var M0=Object.defineProperty;var P0=(s,a,u)=>a in s?M0(s,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):s[a]=u;var k0=(s,a)=>()=>(a||s((a={exports:{}}).exports,a),a.exports);var ei=(s,a,u)=>P0(s,typeof a!="symbol"?a+"":a,u);var C0=k0((exports,module)=>{function _mergeNamespaces(s,a){for(var u=0;u<a.length;u++){const l=a[u];if(typeof l!="string"&&!Array.isArray(l)){for(const f in l)if(f!=="default"&&!(f in s)){const c=Object.getOwnPropertyDescriptor(l,f);c&&Object.defineProperty(s,f,c.get?c:{enumerable:!0,get:()=>l[f]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))l(f);new MutationObserver(f=>{for(const c of f)if(c.type==="childList")for(const h of c.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&l(h)}).observe(document,{childList:!0,subtree:!0});function u(f){const c={};return f.integrity&&(c.integrity=f.integrity),f.referrerPolicy&&(c.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?c.credentials="include":f.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function l(f){if(f.ep)return;f.ep=!0;const c=u(f);fetch(f.href,c)}})();var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function getAugmentedNamespace(s){if(s.__esModule)return s;var a=s.default;if(typeof a=="function"){var u=function l(){return this instanceof l?Reflect.construct(a,arguments,this.constructor):a.apply(this,arguments)};u.prototype=a.prototype}else u={};return Object.defineProperty(u,"__esModule",{value:!0}),Object.keys(s).forEach(function(l){var f=Object.getOwnPropertyDescriptor(s,l);Object.defineProperty(u,l,f.get?f:{enumerable:!0,get:function(){return s[l]}})}),u}var jsxRuntime={exports:{}},reactJsxRuntime_production_min={},react={exports:{}},react_production_min={};/**
 * @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 hasRequiredReact_production_min;function requireReact_production_min(){if(hasRequiredReact_production_min)return react_production_min;hasRequiredReact_production_min=1;var s=Symbol.for("react.element"),a=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),h=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),S=Symbol.iterator;function E(M){return M===null||typeof M!="object"?null:(M=S&&M[S]||M["@@iterator"],typeof M=="function"?M:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,I={};function B(M,W,Y){this.props=M,this.context=W,this.refs=I,this.updater=Y||R}B.prototype.isReactComponent={},B.prototype.setState=function(M,W){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,W,"setState")},B.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function N(){}N.prototype=B.prototype;function D(M,W,Y){this.props=M,this.context=W,this.refs=I,this.updater=Y||R}var G=D.prototype=new N;G.constructor=D,O(G,B.prototype),G.isPureReactComponent=!0;var V=Array.isArray,U=Object.prototype.hasOwnProperty,te={current:null},Z={key:!0,ref:!0,__self:!0,__source:!0};function J(M,W,Y){var ue,ge={},he=null,ae=null;if(W!=null)for(ue in W.ref!==void 0&&(ae=W.ref),W.key!==void 0&&(he=""+W.key),W)U.call(W,ue)&&!Z.hasOwnProperty(ue)&&(ge[ue]=W[ue]);var de=arguments.length-2;if(de===1)ge.children=Y;else if(1<de){for(var pe=Array(de),oe=0;oe<de;oe++)pe[oe]=arguments[oe+2];ge.children=pe}if(M&&M.defaultProps)for(ue in de=M.defaultProps,de)ge[ue]===void 0&&(ge[ue]=de[ue]);return{$$typeof:s,type:M,key:he,ref:ae,props:ge,_owner:te.current}}function Q(M,W){return{$$typeof:s,type:M.type,key:W,ref:M.ref,props:M.props,_owner:M._owner}}function ee(M){return typeof M=="object"&&M!==null&&M.$$typeof===s}function k(M){var W={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(Y){return W[Y]})}var d=/\/+/g;function g(M,W){return typeof M=="object"&&M!==null&&M.key!=null?k(""+M.key):W.toString(36)}function _(M,W,Y,ue,ge){var he=typeof M;(he==="undefined"||he==="boolean")&&(M=null);var ae=!1;if(M===null)ae=!0;else switch(he){case"string":case"number":ae=!0;break;case"object":switch(M.$$typeof){case s:case a:ae=!0}}if(ae)return ae=M,ge=ge(ae),M=ue===""?"."+g(ae,0):ue,V(ge)?(Y="",M!=null&&(Y=M.replace(d,"$&/")+"/"),_(ge,W,Y,"",function(oe){return oe})):ge!=null&&(ee(ge)&&(ge=Q(ge,Y+(!ge.key||ae&&ae.key===ge.key?"":(""+ge.key).replace(d,"$&/")+"/")+M)),W.push(ge)),1;if(ae=0,ue=ue===""?".":ue+":",V(M))for(var de=0;de<M.length;de++){he=M[de];var pe=ue+g(he,de);ae+=_(he,W,Y,pe,ge)}else if(pe=E(M),typeof pe=="function")for(M=pe.call(M),de=0;!(he=M.next()).done;)he=he.value,pe=ue+g(he,de++),ae+=_(he,W,Y,pe,ge);else if(he==="object")throw W=String(M),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.");return ae}function w(M,W,Y){if(M==null)return M;var ue=[],ge=0;return _(M,ue,"","",function(he){return W.call(Y,he,ge++)}),ue}function x(M){if(M._status===-1){var W=M._result;W=W(),W.then(function(Y){(M._status===0||M._status===-1)&&(M._status=1,M._result=Y)},function(Y){(M._status===0||M._status===-1)&&(M._status=2,M._result=Y)}),M._status===-1&&(M._status=0,M._result=W)}if(M._status===1)return M._result.default;throw M._result}var P={current:null},$={transition:null},T={ReactCurrentDispatcher:P,ReactCurrentBatchConfig:$,ReactCurrentOwner:te};function m(){throw Error("act(...) is not supported in production builds of React.")}return react_production_min.Children={map:w,forEach:function(M,W,Y){w(M,function(){W.apply(this,arguments)},Y)},count:function(M){var W=0;return w(M,function(){W++}),W},toArray:function(M){return w(M,function(W){return W})||[]},only:function(M){if(!ee(M))throw Error("React.Children.only expected to receive a single React element child.");return M}},react_production_min.Component=B,react_production_min.Fragment=u,react_production_min.Profiler=f,react_production_min.PureComponent=D,react_production_min.StrictMode=l,react_production_min.Suspense=v,react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=T,react_production_min.act=m,react_production_min.cloneElement=function(M,W,Y){if(M==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+M+".");var ue=O({},M.props),ge=M.key,he=M.ref,ae=M._owner;if(W!=null){if(W.ref!==void 0&&(he=W.ref,ae=te.current),W.key!==void 0&&(ge=""+W.key),M.type&&M.type.defaultProps)var de=M.type.defaultProps;for(pe in W)U.call(W,pe)&&!Z.hasOwnProperty(pe)&&(ue[pe]=W[pe]===void 0&&de!==void 0?de[pe]:W[pe])}var pe=arguments.length-2;if(pe===1)ue.children=Y;else if(1<pe){de=Array(pe);for(var oe=0;oe<pe;oe++)de[oe]=arguments[oe+2];ue.children=de}return{$$typeof:s,type:M.type,key:ge,ref:he,props:ue,_owner:ae}},react_production_min.createContext=function(M){return M={$$typeof:h,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},M.Provider={$$typeof:c,_context:M},M.Consumer=M},react_production_min.createElement=J,react_production_min.createFactory=function(M){var W=J.bind(null,M);return W.type=M,W},react_production_min.createRef=function(){return{current:null}},react_production_min.forwardRef=function(M){return{$$typeof:p,render:M}},react_production_min.isValidElement=ee,react_production_min.lazy=function(M){return{$$typeof:b,_payload:{_status:-1,_result:M},_init:x}},react_production_min.memo=function(M,W){return{$$typeof:y,type:M,compare:W===void 0?null:W}},react_production_min.startTransition=function(M){var W=$.transition;$.transition={};try{M()}finally{$.transition=W}},react_production_min.unstable_act=m,react_production_min.useCallback=function(M,W){return P.current.useCallback(M,W)},react_production_min.useContext=function(M){return P.current.useContext(M)},react_production_min.useDebugValue=function(){},react_production_min.useDeferredValue=function(M){return P.current.useDeferredValue(M)},react_production_min.useEffect=function(M,W){return P.current.useEffect(M,W)},react_production_min.useId=function(){return P.current.useId()},react_production_min.useImperativeHandle=function(M,W,Y){return P.current.useImperativeHandle(M,W,Y)},react_production_min.useInsertionEffect=function(M,W){return P.current.useInsertionEffect(M,W)},react_production_min.useLayoutEffect=function(M,W){return P.current.useLayoutEffect(M,W)},react_production_min.useMemo=function(M,W){return P.current.useMemo(M,W)},react_production_min.useReducer=function(M,W,Y){return P.current.useReducer(M,W,Y)},react_production_min.useRef=function(M){return P.current.useRef(M)},react_production_min.useState=function(M){return P.current.useState(M)},react_production_min.useSyncExternalStore=function(M,W,Y){return P.current.useSyncExternalStore(M,W,Y)},react_production_min.useTransition=function(){return P.current.useTransition()},react_production_min.version="18.3.1",react_production_min}var hasRequiredReact;function requireReact(){return hasRequiredReact||(hasRequiredReact=1,react.exports=requireReact_production_min()),react.exports}/**
 * @license React
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var hasRequiredReactJsxRuntime_production_min;function requireReactJsxRuntime_production_min(){if(hasRequiredReactJsxRuntime_production_min)return reactJsxRuntime_production_min;hasRequiredReactJsxRuntime_production_min=1;var s=requireReact(),a=Symbol.for("react.element"),u=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,f=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function h(p,v,y){var b,S={},E=null,R=null;y!==void 0&&(E=""+y),v.key!==void 0&&(E=""+v.key),v.ref!==void 0&&(R=v.ref);for(b in v)l.call(v,b)&&!c.hasOwnProperty(b)&&(S[b]=v[b]);if(p&&p.defaultProps)for(b in v=p.defaultProps,v)S[b]===void 0&&(S[b]=v[b]);return{$$typeof:a,type:p,key:E,ref:R,props:S,_owner:f.current}}return reactJsxRuntime_production_min.Fragment=u,reactJsxRuntime_production_min.jsx=h,reactJsxRuntime_production_min.jsxs=h,reactJsxRuntime_production_min}var hasRequiredJsxRuntime;function requireJsxRuntime(){return hasRequiredJsxRuntime||(hasRequiredJsxRuntime=1,jsxRuntime.exports=requireReactJsxRuntime_production_min()),jsxRuntime.exports}var jsxRuntimeExports=requireJsxRuntime(),reactExports=requireReact();const React=getDefaultExportFromCjs(reactExports),React$1=_mergeNamespaces({__proto__:null,default:React},[reactExports]);var isDevelopment$5=!1;function sheetForTag(s){if(s.sheet)return s.sheet;for(var a=0;a<document.styleSheets.length;a++)if(document.styleSheets[a].ownerNode===s)return document.styleSheets[a]}function createStyleElement(s){var a=document.createElement("style");return a.setAttribute("data-emotion",s.key),s.nonce!==void 0&&a.setAttribute("nonce",s.nonce),a.appendChild(document.createTextNode("")),a.setAttribute("data-s",""),a}var StyleSheet=function(){function s(u){var l=this;this._insertTag=function(f){var c;l.tags.length===0?l.insertionPoint?c=l.insertionPoint.nextSibling:l.prepend?c=l.container.firstChild:c=l.before:c=l.tags[l.tags.length-1].nextSibling,l.container.insertBefore(f,c),l.tags.push(f)},this.isSpeedy=u.speedy===void 0?!isDevelopment$5:u.speedy,this.tags=[],this.ctr=0,this.nonce=u.nonce,this.key=u.key,this.container=u.container,this.prepend=u.prepend,this.insertionPoint=u.insertionPoint,this.before=null}var a=s.prototype;return a.hydrate=function(l){l.forEach(this._insertTag)},a.insert=function(l){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(createStyleElement(this));var f=this.tags[this.tags.length-1];if(this.isSpeedy){var c=sheetForTag(f);try{c.insertRule(l,c.cssRules.length)}catch{}}else f.appendChild(document.createTextNode(l));this.ctr++},a.flush=function(){this.tags.forEach(function(l){var f;return(f=l.parentNode)==null?void 0:f.removeChild(l)}),this.tags=[],this.ctr=0},s}(),MS="-ms-",MOZ="-moz-",WEBKIT="-webkit-",COMMENT="comm",RULESET="rule",DECLARATION="decl",IMPORT="@import",KEYFRAMES="@keyframes",LAYER="@layer",abs$1=Math.abs,from$1=String.fromCharCode,assign=Object.assign;function hash$5(s,a){return charat(s,0)^45?(((a<<2^charat(s,0))<<2^charat(s,1))<<2^charat(s,2))<<2^charat(s,3):0}function trim(s){return s.trim()}function match(s,a){return(s=a.exec(s))?s[0]:s}function replace(s,a,u){return s.replace(a,u)}function indexof(s,a){return s.indexOf(a)}function charat(s,a){return s.charCodeAt(a)|0}function substr(s,a,u){return s.slice(a,u)}function strlen(s){return s.length}function sizeof(s){return s.length}function append(s,a){return a.push(s),s}function combine(s,a){return s.map(a).join("")}var line=1,column=1,length$1=0,position$1=0,character=0,characters="";function node$4(s,a,u,l,f,c,h){return{value:s,root:a,parent:u,type:l,props:f,children:c,line,column,length:h,return:""}}function copy(s,a){return assign(node$4("",null,null,"",null,null,0),s,{length:-s.length},a)}function char(){return character}function prev$1(){return character=position$1>0?charat(characters,--position$1):0,column--,character===10&&(column=1,line--),character}function next(){return character=position$1<length$1?charat(characters,position$1++):0,column++,character===10&&(column=1,line++),character}function peek(){return charat(characters,position$1)}function caret(){return position$1}function slice(s,a){return substr(characters,s,a)}function token(s){switch(s){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function alloc(s){return line=column=1,length$1=strlen(characters=s),position$1=0,[]}function dealloc(s){return characters="",s}function delimit(s){return trim(slice(position$1-1,delimiter(s===91?s+2:s===40?s+1:s)))}function whitespace(s){for(;(character=peek())&&character<33;)next();return token(s)>2||token(character)>3?"":" "}function escaping(s,a){for(;--a&&next()&&!(character<48||character>102||character>57&&character<65||character>70&&character<97););return slice(s,caret()+(a<6&&peek()==32&&next()==32))}function delimiter(s){for(;next();)switch(character){case s:return position$1;case 34:case 39:s!==34&&s!==39&&delimiter(character);break;case 40:s===41&&delimiter(s);break;case 92:next();break}return position$1}function commenter(s,a){for(;next()&&s+character!==57;)if(s+character===84&&peek()===47)break;return"/*"+slice(a,position$1-1)+"*"+from$1(s===47?s:next())}function identifier(s){for(;!token(peek());)next();return slice(s,position$1)}function compile(s){return dealloc(parse$3("",null,null,null,[""],s=alloc(s),0,[0],s))}function parse$3(s,a,u,l,f,c,h,p,v){for(var y=0,b=0,S=h,E=0,R=0,O=0,I=1,B=1,N=1,D=0,G="",V=f,U=c,te=l,Z=G;B;)switch(O=D,D=next()){case 40:if(O!=108&&charat(Z,S-1)==58){indexof(Z+=replace(delimit(D),"&","&\f"),"&\f")!=-1&&(N=-1);break}case 34:case 39:case 91:Z+=delimit(D);break;case 9:case 10:case 13:case 32:Z+=whitespace(O);break;case 92:Z+=escaping(caret()-1,7);continue;case 47:switch(peek()){case 42:case 47:append(comment$1(commenter(next(),caret()),a,u),v);break;default:Z+="/"}break;case 123*I:p[y++]=strlen(Z)*N;case 125*I:case 59:case 0:switch(D){case 0:case 125:B=0;case 59+b:N==-1&&(Z=replace(Z,/\f/g,"")),R>0&&strlen(Z)-S&&append(R>32?declaration$1(Z+";",l,u,S-1):declaration$1(replace(Z," ","")+";",l,u,S-2),v);break;case 59:Z+=";";default:if(append(te=ruleset(Z,a,u,y,b,f,p,G,V=[],U=[],S),c),D===123)if(b===0)parse$3(Z,a,te,te,V,c,S,p,U);else switch(E===99&&charat(Z,3)===110?100:E){case 100:case 108:case 109:case 115:parse$3(s,te,te,l&&append(ruleset(s,te,te,0,0,f,p,G,f,V=[],S),U),f,U,S,p,l?V:U);break;default:parse$3(Z,te,te,te,[""],U,0,p,U)}}y=b=R=0,I=N=1,G=Z="",S=h;break;case 58:S=1+strlen(Z),R=O;default:if(I<1){if(D==123)--I;else if(D==125&&I++==0&&prev$1()==125)continue}switch(Z+=from$1(D),D*I){case 38:N=b>0?1:(Z+="\f",-1);break;case 44:p[y++]=(strlen(Z)-1)*N,N=1;break;case 64:peek()===45&&(Z+=delimit(next())),E=peek(),b=S=strlen(G=Z+=identifier(caret())),D++;break;case 45:O===45&&strlen(Z)==2&&(I=0)}}return c}function ruleset(s,a,u,l,f,c,h,p,v,y,b){for(var S=f-1,E=f===0?c:[""],R=sizeof(E),O=0,I=0,B=0;O<l;++O)for(var N=0,D=substr(s,S+1,S=abs$1(I=h[O])),G=s;N<R;++N)(G=trim(I>0?E[N]+" "+D:replace(D,/&\f/g,E[N])))&&(v[B++]=G);return node$4(s,a,u,f===0?RULESET:p,v,y,b)}function comment$1(s,a,u){return node$4(s,a,u,COMMENT,from$1(char()),substr(s,2,-2),0)}function declaration$1(s,a,u,l){return node$4(s,a,u,DECLARATION,substr(s,0,l),substr(s,l+1,-1),l)}function serialize(s,a){for(var u="",l=sizeof(s),f=0;f<l;f++)u+=a(s[f],f,s,a)||"";return u}function stringify$4(s,a,u,l){switch(s.type){case LAYER:if(s.children.length)break;case IMPORT:case DECLARATION:return s.return=s.return||s.value;case COMMENT:return"";case KEYFRAMES:return s.return=s.value+"{"+serialize(s.children,l)+"}";case RULESET:s.value=s.props.join(",")}return strlen(u=serialize(s.children,l))?s.return=s.value+"{"+u+"}":""}function middleware(s){var a=sizeof(s);return function(u,l,f,c){for(var h="",p=0;p<a;p++)h+=s[p](u,l,f,c)||"";return h}}function rulesheet(s){return function(a){a.root||(a=a.return)&&s(a)}}var weakMemoize=function(a){var u=new WeakMap;return function(l){if(u.has(l))return u.get(l);var f=a(l);return u.set(l,f),f}};function memoize$2(s){var a=Object.create(null);return function(u){return a[u]===void 0&&(a[u]=s(u)),a[u]}}var identifierWithPointTracking=function(a,u,l){for(var f=0,c=0;f=c,c=peek(),f===38&&c===12&&(u[l]=1),!token(c);)next();return slice(a,position$1)},toRules=function(a,u){var l=-1,f=44;do switch(token(f)){case 0:f===38&&peek()===12&&(u[l]=1),a[l]+=identifierWithPointTracking(position$1-1,u,l);break;case 2:a[l]+=delimit(f);break;case 4:if(f===44){a[++l]=peek()===58?"&\f":"",u[l]=a[l].length;break}default:a[l]+=from$1(f)}while(f=next());return a},getRules=function(a,u){return dealloc(toRules(alloc(a),u))},fixedElements=new WeakMap,compat=function(a){if(!(a.type!=="rule"||!a.parent||a.length<1)){for(var u=a.value,l=a.parent,f=a.column===l.column&&a.line===l.line;l.type!=="rule";)if(l=l.parent,!l)return;if(!(a.props.length===1&&u.charCodeAt(0)!==58&&!fixedElements.get(l))&&!f){fixedElements.set(a,!0);for(var c=[],h=getRules(u,c),p=l.props,v=0,y=0;v<h.length;v++)for(var b=0;b<p.length;b++,y++)a.props[y]=c[v]?h[v].replace(/&\f/g,p[b]):p[b]+" "+h[v]}}},removeLabel=function(a){if(a.type==="decl"){var u=a.value;u.charCodeAt(0)===108&&u.charCodeAt(2)===98&&(a.return="",a.value="")}};function prefix$1(s,a){switch(hash$5(s,a)){case 5103:return WEBKIT+"print-"+s+s;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return WEBKIT+s+s;case 5349:case 4246:case 4810:case 6968:case 2756:return WEBKIT+s+MOZ+s+MS+s+s;case 6828:case 4268:return WEBKIT+s+MS+s+s;case 6165:return WEBKIT+s+MS+"flex-"+s+s;case 5187:return WEBKIT+s+replace(s,/(\w+).+(:[^]+)/,WEBKIT+"box-$1$2"+MS+"flex-$1$2")+s;case 5443:return WEBKIT+s+MS+"flex-item-"+replace(s,/flex-|-self/,"")+s;case 4675:return WEBKIT+s+MS+"flex-line-pack"+replace(s,/align-content|flex-|-self/,"")+s;case 5548:return WEBKIT+s+MS+replace(s,"shrink","negative")+s;case 5292:return WEBKIT+s+MS+replace(s,"basis","preferred-size")+s;case 6060:return WEBKIT+"box-"+replace(s,"-grow","")+WEBKIT+s+MS+replace(s,"grow","positive")+s;case 4554:return WEBKIT+replace(s,/([^-])(transform)/g,"$1"+WEBKIT+"$2")+s;case 6187:return replace(replace(replace(s,/(zoom-|grab)/,WEBKIT+"$1"),/(image-set)/,WEBKIT+"$1"),s,"")+s;case 5495:case 3959:return replace(s,/(image-set\([^]*)/,WEBKIT+"$1$`$1");case 4968:return replace(replace(s,/(.+:)(flex-)?(.*)/,WEBKIT+"box-pack:$3"+MS+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+WEBKIT+s+s;case 4095:case 3583:case 4068:case 2532:return replace(s,/(.+)-inline(.+)/,WEBKIT+"$1$2")+s;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(strlen(s)-1-a>6)switch(charat(s,a+1)){case 109:if(charat(s,a+4)!==45)break;case 102:return replace(s,/(.+:)(.+)-([^]+)/,"$1"+WEBKIT+"$2-$3$1"+MOZ+(charat(s,a+3)==108?"$3":"$2-$3"))+s;case 115:return~indexof(s,"stretch")?prefix$1(replace(s,"stretch","fill-available"),a)+s:s}break;case 4949:if(charat(s,a+1)!==115)break;case 6444:switch(charat(s,strlen(s)-3-(~indexof(s,"!important")&&10))){case 107:return replace(s,":",":"+WEBKIT)+s;case 101:return replace(s,/(.+:)([^;!]+)(;|!.+)?/,"$1"+WEBKIT+(charat(s,14)===45?"inline-":"")+"box$3$1"+WEBKIT+"$2$3$1"+MS+"$2box$3")+s}break;case 5936:switch(charat(s,a+11)){case 114:return WEBKIT+s+MS+replace(s,/[svh]\w+-[tblr]{2}/,"tb")+s;case 108:return WEBKIT+s+MS+replace(s,/[svh]\w+-[tblr]{2}/,"tb-rl")+s;case 45:return WEBKIT+s+MS+replace(s,/[svh]\w+-[tblr]{2}/,"lr")+s}return WEBKIT+s+MS+s+s}return s}var prefixer=function(a,u,l,f){if(a.length>-1&&!a.return)switch(a.type){case DECLARATION:a.return=prefix$1(a.value,a.length);break;case KEYFRAMES:return serialize([copy(a,{value:replace(a.value,"@","@"+WEBKIT)})],f);case RULESET:if(a.length)return combine(a.props,function(c){switch(match(c,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return serialize([copy(a,{props:[replace(c,/:(read-\w+)/,":"+MOZ+"$1")]})],f);case"::placeholder":return serialize([copy(a,{props:[replace(c,/:(plac\w+)/,":"+WEBKIT+"input-$1")]}),copy(a,{props:[replace(c,/:(plac\w+)/,":"+MOZ+"$1")]}),copy(a,{props:[replace(c,/:(plac\w+)/,MS+"input-$1")]})],f)}return""})}},defaultStylisPlugins=[prefixer],createCache=function(a){var u=a.key;if(u==="css"){var l=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(l,function(I){var B=I.getAttribute("data-emotion");B.indexOf(" ")!==-1&&(document.head.appendChild(I),I.setAttribute("data-s",""))})}var f=a.stylisPlugins||defaultStylisPlugins,c={},h,p=[];h=a.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+u+' "]'),function(I){for(var B=I.getAttribute("data-emotion").split(" "),N=1;N<B.length;N++)c[B[N]]=!0;p.push(I)});var v,y=[compat,removeLabel];{var b,S=[stringify$4,rulesheet(function(I){b.insert(I)})],E=middleware(y.concat(f,S)),R=function(B){return serialize(compile(B),E)};v=function(B,N,D,G){b=D,R(B?B+"{"+N.styles+"}":N.styles),G&&(O.inserted[N.name]=!0)}}var O={key:u,sheet:new StyleSheet({key:u,container:h,nonce:a.nonce,speedy:a.speedy,prepend:a.prepend,insertionPoint:a.insertionPoint}),nonce:a.nonce,inserted:c,registered:{},insert:v};return O.sheet.hydrate(p),O};function _extends(){return _extends=Object.assign?Object.assign.bind():function(s){for(var a=1;a<arguments.length;a++){var u=arguments[a];for(var l in u)({}).hasOwnProperty.call(u,l)&&(s[l]=u[l])}return s},_extends.apply(null,arguments)}var reactIs={exports:{}},reactIs_production_min={};/** @license React v16.13.1
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var hasRequiredReactIs_production_min;function requireReactIs_production_min(){if(hasRequiredReactIs_production_min)return reactIs_production_min;hasRequiredReactIs_production_min=1;var s=typeof Symbol=="function"&&Symbol.for,a=s?Symbol.for("react.element"):60103,u=s?Symbol.for("react.portal"):60106,l=s?Symbol.for("react.fragment"):60107,f=s?Symbol.for("react.strict_mode"):60108,c=s?Symbol.for("react.profiler"):60114,h=s?Symbol.for("react.provider"):60109,p=s?Symbol.for("react.context"):60110,v=s?Symbol.for("react.async_mode"):60111,y=s?Symbol.for("react.concurrent_mode"):60111,b=s?Symbol.for("react.forward_ref"):60112,S=s?Symbol.for("react.suspense"):60113,E=s?Symbol.for("react.suspense_list"):60120,R=s?Symbol.for("react.memo"):60115,O=s?Symbol.for("react.lazy"):60116,I=s?Symbol.for("react.block"):60121,B=s?Symbol.for("react.fundamental"):60117,N=s?Symbol.for("react.responder"):60118,D=s?Symbol.for("react.scope"):60119;function G(U){if(typeof U=="object"&&U!==null){var te=U.$$typeof;switch(te){case a:switch(U=U.type,U){case v:case y:case l:case c:case f:case S:return U;default:switch(U=U&&U.$$typeof,U){case p:case b:case O:case R:case h:return U;default:return te}}case u:return te}}}function V(U){return G(U)===y}return reactIs_production_min.AsyncMode=v,reactIs_production_min.ConcurrentMode=y,reactIs_production_min.ContextConsumer=p,reactIs_production_min.ContextProvider=h,reactIs_production_min.Element=a,reactIs_production_min.ForwardRef=b,reactIs_production_min.Fragment=l,reactIs_production_min.Lazy=O,reactIs_production_min.Memo=R,reactIs_production_min.Portal=u,reactIs_production_min.Profiler=c,reactIs_production_min.StrictMode=f,reactIs_production_min.Suspense=S,reactIs_production_min.isAsyncMode=function(U){return V(U)||G(U)===v},reactIs_production_min.isConcurrentMode=V,reactIs_production_min.isContextConsumer=function(U){return G(U)===p},reactIs_production_min.isContextProvider=function(U){return G(U)===h},reactIs_production_min.isElement=function(U){return typeof U=="object"&&U!==null&&U.$$typeof===a},reactIs_production_min.isForwardRef=function(U){return G(U)===b},reactIs_production_min.isFragment=function(U){return G(U)===l},reactIs_production_min.isLazy=function(U){return G(U)===O},reactIs_production_min.isMemo=function(U){return G(U)===R},reactIs_production_min.isPortal=function(U){return G(U)===u},reactIs_production_min.isProfiler=function(U){return G(U)===c},reactIs_production_min.isStrictMode=function(U){return G(U)===f},reactIs_production_min.isSuspense=function(U){return G(U)===S},reactIs_production_min.isValidElementType=function(U){return typeof U=="string"||typeof U=="function"||U===l||U===y||U===c||U===f||U===S||U===E||typeof U=="object"&&U!==null&&(U.$$typeof===O||U.$$typeof===R||U.$$typeof===h||U.$$typeof===p||U.$$typeof===b||U.$$typeof===B||U.$$typeof===N||U.$$typeof===D||U.$$typeof===I)},reactIs_production_min.typeOf=G,reactIs_production_min}var hasRequiredReactIs;function requireReactIs(){return hasRequiredReactIs||(hasRequiredReactIs=1,reactIs.exports=requireReactIs_production_min()),reactIs.exports}var hoistNonReactStatics_cjs,hasRequiredHoistNonReactStatics_cjs;function requireHoistNonReactStatics_cjs(){if(hasRequiredHoistNonReactStatics_cjs)return hoistNonReactStatics_cjs;hasRequiredHoistNonReactStatics_cjs=1;var s=requireReactIs(),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},u={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},l={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},f={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},c={};c[s.ForwardRef]=l,c[s.Memo]=f;function h(O){return s.isMemo(O)?f:c[O.$$typeof]||a}var p=Object.defineProperty,v=Object.getOwnPropertyNames,y=Object.getOwnPropertySymbols,b=Object.getOwnPropertyDescriptor,S=Object.getPrototypeOf,E=Object.prototype;function R(O,I,B){if(typeof I!="string"){if(E){var N=S(I);N&&N!==E&&R(O,N,B)}var D=v(I);y&&(D=D.concat(y(I)));for(var G=h(O),V=h(I),U=0;U<D.length;++U){var te=D[U];if(!u[te]&&!(B&&B[te])&&!(V&&V[te])&&!(G&&G[te])){var Z=b(I,te);try{p(O,te,Z)}catch{}}}}return O}return hoistNonReactStatics_cjs=R,hoistNonReactStatics_cjs}requireHoistNonReactStatics_cjs();var isBrowser$4=!0;function getRegisteredStyles(s,a,u){var l="";return u.split(" ").forEach(function(f){s[f]!==void 0?a.push(s[f]+";"):f&&(l+=f+" ")}),l}var registerStyles=function(a,u,l){var f=a.key+"-"+u.name;(l===!1||isBrowser$4===!1)&&a.registered[f]===void 0&&(a.registered[f]=u.styles)},insertStyles=function(a,u,l){registerStyles(a,u,l);var f=a.key+"-"+u.name;if(a.inserted[u.name]===void 0){var c=u;do a.insert(u===c?"."+f:"",c,a.sheet,!0),c=c.next;while(c!==void 0)}};function murmur2(s){for(var a=0,u,l=0,f=s.length;f>=4;++l,f-=4)u=s.charCodeAt(l)&255|(s.charCodeAt(++l)&255)<<8|(s.charCodeAt(++l)&255)<<16|(s.charCodeAt(++l)&255)<<24,u=(u&65535)*1540483477+((u>>>16)*59797<<16),u^=u>>>24,a=(u&65535)*1540483477+((u>>>16)*59797<<16)^(a&65535)*1540483477+((a>>>16)*59797<<16);switch(f){case 3:a^=(s.charCodeAt(l+2)&255)<<16;case 2:a^=(s.charCodeAt(l+1)&255)<<8;case 1:a^=s.charCodeAt(l)&255,a=(a&65535)*1540483477+((a>>>16)*59797<<16)}return a^=a>>>13,a=(a&65535)*1540483477+((a>>>16)*59797<<16),((a^a>>>15)>>>0).toString(36)}var unitlessKeys={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,scale: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},isDevelopment$4=!1,hyphenateRegex=/[A-Z]|^ms/g,animationRegex=/_EMO_([^_]+?)_([^]*?)_EMO_/g,isCustomProperty=function(a){return a.charCodeAt(1)===45},isProcessableValue=function(a){return a!=null&&typeof a!="boolean"},processStyleName=memoize$2(function(s){return isCustomProperty(s)?s:s.replace(hyphenateRegex,"-$&").toLowerCase()}),processStyleValue=function(a,u){switch(a){case"animation":case"animationName":if(typeof u=="string")return u.replace(animationRegex,function(l,f,c){return cursor={name:f,styles:c,next:cursor},f})}return unitlessKeys[a]!==1&&!isCustomProperty(a)&&typeof u=="number"&&u!==0?u+"px":u},noComponentSelectorMessage="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function handleInterpolation(s,a,u){if(u==null)return"";var l=u;if(l.__emotion_styles!==void 0)return l;switch(typeof u){case"boolean":return"";case"object":{var f=u;if(f.anim===1)return cursor={name:f.name,styles:f.styles,next:cursor},f.name;var c=u;if(c.styles!==void 0){var h=c.next;if(h!==void 0)for(;h!==void 0;)cursor={name:h.name,styles:h.styles,next:cursor},h=h.next;var p=c.styles+";";return p}return createStringFromObject(s,a,u)}case"function":{if(s!==void 0){var v=cursor,y=u(s);return cursor=v,handleInterpolation(s,a,y)}break}}var b=u;if(a==null)return b;var S=a[b];return S!==void 0?S:b}function createStringFromObject(s,a,u){var l="";if(Array.isArray(u))for(var f=0;f<u.length;f++)l+=handleInterpolation(s,a,u[f])+";";else for(var c in u){var h=u[c];if(typeof h!="object"){var p=h;a!=null&&a[p]!==void 0?l+=c+"{"+a[p]+"}":isProcessableValue(p)&&(l+=processStyleName(c)+":"+processStyleValue(c,p)+";")}else{if(c==="NO_COMPONENT_SELECTOR"&&isDevelopment$4)throw new Error(noComponentSelectorMessage);if(Array.isArray(h)&&typeof h[0]=="string"&&(a==null||a[h[0]]===void 0))for(var v=0;v<h.length;v++)isProcessableValue(h[v])&&(l+=processStyleName(c)+":"+processStyleValue(c,h[v])+";");else{var y=handleInterpolation(s,a,h);switch(c){case"animation":case"animationName":{l+=processStyleName(c)+":"+y+";";break}default:l+=c+"{"+y+"}"}}}}return l}var labelPattern=/label:\s*([^\s;{]+)\s*(;|$)/g,cursor;function serializeStyles(s,a,u){if(s.length===1&&typeof s[0]=="object"&&s[0]!==null&&s[0].styles!==void 0)return s[0];var l=!0,f="";cursor=void 0;var c=s[0];if(c==null||c.raw===void 0)l=!1,f+=handleInterpolation(u,a,c);else{var h=c;f+=h[0]}for(var p=1;p<s.length;p++)if(f+=handleInterpolation(u,a,s[p]),l){var v=c;f+=v[p]}labelPattern.lastIndex=0;for(var y="",b;(b=labelPattern.exec(f))!==null;)y+="-"+b[1];var S=murmur2(f)+y;return{name:S,styles:f,next:cursor}}var syncFallback=function(a){return a()},useInsertionEffect=React$1.useInsertionEffect?React$1.useInsertionEffect:!1,useInsertionEffectAlwaysWithSyncFallback=useInsertionEffect||syncFallback,useInsertionEffectWithLayoutFallback=useInsertionEffect||reactExports.useLayoutEffect,isDevelopment$3=!1,EmotionCacheContext=reactExports.createContext(typeof HTMLElement<"u"?createCache({key:"css"}):null);EmotionCacheContext.Provider;var withEmotionCache=function(a){return reactExports.forwardRef(function(u,l){var f=reactExports.useContext(EmotionCacheContext);return a(u,f,l)})},ThemeContext=reactExports.createContext({}),getTheme$1=function(a,u){if(typeof u=="function"){var l=u(a);return l}return _extends({},a,u)},createCacheWithTheme=weakMemoize(function(s){return weakMemoize(function(a){return getTheme$1(s,a)})}),ThemeProvider$1=function(a){var u=reactExports.useContext(ThemeContext);return a.theme!==u&&(u=createCacheWithTheme(u)(a.theme)),reactExports.createElement(ThemeContext.Provider,{value:u},a.children)},hasOwn={}.hasOwnProperty,typePropName="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",createEmotionProps=function(a,u){var l={};for(var f in u)hasOwn.call(u,f)&&(l[f]=u[f]);return l[typePropName]=a,l},Insertion$1=function(a){var u=a.cache,l=a.serialized,f=a.isStringTag;return registerStyles(u,l,f),useInsertionEffectAlwaysWithSyncFallback(function(){return insertStyles(u,l,f)}),null},Emotion=withEmotionCache(function(s,a,u){var l=s.css;typeof l=="string"&&a.registered[l]!==void 0&&(l=a.registered[l]);var f=s[typePropName],c=[l],h="";typeof s.className=="string"?h=getRegisteredStyles(a.registered,c,s.className):s.className!=null&&(h=s.className+" ");var p=serializeStyles(c,void 0,reactExports.useContext(ThemeContext));h+=a.key+"-"+p.name;var v={};for(var y in s)hasOwn.call(s,y)&&y!=="css"&&y!==typePropName&&!isDevelopment$3&&(v[y]=s[y]);return v.className=h,u&&(v.ref=u),reactExports.createElement(reactExports.Fragment,null,reactExports.createElement(Insertion$1,{cache:a,serialized:p,isStringTag:typeof f=="string"}),reactExports.createElement(f,v))}),Emotion$1=Emotion,jsx=function(a,u){var l=arguments;if(u==null||!hasOwn.call(u,"css"))return reactExports.createElement.apply(void 0,l);var f=l.length,c=new Array(f);c[0]=Emotion$1,c[1]=createEmotionProps(a,u);for(var h=2;h<f;h++)c[h]=l[h];return reactExports.createElement.apply(null,c)};(function(s){var a;a||(a=s.JSX||(s.JSX={}))})(jsx||(jsx={}));var Global=withEmotionCache(function(s,a){var u=s.styles,l=serializeStyles([u],void 0,reactExports.useContext(ThemeContext)),f=reactExports.useRef();return useInsertionEffectWithLayoutFallback(function(){var c=a.key+"-global",h=new a.sheet.constructor({key:c,nonce:a.sheet.nonce,container:a.sheet.container,speedy:a.sheet.isSpeedy}),p=!1,v=document.querySelector('style[data-emotion="'+c+" "+l.name+'"]');return a.sheet.tags.length&&(h.before=a.sheet.tags[0]),v!==null&&(p=!0,v.setAttribute("data-emotion",c),h.hydrate([v])),f.current=[h,p],function(){h.flush()}},[a]),useInsertionEffectWithLayoutFallback(function(){var c=f.current,h=c[0],p=c[1];if(p){c[1]=!1;return}if(l.next!==void 0&&insertStyles(a,l.next,!0),h.tags.length){var v=h.tags[h.tags.length-1].nextElementSibling;h.before=v,h.flush()}a.insert("",l,h,!1)},[a,l.name]),null});function css$2(){for(var s=arguments.length,a=new Array(s),u=0;u<s;u++)a[u]=arguments[u];return serializeStyles(a)}function keyframes$1(){var s=css$2.apply(void 0,arguments),a="animation-"+s.name;return{name:a,styles:"@keyframes "+a+"{"+s.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}var css$1=String.raw,vhPolyfill=css$1`
  :root,
  :host {
    --chakra-vh: 100vh;
  }

  @supports (height: -webkit-fill-available) {
    :root,
    :host {
      --chakra-vh: -webkit-fill-available;
    }
  }

  @supports (height: -moz-fill-available) {
    :root,
    :host {
      --chakra-vh: -moz-fill-available;
    }
  }

  @supports (height: 100dvh) {
    :root,
    :host {
      --chakra-vh: 100dvh;
    }
  }
`,CSSPolyfill=()=>jsxRuntimeExports.jsx(Global,{styles:vhPolyfill}),CSSReset=({scope:s=""})=>jsxRuntimeExports.jsx(Global,{styles:css$1`
      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";
      }

      ${s} :where(*, *::before, *::after) {
        border-width: 0;
        border-style: solid;
        box-sizing: border-box;
        word-wrap: break-word;
      }

      main {
        display: block;
      }

      ${s} hr {
        border-top-width: 1px;
        box-sizing: content-box;
        height: 0;
        overflow: visible;
      }

      ${s} :where(pre, code, kbd,samp) {
        font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
        font-size: 1em;
      }

      ${s} a {
        background-color: transparent;
        color: inherit;
        text-decoration: inherit;
      }

      ${s} abbr[title] {
        border-bottom: none;
        text-decoration: underline;
        -webkit-text-decoration: underline dotted;
        text-decoration: underline dotted;
      }

      ${s} :where(b, strong) {
        font-weight: bold;
      }

      ${s} small {
        font-size: 80%;
      }

      ${s} :where(sub,sup) {
        font-size: 75%;
        line-height: 0;
        position: relative;
        vertical-align: baseline;
      }

      ${s} sub {
        bottom: -0.25em;
      }

      ${s} sup {
        top: -0.5em;
      }

      ${s} img {
        border-style: none;
      }

      ${s} :where(button, input, optgroup, select, textarea) {
        font-family: inherit;
        font-size: 100%;
        line-height: 1.15;
        margin: 0;
      }

      ${s} :where(button, input) {
        overflow: visible;
      }

      ${s} :where(button, select) {
        text-transform: none;
      }

      ${s} :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;
      }

      ${s} fieldset {
        padding: 0.35em 0.75em 0.625em;
      }

      ${s} legend {
        box-sizing: border-box;
        color: inherit;
        display: table;
        max-width: 100%;
        padding: 0;
        white-space: normal;
      }

      ${s} progress {
        vertical-align: baseline;
      }

      ${s} textarea {
        overflow: auto;
      }

      ${s} :where([type="checkbox"], [type="radio"]) {
        box-sizing: border-box;
        padding: 0;
      }

      ${s} input[type="number"]::-webkit-inner-spin-button,
      ${s} input[type="number"]::-webkit-outer-spin-button {
        -webkit-appearance: none !important;
      }

      ${s} input[type="number"] {
        -moz-appearance: textfield;
      }

      ${s} input[type="search"] {
        -webkit-appearance: textfield;
        outline-offset: -2px;
      }

      ${s} input[type="search"]::-webkit-search-decoration {
        -webkit-appearance: none !important;
      }

      ${s} ::-webkit-file-upload-button {
        -webkit-appearance: button;
        font: inherit;
      }

      ${s} details {
        display: block;
      }

      ${s} summary {
        display: list-item;
      }

      template {
        display: none;
      }

      [hidden] {
        display: none !important;
      }

      ${s} :where(
          blockquote,
          dl,
          dd,
          h1,
          h2,
          h3,
          h4,
          h5,
          h6,
          hr,
          figure,
          p,
          pre
        ) {
        margin: 0;
      }

      ${s} button {
        background: transparent;
        padding: 0;
      }

      ${s} fieldset {
        margin: 0;
        padding: 0;
      }

      ${s} :where(ol, ul) {
        margin: 0;
        padding: 0;
      }

      ${s} textarea {
        resize: vertical;
      }

      ${s} :where(button, [role="button"]) {
        cursor: pointer;
      }

      ${s} button::-moz-focus-inner {
        border: 0 !important;
      }

      ${s} table {
        border-collapse: collapse;
      }

      ${s} :where(h1, h2, h3, h4, h5, h6) {
        font-size: inherit;
        font-weight: inherit;
      }

      ${s} :where(button, input, optgroup, select, textarea) {
        padding: 0;
        line-height: inherit;
        color: inherit;
      }

      ${s} :where(img, svg, video, canvas, audio, iframe, embed, object) {
        display: block;
      }

      ${s} :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;
      }

      ${s} select::-ms-expand {
        display: none;
      }

      ${vhPolyfill}
    `});function getErrorMessage(s,a){return`${s} returned \`undefined\`. Seems you forgot to wrap component within ${a}`}function createContext$1(s={}){const{name:a,strict:u=!0,hookName:l="useContext",providerName:f="Provider",errorMessage:c,defaultValue:h}=s,p=reactExports.createContext(h);p.displayName=a;function v(){var y;const b=reactExports.useContext(p);if(!b&&u){const S=new Error(c??getErrorMessage(l,f));throw S.name="ContextError",(y=Error.captureStackTrace)==null||y.call(Error,S,v),S}return b}return[p.Provider,v,p]}var[PortalManagerContextProvider,usePortalManager]=createContext$1({strict:!1,name:"PortalManagerContext"});function PortalManager(s){const{children:a,zIndex:u}=s;return jsxRuntimeExports.jsx(PortalManagerContextProvider,{value:{zIndex:u},children:a})}PortalManager.displayName="PortalManager";var useSafeLayoutEffect$2=globalThis!=null&&globalThis.document?reactExports.useLayoutEffect:reactExports.useEffect,reactDom={exports:{}},reactDom_production_min={},scheduler={exports:{}},scheduler_production_min={};/**
 * @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.
 */var hasRequiredScheduler_production_min;function requireScheduler_production_min(){return hasRequiredScheduler_production_min||(hasRequiredScheduler_production_min=1,function(s){function a($,T){var m=$.length;$.push(T);e:for(;0<m;){var M=m-1>>>1,W=$[M];if(0<f(W,T))$[M]=T,$[m]=W,m=M;else break e}}function u($){return $.length===0?null:$[0]}function l($){if($.length===0)return null;var T=$[0],m=$.pop();if(m!==T){$[0]=m;e:for(var M=0,W=$.length,Y=W>>>1;M<Y;){var ue=2*(M+1)-1,ge=$[ue],he=ue+1,ae=$[he];if(0>f(ge,m))he<W&&0>f(ae,ge)?($[M]=ae,$[he]=m,M=he):($[M]=ge,$[ue]=m,M=ue);else if(he<W&&0>f(ae,m))$[M]=ae,$[he]=m,M=he;else break e}}return T}function f($,T){var m=$.sortIndex-T.sortIndex;return m!==0?m:$.id-T.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;s.unstable_now=function(){return c.now()}}else{var h=Date,p=h.now();s.unstable_now=function(){return h.now()-p}}var v=[],y=[],b=1,S=null,E=3,R=!1,O=!1,I=!1,B=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G($){for(var T=u(y);T!==null;){if(T.callback===null)l(y);else if(T.startTime<=$)l(y),T.sortIndex=T.expirationTime,a(v,T);else break;T=u(y)}}function V($){if(I=!1,G($),!O)if(u(v)!==null)O=!0,x(U);else{var T=u(y);T!==null&&P(V,T.startTime-$)}}function U($,T){O=!1,I&&(I=!1,N(J),J=-1),R=!0;var m=E;try{for(G(T),S=u(v);S!==null&&(!(S.expirationTime>T)||$&&!k());){var M=S.callback;if(typeof M=="function"){S.callback=null,E=S.priorityLevel;var W=M(S.expirationTime<=T);T=s.unstable_now(),typeof W=="function"?S.callback=W:S===u(v)&&l(v),G(T)}else l(v);S=u(v)}if(S!==null)var Y=!0;else{var ue=u(y);ue!==null&&P(V,ue.startTime-T),Y=!1}return Y}finally{S=null,E=m,R=!1}}var te=!1,Z=null,J=-1,Q=5,ee=-1;function k(){return!(s.unstable_now()-ee<Q)}function d(){if(Z!==null){var $=s.unstable_now();ee=$;var T=!0;try{T=Z(!0,$)}finally{T?g():(te=!1,Z=null)}}else te=!1}var g;if(typeof D=="function")g=function(){D(d)};else if(typeof MessageChannel<"u"){var _=new MessageChannel,w=_.port2;_.port1.onmessage=d,g=function(){w.postMessage(null)}}else g=function(){B(d,0)};function x($){Z=$,te||(te=!0,g())}function P($,T){J=B(function(){$(s.unstable_now())},T)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function($){$.callback=null},s.unstable_continueExecution=function(){O||R||(O=!0,x(U))},s.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Q=0<$?Math.floor(1e3/$):5},s.unstable_getCurrentPriorityLevel=function(){return E},s.unstable_getFirstCallbackNode=function(){return u(v)},s.unstable_next=function($){switch(E){case 1:case 2:case 3:var T=3;break;default:T=E}var m=E;E=T;try{return $()}finally{E=m}},s.unstable_pauseExecution=function(){},s.unstable_requestPaint=function(){},s.unstable_runWithPriority=function($,T){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var m=E;E=$;try{return T()}finally{E=m}},s.unstable_scheduleCallback=function($,T,m){var M=s.unstable_now();switch(typeof m=="object"&&m!==null?(m=m.delay,m=typeof m=="number"&&0<m?M+m:M):m=M,$){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=m+W,$={id:b++,callback:T,priorityLevel:$,startTime:m,expirationTime:W,sortIndex:-1},m>M?($.sortIndex=m,a(y,$),u(v)===null&&$===u(y)&&(I?(N(J),J=-1):I=!0,P(V,m-M))):($.sortIndex=W,a(v,$),O||R||(O=!0,x(U))),$},s.unstable_shouldYield=k,s.unstable_wrapCallback=function($){var T=E;return function(){var m=E;E=T;try{return $.apply(this,arguments)}finally{E=m}}}}(scheduler_production_min)),scheduler_production_min}var hasRequiredScheduler;function requireScheduler(){return hasRequiredScheduler||(hasRequiredScheduler=1,scheduler.exports=requireScheduler_production_min()),scheduler.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 hasRequiredReactDom_production_min;function requireReactDom_production_min(){if(hasRequiredReactDom_production_min)return reactDom_production_min;hasRequiredReactDom_production_min=1;var s=requireReact(),a=requireScheduler();function u(A){for(var C="https://reactjs.org/docs/error-decoder.html?invariant="+A,F=1;F<arguments.length;F++)C+="&args[]="+encodeURIComponent(arguments[F]);return"Minified React error #"+A+"; visit "+C+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=new Set,f={};function c(A,C){h(A,C),h(A+"Capture",C)}function h(A,C){for(f[A]=C,A=0;A<C.length;A++)l.add(C[A])}var p=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),v=Object.prototype.hasOwnProperty,y=/^[: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]*$/,b={},S={};function E(A){return v.call(S,A)?!0:v.call(b,A)?!1:y.test(A)?S[A]=!0:(b[A]=!0,!1)}function R(A,C,F,ne){if(F!==null&&F.type===0)return!1;switch(typeof C){case"function":case"symbol":return!0;case"boolean":return ne?!1:F!==null?!F.acceptsBooleans:(A=A.toLowerCase().slice(0,5),A!=="data-"&&A!=="aria-");default:return!1}}function O(A,C,F,ne){if(C===null||typeof C>"u"||R(A,C,F,ne))return!0;if(ne)return!1;if(F!==null)switch(F.type){case 3:return!C;case 4:return C===!1;case 5:return isNaN(C);case 6:return isNaN(C)||1>C}return!1}function I(A,C,F,ne,fe,ve,Ae){this.acceptsBooleans=C===2||C===3||C===4,this.attributeName=ne,this.attributeNamespace=fe,this.mustUseProperty=F,this.propertyName=A,this.type=C,this.sanitizeURL=ve,this.removeEmptyString=Ae}var B={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(A){B[A]=new I(A,0,!1,A,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(A){var C=A[0];B[C]=new I(C,1,!1,A[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(A){B[A]=new I(A,2,!1,A.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(A){B[A]=new I(A,2,!1,A,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(A){B[A]=new I(A,3,!1,A.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(A){B[A]=new I(A,3,!0,A,null,!1,!1)}),["capture","download"].forEach(function(A){B[A]=new I(A,4,!1,A,null,!1,!1)}),["cols","rows","size","span"].forEach(function(A){B[A]=new I(A,6,!1,A,null,!1,!1)}),["rowSpan","start"].forEach(function(A){B[A]=new I(A,5,!1,A.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function D(A){return A[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(A){var C=A.replace(N,D);B[C]=new I(C,1,!1,A,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(A){var C=A.replace(N,D);B[C]=new I(C,1,!1,A,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(A){var C=A.replace(N,D);B[C]=new I(C,1,!1,A,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(A){B[A]=new I(A,1,!1,A.toLowerCase(),null,!1,!1)}),B.xlinkHref=new I("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(A){B[A]=new I(A,1,!1,A.toLowerCase(),null,!0,!0)});function G(A,C,F,ne){var fe=B.hasOwnProperty(C)?B[C]:null;(fe!==null?fe.type!==0:ne||!(2<C.length)||C[0]!=="o"&&C[0]!=="O"||C[1]!=="n"&&C[1]!=="N")&&(O(C,F,fe,ne)&&(F=null),ne||fe===null?E(C)&&(F===null?A.removeAttribute(C):A.setAttribute(C,""+F)):fe.mustUseProperty?A[fe.propertyName]=F===null?fe.type===3?!1:"":F:(C=fe.attributeName,ne=fe.attributeNamespace,F===null?A.removeAttribute(C):(fe=fe.type,F=fe===3||fe===4&&F===!0?"":""+F,ne?A.setAttributeNS(ne,C,F):A.setAttribute(C,F))))}var V=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,U=Symbol.for("react.element"),te=Symbol.for("react.portal"),Z=Symbol.for("react.fragment"),J=Symbol.for("react.strict_mode"),Q=Symbol.for("react.profiler"),ee=Symbol.for("react.provider"),k=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),P=Symbol.for("react.offscreen"),$=Symbol.iterator;function T(A){return A===null||typeof A!="object"?null:(A=$&&A[$]||A["@@iterator"],typeof A=="function"?A:null)}var m=Object.assign,M;function W(A){if(M===void 0)try{throw Error()}catch(F){var C=F.stack.trim().match(/\n( *(at )?)/);M=C&&C[1]||""}return`
`+M+A}var Y=!1;function ue(A,C){if(!A||Y)return"";Y=!0;var F=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(C)if(C=function(){throw Error()},Object.defineProperty(C.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(C,[])}catch(gt){var ne=gt}Reflect.construct(A,[],C)}else{try{C.call()}catch(gt){ne=gt}A.call(C.prototype)}else{try{throw Error()}catch(gt){ne=gt}A()}}catch(gt){if(gt&&ne&&typeof gt.stack=="string"){for(var fe=gt.stack.split(`
`),ve=ne.stack.split(`
`),Ae=fe.length-1,Be=ve.length-1;1<=Ae&&0<=Be&&fe[Ae]!==ve[Be];)Be--;for(;1<=Ae&&0<=Be;Ae--,Be--)if(fe[Ae]!==ve[Be]){if(Ae!==1||Be!==1)do if(Ae--,Be--,0>Be||fe[Ae]!==ve[Be]){var Ve=`
`+fe[Ae].replace(" at new "," at ");return A.displayName&&Ve.includes("<anonymous>")&&(Ve=Ve.replace("<anonymous>",A.displayName)),Ve}while(1<=Ae&&0<=Be);break}}}finally{Y=!1,Error.prepareStackTrace=F}return(A=A?A.displayName||A.name:"")?W(A):""}function ge(A){switch(A.tag){case 5:return W(A.type);case 16:return W("Lazy");case 13:return W("Suspense");case 19:return W("SuspenseList");case 0:case 2:case 15:return A=ue(A.type,!1),A;case 11:return A=ue(A.type.render,!1),A;case 1:return A=ue(A.type,!0),A;default:return""}}function he(A){if(A==null)return null;if(typeof A=="function")return A.displayName||A.name||null;if(typeof A=="string")return A;switch(A){case Z:return"Fragment";case te:return"Portal";case Q:return"Profiler";case J:return"StrictMode";case g:return"Suspense";case _:return"SuspenseList"}if(typeof A=="object")switch(A.$$typeof){case k:return(A.displayName||"Context")+".Consumer";case ee:return(A._context.displayName||"Context")+".Provider";case d:var C=A.render;return A=A.displayName,A||(A=C.displayName||C.name||"",A=A!==""?"ForwardRef("+A+")":"ForwardRef"),A;case w:return C=A.displayName||null,C!==null?C:he(A.type)||"Memo";case x:C=A._payload,A=A._init;try{return he(A(C))}catch{}}return null}function ae(A){var C=A.type;switch(A.tag){case 24:return"Cache";case 9:return(C.displayName||"Context")+".Consumer";case 10:return(C._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return A=C.render,A=A.displayName||A.name||"",C.displayName||(A!==""?"ForwardRef("+A+")":"ForwardRef");case 7:return"Fragment";case 5:return C;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return he(C);case 8:return C===J?"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 C=="function")return C.displayName||C.name||null;if(typeof C=="string")return C}return null}function de(A){switch(typeof A){case"boolean":case"number":case"string":case"undefined":return A;case"object":return A;default:return""}}function pe(A){var C=A.type;return(A=A.nodeName)&&A.toLowerCase()==="input"&&(C==="checkbox"||C==="radio")}function oe(A){var C=pe(A)?"checked":"value",F=Object.getOwnPropertyDescriptor(A.constructor.prototype,C),ne=""+A[C];if(!A.hasOwnProperty(C)&&typeof F<"u"&&typeof F.get=="function"&&typeof F.set=="function"){var fe=F.get,ve=F.set;return Object.defineProperty(A,C,{configurable:!0,get:function(){return fe.call(this)},set:function(Ae){ne=""+Ae,ve.call(this,Ae)}}),Object.defineProperty(A,C,{enumerable:F.enumerable}),{getValue:function(){return ne},setValue:function(Ae){ne=""+Ae},stopTracking:function(){A._valueTracker=null,delete A[C]}}}}function le(A){A._valueTracker||(A._valueTracker=oe(A))}function me(A){if(!A)return!1;var C=A._valueTracker;if(!C)return!0;var F=C.getValue(),ne="";return A&&(ne=pe(A)?A.checked?"true":"false":A.value),A=ne,A!==F?(C.setValue(A),!0):!1}function xe(A){if(A=A||(typeof document<"u"?document:void 0),typeof A>"u")return null;try{return A.activeElement||A.body}catch{return A.body}}function Ne(A,C){var F=C.checked;return m({},C,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:F??A._wrapperState.initialChecked})}function Pe(A,C){var F=C.defaultValue==null?"":C.defaultValue,ne=C.checked!=null?C.checked:C.defaultChecked;F=de(C.value!=null?C.value:F),A._wrapperState={initialChecked:ne,initialValue:F,controlled:C.type==="checkbox"||C.type==="radio"?C.checked!=null:C.value!=null}}function Ie(A,C){C=C.checked,C!=null&&G(A,"checked",C,!1)}function Ke(A,C){Ie(A,C);var F=de(C.value),ne=C.type;if(F!=null)ne==="number"?(F===0&&A.value===""||A.value!=F)&&(A.value=""+F):A.value!==""+F&&(A.value=""+F);else if(ne==="submit"||ne==="reset"){A.removeAttribute("value");return}C.hasOwnProperty("value")?Ce(A,C.type,F):C.hasOwnProperty("defaultValue")&&Ce(A,C.type,de(C.defaultValue)),C.checked==null&&C.defaultChecked!=null&&(A.defaultChecked=!!C.defaultChecked)}function Le(A,C,F){if(C.hasOwnProperty("value")||C.hasOwnProperty("defaultValue")){var ne=C.type;if(!(ne!=="submit"&&ne!=="reset"||C.value!==void 0&&C.value!==null))return;C=""+A._wrapperState.initialValue,F||C===A.value||(A.value=C),A.defaultValue=C}F=A.name,F!==""&&(A.name=""),A.defaultChecked=!!A._wrapperState.initialChecked,F!==""&&(A.name=F)}function Ce(A,C,F){(C!=="number"||xe(A.ownerDocument)!==A)&&(F==null?A.defaultValue=""+A._wrapperState.initialValue:A.defaultValue!==""+F&&(A.defaultValue=""+F))}var at=Array.isArray;function Oe(A,C,F,ne){if(A=A.options,C){C={};for(var fe=0;fe<F.length;fe++)C["$"+F[fe]]=!0;for(F=0;F<A.length;F++)fe=C.hasOwnProperty("$"+A[F].value),A[F].selected!==fe&&(A[F].selected=fe),fe&&ne&&(A[F].defaultSelected=!0)}else{for(F=""+de(F),C=null,fe=0;fe<A.length;fe++){if(A[fe].value===F){A[fe].selected=!0,ne&&(A[fe].defaultSelected=!0);return}C!==null||A[fe].disabled||(C=A[fe])}C!==null&&(C.selected=!0)}}function De(A,C){if(C.dangerouslySetInnerHTML!=null)throw Error(u(91));return m({},C,{value:void 0,defaultValue:void 0,children:""+A._wrapperState.initialValue})}function yt(A,C){var F=C.value;if(F==null){if(F=C.children,C=C.defaultValue,F!=null){if(C!=null)throw Error(u(92));if(at(F)){if(1<F.length)throw Error(u(93));F=F[0]}C=F}C==null&&(C=""),F=C}A._wrapperState={initialValue:de(F)}}function Ue(A,C){var F=de(C.value),ne=de(C.defaultValue);F!=null&&(F=""+F,F!==A.value&&(A.value=F),C.defaultValue==null&&A.defaultValue!==F&&(A.defaultValue=F)),ne!=null&&(A.defaultValue=""+ne)}function ze(A){var C=A.textContent;C===A._wrapperState.initialValue&&C!==""&&C!==null&&(A.value=C)}function Mt(A){switch(A){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function se(A,C){return A==null||A==="http://www.w3.org/1999/xhtml"?Mt(C):A==="http://www.w3.org/2000/svg"&&C==="foreignObject"?"http://www.w3.org/1999/xhtml":A}var j,X=function(A){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(C,F,ne,fe){MSApp.execUnsafeLocalFunction(function(){return A(C,F,ne,fe)})}:A}(function(A,C){if(A.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in A)A.innerHTML=C;else{for(j=j||document.createElement("div"),j.innerHTML="<svg>"+C.valueOf().toString()+"</svg>",C=j.firstChild;A.firstChild;)A.removeChild(A.firstChild);for(;C.firstChild;)A.appendChild(C.firstChild)}});function ce(A,C){if(C){var F=A.firstChild;if(F&&F===A.lastChild&&F.nodeType===3){F.nodeValue=C;return}}A.textContent=C}var be={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},Re=["Webkit","ms","Moz","O"];Object.keys(be).forEach(function(A){Re.forEach(function(C){C=C+A.charAt(0).toUpperCase()+A.substring(1),be[C]=be[A]})});function Se(A,C,F){return C==null||typeof C=="boolean"||C===""?"":F||typeof C!="number"||C===0||be.hasOwnProperty(A)&&be[A]?(""+C).trim():C+"px"}function qe(A,C){A=A.style;for(var F in C)if(C.hasOwnProperty(F)){var ne=F.indexOf("--")===0,fe=Se(F,C[F],ne);F==="float"&&(F="cssFloat"),ne?A.setProperty(F,fe):A[F]=fe}}var bt=m({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 je(A,C){if(C){if(bt[A]&&(C.children!=null||C.dangerouslySetInnerHTML!=null))throw Error(u(137,A));if(C.dangerouslySetInnerHTML!=null){if(C.children!=null)throw Error(u(60));if(typeof C.dangerouslySetInnerHTML!="object"||!("__html"in C.dangerouslySetInnerHTML))throw Error(u(61))}if(C.style!=null&&typeof C.style!="object")throw Error(u(62))}}function We(A,C){if(A.indexOf("-")===-1)return typeof C.is=="string";switch(A){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 St=null;function ut(A){return A=A.target||A.srcElement||window,A.correspondingUseElement&&(A=A.correspondingUseElement),A.nodeType===3?A.parentNode:A}var vt=null,zt=null,st=null;function nt(A){if(A=In(A)){if(typeof vt!="function")throw Error(u(280));var C=A.stateNode;C&&(C=wu(C),vt(A.stateNode,A.type,C))}}function Vt(A){zt?st?st.push(A):st=[A]:zt=A}function tt(){if(zt){var A=zt,C=st;if(st=zt=null,nt(A),C)for(A=0;A<C.length;A++)nt(C[A])}}function ft(A,C){return A(C)}function Ft(){}var Qe=!1;function rt(A,C,F){if(Qe)return A(C,F);Qe=!0;try{return ft(A,C,F)}finally{Qe=!1,(zt!==null||st!==null)&&(Ft(),tt())}}function Bt(A,C){var F=A.stateNode;if(F===null)return null;var ne=wu(F);if(ne===null)return null;F=ne[C];e:switch(C){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(ne=!ne.disabled)||(A=A.type,ne=!(A==="button"||A==="input"||A==="select"||A==="textarea")),A=!ne;break e;default:A=!1}if(A)return null;if(F&&typeof F!="function")throw Error(u(231,C,typeof F));return F}var Xe=!1;if(p)try{var ct={};Object.defineProperty(ct,"passive",{get:function(){Xe=!0}}),window.addEventListener("test",ct,ct),window.removeEventListener("test",ct,ct)}catch{Xe=!1}function Ut(A,C,F,ne,fe,ve,Ae,Be,Ve){var gt=Array.prototype.slice.call(arguments,3);try{C.apply(F,gt)}catch(Tt){this.onError(Tt)}}var Je=!1,it=null,qt=!1,et=null,ht={onError:function(A){Je=!0,it=A}};function ar(A,C,F,ne,fe,ve,Ae,Be,Ve){Je=!1,it=null,Ut.apply(ht,arguments)}function dt(A,C,F,ne,fe,ve,Ae,Be,Ve){if(ar.apply(this,arguments),Je){if(Je){var gt=it;Je=!1,it=null}else throw Error(u(198));qt||(qt=!0,et=gt)}}function mt(A){var C=A,F=A;if(A.alternate)for(;C.return;)C=C.return;else{A=C;do C=A,C.flags&4098&&(F=C.return),A=C.return;while(A)}return C.tag===3?F:null}function Xt(A){if(A.tag===13){var C=A.memoizedState;if(C===null&&(A=A.alternate,A!==null&&(C=A.memoizedState)),C!==null)return C.dehydrated}return null}function er(A){if(mt(A)!==A)throw Error(u(188))}function kr(A){var C=A.alternate;if(!C){if(C=mt(A),C===null)throw Error(u(188));return C!==A?null:A}for(var F=A,ne=C;;){var fe=F.return;if(fe===null)break;var ve=fe.alternate;if(ve===null){if(ne=fe.return,ne!==null){F=ne;continue}break}if(fe.child===ve.child){for(ve=fe.child;ve;){if(ve===F)return er(fe),A;if(ve===ne)return er(fe),C;ve=ve.sibling}throw Error(u(188))}if(F.return!==ne.return)F=fe,ne=ve;else{for(var Ae=!1,Be=fe.child;Be;){if(Be===F){Ae=!0,F=fe,ne=ve;break}if(Be===ne){Ae=!0,ne=fe,F=ve;break}Be=Be.sibling}if(!Ae){for(Be=ve.child;Be;){if(Be===F){Ae=!0,F=ve,ne=fe;break}if(Be===ne){Ae=!0,ne=ve,F=fe;break}Be=Be.sibling}if(!Ae)throw Error(u(189))}}if(F.alternate!==ne)throw Error(u(190))}if(F.tag!==3)throw Error(u(188));return F.stateNode.current===F?A:C}function Ar(A){return A=kr(A),A!==null?Tr(A):null}function Tr(A){if(A.tag===5||A.tag===6)return A;for(A=A.child;A!==null;){var C=Tr(A);if(C!==null)return C;A=A.sibling}return null}var Rr=a.unstable_scheduleCallback,pr=a.unstable_cancelCallback,_r=a.unstable_shouldYield,fr=a.unstable_requestPaint,Ht=a.unstable_now,Cr=a.unstable_getCurrentPriorityLevel,ur=a.unstable_ImmediatePriority,wr=a.unstable_UserBlockingPriority,yr=a.unstable_NormalPriority,Mr=a.unstable_LowPriority,Er=a.unstable_IdlePriority,gr=null,sr=null;function Ir(A){if(sr&&typeof sr.onCommitFiberRoot=="function")try{sr.onCommitFiberRoot(gr,A,void 0,(A.current.flags&128)===128)}catch{}}var ln=Math.clz32?Math.clz32:La,ji=Math.log,Na=Math.LN2;function La(A){return A>>>=0,A===0?32:31-(ji(A)/Na|0)|0}var zi=64,ko=4194304;function Vi(A){switch(A&-A){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 A&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return A&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return A}}function Ai(A,C){var F=A.pendingLanes;if(F===0)return 0;var ne=0,fe=A.suspendedLanes,ve=A.pingedLanes,Ae=F&268435455;if(Ae!==0){var Be=Ae&~fe;Be!==0?ne=Vi(Be):(ve&=Ae,ve!==0&&(ne=Vi(ve)))}else Ae=F&~fe,Ae!==0?ne=Vi(Ae):ve!==0&&(ne=Vi(ve));if(ne===0)return 0;if(C!==0&&C!==ne&&!(C&fe)&&(fe=ne&-ne,ve=C&-C,fe>=ve||fe===16&&(ve&4194240)!==0))return C;if(ne&4&&(ne|=F&16),C=A.entangledLanes,C!==0)for(A=A.entanglements,C&=ne;0<C;)F=31-ln(C),fe=1<<F,ne|=A[F],C&=~fe;return ne}function li(A,C){switch(A){case 1:case 2:case 4:return C+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return C+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function lo(A,C){for(var F=A.suspendedLanes,ne=A.pingedLanes,fe=A.expirationTimes,ve=A.pendingLanes;0<ve;){var Ae=31-ln(ve),Be=1<<Ae,Ve=fe[Ae];Ve===-1?(!(Be&F)||Be&ne)&&(fe[Ae]=li(Be,C)):Ve<=C&&(A.expiredLanes|=Be),ve&=~Be}}function Co(A){return A=A.pendingLanes&-1073741825,A!==0?A:A&1073741824?1073741824:0}function ia(){var A=zi;return zi<<=1,!(zi&4194240)&&(zi=64),A}function Ti(A){for(var C=[],F=0;31>F;F++)C.push(A);return C}function co(A,C,F){A.pendingLanes|=C,C!==536870912&&(A.suspendedLanes=0,A.pingedLanes=0),A=A.eventTimes,C=31-ln(C),A[C]=F}function Ba(A,C){var F=A.pendingLanes&~C;A.pendingLanes=C,A.suspendedLanes=0,A.pingedLanes=0,A.expiredLanes&=C,A.mutableReadLanes&=C,A.entangledLanes&=C,C=A.entanglements;var ne=A.eventTimes;for(A=A.expirationTimes;0<F;){var fe=31-ln(F),ve=1<<fe;C[fe]=0,ne[fe]=-1,A[fe]=-1,F&=~ve}}function fo(A,C){var F=A.entangledLanes|=C;for(A=A.entanglements;F;){var ne=31-ln(F),fe=1<<ne;fe&C|A[ne]&C&&(A[ne]|=C),F&=~fe}}var br=0;function Ri(A){return A&=-A,1<A?4<A?A&268435455?16:536870912:4:1}var oa,Io,Hi,aa,sa,Oo=!1,qn=[],Tn=null,Rn=null,Mn=null,Ki=new Map,Mi=new Map,Pn=[],ua="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function mn(A,C){switch(A){case"focusin":case"focusout":Tn=null;break;case"dragenter":case"dragleave":Rn=null;break;case"mouseover":case"mouseout":Mn=null;break;case"pointerover":case"pointerout":Ki.delete(C.pointerId);break;case"gotpointercapture":case"lostpointercapture":Mi.delete(C.pointerId)}}function cn(A,C,F,ne,fe,ve){return A===null||A.nativeEvent!==ve?(A={blockedOn:C,domEventName:F,eventSystemFlags:ne,nativeEvent:ve,targetContainers:[fe]},C!==null&&(C=In(C),C!==null&&Io(C)),A):(A.eventSystemFlags|=ne,C=A.targetContainers,fe!==null&&C.indexOf(fe)===-1&&C.push(fe),A)}function gs(A,C,F,ne,fe){switch(C){case"focusin":return Tn=cn(Tn,A,C,F,ne,fe),!0;case"dragenter":return Rn=cn(Rn,A,C,F,ne,fe),!0;case"mouseover":return Mn=cn(Mn,A,C,F,ne,fe),!0;case"pointerover":var ve=fe.pointerId;return Ki.set(ve,cn(Ki.get(ve)||null,A,C,F,ne,fe)),!0;case"gotpointercapture":return ve=fe.pointerId,Mi.set(ve,cn(Mi.get(ve)||null,A,C,F,ne,fe)),!0}return!1}function $o(A){var C=Yi(A.target);if(C!==null){var F=mt(C);if(F!==null){if(C=F.tag,C===13){if(C=Xt(F),C!==null){A.blockedOn=C,sa(A.priority,function(){Hi(F)});return}}else if(C===3&&F.stateNode.current.memoizedState.isDehydrated){A.blockedOn=F.tag===3?F.stateNode.containerInfo:null;return}}}A.blockedOn=null}function No(A){if(A.blockedOn!==null)return!1;for(var C=A.targetContainers;0<C.length;){var F=Kt(A.domEventName,A.eventSystemFlags,C[0],A.nativeEvent);if(F===null){F=A.nativeEvent;var ne=new F.constructor(F.type,F);St=ne,F.target.dispatchEvent(ne),St=null}else return C=In(F),C!==null&&Io(C),A.blockedOn=F,!1;C.shift()}return!0}function Lo(A,C,F){No(A)&&F.delete(C)}function vs(){Oo=!1,Tn!==null&&No(Tn)&&(Tn=null),Rn!==null&&No(Rn)&&(Rn=null),Mn!==null&&No(Mn)&&(Mn=null),Ki.forEach(Lo),Mi.forEach(Lo)}function Or(A,C){A.blockedOn===C&&(A.blockedOn=null,Oo||(Oo=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,vs)))}function xr(A){function C(fe){return Or(fe,A)}if(0<qn.length){Or(qn[0],A);for(var F=1;F<qn.length;F++){var ne=qn[F];ne.blockedOn===A&&(ne.blockedOn=null)}}for(Tn!==null&&Or(Tn,A),Rn!==null&&Or(Rn,A),Mn!==null&&Or(Mn,A),Ki.forEach(C),Mi.forEach(C),F=0;F<Pn.length;F++)ne=Pn[F],ne.blockedOn===A&&(ne.blockedOn=null);for(;0<Pn.length&&(F=Pn[0],F.blockedOn===null);)$o(F),F.blockedOn===null&&Pn.shift()}var Gi=V.ReactCurrentBatchConfig,we=!0;function Te(A,C,F,ne){var fe=br,ve=Gi.transition;Gi.transition=null;try{br=1,_t(A,C,F,ne)}finally{br=fe,Gi.transition=ve}}function $e(A,C,F,ne){var fe=br,ve=Gi.transition;Gi.transition=null;try{br=4,_t(A,C,F,ne)}finally{br=fe,Gi.transition=ve}}function _t(A,C,F,ne){if(we){var fe=Kt(A,C,F,ne);if(fe===null)Cl(A,C,ne,It,F),mn(A,ne);else if(gs(fe,A,C,F,ne))ne.stopPropagation();else if(mn(A,ne),C&4&&-1<ua.indexOf(A)){for(;fe!==null;){var ve=In(fe);if(ve!==null&&oa(ve),ve=Kt(A,C,F,ne),ve===null&&Cl(A,C,ne,It,F),ve===fe)break;fe=ve}fe!==null&&ne.stopPropagation()}else Cl(A,C,ne,null,F)}}var It=null;function Kt(A,C,F,ne){if(It=null,A=ut(ne),A=Yi(A),A!==null)if(C=mt(A),C===null)A=null;else if(F=C.tag,F===13){if(A=Xt(C),A!==null)return A;A=null}else if(F===3){if(C.stateNode.current.memoizedState.isDehydrated)return C.tag===3?C.stateNode.containerInfo:null;A=null}else C!==A&&(A=null);return It=A,null}function Jt(A){switch(A){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Cr()){case ur:return 1;case wr:return 4;case yr:case Mr:return 16;case Er:return 536870912;default:return 16}default:return 16}}var Ct=null,Zt=null,Pr=null;function qr(){if(Pr)return Pr;var A,C=Zt,F=C.length,ne,fe="value"in Ct?Ct.value:Ct.textContent,ve=fe.length;for(A=0;A<F&&C[A]===fe[A];A++);var Ae=F-A;for(ne=1;ne<=Ae&&C[F-ne]===fe[ve-ne];ne++);return Pr=fe.slice(A,1<ne?1-ne:void 0)}function gn(A){var C=A.keyCode;return"charCode"in A?(A=A.charCode,A===0&&C===13&&(A=13)):A=C,A===10&&(A=13),32<=A||A===13?A:0}function Zr(){return!0}function Pi(){return!1}function rn(A){function C(F,ne,fe,ve,Ae){this._reactName=F,this._targetInst=fe,this.type=ne,this.nativeEvent=ve,this.target=Ae,this.currentTarget=null;for(var Be in A)A.hasOwnProperty(Be)&&(F=A[Be],this[Be]=F?F(ve):ve[Be]);return this.isDefaultPrevented=(ve.defaultPrevented!=null?ve.defaultPrevented:ve.returnValue===!1)?Zr:Pi,this.isPropagationStopped=Pi,this}return m(C.prototype,{preventDefault:function(){this.defaultPrevented=!0;var F=this.nativeEvent;F&&(F.preventDefault?F.preventDefault():typeof F.returnValue!="unknown"&&(F.returnValue=!1),this.isDefaultPrevented=Zr)},stopPropagation:function(){var F=this.nativeEvent;F&&(F.stopPropagation?F.stopPropagation():typeof F.cancelBubble!="unknown"&&(F.cancelBubble=!0),this.isPropagationStopped=Zr)},persist:function(){},isPersistent:Zr}),C}var la={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(A){return A.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},nu=rn(la),Da=m({},la,{view:0,detail:0}),kc=rn(Da),Fn,vl,kn,iu=m({},Da,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xl,button:0,buttons:0,relatedTarget:function(A){return A.relatedTarget===void 0?A.fromElement===A.srcElement?A.toElement:A.fromElement:A.relatedTarget},movementX:function(A){return"movementX"in A?A.movementX:(A!==kn&&(kn&&A.type==="mousemove"?(Fn=A.screenX-kn.screenX,vl=A.screenY-kn.screenY):vl=Fn=0,kn=A),Fn)},movementY:function(A){return"movementY"in A?A.movementY:vl}}),yl=rn(iu),Bo=m({},iu,{dataTransfer:0}),ou=rn(Bo),bl=m({},Da,{relatedTarget:0}),jr=rn(bl),Do=m({},la,{animationName:0,elapsedTime:0,pseudoElement:0}),_l=rn(Do),Vf=m({},la,{clipboardData:function(A){return"clipboardData"in A?A.clipboardData:window.clipboardData}}),wl=rn(Vf),Hf=m({},la,{data:0}),Cc=rn(Hf),Kf={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ic={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},au={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function qa(A){var C=this.nativeEvent;return C.getModifierState?C.getModifierState(A):(A=au[A])?!!C[A]:!1}function xl(){return qa}var Oc=m({},Da,{key:function(A){if(A.key){var C=Kf[A.key]||A.key;if(C!=="Unidentified")return C}return A.type==="keypress"?(A=gn(A),A===13?"Enter":String.fromCharCode(A)):A.type==="keydown"||A.type==="keyup"?Ic[A.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xl,charCode:function(A){return A.type==="keypress"?gn(A):0},keyCode:function(A){return A.type==="keydown"||A.type==="keyup"?A.keyCode:0},which:function(A){return A.type==="keypress"?gn(A):A.type==="keydown"||A.type==="keyup"?A.keyCode:0}}),$c=rn(Oc),El=m({},iu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),su=rn(El),Nc=m({},Da,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xl}),Gf=rn(Nc),Sl=m({},la,{propertyName:0,elapsedTime:0,pseudoElement:0}),Al=rn(Sl),Wf=m({},iu,{deltaX:function(A){return"deltaX"in A?A.deltaX:"wheelDeltaX"in A?-A.wheelDeltaX:0},deltaY:function(A){return"deltaY"in A?A.deltaY:"wheelDeltaY"in A?-A.wheelDeltaY:"wheelDelta"in A?-A.wheelDelta:0},deltaZ:0,deltaMode:0}),Lc=rn(Wf),ti=[9,13,27,32],ys=p&&"CompositionEvent"in window,ho=null;p&&"documentMode"in document&&(ho=document.documentMode);var Bc=p&&"TextEvent"in window&&!ho,Tl=p&&(!ys||ho&&8<ho&&11>=ho),Dc=" ",qc=!1;function Fc(A,C){switch(A){case"keyup":return ti.indexOf(C.keyCode)!==-1;case"keydown":return C.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Uc(A){return A=A.detail,typeof A=="object"&&"data"in A?A.data:null}var Fa=!1;function Ua(A,C){switch(A){case"compositionend":return Uc(C);case"keypress":return C.which!==32?null:(qc=!0,Dc);case"textInput":return A=C.data,A===Dc&&qc?null:A;default:return null}}function Zf(A,C){if(Fa)return A==="compositionend"||!ys&&Fc(A,C)?(A=qr(),Pr=Zt=Ct=null,Fa=!1,A):null;switch(A){case"paste":return null;case"keypress":if(!(C.ctrlKey||C.altKey||C.metaKey)||C.ctrlKey&&C.altKey){if(C.char&&1<C.char.length)return C.char;if(C.which)return String.fromCharCode(C.which)}return null;case"compositionend":return Tl&&C.locale!=="ko"?null:C.data;default:return null}}var Yf={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function uu(A){var C=A&&A.nodeName&&A.nodeName.toLowerCase();return C==="input"?!!Yf[A.type]:C==="textarea"}function Rl(A,C,F,ne){Vt(ne),C=vu(C,"onChange"),0<C.length&&(F=new nu("onChange","change",null,F,ne),A.push({event:F,listeners:C}))}var ci=null,qo=null;function Xf(A){Wc(A,0)}function lu(A){var C=lr(A);if(me(C))return A}function Jf(A,C){if(A==="change")return C}var ca=!1;if(p){var ri;if(p){var cu="oninput"in document;if(!cu){var jc=document.createElement("div");jc.setAttribute("oninput","return;"),cu=typeof jc.oninput=="function"}ri=cu}else ri=!1;ca=ri&&(!document.documentMode||9<document.documentMode)}function zc(){ci&&(ci.detachEvent("onpropertychange",Vc),qo=ci=null)}function Vc(A){if(A.propertyName==="value"&&lu(qo)){var C=[];Rl(C,qo,A,ut(A)),rt(Xf,C)}}function Qf(A,C,F){A==="focusin"?(zc(),ci=C,qo=F,ci.attachEvent("onpropertychange",Vc)):A==="focusout"&&zc()}function ed(A){if(A==="selectionchange"||A==="keyup"||A==="keydown")return lu(qo)}function ja(A,C){if(A==="click")return lu(C)}function Ze(A,C){if(A==="input"||A==="change")return lu(C)}function wt(A,C){return A===C&&(A!==0||1/A===1/C)||A!==A&&C!==C}var pt=typeof Object.is=="function"?Object.is:wt;function $t(A,C){if(pt(A,C))return!0;if(typeof A!="object"||A===null||typeof C!="object"||C===null)return!1;var F=Object.keys(A),ne=Object.keys(C);if(F.length!==ne.length)return!1;for(ne=0;ne<F.length;ne++){var fe=F[ne];if(!v.call(C,fe)||!pt(A[fe],C[fe]))return!1}return!0}function or(A){for(;A&&A.firstChild;)A=A.firstChild;return A}function Lr(A,C){var F=or(A);A=0;for(var ne;F;){if(F.nodeType===3){if(ne=A+F.textContent.length,A<=C&&ne>=C)return{node:F,offset:C-A};A=ne}e:{for(;F;){if(F.nextSibling){F=F.nextSibling;break e}F=F.parentNode}F=void 0}F=or(F)}}function nn(A,C){return A&&C?A===C?!0:A&&A.nodeType===3?!1:C&&C.nodeType===3?nn(A,C.parentNode):"contains"in A?A.contains(C):A.compareDocumentPosition?!!(A.compareDocumentPosition(C)&16):!1:!1}function Fr(){for(var A=window,C=xe();C instanceof A.HTMLIFrameElement;){try{var F=typeof C.contentWindow.location.href=="string"}catch{F=!1}if(F)A=C.contentWindow;else break;C=xe(A.document)}return C}function bs(A){var C=A&&A.nodeName&&A.nodeName.toLowerCase();return C&&(C==="input"&&(A.type==="text"||A.type==="search"||A.type==="tel"||A.type==="url"||A.type==="password")||C==="textarea"||A.contentEditable==="true")}function td(A){var C=Fr(),F=A.focusedElem,ne=A.selectionRange;if(C!==F&&F&&F.ownerDocument&&nn(F.ownerDocument.documentElement,F)){if(ne!==null&&bs(F)){if(C=ne.start,A=ne.end,A===void 0&&(A=C),"selectionStart"in F)F.selectionStart=C,F.selectionEnd=Math.min(A,F.value.length);else if(A=(C=F.ownerDocument||document)&&C.defaultView||window,A.getSelection){A=A.getSelection();var fe=F.textContent.length,ve=Math.min(ne.start,fe);ne=ne.end===void 0?ve:Math.min(ne.end,fe),!A.extend&&ve>ne&&(fe=ne,ne=ve,ve=fe),fe=Lr(F,ve);var Ae=Lr(F,ne);fe&&Ae&&(A.rangeCount!==1||A.anchorNode!==fe.node||A.anchorOffset!==fe.offset||A.focusNode!==Ae.node||A.focusOffset!==Ae.offset)&&(C=C.createRange(),C.setStart(fe.node,fe.offset),A.removeAllRanges(),ve>ne?(A.addRange(C),A.extend(Ae.node,Ae.offset)):(C.setEnd(Ae.node,Ae.offset),A.addRange(C)))}}for(C=[],A=F;A=A.parentNode;)A.nodeType===1&&C.push({element:A,left:A.scrollLeft,top:A.scrollTop});for(typeof F.focus=="function"&&F.focus(),F=0;F<C.length;F++)A=C[F],A.element.scrollLeft=A.left,A.element.scrollTop=A.top}}var fi=p&&"documentMode"in document&&11>=document.documentMode,po=null,Ml=null,Wi=null,za=!1;function _s(A,C,F){var ne=F.window===F?F.document:F.nodeType===9?F:F.ownerDocument;za||po==null||po!==xe(ne)||(ne=po,"selectionStart"in ne&&bs(ne)?ne={start:ne.selectionStart,end:ne.selectionEnd}:(ne=(ne.ownerDocument&&ne.ownerDocument.defaultView||window).getSelection(),ne={anchorNode:ne.anchorNode,anchorOffset:ne.anchorOffset,focusNode:ne.focusNode,focusOffset:ne.focusOffset}),Wi&&$t(Wi,ne)||(Wi=ne,ne=vu(Ml,"onSelect"),0<ne.length&&(C=new nu("onSelect","select",null,C,F),A.push({event:C,listeners:ne}),C.target=po)))}function Br(A,C){var F={};return F[A.toLowerCase()]=C.toLowerCase(),F["Webkit"+A]="webkit"+C,F["Moz"+A]="moz"+C,F}var Va={animationend:Br("Animation","AnimationEnd"),animationiteration:Br("Animation","AnimationIteration"),animationstart:Br("Animation","AnimationStart"),transitionend:Br("Transition","TransitionEnd")},fu={},ws={};p&&(ws=document.createElement("div").style,"AnimationEvent"in window||(delete Va.animationend.animation,delete Va.animationiteration.animation,delete Va.animationstart.animation),"TransitionEvent"in window||delete Va.transitionend.transition);function du(A){if(fu[A])return fu[A];if(!Va[A])return A;var C=Va[A],F;for(F in C)if(C.hasOwnProperty(F)&&F in ws)return fu[A]=C[F];return A}var Hc=du("animationend"),Kc=du("animationiteration"),xs=du("animationstart"),mo=du("transitionend"),Es=new Map,Pl="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ki(A,C){Es.set(A,C),c(C,[A])}for(var hu=0;hu<Pl.length;hu++){var pu=Pl[hu],mu=pu.toLowerCase(),Gc=pu[0].toUpperCase()+pu.slice(1);ki(mu,"on"+Gc)}ki(Hc,"onAnimationEnd"),ki(Kc,"onAnimationIteration"),ki(xs,"onAnimationStart"),ki("dblclick","onDoubleClick"),ki("focusin","onFocus"),ki("focusout","onBlur"),ki(mo,"onTransitionEnd"),h("onMouseEnter",["mouseout","mouseover"]),h("onMouseLeave",["mouseout","mouseover"]),h("onPointerEnter",["pointerout","pointerover"]),h("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var go="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),fa=new Set("cancel close invalid load scroll toggle".split(" ").concat(go));function Ss(A,C,F){var ne=A.type||"unknown-event";A.currentTarget=F,dt(ne,C,void 0,A),A.currentTarget=null}function Wc(A,C){C=(C&4)!==0;for(var F=0;F<A.length;F++){var ne=A[F],fe=ne.event;ne=ne.listeners;e:{var ve=void 0;if(C)for(var Ae=ne.length-1;0<=Ae;Ae--){var Be=ne[Ae],Ve=Be.instance,gt=Be.currentTarget;if(Be=Be.listener,Ve!==ve&&fe.isPropagationStopped())break e;Ss(fe,Be,gt),ve=Ve}else for(Ae=0;Ae<ne.length;Ae++){if(Be=ne[Ae],Ve=Be.instance,gt=Be.currentTarget,Be=Be.listener,Ve!==ve&&fe.isPropagationStopped())break e;Ss(fe,Be,gt),ve=Ve}}}if(qt)throw A=et,qt=!1,et=null,A}function Vr(A,C){var F=C[_u];F===void 0&&(F=C[_u]=new Set);var ne=A+"__bubble";F.has(ne)||(gu(C,A,2,!1),F.add(ne))}function kl(A,C,F){var ne=0;C&&(ne|=4),gu(F,A,ne,C)}var da="_reactListening"+Math.random().toString(36).slice(2);function Fo(A){if(!A[da]){A[da]=!0,l.forEach(function(F){F!=="selectionchange"&&(fa.has(F)||kl(F,!1,A),kl(F,!0,A))});var C=A.nodeType===9?A:A.ownerDocument;C===null||C[da]||(C[da]=!0,kl("selectionchange",!1,C))}}function gu(A,C,F,ne){switch(Jt(C)){case 1:var fe=Te;break;case 4:fe=$e;break;default:fe=_t}F=fe.bind(null,C,F,A),fe=void 0,!Xe||C!=="touchstart"&&C!=="touchmove"&&C!=="wheel"||(fe=!0),ne?fe!==void 0?A.addEventListener(C,F,{capture:!0,passive:fe}):A.addEventListener(C,F,!0):fe!==void 0?A.addEventListener(C,F,{passive:fe}):A.addEventListener(C,F,!1)}function Cl(A,C,F,ne,fe){var ve=ne;if(!(C&1)&&!(C&2)&&ne!==null)e:for(;;){if(ne===null)return;var Ae=ne.tag;if(Ae===3||Ae===4){var Be=ne.stateNode.containerInfo;if(Be===fe||Be.nodeType===8&&Be.parentNode===fe)break;if(Ae===4)for(Ae=ne.return;Ae!==null;){var Ve=Ae.tag;if((Ve===3||Ve===4)&&(Ve=Ae.stateNode.containerInfo,Ve===fe||Ve.nodeType===8&&Ve.parentNode===fe))return;Ae=Ae.return}for(;Be!==null;){if(Ae=Yi(Be),Ae===null)return;if(Ve=Ae.tag,Ve===5||Ve===6){ne=ve=Ae;continue e}Be=Be.parentNode}}ne=ne.return}rt(function(){var gt=ve,Tt=ut(F),Pt=[];e:{var At=Es.get(A);if(At!==void 0){var Nt=nu,Dt=A;switch(A){case"keypress":if(gn(F)===0)break e;case"keydown":case"keyup":Nt=$c;break;case"focusin":Dt="focus",Nt=jr;break;case"focusout":Dt="blur",Nt=jr;break;case"beforeblur":case"afterblur":Nt=jr;break;case"click":if(F.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Nt=yl;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Nt=ou;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Nt=Gf;break;case Hc:case Kc:case xs:Nt=_l;break;case mo:Nt=Al;break;case"scroll":Nt=kc;break;case"wheel":Nt=Lc;break;case"copy":case"cut":case"paste":Nt=wl;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Nt=su}var jt=(C&4)!==0,en=!jt&&A==="scroll",ot=jt?At!==null?At+"Capture":null:At;jt=[];for(var Ge=gt,lt;Ge!==null;){lt=Ge;var kt=lt.stateNode;if(lt.tag===5&&kt!==null&&(lt=kt,ot!==null&&(kt=Bt(Ge,ot),kt!=null&&jt.push(Ha(Ge,kt,lt)))),en)break;Ge=Ge.return}0<jt.length&&(At=new Nt(At,Dt,null,F,Tt),Pt.push({event:At,listeners:jt}))}}if(!(C&7)){e:{if(At=A==="mouseover"||A==="pointerover",Nt=A==="mouseout"||A==="pointerout",At&&F!==St&&(Dt=F.relatedTarget||F.fromElement)&&(Yi(Dt)||Dt[ni]))break e;if((Nt||At)&&(At=Tt.window===Tt?Tt:(At=Tt.ownerDocument)?At.defaultView||At.parentWindow:window,Nt?(Dt=F.relatedTarget||F.toElement,Nt=gt,Dt=Dt?Yi(Dt):null,Dt!==null&&(en=mt(Dt),Dt!==en||Dt.tag!==5&&Dt.tag!==6)&&(Dt=null)):(Nt=null,Dt=gt),Nt!==Dt)){if(jt=yl,kt="onMouseLeave",ot="onMouseEnter",Ge="mouse",(A==="pointerout"||A==="pointerover")&&(jt=su,kt="onPointerLeave",ot="onPointerEnter",Ge="pointer"),en=Nt==null?At:lr(Nt),lt=Dt==null?At:lr(Dt),At=new jt(kt,Ge+"leave",Nt,F,Tt),At.target=en,At.relatedTarget=lt,kt=null,Yi(Tt)===gt&&(jt=new jt(ot,Ge+"enter",Dt,F,Tt),jt.target=lt,jt.relatedTarget=en,kt=jt),en=kt,Nt&&Dt)t:{for(jt=Nt,ot=Dt,Ge=0,lt=jt;lt;lt=Ka(lt))Ge++;for(lt=0,kt=ot;kt;kt=Ka(kt))lt++;for(;0<Ge-lt;)jt=Ka(jt),Ge--;for(;0<lt-Ge;)ot=Ka(ot),lt--;for(;Ge--;){if(jt===ot||ot!==null&&jt===ot.alternate)break t;jt=Ka(jt),ot=Ka(ot)}jt=null}else jt=null;Nt!==null&&an(Pt,At,Nt,jt,!1),Dt!==null&&en!==null&&an(Pt,en,Dt,jt,!0)}}e:{if(At=gt?lr(gt):window,Nt=At.nodeName&&At.nodeName.toLowerCase(),Nt==="select"||Nt==="input"&&At.type==="file")var Gt=Jf;else if(uu(At))if(ca)Gt=Ze;else{Gt=ed;var Qt=Qf}else(Nt=At.nodeName)&&Nt.toLowerCase()==="input"&&(At.type==="checkbox"||At.type==="radio")&&(Gt=ja);if(Gt&&(Gt=Gt(A,gt))){Rl(Pt,Gt,F,Tt);break e}Qt&&Qt(A,At,gt),A==="focusout"&&(Qt=At._wrapperState)&&Qt.controlled&&At.type==="number"&&Ce(At,"number",At.value)}switch(Qt=gt?lr(gt):window,A){case"focusin":(uu(Qt)||Qt.contentEditable==="true")&&(po=Qt,Ml=gt,Wi=null);break;case"focusout":Wi=Ml=po=null;break;case"mousedown":za=!0;break;case"contextmenu":case"mouseup":case"dragend":za=!1,_s(Pt,F,Tt);break;case"selectionchange":if(fi)break;case"keydown":case"keyup":_s(Pt,F,Tt)}var Yt;if(ys)e:{switch(A){case"compositionstart":var rr="onCompositionStart";break e;case"compositionend":rr="onCompositionEnd";break e;case"compositionupdate":rr="onCompositionUpdate";break e}rr=void 0}else Fa?Fc(A,F)&&(rr="onCompositionEnd"):A==="keydown"&&F.keyCode===229&&(rr="onCompositionStart");rr&&(Tl&&F.locale!=="ko"&&(Fa||rr!=="onCompositionStart"?rr==="onCompositionEnd"&&Fa&&(Yt=qr()):(Ct=Tt,Zt="value"in Ct?Ct.value:Ct.textContent,Fa=!0)),Qt=vu(gt,rr),0<Qt.length&&(rr=new Cc(rr,A,null,F,Tt),Pt.push({event:rr,listeners:Qt}),Yt?rr.data=Yt:(Yt=Uc(F),Yt!==null&&(rr.data=Yt)))),(Yt=Bc?Ua(A,F):Zf(A,F))&&(gt=vu(gt,"onBeforeInput"),0<gt.length&&(Tt=new Cc("onBeforeInput","beforeinput",null,F,Tt),Pt.push({event:Tt,listeners:gt}),Tt.data=Yt))}Wc(Pt,C)})}function Ha(A,C,F){return{instance:A,listener:C,currentTarget:F}}function vu(A,C){for(var F=C+"Capture",ne=[];A!==null;){var fe=A,ve=fe.stateNode;fe.tag===5&&ve!==null&&(fe=ve,ve=Bt(A,F),ve!=null&&ne.unshift(Ha(A,ve,fe)),ve=Bt(A,C),ve!=null&&ne.push(Ha(A,ve,fe))),A=A.return}return ne}function Ka(A){if(A===null)return null;do A=A.return;while(A&&A.tag!==5);return A||null}function an(A,C,F,ne,fe){for(var ve=C._reactName,Ae=[];F!==null&&F!==ne;){var Be=F,Ve=Be.alternate,gt=Be.stateNode;if(Ve!==null&&Ve===ne)break;Be.tag===5&&gt!==null&&(Be=gt,fe?(Ve=Bt(F,ve),Ve!=null&&Ae.unshift(Ha(F,Ve,Be))):fe||(Ve=Bt(F,ve),Ve!=null&&Ae.push(Ha(F,Ve,Be)))),F=F.return}Ae.length!==0&&A.push({event:C,listeners:Ae})}var Cn=/\r\n?/g,rd=/\u0000|\uFFFD/g;function Zc(A){return(typeof A=="string"?A:""+A).replace(Cn,`
`).replace(rd,"")}function As(A,C,F){if(C=Zc(C),Zc(A)!==C&&F)throw Error(u(425))}function yu(){}var Ts=null,ha=null;function Rs(A,C){return A==="textarea"||A==="noscript"||typeof C.children=="string"||typeof C.children=="number"||typeof C.dangerouslySetInnerHTML=="object"&&C.dangerouslySetInnerHTML!==null&&C.dangerouslySetInnerHTML.__html!=null}var Uo=typeof setTimeout=="function"?setTimeout:void 0,Ms=typeof clearTimeout=="function"?clearTimeout:void 0,Ga=typeof Promise=="function"?Promise:void 0,bu=typeof queueMicrotask=="function"?queueMicrotask:typeof Ga<"u"?function(A){return Ga.resolve(null).then(A).catch(Wa)}:Uo;function Wa(A){setTimeout(function(){throw A})}function Il(A,C){var F=C,ne=0;do{var fe=F.nextSibling;if(A.removeChild(F),fe&&fe.nodeType===8)if(F=fe.data,F==="/$"){if(ne===0){A.removeChild(fe),xr(C);return}ne--}else F!=="$"&&F!=="$?"&&F!=="$!"||ne++;F=fe}while(F);xr(C)}function jo(A){for(;A!=null;A=A.nextSibling){var C=A.nodeType;if(C===1||C===3)break;if(C===8){if(C=A.data,C==="$"||C==="$!"||C==="$?")break;if(C==="/$")return null}}return A}function Yc(A){A=A.previousSibling;for(var C=0;A;){if(A.nodeType===8){var F=A.data;if(F==="$"||F==="$!"||F==="$?"){if(C===0)return A;C--}else F==="/$"&&C++}A=A.previousSibling}return null}var Za=Math.random().toString(36).slice(2),Zi="__reactFiber$"+Za,zo="__reactProps$"+Za,ni="__reactContainer$"+Za,_u="__reactEvents$"+Za,Me="__reactListeners$"+Za,Ya="__reactHandles$"+Za;function Yi(A){var C=A[Zi];if(C)return C;for(var F=A.parentNode;F;){if(C=F[ni]||F[Zi]){if(F=C.alternate,C.child!==null||F!==null&&F.child!==null)for(A=Yc(A);A!==null;){if(F=A[Zi])return F;A=Yc(A)}return C}A=F,F=A.parentNode}return null}function In(A){return A=A[Zi]||A[ni],!A||A.tag!==5&&A.tag!==6&&A.tag!==13&&A.tag!==3?null:A}function lr(A){if(A.tag===5||A.tag===6)return A.stateNode;throw Error(u(33))}function wu(A){return A[zo]||null}var Ol=[],Xa=-1;function Gn(A){return{current:A}}function Hr(A){0>Xa||(A.current=Ol[Xa],Ol[Xa]=null,Xa--)}function zr(A,C){Xa++,Ol[Xa]=A.current,A.current=C}var Vo={},On=Gn(Vo),Wn=Gn(!1),Un=Vo;function Ja(A,C){var F=A.type.contextTypes;if(!F)return Vo;var ne=A.stateNode;if(ne&&ne.__reactInternalMemoizedUnmaskedChildContext===C)return ne.__reactInternalMemoizedMaskedChildContext;var fe={},ve;for(ve in F)fe[ve]=C[ve];return ne&&(A=A.stateNode,A.__reactInternalMemoizedUnmaskedChildContext=C,A.__reactInternalMemoizedMaskedChildContext=fe),fe}function Zn(A){return A=A.childContextTypes,A!=null}function xu(){Hr(Wn),Hr(On)}function Xc(A,C,F){if(On.current!==Vo)throw Error(u(168));zr(On,C),zr(Wn,F)}function Jc(A,C,F){var ne=A.stateNode;if(C=C.childContextTypes,typeof ne.getChildContext!="function")return F;ne=ne.getChildContext();for(var fe in ne)if(!(fe in C))throw Error(u(108,ae(A)||"Unknown",fe));return m({},F,ne)}function di(A){return A=(A=A.stateNode)&&A.__reactInternalMemoizedMergedChildContext||Vo,Un=On.current,zr(On,A),zr(Wn,Wn.current),!0}function Qc(A,C,F){var ne=A.stateNode;if(!ne)throw Error(u(169));F?(A=Jc(A,C,Un),ne.__reactInternalMemoizedMergedChildContext=A,Hr(Wn),Hr(On),zr(On,A)):Hr(Wn),zr(Wn,F)}var vo=null,Eu=!1,$l=!1;function ef(A){vo===null?vo=[A]:vo.push(A)}function pa(A){Eu=!0,ef(A)}function Ho(){if(!$l&&vo!==null){$l=!0;var A=0,C=br;try{var F=vo;for(br=1;A<F.length;A++){var ne=F[A];do ne=ne(!0);while(ne!==null)}vo=null,Eu=!1}catch(fe){throw vo!==null&&(vo=vo.slice(A+1)),Rr(ur,Ho),fe}finally{br=C,$l=!1}}return null}var Qa=[],$n=0,Su=null,Au=0,hi=[],pi=0,ma=null,Xi=1,Ji="";function ga(A,C){Qa[$n++]=Au,Qa[$n++]=Su,Su=A,Au=C}function tf(A,C,F){hi[pi++]=Xi,hi[pi++]=Ji,hi[pi++]=ma,ma=A;var ne=Xi;A=Ji;var fe=32-ln(ne)-1;ne&=~(1<<fe),F+=1;var ve=32-ln(C)+fe;if(30<ve){var Ae=fe-fe%5;ve=(ne&(1<<Ae)-1).toString(32),ne>>=Ae,fe-=Ae,Xi=1<<32-ln(C)+fe|F<<fe|ne,Ji=ve+A}else Xi=1<<ve|F<<fe|ne,Ji=A}function Ps(A){A.return!==null&&(ga(A,1),tf(A,1,0))}function va(A){for(;A===Su;)Su=Qa[--$n],Qa[$n]=null,Au=Qa[--$n],Qa[$n]=null;for(;A===ma;)ma=hi[--pi],hi[pi]=null,Ji=hi[--pi],hi[pi]=null,Xi=hi[--pi],hi[pi]=null}var Nn=null,ii=null,Kr=!1,Ci=null;function Qi(A,C){var F=wi(5,null,null,0);F.elementType="DELETED",F.stateNode=C,F.return=A,C=A.deletions,C===null?(A.deletions=[F],A.flags|=16):C.push(F)}function Tu(A,C){switch(A.tag){case 5:var F=A.type;return C=C.nodeType!==1||F.toLowerCase()!==C.nodeName.toLowerCase()?null:C,C!==null?(A.stateNode=C,Nn=A,ii=jo(C.firstChild),!0):!1;case 6:return C=A.pendingProps===""||C.nodeType!==3?null:C,C!==null?(A.stateNode=C,Nn=A,ii=null,!0):!1;case 13:return C=C.nodeType!==8?null:C,C!==null?(F=ma!==null?{id:Xi,overflow:Ji}:null,A.memoizedState={dehydrated:C,treeContext:F,retryLane:1073741824},F=wi(18,null,null,0),F.stateNode=C,F.return=A,A.child=F,Nn=A,ii=null,!0):!1;default:return!1}}function yo(A){return(A.mode&1)!==0&&(A.flags&128)===0}function Yn(A){if(Kr){var C=ii;if(C){var F=C;if(!Tu(A,C)){if(yo(A))throw Error(u(418));C=jo(F.nextSibling);var ne=Nn;C&&Tu(A,C)?Qi(ne,F):(A.flags=A.flags&-4097|2,Kr=!1,Nn=A)}}else{if(yo(A))throw Error(u(418));A.flags=A.flags&-4097|2,Kr=!1,Nn=A}}}function rf(A){for(A=A.return;A!==null&&A.tag!==5&&A.tag!==3&&A.tag!==13;)A=A.return;Nn=A}function ks(A){if(A!==Nn)return!1;if(!Kr)return rf(A),Kr=!0,!1;var C;if((C=A.tag!==3)&&!(C=A.tag!==5)&&(C=A.type,C=C!=="head"&&C!=="body"&&!Rs(A.type,A.memoizedProps)),C&&(C=ii)){if(yo(A))throw Nl(),Error(u(418));for(;C;)Qi(A,C),C=jo(C.nextSibling)}if(rf(A),A.tag===13){if(A=A.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(u(317));e:{for(A=A.nextSibling,C=0;A;){if(A.nodeType===8){var F=A.data;if(F==="/$"){if(C===0){ii=jo(A.nextSibling);break e}C--}else F!=="$"&&F!=="$!"&&F!=="$?"||C++}A=A.nextSibling}ii=null}}else ii=Nn?jo(A.stateNode.nextSibling):null;return!0}function Nl(){for(var A=ii;A;)A=jo(A.nextSibling)}function eo(){ii=Nn=null,Kr=!1}function to(A){Ci===null?Ci=[A]:Ci.push(A)}var nf=V.ReactCurrentBatchConfig;function Cs(A,C,F){if(A=F.ref,A!==null&&typeof A!="function"&&typeof A!="object"){if(F._owner){if(F=F._owner,F){if(F.tag!==1)throw Error(u(309));var ne=F.stateNode}if(!ne)throw Error(u(147,A));var fe=ne,ve=""+A;return C!==null&&C.ref!==null&&typeof C.ref=="function"&&C.ref._stringRef===ve?C.ref:(C=function(Ae){var Be=fe.refs;Ae===null?delete Be[ve]:Be[ve]=Ae},C._stringRef=ve,C)}if(typeof A!="string")throw Error(u(284));if(!F._owner)throw Error(u(290,A))}return A}function ya(A,C){throw A=Object.prototype.toString.call(C),Error(u(31,A==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":A))}function af(A){var C=A._init;return C(A._payload)}function Ll(A){function C(ot,Ge){if(A){var lt=ot.deletions;lt===null?(ot.deletions=[Ge],ot.flags|=16):lt.push(Ge)}}function F(ot,Ge){if(!A)return null;for(;Ge!==null;)C(ot,Ge),Ge=Ge.sibling;return null}function ne(ot,Ge){for(ot=new Map;Ge!==null;)Ge.key!==null?ot.set(Ge.key,Ge):ot.set(Ge.index,Ge),Ge=Ge.sibling;return ot}function fe(ot,Ge){return ot=Di(ot,Ge),ot.index=0,ot.sibling=null,ot}function ve(ot,Ge,lt){return ot.index=lt,A?(lt=ot.alternate,lt!==null?(lt=lt.index,lt<Ge?(ot.flags|=2,Ge):lt):(ot.flags|=2,Ge)):(ot.flags|=1048576,Ge)}function Ae(ot){return A&&ot.alternate===null&&(ot.flags|=2),ot}function Be(ot,Ge,lt,kt){return Ge===null||Ge.tag!==6?(Ge=Sc(lt,ot.mode,kt),Ge.return=ot,Ge):(Ge=fe(Ge,lt),Ge.return=ot,Ge)}function Ve(ot,Ge,lt,kt){var Gt=lt.type;return Gt===Z?Tt(ot,Ge,lt.props.children,kt,lt.key):Ge!==null&&(Ge.elementType===Gt||typeof Gt=="object"&&Gt!==null&&Gt.$$typeof===x&&af(Gt)===Ge.type)?(kt=fe(Ge,lt.props),kt.ref=Cs(ot,Ge,lt),kt.return=ot,kt):(kt=sl(lt.type,lt.key,lt.props,null,ot.mode,kt),kt.ref=Cs(ot,Ge,lt),kt.return=ot,kt)}function gt(ot,Ge,lt,kt){return Ge===null||Ge.tag!==4||Ge.stateNode.containerInfo!==lt.containerInfo||Ge.stateNode.implementation!==lt.implementation?(Ge=Ac(lt,ot.mode,kt),Ge.return=ot,Ge):(Ge=fe(Ge,lt.children||[]),Ge.return=ot,Ge)}function Tt(ot,Ge,lt,kt,Gt){return Ge===null||Ge.tag!==7?(Ge=ka(lt,ot.mode,kt,Gt),Ge.return=ot,Ge):(Ge=fe(Ge,lt),Ge.return=ot,Ge)}function Pt(ot,Ge,lt){if(typeof Ge=="string"&&Ge!==""||typeof Ge=="number")return Ge=Sc(""+Ge,ot.mode,lt),Ge.return=ot,Ge;if(typeof Ge=="object"&&Ge!==null){switch(Ge.$$typeof){case U:return lt=sl(Ge.type,Ge.key,Ge.props,null,ot.mode,lt),lt.ref=Cs(ot,null,Ge),lt.return=ot,lt;case te:return Ge=Ac(Ge,ot.mode,lt),Ge.return=ot,Ge;case x:var kt=Ge._init;return Pt(ot,kt(Ge._payload),lt)}if(at(Ge)||T(Ge))return Ge=ka(Ge,ot.mode,lt,null),Ge.return=ot,Ge;ya(ot,Ge)}return null}function At(ot,Ge,lt,kt){var Gt=Ge!==null?Ge.key:null;if(typeof lt=="string"&&lt!==""||typeof lt=="number")return Gt!==null?null:Be(ot,Ge,""+lt,kt);if(typeof lt=="object"&&lt!==null){switch(lt.$$typeof){case U:return lt.key===Gt?Ve(ot,Ge,lt,kt):null;case te:return lt.key===Gt?gt(ot,Ge,lt,kt):null;case x:return Gt=lt._init,At(ot,Ge,Gt(lt._payload),kt)}if(at(lt)||T(lt))return Gt!==null?null:Tt(ot,Ge,lt,kt,null);ya(ot,lt)}return null}function Nt(ot,Ge,lt,kt,Gt){if(typeof kt=="string"&&kt!==""||typeof kt=="number")return ot=ot.get(lt)||null,Be(Ge,ot,""+kt,Gt);if(typeof kt=="object"&&kt!==null){switch(kt.$$typeof){case U:return ot=ot.get(kt.key===null?lt:kt.key)||null,Ve(Ge,ot,kt,Gt);case te:return ot=ot.get(kt.key===null?lt:kt.key)||null,gt(Ge,ot,kt,Gt);case x:var Qt=kt._init;return Nt(ot,Ge,lt,Qt(kt._payload),Gt)}if(at(kt)||T(kt))return ot=ot.get(lt)||null,Tt(Ge,ot,kt,Gt,null);ya(Ge,kt)}return null}function Dt(ot,Ge,lt,kt){for(var Gt=null,Qt=null,Yt=Ge,rr=Ge=0,_n=null;Yt!==null&&rr<lt.length;rr++){Yt.index>rr?(_n=Yt,Yt=null):_n=Yt.sibling;var Dr=At(ot,Yt,lt[rr],kt);if(Dr===null){Yt===null&&(Yt=_n);break}A&&Yt&&Dr.alternate===null&&C(ot,Yt),Ge=ve(Dr,Ge,rr),Qt===null?Gt=Dr:Qt.sibling=Dr,Qt=Dr,Yt=_n}if(rr===lt.length)return F(ot,Yt),Kr&&ga(ot,rr),Gt;if(Yt===null){for(;rr<lt.length;rr++)Yt=Pt(ot,lt[rr],kt),Yt!==null&&(Ge=ve(Yt,Ge,rr),Qt===null?Gt=Yt:Qt.sibling=Yt,Qt=Yt);return Kr&&ga(ot,rr),Gt}for(Yt=ne(ot,Yt);rr<lt.length;rr++)_n=Nt(Yt,ot,rr,lt[rr],kt),_n!==null&&(A&&_n.alternate!==null&&Yt.delete(_n.key===null?rr:_n.key),Ge=ve(_n,Ge,rr),Qt===null?Gt=_n:Qt.sibling=_n,Qt=_n);return A&&Yt.forEach(function(na){return C(ot,na)}),Kr&&ga(ot,rr),Gt}function jt(ot,Ge,lt,kt){var Gt=T(lt);if(typeof Gt!="function")throw Error(u(150));if(lt=Gt.call(lt),lt==null)throw Error(u(151));for(var Qt=Gt=null,Yt=Ge,rr=Ge=0,_n=null,Dr=lt.next();Yt!==null&&!Dr.done;rr++,Dr=lt.next()){Yt.index>rr?(_n=Yt,Yt=null):_n=Yt.sibling;var na=At(ot,Yt,Dr.value,kt);if(na===null){Yt===null&&(Yt=_n);break}A&&Yt&&na.alternate===null&&C(ot,Yt),Ge=ve(na,Ge,rr),Qt===null?Gt=na:Qt.sibling=na,Qt=na,Yt=_n}if(Dr.done)return F(ot,Yt),Kr&&ga(ot,rr),Gt;if(Yt===null){for(;!Dr.done;rr++,Dr=lt.next())Dr=Pt(ot,Dr.value,kt),Dr!==null&&(Ge=ve(Dr,Ge,rr),Qt===null?Gt=Dr:Qt.sibling=Dr,Qt=Dr);return Kr&&ga(ot,rr),Gt}for(Yt=ne(ot,Yt);!Dr.done;rr++,Dr=lt.next())Dr=Nt(Yt,ot,rr,Dr.value,kt),Dr!==null&&(A&&Dr.alternate!==null&&Yt.delete(Dr.key===null?rr:Dr.key),Ge=ve(Dr,Ge,rr),Qt===null?Gt=Dr:Qt.sibling=Dr,Qt=Dr);return A&&Yt.forEach(function(Ad){return C(ot,Ad)}),Kr&&ga(ot,rr),Gt}function en(ot,Ge,lt,kt){if(typeof lt=="object"&&lt!==null&&lt.type===Z&&lt.key===null&&(lt=lt.props.children),typeof lt=="object"&&lt!==null){switch(lt.$$typeof){case U:e:{for(var Gt=lt.key,Qt=Ge;Qt!==null;){if(Qt.key===Gt){if(Gt=lt.type,Gt===Z){if(Qt.tag===7){F(ot,Qt.sibling),Ge=fe(Qt,lt.props.children),Ge.return=ot,ot=Ge;break e}}else if(Qt.elementType===Gt||typeof Gt=="object"&&Gt!==null&&Gt.$$typeof===x&&af(Gt)===Qt.type){F(ot,Qt.sibling),Ge=fe(Qt,lt.props),Ge.ref=Cs(ot,Qt,lt),Ge.return=ot,ot=Ge;break e}F(ot,Qt);break}else C(ot,Qt);Qt=Qt.sibling}lt.type===Z?(Ge=ka(lt.props.children,ot.mode,kt,lt.key),Ge.return=ot,ot=Ge):(kt=sl(lt.type,lt.key,lt.props,null,ot.mode,kt),kt.ref=Cs(ot,Ge,lt),kt.return=ot,ot=kt)}return Ae(ot);case te:e:{for(Qt=lt.key;Ge!==null;){if(Ge.key===Qt)if(Ge.tag===4&&Ge.stateNode.containerInfo===lt.containerInfo&&Ge.stateNode.implementation===lt.implementation){F(ot,Ge.sibling),Ge=fe(Ge,lt.children||[]),Ge.return=ot,ot=Ge;break e}else{F(ot,Ge);break}else C(ot,Ge);Ge=Ge.sibling}Ge=Ac(lt,ot.mode,kt),Ge.return=ot,ot=Ge}return Ae(ot);case x:return Qt=lt._init,en(ot,Ge,Qt(lt._payload),kt)}if(at(lt))return Dt(ot,Ge,lt,kt);if(T(lt))return jt(ot,Ge,lt,kt);ya(ot,lt)}return typeof lt=="string"&&lt!==""||typeof lt=="number"?(lt=""+lt,Ge!==null&&Ge.tag===6?(F(ot,Ge.sibling),Ge=fe(Ge,lt),Ge.return=ot,ot=Ge):(F(ot,Ge),Ge=Sc(lt,ot.mode,kt),Ge.return=ot,ot=Ge),Ae(ot)):F(ot,Ge)}return en}var Jr=Ll(!0),Ru=Ll(!1),Is=Gn(null),oi=null,Ko=null,es=null;function bo(){es=Ko=oi=null}function Mu(A){var C=Is.current;Hr(Is),A._currentValue=C}function wn(A,C,F){for(;A!==null;){var ne=A.alternate;if((A.childLanes&C)!==C?(A.childLanes|=C,ne!==null&&(ne.childLanes|=C)):ne!==null&&(ne.childLanes&C)!==C&&(ne.childLanes|=C),A===F)break;A=A.return}}function Go(A,C){oi=A,es=Ko=null,A=A.dependencies,A!==null&&A.firstContext!==null&&(A.lanes&C&&(zn=!0),A.firstContext=null)}function mi(A){var C=A._currentValue;if(es!==A)if(A={context:A,memoizedValue:C,next:null},Ko===null){if(oi===null)throw Error(u(308));Ko=A,oi.dependencies={lanes:0,firstContext:A}}else Ko=Ko.next=A;return C}var ba=null;function Bl(A){ba===null?ba=[A]:ba.push(A)}function Pu(A,C,F,ne){var fe=C.interleaved;return fe===null?(F.next=F,Bl(C)):(F.next=fe.next,fe.next=F),C.interleaved=F,_o(A,ne)}function _o(A,C){A.lanes|=C;var F=A.alternate;for(F!==null&&(F.lanes|=C),F=A,A=A.return;A!==null;)A.childLanes|=C,F=A.alternate,F!==null&&(F.childLanes|=C),F=A,A=A.return;return F.tag===3?F.stateNode:null}var gi=!1;function ku(A){A.updateQueue={baseState:A.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function sf(A,C){A=A.updateQueue,C.updateQueue===A&&(C.updateQueue={baseState:A.baseState,firstBaseUpdate:A.firstBaseUpdate,lastBaseUpdate:A.lastBaseUpdate,shared:A.shared,effects:A.effects})}function wo(A,C){return{eventTime:A,lane:C,tag:0,payload:null,callback:null,next:null}}function vi(A,C,F){var ne=A.updateQueue;if(ne===null)return null;if(ne=ne.shared,$r&2){var fe=ne.pending;return fe===null?C.next=C:(C.next=fe.next,fe.next=C),ne.pending=C,_o(A,F)}return fe=ne.interleaved,fe===null?(C.next=C,Bl(ne)):(C.next=fe.next,fe.next=C),ne.interleaved=C,_o(A,F)}function Cu(A,C,F){if(C=C.updateQueue,C!==null&&(C=C.shared,(F&4194240)!==0)){var ne=C.lanes;ne&=A.pendingLanes,F|=ne,C.lanes=F,fo(A,F)}}function uf(A,C){var F=A.updateQueue,ne=A.alternate;if(ne!==null&&(ne=ne.updateQueue,F===ne)){var fe=null,ve=null;if(F=F.firstBaseUpdate,F!==null){do{var Ae={eventTime:F.eventTime,lane:F.lane,tag:F.tag,payload:F.payload,callback:F.callback,next:null};ve===null?fe=ve=Ae:ve=ve.next=Ae,F=F.next}while(F!==null);ve===null?fe=ve=C:ve=ve.next=C}else fe=ve=C;F={baseState:ne.baseState,firstBaseUpdate:fe,lastBaseUpdate:ve,shared:ne.shared,effects:ne.effects},A.updateQueue=F;return}A=F.lastBaseUpdate,A===null?F.firstBaseUpdate=C:A.next=C,F.lastBaseUpdate=C}function ts(A,C,F,ne){var fe=A.updateQueue;gi=!1;var ve=fe.firstBaseUpdate,Ae=fe.lastBaseUpdate,Be=fe.shared.pending;if(Be!==null){fe.shared.pending=null;var Ve=Be,gt=Ve.next;Ve.next=null,Ae===null?ve=gt:Ae.next=gt,Ae=Ve;var Tt=A.alternate;Tt!==null&&(Tt=Tt.updateQueue,Be=Tt.lastBaseUpdate,Be!==Ae&&(Be===null?Tt.firstBaseUpdate=gt:Be.next=gt,Tt.lastBaseUpdate=Ve))}if(ve!==null){var Pt=fe.baseState;Ae=0,Tt=gt=Ve=null,Be=ve;do{var At=Be.lane,Nt=Be.eventTime;if((ne&At)===At){Tt!==null&&(Tt=Tt.next={eventTime:Nt,lane:0,tag:Be.tag,payload:Be.payload,callback:Be.callback,next:null});e:{var Dt=A,jt=Be;switch(At=C,Nt=F,jt.tag){case 1:if(Dt=jt.payload,typeof Dt=="function"){Pt=Dt.call(Nt,Pt,At);break e}Pt=Dt;break e;case 3:Dt.flags=Dt.flags&-65537|128;case 0:if(Dt=jt.payload,At=typeof Dt=="function"?Dt.call(Nt,Pt,At):Dt,At==null)break e;Pt=m({},Pt,At);break e;case 2:gi=!0}}Be.callback!==null&&Be.lane!==0&&(A.flags|=64,At=fe.effects,At===null?fe.effects=[Be]:At.push(Be))}else Nt={eventTime:Nt,lane:At,tag:Be.tag,payload:Be.payload,callback:Be.callback,next:null},Tt===null?(gt=Tt=Nt,Ve=Pt):Tt=Tt.next=Nt,Ae|=At;if(Be=Be.next,Be===null){if(Be=fe.shared.pending,Be===null)break;At=Be,Be=At.next,At.next=null,fe.lastBaseUpdate=At,fe.shared.pending=null}}while(!0);if(Tt===null&&(Ve=Pt),fe.baseState=Ve,fe.firstBaseUpdate=gt,fe.lastBaseUpdate=Tt,C=fe.shared.interleaved,C!==null){fe=C;do Ae|=fe.lane,fe=fe.next;while(fe!==C)}else ve===null&&(fe.shared.lanes=0);Jo|=Ae,A.lanes=Ae,A.memoizedState=Pt}}function Dl(A,C,F){if(A=C.effects,C.effects=null,A!==null)for(C=0;C<A.length;C++){var ne=A[C],fe=ne.callback;if(fe!==null){if(ne.callback=null,ne=F,typeof fe!="function")throw Error(u(191,fe));fe.call(ne)}}}var Os={},ro=Gn(Os),$s=Gn(Os),rs=Gn(Os);function xo(A){if(A===Os)throw Error(u(174));return A}function ql(A,C){switch(zr(rs,C),zr($s,A),zr(ro,Os),A=C.nodeType,A){case 9:case 11:C=(C=C.documentElement)?C.namespaceURI:se(null,"");break;default:A=A===8?C.parentNode:C,C=A.namespaceURI||null,A=A.tagName,C=se(C,A)}Hr(ro),zr(ro,C)}function Wo(){Hr(ro),Hr($s),Hr(rs)}function Fl(A){xo(rs.current);var C=xo(ro.current),F=se(C,A.type);C!==F&&(zr($s,A),zr(ro,F))}function Iu(A){$s.current===A&&(Hr(ro),Hr($s))}var Gr=Gn(0);function wa(A){for(var C=A;C!==null;){if(C.tag===13){var F=C.memoizedState;if(F!==null&&(F=F.dehydrated,F===null||F.data==="$?"||F.data==="$!"))return C}else if(C.tag===19&&C.memoizedProps.revealOrder!==void 0){if(C.flags&128)return C}else if(C.child!==null){C.child.return=C,C=C.child;continue}if(C===A)break;for(;C.sibling===null;){if(C.return===null||C.return===A)return null;C=C.return}C.sibling.return=C.return,C=C.sibling}return null}var Ul=[];function Ou(){for(var A=0;A<Ul.length;A++)Ul[A]._workInProgressVersionPrimary=null;Ul.length=0}var Ns=V.ReactCurrentDispatcher,jl=V.ReactCurrentBatchConfig,Zo=0,Yr=null,Qr=null,fn=null,ns=!1,Ls=!1,xa=0,dr=0;function Ln(){throw Error(u(321))}function zl(A,C){if(C===null)return!1;for(var F=0;F<C.length&&F<A.length;F++)if(!pt(A[F],C[F]))return!1;return!0}function Ea(A,C,F,ne,fe,ve){if(Zo=ve,Yr=C,C.memoizedState=null,C.updateQueue=null,C.lanes=0,Ns.current=A===null||A.memoizedState===null?od:Fu,A=F(ne,fe),Ls){ve=0;do{if(Ls=!1,xa=0,25<=ve)throw Error(u(301));ve+=1,fn=Qr=null,C.updateQueue=null,Ns.current=ss,A=F(ne,fe)}while(Ls)}if(Ns.current=qu,C=Qr!==null&&Qr.next!==null,Zo=0,fn=Qr=Yr=null,ns=!1,C)throw Error(u(300));return A}function $u(){var A=xa!==0;return xa=0,A}function no(){var A={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return fn===null?Yr.memoizedState=fn=A:fn=fn.next=A,fn}function yi(){if(Qr===null){var A=Yr.alternate;A=A!==null?A.memoizedState:null}else A=Qr.next;var C=fn===null?Yr.memoizedState:fn.next;if(C!==null)fn=C,Qr=A;else{if(A===null)throw Error(u(310));Qr=A,A={memoizedState:Qr.memoizedState,baseState:Qr.baseState,baseQueue:Qr.baseQueue,queue:Qr.queue,next:null},fn===null?Yr.memoizedState=fn=A:fn=fn.next=A}return fn}function Bn(A,C){return typeof C=="function"?C(A):C}function Vl(A){var C=yi(),F=C.queue;if(F===null)throw Error(u(311));F.lastRenderedReducer=A;var ne=Qr,fe=ne.baseQueue,ve=F.pending;if(ve!==null){if(fe!==null){var Ae=fe.next;fe.next=ve.next,ve.next=Ae}ne.baseQueue=fe=ve,F.pending=null}if(fe!==null){ve=fe.next,ne=ne.baseState;var Be=Ae=null,Ve=null,gt=ve;do{var Tt=gt.lane;if((Zo&Tt)===Tt)Ve!==null&&(Ve=Ve.next={lane:0,action:gt.action,hasEagerState:gt.hasEagerState,eagerState:gt.eagerState,next:null}),ne=gt.hasEagerState?gt.eagerState:A(ne,gt.action);else{var Pt={lane:Tt,action:gt.action,hasEagerState:gt.hasEagerState,eagerState:gt.eagerState,next:null};Ve===null?(Be=Ve=Pt,Ae=ne):Ve=Ve.next=Pt,Yr.lanes|=Tt,Jo|=Tt}gt=gt.next}while(gt!==null&&gt!==ve);Ve===null?Ae=ne:Ve.next=Be,pt(ne,C.memoizedState)||(zn=!0),C.memoizedState=ne,C.baseState=Ae,C.baseQueue=Ve,F.lastRenderedState=ne}if(A=F.interleaved,A!==null){fe=A;do ve=fe.lane,Yr.lanes|=ve,Jo|=ve,fe=fe.next;while(fe!==A)}else fe===null&&(F.lanes=0);return[C.memoizedState,F.dispatch]}function is(A){var C=yi(),F=C.queue;if(F===null)throw Error(u(311));F.lastRenderedReducer=A;var ne=F.dispatch,fe=F.pending,ve=C.memoizedState;if(fe!==null){F.pending=null;var Ae=fe=fe.next;do ve=A(ve,Ae.action),Ae=Ae.next;while(Ae!==fe);pt(ve,C.memoizedState)||(zn=!0),C.memoizedState=ve,C.baseQueue===null&&(C.baseState=ve),F.lastRenderedState=ve}return[ve,ne]}function Nu(){}function Hl(A,C){var F=Yr,ne=yi(),fe=C(),ve=!pt(ne.memoizedState,fe);if(ve&&(ne.memoizedState=fe,zn=!0),ne=ne.queue,io(Eo.bind(null,F,ne,A),[A]),ne.getSnapshot!==C||ve||fn!==null&&fn.memoizedState.tag&1){if(F.flags|=2048,os(9,Xn.bind(null,F,ne,fe,C),void 0,null),yn===null)throw Error(u(349));Zo&30||Kl(F,C,fe)}return fe}function Kl(A,C,F){A.flags|=16384,A={getSnapshot:C,value:F},C=Yr.updateQueue,C===null?(C={lastEffect:null,stores:null},Yr.updateQueue=C,C.stores=[A]):(F=C.stores,F===null?C.stores=[A]:F.push(A))}function Xn(A,C,F,ne){C.value=F,C.getSnapshot=ne,Lu(C)&&Gl(A)}function Eo(A,C,F){return F(function(){Lu(C)&&Gl(A)})}function Lu(A){var C=A.getSnapshot;A=A.value;try{var F=C();return!pt(A,F)}catch{return!0}}function Gl(A){var C=_o(A,1);C!==null&&Bi(C,A,1,-1)}function Bs(A){var C=no();return typeof A=="function"&&(A=A()),C.memoizedState=C.baseState=A,A={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Bn,lastRenderedState:A},C.queue=A,A=A.dispatch=pf.bind(null,Yr,A),[C.memoizedState,A]}function os(A,C,F,ne){return A={tag:A,create:C,destroy:F,deps:ne,next:null},C=Yr.updateQueue,C===null?(C={lastEffect:null,stores:null},Yr.updateQueue=C,C.lastEffect=A.next=A):(F=C.lastEffect,F===null?C.lastEffect=A.next=A:(ne=F.next,F.next=A,A.next=ne,C.lastEffect=A)),A}function Bu(){return yi().memoizedState}function Ds(A,C,F,ne){var fe=no();Yr.flags|=A,fe.memoizedState=os(1|C,F,void 0,ne===void 0?null:ne)}function as(A,C,F,ne){var fe=yi();ne=ne===void 0?null:ne;var ve=void 0;if(Qr!==null){var Ae=Qr.memoizedState;if(ve=Ae.destroy,ne!==null&&zl(ne,Ae.deps)){fe.memoizedState=os(C,F,ve,ne);return}}Yr.flags|=A,fe.memoizedState=os(1|C,F,ve,ne)}function Du(A,C){return Ds(8390656,8,A,C)}function io(A,C){return as(2048,8,A,C)}function lf(A,C){return as(4,2,A,C)}function So(A,C){return as(4,4,A,C)}function Wl(A,C){if(typeof C=="function")return A=A(),C(A),function(){C(null)};if(C!=null)return A=A(),C.current=A,function(){C.current=null}}function Zl(A,C,F){return F=F!=null?F.concat([A]):null,as(4,4,Wl.bind(null,C,A),F)}function qs(){}function cf(A,C){var F=yi();C=C===void 0?null:C;var ne=F.memoizedState;return ne!==null&&C!==null&&zl(C,ne[1])?ne[0]:(F.memoizedState=[A,C],A)}function ff(A,C){var F=yi();C=C===void 0?null:C;var ne=F.memoizedState;return ne!==null&&C!==null&&zl(C,ne[1])?ne[0]:(A=A(),F.memoizedState=[A,C],A)}function df(A,C,F){return Zo&21?(pt(F,C)||(F=ia(),Yr.lanes|=F,Jo|=F,A.baseState=!0),C):(A.baseState&&(A.baseState=!1,zn=!0),A.memoizedState=F)}function hf(A,C){var F=br;br=F!==0&&4>F?F:4,A(!0);var ne=jl.transition;jl.transition={};try{A(!1),C()}finally{br=F,jl.transition=ne}}function Yl(){return yi().memoizedState}function nd(A,C,F){var ne=ta(A);if(F={lane:ne,action:F,hasEagerState:!1,eagerState:null,next:null},Xl(A))jn(C,F);else if(F=Pu(A,C,F,ne),F!==null){var fe=Kn();Bi(F,A,ne,fe),Ii(F,C,ne)}}function pf(A,C,F){var ne=ta(A),fe={lane:ne,action:F,hasEagerState:!1,eagerState:null,next:null};if(Xl(A))jn(C,fe);else{var ve=A.alternate;if(A.lanes===0&&(ve===null||ve.lanes===0)&&(ve=C.lastRenderedReducer,ve!==null))try{var Ae=C.lastRenderedState,Be=ve(Ae,F);if(fe.hasEagerState=!0,fe.eagerState=Be,pt(Be,Ae)){var Ve=C.interleaved;Ve===null?(fe.next=fe,Bl(C)):(fe.next=Ve.next,Ve.next=fe),C.interleaved=fe;return}}catch{}finally{}F=Pu(A,C,fe,ne),F!==null&&(fe=Kn(),Bi(F,A,ne,fe),Ii(F,C,ne))}}function Xl(A){var C=A.alternate;return A===Yr||C!==null&&C===Yr}function jn(A,C){Ls=ns=!0;var F=A.pending;F===null?C.next=C:(C.next=F.next,F.next=C),A.pending=C}function Ii(A,C,F){if(F&4194240){var ne=C.lanes;ne&=A.pendingLanes,F|=ne,C.lanes=F,fo(A,F)}}var qu={readContext:mi,useCallback:Ln,useContext:Ln,useEffect:Ln,useImperativeHandle:Ln,useInsertionEffect:Ln,useLayoutEffect:Ln,useMemo:Ln,useReducer:Ln,useRef:Ln,useState:Ln,useDebugValue:Ln,useDeferredValue:Ln,useTransition:Ln,useMutableSource:Ln,useSyncExternalStore:Ln,useId:Ln,unstable_isNewReconciler:!1},od={readContext:mi,useCallback:function(A,C){return no().memoizedState=[A,C===void 0?null:C],A},useContext:mi,useEffect:Du,useImperativeHandle:function(A,C,F){return F=F!=null?F.concat([A]):null,Ds(4194308,4,Wl.bind(null,C,A),F)},useLayoutEffect:function(A,C){return Ds(4194308,4,A,C)},useInsertionEffect:function(A,C){return Ds(4,2,A,C)},useMemo:function(A,C){var F=no();return C=C===void 0?null:C,A=A(),F.memoizedState=[A,C],A},useReducer:function(A,C,F){var ne=no();return C=F!==void 0?F(C):C,ne.memoizedState=ne.baseState=C,A={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:A,lastRenderedState:C},ne.queue=A,A=A.dispatch=nd.bind(null,Yr,A),[ne.memoizedState,A]},useRef:function(A){var C=no();return A={current:A},C.memoizedState=A},useState:Bs,useDebugValue:qs,useDeferredValue:function(A){return no().memoizedState=A},useTransition:function(){var A=Bs(!1),C=A[0];return A=hf.bind(null,A[1]),no().memoizedState=A,[C,A]},useMutableSource:function(){},useSyncExternalStore:function(A,C,F){var ne=Yr,fe=no();if(Kr){if(F===void 0)throw Error(u(407));F=F()}else{if(F=C(),yn===null)throw Error(u(349));Zo&30||Kl(ne,C,F)}fe.memoizedState=F;var ve={value:F,getSnapshot:C};return fe.queue=ve,Du(Eo.bind(null,ne,ve,A),[A]),ne.flags|=2048,os(9,Xn.bind(null,ne,ve,F,C),void 0,null),F},useId:function(){var A=no(),C=yn.identifierPrefix;if(Kr){var F=Ji,ne=Xi;F=(ne&~(1<<32-ln(ne)-1)).toString(32)+F,C=":"+C+"R"+F,F=xa++,0<F&&(C+="H"+F.toString(32)),C+=":"}else F=dr++,C=":"+C+"r"+F.toString(32)+":";return A.memoizedState=C},unstable_isNewReconciler:!1},Fu={readContext:mi,useCallback:cf,useContext:mi,useEffect:io,useImperativeHandle:Zl,useInsertionEffect:lf,useLayoutEffect:So,useMemo:ff,useReducer:Vl,useRef:Bu,useState:function(){return Vl(Bn)},useDebugValue:qs,useDeferredValue:function(A){var C=yi();return df(C,Qr.memoizedState,A)},useTransition:function(){var A=Vl(Bn)[0],C=yi().memoizedState;return[A,C]},useMutableSource:Nu,useSyncExternalStore:Hl,useId:Yl,unstable_isNewReconciler:!1},ss={readContext:mi,useCallback:cf,useContext:mi,useEffect:io,useImperativeHandle:Zl,useInsertionEffect:lf,useLayoutEffect:So,useMemo:ff,useReducer:is,useRef:Bu,useState:function(){return is(Bn)},useDebugValue:qs,useDeferredValue:function(A){var C=yi();return Qr===null?C.memoizedState=A:df(C,Qr.memoizedState,A)},useTransition:function(){var A=is(Bn)[0],C=yi().memoizedState;return[A,C]},useMutableSource:Nu,useSyncExternalStore:Hl,useId:Yl,unstable_isNewReconciler:!1};function bi(A,C){if(A&&A.defaultProps){C=m({},C),A=A.defaultProps;for(var F in A)C[F]===void 0&&(C[F]=A[F]);return C}return C}function Uu(A,C,F,ne){C=A.memoizedState,F=F(ne,C),F=F==null?C:m({},C,F),A.memoizedState=F,A.lanes===0&&(A.updateQueue.baseState=F)}var ju={isMounted:function(A){return(A=A._reactInternals)?mt(A)===A:!1},enqueueSetState:function(A,C,F){A=A._reactInternals;var ne=Kn(),fe=ta(A),ve=wo(ne,fe);ve.payload=C,F!=null&&(ve.callback=F),C=vi(A,ve,fe),C!==null&&(Bi(C,A,fe,ne),Cu(C,A,fe))},enqueueReplaceState:function(A,C,F){A=A._reactInternals;var ne=Kn(),fe=ta(A),ve=wo(ne,fe);ve.tag=1,ve.payload=C,F!=null&&(ve.callback=F),C=vi(A,ve,fe),C!==null&&(Bi(C,A,fe,ne),Cu(C,A,fe))},enqueueForceUpdate:function(A,C){A=A._reactInternals;var F=Kn(),ne=ta(A),fe=wo(F,ne);fe.tag=2,C!=null&&(fe.callback=C),C=vi(A,fe,ne),C!==null&&(Bi(C,A,ne,F),Cu(C,A,ne))}};function Jl(A,C,F,ne,fe,ve,Ae){return A=A.stateNode,typeof A.shouldComponentUpdate=="function"?A.shouldComponentUpdate(ne,ve,Ae):C.prototype&&C.prototype.isPureReactComponent?!$t(F,ne)||!$t(fe,ve):!0}function Sa(A,C,F){var ne=!1,fe=Vo,ve=C.contextType;return typeof ve=="object"&&ve!==null?ve=mi(ve):(fe=Zn(C)?Un:On.current,ne=C.contextTypes,ve=(ne=ne!=null)?Ja(A,fe):Vo),C=new C(F,ve),A.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,C.updater=ju,A.stateNode=C,C._reactInternals=A,ne&&(A=A.stateNode,A.__reactInternalMemoizedUnmaskedChildContext=fe,A.__reactInternalMemoizedMaskedChildContext=ve),C}function us(A,C,F,ne){A=C.state,typeof C.componentWillReceiveProps=="function"&&C.componentWillReceiveProps(F,ne),typeof C.UNSAFE_componentWillReceiveProps=="function"&&C.UNSAFE_componentWillReceiveProps(F,ne),C.state!==A&&ju.enqueueReplaceState(C,C.state,null)}function Ql(A,C,F,ne){var fe=A.stateNode;fe.props=F,fe.state=A.memoizedState,fe.refs={},ku(A);var ve=C.contextType;typeof ve=="object"&&ve!==null?fe.context=mi(ve):(ve=Zn(C)?Un:On.current,fe.context=Ja(A,ve)),fe.state=A.memoizedState,ve=C.getDerivedStateFromProps,typeof ve=="function"&&(Uu(A,C,ve,F),fe.state=A.memoizedState),typeof C.getDerivedStateFromProps=="function"||typeof fe.getSnapshotBeforeUpdate=="function"||typeof fe.UNSAFE_componentWillMount!="function"&&typeof fe.componentWillMount!="function"||(C=fe.state,typeof fe.componentWillMount=="function"&&fe.componentWillMount(),typeof fe.UNSAFE_componentWillMount=="function"&&fe.UNSAFE_componentWillMount(),C!==fe.state&&ju.enqueueReplaceState(fe,fe.state,null),ts(A,F,fe,ne),fe.state=A.memoizedState),typeof fe.componentDidMount=="function"&&(A.flags|=4194308)}function Aa(A,C){try{var F="",ne=C;do F+=ge(ne),ne=ne.return;while(ne);var fe=F}catch(ve){fe=`
Error generating stack: `+ve.message+`
`+ve.stack}return{value:A,source:C,stack:fe,digest:null}}function zu(A,C,F){return{value:A,source:null,stack:F??null,digest:C??null}}function ls(A,C){try{console.error(C.value)}catch(F){setTimeout(function(){throw F})}}var mf=typeof WeakMap=="function"?WeakMap:Map;function Fs(A,C,F){F=wo(-1,F),F.tag=3,F.payload={element:null};var ne=C.value;return F.callback=function(){el||(el=!0,gc=ne),ls(A,C)},F}function Vu(A,C,F){F=wo(-1,F),F.tag=3;var ne=A.type.getDerivedStateFromError;if(typeof ne=="function"){var fe=C.value;F.payload=function(){return ne(fe)},F.callback=function(){ls(A,C)}}var ve=A.stateNode;return ve!==null&&typeof ve.componentDidCatch=="function"&&(F.callback=function(){ls(A,C),typeof ne!="function"&&(Qo===null?Qo=new Set([this]):Qo.add(this));var Ae=C.stack;this.componentDidCatch(C.value,{componentStack:Ae!==null?Ae:""})}),F}function Us(A,C,F){var ne=A.pingCache;if(ne===null){ne=A.pingCache=new mf;var fe=new Set;ne.set(C,fe)}else fe=ne.get(C),fe===void 0&&(fe=new Set,ne.set(C,fe));fe.has(F)||(fe.add(F),A=hd.bind(null,A,C,F),C.then(A,A))}function gf(A){do{var C;if((C=A.tag===13)&&(C=A.memoizedState,C=C!==null?C.dehydrated!==null:!0),C)return A;A=A.return}while(A!==null);return null}function tc(A,C,F,ne,fe){return A.mode&1?(A.flags|=65536,A.lanes=fe,A):(A===C?A.flags|=65536:(A.flags|=128,F.flags|=131072,F.flags&=-52805,F.tag===1&&(F.alternate===null?F.tag=17:(C=wo(-1,1),C.tag=2,vi(F,C,1))),F.lanes|=1),A)}var Hu=V.ReactCurrentOwner,zn=!1;function xn(A,C,F,ne){C.child=A===null?Ru(C,null,F,ne):Jr(C,A.child,F,ne)}function vf(A,C,F,ne,fe){F=F.render;var ve=C.ref;return Go(C,fe),ne=Ea(A,C,F,ne,ve,fe),F=$u(),A!==null&&!zn?(C.updateQueue=A.updateQueue,C.flags&=-2053,A.lanes&=~fe,Oi(A,C,fe)):(Kr&&F&&Ps(C),C.flags|=1,xn(A,C,ne,fe),C.child)}function rc(A,C,F,ne,fe){if(A===null){var ve=F.type;return typeof ve=="function"&&!al(ve)&&ve.defaultProps===void 0&&F.compare===null&&F.defaultProps===void 0?(C.tag=15,C.type=ve,oo(A,C,ve,ne,fe)):(A=sl(F.type,null,ne,C,C.mode,fe),A.ref=C.ref,A.return=C,C.child=A)}if(ve=A.child,!(A.lanes&fe)){var Ae=ve.memoizedProps;if(F=F.compare,F=F!==null?F:$t,F(Ae,ne)&&A.ref===C.ref)return Oi(A,C,fe)}return C.flags|=1,A=Di(ve,ne),A.ref=C.ref,A.return=C,C.child=A}function oo(A,C,F,ne,fe){if(A!==null){var ve=A.memoizedProps;if($t(ve,ne)&&A.ref===C.ref)if(zn=!1,C.pendingProps=ne=ve,(A.lanes&fe)!==0)A.flags&131072&&(zn=!0);else return C.lanes=A.lanes,Oi(A,C,fe)}return oc(A,C,F,ne,fe)}function nc(A,C,F){var ne=C.pendingProps,fe=ne.children,ve=A!==null?A.memoizedState:null;if(ne.mode==="hidden")if(!(C.mode&1))C.memoizedState={baseLanes:0,cachePool:null,transitions:null},zr(hs,si),si|=F;else{if(!(F&1073741824))return A=ve!==null?ve.baseLanes|F:F,C.lanes=C.childLanes=1073741824,C.memoizedState={baseLanes:A,cachePool:null,transitions:null},C.updateQueue=null,zr(hs,si),si|=A,null;C.memoizedState={baseLanes:0,cachePool:null,transitions:null},ne=ve!==null?ve.baseLanes:F,zr(hs,si),si|=ne}else ve!==null?(ne=ve.baseLanes|F,C.memoizedState=null):ne=F,zr(hs,si),si|=ne;return xn(A,C,fe,F),C.child}function ic(A,C){var F=C.ref;(A===null&&F!==null||A!==null&&A.ref!==F)&&(C.flags|=512,C.flags|=2097152)}function oc(A,C,F,ne,fe){var ve=Zn(F)?Un:On.current;return ve=Ja(C,ve),Go(C,fe),F=Ea(A,C,F,ne,ve,fe),ne=$u(),A!==null&&!zn?(C.updateQueue=A.updateQueue,C.flags&=-2053,A.lanes&=~fe,Oi(A,C,fe)):(Kr&&ne&&Ps(C),C.flags|=1,xn(A,C,F,fe),C.child)}function ac(A,C,F,ne,fe){if(Zn(F)){var ve=!0;di(C)}else ve=!1;if(Go(C,fe),C.stateNode===null)Gu(A,C),Sa(C,F,ne),Ql(C,F,ne,fe),ne=!0;else if(A===null){var Ae=C.stateNode,Be=C.memoizedProps;Ae.props=Be;var Ve=Ae.context,gt=F.contextType;typeof gt=="object"&&gt!==null?gt=mi(gt):(gt=Zn(F)?Un:On.current,gt=Ja(C,gt));var Tt=F.getDerivedStateFromProps,Pt=typeof Tt=="function"||typeof Ae.getSnapshotBeforeUpdate=="function";Pt||typeof Ae.UNSAFE_componentWillReceiveProps!="function"&&typeof Ae.componentWillReceiveProps!="function"||(Be!==ne||Ve!==gt)&&us(C,Ae,ne,gt),gi=!1;var At=C.memoizedState;Ae.state=At,ts(C,ne,Ae,fe),Ve=C.memoizedState,Be!==ne||At!==Ve||Wn.current||gi?(typeof Tt=="function"&&(Uu(C,F,Tt,ne),Ve=C.memoizedState),(Be=gi||Jl(C,F,Be,ne,At,Ve,gt))?(Pt||typeof Ae.UNSAFE_componentWillMount!="function"&&typeof Ae.componentWillMount!="function"||(typeof Ae.componentWillMount=="function"&&Ae.componentWillMount(),typeof Ae.UNSAFE_componentWillMount=="function"&&Ae.UNSAFE_componentWillMount()),typeof Ae.componentDidMount=="function"&&(C.flags|=4194308)):(typeof Ae.componentDidMount=="function"&&(C.flags|=4194308),C.memoizedProps=ne,C.memoizedState=Ve),Ae.props=ne,Ae.state=Ve,Ae.context=gt,ne=Be):(typeof Ae.componentDidMount=="function"&&(C.flags|=4194308),ne=!1)}else{Ae=C.stateNode,sf(A,C),Be=C.memoizedProps,gt=C.type===C.elementType?Be:bi(C.type,Be),Ae.props=gt,Pt=C.pendingProps,At=Ae.context,Ve=F.contextType,typeof Ve=="object"&&Ve!==null?Ve=mi(Ve):(Ve=Zn(F)?Un:On.current,Ve=Ja(C,Ve));var Nt=F.getDerivedStateFromProps;(Tt=typeof Nt=="function"||typeof Ae.getSnapshotBeforeUpdate=="function")||typeof Ae.UNSAFE_componentWillReceiveProps!="function"&&typeof Ae.componentWillReceiveProps!="function"||(Be!==Pt||At!==Ve)&&us(C,Ae,ne,Ve),gi=!1,At=C.memoizedState,Ae.state=At,ts(C,ne,Ae,fe);var Dt=C.memoizedState;Be!==Pt||At!==Dt||Wn.current||gi?(typeof Nt=="function"&&(Uu(C,F,Nt,ne),Dt=C.memoizedState),(gt=gi||Jl(C,F,gt,ne,At,Dt,Ve)||!1)?(Tt||typeof Ae.UNSAFE_componentWillUpdate!="function"&&typeof Ae.componentWillUpdate!="function"||(typeof Ae.componentWillUpdate=="function"&&Ae.componentWillUpdate(ne,Dt,Ve),typeof Ae.UNSAFE_componentWillUpdate=="function"&&Ae.UNSAFE_componentWillUpdate(ne,Dt,Ve)),typeof Ae.componentDidUpdate=="function"&&(C.flags|=4),typeof Ae.getSnapshotBeforeUpdate=="function"&&(C.flags|=1024)):(typeof Ae.componentDidUpdate!="function"||Be===A.memoizedProps&&At===A.memoizedState||(C.flags|=4),typeof Ae.getSnapshotBeforeUpdate!="function"||Be===A.memoizedProps&&At===A.memoizedState||(C.flags|=1024),C.memoizedProps=ne,C.memoizedState=Dt),Ae.props=ne,Ae.state=Dt,Ae.context=Ve,ne=gt):(typeof Ae.componentDidUpdate!="function"||Be===A.memoizedProps&&At===A.memoizedState||(C.flags|=4),typeof Ae.getSnapshotBeforeUpdate!="function"||Be===A.memoizedProps&&At===A.memoizedState||(C.flags|=1024),ne=!1)}return sc(A,C,F,ne,ve,fe)}function sc(A,C,F,ne,fe,ve){ic(A,C);var Ae=(C.flags&128)!==0;if(!ne&&!Ae)return fe&&Qc(C,F,!1),Oi(A,C,ve);ne=C.stateNode,Hu.current=C;var Be=Ae&&typeof F.getDerivedStateFromError!="function"?null:ne.render();return C.flags|=1,A!==null&&Ae?(C.child=Jr(C,A.child,null,ve),C.child=Jr(C,null,Be,ve)):xn(A,C,Be,ve),C.memoizedState=ne.state,fe&&Qc(C,F,!0),C.child}function yf(A){var C=A.stateNode;C.pendingContext?Xc(A,C.pendingContext,C.pendingContext!==C.context):C.context&&Xc(A,C.context,!1),ql(A,C.containerInfo)}function ao(A,C,F,ne,fe){return eo(),to(fe),C.flags|=256,xn(A,C,F,ne),C.child}var js={dehydrated:null,treeContext:null,retryLane:0};function zs(A){return{baseLanes:A,cachePool:null,transitions:null}}function Ku(A,C,F){var ne=C.pendingProps,fe=Gr.current,ve=!1,Ae=(C.flags&128)!==0,Be;if((Be=Ae)||(Be=A!==null&&A.memoizedState===null?!1:(fe&2)!==0),Be?(ve=!0,C.flags&=-129):(A===null||A.memoizedState!==null)&&(fe|=1),zr(Gr,fe&1),A===null)return Yn(C),A=C.memoizedState,A!==null&&(A=A.dehydrated,A!==null)?(C.mode&1?A.data==="$!"?C.lanes=8:C.lanes=1073741824:C.lanes=1,null):(Ae=ne.children,A=ne.fallback,ve?(ne=C.mode,ve=C.child,Ae={mode:"hidden",children:Ae},!(ne&1)&&ve!==null?(ve.childLanes=0,ve.pendingProps=Ae):ve=ul(Ae,ne,0,null),A=ka(A,ne,F,null),ve.return=C,A.return=C,ve.sibling=A,C.child=ve,C.child.memoizedState=zs(F),C.memoizedState=js,A):cs(C,Ae));if(fe=A.memoizedState,fe!==null&&(Be=fe.dehydrated,Be!==null))return tr(A,C,Ae,ne,Be,fe,F);if(ve){ve=ne.fallback,Ae=C.mode,fe=A.child,Be=fe.sibling;var Ve={mode:"hidden",children:ne.children};return!(Ae&1)&&C.child!==fe?(ne=C.child,ne.childLanes=0,ne.pendingProps=Ve,C.deletions=null):(ne=Di(fe,Ve),ne.subtreeFlags=fe.subtreeFlags&14680064),Be!==null?ve=Di(Be,ve):(ve=ka(ve,Ae,F,null),ve.flags|=2),ve.return=C,ne.return=C,ne.sibling=ve,C.child=ne,ne=ve,ve=C.child,Ae=A.child.memoizedState,Ae=Ae===null?zs(F):{baseLanes:Ae.baseLanes|F,cachePool:null,transitions:Ae.transitions},ve.memoizedState=Ae,ve.childLanes=A.childLanes&~F,C.memoizedState=js,ne}return ve=A.child,A=ve.sibling,ne=Di(ve,{mode:"visible",children:ne.children}),!(C.mode&1)&&(ne.lanes=F),ne.return=C,ne.sibling=null,A!==null&&(F=C.deletions,F===null?(C.deletions=[A],C.flags|=16):F.push(A)),C.child=ne,C.memoizedState=null,ne}function cs(A,C){return C=ul({mode:"visible",children:C},A.mode,0,null),C.return=A,A.child=C}function Ao(A,C,F,ne){return ne!==null&&to(ne),Jr(C,A.child,null,F),A=cs(C,C.pendingProps.children),A.flags|=2,C.memoizedState=null,A}function tr(A,C,F,ne,fe,ve,Ae){if(F)return C.flags&256?(C.flags&=-257,ne=zu(Error(u(422))),Ao(A,C,Ae,ne)):C.memoizedState!==null?(C.child=A.child,C.flags|=128,null):(ve=ne.fallback,fe=C.mode,ne=ul({mode:"visible",children:ne.children},fe,0,null),ve=ka(ve,fe,Ae,null),ve.flags|=2,ne.return=C,ve.return=C,ne.sibling=ve,C.child=ne,C.mode&1&&Jr(C,A.child,null,Ae),C.child.memoizedState=zs(Ae),C.memoizedState=js,ve);if(!(C.mode&1))return Ao(A,C,Ae,null);if(fe.data==="$!"){if(ne=fe.nextSibling&&fe.nextSibling.dataset,ne)var Be=ne.dgst;return ne=Be,ve=Error(u(419)),ne=zu(ve,ne,void 0),Ao(A,C,Ae,ne)}if(Be=(Ae&A.childLanes)!==0,zn||Be){if(ne=yn,ne!==null){switch(Ae&-Ae){case 4:fe=2;break;case 16:fe=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:fe=32;break;case 536870912:fe=268435456;break;default:fe=0}fe=fe&(ne.suspendedLanes|Ae)?0:fe,fe!==0&&fe!==ve.retryLane&&(ve.retryLane=fe,_o(A,fe),Bi(ne,A,fe,-1))}return Ec(),ne=zu(Error(u(421))),Ao(A,C,Ae,ne)}return fe.data==="$?"?(C.flags|=128,C.child=A.child,C=pd.bind(null,A),fe._reactRetry=C,null):(A=ve.treeContext,ii=jo(fe.nextSibling),Nn=C,Kr=!0,Ci=null,A!==null&&(hi[pi++]=Xi,hi[pi++]=Ji,hi[pi++]=ma,Xi=A.id,Ji=A.overflow,ma=C),C=cs(C,ne.children),C.flags|=4096,C)}function Vs(A,C,F){A.lanes|=C;var ne=A.alternate;ne!==null&&(ne.lanes|=C),wn(A.return,C,F)}function Hs(A,C,F,ne,fe){var ve=A.memoizedState;ve===null?A.memoizedState={isBackwards:C,rendering:null,renderingStartTime:0,last:ne,tail:F,tailMode:fe}:(ve.isBackwards=C,ve.rendering=null,ve.renderingStartTime=0,ve.last=ne,ve.tail=F,ve.tailMode=fe)}function Yo(A,C,F){var ne=C.pendingProps,fe=ne.revealOrder,ve=ne.tail;if(xn(A,C,ne.children,F),ne=Gr.current,ne&2)ne=ne&1|2,C.flags|=128;else{if(A!==null&&A.flags&128)e:for(A=C.child;A!==null;){if(A.tag===13)A.memoizedState!==null&&Vs(A,F,C);else if(A.tag===19)Vs(A,F,C);else if(A.child!==null){A.child.return=A,A=A.child;continue}if(A===C)break e;for(;A.sibling===null;){if(A.return===null||A.return===C)break e;A=A.return}A.sibling.return=A.return,A=A.sibling}ne&=1}if(zr(Gr,ne),!(C.mode&1))C.memoizedState=null;else switch(fe){case"forwards":for(F=C.child,fe=null;F!==null;)A=F.alternate,A!==null&&wa(A)===null&&(fe=F),F=F.sibling;F=fe,F===null?(fe=C.child,C.child=null):(fe=F.sibling,F.sibling=null),Hs(C,!1,fe,F,ve);break;case"backwards":for(F=null,fe=C.child,C.child=null;fe!==null;){if(A=fe.alternate,A!==null&&wa(A)===null){C.child=fe;break}A=fe.sibling,fe.sibling=F,F=fe,fe=A}Hs(C,!0,F,null,ve);break;case"together":Hs(C,!1,null,null,void 0);break;default:C.memoizedState=null}return C.child}function Gu(A,C){!(C.mode&1)&&A!==null&&(A.alternate=null,C.alternate=null,C.flags|=2)}function Oi(A,C,F){if(A!==null&&(C.dependencies=A.dependencies),Jo|=C.lanes,!(F&C.childLanes))return null;if(A!==null&&C.child!==A.child)throw Error(u(153));if(C.child!==null){for(A=C.child,F=Di(A,A.pendingProps),C.child=F,F.return=C;A.sibling!==null;)A=A.sibling,F=F.sibling=Di(A,A.pendingProps),F.return=C;F.sibling=null}return C.child}function bf(A,C,F){switch(C.tag){case 3:yf(C),eo();break;case 5:Fl(C);break;case 1:Zn(C.type)&&di(C);break;case 4:ql(C,C.stateNode.containerInfo);break;case 10:var ne=C.type._context,fe=C.memoizedProps.value;zr(Is,ne._currentValue),ne._currentValue=fe;break;case 13:if(ne=C.memoizedState,ne!==null)return ne.dehydrated!==null?(zr(Gr,Gr.current&1),C.flags|=128,null):F&C.child.childLanes?Ku(A,C,F):(zr(Gr,Gr.current&1),A=Oi(A,C,F),A!==null?A.sibling:null);zr(Gr,Gr.current&1);break;case 19:if(ne=(F&C.childLanes)!==0,A.flags&128){if(ne)return Yo(A,C,F);C.flags|=128}if(fe=C.memoizedState,fe!==null&&(fe.rendering=null,fe.tail=null,fe.lastEffect=null),zr(Gr,Gr.current),ne)break;return null;case 22:case 23:return C.lanes=0,nc(A,C,F)}return Oi(A,C,F)}var En,uc,wf,lc;En=function(A,C){for(var F=C.child;F!==null;){if(F.tag===5||F.tag===6)A.appendChild(F.stateNode);else if(F.tag!==4&&F.child!==null){F.child.return=F,F=F.child;continue}if(F===C)break;for(;F.sibling===null;){if(F.return===null||F.return===C)return;F=F.return}F.sibling.return=F.return,F=F.sibling}},uc=function(){},wf=function(A,C,F,ne){var fe=A.memoizedProps;if(fe!==ne){A=C.stateNode,xo(ro.current);var ve=null;switch(F){case"input":fe=Ne(A,fe),ne=Ne(A,ne),ve=[];break;case"select":fe=m({},fe,{value:void 0}),ne=m({},ne,{value:void 0}),ve=[];break;case"textarea":fe=De(A,fe),ne=De(A,ne),ve=[];break;default:typeof fe.onClick!="function"&&typeof ne.onClick=="function"&&(A.onclick=yu)}je(F,ne);var Ae;F=null;for(gt in fe)if(!ne.hasOwnProperty(gt)&&fe.hasOwnProperty(gt)&&fe[gt]!=null)if(gt==="style"){var Be=fe[gt];for(Ae in Be)Be.hasOwnProperty(Ae)&&(F||(F={}),F[Ae]="")}else gt!=="dangerouslySetInnerHTML"&&gt!=="children"&&gt!=="suppressContentEditableWarning"&&gt!=="suppressHydrationWarning"&&gt!=="autoFocus"&&(f.hasOwnProperty(gt)?ve||(ve=[]):(ve=ve||[]).push(gt,null));for(gt in ne){var Ve=ne[gt];if(Be=fe!=null?fe[gt]:void 0,ne.hasOwnProperty(gt)&&Ve!==Be&&(Ve!=null||Be!=null))if(gt==="style")if(Be){for(Ae in Be)!Be.hasOwnProperty(Ae)||Ve&&Ve.hasOwnProperty(Ae)||(F||(F={}),F[Ae]="");for(Ae in Ve)Ve.hasOwnProperty(Ae)&&Be[Ae]!==Ve[Ae]&&(F||(F={}),F[Ae]=Ve[Ae])}else F||(ve||(ve=[]),ve.push(gt,F)),F=Ve;else gt==="dangerouslySetInnerHTML"?(Ve=Ve?Ve.__html:void 0,Be=Be?Be.__html:void 0,Ve!=null&&Be!==Ve&&(ve=ve||[]).push(gt,Ve)):gt==="children"?typeof Ve!="string"&&typeof Ve!="number"||(ve=ve||[]).push(gt,""+Ve):gt!=="suppressContentEditableWarning"&&gt!=="suppressHydrationWarning"&&(f.hasOwnProperty(gt)?(Ve!=null&&gt==="onScroll"&&Vr("scroll",A),ve||Be===Ve||(ve=[])):(ve=ve||[]).push(gt,Ve))}F&&(ve=ve||[]).push("style",F);var gt=ve;(C.updateQueue=gt)&&(C.flags|=4)}},lc=function(A,C,F,ne){F!==ne&&(C.flags|=4)};function Ks(A,C){if(!Kr)switch(A.tailMode){case"hidden":C=A.tail;for(var F=null;C!==null;)C.alternate!==null&&(F=C),C=C.sibling;F===null?A.tail=null:F.sibling=null;break;case"collapsed":F=A.tail;for(var ne=null;F!==null;)F.alternate!==null&&(ne=F),F=F.sibling;ne===null?C||A.tail===null?A.tail=null:A.tail.sibling=null:ne.sibling=null}}function Sn(A){var C=A.alternate!==null&&A.alternate.child===A.child,F=0,ne=0;if(C)for(var fe=A.child;fe!==null;)F|=fe.lanes|fe.childLanes,ne|=fe.subtreeFlags&14680064,ne|=fe.flags&14680064,fe.return=A,fe=fe.sibling;else for(fe=A.child;fe!==null;)F|=fe.lanes|fe.childLanes,ne|=fe.subtreeFlags,ne|=fe.flags,fe.return=A,fe=fe.sibling;return A.subtreeFlags|=ne,A.childLanes=F,C}function ad(A,C,F){var ne=C.pendingProps;switch(va(C),C.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Sn(C),null;case 1:return Zn(C.type)&&xu(),Sn(C),null;case 3:return ne=C.stateNode,Wo(),Hr(Wn),Hr(On),Ou(),ne.pendingContext&&(ne.context=ne.pendingContext,ne.pendingContext=null),(A===null||A.child===null)&&(ks(C)?C.flags|=4:A===null||A.memoizedState.isDehydrated&&!(C.flags&256)||(C.flags|=1024,Ci!==null&&(bc(Ci),Ci=null))),uc(A,C),Sn(C),null;case 5:Iu(C);var fe=xo(rs.current);if(F=C.type,A!==null&&C.stateNode!=null)wf(A,C,F,ne,fe),A.ref!==C.ref&&(C.flags|=512,C.flags|=2097152);else{if(!ne){if(C.stateNode===null)throw Error(u(166));return Sn(C),null}if(A=xo(ro.current),ks(C)){ne=C.stateNode,F=C.type;var ve=C.memoizedProps;switch(ne[Zi]=C,ne[zo]=ve,A=(C.mode&1)!==0,F){case"dialog":Vr("cancel",ne),Vr("close",ne);break;case"iframe":case"object":case"embed":Vr("load",ne);break;case"video":case"audio":for(fe=0;fe<go.length;fe++)Vr(go[fe],ne);break;case"source":Vr("error",ne);break;case"img":case"image":case"link":Vr("error",ne),Vr("load",ne);break;case"details":Vr("toggle",ne);break;case"input":Pe(ne,ve),Vr("invalid",ne);break;case"select":ne._wrapperState={wasMultiple:!!ve.multiple},Vr("invalid",ne);break;case"textarea":yt(ne,ve),Vr("invalid",ne)}je(F,ve),fe=null;for(var Ae in ve)if(ve.hasOwnProperty(Ae)){var Be=ve[Ae];Ae==="children"?typeof Be=="string"?ne.textContent!==Be&&(ve.suppressHydrationWarning!==!0&&As(ne.textContent,Be,A),fe=["children",Be]):typeof Be=="number"&&ne.textContent!==""+Be&&(ve.suppressHydrationWarning!==!0&&As(ne.textContent,Be,A),fe=["children",""+Be]):f.hasOwnProperty(Ae)&&Be!=null&&Ae==="onScroll"&&Vr("scroll",ne)}switch(F){case"input":le(ne),Le(ne,ve,!0);break;case"textarea":le(ne),ze(ne);break;case"select":case"option":break;default:typeof ve.onClick=="function"&&(ne.onclick=yu)}ne=fe,C.updateQueue=ne,ne!==null&&(C.flags|=4)}else{Ae=fe.nodeType===9?fe:fe.ownerDocument,A==="http://www.w3.org/1999/xhtml"&&(A=Mt(F)),A==="http://www.w3.org/1999/xhtml"?F==="script"?(A=Ae.createElement("div"),A.innerHTML="<script><\/script>",A=A.removeChild(A.firstChild)):typeof ne.is=="string"?A=Ae.createElement(F,{is:ne.is}):(A=Ae.createElement(F),F==="select"&&(Ae=A,ne.multiple?Ae.multiple=!0:ne.size&&(Ae.size=ne.size))):A=Ae.createElementNS(A,F),A[Zi]=C,A[zo]=ne,En(A,C,!1,!1),C.stateNode=A;e:{switch(Ae=We(F,ne),F){case"dialog":Vr("cancel",A),Vr("close",A),fe=ne;break;case"iframe":case"object":case"embed":Vr("load",A),fe=ne;break;case"video":case"audio":for(fe=0;fe<go.length;fe++)Vr(go[fe],A);fe=ne;break;case"source":Vr("error",A),fe=ne;break;case"img":case"image":case"link":Vr("error",A),Vr("load",A),fe=ne;break;case"details":Vr("toggle",A),fe=ne;break;case"input":Pe(A,ne),fe=Ne(A,ne),Vr("invalid",A);break;case"option":fe=ne;break;case"select":A._wrapperState={wasMultiple:!!ne.multiple},fe=m({},ne,{value:void 0}),Vr("invalid",A);break;case"textarea":yt(A,ne),fe=De(A,ne),Vr("invalid",A);break;default:fe=ne}je(F,fe),Be=fe;for(ve in Be)if(Be.hasOwnProperty(ve)){var Ve=Be[ve];ve==="style"?qe(A,Ve):ve==="dangerouslySetInnerHTML"?(Ve=Ve?Ve.__html:void 0,Ve!=null&&X(A,Ve)):ve==="children"?typeof Ve=="string"?(F!=="textarea"||Ve!=="")&&ce(A,Ve):typeof Ve=="number"&&ce(A,""+Ve):ve!=="suppressContentEditableWarning"&&ve!=="suppressHydrationWarning"&&ve!=="autoFocus"&&(f.hasOwnProperty(ve)?Ve!=null&&ve==="onScroll"&&Vr("scroll",A):Ve!=null&&G(A,ve,Ve,Ae))}switch(F){case"input":le(A),Le(A,ne,!1);break;case"textarea":le(A),ze(A);break;case"option":ne.value!=null&&A.setAttribute("value",""+de(ne.value));break;case"select":A.multiple=!!ne.multiple,ve=ne.value,ve!=null?Oe(A,!!ne.multiple,ve,!1):ne.defaultValue!=null&&Oe(A,!!ne.multiple,ne.defaultValue,!0);break;default:typeof fe.onClick=="function"&&(A.onclick=yu)}switch(F){case"button":case"input":case"select":case"textarea":ne=!!ne.autoFocus;break e;case"img":ne=!0;break e;default:ne=!1}}ne&&(C.flags|=4)}C.ref!==null&&(C.flags|=512,C.flags|=2097152)}return Sn(C),null;case 6:if(A&&C.stateNode!=null)lc(A,C,A.memoizedProps,ne);else{if(typeof ne!="string"&&C.stateNode===null)throw Error(u(166));if(F=xo(rs.current),xo(ro.current),ks(C)){if(ne=C.stateNode,F=C.memoizedProps,ne[Zi]=C,(ve=ne.nodeValue!==F)&&(A=Nn,A!==null))switch(A.tag){case 3:As(ne.nodeValue,F,(A.mode&1)!==0);break;case 5:A.memoizedProps.suppressHydrationWarning!==!0&&As(ne.nodeValue,F,(A.mode&1)!==0)}ve&&(C.flags|=4)}else ne=(F.nodeType===9?F:F.ownerDocument).createTextNode(ne),ne[Zi]=C,C.stateNode=ne}return Sn(C),null;case 13:if(Hr(Gr),ne=C.memoizedState,A===null||A.memoizedState!==null&&A.memoizedState.dehydrated!==null){if(Kr&&ii!==null&&C.mode&1&&!(C.flags&128))Nl(),eo(),C.flags|=98560,ve=!1;else if(ve=ks(C),ne!==null&&ne.dehydrated!==null){if(A===null){if(!ve)throw Error(u(318));if(ve=C.memoizedState,ve=ve!==null?ve.dehydrated:null,!ve)throw Error(u(317));ve[Zi]=C}else eo(),!(C.flags&128)&&(C.memoizedState=null),C.flags|=4;Sn(C),ve=!1}else Ci!==null&&(bc(Ci),Ci=null),ve=!0;if(!ve)return C.flags&65536?C:null}return C.flags&128?(C.lanes=F,C):(ne=ne!==null,ne!==(A!==null&&A.memoizedState!==null)&&ne&&(C.child.flags|=8192,C.mode&1&&(A===null||Gr.current&1?dn===0&&(dn=3):Ec())),C.updateQueue!==null&&(C.flags|=4),Sn(C),null);case 4:return Wo(),uc(A,C),A===null&&Fo(C.stateNode.containerInfo),Sn(C),null;case 10:return Mu(C.type._context),Sn(C),null;case 17:return Zn(C.type)&&xu(),Sn(C),null;case 19:if(Hr(Gr),ve=C.memoizedState,ve===null)return Sn(C),null;if(ne=(C.flags&128)!==0,Ae=ve.rendering,Ae===null)if(ne)Ks(ve,!1);else{if(dn!==0||A!==null&&A.flags&128)for(A=C.child;A!==null;){if(Ae=wa(A),Ae!==null){for(C.flags|=128,Ks(ve,!1),ne=Ae.updateQueue,ne!==null&&(C.updateQueue=ne,C.flags|=4),C.subtreeFlags=0,ne=F,F=C.child;F!==null;)ve=F,A=ne,ve.flags&=14680066,Ae=ve.alternate,Ae===null?(ve.childLanes=0,ve.lanes=A,ve.child=null,ve.subtreeFlags=0,ve.memoizedProps=null,ve.memoizedState=null,ve.updateQueue=null,ve.dependencies=null,ve.stateNode=null):(ve.childLanes=Ae.childLanes,ve.lanes=Ae.lanes,ve.child=Ae.child,ve.subtreeFlags=0,ve.deletions=null,ve.memoizedProps=Ae.memoizedProps,ve.memoizedState=Ae.memoizedState,ve.updateQueue=Ae.updateQueue,ve.type=Ae.type,A=Ae.dependencies,ve.dependencies=A===null?null:{lanes:A.lanes,firstContext:A.firstContext}),F=F.sibling;return zr(Gr,Gr.current&1|2),C.child}A=A.sibling}ve.tail!==null&&Ht()>Ta&&(C.flags|=128,ne=!0,Ks(ve,!1),C.lanes=4194304)}else{if(!ne)if(A=wa(Ae),A!==null){if(C.flags|=128,ne=!0,F=A.updateQueue,F!==null&&(C.updateQueue=F,C.flags|=4),Ks(ve,!0),ve.tail===null&&ve.tailMode==="hidden"&&!Ae.alternate&&!Kr)return Sn(C),null}else 2*Ht()-ve.renderingStartTime>Ta&&F!==1073741824&&(C.flags|=128,ne=!0,Ks(ve,!1),C.lanes=4194304);ve.isBackwards?(Ae.sibling=C.child,C.child=Ae):(F=ve.last,F!==null?F.sibling=Ae:C.child=Ae,ve.last=Ae)}return ve.tail!==null?(C=ve.tail,ve.rendering=C,ve.tail=C.sibling,ve.renderingStartTime=Ht(),C.sibling=null,F=Gr.current,zr(Gr,ne?F&1|2:F&1),C):(Sn(C),null);case 22:case 23:return xc(),ne=C.memoizedState!==null,A!==null&&A.memoizedState!==null!==ne&&(C.flags|=8192),ne&&C.mode&1?si&1073741824&&(Sn(C),C.subtreeFlags&6&&(C.flags|=8192)):Sn(C),null;case 24:return null;case 25:return null}throw Error(u(156,C.tag))}function sd(A,C){switch(va(C),C.tag){case 1:return Zn(C.type)&&xu(),A=C.flags,A&65536?(C.flags=A&-65537|128,C):null;case 3:return Wo(),Hr(Wn),Hr(On),Ou(),A=C.flags,A&65536&&!(A&128)?(C.flags=A&-65537|128,C):null;case 5:return Iu(C),null;case 13:if(Hr(Gr),A=C.memoizedState,A!==null&&A.dehydrated!==null){if(C.alternate===null)throw Error(u(340));eo()}return A=C.flags,A&65536?(C.flags=A&-65537|128,C):null;case 19:return Hr(Gr),null;case 4:return Wo(),null;case 10:return Mu(C.type._context),null;case 22:case 23:return xc(),null;case 24:return null;default:return null}}var Wu=!1,Wr=!1,Vn=typeof WeakSet=="function"?WeakSet:Set,Lt=null;function fs(A,C){var F=A.ref;if(F!==null)if(typeof F=="function")try{F(null)}catch(ne){Xr(A,C,ne)}else F.current=null}function Gs(A,C,F){try{F()}catch(ne){Xr(A,C,ne)}}var xf=!1;function ud(A,C){if(Ts=we,A=Fr(),bs(A)){if("selectionStart"in A)var F={start:A.selectionStart,end:A.selectionEnd};else e:{F=(F=A.ownerDocument)&&F.defaultView||window;var ne=F.getSelection&&F.getSelection();if(ne&&ne.rangeCount!==0){F=ne.anchorNode;var fe=ne.anchorOffset,ve=ne.focusNode;ne=ne.focusOffset;try{F.nodeType,ve.nodeType}catch{F=null;break e}var Ae=0,Be=-1,Ve=-1,gt=0,Tt=0,Pt=A,At=null;t:for(;;){for(var Nt;Pt!==F||fe!==0&&Pt.nodeType!==3||(Be=Ae+fe),Pt!==ve||ne!==0&&Pt.nodeType!==3||(Ve=Ae+ne),Pt.nodeType===3&&(Ae+=Pt.nodeValue.length),(Nt=Pt.firstChild)!==null;)At=Pt,Pt=Nt;for(;;){if(Pt===A)break t;if(At===F&&++gt===fe&&(Be=Ae),At===ve&&++Tt===ne&&(Ve=Ae),(Nt=Pt.nextSibling)!==null)break;Pt=At,At=Pt.parentNode}Pt=Nt}F=Be===-1||Ve===-1?null:{start:Be,end:Ve}}else F=null}F=F||{start:0,end:0}}else F=null;for(ha={focusedElem:A,selectionRange:F},we=!1,Lt=C;Lt!==null;)if(C=Lt,A=C.child,(C.subtreeFlags&1028)!==0&&A!==null)A.return=C,Lt=A;else for(;Lt!==null;){C=Lt;try{var Dt=C.alternate;if(C.flags&1024)switch(C.tag){case 0:case 11:case 15:break;case 1:if(Dt!==null){var jt=Dt.memoizedProps,en=Dt.memoizedState,ot=C.stateNode,Ge=ot.getSnapshotBeforeUpdate(C.elementType===C.type?jt:bi(C.type,jt),en);ot.__reactInternalSnapshotBeforeUpdate=Ge}break;case 3:var lt=C.stateNode.containerInfo;lt.nodeType===1?lt.textContent="":lt.nodeType===9&&lt.documentElement&&lt.removeChild(lt.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(u(163))}}catch(kt){Xr(C,C.return,kt)}if(A=C.sibling,A!==null){A.return=C.return,Lt=A;break}Lt=C.return}return Dt=xf,xf=!1,Dt}function To(A,C,F){var ne=C.updateQueue;if(ne=ne!==null?ne.lastEffect:null,ne!==null){var fe=ne=ne.next;do{if((fe.tag&A)===A){var ve=fe.destroy;fe.destroy=void 0,ve!==void 0&&Gs(C,F,ve)}fe=fe.next}while(fe!==ne)}}function Ws(A,C){if(C=C.updateQueue,C=C!==null?C.lastEffect:null,C!==null){var F=C=C.next;do{if((F.tag&A)===A){var ne=F.create;F.destroy=ne()}F=F.next}while(F!==C)}}function Zu(A){var C=A.ref;if(C!==null){var F=A.stateNode;switch(A.tag){case 5:A=F;break;default:A=F}typeof C=="function"?C(A):C.current=A}}function Ef(A){var C=A.alternate;C!==null&&(A.alternate=null,Ef(C)),A.child=null,A.deletions=null,A.sibling=null,A.tag===5&&(C=A.stateNode,C!==null&&(delete C[Zi],delete C[zo],delete C[_u],delete C[Me],delete C[Ya])),A.stateNode=null,A.return=null,A.dependencies=null,A.memoizedProps=null,A.memoizedState=null,A.pendingProps=null,A.stateNode=null,A.updateQueue=null}function Sf(A){return A.tag===5||A.tag===3||A.tag===4}function Af(A){e:for(;;){for(;A.sibling===null;){if(A.return===null||Sf(A.return))return null;A=A.return}for(A.sibling.return=A.return,A=A.sibling;A.tag!==5&&A.tag!==6&&A.tag!==18;){if(A.flags&2||A.child===null||A.tag===4)continue e;A.child.return=A,A=A.child}if(!(A.flags&2))return A.stateNode}}function cc(A,C,F){var ne=A.tag;if(ne===5||ne===6)A=A.stateNode,C?F.nodeType===8?F.parentNode.insertBefore(A,C):F.insertBefore(A,C):(F.nodeType===8?(C=F.parentNode,C.insertBefore(A,F)):(C=F,C.appendChild(A)),F=F._reactRootContainer,F!=null||C.onclick!==null||(C.onclick=yu));else if(ne!==4&&(A=A.child,A!==null))for(cc(A,C,F),A=A.sibling;A!==null;)cc(A,C,F),A=A.sibling}function Yu(A,C,F){var ne=A.tag;if(ne===5||ne===6)A=A.stateNode,C?F.insertBefore(A,C):F.appendChild(A);else if(ne!==4&&(A=A.child,A!==null))for(Yu(A,C,F),A=A.sibling;A!==null;)Yu(A,C,F),A=A.sibling}var vn=null,$i=!1;function so(A,C,F){for(F=F.child;F!==null;)fc(A,C,F),F=F.sibling}function fc(A,C,F){if(sr&&typeof sr.onCommitFiberUnmount=="function")try{sr.onCommitFiberUnmount(gr,F)}catch{}switch(F.tag){case 5:Wr||fs(F,C);case 6:var ne=vn,fe=$i;vn=null,so(A,C,F),vn=ne,$i=fe,vn!==null&&($i?(A=vn,F=F.stateNode,A.nodeType===8?A.parentNode.removeChild(F):A.removeChild(F)):vn.removeChild(F.stateNode));break;case 18:vn!==null&&($i?(A=vn,F=F.stateNode,A.nodeType===8?Il(A.parentNode,F):A.nodeType===1&&Il(A,F),xr(A)):Il(vn,F.stateNode));break;case 4:ne=vn,fe=$i,vn=F.stateNode.containerInfo,$i=!0,so(A,C,F),vn=ne,$i=fe;break;case 0:case 11:case 14:case 15:if(!Wr&&(ne=F.updateQueue,ne!==null&&(ne=ne.lastEffect,ne!==null))){fe=ne=ne.next;do{var ve=fe,Ae=ve.destroy;ve=ve.tag,Ae!==void 0&&(ve&2||ve&4)&&Gs(F,C,Ae),fe=fe.next}while(fe!==ne)}so(A,C,F);break;case 1:if(!Wr&&(fs(F,C),ne=F.stateNode,typeof ne.componentWillUnmount=="function"))try{ne.props=F.memoizedProps,ne.state=F.memoizedState,ne.componentWillUnmount()}catch(Be){Xr(F,C,Be)}so(A,C,F);break;case 21:so(A,C,F);break;case 22:F.mode&1?(Wr=(ne=Wr)||F.memoizedState!==null,so(A,C,F),Wr=ne):so(A,C,F);break;default:so(A,C,F)}}function ds(A){var C=A.updateQueue;if(C!==null){A.updateQueue=null;var F=A.stateNode;F===null&&(F=A.stateNode=new Vn),C.forEach(function(ne){var fe=md.bind(null,A,ne);F.has(ne)||(F.add(ne),ne.then(fe,fe))})}}function ai(A,C){var F=C.deletions;if(F!==null)for(var ne=0;ne<F.length;ne++){var fe=F[ne];try{var ve=A,Ae=C,Be=Ae;e:for(;Be!==null;){switch(Be.tag){case 5:vn=Be.stateNode,$i=!1;break e;case 3:vn=Be.stateNode.containerInfo,$i=!0;break e;case 4:vn=Be.stateNode.containerInfo,$i=!0;break e}Be=Be.return}if(vn===null)throw Error(u(160));fc(ve,Ae,fe),vn=null,$i=!1;var Ve=fe.alternate;Ve!==null&&(Ve.return=null),fe.return=null}catch(gt){Xr(fe,C,gt)}}if(C.subtreeFlags&12854)for(C=C.child;C!==null;)dc(C,A),C=C.sibling}function dc(A,C){var F=A.alternate,ne=A.flags;switch(A.tag){case 0:case 11:case 14:case 15:if(ai(C,A),Ni(A),ne&4){try{To(3,A,A.return),Ws(3,A)}catch(jt){Xr(A,A.return,jt)}try{To(5,A,A.return)}catch(jt){Xr(A,A.return,jt)}}break;case 1:ai(C,A),Ni(A),ne&512&&F!==null&&fs(F,F.return);break;case 5:if(ai(C,A),Ni(A),ne&512&&F!==null&&fs(F,F.return),A.flags&32){var fe=A.stateNode;try{ce(fe,"")}catch(jt){Xr(A,A.return,jt)}}if(ne&4&&(fe=A.stateNode,fe!=null)){var ve=A.memoizedProps,Ae=F!==null?F.memoizedProps:ve,Be=A.type,Ve=A.updateQueue;if(A.updateQueue=null,Ve!==null)try{Be==="input"&&ve.type==="radio"&&ve.name!=null&&Ie(fe,ve),We(Be,Ae);var gt=We(Be,ve);for(Ae=0;Ae<Ve.length;Ae+=2){var Tt=Ve[Ae],Pt=Ve[Ae+1];Tt==="style"?qe(fe,Pt):Tt==="dangerouslySetInnerHTML"?X(fe,Pt):Tt==="children"?ce(fe,Pt):G(fe,Tt,Pt,gt)}switch(Be){case"input":Ke(fe,ve);break;case"textarea":Ue(fe,ve);break;case"select":var At=fe._wrapperState.wasMultiple;fe._wrapperState.wasMultiple=!!ve.multiple;var Nt=ve.value;Nt!=null?Oe(fe,!!ve.multiple,Nt,!1):At!==!!ve.multiple&&(ve.defaultValue!=null?Oe(fe,!!ve.multiple,ve.defaultValue,!0):Oe(fe,!!ve.multiple,ve.multiple?[]:"",!1))}fe[zo]=ve}catch(jt){Xr(A,A.return,jt)}}break;case 6:if(ai(C,A),Ni(A),ne&4){if(A.stateNode===null)throw Error(u(162));fe=A.stateNode,ve=A.memoizedProps;try{fe.nodeValue=ve}catch(jt){Xr(A,A.return,jt)}}break;case 3:if(ai(C,A),Ni(A),ne&4&&F!==null&&F.memoizedState.isDehydrated)try{xr(C.containerInfo)}catch(jt){Xr(A,A.return,jt)}break;case 4:ai(C,A),Ni(A);break;case 13:ai(C,A),Ni(A),fe=A.child,fe.flags&8192&&(ve=fe.memoizedState!==null,fe.stateNode.isHidden=ve,!ve||fe.alternate!==null&&fe.alternate.memoizedState!==null||(mc=Ht())),ne&4&&ds(A);break;case 22:if(Tt=F!==null&&F.memoizedState!==null,A.mode&1?(Wr=(gt=Wr)||Tt,ai(C,A),Wr=gt):ai(C,A),Ni(A),ne&8192){if(gt=A.memoizedState!==null,(A.stateNode.isHidden=gt)&&!Tt&&A.mode&1)for(Lt=A,Tt=A.child;Tt!==null;){for(Pt=Lt=Tt;Lt!==null;){switch(At=Lt,Nt=At.child,At.tag){case 0:case 11:case 14:case 15:To(4,At,At.return);break;case 1:fs(At,At.return);var Dt=At.stateNode;if(typeof Dt.componentWillUnmount=="function"){ne=At,F=At.return;try{C=ne,Dt.props=C.memoizedProps,Dt.state=C.memoizedState,Dt.componentWillUnmount()}catch(jt){Xr(ne,F,jt)}}break;case 5:fs(At,At.return);break;case 22:if(At.memoizedState!==null){Xo(Pt);continue}}Nt!==null?(Nt.return=At,Lt=Nt):Xo(Pt)}Tt=Tt.sibling}e:for(Tt=null,Pt=A;;){if(Pt.tag===5){if(Tt===null){Tt=Pt;try{fe=Pt.stateNode,gt?(ve=fe.style,typeof ve.setProperty=="function"?ve.setProperty("display","none","important"):ve.display="none"):(Be=Pt.stateNode,Ve=Pt.memoizedProps.style,Ae=Ve!=null&&Ve.hasOwnProperty("display")?Ve.display:null,Be.style.display=Se("display",Ae))}catch(jt){Xr(A,A.return,jt)}}}else if(Pt.tag===6){if(Tt===null)try{Pt.stateNode.nodeValue=gt?"":Pt.memoizedProps}catch(jt){Xr(A,A.return,jt)}}else if((Pt.tag!==22&&Pt.tag!==23||Pt.memoizedState===null||Pt===A)&&Pt.child!==null){Pt.child.return=Pt,Pt=Pt.child;continue}if(Pt===A)break e;for(;Pt.sibling===null;){if(Pt.return===null||Pt.return===A)break e;Tt===Pt&&(Tt=null),Pt=Pt.return}Tt===Pt&&(Tt=null),Pt.sibling.return=Pt.return,Pt=Pt.sibling}}break;case 19:ai(C,A),Ni(A),ne&4&&ds(A);break;case 21:break;default:ai(C,A),Ni(A)}}function Ni(A){var C=A.flags;if(C&2){try{e:{for(var F=A.return;F!==null;){if(Sf(F)){var ne=F;break e}F=F.return}throw Error(u(160))}switch(ne.tag){case 5:var fe=ne.stateNode;ne.flags&32&&(ce(fe,""),ne.flags&=-33);var ve=Af(A);Yu(A,ve,fe);break;case 3:case 4:var Ae=ne.stateNode.containerInfo,Be=Af(A);cc(A,Be,Ae);break;default:throw Error(u(161))}}catch(Ve){Xr(A,A.return,Ve)}A.flags&=-3}C&4096&&(A.flags&=-4097)}function Xu(A,C,F){Lt=A,hc(A)}function hc(A,C,F){for(var ne=(A.mode&1)!==0;Lt!==null;){var fe=Lt,ve=fe.child;if(fe.tag===22&&ne){var Ae=fe.memoizedState!==null||Wu;if(!Ae){var Be=fe.alternate,Ve=Be!==null&&Be.memoizedState!==null||Wr;Be=Wu;var gt=Wr;if(Wu=Ae,(Wr=Ve)&&!gt)for(Lt=fe;Lt!==null;)Ae=Lt,Ve=Ae.child,Ae.tag===22&&Ae.memoizedState!==null?Tf(fe):Ve!==null?(Ve.return=Ae,Lt=Ve):Tf(fe);for(;ve!==null;)Lt=ve,hc(ve),ve=ve.sibling;Lt=fe,Wu=Be,Wr=gt}Li(A)}else fe.subtreeFlags&8772&&ve!==null?(ve.return=fe,Lt=ve):Li(A)}}function Li(A){for(;Lt!==null;){var C=Lt;if(C.flags&8772){var F=C.alternate;try{if(C.flags&8772)switch(C.tag){case 0:case 11:case 15:Wr||Ws(5,C);break;case 1:var ne=C.stateNode;if(C.flags&4&&!Wr)if(F===null)ne.componentDidMount();else{var fe=C.elementType===C.type?F.memoizedProps:bi(C.type,F.memoizedProps);ne.componentDidUpdate(fe,F.memoizedState,ne.__reactInternalSnapshotBeforeUpdate)}var ve=C.updateQueue;ve!==null&&Dl(C,ve,ne);break;case 3:var Ae=C.updateQueue;if(Ae!==null){if(F=null,C.child!==null)switch(C.child.tag){case 5:F=C.child.stateNode;break;case 1:F=C.child.stateNode}Dl(C,Ae,F)}break;case 5:var Be=C.stateNode;if(F===null&&C.flags&4){F=Be;var Ve=C.memoizedProps;switch(C.type){case"button":case"input":case"select":case"textarea":Ve.autoFocus&&F.focus();break;case"img":Ve.src&&(F.src=Ve.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(C.memoizedState===null){var gt=C.alternate;if(gt!==null){var Tt=gt.memoizedState;if(Tt!==null){var Pt=Tt.dehydrated;Pt!==null&&xr(Pt)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(u(163))}Wr||C.flags&512&&Zu(C)}catch(At){Xr(C,C.return,At)}}if(C===A){Lt=null;break}if(F=C.sibling,F!==null){F.return=C.return,Lt=F;break}Lt=C.return}}function Xo(A){for(;Lt!==null;){var C=Lt;if(C===A){Lt=null;break}var F=C.sibling;if(F!==null){F.return=C.return,Lt=F;break}Lt=C.return}}function Tf(A){for(;Lt!==null;){var C=Lt;try{switch(C.tag){case 0:case 11:case 15:var F=C.return;try{Ws(4,C)}catch(Ve){Xr(C,F,Ve)}break;case 1:var ne=C.stateNode;if(typeof ne.componentDidMount=="function"){var fe=C.return;try{ne.componentDidMount()}catch(Ve){Xr(C,fe,Ve)}}var ve=C.return;try{Zu(C)}catch(Ve){Xr(C,ve,Ve)}break;case 5:var Ae=C.return;try{Zu(C)}catch(Ve){Xr(C,Ae,Ve)}}}catch(Ve){Xr(C,C.return,Ve)}if(C===A){Lt=null;break}var Be=C.sibling;if(Be!==null){Be.return=C.return,Lt=Be;break}Lt=C.return}}var Rf=Math.ceil,Ju=V.ReactCurrentDispatcher,pc=V.ReactCurrentOwner,_i=V.ReactCurrentBatchConfig,$r=0,yn=null,sn=null,An=0,si=0,hs=Gn(0),dn=0,Zs=null,Jo=0,Ys=0,Qu=0,Xs=null,Jn=null,mc=0,Ta=1/0,Ro=null,el=!1,gc=null,Qo=null,tl=!1,ea=null,Hn=0,Js=0,vc=null,rl=-1,Qs=0;function Kn(){return $r&6?Ht():rl!==-1?rl:rl=Ht()}function ta(A){return A.mode&1?$r&2&&An!==0?An&-An:nf.transition!==null?(Qs===0&&(Qs=ia()),Qs):(A=br,A!==0||(A=window.event,A=A===void 0?16:Jt(A.type)),A):1}function Bi(A,C,F,ne){if(50<Js)throw Js=0,vc=null,Error(u(185));co(A,F,ne),(!($r&2)||A!==yn)&&(A===yn&&(!($r&2)&&(Ys|=F),dn===4&&ra(A,An)),Qn(A,ne),F===1&&$r===0&&!(C.mode&1)&&(Ta=Ht()+500,Eu&&Ho()))}function Qn(A,C){var F=A.callbackNode;lo(A,C);var ne=Ai(A,A===yn?An:0);if(ne===0)F!==null&&pr(F),A.callbackNode=null,A.callbackPriority=0;else if(C=ne&-ne,A.callbackPriority!==C){if(F!=null&&pr(F),C===1)A.tag===0?pa(Mf.bind(null,A)):ef(Mf.bind(null,A)),bu(function(){!($r&6)&&Ho()}),F=null;else{switch(Ri(ne)){case 1:F=ur;break;case 4:F=wr;break;case 16:F=yr;break;case 536870912:F=Er;break;default:F=yr}F=Nf(F,nl.bind(null,A))}A.callbackPriority=C,A.callbackNode=F}}function nl(A,C){if(rl=-1,Qs=0,$r&6)throw Error(u(327));var F=A.callbackNode;if(ps()&&A.callbackNode!==F)return null;var ne=Ai(A,A===yn?An:0);if(ne===0)return null;if(ne&30||ne&A.expiredLanes||C)C=il(A,ne);else{C=ne;var fe=$r;$r|=2;var ve=kf();(yn!==A||An!==C)&&(Ro=null,Ta=Ht()+500,Ma(A,C));do try{fd();break}catch(Be){Pf(A,Be)}while(!0);bo(),Ju.current=ve,$r=fe,sn!==null?C=0:(yn=null,An=0,C=dn)}if(C!==0){if(C===2&&(fe=Co(A),fe!==0&&(ne=fe,C=yc(A,fe))),C===1)throw F=Zs,Ma(A,0),ra(A,ne),Qn(A,Ht()),F;if(C===6)ra(A,ne);else{if(fe=A.current.alternate,!(ne&30)&&!ld(fe)&&(C=il(A,ne),C===2&&(ve=Co(A),ve!==0&&(ne=ve,C=yc(A,ve))),C===1))throw F=Zs,Ma(A,0),ra(A,ne),Qn(A,Ht()),F;switch(A.finishedWork=fe,A.finishedLanes=ne,C){case 0:case 1:throw Error(u(345));case 2:Pa(A,Jn,Ro);break;case 3:if(ra(A,ne),(ne&130023424)===ne&&(C=mc+500-Ht(),10<C)){if(Ai(A,0)!==0)break;if(fe=A.suspendedLanes,(fe&ne)!==ne){Kn(),A.pingedLanes|=A.suspendedLanes&fe;break}A.timeoutHandle=Uo(Pa.bind(null,A,Jn,Ro),C);break}Pa(A,Jn,Ro);break;case 4:if(ra(A,ne),(ne&4194240)===ne)break;for(C=A.eventTimes,fe=-1;0<ne;){var Ae=31-ln(ne);ve=1<<Ae,Ae=C[Ae],Ae>fe&&(fe=Ae),ne&=~ve}if(ne=fe,ne=Ht()-ne,ne=(120>ne?120:480>ne?480:1080>ne?1080:1920>ne?1920:3e3>ne?3e3:4320>ne?4320:1960*Rf(ne/1960))-ne,10<ne){A.timeoutHandle=Uo(Pa.bind(null,A,Jn,Ro),ne);break}Pa(A,Jn,Ro);break;case 5:Pa(A,Jn,Ro);break;default:throw Error(u(329))}}}return Qn(A,Ht()),A.callbackNode===F?nl.bind(null,A):null}function yc(A,C){var F=Xs;return A.current.memoizedState.isDehydrated&&(Ma(A,C).flags|=256),A=il(A,C),A!==2&&(C=Jn,Jn=F,C!==null&&bc(C)),A}function bc(A){Jn===null?Jn=A:Jn.push.apply(Jn,A)}function ld(A){for(var C=A;;){if(C.flags&16384){var F=C.updateQueue;if(F!==null&&(F=F.stores,F!==null))for(var ne=0;ne<F.length;ne++){var fe=F[ne],ve=fe.getSnapshot;fe=fe.value;try{if(!pt(ve(),fe))return!1}catch{return!1}}}if(F=C.child,C.subtreeFlags&16384&&F!==null)F.return=C,C=F;else{if(C===A)break;for(;C.sibling===null;){if(C.return===null||C.return===A)return!0;C=C.return}C.sibling.return=C.return,C=C.sibling}}return!0}function ra(A,C){for(C&=~Qu,C&=~Ys,A.suspendedLanes|=C,A.pingedLanes&=~C,A=A.expirationTimes;0<C;){var F=31-ln(C),ne=1<<F;A[F]=-1,C&=~ne}}function Mf(A){if($r&6)throw Error(u(327));ps();var C=Ai(A,0);if(!(C&1))return Qn(A,Ht()),null;var F=il(A,C);if(A.tag!==0&&F===2){var ne=Co(A);ne!==0&&(C=ne,F=yc(A,ne))}if(F===1)throw F=Zs,Ma(A,0),ra(A,C),Qn(A,Ht()),F;if(F===6)throw Error(u(345));return A.finishedWork=A.current.alternate,A.finishedLanes=C,Pa(A,Jn,Ro),Qn(A,Ht()),null}function wc(A,C){var F=$r;$r|=1;try{return A(C)}finally{$r=F,$r===0&&(Ta=Ht()+500,Eu&&Ho())}}function Ra(A){ea!==null&&ea.tag===0&&!($r&6)&&ps();var C=$r;$r|=1;var F=_i.transition,ne=br;try{if(_i.transition=null,br=1,A)return A()}finally{br=ne,_i.transition=F,$r=C,!($r&6)&&Ho()}}function xc(){si=hs.current,Hr(hs)}function Ma(A,C){A.finishedWork=null,A.finishedLanes=0;var F=A.timeoutHandle;if(F!==-1&&(A.timeoutHandle=-1,Ms(F)),sn!==null)for(F=sn.return;F!==null;){var ne=F;switch(va(ne),ne.tag){case 1:ne=ne.type.childContextTypes,ne!=null&&xu();break;case 3:Wo(),Hr(Wn),Hr(On),Ou();break;case 5:Iu(ne);break;case 4:Wo();break;case 13:Hr(Gr);break;case 19:Hr(Gr);break;case 10:Mu(ne.type._context);break;case 22:case 23:xc()}F=F.return}if(yn=A,sn=A=Di(A.current,null),An=si=C,dn=0,Zs=null,Qu=Ys=Jo=0,Jn=Xs=null,ba!==null){for(C=0;C<ba.length;C++)if(F=ba[C],ne=F.interleaved,ne!==null){F.interleaved=null;var fe=ne.next,ve=F.pending;if(ve!==null){var Ae=ve.next;ve.next=fe,ne.next=Ae}F.pending=ne}ba=null}return A}function Pf(A,C){do{var F=sn;try{if(bo(),Ns.current=qu,ns){for(var ne=Yr.memoizedState;ne!==null;){var fe=ne.queue;fe!==null&&(fe.pending=null),ne=ne.next}ns=!1}if(Zo=0,fn=Qr=Yr=null,Ls=!1,xa=0,pc.current=null,F===null||F.return===null){dn=1,Zs=C,sn=null;break}e:{var ve=A,Ae=F.return,Be=F,Ve=C;if(C=An,Be.flags|=32768,Ve!==null&&typeof Ve=="object"&&typeof Ve.then=="function"){var gt=Ve,Tt=Be,Pt=Tt.tag;if(!(Tt.mode&1)&&(Pt===0||Pt===11||Pt===15)){var At=Tt.alternate;At?(Tt.updateQueue=At.updateQueue,Tt.memoizedState=At.memoizedState,Tt.lanes=At.lanes):(Tt.updateQueue=null,Tt.memoizedState=null)}var Nt=gf(Ae);if(Nt!==null){Nt.flags&=-257,tc(Nt,Ae,Be,ve,C),Nt.mode&1&&Us(ve,gt,C),C=Nt,Ve=gt;var Dt=C.updateQueue;if(Dt===null){var jt=new Set;jt.add(Ve),C.updateQueue=jt}else Dt.add(Ve);break e}else{if(!(C&1)){Us(ve,gt,C),Ec();break e}Ve=Error(u(426))}}else if(Kr&&Be.mode&1){var en=gf(Ae);if(en!==null){!(en.flags&65536)&&(en.flags|=256),tc(en,Ae,Be,ve,C),to(Aa(Ve,Be));break e}}ve=Ve=Aa(Ve,Be),dn!==4&&(dn=2),Xs===null?Xs=[ve]:Xs.push(ve),ve=Ae;do{switch(ve.tag){case 3:ve.flags|=65536,C&=-C,ve.lanes|=C;var ot=Fs(ve,Ve,C);uf(ve,ot);break e;case 1:Be=Ve;var Ge=ve.type,lt=ve.stateNode;if(!(ve.flags&128)&&(typeof Ge.getDerivedStateFromError=="function"||lt!==null&&typeof lt.componentDidCatch=="function"&&(Qo===null||!Qo.has(lt)))){ve.flags|=65536,C&=-C,ve.lanes|=C;var kt=Vu(ve,Be,C);uf(ve,kt);break e}}ve=ve.return}while(ve!==null)}If(F)}catch(Gt){C=Gt,sn===F&&F!==null&&(sn=F=F.return);continue}break}while(!0)}function kf(){var A=Ju.current;return Ju.current=qu,A===null?qu:A}function Ec(){(dn===0||dn===3||dn===2)&&(dn=4),yn===null||!(Jo&268435455)&&!(Ys&268435455)||ra(yn,An)}function il(A,C){var F=$r;$r|=2;var ne=kf();(yn!==A||An!==C)&&(Ro=null,Ma(A,C));do try{cd();break}catch(fe){Pf(A,fe)}while(!0);if(bo(),$r=F,Ju.current=ne,sn!==null)throw Error(u(261));return yn=null,An=0,dn}function cd(){for(;sn!==null;)Cf(sn)}function fd(){for(;sn!==null&&!_r();)Cf(sn)}function Cf(A){var C=$f(A.alternate,A,si);A.memoizedProps=A.pendingProps,C===null?If(A):sn=C,pc.current=null}function If(A){var C=A;do{var F=C.alternate;if(A=C.return,C.flags&32768){if(F=sd(F,C),F!==null){F.flags&=32767,sn=F;return}if(A!==null)A.flags|=32768,A.subtreeFlags=0,A.deletions=null;else{dn=6,sn=null;return}}else if(F=ad(F,C,si),F!==null){sn=F;return}if(C=C.sibling,C!==null){sn=C;return}sn=C=A}while(C!==null);dn===0&&(dn=5)}function Pa(A,C,F){var ne=br,fe=_i.transition;try{_i.transition=null,br=1,dd(A,C,F,ne)}finally{_i.transition=fe,br=ne}return null}function dd(A,C,F,ne){do ps();while(ea!==null);if($r&6)throw Error(u(327));F=A.finishedWork;var fe=A.finishedLanes;if(F===null)return null;if(A.finishedWork=null,A.finishedLanes=0,F===A.current)throw Error(u(177));A.callbackNode=null,A.callbackPriority=0;var ve=F.lanes|F.childLanes;if(Ba(A,ve),A===yn&&(sn=yn=null,An=0),!(F.subtreeFlags&2064)&&!(F.flags&2064)||tl||(tl=!0,Nf(yr,function(){return ps(),null})),ve=(F.flags&15990)!==0,F.subtreeFlags&15990||ve){ve=_i.transition,_i.transition=null;var Ae=br;br=1;var Be=$r;$r|=4,pc.current=null,ud(A,F),dc(F,A),td(ha),we=!!Ts,ha=Ts=null,A.current=F,Xu(F),fr(),$r=Be,br=Ae,_i.transition=ve}else A.current=F;if(tl&&(tl=!1,ea=A,Hn=fe),ve=A.pendingLanes,ve===0&&(Qo=null),Ir(F.stateNode),Qn(A,Ht()),C!==null)for(ne=A.onRecoverableError,F=0;F<C.length;F++)fe=C[F],ne(fe.value,{componentStack:fe.stack,digest:fe.digest});if(el)throw el=!1,A=gc,gc=null,A;return Hn&1&&A.tag!==0&&ps(),ve=A.pendingLanes,ve&1?A===vc?Js++:(Js=0,vc=A):Js=0,Ho(),null}function ps(){if(ea!==null){var A=Ri(Hn),C=_i.transition,F=br;try{if(_i.transition=null,br=16>A?16:A,ea===null)var ne=!1;else{if(A=ea,ea=null,Hn=0,$r&6)throw Error(u(331));var fe=$r;for($r|=4,Lt=A.current;Lt!==null;){var ve=Lt,Ae=ve.child;if(Lt.flags&16){var Be=ve.deletions;if(Be!==null){for(var Ve=0;Ve<Be.length;Ve++){var gt=Be[Ve];for(Lt=gt;Lt!==null;){var Tt=Lt;switch(Tt.tag){case 0:case 11:case 15:To(8,Tt,ve)}var Pt=Tt.child;if(Pt!==null)Pt.return=Tt,Lt=Pt;else for(;Lt!==null;){Tt=Lt;var At=Tt.sibling,Nt=Tt.return;if(Ef(Tt),Tt===gt){Lt=null;break}if(At!==null){At.return=Nt,Lt=At;break}Lt=Nt}}}var Dt=ve.alternate;if(Dt!==null){var jt=Dt.child;if(jt!==null){Dt.child=null;do{var en=jt.sibling;jt.sibling=null,jt=en}while(jt!==null)}}Lt=ve}}if(ve.subtreeFlags&2064&&Ae!==null)Ae.return=ve,Lt=Ae;else e:for(;Lt!==null;){if(ve=Lt,ve.flags&2048)switch(ve.tag){case 0:case 11:case 15:To(9,ve,ve.return)}var ot=ve.sibling;if(ot!==null){ot.return=ve.return,Lt=ot;break e}Lt=ve.return}}var Ge=A.current;for(Lt=Ge;Lt!==null;){Ae=Lt;var lt=Ae.child;if(Ae.subtreeFlags&2064&&lt!==null)lt.return=Ae,Lt=lt;else e:for(Ae=Ge;Lt!==null;){if(Be=Lt,Be.flags&2048)try{switch(Be.tag){case 0:case 11:case 15:Ws(9,Be)}}catch(Gt){Xr(Be,Be.return,Gt)}if(Be===Ae){Lt=null;break e}var kt=Be.sibling;if(kt!==null){kt.return=Be.return,Lt=kt;break e}Lt=Be.return}}if($r=fe,Ho(),sr&&typeof sr.onPostCommitFiberRoot=="function")try{sr.onPostCommitFiberRoot(gr,A)}catch{}ne=!0}return ne}finally{br=F,_i.transition=C}}return!1}function ol(A,C,F){C=Aa(F,C),C=Fs(A,C,1),A=vi(A,C,1),C=Kn(),A!==null&&(co(A,1,C),Qn(A,C))}function Xr(A,C,F){if(A.tag===3)ol(A,A,F);else for(;C!==null;){if(C.tag===3){ol(C,A,F);break}else if(C.tag===1){var ne=C.stateNode;if(typeof C.type.getDerivedStateFromError=="function"||typeof ne.componentDidCatch=="function"&&(Qo===null||!Qo.has(ne))){A=Aa(F,A),A=Vu(C,A,1),C=vi(C,A,1),A=Kn(),C!==null&&(co(C,1,A),Qn(C,A));break}}C=C.return}}function hd(A,C,F){var ne=A.pingCache;ne!==null&&ne.delete(C),C=Kn(),A.pingedLanes|=A.suspendedLanes&F,yn===A&&(An&F)===F&&(dn===4||dn===3&&(An&130023424)===An&&500>Ht()-mc?Ma(A,0):Qu|=F),Qn(A,C)}function Of(A,C){C===0&&(A.mode&1?(C=ko,ko<<=1,!(ko&130023424)&&(ko=4194304)):C=1);var F=Kn();A=_o(A,C),A!==null&&(co(A,C,F),Qn(A,F))}function pd(A){var C=A.memoizedState,F=0;C!==null&&(F=C.retryLane),Of(A,F)}function md(A,C){var F=0;switch(A.tag){case 13:var ne=A.stateNode,fe=A.memoizedState;fe!==null&&(F=fe.retryLane);break;case 19:ne=A.stateNode;break;default:throw Error(u(314))}ne!==null&&ne.delete(C),Of(A,F)}var $f;$f=function(A,C,F){if(A!==null)if(A.memoizedProps!==C.pendingProps||Wn.current)zn=!0;else{if(!(A.lanes&F)&&!(C.flags&128))return zn=!1,bf(A,C,F);zn=!!(A.flags&131072)}else zn=!1,Kr&&C.flags&1048576&&tf(C,Au,C.index);switch(C.lanes=0,C.tag){case 2:var ne=C.type;Gu(A,C),A=C.pendingProps;var fe=Ja(C,On.current);Go(C,F),fe=Ea(null,C,ne,A,fe,F);var ve=$u();return C.flags|=1,typeof fe=="object"&&fe!==null&&typeof fe.render=="function"&&fe.$$typeof===void 0?(C.tag=1,C.memoizedState=null,C.updateQueue=null,Zn(ne)?(ve=!0,di(C)):ve=!1,C.memoizedState=fe.state!==null&&fe.state!==void 0?fe.state:null,ku(C),fe.updater=ju,C.stateNode=fe,fe._reactInternals=C,Ql(C,ne,A,F),C=sc(null,C,ne,!0,ve,F)):(C.tag=0,Kr&&ve&&Ps(C),xn(null,C,fe,F),C=C.child),C;case 16:ne=C.elementType;e:{switch(Gu(A,C),A=C.pendingProps,fe=ne._init,ne=fe(ne._payload),C.type=ne,fe=C.tag=vd(ne),A=bi(ne,A),fe){case 0:C=oc(null,C,ne,A,F);break e;case 1:C=ac(null,C,ne,A,F);break e;case 11:C=vf(null,C,ne,A,F);break e;case 14:C=rc(null,C,ne,bi(ne.type,A),F);break e}throw Error(u(306,ne,""))}return C;case 0:return ne=C.type,fe=C.pendingProps,fe=C.elementType===ne?fe:bi(ne,fe),oc(A,C,ne,fe,F);case 1:return ne=C.type,fe=C.pendingProps,fe=C.elementType===ne?fe:bi(ne,fe),ac(A,C,ne,fe,F);case 3:e:{if(yf(C),A===null)throw Error(u(387));ne=C.pendingProps,ve=C.memoizedState,fe=ve.element,sf(A,C),ts(C,ne,null,F);var Ae=C.memoizedState;if(ne=Ae.element,ve.isDehydrated)if(ve={element:ne,isDehydrated:!1,cache:Ae.cache,pendingSuspenseBoundaries:Ae.pendingSuspenseBoundaries,transitions:Ae.transitions},C.updateQueue.baseState=ve,C.memoizedState=ve,C.flags&256){fe=Aa(Error(u(423)),C),C=ao(A,C,ne,F,fe);break e}else if(ne!==fe){fe=Aa(Error(u(424)),C),C=ao(A,C,ne,F,fe);break e}else for(ii=jo(C.stateNode.containerInfo.firstChild),Nn=C,Kr=!0,Ci=null,F=Ru(C,null,ne,F),C.child=F;F;)F.flags=F.flags&-3|4096,F=F.sibling;else{if(eo(),ne===fe){C=Oi(A,C,F);break e}xn(A,C,ne,F)}C=C.child}return C;case 5:return Fl(C),A===null&&Yn(C),ne=C.type,fe=C.pendingProps,ve=A!==null?A.memoizedProps:null,Ae=fe.children,Rs(ne,fe)?Ae=null:ve!==null&&Rs(ne,ve)&&(C.flags|=32),ic(A,C),xn(A,C,Ae,F),C.child;case 6:return A===null&&Yn(C),null;case 13:return Ku(A,C,F);case 4:return ql(C,C.stateNode.containerInfo),ne=C.pendingProps,A===null?C.child=Jr(C,null,ne,F):xn(A,C,ne,F),C.child;case 11:return ne=C.type,fe=C.pendingProps,fe=C.elementType===ne?fe:bi(ne,fe),vf(A,C,ne,fe,F);case 7:return xn(A,C,C.pendingProps,F),C.child;case 8:return xn(A,C,C.pendingProps.children,F),C.child;case 12:return xn(A,C,C.pendingProps.children,F),C.child;case 10:e:{if(ne=C.type._context,fe=C.pendingProps,ve=C.memoizedProps,Ae=fe.value,zr(Is,ne._currentValue),ne._currentValue=Ae,ve!==null)if(pt(ve.value,Ae)){if(ve.children===fe.children&&!Wn.current){C=Oi(A,C,F);break e}}else for(ve=C.child,ve!==null&&(ve.return=C);ve!==null;){var Be=ve.dependencies;if(Be!==null){Ae=ve.child;for(var Ve=Be.firstContext;Ve!==null;){if(Ve.context===ne){if(ve.tag===1){Ve=wo(-1,F&-F),Ve.tag=2;var gt=ve.updateQueue;if(gt!==null){gt=gt.shared;var Tt=gt.pending;Tt===null?Ve.next=Ve:(Ve.next=Tt.next,Tt.next=Ve),gt.pending=Ve}}ve.lanes|=F,Ve=ve.alternate,Ve!==null&&(Ve.lanes|=F),wn(ve.return,F,C),Be.lanes|=F;break}Ve=Ve.next}}else if(ve.tag===10)Ae=ve.type===C.type?null:ve.child;else if(ve.tag===18){if(Ae=ve.return,Ae===null)throw Error(u(341));Ae.lanes|=F,Be=Ae.alternate,Be!==null&&(Be.lanes|=F),wn(Ae,F,C),Ae=ve.sibling}else Ae=ve.child;if(Ae!==null)Ae.return=ve;else for(Ae=ve;Ae!==null;){if(Ae===C){Ae=null;break}if(ve=Ae.sibling,ve!==null){ve.return=Ae.return,Ae=ve;break}Ae=Ae.return}ve=Ae}xn(A,C,fe.children,F),C=C.child}return C;case 9:return fe=C.type,ne=C.pendingProps.children,Go(C,F),fe=mi(fe),ne=ne(fe),C.flags|=1,xn(A,C,ne,F),C.child;case 14:return ne=C.type,fe=bi(ne,C.pendingProps),fe=bi(ne.type,fe),rc(A,C,ne,fe,F);case 15:return oo(A,C,C.type,C.pendingProps,F);case 17:return ne=C.type,fe=C.pendingProps,fe=C.elementType===ne?fe:bi(ne,fe),Gu(A,C),C.tag=1,Zn(ne)?(A=!0,di(C)):A=!1,Go(C,F),Sa(C,ne,fe),Ql(C,ne,fe,F),sc(null,C,ne,!0,A,F);case 19:return Yo(A,C,F);case 22:return nc(A,C,F)}throw Error(u(156,C.tag))};function Nf(A,C){return Rr(A,C)}function gd(A,C,F,ne){this.tag=A,this.key=F,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=C,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=ne,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wi(A,C,F,ne){return new gd(A,C,F,ne)}function al(A){return A=A.prototype,!(!A||!A.isReactComponent)}function vd(A){if(typeof A=="function")return al(A)?1:0;if(A!=null){if(A=A.$$typeof,A===d)return 11;if(A===w)return 14}return 2}function Di(A,C){var F=A.alternate;return F===null?(F=wi(A.tag,C,A.key,A.mode),F.elementType=A.elementType,F.type=A.type,F.stateNode=A.stateNode,F.alternate=A,A.alternate=F):(F.pendingProps=C,F.type=A.type,F.flags=0,F.subtreeFlags=0,F.deletions=null),F.flags=A.flags&14680064,F.childLanes=A.childLanes,F.lanes=A.lanes,F.child=A.child,F.memoizedProps=A.memoizedProps,F.memoizedState=A.memoizedState,F.updateQueue=A.updateQueue,C=A.dependencies,F.dependencies=C===null?null:{lanes:C.lanes,firstContext:C.firstContext},F.sibling=A.sibling,F.index=A.index,F.ref=A.ref,F}function sl(A,C,F,ne,fe,ve){var Ae=2;if(ne=A,typeof A=="function")al(A)&&(Ae=1);else if(typeof A=="string")Ae=5;else e:switch(A){case Z:return ka(F.children,fe,ve,C);case J:Ae=8,fe|=8;break;case Q:return A=wi(12,F,C,fe|2),A.elementType=Q,A.lanes=ve,A;case g:return A=wi(13,F,C,fe),A.elementType=g,A.lanes=ve,A;case _:return A=wi(19,F,C,fe),A.elementType=_,A.lanes=ve,A;case P:return ul(F,fe,ve,C);default:if(typeof A=="object"&&A!==null)switch(A.$$typeof){case ee:Ae=10;break e;case k:Ae=9;break e;case d:Ae=11;break e;case w:Ae=14;break e;case x:Ae=16,ne=null;break e}throw Error(u(130,A==null?A:typeof A,""))}return C=wi(Ae,F,C,fe),C.elementType=A,C.type=ne,C.lanes=ve,C}function ka(A,C,F,ne){return A=wi(7,A,ne,C),A.lanes=F,A}function ul(A,C,F,ne){return A=wi(22,A,ne,C),A.elementType=P,A.lanes=F,A.stateNode={isHidden:!1},A}function Sc(A,C,F){return A=wi(6,A,null,C),A.lanes=F,A}function Ac(A,C,F){return C=wi(4,A.children!==null?A.children:[],A.key,C),C.lanes=F,C.stateNode={containerInfo:A.containerInfo,pendingChildren:null,implementation:A.implementation},C}function yd(A,C,F,ne,fe){this.tag=C,this.containerInfo=A,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ti(0),this.expirationTimes=Ti(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ti(0),this.identifierPrefix=ne,this.onRecoverableError=fe,this.mutableSourceEagerHydrationData=null}function Tc(A,C,F,ne,fe,ve,Ae,Be,Ve){return A=new yd(A,C,F,Be,Ve),C===1?(C=1,ve===!0&&(C|=8)):C=0,ve=wi(3,null,null,C),A.current=ve,ve.stateNode=A,ve.memoizedState={element:ne,isDehydrated:F,cache:null,transitions:null,pendingSuspenseBoundaries:null},ku(ve),A}function bd(A,C,F){var ne=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:te,key:ne==null?null:""+ne,children:A,containerInfo:C,implementation:F}}function Lf(A){if(!A)return Vo;A=A._reactInternals;e:{if(mt(A)!==A||A.tag!==1)throw Error(u(170));var C=A;do{switch(C.tag){case 3:C=C.stateNode.context;break e;case 1:if(Zn(C.type)){C=C.stateNode.__reactInternalMemoizedMergedChildContext;break e}}C=C.return}while(C!==null);throw Error(u(171))}if(A.tag===1){var F=A.type;if(Zn(F))return Jc(A,F,C)}return C}function Bf(A,C,F,ne,fe,ve,Ae,Be,Ve){return A=Tc(F,ne,!0,A,fe,ve,Ae,Be,Ve),A.context=Lf(null),F=A.current,ne=Kn(),fe=ta(F),ve=wo(ne,fe),ve.callback=C??null,vi(F,ve,fe),A.current.lanes=fe,co(A,fe,ne),Qn(A,ne),A}function ll(A,C,F,ne){var fe=C.current,ve=Kn(),Ae=ta(fe);return F=Lf(F),C.context===null?C.context=F:C.pendingContext=F,C=wo(ve,Ae),C.payload={element:A},ne=ne===void 0?null:ne,ne!==null&&(C.callback=ne),A=vi(fe,C,Ae),A!==null&&(Bi(A,fe,Ae,ve),Cu(A,fe,Ae)),Ae}function cl(A){if(A=A.current,!A.child)return null;switch(A.child.tag){case 5:return A.child.stateNode;default:return A.child.stateNode}}function Df(A,C){if(A=A.memoizedState,A!==null&&A.dehydrated!==null){var F=A.retryLane;A.retryLane=F!==0&&F<C?F:C}}function Rc(A,C){Df(A,C),(A=A.alternate)&&Df(A,C)}function wd(){return null}var qf=typeof reportError=="function"?reportError:function(A){console.error(A)};function fl(A){this._internalRoot=A}eu.prototype.render=fl.prototype.render=function(A){var C=this._internalRoot;if(C===null)throw Error(u(409));ll(A,C,null,null)},eu.prototype.unmount=fl.prototype.unmount=function(){var A=this._internalRoot;if(A!==null){this._internalRoot=null;var C=A.containerInfo;Ra(function(){ll(null,A,null,null)}),C[ni]=null}};function eu(A){this._internalRoot=A}eu.prototype.unstable_scheduleHydration=function(A){if(A){var C=aa();A={blockedOn:null,target:A,priority:C};for(var F=0;F<Pn.length&&C!==0&&C<Pn[F].priority;F++);Pn.splice(F,0,A),F===0&&$o(A)}};function Mc(A){return!(!A||A.nodeType!==1&&A.nodeType!==9&&A.nodeType!==11)}function dl(A){return!(!A||A.nodeType!==1&&A.nodeType!==9&&A.nodeType!==11&&(A.nodeType!==8||A.nodeValue!==" react-mount-point-unstable "))}function Ff(){}function xd(A,C,F,ne,fe){if(fe){if(typeof ne=="function"){var ve=ne;ne=function(){var gt=cl(Ae);ve.call(gt)}}var Ae=Bf(C,ne,A,0,null,!1,!1,"",Ff);return A._reactRootContainer=Ae,A[ni]=Ae.current,Fo(A.nodeType===8?A.parentNode:A),Ra(),Ae}for(;fe=A.lastChild;)A.removeChild(fe);if(typeof ne=="function"){var Be=ne;ne=function(){var gt=cl(Ve);Be.call(gt)}}var Ve=Tc(A,0,!1,null,null,!1,!1,"",Ff);return A._reactRootContainer=Ve,A[ni]=Ve.current,Fo(A.nodeType===8?A.parentNode:A),Ra(function(){ll(C,Ve,F,ne)}),Ve}function Ca(A,C,F,ne,fe){var ve=F._reactRootContainer;if(ve){var Ae=ve;if(typeof fe=="function"){var Be=fe;fe=function(){var Ve=cl(Ae);Be.call(Ve)}}ll(C,Ae,A,fe)}else Ae=xd(F,C,A,fe,ne);return cl(Ae)}oa=function(A){switch(A.tag){case 3:var C=A.stateNode;if(C.current.memoizedState.isDehydrated){var F=Vi(C.pendingLanes);F!==0&&(fo(C,F|1),Qn(C,Ht()),!($r&6)&&(Ta=Ht()+500,Ho()))}break;case 13:Ra(function(){var ne=_o(A,1);if(ne!==null){var fe=Kn();Bi(ne,A,1,fe)}}),Rc(A,1)}},Io=function(A){if(A.tag===13){var C=_o(A,134217728);if(C!==null){var F=Kn();Bi(C,A,134217728,F)}Rc(A,134217728)}},Hi=function(A){if(A.tag===13){var C=ta(A),F=_o(A,C);if(F!==null){var ne=Kn();Bi(F,A,C,ne)}Rc(A,C)}},aa=function(){return br},sa=function(A,C){var F=br;try{return br=A,C()}finally{br=F}},vt=function(A,C,F){switch(C){case"input":if(Ke(A,F),C=F.name,F.type==="radio"&&C!=null){for(F=A;F.parentNode;)F=F.parentNode;for(F=F.querySelectorAll("input[name="+JSON.stringify(""+C)+'][type="radio"]'),C=0;C<F.length;C++){var ne=F[C];if(ne!==A&&ne.form===A.form){var fe=wu(ne);if(!fe)throw Error(u(90));me(ne),Ke(ne,fe)}}}break;case"textarea":Ue(A,F);break;case"select":C=F.value,C!=null&&Oe(A,!!F.multiple,C,!1)}},ft=wc,Ft=Ra;var Ed={usingClientEntryPoint:!1,Events:[In,lr,wu,Vt,tt,wc]},tu={findFiberByHostInstance:Yi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Sd={bundleType:tu.bundleType,version:tu.version,rendererPackageName:tu.rendererPackageName,rendererConfig:tu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:V.ReactCurrentDispatcher,findHostInstanceByFiber:function(A){return A=Ar(A),A===null?null:A.stateNode},findFiberByHostInstance:tu.findFiberByHostInstance||wd,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var hl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!hl.isDisabled&&hl.supportsFiber)try{gr=hl.inject(Sd),sr=hl}catch{}}return reactDom_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ed,reactDom_production_min.createPortal=function(A,C){var F=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Mc(C))throw Error(u(200));return bd(A,C,null,F)},reactDom_production_min.createRoot=function(A,C){if(!Mc(A))throw Error(u(299));var F=!1,ne="",fe=qf;return C!=null&&(C.unstable_strictMode===!0&&(F=!0),C.identifierPrefix!==void 0&&(ne=C.identifierPrefix),C.onRecoverableError!==void 0&&(fe=C.onRecoverableError)),C=Tc(A,1,!1,null,null,F,!1,ne,fe),A[ni]=C.current,Fo(A.nodeType===8?A.parentNode:A),new fl(C)},reactDom_production_min.findDOMNode=function(A){if(A==null)return null;if(A.nodeType===1)return A;var C=A._reactInternals;if(C===void 0)throw typeof A.render=="function"?Error(u(188)):(A=Object.keys(A).join(","),Error(u(268,A)));return A=Ar(C),A=A===null?null:A.stateNode,A},reactDom_production_min.flushSync=function(A){return Ra(A)},reactDom_production_min.hydrate=function(A,C,F){if(!dl(C))throw Error(u(200));return Ca(null,A,C,!0,F)},reactDom_production_min.hydrateRoot=function(A,C,F){if(!Mc(A))throw Error(u(405));var ne=F!=null&&F.hydratedSources||null,fe=!1,ve="",Ae=qf;if(F!=null&&(F.unstable_strictMode===!0&&(fe=!0),F.identifierPrefix!==void 0&&(ve=F.identifierPrefix),F.onRecoverableError!==void 0&&(Ae=F.onRecoverableError)),C=Bf(C,null,A,1,F??null,fe,!1,ve,Ae),A[ni]=C.current,Fo(A),ne)for(A=0;A<ne.length;A++)F=ne[A],fe=F._getVersion,fe=fe(F._source),C.mutableSourceEagerHydrationData==null?C.mutableSourceEagerHydrationData=[F,fe]:C.mutableSourceEagerHydrationData.push(F,fe);return new eu(C)},reactDom_production_min.render=function(A,C,F){if(!dl(C))throw Error(u(200));return Ca(null,A,C,!1,F)},reactDom_production_min.unmountComponentAtNode=function(A){if(!dl(A))throw Error(u(40));return A._reactRootContainer?(Ra(function(){Ca(null,null,A,!1,function(){A._reactRootContainer=null,A[ni]=null})}),!0):!1},reactDom_production_min.unstable_batchedUpdates=wc,reactDom_production_min.unstable_renderSubtreeIntoContainer=function(A,C,F,ne){if(!dl(F))throw Error(u(200));if(A==null||A._reactInternals===void 0)throw Error(u(38));return Ca(A,C,F,!1,ne)},reactDom_production_min.version="18.3.1-next-f1338f8080-20240426",reactDom_production_min}var hasRequiredReactDom;function requireReactDom(){if(hasRequiredReactDom)return reactDom.exports;hasRequiredReactDom=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(a){console.error(a)}}return s(),reactDom.exports=requireReactDom_production_min(),reactDom.exports}var reactDomExports=requireReactDom(),[PortalContextProvider,usePortalContext]=createContext$1({strict:!1,name:"PortalContext"}),PORTAL_CLASSNAME="chakra-portal",PORTAL_SELECTOR=".chakra-portal",Container=s=>jsxRuntimeExports.jsx("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:s.zIndex,top:0,left:0,right:0},children:s.children}),DefaultPortal=s=>{const{appendToParentPortal:a,children:u}=s,[l,f]=reactExports.useState(null),c=reactExports.useRef(null),[,h]=reactExports.useState({});reactExports.useEffect(()=>h({}),[]);const p=usePortalContext(),v=usePortalManager();useSafeLayoutEffect$2(()=>{if(!l)return;const b=l.ownerDocument,S=a?p??b.body:b.body;if(!S)return;c.current=b.createElement("div"),c.current.className=PORTAL_CLASSNAME,S.appendChild(c.current),h({});const E=c.current;return()=>{S.contains(E)&&S.removeChild(E)}},[l]);const y=v!=null&&v.zIndex?jsxRuntimeExports.jsx(Container,{zIndex:v==null?void 0:v.zIndex,children:u}):u;return c.current?reactDomExports.createPortal(jsxRuntimeExports.jsx(PortalContextProvider,{value:c.current,children:y}),c.current):jsxRuntimeExports.jsx("span",{ref:b=>{b&&f(b)}})},ContainerPortal=s=>{const{children:a,containerRef:u,appendToParentPortal:l}=s,f=u.current,c=f??(typeof window<"u"?document.body:void 0),h=reactExports.useMemo(()=>{const v=f==null?void 0:f.ownerDocument.createElement("div");return v&&(v.className=PORTAL_CLASSNAME),v},[f]),[,p]=reactExports.useState({});return useSafeLayoutEffect$2(()=>p({}),[]),useSafeLayoutEffect$2(()=>{if(!(!h||!c))return c.appendChild(h),()=>{c.removeChild(h)}},[h,c]),c&&h?reactDomExports.createPortal(jsxRuntimeExports.jsx(PortalContextProvider,{value:l?h:null,children:a}),h):null};function Portal(s){const a={appendToParentPortal:!0,...s},{containerRef:u,...l}=a;return u?jsxRuntimeExports.jsx(ContainerPortal,{containerRef:u,...l}):jsxRuntimeExports.jsx(DefaultPortal,{...l})}Portal.className=PORTAL_CLASSNAME;Portal.selector=PORTAL_SELECTOR;Portal.displayName="Portal";function useTheme(){const s=reactExports.useContext(ThemeContext);if(!s)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `<ChakraProvider />` or `<ThemeProvider />`");return s}var ColorModeContext=reactExports.createContext({});ColorModeContext.displayName="ColorModeContext";function useColorMode(){const s=reactExports.useContext(ColorModeContext);if(s===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return s}var classNames={light:"chakra-ui-light",dark:"chakra-ui-dark"};function getColorModeUtils(s={}){const{preventTransition:a=!0}=s,u={setDataset:l=>{const f=a?u.preventTransition():void 0;document.documentElement.dataset.theme=l,document.documentElement.style.colorScheme=l,f==null||f()},setClassName(l){document.body.classList.add(l?classNames.dark:classNames.light),document.body.classList.remove(l?classNames.light:classNames.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(l){var f;return((f=u.query().matches)!=null?f:l==="dark")?"dark":"light"},addListener(l){const f=u.query(),c=h=>{l(h.matches?"dark":"light")};return typeof f.addListener=="function"?f.addListener(c):f.addEventListener("change",c),()=>{typeof f.removeListener=="function"?f.removeListener(c):f.removeEventListener("change",c)}},preventTransition(){const l=document.createElement("style");return l.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(l),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(l)})})}}};return u}var STORAGE_KEY="chakra-ui-color-mode";function createLocalStorageManager(s){return{ssr:!1,type:"localStorage",get(a){if(!(globalThis!=null&&globalThis.document))return a;let u;try{u=localStorage.getItem(s)||a}catch{}return u||a},set(a){try{localStorage.setItem(s,a)}catch{}}}}var localStorageManager=createLocalStorageManager(STORAGE_KEY),noop$2=()=>{};function getTheme(s,a){return s.type==="cookie"&&s.ssr?s.get(a):a}function ColorModeProvider(s){const{value:a,children:u,options:{useSystemColorMode:l,initialColorMode:f,disableTransitionOnChange:c}={},colorModeManager:h=localStorageManager}=s,p=f==="dark"?"dark":"light",[v,y]=reactExports.useState(()=>getTheme(h,p)),[b,S]=reactExports.useState(()=>getTheme(h)),{getSystemTheme:E,setClassName:R,setDataset:O,addListener:I}=reactExports.useMemo(()=>getColorModeUtils({preventTransition:c}),[c]),B=f==="system"&&!v?b:v,N=reactExports.useCallback(V=>{const U=V==="system"?E():V;y(U),R(U==="dark"),O(U),h.set(U)},[h,E,R,O]);useSafeLayoutEffect$2(()=>{f==="system"&&S(E())},[]),reactExports.useEffect(()=>{const V=h.get();if(V){N(V);return}if(f==="system"){N("system");return}N(p)},[h,p,f,N]);const D=reactExports.useCallback(()=>{N(B==="dark"?"light":"dark")},[B,N]);reactExports.useEffect(()=>{if(l)return I(N)},[l,I,N]);const G=reactExports.useMemo(()=>({colorMode:a??B,toggleColorMode:a?noop$2:D,setColorMode:a?noop$2:N,forced:a!==void 0}),[B,D,N,a]);return jsxRuntimeExports.jsx(ColorModeContext.Provider,{value:G,children:u})}ColorModeProvider.displayName="ColorModeProvider";var VALID_VALUES=new Set(["dark","light","system"]);function normalize$1(s){let a=s;return VALID_VALUES.has(a)||(a="light"),a}function getScriptSrc(s={}){const{initialColorMode:a="light",type:u="localStorage",storageKey:l="chakra-ui-color-mode"}=s,f=normalize$1(a),c=u==="cookie",h=`(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="${f}",r="${l}",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){}})();
  `,p=`(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="${f}",e="${l}",t=localStorage.getItem(e);t?a(t):localStorage.setItem(e,a(m))}catch(a){}})();
  `;return`!${c?h:p}`.trim()}function ColorModeScript(s={}){const{nonce:a}=s;return jsxRuntimeExports.jsx("script",{id:"chakra-script",nonce:a,dangerouslySetInnerHTML:{__html:getScriptSrc(s)}})}function useChakra(){const s=useColorMode(),a=useTheme();return{...s,theme:a}}var cx=(...s)=>s.filter(Boolean).join(" ");function isDev(){return!1}function isObject$2(s){const a=typeof s;return s!=null&&(a==="object"||a==="function")&&!Array.isArray(s)}var warn=s=>{const{condition:a,message:u}=s;a&&isDev()&&console.warn(u)};function runIfFn$2(s,...a){return isFunction$5(s)?s(...a):s}var isFunction$5=s=>typeof s=="function",dataAttr=s=>s?"":void 0;function callAllHandlers$1(...s){return function(u){s.some(l=>(l==null||l(u),u==null?void 0:u.defaultPrevented))}}var lodash_mergewith={exports:{}};lodash_mergewith.exports;var hasRequiredLodash_mergewith;function requireLodash_mergewith(){return hasRequiredLodash_mergewith||(hasRequiredLodash_mergewith=1,function(s,a){var u=200,l="__lodash_hash_undefined__",f=800,c=16,h=9007199254740991,p="[object Arguments]",v="[object Array]",y="[object AsyncFunction]",b="[object Boolean]",S="[object Date]",E="[object Error]",R="[object Function]",O="[object GeneratorFunction]",I="[object Map]",B="[object Number]",N="[object Null]",D="[object Object]",G="[object Proxy]",V="[object RegExp]",U="[object Set]",te="[object String]",Z="[object Undefined]",J="[object WeakMap]",Q="[object ArrayBuffer]",ee="[object DataView]",k="[object Float32Array]",d="[object Float64Array]",g="[object Int8Array]",_="[object Int16Array]",w="[object Int32Array]",x="[object Uint8Array]",P="[object Uint8ClampedArray]",$="[object Uint16Array]",T="[object Uint32Array]",m=/[\\^$.*+?()[\]{}|]/g,M=/^\[object .+?Constructor\]$/,W=/^(?:0|[1-9]\d*)$/,Y={};Y[k]=Y[d]=Y[g]=Y[_]=Y[w]=Y[x]=Y[P]=Y[$]=Y[T]=!0,Y[p]=Y[v]=Y[Q]=Y[b]=Y[ee]=Y[S]=Y[E]=Y[R]=Y[I]=Y[B]=Y[D]=Y[V]=Y[U]=Y[te]=Y[J]=!1;var ue=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,ge=typeof self=="object"&&self&&self.Object===Object&&self,he=ue||ge||Function("return this")(),ae=a&&!a.nodeType&&a,de=ae&&!0&&s&&!s.nodeType&&s,pe=de&&de.exports===ae,oe=pe&&ue.process,le=function(){try{var we=de&&de.require&&de.require("util").types;return we||oe&&oe.binding&&oe.binding("util")}catch{}}(),me=le&&le.isTypedArray;function xe(we,Te,$e){switch($e.length){case 0:return we.call(Te);case 1:return we.call(Te,$e[0]);case 2:return we.call(Te,$e[0],$e[1]);case 3:return we.call(Te,$e[0],$e[1],$e[2])}return we.apply(Te,$e)}function Ne(we,Te){for(var $e=-1,_t=Array(we);++$e<we;)_t[$e]=Te($e);return _t}function Pe(we){return function(Te){return we(Te)}}function Ie(we,Te){return we==null?void 0:we[Te]}function Ke(we,Te){return function($e){return we(Te($e))}}var Le=Array.prototype,Ce=Function.prototype,at=Object.prototype,Oe=he["__core-js_shared__"],De=Ce.toString,yt=at.hasOwnProperty,Ue=function(){var we=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||"");return we?"Symbol(src)_1."+we:""}(),ze=at.toString,Mt=De.call(Object),se=RegExp("^"+De.call(yt).replace(m,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),j=pe?he.Buffer:void 0,X=he.Symbol,ce=he.Uint8Array;j&&j.allocUnsafe;var be=Ke(Object.getPrototypeOf,Object),Re=Object.create,Se=at.propertyIsEnumerable,qe=Le.splice,bt=X?X.toStringTag:void 0,je=function(){try{var we=lo(Object,"defineProperty");return we({},"",{}),we}catch{}}(),We=j?j.isBuffer:void 0,St=Math.max,ut=Date.now,vt=lo(he,"Map"),zt=lo(Object,"create"),st=function(){function we(){}return function(Te){if(!mn(Te))return{};if(Re)return Re(Te);we.prototype=Te;var $e=new we;return we.prototype=void 0,$e}}();function nt(we){var Te=-1,$e=we==null?0:we.length;for(this.clear();++Te<$e;){var _t=we[Te];this.set(_t[0],_t[1])}}function Vt(){this.__data__=zt?zt(null):{},this.size=0}function tt(we){var Te=this.has(we)&&delete this.__data__[we];return this.size-=Te?1:0,Te}function ft(we){var Te=this.__data__;if(zt){var $e=Te[we];return $e===l?void 0:$e}return yt.call(Te,we)?Te[we]:void 0}function Ft(we){var Te=this.__data__;return zt?Te[we]!==void 0:yt.call(Te,we)}function Qe(we,Te){var $e=this.__data__;return this.size+=this.has(we)?0:1,$e[we]=zt&&Te===void 0?l:Te,this}nt.prototype.clear=Vt,nt.prototype.delete=tt,nt.prototype.get=ft,nt.prototype.has=Ft,nt.prototype.set=Qe;function rt(we){var Te=-1,$e=we==null?0:we.length;for(this.clear();++Te<$e;){var _t=we[Te];this.set(_t[0],_t[1])}}function Bt(){this.__data__=[],this.size=0}function Xe(we){var Te=this.__data__,$e=fr(Te,we);if($e<0)return!1;var _t=Te.length-1;return $e==_t?Te.pop():qe.call(Te,$e,1),--this.size,!0}function ct(we){var Te=this.__data__,$e=fr(Te,we);return $e<0?void 0:Te[$e][1]}function Ut(we){return fr(this.__data__,we)>-1}function Je(we,Te){var $e=this.__data__,_t=fr($e,we);return _t<0?(++this.size,$e.push([we,Te])):$e[_t][1]=Te,this}rt.prototype.clear=Bt,rt.prototype.delete=Xe,rt.prototype.get=ct,rt.prototype.has=Ut,rt.prototype.set=Je;function it(we){var Te=-1,$e=we==null?0:we.length;for(this.clear();++Te<$e;){var _t=we[Te];this.set(_t[0],_t[1])}}function qt(){this.size=0,this.__data__={hash:new nt,map:new(vt||rt),string:new nt}}function et(we){var Te=li(this,we).delete(we);return this.size-=Te?1:0,Te}function ht(we){return li(this,we).get(we)}function ar(we){return li(this,we).has(we)}function dt(we,Te){var $e=li(this,we),_t=$e.size;return $e.set(we,Te),this.size+=$e.size==_t?0:1,this}it.prototype.clear=qt,it.prototype.delete=et,it.prototype.get=ht,it.prototype.has=ar,it.prototype.set=dt;function mt(we){var Te=this.__data__=new rt(we);this.size=Te.size}function Xt(){this.__data__=new rt,this.size=0}function er(we){var Te=this.__data__,$e=Te.delete(we);return this.size=Te.size,$e}function kr(we){return this.__data__.get(we)}function Ar(we){return this.__data__.has(we)}function Tr(we,Te){var $e=this.__data__;if($e instanceof rt){var _t=$e.__data__;if(!vt||_t.length<u-1)return _t.push([we,Te]),this.size=++$e.size,this;$e=this.__data__=new it(_t)}return $e.set(we,Te),this.size=$e.size,this}mt.prototype.clear=Xt,mt.prototype.delete=er,mt.prototype.get=kr,mt.prototype.has=Ar,mt.prototype.set=Tr;function Rr(we,Te){var $e=Rn(we),_t=!$e&&Tn(we),It=!$e&&!_t&&Mi(we),Kt=!$e&&!_t&&!It&&$o(we),Jt=$e||_t||It||Kt,Ct=Jt?Ne(we.length,String):[],Zt=Ct.length;for(var Pr in we)Jt&&(Pr=="length"||It&&(Pr=="offset"||Pr=="parent")||Kt&&(Pr=="buffer"||Pr=="byteLength"||Pr=="byteOffset")||Ti(Pr,Zt))||Ct.push(Pr);return Ct}function pr(we,Te,$e){($e!==void 0&&!qn(we[Te],$e)||$e===void 0&&!(Te in we))&&Ht(we,Te,$e)}function _r(we,Te,$e){var _t=we[Te];(!(yt.call(we,Te)&&qn(_t,$e))||$e===void 0&&!(Te in we))&&Ht(we,Te,$e)}function fr(we,Te){for(var $e=we.length;$e--;)if(qn(we[$e][0],Te))return $e;return-1}function Ht(we,Te,$e){Te=="__proto__"&&je?je(we,Te,{configurable:!0,enumerable:!0,value:$e,writable:!0}):we[Te]=$e}var Cr=Ai();function ur(we){return we==null?we===void 0?Z:N:bt&&bt in Object(we)?Co(we):oa(we)}function wr(we){return cn(we)&&ur(we)==p}function yr(we){if(!mn(we)||fo(we))return!1;var Te=Pn(we)?se:M;return Te.test(Oo(we))}function Mr(we){return cn(we)&&ua(we.length)&&!!Y[ur(we)]}function Er(we){if(!mn(we))return Ri(we);var Te=br(we),$e=[];for(var _t in we)_t=="constructor"&&(Te||!yt.call(we,_t))||$e.push(_t);return $e}function gr(we,Te,$e,_t,It){we!==Te&&Cr(Te,function(Kt,Jt){if(It||(It=new mt),mn(Kt))sr(we,Te,Jt,$e,gr,_t,It);else{var Ct=_t?_t(Hi(we,Jt),Kt,Jt+"",we,Te,It):void 0;Ct===void 0&&(Ct=Kt),pr(we,Jt,Ct)}},Lo)}function sr(we,Te,$e,_t,It,Kt,Jt){var Ct=Hi(we,$e),Zt=Hi(Te,$e),Pr=Jt.get(Zt);if(Pr){pr(we,$e,Pr);return}var qr=Kt?Kt(Ct,Zt,$e+"",we,Te,Jt):void 0,gn=qr===void 0;if(gn){var Zr=Rn(Zt),Pi=!Zr&&Mi(Zt),rn=!Zr&&!Pi&&$o(Zt);qr=Zt,Zr||Pi||rn?Rn(Ct)?qr=Ct:Ki(Ct)?qr=zi(Ct):Pi?(gn=!1,qr=ji(Zt)):rn?(gn=!1,qr=La(Zt)):qr=[]:gs(Zt)||Tn(Zt)?(qr=Ct,Tn(Ct)?qr=No(Ct):(!mn(Ct)||Pn(Ct))&&(qr=ia(Zt))):gn=!1}gn&&(Jt.set(Zt,qr),It(qr,Zt,_t,Kt,Jt),Jt.delete(Zt)),pr(we,$e,qr)}function Ir(we,Te){return aa(Io(we,Te,xr),we+"")}var ln=je?function(we,Te){return je(we,"toString",{configurable:!0,enumerable:!1,value:Or(Te),writable:!0})}:xr;function ji(we,Te){return we.slice()}function Na(we){var Te=new we.constructor(we.byteLength);return new ce(Te).set(new ce(we)),Te}function La(we,Te){var $e=Na(we.buffer);return new we.constructor($e,we.byteOffset,we.length)}function zi(we,Te){var $e=-1,_t=we.length;for(Te||(Te=Array(_t));++$e<_t;)Te[$e]=we[$e];return Te}function ko(we,Te,$e,_t){var It=!$e;$e||($e={});for(var Kt=-1,Jt=Te.length;++Kt<Jt;){var Ct=Te[Kt],Zt=void 0;Zt===void 0&&(Zt=we[Ct]),It?Ht($e,Ct,Zt):_r($e,Ct,Zt)}return $e}function Vi(we){return Ir(function(Te,$e){var _t=-1,It=$e.length,Kt=It>1?$e[It-1]:void 0,Jt=It>2?$e[2]:void 0;for(Kt=we.length>3&&typeof Kt=="function"?(It--,Kt):void 0,Jt&&co($e[0],$e[1],Jt)&&(Kt=It<3?void 0:Kt,It=1),Te=Object(Te);++_t<It;){var Ct=$e[_t];Ct&&we(Te,Ct,_t,Kt)}return Te})}function Ai(we){return function(Te,$e,_t){for(var It=-1,Kt=Object(Te),Jt=_t(Te),Ct=Jt.length;Ct--;){var Zt=Jt[++It];if($e(Kt[Zt],Zt,Kt)===!1)break}return Te}}function li(we,Te){var $e=we.__data__;return Ba(Te)?$e[typeof Te=="string"?"string":"hash"]:$e.map}function lo(we,Te){var $e=Ie(we,Te);return yr($e)?$e:void 0}function Co(we){var Te=yt.call(we,bt),$e=we[bt];try{we[bt]=void 0;var _t=!0}catch{}var It=ze.call(we);return _t&&(Te?we[bt]=$e:delete we[bt]),It}function ia(we){return typeof we.constructor=="function"&&!br(we)?st(be(we)):{}}function Ti(we,Te){var $e=typeof we;return Te=Te??h,!!Te&&($e=="number"||$e!="symbol"&&W.test(we))&&we>-1&&we%1==0&&we<Te}function co(we,Te,$e){if(!mn($e))return!1;var _t=typeof Te;return(_t=="number"?Mn($e)&&Ti(Te,$e.length):_t=="string"&&Te in $e)?qn($e[Te],we):!1}function Ba(we){var Te=typeof we;return Te=="string"||Te=="number"||Te=="symbol"||Te=="boolean"?we!=="__proto__":we===null}function fo(we){return!!Ue&&Ue in we}function br(we){var Te=we&&we.constructor,$e=typeof Te=="function"&&Te.prototype||at;return we===$e}function Ri(we){var Te=[];if(we!=null)for(var $e in Object(we))Te.push($e);return Te}function oa(we){return ze.call(we)}function Io(we,Te,$e){return Te=St(Te===void 0?we.length-1:Te,0),function(){for(var _t=arguments,It=-1,Kt=St(_t.length-Te,0),Jt=Array(Kt);++It<Kt;)Jt[It]=_t[Te+It];It=-1;for(var Ct=Array(Te+1);++It<Te;)Ct[It]=_t[It];return Ct[Te]=$e(Jt),xe(we,this,Ct)}}function Hi(we,Te){if(!(Te==="constructor"&&typeof we[Te]=="function")&&Te!="__proto__")return we[Te]}var aa=sa(ln);function sa(we){var Te=0,$e=0;return function(){var _t=ut(),It=c-(_t-$e);if($e=_t,It>0){if(++Te>=f)return arguments[0]}else Te=0;return we.apply(void 0,arguments)}}function Oo(we){if(we!=null){try{return De.call(we)}catch{}try{return we+""}catch{}}return""}function qn(we,Te){return we===Te||we!==we&&Te!==Te}var Tn=wr(function(){return arguments}())?wr:function(we){return cn(we)&&yt.call(we,"callee")&&!Se.call(we,"callee")},Rn=Array.isArray;function Mn(we){return we!=null&&ua(we.length)&&!Pn(we)}function Ki(we){return cn(we)&&Mn(we)}var Mi=We||Gi;function Pn(we){if(!mn(we))return!1;var Te=ur(we);return Te==R||Te==O||Te==y||Te==G}function ua(we){return typeof we=="number"&&we>-1&&we%1==0&&we<=h}function mn(we){var Te=typeof we;return we!=null&&(Te=="object"||Te=="function")}function cn(we){return we!=null&&typeof we=="object"}function gs(we){if(!cn(we)||ur(we)!=D)return!1;var Te=be(we);if(Te===null)return!0;var $e=yt.call(Te,"constructor")&&Te.constructor;return typeof $e=="function"&&$e instanceof $e&&De.call($e)==Mt}var $o=me?Pe(me):Mr;function No(we){return ko(we,Lo(we))}function Lo(we){return Mn(we)?Rr(we):Er(we)}var vs=Vi(function(we,Te,$e,_t){gr(we,Te,$e,_t)});function Or(we){return function(){return we}}function xr(we){return we}function Gi(){return!1}s.exports=vs}(lodash_mergewith,lodash_mergewith.exports)),lodash_mergewith.exports}var lodash_mergewithExports=requireLodash_mergewith();const mergeWith=getDefaultExportFromCjs(lodash_mergewithExports);var isImportant=s=>/!(important)?$/.test(s),withoutImportant=s=>typeof s=="string"?s.replace(/!(important)?$/,"").trim():s,tokenToCSSVar=(s,a)=>u=>{const l=String(a),f=isImportant(l),c=withoutImportant(l),h=s?`${s}.${c}`:c;let p=isObject$2(u.__cssMap)&&h in u.__cssMap?u.__cssMap[h].varRef:a;return p=withoutImportant(p),f?`${p} !important`:p};function createTransform(s){const{scale:a,transform:u,compose:l}=s;return(c,h)=>{var p;const v=tokenToCSSVar(a,c)(h);let y=(p=u==null?void 0:u(v,h))!=null?p:v;return l&&(y=l(y,h)),y}}var pipe$2=(...s)=>a=>s.reduce((u,l)=>l(u),a);function toConfig(s,a){return u=>{const l={property:u,scale:s};return l.transform=createTransform({scale:s,transform:a}),l}}var getRtl=({rtl:s,ltr:a})=>u=>u.direction==="rtl"?s:a;function logical(s){const{property:a,scale:u,transform:l}=s;return{scale:u,property:getRtl(a),transform:u?createTransform({scale:u,compose:l}):l}}var transformTemplate=["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 getTransformTemplate(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...transformTemplate].join(" ")}function getTransformGpuTemplate(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...transformTemplate].join(" ")}var filterTemplate={"--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(" ")},backdropFilterTemplate={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 getRingTemplate(s){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":s,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var flexDirectionTemplate={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},directionMap={"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"},valueSet=new Set(Object.values(directionMap)),globalSet=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),trimSpace=s=>s.trim();function parseGradient(s,a){if(s==null||globalSet.has(s))return s;if(!(isCSSFunction(s)||globalSet.has(s)))return`url('${s}')`;const f=/(^[a-z-A-Z]+)\((.*)\)/g.exec(s),c=f==null?void 0:f[1],h=f==null?void 0:f[2];if(!c||!h)return s;const p=c.includes("-gradient")?c:`${c}-gradient`,[v,...y]=h.split(",").map(trimSpace).filter(Boolean);if((y==null?void 0:y.length)===0)return s;const b=v in directionMap?directionMap[v]:v;y.unshift(b);const S=y.map(E=>{if(valueSet.has(E))return E;const R=E.indexOf(" "),[O,I]=R!==-1?[E.substr(0,R),E.substr(R+1)]:[E],B=isCSSFunction(I)?I:I&&I.split(" "),N=`colors.${O}`,D=N in a.__cssMap?a.__cssMap[N].varRef:O;return B?[D,...Array.isArray(B)?B:[B]].join(" "):D});return`${p}(${S.join(", ")})`}var isCSSFunction=s=>typeof s=="string"&&s.includes("(")&&s.includes(")"),gradientTransform=(s,a)=>parseGradient(s,a??{});function isCssVar(s){return/^var\(--.+\)$/.test(s)}var analyzeCSSValue=s=>{const a=parseFloat(s.toString()),u=s.toString().replace(String(a),"");return{unitless:!u,value:a,unit:u}},wrap=s=>a=>`${s}(${a})`,transformFunctions={filter(s){return s!=="auto"?s:filterTemplate},backdropFilter(s){return s!=="auto"?s:backdropFilterTemplate},ring(s){return getRingTemplate(transformFunctions.px(s))},bgClip(s){return s==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:s}},transform(s){return s==="auto"?getTransformTemplate():s==="auto-gpu"?getTransformGpuTemplate():s},vh(s){return s==="$100vh"?"var(--chakra-vh)":s},px(s){if(s==null)return s;const{unitless:a}=analyzeCSSValue(s);return a||typeof s=="number"?`${s}px`:s},fraction(s){return typeof s!="number"||s>1?s:`${s*100}%`},float(s,a){const u={left:"right",right:"left"};return a.direction==="rtl"?u[s]:s},degree(s){if(isCssVar(s)||s==null)return s;const a=typeof s=="string"&&!s.endsWith("deg");return typeof s=="number"||a?`${s}deg`:s},gradient:gradientTransform,blur:wrap("blur"),opacity:wrap("opacity"),brightness:wrap("brightness"),contrast:wrap("contrast"),dropShadow:wrap("drop-shadow"),grayscale:wrap("grayscale"),hueRotate:s=>wrap("hue-rotate")(transformFunctions.degree(s)),invert:wrap("invert"),saturate:wrap("saturate"),sepia:wrap("sepia"),bgImage(s){return s==null||isCSSFunction(s)||globalSet.has(s)?s:`url(${s})`},outline(s){const a=String(s)==="0"||String(s)==="none";return s!==null&&a?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:s}},flexDirection(s){var a;const{space:u,divide:l}=(a=flexDirectionTemplate[s])!=null?a:{},f={flexDirection:s};return u&&(f[u]=1),l&&(f[l]=1),f}},t$1={borderWidths:toConfig("borderWidths"),borderStyles:toConfig("borderStyles"),colors:toConfig("colors"),borders:toConfig("borders"),gradients:toConfig("gradients",transformFunctions.gradient),radii:toConfig("radii",transformFunctions.px),space:toConfig("space",pipe$2(transformFunctions.vh,transformFunctions.px)),spaceT:toConfig("space",pipe$2(transformFunctions.vh,transformFunctions.px)),degreeT(s){return{property:s,transform:transformFunctions.degree}},prop(s,a,u){return{property:s,scale:a,...a&&{transform:createTransform({scale:a,transform:u})}}},propT(s,a){return{property:s,transform:a}},sizes:toConfig("sizes",pipe$2(transformFunctions.vh,transformFunctions.px)),sizesT:toConfig("sizes",pipe$2(transformFunctions.vh,transformFunctions.fraction)),shadows:toConfig("shadows"),logical,blur:toConfig("blur",transformFunctions.blur)},background={background:t$1.colors("background"),backgroundColor:t$1.colors("backgroundColor"),backgroundImage:t$1.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:transformFunctions.bgClip},bgSize:t$1.prop("backgroundSize"),bgPosition:t$1.prop("backgroundPosition"),bg:t$1.colors("background"),bgColor:t$1.colors("backgroundColor"),bgPos:t$1.prop("backgroundPosition"),bgRepeat:t$1.prop("backgroundRepeat"),bgAttachment:t$1.prop("backgroundAttachment"),bgGradient:t$1.gradients("backgroundImage"),bgClip:{transform:transformFunctions.bgClip}};Object.assign(background,{bgImage:background.backgroundImage,bgImg:background.backgroundImage});var border={border:t$1.borders("border"),borderWidth:t$1.borderWidths("borderWidth"),borderStyle:t$1.borderStyles("borderStyle"),borderColor:t$1.colors("borderColor"),borderRadius:t$1.radii("borderRadius"),borderTop:t$1.borders("borderTop"),borderBlockStart:t$1.borders("borderBlockStart"),borderTopLeftRadius:t$1.radii("borderTopLeftRadius"),borderStartStartRadius:t$1.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:t$1.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:t$1.radii("borderTopRightRadius"),borderStartEndRadius:t$1.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:t$1.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:t$1.borders("borderRight"),borderInlineEnd:t$1.borders("borderInlineEnd"),borderBottom:t$1.borders("borderBottom"),borderBlockEnd:t$1.borders("borderBlockEnd"),borderBottomLeftRadius:t$1.radii("borderBottomLeftRadius"),borderBottomRightRadius:t$1.radii("borderBottomRightRadius"),borderLeft:t$1.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:t$1.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:t$1.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:t$1.borders(["borderLeft","borderRight"]),borderInline:t$1.borders("borderInline"),borderY:t$1.borders(["borderTop","borderBottom"]),borderBlock:t$1.borders("borderBlock"),borderTopWidth:t$1.borderWidths("borderTopWidth"),borderBlockStartWidth:t$1.borderWidths("borderBlockStartWidth"),borderTopColor:t$1.colors("borderTopColor"),borderBlockStartColor:t$1.colors("borderBlockStartColor"),borderTopStyle:t$1.borderStyles("borderTopStyle"),borderBlockStartStyle:t$1.borderStyles("borderBlockStartStyle"),borderBottomWidth:t$1.borderWidths("borderBottomWidth"),borderBlockEndWidth:t$1.borderWidths("borderBlockEndWidth"),borderBottomColor:t$1.colors("borderBottomColor"),borderBlockEndColor:t$1.colors("borderBlockEndColor"),borderBottomStyle:t$1.borderStyles("borderBottomStyle"),borderBlockEndStyle:t$1.borderStyles("borderBlockEndStyle"),borderLeftWidth:t$1.borderWidths("borderLeftWidth"),borderInlineStartWidth:t$1.borderWidths("borderInlineStartWidth"),borderLeftColor:t$1.colors("borderLeftColor"),borderInlineStartColor:t$1.colors("borderInlineStartColor"),borderLeftStyle:t$1.borderStyles("borderLeftStyle"),borderInlineStartStyle:t$1.borderStyles("borderInlineStartStyle"),borderRightWidth:t$1.borderWidths("borderRightWidth"),borderInlineEndWidth:t$1.borderWidths("borderInlineEndWidth"),borderRightColor:t$1.colors("borderRightColor"),borderInlineEndColor:t$1.colors("borderInlineEndColor"),borderRightStyle:t$1.borderStyles("borderRightStyle"),borderInlineEndStyle:t$1.borderStyles("borderInlineEndStyle"),borderTopRadius:t$1.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:t$1.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:t$1.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:t$1.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(border,{rounded:border.borderRadius,roundedTop:border.borderTopRadius,roundedTopLeft:border.borderTopLeftRadius,roundedTopRight:border.borderTopRightRadius,roundedTopStart:border.borderStartStartRadius,roundedTopEnd:border.borderStartEndRadius,roundedBottom:border.borderBottomRadius,roundedBottomLeft:border.borderBottomLeftRadius,roundedBottomRight:border.borderBottomRightRadius,roundedBottomStart:border.borderEndStartRadius,roundedBottomEnd:border.borderEndEndRadius,roundedLeft:border.borderLeftRadius,roundedRight:border.borderRightRadius,roundedStart:border.borderInlineStartRadius,roundedEnd:border.borderInlineEndRadius,borderStart:border.borderInlineStart,borderEnd:border.borderInlineEnd,borderTopStartRadius:border.borderStartStartRadius,borderTopEndRadius:border.borderStartEndRadius,borderBottomStartRadius:border.borderEndStartRadius,borderBottomEndRadius:border.borderEndEndRadius,borderStartRadius:border.borderInlineStartRadius,borderEndRadius:border.borderInlineEndRadius,borderStartWidth:border.borderInlineStartWidth,borderEndWidth:border.borderInlineEndWidth,borderStartColor:border.borderInlineStartColor,borderEndColor:border.borderInlineEndColor,borderStartStyle:border.borderInlineStartStyle,borderEndStyle:border.borderInlineEndStyle});var color$1={color:t$1.colors("color"),textColor:t$1.colors("color"),fill:t$1.colors("fill"),stroke:t$1.colors("stroke")},effect={boxShadow:t$1.shadows("boxShadow"),mixBlendMode:!0,blendMode:t$1.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:t$1.prop("backgroundBlendMode"),opacity:!0};Object.assign(effect,{shadow:effect.boxShadow});var filter$2={filter:{transform:transformFunctions.filter},blur:t$1.blur("--chakra-blur"),brightness:t$1.propT("--chakra-brightness",transformFunctions.brightness),contrast:t$1.propT("--chakra-contrast",transformFunctions.contrast),hueRotate:t$1.propT("--chakra-hue-rotate",transformFunctions.hueRotate),invert:t$1.propT("--chakra-invert",transformFunctions.invert),saturate:t$1.propT("--chakra-saturate",transformFunctions.saturate),dropShadow:t$1.propT("--chakra-drop-shadow",transformFunctions.dropShadow),backdropFilter:{transform:transformFunctions.backdropFilter},backdropBlur:t$1.blur("--chakra-backdrop-blur"),backdropBrightness:t$1.propT("--chakra-backdrop-brightness",transformFunctions.brightness),backdropContrast:t$1.propT("--chakra-backdrop-contrast",transformFunctions.contrast),backdropHueRotate:t$1.propT("--chakra-backdrop-hue-rotate",transformFunctions.hueRotate),backdropInvert:t$1.propT("--chakra-backdrop-invert",transformFunctions.invert),backdropSaturate:t$1.propT("--chakra-backdrop-saturate",transformFunctions.saturate)},flexbox={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:transformFunctions.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:t$1.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:t$1.space("gap"),rowGap:t$1.space("rowGap"),columnGap:t$1.space("columnGap")};Object.assign(flexbox,{flexDir:flexbox.flexDirection});var grid={gridGap:t$1.space("gridGap"),gridColumnGap:t$1.space("gridColumnGap"),gridRowGap:t$1.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},interactivity={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:transformFunctions.outline},outlineOffset:!0,outlineColor:t$1.colors("outlineColor")},layout$1={width:t$1.sizesT("width"),inlineSize:t$1.sizesT("inlineSize"),height:t$1.sizes("height"),blockSize:t$1.sizes("blockSize"),boxSize:t$1.sizes(["width","height"]),minWidth:t$1.sizes("minWidth"),minInlineSize:t$1.sizes("minInlineSize"),minHeight:t$1.sizes("minHeight"),minBlockSize:t$1.sizes("minBlockSize"),maxWidth:t$1.sizes("maxWidth"),maxInlineSize:t$1.sizes("maxInlineSize"),maxHeight:t$1.sizes("maxHeight"),maxBlockSize:t$1.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,aspectRatio:!0,hideFrom:{scale:"breakpoints",transform:(s,a)=>{var u,l,f;return{[`@media screen and (min-width: ${(f=(l=(u=a.__breakpoints)==null?void 0:u.get(s))==null?void 0:l.minW)!=null?f:s})`]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(s,a)=>{var u,l,f;return{[`@media screen and (max-width: ${(f=(l=(u=a.__breakpoints)==null?void 0:u.get(s))==null?void 0:l._minW)!=null?f:s})`]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:t$1.propT("float",transformFunctions.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(layout$1,{w:layout$1.width,h:layout$1.height,minW:layout$1.minWidth,maxW:layout$1.maxWidth,minH:layout$1.minHeight,maxH:layout$1.maxHeight,overscroll:layout$1.overscrollBehavior,overscrollX:layout$1.overscrollBehaviorX,overscrollY:layout$1.overscrollBehaviorY});var list={listStyleType:!0,listStylePosition:!0,listStylePos:t$1.prop("listStylePosition"),listStyleImage:!0,listStyleImg:t$1.prop("listStyleImage")};function get$5(s,a,u,l){const f=typeof a=="string"?a.split("."):[a];for(l=0;l<f.length&&s;l+=1)s=s[f[l]];return s===void 0?u:s}var memoize$1=s=>{const a=new WeakMap;return(l,f,c,h)=>{if(typeof l>"u")return s(l,f,c);a.has(l)||a.set(l,new Map);const p=a.get(l);if(p.has(f))return p.get(f);const v=s(l,f,c,h);return p.set(f,v),v}},memoizedGet$1=memoize$1(get$5),srOnly={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},srFocusable={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},getWithPriority=(s,a,u)=>{const l={},f=memoizedGet$1(s,a,{});for(const c in f)c in u&&u[c]!=null||(l[c]=f[c]);return l},others={srOnly:{transform(s){return s===!0?srOnly:s==="focusable"?srFocusable:{}}},layerStyle:{processResult:!0,transform:(s,a,u)=>getWithPriority(a,`layerStyles.${s}`,u)},textStyle:{processResult:!0,transform:(s,a,u)=>getWithPriority(a,`textStyles.${s}`,u)},apply:{processResult:!0,transform:(s,a,u)=>getWithPriority(a,s,u)}},position={position:!0,pos:t$1.prop("position"),zIndex:t$1.prop("zIndex","zIndices"),inset:t$1.spaceT("inset"),insetX:t$1.spaceT(["left","right"]),insetInline:t$1.spaceT("insetInline"),insetY:t$1.spaceT(["top","bottom"]),insetBlock:t$1.spaceT("insetBlock"),top:t$1.spaceT("top"),insetBlockStart:t$1.spaceT("insetBlockStart"),bottom:t$1.spaceT("bottom"),insetBlockEnd:t$1.spaceT("insetBlockEnd"),left:t$1.spaceT("left"),insetInlineStart:t$1.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:t$1.spaceT("right"),insetInlineEnd:t$1.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(position,{insetStart:position.insetInlineStart,insetEnd:position.insetInlineEnd});var ring={ring:{transform:transformFunctions.ring},ringColor:t$1.colors("--chakra-ring-color"),ringOffset:t$1.prop("--chakra-ring-offset-width"),ringOffsetColor:t$1.colors("--chakra-ring-offset-color"),ringInset:t$1.prop("--chakra-ring-inset")},space={margin:t$1.spaceT("margin"),marginTop:t$1.spaceT("marginTop"),marginBlockStart:t$1.spaceT("marginBlockStart"),marginRight:t$1.spaceT("marginRight"),marginInlineEnd:t$1.spaceT("marginInlineEnd"),marginBottom:t$1.spaceT("marginBottom"),marginBlockEnd:t$1.spaceT("marginBlockEnd"),marginLeft:t$1.spaceT("marginLeft"),marginInlineStart:t$1.spaceT("marginInlineStart"),marginX:t$1.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:t$1.spaceT("marginInline"),marginY:t$1.spaceT(["marginTop","marginBottom"]),marginBlock:t$1.spaceT("marginBlock"),padding:t$1.space("padding"),paddingTop:t$1.space("paddingTop"),paddingBlockStart:t$1.space("paddingBlockStart"),paddingRight:t$1.space("paddingRight"),paddingBottom:t$1.space("paddingBottom"),paddingBlockEnd:t$1.space("paddingBlockEnd"),paddingLeft:t$1.space("paddingLeft"),paddingInlineStart:t$1.space("paddingInlineStart"),paddingInlineEnd:t$1.space("paddingInlineEnd"),paddingX:t$1.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:t$1.space("paddingInline"),paddingY:t$1.space(["paddingTop","paddingBottom"]),paddingBlock:t$1.space("paddingBlock")};Object.assign(space,{m:space.margin,mt:space.marginTop,mr:space.marginRight,me:space.marginInlineEnd,marginEnd:space.marginInlineEnd,mb:space.marginBottom,ml:space.marginLeft,ms:space.marginInlineStart,marginStart:space.marginInlineStart,mx:space.marginX,my:space.marginY,p:space.padding,pt:space.paddingTop,py:space.paddingY,px:space.paddingX,pb:space.paddingBottom,pl:space.paddingLeft,ps:space.paddingInlineStart,paddingStart:space.paddingInlineStart,pr:space.paddingRight,pe:space.paddingInlineEnd,paddingEnd:space.paddingInlineEnd});var textDecoration={textDecorationColor:t$1.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:t$1.shadows("textShadow")},transform={clipPath:!0,transform:t$1.propT("transform",transformFunctions.transform),transformOrigin:!0,translateX:t$1.spaceT("--chakra-translate-x"),translateY:t$1.spaceT("--chakra-translate-y"),skewX:t$1.degreeT("--chakra-skew-x"),skewY:t$1.degreeT("--chakra-skew-y"),scaleX:t$1.prop("--chakra-scale-x"),scaleY:t$1.prop("--chakra-scale-y"),scale:t$1.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:t$1.degreeT("--chakra-rotate")},transition$1={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:t$1.prop("transitionDuration","transition.duration"),transitionProperty:t$1.prop("transitionProperty","transition.property"),transitionTimingFunction:t$1.prop("transitionTimingFunction","transition.easing")},typography$1={fontFamily:t$1.prop("fontFamily","fonts"),fontSize:t$1.prop("fontSize","fontSizes",transformFunctions.px),fontWeight:t$1.prop("fontWeight","fontWeights"),lineHeight:t$1.prop("lineHeight","lineHeights"),letterSpacing:t$1.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(s){if(s===!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"}},scroll={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:t$1.spaceT("scrollMargin"),scrollMarginTop:t$1.spaceT("scrollMarginTop"),scrollMarginBottom:t$1.spaceT("scrollMarginBottom"),scrollMarginLeft:t$1.spaceT("scrollMarginLeft"),scrollMarginRight:t$1.spaceT("scrollMarginRight"),scrollMarginX:t$1.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:t$1.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:t$1.spaceT("scrollPadding"),scrollPaddingTop:t$1.spaceT("scrollPaddingTop"),scrollPaddingBottom:t$1.spaceT("scrollPaddingBottom"),scrollPaddingLeft:t$1.spaceT("scrollPaddingLeft"),scrollPaddingRight:t$1.spaceT("scrollPaddingRight"),scrollPaddingX:t$1.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:t$1.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function resolveReference(s){return isObject$2(s)&&s.reference?s.reference:String(s)}var toExpression=(s,...a)=>a.map(resolveReference).join(` ${s} `).replace(/calc/g,""),add$1=(...s)=>`calc(${toExpression("+",...s)})`,subtract$1=(...s)=>`calc(${toExpression("-",...s)})`,multiply$1=(...s)=>`calc(${toExpression("*",...s)})`,divide$1=(...s)=>`calc(${toExpression("/",...s)})`,negate$1=s=>{const a=resolveReference(s);return a!=null&&!Number.isNaN(parseFloat(a))?String(a).startsWith("-")?String(a).slice(1):`-${a}`:multiply$1(a,-1)},calc$1=Object.assign(s=>({add:(...a)=>calc$1(add$1(s,...a)),subtract:(...a)=>calc$1(subtract$1(s,...a)),multiply:(...a)=>calc$1(multiply$1(s,...a)),divide:(...a)=>calc$1(divide$1(s,...a)),negate:()=>calc$1(negate$1(s)),toString:()=>s.toString()}),{add:add$1,subtract:subtract$1,multiply:multiply$1,divide:divide$1,negate:negate$1});function replaceWhiteSpace$1(s,a="-"){return s.replace(/\s+/g,a)}function escape$1(s){const a=replaceWhiteSpace$1(s.toString());return escapeSymbol(escapeDot(a))}function escapeDot(s){return s.includes("\\.")?s:!Number.isInteger(parseFloat(s.toString()))?s.replace(".","\\."):s}function escapeSymbol(s){return s.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function addPrefix$1(s,a=""){return[a,s].filter(Boolean).join("-")}function toVarReference(s,a){return`var(${s}${a?`, ${a}`:""})`}function toVarDefinition(s,a=""){return escape$1(`--${addPrefix$1(s,a)}`)}function cssVar$1(s,a,u){const l=toVarDefinition(s,u);return{variable:l,reference:toVarReference(l,a)}}function defineCssVars(s,a){const u={};for(const l of a){if(Array.isArray(l)){const[f,c]=l;u[f]=cssVar$1(`${s}-${f}`,c);continue}u[l]=cssVar$1(`${s}-${l}`)}return u}function getLastItem(s){const a=s==null?0:s.length;return a?s[a-1]:void 0}function analyzeCSSValue2(s){const a=parseFloat(s.toString()),u=s.toString().replace(String(a),"");return{unitless:!u,value:a,unit:u}}function px$1(s){if(s==null)return s;const{unitless:a}=analyzeCSSValue2(s);return a||typeof s=="number"?`${s}px`:s}var sortByBreakpointValue=(s,a)=>parseInt(s[1],10)>parseInt(a[1],10)?1:-1,sortBps=s=>Object.fromEntries(Object.entries(s).sort(sortByBreakpointValue));function normalize(s){const a=sortBps(s);return Object.assign(Object.values(a),a)}function keys(s){const a=Object.keys(sortBps(s));return new Set(a)}function subtract2(s){var a;if(!s)return s;s=(a=px$1(s))!=null?a:s;const u=-.02;return typeof s=="number"?`${s+u}`:s.replace(/(\d+\.?\d*)/u,l=>`${parseFloat(l)+u}`)}function toMediaQueryString(s,a){const u=["@media screen"];return s&&u.push("and",`(min-width: ${px$1(s)})`),a&&u.push("and",`(max-width: ${px$1(a)})`),u.join(" ")}function analyzeBreakpoints(s){var a;if(!s)return null;s.base=(a=s.base)!=null?a:"0px";const u=normalize(s),l=Object.entries(s).sort(sortByBreakpointValue).map(([h,p],v,y)=>{var b;let[,S]=(b=y[v+1])!=null?b:[];return S=parseFloat(S)>0?subtract2(S):void 0,{_minW:subtract2(p),breakpoint:h,minW:p,maxW:S,maxWQuery:toMediaQueryString(null,S),minWQuery:toMediaQueryString(p),minMaxQuery:toMediaQueryString(p,S)}}),f=keys(s),c=Array.from(f.values());return{keys:f,normalized:u,isResponsive(h){const p=Object.keys(h);return p.length>0&&p.every(v=>f.has(v))},asObject:sortBps(s),asArray:normalize(s),details:l,get(h){return l.find(p=>p.breakpoint===h)},media:[null,...u.map(h=>toMediaQueryString(h)).slice(1)],toArrayValue(h){if(!isObject$2(h))throw new Error("toArrayValue: value must be an object");const p=c.map(v=>{var y;return(y=h[v])!=null?y:null});for(;getLastItem(p)===null;)p.pop();return p},toObjectValue(h){if(!Array.isArray(h))throw new Error("toObjectValue: value must be an array");return h.reduce((p,v,y)=>{const b=c[y];return b!=null&&v!=null&&(p[b]=v),p},{})}}}var state$1={hover:(s,a)=>`${s}:hover ${a}, ${s}[data-hover] ${a}`,focus:(s,a)=>`${s}:focus ${a}, ${s}[data-focus] ${a}`,focusVisible:(s,a)=>`${s}:focus-visible ${a}`,focusWithin:(s,a)=>`${s}:focus-within ${a}`,active:(s,a)=>`${s}:active ${a}, ${s}[data-active] ${a}`,disabled:(s,a)=>`${s}:disabled ${a}, ${s}[data-disabled] ${a}`,invalid:(s,a)=>`${s}:invalid ${a}, ${s}[data-invalid] ${a}`,checked:(s,a)=>`${s}:checked ${a}, ${s}[data-checked] ${a}`,indeterminate:(s,a)=>`${s}:indeterminate ${a}, ${s}[aria-checked=mixed] ${a}, ${s}[data-indeterminate] ${a}`,readOnly:(s,a)=>`${s}:read-only ${a}, ${s}[readonly] ${a}, ${s}[data-read-only] ${a}`,expanded:(s,a)=>`${s}:read-only ${a}, ${s}[aria-expanded=true] ${a}, ${s}[data-expanded] ${a}`,placeholderShown:(s,a)=>`${s}:placeholder-shown ${a}`},toGroup=s=>merge(a=>s(a,"&"),"[role=group]","[data-group]",".group"),toPeer=s=>merge(a=>s(a,"~ &"),"[data-peer]",".peer"),merge=(s,...a)=>a.map(s).join(", "),pseudoSelectors={_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:toGroup(state$1.hover),_peerHover:toPeer(state$1.hover),_groupFocus:toGroup(state$1.focus),_peerFocus:toPeer(state$1.focus),_groupFocusVisible:toGroup(state$1.focusVisible),_peerFocusVisible:toPeer(state$1.focusVisible),_groupActive:toGroup(state$1.active),_peerActive:toPeer(state$1.active),_groupDisabled:toGroup(state$1.disabled),_peerDisabled:toPeer(state$1.disabled),_groupInvalid:toGroup(state$1.invalid),_peerInvalid:toPeer(state$1.invalid),_groupChecked:toGroup(state$1.checked),_peerChecked:toPeer(state$1.checked),_groupFocusWithin:toGroup(state$1.focusWithin),_peerFocusWithin:toPeer(state$1.focusWithin),_peerPlaceholderShown:toPeer(state$1.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]"},pseudoPropNames=Object.keys(pseudoSelectors);function tokenToCssVar(s,a){return cssVar$1(String(s).replace(/\./g,"-"),void 0,a)}function createThemeVars(s,a){let u={};const l={};for(const[f,c]of Object.entries(s)){const{isSemantic:h,value:p}=c,{variable:v,reference:y}=tokenToCssVar(f,a==null?void 0:a.cssVarPrefix);if(!h){if(f.startsWith("space")){const E=f.split("."),[R,...O]=E,I=`${R}.-${O.join(".")}`,B=calc$1.negate(p),N=calc$1.negate(y);l[I]={value:B,var:v,varRef:N}}u[v]=p,l[f]={value:p,var:v,varRef:y};continue}const b=E=>{const O=[String(f).split(".")[0],E].join(".");if(!s[O])return E;const{reference:B}=tokenToCssVar(O,a==null?void 0:a.cssVarPrefix);return B},S=isObject$2(p)?p:{default:p};u=mergeWith(u,Object.entries(S).reduce((E,[R,O])=>{var I,B;if(!O)return E;const N=b(`${O}`);if(R==="default")return E[v]=N,E;const D=(B=(I=pseudoSelectors)==null?void 0:I[R])!=null?B:R;return E[D]={[v]:N},E},{})),l[f]={value:y,var:v,varRef:y}}return{cssVars:u,cssMap:l}}function omit$2(s,a=[]){const u=Object.assign({},s);for(const l of a)l in u&&delete u[l];return u}function pick$1(s,a){const u={};for(const l of a)l in s&&(u[l]=s[l]);return u}function isObject5(s){return typeof s=="object"&&s!=null&&!Array.isArray(s)}function walkObject(s,a,u={}){const{stop:l,getKey:f}=u;function c(h,p=[]){var v;if(isObject5(h)||Array.isArray(h)){const y={};for(const[b,S]of Object.entries(h)){const E=(v=f==null?void 0:f(b))!=null?v:b,R=[...p,E];if(l!=null&&l(h,R))return a(h,p);y[E]=c(S,R)}return y}return a(h,p)}return c(s)}var tokens$1=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","gradients","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function extractTokens(s){return pick$1(s,tokens$1)}function extractSemanticTokens(s){return s.semanticTokens}function omitVars(s){const{__cssMap:a,__cssVars:u,__breakpoints:l,...f}=s;return f}var isSemanticCondition=s=>pseudoPropNames.includes(s)||s==="default";function flattenTokens({tokens:s,semanticTokens:a}){const u={};return walkObject(s,(l,f)=>{l!=null&&(u[f.join(".")]={isSemantic:!1,value:l})}),walkObject(a,(l,f)=>{l!=null&&(u[f.join(".")]={isSemantic:!0,value:l})},{stop:l=>Object.keys(l).every(isSemanticCondition)}),u}function toCSSVar(s){var a;const u=omitVars(s),l=extractTokens(u),f=extractSemanticTokens(u),c=flattenTokens({tokens:l,semanticTokens:f}),h=(a=u.config)==null?void 0:a.cssVarPrefix,{cssMap:p,cssVars:v}=createThemeVars(c,{cssVarPrefix:h});return Object.assign(u,{__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"},...v},__cssMap:p,__breakpoints:analyzeBreakpoints(u.breakpoints)}),u}var systemProps=mergeWith({},background,border,color$1,flexbox,layout$1,filter$2,ring,interactivity,grid,others,position,effect,space,scroll,typography$1,textDecoration,transform,list,transition$1);Object.assign({},space,layout$1,flexbox,grid,position);var propNames=[...Object.keys(systemProps),...pseudoPropNames],styleProps={...systemProps,...pseudoSelectors},isStyleProp=s=>s in styleProps,expandResponsive=s=>a=>{if(!a.__breakpoints)return s;const{isResponsive:u,toArrayValue:l,media:f}=a.__breakpoints,c={};for(const h in s){let p=runIfFn$2(s[h],a);if(p==null)continue;if(p=isObject$2(p)&&u(p)?l(p):p,!Array.isArray(p)){c[h]=p;continue}const v=p.slice(0,f.length).length;for(let y=0;y<v;y+=1){const b=f==null?void 0:f[y];if(!b){c[h]=p[y];continue}c[b]=c[b]||{},p[y]!=null&&(c[b][h]=p[y])}}return c};function splitByComma(s){const a=[];let u="",l=!1;for(let f=0;f<s.length;f++){const c=s[f];c==="("?(l=!0,u+=c):c===")"?(l=!1,u+=c):c===","&&!l?(a.push(u),u=""):u+=c}return u=u.trim(),u&&a.push(u),a}function isCssVar2(s){return/^var\(--.+\)$/.test(s)}var isCSSVariableTokenValue=(s,a)=>s.startsWith("--")&&typeof a=="string"&&!isCssVar2(a),resolveTokenValue=(s,a)=>{var u,l;if(a==null)return a;const f=v=>{var y,b;return(b=(y=s.__cssMap)==null?void 0:y[v])==null?void 0:b.varRef},c=v=>{var y;return(y=f(v))!=null?y:v},[h,p]=splitByComma(a);return a=(l=(u=f(h))!=null?u:c(p))!=null?l:c(a),a};function getCss(s){const{configs:a={},pseudos:u={},theme:l}=s,f=(c,h=!1)=>{var p,v,y;const b=runIfFn$2(c,l),S=expandResponsive(b)(l);let E={};for(let R in S){const O=S[R];let I=runIfFn$2(O,l);R in u&&(R=u[R]),isCSSVariableTokenValue(R,I)&&(I=resolveTokenValue(l,I));let B=a[R];if(B===!0&&(B={property:R}),isObject$2(I)){E[R]=(p=E[R])!=null?p:{},E[R]=mergeWith({},E[R],f(I,!0));continue}let N=(y=(v=B==null?void 0:B.transform)==null?void 0:v.call(B,I,l,b))!=null?y:I;N=B!=null&&B.processResult?f(N,!0):N;const D=runIfFn$2(B==null?void 0:B.property,l);if(!h&&(B!=null&&B.static)){const G=runIfFn$2(B.static,l);E=mergeWith({},E,G)}if(D&&Array.isArray(D)){for(const G of D)E[G]=N;continue}if(D){D==="&"&&isObject$2(N)?E=mergeWith({},E,N):E[D]=N;continue}if(isObject$2(N)){E=mergeWith({},E,N);continue}E[R]=N}return E};return f}var css=s=>a=>getCss({theme:a,pseudos:pseudoSelectors,configs:systemProps})(s);function defineStyle(s){return s}function defineStyleConfig(s){return s}function createMultiStyleConfigHelpers(s){return{definePartsStyle(a){return a},defineMultiStyleConfig(a){return{parts:s,...a}}}}function normalize2(s,a){if(Array.isArray(s))return s;if(isObject$2(s))return a(s);if(s!=null)return[s]}function getNextIndex$1(s,a){for(let u=a+1;u<s.length;u++)if(s[u]!=null)return u;return-1}function createResolver(s){const a=s.__breakpoints;return function(l,f,c,h){var p,v;if(!a)return;const y={},b=normalize2(c,a.toArrayValue);if(!b)return y;const S=b.length,E=S===1,R=!!l.parts;for(let O=0;O<S;O++){const I=a.details[O],B=a.details[getNextIndex$1(b,O)],N=toMediaQueryString(I.minW,B==null?void 0:B._minW),D=runIfFn$2((p=l[f])==null?void 0:p[b[O]],h);if(D){if(R){(v=l.parts)==null||v.forEach(G=>{mergeWith(y,{[G]:E?D[G]:{[N]:D[G]}})});continue}if(!R){E?mergeWith(y,D):y[N]=D;continue}y[N]=D}}return y}}function resolveStyleConfig(s){return a=>{var u;const{variant:l,size:f,theme:c}=a,h=createResolver(c);return mergeWith({},runIfFn$2((u=s.baseStyle)!=null?u:{},a),h(s,"sizes",f,a),h(s,"variants",l,a))}}function omitThemingProps(s){return omit$2(s,["styleConfig","size","variant","colorScheme"])}var requiredChakraThemeKeys=["borders","breakpoints","colors","components","config","direction","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","shadows","sizes","space","styles","transition","zIndices"];function isChakraTheme(s){return isObject$2(s)?requiredChakraThemeKeys.every(a=>Object.prototype.hasOwnProperty.call(s,a)):!1}var transitionProperty={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"},transitionTimingFunction={"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)"},transitionDuration={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},transition={property:transitionProperty,easing:transitionTimingFunction,duration:transitionDuration},transition_default=transition,zIndices={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},z_index_default=zIndices,borders$1={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},borders_default=borders$1,breakpoints={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},breakpoints_default=breakpoints,colors={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}},colors_default=colors,radii={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},radius_default=radii,shadows={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"},shadows_default=shadows,blur={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},blur_default=blur,typography={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"}},typography_default=typography,spacing={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"},largeSizes={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},container$1={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},sizes$n={...spacing,...largeSizes,container:container$1},sizes_default=sizes$n,foundations={breakpoints:breakpoints_default,zIndices:z_index_default,radii:radius_default,blur:blur_default,colors:colors_default,...typography_default,sizes:sizes_default,shadows:shadows_default,space:spacing,borders:borders_default,transition:transition_default},{defineMultiStyleConfig:defineMultiStyleConfig$p,definePartsStyle:definePartsStyle$p}=createMultiStyleConfigHelpers(["stepper","step","title","description","indicator","separator","icon","number"]),$size$4=cssVar$1("stepper-indicator-size"),$iconSize=cssVar$1("stepper-icon-size"),$titleFontSize=cssVar$1("stepper-title-font-size"),$descFontSize=cssVar$1("stepper-description-font-size"),$accentColor=cssVar$1("stepper-accent-color"),baseStyle$F=definePartsStyle$p(({colorScheme:s})=>({stepper:{display:"flex",justifyContent:"space-between",gap:"4","&[data-orientation=vertical]":{flexDirection:"column",alignItems:"flex-start"},"&[data-orientation=horizontal]":{flexDirection:"row",alignItems:"center"},[$accentColor.variable]:`colors.${s}.500`,_dark:{[$accentColor.variable]:`colors.${s}.200`}},title:{fontSize:$titleFontSize.reference,fontWeight:"medium"},description:{fontSize:$descFontSize.reference,color:"chakra-subtle-text"},number:{fontSize:$titleFontSize.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:$iconSize.reference,height:$iconSize.reference},indicator:{flexShrink:0,borderRadius:"full",width:$size$4.reference,height:$size$4.reference,display:"flex",justifyContent:"center",alignItems:"center","&[data-status=active]":{borderWidth:"2px",borderColor:$accentColor.reference},"&[data-status=complete]":{bg:$accentColor.reference,color:"chakra-inverse-text"},"&[data-status=incomplete]":{borderWidth:"2px"}},separator:{bg:"chakra-border-color",flex:"1","&[data-status=complete]":{bg:$accentColor.reference},"&[data-orientation=horizontal]":{width:"100%",height:"2px",marginStart:"2"},"&[data-orientation=vertical]":{width:"2px",position:"absolute",height:"100%",maxHeight:`calc(100% - ${$size$4.reference} - 8px)`,top:`calc(${$size$4.reference} + 4px)`,insetStart:`calc(${$size$4.reference} / 2 - 1px)`}}})),stepperTheme=defineMultiStyleConfig$p({baseStyle:baseStyle$F,sizes:{xs:definePartsStyle$p({stepper:{[$size$4.variable]:"sizes.4",[$iconSize.variable]:"sizes.3",[$titleFontSize.variable]:"fontSizes.xs",[$descFontSize.variable]:"fontSizes.xs"}}),sm:definePartsStyle$p({stepper:{[$size$4.variable]:"sizes.6",[$iconSize.variable]:"sizes.4",[$titleFontSize.variable]:"fontSizes.sm",[$descFontSize.variable]:"fontSizes.xs"}}),md:definePartsStyle$p({stepper:{[$size$4.variable]:"sizes.8",[$iconSize.variable]:"sizes.5",[$titleFontSize.variable]:"fontSizes.md",[$descFontSize.variable]:"fontSizes.sm"}}),lg:definePartsStyle$p({stepper:{[$size$4.variable]:"sizes.10",[$iconSize.variable]:"sizes.6",[$titleFontSize.variable]:"fontSizes.lg",[$descFontSize.variable]:"fontSizes.md"}})},defaultProps:{size:"md",colorScheme:"blue"}});function anatomy(s,a={}){let u=!1;function l(){if(!u){u=!0;return}throw new Error("[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?")}function f(...b){l();for(const S of b)a[S]=v(S);return anatomy(s,a)}function c(...b){for(const S of b)S in a||(a[S]=v(S));return anatomy(s,a)}function h(){return Object.fromEntries(Object.entries(a).map(([S,E])=>[S,E.selector]))}function p(){return Object.fromEntries(Object.entries(a).map(([S,E])=>[S,E.className]))}function v(b){const R=`chakra-${(["container","root"].includes(b??"")?[s]:[s,b]).filter(Boolean).join("__")}`;return{className:R,selector:`.${R}`,toString:()=>b}}return{parts:f,toPart:v,extend:c,selectors:h,classnames:p,get keys(){return Object.keys(a)},__type:{}}}var accordionAnatomy=anatomy("accordion").parts("root","container","button","panel").extend("icon"),alertAnatomy=anatomy("alert").parts("title","description","container").extend("icon","spinner"),avatarAnatomy=anatomy("avatar").parts("label","badge","container").extend("excessLabel","group"),breadcrumbAnatomy=anatomy("breadcrumb").parts("link","item","container").extend("separator");anatomy("button").parts();var checkboxAnatomy=anatomy("checkbox").parts("control","icon","container").extend("label");anatomy("progress").parts("track","filledTrack").extend("label");var drawerAnatomy=anatomy("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),editableAnatomy=anatomy("editable").parts("preview","input","textarea"),formAnatomy=anatomy("form").parts("container","requiredIndicator","helperText"),formErrorAnatomy=anatomy("formError").parts("text","icon"),inputAnatomy=anatomy("input").parts("addon","field","element","group"),listAnatomy=anatomy("list").parts("container","item","icon"),menuAnatomy=anatomy("menu").parts("button","list","item").extend("groupTitle","icon","command","divider"),modalAnatomy=anatomy("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),numberInputAnatomy=anatomy("numberinput").parts("root","field","stepperGroup","stepper");anatomy("pininput").parts("field");var popoverAnatomy=anatomy("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),progressAnatomy=anatomy("progress").parts("label","filledTrack","track"),radioAnatomy=anatomy("radio").parts("container","control","label"),selectAnatomy=anatomy("select").parts("field","icon"),sliderAnatomy=anatomy("slider").parts("container","track","thumb","filledTrack","mark"),statAnatomy=anatomy("stat").parts("container","label","helpText","number","icon"),switchAnatomy=anatomy("switch").parts("container","track","thumb","label"),tableAnatomy=anatomy("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),tabsAnatomy=anatomy("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),tagAnatomy=anatomy("tag").parts("container","label","closeButton"),cardAnatomy=anatomy("card").parts("container","header","body","footer");anatomy("stepper").parts("stepper","step","title","description","indicator","separator","icon","number");function guard(s,a,u){return Math.min(Math.max(s,u),a)}class ColorError extends Error{constructor(a){super(`Failed to parse color: "${a}"`)}}var ColorError$1=ColorError;function parseToRgba(s){if(typeof s!="string")throw new ColorError$1(s);if(s.trim().toLowerCase()==="transparent")return[0,0,0,0];let a=s.trim();a=namedColorRegex.test(s)?nameToHex(s):s;const u=reducedHexRegex.exec(a);if(u){const h=Array.from(u).slice(1);return[...h.slice(0,3).map(p=>parseInt(r$1(p,2),16)),parseInt(r$1(h[3]||"f",2),16)/255]}const l=hexRegex.exec(a);if(l){const h=Array.from(l).slice(1);return[...h.slice(0,3).map(p=>parseInt(p,16)),parseInt(h[3]||"ff",16)/255]}const f=rgbaRegex.exec(a);if(f){const h=Array.from(f).slice(1);return[...h.slice(0,3).map(p=>parseInt(p,10)),parseFloat(h[3]||"1")]}const c=hslaRegex.exec(a);if(c){const[h,p,v,y]=Array.from(c).slice(1).map(parseFloat);if(guard(0,100,p)!==p)throw new ColorError$1(s);if(guard(0,100,v)!==v)throw new ColorError$1(s);return[...hslToRgb(h,p,v),Number.isNaN(y)?1:y]}throw new ColorError$1(s)}function hash$4(s){let a=5381,u=s.length;for(;u;)a=a*33^s.charCodeAt(--u);return(a>>>0)%2341}const colorToInt=s=>parseInt(s.replace(/_/g,""),36),compressedColorMap="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((s,a)=>{const u=colorToInt(a.substring(0,3)),l=colorToInt(a.substring(3)).toString(16);let f="";for(let c=0;c<6-l.length;c++)f+="0";return s[u]=`${f}${l}`,s},{});function nameToHex(s){const a=s.toLowerCase().trim(),u=compressedColorMap[hash$4(a)];if(!u)throw new ColorError$1(s);return`#${u}`}const r$1=(s,a)=>Array.from(Array(a)).map(()=>s).join(""),reducedHexRegex=new RegExp(`^#${r$1("([a-f0-9])",3)}([a-f0-9])?$`,"i"),hexRegex=new RegExp(`^#${r$1("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),rgbaRegex=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${r$1(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),hslaRegex=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,namedColorRegex=/^[a-z]+$/i,roundColor=s=>Math.round(s*255),hslToRgb=(s,a,u)=>{let l=u/100;if(a===0)return[l,l,l].map(roundColor);const f=(s%360+360)%360/60,c=(1-Math.abs(2*l-1))*(a/100),h=c*(1-Math.abs(f%2-1));let p=0,v=0,y=0;f>=0&&f<1?(p=c,v=h):f>=1&&f<2?(p=h,v=c):f>=2&&f<3?(v=c,y=h):f>=3&&f<4?(v=h,y=c):f>=4&&f<5?(p=h,y=c):f>=5&&f<6&&(p=c,y=h);const b=l-c/2,S=p+b,E=v+b,R=y+b;return[S,E,R].map(roundColor)};function rgba$1(s,a,u,l){return`rgba(${guard(0,255,s).toFixed()}, ${guard(0,255,a).toFixed()}, ${guard(0,255,u).toFixed()}, ${parseFloat(guard(0,1,l).toFixed(3))})`}function transparentize$1(s,a){const[u,l,f,c]=parseToRgba(s);return rgba$1(u,l,f,c-a)}function toHex(s){const[a,u,l,f]=parseToRgba(s);let c=h=>{const p=guard(0,255,h).toString(16);return p.length===1?`0${p}`:p};return`#${c(a)}${c(u)}${c(l)}${f<1?c(Math.round(f*255)):""}`}function dlv_es_default(s,a,u,l,f){for(a=a.split?a.split("."):a,l=0;l<a.length;l++)s=s?s[a[l]]:f;return s===f?u:s}var isEmptyObject=s=>Object.keys(s).length===0,getColor=(s,a,u)=>{const l=dlv_es_default(s,`colors.${a}`,a);try{return toHex(l),l}catch{return u??"#000000"}},getBrightness=s=>{const[a,u,l]=parseToRgba(s);return(a*299+u*587+l*114)/1e3},tone=s=>a=>{const u=getColor(a,s);return getBrightness(u)<128?"dark":"light"},isDark=s=>a=>tone(s)(a)==="dark",transparentize=(s,a)=>u=>{const l=getColor(u,s);return transparentize$1(l,1-a)};function generateStripe(s="1rem",a="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient(
    45deg,
    ${a} 25%,
    transparent 25%,
    transparent 50%,
    ${a} 50%,
    ${a} 75%,
    transparent 75%,
    transparent
  )`,backgroundSize:`${s} ${s}`}}var randomHex=()=>`#${Math.floor(Math.random()*16777215).toString(16).padEnd(6,"0")}`;function randomColor(s){const a=randomHex();return!s||isEmptyObject(s)?a:s.string&&s.colors?randomColorFromList(s.string,s.colors):s.string&&!s.colors?randomColorFromString(s.string):s.colors&&!s.string?randomFromList(s.colors):a}function randomColorFromString(s){let a=0;if(s.length===0)return a.toString();for(let l=0;l<s.length;l+=1)a=s.charCodeAt(l)+((a<<5)-a),a=a&a;let u="#";for(let l=0;l<3;l+=1){const f=a>>l*8&255;u+=`00${f.toString(16)}`.substr(-2)}return u}function randomColorFromList(s,a){let u=0;if(s.length===0)return a[0];for(let l=0;l<s.length;l+=1)u=s.charCodeAt(l)+((u<<5)-u),u=u&u;return u=(u%a.length+a.length)%a.length,a[u]}function randomFromList(s){return s[Math.floor(Math.random()*s.length)]}function mode$1(s,a){return u=>u.colorMode==="dark"?a:s}function orient(s){const{orientation:a,vertical:u,horizontal:l}=s;return a?a==="vertical"?u:l:{}}function toRef(s){return isObject$2(s)&&s.reference?s.reference:String(s)}var toExpr=(s,...a)=>a.map(toRef).join(` ${s} `).replace(/calc/g,""),add=(...s)=>`calc(${toExpr("+",...s)})`,subtract=(...s)=>`calc(${toExpr("-",...s)})`,multiply=(...s)=>`calc(${toExpr("*",...s)})`,divide=(...s)=>`calc(${toExpr("/",...s)})`,negate=s=>{const a=toRef(s);return a!=null&&!Number.isNaN(parseFloat(a))?String(a).startsWith("-")?String(a).slice(1):`-${a}`:multiply(a,-1)},calc=Object.assign(s=>({add:(...a)=>calc(add(s,...a)),subtract:(...a)=>calc(subtract(s,...a)),multiply:(...a)=>calc(multiply(s,...a)),divide:(...a)=>calc(divide(s,...a)),negate:()=>calc(negate(s)),toString:()=>s.toString()}),{add,subtract,multiply,divide,negate});function isDecimal$1(s){return!Number.isInteger(parseFloat(s.toString()))}function replaceWhiteSpace(s,a="-"){return s.replace(/\s+/g,a)}function escape(s){const a=replaceWhiteSpace(s.toString());return a.includes("\\.")?s:isDecimal$1(s)?a.replace(".","\\."):s}function addPrefix(s,a=""){return[a,escape(s)].filter(Boolean).join("-")}function toVarRef(s,a){return`var(${escape(s)}${a?`, ${a}`:""})`}function toVar(s,a=""){return`--${addPrefix(s,a)}`}function cssVar(s,a){const u=toVar(s,void 0);return{variable:u,reference:toVarRef(u,getFallback(void 0))}}function getFallback(s){return typeof s=="string"?s:s==null?void 0:s.reference}var{defineMultiStyleConfig:defineMultiStyleConfig$o,definePartsStyle:definePartsStyle$o}=createMultiStyleConfigHelpers(switchAnatomy.keys),$width=cssVar("switch-track-width"),$height$1=cssVar("switch-track-height"),$diff=cssVar("switch-track-diff"),diffValue=calc.subtract($width,$height$1),$translateX=cssVar("switch-thumb-x"),$bg$f=cssVar("switch-bg"),baseStyleTrack$2=s=>{const{colorScheme:a}=s;return{borderRadius:"full",p:"0.5",width:[$width.reference],height:[$height$1.reference],transitionProperty:"common",transitionDuration:"fast",[$bg$f.variable]:"colors.gray.300",_dark:{[$bg$f.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[$bg$f.variable]:`colors.${a}.500`,_dark:{[$bg$f.variable]:`colors.${a}.200`}},bg:$bg$f.reference}},baseStyleThumb$1={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[$height$1.reference],height:[$height$1.reference],_checked:{transform:`translateX(${$translateX.reference})`}},baseStyle$E=definePartsStyle$o(s=>({container:{[$diff.variable]:diffValue,[$translateX.variable]:$diff.reference,_rtl:{[$translateX.variable]:calc($diff).negate().toString()}},track:baseStyleTrack$2(s),thumb:baseStyleThumb$1})),sizes$m={sm:definePartsStyle$o({container:{[$width.variable]:"1.375rem",[$height$1.variable]:"sizes.3"}}),md:definePartsStyle$o({container:{[$width.variable]:"1.875rem",[$height$1.variable]:"sizes.4"}}),lg:definePartsStyle$o({container:{[$width.variable]:"2.875rem",[$height$1.variable]:"sizes.6"}})},switchTheme=defineMultiStyleConfig$o({baseStyle:baseStyle$E,sizes:sizes$m,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:defineMultiStyleConfig$n,definePartsStyle:definePartsStyle$n}=createMultiStyleConfigHelpers(tableAnatomy.keys),baseStyle$D=definePartsStyle$n({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"}}),numericStyles={"&[data-is-numeric=true]":{textAlign:"end"}},variantSimple=definePartsStyle$n(s=>{const{colorScheme:a}=s;return{th:{color:mode$1("gray.600","gray.400")(s),borderBottom:"1px",borderColor:mode$1(`${a}.100`,`${a}.700`)(s),...numericStyles},td:{borderBottom:"1px",borderColor:mode$1(`${a}.100`,`${a}.700`)(s),...numericStyles},caption:{color:mode$1("gray.600","gray.100")(s)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),variantStripe=definePartsStyle$n(s=>{const{colorScheme:a}=s;return{th:{color:mode$1("gray.600","gray.400")(s),borderBottom:"1px",borderColor:mode$1(`${a}.100`,`${a}.700`)(s),...numericStyles},td:{borderBottom:"1px",borderColor:mode$1(`${a}.100`,`${a}.700`)(s),...numericStyles},caption:{color:mode$1("gray.600","gray.100")(s)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:mode$1(`${a}.100`,`${a}.700`)(s)},td:{background:mode$1(`${a}.100`,`${a}.700`)(s)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),variants$e={simple:variantSimple,striped:variantStripe,unstyled:{}},sizes$l={sm:definePartsStyle$n({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:definePartsStyle$n({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:definePartsStyle$n({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},tableTheme=defineMultiStyleConfig$n({baseStyle:baseStyle$D,variants:variants$e,sizes:sizes$l,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),$fg$5=cssVar$1("tabs-color"),$bg$e=cssVar$1("tabs-bg"),$border$3=cssVar$1("tabs-border-color"),{defineMultiStyleConfig:defineMultiStyleConfig$m,definePartsStyle:definePartsStyle$m}=createMultiStyleConfigHelpers(tabsAnatomy.keys),baseStyleRoot$1=s=>{const{orientation:a}=s;return{display:a==="vertical"?"flex":"block"}},baseStyleTab=s=>{const{isFitted:a}=s;return{flex:a?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},baseStyleTablist=s=>{const{align:a="start",orientation:u}=s;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[a],flexDirection:u==="vertical"?"column":"row"}},baseStyleTabpanel={p:4},baseStyle$C=definePartsStyle$m(s=>({root:baseStyleRoot$1(s),tab:baseStyleTab(s),tablist:baseStyleTablist(s),tabpanel:baseStyleTabpanel})),sizes$k={sm:definePartsStyle$m({tab:{py:1,px:4,fontSize:"sm"}}),md:definePartsStyle$m({tab:{fontSize:"md",py:2,px:4}}),lg:definePartsStyle$m({tab:{fontSize:"lg",py:3,px:4}})},variantLine=definePartsStyle$m(s=>{const{colorScheme:a,orientation:u}=s,l=u==="vertical",f=l?"borderStart":"borderBottom",c=l?"marginStart":"marginBottom";return{tablist:{[f]:"2px solid",borderColor:"inherit"},tab:{[f]:"2px solid",borderColor:"transparent",[c]:"-2px",_selected:{[$fg$5.variable]:`colors.${a}.600`,_dark:{[$fg$5.variable]:`colors.${a}.300`},borderColor:"currentColor"},_active:{[$bg$e.variable]:"colors.gray.200",_dark:{[$bg$e.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:$fg$5.reference,bg:$bg$e.reference}}}),variantEnclosed=definePartsStyle$m(s=>{const{colorScheme:a}=s;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[$border$3.variable]:"transparent",_selected:{[$fg$5.variable]:`colors.${a}.600`,[$border$3.variable]:"colors.white",_dark:{[$fg$5.variable]:`colors.${a}.300`,[$border$3.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:$border$3.reference},color:$fg$5.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),variantEnclosedColored=definePartsStyle$m(s=>{const{colorScheme:a}=s;return{tab:{border:"1px solid",borderColor:"inherit",[$bg$e.variable]:"colors.gray.50",_dark:{[$bg$e.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[$bg$e.variable]:"colors.white",[$fg$5.variable]:`colors.${a}.600`,_dark:{[$bg$e.variable]:"colors.gray.800",[$fg$5.variable]:`colors.${a}.300`},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:$fg$5.reference,bg:$bg$e.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),variantSoftRounded=definePartsStyle$m(s=>{const{colorScheme:a,theme:u}=s;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:getColor(u,`${a}.700`),bg:getColor(u,`${a}.100`)}}}}),variantSolidRounded=definePartsStyle$m(s=>{const{colorScheme:a}=s;return{tab:{borderRadius:"full",fontWeight:"semibold",[$fg$5.variable]:"colors.gray.600",_dark:{[$fg$5.variable]:"inherit"},_selected:{[$fg$5.variable]:"colors.white",[$bg$e.variable]:`colors.${a}.600`,_dark:{[$fg$5.variable]:"colors.gray.800",[$bg$e.variable]:`colors.${a}.300`}},color:$fg$5.reference,bg:$bg$e.reference}}}),variantUnstyled$2=definePartsStyle$m({}),variants$d={line:variantLine,enclosed:variantEnclosed,"enclosed-colored":variantEnclosedColored,"soft-rounded":variantSoftRounded,"solid-rounded":variantSolidRounded,unstyled:variantUnstyled$2},tabsTheme=defineMultiStyleConfig$m({baseStyle:baseStyle$C,sizes:sizes$k,variants:variants$d,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),vars=defineCssVars("badge",["bg","color","shadow"]),baseStyle$B={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold",bg:vars.bg.reference,color:vars.color.reference,boxShadow:vars.shadow.reference},variantSolid$3=s=>{const{colorScheme:a,theme:u}=s,l=transparentize(`${a}.500`,.6)(u);return{[vars.bg.variable]:`colors.${a}.500`,[vars.color.variable]:"colors.white",_dark:{[vars.bg.variable]:l,[vars.color.variable]:"colors.whiteAlpha.800"}}},variantSubtle$1=s=>{const{colorScheme:a,theme:u}=s,l=transparentize(`${a}.200`,.16)(u);return{[vars.bg.variable]:`colors.${a}.100`,[vars.color.variable]:`colors.${a}.800`,_dark:{[vars.bg.variable]:l,[vars.color.variable]:`colors.${a}.200`}}},variantOutline$2=s=>{const{colorScheme:a,theme:u}=s,l=transparentize(`${a}.200`,.8)(u);return{[vars.color.variable]:`colors.${a}.500`,_dark:{[vars.color.variable]:l},[vars.shadow.variable]:`inset 0 0 0px 1px ${vars.color.reference}`}},variants$c={solid:variantSolid$3,subtle:variantSubtle$1,outline:variantOutline$2},badgeTheme={baseStyle:baseStyle$B,variants:variants$c,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:defineMultiStyleConfig$l,definePartsStyle:definePartsStyle$l}=createMultiStyleConfigHelpers(tagAnatomy.keys),$bg$d=cssVar$1("tag-bg"),$color=cssVar$1("tag-color"),$shadow$3=cssVar$1("tag-shadow"),$minH=cssVar$1("tag-min-height"),$minW=cssVar$1("tag-min-width"),$fontSize$1=cssVar$1("tag-font-size"),$paddingX=cssVar$1("tag-padding-inline"),baseStyleContainer$4={fontWeight:"medium",lineHeight:1.2,outline:0,[$color.variable]:vars.color.reference,[$bg$d.variable]:vars.bg.reference,[$shadow$3.variable]:vars.shadow.reference,color:$color.reference,bg:$bg$d.reference,boxShadow:$shadow$3.reference,borderRadius:"md",minH:$minH.reference,minW:$minW.reference,fontSize:$fontSize$1.reference,px:$paddingX.reference,_focusVisible:{[$shadow$3.variable]:"shadows.outline"}},baseStyleLabel$4={lineHeight:1.2,overflow:"visible"},baseStyleCloseButton$3={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}},baseStyle$A=definePartsStyle$l({container:baseStyleContainer$4,label:baseStyleLabel$4,closeButton:baseStyleCloseButton$3}),sizes$j={sm:definePartsStyle$l({container:{[$minH.variable]:"sizes.5",[$minW.variable]:"sizes.5",[$fontSize$1.variable]:"fontSizes.xs",[$paddingX.variable]:"space.2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:definePartsStyle$l({container:{[$minH.variable]:"sizes.6",[$minW.variable]:"sizes.6",[$fontSize$1.variable]:"fontSizes.sm",[$paddingX.variable]:"space.2"}}),lg:definePartsStyle$l({container:{[$minH.variable]:"sizes.8",[$minW.variable]:"sizes.8",[$fontSize$1.variable]:"fontSizes.md",[$paddingX.variable]:"space.3"}})},variants$b={subtle:definePartsStyle$l(s=>{var a;return{container:(a=badgeTheme.variants)==null?void 0:a.subtle(s)}}),solid:definePartsStyle$l(s=>{var a;return{container:(a=badgeTheme.variants)==null?void 0:a.solid(s)}}),outline:definePartsStyle$l(s=>{var a;return{container:(a=badgeTheme.variants)==null?void 0:a.outline(s)}})},tagTheme=defineMultiStyleConfig$l({variants:variants$b,baseStyle:baseStyle$A,sizes:sizes$j,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}}),{definePartsStyle:definePartsStyle$k,defineMultiStyleConfig:defineMultiStyleConfig$k}=createMultiStyleConfigHelpers(inputAnatomy.keys),$height=cssVar$1("input-height"),$fontSize=cssVar$1("input-font-size"),$padding$1=cssVar$1("input-padding"),$borderRadius=cssVar$1("input-border-radius"),baseStyle$z=definePartsStyle$k({addon:{height:$height.reference,fontSize:$fontSize.reference,px:$padding$1.reference,borderRadius:$borderRadius.reference},field:{width:"100%",height:$height.reference,fontSize:$fontSize.reference,px:$padding$1.reference,borderRadius:$borderRadius.reference,minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),size={lg:{[$fontSize.variable]:"fontSizes.lg",[$padding$1.variable]:"space.4",[$borderRadius.variable]:"radii.md",[$height.variable]:"sizes.12"},md:{[$fontSize.variable]:"fontSizes.md",[$padding$1.variable]:"space.4",[$borderRadius.variable]:"radii.md",[$height.variable]:"sizes.10"},sm:{[$fontSize.variable]:"fontSizes.sm",[$padding$1.variable]:"space.3",[$borderRadius.variable]:"radii.sm",[$height.variable]:"sizes.8"},xs:{[$fontSize.variable]:"fontSizes.xs",[$padding$1.variable]:"space.2",[$borderRadius.variable]:"radii.sm",[$height.variable]:"sizes.6"}},sizes$i={lg:definePartsStyle$k({field:size.lg,group:size.lg}),md:definePartsStyle$k({field:size.md,group:size.md}),sm:definePartsStyle$k({field:size.sm,group:size.sm}),xs:definePartsStyle$k({field:size.xs,group:size.xs})};function getDefaults(s){const{focusBorderColor:a,errorBorderColor:u}=s;return{focusBorderColor:a||mode$1("blue.500","blue.300")(s),errorBorderColor:u||mode$1("red.500","red.300")(s)}}var variantOutline$1=definePartsStyle$k(s=>{const{theme:a}=s,{focusBorderColor:u,errorBorderColor:l}=getDefaults(s);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:mode$1("gray.300","whiteAlpha.400")(s)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:getColor(a,l),boxShadow:`0 0 0 1px ${getColor(a,l)}`},_focusVisible:{zIndex:1,borderColor:getColor(a,u),boxShadow:`0 0 0 1px ${getColor(a,u)}`}},addon:{border:"1px solid",borderColor:mode$1("inherit","whiteAlpha.50")(s),bg:mode$1("gray.100","whiteAlpha.300")(s)}}}),variantFilled=definePartsStyle$k(s=>{const{theme:a}=s,{focusBorderColor:u,errorBorderColor:l}=getDefaults(s);return{field:{border:"2px solid",borderColor:"transparent",bg:mode$1("gray.100","whiteAlpha.50")(s),_hover:{bg:mode$1("gray.200","whiteAlpha.100")(s)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:getColor(a,l)},_focusVisible:{bg:"transparent",borderColor:getColor(a,u)}},addon:{border:"2px solid",borderColor:"transparent",bg:mode$1("gray.100","whiteAlpha.50")(s)}}}),variantFlushed=definePartsStyle$k(s=>{const{theme:a}=s,{focusBorderColor:u,errorBorderColor:l}=getDefaults(s);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:getColor(a,l),boxShadow:`0px 1px 0px 0px ${getColor(a,l)}`},_focusVisible:{borderColor:getColor(a,u),boxShadow:`0px 1px 0px 0px ${getColor(a,u)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),variantUnstyled$1=definePartsStyle$k({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),variants$a={outline:variantOutline$1,filled:variantFilled,flushed:variantFlushed,unstyled:variantUnstyled$1},inputTheme=defineMultiStyleConfig$k({baseStyle:baseStyle$z,sizes:sizes$i,variants:variants$a,defaultProps:{size:"md",variant:"outline"}}),_a$8,baseStyle$y={...(_a$8=inputTheme.baseStyle)==null?void 0:_a$8.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"},_a2$2,_b$2,variants$9={outline:s=>{var a,u;return(u=(a=inputTheme.variants)==null?void 0:a.outline(s).field)!=null?u:{}},flushed:s=>{var a,u;return(u=(a=inputTheme.variants)==null?void 0:a.flushed(s).field)!=null?u:{}},filled:s=>{var a,u;return(u=(a=inputTheme.variants)==null?void 0:a.filled(s).field)!=null?u:{}},unstyled:(_b$2=(_a2$2=inputTheme.variants)==null?void 0:_a2$2.unstyled.field)!=null?_b$2:{}},_a3,_b2,_c$1,_d$1,_e$1,_f$1,_g$1,_h$1,sizes$h={xs:(_b2=(_a3=inputTheme.sizes)==null?void 0:_a3.xs.field)!=null?_b2:{},sm:(_d$1=(_c$1=inputTheme.sizes)==null?void 0:_c$1.sm.field)!=null?_d$1:{},md:(_f$1=(_e$1=inputTheme.sizes)==null?void 0:_e$1.md.field)!=null?_f$1:{},lg:(_h$1=(_g$1=inputTheme.sizes)==null?void 0:_g$1.lg.field)!=null?_h$1:{}},textareaTheme={baseStyle:baseStyle$y,sizes:sizes$h,variants:variants$9,defaultProps:{size:"md",variant:"outline"}},$bg$c=cssVar("tooltip-bg"),$fg$4=cssVar("tooltip-fg"),$arrowBg$1=cssVar("popper-arrow-bg"),baseStyle$x={bg:$bg$c.reference,color:$fg$4.reference,[$bg$c.variable]:"colors.gray.700",[$fg$4.variable]:"colors.whiteAlpha.900",_dark:{[$bg$c.variable]:"colors.gray.300",[$fg$4.variable]:"colors.gray.900"},[$arrowBg$1.variable]:$bg$c.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},tooltipTheme={baseStyle:baseStyle$x},{defineMultiStyleConfig:defineMultiStyleConfig$j,definePartsStyle:definePartsStyle$j}=createMultiStyleConfigHelpers(progressAnatomy.keys),filledStyle=s=>{const{colorScheme:a,theme:u,isIndeterminate:l,hasStripe:f}=s,c=mode$1(generateStripe(),generateStripe("1rem","rgba(0,0,0,0.1)"))(s),h=mode$1(`${a}.500`,`${a}.200`)(s),p=`linear-gradient(
    to right,
    transparent 0%,
    ${getColor(u,h)} 50%,
    transparent 100%
  )`;return{...!l&&f&&c,...l?{bgImage:p}:{bgColor:h}}},baseStyleLabel$3={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},baseStyleTrack$1=s=>({bg:mode$1("gray.100","whiteAlpha.300")(s)}),baseStyleFilledTrack$1=s=>({transitionProperty:"common",transitionDuration:"slow",...filledStyle(s)}),baseStyle$w=definePartsStyle$j(s=>({label:baseStyleLabel$3,filledTrack:baseStyleFilledTrack$1(s),track:baseStyleTrack$1(s)})),sizes$g={xs:definePartsStyle$j({track:{h:"1"}}),sm:definePartsStyle$j({track:{h:"2"}}),md:definePartsStyle$j({track:{h:"3"}}),lg:definePartsStyle$j({track:{h:"4"}})},progressTheme=defineMultiStyleConfig$j({sizes:sizes$g,baseStyle:baseStyle$w,defaultProps:{size:"md",colorScheme:"blue"}}),isFunction$4=s=>typeof s=="function";function runIfFn$1(s,...a){return isFunction$4(s)?s(...a):s}var{definePartsStyle:definePartsStyle$i,defineMultiStyleConfig:defineMultiStyleConfig$i}=createMultiStyleConfigHelpers(checkboxAnatomy.keys),$size$3=cssVar$1("checkbox-size"),baseStyleControl$1=s=>{const{colorScheme:a}=s;return{w:$size$3.reference,h:$size$3.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:mode$1(`${a}.500`,`${a}.200`)(s),borderColor:mode$1(`${a}.500`,`${a}.200`)(s),color:mode$1("white","gray.900")(s),_hover:{bg:mode$1(`${a}.600`,`${a}.300`)(s),borderColor:mode$1(`${a}.600`,`${a}.300`)(s)},_disabled:{borderColor:mode$1("gray.200","transparent")(s),bg:mode$1("gray.200","whiteAlpha.300")(s),color:mode$1("gray.500","whiteAlpha.500")(s)}},_indeterminate:{bg:mode$1(`${a}.500`,`${a}.200`)(s),borderColor:mode$1(`${a}.500`,`${a}.200`)(s),color:mode$1("white","gray.900")(s)},_disabled:{bg:mode$1("gray.100","whiteAlpha.100")(s),borderColor:mode$1("gray.100","transparent")(s)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:mode$1("red.500","red.300")(s)}}},baseStyleContainer$3={_disabled:{cursor:"not-allowed"}},baseStyleLabel$2={userSelect:"none",_disabled:{opacity:.4}},baseStyleIcon$6={transitionProperty:"transform",transitionDuration:"normal"},baseStyle$v=definePartsStyle$i(s=>({icon:baseStyleIcon$6,container:baseStyleContainer$3,control:runIfFn$1(baseStyleControl$1,s),label:baseStyleLabel$2})),sizes$f={sm:definePartsStyle$i({control:{[$size$3.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:definePartsStyle$i({control:{[$size$3.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:definePartsStyle$i({control:{[$size$3.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},checkboxTheme=defineMultiStyleConfig$i({baseStyle:baseStyle$v,sizes:sizes$f,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:defineMultiStyleConfig$h,definePartsStyle:definePartsStyle$h}=createMultiStyleConfigHelpers(radioAnatomy.keys),baseStyleControl=s=>{var a;const u=(a=runIfFn$1(checkboxTheme.baseStyle,s))==null?void 0:a.control;return{...u,borderRadius:"full",_checked:{...u==null?void 0:u._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},baseStyle$u=definePartsStyle$h(s=>{var a,u,l,f;return{label:(u=(a=checkboxTheme).baseStyle)==null?void 0:u.call(a,s).label,container:(f=(l=checkboxTheme).baseStyle)==null?void 0:f.call(l,s).container,control:baseStyleControl(s)}}),sizes$e={md:definePartsStyle$h({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:definePartsStyle$h({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:definePartsStyle$h({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},radioTheme=defineMultiStyleConfig$h({baseStyle:baseStyle$u,sizes:sizes$e,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:defineMultiStyleConfig$g,definePartsStyle:definePartsStyle$g}=createMultiStyleConfigHelpers(selectAnatomy.keys),$bg$b=cssVar$1("select-bg"),_a$7,baseStyleField$1={...(_a$7=inputTheme.baseStyle)==null?void 0:_a$7.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:$bg$b.reference,[$bg$b.variable]:"colors.white",_dark:{[$bg$b.variable]:"colors.gray.700"},"> option, > optgroup":{bg:$bg$b.reference}},baseStyleIcon$5={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},baseStyle$t=definePartsStyle$g({field:baseStyleField$1,icon:baseStyleIcon$5}),iconSpacing={paddingInlineEnd:"8"},_a2$1,_b$1,_c,_d,_e,_f,_g,_h,sizes$d={lg:{...(_a2$1=inputTheme.sizes)==null?void 0:_a2$1.lg,field:{...(_b$1=inputTheme.sizes)==null?void 0:_b$1.lg.field,...iconSpacing}},md:{...(_c=inputTheme.sizes)==null?void 0:_c.md,field:{...(_d=inputTheme.sizes)==null?void 0:_d.md.field,...iconSpacing}},sm:{...(_e=inputTheme.sizes)==null?void 0:_e.sm,field:{...(_f=inputTheme.sizes)==null?void 0:_f.sm.field,...iconSpacing}},xs:{...(_g=inputTheme.sizes)==null?void 0:_g.xs,field:{...(_h=inputTheme.sizes)==null?void 0:_h.xs.field,...iconSpacing},icon:{insetEnd:"1"}}},selectTheme=defineMultiStyleConfig$g({baseStyle:baseStyle$t,sizes:sizes$d,variants:inputTheme.variants,defaultProps:inputTheme.defaultProps}),$startColor=cssVar$1("skeleton-start-color"),$endColor=cssVar$1("skeleton-end-color"),baseStyle$s={[$startColor.variable]:"colors.gray.100",[$endColor.variable]:"colors.gray.400",_dark:{[$startColor.variable]:"colors.gray.800",[$endColor.variable]:"colors.gray.600"},background:$startColor.reference,borderColor:$endColor.reference,opacity:.7,borderRadius:"sm"},skeletonTheme={baseStyle:baseStyle$s},$bg$a=cssVar$1("skip-link-bg"),baseStyle$r={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[$bg$a.variable]:"colors.white",_dark:{[$bg$a.variable]:"colors.gray.700"},bg:$bg$a.reference}},skipLinkTheme={baseStyle:baseStyle$r},{defineMultiStyleConfig:defineMultiStyleConfig$f,definePartsStyle:definePartsStyle$f}=createMultiStyleConfigHelpers(sliderAnatomy.keys),$thumbSize=cssVar$1("slider-thumb-size"),$trackSize=cssVar$1("slider-track-size"),$bg$9=cssVar$1("slider-bg"),baseStyleContainer$2=s=>{const{orientation:a}=s;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...orient({orientation:a,vertical:{h:"100%"},horizontal:{w:"100%"}})}},baseStyleTrack=s=>({...orient({orientation:s.orientation,horizontal:{h:$trackSize.reference},vertical:{w:$trackSize.reference}}),overflow:"hidden",borderRadius:"sm",[$bg$9.variable]:"colors.gray.200",_dark:{[$bg$9.variable]:"colors.whiteAlpha.200"},_disabled:{[$bg$9.variable]:"colors.gray.300",_dark:{[$bg$9.variable]:"colors.whiteAlpha.300"}},bg:$bg$9.reference}),baseStyleThumb=s=>{const{orientation:a}=s;return{...orient({orientation:a,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:$thumbSize.reference,h:$thumbSize.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"}}},baseStyleFilledTrack=s=>{const{colorScheme:a}=s;return{width:"inherit",height:"inherit",[$bg$9.variable]:`colors.${a}.500`,_dark:{[$bg$9.variable]:`colors.${a}.200`},bg:$bg$9.reference}},baseStyle$q=definePartsStyle$f(s=>({container:baseStyleContainer$2(s),track:baseStyleTrack(s),thumb:baseStyleThumb(s),filledTrack:baseStyleFilledTrack(s)})),sizeLg=definePartsStyle$f({container:{[$thumbSize.variable]:"sizes.4",[$trackSize.variable]:"sizes.1"}}),sizeMd=definePartsStyle$f({container:{[$thumbSize.variable]:"sizes.3.5",[$trackSize.variable]:"sizes.1"}}),sizeSm=definePartsStyle$f({container:{[$thumbSize.variable]:"sizes.2.5",[$trackSize.variable]:"sizes.0.5"}}),sizes$c={lg:sizeLg,md:sizeMd,sm:sizeSm},sliderTheme=defineMultiStyleConfig$f({baseStyle:baseStyle$q,sizes:sizes$c,defaultProps:{size:"md",colorScheme:"blue"}}),$size$2=cssVar("spinner-size"),baseStyle$p={width:[$size$2.reference],height:[$size$2.reference]},sizes$b={xs:{[$size$2.variable]:"sizes.3"},sm:{[$size$2.variable]:"sizes.4"},md:{[$size$2.variable]:"sizes.6"},lg:{[$size$2.variable]:"sizes.8"},xl:{[$size$2.variable]:"sizes.12"}},spinnerTheme={baseStyle:baseStyle$p,sizes:sizes$b,defaultProps:{size:"md"}},{defineMultiStyleConfig:defineMultiStyleConfig$e,definePartsStyle:definePartsStyle$e}=createMultiStyleConfigHelpers(statAnatomy.keys),baseStyleLabel$1={fontWeight:"medium"},baseStyleHelpText={opacity:.8,marginBottom:"2"},baseStyleNumber={verticalAlign:"baseline",fontWeight:"semibold"},baseStyleIcon$4={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},baseStyle$o=definePartsStyle$e({container:{},label:baseStyleLabel$1,helpText:baseStyleHelpText,number:baseStyleNumber,icon:baseStyleIcon$4}),sizes$a={md:definePartsStyle$e({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},statTheme=defineMultiStyleConfig$e({baseStyle:baseStyle$o,sizes:sizes$a,defaultProps:{size:"md"}}),$bg$8=cssVar$1("kbd-bg"),baseStyle$n={[$bg$8.variable]:"colors.gray.100",_dark:{[$bg$8.variable]:"colors.whiteAlpha.100"},bg:$bg$8.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},kbdTheme={baseStyle:baseStyle$n},baseStyle$m={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},linkTheme={baseStyle:baseStyle$m},{defineMultiStyleConfig:defineMultiStyleConfig$d,definePartsStyle:definePartsStyle$d}=createMultiStyleConfigHelpers(listAnatomy.keys),baseStyleIcon$3={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},baseStyle$l=definePartsStyle$d({icon:baseStyleIcon$3}),listTheme=defineMultiStyleConfig$d({baseStyle:baseStyle$l}),{defineMultiStyleConfig:defineMultiStyleConfig$c,definePartsStyle:definePartsStyle$c}=createMultiStyleConfigHelpers(menuAnatomy.keys),$bg$7=cssVar$1("menu-bg"),$shadow$2=cssVar$1("menu-shadow"),baseStyleList={[$bg$7.variable]:"#fff",[$shadow$2.variable]:"shadows.sm",_dark:{[$bg$7.variable]:"colors.gray.700",[$shadow$2.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px",bg:$bg$7.reference,boxShadow:$shadow$2.reference},baseStyleItem={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[$bg$7.variable]:"colors.gray.100",_dark:{[$bg$7.variable]:"colors.whiteAlpha.100"}},_active:{[$bg$7.variable]:"colors.gray.200",_dark:{[$bg$7.variable]:"colors.whiteAlpha.200"}},_expanded:{[$bg$7.variable]:"colors.gray.100",_dark:{[$bg$7.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:$bg$7.reference},baseStyleGroupTitle={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},baseStyleIcon$2={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},baseStyleCommand={opacity:.6},baseStyleDivider={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},baseStyleButton$1={transitionProperty:"common",transitionDuration:"normal"},baseStyle$k=definePartsStyle$c({button:baseStyleButton$1,list:baseStyleList,item:baseStyleItem,groupTitle:baseStyleGroupTitle,icon:baseStyleIcon$2,command:baseStyleCommand,divider:baseStyleDivider}),menuTheme=defineMultiStyleConfig$c({baseStyle:baseStyle$k}),{defineMultiStyleConfig:defineMultiStyleConfig$b,definePartsStyle:definePartsStyle$b}=createMultiStyleConfigHelpers(modalAnatomy.keys),$bg$6=cssVar$1("modal-bg"),$shadow$1=cssVar$1("modal-shadow"),baseStyleOverlay$1={bg:"blackAlpha.600",zIndex:"modal"},baseStyleDialogContainer$1=s=>{const{isCentered:a,scrollBehavior:u}=s;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:a?"center":"flex-start",overflow:u==="inside"?"hidden":"auto",overscrollBehaviorY:"none"}},baseStyleDialog$1=s=>{const{isCentered:a,scrollBehavior:u}=s;return{borderRadius:"md",color:"inherit",my:a?"auto":"16",mx:a?"auto":void 0,zIndex:"modal",maxH:u==="inside"?"calc(100% - 7.5rem)":void 0,[$bg$6.variable]:"colors.white",[$shadow$1.variable]:"shadows.lg",_dark:{[$bg$6.variable]:"colors.gray.700",[$shadow$1.variable]:"shadows.dark-lg"},bg:$bg$6.reference,boxShadow:$shadow$1.reference}},baseStyleHeader$2={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},baseStyleCloseButton$2={position:"absolute",top:"2",insetEnd:"3"},baseStyleBody$2=s=>{const{scrollBehavior:a}=s;return{px:"6",py:"2",flex:"1",overflow:a==="inside"?"auto":void 0}},baseStyleFooter$2={px:"6",py:"4"},baseStyle$j=definePartsStyle$b(s=>({overlay:baseStyleOverlay$1,dialogContainer:runIfFn$1(baseStyleDialogContainer$1,s),dialog:runIfFn$1(baseStyleDialog$1,s),header:baseStyleHeader$2,closeButton:baseStyleCloseButton$2,body:runIfFn$1(baseStyleBody$2,s),footer:baseStyleFooter$2}));function getSize$3(s){return definePartsStyle$b(s==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:s}})}var sizes$9={xs:getSize$3("xs"),sm:getSize$3("sm"),md:getSize$3("md"),lg:getSize$3("lg"),xl:getSize$3("xl"),"2xl":getSize$3("2xl"),"3xl":getSize$3("3xl"),"4xl":getSize$3("4xl"),"5xl":getSize$3("5xl"),"6xl":getSize$3("6xl"),full:getSize$3("full")},modalTheme=defineMultiStyleConfig$b({baseStyle:baseStyle$j,sizes:sizes$9,defaultProps:{size:"md"}}),{defineMultiStyleConfig:defineMultiStyleConfig$a,definePartsStyle:definePartsStyle$a}=createMultiStyleConfigHelpers(numberInputAnatomy.keys),$stepperWidth=cssVar("number-input-stepper-width"),$inputPadding=cssVar("number-input-input-padding"),inputPaddingValue=calc($stepperWidth).add("0.5rem").toString(),$bg$5=cssVar("number-input-bg"),$fg$3=cssVar("number-input-color"),$border$2=cssVar("number-input-border-color"),baseStyleRoot={[$stepperWidth.variable]:"sizes.6",[$inputPadding.variable]:inputPaddingValue},baseStyleField=s=>{var a,u;return(u=(a=runIfFn$1(inputTheme.baseStyle,s))==null?void 0:a.field)!=null?u:{}},baseStyleStepperGroup={width:$stepperWidth.reference},baseStyleStepper={borderStart:"1px solid",borderStartColor:$border$2.reference,color:$fg$3.reference,bg:$bg$5.reference,[$fg$3.variable]:"colors.chakra-body-text",[$border$2.variable]:"colors.chakra-border-color",_dark:{[$fg$3.variable]:"colors.whiteAlpha.800",[$border$2.variable]:"colors.whiteAlpha.300"},_active:{[$bg$5.variable]:"colors.gray.200",_dark:{[$bg$5.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},baseStyle$i=definePartsStyle$a(s=>{var a;return{root:baseStyleRoot,field:(a=runIfFn$1(baseStyleField,s))!=null?a:{},stepperGroup:baseStyleStepperGroup,stepper:baseStyleStepper}});function getSize$2(s){var a,u,l;const f=(a=inputTheme.sizes)==null?void 0:a[s],c={lg:"md",md:"md",sm:"sm",xs:"sm"},h=(l=(u=f.field)==null?void 0:u.fontSize)!=null?l:"md",p=typography_default.fontSizes[h];return definePartsStyle$a({field:{...f.field,paddingInlineEnd:$inputPadding.reference,verticalAlign:"top"},stepper:{fontSize:calc(p).multiply(.75).toString(),_first:{borderTopEndRadius:c[s]},_last:{borderBottomEndRadius:c[s],mt:"-1px",borderTopWidth:1}}})}var sizes$8={xs:getSize$2("xs"),sm:getSize$2("sm"),md:getSize$2("md"),lg:getSize$2("lg")},numberInputTheme=defineMultiStyleConfig$a({baseStyle:baseStyle$i,sizes:sizes$8,variants:inputTheme.variants,defaultProps:inputTheme.defaultProps}),_a$6,baseStyle$h={...(_a$6=inputTheme.baseStyle)==null?void 0:_a$6.field,textAlign:"center"},sizes$7={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"}},_a2,_b,variants$8={outline:s=>{var a,u,l;return(l=(u=runIfFn$1((a=inputTheme.variants)==null?void 0:a.outline,s))==null?void 0:u.field)!=null?l:{}},flushed:s=>{var a,u,l;return(l=(u=runIfFn$1((a=inputTheme.variants)==null?void 0:a.flushed,s))==null?void 0:u.field)!=null?l:{}},filled:s=>{var a,u,l;return(l=(u=runIfFn$1((a=inputTheme.variants)==null?void 0:a.filled,s))==null?void 0:u.field)!=null?l:{}},unstyled:(_b=(_a2=inputTheme.variants)==null?void 0:_a2.unstyled.field)!=null?_b:{}},pinInputTheme={baseStyle:baseStyle$h,sizes:sizes$7,variants:variants$8,defaultProps:inputTheme.defaultProps},{defineMultiStyleConfig:defineMultiStyleConfig$9,definePartsStyle:definePartsStyle$9}=createMultiStyleConfigHelpers(popoverAnatomy.keys),$popperBg=cssVar("popper-bg"),$arrowBg=cssVar("popper-arrow-bg"),$arrowShadowColor=cssVar("popper-arrow-shadow-color"),baseStylePopper={zIndex:10},baseStyleContent={[$popperBg.variable]:"colors.white",bg:$popperBg.reference,[$arrowBg.variable]:$popperBg.reference,[$arrowShadowColor.variable]:"colors.gray.200",_dark:{[$popperBg.variable]:"colors.gray.700",[$arrowShadowColor.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},baseStyleHeader$1={px:3,py:2,borderBottomWidth:"1px"},baseStyleBody$1={px:3,py:2},baseStyleFooter$1={px:3,py:2,borderTopWidth:"1px"},baseStyleCloseButton$1={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},baseStyle$g=definePartsStyle$9({popper:baseStylePopper,content:baseStyleContent,header:baseStyleHeader$1,body:baseStyleBody$1,footer:baseStyleFooter$1,closeButton:baseStyleCloseButton$1}),popoverTheme=defineMultiStyleConfig$9({baseStyle:baseStyle$g}),{definePartsStyle:definePartsStyle$8,defineMultiStyleConfig:defineMultiStyleConfig$8}=createMultiStyleConfigHelpers(drawerAnatomy.keys),$bg$4=cssVar$1("drawer-bg"),$bs=cssVar$1("drawer-box-shadow");function getSize$1(s){return definePartsStyle$8(s==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:s}})}var baseStyleOverlay={bg:"blackAlpha.600",zIndex:"modal"},baseStyleDialogContainer={display:"flex",zIndex:"modal",justifyContent:"center"},baseStyleDialog=s=>{const{isFullHeight:a}=s;return{...a&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[$bg$4.variable]:"colors.white",[$bs.variable]:"shadows.lg",_dark:{[$bg$4.variable]:"colors.gray.700",[$bs.variable]:"shadows.dark-lg"},bg:$bg$4.reference,boxShadow:$bs.reference}},baseStyleHeader={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},baseStyleCloseButton={position:"absolute",top:"2",insetEnd:"3"},baseStyleBody={px:"6",py:"2",flex:"1",overflow:"auto"},baseStyleFooter={px:"6",py:"4"},baseStyle$f=definePartsStyle$8(s=>({overlay:baseStyleOverlay,dialogContainer:baseStyleDialogContainer,dialog:runIfFn$1(baseStyleDialog,s),header:baseStyleHeader,closeButton:baseStyleCloseButton,body:baseStyleBody,footer:baseStyleFooter})),sizes$6={xs:getSize$1("xs"),sm:getSize$1("md"),md:getSize$1("lg"),lg:getSize$1("2xl"),xl:getSize$1("4xl"),full:getSize$1("full")},drawerTheme=defineMultiStyleConfig$8({baseStyle:baseStyle$f,sizes:sizes$6,defaultProps:{size:"xs"}}),{definePartsStyle:definePartsStyle$7,defineMultiStyleConfig:defineMultiStyleConfig$7}=createMultiStyleConfigHelpers(editableAnatomy.keys),baseStylePreview={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},baseStyleInput={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},baseStyleTextarea={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},baseStyle$e=definePartsStyle$7({preview:baseStylePreview,input:baseStyleInput,textarea:baseStyleTextarea}),editableTheme=defineMultiStyleConfig$7({baseStyle:baseStyle$e}),{definePartsStyle:definePartsStyle$6,defineMultiStyleConfig:defineMultiStyleConfig$6}=createMultiStyleConfigHelpers(formAnatomy.keys),$fg$2=cssVar$1("form-control-color"),baseStyleRequiredIndicator={marginStart:"1",[$fg$2.variable]:"colors.red.500",_dark:{[$fg$2.variable]:"colors.red.300"},color:$fg$2.reference},baseStyleHelperText={mt:"2",[$fg$2.variable]:"colors.gray.600",_dark:{[$fg$2.variable]:"colors.whiteAlpha.600"},color:$fg$2.reference,lineHeight:"normal",fontSize:"sm"},baseStyle$d=definePartsStyle$6({container:{width:"100%",position:"relative"},requiredIndicator:baseStyleRequiredIndicator,helperText:baseStyleHelperText}),formTheme=defineMultiStyleConfig$6({baseStyle:baseStyle$d}),{definePartsStyle:definePartsStyle$5,defineMultiStyleConfig:defineMultiStyleConfig$5}=createMultiStyleConfigHelpers(formErrorAnatomy.keys),$fg$1=cssVar$1("form-error-color"),baseStyleText={[$fg$1.variable]:"colors.red.500",_dark:{[$fg$1.variable]:"colors.red.300"},color:$fg$1.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},baseStyleIcon$1={marginEnd:"0.5em",[$fg$1.variable]:"colors.red.500",_dark:{[$fg$1.variable]:"colors.red.300"},color:$fg$1.reference},baseStyle$c=definePartsStyle$5({text:baseStyleText,icon:baseStyleIcon$1}),formErrorTheme=defineMultiStyleConfig$5({baseStyle:baseStyle$c}),baseStyle$b={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},formLabelTheme={baseStyle:baseStyle$b},baseStyle$a={fontFamily:"heading",fontWeight:"bold"},sizes$5={"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}},headingTheme={baseStyle:baseStyle$a,sizes:sizes$5,defaultProps:{size:"xl"}},{defineMultiStyleConfig:defineMultiStyleConfig$4,definePartsStyle:definePartsStyle$4}=createMultiStyleConfigHelpers(breadcrumbAnatomy.keys),$decor=cssVar$1("breadcrumb-link-decor"),baseStyleLink={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",outline:"none",color:"inherit",textDecoration:$decor.reference,[$decor.variable]:"none","&:not([aria-current=page])":{cursor:"pointer",_hover:{[$decor.variable]:"underline"},_focusVisible:{boxShadow:"outline"}}},baseStyle$9=definePartsStyle$4({link:baseStyleLink}),breadcrumbTheme=defineMultiStyleConfig$4({baseStyle:baseStyle$9}),baseStyle$8={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"}}},variantGhost=s=>{const{colorScheme:a,theme:u}=s;if(a==="gray")return{color:mode$1("gray.800","whiteAlpha.900")(s),_hover:{bg:mode$1("gray.100","whiteAlpha.200")(s)},_active:{bg:mode$1("gray.200","whiteAlpha.300")(s)}};const l=transparentize(`${a}.200`,.12)(u),f=transparentize(`${a}.200`,.24)(u);return{color:mode$1(`${a}.600`,`${a}.200`)(s),bg:"transparent",_hover:{bg:mode$1(`${a}.50`,l)(s)},_active:{bg:mode$1(`${a}.100`,f)(s)}}},variantOutline=s=>{const{colorScheme:a}=s,u=mode$1("gray.200","whiteAlpha.300")(s);return{border:"1px solid",borderColor:a==="gray"?u:"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"},...runIfFn$1(variantGhost,s)}},accessibleColorMap={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},variantSolid$2=s=>{var a;const{colorScheme:u}=s;if(u==="gray"){const v=mode$1("gray.100","whiteAlpha.200")(s);return{bg:v,color:mode$1("gray.800","whiteAlpha.900")(s),_hover:{bg:mode$1("gray.200","whiteAlpha.300")(s),_disabled:{bg:v}},_active:{bg:mode$1("gray.300","whiteAlpha.400")(s)}}}const{bg:l=`${u}.500`,color:f="white",hoverBg:c=`${u}.600`,activeBg:h=`${u}.700`}=(a=accessibleColorMap[u])!=null?a:{},p=mode$1(l,`${u}.200`)(s);return{bg:p,color:mode$1(f,"gray.800")(s),_hover:{bg:mode$1(c,`${u}.300`)(s),_disabled:{bg:p}},_active:{bg:mode$1(h,`${u}.400`)(s)}}},variantLink=s=>{const{colorScheme:a}=s;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:mode$1(`${a}.500`,`${a}.200`)(s),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:mode$1(`${a}.700`,`${a}.500`)(s)}}},variantUnstyled={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},variants$7={ghost:variantGhost,outline:variantOutline,solid:variantSolid$2,link:variantLink,unstyled:variantUnstyled},sizes$4={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"}},buttonTheme={baseStyle:baseStyle$8,variants:variants$7,sizes:sizes$4,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:definePartsStyle$3,defineMultiStyleConfig:defineMultiStyleConfig$3}=createMultiStyleConfigHelpers(cardAnatomy.keys),$bg$3=cssVar$1("card-bg"),$padding=cssVar$1("card-padding"),$shadow=cssVar$1("card-shadow"),$radius=cssVar$1("card-radius"),$border$1=cssVar$1("card-border-width","0"),$borderColor=cssVar$1("card-border-color"),baseStyle$7=definePartsStyle$3({container:{[$bg$3.variable]:"colors.chakra-body-bg",backgroundColor:$bg$3.reference,boxShadow:$shadow.reference,borderRadius:$radius.reference,color:"chakra-body-text",borderWidth:$border$1.reference,borderColor:$borderColor.reference},body:{padding:$padding.reference,flex:"1 1 0%"},header:{padding:$padding.reference},footer:{padding:$padding.reference}}),sizes$3={sm:definePartsStyle$3({container:{[$radius.variable]:"radii.base",[$padding.variable]:"space.3"}}),md:definePartsStyle$3({container:{[$radius.variable]:"radii.md",[$padding.variable]:"space.5"}}),lg:definePartsStyle$3({container:{[$radius.variable]:"radii.xl",[$padding.variable]:"space.7"}})},variants$6={elevated:definePartsStyle$3({container:{[$shadow.variable]:"shadows.base",_dark:{[$bg$3.variable]:"colors.gray.700"}}}),outline:definePartsStyle$3({container:{[$border$1.variable]:"1px",[$borderColor.variable]:"colors.chakra-border-color"}}),filled:definePartsStyle$3({container:{[$bg$3.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{[$padding.variable]:0},header:{[$padding.variable]:0},footer:{[$padding.variable]:0}}},cardTheme=defineMultiStyleConfig$3({baseStyle:baseStyle$7,variants:variants$6,sizes:sizes$3,defaultProps:{variant:"elevated",size:"md"}}),$size$1=cssVar("close-button-size"),$bg$2=cssVar("close-button-bg"),baseStyle$6={w:[$size$1.reference],h:[$size$1.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[$bg$2.variable]:"colors.blackAlpha.100",_dark:{[$bg$2.variable]:"colors.whiteAlpha.100"}},_active:{[$bg$2.variable]:"colors.blackAlpha.200",_dark:{[$bg$2.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:$bg$2.reference},sizes$2={lg:{[$size$1.variable]:"sizes.10",fontSize:"md"},md:{[$size$1.variable]:"sizes.8",fontSize:"xs"},sm:{[$size$1.variable]:"sizes.6",fontSize:"2xs"}},closeButtonTheme={baseStyle:baseStyle$6,sizes:sizes$2,defaultProps:{size:"md"}},{variants:variants$5,defaultProps}=badgeTheme,baseStyle$5={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm",bg:vars.bg.reference,color:vars.color.reference,boxShadow:vars.shadow.reference},codeTheme={baseStyle:baseStyle$5,variants:variants$5,defaultProps},baseStyle$4={w:"100%",mx:"auto",maxW:"prose",px:"4"},containerTheme={baseStyle:baseStyle$4},baseStyle$3={opacity:.6,borderColor:"inherit"},variantSolid$1={borderStyle:"solid"},variantDashed={borderStyle:"dashed"},variants$4={solid:variantSolid$1,dashed:variantDashed},dividerTheme={baseStyle:baseStyle$3,variants:variants$4,defaultProps:{variant:"solid"}},{definePartsStyle:definePartsStyle$2,defineMultiStyleConfig:defineMultiStyleConfig$2}=createMultiStyleConfigHelpers(accordionAnatomy.keys),baseStyleContainer$1={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},baseStyleButton={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},baseStylePanel={pt:"2",px:"4",pb:"5"},baseStyleIcon={fontSize:"1.25em"},baseStyle$2=definePartsStyle$2({container:baseStyleContainer$1,button:baseStyleButton,panel:baseStylePanel,icon:baseStyleIcon}),accordionTheme=defineMultiStyleConfig$2({baseStyle:baseStyle$2}),{definePartsStyle:definePartsStyle$1,defineMultiStyleConfig:defineMultiStyleConfig$1}=createMultiStyleConfigHelpers(alertAnatomy.keys),$fg=cssVar$1("alert-fg"),$bg$1=cssVar$1("alert-bg"),baseStyle$1=definePartsStyle$1({container:{bg:$bg$1.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:$fg.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:$fg.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function getBg(s){const{theme:a,colorScheme:u}=s,l=transparentize(`${u}.200`,.16)(a);return{light:`colors.${u}.100`,dark:l}}var variantSubtle=definePartsStyle$1(s=>{const{colorScheme:a}=s,u=getBg(s);return{container:{[$fg.variable]:`colors.${a}.600`,[$bg$1.variable]:u.light,_dark:{[$fg.variable]:`colors.${a}.200`,[$bg$1.variable]:u.dark}}}}),variantLeftAccent=definePartsStyle$1(s=>{const{colorScheme:a}=s,u=getBg(s);return{container:{[$fg.variable]:`colors.${a}.600`,[$bg$1.variable]:u.light,_dark:{[$fg.variable]:`colors.${a}.200`,[$bg$1.variable]:u.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:$fg.reference}}}),variantTopAccent=definePartsStyle$1(s=>{const{colorScheme:a}=s,u=getBg(s);return{container:{[$fg.variable]:`colors.${a}.600`,[$bg$1.variable]:u.light,_dark:{[$fg.variable]:`colors.${a}.200`,[$bg$1.variable]:u.dark},pt:"2",borderTopWidth:"4px",borderTopColor:$fg.reference}}}),variantSolid=definePartsStyle$1(s=>{const{colorScheme:a}=s;return{container:{[$fg.variable]:"colors.white",[$bg$1.variable]:`colors.${a}.600`,_dark:{[$fg.variable]:"colors.gray.900",[$bg$1.variable]:`colors.${a}.200`},color:$fg.reference}}}),variants$3={subtle:variantSubtle,"left-accent":variantLeftAccent,"top-accent":variantTopAccent,solid:variantSolid},alertTheme=defineMultiStyleConfig$1({baseStyle:baseStyle$1,variants:variants$3,defaultProps:{variant:"subtle",colorScheme:"blue"}}),{definePartsStyle,defineMultiStyleConfig}=createMultiStyleConfigHelpers(avatarAnatomy.keys),$border=cssVar$1("avatar-border-color"),$bg=cssVar$1("avatar-bg"),$fs=cssVar$1("avatar-font-size"),$size=cssVar$1("avatar-size"),baseStyleBadge={borderRadius:"full",border:"0.2em solid",borderColor:$border.reference,[$border.variable]:"white",_dark:{[$border.variable]:"colors.gray.800"}},baseStyleExcessLabel={bg:$bg.reference,fontSize:$fs.reference,width:$size.reference,height:$size.reference,lineHeight:"1",[$bg.variable]:"colors.gray.200",_dark:{[$bg.variable]:"colors.whiteAlpha.400"}},baseStyleContainer=s=>{const{name:a,theme:u}=s,l=a?randomColor({string:a}):"colors.gray.400",f=isDark(l)(u);let c="white";return f||(c="gray.800"),{bg:$bg.reference,fontSize:$fs.reference,color:c,borderColor:$border.reference,verticalAlign:"top",width:$size.reference,height:$size.reference,"&:not([data-loaded])":{[$bg.variable]:l},[$border.variable]:"colors.white",_dark:{[$border.variable]:"colors.gray.800"}}},baseStyleLabel={fontSize:$fs.reference,lineHeight:"1"},baseStyle=definePartsStyle(s=>({badge:runIfFn$1(baseStyleBadge,s),excessLabel:runIfFn$1(baseStyleExcessLabel,s),container:runIfFn$1(baseStyleContainer,s),label:baseStyleLabel}));function getSize(s){const a=s!=="100%"?sizes_default[s]:void 0;return definePartsStyle({container:{[$size.variable]:a??s,[$fs.variable]:`calc(${a??s} / 2.5)`},excessLabel:{[$size.variable]:a??s,[$fs.variable]:`calc(${a??s} / 2.5)`}})}var sizes$1={"2xs":getSize(4),xs:getSize(6),sm:getSize(8),md:getSize(12),lg:getSize(16),xl:getSize(24),"2xl":getSize(32),full:getSize("100%")},avatarTheme=defineMultiStyleConfig({baseStyle,sizes:sizes$1,defaultProps:{size:"md"}}),components={Accordion:accordionTheme,Alert:alertTheme,Avatar:avatarTheme,Badge:badgeTheme,Breadcrumb:breadcrumbTheme,Button:buttonTheme,Checkbox:checkboxTheme,CloseButton:closeButtonTheme,Code:codeTheme,Container:containerTheme,Divider:dividerTheme,Drawer:drawerTheme,Editable:editableTheme,Form:formTheme,FormError:formErrorTheme,FormLabel:formLabelTheme,Heading:headingTheme,Input:inputTheme,Kbd:kbdTheme,Link:linkTheme,List:listTheme,Menu:menuTheme,Modal:modalTheme,NumberInput:numberInputTheme,PinInput:pinInputTheme,Popover:popoverTheme,Progress:progressTheme,Radio:radioTheme,Select:selectTheme,Skeleton:skeletonTheme,SkipLink:skipLinkTheme,Slider:sliderTheme,Spinner:spinnerTheme,Stat:statTheme,Switch:switchTheme,Table:tableTheme,Tabs:tabsTheme,Tag:tagTheme,Textarea:textareaTheme,Tooltip:tooltipTheme,Card:cardTheme,Stepper:stepperTheme},semanticTokens={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-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"}}},styles={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color"}}},direction="ltr",config$3={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},theme$1={semanticTokens,direction,...foundations,components,styles,config:config$3};function isFunction$3(s){return typeof s=="function"}function pipe$1(...s){return a=>s.reduce((u,l)=>l(u),a)}var createExtendTheme=s=>function(...u){let l=[...u],f=u[u.length-1];return isChakraTheme(f)&&l.length>1?l=l.slice(0,l.length-1):f=s,pipe$1(...l.map(c=>h=>isFunction$3(c)?c(h):mergeThemeOverride(h,c)))(f)},extendTheme=createExtendTheme(theme$1);function mergeThemeOverride(...s){return mergeWith({},...s,mergeThemeCustomizer)}function mergeThemeCustomizer(s,a,u,l){if((isFunction$3(s)||isFunction$3(a))&&Object.prototype.hasOwnProperty.call(l,u))return(...f)=>{const c=isFunction$3(s)?s(...f):s,h=isFunction$3(a)?a(...f):a;return mergeWith({},c,h,mergeThemeCustomizer)}}function canUseDOM(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var isBrowser$3=canUseDOM();function omit$1(s,a){const u={};return Object.keys(s).forEach(l=>{a.includes(l)||(u[l]=s[l])}),u}function get$4(s,a,u,l){const f=typeof a=="string"?a.split("."):[a];for(l=0;l<f.length&&s;l+=1)s=s[f[l]];return s===void 0?u:s}var memoize=s=>{const a=new WeakMap;return(l,f,c,h)=>{if(typeof l>"u")return s(l,f,c);a.has(l)||a.set(l,new Map);const p=a.get(l);if(p.has(f))return p.get(f);const v=s(l,f,c,h);return p.set(f,v),v}},memoizedGet=memoize(get$4);function objectFilter(s,a){const u={};return Object.keys(s).forEach(l=>{const f=s[l];a(f,l,s)&&(u[l]=f)}),u}var filterUndefined=s=>objectFilter(s,a=>a!=null);function isFunction$2(s){return typeof s=="function"}function runIfFn(s,...a){return isFunction$2(s)?s(...a):s}function callAllHandlers(...s){return function(u){s.some(l=>(l==null||l(u),u==null?void 0:u.defaultPrevented))}}var reactFastCompare,hasRequiredReactFastCompare;function requireReactFastCompare(){if(hasRequiredReactFastCompare)return reactFastCompare;hasRequiredReactFastCompare=1;var s=typeof Element<"u",a=typeof Map=="function",u=typeof Set=="function",l=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function f(c,h){if(c===h)return!0;if(c&&h&&typeof c=="object"&&typeof h=="object"){if(c.constructor!==h.constructor)return!1;var p,v,y;if(Array.isArray(c)){if(p=c.length,p!=h.length)return!1;for(v=p;v--!==0;)if(!f(c[v],h[v]))return!1;return!0}var b;if(a&&c instanceof Map&&h instanceof Map){if(c.size!==h.size)return!1;for(b=c.entries();!(v=b.next()).done;)if(!h.has(v.value[0]))return!1;for(b=c.entries();!(v=b.next()).done;)if(!f(v.value[1],h.get(v.value[0])))return!1;return!0}if(u&&c instanceof Set&&h instanceof Set){if(c.size!==h.size)return!1;for(b=c.entries();!(v=b.next()).done;)if(!h.has(v.value[0]))return!1;return!0}if(l&&ArrayBuffer.isView(c)&&ArrayBuffer.isView(h)){if(p=c.length,p!=h.length)return!1;for(v=p;v--!==0;)if(c[v]!==h[v])return!1;return!0}if(c.constructor===RegExp)return c.source===h.source&&c.flags===h.flags;if(c.valueOf!==Object.prototype.valueOf&&typeof c.valueOf=="function"&&typeof h.valueOf=="function")return c.valueOf()===h.valueOf();if(c.toString!==Object.prototype.toString&&typeof c.toString=="function"&&typeof h.toString=="function")return c.toString()===h.toString();if(y=Object.keys(c),p=y.length,p!==Object.keys(h).length)return!1;for(v=p;v--!==0;)if(!Object.prototype.hasOwnProperty.call(h,y[v]))return!1;if(s&&c instanceof Element)return!1;for(v=p;v--!==0;)if(!((y[v]==="_owner"||y[v]==="__v"||y[v]==="__o")&&c.$$typeof)&&!f(c[y[v]],h[y[v]]))return!1;return!0}return c!==c&&h!==h}return reactFastCompare=function(h,p){try{return f(h,p)}catch(v){if((v.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw v}},reactFastCompare}var reactFastCompareExports=requireReactFastCompare();const isEqual=getDefaultExportFromCjs(reactFastCompareExports);function useStyleConfigImpl(s,a={}){var u;const{styleConfig:l,...f}=a,{theme:c,colorMode:h}=useChakra(),p=s?memoizedGet(c,`components.${s}`):void 0,v=l||p,y=mergeWith({theme:c,colorMode:h},(u=v==null?void 0:v.defaultProps)!=null?u:{},filterUndefined(omit$1(f,["children"]))),b=reactExports.useRef({});if(v){const E=resolveStyleConfig(v)(y);isEqual(b.current,E)||(b.current=E)}return b.current}function useStyleConfig(s,a={}){return useStyleConfigImpl(s,a)}function useMultiStyleConfig(s,a={}){return useStyleConfigImpl(s,a)}var allPropNames=new Set([...propNames,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),validHTMLProps=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function shouldForwardProp(s){return validHTMLProps.has(s)||!allPropNames.has(s)}function assignAfter(s,...a){if(s==null)throw new TypeError("Cannot convert undefined or null to object");const u={...s};for(const l of a)if(l!=null)for(const f in l)Object.prototype.hasOwnProperty.call(l,f)&&(f in u&&delete u[f],u[f]=l[f]);return u}function compact(s){const a=Object.assign({},s);for(let u in a)a[u]===void 0&&delete a[u];return a}var reactPropsRegex=/^((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|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|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)-.*))$/,isPropValid=memoize$2(function(s){return reactPropsRegex.test(s)||s.charCodeAt(0)===111&&s.charCodeAt(1)===110&&s.charCodeAt(2)<91}),isDevelopment$2=!1,testOmitPropsOnStringTag=isPropValid,testOmitPropsOnComponent=function(a){return a!=="theme"},getDefaultShouldForwardProp=function(a){return typeof a=="string"&&a.charCodeAt(0)>96?testOmitPropsOnStringTag:testOmitPropsOnComponent},composeShouldForwardProps=function(a,u,l){var f;if(u){var c=u.shouldForwardProp;f=a.__emotion_forwardProp&&c?function(h){return a.__emotion_forwardProp(h)&&c(h)}:c}return typeof f!="function"&&l&&(f=a.__emotion_forwardProp),f},Insertion=function(a){var u=a.cache,l=a.serialized,f=a.isStringTag;return registerStyles(u,l,f),useInsertionEffectAlwaysWithSyncFallback(function(){return insertStyles(u,l,f)}),null},createStyled=function s(a,u){var l=a.__emotion_real===a,f=l&&a.__emotion_base||a,c,h;u!==void 0&&(c=u.label,h=u.target);var p=composeShouldForwardProps(a,u,l),v=p||getDefaultShouldForwardProp(f),y=!v("as");return function(){var b=arguments,S=l&&a.__emotion_styles!==void 0?a.__emotion_styles.slice(0):[];if(c!==void 0&&S.push("label:"+c+";"),b[0]==null||b[0].raw===void 0)S.push.apply(S,b);else{var E=b[0];S.push(E[0]);for(var R=b.length,O=1;O<R;O++)S.push(b[O],E[O])}var I=withEmotionCache(function(B,N,D){var G=y&&B.as||f,V="",U=[],te=B;if(B.theme==null){te={};for(var Z in B)te[Z]=B[Z];te.theme=reactExports.useContext(ThemeContext)}typeof B.className=="string"?V=getRegisteredStyles(N.registered,U,B.className):B.className!=null&&(V=B.className+" ");var J=serializeStyles(S.concat(U),N.registered,te);V+=N.key+"-"+J.name,h!==void 0&&(V+=" "+h);var Q=y&&p===void 0?getDefaultShouldForwardProp(G):v,ee={};for(var k in B)y&&k==="as"||Q(k)&&(ee[k]=B[k]);return ee.className=V,D&&(ee.ref=D),reactExports.createElement(reactExports.Fragment,null,reactExports.createElement(Insertion,{cache:N,serialized:J,isStringTag:typeof G=="string"}),reactExports.createElement(G,ee))});return I.displayName=c!==void 0?c:"Styled("+(typeof f=="string"?f:f.displayName||f.name||"Component")+")",I.defaultProps=a.defaultProps,I.__emotion_real=I,I.__emotion_base=f,I.__emotion_styles=S,I.__emotion_forwardProp=p,Object.defineProperty(I,"toString",{value:function(){return h===void 0&&isDevelopment$2?"NO_COMPONENT_SELECTOR":"."+h}}),I.withComponent=function(B,N){var D=s(B,_extends({},u,N,{shouldForwardProp:composeShouldForwardProps(I,N,!0)}));return D.apply(void 0,S)},I}},tags=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],newStyled=createStyled.bind(null);tags.forEach(function(s){newStyled[s]=newStyled(s)});var _a$5,emotion_styled=(_a$5=newStyled.default)!=null?_a$5:newStyled,toCSSObject=({baseStyle:s})=>a=>{const{theme:u,css:l,__css:f,sx:c,...h}=a,p=objectFilter(h,(S,E)=>isStyleProp(E)),v=runIfFn(s,a),y=assignAfter({},f,v,filterUndefined(p),c),b=css(y)(a.theme);return l?[b,l]:b};function styled(s,a){const{baseStyle:u,...l}=a??{};l.shouldForwardProp||(l.shouldForwardProp=shouldForwardProp);const f=toCSSObject({baseStyle:u}),c=emotion_styled(s,l)(f);return React.forwardRef(function(v,y){const{colorMode:b,forced:S}=useColorMode();return React.createElement(c,{ref:y,"data-theme":S?b:void 0,...v})})}function factory(){const s=new Map;return new Proxy(styled,{apply(a,u,l){return styled(...l)},get(a,u){return s.has(u)||s.set(u,styled(u)),s.get(u)}})}var chakra=factory();function forwardRef(s){return reactExports.forwardRef(s)}function createContext(s={}){const{strict:a=!0,errorMessage:u="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:l}=s,f=reactExports.createContext(void 0);f.displayName=l;function c(){var h;const p=reactExports.useContext(f);if(!p&&a){const v=new Error(u);throw v.name="ContextError",(h=Error.captureStackTrace)==null||h.call(Error,v,c),v}return p}return[f.Provider,c,f]}function ThemeProvider(s){const{cssVarsRoot:a,theme:u,children:l}=s,f=reactExports.useMemo(()=>toCSSVar(u),[u]);return jsxRuntimeExports.jsxs(ThemeProvider$1,{theme:f,children:[jsxRuntimeExports.jsx(CSSVars,{root:a}),l]})}function CSSVars({root:s=":host, :root"}){const a=[s,"[data-theme]"].join(",");return jsxRuntimeExports.jsx(Global,{styles:u=>({[a]:u.__cssVars})})}createContext({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `<StylesProvider />` "});function createStylesContext(s){return createContext({name:`${s}StylesContext`,errorMessage:`useStyles: "styles" is undefined. Seems you forgot to wrap the components in "<${s} />" `})}function GlobalStyle(){const{colorMode:s}=useColorMode();return jsxRuntimeExports.jsx(Global,{styles:a=>{const u=memoizedGet(a,"styles.global"),l=runIfFn(u,{theme:a,colorMode:s});return l?css(l)(a):void 0}})}var EnvironmentContext=reactExports.createContext({getDocument(){return document},getWindow(){return window}});EnvironmentContext.displayName="EnvironmentContext";function EnvironmentProvider(s){const{children:a,environment:u,disabled:l}=s,f=reactExports.useRef(null),c=reactExports.useMemo(()=>u||{getDocument:()=>{var p,v;return(v=(p=f.current)==null?void 0:p.ownerDocument)!=null?v:document},getWindow:()=>{var p,v;return(v=(p=f.current)==null?void 0:p.ownerDocument.defaultView)!=null?v:window}},[u]),h=!l||!u;return jsxRuntimeExports.jsxs(EnvironmentContext.Provider,{value:c,children:[a,h&&jsxRuntimeExports.jsx("span",{id:"__chakra_env",hidden:!0,ref:f})]})}EnvironmentProvider.displayName="EnvironmentProvider";var ChakraProvider$1=s=>{const{children:a,colorModeManager:u,portalZIndex:l,resetScope:f,resetCSS:c=!0,theme:h={},environment:p,cssVarsRoot:v,disableEnvironment:y,disableGlobalStyle:b}=s,S=jsxRuntimeExports.jsx(EnvironmentProvider,{environment:p,disabled:y,children:a});return jsxRuntimeExports.jsx(ThemeProvider,{theme:h,cssVarsRoot:v,children:jsxRuntimeExports.jsxs(ColorModeProvider,{colorModeManager:u,options:h.config,children:[c?jsxRuntimeExports.jsx(CSSReset,{scope:f}):jsxRuntimeExports.jsx(CSSPolyfill,{}),!b&&jsxRuntimeExports.jsx(GlobalStyle,{}),l?jsxRuntimeExports.jsx(PortalManager,{zIndex:l,children:S}):S]})})},findById=(s,a)=>s.find(u=>u.id===a);function findToast(s,a){const u=getToastPosition(s,a),l=u?s[u].findIndex(f=>f.id===a):-1;return{position:u,index:l}}function getToastPosition(s,a){for(const[u,l]of Object.entries(s))if(findById(l,a))return u}function getToastStyle(s){const a=s.includes("right"),u=s.includes("left");let l="center";return a&&(l="flex-end"),u&&(l="flex-start"),{display:"flex",flexDirection:"column",alignItems:l}}function getToastListStyle(s){const u=s==="top"||s==="bottom"?"0 auto":void 0,l=s.includes("top")?"env(safe-area-inset-top, 0px)":void 0,f=s.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,c=s.includes("left")?void 0:"env(safe-area-inset-right, 0px)",h=s.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:u,top:l,bottom:f,right:c,left:h}}function useCallbackRef$2(s,a=[]){const u=reactExports.useRef(s);return reactExports.useEffect(()=>{u.current=s}),reactExports.useCallback((...l)=>{var f;return(f=u.current)==null?void 0:f.call(u,...l)},a)}function useTimeout(s,a){const u=useCallbackRef$2(s);reactExports.useEffect(()=>{if(a==null)return;let l=null;return l=window.setTimeout(()=>{u()},a),()=>{l&&window.clearTimeout(l)}},[a,u])}function useUpdateEffect(s,a){const u=reactExports.useRef(!1),l=reactExports.useRef(!1);reactExports.useEffect(()=>{if(u.current&&l.current)return s();l.current=!0},a),reactExports.useEffect(()=>(u.current=!0,()=>{u.current=!1}),[])}function createDOMMotionComponentProxy(s){if(typeof Proxy>"u")return s;const a=new Map,u=(...l)=>s(...l);return new Proxy(u,{get:(l,f)=>f==="create"?s:(a.has(f)||a.set(f,s(f)),a.get(f))})}function isAnimationControls(s){return s!==null&&typeof s=="object"&&typeof s.start=="function"}const isKeyframesTarget=s=>Array.isArray(s);function shallowCompare(s,a){if(!Array.isArray(a))return!1;const u=a.length;if(u!==s.length)return!1;for(let l=0;l<u;l++)if(a[l]!==s[l])return!1;return!0}function isVariantLabel(s){return typeof s=="string"||Array.isArray(s)}function getValueState(s){const a=[{},{}];return s==null||s.values.forEach((u,l)=>{a[0][l]=u.get(),a[1][l]=u.getVelocity()}),a}function resolveVariantFromProps(s,a,u,l){if(typeof a=="function"){const[f,c]=getValueState(l);a=a(u!==void 0?u:s.custom,f,c)}if(typeof a=="string"&&(a=s.variants&&s.variants[a]),typeof a=="function"){const[f,c]=getValueState(l);a=a(u!==void 0?u:s.custom,f,c)}return a}function resolveVariant(s,a,u){const l=s.getProps();return resolveVariantFromProps(l,a,u!==void 0?u:l.custom,s)}const variantPriorityOrder=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],variantProps=["initial",...variantPriorityOrder],transformPropOrder=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],transformProps=new Set(transformPropOrder),secondsToMilliseconds=s=>s*1e3,millisecondsToSeconds=s=>s/1e3,underDampedSpring={type:"spring",stiffness:500,damping:25,restSpeed:10},criticallyDampedSpring=s=>({type:"spring",stiffness:550,damping:s===0?2*Math.sqrt(550):30,restSpeed:10}),keyframesTransition={type:"keyframes",duration:.8},ease={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},getDefaultTransition=(s,{keyframes:a})=>a.length>2?keyframesTransition:transformProps.has(s)?s.startsWith("scale")?criticallyDampedSpring(a[1]):underDampedSpring:ease;function getValueTransition(s,a){return s?s[a]||s.default||s:void 0}const MotionGlobalConfig={skipAnimations:!1,useManualTiming:!1},isNotNull=s=>s!==null;function getFinalKeyframe(s,{repeat:a,repeatType:u="loop"},l){const f=s.filter(isNotNull),c=a&&u!=="loop"&&a%2===1?0:f.length-1;return!c||l===void 0?f[c]:l}const noop$1=s=>s;let invariant=noop$1;function createRenderStep(s){let a=new Set,u=new Set,l=!1,f=!1;const c=new WeakSet;let h={delta:0,timestamp:0,isProcessing:!1};function p(y){c.has(y)&&(v.schedule(y),s()),y(h)}const v={schedule:(y,b=!1,S=!1)=>{const R=S&&l?a:u;return b&&c.add(y),R.has(y)||R.add(y),y},cancel:y=>{u.delete(y),c.delete(y)},process:y=>{if(h=y,l){f=!0;return}l=!0,[a,u]=[u,a],a.forEach(p),a.clear(),l=!1,f&&(f=!1,v.process(y))}};return v}const stepsOrder=["read","resolveKeyframes","update","preRender","render","postRender"],maxElapsed=40;function createRenderBatcher(s,a){let u=!1,l=!0;const f={delta:0,timestamp:0,isProcessing:!1},c=()=>u=!0,h=stepsOrder.reduce((N,D)=>(N[D]=createRenderStep(c),N),{}),{read:p,resolveKeyframes:v,update:y,preRender:b,render:S,postRender:E}=h,R=()=>{const N=performance.now();u=!1,f.delta=l?1e3/60:Math.max(Math.min(N-f.timestamp,maxElapsed),1),f.timestamp=N,f.isProcessing=!0,p.process(f),v.process(f),y.process(f),b.process(f),S.process(f),E.process(f),f.isProcessing=!1,u&&a&&(l=!1,s(R))},O=()=>{u=!0,l=!0,f.isProcessing||s(R)};return{schedule:stepsOrder.reduce((N,D)=>{const G=h[D];return N[D]=(V,U=!1,te=!1)=>(u||O(),G.schedule(V,U,te)),N},{}),cancel:N=>{for(let D=0;D<stepsOrder.length;D++)h[stepsOrder[D]].cancel(N)},state:f,steps:h}}const{schedule:frame,cancel:cancelFrame,state:frameData,steps:frameSteps}=createRenderBatcher(typeof requestAnimationFrame<"u"?requestAnimationFrame:noop$1,!0),calcBezier=(s,a,u)=>(((1-3*u+3*a)*s+(3*u-6*a))*s+3*a)*s,subdivisionPrecision=1e-7,subdivisionMaxIterations=12;function binarySubdivide(s,a,u,l,f){let c,h,p=0;do h=a+(u-a)/2,c=calcBezier(h,l,f)-s,c>0?u=h:a=h;while(Math.abs(c)>subdivisionPrecision&&++p<subdivisionMaxIterations);return h}function cubicBezier(s,a,u,l){if(s===a&&u===l)return noop$1;const f=c=>binarySubdivide(c,0,1,s,u);return c=>c===0||c===1?c:calcBezier(f(c),a,l)}const mirrorEasing=s=>a=>a<=.5?s(2*a)/2:(2-s(2*(1-a)))/2,reverseEasing=s=>a=>1-s(1-a),backOut=cubicBezier(.33,1.53,.69,.99),backIn=reverseEasing(backOut),backInOut=mirrorEasing(backIn),anticipate=s=>(s*=2)<1?.5*backIn(s):.5*(2-Math.pow(2,-10*(s-1))),circIn=s=>1-Math.sin(Math.acos(s)),circOut=reverseEasing(circIn),circInOut=mirrorEasing(circIn),isZeroValueString=s=>/^0[^.\s]+$/u.test(s);function isNone(s){return typeof s=="number"?s===0:s!==null?s==="none"||s==="0"||isZeroValueString(s):!0}const isNumericalString=s=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(s),checkStringStartsWith=s=>a=>typeof a=="string"&&a.startsWith(s),isCSSVariableName=checkStringStartsWith("--"),startsAsVariableToken=checkStringStartsWith("var(--"),isCSSVariableToken=s=>startsAsVariableToken(s)?singleCssVariableRegex.test(s.split("/*")[0].trim()):!1,singleCssVariableRegex=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,splitCSSVariableRegex=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function parseCSSVariable(s){const a=splitCSSVariableRegex.exec(s);if(!a)return[,];const[,u,l,f]=a;return[`--${u??l}`,f]}function getVariableValue(s,a,u=1){const[l,f]=parseCSSVariable(s);if(!l)return;const c=window.getComputedStyle(a).getPropertyValue(l);if(c){const h=c.trim();return isNumericalString(h)?parseFloat(h):h}return isCSSVariableToken(f)?getVariableValue(f,a,u+1):f}const clamp=(s,a,u)=>u>a?a:u<s?s:u,number$1={test:s=>typeof s=="number",parse:parseFloat,transform:s=>s},alpha={...number$1,transform:s=>clamp(0,1,s)},scale={...number$1,default:1},createUnitType=s=>({test:a=>typeof a=="string"&&a.endsWith(s)&&a.split(" ").length===1,parse:parseFloat,transform:a=>`${a}${s}`}),degrees=createUnitType("deg"),percent=createUnitType("%"),px=createUnitType("px"),vh=createUnitType("vh"),vw=createUnitType("vw"),progressPercentage={...percent,parse:s=>percent.parse(s)/100,transform:s=>percent.transform(s*100)},positionalKeys=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),isNumOrPxType=s=>s===number$1||s===px,getPosFromMatrix=(s,a)=>parseFloat(s.split(", ")[a]),getTranslateFromMatrix=(s,a)=>(u,{transform:l})=>{if(l==="none"||!l)return 0;const f=l.match(/^matrix3d\((.+)\)$/u);if(f)return getPosFromMatrix(f[1],a);{const c=l.match(/^matrix\((.+)\)$/u);return c?getPosFromMatrix(c[1],s):0}},transformKeys=new Set(["x","y","z"]),nonTranslationalTransformKeys=transformPropOrder.filter(s=>!transformKeys.has(s));function removeNonTranslationalTransform(s){const a=[];return nonTranslationalTransformKeys.forEach(u=>{const l=s.getValue(u);l!==void 0&&(a.push([u,l.get()]),l.set(u.startsWith("scale")?1:0))}),a}const positionalValues={width:({x:s},{paddingLeft:a="0",paddingRight:u="0"})=>s.max-s.min-parseFloat(a)-parseFloat(u),height:({y:s},{paddingTop:a="0",paddingBottom:u="0"})=>s.max-s.min-parseFloat(a)-parseFloat(u),top:(s,{top:a})=>parseFloat(a),left:(s,{left:a})=>parseFloat(a),bottom:({y:s},{top:a})=>parseFloat(a)+(s.max-s.min),right:({x:s},{left:a})=>parseFloat(a)+(s.max-s.min),x:getTranslateFromMatrix(4,13),y:getTranslateFromMatrix(5,14)};positionalValues.translateX=positionalValues.x;positionalValues.translateY=positionalValues.y;const testValueType=s=>a=>a.test(s),auto={test:s=>s==="auto",parse:s=>s},dimensionValueTypes=[number$1,px,percent,degrees,vw,vh,auto],findDimensionValueType=s=>dimensionValueTypes.find(testValueType(s)),toResolve=new Set;let isScheduled=!1,anyNeedsMeasurement=!1;function measureAllKeyframes(){if(anyNeedsMeasurement){const s=Array.from(toResolve).filter(l=>l.needsMeasurement),a=new Set(s.map(l=>l.element)),u=new Map;a.forEach(l=>{const f=removeNonTranslationalTransform(l);f.length&&(u.set(l,f),l.render())}),s.forEach(l=>l.measureInitialState()),a.forEach(l=>{l.render();const f=u.get(l);f&&f.forEach(([c,h])=>{var p;(p=l.getValue(c))===null||p===void 0||p.set(h)})}),s.forEach(l=>l.measureEndState()),s.forEach(l=>{l.suspendedScrollY!==void 0&&window.scrollTo(0,l.suspendedScrollY)})}anyNeedsMeasurement=!1,isScheduled=!1,toResolve.forEach(s=>s.complete()),toResolve.clear()}function readAllKeyframes(){toResolve.forEach(s=>{s.readKeyframes(),s.needsMeasurement&&(anyNeedsMeasurement=!0)})}function flushKeyframeResolvers(){readAllKeyframes(),measureAllKeyframes()}class KeyframeResolver{constructor(a,u,l,f,c,h=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...a],this.onComplete=u,this.name=l,this.motionValue=f,this.element=c,this.isAsync=h}scheduleResolve(){this.isScheduled=!0,this.isAsync?(toResolve.add(this),isScheduled||(isScheduled=!0,frame.read(readAllKeyframes),frame.resolveKeyframes(measureAllKeyframes))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:a,name:u,element:l,motionValue:f}=this;for(let c=0;c<a.length;c++)if(a[c]===null)if(c===0){const h=f==null?void 0:f.get(),p=a[a.length-1];if(h!==void 0)a[0]=h;else if(l&&u){const v=l.readValue(u,p);v!=null&&(a[0]=v)}a[0]===void 0&&(a[0]=p),f&&h===void 0&&f.set(a[0])}else a[c]=a[c-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),toResolve.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,toResolve.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const sanitize=s=>Math.round(s*1e5)/1e5,floatRegex=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function isNullish(s){return s==null}const singleColorRegex=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,isColorString=(s,a)=>u=>!!(typeof u=="string"&&singleColorRegex.test(u)&&u.startsWith(s)||a&&!isNullish(u)&&Object.prototype.hasOwnProperty.call(u,a)),splitColor=(s,a,u)=>l=>{if(typeof l!="string")return l;const[f,c,h,p]=l.match(floatRegex);return{[s]:parseFloat(f),[a]:parseFloat(c),[u]:parseFloat(h),alpha:p!==void 0?parseFloat(p):1}},clampRgbUnit=s=>clamp(0,255,s),rgbUnit={...number$1,transform:s=>Math.round(clampRgbUnit(s))},rgba={test:isColorString("rgb","red"),parse:splitColor("red","green","blue"),transform:({red:s,green:a,blue:u,alpha:l=1})=>"rgba("+rgbUnit.transform(s)+", "+rgbUnit.transform(a)+", "+rgbUnit.transform(u)+", "+sanitize(alpha.transform(l))+")"};function parseHex$1(s){let a="",u="",l="",f="";return s.length>5?(a=s.substring(1,3),u=s.substring(3,5),l=s.substring(5,7),f=s.substring(7,9)):(a=s.substring(1,2),u=s.substring(2,3),l=s.substring(3,4),f=s.substring(4,5),a+=a,u+=u,l+=l,f+=f),{red:parseInt(a,16),green:parseInt(u,16),blue:parseInt(l,16),alpha:f?parseInt(f,16)/255:1}}const hex={test:isColorString("#"),parse:parseHex$1,transform:rgba.transform},hsla={test:isColorString("hsl","hue"),parse:splitColor("hue","saturation","lightness"),transform:({hue:s,saturation:a,lightness:u,alpha:l=1})=>"hsla("+Math.round(s)+", "+percent.transform(sanitize(a))+", "+percent.transform(sanitize(u))+", "+sanitize(alpha.transform(l))+")"},color={test:s=>rgba.test(s)||hex.test(s)||hsla.test(s),parse:s=>rgba.test(s)?rgba.parse(s):hsla.test(s)?hsla.parse(s):hex.parse(s),transform:s=>typeof s=="string"?s:s.hasOwnProperty("red")?rgba.transform(s):hsla.transform(s)},colorRegex=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function test(s){var a,u;return isNaN(s)&&typeof s=="string"&&(((a=s.match(floatRegex))===null||a===void 0?void 0:a.length)||0)+(((u=s.match(colorRegex))===null||u===void 0?void 0:u.length)||0)>0}const NUMBER_TOKEN="number",COLOR_TOKEN="color",VAR_TOKEN="var",VAR_FUNCTION_TOKEN="var(",SPLIT_TOKEN="${}",complexRegex=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function analyseComplexValue(s){const a=s.toString(),u=[],l={color:[],number:[],var:[]},f=[];let c=0;const p=a.replace(complexRegex,v=>(color.test(v)?(l.color.push(c),f.push(COLOR_TOKEN),u.push(color.parse(v))):v.startsWith(VAR_FUNCTION_TOKEN)?(l.var.push(c),f.push(VAR_TOKEN),u.push(v)):(l.number.push(c),f.push(NUMBER_TOKEN),u.push(parseFloat(v))),++c,SPLIT_TOKEN)).split(SPLIT_TOKEN);return{values:u,split:p,indexes:l,types:f}}function parseComplexValue(s){return analyseComplexValue(s).values}function createTransformer(s){const{split:a,types:u}=analyseComplexValue(s),l=a.length;return f=>{let c="";for(let h=0;h<l;h++)if(c+=a[h],f[h]!==void 0){const p=u[h];p===NUMBER_TOKEN?c+=sanitize(f[h]):p===COLOR_TOKEN?c+=color.transform(f[h]):c+=f[h]}return c}}const convertNumbersToZero=s=>typeof s=="number"?0:s;function getAnimatableNone$1(s){const a=parseComplexValue(s);return createTransformer(s)(a.map(convertNumbersToZero))}const complex={test,parse:parseComplexValue,createTransformer,getAnimatableNone:getAnimatableNone$1},maxDefaults=new Set(["brightness","contrast","saturate","opacity"]);function applyDefaultFilter(s){const[a,u]=s.slice(0,-1).split("(");if(a==="drop-shadow")return s;const[l]=u.match(floatRegex)||[];if(!l)return s;const f=u.replace(l,"");let c=maxDefaults.has(a)?1:0;return l!==u&&(c*=100),a+"("+c+f+")"}const functionRegex=/\b([a-z-]*)\(.*?\)/gu,filter$1={...complex,getAnimatableNone:s=>{const a=s.match(functionRegex);return a?a.map(applyDefaultFilter).join(" "):s}},browserNumberValueTypes={borderWidth:px,borderTopWidth:px,borderRightWidth:px,borderBottomWidth:px,borderLeftWidth:px,borderRadius:px,radius:px,borderTopLeftRadius:px,borderTopRightRadius:px,borderBottomRightRadius:px,borderBottomLeftRadius:px,width:px,maxWidth:px,height:px,maxHeight:px,top:px,right:px,bottom:px,left:px,padding:px,paddingTop:px,paddingRight:px,paddingBottom:px,paddingLeft:px,margin:px,marginTop:px,marginRight:px,marginBottom:px,marginLeft:px,backgroundPositionX:px,backgroundPositionY:px},transformValueTypes={rotate:degrees,rotateX:degrees,rotateY:degrees,rotateZ:degrees,scale,scaleX:scale,scaleY:scale,scaleZ:scale,skew:degrees,skewX:degrees,skewY:degrees,distance:px,translateX:px,translateY:px,translateZ:px,x:px,y:px,z:px,perspective:px,transformPerspective:px,opacity:alpha,originX:progressPercentage,originY:progressPercentage,originZ:px},int$1={...number$1,transform:Math.round},numberValueTypes={...browserNumberValueTypes,...transformValueTypes,zIndex:int$1,size:px,fillOpacity:alpha,strokeOpacity:alpha,numOctaves:int$1},defaultValueTypes={...numberValueTypes,color,backgroundColor:color,outlineColor:color,fill:color,stroke:color,borderColor:color,borderTopColor:color,borderRightColor:color,borderBottomColor:color,borderLeftColor:color,filter:filter$1,WebkitFilter:filter$1},getDefaultValueType=s=>defaultValueTypes[s];function getAnimatableNone(s,a){let u=getDefaultValueType(s);return u!==filter$1&&(u=complex),u.getAnimatableNone?u.getAnimatableNone(a):void 0}const invalidTemplates=new Set(["auto","none","0"]);function makeNoneKeyframesAnimatable(s,a,u){let l=0,f;for(;l<s.length&&!f;){const c=s[l];typeof c=="string"&&!invalidTemplates.has(c)&&analyseComplexValue(c).values.length&&(f=s[l]),l++}if(f&&u)for(const c of a)s[c]=getAnimatableNone(u,f)}class DOMKeyframesResolver extends KeyframeResolver{constructor(a,u,l,f,c){super(a,u,l,f,c,!0)}readKeyframes(){const{unresolvedKeyframes:a,element:u,name:l}=this;if(!u||!u.current)return;super.readKeyframes();for(let v=0;v<a.length;v++){let y=a[v];if(typeof y=="string"&&(y=y.trim(),isCSSVariableToken(y))){const b=getVariableValue(y,u.current);b!==void 0&&(a[v]=b),v===a.length-1&&(this.finalKeyframe=y)}}if(this.resolveNoneKeyframes(),!positionalKeys.has(l)||a.length!==2)return;const[f,c]=a,h=findDimensionValueType(f),p=findDimensionValueType(c);if(h!==p)if(isNumOrPxType(h)&&isNumOrPxType(p))for(let v=0;v<a.length;v++){const y=a[v];typeof y=="string"&&(a[v]=parseFloat(y))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:a,name:u}=this,l=[];for(let f=0;f<a.length;f++)isNone(a[f])&&l.push(f);l.length&&makeNoneKeyframesAnimatable(a,l,u)}measureInitialState(){const{element:a,unresolvedKeyframes:u,name:l}=this;if(!a||!a.current)return;l==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=positionalValues[l](a.measureViewportBox(),window.getComputedStyle(a.current)),u[0]=this.measuredOrigin;const f=u[u.length-1];f!==void 0&&a.getValue(l,f).jump(f,!1)}measureEndState(){var a;const{element:u,name:l,unresolvedKeyframes:f}=this;if(!u||!u.current)return;const c=u.getValue(l);c&&c.jump(this.measuredOrigin,!1);const h=f.length-1,p=f[h];f[h]=positionalValues[l](u.measureViewportBox(),window.getComputedStyle(u.current)),p!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=p),!((a=this.removedTransforms)===null||a===void 0)&&a.length&&this.removedTransforms.forEach(([v,y])=>{u.getValue(v).set(y)}),this.resolveNoneKeyframes()}}function isGenerator(s){return typeof s=="function"}let now$1;function clearTime(){now$1=void 0}const time={now:()=>(now$1===void 0&&time.set(frameData.isProcessing||MotionGlobalConfig.useManualTiming?frameData.timestamp:performance.now()),now$1),set:s=>{now$1=s,queueMicrotask(clearTime)}},isAnimatable=(s,a)=>a==="zIndex"?!1:!!(typeof s=="number"||Array.isArray(s)||typeof s=="string"&&(complex.test(s)||s==="0")&&!s.startsWith("url("));function hasKeyframesChanged(s){const a=s[0];if(s.length===1)return!0;for(let u=0;u<s.length;u++)if(s[u]!==a)return!0}function canAnimate(s,a,u,l){const f=s[0];if(f===null)return!1;if(a==="display"||a==="visibility")return!0;const c=s[s.length-1],h=isAnimatable(f,a),p=isAnimatable(c,a);return!h||!p?!1:hasKeyframesChanged(s)||(u==="spring"||isGenerator(u))&&l}const MAX_RESOLVE_DELAY=40;class BaseAnimation{constructor({autoplay:a=!0,delay:u=0,type:l="keyframes",repeat:f=0,repeatDelay:c=0,repeatType:h="loop",...p}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=time.now(),this.options={autoplay:a,delay:u,type:l,repeat:f,repeatDelay:c,repeatType:h,...p},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>MAX_RESOLVE_DELAY?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&flushKeyframeResolvers(),this._resolved}onKeyframesResolved(a,u){this.resolvedAt=time.now(),this.hasAttemptedResolve=!0;const{name:l,type:f,velocity:c,delay:h,onComplete:p,onUpdate:v,isGenerator:y}=this.options;if(!y&&!canAnimate(a,l,f,c))if(h)this.options.duration=0;else{v==null||v(getFinalKeyframe(a,this.options,u)),p==null||p(),this.resolveFinishedPromise();return}const b=this.initPlayback(a,u);b!==!1&&(this._resolved={keyframes:a,finalKeyframe:u,...b},this.onPostResolved())}onPostResolved(){}then(a,u){return this.currentFinishedPromise.then(a,u)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(a=>{this.resolveFinishedPromise=a})}}const progress=(s,a,u)=>{const l=a-s;return l===0?1:(u-s)/l},generateLinearEasing=(s,a,u=10)=>{let l="";const f=Math.max(Math.round(a/u),2);for(let c=0;c<f;c++)l+=s(progress(0,f-1,c))+", ";return`linear(${l.substring(0,l.length-2)})`};function velocityPerSecond(s,a){return a?s*(1e3/a):0}const velocitySampleDuration=5;function calcGeneratorVelocity(s,a,u){const l=Math.max(a-velocitySampleDuration,0);return velocityPerSecond(u-s(l),a-l)}const springDefaults={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},safeMin=.001;function findSpring({duration:s=springDefaults.duration,bounce:a=springDefaults.bounce,velocity:u=springDefaults.velocity,mass:l=springDefaults.mass}){let f,c,h=1-a;h=clamp(springDefaults.minDamping,springDefaults.maxDamping,h),s=clamp(springDefaults.minDuration,springDefaults.maxDuration,millisecondsToSeconds(s)),h<1?(f=y=>{const b=y*h,S=b*s,E=b-u,R=calcAngularFreq(y,h),O=Math.exp(-S);return safeMin-E/R*O},c=y=>{const S=y*h*s,E=S*u+u,R=Math.pow(h,2)*Math.pow(y,2)*s,O=Math.exp(-S),I=calcAngularFreq(Math.pow(y,2),h);return(-f(y)+safeMin>0?-1:1)*((E-R)*O)/I}):(f=y=>{const b=Math.exp(-y*s),S=(y-u)*s+1;return-safeMin+b*S},c=y=>{const b=Math.exp(-y*s),S=(u-y)*(s*s);return b*S});const p=5/s,v=approximateRoot(f,c,p);if(s=secondsToMilliseconds(s),isNaN(v))return{stiffness:springDefaults.stiffness,damping:springDefaults.damping,duration:s};{const y=Math.pow(v,2)*l;return{stiffness:y,damping:h*2*Math.sqrt(l*y),duration:s}}}const rootIterations=12;function approximateRoot(s,a,u){let l=u;for(let f=1;f<rootIterations;f++)l=l-s(l)/a(l);return l}function calcAngularFreq(s,a){return s*Math.sqrt(1-a*a)}const maxGeneratorDuration=2e4;function calcGeneratorDuration(s){let a=0;const u=50;let l=s.next(a);for(;!l.done&&a<maxGeneratorDuration;)a+=u,l=s.next(a);return a>=maxGeneratorDuration?1/0:a}const durationKeys=["duration","bounce"],physicsKeys=["stiffness","damping","mass"];function isSpringType(s,a){return a.some(u=>s[u]!==void 0)}function getSpringOptions(s){let a={velocity:springDefaults.velocity,stiffness:springDefaults.stiffness,damping:springDefaults.damping,mass:springDefaults.mass,isResolvedFromDuration:!1,...s};if(!isSpringType(s,physicsKeys)&&isSpringType(s,durationKeys))if(s.visualDuration){const u=s.visualDuration,l=2*Math.PI/(u*1.2),f=l*l,c=2*clamp(.05,1,1-s.bounce)*Math.sqrt(f);a={...a,mass:springDefaults.mass,stiffness:f,damping:c}}else{const u=findSpring(s);a={...a,...u,mass:springDefaults.mass},a.isResolvedFromDuration=!0}return a}function spring(s=springDefaults.visualDuration,a=springDefaults.bounce){const u=typeof s!="object"?{visualDuration:s,keyframes:[0,1],bounce:a}:s;let{restSpeed:l,restDelta:f}=u;const c=u.keyframes[0],h=u.keyframes[u.keyframes.length-1],p={done:!1,value:c},{stiffness:v,damping:y,mass:b,duration:S,velocity:E,isResolvedFromDuration:R}=getSpringOptions({...u,velocity:-millisecondsToSeconds(u.velocity||0)}),O=E||0,I=y/(2*Math.sqrt(v*b)),B=h-c,N=millisecondsToSeconds(Math.sqrt(v/b)),D=Math.abs(B)<5;l||(l=D?springDefaults.restSpeed.granular:springDefaults.restSpeed.default),f||(f=D?springDefaults.restDelta.granular:springDefaults.restDelta.default);let G;if(I<1){const U=calcAngularFreq(N,I);G=te=>{const Z=Math.exp(-I*N*te);return h-Z*((O+I*N*B)/U*Math.sin(U*te)+B*Math.cos(U*te))}}else if(I===1)G=U=>h-Math.exp(-N*U)*(B+(O+N*B)*U);else{const U=N*Math.sqrt(I*I-1);G=te=>{const Z=Math.exp(-I*N*te),J=Math.min(U*te,300);return h-Z*((O+I*N*B)*Math.sinh(J)+U*B*Math.cosh(J))/U}}const V={calculatedDuration:R&&S||null,next:U=>{const te=G(U);if(R)p.done=U>=S;else{let Z=0;I<1&&(Z=U===0?secondsToMilliseconds(O):calcGeneratorVelocity(G,U,te));const J=Math.abs(Z)<=l,Q=Math.abs(h-te)<=f;p.done=J&&Q}return p.value=p.done?h:te,p},toString:()=>{const U=Math.min(calcGeneratorDuration(V),maxGeneratorDuration),te=generateLinearEasing(Z=>V.next(U*Z).value,U,30);return U+"ms "+te}};return V}function inertia({keyframes:s,velocity:a=0,power:u=.8,timeConstant:l=325,bounceDamping:f=10,bounceStiffness:c=500,modifyTarget:h,min:p,max:v,restDelta:y=.5,restSpeed:b}){const S=s[0],E={done:!1,value:S},R=J=>p!==void 0&&J<p||v!==void 0&&J>v,O=J=>p===void 0?v:v===void 0||Math.abs(p-J)<Math.abs(v-J)?p:v;let I=u*a;const B=S+I,N=h===void 0?B:h(B);N!==B&&(I=N-S);const D=J=>-I*Math.exp(-J/l),G=J=>N+D(J),V=J=>{const Q=D(J),ee=G(J);E.done=Math.abs(Q)<=y,E.value=E.done?N:ee};let U,te;const Z=J=>{R(E.value)&&(U=J,te=spring({keyframes:[E.value,O(E.value)],velocity:calcGeneratorVelocity(G,J,E.value),damping:f,stiffness:c,restDelta:y,restSpeed:b}))};return Z(0),{calculatedDuration:null,next:J=>{let Q=!1;return!te&&U===void 0&&(Q=!0,V(J),Z(J)),U!==void 0&&J>=U?te.next(J-U):(!Q&&V(J),E)}}}const easeIn=cubicBezier(.42,0,1,1),easeOut=cubicBezier(0,0,.58,1),easeInOut=cubicBezier(.42,0,.58,1),isEasingArray=s=>Array.isArray(s)&&typeof s[0]!="number",isBezierDefinition=s=>Array.isArray(s)&&typeof s[0]=="number",easingLookup={linear:noop$1,easeIn,easeInOut,easeOut,circIn,circInOut,circOut,backIn,backInOut,backOut,anticipate},easingDefinitionToFunction=s=>{if(isBezierDefinition(s)){invariant(s.length===4);const[a,u,l,f]=s;return cubicBezier(a,u,l,f)}else if(typeof s=="string")return invariant(easingLookup[s]!==void 0),easingLookup[s];return s},combineFunctions=(s,a)=>u=>a(s(u)),pipe=(...s)=>s.reduce(combineFunctions),mixNumber$1=(s,a,u)=>s+(a-s)*u;function hueToRgb(s,a,u){return u<0&&(u+=1),u>1&&(u-=1),u<1/6?s+(a-s)*6*u:u<1/2?a:u<2/3?s+(a-s)*(2/3-u)*6:s}function hslaToRgba({hue:s,saturation:a,lightness:u,alpha:l}){s/=360,a/=100,u/=100;let f=0,c=0,h=0;if(!a)f=c=h=u;else{const p=u<.5?u*(1+a):u+a-u*a,v=2*u-p;f=hueToRgb(v,p,s+1/3),c=hueToRgb(v,p,s),h=hueToRgb(v,p,s-1/3)}return{red:Math.round(f*255),green:Math.round(c*255),blue:Math.round(h*255),alpha:l}}function mixImmediate(s,a){return u=>u>0?a:s}const mixLinearColor=(s,a,u)=>{const l=s*s,f=u*(a*a-l)+l;return f<0?0:Math.sqrt(f)},colorTypes=[hex,rgba,hsla],getColorType=s=>colorTypes.find(a=>a.test(s));function asRGBA(s){const a=getColorType(s);if(!a)return!1;let u=a.parse(s);return a===hsla&&(u=hslaToRgba(u)),u}const mixColor=(s,a)=>{const u=asRGBA(s),l=asRGBA(a);if(!u||!l)return mixImmediate(s,a);const f={...u};return c=>(f.red=mixLinearColor(u.red,l.red,c),f.green=mixLinearColor(u.green,l.green,c),f.blue=mixLinearColor(u.blue,l.blue,c),f.alpha=mixNumber$1(u.alpha,l.alpha,c),rgba.transform(f))},invisibleValues=new Set(["none","hidden"]);function mixVisibility(s,a){return invisibleValues.has(s)?u=>u<=0?s:a:u=>u>=1?a:s}function mixNumber(s,a){return u=>mixNumber$1(s,a,u)}function getMixer(s){return typeof s=="number"?mixNumber:typeof s=="string"?isCSSVariableToken(s)?mixImmediate:color.test(s)?mixColor:mixComplex:Array.isArray(s)?mixArray:typeof s=="object"?color.test(s)?mixColor:mixObject:mixImmediate}function mixArray(s,a){const u=[...s],l=u.length,f=s.map((c,h)=>getMixer(c)(c,a[h]));return c=>{for(let h=0;h<l;h++)u[h]=f[h](c);return u}}function mixObject(s,a){const u={...s,...a},l={};for(const f in u)s[f]!==void 0&&a[f]!==void 0&&(l[f]=getMixer(s[f])(s[f],a[f]));return f=>{for(const c in l)u[c]=l[c](f);return u}}function matchOrder(s,a){var u;const l=[],f={color:0,var:0,number:0};for(let c=0;c<a.values.length;c++){const h=a.types[c],p=s.indexes[h][f[h]],v=(u=s.values[p])!==null&&u!==void 0?u:0;l[c]=v,f[h]++}return l}const mixComplex=(s,a)=>{const u=complex.createTransformer(a),l=analyseComplexValue(s),f=analyseComplexValue(a);return l.indexes.var.length===f.indexes.var.length&&l.indexes.color.length===f.indexes.color.length&&l.indexes.number.length>=f.indexes.number.length?invisibleValues.has(s)&&!f.values.length||invisibleValues.has(a)&&!l.values.length?mixVisibility(s,a):pipe(mixArray(matchOrder(l,f),f.values),u):mixImmediate(s,a)};function mix(s,a,u){return typeof s=="number"&&typeof a=="number"&&typeof u=="number"?mixNumber$1(s,a,u):getMixer(s)(s,a)}function createMixers(s,a,u){const l=[],f=u||mix,c=s.length-1;for(let h=0;h<c;h++){let p=f(s[h],s[h+1]);if(a){const v=Array.isArray(a)?a[h]||noop$1:a;p=pipe(v,p)}l.push(p)}return l}function interpolate(s,a,{clamp:u=!0,ease:l,mixer:f}={}){const c=s.length;if(invariant(c===a.length),c===1)return()=>a[0];if(c===2&&s[0]===s[1])return()=>a[1];s[0]>s[c-1]&&(s=[...s].reverse(),a=[...a].reverse());const h=createMixers(a,l,f),p=h.length,v=y=>{let b=0;if(p>1)for(;b<s.length-2&&!(y<s[b+1]);b++);const S=progress(s[b],s[b+1],y);return h[b](S)};return u?y=>v(clamp(s[0],s[c-1],y)):v}function fillOffset(s,a){const u=s[s.length-1];for(let l=1;l<=a;l++){const f=progress(0,a,l);s.push(mixNumber$1(u,1,f))}}function defaultOffset(s){const a=[0];return fillOffset(a,s.length-1),a}function convertOffsetToTimes(s,a){return s.map(u=>u*a)}function defaultEasing(s,a){return s.map(()=>a||easeInOut).splice(0,s.length-1)}function keyframes({duration:s=300,keyframes:a,times:u,ease:l="easeInOut"}){const f=isEasingArray(l)?l.map(easingDefinitionToFunction):easingDefinitionToFunction(l),c={done:!1,value:a[0]},h=convertOffsetToTimes(u&&u.length===a.length?u:defaultOffset(a),s),p=interpolate(h,a,{ease:Array.isArray(f)?f:defaultEasing(a,f)});return{calculatedDuration:s,next:v=>(c.value=p(v),c.done=v>=s,c)}}const frameloopDriver=s=>{const a=({timestamp:u})=>s(u);return{start:()=>frame.update(a,!0),stop:()=>cancelFrame(a),now:()=>frameData.isProcessing?frameData.timestamp:time.now()}},generators={decay:inertia,inertia,tween:keyframes,keyframes,spring},percentToProgress=s=>s/100;class MainThreadAnimation extends BaseAnimation{constructor(a){super(a),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:v}=this.options;v&&v()};const{name:u,motionValue:l,element:f,keyframes:c}=this.options,h=(f==null?void 0:f.KeyframeResolver)||KeyframeResolver,p=(v,y)=>this.onKeyframesResolved(v,y);this.resolver=new h(c,p,u,l,f),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(a){const{type:u="keyframes",repeat:l=0,repeatDelay:f=0,repeatType:c,velocity:h=0}=this.options,p=isGenerator(u)?u:generators[u]||keyframes;let v,y;p!==keyframes&&typeof a[0]!="number"&&(v=pipe(percentToProgress,mix(a[0],a[1])),a=[0,100]);const b=p({...this.options,keyframes:a});c==="mirror"&&(y=p({...this.options,keyframes:[...a].reverse(),velocity:-h})),b.calculatedDuration===null&&(b.calculatedDuration=calcGeneratorDuration(b));const{calculatedDuration:S}=b,E=S+f,R=E*(l+1)-f;return{generator:b,mirroredGenerator:y,mapPercentToKeyframes:v,calculatedDuration:S,resolvedDuration:E,totalDuration:R}}onPostResolved(){const{autoplay:a=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!a?this.pause():this.state=this.pendingPlayState}tick(a,u=!1){const{resolved:l}=this;if(!l){const{keyframes:J}=this.options;return{done:!0,value:J[J.length-1]}}const{finalKeyframe:f,generator:c,mirroredGenerator:h,mapPercentToKeyframes:p,keyframes:v,calculatedDuration:y,totalDuration:b,resolvedDuration:S}=l;if(this.startTime===null)return c.next(0);const{delay:E,repeat:R,repeatType:O,repeatDelay:I,onUpdate:B}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,a):this.speed<0&&(this.startTime=Math.min(a-b/this.speed,this.startTime)),u?this.currentTime=a:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(a-this.startTime)*this.speed;const N=this.currentTime-E*(this.speed>=0?1:-1),D=this.speed>=0?N<0:N>b;this.currentTime=Math.max(N,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=b);let G=this.currentTime,V=c;if(R){const J=Math.min(this.currentTime,b)/S;let Q=Math.floor(J),ee=J%1;!ee&&J>=1&&(ee=1),ee===1&&Q--,Q=Math.min(Q,R+1),!!(Q%2)&&(O==="reverse"?(ee=1-ee,I&&(ee-=I/S)):O==="mirror"&&(V=h)),G=clamp(0,1,ee)*S}const U=D?{done:!1,value:v[0]}:V.next(G);p&&(U.value=p(U.value));let{done:te}=U;!D&&y!==null&&(te=this.speed>=0?this.currentTime>=b:this.currentTime<=0);const Z=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&te);return Z&&f!==void 0&&(U.value=getFinalKeyframe(v,this.options,f)),B&&B(U.value),Z&&this.finish(),U}get duration(){const{resolved:a}=this;return a?millisecondsToSeconds(a.calculatedDuration):0}get time(){return millisecondsToSeconds(this.currentTime)}set time(a){a=secondsToMilliseconds(a),this.currentTime=a,this.holdTime!==null||this.speed===0?this.holdTime=a:this.driver&&(this.startTime=this.driver.now()-a/this.speed)}get speed(){return this.playbackSpeed}set speed(a){const u=this.playbackSpeed!==a;this.playbackSpeed=a,u&&(this.time=millisecondsToSeconds(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:a=frameloopDriver,onPlay:u,startTime:l}=this.options;this.driver||(this.driver=a(c=>this.tick(c))),u&&u();const f=this.driver.now();this.holdTime!==null?this.startTime=f-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=f):this.startTime=l??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var a;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(a=this.currentTime)!==null&&a!==void 0?a:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:a}=this.options;a&&a()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(a){return this.startTime=0,this.tick(a,!0)}}const acceleratedValues=new Set(["opacity","clipPath","filter","transform"]);function memo(s){let a;return()=>(a===void 0&&(a=s()),a)}const supportsFlags={linearEasing:void 0};function memoSupports(s,a){const u=memo(s);return()=>{var l;return(l=supportsFlags[a])!==null&&l!==void 0?l:u()}}const supportsLinearEasing=memoSupports(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");function isWaapiSupportedEasing(s){return!!(typeof s=="function"&&supportsLinearEasing()||!s||typeof s=="string"&&(s in supportedWaapiEasing||supportsLinearEasing())||isBezierDefinition(s)||Array.isArray(s)&&s.every(isWaapiSupportedEasing))}const cubicBezierAsString=([s,a,u,l])=>`cubic-bezier(${s}, ${a}, ${u}, ${l})`,supportedWaapiEasing={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:cubicBezierAsString([0,.65,.55,1]),circOut:cubicBezierAsString([.55,0,1,.45]),backIn:cubicBezierAsString([.31,.01,.66,-.59]),backOut:cubicBezierAsString([.33,1.53,.69,.99])};function mapEasingToNativeEasing(s,a){if(s)return typeof s=="function"&&supportsLinearEasing()?generateLinearEasing(s,a):isBezierDefinition(s)?cubicBezierAsString(s):Array.isArray(s)?s.map(u=>mapEasingToNativeEasing(u,a)||supportedWaapiEasing.easeOut):supportedWaapiEasing[s]}function startWaapiAnimation(s,a,u,{delay:l=0,duration:f=300,repeat:c=0,repeatType:h="loop",ease:p="easeInOut",times:v}={}){const y={[a]:u};v&&(y.offset=v);const b=mapEasingToNativeEasing(p,f);return Array.isArray(b)&&(y.easing=b),s.animate(y,{delay:l,duration:f,easing:Array.isArray(b)?"linear":b,fill:"both",iterations:c+1,direction:h==="reverse"?"alternate":"normal"})}function attachTimeline(s,a){s.timeline=a,s.onfinish=null}const supportsWaapi=memo(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),sampleDelta=10,maxDuration=2e4;function requiresPregeneratedKeyframes(s){return isGenerator(s.type)||s.type==="spring"||!isWaapiSupportedEasing(s.ease)}function pregenerateKeyframes(s,a){const u=new MainThreadAnimation({...a,keyframes:s,repeat:0,delay:0,isGenerator:!0});let l={done:!1,value:s[0]};const f=[];let c=0;for(;!l.done&&c<maxDuration;)l=u.sample(c),f.push(l.value),c+=sampleDelta;return{times:void 0,keyframes:f,duration:c-sampleDelta,ease:"linear"}}const unsupportedEasingFunctions={anticipate,backInOut,circInOut};function isUnsupportedEase(s){return s in unsupportedEasingFunctions}class AcceleratedAnimation extends BaseAnimation{constructor(a){super(a);const{name:u,motionValue:l,element:f,keyframes:c}=this.options;this.resolver=new DOMKeyframesResolver(c,(h,p)=>this.onKeyframesResolved(h,p),u,l,f),this.resolver.scheduleResolve()}initPlayback(a,u){var l;let{duration:f=300,times:c,ease:h,type:p,motionValue:v,name:y,startTime:b}=this.options;if(!(!((l=v.owner)===null||l===void 0)&&l.current))return!1;if(typeof h=="string"&&supportsLinearEasing()&&isUnsupportedEase(h)&&(h=unsupportedEasingFunctions[h]),requiresPregeneratedKeyframes(this.options)){const{onComplete:E,onUpdate:R,motionValue:O,element:I,...B}=this.options,N=pregenerateKeyframes(a,B);a=N.keyframes,a.length===1&&(a[1]=a[0]),f=N.duration,c=N.times,h=N.ease,p="keyframes"}const S=startWaapiAnimation(v.owner.current,y,a,{...this.options,duration:f,times:c,ease:h});return S.startTime=b??this.calcStartTime(),this.pendingTimeline?(attachTimeline(S,this.pendingTimeline),this.pendingTimeline=void 0):S.onfinish=()=>{const{onComplete:E}=this.options;v.set(getFinalKeyframe(a,this.options,u)),E&&E(),this.cancel(),this.resolveFinishedPromise()},{animation:S,duration:f,times:c,type:p,ease:h,keyframes:a}}get duration(){const{resolved:a}=this;if(!a)return 0;const{duration:u}=a;return millisecondsToSeconds(u)}get time(){const{resolved:a}=this;if(!a)return 0;const{animation:u}=a;return millisecondsToSeconds(u.currentTime||0)}set time(a){const{resolved:u}=this;if(!u)return;const{animation:l}=u;l.currentTime=secondsToMilliseconds(a)}get speed(){const{resolved:a}=this;if(!a)return 1;const{animation:u}=a;return u.playbackRate}set speed(a){const{resolved:u}=this;if(!u)return;const{animation:l}=u;l.playbackRate=a}get state(){const{resolved:a}=this;if(!a)return"idle";const{animation:u}=a;return u.playState}get startTime(){const{resolved:a}=this;if(!a)return null;const{animation:u}=a;return u.startTime}attachTimeline(a){if(!this._resolved)this.pendingTimeline=a;else{const{resolved:u}=this;if(!u)return noop$1;const{animation:l}=u;attachTimeline(l,a)}return noop$1}play(){if(this.isStopped)return;const{resolved:a}=this;if(!a)return;const{animation:u}=a;u.playState==="finished"&&this.updateFinishedPromise(),u.play()}pause(){const{resolved:a}=this;if(!a)return;const{animation:u}=a;u.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:a}=this;if(!a)return;const{animation:u,keyframes:l,duration:f,type:c,ease:h,times:p}=a;if(u.playState==="idle"||u.playState==="finished")return;if(this.time){const{motionValue:y,onUpdate:b,onComplete:S,element:E,...R}=this.options,O=new MainThreadAnimation({...R,keyframes:l,duration:f,type:c,ease:h,times:p,isGenerator:!0}),I=secondsToMilliseconds(this.time);y.setWithVelocity(O.sample(I-sampleDelta).value,O.sample(I).value,sampleDelta)}const{onStop:v}=this.options;v&&v(),this.cancel()}complete(){const{resolved:a}=this;a&&a.animation.finish()}cancel(){const{resolved:a}=this;a&&a.animation.cancel()}static supports(a){const{motionValue:u,name:l,repeatDelay:f,repeatType:c,damping:h,type:p}=a;return supportsWaapi()&&l&&acceleratedValues.has(l)&&u&&u.owner&&u.owner.current instanceof HTMLElement&&!u.owner.getProps().onUpdate&&!f&&c!=="mirror"&&h!==0&&p!=="inertia"}}const supportsScrollTimeline=memo(()=>window.ScrollTimeline!==void 0);class GroupPlaybackControls{constructor(a){this.stop=()=>this.runAll("stop"),this.animations=a.filter(Boolean)}then(a,u){return Promise.all(this.animations).then(a).catch(u)}getAll(a){return this.animations[0][a]}setAll(a,u){for(let l=0;l<this.animations.length;l++)this.animations[l][a]=u}attachTimeline(a,u){const l=this.animations.map(f=>supportsScrollTimeline()&&f.attachTimeline?f.attachTimeline(a):u(f));return()=>{l.forEach((f,c)=>{f&&f(),this.animations[c].stop()})}}get time(){return this.getAll("time")}set time(a){this.setAll("time",a)}get speed(){return this.getAll("speed")}set speed(a){this.setAll("speed",a)}get startTime(){return this.getAll("startTime")}get duration(){let a=0;for(let u=0;u<this.animations.length;u++)a=Math.max(a,this.animations[u].duration);return a}runAll(a){this.animations.forEach(u=>u[a]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function isTransitionDefined({when:s,delay:a,delayChildren:u,staggerChildren:l,staggerDirection:f,repeat:c,repeatType:h,repeatDelay:p,from:v,elapsed:y,...b}){return!!Object.keys(b).length}const animateMotionValue=(s,a,u,l={},f,c)=>h=>{const p=getValueTransition(l,s)||{},v=p.delay||l.delay||0;let{elapsed:y=0}=l;y=y-secondsToMilliseconds(v);let b={keyframes:Array.isArray(u)?u:[null,u],ease:"easeOut",velocity:a.getVelocity(),...p,delay:-y,onUpdate:E=>{a.set(E),p.onUpdate&&p.onUpdate(E)},onComplete:()=>{h(),p.onComplete&&p.onComplete()},name:s,motionValue:a,element:c?void 0:f};isTransitionDefined(p)||(b={...b,...getDefaultTransition(s,b)}),b.duration&&(b.duration=secondsToMilliseconds(b.duration)),b.repeatDelay&&(b.repeatDelay=secondsToMilliseconds(b.repeatDelay)),b.from!==void 0&&(b.keyframes[0]=b.from);let S=!1;if((b.type===!1||b.duration===0&&!b.repeatDelay)&&(b.duration=0,b.delay===0&&(S=!0)),S&&!c&&a.get()!==void 0){const E=getFinalKeyframe(b.keyframes,p);if(E!==void 0)return frame.update(()=>{b.onUpdate(E),b.onComplete()}),new GroupPlaybackControls([])}return!c&&AcceleratedAnimation.supports(b)?new AcceleratedAnimation(b):new MainThreadAnimation(b)},isCustomValue=s=>!!(s&&typeof s=="object"&&s.mix&&s.toValue),resolveFinalValueInKeyframes=s=>isKeyframesTarget(s)?s[s.length-1]||0:s;function addUniqueItem(s,a){s.indexOf(a)===-1&&s.push(a)}function removeItem(s,a){const u=s.indexOf(a);u>-1&&s.splice(u,1)}class SubscriptionManager{constructor(){this.subscriptions=[]}add(a){return addUniqueItem(this.subscriptions,a),()=>removeItem(this.subscriptions,a)}notify(a,u,l){const f=this.subscriptions.length;if(f)if(f===1)this.subscriptions[0](a,u,l);else for(let c=0;c<f;c++){const h=this.subscriptions[c];h&&h(a,u,l)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const MAX_VELOCITY_DELTA=30,isFloat=s=>!isNaN(parseFloat(s));class MotionValue{constructor(a,u={}){this.version="11.15.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(l,f=!0)=>{const c=time.now();this.updatedAt!==c&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(l),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),f&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(a),this.owner=u.owner}setCurrent(a){this.current=a,this.updatedAt=time.now(),this.canTrackVelocity===null&&a!==void 0&&(this.canTrackVelocity=isFloat(this.current))}setPrevFrameValue(a=this.current){this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt}onChange(a){return this.on("change",a)}on(a,u){this.events[a]||(this.events[a]=new SubscriptionManager);const l=this.events[a].add(u);return a==="change"?()=>{l(),frame.read(()=>{this.events.change.getSize()||this.stop()})}:l}clearListeners(){for(const a in this.events)this.events[a].clear()}attach(a,u){this.passiveEffect=a,this.stopPassiveEffect=u}set(a,u=!0){!u||!this.passiveEffect?this.updateAndNotify(a,u):this.passiveEffect(a,this.updateAndNotify)}setWithVelocity(a,u,l){this.set(u),this.prev=void 0,this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt-l}jump(a,u=!0){this.updateAndNotify(a),this.prev=a,this.prevUpdatedAt=this.prevFrameValue=void 0,u&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const a=time.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||a-this.updatedAt>MAX_VELOCITY_DELTA)return 0;const u=Math.min(this.updatedAt-this.prevUpdatedAt,MAX_VELOCITY_DELTA);return velocityPerSecond(parseFloat(this.current)-parseFloat(this.prevFrameValue),u)}start(a){return this.stop(),new Promise(u=>{this.hasAnimated=!0,this.animation=a(u),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 motionValue(s,a){return new MotionValue(s,a)}function setMotionValue(s,a,u){s.hasValue(a)?s.getValue(a).set(u):s.addValue(a,motionValue(u))}function setTarget(s,a){const u=resolveVariant(s,a);let{transitionEnd:l={},transition:f={},...c}=u||{};c={...c,...l};for(const h in c){const p=resolveFinalValueInKeyframes(c[h]);setMotionValue(s,h,p)}}const camelToDash=s=>s.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),optimizedAppearDataId="framerAppearId",optimizedAppearDataAttribute="data-"+camelToDash(optimizedAppearDataId);function getOptimisedAppearId(s){return s.props[optimizedAppearDataAttribute]}const isMotionValue=s=>!!(s&&s.getVelocity);function isWillChangeMotionValue(s){return!!(isMotionValue(s)&&s.add)}function addValueToWillChange(s,a){const u=s.getValue("willChange");if(isWillChangeMotionValue(u))return u.add(a)}function shouldBlockAnimation({protectedKeys:s,needsAnimating:a},u){const l=s.hasOwnProperty(u)&&a[u]!==!0;return a[u]=!1,l}function animateTarget(s,a,{delay:u=0,transitionOverride:l,type:f}={}){var c;let{transition:h=s.getDefaultTransition(),transitionEnd:p,...v}=a;l&&(h=l);const y=[],b=f&&s.animationState&&s.animationState.getState()[f];for(const S in v){const E=s.getValue(S,(c=s.latestValues[S])!==null&&c!==void 0?c:null),R=v[S];if(R===void 0||b&&shouldBlockAnimation(b,S))continue;const O={delay:u,...getValueTransition(h||{},S)};let I=!1;if(window.MotionHandoffAnimation){const N=getOptimisedAppearId(s);if(N){const D=window.MotionHandoffAnimation(N,S,frame);D!==null&&(O.startTime=D,I=!0)}}addValueToWillChange(s,S),E.start(animateMotionValue(S,E,R,s.shouldReduceMotion&&transformProps.has(S)?{type:!1}:O,s,I));const B=E.animation;B&&y.push(B)}return p&&Promise.all(y).then(()=>{frame.update(()=>{p&&setTarget(s,p)})}),y}function animateVariant(s,a,u={}){var l;const f=resolveVariant(s,a,u.type==="exit"?(l=s.presenceContext)===null||l===void 0?void 0:l.custom:void 0);let{transition:c=s.getDefaultTransition()||{}}=f||{};u.transitionOverride&&(c=u.transitionOverride);const h=f?()=>Promise.all(animateTarget(s,f,u)):()=>Promise.resolve(),p=s.variantChildren&&s.variantChildren.size?(y=0)=>{const{delayChildren:b=0,staggerChildren:S,staggerDirection:E}=c;return animateChildren(s,a,b+y,S,E,u)}:()=>Promise.resolve(),{when:v}=c;if(v){const[y,b]=v==="beforeChildren"?[h,p]:[p,h];return y().then(()=>b())}else return Promise.all([h(),p(u.delay)])}function animateChildren(s,a,u=0,l=0,f=1,c){const h=[],p=(s.variantChildren.size-1)*l,v=f===1?(y=0)=>y*l:(y=0)=>p-y*l;return Array.from(s.variantChildren).sort(sortByTreeOrder).forEach((y,b)=>{y.notify("AnimationStart",a),h.push(animateVariant(y,a,{...c,delay:u+v(b)}).then(()=>y.notify("AnimationComplete",a)))}),Promise.all(h)}function sortByTreeOrder(s,a){return s.sortNodePosition(a)}function animateVisualElement(s,a,u={}){s.notify("AnimationStart",a);let l;if(Array.isArray(a)){const f=a.map(c=>animateVariant(s,c,u));l=Promise.all(f)}else if(typeof a=="string")l=animateVariant(s,a,u);else{const f=typeof a=="function"?resolveVariant(s,a,u.custom):a;l=Promise.all(animateTarget(s,f,u))}return l.then(()=>{s.notify("AnimationComplete",a)})}const numVariantProps=variantProps.length;function getVariantContext(s){if(!s)return;if(!s.isControllingVariants){const u=s.parent?getVariantContext(s.parent)||{}:{};return s.props.initial!==void 0&&(u.initial=s.props.initial),u}const a={};for(let u=0;u<numVariantProps;u++){const l=variantProps[u],f=s.props[l];(isVariantLabel(f)||f===!1)&&(a[l]=f)}return a}const reversePriorityOrder=[...variantPriorityOrder].reverse(),numAnimationTypes=variantPriorityOrder.length;function animateList(s){return a=>Promise.all(a.map(({animation:u,options:l})=>animateVisualElement(s,u,l)))}function createAnimationState(s){let a=animateList(s),u=createState(),l=!0;const f=v=>(y,b)=>{var S;const E=resolveVariant(s,b,v==="exit"?(S=s.presenceContext)===null||S===void 0?void 0:S.custom:void 0);if(E){const{transition:R,transitionEnd:O,...I}=E;y={...y,...I,...O}}return y};function c(v){a=v(s)}function h(v){const{props:y}=s,b=getVariantContext(s.parent)||{},S=[],E=new Set;let R={},O=1/0;for(let B=0;B<numAnimationTypes;B++){const N=reversePriorityOrder[B],D=u[N],G=y[N]!==void 0?y[N]:b[N],V=isVariantLabel(G),U=N===v?D.isActive:null;U===!1&&(O=B);let te=G===b[N]&&G!==y[N]&&V;if(te&&l&&s.manuallyAnimateOnMount&&(te=!1),D.protectedKeys={...R},!D.isActive&&U===null||!G&&!D.prevProp||isAnimationControls(G)||typeof G=="boolean")continue;const Z=checkVariantsDidChange(D.prevProp,G);let J=Z||N===v&&D.isActive&&!te&&V||B>O&&V,Q=!1;const ee=Array.isArray(G)?G:[G];let k=ee.reduce(f(N),{});U===!1&&(k={});const{prevResolvedValues:d={}}=D,g={...d,...k},_=P=>{J=!0,E.has(P)&&(Q=!0,E.delete(P)),D.needsAnimating[P]=!0;const $=s.getValue(P);$&&($.liveStyle=!1)};for(const P in g){const $=k[P],T=d[P];if(R.hasOwnProperty(P))continue;let m=!1;isKeyframesTarget($)&&isKeyframesTarget(T)?m=!shallowCompare($,T):m=$!==T,m?$!=null?_(P):E.add(P):$!==void 0&&E.has(P)?_(P):D.protectedKeys[P]=!0}D.prevProp=G,D.prevResolvedValues=k,D.isActive&&(R={...R,...k}),l&&s.blockInitialAnimation&&(J=!1),J&&(!(te&&Z)||Q)&&S.push(...ee.map(P=>({animation:P,options:{type:N}})))}if(E.size){const B={};E.forEach(N=>{const D=s.getBaseTarget(N),G=s.getValue(N);G&&(G.liveStyle=!0),B[N]=D??null}),S.push({animation:B})}let I=!!S.length;return l&&(y.initial===!1||y.initial===y.animate)&&!s.manuallyAnimateOnMount&&(I=!1),l=!1,I?a(S):Promise.resolve()}function p(v,y){var b;if(u[v].isActive===y)return Promise.resolve();(b=s.variantChildren)===null||b===void 0||b.forEach(E=>{var R;return(R=E.animationState)===null||R===void 0?void 0:R.setActive(v,y)}),u[v].isActive=y;const S=h(v);for(const E in u)u[E].protectedKeys={};return S}return{animateChanges:h,setActive:p,setAnimateFunction:c,getState:()=>u,reset:()=>{u=createState(),l=!0}}}function checkVariantsDidChange(s,a){return typeof a=="string"?a!==s:Array.isArray(a)?!shallowCompare(a,s):!1}function createTypeState(s=!1){return{isActive:s,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function createState(){return{animate:createTypeState(!0),whileInView:createTypeState(),whileHover:createTypeState(),whileTap:createTypeState(),whileDrag:createTypeState(),whileFocus:createTypeState(),exit:createTypeState()}}class Feature{constructor(a){this.isMounted=!1,this.node=a}update(){}}class AnimationFeature extends Feature{constructor(a){super(a),a.animationState||(a.animationState=createAnimationState(a))}updateAnimationControlsSubscription(){const{animate:a}=this.node.getProps();isAnimationControls(a)&&(this.unmountControls=a.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:a}=this.node.getProps(),{animate:u}=this.node.prevProps||{};a!==u&&this.updateAnimationControlsSubscription()}unmount(){var a;this.node.animationState.reset(),(a=this.unmountControls)===null||a===void 0||a.call(this)}}let id$3=0;class ExitAnimationFeature extends Feature{constructor(){super(...arguments),this.id=id$3++}update(){if(!this.node.presenceContext)return;const{isPresent:a,onExitComplete:u}=this.node.presenceContext,{isPresent:l}=this.node.prevPresenceContext||{};if(!this.node.animationState||a===l)return;const f=this.node.animationState.setActive("exit",!a);u&&!a&&f.then(()=>u(this.id))}mount(){const{register:a}=this.node.presenceContext||{};a&&(this.unmount=a(this.id))}unmount(){}}const animations={animation:{Feature:AnimationFeature},exit:{Feature:ExitAnimationFeature}},isDragging={x:!1,y:!1};function isDragActive(){return isDragging.x||isDragging.y}function resolveElements(s,a,u){var l;if(s instanceof Element)return[s];if(typeof s=="string"){let f=document;const c=(l=void 0)!==null&&l!==void 0?l:f.querySelectorAll(s);return c?Array.from(c):[]}return Array.from(s)}function setupGesture(s,a){const u=resolveElements(s),l=new AbortController,f={passive:!0,...a,signal:l.signal};return[u,f,()=>l.abort()]}function filterEvents$1(s){return a=>{a.pointerType==="touch"||isDragActive()||s(a)}}function hover(s,a,u={}){const[l,f,c]=setupGesture(s,u),h=filterEvents$1(p=>{const{target:v}=p,y=a(p);if(!y||!v)return;const b=filterEvents$1(S=>{y(S),v.removeEventListener("pointerleave",b)});v.addEventListener("pointerleave",b,f)});return l.forEach(p=>{p.addEventListener("pointerenter",h,f)}),c}const isPrimaryPointer=s=>s.pointerType==="mouse"?typeof s.button!="number"||s.button<=0:s.isPrimary!==!1,isPressing=new WeakSet;function filterEvents(s){return a=>{a.key==="Enter"&&s(a)}}function firePointerEvent(s,a){s.dispatchEvent(new PointerEvent("pointer"+a,{isPrimary:!0,bubbles:!0}))}const enableKeyboardPress=(s,a)=>{const u=s.currentTarget;if(!u)return;const l=filterEvents(()=>{if(isPressing.has(u))return;firePointerEvent(u,"down");const f=filterEvents(()=>{firePointerEvent(u,"up")}),c=()=>firePointerEvent(u,"cancel");u.addEventListener("keyup",f,a),u.addEventListener("blur",c,a)});u.addEventListener("keydown",l,a),u.addEventListener("blur",()=>u.removeEventListener("keydown",l),a)},focusableElements=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function isElementKeyboardAccessible(s){return focusableElements.has(s.tagName)||s.tabIndex!==-1}const isNodeOrChild=(s,a)=>a?s===a?!0:isNodeOrChild(s,a.parentElement):!1;function isValidPressEvent(s){return isPrimaryPointer(s)&&!isDragActive()}function press(s,a,u={}){const[l,f,c]=setupGesture(s,u),h=p=>{const v=p.currentTarget;if(!isValidPressEvent(p)||isPressing.has(v))return;isPressing.add(v);const y=a(p),b=(R,O)=>{window.removeEventListener("pointerup",S),window.removeEventListener("pointercancel",E),!(!isValidPressEvent(R)||!isPressing.has(v))&&(isPressing.delete(v),y&&y(R,{success:O}))},S=R=>{b(R,u.useGlobalTarget||isNodeOrChild(v,R.target))},E=R=>{b(R,!1)};window.addEventListener("pointerup",S,f),window.addEventListener("pointercancel",E,f)};return l.forEach(p=>{isElementKeyboardAccessible(p)||(p.tabIndex=0),(u.useGlobalTarget?window:p).addEventListener("pointerdown",h,f),p.addEventListener("focus",y=>enableKeyboardPress(y,f),f)}),c}function setDragLock(s){return s==="x"||s==="y"?isDragging[s]?null:(isDragging[s]=!0,()=>{isDragging[s]=!1}):isDragging.x||isDragging.y?null:(isDragging.x=isDragging.y=!0,()=>{isDragging.x=isDragging.y=!1})}function extractEventInfo(s){return{point:{x:s.pageX,y:s.pageY}}}const addPointerInfo=s=>a=>isPrimaryPointer(a)&&s(a,extractEventInfo(a));function addDomEvent(s,a,u,l={passive:!0}){return s.addEventListener(a,u,l),()=>s.removeEventListener(a,u)}function addPointerEvent(s,a,u,l){return addDomEvent(s,a,addPointerInfo(u),l)}const distance=(s,a)=>Math.abs(s-a);function distance2D(s,a){const u=distance(s.x,a.x),l=distance(s.y,a.y);return Math.sqrt(u**2+l**2)}class PanSession{constructor(a,u,{transformPagePoint:l,contextWindow:f,dragSnapToOrigin:c=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const S=getPanInfo(this.lastMoveEventInfo,this.history),E=this.startEvent!==null,R=distance2D(S.offset,{x:0,y:0})>=3;if(!E&&!R)return;const{point:O}=S,{timestamp:I}=frameData;this.history.push({...O,timestamp:I});const{onStart:B,onMove:N}=this.handlers;E||(B&&B(this.lastMoveEvent,S),this.startEvent=this.lastMoveEvent),N&&N(this.lastMoveEvent,S)},this.handlePointerMove=(S,E)=>{this.lastMoveEvent=S,this.lastMoveEventInfo=transformPoint(E,this.transformPagePoint),frame.update(this.updatePoint,!0)},this.handlePointerUp=(S,E)=>{this.end();const{onEnd:R,onSessionEnd:O,resumeAnimation:I}=this.handlers;if(this.dragSnapToOrigin&&I&&I(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const B=getPanInfo(S.type==="pointercancel"?this.lastMoveEventInfo:transformPoint(E,this.transformPagePoint),this.history);this.startEvent&&R&&R(S,B),O&&O(S,B)},!isPrimaryPointer(a))return;this.dragSnapToOrigin=c,this.handlers=u,this.transformPagePoint=l,this.contextWindow=f||window;const h=extractEventInfo(a),p=transformPoint(h,this.transformPagePoint),{point:v}=p,{timestamp:y}=frameData;this.history=[{...v,timestamp:y}];const{onSessionStart:b}=u;b&&b(a,getPanInfo(p,this.history)),this.removeListeners=pipe(addPointerEvent(this.contextWindow,"pointermove",this.handlePointerMove),addPointerEvent(this.contextWindow,"pointerup",this.handlePointerUp),addPointerEvent(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(a){this.handlers=a}end(){this.removeListeners&&this.removeListeners(),cancelFrame(this.updatePoint)}}function transformPoint(s,a){return a?{point:a(s.point)}:s}function subtractPoint(s,a){return{x:s.x-a.x,y:s.y-a.y}}function getPanInfo({point:s},a){return{point:s,delta:subtractPoint(s,lastDevicePoint(a)),offset:subtractPoint(s,startDevicePoint(a)),velocity:getVelocity(a,.1)}}function startDevicePoint(s){return s[0]}function lastDevicePoint(s){return s[s.length-1]}function getVelocity(s,a){if(s.length<2)return{x:0,y:0};let u=s.length-1,l=null;const f=lastDevicePoint(s);for(;u>=0&&(l=s[u],!(f.timestamp-l.timestamp>secondsToMilliseconds(a)));)u--;if(!l)return{x:0,y:0};const c=millisecondsToSeconds(f.timestamp-l.timestamp);if(c===0)return{x:0,y:0};const h={x:(f.x-l.x)/c,y:(f.y-l.y)/c};return h.x===1/0&&(h.x=0),h.y===1/0&&(h.y=0),h}function isRefObject(s){return s&&typeof s=="object"&&Object.prototype.hasOwnProperty.call(s,"current")}const SCALE_PRECISION=1e-4,SCALE_MIN=1-SCALE_PRECISION,SCALE_MAX=1+SCALE_PRECISION,TRANSLATE_PRECISION=.01,TRANSLATE_MIN=0-TRANSLATE_PRECISION,TRANSLATE_MAX=0+TRANSLATE_PRECISION;function calcLength(s){return s.max-s.min}function isNear(s,a,u){return Math.abs(s-a)<=u}function calcAxisDelta(s,a,u,l=.5){s.origin=l,s.originPoint=mixNumber$1(a.min,a.max,s.origin),s.scale=calcLength(u)/calcLength(a),s.translate=mixNumber$1(u.min,u.max,s.origin)-s.originPoint,(s.scale>=SCALE_MIN&&s.scale<=SCALE_MAX||isNaN(s.scale))&&(s.scale=1),(s.translate>=TRANSLATE_MIN&&s.translate<=TRANSLATE_MAX||isNaN(s.translate))&&(s.translate=0)}function calcBoxDelta(s,a,u,l){calcAxisDelta(s.x,a.x,u.x,l?l.originX:void 0),calcAxisDelta(s.y,a.y,u.y,l?l.originY:void 0)}function calcRelativeAxis(s,a,u){s.min=u.min+a.min,s.max=s.min+calcLength(a)}function calcRelativeBox(s,a,u){calcRelativeAxis(s.x,a.x,u.x),calcRelativeAxis(s.y,a.y,u.y)}function calcRelativeAxisPosition(s,a,u){s.min=a.min-u.min,s.max=s.min+calcLength(a)}function calcRelativePosition(s,a,u){calcRelativeAxisPosition(s.x,a.x,u.x),calcRelativeAxisPosition(s.y,a.y,u.y)}function applyConstraints(s,{min:a,max:u},l){return a!==void 0&&s<a?s=l?mixNumber$1(a,s,l.min):Math.max(s,a):u!==void 0&&s>u&&(s=l?mixNumber$1(u,s,l.max):Math.min(s,u)),s}function calcRelativeAxisConstraints(s,a,u){return{min:a!==void 0?s.min+a:void 0,max:u!==void 0?s.max+u-(s.max-s.min):void 0}}function calcRelativeConstraints(s,{top:a,left:u,bottom:l,right:f}){return{x:calcRelativeAxisConstraints(s.x,u,f),y:calcRelativeAxisConstraints(s.y,a,l)}}function calcViewportAxisConstraints(s,a){let u=a.min-s.min,l=a.max-s.max;return a.max-a.min<s.max-s.min&&([u,l]=[l,u]),{min:u,max:l}}function calcViewportConstraints(s,a){return{x:calcViewportAxisConstraints(s.x,a.x),y:calcViewportAxisConstraints(s.y,a.y)}}function calcOrigin$1(s,a){let u=.5;const l=calcLength(s),f=calcLength(a);return f>l?u=progress(a.min,a.max-l,s.min):l>f&&(u=progress(s.min,s.max-f,a.min)),clamp(0,1,u)}function rebaseAxisConstraints(s,a){const u={};return a.min!==void 0&&(u.min=a.min-s.min),a.max!==void 0&&(u.max=a.max-s.min),u}const defaultElastic=.35;function resolveDragElastic(s=defaultElastic){return s===!1?s=0:s===!0&&(s=defaultElastic),{x:resolveAxisElastic(s,"left","right"),y:resolveAxisElastic(s,"top","bottom")}}function resolveAxisElastic(s,a,u){return{min:resolvePointElastic(s,a),max:resolvePointElastic(s,u)}}function resolvePointElastic(s,a){return typeof s=="number"?s:s[a]||0}const createAxisDelta=()=>({translate:0,scale:1,origin:0,originPoint:0}),createDelta=()=>({x:createAxisDelta(),y:createAxisDelta()}),createAxis=()=>({min:0,max:0}),createBox=()=>({x:createAxis(),y:createAxis()});function eachAxis(s){return[s("x"),s("y")]}function convertBoundingBoxToBox({top:s,left:a,right:u,bottom:l}){return{x:{min:a,max:u},y:{min:s,max:l}}}function convertBoxToBoundingBox({x:s,y:a}){return{top:a.min,right:s.max,bottom:a.max,left:s.min}}function transformBoxPoints(s,a){if(!a)return s;const u=a({x:s.left,y:s.top}),l=a({x:s.right,y:s.bottom});return{top:u.y,left:u.x,bottom:l.y,right:l.x}}function isIdentityScale(s){return s===void 0||s===1}function hasScale({scale:s,scaleX:a,scaleY:u}){return!isIdentityScale(s)||!isIdentityScale(a)||!isIdentityScale(u)}function hasTransform(s){return hasScale(s)||has2DTranslate(s)||s.z||s.rotate||s.rotateX||s.rotateY||s.skewX||s.skewY}function has2DTranslate(s){return is2DTranslate(s.x)||is2DTranslate(s.y)}function is2DTranslate(s){return s&&s!=="0%"}function scalePoint(s,a,u){const l=s-u,f=a*l;return u+f}function applyPointDelta(s,a,u,l,f){return f!==void 0&&(s=scalePoint(s,f,l)),scalePoint(s,u,l)+a}function applyAxisDelta(s,a=0,u=1,l,f){s.min=applyPointDelta(s.min,a,u,l,f),s.max=applyPointDelta(s.max,a,u,l,f)}function applyBoxDelta(s,{x:a,y:u}){applyAxisDelta(s.x,a.translate,a.scale,a.originPoint),applyAxisDelta(s.y,u.translate,u.scale,u.originPoint)}const TREE_SCALE_SNAP_MIN=.999999999999,TREE_SCALE_SNAP_MAX=1.0000000000001;function applyTreeDeltas(s,a,u,l=!1){const f=u.length;if(!f)return;a.x=a.y=1;let c,h;for(let p=0;p<f;p++){c=u[p],h=c.projectionDelta;const{visualElement:v}=c.options;v&&v.props.style&&v.props.style.display==="contents"||(l&&c.options.layoutScroll&&c.scroll&&c!==c.root&&transformBox(s,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),h&&(a.x*=h.x.scale,a.y*=h.y.scale,applyBoxDelta(s,h)),l&&hasTransform(c.latestValues)&&transformBox(s,c.latestValues))}a.x<TREE_SCALE_SNAP_MAX&&a.x>TREE_SCALE_SNAP_MIN&&(a.x=1),a.y<TREE_SCALE_SNAP_MAX&&a.y>TREE_SCALE_SNAP_MIN&&(a.y=1)}function translateAxis(s,a){s.min=s.min+a,s.max=s.max+a}function transformAxis(s,a,u,l,f=.5){const c=mixNumber$1(s.min,s.max,f);applyAxisDelta(s,a,u,c,l)}function transformBox(s,a){transformAxis(s.x,a.x,a.scaleX,a.scale,a.originX),transformAxis(s.y,a.y,a.scaleY,a.scale,a.originY)}function measureViewportBox(s,a){return convertBoundingBoxToBox(transformBoxPoints(s.getBoundingClientRect(),a))}function measurePageBox(s,a,u){const l=measureViewportBox(s,u),{scroll:f}=a;return f&&(translateAxis(l.x,f.offset.x),translateAxis(l.y,f.offset.y)),l}const getContextWindow=({current:s})=>s?s.ownerDocument.defaultView:null,elementDragControls=new WeakMap;class VisualElementDragControls{constructor(a){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=createBox(),this.visualElement=a}start(a,{snapToCursor:u=!1}={}){const{presenceContext:l}=this.visualElement;if(l&&l.isPresent===!1)return;const f=b=>{const{dragSnapToOrigin:S}=this.getProps();S?this.pauseAnimation():this.stopAnimation(),u&&this.snapToCursor(extractEventInfo(b).point)},c=(b,S)=>{const{drag:E,dragPropagation:R,onDragStart:O}=this.getProps();if(E&&!R&&(this.openDragLock&&this.openDragLock(),this.openDragLock=setDragLock(E),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),eachAxis(B=>{let N=this.getAxisMotionValue(B).get()||0;if(percent.test(N)){const{projection:D}=this.visualElement;if(D&&D.layout){const G=D.layout.layoutBox[B];G&&(N=calcLength(G)*(parseFloat(N)/100))}}this.originPoint[B]=N}),O&&frame.postRender(()=>O(b,S)),addValueToWillChange(this.visualElement,"transform");const{animationState:I}=this.visualElement;I&&I.setActive("whileDrag",!0)},h=(b,S)=>{const{dragPropagation:E,dragDirectionLock:R,onDirectionLock:O,onDrag:I}=this.getProps();if(!E&&!this.openDragLock)return;const{offset:B}=S;if(R&&this.currentDirection===null){this.currentDirection=getCurrentDirection(B),this.currentDirection!==null&&O&&O(this.currentDirection);return}this.updateAxis("x",S.point,B),this.updateAxis("y",S.point,B),this.visualElement.render(),I&&I(b,S)},p=(b,S)=>this.stop(b,S),v=()=>eachAxis(b=>{var S;return this.getAnimationState(b)==="paused"&&((S=this.getAxisMotionValue(b).animation)===null||S===void 0?void 0:S.play())}),{dragSnapToOrigin:y}=this.getProps();this.panSession=new PanSession(a,{onSessionStart:f,onStart:c,onMove:h,onSessionEnd:p,resumeAnimation:v},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:y,contextWindow:getContextWindow(this.visualElement)})}stop(a,u){const l=this.isDragging;if(this.cancel(),!l)return;const{velocity:f}=u;this.startAnimation(f);const{onDragEnd:c}=this.getProps();c&&frame.postRender(()=>c(a,u))}cancel(){this.isDragging=!1;const{projection:a,animationState:u}=this.visualElement;a&&(a.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:l}=this.getProps();!l&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),u&&u.setActive("whileDrag",!1)}updateAxis(a,u,l){const{drag:f}=this.getProps();if(!l||!shouldDrag(a,f,this.currentDirection))return;const c=this.getAxisMotionValue(a);let h=this.originPoint[a]+l[a];this.constraints&&this.constraints[a]&&(h=applyConstraints(h,this.constraints[a],this.elastic[a])),c.set(h)}resolveConstraints(){var a;const{dragConstraints:u,dragElastic:l}=this.getProps(),f=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)===null||a===void 0?void 0:a.layout,c=this.constraints;u&&isRefObject(u)?this.constraints||(this.constraints=this.resolveRefConstraints()):u&&f?this.constraints=calcRelativeConstraints(f.layoutBox,u):this.constraints=!1,this.elastic=resolveDragElastic(l),c!==this.constraints&&f&&this.constraints&&!this.hasMutatedConstraints&&eachAxis(h=>{this.constraints!==!1&&this.getAxisMotionValue(h)&&(this.constraints[h]=rebaseAxisConstraints(f.layoutBox[h],this.constraints[h]))})}resolveRefConstraints(){const{dragConstraints:a,onMeasureDragConstraints:u}=this.getProps();if(!a||!isRefObject(a))return!1;const l=a.current,{projection:f}=this.visualElement;if(!f||!f.layout)return!1;const c=measurePageBox(l,f.root,this.visualElement.getTransformPagePoint());let h=calcViewportConstraints(f.layout.layoutBox,c);if(u){const p=u(convertBoxToBoundingBox(h));this.hasMutatedConstraints=!!p,p&&(h=convertBoundingBoxToBox(p))}return h}startAnimation(a){const{drag:u,dragMomentum:l,dragElastic:f,dragTransition:c,dragSnapToOrigin:h,onDragTransitionEnd:p}=this.getProps(),v=this.constraints||{},y=eachAxis(b=>{if(!shouldDrag(b,u,this.currentDirection))return;let S=v&&v[b]||{};h&&(S={min:0,max:0});const E=f?200:1e6,R=f?40:1e7,O={type:"inertia",velocity:l?a[b]:0,bounceStiffness:E,bounceDamping:R,timeConstant:750,restDelta:1,restSpeed:10,...c,...S};return this.startAxisValueAnimation(b,O)});return Promise.all(y).then(p)}startAxisValueAnimation(a,u){const l=this.getAxisMotionValue(a);return addValueToWillChange(this.visualElement,a),l.start(animateMotionValue(a,l,0,u,this.visualElement,!1))}stopAnimation(){eachAxis(a=>this.getAxisMotionValue(a).stop())}pauseAnimation(){eachAxis(a=>{var u;return(u=this.getAxisMotionValue(a).animation)===null||u===void 0?void 0:u.pause()})}getAnimationState(a){var u;return(u=this.getAxisMotionValue(a).animation)===null||u===void 0?void 0:u.state}getAxisMotionValue(a){const u=`_drag${a.toUpperCase()}`,l=this.visualElement.getProps(),f=l[u];return f||this.visualElement.getValue(a,(l.initial?l.initial[a]:void 0)||0)}snapToCursor(a){eachAxis(u=>{const{drag:l}=this.getProps();if(!shouldDrag(u,l,this.currentDirection))return;const{projection:f}=this.visualElement,c=this.getAxisMotionValue(u);if(f&&f.layout){const{min:h,max:p}=f.layout.layoutBox[u];c.set(a[u]-mixNumber$1(h,p,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:a,dragConstraints:u}=this.getProps(),{projection:l}=this.visualElement;if(!isRefObject(u)||!l||!this.constraints)return;this.stopAnimation();const f={x:0,y:0};eachAxis(h=>{const p=this.getAxisMotionValue(h);if(p&&this.constraints!==!1){const v=p.get();f[h]=calcOrigin$1({min:v,max:v},this.constraints[h])}});const{transformTemplate:c}=this.visualElement.getProps();this.visualElement.current.style.transform=c?c({},""):"none",l.root&&l.root.updateScroll(),l.updateLayout(),this.resolveConstraints(),eachAxis(h=>{if(!shouldDrag(h,a,null))return;const p=this.getAxisMotionValue(h),{min:v,max:y}=this.constraints[h];p.set(mixNumber$1(v,y,f[h]))})}addListeners(){if(!this.visualElement.current)return;elementDragControls.set(this.visualElement,this);const a=this.visualElement.current,u=addPointerEvent(a,"pointerdown",v=>{const{drag:y,dragListener:b=!0}=this.getProps();y&&b&&this.start(v)}),l=()=>{const{dragConstraints:v}=this.getProps();isRefObject(v)&&v.current&&(this.constraints=this.resolveRefConstraints())},{projection:f}=this.visualElement,c=f.addEventListener("measure",l);f&&!f.layout&&(f.root&&f.root.updateScroll(),f.updateLayout()),frame.read(l);const h=addDomEvent(window,"resize",()=>this.scalePositionWithinConstraints()),p=f.addEventListener("didUpdate",({delta:v,hasLayoutChanged:y})=>{this.isDragging&&y&&(eachAxis(b=>{const S=this.getAxisMotionValue(b);S&&(this.originPoint[b]+=v[b].translate,S.set(S.get()+v[b].translate))}),this.visualElement.render())});return()=>{h(),u(),c(),p&&p()}}getProps(){const a=this.visualElement.getProps(),{drag:u=!1,dragDirectionLock:l=!1,dragPropagation:f=!1,dragConstraints:c=!1,dragElastic:h=defaultElastic,dragMomentum:p=!0}=a;return{...a,drag:u,dragDirectionLock:l,dragPropagation:f,dragConstraints:c,dragElastic:h,dragMomentum:p}}}function shouldDrag(s,a,u){return(a===!0||a===s)&&(u===null||u===s)}function getCurrentDirection(s,a=10){let u=null;return Math.abs(s.y)>a?u="y":Math.abs(s.x)>a&&(u="x"),u}class DragGesture extends Feature{constructor(a){super(a),this.removeGroupControls=noop$1,this.removeListeners=noop$1,this.controls=new VisualElementDragControls(a)}mount(){const{dragControls:a}=this.node.getProps();a&&(this.removeGroupControls=a.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||noop$1}unmount(){this.removeGroupControls(),this.removeListeners()}}const asyncHandler=s=>(a,u)=>{s&&frame.postRender(()=>s(a,u))};class PanGesture extends Feature{constructor(){super(...arguments),this.removePointerDownListener=noop$1}onPointerDown(a){this.session=new PanSession(a,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:getContextWindow(this.node)})}createPanHandlers(){const{onPanSessionStart:a,onPanStart:u,onPan:l,onPanEnd:f}=this.node.getProps();return{onSessionStart:asyncHandler(a),onStart:asyncHandler(u),onMove:l,onEnd:(c,h)=>{delete this.session,f&&frame.postRender(()=>f(c,h))}}}mount(){this.removePointerDownListener=addPointerEvent(this.node.current,"pointerdown",a=>this.onPointerDown(a))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const PresenceContext=reactExports.createContext(null);function usePresence(){const s=reactExports.useContext(PresenceContext);if(s===null)return[!0,null];const{isPresent:a,onExitComplete:u,register:l}=s,f=reactExports.useId();reactExports.useEffect(()=>l(f),[]);const c=reactExports.useCallback(()=>u&&u(f),[f,u]);return!a&&u?[!1,c]:[!0]}function useIsPresent(){return isPresent(reactExports.useContext(PresenceContext))}function isPresent(s){return s===null?!0:s.isPresent}const LayoutGroupContext=reactExports.createContext({}),SwitchLayoutGroupContext=reactExports.createContext({}),globalProjectionState={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function pixelsToPercent(s,a){return a.max===a.min?0:s/(a.max-a.min)*100}const correctBorderRadius={correct:(s,a)=>{if(!a.target)return s;if(typeof s=="string")if(px.test(s))s=parseFloat(s);else return s;const u=pixelsToPercent(s,a.target.x),l=pixelsToPercent(s,a.target.y);return`${u}% ${l}%`}},correctBoxShadow={correct:(s,{treeScale:a,projectionDelta:u})=>{const l=s,f=complex.parse(s);if(f.length>5)return l;const c=complex.createTransformer(s),h=typeof f[0]!="number"?1:0,p=u.x.scale*a.x,v=u.y.scale*a.y;f[0+h]/=p,f[1+h]/=v;const y=mixNumber$1(p,v,.5);return typeof f[2+h]=="number"&&(f[2+h]/=y),typeof f[3+h]=="number"&&(f[3+h]/=y),c(f)}},scaleCorrectors={};function addScaleCorrector(s){Object.assign(scaleCorrectors,s)}const{schedule:microtask,cancel:cancelMicrotask}=createRenderBatcher(queueMicrotask,!1);class MeasureLayoutWithContext extends reactExports.Component{componentDidMount(){const{visualElement:a,layoutGroup:u,switchLayoutGroup:l,layoutId:f}=this.props,{projection:c}=a;addScaleCorrector(defaultScaleCorrectors),c&&(u.group&&u.group.add(c),l&&l.register&&f&&l.register(c),c.root.didUpdate(),c.addEventListener("animationComplete",()=>{this.safeToRemove()}),c.setOptions({...c.options,onExitComplete:()=>this.safeToRemove()})),globalProjectionState.hasEverUpdated=!0}getSnapshotBeforeUpdate(a){const{layoutDependency:u,visualElement:l,drag:f,isPresent:c}=this.props,h=l.projection;return h&&(h.isPresent=c,f||a.layoutDependency!==u||u===void 0?h.willUpdate():this.safeToRemove(),a.isPresent!==c&&(c?h.promote():h.relegate()||frame.postRender(()=>{const p=h.getStack();(!p||!p.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:a}=this.props.visualElement;a&&(a.root.didUpdate(),microtask.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:a,layoutGroup:u,switchLayoutGroup:l}=this.props,{projection:f}=a;f&&(f.scheduleCheckAfterUnmount(),u&&u.group&&u.group.remove(f),l&&l.deregister&&l.deregister(f))}safeToRemove(){const{safeToRemove:a}=this.props;a&&a()}render(){return null}}function MeasureLayout(s){const[a,u]=usePresence(),l=reactExports.useContext(LayoutGroupContext);return jsxRuntimeExports.jsx(MeasureLayoutWithContext,{...s,layoutGroup:l,switchLayoutGroup:reactExports.useContext(SwitchLayoutGroupContext),isPresent:a,safeToRemove:u})}const defaultScaleCorrectors={borderRadius:{...correctBorderRadius,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:correctBorderRadius,borderTopRightRadius:correctBorderRadius,borderBottomLeftRadius:correctBorderRadius,borderBottomRightRadius:correctBorderRadius,boxShadow:correctBoxShadow},borders=["TopLeft","TopRight","BottomLeft","BottomRight"],numBorders=borders.length,asNumber=s=>typeof s=="string"?parseFloat(s):s,isPx=s=>typeof s=="number"||px.test(s);function mixValues(s,a,u,l,f,c){f?(s.opacity=mixNumber$1(0,u.opacity!==void 0?u.opacity:1,easeCrossfadeIn(l)),s.opacityExit=mixNumber$1(a.opacity!==void 0?a.opacity:1,0,easeCrossfadeOut(l))):c&&(s.opacity=mixNumber$1(a.opacity!==void 0?a.opacity:1,u.opacity!==void 0?u.opacity:1,l));for(let h=0;h<numBorders;h++){const p=`border${borders[h]}Radius`;let v=getRadius(a,p),y=getRadius(u,p);if(v===void 0&&y===void 0)continue;v||(v=0),y||(y=0),v===0||y===0||isPx(v)===isPx(y)?(s[p]=Math.max(mixNumber$1(asNumber(v),asNumber(y),l),0),(percent.test(y)||percent.test(v))&&(s[p]+="%")):s[p]=y}(a.rotate||u.rotate)&&(s.rotate=mixNumber$1(a.rotate||0,u.rotate||0,l))}function getRadius(s,a){return s[a]!==void 0?s[a]:s.borderRadius}const easeCrossfadeIn=compress(0,.5,circOut),easeCrossfadeOut=compress(.5,.95,noop$1);function compress(s,a,u){return l=>l<s?0:l>a?1:u(progress(s,a,l))}function copyAxisInto(s,a){s.min=a.min,s.max=a.max}function copyBoxInto(s,a){copyAxisInto(s.x,a.x),copyAxisInto(s.y,a.y)}function copyAxisDeltaInto(s,a){s.translate=a.translate,s.scale=a.scale,s.originPoint=a.originPoint,s.origin=a.origin}function removePointDelta(s,a,u,l,f){return s-=a,s=scalePoint(s,1/u,l),f!==void 0&&(s=scalePoint(s,1/f,l)),s}function removeAxisDelta(s,a=0,u=1,l=.5,f,c=s,h=s){if(percent.test(a)&&(a=parseFloat(a),a=mixNumber$1(h.min,h.max,a/100)-h.min),typeof a!="number")return;let p=mixNumber$1(c.min,c.max,l);s===c&&(p-=a),s.min=removePointDelta(s.min,a,u,p,f),s.max=removePointDelta(s.max,a,u,p,f)}function removeAxisTransforms(s,a,[u,l,f],c,h){removeAxisDelta(s,a[u],a[l],a[f],a.scale,c,h)}const xKeys=["x","scaleX","originX"],yKeys=["y","scaleY","originY"];function removeBoxTransforms(s,a,u,l){removeAxisTransforms(s.x,a,xKeys,u?u.x:void 0,l?l.x:void 0),removeAxisTransforms(s.y,a,yKeys,u?u.y:void 0,l?l.y:void 0)}function isAxisDeltaZero(s){return s.translate===0&&s.scale===1}function isDeltaZero(s){return isAxisDeltaZero(s.x)&&isAxisDeltaZero(s.y)}function axisEquals(s,a){return s.min===a.min&&s.max===a.max}function boxEquals(s,a){return axisEquals(s.x,a.x)&&axisEquals(s.y,a.y)}function axisEqualsRounded(s,a){return Math.round(s.min)===Math.round(a.min)&&Math.round(s.max)===Math.round(a.max)}function boxEqualsRounded(s,a){return axisEqualsRounded(s.x,a.x)&&axisEqualsRounded(s.y,a.y)}function aspectRatio(s){return calcLength(s.x)/calcLength(s.y)}function axisDeltaEquals(s,a){return s.translate===a.translate&&s.scale===a.scale&&s.originPoint===a.originPoint}class NodeStack{constructor(){this.members=[]}add(a){addUniqueItem(this.members,a),a.scheduleRender()}remove(a){if(removeItem(this.members,a),a===this.prevLead&&(this.prevLead=void 0),a===this.lead){const u=this.members[this.members.length-1];u&&this.promote(u)}}relegate(a){const u=this.members.findIndex(f=>a===f);if(u===0)return!1;let l;for(let f=u;f>=0;f--){const c=this.members[f];if(c.isPresent!==!1){l=c;break}}return l?(this.promote(l),!0):!1}promote(a,u){const l=this.lead;if(a!==l&&(this.prevLead=l,this.lead=a,a.show(),l)){l.instance&&l.scheduleRender(),a.scheduleRender(),a.resumeFrom=l,u&&(a.resumeFrom.preserveOpacity=!0),l.snapshot&&(a.snapshot=l.snapshot,a.snapshot.latestValues=l.animationValues||l.latestValues),a.root&&a.root.isUpdating&&(a.isLayoutDirty=!0);const{crossfade:f}=a.options;f===!1&&l.hide()}}exitAnimationComplete(){this.members.forEach(a=>{const{options:u,resumingFrom:l}=a;u.onExitComplete&&u.onExitComplete(),l&&l.options.onExitComplete&&l.options.onExitComplete()})}scheduleRender(){this.members.forEach(a=>{a.instance&&a.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function buildProjectionTransform(s,a,u){let l="";const f=s.x.translate/a.x,c=s.y.translate/a.y,h=(u==null?void 0:u.z)||0;if((f||c||h)&&(l=`translate3d(${f}px, ${c}px, ${h}px) `),(a.x!==1||a.y!==1)&&(l+=`scale(${1/a.x}, ${1/a.y}) `),u){const{transformPerspective:y,rotate:b,rotateX:S,rotateY:E,skewX:R,skewY:O}=u;y&&(l=`perspective(${y}px) ${l}`),b&&(l+=`rotate(${b}deg) `),S&&(l+=`rotateX(${S}deg) `),E&&(l+=`rotateY(${E}deg) `),R&&(l+=`skewX(${R}deg) `),O&&(l+=`skewY(${O}deg) `)}const p=s.x.scale*a.x,v=s.y.scale*a.y;return(p!==1||v!==1)&&(l+=`scale(${p}, ${v})`),l||"none"}const compareByDepth=(s,a)=>s.depth-a.depth;class FlatTree{constructor(){this.children=[],this.isDirty=!1}add(a){addUniqueItem(this.children,a),this.isDirty=!0}remove(a){removeItem(this.children,a),this.isDirty=!0}forEach(a){this.isDirty&&this.children.sort(compareByDepth),this.isDirty=!1,this.children.forEach(a)}}function resolveMotionValue(s){const a=isMotionValue(s)?s.get():s;return isCustomValue(a)?a.toValue():a}function delay(s,a){const u=time.now(),l=({timestamp:f})=>{const c=f-u;c>=a&&(cancelFrame(l),s(c-a))};return frame.read(l,!0),()=>cancelFrame(l)}function isSVGElement(s){return s instanceof SVGElement&&s.tagName!=="svg"}function animateSingleValue(s,a,u){const l=isMotionValue(s)?s:motionValue(s);return l.start(animateMotionValue("",l,a,u)),l.animation}const metrics={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},isDebug=typeof window<"u"&&window.MotionDebug!==void 0,transformAxes=["","X","Y","Z"],hiddenVisibility={visibility:"hidden"},animationTarget=1e3;let id$2=0;function resetDistortingTransform(s,a,u,l){const{latestValues:f}=a;f[s]&&(u[s]=f[s],a.setStaticValue(s,0),l&&(l[s]=0))}function cancelTreeOptimisedTransformAnimations(s){if(s.hasCheckedOptimisedAppear=!0,s.root===s)return;const{visualElement:a}=s.options;if(!a)return;const u=getOptimisedAppearId(a);if(window.MotionHasOptimisedAnimation(u,"transform")){const{layout:f,layoutId:c}=s.options;window.MotionCancelOptimisedAnimation(u,"transform",frame,!(f||c))}const{parent:l}=s;l&&!l.hasCheckedOptimisedAppear&&cancelTreeOptimisedTransformAnimations(l)}function createProjectionNode$1({attachResizeListener:s,defaultParent:a,measureScroll:u,checkIsScrollRoot:l,resetTransform:f}){return class{constructor(h={},p=a==null?void 0:a()){this.id=id$2++,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.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,isDebug&&(metrics.totalNodes=metrics.resolvedTargetDeltas=metrics.recalculatedProjection=0),this.nodes.forEach(propagateDirtyNodes),this.nodes.forEach(resolveTargetDelta),this.nodes.forEach(calcProjection),this.nodes.forEach(cleanDirtyNodes),isDebug&&window.MotionDebug.record(metrics)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=h,this.root=p?p.root||p:this,this.path=p?[...p.path,p]:[],this.parent=p,this.depth=p?p.depth+1:0;for(let v=0;v<this.path.length;v++)this.path[v].shouldResetTransform=!0;this.root===this&&(this.nodes=new FlatTree)}addEventListener(h,p){return this.eventHandlers.has(h)||this.eventHandlers.set(h,new SubscriptionManager),this.eventHandlers.get(h).add(p)}notifyListeners(h,...p){const v=this.eventHandlers.get(h);v&&v.notify(...p)}hasListeners(h){return this.eventHandlers.has(h)}mount(h,p=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=isSVGElement(h),this.instance=h;const{layoutId:v,layout:y,visualElement:b}=this.options;if(b&&!b.current&&b.mount(h),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),p&&(y||v)&&(this.isLayoutDirty=!0),s){let S;const E=()=>this.root.updateBlockedByResize=!1;s(h,()=>{this.root.updateBlockedByResize=!0,S&&S(),S=delay(E,250),globalProjectionState.hasAnimatedSinceResize&&(globalProjectionState.hasAnimatedSinceResize=!1,this.nodes.forEach(finishAnimation))})}v&&this.root.registerSharedNode(v,this),this.options.animate!==!1&&b&&(v||y)&&this.addEventListener("didUpdate",({delta:S,hasLayoutChanged:E,hasRelativeTargetChanged:R,layout:O})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const I=this.options.transition||b.getDefaultTransition()||defaultLayoutTransition,{onLayoutAnimationStart:B,onLayoutAnimationComplete:N}=b.getProps(),D=!this.targetLayout||!boxEqualsRounded(this.targetLayout,O)||R,G=!E&&R;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||G||E&&(D||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(S,G);const V={...getValueTransition(I,"layout"),onPlay:B,onComplete:N};(b.shouldReduceMotion||this.options.layoutRoot)&&(V.delay=0,V.type=!1),this.startAnimation(V)}else E||finishAnimation(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=O})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const h=this.getStack();h&&h.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,cancelFrame(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(resetSkewAndRotation),this.animationId++)}getTransformTemplate(){const{visualElement:h}=this.options;return h&&h.getProps().transformTemplate}willUpdate(h=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&cancelTreeOptimisedTransformAnimations(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let b=0;b<this.path.length;b++){const S=this.path[b];S.shouldResetTransform=!0,S.updateScroll("snapshot"),S.options.layoutRoot&&S.willUpdate(!1)}const{layoutId:p,layout:v}=this.options;if(p===void 0&&!v)return;const y=this.getTransformTemplate();this.prevTransformTemplateValue=y?y(this.latestValues,""):void 0,this.updateSnapshot(),h&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(clearMeasurements);return}this.isUpdating||this.nodes.forEach(clearIsLayoutDirty),this.isUpdating=!1,this.nodes.forEach(resetTransformStyle),this.nodes.forEach(updateLayout),this.nodes.forEach(notifyLayoutUpdate),this.clearAllSnapshots();const p=time.now();frameData.delta=clamp(0,1e3/60,p-frameData.timestamp),frameData.timestamp=p,frameData.isProcessing=!0,frameSteps.update.process(frameData),frameSteps.preRender.process(frameData),frameSteps.render.process(frameData),frameData.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,microtask.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(clearSnapshot),this.sharedNodes.forEach(removeLeadSnapshots)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,frame.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){frame.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 v=0;v<this.path.length;v++)this.path[v].updateScroll();const h=this.layout;this.layout=this.measure(!1),this.layoutCorrected=createBox(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:p}=this.options;p&&p.notify("LayoutMeasure",this.layout.layoutBox,h?h.layoutBox:void 0)}updateScroll(h="measure"){let p=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===h&&(p=!1),p){const v=l(this.instance);this.scroll={animationId:this.root.animationId,phase:h,isRoot:v,offset:u(this.instance),wasRoot:this.scroll?this.scroll.isRoot:v}}}resetTransform(){if(!f)return;const h=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,p=this.projectionDelta&&!isDeltaZero(this.projectionDelta),v=this.getTransformTemplate(),y=v?v(this.latestValues,""):void 0,b=y!==this.prevTransformTemplateValue;h&&(p||hasTransform(this.latestValues)||b)&&(f(this.instance,y),this.shouldResetTransform=!1,this.scheduleRender())}measure(h=!0){const p=this.measurePageBox();let v=this.removeElementScroll(p);return h&&(v=this.removeTransform(v)),roundBox(v),{animationId:this.root.animationId,measuredBox:p,layoutBox:v,latestValues:{},source:this.id}}measurePageBox(){var h;const{visualElement:p}=this.options;if(!p)return createBox();const v=p.measureViewportBox();if(!(((h=this.scroll)===null||h===void 0?void 0:h.wasRoot)||this.path.some(checkNodeWasScrollRoot))){const{scroll:b}=this.root;b&&(translateAxis(v.x,b.offset.x),translateAxis(v.y,b.offset.y))}return v}removeElementScroll(h){var p;const v=createBox();if(copyBoxInto(v,h),!((p=this.scroll)===null||p===void 0)&&p.wasRoot)return v;for(let y=0;y<this.path.length;y++){const b=this.path[y],{scroll:S,options:E}=b;b!==this.root&&S&&E.layoutScroll&&(S.wasRoot&&copyBoxInto(v,h),translateAxis(v.x,S.offset.x),translateAxis(v.y,S.offset.y))}return v}applyTransform(h,p=!1){const v=createBox();copyBoxInto(v,h);for(let y=0;y<this.path.length;y++){const b=this.path[y];!p&&b.options.layoutScroll&&b.scroll&&b!==b.root&&transformBox(v,{x:-b.scroll.offset.x,y:-b.scroll.offset.y}),hasTransform(b.latestValues)&&transformBox(v,b.latestValues)}return hasTransform(this.latestValues)&&transformBox(v,this.latestValues),v}removeTransform(h){const p=createBox();copyBoxInto(p,h);for(let v=0;v<this.path.length;v++){const y=this.path[v];if(!y.instance||!hasTransform(y.latestValues))continue;hasScale(y.latestValues)&&y.updateSnapshot();const b=createBox(),S=y.measurePageBox();copyBoxInto(b,S),removeBoxTransforms(p,y.latestValues,y.snapshot?y.snapshot.layoutBox:void 0,b)}return hasTransform(this.latestValues)&&removeBoxTransforms(p,this.latestValues),p}setTargetDelta(h){this.targetDelta=h,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(h){this.options={...this.options,...h,crossfade:h.crossfade!==void 0?h.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==frameData.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(h=!1){var p;const v=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=v.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=v.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=v.isSharedProjectionDirty);const y=!!this.resumingFrom||this!==v;if(!(h||y&&this.isSharedProjectionDirty||this.isProjectionDirty||!((p=this.parent)===null||p===void 0)&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:S,layoutId:E}=this.options;if(!(!this.layout||!(S||E))){if(this.resolvedRelativeTargetAt=frameData.timestamp,!this.targetDelta&&!this.relativeTarget){const R=this.getClosestProjectingParent();R&&R.layout&&this.animationProgress!==1?(this.relativeParent=R,this.forceRelativeParentToResolveTarget(),this.relativeTarget=createBox(),this.relativeTargetOrigin=createBox(),calcRelativePosition(this.relativeTargetOrigin,this.layout.layoutBox,R.layout.layoutBox),copyBoxInto(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=createBox(),this.targetWithTransforms=createBox()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),calcRelativeBox(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):copyBoxInto(this.target,this.layout.layoutBox),applyBoxDelta(this.target,this.targetDelta)):copyBoxInto(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const R=this.getClosestProjectingParent();R&&!!R.resumingFrom==!!this.resumingFrom&&!R.options.layoutScroll&&R.target&&this.animationProgress!==1?(this.relativeParent=R,this.forceRelativeParentToResolveTarget(),this.relativeTarget=createBox(),this.relativeTargetOrigin=createBox(),calcRelativePosition(this.relativeTargetOrigin,this.target,R.target),copyBoxInto(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}isDebug&&metrics.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||hasScale(this.parent.latestValues)||has2DTranslate(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var h;const p=this.getLead(),v=!!this.resumingFrom||this!==p;let y=!0;if((this.isProjectionDirty||!((h=this.parent)===null||h===void 0)&&h.isProjectionDirty)&&(y=!1),v&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(y=!1),this.resolvedRelativeTargetAt===frameData.timestamp&&(y=!1),y)return;const{layout:b,layoutId:S}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(b||S))return;copyBoxInto(this.layoutCorrected,this.layout.layoutBox);const E=this.treeScale.x,R=this.treeScale.y;applyTreeDeltas(this.layoutCorrected,this.treeScale,this.path,v),p.layout&&!p.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(p.target=p.layout.layoutBox,p.targetWithTransforms=createBox());const{target:O}=p;if(!O){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(copyAxisDeltaInto(this.prevProjectionDelta.x,this.projectionDelta.x),copyAxisDeltaInto(this.prevProjectionDelta.y,this.projectionDelta.y)),calcBoxDelta(this.projectionDelta,this.layoutCorrected,O,this.latestValues),(this.treeScale.x!==E||this.treeScale.y!==R||!axisDeltaEquals(this.projectionDelta.x,this.prevProjectionDelta.x)||!axisDeltaEquals(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",O)),isDebug&&metrics.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(h=!0){var p;if((p=this.options.visualElement)===null||p===void 0||p.scheduleRender(),h){const v=this.getStack();v&&v.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=createDelta(),this.projectionDelta=createDelta(),this.projectionDeltaWithTransform=createDelta()}setAnimationOrigin(h,p=!1){const v=this.snapshot,y=v?v.latestValues:{},b={...this.latestValues},S=createDelta();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!p;const E=createBox(),R=v?v.source:void 0,O=this.layout?this.layout.source:void 0,I=R!==O,B=this.getStack(),N=!B||B.members.length<=1,D=!!(I&&!N&&this.options.crossfade===!0&&!this.path.some(hasOpacityCrossfade));this.animationProgress=0;let G;this.mixTargetDelta=V=>{const U=V/1e3;mixAxisDelta(S.x,h.x,U),mixAxisDelta(S.y,h.y,U),this.setTargetDelta(S),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(calcRelativePosition(E,this.layout.layoutBox,this.relativeParent.layout.layoutBox),mixBox(this.relativeTarget,this.relativeTargetOrigin,E,U),G&&boxEquals(this.relativeTarget,G)&&(this.isProjectionDirty=!1),G||(G=createBox()),copyBoxInto(G,this.relativeTarget)),I&&(this.animationValues=b,mixValues(b,y,this.latestValues,U,D,N)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=U},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(h){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(cancelFrame(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=frame.update(()=>{globalProjectionState.hasAnimatedSinceResize=!0,this.currentAnimation=animateSingleValue(0,animationTarget,{...h,onUpdate:p=>{this.mixTargetDelta(p),h.onUpdate&&h.onUpdate(p)},onComplete:()=>{h.onComplete&&h.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 h=this.getStack();h&&h.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(animationTarget),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const h=this.getLead();let{targetWithTransforms:p,target:v,layout:y,latestValues:b}=h;if(!(!p||!v||!y)){if(this!==h&&this.layout&&y&&shouldAnimatePositionOnly(this.options.animationType,this.layout.layoutBox,y.layoutBox)){v=this.target||createBox();const S=calcLength(this.layout.layoutBox.x);v.x.min=h.target.x.min,v.x.max=v.x.min+S;const E=calcLength(this.layout.layoutBox.y);v.y.min=h.target.y.min,v.y.max=v.y.min+E}copyBoxInto(p,v),transformBox(p,b),calcBoxDelta(this.projectionDeltaWithTransform,this.layoutCorrected,p,b)}}registerSharedNode(h,p){this.sharedNodes.has(h)||this.sharedNodes.set(h,new NodeStack),this.sharedNodes.get(h).add(p);const y=p.options.initialPromotionConfig;p.promote({transition:y?y.transition:void 0,preserveFollowOpacity:y&&y.shouldPreserveFollowOpacity?y.shouldPreserveFollowOpacity(p):void 0})}isLead(){const h=this.getStack();return h?h.lead===this:!0}getLead(){var h;const{layoutId:p}=this.options;return p?((h=this.getStack())===null||h===void 0?void 0:h.lead)||this:this}getPrevLead(){var h;const{layoutId:p}=this.options;return p?(h=this.getStack())===null||h===void 0?void 0:h.prevLead:void 0}getStack(){const{layoutId:h}=this.options;if(h)return this.root.sharedNodes.get(h)}promote({needsReset:h,transition:p,preserveFollowOpacity:v}={}){const y=this.getStack();y&&y.promote(this,v),h&&(this.projectionDelta=void 0,this.needsReset=!0),p&&this.setOptions({transition:p})}relegate(){const h=this.getStack();return h?h.relegate(this):!1}resetSkewAndRotation(){const{visualElement:h}=this.options;if(!h)return;let p=!1;const{latestValues:v}=h;if((v.z||v.rotate||v.rotateX||v.rotateY||v.rotateZ||v.skewX||v.skewY)&&(p=!0),!p)return;const y={};v.z&&resetDistortingTransform("z",h,y,this.animationValues);for(let b=0;b<transformAxes.length;b++)resetDistortingTransform(`rotate${transformAxes[b]}`,h,y,this.animationValues),resetDistortingTransform(`skew${transformAxes[b]}`,h,y,this.animationValues);h.render();for(const b in y)h.setStaticValue(b,y[b]),this.animationValues&&(this.animationValues[b]=y[b]);h.scheduleRender()}getProjectionStyles(h){var p,v;if(!this.instance||this.isSVG)return;if(!this.isVisible)return hiddenVisibility;const y={visibility:""},b=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,y.opacity="",y.pointerEvents=resolveMotionValue(h==null?void 0:h.pointerEvents)||"",y.transform=b?b(this.latestValues,""):"none",y;const S=this.getLead();if(!this.projectionDelta||!this.layout||!S.target){const I={};return this.options.layoutId&&(I.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,I.pointerEvents=resolveMotionValue(h==null?void 0:h.pointerEvents)||""),this.hasProjected&&!hasTransform(this.latestValues)&&(I.transform=b?b({},""):"none",this.hasProjected=!1),I}const E=S.animationValues||S.latestValues;this.applyTransformsToTarget(),y.transform=buildProjectionTransform(this.projectionDeltaWithTransform,this.treeScale,E),b&&(y.transform=b(E,y.transform));const{x:R,y:O}=this.projectionDelta;y.transformOrigin=`${R.origin*100}% ${O.origin*100}% 0`,S.animationValues?y.opacity=S===this?(v=(p=E.opacity)!==null&&p!==void 0?p:this.latestValues.opacity)!==null&&v!==void 0?v:1:this.preserveOpacity?this.latestValues.opacity:E.opacityExit:y.opacity=S===this?E.opacity!==void 0?E.opacity:"":E.opacityExit!==void 0?E.opacityExit:0;for(const I in scaleCorrectors){if(E[I]===void 0)continue;const{correct:B,applyTo:N}=scaleCorrectors[I],D=y.transform==="none"?E[I]:B(E[I],S);if(N){const G=N.length;for(let V=0;V<G;V++)y[N[V]]=D}else y[I]=D}return this.options.layoutId&&(y.pointerEvents=S===this?resolveMotionValue(h==null?void 0:h.pointerEvents)||"":"none"),y}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(h=>{var p;return(p=h.currentAnimation)===null||p===void 0?void 0:p.stop()}),this.root.nodes.forEach(clearMeasurements),this.root.sharedNodes.clear()}}}function updateLayout(s){s.updateLayout()}function notifyLayoutUpdate(s){var a;const u=((a=s.resumeFrom)===null||a===void 0?void 0:a.snapshot)||s.snapshot;if(s.isLead()&&s.layout&&u&&s.hasListeners("didUpdate")){const{layoutBox:l,measuredBox:f}=s.layout,{animationType:c}=s.options,h=u.source!==s.layout.source;c==="size"?eachAxis(S=>{const E=h?u.measuredBox[S]:u.layoutBox[S],R=calcLength(E);E.min=l[S].min,E.max=E.min+R}):shouldAnimatePositionOnly(c,u.layoutBox,l)&&eachAxis(S=>{const E=h?u.measuredBox[S]:u.layoutBox[S],R=calcLength(l[S]);E.max=E.min+R,s.relativeTarget&&!s.currentAnimation&&(s.isProjectionDirty=!0,s.relativeTarget[S].max=s.relativeTarget[S].min+R)});const p=createDelta();calcBoxDelta(p,l,u.layoutBox);const v=createDelta();h?calcBoxDelta(v,s.applyTransform(f,!0),u.measuredBox):calcBoxDelta(v,l,u.layoutBox);const y=!isDeltaZero(p);let b=!1;if(!s.resumeFrom){const S=s.getClosestProjectingParent();if(S&&!S.resumeFrom){const{snapshot:E,layout:R}=S;if(E&&R){const O=createBox();calcRelativePosition(O,u.layoutBox,E.layoutBox);const I=createBox();calcRelativePosition(I,l,R.layoutBox),boxEqualsRounded(O,I)||(b=!0),S.options.layoutRoot&&(s.relativeTarget=I,s.relativeTargetOrigin=O,s.relativeParent=S)}}}s.notifyListeners("didUpdate",{layout:l,snapshot:u,delta:v,layoutDelta:p,hasLayoutChanged:y,hasRelativeTargetChanged:b})}else if(s.isLead()){const{onExitComplete:l}=s.options;l&&l()}s.options.transition=void 0}function propagateDirtyNodes(s){isDebug&&metrics.totalNodes++,s.parent&&(s.isProjecting()||(s.isProjectionDirty=s.parent.isProjectionDirty),s.isSharedProjectionDirty||(s.isSharedProjectionDirty=!!(s.isProjectionDirty||s.parent.isProjectionDirty||s.parent.isSharedProjectionDirty)),s.isTransformDirty||(s.isTransformDirty=s.parent.isTransformDirty))}function cleanDirtyNodes(s){s.isProjectionDirty=s.isSharedProjectionDirty=s.isTransformDirty=!1}function clearSnapshot(s){s.clearSnapshot()}function clearMeasurements(s){s.clearMeasurements()}function clearIsLayoutDirty(s){s.isLayoutDirty=!1}function resetTransformStyle(s){const{visualElement:a}=s.options;a&&a.getProps().onBeforeLayoutMeasure&&a.notify("BeforeLayoutMeasure"),s.resetTransform()}function finishAnimation(s){s.finishAnimation(),s.targetDelta=s.relativeTarget=s.target=void 0,s.isProjectionDirty=!0}function resolveTargetDelta(s){s.resolveTargetDelta()}function calcProjection(s){s.calcProjection()}function resetSkewAndRotation(s){s.resetSkewAndRotation()}function removeLeadSnapshots(s){s.removeLeadSnapshot()}function mixAxisDelta(s,a,u){s.translate=mixNumber$1(a.translate,0,u),s.scale=mixNumber$1(a.scale,1,u),s.origin=a.origin,s.originPoint=a.originPoint}function mixAxis(s,a,u,l){s.min=mixNumber$1(a.min,u.min,l),s.max=mixNumber$1(a.max,u.max,l)}function mixBox(s,a,u,l){mixAxis(s.x,a.x,u.x,l),mixAxis(s.y,a.y,u.y,l)}function hasOpacityCrossfade(s){return s.animationValues&&s.animationValues.opacityExit!==void 0}const defaultLayoutTransition={duration:.45,ease:[.4,0,.1,1]},userAgentContains=s=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(s),roundPoint=userAgentContains("applewebkit/")&&!userAgentContains("chrome/")?Math.round:noop$1;function roundAxis(s){s.min=roundPoint(s.min),s.max=roundPoint(s.max)}function roundBox(s){roundAxis(s.x),roundAxis(s.y)}function shouldAnimatePositionOnly(s,a,u){return s==="position"||s==="preserve-aspect"&&!isNear(aspectRatio(a),aspectRatio(u),.2)}function checkNodeWasScrollRoot(s){var a;return s!==s.root&&((a=s.scroll)===null||a===void 0?void 0:a.wasRoot)}const DocumentProjectionNode=createProjectionNode$1({attachResizeListener:(s,a)=>addDomEvent(s,"resize",a),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),rootProjectionNode={current:void 0},HTMLProjectionNode=createProjectionNode$1({measureScroll:s=>({x:s.scrollLeft,y:s.scrollTop}),defaultParent:()=>{if(!rootProjectionNode.current){const s=new DocumentProjectionNode({});s.mount(window),s.setOptions({layoutScroll:!0}),rootProjectionNode.current=s}return rootProjectionNode.current},resetTransform:(s,a)=>{s.style.transform=a!==void 0?a:"none"},checkIsScrollRoot:s=>window.getComputedStyle(s).position==="fixed"}),drag={pan:{Feature:PanGesture},drag:{Feature:DragGesture,ProjectionNode:HTMLProjectionNode,MeasureLayout}};function handleHoverEvent(s,a,u){const{props:l}=s;s.animationState&&l.whileHover&&s.animationState.setActive("whileHover",u==="Start");const f="onHover"+u,c=l[f];c&&frame.postRender(()=>c(a,extractEventInfo(a)))}class HoverGesture extends Feature{mount(){const{current:a}=this.node;a&&(this.unmount=hover(a,u=>(handleHoverEvent(this.node,u,"Start"),l=>handleHoverEvent(this.node,l,"End"))))}unmount(){}}class FocusGesture extends Feature{constructor(){super(...arguments),this.isActive=!1}onFocus(){let a=!1;try{a=this.node.current.matches(":focus-visible")}catch{a=!0}!a||!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=pipe(addDomEvent(this.node.current,"focus",()=>this.onFocus()),addDomEvent(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function handlePressEvent(s,a,u){const{props:l}=s;s.animationState&&l.whileTap&&s.animationState.setActive("whileTap",u==="Start");const f="onTap"+(u==="End"?"":u),c=l[f];c&&frame.postRender(()=>c(a,extractEventInfo(a)))}class PressGesture extends Feature{mount(){const{current:a}=this.node;a&&(this.unmount=press(a,u=>(handlePressEvent(this.node,u,"Start"),(l,{success:f})=>handlePressEvent(this.node,l,f?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const observerCallbacks=new WeakMap,observers=new WeakMap,fireObserverCallback=s=>{const a=observerCallbacks.get(s.target);a&&a(s)},fireAllObserverCallbacks=s=>{s.forEach(fireObserverCallback)};function initIntersectionObserver({root:s,...a}){const u=s||document;observers.has(u)||observers.set(u,{});const l=observers.get(u),f=JSON.stringify(a);return l[f]||(l[f]=new IntersectionObserver(fireAllObserverCallbacks,{root:s,...a})),l[f]}function observeIntersection(s,a,u){const l=initIntersectionObserver(a);return observerCallbacks.set(s,u),l.observe(s),()=>{observerCallbacks.delete(s),l.unobserve(s)}}const thresholdNames={some:0,all:1};class InViewFeature extends Feature{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:a={}}=this.node.getProps(),{root:u,margin:l,amount:f="some",once:c}=a,h={root:u?u.current:void 0,rootMargin:l,threshold:typeof f=="number"?f:thresholdNames[f]},p=v=>{const{isIntersecting:y}=v;if(this.isInView===y||(this.isInView=y,c&&!y&&this.hasEnteredView))return;y&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",y);const{onViewportEnter:b,onViewportLeave:S}=this.node.getProps(),E=y?b:S;E&&E(v)};return observeIntersection(this.node.current,h,p)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:a,prevProps:u}=this.node;["amount","margin","root"].some(hasViewportOptionChanged(a,u))&&this.startObserver()}unmount(){}}function hasViewportOptionChanged({viewport:s={}},{viewport:a={}}={}){return u=>s[u]!==a[u]}const gestureAnimations={inView:{Feature:InViewFeature},tap:{Feature:PressGesture},focus:{Feature:FocusGesture},hover:{Feature:HoverGesture}},layout={layout:{ProjectionNode:HTMLProjectionNode,MeasureLayout}},MotionConfigContext=reactExports.createContext({transformPagePoint:s=>s,isStatic:!1,reducedMotion:"never"}),MotionContext=reactExports.createContext({}),isBrowser$2=typeof window<"u",useIsomorphicLayoutEffect$1=isBrowser$2?reactExports.useLayoutEffect:reactExports.useEffect,LazyContext=reactExports.createContext({strict:!1});function useVisualElement(s,a,u,l,f){var c,h;const{visualElement:p}=reactExports.useContext(MotionContext),v=reactExports.useContext(LazyContext),y=reactExports.useContext(PresenceContext),b=reactExports.useContext(MotionConfigContext).reducedMotion,S=reactExports.useRef(null);l=l||v.renderer,!S.current&&l&&(S.current=l(s,{visualState:a,parent:p,props:u,presenceContext:y,blockInitialAnimation:y?y.initial===!1:!1,reducedMotionConfig:b}));const E=S.current,R=reactExports.useContext(SwitchLayoutGroupContext);E&&!E.projection&&f&&(E.type==="html"||E.type==="svg")&&createProjectionNode(S.current,u,f,R);const O=reactExports.useRef(!1);reactExports.useInsertionEffect(()=>{E&&O.current&&E.update(u,y)});const I=u[optimizedAppearDataAttribute],B=reactExports.useRef(!!I&&!(!((c=window.MotionHandoffIsComplete)===null||c===void 0)&&c.call(window,I))&&((h=window.MotionHasOptimisedAnimation)===null||h===void 0?void 0:h.call(window,I)));return useIsomorphicLayoutEffect$1(()=>{E&&(O.current=!0,window.MotionIsMounted=!0,E.updateFeatures(),microtask.render(E.render),B.current&&E.animationState&&E.animationState.animateChanges())}),reactExports.useEffect(()=>{E&&(!B.current&&E.animationState&&E.animationState.animateChanges(),B.current&&(queueMicrotask(()=>{var N;(N=window.MotionHandoffMarkAsComplete)===null||N===void 0||N.call(window,I)}),B.current=!1))}),E}function createProjectionNode(s,a,u,l){const{layoutId:f,layout:c,drag:h,dragConstraints:p,layoutScroll:v,layoutRoot:y}=a;s.projection=new u(s.latestValues,a["data-framer-portal-id"]?void 0:getClosestProjectingNode(s.parent)),s.projection.setOptions({layoutId:f,layout:c,alwaysMeasureLayout:!!h||p&&isRefObject(p),visualElement:s,animationType:typeof c=="string"?c:"both",initialPromotionConfig:l,layoutScroll:v,layoutRoot:y})}function getClosestProjectingNode(s){if(s)return s.options.allowProjection!==!1?s.projection:getClosestProjectingNode(s.parent)}function useMotionRef(s,a,u){return reactExports.useCallback(l=>{l&&s.mount&&s.mount(l),a&&(l?a.mount(l):a.unmount()),u&&(typeof u=="function"?u(l):isRefObject(u)&&(u.current=l))},[a])}function isControllingVariants(s){return isAnimationControls(s.animate)||variantProps.some(a=>isVariantLabel(s[a]))}function isVariantNode(s){return!!(isControllingVariants(s)||s.variants)}function getCurrentTreeVariants(s,a){if(isControllingVariants(s)){const{initial:u,animate:l}=s;return{initial:u===!1||isVariantLabel(u)?u:void 0,animate:isVariantLabel(l)?l:void 0}}return s.inherit!==!1?a:{}}function useCreateMotionContext(s){const{initial:a,animate:u}=getCurrentTreeVariants(s,reactExports.useContext(MotionContext));return reactExports.useMemo(()=>({initial:a,animate:u}),[variantLabelsAsDependency(a),variantLabelsAsDependency(u)])}function variantLabelsAsDependency(s){return Array.isArray(s)?s.join(" "):s}const featureProps={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"]},featureDefinitions={};for(const s in featureProps)featureDefinitions[s]={isEnabled:a=>featureProps[s].some(u=>!!a[u])};function loadFeatures(s){for(const a in s)featureDefinitions[a]={...featureDefinitions[a],...s[a]}}const motionComponentSymbol=Symbol.for("motionComponentSymbol");function createRendererMotionComponent({preloadedFeatures:s,createVisualElement:a,useRender:u,useVisualState:l,Component:f}){s&&loadFeatures(s);function c(p,v){let y;const b={...reactExports.useContext(MotionConfigContext),...p,layoutId:useLayoutId(p)},{isStatic:S}=b,E=useCreateMotionContext(p),R=l(p,S);if(!S&&isBrowser$2){useStrictMode();const O=getProjectionFunctionality(b);y=O.MeasureLayout,E.visualElement=useVisualElement(f,R,b,a,O.ProjectionNode)}return jsxRuntimeExports.jsxs(MotionContext.Provider,{value:E,children:[y&&E.visualElement?jsxRuntimeExports.jsx(y,{visualElement:E.visualElement,...b}):null,u(f,p,useMotionRef(R,E.visualElement,v),R,S,E.visualElement)]})}const h=reactExports.forwardRef(c);return h[motionComponentSymbol]=f,h}function useLayoutId({layoutId:s}){const a=reactExports.useContext(LayoutGroupContext).id;return a&&s!==void 0?a+"-"+s:s}function useStrictMode(s,a){reactExports.useContext(LazyContext).strict}function getProjectionFunctionality(s){const{drag:a,layout:u}=featureDefinitions;if(!a&&!u)return{};const l={...a,...u};return{MeasureLayout:a!=null&&a.isEnabled(s)||u!=null&&u.isEnabled(s)?l.MeasureLayout:void 0,ProjectionNode:l.ProjectionNode}}const lowercaseSVGElements=["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 isSVGComponent(s){return typeof s!="string"||s.includes("-")?!1:!!(lowercaseSVGElements.indexOf(s)>-1||/[A-Z]/u.test(s))}function renderHTML(s,{style:a,vars:u},l,f){Object.assign(s.style,a,f&&f.getProjectionStyles(l));for(const c in u)s.style.setProperty(c,u[c])}const camelCaseAttributes=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 renderSVG(s,a,u,l){renderHTML(s,a,void 0,l);for(const f in a.attrs)s.setAttribute(camelCaseAttributes.has(f)?f:camelToDash(f),a.attrs[f])}function isForcedMotionValue(s,{layout:a,layoutId:u}){return transformProps.has(s)||s.startsWith("origin")||(a||u!==void 0)&&(!!scaleCorrectors[s]||s==="opacity")}function scrapeMotionValuesFromProps$1(s,a,u){var l;const{style:f}=s,c={};for(const h in f)(isMotionValue(f[h])||a.style&&isMotionValue(a.style[h])||isForcedMotionValue(h,s)||((l=u==null?void 0:u.getValue(h))===null||l===void 0?void 0:l.liveStyle)!==void 0)&&(c[h]=f[h]);return c}function scrapeMotionValuesFromProps(s,a,u){const l=scrapeMotionValuesFromProps$1(s,a,u);for(const f in s)if(isMotionValue(s[f])||isMotionValue(a[f])){const c=transformPropOrder.indexOf(f)!==-1?"attr"+f.charAt(0).toUpperCase()+f.substring(1):f;l[c]=s[f]}return l}function useConstant(s){const a=reactExports.useRef(null);return a.current===null&&(a.current=s()),a.current}function makeState({scrapeMotionValuesFromProps:s,createRenderState:a,onMount:u},l,f,c){const h={latestValues:makeLatestValues(l,f,c,s),renderState:a()};return u&&(h.mount=p=>u(l,p,h)),h}const makeUseVisualState=s=>(a,u)=>{const l=reactExports.useContext(MotionContext),f=reactExports.useContext(PresenceContext),c=()=>makeState(s,a,l,f);return u?c():useConstant(c)};function makeLatestValues(s,a,u,l){const f={},c=l(s,{});for(const E in c)f[E]=resolveMotionValue(c[E]);let{initial:h,animate:p}=s;const v=isControllingVariants(s),y=isVariantNode(s);a&&y&&!v&&s.inherit!==!1&&(h===void 0&&(h=a.initial),p===void 0&&(p=a.animate));let b=u?u.initial===!1:!1;b=b||h===!1;const S=b?p:h;if(S&&typeof S!="boolean"&&!isAnimationControls(S)){const E=Array.isArray(S)?S:[S];for(let R=0;R<E.length;R++){const O=resolveVariantFromProps(s,E[R]);if(O){const{transitionEnd:I,transition:B,...N}=O;for(const D in N){let G=N[D];if(Array.isArray(G)){const V=b?G.length-1:0;G=G[V]}G!==null&&(f[D]=G)}for(const D in I)f[D]=I[D]}}}return f}const createHtmlRenderState=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),createSvgRenderState=()=>({...createHtmlRenderState(),attrs:{}}),getValueAsType=(s,a)=>a&&typeof s=="number"?a.transform(s):s,translateAlias={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},numTransforms=transformPropOrder.length;function buildTransform(s,a,u){let l="",f=!0;for(let c=0;c<numTransforms;c++){const h=transformPropOrder[c],p=s[h];if(p===void 0)continue;let v=!0;if(typeof p=="number"?v=p===(h.startsWith("scale")?1:0):v=parseFloat(p)===0,!v||u){const y=getValueAsType(p,numberValueTypes[h]);if(!v){f=!1;const b=translateAlias[h]||h;l+=`${b}(${y}) `}u&&(a[h]=y)}}return l=l.trim(),u?l=u(a,f?"":l):f&&(l="none"),l}function buildHTMLStyles(s,a,u){const{style:l,vars:f,transformOrigin:c}=s;let h=!1,p=!1;for(const v in a){const y=a[v];if(transformProps.has(v)){h=!0;continue}else if(isCSSVariableName(v)){f[v]=y;continue}else{const b=getValueAsType(y,numberValueTypes[v]);v.startsWith("origin")?(p=!0,c[v]=b):l[v]=b}}if(a.transform||(h||u?l.transform=buildTransform(a,s.transform,u):l.transform&&(l.transform="none")),p){const{originX:v="50%",originY:y="50%",originZ:b=0}=c;l.transformOrigin=`${v} ${y} ${b}`}}function calcOrigin(s,a,u){return typeof s=="string"?s:px.transform(a+u*s)}function calcSVGTransformOrigin(s,a,u){const l=calcOrigin(a,s.x,s.width),f=calcOrigin(u,s.y,s.height);return`${l} ${f}`}const dashKeys={offset:"stroke-dashoffset",array:"stroke-dasharray"},camelKeys={offset:"strokeDashoffset",array:"strokeDasharray"};function buildSVGPath(s,a,u=1,l=0,f=!0){s.pathLength=1;const c=f?dashKeys:camelKeys;s[c.offset]=px.transform(-l);const h=px.transform(a),p=px.transform(u);s[c.array]=`${h} ${p}`}function buildSVGAttrs(s,{attrX:a,attrY:u,attrScale:l,originX:f,originY:c,pathLength:h,pathSpacing:p=1,pathOffset:v=0,...y},b,S){if(buildHTMLStyles(s,y,S),b){s.style.viewBox&&(s.attrs.viewBox=s.style.viewBox);return}s.attrs=s.style,s.style={};const{attrs:E,style:R,dimensions:O}=s;E.transform&&(O&&(R.transform=E.transform),delete E.transform),O&&(f!==void 0||c!==void 0||R.transform)&&(R.transformOrigin=calcSVGTransformOrigin(O,f!==void 0?f:.5,c!==void 0?c:.5)),a!==void 0&&(E.x=a),u!==void 0&&(E.y=u),l!==void 0&&(E.scale=l),h!==void 0&&buildSVGPath(E,h,p,v,!1)}const isSVGTag=s=>typeof s=="string"&&s.toLowerCase()==="svg",svgMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps,createRenderState:createSvgRenderState,onMount:(s,a,{renderState:u,latestValues:l})=>{frame.read(()=>{try{u.dimensions=typeof a.getBBox=="function"?a.getBBox():a.getBoundingClientRect()}catch{u.dimensions={x:0,y:0,width:0,height:0}}}),frame.render(()=>{buildSVGAttrs(u,l,isSVGTag(a.tagName),s.transformTemplate),renderSVG(a,u)})}})},htmlMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps:scrapeMotionValuesFromProps$1,createRenderState:createHtmlRenderState})};function copyRawValuesOnly(s,a,u){for(const l in a)!isMotionValue(a[l])&&!isForcedMotionValue(l,u)&&(s[l]=a[l])}function useInitialMotionValues({transformTemplate:s},a){return reactExports.useMemo(()=>{const u=createHtmlRenderState();return buildHTMLStyles(u,a,s),Object.assign({},u.vars,u.style)},[a])}function useStyle(s,a){const u=s.style||{},l={};return copyRawValuesOnly(l,u,s),Object.assign(l,useInitialMotionValues(s,a)),l}function useHTMLProps(s,a){const u={},l=useStyle(s,a);return s.drag&&s.dragListener!==!1&&(u.draggable=!1,l.userSelect=l.WebkitUserSelect=l.WebkitTouchCallout="none",l.touchAction=s.drag===!0?"none":`pan-${s.drag==="x"?"y":"x"}`),s.tabIndex===void 0&&(s.onTap||s.onTapStart||s.whileTap)&&(u.tabIndex=0),u.style=l,u}const validMotionProps=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function isValidMotionProp(s){return s.startsWith("while")||s.startsWith("drag")&&s!=="draggable"||s.startsWith("layout")||s.startsWith("onTap")||s.startsWith("onPan")||s.startsWith("onLayout")||validMotionProps.has(s)}let shouldForward=s=>!isValidMotionProp(s);function loadExternalIsValidProp(s){s&&(shouldForward=a=>a.startsWith("on")?!isValidMotionProp(a):s(a))}try{loadExternalIsValidProp(require("@emotion/is-prop-valid").default)}catch{}function filterProps(s,a,u){const l={};for(const f in s)f==="values"&&typeof s.values=="object"||(shouldForward(f)||u===!0&&isValidMotionProp(f)||!a&&!isValidMotionProp(f)||s.draggable&&f.startsWith("onDrag"))&&(l[f]=s[f]);return l}function useSVGProps(s,a,u,l){const f=reactExports.useMemo(()=>{const c=createSvgRenderState();return buildSVGAttrs(c,a,isSVGTag(l),s.transformTemplate),{...c.attrs,style:{...c.style}}},[a]);if(s.style){const c={};copyRawValuesOnly(c,s.style,s),f.style={...c,...f.style}}return f}function createUseRender(s=!1){return(u,l,f,{latestValues:c},h)=>{const v=(isSVGComponent(u)?useSVGProps:useHTMLProps)(l,c,h,u),y=filterProps(l,typeof u=="string",s),b=u!==reactExports.Fragment?{...y,...v,ref:f}:{},{children:S}=l,E=reactExports.useMemo(()=>isMotionValue(S)?S.get():S,[S]);return reactExports.createElement(u,{...b,children:E})}}function createMotionComponentFactory(s,a){return function(l,{forwardMotionProps:f}={forwardMotionProps:!1}){const h={...isSVGComponent(l)?svgMotionConfig:htmlMotionConfig,preloadedFeatures:s,useRender:createUseRender(f),createVisualElement:a,Component:l};return createRendererMotionComponent(h)}}const prefersReducedMotion={current:null},hasReducedMotionListener={current:!1};function initPrefersReducedMotion(){if(hasReducedMotionListener.current=!0,!!isBrowser$2)if(window.matchMedia){const s=window.matchMedia("(prefers-reduced-motion)"),a=()=>prefersReducedMotion.current=s.matches;s.addListener(a),a()}else prefersReducedMotion.current=!1}function updateMotionValuesFromProps(s,a,u){for(const l in a){const f=a[l],c=u[l];if(isMotionValue(f))s.addValue(l,f);else if(isMotionValue(c))s.addValue(l,motionValue(f,{owner:s}));else if(c!==f)if(s.hasValue(l)){const h=s.getValue(l);h.liveStyle===!0?h.jump(f):h.hasAnimated||h.set(f)}else{const h=s.getStaticValue(l);s.addValue(l,motionValue(h!==void 0?h:f,{owner:s}))}}for(const l in u)a[l]===void 0&&s.removeValue(l);return a}const visualElementStore=new WeakMap,valueTypes=[...dimensionValueTypes,color,complex],findValueType=s=>valueTypes.find(testValueType(s)),propEventHandlers=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class VisualElement{scrapeMotionValuesFromProps(a,u,l){return{}}constructor({parent:a,props:u,presenceContext:l,reducedMotionConfig:f,blockInitialAnimation:c,visualState:h},p={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=KeyframeResolver,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.renderScheduledAt=0,this.scheduleRender=()=>{const E=time.now();this.renderScheduledAt<E&&(this.renderScheduledAt=E,frame.render(this.render,!1,!0))};const{latestValues:v,renderState:y}=h;this.latestValues=v,this.baseTarget={...v},this.initialValues=u.initial?{...v}:{},this.renderState=y,this.parent=a,this.props=u,this.presenceContext=l,this.depth=a?a.depth+1:0,this.reducedMotionConfig=f,this.options=p,this.blockInitialAnimation=!!c,this.isControllingVariants=isControllingVariants(u),this.isVariantNode=isVariantNode(u),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(a&&a.current);const{willChange:b,...S}=this.scrapeMotionValuesFromProps(u,{},this);for(const E in S){const R=S[E];v[E]!==void 0&&isMotionValue(R)&&R.set(v[E],!1)}}mount(a){this.current=a,visualElementStore.set(a,this),this.projection&&!this.projection.instance&&this.projection.mount(a),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((u,l)=>this.bindToMotionValue(l,u)),hasReducedMotionListener.current||initPrefersReducedMotion(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:prefersReducedMotion.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){visualElementStore.delete(this.current),this.projection&&this.projection.unmount(),cancelFrame(this.notifyUpdate),cancelFrame(this.render),this.valueSubscriptions.forEach(a=>a()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const a in this.events)this.events[a].clear();for(const a in this.features){const u=this.features[a];u&&(u.unmount(),u.isMounted=!1)}this.current=null}bindToMotionValue(a,u){this.valueSubscriptions.has(a)&&this.valueSubscriptions.get(a)();const l=transformProps.has(a),f=u.on("change",p=>{this.latestValues[a]=p,this.props.onUpdate&&frame.preRender(this.notifyUpdate),l&&this.projection&&(this.projection.isTransformDirty=!0)}),c=u.on("renderRequest",this.scheduleRender);let h;window.MotionCheckAppearSync&&(h=window.MotionCheckAppearSync(this,a,u)),this.valueSubscriptions.set(a,()=>{f(),c(),h&&h(),u.owner&&u.stop()})}sortNodePosition(a){return!this.current||!this.sortInstanceNodePosition||this.type!==a.type?0:this.sortInstanceNodePosition(this.current,a.current)}updateFeatures(){let a="animation";for(a in featureDefinitions){const u=featureDefinitions[a];if(!u)continue;const{isEnabled:l,Feature:f}=u;if(!this.features[a]&&f&&l(this.props)&&(this.features[a]=new f(this)),this.features[a]){const c=this.features[a];c.isMounted?c.update():(c.mount(),c.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):createBox()}getStaticValue(a){return this.latestValues[a]}setStaticValue(a,u){this.latestValues[a]=u}update(a,u){(a.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=a,this.prevPresenceContext=this.presenceContext,this.presenceContext=u;for(let l=0;l<propEventHandlers.length;l++){const f=propEventHandlers[l];this.propEventSubscriptions[f]&&(this.propEventSubscriptions[f](),delete this.propEventSubscriptions[f]);const c="on"+f,h=a[c];h&&(this.propEventSubscriptions[f]=this.on(f,h))}this.prevMotionValues=updateMotionValuesFromProps(this,this.scrapeMotionValuesFromProps(a,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(a){return this.props.variants?this.props.variants[a]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(a){const u=this.getClosestVariantNode();if(u)return u.variantChildren&&u.variantChildren.add(a),()=>u.variantChildren.delete(a)}addValue(a,u){const l=this.values.get(a);u!==l&&(l&&this.removeValue(a),this.bindToMotionValue(a,u),this.values.set(a,u),this.latestValues[a]=u.get())}removeValue(a){this.values.delete(a);const u=this.valueSubscriptions.get(a);u&&(u(),this.valueSubscriptions.delete(a)),delete this.latestValues[a],this.removeValueFromRenderState(a,this.renderState)}hasValue(a){return this.values.has(a)}getValue(a,u){if(this.props.values&&this.props.values[a])return this.props.values[a];let l=this.values.get(a);return l===void 0&&u!==void 0&&(l=motionValue(u===null?void 0:u,{owner:this}),this.addValue(a,l)),l}readValue(a,u){var l;let f=this.latestValues[a]!==void 0||!this.current?this.latestValues[a]:(l=this.getBaseTargetFromProps(this.props,a))!==null&&l!==void 0?l:this.readValueFromInstance(this.current,a,this.options);return f!=null&&(typeof f=="string"&&(isNumericalString(f)||isZeroValueString(f))?f=parseFloat(f):!findValueType(f)&&complex.test(u)&&(f=getAnimatableNone(a,u)),this.setBaseTarget(a,isMotionValue(f)?f.get():f)),isMotionValue(f)?f.get():f}setBaseTarget(a,u){this.baseTarget[a]=u}getBaseTarget(a){var u;const{initial:l}=this.props;let f;if(typeof l=="string"||typeof l=="object"){const h=resolveVariantFromProps(this.props,l,(u=this.presenceContext)===null||u===void 0?void 0:u.custom);h&&(f=h[a])}if(l&&f!==void 0)return f;const c=this.getBaseTargetFromProps(this.props,a);return c!==void 0&&!isMotionValue(c)?c:this.initialValues[a]!==void 0&&f===void 0?void 0:this.baseTarget[a]}on(a,u){return this.events[a]||(this.events[a]=new SubscriptionManager),this.events[a].add(u)}notify(a,...u){this.events[a]&&this.events[a].notify(...u)}}class DOMVisualElement extends VisualElement{constructor(){super(...arguments),this.KeyframeResolver=DOMKeyframesResolver}sortInstanceNodePosition(a,u){return a.compareDocumentPosition(u)&2?1:-1}getBaseTargetFromProps(a,u){return a.style?a.style[u]:void 0}removeValueFromRenderState(a,{vars:u,style:l}){delete u[a],delete l[a]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:a}=this.props;isMotionValue(a)&&(this.childSubscription=a.on("change",u=>{this.current&&(this.current.textContent=`${u}`)}))}}function getComputedStyle(s){return window.getComputedStyle(s)}class HTMLVisualElement extends DOMVisualElement{constructor(){super(...arguments),this.type="html",this.renderInstance=renderHTML}readValueFromInstance(a,u){if(transformProps.has(u)){const l=getDefaultValueType(u);return l&&l.default||0}else{const l=getComputedStyle(a),f=(isCSSVariableName(u)?l.getPropertyValue(u):l[u])||0;return typeof f=="string"?f.trim():f}}measureInstanceViewportBox(a,{transformPagePoint:u}){return measureViewportBox(a,u)}build(a,u,l){buildHTMLStyles(a,u,l.transformTemplate)}scrapeMotionValuesFromProps(a,u,l){return scrapeMotionValuesFromProps$1(a,u,l)}}class SVGVisualElement extends DOMVisualElement{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=createBox}getBaseTargetFromProps(a,u){return a[u]}readValueFromInstance(a,u){if(transformProps.has(u)){const l=getDefaultValueType(u);return l&&l.default||0}return u=camelCaseAttributes.has(u)?u:camelToDash(u),a.getAttribute(u)}scrapeMotionValuesFromProps(a,u,l){return scrapeMotionValuesFromProps(a,u,l)}build(a,u,l){buildSVGAttrs(a,u,this.isSVGTag,l.transformTemplate)}renderInstance(a,u,l,f){renderSVG(a,u,l,f)}mount(a){this.isSVGTag=isSVGTag(a.tagName),super.mount(a)}}const createDomVisualElement=(s,a)=>isSVGComponent(s)?new SVGVisualElement(a):new HTMLVisualElement(a,{allowProjection:s!==reactExports.Fragment}),createMotionComponent=createMotionComponentFactory({...animations,...gestureAnimations,...drag,...layout},createDomVisualElement),motion=createDOMMotionComponentProxy(createMotionComponent);class PopChildMeasure extends reactExports.Component{getSnapshotBeforeUpdate(a){const u=this.props.childRef.current;if(u&&a.isPresent&&!this.props.isPresent){const l=this.props.sizeRef.current;l.height=u.offsetHeight||0,l.width=u.offsetWidth||0,l.top=u.offsetTop,l.left=u.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function PopChild({children:s,isPresent:a}){const u=reactExports.useId(),l=reactExports.useRef(null),f=reactExports.useRef({width:0,height:0,top:0,left:0}),{nonce:c}=reactExports.useContext(MotionConfigContext);return reactExports.useInsertionEffect(()=>{const{width:h,height:p,top:v,left:y}=f.current;if(a||!l.current||!h||!p)return;l.current.dataset.motionPopId=u;const b=document.createElement("style");return c&&(b.nonce=c),document.head.appendChild(b),b.sheet&&b.sheet.insertRule(`
          [data-motion-pop-id="${u}"] {
            position: absolute !important;
            width: ${h}px !important;
            height: ${p}px !important;
            top: ${v}px !important;
            left: ${y}px !important;
          }
        `),()=>{document.head.removeChild(b)}},[a]),jsxRuntimeExports.jsx(PopChildMeasure,{isPresent:a,childRef:l,sizeRef:f,children:reactExports.cloneElement(s,{ref:l})})}const PresenceChild=({children:s,initial:a,isPresent:u,onExitComplete:l,custom:f,presenceAffectsLayout:c,mode:h})=>{const p=useConstant(newChildrenMap),v=reactExports.useId(),y=reactExports.useCallback(S=>{p.set(S,!0);for(const E of p.values())if(!E)return;l&&l()},[p,l]),b=reactExports.useMemo(()=>({id:v,initial:a,isPresent:u,custom:f,onExitComplete:y,register:S=>(p.set(S,!1),()=>p.delete(S))}),c?[Math.random(),y]:[u,y]);return reactExports.useMemo(()=>{p.forEach((S,E)=>p.set(E,!1))},[u]),reactExports.useEffect(()=>{!u&&!p.size&&l&&l()},[u]),h==="popLayout"&&(s=jsxRuntimeExports.jsx(PopChild,{isPresent:u,children:s})),jsxRuntimeExports.jsx(PresenceContext.Provider,{value:b,children:s})};function newChildrenMap(){return new Map}const getChildKey=s=>s.key||"";function onlyElements(s){const a=[];return reactExports.Children.forEach(s,u=>{reactExports.isValidElement(u)&&a.push(u)}),a}const AnimatePresence=({children:s,exitBeforeEnter:a,custom:u,initial:l=!0,onExitComplete:f,presenceAffectsLayout:c=!0,mode:h="sync"})=>{const p=reactExports.useMemo(()=>onlyElements(s),[s]),v=p.map(getChildKey),y=reactExports.useRef(!0),b=reactExports.useRef(p),S=useConstant(()=>new Map),[E,R]=reactExports.useState(p),[O,I]=reactExports.useState(p);useIsomorphicLayoutEffect$1(()=>{y.current=!1,b.current=p;for(let D=0;D<O.length;D++){const G=getChildKey(O[D]);v.includes(G)?S.delete(G):S.get(G)!==!0&&S.set(G,!1)}},[O,v.length,v.join("-")]);const B=[];if(p!==E){let D=[...p];for(let G=0;G<O.length;G++){const V=O[G],U=getChildKey(V);v.includes(U)||(D.splice(G,0,V),B.push(V))}h==="wait"&&B.length&&(D=B),I(onlyElements(D)),R(p);return}const{forceRender:N}=reactExports.useContext(LayoutGroupContext);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:O.map(D=>{const G=getChildKey(D),V=p===O||v.includes(G),U=()=>{if(S.has(G))S.set(G,!0);else return;let te=!0;S.forEach(Z=>{Z||(te=!1)}),te&&(N==null||N(),I(b.current),f&&f())};return jsxRuntimeExports.jsx(PresenceChild,{isPresent:V,initial:!y.current||l?void 0:!1,custom:V?void 0:u,presenceAffectsLayout:c,mode:h,onExitComplete:V?void 0:U,children:D},G)})})};var toastMotionVariants={initial:s=>{const{position:a}=s,u=["top","bottom"].includes(a)?"y":"x";let l=["top-right","bottom-right"].includes(a)?1:-1;return a==="bottom"&&(l=1),{opacity:0,[u]:l*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]}}},ToastComponent=reactExports.memo(s=>{const{id:a,message:u,onCloseComplete:l,onRequestRemove:f,requestClose:c=!1,position:h="bottom",duration:p=5e3,containerStyle:v,motionVariants:y=toastMotionVariants,toastSpacing:b="0.5rem"}=s,[S,E]=reactExports.useState(p),R=useIsPresent();useUpdateEffect(()=>{R||l==null||l()},[R]),useUpdateEffect(()=>{E(p)},[p]);const O=()=>E(null),I=()=>E(p),B=()=>{R&&f()};reactExports.useEffect(()=>{R&&c&&f()},[R,c,f]),useTimeout(B,S);const N=reactExports.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:b,...v}),[v,b]),D=reactExports.useMemo(()=>getToastStyle(h),[h]);return jsxRuntimeExports.jsx(motion.div,{layout:!0,className:"chakra-toast",variants:y,initial:"initial",animate:"animate",exit:"exit",onHoverStart:O,onHoverEnd:I,custom:{position:h},style:D,children:jsxRuntimeExports.jsx(chakra.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:N,children:runIfFn$2(u,{id:a,onClose:B})})})});ToastComponent.displayName="ToastComponent";var fallbackIcon={path:jsxRuntimeExports.jsxs("g",{stroke:"currentColor",strokeWidth:"1.5",children:[jsxRuntimeExports.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"}),jsxRuntimeExports.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"}),jsxRuntimeExports.jsx("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},Icon=forwardRef((s,a)=>{const{as:u,viewBox:l,color:f="currentColor",focusable:c=!1,children:h,className:p,__css:v,...y}=s,b=cx("chakra-icon",p),S=useStyleConfig("Icon",s),E={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:f,...v,...S},R={ref:a,focusable:c,className:b,__css:E},O=l??fallbackIcon.viewBox;if(u&&typeof u!="string")return jsxRuntimeExports.jsx(chakra.svg,{as:u,...R,...y});const I=h??fallbackIcon.path;return jsxRuntimeExports.jsx(chakra.svg,{verticalAlign:"middle",viewBox:O,...R,...y,children:I})});Icon.displayName="Icon";function createIcon(s){const{viewBox:a="0 0 24 24",d:u,displayName:l,defaultProps:f={}}=s,c=reactExports.Children.toArray(s.path),h=forwardRef((p,v)=>jsxRuntimeExports.jsx(Icon,{ref:v,viewBox:a,...f,...p,children:c.length?c:jsxRuntimeExports.jsx("path",{fill:"currentColor",d:u})}));return h.displayName=l,h}function CheckIcon(s){return jsxRuntimeExports.jsx(Icon,{viewBox:"0 0 24 24",...s,children:jsxRuntimeExports.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 InfoIcon(s){return jsxRuntimeExports.jsx(Icon,{viewBox:"0 0 24 24",...s,children:jsxRuntimeExports.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 WarningIcon$1(s){return jsxRuntimeExports.jsx(Icon,{viewBox:"0 0 24 24",...s,children:jsxRuntimeExports.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 spin=keyframes$1({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),Spinner=forwardRef((s,a)=>{const u=useStyleConfig("Spinner",s),{label:l="Loading...",thickness:f="2px",speed:c="0.45s",emptyColor:h="transparent",className:p,...v}=omitThemingProps(s),y=cx("chakra-spinner",p),b={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:f,borderBottomColor:h,borderLeftColor:h,animation:`${spin} ${c} linear infinite`,...u};return jsxRuntimeExports.jsx(chakra.div,{ref:a,__css:b,className:y,...v,children:l&&jsxRuntimeExports.jsx(chakra.span,{srOnly:!0,children:l})})});Spinner.displayName="Spinner";var[AlertProvider,useAlertContext]=createContext$1({name:"AlertContext",hookName:"useAlertContext",providerName:"<Alert />"}),[AlertStylesProvider,useAlertStyles]=createContext$1({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:"<Alert />"}),STATUSES={info:{icon:InfoIcon,colorScheme:"blue"},warning:{icon:WarningIcon$1,colorScheme:"orange"},success:{icon:CheckIcon,colorScheme:"green"},error:{icon:WarningIcon$1,colorScheme:"red"},loading:{icon:Spinner,colorScheme:"blue"}};function getStatusColorScheme(s){return STATUSES[s].colorScheme}function getStatusIcon(s){return STATUSES[s].icon}var AlertDescription=forwardRef(function(a,u){const l=useAlertStyles(),{status:f}=useAlertContext(),c={display:"inline",...l.description};return jsxRuntimeExports.jsx(chakra.div,{ref:u,"data-status":f,...a,className:cx("chakra-alert__desc",a.className),__css:c})});AlertDescription.displayName="AlertDescription";function AlertIcon(s){const{status:a}=useAlertContext(),u=getStatusIcon(a),l=useAlertStyles(),f=a==="loading"?l.spinner:l.icon;return jsxRuntimeExports.jsx(chakra.span,{display:"inherit","data-status":a,...s,className:cx("chakra-alert__icon",s.className),__css:f,children:s.children||jsxRuntimeExports.jsx(u,{h:"100%",w:"100%"})})}AlertIcon.displayName="AlertIcon";var AlertTitle=forwardRef(function(a,u){const l=useAlertStyles(),{status:f}=useAlertContext();return jsxRuntimeExports.jsx(chakra.div,{ref:u,"data-status":f,...a,className:cx("chakra-alert__title",a.className),__css:l.title})});AlertTitle.displayName="AlertTitle";var Alert=forwardRef(function(a,u){var l;const{status:f="info",addRole:c=!0,...h}=omitThemingProps(a),p=(l=a.colorScheme)!=null?l:getStatusColorScheme(f),v=useMultiStyleConfig("Alert",{...a,colorScheme:p}),y={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...v.container};return jsxRuntimeExports.jsx(AlertProvider,{value:{status:f},children:jsxRuntimeExports.jsx(AlertStylesProvider,{value:v,children:jsxRuntimeExports.jsx(chakra.div,{"data-status":f,role:c?"alert":void 0,ref:u,...h,className:cx("chakra-alert",a.className),__css:y})})})});Alert.displayName="Alert";function CloseIcon(s){return jsxRuntimeExports.jsx(Icon,{focusable:"false","aria-hidden":!0,...s,children:jsxRuntimeExports.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 CloseButton=forwardRef(function(a,u){const l=useStyleConfig("CloseButton",a),{children:f,isDisabled:c,__css:h,...p}=omitThemingProps(a),v={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return jsxRuntimeExports.jsx(chakra.button,{type:"button","aria-label":"Close",ref:u,disabled:c,__css:{...v,...l,...h},...p,children:f||jsxRuntimeExports.jsx(CloseIcon,{width:"1em",height:"1em"})})});CloseButton.displayName="CloseButton";var initialState={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},toastStore=createStore(initialState);function createStore(s){let a=s;const u=new Set,l=f=>{a=f(a),u.forEach(c=>c())};return{getState:()=>a,subscribe:f=>(u.add(f),()=>{l(()=>s),u.delete(f)}),removeToast:(f,c)=>{l(h=>({...h,[c]:h[c].filter(p=>p.id!=f)}))},notify:(f,c)=>{const h=createToast(f,c),{position:p,id:v}=h;return l(y=>{var b,S;const R=p.includes("top")?[h,...(b=y[p])!=null?b:[]]:[...(S=y[p])!=null?S:[],h];return{...y,[p]:R}}),v},update:(f,c)=>{f&&l(h=>{const p={...h},{position:v,index:y}=findToast(p,f);return v&&y!==-1&&(p[v][y]={...p[v][y],...c,message:createRenderToast(c)}),p})},closeAll:({positions:f}={})=>{l(c=>(f??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((v,y)=>(v[y]=c[y].map(b=>({...b,requestClose:!0})),v),{...c}))},close:f=>{l(c=>{const h=getToastPosition(c,f);return h?{...c,[h]:c[h].map(p=>p.id==f?{...p,requestClose:!0}:p)}:c})},isActive:f=>!!findToast(toastStore.getState(),f).position}}var counter=0;function createToast(s,a={}){var u,l;counter+=1;const f=(u=a.id)!=null?u:counter,c=(l=a.position)!=null?l:"bottom";return{id:f,message:s,position:c,duration:a.duration,onCloseComplete:a.onCloseComplete,onRequestRemove:()=>toastStore.removeToast(String(f),c),status:a.status,requestClose:!1,containerStyle:a.containerStyle}}var Toast=s=>{const{status:a,variant:u="solid",id:l,title:f,isClosable:c,onClose:h,description:p,colorScheme:v,icon:y}=s,b=l?{root:`toast-${l}`,title:`toast-${l}-title`,description:`toast-${l}-description`}:void 0;return jsxRuntimeExports.jsxs(Alert,{addRole:!1,status:a,variant:u,id:b==null?void 0:b.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto",colorScheme:v,children:[jsxRuntimeExports.jsx(AlertIcon,{children:y}),jsxRuntimeExports.jsxs(chakra.div,{flex:"1",maxWidth:"100%",children:[f&&jsxRuntimeExports.jsx(AlertTitle,{id:b==null?void 0:b.title,children:f}),p&&jsxRuntimeExports.jsx(AlertDescription,{id:b==null?void 0:b.description,display:"block",children:p})]}),c&&jsxRuntimeExports.jsx(CloseButton,{size:"sm",onClick:h,position:"absolute",insetEnd:1,top:1})]})};function createRenderToast(s={}){const{render:a,toastComponent:u=Toast}=s;return f=>typeof a=="function"?a({...f,...s}):jsxRuntimeExports.jsx(u,{...f,...s})}var[ToastOptionProvider,useToastOptionContext]=createContext$1({name:"ToastOptionsContext",strict:!1}),ToastProvider=s=>{const a=reactExports.useSyncExternalStore(toastStore.subscribe,toastStore.getState,toastStore.getState),{motionVariants:u,component:l=ToastComponent,portalProps:f}=s,h=Object.keys(a).map(p=>{const v=a[p];return jsxRuntimeExports.jsx("div",{role:"region","aria-live":"polite","aria-label":`Notifications-${p}`,id:`chakra-toast-manager-${p}`,style:getToastListStyle(p),children:jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,children:v.map(y=>jsxRuntimeExports.jsx(l,{motionVariants:u,...y},y.id))})},p)});return jsxRuntimeExports.jsx(Portal,{...f,children:h})},createChakraProvider=s=>function({children:u,theme:l=s,toastOptions:f,...c}){return jsxRuntimeExports.jsxs(ChakraProvider$1,{theme:l,...c,children:[jsxRuntimeExports.jsx(ToastOptionProvider,{value:f==null?void 0:f.defaultOptions,children:u}),jsxRuntimeExports.jsx(ToastProvider,{...f})]})},ChakraProvider=createChakraProvider(theme$1),__defProp$1=Object.defineProperty,__defNormalProp$1=(s,a,u)=>a in s?__defProp$1(s,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):s[a]=u,__publicField$1=(s,a,u)=>(__defNormalProp$1(s,typeof a!="symbol"?a+"":a,u),u);function sortNodes(s){return s.sort((a,u)=>{const l=a.compareDocumentPosition(u);if(l&Node.DOCUMENT_POSITION_FOLLOWING||l&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(l&Node.DOCUMENT_POSITION_PRECEDING||l&Node.DOCUMENT_POSITION_CONTAINS)return 1;if(l&Node.DOCUMENT_POSITION_DISCONNECTED||l&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)throw Error("Cannot sort the given nodes.");return 0})}var isElement$1=s=>typeof s=="object"&&"nodeType"in s&&s.nodeType===Node.ELEMENT_NODE;function getNextIndex(s,a,u){let l=s+1;return u&&l>=a&&(l=0),l}function getPrevIndex(s,a,u){let l=s-1;return u&&l<0&&(l=a),l}var useSafeLayoutEffect$1=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect,cast=s=>s,DescendantsManager=class{constructor(){__publicField$1(this,"descendants",new Map),__publicField$1(this,"register",s=>{if(s!=null)return isElement$1(s)?this.registerNode(s):a=>{this.registerNode(a,s)}}),__publicField$1(this,"unregister",s=>{this.descendants.delete(s);const a=sortNodes(Array.from(this.descendants.keys()));this.assignIndex(a)}),__publicField$1(this,"destroy",()=>{this.descendants.clear()}),__publicField$1(this,"assignIndex",s=>{this.descendants.forEach(a=>{const u=s.indexOf(a.node);a.index=u,a.node.dataset.index=a.index.toString()})}),__publicField$1(this,"count",()=>this.descendants.size),__publicField$1(this,"enabledCount",()=>this.enabledValues().length),__publicField$1(this,"values",()=>Array.from(this.descendants.values()).sort((a,u)=>a.index-u.index)),__publicField$1(this,"enabledValues",()=>this.values().filter(s=>!s.disabled)),__publicField$1(this,"item",s=>{if(this.count()!==0)return this.values()[s]}),__publicField$1(this,"enabledItem",s=>{if(this.enabledCount()!==0)return this.enabledValues()[s]}),__publicField$1(this,"first",()=>this.item(0)),__publicField$1(this,"firstEnabled",()=>this.enabledItem(0)),__publicField$1(this,"last",()=>this.item(this.descendants.size-1)),__publicField$1(this,"lastEnabled",()=>{const s=this.enabledValues().length-1;return this.enabledItem(s)}),__publicField$1(this,"indexOf",s=>{var a,u;return s&&(u=(a=this.descendants.get(s))==null?void 0:a.index)!=null?u:-1}),__publicField$1(this,"enabledIndexOf",s=>s==null?-1:this.enabledValues().findIndex(a=>a.node.isSameNode(s))),__publicField$1(this,"next",(s,a=!0)=>{const u=getNextIndex(s,this.count(),a);return this.item(u)}),__publicField$1(this,"nextEnabled",(s,a=!0)=>{const u=this.item(s);if(!u)return;const l=this.enabledIndexOf(u.node),f=getNextIndex(l,this.enabledCount(),a);return this.enabledItem(f)}),__publicField$1(this,"prev",(s,a=!0)=>{const u=getPrevIndex(s,this.count()-1,a);return this.item(u)}),__publicField$1(this,"prevEnabled",(s,a=!0)=>{const u=this.item(s);if(!u)return;const l=this.enabledIndexOf(u.node),f=getPrevIndex(l,this.enabledCount()-1,a);return this.enabledItem(f)}),__publicField$1(this,"registerNode",(s,a)=>{if(!s||this.descendants.has(s))return;const u=Array.from(this.descendants.keys()).concat(s),l=sortNodes(u);a!=null&&a.disabled&&(a.disabled=!!a.disabled);const f={node:s,index:-1,...a};this.descendants.set(s,f),this.assignIndex(l)})}};function assignRef$1(s,a){if(s!=null){if(typeof s=="function"){s(a);return}try{s.current=a}catch{throw new Error(`Cannot assign value '${a}' to ref '${s}'`)}}}function mergeRefs(...s){return a=>{s.forEach(u=>{assignRef$1(u,a)})}}function useMergeRefs$1(...s){return reactExports.useMemo(()=>mergeRefs(...s),s)}function useDescendants(){const s=reactExports.useRef(new DescendantsManager);return useSafeLayoutEffect$1(()=>()=>s.current.destroy()),s.current}var[DescendantsContextProvider,useDescendantsContext]=createContext$1({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function useDescendant(s){const a=useDescendantsContext(),[u,l]=reactExports.useState(-1),f=reactExports.useRef(null);useSafeLayoutEffect$1(()=>()=>{f.current&&a.unregister(f.current)},[]),useSafeLayoutEffect$1(()=>{if(!f.current)return;const h=Number(f.current.dataset.index);u!=h&&!Number.isNaN(h)&&l(h)});const c=cast(s?a.register(s):a.register);return{descendants:a,index:u,enabledIndex:a.enabledIndexOf(f.current),register:mergeRefs(c,f)}}function createDescendantContext(){return[cast(DescendantsContextProvider),()=>cast(useDescendantsContext()),()=>useDescendants(),f=>useDescendant(f)]}var[AccordionStylesProvider,useAccordionStyles]=createContext$1({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:"<Accordion />"}),[AccordionItemProvider,useAccordionItemContext]=createContext$1({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:"<AccordionItem />"}),[AccordionDescendantsProvider,useAccordionDescendantsContext,useAccordionDescendants,useAccordionDescendant]=createDescendantContext(),AccordionButton=forwardRef(function(a,u){const{getButtonProps:l}=useAccordionItemContext(),f=l(a,u),h={display:"flex",alignItems:"center",width:"100%",outline:0,...useAccordionStyles().button};return jsxRuntimeExports.jsx(chakra.button,{...f,className:cx("chakra-accordion__button",a.className),__css:h})});AccordionButton.displayName="AccordionButton";function useControllableState(s){const{value:a,defaultValue:u,onChange:l,shouldUpdate:f=(E,R)=>E!==R}=s,c=useCallbackRef$2(l),h=useCallbackRef$2(f),[p,v]=reactExports.useState(u),y=a!==void 0,b=y?a:p,S=useCallbackRef$2(E=>{const O=typeof E=="function"?E(b):E;h(b,O)&&(y||v(O),c(O))},[y,c,b,h]);return[b,S]}function useAccordion(s){const{onChange:a,defaultIndex:u,index:l,allowMultiple:f,allowToggle:c,...h}=s;allowMultipleWarning(s),allowMultipleAndAllowToggleWarning(s);const p=useAccordionDescendants(),[v,y]=reactExports.useState(-1);reactExports.useEffect(()=>()=>{y(-1)},[]);const[b,S]=useControllableState({value:l,defaultValue(){return f?u??[]:u??-1},onChange:a});return{index:b,setIndex:S,htmlProps:h,getAccordionItemProps:R=>{let O=!1;return R!==null&&(O=Array.isArray(b)?b.includes(R):b===R),{isOpen:O,onChange:B=>{if(R!==null)if(f&&Array.isArray(b)){const N=B?b.concat(R):b.filter(D=>D!==R);S(N)}else B?S(R):c&&S(-1)}}},focusedIndex:v,setFocusedIndex:y,descendants:p}}var[AccordionProvider,useAccordionContext]=createContext$1({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function useAccordionItem(s){const{isDisabled:a,isFocusable:u,id:l,...f}=s,{getAccordionItemProps:c,setFocusedIndex:h}=useAccordionContext(),p=reactExports.useRef(null),v=reactExports.useId(),y=l??v,b=`accordion-button-${y}`,S=`accordion-panel-${y}`;focusableNotDisabledWarning(s);const{register:E,index:R,descendants:O}=useAccordionDescendant({disabled:a&&!u}),{isOpen:I,onChange:B}=c(R===-1?null:R);warnIfOpenAndDisabled({isOpen:I,isDisabled:a});const N=()=>{B==null||B(!0)},D=()=>{B==null||B(!1)},G=reactExports.useCallback(()=>{B==null||B(!I),h(R)},[R,h,I,B]),V=reactExports.useCallback(J=>{const ee={ArrowDown:()=>{const k=O.nextEnabled(R);k==null||k.node.focus()},ArrowUp:()=>{const k=O.prevEnabled(R);k==null||k.node.focus()},Home:()=>{const k=O.firstEnabled();k==null||k.node.focus()},End:()=>{const k=O.lastEnabled();k==null||k.node.focus()}}[J.key];ee&&(J.preventDefault(),ee(J))},[O,R]),U=reactExports.useCallback(()=>{h(R)},[h,R]),te=reactExports.useCallback(function(Q={},ee=null){return{...Q,type:"button",ref:mergeRefs(E,p,ee),id:b,disabled:!!a,"aria-expanded":!!I,"aria-controls":S,onClick:callAllHandlers$1(Q.onClick,G),onFocus:callAllHandlers$1(Q.onFocus,U),onKeyDown:callAllHandlers$1(Q.onKeyDown,V)}},[b,a,I,G,U,V,S,E]),Z=reactExports.useCallback(function(Q={},ee=null){return{...Q,ref:ee,role:"region",id:S,"aria-labelledby":b,hidden:!I}},[b,I,S]);return{isOpen:I,isDisabled:a,isFocusable:u,onOpen:N,onClose:D,getButtonProps:te,getPanelProps:Z,htmlProps:f}}function allowMultipleWarning(s){const a=s.index||s.defaultIndex,u=a!=null&&!Array.isArray(a)&&s.allowMultiple;warn({condition:!!u,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof a},`})}function allowMultipleAndAllowToggleWarning(s){warn({condition:!!(s.allowMultiple&&s.allowToggle),message:"If 'allowMultiple' is passed, 'allowToggle' will be ignored. Either remove 'allowToggle' or 'allowMultiple' depending on whether you want multiple accordions visible or not"})}function focusableNotDisabledWarning(s){warn({condition:!!(s.isFocusable&&!s.isDisabled),message:`Using only 'isFocusable', this prop is reserved for situations where you pass 'isDisabled' but you still want the element to receive focus (A11y). Either remove it or pass 'isDisabled' as well.
    `})}function warnIfOpenAndDisabled(s){warn({condition:s.isOpen&&!!s.isDisabled,message:"Cannot open a disabled accordion item"})}function AccordionIcon(s){const{isOpen:a,isDisabled:u}=useAccordionItemContext(),{reduceMotion:l}=useAccordionContext(),f=cx("chakra-accordion__icon",s.className),c=useAccordionStyles(),h={opacity:u?.4:1,transform:a?"rotate(-180deg)":void 0,transition:l?void 0:"transform 0.2s",transformOrigin:"center",...c.icon};return jsxRuntimeExports.jsx(Icon,{viewBox:"0 0 24 24","aria-hidden":!0,className:f,__css:h,...s,children:jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})})}AccordionIcon.displayName="AccordionIcon";var AccordionItem=forwardRef(function(a,u){const{children:l,className:f}=a,{htmlProps:c,...h}=useAccordionItem(a),v={...useAccordionStyles().container,overflowAnchor:"none"},y=reactExports.useMemo(()=>h,[h]);return jsxRuntimeExports.jsx(AccordionItemProvider,{value:y,children:jsxRuntimeExports.jsx(chakra.div,{ref:u,...c,className:cx("chakra-accordion__item",f),__css:v,children:typeof l=="function"?l({isExpanded:!!h.isOpen,isDisabled:!!h.isDisabled}):l})})});AccordionItem.displayName="AccordionItem";var TRANSITION_EASINGS={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},TRANSITION_DEFAULTS={enter:{duration:.2,ease:TRANSITION_EASINGS.easeOut},exit:{duration:.1,ease:TRANSITION_EASINGS.easeIn}},withDelay={enter:(s,a)=>({...s,delay:typeof a=="number"?a:a==null?void 0:a.enter}),exit:(s,a)=>({...s,delay:typeof a=="number"?a:a==null?void 0:a.exit})},isNumeric$1=s=>s!=null&&parseInt(s.toString(),10)>0,defaultTransitions={exit:{height:{duration:.2,ease:TRANSITION_EASINGS.ease},opacity:{duration:.3,ease:TRANSITION_EASINGS.ease}},enter:{height:{duration:.3,ease:TRANSITION_EASINGS.ease},opacity:{duration:.4,ease:TRANSITION_EASINGS.ease}}},variants$2={exit:({animateOpacity:s,startingHeight:a,transition:u,transitionEnd:l,delay:f})=>{var c;return{...s&&{opacity:isNumeric$1(a)?1:0},height:a,transitionEnd:l==null?void 0:l.exit,transition:(c=u==null?void 0:u.exit)!=null?c:withDelay.exit(defaultTransitions.exit,f)}},enter:({animateOpacity:s,endingHeight:a,transition:u,transitionEnd:l,delay:f})=>{var c;return{...s&&{opacity:1},height:a,transitionEnd:l==null?void 0:l.enter,transition:(c=u==null?void 0:u.enter)!=null?c:withDelay.enter(defaultTransitions.enter,f)}}},Collapse=reactExports.forwardRef((s,a)=>{const{in:u,unmountOnExit:l,animateOpacity:f=!0,startingHeight:c=0,endingHeight:h="auto",style:p,className:v,transition:y,transitionEnd:b,...S}=s,[E,R]=reactExports.useState(!1);reactExports.useEffect(()=>{const D=setTimeout(()=>{R(!0)});return()=>clearTimeout(D)},[]),warn({condition:Number(c)>0&&!!l,message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const O=parseFloat(c.toString())>0,I={startingHeight:c,endingHeight:h,animateOpacity:f,transition:E?y:{enter:{duration:0}},transitionEnd:{enter:b==null?void 0:b.enter,exit:l?b==null?void 0:b.exit:{...b==null?void 0:b.exit,display:O?"block":"none"}}},B=l?u:!0,N=u||l?"enter":"exit";return jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,custom:I,children:B&&jsxRuntimeExports.jsx(motion.div,{ref:a,...S,className:cx("chakra-collapse",v),style:{overflow:"hidden",display:"block",...p},custom:I,variants:variants$2,initial:l?"exit":!1,animate:N,exit:"exit"})})});Collapse.displayName="Collapse";var variants$1={exit:({reverse:s,initialScale:a,transition:u,transitionEnd:l,delay:f})=>{var c;return{opacity:0,...s?{scale:a,transitionEnd:l==null?void 0:l.exit}:{transitionEnd:{scale:a,...l==null?void 0:l.exit}},transition:(c=u==null?void 0:u.exit)!=null?c:withDelay.exit(TRANSITION_DEFAULTS.exit,f)}},enter:({transitionEnd:s,transition:a,delay:u})=>{var l;return{opacity:1,scale:1,transition:(l=a==null?void 0:a.enter)!=null?l:withDelay.enter(TRANSITION_DEFAULTS.enter,u),transitionEnd:s==null?void 0:s.enter}}},scaleFadeConfig={initial:"exit",animate:"enter",exit:"exit",variants:variants$1},ScaleFade=reactExports.forwardRef(function(a,u){const{unmountOnExit:l,in:f,reverse:c=!0,initialScale:h=.95,className:p,transition:v,transitionEnd:y,delay:b,...S}=a,E=l?f&&l:!0,R=f||l?"enter":"exit",O={initialScale:h,reverse:c,transition:v,transitionEnd:y,delay:b};return jsxRuntimeExports.jsx(AnimatePresence,{custom:O,children:E&&jsxRuntimeExports.jsx(motion.div,{ref:u,className:cx("chakra-offset-slide",p),...scaleFadeConfig,animate:R,custom:O,...S})})});ScaleFade.displayName="ScaleFade";var variants={initial:({offsetX:s,offsetY:a,transition:u,transitionEnd:l,delay:f})=>{var c;return{opacity:0,x:s,y:a,transition:(c=u==null?void 0:u.exit)!=null?c:withDelay.exit(TRANSITION_DEFAULTS.exit,f),transitionEnd:l==null?void 0:l.exit}},enter:({transition:s,transitionEnd:a,delay:u})=>{var l;return{opacity:1,x:0,y:0,transition:(l=s==null?void 0:s.enter)!=null?l:withDelay.enter(TRANSITION_DEFAULTS.enter,u),transitionEnd:a==null?void 0:a.enter}},exit:({offsetY:s,offsetX:a,transition:u,transitionEnd:l,reverse:f,delay:c})=>{var h;const p={x:a,y:s};return{opacity:0,transition:(h=u==null?void 0:u.exit)!=null?h:withDelay.exit(TRANSITION_DEFAULTS.exit,c),...f?{...p,transitionEnd:l==null?void 0:l.exit}:{transitionEnd:{...p,...l==null?void 0:l.exit}}}}},slideFadeConfig={initial:"initial",animate:"enter",exit:"exit",variants},SlideFade=reactExports.forwardRef(function(a,u){const{unmountOnExit:l,in:f,reverse:c=!0,className:h,offsetX:p=0,offsetY:v=8,transition:y,transitionEnd:b,delay:S,...E}=a,R=l?f&&l:!0,O=f||l?"enter":"exit",I={offsetX:p,offsetY:v,reverse:c,transition:y,transitionEnd:b,delay:S};return jsxRuntimeExports.jsx(AnimatePresence,{custom:I,children:R&&jsxRuntimeExports.jsx(motion.div,{ref:u,className:cx("chakra-offset-slide",h),custom:I,...slideFadeConfig,animate:O,...E})})});SlideFade.displayName="SlideFade";var AccordionPanel=forwardRef(function(a,u){const{className:l,motionProps:f,...c}=a,{reduceMotion:h}=useAccordionContext(),{getPanelProps:p,isOpen:v}=useAccordionItemContext(),y=p(c,u),b=cx("chakra-accordion__panel",l),S=useAccordionStyles();h||delete y.hidden;const E=jsxRuntimeExports.jsx(chakra.div,{...y,__css:S.panel,className:b});return h?E:jsxRuntimeExports.jsx(Collapse,{in:v,...f,children:E})});AccordionPanel.displayName="AccordionPanel";var Accordion=forwardRef(function({children:a,reduceMotion:u,...l},f){const c=useMultiStyleConfig("Accordion",l),h=omitThemingProps(l),{htmlProps:p,descendants:v,...y}=useAccordion(h),b=reactExports.useMemo(()=>({...y,reduceMotion:!!u}),[y,u]);return jsxRuntimeExports.jsx(AccordionDescendantsProvider,{value:v,children:jsxRuntimeExports.jsx(AccordionProvider,{value:b,children:jsxRuntimeExports.jsx(AccordionStylesProvider,{value:c,children:jsxRuntimeExports.jsx(chakra.div,{ref:f,...p,className:cx("chakra-accordion",l.className),__css:c.root,children:a})})})})});Accordion.displayName="Accordion";function getValidChildren(s){return reactExports.Children.toArray(s).filter(a=>reactExports.isValidElement(a))}var[ButtonGroupProvider,useButtonGroup]=createContext$1({strict:!1,name:"ButtonGroupContext"});function useButtonType(s){const[a,u]=reactExports.useState(!s);return{ref:reactExports.useCallback(c=>{c&&u(c.tagName==="BUTTON")},[]),type:a?"button":void 0}}function ButtonIcon(s){const{children:a,className:u,...l}=s,f=reactExports.isValidElement(a)?reactExports.cloneElement(a,{"aria-hidden":!0,focusable:!1}):a,c=cx("chakra-button__icon",u);return jsxRuntimeExports.jsx(chakra.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...l,className:c,children:f})}ButtonIcon.displayName="ButtonIcon";function ButtonSpinner(s){const{label:a,placement:u,spacing:l="0.5rem",children:f=jsxRuntimeExports.jsx(Spinner,{color:"currentColor",width:"1em",height:"1em"}),className:c,__css:h,...p}=s,v=cx("chakra-button__spinner",c),y=u==="start"?"marginEnd":"marginStart",b=reactExports.useMemo(()=>({display:"flex",alignItems:"center",position:a?"relative":"absolute",[y]:a?l:0,fontSize:"1em",lineHeight:"normal",...h}),[h,a,y,l]);return jsxRuntimeExports.jsx(chakra.div,{className:v,...p,__css:b,children:f})}ButtonSpinner.displayName="ButtonSpinner";var Button=forwardRef((s,a)=>{const u=useButtonGroup(),l=useStyleConfig("Button",{...u,...s}),{isDisabled:f=u==null?void 0:u.isDisabled,isLoading:c,isActive:h,children:p,leftIcon:v,rightIcon:y,loadingText:b,iconSpacing:S="0.5rem",type:E,spinner:R,spinnerPlacement:O="start",className:I,as:B,...N}=omitThemingProps(s),D=reactExports.useMemo(()=>{const te={...l==null?void 0:l._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...l,...!!u&&{_focus:te}}},[l,u]),{ref:G,type:V}=useButtonType(B),U={rightIcon:y,leftIcon:v,iconSpacing:S,children:p};return jsxRuntimeExports.jsxs(chakra.button,{ref:useMergeRefs$1(a,G),as:B,type:E??V,"data-active":dataAttr(h),"data-loading":dataAttr(c),__css:D,className:cx("chakra-button",I),...N,disabled:f||c,children:[c&&O==="start"&&jsxRuntimeExports.jsx(ButtonSpinner,{className:"chakra-button__spinner--start",label:b,placement:"start",spacing:S,children:R}),c?b||jsxRuntimeExports.jsx(chakra.span,{opacity:0,children:jsxRuntimeExports.jsx(ButtonContent,{...U})}):jsxRuntimeExports.jsx(ButtonContent,{...U}),c&&O==="end"&&jsxRuntimeExports.jsx(ButtonSpinner,{className:"chakra-button__spinner--end",label:b,placement:"end",spacing:S,children:R})]})});Button.displayName="Button";function ButtonContent(s){const{leftIcon:a,rightIcon:u,children:l,iconSpacing:f}=s;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[a&&jsxRuntimeExports.jsx(ButtonIcon,{marginEnd:f,children:a}),l,u&&jsxRuntimeExports.jsx(ButtonIcon,{marginStart:f,children:u})]})}var[CardStylesProvider,useCardStyles]=createStylesContext("Card"),CardBody=forwardRef(function(a,u){const{className:l,...f}=a,c=useCardStyles();return jsxRuntimeExports.jsx(chakra.div,{ref:u,className:cx("chakra-card__body",l),__css:c.body,...f})}),Card=forwardRef(function(a,u){const{className:l,children:f,direction:c="column",justify:h,align:p,...v}=omitThemingProps(a),y=useMultiStyleConfig("Card",a);return jsxRuntimeExports.jsx(chakra.div,{ref:u,className:cx("chakra-card",l),__css:{display:"flex",flexDirection:c,justifyContent:h,alignItems:p,position:"relative",minWidth:0,wordWrap:"break-word",...y.container},...v,children:jsxRuntimeExports.jsx(CardStylesProvider,{value:y,children:f})})}),[FormControlStylesProvider,useFormControlStyles]=createContext$1({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "<FormControl />" `}),[FormControlProvider,useFormControlContext]=createContext$1({strict:!1,name:"FormControlContext"});function useFormControlProvider(s){const{id:a,isRequired:u,isInvalid:l,isDisabled:f,isReadOnly:c,...h}=s,p=reactExports.useId(),v=a||`field-${p}`,y=`${v}-label`,b=`${v}-feedback`,S=`${v}-helptext`,[E,R]=reactExports.useState(!1),[O,I]=reactExports.useState(!1),[B,N]=reactExports.useState(!1),D=reactExports.useCallback((Z={},J=null)=>({id:S,...Z,ref:mergeRefs(J,Q=>{Q&&I(!0)})}),[S]),G=reactExports.useCallback((Z={},J=null)=>({...Z,ref:J,"data-focus":dataAttr(B),"data-disabled":dataAttr(f),"data-invalid":dataAttr(l),"data-readonly":dataAttr(c),id:Z.id!==void 0?Z.id:y,htmlFor:Z.htmlFor!==void 0?Z.htmlFor:v}),[v,f,B,l,c,y]),V=reactExports.useCallback((Z={},J=null)=>({id:b,...Z,ref:mergeRefs(J,Q=>{Q&&R(!0)}),"aria-live":"polite"}),[b]),U=reactExports.useCallback((Z={},J=null)=>({...Z,...h,ref:J,role:"group","data-focus":dataAttr(B),"data-disabled":dataAttr(f),"data-invalid":dataAttr(l),"data-readonly":dataAttr(c)}),[h,f,B,l,c]),te=reactExports.useCallback((Z={},J=null)=>({...Z,ref:J,role:"presentation","aria-hidden":!0,children:Z.children||"*"}),[]);return{isRequired:!!u,isInvalid:!!l,isReadOnly:!!c,isDisabled:!!f,isFocused:!!B,onFocus:()=>N(!0),onBlur:()=>N(!1),hasFeedbackText:E,setHasFeedbackText:R,hasHelpText:O,setHasHelpText:I,id:v,labelId:y,feedbackId:b,helpTextId:S,htmlProps:h,getHelpTextProps:D,getErrorMessageProps:V,getRootProps:U,getLabelProps:G,getRequiredIndicatorProps:te}}var FormControl=forwardRef(function(a,u){const l=useMultiStyleConfig("Form",a),f=omitThemingProps(a),{getRootProps:c,htmlProps:h,...p}=useFormControlProvider(f),v=cx("chakra-form-control",a.className);return jsxRuntimeExports.jsx(FormControlProvider,{value:p,children:jsxRuntimeExports.jsx(FormControlStylesProvider,{value:l,children:jsxRuntimeExports.jsx(chakra.div,{...c({},u),className:v,__css:l.container})})})});FormControl.displayName="FormControl";var FormHelperText=forwardRef(function(a,u){const l=useFormControlContext(),f=useFormControlStyles(),c=cx("chakra-form__helper-text",a.className);return jsxRuntimeExports.jsx(chakra.div,{...l==null?void 0:l.getHelpTextProps(a,u),__css:f.helperText,className:c})});FormHelperText.displayName="FormHelperText";function useFormControlProps(s){var a,u,l;const f=useFormControlContext(),{id:c,disabled:h,readOnly:p,required:v,isRequired:y,isInvalid:b,isReadOnly:S,isDisabled:E,onFocus:R,onBlur:O,...I}=s,B=s["aria-describedby"]?[s["aria-describedby"]]:[];return f!=null&&f.hasFeedbackText&&(f!=null&&f.isInvalid)&&B.push(f.feedbackId),f!=null&&f.hasHelpText&&B.push(f.helpTextId),{...I,"aria-describedby":B.join(" ")||void 0,id:c??(f==null?void 0:f.id),isDisabled:(a=h??E)!=null?a:f==null?void 0:f.isDisabled,isReadOnly:(u=p??S)!=null?u:f==null?void 0:f.isReadOnly,isRequired:(l=v??y)!=null?l:f==null?void 0:f.isRequired,isInvalid:b??(f==null?void 0:f.isInvalid),onFocus:callAllHandlers$1(f==null?void 0:f.onFocus,R),onBlur:callAllHandlers$1(f==null?void 0:f.onBlur,O)}}var visuallyHiddenStyle={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},isDom=()=>typeof document<"u",hasSetup=!1,modality=null,hasEventBeforeFocus=!1,hasBlurredWindowRecently=!1,handlers=new Set;function trigger(s,a){handlers.forEach(u=>u(s,a))}var isMac=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function isValidKey(s){return!(s.metaKey||!isMac&&s.altKey||s.ctrlKey||s.key==="Control"||s.key==="Shift"||s.key==="Meta")}function onKeyboardEvent(s){hasEventBeforeFocus=!0,isValidKey(s)&&(modality="keyboard",trigger("keyboard",s))}function onPointerEvent(s){if(modality="pointer",s.type==="mousedown"||s.type==="pointerdown"){hasEventBeforeFocus=!0;const a=s.composedPath?s.composedPath()[0]:s.target;let u=!1;try{u=a.matches(":focus-visible")}catch{}if(u)return;trigger("pointer",s)}}function isVirtualClick(s){return s.mozInputSource===0&&s.isTrusted?!0:s.detail===0&&!s.pointerType}function onClickEvent(s){isVirtualClick(s)&&(hasEventBeforeFocus=!0,modality="virtual")}function onWindowFocus(s){s.target===window||s.target===document||(!hasEventBeforeFocus&&!hasBlurredWindowRecently&&(modality="virtual",trigger("virtual",s)),hasEventBeforeFocus=!1,hasBlurredWindowRecently=!1)}function onWindowBlur$1(){hasEventBeforeFocus=!1,hasBlurredWindowRecently=!0}function isFocusVisible(){return modality!=="pointer"}function setupGlobalFocusEvents(){if(!isDom()||hasSetup)return;const{focus:s}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...u){hasEventBeforeFocus=!0,s.apply(this,u)},document.addEventListener("keydown",onKeyboardEvent,!0),document.addEventListener("keyup",onKeyboardEvent,!0),document.addEventListener("click",onClickEvent,!0),window.addEventListener("focus",onWindowFocus,!0),window.addEventListener("blur",onWindowBlur$1,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",onPointerEvent,!0),document.addEventListener("pointermove",onPointerEvent,!0),document.addEventListener("pointerup",onPointerEvent,!0)):(document.addEventListener("mousedown",onPointerEvent,!0),document.addEventListener("mousemove",onPointerEvent,!0),document.addEventListener("mouseup",onPointerEvent,!0)),hasSetup=!0}function trackFocusVisible(s){setupGlobalFocusEvents(),s(isFocusVisible());const a=()=>s(isFocusVisible());return handlers.add(a),()=>{handlers.delete(a)}}function omit(s,a=[]){const u=Object.assign({},s);for(const l of a)l in u&&delete u[l];return u}function useCheckbox(s={}){const a=useFormControlProps(s),{isDisabled:u,isReadOnly:l,isRequired:f,isInvalid:c,id:h,onBlur:p,onFocus:v,"aria-describedby":y}=a,{defaultChecked:b,isChecked:S,isFocusable:E,onChange:R,isIndeterminate:O,name:I,value:B,tabIndex:N=void 0,"aria-label":D,"aria-labelledby":G,"aria-invalid":V,...U}=s,te=omit(U,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),Z=useCallbackRef$2(R),J=useCallbackRef$2(p),Q=useCallbackRef$2(v),[ee,k]=reactExports.useState(!1),[d,g]=reactExports.useState(!1),[_,w]=reactExports.useState(!1),[x,P]=reactExports.useState(!1);reactExports.useEffect(()=>trackFocusVisible(k),[]);const $=reactExports.useRef(null),[T,m]=reactExports.useState(!0),[M,W]=reactExports.useState(!!b),Y=S!==void 0,ue=Y?S:M,ge=reactExports.useCallback(Pe=>{if(l||u){Pe.preventDefault();return}Y||W(ue?Pe.target.checked:O?!0:Pe.target.checked),Z==null||Z(Pe)},[l,u,ue,Y,O,Z]);useSafeLayoutEffect$2(()=>{$.current&&($.current.indeterminate=!!O)},[O]),useUpdateEffect(()=>{u&&g(!1)},[u,g]),useSafeLayoutEffect$2(()=>{const Pe=$.current;if(!(Pe!=null&&Pe.form))return;const Ie=()=>{W(!!b)};return Pe.form.addEventListener("reset",Ie),()=>{var Ke;return(Ke=Pe.form)==null?void 0:Ke.removeEventListener("reset",Ie)}},[]);const he=u&&!E,ae=reactExports.useCallback(Pe=>{Pe.key===" "&&P(!0)},[P]),de=reactExports.useCallback(Pe=>{Pe.key===" "&&P(!1)},[P]);useSafeLayoutEffect$2(()=>{if(!$.current)return;$.current.checked!==ue&&W($.current.checked)},[$.current]);const pe=reactExports.useCallback((Pe={},Ie=null)=>{const Ke=Le=>{d&&Le.preventDefault(),P(!0)};return{...Pe,ref:Ie,"data-active":dataAttr(x),"data-hover":dataAttr(_),"data-checked":dataAttr(ue),"data-focus":dataAttr(d),"data-focus-visible":dataAttr(d&&ee),"data-indeterminate":dataAttr(O),"data-disabled":dataAttr(u),"data-invalid":dataAttr(c),"data-readonly":dataAttr(l),"aria-hidden":!0,onMouseDown:callAllHandlers$1(Pe.onMouseDown,Ke),onMouseUp:callAllHandlers$1(Pe.onMouseUp,()=>P(!1)),onMouseEnter:callAllHandlers$1(Pe.onMouseEnter,()=>w(!0)),onMouseLeave:callAllHandlers$1(Pe.onMouseLeave,()=>w(!1))}},[x,ue,u,d,ee,_,O,c,l]),oe=reactExports.useCallback((Pe={},Ie=null)=>({...Pe,ref:Ie,"data-active":dataAttr(x),"data-hover":dataAttr(_),"data-checked":dataAttr(ue),"data-focus":dataAttr(d),"data-focus-visible":dataAttr(d&&ee),"data-indeterminate":dataAttr(O),"data-disabled":dataAttr(u),"data-invalid":dataAttr(c),"data-readonly":dataAttr(l)}),[x,ue,u,d,ee,_,O,c,l]),le=reactExports.useCallback((Pe={},Ie=null)=>({...te,...Pe,ref:mergeRefs(Ie,Ke=>{Ke&&m(Ke.tagName==="LABEL")}),onClick:callAllHandlers$1(Pe.onClick,()=>{var Ke;T||((Ke=$.current)==null||Ke.click(),requestAnimationFrame(()=>{var Le;(Le=$.current)==null||Le.focus({preventScroll:!0})}))}),"data-disabled":dataAttr(u),"data-checked":dataAttr(ue),"data-invalid":dataAttr(c)}),[te,u,ue,c,T]),me=reactExports.useCallback((Pe={},Ie=null)=>({...Pe,ref:mergeRefs($,Ie),type:"checkbox",name:I,value:B,id:h,tabIndex:N,onChange:callAllHandlers$1(Pe.onChange,ge),onBlur:callAllHandlers$1(Pe.onBlur,J,()=>g(!1)),onFocus:callAllHandlers$1(Pe.onFocus,Q,()=>g(!0)),onKeyDown:callAllHandlers$1(Pe.onKeyDown,ae),onKeyUp:callAllHandlers$1(Pe.onKeyUp,de),required:f,checked:ue,disabled:he,readOnly:l,"aria-label":D,"aria-labelledby":G,"aria-invalid":V?!!V:c,"aria-describedby":y,"aria-disabled":u,style:visuallyHiddenStyle}),[I,B,h,ge,J,Q,ae,de,f,ue,he,l,D,G,V,c,y,u,N]),xe=reactExports.useCallback((Pe={},Ie=null)=>({...Pe,ref:Ie,onMouseDown:callAllHandlers$1(Pe.onMouseDown,stopEvent),"data-disabled":dataAttr(u),"data-checked":dataAttr(ue),"data-invalid":dataAttr(c)}),[ue,u,c]);return{state:{isInvalid:c,isFocused:d,isChecked:ue,isActive:x,isHovered:_,isIndeterminate:O,isDisabled:u,isReadOnly:l,isRequired:f},getRootProps:le,getCheckboxProps:pe,getIndicatorProps:oe,getInputProps:me,getLabelProps:xe,htmlProps:te}}function stopEvent(s){s.preventDefault(),s.stopPropagation()}function _objectWithoutPropertiesLoose(s,a){if(s==null)return{};var u={};for(var l in s)if({}.hasOwnProperty.call(s,l)){if(a.includes(l))continue;u[l]=s[l]}return u}var FOCUS_GROUP="data-focus-lock",FOCUS_DISABLED="data-focus-lock-disabled",FOCUS_ALLOW="data-no-focus-lock",FOCUS_AUTO="data-autofocus-inside",FOCUS_NO_AUTOFOCUS="data-no-autofocus";function assignRef(s,a){return typeof s=="function"?s(a):s&&(s.current=a),s}function useCallbackRef$1(s,a){var u=reactExports.useState(function(){return{value:s,callback:a,facade:{get current(){return u.value},set current(l){var f=u.value;f!==l&&(u.value=l,u.callback(l,f))}}}})[0];return u.callback=a,u.facade}var useIsomorphicLayoutEffect=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect,currentValues=new WeakMap;function useMergeRefs(s,a){var u=useCallbackRef$1(null,function(l){return s.forEach(function(f){return assignRef(f,l)})});return useIsomorphicLayoutEffect(function(){var l=currentValues.get(u);if(l){var f=new Set(l),c=new Set(s),h=u.current;f.forEach(function(p){c.has(p)||assignRef(p,null)}),c.forEach(function(p){f.has(p)||assignRef(p,h)})}currentValues.set(u,s)},[s]),u}var hiddenGuard={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},extendStatics=function(s,a){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,l){u.__proto__=l}||function(u,l){for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(u[f]=l[f])},extendStatics(s,a)};function __extends$1(s,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");extendStatics(s,a);function u(){this.constructor=s}s.prototype=a===null?Object.create(a):(u.prototype=a.prototype,new u)}var __assign$1=function(){return __assign$1=Object.assign||function(a){for(var u,l=1,f=arguments.length;l<f;l++){u=arguments[l];for(var c in u)Object.prototype.hasOwnProperty.call(u,c)&&(a[c]=u[c])}return a},__assign$1.apply(this,arguments)};function __rest$3(s,a){var u={};for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&a.indexOf(l)<0&&(u[l]=s[l]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,l=Object.getOwnPropertySymbols(s);f<l.length;f++)a.indexOf(l[f])<0&&Object.prototype.propertyIsEnumerable.call(s,l[f])&&(u[l[f]]=s[l[f]]);return u}function __awaiter$8(s,a,u,l){function f(c){return c instanceof u?c:new u(function(h){h(c)})}return new(u||(u=Promise))(function(c,h){function p(b){try{y(l.next(b))}catch(S){h(S)}}function v(b){try{y(l.throw(b))}catch(S){h(S)}}function y(b){b.done?c(b.value):f(b.value).then(p,v)}y((l=l.apply(s,a||[])).next())})}function __generator$2(s,a){var u={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},l,f,c,h=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return h.next=p(0),h.throw=p(1),h.return=p(2),typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function p(y){return function(b){return v([y,b])}}function v(y){if(l)throw new TypeError("Generator is already executing.");for(;h&&(h=0,y[0]&&(u=0)),u;)try{if(l=1,f&&(c=y[0]&2?f.return:y[0]?f.throw||((c=f.return)&&c.call(f),0):f.next)&&!(c=c.call(f,y[1])).done)return c;switch(f=0,c&&(y=[y[0]&2,c.value]),y[0]){case 0:case 1:c=y;break;case 4:return u.label++,{value:y[1],done:!1};case 5:u.label++,f=y[1],y=[0];continue;case 7:y=u.ops.pop(),u.trys.pop();continue;default:if(c=u.trys,!(c=c.length>0&&c[c.length-1])&&(y[0]===6||y[0]===2)){u=0;continue}if(y[0]===3&&(!c||y[1]>c[0]&&y[1]<c[3])){u.label=y[1];break}if(y[0]===6&&u.label<c[1]){u.label=c[1],c=y;break}if(c&&u.label<c[2]){u.label=c[2],u.ops.push(y);break}c[2]&&u.ops.pop(),u.trys.pop();continue}y=a.call(s,u)}catch(b){y=[6,b],f=0}finally{l=c=0}if(y[0]&5)throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}}function __values(s){var a=typeof Symbol=="function"&&Symbol.iterator,u=a&&s[a],l=0;if(u)return u.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&l>=s.length&&(s=void 0),{value:s&&s[l++],done:!s}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(s,a){var u=typeof Symbol=="function"&&s[Symbol.iterator];if(!u)return s;var l=u.call(s),f,c=[],h;try{for(;(a===void 0||a-- >0)&&!(f=l.next()).done;)c.push(f.value)}catch(p){h={error:p}}finally{try{f&&!f.done&&(u=l.return)&&u.call(l)}finally{if(h)throw h.error}}return c}function __spreadArray(s,a,u){if(u||arguments.length===2)for(var l=0,f=a.length,c;l<f;l++)(c||!(l in a))&&(c||(c=Array.prototype.slice.call(a,0,l)),c[l]=a[l]);return s.concat(c||Array.prototype.slice.call(a))}function __await(s){return this instanceof __await?(this.v=s,this):new __await(s)}function __asyncGenerator(s,a,u){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var l=u.apply(s,a||[]),f,c=[];return f=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),p("next"),p("throw"),p("return",h),f[Symbol.asyncIterator]=function(){return this},f;function h(R){return function(O){return Promise.resolve(O).then(R,S)}}function p(R,O){l[R]&&(f[R]=function(I){return new Promise(function(B,N){c.push([R,I,B,N])>1||v(R,I)})},O&&(f[R]=O(f[R])))}function v(R,O){try{y(l[R](O))}catch(I){E(c[0][3],I)}}function y(R){R.value instanceof __await?Promise.resolve(R.value.v).then(b,S):E(c[0][2],R)}function b(R){v("next",R)}function S(R){v("throw",R)}function E(R,O){R(O),c.shift(),c.length&&v(c[0][0],c[0][1])}}function __asyncValues(s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=s[Symbol.asyncIterator],u;return a?a.call(s):(s=typeof __values=="function"?__values(s):s[Symbol.iterator](),u={},l("next"),l("throw"),l("return"),u[Symbol.asyncIterator]=function(){return this},u);function l(c){u[c]=s[c]&&function(h){return new Promise(function(p,v){h=s[c](h),f(p,v,h.done,h.value)})}}function f(c,h,p,v){Promise.resolve(v).then(function(y){c({value:y,done:p})},h)}}typeof SuppressedError=="function"&&SuppressedError;function ItoI(s){return s}function innerCreateMedium(s,a){a===void 0&&(a=ItoI);var u=[],l=!1,f={read:function(){if(l)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return u.length?u[u.length-1]:s},useMedium:function(c){var h=a(c,l);return u.push(h),function(){u=u.filter(function(p){return p!==h})}},assignSyncMedium:function(c){for(l=!0;u.length;){var h=u;u=[],h.forEach(c)}u={push:function(p){return c(p)},filter:function(){return u}}},assignMedium:function(c){l=!0;var h=[];if(u.length){var p=u;u=[],p.forEach(c),h=u}var v=function(){var b=h;h=[],b.forEach(c)},y=function(){return Promise.resolve().then(v)};y(),u={push:function(b){h.push(b),y()},filter:function(b){return h=h.filter(b),u}}}};return f}function createMedium(s,a){return a===void 0&&(a=ItoI),innerCreateMedium(s,a)}function createSidecarMedium(s){s===void 0&&(s={});var a=innerCreateMedium(null);return a.options=__assign$1({async:!0,ssr:!1},s),a}var SideCar$1=function(s){var a=s.sideCar,u=__rest$3(s,["sideCar"]);if(!a)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var l=a.read();if(!l)throw new Error("Sidecar medium not found");return reactExports.createElement(l,__assign$1({},u))};SideCar$1.isSideCarExport=!0;function exportSidecar(s,a){return s.useMedium(a),SideCar$1}var mediumFocus=createMedium({},function(s){var a=s.target,u=s.currentTarget;return{target:a,currentTarget:u}}),mediumBlur=createMedium(),mediumEffect=createMedium(),mediumSidecar=createSidecarMedium({async:!0,ssr:typeof document<"u"}),focusScope=reactExports.createContext(void 0),emptyArray=[],FocusLock$1=reactExports.forwardRef(function(a,u){var l,f=reactExports.useState(),c=f[0],h=f[1],p=reactExports.useRef(),v=reactExports.useRef(!1),y=reactExports.useRef(null),b=reactExports.useState({}),S=b[1],E=a.children,R=a.disabled,O=R===void 0?!1:R,I=a.noFocusGuards,B=I===void 0?!1:I,N=a.persistentFocus,D=N===void 0?!1:N,G=a.crossFrame,V=G===void 0?!0:G,U=a.autoFocus,te=U===void 0?!0:U;a.allowTextSelection;var Z=a.group,J=a.className,Q=a.whiteList,ee=a.hasPositiveIndices,k=a.shards,d=k===void 0?emptyArray:k,g=a.as,_=g===void 0?"div":g,w=a.lockProps,x=w===void 0?{}:w,P=a.sideCar,$=a.returnFocus,T=$===void 0?!1:$,m=a.focusOptions,M=a.onActivation,W=a.onDeactivation,Y=reactExports.useState({}),ue=Y[0],ge=reactExports.useCallback(function(Ie){var Ke=Ie.captureFocusRestore;if(!y.current){var Le,Ce=(Le=document)==null?void 0:Le.activeElement;y.current=Ce,Ce!==document.body&&(y.current=Ke(Ce))}p.current&&M&&M(p.current),v.current=!0,S()},[M]),he=reactExports.useCallback(function(){v.current=!1,W&&W(p.current),S()},[W]),ae=reactExports.useCallback(function(Ie){var Ke=y.current;if(Ke){var Le=(typeof Ke=="function"?Ke():Ke)||document.body,Ce=typeof T=="function"?T(Le):T;if(Ce){var at=typeof Ce=="object"?Ce:void 0;y.current=null,Ie?Promise.resolve().then(function(){return Le.focus(at)}):Le.focus(at)}}},[T]),de=reactExports.useCallback(function(Ie){v.current&&mediumFocus.useMedium(Ie)},[]),pe=mediumBlur.useMedium,oe=reactExports.useCallback(function(Ie){p.current!==Ie&&(p.current=Ie,h(Ie))},[]),le=_extends((l={},l[FOCUS_DISABLED]=O&&"disabled",l[FOCUS_GROUP]=Z,l),x),me=B!==!0,xe=me&&B!=="tail",Ne=useMergeRefs([u,oe]),Pe=reactExports.useMemo(function(){return{observed:p,shards:d,enabled:!O,active:v.current}},[O,v.current,d,c]);return reactExports.createElement(reactExports.Fragment,null,me&&[reactExports.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:O?-1:0,style:hiddenGuard}),ee?reactExports.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:O?-1:1,style:hiddenGuard}):null],!O&&reactExports.createElement(P,{id:ue,sideCar:mediumSidecar,observed:c,disabled:O,persistentFocus:D,crossFrame:V,autoFocus:te,whiteList:Q,shards:d,onActivation:ge,onDeactivation:he,returnFocus:ae,focusOptions:m}),reactExports.createElement(_,_extends({ref:Ne},le,{className:J,onBlur:pe,onFocus:de}),reactExports.createElement(focusScope.Provider,{value:Pe},E)),xe&&reactExports.createElement("div",{"data-focus-guard":!0,tabIndex:O?-1:0,style:hiddenGuard}))});FocusLock$1.propTypes={};function _setPrototypeOf(s,a){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(u,l){return u.__proto__=l,u},_setPrototypeOf(s,a)}function _inheritsLoose(s,a){s.prototype=Object.create(a.prototype),s.prototype.constructor=s,_setPrototypeOf(s,a)}function _typeof$1(s){"@babel/helpers - typeof";return _typeof$1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof$1(s)}function toPrimitive(s,a){if(_typeof$1(s)!="object"||!s)return s;var u=s[Symbol.toPrimitive];if(u!==void 0){var l=u.call(s,a||"default");if(_typeof$1(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(s)}function toPropertyKey(s){var a=toPrimitive(s,"string");return _typeof$1(a)=="symbol"?a:a+""}function _defineProperty(s,a,u){return(a=toPropertyKey(a))in s?Object.defineProperty(s,a,{value:u,enumerable:!0,configurable:!0,writable:!0}):s[a]=u,s}function withSideEffect(s,a){function u(l){return l.displayName||l.name||"Component"}return function(f){var c=[],h;function p(){h=s(c.map(function(y){return y.props})),a(h)}var v=function(y){_inheritsLoose(b,y);function b(){return y.apply(this,arguments)||this}b.peek=function(){return h};var S=b.prototype;return S.componentDidMount=function(){c.push(this),p()},S.componentDidUpdate=function(){p()},S.componentWillUnmount=function(){var R=c.indexOf(this);c.splice(R,1),p()},S.render=function(){return React.createElement(f,this.props)},b}(reactExports.PureComponent);return _defineProperty(v,"displayName","SideEffect("+u(f)+")"),v}}var toArray$1=function(s){for(var a=Array(s.length),u=0;u<s.length;++u)a[u]=s[u];return a},asArray=function(s){return Array.isArray(s)?s:[s]},getFirst=function(s){return Array.isArray(s)?s[0]:s},isElementHidden=function(s){if(s.nodeType!==Node.ELEMENT_NODE)return!1;var a=window.getComputedStyle(s,null);return!a||!a.getPropertyValue?!1:a.getPropertyValue("display")==="none"||a.getPropertyValue("visibility")==="hidden"},getParentNode=function(s){return s.parentNode&&s.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?s.parentNode.host:s.parentNode},isTopNode=function(s){return s===document||s&&s.nodeType===Node.DOCUMENT_NODE},isInert=function(s){return s.hasAttribute("inert")},isVisibleUncached=function(s,a){return!s||isTopNode(s)||!isElementHidden(s)&&!isInert(s)&&a(getParentNode(s))},isVisibleCached=function(s,a){var u=s.get(a);if(u!==void 0)return u;var l=isVisibleUncached(a,isVisibleCached.bind(void 0,s));return s.set(a,l),l},isAutoFocusAllowedUncached=function(s,a){return s&&!isTopNode(s)?isAutoFocusAllowed(s)?a(getParentNode(s)):!1:!0},isAutoFocusAllowedCached=function(s,a){var u=s.get(a);if(u!==void 0)return u;var l=isAutoFocusAllowedUncached(a,isAutoFocusAllowedCached.bind(void 0,s));return s.set(a,l),l},getDataset=function(s){return s.dataset},isHTMLButtonElement=function(s){return s.tagName==="BUTTON"},isHTMLInputElement=function(s){return s.tagName==="INPUT"},isRadioElement=function(s){return isHTMLInputElement(s)&&s.type==="radio"},notHiddenInput=function(s){return!((isHTMLInputElement(s)||isHTMLButtonElement(s))&&(s.type==="hidden"||s.disabled))},isAutoFocusAllowed=function(s){var a=s.getAttribute(FOCUS_NO_AUTOFOCUS);return![!0,"true",""].includes(a)},isGuard=function(s){var a;return!!(s&&(!((a=getDataset(s))===null||a===void 0)&&a.focusGuard))},isNotAGuard=function(s){return!isGuard(s)},isDefined=function(s){return!!s},tabSort=function(s,a){var u=Math.max(0,s.tabIndex),l=Math.max(0,a.tabIndex),f=u-l,c=s.index-a.index;if(f){if(!u)return 1;if(!l)return-1}return f||c},getTabIndex=function(s){return s.tabIndex<0&&!s.hasAttribute("tabindex")?0:s.tabIndex},orderByTabIndex=function(s,a,u){return toArray$1(s).map(function(l,f){var c=getTabIndex(l);return{node:l,index:f,tabIndex:u&&c===-1?(l.dataset||{}).focusGuard?0:-1:c}}).filter(function(l){return!a||l.tabIndex>=0}).sort(tabSort)},tabbables=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],queryTabbables=tabbables.join(","),queryGuardTabbables="".concat(queryTabbables,", [data-focus-guard]"),getFocusablesWithShadowDom=function(s,a){return toArray$1((s.shadowRoot||s).children).reduce(function(u,l){return u.concat(l.matches(a?queryGuardTabbables:queryTabbables)?[l]:[],getFocusablesWithShadowDom(l))},[])},getFocusablesWithIFrame=function(s,a){var u;return s instanceof HTMLIFrameElement&&(!((u=s.contentDocument)===null||u===void 0)&&u.body)?getFocusables([s.contentDocument.body],a):[s]},getFocusables=function(s,a){return s.reduce(function(u,l){var f,c=getFocusablesWithShadowDom(l,a),h=(f=[]).concat.apply(f,c.map(function(p){return getFocusablesWithIFrame(p,a)}));return u.concat(h,l.parentNode?toArray$1(l.parentNode.querySelectorAll(queryTabbables)).filter(function(p){return p===l}):[])},[])},getParentAutofocusables=function(s){var a=s.querySelectorAll("[".concat(FOCUS_AUTO,"]"));return toArray$1(a).map(function(u){return getFocusables([u])}).reduce(function(u,l){return u.concat(l)},[])},filterFocusable=function(s,a){return toArray$1(s).filter(function(u){return isVisibleCached(a,u)}).filter(function(u){return notHiddenInput(u)})},filterAutoFocusable=function(s,a){return a===void 0&&(a=new Map),toArray$1(s).filter(function(u){return isAutoFocusAllowedCached(a,u)})},getTabbableNodes=function(s,a,u){return orderByTabIndex(filterFocusable(getFocusables(s,u),a),!0,u)},getFocusableNodes=function(s,a){return orderByTabIndex(filterFocusable(getFocusables(s),a),!1)},parentAutofocusables=function(s,a){return filterFocusable(getParentAutofocusables(s),a)},contains=function(s,a){return s.shadowRoot?contains(s.shadowRoot,a):Object.getPrototypeOf(s).contains!==void 0&&Object.getPrototypeOf(s).contains.call(s,a)?!0:toArray$1(s.children).some(function(u){var l;if(u instanceof HTMLIFrameElement){var f=(l=u.contentDocument)===null||l===void 0?void 0:l.body;return f?contains(f,a):!1}return contains(u,a)})},filterNested=function(s){for(var a=new Set,u=s.length,l=0;l<u;l+=1)for(var f=l+1;f<u;f+=1){var c=s[l].compareDocumentPosition(s[f]);(c&Node.DOCUMENT_POSITION_CONTAINED_BY)>0&&a.add(f),(c&Node.DOCUMENT_POSITION_CONTAINS)>0&&a.add(l)}return s.filter(function(h,p){return!a.has(p)})},getTopParent=function(s){return s.parentNode?getTopParent(s.parentNode):s},getAllAffectedNodes=function(s){var a=asArray(s);return a.filter(Boolean).reduce(function(u,l){var f=l.getAttribute(FOCUS_GROUP);return u.push.apply(u,f?filterNested(toArray$1(getTopParent(l).querySelectorAll("[".concat(FOCUS_GROUP,'="').concat(f,'"]:not([').concat(FOCUS_DISABLED,'="disabled"])')))):[l]),u},[])},safeProbe=function(s){try{return s()}catch{return}},getActiveElement=function(s){if(s===void 0&&(s=document),!(!s||!s.activeElement)){var a=s.activeElement;return a.shadowRoot?getActiveElement(a.shadowRoot):a instanceof HTMLIFrameElement&&safeProbe(function(){return a.contentWindow.document})?getActiveElement(a.contentWindow.document):a}},focusInFrame=function(s,a){return s===a},focusInsideIframe=function(s,a){return!!toArray$1(s.querySelectorAll("iframe")).some(function(u){return focusInFrame(u,a)})},focusInside=function(s,a){return a===void 0&&(a=getActiveElement(getFirst(s).ownerDocument)),!a||a.dataset&&a.dataset.focusGuard?!1:getAllAffectedNodes(s).some(function(u){return contains(u,a)||focusInsideIframe(u,a)})},focusIsHidden=function(s){s===void 0&&(s=document);var a=getActiveElement(s);return a?toArray$1(s.querySelectorAll("[".concat(FOCUS_ALLOW,"]"))).some(function(u){return contains(u,a)}):!1},findSelectedRadio=function(s,a){return a.filter(isRadioElement).filter(function(u){return u.name===s.name}).filter(function(u){return u.checked})[0]||s},correctNode=function(s,a){return isRadioElement(s)&&s.name?findSelectedRadio(s,a):s},correctNodes=function(s){var a=new Set;return s.forEach(function(u){return a.add(correctNode(u,s))}),s.filter(function(u){return a.has(u)})},pickFirstFocus=function(s){return s[0]&&s.length>1?correctNode(s[0],s):s[0]},pickFocusable=function(s,a){return s.indexOf(correctNode(a,s))},NEW_FOCUS="NEW_FOCUS",newFocus=function(s,a,u,l,f){var c=s.length,h=s[0],p=s[c-1],v=isGuard(l);if(!(l&&s.indexOf(l)>=0)){var y=l!==void 0?u.indexOf(l):-1,b=f?u.indexOf(f):y,S=f?s.indexOf(f):-1;if(y===-1)return S!==-1?S:NEW_FOCUS;if(S===-1)return NEW_FOCUS;var E=y-b,R=u.indexOf(h),O=u.indexOf(p),I=correctNodes(u),B=l!==void 0?I.indexOf(l):-1,N=B-(f?I.indexOf(f):y);if(!E&&S>=0||a.length===0)return S;var D=pickFocusable(s,a[0]),G=pickFocusable(s,a[a.length-1]);if(y<=R&&v&&Math.abs(E)>1)return G;if(y>=O&&v&&Math.abs(E)>1)return D;if(E&&Math.abs(N)>1)return S;if(y<=R)return G;if(y>O)return D;if(E)return Math.abs(E)>1?S:(c+S+E)%c}},findAutoFocused=function(s){return function(a){var u,l=(u=getDataset(a))===null||u===void 0?void 0:u.autofocus;return a.autofocus||l!==void 0&&l!=="false"||s.indexOf(a)>=0}},pickAutofocus=function(s,a,u){var l=s.map(function(c){var h=c.node;return h}),f=filterAutoFocusable(l.filter(findAutoFocused(u)));return f&&f.length?pickFirstFocus(f):pickFirstFocus(filterAutoFocusable(a))},getParents=function(s,a){return a===void 0&&(a=[]),a.push(s),s.parentNode&&getParents(s.parentNode.host||s.parentNode,a),a},getCommonParent=function(s,a){for(var u=getParents(s),l=getParents(a),f=0;f<u.length;f+=1){var c=u[f];if(l.indexOf(c)>=0)return c}return!1},getTopCommonParent=function(s,a,u){var l=asArray(s),f=asArray(a),c=l[0],h=!1;return f.filter(Boolean).forEach(function(p){h=getCommonParent(h||p,p)||h,u.filter(Boolean).forEach(function(v){var y=getCommonParent(c,v);y&&(!h||contains(y,h)?h=y:h=getCommonParent(y,h))})}),h},allParentAutofocusables=function(s,a){return s.reduce(function(u,l){return u.concat(parentAutofocusables(l,a))},[])},reorderNodes=function(s,a){var u=new Map;return a.forEach(function(l){return u.set(l.node,l)}),s.map(function(l){return u.get(l)}).filter(isDefined)},focusSolver=function(s,a){var u=getActiveElement(asArray(s).length>0?document:getFirst(s).ownerDocument),l=getAllAffectedNodes(s).filter(isNotAGuard),f=getTopCommonParent(u||s,s,l),c=new Map,h=getFocusableNodes(l,c),p=h.filter(function(O){var I=O.node;return isNotAGuard(I)});if(p[0]){var v=getFocusableNodes([f],c).map(function(O){var I=O.node;return I}),y=reorderNodes(v,p),b=y.map(function(O){var I=O.node;return I}),S=y.filter(function(O){var I=O.tabIndex;return I>=0}).map(function(O){var I=O.node;return I}),E=newFocus(b,S,v,u,a);if(E===NEW_FOCUS){var R=pickAutofocus(h,S,allParentAutofocusables(l,c))||pickAutofocus(h,b,allParentAutofocusables(l,c));if(R)return{node:R};console.warn("focus-lock: cannot find any node to move focus into");return}return E===void 0?E:y[E]}},expandFocusableNodes=function(s){var a=getAllAffectedNodes(s).filter(isNotAGuard),u=getTopCommonParent(s,s,a),l=orderByTabIndex(getFocusables([u],!0),!0,!0),f=getFocusables(a,!1);return l.map(function(c){var h=c.node,p=c.index;return{node:h,index:p,lockItem:f.indexOf(h)>=0,guard:isGuard(h)}})},focusOn=function(s,a){s&&("focus"in s&&s.focus(a),"contentWindow"in s&&s.contentWindow&&s.contentWindow.focus())},guardCount=0,lockDisabled=!1,moveFocusInside=function(s,a,u){u===void 0&&(u={});var l=focusSolver(s,a);if(!lockDisabled&&l){if(guardCount>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),lockDisabled=!0,setTimeout(function(){lockDisabled=!1},1);return}guardCount++,focusOn(l.node,u.focusOptions),guardCount--}};function weakRef(s){if(!s)return null;if(typeof WeakRef>"u")return function(){return s||null};var a=s?new WeakRef(s):null;return function(){return(a==null?void 0:a.deref())||null}}var recordElementLocation=function(s){if(!s)return null;for(var a=[],u=s;u&&u!==document.body;)a.push({current:weakRef(u),parent:weakRef(u.parentElement),left:weakRef(u.previousElementSibling),right:weakRef(u.nextElementSibling)}),u=u.parentElement;return{element:weakRef(s),stack:a,ownerDocument:s.ownerDocument}},restoreFocusTo=function(s){var a,u,l,f,c;if(s)for(var h=s.stack,p=s.ownerDocument,v=new Map,y=0,b=h;y<b.length;y++){var S=b[y],E=(a=S.parent)===null||a===void 0?void 0:a.call(S);if(E&&p.contains(E)){for(var R=(u=S.left)===null||u===void 0?void 0:u.call(S),O=S.current(),I=E.contains(O)?O:void 0,B=(l=S.right)===null||l===void 0?void 0:l.call(S),N=getTabbableNodes([E],v),D=(c=(f=I??(R==null?void 0:R.nextElementSibling))!==null&&f!==void 0?f:B)!==null&&c!==void 0?c:R;D;){for(var G=0,V=N;G<V.length;G++){var U=V[G];if(D!=null&&D.contains(U.node))return U.node}D=D.nextElementSibling}if(N.length)return N[0].node}}},captureFocusRestore=function(s){var a=recordElementLocation(s);return function(){return restoreFocusTo(a)}},getRelativeFocusable=function(s,a,u){if(!s||!a)return console.error("no element or scope given"),{};var l=asArray(a);if(l.every(function(h){return!contains(h,s)}))return console.error("Active element is not contained in the scope"),{};var f=u?getTabbableNodes(l,new Map):getFocusableNodes(l,new Map),c=f.findIndex(function(h){var p=h.node;return p===s});if(c!==-1)return{prev:f[c-1],next:f[c+1],first:f[0],last:f[f.length-1]}},getBoundary=function(s,a){var u=a?getTabbableNodes(asArray(s),new Map):getFocusableNodes(asArray(s),new Map);return{first:u[0],last:u[u.length-1]}},defaultOptions=function(s){return Object.assign({scope:document.body,cycle:!0,onlyTabbable:!0},s)},moveFocus=function(s,a,u){a===void 0&&(a={});var l=defaultOptions(a),f=getRelativeFocusable(s,l.scope,l.onlyTabbable);if(f){var c=u(f,l.cycle);c&&focusOn(c.node,l.focusOptions)}},focusNextElement=function(s,a){a===void 0&&(a={}),moveFocus(s,a,function(u,l){var f=u.next,c=u.first;return f||l&&c})},focusPrevElement=function(s,a){a===void 0&&(a={}),moveFocus(s,a,function(u,l){var f=u.prev,c=u.last;return f||l&&c})},pickBoundary=function(s,a,u){var l,f=getBoundary(s,(l=a.onlyTabbable)!==null&&l!==void 0?l:!0),c=f[u];c&&focusOn(c.node,a.focusOptions)},focusFirstElement=function(s,a){a===void 0&&(a={}),pickBoundary(s,a,"first")},focusLastElement=function(s,a){a===void 0&&(a={}),pickBoundary(s,a,"last")};function deferAction(s){setTimeout(s,1)}var extractRef$1=function(a){return a&&"current"in a?a.current:a},focusOnBody=function(){return document&&document.activeElement===document.body},isFreeFocus=function(){return focusOnBody()||focusIsHidden()},lastActiveTrap=null,lastActiveFocus=null,lastPortaledElement=null,focusWasOutsideWindow=!1,defaultWhitelist=function(){return!0},focusWhitelisted=function(a){return(lastActiveTrap.whiteList||defaultWhitelist)(a)},recordPortal=function(a,u){lastPortaledElement={observerNode:a,portaledElement:u}},focusIsPortaledPair=function(a){return lastPortaledElement&&lastPortaledElement.portaledElement===a};function autoGuard(s,a,u,l){var f=null,c=s;do{var h=l[c];if(h.guard)h.node.dataset.focusAutoGuard&&(f=h);else if(h.lockItem){if(c!==s)return;f=null}else break}while((c+=u)!==a);f&&(f.node.tabIndex=0)}var focusWasOutside=function(a){return a?!!focusWasOutsideWindow:focusWasOutsideWindow==="meanwhile"},checkInHost=function s(a,u,l){return u&&(u.host===a&&(!u.activeElement||l.contains(u.activeElement))||u.parentNode&&s(a,u.parentNode,l))},withinHost=function(a,u){return u.some(function(l){return checkInHost(a,l,l)})},activateTrap=function(){var a=!1;if(lastActiveTrap){var u=lastActiveTrap,l=u.observed,f=u.persistentFocus,c=u.autoFocus,h=u.shards,p=u.crossFrame,v=u.focusOptions,y=l||lastPortaledElement&&lastPortaledElement.portaledElement,b=document&&document.activeElement;if(y){var S=[y].concat(h.map(extractRef$1).filter(Boolean));if((!b||focusWhitelisted(b))&&(f||focusWasOutside(p)||!isFreeFocus()||!lastActiveFocus&&c)&&(y&&!(focusInside(S)||b&&withinHost(b,S)||focusIsPortaledPair(b))&&(document&&!lastActiveFocus&&b&&!c?(b.blur&&b.blur(),document.body.focus()):(a=moveFocusInside(S,lastActiveFocus,{focusOptions:v}),lastPortaledElement={})),focusWasOutsideWindow=!1,lastActiveFocus=document&&document.activeElement),document&&b!==document.activeElement&&document.querySelector("[data-focus-auto-guard]")){var E=document&&document.activeElement,R=expandFocusableNodes(S),O=R.map(function(I){var B=I.node;return B}).indexOf(E);O>-1&&(R.filter(function(I){var B=I.guard,N=I.node;return B&&N.dataset.focusAutoGuard}).forEach(function(I){var B=I.node;return B.removeAttribute("tabIndex")}),autoGuard(O,R.length,1,R),autoGuard(O,-1,-1,R))}}}return a},onTrap=function(a){activateTrap()&&a&&(a.stopPropagation(),a.preventDefault())},onBlur=function(){return deferAction(activateTrap)},onFocus=function(a){var u=a.target,l=a.currentTarget;l.contains(u)||recordPortal(l,u)},FocusWatcher=function(){return null},onWindowBlur=function(){focusWasOutsideWindow="just",deferAction(function(){focusWasOutsideWindow="meanwhile"})},attachHandler=function(){document.addEventListener("focusin",onTrap),document.addEventListener("focusout",onBlur),window.addEventListener("blur",onWindowBlur)},detachHandler=function(){document.removeEventListener("focusin",onTrap),document.removeEventListener("focusout",onBlur),window.removeEventListener("blur",onWindowBlur)};function reducePropsToState(s){return s.filter(function(a){var u=a.disabled;return!u})}var focusLockAPI={moveFocusInside,focusInside,focusNextElement,focusPrevElement,focusFirstElement,focusLastElement,captureFocusRestore};function handleStateChangeOnClient(s){var a=s.slice(-1)[0];a&&!lastActiveTrap&&attachHandler();var u=lastActiveTrap,l=u&&a&&a.id===u.id;lastActiveTrap=a,u&&!l&&(u.onDeactivation(),s.filter(function(f){var c=f.id;return c===u.id}).length||u.returnFocus(!a)),a?(lastActiveFocus=null,(!l||u.observed!==a.observed)&&a.onActivation(focusLockAPI),activateTrap(),deferAction(activateTrap)):(detachHandler(),lastActiveFocus=null)}mediumFocus.assignSyncMedium(onFocus);mediumBlur.assignMedium(onBlur);mediumEffect.assignMedium(function(s){return s(focusLockAPI)});const FocusTrap$1=withSideEffect(reducePropsToState,handleStateChangeOnClient)(FocusWatcher);var FocusLockCombination=reactExports.forwardRef(function(a,u){return reactExports.createElement(FocusLock$1,_extends({sideCar:FocusTrap$1,ref:u},a))}),_ref=FocusLock$1.propTypes||{};_ref.sideCar;_objectWithoutPropertiesLoose(_ref,["sideCar"]);FocusLockCombination.propTypes={};function isElement(s){return s!=null&&typeof s=="object"&&"nodeType"in s&&s.nodeType===Node.ELEMENT_NODE}function isHTMLElement(s){var a;if(!isElement(s))return!1;const u=(a=s.ownerDocument.defaultView)!=null?a:window;return s instanceof u.HTMLElement}var hasTabIndex=s=>s.hasAttribute("tabindex");function isDisabled(s){return!!s.getAttribute("disabled")||!!s.getAttribute("aria-disabled")}function isHidden(s){return s.parentElement&&isHidden(s.parentElement)?!0:s.hidden}function isContentEditable(s){const a=s.getAttribute("contenteditable");return a!=="false"&&a!=null}function isFocusable(s){if(!isHTMLElement(s)||isHidden(s)||isDisabled(s))return!1;const{localName:a}=s;if(["input","select","textarea","button"].indexOf(a)>=0)return!0;const l={a:()=>s.hasAttribute("href"),audio:()=>s.hasAttribute("controls"),video:()=>s.hasAttribute("controls")};return a in l?l[a]():isContentEditable(s)?!0:hasTabIndex(s)}var focusableElList=["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]"],focusableElSelector=focusableElList.join(),isVisible=s=>s.offsetWidth>0&&s.offsetHeight>0;function getAllFocusable(s){const a=Array.from(s.querySelectorAll(focusableElSelector));return a.unshift(s),a.filter(u=>isFocusable(u)&&isVisible(u))}var _a$4,FocusTrap=(_a$4=FocusLockCombination.default)!=null?_a$4:FocusLockCombination,FocusLock=s=>{const{initialFocusRef:a,finalFocusRef:u,contentRef:l,restoreFocus:f,children:c,isDisabled:h,autoFocus:p,persistentFocus:v,lockFocusAcrossFrames:y}=s,b=reactExports.useCallback(()=>{a!=null&&a.current?a.current.focus():l!=null&&l.current&&getAllFocusable(l.current).length===0&&requestAnimationFrame(()=>{var O;(O=l.current)==null||O.focus()})},[a,l]),S=reactExports.useCallback(()=>{var R;(R=u==null?void 0:u.current)==null||R.focus()},[u]),E=f&&!u;return jsxRuntimeExports.jsx(FocusTrap,{crossFrame:y,persistentFocus:v,autoFocus:p,disabled:h,onActivation:b,onDeactivation:S,returnFocus:E,children:c})};FocusLock.displayName="FocusLock";var useSafeLayoutEffect=isBrowser$3?reactExports.useLayoutEffect:reactExports.useEffect;function useCallbackRef(s,a=[]){const u=reactExports.useRef(s);return useSafeLayoutEffect(()=>{u.current=s}),reactExports.useCallback((...l)=>{var f;return(f=u.current)==null?void 0:f.call(u,...l)},a)}function useId(s,a){const u=reactExports.useId();return reactExports.useMemo(()=>s||[a,u].filter(Boolean).join("-"),[s,a,u])}function useControllableProp(s,a){const u=s!==void 0;return[u,u&&typeof s<"u"?s:a]}function useDisclosure(s={}){const{onClose:a,onOpen:u,isOpen:l,id:f}=s,c=useCallbackRef(u),h=useCallbackRef(a),[p,v]=reactExports.useState(s.defaultIsOpen||!1),[y,b]=useControllableProp(l,p),S=useId(f,"disclosure"),E=reactExports.useCallback(()=>{y||v(!1),h==null||h()},[y,h]),R=reactExports.useCallback(()=>{y||v(!0),c==null||c()},[y,c]),O=reactExports.useCallback(()=>{(b?E:R)()},[b,R,E]);return{isOpen:!!b,onOpen:R,onClose:E,onToggle:O,isControlled:y,getButtonProps:(I={})=>({...I,"aria-expanded":b,"aria-controls":S,onClick:callAllHandlers(I.onClick,O)}),getDisclosureProps:(I={})=>({...I,hidden:!b,id:S})}}function mapResponsive(s,a){return Array.isArray(s)?s.map(u=>u===null?null:a(u)):isObject$2(s)?Object.keys(s).reduce((u,l)=>(u[l]=a(s[l]),u),{}):s!=null?a(s):null}var Text=forwardRef(function(a,u){const l=useStyleConfig("Text",a),{className:f,align:c,decoration:h,casing:p,...v}=omitThemingProps(a),y=compact({textAlign:a.align,textDecoration:a.decoration,textTransform:a.casing});return jsxRuntimeExports.jsx(chakra.p,{ref:u,className:cx("chakra-text",a.className),...y,...v,__css:l})});Text.displayName="Text";var StackItem=s=>jsxRuntimeExports.jsx(chakra.div,{className:"chakra-stack__item",...s,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...s.__css}});StackItem.displayName="StackItem";function getDividerStyles(s){const{spacing:a,direction:u}=s,l={column:{my:a,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:a,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:a,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:a,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":mapResponsive(u,f=>l[f])}}var Stack=forwardRef((s,a)=>{const{isInline:u,direction:l,align:f,justify:c,spacing:h="0.5rem",wrap:p,children:v,divider:y,className:b,shouldWrapChildren:S,...E}=s,R=u?"row":l??"column",O=reactExports.useMemo(()=>getDividerStyles({spacing:h,direction:R}),[h,R]),I=!!y,B=!S&&!I,N=reactExports.useMemo(()=>{const G=getValidChildren(v);return B?G:G.map((V,U)=>{const te=typeof V.key<"u"?V.key:U,Z=U+1===G.length,Q=S?jsxRuntimeExports.jsx(StackItem,{children:V},te):V;if(!I)return Q;const ee=reactExports.cloneElement(y,{__css:O}),k=Z?null:ee;return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[Q,k]},te)})},[y,O,I,B,S,v]),D=cx("chakra-stack",b);return jsxRuntimeExports.jsx(chakra.div,{ref:a,display:"flex",alignItems:f,justifyContent:c,flexDirection:R,flexWrap:p,gap:I?void 0:h,className:D,...E,children:N})});Stack.displayName="Stack";var VStack=forwardRef((s,a)=>jsxRuntimeExports.jsx(Stack,{align:"center",...s,direction:"column",ref:a}));VStack.displayName="VStack";var Heading=forwardRef(function(a,u){const l=useStyleConfig("Heading",a),{className:f,...c}=omitThemingProps(a);return jsxRuntimeExports.jsx(chakra.h2,{ref:u,className:cx("chakra-heading",a.className),...c,__css:l})});Heading.displayName="Heading";var Box=chakra("div");Box.displayName="Box";var Square=forwardRef(function(a,u){const{size:l,centerContent:f=!0,...c}=a,h=f?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return jsxRuntimeExports.jsx(Box,{ref:u,boxSize:l,__css:{...h,flexShrink:0,flexGrow:0},...c})});Square.displayName="Square";var Circle=forwardRef(function(a,u){const{size:l,...f}=a;return jsxRuntimeExports.jsx(Square,{size:l,ref:u,borderRadius:"9999px",...f})});Circle.displayName="Circle";var Center=chakra("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});Center.displayName="Center";var centerStyles={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};forwardRef(function(a,u){const{axis:l="both",...f}=a;return jsxRuntimeExports.jsx(chakra.div,{ref:u,__css:centerStyles[l],...f,position:"absolute"})});var Flex=forwardRef(function(a,u){const{direction:l,align:f,justify:c,wrap:h,basis:p,grow:v,shrink:y,...b}=a,S={display:"flex",flexDirection:l,alignItems:f,justifyContent:c,flexWrap:h,flexBasis:p,flexGrow:v,flexShrink:y};return jsxRuntimeExports.jsx(chakra.div,{ref:u,__css:S,...b})});Flex.displayName="Flex";var transitions={slideInBottom:{...slideFadeConfig,custom:{offsetY:16,reverse:!0}},slideInRight:{...slideFadeConfig,custom:{offsetX:16,reverse:!0}},slideInTop:{...slideFadeConfig,custom:{offsetY:-16,reverse:!0}},slideInLeft:{...slideFadeConfig,custom:{offsetX:-16,reverse:!0}},scale:{...scaleFadeConfig,custom:{initialScale:.95,reverse:!0}},none:{}},MotionSection=chakra(motion.section),getMotionProps=s=>transitions[s||"none"],ModalTransition=reactExports.forwardRef((s,a)=>{const{preset:u,motionProps:l=getMotionProps(u),...f}=s;return jsxRuntimeExports.jsx(MotionSection,{ref:a,...l,...f})});ModalTransition.displayName="ModalTransition";var __defProp=Object.defineProperty,__defNormalProp=(s,a,u)=>a in s?__defProp(s,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):s[a]=u,__publicField=(s,a,u)=>(__defNormalProp(s,a+"",u),u),ModalManager=class{constructor(){__publicField(this,"modals"),this.modals=new Map}add(s){return this.modals.set(s,this.modals.size+1),this.modals.size}remove(s){this.modals.delete(s)}isTopModal(s){return s?this.modals.get(s)===this.modals.size:!1}},modalManager=new ModalManager;function useModalManager(s,a){const[u,l]=reactExports.useState(0);return reactExports.useEffect(()=>{const f=s.current;if(f){if(a){const c=modalManager.add(f);l(c)}return()=>{modalManager.remove(f),l(0)}}},[a,s]),u}var getDefaultParent=function(s){if(typeof document>"u")return null;var a=Array.isArray(s)?s[0]:s;return a.ownerDocument.body},counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={},lockCount=0,unwrapHost=function(s){return s&&(s.host||unwrapHost(s.parentNode))},correctTargets=function(s,a){return a.map(function(u){if(s.contains(u))return u;var l=unwrapHost(u);return l&&s.contains(l)?l:(console.error("aria-hidden",u,"in not contained inside",s,". Doing nothing"),null)}).filter(function(u){return!!u})},applyAttributeToOthers=function(s,a,u,l){var f=correctTargets(a,Array.isArray(s)?s:[s]);markerMap[u]||(markerMap[u]=new WeakMap);var c=markerMap[u],h=[],p=new Set,v=new Set(f),y=function(S){!S||p.has(S)||(p.add(S),y(S.parentNode))};f.forEach(y);var b=function(S){!S||v.has(S)||Array.prototype.forEach.call(S.children,function(E){if(p.has(E))b(E);else try{var R=E.getAttribute(l),O=R!==null&&R!=="false",I=(counterMap.get(E)||0)+1,B=(c.get(E)||0)+1;counterMap.set(E,I),c.set(E,B),h.push(E),I===1&&O&&uncontrolledNodes.set(E,!0),B===1&&E.setAttribute(u,"true"),O||E.setAttribute(l,"true")}catch(N){console.error("aria-hidden: cannot operate on ",E,N)}})};return b(a),p.clear(),lockCount++,function(){h.forEach(function(S){var E=counterMap.get(S)-1,R=c.get(S)-1;counterMap.set(S,E),c.set(S,R),E||(uncontrolledNodes.has(S)||S.removeAttribute(l),uncontrolledNodes.delete(S)),R||S.removeAttribute(u)}),lockCount--,lockCount||(counterMap=new WeakMap,counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={})}},hideOthers=function(s,a,u){u===void 0&&(u="data-aria-hidden");var l=Array.from(Array.isArray(s)?s:[s]),f=getDefaultParent(s);return f?(l.push.apply(l,Array.from(f.querySelectorAll("[aria-live]"))),applyAttributeToOthers(l,f,u,"aria-hidden")):function(){return null}};function useModal(s){const{isOpen:a,onClose:u,id:l,closeOnOverlayClick:f=!0,closeOnEsc:c=!0,useInert:h=!0,onOverlayClick:p,onEsc:v}=s,y=reactExports.useRef(null),b=reactExports.useRef(null),[S,E,R]=useIds(l,"chakra-modal","chakra-modal--header","chakra-modal--body");useAriaHidden(y,a&&h);const O=useModalManager(y,a),I=reactExports.useRef(null),B=reactExports.useCallback(Q=>{I.current=Q.target},[]),N=reactExports.useCallback(Q=>{Q.key==="Escape"&&(Q.stopPropagation(),c&&(u==null||u()),v==null||v())},[c,u,v]),[D,G]=reactExports.useState(!1),[V,U]=reactExports.useState(!1),te=reactExports.useCallback((Q={},ee=null)=>({role:"dialog",...Q,ref:mergeRefs(ee,y),id:S,tabIndex:-1,"aria-modal":!0,"aria-labelledby":D?E:void 0,"aria-describedby":V?R:void 0,onClick:callAllHandlers$1(Q.onClick,k=>k.stopPropagation())}),[R,V,S,E,D]),Z=reactExports.useCallback(Q=>{Q.stopPropagation(),I.current===Q.target&&modalManager.isTopModal(y.current)&&(f&&(u==null||u()),p==null||p())},[u,f,p]),J=reactExports.useCallback((Q={},ee=null)=>({...Q,ref:mergeRefs(ee,b),onClick:callAllHandlers$1(Q.onClick,Z),onKeyDown:callAllHandlers$1(Q.onKeyDown,N),onMouseDown:callAllHandlers$1(Q.onMouseDown,B)}),[N,B,Z]);return{isOpen:a,onClose:u,headerId:E,bodyId:R,setBodyMounted:U,setHeaderMounted:G,dialogRef:y,overlayRef:b,getDialogProps:te,getDialogContainerProps:J,index:O}}function useAriaHidden(s,a){const u=s.current;reactExports.useEffect(()=>{if(!(!s.current||!a))return hideOthers(s.current)},[a,s,u])}function useIds(s,...a){const u=reactExports.useId(),l=s||u;return reactExports.useMemo(()=>a.map(f=>`${f}-${l}`),[l,a])}var[ModalStylesProvider,useModalStyles]=createContext$1({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Modal />" `}),[ModalContextProvider,useModalContext]=createContext$1({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in `<Modal />`"}),Modal=s=>{const a={scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale",lockFocusAcrossFrames:!0,...s},{portalProps:u,children:l,autoFocus:f,trapFocus:c,initialFocusRef:h,finalFocusRef:p,returnFocusOnClose:v,blockScrollOnMount:y,allowPinchZoom:b,preserveScrollBarGap:S,motionPreset:E,lockFocusAcrossFrames:R,onCloseComplete:O}=a,I=useMultiStyleConfig("Modal",a),N={...useModal(a),autoFocus:f,trapFocus:c,initialFocusRef:h,finalFocusRef:p,returnFocusOnClose:v,blockScrollOnMount:y,allowPinchZoom:b,preserveScrollBarGap:S,motionPreset:E,lockFocusAcrossFrames:R};return jsxRuntimeExports.jsx(ModalContextProvider,{value:N,children:jsxRuntimeExports.jsx(ModalStylesProvider,{value:I,children:jsxRuntimeExports.jsx(AnimatePresence,{onExitComplete:O,children:N.isOpen&&jsxRuntimeExports.jsx(Portal,{...u,children:l})})})})};Modal.displayName="Modal";var zeroRightClassName="right-scroll-bar-position",fullWidthClassName="width-before-scroll-bar",noScrollbarsClassName="with-scroll-bars-hidden",removedBarSizeVariable="--removed-body-scroll-bar-size",effectCar=createSidecarMedium(),nothing=function(){},RemoveScroll=reactExports.forwardRef(function(s,a){var u=reactExports.useRef(null),l=reactExports.useState({onScrollCapture:nothing,onWheelCapture:nothing,onTouchMoveCapture:nothing}),f=l[0],c=l[1],h=s.forwardProps,p=s.children,v=s.className,y=s.removeScrollBar,b=s.enabled,S=s.shards,E=s.sideCar,R=s.noIsolation,O=s.inert,I=s.allowPinchZoom,B=s.as,N=B===void 0?"div":B,D=s.gapMode,G=__rest$3(s,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),V=E,U=useMergeRefs([u,a]),te=__assign$1(__assign$1({},G),f);return reactExports.createElement(reactExports.Fragment,null,b&&reactExports.createElement(V,{sideCar:effectCar,removeScrollBar:y,shards:S,noIsolation:R,inert:O,setCallbacks:c,allowPinchZoom:!!I,lockRef:u,gapMode:D}),h?reactExports.cloneElement(reactExports.Children.only(p),__assign$1(__assign$1({},te),{ref:U})):reactExports.createElement(N,__assign$1({},te,{className:v,ref:U}),p))});RemoveScroll.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};RemoveScroll.classNames={fullWidth:fullWidthClassName,zeroRight:zeroRightClassName};var getNonce$1=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function makeStyleTag(){if(!document)return null;var s=document.createElement("style");s.type="text/css";var a=getNonce$1();return a&&s.setAttribute("nonce",a),s}function injectStyles(s,a){s.styleSheet?s.styleSheet.cssText=a:s.appendChild(document.createTextNode(a))}function insertStyleTag(s){var a=document.head||document.getElementsByTagName("head")[0];a.appendChild(s)}var stylesheetSingleton=function(){var s=0,a=null;return{add:function(u){s==0&&(a=makeStyleTag())&&(injectStyles(a,u),insertStyleTag(a)),s++},remove:function(){s--,!s&&a&&(a.parentNode&&a.parentNode.removeChild(a),a=null)}}},styleHookSingleton=function(){var s=stylesheetSingleton();return function(a,u){reactExports.useEffect(function(){return s.add(a),function(){s.remove()}},[a&&u])}},styleSingleton=function(){var s=styleHookSingleton(),a=function(u){var l=u.styles,f=u.dynamic;return s(l,f),null};return a},zeroGap={left:0,top:0,right:0,gap:0},parse$2=function(s){return parseInt(s||"",10)||0},getOffset=function(s){var a=window.getComputedStyle(document.body),u=a[s==="padding"?"paddingLeft":"marginLeft"],l=a[s==="padding"?"paddingTop":"marginTop"],f=a[s==="padding"?"paddingRight":"marginRight"];return[parse$2(u),parse$2(l),parse$2(f)]},getGapWidth=function(s){if(s===void 0&&(s="margin"),typeof window>"u")return zeroGap;var a=getOffset(s),u=document.documentElement.clientWidth,l=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,l-u+a[2]-a[0])}},Style=styleSingleton(),lockAttribute="data-scroll-locked",getStyles=function(s,a,u,l){var f=s.left,c=s.top,h=s.right,p=s.gap;return u===void 0&&(u="margin"),`
  .`.concat(noScrollbarsClassName,` {
   overflow: hidden `).concat(l,`;
   padding-right: `).concat(p,"px ").concat(l,`;
  }
  body[`).concat(lockAttribute,`] {
    overflow: hidden `).concat(l,`;
    overscroll-behavior: contain;
    `).concat([a&&"position: relative ".concat(l,";"),u==="margin"&&`
    padding-left: `.concat(f,`px;
    padding-top: `).concat(c,`px;
    padding-right: `).concat(h,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(p,"px ").concat(l,`;
    `),u==="padding"&&"padding-right: ".concat(p,"px ").concat(l,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(zeroRightClassName,` {
    right: `).concat(p,"px ").concat(l,`;
  }
  
  .`).concat(fullWidthClassName,` {
    margin-right: `).concat(p,"px ").concat(l,`;
  }
  
  .`).concat(zeroRightClassName," .").concat(zeroRightClassName,` {
    right: 0 `).concat(l,`;
  }
  
  .`).concat(fullWidthClassName," .").concat(fullWidthClassName,` {
    margin-right: 0 `).concat(l,`;
  }
  
  body[`).concat(lockAttribute,`] {
    `).concat(removedBarSizeVariable,": ").concat(p,`px;
  }
`)},getCurrentUseCounter=function(){var s=parseInt(document.body.getAttribute(lockAttribute)||"0",10);return isFinite(s)?s:0},useLockAttribute=function(){reactExports.useEffect(function(){return document.body.setAttribute(lockAttribute,(getCurrentUseCounter()+1).toString()),function(){var s=getCurrentUseCounter()-1;s<=0?document.body.removeAttribute(lockAttribute):document.body.setAttribute(lockAttribute,s.toString())}},[])},RemoveScrollBar=function(s){var a=s.noRelative,u=s.noImportant,l=s.gapMode,f=l===void 0?"margin":l;useLockAttribute();var c=reactExports.useMemo(function(){return getGapWidth(f)},[f]);return reactExports.createElement(Style,{styles:getStyles(c,!a,f,u?"":"!important")})},passiveSupported=!1;if(typeof window<"u")try{var options=Object.defineProperty({},"passive",{get:function(){return passiveSupported=!0,!0}});window.addEventListener("test",options,options),window.removeEventListener("test",options,options)}catch{passiveSupported=!1}var nonPassive=passiveSupported?{passive:!1}:!1,alwaysContainsScroll=function(s){return s.tagName==="TEXTAREA"},elementCanBeScrolled=function(s,a){if(!(s instanceof Element))return!1;var u=window.getComputedStyle(s);return u[a]!=="hidden"&&!(u.overflowY===u.overflowX&&!alwaysContainsScroll(s)&&u[a]==="visible")},elementCouldBeVScrolled=function(s){return elementCanBeScrolled(s,"overflowY")},elementCouldBeHScrolled=function(s){return elementCanBeScrolled(s,"overflowX")},locationCouldBeScrolled=function(s,a){var u=a.ownerDocument,l=a;do{typeof ShadowRoot<"u"&&l instanceof ShadowRoot&&(l=l.host);var f=elementCouldBeScrolled(s,l);if(f){var c=getScrollVariables(s,l),h=c[1],p=c[2];if(h>p)return!0}l=l.parentNode}while(l&&l!==u.body);return!1},getVScrollVariables=function(s){var a=s.scrollTop,u=s.scrollHeight,l=s.clientHeight;return[a,u,l]},getHScrollVariables=function(s){var a=s.scrollLeft,u=s.scrollWidth,l=s.clientWidth;return[a,u,l]},elementCouldBeScrolled=function(s,a){return s==="v"?elementCouldBeVScrolled(a):elementCouldBeHScrolled(a)},getScrollVariables=function(s,a){return s==="v"?getVScrollVariables(a):getHScrollVariables(a)},getDirectionFactor=function(s,a){return s==="h"&&a==="rtl"?-1:1},handleScroll=function(s,a,u,l,f){var c=getDirectionFactor(s,window.getComputedStyle(a).direction),h=c*l,p=u.target,v=a.contains(p),y=!1,b=h>0,S=0,E=0;do{var R=getScrollVariables(s,p),O=R[0],I=R[1],B=R[2],N=I-B-c*O;(O||N)&&elementCouldBeScrolled(s,p)&&(S+=N,E+=O),p instanceof ShadowRoot?p=p.host:p=p.parentNode}while(!v&&p!==document.body||v&&(a.contains(p)||a===p));return(b&&(Math.abs(S)<1||!f)||!b&&(Math.abs(E)<1||!f))&&(y=!0),y},getTouchXY=function(s){return"changedTouches"in s?[s.changedTouches[0].clientX,s.changedTouches[0].clientY]:[0,0]},getDeltaXY=function(s){return[s.deltaX,s.deltaY]},extractRef=function(s){return s&&"current"in s?s.current:s},deltaCompare=function(s,a){return s[0]===a[0]&&s[1]===a[1]},generateStyle=function(s){return`
  .block-interactivity-`.concat(s,` {pointer-events: none;}
  .allow-interactivity-`).concat(s,` {pointer-events: all;}
`)},idCounter=0,lockStack=[];function RemoveScrollSideCar(s){var a=reactExports.useRef([]),u=reactExports.useRef([0,0]),l=reactExports.useRef(),f=reactExports.useState(idCounter++)[0],c=reactExports.useState(styleSingleton)[0],h=reactExports.useRef(s);reactExports.useEffect(function(){h.current=s},[s]),reactExports.useEffect(function(){if(s.inert){document.body.classList.add("block-interactivity-".concat(f));var I=__spreadArray([s.lockRef.current],(s.shards||[]).map(extractRef),!0).filter(Boolean);return I.forEach(function(B){return B.classList.add("allow-interactivity-".concat(f))}),function(){document.body.classList.remove("block-interactivity-".concat(f)),I.forEach(function(B){return B.classList.remove("allow-interactivity-".concat(f))})}}},[s.inert,s.lockRef.current,s.shards]);var p=reactExports.useCallback(function(I,B){if("touches"in I&&I.touches.length===2||I.type==="wheel"&&I.ctrlKey)return!h.current.allowPinchZoom;var N=getTouchXY(I),D=u.current,G="deltaX"in I?I.deltaX:D[0]-N[0],V="deltaY"in I?I.deltaY:D[1]-N[1],U,te=I.target,Z=Math.abs(G)>Math.abs(V)?"h":"v";if("touches"in I&&Z==="h"&&te.type==="range")return!1;var J=locationCouldBeScrolled(Z,te);if(!J)return!0;if(J?U=Z:(U=Z==="v"?"h":"v",J=locationCouldBeScrolled(Z,te)),!J)return!1;if(!l.current&&"changedTouches"in I&&(G||V)&&(l.current=U),!U)return!0;var Q=l.current||U;return handleScroll(Q,B,I,Q==="h"?G:V,!0)},[]),v=reactExports.useCallback(function(I){var B=I;if(!(!lockStack.length||lockStack[lockStack.length-1]!==c)){var N="deltaY"in B?getDeltaXY(B):getTouchXY(B),D=a.current.filter(function(U){return U.name===B.type&&(U.target===B.target||B.target===U.shadowParent)&&deltaCompare(U.delta,N)})[0];if(D&&D.should){B.cancelable&&B.preventDefault();return}if(!D){var G=(h.current.shards||[]).map(extractRef).filter(Boolean).filter(function(U){return U.contains(B.target)}),V=G.length>0?p(B,G[0]):!h.current.noIsolation;V&&B.cancelable&&B.preventDefault()}}},[]),y=reactExports.useCallback(function(I,B,N,D){var G={name:I,delta:B,target:N,should:D,shadowParent:getOutermostShadowParent(N)};a.current.push(G),setTimeout(function(){a.current=a.current.filter(function(V){return V!==G})},1)},[]),b=reactExports.useCallback(function(I){u.current=getTouchXY(I),l.current=void 0},[]),S=reactExports.useCallback(function(I){y(I.type,getDeltaXY(I),I.target,p(I,s.lockRef.current))},[]),E=reactExports.useCallback(function(I){y(I.type,getTouchXY(I),I.target,p(I,s.lockRef.current))},[]);reactExports.useEffect(function(){return lockStack.push(c),s.setCallbacks({onScrollCapture:S,onWheelCapture:S,onTouchMoveCapture:E}),document.addEventListener("wheel",v,nonPassive),document.addEventListener("touchmove",v,nonPassive),document.addEventListener("touchstart",b,nonPassive),function(){lockStack=lockStack.filter(function(I){return I!==c}),document.removeEventListener("wheel",v,nonPassive),document.removeEventListener("touchmove",v,nonPassive),document.removeEventListener("touchstart",b,nonPassive)}},[]);var R=s.removeScrollBar,O=s.inert;return reactExports.createElement(reactExports.Fragment,null,O?reactExports.createElement(c,{styles:generateStyle(f)}):null,R?reactExports.createElement(RemoveScrollBar,{gapMode:s.gapMode}):null)}function getOutermostShadowParent(s){for(var a=null;s!==null;)s instanceof ShadowRoot&&(a=s.host,s=s.host),s=s.parentNode;return a}const SideCar=exportSidecar(effectCar,RemoveScrollSideCar);var ReactRemoveScroll=reactExports.forwardRef(function(s,a){return reactExports.createElement(RemoveScroll,__assign$1({},s,{ref:a,sideCar:SideCar}))});ReactRemoveScroll.classNames=RemoveScroll.classNames;function ModalFocusScope(s){const{autoFocus:a,trapFocus:u,dialogRef:l,initialFocusRef:f,blockScrollOnMount:c,allowPinchZoom:h,finalFocusRef:p,returnFocusOnClose:v,preserveScrollBarGap:y,lockFocusAcrossFrames:b,isOpen:S}=useModalContext(),[E,R]=usePresence();reactExports.useEffect(()=>{!E&&R&&setTimeout(R)},[E,R]);const O=useModalManager(l,S);return jsxRuntimeExports.jsx(FocusLock,{autoFocus:a,isDisabled:!u,initialFocusRef:f,finalFocusRef:p,restoreFocus:v,contentRef:l,lockFocusAcrossFrames:b,children:jsxRuntimeExports.jsx(ReactRemoveScroll,{removeScrollBar:!y,allowPinchZoom:h,enabled:O===1&&c,forwardProps:!0,children:s.children})})}var ModalContent=forwardRef((s,a)=>{const{className:u,children:l,containerProps:f,motionProps:c,...h}=s,{getDialogProps:p,getDialogContainerProps:v}=useModalContext(),y=p(h,a),b=v(f),S=cx("chakra-modal__content",u),E=useModalStyles(),R={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...E.dialog},O={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...E.dialogContainer},{motionPreset:I}=useModalContext();return jsxRuntimeExports.jsx(ModalFocusScope,{children:jsxRuntimeExports.jsx(chakra.div,{...b,className:"chakra-modal__content-container",tabIndex:-1,__css:O,children:jsxRuntimeExports.jsx(ModalTransition,{preset:I,motionProps:c,className:S,...y,__css:R,children:l})})})});ModalContent.displayName="ModalContent";var ModalCloseButton=forwardRef((s,a)=>{const{onClick:u,className:l,...f}=s,{onClose:c}=useModalContext(),h=cx("chakra-modal__close-btn",l),p=useModalStyles();return jsxRuntimeExports.jsx(CloseButton,{ref:a,__css:p.closeButton,className:h,onClick:callAllHandlers$1(u,v=>{v.stopPropagation(),c()}),...f})});ModalCloseButton.displayName="ModalCloseButton";var Switch=forwardRef(function(a,u){const l=useMultiStyleConfig("Switch",a),{spacing:f="0.5rem",children:c,...h}=omitThemingProps(a),{getIndicatorProps:p,getInputProps:v,getCheckboxProps:y,getRootProps:b,getLabelProps:S}=useCheckbox(h),E=reactExports.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...l.container}),[l.container]),R=reactExports.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...l.track}),[l.track]),O=reactExports.useMemo(()=>({userSelect:"none",marginStart:f,...l.label}),[f,l.label]);return jsxRuntimeExports.jsxs(chakra.label,{...b(),className:cx("chakra-switch",a.className),__css:E,children:[jsxRuntimeExports.jsx("input",{className:"chakra-switch__input",...v({},u)}),jsxRuntimeExports.jsx(chakra.span,{...y(),className:"chakra-switch__track",__css:R,children:jsxRuntimeExports.jsx(chakra.span,{__css:l.thumb,className:"chakra-switch__thumb",...p()})}),c&&jsxRuntimeExports.jsx(chakra.span,{className:"chakra-switch__label",...S(),__css:O,children:c})]})});Switch.displayName="Switch";var client={},hasRequiredClient;function requireClient(){if(hasRequiredClient)return client;hasRequiredClient=1;var s=requireReactDom();return client.createRoot=s.createRoot,client.hydrateRoot=s.hydrateRoot,client}var clientExports=requireClient();const ReactDOM=getDefaultExportFromCjs(clientExports),toMatchingResponseType=s=>{switch(s){case"config_request":return"config_response";case"login_request":return"login_response";case"logout_request":return"logout_response";case"operation_request":return"operation_response";case"sign_request":return"sign_response"}},clientPermissions={kanvas:{origins:["https://kanvas-poa.vercel.app","https://kanvas-poa-git-poa-release-trili-tech.vercel.app"],login:!0,operations:!1,signPayload:!1}},getPermissionsForOrigin=s=>{for(const a in clientPermissions){const u=clientPermissions[a];if(u.origins.includes(s))return u}return null},getDAppByOrigin=s=>{for(const a in clientPermissions)if(clientPermissions[a].origins.includes(s))return a;return null};function isBrowser$1(){return typeof window<"u"}function detectEnvironment$1(){try{const s="production"}catch{}return"production"}function getMode$1(){return(isBrowser$1()?window.vam:detectEnvironment$1())||"production"}function isProduction(){return getMode$1()==="production"}function isDevelopment$1(){return getMode$1()==="development"}function removeKey(s,{[s]:a,...u}){return u}function parseProperties(s,a){if(!s)return;let u=s;const l=[];for(const[f,c]of Object.entries(s))typeof c=="object"&&c!==null&&(a.strip?u=removeKey(f,u):l.push(f));if(l.length>0&&!a.strip)throw Error(`The following properties are not valid: ${l.join(", ")}. Only strings, numbers, booleans, and null are allowed.`);return u}function track(s,a,u){var l,f;if(!isBrowser$1()){const c="[Vercel Web Analytics] Please import `track` from `@vercel/analytics/server` when using this function in a server environment";if(isProduction())console.warn(c);else throw new Error(c);return}if(!a){(l=window.va)==null||l.call(window,"event",{name:s,options:u});return}try{const c=parseProperties(a,{strip:isProduction()});(f=window.va)==null||f.call(window,"event",{name:s,data:c,options:u})}catch(c){c instanceof Error&&isDevelopment$1()&&console.error(c)}}var nacl={},box={},x25519={},random={},system={},browser$d={},hasRequiredBrowser$d;function requireBrowser$d(){if(hasRequiredBrowser$d)return browser$d;hasRequiredBrowser$d=1,Object.defineProperty(browser$d,"__esModule",{value:!0}),browser$d.BrowserRandomSource=void 0;const s=65536;class a{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const l=typeof self<"u"?self.crypto||self.msCrypto:null;l&&l.getRandomValues!==void 0&&(this._crypto=l,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(l){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const f=new Uint8Array(l);for(let c=0;c<f.length;c+=s)this._crypto.getRandomValues(f.subarray(c,c+Math.min(f.length-c,s)));return f}}return browser$d.BrowserRandomSource=a,browser$d}function commonjsRequire(s){throw new Error('Could not dynamically require "'+s+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var node$3={},wipe={},hasRequiredWipe;function requireWipe(){if(hasRequiredWipe)return wipe;hasRequiredWipe=1,Object.defineProperty(wipe,"__esModule",{value:!0});function s(a){for(var u=0;u<a.length;u++)a[u]=0;return a}return wipe.wipe=s,wipe}var cryptoBrowserify={},dist={},bufferPolyfill={},base64Js={},hasRequiredBase64Js;function requireBase64Js(){if(hasRequiredBase64Js)return base64Js;hasRequiredBase64Js=1,base64Js.byteLength=p,base64Js.toByteArray=y,base64Js.fromByteArray=E;for(var s=[],a=[],u=typeof Uint8Array<"u"?Uint8Array:Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,c=l.length;f<c;++f)s[f]=l[f],a[l.charCodeAt(f)]=f;a[45]=62,a[95]=63;function h(R){var O=R.length;if(O%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var I=R.indexOf("=");I===-1&&(I=O);var B=I===O?0:4-I%4;return[I,B]}function p(R){var O=h(R),I=O[0],B=O[1];return(I+B)*3/4-B}function v(R,O,I){return(O+I)*3/4-I}function y(R){var O,I=h(R),B=I[0],N=I[1],D=new u(v(R,B,N)),G=0,V=N>0?B-4:B,U;for(U=0;U<V;U+=4)O=a[R.charCodeAt(U)]<<18|a[R.charCodeAt(U+1)]<<12|a[R.charCodeAt(U+2)]<<6|a[R.charCodeAt(U+3)],D[G++]=O>>16&255,D[G++]=O>>8&255,D[G++]=O&255;return N===2&&(O=a[R.charCodeAt(U)]<<2|a[R.charCodeAt(U+1)]>>4,D[G++]=O&255),N===1&&(O=a[R.charCodeAt(U)]<<10|a[R.charCodeAt(U+1)]<<4|a[R.charCodeAt(U+2)]>>2,D[G++]=O>>8&255,D[G++]=O&255),D}function b(R){return s[R>>18&63]+s[R>>12&63]+s[R>>6&63]+s[R&63]}function S(R,O,I){for(var B,N=[],D=O;D<I;D+=3)B=(R[D]<<16&16711680)+(R[D+1]<<8&65280)+(R[D+2]&255),N.push(b(B));return N.join("")}function E(R){for(var O,I=R.length,B=I%3,N=[],D=16383,G=0,V=I-B;G<V;G+=D)N.push(S(R,G,G+D>V?V:G+D));return B===1?(O=R[I-1],N.push(s[O>>2]+s[O<<4&63]+"==")):B===2&&(O=(R[I-2]<<8)+R[I-1],N.push(s[O>>10]+s[O>>4&63]+s[O<<2&63]+"=")),N.join("")}return base64Js}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var hasRequiredIeee754;function requireIeee754(){return hasRequiredIeee754||(hasRequiredIeee754=1,ieee754.read=function(s,a,u,l,f){var c,h,p=f*8-l-1,v=(1<<p)-1,y=v>>1,b=-7,S=u?f-1:0,E=u?-1:1,R=s[a+S];for(S+=E,c=R&(1<<-b)-1,R>>=-b,b+=p;b>0;c=c*256+s[a+S],S+=E,b-=8);for(h=c&(1<<-b)-1,c>>=-b,b+=l;b>0;h=h*256+s[a+S],S+=E,b-=8);if(c===0)c=1-y;else{if(c===v)return h?NaN:(R?-1:1)*(1/0);h=h+Math.pow(2,l),c=c-y}return(R?-1:1)*h*Math.pow(2,c-l)},ieee754.write=function(s,a,u,l,f,c){var h,p,v,y=c*8-f-1,b=(1<<y)-1,S=b>>1,E=f===23?Math.pow(2,-24)-Math.pow(2,-77):0,R=l?0:c-1,O=l?1:-1,I=a<0||a===0&&1/a<0?1:0;for(a=Math.abs(a),isNaN(a)||a===1/0?(p=isNaN(a)?1:0,h=b):(h=Math.floor(Math.log(a)/Math.LN2),a*(v=Math.pow(2,-h))<1&&(h--,v*=2),h+S>=1?a+=E/v:a+=E*Math.pow(2,1-S),a*v>=2&&(h++,v/=2),h+S>=b?(p=0,h=b):h+S>=1?(p=(a*v-1)*Math.pow(2,f),h=h+S):(p=a*Math.pow(2,S-1)*Math.pow(2,f),h=0));f>=8;s[u+R]=p&255,R+=O,p/=256,f-=8);for(h=h<<f|p,y+=f;y>0;s[u+R]=h&255,R+=O,h/=256,y-=8);s[u+R-O]|=I*128}),ieee754}/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <https://feross.org>
 * @license  MIT
 */var hasRequiredBufferPolyfill;function requireBufferPolyfill(){return hasRequiredBufferPolyfill||(hasRequiredBufferPolyfill=1,function(s){const a=requireBase64Js(),u=requireIeee754(),l=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;s.Buffer=p,s.SlowBuffer=D,s.INSPECT_MAX_BYTES=50;const f=2147483647;s.kMaxLength=f,p.TYPED_ARRAY_SUPPORT=c(),!p.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function c(){try{const se=new Uint8Array(1),j={foo:function(){return 42}};return Object.setPrototypeOf(j,Uint8Array.prototype),Object.setPrototypeOf(se,j),se.foo()===42}catch{return!1}}Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}}),Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}});function h(se){if(se>f)throw new RangeError('The value "'+se+'" is invalid for option "size"');const j=new Uint8Array(se);return Object.setPrototypeOf(j,p.prototype),j}function p(se,j,X){if(typeof se=="number"){if(typeof j=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return S(se)}return v(se,j,X)}p.poolSize=8192;function v(se,j,X){if(typeof se=="string")return E(se,j);if(ArrayBuffer.isView(se))return O(se);if(se==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof se);if(De(se,ArrayBuffer)||se&&De(se.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(De(se,SharedArrayBuffer)||se&&De(se.buffer,SharedArrayBuffer)))return I(se,j,X);if(typeof se=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ce=se.valueOf&&se.valueOf();if(ce!=null&&ce!==se)return p.from(ce,j,X);const be=B(se);if(be)return be;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof se[Symbol.toPrimitive]=="function")return p.from(se[Symbol.toPrimitive]("string"),j,X);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof se)}p.from=function(se,j,X){return v(se,j,X)},Object.setPrototypeOf(p.prototype,Uint8Array.prototype),Object.setPrototypeOf(p,Uint8Array);function y(se){if(typeof se!="number")throw new TypeError('"size" argument must be of type number');if(se<0)throw new RangeError('The value "'+se+'" is invalid for option "size"')}function b(se,j,X){return y(se),se<=0?h(se):j!==void 0?typeof X=="string"?h(se).fill(j,X):h(se).fill(j):h(se)}p.alloc=function(se,j,X){return b(se,j,X)};function S(se){return y(se),h(se<0?0:N(se)|0)}p.allocUnsafe=function(se){return S(se)},p.allocUnsafeSlow=function(se){return S(se)};function E(se,j){if((typeof j!="string"||j==="")&&(j="utf8"),!p.isEncoding(j))throw new TypeError("Unknown encoding: "+j);const X=G(se,j)|0;let ce=h(X);const be=ce.write(se,j);return be!==X&&(ce=ce.slice(0,be)),ce}function R(se){const j=se.length<0?0:N(se.length)|0,X=h(j);for(let ce=0;ce<j;ce+=1)X[ce]=se[ce]&255;return X}function O(se){if(De(se,Uint8Array)){const j=new Uint8Array(se);return I(j.buffer,j.byteOffset,j.byteLength)}return R(se)}function I(se,j,X){if(j<0||se.byteLength<j)throw new RangeError('"offset" is outside of buffer bounds');if(se.byteLength<j+(X||0))throw new RangeError('"length" is outside of buffer bounds');let ce;return j===void 0&&X===void 0?ce=new Uint8Array(se):X===void 0?ce=new Uint8Array(se,j):ce=new Uint8Array(se,j,X),Object.setPrototypeOf(ce,p.prototype),ce}function B(se){if(p.isBuffer(se)){const j=N(se.length)|0,X=h(j);return X.length===0||se.copy(X,0,0,j),X}if(se.length!==void 0)return typeof se.length!="number"||yt(se.length)?h(0):R(se);if(se.type==="Buffer"&&Array.isArray(se.data))return R(se.data)}function N(se){if(se>=f)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f.toString(16)+" bytes");return se|0}function D(se){return+se!=se&&(se=0),p.alloc(+se)}p.isBuffer=function(j){return j!=null&&j._isBuffer===!0&&j!==p.prototype},p.compare=function(j,X){if(De(j,Uint8Array)&&(j=p.from(j,j.offset,j.byteLength)),De(X,Uint8Array)&&(X=p.from(X,X.offset,X.byteLength)),!p.isBuffer(j)||!p.isBuffer(X))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(j===X)return 0;let ce=j.length,be=X.length;for(let Re=0,Se=Math.min(ce,be);Re<Se;++Re)if(j[Re]!==X[Re]){ce=j[Re],be=X[Re];break}return ce<be?-1:be<ce?1:0},p.isEncoding=function(j){switch(String(j).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},p.concat=function(j,X){if(!Array.isArray(j))throw new TypeError('"list" argument must be an Array of Buffers');if(j.length===0)return p.alloc(0);let ce;if(X===void 0)for(X=0,ce=0;ce<j.length;++ce)X+=j[ce].length;const be=p.allocUnsafe(X);let Re=0;for(ce=0;ce<j.length;++ce){let Se=j[ce];if(De(Se,Uint8Array))Re+Se.length>be.length?(p.isBuffer(Se)||(Se=p.from(Se)),Se.copy(be,Re)):Uint8Array.prototype.set.call(be,Se,Re);else if(p.isBuffer(Se))Se.copy(be,Re);else throw new TypeError('"list" argument must be an Array of Buffers');Re+=Se.length}return be};function G(se,j){if(p.isBuffer(se))return se.length;if(ArrayBuffer.isView(se)||De(se,ArrayBuffer))return se.byteLength;if(typeof se!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof se);const X=se.length,ce=arguments.length>2&&arguments[2]===!0;if(!ce&&X===0)return 0;let be=!1;for(;;)switch(j){case"ascii":case"latin1":case"binary":return X;case"utf8":case"utf-8":return Ke(se).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return X*2;case"hex":return X>>>1;case"base64":return at(se).length;default:if(be)return ce?-1:Ke(se).length;j=(""+j).toLowerCase(),be=!0}}p.byteLength=G;function V(se,j,X){let ce=!1;if((j===void 0||j<0)&&(j=0),j>this.length||((X===void 0||X>this.length)&&(X=this.length),X<=0)||(X>>>=0,j>>>=0,X<=j))return"";for(se||(se="utf8");;)switch(se){case"hex":return T(this,j,X);case"utf8":case"utf-8":return _(this,j,X);case"ascii":return P(this,j,X);case"latin1":case"binary":return $(this,j,X);case"base64":return g(this,j,X);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m(this,j,X);default:if(ce)throw new TypeError("Unknown encoding: "+se);se=(se+"").toLowerCase(),ce=!0}}p.prototype._isBuffer=!0;function U(se,j,X){const ce=se[j];se[j]=se[X],se[X]=ce}p.prototype.swap16=function(){const j=this.length;if(j%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let X=0;X<j;X+=2)U(this,X,X+1);return this},p.prototype.swap32=function(){const j=this.length;if(j%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let X=0;X<j;X+=4)U(this,X,X+3),U(this,X+1,X+2);return this},p.prototype.swap64=function(){const j=this.length;if(j%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let X=0;X<j;X+=8)U(this,X,X+7),U(this,X+1,X+6),U(this,X+2,X+5),U(this,X+3,X+4);return this},p.prototype.toString=function(){const j=this.length;return j===0?"":arguments.length===0?_(this,0,j):V.apply(this,arguments)},p.prototype.toLocaleString=p.prototype.toString,p.prototype.equals=function(j){if(!p.isBuffer(j))throw new TypeError("Argument must be a Buffer");return this===j?!0:p.compare(this,j)===0},p.prototype.inspect=function(){let j="";const X=s.INSPECT_MAX_BYTES;return j=this.toString("hex",0,X).replace(/(.{2})/g,"$1 ").trim(),this.length>X&&(j+=" ... "),"<Buffer "+j+">"},l&&(p.prototype[l]=p.prototype.inspect),p.prototype.compare=function(j,X,ce,be,Re){if(De(j,Uint8Array)&&(j=p.from(j,j.offset,j.byteLength)),!p.isBuffer(j))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof j);if(X===void 0&&(X=0),ce===void 0&&(ce=j?j.length:0),be===void 0&&(be=0),Re===void 0&&(Re=this.length),X<0||ce>j.length||be<0||Re>this.length)throw new RangeError("out of range index");if(be>=Re&&X>=ce)return 0;if(be>=Re)return-1;if(X>=ce)return 1;if(X>>>=0,ce>>>=0,be>>>=0,Re>>>=0,this===j)return 0;let Se=Re-be,qe=ce-X;const bt=Math.min(Se,qe),je=this.slice(be,Re),We=j.slice(X,ce);for(let St=0;St<bt;++St)if(je[St]!==We[St]){Se=je[St],qe=We[St];break}return Se<qe?-1:qe<Se?1:0};function te(se,j,X,ce,be){if(se.length===0)return-1;if(typeof X=="string"?(ce=X,X=0):X>2147483647?X=2147483647:X<-2147483648&&(X=-2147483648),X=+X,yt(X)&&(X=be?0:se.length-1),X<0&&(X=se.length+X),X>=se.length){if(be)return-1;X=se.length-1}else if(X<0)if(be)X=0;else return-1;if(typeof j=="string"&&(j=p.from(j,ce)),p.isBuffer(j))return j.length===0?-1:Z(se,j,X,ce,be);if(typeof j=="number")return j=j&255,typeof Uint8Array.prototype.indexOf=="function"?be?Uint8Array.prototype.indexOf.call(se,j,X):Uint8Array.prototype.lastIndexOf.call(se,j,X):Z(se,[j],X,ce,be);throw new TypeError("val must be string, number or Buffer")}function Z(se,j,X,ce,be){let Re=1,Se=se.length,qe=j.length;if(ce!==void 0&&(ce=String(ce).toLowerCase(),ce==="ucs2"||ce==="ucs-2"||ce==="utf16le"||ce==="utf-16le")){if(se.length<2||j.length<2)return-1;Re=2,Se/=2,qe/=2,X/=2}function bt(We,St){return Re===1?We[St]:We.readUInt16BE(St*Re)}let je;if(be){let We=-1;for(je=X;je<Se;je++)if(bt(se,je)===bt(j,We===-1?0:je-We)){if(We===-1&&(We=je),je-We+1===qe)return We*Re}else We!==-1&&(je-=je-We),We=-1}else for(X+qe>Se&&(X=Se-qe),je=X;je>=0;je--){let We=!0;for(let St=0;St<qe;St++)if(bt(se,je+St)!==bt(j,St)){We=!1;break}if(We)return je}return-1}p.prototype.includes=function(j,X,ce){return this.indexOf(j,X,ce)!==-1},p.prototype.indexOf=function(j,X,ce){return te(this,j,X,ce,!0)},p.prototype.lastIndexOf=function(j,X,ce){return te(this,j,X,ce,!1)};function J(se,j,X,ce){X=Number(X)||0;const be=se.length-X;ce?(ce=Number(ce),ce>be&&(ce=be)):ce=be;const Re=j.length;ce>Re/2&&(ce=Re/2);let Se;for(Se=0;Se<ce;++Se){const qe=parseInt(j.substr(Se*2,2),16);if(yt(qe))return Se;se[X+Se]=qe}return Se}function Q(se,j,X,ce){return Oe(Ke(j,se.length-X),se,X,ce)}function ee(se,j,X,ce){return Oe(Le(j),se,X,ce)}function k(se,j,X,ce){return Oe(at(j),se,X,ce)}function d(se,j,X,ce){return Oe(Ce(j,se.length-X),se,X,ce)}p.prototype.write=function(j,X,ce,be){if(X===void 0)be="utf8",ce=this.length,X=0;else if(ce===void 0&&typeof X=="string")be=X,ce=this.length,X=0;else if(isFinite(X))X=X>>>0,isFinite(ce)?(ce=ce>>>0,be===void 0&&(be="utf8")):(be=ce,ce=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Re=this.length-X;if((ce===void 0||ce>Re)&&(ce=Re),j.length>0&&(ce<0||X<0)||X>this.length)throw new RangeError("Attempt to write outside buffer bounds");be||(be="utf8");let Se=!1;for(;;)switch(be){case"hex":return J(this,j,X,ce);case"utf8":case"utf-8":return Q(this,j,X,ce);case"ascii":case"latin1":case"binary":return ee(this,j,X,ce);case"base64":return k(this,j,X,ce);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return d(this,j,X,ce);default:if(Se)throw new TypeError("Unknown encoding: "+be);be=(""+be).toLowerCase(),Se=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function g(se,j,X){return j===0&&X===se.length?a.fromByteArray(se):a.fromByteArray(se.slice(j,X))}function _(se,j,X){X=Math.min(se.length,X);const ce=[];let be=j;for(;be<X;){const Re=se[be];let Se=null,qe=Re>239?4:Re>223?3:Re>191?2:1;if(be+qe<=X){let bt,je,We,St;switch(qe){case 1:Re<128&&(Se=Re);break;case 2:bt=se[be+1],(bt&192)===128&&(St=(Re&31)<<6|bt&63,St>127&&(Se=St));break;case 3:bt=se[be+1],je=se[be+2],(bt&192)===128&&(je&192)===128&&(St=(Re&15)<<12|(bt&63)<<6|je&63,St>2047&&(St<55296||St>57343)&&(Se=St));break;case 4:bt=se[be+1],je=se[be+2],We=se[be+3],(bt&192)===128&&(je&192)===128&&(We&192)===128&&(St=(Re&15)<<18|(bt&63)<<12|(je&63)<<6|We&63,St>65535&&St<1114112&&(Se=St))}}Se===null?(Se=65533,qe=1):Se>65535&&(Se-=65536,ce.push(Se>>>10&1023|55296),Se=56320|Se&1023),ce.push(Se),be+=qe}return x(ce)}const w=4096;function x(se){const j=se.length;if(j<=w)return String.fromCharCode.apply(String,se);let X="",ce=0;for(;ce<j;)X+=String.fromCharCode.apply(String,se.slice(ce,ce+=w));return X}function P(se,j,X){let ce="";X=Math.min(se.length,X);for(let be=j;be<X;++be)ce+=String.fromCharCode(se[be]&127);return ce}function $(se,j,X){let ce="";X=Math.min(se.length,X);for(let be=j;be<X;++be)ce+=String.fromCharCode(se[be]);return ce}function T(se,j,X){const ce=se.length;(!j||j<0)&&(j=0),(!X||X<0||X>ce)&&(X=ce);let be="";for(let Re=j;Re<X;++Re)be+=Ue[se[Re]];return be}function m(se,j,X){const ce=se.slice(j,X);let be="";for(let Re=0;Re<ce.length-1;Re+=2)be+=String.fromCharCode(ce[Re]+ce[Re+1]*256);return be}p.prototype.slice=function(j,X){const ce=this.length;j=~~j,X=X===void 0?ce:~~X,j<0?(j+=ce,j<0&&(j=0)):j>ce&&(j=ce),X<0?(X+=ce,X<0&&(X=0)):X>ce&&(X=ce),X<j&&(X=j);const be=this.subarray(j,X);return Object.setPrototypeOf(be,p.prototype),be};function M(se,j,X){if(se%1!==0||se<0)throw new RangeError("offset is not uint");if(se+j>X)throw new RangeError("Trying to access beyond buffer length")}p.prototype.readUintLE=p.prototype.readUIntLE=function(j,X,ce){j=j>>>0,X=X>>>0,ce||M(j,X,this.length);let be=this[j],Re=1,Se=0;for(;++Se<X&&(Re*=256);)be+=this[j+Se]*Re;return be},p.prototype.readUintBE=p.prototype.readUIntBE=function(j,X,ce){j=j>>>0,X=X>>>0,ce||M(j,X,this.length);let be=this[j+--X],Re=1;for(;X>0&&(Re*=256);)be+=this[j+--X]*Re;return be},p.prototype.readUint8=p.prototype.readUInt8=function(j,X){return j=j>>>0,X||M(j,1,this.length),this[j]},p.prototype.readUint16LE=p.prototype.readUInt16LE=function(j,X){return j=j>>>0,X||M(j,2,this.length),this[j]|this[j+1]<<8},p.prototype.readUint16BE=p.prototype.readUInt16BE=function(j,X){return j=j>>>0,X||M(j,2,this.length),this[j]<<8|this[j+1]},p.prototype.readUint32LE=p.prototype.readUInt32LE=function(j,X){return j=j>>>0,X||M(j,4,this.length),(this[j]|this[j+1]<<8|this[j+2]<<16)+this[j+3]*16777216},p.prototype.readUint32BE=p.prototype.readUInt32BE=function(j,X){return j=j>>>0,X||M(j,4,this.length),this[j]*16777216+(this[j+1]<<16|this[j+2]<<8|this[j+3])},p.prototype.readBigUInt64LE=ze(function(j){j=j>>>0,xe(j,"offset");const X=this[j],ce=this[j+7];(X===void 0||ce===void 0)&&Ne(j,this.length-8);const be=X+this[++j]*2**8+this[++j]*2**16+this[++j]*2**24,Re=this[++j]+this[++j]*2**8+this[++j]*2**16+ce*2**24;return BigInt(be)+(BigInt(Re)<<BigInt(32))}),p.prototype.readBigUInt64BE=ze(function(j){j=j>>>0,xe(j,"offset");const X=this[j],ce=this[j+7];(X===void 0||ce===void 0)&&Ne(j,this.length-8);const be=X*2**24+this[++j]*2**16+this[++j]*2**8+this[++j],Re=this[++j]*2**24+this[++j]*2**16+this[++j]*2**8+ce;return(BigInt(be)<<BigInt(32))+BigInt(Re)}),p.prototype.readIntLE=function(j,X,ce){j=j>>>0,X=X>>>0,ce||M(j,X,this.length);let be=this[j],Re=1,Se=0;for(;++Se<X&&(Re*=256);)be+=this[j+Se]*Re;return Re*=128,be>=Re&&(be-=Math.pow(2,8*X)),be},p.prototype.readIntBE=function(j,X,ce){j=j>>>0,X=X>>>0,ce||M(j,X,this.length);let be=X,Re=1,Se=this[j+--be];for(;be>0&&(Re*=256);)Se+=this[j+--be]*Re;return Re*=128,Se>=Re&&(Se-=Math.pow(2,8*X)),Se},p.prototype.readInt8=function(j,X){return j=j>>>0,X||M(j,1,this.length),this[j]&128?(255-this[j]+1)*-1:this[j]},p.prototype.readInt16LE=function(j,X){j=j>>>0,X||M(j,2,this.length);const ce=this[j]|this[j+1]<<8;return ce&32768?ce|4294901760:ce},p.prototype.readInt16BE=function(j,X){j=j>>>0,X||M(j,2,this.length);const ce=this[j+1]|this[j]<<8;return ce&32768?ce|4294901760:ce},p.prototype.readInt32LE=function(j,X){return j=j>>>0,X||M(j,4,this.length),this[j]|this[j+1]<<8|this[j+2]<<16|this[j+3]<<24},p.prototype.readInt32BE=function(j,X){return j=j>>>0,X||M(j,4,this.length),this[j]<<24|this[j+1]<<16|this[j+2]<<8|this[j+3]},p.prototype.readBigInt64LE=ze(function(j){j=j>>>0,xe(j,"offset");const X=this[j],ce=this[j+7];(X===void 0||ce===void 0)&&Ne(j,this.length-8);const be=this[j+4]+this[j+5]*2**8+this[j+6]*2**16+(ce<<24);return(BigInt(be)<<BigInt(32))+BigInt(X+this[++j]*2**8+this[++j]*2**16+this[++j]*2**24)}),p.prototype.readBigInt64BE=ze(function(j){j=j>>>0,xe(j,"offset");const X=this[j],ce=this[j+7];(X===void 0||ce===void 0)&&Ne(j,this.length-8);const be=(X<<24)+this[++j]*2**16+this[++j]*2**8+this[++j];return(BigInt(be)<<BigInt(32))+BigInt(this[++j]*2**24+this[++j]*2**16+this[++j]*2**8+ce)}),p.prototype.readFloatLE=function(j,X){return j=j>>>0,X||M(j,4,this.length),u.read(this,j,!0,23,4)},p.prototype.readFloatBE=function(j,X){return j=j>>>0,X||M(j,4,this.length),u.read(this,j,!1,23,4)},p.prototype.readDoubleLE=function(j,X){return j=j>>>0,X||M(j,8,this.length),u.read(this,j,!0,52,8)},p.prototype.readDoubleBE=function(j,X){return j=j>>>0,X||M(j,8,this.length),u.read(this,j,!1,52,8)};function W(se,j,X,ce,be,Re){if(!p.isBuffer(se))throw new TypeError('"buffer" argument must be a Buffer instance');if(j>be||j<Re)throw new RangeError('"value" argument is out of bounds');if(X+ce>se.length)throw new RangeError("Index out of range")}p.prototype.writeUintLE=p.prototype.writeUIntLE=function(j,X,ce,be){if(j=+j,X=X>>>0,ce=ce>>>0,!be){const qe=Math.pow(2,8*ce)-1;W(this,j,X,ce,qe,0)}let Re=1,Se=0;for(this[X]=j&255;++Se<ce&&(Re*=256);)this[X+Se]=j/Re&255;return X+ce},p.prototype.writeUintBE=p.prototype.writeUIntBE=function(j,X,ce,be){if(j=+j,X=X>>>0,ce=ce>>>0,!be){const qe=Math.pow(2,8*ce)-1;W(this,j,X,ce,qe,0)}let Re=ce-1,Se=1;for(this[X+Re]=j&255;--Re>=0&&(Se*=256);)this[X+Re]=j/Se&255;return X+ce},p.prototype.writeUint8=p.prototype.writeUInt8=function(j,X,ce){return j=+j,X=X>>>0,ce||W(this,j,X,1,255,0),this[X]=j&255,X+1},p.prototype.writeUint16LE=p.prototype.writeUInt16LE=function(j,X,ce){return j=+j,X=X>>>0,ce||W(this,j,X,2,65535,0),this[X]=j&255,this[X+1]=j>>>8,X+2},p.prototype.writeUint16BE=p.prototype.writeUInt16BE=function(j,X,ce){return j=+j,X=X>>>0,ce||W(this,j,X,2,65535,0),this[X]=j>>>8,this[X+1]=j&255,X+2},p.prototype.writeUint32LE=p.prototype.writeUInt32LE=function(j,X,ce){return j=+j,X=X>>>0,ce||W(this,j,X,4,4294967295,0),this[X+3]=j>>>24,this[X+2]=j>>>16,this[X+1]=j>>>8,this[X]=j&255,X+4},p.prototype.writeUint32BE=p.prototype.writeUInt32BE=function(j,X,ce){return j=+j,X=X>>>0,ce||W(this,j,X,4,4294967295,0),this[X]=j>>>24,this[X+1]=j>>>16,this[X+2]=j>>>8,this[X+3]=j&255,X+4};function Y(se,j,X,ce,be){me(j,ce,be,se,X,7);let Re=Number(j&BigInt(4294967295));se[X++]=Re,Re=Re>>8,se[X++]=Re,Re=Re>>8,se[X++]=Re,Re=Re>>8,se[X++]=Re;let Se=Number(j>>BigInt(32)&BigInt(4294967295));return se[X++]=Se,Se=Se>>8,se[X++]=Se,Se=Se>>8,se[X++]=Se,Se=Se>>8,se[X++]=Se,X}function ue(se,j,X,ce,be){me(j,ce,be,se,X,7);let Re=Number(j&BigInt(4294967295));se[X+7]=Re,Re=Re>>8,se[X+6]=Re,Re=Re>>8,se[X+5]=Re,Re=Re>>8,se[X+4]=Re;let Se=Number(j>>BigInt(32)&BigInt(4294967295));return se[X+3]=Se,Se=Se>>8,se[X+2]=Se,Se=Se>>8,se[X+1]=Se,Se=Se>>8,se[X]=Se,X+8}p.prototype.writeBigUInt64LE=ze(function(j,X=0){return Y(this,j,X,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeBigUInt64BE=ze(function(j,X=0){return ue(this,j,X,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeIntLE=function(j,X,ce,be){if(j=+j,X=X>>>0,!be){const bt=Math.pow(2,8*ce-1);W(this,j,X,ce,bt-1,-bt)}let Re=0,Se=1,qe=0;for(this[X]=j&255;++Re<ce&&(Se*=256);)j<0&&qe===0&&this[X+Re-1]!==0&&(qe=1),this[X+Re]=(j/Se>>0)-qe&255;return X+ce},p.prototype.writeIntBE=function(j,X,ce,be){if(j=+j,X=X>>>0,!be){const bt=Math.pow(2,8*ce-1);W(this,j,X,ce,bt-1,-bt)}let Re=ce-1,Se=1,qe=0;for(this[X+Re]=j&255;--Re>=0&&(Se*=256);)j<0&&qe===0&&this[X+Re+1]!==0&&(qe=1),this[X+Re]=(j/Se>>0)-qe&255;return X+ce},p.prototype.writeInt8=function(j,X,ce){return j=+j,X=X>>>0,ce||W(this,j,X,1,127,-128),j<0&&(j=255+j+1),this[X]=j&255,X+1},p.prototype.writeInt16LE=function(j,X,ce){return j=+j,X=X>>>0,ce||W(this,j,X,2,32767,-32768),this[X]=j&255,this[X+1]=j>>>8,X+2},p.prototype.writeInt16BE=function(j,X,ce){return j=+j,X=X>>>0,ce||W(this,j,X,2,32767,-32768),this[X]=j>>>8,this[X+1]=j&255,X+2},p.prototype.writeInt32LE=function(j,X,ce){return j=+j,X=X>>>0,ce||W(this,j,X,4,2147483647,-2147483648),this[X]=j&255,this[X+1]=j>>>8,this[X+2]=j>>>16,this[X+3]=j>>>24,X+4},p.prototype.writeInt32BE=function(j,X,ce){return j=+j,X=X>>>0,ce||W(this,j,X,4,2147483647,-2147483648),j<0&&(j=4294967295+j+1),this[X]=j>>>24,this[X+1]=j>>>16,this[X+2]=j>>>8,this[X+3]=j&255,X+4},p.prototype.writeBigInt64LE=ze(function(j,X=0){return Y(this,j,X,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),p.prototype.writeBigInt64BE=ze(function(j,X=0){return ue(this,j,X,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ge(se,j,X,ce,be,Re){if(X+ce>se.length)throw new RangeError("Index out of range");if(X<0)throw new RangeError("Index out of range")}function he(se,j,X,ce,be){return j=+j,X=X>>>0,be||ge(se,j,X,4),u.write(se,j,X,ce,23,4),X+4}p.prototype.writeFloatLE=function(j,X,ce){return he(this,j,X,!0,ce)},p.prototype.writeFloatBE=function(j,X,ce){return he(this,j,X,!1,ce)};function ae(se,j,X,ce,be){return j=+j,X=X>>>0,be||ge(se,j,X,8),u.write(se,j,X,ce,52,8),X+8}p.prototype.writeDoubleLE=function(j,X,ce){return ae(this,j,X,!0,ce)},p.prototype.writeDoubleBE=function(j,X,ce){return ae(this,j,X,!1,ce)},p.prototype.copy=function(j,X,ce,be){if(!p.isBuffer(j))throw new TypeError("argument should be a Buffer");if(ce||(ce=0),!be&&be!==0&&(be=this.length),X>=j.length&&(X=j.length),X||(X=0),be>0&&be<ce&&(be=ce),be===ce||j.length===0||this.length===0)return 0;if(X<0)throw new RangeError("targetStart out of bounds");if(ce<0||ce>=this.length)throw new RangeError("Index out of range");if(be<0)throw new RangeError("sourceEnd out of bounds");be>this.length&&(be=this.length),j.length-X<be-ce&&(be=j.length-X+ce);const Re=be-ce;return this===j&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(X,ce,be):Uint8Array.prototype.set.call(j,this.subarray(ce,be),X),Re},p.prototype.fill=function(j,X,ce,be){if(typeof j=="string"){if(typeof X=="string"?(be=X,X=0,ce=this.length):typeof ce=="string"&&(be=ce,ce=this.length),be!==void 0&&typeof be!="string")throw new TypeError("encoding must be a string");if(typeof be=="string"&&!p.isEncoding(be))throw new TypeError("Unknown encoding: "+be);if(j.length===1){const Se=j.charCodeAt(0);(be==="utf8"&&Se<128||be==="latin1")&&(j=Se)}}else typeof j=="number"?j=j&255:typeof j=="boolean"&&(j=Number(j));if(X<0||this.length<X||this.length<ce)throw new RangeError("Out of range index");if(ce<=X)return this;X=X>>>0,ce=ce===void 0?this.length:ce>>>0,j||(j=0);let Re;if(typeof j=="number")for(Re=X;Re<ce;++Re)this[Re]=j;else{const Se=p.isBuffer(j)?j:p.from(j,be),qe=Se.length;if(qe===0)throw new TypeError('The value "'+j+'" is invalid for argument "value"');for(Re=0;Re<ce-X;++Re)this[Re+X]=Se[Re%qe]}return this};const de={};function pe(se,j,X){de[se]=class extends X{constructor(){super(),Object.defineProperty(this,"message",{value:j.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${se}]`,this.stack,delete this.name}get code(){return se}set code(be){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:be,writable:!0})}toString(){return`${this.name} [${se}]: ${this.message}`}}}pe("ERR_BUFFER_OUT_OF_BOUNDS",function(se){return se?`${se} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),pe("ERR_INVALID_ARG_TYPE",function(se,j){return`The "${se}" argument must be of type number. Received type ${typeof j}`},TypeError),pe("ERR_OUT_OF_RANGE",function(se,j,X){let ce=`The value of "${se}" is out of range.`,be=X;return Number.isInteger(X)&&Math.abs(X)>2**32?be=oe(String(X)):typeof X=="bigint"&&(be=String(X),(X>BigInt(2)**BigInt(32)||X<-(BigInt(2)**BigInt(32)))&&(be=oe(be)),be+="n"),ce+=` It must be ${j}. Received ${be}`,ce},RangeError);function oe(se){let j="",X=se.length;const ce=se[0]==="-"?1:0;for(;X>=ce+4;X-=3)j=`_${se.slice(X-3,X)}${j}`;return`${se.slice(0,X)}${j}`}function le(se,j,X){xe(j,"offset"),(se[j]===void 0||se[j+X]===void 0)&&Ne(j,se.length-(X+1))}function me(se,j,X,ce,be,Re){if(se>X||se<j){const Se=typeof j=="bigint"?"n":"";let qe;throw j===0||j===BigInt(0)?qe=`>= 0${Se} and < 2${Se} ** ${(Re+1)*8}${Se}`:qe=`>= -(2${Se} ** ${(Re+1)*8-1}${Se}) and < 2 ** ${(Re+1)*8-1}${Se}`,new de.ERR_OUT_OF_RANGE("value",qe,se)}le(ce,be,Re)}function xe(se,j){if(typeof se!="number")throw new de.ERR_INVALID_ARG_TYPE(j,"number",se)}function Ne(se,j,X){throw Math.floor(se)!==se?(xe(se,X),new de.ERR_OUT_OF_RANGE("offset","an integer",se)):j<0?new de.ERR_BUFFER_OUT_OF_BOUNDS:new de.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${j}`,se)}const Pe=/[^+/0-9A-Za-z-_]/g;function Ie(se){if(se=se.split("=")[0],se=se.trim().replace(Pe,""),se.length<2)return"";for(;se.length%4!==0;)se=se+"=";return se}function Ke(se,j){j=j||1/0;let X;const ce=se.length;let be=null;const Re=[];for(let Se=0;Se<ce;++Se){if(X=se.charCodeAt(Se),X>55295&&X<57344){if(!be){if(X>56319){(j-=3)>-1&&Re.push(239,191,189);continue}else if(Se+1===ce){(j-=3)>-1&&Re.push(239,191,189);continue}be=X;continue}if(X<56320){(j-=3)>-1&&Re.push(239,191,189),be=X;continue}X=(be-55296<<10|X-56320)+65536}else be&&(j-=3)>-1&&Re.push(239,191,189);if(be=null,X<128){if((j-=1)<0)break;Re.push(X)}else if(X<2048){if((j-=2)<0)break;Re.push(X>>6|192,X&63|128)}else if(X<65536){if((j-=3)<0)break;Re.push(X>>12|224,X>>6&63|128,X&63|128)}else if(X<1114112){if((j-=4)<0)break;Re.push(X>>18|240,X>>12&63|128,X>>6&63|128,X&63|128)}else throw new Error("Invalid code point")}return Re}function Le(se){const j=[];for(let X=0;X<se.length;++X)j.push(se.charCodeAt(X)&255);return j}function Ce(se,j){let X,ce,be;const Re=[];for(let Se=0;Se<se.length&&!((j-=2)<0);++Se)X=se.charCodeAt(Se),ce=X>>8,be=X%256,Re.push(be),Re.push(ce);return Re}function at(se){return a.toByteArray(Ie(se))}function Oe(se,j,X,ce){let be;for(be=0;be<ce&&!(be+X>=j.length||be>=se.length);++be)j[be+X]=se[be];return be}function De(se,j){return se instanceof j||se!=null&&se.constructor!=null&&se.constructor.name!=null&&se.constructor.name===j.name}function yt(se){return se!==se}const Ue=function(){const se="0123456789abcdef",j=new Array(256);for(let X=0;X<16;++X){const ce=X*16;for(let be=0;be<16;++be)j[ce+be]=se[X]+se[be]}return j}();function ze(se){return typeof BigInt>"u"?Mt:se}function Mt(){throw new Error("BigInt not supported")}}(bufferPolyfill)),bufferPolyfill}var browser$c={exports:{}},hasRequiredBrowser$c;function requireBrowser$c(){if(hasRequiredBrowser$c)return browser$c.exports;hasRequiredBrowser$c=1;var s=browser$c.exports={},a,u;function l(){throw new Error("setTimeout has not been defined")}function f(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?a=setTimeout:a=l}catch{a=l}try{typeof clearTimeout=="function"?u=clearTimeout:u=f}catch{u=f}})();function c(I){if(a===setTimeout)return setTimeout(I,0);if((a===l||!a)&&setTimeout)return a=setTimeout,setTimeout(I,0);try{return a(I,0)}catch{try{return a.call(null,I,0)}catch{return a.call(this,I,0)}}}function h(I){if(u===clearTimeout)return clearTimeout(I);if((u===f||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(I);try{return u(I)}catch{try{return u.call(null,I)}catch{return u.call(this,I)}}}var p=[],v=!1,y,b=-1;function S(){!v||!y||(v=!1,y.length?p=y.concat(p):b=-1,p.length&&E())}function E(){if(!v){var I=c(S);v=!0;for(var B=p.length;B;){for(y=p,p=[];++b<B;)y&&y[b].run();b=-1,B=p.length}y=null,v=!1,h(I)}}s.nextTick=function(I){var B=new Array(arguments.length-1);if(arguments.length>1)for(var N=1;N<arguments.length;N++)B[N-1]=arguments[N];p.push(new R(I,B)),p.length===1&&!v&&c(E)};function R(I,B){this.fun=I,this.array=B}R.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={};function O(){}return s.on=O,s.addListener=O,s.once=O,s.off=O,s.removeListener=O,s.removeAllListeners=O,s.emit=O,s.prependListener=O,s.prependOnceListener=O,s.listeners=function(I){return[]},s.binding=function(I){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(I){throw new Error("process.chdir is not supported")},s.umask=function(){return 0},browser$c.exports}var hasRequiredDist;function requireDist(){return hasRequiredDist||(hasRequiredDist=1,function(s){Object.defineProperty(s,Symbol.toStringTag,{value:"Module"});const a=requireBufferPolyfill(),u=requireBrowser$c(),l=h=>h&&h.__esModule?h:{default:h},f=l(u),c=globalThis||void 0||self;Object.defineProperty(s,"Buffer",{enumerable:!0,get:()=>a.Buffer}),Object.defineProperty(s,"process",{enumerable:!0,get:()=>f.default}),s.global=c}(dist)),dist}var distExports=requireDist(),browser$b={exports:{}},safeBuffer$2={exports:{}},buffer$1={};/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <https://feross.org>
 * @license  MIT
 */var hasRequiredBuffer$1;function requireBuffer$1(){return hasRequiredBuffer$1||(hasRequiredBuffer$1=1,function(s){const a=requireBase64Js(),u=requireIeee754(),l=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;s.Buffer=p,s.SlowBuffer=D,s.INSPECT_MAX_BYTES=50;const f=2147483647;s.kMaxLength=f,p.TYPED_ARRAY_SUPPORT=c(),!p.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function c(){try{const se=new Uint8Array(1),j={foo:function(){return 42}};return Object.setPrototypeOf(j,Uint8Array.prototype),Object.setPrototypeOf(se,j),se.foo()===42}catch{return!1}}Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}}),Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}});function h(se){if(se>f)throw new RangeError('The value "'+se+'" is invalid for option "size"');const j=new Uint8Array(se);return Object.setPrototypeOf(j,p.prototype),j}function p(se,j,X){if(typeof se=="number"){if(typeof j=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return S(se)}return v(se,j,X)}p.poolSize=8192;function v(se,j,X){if(typeof se=="string")return E(se,j);if(ArrayBuffer.isView(se))return O(se);if(se==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof se);if(De(se,ArrayBuffer)||se&&De(se.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(De(se,SharedArrayBuffer)||se&&De(se.buffer,SharedArrayBuffer)))return I(se,j,X);if(typeof se=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ce=se.valueOf&&se.valueOf();if(ce!=null&&ce!==se)return p.from(ce,j,X);const be=B(se);if(be)return be;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof se[Symbol.toPrimitive]=="function")return p.from(se[Symbol.toPrimitive]("string"),j,X);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof se)}p.from=function(se,j,X){return v(se,j,X)},Object.setPrototypeOf(p.prototype,Uint8Array.prototype),Object.setPrototypeOf(p,Uint8Array);function y(se){if(typeof se!="number")throw new TypeError('"size" argument must be of type number');if(se<0)throw new RangeError('The value "'+se+'" is invalid for option "size"')}function b(se,j,X){return y(se),se<=0?h(se):j!==void 0?typeof X=="string"?h(se).fill(j,X):h(se).fill(j):h(se)}p.alloc=function(se,j,X){return b(se,j,X)};function S(se){return y(se),h(se<0?0:N(se)|0)}p.allocUnsafe=function(se){return S(se)},p.allocUnsafeSlow=function(se){return S(se)};function E(se,j){if((typeof j!="string"||j==="")&&(j="utf8"),!p.isEncoding(j))throw new TypeError("Unknown encoding: "+j);const X=G(se,j)|0;let ce=h(X);const be=ce.write(se,j);return be!==X&&(ce=ce.slice(0,be)),ce}function R(se){const j=se.length<0?0:N(se.length)|0,X=h(j);for(let ce=0;ce<j;ce+=1)X[ce]=se[ce]&255;return X}function O(se){if(De(se,Uint8Array)){const j=new Uint8Array(se);return I(j.buffer,j.byteOffset,j.byteLength)}return R(se)}function I(se,j,X){if(j<0||se.byteLength<j)throw new RangeError('"offset" is outside of buffer bounds');if(se.byteLength<j+(X||0))throw new RangeError('"length" is outside of buffer bounds');let ce;return j===void 0&&X===void 0?ce=new Uint8Array(se):X===void 0?ce=new Uint8Array(se,j):ce=new Uint8Array(se,j,X),Object.setPrototypeOf(ce,p.prototype),ce}function B(se){if(p.isBuffer(se)){const j=N(se.length)|0,X=h(j);return X.length===0||se.copy(X,0,0,j),X}if(se.length!==void 0)return typeof se.length!="number"||yt(se.length)?h(0):R(se);if(se.type==="Buffer"&&Array.isArray(se.data))return R(se.data)}function N(se){if(se>=f)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f.toString(16)+" bytes");return se|0}function D(se){return+se!=se&&(se=0),p.alloc(+se)}p.isBuffer=function(j){return j!=null&&j._isBuffer===!0&&j!==p.prototype},p.compare=function(j,X){if(De(j,Uint8Array)&&(j=p.from(j,j.offset,j.byteLength)),De(X,Uint8Array)&&(X=p.from(X,X.offset,X.byteLength)),!p.isBuffer(j)||!p.isBuffer(X))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(j===X)return 0;let ce=j.length,be=X.length;for(let Re=0,Se=Math.min(ce,be);Re<Se;++Re)if(j[Re]!==X[Re]){ce=j[Re],be=X[Re];break}return ce<be?-1:be<ce?1:0},p.isEncoding=function(j){switch(String(j).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},p.concat=function(j,X){if(!Array.isArray(j))throw new TypeError('"list" argument must be an Array of Buffers');if(j.length===0)return p.alloc(0);let ce;if(X===void 0)for(X=0,ce=0;ce<j.length;++ce)X+=j[ce].length;const be=p.allocUnsafe(X);let Re=0;for(ce=0;ce<j.length;++ce){let Se=j[ce];if(De(Se,Uint8Array))Re+Se.length>be.length?(p.isBuffer(Se)||(Se=p.from(Se)),Se.copy(be,Re)):Uint8Array.prototype.set.call(be,Se,Re);else if(p.isBuffer(Se))Se.copy(be,Re);else throw new TypeError('"list" argument must be an Array of Buffers');Re+=Se.length}return be};function G(se,j){if(p.isBuffer(se))return se.length;if(ArrayBuffer.isView(se)||De(se,ArrayBuffer))return se.byteLength;if(typeof se!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof se);const X=se.length,ce=arguments.length>2&&arguments[2]===!0;if(!ce&&X===0)return 0;let be=!1;for(;;)switch(j){case"ascii":case"latin1":case"binary":return X;case"utf8":case"utf-8":return Ke(se).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return X*2;case"hex":return X>>>1;case"base64":return at(se).length;default:if(be)return ce?-1:Ke(se).length;j=(""+j).toLowerCase(),be=!0}}p.byteLength=G;function V(se,j,X){let ce=!1;if((j===void 0||j<0)&&(j=0),j>this.length||((X===void 0||X>this.length)&&(X=this.length),X<=0)||(X>>>=0,j>>>=0,X<=j))return"";for(se||(se="utf8");;)switch(se){case"hex":return T(this,j,X);case"utf8":case"utf-8":return _(this,j,X);case"ascii":return P(this,j,X);case"latin1":case"binary":return $(this,j,X);case"base64":return g(this,j,X);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m(this,j,X);default:if(ce)throw new TypeError("Unknown encoding: "+se);se=(se+"").toLowerCase(),ce=!0}}p.prototype._isBuffer=!0;function U(se,j,X){const ce=se[j];se[j]=se[X],se[X]=ce}p.prototype.swap16=function(){const j=this.length;if(j%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let X=0;X<j;X+=2)U(this,X,X+1);return this},p.prototype.swap32=function(){const j=this.length;if(j%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let X=0;X<j;X+=4)U(this,X,X+3),U(this,X+1,X+2);return this},p.prototype.swap64=function(){const j=this.length;if(j%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let X=0;X<j;X+=8)U(this,X,X+7),U(this,X+1,X+6),U(this,X+2,X+5),U(this,X+3,X+4);return this},p.prototype.toString=function(){const j=this.length;return j===0?"":arguments.length===0?_(this,0,j):V.apply(this,arguments)},p.prototype.toLocaleString=p.prototype.toString,p.prototype.equals=function(j){if(!p.isBuffer(j))throw new TypeError("Argument must be a Buffer");return this===j?!0:p.compare(this,j)===0},p.prototype.inspect=function(){let j="";const X=s.INSPECT_MAX_BYTES;return j=this.toString("hex",0,X).replace(/(.{2})/g,"$1 ").trim(),this.length>X&&(j+=" ... "),"<Buffer "+j+">"},l&&(p.prototype[l]=p.prototype.inspect),p.prototype.compare=function(j,X,ce,be,Re){if(De(j,Uint8Array)&&(j=p.from(j,j.offset,j.byteLength)),!p.isBuffer(j))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof j);if(X===void 0&&(X=0),ce===void 0&&(ce=j?j.length:0),be===void 0&&(be=0),Re===void 0&&(Re=this.length),X<0||ce>j.length||be<0||Re>this.length)throw new RangeError("out of range index");if(be>=Re&&X>=ce)return 0;if(be>=Re)return-1;if(X>=ce)return 1;if(X>>>=0,ce>>>=0,be>>>=0,Re>>>=0,this===j)return 0;let Se=Re-be,qe=ce-X;const bt=Math.min(Se,qe),je=this.slice(be,Re),We=j.slice(X,ce);for(let St=0;St<bt;++St)if(je[St]!==We[St]){Se=je[St],qe=We[St];break}return Se<qe?-1:qe<Se?1:0};function te(se,j,X,ce,be){if(se.length===0)return-1;if(typeof X=="string"?(ce=X,X=0):X>2147483647?X=2147483647:X<-2147483648&&(X=-2147483648),X=+X,yt(X)&&(X=be?0:se.length-1),X<0&&(X=se.length+X),X>=se.length){if(be)return-1;X=se.length-1}else if(X<0)if(be)X=0;else return-1;if(typeof j=="string"&&(j=p.from(j,ce)),p.isBuffer(j))return j.length===0?-1:Z(se,j,X,ce,be);if(typeof j=="number")return j=j&255,typeof Uint8Array.prototype.indexOf=="function"?be?Uint8Array.prototype.indexOf.call(se,j,X):Uint8Array.prototype.lastIndexOf.call(se,j,X):Z(se,[j],X,ce,be);throw new TypeError("val must be string, number or Buffer")}function Z(se,j,X,ce,be){let Re=1,Se=se.length,qe=j.length;if(ce!==void 0&&(ce=String(ce).toLowerCase(),ce==="ucs2"||ce==="ucs-2"||ce==="utf16le"||ce==="utf-16le")){if(se.length<2||j.length<2)return-1;Re=2,Se/=2,qe/=2,X/=2}function bt(We,St){return Re===1?We[St]:We.readUInt16BE(St*Re)}let je;if(be){let We=-1;for(je=X;je<Se;je++)if(bt(se,je)===bt(j,We===-1?0:je-We)){if(We===-1&&(We=je),je-We+1===qe)return We*Re}else We!==-1&&(je-=je-We),We=-1}else for(X+qe>Se&&(X=Se-qe),je=X;je>=0;je--){let We=!0;for(let St=0;St<qe;St++)if(bt(se,je+St)!==bt(j,St)){We=!1;break}if(We)return je}return-1}p.prototype.includes=function(j,X,ce){return this.indexOf(j,X,ce)!==-1},p.prototype.indexOf=function(j,X,ce){return te(this,j,X,ce,!0)},p.prototype.lastIndexOf=function(j,X,ce){return te(this,j,X,ce,!1)};function J(se,j,X,ce){X=Number(X)||0;const be=se.length-X;ce?(ce=Number(ce),ce>be&&(ce=be)):ce=be;const Re=j.length;ce>Re/2&&(ce=Re/2);let Se;for(Se=0;Se<ce;++Se){const qe=parseInt(j.substr(Se*2,2),16);if(yt(qe))return Se;se[X+Se]=qe}return Se}function Q(se,j,X,ce){return Oe(Ke(j,se.length-X),se,X,ce)}function ee(se,j,X,ce){return Oe(Le(j),se,X,ce)}function k(se,j,X,ce){return Oe(at(j),se,X,ce)}function d(se,j,X,ce){return Oe(Ce(j,se.length-X),se,X,ce)}p.prototype.write=function(j,X,ce,be){if(X===void 0)be="utf8",ce=this.length,X=0;else if(ce===void 0&&typeof X=="string")be=X,ce=this.length,X=0;else if(isFinite(X))X=X>>>0,isFinite(ce)?(ce=ce>>>0,be===void 0&&(be="utf8")):(be=ce,ce=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Re=this.length-X;if((ce===void 0||ce>Re)&&(ce=Re),j.length>0&&(ce<0||X<0)||X>this.length)throw new RangeError("Attempt to write outside buffer bounds");be||(be="utf8");let Se=!1;for(;;)switch(be){case"hex":return J(this,j,X,ce);case"utf8":case"utf-8":return Q(this,j,X,ce);case"ascii":case"latin1":case"binary":return ee(this,j,X,ce);case"base64":return k(this,j,X,ce);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return d(this,j,X,ce);default:if(Se)throw new TypeError("Unknown encoding: "+be);be=(""+be).toLowerCase(),Se=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function g(se,j,X){return j===0&&X===se.length?a.fromByteArray(se):a.fromByteArray(se.slice(j,X))}function _(se,j,X){X=Math.min(se.length,X);const ce=[];let be=j;for(;be<X;){const Re=se[be];let Se=null,qe=Re>239?4:Re>223?3:Re>191?2:1;if(be+qe<=X){let bt,je,We,St;switch(qe){case 1:Re<128&&(Se=Re);break;case 2:bt=se[be+1],(bt&192)===128&&(St=(Re&31)<<6|bt&63,St>127&&(Se=St));break;case 3:bt=se[be+1],je=se[be+2],(bt&192)===128&&(je&192)===128&&(St=(Re&15)<<12|(bt&63)<<6|je&63,St>2047&&(St<55296||St>57343)&&(Se=St));break;case 4:bt=se[be+1],je=se[be+2],We=se[be+3],(bt&192)===128&&(je&192)===128&&(We&192)===128&&(St=(Re&15)<<18|(bt&63)<<12|(je&63)<<6|We&63,St>65535&&St<1114112&&(Se=St))}}Se===null?(Se=65533,qe=1):Se>65535&&(Se-=65536,ce.push(Se>>>10&1023|55296),Se=56320|Se&1023),ce.push(Se),be+=qe}return x(ce)}const w=4096;function x(se){const j=se.length;if(j<=w)return String.fromCharCode.apply(String,se);let X="",ce=0;for(;ce<j;)X+=String.fromCharCode.apply(String,se.slice(ce,ce+=w));return X}function P(se,j,X){let ce="";X=Math.min(se.length,X);for(let be=j;be<X;++be)ce+=String.fromCharCode(se[be]&127);return ce}function $(se,j,X){let ce="";X=Math.min(se.length,X);for(let be=j;be<X;++be)ce+=String.fromCharCode(se[be]);return ce}function T(se,j,X){const ce=se.length;(!j||j<0)&&(j=0),(!X||X<0||X>ce)&&(X=ce);let be="";for(let Re=j;Re<X;++Re)be+=Ue[se[Re]];return be}function m(se,j,X){const ce=se.slice(j,X);let be="";for(let Re=0;Re<ce.length-1;Re+=2)be+=String.fromCharCode(ce[Re]+ce[Re+1]*256);return be}p.prototype.slice=function(j,X){const ce=this.length;j=~~j,X=X===void 0?ce:~~X,j<0?(j+=ce,j<0&&(j=0)):j>ce&&(j=ce),X<0?(X+=ce,X<0&&(X=0)):X>ce&&(X=ce),X<j&&(X=j);const be=this.subarray(j,X);return Object.setPrototypeOf(be,p.prototype),be};function M(se,j,X){if(se%1!==0||se<0)throw new RangeError("offset is not uint");if(se+j>X)throw new RangeError("Trying to access beyond buffer length")}p.prototype.readUintLE=p.prototype.readUIntLE=function(j,X,ce){j=j>>>0,X=X>>>0,ce||M(j,X,this.length);let be=this[j],Re=1,Se=0;for(;++Se<X&&(Re*=256);)be+=this[j+Se]*Re;return be},p.prototype.readUintBE=p.prototype.readUIntBE=function(j,X,ce){j=j>>>0,X=X>>>0,ce||M(j,X,this.length);let be=this[j+--X],Re=1;for(;X>0&&(Re*=256);)be+=this[j+--X]*Re;return be},p.prototype.readUint8=p.prototype.readUInt8=function(j,X){return j=j>>>0,X||M(j,1,this.length),this[j]},p.prototype.readUint16LE=p.prototype.readUInt16LE=function(j,X){return j=j>>>0,X||M(j,2,this.length),this[j]|this[j+1]<<8},p.prototype.readUint16BE=p.prototype.readUInt16BE=function(j,X){return j=j>>>0,X||M(j,2,this.length),this[j]<<8|this[j+1]},p.prototype.readUint32LE=p.prototype.readUInt32LE=function(j,X){return j=j>>>0,X||M(j,4,this.length),(this[j]|this[j+1]<<8|this[j+2]<<16)+this[j+3]*16777216},p.prototype.readUint32BE=p.prototype.readUInt32BE=function(j,X){return j=j>>>0,X||M(j,4,this.length),this[j]*16777216+(this[j+1]<<16|this[j+2]<<8|this[j+3])},p.prototype.readBigUInt64LE=ze(function(j){j=j>>>0,xe(j,"offset");const X=this[j],ce=this[j+7];(X===void 0||ce===void 0)&&Ne(j,this.length-8);const be=X+this[++j]*2**8+this[++j]*2**16+this[++j]*2**24,Re=this[++j]+this[++j]*2**8+this[++j]*2**16+ce*2**24;return BigInt(be)+(BigInt(Re)<<BigInt(32))}),p.prototype.readBigUInt64BE=ze(function(j){j=j>>>0,xe(j,"offset");const X=this[j],ce=this[j+7];(X===void 0||ce===void 0)&&Ne(j,this.length-8);const be=X*2**24+this[++j]*2**16+this[++j]*2**8+this[++j],Re=this[++j]*2**24+this[++j]*2**16+this[++j]*2**8+ce;return(BigInt(be)<<BigInt(32))+BigInt(Re)}),p.prototype.readIntLE=function(j,X,ce){j=j>>>0,X=X>>>0,ce||M(j,X,this.length);let be=this[j],Re=1,Se=0;for(;++Se<X&&(Re*=256);)be+=this[j+Se]*Re;return Re*=128,be>=Re&&(be-=Math.pow(2,8*X)),be},p.prototype.readIntBE=function(j,X,ce){j=j>>>0,X=X>>>0,ce||M(j,X,this.length);let be=X,Re=1,Se=this[j+--be];for(;be>0&&(Re*=256);)Se+=this[j+--be]*Re;return Re*=128,Se>=Re&&(Se-=Math.pow(2,8*X)),Se},p.prototype.readInt8=function(j,X){return j=j>>>0,X||M(j,1,this.length),this[j]&128?(255-this[j]+1)*-1:this[j]},p.prototype.readInt16LE=function(j,X){j=j>>>0,X||M(j,2,this.length);const ce=this[j]|this[j+1]<<8;return ce&32768?ce|4294901760:ce},p.prototype.readInt16BE=function(j,X){j=j>>>0,X||M(j,2,this.length);const ce=this[j+1]|this[j]<<8;return ce&32768?ce|4294901760:ce},p.prototype.readInt32LE=function(j,X){return j=j>>>0,X||M(j,4,this.length),this[j]|this[j+1]<<8|this[j+2]<<16|this[j+3]<<24},p.prototype.readInt32BE=function(j,X){return j=j>>>0,X||M(j,4,this.length),this[j]<<24|this[j+1]<<16|this[j+2]<<8|this[j+3]},p.prototype.readBigInt64LE=ze(function(j){j=j>>>0,xe(j,"offset");const X=this[j],ce=this[j+7];(X===void 0||ce===void 0)&&Ne(j,this.length-8);const be=this[j+4]+this[j+5]*2**8+this[j+6]*2**16+(ce<<24);return(BigInt(be)<<BigInt(32))+BigInt(X+this[++j]*2**8+this[++j]*2**16+this[++j]*2**24)}),p.prototype.readBigInt64BE=ze(function(j){j=j>>>0,xe(j,"offset");const X=this[j],ce=this[j+7];(X===void 0||ce===void 0)&&Ne(j,this.length-8);const be=(X<<24)+this[++j]*2**16+this[++j]*2**8+this[++j];return(BigInt(be)<<BigInt(32))+BigInt(this[++j]*2**24+this[++j]*2**16+this[++j]*2**8+ce)}),p.prototype.readFloatLE=function(j,X){return j=j>>>0,X||M(j,4,this.length),u.read(this,j,!0,23,4)},p.prototype.readFloatBE=function(j,X){return j=j>>>0,X||M(j,4,this.length),u.read(this,j,!1,23,4)},p.prototype.readDoubleLE=function(j,X){return j=j>>>0,X||M(j,8,this.length),u.read(this,j,!0,52,8)},p.prototype.readDoubleBE=function(j,X){return j=j>>>0,X||M(j,8,this.length),u.read(this,j,!1,52,8)};function W(se,j,X,ce,be,Re){if(!p.isBuffer(se))throw new TypeError('"buffer" argument must be a Buffer instance');if(j>be||j<Re)throw new RangeError('"value" argument is out of bounds');if(X+ce>se.length)throw new RangeError("Index out of range")}p.prototype.writeUintLE=p.prototype.writeUIntLE=function(j,X,ce,be){if(j=+j,X=X>>>0,ce=ce>>>0,!be){const qe=Math.pow(2,8*ce)-1;W(this,j,X,ce,qe,0)}let Re=1,Se=0;for(this[X]=j&255;++Se<ce&&(Re*=256);)this[X+Se]=j/Re&255;return X+ce},p.prototype.writeUintBE=p.prototype.writeUIntBE=function(j,X,ce,be){if(j=+j,X=X>>>0,ce=ce>>>0,!be){const qe=Math.pow(2,8*ce)-1;W(this,j,X,ce,qe,0)}let Re=ce-1,Se=1;for(this[X+Re]=j&255;--Re>=0&&(Se*=256);)this[X+Re]=j/Se&255;return X+ce},p.prototype.writeUint8=p.prototype.writeUInt8=function(j,X,ce){return j=+j,X=X>>>0,ce||W(this,j,X,1,255,0),this[X]=j&255,X+1},p.prototype.writeUint16LE=p.prototype.writeUInt16LE=function(j,X,ce){return j=+j,X=X>>>0,ce||W(this,j,X,2,65535,0),this[X]=j&255,this[X+1]=j>>>8,X+2},p.prototype.writeUint16BE=p.prototype.writeUInt16BE=function(j,X,ce){return j=+j,X=X>>>0,ce||W(this,j,X,2,65535,0),this[X]=j>>>8,this[X+1]=j&255,X+2},p.prototype.writeUint32LE=p.prototype.writeUInt32LE=function(j,X,ce){return j=+j,X=X>>>0,ce||W(this,j,X,4,4294967295,0),this[X+3]=j>>>24,this[X+2]=j>>>16,this[X+1]=j>>>8,this[X]=j&255,X+4},p.prototype.writeUint32BE=p.prototype.writeUInt32BE=function(j,X,ce){return j=+j,X=X>>>0,ce||W(this,j,X,4,4294967295,0),this[X]=j>>>24,this[X+1]=j>>>16,this[X+2]=j>>>8,this[X+3]=j&255,X+4};function Y(se,j,X,ce,be){me(j,ce,be,se,X,7);let Re=Number(j&BigInt(4294967295));se[X++]=Re,Re=Re>>8,se[X++]=Re,Re=Re>>8,se[X++]=Re,Re=Re>>8,se[X++]=Re;let Se=Number(j>>BigInt(32)&BigInt(4294967295));return se[X++]=Se,Se=Se>>8,se[X++]=Se,Se=Se>>8,se[X++]=Se,Se=Se>>8,se[X++]=Se,X}function ue(se,j,X,ce,be){me(j,ce,be,se,X,7);let Re=Number(j&BigInt(4294967295));se[X+7]=Re,Re=Re>>8,se[X+6]=Re,Re=Re>>8,se[X+5]=Re,Re=Re>>8,se[X+4]=Re;let Se=Number(j>>BigInt(32)&BigInt(4294967295));return se[X+3]=Se,Se=Se>>8,se[X+2]=Se,Se=Se>>8,se[X+1]=Se,Se=Se>>8,se[X]=Se,X+8}p.prototype.writeBigUInt64LE=ze(function(j,X=0){return Y(this,j,X,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeBigUInt64BE=ze(function(j,X=0){return ue(this,j,X,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeIntLE=function(j,X,ce,be){if(j=+j,X=X>>>0,!be){const bt=Math.pow(2,8*ce-1);W(this,j,X,ce,bt-1,-bt)}let Re=0,Se=1,qe=0;for(this[X]=j&255;++Re<ce&&(Se*=256);)j<0&&qe===0&&this[X+Re-1]!==0&&(qe=1),this[X+Re]=(j/Se>>0)-qe&255;return X+ce},p.prototype.writeIntBE=function(j,X,ce,be){if(j=+j,X=X>>>0,!be){const bt=Math.pow(2,8*ce-1);W(this,j,X,ce,bt-1,-bt)}let Re=ce-1,Se=1,qe=0;for(this[X+Re]=j&255;--Re>=0&&(Se*=256);)j<0&&qe===0&&this[X+Re+1]!==0&&(qe=1),this[X+Re]=(j/Se>>0)-qe&255;return X+ce},p.prototype.writeInt8=function(j,X,ce){return j=+j,X=X>>>0,ce||W(this,j,X,1,127,-128),j<0&&(j=255+j+1),this[X]=j&255,X+1},p.prototype.writeInt16LE=function(j,X,ce){return j=+j,X=X>>>0,ce||W(this,j,X,2,32767,-32768),this[X]=j&255,this[X+1]=j>>>8,X+2},p.prototype.writeInt16BE=function(j,X,ce){return j=+j,X=X>>>0,ce||W(this,j,X,2,32767,-32768),this[X]=j>>>8,this[X+1]=j&255,X+2},p.prototype.writeInt32LE=function(j,X,ce){return j=+j,X=X>>>0,ce||W(this,j,X,4,2147483647,-2147483648),this[X]=j&255,this[X+1]=j>>>8,this[X+2]=j>>>16,this[X+3]=j>>>24,X+4},p.prototype.writeInt32BE=function(j,X,ce){return j=+j,X=X>>>0,ce||W(this,j,X,4,2147483647,-2147483648),j<0&&(j=4294967295+j+1),this[X]=j>>>24,this[X+1]=j>>>16,this[X+2]=j>>>8,this[X+3]=j&255,X+4},p.prototype.writeBigInt64LE=ze(function(j,X=0){return Y(this,j,X,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),p.prototype.writeBigInt64BE=ze(function(j,X=0){return ue(this,j,X,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ge(se,j,X,ce,be,Re){if(X+ce>se.length)throw new RangeError("Index out of range");if(X<0)throw new RangeError("Index out of range")}function he(se,j,X,ce,be){return j=+j,X=X>>>0,be||ge(se,j,X,4),u.write(se,j,X,ce,23,4),X+4}p.prototype.writeFloatLE=function(j,X,ce){return he(this,j,X,!0,ce)},p.prototype.writeFloatBE=function(j,X,ce){return he(this,j,X,!1,ce)};function ae(se,j,X,ce,be){return j=+j,X=X>>>0,be||ge(se,j,X,8),u.write(se,j,X,ce,52,8),X+8}p.prototype.writeDoubleLE=function(j,X,ce){return ae(this,j,X,!0,ce)},p.prototype.writeDoubleBE=function(j,X,ce){return ae(this,j,X,!1,ce)},p.prototype.copy=function(j,X,ce,be){if(!p.isBuffer(j))throw new TypeError("argument should be a Buffer");if(ce||(ce=0),!be&&be!==0&&(be=this.length),X>=j.length&&(X=j.length),X||(X=0),be>0&&be<ce&&(be=ce),be===ce||j.length===0||this.length===0)return 0;if(X<0)throw new RangeError("targetStart out of bounds");if(ce<0||ce>=this.length)throw new RangeError("Index out of range");if(be<0)throw new RangeError("sourceEnd out of bounds");be>this.length&&(be=this.length),j.length-X<be-ce&&(be=j.length-X+ce);const Re=be-ce;return this===j&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(X,ce,be):Uint8Array.prototype.set.call(j,this.subarray(ce,be),X),Re},p.prototype.fill=function(j,X,ce,be){if(typeof j=="string"){if(typeof X=="string"?(be=X,X=0,ce=this.length):typeof ce=="string"&&(be=ce,ce=this.length),be!==void 0&&typeof be!="string")throw new TypeError("encoding must be a string");if(typeof be=="string"&&!p.isEncoding(be))throw new TypeError("Unknown encoding: "+be);if(j.length===1){const Se=j.charCodeAt(0);(be==="utf8"&&Se<128||be==="latin1")&&(j=Se)}}else typeof j=="number"?j=j&255:typeof j=="boolean"&&(j=Number(j));if(X<0||this.length<X||this.length<ce)throw new RangeError("Out of range index");if(ce<=X)return this;X=X>>>0,ce=ce===void 0?this.length:ce>>>0,j||(j=0);let Re;if(typeof j=="number")for(Re=X;Re<ce;++Re)this[Re]=j;else{const Se=p.isBuffer(j)?j:p.from(j,be),qe=Se.length;if(qe===0)throw new TypeError('The value "'+j+'" is invalid for argument "value"');for(Re=0;Re<ce-X;++Re)this[Re+X]=Se[Re%qe]}return this};const de={};function pe(se,j,X){de[se]=class extends X{constructor(){super(),Object.defineProperty(this,"message",{value:j.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${se}]`,this.stack,delete this.name}get code(){return se}set code(be){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:be,writable:!0})}toString(){return`${this.name} [${se}]: ${this.message}`}}}pe("ERR_BUFFER_OUT_OF_BOUNDS",function(se){return se?`${se} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),pe("ERR_INVALID_ARG_TYPE",function(se,j){return`The "${se}" argument must be of type number. Received type ${typeof j}`},TypeError),pe("ERR_OUT_OF_RANGE",function(se,j,X){let ce=`The value of "${se}" is out of range.`,be=X;return Number.isInteger(X)&&Math.abs(X)>2**32?be=oe(String(X)):typeof X=="bigint"&&(be=String(X),(X>BigInt(2)**BigInt(32)||X<-(BigInt(2)**BigInt(32)))&&(be=oe(be)),be+="n"),ce+=` It must be ${j}. Received ${be}`,ce},RangeError);function oe(se){let j="",X=se.length;const ce=se[0]==="-"?1:0;for(;X>=ce+4;X-=3)j=`_${se.slice(X-3,X)}${j}`;return`${se.slice(0,X)}${j}`}function le(se,j,X){xe(j,"offset"),(se[j]===void 0||se[j+X]===void 0)&&Ne(j,se.length-(X+1))}function me(se,j,X,ce,be,Re){if(se>X||se<j){const Se=typeof j=="bigint"?"n":"";let qe;throw j===0||j===BigInt(0)?qe=`>= 0${Se} and < 2${Se} ** ${(Re+1)*8}${Se}`:qe=`>= -(2${Se} ** ${(Re+1)*8-1}${Se}) and < 2 ** ${(Re+1)*8-1}${Se}`,new de.ERR_OUT_OF_RANGE("value",qe,se)}le(ce,be,Re)}function xe(se,j){if(typeof se!="number")throw new de.ERR_INVALID_ARG_TYPE(j,"number",se)}function Ne(se,j,X){throw Math.floor(se)!==se?(xe(se,X),new de.ERR_OUT_OF_RANGE("offset","an integer",se)):j<0?new de.ERR_BUFFER_OUT_OF_BOUNDS:new de.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${j}`,se)}const Pe=/[^+/0-9A-Za-z-_]/g;function Ie(se){if(se=se.split("=")[0],se=se.trim().replace(Pe,""),se.length<2)return"";for(;se.length%4!==0;)se=se+"=";return se}function Ke(se,j){j=j||1/0;let X;const ce=se.length;let be=null;const Re=[];for(let Se=0;Se<ce;++Se){if(X=se.charCodeAt(Se),X>55295&&X<57344){if(!be){if(X>56319){(j-=3)>-1&&Re.push(239,191,189);continue}else if(Se+1===ce){(j-=3)>-1&&Re.push(239,191,189);continue}be=X;continue}if(X<56320){(j-=3)>-1&&Re.push(239,191,189),be=X;continue}X=(be-55296<<10|X-56320)+65536}else be&&(j-=3)>-1&&Re.push(239,191,189);if(be=null,X<128){if((j-=1)<0)break;Re.push(X)}else if(X<2048){if((j-=2)<0)break;Re.push(X>>6|192,X&63|128)}else if(X<65536){if((j-=3)<0)break;Re.push(X>>12|224,X>>6&63|128,X&63|128)}else if(X<1114112){if((j-=4)<0)break;Re.push(X>>18|240,X>>12&63|128,X>>6&63|128,X&63|128)}else throw new Error("Invalid code point")}return Re}function Le(se){const j=[];for(let X=0;X<se.length;++X)j.push(se.charCodeAt(X)&255);return j}function Ce(se,j){let X,ce,be;const Re=[];for(let Se=0;Se<se.length&&!((j-=2)<0);++Se)X=se.charCodeAt(Se),ce=X>>8,be=X%256,Re.push(be),Re.push(ce);return Re}function at(se){return a.toByteArray(Ie(se))}function Oe(se,j,X,ce){let be;for(be=0;be<ce&&!(be+X>=j.length||be>=se.length);++be)j[be+X]=se[be];return be}function De(se,j){return se instanceof j||se!=null&&se.constructor!=null&&se.constructor.name!=null&&se.constructor.name===j.name}function yt(se){return se!==se}const Ue=function(){const se="0123456789abcdef",j=new Array(256);for(let X=0;X<16;++X){const ce=X*16;for(let be=0;be<16;++be)j[ce+be]=se[X]+se[be]}return j}();function ze(se){return typeof BigInt>"u"?Mt:se}function Mt(){throw new Error("BigInt not supported")}}(buffer$1)),buffer$1}/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var hasRequiredSafeBuffer$2;function requireSafeBuffer$2(){return hasRequiredSafeBuffer$2||(hasRequiredSafeBuffer$2=1,function(s,a){var u=requireBuffer$1(),l=u.Buffer;function f(h,p){for(var v in h)p[v]=h[v]}l.from&&l.alloc&&l.allocUnsafe&&l.allocUnsafeSlow?s.exports=u:(f(u,a),a.Buffer=c);function c(h,p,v){return l(h,p,v)}c.prototype=Object.create(l.prototype),f(l,c),c.from=function(h,p,v){if(typeof h=="number")throw new TypeError("Argument must not be a number");return l(h,p,v)},c.alloc=function(h,p,v){if(typeof h!="number")throw new TypeError("Argument must be a number");var y=l(h);return p!==void 0?typeof v=="string"?y.fill(p,v):y.fill(p):y.fill(0),y},c.allocUnsafe=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return l(h)},c.allocUnsafeSlow=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return u.SlowBuffer(h)}}(safeBuffer$2,safeBuffer$2.exports)),safeBuffer$2.exports}var hasRequiredBrowser$b;function requireBrowser$b(){if(hasRequiredBrowser$b)return browser$b.exports;hasRequiredBrowser$b=1;var s=65536,a=4294967295;function u(){throw new Error(`Secure random number generation is not supported by this browser.
Use Chrome, Firefox or Internet Explorer 11`)}var l=requireSafeBuffer$2().Buffer,f=commonjsGlobal.crypto||commonjsGlobal.msCrypto;f&&f.getRandomValues?browser$b.exports=c:browser$b.exports=u;function c(h,p){if(h>a)throw new RangeError("requested too many random bytes");var v=l.allocUnsafe(h);if(h>0)if(h>s)for(var y=0;y<h;y+=s)f.getRandomValues(v.slice(y,y+s));else f.getRandomValues(v);return typeof p=="function"?distExports.process.nextTick(function(){p(null,v)}):v}return browser$b.exports}var inherits_browser={exports:{}},hasRequiredInherits_browser;function requireInherits_browser(){return hasRequiredInherits_browser||(hasRequiredInherits_browser=1,typeof Object.create=="function"?inherits_browser.exports=function(a,u){u&&(a.super_=u,a.prototype=Object.create(u.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser.exports=function(a,u){if(u){a.super_=u;var l=function(){};l.prototype=u.prototype,a.prototype=new l,a.prototype.constructor=a}}),inherits_browser.exports}var readableBrowser$1={exports:{}},events={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events.exports;hasRequiredEvents=1;var s=typeof Reflect=="object"?Reflect:null,a=s&&typeof s.apply=="function"?s.apply:function(U,te,Z){return Function.prototype.apply.call(U,te,Z)},u;s&&typeof s.ownKeys=="function"?u=s.ownKeys:Object.getOwnPropertySymbols?u=function(U){return Object.getOwnPropertyNames(U).concat(Object.getOwnPropertySymbols(U))}:u=function(U){return Object.getOwnPropertyNames(U)};function l(V){console&&console.warn&&console.warn(V)}var f=Number.isNaN||function(U){return U!==U};function c(){c.init.call(this)}events.exports=c,events.exports.once=N,c.EventEmitter=c,c.prototype._events=void 0,c.prototype._eventsCount=0,c.prototype._maxListeners=void 0;var h=10;function p(V){if(typeof V!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof V)}Object.defineProperty(c,"defaultMaxListeners",{enumerable:!0,get:function(){return h},set:function(V){if(typeof V!="number"||V<0||f(V))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+V+".");h=V}}),c.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},c.prototype.setMaxListeners=function(U){if(typeof U!="number"||U<0||f(U))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+U+".");return this._maxListeners=U,this};function v(V){return V._maxListeners===void 0?c.defaultMaxListeners:V._maxListeners}c.prototype.getMaxListeners=function(){return v(this)},c.prototype.emit=function(U){for(var te=[],Z=1;Z<arguments.length;Z++)te.push(arguments[Z]);var J=U==="error",Q=this._events;if(Q!==void 0)J=J&&Q.error===void 0;else if(!J)return!1;if(J){var ee;if(te.length>0&&(ee=te[0]),ee instanceof Error)throw ee;var k=new Error("Unhandled error."+(ee?" ("+ee.message+")":""));throw k.context=ee,k}var d=Q[U];if(d===void 0)return!1;if(typeof d=="function")a(d,this,te);else for(var g=d.length,_=O(d,g),Z=0;Z<g;++Z)a(_[Z],this,te);return!0};function y(V,U,te,Z){var J,Q,ee;if(p(te),Q=V._events,Q===void 0?(Q=V._events=Object.create(null),V._eventsCount=0):(Q.newListener!==void 0&&(V.emit("newListener",U,te.listener?te.listener:te),Q=V._events),ee=Q[U]),ee===void 0)ee=Q[U]=te,++V._eventsCount;else if(typeof ee=="function"?ee=Q[U]=Z?[te,ee]:[ee,te]:Z?ee.unshift(te):ee.push(te),J=v(V),J>0&&ee.length>J&&!ee.warned){ee.warned=!0;var k=new Error("Possible EventEmitter memory leak detected. "+ee.length+" "+String(U)+" listeners added. Use emitter.setMaxListeners() to increase limit");k.name="MaxListenersExceededWarning",k.emitter=V,k.type=U,k.count=ee.length,l(k)}return V}c.prototype.addListener=function(U,te){return y(this,U,te,!1)},c.prototype.on=c.prototype.addListener,c.prototype.prependListener=function(U,te){return y(this,U,te,!0)};function b(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function S(V,U,te){var Z={fired:!1,wrapFn:void 0,target:V,type:U,listener:te},J=b.bind(Z);return J.listener=te,Z.wrapFn=J,J}c.prototype.once=function(U,te){return p(te),this.on(U,S(this,U,te)),this},c.prototype.prependOnceListener=function(U,te){return p(te),this.prependListener(U,S(this,U,te)),this},c.prototype.removeListener=function(U,te){var Z,J,Q,ee,k;if(p(te),J=this._events,J===void 0)return this;if(Z=J[U],Z===void 0)return this;if(Z===te||Z.listener===te)--this._eventsCount===0?this._events=Object.create(null):(delete J[U],J.removeListener&&this.emit("removeListener",U,Z.listener||te));else if(typeof Z!="function"){for(Q=-1,ee=Z.length-1;ee>=0;ee--)if(Z[ee]===te||Z[ee].listener===te){k=Z[ee].listener,Q=ee;break}if(Q<0)return this;Q===0?Z.shift():I(Z,Q),Z.length===1&&(J[U]=Z[0]),J.removeListener!==void 0&&this.emit("removeListener",U,k||te)}return this},c.prototype.off=c.prototype.removeListener,c.prototype.removeAllListeners=function(U){var te,Z,J;if(Z=this._events,Z===void 0)return this;if(Z.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):Z[U]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete Z[U]),this;if(arguments.length===0){var Q=Object.keys(Z),ee;for(J=0;J<Q.length;++J)ee=Q[J],ee!=="removeListener"&&this.removeAllListeners(ee);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(te=Z[U],typeof te=="function")this.removeListener(U,te);else if(te!==void 0)for(J=te.length-1;J>=0;J--)this.removeListener(U,te[J]);return this};function E(V,U,te){var Z=V._events;if(Z===void 0)return[];var J=Z[U];return J===void 0?[]:typeof J=="function"?te?[J.listener||J]:[J]:te?B(J):O(J,J.length)}c.prototype.listeners=function(U){return E(this,U,!0)},c.prototype.rawListeners=function(U){return E(this,U,!1)},c.listenerCount=function(V,U){return typeof V.listenerCount=="function"?V.listenerCount(U):R.call(V,U)},c.prototype.listenerCount=R;function R(V){var U=this._events;if(U!==void 0){var te=U[V];if(typeof te=="function")return 1;if(te!==void 0)return te.length}return 0}c.prototype.eventNames=function(){return this._eventsCount>0?u(this._events):[]};function O(V,U){for(var te=new Array(U),Z=0;Z<U;++Z)te[Z]=V[Z];return te}function I(V,U){for(;U+1<V.length;U++)V[U]=V[U+1];V.pop()}function B(V){for(var U=new Array(V.length),te=0;te<U.length;++te)U[te]=V[te].listener||V[te];return U}function N(V,U){return new Promise(function(te,Z){function J(ee){V.removeListener(U,Q),Z(ee)}function Q(){typeof V.removeListener=="function"&&V.removeListener("error",J),te([].slice.call(arguments))}G(V,U,Q,{once:!0}),U!=="error"&&D(V,J,{once:!0})})}function D(V,U,te){typeof V.on=="function"&&G(V,"error",U,te)}function G(V,U,te,Z){if(typeof V.on=="function")Z.once?V.once(U,te):V.on(U,te);else if(typeof V.addEventListener=="function")V.addEventListener(U,function J(Q){Z.once&&V.removeEventListener(U,J),te(Q)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof V)}return events.exports}var streamBrowser$1,hasRequiredStreamBrowser$1;function requireStreamBrowser$1(){return hasRequiredStreamBrowser$1||(hasRequiredStreamBrowser$1=1,streamBrowser$1=requireEvents().EventEmitter),streamBrowser$1}var util$3={},types={},shams$4,hasRequiredShams$4;function requireShams$4(){return hasRequiredShams$4||(hasRequiredShams$4=1,shams$4=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var a={},u=Symbol("test"),l=Object(u);if(typeof u=="string"||Object.prototype.toString.call(u)!=="[object Symbol]"||Object.prototype.toString.call(l)!=="[object Symbol]")return!1;var f=42;a[u]=f;for(u in a)return!1;if(typeof Object.keys=="function"&&Object.keys(a).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(a).length!==0)return!1;var c=Object.getOwnPropertySymbols(a);if(c.length!==1||c[0]!==u||!Object.prototype.propertyIsEnumerable.call(a,u))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var h=Object.getOwnPropertyDescriptor(a,u);if(h.value!==f||h.enumerable!==!0)return!1}return!0}),shams$4}var shams$3,hasRequiredShams$3;function requireShams$3(){if(hasRequiredShams$3)return shams$3;hasRequiredShams$3=1;var s=requireShams$4();return shams$3=function(){return s()&&!!Symbol.toStringTag},shams$3}var esErrors,hasRequiredEsErrors;function requireEsErrors(){return hasRequiredEsErrors||(hasRequiredEsErrors=1,esErrors=Error),esErrors}var _eval,hasRequired_eval;function require_eval(){return hasRequired_eval||(hasRequired_eval=1,_eval=EvalError),_eval}var range$2,hasRequiredRange$1;function requireRange$1(){return hasRequiredRange$1||(hasRequiredRange$1=1,range$2=RangeError),range$2}var ref,hasRequiredRef;function requireRef(){return hasRequiredRef||(hasRequiredRef=1,ref=ReferenceError),ref}var syntax,hasRequiredSyntax;function requireSyntax(){return hasRequiredSyntax||(hasRequiredSyntax=1,syntax=SyntaxError),syntax}var type$5,hasRequiredType;function requireType(){return hasRequiredType||(hasRequiredType=1,type$5=TypeError),type$5}var uri,hasRequiredUri;function requireUri(){return hasRequiredUri||(hasRequiredUri=1,uri=URIError),uri}var shams$2,hasRequiredShams$2;function requireShams$2(){return hasRequiredShams$2||(hasRequiredShams$2=1,shams$2=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var a={},u=Symbol("test"),l=Object(u);if(typeof u=="string"||Object.prototype.toString.call(u)!=="[object Symbol]"||Object.prototype.toString.call(l)!=="[object Symbol]")return!1;var f=42;a[u]=f;for(u in a)return!1;if(typeof Object.keys=="function"&&Object.keys(a).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(a).length!==0)return!1;var c=Object.getOwnPropertySymbols(a);if(c.length!==1||c[0]!==u||!Object.prototype.propertyIsEnumerable.call(a,u))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var h=Object.getOwnPropertyDescriptor(a,u);if(h.value!==f||h.enumerable!==!0)return!1}return!0}),shams$2}var hasSymbols$2,hasRequiredHasSymbols$2;function requireHasSymbols$2(){if(hasRequiredHasSymbols$2)return hasSymbols$2;hasRequiredHasSymbols$2=1;var s=typeof Symbol<"u"&&Symbol,a=requireShams$2();return hasSymbols$2=function(){return typeof s!="function"||typeof Symbol!="function"||typeof s("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:a()},hasSymbols$2}var hasProto$1,hasRequiredHasProto$1;function requireHasProto$1(){if(hasRequiredHasProto$1)return hasProto$1;hasRequiredHasProto$1=1;var s={__proto__:null,foo:{}},a=Object;return hasProto$1=function(){return{__proto__:s}.foo===s.foo&&!(s instanceof a)},hasProto$1}var implementation$1,hasRequiredImplementation$1;function requireImplementation$1(){if(hasRequiredImplementation$1)return implementation$1;hasRequiredImplementation$1=1;var s="Function.prototype.bind called on incompatible ",a=Object.prototype.toString,u=Math.max,l="[object Function]",f=function(v,y){for(var b=[],S=0;S<v.length;S+=1)b[S]=v[S];for(var E=0;E<y.length;E+=1)b[E+v.length]=y[E];return b},c=function(v,y){for(var b=[],S=y,E=0;S<v.length;S+=1,E+=1)b[E]=v[S];return b},h=function(p,v){for(var y="",b=0;b<p.length;b+=1)y+=p[b],b+1<p.length&&(y+=v);return y};return implementation$1=function(v){var y=this;if(typeof y!="function"||a.apply(y)!==l)throw new TypeError(s+y);for(var b=c(arguments,1),S,E=function(){if(this instanceof S){var N=y.apply(this,f(b,arguments));return Object(N)===N?N:this}return y.apply(v,f(b,arguments))},R=u(0,y.length-b.length),O=[],I=0;I<R;I++)O[I]="$"+I;if(S=Function("binder","return function ("+h(O,",")+"){ return binder.apply(this,arguments); }")(E),y.prototype){var B=function(){};B.prototype=y.prototype,S.prototype=new B,B.prototype=null}return S},implementation$1}var functionBind,hasRequiredFunctionBind;function requireFunctionBind(){if(hasRequiredFunctionBind)return functionBind;hasRequiredFunctionBind=1;var s=requireImplementation$1();return functionBind=Function.prototype.bind||s,functionBind}var hasown,hasRequiredHasown;function requireHasown(){if(hasRequiredHasown)return hasown;hasRequiredHasown=1;var s=Function.prototype.call,a=Object.prototype.hasOwnProperty,u=requireFunctionBind();return hasown=u.call(s,a),hasown}var getIntrinsic$3,hasRequiredGetIntrinsic$3;function requireGetIntrinsic$3(){if(hasRequiredGetIntrinsic$3)return getIntrinsic$3;hasRequiredGetIntrinsic$3=1;var s,a=requireEsErrors(),u=require_eval(),l=requireRange$1(),f=requireRef(),c=requireSyntax(),h=requireType(),p=requireUri(),v=Function,y=function(P){try{return v('"use strict"; return ('+P+").constructor;")()}catch{}},b=Object.getOwnPropertyDescriptor;if(b)try{b({},"")}catch{b=null}var S=function(){throw new h},E=b?function(){try{return arguments.callee,S}catch{try{return b(arguments,"callee").get}catch{return S}}}():S,R=requireHasSymbols$2()(),O=requireHasProto$1()(),I=Object.getPrototypeOf||(O?function(P){return P.__proto__}:null),B={},N=typeof Uint8Array>"u"||!I?s:I(Uint8Array),D={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?s:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?s:ArrayBuffer,"%ArrayIteratorPrototype%":R&&I?I([][Symbol.iterator]()):s,"%AsyncFromSyncIteratorPrototype%":s,"%AsyncFunction%":B,"%AsyncGenerator%":B,"%AsyncGeneratorFunction%":B,"%AsyncIteratorPrototype%":B,"%Atomics%":typeof Atomics>"u"?s:Atomics,"%BigInt%":typeof BigInt>"u"?s:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?s:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?s:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?s:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":a,"%eval%":eval,"%EvalError%":u,"%Float32Array%":typeof Float32Array>"u"?s:Float32Array,"%Float64Array%":typeof Float64Array>"u"?s:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?s:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":B,"%Int8Array%":typeof Int8Array>"u"?s:Int8Array,"%Int16Array%":typeof Int16Array>"u"?s:Int16Array,"%Int32Array%":typeof Int32Array>"u"?s:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":R&&I?I(I([][Symbol.iterator]())):s,"%JSON%":typeof JSON=="object"?JSON:s,"%Map%":typeof Map>"u"?s:Map,"%MapIteratorPrototype%":typeof Map>"u"||!R||!I?s:I(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?s:Promise,"%Proxy%":typeof Proxy>"u"?s:Proxy,"%RangeError%":l,"%ReferenceError%":f,"%Reflect%":typeof Reflect>"u"?s:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?s:Set,"%SetIteratorPrototype%":typeof Set>"u"||!R||!I?s:I(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?s:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":R&&I?I(""[Symbol.iterator]()):s,"%Symbol%":R?Symbol:s,"%SyntaxError%":c,"%ThrowTypeError%":E,"%TypedArray%":N,"%TypeError%":h,"%Uint8Array%":typeof Uint8Array>"u"?s:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?s:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?s:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?s:Uint32Array,"%URIError%":p,"%WeakMap%":typeof WeakMap>"u"?s:WeakMap,"%WeakRef%":typeof WeakRef>"u"?s:WeakRef,"%WeakSet%":typeof WeakSet>"u"?s:WeakSet};if(I)try{null.error}catch(P){var G=I(I(P));D["%Error.prototype%"]=G}var V=function P($){var T;if($==="%AsyncFunction%")T=y("async function () {}");else if($==="%GeneratorFunction%")T=y("function* () {}");else if($==="%AsyncGeneratorFunction%")T=y("async function* () {}");else if($==="%AsyncGenerator%"){var m=P("%AsyncGeneratorFunction%");m&&(T=m.prototype)}else if($==="%AsyncIteratorPrototype%"){var M=P("%AsyncGenerator%");M&&I&&(T=I(M.prototype))}return D[$]=T,T},U={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},te=requireFunctionBind(),Z=requireHasown(),J=te.call(Function.call,Array.prototype.concat),Q=te.call(Function.apply,Array.prototype.splice),ee=te.call(Function.call,String.prototype.replace),k=te.call(Function.call,String.prototype.slice),d=te.call(Function.call,RegExp.prototype.exec),g=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,_=/\\(\\)?/g,w=function($){var T=k($,0,1),m=k($,-1);if(T==="%"&&m!=="%")throw new c("invalid intrinsic syntax, expected closing `%`");if(m==="%"&&T!=="%")throw new c("invalid intrinsic syntax, expected opening `%`");var M=[];return ee($,g,function(W,Y,ue,ge){M[M.length]=ue?ee(ge,_,"$1"):Y||W}),M},x=function($,T){var m=$,M;if(Z(U,m)&&(M=U[m],m="%"+M[0]+"%"),Z(D,m)){var W=D[m];if(W===B&&(W=V(m)),typeof W>"u"&&!T)throw new h("intrinsic "+$+" exists, but is not available. Please file an issue!");return{alias:M,name:m,value:W}}throw new c("intrinsic "+$+" does not exist!")};return getIntrinsic$3=function($,T){if(typeof $!="string"||$.length===0)throw new h("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof T!="boolean")throw new h('"allowMissing" argument must be a boolean');if(d(/^%?[^%]*%?$/,$)===null)throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var m=w($),M=m.length>0?m[0]:"",W=x("%"+M+"%",T),Y=W.name,ue=W.value,ge=!1,he=W.alias;he&&(M=he[0],Q(m,J([0,1],he)));for(var ae=1,de=!0;ae<m.length;ae+=1){var pe=m[ae],oe=k(pe,0,1),le=k(pe,-1);if((oe==='"'||oe==="'"||oe==="`"||le==='"'||le==="'"||le==="`")&&oe!==le)throw new c("property names with quotes must have matching quotes");if((pe==="constructor"||!de)&&(ge=!0),M+="."+pe,Y="%"+M+"%",Z(D,Y))ue=D[Y];else if(ue!=null){if(!(pe in ue)){if(!T)throw new h("base intrinsic for "+$+" exists, but the property is not available.");return}if(b&&ae+1>=m.length){var me=b(ue,pe);de=!!me,de&&"get"in me&&!("originalValue"in me.get)?ue=me.get:ue=ue[pe]}else de=Z(ue,pe),ue=ue[pe];de&&!ge&&(D[Y]=ue)}}return ue},getIntrinsic$3}var callBind$2={exports:{}},esObjectAtoms,hasRequiredEsObjectAtoms;function requireEsObjectAtoms(){return hasRequiredEsObjectAtoms||(hasRequiredEsObjectAtoms=1,esObjectAtoms=Object),esObjectAtoms}var abs,hasRequiredAbs;function requireAbs(){return hasRequiredAbs||(hasRequiredAbs=1,abs=Math.abs),abs}var floor,hasRequiredFloor;function requireFloor(){return hasRequiredFloor||(hasRequiredFloor=1,floor=Math.floor),floor}var max,hasRequiredMax;function requireMax(){return hasRequiredMax||(hasRequiredMax=1,max=Math.max),max}var min,hasRequiredMin;function requireMin(){return hasRequiredMin||(hasRequiredMin=1,min=Math.min),min}var pow,hasRequiredPow;function requirePow(){return hasRequiredPow||(hasRequiredPow=1,pow=Math.pow),pow}var gOPD$1,hasRequiredGOPD$1;function requireGOPD$1(){return hasRequiredGOPD$1||(hasRequiredGOPD$1=1,gOPD$1=Object.getOwnPropertyDescriptor),gOPD$1}var gopd$2,hasRequiredGopd$2;function requireGopd$2(){if(hasRequiredGopd$2)return gopd$2;hasRequiredGopd$2=1;var s=requireGOPD$1();if(s)try{s([],"length")}catch{s=null}return gopd$2=s,gopd$2}var esDefineProperty$3,hasRequiredEsDefineProperty$3;function requireEsDefineProperty$3(){if(hasRequiredEsDefineProperty$3)return esDefineProperty$3;hasRequiredEsDefineProperty$3=1;var s=Object.defineProperty||!1;if(s)try{s({},"a",{value:1})}catch{s=!1}return esDefineProperty$3=s,esDefineProperty$3}var shams$1,hasRequiredShams$1;function requireShams$1(){return hasRequiredShams$1||(hasRequiredShams$1=1,shams$1=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var a={},u=Symbol("test"),l=Object(u);if(typeof u=="string"||Object.prototype.toString.call(u)!=="[object Symbol]"||Object.prototype.toString.call(l)!=="[object Symbol]")return!1;var f=42;a[u]=f;for(var c in a)return!1;if(typeof Object.keys=="function"&&Object.keys(a).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(a).length!==0)return!1;var h=Object.getOwnPropertySymbols(a);if(h.length!==1||h[0]!==u||!Object.prototype.propertyIsEnumerable.call(a,u))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var p=Object.getOwnPropertyDescriptor(a,u);if(p.value!==f||p.enumerable!==!0)return!1}return!0}),shams$1}var hasSymbols$1,hasRequiredHasSymbols$1;function requireHasSymbols$1(){if(hasRequiredHasSymbols$1)return hasSymbols$1;hasRequiredHasSymbols$1=1;var s=typeof Symbol<"u"&&Symbol,a=requireShams$1();return hasSymbols$1=function(){return typeof s!="function"||typeof Symbol!="function"||typeof s("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:a()},hasSymbols$1}var functionCall,hasRequiredFunctionCall;function requireFunctionCall(){return hasRequiredFunctionCall||(hasRequiredFunctionCall=1,functionCall=Function.prototype.call),functionCall}var functionApply,hasRequiredFunctionApply;function requireFunctionApply(){return hasRequiredFunctionApply||(hasRequiredFunctionApply=1,functionApply=Function.prototype.apply),functionApply}var reflectApply,hasRequiredReflectApply;function requireReflectApply(){return hasRequiredReflectApply||(hasRequiredReflectApply=1,reflectApply=typeof Reflect<"u"&&Reflect&&Reflect.apply),reflectApply}var actualApply,hasRequiredActualApply;function requireActualApply(){if(hasRequiredActualApply)return actualApply;hasRequiredActualApply=1;var s=requireFunctionBind(),a=requireFunctionApply(),u=requireFunctionCall(),l=requireReflectApply();return actualApply=l||s.call(u,a),actualApply}var callBindApplyHelpers,hasRequiredCallBindApplyHelpers;function requireCallBindApplyHelpers(){if(hasRequiredCallBindApplyHelpers)return callBindApplyHelpers;hasRequiredCallBindApplyHelpers=1;var s=requireFunctionBind(),a=requireType(),u=requireFunctionCall(),l=requireActualApply();return callBindApplyHelpers=function(c){if(c.length<1||typeof c[0]!="function")throw new a("a function is required");return l(s,u,c)},callBindApplyHelpers}var get$3,hasRequiredGet;function requireGet(){if(hasRequiredGet)return get$3;hasRequiredGet=1;var s=requireCallBindApplyHelpers(),a=requireGopd$2(),u;try{u=[].__proto__===Array.prototype}catch(h){if(!h||typeof h!="object"||!("code"in h)||h.code!=="ERR_PROTO_ACCESS")throw h}var l=!!u&&a&&a(Object.prototype,"__proto__"),f=Object,c=f.getPrototypeOf;return get$3=l&&typeof l.get=="function"?s([l.get]):typeof c=="function"?function(p){return c(p==null?p:f(p))}:!1,get$3}var getIntrinsic$2,hasRequiredGetIntrinsic$2;function requireGetIntrinsic$2(){if(hasRequiredGetIntrinsic$2)return getIntrinsic$2;hasRequiredGetIntrinsic$2=1;var s,a=requireEsObjectAtoms(),u=requireEsErrors(),l=require_eval(),f=requireRange$1(),c=requireRef(),h=requireSyntax(),p=requireType(),v=requireUri(),y=requireAbs(),b=requireFloor(),S=requireMax(),E=requireMin(),R=requirePow(),O=Function,I=function(he){try{return O('"use strict"; return ('+he+").constructor;")()}catch{}},B=requireGopd$2(),N=requireEsDefineProperty$3(),D=function(){throw new p},G=B?function(){try{return arguments.callee,D}catch{try{return B(arguments,"callee").get}catch{return D}}}():D,V=requireHasSymbols$1()(),U=requireGet(),te=typeof Reflect=="function"&&Reflect.getPrototypeOf||a.getPrototypeOf||U,Z=requireFunctionApply(),J=requireFunctionCall(),Q={},ee=typeof Uint8Array>"u"||!te?s:te(Uint8Array),k={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?s:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?s:ArrayBuffer,"%ArrayIteratorPrototype%":V&&te?te([][Symbol.iterator]()):s,"%AsyncFromSyncIteratorPrototype%":s,"%AsyncFunction%":Q,"%AsyncGenerator%":Q,"%AsyncGeneratorFunction%":Q,"%AsyncIteratorPrototype%":Q,"%Atomics%":typeof Atomics>"u"?s:Atomics,"%BigInt%":typeof BigInt>"u"?s:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?s:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?s:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?s:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":u,"%eval%":eval,"%EvalError%":l,"%Float32Array%":typeof Float32Array>"u"?s:Float32Array,"%Float64Array%":typeof Float64Array>"u"?s:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?s:FinalizationRegistry,"%Function%":O,"%GeneratorFunction%":Q,"%Int8Array%":typeof Int8Array>"u"?s:Int8Array,"%Int16Array%":typeof Int16Array>"u"?s:Int16Array,"%Int32Array%":typeof Int32Array>"u"?s:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":V&&te?te(te([][Symbol.iterator]())):s,"%JSON%":typeof JSON=="object"?JSON:s,"%Map%":typeof Map>"u"?s:Map,"%MapIteratorPrototype%":typeof Map>"u"||!V||!te?s:te(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":a,"%Object.getOwnPropertyDescriptor%":B,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?s:Promise,"%Proxy%":typeof Proxy>"u"?s:Proxy,"%RangeError%":f,"%ReferenceError%":c,"%Reflect%":typeof Reflect>"u"?s:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?s:Set,"%SetIteratorPrototype%":typeof Set>"u"||!V||!te?s:te(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?s:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":V&&te?te(""[Symbol.iterator]()):s,"%Symbol%":V?Symbol:s,"%SyntaxError%":h,"%ThrowTypeError%":G,"%TypedArray%":ee,"%TypeError%":p,"%Uint8Array%":typeof Uint8Array>"u"?s:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?s:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?s:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?s:Uint32Array,"%URIError%":v,"%WeakMap%":typeof WeakMap>"u"?s:WeakMap,"%WeakRef%":typeof WeakRef>"u"?s:WeakRef,"%WeakSet%":typeof WeakSet>"u"?s:WeakSet,"%Function.prototype.call%":J,"%Function.prototype.apply%":Z,"%Object.defineProperty%":N,"%Math.abs%":y,"%Math.floor%":b,"%Math.max%":S,"%Math.min%":E,"%Math.pow%":R};if(te)try{null.error}catch(he){var d=te(te(he));k["%Error.prototype%"]=d}var g=function he(ae){var de;if(ae==="%AsyncFunction%")de=I("async function () {}");else if(ae==="%GeneratorFunction%")de=I("function* () {}");else if(ae==="%AsyncGeneratorFunction%")de=I("async function* () {}");else if(ae==="%AsyncGenerator%"){var pe=he("%AsyncGeneratorFunction%");pe&&(de=pe.prototype)}else if(ae==="%AsyncIteratorPrototype%"){var oe=he("%AsyncGenerator%");oe&&te&&(de=te(oe.prototype))}return k[ae]=de,de},_={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},w=requireFunctionBind(),x=requireHasown(),P=w.call(J,Array.prototype.concat),$=w.call(Z,Array.prototype.splice),T=w.call(J,String.prototype.replace),m=w.call(J,String.prototype.slice),M=w.call(J,RegExp.prototype.exec),W=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Y=/\\(\\)?/g,ue=function(ae){var de=m(ae,0,1),pe=m(ae,-1);if(de==="%"&&pe!=="%")throw new h("invalid intrinsic syntax, expected closing `%`");if(pe==="%"&&de!=="%")throw new h("invalid intrinsic syntax, expected opening `%`");var oe=[];return T(ae,W,function(le,me,xe,Ne){oe[oe.length]=xe?T(Ne,Y,"$1"):me||le}),oe},ge=function(ae,de){var pe=ae,oe;if(x(_,pe)&&(oe=_[pe],pe="%"+oe[0]+"%"),x(k,pe)){var le=k[pe];if(le===Q&&(le=g(pe)),typeof le>"u"&&!de)throw new p("intrinsic "+ae+" exists, but is not available. Please file an issue!");return{alias:oe,name:pe,value:le}}throw new h("intrinsic "+ae+" does not exist!")};return getIntrinsic$2=function(ae,de){if(typeof ae!="string"||ae.length===0)throw new p("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof de!="boolean")throw new p('"allowMissing" argument must be a boolean');if(M(/^%?[^%]*%?$/,ae)===null)throw new h("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var pe=ue(ae),oe=pe.length>0?pe[0]:"",le=ge("%"+oe+"%",de),me=le.name,xe=le.value,Ne=!1,Pe=le.alias;Pe&&(oe=Pe[0],$(pe,P([0,1],Pe)));for(var Ie=1,Ke=!0;Ie<pe.length;Ie+=1){var Le=pe[Ie],Ce=m(Le,0,1),at=m(Le,-1);if((Ce==='"'||Ce==="'"||Ce==="`"||at==='"'||at==="'"||at==="`")&&Ce!==at)throw new h("property names with quotes must have matching quotes");if((Le==="constructor"||!Ke)&&(Ne=!0),oe+="."+Le,me="%"+oe+"%",x(k,me))xe=k[me];else if(xe!=null){if(!(Le in xe)){if(!de)throw new p("base intrinsic for "+ae+" exists, but the property is not available.");return}if(B&&Ie+1>=pe.length){var Oe=B(xe,Le);Ke=!!Oe,Ke&&"get"in Oe&&!("originalValue"in Oe.get)?xe=Oe.get:xe=xe[Le]}else Ke=x(xe,Le),xe=xe[Le];Ke&&!Ne&&(k[me]=xe)}}return xe},getIntrinsic$2}var defineDataProperty,hasRequiredDefineDataProperty;function requireDefineDataProperty(){if(hasRequiredDefineDataProperty)return defineDataProperty;hasRequiredDefineDataProperty=1;var s=requireEsDefineProperty$3(),a=requireSyntax(),u=requireType(),l=requireGopd$2();return defineDataProperty=function(c,h,p){if(!c||typeof c!="object"&&typeof c!="function")throw new u("`obj` must be an object or a function`");if(typeof h!="string"&&typeof h!="symbol")throw new u("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new u("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new u("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new u("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new u("`loose`, if provided, must be a boolean");var v=arguments.length>3?arguments[3]:null,y=arguments.length>4?arguments[4]:null,b=arguments.length>5?arguments[5]:null,S=arguments.length>6?arguments[6]:!1,E=!!l&&l(c,h);if(s)s(c,h,{configurable:b===null&&E?E.configurable:!b,enumerable:v===null&&E?E.enumerable:!v,value:p,writable:y===null&&E?E.writable:!y});else if(S||!v&&!y&&!b)c[h]=p;else throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},defineDataProperty}var hasPropertyDescriptors_1,hasRequiredHasPropertyDescriptors;function requireHasPropertyDescriptors(){if(hasRequiredHasPropertyDescriptors)return hasPropertyDescriptors_1;hasRequiredHasPropertyDescriptors=1;var s=requireEsDefineProperty$3(),a=function(){return!!s};return a.hasArrayLengthDefineBug=function(){if(!s)return null;try{return s([],"length",{value:1}).length!==1}catch{return!0}},hasPropertyDescriptors_1=a,hasPropertyDescriptors_1}var setFunctionLength,hasRequiredSetFunctionLength;function requireSetFunctionLength(){if(hasRequiredSetFunctionLength)return setFunctionLength;hasRequiredSetFunctionLength=1;var s=requireGetIntrinsic$2(),a=requireDefineDataProperty(),u=requireHasPropertyDescriptors()(),l=requireGopd$2(),f=requireType(),c=s("%Math.floor%");return setFunctionLength=function(p,v){if(typeof p!="function")throw new f("`fn` is not a function");if(typeof v!="number"||v<0||v>4294967295||c(v)!==v)throw new f("`length` must be a positive 32-bit integer");var y=arguments.length>2&&!!arguments[2],b=!0,S=!0;if("length"in p&&l){var E=l(p,"length");E&&!E.configurable&&(b=!1),E&&!E.writable&&(S=!1)}return(b||S||!y)&&(u?a(p,"length",v,!0,!0):a(p,"length",v)),p},setFunctionLength}var esDefineProperty$2,hasRequiredEsDefineProperty$2;function requireEsDefineProperty$2(){if(hasRequiredEsDefineProperty$2)return esDefineProperty$2;hasRequiredEsDefineProperty$2=1;var s=requireGetIntrinsic$2(),a=s("%Object.defineProperty%",!0)||!1;if(a)try{a({},"a",{value:1})}catch{a=!1}return esDefineProperty$2=a,esDefineProperty$2}var hasRequiredCallBind$2;function requireCallBind$2(){return hasRequiredCallBind$2||(hasRequiredCallBind$2=1,function(s){var a=requireFunctionBind(),u=requireGetIntrinsic$3(),l=requireSetFunctionLength(),f=requireType(),c=u("%Function.prototype.apply%"),h=u("%Function.prototype.call%"),p=u("%Reflect.apply%",!0)||a.call(h,c),v=requireEsDefineProperty$2(),y=u("%Math.max%");s.exports=function(E){if(typeof E!="function")throw new f("a function is required");var R=p(a,h,arguments);return l(R,1+y(0,E.length-(arguments.length-1)),!0)};var b=function(){return p(a,c,arguments)};v?v(s.exports,"apply",{value:b}):s.exports.apply=b}(callBind$2)),callBind$2.exports}var callBound$2,hasRequiredCallBound$2;function requireCallBound$2(){if(hasRequiredCallBound$2)return callBound$2;hasRequiredCallBound$2=1;var s=requireGetIntrinsic$3(),a=requireCallBind$2(),u=a(s("String.prototype.indexOf"));return callBound$2=function(f,c){var h=s(f,!!c);return typeof h=="function"&&u(f,".prototype.")>-1?a(h):h},callBound$2}var isArguments$1,hasRequiredIsArguments$1;function requireIsArguments$1(){if(hasRequiredIsArguments$1)return isArguments$1;hasRequiredIsArguments$1=1;var s=requireShams$3()(),a=requireCallBound$2(),u=a("Object.prototype.toString"),l=function(p){return s&&p&&typeof p=="object"&&Symbol.toStringTag in p?!1:u(p)==="[object Arguments]"},f=function(p){return l(p)?!0:p!==null&&typeof p=="object"&&typeof p.length=="number"&&p.length>=0&&u(p)!=="[object Array]"&&u(p.callee)==="[object Function]"},c=function(){return l(arguments)}();return l.isLegacyArguments=f,isArguments$1=c?l:f,isArguments$1}var isGeneratorFunction,hasRequiredIsGeneratorFunction;function requireIsGeneratorFunction(){if(hasRequiredIsGeneratorFunction)return isGeneratorFunction;hasRequiredIsGeneratorFunction=1;var s=Object.prototype.toString,a=Function.prototype.toString,u=/^\s*(?:function)?\*/,l=requireShams$3()(),f=Object.getPrototypeOf,c=function(){if(!l)return!1;try{return Function("return function*() {}")()}catch{}},h;return isGeneratorFunction=function(v){if(typeof v!="function")return!1;if(u.test(a.call(v)))return!0;if(!l){var y=s.call(v);return y==="[object GeneratorFunction]"}if(!f)return!1;if(typeof h>"u"){var b=c();h=b?f(b):!1}return f(v)===h},isGeneratorFunction}var isCallable,hasRequiredIsCallable;function requireIsCallable(){if(hasRequiredIsCallable)return isCallable;hasRequiredIsCallable=1;var s=Function.prototype.toString,a=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,u,l;if(typeof a=="function"&&typeof Object.defineProperty=="function")try{u=Object.defineProperty({},"length",{get:function(){throw l}}),l={},a(function(){throw 42},null,u)}catch(D){D!==l&&(a=null)}else a=null;var f=/^\s*class\b/,c=function(G){try{var V=s.call(G);return f.test(V)}catch{return!1}},h=function(G){try{return c(G)?!1:(s.call(G),!0)}catch{return!1}},p=Object.prototype.toString,v="[object Object]",y="[object Function]",b="[object GeneratorFunction]",S="[object HTMLAllCollection]",E="[object HTML document.all class]",R="[object HTMLCollection]",O=typeof Symbol=="function"&&!!Symbol.toStringTag,I=!(0 in[,]),B=function(){return!1};if(typeof document=="object"){var N=document.all;p.call(N)===p.call(document.all)&&(B=function(G){if((I||!G)&&(typeof G>"u"||typeof G=="object"))try{var V=p.call(G);return(V===S||V===E||V===R||V===v)&&G("")==null}catch{}return!1})}return isCallable=a?function(G){if(B(G))return!0;if(!G||typeof G!="function"&&typeof G!="object")return!1;try{a(G,null,u)}catch(V){if(V!==l)return!1}return!c(G)&&h(G)}:function(G){if(B(G))return!0;if(!G||typeof G!="function"&&typeof G!="object")return!1;if(O)return h(G);if(c(G))return!1;var V=p.call(G);return V!==y&&V!==b&&!/^\[object HTML/.test(V)?!1:h(G)},isCallable}var forEach_1,hasRequiredForEach;function requireForEach(){if(hasRequiredForEach)return forEach_1;hasRequiredForEach=1;var s=requireIsCallable(),a=Object.prototype.toString,u=Object.prototype.hasOwnProperty,l=function(v,y,b){for(var S=0,E=v.length;S<E;S++)u.call(v,S)&&(b==null?y(v[S],S,v):y.call(b,v[S],S,v))},f=function(v,y,b){for(var S=0,E=v.length;S<E;S++)b==null?y(v.charAt(S),S,v):y.call(b,v.charAt(S),S,v)},c=function(v,y,b){for(var S in v)u.call(v,S)&&(b==null?y(v[S],S,v):y.call(b,v[S],S,v))},h=function(v,y,b){if(!s(y))throw new TypeError("iterator must be a function");var S;arguments.length>=3&&(S=b),a.call(v)==="[object Array]"?l(v,y,S):typeof v=="string"?f(v,y,S):c(v,y,S)};return forEach_1=h,forEach_1}var possibleTypedArrayNames,hasRequiredPossibleTypedArrayNames;function requirePossibleTypedArrayNames(){return hasRequiredPossibleTypedArrayNames||(hasRequiredPossibleTypedArrayNames=1,possibleTypedArrayNames=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),possibleTypedArrayNames}var availableTypedArrays,hasRequiredAvailableTypedArrays;function requireAvailableTypedArrays(){if(hasRequiredAvailableTypedArrays)return availableTypedArrays;hasRequiredAvailableTypedArrays=1;var s=requirePossibleTypedArrayNames(),a=typeof globalThis>"u"?commonjsGlobal:globalThis;return availableTypedArrays=function(){for(var l=[],f=0;f<s.length;f++)typeof a[s[f]]=="function"&&(l[l.length]=s[f]);return l},availableTypedArrays}var callBind$1={exports:{}},shams,hasRequiredShams;function requireShams(){return hasRequiredShams||(hasRequiredShams=1,shams=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var a={},u=Symbol("test"),l=Object(u);if(typeof u=="string"||Object.prototype.toString.call(u)!=="[object Symbol]"||Object.prototype.toString.call(l)!=="[object Symbol]")return!1;var f=42;a[u]=f;for(u in a)return!1;if(typeof Object.keys=="function"&&Object.keys(a).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(a).length!==0)return!1;var c=Object.getOwnPropertySymbols(a);if(c.length!==1||c[0]!==u||!Object.prototype.propertyIsEnumerable.call(a,u))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var h=Object.getOwnPropertyDescriptor(a,u);if(h.value!==f||h.enumerable!==!0)return!1}return!0}),shams}var hasSymbols,hasRequiredHasSymbols;function requireHasSymbols(){if(hasRequiredHasSymbols)return hasSymbols;hasRequiredHasSymbols=1;var s=typeof Symbol<"u"&&Symbol,a=requireShams();return hasSymbols=function(){return typeof s!="function"||typeof Symbol!="function"||typeof s("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:a()},hasSymbols}var hasProto,hasRequiredHasProto;function requireHasProto(){if(hasRequiredHasProto)return hasProto;hasRequiredHasProto=1;var s={__proto__:null,foo:{}},a=Object;return hasProto=function(){return{__proto__:s}.foo===s.foo&&!(s instanceof a)},hasProto}var getIntrinsic$1,hasRequiredGetIntrinsic$1;function requireGetIntrinsic$1(){if(hasRequiredGetIntrinsic$1)return getIntrinsic$1;hasRequiredGetIntrinsic$1=1;var s,a=requireEsErrors(),u=require_eval(),l=requireRange$1(),f=requireRef(),c=requireSyntax(),h=requireType(),p=requireUri(),v=Function,y=function(P){try{return v('"use strict"; return ('+P+").constructor;")()}catch{}},b=Object.getOwnPropertyDescriptor;if(b)try{b({},"")}catch{b=null}var S=function(){throw new h},E=b?function(){try{return arguments.callee,S}catch{try{return b(arguments,"callee").get}catch{return S}}}():S,R=requireHasSymbols()(),O=requireHasProto()(),I=Object.getPrototypeOf||(O?function(P){return P.__proto__}:null),B={},N=typeof Uint8Array>"u"||!I?s:I(Uint8Array),D={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?s:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?s:ArrayBuffer,"%ArrayIteratorPrototype%":R&&I?I([][Symbol.iterator]()):s,"%AsyncFromSyncIteratorPrototype%":s,"%AsyncFunction%":B,"%AsyncGenerator%":B,"%AsyncGeneratorFunction%":B,"%AsyncIteratorPrototype%":B,"%Atomics%":typeof Atomics>"u"?s:Atomics,"%BigInt%":typeof BigInt>"u"?s:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?s:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?s:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?s:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":a,"%eval%":eval,"%EvalError%":u,"%Float32Array%":typeof Float32Array>"u"?s:Float32Array,"%Float64Array%":typeof Float64Array>"u"?s:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?s:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":B,"%Int8Array%":typeof Int8Array>"u"?s:Int8Array,"%Int16Array%":typeof Int16Array>"u"?s:Int16Array,"%Int32Array%":typeof Int32Array>"u"?s:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":R&&I?I(I([][Symbol.iterator]())):s,"%JSON%":typeof JSON=="object"?JSON:s,"%Map%":typeof Map>"u"?s:Map,"%MapIteratorPrototype%":typeof Map>"u"||!R||!I?s:I(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?s:Promise,"%Proxy%":typeof Proxy>"u"?s:Proxy,"%RangeError%":l,"%ReferenceError%":f,"%Reflect%":typeof Reflect>"u"?s:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?s:Set,"%SetIteratorPrototype%":typeof Set>"u"||!R||!I?s:I(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?s:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":R&&I?I(""[Symbol.iterator]()):s,"%Symbol%":R?Symbol:s,"%SyntaxError%":c,"%ThrowTypeError%":E,"%TypedArray%":N,"%TypeError%":h,"%Uint8Array%":typeof Uint8Array>"u"?s:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?s:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?s:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?s:Uint32Array,"%URIError%":p,"%WeakMap%":typeof WeakMap>"u"?s:WeakMap,"%WeakRef%":typeof WeakRef>"u"?s:WeakRef,"%WeakSet%":typeof WeakSet>"u"?s:WeakSet};if(I)try{null.error}catch(P){var G=I(I(P));D["%Error.prototype%"]=G}var V=function P($){var T;if($==="%AsyncFunction%")T=y("async function () {}");else if($==="%GeneratorFunction%")T=y("function* () {}");else if($==="%AsyncGeneratorFunction%")T=y("async function* () {}");else if($==="%AsyncGenerator%"){var m=P("%AsyncGeneratorFunction%");m&&(T=m.prototype)}else if($==="%AsyncIteratorPrototype%"){var M=P("%AsyncGenerator%");M&&I&&(T=I(M.prototype))}return D[$]=T,T},U={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},te=requireFunctionBind(),Z=requireHasown(),J=te.call(Function.call,Array.prototype.concat),Q=te.call(Function.apply,Array.prototype.splice),ee=te.call(Function.call,String.prototype.replace),k=te.call(Function.call,String.prototype.slice),d=te.call(Function.call,RegExp.prototype.exec),g=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,_=/\\(\\)?/g,w=function($){var T=k($,0,1),m=k($,-1);if(T==="%"&&m!=="%")throw new c("invalid intrinsic syntax, expected closing `%`");if(m==="%"&&T!=="%")throw new c("invalid intrinsic syntax, expected opening `%`");var M=[];return ee($,g,function(W,Y,ue,ge){M[M.length]=ue?ee(ge,_,"$1"):Y||W}),M},x=function($,T){var m=$,M;if(Z(U,m)&&(M=U[m],m="%"+M[0]+"%"),Z(D,m)){var W=D[m];if(W===B&&(W=V(m)),typeof W>"u"&&!T)throw new h("intrinsic "+$+" exists, but is not available. Please file an issue!");return{alias:M,name:m,value:W}}throw new c("intrinsic "+$+" does not exist!")};return getIntrinsic$1=function($,T){if(typeof $!="string"||$.length===0)throw new h("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof T!="boolean")throw new h('"allowMissing" argument must be a boolean');if(d(/^%?[^%]*%?$/,$)===null)throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var m=w($),M=m.length>0?m[0]:"",W=x("%"+M+"%",T),Y=W.name,ue=W.value,ge=!1,he=W.alias;he&&(M=he[0],Q(m,J([0,1],he)));for(var ae=1,de=!0;ae<m.length;ae+=1){var pe=m[ae],oe=k(pe,0,1),le=k(pe,-1);if((oe==='"'||oe==="'"||oe==="`"||le==='"'||le==="'"||le==="`")&&oe!==le)throw new c("property names with quotes must have matching quotes");if((pe==="constructor"||!de)&&(ge=!0),M+="."+pe,Y="%"+M+"%",Z(D,Y))ue=D[Y];else if(ue!=null){if(!(pe in ue)){if(!T)throw new h("base intrinsic for "+$+" exists, but the property is not available.");return}if(b&&ae+1>=m.length){var me=b(ue,pe);de=!!me,de&&"get"in me&&!("originalValue"in me.get)?ue=me.get:ue=ue[pe]}else de=Z(ue,pe),ue=ue[pe];de&&!ge&&(D[Y]=ue)}}return ue},getIntrinsic$1}var gOPD,hasRequiredGOPD;function requireGOPD(){return hasRequiredGOPD||(hasRequiredGOPD=1,gOPD=Object.getOwnPropertyDescriptor),gOPD}var gopd$1,hasRequiredGopd$1;function requireGopd$1(){if(hasRequiredGopd$1)return gopd$1;hasRequiredGopd$1=1;var s=requireGOPD();if(s)try{s([],"length")}catch{s=null}return gopd$1=s,gopd$1}var esDefineProperty$1,hasRequiredEsDefineProperty$1;function requireEsDefineProperty$1(){if(hasRequiredEsDefineProperty$1)return esDefineProperty$1;hasRequiredEsDefineProperty$1=1;var s=Object.defineProperty||!1;if(s)try{s({},"a",{value:1})}catch{s=!1}return esDefineProperty$1=s,esDefineProperty$1}var getIntrinsic,hasRequiredGetIntrinsic;function requireGetIntrinsic(){if(hasRequiredGetIntrinsic)return getIntrinsic;hasRequiredGetIntrinsic=1;var s,a=requireEsObjectAtoms(),u=requireEsErrors(),l=require_eval(),f=requireRange$1(),c=requireRef(),h=requireSyntax(),p=requireType(),v=requireUri(),y=requireAbs(),b=requireFloor(),S=requireMax(),E=requireMin(),R=requirePow(),O=Function,I=function(he){try{return O('"use strict"; return ('+he+").constructor;")()}catch{}},B=requireGopd$1(),N=requireEsDefineProperty$1(),D=function(){throw new p},G=B?function(){try{return arguments.callee,D}catch{try{return B(arguments,"callee").get}catch{return D}}}():D,V=requireHasSymbols$1()(),U=requireGet(),te=typeof Reflect=="function"&&Reflect.getPrototypeOf||a.getPrototypeOf||U,Z=requireFunctionApply(),J=requireFunctionCall(),Q={},ee=typeof Uint8Array>"u"||!te?s:te(Uint8Array),k={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?s:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?s:ArrayBuffer,"%ArrayIteratorPrototype%":V&&te?te([][Symbol.iterator]()):s,"%AsyncFromSyncIteratorPrototype%":s,"%AsyncFunction%":Q,"%AsyncGenerator%":Q,"%AsyncGeneratorFunction%":Q,"%AsyncIteratorPrototype%":Q,"%Atomics%":typeof Atomics>"u"?s:Atomics,"%BigInt%":typeof BigInt>"u"?s:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?s:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?s:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?s:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":u,"%eval%":eval,"%EvalError%":l,"%Float32Array%":typeof Float32Array>"u"?s:Float32Array,"%Float64Array%":typeof Float64Array>"u"?s:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?s:FinalizationRegistry,"%Function%":O,"%GeneratorFunction%":Q,"%Int8Array%":typeof Int8Array>"u"?s:Int8Array,"%Int16Array%":typeof Int16Array>"u"?s:Int16Array,"%Int32Array%":typeof Int32Array>"u"?s:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":V&&te?te(te([][Symbol.iterator]())):s,"%JSON%":typeof JSON=="object"?JSON:s,"%Map%":typeof Map>"u"?s:Map,"%MapIteratorPrototype%":typeof Map>"u"||!V||!te?s:te(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":a,"%Object.getOwnPropertyDescriptor%":B,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?s:Promise,"%Proxy%":typeof Proxy>"u"?s:Proxy,"%RangeError%":f,"%ReferenceError%":c,"%Reflect%":typeof Reflect>"u"?s:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?s:Set,"%SetIteratorPrototype%":typeof Set>"u"||!V||!te?s:te(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?s:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":V&&te?te(""[Symbol.iterator]()):s,"%Symbol%":V?Symbol:s,"%SyntaxError%":h,"%ThrowTypeError%":G,"%TypedArray%":ee,"%TypeError%":p,"%Uint8Array%":typeof Uint8Array>"u"?s:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?s:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?s:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?s:Uint32Array,"%URIError%":v,"%WeakMap%":typeof WeakMap>"u"?s:WeakMap,"%WeakRef%":typeof WeakRef>"u"?s:WeakRef,"%WeakSet%":typeof WeakSet>"u"?s:WeakSet,"%Function.prototype.call%":J,"%Function.prototype.apply%":Z,"%Object.defineProperty%":N,"%Math.abs%":y,"%Math.floor%":b,"%Math.max%":S,"%Math.min%":E,"%Math.pow%":R};if(te)try{null.error}catch(he){var d=te(te(he));k["%Error.prototype%"]=d}var g=function he(ae){var de;if(ae==="%AsyncFunction%")de=I("async function () {}");else if(ae==="%GeneratorFunction%")de=I("function* () {}");else if(ae==="%AsyncGeneratorFunction%")de=I("async function* () {}");else if(ae==="%AsyncGenerator%"){var pe=he("%AsyncGeneratorFunction%");pe&&(de=pe.prototype)}else if(ae==="%AsyncIteratorPrototype%"){var oe=he("%AsyncGenerator%");oe&&te&&(de=te(oe.prototype))}return k[ae]=de,de},_={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},w=requireFunctionBind(),x=requireHasown(),P=w.call(J,Array.prototype.concat),$=w.call(Z,Array.prototype.splice),T=w.call(J,String.prototype.replace),m=w.call(J,String.prototype.slice),M=w.call(J,RegExp.prototype.exec),W=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Y=/\\(\\)?/g,ue=function(ae){var de=m(ae,0,1),pe=m(ae,-1);if(de==="%"&&pe!=="%")throw new h("invalid intrinsic syntax, expected closing `%`");if(pe==="%"&&de!=="%")throw new h("invalid intrinsic syntax, expected opening `%`");var oe=[];return T(ae,W,function(le,me,xe,Ne){oe[oe.length]=xe?T(Ne,Y,"$1"):me||le}),oe},ge=function(ae,de){var pe=ae,oe;if(x(_,pe)&&(oe=_[pe],pe="%"+oe[0]+"%"),x(k,pe)){var le=k[pe];if(le===Q&&(le=g(pe)),typeof le>"u"&&!de)throw new p("intrinsic "+ae+" exists, but is not available. Please file an issue!");return{alias:oe,name:pe,value:le}}throw new h("intrinsic "+ae+" does not exist!")};return getIntrinsic=function(ae,de){if(typeof ae!="string"||ae.length===0)throw new p("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof de!="boolean")throw new p('"allowMissing" argument must be a boolean');if(M(/^%?[^%]*%?$/,ae)===null)throw new h("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var pe=ue(ae),oe=pe.length>0?pe[0]:"",le=ge("%"+oe+"%",de),me=le.name,xe=le.value,Ne=!1,Pe=le.alias;Pe&&(oe=Pe[0],$(pe,P([0,1],Pe)));for(var Ie=1,Ke=!0;Ie<pe.length;Ie+=1){var Le=pe[Ie],Ce=m(Le,0,1),at=m(Le,-1);if((Ce==='"'||Ce==="'"||Ce==="`"||at==='"'||at==="'"||at==="`")&&Ce!==at)throw new h("property names with quotes must have matching quotes");if((Le==="constructor"||!Ke)&&(Ne=!0),oe+="."+Le,me="%"+oe+"%",x(k,me))xe=k[me];else if(xe!=null){if(!(Le in xe)){if(!de)throw new p("base intrinsic for "+ae+" exists, but the property is not available.");return}if(B&&Ie+1>=pe.length){var Oe=B(xe,Le);Ke=!!Oe,Ke&&"get"in Oe&&!("originalValue"in Oe.get)?xe=Oe.get:xe=xe[Le]}else Ke=x(xe,Le),xe=xe[Le];Ke&&!Ne&&(k[me]=xe)}}return xe},getIntrinsic}var esDefineProperty,hasRequiredEsDefineProperty;function requireEsDefineProperty(){if(hasRequiredEsDefineProperty)return esDefineProperty;hasRequiredEsDefineProperty=1;var s=requireGetIntrinsic(),a=s("%Object.defineProperty%",!0)||!1;if(a)try{a({},"a",{value:1})}catch{a=!1}return esDefineProperty=a,esDefineProperty}var hasRequiredCallBind$1;function requireCallBind$1(){return hasRequiredCallBind$1||(hasRequiredCallBind$1=1,function(s){var a=requireFunctionBind(),u=requireGetIntrinsic$1(),l=requireSetFunctionLength(),f=requireType(),c=u("%Function.prototype.apply%"),h=u("%Function.prototype.call%"),p=u("%Reflect.apply%",!0)||a.call(h,c),v=requireEsDefineProperty(),y=u("%Math.max%");s.exports=function(E){if(typeof E!="function")throw new f("a function is required");var R=p(a,h,arguments);return l(R,1+y(0,E.length-(arguments.length-1)),!0)};var b=function(){return p(a,c,arguments)};v?v(s.exports,"apply",{value:b}):s.exports.apply=b}(callBind$1)),callBind$1.exports}var callBound$1,hasRequiredCallBound$1;function requireCallBound$1(){if(hasRequiredCallBound$1)return callBound$1;hasRequiredCallBound$1=1;var s=requireGetIntrinsic$1(),a=requireCallBind$1(),u=a(s("String.prototype.indexOf"));return callBound$1=function(f,c){var h=s(f,!!c);return typeof h=="function"&&u(f,".prototype.")>-1?a(h):h},callBound$1}var gopd,hasRequiredGopd;function requireGopd(){if(hasRequiredGopd)return gopd;hasRequiredGopd=1;var s=requireGetIntrinsic$1(),a=s("%Object.getOwnPropertyDescriptor%",!0);if(a)try{a([],"length")}catch{a=null}return gopd=a,gopd}var whichTypedArray,hasRequiredWhichTypedArray;function requireWhichTypedArray(){if(hasRequiredWhichTypedArray)return whichTypedArray;hasRequiredWhichTypedArray=1;var s=requireForEach(),a=requireAvailableTypedArrays(),u=requireCallBind$1(),l=requireCallBound$1(),f=requireGopd(),c=l("Object.prototype.toString"),h=requireShams$3()(),p=typeof globalThis>"u"?commonjsGlobal:globalThis,v=a(),y=l("String.prototype.slice"),b=Object.getPrototypeOf,S=l("Array.prototype.indexOf",!0)||function(B,N){for(var D=0;D<B.length;D+=1)if(B[D]===N)return D;return-1},E={__proto__:null};h&&f&&b?s(v,function(I){var B=new p[I];if(Symbol.toStringTag in B){var N=b(B),D=f(N,Symbol.toStringTag);if(!D){var G=b(N);D=f(G,Symbol.toStringTag)}E["$"+I]=u(D.get)}}):s(v,function(I){var B=new p[I],N=B.slice||B.set;N&&(E["$"+I]=u(N))});var R=function(B){var N=!1;return s(E,function(D,G){if(!N)try{"$"+D(B)===G&&(N=y(G,1))}catch{}}),N},O=function(B){var N=!1;return s(E,function(D,G){if(!N)try{D(B),N=y(G,1)}catch{}}),N};return whichTypedArray=function(B){if(!B||typeof B!="object")return!1;if(!h){var N=y(c(B),8,-1);return S(v,N)>-1?N:N!=="Object"?!1:O(B)}return f?R(B):null},whichTypedArray}var isTypedArray,hasRequiredIsTypedArray;function requireIsTypedArray(){if(hasRequiredIsTypedArray)return isTypedArray;hasRequiredIsTypedArray=1;var s=requireWhichTypedArray();return isTypedArray=function(u){return!!s(u)},isTypedArray}var hasRequiredTypes;function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,function(s){var a=requireIsArguments$1(),u=requireIsGeneratorFunction(),l=requireWhichTypedArray(),f=requireIsTypedArray();function c(Ce){return Ce.call.bind(Ce)}var h=typeof BigInt<"u",p=typeof Symbol<"u",v=c(Object.prototype.toString),y=c(Number.prototype.valueOf),b=c(String.prototype.valueOf),S=c(Boolean.prototype.valueOf);if(h)var E=c(BigInt.prototype.valueOf);if(p)var R=c(Symbol.prototype.valueOf);function O(Ce,at){if(typeof Ce!="object")return!1;try{return at(Ce),!0}catch{return!1}}s.isArgumentsObject=a,s.isGeneratorFunction=u,s.isTypedArray=f;function I(Ce){return typeof Promise<"u"&&Ce instanceof Promise||Ce!==null&&typeof Ce=="object"&&typeof Ce.then=="function"&&typeof Ce.catch=="function"}s.isPromise=I;function B(Ce){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Ce):f(Ce)||Y(Ce)}s.isArrayBufferView=B;function N(Ce){return l(Ce)==="Uint8Array"}s.isUint8Array=N;function D(Ce){return l(Ce)==="Uint8ClampedArray"}s.isUint8ClampedArray=D;function G(Ce){return l(Ce)==="Uint16Array"}s.isUint16Array=G;function V(Ce){return l(Ce)==="Uint32Array"}s.isUint32Array=V;function U(Ce){return l(Ce)==="Int8Array"}s.isInt8Array=U;function te(Ce){return l(Ce)==="Int16Array"}s.isInt16Array=te;function Z(Ce){return l(Ce)==="Int32Array"}s.isInt32Array=Z;function J(Ce){return l(Ce)==="Float32Array"}s.isFloat32Array=J;function Q(Ce){return l(Ce)==="Float64Array"}s.isFloat64Array=Q;function ee(Ce){return l(Ce)==="BigInt64Array"}s.isBigInt64Array=ee;function k(Ce){return l(Ce)==="BigUint64Array"}s.isBigUint64Array=k;function d(Ce){return v(Ce)==="[object Map]"}d.working=typeof Map<"u"&&d(new Map);function g(Ce){return typeof Map>"u"?!1:d.working?d(Ce):Ce instanceof Map}s.isMap=g;function _(Ce){return v(Ce)==="[object Set]"}_.working=typeof Set<"u"&&_(new Set);function w(Ce){return typeof Set>"u"?!1:_.working?_(Ce):Ce instanceof Set}s.isSet=w;function x(Ce){return v(Ce)==="[object WeakMap]"}x.working=typeof WeakMap<"u"&&x(new WeakMap);function P(Ce){return typeof WeakMap>"u"?!1:x.working?x(Ce):Ce instanceof WeakMap}s.isWeakMap=P;function $(Ce){return v(Ce)==="[object WeakSet]"}$.working=typeof WeakSet<"u"&&$(new WeakSet);function T(Ce){return $(Ce)}s.isWeakSet=T;function m(Ce){return v(Ce)==="[object ArrayBuffer]"}m.working=typeof ArrayBuffer<"u"&&m(new ArrayBuffer);function M(Ce){return typeof ArrayBuffer>"u"?!1:m.working?m(Ce):Ce instanceof ArrayBuffer}s.isArrayBuffer=M;function W(Ce){return v(Ce)==="[object DataView]"}W.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&W(new DataView(new ArrayBuffer(1),0,1));function Y(Ce){return typeof DataView>"u"?!1:W.working?W(Ce):Ce instanceof DataView}s.isDataView=Y;var ue=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function ge(Ce){return v(Ce)==="[object SharedArrayBuffer]"}function he(Ce){return typeof ue>"u"?!1:(typeof ge.working>"u"&&(ge.working=ge(new ue)),ge.working?ge(Ce):Ce instanceof ue)}s.isSharedArrayBuffer=he;function ae(Ce){return v(Ce)==="[object AsyncFunction]"}s.isAsyncFunction=ae;function de(Ce){return v(Ce)==="[object Map Iterator]"}s.isMapIterator=de;function pe(Ce){return v(Ce)==="[object Set Iterator]"}s.isSetIterator=pe;function oe(Ce){return v(Ce)==="[object Generator]"}s.isGeneratorObject=oe;function le(Ce){return v(Ce)==="[object WebAssembly.Module]"}s.isWebAssemblyCompiledModule=le;function me(Ce){return O(Ce,y)}s.isNumberObject=me;function xe(Ce){return O(Ce,b)}s.isStringObject=xe;function Ne(Ce){return O(Ce,S)}s.isBooleanObject=Ne;function Pe(Ce){return h&&O(Ce,E)}s.isBigIntObject=Pe;function Ie(Ce){return p&&O(Ce,R)}s.isSymbolObject=Ie;function Ke(Ce){return me(Ce)||xe(Ce)||Ne(Ce)||Pe(Ce)||Ie(Ce)}s.isBoxedPrimitive=Ke;function Le(Ce){return typeof Uint8Array<"u"&&(M(Ce)||he(Ce))}s.isAnyArrayBuffer=Le,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Ce){Object.defineProperty(s,Ce,{enumerable:!1,value:function(){throw new Error(Ce+" is not supported in userland")}})})}(types)),types}var isBufferBrowser,hasRequiredIsBufferBrowser;function requireIsBufferBrowser(){return hasRequiredIsBufferBrowser||(hasRequiredIsBufferBrowser=1,isBufferBrowser=function(a){return a&&typeof a=="object"&&typeof a.copy=="function"&&typeof a.fill=="function"&&typeof a.readUInt8=="function"}),isBufferBrowser}var hasRequiredUtil$2;function requireUtil$2(){return hasRequiredUtil$2||(hasRequiredUtil$2=1,function(s){var a={},u=Object.getOwnPropertyDescriptors||function(ue){for(var ge=Object.keys(ue),he={},ae=0;ae<ge.length;ae++)he[ge[ae]]=Object.getOwnPropertyDescriptor(ue,ge[ae]);return he},l=/%[sdj%]/g;s.format=function(Y){if(!te(Y)){for(var ue=[],ge=0;ge<arguments.length;ge++)ue.push(p(arguments[ge]));return ue.join(" ")}for(var ge=1,he=arguments,ae=he.length,de=String(Y).replace(l,function(oe){if(oe==="%%")return"%";if(ge>=ae)return oe;switch(oe){case"%s":return String(he[ge++]);case"%d":return Number(he[ge++]);case"%j":try{return JSON.stringify(he[ge++])}catch{return"[Circular]"}default:return oe}}),pe=he[ge];ge<ae;pe=he[++ge])G(pe)||!ee(pe)?de+=" "+pe:de+=" "+p(pe);return de},s.deprecate=function(Y,ue){if(typeof distExports.process<"u"&&distExports.process.noDeprecation===!0)return Y;if(typeof distExports.process>"u")return function(){return s.deprecate(Y,ue).apply(this,arguments)};var ge=!1;function he(){if(!ge){if(distExports.process.throwDeprecation)throw new Error(ue);distExports.process.traceDeprecation?console.trace(ue):console.error(ue),ge=!0}return Y.apply(this,arguments)}return he};var f={},c=/^$/;if(a.NODE_DEBUG){var h=a.NODE_DEBUG;h=h.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),c=new RegExp("^"+h+"$","i")}s.debuglog=function(Y){if(Y=Y.toUpperCase(),!f[Y])if(c.test(Y)){var ue=distExports.process.pid;f[Y]=function(){var ge=s.format.apply(s,arguments);console.error("%s %d: %s",Y,ue,ge)}}else f[Y]=function(){};return f[Y]};function p(Y,ue){var ge={seen:[],stylize:y};return arguments.length>=3&&(ge.depth=arguments[2]),arguments.length>=4&&(ge.colors=arguments[3]),D(ue)?ge.showHidden=ue:ue&&s._extend(ge,ue),J(ge.showHidden)&&(ge.showHidden=!1),J(ge.depth)&&(ge.depth=2),J(ge.colors)&&(ge.colors=!1),J(ge.customInspect)&&(ge.customInspect=!0),ge.colors&&(ge.stylize=v),S(ge,Y,ge.depth)}s.inspect=p,p.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},p.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function v(Y,ue){var ge=p.styles[ue];return ge?"\x1B["+p.colors[ge][0]+"m"+Y+"\x1B["+p.colors[ge][1]+"m":Y}function y(Y,ue){return Y}function b(Y){var ue={};return Y.forEach(function(ge,he){ue[ge]=!0}),ue}function S(Y,ue,ge){if(Y.customInspect&&ue&&g(ue.inspect)&&ue.inspect!==s.inspect&&!(ue.constructor&&ue.constructor.prototype===ue)){var he=ue.inspect(ge,Y);return te(he)||(he=S(Y,he,ge)),he}var ae=E(Y,ue);if(ae)return ae;var de=Object.keys(ue),pe=b(de);if(Y.showHidden&&(de=Object.getOwnPropertyNames(ue)),d(ue)&&(de.indexOf("message")>=0||de.indexOf("description")>=0))return R(ue);if(de.length===0){if(g(ue)){var oe=ue.name?": "+ue.name:"";return Y.stylize("[Function"+oe+"]","special")}if(Q(ue))return Y.stylize(RegExp.prototype.toString.call(ue),"regexp");if(k(ue))return Y.stylize(Date.prototype.toString.call(ue),"date");if(d(ue))return R(ue)}var le="",me=!1,xe=["{","}"];if(N(ue)&&(me=!0,xe=["[","]"]),g(ue)){var Ne=ue.name?": "+ue.name:"";le=" [Function"+Ne+"]"}if(Q(ue)&&(le=" "+RegExp.prototype.toString.call(ue)),k(ue)&&(le=" "+Date.prototype.toUTCString.call(ue)),d(ue)&&(le=" "+R(ue)),de.length===0&&(!me||ue.length==0))return xe[0]+le+xe[1];if(ge<0)return Q(ue)?Y.stylize(RegExp.prototype.toString.call(ue),"regexp"):Y.stylize("[Object]","special");Y.seen.push(ue);var Pe;return me?Pe=O(Y,ue,ge,pe,de):Pe=de.map(function(Ie){return I(Y,ue,ge,pe,Ie,me)}),Y.seen.pop(),B(Pe,le,xe)}function E(Y,ue){if(J(ue))return Y.stylize("undefined","undefined");if(te(ue)){var ge="'"+JSON.stringify(ue).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return Y.stylize(ge,"string")}if(U(ue))return Y.stylize(""+ue,"number");if(D(ue))return Y.stylize(""+ue,"boolean");if(G(ue))return Y.stylize("null","null")}function R(Y){return"["+Error.prototype.toString.call(Y)+"]"}function O(Y,ue,ge,he,ae){for(var de=[],pe=0,oe=ue.length;pe<oe;++pe)T(ue,String(pe))?de.push(I(Y,ue,ge,he,String(pe),!0)):de.push("");return ae.forEach(function(le){le.match(/^\d+$/)||de.push(I(Y,ue,ge,he,le,!0))}),de}function I(Y,ue,ge,he,ae,de){var pe,oe,le;if(le=Object.getOwnPropertyDescriptor(ue,ae)||{value:ue[ae]},le.get?le.set?oe=Y.stylize("[Getter/Setter]","special"):oe=Y.stylize("[Getter]","special"):le.set&&(oe=Y.stylize("[Setter]","special")),T(he,ae)||(pe="["+ae+"]"),oe||(Y.seen.indexOf(le.value)<0?(G(ge)?oe=S(Y,le.value,null):oe=S(Y,le.value,ge-1),oe.indexOf(`
`)>-1&&(de?oe=oe.split(`
`).map(function(me){return"  "+me}).join(`
`).slice(2):oe=`
`+oe.split(`
`).map(function(me){return"   "+me}).join(`
`))):oe=Y.stylize("[Circular]","special")),J(pe)){if(de&&ae.match(/^\d+$/))return oe;pe=JSON.stringify(""+ae),pe.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(pe=pe.slice(1,-1),pe=Y.stylize(pe,"name")):(pe=pe.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),pe=Y.stylize(pe,"string"))}return pe+": "+oe}function B(Y,ue,ge){var he=Y.reduce(function(ae,de){return de.indexOf(`
`)>=0,ae+de.replace(/\u001b\[\d\d?m/g,"").length+1},0);return he>60?ge[0]+(ue===""?"":ue+`
 `)+" "+Y.join(`,
  `)+" "+ge[1]:ge[0]+ue+" "+Y.join(", ")+" "+ge[1]}s.types=requireTypes();function N(Y){return Array.isArray(Y)}s.isArray=N;function D(Y){return typeof Y=="boolean"}s.isBoolean=D;function G(Y){return Y===null}s.isNull=G;function V(Y){return Y==null}s.isNullOrUndefined=V;function U(Y){return typeof Y=="number"}s.isNumber=U;function te(Y){return typeof Y=="string"}s.isString=te;function Z(Y){return typeof Y=="symbol"}s.isSymbol=Z;function J(Y){return Y===void 0}s.isUndefined=J;function Q(Y){return ee(Y)&&w(Y)==="[object RegExp]"}s.isRegExp=Q,s.types.isRegExp=Q;function ee(Y){return typeof Y=="object"&&Y!==null}s.isObject=ee;function k(Y){return ee(Y)&&w(Y)==="[object Date]"}s.isDate=k,s.types.isDate=k;function d(Y){return ee(Y)&&(w(Y)==="[object Error]"||Y instanceof Error)}s.isError=d,s.types.isNativeError=d;function g(Y){return typeof Y=="function"}s.isFunction=g;function _(Y){return Y===null||typeof Y=="boolean"||typeof Y=="number"||typeof Y=="string"||typeof Y=="symbol"||typeof Y>"u"}s.isPrimitive=_,s.isBuffer=requireIsBufferBrowser();function w(Y){return Object.prototype.toString.call(Y)}function x(Y){return Y<10?"0"+Y.toString(10):Y.toString(10)}var P=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function $(){var Y=new Date,ue=[x(Y.getHours()),x(Y.getMinutes()),x(Y.getSeconds())].join(":");return[Y.getDate(),P[Y.getMonth()],ue].join(" ")}s.log=function(){console.log("%s - %s",$(),s.format.apply(s,arguments))},s.inherits=requireInherits_browser(),s._extend=function(Y,ue){if(!ue||!ee(ue))return Y;for(var ge=Object.keys(ue),he=ge.length;he--;)Y[ge[he]]=ue[ge[he]];return Y};function T(Y,ue){return Object.prototype.hasOwnProperty.call(Y,ue)}var m=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;s.promisify=function(ue){if(typeof ue!="function")throw new TypeError('The "original" argument must be of type Function');if(m&&ue[m]){var ge=ue[m];if(typeof ge!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(ge,m,{value:ge,enumerable:!1,writable:!1,configurable:!0}),ge}function ge(){for(var he,ae,de=new Promise(function(le,me){he=le,ae=me}),pe=[],oe=0;oe<arguments.length;oe++)pe.push(arguments[oe]);pe.push(function(le,me){le?ae(le):he(me)});try{ue.apply(this,pe)}catch(le){ae(le)}return de}return Object.setPrototypeOf(ge,Object.getPrototypeOf(ue)),m&&Object.defineProperty(ge,m,{value:ge,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(ge,u(ue))},s.promisify.custom=m;function M(Y,ue){if(!Y){var ge=new Error("Promise was rejected with a falsy value");ge.reason=Y,Y=ge}return ue(Y)}function W(Y){if(typeof Y!="function")throw new TypeError('The "original" argument must be of type Function');function ue(){for(var ge=[],he=0;he<arguments.length;he++)ge.push(arguments[he]);var ae=ge.pop();if(typeof ae!="function")throw new TypeError("The last argument must be of type Function");var de=this,pe=function(){return ae.apply(de,arguments)};Y.apply(this,ge).then(function(oe){distExports.process.nextTick(pe.bind(null,null,oe))},function(oe){distExports.process.nextTick(M.bind(null,oe,pe))})}return Object.setPrototypeOf(ue,Object.getPrototypeOf(Y)),Object.defineProperties(ue,u(Y)),ue}s.callbackify=W}(util$3)),util$3}var buffer_list,hasRequiredBuffer_list;function requireBuffer_list(){if(hasRequiredBuffer_list)return buffer_list;hasRequiredBuffer_list=1;function s(O,I){var B=Object.keys(O);if(Object.getOwnPropertySymbols){var N=Object.getOwnPropertySymbols(O);I&&(N=N.filter(function(D){return Object.getOwnPropertyDescriptor(O,D).enumerable})),B.push.apply(B,N)}return B}function a(O){for(var I=1;I<arguments.length;I++){var B=arguments[I]!=null?arguments[I]:{};I%2?s(Object(B),!0).forEach(function(N){u(O,N,B[N])}):Object.getOwnPropertyDescriptors?Object.defineProperties(O,Object.getOwnPropertyDescriptors(B)):s(Object(B)).forEach(function(N){Object.defineProperty(O,N,Object.getOwnPropertyDescriptor(B,N))})}return O}function u(O,I,B){return I=h(I),I in O?Object.defineProperty(O,I,{value:B,enumerable:!0,configurable:!0,writable:!0}):O[I]=B,O}function l(O,I){if(!(O instanceof I))throw new TypeError("Cannot call a class as a function")}function f(O,I){for(var B=0;B<I.length;B++){var N=I[B];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(O,h(N.key),N)}}function c(O,I,B){return I&&f(O.prototype,I),Object.defineProperty(O,"prototype",{writable:!1}),O}function h(O){var I=p(O,"string");return typeof I=="symbol"?I:String(I)}function p(O,I){if(typeof O!="object"||O===null)return O;var B=O[Symbol.toPrimitive];if(B!==void 0){var N=B.call(O,I||"default");if(typeof N!="object")return N;throw new TypeError("@@toPrimitive must return a primitive value.")}return(I==="string"?String:Number)(O)}var v=requireBuffer$1(),y=v.Buffer,b=requireUtil$2(),S=b.inspect,E=S&&S.custom||"inspect";function R(O,I,B){y.prototype.copy.call(O,I,B)}return buffer_list=function(){function O(){l(this,O),this.head=null,this.tail=null,this.length=0}return c(O,[{key:"push",value:function(B){var N={data:B,next:null};this.length>0?this.tail.next=N:this.head=N,this.tail=N,++this.length}},{key:"unshift",value:function(B){var N={data:B,next:this.head};this.length===0&&(this.tail=N),this.head=N,++this.length}},{key:"shift",value:function(){if(this.length!==0){var B=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,B}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(B){if(this.length===0)return"";for(var N=this.head,D=""+N.data;N=N.next;)D+=B+N.data;return D}},{key:"concat",value:function(B){if(this.length===0)return y.alloc(0);for(var N=y.allocUnsafe(B>>>0),D=this.head,G=0;D;)R(D.data,N,G),G+=D.data.length,D=D.next;return N}},{key:"consume",value:function(B,N){var D;return B<this.head.data.length?(D=this.head.data.slice(0,B),this.head.data=this.head.data.slice(B)):B===this.head.data.length?D=this.shift():D=N?this._getString(B):this._getBuffer(B),D}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(B){var N=this.head,D=1,G=N.data;for(B-=G.length;N=N.next;){var V=N.data,U=B>V.length?V.length:B;if(U===V.length?G+=V:G+=V.slice(0,B),B-=U,B===0){U===V.length?(++D,N.next?this.head=N.next:this.head=this.tail=null):(this.head=N,N.data=V.slice(U));break}++D}return this.length-=D,G}},{key:"_getBuffer",value:function(B){var N=y.allocUnsafe(B),D=this.head,G=1;for(D.data.copy(N),B-=D.data.length;D=D.next;){var V=D.data,U=B>V.length?V.length:B;if(V.copy(N,N.length-B,0,U),B-=U,B===0){U===V.length?(++G,D.next?this.head=D.next:this.head=this.tail=null):(this.head=D,D.data=V.slice(U));break}++G}return this.length-=G,N}},{key:E,value:function(B,N){return S(this,a(a({},N),{},{depth:0,customInspect:!1}))}}]),O}(),buffer_list}var destroy_1$1,hasRequiredDestroy$1;function requireDestroy$1(){if(hasRequiredDestroy$1)return destroy_1$1;hasRequiredDestroy$1=1;function s(h,p){var v=this,y=this._readableState&&this._readableState.destroyed,b=this._writableState&&this._writableState.destroyed;return y||b?(p?p(h):h&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,distExports.process.nextTick(f,this,h)):distExports.process.nextTick(f,this,h)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(h||null,function(S){!p&&S?v._writableState?v._writableState.errorEmitted?distExports.process.nextTick(u,v):(v._writableState.errorEmitted=!0,distExports.process.nextTick(a,v,S)):distExports.process.nextTick(a,v,S):p?(distExports.process.nextTick(u,v),p(S)):distExports.process.nextTick(u,v)}),this)}function a(h,p){f(h,p),u(h)}function u(h){h._writableState&&!h._writableState.emitClose||h._readableState&&!h._readableState.emitClose||h.emit("close")}function l(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function f(h,p){h.emit("error",p)}function c(h,p){var v=h._readableState,y=h._writableState;v&&v.autoDestroy||y&&y.autoDestroy?h.destroy(p):h.emit("error",p)}return destroy_1$1={destroy:s,undestroy:l,errorOrDestroy:c},destroy_1$1}var errorsBrowser={},hasRequiredErrorsBrowser;function requireErrorsBrowser(){if(hasRequiredErrorsBrowser)return errorsBrowser;hasRequiredErrorsBrowser=1;function s(p,v){p.prototype=Object.create(v.prototype),p.prototype.constructor=p,p.__proto__=v}var a={};function u(p,v,y){y||(y=Error);function b(E,R,O){return typeof v=="string"?v:v(E,R,O)}var S=function(E){s(R,E);function R(O,I,B){return E.call(this,b(O,I,B))||this}return R}(y);S.prototype.name=y.name,S.prototype.code=p,a[p]=S}function l(p,v){if(Array.isArray(p)){var y=p.length;return p=p.map(function(b){return String(b)}),y>2?"one of ".concat(v," ").concat(p.slice(0,y-1).join(", "),", or ")+p[y-1]:y===2?"one of ".concat(v," ").concat(p[0]," or ").concat(p[1]):"of ".concat(v," ").concat(p[0])}else return"of ".concat(v," ").concat(String(p))}function f(p,v,y){return p.substr(0,v.length)===v}function c(p,v,y){return(y===void 0||y>p.length)&&(y=p.length),p.substring(y-v.length,y)===v}function h(p,v,y){return typeof y!="number"&&(y=0),y+v.length>p.length?!1:p.indexOf(v,y)!==-1}return u("ERR_INVALID_OPT_VALUE",function(p,v){return'The value "'+v+'" is invalid for option "'+p+'"'},TypeError),u("ERR_INVALID_ARG_TYPE",function(p,v,y){var b;typeof v=="string"&&f(v,"not ")?(b="must not be",v=v.replace(/^not /,"")):b="must be";var S;if(c(p," argument"))S="The ".concat(p," ").concat(b," ").concat(l(v,"type"));else{var E=h(p,".")?"property":"argument";S='The "'.concat(p,'" ').concat(E," ").concat(b," ").concat(l(v,"type"))}return S+=". Received type ".concat(typeof y),S},TypeError),u("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),u("ERR_METHOD_NOT_IMPLEMENTED",function(p){return"The "+p+" method is not implemented"}),u("ERR_STREAM_PREMATURE_CLOSE","Premature close"),u("ERR_STREAM_DESTROYED",function(p){return"Cannot call "+p+" after a stream was destroyed"}),u("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),u("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),u("ERR_STREAM_WRITE_AFTER_END","write after end"),u("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),u("ERR_UNKNOWN_ENCODING",function(p){return"Unknown encoding: "+p},TypeError),u("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),errorsBrowser.codes=a,errorsBrowser}var state,hasRequiredState;function requireState(){if(hasRequiredState)return state;hasRequiredState=1;var s=requireErrorsBrowser().codes.ERR_INVALID_OPT_VALUE;function a(l,f,c){return l.highWaterMark!=null?l.highWaterMark:f?l[c]:null}function u(l,f,c,h){var p=a(f,h,c);if(p!=null){if(!(isFinite(p)&&Math.floor(p)===p)||p<0){var v=h?c:"highWaterMark";throw new s(v,p)}return Math.floor(p)}return l.objectMode?16:16*1024}return state={getHighWaterMark:u},state}var browser$a,hasRequiredBrowser$a;function requireBrowser$a(){if(hasRequiredBrowser$a)return browser$a;hasRequiredBrowser$a=1,browser$a=s;function s(u,l){if(a("noDeprecation"))return u;var f=!1;function c(){if(!f){if(a("throwDeprecation"))throw new Error(l);a("traceDeprecation")?console.trace(l):console.warn(l),f=!0}return u.apply(this,arguments)}return c}function a(u){try{if(!commonjsGlobal.localStorage)return!1}catch{return!1}var l=commonjsGlobal.localStorage[u];return l==null?!1:String(l).toLowerCase()==="true"}return browser$a}var _stream_writable$1,hasRequired_stream_writable$1;function require_stream_writable$1(){if(hasRequired_stream_writable$1)return _stream_writable$1;hasRequired_stream_writable$1=1,_stream_writable$1=J;function s(he){var ae=this;this.next=null,this.entry=null,this.finish=function(){ge(ae,he)}}var a;J.WritableState=te;var u={deprecate:requireBrowser$a()},l=requireStreamBrowser$1(),f=requireBuffer$1().Buffer,c=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function h(he){return f.from(he)}function p(he){return f.isBuffer(he)||he instanceof c}var v=requireDestroy$1(),y=requireState(),b=y.getHighWaterMark,S=requireErrorsBrowser().codes,E=S.ERR_INVALID_ARG_TYPE,R=S.ERR_METHOD_NOT_IMPLEMENTED,O=S.ERR_MULTIPLE_CALLBACK,I=S.ERR_STREAM_CANNOT_PIPE,B=S.ERR_STREAM_DESTROYED,N=S.ERR_STREAM_NULL_VALUES,D=S.ERR_STREAM_WRITE_AFTER_END,G=S.ERR_UNKNOWN_ENCODING,V=v.errorOrDestroy;requireInherits_browser()(J,l);function U(){}function te(he,ae,de){a=a||require_stream_duplex$1(),he=he||{},typeof de!="boolean"&&(de=ae instanceof a),this.objectMode=!!he.objectMode,de&&(this.objectMode=this.objectMode||!!he.writableObjectMode),this.highWaterMark=b(this,he,"writableHighWaterMark",de),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var pe=he.decodeStrings===!1;this.decodeStrings=!pe,this.defaultEncoding=he.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(oe){x(ae,oe)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=he.emitClose!==!1,this.autoDestroy=!!he.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}te.prototype.getBuffer=function(){for(var ae=this.bufferedRequest,de=[];ae;)de.push(ae),ae=ae.next;return de},function(){try{Object.defineProperty(te.prototype,"buffer",{get:u.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var Z;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Z=Function.prototype[Symbol.hasInstance],Object.defineProperty(J,Symbol.hasInstance,{value:function(ae){return Z.call(this,ae)?!0:this!==J?!1:ae&&ae._writableState instanceof te}})):Z=function(ae){return ae instanceof this};function J(he){a=a||require_stream_duplex$1();var ae=this instanceof a;if(!ae&&!Z.call(J,this))return new J(he);this._writableState=new te(he,this,ae),this.writable=!0,he&&(typeof he.write=="function"&&(this._write=he.write),typeof he.writev=="function"&&(this._writev=he.writev),typeof he.destroy=="function"&&(this._destroy=he.destroy),typeof he.final=="function"&&(this._final=he.final)),l.call(this)}J.prototype.pipe=function(){V(this,new I)};function Q(he,ae){var de=new D;V(he,de),distExports.process.nextTick(ae,de)}function ee(he,ae,de,pe){var oe;return de===null?oe=new N:typeof de!="string"&&!ae.objectMode&&(oe=new E("chunk",["string","Buffer"],de)),oe?(V(he,oe),distExports.process.nextTick(pe,oe),!1):!0}J.prototype.write=function(he,ae,de){var pe=this._writableState,oe=!1,le=!pe.objectMode&&p(he);return le&&!f.isBuffer(he)&&(he=h(he)),typeof ae=="function"&&(de=ae,ae=null),le?ae="buffer":ae||(ae=pe.defaultEncoding),typeof de!="function"&&(de=U),pe.ending?Q(this,de):(le||ee(this,pe,he,de))&&(pe.pendingcb++,oe=d(this,pe,le,he,ae,de)),oe},J.prototype.cork=function(){this._writableState.corked++},J.prototype.uncork=function(){var he=this._writableState;he.corked&&(he.corked--,!he.writing&&!he.corked&&!he.bufferProcessing&&he.bufferedRequest&&T(this,he))},J.prototype.setDefaultEncoding=function(ae){if(typeof ae=="string"&&(ae=ae.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((ae+"").toLowerCase())>-1))throw new G(ae);return this._writableState.defaultEncoding=ae,this},Object.defineProperty(J.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function k(he,ae,de){return!he.objectMode&&he.decodeStrings!==!1&&typeof ae=="string"&&(ae=f.from(ae,de)),ae}Object.defineProperty(J.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function d(he,ae,de,pe,oe,le){if(!de){var me=k(ae,pe,oe);pe!==me&&(de=!0,oe="buffer",pe=me)}var xe=ae.objectMode?1:pe.length;ae.length+=xe;var Ne=ae.length<ae.highWaterMark;if(Ne||(ae.needDrain=!0),ae.writing||ae.corked){var Pe=ae.lastBufferedRequest;ae.lastBufferedRequest={chunk:pe,encoding:oe,isBuf:de,callback:le,next:null},Pe?Pe.next=ae.lastBufferedRequest:ae.bufferedRequest=ae.lastBufferedRequest,ae.bufferedRequestCount+=1}else g(he,ae,!1,xe,pe,oe,le);return Ne}function g(he,ae,de,pe,oe,le,me){ae.writelen=pe,ae.writecb=me,ae.writing=!0,ae.sync=!0,ae.destroyed?ae.onwrite(new B("write")):de?he._writev(oe,ae.onwrite):he._write(oe,le,ae.onwrite),ae.sync=!1}function _(he,ae,de,pe,oe){--ae.pendingcb,de?(distExports.process.nextTick(oe,pe),distExports.process.nextTick(Y,he,ae),he._writableState.errorEmitted=!0,V(he,pe)):(oe(pe),he._writableState.errorEmitted=!0,V(he,pe),Y(he,ae))}function w(he){he.writing=!1,he.writecb=null,he.length-=he.writelen,he.writelen=0}function x(he,ae){var de=he._writableState,pe=de.sync,oe=de.writecb;if(typeof oe!="function")throw new O;if(w(de),ae)_(he,de,pe,ae,oe);else{var le=m(de)||he.destroyed;!le&&!de.corked&&!de.bufferProcessing&&de.bufferedRequest&&T(he,de),pe?distExports.process.nextTick(P,he,de,le,oe):P(he,de,le,oe)}}function P(he,ae,de,pe){de||$(he,ae),ae.pendingcb--,pe(),Y(he,ae)}function $(he,ae){ae.length===0&&ae.needDrain&&(ae.needDrain=!1,he.emit("drain"))}function T(he,ae){ae.bufferProcessing=!0;var de=ae.bufferedRequest;if(he._writev&&de&&de.next){var pe=ae.bufferedRequestCount,oe=new Array(pe),le=ae.corkedRequestsFree;le.entry=de;for(var me=0,xe=!0;de;)oe[me]=de,de.isBuf||(xe=!1),de=de.next,me+=1;oe.allBuffers=xe,g(he,ae,!0,ae.length,oe,"",le.finish),ae.pendingcb++,ae.lastBufferedRequest=null,le.next?(ae.corkedRequestsFree=le.next,le.next=null):ae.corkedRequestsFree=new s(ae),ae.bufferedRequestCount=0}else{for(;de;){var Ne=de.chunk,Pe=de.encoding,Ie=de.callback,Ke=ae.objectMode?1:Ne.length;if(g(he,ae,!1,Ke,Ne,Pe,Ie),de=de.next,ae.bufferedRequestCount--,ae.writing)break}de===null&&(ae.lastBufferedRequest=null)}ae.bufferedRequest=de,ae.bufferProcessing=!1}J.prototype._write=function(he,ae,de){de(new R("_write()"))},J.prototype._writev=null,J.prototype.end=function(he,ae,de){var pe=this._writableState;return typeof he=="function"?(de=he,he=null,ae=null):typeof ae=="function"&&(de=ae,ae=null),he!=null&&this.write(he,ae),pe.corked&&(pe.corked=1,this.uncork()),pe.ending||ue(this,pe,de),this},Object.defineProperty(J.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function m(he){return he.ending&&he.length===0&&he.bufferedRequest===null&&!he.finished&&!he.writing}function M(he,ae){he._final(function(de){ae.pendingcb--,de&&V(he,de),ae.prefinished=!0,he.emit("prefinish"),Y(he,ae)})}function W(he,ae){!ae.prefinished&&!ae.finalCalled&&(typeof he._final=="function"&&!ae.destroyed?(ae.pendingcb++,ae.finalCalled=!0,distExports.process.nextTick(M,he,ae)):(ae.prefinished=!0,he.emit("prefinish")))}function Y(he,ae){var de=m(ae);if(de&&(W(he,ae),ae.pendingcb===0&&(ae.finished=!0,he.emit("finish"),ae.autoDestroy))){var pe=he._readableState;(!pe||pe.autoDestroy&&pe.endEmitted)&&he.destroy()}return de}function ue(he,ae,de){ae.ending=!0,Y(he,ae),de&&(ae.finished?distExports.process.nextTick(de):he.once("finish",de)),ae.ended=!0,he.writable=!1}function ge(he,ae,de){var pe=he.entry;for(he.entry=null;pe;){var oe=pe.callback;ae.pendingcb--,oe(de),pe=pe.next}ae.corkedRequestsFree.next=he}return Object.defineProperty(J.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(ae){this._writableState&&(this._writableState.destroyed=ae)}}),J.prototype.destroy=v.destroy,J.prototype._undestroy=v.undestroy,J.prototype._destroy=function(he,ae){ae(he)},_stream_writable$1}var _stream_duplex$1,hasRequired_stream_duplex$1;function require_stream_duplex$1(){if(hasRequired_stream_duplex$1)return _stream_duplex$1;hasRequired_stream_duplex$1=1;var s=Object.keys||function(y){var b=[];for(var S in y)b.push(S);return b};_stream_duplex$1=h;var a=require_stream_readable$1(),u=require_stream_writable$1();requireInherits_browser()(h,a);for(var l=s(u.prototype),f=0;f<l.length;f++){var c=l[f];h.prototype[c]||(h.prototype[c]=u.prototype[c])}function h(y){if(!(this instanceof h))return new h(y);a.call(this,y),u.call(this,y),this.allowHalfOpen=!0,y&&(y.readable===!1&&(this.readable=!1),y.writable===!1&&(this.writable=!1),y.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",p)))}Object.defineProperty(h.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(h.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(h.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function p(){this._writableState.ended||distExports.process.nextTick(v,this)}function v(y){y.end()}return Object.defineProperty(h.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(b){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=b,this._writableState.destroyed=b)}}),_stream_duplex$1}var string_decoder$1={},hasRequiredString_decoder$1;function requireString_decoder$1(){if(hasRequiredString_decoder$1)return string_decoder$1;hasRequiredString_decoder$1=1;var s=requireSafeBuffer$2().Buffer,a=s.isEncoding||function(N){switch(N=""+N,N&&N.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function u(N){if(!N)return"utf8";for(var D;;)switch(N){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return N;default:if(D)return;N=(""+N).toLowerCase(),D=!0}}function l(N){var D=u(N);if(typeof D!="string"&&(s.isEncoding===a||!a(N)))throw new Error("Unknown encoding: "+N);return D||N}string_decoder$1.StringDecoder=f;function f(N){this.encoding=l(N);var D;switch(this.encoding){case"utf16le":this.text=S,this.end=E,D=4;break;case"utf8":this.fillLast=v,D=4;break;case"base64":this.text=R,this.end=O,D=3;break;default:this.write=I,this.end=B;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=s.allocUnsafe(D)}f.prototype.write=function(N){if(N.length===0)return"";var D,G;if(this.lastNeed){if(D=this.fillLast(N),D===void 0)return"";G=this.lastNeed,this.lastNeed=0}else G=0;return G<N.length?D?D+this.text(N,G):this.text(N,G):D||""},f.prototype.end=b,f.prototype.text=y,f.prototype.fillLast=function(N){if(this.lastNeed<=N.length)return N.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);N.copy(this.lastChar,this.lastTotal-this.lastNeed,0,N.length),this.lastNeed-=N.length};function c(N){return N<=127?0:N>>5===6?2:N>>4===14?3:N>>3===30?4:N>>6===2?-1:-2}function h(N,D,G){var V=D.length-1;if(V<G)return 0;var U=c(D[V]);return U>=0?(U>0&&(N.lastNeed=U-1),U):--V<G||U===-2?0:(U=c(D[V]),U>=0?(U>0&&(N.lastNeed=U-2),U):--V<G||U===-2?0:(U=c(D[V]),U>=0?(U>0&&(U===2?U=0:N.lastNeed=U-3),U):0))}function p(N,D,G){if((D[0]&192)!==128)return N.lastNeed=0,"�";if(N.lastNeed>1&&D.length>1){if((D[1]&192)!==128)return N.lastNeed=1,"�";if(N.lastNeed>2&&D.length>2&&(D[2]&192)!==128)return N.lastNeed=2,"�"}}function v(N){var D=this.lastTotal-this.lastNeed,G=p(this,N);if(G!==void 0)return G;if(this.lastNeed<=N.length)return N.copy(this.lastChar,D,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);N.copy(this.lastChar,D,0,N.length),this.lastNeed-=N.length}function y(N,D){var G=h(this,N,D);if(!this.lastNeed)return N.toString("utf8",D);this.lastTotal=G;var V=N.length-(G-this.lastNeed);return N.copy(this.lastChar,0,V),N.toString("utf8",D,V)}function b(N){var D=N&&N.length?this.write(N):"";return this.lastNeed?D+"�":D}function S(N,D){if((N.length-D)%2===0){var G=N.toString("utf16le",D);if(G){var V=G.charCodeAt(G.length-1);if(V>=55296&&V<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=N[N.length-2],this.lastChar[1]=N[N.length-1],G.slice(0,-1)}return G}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=N[N.length-1],N.toString("utf16le",D,N.length-1)}function E(N){var D=N&&N.length?this.write(N):"";if(this.lastNeed){var G=this.lastTotal-this.lastNeed;return D+this.lastChar.toString("utf16le",0,G)}return D}function R(N,D){var G=(N.length-D)%3;return G===0?N.toString("base64",D):(this.lastNeed=3-G,this.lastTotal=3,G===1?this.lastChar[0]=N[N.length-1]:(this.lastChar[0]=N[N.length-2],this.lastChar[1]=N[N.length-1]),N.toString("base64",D,N.length-G))}function O(N){var D=N&&N.length?this.write(N):"";return this.lastNeed?D+this.lastChar.toString("base64",0,3-this.lastNeed):D}function I(N){return N.toString(this.encoding)}function B(N){return N&&N.length?this.write(N):""}return string_decoder$1}var endOfStream,hasRequiredEndOfStream;function requireEndOfStream(){if(hasRequiredEndOfStream)return endOfStream;hasRequiredEndOfStream=1;var s=requireErrorsBrowser().codes.ERR_STREAM_PREMATURE_CLOSE;function a(c){var h=!1;return function(){if(!h){h=!0;for(var p=arguments.length,v=new Array(p),y=0;y<p;y++)v[y]=arguments[y];c.apply(this,v)}}}function u(){}function l(c){return c.setHeader&&typeof c.abort=="function"}function f(c,h,p){if(typeof h=="function")return f(c,null,h);h||(h={}),p=a(p||u);var v=h.readable||h.readable!==!1&&c.readable,y=h.writable||h.writable!==!1&&c.writable,b=function(){c.writable||E()},S=c._writableState&&c._writableState.finished,E=function(){y=!1,S=!0,v||p.call(c)},R=c._readableState&&c._readableState.endEmitted,O=function(){v=!1,R=!0,y||p.call(c)},I=function(G){p.call(c,G)},B=function(){var G;if(v&&!R)return(!c._readableState||!c._readableState.ended)&&(G=new s),p.call(c,G);if(y&&!S)return(!c._writableState||!c._writableState.ended)&&(G=new s),p.call(c,G)},N=function(){c.req.on("finish",E)};return l(c)?(c.on("complete",E),c.on("abort",B),c.req?N():c.on("request",N)):y&&!c._writableState&&(c.on("end",b),c.on("close",b)),c.on("end",O),c.on("finish",E),h.error!==!1&&c.on("error",I),c.on("close",B),function(){c.removeListener("complete",E),c.removeListener("abort",B),c.removeListener("request",N),c.req&&c.req.removeListener("finish",E),c.removeListener("end",b),c.removeListener("close",b),c.removeListener("finish",E),c.removeListener("end",O),c.removeListener("error",I),c.removeListener("close",B)}}return endOfStream=f,endOfStream}var async_iterator,hasRequiredAsync_iterator;function requireAsync_iterator(){if(hasRequiredAsync_iterator)return async_iterator;hasRequiredAsync_iterator=1;var s;function a(G,V,U){return V=u(V),V in G?Object.defineProperty(G,V,{value:U,enumerable:!0,configurable:!0,writable:!0}):G[V]=U,G}function u(G){var V=l(G,"string");return typeof V=="symbol"?V:String(V)}function l(G,V){if(typeof G!="object"||G===null)return G;var U=G[Symbol.toPrimitive];if(U!==void 0){var te=U.call(G,V||"default");if(typeof te!="object")return te;throw new TypeError("@@toPrimitive must return a primitive value.")}return(V==="string"?String:Number)(G)}var f=requireEndOfStream(),c=Symbol("lastResolve"),h=Symbol("lastReject"),p=Symbol("error"),v=Symbol("ended"),y=Symbol("lastPromise"),b=Symbol("handlePromise"),S=Symbol("stream");function E(G,V){return{value:G,done:V}}function R(G){var V=G[c];if(V!==null){var U=G[S].read();U!==null&&(G[y]=null,G[c]=null,G[h]=null,V(E(U,!1)))}}function O(G){distExports.process.nextTick(R,G)}function I(G,V){return function(U,te){G.then(function(){if(V[v]){U(E(void 0,!0));return}V[b](U,te)},te)}}var B=Object.getPrototypeOf(function(){}),N=Object.setPrototypeOf((s={get stream(){return this[S]},next:function(){var V=this,U=this[p];if(U!==null)return Promise.reject(U);if(this[v])return Promise.resolve(E(void 0,!0));if(this[S].destroyed)return new Promise(function(Q,ee){distExports.process.nextTick(function(){V[p]?ee(V[p]):Q(E(void 0,!0))})});var te=this[y],Z;if(te)Z=new Promise(I(te,this));else{var J=this[S].read();if(J!==null)return Promise.resolve(E(J,!1));Z=new Promise(this[b])}return this[y]=Z,Z}},a(s,Symbol.asyncIterator,function(){return this}),a(s,"return",function(){var V=this;return new Promise(function(U,te){V[S].destroy(null,function(Z){if(Z){te(Z);return}U(E(void 0,!0))})})}),s),B),D=function(V){var U,te=Object.create(N,(U={},a(U,S,{value:V,writable:!0}),a(U,c,{value:null,writable:!0}),a(U,h,{value:null,writable:!0}),a(U,p,{value:null,writable:!0}),a(U,v,{value:V._readableState.endEmitted,writable:!0}),a(U,b,{value:function(J,Q){var ee=te[S].read();ee?(te[y]=null,te[c]=null,te[h]=null,J(E(ee,!1))):(te[c]=J,te[h]=Q)},writable:!0}),U));return te[y]=null,f(V,function(Z){if(Z&&Z.code!=="ERR_STREAM_PREMATURE_CLOSE"){var J=te[h];J!==null&&(te[y]=null,te[c]=null,te[h]=null,J(Z)),te[p]=Z;return}var Q=te[c];Q!==null&&(te[y]=null,te[c]=null,te[h]=null,Q(E(void 0,!0))),te[v]=!0}),V.on("readable",O.bind(null,te)),te};return async_iterator=D,async_iterator}var fromBrowser,hasRequiredFromBrowser;function requireFromBrowser(){return hasRequiredFromBrowser||(hasRequiredFromBrowser=1,fromBrowser=function(){throw new Error("Readable.from is not available in the browser")}),fromBrowser}var _stream_readable$1,hasRequired_stream_readable$1;function require_stream_readable$1(){if(hasRequired_stream_readable$1)return _stream_readable$1;hasRequired_stream_readable$1=1,_stream_readable$1=Q;var s;Q.ReadableState=J,requireEvents().EventEmitter;var a=function(me,xe){return me.listeners(xe).length},u=requireStreamBrowser$1(),l=requireBuffer$1().Buffer,f=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function c(le){return l.from(le)}function h(le){return l.isBuffer(le)||le instanceof f}var p=requireUtil$2(),v;p&&p.debuglog?v=p.debuglog("stream"):v=function(){};var y=requireBuffer_list(),b=requireDestroy$1(),S=requireState(),E=S.getHighWaterMark,R=requireErrorsBrowser().codes,O=R.ERR_INVALID_ARG_TYPE,I=R.ERR_STREAM_PUSH_AFTER_EOF,B=R.ERR_METHOD_NOT_IMPLEMENTED,N=R.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,D,G,V;requireInherits_browser()(Q,u);var U=b.errorOrDestroy,te=["error","close","destroy","pause","resume"];function Z(le,me,xe){if(typeof le.prependListener=="function")return le.prependListener(me,xe);!le._events||!le._events[me]?le.on(me,xe):Array.isArray(le._events[me])?le._events[me].unshift(xe):le._events[me]=[xe,le._events[me]]}function J(le,me,xe){s=s||require_stream_duplex$1(),le=le||{},typeof xe!="boolean"&&(xe=me instanceof s),this.objectMode=!!le.objectMode,xe&&(this.objectMode=this.objectMode||!!le.readableObjectMode),this.highWaterMark=E(this,le,"readableHighWaterMark",xe),this.buffer=new y,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=le.emitClose!==!1,this.autoDestroy=!!le.autoDestroy,this.destroyed=!1,this.defaultEncoding=le.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,le.encoding&&(D||(D=requireString_decoder$1().StringDecoder),this.decoder=new D(le.encoding),this.encoding=le.encoding)}function Q(le){if(s=s||require_stream_duplex$1(),!(this instanceof Q))return new Q(le);var me=this instanceof s;this._readableState=new J(le,this,me),this.readable=!0,le&&(typeof le.read=="function"&&(this._read=le.read),typeof le.destroy=="function"&&(this._destroy=le.destroy)),u.call(this)}Object.defineProperty(Q.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(me){this._readableState&&(this._readableState.destroyed=me)}}),Q.prototype.destroy=b.destroy,Q.prototype._undestroy=b.undestroy,Q.prototype._destroy=function(le,me){me(le)},Q.prototype.push=function(le,me){var xe=this._readableState,Ne;return xe.objectMode?Ne=!0:typeof le=="string"&&(me=me||xe.defaultEncoding,me!==xe.encoding&&(le=l.from(le,me),me=""),Ne=!0),ee(this,le,me,!1,Ne)},Q.prototype.unshift=function(le){return ee(this,le,null,!0,!1)};function ee(le,me,xe,Ne,Pe){v("readableAddChunk",me);var Ie=le._readableState;if(me===null)Ie.reading=!1,x(le,Ie);else{var Ke;if(Pe||(Ke=d(Ie,me)),Ke)U(le,Ke);else if(Ie.objectMode||me&&me.length>0)if(typeof me!="string"&&!Ie.objectMode&&Object.getPrototypeOf(me)!==l.prototype&&(me=c(me)),Ne)Ie.endEmitted?U(le,new N):k(le,Ie,me,!0);else if(Ie.ended)U(le,new I);else{if(Ie.destroyed)return!1;Ie.reading=!1,Ie.decoder&&!xe?(me=Ie.decoder.write(me),Ie.objectMode||me.length!==0?k(le,Ie,me,!1):T(le,Ie)):k(le,Ie,me,!1)}else Ne||(Ie.reading=!1,T(le,Ie))}return!Ie.ended&&(Ie.length<Ie.highWaterMark||Ie.length===0)}function k(le,me,xe,Ne){me.flowing&&me.length===0&&!me.sync?(me.awaitDrain=0,le.emit("data",xe)):(me.length+=me.objectMode?1:xe.length,Ne?me.buffer.unshift(xe):me.buffer.push(xe),me.needReadable&&P(le)),T(le,me)}function d(le,me){var xe;return!h(me)&&typeof me!="string"&&me!==void 0&&!le.objectMode&&(xe=new O("chunk",["string","Buffer","Uint8Array"],me)),xe}Q.prototype.isPaused=function(){return this._readableState.flowing===!1},Q.prototype.setEncoding=function(le){D||(D=requireString_decoder$1().StringDecoder);var me=new D(le);this._readableState.decoder=me,this._readableState.encoding=this._readableState.decoder.encoding;for(var xe=this._readableState.buffer.head,Ne="";xe!==null;)Ne+=me.write(xe.data),xe=xe.next;return this._readableState.buffer.clear(),Ne!==""&&this._readableState.buffer.push(Ne),this._readableState.length=Ne.length,this};var g=1073741824;function _(le){return le>=g?le=g:(le--,le|=le>>>1,le|=le>>>2,le|=le>>>4,le|=le>>>8,le|=le>>>16,le++),le}function w(le,me){return le<=0||me.length===0&&me.ended?0:me.objectMode?1:le!==le?me.flowing&&me.length?me.buffer.head.data.length:me.length:(le>me.highWaterMark&&(me.highWaterMark=_(le)),le<=me.length?le:me.ended?me.length:(me.needReadable=!0,0))}Q.prototype.read=function(le){v("read",le),le=parseInt(le,10);var me=this._readableState,xe=le;if(le!==0&&(me.emittedReadable=!1),le===0&&me.needReadable&&((me.highWaterMark!==0?me.length>=me.highWaterMark:me.length>0)||me.ended))return v("read: emitReadable",me.length,me.ended),me.length===0&&me.ended?de(this):P(this),null;if(le=w(le,me),le===0&&me.ended)return me.length===0&&de(this),null;var Ne=me.needReadable;v("need readable",Ne),(me.length===0||me.length-le<me.highWaterMark)&&(Ne=!0,v("length less than watermark",Ne)),me.ended||me.reading?(Ne=!1,v("reading or ended",Ne)):Ne&&(v("do read"),me.reading=!0,me.sync=!0,me.length===0&&(me.needReadable=!0),this._read(me.highWaterMark),me.sync=!1,me.reading||(le=w(xe,me)));var Pe;return le>0?Pe=ae(le,me):Pe=null,Pe===null?(me.needReadable=me.length<=me.highWaterMark,le=0):(me.length-=le,me.awaitDrain=0),me.length===0&&(me.ended||(me.needReadable=!0),xe!==le&&me.ended&&de(this)),Pe!==null&&this.emit("data",Pe),Pe};function x(le,me){if(v("onEofChunk"),!me.ended){if(me.decoder){var xe=me.decoder.end();xe&&xe.length&&(me.buffer.push(xe),me.length+=me.objectMode?1:xe.length)}me.ended=!0,me.sync?P(le):(me.needReadable=!1,me.emittedReadable||(me.emittedReadable=!0,$(le)))}}function P(le){var me=le._readableState;v("emitReadable",me.needReadable,me.emittedReadable),me.needReadable=!1,me.emittedReadable||(v("emitReadable",me.flowing),me.emittedReadable=!0,distExports.process.nextTick($,le))}function $(le){var me=le._readableState;v("emitReadable_",me.destroyed,me.length,me.ended),!me.destroyed&&(me.length||me.ended)&&(le.emit("readable"),me.emittedReadable=!1),me.needReadable=!me.flowing&&!me.ended&&me.length<=me.highWaterMark,he(le)}function T(le,me){me.readingMore||(me.readingMore=!0,distExports.process.nextTick(m,le,me))}function m(le,me){for(;!me.reading&&!me.ended&&(me.length<me.highWaterMark||me.flowing&&me.length===0);){var xe=me.length;if(v("maybeReadMore read 0"),le.read(0),xe===me.length)break}me.readingMore=!1}Q.prototype._read=function(le){U(this,new B("_read()"))},Q.prototype.pipe=function(le,me){var xe=this,Ne=this._readableState;switch(Ne.pipesCount){case 0:Ne.pipes=le;break;case 1:Ne.pipes=[Ne.pipes,le];break;default:Ne.pipes.push(le);break}Ne.pipesCount+=1,v("pipe count=%d opts=%j",Ne.pipesCount,me);var Pe=(!me||me.end!==!1)&&le!==distExports.process.stdout&&le!==distExports.process.stderr,Ie=Pe?Le:Mt;Ne.endEmitted?distExports.process.nextTick(Ie):xe.once("end",Ie),le.on("unpipe",Ke);function Ke(se,j){v("onunpipe"),se===xe&&j&&j.hasUnpiped===!1&&(j.hasUnpiped=!0,Oe())}function Le(){v("onend"),le.end()}var Ce=M(xe);le.on("drain",Ce);var at=!1;function Oe(){v("cleanup"),le.removeListener("close",Ue),le.removeListener("finish",ze),le.removeListener("drain",Ce),le.removeListener("error",yt),le.removeListener("unpipe",Ke),xe.removeListener("end",Le),xe.removeListener("end",Mt),xe.removeListener("data",De),at=!0,Ne.awaitDrain&&(!le._writableState||le._writableState.needDrain)&&Ce()}xe.on("data",De);function De(se){v("ondata");var j=le.write(se);v("dest.write",j),j===!1&&((Ne.pipesCount===1&&Ne.pipes===le||Ne.pipesCount>1&&oe(Ne.pipes,le)!==-1)&&!at&&(v("false write response, pause",Ne.awaitDrain),Ne.awaitDrain++),xe.pause())}function yt(se){v("onerror",se),Mt(),le.removeListener("error",yt),a(le,"error")===0&&U(le,se)}Z(le,"error",yt);function Ue(){le.removeListener("finish",ze),Mt()}le.once("close",Ue);function ze(){v("onfinish"),le.removeListener("close",Ue),Mt()}le.once("finish",ze);function Mt(){v("unpipe"),xe.unpipe(le)}return le.emit("pipe",xe),Ne.flowing||(v("pipe resume"),xe.resume()),le};function M(le){return function(){var xe=le._readableState;v("pipeOnDrain",xe.awaitDrain),xe.awaitDrain&&xe.awaitDrain--,xe.awaitDrain===0&&a(le,"data")&&(xe.flowing=!0,he(le))}}Q.prototype.unpipe=function(le){var me=this._readableState,xe={hasUnpiped:!1};if(me.pipesCount===0)return this;if(me.pipesCount===1)return le&&le!==me.pipes?this:(le||(le=me.pipes),me.pipes=null,me.pipesCount=0,me.flowing=!1,le&&le.emit("unpipe",this,xe),this);if(!le){var Ne=me.pipes,Pe=me.pipesCount;me.pipes=null,me.pipesCount=0,me.flowing=!1;for(var Ie=0;Ie<Pe;Ie++)Ne[Ie].emit("unpipe",this,{hasUnpiped:!1});return this}var Ke=oe(me.pipes,le);return Ke===-1?this:(me.pipes.splice(Ke,1),me.pipesCount-=1,me.pipesCount===1&&(me.pipes=me.pipes[0]),le.emit("unpipe",this,xe),this)},Q.prototype.on=function(le,me){var xe=u.prototype.on.call(this,le,me),Ne=this._readableState;return le==="data"?(Ne.readableListening=this.listenerCount("readable")>0,Ne.flowing!==!1&&this.resume()):le==="readable"&&!Ne.endEmitted&&!Ne.readableListening&&(Ne.readableListening=Ne.needReadable=!0,Ne.flowing=!1,Ne.emittedReadable=!1,v("on readable",Ne.length,Ne.reading),Ne.length?P(this):Ne.reading||distExports.process.nextTick(Y,this)),xe},Q.prototype.addListener=Q.prototype.on,Q.prototype.removeListener=function(le,me){var xe=u.prototype.removeListener.call(this,le,me);return le==="readable"&&distExports.process.nextTick(W,this),xe},Q.prototype.removeAllListeners=function(le){var me=u.prototype.removeAllListeners.apply(this,arguments);return(le==="readable"||le===void 0)&&distExports.process.nextTick(W,this),me};function W(le){var me=le._readableState;me.readableListening=le.listenerCount("readable")>0,me.resumeScheduled&&!me.paused?me.flowing=!0:le.listenerCount("data")>0&&le.resume()}function Y(le){v("readable nexttick read 0"),le.read(0)}Q.prototype.resume=function(){var le=this._readableState;return le.flowing||(v("resume"),le.flowing=!le.readableListening,ue(this,le)),le.paused=!1,this};function ue(le,me){me.resumeScheduled||(me.resumeScheduled=!0,distExports.process.nextTick(ge,le,me))}function ge(le,me){v("resume",me.reading),me.reading||le.read(0),me.resumeScheduled=!1,le.emit("resume"),he(le),me.flowing&&!me.reading&&le.read(0)}Q.prototype.pause=function(){return v("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(v("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function he(le){var me=le._readableState;for(v("flow",me.flowing);me.flowing&&le.read()!==null;);}Q.prototype.wrap=function(le){var me=this,xe=this._readableState,Ne=!1;le.on("end",function(){if(v("wrapped end"),xe.decoder&&!xe.ended){var Ke=xe.decoder.end();Ke&&Ke.length&&me.push(Ke)}me.push(null)}),le.on("data",function(Ke){if(v("wrapped data"),xe.decoder&&(Ke=xe.decoder.write(Ke)),!(xe.objectMode&&Ke==null)&&!(!xe.objectMode&&(!Ke||!Ke.length))){var Le=me.push(Ke);Le||(Ne=!0,le.pause())}});for(var Pe in le)this[Pe]===void 0&&typeof le[Pe]=="function"&&(this[Pe]=function(Le){return function(){return le[Le].apply(le,arguments)}}(Pe));for(var Ie=0;Ie<te.length;Ie++)le.on(te[Ie],this.emit.bind(this,te[Ie]));return this._read=function(Ke){v("wrapped _read",Ke),Ne&&(Ne=!1,le.resume())},this},typeof Symbol=="function"&&(Q.prototype[Symbol.asyncIterator]=function(){return G===void 0&&(G=requireAsync_iterator()),G(this)}),Object.defineProperty(Q.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(Q.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(Q.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(me){this._readableState&&(this._readableState.flowing=me)}}),Q._fromList=ae,Object.defineProperty(Q.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function ae(le,me){if(me.length===0)return null;var xe;return me.objectMode?xe=me.buffer.shift():!le||le>=me.length?(me.decoder?xe=me.buffer.join(""):me.buffer.length===1?xe=me.buffer.first():xe=me.buffer.concat(me.length),me.buffer.clear()):xe=me.buffer.consume(le,me.decoder),xe}function de(le){var me=le._readableState;v("endReadable",me.endEmitted),me.endEmitted||(me.ended=!0,distExports.process.nextTick(pe,me,le))}function pe(le,me){if(v("endReadableNT",le.endEmitted,le.length),!le.endEmitted&&le.length===0&&(le.endEmitted=!0,me.readable=!1,me.emit("end"),le.autoDestroy)){var xe=me._writableState;(!xe||xe.autoDestroy&&xe.finished)&&me.destroy()}}typeof Symbol=="function"&&(Q.from=function(le,me){return V===void 0&&(V=requireFromBrowser()),V(Q,le,me)});function oe(le,me){for(var xe=0,Ne=le.length;xe<Ne;xe++)if(le[xe]===me)return xe;return-1}return _stream_readable$1}var _stream_transform$1,hasRequired_stream_transform$1;function require_stream_transform$1(){if(hasRequired_stream_transform$1)return _stream_transform$1;hasRequired_stream_transform$1=1,_stream_transform$1=p;var s=requireErrorsBrowser().codes,a=s.ERR_METHOD_NOT_IMPLEMENTED,u=s.ERR_MULTIPLE_CALLBACK,l=s.ERR_TRANSFORM_ALREADY_TRANSFORMING,f=s.ERR_TRANSFORM_WITH_LENGTH_0,c=require_stream_duplex$1();requireInherits_browser()(p,c);function h(b,S){var E=this._transformState;E.transforming=!1;var R=E.writecb;if(R===null)return this.emit("error",new u);E.writechunk=null,E.writecb=null,S!=null&&this.push(S),R(b);var O=this._readableState;O.reading=!1,(O.needReadable||O.length<O.highWaterMark)&&this._read(O.highWaterMark)}function p(b){if(!(this instanceof p))return new p(b);c.call(this,b),this._transformState={afterTransform:h.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,b&&(typeof b.transform=="function"&&(this._transform=b.transform),typeof b.flush=="function"&&(this._flush=b.flush)),this.on("prefinish",v)}function v(){var b=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(S,E){y(b,S,E)}):y(this,null,null)}p.prototype.push=function(b,S){return this._transformState.needTransform=!1,c.prototype.push.call(this,b,S)},p.prototype._transform=function(b,S,E){E(new a("_transform()"))},p.prototype._write=function(b,S,E){var R=this._transformState;if(R.writecb=E,R.writechunk=b,R.writeencoding=S,!R.transforming){var O=this._readableState;(R.needTransform||O.needReadable||O.length<O.highWaterMark)&&this._read(O.highWaterMark)}},p.prototype._read=function(b){var S=this._transformState;S.writechunk!==null&&!S.transforming?(S.transforming=!0,this._transform(S.writechunk,S.writeencoding,S.afterTransform)):S.needTransform=!0},p.prototype._destroy=function(b,S){c.prototype._destroy.call(this,b,function(E){S(E)})};function y(b,S,E){if(S)return b.emit("error",S);if(E!=null&&b.push(E),b._writableState.length)throw new f;if(b._transformState.transforming)throw new l;return b.push(null)}return _stream_transform$1}var _stream_passthrough$1,hasRequired_stream_passthrough$1;function require_stream_passthrough$1(){if(hasRequired_stream_passthrough$1)return _stream_passthrough$1;hasRequired_stream_passthrough$1=1,_stream_passthrough$1=a;var s=require_stream_transform$1();requireInherits_browser()(a,s);function a(u){if(!(this instanceof a))return new a(u);s.call(this,u)}return a.prototype._transform=function(u,l,f){f(null,u)},_stream_passthrough$1}var pipeline_1,hasRequiredPipeline;function requirePipeline(){if(hasRequiredPipeline)return pipeline_1;hasRequiredPipeline=1;var s;function a(E){var R=!1;return function(){R||(R=!0,E.apply(void 0,arguments))}}var u=requireErrorsBrowser().codes,l=u.ERR_MISSING_ARGS,f=u.ERR_STREAM_DESTROYED;function c(E){if(E)throw E}function h(E){return E.setHeader&&typeof E.abort=="function"}function p(E,R,O,I){I=a(I);var B=!1;E.on("close",function(){B=!0}),s===void 0&&(s=requireEndOfStream()),s(E,{readable:R,writable:O},function(D){if(D)return I(D);B=!0,I()});var N=!1;return function(D){if(!B&&!N){if(N=!0,h(E))return E.abort();if(typeof E.destroy=="function")return E.destroy();I(D||new f("pipe"))}}}function v(E){E()}function y(E,R){return E.pipe(R)}function b(E){return!E.length||typeof E[E.length-1]!="function"?c:E.pop()}function S(){for(var E=arguments.length,R=new Array(E),O=0;O<E;O++)R[O]=arguments[O];var I=b(R);if(Array.isArray(R[0])&&(R=R[0]),R.length<2)throw new l("streams");var B,N=R.map(function(D,G){var V=G<R.length-1,U=G>0;return p(D,V,U,function(te){B||(B=te),te&&N.forEach(v),!V&&(N.forEach(v),I(B))})});return R.reduce(y)}return pipeline_1=S,pipeline_1}var hasRequiredReadableBrowser$1;function requireReadableBrowser$1(){return hasRequiredReadableBrowser$1||(hasRequiredReadableBrowser$1=1,function(s,a){a=s.exports=require_stream_readable$1(),a.Stream=a,a.Readable=a,a.Writable=require_stream_writable$1(),a.Duplex=require_stream_duplex$1(),a.Transform=require_stream_transform$1(),a.PassThrough=require_stream_passthrough$1(),a.finished=requireEndOfStream(),a.pipeline=requirePipeline()}(readableBrowser$1,readableBrowser$1.exports)),readableBrowser$1.exports}var hashBase$1,hasRequiredHashBase$1;function requireHashBase$1(){if(hasRequiredHashBase$1)return hashBase$1;hasRequiredHashBase$1=1;var s=requireSafeBuffer$2().Buffer,a=requireReadableBrowser$1().Transform,u=requireInherits_browser();function l(c,h){if(!s.isBuffer(c)&&typeof c!="string")throw new TypeError(h+" must be a string or a buffer")}function f(c){a.call(this),this._block=s.allocUnsafe(c),this._blockSize=c,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}return u(f,a),f.prototype._transform=function(c,h,p){var v=null;try{this.update(c,h)}catch(y){v=y}p(v)},f.prototype._flush=function(c){var h=null;try{this.push(this.digest())}catch(p){h=p}c(h)},f.prototype.update=function(c,h){if(l(c,"Data"),this._finalized)throw new Error("Digest already called");s.isBuffer(c)||(c=s.from(c,h));for(var p=this._block,v=0;this._blockOffset+c.length-v>=this._blockSize;){for(var y=this._blockOffset;y<this._blockSize;)p[y++]=c[v++];this._update(),this._blockOffset=0}for(;v<c.length;)p[this._blockOffset++]=c[v++];for(var b=0,S=c.length*8;S>0;++b)this._length[b]+=S,S=this._length[b]/4294967296|0,S>0&&(this._length[b]-=4294967296*S);return this},f.prototype._update=function(){throw new Error("_update is not implemented")},f.prototype.digest=function(c){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var h=this._digest();c!==void 0&&(h=h.toString(c)),this._block.fill(0),this._blockOffset=0;for(var p=0;p<4;++p)this._length[p]=0;return h},f.prototype._digest=function(){throw new Error("_digest is not implemented")},hashBase$1=f,hashBase$1}var md5_js,hasRequiredMd5_js;function requireMd5_js(){if(hasRequiredMd5_js)return md5_js;hasRequiredMd5_js=1;var s=requireInherits_browser(),a=requireHashBase$1(),u=requireSafeBuffer$2().Buffer,l=new Array(16);function f(){a.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}s(f,a),f.prototype._update=function(){for(var b=l,S=0;S<16;++S)b[S]=this._block.readInt32LE(S*4);var E=this._a,R=this._b,O=this._c,I=this._d;E=h(E,R,O,I,b[0],3614090360,7),I=h(I,E,R,O,b[1],3905402710,12),O=h(O,I,E,R,b[2],606105819,17),R=h(R,O,I,E,b[3],3250441966,22),E=h(E,R,O,I,b[4],4118548399,7),I=h(I,E,R,O,b[5],1200080426,12),O=h(O,I,E,R,b[6],2821735955,17),R=h(R,O,I,E,b[7],4249261313,22),E=h(E,R,O,I,b[8],1770035416,7),I=h(I,E,R,O,b[9],2336552879,12),O=h(O,I,E,R,b[10],4294925233,17),R=h(R,O,I,E,b[11],2304563134,22),E=h(E,R,O,I,b[12],1804603682,7),I=h(I,E,R,O,b[13],4254626195,12),O=h(O,I,E,R,b[14],2792965006,17),R=h(R,O,I,E,b[15],1236535329,22),E=p(E,R,O,I,b[1],4129170786,5),I=p(I,E,R,O,b[6],3225465664,9),O=p(O,I,E,R,b[11],643717713,14),R=p(R,O,I,E,b[0],3921069994,20),E=p(E,R,O,I,b[5],3593408605,5),I=p(I,E,R,O,b[10],38016083,9),O=p(O,I,E,R,b[15],3634488961,14),R=p(R,O,I,E,b[4],3889429448,20),E=p(E,R,O,I,b[9],568446438,5),I=p(I,E,R,O,b[14],3275163606,9),O=p(O,I,E,R,b[3],4107603335,14),R=p(R,O,I,E,b[8],1163531501,20),E=p(E,R,O,I,b[13],2850285829,5),I=p(I,E,R,O,b[2],4243563512,9),O=p(O,I,E,R,b[7],1735328473,14),R=p(R,O,I,E,b[12],2368359562,20),E=v(E,R,O,I,b[5],4294588738,4),I=v(I,E,R,O,b[8],2272392833,11),O=v(O,I,E,R,b[11],1839030562,16),R=v(R,O,I,E,b[14],4259657740,23),E=v(E,R,O,I,b[1],2763975236,4),I=v(I,E,R,O,b[4],1272893353,11),O=v(O,I,E,R,b[7],4139469664,16),R=v(R,O,I,E,b[10],3200236656,23),E=v(E,R,O,I,b[13],681279174,4),I=v(I,E,R,O,b[0],3936430074,11),O=v(O,I,E,R,b[3],3572445317,16),R=v(R,O,I,E,b[6],76029189,23),E=v(E,R,O,I,b[9],3654602809,4),I=v(I,E,R,O,b[12],3873151461,11),O=v(O,I,E,R,b[15],530742520,16),R=v(R,O,I,E,b[2],3299628645,23),E=y(E,R,O,I,b[0],4096336452,6),I=y(I,E,R,O,b[7],1126891415,10),O=y(O,I,E,R,b[14],2878612391,15),R=y(R,O,I,E,b[5],4237533241,21),E=y(E,R,O,I,b[12],1700485571,6),I=y(I,E,R,O,b[3],2399980690,10),O=y(O,I,E,R,b[10],4293915773,15),R=y(R,O,I,E,b[1],2240044497,21),E=y(E,R,O,I,b[8],1873313359,6),I=y(I,E,R,O,b[15],4264355552,10),O=y(O,I,E,R,b[6],2734768916,15),R=y(R,O,I,E,b[13],1309151649,21),E=y(E,R,O,I,b[4],4149444226,6),I=y(I,E,R,O,b[11],3174756917,10),O=y(O,I,E,R,b[2],718787259,15),R=y(R,O,I,E,b[9],3951481745,21),this._a=this._a+E|0,this._b=this._b+R|0,this._c=this._c+O|0,this._d=this._d+I|0},f.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var b=u.allocUnsafe(16);return b.writeInt32LE(this._a,0),b.writeInt32LE(this._b,4),b.writeInt32LE(this._c,8),b.writeInt32LE(this._d,12),b};function c(b,S){return b<<S|b>>>32-S}function h(b,S,E,R,O,I,B){return c(b+(S&E|~S&R)+O+I|0,B)+S|0}function p(b,S,E,R,O,I,B){return c(b+(S&R|E&~R)+O+I|0,B)+S|0}function v(b,S,E,R,O,I,B){return c(b+(S^E^R)+O+I|0,B)+S|0}function y(b,S,E,R,O,I,B){return c(b+(E^(S|~R))+O+I|0,B)+S|0}return md5_js=f,md5_js}var hashBase,hasRequiredHashBase;function requireHashBase(){if(hasRequiredHashBase)return hashBase;hasRequiredHashBase=1;var s=requireSafeBuffer$2().Buffer,a=requireReadableBrowser$1().Transform,u=requireInherits_browser();function l(c,h){if(!s.isBuffer(c)&&typeof c!="string")throw new TypeError(h+" must be a string or a buffer")}function f(c){a.call(this),this._block=s.allocUnsafe(c),this._blockSize=c,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}return u(f,a),f.prototype._transform=function(c,h,p){var v=null;try{this.update(c,h)}catch(y){v=y}p(v)},f.prototype._flush=function(c){var h=null;try{this.push(this.digest())}catch(p){h=p}c(h)},f.prototype.update=function(c,h){if(l(c,"Data"),this._finalized)throw new Error("Digest already called");s.isBuffer(c)||(c=s.from(c,h));for(var p=this._block,v=0;this._blockOffset+c.length-v>=this._blockSize;){for(var y=this._blockOffset;y<this._blockSize;)p[y++]=c[v++];this._update(),this._blockOffset=0}for(;v<c.length;)p[this._blockOffset++]=c[v++];for(var b=0,S=c.length*8;S>0;++b)this._length[b]+=S,S=this._length[b]/4294967296|0,S>0&&(this._length[b]-=4294967296*S);return this},f.prototype._update=function(){throw new Error("_update is not implemented")},f.prototype.digest=function(c){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var h=this._digest();c!==void 0&&(h=h.toString(c)),this._block.fill(0),this._blockOffset=0;for(var p=0;p<4;++p)this._length[p]=0;return h},f.prototype._digest=function(){throw new Error("_digest is not implemented")},hashBase=f,hashBase}var ripemd160,hasRequiredRipemd160;function requireRipemd160(){if(hasRequiredRipemd160)return ripemd160;hasRequiredRipemd160=1;var s=requireBuffer$1().Buffer,a=requireInherits_browser(),u=requireHashBase(),l=new Array(16),f=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],c=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],h=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],p=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],v=[0,1518500249,1859775393,2400959708,2840853838],y=[1352829926,1548603684,1836072691,2053994217,0];function b(){u.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}a(b,u),b.prototype._update=function(){for(var N=l,D=0;D<16;++D)N[D]=this._block.readInt32LE(D*4);for(var G=this._a|0,V=this._b|0,U=this._c|0,te=this._d|0,Z=this._e|0,J=this._a|0,Q=this._b|0,ee=this._c|0,k=this._d|0,d=this._e|0,g=0;g<80;g+=1){var _,w;g<16?(_=E(G,V,U,te,Z,N[f[g]],v[0],h[g]),w=B(J,Q,ee,k,d,N[c[g]],y[0],p[g])):g<32?(_=R(G,V,U,te,Z,N[f[g]],v[1],h[g]),w=I(J,Q,ee,k,d,N[c[g]],y[1],p[g])):g<48?(_=O(G,V,U,te,Z,N[f[g]],v[2],h[g]),w=O(J,Q,ee,k,d,N[c[g]],y[2],p[g])):g<64?(_=I(G,V,U,te,Z,N[f[g]],v[3],h[g]),w=R(J,Q,ee,k,d,N[c[g]],y[3],p[g])):(_=B(G,V,U,te,Z,N[f[g]],v[4],h[g]),w=E(J,Q,ee,k,d,N[c[g]],y[4],p[g])),G=Z,Z=te,te=S(U,10),U=V,V=_,J=d,d=k,k=S(ee,10),ee=Q,Q=w}var x=this._b+U+k|0;this._b=this._c+te+d|0,this._c=this._d+Z+J|0,this._d=this._e+G+Q|0,this._e=this._a+V+ee|0,this._a=x},b.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var N=s.alloc?s.alloc(20):new s(20);return N.writeInt32LE(this._a,0),N.writeInt32LE(this._b,4),N.writeInt32LE(this._c,8),N.writeInt32LE(this._d,12),N.writeInt32LE(this._e,16),N};function S(N,D){return N<<D|N>>>32-D}function E(N,D,G,V,U,te,Z,J){return S(N+(D^G^V)+te+Z|0,J)+U|0}function R(N,D,G,V,U,te,Z,J){return S(N+(D&G|~D&V)+te+Z|0,J)+U|0}function O(N,D,G,V,U,te,Z,J){return S(N+((D|~G)^V)+te+Z|0,J)+U|0}function I(N,D,G,V,U,te,Z,J){return S(N+(D&V|G&~V)+te+Z|0,J)+U|0}function B(N,D,G,V,U,te,Z,J){return S(N+(D^(G|~V))+te+Z|0,J)+U|0}return ripemd160=b,ripemd160}var sha_js={exports:{}},hash$3,hasRequiredHash$2;function requireHash$2(){if(hasRequiredHash$2)return hash$3;hasRequiredHash$2=1;var s=requireSafeBuffer$2().Buffer;function a(u,l){this._block=s.alloc(u),this._finalSize=l,this._blockSize=u,this._len=0}return a.prototype.update=function(u,l){typeof u=="string"&&(l=l||"utf8",u=s.from(u,l));for(var f=this._block,c=this._blockSize,h=u.length,p=this._len,v=0;v<h;){for(var y=p%c,b=Math.min(h-v,c-y),S=0;S<b;S++)f[y+S]=u[v+S];p+=b,v+=b,p%c===0&&this._update(f)}return this._len+=h,this},a.prototype.digest=function(u){var l=this._len%this._blockSize;this._block[l]=128,this._block.fill(0,l+1),l>=this._finalSize&&(this._update(this._block),this._block.fill(0));var f=this._len*8;if(f<=4294967295)this._block.writeUInt32BE(f,this._blockSize-4);else{var c=(f&4294967295)>>>0,h=(f-c)/4294967296;this._block.writeUInt32BE(h,this._blockSize-8),this._block.writeUInt32BE(c,this._blockSize-4)}this._update(this._block);var p=this._hash();return u?p.toString(u):p},a.prototype._update=function(){throw new Error("_update must be implemented by subclass")},hash$3=a,hash$3}var sha$1,hasRequiredSha$1;function requireSha$1(){if(hasRequiredSha$1)return sha$1;hasRequiredSha$1=1;var s=requireInherits_browser(),a=requireHash$2(),u=requireSafeBuffer$2().Buffer,l=[1518500249,1859775393,-1894007588,-899497514],f=new Array(80);function c(){this.init(),this._w=f,a.call(this,64,56)}s(c,a),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function h(y){return y<<5|y>>>27}function p(y){return y<<30|y>>>2}function v(y,b,S,E){return y===0?b&S|~b&E:y===2?b&S|b&E|S&E:b^S^E}return c.prototype._update=function(y){for(var b=this._w,S=this._a|0,E=this._b|0,R=this._c|0,O=this._d|0,I=this._e|0,B=0;B<16;++B)b[B]=y.readInt32BE(B*4);for(;B<80;++B)b[B]=b[B-3]^b[B-8]^b[B-14]^b[B-16];for(var N=0;N<80;++N){var D=~~(N/20),G=h(S)+v(D,E,R,O)+I+b[N]+l[D]|0;I=O,O=R,R=p(E),E=S,S=G}this._a=S+this._a|0,this._b=E+this._b|0,this._c=R+this._c|0,this._d=O+this._d|0,this._e=I+this._e|0},c.prototype._hash=function(){var y=u.allocUnsafe(20);return y.writeInt32BE(this._a|0,0),y.writeInt32BE(this._b|0,4),y.writeInt32BE(this._c|0,8),y.writeInt32BE(this._d|0,12),y.writeInt32BE(this._e|0,16),y},sha$1=c,sha$1}var sha1,hasRequiredSha1;function requireSha1(){if(hasRequiredSha1)return sha1;hasRequiredSha1=1;var s=requireInherits_browser(),a=requireHash$2(),u=requireSafeBuffer$2().Buffer,l=[1518500249,1859775393,-1894007588,-899497514],f=new Array(80);function c(){this.init(),this._w=f,a.call(this,64,56)}s(c,a),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function h(b){return b<<1|b>>>31}function p(b){return b<<5|b>>>27}function v(b){return b<<30|b>>>2}function y(b,S,E,R){return b===0?S&E|~S&R:b===2?S&E|S&R|E&R:S^E^R}return c.prototype._update=function(b){for(var S=this._w,E=this._a|0,R=this._b|0,O=this._c|0,I=this._d|0,B=this._e|0,N=0;N<16;++N)S[N]=b.readInt32BE(N*4);for(;N<80;++N)S[N]=h(S[N-3]^S[N-8]^S[N-14]^S[N-16]);for(var D=0;D<80;++D){var G=~~(D/20),V=p(E)+y(G,R,O,I)+B+S[D]+l[G]|0;B=I,I=O,O=v(R),R=E,E=V}this._a=E+this._a|0,this._b=R+this._b|0,this._c=O+this._c|0,this._d=I+this._d|0,this._e=B+this._e|0},c.prototype._hash=function(){var b=u.allocUnsafe(20);return b.writeInt32BE(this._a|0,0),b.writeInt32BE(this._b|0,4),b.writeInt32BE(this._c|0,8),b.writeInt32BE(this._d|0,12),b.writeInt32BE(this._e|0,16),b},sha1=c,sha1}var sha256$3,hasRequiredSha256$1;function requireSha256$1(){if(hasRequiredSha256$1)return sha256$3;hasRequiredSha256$1=1;var s=requireInherits_browser(),a=requireHash$2(),u=requireSafeBuffer$2().Buffer,l=[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],f=new Array(64);function c(){this.init(),this._w=f,a.call(this,64,56)}s(c,a),c.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function h(E,R,O){return O^E&(R^O)}function p(E,R,O){return E&R|O&(E|R)}function v(E){return(E>>>2|E<<30)^(E>>>13|E<<19)^(E>>>22|E<<10)}function y(E){return(E>>>6|E<<26)^(E>>>11|E<<21)^(E>>>25|E<<7)}function b(E){return(E>>>7|E<<25)^(E>>>18|E<<14)^E>>>3}function S(E){return(E>>>17|E<<15)^(E>>>19|E<<13)^E>>>10}return c.prototype._update=function(E){for(var R=this._w,O=this._a|0,I=this._b|0,B=this._c|0,N=this._d|0,D=this._e|0,G=this._f|0,V=this._g|0,U=this._h|0,te=0;te<16;++te)R[te]=E.readInt32BE(te*4);for(;te<64;++te)R[te]=S(R[te-2])+R[te-7]+b(R[te-15])+R[te-16]|0;for(var Z=0;Z<64;++Z){var J=U+y(D)+h(D,G,V)+l[Z]+R[Z]|0,Q=v(O)+p(O,I,B)|0;U=V,V=G,G=D,D=N+J|0,N=B,B=I,I=O,O=J+Q|0}this._a=O+this._a|0,this._b=I+this._b|0,this._c=B+this._c|0,this._d=N+this._d|0,this._e=D+this._e|0,this._f=G+this._f|0,this._g=V+this._g|0,this._h=U+this._h|0},c.prototype._hash=function(){var E=u.allocUnsafe(32);return E.writeInt32BE(this._a,0),E.writeInt32BE(this._b,4),E.writeInt32BE(this._c,8),E.writeInt32BE(this._d,12),E.writeInt32BE(this._e,16),E.writeInt32BE(this._f,20),E.writeInt32BE(this._g,24),E.writeInt32BE(this._h,28),E},sha256$3=c,sha256$3}var sha224$1,hasRequiredSha224;function requireSha224(){if(hasRequiredSha224)return sha224$1;hasRequiredSha224=1;var s=requireInherits_browser(),a=requireSha256$1(),u=requireHash$2(),l=requireSafeBuffer$2().Buffer,f=new Array(64);function c(){this.init(),this._w=f,u.call(this,64,56)}return s(c,a),c.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},c.prototype._hash=function(){var h=l.allocUnsafe(28);return h.writeInt32BE(this._a,0),h.writeInt32BE(this._b,4),h.writeInt32BE(this._c,8),h.writeInt32BE(this._d,12),h.writeInt32BE(this._e,16),h.writeInt32BE(this._f,20),h.writeInt32BE(this._g,24),h},sha224$1=c,sha224$1}var sha512$4,hasRequiredSha512$2;function requireSha512$2(){if(hasRequiredSha512$2)return sha512$4;hasRequiredSha512$2=1;var s=requireInherits_browser(),a=requireHash$2(),u=requireSafeBuffer$2().Buffer,l=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],f=new Array(160);function c(){this.init(),this._w=f,a.call(this,128,112)}s(c,a),c.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function h(I,B,N){return N^I&(B^N)}function p(I,B,N){return I&B|N&(I|B)}function v(I,B){return(I>>>28|B<<4)^(B>>>2|I<<30)^(B>>>7|I<<25)}function y(I,B){return(I>>>14|B<<18)^(I>>>18|B<<14)^(B>>>9|I<<23)}function b(I,B){return(I>>>1|B<<31)^(I>>>8|B<<24)^I>>>7}function S(I,B){return(I>>>1|B<<31)^(I>>>8|B<<24)^(I>>>7|B<<25)}function E(I,B){return(I>>>19|B<<13)^(B>>>29|I<<3)^I>>>6}function R(I,B){return(I>>>19|B<<13)^(B>>>29|I<<3)^(I>>>6|B<<26)}function O(I,B){return I>>>0<B>>>0?1:0}return c.prototype._update=function(I){for(var B=this._w,N=this._ah|0,D=this._bh|0,G=this._ch|0,V=this._dh|0,U=this._eh|0,te=this._fh|0,Z=this._gh|0,J=this._hh|0,Q=this._al|0,ee=this._bl|0,k=this._cl|0,d=this._dl|0,g=this._el|0,_=this._fl|0,w=this._gl|0,x=this._hl|0,P=0;P<32;P+=2)B[P]=I.readInt32BE(P*4),B[P+1]=I.readInt32BE(P*4+4);for(;P<160;P+=2){var $=B[P-30],T=B[P-15*2+1],m=b($,T),M=S(T,$);$=B[P-2*2],T=B[P-2*2+1];var W=E($,T),Y=R(T,$),ue=B[P-7*2],ge=B[P-7*2+1],he=B[P-16*2],ae=B[P-16*2+1],de=M+ge|0,pe=m+ue+O(de,M)|0;de=de+Y|0,pe=pe+W+O(de,Y)|0,de=de+ae|0,pe=pe+he+O(de,ae)|0,B[P]=pe,B[P+1]=de}for(var oe=0;oe<160;oe+=2){pe=B[oe],de=B[oe+1];var le=p(N,D,G),me=p(Q,ee,k),xe=v(N,Q),Ne=v(Q,N),Pe=y(U,g),Ie=y(g,U),Ke=l[oe],Le=l[oe+1],Ce=h(U,te,Z),at=h(g,_,w),Oe=x+Ie|0,De=J+Pe+O(Oe,x)|0;Oe=Oe+at|0,De=De+Ce+O(Oe,at)|0,Oe=Oe+Le|0,De=De+Ke+O(Oe,Le)|0,Oe=Oe+de|0,De=De+pe+O(Oe,de)|0;var yt=Ne+me|0,Ue=xe+le+O(yt,Ne)|0;J=Z,x=w,Z=te,w=_,te=U,_=g,g=d+Oe|0,U=V+De+O(g,d)|0,V=G,d=k,G=D,k=ee,D=N,ee=Q,Q=Oe+yt|0,N=De+Ue+O(Q,Oe)|0}this._al=this._al+Q|0,this._bl=this._bl+ee|0,this._cl=this._cl+k|0,this._dl=this._dl+d|0,this._el=this._el+g|0,this._fl=this._fl+_|0,this._gl=this._gl+w|0,this._hl=this._hl+x|0,this._ah=this._ah+N+O(this._al,Q)|0,this._bh=this._bh+D+O(this._bl,ee)|0,this._ch=this._ch+G+O(this._cl,k)|0,this._dh=this._dh+V+O(this._dl,d)|0,this._eh=this._eh+U+O(this._el,g)|0,this._fh=this._fh+te+O(this._fl,_)|0,this._gh=this._gh+Z+O(this._gl,w)|0,this._hh=this._hh+J+O(this._hl,x)|0},c.prototype._hash=function(){var I=u.allocUnsafe(64);function B(N,D,G){I.writeInt32BE(N,G),I.writeInt32BE(D,G+4)}return B(this._ah,this._al,0),B(this._bh,this._bl,8),B(this._ch,this._cl,16),B(this._dh,this._dl,24),B(this._eh,this._el,32),B(this._fh,this._fl,40),B(this._gh,this._gl,48),B(this._hh,this._hl,56),I},sha512$4=c,sha512$4}var sha384$1,hasRequiredSha384;function requireSha384(){if(hasRequiredSha384)return sha384$1;hasRequiredSha384=1;var s=requireInherits_browser(),a=requireSha512$2(),u=requireHash$2(),l=requireSafeBuffer$2().Buffer,f=new Array(160);function c(){this.init(),this._w=f,u.call(this,128,112)}return s(c,a),c.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},c.prototype._hash=function(){var h=l.allocUnsafe(48);function p(v,y,b){h.writeInt32BE(v,b),h.writeInt32BE(y,b+4)}return p(this._ah,this._al,0),p(this._bh,this._bl,8),p(this._ch,this._cl,16),p(this._dh,this._dl,24),p(this._eh,this._el,32),p(this._fh,this._fl,40),h},sha384$1=c,sha384$1}var hasRequiredSha_js;function requireSha_js(){if(hasRequiredSha_js)return sha_js.exports;hasRequiredSha_js=1;var s=sha_js.exports=function(u){u=u.toLowerCase();var l=s[u];if(!l)throw new Error(u+" is not supported (we accept pull requests)");return new l};return s.sha=requireSha$1(),s.sha1=requireSha1(),s.sha224=requireSha224(),s.sha256=requireSha256$1(),s.sha384=requireSha384(),s.sha512=requireSha512$2(),sha_js.exports}var streamBrowserify,hasRequiredStreamBrowserify;function requireStreamBrowserify(){if(hasRequiredStreamBrowserify)return streamBrowserify;hasRequiredStreamBrowserify=1,streamBrowserify=u;var s=requireEvents().EventEmitter,a=requireInherits_browser();a(u,s),u.Readable=require_stream_readable$1(),u.Writable=require_stream_writable$1(),u.Duplex=require_stream_duplex$1(),u.Transform=require_stream_transform$1(),u.PassThrough=require_stream_passthrough$1(),u.finished=requireEndOfStream(),u.pipeline=requirePipeline(),u.Stream=u;function u(){s.call(this)}return u.prototype.pipe=function(l,f){var c=this;function h(R){l.writable&&l.write(R)===!1&&c.pause&&c.pause()}c.on("data",h);function p(){c.readable&&c.resume&&c.resume()}l.on("drain",p),!l._isStdio&&(!f||f.end!==!1)&&(c.on("end",y),c.on("close",b));var v=!1;function y(){v||(v=!0,l.end())}function b(){v||(v=!0,typeof l.destroy=="function"&&l.destroy())}function S(R){if(E(),s.listenerCount(this,"error")===0)throw R}c.on("error",S),l.on("error",S);function E(){c.removeListener("data",h),l.removeListener("drain",p),c.removeListener("end",y),c.removeListener("close",b),c.removeListener("error",S),l.removeListener("error",S),c.removeListener("end",E),c.removeListener("close",E),l.removeListener("close",E)}return c.on("end",E),c.on("close",E),l.on("close",E),l.emit("pipe",c),l},streamBrowserify}var cipherBase,hasRequiredCipherBase;function requireCipherBase(){if(hasRequiredCipherBase)return cipherBase;hasRequiredCipherBase=1;var s=requireSafeBuffer$2().Buffer,a=requireStreamBrowserify().Transform,u=requireString_decoder$1().StringDecoder,l=requireInherits_browser();function f(c){a.call(this),this.hashMode=typeof c=="string",this.hashMode?this[c]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}return l(f,a),f.prototype.update=function(c,h,p){typeof c=="string"&&(c=s.from(c,h));var v=this._update(c);return this.hashMode?this:(p&&(v=this._toString(v,p)),v)},f.prototype.setAutoPadding=function(){},f.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},f.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},f.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},f.prototype._transform=function(c,h,p){var v;try{this.hashMode?this._update(c):this.push(this._update(c))}catch(y){v=y}finally{p(v)}},f.prototype._flush=function(c){var h;try{this.push(this.__final())}catch(p){h=p}c(h)},f.prototype._finalOrDigest=function(c){var h=this.__final()||s.alloc(0);return c&&(h=this._toString(h,c,!0)),h},f.prototype._toString=function(c,h,p){if(this._decoder||(this._decoder=new u(h),this._encoding=h),this._encoding!==h)throw new Error("can't switch encodings");var v=this._decoder.write(c);return p&&(v+=this._decoder.end()),v},cipherBase=f,cipherBase}var browser$9,hasRequiredBrowser$9;function requireBrowser$9(){if(hasRequiredBrowser$9)return browser$9;hasRequiredBrowser$9=1;var s=requireInherits_browser(),a=requireMd5_js(),u=requireRipemd160(),l=requireSha_js(),f=requireCipherBase();function c(h){f.call(this,"digest"),this._hash=h}return s(c,f),c.prototype._update=function(h){this._hash.update(h)},c.prototype._final=function(){return this._hash.digest()},browser$9=function(p){return p=p.toLowerCase(),p==="md5"?new a:p==="rmd160"||p==="ripemd160"?new u:new c(l(p))},browser$9}var legacy$1,hasRequiredLegacy$1;function requireLegacy$1(){if(hasRequiredLegacy$1)return legacy$1;hasRequiredLegacy$1=1;var s=requireInherits_browser(),a=requireSafeBuffer$2().Buffer,u=requireCipherBase(),l=a.alloc(128),f=64;function c(h,p){u.call(this,"digest"),typeof p=="string"&&(p=a.from(p)),this._alg=h,this._key=p,p.length>f?p=h(p):p.length<f&&(p=a.concat([p,l],f));for(var v=this._ipad=a.allocUnsafe(f),y=this._opad=a.allocUnsafe(f),b=0;b<f;b++)v[b]=p[b]^54,y[b]=p[b]^92;this._hash=[v]}return s(c,u),c.prototype._update=function(h){this._hash.push(h)},c.prototype._final=function(){var h=this._alg(a.concat(this._hash));return this._alg(a.concat([this._opad,h]))},legacy$1=c,legacy$1}var md5,hasRequiredMd5;function requireMd5(){if(hasRequiredMd5)return md5;hasRequiredMd5=1;var s=requireMd5_js();return md5=function(a){return new s().update(a).digest()},md5}var browser$8,hasRequiredBrowser$8;function requireBrowser$8(){if(hasRequiredBrowser$8)return browser$8;hasRequiredBrowser$8=1;var s=requireInherits_browser(),a=requireLegacy$1(),u=requireCipherBase(),l=requireSafeBuffer$2().Buffer,f=requireMd5(),c=requireRipemd160(),h=requireSha_js(),p=l.alloc(128);function v(y,b){u.call(this,"digest"),typeof b=="string"&&(b=l.from(b));var S=y==="sha512"||y==="sha384"?128:64;if(this._alg=y,this._key=b,b.length>S){var E=y==="rmd160"?new c:h(y);b=E.update(b).digest()}else b.length<S&&(b=l.concat([b,p],S));for(var R=this._ipad=l.allocUnsafe(S),O=this._opad=l.allocUnsafe(S),I=0;I<S;I++)R[I]=b[I]^54,O[I]=b[I]^92;this._hash=y==="rmd160"?new c:h(y),this._hash.update(R)}return s(v,u),v.prototype._update=function(y){this._hash.update(y)},v.prototype._final=function(){var y=this._hash.digest(),b=this._alg==="rmd160"?new c:h(this._alg);return b.update(this._opad).update(y).digest()},browser$8=function(b,S){return b=b.toLowerCase(),b==="rmd160"||b==="ripemd160"?new v("rmd160",S):b==="md5"?new a(f,S):new v(b,S)},browser$8}const sha224WithRSAEncryption={sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption={sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption={sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption={sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},sha256$2={sign:"ecdsa",hash:"sha256",id:""},sha224={sign:"ecdsa",hash:"sha224",id:""},sha384={sign:"ecdsa",hash:"sha384",id:""},sha512$3={sign:"ecdsa",hash:"sha512",id:""},DSA={sign:"dsa",hash:"sha1",id:""},ripemd160WithRSA={sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption={sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},require$$6$1={sha224WithRSAEncryption,"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption,"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption,"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption,"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:sha256$2,sha224,sha384,sha512:sha512$3,"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA,"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA,"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption,"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}};var algos,hasRequiredAlgos;function requireAlgos(){return hasRequiredAlgos||(hasRequiredAlgos=1,algos=require$$6$1),algos}var browser$7={},precondition,hasRequiredPrecondition;function requirePrecondition(){if(hasRequiredPrecondition)return precondition;hasRequiredPrecondition=1;var s=Math.pow(2,30)-1;return precondition=function(a,u){if(typeof a!="number")throw new TypeError("Iterations not a number");if(a<0)throw new TypeError("Bad iterations");if(typeof u!="number")throw new TypeError("Key length not a number");if(u<0||u>s||u!==u)throw new TypeError("Bad key length")},precondition}var defaultEncoding_1,hasRequiredDefaultEncoding;function requireDefaultEncoding(){if(hasRequiredDefaultEncoding)return defaultEncoding_1;hasRequiredDefaultEncoding=1;var s;if(commonjsGlobal.process&&commonjsGlobal.process.browser)s="utf-8";else if(commonjsGlobal.process&&commonjsGlobal.process.version){var a=parseInt(distExports.process.version.split(".")[0].slice(1),10);s=a>=6?"utf-8":"binary"}else s="utf-8";return defaultEncoding_1=s,defaultEncoding_1}var toBuffer$1,hasRequiredToBuffer;function requireToBuffer(){if(hasRequiredToBuffer)return toBuffer$1;hasRequiredToBuffer=1;var s=requireSafeBuffer$2().Buffer;return toBuffer$1=function(a,u,l){if(s.isBuffer(a))return a;if(typeof a=="string")return s.from(a,u);if(ArrayBuffer.isView(a))return s.from(a.buffer);throw new TypeError(l+" must be a string, a Buffer, a typed array or a DataView")},toBuffer$1}var syncBrowser,hasRequiredSyncBrowser;function requireSyncBrowser(){if(hasRequiredSyncBrowser)return syncBrowser;hasRequiredSyncBrowser=1;var s=requireMd5(),a=requireRipemd160(),u=requireSha_js(),l=requireSafeBuffer$2().Buffer,f=requirePrecondition(),c=requireDefaultEncoding(),h=requireToBuffer(),p=l.alloc(128),v={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function y(E,R,O){var I=b(E),B=E==="sha512"||E==="sha384"?128:64;R.length>B?R=I(R):R.length<B&&(R=l.concat([R,p],B));for(var N=l.allocUnsafe(B+v[E]),D=l.allocUnsafe(B+v[E]),G=0;G<B;G++)N[G]=R[G]^54,D[G]=R[G]^92;var V=l.allocUnsafe(B+O+4);N.copy(V,0,0,B),this.ipad1=V,this.ipad2=N,this.opad=D,this.alg=E,this.blocksize=B,this.hash=I,this.size=v[E]}y.prototype.run=function(E,R){E.copy(R,this.blocksize);var O=this.hash(R);return O.copy(this.opad,this.blocksize),this.hash(this.opad)};function b(E){function R(I){return u(E).update(I).digest()}function O(I){return new a().update(I).digest()}return E==="rmd160"||E==="ripemd160"?O:E==="md5"?s:R}function S(E,R,O,I,B){f(O,I),E=h(E,c,"Password"),R=h(R,c,"Salt"),B=B||"sha1";var N=new y(B,E,R.length),D=l.allocUnsafe(I),G=l.allocUnsafe(R.length+4);R.copy(G,0,0,R.length);for(var V=0,U=v[B],te=Math.ceil(I/U),Z=1;Z<=te;Z++){G.writeUInt32BE(Z,R.length);for(var J=N.run(G,N.ipad1),Q=J,ee=1;ee<O;ee++){Q=N.run(Q,N.ipad2);for(var k=0;k<U;k++)J[k]^=Q[k]}J.copy(D,V),V+=U}return D}return syncBrowser=S,syncBrowser}var async$1,hasRequiredAsync;function requireAsync(){if(hasRequiredAsync)return async$1;hasRequiredAsync=1;var s=requireSafeBuffer$2().Buffer,a=requirePrecondition(),u=requireDefaultEncoding(),l=requireSyncBrowser(),f=requireToBuffer(),c,h=commonjsGlobal.crypto&&commonjsGlobal.crypto.subtle,p={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},v=[];function y(O){if(commonjsGlobal.process&&!commonjsGlobal.process.browser||!h||!h.importKey||!h.deriveBits)return Promise.resolve(!1);if(v[O]!==void 0)return v[O];c=c||s.alloc(8);var I=E(c,c,10,128,O).then(function(){return!0}).catch(function(){return!1});return v[O]=I,I}var b;function S(){return b||(commonjsGlobal.process&&commonjsGlobal.process.nextTick?b=commonjsGlobal.process.nextTick:commonjsGlobal.queueMicrotask?b=commonjsGlobal.queueMicrotask:commonjsGlobal.setImmediate?b=commonjsGlobal.setImmediate:b=commonjsGlobal.setTimeout,b)}function E(O,I,B,N,D){return h.importKey("raw",O,{name:"PBKDF2"},!1,["deriveBits"]).then(function(G){return h.deriveBits({name:"PBKDF2",salt:I,iterations:B,hash:{name:D}},G,N<<3)}).then(function(G){return s.from(G)})}function R(O,I){O.then(function(B){S()(function(){I(null,B)})},function(B){S()(function(){I(B)})})}return async$1=function(O,I,B,N,D,G){typeof D=="function"&&(G=D,D=void 0),D=D||"sha1";var V=p[D.toLowerCase()];if(!V||typeof commonjsGlobal.Promise!="function"){S()(function(){var U;try{U=l(O,I,B,N,D)}catch(te){return G(te)}G(null,U)});return}if(a(B,N),O=f(O,u,"Password"),I=f(I,u,"Salt"),typeof G!="function")throw new Error("No callback provided to pbkdf2");R(y(V).then(function(U){return U?E(O,I,B,N,V):l(O,I,B,N,D)}),G)},async$1}var hasRequiredBrowser$7;function requireBrowser$7(){return hasRequiredBrowser$7||(hasRequiredBrowser$7=1,browser$7.pbkdf2=requireAsync(),browser$7.pbkdf2Sync=requireSyncBrowser()),browser$7}var browser$6={},des$1={},utils$4={},hasRequiredUtils$4;function requireUtils$4(){if(hasRequiredUtils$4)return utils$4;hasRequiredUtils$4=1,utils$4.readUInt32BE=function(f,c){var h=f[0+c]<<24|f[1+c]<<16|f[2+c]<<8|f[3+c];return h>>>0},utils$4.writeUInt32BE=function(f,c,h){f[0+h]=c>>>24,f[1+h]=c>>>16&255,f[2+h]=c>>>8&255,f[3+h]=c&255},utils$4.ip=function(f,c,h,p){for(var v=0,y=0,b=6;b>=0;b-=2){for(var S=0;S<=24;S+=8)v<<=1,v|=c>>>S+b&1;for(var S=0;S<=24;S+=8)v<<=1,v|=f>>>S+b&1}for(var b=6;b>=0;b-=2){for(var S=1;S<=25;S+=8)y<<=1,y|=c>>>S+b&1;for(var S=1;S<=25;S+=8)y<<=1,y|=f>>>S+b&1}h[p+0]=v>>>0,h[p+1]=y>>>0},utils$4.rip=function(f,c,h,p){for(var v=0,y=0,b=0;b<4;b++)for(var S=24;S>=0;S-=8)v<<=1,v|=c>>>S+b&1,v<<=1,v|=f>>>S+b&1;for(var b=4;b<8;b++)for(var S=24;S>=0;S-=8)y<<=1,y|=c>>>S+b&1,y<<=1,y|=f>>>S+b&1;h[p+0]=v>>>0,h[p+1]=y>>>0},utils$4.pc1=function(f,c,h,p){for(var v=0,y=0,b=7;b>=5;b--){for(var S=0;S<=24;S+=8)v<<=1,v|=c>>S+b&1;for(var S=0;S<=24;S+=8)v<<=1,v|=f>>S+b&1}for(var S=0;S<=24;S+=8)v<<=1,v|=c>>S+b&1;for(var b=1;b<=3;b++){for(var S=0;S<=24;S+=8)y<<=1,y|=c>>S+b&1;for(var S=0;S<=24;S+=8)y<<=1,y|=f>>S+b&1}for(var S=0;S<=24;S+=8)y<<=1,y|=f>>S+b&1;h[p+0]=v>>>0,h[p+1]=y>>>0},utils$4.r28shl=function(f,c){return f<<c&268435455|f>>>28-c};var s=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];utils$4.pc2=function(f,c,h,p){for(var v=0,y=0,b=s.length>>>1,S=0;S<b;S++)v<<=1,v|=f>>>s[S]&1;for(var S=b;S<s.length;S++)y<<=1,y|=c>>>s[S]&1;h[p+0]=v>>>0,h[p+1]=y>>>0},utils$4.expand=function(f,c,h){var p=0,v=0;p=(f&1)<<5|f>>>27;for(var y=23;y>=15;y-=4)p<<=6,p|=f>>>y&63;for(var y=11;y>=3;y-=4)v|=f>>>y&63,v<<=6;v|=(f&31)<<1|f>>>31,c[h+0]=p>>>0,c[h+1]=v>>>0};var a=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];utils$4.substitute=function(f,c){for(var h=0,p=0;p<4;p++){var v=f>>>18-p*6&63,y=a[p*64+v];h<<=4,h|=y}for(var p=0;p<4;p++){var v=c>>>18-p*6&63,y=a[4*64+p*64+v];h<<=4,h|=y}return h>>>0};var u=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];return utils$4.permute=function(f){for(var c=0,h=0;h<u.length;h++)c<<=1,c|=f>>>u[h]&1;return c>>>0},utils$4.padSplit=function(f,c,h){for(var p=f.toString(2);p.length<c;)p="0"+p;for(var v=[],y=0;y<c;y+=h)v.push(p.slice(y,y+h));return v.join(" ")},utils$4}var minimalisticAssert,hasRequiredMinimalisticAssert;function requireMinimalisticAssert(){if(hasRequiredMinimalisticAssert)return minimalisticAssert;hasRequiredMinimalisticAssert=1,minimalisticAssert=s;function s(a,u){if(!a)throw new Error(u||"Assertion failed")}return s.equal=function(u,l,f){if(u!=l)throw new Error(f||"Assertion failed: "+u+" != "+l)},minimalisticAssert}var cipher,hasRequiredCipher;function requireCipher(){if(hasRequiredCipher)return cipher;hasRequiredCipher=1;var s=requireMinimalisticAssert();function a(u){this.options=u,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=u.padding!==!1}return cipher=a,a.prototype._init=function(){},a.prototype.update=function(l){return l.length===0?[]:this.type==="decrypt"?this._updateDecrypt(l):this._updateEncrypt(l)},a.prototype._buffer=function(l,f){for(var c=Math.min(this.buffer.length-this.bufferOff,l.length-f),h=0;h<c;h++)this.buffer[this.bufferOff+h]=l[f+h];return this.bufferOff+=c,c},a.prototype._flushBuffer=function(l,f){return this._update(this.buffer,0,l,f),this.bufferOff=0,this.blockSize},a.prototype._updateEncrypt=function(l){var f=0,c=0,h=(this.bufferOff+l.length)/this.blockSize|0,p=new Array(h*this.blockSize);this.bufferOff!==0&&(f+=this._buffer(l,f),this.bufferOff===this.buffer.length&&(c+=this._flushBuffer(p,c)));for(var v=l.length-(l.length-f)%this.blockSize;f<v;f+=this.blockSize)this._update(l,f,p,c),c+=this.blockSize;for(;f<l.length;f++,this.bufferOff++)this.buffer[this.bufferOff]=l[f];return p},a.prototype._updateDecrypt=function(l){for(var f=0,c=0,h=Math.ceil((this.bufferOff+l.length)/this.blockSize)-1,p=new Array(h*this.blockSize);h>0;h--)f+=this._buffer(l,f),c+=this._flushBuffer(p,c);return f+=this._buffer(l,f),p},a.prototype.final=function(l){var f;l&&(f=this.update(l));var c;return this.type==="encrypt"?c=this._finalEncrypt():c=this._finalDecrypt(),f?f.concat(c):c},a.prototype._pad=function(l,f){if(f===0)return!1;for(;f<l.length;)l[f++]=0;return!0},a.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var l=new Array(this.blockSize);return this._update(this.buffer,0,l,0),l},a.prototype._unpad=function(l){return l},a.prototype._finalDecrypt=function(){s.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var l=new Array(this.blockSize);return this._flushBuffer(l,0),this._unpad(l)},cipher}var des,hasRequiredDes$1;function requireDes$1(){if(hasRequiredDes$1)return des;hasRequiredDes$1=1;var s=requireMinimalisticAssert(),a=requireInherits_browser(),u=requireUtils$4(),l=requireCipher();function f(){this.tmp=new Array(2),this.keys=null}function c(p){l.call(this,p);var v=new f;this._desState=v,this.deriveKeys(v,p.key)}a(c,l),des=c,c.create=function(v){return new c(v)};var h=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];return c.prototype.deriveKeys=function(v,y){v.keys=new Array(16*2),s.equal(y.length,this.blockSize,"Invalid key length");var b=u.readUInt32BE(y,0),S=u.readUInt32BE(y,4);u.pc1(b,S,v.tmp,0),b=v.tmp[0],S=v.tmp[1];for(var E=0;E<v.keys.length;E+=2){var R=h[E>>>1];b=u.r28shl(b,R),S=u.r28shl(S,R),u.pc2(b,S,v.keys,E)}},c.prototype._update=function(v,y,b,S){var E=this._desState,R=u.readUInt32BE(v,y),O=u.readUInt32BE(v,y+4);u.ip(R,O,E.tmp,0),R=E.tmp[0],O=E.tmp[1],this.type==="encrypt"?this._encrypt(E,R,O,E.tmp,0):this._decrypt(E,R,O,E.tmp,0),R=E.tmp[0],O=E.tmp[1],u.writeUInt32BE(b,R,S),u.writeUInt32BE(b,O,S+4)},c.prototype._pad=function(v,y){if(this.padding===!1)return!1;for(var b=v.length-y,S=y;S<v.length;S++)v[S]=b;return!0},c.prototype._unpad=function(v){if(this.padding===!1)return v;for(var y=v[v.length-1],b=v.length-y;b<v.length;b++)s.equal(v[b],y);return v.slice(0,v.length-y)},c.prototype._encrypt=function(v,y,b,S,E){for(var R=y,O=b,I=0;I<v.keys.length;I+=2){var B=v.keys[I],N=v.keys[I+1];u.expand(O,v.tmp,0),B^=v.tmp[0],N^=v.tmp[1];var D=u.substitute(B,N),G=u.permute(D),V=O;O=(R^G)>>>0,R=V}u.rip(O,R,S,E)},c.prototype._decrypt=function(v,y,b,S,E){for(var R=b,O=y,I=v.keys.length-2;I>=0;I-=2){var B=v.keys[I],N=v.keys[I+1];u.expand(R,v.tmp,0),B^=v.tmp[0],N^=v.tmp[1];var D=u.substitute(B,N),G=u.permute(D),V=R;R=(O^G)>>>0,O=V}u.rip(R,O,S,E)},des}var cbc$1={},hasRequiredCbc$1;function requireCbc$1(){if(hasRequiredCbc$1)return cbc$1;hasRequiredCbc$1=1;var s=requireMinimalisticAssert(),a=requireInherits_browser(),u={};function l(c){s.equal(c.length,8,"Invalid IV length"),this.iv=new Array(8);for(var h=0;h<this.iv.length;h++)this.iv[h]=c[h]}function f(c){function h(b){c.call(this,b),this._cbcInit()}a(h,c);for(var p=Object.keys(u),v=0;v<p.length;v++){var y=p[v];h.prototype[y]=u[y]}return h.create=function(S){return new h(S)},h}return cbc$1.instantiate=f,u._cbcInit=function(){var h=new l(this.options.iv);this._cbcState=h},u._update=function(h,p,v,y){var b=this._cbcState,S=this.constructor.super_.prototype,E=b.iv;if(this.type==="encrypt"){for(var R=0;R<this.blockSize;R++)E[R]^=h[p+R];S._update.call(this,E,0,v,y);for(var R=0;R<this.blockSize;R++)E[R]=v[y+R]}else{S._update.call(this,h,p,v,y);for(var R=0;R<this.blockSize;R++)v[y+R]^=E[R];for(var R=0;R<this.blockSize;R++)E[R]=h[p+R]}},cbc$1}var ede,hasRequiredEde;function requireEde(){if(hasRequiredEde)return ede;hasRequiredEde=1;var s=requireMinimalisticAssert(),a=requireInherits_browser(),u=requireCipher(),l=requireDes$1();function f(h,p){s.equal(p.length,24,"Invalid key length");var v=p.slice(0,8),y=p.slice(8,16),b=p.slice(16,24);h==="encrypt"?this.ciphers=[l.create({type:"encrypt",key:v}),l.create({type:"decrypt",key:y}),l.create({type:"encrypt",key:b})]:this.ciphers=[l.create({type:"decrypt",key:b}),l.create({type:"encrypt",key:y}),l.create({type:"decrypt",key:v})]}function c(h){u.call(this,h);var p=new f(this.type,this.options.key);this._edeState=p}return a(c,u),ede=c,c.create=function(p){return new c(p)},c.prototype._update=function(p,v,y,b){var S=this._edeState;S.ciphers[0]._update(p,v,y,b),S.ciphers[1]._update(y,b,y,b),S.ciphers[2]._update(y,b,y,b)},c.prototype._pad=l.prototype._pad,c.prototype._unpad=l.prototype._unpad,ede}var hasRequiredDes;function requireDes(){return hasRequiredDes||(hasRequiredDes=1,des$1.utils=requireUtils$4(),des$1.Cipher=requireCipher(),des$1.DES=requireDes$1(),des$1.CBC=requireCbc$1(),des$1.EDE=requireEde()),des$1}var browserifyDes,hasRequiredBrowserifyDes;function requireBrowserifyDes(){if(hasRequiredBrowserifyDes)return browserifyDes;hasRequiredBrowserifyDes=1;var s=requireCipherBase(),a=requireDes(),u=requireInherits_browser(),l=requireSafeBuffer$2().Buffer,f={"des-ede3-cbc":a.CBC.instantiate(a.EDE),"des-ede3":a.EDE,"des-ede-cbc":a.CBC.instantiate(a.EDE),"des-ede":a.EDE,"des-cbc":a.CBC.instantiate(a.DES),"des-ecb":a.DES};f.des=f["des-cbc"],f.des3=f["des-ede3-cbc"],browserifyDes=c,u(c,s);function c(h){s.call(this);var p=h.mode.toLowerCase(),v=f[p],y;h.decrypt?y="decrypt":y="encrypt";var b=h.key;l.isBuffer(b)||(b=l.from(b)),(p==="des-ede"||p==="des-ede-cbc")&&(b=l.concat([b,b.slice(0,8)]));var S=h.iv;l.isBuffer(S)||(S=l.from(S)),this._des=v.create({key:b,iv:S,type:y})}return c.prototype._update=function(h){return l.from(this._des.update(h))},c.prototype._final=function(){return l.from(this._des.final())},browserifyDes}var browser$5={},encrypter={},ecb={},hasRequiredEcb;function requireEcb(){return hasRequiredEcb||(hasRequiredEcb=1,ecb.encrypt=function(s,a){return s._cipher.encryptBlock(a)},ecb.decrypt=function(s,a){return s._cipher.decryptBlock(a)}),ecb}var cbc={},bufferXor,hasRequiredBufferXor;function requireBufferXor(){return hasRequiredBufferXor||(hasRequiredBufferXor=1,bufferXor=function(a,u){for(var l=Math.min(a.length,u.length),f=new distExports.Buffer(l),c=0;c<l;++c)f[c]=a[c]^u[c];return f}),bufferXor}var hasRequiredCbc;function requireCbc(){if(hasRequiredCbc)return cbc;hasRequiredCbc=1;var s=requireBufferXor();return cbc.encrypt=function(a,u){var l=s(u,a._prev);return a._prev=a._cipher.encryptBlock(l),a._prev},cbc.decrypt=function(a,u){var l=a._prev;a._prev=u;var f=a._cipher.decryptBlock(u);return s(f,l)},cbc}var cfb={},hasRequiredCfb;function requireCfb(){if(hasRequiredCfb)return cfb;hasRequiredCfb=1;var s=requireSafeBuffer$2().Buffer,a=requireBufferXor();function u(l,f,c){var h=f.length,p=a(f,l._cache);return l._cache=l._cache.slice(h),l._prev=s.concat([l._prev,c?f:p]),p}return cfb.encrypt=function(l,f,c){for(var h=s.allocUnsafe(0),p;f.length;)if(l._cache.length===0&&(l._cache=l._cipher.encryptBlock(l._prev),l._prev=s.allocUnsafe(0)),l._cache.length<=f.length)p=l._cache.length,h=s.concat([h,u(l,f.slice(0,p),c)]),f=f.slice(p);else{h=s.concat([h,u(l,f,c)]);break}return h},cfb}var cfb8={},hasRequiredCfb8;function requireCfb8(){if(hasRequiredCfb8)return cfb8;hasRequiredCfb8=1;var s=requireSafeBuffer$2().Buffer;function a(u,l,f){var c=u._cipher.encryptBlock(u._prev),h=c[0]^l;return u._prev=s.concat([u._prev.slice(1),s.from([f?l:h])]),h}return cfb8.encrypt=function(u,l,f){for(var c=l.length,h=s.allocUnsafe(c),p=-1;++p<c;)h[p]=a(u,l[p],f);return h},cfb8}var cfb1={},hasRequiredCfb1;function requireCfb1(){if(hasRequiredCfb1)return cfb1;hasRequiredCfb1=1;var s=requireSafeBuffer$2().Buffer;function a(l,f,c){for(var h,p=-1,v=8,y=0,b,S;++p<v;)h=l._cipher.encryptBlock(l._prev),b=f&1<<7-p?128:0,S=h[0]^b,y+=(S&128)>>p%8,l._prev=u(l._prev,c?b:S);return y}function u(l,f){var c=l.length,h=-1,p=s.allocUnsafe(l.length);for(l=s.concat([l,s.from([f])]);++h<c;)p[h]=l[h]<<1|l[h+1]>>7;return p}return cfb1.encrypt=function(l,f,c){for(var h=f.length,p=s.allocUnsafe(h),v=-1;++v<h;)p[v]=a(l,f[v],c);return p},cfb1}var ofb={},hasRequiredOfb;function requireOfb(){if(hasRequiredOfb)return ofb;hasRequiredOfb=1;var s=requireBufferXor();function a(u){return u._prev=u._cipher.encryptBlock(u._prev),u._prev}return ofb.encrypt=function(u,l){for(;u._cache.length<l.length;)u._cache=distExports.Buffer.concat([u._cache,a(u)]);var f=u._cache.slice(0,l.length);return u._cache=u._cache.slice(l.length),s(l,f)},ofb}var ctr={},incr32_1,hasRequiredIncr32;function requireIncr32(){if(hasRequiredIncr32)return incr32_1;hasRequiredIncr32=1;function s(a){for(var u=a.length,l;u--;)if(l=a.readUInt8(u),l===255)a.writeUInt8(0,u);else{l++,a.writeUInt8(l,u);break}}return incr32_1=s,incr32_1}var hasRequiredCtr;function requireCtr(){if(hasRequiredCtr)return ctr;hasRequiredCtr=1;var s=requireBufferXor(),a=requireSafeBuffer$2().Buffer,u=requireIncr32();function l(c){var h=c._cipher.encryptBlockRaw(c._prev);return u(c._prev),h}var f=16;return ctr.encrypt=function(c,h){var p=Math.ceil(h.length/f),v=c._cache.length;c._cache=a.concat([c._cache,a.allocUnsafe(p*f)]);for(var y=0;y<p;y++){var b=l(c),S=v+y*f;c._cache.writeUInt32BE(b[0],S+0),c._cache.writeUInt32BE(b[1],S+4),c._cache.writeUInt32BE(b[2],S+8),c._cache.writeUInt32BE(b[3],S+12)}var E=c._cache.slice(0,h.length);return c._cache=c._cache.slice(h.length),s(h,E)},ctr}const aes128={cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192={cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256={cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},require$$2$2={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128,aes192,aes256,"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}};var modes_1,hasRequiredModes$1;function requireModes$1(){if(hasRequiredModes$1)return modes_1;hasRequiredModes$1=1;var s={ECB:requireEcb(),CBC:requireCbc(),CFB:requireCfb(),CFB8:requireCfb8(),CFB1:requireCfb1(),OFB:requireOfb(),CTR:requireCtr(),GCM:requireCtr()},a=require$$2$2;for(var u in a)a[u].module=s[a[u].mode];return modes_1=a,modes_1}var aes={},hasRequiredAes;function requireAes(){if(hasRequiredAes)return aes;hasRequiredAes=1;var s=requireSafeBuffer$2().Buffer;function a(p){s.isBuffer(p)||(p=s.from(p));for(var v=p.length/4|0,y=new Array(v),b=0;b<v;b++)y[b]=p.readUInt32BE(b*4);return y}function u(p){for(var v=0;v<p.length;p++)p[v]=0}function l(p,v,y,b,S){for(var E=y[0],R=y[1],O=y[2],I=y[3],B=p[0]^v[0],N=p[1]^v[1],D=p[2]^v[2],G=p[3]^v[3],V,U,te,Z,J=4,Q=1;Q<S;Q++)V=E[B>>>24]^R[N>>>16&255]^O[D>>>8&255]^I[G&255]^v[J++],U=E[N>>>24]^R[D>>>16&255]^O[G>>>8&255]^I[B&255]^v[J++],te=E[D>>>24]^R[G>>>16&255]^O[B>>>8&255]^I[N&255]^v[J++],Z=E[G>>>24]^R[B>>>16&255]^O[N>>>8&255]^I[D&255]^v[J++],B=V,N=U,D=te,G=Z;return V=(b[B>>>24]<<24|b[N>>>16&255]<<16|b[D>>>8&255]<<8|b[G&255])^v[J++],U=(b[N>>>24]<<24|b[D>>>16&255]<<16|b[G>>>8&255]<<8|b[B&255])^v[J++],te=(b[D>>>24]<<24|b[G>>>16&255]<<16|b[B>>>8&255]<<8|b[N&255])^v[J++],Z=(b[G>>>24]<<24|b[B>>>16&255]<<16|b[N>>>8&255]<<8|b[D&255])^v[J++],V=V>>>0,U=U>>>0,te=te>>>0,Z=Z>>>0,[V,U,te,Z]}var f=[0,1,2,4,8,16,32,64,128,27,54],c=function(){for(var p=new Array(256),v=0;v<256;v++)v<128?p[v]=v<<1:p[v]=v<<1^283;for(var y=[],b=[],S=[[],[],[],[]],E=[[],[],[],[]],R=0,O=0,I=0;I<256;++I){var B=O^O<<1^O<<2^O<<3^O<<4;B=B>>>8^B&255^99,y[R]=B,b[B]=R;var N=p[R],D=p[N],G=p[D],V=p[B]*257^B*16843008;S[0][R]=V<<24|V>>>8,S[1][R]=V<<16|V>>>16,S[2][R]=V<<8|V>>>24,S[3][R]=V,V=G*16843009^D*65537^N*257^R*16843008,E[0][B]=V<<24|V>>>8,E[1][B]=V<<16|V>>>16,E[2][B]=V<<8|V>>>24,E[3][B]=V,R===0?R=O=1:(R=N^p[p[p[G^N]]],O^=p[p[O]])}return{SBOX:y,INV_SBOX:b,SUB_MIX:S,INV_SUB_MIX:E}}();function h(p){this._key=a(p),this._reset()}return h.blockSize=4*4,h.keySize=256/8,h.prototype.blockSize=h.blockSize,h.prototype.keySize=h.keySize,h.prototype._reset=function(){for(var p=this._key,v=p.length,y=v+6,b=(y+1)*4,S=[],E=0;E<v;E++)S[E]=p[E];for(E=v;E<b;E++){var R=S[E-1];E%v===0?(R=R<<8|R>>>24,R=c.SBOX[R>>>24]<<24|c.SBOX[R>>>16&255]<<16|c.SBOX[R>>>8&255]<<8|c.SBOX[R&255],R^=f[E/v|0]<<24):v>6&&E%v===4&&(R=c.SBOX[R>>>24]<<24|c.SBOX[R>>>16&255]<<16|c.SBOX[R>>>8&255]<<8|c.SBOX[R&255]),S[E]=S[E-v]^R}for(var O=[],I=0;I<b;I++){var B=b-I,N=S[B-(I%4?0:4)];I<4||B<=4?O[I]=N:O[I]=c.INV_SUB_MIX[0][c.SBOX[N>>>24]]^c.INV_SUB_MIX[1][c.SBOX[N>>>16&255]]^c.INV_SUB_MIX[2][c.SBOX[N>>>8&255]]^c.INV_SUB_MIX[3][c.SBOX[N&255]]}this._nRounds=y,this._keySchedule=S,this._invKeySchedule=O},h.prototype.encryptBlockRaw=function(p){return p=a(p),l(p,this._keySchedule,c.SUB_MIX,c.SBOX,this._nRounds)},h.prototype.encryptBlock=function(p){var v=this.encryptBlockRaw(p),y=s.allocUnsafe(16);return y.writeUInt32BE(v[0],0),y.writeUInt32BE(v[1],4),y.writeUInt32BE(v[2],8),y.writeUInt32BE(v[3],12),y},h.prototype.decryptBlock=function(p){p=a(p);var v=p[1];p[1]=p[3],p[3]=v;var y=l(p,this._invKeySchedule,c.INV_SUB_MIX,c.INV_SBOX,this._nRounds),b=s.allocUnsafe(16);return b.writeUInt32BE(y[0],0),b.writeUInt32BE(y[3],4),b.writeUInt32BE(y[2],8),b.writeUInt32BE(y[1],12),b},h.prototype.scrub=function(){u(this._keySchedule),u(this._invKeySchedule),u(this._key)},aes.AES=h,aes}var ghash,hasRequiredGhash;function requireGhash(){if(hasRequiredGhash)return ghash;hasRequiredGhash=1;var s=requireSafeBuffer$2().Buffer,a=s.alloc(16,0);function u(c){return[c.readUInt32BE(0),c.readUInt32BE(4),c.readUInt32BE(8),c.readUInt32BE(12)]}function l(c){var h=s.allocUnsafe(16);return h.writeUInt32BE(c[0]>>>0,0),h.writeUInt32BE(c[1]>>>0,4),h.writeUInt32BE(c[2]>>>0,8),h.writeUInt32BE(c[3]>>>0,12),h}function f(c){this.h=c,this.state=s.alloc(16,0),this.cache=s.allocUnsafe(0)}return f.prototype.ghash=function(c){for(var h=-1;++h<c.length;)this.state[h]^=c[h];this._multiply()},f.prototype._multiply=function(){for(var c=u(this.h),h=[0,0,0,0],p,v,y,b=-1;++b<128;){for(v=(this.state[~~(b/8)]&1<<7-b%8)!==0,v&&(h[0]^=c[0],h[1]^=c[1],h[2]^=c[2],h[3]^=c[3]),y=(c[3]&1)!==0,p=3;p>0;p--)c[p]=c[p]>>>1|(c[p-1]&1)<<31;c[0]=c[0]>>>1,y&&(c[0]=c[0]^225<<24)}this.state=l(h)},f.prototype.update=function(c){this.cache=s.concat([this.cache,c]);for(var h;this.cache.length>=16;)h=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(h)},f.prototype.final=function(c,h){return this.cache.length&&this.ghash(s.concat([this.cache,a],16)),this.ghash(l([0,c,0,h])),this.state},ghash=f,ghash}var authCipher,hasRequiredAuthCipher;function requireAuthCipher(){if(hasRequiredAuthCipher)return authCipher;hasRequiredAuthCipher=1;var s=requireAes(),a=requireSafeBuffer$2().Buffer,u=requireCipherBase(),l=requireInherits_browser(),f=requireGhash(),c=requireBufferXor(),h=requireIncr32();function p(b,S){var E=0;b.length!==S.length&&E++;for(var R=Math.min(b.length,S.length),O=0;O<R;++O)E+=b[O]^S[O];return E}function v(b,S,E){if(S.length===12)return b._finID=a.concat([S,a.from([0,0,0,1])]),a.concat([S,a.from([0,0,0,2])]);var R=new f(E),O=S.length,I=O%16;R.update(S),I&&(I=16-I,R.update(a.alloc(I,0))),R.update(a.alloc(8,0));var B=O*8,N=a.alloc(8);N.writeUIntBE(B,0,8),R.update(N),b._finID=R.state;var D=a.from(b._finID);return h(D),D}function y(b,S,E,R){u.call(this);var O=a.alloc(4,0);this._cipher=new s.AES(S);var I=this._cipher.encryptBlock(O);this._ghash=new f(I),E=v(this,E,I),this._prev=a.from(E),this._cache=a.allocUnsafe(0),this._secCache=a.allocUnsafe(0),this._decrypt=R,this._alen=0,this._len=0,this._mode=b,this._authTag=null,this._called=!1}return l(y,u),y.prototype._update=function(b){if(!this._called&&this._alen){var S=16-this._alen%16;S<16&&(S=a.alloc(S,0),this._ghash.update(S))}this._called=!0;var E=this._mode.encrypt(this,b);return this._decrypt?this._ghash.update(b):this._ghash.update(E),this._len+=b.length,E},y.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var b=c(this._ghash.final(this._alen*8,this._len*8),this._cipher.encryptBlock(this._finID));if(this._decrypt&&p(b,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=b,this._cipher.scrub()},y.prototype.getAuthTag=function(){if(this._decrypt||!a.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},y.prototype.setAuthTag=function(S){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=S},y.prototype.setAAD=function(S){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(S),this._alen+=S.length},authCipher=y,authCipher}var streamCipher,hasRequiredStreamCipher;function requireStreamCipher(){if(hasRequiredStreamCipher)return streamCipher;hasRequiredStreamCipher=1;var s=requireAes(),a=requireSafeBuffer$2().Buffer,u=requireCipherBase(),l=requireInherits_browser();function f(c,h,p,v){u.call(this),this._cipher=new s.AES(h),this._prev=a.from(p),this._cache=a.allocUnsafe(0),this._secCache=a.allocUnsafe(0),this._decrypt=v,this._mode=c}return l(f,u),f.prototype._update=function(c){return this._mode.encrypt(this,c,this._decrypt)},f.prototype._final=function(){this._cipher.scrub()},streamCipher=f,streamCipher}var evp_bytestokey,hasRequiredEvp_bytestokey;function requireEvp_bytestokey(){if(hasRequiredEvp_bytestokey)return evp_bytestokey;hasRequiredEvp_bytestokey=1;var s=requireSafeBuffer$2().Buffer,a=requireMd5_js();function u(l,f,c,h){if(s.isBuffer(l)||(l=s.from(l,"binary")),f&&(s.isBuffer(f)||(f=s.from(f,"binary")),f.length!==8))throw new RangeError("salt should be Buffer with 8 byte length");for(var p=c/8,v=s.alloc(p),y=s.alloc(h||0),b=s.alloc(0);p>0||h>0;){var S=new a;S.update(b),S.update(l),f&&S.update(f),b=S.digest();var E=0;if(p>0){var R=v.length-p;E=Math.min(p,b.length),b.copy(v,R,0,E),p-=E}if(E<b.length&&h>0){var O=y.length-h,I=Math.min(h,b.length-E);b.copy(y,O,E,E+I),h-=I}}return b.fill(0),{key:v,iv:y}}return evp_bytestokey=u,evp_bytestokey}var hasRequiredEncrypter;function requireEncrypter(){if(hasRequiredEncrypter)return encrypter;hasRequiredEncrypter=1;var s=requireModes$1(),a=requireAuthCipher(),u=requireSafeBuffer$2().Buffer,l=requireStreamCipher(),f=requireCipherBase(),c=requireAes(),h=requireEvp_bytestokey(),p=requireInherits_browser();function v(R,O,I){f.call(this),this._cache=new b,this._cipher=new c.AES(O),this._prev=u.from(I),this._mode=R,this._autopadding=!0}p(v,f),v.prototype._update=function(R){this._cache.add(R);for(var O,I,B=[];O=this._cache.get();)I=this._mode.encrypt(this,O),B.push(I);return u.concat(B)};var y=u.alloc(16,16);v.prototype._final=function(){var R=this._cache.flush();if(this._autopadding)return R=this._mode.encrypt(this,R),this._cipher.scrub(),R;if(!R.equals(y))throw this._cipher.scrub(),new Error("data not multiple of block length")},v.prototype.setAutoPadding=function(R){return this._autopadding=!!R,this};function b(){this.cache=u.allocUnsafe(0)}b.prototype.add=function(R){this.cache=u.concat([this.cache,R])},b.prototype.get=function(){if(this.cache.length>15){var R=this.cache.slice(0,16);return this.cache=this.cache.slice(16),R}return null},b.prototype.flush=function(){for(var R=16-this.cache.length,O=u.allocUnsafe(R),I=-1;++I<R;)O.writeUInt8(R,I);return u.concat([this.cache,O])};function S(R,O,I){var B=s[R.toLowerCase()];if(!B)throw new TypeError("invalid suite type");if(typeof O=="string"&&(O=u.from(O)),O.length!==B.key/8)throw new TypeError("invalid key length "+O.length);if(typeof I=="string"&&(I=u.from(I)),B.mode!=="GCM"&&I.length!==B.iv)throw new TypeError("invalid iv length "+I.length);return B.type==="stream"?new l(B.module,O,I):B.type==="auth"?new a(B.module,O,I):new v(B.module,O,I)}function E(R,O){var I=s[R.toLowerCase()];if(!I)throw new TypeError("invalid suite type");var B=h(O,!1,I.key,I.iv);return S(R,B.key,B.iv)}return encrypter.createCipheriv=S,encrypter.createCipher=E,encrypter}var decrypter={},hasRequiredDecrypter;function requireDecrypter(){if(hasRequiredDecrypter)return decrypter;hasRequiredDecrypter=1;var s=requireAuthCipher(),a=requireSafeBuffer$2().Buffer,u=requireModes$1(),l=requireStreamCipher(),f=requireCipherBase(),c=requireAes(),h=requireEvp_bytestokey(),p=requireInherits_browser();function v(R,O,I){f.call(this),this._cache=new y,this._last=void 0,this._cipher=new c.AES(O),this._prev=a.from(I),this._mode=R,this._autopadding=!0}p(v,f),v.prototype._update=function(R){this._cache.add(R);for(var O,I,B=[];O=this._cache.get(this._autopadding);)I=this._mode.decrypt(this,O),B.push(I);return a.concat(B)},v.prototype._final=function(){var R=this._cache.flush();if(this._autopadding)return b(this._mode.decrypt(this,R));if(R)throw new Error("data not multiple of block length")},v.prototype.setAutoPadding=function(R){return this._autopadding=!!R,this};function y(){this.cache=a.allocUnsafe(0)}y.prototype.add=function(R){this.cache=a.concat([this.cache,R])},y.prototype.get=function(R){var O;if(R){if(this.cache.length>16)return O=this.cache.slice(0,16),this.cache=this.cache.slice(16),O}else if(this.cache.length>=16)return O=this.cache.slice(0,16),this.cache=this.cache.slice(16),O;return null},y.prototype.flush=function(){if(this.cache.length)return this.cache};function b(R){var O=R[15];if(O<1||O>16)throw new Error("unable to decrypt data");for(var I=-1;++I<O;)if(R[I+(16-O)]!==O)throw new Error("unable to decrypt data");if(O!==16)return R.slice(0,16-O)}function S(R,O,I){var B=u[R.toLowerCase()];if(!B)throw new TypeError("invalid suite type");if(typeof I=="string"&&(I=a.from(I)),B.mode!=="GCM"&&I.length!==B.iv)throw new TypeError("invalid iv length "+I.length);if(typeof O=="string"&&(O=a.from(O)),O.length!==B.key/8)throw new TypeError("invalid key length "+O.length);return B.type==="stream"?new l(B.module,O,I,!0):B.type==="auth"?new s(B.module,O,I,!0):new v(B.module,O,I)}function E(R,O){var I=u[R.toLowerCase()];if(!I)throw new TypeError("invalid suite type");var B=h(O,!1,I.key,I.iv);return S(R,B.key,B.iv)}return decrypter.createDecipher=E,decrypter.createDecipheriv=S,decrypter}var hasRequiredBrowser$6;function requireBrowser$6(){if(hasRequiredBrowser$6)return browser$5;hasRequiredBrowser$6=1;var s=requireEncrypter(),a=requireDecrypter(),u=require$$2$2;function l(){return Object.keys(u)}return browser$5.createCipher=browser$5.Cipher=s.createCipher,browser$5.createCipheriv=browser$5.Cipheriv=s.createCipheriv,browser$5.createDecipher=browser$5.Decipher=a.createDecipher,browser$5.createDecipheriv=browser$5.Decipheriv=a.createDecipheriv,browser$5.listCiphers=browser$5.getCiphers=l,browser$5}var modes={},hasRequiredModes;function requireModes(){return hasRequiredModes||(hasRequiredModes=1,function(s){s["des-ecb"]={key:8,iv:0},s["des-cbc"]=s.des={key:8,iv:8},s["des-ede3-cbc"]=s.des3={key:24,iv:8},s["des-ede3"]={key:24,iv:0},s["des-ede-cbc"]={key:16,iv:8},s["des-ede"]={key:16,iv:0}}(modes)),modes}var hasRequiredBrowser$5;function requireBrowser$5(){if(hasRequiredBrowser$5)return browser$6;hasRequiredBrowser$5=1;var s=requireBrowserifyDes(),a=requireBrowser$6(),u=requireModes$1(),l=requireModes(),f=requireEvp_bytestokey();function c(b,S){b=b.toLowerCase();var E,R;if(u[b])E=u[b].key,R=u[b].iv;else if(l[b])E=l[b].key*8,R=l[b].iv;else throw new TypeError("invalid suite type");var O=f(S,!1,E,R);return p(b,O.key,O.iv)}function h(b,S){b=b.toLowerCase();var E,R;if(u[b])E=u[b].key,R=u[b].iv;else if(l[b])E=l[b].key*8,R=l[b].iv;else throw new TypeError("invalid suite type");var O=f(S,!1,E,R);return v(b,O.key,O.iv)}function p(b,S,E){if(b=b.toLowerCase(),u[b])return a.createCipheriv(b,S,E);if(l[b])return new s({key:S,iv:E,mode:b});throw new TypeError("invalid suite type")}function v(b,S,E){if(b=b.toLowerCase(),u[b])return a.createDecipheriv(b,S,E);if(l[b])return new s({key:S,iv:E,mode:b,decrypt:!0});throw new TypeError("invalid suite type")}function y(){return Object.keys(l).concat(a.getCiphers())}return browser$6.createCipher=browser$6.Cipher=c,browser$6.createCipheriv=browser$6.Cipheriv=p,browser$6.createDecipher=browser$6.Decipher=h,browser$6.createDecipheriv=browser$6.Decipheriv=v,browser$6.listCiphers=browser$6.getCiphers=y,browser$6}var browser$4={},bn$d={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$2$1=getAugmentedNamespace(__viteBrowserExternal$1);var bn$c=bn$d.exports,hasRequiredBn$6;function requireBn$6(){return hasRequiredBn$6||(hasRequiredBn$6=1,function(s){(function(a,u){function l(k,d){if(!k)throw new Error(d||"Assertion failed")}function f(k,d){k.super_=d;var g=function(){};g.prototype=d.prototype,k.prototype=new g,k.prototype.constructor=k}function c(k,d,g){if(c.isBN(k))return k;this.negative=0,this.words=null,this.length=0,this.red=null,k!==null&&((d==="le"||d==="be")&&(g=d,d=10),this._init(k||0,d||10,g||"be"))}typeof a=="object"?a.exports=c:u.BN=c,c.BN=c,c.wordSize=26;var h;try{typeof window<"u"&&typeof window.Buffer<"u"?h=window.Buffer:h=require$$2$1.Buffer}catch{}c.isBN=function(d){return d instanceof c?!0:d!==null&&typeof d=="object"&&d.constructor.wordSize===c.wordSize&&Array.isArray(d.words)},c.max=function(d,g){return d.cmp(g)>0?d:g},c.min=function(d,g){return d.cmp(g)<0?d:g},c.prototype._init=function(d,g,_){if(typeof d=="number")return this._initNumber(d,g,_);if(typeof d=="object")return this._initArray(d,g,_);g==="hex"&&(g=16),l(g===(g|0)&&g>=2&&g<=36),d=d.toString().replace(/\s+/g,"");var w=0;d[0]==="-"&&(w++,this.negative=1),w<d.length&&(g===16?this._parseHex(d,w,_):(this._parseBase(d,g,w),_==="le"&&this._initArray(this.toArray(),g,_)))},c.prototype._initNumber=function(d,g,_){d<0&&(this.negative=1,d=-d),d<67108864?(this.words=[d&67108863],this.length=1):d<4503599627370496?(this.words=[d&67108863,d/67108864&67108863],this.length=2):(l(d<9007199254740992),this.words=[d&67108863,d/67108864&67108863,1],this.length=3),_==="le"&&this._initArray(this.toArray(),g,_)},c.prototype._initArray=function(d,g,_){if(l(typeof d.length=="number"),d.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(d.length/3),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var x,P,$=0;if(_==="be")for(w=d.length-1,x=0;w>=0;w-=3)P=d[w]|d[w-1]<<8|d[w-2]<<16,this.words[x]|=P<<$&67108863,this.words[x+1]=P>>>26-$&67108863,$+=24,$>=26&&($-=26,x++);else if(_==="le")for(w=0,x=0;w<d.length;w+=3)P=d[w]|d[w+1]<<8|d[w+2]<<16,this.words[x]|=P<<$&67108863,this.words[x+1]=P>>>26-$&67108863,$+=24,$>=26&&($-=26,x++);return this.strip()};function p(k,d){var g=k.charCodeAt(d);return g>=65&&g<=70?g-55:g>=97&&g<=102?g-87:g-48&15}function v(k,d,g){var _=p(k,g);return g-1>=d&&(_|=p(k,g-1)<<4),_}c.prototype._parseHex=function(d,g,_){this.length=Math.ceil((d.length-g)/6),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var x=0,P=0,$;if(_==="be")for(w=d.length-1;w>=g;w-=2)$=v(d,g,w)<<x,this.words[P]|=$&67108863,x>=18?(x-=18,P+=1,this.words[P]|=$>>>26):x+=8;else{var T=d.length-g;for(w=T%2===0?g+1:g;w<d.length;w+=2)$=v(d,g,w)<<x,this.words[P]|=$&67108863,x>=18?(x-=18,P+=1,this.words[P]|=$>>>26):x+=8}this.strip()};function y(k,d,g,_){for(var w=0,x=Math.min(k.length,g),P=d;P<x;P++){var $=k.charCodeAt(P)-48;w*=_,$>=49?w+=$-49+10:$>=17?w+=$-17+10:w+=$}return w}c.prototype._parseBase=function(d,g,_){this.words=[0],this.length=1;for(var w=0,x=1;x<=67108863;x*=g)w++;w--,x=x/g|0;for(var P=d.length-_,$=P%w,T=Math.min(P,P-$)+_,m=0,M=_;M<T;M+=w)m=y(d,M,M+w,g),this.imuln(x),this.words[0]+m<67108864?this.words[0]+=m:this._iaddn(m);if($!==0){var W=1;for(m=y(d,M,d.length,g),M=0;M<$;M++)W*=g;this.imuln(W),this.words[0]+m<67108864?this.words[0]+=m:this._iaddn(m)}this.strip()},c.prototype.copy=function(d){d.words=new Array(this.length);for(var g=0;g<this.length;g++)d.words[g]=this.words[g];d.length=this.length,d.negative=this.negative,d.red=this.red},c.prototype.clone=function(){var d=new c(null);return this.copy(d),d},c.prototype._expand=function(d){for(;this.length<d;)this.words[this.length++]=0;return this},c.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},c.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},c.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var b=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],S=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],E=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];c.prototype.toString=function(d,g){d=d||10,g=g|0||1;var _;if(d===16||d==="hex"){_="";for(var w=0,x=0,P=0;P<this.length;P++){var $=this.words[P],T=(($<<w|x)&16777215).toString(16);x=$>>>24-w&16777215,x!==0||P!==this.length-1?_=b[6-T.length]+T+_:_=T+_,w+=2,w>=26&&(w-=26,P--)}for(x!==0&&(_=x.toString(16)+_);_.length%g!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}if(d===(d|0)&&d>=2&&d<=36){var m=S[d],M=E[d];_="";var W=this.clone();for(W.negative=0;!W.isZero();){var Y=W.modn(M).toString(d);W=W.idivn(M),W.isZero()?_=Y+_:_=b[m-Y.length]+Y+_}for(this.isZero()&&(_="0"+_);_.length%g!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}l(!1,"Base should be between 2 and 36")},c.prototype.toNumber=function(){var d=this.words[0];return this.length===2?d+=this.words[1]*67108864:this.length===3&&this.words[2]===1?d+=4503599627370496+this.words[1]*67108864:this.length>2&&l(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-d:d},c.prototype.toJSON=function(){return this.toString(16)},c.prototype.toBuffer=function(d,g){return l(typeof h<"u"),this.toArrayLike(h,d,g)},c.prototype.toArray=function(d,g){return this.toArrayLike(Array,d,g)},c.prototype.toArrayLike=function(d,g,_){var w=this.byteLength(),x=_||Math.max(1,w);l(w<=x,"byte array longer than desired length"),l(x>0,"Requested array length <= 0"),this.strip();var P=g==="le",$=new d(x),T,m,M=this.clone();if(P){for(m=0;!M.isZero();m++)T=M.andln(255),M.iushrn(8),$[m]=T;for(;m<x;m++)$[m]=0}else{for(m=0;m<x-w;m++)$[m]=0;for(m=0;!M.isZero();m++)T=M.andln(255),M.iushrn(8),$[x-m-1]=T}return $},Math.clz32?c.prototype._countBits=function(d){return 32-Math.clz32(d)}:c.prototype._countBits=function(d){var g=d,_=0;return g>=4096&&(_+=13,g>>>=13),g>=64&&(_+=7,g>>>=7),g>=8&&(_+=4,g>>>=4),g>=2&&(_+=2,g>>>=2),_+g},c.prototype._zeroBits=function(d){if(d===0)return 26;var g=d,_=0;return g&8191||(_+=13,g>>>=13),g&127||(_+=7,g>>>=7),g&15||(_+=4,g>>>=4),g&3||(_+=2,g>>>=2),g&1||_++,_},c.prototype.bitLength=function(){var d=this.words[this.length-1],g=this._countBits(d);return(this.length-1)*26+g};function R(k){for(var d=new Array(k.bitLength()),g=0;g<d.length;g++){var _=g/26|0,w=g%26;d[g]=(k.words[_]&1<<w)>>>w}return d}c.prototype.zeroBits=function(){if(this.isZero())return 0;for(var d=0,g=0;g<this.length;g++){var _=this._zeroBits(this.words[g]);if(d+=_,_!==26)break}return d},c.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},c.prototype.toTwos=function(d){return this.negative!==0?this.abs().inotn(d).iaddn(1):this.clone()},c.prototype.fromTwos=function(d){return this.testn(d-1)?this.notn(d).iaddn(1).ineg():this.clone()},c.prototype.isNeg=function(){return this.negative!==0},c.prototype.neg=function(){return this.clone().ineg()},c.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},c.prototype.iuor=function(d){for(;this.length<d.length;)this.words[this.length++]=0;for(var g=0;g<d.length;g++)this.words[g]=this.words[g]|d.words[g];return this.strip()},c.prototype.ior=function(d){return l((this.negative|d.negative)===0),this.iuor(d)},c.prototype.or=function(d){return this.length>d.length?this.clone().ior(d):d.clone().ior(this)},c.prototype.uor=function(d){return this.length>d.length?this.clone().iuor(d):d.clone().iuor(this)},c.prototype.iuand=function(d){var g;this.length>d.length?g=d:g=this;for(var _=0;_<g.length;_++)this.words[_]=this.words[_]&d.words[_];return this.length=g.length,this.strip()},c.prototype.iand=function(d){return l((this.negative|d.negative)===0),this.iuand(d)},c.prototype.and=function(d){return this.length>d.length?this.clone().iand(d):d.clone().iand(this)},c.prototype.uand=function(d){return this.length>d.length?this.clone().iuand(d):d.clone().iuand(this)},c.prototype.iuxor=function(d){var g,_;this.length>d.length?(g=this,_=d):(g=d,_=this);for(var w=0;w<_.length;w++)this.words[w]=g.words[w]^_.words[w];if(this!==g)for(;w<g.length;w++)this.words[w]=g.words[w];return this.length=g.length,this.strip()},c.prototype.ixor=function(d){return l((this.negative|d.negative)===0),this.iuxor(d)},c.prototype.xor=function(d){return this.length>d.length?this.clone().ixor(d):d.clone().ixor(this)},c.prototype.uxor=function(d){return this.length>d.length?this.clone().iuxor(d):d.clone().iuxor(this)},c.prototype.inotn=function(d){l(typeof d=="number"&&d>=0);var g=Math.ceil(d/26)|0,_=d%26;this._expand(g),_>0&&g--;for(var w=0;w<g;w++)this.words[w]=~this.words[w]&67108863;return _>0&&(this.words[w]=~this.words[w]&67108863>>26-_),this.strip()},c.prototype.notn=function(d){return this.clone().inotn(d)},c.prototype.setn=function(d,g){l(typeof d=="number"&&d>=0);var _=d/26|0,w=d%26;return this._expand(_+1),g?this.words[_]=this.words[_]|1<<w:this.words[_]=this.words[_]&~(1<<w),this.strip()},c.prototype.iadd=function(d){var g;if(this.negative!==0&&d.negative===0)return this.negative=0,g=this.isub(d),this.negative^=1,this._normSign();if(this.negative===0&&d.negative!==0)return d.negative=0,g=this.isub(d),d.negative=1,g._normSign();var _,w;this.length>d.length?(_=this,w=d):(_=d,w=this);for(var x=0,P=0;P<w.length;P++)g=(_.words[P]|0)+(w.words[P]|0)+x,this.words[P]=g&67108863,x=g>>>26;for(;x!==0&&P<_.length;P++)g=(_.words[P]|0)+x,this.words[P]=g&67108863,x=g>>>26;if(this.length=_.length,x!==0)this.words[this.length]=x,this.length++;else if(_!==this)for(;P<_.length;P++)this.words[P]=_.words[P];return this},c.prototype.add=function(d){var g;return d.negative!==0&&this.negative===0?(d.negative=0,g=this.sub(d),d.negative^=1,g):d.negative===0&&this.negative!==0?(this.negative=0,g=d.sub(this),this.negative=1,g):this.length>d.length?this.clone().iadd(d):d.clone().iadd(this)},c.prototype.isub=function(d){if(d.negative!==0){d.negative=0;var g=this.iadd(d);return d.negative=1,g._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(d),this.negative=1,this._normSign();var _=this.cmp(d);if(_===0)return this.negative=0,this.length=1,this.words[0]=0,this;var w,x;_>0?(w=this,x=d):(w=d,x=this);for(var P=0,$=0;$<x.length;$++)g=(w.words[$]|0)-(x.words[$]|0)+P,P=g>>26,this.words[$]=g&67108863;for(;P!==0&&$<w.length;$++)g=(w.words[$]|0)+P,P=g>>26,this.words[$]=g&67108863;if(P===0&&$<w.length&&w!==this)for(;$<w.length;$++)this.words[$]=w.words[$];return this.length=Math.max(this.length,$),w!==this&&(this.negative=1),this.strip()},c.prototype.sub=function(d){return this.clone().isub(d)};function O(k,d,g){g.negative=d.negative^k.negative;var _=k.length+d.length|0;g.length=_,_=_-1|0;var w=k.words[0]|0,x=d.words[0]|0,P=w*x,$=P&67108863,T=P/67108864|0;g.words[0]=$;for(var m=1;m<_;m++){for(var M=T>>>26,W=T&67108863,Y=Math.min(m,d.length-1),ue=Math.max(0,m-k.length+1);ue<=Y;ue++){var ge=m-ue|0;w=k.words[ge]|0,x=d.words[ue]|0,P=w*x+W,M+=P/67108864|0,W=P&67108863}g.words[m]=W|0,T=M|0}return T!==0?g.words[m]=T|0:g.length--,g.strip()}var I=function(d,g,_){var w=d.words,x=g.words,P=_.words,$=0,T,m,M,W=w[0]|0,Y=W&8191,ue=W>>>13,ge=w[1]|0,he=ge&8191,ae=ge>>>13,de=w[2]|0,pe=de&8191,oe=de>>>13,le=w[3]|0,me=le&8191,xe=le>>>13,Ne=w[4]|0,Pe=Ne&8191,Ie=Ne>>>13,Ke=w[5]|0,Le=Ke&8191,Ce=Ke>>>13,at=w[6]|0,Oe=at&8191,De=at>>>13,yt=w[7]|0,Ue=yt&8191,ze=yt>>>13,Mt=w[8]|0,se=Mt&8191,j=Mt>>>13,X=w[9]|0,ce=X&8191,be=X>>>13,Re=x[0]|0,Se=Re&8191,qe=Re>>>13,bt=x[1]|0,je=bt&8191,We=bt>>>13,St=x[2]|0,ut=St&8191,vt=St>>>13,zt=x[3]|0,st=zt&8191,nt=zt>>>13,Vt=x[4]|0,tt=Vt&8191,ft=Vt>>>13,Ft=x[5]|0,Qe=Ft&8191,rt=Ft>>>13,Bt=x[6]|0,Xe=Bt&8191,ct=Bt>>>13,Ut=x[7]|0,Je=Ut&8191,it=Ut>>>13,qt=x[8]|0,et=qt&8191,ht=qt>>>13,ar=x[9]|0,dt=ar&8191,mt=ar>>>13;_.negative=d.negative^g.negative,_.length=19,T=Math.imul(Y,Se),m=Math.imul(Y,qe),m=m+Math.imul(ue,Se)|0,M=Math.imul(ue,qe);var Xt=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,T=Math.imul(he,Se),m=Math.imul(he,qe),m=m+Math.imul(ae,Se)|0,M=Math.imul(ae,qe),T=T+Math.imul(Y,je)|0,m=m+Math.imul(Y,We)|0,m=m+Math.imul(ue,je)|0,M=M+Math.imul(ue,We)|0;var er=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(er>>>26)|0,er&=67108863,T=Math.imul(pe,Se),m=Math.imul(pe,qe),m=m+Math.imul(oe,Se)|0,M=Math.imul(oe,qe),T=T+Math.imul(he,je)|0,m=m+Math.imul(he,We)|0,m=m+Math.imul(ae,je)|0,M=M+Math.imul(ae,We)|0,T=T+Math.imul(Y,ut)|0,m=m+Math.imul(Y,vt)|0,m=m+Math.imul(ue,ut)|0,M=M+Math.imul(ue,vt)|0;var kr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(kr>>>26)|0,kr&=67108863,T=Math.imul(me,Se),m=Math.imul(me,qe),m=m+Math.imul(xe,Se)|0,M=Math.imul(xe,qe),T=T+Math.imul(pe,je)|0,m=m+Math.imul(pe,We)|0,m=m+Math.imul(oe,je)|0,M=M+Math.imul(oe,We)|0,T=T+Math.imul(he,ut)|0,m=m+Math.imul(he,vt)|0,m=m+Math.imul(ae,ut)|0,M=M+Math.imul(ae,vt)|0,T=T+Math.imul(Y,st)|0,m=m+Math.imul(Y,nt)|0,m=m+Math.imul(ue,st)|0,M=M+Math.imul(ue,nt)|0;var Ar=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,T=Math.imul(Pe,Se),m=Math.imul(Pe,qe),m=m+Math.imul(Ie,Se)|0,M=Math.imul(Ie,qe),T=T+Math.imul(me,je)|0,m=m+Math.imul(me,We)|0,m=m+Math.imul(xe,je)|0,M=M+Math.imul(xe,We)|0,T=T+Math.imul(pe,ut)|0,m=m+Math.imul(pe,vt)|0,m=m+Math.imul(oe,ut)|0,M=M+Math.imul(oe,vt)|0,T=T+Math.imul(he,st)|0,m=m+Math.imul(he,nt)|0,m=m+Math.imul(ae,st)|0,M=M+Math.imul(ae,nt)|0,T=T+Math.imul(Y,tt)|0,m=m+Math.imul(Y,ft)|0,m=m+Math.imul(ue,tt)|0,M=M+Math.imul(ue,ft)|0;var Tr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Tr>>>26)|0,Tr&=67108863,T=Math.imul(Le,Se),m=Math.imul(Le,qe),m=m+Math.imul(Ce,Se)|0,M=Math.imul(Ce,qe),T=T+Math.imul(Pe,je)|0,m=m+Math.imul(Pe,We)|0,m=m+Math.imul(Ie,je)|0,M=M+Math.imul(Ie,We)|0,T=T+Math.imul(me,ut)|0,m=m+Math.imul(me,vt)|0,m=m+Math.imul(xe,ut)|0,M=M+Math.imul(xe,vt)|0,T=T+Math.imul(pe,st)|0,m=m+Math.imul(pe,nt)|0,m=m+Math.imul(oe,st)|0,M=M+Math.imul(oe,nt)|0,T=T+Math.imul(he,tt)|0,m=m+Math.imul(he,ft)|0,m=m+Math.imul(ae,tt)|0,M=M+Math.imul(ae,ft)|0,T=T+Math.imul(Y,Qe)|0,m=m+Math.imul(Y,rt)|0,m=m+Math.imul(ue,Qe)|0,M=M+Math.imul(ue,rt)|0;var Rr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,T=Math.imul(Oe,Se),m=Math.imul(Oe,qe),m=m+Math.imul(De,Se)|0,M=Math.imul(De,qe),T=T+Math.imul(Le,je)|0,m=m+Math.imul(Le,We)|0,m=m+Math.imul(Ce,je)|0,M=M+Math.imul(Ce,We)|0,T=T+Math.imul(Pe,ut)|0,m=m+Math.imul(Pe,vt)|0,m=m+Math.imul(Ie,ut)|0,M=M+Math.imul(Ie,vt)|0,T=T+Math.imul(me,st)|0,m=m+Math.imul(me,nt)|0,m=m+Math.imul(xe,st)|0,M=M+Math.imul(xe,nt)|0,T=T+Math.imul(pe,tt)|0,m=m+Math.imul(pe,ft)|0,m=m+Math.imul(oe,tt)|0,M=M+Math.imul(oe,ft)|0,T=T+Math.imul(he,Qe)|0,m=m+Math.imul(he,rt)|0,m=m+Math.imul(ae,Qe)|0,M=M+Math.imul(ae,rt)|0,T=T+Math.imul(Y,Xe)|0,m=m+Math.imul(Y,ct)|0,m=m+Math.imul(ue,Xe)|0,M=M+Math.imul(ue,ct)|0;var pr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(pr>>>26)|0,pr&=67108863,T=Math.imul(Ue,Se),m=Math.imul(Ue,qe),m=m+Math.imul(ze,Se)|0,M=Math.imul(ze,qe),T=T+Math.imul(Oe,je)|0,m=m+Math.imul(Oe,We)|0,m=m+Math.imul(De,je)|0,M=M+Math.imul(De,We)|0,T=T+Math.imul(Le,ut)|0,m=m+Math.imul(Le,vt)|0,m=m+Math.imul(Ce,ut)|0,M=M+Math.imul(Ce,vt)|0,T=T+Math.imul(Pe,st)|0,m=m+Math.imul(Pe,nt)|0,m=m+Math.imul(Ie,st)|0,M=M+Math.imul(Ie,nt)|0,T=T+Math.imul(me,tt)|0,m=m+Math.imul(me,ft)|0,m=m+Math.imul(xe,tt)|0,M=M+Math.imul(xe,ft)|0,T=T+Math.imul(pe,Qe)|0,m=m+Math.imul(pe,rt)|0,m=m+Math.imul(oe,Qe)|0,M=M+Math.imul(oe,rt)|0,T=T+Math.imul(he,Xe)|0,m=m+Math.imul(he,ct)|0,m=m+Math.imul(ae,Xe)|0,M=M+Math.imul(ae,ct)|0,T=T+Math.imul(Y,Je)|0,m=m+Math.imul(Y,it)|0,m=m+Math.imul(ue,Je)|0,M=M+Math.imul(ue,it)|0;var _r=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(_r>>>26)|0,_r&=67108863,T=Math.imul(se,Se),m=Math.imul(se,qe),m=m+Math.imul(j,Se)|0,M=Math.imul(j,qe),T=T+Math.imul(Ue,je)|0,m=m+Math.imul(Ue,We)|0,m=m+Math.imul(ze,je)|0,M=M+Math.imul(ze,We)|0,T=T+Math.imul(Oe,ut)|0,m=m+Math.imul(Oe,vt)|0,m=m+Math.imul(De,ut)|0,M=M+Math.imul(De,vt)|0,T=T+Math.imul(Le,st)|0,m=m+Math.imul(Le,nt)|0,m=m+Math.imul(Ce,st)|0,M=M+Math.imul(Ce,nt)|0,T=T+Math.imul(Pe,tt)|0,m=m+Math.imul(Pe,ft)|0,m=m+Math.imul(Ie,tt)|0,M=M+Math.imul(Ie,ft)|0,T=T+Math.imul(me,Qe)|0,m=m+Math.imul(me,rt)|0,m=m+Math.imul(xe,Qe)|0,M=M+Math.imul(xe,rt)|0,T=T+Math.imul(pe,Xe)|0,m=m+Math.imul(pe,ct)|0,m=m+Math.imul(oe,Xe)|0,M=M+Math.imul(oe,ct)|0,T=T+Math.imul(he,Je)|0,m=m+Math.imul(he,it)|0,m=m+Math.imul(ae,Je)|0,M=M+Math.imul(ae,it)|0,T=T+Math.imul(Y,et)|0,m=m+Math.imul(Y,ht)|0,m=m+Math.imul(ue,et)|0,M=M+Math.imul(ue,ht)|0;var fr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(fr>>>26)|0,fr&=67108863,T=Math.imul(ce,Se),m=Math.imul(ce,qe),m=m+Math.imul(be,Se)|0,M=Math.imul(be,qe),T=T+Math.imul(se,je)|0,m=m+Math.imul(se,We)|0,m=m+Math.imul(j,je)|0,M=M+Math.imul(j,We)|0,T=T+Math.imul(Ue,ut)|0,m=m+Math.imul(Ue,vt)|0,m=m+Math.imul(ze,ut)|0,M=M+Math.imul(ze,vt)|0,T=T+Math.imul(Oe,st)|0,m=m+Math.imul(Oe,nt)|0,m=m+Math.imul(De,st)|0,M=M+Math.imul(De,nt)|0,T=T+Math.imul(Le,tt)|0,m=m+Math.imul(Le,ft)|0,m=m+Math.imul(Ce,tt)|0,M=M+Math.imul(Ce,ft)|0,T=T+Math.imul(Pe,Qe)|0,m=m+Math.imul(Pe,rt)|0,m=m+Math.imul(Ie,Qe)|0,M=M+Math.imul(Ie,rt)|0,T=T+Math.imul(me,Xe)|0,m=m+Math.imul(me,ct)|0,m=m+Math.imul(xe,Xe)|0,M=M+Math.imul(xe,ct)|0,T=T+Math.imul(pe,Je)|0,m=m+Math.imul(pe,it)|0,m=m+Math.imul(oe,Je)|0,M=M+Math.imul(oe,it)|0,T=T+Math.imul(he,et)|0,m=m+Math.imul(he,ht)|0,m=m+Math.imul(ae,et)|0,M=M+Math.imul(ae,ht)|0,T=T+Math.imul(Y,dt)|0,m=m+Math.imul(Y,mt)|0,m=m+Math.imul(ue,dt)|0,M=M+Math.imul(ue,mt)|0;var Ht=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,T=Math.imul(ce,je),m=Math.imul(ce,We),m=m+Math.imul(be,je)|0,M=Math.imul(be,We),T=T+Math.imul(se,ut)|0,m=m+Math.imul(se,vt)|0,m=m+Math.imul(j,ut)|0,M=M+Math.imul(j,vt)|0,T=T+Math.imul(Ue,st)|0,m=m+Math.imul(Ue,nt)|0,m=m+Math.imul(ze,st)|0,M=M+Math.imul(ze,nt)|0,T=T+Math.imul(Oe,tt)|0,m=m+Math.imul(Oe,ft)|0,m=m+Math.imul(De,tt)|0,M=M+Math.imul(De,ft)|0,T=T+Math.imul(Le,Qe)|0,m=m+Math.imul(Le,rt)|0,m=m+Math.imul(Ce,Qe)|0,M=M+Math.imul(Ce,rt)|0,T=T+Math.imul(Pe,Xe)|0,m=m+Math.imul(Pe,ct)|0,m=m+Math.imul(Ie,Xe)|0,M=M+Math.imul(Ie,ct)|0,T=T+Math.imul(me,Je)|0,m=m+Math.imul(me,it)|0,m=m+Math.imul(xe,Je)|0,M=M+Math.imul(xe,it)|0,T=T+Math.imul(pe,et)|0,m=m+Math.imul(pe,ht)|0,m=m+Math.imul(oe,et)|0,M=M+Math.imul(oe,ht)|0,T=T+Math.imul(he,dt)|0,m=m+Math.imul(he,mt)|0,m=m+Math.imul(ae,dt)|0,M=M+Math.imul(ae,mt)|0;var Cr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,T=Math.imul(ce,ut),m=Math.imul(ce,vt),m=m+Math.imul(be,ut)|0,M=Math.imul(be,vt),T=T+Math.imul(se,st)|0,m=m+Math.imul(se,nt)|0,m=m+Math.imul(j,st)|0,M=M+Math.imul(j,nt)|0,T=T+Math.imul(Ue,tt)|0,m=m+Math.imul(Ue,ft)|0,m=m+Math.imul(ze,tt)|0,M=M+Math.imul(ze,ft)|0,T=T+Math.imul(Oe,Qe)|0,m=m+Math.imul(Oe,rt)|0,m=m+Math.imul(De,Qe)|0,M=M+Math.imul(De,rt)|0,T=T+Math.imul(Le,Xe)|0,m=m+Math.imul(Le,ct)|0,m=m+Math.imul(Ce,Xe)|0,M=M+Math.imul(Ce,ct)|0,T=T+Math.imul(Pe,Je)|0,m=m+Math.imul(Pe,it)|0,m=m+Math.imul(Ie,Je)|0,M=M+Math.imul(Ie,it)|0,T=T+Math.imul(me,et)|0,m=m+Math.imul(me,ht)|0,m=m+Math.imul(xe,et)|0,M=M+Math.imul(xe,ht)|0,T=T+Math.imul(pe,dt)|0,m=m+Math.imul(pe,mt)|0,m=m+Math.imul(oe,dt)|0,M=M+Math.imul(oe,mt)|0;var ur=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(ur>>>26)|0,ur&=67108863,T=Math.imul(ce,st),m=Math.imul(ce,nt),m=m+Math.imul(be,st)|0,M=Math.imul(be,nt),T=T+Math.imul(se,tt)|0,m=m+Math.imul(se,ft)|0,m=m+Math.imul(j,tt)|0,M=M+Math.imul(j,ft)|0,T=T+Math.imul(Ue,Qe)|0,m=m+Math.imul(Ue,rt)|0,m=m+Math.imul(ze,Qe)|0,M=M+Math.imul(ze,rt)|0,T=T+Math.imul(Oe,Xe)|0,m=m+Math.imul(Oe,ct)|0,m=m+Math.imul(De,Xe)|0,M=M+Math.imul(De,ct)|0,T=T+Math.imul(Le,Je)|0,m=m+Math.imul(Le,it)|0,m=m+Math.imul(Ce,Je)|0,M=M+Math.imul(Ce,it)|0,T=T+Math.imul(Pe,et)|0,m=m+Math.imul(Pe,ht)|0,m=m+Math.imul(Ie,et)|0,M=M+Math.imul(Ie,ht)|0,T=T+Math.imul(me,dt)|0,m=m+Math.imul(me,mt)|0,m=m+Math.imul(xe,dt)|0,M=M+Math.imul(xe,mt)|0;var wr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(wr>>>26)|0,wr&=67108863,T=Math.imul(ce,tt),m=Math.imul(ce,ft),m=m+Math.imul(be,tt)|0,M=Math.imul(be,ft),T=T+Math.imul(se,Qe)|0,m=m+Math.imul(se,rt)|0,m=m+Math.imul(j,Qe)|0,M=M+Math.imul(j,rt)|0,T=T+Math.imul(Ue,Xe)|0,m=m+Math.imul(Ue,ct)|0,m=m+Math.imul(ze,Xe)|0,M=M+Math.imul(ze,ct)|0,T=T+Math.imul(Oe,Je)|0,m=m+Math.imul(Oe,it)|0,m=m+Math.imul(De,Je)|0,M=M+Math.imul(De,it)|0,T=T+Math.imul(Le,et)|0,m=m+Math.imul(Le,ht)|0,m=m+Math.imul(Ce,et)|0,M=M+Math.imul(Ce,ht)|0,T=T+Math.imul(Pe,dt)|0,m=m+Math.imul(Pe,mt)|0,m=m+Math.imul(Ie,dt)|0,M=M+Math.imul(Ie,mt)|0;var yr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(yr>>>26)|0,yr&=67108863,T=Math.imul(ce,Qe),m=Math.imul(ce,rt),m=m+Math.imul(be,Qe)|0,M=Math.imul(be,rt),T=T+Math.imul(se,Xe)|0,m=m+Math.imul(se,ct)|0,m=m+Math.imul(j,Xe)|0,M=M+Math.imul(j,ct)|0,T=T+Math.imul(Ue,Je)|0,m=m+Math.imul(Ue,it)|0,m=m+Math.imul(ze,Je)|0,M=M+Math.imul(ze,it)|0,T=T+Math.imul(Oe,et)|0,m=m+Math.imul(Oe,ht)|0,m=m+Math.imul(De,et)|0,M=M+Math.imul(De,ht)|0,T=T+Math.imul(Le,dt)|0,m=m+Math.imul(Le,mt)|0,m=m+Math.imul(Ce,dt)|0,M=M+Math.imul(Ce,mt)|0;var Mr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,T=Math.imul(ce,Xe),m=Math.imul(ce,ct),m=m+Math.imul(be,Xe)|0,M=Math.imul(be,ct),T=T+Math.imul(se,Je)|0,m=m+Math.imul(se,it)|0,m=m+Math.imul(j,Je)|0,M=M+Math.imul(j,it)|0,T=T+Math.imul(Ue,et)|0,m=m+Math.imul(Ue,ht)|0,m=m+Math.imul(ze,et)|0,M=M+Math.imul(ze,ht)|0,T=T+Math.imul(Oe,dt)|0,m=m+Math.imul(Oe,mt)|0,m=m+Math.imul(De,dt)|0,M=M+Math.imul(De,mt)|0;var Er=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Er>>>26)|0,Er&=67108863,T=Math.imul(ce,Je),m=Math.imul(ce,it),m=m+Math.imul(be,Je)|0,M=Math.imul(be,it),T=T+Math.imul(se,et)|0,m=m+Math.imul(se,ht)|0,m=m+Math.imul(j,et)|0,M=M+Math.imul(j,ht)|0,T=T+Math.imul(Ue,dt)|0,m=m+Math.imul(Ue,mt)|0,m=m+Math.imul(ze,dt)|0,M=M+Math.imul(ze,mt)|0;var gr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(gr>>>26)|0,gr&=67108863,T=Math.imul(ce,et),m=Math.imul(ce,ht),m=m+Math.imul(be,et)|0,M=Math.imul(be,ht),T=T+Math.imul(se,dt)|0,m=m+Math.imul(se,mt)|0,m=m+Math.imul(j,dt)|0,M=M+Math.imul(j,mt)|0;var sr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(sr>>>26)|0,sr&=67108863,T=Math.imul(ce,dt),m=Math.imul(ce,mt),m=m+Math.imul(be,dt)|0,M=Math.imul(be,mt);var Ir=($+T|0)+((m&8191)<<13)|0;return $=(M+(m>>>13)|0)+(Ir>>>26)|0,Ir&=67108863,P[0]=Xt,P[1]=er,P[2]=kr,P[3]=Ar,P[4]=Tr,P[5]=Rr,P[6]=pr,P[7]=_r,P[8]=fr,P[9]=Ht,P[10]=Cr,P[11]=ur,P[12]=wr,P[13]=yr,P[14]=Mr,P[15]=Er,P[16]=gr,P[17]=sr,P[18]=Ir,$!==0&&(P[19]=$,_.length++),_};Math.imul||(I=O);function B(k,d,g){g.negative=d.negative^k.negative,g.length=k.length+d.length;for(var _=0,w=0,x=0;x<g.length-1;x++){var P=w;w=0;for(var $=_&67108863,T=Math.min(x,d.length-1),m=Math.max(0,x-k.length+1);m<=T;m++){var M=x-m,W=k.words[M]|0,Y=d.words[m]|0,ue=W*Y,ge=ue&67108863;P=P+(ue/67108864|0)|0,ge=ge+$|0,$=ge&67108863,P=P+(ge>>>26)|0,w+=P>>>26,P&=67108863}g.words[x]=$,_=P,P=w}return _!==0?g.words[x]=_:g.length--,g.strip()}function N(k,d,g){var _=new D;return _.mulp(k,d,g)}c.prototype.mulTo=function(d,g){var _,w=this.length+d.length;return this.length===10&&d.length===10?_=I(this,d,g):w<63?_=O(this,d,g):w<1024?_=B(this,d,g):_=N(this,d,g),_};function D(k,d){this.x=k,this.y=d}D.prototype.makeRBT=function(d){for(var g=new Array(d),_=c.prototype._countBits(d)-1,w=0;w<d;w++)g[w]=this.revBin(w,_,d);return g},D.prototype.revBin=function(d,g,_){if(d===0||d===_-1)return d;for(var w=0,x=0;x<g;x++)w|=(d&1)<<g-x-1,d>>=1;return w},D.prototype.permute=function(d,g,_,w,x,P){for(var $=0;$<P;$++)w[$]=g[d[$]],x[$]=_[d[$]]},D.prototype.transform=function(d,g,_,w,x,P){this.permute(P,d,g,_,w,x);for(var $=1;$<x;$<<=1)for(var T=$<<1,m=Math.cos(2*Math.PI/T),M=Math.sin(2*Math.PI/T),W=0;W<x;W+=T)for(var Y=m,ue=M,ge=0;ge<$;ge++){var he=_[W+ge],ae=w[W+ge],de=_[W+ge+$],pe=w[W+ge+$],oe=Y*de-ue*pe;pe=Y*pe+ue*de,de=oe,_[W+ge]=he+de,w[W+ge]=ae+pe,_[W+ge+$]=he-de,w[W+ge+$]=ae-pe,ge!==T&&(oe=m*Y-M*ue,ue=m*ue+M*Y,Y=oe)}},D.prototype.guessLen13b=function(d,g){var _=Math.max(g,d)|1,w=_&1,x=0;for(_=_/2|0;_;_=_>>>1)x++;return 1<<x+1+w},D.prototype.conjugate=function(d,g,_){if(!(_<=1))for(var w=0;w<_/2;w++){var x=d[w];d[w]=d[_-w-1],d[_-w-1]=x,x=g[w],g[w]=-g[_-w-1],g[_-w-1]=-x}},D.prototype.normalize13b=function(d,g){for(var _=0,w=0;w<g/2;w++){var x=Math.round(d[2*w+1]/g)*8192+Math.round(d[2*w]/g)+_;d[w]=x&67108863,x<67108864?_=0:_=x/67108864|0}return d},D.prototype.convert13b=function(d,g,_,w){for(var x=0,P=0;P<g;P++)x=x+(d[P]|0),_[2*P]=x&8191,x=x>>>13,_[2*P+1]=x&8191,x=x>>>13;for(P=2*g;P<w;++P)_[P]=0;l(x===0),l((x&-8192)===0)},D.prototype.stub=function(d){for(var g=new Array(d),_=0;_<d;_++)g[_]=0;return g},D.prototype.mulp=function(d,g,_){var w=2*this.guessLen13b(d.length,g.length),x=this.makeRBT(w),P=this.stub(w),$=new Array(w),T=new Array(w),m=new Array(w),M=new Array(w),W=new Array(w),Y=new Array(w),ue=_.words;ue.length=w,this.convert13b(d.words,d.length,$,w),this.convert13b(g.words,g.length,M,w),this.transform($,P,T,m,w,x),this.transform(M,P,W,Y,w,x);for(var ge=0;ge<w;ge++){var he=T[ge]*W[ge]-m[ge]*Y[ge];m[ge]=T[ge]*Y[ge]+m[ge]*W[ge],T[ge]=he}return this.conjugate(T,m,w),this.transform(T,m,ue,P,w,x),this.conjugate(ue,P,w),this.normalize13b(ue,w),_.negative=d.negative^g.negative,_.length=d.length+g.length,_.strip()},c.prototype.mul=function(d){var g=new c(null);return g.words=new Array(this.length+d.length),this.mulTo(d,g)},c.prototype.mulf=function(d){var g=new c(null);return g.words=new Array(this.length+d.length),N(this,d,g)},c.prototype.imul=function(d){return this.clone().mulTo(d,this)},c.prototype.imuln=function(d){l(typeof d=="number"),l(d<67108864);for(var g=0,_=0;_<this.length;_++){var w=(this.words[_]|0)*d,x=(w&67108863)+(g&67108863);g>>=26,g+=w/67108864|0,g+=x>>>26,this.words[_]=x&67108863}return g!==0&&(this.words[_]=g,this.length++),this},c.prototype.muln=function(d){return this.clone().imuln(d)},c.prototype.sqr=function(){return this.mul(this)},c.prototype.isqr=function(){return this.imul(this.clone())},c.prototype.pow=function(d){var g=R(d);if(g.length===0)return new c(1);for(var _=this,w=0;w<g.length&&g[w]===0;w++,_=_.sqr());if(++w<g.length)for(var x=_.sqr();w<g.length;w++,x=x.sqr())g[w]!==0&&(_=_.mul(x));return _},c.prototype.iushln=function(d){l(typeof d=="number"&&d>=0);var g=d%26,_=(d-g)/26,w=67108863>>>26-g<<26-g,x;if(g!==0){var P=0;for(x=0;x<this.length;x++){var $=this.words[x]&w,T=(this.words[x]|0)-$<<g;this.words[x]=T|P,P=$>>>26-g}P&&(this.words[x]=P,this.length++)}if(_!==0){for(x=this.length-1;x>=0;x--)this.words[x+_]=this.words[x];for(x=0;x<_;x++)this.words[x]=0;this.length+=_}return this.strip()},c.prototype.ishln=function(d){return l(this.negative===0),this.iushln(d)},c.prototype.iushrn=function(d,g,_){l(typeof d=="number"&&d>=0);var w;g?w=(g-g%26)/26:w=0;var x=d%26,P=Math.min((d-x)/26,this.length),$=67108863^67108863>>>x<<x,T=_;if(w-=P,w=Math.max(0,w),T){for(var m=0;m<P;m++)T.words[m]=this.words[m];T.length=P}if(P!==0)if(this.length>P)for(this.length-=P,m=0;m<this.length;m++)this.words[m]=this.words[m+P];else this.words[0]=0,this.length=1;var M=0;for(m=this.length-1;m>=0&&(M!==0||m>=w);m--){var W=this.words[m]|0;this.words[m]=M<<26-x|W>>>x,M=W&$}return T&&M!==0&&(T.words[T.length++]=M),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},c.prototype.ishrn=function(d,g,_){return l(this.negative===0),this.iushrn(d,g,_)},c.prototype.shln=function(d){return this.clone().ishln(d)},c.prototype.ushln=function(d){return this.clone().iushln(d)},c.prototype.shrn=function(d){return this.clone().ishrn(d)},c.prototype.ushrn=function(d){return this.clone().iushrn(d)},c.prototype.testn=function(d){l(typeof d=="number"&&d>=0);var g=d%26,_=(d-g)/26,w=1<<g;if(this.length<=_)return!1;var x=this.words[_];return!!(x&w)},c.prototype.imaskn=function(d){l(typeof d=="number"&&d>=0);var g=d%26,_=(d-g)/26;if(l(this.negative===0,"imaskn works only with positive numbers"),this.length<=_)return this;if(g!==0&&_++,this.length=Math.min(_,this.length),g!==0){var w=67108863^67108863>>>g<<g;this.words[this.length-1]&=w}return this.strip()},c.prototype.maskn=function(d){return this.clone().imaskn(d)},c.prototype.iaddn=function(d){return l(typeof d=="number"),l(d<67108864),d<0?this.isubn(-d):this.negative!==0?this.length===1&&(this.words[0]|0)<d?(this.words[0]=d-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(d),this.negative=1,this):this._iaddn(d)},c.prototype._iaddn=function(d){this.words[0]+=d;for(var g=0;g<this.length&&this.words[g]>=67108864;g++)this.words[g]-=67108864,g===this.length-1?this.words[g+1]=1:this.words[g+1]++;return this.length=Math.max(this.length,g+1),this},c.prototype.isubn=function(d){if(l(typeof d=="number"),l(d<67108864),d<0)return this.iaddn(-d);if(this.negative!==0)return this.negative=0,this.iaddn(d),this.negative=1,this;if(this.words[0]-=d,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var g=0;g<this.length&&this.words[g]<0;g++)this.words[g]+=67108864,this.words[g+1]-=1;return this.strip()},c.prototype.addn=function(d){return this.clone().iaddn(d)},c.prototype.subn=function(d){return this.clone().isubn(d)},c.prototype.iabs=function(){return this.negative=0,this},c.prototype.abs=function(){return this.clone().iabs()},c.prototype._ishlnsubmul=function(d,g,_){var w=d.length+_,x;this._expand(w);var P,$=0;for(x=0;x<d.length;x++){P=(this.words[x+_]|0)+$;var T=(d.words[x]|0)*g;P-=T&67108863,$=(P>>26)-(T/67108864|0),this.words[x+_]=P&67108863}for(;x<this.length-_;x++)P=(this.words[x+_]|0)+$,$=P>>26,this.words[x+_]=P&67108863;if($===0)return this.strip();for(l($===-1),$=0,x=0;x<this.length;x++)P=-(this.words[x]|0)+$,$=P>>26,this.words[x]=P&67108863;return this.negative=1,this.strip()},c.prototype._wordDiv=function(d,g){var _=this.length-d.length,w=this.clone(),x=d,P=x.words[x.length-1]|0,$=this._countBits(P);_=26-$,_!==0&&(x=x.ushln(_),w.iushln(_),P=x.words[x.length-1]|0);var T=w.length-x.length,m;if(g!=="mod"){m=new c(null),m.length=T+1,m.words=new Array(m.length);for(var M=0;M<m.length;M++)m.words[M]=0}var W=w.clone()._ishlnsubmul(x,1,T);W.negative===0&&(w=W,m&&(m.words[T]=1));for(var Y=T-1;Y>=0;Y--){var ue=(w.words[x.length+Y]|0)*67108864+(w.words[x.length+Y-1]|0);for(ue=Math.min(ue/P|0,67108863),w._ishlnsubmul(x,ue,Y);w.negative!==0;)ue--,w.negative=0,w._ishlnsubmul(x,1,Y),w.isZero()||(w.negative^=1);m&&(m.words[Y]=ue)}return m&&m.strip(),w.strip(),g!=="div"&&_!==0&&w.iushrn(_),{div:m||null,mod:w}},c.prototype.divmod=function(d,g,_){if(l(!d.isZero()),this.isZero())return{div:new c(0),mod:new c(0)};var w,x,P;return this.negative!==0&&d.negative===0?(P=this.neg().divmod(d,g),g!=="mod"&&(w=P.div.neg()),g!=="div"&&(x=P.mod.neg(),_&&x.negative!==0&&x.iadd(d)),{div:w,mod:x}):this.negative===0&&d.negative!==0?(P=this.divmod(d.neg(),g),g!=="mod"&&(w=P.div.neg()),{div:w,mod:P.mod}):this.negative&d.negative?(P=this.neg().divmod(d.neg(),g),g!=="div"&&(x=P.mod.neg(),_&&x.negative!==0&&x.isub(d)),{div:P.div,mod:x}):d.length>this.length||this.cmp(d)<0?{div:new c(0),mod:this}:d.length===1?g==="div"?{div:this.divn(d.words[0]),mod:null}:g==="mod"?{div:null,mod:new c(this.modn(d.words[0]))}:{div:this.divn(d.words[0]),mod:new c(this.modn(d.words[0]))}:this._wordDiv(d,g)},c.prototype.div=function(d){return this.divmod(d,"div",!1).div},c.prototype.mod=function(d){return this.divmod(d,"mod",!1).mod},c.prototype.umod=function(d){return this.divmod(d,"mod",!0).mod},c.prototype.divRound=function(d){var g=this.divmod(d);if(g.mod.isZero())return g.div;var _=g.div.negative!==0?g.mod.isub(d):g.mod,w=d.ushrn(1),x=d.andln(1),P=_.cmp(w);return P<0||x===1&&P===0?g.div:g.div.negative!==0?g.div.isubn(1):g.div.iaddn(1)},c.prototype.modn=function(d){l(d<=67108863);for(var g=(1<<26)%d,_=0,w=this.length-1;w>=0;w--)_=(g*_+(this.words[w]|0))%d;return _},c.prototype.idivn=function(d){l(d<=67108863);for(var g=0,_=this.length-1;_>=0;_--){var w=(this.words[_]|0)+g*67108864;this.words[_]=w/d|0,g=w%d}return this.strip()},c.prototype.divn=function(d){return this.clone().idivn(d)},c.prototype.egcd=function(d){l(d.negative===0),l(!d.isZero());var g=this,_=d.clone();g.negative!==0?g=g.umod(d):g=g.clone();for(var w=new c(1),x=new c(0),P=new c(0),$=new c(1),T=0;g.isEven()&&_.isEven();)g.iushrn(1),_.iushrn(1),++T;for(var m=_.clone(),M=g.clone();!g.isZero();){for(var W=0,Y=1;!(g.words[0]&Y)&&W<26;++W,Y<<=1);if(W>0)for(g.iushrn(W);W-- >0;)(w.isOdd()||x.isOdd())&&(w.iadd(m),x.isub(M)),w.iushrn(1),x.iushrn(1);for(var ue=0,ge=1;!(_.words[0]&ge)&&ue<26;++ue,ge<<=1);if(ue>0)for(_.iushrn(ue);ue-- >0;)(P.isOdd()||$.isOdd())&&(P.iadd(m),$.isub(M)),P.iushrn(1),$.iushrn(1);g.cmp(_)>=0?(g.isub(_),w.isub(P),x.isub($)):(_.isub(g),P.isub(w),$.isub(x))}return{a:P,b:$,gcd:_.iushln(T)}},c.prototype._invmp=function(d){l(d.negative===0),l(!d.isZero());var g=this,_=d.clone();g.negative!==0?g=g.umod(d):g=g.clone();for(var w=new c(1),x=new c(0),P=_.clone();g.cmpn(1)>0&&_.cmpn(1)>0;){for(var $=0,T=1;!(g.words[0]&T)&&$<26;++$,T<<=1);if($>0)for(g.iushrn($);$-- >0;)w.isOdd()&&w.iadd(P),w.iushrn(1);for(var m=0,M=1;!(_.words[0]&M)&&m<26;++m,M<<=1);if(m>0)for(_.iushrn(m);m-- >0;)x.isOdd()&&x.iadd(P),x.iushrn(1);g.cmp(_)>=0?(g.isub(_),w.isub(x)):(_.isub(g),x.isub(w))}var W;return g.cmpn(1)===0?W=w:W=x,W.cmpn(0)<0&&W.iadd(d),W},c.prototype.gcd=function(d){if(this.isZero())return d.abs();if(d.isZero())return this.abs();var g=this.clone(),_=d.clone();g.negative=0,_.negative=0;for(var w=0;g.isEven()&&_.isEven();w++)g.iushrn(1),_.iushrn(1);do{for(;g.isEven();)g.iushrn(1);for(;_.isEven();)_.iushrn(1);var x=g.cmp(_);if(x<0){var P=g;g=_,_=P}else if(x===0||_.cmpn(1)===0)break;g.isub(_)}while(!0);return _.iushln(w)},c.prototype.invm=function(d){return this.egcd(d).a.umod(d)},c.prototype.isEven=function(){return(this.words[0]&1)===0},c.prototype.isOdd=function(){return(this.words[0]&1)===1},c.prototype.andln=function(d){return this.words[0]&d},c.prototype.bincn=function(d){l(typeof d=="number");var g=d%26,_=(d-g)/26,w=1<<g;if(this.length<=_)return this._expand(_+1),this.words[_]|=w,this;for(var x=w,P=_;x!==0&&P<this.length;P++){var $=this.words[P]|0;$+=x,x=$>>>26,$&=67108863,this.words[P]=$}return x!==0&&(this.words[P]=x,this.length++),this},c.prototype.isZero=function(){return this.length===1&&this.words[0]===0},c.prototype.cmpn=function(d){var g=d<0;if(this.negative!==0&&!g)return-1;if(this.negative===0&&g)return 1;this.strip();var _;if(this.length>1)_=1;else{g&&(d=-d),l(d<=67108863,"Number is too big");var w=this.words[0]|0;_=w===d?0:w<d?-1:1}return this.negative!==0?-_|0:_},c.prototype.cmp=function(d){if(this.negative!==0&&d.negative===0)return-1;if(this.negative===0&&d.negative!==0)return 1;var g=this.ucmp(d);return this.negative!==0?-g|0:g},c.prototype.ucmp=function(d){if(this.length>d.length)return 1;if(this.length<d.length)return-1;for(var g=0,_=this.length-1;_>=0;_--){var w=this.words[_]|0,x=d.words[_]|0;if(w!==x){w<x?g=-1:w>x&&(g=1);break}}return g},c.prototype.gtn=function(d){return this.cmpn(d)===1},c.prototype.gt=function(d){return this.cmp(d)===1},c.prototype.gten=function(d){return this.cmpn(d)>=0},c.prototype.gte=function(d){return this.cmp(d)>=0},c.prototype.ltn=function(d){return this.cmpn(d)===-1},c.prototype.lt=function(d){return this.cmp(d)===-1},c.prototype.lten=function(d){return this.cmpn(d)<=0},c.prototype.lte=function(d){return this.cmp(d)<=0},c.prototype.eqn=function(d){return this.cmpn(d)===0},c.prototype.eq=function(d){return this.cmp(d)===0},c.red=function(d){return new Q(d)},c.prototype.toRed=function(d){return l(!this.red,"Already a number in reduction context"),l(this.negative===0,"red works only with positives"),d.convertTo(this)._forceRed(d)},c.prototype.fromRed=function(){return l(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},c.prototype._forceRed=function(d){return this.red=d,this},c.prototype.forceRed=function(d){return l(!this.red,"Already a number in reduction context"),this._forceRed(d)},c.prototype.redAdd=function(d){return l(this.red,"redAdd works only with red numbers"),this.red.add(this,d)},c.prototype.redIAdd=function(d){return l(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,d)},c.prototype.redSub=function(d){return l(this.red,"redSub works only with red numbers"),this.red.sub(this,d)},c.prototype.redISub=function(d){return l(this.red,"redISub works only with red numbers"),this.red.isub(this,d)},c.prototype.redShl=function(d){return l(this.red,"redShl works only with red numbers"),this.red.shl(this,d)},c.prototype.redMul=function(d){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.mul(this,d)},c.prototype.redIMul=function(d){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.imul(this,d)},c.prototype.redSqr=function(){return l(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},c.prototype.redISqr=function(){return l(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},c.prototype.redSqrt=function(){return l(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},c.prototype.redInvm=function(){return l(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},c.prototype.redNeg=function(){return l(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},c.prototype.redPow=function(d){return l(this.red&&!d.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,d)};var G={k256:null,p224:null,p192:null,p25519:null};function V(k,d){this.name=k,this.p=new c(d,16),this.n=this.p.bitLength(),this.k=new c(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}V.prototype._tmp=function(){var d=new c(null);return d.words=new Array(Math.ceil(this.n/13)),d},V.prototype.ireduce=function(d){var g=d,_;do this.split(g,this.tmp),g=this.imulK(g),g=g.iadd(this.tmp),_=g.bitLength();while(_>this.n);var w=_<this.n?-1:g.ucmp(this.p);return w===0?(g.words[0]=0,g.length=1):w>0?g.isub(this.p):g.strip!==void 0?g.strip():g._strip(),g},V.prototype.split=function(d,g){d.iushrn(this.n,0,g)},V.prototype.imulK=function(d){return d.imul(this.k)};function U(){V.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}f(U,V),U.prototype.split=function(d,g){for(var _=4194303,w=Math.min(d.length,9),x=0;x<w;x++)g.words[x]=d.words[x];if(g.length=w,d.length<=9){d.words[0]=0,d.length=1;return}var P=d.words[9];for(g.words[g.length++]=P&_,x=10;x<d.length;x++){var $=d.words[x]|0;d.words[x-10]=($&_)<<4|P>>>22,P=$}P>>>=22,d.words[x-10]=P,P===0&&d.length>10?d.length-=10:d.length-=9},U.prototype.imulK=function(d){d.words[d.length]=0,d.words[d.length+1]=0,d.length+=2;for(var g=0,_=0;_<d.length;_++){var w=d.words[_]|0;g+=w*977,d.words[_]=g&67108863,g=w*64+(g/67108864|0)}return d.words[d.length-1]===0&&(d.length--,d.words[d.length-1]===0&&d.length--),d};function te(){V.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}f(te,V);function Z(){V.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}f(Z,V);function J(){V.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}f(J,V),J.prototype.imulK=function(d){for(var g=0,_=0;_<d.length;_++){var w=(d.words[_]|0)*19+g,x=w&67108863;w>>>=26,d.words[_]=x,g=w}return g!==0&&(d.words[d.length++]=g),d},c._prime=function(d){if(G[d])return G[d];var g;if(d==="k256")g=new U;else if(d==="p224")g=new te;else if(d==="p192")g=new Z;else if(d==="p25519")g=new J;else throw new Error("Unknown prime "+d);return G[d]=g,g};function Q(k){if(typeof k=="string"){var d=c._prime(k);this.m=d.p,this.prime=d}else l(k.gtn(1),"modulus must be greater than 1"),this.m=k,this.prime=null}Q.prototype._verify1=function(d){l(d.negative===0,"red works only with positives"),l(d.red,"red works only with red numbers")},Q.prototype._verify2=function(d,g){l((d.negative|g.negative)===0,"red works only with positives"),l(d.red&&d.red===g.red,"red works only with red numbers")},Q.prototype.imod=function(d){return this.prime?this.prime.ireduce(d)._forceRed(this):d.umod(this.m)._forceRed(this)},Q.prototype.neg=function(d){return d.isZero()?d.clone():this.m.sub(d)._forceRed(this)},Q.prototype.add=function(d,g){this._verify2(d,g);var _=d.add(g);return _.cmp(this.m)>=0&&_.isub(this.m),_._forceRed(this)},Q.prototype.iadd=function(d,g){this._verify2(d,g);var _=d.iadd(g);return _.cmp(this.m)>=0&&_.isub(this.m),_},Q.prototype.sub=function(d,g){this._verify2(d,g);var _=d.sub(g);return _.cmpn(0)<0&&_.iadd(this.m),_._forceRed(this)},Q.prototype.isub=function(d,g){this._verify2(d,g);var _=d.isub(g);return _.cmpn(0)<0&&_.iadd(this.m),_},Q.prototype.shl=function(d,g){return this._verify1(d),this.imod(d.ushln(g))},Q.prototype.imul=function(d,g){return this._verify2(d,g),this.imod(d.imul(g))},Q.prototype.mul=function(d,g){return this._verify2(d,g),this.imod(d.mul(g))},Q.prototype.isqr=function(d){return this.imul(d,d.clone())},Q.prototype.sqr=function(d){return this.mul(d,d)},Q.prototype.sqrt=function(d){if(d.isZero())return d.clone();var g=this.m.andln(3);if(l(g%2===1),g===3){var _=this.m.add(new c(1)).iushrn(2);return this.pow(d,_)}for(var w=this.m.subn(1),x=0;!w.isZero()&&w.andln(1)===0;)x++,w.iushrn(1);l(!w.isZero());var P=new c(1).toRed(this),$=P.redNeg(),T=this.m.subn(1).iushrn(1),m=this.m.bitLength();for(m=new c(2*m*m).toRed(this);this.pow(m,T).cmp($)!==0;)m.redIAdd($);for(var M=this.pow(m,w),W=this.pow(d,w.addn(1).iushrn(1)),Y=this.pow(d,w),ue=x;Y.cmp(P)!==0;){for(var ge=Y,he=0;ge.cmp(P)!==0;he++)ge=ge.redSqr();l(he<ue);var ae=this.pow(M,new c(1).iushln(ue-he-1));W=W.redMul(ae),M=ae.redSqr(),Y=Y.redMul(M),ue=he}return W},Q.prototype.invm=function(d){var g=d._invmp(this.m);return g.negative!==0?(g.negative=0,this.imod(g).redNeg()):this.imod(g)},Q.prototype.pow=function(d,g){if(g.isZero())return new c(1).toRed(this);if(g.cmpn(1)===0)return d.clone();var _=4,w=new Array(1<<_);w[0]=new c(1).toRed(this),w[1]=d;for(var x=2;x<w.length;x++)w[x]=this.mul(w[x-1],d);var P=w[0],$=0,T=0,m=g.bitLength()%26;for(m===0&&(m=26),x=g.length-1;x>=0;x--){for(var M=g.words[x],W=m-1;W>=0;W--){var Y=M>>W&1;if(P!==w[0]&&(P=this.sqr(P)),Y===0&&$===0){T=0;continue}$<<=1,$|=Y,T++,!(T!==_&&(x!==0||W!==0))&&(P=this.mul(P,w[$]),T=0,$=0)}m=26}return P},Q.prototype.convertTo=function(d){var g=d.umod(this.m);return g===d?g.clone():g},Q.prototype.convertFrom=function(d){var g=d.clone();return g.red=null,g},c.mont=function(d){return new ee(d)};function ee(k){Q.call(this,k),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new c(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}f(ee,Q),ee.prototype.convertTo=function(d){return this.imod(d.ushln(this.shift))},ee.prototype.convertFrom=function(d){var g=this.imod(d.mul(this.rinv));return g.red=null,g},ee.prototype.imul=function(d,g){if(d.isZero()||g.isZero())return d.words[0]=0,d.length=1,d;var _=d.imul(g),w=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=_.isub(w).iushrn(this.shift),P=x;return x.cmp(this.m)>=0?P=x.isub(this.m):x.cmpn(0)<0&&(P=x.iadd(this.m)),P._forceRed(this)},ee.prototype.mul=function(d,g){if(d.isZero()||g.isZero())return new c(0)._forceRed(this);var _=d.mul(g),w=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=_.isub(w).iushrn(this.shift),P=x;return x.cmp(this.m)>=0?P=x.isub(this.m):x.cmpn(0)<0&&(P=x.iadd(this.m)),P._forceRed(this)},ee.prototype.invm=function(d){var g=this.imod(d._invmp(this.m).mul(this.r2));return g._forceRed(this)}})(s,bn$c)}(bn$d)),bn$d.exports}var bn$b={exports:{}},bn$a=bn$b.exports,hasRequiredBn$5;function requireBn$5(){return hasRequiredBn$5||(hasRequiredBn$5=1,function(s){(function(a,u){function l(k,d){if(!k)throw new Error(d||"Assertion failed")}function f(k,d){k.super_=d;var g=function(){};g.prototype=d.prototype,k.prototype=new g,k.prototype.constructor=k}function c(k,d,g){if(c.isBN(k))return k;this.negative=0,this.words=null,this.length=0,this.red=null,k!==null&&((d==="le"||d==="be")&&(g=d,d=10),this._init(k||0,d||10,g||"be"))}typeof a=="object"?a.exports=c:u.BN=c,c.BN=c,c.wordSize=26;var h;try{typeof window<"u"&&typeof window.Buffer<"u"?h=window.Buffer:h=require$$2$1.Buffer}catch{}c.isBN=function(d){return d instanceof c?!0:d!==null&&typeof d=="object"&&d.constructor.wordSize===c.wordSize&&Array.isArray(d.words)},c.max=function(d,g){return d.cmp(g)>0?d:g},c.min=function(d,g){return d.cmp(g)<0?d:g},c.prototype._init=function(d,g,_){if(typeof d=="number")return this._initNumber(d,g,_);if(typeof d=="object")return this._initArray(d,g,_);g==="hex"&&(g=16),l(g===(g|0)&&g>=2&&g<=36),d=d.toString().replace(/\s+/g,"");var w=0;d[0]==="-"&&(w++,this.negative=1),w<d.length&&(g===16?this._parseHex(d,w,_):(this._parseBase(d,g,w),_==="le"&&this._initArray(this.toArray(),g,_)))},c.prototype._initNumber=function(d,g,_){d<0&&(this.negative=1,d=-d),d<67108864?(this.words=[d&67108863],this.length=1):d<4503599627370496?(this.words=[d&67108863,d/67108864&67108863],this.length=2):(l(d<9007199254740992),this.words=[d&67108863,d/67108864&67108863,1],this.length=3),_==="le"&&this._initArray(this.toArray(),g,_)},c.prototype._initArray=function(d,g,_){if(l(typeof d.length=="number"),d.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(d.length/3),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var x,P,$=0;if(_==="be")for(w=d.length-1,x=0;w>=0;w-=3)P=d[w]|d[w-1]<<8|d[w-2]<<16,this.words[x]|=P<<$&67108863,this.words[x+1]=P>>>26-$&67108863,$+=24,$>=26&&($-=26,x++);else if(_==="le")for(w=0,x=0;w<d.length;w+=3)P=d[w]|d[w+1]<<8|d[w+2]<<16,this.words[x]|=P<<$&67108863,this.words[x+1]=P>>>26-$&67108863,$+=24,$>=26&&($-=26,x++);return this.strip()};function p(k,d){var g=k.charCodeAt(d);return g>=65&&g<=70?g-55:g>=97&&g<=102?g-87:g-48&15}function v(k,d,g){var _=p(k,g);return g-1>=d&&(_|=p(k,g-1)<<4),_}c.prototype._parseHex=function(d,g,_){this.length=Math.ceil((d.length-g)/6),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var x=0,P=0,$;if(_==="be")for(w=d.length-1;w>=g;w-=2)$=v(d,g,w)<<x,this.words[P]|=$&67108863,x>=18?(x-=18,P+=1,this.words[P]|=$>>>26):x+=8;else{var T=d.length-g;for(w=T%2===0?g+1:g;w<d.length;w+=2)$=v(d,g,w)<<x,this.words[P]|=$&67108863,x>=18?(x-=18,P+=1,this.words[P]|=$>>>26):x+=8}this.strip()};function y(k,d,g,_){for(var w=0,x=Math.min(k.length,g),P=d;P<x;P++){var $=k.charCodeAt(P)-48;w*=_,$>=49?w+=$-49+10:$>=17?w+=$-17+10:w+=$}return w}c.prototype._parseBase=function(d,g,_){this.words=[0],this.length=1;for(var w=0,x=1;x<=67108863;x*=g)w++;w--,x=x/g|0;for(var P=d.length-_,$=P%w,T=Math.min(P,P-$)+_,m=0,M=_;M<T;M+=w)m=y(d,M,M+w,g),this.imuln(x),this.words[0]+m<67108864?this.words[0]+=m:this._iaddn(m);if($!==0){var W=1;for(m=y(d,M,d.length,g),M=0;M<$;M++)W*=g;this.imuln(W),this.words[0]+m<67108864?this.words[0]+=m:this._iaddn(m)}this.strip()},c.prototype.copy=function(d){d.words=new Array(this.length);for(var g=0;g<this.length;g++)d.words[g]=this.words[g];d.length=this.length,d.negative=this.negative,d.red=this.red},c.prototype.clone=function(){var d=new c(null);return this.copy(d),d},c.prototype._expand=function(d){for(;this.length<d;)this.words[this.length++]=0;return this},c.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},c.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},c.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var b=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],S=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],E=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];c.prototype.toString=function(d,g){d=d||10,g=g|0||1;var _;if(d===16||d==="hex"){_="";for(var w=0,x=0,P=0;P<this.length;P++){var $=this.words[P],T=(($<<w|x)&16777215).toString(16);x=$>>>24-w&16777215,x!==0||P!==this.length-1?_=b[6-T.length]+T+_:_=T+_,w+=2,w>=26&&(w-=26,P--)}for(x!==0&&(_=x.toString(16)+_);_.length%g!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}if(d===(d|0)&&d>=2&&d<=36){var m=S[d],M=E[d];_="";var W=this.clone();for(W.negative=0;!W.isZero();){var Y=W.modn(M).toString(d);W=W.idivn(M),W.isZero()?_=Y+_:_=b[m-Y.length]+Y+_}for(this.isZero()&&(_="0"+_);_.length%g!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}l(!1,"Base should be between 2 and 36")},c.prototype.toNumber=function(){var d=this.words[0];return this.length===2?d+=this.words[1]*67108864:this.length===3&&this.words[2]===1?d+=4503599627370496+this.words[1]*67108864:this.length>2&&l(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-d:d},c.prototype.toJSON=function(){return this.toString(16)},c.prototype.toBuffer=function(d,g){return l(typeof h<"u"),this.toArrayLike(h,d,g)},c.prototype.toArray=function(d,g){return this.toArrayLike(Array,d,g)},c.prototype.toArrayLike=function(d,g,_){var w=this.byteLength(),x=_||Math.max(1,w);l(w<=x,"byte array longer than desired length"),l(x>0,"Requested array length <= 0"),this.strip();var P=g==="le",$=new d(x),T,m,M=this.clone();if(P){for(m=0;!M.isZero();m++)T=M.andln(255),M.iushrn(8),$[m]=T;for(;m<x;m++)$[m]=0}else{for(m=0;m<x-w;m++)$[m]=0;for(m=0;!M.isZero();m++)T=M.andln(255),M.iushrn(8),$[x-m-1]=T}return $},Math.clz32?c.prototype._countBits=function(d){return 32-Math.clz32(d)}:c.prototype._countBits=function(d){var g=d,_=0;return g>=4096&&(_+=13,g>>>=13),g>=64&&(_+=7,g>>>=7),g>=8&&(_+=4,g>>>=4),g>=2&&(_+=2,g>>>=2),_+g},c.prototype._zeroBits=function(d){if(d===0)return 26;var g=d,_=0;return g&8191||(_+=13,g>>>=13),g&127||(_+=7,g>>>=7),g&15||(_+=4,g>>>=4),g&3||(_+=2,g>>>=2),g&1||_++,_},c.prototype.bitLength=function(){var d=this.words[this.length-1],g=this._countBits(d);return(this.length-1)*26+g};function R(k){for(var d=new Array(k.bitLength()),g=0;g<d.length;g++){var _=g/26|0,w=g%26;d[g]=(k.words[_]&1<<w)>>>w}return d}c.prototype.zeroBits=function(){if(this.isZero())return 0;for(var d=0,g=0;g<this.length;g++){var _=this._zeroBits(this.words[g]);if(d+=_,_!==26)break}return d},c.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},c.prototype.toTwos=function(d){return this.negative!==0?this.abs().inotn(d).iaddn(1):this.clone()},c.prototype.fromTwos=function(d){return this.testn(d-1)?this.notn(d).iaddn(1).ineg():this.clone()},c.prototype.isNeg=function(){return this.negative!==0},c.prototype.neg=function(){return this.clone().ineg()},c.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},c.prototype.iuor=function(d){for(;this.length<d.length;)this.words[this.length++]=0;for(var g=0;g<d.length;g++)this.words[g]=this.words[g]|d.words[g];return this.strip()},c.prototype.ior=function(d){return l((this.negative|d.negative)===0),this.iuor(d)},c.prototype.or=function(d){return this.length>d.length?this.clone().ior(d):d.clone().ior(this)},c.prototype.uor=function(d){return this.length>d.length?this.clone().iuor(d):d.clone().iuor(this)},c.prototype.iuand=function(d){var g;this.length>d.length?g=d:g=this;for(var _=0;_<g.length;_++)this.words[_]=this.words[_]&d.words[_];return this.length=g.length,this.strip()},c.prototype.iand=function(d){return l((this.negative|d.negative)===0),this.iuand(d)},c.prototype.and=function(d){return this.length>d.length?this.clone().iand(d):d.clone().iand(this)},c.prototype.uand=function(d){return this.length>d.length?this.clone().iuand(d):d.clone().iuand(this)},c.prototype.iuxor=function(d){var g,_;this.length>d.length?(g=this,_=d):(g=d,_=this);for(var w=0;w<_.length;w++)this.words[w]=g.words[w]^_.words[w];if(this!==g)for(;w<g.length;w++)this.words[w]=g.words[w];return this.length=g.length,this.strip()},c.prototype.ixor=function(d){return l((this.negative|d.negative)===0),this.iuxor(d)},c.prototype.xor=function(d){return this.length>d.length?this.clone().ixor(d):d.clone().ixor(this)},c.prototype.uxor=function(d){return this.length>d.length?this.clone().iuxor(d):d.clone().iuxor(this)},c.prototype.inotn=function(d){l(typeof d=="number"&&d>=0);var g=Math.ceil(d/26)|0,_=d%26;this._expand(g),_>0&&g--;for(var w=0;w<g;w++)this.words[w]=~this.words[w]&67108863;return _>0&&(this.words[w]=~this.words[w]&67108863>>26-_),this.strip()},c.prototype.notn=function(d){return this.clone().inotn(d)},c.prototype.setn=function(d,g){l(typeof d=="number"&&d>=0);var _=d/26|0,w=d%26;return this._expand(_+1),g?this.words[_]=this.words[_]|1<<w:this.words[_]=this.words[_]&~(1<<w),this.strip()},c.prototype.iadd=function(d){var g;if(this.negative!==0&&d.negative===0)return this.negative=0,g=this.isub(d),this.negative^=1,this._normSign();if(this.negative===0&&d.negative!==0)return d.negative=0,g=this.isub(d),d.negative=1,g._normSign();var _,w;this.length>d.length?(_=this,w=d):(_=d,w=this);for(var x=0,P=0;P<w.length;P++)g=(_.words[P]|0)+(w.words[P]|0)+x,this.words[P]=g&67108863,x=g>>>26;for(;x!==0&&P<_.length;P++)g=(_.words[P]|0)+x,this.words[P]=g&67108863,x=g>>>26;if(this.length=_.length,x!==0)this.words[this.length]=x,this.length++;else if(_!==this)for(;P<_.length;P++)this.words[P]=_.words[P];return this},c.prototype.add=function(d){var g;return d.negative!==0&&this.negative===0?(d.negative=0,g=this.sub(d),d.negative^=1,g):d.negative===0&&this.negative!==0?(this.negative=0,g=d.sub(this),this.negative=1,g):this.length>d.length?this.clone().iadd(d):d.clone().iadd(this)},c.prototype.isub=function(d){if(d.negative!==0){d.negative=0;var g=this.iadd(d);return d.negative=1,g._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(d),this.negative=1,this._normSign();var _=this.cmp(d);if(_===0)return this.negative=0,this.length=1,this.words[0]=0,this;var w,x;_>0?(w=this,x=d):(w=d,x=this);for(var P=0,$=0;$<x.length;$++)g=(w.words[$]|0)-(x.words[$]|0)+P,P=g>>26,this.words[$]=g&67108863;for(;P!==0&&$<w.length;$++)g=(w.words[$]|0)+P,P=g>>26,this.words[$]=g&67108863;if(P===0&&$<w.length&&w!==this)for(;$<w.length;$++)this.words[$]=w.words[$];return this.length=Math.max(this.length,$),w!==this&&(this.negative=1),this.strip()},c.prototype.sub=function(d){return this.clone().isub(d)};function O(k,d,g){g.negative=d.negative^k.negative;var _=k.length+d.length|0;g.length=_,_=_-1|0;var w=k.words[0]|0,x=d.words[0]|0,P=w*x,$=P&67108863,T=P/67108864|0;g.words[0]=$;for(var m=1;m<_;m++){for(var M=T>>>26,W=T&67108863,Y=Math.min(m,d.length-1),ue=Math.max(0,m-k.length+1);ue<=Y;ue++){var ge=m-ue|0;w=k.words[ge]|0,x=d.words[ue]|0,P=w*x+W,M+=P/67108864|0,W=P&67108863}g.words[m]=W|0,T=M|0}return T!==0?g.words[m]=T|0:g.length--,g.strip()}var I=function(d,g,_){var w=d.words,x=g.words,P=_.words,$=0,T,m,M,W=w[0]|0,Y=W&8191,ue=W>>>13,ge=w[1]|0,he=ge&8191,ae=ge>>>13,de=w[2]|0,pe=de&8191,oe=de>>>13,le=w[3]|0,me=le&8191,xe=le>>>13,Ne=w[4]|0,Pe=Ne&8191,Ie=Ne>>>13,Ke=w[5]|0,Le=Ke&8191,Ce=Ke>>>13,at=w[6]|0,Oe=at&8191,De=at>>>13,yt=w[7]|0,Ue=yt&8191,ze=yt>>>13,Mt=w[8]|0,se=Mt&8191,j=Mt>>>13,X=w[9]|0,ce=X&8191,be=X>>>13,Re=x[0]|0,Se=Re&8191,qe=Re>>>13,bt=x[1]|0,je=bt&8191,We=bt>>>13,St=x[2]|0,ut=St&8191,vt=St>>>13,zt=x[3]|0,st=zt&8191,nt=zt>>>13,Vt=x[4]|0,tt=Vt&8191,ft=Vt>>>13,Ft=x[5]|0,Qe=Ft&8191,rt=Ft>>>13,Bt=x[6]|0,Xe=Bt&8191,ct=Bt>>>13,Ut=x[7]|0,Je=Ut&8191,it=Ut>>>13,qt=x[8]|0,et=qt&8191,ht=qt>>>13,ar=x[9]|0,dt=ar&8191,mt=ar>>>13;_.negative=d.negative^g.negative,_.length=19,T=Math.imul(Y,Se),m=Math.imul(Y,qe),m=m+Math.imul(ue,Se)|0,M=Math.imul(ue,qe);var Xt=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,T=Math.imul(he,Se),m=Math.imul(he,qe),m=m+Math.imul(ae,Se)|0,M=Math.imul(ae,qe),T=T+Math.imul(Y,je)|0,m=m+Math.imul(Y,We)|0,m=m+Math.imul(ue,je)|0,M=M+Math.imul(ue,We)|0;var er=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(er>>>26)|0,er&=67108863,T=Math.imul(pe,Se),m=Math.imul(pe,qe),m=m+Math.imul(oe,Se)|0,M=Math.imul(oe,qe),T=T+Math.imul(he,je)|0,m=m+Math.imul(he,We)|0,m=m+Math.imul(ae,je)|0,M=M+Math.imul(ae,We)|0,T=T+Math.imul(Y,ut)|0,m=m+Math.imul(Y,vt)|0,m=m+Math.imul(ue,ut)|0,M=M+Math.imul(ue,vt)|0;var kr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(kr>>>26)|0,kr&=67108863,T=Math.imul(me,Se),m=Math.imul(me,qe),m=m+Math.imul(xe,Se)|0,M=Math.imul(xe,qe),T=T+Math.imul(pe,je)|0,m=m+Math.imul(pe,We)|0,m=m+Math.imul(oe,je)|0,M=M+Math.imul(oe,We)|0,T=T+Math.imul(he,ut)|0,m=m+Math.imul(he,vt)|0,m=m+Math.imul(ae,ut)|0,M=M+Math.imul(ae,vt)|0,T=T+Math.imul(Y,st)|0,m=m+Math.imul(Y,nt)|0,m=m+Math.imul(ue,st)|0,M=M+Math.imul(ue,nt)|0;var Ar=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,T=Math.imul(Pe,Se),m=Math.imul(Pe,qe),m=m+Math.imul(Ie,Se)|0,M=Math.imul(Ie,qe),T=T+Math.imul(me,je)|0,m=m+Math.imul(me,We)|0,m=m+Math.imul(xe,je)|0,M=M+Math.imul(xe,We)|0,T=T+Math.imul(pe,ut)|0,m=m+Math.imul(pe,vt)|0,m=m+Math.imul(oe,ut)|0,M=M+Math.imul(oe,vt)|0,T=T+Math.imul(he,st)|0,m=m+Math.imul(he,nt)|0,m=m+Math.imul(ae,st)|0,M=M+Math.imul(ae,nt)|0,T=T+Math.imul(Y,tt)|0,m=m+Math.imul(Y,ft)|0,m=m+Math.imul(ue,tt)|0,M=M+Math.imul(ue,ft)|0;var Tr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Tr>>>26)|0,Tr&=67108863,T=Math.imul(Le,Se),m=Math.imul(Le,qe),m=m+Math.imul(Ce,Se)|0,M=Math.imul(Ce,qe),T=T+Math.imul(Pe,je)|0,m=m+Math.imul(Pe,We)|0,m=m+Math.imul(Ie,je)|0,M=M+Math.imul(Ie,We)|0,T=T+Math.imul(me,ut)|0,m=m+Math.imul(me,vt)|0,m=m+Math.imul(xe,ut)|0,M=M+Math.imul(xe,vt)|0,T=T+Math.imul(pe,st)|0,m=m+Math.imul(pe,nt)|0,m=m+Math.imul(oe,st)|0,M=M+Math.imul(oe,nt)|0,T=T+Math.imul(he,tt)|0,m=m+Math.imul(he,ft)|0,m=m+Math.imul(ae,tt)|0,M=M+Math.imul(ae,ft)|0,T=T+Math.imul(Y,Qe)|0,m=m+Math.imul(Y,rt)|0,m=m+Math.imul(ue,Qe)|0,M=M+Math.imul(ue,rt)|0;var Rr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,T=Math.imul(Oe,Se),m=Math.imul(Oe,qe),m=m+Math.imul(De,Se)|0,M=Math.imul(De,qe),T=T+Math.imul(Le,je)|0,m=m+Math.imul(Le,We)|0,m=m+Math.imul(Ce,je)|0,M=M+Math.imul(Ce,We)|0,T=T+Math.imul(Pe,ut)|0,m=m+Math.imul(Pe,vt)|0,m=m+Math.imul(Ie,ut)|0,M=M+Math.imul(Ie,vt)|0,T=T+Math.imul(me,st)|0,m=m+Math.imul(me,nt)|0,m=m+Math.imul(xe,st)|0,M=M+Math.imul(xe,nt)|0,T=T+Math.imul(pe,tt)|0,m=m+Math.imul(pe,ft)|0,m=m+Math.imul(oe,tt)|0,M=M+Math.imul(oe,ft)|0,T=T+Math.imul(he,Qe)|0,m=m+Math.imul(he,rt)|0,m=m+Math.imul(ae,Qe)|0,M=M+Math.imul(ae,rt)|0,T=T+Math.imul(Y,Xe)|0,m=m+Math.imul(Y,ct)|0,m=m+Math.imul(ue,Xe)|0,M=M+Math.imul(ue,ct)|0;var pr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(pr>>>26)|0,pr&=67108863,T=Math.imul(Ue,Se),m=Math.imul(Ue,qe),m=m+Math.imul(ze,Se)|0,M=Math.imul(ze,qe),T=T+Math.imul(Oe,je)|0,m=m+Math.imul(Oe,We)|0,m=m+Math.imul(De,je)|0,M=M+Math.imul(De,We)|0,T=T+Math.imul(Le,ut)|0,m=m+Math.imul(Le,vt)|0,m=m+Math.imul(Ce,ut)|0,M=M+Math.imul(Ce,vt)|0,T=T+Math.imul(Pe,st)|0,m=m+Math.imul(Pe,nt)|0,m=m+Math.imul(Ie,st)|0,M=M+Math.imul(Ie,nt)|0,T=T+Math.imul(me,tt)|0,m=m+Math.imul(me,ft)|0,m=m+Math.imul(xe,tt)|0,M=M+Math.imul(xe,ft)|0,T=T+Math.imul(pe,Qe)|0,m=m+Math.imul(pe,rt)|0,m=m+Math.imul(oe,Qe)|0,M=M+Math.imul(oe,rt)|0,T=T+Math.imul(he,Xe)|0,m=m+Math.imul(he,ct)|0,m=m+Math.imul(ae,Xe)|0,M=M+Math.imul(ae,ct)|0,T=T+Math.imul(Y,Je)|0,m=m+Math.imul(Y,it)|0,m=m+Math.imul(ue,Je)|0,M=M+Math.imul(ue,it)|0;var _r=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(_r>>>26)|0,_r&=67108863,T=Math.imul(se,Se),m=Math.imul(se,qe),m=m+Math.imul(j,Se)|0,M=Math.imul(j,qe),T=T+Math.imul(Ue,je)|0,m=m+Math.imul(Ue,We)|0,m=m+Math.imul(ze,je)|0,M=M+Math.imul(ze,We)|0,T=T+Math.imul(Oe,ut)|0,m=m+Math.imul(Oe,vt)|0,m=m+Math.imul(De,ut)|0,M=M+Math.imul(De,vt)|0,T=T+Math.imul(Le,st)|0,m=m+Math.imul(Le,nt)|0,m=m+Math.imul(Ce,st)|0,M=M+Math.imul(Ce,nt)|0,T=T+Math.imul(Pe,tt)|0,m=m+Math.imul(Pe,ft)|0,m=m+Math.imul(Ie,tt)|0,M=M+Math.imul(Ie,ft)|0,T=T+Math.imul(me,Qe)|0,m=m+Math.imul(me,rt)|0,m=m+Math.imul(xe,Qe)|0,M=M+Math.imul(xe,rt)|0,T=T+Math.imul(pe,Xe)|0,m=m+Math.imul(pe,ct)|0,m=m+Math.imul(oe,Xe)|0,M=M+Math.imul(oe,ct)|0,T=T+Math.imul(he,Je)|0,m=m+Math.imul(he,it)|0,m=m+Math.imul(ae,Je)|0,M=M+Math.imul(ae,it)|0,T=T+Math.imul(Y,et)|0,m=m+Math.imul(Y,ht)|0,m=m+Math.imul(ue,et)|0,M=M+Math.imul(ue,ht)|0;var fr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(fr>>>26)|0,fr&=67108863,T=Math.imul(ce,Se),m=Math.imul(ce,qe),m=m+Math.imul(be,Se)|0,M=Math.imul(be,qe),T=T+Math.imul(se,je)|0,m=m+Math.imul(se,We)|0,m=m+Math.imul(j,je)|0,M=M+Math.imul(j,We)|0,T=T+Math.imul(Ue,ut)|0,m=m+Math.imul(Ue,vt)|0,m=m+Math.imul(ze,ut)|0,M=M+Math.imul(ze,vt)|0,T=T+Math.imul(Oe,st)|0,m=m+Math.imul(Oe,nt)|0,m=m+Math.imul(De,st)|0,M=M+Math.imul(De,nt)|0,T=T+Math.imul(Le,tt)|0,m=m+Math.imul(Le,ft)|0,m=m+Math.imul(Ce,tt)|0,M=M+Math.imul(Ce,ft)|0,T=T+Math.imul(Pe,Qe)|0,m=m+Math.imul(Pe,rt)|0,m=m+Math.imul(Ie,Qe)|0,M=M+Math.imul(Ie,rt)|0,T=T+Math.imul(me,Xe)|0,m=m+Math.imul(me,ct)|0,m=m+Math.imul(xe,Xe)|0,M=M+Math.imul(xe,ct)|0,T=T+Math.imul(pe,Je)|0,m=m+Math.imul(pe,it)|0,m=m+Math.imul(oe,Je)|0,M=M+Math.imul(oe,it)|0,T=T+Math.imul(he,et)|0,m=m+Math.imul(he,ht)|0,m=m+Math.imul(ae,et)|0,M=M+Math.imul(ae,ht)|0,T=T+Math.imul(Y,dt)|0,m=m+Math.imul(Y,mt)|0,m=m+Math.imul(ue,dt)|0,M=M+Math.imul(ue,mt)|0;var Ht=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,T=Math.imul(ce,je),m=Math.imul(ce,We),m=m+Math.imul(be,je)|0,M=Math.imul(be,We),T=T+Math.imul(se,ut)|0,m=m+Math.imul(se,vt)|0,m=m+Math.imul(j,ut)|0,M=M+Math.imul(j,vt)|0,T=T+Math.imul(Ue,st)|0,m=m+Math.imul(Ue,nt)|0,m=m+Math.imul(ze,st)|0,M=M+Math.imul(ze,nt)|0,T=T+Math.imul(Oe,tt)|0,m=m+Math.imul(Oe,ft)|0,m=m+Math.imul(De,tt)|0,M=M+Math.imul(De,ft)|0,T=T+Math.imul(Le,Qe)|0,m=m+Math.imul(Le,rt)|0,m=m+Math.imul(Ce,Qe)|0,M=M+Math.imul(Ce,rt)|0,T=T+Math.imul(Pe,Xe)|0,m=m+Math.imul(Pe,ct)|0,m=m+Math.imul(Ie,Xe)|0,M=M+Math.imul(Ie,ct)|0,T=T+Math.imul(me,Je)|0,m=m+Math.imul(me,it)|0,m=m+Math.imul(xe,Je)|0,M=M+Math.imul(xe,it)|0,T=T+Math.imul(pe,et)|0,m=m+Math.imul(pe,ht)|0,m=m+Math.imul(oe,et)|0,M=M+Math.imul(oe,ht)|0,T=T+Math.imul(he,dt)|0,m=m+Math.imul(he,mt)|0,m=m+Math.imul(ae,dt)|0,M=M+Math.imul(ae,mt)|0;var Cr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,T=Math.imul(ce,ut),m=Math.imul(ce,vt),m=m+Math.imul(be,ut)|0,M=Math.imul(be,vt),T=T+Math.imul(se,st)|0,m=m+Math.imul(se,nt)|0,m=m+Math.imul(j,st)|0,M=M+Math.imul(j,nt)|0,T=T+Math.imul(Ue,tt)|0,m=m+Math.imul(Ue,ft)|0,m=m+Math.imul(ze,tt)|0,M=M+Math.imul(ze,ft)|0,T=T+Math.imul(Oe,Qe)|0,m=m+Math.imul(Oe,rt)|0,m=m+Math.imul(De,Qe)|0,M=M+Math.imul(De,rt)|0,T=T+Math.imul(Le,Xe)|0,m=m+Math.imul(Le,ct)|0,m=m+Math.imul(Ce,Xe)|0,M=M+Math.imul(Ce,ct)|0,T=T+Math.imul(Pe,Je)|0,m=m+Math.imul(Pe,it)|0,m=m+Math.imul(Ie,Je)|0,M=M+Math.imul(Ie,it)|0,T=T+Math.imul(me,et)|0,m=m+Math.imul(me,ht)|0,m=m+Math.imul(xe,et)|0,M=M+Math.imul(xe,ht)|0,T=T+Math.imul(pe,dt)|0,m=m+Math.imul(pe,mt)|0,m=m+Math.imul(oe,dt)|0,M=M+Math.imul(oe,mt)|0;var ur=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(ur>>>26)|0,ur&=67108863,T=Math.imul(ce,st),m=Math.imul(ce,nt),m=m+Math.imul(be,st)|0,M=Math.imul(be,nt),T=T+Math.imul(se,tt)|0,m=m+Math.imul(se,ft)|0,m=m+Math.imul(j,tt)|0,M=M+Math.imul(j,ft)|0,T=T+Math.imul(Ue,Qe)|0,m=m+Math.imul(Ue,rt)|0,m=m+Math.imul(ze,Qe)|0,M=M+Math.imul(ze,rt)|0,T=T+Math.imul(Oe,Xe)|0,m=m+Math.imul(Oe,ct)|0,m=m+Math.imul(De,Xe)|0,M=M+Math.imul(De,ct)|0,T=T+Math.imul(Le,Je)|0,m=m+Math.imul(Le,it)|0,m=m+Math.imul(Ce,Je)|0,M=M+Math.imul(Ce,it)|0,T=T+Math.imul(Pe,et)|0,m=m+Math.imul(Pe,ht)|0,m=m+Math.imul(Ie,et)|0,M=M+Math.imul(Ie,ht)|0,T=T+Math.imul(me,dt)|0,m=m+Math.imul(me,mt)|0,m=m+Math.imul(xe,dt)|0,M=M+Math.imul(xe,mt)|0;var wr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(wr>>>26)|0,wr&=67108863,T=Math.imul(ce,tt),m=Math.imul(ce,ft),m=m+Math.imul(be,tt)|0,M=Math.imul(be,ft),T=T+Math.imul(se,Qe)|0,m=m+Math.imul(se,rt)|0,m=m+Math.imul(j,Qe)|0,M=M+Math.imul(j,rt)|0,T=T+Math.imul(Ue,Xe)|0,m=m+Math.imul(Ue,ct)|0,m=m+Math.imul(ze,Xe)|0,M=M+Math.imul(ze,ct)|0,T=T+Math.imul(Oe,Je)|0,m=m+Math.imul(Oe,it)|0,m=m+Math.imul(De,Je)|0,M=M+Math.imul(De,it)|0,T=T+Math.imul(Le,et)|0,m=m+Math.imul(Le,ht)|0,m=m+Math.imul(Ce,et)|0,M=M+Math.imul(Ce,ht)|0,T=T+Math.imul(Pe,dt)|0,m=m+Math.imul(Pe,mt)|0,m=m+Math.imul(Ie,dt)|0,M=M+Math.imul(Ie,mt)|0;var yr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(yr>>>26)|0,yr&=67108863,T=Math.imul(ce,Qe),m=Math.imul(ce,rt),m=m+Math.imul(be,Qe)|0,M=Math.imul(be,rt),T=T+Math.imul(se,Xe)|0,m=m+Math.imul(se,ct)|0,m=m+Math.imul(j,Xe)|0,M=M+Math.imul(j,ct)|0,T=T+Math.imul(Ue,Je)|0,m=m+Math.imul(Ue,it)|0,m=m+Math.imul(ze,Je)|0,M=M+Math.imul(ze,it)|0,T=T+Math.imul(Oe,et)|0,m=m+Math.imul(Oe,ht)|0,m=m+Math.imul(De,et)|0,M=M+Math.imul(De,ht)|0,T=T+Math.imul(Le,dt)|0,m=m+Math.imul(Le,mt)|0,m=m+Math.imul(Ce,dt)|0,M=M+Math.imul(Ce,mt)|0;var Mr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,T=Math.imul(ce,Xe),m=Math.imul(ce,ct),m=m+Math.imul(be,Xe)|0,M=Math.imul(be,ct),T=T+Math.imul(se,Je)|0,m=m+Math.imul(se,it)|0,m=m+Math.imul(j,Je)|0,M=M+Math.imul(j,it)|0,T=T+Math.imul(Ue,et)|0,m=m+Math.imul(Ue,ht)|0,m=m+Math.imul(ze,et)|0,M=M+Math.imul(ze,ht)|0,T=T+Math.imul(Oe,dt)|0,m=m+Math.imul(Oe,mt)|0,m=m+Math.imul(De,dt)|0,M=M+Math.imul(De,mt)|0;var Er=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Er>>>26)|0,Er&=67108863,T=Math.imul(ce,Je),m=Math.imul(ce,it),m=m+Math.imul(be,Je)|0,M=Math.imul(be,it),T=T+Math.imul(se,et)|0,m=m+Math.imul(se,ht)|0,m=m+Math.imul(j,et)|0,M=M+Math.imul(j,ht)|0,T=T+Math.imul(Ue,dt)|0,m=m+Math.imul(Ue,mt)|0,m=m+Math.imul(ze,dt)|0,M=M+Math.imul(ze,mt)|0;var gr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(gr>>>26)|0,gr&=67108863,T=Math.imul(ce,et),m=Math.imul(ce,ht),m=m+Math.imul(be,et)|0,M=Math.imul(be,ht),T=T+Math.imul(se,dt)|0,m=m+Math.imul(se,mt)|0,m=m+Math.imul(j,dt)|0,M=M+Math.imul(j,mt)|0;var sr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(sr>>>26)|0,sr&=67108863,T=Math.imul(ce,dt),m=Math.imul(ce,mt),m=m+Math.imul(be,dt)|0,M=Math.imul(be,mt);var Ir=($+T|0)+((m&8191)<<13)|0;return $=(M+(m>>>13)|0)+(Ir>>>26)|0,Ir&=67108863,P[0]=Xt,P[1]=er,P[2]=kr,P[3]=Ar,P[4]=Tr,P[5]=Rr,P[6]=pr,P[7]=_r,P[8]=fr,P[9]=Ht,P[10]=Cr,P[11]=ur,P[12]=wr,P[13]=yr,P[14]=Mr,P[15]=Er,P[16]=gr,P[17]=sr,P[18]=Ir,$!==0&&(P[19]=$,_.length++),_};Math.imul||(I=O);function B(k,d,g){g.negative=d.negative^k.negative,g.length=k.length+d.length;for(var _=0,w=0,x=0;x<g.length-1;x++){var P=w;w=0;for(var $=_&67108863,T=Math.min(x,d.length-1),m=Math.max(0,x-k.length+1);m<=T;m++){var M=x-m,W=k.words[M]|0,Y=d.words[m]|0,ue=W*Y,ge=ue&67108863;P=P+(ue/67108864|0)|0,ge=ge+$|0,$=ge&67108863,P=P+(ge>>>26)|0,w+=P>>>26,P&=67108863}g.words[x]=$,_=P,P=w}return _!==0?g.words[x]=_:g.length--,g.strip()}function N(k,d,g){var _=new D;return _.mulp(k,d,g)}c.prototype.mulTo=function(d,g){var _,w=this.length+d.length;return this.length===10&&d.length===10?_=I(this,d,g):w<63?_=O(this,d,g):w<1024?_=B(this,d,g):_=N(this,d,g),_};function D(k,d){this.x=k,this.y=d}D.prototype.makeRBT=function(d){for(var g=new Array(d),_=c.prototype._countBits(d)-1,w=0;w<d;w++)g[w]=this.revBin(w,_,d);return g},D.prototype.revBin=function(d,g,_){if(d===0||d===_-1)return d;for(var w=0,x=0;x<g;x++)w|=(d&1)<<g-x-1,d>>=1;return w},D.prototype.permute=function(d,g,_,w,x,P){for(var $=0;$<P;$++)w[$]=g[d[$]],x[$]=_[d[$]]},D.prototype.transform=function(d,g,_,w,x,P){this.permute(P,d,g,_,w,x);for(var $=1;$<x;$<<=1)for(var T=$<<1,m=Math.cos(2*Math.PI/T),M=Math.sin(2*Math.PI/T),W=0;W<x;W+=T)for(var Y=m,ue=M,ge=0;ge<$;ge++){var he=_[W+ge],ae=w[W+ge],de=_[W+ge+$],pe=w[W+ge+$],oe=Y*de-ue*pe;pe=Y*pe+ue*de,de=oe,_[W+ge]=he+de,w[W+ge]=ae+pe,_[W+ge+$]=he-de,w[W+ge+$]=ae-pe,ge!==T&&(oe=m*Y-M*ue,ue=m*ue+M*Y,Y=oe)}},D.prototype.guessLen13b=function(d,g){var _=Math.max(g,d)|1,w=_&1,x=0;for(_=_/2|0;_;_=_>>>1)x++;return 1<<x+1+w},D.prototype.conjugate=function(d,g,_){if(!(_<=1))for(var w=0;w<_/2;w++){var x=d[w];d[w]=d[_-w-1],d[_-w-1]=x,x=g[w],g[w]=-g[_-w-1],g[_-w-1]=-x}},D.prototype.normalize13b=function(d,g){for(var _=0,w=0;w<g/2;w++){var x=Math.round(d[2*w+1]/g)*8192+Math.round(d[2*w]/g)+_;d[w]=x&67108863,x<67108864?_=0:_=x/67108864|0}return d},D.prototype.convert13b=function(d,g,_,w){for(var x=0,P=0;P<g;P++)x=x+(d[P]|0),_[2*P]=x&8191,x=x>>>13,_[2*P+1]=x&8191,x=x>>>13;for(P=2*g;P<w;++P)_[P]=0;l(x===0),l((x&-8192)===0)},D.prototype.stub=function(d){for(var g=new Array(d),_=0;_<d;_++)g[_]=0;return g},D.prototype.mulp=function(d,g,_){var w=2*this.guessLen13b(d.length,g.length),x=this.makeRBT(w),P=this.stub(w),$=new Array(w),T=new Array(w),m=new Array(w),M=new Array(w),W=new Array(w),Y=new Array(w),ue=_.words;ue.length=w,this.convert13b(d.words,d.length,$,w),this.convert13b(g.words,g.length,M,w),this.transform($,P,T,m,w,x),this.transform(M,P,W,Y,w,x);for(var ge=0;ge<w;ge++){var he=T[ge]*W[ge]-m[ge]*Y[ge];m[ge]=T[ge]*Y[ge]+m[ge]*W[ge],T[ge]=he}return this.conjugate(T,m,w),this.transform(T,m,ue,P,w,x),this.conjugate(ue,P,w),this.normalize13b(ue,w),_.negative=d.negative^g.negative,_.length=d.length+g.length,_.strip()},c.prototype.mul=function(d){var g=new c(null);return g.words=new Array(this.length+d.length),this.mulTo(d,g)},c.prototype.mulf=function(d){var g=new c(null);return g.words=new Array(this.length+d.length),N(this,d,g)},c.prototype.imul=function(d){return this.clone().mulTo(d,this)},c.prototype.imuln=function(d){l(typeof d=="number"),l(d<67108864);for(var g=0,_=0;_<this.length;_++){var w=(this.words[_]|0)*d,x=(w&67108863)+(g&67108863);g>>=26,g+=w/67108864|0,g+=x>>>26,this.words[_]=x&67108863}return g!==0&&(this.words[_]=g,this.length++),this},c.prototype.muln=function(d){return this.clone().imuln(d)},c.prototype.sqr=function(){return this.mul(this)},c.prototype.isqr=function(){return this.imul(this.clone())},c.prototype.pow=function(d){var g=R(d);if(g.length===0)return new c(1);for(var _=this,w=0;w<g.length&&g[w]===0;w++,_=_.sqr());if(++w<g.length)for(var x=_.sqr();w<g.length;w++,x=x.sqr())g[w]!==0&&(_=_.mul(x));return _},c.prototype.iushln=function(d){l(typeof d=="number"&&d>=0);var g=d%26,_=(d-g)/26,w=67108863>>>26-g<<26-g,x;if(g!==0){var P=0;for(x=0;x<this.length;x++){var $=this.words[x]&w,T=(this.words[x]|0)-$<<g;this.words[x]=T|P,P=$>>>26-g}P&&(this.words[x]=P,this.length++)}if(_!==0){for(x=this.length-1;x>=0;x--)this.words[x+_]=this.words[x];for(x=0;x<_;x++)this.words[x]=0;this.length+=_}return this.strip()},c.prototype.ishln=function(d){return l(this.negative===0),this.iushln(d)},c.prototype.iushrn=function(d,g,_){l(typeof d=="number"&&d>=0);var w;g?w=(g-g%26)/26:w=0;var x=d%26,P=Math.min((d-x)/26,this.length),$=67108863^67108863>>>x<<x,T=_;if(w-=P,w=Math.max(0,w),T){for(var m=0;m<P;m++)T.words[m]=this.words[m];T.length=P}if(P!==0)if(this.length>P)for(this.length-=P,m=0;m<this.length;m++)this.words[m]=this.words[m+P];else this.words[0]=0,this.length=1;var M=0;for(m=this.length-1;m>=0&&(M!==0||m>=w);m--){var W=this.words[m]|0;this.words[m]=M<<26-x|W>>>x,M=W&$}return T&&M!==0&&(T.words[T.length++]=M),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},c.prototype.ishrn=function(d,g,_){return l(this.negative===0),this.iushrn(d,g,_)},c.prototype.shln=function(d){return this.clone().ishln(d)},c.prototype.ushln=function(d){return this.clone().iushln(d)},c.prototype.shrn=function(d){return this.clone().ishrn(d)},c.prototype.ushrn=function(d){return this.clone().iushrn(d)},c.prototype.testn=function(d){l(typeof d=="number"&&d>=0);var g=d%26,_=(d-g)/26,w=1<<g;if(this.length<=_)return!1;var x=this.words[_];return!!(x&w)},c.prototype.imaskn=function(d){l(typeof d=="number"&&d>=0);var g=d%26,_=(d-g)/26;if(l(this.negative===0,"imaskn works only with positive numbers"),this.length<=_)return this;if(g!==0&&_++,this.length=Math.min(_,this.length),g!==0){var w=67108863^67108863>>>g<<g;this.words[this.length-1]&=w}return this.strip()},c.prototype.maskn=function(d){return this.clone().imaskn(d)},c.prototype.iaddn=function(d){return l(typeof d=="number"),l(d<67108864),d<0?this.isubn(-d):this.negative!==0?this.length===1&&(this.words[0]|0)<d?(this.words[0]=d-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(d),this.negative=1,this):this._iaddn(d)},c.prototype._iaddn=function(d){this.words[0]+=d;for(var g=0;g<this.length&&this.words[g]>=67108864;g++)this.words[g]-=67108864,g===this.length-1?this.words[g+1]=1:this.words[g+1]++;return this.length=Math.max(this.length,g+1),this},c.prototype.isubn=function(d){if(l(typeof d=="number"),l(d<67108864),d<0)return this.iaddn(-d);if(this.negative!==0)return this.negative=0,this.iaddn(d),this.negative=1,this;if(this.words[0]-=d,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var g=0;g<this.length&&this.words[g]<0;g++)this.words[g]+=67108864,this.words[g+1]-=1;return this.strip()},c.prototype.addn=function(d){return this.clone().iaddn(d)},c.prototype.subn=function(d){return this.clone().isubn(d)},c.prototype.iabs=function(){return this.negative=0,this},c.prototype.abs=function(){return this.clone().iabs()},c.prototype._ishlnsubmul=function(d,g,_){var w=d.length+_,x;this._expand(w);var P,$=0;for(x=0;x<d.length;x++){P=(this.words[x+_]|0)+$;var T=(d.words[x]|0)*g;P-=T&67108863,$=(P>>26)-(T/67108864|0),this.words[x+_]=P&67108863}for(;x<this.length-_;x++)P=(this.words[x+_]|0)+$,$=P>>26,this.words[x+_]=P&67108863;if($===0)return this.strip();for(l($===-1),$=0,x=0;x<this.length;x++)P=-(this.words[x]|0)+$,$=P>>26,this.words[x]=P&67108863;return this.negative=1,this.strip()},c.prototype._wordDiv=function(d,g){var _=this.length-d.length,w=this.clone(),x=d,P=x.words[x.length-1]|0,$=this._countBits(P);_=26-$,_!==0&&(x=x.ushln(_),w.iushln(_),P=x.words[x.length-1]|0);var T=w.length-x.length,m;if(g!=="mod"){m=new c(null),m.length=T+1,m.words=new Array(m.length);for(var M=0;M<m.length;M++)m.words[M]=0}var W=w.clone()._ishlnsubmul(x,1,T);W.negative===0&&(w=W,m&&(m.words[T]=1));for(var Y=T-1;Y>=0;Y--){var ue=(w.words[x.length+Y]|0)*67108864+(w.words[x.length+Y-1]|0);for(ue=Math.min(ue/P|0,67108863),w._ishlnsubmul(x,ue,Y);w.negative!==0;)ue--,w.negative=0,w._ishlnsubmul(x,1,Y),w.isZero()||(w.negative^=1);m&&(m.words[Y]=ue)}return m&&m.strip(),w.strip(),g!=="div"&&_!==0&&w.iushrn(_),{div:m||null,mod:w}},c.prototype.divmod=function(d,g,_){if(l(!d.isZero()),this.isZero())return{div:new c(0),mod:new c(0)};var w,x,P;return this.negative!==0&&d.negative===0?(P=this.neg().divmod(d,g),g!=="mod"&&(w=P.div.neg()),g!=="div"&&(x=P.mod.neg(),_&&x.negative!==0&&x.iadd(d)),{div:w,mod:x}):this.negative===0&&d.negative!==0?(P=this.divmod(d.neg(),g),g!=="mod"&&(w=P.div.neg()),{div:w,mod:P.mod}):this.negative&d.negative?(P=this.neg().divmod(d.neg(),g),g!=="div"&&(x=P.mod.neg(),_&&x.negative!==0&&x.isub(d)),{div:P.div,mod:x}):d.length>this.length||this.cmp(d)<0?{div:new c(0),mod:this}:d.length===1?g==="div"?{div:this.divn(d.words[0]),mod:null}:g==="mod"?{div:null,mod:new c(this.modn(d.words[0]))}:{div:this.divn(d.words[0]),mod:new c(this.modn(d.words[0]))}:this._wordDiv(d,g)},c.prototype.div=function(d){return this.divmod(d,"div",!1).div},c.prototype.mod=function(d){return this.divmod(d,"mod",!1).mod},c.prototype.umod=function(d){return this.divmod(d,"mod",!0).mod},c.prototype.divRound=function(d){var g=this.divmod(d);if(g.mod.isZero())return g.div;var _=g.div.negative!==0?g.mod.isub(d):g.mod,w=d.ushrn(1),x=d.andln(1),P=_.cmp(w);return P<0||x===1&&P===0?g.div:g.div.negative!==0?g.div.isubn(1):g.div.iaddn(1)},c.prototype.modn=function(d){l(d<=67108863);for(var g=(1<<26)%d,_=0,w=this.length-1;w>=0;w--)_=(g*_+(this.words[w]|0))%d;return _},c.prototype.idivn=function(d){l(d<=67108863);for(var g=0,_=this.length-1;_>=0;_--){var w=(this.words[_]|0)+g*67108864;this.words[_]=w/d|0,g=w%d}return this.strip()},c.prototype.divn=function(d){return this.clone().idivn(d)},c.prototype.egcd=function(d){l(d.negative===0),l(!d.isZero());var g=this,_=d.clone();g.negative!==0?g=g.umod(d):g=g.clone();for(var w=new c(1),x=new c(0),P=new c(0),$=new c(1),T=0;g.isEven()&&_.isEven();)g.iushrn(1),_.iushrn(1),++T;for(var m=_.clone(),M=g.clone();!g.isZero();){for(var W=0,Y=1;!(g.words[0]&Y)&&W<26;++W,Y<<=1);if(W>0)for(g.iushrn(W);W-- >0;)(w.isOdd()||x.isOdd())&&(w.iadd(m),x.isub(M)),w.iushrn(1),x.iushrn(1);for(var ue=0,ge=1;!(_.words[0]&ge)&&ue<26;++ue,ge<<=1);if(ue>0)for(_.iushrn(ue);ue-- >0;)(P.isOdd()||$.isOdd())&&(P.iadd(m),$.isub(M)),P.iushrn(1),$.iushrn(1);g.cmp(_)>=0?(g.isub(_),w.isub(P),x.isub($)):(_.isub(g),P.isub(w),$.isub(x))}return{a:P,b:$,gcd:_.iushln(T)}},c.prototype._invmp=function(d){l(d.negative===0),l(!d.isZero());var g=this,_=d.clone();g.negative!==0?g=g.umod(d):g=g.clone();for(var w=new c(1),x=new c(0),P=_.clone();g.cmpn(1)>0&&_.cmpn(1)>0;){for(var $=0,T=1;!(g.words[0]&T)&&$<26;++$,T<<=1);if($>0)for(g.iushrn($);$-- >0;)w.isOdd()&&w.iadd(P),w.iushrn(1);for(var m=0,M=1;!(_.words[0]&M)&&m<26;++m,M<<=1);if(m>0)for(_.iushrn(m);m-- >0;)x.isOdd()&&x.iadd(P),x.iushrn(1);g.cmp(_)>=0?(g.isub(_),w.isub(x)):(_.isub(g),x.isub(w))}var W;return g.cmpn(1)===0?W=w:W=x,W.cmpn(0)<0&&W.iadd(d),W},c.prototype.gcd=function(d){if(this.isZero())return d.abs();if(d.isZero())return this.abs();var g=this.clone(),_=d.clone();g.negative=0,_.negative=0;for(var w=0;g.isEven()&&_.isEven();w++)g.iushrn(1),_.iushrn(1);do{for(;g.isEven();)g.iushrn(1);for(;_.isEven();)_.iushrn(1);var x=g.cmp(_);if(x<0){var P=g;g=_,_=P}else if(x===0||_.cmpn(1)===0)break;g.isub(_)}while(!0);return _.iushln(w)},c.prototype.invm=function(d){return this.egcd(d).a.umod(d)},c.prototype.isEven=function(){return(this.words[0]&1)===0},c.prototype.isOdd=function(){return(this.words[0]&1)===1},c.prototype.andln=function(d){return this.words[0]&d},c.prototype.bincn=function(d){l(typeof d=="number");var g=d%26,_=(d-g)/26,w=1<<g;if(this.length<=_)return this._expand(_+1),this.words[_]|=w,this;for(var x=w,P=_;x!==0&&P<this.length;P++){var $=this.words[P]|0;$+=x,x=$>>>26,$&=67108863,this.words[P]=$}return x!==0&&(this.words[P]=x,this.length++),this},c.prototype.isZero=function(){return this.length===1&&this.words[0]===0},c.prototype.cmpn=function(d){var g=d<0;if(this.negative!==0&&!g)return-1;if(this.negative===0&&g)return 1;this.strip();var _;if(this.length>1)_=1;else{g&&(d=-d),l(d<=67108863,"Number is too big");var w=this.words[0]|0;_=w===d?0:w<d?-1:1}return this.negative!==0?-_|0:_},c.prototype.cmp=function(d){if(this.negative!==0&&d.negative===0)return-1;if(this.negative===0&&d.negative!==0)return 1;var g=this.ucmp(d);return this.negative!==0?-g|0:g},c.prototype.ucmp=function(d){if(this.length>d.length)return 1;if(this.length<d.length)return-1;for(var g=0,_=this.length-1;_>=0;_--){var w=this.words[_]|0,x=d.words[_]|0;if(w!==x){w<x?g=-1:w>x&&(g=1);break}}return g},c.prototype.gtn=function(d){return this.cmpn(d)===1},c.prototype.gt=function(d){return this.cmp(d)===1},c.prototype.gten=function(d){return this.cmpn(d)>=0},c.prototype.gte=function(d){return this.cmp(d)>=0},c.prototype.ltn=function(d){return this.cmpn(d)===-1},c.prototype.lt=function(d){return this.cmp(d)===-1},c.prototype.lten=function(d){return this.cmpn(d)<=0},c.prototype.lte=function(d){return this.cmp(d)<=0},c.prototype.eqn=function(d){return this.cmpn(d)===0},c.prototype.eq=function(d){return this.cmp(d)===0},c.red=function(d){return new Q(d)},c.prototype.toRed=function(d){return l(!this.red,"Already a number in reduction context"),l(this.negative===0,"red works only with positives"),d.convertTo(this)._forceRed(d)},c.prototype.fromRed=function(){return l(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},c.prototype._forceRed=function(d){return this.red=d,this},c.prototype.forceRed=function(d){return l(!this.red,"Already a number in reduction context"),this._forceRed(d)},c.prototype.redAdd=function(d){return l(this.red,"redAdd works only with red numbers"),this.red.add(this,d)},c.prototype.redIAdd=function(d){return l(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,d)},c.prototype.redSub=function(d){return l(this.red,"redSub works only with red numbers"),this.red.sub(this,d)},c.prototype.redISub=function(d){return l(this.red,"redISub works only with red numbers"),this.red.isub(this,d)},c.prototype.redShl=function(d){return l(this.red,"redShl works only with red numbers"),this.red.shl(this,d)},c.prototype.redMul=function(d){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.mul(this,d)},c.prototype.redIMul=function(d){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.imul(this,d)},c.prototype.redSqr=function(){return l(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},c.prototype.redISqr=function(){return l(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},c.prototype.redSqrt=function(){return l(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},c.prototype.redInvm=function(){return l(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},c.prototype.redNeg=function(){return l(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},c.prototype.redPow=function(d){return l(this.red&&!d.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,d)};var G={k256:null,p224:null,p192:null,p25519:null};function V(k,d){this.name=k,this.p=new c(d,16),this.n=this.p.bitLength(),this.k=new c(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}V.prototype._tmp=function(){var d=new c(null);return d.words=new Array(Math.ceil(this.n/13)),d},V.prototype.ireduce=function(d){var g=d,_;do this.split(g,this.tmp),g=this.imulK(g),g=g.iadd(this.tmp),_=g.bitLength();while(_>this.n);var w=_<this.n?-1:g.ucmp(this.p);return w===0?(g.words[0]=0,g.length=1):w>0?g.isub(this.p):g.strip!==void 0?g.strip():g._strip(),g},V.prototype.split=function(d,g){d.iushrn(this.n,0,g)},V.prototype.imulK=function(d){return d.imul(this.k)};function U(){V.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}f(U,V),U.prototype.split=function(d,g){for(var _=4194303,w=Math.min(d.length,9),x=0;x<w;x++)g.words[x]=d.words[x];if(g.length=w,d.length<=9){d.words[0]=0,d.length=1;return}var P=d.words[9];for(g.words[g.length++]=P&_,x=10;x<d.length;x++){var $=d.words[x]|0;d.words[x-10]=($&_)<<4|P>>>22,P=$}P>>>=22,d.words[x-10]=P,P===0&&d.length>10?d.length-=10:d.length-=9},U.prototype.imulK=function(d){d.words[d.length]=0,d.words[d.length+1]=0,d.length+=2;for(var g=0,_=0;_<d.length;_++){var w=d.words[_]|0;g+=w*977,d.words[_]=g&67108863,g=w*64+(g/67108864|0)}return d.words[d.length-1]===0&&(d.length--,d.words[d.length-1]===0&&d.length--),d};function te(){V.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}f(te,V);function Z(){V.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}f(Z,V);function J(){V.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}f(J,V),J.prototype.imulK=function(d){for(var g=0,_=0;_<d.length;_++){var w=(d.words[_]|0)*19+g,x=w&67108863;w>>>=26,d.words[_]=x,g=w}return g!==0&&(d.words[d.length++]=g),d},c._prime=function(d){if(G[d])return G[d];var g;if(d==="k256")g=new U;else if(d==="p224")g=new te;else if(d==="p192")g=new Z;else if(d==="p25519")g=new J;else throw new Error("Unknown prime "+d);return G[d]=g,g};function Q(k){if(typeof k=="string"){var d=c._prime(k);this.m=d.p,this.prime=d}else l(k.gtn(1),"modulus must be greater than 1"),this.m=k,this.prime=null}Q.prototype._verify1=function(d){l(d.negative===0,"red works only with positives"),l(d.red,"red works only with red numbers")},Q.prototype._verify2=function(d,g){l((d.negative|g.negative)===0,"red works only with positives"),l(d.red&&d.red===g.red,"red works only with red numbers")},Q.prototype.imod=function(d){return this.prime?this.prime.ireduce(d)._forceRed(this):d.umod(this.m)._forceRed(this)},Q.prototype.neg=function(d){return d.isZero()?d.clone():this.m.sub(d)._forceRed(this)},Q.prototype.add=function(d,g){this._verify2(d,g);var _=d.add(g);return _.cmp(this.m)>=0&&_.isub(this.m),_._forceRed(this)},Q.prototype.iadd=function(d,g){this._verify2(d,g);var _=d.iadd(g);return _.cmp(this.m)>=0&&_.isub(this.m),_},Q.prototype.sub=function(d,g){this._verify2(d,g);var _=d.sub(g);return _.cmpn(0)<0&&_.iadd(this.m),_._forceRed(this)},Q.prototype.isub=function(d,g){this._verify2(d,g);var _=d.isub(g);return _.cmpn(0)<0&&_.iadd(this.m),_},Q.prototype.shl=function(d,g){return this._verify1(d),this.imod(d.ushln(g))},Q.prototype.imul=function(d,g){return this._verify2(d,g),this.imod(d.imul(g))},Q.prototype.mul=function(d,g){return this._verify2(d,g),this.imod(d.mul(g))},Q.prototype.isqr=function(d){return this.imul(d,d.clone())},Q.prototype.sqr=function(d){return this.mul(d,d)},Q.prototype.sqrt=function(d){if(d.isZero())return d.clone();var g=this.m.andln(3);if(l(g%2===1),g===3){var _=this.m.add(new c(1)).iushrn(2);return this.pow(d,_)}for(var w=this.m.subn(1),x=0;!w.isZero()&&w.andln(1)===0;)x++,w.iushrn(1);l(!w.isZero());var P=new c(1).toRed(this),$=P.redNeg(),T=this.m.subn(1).iushrn(1),m=this.m.bitLength();for(m=new c(2*m*m).toRed(this);this.pow(m,T).cmp($)!==0;)m.redIAdd($);for(var M=this.pow(m,w),W=this.pow(d,w.addn(1).iushrn(1)),Y=this.pow(d,w),ue=x;Y.cmp(P)!==0;){for(var ge=Y,he=0;ge.cmp(P)!==0;he++)ge=ge.redSqr();l(he<ue);var ae=this.pow(M,new c(1).iushln(ue-he-1));W=W.redMul(ae),M=ae.redSqr(),Y=Y.redMul(M),ue=he}return W},Q.prototype.invm=function(d){var g=d._invmp(this.m);return g.negative!==0?(g.negative=0,this.imod(g).redNeg()):this.imod(g)},Q.prototype.pow=function(d,g){if(g.isZero())return new c(1).toRed(this);if(g.cmpn(1)===0)return d.clone();var _=4,w=new Array(1<<_);w[0]=new c(1).toRed(this),w[1]=d;for(var x=2;x<w.length;x++)w[x]=this.mul(w[x-1],d);var P=w[0],$=0,T=0,m=g.bitLength()%26;for(m===0&&(m=26),x=g.length-1;x>=0;x--){for(var M=g.words[x],W=m-1;W>=0;W--){var Y=M>>W&1;if(P!==w[0]&&(P=this.sqr(P)),Y===0&&$===0){T=0;continue}$<<=1,$|=Y,T++,!(T!==_&&(x!==0||W!==0))&&(P=this.mul(P,w[$]),T=0,$=0)}m=26}return P},Q.prototype.convertTo=function(d){var g=d.umod(this.m);return g===d?g.clone():g},Q.prototype.convertFrom=function(d){var g=d.clone();return g.red=null,g},c.mont=function(d){return new ee(d)};function ee(k){Q.call(this,k),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new c(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}f(ee,Q),ee.prototype.convertTo=function(d){return this.imod(d.ushln(this.shift))},ee.prototype.convertFrom=function(d){var g=this.imod(d.mul(this.rinv));return g.red=null,g},ee.prototype.imul=function(d,g){if(d.isZero()||g.isZero())return d.words[0]=0,d.length=1,d;var _=d.imul(g),w=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=_.isub(w).iushrn(this.shift),P=x;return x.cmp(this.m)>=0?P=x.isub(this.m):x.cmpn(0)<0&&(P=x.iadd(this.m)),P._forceRed(this)},ee.prototype.mul=function(d,g){if(d.isZero()||g.isZero())return new c(0)._forceRed(this);var _=d.mul(g),w=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=_.isub(w).iushrn(this.shift),P=x;return x.cmp(this.m)>=0?P=x.isub(this.m):x.cmpn(0)<0&&(P=x.iadd(this.m)),P._forceRed(this)},ee.prototype.invm=function(d){var g=this.imod(d._invmp(this.m).mul(this.r2));return g._forceRed(this)}})(s,bn$a)}(bn$b)),bn$b.exports}var brorand={exports:{}},hasRequiredBrorand;function requireBrorand(){if(hasRequiredBrorand)return brorand.exports;hasRequiredBrorand=1;var s;brorand.exports=function(f){return s||(s=new a(null)),s.generate(f)};function a(l){this.rand=l}if(brorand.exports.Rand=a,a.prototype.generate=function(f){return this._rand(f)},a.prototype._rand=function(f){if(this.rand.getBytes)return this.rand.getBytes(f);for(var c=new Uint8Array(f),h=0;h<c.length;h++)c[h]=this.rand.getByte();return c},typeof self=="object")self.crypto&&self.crypto.getRandomValues?a.prototype._rand=function(f){var c=new Uint8Array(f);return self.crypto.getRandomValues(c),c}:self.msCrypto&&self.msCrypto.getRandomValues?a.prototype._rand=function(f){var c=new Uint8Array(f);return self.msCrypto.getRandomValues(c),c}:typeof window=="object"&&(a.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var u=requireCryptoBrowserify();if(typeof u.randomBytes!="function")throw new Error("Not supported");a.prototype._rand=function(f){return u.randomBytes(f)}}catch{}return brorand.exports}var mr,hasRequiredMr;function requireMr(){if(hasRequiredMr)return mr;hasRequiredMr=1;var s=requireBn$5(),a=requireBrorand();function u(l){this.rand=l||new a.Rand}return mr=u,u.create=function(f){return new u(f)},u.prototype._randbelow=function(f){var c=f.bitLength(),h=Math.ceil(c/8);do var p=new s(this.rand.generate(h));while(p.cmp(f)>=0);return p},u.prototype._randrange=function(f,c){var h=c.sub(f);return f.add(this._randbelow(h))},u.prototype.test=function(f,c,h){var p=f.bitLength(),v=s.mont(f),y=new s(1).toRed(v);c||(c=Math.max(1,p/48|0));for(var b=f.subn(1),S=0;!b.testn(S);S++);for(var E=f.shrn(S),R=b.toRed(v),O=!0;c>0;c--){var I=this._randrange(new s(2),b);h&&h(I);var B=I.toRed(v).redPow(E);if(!(B.cmp(y)===0||B.cmp(R)===0)){for(var N=1;N<S;N++){if(B=B.redSqr(),B.cmp(y)===0)return!1;if(B.cmp(R)===0)break}if(N===S)return!1}}return O},u.prototype.getDivisor=function(f,c){var h=f.bitLength(),p=s.mont(f),v=new s(1).toRed(p);c||(c=Math.max(1,h/48|0));for(var y=f.subn(1),b=0;!y.testn(b);b++);for(var S=f.shrn(b),E=y.toRed(p);c>0;c--){var R=this._randrange(new s(2),y),O=f.gcd(R);if(O.cmpn(1)!==0)return O;var I=R.toRed(p).redPow(S);if(!(I.cmp(v)===0||I.cmp(E)===0)){for(var B=1;B<b;B++){if(I=I.redSqr(),I.cmp(v)===0)return I.fromRed().subn(1).gcd(f);if(I.cmp(E)===0)break}if(B===b)return I=I.redSqr(),I.fromRed().subn(1).gcd(f)}}return!1},mr}var generatePrime,hasRequiredGeneratePrime;function requireGeneratePrime(){if(hasRequiredGeneratePrime)return generatePrime;hasRequiredGeneratePrime=1;var s=requireBrowser$b();generatePrime=B,B.simpleSieve=O,B.fermatTest=I;var a=requireBn$6(),u=new a(24),l=requireMr(),f=new l,c=new a(1),h=new a(2),p=new a(5);new a(16),new a(8);var v=new a(10),y=new a(3);new a(7);var b=new a(11),S=new a(4);new a(12);var E=null;function R(){if(E!==null)return E;var N=1048576,D=[];D[0]=2;for(var G=1,V=3;V<N;V+=2){for(var U=Math.ceil(Math.sqrt(V)),te=0;te<G&&D[te]<=U&&V%D[te]!==0;te++);G!==te&&D[te]<=U||(D[G++]=V)}return E=D,D}function O(N){for(var D=R(),G=0;G<D.length;G++)if(N.modn(D[G])===0)return N.cmpn(D[G])===0;return!0}function I(N){var D=a.mont(N);return h.toRed(D).redPow(N.subn(1)).fromRed().cmpn(1)===0}function B(N,D){if(N<16)return D===2||D===5?new a([140,123]):new a([140,39]);D=new a(D);for(var G,V;;){for(G=new a(s(Math.ceil(N/8)));G.bitLength()>N;)G.ishrn(1);if(G.isEven()&&G.iadd(c),G.testn(1)||G.iadd(h),D.cmp(h)){if(!D.cmp(p))for(;G.mod(v).cmp(y);)G.iadd(S)}else for(;G.mod(u).cmp(b);)G.iadd(S);if(V=G.shrn(1),O(V)&&O(G)&&I(V)&&I(G)&&f.test(V)&&f.test(G))return G}}return generatePrime}const modp1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"},require$$1$2={modp1,modp2,modp5,modp14,modp15,modp16,modp17,modp18};var dh,hasRequiredDh;function requireDh(){if(hasRequiredDh)return dh;hasRequiredDh=1;var s=requireBn$6(),a=requireMr(),u=new a,l=new s(24),f=new s(11),c=new s(10),h=new s(3),p=new s(7),v=requireGeneratePrime(),y=requireBrowser$b();dh=O;function b(B,N){return N=N||"utf8",distExports.Buffer.isBuffer(B)||(B=new distExports.Buffer(B,N)),this._pub=new s(B),this}function S(B,N){return N=N||"utf8",distExports.Buffer.isBuffer(B)||(B=new distExports.Buffer(B,N)),this._priv=new s(B),this}var E={};function R(B,N){var D=N.toString("hex"),G=[D,B.toString(16)].join("_");if(G in E)return E[G];var V=0;if(B.isEven()||!v.simpleSieve||!v.fermatTest(B)||!u.test(B))return V+=1,D==="02"||D==="05"?V+=8:V+=4,E[G]=V,V;u.test(B.shrn(1))||(V+=2);var U;switch(D){case"02":B.mod(l).cmp(f)&&(V+=8);break;case"05":U=B.mod(c),U.cmp(h)&&U.cmp(p)&&(V+=8);break;default:V+=4}return E[G]=V,V}function O(B,N,D){this.setGenerator(N),this.__prime=new s(B),this._prime=s.mont(this.__prime),this._primeLen=B.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,D?(this.setPublicKey=b,this.setPrivateKey=S):this._primeCode=8}Object.defineProperty(O.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=R(this.__prime,this.__gen)),this._primeCode}}),O.prototype.generateKeys=function(){return this._priv||(this._priv=new s(y(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},O.prototype.computeSecret=function(B){B=new s(B),B=B.toRed(this._prime);var N=B.redPow(this._priv).fromRed(),D=new distExports.Buffer(N.toArray()),G=this.getPrime();if(D.length<G.length){var V=new distExports.Buffer(G.length-D.length);V.fill(0),D=distExports.Buffer.concat([V,D])}return D},O.prototype.getPublicKey=function(N){return I(this._pub,N)},O.prototype.getPrivateKey=function(N){return I(this._priv,N)},O.prototype.getPrime=function(B){return I(this.__prime,B)},O.prototype.getGenerator=function(B){return I(this._gen,B)},O.prototype.setGenerator=function(B,N){return N=N||"utf8",distExports.Buffer.isBuffer(B)||(B=new distExports.Buffer(B,N)),this.__gen=B,this._gen=new s(B),this};function I(B,N){var D=new distExports.Buffer(B.toArray());return N?D.toString(N):D}return dh}var hasRequiredBrowser$4;function requireBrowser$4(){if(hasRequiredBrowser$4)return browser$4;hasRequiredBrowser$4=1;var s=requireGeneratePrime(),a=require$$1$2,u=requireDh();function l(h){var p=new distExports.Buffer(a[h].prime,"hex"),v=new distExports.Buffer(a[h].gen,"hex");return new u(p,v)}var f={binary:!0,hex:!0,base64:!0};function c(h,p,v,y){return distExports.Buffer.isBuffer(p)||f[p]===void 0?c(h,"binary",p,v):(p=p||"binary",y=y||"binary",v=v||new distExports.Buffer([2]),distExports.Buffer.isBuffer(v)||(v=new distExports.Buffer(v,y)),typeof h=="number"?new u(s(h,v),v,!0):(distExports.Buffer.isBuffer(h)||(h=new distExports.Buffer(h,p)),new u(h,v,!0)))}return browser$4.DiffieHellmanGroup=browser$4.createDiffieHellmanGroup=browser$4.getDiffieHellman=l,browser$4.createDiffieHellman=browser$4.DiffieHellman=c,browser$4}var readableBrowser={exports:{}},processNextickArgs={exports:{}},hasRequiredProcessNextickArgs;function requireProcessNextickArgs(){if(hasRequiredProcessNextickArgs)return processNextickArgs.exports;hasRequiredProcessNextickArgs=1,typeof distExports.process>"u"||!distExports.process.version||distExports.process.version.indexOf("v0.")===0||distExports.process.version.indexOf("v1.")===0&&distExports.process.version.indexOf("v1.8.")!==0?processNextickArgs.exports={nextTick:s}:processNextickArgs.exports=distExports.process;function s(a,u,l,f){if(typeof a!="function")throw new TypeError('"callback" argument must be a function');var c=arguments.length,h,p;switch(c){case 0:case 1:return distExports.process.nextTick(a);case 2:return distExports.process.nextTick(function(){a.call(null,u)});case 3:return distExports.process.nextTick(function(){a.call(null,u,l)});case 4:return distExports.process.nextTick(function(){a.call(null,u,l,f)});default:for(h=new Array(c-1),p=0;p<h.length;)h[p++]=arguments[p];return distExports.process.nextTick(function(){a.apply(null,h)})}}return processNextickArgs.exports}var isarray$1,hasRequiredIsarray$1;function requireIsarray$1(){if(hasRequiredIsarray$1)return isarray$1;hasRequiredIsarray$1=1;var s={}.toString;return isarray$1=Array.isArray||function(a){return s.call(a)=="[object Array]"},isarray$1}var streamBrowser,hasRequiredStreamBrowser;function requireStreamBrowser(){return hasRequiredStreamBrowser||(hasRequiredStreamBrowser=1,streamBrowser=requireEvents().EventEmitter),streamBrowser}var safeBuffer$1={exports:{}},hasRequiredSafeBuffer$1;function requireSafeBuffer$1(){return hasRequiredSafeBuffer$1||(hasRequiredSafeBuffer$1=1,function(s,a){var u=requireBuffer$1(),l=u.Buffer;function f(h,p){for(var v in h)p[v]=h[v]}l.from&&l.alloc&&l.allocUnsafe&&l.allocUnsafeSlow?s.exports=u:(f(u,a),a.Buffer=c);function c(h,p,v){return l(h,p,v)}f(l,c),c.from=function(h,p,v){if(typeof h=="number")throw new TypeError("Argument must not be a number");return l(h,p,v)},c.alloc=function(h,p,v){if(typeof h!="number")throw new TypeError("Argument must be a number");var y=l(h);return p!==void 0?typeof v=="string"?y.fill(p,v):y.fill(p):y.fill(0),y},c.allocUnsafe=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return l(h)},c.allocUnsafeSlow=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return u.SlowBuffer(h)}}(safeBuffer$1,safeBuffer$1.exports)),safeBuffer$1.exports}var util$2={},hasRequiredUtil$1;function requireUtil$1(){if(hasRequiredUtil$1)return util$2;hasRequiredUtil$1=1;function s(I){return Array.isArray?Array.isArray(I):O(I)==="[object Array]"}util$2.isArray=s;function a(I){return typeof I=="boolean"}util$2.isBoolean=a;function u(I){return I===null}util$2.isNull=u;function l(I){return I==null}util$2.isNullOrUndefined=l;function f(I){return typeof I=="number"}util$2.isNumber=f;function c(I){return typeof I=="string"}util$2.isString=c;function h(I){return typeof I=="symbol"}util$2.isSymbol=h;function p(I){return I===void 0}util$2.isUndefined=p;function v(I){return O(I)==="[object RegExp]"}util$2.isRegExp=v;function y(I){return typeof I=="object"&&I!==null}util$2.isObject=y;function b(I){return O(I)==="[object Date]"}util$2.isDate=b;function S(I){return O(I)==="[object Error]"||I instanceof Error}util$2.isError=S;function E(I){return typeof I=="function"}util$2.isFunction=E;function R(I){return I===null||typeof I=="boolean"||typeof I=="number"||typeof I=="string"||typeof I=="symbol"||typeof I>"u"}util$2.isPrimitive=R,util$2.isBuffer=requireBuffer$1().Buffer.isBuffer;function O(I){return Object.prototype.toString.call(I)}return util$2}var BufferList={exports:{}},hasRequiredBufferList;function requireBufferList(){return hasRequiredBufferList||(hasRequiredBufferList=1,function(s){function a(c,h){if(!(c instanceof h))throw new TypeError("Cannot call a class as a function")}var u=requireSafeBuffer$1().Buffer,l=requireUtil$2();function f(c,h,p){c.copy(h,p)}s.exports=function(){function c(){a(this,c),this.head=null,this.tail=null,this.length=0}return c.prototype.push=function(p){var v={data:p,next:null};this.length>0?this.tail.next=v:this.head=v,this.tail=v,++this.length},c.prototype.unshift=function(p){var v={data:p,next:this.head};this.length===0&&(this.tail=v),this.head=v,++this.length},c.prototype.shift=function(){if(this.length!==0){var p=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,p}},c.prototype.clear=function(){this.head=this.tail=null,this.length=0},c.prototype.join=function(p){if(this.length===0)return"";for(var v=this.head,y=""+v.data;v=v.next;)y+=p+v.data;return y},c.prototype.concat=function(p){if(this.length===0)return u.alloc(0);for(var v=u.allocUnsafe(p>>>0),y=this.head,b=0;y;)f(y.data,v,b),b+=y.data.length,y=y.next;return v},c}(),l&&l.inspect&&l.inspect.custom&&(s.exports.prototype[l.inspect.custom]=function(){var c=l.inspect({length:this.length});return this.constructor.name+" "+c})}(BufferList)),BufferList.exports}var destroy_1,hasRequiredDestroy;function requireDestroy(){if(hasRequiredDestroy)return destroy_1;hasRequiredDestroy=1;var s=requireProcessNextickArgs();function a(f,c){var h=this,p=this._readableState&&this._readableState.destroyed,v=this._writableState&&this._writableState.destroyed;return p||v?(c?c(f):f&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,s.nextTick(l,this,f)):s.nextTick(l,this,f)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(f||null,function(y){!c&&y?h._writableState?h._writableState.errorEmitted||(h._writableState.errorEmitted=!0,s.nextTick(l,h,y)):s.nextTick(l,h,y):c&&c(y)}),this)}function u(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function l(f,c){f.emit("error",c)}return destroy_1={destroy:a,undestroy:u},destroy_1}var _stream_writable,hasRequired_stream_writable;function require_stream_writable(){if(hasRequired_stream_writable)return _stream_writable;hasRequired_stream_writable=1;var s=requireProcessNextickArgs();_stream_writable=I;function a(P){var $=this;this.next=null,this.entry=null,this.finish=function(){x($,P)}}var u=!distExports.process.browser&&["v0.10","v0.9."].indexOf(distExports.process.version.slice(0,5))>-1?setImmediate:s.nextTick,l;I.WritableState=R;var f=Object.create(requireUtil$1());f.inherits=requireInherits_browser();var c={deprecate:requireBrowser$a()},h=requireStreamBrowser(),p=requireSafeBuffer$1().Buffer,v=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function y(P){return p.from(P)}function b(P){return p.isBuffer(P)||P instanceof v}var S=requireDestroy();f.inherits(I,h);function E(){}function R(P,$){l=l||require_stream_duplex(),P=P||{};var T=$ instanceof l;this.objectMode=!!P.objectMode,T&&(this.objectMode=this.objectMode||!!P.writableObjectMode);var m=P.highWaterMark,M=P.writableHighWaterMark,W=this.objectMode?16:16*1024;m||m===0?this.highWaterMark=m:T&&(M||M===0)?this.highWaterMark=M:this.highWaterMark=W,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Y=P.decodeStrings===!1;this.decodeStrings=!Y,this.defaultEncoding=P.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ue){Z($,ue)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}R.prototype.getBuffer=function(){for(var $=this.bufferedRequest,T=[];$;)T.push($),$=$.next;return T},function(){try{Object.defineProperty(R.prototype,"buffer",{get:c.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var O;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(O=Function.prototype[Symbol.hasInstance],Object.defineProperty(I,Symbol.hasInstance,{value:function(P){return O.call(this,P)?!0:this!==I?!1:P&&P._writableState instanceof R}})):O=function(P){return P instanceof this};function I(P){if(l=l||require_stream_duplex(),!O.call(I,this)&&!(this instanceof l))return new I(P);this._writableState=new R(P,this),this.writable=!0,P&&(typeof P.write=="function"&&(this._write=P.write),typeof P.writev=="function"&&(this._writev=P.writev),typeof P.destroy=="function"&&(this._destroy=P.destroy),typeof P.final=="function"&&(this._final=P.final)),h.call(this)}I.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function B(P,$){var T=new Error("write after end");P.emit("error",T),s.nextTick($,T)}function N(P,$,T,m){var M=!0,W=!1;return T===null?W=new TypeError("May not write null values to stream"):typeof T!="string"&&T!==void 0&&!$.objectMode&&(W=new TypeError("Invalid non-string/buffer chunk")),W&&(P.emit("error",W),s.nextTick(m,W),M=!1),M}I.prototype.write=function(P,$,T){var m=this._writableState,M=!1,W=!m.objectMode&&b(P);return W&&!p.isBuffer(P)&&(P=y(P)),typeof $=="function"&&(T=$,$=null),W?$="buffer":$||($=m.defaultEncoding),typeof T!="function"&&(T=E),m.ended?B(this,T):(W||N(this,m,P,T))&&(m.pendingcb++,M=G(this,m,W,P,$,T)),M},I.prototype.cork=function(){var P=this._writableState;P.corked++},I.prototype.uncork=function(){var P=this._writableState;P.corked&&(P.corked--,!P.writing&&!P.corked&&!P.bufferProcessing&&P.bufferedRequest&&ee(this,P))},I.prototype.setDefaultEncoding=function($){if(typeof $=="string"&&($=$.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf(($+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+$);return this._writableState.defaultEncoding=$,this};function D(P,$,T){return!P.objectMode&&P.decodeStrings!==!1&&typeof $=="string"&&($=p.from($,T)),$}Object.defineProperty(I.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function G(P,$,T,m,M,W){if(!T){var Y=D($,m,M);m!==Y&&(T=!0,M="buffer",m=Y)}var ue=$.objectMode?1:m.length;$.length+=ue;var ge=$.length<$.highWaterMark;if(ge||($.needDrain=!0),$.writing||$.corked){var he=$.lastBufferedRequest;$.lastBufferedRequest={chunk:m,encoding:M,isBuf:T,callback:W,next:null},he?he.next=$.lastBufferedRequest:$.bufferedRequest=$.lastBufferedRequest,$.bufferedRequestCount+=1}else V(P,$,!1,ue,m,M,W);return ge}function V(P,$,T,m,M,W,Y){$.writelen=m,$.writecb=Y,$.writing=!0,$.sync=!0,T?P._writev(M,$.onwrite):P._write(M,W,$.onwrite),$.sync=!1}function U(P,$,T,m,M){--$.pendingcb,T?(s.nextTick(M,m),s.nextTick(_,P,$),P._writableState.errorEmitted=!0,P.emit("error",m)):(M(m),P._writableState.errorEmitted=!0,P.emit("error",m),_(P,$))}function te(P){P.writing=!1,P.writecb=null,P.length-=P.writelen,P.writelen=0}function Z(P,$){var T=P._writableState,m=T.sync,M=T.writecb;if(te(T),$)U(P,T,m,$,M);else{var W=k(T);!W&&!T.corked&&!T.bufferProcessing&&T.bufferedRequest&&ee(P,T),m?u(J,P,T,W,M):J(P,T,W,M)}}function J(P,$,T,m){T||Q(P,$),$.pendingcb--,m(),_(P,$)}function Q(P,$){$.length===0&&$.needDrain&&($.needDrain=!1,P.emit("drain"))}function ee(P,$){$.bufferProcessing=!0;var T=$.bufferedRequest;if(P._writev&&T&&T.next){var m=$.bufferedRequestCount,M=new Array(m),W=$.corkedRequestsFree;W.entry=T;for(var Y=0,ue=!0;T;)M[Y]=T,T.isBuf||(ue=!1),T=T.next,Y+=1;M.allBuffers=ue,V(P,$,!0,$.length,M,"",W.finish),$.pendingcb++,$.lastBufferedRequest=null,W.next?($.corkedRequestsFree=W.next,W.next=null):$.corkedRequestsFree=new a($),$.bufferedRequestCount=0}else{for(;T;){var ge=T.chunk,he=T.encoding,ae=T.callback,de=$.objectMode?1:ge.length;if(V(P,$,!1,de,ge,he,ae),T=T.next,$.bufferedRequestCount--,$.writing)break}T===null&&($.lastBufferedRequest=null)}$.bufferedRequest=T,$.bufferProcessing=!1}I.prototype._write=function(P,$,T){T(new Error("_write() is not implemented"))},I.prototype._writev=null,I.prototype.end=function(P,$,T){var m=this._writableState;typeof P=="function"?(T=P,P=null,$=null):typeof $=="function"&&(T=$,$=null),P!=null&&this.write(P,$),m.corked&&(m.corked=1,this.uncork()),m.ending||w(this,m,T)};function k(P){return P.ending&&P.length===0&&P.bufferedRequest===null&&!P.finished&&!P.writing}function d(P,$){P._final(function(T){$.pendingcb--,T&&P.emit("error",T),$.prefinished=!0,P.emit("prefinish"),_(P,$)})}function g(P,$){!$.prefinished&&!$.finalCalled&&(typeof P._final=="function"?($.pendingcb++,$.finalCalled=!0,s.nextTick(d,P,$)):($.prefinished=!0,P.emit("prefinish")))}function _(P,$){var T=k($);return T&&(g(P,$),$.pendingcb===0&&($.finished=!0,P.emit("finish"))),T}function w(P,$,T){$.ending=!0,_(P,$),T&&($.finished?s.nextTick(T):P.once("finish",T)),$.ended=!0,P.writable=!1}function x(P,$,T){var m=P.entry;for(P.entry=null;m;){var M=m.callback;$.pendingcb--,M(T),m=m.next}$.corkedRequestsFree.next=P}return Object.defineProperty(I.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(P){this._writableState&&(this._writableState.destroyed=P)}}),I.prototype.destroy=S.destroy,I.prototype._undestroy=S.undestroy,I.prototype._destroy=function(P,$){this.end(),$(P)},_stream_writable}var _stream_duplex,hasRequired_stream_duplex;function require_stream_duplex(){if(hasRequired_stream_duplex)return _stream_duplex;hasRequired_stream_duplex=1;var s=requireProcessNextickArgs(),a=Object.keys||function(S){var E=[];for(var R in S)E.push(R);return E};_stream_duplex=v;var u=Object.create(requireUtil$1());u.inherits=requireInherits_browser();var l=require_stream_readable(),f=require_stream_writable();u.inherits(v,l);for(var c=a(f.prototype),h=0;h<c.length;h++){var p=c[h];v.prototype[p]||(v.prototype[p]=f.prototype[p])}function v(S){if(!(this instanceof v))return new v(S);l.call(this,S),f.call(this,S),S&&S.readable===!1&&(this.readable=!1),S&&S.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,S&&S.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",y)}Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function y(){this.allowHalfOpen||this._writableState.ended||s.nextTick(b,this)}function b(S){S.end()}return Object.defineProperty(v.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(S){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=S,this._writableState.destroyed=S)}}),v.prototype._destroy=function(S,E){this.push(null),this.end(),s.nextTick(E,S)},_stream_duplex}var string_decoder={},safeBuffer={exports:{}},hasRequiredSafeBuffer;function requireSafeBuffer(){return hasRequiredSafeBuffer||(hasRequiredSafeBuffer=1,function(s,a){var u=requireBuffer$1(),l=u.Buffer;function f(h,p){for(var v in h)p[v]=h[v]}l.from&&l.alloc&&l.allocUnsafe&&l.allocUnsafeSlow?s.exports=u:(f(u,a),a.Buffer=c);function c(h,p,v){return l(h,p,v)}f(l,c),c.from=function(h,p,v){if(typeof h=="number")throw new TypeError("Argument must not be a number");return l(h,p,v)},c.alloc=function(h,p,v){if(typeof h!="number")throw new TypeError("Argument must be a number");var y=l(h);return p!==void 0?typeof v=="string"?y.fill(p,v):y.fill(p):y.fill(0),y},c.allocUnsafe=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return l(h)},c.allocUnsafeSlow=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return u.SlowBuffer(h)}}(safeBuffer,safeBuffer.exports)),safeBuffer.exports}var hasRequiredString_decoder;function requireString_decoder(){if(hasRequiredString_decoder)return string_decoder;hasRequiredString_decoder=1;var s=requireSafeBuffer().Buffer,a=s.isEncoding||function(N){switch(N=""+N,N&&N.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function u(N){if(!N)return"utf8";for(var D;;)switch(N){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return N;default:if(D)return;N=(""+N).toLowerCase(),D=!0}}function l(N){var D=u(N);if(typeof D!="string"&&(s.isEncoding===a||!a(N)))throw new Error("Unknown encoding: "+N);return D||N}string_decoder.StringDecoder=f;function f(N){this.encoding=l(N);var D;switch(this.encoding){case"utf16le":this.text=S,this.end=E,D=4;break;case"utf8":this.fillLast=v,D=4;break;case"base64":this.text=R,this.end=O,D=3;break;default:this.write=I,this.end=B;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=s.allocUnsafe(D)}f.prototype.write=function(N){if(N.length===0)return"";var D,G;if(this.lastNeed){if(D=this.fillLast(N),D===void 0)return"";G=this.lastNeed,this.lastNeed=0}else G=0;return G<N.length?D?D+this.text(N,G):this.text(N,G):D||""},f.prototype.end=b,f.prototype.text=y,f.prototype.fillLast=function(N){if(this.lastNeed<=N.length)return N.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);N.copy(this.lastChar,this.lastTotal-this.lastNeed,0,N.length),this.lastNeed-=N.length};function c(N){return N<=127?0:N>>5===6?2:N>>4===14?3:N>>3===30?4:N>>6===2?-1:-2}function h(N,D,G){var V=D.length-1;if(V<G)return 0;var U=c(D[V]);return U>=0?(U>0&&(N.lastNeed=U-1),U):--V<G||U===-2?0:(U=c(D[V]),U>=0?(U>0&&(N.lastNeed=U-2),U):--V<G||U===-2?0:(U=c(D[V]),U>=0?(U>0&&(U===2?U=0:N.lastNeed=U-3),U):0))}function p(N,D,G){if((D[0]&192)!==128)return N.lastNeed=0,"�";if(N.lastNeed>1&&D.length>1){if((D[1]&192)!==128)return N.lastNeed=1,"�";if(N.lastNeed>2&&D.length>2&&(D[2]&192)!==128)return N.lastNeed=2,"�"}}function v(N){var D=this.lastTotal-this.lastNeed,G=p(this,N);if(G!==void 0)return G;if(this.lastNeed<=N.length)return N.copy(this.lastChar,D,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);N.copy(this.lastChar,D,0,N.length),this.lastNeed-=N.length}function y(N,D){var G=h(this,N,D);if(!this.lastNeed)return N.toString("utf8",D);this.lastTotal=G;var V=N.length-(G-this.lastNeed);return N.copy(this.lastChar,0,V),N.toString("utf8",D,V)}function b(N){var D=N&&N.length?this.write(N):"";return this.lastNeed?D+"�":D}function S(N,D){if((N.length-D)%2===0){var G=N.toString("utf16le",D);if(G){var V=G.charCodeAt(G.length-1);if(V>=55296&&V<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=N[N.length-2],this.lastChar[1]=N[N.length-1],G.slice(0,-1)}return G}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=N[N.length-1],N.toString("utf16le",D,N.length-1)}function E(N){var D=N&&N.length?this.write(N):"";if(this.lastNeed){var G=this.lastTotal-this.lastNeed;return D+this.lastChar.toString("utf16le",0,G)}return D}function R(N,D){var G=(N.length-D)%3;return G===0?N.toString("base64",D):(this.lastNeed=3-G,this.lastTotal=3,G===1?this.lastChar[0]=N[N.length-1]:(this.lastChar[0]=N[N.length-2],this.lastChar[1]=N[N.length-1]),N.toString("base64",D,N.length-G))}function O(N){var D=N&&N.length?this.write(N):"";return this.lastNeed?D+this.lastChar.toString("base64",0,3-this.lastNeed):D}function I(N){return N.toString(this.encoding)}function B(N){return N&&N.length?this.write(N):""}return string_decoder}var _stream_readable,hasRequired_stream_readable;function require_stream_readable(){if(hasRequired_stream_readable)return _stream_readable;hasRequired_stream_readable=1;var s=requireProcessNextickArgs();_stream_readable=D;var a=requireIsarray$1(),u;D.ReadableState=N,requireEvents().EventEmitter;var l=function(ae,de){return ae.listeners(de).length},f=requireStreamBrowser(),c=requireSafeBuffer$1().Buffer,h=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function p(ae){return c.from(ae)}function v(ae){return c.isBuffer(ae)||ae instanceof h}var y=Object.create(requireUtil$1());y.inherits=requireInherits_browser();var b=requireUtil$2(),S=void 0;b&&b.debuglog?S=b.debuglog("stream"):S=function(){};var E=requireBufferList(),R=requireDestroy(),O;y.inherits(D,f);var I=["error","close","destroy","pause","resume"];function B(ae,de,pe){if(typeof ae.prependListener=="function")return ae.prependListener(de,pe);!ae._events||!ae._events[de]?ae.on(de,pe):a(ae._events[de])?ae._events[de].unshift(pe):ae._events[de]=[pe,ae._events[de]]}function N(ae,de){u=u||require_stream_duplex(),ae=ae||{};var pe=de instanceof u;this.objectMode=!!ae.objectMode,pe&&(this.objectMode=this.objectMode||!!ae.readableObjectMode);var oe=ae.highWaterMark,le=ae.readableHighWaterMark,me=this.objectMode?16:16*1024;oe||oe===0?this.highWaterMark=oe:pe&&(le||le===0)?this.highWaterMark=le:this.highWaterMark=me,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new E,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=ae.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,ae.encoding&&(O||(O=requireString_decoder().StringDecoder),this.decoder=new O(ae.encoding),this.encoding=ae.encoding)}function D(ae){if(u=u||require_stream_duplex(),!(this instanceof D))return new D(ae);this._readableState=new N(ae,this),this.readable=!0,ae&&(typeof ae.read=="function"&&(this._read=ae.read),typeof ae.destroy=="function"&&(this._destroy=ae.destroy)),f.call(this)}Object.defineProperty(D.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(ae){this._readableState&&(this._readableState.destroyed=ae)}}),D.prototype.destroy=R.destroy,D.prototype._undestroy=R.undestroy,D.prototype._destroy=function(ae,de){this.push(null),de(ae)},D.prototype.push=function(ae,de){var pe=this._readableState,oe;return pe.objectMode?oe=!0:typeof ae=="string"&&(de=de||pe.defaultEncoding,de!==pe.encoding&&(ae=c.from(ae,de),de=""),oe=!0),G(this,ae,de,!1,oe)},D.prototype.unshift=function(ae){return G(this,ae,null,!0,!1)};function G(ae,de,pe,oe,le){var me=ae._readableState;if(de===null)me.reading=!1,ee(ae,me);else{var xe;le||(xe=U(me,de)),xe?ae.emit("error",xe):me.objectMode||de&&de.length>0?(typeof de!="string"&&!me.objectMode&&Object.getPrototypeOf(de)!==c.prototype&&(de=p(de)),oe?me.endEmitted?ae.emit("error",new Error("stream.unshift() after end event")):V(ae,me,de,!0):me.ended?ae.emit("error",new Error("stream.push() after EOF")):(me.reading=!1,me.decoder&&!pe?(de=me.decoder.write(de),me.objectMode||de.length!==0?V(ae,me,de,!1):g(ae,me)):V(ae,me,de,!1))):oe||(me.reading=!1)}return te(me)}function V(ae,de,pe,oe){de.flowing&&de.length===0&&!de.sync?(ae.emit("data",pe),ae.read(0)):(de.length+=de.objectMode?1:pe.length,oe?de.buffer.unshift(pe):de.buffer.push(pe),de.needReadable&&k(ae)),g(ae,de)}function U(ae,de){var pe;return!v(de)&&typeof de!="string"&&de!==void 0&&!ae.objectMode&&(pe=new TypeError("Invalid non-string/buffer chunk")),pe}function te(ae){return!ae.ended&&(ae.needReadable||ae.length<ae.highWaterMark||ae.length===0)}D.prototype.isPaused=function(){return this._readableState.flowing===!1},D.prototype.setEncoding=function(ae){return O||(O=requireString_decoder().StringDecoder),this._readableState.decoder=new O(ae),this._readableState.encoding=ae,this};var Z=8388608;function J(ae){return ae>=Z?ae=Z:(ae--,ae|=ae>>>1,ae|=ae>>>2,ae|=ae>>>4,ae|=ae>>>8,ae|=ae>>>16,ae++),ae}function Q(ae,de){return ae<=0||de.length===0&&de.ended?0:de.objectMode?1:ae!==ae?de.flowing&&de.length?de.buffer.head.data.length:de.length:(ae>de.highWaterMark&&(de.highWaterMark=J(ae)),ae<=de.length?ae:de.ended?de.length:(de.needReadable=!0,0))}D.prototype.read=function(ae){S("read",ae),ae=parseInt(ae,10);var de=this._readableState,pe=ae;if(ae!==0&&(de.emittedReadable=!1),ae===0&&de.needReadable&&(de.length>=de.highWaterMark||de.ended))return S("read: emitReadable",de.length,de.ended),de.length===0&&de.ended?ue(this):k(this),null;if(ae=Q(ae,de),ae===0&&de.ended)return de.length===0&&ue(this),null;var oe=de.needReadable;S("need readable",oe),(de.length===0||de.length-ae<de.highWaterMark)&&(oe=!0,S("length less than watermark",oe)),de.ended||de.reading?(oe=!1,S("reading or ended",oe)):oe&&(S("do read"),de.reading=!0,de.sync=!0,de.length===0&&(de.needReadable=!0),this._read(de.highWaterMark),de.sync=!1,de.reading||(ae=Q(pe,de)));var le;return ae>0?le=m(ae,de):le=null,le===null?(de.needReadable=!0,ae=0):de.length-=ae,de.length===0&&(de.ended||(de.needReadable=!0),pe!==ae&&de.ended&&ue(this)),le!==null&&this.emit("data",le),le};function ee(ae,de){if(!de.ended){if(de.decoder){var pe=de.decoder.end();pe&&pe.length&&(de.buffer.push(pe),de.length+=de.objectMode?1:pe.length)}de.ended=!0,k(ae)}}function k(ae){var de=ae._readableState;de.needReadable=!1,de.emittedReadable||(S("emitReadable",de.flowing),de.emittedReadable=!0,de.sync?s.nextTick(d,ae):d(ae))}function d(ae){S("emit readable"),ae.emit("readable"),T(ae)}function g(ae,de){de.readingMore||(de.readingMore=!0,s.nextTick(_,ae,de))}function _(ae,de){for(var pe=de.length;!de.reading&&!de.flowing&&!de.ended&&de.length<de.highWaterMark&&(S("maybeReadMore read 0"),ae.read(0),pe!==de.length);)pe=de.length;de.readingMore=!1}D.prototype._read=function(ae){this.emit("error",new Error("_read() is not implemented"))},D.prototype.pipe=function(ae,de){var pe=this,oe=this._readableState;switch(oe.pipesCount){case 0:oe.pipes=ae;break;case 1:oe.pipes=[oe.pipes,ae];break;default:oe.pipes.push(ae);break}oe.pipesCount+=1,S("pipe count=%d opts=%j",oe.pipesCount,de);var le=(!de||de.end!==!1)&&ae!==distExports.process.stdout&&ae!==distExports.process.stderr,me=le?Ne:yt;oe.endEmitted?s.nextTick(me):pe.once("end",me),ae.on("unpipe",xe);function xe(Ue,ze){S("onunpipe"),Ue===pe&&ze&&ze.hasUnpiped===!1&&(ze.hasUnpiped=!0,Ke())}function Ne(){S("onend"),ae.end()}var Pe=w(pe);ae.on("drain",Pe);var Ie=!1;function Ke(){S("cleanup"),ae.removeListener("close",Oe),ae.removeListener("finish",De),ae.removeListener("drain",Pe),ae.removeListener("error",at),ae.removeListener("unpipe",xe),pe.removeListener("end",Ne),pe.removeListener("end",yt),pe.removeListener("data",Ce),Ie=!0,oe.awaitDrain&&(!ae._writableState||ae._writableState.needDrain)&&Pe()}var Le=!1;pe.on("data",Ce);function Ce(Ue){S("ondata"),Le=!1;var ze=ae.write(Ue);ze===!1&&!Le&&((oe.pipesCount===1&&oe.pipes===ae||oe.pipesCount>1&&he(oe.pipes,ae)!==-1)&&!Ie&&(S("false write response, pause",oe.awaitDrain),oe.awaitDrain++,Le=!0),pe.pause())}function at(Ue){S("onerror",Ue),yt(),ae.removeListener("error",at),l(ae,"error")===0&&ae.emit("error",Ue)}B(ae,"error",at);function Oe(){ae.removeListener("finish",De),yt()}ae.once("close",Oe);function De(){S("onfinish"),ae.removeListener("close",Oe),yt()}ae.once("finish",De);function yt(){S("unpipe"),pe.unpipe(ae)}return ae.emit("pipe",pe),oe.flowing||(S("pipe resume"),pe.resume()),ae};function w(ae){return function(){var de=ae._readableState;S("pipeOnDrain",de.awaitDrain),de.awaitDrain&&de.awaitDrain--,de.awaitDrain===0&&l(ae,"data")&&(de.flowing=!0,T(ae))}}D.prototype.unpipe=function(ae){var de=this._readableState,pe={hasUnpiped:!1};if(de.pipesCount===0)return this;if(de.pipesCount===1)return ae&&ae!==de.pipes?this:(ae||(ae=de.pipes),de.pipes=null,de.pipesCount=0,de.flowing=!1,ae&&ae.emit("unpipe",this,pe),this);if(!ae){var oe=de.pipes,le=de.pipesCount;de.pipes=null,de.pipesCount=0,de.flowing=!1;for(var me=0;me<le;me++)oe[me].emit("unpipe",this,{hasUnpiped:!1});return this}var xe=he(de.pipes,ae);return xe===-1?this:(de.pipes.splice(xe,1),de.pipesCount-=1,de.pipesCount===1&&(de.pipes=de.pipes[0]),ae.emit("unpipe",this,pe),this)},D.prototype.on=function(ae,de){var pe=f.prototype.on.call(this,ae,de);if(ae==="data")this._readableState.flowing!==!1&&this.resume();else if(ae==="readable"){var oe=this._readableState;!oe.endEmitted&&!oe.readableListening&&(oe.readableListening=oe.needReadable=!0,oe.emittedReadable=!1,oe.reading?oe.length&&k(this):s.nextTick(x,this))}return pe},D.prototype.addListener=D.prototype.on;function x(ae){S("readable nexttick read 0"),ae.read(0)}D.prototype.resume=function(){var ae=this._readableState;return ae.flowing||(S("resume"),ae.flowing=!0,P(this,ae)),this};function P(ae,de){de.resumeScheduled||(de.resumeScheduled=!0,s.nextTick($,ae,de))}function $(ae,de){de.reading||(S("resume read 0"),ae.read(0)),de.resumeScheduled=!1,de.awaitDrain=0,ae.emit("resume"),T(ae),de.flowing&&!de.reading&&ae.read(0)}D.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function T(ae){var de=ae._readableState;for(S("flow",de.flowing);de.flowing&&ae.read()!==null;);}D.prototype.wrap=function(ae){var de=this,pe=this._readableState,oe=!1;ae.on("end",function(){if(S("wrapped end"),pe.decoder&&!pe.ended){var xe=pe.decoder.end();xe&&xe.length&&de.push(xe)}de.push(null)}),ae.on("data",function(xe){if(S("wrapped data"),pe.decoder&&(xe=pe.decoder.write(xe)),!(pe.objectMode&&xe==null)&&!(!pe.objectMode&&(!xe||!xe.length))){var Ne=de.push(xe);Ne||(oe=!0,ae.pause())}});for(var le in ae)this[le]===void 0&&typeof ae[le]=="function"&&(this[le]=function(xe){return function(){return ae[xe].apply(ae,arguments)}}(le));for(var me=0;me<I.length;me++)ae.on(I[me],this.emit.bind(this,I[me]));return this._read=function(xe){S("wrapped _read",xe),oe&&(oe=!1,ae.resume())},this},Object.defineProperty(D.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),D._fromList=m;function m(ae,de){if(de.length===0)return null;var pe;return de.objectMode?pe=de.buffer.shift():!ae||ae>=de.length?(de.decoder?pe=de.buffer.join(""):de.buffer.length===1?pe=de.buffer.head.data:pe=de.buffer.concat(de.length),de.buffer.clear()):pe=M(ae,de.buffer,de.decoder),pe}function M(ae,de,pe){var oe;return ae<de.head.data.length?(oe=de.head.data.slice(0,ae),de.head.data=de.head.data.slice(ae)):ae===de.head.data.length?oe=de.shift():oe=pe?W(ae,de):Y(ae,de),oe}function W(ae,de){var pe=de.head,oe=1,le=pe.data;for(ae-=le.length;pe=pe.next;){var me=pe.data,xe=ae>me.length?me.length:ae;if(xe===me.length?le+=me:le+=me.slice(0,ae),ae-=xe,ae===0){xe===me.length?(++oe,pe.next?de.head=pe.next:de.head=de.tail=null):(de.head=pe,pe.data=me.slice(xe));break}++oe}return de.length-=oe,le}function Y(ae,de){var pe=c.allocUnsafe(ae),oe=de.head,le=1;for(oe.data.copy(pe),ae-=oe.data.length;oe=oe.next;){var me=oe.data,xe=ae>me.length?me.length:ae;if(me.copy(pe,pe.length-ae,0,xe),ae-=xe,ae===0){xe===me.length?(++le,oe.next?de.head=oe.next:de.head=de.tail=null):(de.head=oe,oe.data=me.slice(xe));break}++le}return de.length-=le,pe}function ue(ae){var de=ae._readableState;if(de.length>0)throw new Error('"endReadable()" called on non-empty stream');de.endEmitted||(de.ended=!0,s.nextTick(ge,de,ae))}function ge(ae,de){!ae.endEmitted&&ae.length===0&&(ae.endEmitted=!0,de.readable=!1,de.emit("end"))}function he(ae,de){for(var pe=0,oe=ae.length;pe<oe;pe++)if(ae[pe]===de)return pe;return-1}return _stream_readable}var _stream_transform,hasRequired_stream_transform;function require_stream_transform(){if(hasRequired_stream_transform)return _stream_transform;hasRequired_stream_transform=1,_stream_transform=l;var s=require_stream_duplex(),a=Object.create(requireUtil$1());a.inherits=requireInherits_browser(),a.inherits(l,s);function u(h,p){var v=this._transformState;v.transforming=!1;var y=v.writecb;if(!y)return this.emit("error",new Error("write callback called multiple times"));v.writechunk=null,v.writecb=null,p!=null&&this.push(p),y(h);var b=this._readableState;b.reading=!1,(b.needReadable||b.length<b.highWaterMark)&&this._read(b.highWaterMark)}function l(h){if(!(this instanceof l))return new l(h);s.call(this,h),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,h&&(typeof h.transform=="function"&&(this._transform=h.transform),typeof h.flush=="function"&&(this._flush=h.flush)),this.on("prefinish",f)}function f(){var h=this;typeof this._flush=="function"?this._flush(function(p,v){c(h,p,v)}):c(this,null,null)}l.prototype.push=function(h,p){return this._transformState.needTransform=!1,s.prototype.push.call(this,h,p)},l.prototype._transform=function(h,p,v){throw new Error("_transform() is not implemented")},l.prototype._write=function(h,p,v){var y=this._transformState;if(y.writecb=v,y.writechunk=h,y.writeencoding=p,!y.transforming){var b=this._readableState;(y.needTransform||b.needReadable||b.length<b.highWaterMark)&&this._read(b.highWaterMark)}},l.prototype._read=function(h){var p=this._transformState;p.writechunk!==null&&p.writecb&&!p.transforming?(p.transforming=!0,this._transform(p.writechunk,p.writeencoding,p.afterTransform)):p.needTransform=!0},l.prototype._destroy=function(h,p){var v=this;s.prototype._destroy.call(this,h,function(y){p(y),v.emit("close")})};function c(h,p,v){if(p)return h.emit("error",p);if(v!=null&&h.push(v),h._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(h._transformState.transforming)throw new Error("Calling transform done when still transforming");return h.push(null)}return _stream_transform}var _stream_passthrough,hasRequired_stream_passthrough;function require_stream_passthrough(){if(hasRequired_stream_passthrough)return _stream_passthrough;hasRequired_stream_passthrough=1,_stream_passthrough=u;var s=require_stream_transform(),a=Object.create(requireUtil$1());a.inherits=requireInherits_browser(),a.inherits(u,s);function u(l){if(!(this instanceof u))return new u(l);s.call(this,l)}return u.prototype._transform=function(l,f,c){c(null,l)},_stream_passthrough}var hasRequiredReadableBrowser;function requireReadableBrowser(){return hasRequiredReadableBrowser||(hasRequiredReadableBrowser=1,function(s,a){a=s.exports=require_stream_readable(),a.Stream=a,a.Readable=a,a.Writable=require_stream_writable(),a.Duplex=require_stream_duplex(),a.Transform=require_stream_transform(),a.PassThrough=require_stream_passthrough()}(readableBrowser,readableBrowser.exports)),readableBrowser.exports}var sign$1={exports:{}},bn$9={exports:{}},bn$8=bn$9.exports,hasRequiredBn$4;function requireBn$4(){return hasRequiredBn$4||(hasRequiredBn$4=1,function(s){(function(a,u){function l(g,_){if(!g)throw new Error(_||"Assertion failed")}function f(g,_){g.super_=_;var w=function(){};w.prototype=_.prototype,g.prototype=new w,g.prototype.constructor=g}function c(g,_,w){if(c.isBN(g))return g;this.negative=0,this.words=null,this.length=0,this.red=null,g!==null&&((_==="le"||_==="be")&&(w=_,_=10),this._init(g||0,_||10,w||"be"))}typeof a=="object"?a.exports=c:u.BN=c,c.BN=c,c.wordSize=26;var h;try{typeof window<"u"&&typeof window.Buffer<"u"?h=window.Buffer:h=require$$2$1.Buffer}catch{}c.isBN=function(_){return _ instanceof c?!0:_!==null&&typeof _=="object"&&_.constructor.wordSize===c.wordSize&&Array.isArray(_.words)},c.max=function(_,w){return _.cmp(w)>0?_:w},c.min=function(_,w){return _.cmp(w)<0?_:w},c.prototype._init=function(_,w,x){if(typeof _=="number")return this._initNumber(_,w,x);if(typeof _=="object")return this._initArray(_,w,x);w==="hex"&&(w=16),l(w===(w|0)&&w>=2&&w<=36),_=_.toString().replace(/\s+/g,"");var P=0;_[0]==="-"&&(P++,this.negative=1),P<_.length&&(w===16?this._parseHex(_,P,x):(this._parseBase(_,w,P),x==="le"&&this._initArray(this.toArray(),w,x)))},c.prototype._initNumber=function(_,w,x){_<0&&(this.negative=1,_=-_),_<67108864?(this.words=[_&67108863],this.length=1):_<4503599627370496?(this.words=[_&67108863,_/67108864&67108863],this.length=2):(l(_<9007199254740992),this.words=[_&67108863,_/67108864&67108863,1],this.length=3),x==="le"&&this._initArray(this.toArray(),w,x)},c.prototype._initArray=function(_,w,x){if(l(typeof _.length=="number"),_.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(_.length/3),this.words=new Array(this.length);for(var P=0;P<this.length;P++)this.words[P]=0;var $,T,m=0;if(x==="be")for(P=_.length-1,$=0;P>=0;P-=3)T=_[P]|_[P-1]<<8|_[P-2]<<16,this.words[$]|=T<<m&67108863,this.words[$+1]=T>>>26-m&67108863,m+=24,m>=26&&(m-=26,$++);else if(x==="le")for(P=0,$=0;P<_.length;P+=3)T=_[P]|_[P+1]<<8|_[P+2]<<16,this.words[$]|=T<<m&67108863,this.words[$+1]=T>>>26-m&67108863,m+=24,m>=26&&(m-=26,$++);return this._strip()};function p(g,_){var w=g.charCodeAt(_);if(w>=48&&w<=57)return w-48;if(w>=65&&w<=70)return w-55;if(w>=97&&w<=102)return w-87;l(!1,"Invalid character in "+g)}function v(g,_,w){var x=p(g,w);return w-1>=_&&(x|=p(g,w-1)<<4),x}c.prototype._parseHex=function(_,w,x){this.length=Math.ceil((_.length-w)/6),this.words=new Array(this.length);for(var P=0;P<this.length;P++)this.words[P]=0;var $=0,T=0,m;if(x==="be")for(P=_.length-1;P>=w;P-=2)m=v(_,w,P)<<$,this.words[T]|=m&67108863,$>=18?($-=18,T+=1,this.words[T]|=m>>>26):$+=8;else{var M=_.length-w;for(P=M%2===0?w+1:w;P<_.length;P+=2)m=v(_,w,P)<<$,this.words[T]|=m&67108863,$>=18?($-=18,T+=1,this.words[T]|=m>>>26):$+=8}this._strip()};function y(g,_,w,x){for(var P=0,$=0,T=Math.min(g.length,w),m=_;m<T;m++){var M=g.charCodeAt(m)-48;P*=x,M>=49?$=M-49+10:M>=17?$=M-17+10:$=M,l(M>=0&&$<x,"Invalid character"),P+=$}return P}c.prototype._parseBase=function(_,w,x){this.words=[0],this.length=1;for(var P=0,$=1;$<=67108863;$*=w)P++;P--,$=$/w|0;for(var T=_.length-x,m=T%P,M=Math.min(T,T-m)+x,W=0,Y=x;Y<M;Y+=P)W=y(_,Y,Y+P,w),this.imuln($),this.words[0]+W<67108864?this.words[0]+=W:this._iaddn(W);if(m!==0){var ue=1;for(W=y(_,Y,_.length,w),Y=0;Y<m;Y++)ue*=w;this.imuln(ue),this.words[0]+W<67108864?this.words[0]+=W:this._iaddn(W)}this._strip()},c.prototype.copy=function(_){_.words=new Array(this.length);for(var w=0;w<this.length;w++)_.words[w]=this.words[w];_.length=this.length,_.negative=this.negative,_.red=this.red};function b(g,_){g.words=_.words,g.length=_.length,g.negative=_.negative,g.red=_.red}if(c.prototype._move=function(_){b(_,this)},c.prototype.clone=function(){var _=new c(null);return this.copy(_),_},c.prototype._expand=function(_){for(;this.length<_;)this.words[this.length++]=0;return this},c.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},c.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{c.prototype[Symbol.for("nodejs.util.inspect.custom")]=S}catch{c.prototype.inspect=S}else c.prototype.inspect=S;function S(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var E=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],R=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],O=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];c.prototype.toString=function(_,w){_=_||10,w=w|0||1;var x;if(_===16||_==="hex"){x="";for(var P=0,$=0,T=0;T<this.length;T++){var m=this.words[T],M=((m<<P|$)&16777215).toString(16);$=m>>>24-P&16777215,P+=2,P>=26&&(P-=26,T--),$!==0||T!==this.length-1?x=E[6-M.length]+M+x:x=M+x}for($!==0&&(x=$.toString(16)+x);x.length%w!==0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}if(_===(_|0)&&_>=2&&_<=36){var W=R[_],Y=O[_];x="";var ue=this.clone();for(ue.negative=0;!ue.isZero();){var ge=ue.modrn(Y).toString(_);ue=ue.idivn(Y),ue.isZero()?x=ge+x:x=E[W-ge.length]+ge+x}for(this.isZero()&&(x="0"+x);x.length%w!==0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}l(!1,"Base should be between 2 and 36")},c.prototype.toNumber=function(){var _=this.words[0];return this.length===2?_+=this.words[1]*67108864:this.length===3&&this.words[2]===1?_+=4503599627370496+this.words[1]*67108864:this.length>2&&l(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-_:_},c.prototype.toJSON=function(){return this.toString(16,2)},h&&(c.prototype.toBuffer=function(_,w){return this.toArrayLike(h,_,w)}),c.prototype.toArray=function(_,w){return this.toArrayLike(Array,_,w)};var I=function(_,w){return _.allocUnsafe?_.allocUnsafe(w):new _(w)};c.prototype.toArrayLike=function(_,w,x){this._strip();var P=this.byteLength(),$=x||Math.max(1,P);l(P<=$,"byte array longer than desired length"),l($>0,"Requested array length <= 0");var T=I(_,$),m=w==="le"?"LE":"BE";return this["_toArrayLike"+m](T,P),T},c.prototype._toArrayLikeLE=function(_,w){for(var x=0,P=0,$=0,T=0;$<this.length;$++){var m=this.words[$]<<T|P;_[x++]=m&255,x<_.length&&(_[x++]=m>>8&255),x<_.length&&(_[x++]=m>>16&255),T===6?(x<_.length&&(_[x++]=m>>24&255),P=0,T=0):(P=m>>>24,T+=2)}if(x<_.length)for(_[x++]=P;x<_.length;)_[x++]=0},c.prototype._toArrayLikeBE=function(_,w){for(var x=_.length-1,P=0,$=0,T=0;$<this.length;$++){var m=this.words[$]<<T|P;_[x--]=m&255,x>=0&&(_[x--]=m>>8&255),x>=0&&(_[x--]=m>>16&255),T===6?(x>=0&&(_[x--]=m>>24&255),P=0,T=0):(P=m>>>24,T+=2)}if(x>=0)for(_[x--]=P;x>=0;)_[x--]=0},Math.clz32?c.prototype._countBits=function(_){return 32-Math.clz32(_)}:c.prototype._countBits=function(_){var w=_,x=0;return w>=4096&&(x+=13,w>>>=13),w>=64&&(x+=7,w>>>=7),w>=8&&(x+=4,w>>>=4),w>=2&&(x+=2,w>>>=2),x+w},c.prototype._zeroBits=function(_){if(_===0)return 26;var w=_,x=0;return w&8191||(x+=13,w>>>=13),w&127||(x+=7,w>>>=7),w&15||(x+=4,w>>>=4),w&3||(x+=2,w>>>=2),w&1||x++,x},c.prototype.bitLength=function(){var _=this.words[this.length-1],w=this._countBits(_);return(this.length-1)*26+w};function B(g){for(var _=new Array(g.bitLength()),w=0;w<_.length;w++){var x=w/26|0,P=w%26;_[w]=g.words[x]>>>P&1}return _}c.prototype.zeroBits=function(){if(this.isZero())return 0;for(var _=0,w=0;w<this.length;w++){var x=this._zeroBits(this.words[w]);if(_+=x,x!==26)break}return _},c.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},c.prototype.toTwos=function(_){return this.negative!==0?this.abs().inotn(_).iaddn(1):this.clone()},c.prototype.fromTwos=function(_){return this.testn(_-1)?this.notn(_).iaddn(1).ineg():this.clone()},c.prototype.isNeg=function(){return this.negative!==0},c.prototype.neg=function(){return this.clone().ineg()},c.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},c.prototype.iuor=function(_){for(;this.length<_.length;)this.words[this.length++]=0;for(var w=0;w<_.length;w++)this.words[w]=this.words[w]|_.words[w];return this._strip()},c.prototype.ior=function(_){return l((this.negative|_.negative)===0),this.iuor(_)},c.prototype.or=function(_){return this.length>_.length?this.clone().ior(_):_.clone().ior(this)},c.prototype.uor=function(_){return this.length>_.length?this.clone().iuor(_):_.clone().iuor(this)},c.prototype.iuand=function(_){var w;this.length>_.length?w=_:w=this;for(var x=0;x<w.length;x++)this.words[x]=this.words[x]&_.words[x];return this.length=w.length,this._strip()},c.prototype.iand=function(_){return l((this.negative|_.negative)===0),this.iuand(_)},c.prototype.and=function(_){return this.length>_.length?this.clone().iand(_):_.clone().iand(this)},c.prototype.uand=function(_){return this.length>_.length?this.clone().iuand(_):_.clone().iuand(this)},c.prototype.iuxor=function(_){var w,x;this.length>_.length?(w=this,x=_):(w=_,x=this);for(var P=0;P<x.length;P++)this.words[P]=w.words[P]^x.words[P];if(this!==w)for(;P<w.length;P++)this.words[P]=w.words[P];return this.length=w.length,this._strip()},c.prototype.ixor=function(_){return l((this.negative|_.negative)===0),this.iuxor(_)},c.prototype.xor=function(_){return this.length>_.length?this.clone().ixor(_):_.clone().ixor(this)},c.prototype.uxor=function(_){return this.length>_.length?this.clone().iuxor(_):_.clone().iuxor(this)},c.prototype.inotn=function(_){l(typeof _=="number"&&_>=0);var w=Math.ceil(_/26)|0,x=_%26;this._expand(w),x>0&&w--;for(var P=0;P<w;P++)this.words[P]=~this.words[P]&67108863;return x>0&&(this.words[P]=~this.words[P]&67108863>>26-x),this._strip()},c.prototype.notn=function(_){return this.clone().inotn(_)},c.prototype.setn=function(_,w){l(typeof _=="number"&&_>=0);var x=_/26|0,P=_%26;return this._expand(x+1),w?this.words[x]=this.words[x]|1<<P:this.words[x]=this.words[x]&~(1<<P),this._strip()},c.prototype.iadd=function(_){var w;if(this.negative!==0&&_.negative===0)return this.negative=0,w=this.isub(_),this.negative^=1,this._normSign();if(this.negative===0&&_.negative!==0)return _.negative=0,w=this.isub(_),_.negative=1,w._normSign();var x,P;this.length>_.length?(x=this,P=_):(x=_,P=this);for(var $=0,T=0;T<P.length;T++)w=(x.words[T]|0)+(P.words[T]|0)+$,this.words[T]=w&67108863,$=w>>>26;for(;$!==0&&T<x.length;T++)w=(x.words[T]|0)+$,this.words[T]=w&67108863,$=w>>>26;if(this.length=x.length,$!==0)this.words[this.length]=$,this.length++;else if(x!==this)for(;T<x.length;T++)this.words[T]=x.words[T];return this},c.prototype.add=function(_){var w;return _.negative!==0&&this.negative===0?(_.negative=0,w=this.sub(_),_.negative^=1,w):_.negative===0&&this.negative!==0?(this.negative=0,w=_.sub(this),this.negative=1,w):this.length>_.length?this.clone().iadd(_):_.clone().iadd(this)},c.prototype.isub=function(_){if(_.negative!==0){_.negative=0;var w=this.iadd(_);return _.negative=1,w._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(_),this.negative=1,this._normSign();var x=this.cmp(_);if(x===0)return this.negative=0,this.length=1,this.words[0]=0,this;var P,$;x>0?(P=this,$=_):(P=_,$=this);for(var T=0,m=0;m<$.length;m++)w=(P.words[m]|0)-($.words[m]|0)+T,T=w>>26,this.words[m]=w&67108863;for(;T!==0&&m<P.length;m++)w=(P.words[m]|0)+T,T=w>>26,this.words[m]=w&67108863;if(T===0&&m<P.length&&P!==this)for(;m<P.length;m++)this.words[m]=P.words[m];return this.length=Math.max(this.length,m),P!==this&&(this.negative=1),this._strip()},c.prototype.sub=function(_){return this.clone().isub(_)};function N(g,_,w){w.negative=_.negative^g.negative;var x=g.length+_.length|0;w.length=x,x=x-1|0;var P=g.words[0]|0,$=_.words[0]|0,T=P*$,m=T&67108863,M=T/67108864|0;w.words[0]=m;for(var W=1;W<x;W++){for(var Y=M>>>26,ue=M&67108863,ge=Math.min(W,_.length-1),he=Math.max(0,W-g.length+1);he<=ge;he++){var ae=W-he|0;P=g.words[ae]|0,$=_.words[he]|0,T=P*$+ue,Y+=T/67108864|0,ue=T&67108863}w.words[W]=ue|0,M=Y|0}return M!==0?w.words[W]=M|0:w.length--,w._strip()}var D=function(_,w,x){var P=_.words,$=w.words,T=x.words,m=0,M,W,Y,ue=P[0]|0,ge=ue&8191,he=ue>>>13,ae=P[1]|0,de=ae&8191,pe=ae>>>13,oe=P[2]|0,le=oe&8191,me=oe>>>13,xe=P[3]|0,Ne=xe&8191,Pe=xe>>>13,Ie=P[4]|0,Ke=Ie&8191,Le=Ie>>>13,Ce=P[5]|0,at=Ce&8191,Oe=Ce>>>13,De=P[6]|0,yt=De&8191,Ue=De>>>13,ze=P[7]|0,Mt=ze&8191,se=ze>>>13,j=P[8]|0,X=j&8191,ce=j>>>13,be=P[9]|0,Re=be&8191,Se=be>>>13,qe=$[0]|0,bt=qe&8191,je=qe>>>13,We=$[1]|0,St=We&8191,ut=We>>>13,vt=$[2]|0,zt=vt&8191,st=vt>>>13,nt=$[3]|0,Vt=nt&8191,tt=nt>>>13,ft=$[4]|0,Ft=ft&8191,Qe=ft>>>13,rt=$[5]|0,Bt=rt&8191,Xe=rt>>>13,ct=$[6]|0,Ut=ct&8191,Je=ct>>>13,it=$[7]|0,qt=it&8191,et=it>>>13,ht=$[8]|0,ar=ht&8191,dt=ht>>>13,mt=$[9]|0,Xt=mt&8191,er=mt>>>13;x.negative=_.negative^w.negative,x.length=19,M=Math.imul(ge,bt),W=Math.imul(ge,je),W=W+Math.imul(he,bt)|0,Y=Math.imul(he,je);var kr=(m+M|0)+((W&8191)<<13)|0;m=(Y+(W>>>13)|0)+(kr>>>26)|0,kr&=67108863,M=Math.imul(de,bt),W=Math.imul(de,je),W=W+Math.imul(pe,bt)|0,Y=Math.imul(pe,je),M=M+Math.imul(ge,St)|0,W=W+Math.imul(ge,ut)|0,W=W+Math.imul(he,St)|0,Y=Y+Math.imul(he,ut)|0;var Ar=(m+M|0)+((W&8191)<<13)|0;m=(Y+(W>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,M=Math.imul(le,bt),W=Math.imul(le,je),W=W+Math.imul(me,bt)|0,Y=Math.imul(me,je),M=M+Math.imul(de,St)|0,W=W+Math.imul(de,ut)|0,W=W+Math.imul(pe,St)|0,Y=Y+Math.imul(pe,ut)|0,M=M+Math.imul(ge,zt)|0,W=W+Math.imul(ge,st)|0,W=W+Math.imul(he,zt)|0,Y=Y+Math.imul(he,st)|0;var Tr=(m+M|0)+((W&8191)<<13)|0;m=(Y+(W>>>13)|0)+(Tr>>>26)|0,Tr&=67108863,M=Math.imul(Ne,bt),W=Math.imul(Ne,je),W=W+Math.imul(Pe,bt)|0,Y=Math.imul(Pe,je),M=M+Math.imul(le,St)|0,W=W+Math.imul(le,ut)|0,W=W+Math.imul(me,St)|0,Y=Y+Math.imul(me,ut)|0,M=M+Math.imul(de,zt)|0,W=W+Math.imul(de,st)|0,W=W+Math.imul(pe,zt)|0,Y=Y+Math.imul(pe,st)|0,M=M+Math.imul(ge,Vt)|0,W=W+Math.imul(ge,tt)|0,W=W+Math.imul(he,Vt)|0,Y=Y+Math.imul(he,tt)|0;var Rr=(m+M|0)+((W&8191)<<13)|0;m=(Y+(W>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,M=Math.imul(Ke,bt),W=Math.imul(Ke,je),W=W+Math.imul(Le,bt)|0,Y=Math.imul(Le,je),M=M+Math.imul(Ne,St)|0,W=W+Math.imul(Ne,ut)|0,W=W+Math.imul(Pe,St)|0,Y=Y+Math.imul(Pe,ut)|0,M=M+Math.imul(le,zt)|0,W=W+Math.imul(le,st)|0,W=W+Math.imul(me,zt)|0,Y=Y+Math.imul(me,st)|0,M=M+Math.imul(de,Vt)|0,W=W+Math.imul(de,tt)|0,W=W+Math.imul(pe,Vt)|0,Y=Y+Math.imul(pe,tt)|0,M=M+Math.imul(ge,Ft)|0,W=W+Math.imul(ge,Qe)|0,W=W+Math.imul(he,Ft)|0,Y=Y+Math.imul(he,Qe)|0;var pr=(m+M|0)+((W&8191)<<13)|0;m=(Y+(W>>>13)|0)+(pr>>>26)|0,pr&=67108863,M=Math.imul(at,bt),W=Math.imul(at,je),W=W+Math.imul(Oe,bt)|0,Y=Math.imul(Oe,je),M=M+Math.imul(Ke,St)|0,W=W+Math.imul(Ke,ut)|0,W=W+Math.imul(Le,St)|0,Y=Y+Math.imul(Le,ut)|0,M=M+Math.imul(Ne,zt)|0,W=W+Math.imul(Ne,st)|0,W=W+Math.imul(Pe,zt)|0,Y=Y+Math.imul(Pe,st)|0,M=M+Math.imul(le,Vt)|0,W=W+Math.imul(le,tt)|0,W=W+Math.imul(me,Vt)|0,Y=Y+Math.imul(me,tt)|0,M=M+Math.imul(de,Ft)|0,W=W+Math.imul(de,Qe)|0,W=W+Math.imul(pe,Ft)|0,Y=Y+Math.imul(pe,Qe)|0,M=M+Math.imul(ge,Bt)|0,W=W+Math.imul(ge,Xe)|0,W=W+Math.imul(he,Bt)|0,Y=Y+Math.imul(he,Xe)|0;var _r=(m+M|0)+((W&8191)<<13)|0;m=(Y+(W>>>13)|0)+(_r>>>26)|0,_r&=67108863,M=Math.imul(yt,bt),W=Math.imul(yt,je),W=W+Math.imul(Ue,bt)|0,Y=Math.imul(Ue,je),M=M+Math.imul(at,St)|0,W=W+Math.imul(at,ut)|0,W=W+Math.imul(Oe,St)|0,Y=Y+Math.imul(Oe,ut)|0,M=M+Math.imul(Ke,zt)|0,W=W+Math.imul(Ke,st)|0,W=W+Math.imul(Le,zt)|0,Y=Y+Math.imul(Le,st)|0,M=M+Math.imul(Ne,Vt)|0,W=W+Math.imul(Ne,tt)|0,W=W+Math.imul(Pe,Vt)|0,Y=Y+Math.imul(Pe,tt)|0,M=M+Math.imul(le,Ft)|0,W=W+Math.imul(le,Qe)|0,W=W+Math.imul(me,Ft)|0,Y=Y+Math.imul(me,Qe)|0,M=M+Math.imul(de,Bt)|0,W=W+Math.imul(de,Xe)|0,W=W+Math.imul(pe,Bt)|0,Y=Y+Math.imul(pe,Xe)|0,M=M+Math.imul(ge,Ut)|0,W=W+Math.imul(ge,Je)|0,W=W+Math.imul(he,Ut)|0,Y=Y+Math.imul(he,Je)|0;var fr=(m+M|0)+((W&8191)<<13)|0;m=(Y+(W>>>13)|0)+(fr>>>26)|0,fr&=67108863,M=Math.imul(Mt,bt),W=Math.imul(Mt,je),W=W+Math.imul(se,bt)|0,Y=Math.imul(se,je),M=M+Math.imul(yt,St)|0,W=W+Math.imul(yt,ut)|0,W=W+Math.imul(Ue,St)|0,Y=Y+Math.imul(Ue,ut)|0,M=M+Math.imul(at,zt)|0,W=W+Math.imul(at,st)|0,W=W+Math.imul(Oe,zt)|0,Y=Y+Math.imul(Oe,st)|0,M=M+Math.imul(Ke,Vt)|0,W=W+Math.imul(Ke,tt)|0,W=W+Math.imul(Le,Vt)|0,Y=Y+Math.imul(Le,tt)|0,M=M+Math.imul(Ne,Ft)|0,W=W+Math.imul(Ne,Qe)|0,W=W+Math.imul(Pe,Ft)|0,Y=Y+Math.imul(Pe,Qe)|0,M=M+Math.imul(le,Bt)|0,W=W+Math.imul(le,Xe)|0,W=W+Math.imul(me,Bt)|0,Y=Y+Math.imul(me,Xe)|0,M=M+Math.imul(de,Ut)|0,W=W+Math.imul(de,Je)|0,W=W+Math.imul(pe,Ut)|0,Y=Y+Math.imul(pe,Je)|0,M=M+Math.imul(ge,qt)|0,W=W+Math.imul(ge,et)|0,W=W+Math.imul(he,qt)|0,Y=Y+Math.imul(he,et)|0;var Ht=(m+M|0)+((W&8191)<<13)|0;m=(Y+(W>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,M=Math.imul(X,bt),W=Math.imul(X,je),W=W+Math.imul(ce,bt)|0,Y=Math.imul(ce,je),M=M+Math.imul(Mt,St)|0,W=W+Math.imul(Mt,ut)|0,W=W+Math.imul(se,St)|0,Y=Y+Math.imul(se,ut)|0,M=M+Math.imul(yt,zt)|0,W=W+Math.imul(yt,st)|0,W=W+Math.imul(Ue,zt)|0,Y=Y+Math.imul(Ue,st)|0,M=M+Math.imul(at,Vt)|0,W=W+Math.imul(at,tt)|0,W=W+Math.imul(Oe,Vt)|0,Y=Y+Math.imul(Oe,tt)|0,M=M+Math.imul(Ke,Ft)|0,W=W+Math.imul(Ke,Qe)|0,W=W+Math.imul(Le,Ft)|0,Y=Y+Math.imul(Le,Qe)|0,M=M+Math.imul(Ne,Bt)|0,W=W+Math.imul(Ne,Xe)|0,W=W+Math.imul(Pe,Bt)|0,Y=Y+Math.imul(Pe,Xe)|0,M=M+Math.imul(le,Ut)|0,W=W+Math.imul(le,Je)|0,W=W+Math.imul(me,Ut)|0,Y=Y+Math.imul(me,Je)|0,M=M+Math.imul(de,qt)|0,W=W+Math.imul(de,et)|0,W=W+Math.imul(pe,qt)|0,Y=Y+Math.imul(pe,et)|0,M=M+Math.imul(ge,ar)|0,W=W+Math.imul(ge,dt)|0,W=W+Math.imul(he,ar)|0,Y=Y+Math.imul(he,dt)|0;var Cr=(m+M|0)+((W&8191)<<13)|0;m=(Y+(W>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,M=Math.imul(Re,bt),W=Math.imul(Re,je),W=W+Math.imul(Se,bt)|0,Y=Math.imul(Se,je),M=M+Math.imul(X,St)|0,W=W+Math.imul(X,ut)|0,W=W+Math.imul(ce,St)|0,Y=Y+Math.imul(ce,ut)|0,M=M+Math.imul(Mt,zt)|0,W=W+Math.imul(Mt,st)|0,W=W+Math.imul(se,zt)|0,Y=Y+Math.imul(se,st)|0,M=M+Math.imul(yt,Vt)|0,W=W+Math.imul(yt,tt)|0,W=W+Math.imul(Ue,Vt)|0,Y=Y+Math.imul(Ue,tt)|0,M=M+Math.imul(at,Ft)|0,W=W+Math.imul(at,Qe)|0,W=W+Math.imul(Oe,Ft)|0,Y=Y+Math.imul(Oe,Qe)|0,M=M+Math.imul(Ke,Bt)|0,W=W+Math.imul(Ke,Xe)|0,W=W+Math.imul(Le,Bt)|0,Y=Y+Math.imul(Le,Xe)|0,M=M+Math.imul(Ne,Ut)|0,W=W+Math.imul(Ne,Je)|0,W=W+Math.imul(Pe,Ut)|0,Y=Y+Math.imul(Pe,Je)|0,M=M+Math.imul(le,qt)|0,W=W+Math.imul(le,et)|0,W=W+Math.imul(me,qt)|0,Y=Y+Math.imul(me,et)|0,M=M+Math.imul(de,ar)|0,W=W+Math.imul(de,dt)|0,W=W+Math.imul(pe,ar)|0,Y=Y+Math.imul(pe,dt)|0,M=M+Math.imul(ge,Xt)|0,W=W+Math.imul(ge,er)|0,W=W+Math.imul(he,Xt)|0,Y=Y+Math.imul(he,er)|0;var ur=(m+M|0)+((W&8191)<<13)|0;m=(Y+(W>>>13)|0)+(ur>>>26)|0,ur&=67108863,M=Math.imul(Re,St),W=Math.imul(Re,ut),W=W+Math.imul(Se,St)|0,Y=Math.imul(Se,ut),M=M+Math.imul(X,zt)|0,W=W+Math.imul(X,st)|0,W=W+Math.imul(ce,zt)|0,Y=Y+Math.imul(ce,st)|0,M=M+Math.imul(Mt,Vt)|0,W=W+Math.imul(Mt,tt)|0,W=W+Math.imul(se,Vt)|0,Y=Y+Math.imul(se,tt)|0,M=M+Math.imul(yt,Ft)|0,W=W+Math.imul(yt,Qe)|0,W=W+Math.imul(Ue,Ft)|0,Y=Y+Math.imul(Ue,Qe)|0,M=M+Math.imul(at,Bt)|0,W=W+Math.imul(at,Xe)|0,W=W+Math.imul(Oe,Bt)|0,Y=Y+Math.imul(Oe,Xe)|0,M=M+Math.imul(Ke,Ut)|0,W=W+Math.imul(Ke,Je)|0,W=W+Math.imul(Le,Ut)|0,Y=Y+Math.imul(Le,Je)|0,M=M+Math.imul(Ne,qt)|0,W=W+Math.imul(Ne,et)|0,W=W+Math.imul(Pe,qt)|0,Y=Y+Math.imul(Pe,et)|0,M=M+Math.imul(le,ar)|0,W=W+Math.imul(le,dt)|0,W=W+Math.imul(me,ar)|0,Y=Y+Math.imul(me,dt)|0,M=M+Math.imul(de,Xt)|0,W=W+Math.imul(de,er)|0,W=W+Math.imul(pe,Xt)|0,Y=Y+Math.imul(pe,er)|0;var wr=(m+M|0)+((W&8191)<<13)|0;m=(Y+(W>>>13)|0)+(wr>>>26)|0,wr&=67108863,M=Math.imul(Re,zt),W=Math.imul(Re,st),W=W+Math.imul(Se,zt)|0,Y=Math.imul(Se,st),M=M+Math.imul(X,Vt)|0,W=W+Math.imul(X,tt)|0,W=W+Math.imul(ce,Vt)|0,Y=Y+Math.imul(ce,tt)|0,M=M+Math.imul(Mt,Ft)|0,W=W+Math.imul(Mt,Qe)|0,W=W+Math.imul(se,Ft)|0,Y=Y+Math.imul(se,Qe)|0,M=M+Math.imul(yt,Bt)|0,W=W+Math.imul(yt,Xe)|0,W=W+Math.imul(Ue,Bt)|0,Y=Y+Math.imul(Ue,Xe)|0,M=M+Math.imul(at,Ut)|0,W=W+Math.imul(at,Je)|0,W=W+Math.imul(Oe,Ut)|0,Y=Y+Math.imul(Oe,Je)|0,M=M+Math.imul(Ke,qt)|0,W=W+Math.imul(Ke,et)|0,W=W+Math.imul(Le,qt)|0,Y=Y+Math.imul(Le,et)|0,M=M+Math.imul(Ne,ar)|0,W=W+Math.imul(Ne,dt)|0,W=W+Math.imul(Pe,ar)|0,Y=Y+Math.imul(Pe,dt)|0,M=M+Math.imul(le,Xt)|0,W=W+Math.imul(le,er)|0,W=W+Math.imul(me,Xt)|0,Y=Y+Math.imul(me,er)|0;var yr=(m+M|0)+((W&8191)<<13)|0;m=(Y+(W>>>13)|0)+(yr>>>26)|0,yr&=67108863,M=Math.imul(Re,Vt),W=Math.imul(Re,tt),W=W+Math.imul(Se,Vt)|0,Y=Math.imul(Se,tt),M=M+Math.imul(X,Ft)|0,W=W+Math.imul(X,Qe)|0,W=W+Math.imul(ce,Ft)|0,Y=Y+Math.imul(ce,Qe)|0,M=M+Math.imul(Mt,Bt)|0,W=W+Math.imul(Mt,Xe)|0,W=W+Math.imul(se,Bt)|0,Y=Y+Math.imul(se,Xe)|0,M=M+Math.imul(yt,Ut)|0,W=W+Math.imul(yt,Je)|0,W=W+Math.imul(Ue,Ut)|0,Y=Y+Math.imul(Ue,Je)|0,M=M+Math.imul(at,qt)|0,W=W+Math.imul(at,et)|0,W=W+Math.imul(Oe,qt)|0,Y=Y+Math.imul(Oe,et)|0,M=M+Math.imul(Ke,ar)|0,W=W+Math.imul(Ke,dt)|0,W=W+Math.imul(Le,ar)|0,Y=Y+Math.imul(Le,dt)|0,M=M+Math.imul(Ne,Xt)|0,W=W+Math.imul(Ne,er)|0,W=W+Math.imul(Pe,Xt)|0,Y=Y+Math.imul(Pe,er)|0;var Mr=(m+M|0)+((W&8191)<<13)|0;m=(Y+(W>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,M=Math.imul(Re,Ft),W=Math.imul(Re,Qe),W=W+Math.imul(Se,Ft)|0,Y=Math.imul(Se,Qe),M=M+Math.imul(X,Bt)|0,W=W+Math.imul(X,Xe)|0,W=W+Math.imul(ce,Bt)|0,Y=Y+Math.imul(ce,Xe)|0,M=M+Math.imul(Mt,Ut)|0,W=W+Math.imul(Mt,Je)|0,W=W+Math.imul(se,Ut)|0,Y=Y+Math.imul(se,Je)|0,M=M+Math.imul(yt,qt)|0,W=W+Math.imul(yt,et)|0,W=W+Math.imul(Ue,qt)|0,Y=Y+Math.imul(Ue,et)|0,M=M+Math.imul(at,ar)|0,W=W+Math.imul(at,dt)|0,W=W+Math.imul(Oe,ar)|0,Y=Y+Math.imul(Oe,dt)|0,M=M+Math.imul(Ke,Xt)|0,W=W+Math.imul(Ke,er)|0,W=W+Math.imul(Le,Xt)|0,Y=Y+Math.imul(Le,er)|0;var Er=(m+M|0)+((W&8191)<<13)|0;m=(Y+(W>>>13)|0)+(Er>>>26)|0,Er&=67108863,M=Math.imul(Re,Bt),W=Math.imul(Re,Xe),W=W+Math.imul(Se,Bt)|0,Y=Math.imul(Se,Xe),M=M+Math.imul(X,Ut)|0,W=W+Math.imul(X,Je)|0,W=W+Math.imul(ce,Ut)|0,Y=Y+Math.imul(ce,Je)|0,M=M+Math.imul(Mt,qt)|0,W=W+Math.imul(Mt,et)|0,W=W+Math.imul(se,qt)|0,Y=Y+Math.imul(se,et)|0,M=M+Math.imul(yt,ar)|0,W=W+Math.imul(yt,dt)|0,W=W+Math.imul(Ue,ar)|0,Y=Y+Math.imul(Ue,dt)|0,M=M+Math.imul(at,Xt)|0,W=W+Math.imul(at,er)|0,W=W+Math.imul(Oe,Xt)|0,Y=Y+Math.imul(Oe,er)|0;var gr=(m+M|0)+((W&8191)<<13)|0;m=(Y+(W>>>13)|0)+(gr>>>26)|0,gr&=67108863,M=Math.imul(Re,Ut),W=Math.imul(Re,Je),W=W+Math.imul(Se,Ut)|0,Y=Math.imul(Se,Je),M=M+Math.imul(X,qt)|0,W=W+Math.imul(X,et)|0,W=W+Math.imul(ce,qt)|0,Y=Y+Math.imul(ce,et)|0,M=M+Math.imul(Mt,ar)|0,W=W+Math.imul(Mt,dt)|0,W=W+Math.imul(se,ar)|0,Y=Y+Math.imul(se,dt)|0,M=M+Math.imul(yt,Xt)|0,W=W+Math.imul(yt,er)|0,W=W+Math.imul(Ue,Xt)|0,Y=Y+Math.imul(Ue,er)|0;var sr=(m+M|0)+((W&8191)<<13)|0;m=(Y+(W>>>13)|0)+(sr>>>26)|0,sr&=67108863,M=Math.imul(Re,qt),W=Math.imul(Re,et),W=W+Math.imul(Se,qt)|0,Y=Math.imul(Se,et),M=M+Math.imul(X,ar)|0,W=W+Math.imul(X,dt)|0,W=W+Math.imul(ce,ar)|0,Y=Y+Math.imul(ce,dt)|0,M=M+Math.imul(Mt,Xt)|0,W=W+Math.imul(Mt,er)|0,W=W+Math.imul(se,Xt)|0,Y=Y+Math.imul(se,er)|0;var Ir=(m+M|0)+((W&8191)<<13)|0;m=(Y+(W>>>13)|0)+(Ir>>>26)|0,Ir&=67108863,M=Math.imul(Re,ar),W=Math.imul(Re,dt),W=W+Math.imul(Se,ar)|0,Y=Math.imul(Se,dt),M=M+Math.imul(X,Xt)|0,W=W+Math.imul(X,er)|0,W=W+Math.imul(ce,Xt)|0,Y=Y+Math.imul(ce,er)|0;var ln=(m+M|0)+((W&8191)<<13)|0;m=(Y+(W>>>13)|0)+(ln>>>26)|0,ln&=67108863,M=Math.imul(Re,Xt),W=Math.imul(Re,er),W=W+Math.imul(Se,Xt)|0,Y=Math.imul(Se,er);var ji=(m+M|0)+((W&8191)<<13)|0;return m=(Y+(W>>>13)|0)+(ji>>>26)|0,ji&=67108863,T[0]=kr,T[1]=Ar,T[2]=Tr,T[3]=Rr,T[4]=pr,T[5]=_r,T[6]=fr,T[7]=Ht,T[8]=Cr,T[9]=ur,T[10]=wr,T[11]=yr,T[12]=Mr,T[13]=Er,T[14]=gr,T[15]=sr,T[16]=Ir,T[17]=ln,T[18]=ji,m!==0&&(T[19]=m,x.length++),x};Math.imul||(D=N);function G(g,_,w){w.negative=_.negative^g.negative,w.length=g.length+_.length;for(var x=0,P=0,$=0;$<w.length-1;$++){var T=P;P=0;for(var m=x&67108863,M=Math.min($,_.length-1),W=Math.max(0,$-g.length+1);W<=M;W++){var Y=$-W,ue=g.words[Y]|0,ge=_.words[W]|0,he=ue*ge,ae=he&67108863;T=T+(he/67108864|0)|0,ae=ae+m|0,m=ae&67108863,T=T+(ae>>>26)|0,P+=T>>>26,T&=67108863}w.words[$]=m,x=T,T=P}return x!==0?w.words[$]=x:w.length--,w._strip()}function V(g,_,w){return G(g,_,w)}c.prototype.mulTo=function(_,w){var x,P=this.length+_.length;return this.length===10&&_.length===10?x=D(this,_,w):P<63?x=N(this,_,w):P<1024?x=G(this,_,w):x=V(this,_,w),x},c.prototype.mul=function(_){var w=new c(null);return w.words=new Array(this.length+_.length),this.mulTo(_,w)},c.prototype.mulf=function(_){var w=new c(null);return w.words=new Array(this.length+_.length),V(this,_,w)},c.prototype.imul=function(_){return this.clone().mulTo(_,this)},c.prototype.imuln=function(_){var w=_<0;w&&(_=-_),l(typeof _=="number"),l(_<67108864);for(var x=0,P=0;P<this.length;P++){var $=(this.words[P]|0)*_,T=($&67108863)+(x&67108863);x>>=26,x+=$/67108864|0,x+=T>>>26,this.words[P]=T&67108863}return x!==0&&(this.words[P]=x,this.length++),w?this.ineg():this},c.prototype.muln=function(_){return this.clone().imuln(_)},c.prototype.sqr=function(){return this.mul(this)},c.prototype.isqr=function(){return this.imul(this.clone())},c.prototype.pow=function(_){var w=B(_);if(w.length===0)return new c(1);for(var x=this,P=0;P<w.length&&w[P]===0;P++,x=x.sqr());if(++P<w.length)for(var $=x.sqr();P<w.length;P++,$=$.sqr())w[P]!==0&&(x=x.mul($));return x},c.prototype.iushln=function(_){l(typeof _=="number"&&_>=0);var w=_%26,x=(_-w)/26,P=67108863>>>26-w<<26-w,$;if(w!==0){var T=0;for($=0;$<this.length;$++){var m=this.words[$]&P,M=(this.words[$]|0)-m<<w;this.words[$]=M|T,T=m>>>26-w}T&&(this.words[$]=T,this.length++)}if(x!==0){for($=this.length-1;$>=0;$--)this.words[$+x]=this.words[$];for($=0;$<x;$++)this.words[$]=0;this.length+=x}return this._strip()},c.prototype.ishln=function(_){return l(this.negative===0),this.iushln(_)},c.prototype.iushrn=function(_,w,x){l(typeof _=="number"&&_>=0);var P;w?P=(w-w%26)/26:P=0;var $=_%26,T=Math.min((_-$)/26,this.length),m=67108863^67108863>>>$<<$,M=x;if(P-=T,P=Math.max(0,P),M){for(var W=0;W<T;W++)M.words[W]=this.words[W];M.length=T}if(T!==0)if(this.length>T)for(this.length-=T,W=0;W<this.length;W++)this.words[W]=this.words[W+T];else this.words[0]=0,this.length=1;var Y=0;for(W=this.length-1;W>=0&&(Y!==0||W>=P);W--){var ue=this.words[W]|0;this.words[W]=Y<<26-$|ue>>>$,Y=ue&m}return M&&Y!==0&&(M.words[M.length++]=Y),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},c.prototype.ishrn=function(_,w,x){return l(this.negative===0),this.iushrn(_,w,x)},c.prototype.shln=function(_){return this.clone().ishln(_)},c.prototype.ushln=function(_){return this.clone().iushln(_)},c.prototype.shrn=function(_){return this.clone().ishrn(_)},c.prototype.ushrn=function(_){return this.clone().iushrn(_)},c.prototype.testn=function(_){l(typeof _=="number"&&_>=0);var w=_%26,x=(_-w)/26,P=1<<w;if(this.length<=x)return!1;var $=this.words[x];return!!($&P)},c.prototype.imaskn=function(_){l(typeof _=="number"&&_>=0);var w=_%26,x=(_-w)/26;if(l(this.negative===0,"imaskn works only with positive numbers"),this.length<=x)return this;if(w!==0&&x++,this.length=Math.min(x,this.length),w!==0){var P=67108863^67108863>>>w<<w;this.words[this.length-1]&=P}return this._strip()},c.prototype.maskn=function(_){return this.clone().imaskn(_)},c.prototype.iaddn=function(_){return l(typeof _=="number"),l(_<67108864),_<0?this.isubn(-_):this.negative!==0?this.length===1&&(this.words[0]|0)<=_?(this.words[0]=_-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(_),this.negative=1,this):this._iaddn(_)},c.prototype._iaddn=function(_){this.words[0]+=_;for(var w=0;w<this.length&&this.words[w]>=67108864;w++)this.words[w]-=67108864,w===this.length-1?this.words[w+1]=1:this.words[w+1]++;return this.length=Math.max(this.length,w+1),this},c.prototype.isubn=function(_){if(l(typeof _=="number"),l(_<67108864),_<0)return this.iaddn(-_);if(this.negative!==0)return this.negative=0,this.iaddn(_),this.negative=1,this;if(this.words[0]-=_,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var w=0;w<this.length&&this.words[w]<0;w++)this.words[w]+=67108864,this.words[w+1]-=1;return this._strip()},c.prototype.addn=function(_){return this.clone().iaddn(_)},c.prototype.subn=function(_){return this.clone().isubn(_)},c.prototype.iabs=function(){return this.negative=0,this},c.prototype.abs=function(){return this.clone().iabs()},c.prototype._ishlnsubmul=function(_,w,x){var P=_.length+x,$;this._expand(P);var T,m=0;for($=0;$<_.length;$++){T=(this.words[$+x]|0)+m;var M=(_.words[$]|0)*w;T-=M&67108863,m=(T>>26)-(M/67108864|0),this.words[$+x]=T&67108863}for(;$<this.length-x;$++)T=(this.words[$+x]|0)+m,m=T>>26,this.words[$+x]=T&67108863;if(m===0)return this._strip();for(l(m===-1),m=0,$=0;$<this.length;$++)T=-(this.words[$]|0)+m,m=T>>26,this.words[$]=T&67108863;return this.negative=1,this._strip()},c.prototype._wordDiv=function(_,w){var x=this.length-_.length,P=this.clone(),$=_,T=$.words[$.length-1]|0,m=this._countBits(T);x=26-m,x!==0&&($=$.ushln(x),P.iushln(x),T=$.words[$.length-1]|0);var M=P.length-$.length,W;if(w!=="mod"){W=new c(null),W.length=M+1,W.words=new Array(W.length);for(var Y=0;Y<W.length;Y++)W.words[Y]=0}var ue=P.clone()._ishlnsubmul($,1,M);ue.negative===0&&(P=ue,W&&(W.words[M]=1));for(var ge=M-1;ge>=0;ge--){var he=(P.words[$.length+ge]|0)*67108864+(P.words[$.length+ge-1]|0);for(he=Math.min(he/T|0,67108863),P._ishlnsubmul($,he,ge);P.negative!==0;)he--,P.negative=0,P._ishlnsubmul($,1,ge),P.isZero()||(P.negative^=1);W&&(W.words[ge]=he)}return W&&W._strip(),P._strip(),w!=="div"&&x!==0&&P.iushrn(x),{div:W||null,mod:P}},c.prototype.divmod=function(_,w,x){if(l(!_.isZero()),this.isZero())return{div:new c(0),mod:new c(0)};var P,$,T;return this.negative!==0&&_.negative===0?(T=this.neg().divmod(_,w),w!=="mod"&&(P=T.div.neg()),w!=="div"&&($=T.mod.neg(),x&&$.negative!==0&&$.iadd(_)),{div:P,mod:$}):this.negative===0&&_.negative!==0?(T=this.divmod(_.neg(),w),w!=="mod"&&(P=T.div.neg()),{div:P,mod:T.mod}):this.negative&_.negative?(T=this.neg().divmod(_.neg(),w),w!=="div"&&($=T.mod.neg(),x&&$.negative!==0&&$.isub(_)),{div:T.div,mod:$}):_.length>this.length||this.cmp(_)<0?{div:new c(0),mod:this}:_.length===1?w==="div"?{div:this.divn(_.words[0]),mod:null}:w==="mod"?{div:null,mod:new c(this.modrn(_.words[0]))}:{div:this.divn(_.words[0]),mod:new c(this.modrn(_.words[0]))}:this._wordDiv(_,w)},c.prototype.div=function(_){return this.divmod(_,"div",!1).div},c.prototype.mod=function(_){return this.divmod(_,"mod",!1).mod},c.prototype.umod=function(_){return this.divmod(_,"mod",!0).mod},c.prototype.divRound=function(_){var w=this.divmod(_);if(w.mod.isZero())return w.div;var x=w.div.negative!==0?w.mod.isub(_):w.mod,P=_.ushrn(1),$=_.andln(1),T=x.cmp(P);return T<0||$===1&&T===0?w.div:w.div.negative!==0?w.div.isubn(1):w.div.iaddn(1)},c.prototype.modrn=function(_){var w=_<0;w&&(_=-_),l(_<=67108863);for(var x=(1<<26)%_,P=0,$=this.length-1;$>=0;$--)P=(x*P+(this.words[$]|0))%_;return w?-P:P},c.prototype.modn=function(_){return this.modrn(_)},c.prototype.idivn=function(_){var w=_<0;w&&(_=-_),l(_<=67108863);for(var x=0,P=this.length-1;P>=0;P--){var $=(this.words[P]|0)+x*67108864;this.words[P]=$/_|0,x=$%_}return this._strip(),w?this.ineg():this},c.prototype.divn=function(_){return this.clone().idivn(_)},c.prototype.egcd=function(_){l(_.negative===0),l(!_.isZero());var w=this,x=_.clone();w.negative!==0?w=w.umod(_):w=w.clone();for(var P=new c(1),$=new c(0),T=new c(0),m=new c(1),M=0;w.isEven()&&x.isEven();)w.iushrn(1),x.iushrn(1),++M;for(var W=x.clone(),Y=w.clone();!w.isZero();){for(var ue=0,ge=1;!(w.words[0]&ge)&&ue<26;++ue,ge<<=1);if(ue>0)for(w.iushrn(ue);ue-- >0;)(P.isOdd()||$.isOdd())&&(P.iadd(W),$.isub(Y)),P.iushrn(1),$.iushrn(1);for(var he=0,ae=1;!(x.words[0]&ae)&&he<26;++he,ae<<=1);if(he>0)for(x.iushrn(he);he-- >0;)(T.isOdd()||m.isOdd())&&(T.iadd(W),m.isub(Y)),T.iushrn(1),m.iushrn(1);w.cmp(x)>=0?(w.isub(x),P.isub(T),$.isub(m)):(x.isub(w),T.isub(P),m.isub($))}return{a:T,b:m,gcd:x.iushln(M)}},c.prototype._invmp=function(_){l(_.negative===0),l(!_.isZero());var w=this,x=_.clone();w.negative!==0?w=w.umod(_):w=w.clone();for(var P=new c(1),$=new c(0),T=x.clone();w.cmpn(1)>0&&x.cmpn(1)>0;){for(var m=0,M=1;!(w.words[0]&M)&&m<26;++m,M<<=1);if(m>0)for(w.iushrn(m);m-- >0;)P.isOdd()&&P.iadd(T),P.iushrn(1);for(var W=0,Y=1;!(x.words[0]&Y)&&W<26;++W,Y<<=1);if(W>0)for(x.iushrn(W);W-- >0;)$.isOdd()&&$.iadd(T),$.iushrn(1);w.cmp(x)>=0?(w.isub(x),P.isub($)):(x.isub(w),$.isub(P))}var ue;return w.cmpn(1)===0?ue=P:ue=$,ue.cmpn(0)<0&&ue.iadd(_),ue},c.prototype.gcd=function(_){if(this.isZero())return _.abs();if(_.isZero())return this.abs();var w=this.clone(),x=_.clone();w.negative=0,x.negative=0;for(var P=0;w.isEven()&&x.isEven();P++)w.iushrn(1),x.iushrn(1);do{for(;w.isEven();)w.iushrn(1);for(;x.isEven();)x.iushrn(1);var $=w.cmp(x);if($<0){var T=w;w=x,x=T}else if($===0||x.cmpn(1)===0)break;w.isub(x)}while(!0);return x.iushln(P)},c.prototype.invm=function(_){return this.egcd(_).a.umod(_)},c.prototype.isEven=function(){return(this.words[0]&1)===0},c.prototype.isOdd=function(){return(this.words[0]&1)===1},c.prototype.andln=function(_){return this.words[0]&_},c.prototype.bincn=function(_){l(typeof _=="number");var w=_%26,x=(_-w)/26,P=1<<w;if(this.length<=x)return this._expand(x+1),this.words[x]|=P,this;for(var $=P,T=x;$!==0&&T<this.length;T++){var m=this.words[T]|0;m+=$,$=m>>>26,m&=67108863,this.words[T]=m}return $!==0&&(this.words[T]=$,this.length++),this},c.prototype.isZero=function(){return this.length===1&&this.words[0]===0},c.prototype.cmpn=function(_){var w=_<0;if(this.negative!==0&&!w)return-1;if(this.negative===0&&w)return 1;this._strip();var x;if(this.length>1)x=1;else{w&&(_=-_),l(_<=67108863,"Number is too big");var P=this.words[0]|0;x=P===_?0:P<_?-1:1}return this.negative!==0?-x|0:x},c.prototype.cmp=function(_){if(this.negative!==0&&_.negative===0)return-1;if(this.negative===0&&_.negative!==0)return 1;var w=this.ucmp(_);return this.negative!==0?-w|0:w},c.prototype.ucmp=function(_){if(this.length>_.length)return 1;if(this.length<_.length)return-1;for(var w=0,x=this.length-1;x>=0;x--){var P=this.words[x]|0,$=_.words[x]|0;if(P!==$){P<$?w=-1:P>$&&(w=1);break}}return w},c.prototype.gtn=function(_){return this.cmpn(_)===1},c.prototype.gt=function(_){return this.cmp(_)===1},c.prototype.gten=function(_){return this.cmpn(_)>=0},c.prototype.gte=function(_){return this.cmp(_)>=0},c.prototype.ltn=function(_){return this.cmpn(_)===-1},c.prototype.lt=function(_){return this.cmp(_)===-1},c.prototype.lten=function(_){return this.cmpn(_)<=0},c.prototype.lte=function(_){return this.cmp(_)<=0},c.prototype.eqn=function(_){return this.cmpn(_)===0},c.prototype.eq=function(_){return this.cmp(_)===0},c.red=function(_){return new k(_)},c.prototype.toRed=function(_){return l(!this.red,"Already a number in reduction context"),l(this.negative===0,"red works only with positives"),_.convertTo(this)._forceRed(_)},c.prototype.fromRed=function(){return l(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},c.prototype._forceRed=function(_){return this.red=_,this},c.prototype.forceRed=function(_){return l(!this.red,"Already a number in reduction context"),this._forceRed(_)},c.prototype.redAdd=function(_){return l(this.red,"redAdd works only with red numbers"),this.red.add(this,_)},c.prototype.redIAdd=function(_){return l(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,_)},c.prototype.redSub=function(_){return l(this.red,"redSub works only with red numbers"),this.red.sub(this,_)},c.prototype.redISub=function(_){return l(this.red,"redISub works only with red numbers"),this.red.isub(this,_)},c.prototype.redShl=function(_){return l(this.red,"redShl works only with red numbers"),this.red.shl(this,_)},c.prototype.redMul=function(_){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,_),this.red.mul(this,_)},c.prototype.redIMul=function(_){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,_),this.red.imul(this,_)},c.prototype.redSqr=function(){return l(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},c.prototype.redISqr=function(){return l(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},c.prototype.redSqrt=function(){return l(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},c.prototype.redInvm=function(){return l(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},c.prototype.redNeg=function(){return l(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},c.prototype.redPow=function(_){return l(this.red&&!_.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,_)};var U={k256:null,p224:null,p192:null,p25519:null};function te(g,_){this.name=g,this.p=new c(_,16),this.n=this.p.bitLength(),this.k=new c(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}te.prototype._tmp=function(){var _=new c(null);return _.words=new Array(Math.ceil(this.n/13)),_},te.prototype.ireduce=function(_){var w=_,x;do this.split(w,this.tmp),w=this.imulK(w),w=w.iadd(this.tmp),x=w.bitLength();while(x>this.n);var P=x<this.n?-1:w.ucmp(this.p);return P===0?(w.words[0]=0,w.length=1):P>0?w.isub(this.p):w.strip!==void 0?w.strip():w._strip(),w},te.prototype.split=function(_,w){_.iushrn(this.n,0,w)},te.prototype.imulK=function(_){return _.imul(this.k)};function Z(){te.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}f(Z,te),Z.prototype.split=function(_,w){for(var x=4194303,P=Math.min(_.length,9),$=0;$<P;$++)w.words[$]=_.words[$];if(w.length=P,_.length<=9){_.words[0]=0,_.length=1;return}var T=_.words[9];for(w.words[w.length++]=T&x,$=10;$<_.length;$++){var m=_.words[$]|0;_.words[$-10]=(m&x)<<4|T>>>22,T=m}T>>>=22,_.words[$-10]=T,T===0&&_.length>10?_.length-=10:_.length-=9},Z.prototype.imulK=function(_){_.words[_.length]=0,_.words[_.length+1]=0,_.length+=2;for(var w=0,x=0;x<_.length;x++){var P=_.words[x]|0;w+=P*977,_.words[x]=w&67108863,w=P*64+(w/67108864|0)}return _.words[_.length-1]===0&&(_.length--,_.words[_.length-1]===0&&_.length--),_};function J(){te.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}f(J,te);function Q(){te.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}f(Q,te);function ee(){te.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}f(ee,te),ee.prototype.imulK=function(_){for(var w=0,x=0;x<_.length;x++){var P=(_.words[x]|0)*19+w,$=P&67108863;P>>>=26,_.words[x]=$,w=P}return w!==0&&(_.words[_.length++]=w),_},c._prime=function(_){if(U[_])return U[_];var w;if(_==="k256")w=new Z;else if(_==="p224")w=new J;else if(_==="p192")w=new Q;else if(_==="p25519")w=new ee;else throw new Error("Unknown prime "+_);return U[_]=w,w};function k(g){if(typeof g=="string"){var _=c._prime(g);this.m=_.p,this.prime=_}else l(g.gtn(1),"modulus must be greater than 1"),this.m=g,this.prime=null}k.prototype._verify1=function(_){l(_.negative===0,"red works only with positives"),l(_.red,"red works only with red numbers")},k.prototype._verify2=function(_,w){l((_.negative|w.negative)===0,"red works only with positives"),l(_.red&&_.red===w.red,"red works only with red numbers")},k.prototype.imod=function(_){return this.prime?this.prime.ireduce(_)._forceRed(this):(b(_,_.umod(this.m)._forceRed(this)),_)},k.prototype.neg=function(_){return _.isZero()?_.clone():this.m.sub(_)._forceRed(this)},k.prototype.add=function(_,w){this._verify2(_,w);var x=_.add(w);return x.cmp(this.m)>=0&&x.isub(this.m),x._forceRed(this)},k.prototype.iadd=function(_,w){this._verify2(_,w);var x=_.iadd(w);return x.cmp(this.m)>=0&&x.isub(this.m),x},k.prototype.sub=function(_,w){this._verify2(_,w);var x=_.sub(w);return x.cmpn(0)<0&&x.iadd(this.m),x._forceRed(this)},k.prototype.isub=function(_,w){this._verify2(_,w);var x=_.isub(w);return x.cmpn(0)<0&&x.iadd(this.m),x},k.prototype.shl=function(_,w){return this._verify1(_),this.imod(_.ushln(w))},k.prototype.imul=function(_,w){return this._verify2(_,w),this.imod(_.imul(w))},k.prototype.mul=function(_,w){return this._verify2(_,w),this.imod(_.mul(w))},k.prototype.isqr=function(_){return this.imul(_,_.clone())},k.prototype.sqr=function(_){return this.mul(_,_)},k.prototype.sqrt=function(_){if(_.isZero())return _.clone();var w=this.m.andln(3);if(l(w%2===1),w===3){var x=this.m.add(new c(1)).iushrn(2);return this.pow(_,x)}for(var P=this.m.subn(1),$=0;!P.isZero()&&P.andln(1)===0;)$++,P.iushrn(1);l(!P.isZero());var T=new c(1).toRed(this),m=T.redNeg(),M=this.m.subn(1).iushrn(1),W=this.m.bitLength();for(W=new c(2*W*W).toRed(this);this.pow(W,M).cmp(m)!==0;)W.redIAdd(m);for(var Y=this.pow(W,P),ue=this.pow(_,P.addn(1).iushrn(1)),ge=this.pow(_,P),he=$;ge.cmp(T)!==0;){for(var ae=ge,de=0;ae.cmp(T)!==0;de++)ae=ae.redSqr();l(de<he);var pe=this.pow(Y,new c(1).iushln(he-de-1));ue=ue.redMul(pe),Y=pe.redSqr(),ge=ge.redMul(Y),he=de}return ue},k.prototype.invm=function(_){var w=_._invmp(this.m);return w.negative!==0?(w.negative=0,this.imod(w).redNeg()):this.imod(w)},k.prototype.pow=function(_,w){if(w.isZero())return new c(1).toRed(this);if(w.cmpn(1)===0)return _.clone();var x=4,P=new Array(1<<x);P[0]=new c(1).toRed(this),P[1]=_;for(var $=2;$<P.length;$++)P[$]=this.mul(P[$-1],_);var T=P[0],m=0,M=0,W=w.bitLength()%26;for(W===0&&(W=26),$=w.length-1;$>=0;$--){for(var Y=w.words[$],ue=W-1;ue>=0;ue--){var ge=Y>>ue&1;if(T!==P[0]&&(T=this.sqr(T)),ge===0&&m===0){M=0;continue}m<<=1,m|=ge,M++,!(M!==x&&($!==0||ue!==0))&&(T=this.mul(T,P[m]),M=0,m=0)}W=26}return T},k.prototype.convertTo=function(_){var w=_.umod(this.m);return w===_?w.clone():w},k.prototype.convertFrom=function(_){var w=_.clone();return w.red=null,w},c.mont=function(_){return new d(_)};function d(g){k.call(this,g),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new c(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}f(d,k),d.prototype.convertTo=function(_){return this.imod(_.ushln(this.shift))},d.prototype.convertFrom=function(_){var w=this.imod(_.mul(this.rinv));return w.red=null,w},d.prototype.imul=function(_,w){if(_.isZero()||w.isZero())return _.words[0]=0,_.length=1,_;var x=_.imul(w),P=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),$=x.isub(P).iushrn(this.shift),T=$;return $.cmp(this.m)>=0?T=$.isub(this.m):$.cmpn(0)<0&&(T=$.iadd(this.m)),T._forceRed(this)},d.prototype.mul=function(_,w){if(_.isZero()||w.isZero())return new c(0)._forceRed(this);var x=_.mul(w),P=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),$=x.isub(P).iushrn(this.shift),T=$;return $.cmp(this.m)>=0?T=$.isub(this.m):$.cmpn(0)<0&&(T=$.iadd(this.m)),T._forceRed(this)},d.prototype.invm=function(_){var w=this.imod(_._invmp(this.m).mul(this.r2));return w._forceRed(this)}})(s,bn$8)}(bn$9)),bn$9.exports}var browserifyRsa,hasRequiredBrowserifyRsa;function requireBrowserifyRsa(){if(hasRequiredBrowserifyRsa)return browserifyRsa;hasRequiredBrowserifyRsa=1;var s=requireBn$4(),a=requireBrowser$b();function u(c){var h=l(c),p=h.toRed(s.mont(c.modulus)).redPow(new s(c.publicExponent)).fromRed();return{blinder:p,unblinder:h.invm(c.modulus)}}function l(c){var h=c.modulus.byteLength(),p;do p=new s(a(h));while(p.cmp(c.modulus)>=0||!p.umod(c.prime1)||!p.umod(c.prime2));return p}function f(c,h){var p=u(h),v=h.modulus.byteLength(),y=new s(c).mul(p.blinder).umod(h.modulus),b=y.toRed(s.mont(h.prime1)),S=y.toRed(s.mont(h.prime2)),E=h.coefficient,R=h.prime1,O=h.prime2,I=b.redPow(h.exponent1).fromRed(),B=S.redPow(h.exponent2).fromRed(),N=I.isub(B).imul(E).umod(R).imul(O);return B.iadd(N).imul(p.unblinder).umod(h.modulus).toArrayLike(distExports.Buffer,"be",v)}return f.getr=l,browserifyRsa=f,browserifyRsa}var elliptic$1={};const name$1="elliptic",version$1="6.6.1",description="EC cryptography",main="lib/elliptic.js",files=["lib"],scripts={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository={type:"git",url:"git@github.com:indutny/elliptic"},keywords=["EC","Elliptic","curve","Cryptography"],author="Fedor Indutny <fedor@indutny.com>",license="MIT",bugs={url:"https://github.com/indutny/elliptic/issues"},homepage="https://github.com/indutny/elliptic",devDependencies={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},require$$0$2={name:name$1,version:version$1,description,main,files,scripts,repository,keywords,author,license,bugs,homepage,devDependencies,dependencies};var utils$3={},bn$7={exports:{}},bn$6=bn$7.exports,hasRequiredBn$3;function requireBn$3(){return hasRequiredBn$3||(hasRequiredBn$3=1,function(s){(function(a,u){function l(k,d){if(!k)throw new Error(d||"Assertion failed")}function f(k,d){k.super_=d;var g=function(){};g.prototype=d.prototype,k.prototype=new g,k.prototype.constructor=k}function c(k,d,g){if(c.isBN(k))return k;this.negative=0,this.words=null,this.length=0,this.red=null,k!==null&&((d==="le"||d==="be")&&(g=d,d=10),this._init(k||0,d||10,g||"be"))}typeof a=="object"?a.exports=c:u.BN=c,c.BN=c,c.wordSize=26;var h;try{typeof window<"u"&&typeof window.Buffer<"u"?h=window.Buffer:h=require$$2$1.Buffer}catch{}c.isBN=function(d){return d instanceof c?!0:d!==null&&typeof d=="object"&&d.constructor.wordSize===c.wordSize&&Array.isArray(d.words)},c.max=function(d,g){return d.cmp(g)>0?d:g},c.min=function(d,g){return d.cmp(g)<0?d:g},c.prototype._init=function(d,g,_){if(typeof d=="number")return this._initNumber(d,g,_);if(typeof d=="object")return this._initArray(d,g,_);g==="hex"&&(g=16),l(g===(g|0)&&g>=2&&g<=36),d=d.toString().replace(/\s+/g,"");var w=0;d[0]==="-"&&(w++,this.negative=1),w<d.length&&(g===16?this._parseHex(d,w,_):(this._parseBase(d,g,w),_==="le"&&this._initArray(this.toArray(),g,_)))},c.prototype._initNumber=function(d,g,_){d<0&&(this.negative=1,d=-d),d<67108864?(this.words=[d&67108863],this.length=1):d<4503599627370496?(this.words=[d&67108863,d/67108864&67108863],this.length=2):(l(d<9007199254740992),this.words=[d&67108863,d/67108864&67108863,1],this.length=3),_==="le"&&this._initArray(this.toArray(),g,_)},c.prototype._initArray=function(d,g,_){if(l(typeof d.length=="number"),d.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(d.length/3),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var x,P,$=0;if(_==="be")for(w=d.length-1,x=0;w>=0;w-=3)P=d[w]|d[w-1]<<8|d[w-2]<<16,this.words[x]|=P<<$&67108863,this.words[x+1]=P>>>26-$&67108863,$+=24,$>=26&&($-=26,x++);else if(_==="le")for(w=0,x=0;w<d.length;w+=3)P=d[w]|d[w+1]<<8|d[w+2]<<16,this.words[x]|=P<<$&67108863,this.words[x+1]=P>>>26-$&67108863,$+=24,$>=26&&($-=26,x++);return this.strip()};function p(k,d){var g=k.charCodeAt(d);return g>=65&&g<=70?g-55:g>=97&&g<=102?g-87:g-48&15}function v(k,d,g){var _=p(k,g);return g-1>=d&&(_|=p(k,g-1)<<4),_}c.prototype._parseHex=function(d,g,_){this.length=Math.ceil((d.length-g)/6),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var x=0,P=0,$;if(_==="be")for(w=d.length-1;w>=g;w-=2)$=v(d,g,w)<<x,this.words[P]|=$&67108863,x>=18?(x-=18,P+=1,this.words[P]|=$>>>26):x+=8;else{var T=d.length-g;for(w=T%2===0?g+1:g;w<d.length;w+=2)$=v(d,g,w)<<x,this.words[P]|=$&67108863,x>=18?(x-=18,P+=1,this.words[P]|=$>>>26):x+=8}this.strip()};function y(k,d,g,_){for(var w=0,x=Math.min(k.length,g),P=d;P<x;P++){var $=k.charCodeAt(P)-48;w*=_,$>=49?w+=$-49+10:$>=17?w+=$-17+10:w+=$}return w}c.prototype._parseBase=function(d,g,_){this.words=[0],this.length=1;for(var w=0,x=1;x<=67108863;x*=g)w++;w--,x=x/g|0;for(var P=d.length-_,$=P%w,T=Math.min(P,P-$)+_,m=0,M=_;M<T;M+=w)m=y(d,M,M+w,g),this.imuln(x),this.words[0]+m<67108864?this.words[0]+=m:this._iaddn(m);if($!==0){var W=1;for(m=y(d,M,d.length,g),M=0;M<$;M++)W*=g;this.imuln(W),this.words[0]+m<67108864?this.words[0]+=m:this._iaddn(m)}this.strip()},c.prototype.copy=function(d){d.words=new Array(this.length);for(var g=0;g<this.length;g++)d.words[g]=this.words[g];d.length=this.length,d.negative=this.negative,d.red=this.red},c.prototype.clone=function(){var d=new c(null);return this.copy(d),d},c.prototype._expand=function(d){for(;this.length<d;)this.words[this.length++]=0;return this},c.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},c.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},c.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var b=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],S=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],E=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];c.prototype.toString=function(d,g){d=d||10,g=g|0||1;var _;if(d===16||d==="hex"){_="";for(var w=0,x=0,P=0;P<this.length;P++){var $=this.words[P],T=(($<<w|x)&16777215).toString(16);x=$>>>24-w&16777215,x!==0||P!==this.length-1?_=b[6-T.length]+T+_:_=T+_,w+=2,w>=26&&(w-=26,P--)}for(x!==0&&(_=x.toString(16)+_);_.length%g!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}if(d===(d|0)&&d>=2&&d<=36){var m=S[d],M=E[d];_="";var W=this.clone();for(W.negative=0;!W.isZero();){var Y=W.modn(M).toString(d);W=W.idivn(M),W.isZero()?_=Y+_:_=b[m-Y.length]+Y+_}for(this.isZero()&&(_="0"+_);_.length%g!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}l(!1,"Base should be between 2 and 36")},c.prototype.toNumber=function(){var d=this.words[0];return this.length===2?d+=this.words[1]*67108864:this.length===3&&this.words[2]===1?d+=4503599627370496+this.words[1]*67108864:this.length>2&&l(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-d:d},c.prototype.toJSON=function(){return this.toString(16)},c.prototype.toBuffer=function(d,g){return l(typeof h<"u"),this.toArrayLike(h,d,g)},c.prototype.toArray=function(d,g){return this.toArrayLike(Array,d,g)},c.prototype.toArrayLike=function(d,g,_){var w=this.byteLength(),x=_||Math.max(1,w);l(w<=x,"byte array longer than desired length"),l(x>0,"Requested array length <= 0"),this.strip();var P=g==="le",$=new d(x),T,m,M=this.clone();if(P){for(m=0;!M.isZero();m++)T=M.andln(255),M.iushrn(8),$[m]=T;for(;m<x;m++)$[m]=0}else{for(m=0;m<x-w;m++)$[m]=0;for(m=0;!M.isZero();m++)T=M.andln(255),M.iushrn(8),$[x-m-1]=T}return $},Math.clz32?c.prototype._countBits=function(d){return 32-Math.clz32(d)}:c.prototype._countBits=function(d){var g=d,_=0;return g>=4096&&(_+=13,g>>>=13),g>=64&&(_+=7,g>>>=7),g>=8&&(_+=4,g>>>=4),g>=2&&(_+=2,g>>>=2),_+g},c.prototype._zeroBits=function(d){if(d===0)return 26;var g=d,_=0;return g&8191||(_+=13,g>>>=13),g&127||(_+=7,g>>>=7),g&15||(_+=4,g>>>=4),g&3||(_+=2,g>>>=2),g&1||_++,_},c.prototype.bitLength=function(){var d=this.words[this.length-1],g=this._countBits(d);return(this.length-1)*26+g};function R(k){for(var d=new Array(k.bitLength()),g=0;g<d.length;g++){var _=g/26|0,w=g%26;d[g]=(k.words[_]&1<<w)>>>w}return d}c.prototype.zeroBits=function(){if(this.isZero())return 0;for(var d=0,g=0;g<this.length;g++){var _=this._zeroBits(this.words[g]);if(d+=_,_!==26)break}return d},c.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},c.prototype.toTwos=function(d){return this.negative!==0?this.abs().inotn(d).iaddn(1):this.clone()},c.prototype.fromTwos=function(d){return this.testn(d-1)?this.notn(d).iaddn(1).ineg():this.clone()},c.prototype.isNeg=function(){return this.negative!==0},c.prototype.neg=function(){return this.clone().ineg()},c.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},c.prototype.iuor=function(d){for(;this.length<d.length;)this.words[this.length++]=0;for(var g=0;g<d.length;g++)this.words[g]=this.words[g]|d.words[g];return this.strip()},c.prototype.ior=function(d){return l((this.negative|d.negative)===0),this.iuor(d)},c.prototype.or=function(d){return this.length>d.length?this.clone().ior(d):d.clone().ior(this)},c.prototype.uor=function(d){return this.length>d.length?this.clone().iuor(d):d.clone().iuor(this)},c.prototype.iuand=function(d){var g;this.length>d.length?g=d:g=this;for(var _=0;_<g.length;_++)this.words[_]=this.words[_]&d.words[_];return this.length=g.length,this.strip()},c.prototype.iand=function(d){return l((this.negative|d.negative)===0),this.iuand(d)},c.prototype.and=function(d){return this.length>d.length?this.clone().iand(d):d.clone().iand(this)},c.prototype.uand=function(d){return this.length>d.length?this.clone().iuand(d):d.clone().iuand(this)},c.prototype.iuxor=function(d){var g,_;this.length>d.length?(g=this,_=d):(g=d,_=this);for(var w=0;w<_.length;w++)this.words[w]=g.words[w]^_.words[w];if(this!==g)for(;w<g.length;w++)this.words[w]=g.words[w];return this.length=g.length,this.strip()},c.prototype.ixor=function(d){return l((this.negative|d.negative)===0),this.iuxor(d)},c.prototype.xor=function(d){return this.length>d.length?this.clone().ixor(d):d.clone().ixor(this)},c.prototype.uxor=function(d){return this.length>d.length?this.clone().iuxor(d):d.clone().iuxor(this)},c.prototype.inotn=function(d){l(typeof d=="number"&&d>=0);var g=Math.ceil(d/26)|0,_=d%26;this._expand(g),_>0&&g--;for(var w=0;w<g;w++)this.words[w]=~this.words[w]&67108863;return _>0&&(this.words[w]=~this.words[w]&67108863>>26-_),this.strip()},c.prototype.notn=function(d){return this.clone().inotn(d)},c.prototype.setn=function(d,g){l(typeof d=="number"&&d>=0);var _=d/26|0,w=d%26;return this._expand(_+1),g?this.words[_]=this.words[_]|1<<w:this.words[_]=this.words[_]&~(1<<w),this.strip()},c.prototype.iadd=function(d){var g;if(this.negative!==0&&d.negative===0)return this.negative=0,g=this.isub(d),this.negative^=1,this._normSign();if(this.negative===0&&d.negative!==0)return d.negative=0,g=this.isub(d),d.negative=1,g._normSign();var _,w;this.length>d.length?(_=this,w=d):(_=d,w=this);for(var x=0,P=0;P<w.length;P++)g=(_.words[P]|0)+(w.words[P]|0)+x,this.words[P]=g&67108863,x=g>>>26;for(;x!==0&&P<_.length;P++)g=(_.words[P]|0)+x,this.words[P]=g&67108863,x=g>>>26;if(this.length=_.length,x!==0)this.words[this.length]=x,this.length++;else if(_!==this)for(;P<_.length;P++)this.words[P]=_.words[P];return this},c.prototype.add=function(d){var g;return d.negative!==0&&this.negative===0?(d.negative=0,g=this.sub(d),d.negative^=1,g):d.negative===0&&this.negative!==0?(this.negative=0,g=d.sub(this),this.negative=1,g):this.length>d.length?this.clone().iadd(d):d.clone().iadd(this)},c.prototype.isub=function(d){if(d.negative!==0){d.negative=0;var g=this.iadd(d);return d.negative=1,g._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(d),this.negative=1,this._normSign();var _=this.cmp(d);if(_===0)return this.negative=0,this.length=1,this.words[0]=0,this;var w,x;_>0?(w=this,x=d):(w=d,x=this);for(var P=0,$=0;$<x.length;$++)g=(w.words[$]|0)-(x.words[$]|0)+P,P=g>>26,this.words[$]=g&67108863;for(;P!==0&&$<w.length;$++)g=(w.words[$]|0)+P,P=g>>26,this.words[$]=g&67108863;if(P===0&&$<w.length&&w!==this)for(;$<w.length;$++)this.words[$]=w.words[$];return this.length=Math.max(this.length,$),w!==this&&(this.negative=1),this.strip()},c.prototype.sub=function(d){return this.clone().isub(d)};function O(k,d,g){g.negative=d.negative^k.negative;var _=k.length+d.length|0;g.length=_,_=_-1|0;var w=k.words[0]|0,x=d.words[0]|0,P=w*x,$=P&67108863,T=P/67108864|0;g.words[0]=$;for(var m=1;m<_;m++){for(var M=T>>>26,W=T&67108863,Y=Math.min(m,d.length-1),ue=Math.max(0,m-k.length+1);ue<=Y;ue++){var ge=m-ue|0;w=k.words[ge]|0,x=d.words[ue]|0,P=w*x+W,M+=P/67108864|0,W=P&67108863}g.words[m]=W|0,T=M|0}return T!==0?g.words[m]=T|0:g.length--,g.strip()}var I=function(d,g,_){var w=d.words,x=g.words,P=_.words,$=0,T,m,M,W=w[0]|0,Y=W&8191,ue=W>>>13,ge=w[1]|0,he=ge&8191,ae=ge>>>13,de=w[2]|0,pe=de&8191,oe=de>>>13,le=w[3]|0,me=le&8191,xe=le>>>13,Ne=w[4]|0,Pe=Ne&8191,Ie=Ne>>>13,Ke=w[5]|0,Le=Ke&8191,Ce=Ke>>>13,at=w[6]|0,Oe=at&8191,De=at>>>13,yt=w[7]|0,Ue=yt&8191,ze=yt>>>13,Mt=w[8]|0,se=Mt&8191,j=Mt>>>13,X=w[9]|0,ce=X&8191,be=X>>>13,Re=x[0]|0,Se=Re&8191,qe=Re>>>13,bt=x[1]|0,je=bt&8191,We=bt>>>13,St=x[2]|0,ut=St&8191,vt=St>>>13,zt=x[3]|0,st=zt&8191,nt=zt>>>13,Vt=x[4]|0,tt=Vt&8191,ft=Vt>>>13,Ft=x[5]|0,Qe=Ft&8191,rt=Ft>>>13,Bt=x[6]|0,Xe=Bt&8191,ct=Bt>>>13,Ut=x[7]|0,Je=Ut&8191,it=Ut>>>13,qt=x[8]|0,et=qt&8191,ht=qt>>>13,ar=x[9]|0,dt=ar&8191,mt=ar>>>13;_.negative=d.negative^g.negative,_.length=19,T=Math.imul(Y,Se),m=Math.imul(Y,qe),m=m+Math.imul(ue,Se)|0,M=Math.imul(ue,qe);var Xt=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,T=Math.imul(he,Se),m=Math.imul(he,qe),m=m+Math.imul(ae,Se)|0,M=Math.imul(ae,qe),T=T+Math.imul(Y,je)|0,m=m+Math.imul(Y,We)|0,m=m+Math.imul(ue,je)|0,M=M+Math.imul(ue,We)|0;var er=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(er>>>26)|0,er&=67108863,T=Math.imul(pe,Se),m=Math.imul(pe,qe),m=m+Math.imul(oe,Se)|0,M=Math.imul(oe,qe),T=T+Math.imul(he,je)|0,m=m+Math.imul(he,We)|0,m=m+Math.imul(ae,je)|0,M=M+Math.imul(ae,We)|0,T=T+Math.imul(Y,ut)|0,m=m+Math.imul(Y,vt)|0,m=m+Math.imul(ue,ut)|0,M=M+Math.imul(ue,vt)|0;var kr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(kr>>>26)|0,kr&=67108863,T=Math.imul(me,Se),m=Math.imul(me,qe),m=m+Math.imul(xe,Se)|0,M=Math.imul(xe,qe),T=T+Math.imul(pe,je)|0,m=m+Math.imul(pe,We)|0,m=m+Math.imul(oe,je)|0,M=M+Math.imul(oe,We)|0,T=T+Math.imul(he,ut)|0,m=m+Math.imul(he,vt)|0,m=m+Math.imul(ae,ut)|0,M=M+Math.imul(ae,vt)|0,T=T+Math.imul(Y,st)|0,m=m+Math.imul(Y,nt)|0,m=m+Math.imul(ue,st)|0,M=M+Math.imul(ue,nt)|0;var Ar=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,T=Math.imul(Pe,Se),m=Math.imul(Pe,qe),m=m+Math.imul(Ie,Se)|0,M=Math.imul(Ie,qe),T=T+Math.imul(me,je)|0,m=m+Math.imul(me,We)|0,m=m+Math.imul(xe,je)|0,M=M+Math.imul(xe,We)|0,T=T+Math.imul(pe,ut)|0,m=m+Math.imul(pe,vt)|0,m=m+Math.imul(oe,ut)|0,M=M+Math.imul(oe,vt)|0,T=T+Math.imul(he,st)|0,m=m+Math.imul(he,nt)|0,m=m+Math.imul(ae,st)|0,M=M+Math.imul(ae,nt)|0,T=T+Math.imul(Y,tt)|0,m=m+Math.imul(Y,ft)|0,m=m+Math.imul(ue,tt)|0,M=M+Math.imul(ue,ft)|0;var Tr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Tr>>>26)|0,Tr&=67108863,T=Math.imul(Le,Se),m=Math.imul(Le,qe),m=m+Math.imul(Ce,Se)|0,M=Math.imul(Ce,qe),T=T+Math.imul(Pe,je)|0,m=m+Math.imul(Pe,We)|0,m=m+Math.imul(Ie,je)|0,M=M+Math.imul(Ie,We)|0,T=T+Math.imul(me,ut)|0,m=m+Math.imul(me,vt)|0,m=m+Math.imul(xe,ut)|0,M=M+Math.imul(xe,vt)|0,T=T+Math.imul(pe,st)|0,m=m+Math.imul(pe,nt)|0,m=m+Math.imul(oe,st)|0,M=M+Math.imul(oe,nt)|0,T=T+Math.imul(he,tt)|0,m=m+Math.imul(he,ft)|0,m=m+Math.imul(ae,tt)|0,M=M+Math.imul(ae,ft)|0,T=T+Math.imul(Y,Qe)|0,m=m+Math.imul(Y,rt)|0,m=m+Math.imul(ue,Qe)|0,M=M+Math.imul(ue,rt)|0;var Rr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,T=Math.imul(Oe,Se),m=Math.imul(Oe,qe),m=m+Math.imul(De,Se)|0,M=Math.imul(De,qe),T=T+Math.imul(Le,je)|0,m=m+Math.imul(Le,We)|0,m=m+Math.imul(Ce,je)|0,M=M+Math.imul(Ce,We)|0,T=T+Math.imul(Pe,ut)|0,m=m+Math.imul(Pe,vt)|0,m=m+Math.imul(Ie,ut)|0,M=M+Math.imul(Ie,vt)|0,T=T+Math.imul(me,st)|0,m=m+Math.imul(me,nt)|0,m=m+Math.imul(xe,st)|0,M=M+Math.imul(xe,nt)|0,T=T+Math.imul(pe,tt)|0,m=m+Math.imul(pe,ft)|0,m=m+Math.imul(oe,tt)|0,M=M+Math.imul(oe,ft)|0,T=T+Math.imul(he,Qe)|0,m=m+Math.imul(he,rt)|0,m=m+Math.imul(ae,Qe)|0,M=M+Math.imul(ae,rt)|0,T=T+Math.imul(Y,Xe)|0,m=m+Math.imul(Y,ct)|0,m=m+Math.imul(ue,Xe)|0,M=M+Math.imul(ue,ct)|0;var pr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(pr>>>26)|0,pr&=67108863,T=Math.imul(Ue,Se),m=Math.imul(Ue,qe),m=m+Math.imul(ze,Se)|0,M=Math.imul(ze,qe),T=T+Math.imul(Oe,je)|0,m=m+Math.imul(Oe,We)|0,m=m+Math.imul(De,je)|0,M=M+Math.imul(De,We)|0,T=T+Math.imul(Le,ut)|0,m=m+Math.imul(Le,vt)|0,m=m+Math.imul(Ce,ut)|0,M=M+Math.imul(Ce,vt)|0,T=T+Math.imul(Pe,st)|0,m=m+Math.imul(Pe,nt)|0,m=m+Math.imul(Ie,st)|0,M=M+Math.imul(Ie,nt)|0,T=T+Math.imul(me,tt)|0,m=m+Math.imul(me,ft)|0,m=m+Math.imul(xe,tt)|0,M=M+Math.imul(xe,ft)|0,T=T+Math.imul(pe,Qe)|0,m=m+Math.imul(pe,rt)|0,m=m+Math.imul(oe,Qe)|0,M=M+Math.imul(oe,rt)|0,T=T+Math.imul(he,Xe)|0,m=m+Math.imul(he,ct)|0,m=m+Math.imul(ae,Xe)|0,M=M+Math.imul(ae,ct)|0,T=T+Math.imul(Y,Je)|0,m=m+Math.imul(Y,it)|0,m=m+Math.imul(ue,Je)|0,M=M+Math.imul(ue,it)|0;var _r=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(_r>>>26)|0,_r&=67108863,T=Math.imul(se,Se),m=Math.imul(se,qe),m=m+Math.imul(j,Se)|0,M=Math.imul(j,qe),T=T+Math.imul(Ue,je)|0,m=m+Math.imul(Ue,We)|0,m=m+Math.imul(ze,je)|0,M=M+Math.imul(ze,We)|0,T=T+Math.imul(Oe,ut)|0,m=m+Math.imul(Oe,vt)|0,m=m+Math.imul(De,ut)|0,M=M+Math.imul(De,vt)|0,T=T+Math.imul(Le,st)|0,m=m+Math.imul(Le,nt)|0,m=m+Math.imul(Ce,st)|0,M=M+Math.imul(Ce,nt)|0,T=T+Math.imul(Pe,tt)|0,m=m+Math.imul(Pe,ft)|0,m=m+Math.imul(Ie,tt)|0,M=M+Math.imul(Ie,ft)|0,T=T+Math.imul(me,Qe)|0,m=m+Math.imul(me,rt)|0,m=m+Math.imul(xe,Qe)|0,M=M+Math.imul(xe,rt)|0,T=T+Math.imul(pe,Xe)|0,m=m+Math.imul(pe,ct)|0,m=m+Math.imul(oe,Xe)|0,M=M+Math.imul(oe,ct)|0,T=T+Math.imul(he,Je)|0,m=m+Math.imul(he,it)|0,m=m+Math.imul(ae,Je)|0,M=M+Math.imul(ae,it)|0,T=T+Math.imul(Y,et)|0,m=m+Math.imul(Y,ht)|0,m=m+Math.imul(ue,et)|0,M=M+Math.imul(ue,ht)|0;var fr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(fr>>>26)|0,fr&=67108863,T=Math.imul(ce,Se),m=Math.imul(ce,qe),m=m+Math.imul(be,Se)|0,M=Math.imul(be,qe),T=T+Math.imul(se,je)|0,m=m+Math.imul(se,We)|0,m=m+Math.imul(j,je)|0,M=M+Math.imul(j,We)|0,T=T+Math.imul(Ue,ut)|0,m=m+Math.imul(Ue,vt)|0,m=m+Math.imul(ze,ut)|0,M=M+Math.imul(ze,vt)|0,T=T+Math.imul(Oe,st)|0,m=m+Math.imul(Oe,nt)|0,m=m+Math.imul(De,st)|0,M=M+Math.imul(De,nt)|0,T=T+Math.imul(Le,tt)|0,m=m+Math.imul(Le,ft)|0,m=m+Math.imul(Ce,tt)|0,M=M+Math.imul(Ce,ft)|0,T=T+Math.imul(Pe,Qe)|0,m=m+Math.imul(Pe,rt)|0,m=m+Math.imul(Ie,Qe)|0,M=M+Math.imul(Ie,rt)|0,T=T+Math.imul(me,Xe)|0,m=m+Math.imul(me,ct)|0,m=m+Math.imul(xe,Xe)|0,M=M+Math.imul(xe,ct)|0,T=T+Math.imul(pe,Je)|0,m=m+Math.imul(pe,it)|0,m=m+Math.imul(oe,Je)|0,M=M+Math.imul(oe,it)|0,T=T+Math.imul(he,et)|0,m=m+Math.imul(he,ht)|0,m=m+Math.imul(ae,et)|0,M=M+Math.imul(ae,ht)|0,T=T+Math.imul(Y,dt)|0,m=m+Math.imul(Y,mt)|0,m=m+Math.imul(ue,dt)|0,M=M+Math.imul(ue,mt)|0;var Ht=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,T=Math.imul(ce,je),m=Math.imul(ce,We),m=m+Math.imul(be,je)|0,M=Math.imul(be,We),T=T+Math.imul(se,ut)|0,m=m+Math.imul(se,vt)|0,m=m+Math.imul(j,ut)|0,M=M+Math.imul(j,vt)|0,T=T+Math.imul(Ue,st)|0,m=m+Math.imul(Ue,nt)|0,m=m+Math.imul(ze,st)|0,M=M+Math.imul(ze,nt)|0,T=T+Math.imul(Oe,tt)|0,m=m+Math.imul(Oe,ft)|0,m=m+Math.imul(De,tt)|0,M=M+Math.imul(De,ft)|0,T=T+Math.imul(Le,Qe)|0,m=m+Math.imul(Le,rt)|0,m=m+Math.imul(Ce,Qe)|0,M=M+Math.imul(Ce,rt)|0,T=T+Math.imul(Pe,Xe)|0,m=m+Math.imul(Pe,ct)|0,m=m+Math.imul(Ie,Xe)|0,M=M+Math.imul(Ie,ct)|0,T=T+Math.imul(me,Je)|0,m=m+Math.imul(me,it)|0,m=m+Math.imul(xe,Je)|0,M=M+Math.imul(xe,it)|0,T=T+Math.imul(pe,et)|0,m=m+Math.imul(pe,ht)|0,m=m+Math.imul(oe,et)|0,M=M+Math.imul(oe,ht)|0,T=T+Math.imul(he,dt)|0,m=m+Math.imul(he,mt)|0,m=m+Math.imul(ae,dt)|0,M=M+Math.imul(ae,mt)|0;var Cr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,T=Math.imul(ce,ut),m=Math.imul(ce,vt),m=m+Math.imul(be,ut)|0,M=Math.imul(be,vt),T=T+Math.imul(se,st)|0,m=m+Math.imul(se,nt)|0,m=m+Math.imul(j,st)|0,M=M+Math.imul(j,nt)|0,T=T+Math.imul(Ue,tt)|0,m=m+Math.imul(Ue,ft)|0,m=m+Math.imul(ze,tt)|0,M=M+Math.imul(ze,ft)|0,T=T+Math.imul(Oe,Qe)|0,m=m+Math.imul(Oe,rt)|0,m=m+Math.imul(De,Qe)|0,M=M+Math.imul(De,rt)|0,T=T+Math.imul(Le,Xe)|0,m=m+Math.imul(Le,ct)|0,m=m+Math.imul(Ce,Xe)|0,M=M+Math.imul(Ce,ct)|0,T=T+Math.imul(Pe,Je)|0,m=m+Math.imul(Pe,it)|0,m=m+Math.imul(Ie,Je)|0,M=M+Math.imul(Ie,it)|0,T=T+Math.imul(me,et)|0,m=m+Math.imul(me,ht)|0,m=m+Math.imul(xe,et)|0,M=M+Math.imul(xe,ht)|0,T=T+Math.imul(pe,dt)|0,m=m+Math.imul(pe,mt)|0,m=m+Math.imul(oe,dt)|0,M=M+Math.imul(oe,mt)|0;var ur=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(ur>>>26)|0,ur&=67108863,T=Math.imul(ce,st),m=Math.imul(ce,nt),m=m+Math.imul(be,st)|0,M=Math.imul(be,nt),T=T+Math.imul(se,tt)|0,m=m+Math.imul(se,ft)|0,m=m+Math.imul(j,tt)|0,M=M+Math.imul(j,ft)|0,T=T+Math.imul(Ue,Qe)|0,m=m+Math.imul(Ue,rt)|0,m=m+Math.imul(ze,Qe)|0,M=M+Math.imul(ze,rt)|0,T=T+Math.imul(Oe,Xe)|0,m=m+Math.imul(Oe,ct)|0,m=m+Math.imul(De,Xe)|0,M=M+Math.imul(De,ct)|0,T=T+Math.imul(Le,Je)|0,m=m+Math.imul(Le,it)|0,m=m+Math.imul(Ce,Je)|0,M=M+Math.imul(Ce,it)|0,T=T+Math.imul(Pe,et)|0,m=m+Math.imul(Pe,ht)|0,m=m+Math.imul(Ie,et)|0,M=M+Math.imul(Ie,ht)|0,T=T+Math.imul(me,dt)|0,m=m+Math.imul(me,mt)|0,m=m+Math.imul(xe,dt)|0,M=M+Math.imul(xe,mt)|0;var wr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(wr>>>26)|0,wr&=67108863,T=Math.imul(ce,tt),m=Math.imul(ce,ft),m=m+Math.imul(be,tt)|0,M=Math.imul(be,ft),T=T+Math.imul(se,Qe)|0,m=m+Math.imul(se,rt)|0,m=m+Math.imul(j,Qe)|0,M=M+Math.imul(j,rt)|0,T=T+Math.imul(Ue,Xe)|0,m=m+Math.imul(Ue,ct)|0,m=m+Math.imul(ze,Xe)|0,M=M+Math.imul(ze,ct)|0,T=T+Math.imul(Oe,Je)|0,m=m+Math.imul(Oe,it)|0,m=m+Math.imul(De,Je)|0,M=M+Math.imul(De,it)|0,T=T+Math.imul(Le,et)|0,m=m+Math.imul(Le,ht)|0,m=m+Math.imul(Ce,et)|0,M=M+Math.imul(Ce,ht)|0,T=T+Math.imul(Pe,dt)|0,m=m+Math.imul(Pe,mt)|0,m=m+Math.imul(Ie,dt)|0,M=M+Math.imul(Ie,mt)|0;var yr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(yr>>>26)|0,yr&=67108863,T=Math.imul(ce,Qe),m=Math.imul(ce,rt),m=m+Math.imul(be,Qe)|0,M=Math.imul(be,rt),T=T+Math.imul(se,Xe)|0,m=m+Math.imul(se,ct)|0,m=m+Math.imul(j,Xe)|0,M=M+Math.imul(j,ct)|0,T=T+Math.imul(Ue,Je)|0,m=m+Math.imul(Ue,it)|0,m=m+Math.imul(ze,Je)|0,M=M+Math.imul(ze,it)|0,T=T+Math.imul(Oe,et)|0,m=m+Math.imul(Oe,ht)|0,m=m+Math.imul(De,et)|0,M=M+Math.imul(De,ht)|0,T=T+Math.imul(Le,dt)|0,m=m+Math.imul(Le,mt)|0,m=m+Math.imul(Ce,dt)|0,M=M+Math.imul(Ce,mt)|0;var Mr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,T=Math.imul(ce,Xe),m=Math.imul(ce,ct),m=m+Math.imul(be,Xe)|0,M=Math.imul(be,ct),T=T+Math.imul(se,Je)|0,m=m+Math.imul(se,it)|0,m=m+Math.imul(j,Je)|0,M=M+Math.imul(j,it)|0,T=T+Math.imul(Ue,et)|0,m=m+Math.imul(Ue,ht)|0,m=m+Math.imul(ze,et)|0,M=M+Math.imul(ze,ht)|0,T=T+Math.imul(Oe,dt)|0,m=m+Math.imul(Oe,mt)|0,m=m+Math.imul(De,dt)|0,M=M+Math.imul(De,mt)|0;var Er=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Er>>>26)|0,Er&=67108863,T=Math.imul(ce,Je),m=Math.imul(ce,it),m=m+Math.imul(be,Je)|0,M=Math.imul(be,it),T=T+Math.imul(se,et)|0,m=m+Math.imul(se,ht)|0,m=m+Math.imul(j,et)|0,M=M+Math.imul(j,ht)|0,T=T+Math.imul(Ue,dt)|0,m=m+Math.imul(Ue,mt)|0,m=m+Math.imul(ze,dt)|0,M=M+Math.imul(ze,mt)|0;var gr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(gr>>>26)|0,gr&=67108863,T=Math.imul(ce,et),m=Math.imul(ce,ht),m=m+Math.imul(be,et)|0,M=Math.imul(be,ht),T=T+Math.imul(se,dt)|0,m=m+Math.imul(se,mt)|0,m=m+Math.imul(j,dt)|0,M=M+Math.imul(j,mt)|0;var sr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(sr>>>26)|0,sr&=67108863,T=Math.imul(ce,dt),m=Math.imul(ce,mt),m=m+Math.imul(be,dt)|0,M=Math.imul(be,mt);var Ir=($+T|0)+((m&8191)<<13)|0;return $=(M+(m>>>13)|0)+(Ir>>>26)|0,Ir&=67108863,P[0]=Xt,P[1]=er,P[2]=kr,P[3]=Ar,P[4]=Tr,P[5]=Rr,P[6]=pr,P[7]=_r,P[8]=fr,P[9]=Ht,P[10]=Cr,P[11]=ur,P[12]=wr,P[13]=yr,P[14]=Mr,P[15]=Er,P[16]=gr,P[17]=sr,P[18]=Ir,$!==0&&(P[19]=$,_.length++),_};Math.imul||(I=O);function B(k,d,g){g.negative=d.negative^k.negative,g.length=k.length+d.length;for(var _=0,w=0,x=0;x<g.length-1;x++){var P=w;w=0;for(var $=_&67108863,T=Math.min(x,d.length-1),m=Math.max(0,x-k.length+1);m<=T;m++){var M=x-m,W=k.words[M]|0,Y=d.words[m]|0,ue=W*Y,ge=ue&67108863;P=P+(ue/67108864|0)|0,ge=ge+$|0,$=ge&67108863,P=P+(ge>>>26)|0,w+=P>>>26,P&=67108863}g.words[x]=$,_=P,P=w}return _!==0?g.words[x]=_:g.length--,g.strip()}function N(k,d,g){var _=new D;return _.mulp(k,d,g)}c.prototype.mulTo=function(d,g){var _,w=this.length+d.length;return this.length===10&&d.length===10?_=I(this,d,g):w<63?_=O(this,d,g):w<1024?_=B(this,d,g):_=N(this,d,g),_};function D(k,d){this.x=k,this.y=d}D.prototype.makeRBT=function(d){for(var g=new Array(d),_=c.prototype._countBits(d)-1,w=0;w<d;w++)g[w]=this.revBin(w,_,d);return g},D.prototype.revBin=function(d,g,_){if(d===0||d===_-1)return d;for(var w=0,x=0;x<g;x++)w|=(d&1)<<g-x-1,d>>=1;return w},D.prototype.permute=function(d,g,_,w,x,P){for(var $=0;$<P;$++)w[$]=g[d[$]],x[$]=_[d[$]]},D.prototype.transform=function(d,g,_,w,x,P){this.permute(P,d,g,_,w,x);for(var $=1;$<x;$<<=1)for(var T=$<<1,m=Math.cos(2*Math.PI/T),M=Math.sin(2*Math.PI/T),W=0;W<x;W+=T)for(var Y=m,ue=M,ge=0;ge<$;ge++){var he=_[W+ge],ae=w[W+ge],de=_[W+ge+$],pe=w[W+ge+$],oe=Y*de-ue*pe;pe=Y*pe+ue*de,de=oe,_[W+ge]=he+de,w[W+ge]=ae+pe,_[W+ge+$]=he-de,w[W+ge+$]=ae-pe,ge!==T&&(oe=m*Y-M*ue,ue=m*ue+M*Y,Y=oe)}},D.prototype.guessLen13b=function(d,g){var _=Math.max(g,d)|1,w=_&1,x=0;for(_=_/2|0;_;_=_>>>1)x++;return 1<<x+1+w},D.prototype.conjugate=function(d,g,_){if(!(_<=1))for(var w=0;w<_/2;w++){var x=d[w];d[w]=d[_-w-1],d[_-w-1]=x,x=g[w],g[w]=-g[_-w-1],g[_-w-1]=-x}},D.prototype.normalize13b=function(d,g){for(var _=0,w=0;w<g/2;w++){var x=Math.round(d[2*w+1]/g)*8192+Math.round(d[2*w]/g)+_;d[w]=x&67108863,x<67108864?_=0:_=x/67108864|0}return d},D.prototype.convert13b=function(d,g,_,w){for(var x=0,P=0;P<g;P++)x=x+(d[P]|0),_[2*P]=x&8191,x=x>>>13,_[2*P+1]=x&8191,x=x>>>13;for(P=2*g;P<w;++P)_[P]=0;l(x===0),l((x&-8192)===0)},D.prototype.stub=function(d){for(var g=new Array(d),_=0;_<d;_++)g[_]=0;return g},D.prototype.mulp=function(d,g,_){var w=2*this.guessLen13b(d.length,g.length),x=this.makeRBT(w),P=this.stub(w),$=new Array(w),T=new Array(w),m=new Array(w),M=new Array(w),W=new Array(w),Y=new Array(w),ue=_.words;ue.length=w,this.convert13b(d.words,d.length,$,w),this.convert13b(g.words,g.length,M,w),this.transform($,P,T,m,w,x),this.transform(M,P,W,Y,w,x);for(var ge=0;ge<w;ge++){var he=T[ge]*W[ge]-m[ge]*Y[ge];m[ge]=T[ge]*Y[ge]+m[ge]*W[ge],T[ge]=he}return this.conjugate(T,m,w),this.transform(T,m,ue,P,w,x),this.conjugate(ue,P,w),this.normalize13b(ue,w),_.negative=d.negative^g.negative,_.length=d.length+g.length,_.strip()},c.prototype.mul=function(d){var g=new c(null);return g.words=new Array(this.length+d.length),this.mulTo(d,g)},c.prototype.mulf=function(d){var g=new c(null);return g.words=new Array(this.length+d.length),N(this,d,g)},c.prototype.imul=function(d){return this.clone().mulTo(d,this)},c.prototype.imuln=function(d){l(typeof d=="number"),l(d<67108864);for(var g=0,_=0;_<this.length;_++){var w=(this.words[_]|0)*d,x=(w&67108863)+(g&67108863);g>>=26,g+=w/67108864|0,g+=x>>>26,this.words[_]=x&67108863}return g!==0&&(this.words[_]=g,this.length++),this},c.prototype.muln=function(d){return this.clone().imuln(d)},c.prototype.sqr=function(){return this.mul(this)},c.prototype.isqr=function(){return this.imul(this.clone())},c.prototype.pow=function(d){var g=R(d);if(g.length===0)return new c(1);for(var _=this,w=0;w<g.length&&g[w]===0;w++,_=_.sqr());if(++w<g.length)for(var x=_.sqr();w<g.length;w++,x=x.sqr())g[w]!==0&&(_=_.mul(x));return _},c.prototype.iushln=function(d){l(typeof d=="number"&&d>=0);var g=d%26,_=(d-g)/26,w=67108863>>>26-g<<26-g,x;if(g!==0){var P=0;for(x=0;x<this.length;x++){var $=this.words[x]&w,T=(this.words[x]|0)-$<<g;this.words[x]=T|P,P=$>>>26-g}P&&(this.words[x]=P,this.length++)}if(_!==0){for(x=this.length-1;x>=0;x--)this.words[x+_]=this.words[x];for(x=0;x<_;x++)this.words[x]=0;this.length+=_}return this.strip()},c.prototype.ishln=function(d){return l(this.negative===0),this.iushln(d)},c.prototype.iushrn=function(d,g,_){l(typeof d=="number"&&d>=0);var w;g?w=(g-g%26)/26:w=0;var x=d%26,P=Math.min((d-x)/26,this.length),$=67108863^67108863>>>x<<x,T=_;if(w-=P,w=Math.max(0,w),T){for(var m=0;m<P;m++)T.words[m]=this.words[m];T.length=P}if(P!==0)if(this.length>P)for(this.length-=P,m=0;m<this.length;m++)this.words[m]=this.words[m+P];else this.words[0]=0,this.length=1;var M=0;for(m=this.length-1;m>=0&&(M!==0||m>=w);m--){var W=this.words[m]|0;this.words[m]=M<<26-x|W>>>x,M=W&$}return T&&M!==0&&(T.words[T.length++]=M),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},c.prototype.ishrn=function(d,g,_){return l(this.negative===0),this.iushrn(d,g,_)},c.prototype.shln=function(d){return this.clone().ishln(d)},c.prototype.ushln=function(d){return this.clone().iushln(d)},c.prototype.shrn=function(d){return this.clone().ishrn(d)},c.prototype.ushrn=function(d){return this.clone().iushrn(d)},c.prototype.testn=function(d){l(typeof d=="number"&&d>=0);var g=d%26,_=(d-g)/26,w=1<<g;if(this.length<=_)return!1;var x=this.words[_];return!!(x&w)},c.prototype.imaskn=function(d){l(typeof d=="number"&&d>=0);var g=d%26,_=(d-g)/26;if(l(this.negative===0,"imaskn works only with positive numbers"),this.length<=_)return this;if(g!==0&&_++,this.length=Math.min(_,this.length),g!==0){var w=67108863^67108863>>>g<<g;this.words[this.length-1]&=w}return this.strip()},c.prototype.maskn=function(d){return this.clone().imaskn(d)},c.prototype.iaddn=function(d){return l(typeof d=="number"),l(d<67108864),d<0?this.isubn(-d):this.negative!==0?this.length===1&&(this.words[0]|0)<d?(this.words[0]=d-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(d),this.negative=1,this):this._iaddn(d)},c.prototype._iaddn=function(d){this.words[0]+=d;for(var g=0;g<this.length&&this.words[g]>=67108864;g++)this.words[g]-=67108864,g===this.length-1?this.words[g+1]=1:this.words[g+1]++;return this.length=Math.max(this.length,g+1),this},c.prototype.isubn=function(d){if(l(typeof d=="number"),l(d<67108864),d<0)return this.iaddn(-d);if(this.negative!==0)return this.negative=0,this.iaddn(d),this.negative=1,this;if(this.words[0]-=d,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var g=0;g<this.length&&this.words[g]<0;g++)this.words[g]+=67108864,this.words[g+1]-=1;return this.strip()},c.prototype.addn=function(d){return this.clone().iaddn(d)},c.prototype.subn=function(d){return this.clone().isubn(d)},c.prototype.iabs=function(){return this.negative=0,this},c.prototype.abs=function(){return this.clone().iabs()},c.prototype._ishlnsubmul=function(d,g,_){var w=d.length+_,x;this._expand(w);var P,$=0;for(x=0;x<d.length;x++){P=(this.words[x+_]|0)+$;var T=(d.words[x]|0)*g;P-=T&67108863,$=(P>>26)-(T/67108864|0),this.words[x+_]=P&67108863}for(;x<this.length-_;x++)P=(this.words[x+_]|0)+$,$=P>>26,this.words[x+_]=P&67108863;if($===0)return this.strip();for(l($===-1),$=0,x=0;x<this.length;x++)P=-(this.words[x]|0)+$,$=P>>26,this.words[x]=P&67108863;return this.negative=1,this.strip()},c.prototype._wordDiv=function(d,g){var _=this.length-d.length,w=this.clone(),x=d,P=x.words[x.length-1]|0,$=this._countBits(P);_=26-$,_!==0&&(x=x.ushln(_),w.iushln(_),P=x.words[x.length-1]|0);var T=w.length-x.length,m;if(g!=="mod"){m=new c(null),m.length=T+1,m.words=new Array(m.length);for(var M=0;M<m.length;M++)m.words[M]=0}var W=w.clone()._ishlnsubmul(x,1,T);W.negative===0&&(w=W,m&&(m.words[T]=1));for(var Y=T-1;Y>=0;Y--){var ue=(w.words[x.length+Y]|0)*67108864+(w.words[x.length+Y-1]|0);for(ue=Math.min(ue/P|0,67108863),w._ishlnsubmul(x,ue,Y);w.negative!==0;)ue--,w.negative=0,w._ishlnsubmul(x,1,Y),w.isZero()||(w.negative^=1);m&&(m.words[Y]=ue)}return m&&m.strip(),w.strip(),g!=="div"&&_!==0&&w.iushrn(_),{div:m||null,mod:w}},c.prototype.divmod=function(d,g,_){if(l(!d.isZero()),this.isZero())return{div:new c(0),mod:new c(0)};var w,x,P;return this.negative!==0&&d.negative===0?(P=this.neg().divmod(d,g),g!=="mod"&&(w=P.div.neg()),g!=="div"&&(x=P.mod.neg(),_&&x.negative!==0&&x.iadd(d)),{div:w,mod:x}):this.negative===0&&d.negative!==0?(P=this.divmod(d.neg(),g),g!=="mod"&&(w=P.div.neg()),{div:w,mod:P.mod}):this.negative&d.negative?(P=this.neg().divmod(d.neg(),g),g!=="div"&&(x=P.mod.neg(),_&&x.negative!==0&&x.isub(d)),{div:P.div,mod:x}):d.length>this.length||this.cmp(d)<0?{div:new c(0),mod:this}:d.length===1?g==="div"?{div:this.divn(d.words[0]),mod:null}:g==="mod"?{div:null,mod:new c(this.modn(d.words[0]))}:{div:this.divn(d.words[0]),mod:new c(this.modn(d.words[0]))}:this._wordDiv(d,g)},c.prototype.div=function(d){return this.divmod(d,"div",!1).div},c.prototype.mod=function(d){return this.divmod(d,"mod",!1).mod},c.prototype.umod=function(d){return this.divmod(d,"mod",!0).mod},c.prototype.divRound=function(d){var g=this.divmod(d);if(g.mod.isZero())return g.div;var _=g.div.negative!==0?g.mod.isub(d):g.mod,w=d.ushrn(1),x=d.andln(1),P=_.cmp(w);return P<0||x===1&&P===0?g.div:g.div.negative!==0?g.div.isubn(1):g.div.iaddn(1)},c.prototype.modn=function(d){l(d<=67108863);for(var g=(1<<26)%d,_=0,w=this.length-1;w>=0;w--)_=(g*_+(this.words[w]|0))%d;return _},c.prototype.idivn=function(d){l(d<=67108863);for(var g=0,_=this.length-1;_>=0;_--){var w=(this.words[_]|0)+g*67108864;this.words[_]=w/d|0,g=w%d}return this.strip()},c.prototype.divn=function(d){return this.clone().idivn(d)},c.prototype.egcd=function(d){l(d.negative===0),l(!d.isZero());var g=this,_=d.clone();g.negative!==0?g=g.umod(d):g=g.clone();for(var w=new c(1),x=new c(0),P=new c(0),$=new c(1),T=0;g.isEven()&&_.isEven();)g.iushrn(1),_.iushrn(1),++T;for(var m=_.clone(),M=g.clone();!g.isZero();){for(var W=0,Y=1;!(g.words[0]&Y)&&W<26;++W,Y<<=1);if(W>0)for(g.iushrn(W);W-- >0;)(w.isOdd()||x.isOdd())&&(w.iadd(m),x.isub(M)),w.iushrn(1),x.iushrn(1);for(var ue=0,ge=1;!(_.words[0]&ge)&&ue<26;++ue,ge<<=1);if(ue>0)for(_.iushrn(ue);ue-- >0;)(P.isOdd()||$.isOdd())&&(P.iadd(m),$.isub(M)),P.iushrn(1),$.iushrn(1);g.cmp(_)>=0?(g.isub(_),w.isub(P),x.isub($)):(_.isub(g),P.isub(w),$.isub(x))}return{a:P,b:$,gcd:_.iushln(T)}},c.prototype._invmp=function(d){l(d.negative===0),l(!d.isZero());var g=this,_=d.clone();g.negative!==0?g=g.umod(d):g=g.clone();for(var w=new c(1),x=new c(0),P=_.clone();g.cmpn(1)>0&&_.cmpn(1)>0;){for(var $=0,T=1;!(g.words[0]&T)&&$<26;++$,T<<=1);if($>0)for(g.iushrn($);$-- >0;)w.isOdd()&&w.iadd(P),w.iushrn(1);for(var m=0,M=1;!(_.words[0]&M)&&m<26;++m,M<<=1);if(m>0)for(_.iushrn(m);m-- >0;)x.isOdd()&&x.iadd(P),x.iushrn(1);g.cmp(_)>=0?(g.isub(_),w.isub(x)):(_.isub(g),x.isub(w))}var W;return g.cmpn(1)===0?W=w:W=x,W.cmpn(0)<0&&W.iadd(d),W},c.prototype.gcd=function(d){if(this.isZero())return d.abs();if(d.isZero())return this.abs();var g=this.clone(),_=d.clone();g.negative=0,_.negative=0;for(var w=0;g.isEven()&&_.isEven();w++)g.iushrn(1),_.iushrn(1);do{for(;g.isEven();)g.iushrn(1);for(;_.isEven();)_.iushrn(1);var x=g.cmp(_);if(x<0){var P=g;g=_,_=P}else if(x===0||_.cmpn(1)===0)break;g.isub(_)}while(!0);return _.iushln(w)},c.prototype.invm=function(d){return this.egcd(d).a.umod(d)},c.prototype.isEven=function(){return(this.words[0]&1)===0},c.prototype.isOdd=function(){return(this.words[0]&1)===1},c.prototype.andln=function(d){return this.words[0]&d},c.prototype.bincn=function(d){l(typeof d=="number");var g=d%26,_=(d-g)/26,w=1<<g;if(this.length<=_)return this._expand(_+1),this.words[_]|=w,this;for(var x=w,P=_;x!==0&&P<this.length;P++){var $=this.words[P]|0;$+=x,x=$>>>26,$&=67108863,this.words[P]=$}return x!==0&&(this.words[P]=x,this.length++),this},c.prototype.isZero=function(){return this.length===1&&this.words[0]===0},c.prototype.cmpn=function(d){var g=d<0;if(this.negative!==0&&!g)return-1;if(this.negative===0&&g)return 1;this.strip();var _;if(this.length>1)_=1;else{g&&(d=-d),l(d<=67108863,"Number is too big");var w=this.words[0]|0;_=w===d?0:w<d?-1:1}return this.negative!==0?-_|0:_},c.prototype.cmp=function(d){if(this.negative!==0&&d.negative===0)return-1;if(this.negative===0&&d.negative!==0)return 1;var g=this.ucmp(d);return this.negative!==0?-g|0:g},c.prototype.ucmp=function(d){if(this.length>d.length)return 1;if(this.length<d.length)return-1;for(var g=0,_=this.length-1;_>=0;_--){var w=this.words[_]|0,x=d.words[_]|0;if(w!==x){w<x?g=-1:w>x&&(g=1);break}}return g},c.prototype.gtn=function(d){return this.cmpn(d)===1},c.prototype.gt=function(d){return this.cmp(d)===1},c.prototype.gten=function(d){return this.cmpn(d)>=0},c.prototype.gte=function(d){return this.cmp(d)>=0},c.prototype.ltn=function(d){return this.cmpn(d)===-1},c.prototype.lt=function(d){return this.cmp(d)===-1},c.prototype.lten=function(d){return this.cmpn(d)<=0},c.prototype.lte=function(d){return this.cmp(d)<=0},c.prototype.eqn=function(d){return this.cmpn(d)===0},c.prototype.eq=function(d){return this.cmp(d)===0},c.red=function(d){return new Q(d)},c.prototype.toRed=function(d){return l(!this.red,"Already a number in reduction context"),l(this.negative===0,"red works only with positives"),d.convertTo(this)._forceRed(d)},c.prototype.fromRed=function(){return l(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},c.prototype._forceRed=function(d){return this.red=d,this},c.prototype.forceRed=function(d){return l(!this.red,"Already a number in reduction context"),this._forceRed(d)},c.prototype.redAdd=function(d){return l(this.red,"redAdd works only with red numbers"),this.red.add(this,d)},c.prototype.redIAdd=function(d){return l(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,d)},c.prototype.redSub=function(d){return l(this.red,"redSub works only with red numbers"),this.red.sub(this,d)},c.prototype.redISub=function(d){return l(this.red,"redISub works only with red numbers"),this.red.isub(this,d)},c.prototype.redShl=function(d){return l(this.red,"redShl works only with red numbers"),this.red.shl(this,d)},c.prototype.redMul=function(d){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.mul(this,d)},c.prototype.redIMul=function(d){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.imul(this,d)},c.prototype.redSqr=function(){return l(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},c.prototype.redISqr=function(){return l(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},c.prototype.redSqrt=function(){return l(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},c.prototype.redInvm=function(){return l(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},c.prototype.redNeg=function(){return l(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},c.prototype.redPow=function(d){return l(this.red&&!d.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,d)};var G={k256:null,p224:null,p192:null,p25519:null};function V(k,d){this.name=k,this.p=new c(d,16),this.n=this.p.bitLength(),this.k=new c(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}V.prototype._tmp=function(){var d=new c(null);return d.words=new Array(Math.ceil(this.n/13)),d},V.prototype.ireduce=function(d){var g=d,_;do this.split(g,this.tmp),g=this.imulK(g),g=g.iadd(this.tmp),_=g.bitLength();while(_>this.n);var w=_<this.n?-1:g.ucmp(this.p);return w===0?(g.words[0]=0,g.length=1):w>0?g.isub(this.p):g.strip!==void 0?g.strip():g._strip(),g},V.prototype.split=function(d,g){d.iushrn(this.n,0,g)},V.prototype.imulK=function(d){return d.imul(this.k)};function U(){V.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}f(U,V),U.prototype.split=function(d,g){for(var _=4194303,w=Math.min(d.length,9),x=0;x<w;x++)g.words[x]=d.words[x];if(g.length=w,d.length<=9){d.words[0]=0,d.length=1;return}var P=d.words[9];for(g.words[g.length++]=P&_,x=10;x<d.length;x++){var $=d.words[x]|0;d.words[x-10]=($&_)<<4|P>>>22,P=$}P>>>=22,d.words[x-10]=P,P===0&&d.length>10?d.length-=10:d.length-=9},U.prototype.imulK=function(d){d.words[d.length]=0,d.words[d.length+1]=0,d.length+=2;for(var g=0,_=0;_<d.length;_++){var w=d.words[_]|0;g+=w*977,d.words[_]=g&67108863,g=w*64+(g/67108864|0)}return d.words[d.length-1]===0&&(d.length--,d.words[d.length-1]===0&&d.length--),d};function te(){V.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}f(te,V);function Z(){V.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}f(Z,V);function J(){V.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}f(J,V),J.prototype.imulK=function(d){for(var g=0,_=0;_<d.length;_++){var w=(d.words[_]|0)*19+g,x=w&67108863;w>>>=26,d.words[_]=x,g=w}return g!==0&&(d.words[d.length++]=g),d},c._prime=function(d){if(G[d])return G[d];var g;if(d==="k256")g=new U;else if(d==="p224")g=new te;else if(d==="p192")g=new Z;else if(d==="p25519")g=new J;else throw new Error("Unknown prime "+d);return G[d]=g,g};function Q(k){if(typeof k=="string"){var d=c._prime(k);this.m=d.p,this.prime=d}else l(k.gtn(1),"modulus must be greater than 1"),this.m=k,this.prime=null}Q.prototype._verify1=function(d){l(d.negative===0,"red works only with positives"),l(d.red,"red works only with red numbers")},Q.prototype._verify2=function(d,g){l((d.negative|g.negative)===0,"red works only with positives"),l(d.red&&d.red===g.red,"red works only with red numbers")},Q.prototype.imod=function(d){return this.prime?this.prime.ireduce(d)._forceRed(this):d.umod(this.m)._forceRed(this)},Q.prototype.neg=function(d){return d.isZero()?d.clone():this.m.sub(d)._forceRed(this)},Q.prototype.add=function(d,g){this._verify2(d,g);var _=d.add(g);return _.cmp(this.m)>=0&&_.isub(this.m),_._forceRed(this)},Q.prototype.iadd=function(d,g){this._verify2(d,g);var _=d.iadd(g);return _.cmp(this.m)>=0&&_.isub(this.m),_},Q.prototype.sub=function(d,g){this._verify2(d,g);var _=d.sub(g);return _.cmpn(0)<0&&_.iadd(this.m),_._forceRed(this)},Q.prototype.isub=function(d,g){this._verify2(d,g);var _=d.isub(g);return _.cmpn(0)<0&&_.iadd(this.m),_},Q.prototype.shl=function(d,g){return this._verify1(d),this.imod(d.ushln(g))},Q.prototype.imul=function(d,g){return this._verify2(d,g),this.imod(d.imul(g))},Q.prototype.mul=function(d,g){return this._verify2(d,g),this.imod(d.mul(g))},Q.prototype.isqr=function(d){return this.imul(d,d.clone())},Q.prototype.sqr=function(d){return this.mul(d,d)},Q.prototype.sqrt=function(d){if(d.isZero())return d.clone();var g=this.m.andln(3);if(l(g%2===1),g===3){var _=this.m.add(new c(1)).iushrn(2);return this.pow(d,_)}for(var w=this.m.subn(1),x=0;!w.isZero()&&w.andln(1)===0;)x++,w.iushrn(1);l(!w.isZero());var P=new c(1).toRed(this),$=P.redNeg(),T=this.m.subn(1).iushrn(1),m=this.m.bitLength();for(m=new c(2*m*m).toRed(this);this.pow(m,T).cmp($)!==0;)m.redIAdd($);for(var M=this.pow(m,w),W=this.pow(d,w.addn(1).iushrn(1)),Y=this.pow(d,w),ue=x;Y.cmp(P)!==0;){for(var ge=Y,he=0;ge.cmp(P)!==0;he++)ge=ge.redSqr();l(he<ue);var ae=this.pow(M,new c(1).iushln(ue-he-1));W=W.redMul(ae),M=ae.redSqr(),Y=Y.redMul(M),ue=he}return W},Q.prototype.invm=function(d){var g=d._invmp(this.m);return g.negative!==0?(g.negative=0,this.imod(g).redNeg()):this.imod(g)},Q.prototype.pow=function(d,g){if(g.isZero())return new c(1).toRed(this);if(g.cmpn(1)===0)return d.clone();var _=4,w=new Array(1<<_);w[0]=new c(1).toRed(this),w[1]=d;for(var x=2;x<w.length;x++)w[x]=this.mul(w[x-1],d);var P=w[0],$=0,T=0,m=g.bitLength()%26;for(m===0&&(m=26),x=g.length-1;x>=0;x--){for(var M=g.words[x],W=m-1;W>=0;W--){var Y=M>>W&1;if(P!==w[0]&&(P=this.sqr(P)),Y===0&&$===0){T=0;continue}$<<=1,$|=Y,T++,!(T!==_&&(x!==0||W!==0))&&(P=this.mul(P,w[$]),T=0,$=0)}m=26}return P},Q.prototype.convertTo=function(d){var g=d.umod(this.m);return g===d?g.clone():g},Q.prototype.convertFrom=function(d){var g=d.clone();return g.red=null,g},c.mont=function(d){return new ee(d)};function ee(k){Q.call(this,k),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new c(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}f(ee,Q),ee.prototype.convertTo=function(d){return this.imod(d.ushln(this.shift))},ee.prototype.convertFrom=function(d){var g=this.imod(d.mul(this.rinv));return g.red=null,g},ee.prototype.imul=function(d,g){if(d.isZero()||g.isZero())return d.words[0]=0,d.length=1,d;var _=d.imul(g),w=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=_.isub(w).iushrn(this.shift),P=x;return x.cmp(this.m)>=0?P=x.isub(this.m):x.cmpn(0)<0&&(P=x.iadd(this.m)),P._forceRed(this)},ee.prototype.mul=function(d,g){if(d.isZero()||g.isZero())return new c(0)._forceRed(this);var _=d.mul(g),w=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=_.isub(w).iushrn(this.shift),P=x;return x.cmp(this.m)>=0?P=x.isub(this.m):x.cmpn(0)<0&&(P=x.iadd(this.m)),P._forceRed(this)},ee.prototype.invm=function(d){var g=this.imod(d._invmp(this.m).mul(this.r2));return g._forceRed(this)}})(s,bn$6)}(bn$7)),bn$7.exports}var utils$2={},hasRequiredUtils$3;function requireUtils$3(){return hasRequiredUtils$3||(hasRequiredUtils$3=1,function(s){var a=s;function u(c,h){if(Array.isArray(c))return c.slice();if(!c)return[];var p=[];if(typeof c!="string"){for(var v=0;v<c.length;v++)p[v]=c[v]|0;return p}if(h==="hex"){c=c.replace(/[^a-z0-9]+/ig,""),c.length%2!==0&&(c="0"+c);for(var v=0;v<c.length;v+=2)p.push(parseInt(c[v]+c[v+1],16))}else for(var v=0;v<c.length;v++){var y=c.charCodeAt(v),b=y>>8,S=y&255;b?p.push(b,S):p.push(S)}return p}a.toArray=u;function l(c){return c.length===1?"0"+c:c}a.zero2=l;function f(c){for(var h="",p=0;p<c.length;p++)h+=l(c[p].toString(16));return h}a.toHex=f,a.encode=function(h,p){return p==="hex"?f(h):h}}(utils$2)),utils$2}var hasRequiredUtils$2;function requireUtils$2(){return hasRequiredUtils$2||(hasRequiredUtils$2=1,function(s){var a=s,u=requireBn$3(),l=requireMinimalisticAssert(),f=requireUtils$3();a.assert=l,a.toArray=f.toArray,a.zero2=f.zero2,a.toHex=f.toHex,a.encode=f.encode;function c(b,S,E){var R=new Array(Math.max(b.bitLength(),E)+1),O;for(O=0;O<R.length;O+=1)R[O]=0;var I=1<<S+1,B=b.clone();for(O=0;O<R.length;O++){var N,D=B.andln(I-1);B.isOdd()?(D>(I>>1)-1?N=(I>>1)-D:N=D,B.isubn(N)):N=0,R[O]=N,B.iushrn(1)}return R}a.getNAF=c;function h(b,S){var E=[[],[]];b=b.clone(),S=S.clone();for(var R=0,O=0,I;b.cmpn(-R)>0||S.cmpn(-O)>0;){var B=b.andln(3)+R&3,N=S.andln(3)+O&3;B===3&&(B=-1),N===3&&(N=-1);var D;B&1?(I=b.andln(7)+R&7,(I===3||I===5)&&N===2?D=-B:D=B):D=0,E[0].push(D);var G;N&1?(I=S.andln(7)+O&7,(I===3||I===5)&&B===2?G=-N:G=N):G=0,E[1].push(G),2*R===D+1&&(R=1-R),2*O===G+1&&(O=1-O),b.iushrn(1),S.iushrn(1)}return E}a.getJSF=h;function p(b,S,E){var R="_"+S;b.prototype[S]=function(){return this[R]!==void 0?this[R]:this[R]=E.call(this)}}a.cachedProperty=p;function v(b){return typeof b=="string"?a.toArray(b,"hex"):b}a.parseBytes=v;function y(b){return new u(b,"hex","le")}a.intFromLE=y}(utils$3)),utils$3}var curve={},base$3,hasRequiredBase$3;function requireBase$3(){if(hasRequiredBase$3)return base$3;hasRequiredBase$3=1;var s=requireBn$3(),a=requireUtils$2(),u=a.getNAF,l=a.getJSF,f=a.assert;function c(p,v){this.type=p,this.p=new s(v.p,16),this.red=v.prime?s.red(v.prime):s.mont(this.p),this.zero=new s(0).toRed(this.red),this.one=new s(1).toRed(this.red),this.two=new s(2).toRed(this.red),this.n=v.n&&new s(v.n,16),this.g=v.g&&this.pointFromJSON(v.g,v.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var y=this.n&&this.p.div(this.n);!y||y.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}base$3=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(v,y){f(v.precomputed);var b=v._getDoubles(),S=u(y,1,this._bitLength),E=(1<<b.step+1)-(b.step%2===0?2:1);E/=3;var R=[],O,I;for(O=0;O<S.length;O+=b.step){I=0;for(var B=O+b.step-1;B>=O;B--)I=(I<<1)+S[B];R.push(I)}for(var N=this.jpoint(null,null,null),D=this.jpoint(null,null,null),G=E;G>0;G--){for(O=0;O<R.length;O++)I=R[O],I===G?D=D.mixedAdd(b.points[O]):I===-G&&(D=D.mixedAdd(b.points[O].neg()));N=N.add(D)}return N.toP()},c.prototype._wnafMul=function(v,y){var b=4,S=v._getNAFPoints(b);b=S.wnd;for(var E=S.points,R=u(y,b,this._bitLength),O=this.jpoint(null,null,null),I=R.length-1;I>=0;I--){for(var B=0;I>=0&&R[I]===0;I--)B++;if(I>=0&&B++,O=O.dblp(B),I<0)break;var N=R[I];f(N!==0),v.type==="affine"?N>0?O=O.mixedAdd(E[N-1>>1]):O=O.mixedAdd(E[-N-1>>1].neg()):N>0?O=O.add(E[N-1>>1]):O=O.add(E[-N-1>>1].neg())}return v.type==="affine"?O.toP():O},c.prototype._wnafMulAdd=function(v,y,b,S,E){var R=this._wnafT1,O=this._wnafT2,I=this._wnafT3,B=0,N,D,G;for(N=0;N<S;N++){G=y[N];var V=G._getNAFPoints(v);R[N]=V.wnd,O[N]=V.points}for(N=S-1;N>=1;N-=2){var U=N-1,te=N;if(R[U]!==1||R[te]!==1){I[U]=u(b[U],R[U],this._bitLength),I[te]=u(b[te],R[te],this._bitLength),B=Math.max(I[U].length,B),B=Math.max(I[te].length,B);continue}var Z=[y[U],null,null,y[te]];y[U].y.cmp(y[te].y)===0?(Z[1]=y[U].add(y[te]),Z[2]=y[U].toJ().mixedAdd(y[te].neg())):y[U].y.cmp(y[te].y.redNeg())===0?(Z[1]=y[U].toJ().mixedAdd(y[te]),Z[2]=y[U].add(y[te].neg())):(Z[1]=y[U].toJ().mixedAdd(y[te]),Z[2]=y[U].toJ().mixedAdd(y[te].neg()));var J=[-3,-1,-5,-7,0,7,5,1,3],Q=l(b[U],b[te]);for(B=Math.max(Q[0].length,B),I[U]=new Array(B),I[te]=new Array(B),D=0;D<B;D++){var ee=Q[0][D]|0,k=Q[1][D]|0;I[U][D]=J[(ee+1)*3+(k+1)],I[te][D]=0,O[U]=Z}}var d=this.jpoint(null,null,null),g=this._wnafT4;for(N=B;N>=0;N--){for(var _=0;N>=0;){var w=!0;for(D=0;D<S;D++)g[D]=I[D][N]|0,g[D]!==0&&(w=!1);if(!w)break;_++,N--}if(N>=0&&_++,d=d.dblp(_),N<0)break;for(D=0;D<S;D++){var x=g[D];x!==0&&(x>0?G=O[D][x-1>>1]:x<0&&(G=O[D][-x-1>>1].neg()),G.type==="affine"?d=d.mixedAdd(G):d=d.add(G))}}for(N=0;N<S;N++)O[N]=null;return E?d:d.toP()};function h(p,v){this.curve=p,this.type=v,this.precomputed=null}return c.BasePoint=h,h.prototype.eq=function(){throw new Error("Not implemented")},h.prototype.validate=function(){return this.curve.validate(this)},c.prototype.decodePoint=function(v,y){v=a.toArray(v,y);var b=this.p.byteLength();if((v[0]===4||v[0]===6||v[0]===7)&&v.length-1===2*b){v[0]===6?f(v[v.length-1]%2===0):v[0]===7&&f(v[v.length-1]%2===1);var S=this.point(v.slice(1,1+b),v.slice(1+b,1+2*b));return S}else if((v[0]===2||v[0]===3)&&v.length-1===b)return this.pointFromX(v.slice(1,1+b),v[0]===3);throw new Error("Unknown point format")},h.prototype.encodeCompressed=function(v){return this.encode(v,!0)},h.prototype._encode=function(v){var y=this.curve.p.byteLength(),b=this.getX().toArray("be",y);return v?[this.getY().isEven()?2:3].concat(b):[4].concat(b,this.getY().toArray("be",y))},h.prototype.encode=function(v,y){return a.encode(this._encode(y),v)},h.prototype.precompute=function(v){if(this.precomputed)return this;var y={doubles:null,naf:null,beta:null};return y.naf=this._getNAFPoints(8),y.doubles=this._getDoubles(4,v),y.beta=this._getBeta(),this.precomputed=y,this},h.prototype._hasDoubles=function(v){if(!this.precomputed)return!1;var y=this.precomputed.doubles;return y?y.points.length>=Math.ceil((v.bitLength()+1)/y.step):!1},h.prototype._getDoubles=function(v,y){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var b=[this],S=this,E=0;E<y;E+=v){for(var R=0;R<v;R++)S=S.dbl();b.push(S)}return{step:v,points:b}},h.prototype._getNAFPoints=function(v){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var y=[this],b=(1<<v)-1,S=b===1?null:this.dbl(),E=1;E<b;E++)y[E]=y[E-1].add(S);return{wnd:v,points:y}},h.prototype._getBeta=function(){return null},h.prototype.dblp=function(v){for(var y=this,b=0;b<v;b++)y=y.dbl();return y},base$3}var short,hasRequiredShort;function requireShort(){if(hasRequiredShort)return short;hasRequiredShort=1;var s=requireUtils$2(),a=requireBn$3(),u=requireInherits_browser(),l=requireBase$3(),f=s.assert;function c(v){l.call(this,"short",v),this.a=new a(v.a,16).toRed(this.red),this.b=new a(v.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(v),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}u(c,l),short=c,c.prototype._getEndomorphism=function(y){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var b,S;if(y.beta)b=new a(y.beta,16).toRed(this.red);else{var E=this._getEndoRoots(this.p);b=E[0].cmp(E[1])<0?E[0]:E[1],b=b.toRed(this.red)}if(y.lambda)S=new a(y.lambda,16);else{var R=this._getEndoRoots(this.n);this.g.mul(R[0]).x.cmp(this.g.x.redMul(b))===0?S=R[0]:(S=R[1],f(this.g.mul(S).x.cmp(this.g.x.redMul(b))===0))}var O;return y.basis?O=y.basis.map(function(I){return{a:new a(I.a,16),b:new a(I.b,16)}}):O=this._getEndoBasis(S),{beta:b,lambda:S,basis:O}}},c.prototype._getEndoRoots=function(y){var b=y===this.p?this.red:a.mont(y),S=new a(2).toRed(b).redInvm(),E=S.redNeg(),R=new a(3).toRed(b).redNeg().redSqrt().redMul(S),O=E.redAdd(R).fromRed(),I=E.redSub(R).fromRed();return[O,I]},c.prototype._getEndoBasis=function(y){for(var b=this.n.ushrn(Math.floor(this.n.bitLength()/2)),S=y,E=this.n.clone(),R=new a(1),O=new a(0),I=new a(0),B=new a(1),N,D,G,V,U,te,Z,J=0,Q,ee;S.cmpn(0)!==0;){var k=E.div(S);Q=E.sub(k.mul(S)),ee=I.sub(k.mul(R));var d=B.sub(k.mul(O));if(!G&&Q.cmp(b)<0)N=Z.neg(),D=R,G=Q.neg(),V=ee;else if(G&&++J===2)break;Z=Q,E=S,S=Q,I=R,R=ee,B=O,O=d}U=Q.neg(),te=ee;var g=G.sqr().add(V.sqr()),_=U.sqr().add(te.sqr());return _.cmp(g)>=0&&(U=N,te=D),G.negative&&(G=G.neg(),V=V.neg()),U.negative&&(U=U.neg(),te=te.neg()),[{a:G,b:V},{a:U,b:te}]},c.prototype._endoSplit=function(y){var b=this.endo.basis,S=b[0],E=b[1],R=E.b.mul(y).divRound(this.n),O=S.b.neg().mul(y).divRound(this.n),I=R.mul(S.a),B=O.mul(E.a),N=R.mul(S.b),D=O.mul(E.b),G=y.sub(I).sub(B),V=N.add(D).neg();return{k1:G,k2:V}},c.prototype.pointFromX=function(y,b){y=new a(y,16),y.red||(y=y.toRed(this.red));var S=y.redSqr().redMul(y).redIAdd(y.redMul(this.a)).redIAdd(this.b),E=S.redSqrt();if(E.redSqr().redSub(S).cmp(this.zero)!==0)throw new Error("invalid point");var R=E.fromRed().isOdd();return(b&&!R||!b&&R)&&(E=E.redNeg()),this.point(y,E)},c.prototype.validate=function(y){if(y.inf)return!0;var b=y.x,S=y.y,E=this.a.redMul(b),R=b.redSqr().redMul(b).redIAdd(E).redIAdd(this.b);return S.redSqr().redISub(R).cmpn(0)===0},c.prototype._endoWnafMulAdd=function(y,b,S){for(var E=this._endoWnafT1,R=this._endoWnafT2,O=0;O<y.length;O++){var I=this._endoSplit(b[O]),B=y[O],N=B._getBeta();I.k1.negative&&(I.k1.ineg(),B=B.neg(!0)),I.k2.negative&&(I.k2.ineg(),N=N.neg(!0)),E[O*2]=B,E[O*2+1]=N,R[O*2]=I.k1,R[O*2+1]=I.k2}for(var D=this._wnafMulAdd(1,E,R,O*2,S),G=0;G<O*2;G++)E[G]=null,R[G]=null;return D};function h(v,y,b,S){l.BasePoint.call(this,v,"affine"),y===null&&b===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new a(y,16),this.y=new a(b,16),S&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}u(h,l.BasePoint),c.prototype.point=function(y,b,S){return new h(this,y,b,S)},c.prototype.pointFromJSON=function(y,b){return h.fromJSON(this,y,b)},h.prototype._getBeta=function(){if(this.curve.endo){var y=this.precomputed;if(y&&y.beta)return y.beta;var b=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(y){var S=this.curve,E=function(R){return S.point(R.x.redMul(S.endo.beta),R.y)};y.beta=b,b.precomputed={beta:null,naf:y.naf&&{wnd:y.naf.wnd,points:y.naf.points.map(E)},doubles:y.doubles&&{step:y.doubles.step,points:y.doubles.points.map(E)}}}return b}},h.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},h.fromJSON=function(y,b,S){typeof b=="string"&&(b=JSON.parse(b));var E=y.point(b[0],b[1],S);if(!b[2])return E;function R(I){return y.point(I[0],I[1],S)}var O=b[2];return E.precomputed={beta:null,doubles:O.doubles&&{step:O.doubles.step,points:[E].concat(O.doubles.points.map(R))},naf:O.naf&&{wnd:O.naf.wnd,points:[E].concat(O.naf.points.map(R))}},E},h.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},h.prototype.isInfinity=function(){return this.inf},h.prototype.add=function(y){if(this.inf)return y;if(y.inf)return this;if(this.eq(y))return this.dbl();if(this.neg().eq(y))return this.curve.point(null,null);if(this.x.cmp(y.x)===0)return this.curve.point(null,null);var b=this.y.redSub(y.y);b.cmpn(0)!==0&&(b=b.redMul(this.x.redSub(y.x).redInvm()));var S=b.redSqr().redISub(this.x).redISub(y.x),E=b.redMul(this.x.redSub(S)).redISub(this.y);return this.curve.point(S,E)},h.prototype.dbl=function(){if(this.inf)return this;var y=this.y.redAdd(this.y);if(y.cmpn(0)===0)return this.curve.point(null,null);var b=this.curve.a,S=this.x.redSqr(),E=y.redInvm(),R=S.redAdd(S).redIAdd(S).redIAdd(b).redMul(E),O=R.redSqr().redISub(this.x.redAdd(this.x)),I=R.redMul(this.x.redSub(O)).redISub(this.y);return this.curve.point(O,I)},h.prototype.getX=function(){return this.x.fromRed()},h.prototype.getY=function(){return this.y.fromRed()},h.prototype.mul=function(y){return y=new a(y,16),this.isInfinity()?this:this._hasDoubles(y)?this.curve._fixedNafMul(this,y):this.curve.endo?this.curve._endoWnafMulAdd([this],[y]):this.curve._wnafMul(this,y)},h.prototype.mulAdd=function(y,b,S){var E=[this,b],R=[y,S];return this.curve.endo?this.curve._endoWnafMulAdd(E,R):this.curve._wnafMulAdd(1,E,R,2)},h.prototype.jmulAdd=function(y,b,S){var E=[this,b],R=[y,S];return this.curve.endo?this.curve._endoWnafMulAdd(E,R,!0):this.curve._wnafMulAdd(1,E,R,2,!0)},h.prototype.eq=function(y){return this===y||this.inf===y.inf&&(this.inf||this.x.cmp(y.x)===0&&this.y.cmp(y.y)===0)},h.prototype.neg=function(y){if(this.inf)return this;var b=this.curve.point(this.x,this.y.redNeg());if(y&&this.precomputed){var S=this.precomputed,E=function(R){return R.neg()};b.precomputed={naf:S.naf&&{wnd:S.naf.wnd,points:S.naf.points.map(E)},doubles:S.doubles&&{step:S.doubles.step,points:S.doubles.points.map(E)}}}return b},h.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var y=this.curve.jpoint(this.x,this.y,this.curve.one);return y};function p(v,y,b,S){l.BasePoint.call(this,v,"jacobian"),y===null&&b===null&&S===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new a(0)):(this.x=new a(y,16),this.y=new a(b,16),this.z=new a(S,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}return u(p,l.BasePoint),c.prototype.jpoint=function(y,b,S){return new p(this,y,b,S)},p.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var y=this.z.redInvm(),b=y.redSqr(),S=this.x.redMul(b),E=this.y.redMul(b).redMul(y);return this.curve.point(S,E)},p.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},p.prototype.add=function(y){if(this.isInfinity())return y;if(y.isInfinity())return this;var b=y.z.redSqr(),S=this.z.redSqr(),E=this.x.redMul(b),R=y.x.redMul(S),O=this.y.redMul(b.redMul(y.z)),I=y.y.redMul(S.redMul(this.z)),B=E.redSub(R),N=O.redSub(I);if(B.cmpn(0)===0)return N.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var D=B.redSqr(),G=D.redMul(B),V=E.redMul(D),U=N.redSqr().redIAdd(G).redISub(V).redISub(V),te=N.redMul(V.redISub(U)).redISub(O.redMul(G)),Z=this.z.redMul(y.z).redMul(B);return this.curve.jpoint(U,te,Z)},p.prototype.mixedAdd=function(y){if(this.isInfinity())return y.toJ();if(y.isInfinity())return this;var b=this.z.redSqr(),S=this.x,E=y.x.redMul(b),R=this.y,O=y.y.redMul(b).redMul(this.z),I=S.redSub(E),B=R.redSub(O);if(I.cmpn(0)===0)return B.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var N=I.redSqr(),D=N.redMul(I),G=S.redMul(N),V=B.redSqr().redIAdd(D).redISub(G).redISub(G),U=B.redMul(G.redISub(V)).redISub(R.redMul(D)),te=this.z.redMul(I);return this.curve.jpoint(V,U,te)},p.prototype.dblp=function(y){if(y===0)return this;if(this.isInfinity())return this;if(!y)return this.dbl();var b;if(this.curve.zeroA||this.curve.threeA){var S=this;for(b=0;b<y;b++)S=S.dbl();return S}var E=this.curve.a,R=this.curve.tinv,O=this.x,I=this.y,B=this.z,N=B.redSqr().redSqr(),D=I.redAdd(I);for(b=0;b<y;b++){var G=O.redSqr(),V=D.redSqr(),U=V.redSqr(),te=G.redAdd(G).redIAdd(G).redIAdd(E.redMul(N)),Z=O.redMul(V),J=te.redSqr().redISub(Z.redAdd(Z)),Q=Z.redISub(J),ee=te.redMul(Q);ee=ee.redIAdd(ee).redISub(U);var k=D.redMul(B);b+1<y&&(N=N.redMul(U)),O=J,B=k,D=ee}return this.curve.jpoint(O,D.redMul(R),B)},p.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},p.prototype._zeroDbl=function(){var y,b,S;if(this.zOne){var E=this.x.redSqr(),R=this.y.redSqr(),O=R.redSqr(),I=this.x.redAdd(R).redSqr().redISub(E).redISub(O);I=I.redIAdd(I);var B=E.redAdd(E).redIAdd(E),N=B.redSqr().redISub(I).redISub(I),D=O.redIAdd(O);D=D.redIAdd(D),D=D.redIAdd(D),y=N,b=B.redMul(I.redISub(N)).redISub(D),S=this.y.redAdd(this.y)}else{var G=this.x.redSqr(),V=this.y.redSqr(),U=V.redSqr(),te=this.x.redAdd(V).redSqr().redISub(G).redISub(U);te=te.redIAdd(te);var Z=G.redAdd(G).redIAdd(G),J=Z.redSqr(),Q=U.redIAdd(U);Q=Q.redIAdd(Q),Q=Q.redIAdd(Q),y=J.redISub(te).redISub(te),b=Z.redMul(te.redISub(y)).redISub(Q),S=this.y.redMul(this.z),S=S.redIAdd(S)}return this.curve.jpoint(y,b,S)},p.prototype._threeDbl=function(){var y,b,S;if(this.zOne){var E=this.x.redSqr(),R=this.y.redSqr(),O=R.redSqr(),I=this.x.redAdd(R).redSqr().redISub(E).redISub(O);I=I.redIAdd(I);var B=E.redAdd(E).redIAdd(E).redIAdd(this.curve.a),N=B.redSqr().redISub(I).redISub(I);y=N;var D=O.redIAdd(O);D=D.redIAdd(D),D=D.redIAdd(D),b=B.redMul(I.redISub(N)).redISub(D),S=this.y.redAdd(this.y)}else{var G=this.z.redSqr(),V=this.y.redSqr(),U=this.x.redMul(V),te=this.x.redSub(G).redMul(this.x.redAdd(G));te=te.redAdd(te).redIAdd(te);var Z=U.redIAdd(U);Z=Z.redIAdd(Z);var J=Z.redAdd(Z);y=te.redSqr().redISub(J),S=this.y.redAdd(this.z).redSqr().redISub(V).redISub(G);var Q=V.redSqr();Q=Q.redIAdd(Q),Q=Q.redIAdd(Q),Q=Q.redIAdd(Q),b=te.redMul(Z.redISub(y)).redISub(Q)}return this.curve.jpoint(y,b,S)},p.prototype._dbl=function(){var y=this.curve.a,b=this.x,S=this.y,E=this.z,R=E.redSqr().redSqr(),O=b.redSqr(),I=S.redSqr(),B=O.redAdd(O).redIAdd(O).redIAdd(y.redMul(R)),N=b.redAdd(b);N=N.redIAdd(N);var D=N.redMul(I),G=B.redSqr().redISub(D.redAdd(D)),V=D.redISub(G),U=I.redSqr();U=U.redIAdd(U),U=U.redIAdd(U),U=U.redIAdd(U);var te=B.redMul(V).redISub(U),Z=S.redAdd(S).redMul(E);return this.curve.jpoint(G,te,Z)},p.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var y=this.x.redSqr(),b=this.y.redSqr(),S=this.z.redSqr(),E=b.redSqr(),R=y.redAdd(y).redIAdd(y),O=R.redSqr(),I=this.x.redAdd(b).redSqr().redISub(y).redISub(E);I=I.redIAdd(I),I=I.redAdd(I).redIAdd(I),I=I.redISub(O);var B=I.redSqr(),N=E.redIAdd(E);N=N.redIAdd(N),N=N.redIAdd(N),N=N.redIAdd(N);var D=R.redIAdd(I).redSqr().redISub(O).redISub(B).redISub(N),G=b.redMul(D);G=G.redIAdd(G),G=G.redIAdd(G);var V=this.x.redMul(B).redISub(G);V=V.redIAdd(V),V=V.redIAdd(V);var U=this.y.redMul(D.redMul(N.redISub(D)).redISub(I.redMul(B)));U=U.redIAdd(U),U=U.redIAdd(U),U=U.redIAdd(U);var te=this.z.redAdd(I).redSqr().redISub(S).redISub(B);return this.curve.jpoint(V,U,te)},p.prototype.mul=function(y,b){return y=new a(y,b),this.curve._wnafMul(this,y)},p.prototype.eq=function(y){if(y.type==="affine")return this.eq(y.toJ());if(this===y)return!0;var b=this.z.redSqr(),S=y.z.redSqr();if(this.x.redMul(S).redISub(y.x.redMul(b)).cmpn(0)!==0)return!1;var E=b.redMul(this.z),R=S.redMul(y.z);return this.y.redMul(R).redISub(y.y.redMul(E)).cmpn(0)===0},p.prototype.eqXToP=function(y){var b=this.z.redSqr(),S=y.toRed(this.curve.red).redMul(b);if(this.x.cmp(S)===0)return!0;for(var E=y.clone(),R=this.curve.redN.redMul(b);;){if(E.iadd(this.curve.n),E.cmp(this.curve.p)>=0)return!1;if(S.redIAdd(R),this.x.cmp(S)===0)return!0}},p.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},p.prototype.isInfinity=function(){return this.z.cmpn(0)===0},short}var mont,hasRequiredMont;function requireMont(){if(hasRequiredMont)return mont;hasRequiredMont=1;var s=requireBn$3(),a=requireInherits_browser(),u=requireBase$3(),l=requireUtils$2();function f(h){u.call(this,"mont",h),this.a=new s(h.a,16).toRed(this.red),this.b=new s(h.b,16).toRed(this.red),this.i4=new s(4).toRed(this.red).redInvm(),this.two=new s(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}a(f,u),mont=f,f.prototype.validate=function(p){var v=p.normalize().x,y=v.redSqr(),b=y.redMul(v).redAdd(y.redMul(this.a)).redAdd(v),S=b.redSqrt();return S.redSqr().cmp(b)===0};function c(h,p,v){u.BasePoint.call(this,h,"projective"),p===null&&v===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new s(p,16),this.z=new s(v,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return a(c,u.BasePoint),f.prototype.decodePoint=function(p,v){return this.point(l.toArray(p,v),1)},f.prototype.point=function(p,v){return new c(this,p,v)},f.prototype.pointFromJSON=function(p){return c.fromJSON(this,p)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(p,v){return new c(p,v[0],v[1]||p.one)},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return this.z.cmpn(0)===0},c.prototype.dbl=function(){var p=this.x.redAdd(this.z),v=p.redSqr(),y=this.x.redSub(this.z),b=y.redSqr(),S=v.redSub(b),E=v.redMul(b),R=S.redMul(b.redAdd(this.curve.a24.redMul(S)));return this.curve.point(E,R)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(p,v){var y=this.x.redAdd(this.z),b=this.x.redSub(this.z),S=p.x.redAdd(p.z),E=p.x.redSub(p.z),R=E.redMul(y),O=S.redMul(b),I=v.z.redMul(R.redAdd(O).redSqr()),B=v.x.redMul(R.redISub(O).redSqr());return this.curve.point(I,B)},c.prototype.mul=function(p){for(var v=p.clone(),y=this,b=this.curve.point(null,null),S=this,E=[];v.cmpn(0)!==0;v.iushrn(1))E.push(v.andln(1));for(var R=E.length-1;R>=0;R--)E[R]===0?(y=y.diffAdd(b,S),b=b.dbl()):(b=y.diffAdd(b,S),y=y.dbl());return b},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(p){return this.getX().cmp(p.getX())===0},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},mont}var edwards,hasRequiredEdwards;function requireEdwards(){if(hasRequiredEdwards)return edwards;hasRequiredEdwards=1;var s=requireUtils$2(),a=requireBn$3(),u=requireInherits_browser(),l=requireBase$3(),f=s.assert;function c(p){this.twisted=(p.a|0)!==1,this.mOneA=this.twisted&&(p.a|0)===-1,this.extended=this.mOneA,l.call(this,"edwards",p),this.a=new a(p.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new a(p.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new a(p.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),f(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(p.c|0)===1}u(c,l),edwards=c,c.prototype._mulA=function(v){return this.mOneA?v.redNeg():this.a.redMul(v)},c.prototype._mulC=function(v){return this.oneC?v:this.c.redMul(v)},c.prototype.jpoint=function(v,y,b,S){return this.point(v,y,b,S)},c.prototype.pointFromX=function(v,y){v=new a(v,16),v.red||(v=v.toRed(this.red));var b=v.redSqr(),S=this.c2.redSub(this.a.redMul(b)),E=this.one.redSub(this.c2.redMul(this.d).redMul(b)),R=S.redMul(E.redInvm()),O=R.redSqrt();if(O.redSqr().redSub(R).cmp(this.zero)!==0)throw new Error("invalid point");var I=O.fromRed().isOdd();return(y&&!I||!y&&I)&&(O=O.redNeg()),this.point(v,O)},c.prototype.pointFromY=function(v,y){v=new a(v,16),v.red||(v=v.toRed(this.red));var b=v.redSqr(),S=b.redSub(this.c2),E=b.redMul(this.d).redMul(this.c2).redSub(this.a),R=S.redMul(E.redInvm());if(R.cmp(this.zero)===0){if(y)throw new Error("invalid point");return this.point(this.zero,v)}var O=R.redSqrt();if(O.redSqr().redSub(R).cmp(this.zero)!==0)throw new Error("invalid point");return O.fromRed().isOdd()!==y&&(O=O.redNeg()),this.point(O,v)},c.prototype.validate=function(v){if(v.isInfinity())return!0;v.normalize();var y=v.x.redSqr(),b=v.y.redSqr(),S=y.redMul(this.a).redAdd(b),E=this.c2.redMul(this.one.redAdd(this.d.redMul(y).redMul(b)));return S.cmp(E)===0};function h(p,v,y,b,S){l.BasePoint.call(this,p,"projective"),v===null&&y===null&&b===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new a(v,16),this.y=new a(y,16),this.z=b?new a(b,16):this.curve.one,this.t=S&&new a(S,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}return u(h,l.BasePoint),c.prototype.pointFromJSON=function(v){return h.fromJSON(this,v)},c.prototype.point=function(v,y,b,S){return new h(this,v,y,b,S)},h.fromJSON=function(v,y){return new h(v,y[0],y[1],y[2])},h.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},h.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},h.prototype._extDbl=function(){var v=this.x.redSqr(),y=this.y.redSqr(),b=this.z.redSqr();b=b.redIAdd(b);var S=this.curve._mulA(v),E=this.x.redAdd(this.y).redSqr().redISub(v).redISub(y),R=S.redAdd(y),O=R.redSub(b),I=S.redSub(y),B=E.redMul(O),N=R.redMul(I),D=E.redMul(I),G=O.redMul(R);return this.curve.point(B,N,G,D)},h.prototype._projDbl=function(){var v=this.x.redAdd(this.y).redSqr(),y=this.x.redSqr(),b=this.y.redSqr(),S,E,R,O,I,B;if(this.curve.twisted){O=this.curve._mulA(y);var N=O.redAdd(b);this.zOne?(S=v.redSub(y).redSub(b).redMul(N.redSub(this.curve.two)),E=N.redMul(O.redSub(b)),R=N.redSqr().redSub(N).redSub(N)):(I=this.z.redSqr(),B=N.redSub(I).redISub(I),S=v.redSub(y).redISub(b).redMul(B),E=N.redMul(O.redSub(b)),R=N.redMul(B))}else O=y.redAdd(b),I=this.curve._mulC(this.z).redSqr(),B=O.redSub(I).redSub(I),S=this.curve._mulC(v.redISub(O)).redMul(B),E=this.curve._mulC(O).redMul(y.redISub(b)),R=O.redMul(B);return this.curve.point(S,E,R)},h.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},h.prototype._extAdd=function(v){var y=this.y.redSub(this.x).redMul(v.y.redSub(v.x)),b=this.y.redAdd(this.x).redMul(v.y.redAdd(v.x)),S=this.t.redMul(this.curve.dd).redMul(v.t),E=this.z.redMul(v.z.redAdd(v.z)),R=b.redSub(y),O=E.redSub(S),I=E.redAdd(S),B=b.redAdd(y),N=R.redMul(O),D=I.redMul(B),G=R.redMul(B),V=O.redMul(I);return this.curve.point(N,D,V,G)},h.prototype._projAdd=function(v){var y=this.z.redMul(v.z),b=y.redSqr(),S=this.x.redMul(v.x),E=this.y.redMul(v.y),R=this.curve.d.redMul(S).redMul(E),O=b.redSub(R),I=b.redAdd(R),B=this.x.redAdd(this.y).redMul(v.x.redAdd(v.y)).redISub(S).redISub(E),N=y.redMul(O).redMul(B),D,G;return this.curve.twisted?(D=y.redMul(I).redMul(E.redSub(this.curve._mulA(S))),G=O.redMul(I)):(D=y.redMul(I).redMul(E.redSub(S)),G=this.curve._mulC(O).redMul(I)),this.curve.point(N,D,G)},h.prototype.add=function(v){return this.isInfinity()?v:v.isInfinity()?this:this.curve.extended?this._extAdd(v):this._projAdd(v)},h.prototype.mul=function(v){return this._hasDoubles(v)?this.curve._fixedNafMul(this,v):this.curve._wnafMul(this,v)},h.prototype.mulAdd=function(v,y,b){return this.curve._wnafMulAdd(1,[this,y],[v,b],2,!1)},h.prototype.jmulAdd=function(v,y,b){return this.curve._wnafMulAdd(1,[this,y],[v,b],2,!0)},h.prototype.normalize=function(){if(this.zOne)return this;var v=this.z.redInvm();return this.x=this.x.redMul(v),this.y=this.y.redMul(v),this.t&&(this.t=this.t.redMul(v)),this.z=this.curve.one,this.zOne=!0,this},h.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},h.prototype.getX=function(){return this.normalize(),this.x.fromRed()},h.prototype.getY=function(){return this.normalize(),this.y.fromRed()},h.prototype.eq=function(v){return this===v||this.getX().cmp(v.getX())===0&&this.getY().cmp(v.getY())===0},h.prototype.eqXToP=function(v){var y=v.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(y)===0)return!0;for(var b=v.clone(),S=this.curve.redN.redMul(this.z);;){if(b.iadd(this.curve.n),b.cmp(this.curve.p)>=0)return!1;if(y.redIAdd(S),this.x.cmp(y)===0)return!0}},h.prototype.toP=h.prototype.normalize,h.prototype.mixedAdd=h.prototype.add,edwards}var hasRequiredCurve;function requireCurve(){return hasRequiredCurve||(hasRequiredCurve=1,function(s){var a=s;a.base=requireBase$3(),a.short=requireShort(),a.mont=requireMont(),a.edwards=requireEdwards()}(curve)),curve}var curves={},hash$2={},utils$1={},hasRequiredUtils$1;function requireUtils$1(){if(hasRequiredUtils$1)return utils$1;hasRequiredUtils$1=1;var s=requireMinimalisticAssert(),a=requireInherits_browser();utils$1.inherits=a;function u(d,g){return(d.charCodeAt(g)&64512)!==55296||g<0||g+1>=d.length?!1:(d.charCodeAt(g+1)&64512)===56320}function l(d,g){if(Array.isArray(d))return d.slice();if(!d)return[];var _=[];if(typeof d=="string")if(g){if(g==="hex")for(d=d.replace(/[^a-z0-9]+/ig,""),d.length%2!==0&&(d="0"+d),x=0;x<d.length;x+=2)_.push(parseInt(d[x]+d[x+1],16))}else for(var w=0,x=0;x<d.length;x++){var P=d.charCodeAt(x);P<128?_[w++]=P:P<2048?(_[w++]=P>>6|192,_[w++]=P&63|128):u(d,x)?(P=65536+((P&1023)<<10)+(d.charCodeAt(++x)&1023),_[w++]=P>>18|240,_[w++]=P>>12&63|128,_[w++]=P>>6&63|128,_[w++]=P&63|128):(_[w++]=P>>12|224,_[w++]=P>>6&63|128,_[w++]=P&63|128)}else for(x=0;x<d.length;x++)_[x]=d[x]|0;return _}utils$1.toArray=l;function f(d){for(var g="",_=0;_<d.length;_++)g+=p(d[_].toString(16));return g}utils$1.toHex=f;function c(d){var g=d>>>24|d>>>8&65280|d<<8&16711680|(d&255)<<24;return g>>>0}utils$1.htonl=c;function h(d,g){for(var _="",w=0;w<d.length;w++){var x=d[w];g==="little"&&(x=c(x)),_+=v(x.toString(16))}return _}utils$1.toHex32=h;function p(d){return d.length===1?"0"+d:d}utils$1.zero2=p;function v(d){return d.length===7?"0"+d:d.length===6?"00"+d:d.length===5?"000"+d:d.length===4?"0000"+d:d.length===3?"00000"+d:d.length===2?"000000"+d:d.length===1?"0000000"+d:d}utils$1.zero8=v;function y(d,g,_,w){var x=_-g;s(x%4===0);for(var P=new Array(x/4),$=0,T=g;$<P.length;$++,T+=4){var m;w==="big"?m=d[T]<<24|d[T+1]<<16|d[T+2]<<8|d[T+3]:m=d[T+3]<<24|d[T+2]<<16|d[T+1]<<8|d[T],P[$]=m>>>0}return P}utils$1.join32=y;function b(d,g){for(var _=new Array(d.length*4),w=0,x=0;w<d.length;w++,x+=4){var P=d[w];g==="big"?(_[x]=P>>>24,_[x+1]=P>>>16&255,_[x+2]=P>>>8&255,_[x+3]=P&255):(_[x+3]=P>>>24,_[x+2]=P>>>16&255,_[x+1]=P>>>8&255,_[x]=P&255)}return _}utils$1.split32=b;function S(d,g){return d>>>g|d<<32-g}utils$1.rotr32=S;function E(d,g){return d<<g|d>>>32-g}utils$1.rotl32=E;function R(d,g){return d+g>>>0}utils$1.sum32=R;function O(d,g,_){return d+g+_>>>0}utils$1.sum32_3=O;function I(d,g,_,w){return d+g+_+w>>>0}utils$1.sum32_4=I;function B(d,g,_,w,x){return d+g+_+w+x>>>0}utils$1.sum32_5=B;function N(d,g,_,w){var x=d[g],P=d[g+1],$=w+P>>>0,T=($<w?1:0)+_+x;d[g]=T>>>0,d[g+1]=$}utils$1.sum64=N;function D(d,g,_,w){var x=g+w>>>0,P=(x<g?1:0)+d+_;return P>>>0}utils$1.sum64_hi=D;function G(d,g,_,w){var x=g+w;return x>>>0}utils$1.sum64_lo=G;function V(d,g,_,w,x,P,$,T){var m=0,M=g;M=M+w>>>0,m+=M<g?1:0,M=M+P>>>0,m+=M<P?1:0,M=M+T>>>0,m+=M<T?1:0;var W=d+_+x+$+m;return W>>>0}utils$1.sum64_4_hi=V;function U(d,g,_,w,x,P,$,T){var m=g+w+P+T;return m>>>0}utils$1.sum64_4_lo=U;function te(d,g,_,w,x,P,$,T,m,M){var W=0,Y=g;Y=Y+w>>>0,W+=Y<g?1:0,Y=Y+P>>>0,W+=Y<P?1:0,Y=Y+T>>>0,W+=Y<T?1:0,Y=Y+M>>>0,W+=Y<M?1:0;var ue=d+_+x+$+m+W;return ue>>>0}utils$1.sum64_5_hi=te;function Z(d,g,_,w,x,P,$,T,m,M){var W=g+w+P+T+M;return W>>>0}utils$1.sum64_5_lo=Z;function J(d,g,_){var w=g<<32-_|d>>>_;return w>>>0}utils$1.rotr64_hi=J;function Q(d,g,_){var w=d<<32-_|g>>>_;return w>>>0}utils$1.rotr64_lo=Q;function ee(d,g,_){return d>>>_}utils$1.shr64_hi=ee;function k(d,g,_){var w=d<<32-_|g>>>_;return w>>>0}return utils$1.shr64_lo=k,utils$1}var common$1={},hasRequiredCommon$1;function requireCommon$1(){if(hasRequiredCommon$1)return common$1;hasRequiredCommon$1=1;var s=requireUtils$1(),a=requireMinimalisticAssert();function u(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}return common$1.BlockHash=u,u.prototype.update=function(f,c){if(f=s.toArray(f,c),this.pending?this.pending=this.pending.concat(f):this.pending=f,this.pendingTotal+=f.length,this.pending.length>=this._delta8){f=this.pending;var h=f.length%this._delta8;this.pending=f.slice(f.length-h,f.length),this.pending.length===0&&(this.pending=null),f=s.join32(f,0,f.length-h,this.endian);for(var p=0;p<f.length;p+=this._delta32)this._update(f,p,p+this._delta32)}return this},u.prototype.digest=function(f){return this.update(this._pad()),a(this.pending===null),this._digest(f)},u.prototype._pad=function(){var f=this.pendingTotal,c=this._delta8,h=c-(f+this.padLength)%c,p=new Array(h+this.padLength);p[0]=128;for(var v=1;v<h;v++)p[v]=0;if(f<<=3,this.endian==="big"){for(var y=8;y<this.padLength;y++)p[v++]=0;p[v++]=0,p[v++]=0,p[v++]=0,p[v++]=0,p[v++]=f>>>24&255,p[v++]=f>>>16&255,p[v++]=f>>>8&255,p[v++]=f&255}else for(p[v++]=f&255,p[v++]=f>>>8&255,p[v++]=f>>>16&255,p[v++]=f>>>24&255,p[v++]=0,p[v++]=0,p[v++]=0,p[v++]=0,y=8;y<this.padLength;y++)p[v++]=0;return p},common$1}var sha={},common={},hasRequiredCommon;function requireCommon(){if(hasRequiredCommon)return common;hasRequiredCommon=1;var s=requireUtils$1(),a=s.rotr32;function u(b,S,E,R){if(b===0)return l(S,E,R);if(b===1||b===3)return c(S,E,R);if(b===2)return f(S,E,R)}common.ft_1=u;function l(b,S,E){return b&S^~b&E}common.ch32=l;function f(b,S,E){return b&S^b&E^S&E}common.maj32=f;function c(b,S,E){return b^S^E}common.p32=c;function h(b){return a(b,2)^a(b,13)^a(b,22)}common.s0_256=h;function p(b){return a(b,6)^a(b,11)^a(b,25)}common.s1_256=p;function v(b){return a(b,7)^a(b,18)^b>>>3}common.g0_256=v;function y(b){return a(b,17)^a(b,19)^b>>>10}return common.g1_256=y,common}var _1,hasRequired_1;function require_1(){if(hasRequired_1)return _1;hasRequired_1=1;var s=requireUtils$1(),a=requireCommon$1(),u=requireCommon(),l=s.rotl32,f=s.sum32,c=s.sum32_5,h=u.ft_1,p=a.BlockHash,v=[1518500249,1859775393,2400959708,3395469782];function y(){if(!(this instanceof y))return new y;p.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return s.inherits(y,p),_1=y,y.blockSize=512,y.outSize=160,y.hmacStrength=80,y.padLength=64,y.prototype._update=function(S,E){for(var R=this.W,O=0;O<16;O++)R[O]=S[E+O];for(;O<R.length;O++)R[O]=l(R[O-3]^R[O-8]^R[O-14]^R[O-16],1);var I=this.h[0],B=this.h[1],N=this.h[2],D=this.h[3],G=this.h[4];for(O=0;O<R.length;O++){var V=~~(O/20),U=c(l(I,5),h(V,B,N,D),G,R[O],v[V]);G=D,D=N,N=l(B,30),B=I,I=U}this.h[0]=f(this.h[0],I),this.h[1]=f(this.h[1],B),this.h[2]=f(this.h[2],N),this.h[3]=f(this.h[3],D),this.h[4]=f(this.h[4],G)},y.prototype._digest=function(S){return S==="hex"?s.toHex32(this.h,"big"):s.split32(this.h,"big")},_1}var _256,hasRequired_256;function require_256(){if(hasRequired_256)return _256;hasRequired_256=1;var s=requireUtils$1(),a=requireCommon$1(),u=requireCommon(),l=requireMinimalisticAssert(),f=s.sum32,c=s.sum32_4,h=s.sum32_5,p=u.ch32,v=u.maj32,y=u.s0_256,b=u.s1_256,S=u.g0_256,E=u.g1_256,R=a.BlockHash,O=[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];function I(){if(!(this instanceof I))return new I;R.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=O,this.W=new Array(64)}return s.inherits(I,R),_256=I,I.blockSize=512,I.outSize=256,I.hmacStrength=192,I.padLength=64,I.prototype._update=function(N,D){for(var G=this.W,V=0;V<16;V++)G[V]=N[D+V];for(;V<G.length;V++)G[V]=c(E(G[V-2]),G[V-7],S(G[V-15]),G[V-16]);var U=this.h[0],te=this.h[1],Z=this.h[2],J=this.h[3],Q=this.h[4],ee=this.h[5],k=this.h[6],d=this.h[7];for(l(this.k.length===G.length),V=0;V<G.length;V++){var g=h(d,b(Q),p(Q,ee,k),this.k[V],G[V]),_=f(y(U),v(U,te,Z));d=k,k=ee,ee=Q,Q=f(J,g),J=Z,Z=te,te=U,U=f(g,_)}this.h[0]=f(this.h[0],U),this.h[1]=f(this.h[1],te),this.h[2]=f(this.h[2],Z),this.h[3]=f(this.h[3],J),this.h[4]=f(this.h[4],Q),this.h[5]=f(this.h[5],ee),this.h[6]=f(this.h[6],k),this.h[7]=f(this.h[7],d)},I.prototype._digest=function(N){return N==="hex"?s.toHex32(this.h,"big"):s.split32(this.h,"big")},_256}var _224,hasRequired_224;function require_224(){if(hasRequired_224)return _224;hasRequired_224=1;var s=requireUtils$1(),a=require_256();function u(){if(!(this instanceof u))return new u;a.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}return s.inherits(u,a),_224=u,u.blockSize=512,u.outSize=224,u.hmacStrength=192,u.padLength=64,u.prototype._digest=function(f){return f==="hex"?s.toHex32(this.h.slice(0,7),"big"):s.split32(this.h.slice(0,7),"big")},_224}var _512,hasRequired_512;function require_512(){if(hasRequired_512)return _512;hasRequired_512=1;var s=requireUtils$1(),a=requireCommon$1(),u=requireMinimalisticAssert(),l=s.rotr64_hi,f=s.rotr64_lo,c=s.shr64_hi,h=s.shr64_lo,p=s.sum64,v=s.sum64_hi,y=s.sum64_lo,b=s.sum64_4_hi,S=s.sum64_4_lo,E=s.sum64_5_hi,R=s.sum64_5_lo,O=a.BlockHash,I=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function B(){if(!(this instanceof B))return new B;O.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=I,this.W=new Array(160)}s.inherits(B,O),_512=B,B.blockSize=1024,B.outSize=512,B.hmacStrength=192,B.padLength=128,B.prototype._prepareBlock=function(_,w){for(var x=this.W,P=0;P<32;P++)x[P]=_[w+P];for(;P<x.length;P+=2){var $=k(x[P-4],x[P-3]),T=d(x[P-4],x[P-3]),m=x[P-14],M=x[P-13],W=Q(x[P-30],x[P-29]),Y=ee(x[P-30],x[P-29]),ue=x[P-32],ge=x[P-31];x[P]=b($,T,m,M,W,Y,ue,ge),x[P+1]=S($,T,m,M,W,Y,ue,ge)}},B.prototype._update=function(_,w){this._prepareBlock(_,w);var x=this.W,P=this.h[0],$=this.h[1],T=this.h[2],m=this.h[3],M=this.h[4],W=this.h[5],Y=this.h[6],ue=this.h[7],ge=this.h[8],he=this.h[9],ae=this.h[10],de=this.h[11],pe=this.h[12],oe=this.h[13],le=this.h[14],me=this.h[15];u(this.k.length===x.length);for(var xe=0;xe<x.length;xe+=2){var Ne=le,Pe=me,Ie=Z(ge,he),Ke=J(ge,he),Le=N(ge,he,ae,de,pe),Ce=D(ge,he,ae,de,pe,oe),at=this.k[xe],Oe=this.k[xe+1],De=x[xe],yt=x[xe+1],Ue=E(Ne,Pe,Ie,Ke,Le,Ce,at,Oe,De,yt),ze=R(Ne,Pe,Ie,Ke,Le,Ce,at,Oe,De,yt);Ne=U(P,$),Pe=te(P,$),Ie=G(P,$,T,m,M),Ke=V(P,$,T,m,M,W);var Mt=v(Ne,Pe,Ie,Ke),se=y(Ne,Pe,Ie,Ke);le=pe,me=oe,pe=ae,oe=de,ae=ge,de=he,ge=v(Y,ue,Ue,ze),he=y(ue,ue,Ue,ze),Y=M,ue=W,M=T,W=m,T=P,m=$,P=v(Ue,ze,Mt,se),$=y(Ue,ze,Mt,se)}p(this.h,0,P,$),p(this.h,2,T,m),p(this.h,4,M,W),p(this.h,6,Y,ue),p(this.h,8,ge,he),p(this.h,10,ae,de),p(this.h,12,pe,oe),p(this.h,14,le,me)},B.prototype._digest=function(_){return _==="hex"?s.toHex32(this.h,"big"):s.split32(this.h,"big")};function N(g,_,w,x,P){var $=g&w^~g&P;return $<0&&($+=4294967296),$}function D(g,_,w,x,P,$){var T=_&x^~_&$;return T<0&&(T+=4294967296),T}function G(g,_,w,x,P){var $=g&w^g&P^w&P;return $<0&&($+=4294967296),$}function V(g,_,w,x,P,$){var T=_&x^_&$^x&$;return T<0&&(T+=4294967296),T}function U(g,_){var w=l(g,_,28),x=l(_,g,2),P=l(_,g,7),$=w^x^P;return $<0&&($+=4294967296),$}function te(g,_){var w=f(g,_,28),x=f(_,g,2),P=f(_,g,7),$=w^x^P;return $<0&&($+=4294967296),$}function Z(g,_){var w=l(g,_,14),x=l(g,_,18),P=l(_,g,9),$=w^x^P;return $<0&&($+=4294967296),$}function J(g,_){var w=f(g,_,14),x=f(g,_,18),P=f(_,g,9),$=w^x^P;return $<0&&($+=4294967296),$}function Q(g,_){var w=l(g,_,1),x=l(g,_,8),P=c(g,_,7),$=w^x^P;return $<0&&($+=4294967296),$}function ee(g,_){var w=f(g,_,1),x=f(g,_,8),P=h(g,_,7),$=w^x^P;return $<0&&($+=4294967296),$}function k(g,_){var w=l(g,_,19),x=l(_,g,29),P=c(g,_,6),$=w^x^P;return $<0&&($+=4294967296),$}function d(g,_){var w=f(g,_,19),x=f(_,g,29),P=h(g,_,6),$=w^x^P;return $<0&&($+=4294967296),$}return _512}var _384,hasRequired_384;function require_384(){if(hasRequired_384)return _384;hasRequired_384=1;var s=requireUtils$1(),a=require_512();function u(){if(!(this instanceof u))return new u;a.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}return s.inherits(u,a),_384=u,u.blockSize=1024,u.outSize=384,u.hmacStrength=192,u.padLength=128,u.prototype._digest=function(f){return f==="hex"?s.toHex32(this.h.slice(0,12),"big"):s.split32(this.h.slice(0,12),"big")},_384}var hasRequiredSha;function requireSha(){return hasRequiredSha||(hasRequiredSha=1,sha.sha1=require_1(),sha.sha224=require_224(),sha.sha256=require_256(),sha.sha384=require_384(),sha.sha512=require_512()),sha}var ripemd={},hasRequiredRipemd;function requireRipemd(){if(hasRequiredRipemd)return ripemd;hasRequiredRipemd=1;var s=requireUtils$1(),a=requireCommon$1(),u=s.rotl32,l=s.sum32,f=s.sum32_3,c=s.sum32_4,h=a.BlockHash;function p(){if(!(this instanceof p))return new p;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}s.inherits(p,h),ripemd.ripemd160=p,p.blockSize=512,p.outSize=160,p.hmacStrength=192,p.padLength=64,p.prototype._update=function(B,N){for(var D=this.h[0],G=this.h[1],V=this.h[2],U=this.h[3],te=this.h[4],Z=D,J=G,Q=V,ee=U,k=te,d=0;d<80;d++){var g=l(u(c(D,v(d,G,V,U),B[S[d]+N],y(d)),R[d]),te);D=te,te=U,U=u(V,10),V=G,G=g,g=l(u(c(Z,v(79-d,J,Q,ee),B[E[d]+N],b(d)),O[d]),k),Z=k,k=ee,ee=u(Q,10),Q=J,J=g}g=f(this.h[1],V,ee),this.h[1]=f(this.h[2],U,k),this.h[2]=f(this.h[3],te,Z),this.h[3]=f(this.h[4],D,J),this.h[4]=f(this.h[0],G,Q),this.h[0]=g},p.prototype._digest=function(B){return B==="hex"?s.toHex32(this.h,"little"):s.split32(this.h,"little")};function v(I,B,N,D){return I<=15?B^N^D:I<=31?B&N|~B&D:I<=47?(B|~N)^D:I<=63?B&D|N&~D:B^(N|~D)}function y(I){return I<=15?0:I<=31?1518500249:I<=47?1859775393:I<=63?2400959708:2840853838}function b(I){return I<=15?1352829926:I<=31?1548603684:I<=47?1836072691:I<=63?2053994217:0}var S=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],E=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],R=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],O=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];return ripemd}var hmac$2,hasRequiredHmac$2;function requireHmac$2(){if(hasRequiredHmac$2)return hmac$2;hasRequiredHmac$2=1;var s=requireUtils$1(),a=requireMinimalisticAssert();function u(l,f,c){if(!(this instanceof u))return new u(l,f,c);this.Hash=l,this.blockSize=l.blockSize/8,this.outSize=l.outSize/8,this.inner=null,this.outer=null,this._init(s.toArray(f,c))}return hmac$2=u,u.prototype._init=function(f){f.length>this.blockSize&&(f=new this.Hash().update(f).digest()),a(f.length<=this.blockSize);for(var c=f.length;c<this.blockSize;c++)f.push(0);for(c=0;c<f.length;c++)f[c]^=54;for(this.inner=new this.Hash().update(f),c=0;c<f.length;c++)f[c]^=106;this.outer=new this.Hash().update(f)},u.prototype.update=function(f,c){return this.inner.update(f,c),this},u.prototype.digest=function(f){return this.outer.update(this.inner.digest()),this.outer.digest(f)},hmac$2}var hasRequiredHash$1;function requireHash$1(){return hasRequiredHash$1||(hasRequiredHash$1=1,function(s){var a=s;a.utils=requireUtils$1(),a.common=requireCommon$1(),a.sha=requireSha(),a.ripemd=requireRipemd(),a.hmac=requireHmac$2(),a.sha1=a.sha.sha1,a.sha256=a.sha.sha256,a.sha224=a.sha.sha224,a.sha384=a.sha.sha384,a.sha512=a.sha.sha512,a.ripemd160=a.ripemd.ripemd160}(hash$2)),hash$2}var secp256k1,hasRequiredSecp256k1;function requireSecp256k1(){return hasRequiredSecp256k1||(hasRequiredSecp256k1=1,secp256k1={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}),secp256k1}var hasRequiredCurves;function requireCurves(){return hasRequiredCurves||(hasRequiredCurves=1,function(s){var a=s,u=requireHash$1(),l=requireCurve(),f=requireUtils$2(),c=f.assert;function h(y){y.type==="short"?this.curve=new l.short(y):y.type==="edwards"?this.curve=new l.edwards(y):this.curve=new l.mont(y),this.g=this.curve.g,this.n=this.curve.n,this.hash=y.hash,c(this.g.validate(),"Invalid curve"),c(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}a.PresetCurve=h;function p(y,b){Object.defineProperty(a,y,{configurable:!0,enumerable:!0,get:function(){var S=new h(b);return Object.defineProperty(a,y,{configurable:!0,enumerable:!0,value:S}),S}})}p("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:u.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),p("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:u.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),p("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:u.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),p("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:u.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),p("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:u.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),p("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:u.sha256,gRed:!1,g:["9"]}),p("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:u.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var v;try{v=requireSecp256k1()}catch{v=void 0}p("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:u.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",v]})}(curves)),curves}var hmacDrbg,hasRequiredHmacDrbg;function requireHmacDrbg(){if(hasRequiredHmacDrbg)return hmacDrbg;hasRequiredHmacDrbg=1;var s=requireHash$1(),a=requireUtils$3(),u=requireMinimalisticAssert();function l(f){if(!(this instanceof l))return new l(f);this.hash=f.hash,this.predResist=!!f.predResist,this.outLen=this.hash.outSize,this.minEntropy=f.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var c=a.toArray(f.entropy,f.entropyEnc||"hex"),h=a.toArray(f.nonce,f.nonceEnc||"hex"),p=a.toArray(f.pers,f.persEnc||"hex");u(c.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(c,h,p)}return hmacDrbg=l,l.prototype._init=function(c,h,p){var v=c.concat(h).concat(p);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var y=0;y<this.V.length;y++)this.K[y]=0,this.V[y]=1;this._update(v),this._reseed=1,this.reseedInterval=281474976710656},l.prototype._hmac=function(){return new s.hmac(this.hash,this.K)},l.prototype._update=function(c){var h=this._hmac().update(this.V).update([0]);c&&(h=h.update(c)),this.K=h.digest(),this.V=this._hmac().update(this.V).digest(),c&&(this.K=this._hmac().update(this.V).update([1]).update(c).digest(),this.V=this._hmac().update(this.V).digest())},l.prototype.reseed=function(c,h,p,v){typeof h!="string"&&(v=p,p=h,h=null),c=a.toArray(c,h),p=a.toArray(p,v),u(c.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(c.concat(p||[])),this._reseed=1},l.prototype.generate=function(c,h,p,v){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof h!="string"&&(v=p,p=h,h=null),p&&(p=a.toArray(p,v||"hex"),this._update(p));for(var y=[];y.length<c;)this.V=this._hmac().update(this.V).digest(),y=y.concat(this.V);var b=y.slice(0,c);return this._update(p),this._reseed++,a.encode(b,h)},hmacDrbg}var key$1,hasRequiredKey$1;function requireKey$1(){if(hasRequiredKey$1)return key$1;hasRequiredKey$1=1;var s=requireBn$3(),a=requireUtils$2(),u=a.assert;function l(f,c){this.ec=f,this.priv=null,this.pub=null,c.priv&&this._importPrivate(c.priv,c.privEnc),c.pub&&this._importPublic(c.pub,c.pubEnc)}return key$1=l,l.fromPublic=function(c,h,p){return h instanceof l?h:new l(c,{pub:h,pubEnc:p})},l.fromPrivate=function(c,h,p){return h instanceof l?h:new l(c,{priv:h,privEnc:p})},l.prototype.validate=function(){var c=this.getPublic();return c.isInfinity()?{result:!1,reason:"Invalid public key"}:c.validate()?c.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},l.prototype.getPublic=function(c,h){return typeof c=="string"&&(h=c,c=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),h?this.pub.encode(h,c):this.pub},l.prototype.getPrivate=function(c){return c==="hex"?this.priv.toString(16,2):this.priv},l.prototype._importPrivate=function(c,h){this.priv=new s(c,h||16),this.priv=this.priv.umod(this.ec.curve.n)},l.prototype._importPublic=function(c,h){if(c.x||c.y){this.ec.curve.type==="mont"?u(c.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&u(c.x&&c.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(c.x,c.y);return}this.pub=this.ec.curve.decodePoint(c,h)},l.prototype.derive=function(c){return c.validate()||u(c.validate(),"public point not validated"),c.mul(this.priv).getX()},l.prototype.sign=function(c,h,p){return this.ec.sign(c,this,h,p)},l.prototype.verify=function(c,h,p){return this.ec.verify(c,h,this,void 0,p)},l.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},key$1}var signature$1,hasRequiredSignature$1;function requireSignature$1(){if(hasRequiredSignature$1)return signature$1;hasRequiredSignature$1=1;var s=requireBn$3(),a=requireUtils$2(),u=a.assert;function l(v,y){if(v instanceof l)return v;this._importDER(v,y)||(u(v.r&&v.s,"Signature without r or s"),this.r=new s(v.r,16),this.s=new s(v.s,16),v.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=v.recoveryParam)}signature$1=l;function f(){this.place=0}function c(v,y){var b=v[y.place++];if(!(b&128))return b;var S=b&15;if(S===0||S>4||v[y.place]===0)return!1;for(var E=0,R=0,O=y.place;R<S;R++,O++)E<<=8,E|=v[O],E>>>=0;return E<=127?!1:(y.place=O,E)}function h(v){for(var y=0,b=v.length-1;!v[y]&&!(v[y+1]&128)&&y<b;)y++;return y===0?v:v.slice(y)}l.prototype._importDER=function(y,b){y=a.toArray(y,b);var S=new f;if(y[S.place++]!==48)return!1;var E=c(y,S);if(E===!1||E+S.place!==y.length||y[S.place++]!==2)return!1;var R=c(y,S);if(R===!1||y[S.place]&128)return!1;var O=y.slice(S.place,R+S.place);if(S.place+=R,y[S.place++]!==2)return!1;var I=c(y,S);if(I===!1||y.length!==I+S.place||y[S.place]&128)return!1;var B=y.slice(S.place,I+S.place);if(O[0]===0)if(O[1]&128)O=O.slice(1);else return!1;if(B[0]===0)if(B[1]&128)B=B.slice(1);else return!1;return this.r=new s(O),this.s=new s(B),this.recoveryParam=null,!0};function p(v,y){if(y<128){v.push(y);return}var b=1+(Math.log(y)/Math.LN2>>>3);for(v.push(b|128);--b;)v.push(y>>>(b<<3)&255);v.push(y)}return l.prototype.toDER=function(y){var b=this.r.toArray(),S=this.s.toArray();for(b[0]&128&&(b=[0].concat(b)),S[0]&128&&(S=[0].concat(S)),b=h(b),S=h(S);!S[0]&&!(S[1]&128);)S=S.slice(1);var E=[2];p(E,b.length),E=E.concat(b),E.push(2),p(E,S.length);var R=E.concat(S),O=[48];return p(O,R.length),O=O.concat(R),a.encode(O,y)},signature$1}var ec$3,hasRequiredEc;function requireEc(){if(hasRequiredEc)return ec$3;hasRequiredEc=1;var s=requireBn$3(),a=requireHmacDrbg(),u=requireUtils$2(),l=requireCurves(),f=requireBrorand(),c=u.assert,h=requireKey$1(),p=requireSignature$1();function v(y){if(!(this instanceof v))return new v(y);typeof y=="string"&&(c(Object.prototype.hasOwnProperty.call(l,y),"Unknown curve "+y),y=l[y]),y instanceof l.PresetCurve&&(y={curve:y}),this.curve=y.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=y.curve.g,this.g.precompute(y.curve.n.bitLength()+1),this.hash=y.hash||y.curve.hash}return ec$3=v,v.prototype.keyPair=function(b){return new h(this,b)},v.prototype.keyFromPrivate=function(b,S){return h.fromPrivate(this,b,S)},v.prototype.keyFromPublic=function(b,S){return h.fromPublic(this,b,S)},v.prototype.genKeyPair=function(b){b||(b={});for(var S=new a({hash:this.hash,pers:b.pers,persEnc:b.persEnc||"utf8",entropy:b.entropy||f(this.hash.hmacStrength),entropyEnc:b.entropy&&b.entropyEnc||"utf8",nonce:this.n.toArray()}),E=this.n.byteLength(),R=this.n.sub(new s(2));;){var O=new s(S.generate(E));if(!(O.cmp(R)>0))return O.iaddn(1),this.keyFromPrivate(O)}},v.prototype._truncateToN=function(b,S,E){var R;if(s.isBN(b)||typeof b=="number")b=new s(b,16),R=b.byteLength();else if(typeof b=="object")R=b.length,b=new s(b,16);else{var O=b.toString();R=O.length+1>>>1,b=new s(O,16)}typeof E!="number"&&(E=R*8);var I=E-this.n.bitLength();return I>0&&(b=b.ushrn(I)),!S&&b.cmp(this.n)>=0?b.sub(this.n):b},v.prototype.sign=function(b,S,E,R){if(typeof E=="object"&&(R=E,E=null),R||(R={}),typeof b!="string"&&typeof b!="number"&&!s.isBN(b)){c(typeof b=="object"&&b&&typeof b.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),c(b.length>>>0===b.length);for(var O=0;O<b.length;O++)c((b[O]&255)===b[O])}S=this.keyFromPrivate(S,E),b=this._truncateToN(b,!1,R.msgBitLength),c(!b.isNeg(),"Can not sign a negative message");var I=this.n.byteLength(),B=S.getPrivate().toArray("be",I),N=b.toArray("be",I);c(new s(N).eq(b),"Can not sign message");for(var D=new a({hash:this.hash,entropy:B,nonce:N,pers:R.pers,persEnc:R.persEnc||"utf8"}),G=this.n.sub(new s(1)),V=0;;V++){var U=R.k?R.k(V):new s(D.generate(this.n.byteLength()));if(U=this._truncateToN(U,!0),!(U.cmpn(1)<=0||U.cmp(G)>=0)){var te=this.g.mul(U);if(!te.isInfinity()){var Z=te.getX(),J=Z.umod(this.n);if(J.cmpn(0)!==0){var Q=U.invm(this.n).mul(J.mul(S.getPrivate()).iadd(b));if(Q=Q.umod(this.n),Q.cmpn(0)!==0){var ee=(te.getY().isOdd()?1:0)|(Z.cmp(J)!==0?2:0);return R.canonical&&Q.cmp(this.nh)>0&&(Q=this.n.sub(Q),ee^=1),new p({r:J,s:Q,recoveryParam:ee})}}}}}},v.prototype.verify=function(b,S,E,R,O){O||(O={}),b=this._truncateToN(b,!1,O.msgBitLength),E=this.keyFromPublic(E,R),S=new p(S,"hex");var I=S.r,B=S.s;if(I.cmpn(1)<0||I.cmp(this.n)>=0||B.cmpn(1)<0||B.cmp(this.n)>=0)return!1;var N=B.invm(this.n),D=N.mul(b).umod(this.n),G=N.mul(I).umod(this.n),V;return this.curve._maxwellTrick?(V=this.g.jmulAdd(D,E.getPublic(),G),V.isInfinity()?!1:V.eqXToP(I)):(V=this.g.mulAdd(D,E.getPublic(),G),V.isInfinity()?!1:V.getX().umod(this.n).cmp(I)===0)},v.prototype.recoverPubKey=function(y,b,S,E){c((3&S)===S,"The recovery param is more than two bits"),b=new p(b,E);var R=this.n,O=new s(y),I=b.r,B=b.s,N=S&1,D=S>>1;if(I.cmp(this.curve.p.umod(this.curve.n))>=0&&D)throw new Error("Unable to find sencond key candinate");D?I=this.curve.pointFromX(I.add(this.curve.n),N):I=this.curve.pointFromX(I,N);var G=b.r.invm(R),V=R.sub(O).mul(G).umod(R),U=B.mul(G).umod(R);return this.g.mulAdd(V,I,U)},v.prototype.getKeyRecoveryParam=function(y,b,S,E){if(b=new p(b,E),b.recoveryParam!==null)return b.recoveryParam;for(var R=0;R<4;R++){var O;try{O=this.recoverPubKey(y,b,R)}catch{continue}if(O.eq(S))return R}throw new Error("Unable to find valid recovery factor")},ec$3}var key,hasRequiredKey;function requireKey(){if(hasRequiredKey)return key;hasRequiredKey=1;var s=requireUtils$2(),a=s.assert,u=s.parseBytes,l=s.cachedProperty;function f(c,h){this.eddsa=c,this._secret=u(h.secret),c.isPoint(h.pub)?this._pub=h.pub:this._pubBytes=u(h.pub)}return f.fromPublic=function(h,p){return p instanceof f?p:new f(h,{pub:p})},f.fromSecret=function(h,p){return p instanceof f?p:new f(h,{secret:p})},f.prototype.secret=function(){return this._secret},l(f,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),l(f,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),l(f,"privBytes",function(){var h=this.eddsa,p=this.hash(),v=h.encodingLength-1,y=p.slice(0,h.encodingLength);return y[0]&=248,y[v]&=127,y[v]|=64,y}),l(f,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),l(f,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),l(f,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),f.prototype.sign=function(h){return a(this._secret,"KeyPair can only verify"),this.eddsa.sign(h,this)},f.prototype.verify=function(h,p){return this.eddsa.verify(h,p,this)},f.prototype.getSecret=function(h){return a(this._secret,"KeyPair is public only"),s.encode(this.secret(),h)},f.prototype.getPublic=function(h){return s.encode(this.pubBytes(),h)},key=f,key}var signature,hasRequiredSignature;function requireSignature(){if(hasRequiredSignature)return signature;hasRequiredSignature=1;var s=requireBn$3(),a=requireUtils$2(),u=a.assert,l=a.cachedProperty,f=a.parseBytes;function c(h,p){this.eddsa=h,typeof p!="object"&&(p=f(p)),Array.isArray(p)&&(u(p.length===h.encodingLength*2,"Signature has invalid size"),p={R:p.slice(0,h.encodingLength),S:p.slice(h.encodingLength)}),u(p.R&&p.S,"Signature without R or S"),h.isPoint(p.R)&&(this._R=p.R),p.S instanceof s&&(this._S=p.S),this._Rencoded=Array.isArray(p.R)?p.R:p.Rencoded,this._Sencoded=Array.isArray(p.S)?p.S:p.Sencoded}return l(c,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),l(c,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),l(c,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),l(c,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),c.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},c.prototype.toHex=function(){return a.encode(this.toBytes(),"hex").toUpperCase()},signature=c,signature}var eddsa,hasRequiredEddsa;function requireEddsa(){if(hasRequiredEddsa)return eddsa;hasRequiredEddsa=1;var s=requireHash$1(),a=requireCurves(),u=requireUtils$2(),l=u.assert,f=u.parseBytes,c=requireKey(),h=requireSignature();function p(v){if(l(v==="ed25519","only tested with ed25519 so far"),!(this instanceof p))return new p(v);v=a[v].curve,this.curve=v,this.g=v.g,this.g.precompute(v.n.bitLength()+1),this.pointClass=v.point().constructor,this.encodingLength=Math.ceil(v.n.bitLength()/8),this.hash=s.sha512}return eddsa=p,p.prototype.sign=function(y,b){y=f(y);var S=this.keyFromSecret(b),E=this.hashInt(S.messagePrefix(),y),R=this.g.mul(E),O=this.encodePoint(R),I=this.hashInt(O,S.pubBytes(),y).mul(S.priv()),B=E.add(I).umod(this.curve.n);return this.makeSignature({R,S:B,Rencoded:O})},p.prototype.verify=function(y,b,S){if(y=f(y),b=this.makeSignature(b),b.S().gte(b.eddsa.curve.n)||b.S().isNeg())return!1;var E=this.keyFromPublic(S),R=this.hashInt(b.Rencoded(),E.pubBytes(),y),O=this.g.mul(b.S()),I=b.R().add(E.pub().mul(R));return I.eq(O)},p.prototype.hashInt=function(){for(var y=this.hash(),b=0;b<arguments.length;b++)y.update(arguments[b]);return u.intFromLE(y.digest()).umod(this.curve.n)},p.prototype.keyFromPublic=function(y){return c.fromPublic(this,y)},p.prototype.keyFromSecret=function(y){return c.fromSecret(this,y)},p.prototype.makeSignature=function(y){return y instanceof h?y:new h(this,y)},p.prototype.encodePoint=function(y){var b=y.getY().toArray("le",this.encodingLength);return b[this.encodingLength-1]|=y.getX().isOdd()?128:0,b},p.prototype.decodePoint=function(y){y=u.parseBytes(y);var b=y.length-1,S=y.slice(0,b).concat(y[b]&-129),E=(y[b]&128)!==0,R=u.intFromLE(S);return this.curve.pointFromY(R,E)},p.prototype.encodeInt=function(y){return y.toArray("le",this.encodingLength)},p.prototype.decodeInt=function(y){return u.intFromLE(y)},p.prototype.isPoint=function(y){return y instanceof this.pointClass},eddsa}var hasRequiredElliptic;function requireElliptic(){return hasRequiredElliptic||(hasRequiredElliptic=1,function(s){var a=s;a.version=require$$0$2.version,a.utils=requireUtils$2(),a.rand=requireBrorand(),a.curve=requireCurve(),a.curves=requireCurves(),a.ec=requireEc(),a.eddsa=requireEddsa()}(elliptic$1)),elliptic$1}var asn1$1={},asn1={},bn$5={exports:{}},bn$4=bn$5.exports,hasRequiredBn$2;function requireBn$2(){return hasRequiredBn$2||(hasRequiredBn$2=1,function(s){(function(a,u){function l(k,d){if(!k)throw new Error(d||"Assertion failed")}function f(k,d){k.super_=d;var g=function(){};g.prototype=d.prototype,k.prototype=new g,k.prototype.constructor=k}function c(k,d,g){if(c.isBN(k))return k;this.negative=0,this.words=null,this.length=0,this.red=null,k!==null&&((d==="le"||d==="be")&&(g=d,d=10),this._init(k||0,d||10,g||"be"))}typeof a=="object"?a.exports=c:u.BN=c,c.BN=c,c.wordSize=26;var h;try{typeof window<"u"&&typeof window.Buffer<"u"?h=window.Buffer:h=require$$2$1.Buffer}catch{}c.isBN=function(d){return d instanceof c?!0:d!==null&&typeof d=="object"&&d.constructor.wordSize===c.wordSize&&Array.isArray(d.words)},c.max=function(d,g){return d.cmp(g)>0?d:g},c.min=function(d,g){return d.cmp(g)<0?d:g},c.prototype._init=function(d,g,_){if(typeof d=="number")return this._initNumber(d,g,_);if(typeof d=="object")return this._initArray(d,g,_);g==="hex"&&(g=16),l(g===(g|0)&&g>=2&&g<=36),d=d.toString().replace(/\s+/g,"");var w=0;d[0]==="-"&&(w++,this.negative=1),w<d.length&&(g===16?this._parseHex(d,w,_):(this._parseBase(d,g,w),_==="le"&&this._initArray(this.toArray(),g,_)))},c.prototype._initNumber=function(d,g,_){d<0&&(this.negative=1,d=-d),d<67108864?(this.words=[d&67108863],this.length=1):d<4503599627370496?(this.words=[d&67108863,d/67108864&67108863],this.length=2):(l(d<9007199254740992),this.words=[d&67108863,d/67108864&67108863,1],this.length=3),_==="le"&&this._initArray(this.toArray(),g,_)},c.prototype._initArray=function(d,g,_){if(l(typeof d.length=="number"),d.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(d.length/3),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var x,P,$=0;if(_==="be")for(w=d.length-1,x=0;w>=0;w-=3)P=d[w]|d[w-1]<<8|d[w-2]<<16,this.words[x]|=P<<$&67108863,this.words[x+1]=P>>>26-$&67108863,$+=24,$>=26&&($-=26,x++);else if(_==="le")for(w=0,x=0;w<d.length;w+=3)P=d[w]|d[w+1]<<8|d[w+2]<<16,this.words[x]|=P<<$&67108863,this.words[x+1]=P>>>26-$&67108863,$+=24,$>=26&&($-=26,x++);return this.strip()};function p(k,d){var g=k.charCodeAt(d);return g>=65&&g<=70?g-55:g>=97&&g<=102?g-87:g-48&15}function v(k,d,g){var _=p(k,g);return g-1>=d&&(_|=p(k,g-1)<<4),_}c.prototype._parseHex=function(d,g,_){this.length=Math.ceil((d.length-g)/6),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var x=0,P=0,$;if(_==="be")for(w=d.length-1;w>=g;w-=2)$=v(d,g,w)<<x,this.words[P]|=$&67108863,x>=18?(x-=18,P+=1,this.words[P]|=$>>>26):x+=8;else{var T=d.length-g;for(w=T%2===0?g+1:g;w<d.length;w+=2)$=v(d,g,w)<<x,this.words[P]|=$&67108863,x>=18?(x-=18,P+=1,this.words[P]|=$>>>26):x+=8}this.strip()};function y(k,d,g,_){for(var w=0,x=Math.min(k.length,g),P=d;P<x;P++){var $=k.charCodeAt(P)-48;w*=_,$>=49?w+=$-49+10:$>=17?w+=$-17+10:w+=$}return w}c.prototype._parseBase=function(d,g,_){this.words=[0],this.length=1;for(var w=0,x=1;x<=67108863;x*=g)w++;w--,x=x/g|0;for(var P=d.length-_,$=P%w,T=Math.min(P,P-$)+_,m=0,M=_;M<T;M+=w)m=y(d,M,M+w,g),this.imuln(x),this.words[0]+m<67108864?this.words[0]+=m:this._iaddn(m);if($!==0){var W=1;for(m=y(d,M,d.length,g),M=0;M<$;M++)W*=g;this.imuln(W),this.words[0]+m<67108864?this.words[0]+=m:this._iaddn(m)}this.strip()},c.prototype.copy=function(d){d.words=new Array(this.length);for(var g=0;g<this.length;g++)d.words[g]=this.words[g];d.length=this.length,d.negative=this.negative,d.red=this.red},c.prototype.clone=function(){var d=new c(null);return this.copy(d),d},c.prototype._expand=function(d){for(;this.length<d;)this.words[this.length++]=0;return this},c.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},c.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},c.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var b=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],S=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],E=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];c.prototype.toString=function(d,g){d=d||10,g=g|0||1;var _;if(d===16||d==="hex"){_="";for(var w=0,x=0,P=0;P<this.length;P++){var $=this.words[P],T=(($<<w|x)&16777215).toString(16);x=$>>>24-w&16777215,x!==0||P!==this.length-1?_=b[6-T.length]+T+_:_=T+_,w+=2,w>=26&&(w-=26,P--)}for(x!==0&&(_=x.toString(16)+_);_.length%g!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}if(d===(d|0)&&d>=2&&d<=36){var m=S[d],M=E[d];_="";var W=this.clone();for(W.negative=0;!W.isZero();){var Y=W.modn(M).toString(d);W=W.idivn(M),W.isZero()?_=Y+_:_=b[m-Y.length]+Y+_}for(this.isZero()&&(_="0"+_);_.length%g!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}l(!1,"Base should be between 2 and 36")},c.prototype.toNumber=function(){var d=this.words[0];return this.length===2?d+=this.words[1]*67108864:this.length===3&&this.words[2]===1?d+=4503599627370496+this.words[1]*67108864:this.length>2&&l(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-d:d},c.prototype.toJSON=function(){return this.toString(16)},c.prototype.toBuffer=function(d,g){return l(typeof h<"u"),this.toArrayLike(h,d,g)},c.prototype.toArray=function(d,g){return this.toArrayLike(Array,d,g)},c.prototype.toArrayLike=function(d,g,_){var w=this.byteLength(),x=_||Math.max(1,w);l(w<=x,"byte array longer than desired length"),l(x>0,"Requested array length <= 0"),this.strip();var P=g==="le",$=new d(x),T,m,M=this.clone();if(P){for(m=0;!M.isZero();m++)T=M.andln(255),M.iushrn(8),$[m]=T;for(;m<x;m++)$[m]=0}else{for(m=0;m<x-w;m++)$[m]=0;for(m=0;!M.isZero();m++)T=M.andln(255),M.iushrn(8),$[x-m-1]=T}return $},Math.clz32?c.prototype._countBits=function(d){return 32-Math.clz32(d)}:c.prototype._countBits=function(d){var g=d,_=0;return g>=4096&&(_+=13,g>>>=13),g>=64&&(_+=7,g>>>=7),g>=8&&(_+=4,g>>>=4),g>=2&&(_+=2,g>>>=2),_+g},c.prototype._zeroBits=function(d){if(d===0)return 26;var g=d,_=0;return g&8191||(_+=13,g>>>=13),g&127||(_+=7,g>>>=7),g&15||(_+=4,g>>>=4),g&3||(_+=2,g>>>=2),g&1||_++,_},c.prototype.bitLength=function(){var d=this.words[this.length-1],g=this._countBits(d);return(this.length-1)*26+g};function R(k){for(var d=new Array(k.bitLength()),g=0;g<d.length;g++){var _=g/26|0,w=g%26;d[g]=(k.words[_]&1<<w)>>>w}return d}c.prototype.zeroBits=function(){if(this.isZero())return 0;for(var d=0,g=0;g<this.length;g++){var _=this._zeroBits(this.words[g]);if(d+=_,_!==26)break}return d},c.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},c.prototype.toTwos=function(d){return this.negative!==0?this.abs().inotn(d).iaddn(1):this.clone()},c.prototype.fromTwos=function(d){return this.testn(d-1)?this.notn(d).iaddn(1).ineg():this.clone()},c.prototype.isNeg=function(){return this.negative!==0},c.prototype.neg=function(){return this.clone().ineg()},c.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},c.prototype.iuor=function(d){for(;this.length<d.length;)this.words[this.length++]=0;for(var g=0;g<d.length;g++)this.words[g]=this.words[g]|d.words[g];return this.strip()},c.prototype.ior=function(d){return l((this.negative|d.negative)===0),this.iuor(d)},c.prototype.or=function(d){return this.length>d.length?this.clone().ior(d):d.clone().ior(this)},c.prototype.uor=function(d){return this.length>d.length?this.clone().iuor(d):d.clone().iuor(this)},c.prototype.iuand=function(d){var g;this.length>d.length?g=d:g=this;for(var _=0;_<g.length;_++)this.words[_]=this.words[_]&d.words[_];return this.length=g.length,this.strip()},c.prototype.iand=function(d){return l((this.negative|d.negative)===0),this.iuand(d)},c.prototype.and=function(d){return this.length>d.length?this.clone().iand(d):d.clone().iand(this)},c.prototype.uand=function(d){return this.length>d.length?this.clone().iuand(d):d.clone().iuand(this)},c.prototype.iuxor=function(d){var g,_;this.length>d.length?(g=this,_=d):(g=d,_=this);for(var w=0;w<_.length;w++)this.words[w]=g.words[w]^_.words[w];if(this!==g)for(;w<g.length;w++)this.words[w]=g.words[w];return this.length=g.length,this.strip()},c.prototype.ixor=function(d){return l((this.negative|d.negative)===0),this.iuxor(d)},c.prototype.xor=function(d){return this.length>d.length?this.clone().ixor(d):d.clone().ixor(this)},c.prototype.uxor=function(d){return this.length>d.length?this.clone().iuxor(d):d.clone().iuxor(this)},c.prototype.inotn=function(d){l(typeof d=="number"&&d>=0);var g=Math.ceil(d/26)|0,_=d%26;this._expand(g),_>0&&g--;for(var w=0;w<g;w++)this.words[w]=~this.words[w]&67108863;return _>0&&(this.words[w]=~this.words[w]&67108863>>26-_),this.strip()},c.prototype.notn=function(d){return this.clone().inotn(d)},c.prototype.setn=function(d,g){l(typeof d=="number"&&d>=0);var _=d/26|0,w=d%26;return this._expand(_+1),g?this.words[_]=this.words[_]|1<<w:this.words[_]=this.words[_]&~(1<<w),this.strip()},c.prototype.iadd=function(d){var g;if(this.negative!==0&&d.negative===0)return this.negative=0,g=this.isub(d),this.negative^=1,this._normSign();if(this.negative===0&&d.negative!==0)return d.negative=0,g=this.isub(d),d.negative=1,g._normSign();var _,w;this.length>d.length?(_=this,w=d):(_=d,w=this);for(var x=0,P=0;P<w.length;P++)g=(_.words[P]|0)+(w.words[P]|0)+x,this.words[P]=g&67108863,x=g>>>26;for(;x!==0&&P<_.length;P++)g=(_.words[P]|0)+x,this.words[P]=g&67108863,x=g>>>26;if(this.length=_.length,x!==0)this.words[this.length]=x,this.length++;else if(_!==this)for(;P<_.length;P++)this.words[P]=_.words[P];return this},c.prototype.add=function(d){var g;return d.negative!==0&&this.negative===0?(d.negative=0,g=this.sub(d),d.negative^=1,g):d.negative===0&&this.negative!==0?(this.negative=0,g=d.sub(this),this.negative=1,g):this.length>d.length?this.clone().iadd(d):d.clone().iadd(this)},c.prototype.isub=function(d){if(d.negative!==0){d.negative=0;var g=this.iadd(d);return d.negative=1,g._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(d),this.negative=1,this._normSign();var _=this.cmp(d);if(_===0)return this.negative=0,this.length=1,this.words[0]=0,this;var w,x;_>0?(w=this,x=d):(w=d,x=this);for(var P=0,$=0;$<x.length;$++)g=(w.words[$]|0)-(x.words[$]|0)+P,P=g>>26,this.words[$]=g&67108863;for(;P!==0&&$<w.length;$++)g=(w.words[$]|0)+P,P=g>>26,this.words[$]=g&67108863;if(P===0&&$<w.length&&w!==this)for(;$<w.length;$++)this.words[$]=w.words[$];return this.length=Math.max(this.length,$),w!==this&&(this.negative=1),this.strip()},c.prototype.sub=function(d){return this.clone().isub(d)};function O(k,d,g){g.negative=d.negative^k.negative;var _=k.length+d.length|0;g.length=_,_=_-1|0;var w=k.words[0]|0,x=d.words[0]|0,P=w*x,$=P&67108863,T=P/67108864|0;g.words[0]=$;for(var m=1;m<_;m++){for(var M=T>>>26,W=T&67108863,Y=Math.min(m,d.length-1),ue=Math.max(0,m-k.length+1);ue<=Y;ue++){var ge=m-ue|0;w=k.words[ge]|0,x=d.words[ue]|0,P=w*x+W,M+=P/67108864|0,W=P&67108863}g.words[m]=W|0,T=M|0}return T!==0?g.words[m]=T|0:g.length--,g.strip()}var I=function(d,g,_){var w=d.words,x=g.words,P=_.words,$=0,T,m,M,W=w[0]|0,Y=W&8191,ue=W>>>13,ge=w[1]|0,he=ge&8191,ae=ge>>>13,de=w[2]|0,pe=de&8191,oe=de>>>13,le=w[3]|0,me=le&8191,xe=le>>>13,Ne=w[4]|0,Pe=Ne&8191,Ie=Ne>>>13,Ke=w[5]|0,Le=Ke&8191,Ce=Ke>>>13,at=w[6]|0,Oe=at&8191,De=at>>>13,yt=w[7]|0,Ue=yt&8191,ze=yt>>>13,Mt=w[8]|0,se=Mt&8191,j=Mt>>>13,X=w[9]|0,ce=X&8191,be=X>>>13,Re=x[0]|0,Se=Re&8191,qe=Re>>>13,bt=x[1]|0,je=bt&8191,We=bt>>>13,St=x[2]|0,ut=St&8191,vt=St>>>13,zt=x[3]|0,st=zt&8191,nt=zt>>>13,Vt=x[4]|0,tt=Vt&8191,ft=Vt>>>13,Ft=x[5]|0,Qe=Ft&8191,rt=Ft>>>13,Bt=x[6]|0,Xe=Bt&8191,ct=Bt>>>13,Ut=x[7]|0,Je=Ut&8191,it=Ut>>>13,qt=x[8]|0,et=qt&8191,ht=qt>>>13,ar=x[9]|0,dt=ar&8191,mt=ar>>>13;_.negative=d.negative^g.negative,_.length=19,T=Math.imul(Y,Se),m=Math.imul(Y,qe),m=m+Math.imul(ue,Se)|0,M=Math.imul(ue,qe);var Xt=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,T=Math.imul(he,Se),m=Math.imul(he,qe),m=m+Math.imul(ae,Se)|0,M=Math.imul(ae,qe),T=T+Math.imul(Y,je)|0,m=m+Math.imul(Y,We)|0,m=m+Math.imul(ue,je)|0,M=M+Math.imul(ue,We)|0;var er=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(er>>>26)|0,er&=67108863,T=Math.imul(pe,Se),m=Math.imul(pe,qe),m=m+Math.imul(oe,Se)|0,M=Math.imul(oe,qe),T=T+Math.imul(he,je)|0,m=m+Math.imul(he,We)|0,m=m+Math.imul(ae,je)|0,M=M+Math.imul(ae,We)|0,T=T+Math.imul(Y,ut)|0,m=m+Math.imul(Y,vt)|0,m=m+Math.imul(ue,ut)|0,M=M+Math.imul(ue,vt)|0;var kr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(kr>>>26)|0,kr&=67108863,T=Math.imul(me,Se),m=Math.imul(me,qe),m=m+Math.imul(xe,Se)|0,M=Math.imul(xe,qe),T=T+Math.imul(pe,je)|0,m=m+Math.imul(pe,We)|0,m=m+Math.imul(oe,je)|0,M=M+Math.imul(oe,We)|0,T=T+Math.imul(he,ut)|0,m=m+Math.imul(he,vt)|0,m=m+Math.imul(ae,ut)|0,M=M+Math.imul(ae,vt)|0,T=T+Math.imul(Y,st)|0,m=m+Math.imul(Y,nt)|0,m=m+Math.imul(ue,st)|0,M=M+Math.imul(ue,nt)|0;var Ar=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,T=Math.imul(Pe,Se),m=Math.imul(Pe,qe),m=m+Math.imul(Ie,Se)|0,M=Math.imul(Ie,qe),T=T+Math.imul(me,je)|0,m=m+Math.imul(me,We)|0,m=m+Math.imul(xe,je)|0,M=M+Math.imul(xe,We)|0,T=T+Math.imul(pe,ut)|0,m=m+Math.imul(pe,vt)|0,m=m+Math.imul(oe,ut)|0,M=M+Math.imul(oe,vt)|0,T=T+Math.imul(he,st)|0,m=m+Math.imul(he,nt)|0,m=m+Math.imul(ae,st)|0,M=M+Math.imul(ae,nt)|0,T=T+Math.imul(Y,tt)|0,m=m+Math.imul(Y,ft)|0,m=m+Math.imul(ue,tt)|0,M=M+Math.imul(ue,ft)|0;var Tr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Tr>>>26)|0,Tr&=67108863,T=Math.imul(Le,Se),m=Math.imul(Le,qe),m=m+Math.imul(Ce,Se)|0,M=Math.imul(Ce,qe),T=T+Math.imul(Pe,je)|0,m=m+Math.imul(Pe,We)|0,m=m+Math.imul(Ie,je)|0,M=M+Math.imul(Ie,We)|0,T=T+Math.imul(me,ut)|0,m=m+Math.imul(me,vt)|0,m=m+Math.imul(xe,ut)|0,M=M+Math.imul(xe,vt)|0,T=T+Math.imul(pe,st)|0,m=m+Math.imul(pe,nt)|0,m=m+Math.imul(oe,st)|0,M=M+Math.imul(oe,nt)|0,T=T+Math.imul(he,tt)|0,m=m+Math.imul(he,ft)|0,m=m+Math.imul(ae,tt)|0,M=M+Math.imul(ae,ft)|0,T=T+Math.imul(Y,Qe)|0,m=m+Math.imul(Y,rt)|0,m=m+Math.imul(ue,Qe)|0,M=M+Math.imul(ue,rt)|0;var Rr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,T=Math.imul(Oe,Se),m=Math.imul(Oe,qe),m=m+Math.imul(De,Se)|0,M=Math.imul(De,qe),T=T+Math.imul(Le,je)|0,m=m+Math.imul(Le,We)|0,m=m+Math.imul(Ce,je)|0,M=M+Math.imul(Ce,We)|0,T=T+Math.imul(Pe,ut)|0,m=m+Math.imul(Pe,vt)|0,m=m+Math.imul(Ie,ut)|0,M=M+Math.imul(Ie,vt)|0,T=T+Math.imul(me,st)|0,m=m+Math.imul(me,nt)|0,m=m+Math.imul(xe,st)|0,M=M+Math.imul(xe,nt)|0,T=T+Math.imul(pe,tt)|0,m=m+Math.imul(pe,ft)|0,m=m+Math.imul(oe,tt)|0,M=M+Math.imul(oe,ft)|0,T=T+Math.imul(he,Qe)|0,m=m+Math.imul(he,rt)|0,m=m+Math.imul(ae,Qe)|0,M=M+Math.imul(ae,rt)|0,T=T+Math.imul(Y,Xe)|0,m=m+Math.imul(Y,ct)|0,m=m+Math.imul(ue,Xe)|0,M=M+Math.imul(ue,ct)|0;var pr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(pr>>>26)|0,pr&=67108863,T=Math.imul(Ue,Se),m=Math.imul(Ue,qe),m=m+Math.imul(ze,Se)|0,M=Math.imul(ze,qe),T=T+Math.imul(Oe,je)|0,m=m+Math.imul(Oe,We)|0,m=m+Math.imul(De,je)|0,M=M+Math.imul(De,We)|0,T=T+Math.imul(Le,ut)|0,m=m+Math.imul(Le,vt)|0,m=m+Math.imul(Ce,ut)|0,M=M+Math.imul(Ce,vt)|0,T=T+Math.imul(Pe,st)|0,m=m+Math.imul(Pe,nt)|0,m=m+Math.imul(Ie,st)|0,M=M+Math.imul(Ie,nt)|0,T=T+Math.imul(me,tt)|0,m=m+Math.imul(me,ft)|0,m=m+Math.imul(xe,tt)|0,M=M+Math.imul(xe,ft)|0,T=T+Math.imul(pe,Qe)|0,m=m+Math.imul(pe,rt)|0,m=m+Math.imul(oe,Qe)|0,M=M+Math.imul(oe,rt)|0,T=T+Math.imul(he,Xe)|0,m=m+Math.imul(he,ct)|0,m=m+Math.imul(ae,Xe)|0,M=M+Math.imul(ae,ct)|0,T=T+Math.imul(Y,Je)|0,m=m+Math.imul(Y,it)|0,m=m+Math.imul(ue,Je)|0,M=M+Math.imul(ue,it)|0;var _r=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(_r>>>26)|0,_r&=67108863,T=Math.imul(se,Se),m=Math.imul(se,qe),m=m+Math.imul(j,Se)|0,M=Math.imul(j,qe),T=T+Math.imul(Ue,je)|0,m=m+Math.imul(Ue,We)|0,m=m+Math.imul(ze,je)|0,M=M+Math.imul(ze,We)|0,T=T+Math.imul(Oe,ut)|0,m=m+Math.imul(Oe,vt)|0,m=m+Math.imul(De,ut)|0,M=M+Math.imul(De,vt)|0,T=T+Math.imul(Le,st)|0,m=m+Math.imul(Le,nt)|0,m=m+Math.imul(Ce,st)|0,M=M+Math.imul(Ce,nt)|0,T=T+Math.imul(Pe,tt)|0,m=m+Math.imul(Pe,ft)|0,m=m+Math.imul(Ie,tt)|0,M=M+Math.imul(Ie,ft)|0,T=T+Math.imul(me,Qe)|0,m=m+Math.imul(me,rt)|0,m=m+Math.imul(xe,Qe)|0,M=M+Math.imul(xe,rt)|0,T=T+Math.imul(pe,Xe)|0,m=m+Math.imul(pe,ct)|0,m=m+Math.imul(oe,Xe)|0,M=M+Math.imul(oe,ct)|0,T=T+Math.imul(he,Je)|0,m=m+Math.imul(he,it)|0,m=m+Math.imul(ae,Je)|0,M=M+Math.imul(ae,it)|0,T=T+Math.imul(Y,et)|0,m=m+Math.imul(Y,ht)|0,m=m+Math.imul(ue,et)|0,M=M+Math.imul(ue,ht)|0;var fr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(fr>>>26)|0,fr&=67108863,T=Math.imul(ce,Se),m=Math.imul(ce,qe),m=m+Math.imul(be,Se)|0,M=Math.imul(be,qe),T=T+Math.imul(se,je)|0,m=m+Math.imul(se,We)|0,m=m+Math.imul(j,je)|0,M=M+Math.imul(j,We)|0,T=T+Math.imul(Ue,ut)|0,m=m+Math.imul(Ue,vt)|0,m=m+Math.imul(ze,ut)|0,M=M+Math.imul(ze,vt)|0,T=T+Math.imul(Oe,st)|0,m=m+Math.imul(Oe,nt)|0,m=m+Math.imul(De,st)|0,M=M+Math.imul(De,nt)|0,T=T+Math.imul(Le,tt)|0,m=m+Math.imul(Le,ft)|0,m=m+Math.imul(Ce,tt)|0,M=M+Math.imul(Ce,ft)|0,T=T+Math.imul(Pe,Qe)|0,m=m+Math.imul(Pe,rt)|0,m=m+Math.imul(Ie,Qe)|0,M=M+Math.imul(Ie,rt)|0,T=T+Math.imul(me,Xe)|0,m=m+Math.imul(me,ct)|0,m=m+Math.imul(xe,Xe)|0,M=M+Math.imul(xe,ct)|0,T=T+Math.imul(pe,Je)|0,m=m+Math.imul(pe,it)|0,m=m+Math.imul(oe,Je)|0,M=M+Math.imul(oe,it)|0,T=T+Math.imul(he,et)|0,m=m+Math.imul(he,ht)|0,m=m+Math.imul(ae,et)|0,M=M+Math.imul(ae,ht)|0,T=T+Math.imul(Y,dt)|0,m=m+Math.imul(Y,mt)|0,m=m+Math.imul(ue,dt)|0,M=M+Math.imul(ue,mt)|0;var Ht=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,T=Math.imul(ce,je),m=Math.imul(ce,We),m=m+Math.imul(be,je)|0,M=Math.imul(be,We),T=T+Math.imul(se,ut)|0,m=m+Math.imul(se,vt)|0,m=m+Math.imul(j,ut)|0,M=M+Math.imul(j,vt)|0,T=T+Math.imul(Ue,st)|0,m=m+Math.imul(Ue,nt)|0,m=m+Math.imul(ze,st)|0,M=M+Math.imul(ze,nt)|0,T=T+Math.imul(Oe,tt)|0,m=m+Math.imul(Oe,ft)|0,m=m+Math.imul(De,tt)|0,M=M+Math.imul(De,ft)|0,T=T+Math.imul(Le,Qe)|0,m=m+Math.imul(Le,rt)|0,m=m+Math.imul(Ce,Qe)|0,M=M+Math.imul(Ce,rt)|0,T=T+Math.imul(Pe,Xe)|0,m=m+Math.imul(Pe,ct)|0,m=m+Math.imul(Ie,Xe)|0,M=M+Math.imul(Ie,ct)|0,T=T+Math.imul(me,Je)|0,m=m+Math.imul(me,it)|0,m=m+Math.imul(xe,Je)|0,M=M+Math.imul(xe,it)|0,T=T+Math.imul(pe,et)|0,m=m+Math.imul(pe,ht)|0,m=m+Math.imul(oe,et)|0,M=M+Math.imul(oe,ht)|0,T=T+Math.imul(he,dt)|0,m=m+Math.imul(he,mt)|0,m=m+Math.imul(ae,dt)|0,M=M+Math.imul(ae,mt)|0;var Cr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,T=Math.imul(ce,ut),m=Math.imul(ce,vt),m=m+Math.imul(be,ut)|0,M=Math.imul(be,vt),T=T+Math.imul(se,st)|0,m=m+Math.imul(se,nt)|0,m=m+Math.imul(j,st)|0,M=M+Math.imul(j,nt)|0,T=T+Math.imul(Ue,tt)|0,m=m+Math.imul(Ue,ft)|0,m=m+Math.imul(ze,tt)|0,M=M+Math.imul(ze,ft)|0,T=T+Math.imul(Oe,Qe)|0,m=m+Math.imul(Oe,rt)|0,m=m+Math.imul(De,Qe)|0,M=M+Math.imul(De,rt)|0,T=T+Math.imul(Le,Xe)|0,m=m+Math.imul(Le,ct)|0,m=m+Math.imul(Ce,Xe)|0,M=M+Math.imul(Ce,ct)|0,T=T+Math.imul(Pe,Je)|0,m=m+Math.imul(Pe,it)|0,m=m+Math.imul(Ie,Je)|0,M=M+Math.imul(Ie,it)|0,T=T+Math.imul(me,et)|0,m=m+Math.imul(me,ht)|0,m=m+Math.imul(xe,et)|0,M=M+Math.imul(xe,ht)|0,T=T+Math.imul(pe,dt)|0,m=m+Math.imul(pe,mt)|0,m=m+Math.imul(oe,dt)|0,M=M+Math.imul(oe,mt)|0;var ur=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(ur>>>26)|0,ur&=67108863,T=Math.imul(ce,st),m=Math.imul(ce,nt),m=m+Math.imul(be,st)|0,M=Math.imul(be,nt),T=T+Math.imul(se,tt)|0,m=m+Math.imul(se,ft)|0,m=m+Math.imul(j,tt)|0,M=M+Math.imul(j,ft)|0,T=T+Math.imul(Ue,Qe)|0,m=m+Math.imul(Ue,rt)|0,m=m+Math.imul(ze,Qe)|0,M=M+Math.imul(ze,rt)|0,T=T+Math.imul(Oe,Xe)|0,m=m+Math.imul(Oe,ct)|0,m=m+Math.imul(De,Xe)|0,M=M+Math.imul(De,ct)|0,T=T+Math.imul(Le,Je)|0,m=m+Math.imul(Le,it)|0,m=m+Math.imul(Ce,Je)|0,M=M+Math.imul(Ce,it)|0,T=T+Math.imul(Pe,et)|0,m=m+Math.imul(Pe,ht)|0,m=m+Math.imul(Ie,et)|0,M=M+Math.imul(Ie,ht)|0,T=T+Math.imul(me,dt)|0,m=m+Math.imul(me,mt)|0,m=m+Math.imul(xe,dt)|0,M=M+Math.imul(xe,mt)|0;var wr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(wr>>>26)|0,wr&=67108863,T=Math.imul(ce,tt),m=Math.imul(ce,ft),m=m+Math.imul(be,tt)|0,M=Math.imul(be,ft),T=T+Math.imul(se,Qe)|0,m=m+Math.imul(se,rt)|0,m=m+Math.imul(j,Qe)|0,M=M+Math.imul(j,rt)|0,T=T+Math.imul(Ue,Xe)|0,m=m+Math.imul(Ue,ct)|0,m=m+Math.imul(ze,Xe)|0,M=M+Math.imul(ze,ct)|0,T=T+Math.imul(Oe,Je)|0,m=m+Math.imul(Oe,it)|0,m=m+Math.imul(De,Je)|0,M=M+Math.imul(De,it)|0,T=T+Math.imul(Le,et)|0,m=m+Math.imul(Le,ht)|0,m=m+Math.imul(Ce,et)|0,M=M+Math.imul(Ce,ht)|0,T=T+Math.imul(Pe,dt)|0,m=m+Math.imul(Pe,mt)|0,m=m+Math.imul(Ie,dt)|0,M=M+Math.imul(Ie,mt)|0;var yr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(yr>>>26)|0,yr&=67108863,T=Math.imul(ce,Qe),m=Math.imul(ce,rt),m=m+Math.imul(be,Qe)|0,M=Math.imul(be,rt),T=T+Math.imul(se,Xe)|0,m=m+Math.imul(se,ct)|0,m=m+Math.imul(j,Xe)|0,M=M+Math.imul(j,ct)|0,T=T+Math.imul(Ue,Je)|0,m=m+Math.imul(Ue,it)|0,m=m+Math.imul(ze,Je)|0,M=M+Math.imul(ze,it)|0,T=T+Math.imul(Oe,et)|0,m=m+Math.imul(Oe,ht)|0,m=m+Math.imul(De,et)|0,M=M+Math.imul(De,ht)|0,T=T+Math.imul(Le,dt)|0,m=m+Math.imul(Le,mt)|0,m=m+Math.imul(Ce,dt)|0,M=M+Math.imul(Ce,mt)|0;var Mr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,T=Math.imul(ce,Xe),m=Math.imul(ce,ct),m=m+Math.imul(be,Xe)|0,M=Math.imul(be,ct),T=T+Math.imul(se,Je)|0,m=m+Math.imul(se,it)|0,m=m+Math.imul(j,Je)|0,M=M+Math.imul(j,it)|0,T=T+Math.imul(Ue,et)|0,m=m+Math.imul(Ue,ht)|0,m=m+Math.imul(ze,et)|0,M=M+Math.imul(ze,ht)|0,T=T+Math.imul(Oe,dt)|0,m=m+Math.imul(Oe,mt)|0,m=m+Math.imul(De,dt)|0,M=M+Math.imul(De,mt)|0;var Er=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Er>>>26)|0,Er&=67108863,T=Math.imul(ce,Je),m=Math.imul(ce,it),m=m+Math.imul(be,Je)|0,M=Math.imul(be,it),T=T+Math.imul(se,et)|0,m=m+Math.imul(se,ht)|0,m=m+Math.imul(j,et)|0,M=M+Math.imul(j,ht)|0,T=T+Math.imul(Ue,dt)|0,m=m+Math.imul(Ue,mt)|0,m=m+Math.imul(ze,dt)|0,M=M+Math.imul(ze,mt)|0;var gr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(gr>>>26)|0,gr&=67108863,T=Math.imul(ce,et),m=Math.imul(ce,ht),m=m+Math.imul(be,et)|0,M=Math.imul(be,ht),T=T+Math.imul(se,dt)|0,m=m+Math.imul(se,mt)|0,m=m+Math.imul(j,dt)|0,M=M+Math.imul(j,mt)|0;var sr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(sr>>>26)|0,sr&=67108863,T=Math.imul(ce,dt),m=Math.imul(ce,mt),m=m+Math.imul(be,dt)|0,M=Math.imul(be,mt);var Ir=($+T|0)+((m&8191)<<13)|0;return $=(M+(m>>>13)|0)+(Ir>>>26)|0,Ir&=67108863,P[0]=Xt,P[1]=er,P[2]=kr,P[3]=Ar,P[4]=Tr,P[5]=Rr,P[6]=pr,P[7]=_r,P[8]=fr,P[9]=Ht,P[10]=Cr,P[11]=ur,P[12]=wr,P[13]=yr,P[14]=Mr,P[15]=Er,P[16]=gr,P[17]=sr,P[18]=Ir,$!==0&&(P[19]=$,_.length++),_};Math.imul||(I=O);function B(k,d,g){g.negative=d.negative^k.negative,g.length=k.length+d.length;for(var _=0,w=0,x=0;x<g.length-1;x++){var P=w;w=0;for(var $=_&67108863,T=Math.min(x,d.length-1),m=Math.max(0,x-k.length+1);m<=T;m++){var M=x-m,W=k.words[M]|0,Y=d.words[m]|0,ue=W*Y,ge=ue&67108863;P=P+(ue/67108864|0)|0,ge=ge+$|0,$=ge&67108863,P=P+(ge>>>26)|0,w+=P>>>26,P&=67108863}g.words[x]=$,_=P,P=w}return _!==0?g.words[x]=_:g.length--,g.strip()}function N(k,d,g){var _=new D;return _.mulp(k,d,g)}c.prototype.mulTo=function(d,g){var _,w=this.length+d.length;return this.length===10&&d.length===10?_=I(this,d,g):w<63?_=O(this,d,g):w<1024?_=B(this,d,g):_=N(this,d,g),_};function D(k,d){this.x=k,this.y=d}D.prototype.makeRBT=function(d){for(var g=new Array(d),_=c.prototype._countBits(d)-1,w=0;w<d;w++)g[w]=this.revBin(w,_,d);return g},D.prototype.revBin=function(d,g,_){if(d===0||d===_-1)return d;for(var w=0,x=0;x<g;x++)w|=(d&1)<<g-x-1,d>>=1;return w},D.prototype.permute=function(d,g,_,w,x,P){for(var $=0;$<P;$++)w[$]=g[d[$]],x[$]=_[d[$]]},D.prototype.transform=function(d,g,_,w,x,P){this.permute(P,d,g,_,w,x);for(var $=1;$<x;$<<=1)for(var T=$<<1,m=Math.cos(2*Math.PI/T),M=Math.sin(2*Math.PI/T),W=0;W<x;W+=T)for(var Y=m,ue=M,ge=0;ge<$;ge++){var he=_[W+ge],ae=w[W+ge],de=_[W+ge+$],pe=w[W+ge+$],oe=Y*de-ue*pe;pe=Y*pe+ue*de,de=oe,_[W+ge]=he+de,w[W+ge]=ae+pe,_[W+ge+$]=he-de,w[W+ge+$]=ae-pe,ge!==T&&(oe=m*Y-M*ue,ue=m*ue+M*Y,Y=oe)}},D.prototype.guessLen13b=function(d,g){var _=Math.max(g,d)|1,w=_&1,x=0;for(_=_/2|0;_;_=_>>>1)x++;return 1<<x+1+w},D.prototype.conjugate=function(d,g,_){if(!(_<=1))for(var w=0;w<_/2;w++){var x=d[w];d[w]=d[_-w-1],d[_-w-1]=x,x=g[w],g[w]=-g[_-w-1],g[_-w-1]=-x}},D.prototype.normalize13b=function(d,g){for(var _=0,w=0;w<g/2;w++){var x=Math.round(d[2*w+1]/g)*8192+Math.round(d[2*w]/g)+_;d[w]=x&67108863,x<67108864?_=0:_=x/67108864|0}return d},D.prototype.convert13b=function(d,g,_,w){for(var x=0,P=0;P<g;P++)x=x+(d[P]|0),_[2*P]=x&8191,x=x>>>13,_[2*P+1]=x&8191,x=x>>>13;for(P=2*g;P<w;++P)_[P]=0;l(x===0),l((x&-8192)===0)},D.prototype.stub=function(d){for(var g=new Array(d),_=0;_<d;_++)g[_]=0;return g},D.prototype.mulp=function(d,g,_){var w=2*this.guessLen13b(d.length,g.length),x=this.makeRBT(w),P=this.stub(w),$=new Array(w),T=new Array(w),m=new Array(w),M=new Array(w),W=new Array(w),Y=new Array(w),ue=_.words;ue.length=w,this.convert13b(d.words,d.length,$,w),this.convert13b(g.words,g.length,M,w),this.transform($,P,T,m,w,x),this.transform(M,P,W,Y,w,x);for(var ge=0;ge<w;ge++){var he=T[ge]*W[ge]-m[ge]*Y[ge];m[ge]=T[ge]*Y[ge]+m[ge]*W[ge],T[ge]=he}return this.conjugate(T,m,w),this.transform(T,m,ue,P,w,x),this.conjugate(ue,P,w),this.normalize13b(ue,w),_.negative=d.negative^g.negative,_.length=d.length+g.length,_.strip()},c.prototype.mul=function(d){var g=new c(null);return g.words=new Array(this.length+d.length),this.mulTo(d,g)},c.prototype.mulf=function(d){var g=new c(null);return g.words=new Array(this.length+d.length),N(this,d,g)},c.prototype.imul=function(d){return this.clone().mulTo(d,this)},c.prototype.imuln=function(d){l(typeof d=="number"),l(d<67108864);for(var g=0,_=0;_<this.length;_++){var w=(this.words[_]|0)*d,x=(w&67108863)+(g&67108863);g>>=26,g+=w/67108864|0,g+=x>>>26,this.words[_]=x&67108863}return g!==0&&(this.words[_]=g,this.length++),this},c.prototype.muln=function(d){return this.clone().imuln(d)},c.prototype.sqr=function(){return this.mul(this)},c.prototype.isqr=function(){return this.imul(this.clone())},c.prototype.pow=function(d){var g=R(d);if(g.length===0)return new c(1);for(var _=this,w=0;w<g.length&&g[w]===0;w++,_=_.sqr());if(++w<g.length)for(var x=_.sqr();w<g.length;w++,x=x.sqr())g[w]!==0&&(_=_.mul(x));return _},c.prototype.iushln=function(d){l(typeof d=="number"&&d>=0);var g=d%26,_=(d-g)/26,w=67108863>>>26-g<<26-g,x;if(g!==0){var P=0;for(x=0;x<this.length;x++){var $=this.words[x]&w,T=(this.words[x]|0)-$<<g;this.words[x]=T|P,P=$>>>26-g}P&&(this.words[x]=P,this.length++)}if(_!==0){for(x=this.length-1;x>=0;x--)this.words[x+_]=this.words[x];for(x=0;x<_;x++)this.words[x]=0;this.length+=_}return this.strip()},c.prototype.ishln=function(d){return l(this.negative===0),this.iushln(d)},c.prototype.iushrn=function(d,g,_){l(typeof d=="number"&&d>=0);var w;g?w=(g-g%26)/26:w=0;var x=d%26,P=Math.min((d-x)/26,this.length),$=67108863^67108863>>>x<<x,T=_;if(w-=P,w=Math.max(0,w),T){for(var m=0;m<P;m++)T.words[m]=this.words[m];T.length=P}if(P!==0)if(this.length>P)for(this.length-=P,m=0;m<this.length;m++)this.words[m]=this.words[m+P];else this.words[0]=0,this.length=1;var M=0;for(m=this.length-1;m>=0&&(M!==0||m>=w);m--){var W=this.words[m]|0;this.words[m]=M<<26-x|W>>>x,M=W&$}return T&&M!==0&&(T.words[T.length++]=M),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},c.prototype.ishrn=function(d,g,_){return l(this.negative===0),this.iushrn(d,g,_)},c.prototype.shln=function(d){return this.clone().ishln(d)},c.prototype.ushln=function(d){return this.clone().iushln(d)},c.prototype.shrn=function(d){return this.clone().ishrn(d)},c.prototype.ushrn=function(d){return this.clone().iushrn(d)},c.prototype.testn=function(d){l(typeof d=="number"&&d>=0);var g=d%26,_=(d-g)/26,w=1<<g;if(this.length<=_)return!1;var x=this.words[_];return!!(x&w)},c.prototype.imaskn=function(d){l(typeof d=="number"&&d>=0);var g=d%26,_=(d-g)/26;if(l(this.negative===0,"imaskn works only with positive numbers"),this.length<=_)return this;if(g!==0&&_++,this.length=Math.min(_,this.length),g!==0){var w=67108863^67108863>>>g<<g;this.words[this.length-1]&=w}return this.strip()},c.prototype.maskn=function(d){return this.clone().imaskn(d)},c.prototype.iaddn=function(d){return l(typeof d=="number"),l(d<67108864),d<0?this.isubn(-d):this.negative!==0?this.length===1&&(this.words[0]|0)<d?(this.words[0]=d-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(d),this.negative=1,this):this._iaddn(d)},c.prototype._iaddn=function(d){this.words[0]+=d;for(var g=0;g<this.length&&this.words[g]>=67108864;g++)this.words[g]-=67108864,g===this.length-1?this.words[g+1]=1:this.words[g+1]++;return this.length=Math.max(this.length,g+1),this},c.prototype.isubn=function(d){if(l(typeof d=="number"),l(d<67108864),d<0)return this.iaddn(-d);if(this.negative!==0)return this.negative=0,this.iaddn(d),this.negative=1,this;if(this.words[0]-=d,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var g=0;g<this.length&&this.words[g]<0;g++)this.words[g]+=67108864,this.words[g+1]-=1;return this.strip()},c.prototype.addn=function(d){return this.clone().iaddn(d)},c.prototype.subn=function(d){return this.clone().isubn(d)},c.prototype.iabs=function(){return this.negative=0,this},c.prototype.abs=function(){return this.clone().iabs()},c.prototype._ishlnsubmul=function(d,g,_){var w=d.length+_,x;this._expand(w);var P,$=0;for(x=0;x<d.length;x++){P=(this.words[x+_]|0)+$;var T=(d.words[x]|0)*g;P-=T&67108863,$=(P>>26)-(T/67108864|0),this.words[x+_]=P&67108863}for(;x<this.length-_;x++)P=(this.words[x+_]|0)+$,$=P>>26,this.words[x+_]=P&67108863;if($===0)return this.strip();for(l($===-1),$=0,x=0;x<this.length;x++)P=-(this.words[x]|0)+$,$=P>>26,this.words[x]=P&67108863;return this.negative=1,this.strip()},c.prototype._wordDiv=function(d,g){var _=this.length-d.length,w=this.clone(),x=d,P=x.words[x.length-1]|0,$=this._countBits(P);_=26-$,_!==0&&(x=x.ushln(_),w.iushln(_),P=x.words[x.length-1]|0);var T=w.length-x.length,m;if(g!=="mod"){m=new c(null),m.length=T+1,m.words=new Array(m.length);for(var M=0;M<m.length;M++)m.words[M]=0}var W=w.clone()._ishlnsubmul(x,1,T);W.negative===0&&(w=W,m&&(m.words[T]=1));for(var Y=T-1;Y>=0;Y--){var ue=(w.words[x.length+Y]|0)*67108864+(w.words[x.length+Y-1]|0);for(ue=Math.min(ue/P|0,67108863),w._ishlnsubmul(x,ue,Y);w.negative!==0;)ue--,w.negative=0,w._ishlnsubmul(x,1,Y),w.isZero()||(w.negative^=1);m&&(m.words[Y]=ue)}return m&&m.strip(),w.strip(),g!=="div"&&_!==0&&w.iushrn(_),{div:m||null,mod:w}},c.prototype.divmod=function(d,g,_){if(l(!d.isZero()),this.isZero())return{div:new c(0),mod:new c(0)};var w,x,P;return this.negative!==0&&d.negative===0?(P=this.neg().divmod(d,g),g!=="mod"&&(w=P.div.neg()),g!=="div"&&(x=P.mod.neg(),_&&x.negative!==0&&x.iadd(d)),{div:w,mod:x}):this.negative===0&&d.negative!==0?(P=this.divmod(d.neg(),g),g!=="mod"&&(w=P.div.neg()),{div:w,mod:P.mod}):this.negative&d.negative?(P=this.neg().divmod(d.neg(),g),g!=="div"&&(x=P.mod.neg(),_&&x.negative!==0&&x.isub(d)),{div:P.div,mod:x}):d.length>this.length||this.cmp(d)<0?{div:new c(0),mod:this}:d.length===1?g==="div"?{div:this.divn(d.words[0]),mod:null}:g==="mod"?{div:null,mod:new c(this.modn(d.words[0]))}:{div:this.divn(d.words[0]),mod:new c(this.modn(d.words[0]))}:this._wordDiv(d,g)},c.prototype.div=function(d){return this.divmod(d,"div",!1).div},c.prototype.mod=function(d){return this.divmod(d,"mod",!1).mod},c.prototype.umod=function(d){return this.divmod(d,"mod",!0).mod},c.prototype.divRound=function(d){var g=this.divmod(d);if(g.mod.isZero())return g.div;var _=g.div.negative!==0?g.mod.isub(d):g.mod,w=d.ushrn(1),x=d.andln(1),P=_.cmp(w);return P<0||x===1&&P===0?g.div:g.div.negative!==0?g.div.isubn(1):g.div.iaddn(1)},c.prototype.modn=function(d){l(d<=67108863);for(var g=(1<<26)%d,_=0,w=this.length-1;w>=0;w--)_=(g*_+(this.words[w]|0))%d;return _},c.prototype.idivn=function(d){l(d<=67108863);for(var g=0,_=this.length-1;_>=0;_--){var w=(this.words[_]|0)+g*67108864;this.words[_]=w/d|0,g=w%d}return this.strip()},c.prototype.divn=function(d){return this.clone().idivn(d)},c.prototype.egcd=function(d){l(d.negative===0),l(!d.isZero());var g=this,_=d.clone();g.negative!==0?g=g.umod(d):g=g.clone();for(var w=new c(1),x=new c(0),P=new c(0),$=new c(1),T=0;g.isEven()&&_.isEven();)g.iushrn(1),_.iushrn(1),++T;for(var m=_.clone(),M=g.clone();!g.isZero();){for(var W=0,Y=1;!(g.words[0]&Y)&&W<26;++W,Y<<=1);if(W>0)for(g.iushrn(W);W-- >0;)(w.isOdd()||x.isOdd())&&(w.iadd(m),x.isub(M)),w.iushrn(1),x.iushrn(1);for(var ue=0,ge=1;!(_.words[0]&ge)&&ue<26;++ue,ge<<=1);if(ue>0)for(_.iushrn(ue);ue-- >0;)(P.isOdd()||$.isOdd())&&(P.iadd(m),$.isub(M)),P.iushrn(1),$.iushrn(1);g.cmp(_)>=0?(g.isub(_),w.isub(P),x.isub($)):(_.isub(g),P.isub(w),$.isub(x))}return{a:P,b:$,gcd:_.iushln(T)}},c.prototype._invmp=function(d){l(d.negative===0),l(!d.isZero());var g=this,_=d.clone();g.negative!==0?g=g.umod(d):g=g.clone();for(var w=new c(1),x=new c(0),P=_.clone();g.cmpn(1)>0&&_.cmpn(1)>0;){for(var $=0,T=1;!(g.words[0]&T)&&$<26;++$,T<<=1);if($>0)for(g.iushrn($);$-- >0;)w.isOdd()&&w.iadd(P),w.iushrn(1);for(var m=0,M=1;!(_.words[0]&M)&&m<26;++m,M<<=1);if(m>0)for(_.iushrn(m);m-- >0;)x.isOdd()&&x.iadd(P),x.iushrn(1);g.cmp(_)>=0?(g.isub(_),w.isub(x)):(_.isub(g),x.isub(w))}var W;return g.cmpn(1)===0?W=w:W=x,W.cmpn(0)<0&&W.iadd(d),W},c.prototype.gcd=function(d){if(this.isZero())return d.abs();if(d.isZero())return this.abs();var g=this.clone(),_=d.clone();g.negative=0,_.negative=0;for(var w=0;g.isEven()&&_.isEven();w++)g.iushrn(1),_.iushrn(1);do{for(;g.isEven();)g.iushrn(1);for(;_.isEven();)_.iushrn(1);var x=g.cmp(_);if(x<0){var P=g;g=_,_=P}else if(x===0||_.cmpn(1)===0)break;g.isub(_)}while(!0);return _.iushln(w)},c.prototype.invm=function(d){return this.egcd(d).a.umod(d)},c.prototype.isEven=function(){return(this.words[0]&1)===0},c.prototype.isOdd=function(){return(this.words[0]&1)===1},c.prototype.andln=function(d){return this.words[0]&d},c.prototype.bincn=function(d){l(typeof d=="number");var g=d%26,_=(d-g)/26,w=1<<g;if(this.length<=_)return this._expand(_+1),this.words[_]|=w,this;for(var x=w,P=_;x!==0&&P<this.length;P++){var $=this.words[P]|0;$+=x,x=$>>>26,$&=67108863,this.words[P]=$}return x!==0&&(this.words[P]=x,this.length++),this},c.prototype.isZero=function(){return this.length===1&&this.words[0]===0},c.prototype.cmpn=function(d){var g=d<0;if(this.negative!==0&&!g)return-1;if(this.negative===0&&g)return 1;this.strip();var _;if(this.length>1)_=1;else{g&&(d=-d),l(d<=67108863,"Number is too big");var w=this.words[0]|0;_=w===d?0:w<d?-1:1}return this.negative!==0?-_|0:_},c.prototype.cmp=function(d){if(this.negative!==0&&d.negative===0)return-1;if(this.negative===0&&d.negative!==0)return 1;var g=this.ucmp(d);return this.negative!==0?-g|0:g},c.prototype.ucmp=function(d){if(this.length>d.length)return 1;if(this.length<d.length)return-1;for(var g=0,_=this.length-1;_>=0;_--){var w=this.words[_]|0,x=d.words[_]|0;if(w!==x){w<x?g=-1:w>x&&(g=1);break}}return g},c.prototype.gtn=function(d){return this.cmpn(d)===1},c.prototype.gt=function(d){return this.cmp(d)===1},c.prototype.gten=function(d){return this.cmpn(d)>=0},c.prototype.gte=function(d){return this.cmp(d)>=0},c.prototype.ltn=function(d){return this.cmpn(d)===-1},c.prototype.lt=function(d){return this.cmp(d)===-1},c.prototype.lten=function(d){return this.cmpn(d)<=0},c.prototype.lte=function(d){return this.cmp(d)<=0},c.prototype.eqn=function(d){return this.cmpn(d)===0},c.prototype.eq=function(d){return this.cmp(d)===0},c.red=function(d){return new Q(d)},c.prototype.toRed=function(d){return l(!this.red,"Already a number in reduction context"),l(this.negative===0,"red works only with positives"),d.convertTo(this)._forceRed(d)},c.prototype.fromRed=function(){return l(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},c.prototype._forceRed=function(d){return this.red=d,this},c.prototype.forceRed=function(d){return l(!this.red,"Already a number in reduction context"),this._forceRed(d)},c.prototype.redAdd=function(d){return l(this.red,"redAdd works only with red numbers"),this.red.add(this,d)},c.prototype.redIAdd=function(d){return l(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,d)},c.prototype.redSub=function(d){return l(this.red,"redSub works only with red numbers"),this.red.sub(this,d)},c.prototype.redISub=function(d){return l(this.red,"redISub works only with red numbers"),this.red.isub(this,d)},c.prototype.redShl=function(d){return l(this.red,"redShl works only with red numbers"),this.red.shl(this,d)},c.prototype.redMul=function(d){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.mul(this,d)},c.prototype.redIMul=function(d){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.imul(this,d)},c.prototype.redSqr=function(){return l(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},c.prototype.redISqr=function(){return l(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},c.prototype.redSqrt=function(){return l(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},c.prototype.redInvm=function(){return l(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},c.prototype.redNeg=function(){return l(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},c.prototype.redPow=function(d){return l(this.red&&!d.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,d)};var G={k256:null,p224:null,p192:null,p25519:null};function V(k,d){this.name=k,this.p=new c(d,16),this.n=this.p.bitLength(),this.k=new c(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}V.prototype._tmp=function(){var d=new c(null);return d.words=new Array(Math.ceil(this.n/13)),d},V.prototype.ireduce=function(d){var g=d,_;do this.split(g,this.tmp),g=this.imulK(g),g=g.iadd(this.tmp),_=g.bitLength();while(_>this.n);var w=_<this.n?-1:g.ucmp(this.p);return w===0?(g.words[0]=0,g.length=1):w>0?g.isub(this.p):g.strip!==void 0?g.strip():g._strip(),g},V.prototype.split=function(d,g){d.iushrn(this.n,0,g)},V.prototype.imulK=function(d){return d.imul(this.k)};function U(){V.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}f(U,V),U.prototype.split=function(d,g){for(var _=4194303,w=Math.min(d.length,9),x=0;x<w;x++)g.words[x]=d.words[x];if(g.length=w,d.length<=9){d.words[0]=0,d.length=1;return}var P=d.words[9];for(g.words[g.length++]=P&_,x=10;x<d.length;x++){var $=d.words[x]|0;d.words[x-10]=($&_)<<4|P>>>22,P=$}P>>>=22,d.words[x-10]=P,P===0&&d.length>10?d.length-=10:d.length-=9},U.prototype.imulK=function(d){d.words[d.length]=0,d.words[d.length+1]=0,d.length+=2;for(var g=0,_=0;_<d.length;_++){var w=d.words[_]|0;g+=w*977,d.words[_]=g&67108863,g=w*64+(g/67108864|0)}return d.words[d.length-1]===0&&(d.length--,d.words[d.length-1]===0&&d.length--),d};function te(){V.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}f(te,V);function Z(){V.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}f(Z,V);function J(){V.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}f(J,V),J.prototype.imulK=function(d){for(var g=0,_=0;_<d.length;_++){var w=(d.words[_]|0)*19+g,x=w&67108863;w>>>=26,d.words[_]=x,g=w}return g!==0&&(d.words[d.length++]=g),d},c._prime=function(d){if(G[d])return G[d];var g;if(d==="k256")g=new U;else if(d==="p224")g=new te;else if(d==="p192")g=new Z;else if(d==="p25519")g=new J;else throw new Error("Unknown prime "+d);return G[d]=g,g};function Q(k){if(typeof k=="string"){var d=c._prime(k);this.m=d.p,this.prime=d}else l(k.gtn(1),"modulus must be greater than 1"),this.m=k,this.prime=null}Q.prototype._verify1=function(d){l(d.negative===0,"red works only with positives"),l(d.red,"red works only with red numbers")},Q.prototype._verify2=function(d,g){l((d.negative|g.negative)===0,"red works only with positives"),l(d.red&&d.red===g.red,"red works only with red numbers")},Q.prototype.imod=function(d){return this.prime?this.prime.ireduce(d)._forceRed(this):d.umod(this.m)._forceRed(this)},Q.prototype.neg=function(d){return d.isZero()?d.clone():this.m.sub(d)._forceRed(this)},Q.prototype.add=function(d,g){this._verify2(d,g);var _=d.add(g);return _.cmp(this.m)>=0&&_.isub(this.m),_._forceRed(this)},Q.prototype.iadd=function(d,g){this._verify2(d,g);var _=d.iadd(g);return _.cmp(this.m)>=0&&_.isub(this.m),_},Q.prototype.sub=function(d,g){this._verify2(d,g);var _=d.sub(g);return _.cmpn(0)<0&&_.iadd(this.m),_._forceRed(this)},Q.prototype.isub=function(d,g){this._verify2(d,g);var _=d.isub(g);return _.cmpn(0)<0&&_.iadd(this.m),_},Q.prototype.shl=function(d,g){return this._verify1(d),this.imod(d.ushln(g))},Q.prototype.imul=function(d,g){return this._verify2(d,g),this.imod(d.imul(g))},Q.prototype.mul=function(d,g){return this._verify2(d,g),this.imod(d.mul(g))},Q.prototype.isqr=function(d){return this.imul(d,d.clone())},Q.prototype.sqr=function(d){return this.mul(d,d)},Q.prototype.sqrt=function(d){if(d.isZero())return d.clone();var g=this.m.andln(3);if(l(g%2===1),g===3){var _=this.m.add(new c(1)).iushrn(2);return this.pow(d,_)}for(var w=this.m.subn(1),x=0;!w.isZero()&&w.andln(1)===0;)x++,w.iushrn(1);l(!w.isZero());var P=new c(1).toRed(this),$=P.redNeg(),T=this.m.subn(1).iushrn(1),m=this.m.bitLength();for(m=new c(2*m*m).toRed(this);this.pow(m,T).cmp($)!==0;)m.redIAdd($);for(var M=this.pow(m,w),W=this.pow(d,w.addn(1).iushrn(1)),Y=this.pow(d,w),ue=x;Y.cmp(P)!==0;){for(var ge=Y,he=0;ge.cmp(P)!==0;he++)ge=ge.redSqr();l(he<ue);var ae=this.pow(M,new c(1).iushln(ue-he-1));W=W.redMul(ae),M=ae.redSqr(),Y=Y.redMul(M),ue=he}return W},Q.prototype.invm=function(d){var g=d._invmp(this.m);return g.negative!==0?(g.negative=0,this.imod(g).redNeg()):this.imod(g)},Q.prototype.pow=function(d,g){if(g.isZero())return new c(1).toRed(this);if(g.cmpn(1)===0)return d.clone();var _=4,w=new Array(1<<_);w[0]=new c(1).toRed(this),w[1]=d;for(var x=2;x<w.length;x++)w[x]=this.mul(w[x-1],d);var P=w[0],$=0,T=0,m=g.bitLength()%26;for(m===0&&(m=26),x=g.length-1;x>=0;x--){for(var M=g.words[x],W=m-1;W>=0;W--){var Y=M>>W&1;if(P!==w[0]&&(P=this.sqr(P)),Y===0&&$===0){T=0;continue}$<<=1,$|=Y,T++,!(T!==_&&(x!==0||W!==0))&&(P=this.mul(P,w[$]),T=0,$=0)}m=26}return P},Q.prototype.convertTo=function(d){var g=d.umod(this.m);return g===d?g.clone():g},Q.prototype.convertFrom=function(d){var g=d.clone();return g.red=null,g},c.mont=function(d){return new ee(d)};function ee(k){Q.call(this,k),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new c(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}f(ee,Q),ee.prototype.convertTo=function(d){return this.imod(d.ushln(this.shift))},ee.prototype.convertFrom=function(d){var g=this.imod(d.mul(this.rinv));return g.red=null,g},ee.prototype.imul=function(d,g){if(d.isZero()||g.isZero())return d.words[0]=0,d.length=1,d;var _=d.imul(g),w=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=_.isub(w).iushrn(this.shift),P=x;return x.cmp(this.m)>=0?P=x.isub(this.m):x.cmpn(0)<0&&(P=x.iadd(this.m)),P._forceRed(this)},ee.prototype.mul=function(d,g){if(d.isZero()||g.isZero())return new c(0)._forceRed(this);var _=d.mul(g),w=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=_.isub(w).iushrn(this.shift),P=x;return x.cmp(this.m)>=0?P=x.isub(this.m):x.cmpn(0)<0&&(P=x.iadd(this.m)),P._forceRed(this)},ee.prototype.invm=function(d){var g=this.imod(d._invmp(this.m).mul(this.r2));return g._forceRed(this)}})(s,bn$4)}(bn$5)),bn$5.exports}var api={},vmBrowserify={},hasRequiredVmBrowserify;function requireVmBrowserify(){return hasRequiredVmBrowserify||(hasRequiredVmBrowserify=1,function(exports){var indexOf=function(s,a){if(s.indexOf)return s.indexOf(a);for(var u=0;u<s.length;u++)if(s[u]===a)return u;return-1},Object_keys=function(s){if(Object.keys)return Object.keys(s);var a=[];for(var u in s)a.push(u);return a},forEach=function(s,a){if(s.forEach)return s.forEach(a);for(var u=0;u<s.length;u++)a(s[u],u,s)},defineProp=function(){try{return Object.defineProperty({},"_",{}),function(s,a,u){Object.defineProperty(s,a,{writable:!0,enumerable:!1,configurable:!0,value:u})}}catch{return function(a,u,l){a[u]=l}}}(),globals=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];function Context(){}Context.prototype={};var Script=exports.Script=function(a){if(!(this instanceof Script))return new Script(a);this.code=a};Script.prototype.runInContext=function(s){if(!(s instanceof Context))throw new TypeError("needs a 'context' argument.");var a=document.createElement("iframe");a.style||(a.style={}),a.style.display="none",document.body.appendChild(a);var u=a.contentWindow,l=u.eval,f=u.execScript;!l&&f&&(f.call(u,"null"),l=u.eval),forEach(Object_keys(s),function(p){u[p]=s[p]}),forEach(globals,function(p){s[p]&&(u[p]=s[p])});var c=Object_keys(u),h=l.call(u,this.code);return forEach(Object_keys(u),function(p){(p in s||indexOf(c,p)===-1)&&(s[p]=u[p])}),forEach(globals,function(p){p in s||defineProp(s,p,u[p])}),document.body.removeChild(a),h},Script.prototype.runInThisContext=function(){return eval(this.code)},Script.prototype.runInNewContext=function(s){var a=Script.createContext(s),u=this.runInContext(a);return s&&forEach(Object_keys(a),function(l){s[l]=a[l]}),u},forEach(Object_keys(Script.prototype),function(s){exports[s]=Script[s]=function(a){var u=Script(a);return u[s].apply(u,[].slice.call(arguments,1))}}),exports.isContext=function(s){return s instanceof Context},exports.createScript=function(s){return exports.Script(s)},exports.createContext=Script.createContext=function(s){var a=new Context;return typeof s=="object"&&forEach(Object_keys(s),function(u){a[u]=s[u]}),a}}(vmBrowserify)),vmBrowserify}var hasRequiredApi;function requireApi(){return hasRequiredApi||(hasRequiredApi=1,function(s){var a=requireAsn1$1(),u=requireInherits_browser(),l=s;l.define=function(h,p){return new f(h,p)};function f(c,h){this.name=c,this.body=h,this.decoders={},this.encoders={}}f.prototype._createNamed=function(h){var p;try{p=requireVmBrowserify().runInThisContext("(function "+this.name+`(entity) {
  this._initNamed(entity);
})`)}catch{p=function(y){this._initNamed(y)}}return u(p,h),p.prototype._initNamed=function(y){h.call(this,y)},new p(this)},f.prototype._getDecoder=function(h){return h=h||"der",this.decoders.hasOwnProperty(h)||(this.decoders[h]=this._createNamed(a.decoders[h])),this.decoders[h]},f.prototype.decode=function(h,p,v){return this._getDecoder(p).decode(h,v)},f.prototype._getEncoder=function(h){return h=h||"der",this.encoders.hasOwnProperty(h)||(this.encoders[h]=this._createNamed(a.encoders[h])),this.encoders[h]},f.prototype.encode=function(h,p,v){return this._getEncoder(p).encode(h,v)}}(api)),api}var base$2={},reporter={},hasRequiredReporter;function requireReporter(){if(hasRequiredReporter)return reporter;hasRequiredReporter=1;var s=requireInherits_browser();function a(l){this._reporterState={obj:null,path:[],options:l||{},errors:[]}}reporter.Reporter=a,a.prototype.isError=function(f){return f instanceof u},a.prototype.save=function(){var f=this._reporterState;return{obj:f.obj,pathLen:f.path.length}},a.prototype.restore=function(f){var c=this._reporterState;c.obj=f.obj,c.path=c.path.slice(0,f.pathLen)},a.prototype.enterKey=function(f){return this._reporterState.path.push(f)},a.prototype.exitKey=function(f){var c=this._reporterState;c.path=c.path.slice(0,f-1)},a.prototype.leaveKey=function(f,c,h){var p=this._reporterState;this.exitKey(f),p.obj!==null&&(p.obj[c]=h)},a.prototype.path=function(){return this._reporterState.path.join("/")},a.prototype.enterObject=function(){var f=this._reporterState,c=f.obj;return f.obj={},c},a.prototype.leaveObject=function(f){var c=this._reporterState,h=c.obj;return c.obj=f,h},a.prototype.error=function(f){var c,h=this._reporterState,p=f instanceof u;if(p?c=f:c=new u(h.path.map(function(v){return"["+JSON.stringify(v)+"]"}).join(""),f.message||f,f.stack),!h.options.partial)throw c;return p||h.errors.push(c),c},a.prototype.wrapResult=function(f){var c=this._reporterState;return c.options.partial?{result:this.isError(f)?null:f,errors:c.errors}:f};function u(l,f){this.path=l,this.rethrow(f)}return s(u,Error),u.prototype.rethrow=function(f){if(this.message=f+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,u),!this.stack)try{throw new Error(this.message)}catch(c){this.stack=c.stack}return this},reporter}var buffer={},hasRequiredBuffer;function requireBuffer(){if(hasRequiredBuffer)return buffer;hasRequiredBuffer=1;var s=requireInherits_browser(),a=requireBase$2().Reporter,u=requireBuffer$1().Buffer;function l(c,h){if(a.call(this,h),!u.isBuffer(c)){this.error("Input not Buffer");return}this.base=c,this.offset=0,this.length=c.length}s(l,a),buffer.DecoderBuffer=l,l.prototype.save=function(){return{offset:this.offset,reporter:a.prototype.save.call(this)}},l.prototype.restore=function(h){var p=new l(this.base);return p.offset=h.offset,p.length=this.offset,this.offset=h.offset,a.prototype.restore.call(this,h.reporter),p},l.prototype.isEmpty=function(){return this.offset===this.length},l.prototype.readUInt8=function(h){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(h||"DecoderBuffer overrun")},l.prototype.skip=function(h,p){if(!(this.offset+h<=this.length))return this.error(p||"DecoderBuffer overrun");var v=new l(this.base);return v._reporterState=this._reporterState,v.offset=this.offset,v.length=this.offset+h,this.offset+=h,v},l.prototype.raw=function(h){return this.base.slice(h?h.offset:this.offset,this.length)};function f(c,h){if(Array.isArray(c))this.length=0,this.value=c.map(function(p){return p instanceof f||(p=new f(p,h)),this.length+=p.length,p},this);else if(typeof c=="number"){if(!(0<=c&&c<=255))return h.error("non-byte EncoderBuffer value");this.value=c,this.length=1}else if(typeof c=="string")this.value=c,this.length=u.byteLength(c);else if(u.isBuffer(c))this.value=c,this.length=c.length;else return h.error("Unsupported type: "+typeof c)}return buffer.EncoderBuffer=f,f.prototype.join=function(h,p){return h||(h=new u(this.length)),p||(p=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(v){v.join(h,p),p+=v.length}):(typeof this.value=="number"?h[p]=this.value:typeof this.value=="string"?h.write(this.value,p):u.isBuffer(this.value)&&this.value.copy(h,p),p+=this.length)),h},buffer}var node$2,hasRequiredNode$3;function requireNode$3(){if(hasRequiredNode$3)return node$2;hasRequiredNode$3=1;var s=requireBase$2().Reporter,a=requireBase$2().EncoderBuffer,u=requireBase$2().DecoderBuffer,l=requireMinimalisticAssert(),f=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],c=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(f),h=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function p(y,b){var S={};this._baseState=S,S.enc=y,S.parent=b||null,S.children=null,S.tag=null,S.args=null,S.reverseArgs=null,S.choice=null,S.optional=!1,S.any=!1,S.obj=!1,S.use=null,S.useDecoder=null,S.key=null,S.default=null,S.explicit=null,S.implicit=null,S.contains=null,S.parent||(S.children=[],this._wrap())}node$2=p;var v=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];return p.prototype.clone=function(){var b=this._baseState,S={};v.forEach(function(R){S[R]=b[R]});var E=new this.constructor(S.parent);return E._baseState=S,E},p.prototype._wrap=function(){var b=this._baseState;c.forEach(function(S){this[S]=function(){var R=new this.constructor(this);return b.children.push(R),R[S].apply(R,arguments)}},this)},p.prototype._init=function(b){var S=this._baseState;l(S.parent===null),b.call(this),S.children=S.children.filter(function(E){return E._baseState.parent===this},this),l.equal(S.children.length,1,"Root node can have only one child")},p.prototype._useArgs=function(b){var S=this._baseState,E=b.filter(function(R){return R instanceof this.constructor},this);b=b.filter(function(R){return!(R instanceof this.constructor)},this),E.length!==0&&(l(S.children===null),S.children=E,E.forEach(function(R){R._baseState.parent=this},this)),b.length!==0&&(l(S.args===null),S.args=b,S.reverseArgs=b.map(function(R){if(typeof R!="object"||R.constructor!==Object)return R;var O={};return Object.keys(R).forEach(function(I){I==(I|0)&&(I|=0);var B=R[I];O[B]=I}),O}))},h.forEach(function(y){p.prototype[y]=function(){var S=this._baseState;throw new Error(y+" not implemented for encoding: "+S.enc)}}),f.forEach(function(y){p.prototype[y]=function(){var S=this._baseState,E=Array.prototype.slice.call(arguments);return l(S.tag===null),S.tag=y,this._useArgs(E),this}}),p.prototype.use=function(b){l(b);var S=this._baseState;return l(S.use===null),S.use=b,this},p.prototype.optional=function(){var b=this._baseState;return b.optional=!0,this},p.prototype.def=function(b){var S=this._baseState;return l(S.default===null),S.default=b,S.optional=!0,this},p.prototype.explicit=function(b){var S=this._baseState;return l(S.explicit===null&&S.implicit===null),S.explicit=b,this},p.prototype.implicit=function(b){var S=this._baseState;return l(S.explicit===null&&S.implicit===null),S.implicit=b,this},p.prototype.obj=function(){var b=this._baseState,S=Array.prototype.slice.call(arguments);return b.obj=!0,S.length!==0&&this._useArgs(S),this},p.prototype.key=function(b){var S=this._baseState;return l(S.key===null),S.key=b,this},p.prototype.any=function(){var b=this._baseState;return b.any=!0,this},p.prototype.choice=function(b){var S=this._baseState;return l(S.choice===null),S.choice=b,this._useArgs(Object.keys(b).map(function(E){return b[E]})),this},p.prototype.contains=function(b){var S=this._baseState;return l(S.use===null),S.contains=b,this},p.prototype._decode=function(b,S){var E=this._baseState;if(E.parent===null)return b.wrapResult(E.children[0]._decode(b,S));var R=E.default,O=!0,I=null;if(E.key!==null&&(I=b.enterKey(E.key)),E.optional){var B=null;if(E.explicit!==null?B=E.explicit:E.implicit!==null?B=E.implicit:E.tag!==null&&(B=E.tag),B===null&&!E.any){var N=b.save();try{E.choice===null?this._decodeGeneric(E.tag,b,S):this._decodeChoice(b,S),O=!0}catch{O=!1}b.restore(N)}else if(O=this._peekTag(b,B,E.any),b.isError(O))return O}var D;if(E.obj&&O&&(D=b.enterObject()),O){if(E.explicit!==null){var G=this._decodeTag(b,E.explicit);if(b.isError(G))return G;b=G}var V=b.offset;if(E.use===null&&E.choice===null){if(E.any)var N=b.save();var U=this._decodeTag(b,E.implicit!==null?E.implicit:E.tag,E.any);if(b.isError(U))return U;E.any?R=b.raw(N):b=U}if(S&&S.track&&E.tag!==null&&S.track(b.path(),V,b.length,"tagged"),S&&S.track&&E.tag!==null&&S.track(b.path(),b.offset,b.length,"content"),E.any?R=R:E.choice===null?R=this._decodeGeneric(E.tag,b,S):R=this._decodeChoice(b,S),b.isError(R))return R;if(!E.any&&E.choice===null&&E.children!==null&&E.children.forEach(function(J){J._decode(b,S)}),E.contains&&(E.tag==="octstr"||E.tag==="bitstr")){var te=new u(R);R=this._getUse(E.contains,b._reporterState.obj)._decode(te,S)}}return E.obj&&O&&(R=b.leaveObject(D)),E.key!==null&&(R!==null||O===!0)?b.leaveKey(I,E.key,R):I!==null&&b.exitKey(I),R},p.prototype._decodeGeneric=function(b,S,E){var R=this._baseState;return b==="seq"||b==="set"?null:b==="seqof"||b==="setof"?this._decodeList(S,b,R.args[0],E):/str$/.test(b)?this._decodeStr(S,b,E):b==="objid"&&R.args?this._decodeObjid(S,R.args[0],R.args[1],E):b==="objid"?this._decodeObjid(S,null,null,E):b==="gentime"||b==="utctime"?this._decodeTime(S,b,E):b==="null_"?this._decodeNull(S,E):b==="bool"?this._decodeBool(S,E):b==="objDesc"?this._decodeStr(S,b,E):b==="int"||b==="enum"?this._decodeInt(S,R.args&&R.args[0],E):R.use!==null?this._getUse(R.use,S._reporterState.obj)._decode(S,E):S.error("unknown tag: "+b)},p.prototype._getUse=function(b,S){var E=this._baseState;return E.useDecoder=this._use(b,S),l(E.useDecoder._baseState.parent===null),E.useDecoder=E.useDecoder._baseState.children[0],E.implicit!==E.useDecoder._baseState.implicit&&(E.useDecoder=E.useDecoder.clone(),E.useDecoder._baseState.implicit=E.implicit),E.useDecoder},p.prototype._decodeChoice=function(b,S){var E=this._baseState,R=null,O=!1;return Object.keys(E.choice).some(function(I){var B=b.save(),N=E.choice[I];try{var D=N._decode(b,S);if(b.isError(D))return!1;R={type:I,value:D},O=!0}catch{return b.restore(B),!1}return!0},this),O?R:b.error("Choice not matched")},p.prototype._createEncoderBuffer=function(b){return new a(b,this.reporter)},p.prototype._encode=function(b,S,E){var R=this._baseState;if(!(R.default!==null&&R.default===b)){var O=this._encodeValue(b,S,E);if(O!==void 0&&!this._skipDefault(O,S,E))return O}},p.prototype._encodeValue=function(b,S,E){var R=this._baseState;if(R.parent===null)return R.children[0]._encode(b,S||new s);var N=null;if(this.reporter=S,R.optional&&b===void 0)if(R.default!==null)b=R.default;else return;var O=null,I=!1;if(R.any)N=this._createEncoderBuffer(b);else if(R.choice)N=this._encodeChoice(b,S);else if(R.contains)O=this._getUse(R.contains,E)._encode(b,S),I=!0;else if(R.children)O=R.children.map(function(V){if(V._baseState.tag==="null_")return V._encode(null,S,b);if(V._baseState.key===null)return S.error("Child should have a key");var U=S.enterKey(V._baseState.key);if(typeof b!="object")return S.error("Child expected, but input is not object");var te=V._encode(b[V._baseState.key],S,b);return S.leaveKey(U),te},this).filter(function(V){return V}),O=this._createEncoderBuffer(O);else if(R.tag==="seqof"||R.tag==="setof"){if(!(R.args&&R.args.length===1))return S.error("Too many args for : "+R.tag);if(!Array.isArray(b))return S.error("seqof/setof, but data is not Array");var B=this.clone();B._baseState.implicit=null,O=this._createEncoderBuffer(b.map(function(V){var U=this._baseState;return this._getUse(U.args[0],b)._encode(V,S)},B))}else R.use!==null?N=this._getUse(R.use,E)._encode(b,S):(O=this._encodePrimitive(R.tag,b),I=!0);var N;if(!R.any&&R.choice===null){var D=R.implicit!==null?R.implicit:R.tag,G=R.implicit===null?"universal":"context";D===null?R.use===null&&S.error("Tag could be omitted only for .use()"):R.use===null&&(N=this._encodeComposite(D,I,G,O))}return R.explicit!==null&&(N=this._encodeComposite(R.explicit,!1,"context",N)),N},p.prototype._encodeChoice=function(b,S){var E=this._baseState,R=E.choice[b.type];return R||l(!1,b.type+" not found in "+JSON.stringify(Object.keys(E.choice))),R._encode(b.value,S)},p.prototype._encodePrimitive=function(b,S){var E=this._baseState;if(/str$/.test(b))return this._encodeStr(S,b);if(b==="objid"&&E.args)return this._encodeObjid(S,E.reverseArgs[0],E.args[1]);if(b==="objid")return this._encodeObjid(S,null,null);if(b==="gentime"||b==="utctime")return this._encodeTime(S,b);if(b==="null_")return this._encodeNull();if(b==="int"||b==="enum")return this._encodeInt(S,E.args&&E.reverseArgs[0]);if(b==="bool")return this._encodeBool(S);if(b==="objDesc")return this._encodeStr(S,b);throw new Error("Unsupported tag: "+b)},p.prototype._isNumstr=function(b){return/^[0-9 ]*$/.test(b)},p.prototype._isPrintstr=function(b){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(b)},node$2}var hasRequiredBase$2;function requireBase$2(){return hasRequiredBase$2||(hasRequiredBase$2=1,function(s){var a=s;a.Reporter=requireReporter().Reporter,a.DecoderBuffer=requireBuffer().DecoderBuffer,a.EncoderBuffer=requireBuffer().EncoderBuffer,a.Node=requireNode$3()}(base$2)),base$2}var constants$1={},der={},hasRequiredDer$2;function requireDer$2(){return hasRequiredDer$2||(hasRequiredDer$2=1,function(s){var a=requireConstants$1();s.tagClass={0:"universal",1:"application",2:"context",3:"private"},s.tagClassByName=a._reverse(s.tagClass),s.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},s.tagByName=a._reverse(s.tag)}(der)),der}var hasRequiredConstants$1;function requireConstants$1(){return hasRequiredConstants$1||(hasRequiredConstants$1=1,function(s){var a=s;a._reverse=function(l){var f={};return Object.keys(l).forEach(function(c){(c|0)==c&&(c=c|0);var h=l[c];f[h]=c}),f},a.der=requireDer$2()}(constants$1)),constants$1}var decoders$1={},der_1$1,hasRequiredDer$1;function requireDer$1(){if(hasRequiredDer$1)return der_1$1;hasRequiredDer$1=1;var s=requireInherits_browser(),a=requireAsn1$1(),u=a.base,l=a.bignum,f=a.constants.der;function c(y){this.enc="der",this.name=y.name,this.entity=y,this.tree=new h,this.tree._init(y.body)}der_1$1=c,c.prototype.decode=function(b,S){return b instanceof u.DecoderBuffer||(b=new u.DecoderBuffer(b,S)),this.tree._decode(b,S)};function h(y){u.Node.call(this,"der",y)}s(h,u.Node),h.prototype._peekTag=function(b,S,E){if(b.isEmpty())return!1;var R=b.save(),O=p(b,'Failed to peek tag: "'+S+'"');return b.isError(O)?O:(b.restore(R),O.tag===S||O.tagStr===S||O.tagStr+"of"===S||E)},h.prototype._decodeTag=function(b,S,E){var R=p(b,'Failed to decode tag of "'+S+'"');if(b.isError(R))return R;var O=v(b,R.primitive,'Failed to get length of "'+S+'"');if(b.isError(O))return O;if(!E&&R.tag!==S&&R.tagStr!==S&&R.tagStr+"of"!==S)return b.error('Failed to match tag: "'+S+'"');if(R.primitive||O!==null)return b.skip(O,'Failed to match body of: "'+S+'"');var I=b.save(),B=this._skipUntilEnd(b,'Failed to skip indefinite length body: "'+this.tag+'"');return b.isError(B)?B:(O=b.offset-I.offset,b.restore(I),b.skip(O,'Failed to match body of: "'+S+'"'))},h.prototype._skipUntilEnd=function(b,S){for(;;){var E=p(b,S);if(b.isError(E))return E;var R=v(b,E.primitive,S);if(b.isError(R))return R;var O;if(E.primitive||R!==null?O=b.skip(R):O=this._skipUntilEnd(b,S),b.isError(O))return O;if(E.tagStr==="end")break}},h.prototype._decodeList=function(b,S,E,R){for(var O=[];!b.isEmpty();){var I=this._peekTag(b,"end");if(b.isError(I))return I;var B=E.decode(b,"der",R);if(b.isError(B)&&I)break;O.push(B)}return O},h.prototype._decodeStr=function(b,S){if(S==="bitstr"){var E=b.readUInt8();return b.isError(E)?E:{unused:E,data:b.raw()}}else if(S==="bmpstr"){var R=b.raw();if(R.length%2===1)return b.error("Decoding of string type: bmpstr length mismatch");for(var O="",I=0;I<R.length/2;I++)O+=String.fromCharCode(R.readUInt16BE(I*2));return O}else if(S==="numstr"){var B=b.raw().toString("ascii");return this._isNumstr(B)?B:b.error("Decoding of string type: numstr unsupported characters")}else{if(S==="octstr")return b.raw();if(S==="objDesc")return b.raw();if(S==="printstr"){var N=b.raw().toString("ascii");return this._isPrintstr(N)?N:b.error("Decoding of string type: printstr unsupported characters")}else return/str$/.test(S)?b.raw().toString():b.error("Decoding of string type: "+S+" unsupported")}},h.prototype._decodeObjid=function(b,S,E){for(var R,O=[],I=0;!b.isEmpty();){var B=b.readUInt8();I<<=7,I|=B&127,B&128||(O.push(I),I=0)}B&128&&O.push(I);var N=O[0]/40|0,D=O[0]%40;if(E?R=O:R=[N,D].concat(O.slice(1)),S){var G=S[R.join(" ")];G===void 0&&(G=S[R.join(".")]),G!==void 0&&(R=G)}return R},h.prototype._decodeTime=function(b,S){var E=b.raw().toString();if(S==="gentime")var R=E.slice(0,4)|0,O=E.slice(4,6)|0,I=E.slice(6,8)|0,B=E.slice(8,10)|0,N=E.slice(10,12)|0,D=E.slice(12,14)|0;else if(S==="utctime"){var R=E.slice(0,2)|0,O=E.slice(2,4)|0,I=E.slice(4,6)|0,B=E.slice(6,8)|0,N=E.slice(8,10)|0,D=E.slice(10,12)|0;R<70?R=2e3+R:R=1900+R}else return b.error("Decoding "+S+" time is not supported yet");return Date.UTC(R,O-1,I,B,N,D,0)},h.prototype._decodeNull=function(b){return null},h.prototype._decodeBool=function(b){var S=b.readUInt8();return b.isError(S)?S:S!==0},h.prototype._decodeInt=function(b,S){var E=b.raw(),R=new l(E);return S&&(R=S[R.toString(10)]||R),R},h.prototype._use=function(b,S){return typeof b=="function"&&(b=b(S)),b._getDecoder("der").tree};function p(y,b){var S=y.readUInt8(b);if(y.isError(S))return S;var E=f.tagClass[S>>6],R=(S&32)===0;if((S&31)===31){var O=S;for(S=0;(O&128)===128;){if(O=y.readUInt8(b),y.isError(O))return O;S<<=7,S|=O&127}}else S&=31;var I=f.tag[S];return{cls:E,primitive:R,tag:S,tagStr:I}}function v(y,b,S){var E=y.readUInt8(S);if(y.isError(E))return E;if(!b&&E===128)return null;if(!(E&128))return E;var R=E&127;if(R>4)return y.error("length octect is too long");E=0;for(var O=0;O<R;O++){E<<=8;var I=y.readUInt8(S);if(y.isError(I))return I;E|=I}return E}return der_1$1}var pem$1,hasRequiredPem$1;function requirePem$1(){if(hasRequiredPem$1)return pem$1;hasRequiredPem$1=1;var s=requireInherits_browser(),a=requireBuffer$1().Buffer,u=requireDer$1();function l(f){u.call(this,f),this.enc="pem"}return s(l,u),pem$1=l,l.prototype.decode=function(c,h){for(var p=c.toString().split(/[\r\n]+/g),v=h.label.toUpperCase(),y=/^-----(BEGIN|END) ([^-]+)-----$/,b=-1,S=-1,E=0;E<p.length;E++){var R=p[E].match(y);if(R!==null&&R[2]===v)if(b===-1){if(R[1]!=="BEGIN")break;b=E}else{if(R[1]!=="END")break;S=E;break}}if(b===-1||S===-1)throw new Error("PEM section not found for: "+v);var O=p.slice(b+1,S).join("");O.replace(/[^a-z0-9\+\/=]+/gi,"");var I=new a(O,"base64");return u.prototype.decode.call(this,I,h)},pem$1}var hasRequiredDecoders;function requireDecoders(){return hasRequiredDecoders||(hasRequiredDecoders=1,function(s){var a=s;a.der=requireDer$1(),a.pem=requirePem$1()}(decoders$1)),decoders$1}var encoders$1={},der_1,hasRequiredDer;function requireDer(){if(hasRequiredDer)return der_1;hasRequiredDer=1;var s=requireInherits_browser(),a=requireBuffer$1().Buffer,u=requireAsn1$1(),l=u.base,f=u.constants.der;function c(y){this.enc="der",this.name=y.name,this.entity=y,this.tree=new h,this.tree._init(y.body)}der_1=c,c.prototype.encode=function(b,S){return this.tree._encode(b,S).join()};function h(y){l.Node.call(this,"der",y)}s(h,l.Node),h.prototype._encodeComposite=function(b,S,E,R){var O=v(b,S,E,this.reporter);if(R.length<128){var N=new a(2);return N[0]=O,N[1]=R.length,this._createEncoderBuffer([N,R])}for(var I=1,B=R.length;B>=256;B>>=8)I++;var N=new a(2+I);N[0]=O,N[1]=128|I;for(var B=1+I,D=R.length;D>0;B--,D>>=8)N[B]=D&255;return this._createEncoderBuffer([N,R])},h.prototype._encodeStr=function(b,S){if(S==="bitstr")return this._createEncoderBuffer([b.unused|0,b.data]);if(S==="bmpstr"){for(var E=new a(b.length*2),R=0;R<b.length;R++)E.writeUInt16BE(b.charCodeAt(R),R*2);return this._createEncoderBuffer(E)}else return S==="numstr"?this._isNumstr(b)?this._createEncoderBuffer(b):this.reporter.error("Encoding of string type: numstr supports only digits and space"):S==="printstr"?this._isPrintstr(b)?this._createEncoderBuffer(b):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(S)?this._createEncoderBuffer(b):S==="objDesc"?this._createEncoderBuffer(b):this.reporter.error("Encoding of string type: "+S+" unsupported")},h.prototype._encodeObjid=function(b,S,E){if(typeof b=="string"){if(!S)return this.reporter.error("string objid given, but no values map found");if(!S.hasOwnProperty(b))return this.reporter.error("objid not found in values map");b=S[b].split(/[\s\.]+/g);for(var R=0;R<b.length;R++)b[R]|=0}else if(Array.isArray(b)){b=b.slice();for(var R=0;R<b.length;R++)b[R]|=0}if(!Array.isArray(b))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(b));if(!E){if(b[1]>=40)return this.reporter.error("Second objid identifier OOB");b.splice(0,2,b[0]*40+b[1])}for(var O=0,R=0;R<b.length;R++){var I=b[R];for(O++;I>=128;I>>=7)O++}for(var B=new a(O),N=B.length-1,R=b.length-1;R>=0;R--){var I=b[R];for(B[N--]=I&127;(I>>=7)>0;)B[N--]=128|I&127}return this._createEncoderBuffer(B)};function p(y){return y<10?"0"+y:y}h.prototype._encodeTime=function(b,S){var E,R=new Date(b);return S==="gentime"?E=[p(R.getFullYear()),p(R.getUTCMonth()+1),p(R.getUTCDate()),p(R.getUTCHours()),p(R.getUTCMinutes()),p(R.getUTCSeconds()),"Z"].join(""):S==="utctime"?E=[p(R.getFullYear()%100),p(R.getUTCMonth()+1),p(R.getUTCDate()),p(R.getUTCHours()),p(R.getUTCMinutes()),p(R.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+S+" time is not supported yet"),this._encodeStr(E,"octstr")},h.prototype._encodeNull=function(){return this._createEncoderBuffer("")},h.prototype._encodeInt=function(b,S){if(typeof b=="string"){if(!S)return this.reporter.error("String int or enum given, but no values map");if(!S.hasOwnProperty(b))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(b));b=S[b]}if(typeof b!="number"&&!a.isBuffer(b)){var E=b.toArray();!b.sign&&E[0]&128&&E.unshift(0),b=new a(E)}if(a.isBuffer(b)){var R=b.length;b.length===0&&R++;var I=new a(R);return b.copy(I),b.length===0&&(I[0]=0),this._createEncoderBuffer(I)}if(b<128)return this._createEncoderBuffer(b);if(b<256)return this._createEncoderBuffer([0,b]);for(var R=1,O=b;O>=256;O>>=8)R++;for(var I=new Array(R),O=I.length-1;O>=0;O--)I[O]=b&255,b>>=8;return I[0]&128&&I.unshift(0),this._createEncoderBuffer(new a(I))},h.prototype._encodeBool=function(b){return this._createEncoderBuffer(b?255:0)},h.prototype._use=function(b,S){return typeof b=="function"&&(b=b(S)),b._getEncoder("der").tree},h.prototype._skipDefault=function(b,S,E){var R=this._baseState,O;if(R.default===null)return!1;var I=b.join();if(R.defaultBuffer===void 0&&(R.defaultBuffer=this._encodeValue(R.default,S,E).join()),I.length!==R.defaultBuffer.length)return!1;for(O=0;O<I.length;O++)if(I[O]!==R.defaultBuffer[O])return!1;return!0};function v(y,b,S,E){var R;if(y==="seqof"?y="seq":y==="setof"&&(y="set"),f.tagByName.hasOwnProperty(y))R=f.tagByName[y];else if(typeof y=="number"&&(y|0)===y)R=y;else return E.error("Unknown tag: "+y);return R>=31?E.error("Multi-octet tag encoding unsupported"):(b||(R|=32),R|=f.tagClassByName[S||"universal"]<<6,R)}return der_1}var pem,hasRequiredPem;function requirePem(){if(hasRequiredPem)return pem;hasRequiredPem=1;var s=requireInherits_browser(),a=requireDer();function u(l){a.call(this,l),this.enc="pem"}return s(u,a),pem=u,u.prototype.encode=function(f,c){for(var h=a.prototype.encode.call(this,f),p=h.toString("base64"),v=["-----BEGIN "+c.label+"-----"],y=0;y<p.length;y+=64)v.push(p.slice(y,y+64));return v.push("-----END "+c.label+"-----"),v.join(`
`)},pem}var hasRequiredEncoders;function requireEncoders(){return hasRequiredEncoders||(hasRequiredEncoders=1,function(s){var a=s;a.der=requireDer(),a.pem=requirePem()}(encoders$1)),encoders$1}var hasRequiredAsn1$1;function requireAsn1$1(){return hasRequiredAsn1$1||(hasRequiredAsn1$1=1,function(s){var a=s;a.bignum=requireBn$2(),a.define=requireApi().define,a.base=requireBase$2(),a.constants=requireConstants$1(),a.decoders=requireDecoders(),a.encoders=requireEncoders()}(asn1)),asn1}var certificate,hasRequiredCertificate;function requireCertificate(){if(hasRequiredCertificate)return certificate;hasRequiredCertificate=1;var s=requireAsn1$1(),a=s.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),u=s.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),l=s.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),f=s.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(l),this.key("subjectPublicKey").bitstr())}),c=s.define("RelativeDistinguishedName",function(){this.setof(u)}),h=s.define("RDNSequence",function(){this.seqof(c)}),p=s.define("Name",function(){this.choice({rdnSequence:this.use(h)})}),v=s.define("Validity",function(){this.seq().obj(this.key("notBefore").use(a),this.key("notAfter").use(a))}),y=s.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),b=s.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(l),this.key("issuer").use(p),this.key("validity").use(v),this.key("subject").use(p),this.key("subjectPublicKeyInfo").use(f),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(y).optional())}),S=s.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(b),this.key("signatureAlgorithm").use(l),this.key("signatureValue").bitstr())});return certificate=S,certificate}var hasRequiredAsn1;function requireAsn1(){if(hasRequiredAsn1)return asn1$1;hasRequiredAsn1=1;var s=requireAsn1$1();asn1$1.certificate=requireCertificate();var a=s.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});asn1$1.RSAPrivateKey=a;var u=s.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});asn1$1.RSAPublicKey=u;var l=s.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),f=s.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(l),this.key("subjectPublicKey").bitstr())});asn1$1.PublicKey=f;var c=s.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(l),this.key("subjectPrivateKey").octstr())});asn1$1.PrivateKey=c;var h=s.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});asn1$1.EncryptedPrivateKey=h;var p=s.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});asn1$1.DSAPrivateKey=p,asn1$1.DSAparam=s.define("DSAparam",function(){this.int()});var v=s.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),y=s.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(v),this.key("publicKey").optional().explicit(1).bitstr())});return asn1$1.ECPrivateKey=y,asn1$1.signature=s.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())}),asn1$1}const require$$1$1={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"};var fixProc,hasRequiredFixProc;function requireFixProc(){if(hasRequiredFixProc)return fixProc;hasRequiredFixProc=1;var s=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,a=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,u=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,l=requireEvp_bytestokey(),f=requireBrowser$6(),c=requireSafeBuffer$2().Buffer;return fixProc=function(h,p){var v=h.toString(),y=v.match(s),b;if(y){var E="aes"+y[1],R=c.from(y[2],"hex"),O=c.from(y[3].replace(/[\r\n]/g,""),"base64"),I=l(p,R.slice(0,8),parseInt(y[1],10)).key,B=[],N=f.createDecipheriv(E,I,R);B.push(N.update(O)),B.push(N.final()),b=c.concat(B)}else{var S=v.match(u);b=c.from(S[2].replace(/[\r\n]/g,""),"base64")}var D=v.match(a)[1];return{tag:D,data:b}},fixProc}var parseAsn1,hasRequiredParseAsn1;function requireParseAsn1(){if(hasRequiredParseAsn1)return parseAsn1;hasRequiredParseAsn1=1;var s=requireAsn1(),a=require$$1$1,u=requireFixProc(),l=requireBrowser$6(),f=requireBrowser$7(),c=requireSafeBuffer$2().Buffer;function h(v,y){var b=v.algorithm.decrypt.kde.kdeparams.salt,S=parseInt(v.algorithm.decrypt.kde.kdeparams.iters.toString(),10),E=a[v.algorithm.decrypt.cipher.algo.join(".")],R=v.algorithm.decrypt.cipher.iv,O=v.subjectPrivateKey,I=parseInt(E.split("-")[1],10)/8,B=f.pbkdf2Sync(y,b,S,I,"sha1"),N=l.createDecipheriv(E,B,R),D=[];return D.push(N.update(O)),D.push(N.final()),c.concat(D)}function p(v){var y;typeof v=="object"&&!c.isBuffer(v)&&(y=v.passphrase,v=v.key),typeof v=="string"&&(v=c.from(v));var b=u(v,y),S=b.tag,E=b.data,R,O;switch(S){case"CERTIFICATE":O=s.certificate.decode(E,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(O||(O=s.PublicKey.decode(E,"der")),R=O.algorithm.algorithm.join("."),R){case"1.2.840.113549.1.1.1":return s.RSAPublicKey.decode(O.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return O.subjectPrivateKey=O.subjectPublicKey,{type:"ec",data:O};case"1.2.840.10040.4.1":return O.algorithm.params.pub_key=s.DSAparam.decode(O.subjectPublicKey.data,"der"),{type:"dsa",data:O.algorithm.params};default:throw new Error("unknown key id "+R)}case"ENCRYPTED PRIVATE KEY":E=s.EncryptedPrivateKey.decode(E,"der"),E=h(E,y);case"PRIVATE KEY":switch(O=s.PrivateKey.decode(E,"der"),R=O.algorithm.algorithm.join("."),R){case"1.2.840.113549.1.1.1":return s.RSAPrivateKey.decode(O.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:O.algorithm.curve,privateKey:s.ECPrivateKey.decode(O.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return O.algorithm.params.priv_key=s.DSAparam.decode(O.subjectPrivateKey,"der"),{type:"dsa",params:O.algorithm.params};default:throw new Error("unknown key id "+R)}case"RSA PUBLIC KEY":return s.RSAPublicKey.decode(E,"der");case"RSA PRIVATE KEY":return s.RSAPrivateKey.decode(E,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:s.DSAPrivateKey.decode(E,"der")};case"EC PRIVATE KEY":return E=s.ECPrivateKey.decode(E,"der"),{curve:E.parameters.value,privateKey:E.privateKey};default:throw new Error("unknown key type "+S)}}return p.signature=s.signature,parseAsn1=p,parseAsn1}const require$$4$1={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"};var hasRequiredSign;function requireSign(){if(hasRequiredSign)return sign$1.exports;hasRequiredSign=1;var s=requireSafeBuffer$2().Buffer,a=requireBrowser$8(),u=requireBrowserifyRsa(),l=requireElliptic().ec,f=requireBn$4(),c=requireParseAsn1(),h=require$$4$1,p=1;function v(N,D,G,V,U){var te=c(D);if(te.curve){if(V!=="ecdsa"&&V!=="ecdsa/rsa")throw new Error("wrong private key type");return y(N,te)}else if(te.type==="dsa"){if(V!=="dsa")throw new Error("wrong private key type");return b(N,te,G)}if(V!=="rsa"&&V!=="ecdsa/rsa")throw new Error("wrong private key type");if(D.padding!==void 0&&D.padding!==p)throw new Error("illegal or unsupported padding mode");N=s.concat([U,N]);for(var Z=te.modulus.byteLength(),J=[0,1];N.length+J.length+1<Z;)J.push(255);J.push(0);for(var Q=-1;++Q<N.length;)J.push(N[Q]);var ee=u(J,te);return ee}function y(N,D){var G=h[D.curve.join(".")];if(!G)throw new Error("unknown curve "+D.curve.join("."));var V=new l(G),U=V.keyFromPrivate(D.privateKey),te=U.sign(N);return s.from(te.toDER())}function b(N,D,G){for(var V=D.params.priv_key,U=D.params.p,te=D.params.q,Z=D.params.g,J=new f(0),Q,ee=R(N,te).mod(te),k=!1,d=E(V,te,N,G);k===!1;)Q=I(te,d,G),J=B(Z,Q,U,te),k=Q.invm(te).imul(ee.add(V.mul(J))).mod(te),k.cmpn(0)===0&&(k=!1,J=new f(0));return S(J,k)}function S(N,D){N=N.toArray(),D=D.toArray(),N[0]&128&&(N=[0].concat(N)),D[0]&128&&(D=[0].concat(D));var G=N.length+D.length+4,V=[48,G,2,N.length];return V=V.concat(N,[2,D.length],D),s.from(V)}function E(N,D,G,V){if(N=s.from(N.toArray()),N.length<D.byteLength()){var U=s.alloc(D.byteLength()-N.length);N=s.concat([U,N])}var te=G.length,Z=O(G,D),J=s.alloc(te);J.fill(1);var Q=s.alloc(te);return Q=a(V,Q).update(J).update(s.from([0])).update(N).update(Z).digest(),J=a(V,Q).update(J).digest(),Q=a(V,Q).update(J).update(s.from([1])).update(N).update(Z).digest(),J=a(V,Q).update(J).digest(),{k:Q,v:J}}function R(N,D){var G=new f(N),V=(N.length<<3)-D.bitLength();return V>0&&G.ishrn(V),G}function O(N,D){N=R(N,D),N=N.mod(D);var G=s.from(N.toArray());if(G.length<D.byteLength()){var V=s.alloc(D.byteLength()-G.length);G=s.concat([V,G])}return G}function I(N,D,G){var V,U;do{for(V=s.alloc(0);V.length*8<N.bitLength();)D.v=a(G,D.k).update(D.v).digest(),V=s.concat([V,D.v]);U=R(V,N),D.k=a(G,D.k).update(D.v).update(s.from([0])).digest(),D.v=a(G,D.k).update(D.v).digest()}while(U.cmp(N)!==-1);return U}function B(N,D,G,V){return N.toRed(f.mont(G)).redPow(D).fromRed().mod(V)}return sign$1.exports=v,sign$1.exports.getKey=E,sign$1.exports.makeKey=I,sign$1.exports}var verify_1,hasRequiredVerify;function requireVerify(){if(hasRequiredVerify)return verify_1;hasRequiredVerify=1;var s=requireSafeBuffer$2().Buffer,a=requireBn$4(),u=requireElliptic().ec,l=requireParseAsn1(),f=require$$4$1;function c(y,b,S,E,R){var O=l(S);if(O.type==="ec"){if(E!=="ecdsa"&&E!=="ecdsa/rsa")throw new Error("wrong public key type");return h(y,b,O)}else if(O.type==="dsa"){if(E!=="dsa")throw new Error("wrong public key type");return p(y,b,O)}if(E!=="rsa"&&E!=="ecdsa/rsa")throw new Error("wrong public key type");b=s.concat([R,b]);for(var I=O.modulus.byteLength(),B=[1],N=0;b.length+B.length+2<I;)B.push(255),N+=1;B.push(0);for(var D=-1;++D<b.length;)B.push(b[D]);B=s.from(B);var G=a.mont(O.modulus);y=new a(y).toRed(G),y=y.redPow(new a(O.publicExponent)),y=s.from(y.fromRed().toArray());var V=N<8?1:0;for(I=Math.min(y.length,B.length),y.length!==B.length&&(V=1),D=-1;++D<I;)V|=y[D]^B[D];return V===0}function h(y,b,S){var E=f[S.data.algorithm.curve.join(".")];if(!E)throw new Error("unknown curve "+S.data.algorithm.curve.join("."));var R=new u(E),O=S.data.subjectPrivateKey.data;return R.verify(b,y,O)}function p(y,b,S){var E=S.data.p,R=S.data.q,O=S.data.g,I=S.data.pub_key,B=l.signature.decode(y,"der"),N=B.s,D=B.r;v(N,R),v(D,R);var G=a.mont(E),V=N.invm(R),U=O.toRed(G).redPow(new a(b).mul(V).mod(R)).fromRed().mul(I.toRed(G).redPow(D.mul(V).mod(R)).fromRed()).mod(E).mod(R);return U.cmp(D)===0}function v(y,b){if(y.cmpn(0)<=0)throw new Error("invalid sig");if(y.cmp(b)>=0)throw new Error("invalid sig")}return verify_1=c,verify_1}var browser$3,hasRequiredBrowser$3;function requireBrowser$3(){if(hasRequiredBrowser$3)return browser$3;hasRequiredBrowser$3=1;var s=requireSafeBuffer$2().Buffer,a=requireBrowser$9(),u=requireReadableBrowser(),l=requireInherits_browser(),f=requireSign(),c=requireVerify(),h=require$$6$1;Object.keys(h).forEach(function(S){h[S].id=s.from(h[S].id,"hex"),h[S.toLowerCase()]=h[S]});function p(S){u.Writable.call(this);var E=h[S];if(!E)throw new Error("Unknown message digest");this._hashType=E.hash,this._hash=a(E.hash),this._tag=E.id,this._signType=E.sign}l(p,u.Writable),p.prototype._write=function(E,R,O){this._hash.update(E),O()},p.prototype.update=function(E,R){return this._hash.update(typeof E=="string"?s.from(E,R):E),this},p.prototype.sign=function(E,R){this.end();var O=this._hash.digest(),I=f(O,E,this._hashType,this._signType,this._tag);return R?I.toString(R):I};function v(S){u.Writable.call(this);var E=h[S];if(!E)throw new Error("Unknown message digest");this._hash=a(E.hash),this._tag=E.id,this._signType=E.sign}l(v,u.Writable),v.prototype._write=function(E,R,O){this._hash.update(E),O()},v.prototype.update=function(E,R){return this._hash.update(typeof E=="string"?s.from(E,R):E),this},v.prototype.verify=function(E,R,O){var I=typeof R=="string"?s.from(R,O):R;this.end();var B=this._hash.digest();return c(I,B,E,this._signType,this._tag)};function y(S){return new p(S)}function b(S){return new v(S)}return browser$3={Sign:y,Verify:b,createSign:y,createVerify:b},browser$3}var bn$3={exports:{}},bn$2=bn$3.exports,hasRequiredBn$1;function requireBn$1(){return hasRequiredBn$1||(hasRequiredBn$1=1,function(s){(function(a,u){function l(k,d){if(!k)throw new Error(d||"Assertion failed")}function f(k,d){k.super_=d;var g=function(){};g.prototype=d.prototype,k.prototype=new g,k.prototype.constructor=k}function c(k,d,g){if(c.isBN(k))return k;this.negative=0,this.words=null,this.length=0,this.red=null,k!==null&&((d==="le"||d==="be")&&(g=d,d=10),this._init(k||0,d||10,g||"be"))}typeof a=="object"?a.exports=c:u.BN=c,c.BN=c,c.wordSize=26;var h;try{typeof window<"u"&&typeof window.Buffer<"u"?h=window.Buffer:h=require$$2$1.Buffer}catch{}c.isBN=function(d){return d instanceof c?!0:d!==null&&typeof d=="object"&&d.constructor.wordSize===c.wordSize&&Array.isArray(d.words)},c.max=function(d,g){return d.cmp(g)>0?d:g},c.min=function(d,g){return d.cmp(g)<0?d:g},c.prototype._init=function(d,g,_){if(typeof d=="number")return this._initNumber(d,g,_);if(typeof d=="object")return this._initArray(d,g,_);g==="hex"&&(g=16),l(g===(g|0)&&g>=2&&g<=36),d=d.toString().replace(/\s+/g,"");var w=0;d[0]==="-"&&(w++,this.negative=1),w<d.length&&(g===16?this._parseHex(d,w,_):(this._parseBase(d,g,w),_==="le"&&this._initArray(this.toArray(),g,_)))},c.prototype._initNumber=function(d,g,_){d<0&&(this.negative=1,d=-d),d<67108864?(this.words=[d&67108863],this.length=1):d<4503599627370496?(this.words=[d&67108863,d/67108864&67108863],this.length=2):(l(d<9007199254740992),this.words=[d&67108863,d/67108864&67108863,1],this.length=3),_==="le"&&this._initArray(this.toArray(),g,_)},c.prototype._initArray=function(d,g,_){if(l(typeof d.length=="number"),d.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(d.length/3),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var x,P,$=0;if(_==="be")for(w=d.length-1,x=0;w>=0;w-=3)P=d[w]|d[w-1]<<8|d[w-2]<<16,this.words[x]|=P<<$&67108863,this.words[x+1]=P>>>26-$&67108863,$+=24,$>=26&&($-=26,x++);else if(_==="le")for(w=0,x=0;w<d.length;w+=3)P=d[w]|d[w+1]<<8|d[w+2]<<16,this.words[x]|=P<<$&67108863,this.words[x+1]=P>>>26-$&67108863,$+=24,$>=26&&($-=26,x++);return this.strip()};function p(k,d){var g=k.charCodeAt(d);return g>=65&&g<=70?g-55:g>=97&&g<=102?g-87:g-48&15}function v(k,d,g){var _=p(k,g);return g-1>=d&&(_|=p(k,g-1)<<4),_}c.prototype._parseHex=function(d,g,_){this.length=Math.ceil((d.length-g)/6),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var x=0,P=0,$;if(_==="be")for(w=d.length-1;w>=g;w-=2)$=v(d,g,w)<<x,this.words[P]|=$&67108863,x>=18?(x-=18,P+=1,this.words[P]|=$>>>26):x+=8;else{var T=d.length-g;for(w=T%2===0?g+1:g;w<d.length;w+=2)$=v(d,g,w)<<x,this.words[P]|=$&67108863,x>=18?(x-=18,P+=1,this.words[P]|=$>>>26):x+=8}this.strip()};function y(k,d,g,_){for(var w=0,x=Math.min(k.length,g),P=d;P<x;P++){var $=k.charCodeAt(P)-48;w*=_,$>=49?w+=$-49+10:$>=17?w+=$-17+10:w+=$}return w}c.prototype._parseBase=function(d,g,_){this.words=[0],this.length=1;for(var w=0,x=1;x<=67108863;x*=g)w++;w--,x=x/g|0;for(var P=d.length-_,$=P%w,T=Math.min(P,P-$)+_,m=0,M=_;M<T;M+=w)m=y(d,M,M+w,g),this.imuln(x),this.words[0]+m<67108864?this.words[0]+=m:this._iaddn(m);if($!==0){var W=1;for(m=y(d,M,d.length,g),M=0;M<$;M++)W*=g;this.imuln(W),this.words[0]+m<67108864?this.words[0]+=m:this._iaddn(m)}this.strip()},c.prototype.copy=function(d){d.words=new Array(this.length);for(var g=0;g<this.length;g++)d.words[g]=this.words[g];d.length=this.length,d.negative=this.negative,d.red=this.red},c.prototype.clone=function(){var d=new c(null);return this.copy(d),d},c.prototype._expand=function(d){for(;this.length<d;)this.words[this.length++]=0;return this},c.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},c.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},c.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var b=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],S=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],E=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];c.prototype.toString=function(d,g){d=d||10,g=g|0||1;var _;if(d===16||d==="hex"){_="";for(var w=0,x=0,P=0;P<this.length;P++){var $=this.words[P],T=(($<<w|x)&16777215).toString(16);x=$>>>24-w&16777215,x!==0||P!==this.length-1?_=b[6-T.length]+T+_:_=T+_,w+=2,w>=26&&(w-=26,P--)}for(x!==0&&(_=x.toString(16)+_);_.length%g!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}if(d===(d|0)&&d>=2&&d<=36){var m=S[d],M=E[d];_="";var W=this.clone();for(W.negative=0;!W.isZero();){var Y=W.modn(M).toString(d);W=W.idivn(M),W.isZero()?_=Y+_:_=b[m-Y.length]+Y+_}for(this.isZero()&&(_="0"+_);_.length%g!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}l(!1,"Base should be between 2 and 36")},c.prototype.toNumber=function(){var d=this.words[0];return this.length===2?d+=this.words[1]*67108864:this.length===3&&this.words[2]===1?d+=4503599627370496+this.words[1]*67108864:this.length>2&&l(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-d:d},c.prototype.toJSON=function(){return this.toString(16)},c.prototype.toBuffer=function(d,g){return l(typeof h<"u"),this.toArrayLike(h,d,g)},c.prototype.toArray=function(d,g){return this.toArrayLike(Array,d,g)},c.prototype.toArrayLike=function(d,g,_){var w=this.byteLength(),x=_||Math.max(1,w);l(w<=x,"byte array longer than desired length"),l(x>0,"Requested array length <= 0"),this.strip();var P=g==="le",$=new d(x),T,m,M=this.clone();if(P){for(m=0;!M.isZero();m++)T=M.andln(255),M.iushrn(8),$[m]=T;for(;m<x;m++)$[m]=0}else{for(m=0;m<x-w;m++)$[m]=0;for(m=0;!M.isZero();m++)T=M.andln(255),M.iushrn(8),$[x-m-1]=T}return $},Math.clz32?c.prototype._countBits=function(d){return 32-Math.clz32(d)}:c.prototype._countBits=function(d){var g=d,_=0;return g>=4096&&(_+=13,g>>>=13),g>=64&&(_+=7,g>>>=7),g>=8&&(_+=4,g>>>=4),g>=2&&(_+=2,g>>>=2),_+g},c.prototype._zeroBits=function(d){if(d===0)return 26;var g=d,_=0;return g&8191||(_+=13,g>>>=13),g&127||(_+=7,g>>>=7),g&15||(_+=4,g>>>=4),g&3||(_+=2,g>>>=2),g&1||_++,_},c.prototype.bitLength=function(){var d=this.words[this.length-1],g=this._countBits(d);return(this.length-1)*26+g};function R(k){for(var d=new Array(k.bitLength()),g=0;g<d.length;g++){var _=g/26|0,w=g%26;d[g]=(k.words[_]&1<<w)>>>w}return d}c.prototype.zeroBits=function(){if(this.isZero())return 0;for(var d=0,g=0;g<this.length;g++){var _=this._zeroBits(this.words[g]);if(d+=_,_!==26)break}return d},c.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},c.prototype.toTwos=function(d){return this.negative!==0?this.abs().inotn(d).iaddn(1):this.clone()},c.prototype.fromTwos=function(d){return this.testn(d-1)?this.notn(d).iaddn(1).ineg():this.clone()},c.prototype.isNeg=function(){return this.negative!==0},c.prototype.neg=function(){return this.clone().ineg()},c.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},c.prototype.iuor=function(d){for(;this.length<d.length;)this.words[this.length++]=0;for(var g=0;g<d.length;g++)this.words[g]=this.words[g]|d.words[g];return this.strip()},c.prototype.ior=function(d){return l((this.negative|d.negative)===0),this.iuor(d)},c.prototype.or=function(d){return this.length>d.length?this.clone().ior(d):d.clone().ior(this)},c.prototype.uor=function(d){return this.length>d.length?this.clone().iuor(d):d.clone().iuor(this)},c.prototype.iuand=function(d){var g;this.length>d.length?g=d:g=this;for(var _=0;_<g.length;_++)this.words[_]=this.words[_]&d.words[_];return this.length=g.length,this.strip()},c.prototype.iand=function(d){return l((this.negative|d.negative)===0),this.iuand(d)},c.prototype.and=function(d){return this.length>d.length?this.clone().iand(d):d.clone().iand(this)},c.prototype.uand=function(d){return this.length>d.length?this.clone().iuand(d):d.clone().iuand(this)},c.prototype.iuxor=function(d){var g,_;this.length>d.length?(g=this,_=d):(g=d,_=this);for(var w=0;w<_.length;w++)this.words[w]=g.words[w]^_.words[w];if(this!==g)for(;w<g.length;w++)this.words[w]=g.words[w];return this.length=g.length,this.strip()},c.prototype.ixor=function(d){return l((this.negative|d.negative)===0),this.iuxor(d)},c.prototype.xor=function(d){return this.length>d.length?this.clone().ixor(d):d.clone().ixor(this)},c.prototype.uxor=function(d){return this.length>d.length?this.clone().iuxor(d):d.clone().iuxor(this)},c.prototype.inotn=function(d){l(typeof d=="number"&&d>=0);var g=Math.ceil(d/26)|0,_=d%26;this._expand(g),_>0&&g--;for(var w=0;w<g;w++)this.words[w]=~this.words[w]&67108863;return _>0&&(this.words[w]=~this.words[w]&67108863>>26-_),this.strip()},c.prototype.notn=function(d){return this.clone().inotn(d)},c.prototype.setn=function(d,g){l(typeof d=="number"&&d>=0);var _=d/26|0,w=d%26;return this._expand(_+1),g?this.words[_]=this.words[_]|1<<w:this.words[_]=this.words[_]&~(1<<w),this.strip()},c.prototype.iadd=function(d){var g;if(this.negative!==0&&d.negative===0)return this.negative=0,g=this.isub(d),this.negative^=1,this._normSign();if(this.negative===0&&d.negative!==0)return d.negative=0,g=this.isub(d),d.negative=1,g._normSign();var _,w;this.length>d.length?(_=this,w=d):(_=d,w=this);for(var x=0,P=0;P<w.length;P++)g=(_.words[P]|0)+(w.words[P]|0)+x,this.words[P]=g&67108863,x=g>>>26;for(;x!==0&&P<_.length;P++)g=(_.words[P]|0)+x,this.words[P]=g&67108863,x=g>>>26;if(this.length=_.length,x!==0)this.words[this.length]=x,this.length++;else if(_!==this)for(;P<_.length;P++)this.words[P]=_.words[P];return this},c.prototype.add=function(d){var g;return d.negative!==0&&this.negative===0?(d.negative=0,g=this.sub(d),d.negative^=1,g):d.negative===0&&this.negative!==0?(this.negative=0,g=d.sub(this),this.negative=1,g):this.length>d.length?this.clone().iadd(d):d.clone().iadd(this)},c.prototype.isub=function(d){if(d.negative!==0){d.negative=0;var g=this.iadd(d);return d.negative=1,g._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(d),this.negative=1,this._normSign();var _=this.cmp(d);if(_===0)return this.negative=0,this.length=1,this.words[0]=0,this;var w,x;_>0?(w=this,x=d):(w=d,x=this);for(var P=0,$=0;$<x.length;$++)g=(w.words[$]|0)-(x.words[$]|0)+P,P=g>>26,this.words[$]=g&67108863;for(;P!==0&&$<w.length;$++)g=(w.words[$]|0)+P,P=g>>26,this.words[$]=g&67108863;if(P===0&&$<w.length&&w!==this)for(;$<w.length;$++)this.words[$]=w.words[$];return this.length=Math.max(this.length,$),w!==this&&(this.negative=1),this.strip()},c.prototype.sub=function(d){return this.clone().isub(d)};function O(k,d,g){g.negative=d.negative^k.negative;var _=k.length+d.length|0;g.length=_,_=_-1|0;var w=k.words[0]|0,x=d.words[0]|0,P=w*x,$=P&67108863,T=P/67108864|0;g.words[0]=$;for(var m=1;m<_;m++){for(var M=T>>>26,W=T&67108863,Y=Math.min(m,d.length-1),ue=Math.max(0,m-k.length+1);ue<=Y;ue++){var ge=m-ue|0;w=k.words[ge]|0,x=d.words[ue]|0,P=w*x+W,M+=P/67108864|0,W=P&67108863}g.words[m]=W|0,T=M|0}return T!==0?g.words[m]=T|0:g.length--,g.strip()}var I=function(d,g,_){var w=d.words,x=g.words,P=_.words,$=0,T,m,M,W=w[0]|0,Y=W&8191,ue=W>>>13,ge=w[1]|0,he=ge&8191,ae=ge>>>13,de=w[2]|0,pe=de&8191,oe=de>>>13,le=w[3]|0,me=le&8191,xe=le>>>13,Ne=w[4]|0,Pe=Ne&8191,Ie=Ne>>>13,Ke=w[5]|0,Le=Ke&8191,Ce=Ke>>>13,at=w[6]|0,Oe=at&8191,De=at>>>13,yt=w[7]|0,Ue=yt&8191,ze=yt>>>13,Mt=w[8]|0,se=Mt&8191,j=Mt>>>13,X=w[9]|0,ce=X&8191,be=X>>>13,Re=x[0]|0,Se=Re&8191,qe=Re>>>13,bt=x[1]|0,je=bt&8191,We=bt>>>13,St=x[2]|0,ut=St&8191,vt=St>>>13,zt=x[3]|0,st=zt&8191,nt=zt>>>13,Vt=x[4]|0,tt=Vt&8191,ft=Vt>>>13,Ft=x[5]|0,Qe=Ft&8191,rt=Ft>>>13,Bt=x[6]|0,Xe=Bt&8191,ct=Bt>>>13,Ut=x[7]|0,Je=Ut&8191,it=Ut>>>13,qt=x[8]|0,et=qt&8191,ht=qt>>>13,ar=x[9]|0,dt=ar&8191,mt=ar>>>13;_.negative=d.negative^g.negative,_.length=19,T=Math.imul(Y,Se),m=Math.imul(Y,qe),m=m+Math.imul(ue,Se)|0,M=Math.imul(ue,qe);var Xt=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,T=Math.imul(he,Se),m=Math.imul(he,qe),m=m+Math.imul(ae,Se)|0,M=Math.imul(ae,qe),T=T+Math.imul(Y,je)|0,m=m+Math.imul(Y,We)|0,m=m+Math.imul(ue,je)|0,M=M+Math.imul(ue,We)|0;var er=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(er>>>26)|0,er&=67108863,T=Math.imul(pe,Se),m=Math.imul(pe,qe),m=m+Math.imul(oe,Se)|0,M=Math.imul(oe,qe),T=T+Math.imul(he,je)|0,m=m+Math.imul(he,We)|0,m=m+Math.imul(ae,je)|0,M=M+Math.imul(ae,We)|0,T=T+Math.imul(Y,ut)|0,m=m+Math.imul(Y,vt)|0,m=m+Math.imul(ue,ut)|0,M=M+Math.imul(ue,vt)|0;var kr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(kr>>>26)|0,kr&=67108863,T=Math.imul(me,Se),m=Math.imul(me,qe),m=m+Math.imul(xe,Se)|0,M=Math.imul(xe,qe),T=T+Math.imul(pe,je)|0,m=m+Math.imul(pe,We)|0,m=m+Math.imul(oe,je)|0,M=M+Math.imul(oe,We)|0,T=T+Math.imul(he,ut)|0,m=m+Math.imul(he,vt)|0,m=m+Math.imul(ae,ut)|0,M=M+Math.imul(ae,vt)|0,T=T+Math.imul(Y,st)|0,m=m+Math.imul(Y,nt)|0,m=m+Math.imul(ue,st)|0,M=M+Math.imul(ue,nt)|0;var Ar=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,T=Math.imul(Pe,Se),m=Math.imul(Pe,qe),m=m+Math.imul(Ie,Se)|0,M=Math.imul(Ie,qe),T=T+Math.imul(me,je)|0,m=m+Math.imul(me,We)|0,m=m+Math.imul(xe,je)|0,M=M+Math.imul(xe,We)|0,T=T+Math.imul(pe,ut)|0,m=m+Math.imul(pe,vt)|0,m=m+Math.imul(oe,ut)|0,M=M+Math.imul(oe,vt)|0,T=T+Math.imul(he,st)|0,m=m+Math.imul(he,nt)|0,m=m+Math.imul(ae,st)|0,M=M+Math.imul(ae,nt)|0,T=T+Math.imul(Y,tt)|0,m=m+Math.imul(Y,ft)|0,m=m+Math.imul(ue,tt)|0,M=M+Math.imul(ue,ft)|0;var Tr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Tr>>>26)|0,Tr&=67108863,T=Math.imul(Le,Se),m=Math.imul(Le,qe),m=m+Math.imul(Ce,Se)|0,M=Math.imul(Ce,qe),T=T+Math.imul(Pe,je)|0,m=m+Math.imul(Pe,We)|0,m=m+Math.imul(Ie,je)|0,M=M+Math.imul(Ie,We)|0,T=T+Math.imul(me,ut)|0,m=m+Math.imul(me,vt)|0,m=m+Math.imul(xe,ut)|0,M=M+Math.imul(xe,vt)|0,T=T+Math.imul(pe,st)|0,m=m+Math.imul(pe,nt)|0,m=m+Math.imul(oe,st)|0,M=M+Math.imul(oe,nt)|0,T=T+Math.imul(he,tt)|0,m=m+Math.imul(he,ft)|0,m=m+Math.imul(ae,tt)|0,M=M+Math.imul(ae,ft)|0,T=T+Math.imul(Y,Qe)|0,m=m+Math.imul(Y,rt)|0,m=m+Math.imul(ue,Qe)|0,M=M+Math.imul(ue,rt)|0;var Rr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,T=Math.imul(Oe,Se),m=Math.imul(Oe,qe),m=m+Math.imul(De,Se)|0,M=Math.imul(De,qe),T=T+Math.imul(Le,je)|0,m=m+Math.imul(Le,We)|0,m=m+Math.imul(Ce,je)|0,M=M+Math.imul(Ce,We)|0,T=T+Math.imul(Pe,ut)|0,m=m+Math.imul(Pe,vt)|0,m=m+Math.imul(Ie,ut)|0,M=M+Math.imul(Ie,vt)|0,T=T+Math.imul(me,st)|0,m=m+Math.imul(me,nt)|0,m=m+Math.imul(xe,st)|0,M=M+Math.imul(xe,nt)|0,T=T+Math.imul(pe,tt)|0,m=m+Math.imul(pe,ft)|0,m=m+Math.imul(oe,tt)|0,M=M+Math.imul(oe,ft)|0,T=T+Math.imul(he,Qe)|0,m=m+Math.imul(he,rt)|0,m=m+Math.imul(ae,Qe)|0,M=M+Math.imul(ae,rt)|0,T=T+Math.imul(Y,Xe)|0,m=m+Math.imul(Y,ct)|0,m=m+Math.imul(ue,Xe)|0,M=M+Math.imul(ue,ct)|0;var pr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(pr>>>26)|0,pr&=67108863,T=Math.imul(Ue,Se),m=Math.imul(Ue,qe),m=m+Math.imul(ze,Se)|0,M=Math.imul(ze,qe),T=T+Math.imul(Oe,je)|0,m=m+Math.imul(Oe,We)|0,m=m+Math.imul(De,je)|0,M=M+Math.imul(De,We)|0,T=T+Math.imul(Le,ut)|0,m=m+Math.imul(Le,vt)|0,m=m+Math.imul(Ce,ut)|0,M=M+Math.imul(Ce,vt)|0,T=T+Math.imul(Pe,st)|0,m=m+Math.imul(Pe,nt)|0,m=m+Math.imul(Ie,st)|0,M=M+Math.imul(Ie,nt)|0,T=T+Math.imul(me,tt)|0,m=m+Math.imul(me,ft)|0,m=m+Math.imul(xe,tt)|0,M=M+Math.imul(xe,ft)|0,T=T+Math.imul(pe,Qe)|0,m=m+Math.imul(pe,rt)|0,m=m+Math.imul(oe,Qe)|0,M=M+Math.imul(oe,rt)|0,T=T+Math.imul(he,Xe)|0,m=m+Math.imul(he,ct)|0,m=m+Math.imul(ae,Xe)|0,M=M+Math.imul(ae,ct)|0,T=T+Math.imul(Y,Je)|0,m=m+Math.imul(Y,it)|0,m=m+Math.imul(ue,Je)|0,M=M+Math.imul(ue,it)|0;var _r=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(_r>>>26)|0,_r&=67108863,T=Math.imul(se,Se),m=Math.imul(se,qe),m=m+Math.imul(j,Se)|0,M=Math.imul(j,qe),T=T+Math.imul(Ue,je)|0,m=m+Math.imul(Ue,We)|0,m=m+Math.imul(ze,je)|0,M=M+Math.imul(ze,We)|0,T=T+Math.imul(Oe,ut)|0,m=m+Math.imul(Oe,vt)|0,m=m+Math.imul(De,ut)|0,M=M+Math.imul(De,vt)|0,T=T+Math.imul(Le,st)|0,m=m+Math.imul(Le,nt)|0,m=m+Math.imul(Ce,st)|0,M=M+Math.imul(Ce,nt)|0,T=T+Math.imul(Pe,tt)|0,m=m+Math.imul(Pe,ft)|0,m=m+Math.imul(Ie,tt)|0,M=M+Math.imul(Ie,ft)|0,T=T+Math.imul(me,Qe)|0,m=m+Math.imul(me,rt)|0,m=m+Math.imul(xe,Qe)|0,M=M+Math.imul(xe,rt)|0,T=T+Math.imul(pe,Xe)|0,m=m+Math.imul(pe,ct)|0,m=m+Math.imul(oe,Xe)|0,M=M+Math.imul(oe,ct)|0,T=T+Math.imul(he,Je)|0,m=m+Math.imul(he,it)|0,m=m+Math.imul(ae,Je)|0,M=M+Math.imul(ae,it)|0,T=T+Math.imul(Y,et)|0,m=m+Math.imul(Y,ht)|0,m=m+Math.imul(ue,et)|0,M=M+Math.imul(ue,ht)|0;var fr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(fr>>>26)|0,fr&=67108863,T=Math.imul(ce,Se),m=Math.imul(ce,qe),m=m+Math.imul(be,Se)|0,M=Math.imul(be,qe),T=T+Math.imul(se,je)|0,m=m+Math.imul(se,We)|0,m=m+Math.imul(j,je)|0,M=M+Math.imul(j,We)|0,T=T+Math.imul(Ue,ut)|0,m=m+Math.imul(Ue,vt)|0,m=m+Math.imul(ze,ut)|0,M=M+Math.imul(ze,vt)|0,T=T+Math.imul(Oe,st)|0,m=m+Math.imul(Oe,nt)|0,m=m+Math.imul(De,st)|0,M=M+Math.imul(De,nt)|0,T=T+Math.imul(Le,tt)|0,m=m+Math.imul(Le,ft)|0,m=m+Math.imul(Ce,tt)|0,M=M+Math.imul(Ce,ft)|0,T=T+Math.imul(Pe,Qe)|0,m=m+Math.imul(Pe,rt)|0,m=m+Math.imul(Ie,Qe)|0,M=M+Math.imul(Ie,rt)|0,T=T+Math.imul(me,Xe)|0,m=m+Math.imul(me,ct)|0,m=m+Math.imul(xe,Xe)|0,M=M+Math.imul(xe,ct)|0,T=T+Math.imul(pe,Je)|0,m=m+Math.imul(pe,it)|0,m=m+Math.imul(oe,Je)|0,M=M+Math.imul(oe,it)|0,T=T+Math.imul(he,et)|0,m=m+Math.imul(he,ht)|0,m=m+Math.imul(ae,et)|0,M=M+Math.imul(ae,ht)|0,T=T+Math.imul(Y,dt)|0,m=m+Math.imul(Y,mt)|0,m=m+Math.imul(ue,dt)|0,M=M+Math.imul(ue,mt)|0;var Ht=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,T=Math.imul(ce,je),m=Math.imul(ce,We),m=m+Math.imul(be,je)|0,M=Math.imul(be,We),T=T+Math.imul(se,ut)|0,m=m+Math.imul(se,vt)|0,m=m+Math.imul(j,ut)|0,M=M+Math.imul(j,vt)|0,T=T+Math.imul(Ue,st)|0,m=m+Math.imul(Ue,nt)|0,m=m+Math.imul(ze,st)|0,M=M+Math.imul(ze,nt)|0,T=T+Math.imul(Oe,tt)|0,m=m+Math.imul(Oe,ft)|0,m=m+Math.imul(De,tt)|0,M=M+Math.imul(De,ft)|0,T=T+Math.imul(Le,Qe)|0,m=m+Math.imul(Le,rt)|0,m=m+Math.imul(Ce,Qe)|0,M=M+Math.imul(Ce,rt)|0,T=T+Math.imul(Pe,Xe)|0,m=m+Math.imul(Pe,ct)|0,m=m+Math.imul(Ie,Xe)|0,M=M+Math.imul(Ie,ct)|0,T=T+Math.imul(me,Je)|0,m=m+Math.imul(me,it)|0,m=m+Math.imul(xe,Je)|0,M=M+Math.imul(xe,it)|0,T=T+Math.imul(pe,et)|0,m=m+Math.imul(pe,ht)|0,m=m+Math.imul(oe,et)|0,M=M+Math.imul(oe,ht)|0,T=T+Math.imul(he,dt)|0,m=m+Math.imul(he,mt)|0,m=m+Math.imul(ae,dt)|0,M=M+Math.imul(ae,mt)|0;var Cr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,T=Math.imul(ce,ut),m=Math.imul(ce,vt),m=m+Math.imul(be,ut)|0,M=Math.imul(be,vt),T=T+Math.imul(se,st)|0,m=m+Math.imul(se,nt)|0,m=m+Math.imul(j,st)|0,M=M+Math.imul(j,nt)|0,T=T+Math.imul(Ue,tt)|0,m=m+Math.imul(Ue,ft)|0,m=m+Math.imul(ze,tt)|0,M=M+Math.imul(ze,ft)|0,T=T+Math.imul(Oe,Qe)|0,m=m+Math.imul(Oe,rt)|0,m=m+Math.imul(De,Qe)|0,M=M+Math.imul(De,rt)|0,T=T+Math.imul(Le,Xe)|0,m=m+Math.imul(Le,ct)|0,m=m+Math.imul(Ce,Xe)|0,M=M+Math.imul(Ce,ct)|0,T=T+Math.imul(Pe,Je)|0,m=m+Math.imul(Pe,it)|0,m=m+Math.imul(Ie,Je)|0,M=M+Math.imul(Ie,it)|0,T=T+Math.imul(me,et)|0,m=m+Math.imul(me,ht)|0,m=m+Math.imul(xe,et)|0,M=M+Math.imul(xe,ht)|0,T=T+Math.imul(pe,dt)|0,m=m+Math.imul(pe,mt)|0,m=m+Math.imul(oe,dt)|0,M=M+Math.imul(oe,mt)|0;var ur=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(ur>>>26)|0,ur&=67108863,T=Math.imul(ce,st),m=Math.imul(ce,nt),m=m+Math.imul(be,st)|0,M=Math.imul(be,nt),T=T+Math.imul(se,tt)|0,m=m+Math.imul(se,ft)|0,m=m+Math.imul(j,tt)|0,M=M+Math.imul(j,ft)|0,T=T+Math.imul(Ue,Qe)|0,m=m+Math.imul(Ue,rt)|0,m=m+Math.imul(ze,Qe)|0,M=M+Math.imul(ze,rt)|0,T=T+Math.imul(Oe,Xe)|0,m=m+Math.imul(Oe,ct)|0,m=m+Math.imul(De,Xe)|0,M=M+Math.imul(De,ct)|0,T=T+Math.imul(Le,Je)|0,m=m+Math.imul(Le,it)|0,m=m+Math.imul(Ce,Je)|0,M=M+Math.imul(Ce,it)|0,T=T+Math.imul(Pe,et)|0,m=m+Math.imul(Pe,ht)|0,m=m+Math.imul(Ie,et)|0,M=M+Math.imul(Ie,ht)|0,T=T+Math.imul(me,dt)|0,m=m+Math.imul(me,mt)|0,m=m+Math.imul(xe,dt)|0,M=M+Math.imul(xe,mt)|0;var wr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(wr>>>26)|0,wr&=67108863,T=Math.imul(ce,tt),m=Math.imul(ce,ft),m=m+Math.imul(be,tt)|0,M=Math.imul(be,ft),T=T+Math.imul(se,Qe)|0,m=m+Math.imul(se,rt)|0,m=m+Math.imul(j,Qe)|0,M=M+Math.imul(j,rt)|0,T=T+Math.imul(Ue,Xe)|0,m=m+Math.imul(Ue,ct)|0,m=m+Math.imul(ze,Xe)|0,M=M+Math.imul(ze,ct)|0,T=T+Math.imul(Oe,Je)|0,m=m+Math.imul(Oe,it)|0,m=m+Math.imul(De,Je)|0,M=M+Math.imul(De,it)|0,T=T+Math.imul(Le,et)|0,m=m+Math.imul(Le,ht)|0,m=m+Math.imul(Ce,et)|0,M=M+Math.imul(Ce,ht)|0,T=T+Math.imul(Pe,dt)|0,m=m+Math.imul(Pe,mt)|0,m=m+Math.imul(Ie,dt)|0,M=M+Math.imul(Ie,mt)|0;var yr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(yr>>>26)|0,yr&=67108863,T=Math.imul(ce,Qe),m=Math.imul(ce,rt),m=m+Math.imul(be,Qe)|0,M=Math.imul(be,rt),T=T+Math.imul(se,Xe)|0,m=m+Math.imul(se,ct)|0,m=m+Math.imul(j,Xe)|0,M=M+Math.imul(j,ct)|0,T=T+Math.imul(Ue,Je)|0,m=m+Math.imul(Ue,it)|0,m=m+Math.imul(ze,Je)|0,M=M+Math.imul(ze,it)|0,T=T+Math.imul(Oe,et)|0,m=m+Math.imul(Oe,ht)|0,m=m+Math.imul(De,et)|0,M=M+Math.imul(De,ht)|0,T=T+Math.imul(Le,dt)|0,m=m+Math.imul(Le,mt)|0,m=m+Math.imul(Ce,dt)|0,M=M+Math.imul(Ce,mt)|0;var Mr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,T=Math.imul(ce,Xe),m=Math.imul(ce,ct),m=m+Math.imul(be,Xe)|0,M=Math.imul(be,ct),T=T+Math.imul(se,Je)|0,m=m+Math.imul(se,it)|0,m=m+Math.imul(j,Je)|0,M=M+Math.imul(j,it)|0,T=T+Math.imul(Ue,et)|0,m=m+Math.imul(Ue,ht)|0,m=m+Math.imul(ze,et)|0,M=M+Math.imul(ze,ht)|0,T=T+Math.imul(Oe,dt)|0,m=m+Math.imul(Oe,mt)|0,m=m+Math.imul(De,dt)|0,M=M+Math.imul(De,mt)|0;var Er=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Er>>>26)|0,Er&=67108863,T=Math.imul(ce,Je),m=Math.imul(ce,it),m=m+Math.imul(be,Je)|0,M=Math.imul(be,it),T=T+Math.imul(se,et)|0,m=m+Math.imul(se,ht)|0,m=m+Math.imul(j,et)|0,M=M+Math.imul(j,ht)|0,T=T+Math.imul(Ue,dt)|0,m=m+Math.imul(Ue,mt)|0,m=m+Math.imul(ze,dt)|0,M=M+Math.imul(ze,mt)|0;var gr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(gr>>>26)|0,gr&=67108863,T=Math.imul(ce,et),m=Math.imul(ce,ht),m=m+Math.imul(be,et)|0,M=Math.imul(be,ht),T=T+Math.imul(se,dt)|0,m=m+Math.imul(se,mt)|0,m=m+Math.imul(j,dt)|0,M=M+Math.imul(j,mt)|0;var sr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(sr>>>26)|0,sr&=67108863,T=Math.imul(ce,dt),m=Math.imul(ce,mt),m=m+Math.imul(be,dt)|0,M=Math.imul(be,mt);var Ir=($+T|0)+((m&8191)<<13)|0;return $=(M+(m>>>13)|0)+(Ir>>>26)|0,Ir&=67108863,P[0]=Xt,P[1]=er,P[2]=kr,P[3]=Ar,P[4]=Tr,P[5]=Rr,P[6]=pr,P[7]=_r,P[8]=fr,P[9]=Ht,P[10]=Cr,P[11]=ur,P[12]=wr,P[13]=yr,P[14]=Mr,P[15]=Er,P[16]=gr,P[17]=sr,P[18]=Ir,$!==0&&(P[19]=$,_.length++),_};Math.imul||(I=O);function B(k,d,g){g.negative=d.negative^k.negative,g.length=k.length+d.length;for(var _=0,w=0,x=0;x<g.length-1;x++){var P=w;w=0;for(var $=_&67108863,T=Math.min(x,d.length-1),m=Math.max(0,x-k.length+1);m<=T;m++){var M=x-m,W=k.words[M]|0,Y=d.words[m]|0,ue=W*Y,ge=ue&67108863;P=P+(ue/67108864|0)|0,ge=ge+$|0,$=ge&67108863,P=P+(ge>>>26)|0,w+=P>>>26,P&=67108863}g.words[x]=$,_=P,P=w}return _!==0?g.words[x]=_:g.length--,g.strip()}function N(k,d,g){var _=new D;return _.mulp(k,d,g)}c.prototype.mulTo=function(d,g){var _,w=this.length+d.length;return this.length===10&&d.length===10?_=I(this,d,g):w<63?_=O(this,d,g):w<1024?_=B(this,d,g):_=N(this,d,g),_};function D(k,d){this.x=k,this.y=d}D.prototype.makeRBT=function(d){for(var g=new Array(d),_=c.prototype._countBits(d)-1,w=0;w<d;w++)g[w]=this.revBin(w,_,d);return g},D.prototype.revBin=function(d,g,_){if(d===0||d===_-1)return d;for(var w=0,x=0;x<g;x++)w|=(d&1)<<g-x-1,d>>=1;return w},D.prototype.permute=function(d,g,_,w,x,P){for(var $=0;$<P;$++)w[$]=g[d[$]],x[$]=_[d[$]]},D.prototype.transform=function(d,g,_,w,x,P){this.permute(P,d,g,_,w,x);for(var $=1;$<x;$<<=1)for(var T=$<<1,m=Math.cos(2*Math.PI/T),M=Math.sin(2*Math.PI/T),W=0;W<x;W+=T)for(var Y=m,ue=M,ge=0;ge<$;ge++){var he=_[W+ge],ae=w[W+ge],de=_[W+ge+$],pe=w[W+ge+$],oe=Y*de-ue*pe;pe=Y*pe+ue*de,de=oe,_[W+ge]=he+de,w[W+ge]=ae+pe,_[W+ge+$]=he-de,w[W+ge+$]=ae-pe,ge!==T&&(oe=m*Y-M*ue,ue=m*ue+M*Y,Y=oe)}},D.prototype.guessLen13b=function(d,g){var _=Math.max(g,d)|1,w=_&1,x=0;for(_=_/2|0;_;_=_>>>1)x++;return 1<<x+1+w},D.prototype.conjugate=function(d,g,_){if(!(_<=1))for(var w=0;w<_/2;w++){var x=d[w];d[w]=d[_-w-1],d[_-w-1]=x,x=g[w],g[w]=-g[_-w-1],g[_-w-1]=-x}},D.prototype.normalize13b=function(d,g){for(var _=0,w=0;w<g/2;w++){var x=Math.round(d[2*w+1]/g)*8192+Math.round(d[2*w]/g)+_;d[w]=x&67108863,x<67108864?_=0:_=x/67108864|0}return d},D.prototype.convert13b=function(d,g,_,w){for(var x=0,P=0;P<g;P++)x=x+(d[P]|0),_[2*P]=x&8191,x=x>>>13,_[2*P+1]=x&8191,x=x>>>13;for(P=2*g;P<w;++P)_[P]=0;l(x===0),l((x&-8192)===0)},D.prototype.stub=function(d){for(var g=new Array(d),_=0;_<d;_++)g[_]=0;return g},D.prototype.mulp=function(d,g,_){var w=2*this.guessLen13b(d.length,g.length),x=this.makeRBT(w),P=this.stub(w),$=new Array(w),T=new Array(w),m=new Array(w),M=new Array(w),W=new Array(w),Y=new Array(w),ue=_.words;ue.length=w,this.convert13b(d.words,d.length,$,w),this.convert13b(g.words,g.length,M,w),this.transform($,P,T,m,w,x),this.transform(M,P,W,Y,w,x);for(var ge=0;ge<w;ge++){var he=T[ge]*W[ge]-m[ge]*Y[ge];m[ge]=T[ge]*Y[ge]+m[ge]*W[ge],T[ge]=he}return this.conjugate(T,m,w),this.transform(T,m,ue,P,w,x),this.conjugate(ue,P,w),this.normalize13b(ue,w),_.negative=d.negative^g.negative,_.length=d.length+g.length,_.strip()},c.prototype.mul=function(d){var g=new c(null);return g.words=new Array(this.length+d.length),this.mulTo(d,g)},c.prototype.mulf=function(d){var g=new c(null);return g.words=new Array(this.length+d.length),N(this,d,g)},c.prototype.imul=function(d){return this.clone().mulTo(d,this)},c.prototype.imuln=function(d){l(typeof d=="number"),l(d<67108864);for(var g=0,_=0;_<this.length;_++){var w=(this.words[_]|0)*d,x=(w&67108863)+(g&67108863);g>>=26,g+=w/67108864|0,g+=x>>>26,this.words[_]=x&67108863}return g!==0&&(this.words[_]=g,this.length++),this},c.prototype.muln=function(d){return this.clone().imuln(d)},c.prototype.sqr=function(){return this.mul(this)},c.prototype.isqr=function(){return this.imul(this.clone())},c.prototype.pow=function(d){var g=R(d);if(g.length===0)return new c(1);for(var _=this,w=0;w<g.length&&g[w]===0;w++,_=_.sqr());if(++w<g.length)for(var x=_.sqr();w<g.length;w++,x=x.sqr())g[w]!==0&&(_=_.mul(x));return _},c.prototype.iushln=function(d){l(typeof d=="number"&&d>=0);var g=d%26,_=(d-g)/26,w=67108863>>>26-g<<26-g,x;if(g!==0){var P=0;for(x=0;x<this.length;x++){var $=this.words[x]&w,T=(this.words[x]|0)-$<<g;this.words[x]=T|P,P=$>>>26-g}P&&(this.words[x]=P,this.length++)}if(_!==0){for(x=this.length-1;x>=0;x--)this.words[x+_]=this.words[x];for(x=0;x<_;x++)this.words[x]=0;this.length+=_}return this.strip()},c.prototype.ishln=function(d){return l(this.negative===0),this.iushln(d)},c.prototype.iushrn=function(d,g,_){l(typeof d=="number"&&d>=0);var w;g?w=(g-g%26)/26:w=0;var x=d%26,P=Math.min((d-x)/26,this.length),$=67108863^67108863>>>x<<x,T=_;if(w-=P,w=Math.max(0,w),T){for(var m=0;m<P;m++)T.words[m]=this.words[m];T.length=P}if(P!==0)if(this.length>P)for(this.length-=P,m=0;m<this.length;m++)this.words[m]=this.words[m+P];else this.words[0]=0,this.length=1;var M=0;for(m=this.length-1;m>=0&&(M!==0||m>=w);m--){var W=this.words[m]|0;this.words[m]=M<<26-x|W>>>x,M=W&$}return T&&M!==0&&(T.words[T.length++]=M),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},c.prototype.ishrn=function(d,g,_){return l(this.negative===0),this.iushrn(d,g,_)},c.prototype.shln=function(d){return this.clone().ishln(d)},c.prototype.ushln=function(d){return this.clone().iushln(d)},c.prototype.shrn=function(d){return this.clone().ishrn(d)},c.prototype.ushrn=function(d){return this.clone().iushrn(d)},c.prototype.testn=function(d){l(typeof d=="number"&&d>=0);var g=d%26,_=(d-g)/26,w=1<<g;if(this.length<=_)return!1;var x=this.words[_];return!!(x&w)},c.prototype.imaskn=function(d){l(typeof d=="number"&&d>=0);var g=d%26,_=(d-g)/26;if(l(this.negative===0,"imaskn works only with positive numbers"),this.length<=_)return this;if(g!==0&&_++,this.length=Math.min(_,this.length),g!==0){var w=67108863^67108863>>>g<<g;this.words[this.length-1]&=w}return this.strip()},c.prototype.maskn=function(d){return this.clone().imaskn(d)},c.prototype.iaddn=function(d){return l(typeof d=="number"),l(d<67108864),d<0?this.isubn(-d):this.negative!==0?this.length===1&&(this.words[0]|0)<d?(this.words[0]=d-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(d),this.negative=1,this):this._iaddn(d)},c.prototype._iaddn=function(d){this.words[0]+=d;for(var g=0;g<this.length&&this.words[g]>=67108864;g++)this.words[g]-=67108864,g===this.length-1?this.words[g+1]=1:this.words[g+1]++;return this.length=Math.max(this.length,g+1),this},c.prototype.isubn=function(d){if(l(typeof d=="number"),l(d<67108864),d<0)return this.iaddn(-d);if(this.negative!==0)return this.negative=0,this.iaddn(d),this.negative=1,this;if(this.words[0]-=d,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var g=0;g<this.length&&this.words[g]<0;g++)this.words[g]+=67108864,this.words[g+1]-=1;return this.strip()},c.prototype.addn=function(d){return this.clone().iaddn(d)},c.prototype.subn=function(d){return this.clone().isubn(d)},c.prototype.iabs=function(){return this.negative=0,this},c.prototype.abs=function(){return this.clone().iabs()},c.prototype._ishlnsubmul=function(d,g,_){var w=d.length+_,x;this._expand(w);var P,$=0;for(x=0;x<d.length;x++){P=(this.words[x+_]|0)+$;var T=(d.words[x]|0)*g;P-=T&67108863,$=(P>>26)-(T/67108864|0),this.words[x+_]=P&67108863}for(;x<this.length-_;x++)P=(this.words[x+_]|0)+$,$=P>>26,this.words[x+_]=P&67108863;if($===0)return this.strip();for(l($===-1),$=0,x=0;x<this.length;x++)P=-(this.words[x]|0)+$,$=P>>26,this.words[x]=P&67108863;return this.negative=1,this.strip()},c.prototype._wordDiv=function(d,g){var _=this.length-d.length,w=this.clone(),x=d,P=x.words[x.length-1]|0,$=this._countBits(P);_=26-$,_!==0&&(x=x.ushln(_),w.iushln(_),P=x.words[x.length-1]|0);var T=w.length-x.length,m;if(g!=="mod"){m=new c(null),m.length=T+1,m.words=new Array(m.length);for(var M=0;M<m.length;M++)m.words[M]=0}var W=w.clone()._ishlnsubmul(x,1,T);W.negative===0&&(w=W,m&&(m.words[T]=1));for(var Y=T-1;Y>=0;Y--){var ue=(w.words[x.length+Y]|0)*67108864+(w.words[x.length+Y-1]|0);for(ue=Math.min(ue/P|0,67108863),w._ishlnsubmul(x,ue,Y);w.negative!==0;)ue--,w.negative=0,w._ishlnsubmul(x,1,Y),w.isZero()||(w.negative^=1);m&&(m.words[Y]=ue)}return m&&m.strip(),w.strip(),g!=="div"&&_!==0&&w.iushrn(_),{div:m||null,mod:w}},c.prototype.divmod=function(d,g,_){if(l(!d.isZero()),this.isZero())return{div:new c(0),mod:new c(0)};var w,x,P;return this.negative!==0&&d.negative===0?(P=this.neg().divmod(d,g),g!=="mod"&&(w=P.div.neg()),g!=="div"&&(x=P.mod.neg(),_&&x.negative!==0&&x.iadd(d)),{div:w,mod:x}):this.negative===0&&d.negative!==0?(P=this.divmod(d.neg(),g),g!=="mod"&&(w=P.div.neg()),{div:w,mod:P.mod}):this.negative&d.negative?(P=this.neg().divmod(d.neg(),g),g!=="div"&&(x=P.mod.neg(),_&&x.negative!==0&&x.isub(d)),{div:P.div,mod:x}):d.length>this.length||this.cmp(d)<0?{div:new c(0),mod:this}:d.length===1?g==="div"?{div:this.divn(d.words[0]),mod:null}:g==="mod"?{div:null,mod:new c(this.modn(d.words[0]))}:{div:this.divn(d.words[0]),mod:new c(this.modn(d.words[0]))}:this._wordDiv(d,g)},c.prototype.div=function(d){return this.divmod(d,"div",!1).div},c.prototype.mod=function(d){return this.divmod(d,"mod",!1).mod},c.prototype.umod=function(d){return this.divmod(d,"mod",!0).mod},c.prototype.divRound=function(d){var g=this.divmod(d);if(g.mod.isZero())return g.div;var _=g.div.negative!==0?g.mod.isub(d):g.mod,w=d.ushrn(1),x=d.andln(1),P=_.cmp(w);return P<0||x===1&&P===0?g.div:g.div.negative!==0?g.div.isubn(1):g.div.iaddn(1)},c.prototype.modn=function(d){l(d<=67108863);for(var g=(1<<26)%d,_=0,w=this.length-1;w>=0;w--)_=(g*_+(this.words[w]|0))%d;return _},c.prototype.idivn=function(d){l(d<=67108863);for(var g=0,_=this.length-1;_>=0;_--){var w=(this.words[_]|0)+g*67108864;this.words[_]=w/d|0,g=w%d}return this.strip()},c.prototype.divn=function(d){return this.clone().idivn(d)},c.prototype.egcd=function(d){l(d.negative===0),l(!d.isZero());var g=this,_=d.clone();g.negative!==0?g=g.umod(d):g=g.clone();for(var w=new c(1),x=new c(0),P=new c(0),$=new c(1),T=0;g.isEven()&&_.isEven();)g.iushrn(1),_.iushrn(1),++T;for(var m=_.clone(),M=g.clone();!g.isZero();){for(var W=0,Y=1;!(g.words[0]&Y)&&W<26;++W,Y<<=1);if(W>0)for(g.iushrn(W);W-- >0;)(w.isOdd()||x.isOdd())&&(w.iadd(m),x.isub(M)),w.iushrn(1),x.iushrn(1);for(var ue=0,ge=1;!(_.words[0]&ge)&&ue<26;++ue,ge<<=1);if(ue>0)for(_.iushrn(ue);ue-- >0;)(P.isOdd()||$.isOdd())&&(P.iadd(m),$.isub(M)),P.iushrn(1),$.iushrn(1);g.cmp(_)>=0?(g.isub(_),w.isub(P),x.isub($)):(_.isub(g),P.isub(w),$.isub(x))}return{a:P,b:$,gcd:_.iushln(T)}},c.prototype._invmp=function(d){l(d.negative===0),l(!d.isZero());var g=this,_=d.clone();g.negative!==0?g=g.umod(d):g=g.clone();for(var w=new c(1),x=new c(0),P=_.clone();g.cmpn(1)>0&&_.cmpn(1)>0;){for(var $=0,T=1;!(g.words[0]&T)&&$<26;++$,T<<=1);if($>0)for(g.iushrn($);$-- >0;)w.isOdd()&&w.iadd(P),w.iushrn(1);for(var m=0,M=1;!(_.words[0]&M)&&m<26;++m,M<<=1);if(m>0)for(_.iushrn(m);m-- >0;)x.isOdd()&&x.iadd(P),x.iushrn(1);g.cmp(_)>=0?(g.isub(_),w.isub(x)):(_.isub(g),x.isub(w))}var W;return g.cmpn(1)===0?W=w:W=x,W.cmpn(0)<0&&W.iadd(d),W},c.prototype.gcd=function(d){if(this.isZero())return d.abs();if(d.isZero())return this.abs();var g=this.clone(),_=d.clone();g.negative=0,_.negative=0;for(var w=0;g.isEven()&&_.isEven();w++)g.iushrn(1),_.iushrn(1);do{for(;g.isEven();)g.iushrn(1);for(;_.isEven();)_.iushrn(1);var x=g.cmp(_);if(x<0){var P=g;g=_,_=P}else if(x===0||_.cmpn(1)===0)break;g.isub(_)}while(!0);return _.iushln(w)},c.prototype.invm=function(d){return this.egcd(d).a.umod(d)},c.prototype.isEven=function(){return(this.words[0]&1)===0},c.prototype.isOdd=function(){return(this.words[0]&1)===1},c.prototype.andln=function(d){return this.words[0]&d},c.prototype.bincn=function(d){l(typeof d=="number");var g=d%26,_=(d-g)/26,w=1<<g;if(this.length<=_)return this._expand(_+1),this.words[_]|=w,this;for(var x=w,P=_;x!==0&&P<this.length;P++){var $=this.words[P]|0;$+=x,x=$>>>26,$&=67108863,this.words[P]=$}return x!==0&&(this.words[P]=x,this.length++),this},c.prototype.isZero=function(){return this.length===1&&this.words[0]===0},c.prototype.cmpn=function(d){var g=d<0;if(this.negative!==0&&!g)return-1;if(this.negative===0&&g)return 1;this.strip();var _;if(this.length>1)_=1;else{g&&(d=-d),l(d<=67108863,"Number is too big");var w=this.words[0]|0;_=w===d?0:w<d?-1:1}return this.negative!==0?-_|0:_},c.prototype.cmp=function(d){if(this.negative!==0&&d.negative===0)return-1;if(this.negative===0&&d.negative!==0)return 1;var g=this.ucmp(d);return this.negative!==0?-g|0:g},c.prototype.ucmp=function(d){if(this.length>d.length)return 1;if(this.length<d.length)return-1;for(var g=0,_=this.length-1;_>=0;_--){var w=this.words[_]|0,x=d.words[_]|0;if(w!==x){w<x?g=-1:w>x&&(g=1);break}}return g},c.prototype.gtn=function(d){return this.cmpn(d)===1},c.prototype.gt=function(d){return this.cmp(d)===1},c.prototype.gten=function(d){return this.cmpn(d)>=0},c.prototype.gte=function(d){return this.cmp(d)>=0},c.prototype.ltn=function(d){return this.cmpn(d)===-1},c.prototype.lt=function(d){return this.cmp(d)===-1},c.prototype.lten=function(d){return this.cmpn(d)<=0},c.prototype.lte=function(d){return this.cmp(d)<=0},c.prototype.eqn=function(d){return this.cmpn(d)===0},c.prototype.eq=function(d){return this.cmp(d)===0},c.red=function(d){return new Q(d)},c.prototype.toRed=function(d){return l(!this.red,"Already a number in reduction context"),l(this.negative===0,"red works only with positives"),d.convertTo(this)._forceRed(d)},c.prototype.fromRed=function(){return l(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},c.prototype._forceRed=function(d){return this.red=d,this},c.prototype.forceRed=function(d){return l(!this.red,"Already a number in reduction context"),this._forceRed(d)},c.prototype.redAdd=function(d){return l(this.red,"redAdd works only with red numbers"),this.red.add(this,d)},c.prototype.redIAdd=function(d){return l(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,d)},c.prototype.redSub=function(d){return l(this.red,"redSub works only with red numbers"),this.red.sub(this,d)},c.prototype.redISub=function(d){return l(this.red,"redISub works only with red numbers"),this.red.isub(this,d)},c.prototype.redShl=function(d){return l(this.red,"redShl works only with red numbers"),this.red.shl(this,d)},c.prototype.redMul=function(d){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.mul(this,d)},c.prototype.redIMul=function(d){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.imul(this,d)},c.prototype.redSqr=function(){return l(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},c.prototype.redISqr=function(){return l(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},c.prototype.redSqrt=function(){return l(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},c.prototype.redInvm=function(){return l(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},c.prototype.redNeg=function(){return l(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},c.prototype.redPow=function(d){return l(this.red&&!d.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,d)};var G={k256:null,p224:null,p192:null,p25519:null};function V(k,d){this.name=k,this.p=new c(d,16),this.n=this.p.bitLength(),this.k=new c(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}V.prototype._tmp=function(){var d=new c(null);return d.words=new Array(Math.ceil(this.n/13)),d},V.prototype.ireduce=function(d){var g=d,_;do this.split(g,this.tmp),g=this.imulK(g),g=g.iadd(this.tmp),_=g.bitLength();while(_>this.n);var w=_<this.n?-1:g.ucmp(this.p);return w===0?(g.words[0]=0,g.length=1):w>0?g.isub(this.p):g.strip!==void 0?g.strip():g._strip(),g},V.prototype.split=function(d,g){d.iushrn(this.n,0,g)},V.prototype.imulK=function(d){return d.imul(this.k)};function U(){V.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}f(U,V),U.prototype.split=function(d,g){for(var _=4194303,w=Math.min(d.length,9),x=0;x<w;x++)g.words[x]=d.words[x];if(g.length=w,d.length<=9){d.words[0]=0,d.length=1;return}var P=d.words[9];for(g.words[g.length++]=P&_,x=10;x<d.length;x++){var $=d.words[x]|0;d.words[x-10]=($&_)<<4|P>>>22,P=$}P>>>=22,d.words[x-10]=P,P===0&&d.length>10?d.length-=10:d.length-=9},U.prototype.imulK=function(d){d.words[d.length]=0,d.words[d.length+1]=0,d.length+=2;for(var g=0,_=0;_<d.length;_++){var w=d.words[_]|0;g+=w*977,d.words[_]=g&67108863,g=w*64+(g/67108864|0)}return d.words[d.length-1]===0&&(d.length--,d.words[d.length-1]===0&&d.length--),d};function te(){V.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}f(te,V);function Z(){V.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}f(Z,V);function J(){V.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}f(J,V),J.prototype.imulK=function(d){for(var g=0,_=0;_<d.length;_++){var w=(d.words[_]|0)*19+g,x=w&67108863;w>>>=26,d.words[_]=x,g=w}return g!==0&&(d.words[d.length++]=g),d},c._prime=function(d){if(G[d])return G[d];var g;if(d==="k256")g=new U;else if(d==="p224")g=new te;else if(d==="p192")g=new Z;else if(d==="p25519")g=new J;else throw new Error("Unknown prime "+d);return G[d]=g,g};function Q(k){if(typeof k=="string"){var d=c._prime(k);this.m=d.p,this.prime=d}else l(k.gtn(1),"modulus must be greater than 1"),this.m=k,this.prime=null}Q.prototype._verify1=function(d){l(d.negative===0,"red works only with positives"),l(d.red,"red works only with red numbers")},Q.prototype._verify2=function(d,g){l((d.negative|g.negative)===0,"red works only with positives"),l(d.red&&d.red===g.red,"red works only with red numbers")},Q.prototype.imod=function(d){return this.prime?this.prime.ireduce(d)._forceRed(this):d.umod(this.m)._forceRed(this)},Q.prototype.neg=function(d){return d.isZero()?d.clone():this.m.sub(d)._forceRed(this)},Q.prototype.add=function(d,g){this._verify2(d,g);var _=d.add(g);return _.cmp(this.m)>=0&&_.isub(this.m),_._forceRed(this)},Q.prototype.iadd=function(d,g){this._verify2(d,g);var _=d.iadd(g);return _.cmp(this.m)>=0&&_.isub(this.m),_},Q.prototype.sub=function(d,g){this._verify2(d,g);var _=d.sub(g);return _.cmpn(0)<0&&_.iadd(this.m),_._forceRed(this)},Q.prototype.isub=function(d,g){this._verify2(d,g);var _=d.isub(g);return _.cmpn(0)<0&&_.iadd(this.m),_},Q.prototype.shl=function(d,g){return this._verify1(d),this.imod(d.ushln(g))},Q.prototype.imul=function(d,g){return this._verify2(d,g),this.imod(d.imul(g))},Q.prototype.mul=function(d,g){return this._verify2(d,g),this.imod(d.mul(g))},Q.prototype.isqr=function(d){return this.imul(d,d.clone())},Q.prototype.sqr=function(d){return this.mul(d,d)},Q.prototype.sqrt=function(d){if(d.isZero())return d.clone();var g=this.m.andln(3);if(l(g%2===1),g===3){var _=this.m.add(new c(1)).iushrn(2);return this.pow(d,_)}for(var w=this.m.subn(1),x=0;!w.isZero()&&w.andln(1)===0;)x++,w.iushrn(1);l(!w.isZero());var P=new c(1).toRed(this),$=P.redNeg(),T=this.m.subn(1).iushrn(1),m=this.m.bitLength();for(m=new c(2*m*m).toRed(this);this.pow(m,T).cmp($)!==0;)m.redIAdd($);for(var M=this.pow(m,w),W=this.pow(d,w.addn(1).iushrn(1)),Y=this.pow(d,w),ue=x;Y.cmp(P)!==0;){for(var ge=Y,he=0;ge.cmp(P)!==0;he++)ge=ge.redSqr();l(he<ue);var ae=this.pow(M,new c(1).iushln(ue-he-1));W=W.redMul(ae),M=ae.redSqr(),Y=Y.redMul(M),ue=he}return W},Q.prototype.invm=function(d){var g=d._invmp(this.m);return g.negative!==0?(g.negative=0,this.imod(g).redNeg()):this.imod(g)},Q.prototype.pow=function(d,g){if(g.isZero())return new c(1).toRed(this);if(g.cmpn(1)===0)return d.clone();var _=4,w=new Array(1<<_);w[0]=new c(1).toRed(this),w[1]=d;for(var x=2;x<w.length;x++)w[x]=this.mul(w[x-1],d);var P=w[0],$=0,T=0,m=g.bitLength()%26;for(m===0&&(m=26),x=g.length-1;x>=0;x--){for(var M=g.words[x],W=m-1;W>=0;W--){var Y=M>>W&1;if(P!==w[0]&&(P=this.sqr(P)),Y===0&&$===0){T=0;continue}$<<=1,$|=Y,T++,!(T!==_&&(x!==0||W!==0))&&(P=this.mul(P,w[$]),T=0,$=0)}m=26}return P},Q.prototype.convertTo=function(d){var g=d.umod(this.m);return g===d?g.clone():g},Q.prototype.convertFrom=function(d){var g=d.clone();return g.red=null,g},c.mont=function(d){return new ee(d)};function ee(k){Q.call(this,k),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new c(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}f(ee,Q),ee.prototype.convertTo=function(d){return this.imod(d.ushln(this.shift))},ee.prototype.convertFrom=function(d){var g=this.imod(d.mul(this.rinv));return g.red=null,g},ee.prototype.imul=function(d,g){if(d.isZero()||g.isZero())return d.words[0]=0,d.length=1,d;var _=d.imul(g),w=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=_.isub(w).iushrn(this.shift),P=x;return x.cmp(this.m)>=0?P=x.isub(this.m):x.cmpn(0)<0&&(P=x.iadd(this.m)),P._forceRed(this)},ee.prototype.mul=function(d,g){if(d.isZero()||g.isZero())return new c(0)._forceRed(this);var _=d.mul(g),w=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=_.isub(w).iushrn(this.shift),P=x;return x.cmp(this.m)>=0?P=x.isub(this.m):x.cmpn(0)<0&&(P=x.iadd(this.m)),P._forceRed(this)},ee.prototype.invm=function(d){var g=this.imod(d._invmp(this.m).mul(this.r2));return g._forceRed(this)}})(s,bn$2)}(bn$3)),bn$3.exports}var browser$2,hasRequiredBrowser$2;function requireBrowser$2(){if(hasRequiredBrowser$2)return browser$2;hasRequiredBrowser$2=1;var s=requireElliptic(),a=requireBn$1();browser$2=function(h){return new l(h)};var u={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};u.p224=u.secp224r1,u.p256=u.secp256r1=u.prime256v1,u.p192=u.secp192r1=u.prime192v1,u.p384=u.secp384r1,u.p521=u.secp521r1;function l(c){this.curveType=u[c],this.curveType||(this.curveType={name:c}),this.curve=new s.ec(this.curveType.name),this.keys=void 0}l.prototype.generateKeys=function(c,h){return this.keys=this.curve.genKeyPair(),this.getPublicKey(c,h)},l.prototype.computeSecret=function(c,h,p){h=h||"utf8",distExports.Buffer.isBuffer(c)||(c=new distExports.Buffer(c,h));var v=this.curve.keyFromPublic(c).getPublic(),y=v.mul(this.keys.getPrivate()).getX();return f(y,p,this.curveType.byteLength)},l.prototype.getPublicKey=function(c,h){var p=this.keys.getPublic(h==="compressed",!0);return h==="hybrid"&&(p[p.length-1]%2?p[0]=7:p[0]=6),f(p,c)},l.prototype.getPrivateKey=function(c){return f(this.keys.getPrivate(),c)},l.prototype.setPublicKey=function(c,h){return h=h||"utf8",distExports.Buffer.isBuffer(c)||(c=new distExports.Buffer(c,h)),this.keys._importPublic(c),this},l.prototype.setPrivateKey=function(c,h){h=h||"utf8",distExports.Buffer.isBuffer(c)||(c=new distExports.Buffer(c,h));var p=new a(c);return p=p.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(p),this};function f(c,h,p){Array.isArray(c)||(c=c.toArray());var v=new distExports.Buffer(c);if(p&&v.length<p){var y=new distExports.Buffer(p-v.length);y.fill(0),v=distExports.Buffer.concat([y,v])}return h?v.toString(h):v}return browser$2}var browser$1={},mgf,hasRequiredMgf;function requireMgf(){if(hasRequiredMgf)return mgf;hasRequiredMgf=1;var s=requireBrowser$9(),a=requireSafeBuffer$2().Buffer;mgf=function(l,f){for(var c=a.alloc(0),h=0,p;c.length<f;)p=u(h++),c=a.concat([c,s("sha1").update(l).update(p).digest()]);return c.slice(0,f)};function u(l){var f=a.allocUnsafe(4);return f.writeUInt32BE(l,0),f}return mgf}var xor,hasRequiredXor;function requireXor(){return hasRequiredXor||(hasRequiredXor=1,xor=function(a,u){for(var l=a.length,f=-1;++f<l;)a[f]^=u[f];return a}),xor}var bn$1={exports:{}},bn=bn$1.exports,hasRequiredBn;function requireBn(){return hasRequiredBn||(hasRequiredBn=1,function(s){(function(a,u){function l(k,d){if(!k)throw new Error(d||"Assertion failed")}function f(k,d){k.super_=d;var g=function(){};g.prototype=d.prototype,k.prototype=new g,k.prototype.constructor=k}function c(k,d,g){if(c.isBN(k))return k;this.negative=0,this.words=null,this.length=0,this.red=null,k!==null&&((d==="le"||d==="be")&&(g=d,d=10),this._init(k||0,d||10,g||"be"))}typeof a=="object"?a.exports=c:u.BN=c,c.BN=c,c.wordSize=26;var h;try{typeof window<"u"&&typeof window.Buffer<"u"?h=window.Buffer:h=require$$2$1.Buffer}catch{}c.isBN=function(d){return d instanceof c?!0:d!==null&&typeof d=="object"&&d.constructor.wordSize===c.wordSize&&Array.isArray(d.words)},c.max=function(d,g){return d.cmp(g)>0?d:g},c.min=function(d,g){return d.cmp(g)<0?d:g},c.prototype._init=function(d,g,_){if(typeof d=="number")return this._initNumber(d,g,_);if(typeof d=="object")return this._initArray(d,g,_);g==="hex"&&(g=16),l(g===(g|0)&&g>=2&&g<=36),d=d.toString().replace(/\s+/g,"");var w=0;d[0]==="-"&&(w++,this.negative=1),w<d.length&&(g===16?this._parseHex(d,w,_):(this._parseBase(d,g,w),_==="le"&&this._initArray(this.toArray(),g,_)))},c.prototype._initNumber=function(d,g,_){d<0&&(this.negative=1,d=-d),d<67108864?(this.words=[d&67108863],this.length=1):d<4503599627370496?(this.words=[d&67108863,d/67108864&67108863],this.length=2):(l(d<9007199254740992),this.words=[d&67108863,d/67108864&67108863,1],this.length=3),_==="le"&&this._initArray(this.toArray(),g,_)},c.prototype._initArray=function(d,g,_){if(l(typeof d.length=="number"),d.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(d.length/3),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var x,P,$=0;if(_==="be")for(w=d.length-1,x=0;w>=0;w-=3)P=d[w]|d[w-1]<<8|d[w-2]<<16,this.words[x]|=P<<$&67108863,this.words[x+1]=P>>>26-$&67108863,$+=24,$>=26&&($-=26,x++);else if(_==="le")for(w=0,x=0;w<d.length;w+=3)P=d[w]|d[w+1]<<8|d[w+2]<<16,this.words[x]|=P<<$&67108863,this.words[x+1]=P>>>26-$&67108863,$+=24,$>=26&&($-=26,x++);return this.strip()};function p(k,d){var g=k.charCodeAt(d);return g>=65&&g<=70?g-55:g>=97&&g<=102?g-87:g-48&15}function v(k,d,g){var _=p(k,g);return g-1>=d&&(_|=p(k,g-1)<<4),_}c.prototype._parseHex=function(d,g,_){this.length=Math.ceil((d.length-g)/6),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var x=0,P=0,$;if(_==="be")for(w=d.length-1;w>=g;w-=2)$=v(d,g,w)<<x,this.words[P]|=$&67108863,x>=18?(x-=18,P+=1,this.words[P]|=$>>>26):x+=8;else{var T=d.length-g;for(w=T%2===0?g+1:g;w<d.length;w+=2)$=v(d,g,w)<<x,this.words[P]|=$&67108863,x>=18?(x-=18,P+=1,this.words[P]|=$>>>26):x+=8}this.strip()};function y(k,d,g,_){for(var w=0,x=Math.min(k.length,g),P=d;P<x;P++){var $=k.charCodeAt(P)-48;w*=_,$>=49?w+=$-49+10:$>=17?w+=$-17+10:w+=$}return w}c.prototype._parseBase=function(d,g,_){this.words=[0],this.length=1;for(var w=0,x=1;x<=67108863;x*=g)w++;w--,x=x/g|0;for(var P=d.length-_,$=P%w,T=Math.min(P,P-$)+_,m=0,M=_;M<T;M+=w)m=y(d,M,M+w,g),this.imuln(x),this.words[0]+m<67108864?this.words[0]+=m:this._iaddn(m);if($!==0){var W=1;for(m=y(d,M,d.length,g),M=0;M<$;M++)W*=g;this.imuln(W),this.words[0]+m<67108864?this.words[0]+=m:this._iaddn(m)}this.strip()},c.prototype.copy=function(d){d.words=new Array(this.length);for(var g=0;g<this.length;g++)d.words[g]=this.words[g];d.length=this.length,d.negative=this.negative,d.red=this.red},c.prototype.clone=function(){var d=new c(null);return this.copy(d),d},c.prototype._expand=function(d){for(;this.length<d;)this.words[this.length++]=0;return this},c.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},c.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},c.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var b=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],S=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],E=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];c.prototype.toString=function(d,g){d=d||10,g=g|0||1;var _;if(d===16||d==="hex"){_="";for(var w=0,x=0,P=0;P<this.length;P++){var $=this.words[P],T=(($<<w|x)&16777215).toString(16);x=$>>>24-w&16777215,x!==0||P!==this.length-1?_=b[6-T.length]+T+_:_=T+_,w+=2,w>=26&&(w-=26,P--)}for(x!==0&&(_=x.toString(16)+_);_.length%g!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}if(d===(d|0)&&d>=2&&d<=36){var m=S[d],M=E[d];_="";var W=this.clone();for(W.negative=0;!W.isZero();){var Y=W.modn(M).toString(d);W=W.idivn(M),W.isZero()?_=Y+_:_=b[m-Y.length]+Y+_}for(this.isZero()&&(_="0"+_);_.length%g!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}l(!1,"Base should be between 2 and 36")},c.prototype.toNumber=function(){var d=this.words[0];return this.length===2?d+=this.words[1]*67108864:this.length===3&&this.words[2]===1?d+=4503599627370496+this.words[1]*67108864:this.length>2&&l(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-d:d},c.prototype.toJSON=function(){return this.toString(16)},c.prototype.toBuffer=function(d,g){return l(typeof h<"u"),this.toArrayLike(h,d,g)},c.prototype.toArray=function(d,g){return this.toArrayLike(Array,d,g)},c.prototype.toArrayLike=function(d,g,_){var w=this.byteLength(),x=_||Math.max(1,w);l(w<=x,"byte array longer than desired length"),l(x>0,"Requested array length <= 0"),this.strip();var P=g==="le",$=new d(x),T,m,M=this.clone();if(P){for(m=0;!M.isZero();m++)T=M.andln(255),M.iushrn(8),$[m]=T;for(;m<x;m++)$[m]=0}else{for(m=0;m<x-w;m++)$[m]=0;for(m=0;!M.isZero();m++)T=M.andln(255),M.iushrn(8),$[x-m-1]=T}return $},Math.clz32?c.prototype._countBits=function(d){return 32-Math.clz32(d)}:c.prototype._countBits=function(d){var g=d,_=0;return g>=4096&&(_+=13,g>>>=13),g>=64&&(_+=7,g>>>=7),g>=8&&(_+=4,g>>>=4),g>=2&&(_+=2,g>>>=2),_+g},c.prototype._zeroBits=function(d){if(d===0)return 26;var g=d,_=0;return g&8191||(_+=13,g>>>=13),g&127||(_+=7,g>>>=7),g&15||(_+=4,g>>>=4),g&3||(_+=2,g>>>=2),g&1||_++,_},c.prototype.bitLength=function(){var d=this.words[this.length-1],g=this._countBits(d);return(this.length-1)*26+g};function R(k){for(var d=new Array(k.bitLength()),g=0;g<d.length;g++){var _=g/26|0,w=g%26;d[g]=(k.words[_]&1<<w)>>>w}return d}c.prototype.zeroBits=function(){if(this.isZero())return 0;for(var d=0,g=0;g<this.length;g++){var _=this._zeroBits(this.words[g]);if(d+=_,_!==26)break}return d},c.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},c.prototype.toTwos=function(d){return this.negative!==0?this.abs().inotn(d).iaddn(1):this.clone()},c.prototype.fromTwos=function(d){return this.testn(d-1)?this.notn(d).iaddn(1).ineg():this.clone()},c.prototype.isNeg=function(){return this.negative!==0},c.prototype.neg=function(){return this.clone().ineg()},c.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},c.prototype.iuor=function(d){for(;this.length<d.length;)this.words[this.length++]=0;for(var g=0;g<d.length;g++)this.words[g]=this.words[g]|d.words[g];return this.strip()},c.prototype.ior=function(d){return l((this.negative|d.negative)===0),this.iuor(d)},c.prototype.or=function(d){return this.length>d.length?this.clone().ior(d):d.clone().ior(this)},c.prototype.uor=function(d){return this.length>d.length?this.clone().iuor(d):d.clone().iuor(this)},c.prototype.iuand=function(d){var g;this.length>d.length?g=d:g=this;for(var _=0;_<g.length;_++)this.words[_]=this.words[_]&d.words[_];return this.length=g.length,this.strip()},c.prototype.iand=function(d){return l((this.negative|d.negative)===0),this.iuand(d)},c.prototype.and=function(d){return this.length>d.length?this.clone().iand(d):d.clone().iand(this)},c.prototype.uand=function(d){return this.length>d.length?this.clone().iuand(d):d.clone().iuand(this)},c.prototype.iuxor=function(d){var g,_;this.length>d.length?(g=this,_=d):(g=d,_=this);for(var w=0;w<_.length;w++)this.words[w]=g.words[w]^_.words[w];if(this!==g)for(;w<g.length;w++)this.words[w]=g.words[w];return this.length=g.length,this.strip()},c.prototype.ixor=function(d){return l((this.negative|d.negative)===0),this.iuxor(d)},c.prototype.xor=function(d){return this.length>d.length?this.clone().ixor(d):d.clone().ixor(this)},c.prototype.uxor=function(d){return this.length>d.length?this.clone().iuxor(d):d.clone().iuxor(this)},c.prototype.inotn=function(d){l(typeof d=="number"&&d>=0);var g=Math.ceil(d/26)|0,_=d%26;this._expand(g),_>0&&g--;for(var w=0;w<g;w++)this.words[w]=~this.words[w]&67108863;return _>0&&(this.words[w]=~this.words[w]&67108863>>26-_),this.strip()},c.prototype.notn=function(d){return this.clone().inotn(d)},c.prototype.setn=function(d,g){l(typeof d=="number"&&d>=0);var _=d/26|0,w=d%26;return this._expand(_+1),g?this.words[_]=this.words[_]|1<<w:this.words[_]=this.words[_]&~(1<<w),this.strip()},c.prototype.iadd=function(d){var g;if(this.negative!==0&&d.negative===0)return this.negative=0,g=this.isub(d),this.negative^=1,this._normSign();if(this.negative===0&&d.negative!==0)return d.negative=0,g=this.isub(d),d.negative=1,g._normSign();var _,w;this.length>d.length?(_=this,w=d):(_=d,w=this);for(var x=0,P=0;P<w.length;P++)g=(_.words[P]|0)+(w.words[P]|0)+x,this.words[P]=g&67108863,x=g>>>26;for(;x!==0&&P<_.length;P++)g=(_.words[P]|0)+x,this.words[P]=g&67108863,x=g>>>26;if(this.length=_.length,x!==0)this.words[this.length]=x,this.length++;else if(_!==this)for(;P<_.length;P++)this.words[P]=_.words[P];return this},c.prototype.add=function(d){var g;return d.negative!==0&&this.negative===0?(d.negative=0,g=this.sub(d),d.negative^=1,g):d.negative===0&&this.negative!==0?(this.negative=0,g=d.sub(this),this.negative=1,g):this.length>d.length?this.clone().iadd(d):d.clone().iadd(this)},c.prototype.isub=function(d){if(d.negative!==0){d.negative=0;var g=this.iadd(d);return d.negative=1,g._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(d),this.negative=1,this._normSign();var _=this.cmp(d);if(_===0)return this.negative=0,this.length=1,this.words[0]=0,this;var w,x;_>0?(w=this,x=d):(w=d,x=this);for(var P=0,$=0;$<x.length;$++)g=(w.words[$]|0)-(x.words[$]|0)+P,P=g>>26,this.words[$]=g&67108863;for(;P!==0&&$<w.length;$++)g=(w.words[$]|0)+P,P=g>>26,this.words[$]=g&67108863;if(P===0&&$<w.length&&w!==this)for(;$<w.length;$++)this.words[$]=w.words[$];return this.length=Math.max(this.length,$),w!==this&&(this.negative=1),this.strip()},c.prototype.sub=function(d){return this.clone().isub(d)};function O(k,d,g){g.negative=d.negative^k.negative;var _=k.length+d.length|0;g.length=_,_=_-1|0;var w=k.words[0]|0,x=d.words[0]|0,P=w*x,$=P&67108863,T=P/67108864|0;g.words[0]=$;for(var m=1;m<_;m++){for(var M=T>>>26,W=T&67108863,Y=Math.min(m,d.length-1),ue=Math.max(0,m-k.length+1);ue<=Y;ue++){var ge=m-ue|0;w=k.words[ge]|0,x=d.words[ue]|0,P=w*x+W,M+=P/67108864|0,W=P&67108863}g.words[m]=W|0,T=M|0}return T!==0?g.words[m]=T|0:g.length--,g.strip()}var I=function(d,g,_){var w=d.words,x=g.words,P=_.words,$=0,T,m,M,W=w[0]|0,Y=W&8191,ue=W>>>13,ge=w[1]|0,he=ge&8191,ae=ge>>>13,de=w[2]|0,pe=de&8191,oe=de>>>13,le=w[3]|0,me=le&8191,xe=le>>>13,Ne=w[4]|0,Pe=Ne&8191,Ie=Ne>>>13,Ke=w[5]|0,Le=Ke&8191,Ce=Ke>>>13,at=w[6]|0,Oe=at&8191,De=at>>>13,yt=w[7]|0,Ue=yt&8191,ze=yt>>>13,Mt=w[8]|0,se=Mt&8191,j=Mt>>>13,X=w[9]|0,ce=X&8191,be=X>>>13,Re=x[0]|0,Se=Re&8191,qe=Re>>>13,bt=x[1]|0,je=bt&8191,We=bt>>>13,St=x[2]|0,ut=St&8191,vt=St>>>13,zt=x[3]|0,st=zt&8191,nt=zt>>>13,Vt=x[4]|0,tt=Vt&8191,ft=Vt>>>13,Ft=x[5]|0,Qe=Ft&8191,rt=Ft>>>13,Bt=x[6]|0,Xe=Bt&8191,ct=Bt>>>13,Ut=x[7]|0,Je=Ut&8191,it=Ut>>>13,qt=x[8]|0,et=qt&8191,ht=qt>>>13,ar=x[9]|0,dt=ar&8191,mt=ar>>>13;_.negative=d.negative^g.negative,_.length=19,T=Math.imul(Y,Se),m=Math.imul(Y,qe),m=m+Math.imul(ue,Se)|0,M=Math.imul(ue,qe);var Xt=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,T=Math.imul(he,Se),m=Math.imul(he,qe),m=m+Math.imul(ae,Se)|0,M=Math.imul(ae,qe),T=T+Math.imul(Y,je)|0,m=m+Math.imul(Y,We)|0,m=m+Math.imul(ue,je)|0,M=M+Math.imul(ue,We)|0;var er=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(er>>>26)|0,er&=67108863,T=Math.imul(pe,Se),m=Math.imul(pe,qe),m=m+Math.imul(oe,Se)|0,M=Math.imul(oe,qe),T=T+Math.imul(he,je)|0,m=m+Math.imul(he,We)|0,m=m+Math.imul(ae,je)|0,M=M+Math.imul(ae,We)|0,T=T+Math.imul(Y,ut)|0,m=m+Math.imul(Y,vt)|0,m=m+Math.imul(ue,ut)|0,M=M+Math.imul(ue,vt)|0;var kr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(kr>>>26)|0,kr&=67108863,T=Math.imul(me,Se),m=Math.imul(me,qe),m=m+Math.imul(xe,Se)|0,M=Math.imul(xe,qe),T=T+Math.imul(pe,je)|0,m=m+Math.imul(pe,We)|0,m=m+Math.imul(oe,je)|0,M=M+Math.imul(oe,We)|0,T=T+Math.imul(he,ut)|0,m=m+Math.imul(he,vt)|0,m=m+Math.imul(ae,ut)|0,M=M+Math.imul(ae,vt)|0,T=T+Math.imul(Y,st)|0,m=m+Math.imul(Y,nt)|0,m=m+Math.imul(ue,st)|0,M=M+Math.imul(ue,nt)|0;var Ar=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,T=Math.imul(Pe,Se),m=Math.imul(Pe,qe),m=m+Math.imul(Ie,Se)|0,M=Math.imul(Ie,qe),T=T+Math.imul(me,je)|0,m=m+Math.imul(me,We)|0,m=m+Math.imul(xe,je)|0,M=M+Math.imul(xe,We)|0,T=T+Math.imul(pe,ut)|0,m=m+Math.imul(pe,vt)|0,m=m+Math.imul(oe,ut)|0,M=M+Math.imul(oe,vt)|0,T=T+Math.imul(he,st)|0,m=m+Math.imul(he,nt)|0,m=m+Math.imul(ae,st)|0,M=M+Math.imul(ae,nt)|0,T=T+Math.imul(Y,tt)|0,m=m+Math.imul(Y,ft)|0,m=m+Math.imul(ue,tt)|0,M=M+Math.imul(ue,ft)|0;var Tr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Tr>>>26)|0,Tr&=67108863,T=Math.imul(Le,Se),m=Math.imul(Le,qe),m=m+Math.imul(Ce,Se)|0,M=Math.imul(Ce,qe),T=T+Math.imul(Pe,je)|0,m=m+Math.imul(Pe,We)|0,m=m+Math.imul(Ie,je)|0,M=M+Math.imul(Ie,We)|0,T=T+Math.imul(me,ut)|0,m=m+Math.imul(me,vt)|0,m=m+Math.imul(xe,ut)|0,M=M+Math.imul(xe,vt)|0,T=T+Math.imul(pe,st)|0,m=m+Math.imul(pe,nt)|0,m=m+Math.imul(oe,st)|0,M=M+Math.imul(oe,nt)|0,T=T+Math.imul(he,tt)|0,m=m+Math.imul(he,ft)|0,m=m+Math.imul(ae,tt)|0,M=M+Math.imul(ae,ft)|0,T=T+Math.imul(Y,Qe)|0,m=m+Math.imul(Y,rt)|0,m=m+Math.imul(ue,Qe)|0,M=M+Math.imul(ue,rt)|0;var Rr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,T=Math.imul(Oe,Se),m=Math.imul(Oe,qe),m=m+Math.imul(De,Se)|0,M=Math.imul(De,qe),T=T+Math.imul(Le,je)|0,m=m+Math.imul(Le,We)|0,m=m+Math.imul(Ce,je)|0,M=M+Math.imul(Ce,We)|0,T=T+Math.imul(Pe,ut)|0,m=m+Math.imul(Pe,vt)|0,m=m+Math.imul(Ie,ut)|0,M=M+Math.imul(Ie,vt)|0,T=T+Math.imul(me,st)|0,m=m+Math.imul(me,nt)|0,m=m+Math.imul(xe,st)|0,M=M+Math.imul(xe,nt)|0,T=T+Math.imul(pe,tt)|0,m=m+Math.imul(pe,ft)|0,m=m+Math.imul(oe,tt)|0,M=M+Math.imul(oe,ft)|0,T=T+Math.imul(he,Qe)|0,m=m+Math.imul(he,rt)|0,m=m+Math.imul(ae,Qe)|0,M=M+Math.imul(ae,rt)|0,T=T+Math.imul(Y,Xe)|0,m=m+Math.imul(Y,ct)|0,m=m+Math.imul(ue,Xe)|0,M=M+Math.imul(ue,ct)|0;var pr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(pr>>>26)|0,pr&=67108863,T=Math.imul(Ue,Se),m=Math.imul(Ue,qe),m=m+Math.imul(ze,Se)|0,M=Math.imul(ze,qe),T=T+Math.imul(Oe,je)|0,m=m+Math.imul(Oe,We)|0,m=m+Math.imul(De,je)|0,M=M+Math.imul(De,We)|0,T=T+Math.imul(Le,ut)|0,m=m+Math.imul(Le,vt)|0,m=m+Math.imul(Ce,ut)|0,M=M+Math.imul(Ce,vt)|0,T=T+Math.imul(Pe,st)|0,m=m+Math.imul(Pe,nt)|0,m=m+Math.imul(Ie,st)|0,M=M+Math.imul(Ie,nt)|0,T=T+Math.imul(me,tt)|0,m=m+Math.imul(me,ft)|0,m=m+Math.imul(xe,tt)|0,M=M+Math.imul(xe,ft)|0,T=T+Math.imul(pe,Qe)|0,m=m+Math.imul(pe,rt)|0,m=m+Math.imul(oe,Qe)|0,M=M+Math.imul(oe,rt)|0,T=T+Math.imul(he,Xe)|0,m=m+Math.imul(he,ct)|0,m=m+Math.imul(ae,Xe)|0,M=M+Math.imul(ae,ct)|0,T=T+Math.imul(Y,Je)|0,m=m+Math.imul(Y,it)|0,m=m+Math.imul(ue,Je)|0,M=M+Math.imul(ue,it)|0;var _r=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(_r>>>26)|0,_r&=67108863,T=Math.imul(se,Se),m=Math.imul(se,qe),m=m+Math.imul(j,Se)|0,M=Math.imul(j,qe),T=T+Math.imul(Ue,je)|0,m=m+Math.imul(Ue,We)|0,m=m+Math.imul(ze,je)|0,M=M+Math.imul(ze,We)|0,T=T+Math.imul(Oe,ut)|0,m=m+Math.imul(Oe,vt)|0,m=m+Math.imul(De,ut)|0,M=M+Math.imul(De,vt)|0,T=T+Math.imul(Le,st)|0,m=m+Math.imul(Le,nt)|0,m=m+Math.imul(Ce,st)|0,M=M+Math.imul(Ce,nt)|0,T=T+Math.imul(Pe,tt)|0,m=m+Math.imul(Pe,ft)|0,m=m+Math.imul(Ie,tt)|0,M=M+Math.imul(Ie,ft)|0,T=T+Math.imul(me,Qe)|0,m=m+Math.imul(me,rt)|0,m=m+Math.imul(xe,Qe)|0,M=M+Math.imul(xe,rt)|0,T=T+Math.imul(pe,Xe)|0,m=m+Math.imul(pe,ct)|0,m=m+Math.imul(oe,Xe)|0,M=M+Math.imul(oe,ct)|0,T=T+Math.imul(he,Je)|0,m=m+Math.imul(he,it)|0,m=m+Math.imul(ae,Je)|0,M=M+Math.imul(ae,it)|0,T=T+Math.imul(Y,et)|0,m=m+Math.imul(Y,ht)|0,m=m+Math.imul(ue,et)|0,M=M+Math.imul(ue,ht)|0;var fr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(fr>>>26)|0,fr&=67108863,T=Math.imul(ce,Se),m=Math.imul(ce,qe),m=m+Math.imul(be,Se)|0,M=Math.imul(be,qe),T=T+Math.imul(se,je)|0,m=m+Math.imul(se,We)|0,m=m+Math.imul(j,je)|0,M=M+Math.imul(j,We)|0,T=T+Math.imul(Ue,ut)|0,m=m+Math.imul(Ue,vt)|0,m=m+Math.imul(ze,ut)|0,M=M+Math.imul(ze,vt)|0,T=T+Math.imul(Oe,st)|0,m=m+Math.imul(Oe,nt)|0,m=m+Math.imul(De,st)|0,M=M+Math.imul(De,nt)|0,T=T+Math.imul(Le,tt)|0,m=m+Math.imul(Le,ft)|0,m=m+Math.imul(Ce,tt)|0,M=M+Math.imul(Ce,ft)|0,T=T+Math.imul(Pe,Qe)|0,m=m+Math.imul(Pe,rt)|0,m=m+Math.imul(Ie,Qe)|0,M=M+Math.imul(Ie,rt)|0,T=T+Math.imul(me,Xe)|0,m=m+Math.imul(me,ct)|0,m=m+Math.imul(xe,Xe)|0,M=M+Math.imul(xe,ct)|0,T=T+Math.imul(pe,Je)|0,m=m+Math.imul(pe,it)|0,m=m+Math.imul(oe,Je)|0,M=M+Math.imul(oe,it)|0,T=T+Math.imul(he,et)|0,m=m+Math.imul(he,ht)|0,m=m+Math.imul(ae,et)|0,M=M+Math.imul(ae,ht)|0,T=T+Math.imul(Y,dt)|0,m=m+Math.imul(Y,mt)|0,m=m+Math.imul(ue,dt)|0,M=M+Math.imul(ue,mt)|0;var Ht=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,T=Math.imul(ce,je),m=Math.imul(ce,We),m=m+Math.imul(be,je)|0,M=Math.imul(be,We),T=T+Math.imul(se,ut)|0,m=m+Math.imul(se,vt)|0,m=m+Math.imul(j,ut)|0,M=M+Math.imul(j,vt)|0,T=T+Math.imul(Ue,st)|0,m=m+Math.imul(Ue,nt)|0,m=m+Math.imul(ze,st)|0,M=M+Math.imul(ze,nt)|0,T=T+Math.imul(Oe,tt)|0,m=m+Math.imul(Oe,ft)|0,m=m+Math.imul(De,tt)|0,M=M+Math.imul(De,ft)|0,T=T+Math.imul(Le,Qe)|0,m=m+Math.imul(Le,rt)|0,m=m+Math.imul(Ce,Qe)|0,M=M+Math.imul(Ce,rt)|0,T=T+Math.imul(Pe,Xe)|0,m=m+Math.imul(Pe,ct)|0,m=m+Math.imul(Ie,Xe)|0,M=M+Math.imul(Ie,ct)|0,T=T+Math.imul(me,Je)|0,m=m+Math.imul(me,it)|0,m=m+Math.imul(xe,Je)|0,M=M+Math.imul(xe,it)|0,T=T+Math.imul(pe,et)|0,m=m+Math.imul(pe,ht)|0,m=m+Math.imul(oe,et)|0,M=M+Math.imul(oe,ht)|0,T=T+Math.imul(he,dt)|0,m=m+Math.imul(he,mt)|0,m=m+Math.imul(ae,dt)|0,M=M+Math.imul(ae,mt)|0;var Cr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,T=Math.imul(ce,ut),m=Math.imul(ce,vt),m=m+Math.imul(be,ut)|0,M=Math.imul(be,vt),T=T+Math.imul(se,st)|0,m=m+Math.imul(se,nt)|0,m=m+Math.imul(j,st)|0,M=M+Math.imul(j,nt)|0,T=T+Math.imul(Ue,tt)|0,m=m+Math.imul(Ue,ft)|0,m=m+Math.imul(ze,tt)|0,M=M+Math.imul(ze,ft)|0,T=T+Math.imul(Oe,Qe)|0,m=m+Math.imul(Oe,rt)|0,m=m+Math.imul(De,Qe)|0,M=M+Math.imul(De,rt)|0,T=T+Math.imul(Le,Xe)|0,m=m+Math.imul(Le,ct)|0,m=m+Math.imul(Ce,Xe)|0,M=M+Math.imul(Ce,ct)|0,T=T+Math.imul(Pe,Je)|0,m=m+Math.imul(Pe,it)|0,m=m+Math.imul(Ie,Je)|0,M=M+Math.imul(Ie,it)|0,T=T+Math.imul(me,et)|0,m=m+Math.imul(me,ht)|0,m=m+Math.imul(xe,et)|0,M=M+Math.imul(xe,ht)|0,T=T+Math.imul(pe,dt)|0,m=m+Math.imul(pe,mt)|0,m=m+Math.imul(oe,dt)|0,M=M+Math.imul(oe,mt)|0;var ur=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(ur>>>26)|0,ur&=67108863,T=Math.imul(ce,st),m=Math.imul(ce,nt),m=m+Math.imul(be,st)|0,M=Math.imul(be,nt),T=T+Math.imul(se,tt)|0,m=m+Math.imul(se,ft)|0,m=m+Math.imul(j,tt)|0,M=M+Math.imul(j,ft)|0,T=T+Math.imul(Ue,Qe)|0,m=m+Math.imul(Ue,rt)|0,m=m+Math.imul(ze,Qe)|0,M=M+Math.imul(ze,rt)|0,T=T+Math.imul(Oe,Xe)|0,m=m+Math.imul(Oe,ct)|0,m=m+Math.imul(De,Xe)|0,M=M+Math.imul(De,ct)|0,T=T+Math.imul(Le,Je)|0,m=m+Math.imul(Le,it)|0,m=m+Math.imul(Ce,Je)|0,M=M+Math.imul(Ce,it)|0,T=T+Math.imul(Pe,et)|0,m=m+Math.imul(Pe,ht)|0,m=m+Math.imul(Ie,et)|0,M=M+Math.imul(Ie,ht)|0,T=T+Math.imul(me,dt)|0,m=m+Math.imul(me,mt)|0,m=m+Math.imul(xe,dt)|0,M=M+Math.imul(xe,mt)|0;var wr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(wr>>>26)|0,wr&=67108863,T=Math.imul(ce,tt),m=Math.imul(ce,ft),m=m+Math.imul(be,tt)|0,M=Math.imul(be,ft),T=T+Math.imul(se,Qe)|0,m=m+Math.imul(se,rt)|0,m=m+Math.imul(j,Qe)|0,M=M+Math.imul(j,rt)|0,T=T+Math.imul(Ue,Xe)|0,m=m+Math.imul(Ue,ct)|0,m=m+Math.imul(ze,Xe)|0,M=M+Math.imul(ze,ct)|0,T=T+Math.imul(Oe,Je)|0,m=m+Math.imul(Oe,it)|0,m=m+Math.imul(De,Je)|0,M=M+Math.imul(De,it)|0,T=T+Math.imul(Le,et)|0,m=m+Math.imul(Le,ht)|0,m=m+Math.imul(Ce,et)|0,M=M+Math.imul(Ce,ht)|0,T=T+Math.imul(Pe,dt)|0,m=m+Math.imul(Pe,mt)|0,m=m+Math.imul(Ie,dt)|0,M=M+Math.imul(Ie,mt)|0;var yr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(yr>>>26)|0,yr&=67108863,T=Math.imul(ce,Qe),m=Math.imul(ce,rt),m=m+Math.imul(be,Qe)|0,M=Math.imul(be,rt),T=T+Math.imul(se,Xe)|0,m=m+Math.imul(se,ct)|0,m=m+Math.imul(j,Xe)|0,M=M+Math.imul(j,ct)|0,T=T+Math.imul(Ue,Je)|0,m=m+Math.imul(Ue,it)|0,m=m+Math.imul(ze,Je)|0,M=M+Math.imul(ze,it)|0,T=T+Math.imul(Oe,et)|0,m=m+Math.imul(Oe,ht)|0,m=m+Math.imul(De,et)|0,M=M+Math.imul(De,ht)|0,T=T+Math.imul(Le,dt)|0,m=m+Math.imul(Le,mt)|0,m=m+Math.imul(Ce,dt)|0,M=M+Math.imul(Ce,mt)|0;var Mr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,T=Math.imul(ce,Xe),m=Math.imul(ce,ct),m=m+Math.imul(be,Xe)|0,M=Math.imul(be,ct),T=T+Math.imul(se,Je)|0,m=m+Math.imul(se,it)|0,m=m+Math.imul(j,Je)|0,M=M+Math.imul(j,it)|0,T=T+Math.imul(Ue,et)|0,m=m+Math.imul(Ue,ht)|0,m=m+Math.imul(ze,et)|0,M=M+Math.imul(ze,ht)|0,T=T+Math.imul(Oe,dt)|0,m=m+Math.imul(Oe,mt)|0,m=m+Math.imul(De,dt)|0,M=M+Math.imul(De,mt)|0;var Er=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(Er>>>26)|0,Er&=67108863,T=Math.imul(ce,Je),m=Math.imul(ce,it),m=m+Math.imul(be,Je)|0,M=Math.imul(be,it),T=T+Math.imul(se,et)|0,m=m+Math.imul(se,ht)|0,m=m+Math.imul(j,et)|0,M=M+Math.imul(j,ht)|0,T=T+Math.imul(Ue,dt)|0,m=m+Math.imul(Ue,mt)|0,m=m+Math.imul(ze,dt)|0,M=M+Math.imul(ze,mt)|0;var gr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(gr>>>26)|0,gr&=67108863,T=Math.imul(ce,et),m=Math.imul(ce,ht),m=m+Math.imul(be,et)|0,M=Math.imul(be,ht),T=T+Math.imul(se,dt)|0,m=m+Math.imul(se,mt)|0,m=m+Math.imul(j,dt)|0,M=M+Math.imul(j,mt)|0;var sr=($+T|0)+((m&8191)<<13)|0;$=(M+(m>>>13)|0)+(sr>>>26)|0,sr&=67108863,T=Math.imul(ce,dt),m=Math.imul(ce,mt),m=m+Math.imul(be,dt)|0,M=Math.imul(be,mt);var Ir=($+T|0)+((m&8191)<<13)|0;return $=(M+(m>>>13)|0)+(Ir>>>26)|0,Ir&=67108863,P[0]=Xt,P[1]=er,P[2]=kr,P[3]=Ar,P[4]=Tr,P[5]=Rr,P[6]=pr,P[7]=_r,P[8]=fr,P[9]=Ht,P[10]=Cr,P[11]=ur,P[12]=wr,P[13]=yr,P[14]=Mr,P[15]=Er,P[16]=gr,P[17]=sr,P[18]=Ir,$!==0&&(P[19]=$,_.length++),_};Math.imul||(I=O);function B(k,d,g){g.negative=d.negative^k.negative,g.length=k.length+d.length;for(var _=0,w=0,x=0;x<g.length-1;x++){var P=w;w=0;for(var $=_&67108863,T=Math.min(x,d.length-1),m=Math.max(0,x-k.length+1);m<=T;m++){var M=x-m,W=k.words[M]|0,Y=d.words[m]|0,ue=W*Y,ge=ue&67108863;P=P+(ue/67108864|0)|0,ge=ge+$|0,$=ge&67108863,P=P+(ge>>>26)|0,w+=P>>>26,P&=67108863}g.words[x]=$,_=P,P=w}return _!==0?g.words[x]=_:g.length--,g.strip()}function N(k,d,g){var _=new D;return _.mulp(k,d,g)}c.prototype.mulTo=function(d,g){var _,w=this.length+d.length;return this.length===10&&d.length===10?_=I(this,d,g):w<63?_=O(this,d,g):w<1024?_=B(this,d,g):_=N(this,d,g),_};function D(k,d){this.x=k,this.y=d}D.prototype.makeRBT=function(d){for(var g=new Array(d),_=c.prototype._countBits(d)-1,w=0;w<d;w++)g[w]=this.revBin(w,_,d);return g},D.prototype.revBin=function(d,g,_){if(d===0||d===_-1)return d;for(var w=0,x=0;x<g;x++)w|=(d&1)<<g-x-1,d>>=1;return w},D.prototype.permute=function(d,g,_,w,x,P){for(var $=0;$<P;$++)w[$]=g[d[$]],x[$]=_[d[$]]},D.prototype.transform=function(d,g,_,w,x,P){this.permute(P,d,g,_,w,x);for(var $=1;$<x;$<<=1)for(var T=$<<1,m=Math.cos(2*Math.PI/T),M=Math.sin(2*Math.PI/T),W=0;W<x;W+=T)for(var Y=m,ue=M,ge=0;ge<$;ge++){var he=_[W+ge],ae=w[W+ge],de=_[W+ge+$],pe=w[W+ge+$],oe=Y*de-ue*pe;pe=Y*pe+ue*de,de=oe,_[W+ge]=he+de,w[W+ge]=ae+pe,_[W+ge+$]=he-de,w[W+ge+$]=ae-pe,ge!==T&&(oe=m*Y-M*ue,ue=m*ue+M*Y,Y=oe)}},D.prototype.guessLen13b=function(d,g){var _=Math.max(g,d)|1,w=_&1,x=0;for(_=_/2|0;_;_=_>>>1)x++;return 1<<x+1+w},D.prototype.conjugate=function(d,g,_){if(!(_<=1))for(var w=0;w<_/2;w++){var x=d[w];d[w]=d[_-w-1],d[_-w-1]=x,x=g[w],g[w]=-g[_-w-1],g[_-w-1]=-x}},D.prototype.normalize13b=function(d,g){for(var _=0,w=0;w<g/2;w++){var x=Math.round(d[2*w+1]/g)*8192+Math.round(d[2*w]/g)+_;d[w]=x&67108863,x<67108864?_=0:_=x/67108864|0}return d},D.prototype.convert13b=function(d,g,_,w){for(var x=0,P=0;P<g;P++)x=x+(d[P]|0),_[2*P]=x&8191,x=x>>>13,_[2*P+1]=x&8191,x=x>>>13;for(P=2*g;P<w;++P)_[P]=0;l(x===0),l((x&-8192)===0)},D.prototype.stub=function(d){for(var g=new Array(d),_=0;_<d;_++)g[_]=0;return g},D.prototype.mulp=function(d,g,_){var w=2*this.guessLen13b(d.length,g.length),x=this.makeRBT(w),P=this.stub(w),$=new Array(w),T=new Array(w),m=new Array(w),M=new Array(w),W=new Array(w),Y=new Array(w),ue=_.words;ue.length=w,this.convert13b(d.words,d.length,$,w),this.convert13b(g.words,g.length,M,w),this.transform($,P,T,m,w,x),this.transform(M,P,W,Y,w,x);for(var ge=0;ge<w;ge++){var he=T[ge]*W[ge]-m[ge]*Y[ge];m[ge]=T[ge]*Y[ge]+m[ge]*W[ge],T[ge]=he}return this.conjugate(T,m,w),this.transform(T,m,ue,P,w,x),this.conjugate(ue,P,w),this.normalize13b(ue,w),_.negative=d.negative^g.negative,_.length=d.length+g.length,_.strip()},c.prototype.mul=function(d){var g=new c(null);return g.words=new Array(this.length+d.length),this.mulTo(d,g)},c.prototype.mulf=function(d){var g=new c(null);return g.words=new Array(this.length+d.length),N(this,d,g)},c.prototype.imul=function(d){return this.clone().mulTo(d,this)},c.prototype.imuln=function(d){l(typeof d=="number"),l(d<67108864);for(var g=0,_=0;_<this.length;_++){var w=(this.words[_]|0)*d,x=(w&67108863)+(g&67108863);g>>=26,g+=w/67108864|0,g+=x>>>26,this.words[_]=x&67108863}return g!==0&&(this.words[_]=g,this.length++),this},c.prototype.muln=function(d){return this.clone().imuln(d)},c.prototype.sqr=function(){return this.mul(this)},c.prototype.isqr=function(){return this.imul(this.clone())},c.prototype.pow=function(d){var g=R(d);if(g.length===0)return new c(1);for(var _=this,w=0;w<g.length&&g[w]===0;w++,_=_.sqr());if(++w<g.length)for(var x=_.sqr();w<g.length;w++,x=x.sqr())g[w]!==0&&(_=_.mul(x));return _},c.prototype.iushln=function(d){l(typeof d=="number"&&d>=0);var g=d%26,_=(d-g)/26,w=67108863>>>26-g<<26-g,x;if(g!==0){var P=0;for(x=0;x<this.length;x++){var $=this.words[x]&w,T=(this.words[x]|0)-$<<g;this.words[x]=T|P,P=$>>>26-g}P&&(this.words[x]=P,this.length++)}if(_!==0){for(x=this.length-1;x>=0;x--)this.words[x+_]=this.words[x];for(x=0;x<_;x++)this.words[x]=0;this.length+=_}return this.strip()},c.prototype.ishln=function(d){return l(this.negative===0),this.iushln(d)},c.prototype.iushrn=function(d,g,_){l(typeof d=="number"&&d>=0);var w;g?w=(g-g%26)/26:w=0;var x=d%26,P=Math.min((d-x)/26,this.length),$=67108863^67108863>>>x<<x,T=_;if(w-=P,w=Math.max(0,w),T){for(var m=0;m<P;m++)T.words[m]=this.words[m];T.length=P}if(P!==0)if(this.length>P)for(this.length-=P,m=0;m<this.length;m++)this.words[m]=this.words[m+P];else this.words[0]=0,this.length=1;var M=0;for(m=this.length-1;m>=0&&(M!==0||m>=w);m--){var W=this.words[m]|0;this.words[m]=M<<26-x|W>>>x,M=W&$}return T&&M!==0&&(T.words[T.length++]=M),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},c.prototype.ishrn=function(d,g,_){return l(this.negative===0),this.iushrn(d,g,_)},c.prototype.shln=function(d){return this.clone().ishln(d)},c.prototype.ushln=function(d){return this.clone().iushln(d)},c.prototype.shrn=function(d){return this.clone().ishrn(d)},c.prototype.ushrn=function(d){return this.clone().iushrn(d)},c.prototype.testn=function(d){l(typeof d=="number"&&d>=0);var g=d%26,_=(d-g)/26,w=1<<g;if(this.length<=_)return!1;var x=this.words[_];return!!(x&w)},c.prototype.imaskn=function(d){l(typeof d=="number"&&d>=0);var g=d%26,_=(d-g)/26;if(l(this.negative===0,"imaskn works only with positive numbers"),this.length<=_)return this;if(g!==0&&_++,this.length=Math.min(_,this.length),g!==0){var w=67108863^67108863>>>g<<g;this.words[this.length-1]&=w}return this.strip()},c.prototype.maskn=function(d){return this.clone().imaskn(d)},c.prototype.iaddn=function(d){return l(typeof d=="number"),l(d<67108864),d<0?this.isubn(-d):this.negative!==0?this.length===1&&(this.words[0]|0)<d?(this.words[0]=d-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(d),this.negative=1,this):this._iaddn(d)},c.prototype._iaddn=function(d){this.words[0]+=d;for(var g=0;g<this.length&&this.words[g]>=67108864;g++)this.words[g]-=67108864,g===this.length-1?this.words[g+1]=1:this.words[g+1]++;return this.length=Math.max(this.length,g+1),this},c.prototype.isubn=function(d){if(l(typeof d=="number"),l(d<67108864),d<0)return this.iaddn(-d);if(this.negative!==0)return this.negative=0,this.iaddn(d),this.negative=1,this;if(this.words[0]-=d,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var g=0;g<this.length&&this.words[g]<0;g++)this.words[g]+=67108864,this.words[g+1]-=1;return this.strip()},c.prototype.addn=function(d){return this.clone().iaddn(d)},c.prototype.subn=function(d){return this.clone().isubn(d)},c.prototype.iabs=function(){return this.negative=0,this},c.prototype.abs=function(){return this.clone().iabs()},c.prototype._ishlnsubmul=function(d,g,_){var w=d.length+_,x;this._expand(w);var P,$=0;for(x=0;x<d.length;x++){P=(this.words[x+_]|0)+$;var T=(d.words[x]|0)*g;P-=T&67108863,$=(P>>26)-(T/67108864|0),this.words[x+_]=P&67108863}for(;x<this.length-_;x++)P=(this.words[x+_]|0)+$,$=P>>26,this.words[x+_]=P&67108863;if($===0)return this.strip();for(l($===-1),$=0,x=0;x<this.length;x++)P=-(this.words[x]|0)+$,$=P>>26,this.words[x]=P&67108863;return this.negative=1,this.strip()},c.prototype._wordDiv=function(d,g){var _=this.length-d.length,w=this.clone(),x=d,P=x.words[x.length-1]|0,$=this._countBits(P);_=26-$,_!==0&&(x=x.ushln(_),w.iushln(_),P=x.words[x.length-1]|0);var T=w.length-x.length,m;if(g!=="mod"){m=new c(null),m.length=T+1,m.words=new Array(m.length);for(var M=0;M<m.length;M++)m.words[M]=0}var W=w.clone()._ishlnsubmul(x,1,T);W.negative===0&&(w=W,m&&(m.words[T]=1));for(var Y=T-1;Y>=0;Y--){var ue=(w.words[x.length+Y]|0)*67108864+(w.words[x.length+Y-1]|0);for(ue=Math.min(ue/P|0,67108863),w._ishlnsubmul(x,ue,Y);w.negative!==0;)ue--,w.negative=0,w._ishlnsubmul(x,1,Y),w.isZero()||(w.negative^=1);m&&(m.words[Y]=ue)}return m&&m.strip(),w.strip(),g!=="div"&&_!==0&&w.iushrn(_),{div:m||null,mod:w}},c.prototype.divmod=function(d,g,_){if(l(!d.isZero()),this.isZero())return{div:new c(0),mod:new c(0)};var w,x,P;return this.negative!==0&&d.negative===0?(P=this.neg().divmod(d,g),g!=="mod"&&(w=P.div.neg()),g!=="div"&&(x=P.mod.neg(),_&&x.negative!==0&&x.iadd(d)),{div:w,mod:x}):this.negative===0&&d.negative!==0?(P=this.divmod(d.neg(),g),g!=="mod"&&(w=P.div.neg()),{div:w,mod:P.mod}):this.negative&d.negative?(P=this.neg().divmod(d.neg(),g),g!=="div"&&(x=P.mod.neg(),_&&x.negative!==0&&x.isub(d)),{div:P.div,mod:x}):d.length>this.length||this.cmp(d)<0?{div:new c(0),mod:this}:d.length===1?g==="div"?{div:this.divn(d.words[0]),mod:null}:g==="mod"?{div:null,mod:new c(this.modn(d.words[0]))}:{div:this.divn(d.words[0]),mod:new c(this.modn(d.words[0]))}:this._wordDiv(d,g)},c.prototype.div=function(d){return this.divmod(d,"div",!1).div},c.prototype.mod=function(d){return this.divmod(d,"mod",!1).mod},c.prototype.umod=function(d){return this.divmod(d,"mod",!0).mod},c.prototype.divRound=function(d){var g=this.divmod(d);if(g.mod.isZero())return g.div;var _=g.div.negative!==0?g.mod.isub(d):g.mod,w=d.ushrn(1),x=d.andln(1),P=_.cmp(w);return P<0||x===1&&P===0?g.div:g.div.negative!==0?g.div.isubn(1):g.div.iaddn(1)},c.prototype.modn=function(d){l(d<=67108863);for(var g=(1<<26)%d,_=0,w=this.length-1;w>=0;w--)_=(g*_+(this.words[w]|0))%d;return _},c.prototype.idivn=function(d){l(d<=67108863);for(var g=0,_=this.length-1;_>=0;_--){var w=(this.words[_]|0)+g*67108864;this.words[_]=w/d|0,g=w%d}return this.strip()},c.prototype.divn=function(d){return this.clone().idivn(d)},c.prototype.egcd=function(d){l(d.negative===0),l(!d.isZero());var g=this,_=d.clone();g.negative!==0?g=g.umod(d):g=g.clone();for(var w=new c(1),x=new c(0),P=new c(0),$=new c(1),T=0;g.isEven()&&_.isEven();)g.iushrn(1),_.iushrn(1),++T;for(var m=_.clone(),M=g.clone();!g.isZero();){for(var W=0,Y=1;!(g.words[0]&Y)&&W<26;++W,Y<<=1);if(W>0)for(g.iushrn(W);W-- >0;)(w.isOdd()||x.isOdd())&&(w.iadd(m),x.isub(M)),w.iushrn(1),x.iushrn(1);for(var ue=0,ge=1;!(_.words[0]&ge)&&ue<26;++ue,ge<<=1);if(ue>0)for(_.iushrn(ue);ue-- >0;)(P.isOdd()||$.isOdd())&&(P.iadd(m),$.isub(M)),P.iushrn(1),$.iushrn(1);g.cmp(_)>=0?(g.isub(_),w.isub(P),x.isub($)):(_.isub(g),P.isub(w),$.isub(x))}return{a:P,b:$,gcd:_.iushln(T)}},c.prototype._invmp=function(d){l(d.negative===0),l(!d.isZero());var g=this,_=d.clone();g.negative!==0?g=g.umod(d):g=g.clone();for(var w=new c(1),x=new c(0),P=_.clone();g.cmpn(1)>0&&_.cmpn(1)>0;){for(var $=0,T=1;!(g.words[0]&T)&&$<26;++$,T<<=1);if($>0)for(g.iushrn($);$-- >0;)w.isOdd()&&w.iadd(P),w.iushrn(1);for(var m=0,M=1;!(_.words[0]&M)&&m<26;++m,M<<=1);if(m>0)for(_.iushrn(m);m-- >0;)x.isOdd()&&x.iadd(P),x.iushrn(1);g.cmp(_)>=0?(g.isub(_),w.isub(x)):(_.isub(g),x.isub(w))}var W;return g.cmpn(1)===0?W=w:W=x,W.cmpn(0)<0&&W.iadd(d),W},c.prototype.gcd=function(d){if(this.isZero())return d.abs();if(d.isZero())return this.abs();var g=this.clone(),_=d.clone();g.negative=0,_.negative=0;for(var w=0;g.isEven()&&_.isEven();w++)g.iushrn(1),_.iushrn(1);do{for(;g.isEven();)g.iushrn(1);for(;_.isEven();)_.iushrn(1);var x=g.cmp(_);if(x<0){var P=g;g=_,_=P}else if(x===0||_.cmpn(1)===0)break;g.isub(_)}while(!0);return _.iushln(w)},c.prototype.invm=function(d){return this.egcd(d).a.umod(d)},c.prototype.isEven=function(){return(this.words[0]&1)===0},c.prototype.isOdd=function(){return(this.words[0]&1)===1},c.prototype.andln=function(d){return this.words[0]&d},c.prototype.bincn=function(d){l(typeof d=="number");var g=d%26,_=(d-g)/26,w=1<<g;if(this.length<=_)return this._expand(_+1),this.words[_]|=w,this;for(var x=w,P=_;x!==0&&P<this.length;P++){var $=this.words[P]|0;$+=x,x=$>>>26,$&=67108863,this.words[P]=$}return x!==0&&(this.words[P]=x,this.length++),this},c.prototype.isZero=function(){return this.length===1&&this.words[0]===0},c.prototype.cmpn=function(d){var g=d<0;if(this.negative!==0&&!g)return-1;if(this.negative===0&&g)return 1;this.strip();var _;if(this.length>1)_=1;else{g&&(d=-d),l(d<=67108863,"Number is too big");var w=this.words[0]|0;_=w===d?0:w<d?-1:1}return this.negative!==0?-_|0:_},c.prototype.cmp=function(d){if(this.negative!==0&&d.negative===0)return-1;if(this.negative===0&&d.negative!==0)return 1;var g=this.ucmp(d);return this.negative!==0?-g|0:g},c.prototype.ucmp=function(d){if(this.length>d.length)return 1;if(this.length<d.length)return-1;for(var g=0,_=this.length-1;_>=0;_--){var w=this.words[_]|0,x=d.words[_]|0;if(w!==x){w<x?g=-1:w>x&&(g=1);break}}return g},c.prototype.gtn=function(d){return this.cmpn(d)===1},c.prototype.gt=function(d){return this.cmp(d)===1},c.prototype.gten=function(d){return this.cmpn(d)>=0},c.prototype.gte=function(d){return this.cmp(d)>=0},c.prototype.ltn=function(d){return this.cmpn(d)===-1},c.prototype.lt=function(d){return this.cmp(d)===-1},c.prototype.lten=function(d){return this.cmpn(d)<=0},c.prototype.lte=function(d){return this.cmp(d)<=0},c.prototype.eqn=function(d){return this.cmpn(d)===0},c.prototype.eq=function(d){return this.cmp(d)===0},c.red=function(d){return new Q(d)},c.prototype.toRed=function(d){return l(!this.red,"Already a number in reduction context"),l(this.negative===0,"red works only with positives"),d.convertTo(this)._forceRed(d)},c.prototype.fromRed=function(){return l(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},c.prototype._forceRed=function(d){return this.red=d,this},c.prototype.forceRed=function(d){return l(!this.red,"Already a number in reduction context"),this._forceRed(d)},c.prototype.redAdd=function(d){return l(this.red,"redAdd works only with red numbers"),this.red.add(this,d)},c.prototype.redIAdd=function(d){return l(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,d)},c.prototype.redSub=function(d){return l(this.red,"redSub works only with red numbers"),this.red.sub(this,d)},c.prototype.redISub=function(d){return l(this.red,"redISub works only with red numbers"),this.red.isub(this,d)},c.prototype.redShl=function(d){return l(this.red,"redShl works only with red numbers"),this.red.shl(this,d)},c.prototype.redMul=function(d){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.mul(this,d)},c.prototype.redIMul=function(d){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.imul(this,d)},c.prototype.redSqr=function(){return l(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},c.prototype.redISqr=function(){return l(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},c.prototype.redSqrt=function(){return l(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},c.prototype.redInvm=function(){return l(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},c.prototype.redNeg=function(){return l(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},c.prototype.redPow=function(d){return l(this.red&&!d.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,d)};var G={k256:null,p224:null,p192:null,p25519:null};function V(k,d){this.name=k,this.p=new c(d,16),this.n=this.p.bitLength(),this.k=new c(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}V.prototype._tmp=function(){var d=new c(null);return d.words=new Array(Math.ceil(this.n/13)),d},V.prototype.ireduce=function(d){var g=d,_;do this.split(g,this.tmp),g=this.imulK(g),g=g.iadd(this.tmp),_=g.bitLength();while(_>this.n);var w=_<this.n?-1:g.ucmp(this.p);return w===0?(g.words[0]=0,g.length=1):w>0?g.isub(this.p):g.strip!==void 0?g.strip():g._strip(),g},V.prototype.split=function(d,g){d.iushrn(this.n,0,g)},V.prototype.imulK=function(d){return d.imul(this.k)};function U(){V.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}f(U,V),U.prototype.split=function(d,g){for(var _=4194303,w=Math.min(d.length,9),x=0;x<w;x++)g.words[x]=d.words[x];if(g.length=w,d.length<=9){d.words[0]=0,d.length=1;return}var P=d.words[9];for(g.words[g.length++]=P&_,x=10;x<d.length;x++){var $=d.words[x]|0;d.words[x-10]=($&_)<<4|P>>>22,P=$}P>>>=22,d.words[x-10]=P,P===0&&d.length>10?d.length-=10:d.length-=9},U.prototype.imulK=function(d){d.words[d.length]=0,d.words[d.length+1]=0,d.length+=2;for(var g=0,_=0;_<d.length;_++){var w=d.words[_]|0;g+=w*977,d.words[_]=g&67108863,g=w*64+(g/67108864|0)}return d.words[d.length-1]===0&&(d.length--,d.words[d.length-1]===0&&d.length--),d};function te(){V.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}f(te,V);function Z(){V.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}f(Z,V);function J(){V.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}f(J,V),J.prototype.imulK=function(d){for(var g=0,_=0;_<d.length;_++){var w=(d.words[_]|0)*19+g,x=w&67108863;w>>>=26,d.words[_]=x,g=w}return g!==0&&(d.words[d.length++]=g),d},c._prime=function(d){if(G[d])return G[d];var g;if(d==="k256")g=new U;else if(d==="p224")g=new te;else if(d==="p192")g=new Z;else if(d==="p25519")g=new J;else throw new Error("Unknown prime "+d);return G[d]=g,g};function Q(k){if(typeof k=="string"){var d=c._prime(k);this.m=d.p,this.prime=d}else l(k.gtn(1),"modulus must be greater than 1"),this.m=k,this.prime=null}Q.prototype._verify1=function(d){l(d.negative===0,"red works only with positives"),l(d.red,"red works only with red numbers")},Q.prototype._verify2=function(d,g){l((d.negative|g.negative)===0,"red works only with positives"),l(d.red&&d.red===g.red,"red works only with red numbers")},Q.prototype.imod=function(d){return this.prime?this.prime.ireduce(d)._forceRed(this):d.umod(this.m)._forceRed(this)},Q.prototype.neg=function(d){return d.isZero()?d.clone():this.m.sub(d)._forceRed(this)},Q.prototype.add=function(d,g){this._verify2(d,g);var _=d.add(g);return _.cmp(this.m)>=0&&_.isub(this.m),_._forceRed(this)},Q.prototype.iadd=function(d,g){this._verify2(d,g);var _=d.iadd(g);return _.cmp(this.m)>=0&&_.isub(this.m),_},Q.prototype.sub=function(d,g){this._verify2(d,g);var _=d.sub(g);return _.cmpn(0)<0&&_.iadd(this.m),_._forceRed(this)},Q.prototype.isub=function(d,g){this._verify2(d,g);var _=d.isub(g);return _.cmpn(0)<0&&_.iadd(this.m),_},Q.prototype.shl=function(d,g){return this._verify1(d),this.imod(d.ushln(g))},Q.prototype.imul=function(d,g){return this._verify2(d,g),this.imod(d.imul(g))},Q.prototype.mul=function(d,g){return this._verify2(d,g),this.imod(d.mul(g))},Q.prototype.isqr=function(d){return this.imul(d,d.clone())},Q.prototype.sqr=function(d){return this.mul(d,d)},Q.prototype.sqrt=function(d){if(d.isZero())return d.clone();var g=this.m.andln(3);if(l(g%2===1),g===3){var _=this.m.add(new c(1)).iushrn(2);return this.pow(d,_)}for(var w=this.m.subn(1),x=0;!w.isZero()&&w.andln(1)===0;)x++,w.iushrn(1);l(!w.isZero());var P=new c(1).toRed(this),$=P.redNeg(),T=this.m.subn(1).iushrn(1),m=this.m.bitLength();for(m=new c(2*m*m).toRed(this);this.pow(m,T).cmp($)!==0;)m.redIAdd($);for(var M=this.pow(m,w),W=this.pow(d,w.addn(1).iushrn(1)),Y=this.pow(d,w),ue=x;Y.cmp(P)!==0;){for(var ge=Y,he=0;ge.cmp(P)!==0;he++)ge=ge.redSqr();l(he<ue);var ae=this.pow(M,new c(1).iushln(ue-he-1));W=W.redMul(ae),M=ae.redSqr(),Y=Y.redMul(M),ue=he}return W},Q.prototype.invm=function(d){var g=d._invmp(this.m);return g.negative!==0?(g.negative=0,this.imod(g).redNeg()):this.imod(g)},Q.prototype.pow=function(d,g){if(g.isZero())return new c(1).toRed(this);if(g.cmpn(1)===0)return d.clone();var _=4,w=new Array(1<<_);w[0]=new c(1).toRed(this),w[1]=d;for(var x=2;x<w.length;x++)w[x]=this.mul(w[x-1],d);var P=w[0],$=0,T=0,m=g.bitLength()%26;for(m===0&&(m=26),x=g.length-1;x>=0;x--){for(var M=g.words[x],W=m-1;W>=0;W--){var Y=M>>W&1;if(P!==w[0]&&(P=this.sqr(P)),Y===0&&$===0){T=0;continue}$<<=1,$|=Y,T++,!(T!==_&&(x!==0||W!==0))&&(P=this.mul(P,w[$]),T=0,$=0)}m=26}return P},Q.prototype.convertTo=function(d){var g=d.umod(this.m);return g===d?g.clone():g},Q.prototype.convertFrom=function(d){var g=d.clone();return g.red=null,g},c.mont=function(d){return new ee(d)};function ee(k){Q.call(this,k),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new c(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}f(ee,Q),ee.prototype.convertTo=function(d){return this.imod(d.ushln(this.shift))},ee.prototype.convertFrom=function(d){var g=this.imod(d.mul(this.rinv));return g.red=null,g},ee.prototype.imul=function(d,g){if(d.isZero()||g.isZero())return d.words[0]=0,d.length=1,d;var _=d.imul(g),w=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=_.isub(w).iushrn(this.shift),P=x;return x.cmp(this.m)>=0?P=x.isub(this.m):x.cmpn(0)<0&&(P=x.iadd(this.m)),P._forceRed(this)},ee.prototype.mul=function(d,g){if(d.isZero()||g.isZero())return new c(0)._forceRed(this);var _=d.mul(g),w=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=_.isub(w).iushrn(this.shift),P=x;return x.cmp(this.m)>=0?P=x.isub(this.m):x.cmpn(0)<0&&(P=x.iadd(this.m)),P._forceRed(this)},ee.prototype.invm=function(d){var g=this.imod(d._invmp(this.m).mul(this.r2));return g._forceRed(this)}})(s,bn)}(bn$1)),bn$1.exports}var withPublic_1,hasRequiredWithPublic;function requireWithPublic(){if(hasRequiredWithPublic)return withPublic_1;hasRequiredWithPublic=1;var s=requireBn(),a=requireSafeBuffer$2().Buffer;function u(l,f){return a.from(l.toRed(s.mont(f.modulus)).redPow(new s(f.publicExponent)).fromRed().toArray())}return withPublic_1=u,withPublic_1}var publicEncrypt,hasRequiredPublicEncrypt;function requirePublicEncrypt(){if(hasRequiredPublicEncrypt)return publicEncrypt;hasRequiredPublicEncrypt=1;var s=requireParseAsn1(),a=requireBrowser$b(),u=requireBrowser$9(),l=requireMgf(),f=requireXor(),c=requireBn(),h=requireWithPublic(),p=requireBrowserifyRsa(),v=requireSafeBuffer$2().Buffer;publicEncrypt=function(R,O,I){var B;R.padding?B=R.padding:I?B=1:B=4;var N=s(R),D;if(B===4)D=y(N,O);else if(B===1)D=b(N,O,I);else if(B===3){if(D=new c(O),D.cmp(N.modulus)>=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return I?p(D,N):h(D,N)};function y(E,R){var O=E.modulus.byteLength(),I=R.length,B=u("sha1").update(v.alloc(0)).digest(),N=B.length,D=2*N;if(I>O-D-2)throw new Error("message too long");var G=v.alloc(O-I-D-2),V=O-N-1,U=a(N),te=f(v.concat([B,G,v.alloc(1,1),R],V),l(U,V)),Z=f(U,l(te,N));return new c(v.concat([v.alloc(1),Z,te],O))}function b(E,R,O){var I=R.length,B=E.modulus.byteLength();if(I>B-11)throw new Error("message too long");var N;return O?N=v.alloc(B-I-3,255):N=S(B-I-3),new c(v.concat([v.from([0,O?1:2]),N,v.alloc(1),R],B))}function S(E){for(var R=v.allocUnsafe(E),O=0,I=a(E*2),B=0,N;O<E;)B===I.length&&(I=a(E*2),B=0),N=I[B++],N&&(R[O++]=N);return R}return publicEncrypt}var privateDecrypt,hasRequiredPrivateDecrypt;function requirePrivateDecrypt(){if(hasRequiredPrivateDecrypt)return privateDecrypt;hasRequiredPrivateDecrypt=1;var s=requireParseAsn1(),a=requireMgf(),u=requireXor(),l=requireBn(),f=requireBrowserifyRsa(),c=requireBrowser$9(),h=requireWithPublic(),p=requireSafeBuffer$2().Buffer;privateDecrypt=function(E,R,O){var I;E.padding?I=E.padding:O?I=1:I=4;var B=s(E),N=B.modulus.byteLength();if(R.length>N||new l(R).cmp(B.modulus)>=0)throw new Error("decryption error");var D;O?D=h(new l(R),B):D=f(R,B);var G=p.alloc(N-D.length);if(D=p.concat([G,D],N),I===4)return v(B,D);if(I===1)return y(B,D,O);if(I===3)return D;throw new Error("unknown padding")};function v(S,E){var R=S.modulus.byteLength(),O=c("sha1").update(p.alloc(0)).digest(),I=O.length;if(E[0]!==0)throw new Error("decryption error");var B=E.slice(1,I+1),N=E.slice(I+1),D=u(B,a(N,I)),G=u(N,a(D,R-I-1));if(b(O,G.slice(0,I)))throw new Error("decryption error");for(var V=I;G[V]===0;)V++;if(G[V++]!==1)throw new Error("decryption error");return G.slice(V)}function y(S,E,R){for(var O=E.slice(0,2),I=2,B=0;E[I++]!==0;)if(I>=E.length){B++;break}var N=E.slice(2,I-1);if((O.toString("hex")!=="0002"&&!R||O.toString("hex")!=="0001"&&R)&&B++,N.length<8&&B++,B)throw new Error("decryption error");return E.slice(I)}function b(S,E){S=p.from(S),E=p.from(E);var R=0,O=S.length;S.length!==E.length&&(R++,O=Math.min(S.length,E.length));for(var I=-1;++I<O;)R+=S[I]^E[I];return R}return privateDecrypt}var hasRequiredBrowser$1;function requireBrowser$1(){return hasRequiredBrowser$1||(hasRequiredBrowser$1=1,function(s){s.publicEncrypt=requirePublicEncrypt(),s.privateDecrypt=requirePrivateDecrypt(),s.privateEncrypt=function(u,l){return s.publicEncrypt(u,l,!0)},s.publicDecrypt=function(u,l){return s.privateDecrypt(u,l,!0)}}(browser$1)),browser$1}var browser={},hasRequiredBrowser;function requireBrowser(){if(hasRequiredBrowser)return browser;hasRequiredBrowser=1;function s(){throw new Error(`secure random number generation not supported by this browser
use chrome, FireFox or Internet Explorer 11`)}var a=requireSafeBuffer$2(),u=requireBrowser$b(),l=a.Buffer,f=a.kMaxLength,c=commonjsGlobal.crypto||commonjsGlobal.msCrypto,h=Math.pow(2,32)-1;function p(E,R){if(typeof E!="number"||E!==E)throw new TypeError("offset must be a number");if(E>h||E<0)throw new TypeError("offset must be a uint32");if(E>f||E>R)throw new RangeError("offset out of range")}function v(E,R,O){if(typeof E!="number"||E!==E)throw new TypeError("size must be a number");if(E>h||E<0)throw new TypeError("size must be a uint32");if(E+R>O||E>f)throw new RangeError("buffer too small")}c&&c.getRandomValues||!distExports.process.browser?(browser.randomFill=y,browser.randomFillSync=S):(browser.randomFill=s,browser.randomFillSync=s);function y(E,R,O,I){if(!l.isBuffer(E)&&!(E instanceof commonjsGlobal.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof R=="function")I=R,R=0,O=E.length;else if(typeof O=="function")I=O,O=E.length-R;else if(typeof I!="function")throw new TypeError('"cb" argument must be a function');return p(R,E.length),v(O,R,E.length),b(E,R,O,I)}function b(E,R,O,I){if(distExports.process.browser){var B=E.buffer,N=new Uint8Array(B,R,O);if(c.getRandomValues(N),I){distExports.process.nextTick(function(){I(null,E)});return}return E}if(I){u(O,function(G,V){if(G)return I(G);V.copy(E,R),I(null,E)});return}var D=u(O);return D.copy(E,R),E}function S(E,R,O){if(typeof R>"u"&&(R=0),!l.isBuffer(E)&&!(E instanceof commonjsGlobal.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return p(R,E.length),O===void 0&&(O=E.length-R),v(O,R,E.length),b(E,R,O)}return browser}var hasRequiredCryptoBrowserify;function requireCryptoBrowserify(){if(hasRequiredCryptoBrowserify)return cryptoBrowserify;hasRequiredCryptoBrowserify=1,cryptoBrowserify.randomBytes=cryptoBrowserify.rng=cryptoBrowserify.pseudoRandomBytes=cryptoBrowserify.prng=requireBrowser$b(),cryptoBrowserify.createHash=cryptoBrowserify.Hash=requireBrowser$9(),cryptoBrowserify.createHmac=cryptoBrowserify.Hmac=requireBrowser$8();var s=requireAlgos(),a=Object.keys(s),u=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(a);cryptoBrowserify.getHashes=function(){return u};var l=requireBrowser$7();cryptoBrowserify.pbkdf2=l.pbkdf2,cryptoBrowserify.pbkdf2Sync=l.pbkdf2Sync;var f=requireBrowser$5();cryptoBrowserify.Cipher=f.Cipher,cryptoBrowserify.createCipher=f.createCipher,cryptoBrowserify.Cipheriv=f.Cipheriv,cryptoBrowserify.createCipheriv=f.createCipheriv,cryptoBrowserify.Decipher=f.Decipher,cryptoBrowserify.createDecipher=f.createDecipher,cryptoBrowserify.Decipheriv=f.Decipheriv,cryptoBrowserify.createDecipheriv=f.createDecipheriv,cryptoBrowserify.getCiphers=f.getCiphers,cryptoBrowserify.listCiphers=f.listCiphers;var c=requireBrowser$4();cryptoBrowserify.DiffieHellmanGroup=c.DiffieHellmanGroup,cryptoBrowserify.createDiffieHellmanGroup=c.createDiffieHellmanGroup,cryptoBrowserify.getDiffieHellman=c.getDiffieHellman,cryptoBrowserify.createDiffieHellman=c.createDiffieHellman,cryptoBrowserify.DiffieHellman=c.DiffieHellman;var h=requireBrowser$3();cryptoBrowserify.createSign=h.createSign,cryptoBrowserify.Sign=h.Sign,cryptoBrowserify.createVerify=h.createVerify,cryptoBrowserify.Verify=h.Verify,cryptoBrowserify.createECDH=requireBrowser$2();var p=requireBrowser$1();cryptoBrowserify.publicEncrypt=p.publicEncrypt,cryptoBrowserify.privateEncrypt=p.privateEncrypt,cryptoBrowserify.publicDecrypt=p.publicDecrypt,cryptoBrowserify.privateDecrypt=p.privateDecrypt;var v=requireBrowser();return cryptoBrowserify.randomFill=v.randomFill,cryptoBrowserify.randomFillSync=v.randomFillSync,cryptoBrowserify.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join(`
`))},cryptoBrowserify.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6},cryptoBrowserify}var hasRequiredNode$2;function requireNode$2(){if(hasRequiredNode$2)return node$3;hasRequiredNode$2=1,Object.defineProperty(node$3,"__esModule",{value:!0}),node$3.NodeRandomSource=void 0;const s=requireWipe();class a{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof commonjsRequire<"u"){const l=requireCryptoBrowserify();l&&l.randomBytes&&(this._crypto=l,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(l){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let f=this._crypto.randomBytes(l);if(f.length!==l)throw new Error("NodeRandomSource: got fewer bytes than requested");const c=new Uint8Array(l);for(let h=0;h<c.length;h++)c[h]=f[h];return(0,s.wipe)(f),c}}return node$3.NodeRandomSource=a,node$3}var hasRequiredSystem;function requireSystem(){if(hasRequiredSystem)return system;hasRequiredSystem=1,Object.defineProperty(system,"__esModule",{value:!0}),system.SystemRandomSource=void 0;const s=requireBrowser$d(),a=requireNode$2();class u{constructor(){if(this.isAvailable=!1,this.name="",this._source=new s.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new a.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(f){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(f)}}return system.SystemRandomSource=u,system}var binary={},int={},hasRequiredInt;function requireInt(){return hasRequiredInt||(hasRequiredInt=1,function(s){Object.defineProperty(s,"__esModule",{value:!0});function a(p,v){var y=p>>>16&65535,b=p&65535,S=v>>>16&65535,E=v&65535;return b*E+(y*E+b*S<<16>>>0)|0}s.mul=Math.imul||a;function u(p,v){return p+v|0}s.add=u;function l(p,v){return p-v|0}s.sub=l;function f(p,v){return p<<v|p>>>32-v}s.rotl=f;function c(p,v){return p<<32-v|p>>>v}s.rotr=c;function h(p){return typeof p=="number"&&isFinite(p)&&Math.floor(p)===p}s.isInteger=Number.isInteger||h,s.MAX_SAFE_INTEGER=9007199254740991,s.isSafeInteger=function(p){return s.isInteger(p)&&p>=-s.MAX_SAFE_INTEGER&&p<=s.MAX_SAFE_INTEGER}}(int)),int}var hasRequiredBinary;function requireBinary(){if(hasRequiredBinary)return binary;hasRequiredBinary=1,Object.defineProperty(binary,"__esModule",{value:!0});var s=requireInt();function a(w,x){return x===void 0&&(x=0),(w[x+0]<<8|w[x+1])<<16>>16}binary.readInt16BE=a;function u(w,x){return x===void 0&&(x=0),(w[x+0]<<8|w[x+1])>>>0}binary.readUint16BE=u;function l(w,x){return x===void 0&&(x=0),(w[x+1]<<8|w[x])<<16>>16}binary.readInt16LE=l;function f(w,x){return x===void 0&&(x=0),(w[x+1]<<8|w[x])>>>0}binary.readUint16LE=f;function c(w,x,P){return x===void 0&&(x=new Uint8Array(2)),P===void 0&&(P=0),x[P+0]=w>>>8,x[P+1]=w>>>0,x}binary.writeUint16BE=c,binary.writeInt16BE=c;function h(w,x,P){return x===void 0&&(x=new Uint8Array(2)),P===void 0&&(P=0),x[P+0]=w>>>0,x[P+1]=w>>>8,x}binary.writeUint16LE=h,binary.writeInt16LE=h;function p(w,x){return x===void 0&&(x=0),w[x]<<24|w[x+1]<<16|w[x+2]<<8|w[x+3]}binary.readInt32BE=p;function v(w,x){return x===void 0&&(x=0),(w[x]<<24|w[x+1]<<16|w[x+2]<<8|w[x+3])>>>0}binary.readUint32BE=v;function y(w,x){return x===void 0&&(x=0),w[x+3]<<24|w[x+2]<<16|w[x+1]<<8|w[x]}binary.readInt32LE=y;function b(w,x){return x===void 0&&(x=0),(w[x+3]<<24|w[x+2]<<16|w[x+1]<<8|w[x])>>>0}binary.readUint32LE=b;function S(w,x,P){return x===void 0&&(x=new Uint8Array(4)),P===void 0&&(P=0),x[P+0]=w>>>24,x[P+1]=w>>>16,x[P+2]=w>>>8,x[P+3]=w>>>0,x}binary.writeUint32BE=S,binary.writeInt32BE=S;function E(w,x,P){return x===void 0&&(x=new Uint8Array(4)),P===void 0&&(P=0),x[P+0]=w>>>0,x[P+1]=w>>>8,x[P+2]=w>>>16,x[P+3]=w>>>24,x}binary.writeUint32LE=E,binary.writeInt32LE=E;function R(w,x){x===void 0&&(x=0);var P=p(w,x),$=p(w,x+4);return P*4294967296+$-($>>31)*4294967296}binary.readInt64BE=R;function O(w,x){x===void 0&&(x=0);var P=v(w,x),$=v(w,x+4);return P*4294967296+$}binary.readUint64BE=O;function I(w,x){x===void 0&&(x=0);var P=y(w,x),$=y(w,x+4);return $*4294967296+P-(P>>31)*4294967296}binary.readInt64LE=I;function B(w,x){x===void 0&&(x=0);var P=b(w,x),$=b(w,x+4);return $*4294967296+P}binary.readUint64LE=B;function N(w,x,P){return x===void 0&&(x=new Uint8Array(8)),P===void 0&&(P=0),S(w/4294967296>>>0,x,P),S(w>>>0,x,P+4),x}binary.writeUint64BE=N,binary.writeInt64BE=N;function D(w,x,P){return x===void 0&&(x=new Uint8Array(8)),P===void 0&&(P=0),E(w>>>0,x,P),E(w/4294967296>>>0,x,P+4),x}binary.writeUint64LE=D,binary.writeInt64LE=D;function G(w,x,P){if(P===void 0&&(P=0),w%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(w/8>x.length-P)throw new Error("readUintBE: array is too short for the given bitLength");for(var $=0,T=1,m=w/8+P-1;m>=P;m--)$+=x[m]*T,T*=256;return $}binary.readUintBE=G;function V(w,x,P){if(P===void 0&&(P=0),w%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(w/8>x.length-P)throw new Error("readUintLE: array is too short for the given bitLength");for(var $=0,T=1,m=P;m<P+w/8;m++)$+=x[m]*T,T*=256;return $}binary.readUintLE=V;function U(w,x,P,$){if(P===void 0&&(P=new Uint8Array(w/8)),$===void 0&&($=0),w%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!s.isSafeInteger(x))throw new Error("writeUintBE value must be an integer");for(var T=1,m=w/8+$-1;m>=$;m--)P[m]=x/T&255,T*=256;return P}binary.writeUintBE=U;function te(w,x,P,$){if(P===void 0&&(P=new Uint8Array(w/8)),$===void 0&&($=0),w%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!s.isSafeInteger(x))throw new Error("writeUintLE value must be an integer");for(var T=1,m=$;m<$+w/8;m++)P[m]=x/T&255,T*=256;return P}binary.writeUintLE=te;function Z(w,x){x===void 0&&(x=0);var P=new DataView(w.buffer,w.byteOffset,w.byteLength);return P.getFloat32(x)}binary.readFloat32BE=Z;function J(w,x){x===void 0&&(x=0);var P=new DataView(w.buffer,w.byteOffset,w.byteLength);return P.getFloat32(x,!0)}binary.readFloat32LE=J;function Q(w,x){x===void 0&&(x=0);var P=new DataView(w.buffer,w.byteOffset,w.byteLength);return P.getFloat64(x)}binary.readFloat64BE=Q;function ee(w,x){x===void 0&&(x=0);var P=new DataView(w.buffer,w.byteOffset,w.byteLength);return P.getFloat64(x,!0)}binary.readFloat64LE=ee;function k(w,x,P){x===void 0&&(x=new Uint8Array(4)),P===void 0&&(P=0);var $=new DataView(x.buffer,x.byteOffset,x.byteLength);return $.setFloat32(P,w),x}binary.writeFloat32BE=k;function d(w,x,P){x===void 0&&(x=new Uint8Array(4)),P===void 0&&(P=0);var $=new DataView(x.buffer,x.byteOffset,x.byteLength);return $.setFloat32(P,w,!0),x}binary.writeFloat32LE=d;function g(w,x,P){x===void 0&&(x=new Uint8Array(8)),P===void 0&&(P=0);var $=new DataView(x.buffer,x.byteOffset,x.byteLength);return $.setFloat64(P,w),x}binary.writeFloat64BE=g;function _(w,x,P){x===void 0&&(x=new Uint8Array(8)),P===void 0&&(P=0);var $=new DataView(x.buffer,x.byteOffset,x.byteLength);return $.setFloat64(P,w,!0),x}return binary.writeFloat64LE=_,binary}var hasRequiredRandom;function requireRandom(){return hasRequiredRandom||(hasRequiredRandom=1,function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.randomStringForEntropy=s.randomString=s.randomUint32=s.randomBytes=s.defaultRandomSource=void 0;const a=requireSystem(),u=requireBinary(),l=requireWipe();s.defaultRandomSource=new a.SystemRandomSource;function f(y,b=s.defaultRandomSource){return b.randomBytes(y)}s.randomBytes=f;function c(y=s.defaultRandomSource){const b=f(4,y),S=(0,u.readUint32LE)(b);return(0,l.wipe)(b),S}s.randomUint32=c;const h="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function p(y,b=h,S=s.defaultRandomSource){if(b.length<2)throw new Error("randomString charset is too short");if(b.length>256)throw new Error("randomString charset is too long");let E="";const R=b.length,O=256-256%R;for(;y>0;){const I=f(Math.ceil(y*256/O),S);for(let B=0;B<I.length&&y>0;B++){const N=I[B];N<O&&(E+=b.charAt(N%R),y--)}(0,l.wipe)(I)}return E}s.randomString=p;function v(y,b=h,S=s.defaultRandomSource){const E=Math.ceil(y/(Math.log(b.length)/Math.LN2));return p(E,b,S)}s.randomStringForEntropy=v}(random)),random}var hasRequiredX25519;function requireX25519(){return hasRequiredX25519||(hasRequiredX25519=1,function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.sharedKey=s.generateKeyPair=s.generateKeyPairFromSeed=s.scalarMultBase=s.scalarMult=s.SHARED_KEY_LENGTH=s.SECRET_KEY_LENGTH=s.PUBLIC_KEY_LENGTH=void 0;const a=requireRandom(),u=requireWipe();s.PUBLIC_KEY_LENGTH=32,s.SECRET_KEY_LENGTH=32,s.SHARED_KEY_LENGTH=32;function l(V){const U=new Float64Array(16);if(V)for(let te=0;te<V.length;te++)U[te]=V[te];return U}const f=new Uint8Array(32);f[0]=9;const c=l([56129,1]);function h(V){let U=1;for(let te=0;te<16;te++){let Z=V[te]+U+65535;U=Math.floor(Z/65536),V[te]=Z-U*65536}V[0]+=U-1+37*(U-1)}function p(V,U,te){const Z=~(te-1);for(let J=0;J<16;J++){const Q=Z&(V[J]^U[J]);V[J]^=Q,U[J]^=Q}}function v(V,U){const te=l(),Z=l();for(let J=0;J<16;J++)Z[J]=U[J];h(Z),h(Z),h(Z);for(let J=0;J<2;J++){te[0]=Z[0]-65517;for(let ee=1;ee<15;ee++)te[ee]=Z[ee]-65535-(te[ee-1]>>16&1),te[ee-1]&=65535;te[15]=Z[15]-32767-(te[14]>>16&1);const Q=te[15]>>16&1;te[14]&=65535,p(Z,te,1-Q)}for(let J=0;J<16;J++)V[2*J]=Z[J]&255,V[2*J+1]=Z[J]>>8}function y(V,U){for(let te=0;te<16;te++)V[te]=U[2*te]+(U[2*te+1]<<8);V[15]&=32767}function b(V,U,te){for(let Z=0;Z<16;Z++)V[Z]=U[Z]+te[Z]}function S(V,U,te){for(let Z=0;Z<16;Z++)V[Z]=U[Z]-te[Z]}function E(V,U,te){let Z,J,Q=0,ee=0,k=0,d=0,g=0,_=0,w=0,x=0,P=0,$=0,T=0,m=0,M=0,W=0,Y=0,ue=0,ge=0,he=0,ae=0,de=0,pe=0,oe=0,le=0,me=0,xe=0,Ne=0,Pe=0,Ie=0,Ke=0,Le=0,Ce=0,at=te[0],Oe=te[1],De=te[2],yt=te[3],Ue=te[4],ze=te[5],Mt=te[6],se=te[7],j=te[8],X=te[9],ce=te[10],be=te[11],Re=te[12],Se=te[13],qe=te[14],bt=te[15];Z=U[0],Q+=Z*at,ee+=Z*Oe,k+=Z*De,d+=Z*yt,g+=Z*Ue,_+=Z*ze,w+=Z*Mt,x+=Z*se,P+=Z*j,$+=Z*X,T+=Z*ce,m+=Z*be,M+=Z*Re,W+=Z*Se,Y+=Z*qe,ue+=Z*bt,Z=U[1],ee+=Z*at,k+=Z*Oe,d+=Z*De,g+=Z*yt,_+=Z*Ue,w+=Z*ze,x+=Z*Mt,P+=Z*se,$+=Z*j,T+=Z*X,m+=Z*ce,M+=Z*be,W+=Z*Re,Y+=Z*Se,ue+=Z*qe,ge+=Z*bt,Z=U[2],k+=Z*at,d+=Z*Oe,g+=Z*De,_+=Z*yt,w+=Z*Ue,x+=Z*ze,P+=Z*Mt,$+=Z*se,T+=Z*j,m+=Z*X,M+=Z*ce,W+=Z*be,Y+=Z*Re,ue+=Z*Se,ge+=Z*qe,he+=Z*bt,Z=U[3],d+=Z*at,g+=Z*Oe,_+=Z*De,w+=Z*yt,x+=Z*Ue,P+=Z*ze,$+=Z*Mt,T+=Z*se,m+=Z*j,M+=Z*X,W+=Z*ce,Y+=Z*be,ue+=Z*Re,ge+=Z*Se,he+=Z*qe,ae+=Z*bt,Z=U[4],g+=Z*at,_+=Z*Oe,w+=Z*De,x+=Z*yt,P+=Z*Ue,$+=Z*ze,T+=Z*Mt,m+=Z*se,M+=Z*j,W+=Z*X,Y+=Z*ce,ue+=Z*be,ge+=Z*Re,he+=Z*Se,ae+=Z*qe,de+=Z*bt,Z=U[5],_+=Z*at,w+=Z*Oe,x+=Z*De,P+=Z*yt,$+=Z*Ue,T+=Z*ze,m+=Z*Mt,M+=Z*se,W+=Z*j,Y+=Z*X,ue+=Z*ce,ge+=Z*be,he+=Z*Re,ae+=Z*Se,de+=Z*qe,pe+=Z*bt,Z=U[6],w+=Z*at,x+=Z*Oe,P+=Z*De,$+=Z*yt,T+=Z*Ue,m+=Z*ze,M+=Z*Mt,W+=Z*se,Y+=Z*j,ue+=Z*X,ge+=Z*ce,he+=Z*be,ae+=Z*Re,de+=Z*Se,pe+=Z*qe,oe+=Z*bt,Z=U[7],x+=Z*at,P+=Z*Oe,$+=Z*De,T+=Z*yt,m+=Z*Ue,M+=Z*ze,W+=Z*Mt,Y+=Z*se,ue+=Z*j,ge+=Z*X,he+=Z*ce,ae+=Z*be,de+=Z*Re,pe+=Z*Se,oe+=Z*qe,le+=Z*bt,Z=U[8],P+=Z*at,$+=Z*Oe,T+=Z*De,m+=Z*yt,M+=Z*Ue,W+=Z*ze,Y+=Z*Mt,ue+=Z*se,ge+=Z*j,he+=Z*X,ae+=Z*ce,de+=Z*be,pe+=Z*Re,oe+=Z*Se,le+=Z*qe,me+=Z*bt,Z=U[9],$+=Z*at,T+=Z*Oe,m+=Z*De,M+=Z*yt,W+=Z*Ue,Y+=Z*ze,ue+=Z*Mt,ge+=Z*se,he+=Z*j,ae+=Z*X,de+=Z*ce,pe+=Z*be,oe+=Z*Re,le+=Z*Se,me+=Z*qe,xe+=Z*bt,Z=U[10],T+=Z*at,m+=Z*Oe,M+=Z*De,W+=Z*yt,Y+=Z*Ue,ue+=Z*ze,ge+=Z*Mt,he+=Z*se,ae+=Z*j,de+=Z*X,pe+=Z*ce,oe+=Z*be,le+=Z*Re,me+=Z*Se,xe+=Z*qe,Ne+=Z*bt,Z=U[11],m+=Z*at,M+=Z*Oe,W+=Z*De,Y+=Z*yt,ue+=Z*Ue,ge+=Z*ze,he+=Z*Mt,ae+=Z*se,de+=Z*j,pe+=Z*X,oe+=Z*ce,le+=Z*be,me+=Z*Re,xe+=Z*Se,Ne+=Z*qe,Pe+=Z*bt,Z=U[12],M+=Z*at,W+=Z*Oe,Y+=Z*De,ue+=Z*yt,ge+=Z*Ue,he+=Z*ze,ae+=Z*Mt,de+=Z*se,pe+=Z*j,oe+=Z*X,le+=Z*ce,me+=Z*be,xe+=Z*Re,Ne+=Z*Se,Pe+=Z*qe,Ie+=Z*bt,Z=U[13],W+=Z*at,Y+=Z*Oe,ue+=Z*De,ge+=Z*yt,he+=Z*Ue,ae+=Z*ze,de+=Z*Mt,pe+=Z*se,oe+=Z*j,le+=Z*X,me+=Z*ce,xe+=Z*be,Ne+=Z*Re,Pe+=Z*Se,Ie+=Z*qe,Ke+=Z*bt,Z=U[14],Y+=Z*at,ue+=Z*Oe,ge+=Z*De,he+=Z*yt,ae+=Z*Ue,de+=Z*ze,pe+=Z*Mt,oe+=Z*se,le+=Z*j,me+=Z*X,xe+=Z*ce,Ne+=Z*be,Pe+=Z*Re,Ie+=Z*Se,Ke+=Z*qe,Le+=Z*bt,Z=U[15],ue+=Z*at,ge+=Z*Oe,he+=Z*De,ae+=Z*yt,de+=Z*Ue,pe+=Z*ze,oe+=Z*Mt,le+=Z*se,me+=Z*j,xe+=Z*X,Ne+=Z*ce,Pe+=Z*be,Ie+=Z*Re,Ke+=Z*Se,Le+=Z*qe,Ce+=Z*bt,Q+=38*ge,ee+=38*he,k+=38*ae,d+=38*de,g+=38*pe,_+=38*oe,w+=38*le,x+=38*me,P+=38*xe,$+=38*Ne,T+=38*Pe,m+=38*Ie,M+=38*Ke,W+=38*Le,Y+=38*Ce,J=1,Z=Q+J+65535,J=Math.floor(Z/65536),Q=Z-J*65536,Z=ee+J+65535,J=Math.floor(Z/65536),ee=Z-J*65536,Z=k+J+65535,J=Math.floor(Z/65536),k=Z-J*65536,Z=d+J+65535,J=Math.floor(Z/65536),d=Z-J*65536,Z=g+J+65535,J=Math.floor(Z/65536),g=Z-J*65536,Z=_+J+65535,J=Math.floor(Z/65536),_=Z-J*65536,Z=w+J+65535,J=Math.floor(Z/65536),w=Z-J*65536,Z=x+J+65535,J=Math.floor(Z/65536),x=Z-J*65536,Z=P+J+65535,J=Math.floor(Z/65536),P=Z-J*65536,Z=$+J+65535,J=Math.floor(Z/65536),$=Z-J*65536,Z=T+J+65535,J=Math.floor(Z/65536),T=Z-J*65536,Z=m+J+65535,J=Math.floor(Z/65536),m=Z-J*65536,Z=M+J+65535,J=Math.floor(Z/65536),M=Z-J*65536,Z=W+J+65535,J=Math.floor(Z/65536),W=Z-J*65536,Z=Y+J+65535,J=Math.floor(Z/65536),Y=Z-J*65536,Z=ue+J+65535,J=Math.floor(Z/65536),ue=Z-J*65536,Q+=J-1+37*(J-1),J=1,Z=Q+J+65535,J=Math.floor(Z/65536),Q=Z-J*65536,Z=ee+J+65535,J=Math.floor(Z/65536),ee=Z-J*65536,Z=k+J+65535,J=Math.floor(Z/65536),k=Z-J*65536,Z=d+J+65535,J=Math.floor(Z/65536),d=Z-J*65536,Z=g+J+65535,J=Math.floor(Z/65536),g=Z-J*65536,Z=_+J+65535,J=Math.floor(Z/65536),_=Z-J*65536,Z=w+J+65535,J=Math.floor(Z/65536),w=Z-J*65536,Z=x+J+65535,J=Math.floor(Z/65536),x=Z-J*65536,Z=P+J+65535,J=Math.floor(Z/65536),P=Z-J*65536,Z=$+J+65535,J=Math.floor(Z/65536),$=Z-J*65536,Z=T+J+65535,J=Math.floor(Z/65536),T=Z-J*65536,Z=m+J+65535,J=Math.floor(Z/65536),m=Z-J*65536,Z=M+J+65535,J=Math.floor(Z/65536),M=Z-J*65536,Z=W+J+65535,J=Math.floor(Z/65536),W=Z-J*65536,Z=Y+J+65535,J=Math.floor(Z/65536),Y=Z-J*65536,Z=ue+J+65535,J=Math.floor(Z/65536),ue=Z-J*65536,Q+=J-1+37*(J-1),V[0]=Q,V[1]=ee,V[2]=k,V[3]=d,V[4]=g,V[5]=_,V[6]=w,V[7]=x,V[8]=P,V[9]=$,V[10]=T,V[11]=m,V[12]=M,V[13]=W,V[14]=Y,V[15]=ue}function R(V,U){E(V,U,U)}function O(V,U){const te=l();for(let Z=0;Z<16;Z++)te[Z]=U[Z];for(let Z=253;Z>=0;Z--)R(te,te),Z!==2&&Z!==4&&E(te,te,U);for(let Z=0;Z<16;Z++)V[Z]=te[Z]}function I(V,U){const te=new Uint8Array(32),Z=new Float64Array(80),J=l(),Q=l(),ee=l(),k=l(),d=l(),g=l();for(let P=0;P<31;P++)te[P]=V[P];te[31]=V[31]&127|64,te[0]&=248,y(Z,U);for(let P=0;P<16;P++)Q[P]=Z[P];J[0]=k[0]=1;for(let P=254;P>=0;--P){const $=te[P>>>3]>>>(P&7)&1;p(J,Q,$),p(ee,k,$),b(d,J,ee),S(J,J,ee),b(ee,Q,k),S(Q,Q,k),R(k,d),R(g,J),E(J,ee,J),E(ee,Q,d),b(d,J,ee),S(J,J,ee),R(Q,J),S(ee,k,g),E(J,ee,c),b(J,J,k),E(ee,ee,J),E(J,k,g),E(k,Q,Z),R(Q,d),p(J,Q,$),p(ee,k,$)}for(let P=0;P<16;P++)Z[P+16]=J[P],Z[P+32]=ee[P],Z[P+48]=Q[P],Z[P+64]=k[P];const _=Z.subarray(32),w=Z.subarray(16);O(_,_),E(w,w,_);const x=new Uint8Array(32);return v(x,w),x}s.scalarMult=I;function B(V){return I(V,f)}s.scalarMultBase=B;function N(V){if(V.length!==s.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${s.SECRET_KEY_LENGTH} bytes`);const U=new Uint8Array(V);return{publicKey:B(U),secretKey:U}}s.generateKeyPairFromSeed=N;function D(V){const U=(0,a.randomBytes)(32,V),te=N(U);return(0,u.wipe)(U),te}s.generateKeyPair=D;function G(V,U,te=!1){if(V.length!==s.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(U.length!==s.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const Z=I(V,U);if(te){let J=0;for(let Q=0;Q<Z.length;Q++)J|=Z[Q];if(J===0)throw new Error("X25519: invalid shared key")}return Z}s.sharedKey=G}(x25519)),x25519}var xsalsa20={},salsa20={},hasRequiredSalsa20;function requireSalsa20(){if(hasRequiredSalsa20)return salsa20;hasRequiredSalsa20=1,Object.defineProperty(salsa20,"__esModule",{value:!0});var s=requireBinary(),a=requireWipe(),u=20;function l(p,v,y){for(var b=1634760805,S=y[3]<<24|y[2]<<16|y[1]<<8|y[0],E=y[7]<<24|y[6]<<16|y[5]<<8|y[4],R=y[11]<<24|y[10]<<16|y[9]<<8|y[8],O=y[15]<<24|y[14]<<16|y[13]<<8|y[12],I=857760878,B=v[3]<<24|v[2]<<16|v[1]<<8|v[0],N=v[7]<<24|v[6]<<16|v[5]<<8|v[4],D=v[11]<<24|v[10]<<16|v[9]<<8|v[8],G=v[15]<<24|v[14]<<16|v[13]<<8|v[12],V=2036477234,U=y[19]<<24|y[18]<<16|y[17]<<8|y[16],te=y[23]<<24|y[22]<<16|y[21]<<8|y[20],Z=y[27]<<24|y[26]<<16|y[25]<<8|y[24],J=y[31]<<24|y[30]<<16|y[29]<<8|y[28],Q=1797285236,ee=b,k=S,d=E,g=R,_=O,w=I,x=B,P=N,$=D,T=G,m=V,M=U,W=te,Y=Z,ue=J,ge=Q,he,ae=0;ae<u;ae+=2)he=ee+W|0,_^=he<<7|he>>>25,he=_+ee|0,$^=he<<9|he>>>23,he=$+_|0,W^=he<<13|he>>>19,he=W+$|0,ee^=he<<18|he>>>14,he=w+k|0,T^=he<<7|he>>>25,he=T+w|0,Y^=he<<9|he>>>23,he=Y+T|0,k^=he<<13|he>>>19,he=k+Y|0,w^=he<<18|he>>>14,he=m+x|0,ue^=he<<7|he>>>25,he=ue+m|0,d^=he<<9|he>>>23,he=d+ue|0,x^=he<<13|he>>>19,he=x+d|0,m^=he<<18|he>>>14,he=ge+M|0,g^=he<<7|he>>>25,he=g+ge|0,P^=he<<9|he>>>23,he=P+g|0,M^=he<<13|he>>>19,he=M+P|0,ge^=he<<18|he>>>14,he=ee+g|0,k^=he<<7|he>>>25,he=k+ee|0,d^=he<<9|he>>>23,he=d+k|0,g^=he<<13|he>>>19,he=g+d|0,ee^=he<<18|he>>>14,he=w+_|0,x^=he<<7|he>>>25,he=x+w|0,P^=he<<9|he>>>23,he=P+x|0,_^=he<<13|he>>>19,he=_+P|0,w^=he<<18|he>>>14,he=m+T|0,M^=he<<7|he>>>25,he=M+m|0,$^=he<<9|he>>>23,he=$+M|0,T^=he<<13|he>>>19,he=T+$|0,m^=he<<18|he>>>14,he=ge+ue|0,W^=he<<7|he>>>25,he=W+ge|0,Y^=he<<9|he>>>23,he=Y+W|0,ue^=he<<13|he>>>19,he=ue+Y|0,ge^=he<<18|he>>>14;s.writeUint32LE(ee+b|0,p,0),s.writeUint32LE(k+S|0,p,4),s.writeUint32LE(d+E|0,p,8),s.writeUint32LE(g+R|0,p,12),s.writeUint32LE(_+O|0,p,16),s.writeUint32LE(w+I|0,p,20),s.writeUint32LE(x+B|0,p,24),s.writeUint32LE(P+N|0,p,28),s.writeUint32LE($+D|0,p,32),s.writeUint32LE(T+G|0,p,36),s.writeUint32LE(m+V|0,p,40),s.writeUint32LE(M+U|0,p,44),s.writeUint32LE(W+te|0,p,48),s.writeUint32LE(Y+Z|0,p,52),s.writeUint32LE(ue+J|0,p,56),s.writeUint32LE(ge+Q|0,p,60)}function f(p,v,y,b,S){if(S===void 0&&(S=0),p.length!==32)throw new Error("Salsa20: key size must be 32 bytes");if(b.length<y.length)throw new Error("Salsa20: destination is shorter than source");var E,R;if(S===0){if(v.length!==8)throw new Error("Salsa20 nonce must be 8 bytes");E=new Uint8Array(16),E.set(v),R=v.length}else{if(v.length!==16)throw new Error("Salsa20 nonce with counter must be 16 bytes");E=v,R=16-S}for(var O=new Uint8Array(64),I=0;I<y.length;I+=64){l(O,E,p);for(var B=I;B<I+64&&B<y.length;B++)b[B]=y[B]^O[B-I];h(E,R,E.length-R)}return a.wipe(O),S===0&&a.wipe(E),b}salsa20.streamXOR=f;function c(p,v,y,b){return b===void 0&&(b=0),a.wipe(y),f(p,v,y,y,b)}salsa20.stream=c;function h(p,v,y){for(var b=1;y--;)b=b+(p[v]&255)|0,p[v]=b&255,b>>>=8,v++;if(b>0)throw new Error("Salsa20: counter overflow")}return salsa20}var hasRequiredXsalsa20;function requireXsalsa20(){if(hasRequiredXsalsa20)return xsalsa20;hasRequiredXsalsa20=1,Object.defineProperty(xsalsa20,"__esModule",{value:!0});var s=requireBinary(),a=requireSalsa20(),u=requireWipe();function l(p,v,y,b,S){if(S===void 0&&(S=0),S===0){if(v.length!==24)throw new Error("XSalsa20 nonce must be 24 bytes")}else if(v.length!==32)throw new Error("XSalsa20 nonce with counter must be 32 bytes");var E=h(p,v.subarray(0,16),new Uint8Array(32)),R=a.streamXOR(E,v.subarray(16),y,b,S);return u.wipe(E),R}xsalsa20.streamXOR=l;function f(p,v,y,b){return b===void 0&&(b=0),u.wipe(y),l(p,v,y,y,b)}xsalsa20.stream=f;var c=20;function h(p,v,y){for(var b=1634760805,S=p[3]<<24|p[2]<<16|p[1]<<8|p[0],E=p[7]<<24|p[6]<<16|p[5]<<8|p[4],R=p[11]<<24|p[10]<<16|p[9]<<8|p[8],O=p[15]<<24|p[14]<<16|p[13]<<8|p[12],I=857760878,B=v[3]<<24|v[2]<<16|v[1]<<8|v[0],N=v[7]<<24|v[6]<<16|v[5]<<8|v[4],D=v[11]<<24|v[10]<<16|v[9]<<8|v[8],G=v[15]<<24|v[14]<<16|v[13]<<8|v[12],V=2036477234,U=p[19]<<24|p[18]<<16|p[17]<<8|p[16],te=p[23]<<24|p[22]<<16|p[21]<<8|p[20],Z=p[27]<<24|p[26]<<16|p[25]<<8|p[24],J=p[31]<<24|p[30]<<16|p[29]<<8|p[28],Q=1797285236,ee,k=0;k<c;k+=2)ee=b+te|0,O^=ee<<7|ee>>>25,ee=O+b|0,D^=ee<<9|ee>>>23,ee=D+O|0,te^=ee<<13|ee>>>19,ee=te+D|0,b^=ee<<18|ee>>>14,ee=I+S|0,G^=ee<<7|ee>>>25,ee=G+I|0,Z^=ee<<9|ee>>>23,ee=Z+G|0,S^=ee<<13|ee>>>19,ee=S+Z|0,I^=ee<<18|ee>>>14,ee=V+B|0,J^=ee<<7|ee>>>25,ee=J+V|0,E^=ee<<9|ee>>>23,ee=E+J|0,B^=ee<<13|ee>>>19,ee=B+E|0,V^=ee<<18|ee>>>14,ee=Q+U|0,R^=ee<<7|ee>>>25,ee=R+Q|0,N^=ee<<9|ee>>>23,ee=N+R|0,U^=ee<<13|ee>>>19,ee=U+N|0,Q^=ee<<18|ee>>>14,ee=b+R|0,S^=ee<<7|ee>>>25,ee=S+b|0,E^=ee<<9|ee>>>23,ee=E+S|0,R^=ee<<13|ee>>>19,ee=R+E|0,b^=ee<<18|ee>>>14,ee=I+O|0,B^=ee<<7|ee>>>25,ee=B+I|0,N^=ee<<9|ee>>>23,ee=N+B|0,O^=ee<<13|ee>>>19,ee=O+N|0,I^=ee<<18|ee>>>14,ee=V+G|0,U^=ee<<7|ee>>>25,ee=U+V|0,D^=ee<<9|ee>>>23,ee=D+U|0,G^=ee<<13|ee>>>19,ee=G+D|0,V^=ee<<18|ee>>>14,ee=Q+J|0,te^=ee<<7|ee>>>25,ee=te+Q|0,Z^=ee<<9|ee>>>23,ee=Z+te|0,J^=ee<<13|ee>>>19,ee=J+Z|0,Q^=ee<<18|ee>>>14;return s.writeUint32LE(b,y,0),s.writeUint32LE(I,y,4),s.writeUint32LE(V,y,8),s.writeUint32LE(Q,y,12),s.writeUint32LE(B,y,16),s.writeUint32LE(N,y,20),s.writeUint32LE(D,y,24),s.writeUint32LE(G,y,28),y}return xsalsa20.hsalsa=h,xsalsa20}var secretbox={},poly1305={},constantTime={},hasRequiredConstantTime;function requireConstantTime(){if(hasRequiredConstantTime)return constantTime;hasRequiredConstantTime=1,Object.defineProperty(constantTime,"__esModule",{value:!0});function s(f,c,h){return~(f-1)&c|f-1&h}constantTime.select=s;function a(f,c){return(f|0)-(c|0)-1>>>31&1}constantTime.lessOrEqual=a;function u(f,c){if(f.length!==c.length)return 0;for(var h=0,p=0;p<f.length;p++)h|=f[p]^c[p];return 1&h-1>>>8}constantTime.compare=u;function l(f,c){return f.length===0||c.length===0?!1:u(f,c)!==0}return constantTime.equal=l,constantTime}var hasRequiredPoly1305;function requirePoly1305(){return hasRequiredPoly1305||(hasRequiredPoly1305=1,function(s){Object.defineProperty(s,"__esModule",{value:!0});var a=requireConstantTime(),u=requireWipe();s.DIGEST_LENGTH=16;var l=function(){function h(p){this.digestLength=s.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var v=p[0]|p[1]<<8;this._r[0]=v&8191;var y=p[2]|p[3]<<8;this._r[1]=(v>>>13|y<<3)&8191;var b=p[4]|p[5]<<8;this._r[2]=(y>>>10|b<<6)&7939;var S=p[6]|p[7]<<8;this._r[3]=(b>>>7|S<<9)&8191;var E=p[8]|p[9]<<8;this._r[4]=(S>>>4|E<<12)&255,this._r[5]=E>>>1&8190;var R=p[10]|p[11]<<8;this._r[6]=(E>>>14|R<<2)&8191;var O=p[12]|p[13]<<8;this._r[7]=(R>>>11|O<<5)&8065;var I=p[14]|p[15]<<8;this._r[8]=(O>>>8|I<<8)&8191,this._r[9]=I>>>5&127,this._pad[0]=p[16]|p[17]<<8,this._pad[1]=p[18]|p[19]<<8,this._pad[2]=p[20]|p[21]<<8,this._pad[3]=p[22]|p[23]<<8,this._pad[4]=p[24]|p[25]<<8,this._pad[5]=p[26]|p[27]<<8,this._pad[6]=p[28]|p[29]<<8,this._pad[7]=p[30]|p[31]<<8}return h.prototype._blocks=function(p,v,y){for(var b=this._fin?0:2048,S=this._h[0],E=this._h[1],R=this._h[2],O=this._h[3],I=this._h[4],B=this._h[5],N=this._h[6],D=this._h[7],G=this._h[8],V=this._h[9],U=this._r[0],te=this._r[1],Z=this._r[2],J=this._r[3],Q=this._r[4],ee=this._r[5],k=this._r[6],d=this._r[7],g=this._r[8],_=this._r[9];y>=16;){var w=p[v+0]|p[v+1]<<8;S+=w&8191;var x=p[v+2]|p[v+3]<<8;E+=(w>>>13|x<<3)&8191;var P=p[v+4]|p[v+5]<<8;R+=(x>>>10|P<<6)&8191;var $=p[v+6]|p[v+7]<<8;O+=(P>>>7|$<<9)&8191;var T=p[v+8]|p[v+9]<<8;I+=($>>>4|T<<12)&8191,B+=T>>>1&8191;var m=p[v+10]|p[v+11]<<8;N+=(T>>>14|m<<2)&8191;var M=p[v+12]|p[v+13]<<8;D+=(m>>>11|M<<5)&8191;var W=p[v+14]|p[v+15]<<8;G+=(M>>>8|W<<8)&8191,V+=W>>>5|b;var Y=0,ue=Y;ue+=S*U,ue+=E*(5*_),ue+=R*(5*g),ue+=O*(5*d),ue+=I*(5*k),Y=ue>>>13,ue&=8191,ue+=B*(5*ee),ue+=N*(5*Q),ue+=D*(5*J),ue+=G*(5*Z),ue+=V*(5*te),Y+=ue>>>13,ue&=8191;var ge=Y;ge+=S*te,ge+=E*U,ge+=R*(5*_),ge+=O*(5*g),ge+=I*(5*d),Y=ge>>>13,ge&=8191,ge+=B*(5*k),ge+=N*(5*ee),ge+=D*(5*Q),ge+=G*(5*J),ge+=V*(5*Z),Y+=ge>>>13,ge&=8191;var he=Y;he+=S*Z,he+=E*te,he+=R*U,he+=O*(5*_),he+=I*(5*g),Y=he>>>13,he&=8191,he+=B*(5*d),he+=N*(5*k),he+=D*(5*ee),he+=G*(5*Q),he+=V*(5*J),Y+=he>>>13,he&=8191;var ae=Y;ae+=S*J,ae+=E*Z,ae+=R*te,ae+=O*U,ae+=I*(5*_),Y=ae>>>13,ae&=8191,ae+=B*(5*g),ae+=N*(5*d),ae+=D*(5*k),ae+=G*(5*ee),ae+=V*(5*Q),Y+=ae>>>13,ae&=8191;var de=Y;de+=S*Q,de+=E*J,de+=R*Z,de+=O*te,de+=I*U,Y=de>>>13,de&=8191,de+=B*(5*_),de+=N*(5*g),de+=D*(5*d),de+=G*(5*k),de+=V*(5*ee),Y+=de>>>13,de&=8191;var pe=Y;pe+=S*ee,pe+=E*Q,pe+=R*J,pe+=O*Z,pe+=I*te,Y=pe>>>13,pe&=8191,pe+=B*U,pe+=N*(5*_),pe+=D*(5*g),pe+=G*(5*d),pe+=V*(5*k),Y+=pe>>>13,pe&=8191;var oe=Y;oe+=S*k,oe+=E*ee,oe+=R*Q,oe+=O*J,oe+=I*Z,Y=oe>>>13,oe&=8191,oe+=B*te,oe+=N*U,oe+=D*(5*_),oe+=G*(5*g),oe+=V*(5*d),Y+=oe>>>13,oe&=8191;var le=Y;le+=S*d,le+=E*k,le+=R*ee,le+=O*Q,le+=I*J,Y=le>>>13,le&=8191,le+=B*Z,le+=N*te,le+=D*U,le+=G*(5*_),le+=V*(5*g),Y+=le>>>13,le&=8191;var me=Y;me+=S*g,me+=E*d,me+=R*k,me+=O*ee,me+=I*Q,Y=me>>>13,me&=8191,me+=B*J,me+=N*Z,me+=D*te,me+=G*U,me+=V*(5*_),Y+=me>>>13,me&=8191;var xe=Y;xe+=S*_,xe+=E*g,xe+=R*d,xe+=O*k,xe+=I*ee,Y=xe>>>13,xe&=8191,xe+=B*Q,xe+=N*J,xe+=D*Z,xe+=G*te,xe+=V*U,Y+=xe>>>13,xe&=8191,Y=(Y<<2)+Y|0,Y=Y+ue|0,ue=Y&8191,Y=Y>>>13,ge+=Y,S=ue,E=ge,R=he,O=ae,I=de,B=pe,N=oe,D=le,G=me,V=xe,v+=16,y-=16}this._h[0]=S,this._h[1]=E,this._h[2]=R,this._h[3]=O,this._h[4]=I,this._h[5]=B,this._h[6]=N,this._h[7]=D,this._h[8]=G,this._h[9]=V},h.prototype.finish=function(p,v){v===void 0&&(v=0);var y=new Uint16Array(10),b,S,E,R;if(this._leftover){for(R=this._leftover,this._buffer[R++]=1;R<16;R++)this._buffer[R]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(b=this._h[1]>>>13,this._h[1]&=8191,R=2;R<10;R++)this._h[R]+=b,b=this._h[R]>>>13,this._h[R]&=8191;for(this._h[0]+=b*5,b=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=b,b=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=b,y[0]=this._h[0]+5,b=y[0]>>>13,y[0]&=8191,R=1;R<10;R++)y[R]=this._h[R]+b,b=y[R]>>>13,y[R]&=8191;for(y[9]-=8192,S=(b^1)-1,R=0;R<10;R++)y[R]&=S;for(S=~S,R=0;R<10;R++)this._h[R]=this._h[R]&S|y[R];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,E=this._h[0]+this._pad[0],this._h[0]=E&65535,R=1;R<8;R++)E=(this._h[R]+this._pad[R]|0)+(E>>>16)|0,this._h[R]=E&65535;return p[v+0]=this._h[0]>>>0,p[v+1]=this._h[0]>>>8,p[v+2]=this._h[1]>>>0,p[v+3]=this._h[1]>>>8,p[v+4]=this._h[2]>>>0,p[v+5]=this._h[2]>>>8,p[v+6]=this._h[3]>>>0,p[v+7]=this._h[3]>>>8,p[v+8]=this._h[4]>>>0,p[v+9]=this._h[4]>>>8,p[v+10]=this._h[5]>>>0,p[v+11]=this._h[5]>>>8,p[v+12]=this._h[6]>>>0,p[v+13]=this._h[6]>>>8,p[v+14]=this._h[7]>>>0,p[v+15]=this._h[7]>>>8,this._finished=!0,this},h.prototype.update=function(p){var v=0,y=p.length,b;if(this._leftover){b=16-this._leftover,b>y&&(b=y);for(var S=0;S<b;S++)this._buffer[this._leftover+S]=p[v+S];if(y-=b,v+=b,this._leftover+=b,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(y>=16&&(b=y-y%16,this._blocks(p,v,b),v+=b,y-=b),y){for(var S=0;S<y;S++)this._buffer[this._leftover+S]=p[v+S];this._leftover+=y}return this},h.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var p=new Uint8Array(16);return this.finish(p),p},h.prototype.clean=function(){return u.wipe(this._buffer),u.wipe(this._r),u.wipe(this._h),u.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},h}();s.Poly1305=l;function f(h,p){var v=new l(h);v.update(p);var y=v.digest();return v.clean(),y}s.oneTimeAuth=f;function c(h,p){return h.length!==s.DIGEST_LENGTH||p.length!==s.DIGEST_LENGTH?!1:a.equal(h,p)}s.equal=c}(poly1305)),poly1305}var hasRequiredSecretbox;function requireSecretbox(){if(hasRequiredSecretbox)return secretbox;hasRequiredSecretbox=1,Object.defineProperty(secretbox,"__esModule",{value:!0}),secretbox.generateKey=secretbox.openSecretBox=secretbox.secretBox=void 0;const s=requireXsalsa20(),a=requirePoly1305(),u=requireWipe(),l=requireRandom();function f(p,v,y){if(v.length!==24)throw new Error("secretBox nonce must be 24 bytes");const b=new Uint8Array(64),S=new Uint8Array(32);S.set(v),(0,s.stream)(p,S,b,8);const E=new Uint8Array(16+y.length);for(let O=0;O<32&&O<y.length;O++)E[16+O]=y[O]^b[32+O];y.length>32&&(0,s.streamXOR)(p,S,y.subarray(32),E.subarray(48),8);const R=(0,a.oneTimeAuth)(b.subarray(0,32),E.subarray(16));for(let O=0;O<R.length;O++)E[O]=R[O];return(0,u.wipe)(R),(0,u.wipe)(b),(0,u.wipe)(S),E}secretbox.secretBox=f;function c(p,v,y){if(v.length!==24)throw new Error("secretBox nonce must be 24 bytes");if(y.length<16)throw new Error("secretBox data must be at least 16 bytes");const b=new Uint8Array(64),S=new Uint8Array(32);S.set(v),(0,s.stream)(p,S,b,8);const E=(0,a.oneTimeAuth)(b.subarray(0,32),y.subarray(16));if(!(0,a.equal)(E,y.subarray(0,16)))return null;const R=y.subarray(16),O=new Uint8Array(R.length);for(let I=0;I<32&&I<R.length;I++)O[I]=R[I]^b[32+I];return R.length>32&&(0,s.streamXOR)(p,S,R.subarray(32),O.subarray(32),8),(0,u.wipe)(E),(0,u.wipe)(b),(0,u.wipe)(S),O}secretbox.openSecretBox=c;function h(p){return(0,l.randomBytes)(32,p)}return secretbox.generateKey=h,secretbox}var hasRequiredBox;function requireBox(){return hasRequiredBox||(hasRequiredBox=1,function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.openBox=s.box=s.precomputeSharedKey=s.generateKeyPair=void 0;const a=requireX25519(),u=requireXsalsa20(),l=requireSecretbox(),f=requireWipe();var c=requireX25519();Object.defineProperty(s,"generateKeyPair",{enumerable:!0,get:function(){return c.generateKeyPair}});const h=new Uint8Array(16);function p(b,S){const E=(0,a.scalarMult)(S,b);return(0,u.hsalsa)(E,h,E),E}s.precomputeSharedKey=p;function v(b,S,E,R){const O=p(b,S),I=(0,l.secretBox)(O,E,R);return(0,f.wipe)(O),I}s.box=v;function y(b,S,E,R){const O=p(b,S),I=(0,l.openSecretBox)(O,E,R);return(0,f.wipe)(O),I}s.openBox=y}(box)),box}var hasRequiredNacl;function requireNacl(){return hasRequiredNacl||(hasRequiredNacl=1,function(s){var a=nacl&&nacl.__createBinding||(Object.create?function(l,f,c,h){h===void 0&&(h=c);var p=Object.getOwnPropertyDescriptor(f,c);(!p||("get"in p?!f.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return f[c]}}),Object.defineProperty(l,h,p)}:function(l,f,c,h){h===void 0&&(h=c),l[h]=f[c]}),u=nacl&&nacl.__exportStar||function(l,f){for(var c in l)c!=="default"&&!Object.prototype.hasOwnProperty.call(f,c)&&a(f,l,c)};Object.defineProperty(s,"__esModule",{value:!0}),u(requireBox(),s),u(requireSecretbox(),s)}(nacl)),nacl}var naclExports=requireNacl(),blake2b={},hasRequiredBlake2b$1;function requireBlake2b$1(){return hasRequiredBlake2b$1||(hasRequiredBlake2b$1=1,function(s){Object.defineProperty(s,"__esModule",{value:!0});var a=requireBinary(),u=requireWipe();s.BLOCK_SIZE=128,s.DIGEST_LENGTH=64,s.KEY_LENGTH=64,s.PERSONALIZATION_LENGTH=16,s.SALT_LENGTH=16,s.MAX_LEAF_SIZE=Math.pow(2,32)-1,s.MAX_FANOUT=255,s.MAX_MAX_DEPTH=255;var l=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),f=[[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30],[28,20,8,16,18,30,26,12,2,24,0,4,22,14,10,6],[22,16,24,0,10,4,30,26,20,28,6,12,14,2,18,8],[14,18,6,2,26,24,22,28,4,12,10,20,8,0,30,16],[18,0,10,14,4,8,20,30,28,2,22,24,12,16,6,26],[4,24,12,20,0,22,16,6,8,26,14,10,30,28,2,18],[24,10,2,30,28,26,8,20,0,14,12,6,18,4,16,22],[26,22,14,28,24,2,6,18,10,0,30,8,16,12,4,20],[12,30,28,18,22,6,0,16,24,4,26,14,2,8,20,10],[20,4,16,8,14,12,2,10,30,22,18,28,6,24,26,0],[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30],[28,20,8,16,18,30,26,12,2,24,0,4,22,14,10,6]],c=function(){function p(v,y){if(v===void 0&&(v=64),this.digestLength=v,this.blockSize=s.BLOCK_SIZE,this._state=new Int32Array(l),this._buffer=new Uint8Array(s.BLOCK_SIZE),this._bufferLength=0,this._ctr=new Uint32Array(4),this._flag=new Uint32Array(4),this._lastNode=!1,this._finished=!1,this._vtmp=new Uint32Array(32),this._mtmp=new Uint32Array(32),v<1||v>s.DIGEST_LENGTH)throw new Error("blake2b: wrong digest length");y&&this.validateConfig(y);var b=0;y&&y.key&&(b=y.key.length);var S=1,E=1;y&&y.tree&&(S=y.tree.fanout,E=y.tree.maxDepth),this._state[0]^=v|b<<8|S<<16|E<<24,y&&y.tree&&(this._state[1]^=y.tree.leafSize,this._state[2]^=y.tree.nodeOffsetLowBits,this._state[3]^=y.tree.nodeOffsetHighBits,this._state[4]^=y.tree.nodeDepth|y.tree.innerDigestLength<<8,this._lastNode=y.tree.lastNode),y&&y.salt&&(this._state[8]^=a.readUint32LE(y.salt,0),this._state[9]^=a.readUint32LE(y.salt,4),this._state[10]^=a.readUint32LE(y.salt,8),this._state[11]^=a.readUint32LE(y.salt,12)),y&&y.personalization&&(this._state[12]^=a.readUint32LE(y.personalization,0),this._state[13]^=a.readUint32LE(y.personalization,4),this._state[14]^=a.readUint32LE(y.personalization,8),this._state[15]^=a.readUint32LE(y.personalization,12)),this._initialState=new Uint32Array(this._state),y&&y.key&&b>0&&(this._paddedKey=new Uint8Array(s.BLOCK_SIZE),this._paddedKey.set(y.key),this._buffer.set(this._paddedKey),this._bufferLength=s.BLOCK_SIZE)}return p.prototype.reset=function(){return this._state.set(this._initialState),this._paddedKey?(this._buffer.set(this._paddedKey),this._bufferLength=s.BLOCK_SIZE):this._bufferLength=0,u.wipe(this._ctr),u.wipe(this._flag),this._finished=!1,this},p.prototype.validateConfig=function(v){if(v.key&&v.key.length>s.KEY_LENGTH)throw new Error("blake2b: wrong key length");if(v.salt&&v.salt.length!==s.SALT_LENGTH)throw new Error("blake2b: wrong salt length");if(v.personalization&&v.personalization.length!==s.PERSONALIZATION_LENGTH)throw new Error("blake2b: wrong personalization length");if(v.tree){if(v.tree.fanout<0||v.tree.fanout>s.MAX_FANOUT)throw new Error("blake2b: wrong tree fanout");if(v.tree.maxDepth<0||v.tree.maxDepth>s.MAX_MAX_DEPTH)throw new Error("blake2b: wrong tree depth");if(v.tree.leafSize<0||v.tree.leafSize>s.MAX_LEAF_SIZE)throw new Error("blake2b: wrong leaf size");if(v.tree.innerDigestLength<0||v.tree.innerDigestLength>s.DIGEST_LENGTH)throw new Error("blake2b: wrong tree inner digest length")}},p.prototype.update=function(v,y){if(y===void 0&&(y=v.length),this._finished)throw new Error("blake2b: can't update because hash was finished.");var b=s.BLOCK_SIZE-this._bufferLength,S=0;if(y===0)return this;if(y>b){for(var E=0;E<b;E++)this._buffer[this._bufferLength+E]=v[S+E];this._processBlock(s.BLOCK_SIZE),S+=b,y-=b,this._bufferLength=0}for(;y>s.BLOCK_SIZE;){for(var E=0;E<s.BLOCK_SIZE;E++)this._buffer[E]=v[S+E];this._processBlock(s.BLOCK_SIZE),S+=s.BLOCK_SIZE,y-=s.BLOCK_SIZE,this._bufferLength=0}for(var E=0;E<y;E++)this._buffer[this._bufferLength+E]=v[S+E];return this._bufferLength+=y,this},p.prototype.finish=function(v){if(!this._finished){for(var y=this._bufferLength;y<s.BLOCK_SIZE;y++)this._buffer[y]=0;this._flag[0]=4294967295,this._flag[1]=4294967295,this._lastNode&&(this._flag[2]=4294967295,this._flag[3]=4294967295),this._processBlock(this._bufferLength),this._finished=!0}for(var b=this._buffer.subarray(0,64),y=0;y<16;y++)a.writeUint32LE(this._state[y],b,y*4);return v.set(b.subarray(0,v.length)),this},p.prototype.digest=function(){var v=new Uint8Array(this.digestLength);return this.finish(v),v},p.prototype.clean=function(){u.wipe(this._vtmp),u.wipe(this._mtmp),u.wipe(this._state),u.wipe(this._buffer),u.wipe(this._initialState),this._paddedKey&&u.wipe(this._paddedKey),this._bufferLength=0,u.wipe(this._ctr),u.wipe(this._flag),this._lastNode=!1,this._finished=!1},p.prototype.saveState=function(){if(this._finished)throw new Error("blake2b: cannot save finished state");return{state:new Uint32Array(this._state),buffer:new Uint8Array(this._buffer),bufferLength:this._bufferLength,ctr:new Uint32Array(this._ctr),flag:new Uint32Array(this._flag),lastNode:this._lastNode,paddedKey:this._paddedKey?new Uint8Array(this._paddedKey):void 0,initialState:new Uint32Array(this._initialState)}},p.prototype.restoreState=function(v){return this._state.set(v.state),this._buffer.set(v.buffer),this._bufferLength=v.bufferLength,this._ctr.set(v.ctr),this._flag.set(v.flag),this._lastNode=v.lastNode,this._paddedKey&&u.wipe(this._paddedKey),this._paddedKey=v.paddedKey?new Uint8Array(v.paddedKey):void 0,this._initialState.set(v.initialState),this},p.prototype.cleanSavedState=function(v){u.wipe(v.state),u.wipe(v.buffer),u.wipe(v.initialState),v.paddedKey&&u.wipe(v.paddedKey),v.bufferLength=0,u.wipe(v.ctr),u.wipe(v.flag),v.lastNode=!1},p.prototype._G=function(v,y,b,S,E,R,O,I,B,N,D,G,V){var U=v[y],te=v[R],Z=v[b],J=v[O],Q=v[S],ee=v[I],k=v[E],d=v[B],g=U&65535,_=U>>>16,w=te&65535,x=te>>>16;g+=Z&65535,_+=Z>>>16,w+=J&65535,x+=J>>>16,_+=g>>>16,w+=_>>>16,x+=w>>>16,te=w&65535|x<<16,U=g&65535|_<<16,g=U&65535,_=U>>>16,w=te&65535,x=te>>>16,g+=N&65535,_+=N>>>16,w+=D&65535,x+=D>>>16,_+=g>>>16,w+=_>>>16,x+=w>>>16,te=w&65535|x<<16,U=g&65535|_<<16,k^=U,d^=te,g=d,d=k,k=g,g=Q&65535,_=Q>>>16,w=ee&65535,x=ee>>>16,g+=k&65535,_+=k>>>16,w+=d&65535,x+=d>>>16,_+=g>>>16,w+=_>>>16,x+=w>>>16,ee=w&65535|x<<16,Q=g&65535|_<<16,Z^=Q,J^=ee,g=Z<<8|J>>>24,Z=J<<8|Z>>>24,J=g,g=U&65535,_=U>>>16,w=te&65535,x=te>>>16,g+=Z&65535,_+=Z>>>16,w+=J&65535,x+=J>>>16,_+=g>>>16,w+=_>>>16,x+=w>>>16,te=w&65535|x<<16,U=g&65535|_<<16,g=U&65535,_=U>>>16,w=te&65535,x=te>>>16,g+=G&65535,_+=G>>>16,w+=V&65535,x+=V>>>16,_+=g>>>16,w+=_>>>16,x+=w>>>16,te=w&65535|x<<16,U=g&65535|_<<16,k^=U,d^=te,g=k<<16|d>>>16,k=d<<16|k>>>16,d=g,g=Q&65535,_=Q>>>16,w=ee&65535,x=ee>>>16,g+=k&65535,_+=k>>>16,w+=d&65535,x+=d>>>16,_+=g>>>16,w+=_>>>16,x+=w>>>16,ee=w&65535|x<<16,Q=g&65535|_<<16,Z^=Q,J^=ee,g=J<<1|Z>>>31,Z=Z<<1|J>>>31,J=g,v[y]=U,v[R]=te,v[b]=Z,v[O]=J,v[S]=Q,v[I]=ee,v[E]=k,v[B]=d},p.prototype._incrementCounter=function(v){for(var y=0;y<3;y++){var b=this._ctr[y]+v;if(this._ctr[y]=b>>>0,this._ctr[y]===b)return;v=1}},p.prototype._processBlock=function(v){this._incrementCounter(v);var y=this._vtmp;y.set(this._state),y.set(l,16),y[12*2+0]^=this._ctr[0],y[12*2+1]^=this._ctr[1],y[13*2+0]^=this._ctr[2],y[13*2+1]^=this._ctr[3],y[14*2+0]^=this._flag[0],y[14*2+1]^=this._flag[1],y[15*2+0]^=this._flag[2],y[15*2+1]^=this._flag[3];for(var b=this._mtmp,S=0;S<32;S++)b[S]=a.readUint32LE(this._buffer,S*4);for(var E=0;E<12;E++)this._G(y,0,8,16,24,1,9,17,25,b[f[E][0]],b[f[E][0]+1],b[f[E][1]],b[f[E][1]+1]),this._G(y,2,10,18,26,3,11,19,27,b[f[E][2]],b[f[E][2]+1],b[f[E][3]],b[f[E][3]+1]),this._G(y,4,12,20,28,5,13,21,29,b[f[E][4]],b[f[E][4]+1],b[f[E][5]],b[f[E][5]+1]),this._G(y,6,14,22,30,7,15,23,31,b[f[E][6]],b[f[E][6]+1],b[f[E][7]],b[f[E][7]+1]),this._G(y,0,10,20,30,1,11,21,31,b[f[E][8]],b[f[E][8]+1],b[f[E][9]],b[f[E][9]+1]),this._G(y,2,12,22,24,3,13,23,25,b[f[E][10]],b[f[E][10]+1],b[f[E][11]],b[f[E][11]+1]),this._G(y,4,14,16,26,5,15,17,27,b[f[E][12]],b[f[E][12]+1],b[f[E][13]],b[f[E][13]+1]),this._G(y,6,8,18,28,7,9,19,29,b[f[E][14]],b[f[E][14]+1],b[f[E][15]],b[f[E][15]+1]);for(var S=0;S<16;S++)this._state[S]^=y[S]^y[S+16]},p}();s.BLAKE2b=c;function h(p,v,y){v===void 0&&(v=s.DIGEST_LENGTH);var b=new c(v,y);b.update(p);var S=b.digest();return b.clean(),S}s.hash=h}(blake2b)),blake2b}var blake2bExports=requireBlake2b$1(),bufferExports=requireBuffer$1(),ed25519={},sha512$2={},hasRequiredSha512$1;function requireSha512$1(){return hasRequiredSha512$1||(hasRequiredSha512$1=1,function(s){Object.defineProperty(s,"__esModule",{value:!0});var a=requireBinary(),u=requireWipe();s.DIGEST_LENGTH=64,s.BLOCK_SIZE=128;var l=function(){function p(){this.digestLength=s.DIGEST_LENGTH,this.blockSize=s.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return p.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},p.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},p.prototype.clean=function(){u.wipe(this._buffer),u.wipe(this._tempHi),u.wipe(this._tempLo),this.reset()},p.prototype.update=function(v,y){if(y===void 0&&(y=v.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var b=0;if(this._bytesHashed+=y,this._bufferLength>0){for(;this._bufferLength<s.BLOCK_SIZE&&y>0;)this._buffer[this._bufferLength++]=v[b++],y--;this._bufferLength===this.blockSize&&(c(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(y>=this.blockSize&&(b=c(this._tempHi,this._tempLo,this._stateHi,this._stateLo,v,b,y),y%=this.blockSize);y>0;)this._buffer[this._bufferLength++]=v[b++],y--;return this},p.prototype.finish=function(v){if(!this._finished){var y=this._bytesHashed,b=this._bufferLength,S=y/536870912|0,E=y<<3,R=y%128<112?128:256;this._buffer[b]=128;for(var O=b+1;O<R-8;O++)this._buffer[O]=0;a.writeUint32BE(S,this._buffer,R-8),a.writeUint32BE(E,this._buffer,R-4),c(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,R),this._finished=!0}for(var O=0;O<this.digestLength/8;O++)a.writeUint32BE(this._stateHi[O],v,O*8),a.writeUint32BE(this._stateLo[O],v,O*8+4);return this},p.prototype.digest=function(){var v=new Uint8Array(this.digestLength);return this.finish(v),v},p.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},p.prototype.restoreState=function(v){return this._stateHi.set(v.stateHi),this._stateLo.set(v.stateLo),this._bufferLength=v.bufferLength,v.buffer&&this._buffer.set(v.buffer),this._bytesHashed=v.bytesHashed,this._finished=!1,this},p.prototype.cleanSavedState=function(v){u.wipe(v.stateHi),u.wipe(v.stateLo),v.buffer&&u.wipe(v.buffer),v.bufferLength=0,v.bytesHashed=0},p}();s.SHA512=l;var f=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function c(p,v,y,b,S,E,R){for(var O=y[0],I=y[1],B=y[2],N=y[3],D=y[4],G=y[5],V=y[6],U=y[7],te=b[0],Z=b[1],J=b[2],Q=b[3],ee=b[4],k=b[5],d=b[6],g=b[7],_,w,x,P,$,T,m,M;R>=128;){for(var W=0;W<16;W++){var Y=8*W+E;p[W]=a.readUint32BE(S,Y),v[W]=a.readUint32BE(S,Y+4)}for(var W=0;W<80;W++){var ue=O,ge=I,he=B,ae=N,de=D,pe=G,oe=V,le=U,me=te,xe=Z,Ne=J,Pe=Q,Ie=ee,Ke=k,Le=d,Ce=g;if(_=U,w=g,$=w&65535,T=w>>>16,m=_&65535,M=_>>>16,_=(D>>>14|ee<<18)^(D>>>18|ee<<14)^(ee>>>9|D<<23),w=(ee>>>14|D<<18)^(ee>>>18|D<<14)^(D>>>9|ee<<23),$+=w&65535,T+=w>>>16,m+=_&65535,M+=_>>>16,_=D&G^~D&V,w=ee&k^~ee&d,$+=w&65535,T+=w>>>16,m+=_&65535,M+=_>>>16,_=f[W*2],w=f[W*2+1],$+=w&65535,T+=w>>>16,m+=_&65535,M+=_>>>16,_=p[W%16],w=v[W%16],$+=w&65535,T+=w>>>16,m+=_&65535,M+=_>>>16,T+=$>>>16,m+=T>>>16,M+=m>>>16,x=m&65535|M<<16,P=$&65535|T<<16,_=x,w=P,$=w&65535,T=w>>>16,m=_&65535,M=_>>>16,_=(O>>>28|te<<4)^(te>>>2|O<<30)^(te>>>7|O<<25),w=(te>>>28|O<<4)^(O>>>2|te<<30)^(O>>>7|te<<25),$+=w&65535,T+=w>>>16,m+=_&65535,M+=_>>>16,_=O&I^O&B^I&B,w=te&Z^te&J^Z&J,$+=w&65535,T+=w>>>16,m+=_&65535,M+=_>>>16,T+=$>>>16,m+=T>>>16,M+=m>>>16,le=m&65535|M<<16,Ce=$&65535|T<<16,_=ae,w=Pe,$=w&65535,T=w>>>16,m=_&65535,M=_>>>16,_=x,w=P,$+=w&65535,T+=w>>>16,m+=_&65535,M+=_>>>16,T+=$>>>16,m+=T>>>16,M+=m>>>16,ae=m&65535|M<<16,Pe=$&65535|T<<16,I=ue,B=ge,N=he,D=ae,G=de,V=pe,U=oe,O=le,Z=me,J=xe,Q=Ne,ee=Pe,k=Ie,d=Ke,g=Le,te=Ce,W%16===15)for(var Y=0;Y<16;Y++)_=p[Y],w=v[Y],$=w&65535,T=w>>>16,m=_&65535,M=_>>>16,_=p[(Y+9)%16],w=v[(Y+9)%16],$+=w&65535,T+=w>>>16,m+=_&65535,M+=_>>>16,x=p[(Y+1)%16],P=v[(Y+1)%16],_=(x>>>1|P<<31)^(x>>>8|P<<24)^x>>>7,w=(P>>>1|x<<31)^(P>>>8|x<<24)^(P>>>7|x<<25),$+=w&65535,T+=w>>>16,m+=_&65535,M+=_>>>16,x=p[(Y+14)%16],P=v[(Y+14)%16],_=(x>>>19|P<<13)^(P>>>29|x<<3)^x>>>6,w=(P>>>19|x<<13)^(x>>>29|P<<3)^(P>>>6|x<<26),$+=w&65535,T+=w>>>16,m+=_&65535,M+=_>>>16,T+=$>>>16,m+=T>>>16,M+=m>>>16,p[Y]=m&65535|M<<16,v[Y]=$&65535|T<<16}_=O,w=te,$=w&65535,T=w>>>16,m=_&65535,M=_>>>16,_=y[0],w=b[0],$+=w&65535,T+=w>>>16,m+=_&65535,M+=_>>>16,T+=$>>>16,m+=T>>>16,M+=m>>>16,y[0]=O=m&65535|M<<16,b[0]=te=$&65535|T<<16,_=I,w=Z,$=w&65535,T=w>>>16,m=_&65535,M=_>>>16,_=y[1],w=b[1],$+=w&65535,T+=w>>>16,m+=_&65535,M+=_>>>16,T+=$>>>16,m+=T>>>16,M+=m>>>16,y[1]=I=m&65535|M<<16,b[1]=Z=$&65535|T<<16,_=B,w=J,$=w&65535,T=w>>>16,m=_&65535,M=_>>>16,_=y[2],w=b[2],$+=w&65535,T+=w>>>16,m+=_&65535,M+=_>>>16,T+=$>>>16,m+=T>>>16,M+=m>>>16,y[2]=B=m&65535|M<<16,b[2]=J=$&65535|T<<16,_=N,w=Q,$=w&65535,T=w>>>16,m=_&65535,M=_>>>16,_=y[3],w=b[3],$+=w&65535,T+=w>>>16,m+=_&65535,M+=_>>>16,T+=$>>>16,m+=T>>>16,M+=m>>>16,y[3]=N=m&65535|M<<16,b[3]=Q=$&65535|T<<16,_=D,w=ee,$=w&65535,T=w>>>16,m=_&65535,M=_>>>16,_=y[4],w=b[4],$+=w&65535,T+=w>>>16,m+=_&65535,M+=_>>>16,T+=$>>>16,m+=T>>>16,M+=m>>>16,y[4]=D=m&65535|M<<16,b[4]=ee=$&65535|T<<16,_=G,w=k,$=w&65535,T=w>>>16,m=_&65535,M=_>>>16,_=y[5],w=b[5],$+=w&65535,T+=w>>>16,m+=_&65535,M+=_>>>16,T+=$>>>16,m+=T>>>16,M+=m>>>16,y[5]=G=m&65535|M<<16,b[5]=k=$&65535|T<<16,_=V,w=d,$=w&65535,T=w>>>16,m=_&65535,M=_>>>16,_=y[6],w=b[6],$+=w&65535,T+=w>>>16,m+=_&65535,M+=_>>>16,T+=$>>>16,m+=T>>>16,M+=m>>>16,y[6]=V=m&65535|M<<16,b[6]=d=$&65535|T<<16,_=U,w=g,$=w&65535,T=w>>>16,m=_&65535,M=_>>>16,_=y[7],w=b[7],$+=w&65535,T+=w>>>16,m+=_&65535,M+=_>>>16,T+=$>>>16,m+=T>>>16,M+=m>>>16,y[7]=U=m&65535|M<<16,b[7]=g=$&65535|T<<16,E+=128,R-=128}return E}function h(p){var v=new l;v.update(p);var y=v.digest();return v.clean(),y}s.hash=h}(sha512$2)),sha512$2}var hasRequiredEd25519;function requireEd25519(){return hasRequiredEd25519||(hasRequiredEd25519=1,function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.convertSecretKeyToX25519=s.convertPublicKeyToX25519=s.verify=s.sign=s.extractPublicKeyFromSecretKey=s.generateKeyPair=s.generateKeyPairFromSeed=s.SEED_LENGTH=s.SECRET_KEY_LENGTH=s.PUBLIC_KEY_LENGTH=s.SIGNATURE_LENGTH=void 0;const a=requireRandom(),u=requireSha512$1(),l=requireWipe();s.SIGNATURE_LENGTH=64,s.PUBLIC_KEY_LENGTH=32,s.SECRET_KEY_LENGTH=64,s.SEED_LENGTH=32;function f(ae){const de=new Float64Array(16);if(ae)for(let pe=0;pe<ae.length;pe++)de[pe]=ae[pe];return de}const c=new Uint8Array(32);c[0]=9;const h=f(),p=f([1]),v=f([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),y=f([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),b=f([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),S=f([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),E=f([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function R(ae,de){for(let pe=0;pe<16;pe++)ae[pe]=de[pe]|0}function O(ae){let de=1;for(let pe=0;pe<16;pe++){let oe=ae[pe]+de+65535;de=Math.floor(oe/65536),ae[pe]=oe-de*65536}ae[0]+=de-1+37*(de-1)}function I(ae,de,pe){const oe=~(pe-1);for(let le=0;le<16;le++){const me=oe&(ae[le]^de[le]);ae[le]^=me,de[le]^=me}}function B(ae,de){const pe=f(),oe=f();for(let le=0;le<16;le++)oe[le]=de[le];O(oe),O(oe),O(oe);for(let le=0;le<2;le++){pe[0]=oe[0]-65517;for(let xe=1;xe<15;xe++)pe[xe]=oe[xe]-65535-(pe[xe-1]>>16&1),pe[xe-1]&=65535;pe[15]=oe[15]-32767-(pe[14]>>16&1);const me=pe[15]>>16&1;pe[14]&=65535,I(oe,pe,1-me)}for(let le=0;le<16;le++)ae[2*le]=oe[le]&255,ae[2*le+1]=oe[le]>>8}function N(ae,de){let pe=0;for(let oe=0;oe<32;oe++)pe|=ae[oe]^de[oe];return(1&pe-1>>>8)-1}function D(ae,de){const pe=new Uint8Array(32),oe=new Uint8Array(32);return B(pe,ae),B(oe,de),N(pe,oe)}function G(ae){const de=new Uint8Array(32);return B(de,ae),de[0]&1}function V(ae,de){for(let pe=0;pe<16;pe++)ae[pe]=de[2*pe]+(de[2*pe+1]<<8);ae[15]&=32767}function U(ae,de,pe){for(let oe=0;oe<16;oe++)ae[oe]=de[oe]+pe[oe]}function te(ae,de,pe){for(let oe=0;oe<16;oe++)ae[oe]=de[oe]-pe[oe]}function Z(ae,de,pe){let oe,le,me=0,xe=0,Ne=0,Pe=0,Ie=0,Ke=0,Le=0,Ce=0,at=0,Oe=0,De=0,yt=0,Ue=0,ze=0,Mt=0,se=0,j=0,X=0,ce=0,be=0,Re=0,Se=0,qe=0,bt=0,je=0,We=0,St=0,ut=0,vt=0,zt=0,st=0,nt=pe[0],Vt=pe[1],tt=pe[2],ft=pe[3],Ft=pe[4],Qe=pe[5],rt=pe[6],Bt=pe[7],Xe=pe[8],ct=pe[9],Ut=pe[10],Je=pe[11],it=pe[12],qt=pe[13],et=pe[14],ht=pe[15];oe=de[0],me+=oe*nt,xe+=oe*Vt,Ne+=oe*tt,Pe+=oe*ft,Ie+=oe*Ft,Ke+=oe*Qe,Le+=oe*rt,Ce+=oe*Bt,at+=oe*Xe,Oe+=oe*ct,De+=oe*Ut,yt+=oe*Je,Ue+=oe*it,ze+=oe*qt,Mt+=oe*et,se+=oe*ht,oe=de[1],xe+=oe*nt,Ne+=oe*Vt,Pe+=oe*tt,Ie+=oe*ft,Ke+=oe*Ft,Le+=oe*Qe,Ce+=oe*rt,at+=oe*Bt,Oe+=oe*Xe,De+=oe*ct,yt+=oe*Ut,Ue+=oe*Je,ze+=oe*it,Mt+=oe*qt,se+=oe*et,j+=oe*ht,oe=de[2],Ne+=oe*nt,Pe+=oe*Vt,Ie+=oe*tt,Ke+=oe*ft,Le+=oe*Ft,Ce+=oe*Qe,at+=oe*rt,Oe+=oe*Bt,De+=oe*Xe,yt+=oe*ct,Ue+=oe*Ut,ze+=oe*Je,Mt+=oe*it,se+=oe*qt,j+=oe*et,X+=oe*ht,oe=de[3],Pe+=oe*nt,Ie+=oe*Vt,Ke+=oe*tt,Le+=oe*ft,Ce+=oe*Ft,at+=oe*Qe,Oe+=oe*rt,De+=oe*Bt,yt+=oe*Xe,Ue+=oe*ct,ze+=oe*Ut,Mt+=oe*Je,se+=oe*it,j+=oe*qt,X+=oe*et,ce+=oe*ht,oe=de[4],Ie+=oe*nt,Ke+=oe*Vt,Le+=oe*tt,Ce+=oe*ft,at+=oe*Ft,Oe+=oe*Qe,De+=oe*rt,yt+=oe*Bt,Ue+=oe*Xe,ze+=oe*ct,Mt+=oe*Ut,se+=oe*Je,j+=oe*it,X+=oe*qt,ce+=oe*et,be+=oe*ht,oe=de[5],Ke+=oe*nt,Le+=oe*Vt,Ce+=oe*tt,at+=oe*ft,Oe+=oe*Ft,De+=oe*Qe,yt+=oe*rt,Ue+=oe*Bt,ze+=oe*Xe,Mt+=oe*ct,se+=oe*Ut,j+=oe*Je,X+=oe*it,ce+=oe*qt,be+=oe*et,Re+=oe*ht,oe=de[6],Le+=oe*nt,Ce+=oe*Vt,at+=oe*tt,Oe+=oe*ft,De+=oe*Ft,yt+=oe*Qe,Ue+=oe*rt,ze+=oe*Bt,Mt+=oe*Xe,se+=oe*ct,j+=oe*Ut,X+=oe*Je,ce+=oe*it,be+=oe*qt,Re+=oe*et,Se+=oe*ht,oe=de[7],Ce+=oe*nt,at+=oe*Vt,Oe+=oe*tt,De+=oe*ft,yt+=oe*Ft,Ue+=oe*Qe,ze+=oe*rt,Mt+=oe*Bt,se+=oe*Xe,j+=oe*ct,X+=oe*Ut,ce+=oe*Je,be+=oe*it,Re+=oe*qt,Se+=oe*et,qe+=oe*ht,oe=de[8],at+=oe*nt,Oe+=oe*Vt,De+=oe*tt,yt+=oe*ft,Ue+=oe*Ft,ze+=oe*Qe,Mt+=oe*rt,se+=oe*Bt,j+=oe*Xe,X+=oe*ct,ce+=oe*Ut,be+=oe*Je,Re+=oe*it,Se+=oe*qt,qe+=oe*et,bt+=oe*ht,oe=de[9],Oe+=oe*nt,De+=oe*Vt,yt+=oe*tt,Ue+=oe*ft,ze+=oe*Ft,Mt+=oe*Qe,se+=oe*rt,j+=oe*Bt,X+=oe*Xe,ce+=oe*ct,be+=oe*Ut,Re+=oe*Je,Se+=oe*it,qe+=oe*qt,bt+=oe*et,je+=oe*ht,oe=de[10],De+=oe*nt,yt+=oe*Vt,Ue+=oe*tt,ze+=oe*ft,Mt+=oe*Ft,se+=oe*Qe,j+=oe*rt,X+=oe*Bt,ce+=oe*Xe,be+=oe*ct,Re+=oe*Ut,Se+=oe*Je,qe+=oe*it,bt+=oe*qt,je+=oe*et,We+=oe*ht,oe=de[11],yt+=oe*nt,Ue+=oe*Vt,ze+=oe*tt,Mt+=oe*ft,se+=oe*Ft,j+=oe*Qe,X+=oe*rt,ce+=oe*Bt,be+=oe*Xe,Re+=oe*ct,Se+=oe*Ut,qe+=oe*Je,bt+=oe*it,je+=oe*qt,We+=oe*et,St+=oe*ht,oe=de[12],Ue+=oe*nt,ze+=oe*Vt,Mt+=oe*tt,se+=oe*ft,j+=oe*Ft,X+=oe*Qe,ce+=oe*rt,be+=oe*Bt,Re+=oe*Xe,Se+=oe*ct,qe+=oe*Ut,bt+=oe*Je,je+=oe*it,We+=oe*qt,St+=oe*et,ut+=oe*ht,oe=de[13],ze+=oe*nt,Mt+=oe*Vt,se+=oe*tt,j+=oe*ft,X+=oe*Ft,ce+=oe*Qe,be+=oe*rt,Re+=oe*Bt,Se+=oe*Xe,qe+=oe*ct,bt+=oe*Ut,je+=oe*Je,We+=oe*it,St+=oe*qt,ut+=oe*et,vt+=oe*ht,oe=de[14],Mt+=oe*nt,se+=oe*Vt,j+=oe*tt,X+=oe*ft,ce+=oe*Ft,be+=oe*Qe,Re+=oe*rt,Se+=oe*Bt,qe+=oe*Xe,bt+=oe*ct,je+=oe*Ut,We+=oe*Je,St+=oe*it,ut+=oe*qt,vt+=oe*et,zt+=oe*ht,oe=de[15],se+=oe*nt,j+=oe*Vt,X+=oe*tt,ce+=oe*ft,be+=oe*Ft,Re+=oe*Qe,Se+=oe*rt,qe+=oe*Bt,bt+=oe*Xe,je+=oe*ct,We+=oe*Ut,St+=oe*Je,ut+=oe*it,vt+=oe*qt,zt+=oe*et,st+=oe*ht,me+=38*j,xe+=38*X,Ne+=38*ce,Pe+=38*be,Ie+=38*Re,Ke+=38*Se,Le+=38*qe,Ce+=38*bt,at+=38*je,Oe+=38*We,De+=38*St,yt+=38*ut,Ue+=38*vt,ze+=38*zt,Mt+=38*st,le=1,oe=me+le+65535,le=Math.floor(oe/65536),me=oe-le*65536,oe=xe+le+65535,le=Math.floor(oe/65536),xe=oe-le*65536,oe=Ne+le+65535,le=Math.floor(oe/65536),Ne=oe-le*65536,oe=Pe+le+65535,le=Math.floor(oe/65536),Pe=oe-le*65536,oe=Ie+le+65535,le=Math.floor(oe/65536),Ie=oe-le*65536,oe=Ke+le+65535,le=Math.floor(oe/65536),Ke=oe-le*65536,oe=Le+le+65535,le=Math.floor(oe/65536),Le=oe-le*65536,oe=Ce+le+65535,le=Math.floor(oe/65536),Ce=oe-le*65536,oe=at+le+65535,le=Math.floor(oe/65536),at=oe-le*65536,oe=Oe+le+65535,le=Math.floor(oe/65536),Oe=oe-le*65536,oe=De+le+65535,le=Math.floor(oe/65536),De=oe-le*65536,oe=yt+le+65535,le=Math.floor(oe/65536),yt=oe-le*65536,oe=Ue+le+65535,le=Math.floor(oe/65536),Ue=oe-le*65536,oe=ze+le+65535,le=Math.floor(oe/65536),ze=oe-le*65536,oe=Mt+le+65535,le=Math.floor(oe/65536),Mt=oe-le*65536,oe=se+le+65535,le=Math.floor(oe/65536),se=oe-le*65536,me+=le-1+37*(le-1),le=1,oe=me+le+65535,le=Math.floor(oe/65536),me=oe-le*65536,oe=xe+le+65535,le=Math.floor(oe/65536),xe=oe-le*65536,oe=Ne+le+65535,le=Math.floor(oe/65536),Ne=oe-le*65536,oe=Pe+le+65535,le=Math.floor(oe/65536),Pe=oe-le*65536,oe=Ie+le+65535,le=Math.floor(oe/65536),Ie=oe-le*65536,oe=Ke+le+65535,le=Math.floor(oe/65536),Ke=oe-le*65536,oe=Le+le+65535,le=Math.floor(oe/65536),Le=oe-le*65536,oe=Ce+le+65535,le=Math.floor(oe/65536),Ce=oe-le*65536,oe=at+le+65535,le=Math.floor(oe/65536),at=oe-le*65536,oe=Oe+le+65535,le=Math.floor(oe/65536),Oe=oe-le*65536,oe=De+le+65535,le=Math.floor(oe/65536),De=oe-le*65536,oe=yt+le+65535,le=Math.floor(oe/65536),yt=oe-le*65536,oe=Ue+le+65535,le=Math.floor(oe/65536),Ue=oe-le*65536,oe=ze+le+65535,le=Math.floor(oe/65536),ze=oe-le*65536,oe=Mt+le+65535,le=Math.floor(oe/65536),Mt=oe-le*65536,oe=se+le+65535,le=Math.floor(oe/65536),se=oe-le*65536,me+=le-1+37*(le-1),ae[0]=me,ae[1]=xe,ae[2]=Ne,ae[3]=Pe,ae[4]=Ie,ae[5]=Ke,ae[6]=Le,ae[7]=Ce,ae[8]=at,ae[9]=Oe,ae[10]=De,ae[11]=yt,ae[12]=Ue,ae[13]=ze,ae[14]=Mt,ae[15]=se}function J(ae,de){Z(ae,de,de)}function Q(ae,de){const pe=f();let oe;for(oe=0;oe<16;oe++)pe[oe]=de[oe];for(oe=253;oe>=0;oe--)J(pe,pe),oe!==2&&oe!==4&&Z(pe,pe,de);for(oe=0;oe<16;oe++)ae[oe]=pe[oe]}function ee(ae,de){const pe=f();let oe;for(oe=0;oe<16;oe++)pe[oe]=de[oe];for(oe=250;oe>=0;oe--)J(pe,pe),oe!==1&&Z(pe,pe,de);for(oe=0;oe<16;oe++)ae[oe]=pe[oe]}function k(ae,de){const pe=f(),oe=f(),le=f(),me=f(),xe=f(),Ne=f(),Pe=f(),Ie=f(),Ke=f();te(pe,ae[1],ae[0]),te(Ke,de[1],de[0]),Z(pe,pe,Ke),U(oe,ae[0],ae[1]),U(Ke,de[0],de[1]),Z(oe,oe,Ke),Z(le,ae[3],de[3]),Z(le,le,y),Z(me,ae[2],de[2]),U(me,me,me),te(xe,oe,pe),te(Ne,me,le),U(Pe,me,le),U(Ie,oe,pe),Z(ae[0],xe,Ne),Z(ae[1],Ie,Pe),Z(ae[2],Pe,Ne),Z(ae[3],xe,Ie)}function d(ae,de,pe){for(let oe=0;oe<4;oe++)I(ae[oe],de[oe],pe)}function g(ae,de){const pe=f(),oe=f(),le=f();Q(le,de[2]),Z(pe,de[0],le),Z(oe,de[1],le),B(ae,oe),ae[31]^=G(pe)<<7}function _(ae,de,pe){R(ae[0],h),R(ae[1],p),R(ae[2],p),R(ae[3],h);for(let oe=255;oe>=0;--oe){const le=pe[oe/8|0]>>(oe&7)&1;d(ae,de,le),k(de,ae),k(ae,ae),d(ae,de,le)}}function w(ae,de){const pe=[f(),f(),f(),f()];R(pe[0],b),R(pe[1],S),R(pe[2],p),Z(pe[3],b,S),_(ae,pe,de)}function x(ae){if(ae.length!==s.SEED_LENGTH)throw new Error(`ed25519: seed must be ${s.SEED_LENGTH} bytes`);const de=(0,u.hash)(ae);de[0]&=248,de[31]&=127,de[31]|=64;const pe=new Uint8Array(32),oe=[f(),f(),f(),f()];w(oe,de),g(pe,oe);const le=new Uint8Array(64);return le.set(ae),le.set(pe,32),{publicKey:pe,secretKey:le}}s.generateKeyPairFromSeed=x;function P(ae){const de=(0,a.randomBytes)(32,ae),pe=x(de);return(0,l.wipe)(de),pe}s.generateKeyPair=P;function $(ae){if(ae.length!==s.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${s.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(ae.subarray(32))}s.extractPublicKeyFromSecretKey=$;const T=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function m(ae,de){let pe,oe,le,me;for(oe=63;oe>=32;--oe){for(pe=0,le=oe-32,me=oe-12;le<me;++le)de[le]+=pe-16*de[oe]*T[le-(oe-32)],pe=Math.floor((de[le]+128)/256),de[le]-=pe*256;de[le]+=pe,de[oe]=0}for(pe=0,le=0;le<32;le++)de[le]+=pe-(de[31]>>4)*T[le],pe=de[le]>>8,de[le]&=255;for(le=0;le<32;le++)de[le]-=pe*T[le];for(oe=0;oe<32;oe++)de[oe+1]+=de[oe]>>8,ae[oe]=de[oe]&255}function M(ae){const de=new Float64Array(64);for(let pe=0;pe<64;pe++)de[pe]=ae[pe];for(let pe=0;pe<64;pe++)ae[pe]=0;m(ae,de)}function W(ae,de){const pe=new Float64Array(64),oe=[f(),f(),f(),f()],le=(0,u.hash)(ae.subarray(0,32));le[0]&=248,le[31]&=127,le[31]|=64;const me=new Uint8Array(64);me.set(le.subarray(32),32);const xe=new u.SHA512;xe.update(me.subarray(32)),xe.update(de);const Ne=xe.digest();xe.clean(),M(Ne),w(oe,Ne),g(me,oe),xe.reset(),xe.update(me.subarray(0,32)),xe.update(ae.subarray(32)),xe.update(de);const Pe=xe.digest();M(Pe);for(let Ie=0;Ie<32;Ie++)pe[Ie]=Ne[Ie];for(let Ie=0;Ie<32;Ie++)for(let Ke=0;Ke<32;Ke++)pe[Ie+Ke]+=Pe[Ie]*le[Ke];return m(me.subarray(32),pe),me}s.sign=W;function Y(ae,de){const pe=f(),oe=f(),le=f(),me=f(),xe=f(),Ne=f(),Pe=f();return R(ae[2],p),V(ae[1],de),J(le,ae[1]),Z(me,le,v),te(le,le,ae[2]),U(me,ae[2],me),J(xe,me),J(Ne,xe),Z(Pe,Ne,xe),Z(pe,Pe,le),Z(pe,pe,me),ee(pe,pe),Z(pe,pe,le),Z(pe,pe,me),Z(pe,pe,me),Z(ae[0],pe,me),J(oe,ae[0]),Z(oe,oe,me),D(oe,le)&&Z(ae[0],ae[0],E),J(oe,ae[0]),Z(oe,oe,me),D(oe,le)?-1:(G(ae[0])===de[31]>>7&&te(ae[0],h,ae[0]),Z(ae[3],ae[0],ae[1]),0)}function ue(ae,de,pe){const oe=new Uint8Array(32),le=[f(),f(),f(),f()],me=[f(),f(),f(),f()];if(pe.length!==s.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${s.SIGNATURE_LENGTH} bytes`);if(Y(me,ae))return!1;const xe=new u.SHA512;xe.update(pe.subarray(0,32)),xe.update(ae),xe.update(de);const Ne=xe.digest();return M(Ne),_(le,me,Ne),w(me,pe.subarray(32)),k(le,me),g(oe,le),!N(pe,oe)}s.verify=ue;function ge(ae){let de=[f(),f(),f(),f()];if(Y(de,ae))throw new Error("Ed25519: invalid public key");let pe=f(),oe=f(),le=de[1];U(pe,p,le),te(oe,p,le),Q(oe,oe),Z(pe,pe,oe);let me=new Uint8Array(32);return B(me,pe),me}s.convertPublicKeyToX25519=ge;function he(ae){const de=(0,u.hash)(ae.subarray(0,32));de[0]&=248,de[31]&=127,de[31]|=64;const pe=new Uint8Array(de.subarray(0,32));return(0,l.wipe)(de),pe}s.convertSecretKeyToX25519=he}(ed25519)),ed25519}var ed25519Exports=requireEd25519(),util$1,hasRequiredUtil;function requireUtil(){if(hasRequiredUtil)return util$1;hasRequiredUtil=1;const s="Input must be an string, Buffer or Uint8Array";function a(h){let p;if(h instanceof Uint8Array)p=h;else if(typeof h=="string")p=new TextEncoder().encode(h);else throw new Error(s);return p}function u(h){return Array.prototype.map.call(h,function(p){return(p<16?"0":"")+p.toString(16)}).join("")}function l(h){return(4294967296+h).toString(16).substring(1)}function f(h,p,v){let y=`
`+h+" = ";for(let b=0;b<p.length;b+=2){if(v===32)y+=l(p[b]).toUpperCase(),y+=" ",y+=l(p[b+1]).toUpperCase();else if(v===64)y+=l(p[b+1]).toUpperCase(),y+=l(p[b]).toUpperCase();else throw new Error("Invalid size "+v);b%6===4?y+=`
`+new Array(h.length+4).join(" "):b<p.length-2&&(y+=" ")}console.log(y)}function c(h,p,v){let y=new Date().getTime();const b=new Uint8Array(p);for(let E=0;E<p;E++)b[E]=E%256;const S=new Date().getTime();console.log("Generated random input in "+(S-y)+"ms"),y=S;for(let E=0;E<v;E++){const R=h(b),O=new Date().getTime(),I=O-y;y=O,console.log("Hashed in "+I+"ms: "+R.substring(0,20)+"..."),console.log(Math.round(p/(1<<20)/(I/1e3)*100)/100+" MB PER SECOND")}}return util$1={normalizeInput:a,toHex:u,debugPrint:f,testSpeed:c},util$1}var blake2b_1,hasRequiredBlake2b;function requireBlake2b(){if(hasRequiredBlake2b)return blake2b_1;hasRequiredBlake2b=1;const s=requireUtil();function a(N,D,G){const V=N[D]+N[G];let U=N[D+1]+N[G+1];V>=4294967296&&U++,N[D]=V,N[D+1]=U}function u(N,D,G,V){let U=N[D]+G;G<0&&(U+=4294967296);let te=N[D+1]+V;U>=4294967296&&te++,N[D]=U,N[D+1]=te}function l(N,D){return N[D]^N[D+1]<<8^N[D+2]<<16^N[D+3]<<24}function f(N,D,G,V,U,te){const Z=y[U],J=y[U+1],Q=y[te],ee=y[te+1];a(v,N,D),u(v,N,Z,J);let k=v[V]^v[N],d=v[V+1]^v[N+1];v[V]=d,v[V+1]=k,a(v,G,V),k=v[D]^v[G],d=v[D+1]^v[G+1],v[D]=k>>>24^d<<8,v[D+1]=d>>>24^k<<8,a(v,N,D),u(v,N,Q,ee),k=v[V]^v[N],d=v[V+1]^v[N+1],v[V]=k>>>16^d<<16,v[V+1]=d>>>16^k<<16,a(v,G,V),k=v[D]^v[G],d=v[D+1]^v[G+1],v[D]=d>>>31^k<<1,v[D+1]=k>>>31^d<<1}const c=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),h=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],p=new Uint8Array(h.map(function(N){return N*2})),v=new Uint32Array(32),y=new Uint32Array(32);function b(N,D){let G=0;for(G=0;G<16;G++)v[G]=N.h[G],v[G+16]=c[G];for(v[24]=v[24]^N.t,v[25]=v[25]^N.t/4294967296,D&&(v[28]=~v[28],v[29]=~v[29]),G=0;G<32;G++)y[G]=l(N.b,4*G);for(G=0;G<12;G++)f(0,8,16,24,p[G*16+0],p[G*16+1]),f(2,10,18,26,p[G*16+2],p[G*16+3]),f(4,12,20,28,p[G*16+4],p[G*16+5]),f(6,14,22,30,p[G*16+6],p[G*16+7]),f(0,10,20,30,p[G*16+8],p[G*16+9]),f(2,12,22,24,p[G*16+10],p[G*16+11]),f(4,14,16,26,p[G*16+12],p[G*16+13]),f(6,8,18,28,p[G*16+14],p[G*16+15]);for(G=0;G<16;G++)N.h[G]=N.h[G]^v[G]^v[G+16]}const S=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function E(N,D,G,V){if(N===0||N>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(D&&D.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(G&&G.length!==16)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(V&&V.length!==16)throw new Error("Illegal personal, expected Uint8Array with length is 16");const U={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:N};S.fill(0),S[0]=N,D&&(S[1]=D.length),S[2]=1,S[3]=1,G&&S.set(G,32),V&&S.set(V,48);for(let te=0;te<16;te++)U.h[te]=c[te]^l(S,te*4);return D&&(R(U,D),U.c=128),U}function R(N,D){for(let G=0;G<D.length;G++)N.c===128&&(N.t+=N.c,b(N,!1),N.c=0),N.b[N.c++]=D[G]}function O(N){for(N.t+=N.c;N.c<128;)N.b[N.c++]=0;b(N,!0);const D=new Uint8Array(N.outlen);for(let G=0;G<N.outlen;G++)D[G]=N.h[G>>2]>>8*(G&3);return D}function I(N,D,G,V,U){G=G||64,N=s.normalizeInput(N),V&&(V=s.normalizeInput(V)),U&&(U=s.normalizeInput(U));const te=E(G,D,V,U);return R(te,N),O(te)}function B(N,D,G,V,U){const te=I(N,D,G,V,U);return s.toHex(te)}return blake2b_1={blake2b:I,blake2bHex:B,blake2bInit:E,blake2bUpdate:R,blake2bFinal:O},blake2b_1}var blake2s_1,hasRequiredBlake2s;function requireBlake2s(){if(hasRequiredBlake2s)return blake2s_1;hasRequiredBlake2s=1;const s=requireUtil();function a(O,I){return O[I]^O[I+1]<<8^O[I+2]<<16^O[I+3]<<24}function u(O,I,B,N,D,G){h[O]=h[O]+h[I]+D,h[N]=l(h[N]^h[O],16),h[B]=h[B]+h[N],h[I]=l(h[I]^h[B],12),h[O]=h[O]+h[I]+G,h[N]=l(h[N]^h[O],8),h[B]=h[B]+h[N],h[I]=l(h[I]^h[B],7)}function l(O,I){return O>>>I^O<<32-I}const f=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),h=new Uint32Array(16),p=new Uint32Array(16);function v(O,I){let B=0;for(B=0;B<8;B++)h[B]=O.h[B],h[B+8]=f[B];for(h[12]^=O.t,h[13]^=O.t/4294967296,I&&(h[14]=~h[14]),B=0;B<16;B++)p[B]=a(O.b,4*B);for(B=0;B<10;B++)u(0,4,8,12,p[c[B*16+0]],p[c[B*16+1]]),u(1,5,9,13,p[c[B*16+2]],p[c[B*16+3]]),u(2,6,10,14,p[c[B*16+4]],p[c[B*16+5]]),u(3,7,11,15,p[c[B*16+6]],p[c[B*16+7]]),u(0,5,10,15,p[c[B*16+8]],p[c[B*16+9]]),u(1,6,11,12,p[c[B*16+10]],p[c[B*16+11]]),u(2,7,8,13,p[c[B*16+12]],p[c[B*16+13]]),u(3,4,9,14,p[c[B*16+14]],p[c[B*16+15]]);for(B=0;B<8;B++)O.h[B]^=h[B]^h[B+8]}function y(O,I){if(!(O>0&&O<=32))throw new Error("Incorrect output length, should be in [1, 32]");const B=I?I.length:0;if(I&&!(B>0&&B<=32))throw new Error("Incorrect key length, should be in [1, 32]");const N={h:new Uint32Array(f),b:new Uint8Array(64),c:0,t:0,outlen:O};return N.h[0]^=16842752^B<<8^O,B>0&&(b(N,I),N.c=64),N}function b(O,I){for(let B=0;B<I.length;B++)O.c===64&&(O.t+=O.c,v(O,!1),O.c=0),O.b[O.c++]=I[B]}function S(O){for(O.t+=O.c;O.c<64;)O.b[O.c++]=0;v(O,!0);const I=new Uint8Array(O.outlen);for(let B=0;B<O.outlen;B++)I[B]=O.h[B>>2]>>8*(B&3)&255;return I}function E(O,I,B){B=B||32,O=s.normalizeInput(O);const N=y(B,I);return b(N,O),S(N)}function R(O,I,B){const N=E(O,I,B);return s.toHex(N)}return blake2s_1={blake2s:E,blake2sHex:R,blake2sInit:y,blake2sUpdate:b,blake2sFinal:S},blake2s_1}var blakejs,hasRequiredBlakejs;function requireBlakejs(){if(hasRequiredBlakejs)return blakejs;hasRequiredBlakejs=1;const s=requireBlake2b(),a=requireBlake2s();return blakejs={blake2b:s.blake2b,blake2bHex:s.blake2bHex,blake2bInit:s.blake2bInit,blake2bUpdate:s.blake2bUpdate,blake2bFinal:s.blake2bFinal,blake2s:a.blake2s,blake2sHex:a.blake2sHex,blake2sInit:a.blake2sInit,blake2sUpdate:a.blake2sUpdate,blake2sFinal:a.blake2sFinal},blakejs}var blakejsExports=requireBlakejs();const blake=getDefaultExportFromCjs(blakejsExports);var sha256$1={},_md={},_assert={},hasRequired_assert;function require_assert(){if(hasRequired_assert)return _assert;hasRequired_assert=1,Object.defineProperty(_assert,"__esModule",{value:!0}),_assert.output=_assert.exists=_assert.hash=_assert.bytes=_assert.bool=_assert.number=_assert.isBytes=void 0;function s(v){if(!Number.isSafeInteger(v)||v<0)throw new Error(`positive integer expected, not ${v}`)}_assert.number=s;function a(v){if(typeof v!="boolean")throw new Error(`boolean expected, not ${v}`)}_assert.bool=a;function u(v){return v instanceof Uint8Array||v!=null&&typeof v=="object"&&v.constructor.name==="Uint8Array"}_assert.isBytes=u;function l(v,...y){if(!u(v))throw new Error("Uint8Array expected");if(y.length>0&&!y.includes(v.length))throw new Error(`Uint8Array expected of length ${y}, not of length=${v.length}`)}_assert.bytes=l;function f(v){if(typeof v!="function"||typeof v.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");s(v.outputLen),s(v.blockLen)}_assert.hash=f;function c(v,y=!0){if(v.destroyed)throw new Error("Hash instance has been destroyed");if(y&&v.finished)throw new Error("Hash#digest() has already been called")}_assert.exists=c;function h(v,y){l(v);const b=y.outputLen;if(v.length<b)throw new Error(`digestInto() expects output buffer of length at least ${b}`)}_assert.output=h;const p={number:s,bool:a,bytes:l,hash:f,exists:c,output:h};return _assert.default=p,_assert}var utils={},crypto$1={},hasRequiredCrypto;function requireCrypto(){return hasRequiredCrypto||(hasRequiredCrypto=1,Object.defineProperty(crypto$1,"__esModule",{value:!0}),crypto$1.crypto=void 0,crypto$1.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0),crypto$1}var hasRequiredUtils;function requireUtils(){return hasRequiredUtils||(hasRequiredUtils=1,function(s){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(s,"__esModule",{value:!0}),s.randomBytes=s.wrapXOFConstructorWithOpts=s.wrapConstructorWithOpts=s.wrapConstructor=s.checkOpts=s.Hash=s.concatBytes=s.toBytes=s.utf8ToBytes=s.asyncLoop=s.nextTick=s.hexToBytes=s.bytesToHex=s.byteSwap32=s.byteSwapIfBE=s.byteSwap=s.isLE=s.rotl=s.rotr=s.createView=s.u32=s.u8=s.isBytes=void 0;const a=requireCrypto(),u=require_assert();function l(d){return d instanceof Uint8Array||d!=null&&typeof d=="object"&&d.constructor.name==="Uint8Array"}s.isBytes=l;const f=d=>new Uint8Array(d.buffer,d.byteOffset,d.byteLength);s.u8=f;const c=d=>new Uint32Array(d.buffer,d.byteOffset,Math.floor(d.byteLength/4));s.u32=c;const h=d=>new DataView(d.buffer,d.byteOffset,d.byteLength);s.createView=h;const p=(d,g)=>d<<32-g|d>>>g;s.rotr=p;const v=(d,g)=>d<<g|d>>>32-g>>>0;s.rotl=v,s.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;const y=d=>d<<24&4278190080|d<<8&16711680|d>>>8&65280|d>>>24&255;s.byteSwap=y,s.byteSwapIfBE=s.isLE?d=>d:d=>(0,s.byteSwap)(d);function b(d){for(let g=0;g<d.length;g++)d[g]=(0,s.byteSwap)(d[g])}s.byteSwap32=b;const S=Array.from({length:256},(d,g)=>g.toString(16).padStart(2,"0"));function E(d){(0,u.bytes)(d);let g="";for(let _=0;_<d.length;_++)g+=S[d[_]];return g}s.bytesToHex=E;const R={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function O(d){if(d>=R._0&&d<=R._9)return d-R._0;if(d>=R._A&&d<=R._F)return d-(R._A-10);if(d>=R._a&&d<=R._f)return d-(R._a-10)}function I(d){if(typeof d!="string")throw new Error("hex string expected, got "+typeof d);const g=d.length,_=g/2;if(g%2)throw new Error("padded hex string expected, got unpadded hex of length "+g);const w=new Uint8Array(_);for(let x=0,P=0;x<_;x++,P+=2){const $=O(d.charCodeAt(P)),T=O(d.charCodeAt(P+1));if($===void 0||T===void 0){const m=d[P]+d[P+1];throw new Error('hex string expected, got non-hex character "'+m+'" at index '+P)}w[x]=$*16+T}return w}s.hexToBytes=I;const B=async()=>{};s.nextTick=B;async function N(d,g,_){let w=Date.now();for(let x=0;x<d;x++){_(x);const P=Date.now()-w;P>=0&&P<g||(await(0,s.nextTick)(),w+=P)}}s.asyncLoop=N;function D(d){if(typeof d!="string")throw new Error(`utf8ToBytes expected string, got ${typeof d}`);return new Uint8Array(new TextEncoder().encode(d))}s.utf8ToBytes=D;function G(d){return typeof d=="string"&&(d=D(d)),(0,u.bytes)(d),d}s.toBytes=G;function V(...d){let g=0;for(let w=0;w<d.length;w++){const x=d[w];(0,u.bytes)(x),g+=x.length}const _=new Uint8Array(g);for(let w=0,x=0;w<d.length;w++){const P=d[w];_.set(P,x),x+=P.length}return _}s.concatBytes=V;class U{clone(){return this._cloneInto()}}s.Hash=U;const te={}.toString;function Z(d,g){if(g!==void 0&&te.call(g)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(d,g)}s.checkOpts=Z;function J(d){const g=w=>d().update(G(w)).digest(),_=d();return g.outputLen=_.outputLen,g.blockLen=_.blockLen,g.create=()=>d(),g}s.wrapConstructor=J;function Q(d){const g=(w,x)=>d(x).update(G(w)).digest(),_=d({});return g.outputLen=_.outputLen,g.blockLen=_.blockLen,g.create=w=>d(w),g}s.wrapConstructorWithOpts=Q;function ee(d){const g=(w,x)=>d(x).update(G(w)).digest(),_=d({});return g.outputLen=_.outputLen,g.blockLen=_.blockLen,g.create=w=>d(w),g}s.wrapXOFConstructorWithOpts=ee;function k(d=32){if(a.crypto&&typeof a.crypto.getRandomValues=="function")return a.crypto.getRandomValues(new Uint8Array(d));throw new Error("crypto.getRandomValues must be defined")}s.randomBytes=k}(utils)),utils}var hasRequired_md;function require_md(){if(hasRequired_md)return _md;hasRequired_md=1,Object.defineProperty(_md,"__esModule",{value:!0}),_md.HashMD=_md.Maj=_md.Chi=void 0;const s=require_assert(),a=requireUtils();function u(h,p,v,y){if(typeof h.setBigUint64=="function")return h.setBigUint64(p,v,y);const b=BigInt(32),S=BigInt(4294967295),E=Number(v>>b&S),R=Number(v&S),O=y?4:0,I=y?0:4;h.setUint32(p+O,E,y),h.setUint32(p+I,R,y)}const l=(h,p,v)=>h&p^~h&v;_md.Chi=l;const f=(h,p,v)=>h&p^h&v^p&v;_md.Maj=f;class c extends a.Hash{constructor(p,v,y,b){super(),this.blockLen=p,this.outputLen=v,this.padOffset=y,this.isLE=b,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(p),this.view=(0,a.createView)(this.buffer)}update(p){(0,s.exists)(this);const{view:v,buffer:y,blockLen:b}=this;p=(0,a.toBytes)(p);const S=p.length;for(let E=0;E<S;){const R=Math.min(b-this.pos,S-E);if(R===b){const O=(0,a.createView)(p);for(;b<=S-E;E+=b)this.process(O,E);continue}y.set(p.subarray(E,E+R),this.pos),this.pos+=R,E+=R,this.pos===b&&(this.process(v,0),this.pos=0)}return this.length+=p.length,this.roundClean(),this}digestInto(p){(0,s.exists)(this),(0,s.output)(p,this),this.finished=!0;const{buffer:v,view:y,blockLen:b,isLE:S}=this;let{pos:E}=this;v[E++]=128,this.buffer.subarray(E).fill(0),this.padOffset>b-E&&(this.process(y,0),E=0);for(let N=E;N<b;N++)v[N]=0;u(y,b-8,BigInt(this.length*8),S),this.process(y,0);const R=(0,a.createView)(p),O=this.outputLen;if(O%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const I=O/4,B=this.get();if(I>B.length)throw new Error("_sha2: outputLen bigger than state");for(let N=0;N<I;N++)R.setUint32(4*N,B[N],S)}digest(){const{buffer:p,outputLen:v}=this;this.digestInto(p);const y=p.slice(0,v);return this.destroy(),y}_cloneInto(p){p||(p=new this.constructor),p.set(...this.get());const{blockLen:v,buffer:y,length:b,finished:S,destroyed:E,pos:R}=this;return p.length=b,p.pos=R,p.finished=S,p.destroyed=E,b%v&&p.buffer.set(y),p}}return _md.HashMD=c,_md}var hasRequiredSha256;function requireSha256(){if(hasRequiredSha256)return sha256$1;hasRequiredSha256=1,Object.defineProperty(sha256$1,"__esModule",{value:!0}),sha256$1.sha224=sha256$1.sha256=void 0;const s=require_md(),a=requireUtils(),u=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]),l=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),f=new Uint32Array(64);class c extends s.HashMD{constructor(){super(64,32,8,!1),this.A=l[0]|0,this.B=l[1]|0,this.C=l[2]|0,this.D=l[3]|0,this.E=l[4]|0,this.F=l[5]|0,this.G=l[6]|0,this.H=l[7]|0}get(){const{A:v,B:y,C:b,D:S,E,F:R,G:O,H:I}=this;return[v,y,b,S,E,R,O,I]}set(v,y,b,S,E,R,O,I){this.A=v|0,this.B=y|0,this.C=b|0,this.D=S|0,this.E=E|0,this.F=R|0,this.G=O|0,this.H=I|0}process(v,y){for(let D=0;D<16;D++,y+=4)f[D]=v.getUint32(y,!1);for(let D=16;D<64;D++){const G=f[D-15],V=f[D-2],U=(0,a.rotr)(G,7)^(0,a.rotr)(G,18)^G>>>3,te=(0,a.rotr)(V,17)^(0,a.rotr)(V,19)^V>>>10;f[D]=te+f[D-7]+U+f[D-16]|0}let{A:b,B:S,C:E,D:R,E:O,F:I,G:B,H:N}=this;for(let D=0;D<64;D++){const G=(0,a.rotr)(O,6)^(0,a.rotr)(O,11)^(0,a.rotr)(O,25),V=N+G+(0,s.Chi)(O,I,B)+u[D]+f[D]|0,te=((0,a.rotr)(b,2)^(0,a.rotr)(b,13)^(0,a.rotr)(b,22))+(0,s.Maj)(b,S,E)|0;N=B,B=I,I=O,O=R+V|0,R=E,E=S,S=b,b=V+te|0}b=b+this.A|0,S=S+this.B|0,E=E+this.C|0,R=R+this.D|0,O=O+this.E|0,I=I+this.F|0,B=B+this.G|0,N=N+this.H|0,this.set(b,S,E,R,O,I,B,N)}roundClean(){f.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class h extends c{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}}return sha256$1.sha256=(0,a.wrapConstructor)(()=>new c),sha256$1.sha224=(0,a.wrapConstructor)(()=>new h),sha256$1}var src$2,hasRequiredSrc$2;function requireSrc$2(){if(hasRequiredSrc$2)return src$2;hasRequiredSrc$2=1;function s(a){if(a.length>=255)throw new TypeError("Alphabet too long");for(var u=new Uint8Array(256),l=0;l<u.length;l++)u[l]=255;for(var f=0;f<a.length;f++){var c=a.charAt(f),h=c.charCodeAt(0);if(u[h]!==255)throw new TypeError(c+" is ambiguous");u[h]=f}var p=a.length,v=a.charAt(0),y=Math.log(p)/Math.log(256),b=Math.log(256)/Math.log(p);function S(O){if(O instanceof Uint8Array||(ArrayBuffer.isView(O)?O=new Uint8Array(O.buffer,O.byteOffset,O.byteLength):Array.isArray(O)&&(O=Uint8Array.from(O))),!(O instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(O.length===0)return"";for(var I=0,B=0,N=0,D=O.length;N!==D&&O[N]===0;)N++,I++;for(var G=(D-N)*b+1>>>0,V=new Uint8Array(G);N!==D;){for(var U=O[N],te=0,Z=G-1;(U!==0||te<B)&&Z!==-1;Z--,te++)U+=256*V[Z]>>>0,V[Z]=U%p>>>0,U=U/p>>>0;if(U!==0)throw new Error("Non-zero carry");B=te,N++}for(var J=G-B;J!==G&&V[J]===0;)J++;for(var Q=v.repeat(I);J<G;++J)Q+=a.charAt(V[J]);return Q}function E(O){if(typeof O!="string")throw new TypeError("Expected String");if(O.length===0)return new Uint8Array;for(var I=0,B=0,N=0;O[I]===v;)B++,I++;for(var D=(O.length-I)*y+1>>>0,G=new Uint8Array(D);O[I];){var V=u[O.charCodeAt(I)];if(V===255)return;for(var U=0,te=D-1;(V!==0||U<N)&&te!==-1;te--,U++)V+=p*G[te]>>>0,G[te]=V%256>>>0,V=V/256>>>0;if(V!==0)throw new Error("Non-zero carry");N=U,I++}for(var Z=D-N;Z!==D&&G[Z]===0;)Z++;for(var J=new Uint8Array(B+(D-Z)),Q=B;Z!==D;)J[Q++]=G[Z++];return J}function R(O){var I=E(O);if(I)return I;throw new Error("Non-base"+p+" character")}return{encode:S,decodeUnsafe:E,decode:R}}return src$2=s,src$2}var bs58$1,hasRequiredBs58$1;function requireBs58$1(){return hasRequiredBs58$1||(hasRequiredBs58$1=1,bs58$1=requireSrc$2()("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")),bs58$1}var base$1,hasRequiredBase$1;function requireBase$1(){if(hasRequiredBase$1)return base$1;hasRequiredBase$1=1;var s=requireBs58$1();return base$1=function(a){function u(h){var p=Uint8Array.from(h),v=a(p),y=p.length+4,b=new Uint8Array(y);return b.set(p,0),b.set(v.subarray(0,4),p.length),s.encode(b,y)}function l(h){var p=h.slice(0,-4),v=h.slice(-4),y=a(p);if(!(v[0]^y[0]|v[1]^y[1]|v[2]^y[2]|v[3]^y[3]))return p}function f(h){var p=s.decodeUnsafe(h);if(p)return l(p)}function c(h){var p=s.decode(h),v=l(p);if(!v)throw new Error("Invalid checksum");return v}return{encode:u,decode:c,decodeUnsafe:f}},base$1}var bs58check$2,hasRequiredBs58check$1;function requireBs58check$1(){if(hasRequiredBs58check$1)return bs58check$2;hasRequiredBs58check$1=1;var{sha256:s}=requireSha256(),a=requireBase$1();function u(l){return s(s(l))}return bs58check$2=a(u),bs58check$2}var bs58checkExports=requireBs58check$1();const bs58check$1=getDefaultExportFromCjs(bs58checkExports);class TaquitoError extends Error{}class ParameterValidationError extends TaquitoError{}class RpcError extends TaquitoError{}class TezosToolkitConfigError extends TaquitoError{}class UnsupportedActionError extends TaquitoError{}let NetworkError$1=class extends TaquitoError{};class InvalidAddressError extends ParameterValidationError{constructor(a,u){super(),this.address=a,this.errorDetail=u,this.name="InvalidAddressError",this.message=`Invalid address "${a}"`,this.message+=u?` ${u}.`:"."}}class InvalidStakingAddressError extends ParameterValidationError{constructor(a,u){super(),this.address=a,this.errorDetail=u,this.name="InvalidStakingAddressError",this.message=`Invalid staking address "${a}", you can only set destination as your own address`}}class InvalidFinalizeUnstakeAmountError extends ParameterValidationError{constructor(a,u){super(),this.address=a,this.errorDetail=u,this.name="InvalidFinalizeUnstakeAmountError",this.message="The amount can only be 0 when finalizing an unstake"}}class InvalidBlockHashError extends ParameterValidationError{constructor(a,u){super(),this.blockHash=a,this.errorDetail=u,this.name="InvalidBlockHashError",this.message=`Invalid block hash "${a}"`,this.message+=u?` ${u}.`:"."}}class InvalidAmountError extends ParameterValidationError{constructor(a){super(),this.amount=a,this.name="InvalidAmountError",this.message=`Invalid amount "${a}"`}}class InvalidDerivationPathError extends ParameterValidationError{constructor(a,u){super(),this.derivationPath=a,this.errorDetail=u,this.name="InvalidDerivationPathError",this.message=`Invalid derivation path "${a}"`,this.message+=u?` ${u}.`:"."}}class InvalidHexStringError extends ParameterValidationError{constructor(a,u){super(),this.hexString=a,this.errorDetail=u,this.name="InvalidHexStringError",this.message=`Invalid hex string "${a}"`,this.message+=u?` ${u}.`:"."}}class InvalidMessageError extends ParameterValidationError{constructor(a,u){super(),this.msg=a,this.errorDetail=u,this.name="InvalidMessageError",this.message=`Invalid message "${a}"`,this.message+=u?` ${u}.`:"."}}class InvalidViewParameterError extends ParameterValidationError{constructor(a,u,l,f){super(),this.viewName=a,this.sigs=u,this.args=l,this.cause=f,this.name="InvalidViewParameterError",this.message=`Invalid view arguments ${JSON.stringify(l)} received for name "${a}" expecting one of the following signatures ${JSON.stringify(u)}.`}}class InvalidKeyError extends ParameterValidationError{constructor(a){super(),this.errorDetail=a,this.name="InvalidKeyError",this.message="Invalid private key",this.message+=a?` ${a}.`:"."}}class InvalidPublicKeyError extends ParameterValidationError{constructor(a,u){super(),this.publicKey=a,this.errorDetail=u,this.name="InvalidPublicKeyError",this.message=`Invalid public key "${a}"`,this.message+=u?` ${u}.`:"."}}class InvalidContractAddressError extends ParameterValidationError{constructor(a,u){super(),this.contractAddress=a,this.errorDetail=u,this.name="InvalidContractAddressError",this.message=`Invalid contract address "${a}"`,this.message+=u?` ${u}.`:"."}}class InvalidChainIdError extends ParameterValidationError{constructor(a,u){super(),this.chainId=a,this.errorDetail=u,this.name="InvalidChainIdError",this.message=`Invalid chain id "${a}"`,this.message+=u?` ${u}.`:"."}}class InvalidKeyHashError extends ParameterValidationError{constructor(a,u){super(),this.keyHash=a,this.errorDetail=u,this.name="InvalidKeyHashError",this.message=`Invalid public key hash "${a}"`,this.message+=u?` ${u}.`:"."}}class InvalidOperationHashError extends ParameterValidationError{constructor(a,u){super(),this.operationHash=a,this.errorDetail=u,this.name="InvalidOperationHashError",this.message=`Invalid operation hash "${a}"`,this.message+=u?` ${u}.`:"."}}class InvalidOperationKindError extends ParameterValidationError{constructor(a,u){super(),this.operationKind=a,this.errorDetail=u,this.name="InvalidOperationKindError",this.message=`Invalid operation kind "${a}"`,this.message+=u?` ${u}.`:"."}}class DeprecationError extends UnsupportedActionError{constructor(a){super(),this.message=a,this.name="DeprecationError"}}class ProhibitedActionError extends UnsupportedActionError{constructor(a){super(),this.message=a,this.name="ProhibitedActionError"}}class PublicKeyNotFoundError extends TaquitoError{constructor(a,u){super(),this.pkh=a,this.cause=u,this.name="PublicKeyNotFoundError",this.message=`Public key not found of this address "${a}" in either wallet or contract API.`}}var isNumeric=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,mathceil=Math.ceil,mathfloor=Math.floor,bignumberError="[BigNumber Error] ",tooManyDigits=bignumberError+"Number primitive has more than 15 significant digits: ",BASE=1e14,LOG_BASE=14,MAX_SAFE_INTEGER=9007199254740991,POWS_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],SQRT_BASE=1e7,MAX=1e9;function clone(s){var a,u,l,f=D.prototype={constructor:D,toString:null,valueOf:null},c=new D(1),h=20,p=4,v=-7,y=21,b=-1e7,S=1e7,E=!1,R=1,O=0,I={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},B="0123456789abcdefghijklmnopqrstuvwxyz",N=!0;function D(J,Q){var ee,k,d,g,_,w,x,P,$=this;if(!($ instanceof D))return new D(J,Q);if(Q==null){if(J&&J._isBigNumber===!0){$.s=J.s,!J.c||J.e>S?$.c=$.e=null:J.e<b?$.c=[$.e=0]:($.e=J.e,$.c=J.c.slice());return}if((w=typeof J=="number")&&J*0==0){if($.s=1/J<0?(J=-J,-1):1,J===~~J){for(g=0,_=J;_>=10;_/=10,g++);g>S?$.c=$.e=null:($.e=g,$.c=[J]);return}P=String(J)}else{if(!isNumeric.test(P=String(J)))return l($,P,w);$.s=P.charCodeAt(0)==45?(P=P.slice(1),-1):1}(g=P.indexOf("."))>-1&&(P=P.replace(".","")),(_=P.search(/e/i))>0?(g<0&&(g=_),g+=+P.slice(_+1),P=P.substring(0,_)):g<0&&(g=P.length)}else{if(intCheck(Q,2,B.length,"Base"),Q==10&&N)return $=new D(J),te($,h+$.e+1,p);if(P=String(J),w=typeof J=="number"){if(J*0!=0)return l($,P,w,Q);if($.s=1/J<0?(P=P.slice(1),-1):1,D.DEBUG&&P.replace(/^0\.0*|\./,"").length>15)throw Error(tooManyDigits+J)}else $.s=P.charCodeAt(0)===45?(P=P.slice(1),-1):1;for(ee=B.slice(0,Q),g=_=0,x=P.length;_<x;_++)if(ee.indexOf(k=P.charAt(_))<0){if(k=="."){if(_>g){g=x;continue}}else if(!d&&(P==P.toUpperCase()&&(P=P.toLowerCase())||P==P.toLowerCase()&&(P=P.toUpperCase()))){d=!0,_=-1,g=0;continue}return l($,String(J),w,Q)}w=!1,P=u(P,Q,10,$.s),(g=P.indexOf("."))>-1?P=P.replace(".",""):g=P.length}for(_=0;P.charCodeAt(_)===48;_++);for(x=P.length;P.charCodeAt(--x)===48;);if(P=P.slice(_,++x)){if(x-=_,w&&D.DEBUG&&x>15&&(J>MAX_SAFE_INTEGER||J!==mathfloor(J)))throw Error(tooManyDigits+$.s*J);if((g=g-_-1)>S)$.c=$.e=null;else if(g<b)$.c=[$.e=0];else{if($.e=g,$.c=[],_=(g+1)%LOG_BASE,g<0&&(_+=LOG_BASE),_<x){for(_&&$.c.push(+P.slice(0,_)),x-=LOG_BASE;_<x;)$.c.push(+P.slice(_,_+=LOG_BASE));_=LOG_BASE-(P=P.slice(_)).length}else _-=x;for(;_--;P+="0");$.c.push(+P)}}else $.c=[$.e=0]}D.clone=clone,D.ROUND_UP=0,D.ROUND_DOWN=1,D.ROUND_CEIL=2,D.ROUND_FLOOR=3,D.ROUND_HALF_UP=4,D.ROUND_HALF_DOWN=5,D.ROUND_HALF_EVEN=6,D.ROUND_HALF_CEIL=7,D.ROUND_HALF_FLOOR=8,D.EUCLID=9,D.config=D.set=function(J){var Q,ee;if(J!=null)if(typeof J=="object"){if(J.hasOwnProperty(Q="DECIMAL_PLACES")&&(ee=J[Q],intCheck(ee,0,MAX,Q),h=ee),J.hasOwnProperty(Q="ROUNDING_MODE")&&(ee=J[Q],intCheck(ee,0,8,Q),p=ee),J.hasOwnProperty(Q="EXPONENTIAL_AT")&&(ee=J[Q],ee&&ee.pop?(intCheck(ee[0],-MAX,0,Q),intCheck(ee[1],0,MAX,Q),v=ee[0],y=ee[1]):(intCheck(ee,-MAX,MAX,Q),v=-(y=ee<0?-ee:ee))),J.hasOwnProperty(Q="RANGE"))if(ee=J[Q],ee&&ee.pop)intCheck(ee[0],-MAX,-1,Q),intCheck(ee[1],1,MAX,Q),b=ee[0],S=ee[1];else if(intCheck(ee,-MAX,MAX,Q),ee)b=-(S=ee<0?-ee:ee);else throw Error(bignumberError+Q+" cannot be zero: "+ee);if(J.hasOwnProperty(Q="CRYPTO"))if(ee=J[Q],ee===!!ee)if(ee)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))E=ee;else throw E=!ee,Error(bignumberError+"crypto unavailable");else E=ee;else throw Error(bignumberError+Q+" not true or false: "+ee);if(J.hasOwnProperty(Q="MODULO_MODE")&&(ee=J[Q],intCheck(ee,0,9,Q),R=ee),J.hasOwnProperty(Q="POW_PRECISION")&&(ee=J[Q],intCheck(ee,0,MAX,Q),O=ee),J.hasOwnProperty(Q="FORMAT"))if(ee=J[Q],typeof ee=="object")I=ee;else throw Error(bignumberError+Q+" not an object: "+ee);if(J.hasOwnProperty(Q="ALPHABET"))if(ee=J[Q],typeof ee=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(ee))N=ee.slice(0,10)=="0123456789",B=ee;else throw Error(bignumberError+Q+" invalid: "+ee)}else throw Error(bignumberError+"Object expected: "+J);return{DECIMAL_PLACES:h,ROUNDING_MODE:p,EXPONENTIAL_AT:[v,y],RANGE:[b,S],CRYPTO:E,MODULO_MODE:R,POW_PRECISION:O,FORMAT:I,ALPHABET:B}},D.isBigNumber=function(J){if(!J||J._isBigNumber!==!0)return!1;if(!D.DEBUG)return!0;var Q,ee,k=J.c,d=J.e,g=J.s;e:if({}.toString.call(k)=="[object Array]"){if((g===1||g===-1)&&d>=-MAX&&d<=MAX&&d===mathfloor(d)){if(k[0]===0){if(d===0&&k.length===1)return!0;break e}if(Q=(d+1)%LOG_BASE,Q<1&&(Q+=LOG_BASE),String(k[0]).length==Q){for(Q=0;Q<k.length;Q++)if(ee=k[Q],ee<0||ee>=BASE||ee!==mathfloor(ee))break e;if(ee!==0)return!0}}}else if(k===null&&d===null&&(g===null||g===1||g===-1))return!0;throw Error(bignumberError+"Invalid BigNumber: "+J)},D.maximum=D.max=function(){return V(arguments,-1)},D.minimum=D.min=function(){return V(arguments,1)},D.random=function(){var J=9007199254740992,Q=Math.random()*J&2097151?function(){return mathfloor(Math.random()*J)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(ee){var k,d,g,_,w,x=0,P=[],$=new D(c);if(ee==null?ee=h:intCheck(ee,0,MAX),_=mathceil(ee/LOG_BASE),E)if(crypto.getRandomValues){for(k=crypto.getRandomValues(new Uint32Array(_*=2));x<_;)w=k[x]*131072+(k[x+1]>>>11),w>=9e15?(d=crypto.getRandomValues(new Uint32Array(2)),k[x]=d[0],k[x+1]=d[1]):(P.push(w%1e14),x+=2);x=_/2}else if(crypto.randomBytes){for(k=crypto.randomBytes(_*=7);x<_;)w=(k[x]&31)*281474976710656+k[x+1]*1099511627776+k[x+2]*4294967296+k[x+3]*16777216+(k[x+4]<<16)+(k[x+5]<<8)+k[x+6],w>=9e15?crypto.randomBytes(7).copy(k,x):(P.push(w%1e14),x+=7);x=_/7}else throw E=!1,Error(bignumberError+"crypto unavailable");if(!E)for(;x<_;)w=Q(),w<9e15&&(P[x++]=w%1e14);for(_=P[--x],ee%=LOG_BASE,_&&ee&&(w=POWS_TEN[LOG_BASE-ee],P[x]=mathfloor(_/w)*w);P[x]===0;P.pop(),x--);if(x<0)P=[g=0];else{for(g=-1;P[0]===0;P.splice(0,1),g-=LOG_BASE);for(x=1,w=P[0];w>=10;w/=10,x++);x<LOG_BASE&&(g-=LOG_BASE-x)}return $.e=g,$.c=P,$}}(),D.sum=function(){for(var J=1,Q=arguments,ee=new D(Q[0]);J<Q.length;)ee=ee.plus(Q[J++]);return ee},u=function(){var J="0123456789";function Q(ee,k,d,g){for(var _,w=[0],x,P=0,$=ee.length;P<$;){for(x=w.length;x--;w[x]*=k);for(w[0]+=g.indexOf(ee.charAt(P++)),_=0;_<w.length;_++)w[_]>d-1&&(w[_+1]==null&&(w[_+1]=0),w[_+1]+=w[_]/d|0,w[_]%=d)}return w.reverse()}return function(ee,k,d,g,_){var w,x,P,$,T,m,M,W,Y=ee.indexOf("."),ue=h,ge=p;for(Y>=0&&($=O,O=0,ee=ee.replace(".",""),W=new D(k),m=W.pow(ee.length-Y),O=$,W.c=Q(toFixedPoint(coeffToString(m.c),m.e,"0"),10,d,J),W.e=W.c.length),M=Q(ee,k,d,_?(w=B,J):(w=J,B)),P=$=M.length;M[--$]==0;M.pop());if(!M[0])return w.charAt(0);if(Y<0?--P:(m.c=M,m.e=P,m.s=g,m=a(m,W,ue,ge,d),M=m.c,T=m.r,P=m.e),x=P+ue+1,Y=M[x],$=d/2,T=T||x<0||M[x+1]!=null,T=ge<4?(Y!=null||T)&&(ge==0||ge==(m.s<0?3:2)):Y>$||Y==$&&(ge==4||T||ge==6&&M[x-1]&1||ge==(m.s<0?8:7)),x<1||!M[0])ee=T?toFixedPoint(w.charAt(1),-ue,w.charAt(0)):w.charAt(0);else{if(M.length=x,T)for(--d;++M[--x]>d;)M[x]=0,x||(++P,M=[1].concat(M));for($=M.length;!M[--$];);for(Y=0,ee="";Y<=$;ee+=w.charAt(M[Y++]));ee=toFixedPoint(ee,P,w.charAt(0))}return ee}}(),a=function(){function J(k,d,g){var _,w,x,P,$=0,T=k.length,m=d%SQRT_BASE,M=d/SQRT_BASE|0;for(k=k.slice();T--;)x=k[T]%SQRT_BASE,P=k[T]/SQRT_BASE|0,_=M*x+P*m,w=m*x+_%SQRT_BASE*SQRT_BASE+$,$=(w/g|0)+(_/SQRT_BASE|0)+M*P,k[T]=w%g;return $&&(k=[$].concat(k)),k}function Q(k,d,g,_){var w,x;if(g!=_)x=g>_?1:-1;else for(w=x=0;w<g;w++)if(k[w]!=d[w]){x=k[w]>d[w]?1:-1;break}return x}function ee(k,d,g,_){for(var w=0;g--;)k[g]-=w,w=k[g]<d[g]?1:0,k[g]=w*_+k[g]-d[g];for(;!k[0]&&k.length>1;k.splice(0,1));}return function(k,d,g,_,w){var x,P,$,T,m,M,W,Y,ue,ge,he,ae,de,pe,oe,le,me,xe=k.s==d.s?1:-1,Ne=k.c,Pe=d.c;if(!Ne||!Ne[0]||!Pe||!Pe[0])return new D(!k.s||!d.s||(Ne?Pe&&Ne[0]==Pe[0]:!Pe)?NaN:Ne&&Ne[0]==0||!Pe?xe*0:xe/0);for(Y=new D(xe),ue=Y.c=[],P=k.e-d.e,xe=g+P+1,w||(w=BASE,P=bitFloor(k.e/LOG_BASE)-bitFloor(d.e/LOG_BASE),xe=xe/LOG_BASE|0),$=0;Pe[$]==(Ne[$]||0);$++);if(Pe[$]>(Ne[$]||0)&&P--,xe<0)ue.push(1),T=!0;else{for(pe=Ne.length,le=Pe.length,$=0,xe+=2,m=mathfloor(w/(Pe[0]+1)),m>1&&(Pe=J(Pe,m,w),Ne=J(Ne,m,w),le=Pe.length,pe=Ne.length),de=le,ge=Ne.slice(0,le),he=ge.length;he<le;ge[he++]=0);me=Pe.slice(),me=[0].concat(me),oe=Pe[0],Pe[1]>=w/2&&oe++;do{if(m=0,x=Q(Pe,ge,le,he),x<0){if(ae=ge[0],le!=he&&(ae=ae*w+(ge[1]||0)),m=mathfloor(ae/oe),m>1)for(m>=w&&(m=w-1),M=J(Pe,m,w),W=M.length,he=ge.length;Q(M,ge,W,he)==1;)m--,ee(M,le<W?me:Pe,W,w),W=M.length,x=1;else m==0&&(x=m=1),M=Pe.slice(),W=M.length;if(W<he&&(M=[0].concat(M)),ee(ge,M,he,w),he=ge.length,x==-1)for(;Q(Pe,ge,le,he)<1;)m++,ee(ge,le<he?me:Pe,he,w),he=ge.length}else x===0&&(m++,ge=[0]);ue[$++]=m,ge[0]?ge[he++]=Ne[de]||0:(ge=[Ne[de]],he=1)}while((de++<pe||ge[0]!=null)&&xe--);T=ge[0]!=null,ue[0]||ue.splice(0,1)}if(w==BASE){for($=1,xe=ue[0];xe>=10;xe/=10,$++);te(Y,g+(Y.e=$+P*LOG_BASE-1)+1,_,T)}else Y.e=P,Y.r=+T;return Y}}();function G(J,Q,ee,k){var d,g,_,w,x;if(ee==null?ee=p:intCheck(ee,0,8),!J.c)return J.toString();if(d=J.c[0],_=J.e,Q==null)x=coeffToString(J.c),x=k==1||k==2&&(_<=v||_>=y)?toExponential(x,_):toFixedPoint(x,_,"0");else if(J=te(new D(J),Q,ee),g=J.e,x=coeffToString(J.c),w=x.length,k==1||k==2&&(Q<=g||g<=v)){for(;w<Q;x+="0",w++);x=toExponential(x,g)}else if(Q-=_,x=toFixedPoint(x,g,"0"),g+1>w){if(--Q>0)for(x+=".";Q--;x+="0");}else if(Q+=g-w,Q>0)for(g+1==w&&(x+=".");Q--;x+="0");return J.s<0&&d?"-"+x:x}function V(J,Q){for(var ee,k,d=1,g=new D(J[0]);d<J.length;d++)k=new D(J[d]),(!k.s||(ee=compare(g,k))===Q||ee===0&&g.s===Q)&&(g=k);return g}function U(J,Q,ee){for(var k=1,d=Q.length;!Q[--d];Q.pop());for(d=Q[0];d>=10;d/=10,k++);return(ee=k+ee*LOG_BASE-1)>S?J.c=J.e=null:ee<b?J.c=[J.e=0]:(J.e=ee,J.c=Q),J}l=function(){var J=/^(-?)0([xbo])(?=\w[\w.]*$)/i,Q=/^([^.]+)\.$/,ee=/^\.([^.]+)$/,k=/^-?(Infinity|NaN)$/,d=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(g,_,w,x){var P,$=w?_:_.replace(d,"");if(k.test($))g.s=isNaN($)?null:$<0?-1:1;else{if(!w&&($=$.replace(J,function(T,m,M){return P=(M=M.toLowerCase())=="x"?16:M=="b"?2:8,!x||x==P?m:T}),x&&(P=x,$=$.replace(Q,"$1").replace(ee,"0.$1")),_!=$))return new D($,P);if(D.DEBUG)throw Error(bignumberError+"Not a"+(x?" base "+x:"")+" number: "+_);g.s=null}g.c=g.e=null}}();function te(J,Q,ee,k){var d,g,_,w,x,P,$,T=J.c,m=POWS_TEN;if(T){e:{for(d=1,w=T[0];w>=10;w/=10,d++);if(g=Q-d,g<0)g+=LOG_BASE,_=Q,x=T[P=0],$=mathfloor(x/m[d-_-1]%10);else if(P=mathceil((g+1)/LOG_BASE),P>=T.length)if(k){for(;T.length<=P;T.push(0));x=$=0,d=1,g%=LOG_BASE,_=g-LOG_BASE+1}else break e;else{for(x=w=T[P],d=1;w>=10;w/=10,d++);g%=LOG_BASE,_=g-LOG_BASE+d,$=_<0?0:mathfloor(x/m[d-_-1]%10)}if(k=k||Q<0||T[P+1]!=null||(_<0?x:x%m[d-_-1]),k=ee<4?($||k)&&(ee==0||ee==(J.s<0?3:2)):$>5||$==5&&(ee==4||k||ee==6&&(g>0?_>0?x/m[d-_]:0:T[P-1])%10&1||ee==(J.s<0?8:7)),Q<1||!T[0])return T.length=0,k?(Q-=J.e+1,T[0]=m[(LOG_BASE-Q%LOG_BASE)%LOG_BASE],J.e=-Q||0):T[0]=J.e=0,J;if(g==0?(T.length=P,w=1,P--):(T.length=P+1,w=m[LOG_BASE-g],T[P]=_>0?mathfloor(x/m[d-_]%m[_])*w:0),k)for(;;)if(P==0){for(g=1,_=T[0];_>=10;_/=10,g++);for(_=T[0]+=w,w=1;_>=10;_/=10,w++);g!=w&&(J.e++,T[0]==BASE&&(T[0]=1));break}else{if(T[P]+=w,T[P]!=BASE)break;T[P--]=0,w=1}for(g=T.length;T[--g]===0;T.pop());}J.e>S?J.c=J.e=null:J.e<b&&(J.c=[J.e=0])}return J}function Z(J){var Q,ee=J.e;return ee===null?J.toString():(Q=coeffToString(J.c),Q=ee<=v||ee>=y?toExponential(Q,ee):toFixedPoint(Q,ee,"0"),J.s<0?"-"+Q:Q)}return f.absoluteValue=f.abs=function(){var J=new D(this);return J.s<0&&(J.s=1),J},f.comparedTo=function(J,Q){return compare(this,new D(J,Q))},f.decimalPlaces=f.dp=function(J,Q){var ee,k,d,g=this;if(J!=null)return intCheck(J,0,MAX),Q==null?Q=p:intCheck(Q,0,8),te(new D(g),J+g.e+1,Q);if(!(ee=g.c))return null;if(k=((d=ee.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,d=ee[d])for(;d%10==0;d/=10,k--);return k<0&&(k=0),k},f.dividedBy=f.div=function(J,Q){return a(this,new D(J,Q),h,p)},f.dividedToIntegerBy=f.idiv=function(J,Q){return a(this,new D(J,Q),0,1)},f.exponentiatedBy=f.pow=function(J,Q){var ee,k,d,g,_,w,x,P,$,T=this;if(J=new D(J),J.c&&!J.isInteger())throw Error(bignumberError+"Exponent not an integer: "+Z(J));if(Q!=null&&(Q=new D(Q)),w=J.e>14,!T.c||!T.c[0]||T.c[0]==1&&!T.e&&T.c.length==1||!J.c||!J.c[0])return $=new D(Math.pow(+Z(T),w?J.s*(2-isOdd(J)):+Z(J))),Q?$.mod(Q):$;if(x=J.s<0,Q){if(Q.c?!Q.c[0]:!Q.s)return new D(NaN);k=!x&&T.isInteger()&&Q.isInteger(),k&&(T=T.mod(Q))}else{if(J.e>9&&(T.e>0||T.e<-1||(T.e==0?T.c[0]>1||w&&T.c[1]>=24e7:T.c[0]<8e13||w&&T.c[0]<=9999975e7)))return g=T.s<0&&isOdd(J)?-0:0,T.e>-1&&(g=1/g),new D(x?1/g:g);O&&(g=mathceil(O/LOG_BASE+2))}for(w?(ee=new D(.5),x&&(J.s=1),P=isOdd(J)):(d=Math.abs(+Z(J)),P=d%2),$=new D(c);;){if(P){if($=$.times(T),!$.c)break;g?$.c.length>g&&($.c.length=g):k&&($=$.mod(Q))}if(d){if(d=mathfloor(d/2),d===0)break;P=d%2}else if(J=J.times(ee),te(J,J.e+1,1),J.e>14)P=isOdd(J);else{if(d=+Z(J),d===0)break;P=d%2}T=T.times(T),g?T.c&&T.c.length>g&&(T.c.length=g):k&&(T=T.mod(Q))}return k?$:(x&&($=c.div($)),Q?$.mod(Q):g?te($,O,p,_):$)},f.integerValue=function(J){var Q=new D(this);return J==null?J=p:intCheck(J,0,8),te(Q,Q.e+1,J)},f.isEqualTo=f.eq=function(J,Q){return compare(this,new D(J,Q))===0},f.isFinite=function(){return!!this.c},f.isGreaterThan=f.gt=function(J,Q){return compare(this,new D(J,Q))>0},f.isGreaterThanOrEqualTo=f.gte=function(J,Q){return(Q=compare(this,new D(J,Q)))===1||Q===0},f.isInteger=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},f.isLessThan=f.lt=function(J,Q){return compare(this,new D(J,Q))<0},f.isLessThanOrEqualTo=f.lte=function(J,Q){return(Q=compare(this,new D(J,Q)))===-1||Q===0},f.isNaN=function(){return!this.s},f.isNegative=function(){return this.s<0},f.isPositive=function(){return this.s>0},f.isZero=function(){return!!this.c&&this.c[0]==0},f.minus=function(J,Q){var ee,k,d,g,_=this,w=_.s;if(J=new D(J,Q),Q=J.s,!w||!Q)return new D(NaN);if(w!=Q)return J.s=-Q,_.plus(J);var x=_.e/LOG_BASE,P=J.e/LOG_BASE,$=_.c,T=J.c;if(!x||!P){if(!$||!T)return $?(J.s=-Q,J):new D(T?_:NaN);if(!$[0]||!T[0])return T[0]?(J.s=-Q,J):new D($[0]?_:p==3?-0:0)}if(x=bitFloor(x),P=bitFloor(P),$=$.slice(),w=x-P){for((g=w<0)?(w=-w,d=$):(P=x,d=T),d.reverse(),Q=w;Q--;d.push(0));d.reverse()}else for(k=(g=(w=$.length)<(Q=T.length))?w:Q,w=Q=0;Q<k;Q++)if($[Q]!=T[Q]){g=$[Q]<T[Q];break}if(g&&(d=$,$=T,T=d,J.s=-J.s),Q=(k=T.length)-(ee=$.length),Q>0)for(;Q--;$[ee++]=0);for(Q=BASE-1;k>w;){if($[--k]<T[k]){for(ee=k;ee&&!$[--ee];$[ee]=Q);--$[ee],$[k]+=BASE}$[k]-=T[k]}for(;$[0]==0;$.splice(0,1),--P);return $[0]?U(J,$,P):(J.s=p==3?-1:1,J.c=[J.e=0],J)},f.modulo=f.mod=function(J,Q){var ee,k,d=this;return J=new D(J,Q),!d.c||!J.s||J.c&&!J.c[0]?new D(NaN):!J.c||d.c&&!d.c[0]?new D(d):(R==9?(k=J.s,J.s=1,ee=a(d,J,0,3),J.s=k,ee.s*=k):ee=a(d,J,0,R),J=d.minus(ee.times(J)),!J.c[0]&&R==1&&(J.s=d.s),J)},f.multipliedBy=f.times=function(J,Q){var ee,k,d,g,_,w,x,P,$,T,m,M,W,Y,ue,ge=this,he=ge.c,ae=(J=new D(J,Q)).c;if(!he||!ae||!he[0]||!ae[0])return!ge.s||!J.s||he&&!he[0]&&!ae||ae&&!ae[0]&&!he?J.c=J.e=J.s=null:(J.s*=ge.s,!he||!ae?J.c=J.e=null:(J.c=[0],J.e=0)),J;for(k=bitFloor(ge.e/LOG_BASE)+bitFloor(J.e/LOG_BASE),J.s*=ge.s,x=he.length,T=ae.length,x<T&&(W=he,he=ae,ae=W,d=x,x=T,T=d),d=x+T,W=[];d--;W.push(0));for(Y=BASE,ue=SQRT_BASE,d=T;--d>=0;){for(ee=0,m=ae[d]%ue,M=ae[d]/ue|0,_=x,g=d+_;g>d;)P=he[--_]%ue,$=he[_]/ue|0,w=M*P+$*m,P=m*P+w%ue*ue+W[g]+ee,ee=(P/Y|0)+(w/ue|0)+M*$,W[g--]=P%Y;W[g]=ee}return ee?++k:W.splice(0,1),U(J,W,k)},f.negated=function(){var J=new D(this);return J.s=-J.s||null,J},f.plus=function(J,Q){var ee,k=this,d=k.s;if(J=new D(J,Q),Q=J.s,!d||!Q)return new D(NaN);if(d!=Q)return J.s=-Q,k.minus(J);var g=k.e/LOG_BASE,_=J.e/LOG_BASE,w=k.c,x=J.c;if(!g||!_){if(!w||!x)return new D(d/0);if(!w[0]||!x[0])return x[0]?J:new D(w[0]?k:d*0)}if(g=bitFloor(g),_=bitFloor(_),w=w.slice(),d=g-_){for(d>0?(_=g,ee=x):(d=-d,ee=w),ee.reverse();d--;ee.push(0));ee.reverse()}for(d=w.length,Q=x.length,d-Q<0&&(ee=x,x=w,w=ee,Q=d),d=0;Q;)d=(w[--Q]=w[Q]+x[Q]+d)/BASE|0,w[Q]=BASE===w[Q]?0:w[Q]%BASE;return d&&(w=[d].concat(w),++_),U(J,w,_)},f.precision=f.sd=function(J,Q){var ee,k,d,g=this;if(J!=null&&J!==!!J)return intCheck(J,1,MAX),Q==null?Q=p:intCheck(Q,0,8),te(new D(g),J,Q);if(!(ee=g.c))return null;if(d=ee.length-1,k=d*LOG_BASE+1,d=ee[d]){for(;d%10==0;d/=10,k--);for(d=ee[0];d>=10;d/=10,k++);}return J&&g.e+1>k&&(k=g.e+1),k},f.shiftedBy=function(J){return intCheck(J,-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER),this.times("1e"+J)},f.squareRoot=f.sqrt=function(){var J,Q,ee,k,d,g=this,_=g.c,w=g.s,x=g.e,P=h+4,$=new D("0.5");if(w!==1||!_||!_[0])return new D(!w||w<0&&(!_||_[0])?NaN:_?g:1/0);if(w=Math.sqrt(+Z(g)),w==0||w==1/0?(Q=coeffToString(_),(Q.length+x)%2==0&&(Q+="0"),w=Math.sqrt(+Q),x=bitFloor((x+1)/2)-(x<0||x%2),w==1/0?Q="5e"+x:(Q=w.toExponential(),Q=Q.slice(0,Q.indexOf("e")+1)+x),ee=new D(Q)):ee=new D(w+""),ee.c[0]){for(x=ee.e,w=x+P,w<3&&(w=0);;)if(d=ee,ee=$.times(d.plus(a(g,d,P,1))),coeffToString(d.c).slice(0,w)===(Q=coeffToString(ee.c)).slice(0,w))if(ee.e<x&&--w,Q=Q.slice(w-3,w+1),Q=="9999"||!k&&Q=="4999"){if(!k&&(te(d,d.e+h+2,0),d.times(d).eq(g))){ee=d;break}P+=4,w+=4,k=1}else{(!+Q||!+Q.slice(1)&&Q.charAt(0)=="5")&&(te(ee,ee.e+h+2,1),J=!ee.times(ee).eq(g));break}}return te(ee,ee.e+h+1,p,J)},f.toExponential=function(J,Q){return J!=null&&(intCheck(J,0,MAX),J++),G(this,J,Q,1)},f.toFixed=function(J,Q){return J!=null&&(intCheck(J,0,MAX),J=J+this.e+1),G(this,J,Q)},f.toFormat=function(J,Q,ee){var k,d=this;if(ee==null)J!=null&&Q&&typeof Q=="object"?(ee=Q,Q=null):J&&typeof J=="object"?(ee=J,J=Q=null):ee=I;else if(typeof ee!="object")throw Error(bignumberError+"Argument not an object: "+ee);if(k=d.toFixed(J,Q),d.c){var g,_=k.split("."),w=+ee.groupSize,x=+ee.secondaryGroupSize,P=ee.groupSeparator||"",$=_[0],T=_[1],m=d.s<0,M=m?$.slice(1):$,W=M.length;if(x&&(g=w,w=x,x=g,W-=g),w>0&&W>0){for(g=W%w||w,$=M.substr(0,g);g<W;g+=w)$+=P+M.substr(g,w);x>0&&($+=P+M.slice(g)),m&&($="-"+$)}k=T?$+(ee.decimalSeparator||"")+((x=+ee.fractionGroupSize)?T.replace(new RegExp("\\d{"+x+"}\\B","g"),"$&"+(ee.fractionGroupSeparator||"")):T):$}return(ee.prefix||"")+k+(ee.suffix||"")},f.toFraction=function(J){var Q,ee,k,d,g,_,w,x,P,$,T,m,M=this,W=M.c;if(J!=null&&(w=new D(J),!w.isInteger()&&(w.c||w.s!==1)||w.lt(c)))throw Error(bignumberError+"Argument "+(w.isInteger()?"out of range: ":"not an integer: ")+Z(w));if(!W)return new D(M);for(Q=new D(c),P=ee=new D(c),k=x=new D(c),m=coeffToString(W),g=Q.e=m.length-M.e-1,Q.c[0]=POWS_TEN[(_=g%LOG_BASE)<0?LOG_BASE+_:_],J=!J||w.comparedTo(Q)>0?g>0?Q:P:w,_=S,S=1/0,w=new D(m),x.c[0]=0;$=a(w,Q,0,1),d=ee.plus($.times(k)),d.comparedTo(J)!=1;)ee=k,k=d,P=x.plus($.times(d=P)),x=d,Q=w.minus($.times(d=Q)),w=d;return d=a(J.minus(ee),k,0,1),x=x.plus(d.times(P)),ee=ee.plus(d.times(k)),x.s=P.s=M.s,g=g*2,T=a(P,k,g,p).minus(M).abs().comparedTo(a(x,ee,g,p).minus(M).abs())<1?[P,k]:[x,ee],S=_,T},f.toNumber=function(){return+Z(this)},f.toPrecision=function(J,Q){return J!=null&&intCheck(J,1,MAX),G(this,J,Q,2)},f.toString=function(J){var Q,ee=this,k=ee.s,d=ee.e;return d===null?k?(Q="Infinity",k<0&&(Q="-"+Q)):Q="NaN":(J==null?Q=d<=v||d>=y?toExponential(coeffToString(ee.c),d):toFixedPoint(coeffToString(ee.c),d,"0"):J===10&&N?(ee=te(new D(ee),h+d+1,p),Q=toFixedPoint(coeffToString(ee.c),ee.e,"0")):(intCheck(J,2,B.length,"Base"),Q=u(toFixedPoint(coeffToString(ee.c),d,"0"),10,J,k,!0)),k<0&&ee.c[0]&&(Q="-"+Q)),Q},f.valueOf=f.toJSON=function(){return Z(this)},f._isBigNumber=!0,f[Symbol.toStringTag]="BigNumber",f[Symbol.for("nodejs.util.inspect.custom")]=f.valueOf,s!=null&&D.set(s),D}function bitFloor(s){var a=s|0;return s>0||s===a?a:a-1}function coeffToString(s){for(var a,u,l=1,f=s.length,c=s[0]+"";l<f;){for(a=s[l++]+"",u=LOG_BASE-a.length;u--;a="0"+a);c+=a}for(f=c.length;c.charCodeAt(--f)===48;);return c.slice(0,f+1||1)}function compare(s,a){var u,l,f=s.c,c=a.c,h=s.s,p=a.s,v=s.e,y=a.e;if(!h||!p)return null;if(u=f&&!f[0],l=c&&!c[0],u||l)return u?l?0:-p:h;if(h!=p)return h;if(u=h<0,l=v==y,!f||!c)return l?0:!f^u?1:-1;if(!l)return v>y^u?1:-1;for(p=(v=f.length)<(y=c.length)?v:y,h=0;h<p;h++)if(f[h]!=c[h])return f[h]>c[h]^u?1:-1;return v==y?0:v>y^u?1:-1}function intCheck(s,a,u,l){if(s<a||s>u||s!==mathfloor(s))throw Error(bignumberError+(l||"Argument")+(typeof s=="number"?s<a||s>u?" out of range: ":" not an integer: ":" not a primitive number: ")+String(s))}function isOdd(s){var a=s.c.length-1;return bitFloor(s.e/LOG_BASE)==a&&s.c[a]%2!=0}function toExponential(s,a){return(s.length>1?s.charAt(0)+"."+s.slice(1):s)+(a<0?"e":"e+")+a}function toFixedPoint(s,a,u){var l,f;if(a<0){for(f=u+".";++a;f+=u);s=f+s}else if(l=s.length,++a>l){for(f=u,a-=l;--a;f+=u);s+=f}else a<l&&(s=s.slice(0,a)+"."+s.slice(a));return s}var BigNumber=clone(),ellipticExports=requireElliptic();const elliptic=getDefaultExportFromCjs(ellipticExports);var typedarrayToBuffer,hasRequiredTypedarrayToBuffer;function requireTypedarrayToBuffer(){return hasRequiredTypedarrayToBuffer||(hasRequiredTypedarrayToBuffer=1,typedarrayToBuffer=function(a){return ArrayBuffer.isView(a)?distExports.Buffer.from(a.buffer,a.byteOffset,a.byteLength):distExports.Buffer.from(a)}),typedarrayToBuffer}var typedarrayToBufferExports=requireTypedarrayToBuffer();const toBuffer=getDefaultExportFromCjs(typedarrayToBufferExports);var Prefix;(function(s){s.TZ1="tz1",s.TZ2="tz2",s.TZ3="tz3",s.TZ4="tz4",s.KT="KT",s.KT1="KT1",s.EDSK2="edsk2",s.SPSK="spsk",s.P2SK="p2sk",s.EDPK="edpk",s.SPPK="sppk",s.P2PK="p2pk",s.BLPK="BLpk",s.EDESK="edesk",s.SPESK="spesk",s.P2ESK="p2esk",s.EDSK="edsk",s.EDSIG="edsig",s.SPSIG="spsig",s.P2SIG="p2sig",s.SIG="sig",s.NET="Net",s.NCE="nce",s.B="B",s.O="o",s.LO="Lo",s.LLO="LLo",s.P="P",s.CO="Co",s.ID="id",s.EXPR="expr",s.TZ="TZ",s.VH="vh",s.SASK="sask",s.ZET1="zet1",s.SR1="sr1",s.SRC1="src1",s.SH="sh"})(Prefix||(Prefix={}));const prefix={[Prefix.TZ1]:new Uint8Array([6,161,159]),[Prefix.TZ2]:new Uint8Array([6,161,161]),[Prefix.TZ3]:new Uint8Array([6,161,164]),[Prefix.TZ4]:new Uint8Array([6,161,166]),[Prefix.KT]:new Uint8Array([2,90,121]),[Prefix.KT1]:new Uint8Array([2,90,121]),[Prefix.EDSK]:new Uint8Array([43,246,78,7]),[Prefix.EDSK2]:new Uint8Array([13,15,58,7]),[Prefix.SPSK]:new Uint8Array([17,162,224,201]),[Prefix.P2SK]:new Uint8Array([16,81,238,189]),[Prefix.EDPK]:new Uint8Array([13,15,37,217]),[Prefix.SPPK]:new Uint8Array([3,254,226,86]),[Prefix.P2PK]:new Uint8Array([3,178,139,127]),[Prefix.BLPK]:new Uint8Array([6,149,135,204]),[Prefix.EDESK]:new Uint8Array([7,90,60,179,41]),[Prefix.SPESK]:new Uint8Array([9,237,241,174,150]),[Prefix.P2ESK]:new Uint8Array([9,48,57,115,171]),[Prefix.EDSIG]:new Uint8Array([9,245,205,134,18]),[Prefix.SPSIG]:new Uint8Array([13,115,101,19,63]),[Prefix.P2SIG]:new Uint8Array([54,240,44,52]),[Prefix.SIG]:new Uint8Array([4,130,43]),[Prefix.NET]:new Uint8Array([87,82,0]),[Prefix.NCE]:new Uint8Array([69,220,169]),[Prefix.B]:new Uint8Array([1,52]),[Prefix.O]:new Uint8Array([5,116]),[Prefix.LO]:new Uint8Array([133,233]),[Prefix.LLO]:new Uint8Array([29,159,109]),[Prefix.P]:new Uint8Array([2,170]),[Prefix.CO]:new Uint8Array([79,179]),[Prefix.ID]:new Uint8Array([153,103]),[Prefix.EXPR]:new Uint8Array([13,44,64,27]),[Prefix.TZ]:new Uint8Array([2,90,121]),[Prefix.VH]:new Uint8Array([1,106,242]),[Prefix.SASK]:new Uint8Array([11,237,20,92]),[Prefix.ZET1]:new Uint8Array([18,71,40,223]),[Prefix.SR1]:new Uint8Array([6,124,117]),[Prefix.SRC1]:new Uint8Array([17,165,134,138]),[Prefix.SH]:new Uint8Array([2,116,180])},prefixLength={[Prefix.TZ1]:20,[Prefix.TZ2]:20,[Prefix.TZ3]:20,[Prefix.TZ4]:20,[Prefix.KT]:20,[Prefix.KT1]:20,[Prefix.EDPK]:32,[Prefix.SPPK]:33,[Prefix.P2PK]:33,[Prefix.BLPK]:48,[Prefix.EDSIG]:64,[Prefix.SPSIG]:64,[Prefix.P2SIG]:64,[Prefix.SIG]:64,[Prefix.NET]:4,[Prefix.B]:32,[Prefix.P]:32,[Prefix.O]:32,[Prefix.VH]:32,[Prefix.SASK]:169,[Prefix.ZET1]:43,[Prefix.SR1]:20,[Prefix.SRC1]:32,[Prefix.SH]:48};class ValueConversionError extends UnsupportedActionError{constructor(a,u){super(),this.value=a,this.desiredType=u,this.name="ValueConversionError",this.message=`Unable to convert ${a} to a ${u}`}}var ValidationResult;(function(s){s[s.NO_PREFIX_MATCHED=0]="NO_PREFIX_MATCHED",s[s.INVALID_CHECKSUM=1]="INVALID_CHECKSUM",s[s.INVALID_LENGTH=2]="INVALID_LENGTH",s[s.VALID=3]="VALID"})(ValidationResult||(ValidationResult={}));function isValidPrefix(s){return typeof s!="string"?!1:s in prefix}function validatePrefixedValue(s,a){const u=new RegExp(`^(${a.join("|")})`).exec(s);if(!u||u.length===0)return ValidationResult.NO_PREFIX_MATCHED;const l=u[0];if(!isValidPrefix(l))return ValidationResult.NO_PREFIX_MATCHED;if(s.includes("%")&&(s=s.split("%")[0]),!/^(KT1\w{33})$/.test(s)&&l==="KT1")return ValidationResult.INVALID_CHECKSUM;let c=bs58check$1.decodeUnsafe(s);return c?(c=c.slice(prefix[l].length),c.length!==prefixLength[l]?ValidationResult.INVALID_LENGTH:ValidationResult.VALID):ValidationResult.INVALID_CHECKSUM}const implicitPrefix=[Prefix.TZ1,Prefix.TZ2,Prefix.TZ3,Prefix.TZ4],contractPrefix=[Prefix.KT1],signaturePrefix=[Prefix.EDSIG,Prefix.P2SIG,Prefix.SPSIG,Prefix.SIG],pkPrefix=[Prefix.EDPK,Prefix.SPPK,Prefix.P2PK,Prefix.BLPK],operationPrefix=[Prefix.O];Prefix.P;const blockPrefix=[Prefix.B],smartRollupPrefix=[Prefix.SR1];function validateAddress(s){return validatePrefixedValue(s,[...implicitPrefix,...contractPrefix,...smartRollupPrefix])}function validateChain(s){return validatePrefixedValue(s,[Prefix.NET])}function validateContractAddress(s){return validatePrefixedValue(s,contractPrefix)}function validateKeyHash(s){return validatePrefixedValue(s,implicitPrefix)}function validateSignature(s){return validatePrefixedValue(s,signaturePrefix)}function validatePublicKey(s){return validatePrefixedValue(s,pkPrefix)}function validateOperation(s){return validatePrefixedValue(s,operationPrefix)}function validateBlock(s){return validatePrefixedValue(s,blockPrefix)}function invalidDetail(s){switch(s){case ValidationResult.NO_PREFIX_MATCHED:return"with unsupported prefix";case ValidationResult.INVALID_CHECKSUM:return"failed checksum";case ValidationResult.INVALID_LENGTH:return"with incorrect length";default:return""}}const TZ_DECIMALS=6,MTZ_DECIMALS=3;function getDecimal(s){switch(s){case"tz":return TZ_DECIMALS;case"mtz":return MTZ_DECIMALS;case"mutez":default:return 0}}function format(s="mutez",a="mutez",u){const l=new BigNumber(u);return l.isNaN()?u:l.multipliedBy(Math.pow(10,getDecimal(s))).dividedBy(Math.pow(10,getDecimal(a)))}function encodeExpr(s){const a=blake.blake2b(hex2buf(s),void 0,32);return b58cencode(a,prefix.expr)}function b58cencode(s,a){const u=typeof s=="string"?Uint8Array.from(bufferExports.Buffer.from(s,"hex")):s,l=new Uint8Array(a.length+u.length);return l.set(a),l.set(u,a.length),bs58check$1.encode(bufferExports.Buffer.from(l.buffer))}const b58cdecode=(s,a)=>bs58check$1.decode(s).slice(a.length);function b58decode(s){const a=bs58check$1.decode(s),l={[prefix.tz1.toString()]:"0000",[prefix.tz2.toString()]:"0001",[prefix.tz3.toString()]:"0002"}[new Uint8Array(a.slice(0,3)).toString()];if(l){const f=buf2hex(a.slice(3));return l+f}else return"01"+buf2hex(a.slice(3,42))+"00"}function encodeAddress(s){if(s.substring(0,2)==="0x"&&(s=s.slice(2)),s.substring(0,2)==="00"){const a={"0000":prefix.tz1,"0001":prefix.tz2,"0002":prefix.tz3};return b58cencode(s.substring(4),a[s.substring(0,4)])}return b58cencode(s.substring(2,42),prefix.KT)}function encodeKey(s){if(s[0]==="0"){const a={"00":new Uint8Array([13,15,37,217]),"01":new Uint8Array([3,254,226,86]),"02":new Uint8Array([3,178,139,127])};return b58cencode(s.substring(2),a[s.substring(0,2)])}}function encodeKeyHash(s){if(s[0]==="0"){const a={"00":new Uint8Array([6,161,159]),"01":new Uint8Array([6,161,161]),"02":new Uint8Array([6,161,164])};return b58cencode(s.substring(2),a[s.substring(0,2)])}}const hex2buf=s=>{if(s.length%2!==0)throw new InvalidHexStringError(s,": Expecting even number of characters");const a=stripHexPrefix$1(s);if(!a.match(/^([\da-f]{2})*$/gi))throw new InvalidHexStringError(s,": Only characters 0-9, a-f and A-F are expected. Optionally, it can be prefixed with '0x'");const u=new Uint8Array(a.length/2);let l=0;for(let f=0;f<a.length;f+=2){const c=parseInt(a.slice(f,f+2),16);if(Number.isNaN(c))throw new ValueConversionError(s,"Uint8Array");u[l++]=c}return u},mergebuf=(s,a)=>{const u=new Uint8Array(s.length+a.length);return u.set(s),u.set(a,s.length),u},buf2hex=s=>{const a=[];return s.forEach(u=>{const f=`00${u.toString(16)}`.slice(-2);a.push(f)}),a.join("")};function bytesToString(s){return bufferExports.Buffer.from(hex2buf(s)).toString("utf8")}function stripHexPrefix$1(s){return s.startsWith("0x")?s.slice(2):s}var browserExports=requireBrowser$7();const pbkdf2$1=getDefaultExportFromCjs(browserExports);var src$1={},sha512$1={},_u64={},hasRequired_u64;function require_u64(){if(hasRequired_u64)return _u64;hasRequired_u64=1,Object.defineProperty(_u64,"__esModule",{value:!0}),_u64.add5L=_u64.add5H=_u64.add4H=_u64.add4L=_u64.add3H=_u64.add3L=_u64.add=_u64.rotlBL=_u64.rotlBH=_u64.rotlSL=_u64.rotlSH=_u64.rotr32L=_u64.rotr32H=_u64.rotrBL=_u64.rotrBH=_u64.rotrSL=_u64.rotrSH=_u64.shrSL=_u64.shrSH=_u64.toBig=_u64.split=_u64.fromBig=void 0;const s=BigInt(2**32-1),a=BigInt(32);function u(Q,ee=!1){return ee?{h:Number(Q&s),l:Number(Q>>a&s)}:{h:Number(Q>>a&s)|0,l:Number(Q&s)|0}}_u64.fromBig=u;function l(Q,ee=!1){let k=new Uint32Array(Q.length),d=new Uint32Array(Q.length);for(let g=0;g<Q.length;g++){const{h:_,l:w}=u(Q[g],ee);[k[g],d[g]]=[_,w]}return[k,d]}_u64.split=l;const f=(Q,ee)=>BigInt(Q>>>0)<<a|BigInt(ee>>>0);_u64.toBig=f;const c=(Q,ee,k)=>Q>>>k;_u64.shrSH=c;const h=(Q,ee,k)=>Q<<32-k|ee>>>k;_u64.shrSL=h;const p=(Q,ee,k)=>Q>>>k|ee<<32-k;_u64.rotrSH=p;const v=(Q,ee,k)=>Q<<32-k|ee>>>k;_u64.rotrSL=v;const y=(Q,ee,k)=>Q<<64-k|ee>>>k-32;_u64.rotrBH=y;const b=(Q,ee,k)=>Q>>>k-32|ee<<64-k;_u64.rotrBL=b;const S=(Q,ee)=>ee;_u64.rotr32H=S;const E=(Q,ee)=>Q;_u64.rotr32L=E;const R=(Q,ee,k)=>Q<<k|ee>>>32-k;_u64.rotlSH=R;const O=(Q,ee,k)=>ee<<k|Q>>>32-k;_u64.rotlSL=O;const I=(Q,ee,k)=>ee<<k-32|Q>>>64-k;_u64.rotlBH=I;const B=(Q,ee,k)=>Q<<k-32|ee>>>64-k;_u64.rotlBL=B;function N(Q,ee,k,d){const g=(ee>>>0)+(d>>>0);return{h:Q+k+(g/2**32|0)|0,l:g|0}}_u64.add=N;const D=(Q,ee,k)=>(Q>>>0)+(ee>>>0)+(k>>>0);_u64.add3L=D;const G=(Q,ee,k,d)=>ee+k+d+(Q/2**32|0)|0;_u64.add3H=G;const V=(Q,ee,k,d)=>(Q>>>0)+(ee>>>0)+(k>>>0)+(d>>>0);_u64.add4L=V;const U=(Q,ee,k,d,g)=>ee+k+d+g+(Q/2**32|0)|0;_u64.add4H=U;const te=(Q,ee,k,d,g)=>(Q>>>0)+(ee>>>0)+(k>>>0)+(d>>>0)+(g>>>0);_u64.add5L=te;const Z=(Q,ee,k,d,g,_)=>ee+k+d+g+_+(Q/2**32|0)|0;_u64.add5H=Z;const J={fromBig:u,split:l,toBig:f,shrSH:c,shrSL:h,rotrSH:p,rotrSL:v,rotrBH:y,rotrBL:b,rotr32H:S,rotr32L:E,rotlSH:R,rotlSL:O,rotlBH:I,rotlBL:B,add:N,add3L:D,add3H:G,add4L:V,add4H:U,add5H:Z,add5L:te};return _u64.default=J,_u64}var hasRequiredSha512;function requireSha512(){if(hasRequiredSha512)return sha512$1;hasRequiredSha512=1,Object.defineProperty(sha512$1,"__esModule",{value:!0}),sha512$1.sha384=sha512$1.sha512_256=sha512$1.sha512_224=sha512$1.sha512=sha512$1.SHA512=void 0;const s=require_md(),a=require_u64(),u=requireUtils(),[l,f]=a.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(S=>BigInt(S))),c=new Uint32Array(80),h=new Uint32Array(80);class p extends s.HashMD{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:E,Al:R,Bh:O,Bl:I,Ch:B,Cl:N,Dh:D,Dl:G,Eh:V,El:U,Fh:te,Fl:Z,Gh:J,Gl:Q,Hh:ee,Hl:k}=this;return[E,R,O,I,B,N,D,G,V,U,te,Z,J,Q,ee,k]}set(E,R,O,I,B,N,D,G,V,U,te,Z,J,Q,ee,k){this.Ah=E|0,this.Al=R|0,this.Bh=O|0,this.Bl=I|0,this.Ch=B|0,this.Cl=N|0,this.Dh=D|0,this.Dl=G|0,this.Eh=V|0,this.El=U|0,this.Fh=te|0,this.Fl=Z|0,this.Gh=J|0,this.Gl=Q|0,this.Hh=ee|0,this.Hl=k|0}process(E,R){for(let _=0;_<16;_++,R+=4)c[_]=E.getUint32(R),h[_]=E.getUint32(R+=4);for(let _=16;_<80;_++){const w=c[_-15]|0,x=h[_-15]|0,P=a.default.rotrSH(w,x,1)^a.default.rotrSH(w,x,8)^a.default.shrSH(w,x,7),$=a.default.rotrSL(w,x,1)^a.default.rotrSL(w,x,8)^a.default.shrSL(w,x,7),T=c[_-2]|0,m=h[_-2]|0,M=a.default.rotrSH(T,m,19)^a.default.rotrBH(T,m,61)^a.default.shrSH(T,m,6),W=a.default.rotrSL(T,m,19)^a.default.rotrBL(T,m,61)^a.default.shrSL(T,m,6),Y=a.default.add4L($,W,h[_-7],h[_-16]),ue=a.default.add4H(Y,P,M,c[_-7],c[_-16]);c[_]=ue|0,h[_]=Y|0}let{Ah:O,Al:I,Bh:B,Bl:N,Ch:D,Cl:G,Dh:V,Dl:U,Eh:te,El:Z,Fh:J,Fl:Q,Gh:ee,Gl:k,Hh:d,Hl:g}=this;for(let _=0;_<80;_++){const w=a.default.rotrSH(te,Z,14)^a.default.rotrSH(te,Z,18)^a.default.rotrBH(te,Z,41),x=a.default.rotrSL(te,Z,14)^a.default.rotrSL(te,Z,18)^a.default.rotrBL(te,Z,41),P=te&J^~te&ee,$=Z&Q^~Z&k,T=a.default.add5L(g,x,$,f[_],h[_]),m=a.default.add5H(T,d,w,P,l[_],c[_]),M=T|0,W=a.default.rotrSH(O,I,28)^a.default.rotrBH(O,I,34)^a.default.rotrBH(O,I,39),Y=a.default.rotrSL(O,I,28)^a.default.rotrBL(O,I,34)^a.default.rotrBL(O,I,39),ue=O&B^O&D^B&D,ge=I&N^I&G^N&G;d=ee|0,g=k|0,ee=J|0,k=Q|0,J=te|0,Q=Z|0,{h:te,l:Z}=a.default.add(V|0,U|0,m|0,M|0),V=D|0,U=G|0,D=B|0,G=N|0,B=O|0,N=I|0;const he=a.default.add3L(M,Y,ge);O=a.default.add3H(he,m,W,ue),I=he|0}({h:O,l:I}=a.default.add(this.Ah|0,this.Al|0,O|0,I|0)),{h:B,l:N}=a.default.add(this.Bh|0,this.Bl|0,B|0,N|0),{h:D,l:G}=a.default.add(this.Ch|0,this.Cl|0,D|0,G|0),{h:V,l:U}=a.default.add(this.Dh|0,this.Dl|0,V|0,U|0),{h:te,l:Z}=a.default.add(this.Eh|0,this.El|0,te|0,Z|0),{h:J,l:Q}=a.default.add(this.Fh|0,this.Fl|0,J|0,Q|0),{h:ee,l:k}=a.default.add(this.Gh|0,this.Gl|0,ee|0,k|0),{h:d,l:g}=a.default.add(this.Hh|0,this.Hl|0,d|0,g|0),this.set(O,I,B,N,D,G,V,U,te,Z,J,Q,ee,k,d,g)}roundClean(){c.fill(0),h.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}sha512$1.SHA512=p;class v extends p{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}class y extends p{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class b extends p{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}return sha512$1.sha512=(0,u.wrapConstructor)(()=>new p),sha512$1.sha512_224=(0,u.wrapConstructor)(()=>new v),sha512$1.sha512_256=(0,u.wrapConstructor)(()=>new y),sha512$1.sha384=(0,u.wrapConstructor)(()=>new b),sha512$1}var pbkdf2={},hmac$1={},hasRequiredHmac$1;function requireHmac$1(){return hasRequiredHmac$1||(hasRequiredHmac$1=1,function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.hmac=s.HMAC=void 0;const a=require_assert(),u=requireUtils();class l extends u.Hash{constructor(h,p){super(),this.finished=!1,this.destroyed=!1,(0,a.hash)(h);const v=(0,u.toBytes)(p);if(this.iHash=h.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 y=this.blockLen,b=new Uint8Array(y);b.set(v.length>y?h.create().update(v).digest():v);for(let S=0;S<b.length;S++)b[S]^=54;this.iHash.update(b),this.oHash=h.create();for(let S=0;S<b.length;S++)b[S]^=106;this.oHash.update(b),b.fill(0)}update(h){return(0,a.exists)(this),this.iHash.update(h),this}digestInto(h){(0,a.exists)(this),(0,a.bytes)(h,this.outputLen),this.finished=!0,this.iHash.digestInto(h),this.oHash.update(h),this.oHash.digestInto(h),this.destroy()}digest(){const h=new Uint8Array(this.oHash.outputLen);return this.digestInto(h),h}_cloneInto(h){h||(h=Object.create(Object.getPrototypeOf(this),{}));const{oHash:p,iHash:v,finished:y,destroyed:b,blockLen:S,outputLen:E}=this;return h=h,h.finished=y,h.destroyed=b,h.blockLen=S,h.outputLen=E,h.oHash=p._cloneInto(h.oHash),h.iHash=v._cloneInto(h.iHash),h}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}s.HMAC=l;const f=(c,h,p)=>new l(c,h).update(p).digest();s.hmac=f,s.hmac.create=(c,h)=>new l(c,h)}(hmac$1)),hmac$1}var hasRequiredPbkdf2;function requirePbkdf2(){if(hasRequiredPbkdf2)return pbkdf2;hasRequiredPbkdf2=1,Object.defineProperty(pbkdf2,"__esModule",{value:!0}),pbkdf2.pbkdf2Async=pbkdf2.pbkdf2=void 0;const s=require_assert(),a=requireHmac$1(),u=requireUtils();function l(p,v,y,b){(0,s.hash)(p);const S=(0,u.checkOpts)({dkLen:32,asyncTick:10},b),{c:E,dkLen:R,asyncTick:O}=S;if((0,s.number)(E),(0,s.number)(R),(0,s.number)(O),E<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const I=(0,u.toBytes)(v),B=(0,u.toBytes)(y),N=new Uint8Array(R),D=a.hmac.create(p,I),G=D._cloneInto().update(B);return{c:E,dkLen:R,asyncTick:O,DK:N,PRF:D,PRFSalt:G}}function f(p,v,y,b,S){return p.destroy(),v.destroy(),b&&b.destroy(),S.fill(0),y}function c(p,v,y,b){const{c:S,dkLen:E,DK:R,PRF:O,PRFSalt:I}=l(p,v,y,b);let B;const N=new Uint8Array(4),D=(0,u.createView)(N),G=new Uint8Array(O.outputLen);for(let V=1,U=0;U<E;V++,U+=O.outputLen){const te=R.subarray(U,U+O.outputLen);D.setInt32(0,V,!1),(B=I._cloneInto(B)).update(N).digestInto(G),te.set(G.subarray(0,te.length));for(let Z=1;Z<S;Z++){O._cloneInto(B).update(G).digestInto(G);for(let J=0;J<te.length;J++)te[J]^=G[J]}}return f(O,I,R,B,G)}pbkdf2.pbkdf2=c;async function h(p,v,y,b){const{c:S,dkLen:E,asyncTick:R,DK:O,PRF:I,PRFSalt:B}=l(p,v,y,b);let N;const D=new Uint8Array(4),G=(0,u.createView)(D),V=new Uint8Array(I.outputLen);for(let U=1,te=0;te<E;U++,te+=I.outputLen){const Z=O.subarray(te,te+I.outputLen);G.setInt32(0,U,!1),(N=B._cloneInto(N)).update(D).digestInto(V),Z.set(V.subarray(0,Z.length)),await(0,u.asyncLoop)(S-1,R,()=>{I._cloneInto(N).update(V).digestInto(V);for(let J=0;J<Z.length;J++)Z[J]^=V[J]})}return f(I,B,O,N,V)}return pbkdf2.pbkdf2Async=h,pbkdf2}var _wordlists={};const require$$0$1=JSON.parse('["abdikace","abeceda","adresa","agrese","akce","aktovka","alej","alkohol","amputace","ananas","andulka","anekdota","anketa","antika","anulovat","archa","arogance","asfalt","asistent","aspirace","astma","astronom","atlas","atletika","atol","autobus","azyl","babka","bachor","bacil","baculka","badatel","bageta","bagr","bahno","bakterie","balada","baletka","balkon","balonek","balvan","balza","bambus","bankomat","barbar","baret","barman","baroko","barva","baterka","batoh","bavlna","bazalka","bazilika","bazuka","bedna","beran","beseda","bestie","beton","bezinka","bezmoc","beztak","bicykl","bidlo","biftek","bikiny","bilance","biograf","biolog","bitva","bizon","blahobyt","blatouch","blecha","bledule","blesk","blikat","blizna","blokovat","bloudit","blud","bobek","bobr","bodlina","bodnout","bohatost","bojkot","bojovat","bokorys","bolest","borec","borovice","bota","boubel","bouchat","bouda","boule","bourat","boxer","bradavka","brambora","branka","bratr","brepta","briketa","brko","brloh","bronz","broskev","brunetka","brusinka","brzda","brzy","bublina","bubnovat","buchta","buditel","budka","budova","bufet","bujarost","bukvice","buldok","bulva","bunda","bunkr","burza","butik","buvol","buzola","bydlet","bylina","bytovka","bzukot","capart","carevna","cedr","cedule","cejch","cejn","cela","celer","celkem","celnice","cenina","cennost","cenovka","centrum","cenzor","cestopis","cetka","chalupa","chapadlo","charita","chata","chechtat","chemie","chichot","chirurg","chlad","chleba","chlubit","chmel","chmura","chobot","chochol","chodba","cholera","chomout","chopit","choroba","chov","chrapot","chrlit","chrt","chrup","chtivost","chudina","chutnat","chvat","chvilka","chvost","chyba","chystat","chytit","cibule","cigareta","cihelna","cihla","cinkot","cirkus","cisterna","citace","citrus","cizinec","cizost","clona","cokoliv","couvat","ctitel","ctnost","cudnost","cuketa","cukr","cupot","cvaknout","cval","cvik","cvrkot","cyklista","daleko","dareba","datel","datum","dcera","debata","dechovka","decibel","deficit","deflace","dekl","dekret","demokrat","deprese","derby","deska","detektiv","dikobraz","diktovat","dioda","diplom","disk","displej","divadlo","divoch","dlaha","dlouho","dluhopis","dnes","dobro","dobytek","docent","dochutit","dodnes","dohled","dohoda","dohra","dojem","dojnice","doklad","dokola","doktor","dokument","dolar","doleva","dolina","doma","dominant","domluvit","domov","donutit","dopad","dopis","doplnit","doposud","doprovod","dopustit","dorazit","dorost","dort","dosah","doslov","dostatek","dosud","dosyta","dotaz","dotek","dotknout","doufat","doutnat","dovozce","dozadu","doznat","dozorce","drahota","drak","dramatik","dravec","draze","drdol","drobnost","drogerie","drozd","drsnost","drtit","drzost","duben","duchovno","dudek","duha","duhovka","dusit","dusno","dutost","dvojice","dvorec","dynamit","ekolog","ekonomie","elektron","elipsa","email","emise","emoce","empatie","epizoda","epocha","epopej","epos","esej","esence","eskorta","eskymo","etiketa","euforie","evoluce","exekuce","exkurze","expedice","exploze","export","extrakt","facka","fajfka","fakulta","fanatik","fantazie","farmacie","favorit","fazole","federace","fejeton","fenka","fialka","figurant","filozof","filtr","finance","finta","fixace","fjord","flanel","flirt","flotila","fond","fosfor","fotbal","fotka","foton","frakce","freska","fronta","fukar","funkce","fyzika","galeje","garant","genetika","geolog","gilotina","glazura","glejt","golem","golfista","gotika","graf","gramofon","granule","grep","gril","grog","groteska","guma","hadice","hadr","hala","halenka","hanba","hanopis","harfa","harpuna","havran","hebkost","hejkal","hejno","hejtman","hektar","helma","hematom","herec","herna","heslo","hezky","historik","hladovka","hlasivky","hlava","hledat","hlen","hlodavec","hloh","hloupost","hltat","hlubina","hluchota","hmat","hmota","hmyz","hnis","hnojivo","hnout","hoblina","hoboj","hoch","hodiny","hodlat","hodnota","hodovat","hojnost","hokej","holinka","holka","holub","homole","honitba","honorace","horal","horda","horizont","horko","horlivec","hormon","hornina","horoskop","horstvo","hospoda","hostina","hotovost","houba","houf","houpat","houska","hovor","hradba","hranice","hravost","hrazda","hrbolek","hrdina","hrdlo","hrdost","hrnek","hrobka","hromada","hrot","hrouda","hrozen","hrstka","hrubost","hryzat","hubenost","hubnout","hudba","hukot","humr","husita","hustota","hvozd","hybnost","hydrant","hygiena","hymna","hysterik","idylka","ihned","ikona","iluze","imunita","infekce","inflace","inkaso","inovace","inspekce","internet","invalida","investor","inzerce","ironie","jablko","jachta","jahoda","jakmile","jakost","jalovec","jantar","jarmark","jaro","jasan","jasno","jatka","javor","jazyk","jedinec","jedle","jednatel","jehlan","jekot","jelen","jelito","jemnost","jenom","jepice","jeseter","jevit","jezdec","jezero","jinak","jindy","jinoch","jiskra","jistota","jitrnice","jizva","jmenovat","jogurt","jurta","kabaret","kabel","kabinet","kachna","kadet","kadidlo","kahan","kajak","kajuta","kakao","kaktus","kalamita","kalhoty","kalibr","kalnost","kamera","kamkoliv","kamna","kanibal","kanoe","kantor","kapalina","kapela","kapitola","kapka","kaple","kapota","kapr","kapusta","kapybara","karamel","karotka","karton","kasa","katalog","katedra","kauce","kauza","kavalec","kazajka","kazeta","kazivost","kdekoliv","kdesi","kedluben","kemp","keramika","kino","klacek","kladivo","klam","klapot","klasika","klaun","klec","klenba","klepat","klesnout","klid","klima","klisna","klobouk","klokan","klopa","kloub","klubovna","klusat","kluzkost","kmen","kmitat","kmotr","kniha","knot","koalice","koberec","kobka","kobliha","kobyla","kocour","kohout","kojenec","kokos","koktejl","kolaps","koleda","kolize","kolo","komando","kometa","komik","komnata","komora","kompas","komunita","konat","koncept","kondice","konec","konfese","kongres","konina","konkurs","kontakt","konzerva","kopanec","kopie","kopnout","koprovka","korbel","korektor","kormidlo","koroptev","korpus","koruna","koryto","korzet","kosatec","kostka","kotel","kotleta","kotoul","koukat","koupelna","kousek","kouzlo","kovboj","koza","kozoroh","krabice","krach","krajina","kralovat","krasopis","kravata","kredit","krejcar","kresba","kreveta","kriket","kritik","krize","krkavec","krmelec","krmivo","krocan","krok","kronika","kropit","kroupa","krovka","krtek","kruhadlo","krupice","krutost","krvinka","krychle","krypta","krystal","kryt","kudlanka","kufr","kujnost","kukla","kulajda","kulich","kulka","kulomet","kultura","kuna","kupodivu","kurt","kurzor","kutil","kvalita","kvasinka","kvestor","kynolog","kyselina","kytara","kytice","kytka","kytovec","kyvadlo","labrador","lachtan","ladnost","laik","lakomec","lamela","lampa","lanovka","lasice","laso","lastura","latinka","lavina","lebka","leckdy","leden","lednice","ledovka","ledvina","legenda","legie","legrace","lehce","lehkost","lehnout","lektvar","lenochod","lentilka","lepenka","lepidlo","letadlo","letec","letmo","letokruh","levhart","levitace","levobok","libra","lichotka","lidojed","lidskost","lihovina","lijavec","lilek","limetka","linie","linka","linoleum","listopad","litina","litovat","lobista","lodivod","logika","logoped","lokalita","loket","lomcovat","lopata","lopuch","lord","losos","lotr","loudal","louh","louka","louskat","lovec","lstivost","lucerna","lucifer","lump","lusk","lustrace","lvice","lyra","lyrika","lysina","madam","madlo","magistr","mahagon","majetek","majitel","majorita","makak","makovice","makrela","malba","malina","malovat","malvice","maminka","mandle","manko","marnost","masakr","maskot","masopust","matice","matrika","maturita","mazanec","mazivo","mazlit","mazurka","mdloba","mechanik","meditace","medovina","melasa","meloun","mentolka","metla","metoda","metr","mezera","migrace","mihnout","mihule","mikina","mikrofon","milenec","milimetr","milost","mimika","mincovna","minibar","minomet","minulost","miska","mistr","mixovat","mladost","mlha","mlhovina","mlok","mlsat","mluvit","mnich","mnohem","mobil","mocnost","modelka","modlitba","mohyla","mokro","molekula","momentka","monarcha","monokl","monstrum","montovat","monzun","mosaz","moskyt","most","motivace","motorka","motyka","moucha","moudrost","mozaika","mozek","mozol","mramor","mravenec","mrkev","mrtvola","mrzet","mrzutost","mstitel","mudrc","muflon","mulat","mumie","munice","muset","mutace","muzeum","muzikant","myslivec","mzda","nabourat","nachytat","nadace","nadbytek","nadhoz","nadobro","nadpis","nahlas","nahnat","nahodile","nahradit","naivita","najednou","najisto","najmout","naklonit","nakonec","nakrmit","nalevo","namazat","namluvit","nanometr","naoko","naopak","naostro","napadat","napevno","naplnit","napnout","naposled","naprosto","narodit","naruby","narychlo","nasadit","nasekat","naslepo","nastat","natolik","navenek","navrch","navzdory","nazvat","nebe","nechat","necky","nedaleko","nedbat","neduh","negace","nehet","nehoda","nejen","nejprve","neklid","nelibost","nemilost","nemoc","neochota","neonka","nepokoj","nerost","nerv","nesmysl","nesoulad","netvor","neuron","nevina","nezvykle","nicota","nijak","nikam","nikdy","nikl","nikterak","nitro","nocleh","nohavice","nominace","nora","norek","nositel","nosnost","nouze","noviny","novota","nozdra","nuda","nudle","nuget","nutit","nutnost","nutrie","nymfa","obal","obarvit","obava","obdiv","obec","obehnat","obejmout","obezita","obhajoba","obilnice","objasnit","objekt","obklopit","oblast","oblek","obliba","obloha","obluda","obnos","obohatit","obojek","obout","obrazec","obrna","obruba","obrys","obsah","obsluha","obstarat","obuv","obvaz","obvinit","obvod","obvykle","obyvatel","obzor","ocas","ocel","ocenit","ochladit","ochota","ochrana","ocitnout","odboj","odbyt","odchod","odcizit","odebrat","odeslat","odevzdat","odezva","odhadce","odhodit","odjet","odjinud","odkaz","odkoupit","odliv","odluka","odmlka","odolnost","odpad","odpis","odplout","odpor","odpustit","odpykat","odrazka","odsoudit","odstup","odsun","odtok","odtud","odvaha","odveta","odvolat","odvracet","odznak","ofina","ofsajd","ohlas","ohnisko","ohrada","ohrozit","ohryzek","okap","okenice","oklika","okno","okouzlit","okovy","okrasa","okres","okrsek","okruh","okupant","okurka","okusit","olejnina","olizovat","omak","omeleta","omezit","omladina","omlouvat","omluva","omyl","onehdy","opakovat","opasek","operace","opice","opilost","opisovat","opora","opozice","opravdu","oproti","orbital","orchestr","orgie","orlice","orloj","ortel","osada","oschnout","osika","osivo","oslava","oslepit","oslnit","oslovit","osnova","osoba","osolit","ospalec","osten","ostraha","ostuda","ostych","osvojit","oteplit","otisk","otop","otrhat","otrlost","otrok","otruby","otvor","ovanout","ovar","oves","ovlivnit","ovoce","oxid","ozdoba","pachatel","pacient","padouch","pahorek","pakt","palanda","palec","palivo","paluba","pamflet","pamlsek","panenka","panika","panna","panovat","panstvo","pantofle","paprika","parketa","parodie","parta","paruka","paryba","paseka","pasivita","pastelka","patent","patrona","pavouk","pazneht","pazourek","pecka","pedagog","pejsek","peklo","peloton","penalta","pendrek","penze","periskop","pero","pestrost","petarda","petice","petrolej","pevnina","pexeso","pianista","piha","pijavice","pikle","piknik","pilina","pilnost","pilulka","pinzeta","pipeta","pisatel","pistole","pitevna","pivnice","pivovar","placenta","plakat","plamen","planeta","plastika","platit","plavidlo","plaz","plech","plemeno","plenta","ples","pletivo","plevel","plivat","plnit","plno","plocha","plodina","plomba","plout","pluk","plyn","pobavit","pobyt","pochod","pocit","poctivec","podat","podcenit","podepsat","podhled","podivit","podklad","podmanit","podnik","podoba","podpora","podraz","podstata","podvod","podzim","poezie","pohanka","pohnutka","pohovor","pohroma","pohyb","pointa","pojistka","pojmout","pokazit","pokles","pokoj","pokrok","pokuta","pokyn","poledne","polibek","polknout","poloha","polynom","pomalu","pominout","pomlka","pomoc","pomsta","pomyslet","ponechat","ponorka","ponurost","popadat","popel","popisek","poplach","poprosit","popsat","popud","poradce","porce","porod","porucha","poryv","posadit","posed","posila","poskok","poslanec","posoudit","pospolu","postava","posudek","posyp","potah","potkan","potlesk","potomek","potrava","potupa","potvora","poukaz","pouto","pouzdro","povaha","povidla","povlak","povoz","povrch","povstat","povyk","povzdech","pozdrav","pozemek","poznatek","pozor","pozvat","pracovat","prahory","praktika","prales","praotec","praporek","prase","pravda","princip","prkno","probudit","procento","prodej","profese","prohra","projekt","prolomit","promile","pronikat","propad","prorok","prosba","proton","proutek","provaz","prskavka","prsten","prudkost","prut","prvek","prvohory","psanec","psovod","pstruh","ptactvo","puberta","puch","pudl","pukavec","puklina","pukrle","pult","pumpa","punc","pupen","pusa","pusinka","pustina","putovat","putyka","pyramida","pysk","pytel","racek","rachot","radiace","radnice","radon","raft","ragby","raketa","rakovina","rameno","rampouch","rande","rarach","rarita","rasovna","rastr","ratolest","razance","razidlo","reagovat","reakce","recept","redaktor","referent","reflex","rejnok","reklama","rekord","rekrut","rektor","reputace","revize","revma","revolver","rezerva","riskovat","riziko","robotika","rodokmen","rohovka","rokle","rokoko","romaneto","ropovod","ropucha","rorejs","rosol","rostlina","rotmistr","rotoped","rotunda","roubenka","roucho","roup","roura","rovina","rovnice","rozbor","rozchod","rozdat","rozeznat","rozhodce","rozinka","rozjezd","rozkaz","rozloha","rozmar","rozpad","rozruch","rozsah","roztok","rozum","rozvod","rubrika","ruchadlo","rukavice","rukopis","ryba","rybolov","rychlost","rydlo","rypadlo","rytina","ryzost","sadista","sahat","sako","samec","samizdat","samota","sanitka","sardinka","sasanka","satelit","sazba","sazenice","sbor","schovat","sebranka","secese","sedadlo","sediment","sedlo","sehnat","sejmout","sekera","sekta","sekunda","sekvoje","semeno","seno","servis","sesadit","seshora","seskok","seslat","sestra","sesuv","sesypat","setba","setina","setkat","setnout","setrvat","sever","seznam","shoda","shrnout","sifon","silnice","sirka","sirotek","sirup","situace","skafandr","skalisko","skanzen","skaut","skeptik","skica","skladba","sklenice","sklo","skluz","skoba","skokan","skoro","skripta","skrz","skupina","skvost","skvrna","slabika","sladidlo","slanina","slast","slavnost","sledovat","slepec","sleva","slezina","slib","slina","sliznice","slon","sloupek","slovo","sluch","sluha","slunce","slupka","slza","smaragd","smetana","smilstvo","smlouva","smog","smrad","smrk","smrtka","smutek","smysl","snad","snaha","snob","sobota","socha","sodovka","sokol","sopka","sotva","souboj","soucit","soudce","souhlas","soulad","soumrak","souprava","soused","soutok","souviset","spalovna","spasitel","spis","splav","spodek","spojenec","spolu","sponzor","spornost","spousta","sprcha","spustit","sranda","sraz","srdce","srna","srnec","srovnat","srpen","srst","srub","stanice","starosta","statika","stavba","stehno","stezka","stodola","stolek","stopa","storno","stoupat","strach","stres","strhnout","strom","struna","studna","stupnice","stvol","styk","subjekt","subtropy","suchar","sudost","sukno","sundat","sunout","surikata","surovina","svah","svalstvo","svetr","svatba","svazek","svisle","svitek","svoboda","svodidlo","svorka","svrab","sykavka","sykot","synek","synovec","sypat","sypkost","syrovost","sysel","sytost","tabletka","tabule","tahoun","tajemno","tajfun","tajga","tajit","tajnost","taktika","tamhle","tampon","tancovat","tanec","tanker","tapeta","tavenina","tazatel","technika","tehdy","tekutina","telefon","temnota","tendence","tenista","tenor","teplota","tepna","teprve","terapie","termoska","textil","ticho","tiskopis","titulek","tkadlec","tkanina","tlapka","tleskat","tlukot","tlupa","tmel","toaleta","topinka","topol","torzo","touha","toulec","tradice","traktor","tramp","trasa","traverza","trefit","trest","trezor","trhavina","trhlina","trochu","trojice","troska","trouba","trpce","trpitel","trpkost","trubec","truchlit","truhlice","trus","trvat","tudy","tuhnout","tuhost","tundra","turista","turnaj","tuzemsko","tvaroh","tvorba","tvrdost","tvrz","tygr","tykev","ubohost","uboze","ubrat","ubrousek","ubrus","ubytovna","ucho","uctivost","udivit","uhradit","ujednat","ujistit","ujmout","ukazatel","uklidnit","uklonit","ukotvit","ukrojit","ulice","ulita","ulovit","umyvadlo","unavit","uniforma","uniknout","upadnout","uplatnit","uplynout","upoutat","upravit","uran","urazit","usednout","usilovat","usmrtit","usnadnit","usnout","usoudit","ustlat","ustrnout","utahovat","utkat","utlumit","utonout","utopenec","utrousit","uvalit","uvolnit","uvozovka","uzdravit","uzel","uzenina","uzlina","uznat","vagon","valcha","valoun","vana","vandal","vanilka","varan","varhany","varovat","vcelku","vchod","vdova","vedro","vegetace","vejce","velbloud","veletrh","velitel","velmoc","velryba","venkov","veranda","verze","veselka","veskrze","vesnice","vespodu","vesta","veterina","veverka","vibrace","vichr","videohra","vidina","vidle","vila","vinice","viset","vitalita","vize","vizitka","vjezd","vklad","vkus","vlajka","vlak","vlasec","vlevo","vlhkost","vliv","vlnovka","vloupat","vnucovat","vnuk","voda","vodivost","vodoznak","vodstvo","vojensky","vojna","vojsko","volant","volba","volit","volno","voskovka","vozidlo","vozovna","vpravo","vrabec","vracet","vrah","vrata","vrba","vrcholek","vrhat","vrstva","vrtule","vsadit","vstoupit","vstup","vtip","vybavit","vybrat","vychovat","vydat","vydra","vyfotit","vyhledat","vyhnout","vyhodit","vyhradit","vyhubit","vyjasnit","vyjet","vyjmout","vyklopit","vykonat","vylekat","vymazat","vymezit","vymizet","vymyslet","vynechat","vynikat","vynutit","vypadat","vyplatit","vypravit","vypustit","vyrazit","vyrovnat","vyrvat","vyslovit","vysoko","vystavit","vysunout","vysypat","vytasit","vytesat","vytratit","vyvinout","vyvolat","vyvrhel","vyzdobit","vyznat","vzadu","vzbudit","vzchopit","vzdor","vzduch","vzdychat","vzestup","vzhledem","vzkaz","vzlykat","vznik","vzorek","vzpoura","vztah","vztek","xylofon","zabrat","zabydlet","zachovat","zadarmo","zadusit","zafoukat","zahltit","zahodit","zahrada","zahynout","zajatec","zajet","zajistit","zaklepat","zakoupit","zalepit","zamezit","zamotat","zamyslet","zanechat","zanikat","zaplatit","zapojit","zapsat","zarazit","zastavit","zasunout","zatajit","zatemnit","zatknout","zaujmout","zavalit","zavelet","zavinit","zavolat","zavrtat","zazvonit","zbavit","zbrusu","zbudovat","zbytek","zdaleka","zdarma","zdatnost","zdivo","zdobit","zdroj","zdvih","zdymadlo","zelenina","zeman","zemina","zeptat","zezadu","zezdola","zhatit","zhltnout","zhluboka","zhotovit","zhruba","zima","zimnice","zjemnit","zklamat","zkoumat","zkratka","zkumavka","zlato","zlehka","zloba","zlom","zlost","zlozvyk","zmapovat","zmar","zmatek","zmije","zmizet","zmocnit","zmodrat","zmrzlina","zmutovat","znak","znalost","znamenat","znovu","zobrazit","zotavit","zoubek","zoufale","zplodit","zpomalit","zprava","zprostit","zprudka","zprvu","zrada","zranit","zrcadlo","zrnitost","zrno","zrovna","zrychlit","zrzavost","zticha","ztratit","zubovina","zubr","zvednout","zvenku","zvesela","zvon","zvrat","zvukovod","zvyk"]'),require$$1=JSON.parse('["的","一","是","在","不","了","有","和","人","这","中","大","为","上","个","国","我","以","要","他","时","来","用","们","生","到","作","地","于","出","就","分","对","成","会","可","主","发","年","动","同","工","也","能","下","过","子","说","产","种","面","而","方","后","多","定","行","学","法","所","民","得","经","十","三","之","进","着","等","部","度","家","电","力","里","如","水","化","高","自","二","理","起","小","物","现","实","加","量","都","两","体","制","机","当","使","点","从","业","本","去","把","性","好","应","开","它","合","还","因","由","其","些","然","前","外","天","政","四","日","那","社","义","事","平","形","相","全","表","间","样","与","关","各","重","新","线","内","数","正","心","反","你","明","看","原","又","么","利","比","或","但","质","气","第","向","道","命","此","变","条","只","没","结","解","问","意","建","月","公","无","系","军","很","情","者","最","立","代","想","已","通","并","提","直","题","党","程","展","五","果","料","象","员","革","位","入","常","文","总","次","品","式","活","设","及","管","特","件","长","求","老","头","基","资","边","流","路","级","少","图","山","统","接","知","较","将","组","见","计","别","她","手","角","期","根","论","运","农","指","几","九","区","强","放","决","西","被","干","做","必","战","先","回","则","任","取","据","处","队","南","给","色","光","门","即","保","治","北","造","百","规","热","领","七","海","口","东","导","器","压","志","世","金","增","争","济","阶","油","思","术","极","交","受","联","什","认","六","共","权","收","证","改","清","美","再","采","转","更","单","风","切","打","白","教","速","花","带","安","场","身","车","例","真","务","具","万","每","目","至","达","走","积","示","议","声","报","斗","完","类","八","离","华","名","确","才","科","张","信","马","节","话","米","整","空","元","况","今","集","温","传","土","许","步","群","广","石","记","需","段","研","界","拉","林","律","叫","且","究","观","越","织","装","影","算","低","持","音","众","书","布","复","容","儿","须","际","商","非","验","连","断","深","难","近","矿","千","周","委","素","技","备","半","办","青","省","列","习","响","约","支","般","史","感","劳","便","团","往","酸","历","市","克","何","除","消","构","府","称","太","准","精","值","号","率","族","维","划","选","标","写","存","候","毛","亲","快","效","斯","院","查","江","型","眼","王","按","格","养","易","置","派","层","片","始","却","专","状","育","厂","京","识","适","属","圆","包","火","住","调","满","县","局","照","参","红","细","引","听","该","铁","价","严","首","底","液","官","德","随","病","苏","失","尔","死","讲","配","女","黄","推","显","谈","罪","神","艺","呢","席","含","企","望","密","批","营","项","防","举","球","英","氧","势","告","李","台","落","木","帮","轮","破","亚","师","围","注","远","字","材","排","供","河","态","封","另","施","减","树","溶","怎","止","案","言","士","均","武","固","叶","鱼","波","视","仅","费","紧","爱","左","章","早","朝","害","续","轻","服","试","食","充","兵","源","判","护","司","足","某","练","差","致","板","田","降","黑","犯","负","击","范","继","兴","似","余","坚","曲","输","修","故","城","夫","够","送","笔","船","占","右","财","吃","富","春","职","觉","汉","画","功","巴","跟","虽","杂","飞","检","吸","助","升","阳","互","初","创","抗","考","投","坏","策","古","径","换","未","跑","留","钢","曾","端","责","站","简","述","钱","副","尽","帝","射","草","冲","承","独","令","限","阿","宣","环","双","请","超","微","让","控","州","良","轴","找","否","纪","益","依","优","顶","础","载","倒","房","突","坐","粉","敌","略","客","袁","冷","胜","绝","析","块","剂","测","丝","协","诉","念","陈","仍","罗","盐","友","洋","错","苦","夜","刑","移","频","逐","靠","混","母","短","皮","终","聚","汽","村","云","哪","既","距","卫","停","烈","央","察","烧","迅","境","若","印","洲","刻","括","激","孔","搞","甚","室","待","核","校","散","侵","吧","甲","游","久","菜","味","旧","模","湖","货","损","预","阻","毫","普","稳","乙","妈","植","息","扩","银","语","挥","酒","守","拿","序","纸","医","缺","雨","吗","针","刘","啊","急","唱","误","训","愿","审","附","获","茶","鲜","粮","斤","孩","脱","硫","肥","善","龙","演","父","渐","血","欢","械","掌","歌","沙","刚","攻","谓","盾","讨","晚","粒","乱","燃","矛","乎","杀","药","宁","鲁","贵","钟","煤","读","班","伯","香","介","迫","句","丰","培","握","兰","担","弦","蛋","沉","假","穿","执","答","乐","谁","顺","烟","缩","征","脸","喜","松","脚","困","异","免","背","星","福","买","染","井","概","慢","怕","磁","倍","祖","皇","促","静","补","评","翻","肉","践","尼","衣","宽","扬","棉","希","伤","操","垂","秋","宜","氢","套","督","振","架","亮","末","宪","庆","编","牛","触","映","雷","销","诗","座","居","抓","裂","胞","呼","娘","景","威","绿","晶","厚","盟","衡","鸡","孙","延","危","胶","屋","乡","临","陆","顾","掉","呀","灯","岁","措","束","耐","剧","玉","赵","跳","哥","季","课","凯","胡","额","款","绍","卷","齐","伟","蒸","殖","永","宗","苗","川","炉","岩","弱","零","杨","奏","沿","露","杆","探","滑","镇","饭","浓","航","怀","赶","库","夺","伊","灵","税","途","灭","赛","归","召","鼓","播","盘","裁","险","康","唯","录","菌","纯","借","糖","盖","横","符","私","努","堂","域","枪","润","幅","哈","竟","熟","虫","泽","脑","壤","碳","欧","遍","侧","寨","敢","彻","虑","斜","薄","庭","纳","弹","饲","伸","折","麦","湿","暗","荷","瓦","塞","床","筑","恶","户","访","塔","奇","透","梁","刀","旋","迹","卡","氯","遇","份","毒","泥","退","洗","摆","灰","彩","卖","耗","夏","择","忙","铜","献","硬","予","繁","圈","雪","函","亦","抽","篇","阵","阴","丁","尺","追","堆","雄","迎","泛","爸","楼","避","谋","吨","野","猪","旗","累","偏","典","馆","索","秦","脂","潮","爷","豆","忽","托","惊","塑","遗","愈","朱","替","纤","粗","倾","尚","痛","楚","谢","奋","购","磨","君","池","旁","碎","骨","监","捕","弟","暴","割","贯","殊","释","词","亡","壁","顿","宝","午","尘","闻","揭","炮","残","冬","桥","妇","警","综","招","吴","付","浮","遭","徐","您","摇","谷","赞","箱","隔","订","男","吹","园","纷","唐","败","宋","玻","巨","耕","坦","荣","闭","湾","键","凡","驻","锅","救","恩","剥","凝","碱","齿","截","炼","麻","纺","禁","废","盛","版","缓","净","睛","昌","婚","涉","筒","嘴","插","岸","朗","庄","街","藏","姑","贸","腐","奴","啦","惯","乘","伙","恢","匀","纱","扎","辩","耳","彪","臣","亿","璃","抵","脉","秀","萨","俄","网","舞","店","喷","纵","寸","汗","挂","洪","贺","闪","柬","爆","烯","津","稻","墙","软","勇","像","滚","厘","蒙","芳","肯","坡","柱","荡","腿","仪","旅","尾","轧","冰","贡","登","黎","削","钻","勒","逃","障","氨","郭","峰","币","港","伏","轨","亩","毕","擦","莫","刺","浪","秘","援","株","健","售","股","岛","甘","泡","睡","童","铸","汤","阀","休","汇","舍","牧","绕","炸","哲","磷","绩","朋","淡","尖","启","陷","柴","呈","徒","颜","泪","稍","忘","泵","蓝","拖","洞","授","镜","辛","壮","锋","贫","虚","弯","摩","泰","幼","廷","尊","窗","纲","弄","隶","疑","氏","宫","姐","震","瑞","怪","尤","琴","循","描","膜","违","夹","腰","缘","珠","穷","森","枝","竹","沟","催","绳","忆","邦","剩","幸","浆","栏","拥","牙","贮","礼","滤","钠","纹","罢","拍","咱","喊","袖","埃","勤","罚","焦","潜","伍","墨","欲","缝","姓","刊","饱","仿","奖","铝","鬼","丽","跨","默","挖","链","扫","喝","袋","炭","污","幕","诸","弧","励","梅","奶","洁","灾","舟","鉴","苯","讼","抱","毁","懂","寒","智","埔","寄","届","跃","渡","挑","丹","艰","贝","碰","拔","爹","戴","码","梦","芽","熔","赤","渔","哭","敬","颗","奔","铅","仲","虎","稀","妹","乏","珍","申","桌","遵","允","隆","螺","仓","魏","锐","晓","氮","兼","隐","碍","赫","拨","忠","肃","缸","牵","抢","博","巧","壳","兄","杜","讯","诚","碧","祥","柯","页","巡","矩","悲","灌","龄","伦","票","寻","桂","铺","圣","恐","恰","郑","趣","抬","荒","腾","贴","柔","滴","猛","阔","辆","妻","填","撤","储","签","闹","扰","紫","砂","递","戏","吊","陶","伐","喂","疗","瓶","婆","抚","臂","摸","忍","虾","蜡","邻","胸","巩","挤","偶","弃","槽","劲","乳","邓","吉","仁","烂","砖","租","乌","舰","伴","瓜","浅","丙","暂","燥","橡","柳","迷","暖","牌","秧","胆","详","簧","踏","瓷","谱","呆","宾","糊","洛","辉","愤","竞","隙","怒","粘","乃","绪","肩","籍","敏","涂","熙","皆","侦","悬","掘","享","纠","醒","狂","锁","淀","恨","牲","霸","爬","赏","逆","玩","陵","祝","秒","浙","貌","役","彼","悉","鸭","趋","凤","晨","畜","辈","秩","卵","署","梯","炎","滩","棋","驱","筛","峡","冒","啥","寿","译","浸","泉","帽","迟","硅","疆","贷","漏","稿","冠","嫩","胁","芯","牢","叛","蚀","奥","鸣","岭","羊","凭","串","塘","绘","酵","融","盆","锡","庙","筹","冻","辅","摄","袭","筋","拒","僚","旱","钾","鸟","漆","沈","眉","疏","添","棒","穗","硝","韩","逼","扭","侨","凉","挺","碗","栽","炒","杯","患","馏","劝","豪","辽","勃","鸿","旦","吏","拜","狗","埋","辊","掩","饮","搬","骂","辞","勾","扣","估","蒋","绒","雾","丈","朵","姆","拟","宇","辑","陕","雕","偿","蓄","崇","剪","倡","厅","咬","驶","薯","刷","斥","番","赋","奉","佛","浇","漫","曼","扇","钙","桃","扶","仔","返","俗","亏","腔","鞋","棱","覆","框","悄","叔","撞","骗","勘","旺","沸","孤","吐","孟","渠","屈","疾","妙","惜","仰","狠","胀","谐","抛","霉","桑","岗","嘛","衰","盗","渗","脏","赖","涌","甜","曹","阅","肌","哩","厉","烃","纬","毅","昨","伪","症","煮","叹","钉","搭","茎","笼","酷","偷","弓","锥","恒","杰","坑","鼻","翼","纶","叙","狱","逮","罐","络","棚","抑","膨","蔬","寺","骤","穆","冶","枯","册","尸","凸","绅","坯","牺","焰","轰","欣","晋","瘦","御","锭","锦","丧","旬","锻","垄","搜","扑","邀","亭","酯","迈","舒","脆","酶","闲","忧","酚","顽","羽","涨","卸","仗","陪","辟","惩","杭","姚","肚","捉","飘","漂","昆","欺","吾","郎","烷","汁","呵","饰","萧","雅","邮","迁","燕","撒","姻","赴","宴","烦","债","帐","斑","铃","旨","醇","董","饼","雏","姿","拌","傅","腹","妥","揉","贤","拆","歪","葡","胺","丢","浩","徽","昂","垫","挡","览","贪","慰","缴","汪","慌","冯","诺","姜","谊","凶","劣","诬","耀","昏","躺","盈","骑","乔","溪","丛","卢","抹","闷","咨","刮","驾","缆","悟","摘","铒","掷","颇","幻","柄","惠","惨","佳","仇","腊","窝","涤","剑","瞧","堡","泼","葱","罩","霍","捞","胎","苍","滨","俩","捅","湘","砍","霞","邵","萄","疯","淮","遂","熊","粪","烘","宿","档","戈","驳","嫂","裕","徙","箭","捐","肠","撑","晒","辨","殿","莲","摊","搅","酱","屏","疫","哀","蔡","堵","沫","皱","畅","叠","阁","莱","敲","辖","钩","痕","坝","巷","饿","祸","丘","玄","溜","曰","逻","彭","尝","卿","妨","艇","吞","韦","怨","矮","歇"]'),require$$2=JSON.parse('["的","一","是","在","不","了","有","和","人","這","中","大","為","上","個","國","我","以","要","他","時","來","用","們","生","到","作","地","於","出","就","分","對","成","會","可","主","發","年","動","同","工","也","能","下","過","子","說","產","種","面","而","方","後","多","定","行","學","法","所","民","得","經","十","三","之","進","著","等","部","度","家","電","力","裡","如","水","化","高","自","二","理","起","小","物","現","實","加","量","都","兩","體","制","機","當","使","點","從","業","本","去","把","性","好","應","開","它","合","還","因","由","其","些","然","前","外","天","政","四","日","那","社","義","事","平","形","相","全","表","間","樣","與","關","各","重","新","線","內","數","正","心","反","你","明","看","原","又","麼","利","比","或","但","質","氣","第","向","道","命","此","變","條","只","沒","結","解","問","意","建","月","公","無","系","軍","很","情","者","最","立","代","想","已","通","並","提","直","題","黨","程","展","五","果","料","象","員","革","位","入","常","文","總","次","品","式","活","設","及","管","特","件","長","求","老","頭","基","資","邊","流","路","級","少","圖","山","統","接","知","較","將","組","見","計","別","她","手","角","期","根","論","運","農","指","幾","九","區","強","放","決","西","被","幹","做","必","戰","先","回","則","任","取","據","處","隊","南","給","色","光","門","即","保","治","北","造","百","規","熱","領","七","海","口","東","導","器","壓","志","世","金","增","爭","濟","階","油","思","術","極","交","受","聯","什","認","六","共","權","收","證","改","清","美","再","採","轉","更","單","風","切","打","白","教","速","花","帶","安","場","身","車","例","真","務","具","萬","每","目","至","達","走","積","示","議","聲","報","鬥","完","類","八","離","華","名","確","才","科","張","信","馬","節","話","米","整","空","元","況","今","集","溫","傳","土","許","步","群","廣","石","記","需","段","研","界","拉","林","律","叫","且","究","觀","越","織","裝","影","算","低","持","音","眾","書","布","复","容","兒","須","際","商","非","驗","連","斷","深","難","近","礦","千","週","委","素","技","備","半","辦","青","省","列","習","響","約","支","般","史","感","勞","便","團","往","酸","歷","市","克","何","除","消","構","府","稱","太","準","精","值","號","率","族","維","劃","選","標","寫","存","候","毛","親","快","效","斯","院","查","江","型","眼","王","按","格","養","易","置","派","層","片","始","卻","專","狀","育","廠","京","識","適","屬","圓","包","火","住","調","滿","縣","局","照","參","紅","細","引","聽","該","鐵","價","嚴","首","底","液","官","德","隨","病","蘇","失","爾","死","講","配","女","黃","推","顯","談","罪","神","藝","呢","席","含","企","望","密","批","營","項","防","舉","球","英","氧","勢","告","李","台","落","木","幫","輪","破","亞","師","圍","注","遠","字","材","排","供","河","態","封","另","施","減","樹","溶","怎","止","案","言","士","均","武","固","葉","魚","波","視","僅","費","緊","愛","左","章","早","朝","害","續","輕","服","試","食","充","兵","源","判","護","司","足","某","練","差","致","板","田","降","黑","犯","負","擊","范","繼","興","似","餘","堅","曲","輸","修","故","城","夫","夠","送","筆","船","佔","右","財","吃","富","春","職","覺","漢","畫","功","巴","跟","雖","雜","飛","檢","吸","助","昇","陽","互","初","創","抗","考","投","壞","策","古","徑","換","未","跑","留","鋼","曾","端","責","站","簡","述","錢","副","盡","帝","射","草","衝","承","獨","令","限","阿","宣","環","雙","請","超","微","讓","控","州","良","軸","找","否","紀","益","依","優","頂","礎","載","倒","房","突","坐","粉","敵","略","客","袁","冷","勝","絕","析","塊","劑","測","絲","協","訴","念","陳","仍","羅","鹽","友","洋","錯","苦","夜","刑","移","頻","逐","靠","混","母","短","皮","終","聚","汽","村","雲","哪","既","距","衛","停","烈","央","察","燒","迅","境","若","印","洲","刻","括","激","孔","搞","甚","室","待","核","校","散","侵","吧","甲","遊","久","菜","味","舊","模","湖","貨","損","預","阻","毫","普","穩","乙","媽","植","息","擴","銀","語","揮","酒","守","拿","序","紙","醫","缺","雨","嗎","針","劉","啊","急","唱","誤","訓","願","審","附","獲","茶","鮮","糧","斤","孩","脫","硫","肥","善","龍","演","父","漸","血","歡","械","掌","歌","沙","剛","攻","謂","盾","討","晚","粒","亂","燃","矛","乎","殺","藥","寧","魯","貴","鐘","煤","讀","班","伯","香","介","迫","句","豐","培","握","蘭","擔","弦","蛋","沉","假","穿","執","答","樂","誰","順","煙","縮","徵","臉","喜","松","腳","困","異","免","背","星","福","買","染","井","概","慢","怕","磁","倍","祖","皇","促","靜","補","評","翻","肉","踐","尼","衣","寬","揚","棉","希","傷","操","垂","秋","宜","氫","套","督","振","架","亮","末","憲","慶","編","牛","觸","映","雷","銷","詩","座","居","抓","裂","胞","呼","娘","景","威","綠","晶","厚","盟","衡","雞","孫","延","危","膠","屋","鄉","臨","陸","顧","掉","呀","燈","歲","措","束","耐","劇","玉","趙","跳","哥","季","課","凱","胡","額","款","紹","卷","齊","偉","蒸","殖","永","宗","苗","川","爐","岩","弱","零","楊","奏","沿","露","桿","探","滑","鎮","飯","濃","航","懷","趕","庫","奪","伊","靈","稅","途","滅","賽","歸","召","鼓","播","盤","裁","險","康","唯","錄","菌","純","借","糖","蓋","橫","符","私","努","堂","域","槍","潤","幅","哈","竟","熟","蟲","澤","腦","壤","碳","歐","遍","側","寨","敢","徹","慮","斜","薄","庭","納","彈","飼","伸","折","麥","濕","暗","荷","瓦","塞","床","築","惡","戶","訪","塔","奇","透","梁","刀","旋","跡","卡","氯","遇","份","毒","泥","退","洗","擺","灰","彩","賣","耗","夏","擇","忙","銅","獻","硬","予","繁","圈","雪","函","亦","抽","篇","陣","陰","丁","尺","追","堆","雄","迎","泛","爸","樓","避","謀","噸","野","豬","旗","累","偏","典","館","索","秦","脂","潮","爺","豆","忽","托","驚","塑","遺","愈","朱","替","纖","粗","傾","尚","痛","楚","謝","奮","購","磨","君","池","旁","碎","骨","監","捕","弟","暴","割","貫","殊","釋","詞","亡","壁","頓","寶","午","塵","聞","揭","炮","殘","冬","橋","婦","警","綜","招","吳","付","浮","遭","徐","您","搖","谷","贊","箱","隔","訂","男","吹","園","紛","唐","敗","宋","玻","巨","耕","坦","榮","閉","灣","鍵","凡","駐","鍋","救","恩","剝","凝","鹼","齒","截","煉","麻","紡","禁","廢","盛","版","緩","淨","睛","昌","婚","涉","筒","嘴","插","岸","朗","莊","街","藏","姑","貿","腐","奴","啦","慣","乘","夥","恢","勻","紗","扎","辯","耳","彪","臣","億","璃","抵","脈","秀","薩","俄","網","舞","店","噴","縱","寸","汗","掛","洪","賀","閃","柬","爆","烯","津","稻","牆","軟","勇","像","滾","厘","蒙","芳","肯","坡","柱","盪","腿","儀","旅","尾","軋","冰","貢","登","黎","削","鑽","勒","逃","障","氨","郭","峰","幣","港","伏","軌","畝","畢","擦","莫","刺","浪","秘","援","株","健","售","股","島","甘","泡","睡","童","鑄","湯","閥","休","匯","舍","牧","繞","炸","哲","磷","績","朋","淡","尖","啟","陷","柴","呈","徒","顏","淚","稍","忘","泵","藍","拖","洞","授","鏡","辛","壯","鋒","貧","虛","彎","摩","泰","幼","廷","尊","窗","綱","弄","隸","疑","氏","宮","姐","震","瑞","怪","尤","琴","循","描","膜","違","夾","腰","緣","珠","窮","森","枝","竹","溝","催","繩","憶","邦","剩","幸","漿","欄","擁","牙","貯","禮","濾","鈉","紋","罷","拍","咱","喊","袖","埃","勤","罰","焦","潛","伍","墨","欲","縫","姓","刊","飽","仿","獎","鋁","鬼","麗","跨","默","挖","鏈","掃","喝","袋","炭","污","幕","諸","弧","勵","梅","奶","潔","災","舟","鑑","苯","訟","抱","毀","懂","寒","智","埔","寄","屆","躍","渡","挑","丹","艱","貝","碰","拔","爹","戴","碼","夢","芽","熔","赤","漁","哭","敬","顆","奔","鉛","仲","虎","稀","妹","乏","珍","申","桌","遵","允","隆","螺","倉","魏","銳","曉","氮","兼","隱","礙","赫","撥","忠","肅","缸","牽","搶","博","巧","殼","兄","杜","訊","誠","碧","祥","柯","頁","巡","矩","悲","灌","齡","倫","票","尋","桂","鋪","聖","恐","恰","鄭","趣","抬","荒","騰","貼","柔","滴","猛","闊","輛","妻","填","撤","儲","簽","鬧","擾","紫","砂","遞","戲","吊","陶","伐","餵","療","瓶","婆","撫","臂","摸","忍","蝦","蠟","鄰","胸","鞏","擠","偶","棄","槽","勁","乳","鄧","吉","仁","爛","磚","租","烏","艦","伴","瓜","淺","丙","暫","燥","橡","柳","迷","暖","牌","秧","膽","詳","簧","踏","瓷","譜","呆","賓","糊","洛","輝","憤","競","隙","怒","粘","乃","緒","肩","籍","敏","塗","熙","皆","偵","懸","掘","享","糾","醒","狂","鎖","淀","恨","牲","霸","爬","賞","逆","玩","陵","祝","秒","浙","貌","役","彼","悉","鴨","趨","鳳","晨","畜","輩","秩","卵","署","梯","炎","灘","棋","驅","篩","峽","冒","啥","壽","譯","浸","泉","帽","遲","矽","疆","貸","漏","稿","冠","嫩","脅","芯","牢","叛","蝕","奧","鳴","嶺","羊","憑","串","塘","繪","酵","融","盆","錫","廟","籌","凍","輔","攝","襲","筋","拒","僚","旱","鉀","鳥","漆","沈","眉","疏","添","棒","穗","硝","韓","逼","扭","僑","涼","挺","碗","栽","炒","杯","患","餾","勸","豪","遼","勃","鴻","旦","吏","拜","狗","埋","輥","掩","飲","搬","罵","辭","勾","扣","估","蔣","絨","霧","丈","朵","姆","擬","宇","輯","陝","雕","償","蓄","崇","剪","倡","廳","咬","駛","薯","刷","斥","番","賦","奉","佛","澆","漫","曼","扇","鈣","桃","扶","仔","返","俗","虧","腔","鞋","棱","覆","框","悄","叔","撞","騙","勘","旺","沸","孤","吐","孟","渠","屈","疾","妙","惜","仰","狠","脹","諧","拋","黴","桑","崗","嘛","衰","盜","滲","臟","賴","湧","甜","曹","閱","肌","哩","厲","烴","緯","毅","昨","偽","症","煮","嘆","釘","搭","莖","籠","酷","偷","弓","錐","恆","傑","坑","鼻","翼","綸","敘","獄","逮","罐","絡","棚","抑","膨","蔬","寺","驟","穆","冶","枯","冊","屍","凸","紳","坯","犧","焰","轟","欣","晉","瘦","禦","錠","錦","喪","旬","鍛","壟","搜","撲","邀","亭","酯","邁","舒","脆","酶","閒","憂","酚","頑","羽","漲","卸","仗","陪","闢","懲","杭","姚","肚","捉","飄","漂","昆","欺","吾","郎","烷","汁","呵","飾","蕭","雅","郵","遷","燕","撒","姻","赴","宴","煩","債","帳","斑","鈴","旨","醇","董","餅","雛","姿","拌","傅","腹","妥","揉","賢","拆","歪","葡","胺","丟","浩","徽","昂","墊","擋","覽","貪","慰","繳","汪","慌","馮","諾","姜","誼","兇","劣","誣","耀","昏","躺","盈","騎","喬","溪","叢","盧","抹","悶","諮","刮","駕","纜","悟","摘","鉺","擲","頗","幻","柄","惠","慘","佳","仇","臘","窩","滌","劍","瞧","堡","潑","蔥","罩","霍","撈","胎","蒼","濱","倆","捅","湘","砍","霞","邵","萄","瘋","淮","遂","熊","糞","烘","宿","檔","戈","駁","嫂","裕","徙","箭","捐","腸","撐","曬","辨","殿","蓮","攤","攪","醬","屏","疫","哀","蔡","堵","沫","皺","暢","疊","閣","萊","敲","轄","鉤","痕","壩","巷","餓","禍","丘","玄","溜","曰","邏","彭","嘗","卿","妨","艇","吞","韋","怨","矮","歇"]'),require$$3=JSON.parse('["가격","가끔","가난","가능","가득","가르침","가뭄","가방","가상","가슴","가운데","가을","가이드","가입","가장","가정","가족","가죽","각오","각자","간격","간부","간섭","간장","간접","간판","갈등","갈비","갈색","갈증","감각","감기","감소","감수성","감자","감정","갑자기","강남","강당","강도","강력히","강변","강북","강사","강수량","강아지","강원도","강의","강제","강조","같이","개구리","개나리","개방","개별","개선","개성","개인","객관적","거실","거액","거울","거짓","거품","걱정","건강","건물","건설","건조","건축","걸음","검사","검토","게시판","게임","겨울","견해","결과","결국","결론","결석","결승","결심","결정","결혼","경계","경고","경기","경력","경복궁","경비","경상도","경영","경우","경쟁","경제","경주","경찰","경치","경향","경험","계곡","계단","계란","계산","계속","계약","계절","계층","계획","고객","고구려","고궁","고급","고등학생","고무신","고민","고양이","고장","고전","고집","고춧가루","고통","고향","곡식","골목","골짜기","골프","공간","공개","공격","공군","공급","공기","공동","공무원","공부","공사","공식","공업","공연","공원","공장","공짜","공책","공통","공포","공항","공휴일","과목","과일","과장","과정","과학","관객","관계","관광","관념","관람","관련","관리","관습","관심","관점","관찰","광경","광고","광장","광주","괴로움","굉장히","교과서","교문","교복","교실","교양","교육","교장","교직","교통","교환","교훈","구경","구름","구멍","구별","구분","구석","구성","구속","구역","구입","구청","구체적","국가","국기","국내","국립","국물","국민","국수","국어","국왕","국적","국제","국회","군대","군사","군인","궁극적","권리","권위","권투","귀국","귀신","규정","규칙","균형","그날","그냥","그늘","그러나","그룹","그릇","그림","그제서야","그토록","극복","극히","근거","근교","근래","근로","근무","근본","근원","근육","근처","글씨","글자","금강산","금고","금년","금메달","금액","금연","금요일","금지","긍정적","기간","기관","기념","기능","기독교","기둥","기록","기름","기법","기본","기분","기쁨","기숙사","기술","기억","기업","기온","기운","기원","기적","기준","기침","기혼","기획","긴급","긴장","길이","김밥","김치","김포공항","깍두기","깜빡","깨달음","깨소금","껍질","꼭대기","꽃잎","나들이","나란히","나머지","나물","나침반","나흘","낙엽","난방","날개","날씨","날짜","남녀","남대문","남매","남산","남자","남편","남학생","낭비","낱말","내년","내용","내일","냄비","냄새","냇물","냉동","냉면","냉방","냉장고","넥타이","넷째","노동","노란색","노력","노인","녹음","녹차","녹화","논리","논문","논쟁","놀이","농구","농담","농민","농부","농업","농장","농촌","높이","눈동자","눈물","눈썹","뉴욕","느낌","늑대","능동적","능력","다방","다양성","다음","다이어트","다행","단계","단골","단독","단맛","단순","단어","단위","단점","단체","단추","단편","단풍","달걀","달러","달력","달리","닭고기","담당","담배","담요","담임","답변","답장","당근","당분간","당연히","당장","대규모","대낮","대단히","대답","대도시","대략","대량","대륙","대문","대부분","대신","대응","대장","대전","대접","대중","대책","대출","대충","대통령","대학","대한민국","대합실","대형","덩어리","데이트","도대체","도덕","도둑","도망","도서관","도심","도움","도입","도자기","도저히","도전","도중","도착","독감","독립","독서","독일","독창적","동화책","뒷모습","뒷산","딸아이","마누라","마늘","마당","마라톤","마련","마무리","마사지","마약","마요네즈","마을","마음","마이크","마중","마지막","마찬가지","마찰","마흔","막걸리","막내","막상","만남","만두","만세","만약","만일","만점","만족","만화","많이","말기","말씀","말투","맘대로","망원경","매년","매달","매력","매번","매스컴","매일","매장","맥주","먹이","먼저","먼지","멀리","메일","며느리","며칠","면담","멸치","명단","명령","명예","명의","명절","명칭","명함","모금","모니터","모델","모든","모범","모습","모양","모임","모조리","모집","모퉁이","목걸이","목록","목사","목소리","목숨","목적","목표","몰래","몸매","몸무게","몸살","몸속","몸짓","몸통","몹시","무관심","무궁화","무더위","무덤","무릎","무슨","무엇","무역","무용","무조건","무지개","무척","문구","문득","문법","문서","문제","문학","문화","물가","물건","물결","물고기","물론","물리학","물음","물질","물체","미국","미디어","미사일","미술","미역","미용실","미움","미인","미팅","미혼","민간","민족","민주","믿음","밀가루","밀리미터","밑바닥","바가지","바구니","바나나","바늘","바닥","바닷가","바람","바이러스","바탕","박물관","박사","박수","반대","반드시","반말","반발","반성","반응","반장","반죽","반지","반찬","받침","발가락","발걸음","발견","발달","발레","발목","발바닥","발생","발음","발자국","발전","발톱","발표","밤하늘","밥그릇","밥맛","밥상","밥솥","방금","방면","방문","방바닥","방법","방송","방식","방안","방울","방지","방학","방해","방향","배경","배꼽","배달","배드민턴","백두산","백색","백성","백인","백제","백화점","버릇","버섯","버튼","번개","번역","번지","번호","벌금","벌레","벌써","범위","범인","범죄","법률","법원","법적","법칙","베이징","벨트","변경","변동","변명","변신","변호사","변화","별도","별명","별일","병실","병아리","병원","보관","보너스","보라색","보람","보름","보상","보안","보자기","보장","보전","보존","보통","보편적","보험","복도","복사","복숭아","복습","볶음","본격적","본래","본부","본사","본성","본인","본질","볼펜","봉사","봉지","봉투","부근","부끄러움","부담","부동산","부문","부분","부산","부상","부엌","부인","부작용","부장","부정","부족","부지런히","부친","부탁","부품","부회장","북부","북한","분노","분량","분리","분명","분석","분야","분위기","분필","분홍색","불고기","불과","불교","불꽃","불만","불법","불빛","불안","불이익","불행","브랜드","비극","비난","비닐","비둘기","비디오","비로소","비만","비명","비밀","비바람","비빔밥","비상","비용","비율","비중","비타민","비판","빌딩","빗물","빗방울","빗줄기","빛깔","빨간색","빨래","빨리","사건","사계절","사나이","사냥","사람","사랑","사립","사모님","사물","사방","사상","사생활","사설","사슴","사실","사업","사용","사월","사장","사전","사진","사촌","사춘기","사탕","사투리","사흘","산길","산부인과","산업","산책","살림","살인","살짝","삼계탕","삼국","삼십","삼월","삼촌","상관","상금","상대","상류","상반기","상상","상식","상업","상인","상자","상점","상처","상추","상태","상표","상품","상황","새벽","색깔","색연필","생각","생명","생물","생방송","생산","생선","생신","생일","생활","서랍","서른","서명","서민","서비스","서양","서울","서적","서점","서쪽","서클","석사","석유","선거","선물","선배","선생","선수","선원","선장","선전","선택","선풍기","설거지","설날","설렁탕","설명","설문","설사","설악산","설치","설탕","섭씨","성공","성당","성명","성별","성인","성장","성적","성질","성함","세금","세미나","세상","세월","세종대왕","세탁","센터","센티미터","셋째","소규모","소극적","소금","소나기","소년","소득","소망","소문","소설","소속","소아과","소용","소원","소음","소중히","소지품","소질","소풍","소형","속담","속도","속옷","손가락","손길","손녀","손님","손등","손목","손뼉","손실","손질","손톱","손해","솔직히","솜씨","송아지","송이","송편","쇠고기","쇼핑","수건","수년","수단","수돗물","수동적","수면","수명","수박","수상","수석","수술","수시로","수업","수염","수영","수입","수준","수집","수출","수컷","수필","수학","수험생","수화기","숙녀","숙소","숙제","순간","순서","순수","순식간","순위","숟가락","술병","술집","숫자","스님","스물","스스로","스승","스웨터","스위치","스케이트","스튜디오","스트레스","스포츠","슬쩍","슬픔","습관","습기","승객","승리","승부","승용차","승진","시각","시간","시골","시금치","시나리오","시댁","시리즈","시멘트","시민","시부모","시선","시설","시스템","시아버지","시어머니","시월","시인","시일","시작","시장","시절","시점","시중","시즌","시집","시청","시합","시험","식구","식기","식당","식량","식료품","식물","식빵","식사","식생활","식초","식탁","식품","신고","신규","신념","신문","신발","신비","신사","신세","신용","신제품","신청","신체","신화","실감","실내","실력","실례","실망","실수","실습","실시","실장","실정","실질적","실천","실체","실컷","실태","실패","실험","실현","심리","심부름","심사","심장","심정","심판","쌍둥이","씨름","씨앗","아가씨","아나운서","아드님","아들","아쉬움","아스팔트","아시아","아울러","아저씨","아줌마","아직","아침","아파트","아프리카","아픔","아홉","아흔","악기","악몽","악수","안개","안경","안과","안내","안녕","안동","안방","안부","안주","알루미늄","알코올","암시","암컷","압력","앞날","앞문","애인","애정","액수","앨범","야간","야단","야옹","약간","약국","약속","약수","약점","약품","약혼녀","양념","양력","양말","양배추","양주","양파","어둠","어려움","어른","어젯밤","어쨌든","어쩌다가","어쩐지","언니","언덕","언론","언어","얼굴","얼른","얼음","얼핏","엄마","업무","업종","업체","엉덩이","엉망","엉터리","엊그제","에너지","에어컨","엔진","여건","여고생","여관","여군","여권","여대생","여덟","여동생","여든","여론","여름","여섯","여성","여왕","여인","여전히","여직원","여학생","여행","역사","역시","역할","연결","연구","연극","연기","연락","연설","연세","연속","연습","연애","연예인","연인","연장","연주","연출","연필","연합","연휴","열기","열매","열쇠","열심히","열정","열차","열흘","염려","엽서","영국","영남","영상","영양","영역","영웅","영원히","영하","영향","영혼","영화","옆구리","옆방","옆집","예감","예금","예방","예산","예상","예선","예술","예습","예식장","예약","예전","예절","예정","예컨대","옛날","오늘","오락","오랫동안","오렌지","오로지","오른발","오븐","오십","오염","오월","오전","오직","오징어","오페라","오피스텔","오히려","옥상","옥수수","온갖","온라인","온몸","온종일","온통","올가을","올림픽","올해","옷차림","와이셔츠","와인","완성","완전","왕비","왕자","왜냐하면","왠지","외갓집","외국","외로움","외삼촌","외출","외침","외할머니","왼발","왼손","왼쪽","요금","요일","요즘","요청","용기","용서","용어","우산","우선","우승","우연히","우정","우체국","우편","운동","운명","운반","운전","운행","울산","울음","움직임","웃어른","웃음","워낙","원고","원래","원서","원숭이","원인","원장","원피스","월급","월드컵","월세","월요일","웨이터","위반","위법","위성","위원","위험","위협","윗사람","유난히","유럽","유명","유물","유산","유적","유치원","유학","유행","유형","육군","육상","육십","육체","은행","음력","음료","음반","음성","음식","음악","음주","의견","의논","의문","의복","의식","의심","의외로","의욕","의원","의학","이것","이곳","이념","이놈","이달","이대로","이동","이렇게","이력서","이론적","이름","이민","이발소","이별","이불","이빨","이상","이성","이슬","이야기","이용","이웃","이월","이윽고","이익","이전","이중","이튿날","이틀","이혼","인간","인격","인공","인구","인근","인기","인도","인류","인물","인생","인쇄","인연","인원","인재","인종","인천","인체","인터넷","인하","인형","일곱","일기","일단","일대","일등","일반","일본","일부","일상","일생","일손","일요일","일월","일정","일종","일주일","일찍","일체","일치","일행","일회용","임금","임무","입대","입력","입맛","입사","입술","입시","입원","입장","입학","자가용","자격","자극","자동","자랑","자부심","자식","자신","자연","자원","자율","자전거","자정","자존심","자판","작가","작년","작성","작업","작용","작은딸","작품","잔디","잔뜩","잔치","잘못","잠깐","잠수함","잠시","잠옷","잠자리","잡지","장관","장군","장기간","장래","장례","장르","장마","장면","장모","장미","장비","장사","장소","장식","장애인","장인","장점","장차","장학금","재능","재빨리","재산","재생","재작년","재정","재채기","재판","재학","재활용","저것","저고리","저곳","저녁","저런","저렇게","저번","저울","저절로","저축","적극","적당히","적성","적용","적응","전개","전공","전기","전달","전라도","전망","전문","전반","전부","전세","전시","전용","전자","전쟁","전주","전철","전체","전통","전혀","전후","절대","절망","절반","절약","절차","점검","점수","점심","점원","점점","점차","접근","접시","접촉","젓가락","정거장","정도","정류장","정리","정말","정면","정문","정반대","정보","정부","정비","정상","정성","정오","정원","정장","정지","정치","정확히","제공","제과점","제대로","제목","제발","제법","제삿날","제안","제일","제작","제주도","제출","제품","제한","조각","조건","조금","조깅","조명","조미료","조상","조선","조용히","조절","조정","조직","존댓말","존재","졸업","졸음","종교","종로","종류","종소리","종업원","종종","종합","좌석","죄인","주관적","주름","주말","주머니","주먹","주문","주민","주방","주변","주식","주인","주일","주장","주전자","주택","준비","줄거리","줄기","줄무늬","중간","중계방송","중국","중년","중단","중독","중반","중부","중세","중소기업","중순","중앙","중요","중학교","즉석","즉시","즐거움","증가","증거","증권","증상","증세","지각","지갑","지경","지극히","지금","지급","지능","지름길","지리산","지방","지붕","지식","지역","지우개","지원","지적","지점","지진","지출","직선","직업","직원","직장","진급","진동","진로","진료","진리","진짜","진찰","진출","진통","진행","질문","질병","질서","짐작","집단","집안","집중","짜증","찌꺼기","차남","차라리","차량","차림","차별","차선","차츰","착각","찬물","찬성","참가","참기름","참새","참석","참여","참외","참조","찻잔","창가","창고","창구","창문","창밖","창작","창조","채널","채점","책가방","책방","책상","책임","챔피언","처벌","처음","천국","천둥","천장","천재","천천히","철도","철저히","철학","첫날","첫째","청년","청바지","청소","청춘","체계","체력","체온","체육","체중","체험","초등학생","초반","초밥","초상화","초순","초여름","초원","초저녁","초점","초청","초콜릿","촛불","총각","총리","총장","촬영","최근","최상","최선","최신","최악","최종","추석","추억","추진","추천","추측","축구","축소","축제","축하","출근","출발","출산","출신","출연","출입","출장","출판","충격","충고","충돌","충분히","충청도","취업","취직","취향","치약","친구","친척","칠십","칠월","칠판","침대","침묵","침실","칫솔","칭찬","카메라","카운터","칼국수","캐릭터","캠퍼스","캠페인","커튼","컨디션","컬러","컴퓨터","코끼리","코미디","콘서트","콜라","콤플렉스","콩나물","쾌감","쿠데타","크림","큰길","큰딸","큰소리","큰아들","큰어머니","큰일","큰절","클래식","클럽","킬로","타입","타자기","탁구","탁자","탄생","태권도","태양","태풍","택시","탤런트","터널","터미널","테니스","테스트","테이블","텔레비전","토론","토마토","토요일","통계","통과","통로","통신","통역","통일","통장","통제","통증","통합","통화","퇴근","퇴원","퇴직금","튀김","트럭","특급","특별","특성","특수","특징","특히","튼튼히","티셔츠","파란색","파일","파출소","판결","판단","판매","판사","팔십","팔월","팝송","패션","팩스","팩시밀리","팬티","퍼센트","페인트","편견","편의","편지","편히","평가","평균","평생","평소","평양","평일","평화","포스터","포인트","포장","포함","표면","표정","표준","표현","품목","품질","풍경","풍속","풍습","프랑스","프린터","플라스틱","피곤","피망","피아노","필름","필수","필요","필자","필통","핑계","하느님","하늘","하드웨어","하룻밤","하반기","하숙집","하순","하여튼","하지만","하천","하품","하필","학과","학교","학급","학기","학년","학력","학번","학부모","학비","학생","학술","학습","학용품","학원","학위","학자","학점","한계","한글","한꺼번에","한낮","한눈","한동안","한때","한라산","한마디","한문","한번","한복","한식","한여름","한쪽","할머니","할아버지","할인","함께","함부로","합격","합리적","항공","항구","항상","항의","해결","해군","해답","해당","해물","해석","해설","해수욕장","해안","핵심","핸드백","햄버거","햇볕","햇살","행동","행복","행사","행운","행위","향기","향상","향수","허락","허용","헬기","현관","현금","현대","현상","현실","현장","현재","현지","혈액","협력","형부","형사","형수","형식","형제","형태","형편","혜택","호기심","호남","호랑이","호박","호텔","호흡","혹시","홀로","홈페이지","홍보","홍수","홍차","화면","화분","화살","화요일","화장","화학","확보","확인","확장","확정","환갑","환경","환영","환율","환자","활기","활동","활발히","활용","활짝","회견","회관","회복","회색","회원","회장","회전","횟수","횡단보도","효율적","후반","후춧가루","훈련","훨씬","휴식","휴일","흉내","흐름","흑백","흑인","흔적","흔히","흥미","흥분","희곡","희망","희생","흰색","힘껏"]'),require$$4=JSON.parse('["abaisser","abandon","abdiquer","abeille","abolir","aborder","aboutir","aboyer","abrasif","abreuver","abriter","abroger","abrupt","absence","absolu","absurde","abusif","abyssal","académie","acajou","acarien","accabler","accepter","acclamer","accolade","accroche","accuser","acerbe","achat","acheter","aciduler","acier","acompte","acquérir","acronyme","acteur","actif","actuel","adepte","adéquat","adhésif","adjectif","adjuger","admettre","admirer","adopter","adorer","adoucir","adresse","adroit","adulte","adverbe","aérer","aéronef","affaire","affecter","affiche","affreux","affubler","agacer","agencer","agile","agiter","agrafer","agréable","agrume","aider","aiguille","ailier","aimable","aisance","ajouter","ajuster","alarmer","alchimie","alerte","algèbre","algue","aliéner","aliment","alléger","alliage","allouer","allumer","alourdir","alpaga","altesse","alvéole","amateur","ambigu","ambre","aménager","amertume","amidon","amiral","amorcer","amour","amovible","amphibie","ampleur","amusant","analyse","anaphore","anarchie","anatomie","ancien","anéantir","angle","angoisse","anguleux","animal","annexer","annonce","annuel","anodin","anomalie","anonyme","anormal","antenne","antidote","anxieux","apaiser","apéritif","aplanir","apologie","appareil","appeler","apporter","appuyer","aquarium","aqueduc","arbitre","arbuste","ardeur","ardoise","argent","arlequin","armature","armement","armoire","armure","arpenter","arracher","arriver","arroser","arsenic","artériel","article","aspect","asphalte","aspirer","assaut","asservir","assiette","associer","assurer","asticot","astre","astuce","atelier","atome","atrium","atroce","attaque","attentif","attirer","attraper","aubaine","auberge","audace","audible","augurer","aurore","automne","autruche","avaler","avancer","avarice","avenir","averse","aveugle","aviateur","avide","avion","aviser","avoine","avouer","avril","axial","axiome","badge","bafouer","bagage","baguette","baignade","balancer","balcon","baleine","balisage","bambin","bancaire","bandage","banlieue","bannière","banquier","barbier","baril","baron","barque","barrage","bassin","bastion","bataille","bateau","batterie","baudrier","bavarder","belette","bélier","belote","bénéfice","berceau","berger","berline","bermuda","besace","besogne","bétail","beurre","biberon","bicycle","bidule","bijou","bilan","bilingue","billard","binaire","biologie","biopsie","biotype","biscuit","bison","bistouri","bitume","bizarre","blafard","blague","blanchir","blessant","blinder","blond","bloquer","blouson","bobard","bobine","boire","boiser","bolide","bonbon","bondir","bonheur","bonifier","bonus","bordure","borne","botte","boucle","boueux","bougie","boulon","bouquin","bourse","boussole","boutique","boxeur","branche","brasier","brave","brebis","brèche","breuvage","bricoler","brigade","brillant","brioche","brique","brochure","broder","bronzer","brousse","broyeur","brume","brusque","brutal","bruyant","buffle","buisson","bulletin","bureau","burin","bustier","butiner","butoir","buvable","buvette","cabanon","cabine","cachette","cadeau","cadre","caféine","caillou","caisson","calculer","calepin","calibre","calmer","calomnie","calvaire","camarade","caméra","camion","campagne","canal","caneton","canon","cantine","canular","capable","caporal","caprice","capsule","capter","capuche","carabine","carbone","caresser","caribou","carnage","carotte","carreau","carton","cascade","casier","casque","cassure","causer","caution","cavalier","caverne","caviar","cédille","ceinture","céleste","cellule","cendrier","censurer","central","cercle","cérébral","cerise","cerner","cerveau","cesser","chagrin","chaise","chaleur","chambre","chance","chapitre","charbon","chasseur","chaton","chausson","chavirer","chemise","chenille","chéquier","chercher","cheval","chien","chiffre","chignon","chimère","chiot","chlorure","chocolat","choisir","chose","chouette","chrome","chute","cigare","cigogne","cimenter","cinéma","cintrer","circuler","cirer","cirque","citerne","citoyen","citron","civil","clairon","clameur","claquer","classe","clavier","client","cligner","climat","clivage","cloche","clonage","cloporte","cobalt","cobra","cocasse","cocotier","coder","codifier","coffre","cogner","cohésion","coiffer","coincer","colère","colibri","colline","colmater","colonel","combat","comédie","commande","compact","concert","conduire","confier","congeler","connoter","consonne","contact","convexe","copain","copie","corail","corbeau","cordage","corniche","corpus","correct","cortège","cosmique","costume","coton","coude","coupure","courage","couteau","couvrir","coyote","crabe","crainte","cravate","crayon","créature","créditer","crémeux","creuser","crevette","cribler","crier","cristal","critère","croire","croquer","crotale","crucial","cruel","crypter","cubique","cueillir","cuillère","cuisine","cuivre","culminer","cultiver","cumuler","cupide","curatif","curseur","cyanure","cycle","cylindre","cynique","daigner","damier","danger","danseur","dauphin","débattre","débiter","déborder","débrider","débutant","décaler","décembre","déchirer","décider","déclarer","décorer","décrire","décupler","dédale","déductif","déesse","défensif","défiler","défrayer","dégager","dégivrer","déglutir","dégrafer","déjeuner","délice","déloger","demander","demeurer","démolir","dénicher","dénouer","dentelle","dénuder","départ","dépenser","déphaser","déplacer","déposer","déranger","dérober","désastre","descente","désert","désigner","désobéir","dessiner","destrier","détacher","détester","détourer","détresse","devancer","devenir","deviner","devoir","diable","dialogue","diamant","dicter","différer","digérer","digital","digne","diluer","dimanche","diminuer","dioxyde","directif","diriger","discuter","disposer","dissiper","distance","divertir","diviser","docile","docteur","dogme","doigt","domaine","domicile","dompter","donateur","donjon","donner","dopamine","dortoir","dorure","dosage","doseur","dossier","dotation","douanier","double","douceur","douter","doyen","dragon","draper","dresser","dribbler","droiture","duperie","duplexe","durable","durcir","dynastie","éblouir","écarter","écharpe","échelle","éclairer","éclipse","éclore","écluse","école","économie","écorce","écouter","écraser","écrémer","écrivain","écrou","écume","écureuil","édifier","éduquer","effacer","effectif","effigie","effort","effrayer","effusion","égaliser","égarer","éjecter","élaborer","élargir","électron","élégant","éléphant","élève","éligible","élitisme","éloge","élucider","éluder","emballer","embellir","embryon","émeraude","émission","emmener","émotion","émouvoir","empereur","employer","emporter","emprise","émulsion","encadrer","enchère","enclave","encoche","endiguer","endosser","endroit","enduire","énergie","enfance","enfermer","enfouir","engager","engin","englober","énigme","enjamber","enjeu","enlever","ennemi","ennuyeux","enrichir","enrobage","enseigne","entasser","entendre","entier","entourer","entraver","énumérer","envahir","enviable","envoyer","enzyme","éolien","épaissir","épargne","épatant","épaule","épicerie","épidémie","épier","épilogue","épine","épisode","épitaphe","époque","épreuve","éprouver","épuisant","équerre","équipe","ériger","érosion","erreur","éruption","escalier","espadon","espèce","espiègle","espoir","esprit","esquiver","essayer","essence","essieu","essorer","estime","estomac","estrade","étagère","étaler","étanche","étatique","éteindre","étendoir","éternel","éthanol","éthique","ethnie","étirer","étoffer","étoile","étonnant","étourdir","étrange","étroit","étude","euphorie","évaluer","évasion","éventail","évidence","éviter","évolutif","évoquer","exact","exagérer","exaucer","exceller","excitant","exclusif","excuse","exécuter","exemple","exercer","exhaler","exhorter","exigence","exiler","exister","exotique","expédier","explorer","exposer","exprimer","exquis","extensif","extraire","exulter","fable","fabuleux","facette","facile","facture","faiblir","falaise","fameux","famille","farceur","farfelu","farine","farouche","fasciner","fatal","fatigue","faucon","fautif","faveur","favori","fébrile","féconder","fédérer","félin","femme","fémur","fendoir","féodal","fermer","féroce","ferveur","festival","feuille","feutre","février","fiasco","ficeler","fictif","fidèle","figure","filature","filetage","filière","filleul","filmer","filou","filtrer","financer","finir","fiole","firme","fissure","fixer","flairer","flamme","flasque","flatteur","fléau","flèche","fleur","flexion","flocon","flore","fluctuer","fluide","fluvial","folie","fonderie","fongible","fontaine","forcer","forgeron","formuler","fortune","fossile","foudre","fougère","fouiller","foulure","fourmi","fragile","fraise","franchir","frapper","frayeur","frégate","freiner","frelon","frémir","frénésie","frère","friable","friction","frisson","frivole","froid","fromage","frontal","frotter","fruit","fugitif","fuite","fureur","furieux","furtif","fusion","futur","gagner","galaxie","galerie","gambader","garantir","gardien","garnir","garrigue","gazelle","gazon","géant","gélatine","gélule","gendarme","général","génie","genou","gentil","géologie","géomètre","géranium","germe","gestuel","geyser","gibier","gicler","girafe","givre","glace","glaive","glisser","globe","gloire","glorieux","golfeur","gomme","gonfler","gorge","gorille","goudron","gouffre","goulot","goupille","gourmand","goutte","graduel","graffiti","graine","grand","grappin","gratuit","gravir","grenat","griffure","griller","grimper","grogner","gronder","grotte","groupe","gruger","grutier","gruyère","guépard","guerrier","guide","guimauve","guitare","gustatif","gymnaste","gyrostat","habitude","hachoir","halte","hameau","hangar","hanneton","haricot","harmonie","harpon","hasard","hélium","hématome","herbe","hérisson","hermine","héron","hésiter","heureux","hiberner","hibou","hilarant","histoire","hiver","homard","hommage","homogène","honneur","honorer","honteux","horde","horizon","horloge","hormone","horrible","houleux","housse","hublot","huileux","humain","humble","humide","humour","hurler","hydromel","hygiène","hymne","hypnose","idylle","ignorer","iguane","illicite","illusion","image","imbiber","imiter","immense","immobile","immuable","impact","impérial","implorer","imposer","imprimer","imputer","incarner","incendie","incident","incliner","incolore","indexer","indice","inductif","inédit","ineptie","inexact","infini","infliger","informer","infusion","ingérer","inhaler","inhiber","injecter","injure","innocent","inoculer","inonder","inscrire","insecte","insigne","insolite","inspirer","instinct","insulter","intact","intense","intime","intrigue","intuitif","inutile","invasion","inventer","inviter","invoquer","ironique","irradier","irréel","irriter","isoler","ivoire","ivresse","jaguar","jaillir","jambe","janvier","jardin","jauger","jaune","javelot","jetable","jeton","jeudi","jeunesse","joindre","joncher","jongler","joueur","jouissif","journal","jovial","joyau","joyeux","jubiler","jugement","junior","jupon","juriste","justice","juteux","juvénile","kayak","kimono","kiosque","label","labial","labourer","lacérer","lactose","lagune","laine","laisser","laitier","lambeau","lamelle","lampe","lanceur","langage","lanterne","lapin","largeur","larme","laurier","lavabo","lavoir","lecture","légal","léger","légume","lessive","lettre","levier","lexique","lézard","liasse","libérer","libre","licence","licorne","liège","lièvre","ligature","ligoter","ligue","limer","limite","limonade","limpide","linéaire","lingot","lionceau","liquide","lisière","lister","lithium","litige","littoral","livreur","logique","lointain","loisir","lombric","loterie","louer","lourd","loutre","louve","loyal","lubie","lucide","lucratif","lueur","lugubre","luisant","lumière","lunaire","lundi","luron","lutter","luxueux","machine","magasin","magenta","magique","maigre","maillon","maintien","mairie","maison","majorer","malaxer","maléfice","malheur","malice","mallette","mammouth","mandater","maniable","manquant","manteau","manuel","marathon","marbre","marchand","mardi","maritime","marqueur","marron","marteler","mascotte","massif","matériel","matière","matraque","maudire","maussade","mauve","maximal","méchant","méconnu","médaille","médecin","méditer","méduse","meilleur","mélange","mélodie","membre","mémoire","menacer","mener","menhir","mensonge","mentor","mercredi","mérite","merle","messager","mesure","métal","météore","méthode","métier","meuble","miauler","microbe","miette","mignon","migrer","milieu","million","mimique","mince","minéral","minimal","minorer","minute","miracle","miroiter","missile","mixte","mobile","moderne","moelleux","mondial","moniteur","monnaie","monotone","monstre","montagne","monument","moqueur","morceau","morsure","mortier","moteur","motif","mouche","moufle","moulin","mousson","mouton","mouvant","multiple","munition","muraille","murène","murmure","muscle","muséum","musicien","mutation","muter","mutuel","myriade","myrtille","mystère","mythique","nageur","nappe","narquois","narrer","natation","nation","nature","naufrage","nautique","navire","nébuleux","nectar","néfaste","négation","négliger","négocier","neige","nerveux","nettoyer","neurone","neutron","neveu","niche","nickel","nitrate","niveau","noble","nocif","nocturne","noirceur","noisette","nomade","nombreux","nommer","normatif","notable","notifier","notoire","nourrir","nouveau","novateur","novembre","novice","nuage","nuancer","nuire","nuisible","numéro","nuptial","nuque","nutritif","obéir","objectif","obliger","obscur","observer","obstacle","obtenir","obturer","occasion","occuper","océan","octobre","octroyer","octupler","oculaire","odeur","odorant","offenser","officier","offrir","ogive","oiseau","oisillon","olfactif","olivier","ombrage","omettre","onctueux","onduler","onéreux","onirique","opale","opaque","opérer","opinion","opportun","opprimer","opter","optique","orageux","orange","orbite","ordonner","oreille","organe","orgueil","orifice","ornement","orque","ortie","osciller","osmose","ossature","otarie","ouragan","ourson","outil","outrager","ouvrage","ovation","oxyde","oxygène","ozone","paisible","palace","palmarès","palourde","palper","panache","panda","pangolin","paniquer","panneau","panorama","pantalon","papaye","papier","papoter","papyrus","paradoxe","parcelle","paresse","parfumer","parler","parole","parrain","parsemer","partager","parure","parvenir","passion","pastèque","paternel","patience","patron","pavillon","pavoiser","payer","paysage","peigne","peintre","pelage","pélican","pelle","pelouse","peluche","pendule","pénétrer","pénible","pensif","pénurie","pépite","péplum","perdrix","perforer","période","permuter","perplexe","persil","perte","peser","pétale","petit","pétrir","peuple","pharaon","phobie","phoque","photon","phrase","physique","piano","pictural","pièce","pierre","pieuvre","pilote","pinceau","pipette","piquer","pirogue","piscine","piston","pivoter","pixel","pizza","placard","plafond","plaisir","planer","plaque","plastron","plateau","pleurer","plexus","pliage","plomb","plonger","pluie","plumage","pochette","poésie","poète","pointe","poirier","poisson","poivre","polaire","policier","pollen","polygone","pommade","pompier","ponctuel","pondérer","poney","portique","position","posséder","posture","potager","poteau","potion","pouce","poulain","poumon","pourpre","poussin","pouvoir","prairie","pratique","précieux","prédire","préfixe","prélude","prénom","présence","prétexte","prévoir","primitif","prince","prison","priver","problème","procéder","prodige","profond","progrès","proie","projeter","prologue","promener","propre","prospère","protéger","prouesse","proverbe","prudence","pruneau","psychose","public","puceron","puiser","pulpe","pulsar","punaise","punitif","pupitre","purifier","puzzle","pyramide","quasar","querelle","question","quiétude","quitter","quotient","racine","raconter","radieux","ragondin","raideur","raisin","ralentir","rallonge","ramasser","rapide","rasage","ratisser","ravager","ravin","rayonner","réactif","réagir","réaliser","réanimer","recevoir","réciter","réclamer","récolter","recruter","reculer","recycler","rédiger","redouter","refaire","réflexe","réformer","refrain","refuge","régalien","région","réglage","régulier","réitérer","rejeter","rejouer","relatif","relever","relief","remarque","remède","remise","remonter","remplir","remuer","renard","renfort","renifler","renoncer","rentrer","renvoi","replier","reporter","reprise","reptile","requin","réserve","résineux","résoudre","respect","rester","résultat","rétablir","retenir","réticule","retomber","retracer","réunion","réussir","revanche","revivre","révolte","révulsif","richesse","rideau","rieur","rigide","rigoler","rincer","riposter","risible","risque","rituel","rival","rivière","rocheux","romance","rompre","ronce","rondin","roseau","rosier","rotatif","rotor","rotule","rouge","rouille","rouleau","routine","royaume","ruban","rubis","ruche","ruelle","rugueux","ruiner","ruisseau","ruser","rustique","rythme","sabler","saboter","sabre","sacoche","safari","sagesse","saisir","salade","salive","salon","saluer","samedi","sanction","sanglier","sarcasme","sardine","saturer","saugrenu","saumon","sauter","sauvage","savant","savonner","scalpel","scandale","scélérat","scénario","sceptre","schéma","science","scinder","score","scrutin","sculpter","séance","sécable","sécher","secouer","sécréter","sédatif","séduire","seigneur","séjour","sélectif","semaine","sembler","semence","séminal","sénateur","sensible","sentence","séparer","séquence","serein","sergent","sérieux","serrure","sérum","service","sésame","sévir","sevrage","sextuple","sidéral","siècle","siéger","siffler","sigle","signal","silence","silicium","simple","sincère","sinistre","siphon","sirop","sismique","situer","skier","social","socle","sodium","soigneux","soldat","soleil","solitude","soluble","sombre","sommeil","somnoler","sonde","songeur","sonnette","sonore","sorcier","sortir","sosie","sottise","soucieux","soudure","souffle","soulever","soupape","source","soutirer","souvenir","spacieux","spatial","spécial","sphère","spiral","stable","station","sternum","stimulus","stipuler","strict","studieux","stupeur","styliste","sublime","substrat","subtil","subvenir","succès","sucre","suffixe","suggérer","suiveur","sulfate","superbe","supplier","surface","suricate","surmener","surprise","sursaut","survie","suspect","syllabe","symbole","symétrie","synapse","syntaxe","système","tabac","tablier","tactile","tailler","talent","talisman","talonner","tambour","tamiser","tangible","tapis","taquiner","tarder","tarif","tartine","tasse","tatami","tatouage","taupe","taureau","taxer","témoin","temporel","tenaille","tendre","teneur","tenir","tension","terminer","terne","terrible","tétine","texte","thème","théorie","thérapie","thorax","tibia","tiède","timide","tirelire","tiroir","tissu","titane","titre","tituber","toboggan","tolérant","tomate","tonique","tonneau","toponyme","torche","tordre","tornade","torpille","torrent","torse","tortue","totem","toucher","tournage","tousser","toxine","traction","trafic","tragique","trahir","train","trancher","travail","trèfle","tremper","trésor","treuil","triage","tribunal","tricoter","trilogie","triomphe","tripler","triturer","trivial","trombone","tronc","tropical","troupeau","tuile","tulipe","tumulte","tunnel","turbine","tuteur","tutoyer","tuyau","tympan","typhon","typique","tyran","ubuesque","ultime","ultrason","unanime","unifier","union","unique","unitaire","univers","uranium","urbain","urticant","usage","usine","usuel","usure","utile","utopie","vacarme","vaccin","vagabond","vague","vaillant","vaincre","vaisseau","valable","valise","vallon","valve","vampire","vanille","vapeur","varier","vaseux","vassal","vaste","vecteur","vedette","végétal","véhicule","veinard","véloce","vendredi","vénérer","venger","venimeux","ventouse","verdure","vérin","vernir","verrou","verser","vertu","veston","vétéran","vétuste","vexant","vexer","viaduc","viande","victoire","vidange","vidéo","vignette","vigueur","vilain","village","vinaigre","violon","vipère","virement","virtuose","virus","visage","viseur","vision","visqueux","visuel","vital","vitesse","viticole","vitrine","vivace","vivipare","vocation","voguer","voile","voisin","voiture","volaille","volcan","voltiger","volume","vorace","vortex","voter","vouloir","voyage","voyelle","wagon","xénon","yacht","zèbre","zénith","zeste","zoologie"]'),require$$5=JSON.parse('["abaco","abbaglio","abbinato","abete","abisso","abolire","abrasivo","abrogato","accadere","accenno","accusato","acetone","achille","acido","acqua","acre","acrilico","acrobata","acuto","adagio","addebito","addome","adeguato","aderire","adipe","adottare","adulare","affabile","affetto","affisso","affranto","aforisma","afoso","africano","agave","agente","agevole","aggancio","agire","agitare","agonismo","agricolo","agrumeto","aguzzo","alabarda","alato","albatro","alberato","albo","albume","alce","alcolico","alettone","alfa","algebra","aliante","alibi","alimento","allagato","allegro","allievo","allodola","allusivo","almeno","alogeno","alpaca","alpestre","altalena","alterno","alticcio","altrove","alunno","alveolo","alzare","amalgama","amanita","amarena","ambito","ambrato","ameba","america","ametista","amico","ammasso","ammenda","ammirare","ammonito","amore","ampio","ampliare","amuleto","anacardo","anagrafe","analista","anarchia","anatra","anca","ancella","ancora","andare","andrea","anello","angelo","angolare","angusto","anima","annegare","annidato","anno","annuncio","anonimo","anticipo","anzi","apatico","apertura","apode","apparire","appetito","appoggio","approdo","appunto","aprile","arabica","arachide","aragosta","araldica","arancio","aratura","arazzo","arbitro","archivio","ardito","arenile","argento","argine","arguto","aria","armonia","arnese","arredato","arringa","arrosto","arsenico","arso","artefice","arzillo","asciutto","ascolto","asepsi","asettico","asfalto","asino","asola","aspirato","aspro","assaggio","asse","assoluto","assurdo","asta","astenuto","astice","astratto","atavico","ateismo","atomico","atono","attesa","attivare","attorno","attrito","attuale","ausilio","austria","autista","autonomo","autunno","avanzato","avere","avvenire","avviso","avvolgere","azione","azoto","azzimo","azzurro","babele","baccano","bacino","baco","badessa","badilata","bagnato","baita","balcone","baldo","balena","ballata","balzano","bambino","bandire","baraonda","barbaro","barca","baritono","barlume","barocco","basilico","basso","batosta","battuto","baule","bava","bavosa","becco","beffa","belgio","belva","benda","benevole","benigno","benzina","bere","berlina","beta","bibita","bici","bidone","bifido","biga","bilancia","bimbo","binocolo","biologo","bipede","bipolare","birbante","birra","biscotto","bisesto","bisnonno","bisonte","bisturi","bizzarro","blando","blatta","bollito","bonifico","bordo","bosco","botanico","bottino","bozzolo","braccio","bradipo","brama","branca","bravura","bretella","brevetto","brezza","briglia","brillante","brindare","broccolo","brodo","bronzina","brullo","bruno","bubbone","buca","budino","buffone","buio","bulbo","buono","burlone","burrasca","bussola","busta","cadetto","caduco","calamaro","calcolo","calesse","calibro","calmo","caloria","cambusa","camerata","camicia","cammino","camola","campale","canapa","candela","cane","canino","canotto","cantina","capace","capello","capitolo","capogiro","cappero","capra","capsula","carapace","carcassa","cardo","carisma","carovana","carretto","cartolina","casaccio","cascata","caserma","caso","cassone","castello","casuale","catasta","catena","catrame","cauto","cavillo","cedibile","cedrata","cefalo","celebre","cellulare","cena","cenone","centesimo","ceramica","cercare","certo","cerume","cervello","cesoia","cespo","ceto","chela","chiaro","chicca","chiedere","chimera","china","chirurgo","chitarra","ciao","ciclismo","cifrare","cigno","cilindro","ciottolo","circa","cirrosi","citrico","cittadino","ciuffo","civetta","civile","classico","clinica","cloro","cocco","codardo","codice","coerente","cognome","collare","colmato","colore","colposo","coltivato","colza","coma","cometa","commando","comodo","computer","comune","conciso","condurre","conferma","congelare","coniuge","connesso","conoscere","consumo","continuo","convegno","coperto","copione","coppia","copricapo","corazza","cordata","coricato","cornice","corolla","corpo","corredo","corsia","cortese","cosmico","costante","cottura","covato","cratere","cravatta","creato","credere","cremoso","crescita","creta","criceto","crinale","crisi","critico","croce","cronaca","crostata","cruciale","crusca","cucire","cuculo","cugino","cullato","cupola","curatore","cursore","curvo","cuscino","custode","dado","daino","dalmata","damerino","daniela","dannoso","danzare","datato","davanti","davvero","debutto","decennio","deciso","declino","decollo","decreto","dedicato","definito","deforme","degno","delegare","delfino","delirio","delta","demenza","denotato","dentro","deposito","derapata","derivare","deroga","descritto","deserto","desiderio","desumere","detersivo","devoto","diametro","dicembre","diedro","difeso","diffuso","digerire","digitale","diluvio","dinamico","dinnanzi","dipinto","diploma","dipolo","diradare","dire","dirotto","dirupo","disagio","discreto","disfare","disgelo","disposto","distanza","disumano","dito","divano","divelto","dividere","divorato","doblone","docente","doganale","dogma","dolce","domato","domenica","dominare","dondolo","dono","dormire","dote","dottore","dovuto","dozzina","drago","druido","dubbio","dubitare","ducale","duna","duomo","duplice","duraturo","ebano","eccesso","ecco","eclissi","economia","edera","edicola","edile","editoria","educare","egemonia","egli","egoismo","egregio","elaborato","elargire","elegante","elencato","eletto","elevare","elfico","elica","elmo","elsa","eluso","emanato","emblema","emesso","emiro","emotivo","emozione","empirico","emulo","endemico","enduro","energia","enfasi","enoteca","entrare","enzima","epatite","epilogo","episodio","epocale","eppure","equatore","erario","erba","erboso","erede","eremita","erigere","ermetico","eroe","erosivo","errante","esagono","esame","esanime","esaudire","esca","esempio","esercito","esibito","esigente","esistere","esito","esofago","esortato","esoso","espanso","espresso","essenza","esso","esteso","estimare","estonia","estroso","esultare","etilico","etnico","etrusco","etto","euclideo","europa","evaso","evidenza","evitato","evoluto","evviva","fabbrica","faccenda","fachiro","falco","famiglia","fanale","fanfara","fango","fantasma","fare","farfalla","farinoso","farmaco","fascia","fastoso","fasullo","faticare","fato","favoloso","febbre","fecola","fede","fegato","felpa","feltro","femmina","fendere","fenomeno","fermento","ferro","fertile","fessura","festivo","fetta","feudo","fiaba","fiducia","fifa","figurato","filo","finanza","finestra","finire","fiore","fiscale","fisico","fiume","flacone","flamenco","flebo","flemma","florido","fluente","fluoro","fobico","focaccia","focoso","foderato","foglio","folata","folclore","folgore","fondente","fonetico","fonia","fontana","forbito","forchetta","foresta","formica","fornaio","foro","fortezza","forzare","fosfato","fosso","fracasso","frana","frassino","fratello","freccetta","frenata","fresco","frigo","frollino","fronde","frugale","frutta","fucilata","fucsia","fuggente","fulmine","fulvo","fumante","fumetto","fumoso","fune","funzione","fuoco","furbo","furgone","furore","fuso","futile","gabbiano","gaffe","galateo","gallina","galoppo","gambero","gamma","garanzia","garbo","garofano","garzone","gasdotto","gasolio","gastrico","gatto","gaudio","gazebo","gazzella","geco","gelatina","gelso","gemello","gemmato","gene","genitore","gennaio","genotipo","gergo","ghepardo","ghiaccio","ghisa","giallo","gilda","ginepro","giocare","gioiello","giorno","giove","girato","girone","gittata","giudizio","giurato","giusto","globulo","glutine","gnomo","gobba","golf","gomito","gommone","gonfio","gonna","governo","gracile","grado","grafico","grammo","grande","grattare","gravoso","grazia","greca","gregge","grifone","grigio","grinza","grotta","gruppo","guadagno","guaio","guanto","guardare","gufo","guidare","ibernato","icona","identico","idillio","idolo","idra","idrico","idrogeno","igiene","ignaro","ignorato","ilare","illeso","illogico","illudere","imballo","imbevuto","imbocco","imbuto","immane","immerso","immolato","impacco","impeto","impiego","importo","impronta","inalare","inarcare","inattivo","incanto","incendio","inchino","incisivo","incluso","incontro","incrocio","incubo","indagine","india","indole","inedito","infatti","infilare","inflitto","ingaggio","ingegno","inglese","ingordo","ingrosso","innesco","inodore","inoltrare","inondato","insano","insetto","insieme","insonnia","insulina","intasato","intero","intonaco","intuito","inumidire","invalido","invece","invito","iperbole","ipnotico","ipotesi","ippica","iride","irlanda","ironico","irrigato","irrorare","isolato","isotopo","isterico","istituto","istrice","italia","iterare","labbro","labirinto","lacca","lacerato","lacrima","lacuna","laddove","lago","lampo","lancetta","lanterna","lardoso","larga","laringe","lastra","latenza","latino","lattuga","lavagna","lavoro","legale","leggero","lembo","lentezza","lenza","leone","lepre","lesivo","lessato","lesto","letterale","leva","levigato","libero","lido","lievito","lilla","limatura","limitare","limpido","lineare","lingua","liquido","lira","lirica","lisca","lite","litigio","livrea","locanda","lode","logica","lombare","londra","longevo","loquace","lorenzo","loto","lotteria","luce","lucidato","lumaca","luminoso","lungo","lupo","luppolo","lusinga","lusso","lutto","macabro","macchina","macero","macinato","madama","magico","maglia","magnete","magro","maiolica","malafede","malgrado","malinteso","malsano","malto","malumore","mana","mancia","mandorla","mangiare","manifesto","mannaro","manovra","mansarda","mantide","manubrio","mappa","maratona","marcire","maretta","marmo","marsupio","maschera","massaia","mastino","materasso","matricola","mattone","maturo","mazurca","meandro","meccanico","mecenate","medesimo","meditare","mega","melassa","melis","melodia","meninge","meno","mensola","mercurio","merenda","merlo","meschino","mese","messere","mestolo","metallo","metodo","mettere","miagolare","mica","micelio","michele","microbo","midollo","miele","migliore","milano","milite","mimosa","minerale","mini","minore","mirino","mirtillo","miscela","missiva","misto","misurare","mitezza","mitigare","mitra","mittente","mnemonico","modello","modifica","modulo","mogano","mogio","mole","molosso","monastero","monco","mondina","monetario","monile","monotono","monsone","montato","monviso","mora","mordere","morsicato","mostro","motivato","motosega","motto","movenza","movimento","mozzo","mucca","mucosa","muffa","mughetto","mugnaio","mulatto","mulinello","multiplo","mummia","munto","muovere","murale","musa","muscolo","musica","mutevole","muto","nababbo","nafta","nanometro","narciso","narice","narrato","nascere","nastrare","naturale","nautica","naviglio","nebulosa","necrosi","negativo","negozio","nemmeno","neofita","neretto","nervo","nessuno","nettuno","neutrale","neve","nevrotico","nicchia","ninfa","nitido","nobile","nocivo","nodo","nome","nomina","nordico","normale","norvegese","nostrano","notare","notizia","notturno","novella","nucleo","nulla","numero","nuovo","nutrire","nuvola","nuziale","oasi","obbedire","obbligo","obelisco","oblio","obolo","obsoleto","occasione","occhio","occidente","occorrere","occultare","ocra","oculato","odierno","odorare","offerta","offrire","offuscato","oggetto","oggi","ognuno","olandese","olfatto","oliato","oliva","ologramma","oltre","omaggio","ombelico","ombra","omega","omissione","ondoso","onere","onice","onnivoro","onorevole","onta","operato","opinione","opposto","oracolo","orafo","ordine","orecchino","orefice","orfano","organico","origine","orizzonte","orma","ormeggio","ornativo","orologio","orrendo","orribile","ortensia","ortica","orzata","orzo","osare","oscurare","osmosi","ospedale","ospite","ossa","ossidare","ostacolo","oste","otite","otre","ottagono","ottimo","ottobre","ovale","ovest","ovino","oviparo","ovocito","ovunque","ovviare","ozio","pacchetto","pace","pacifico","padella","padrone","paese","paga","pagina","palazzina","palesare","pallido","palo","palude","pandoro","pannello","paolo","paonazzo","paprica","parabola","parcella","parere","pargolo","pari","parlato","parola","partire","parvenza","parziale","passivo","pasticca","patacca","patologia","pattume","pavone","peccato","pedalare","pedonale","peggio","peloso","penare","pendice","penisola","pennuto","penombra","pensare","pentola","pepe","pepita","perbene","percorso","perdonato","perforare","pergamena","periodo","permesso","perno","perplesso","persuaso","pertugio","pervaso","pesatore","pesista","peso","pestifero","petalo","pettine","petulante","pezzo","piacere","pianta","piattino","piccino","picozza","piega","pietra","piffero","pigiama","pigolio","pigro","pila","pilifero","pillola","pilota","pimpante","pineta","pinna","pinolo","pioggia","piombo","piramide","piretico","pirite","pirolisi","pitone","pizzico","placebo","planare","plasma","platano","plenario","pochezza","poderoso","podismo","poesia","poggiare","polenta","poligono","pollice","polmonite","polpetta","polso","poltrona","polvere","pomice","pomodoro","ponte","popoloso","porfido","poroso","porpora","porre","portata","posa","positivo","possesso","postulato","potassio","potere","pranzo","prassi","pratica","precluso","predica","prefisso","pregiato","prelievo","premere","prenotare","preparato","presenza","pretesto","prevalso","prima","principe","privato","problema","procura","produrre","profumo","progetto","prolunga","promessa","pronome","proposta","proroga","proteso","prova","prudente","prugna","prurito","psiche","pubblico","pudica","pugilato","pugno","pulce","pulito","pulsante","puntare","pupazzo","pupilla","puro","quadro","qualcosa","quasi","querela","quota","raccolto","raddoppio","radicale","radunato","raffica","ragazzo","ragione","ragno","ramarro","ramingo","ramo","randagio","rantolare","rapato","rapina","rappreso","rasatura","raschiato","rasente","rassegna","rastrello","rata","ravveduto","reale","recepire","recinto","recluta","recondito","recupero","reddito","redimere","regalato","registro","regola","regresso","relazione","remare","remoto","renna","replica","reprimere","reputare","resa","residente","responso","restauro","rete","retina","retorica","rettifica","revocato","riassunto","ribadire","ribelle","ribrezzo","ricarica","ricco","ricevere","riciclato","ricordo","ricreduto","ridicolo","ridurre","rifasare","riflesso","riforma","rifugio","rigare","rigettato","righello","rilassato","rilevato","rimanere","rimbalzo","rimedio","rimorchio","rinascita","rincaro","rinforzo","rinnovo","rinomato","rinsavito","rintocco","rinuncia","rinvenire","riparato","ripetuto","ripieno","riportare","ripresa","ripulire","risata","rischio","riserva","risibile","riso","rispetto","ristoro","risultato","risvolto","ritardo","ritegno","ritmico","ritrovo","riunione","riva","riverso","rivincita","rivolto","rizoma","roba","robotico","robusto","roccia","roco","rodaggio","rodere","roditore","rogito","rollio","romantico","rompere","ronzio","rosolare","rospo","rotante","rotondo","rotula","rovescio","rubizzo","rubrica","ruga","rullino","rumine","rumoroso","ruolo","rupe","russare","rustico","sabato","sabbiare","sabotato","sagoma","salasso","saldatura","salgemma","salivare","salmone","salone","saltare","saluto","salvo","sapere","sapido","saporito","saraceno","sarcasmo","sarto","sassoso","satellite","satira","satollo","saturno","savana","savio","saziato","sbadiglio","sbalzo","sbancato","sbarra","sbattere","sbavare","sbendare","sbirciare","sbloccato","sbocciato","sbrinare","sbruffone","sbuffare","scabroso","scadenza","scala","scambiare","scandalo","scapola","scarso","scatenare","scavato","scelto","scenico","scettro","scheda","schiena","sciarpa","scienza","scindere","scippo","sciroppo","scivolo","sclerare","scodella","scolpito","scomparto","sconforto","scoprire","scorta","scossone","scozzese","scriba","scrollare","scrutinio","scuderia","scultore","scuola","scuro","scusare","sdebitare","sdoganare","seccatura","secondo","sedano","seggiola","segnalato","segregato","seguito","selciato","selettivo","sella","selvaggio","semaforo","sembrare","seme","seminato","sempre","senso","sentire","sepolto","sequenza","serata","serbato","sereno","serio","serpente","serraglio","servire","sestina","setola","settimana","sfacelo","sfaldare","sfamato","sfarzoso","sfaticato","sfera","sfida","sfilato","sfinge","sfocato","sfoderare","sfogo","sfoltire","sforzato","sfratto","sfruttato","sfuggito","sfumare","sfuso","sgabello","sgarbato","sgonfiare","sgorbio","sgrassato","sguardo","sibilo","siccome","sierra","sigla","signore","silenzio","sillaba","simbolo","simpatico","simulato","sinfonia","singolo","sinistro","sino","sintesi","sinusoide","sipario","sisma","sistole","situato","slitta","slogatura","sloveno","smarrito","smemorato","smentito","smeraldo","smilzo","smontare","smottato","smussato","snellire","snervato","snodo","sobbalzo","sobrio","soccorso","sociale","sodale","soffitto","sogno","soldato","solenne","solido","sollazzo","solo","solubile","solvente","somatico","somma","sonda","sonetto","sonnifero","sopire","soppeso","sopra","sorgere","sorpasso","sorriso","sorso","sorteggio","sorvolato","sospiro","sosta","sottile","spada","spalla","spargere","spatola","spavento","spazzola","specie","spedire","spegnere","spelatura","speranza","spessore","spettrale","spezzato","spia","spigoloso","spillato","spinoso","spirale","splendido","sportivo","sposo","spranga","sprecare","spronato","spruzzo","spuntino","squillo","sradicare","srotolato","stabile","stacco","staffa","stagnare","stampato","stantio","starnuto","stasera","statuto","stelo","steppa","sterzo","stiletto","stima","stirpe","stivale","stizzoso","stonato","storico","strappo","stregato","stridulo","strozzare","strutto","stuccare","stufo","stupendo","subentro","succoso","sudore","suggerito","sugo","sultano","suonare","superbo","supporto","surgelato","surrogato","sussurro","sutura","svagare","svedese","sveglio","svelare","svenuto","svezia","sviluppo","svista","svizzera","svolta","svuotare","tabacco","tabulato","tacciare","taciturno","tale","talismano","tampone","tannino","tara","tardivo","targato","tariffa","tarpare","tartaruga","tasto","tattico","taverna","tavolata","tazza","teca","tecnico","telefono","temerario","tempo","temuto","tendone","tenero","tensione","tentacolo","teorema","terme","terrazzo","terzetto","tesi","tesserato","testato","tetro","tettoia","tifare","tigella","timbro","tinto","tipico","tipografo","tiraggio","tiro","titanio","titolo","titubante","tizio","tizzone","toccare","tollerare","tolto","tombola","tomo","tonfo","tonsilla","topazio","topologia","toppa","torba","tornare","torrone","tortora","toscano","tossire","tostatura","totano","trabocco","trachea","trafila","tragedia","tralcio","tramonto","transito","trapano","trarre","trasloco","trattato","trave","treccia","tremolio","trespolo","tributo","tricheco","trifoglio","trillo","trincea","trio","tristezza","triturato","trivella","tromba","trono","troppo","trottola","trovare","truccato","tubatura","tuffato","tulipano","tumulto","tunisia","turbare","turchino","tuta","tutela","ubicato","uccello","uccisore","udire","uditivo","uffa","ufficio","uguale","ulisse","ultimato","umano","umile","umorismo","uncinetto","ungere","ungherese","unicorno","unificato","unisono","unitario","unte","uovo","upupa","uragano","urgenza","urlo","usanza","usato","uscito","usignolo","usuraio","utensile","utilizzo","utopia","vacante","vaccinato","vagabondo","vagliato","valanga","valgo","valico","valletta","valoroso","valutare","valvola","vampata","vangare","vanitoso","vano","vantaggio","vanvera","vapore","varano","varcato","variante","vasca","vedetta","vedova","veduto","vegetale","veicolo","velcro","velina","velluto","veloce","venato","vendemmia","vento","verace","verbale","vergogna","verifica","vero","verruca","verticale","vescica","vessillo","vestale","veterano","vetrina","vetusto","viandante","vibrante","vicenda","vichingo","vicinanza","vidimare","vigilia","vigneto","vigore","vile","villano","vimini","vincitore","viola","vipera","virgola","virologo","virulento","viscoso","visione","vispo","vissuto","visura","vita","vitello","vittima","vivanda","vivido","viziare","voce","voga","volatile","volere","volpe","voragine","vulcano","zampogna","zanna","zappato","zattera","zavorra","zefiro","zelante","zelo","zenzero","zerbino","zibetto","zinco","zircone","zitto","zolla","zotico","zucchero","zufolo","zulu","zuppa"]'),require$$6=JSON.parse('["ábaco","abdomen","abeja","abierto","abogado","abono","aborto","abrazo","abrir","abuelo","abuso","acabar","academia","acceso","acción","aceite","acelga","acento","aceptar","ácido","aclarar","acné","acoger","acoso","activo","acto","actriz","actuar","acudir","acuerdo","acusar","adicto","admitir","adoptar","adorno","aduana","adulto","aéreo","afectar","afición","afinar","afirmar","ágil","agitar","agonía","agosto","agotar","agregar","agrio","agua","agudo","águila","aguja","ahogo","ahorro","aire","aislar","ajedrez","ajeno","ajuste","alacrán","alambre","alarma","alba","álbum","alcalde","aldea","alegre","alejar","alerta","aleta","alfiler","alga","algodón","aliado","aliento","alivio","alma","almeja","almíbar","altar","alteza","altivo","alto","altura","alumno","alzar","amable","amante","amapola","amargo","amasar","ámbar","ámbito","ameno","amigo","amistad","amor","amparo","amplio","ancho","anciano","ancla","andar","andén","anemia","ángulo","anillo","ánimo","anís","anotar","antena","antiguo","antojo","anual","anular","anuncio","añadir","añejo","año","apagar","aparato","apetito","apio","aplicar","apodo","aporte","apoyo","aprender","aprobar","apuesta","apuro","arado","araña","arar","árbitro","árbol","arbusto","archivo","arco","arder","ardilla","arduo","área","árido","aries","armonía","arnés","aroma","arpa","arpón","arreglo","arroz","arruga","arte","artista","asa","asado","asalto","ascenso","asegurar","aseo","asesor","asiento","asilo","asistir","asno","asombro","áspero","astilla","astro","astuto","asumir","asunto","atajo","ataque","atar","atento","ateo","ático","atleta","átomo","atraer","atroz","atún","audaz","audio","auge","aula","aumento","ausente","autor","aval","avance","avaro","ave","avellana","avena","avestruz","avión","aviso","ayer","ayuda","ayuno","azafrán","azar","azote","azúcar","azufre","azul","baba","babor","bache","bahía","baile","bajar","balanza","balcón","balde","bambú","banco","banda","baño","barba","barco","barniz","barro","báscula","bastón","basura","batalla","batería","batir","batuta","baúl","bazar","bebé","bebida","bello","besar","beso","bestia","bicho","bien","bingo","blanco","bloque","blusa","boa","bobina","bobo","boca","bocina","boda","bodega","boina","bola","bolero","bolsa","bomba","bondad","bonito","bono","bonsái","borde","borrar","bosque","bote","botín","bóveda","bozal","bravo","brazo","brecha","breve","brillo","brinco","brisa","broca","broma","bronce","brote","bruja","brusco","bruto","buceo","bucle","bueno","buey","bufanda","bufón","búho","buitre","bulto","burbuja","burla","burro","buscar","butaca","buzón","caballo","cabeza","cabina","cabra","cacao","cadáver","cadena","caer","café","caída","caimán","caja","cajón","cal","calamar","calcio","caldo","calidad","calle","calma","calor","calvo","cama","cambio","camello","camino","campo","cáncer","candil","canela","canguro","canica","canto","caña","cañón","caoba","caos","capaz","capitán","capote","captar","capucha","cara","carbón","cárcel","careta","carga","cariño","carne","carpeta","carro","carta","casa","casco","casero","caspa","castor","catorce","catre","caudal","causa","cazo","cebolla","ceder","cedro","celda","célebre","celoso","célula","cemento","ceniza","centro","cerca","cerdo","cereza","cero","cerrar","certeza","césped","cetro","chacal","chaleco","champú","chancla","chapa","charla","chico","chiste","chivo","choque","choza","chuleta","chupar","ciclón","ciego","cielo","cien","cierto","cifra","cigarro","cima","cinco","cine","cinta","ciprés","circo","ciruela","cisne","cita","ciudad","clamor","clan","claro","clase","clave","cliente","clima","clínica","cobre","cocción","cochino","cocina","coco","código","codo","cofre","coger","cohete","cojín","cojo","cola","colcha","colegio","colgar","colina","collar","colmo","columna","combate","comer","comida","cómodo","compra","conde","conejo","conga","conocer","consejo","contar","copa","copia","corazón","corbata","corcho","cordón","corona","correr","coser","cosmos","costa","cráneo","cráter","crear","crecer","creído","crema","cría","crimen","cripta","crisis","cromo","crónica","croqueta","crudo","cruz","cuadro","cuarto","cuatro","cubo","cubrir","cuchara","cuello","cuento","cuerda","cuesta","cueva","cuidar","culebra","culpa","culto","cumbre","cumplir","cuna","cuneta","cuota","cupón","cúpula","curar","curioso","curso","curva","cutis","dama","danza","dar","dardo","dátil","deber","débil","década","decir","dedo","defensa","definir","dejar","delfín","delgado","delito","demora","denso","dental","deporte","derecho","derrota","desayuno","deseo","desfile","desnudo","destino","desvío","detalle","detener","deuda","día","diablo","diadema","diamante","diana","diario","dibujo","dictar","diente","dieta","diez","difícil","digno","dilema","diluir","dinero","directo","dirigir","disco","diseño","disfraz","diva","divino","doble","doce","dolor","domingo","don","donar","dorado","dormir","dorso","dos","dosis","dragón","droga","ducha","duda","duelo","dueño","dulce","dúo","duque","durar","dureza","duro","ébano","ebrio","echar","eco","ecuador","edad","edición","edificio","editor","educar","efecto","eficaz","eje","ejemplo","elefante","elegir","elemento","elevar","elipse","élite","elixir","elogio","eludir","embudo","emitir","emoción","empate","empeño","empleo","empresa","enano","encargo","enchufe","encía","enemigo","enero","enfado","enfermo","engaño","enigma","enlace","enorme","enredo","ensayo","enseñar","entero","entrar","envase","envío","época","equipo","erizo","escala","escena","escolar","escribir","escudo","esencia","esfera","esfuerzo","espada","espejo","espía","esposa","espuma","esquí","estar","este","estilo","estufa","etapa","eterno","ética","etnia","evadir","evaluar","evento","evitar","exacto","examen","exceso","excusa","exento","exigir","exilio","existir","éxito","experto","explicar","exponer","extremo","fábrica","fábula","fachada","fácil","factor","faena","faja","falda","fallo","falso","faltar","fama","familia","famoso","faraón","farmacia","farol","farsa","fase","fatiga","fauna","favor","fax","febrero","fecha","feliz","feo","feria","feroz","fértil","fervor","festín","fiable","fianza","fiar","fibra","ficción","ficha","fideo","fiebre","fiel","fiera","fiesta","figura","fijar","fijo","fila","filete","filial","filtro","fin","finca","fingir","finito","firma","flaco","flauta","flecha","flor","flota","fluir","flujo","flúor","fobia","foca","fogata","fogón","folio","folleto","fondo","forma","forro","fortuna","forzar","fosa","foto","fracaso","frágil","franja","frase","fraude","freír","freno","fresa","frío","frito","fruta","fuego","fuente","fuerza","fuga","fumar","función","funda","furgón","furia","fusil","fútbol","futuro","gacela","gafas","gaita","gajo","gala","galería","gallo","gamba","ganar","gancho","ganga","ganso","garaje","garza","gasolina","gastar","gato","gavilán","gemelo","gemir","gen","género","genio","gente","geranio","gerente","germen","gesto","gigante","gimnasio","girar","giro","glaciar","globo","gloria","gol","golfo","goloso","golpe","goma","gordo","gorila","gorra","gota","goteo","gozar","grada","gráfico","grano","grasa","gratis","grave","grieta","grillo","gripe","gris","grito","grosor","grúa","grueso","grumo","grupo","guante","guapo","guardia","guerra","guía","guiño","guion","guiso","guitarra","gusano","gustar","haber","hábil","hablar","hacer","hacha","hada","hallar","hamaca","harina","haz","hazaña","hebilla","hebra","hecho","helado","helio","hembra","herir","hermano","héroe","hervir","hielo","hierro","hígado","higiene","hijo","himno","historia","hocico","hogar","hoguera","hoja","hombre","hongo","honor","honra","hora","hormiga","horno","hostil","hoyo","hueco","huelga","huerta","hueso","huevo","huida","huir","humano","húmedo","humilde","humo","hundir","huracán","hurto","icono","ideal","idioma","ídolo","iglesia","iglú","igual","ilegal","ilusión","imagen","imán","imitar","impar","imperio","imponer","impulso","incapaz","índice","inerte","infiel","informe","ingenio","inicio","inmenso","inmune","innato","insecto","instante","interés","íntimo","intuir","inútil","invierno","ira","iris","ironía","isla","islote","jabalí","jabón","jamón","jarabe","jardín","jarra","jaula","jazmín","jefe","jeringa","jinete","jornada","joroba","joven","joya","juerga","jueves","juez","jugador","jugo","juguete","juicio","junco","jungla","junio","juntar","júpiter","jurar","justo","juvenil","juzgar","kilo","koala","labio","lacio","lacra","lado","ladrón","lagarto","lágrima","laguna","laico","lamer","lámina","lámpara","lana","lancha","langosta","lanza","lápiz","largo","larva","lástima","lata","látex","latir","laurel","lavar","lazo","leal","lección","leche","lector","leer","legión","legumbre","lejano","lengua","lento","leña","león","leopardo","lesión","letal","letra","leve","leyenda","libertad","libro","licor","líder","lidiar","lienzo","liga","ligero","lima","límite","limón","limpio","lince","lindo","línea","lingote","lino","linterna","líquido","liso","lista","litera","litio","litro","llaga","llama","llanto","llave","llegar","llenar","llevar","llorar","llover","lluvia","lobo","loción","loco","locura","lógica","logro","lombriz","lomo","lonja","lote","lucha","lucir","lugar","lujo","luna","lunes","lupa","lustro","luto","luz","maceta","macho","madera","madre","maduro","maestro","mafia","magia","mago","maíz","maldad","maleta","malla","malo","mamá","mambo","mamut","manco","mando","manejar","manga","maniquí","manjar","mano","manso","manta","mañana","mapa","máquina","mar","marco","marea","marfil","margen","marido","mármol","marrón","martes","marzo","masa","máscara","masivo","matar","materia","matiz","matriz","máximo","mayor","mazorca","mecha","medalla","medio","médula","mejilla","mejor","melena","melón","memoria","menor","mensaje","mente","menú","mercado","merengue","mérito","mes","mesón","meta","meter","método","metro","mezcla","miedo","miel","miembro","miga","mil","milagro","militar","millón","mimo","mina","minero","mínimo","minuto","miope","mirar","misa","miseria","misil","mismo","mitad","mito","mochila","moción","moda","modelo","moho","mojar","molde","moler","molino","momento","momia","monarca","moneda","monja","monto","moño","morada","morder","moreno","morir","morro","morsa","mortal","mosca","mostrar","motivo","mover","móvil","mozo","mucho","mudar","mueble","muela","muerte","muestra","mugre","mujer","mula","muleta","multa","mundo","muñeca","mural","muro","músculo","museo","musgo","música","muslo","nácar","nación","nadar","naipe","naranja","nariz","narrar","nasal","natal","nativo","natural","náusea","naval","nave","navidad","necio","néctar","negar","negocio","negro","neón","nervio","neto","neutro","nevar","nevera","nicho","nido","niebla","nieto","niñez","niño","nítido","nivel","nobleza","noche","nómina","noria","norma","norte","nota","noticia","novato","novela","novio","nube","nuca","núcleo","nudillo","nudo","nuera","nueve","nuez","nulo","número","nutria","oasis","obeso","obispo","objeto","obra","obrero","observar","obtener","obvio","oca","ocaso","océano","ochenta","ocho","ocio","ocre","octavo","octubre","oculto","ocupar","ocurrir","odiar","odio","odisea","oeste","ofensa","oferta","oficio","ofrecer","ogro","oído","oír","ojo","ola","oleada","olfato","olivo","olla","olmo","olor","olvido","ombligo","onda","onza","opaco","opción","ópera","opinar","oponer","optar","óptica","opuesto","oración","orador","oral","órbita","orca","orden","oreja","órgano","orgía","orgullo","oriente","origen","orilla","oro","orquesta","oruga","osadía","oscuro","osezno","oso","ostra","otoño","otro","oveja","óvulo","óxido","oxígeno","oyente","ozono","pacto","padre","paella","página","pago","país","pájaro","palabra","palco","paleta","pálido","palma","paloma","palpar","pan","panal","pánico","pantera","pañuelo","papá","papel","papilla","paquete","parar","parcela","pared","parir","paro","párpado","parque","párrafo","parte","pasar","paseo","pasión","paso","pasta","pata","patio","patria","pausa","pauta","pavo","payaso","peatón","pecado","pecera","pecho","pedal","pedir","pegar","peine","pelar","peldaño","pelea","peligro","pellejo","pelo","peluca","pena","pensar","peñón","peón","peor","pepino","pequeño","pera","percha","perder","pereza","perfil","perico","perla","permiso","perro","persona","pesa","pesca","pésimo","pestaña","pétalo","petróleo","pez","pezuña","picar","pichón","pie","piedra","pierna","pieza","pijama","pilar","piloto","pimienta","pino","pintor","pinza","piña","piojo","pipa","pirata","pisar","piscina","piso","pista","pitón","pizca","placa","plan","plata","playa","plaza","pleito","pleno","plomo","pluma","plural","pobre","poco","poder","podio","poema","poesía","poeta","polen","policía","pollo","polvo","pomada","pomelo","pomo","pompa","poner","porción","portal","posada","poseer","posible","poste","potencia","potro","pozo","prado","precoz","pregunta","premio","prensa","preso","previo","primo","príncipe","prisión","privar","proa","probar","proceso","producto","proeza","profesor","programa","prole","promesa","pronto","propio","próximo","prueba","público","puchero","pudor","pueblo","puerta","puesto","pulga","pulir","pulmón","pulpo","pulso","puma","punto","puñal","puño","pupa","pupila","puré","quedar","queja","quemar","querer","queso","quieto","química","quince","quitar","rábano","rabia","rabo","ración","radical","raíz","rama","rampa","rancho","rango","rapaz","rápido","rapto","rasgo","raspa","rato","rayo","raza","razón","reacción","realidad","rebaño","rebote","recaer","receta","rechazo","recoger","recreo","recto","recurso","red","redondo","reducir","reflejo","reforma","refrán","refugio","regalo","regir","regla","regreso","rehén","reino","reír","reja","relato","relevo","relieve","relleno","reloj","remar","remedio","remo","rencor","rendir","renta","reparto","repetir","reposo","reptil","res","rescate","resina","respeto","resto","resumen","retiro","retorno","retrato","reunir","revés","revista","rey","rezar","rico","riego","rienda","riesgo","rifa","rígido","rigor","rincón","riñón","río","riqueza","risa","ritmo","rito","rizo","roble","roce","rociar","rodar","rodeo","rodilla","roer","rojizo","rojo","romero","romper","ron","ronco","ronda","ropa","ropero","rosa","rosca","rostro","rotar","rubí","rubor","rudo","rueda","rugir","ruido","ruina","ruleta","rulo","rumbo","rumor","ruptura","ruta","rutina","sábado","saber","sabio","sable","sacar","sagaz","sagrado","sala","saldo","salero","salir","salmón","salón","salsa","salto","salud","salvar","samba","sanción","sandía","sanear","sangre","sanidad","sano","santo","sapo","saque","sardina","sartén","sastre","satán","sauna","saxofón","sección","seco","secreto","secta","sed","seguir","seis","sello","selva","semana","semilla","senda","sensor","señal","señor","separar","sepia","sequía","ser","serie","sermón","servir","sesenta","sesión","seta","setenta","severo","sexo","sexto","sidra","siesta","siete","siglo","signo","sílaba","silbar","silencio","silla","símbolo","simio","sirena","sistema","sitio","situar","sobre","socio","sodio","sol","solapa","soldado","soledad","sólido","soltar","solución","sombra","sondeo","sonido","sonoro","sonrisa","sopa","soplar","soporte","sordo","sorpresa","sorteo","sostén","sótano","suave","subir","suceso","sudor","suegra","suelo","sueño","suerte","sufrir","sujeto","sultán","sumar","superar","suplir","suponer","supremo","sur","surco","sureño","surgir","susto","sutil","tabaco","tabique","tabla","tabú","taco","tacto","tajo","talar","talco","talento","talla","talón","tamaño","tambor","tango","tanque","tapa","tapete","tapia","tapón","taquilla","tarde","tarea","tarifa","tarjeta","tarot","tarro","tarta","tatuaje","tauro","taza","tazón","teatro","techo","tecla","técnica","tejado","tejer","tejido","tela","teléfono","tema","temor","templo","tenaz","tender","tener","tenis","tenso","teoría","terapia","terco","término","ternura","terror","tesis","tesoro","testigo","tetera","texto","tez","tibio","tiburón","tiempo","tienda","tierra","tieso","tigre","tijera","tilde","timbre","tímido","timo","tinta","tío","típico","tipo","tira","tirón","titán","títere","título","tiza","toalla","tobillo","tocar","tocino","todo","toga","toldo","tomar","tono","tonto","topar","tope","toque","tórax","torero","tormenta","torneo","toro","torpedo","torre","torso","tortuga","tos","tosco","toser","tóxico","trabajo","tractor","traer","tráfico","trago","traje","tramo","trance","trato","trauma","trazar","trébol","tregua","treinta","tren","trepar","tres","tribu","trigo","tripa","triste","triunfo","trofeo","trompa","tronco","tropa","trote","trozo","truco","trueno","trufa","tubería","tubo","tuerto","tumba","tumor","túnel","túnica","turbina","turismo","turno","tutor","ubicar","úlcera","umbral","unidad","unir","universo","uno","untar","uña","urbano","urbe","urgente","urna","usar","usuario","útil","utopía","uva","vaca","vacío","vacuna","vagar","vago","vaina","vajilla","vale","válido","valle","valor","válvula","vampiro","vara","variar","varón","vaso","vecino","vector","vehículo","veinte","vejez","vela","velero","veloz","vena","vencer","venda","veneno","vengar","venir","venta","venus","ver","verano","verbo","verde","vereda","verja","verso","verter","vía","viaje","vibrar","vicio","víctima","vida","vídeo","vidrio","viejo","viernes","vigor","vil","villa","vinagre","vino","viñedo","violín","viral","virgo","virtud","visor","víspera","vista","vitamina","viudo","vivaz","vivero","vivir","vivo","volcán","volumen","volver","voraz","votar","voto","voz","vuelo","vulgar","yacer","yate","yegua","yema","yerno","yeso","yodo","yoga","yogur","zafiro","zanja","zapato","zarza","zona","zorro","zumo","zurdo"]'),require$$7=JSON.parse('["あいこくしん","あいさつ","あいだ","あおぞら","あかちゃん","あきる","あけがた","あける","あこがれる","あさい","あさひ","あしあと","あじわう","あずかる","あずき","あそぶ","あたえる","あたためる","あたりまえ","あたる","あつい","あつかう","あっしゅく","あつまり","あつめる","あてな","あてはまる","あひる","あぶら","あぶる","あふれる","あまい","あまど","あまやかす","あまり","あみもの","あめりか","あやまる","あゆむ","あらいぐま","あらし","あらすじ","あらためる","あらゆる","あらわす","ありがとう","あわせる","あわてる","あんい","あんがい","あんこ","あんぜん","あんてい","あんない","あんまり","いいだす","いおん","いがい","いがく","いきおい","いきなり","いきもの","いきる","いくじ","いくぶん","いけばな","いけん","いこう","いこく","いこつ","いさましい","いさん","いしき","いじゅう","いじょう","いじわる","いずみ","いずれ","いせい","いせえび","いせかい","いせき","いぜん","いそうろう","いそがしい","いだい","いだく","いたずら","いたみ","いたりあ","いちおう","いちじ","いちど","いちば","いちぶ","いちりゅう","いつか","いっしゅん","いっせい","いっそう","いったん","いっち","いってい","いっぽう","いてざ","いてん","いどう","いとこ","いない","いなか","いねむり","いのち","いのる","いはつ","いばる","いはん","いびき","いひん","いふく","いへん","いほう","いみん","いもうと","いもたれ","いもり","いやがる","いやす","いよかん","いよく","いらい","いらすと","いりぐち","いりょう","いれい","いれもの","いれる","いろえんぴつ","いわい","いわう","いわかん","いわば","いわゆる","いんげんまめ","いんさつ","いんしょう","いんよう","うえき","うえる","うおざ","うがい","うかぶ","うかべる","うきわ","うくらいな","うくれれ","うけたまわる","うけつけ","うけとる","うけもつ","うける","うごかす","うごく","うこん","うさぎ","うしなう","うしろがみ","うすい","うすぎ","うすぐらい","うすめる","うせつ","うちあわせ","うちがわ","うちき","うちゅう","うっかり","うつくしい","うったえる","うつる","うどん","うなぎ","うなじ","うなずく","うなる","うねる","うのう","うぶげ","うぶごえ","うまれる","うめる","うもう","うやまう","うよく","うらがえす","うらぐち","うらない","うりあげ","うりきれ","うるさい","うれしい","うれゆき","うれる","うろこ","うわき","うわさ","うんこう","うんちん","うんてん","うんどう","えいえん","えいが","えいきょう","えいご","えいせい","えいぶん","えいよう","えいわ","えおり","えがお","えがく","えきたい","えくせる","えしゃく","えすて","えつらん","えのぐ","えほうまき","えほん","えまき","えもじ","えもの","えらい","えらぶ","えりあ","えんえん","えんかい","えんぎ","えんげき","えんしゅう","えんぜつ","えんそく","えんちょう","えんとつ","おいかける","おいこす","おいしい","おいつく","おうえん","おうさま","おうじ","おうせつ","おうたい","おうふく","おうべい","おうよう","おえる","おおい","おおう","おおどおり","おおや","おおよそ","おかえり","おかず","おがむ","おかわり","おぎなう","おきる","おくさま","おくじょう","おくりがな","おくる","おくれる","おこす","おこなう","おこる","おさえる","おさない","おさめる","おしいれ","おしえる","おじぎ","おじさん","おしゃれ","おそらく","おそわる","おたがい","おたく","おだやか","おちつく","おっと","おつり","おでかけ","おとしもの","おとなしい","おどり","おどろかす","おばさん","おまいり","おめでとう","おもいで","おもう","おもたい","おもちゃ","おやつ","おやゆび","およぼす","おらんだ","おろす","おんがく","おんけい","おんしゃ","おんせん","おんだん","おんちゅう","おんどけい","かあつ","かいが","がいき","がいけん","がいこう","かいさつ","かいしゃ","かいすいよく","かいぜん","かいぞうど","かいつう","かいてん","かいとう","かいふく","がいへき","かいほう","かいよう","がいらい","かいわ","かえる","かおり","かかえる","かがく","かがし","かがみ","かくご","かくとく","かざる","がぞう","かたい","かたち","がちょう","がっきゅう","がっこう","がっさん","がっしょう","かなざわし","かのう","がはく","かぶか","かほう","かほご","かまう","かまぼこ","かめれおん","かゆい","かようび","からい","かるい","かろう","かわく","かわら","がんか","かんけい","かんこう","かんしゃ","かんそう","かんたん","かんち","がんばる","きあい","きあつ","きいろ","ぎいん","きうい","きうん","きえる","きおう","きおく","きおち","きおん","きかい","きかく","きかんしゃ","ききて","きくばり","きくらげ","きけんせい","きこう","きこえる","きこく","きさい","きさく","きさま","きさらぎ","ぎじかがく","ぎしき","ぎじたいけん","ぎじにってい","ぎじゅつしゃ","きすう","きせい","きせき","きせつ","きそう","きぞく","きぞん","きたえる","きちょう","きつえん","ぎっちり","きつつき","きつね","きてい","きどう","きどく","きない","きなが","きなこ","きぬごし","きねん","きのう","きのした","きはく","きびしい","きひん","きふく","きぶん","きぼう","きほん","きまる","きみつ","きむずかしい","きめる","きもだめし","きもち","きもの","きゃく","きやく","ぎゅうにく","きよう","きょうりゅう","きらい","きらく","きりん","きれい","きれつ","きろく","ぎろん","きわめる","ぎんいろ","きんかくじ","きんじょ","きんようび","ぐあい","くいず","くうかん","くうき","くうぐん","くうこう","ぐうせい","くうそう","ぐうたら","くうふく","くうぼ","くかん","くきょう","くげん","ぐこう","くさい","くさき","くさばな","くさる","くしゃみ","くしょう","くすのき","くすりゆび","くせげ","くせん","ぐたいてき","くださる","くたびれる","くちこみ","くちさき","くつした","ぐっすり","くつろぐ","くとうてん","くどく","くなん","くねくね","くのう","くふう","くみあわせ","くみたてる","くめる","くやくしょ","くらす","くらべる","くるま","くれる","くろう","くわしい","ぐんかん","ぐんしょく","ぐんたい","ぐんて","けあな","けいかく","けいけん","けいこ","けいさつ","げいじゅつ","けいたい","げいのうじん","けいれき","けいろ","けおとす","けおりもの","げきか","げきげん","げきだん","げきちん","げきとつ","げきは","げきやく","げこう","げこくじょう","げざい","けさき","げざん","けしき","けしごむ","けしょう","げすと","けたば","けちゃっぷ","けちらす","けつあつ","けつい","けつえき","けっこん","けつじょ","けっせき","けってい","けつまつ","げつようび","げつれい","けつろん","げどく","けとばす","けとる","けなげ","けなす","けなみ","けぬき","げねつ","けねん","けはい","げひん","けぶかい","げぼく","けまり","けみかる","けむし","けむり","けもの","けらい","けろけろ","けわしい","けんい","けんえつ","けんお","けんか","げんき","けんげん","けんこう","けんさく","けんしゅう","けんすう","げんそう","けんちく","けんてい","けんとう","けんない","けんにん","げんぶつ","けんま","けんみん","けんめい","けんらん","けんり","こあくま","こいぬ","こいびと","ごうい","こうえん","こうおん","こうかん","ごうきゅう","ごうけい","こうこう","こうさい","こうじ","こうすい","ごうせい","こうそく","こうたい","こうちゃ","こうつう","こうてい","こうどう","こうない","こうはい","ごうほう","ごうまん","こうもく","こうりつ","こえる","こおり","ごかい","ごがつ","ごかん","こくご","こくさい","こくとう","こくない","こくはく","こぐま","こけい","こける","ここのか","こころ","こさめ","こしつ","こすう","こせい","こせき","こぜん","こそだて","こたい","こたえる","こたつ","こちょう","こっか","こつこつ","こつばん","こつぶ","こてい","こてん","ことがら","ことし","ことば","ことり","こなごな","こねこね","このまま","このみ","このよ","ごはん","こひつじ","こふう","こふん","こぼれる","ごまあぶら","こまかい","ごますり","こまつな","こまる","こむぎこ","こもじ","こもち","こもの","こもん","こやく","こやま","こゆう","こゆび","こよい","こよう","こりる","これくしょん","ころっけ","こわもて","こわれる","こんいん","こんかい","こんき","こんしゅう","こんすい","こんだて","こんとん","こんなん","こんびに","こんぽん","こんまけ","こんや","こんれい","こんわく","ざいえき","さいかい","さいきん","ざいげん","ざいこ","さいしょ","さいせい","ざいたく","ざいちゅう","さいてき","ざいりょう","さうな","さかいし","さがす","さかな","さかみち","さがる","さぎょう","さくし","さくひん","さくら","さこく","さこつ","さずかる","ざせき","さたん","さつえい","ざつおん","ざっか","ざつがく","さっきょく","ざっし","さつじん","ざっそう","さつたば","さつまいも","さてい","さといも","さとう","さとおや","さとし","さとる","さのう","さばく","さびしい","さべつ","さほう","さほど","さます","さみしい","さみだれ","さむけ","さめる","さやえんどう","さゆう","さよう","さよく","さらだ","ざるそば","さわやか","さわる","さんいん","さんか","さんきゃく","さんこう","さんさい","ざんしょ","さんすう","さんせい","さんそ","さんち","さんま","さんみ","さんらん","しあい","しあげ","しあさって","しあわせ","しいく","しいん","しうち","しえい","しおけ","しかい","しかく","じかん","しごと","しすう","じだい","したうけ","したぎ","したて","したみ","しちょう","しちりん","しっかり","しつじ","しつもん","してい","してき","してつ","じてん","じどう","しなぎれ","しなもの","しなん","しねま","しねん","しのぐ","しのぶ","しはい","しばかり","しはつ","しはらい","しはん","しひょう","しふく","じぶん","しへい","しほう","しほん","しまう","しまる","しみん","しむける","じむしょ","しめい","しめる","しもん","しゃいん","しゃうん","しゃおん","じゃがいも","しやくしょ","しゃくほう","しゃけん","しゃこ","しゃざい","しゃしん","しゃせん","しゃそう","しゃたい","しゃちょう","しゃっきん","じゃま","しゃりん","しゃれい","じゆう","じゅうしょ","しゅくはく","じゅしん","しゅっせき","しゅみ","しゅらば","じゅんばん","しょうかい","しょくたく","しょっけん","しょどう","しょもつ","しらせる","しらべる","しんか","しんこう","じんじゃ","しんせいじ","しんちく","しんりん","すあげ","すあし","すあな","ずあん","すいえい","すいか","すいとう","ずいぶん","すいようび","すうがく","すうじつ","すうせん","すおどり","すきま","すくう","すくない","すける","すごい","すこし","ずさん","すずしい","すすむ","すすめる","すっかり","ずっしり","ずっと","すてき","すてる","すねる","すのこ","すはだ","すばらしい","ずひょう","ずぶぬれ","すぶり","すふれ","すべて","すべる","ずほう","すぼん","すまい","すめし","すもう","すやき","すらすら","するめ","すれちがう","すろっと","すわる","すんぜん","すんぽう","せあぶら","せいかつ","せいげん","せいじ","せいよう","せおう","せかいかん","せきにん","せきむ","せきゆ","せきらんうん","せけん","せこう","せすじ","せたい","せたけ","せっかく","せっきゃく","ぜっく","せっけん","せっこつ","せっさたくま","せつぞく","せつだん","せつでん","せっぱん","せつび","せつぶん","せつめい","せつりつ","せなか","せのび","せはば","せびろ","せぼね","せまい","せまる","せめる","せもたれ","せりふ","ぜんあく","せんい","せんえい","せんか","せんきょ","せんく","せんげん","ぜんご","せんさい","せんしゅ","せんすい","せんせい","せんぞ","せんたく","せんちょう","せんてい","せんとう","せんぬき","せんねん","せんぱい","ぜんぶ","ぜんぽう","せんむ","せんめんじょ","せんもん","せんやく","せんゆう","せんよう","ぜんら","ぜんりゃく","せんれい","せんろ","そあく","そいとげる","そいね","そうがんきょう","そうき","そうご","そうしん","そうだん","そうなん","そうび","そうめん","そうり","そえもの","そえん","そがい","そげき","そこう","そこそこ","そざい","そしな","そせい","そせん","そそぐ","そだてる","そつう","そつえん","そっかん","そつぎょう","そっけつ","そっこう","そっせん","そっと","そとがわ","そとづら","そなえる","そなた","そふぼ","そぼく","そぼろ","そまつ","そまる","そむく","そむりえ","そめる","そもそも","そよかぜ","そらまめ","そろう","そんかい","そんけい","そんざい","そんしつ","そんぞく","そんちょう","ぞんび","ぞんぶん","そんみん","たあい","たいいん","たいうん","たいえき","たいおう","だいがく","たいき","たいぐう","たいけん","たいこ","たいざい","だいじょうぶ","だいすき","たいせつ","たいそう","だいたい","たいちょう","たいてい","だいどころ","たいない","たいねつ","たいのう","たいはん","だいひょう","たいふう","たいへん","たいほ","たいまつばな","たいみんぐ","たいむ","たいめん","たいやき","たいよう","たいら","たいりょく","たいる","たいわん","たうえ","たえる","たおす","たおる","たおれる","たかい","たかね","たきび","たくさん","たこく","たこやき","たさい","たしざん","だじゃれ","たすける","たずさわる","たそがれ","たたかう","たたく","ただしい","たたみ","たちばな","だっかい","だっきゃく","だっこ","だっしゅつ","だったい","たてる","たとえる","たなばた","たにん","たぬき","たのしみ","たはつ","たぶん","たべる","たぼう","たまご","たまる","だむる","ためいき","ためす","ためる","たもつ","たやすい","たよる","たらす","たりきほんがん","たりょう","たりる","たると","たれる","たれんと","たろっと","たわむれる","だんあつ","たんい","たんおん","たんか","たんき","たんけん","たんご","たんさん","たんじょうび","だんせい","たんそく","たんたい","だんち","たんてい","たんとう","だんな","たんにん","だんねつ","たんのう","たんぴん","だんぼう","たんまつ","たんめい","だんれつ","だんろ","だんわ","ちあい","ちあん","ちいき","ちいさい","ちえん","ちかい","ちから","ちきゅう","ちきん","ちけいず","ちけん","ちこく","ちさい","ちしき","ちしりょう","ちせい","ちそう","ちたい","ちたん","ちちおや","ちつじょ","ちてき","ちてん","ちぬき","ちぬり","ちのう","ちひょう","ちへいせん","ちほう","ちまた","ちみつ","ちみどろ","ちめいど","ちゃんこなべ","ちゅうい","ちゆりょく","ちょうし","ちょさくけん","ちらし","ちらみ","ちりがみ","ちりょう","ちるど","ちわわ","ちんたい","ちんもく","ついか","ついたち","つうか","つうじょう","つうはん","つうわ","つかう","つかれる","つくね","つくる","つけね","つける","つごう","つたえる","つづく","つつじ","つつむ","つとめる","つながる","つなみ","つねづね","つのる","つぶす","つまらない","つまる","つみき","つめたい","つもり","つもる","つよい","つるぼ","つるみく","つわもの","つわり","てあし","てあて","てあみ","ていおん","ていか","ていき","ていけい","ていこく","ていさつ","ていし","ていせい","ていたい","ていど","ていねい","ていひょう","ていへん","ていぼう","てうち","ておくれ","てきとう","てくび","でこぼこ","てさぎょう","てさげ","てすり","てそう","てちがい","てちょう","てつがく","てつづき","でっぱ","てつぼう","てつや","でぬかえ","てぬき","てぬぐい","てのひら","てはい","てぶくろ","てふだ","てほどき","てほん","てまえ","てまきずし","てみじか","てみやげ","てらす","てれび","てわけ","てわたし","でんあつ","てんいん","てんかい","てんき","てんぐ","てんけん","てんごく","てんさい","てんし","てんすう","でんち","てんてき","てんとう","てんない","てんぷら","てんぼうだい","てんめつ","てんらんかい","でんりょく","でんわ","どあい","といれ","どうかん","とうきゅう","どうぐ","とうし","とうむぎ","とおい","とおか","とおく","とおす","とおる","とかい","とかす","ときおり","ときどき","とくい","とくしゅう","とくてん","とくに","とくべつ","とけい","とける","とこや","とさか","としょかん","とそう","とたん","とちゅう","とっきゅう","とっくん","とつぜん","とつにゅう","とどける","ととのえる","とない","となえる","となり","とのさま","とばす","どぶがわ","とほう","とまる","とめる","ともだち","ともる","どようび","とらえる","とんかつ","どんぶり","ないかく","ないこう","ないしょ","ないす","ないせん","ないそう","なおす","ながい","なくす","なげる","なこうど","なさけ","なたでここ","なっとう","なつやすみ","ななおし","なにごと","なにもの","なにわ","なのか","なふだ","なまいき","なまえ","なまみ","なみだ","なめらか","なめる","なやむ","ならう","ならび","ならぶ","なれる","なわとび","なわばり","にあう","にいがた","にうけ","におい","にかい","にがて","にきび","にくしみ","にくまん","にげる","にさんかたんそ","にしき","にせもの","にちじょう","にちようび","にっか","にっき","にっけい","にっこう","にっさん","にっしょく","にっすう","にっせき","にってい","になう","にほん","にまめ","にもつ","にやり","にゅういん","にりんしゃ","にわとり","にんい","にんか","にんき","にんげん","にんしき","にんずう","にんそう","にんたい","にんち","にんてい","にんにく","にんぷ","にんまり","にんむ","にんめい","にんよう","ぬいくぎ","ぬかす","ぬぐいとる","ぬぐう","ぬくもり","ぬすむ","ぬまえび","ぬめり","ぬらす","ぬんちゃく","ねあげ","ねいき","ねいる","ねいろ","ねぐせ","ねくたい","ねくら","ねこぜ","ねこむ","ねさげ","ねすごす","ねそべる","ねだん","ねつい","ねっしん","ねつぞう","ねったいぎょ","ねぶそく","ねふだ","ねぼう","ねほりはほり","ねまき","ねまわし","ねみみ","ねむい","ねむたい","ねもと","ねらう","ねわざ","ねんいり","ねんおし","ねんかん","ねんきん","ねんぐ","ねんざ","ねんし","ねんちゃく","ねんど","ねんぴ","ねんぶつ","ねんまつ","ねんりょう","ねんれい","のいず","のおづま","のがす","のきなみ","のこぎり","のこす","のこる","のせる","のぞく","のぞむ","のたまう","のちほど","のっく","のばす","のはら","のべる","のぼる","のみもの","のやま","のらいぬ","のらねこ","のりもの","のりゆき","のれん","のんき","ばあい","はあく","ばあさん","ばいか","ばいく","はいけん","はいご","はいしん","はいすい","はいせん","はいそう","はいち","ばいばい","はいれつ","はえる","はおる","はかい","ばかり","はかる","はくしゅ","はけん","はこぶ","はさみ","はさん","はしご","ばしょ","はしる","はせる","ぱそこん","はそん","はたん","はちみつ","はつおん","はっかく","はづき","はっきり","はっくつ","はっけん","はっこう","はっさん","はっしん","はったつ","はっちゅう","はってん","はっぴょう","はっぽう","はなす","はなび","はにかむ","はぶらし","はみがき","はむかう","はめつ","はやい","はやし","はらう","はろうぃん","はわい","はんい","はんえい","はんおん","はんかく","はんきょう","ばんぐみ","はんこ","はんしゃ","はんすう","はんだん","ぱんち","ぱんつ","はんてい","はんとし","はんのう","はんぱ","はんぶん","はんぺん","はんぼうき","はんめい","はんらん","はんろん","ひいき","ひうん","ひえる","ひかく","ひかり","ひかる","ひかん","ひくい","ひけつ","ひこうき","ひこく","ひさい","ひさしぶり","ひさん","びじゅつかん","ひしょ","ひそか","ひそむ","ひたむき","ひだり","ひたる","ひつぎ","ひっこし","ひっし","ひつじゅひん","ひっす","ひつぜん","ぴったり","ぴっちり","ひつよう","ひてい","ひとごみ","ひなまつり","ひなん","ひねる","ひはん","ひびく","ひひょう","ひほう","ひまわり","ひまん","ひみつ","ひめい","ひめじし","ひやけ","ひやす","ひよう","びょうき","ひらがな","ひらく","ひりつ","ひりょう","ひるま","ひるやすみ","ひれい","ひろい","ひろう","ひろき","ひろゆき","ひんかく","ひんけつ","ひんこん","ひんしゅ","ひんそう","ぴんち","ひんぱん","びんぼう","ふあん","ふいうち","ふうけい","ふうせん","ぷうたろう","ふうとう","ふうふ","ふえる","ふおん","ふかい","ふきん","ふくざつ","ふくぶくろ","ふこう","ふさい","ふしぎ","ふじみ","ふすま","ふせい","ふせぐ","ふそく","ぶたにく","ふたん","ふちょう","ふつう","ふつか","ふっかつ","ふっき","ふっこく","ぶどう","ふとる","ふとん","ふのう","ふはい","ふひょう","ふへん","ふまん","ふみん","ふめつ","ふめん","ふよう","ふりこ","ふりる","ふるい","ふんいき","ぶんがく","ぶんぐ","ふんしつ","ぶんせき","ふんそう","ぶんぽう","へいあん","へいおん","へいがい","へいき","へいげん","へいこう","へいさ","へいしゃ","へいせつ","へいそ","へいたく","へいてん","へいねつ","へいわ","へきが","へこむ","べにいろ","べにしょうが","へらす","へんかん","べんきょう","べんごし","へんさい","へんたい","べんり","ほあん","ほいく","ぼうぎょ","ほうこく","ほうそう","ほうほう","ほうもん","ほうりつ","ほえる","ほおん","ほかん","ほきょう","ぼきん","ほくろ","ほけつ","ほけん","ほこう","ほこる","ほしい","ほしつ","ほしゅ","ほしょう","ほせい","ほそい","ほそく","ほたて","ほたる","ぽちぶくろ","ほっきょく","ほっさ","ほったん","ほとんど","ほめる","ほんい","ほんき","ほんけ","ほんしつ","ほんやく","まいにち","まかい","まかせる","まがる","まける","まこと","まさつ","まじめ","ますく","まぜる","まつり","まとめ","まなぶ","まぬけ","まねく","まほう","まもる","まゆげ","まよう","まろやか","まわす","まわり","まわる","まんが","まんきつ","まんぞく","まんなか","みいら","みうち","みえる","みがく","みかた","みかん","みけん","みこん","みじかい","みすい","みすえる","みせる","みっか","みつかる","みつける","みてい","みとめる","みなと","みなみかさい","みねらる","みのう","みのがす","みほん","みもと","みやげ","みらい","みりょく","みわく","みんか","みんぞく","むいか","むえき","むえん","むかい","むかう","むかえ","むかし","むぎちゃ","むける","むげん","むさぼる","むしあつい","むしば","むじゅん","むしろ","むすう","むすこ","むすぶ","むすめ","むせる","むせん","むちゅう","むなしい","むのう","むやみ","むよう","むらさき","むりょう","むろん","めいあん","めいうん","めいえん","めいかく","めいきょく","めいさい","めいし","めいそう","めいぶつ","めいれい","めいわく","めぐまれる","めざす","めした","めずらしい","めだつ","めまい","めやす","めんきょ","めんせき","めんどう","もうしあげる","もうどうけん","もえる","もくし","もくてき","もくようび","もちろん","もどる","もらう","もんく","もんだい","やおや","やける","やさい","やさしい","やすい","やすたろう","やすみ","やせる","やそう","やたい","やちん","やっと","やっぱり","やぶる","やめる","ややこしい","やよい","やわらかい","ゆうき","ゆうびんきょく","ゆうべ","ゆうめい","ゆけつ","ゆしゅつ","ゆせん","ゆそう","ゆたか","ゆちゃく","ゆでる","ゆにゅう","ゆびわ","ゆらい","ゆれる","ようい","ようか","ようきゅう","ようじ","ようす","ようちえん","よかぜ","よかん","よきん","よくせい","よくぼう","よけい","よごれる","よさん","よしゅう","よそう","よそく","よっか","よてい","よどがわく","よねつ","よやく","よゆう","よろこぶ","よろしい","らいう","らくがき","らくご","らくさつ","らくだ","らしんばん","らせん","らぞく","らたい","らっか","られつ","りえき","りかい","りきさく","りきせつ","りくぐん","りくつ","りけん","りこう","りせい","りそう","りそく","りてん","りねん","りゆう","りゅうがく","りよう","りょうり","りょかん","りょくちゃ","りょこう","りりく","りれき","りろん","りんご","るいけい","るいさい","るいじ","るいせき","るすばん","るりがわら","れいかん","れいぎ","れいせい","れいぞうこ","れいとう","れいぼう","れきし","れきだい","れんあい","れんけい","れんこん","れんさい","れんしゅう","れんぞく","れんらく","ろうか","ろうご","ろうじん","ろうそく","ろくが","ろこつ","ろじうら","ろしゅつ","ろせん","ろてん","ろめん","ろれつ","ろんぎ","ろんぱ","ろんぶん","ろんり","わかす","わかめ","わかやま","わかれる","わしつ","わじまし","わすれもの","わらう","われる"]'),require$$8=JSON.parse('["abacate","abaixo","abalar","abater","abduzir","abelha","aberto","abismo","abotoar","abranger","abreviar","abrigar","abrupto","absinto","absoluto","absurdo","abutre","acabado","acalmar","acampar","acanhar","acaso","aceitar","acelerar","acenar","acervo","acessar","acetona","achatar","acidez","acima","acionado","acirrar","aclamar","aclive","acolhida","acomodar","acoplar","acordar","acumular","acusador","adaptar","adega","adentro","adepto","adequar","aderente","adesivo","adeus","adiante","aditivo","adjetivo","adjunto","admirar","adorar","adquirir","adubo","adverso","advogado","aeronave","afastar","aferir","afetivo","afinador","afivelar","aflito","afluente","afrontar","agachar","agarrar","agasalho","agenciar","agilizar","agiota","agitado","agora","agradar","agreste","agrupar","aguardar","agulha","ajoelhar","ajudar","ajustar","alameda","alarme","alastrar","alavanca","albergue","albino","alcatra","aldeia","alecrim","alegria","alertar","alface","alfinete","algum","alheio","aliar","alicate","alienar","alinhar","aliviar","almofada","alocar","alpiste","alterar","altitude","alucinar","alugar","aluno","alusivo","alvo","amaciar","amador","amarelo","amassar","ambas","ambiente","ameixa","amenizar","amido","amistoso","amizade","amolador","amontoar","amoroso","amostra","amparar","ampliar","ampola","anagrama","analisar","anarquia","anatomia","andaime","anel","anexo","angular","animar","anjo","anomalia","anotado","ansioso","anterior","anuidade","anunciar","anzol","apagador","apalpar","apanhado","apego","apelido","apertada","apesar","apetite","apito","aplauso","aplicada","apoio","apontar","aposta","aprendiz","aprovar","aquecer","arame","aranha","arara","arcada","ardente","areia","arejar","arenito","aresta","argiloso","argola","arma","arquivo","arraial","arrebate","arriscar","arroba","arrumar","arsenal","arterial","artigo","arvoredo","asfaltar","asilado","aspirar","assador","assinar","assoalho","assunto","astral","atacado","atadura","atalho","atarefar","atear","atender","aterro","ateu","atingir","atirador","ativo","atoleiro","atracar","atrevido","atriz","atual","atum","auditor","aumentar","aura","aurora","autismo","autoria","autuar","avaliar","avante","avaria","avental","avesso","aviador","avisar","avulso","axila","azarar","azedo","azeite","azulejo","babar","babosa","bacalhau","bacharel","bacia","bagagem","baiano","bailar","baioneta","bairro","baixista","bajular","baleia","baliza","balsa","banal","bandeira","banho","banir","banquete","barato","barbado","baronesa","barraca","barulho","baseado","bastante","batata","batedor","batida","batom","batucar","baunilha","beber","beijo","beirada","beisebol","beldade","beleza","belga","beliscar","bendito","bengala","benzer","berimbau","berlinda","berro","besouro","bexiga","bezerro","bico","bicudo","bienal","bifocal","bifurcar","bigorna","bilhete","bimestre","bimotor","biologia","biombo","biosfera","bipolar","birrento","biscoito","bisneto","bispo","bissexto","bitola","bizarro","blindado","bloco","bloquear","boato","bobagem","bocado","bocejo","bochecha","boicotar","bolada","boletim","bolha","bolo","bombeiro","bonde","boneco","bonita","borbulha","borda","boreal","borracha","bovino","boxeador","branco","brasa","braveza","breu","briga","brilho","brincar","broa","brochura","bronzear","broto","bruxo","bucha","budismo","bufar","bule","buraco","busca","busto","buzina","cabana","cabelo","cabide","cabo","cabrito","cacau","cacetada","cachorro","cacique","cadastro","cadeado","cafezal","caiaque","caipira","caixote","cajado","caju","calafrio","calcular","caldeira","calibrar","calmante","calota","camada","cambista","camisa","camomila","campanha","camuflar","canavial","cancelar","caneta","canguru","canhoto","canivete","canoa","cansado","cantar","canudo","capacho","capela","capinar","capotar","capricho","captador","capuz","caracol","carbono","cardeal","careca","carimbar","carneiro","carpete","carreira","cartaz","carvalho","casaco","casca","casebre","castelo","casulo","catarata","cativar","caule","causador","cautelar","cavalo","caverna","cebola","cedilha","cegonha","celebrar","celular","cenoura","censo","centeio","cercar","cerrado","certeiro","cerveja","cetim","cevada","chacota","chaleira","chamado","chapada","charme","chatice","chave","chefe","chegada","cheiro","cheque","chicote","chifre","chinelo","chocalho","chover","chumbo","chutar","chuva","cicatriz","ciclone","cidade","cidreira","ciente","cigana","cimento","cinto","cinza","ciranda","circuito","cirurgia","citar","clareza","clero","clicar","clone","clube","coado","coagir","cobaia","cobertor","cobrar","cocada","coelho","coentro","coeso","cogumelo","coibir","coifa","coiote","colar","coleira","colher","colidir","colmeia","colono","coluna","comando","combinar","comentar","comitiva","comover","complexo","comum","concha","condor","conectar","confuso","congelar","conhecer","conjugar","consumir","contrato","convite","cooperar","copeiro","copiador","copo","coquetel","coragem","cordial","corneta","coronha","corporal","correio","cortejo","coruja","corvo","cosseno","costela","cotonete","couro","couve","covil","cozinha","cratera","cravo","creche","credor","creme","crer","crespo","criada","criminal","crioulo","crise","criticar","crosta","crua","cruzeiro","cubano","cueca","cuidado","cujo","culatra","culminar","culpar","cultura","cumprir","cunhado","cupido","curativo","curral","cursar","curto","cuspir","custear","cutelo","damasco","datar","debater","debitar","deboche","debulhar","decalque","decimal","declive","decote","decretar","dedal","dedicado","deduzir","defesa","defumar","degelo","degrau","degustar","deitado","deixar","delator","delegado","delinear","delonga","demanda","demitir","demolido","dentista","depenado","depilar","depois","depressa","depurar","deriva","derramar","desafio","desbotar","descanso","desenho","desfiado","desgaste","desigual","deslize","desmamar","desova","despesa","destaque","desviar","detalhar","detentor","detonar","detrito","deusa","dever","devido","devotado","dezena","diagrama","dialeto","didata","difuso","digitar","dilatado","diluente","diminuir","dinastia","dinheiro","diocese","direto","discreta","disfarce","disparo","disquete","dissipar","distante","ditador","diurno","diverso","divisor","divulgar","dizer","dobrador","dolorido","domador","dominado","donativo","donzela","dormente","dorsal","dosagem","dourado","doutor","drenagem","drible","drogaria","duelar","duende","dueto","duplo","duquesa","durante","duvidoso","eclodir","ecoar","ecologia","edificar","edital","educado","efeito","efetivar","ejetar","elaborar","eleger","eleitor","elenco","elevador","eliminar","elogiar","embargo","embolado","embrulho","embutido","emenda","emergir","emissor","empatia","empenho","empinado","empolgar","emprego","empurrar","emulador","encaixe","encenado","enchente","encontro","endeusar","endossar","enfaixar","enfeite","enfim","engajado","engenho","englobar","engomado","engraxar","enguia","enjoar","enlatar","enquanto","enraizar","enrolado","enrugar","ensaio","enseada","ensino","ensopado","entanto","enteado","entidade","entortar","entrada","entulho","envergar","enviado","envolver","enxame","enxerto","enxofre","enxuto","epiderme","equipar","ereto","erguido","errata","erva","ervilha","esbanjar","esbelto","escama","escola","escrita","escuta","esfinge","esfolar","esfregar","esfumado","esgrima","esmalte","espanto","espelho","espiga","esponja","espreita","espumar","esquerda","estaca","esteira","esticar","estofado","estrela","estudo","esvaziar","etanol","etiqueta","euforia","europeu","evacuar","evaporar","evasivo","eventual","evidente","evoluir","exagero","exalar","examinar","exato","exausto","excesso","excitar","exclamar","executar","exemplo","exibir","exigente","exonerar","expandir","expelir","expirar","explanar","exposto","expresso","expulsar","externo","extinto","extrato","fabricar","fabuloso","faceta","facial","fada","fadiga","faixa","falar","falta","familiar","fandango","fanfarra","fantoche","fardado","farelo","farinha","farofa","farpa","fartura","fatia","fator","favorita","faxina","fazenda","fechado","feijoada","feirante","felino","feminino","fenda","feno","fera","feriado","ferrugem","ferver","festejar","fetal","feudal","fiapo","fibrose","ficar","ficheiro","figurado","fileira","filho","filme","filtrar","firmeza","fisgada","fissura","fita","fivela","fixador","fixo","flacidez","flamingo","flanela","flechada","flora","flutuar","fluxo","focal","focinho","fofocar","fogo","foguete","foice","folgado","folheto","forjar","formiga","forno","forte","fosco","fossa","fragata","fralda","frango","frasco","fraterno","freira","frente","fretar","frieza","friso","fritura","fronha","frustrar","fruteira","fugir","fulano","fuligem","fundar","fungo","funil","furador","furioso","futebol","gabarito","gabinete","gado","gaiato","gaiola","gaivota","galega","galho","galinha","galocha","ganhar","garagem","garfo","gargalo","garimpo","garoupa","garrafa","gasoduto","gasto","gata","gatilho","gaveta","gazela","gelado","geleia","gelo","gemada","gemer","gemido","generoso","gengiva","genial","genoma","genro","geologia","gerador","germinar","gesso","gestor","ginasta","gincana","gingado","girafa","girino","glacial","glicose","global","glorioso","goela","goiaba","golfe","golpear","gordura","gorjeta","gorro","gostoso","goteira","governar","gracejo","gradual","grafite","gralha","grampo","granada","gratuito","graveto","graxa","grego","grelhar","greve","grilo","grisalho","gritaria","grosso","grotesco","grudado","grunhido","gruta","guache","guarani","guaxinim","guerrear","guiar","guincho","guisado","gula","guloso","guru","habitar","harmonia","haste","haver","hectare","herdar","heresia","hesitar","hiato","hibernar","hidratar","hiena","hino","hipismo","hipnose","hipoteca","hoje","holofote","homem","honesto","honrado","hormonal","hospedar","humorado","iate","ideia","idoso","ignorado","igreja","iguana","ileso","ilha","iludido","iluminar","ilustrar","imagem","imediato","imenso","imersivo","iminente","imitador","imortal","impacto","impedir","implante","impor","imprensa","impune","imunizar","inalador","inapto","inativo","incenso","inchar","incidir","incluir","incolor","indeciso","indireto","indutor","ineficaz","inerente","infantil","infestar","infinito","inflamar","informal","infrator","ingerir","inibido","inicial","inimigo","injetar","inocente","inodoro","inovador","inox","inquieto","inscrito","inseto","insistir","inspetor","instalar","insulto","intacto","integral","intimar","intocado","intriga","invasor","inverno","invicto","invocar","iogurte","iraniano","ironizar","irreal","irritado","isca","isento","isolado","isqueiro","italiano","janeiro","jangada","janta","jararaca","jardim","jarro","jasmim","jato","javali","jazida","jejum","joaninha","joelhada","jogador","joia","jornal","jorrar","jovem","juba","judeu","judoca","juiz","julgador","julho","jurado","jurista","juro","justa","labareda","laboral","lacre","lactante","ladrilho","lagarta","lagoa","laje","lamber","lamentar","laminar","lampejo","lanche","lapidar","lapso","laranja","lareira","largura","lasanha","lastro","lateral","latido","lavanda","lavoura","lavrador","laxante","lazer","lealdade","lebre","legado","legendar","legista","leigo","leiloar","leitura","lembrete","leme","lenhador","lentilha","leoa","lesma","leste","letivo","letreiro","levar","leveza","levitar","liberal","libido","liderar","ligar","ligeiro","limitar","limoeiro","limpador","linda","linear","linhagem","liquidez","listagem","lisura","litoral","livro","lixa","lixeira","locador","locutor","lojista","lombo","lona","longe","lontra","lorde","lotado","loteria","loucura","lousa","louvar","luar","lucidez","lucro","luneta","lustre","lutador","luva","macaco","macete","machado","macio","madeira","madrinha","magnata","magreza","maior","mais","malandro","malha","malote","maluco","mamilo","mamoeiro","mamute","manada","mancha","mandato","manequim","manhoso","manivela","manobrar","mansa","manter","manusear","mapeado","maquinar","marcador","maresia","marfim","margem","marinho","marmita","maroto","marquise","marreco","martelo","marujo","mascote","masmorra","massagem","mastigar","matagal","materno","matinal","matutar","maxilar","medalha","medida","medusa","megafone","meiga","melancia","melhor","membro","memorial","menino","menos","mensagem","mental","merecer","mergulho","mesada","mesclar","mesmo","mesquita","mestre","metade","meteoro","metragem","mexer","mexicano","micro","migalha","migrar","milagre","milenar","milhar","mimado","minerar","minhoca","ministro","minoria","miolo","mirante","mirtilo","misturar","mocidade","moderno","modular","moeda","moer","moinho","moita","moldura","moleza","molho","molinete","molusco","montanha","moqueca","morango","morcego","mordomo","morena","mosaico","mosquete","mostarda","motel","motim","moto","motriz","muda","muito","mulata","mulher","multar","mundial","munido","muralha","murcho","muscular","museu","musical","nacional","nadador","naja","namoro","narina","narrado","nascer","nativa","natureza","navalha","navegar","navio","neblina","nebuloso","negativa","negociar","negrito","nervoso","neta","neural","nevasca","nevoeiro","ninar","ninho","nitidez","nivelar","nobreza","noite","noiva","nomear","nominal","nordeste","nortear","notar","noticiar","noturno","novelo","novilho","novo","nublado","nudez","numeral","nupcial","nutrir","nuvem","obcecado","obedecer","objetivo","obrigado","obscuro","obstetra","obter","obturar","ocidente","ocioso","ocorrer","oculista","ocupado","ofegante","ofensiva","oferenda","oficina","ofuscado","ogiva","olaria","oleoso","olhar","oliveira","ombro","omelete","omisso","omitir","ondulado","oneroso","ontem","opcional","operador","oponente","oportuno","oposto","orar","orbitar","ordem","ordinal","orfanato","orgasmo","orgulho","oriental","origem","oriundo","orla","ortodoxo","orvalho","oscilar","ossada","osso","ostentar","otimismo","ousadia","outono","outubro","ouvido","ovelha","ovular","oxidar","oxigenar","pacato","paciente","pacote","pactuar","padaria","padrinho","pagar","pagode","painel","pairar","paisagem","palavra","palestra","palheta","palito","palmada","palpitar","pancada","panela","panfleto","panqueca","pantanal","papagaio","papelada","papiro","parafina","parcial","pardal","parede","partida","pasmo","passado","pastel","patamar","patente","patinar","patrono","paulada","pausar","peculiar","pedalar","pedestre","pediatra","pedra","pegada","peitoral","peixe","pele","pelicano","penca","pendurar","peneira","penhasco","pensador","pente","perceber","perfeito","pergunta","perito","permitir","perna","perplexo","persiana","pertence","peruca","pescado","pesquisa","pessoa","petiscar","piada","picado","piedade","pigmento","pilastra","pilhado","pilotar","pimenta","pincel","pinguim","pinha","pinote","pintar","pioneiro","pipoca","piquete","piranha","pires","pirueta","piscar","pistola","pitanga","pivete","planta","plaqueta","platina","plebeu","plumagem","pluvial","pneu","poda","poeira","poetisa","polegada","policiar","poluente","polvilho","pomar","pomba","ponderar","pontaria","populoso","porta","possuir","postal","pote","poupar","pouso","povoar","praia","prancha","prato","praxe","prece","predador","prefeito","premiar","prensar","preparar","presilha","pretexto","prevenir","prezar","primata","princesa","prisma","privado","processo","produto","profeta","proibido","projeto","prometer","propagar","prosa","protetor","provador","publicar","pudim","pular","pulmonar","pulseira","punhal","punir","pupilo","pureza","puxador","quadra","quantia","quarto","quase","quebrar","queda","queijo","quente","querido","quimono","quina","quiosque","rabanada","rabisco","rachar","racionar","radial","raiar","rainha","raio","raiva","rajada","ralado","ramal","ranger","ranhura","rapadura","rapel","rapidez","raposa","raquete","raridade","rasante","rascunho","rasgar","raspador","rasteira","rasurar","ratazana","ratoeira","realeza","reanimar","reaver","rebaixar","rebelde","rebolar","recado","recente","recheio","recibo","recordar","recrutar","recuar","rede","redimir","redonda","reduzida","reenvio","refinar","refletir","refogar","refresco","refugiar","regalia","regime","regra","reinado","reitor","rejeitar","relativo","remador","remendo","remorso","renovado","reparo","repelir","repleto","repolho","represa","repudiar","requerer","resenha","resfriar","resgatar","residir","resolver","respeito","ressaca","restante","resumir","retalho","reter","retirar","retomada","retratar","revelar","revisor","revolta","riacho","rica","rigidez","rigoroso","rimar","ringue","risada","risco","risonho","robalo","rochedo","rodada","rodeio","rodovia","roedor","roleta","romano","roncar","rosado","roseira","rosto","rota","roteiro","rotina","rotular","rouco","roupa","roxo","rubro","rugido","rugoso","ruivo","rumo","rupestre","russo","sabor","saciar","sacola","sacudir","sadio","safira","saga","sagrada","saibro","salada","saleiro","salgado","saliva","salpicar","salsicha","saltar","salvador","sambar","samurai","sanar","sanfona","sangue","sanidade","sapato","sarda","sargento","sarjeta","saturar","saudade","saxofone","sazonal","secar","secular","seda","sedento","sediado","sedoso","sedutor","segmento","segredo","segundo","seiva","seleto","selvagem","semanal","semente","senador","senhor","sensual","sentado","separado","sereia","seringa","serra","servo","setembro","setor","sigilo","silhueta","silicone","simetria","simpatia","simular","sinal","sincero","singular","sinopse","sintonia","sirene","siri","situado","soberano","sobra","socorro","sogro","soja","solda","soletrar","solteiro","sombrio","sonata","sondar","sonegar","sonhador","sono","soprano","soquete","sorrir","sorteio","sossego","sotaque","soterrar","sovado","sozinho","suavizar","subida","submerso","subsolo","subtrair","sucata","sucesso","suco","sudeste","sufixo","sugador","sugerir","sujeito","sulfato","sumir","suor","superior","suplicar","suposto","suprimir","surdina","surfista","surpresa","surreal","surtir","suspiro","sustento","tabela","tablete","tabuada","tacho","tagarela","talher","talo","talvez","tamanho","tamborim","tampa","tangente","tanto","tapar","tapioca","tardio","tarefa","tarja","tarraxa","tatuagem","taurino","taxativo","taxista","teatral","tecer","tecido","teclado","tedioso","teia","teimar","telefone","telhado","tempero","tenente","tensor","tentar","termal","terno","terreno","tese","tesoura","testado","teto","textura","texugo","tiara","tigela","tijolo","timbrar","timidez","tingido","tinteiro","tiragem","titular","toalha","tocha","tolerar","tolice","tomada","tomilho","tonel","tontura","topete","tora","torcido","torneio","torque","torrada","torto","tostar","touca","toupeira","toxina","trabalho","tracejar","tradutor","trafegar","trajeto","trama","trancar","trapo","traseiro","tratador","travar","treino","tremer","trepidar","trevo","triagem","tribo","triciclo","tridente","trilogia","trindade","triplo","triturar","triunfal","trocar","trombeta","trova","trunfo","truque","tubular","tucano","tudo","tulipa","tupi","turbo","turma","turquesa","tutelar","tutorial","uivar","umbigo","unha","unidade","uniforme","urologia","urso","urtiga","urubu","usado","usina","usufruir","vacina","vadiar","vagaroso","vaidoso","vala","valente","validade","valores","vantagem","vaqueiro","varanda","vareta","varrer","vascular","vasilha","vassoura","vazar","vazio","veado","vedar","vegetar","veicular","veleiro","velhice","veludo","vencedor","vendaval","venerar","ventre","verbal","verdade","vereador","vergonha","vermelho","verniz","versar","vertente","vespa","vestido","vetorial","viaduto","viagem","viajar","viatura","vibrador","videira","vidraria","viela","viga","vigente","vigiar","vigorar","vilarejo","vinco","vinheta","vinil","violeta","virada","virtude","visitar","visto","vitral","viveiro","vizinho","voador","voar","vogal","volante","voleibol","voltagem","volumoso","vontade","vulto","vuvuzela","xadrez","xarope","xeque","xeretar","xerife","xingar","zangado","zarpar","zebu","zelador","zombar","zoologia","zumbido"]'),require$$9=JSON.parse('["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"]');var hasRequired_wordlists;function require_wordlists(){if(hasRequired_wordlists)return _wordlists;hasRequired_wordlists=1,Object.defineProperty(_wordlists,"__esModule",{value:!0});const s={};_wordlists.wordlists=s;let a;_wordlists._default=a;try{_wordlists._default=a=require$$0$1,s.czech=a}catch{}try{_wordlists._default=a=require$$1,s.chinese_simplified=a}catch{}try{_wordlists._default=a=require$$2,s.chinese_traditional=a}catch{}try{_wordlists._default=a=require$$3,s.korean=a}catch{}try{_wordlists._default=a=require$$4,s.french=a}catch{}try{_wordlists._default=a=require$$5,s.italian=a}catch{}try{_wordlists._default=a=require$$6,s.spanish=a}catch{}try{_wordlists._default=a=require$$7,s.japanese=a,s.JA=a}catch{}try{_wordlists._default=a=require$$8,s.portuguese=a}catch{}try{_wordlists._default=a=require$$9,s.english=a,s.EN=a}catch{}return _wordlists}var hasRequiredSrc$1;function requireSrc$1(){if(hasRequiredSrc$1)return src$1;hasRequiredSrc$1=1,Object.defineProperty(src$1,"__esModule",{value:!0});const s=requireSha256(),a=requireSha512(),u=requirePbkdf2(),l=requireUtils(),f=require_wordlists();let c=f._default;const h="Invalid mnemonic",p="Invalid entropy",v="Invalid mnemonic checksum",y=`A wordlist is required but a default could not be found.
Please pass a 2048 word array explicitly.`;function b(Q){return(Q||"").normalize("NFKD")}function S(Q,ee,k){for(;Q.length<k;)Q=ee+Q;return Q}function E(Q){return parseInt(Q,2)}function R(Q){return Q.map(ee=>S(ee.toString(2),"0",8)).join("")}function O(Q){const k=Q.length*8/32,d=s.sha256(Uint8Array.from(Q));return R(Array.from(d)).slice(0,k)}function I(Q){return"mnemonic"+(Q||"")}function B(Q,ee){const k=Uint8Array.from(distExports.Buffer.from(b(Q),"utf8")),d=Uint8Array.from(distExports.Buffer.from(I(b(ee)),"utf8")),g=u.pbkdf2(a.sha512,k,d,{c:2048,dkLen:64});return distExports.Buffer.from(g)}src$1.mnemonicToSeedSync=B;function N(Q,ee){const k=Uint8Array.from(distExports.Buffer.from(b(Q),"utf8")),d=Uint8Array.from(distExports.Buffer.from(I(b(ee)),"utf8"));return u.pbkdf2Async(a.sha512,k,d,{c:2048,dkLen:64}).then(g=>distExports.Buffer.from(g))}src$1.mnemonicToSeed=N;function D(Q,ee){if(ee=ee||c,!ee)throw new Error(y);const k=b(Q).split(" ");if(k.length%3!==0)throw new Error(h);const d=k.map(T=>{const m=ee.indexOf(T);if(m===-1)throw new Error(h);return S(m.toString(2),"0",11)}).join(""),g=Math.floor(d.length/33)*32,_=d.slice(0,g),w=d.slice(g),x=_.match(/(.{1,8})/g).map(E);if(x.length<16)throw new Error(p);if(x.length>32)throw new Error(p);if(x.length%4!==0)throw new Error(p);const P=distExports.Buffer.from(x);if(O(P)!==w)throw new Error(v);return P.toString("hex")}src$1.mnemonicToEntropy=D;function G(Q,ee){if(distExports.Buffer.isBuffer(Q)||(Q=distExports.Buffer.from(Q,"hex")),ee=ee||c,!ee)throw new Error(y);if(Q.length<16)throw new TypeError(p);if(Q.length>32)throw new TypeError(p);if(Q.length%4!==0)throw new TypeError(p);const k=R(Array.from(Q)),d=O(Q),w=(k+d).match(/(.{1,11})/g).map(x=>{const P=E(x);return ee[P]});return ee[0]==="あいこくしん"?w.join("　"):w.join(" ")}src$1.entropyToMnemonic=G;function V(Q,ee,k){if(Q=Q||128,Q%32!==0)throw new TypeError(p);return ee=ee||(d=>distExports.Buffer.from(l.randomBytes(d))),G(ee(Q/8),k)}src$1.generateMnemonic=V;function U(Q,ee){try{D(Q,ee)}catch{return!1}return!0}src$1.validateMnemonic=U;function te(Q){const ee=f.wordlists[Q];if(ee)c=ee;else throw new Error('Could not find wordlist for language "'+Q+'"')}src$1.setDefaultWordlist=te;function Z(){if(!c)throw new Error("No Default Wordlist set");return Object.keys(f.wordlists).filter(Q=>Q==="JA"||Q==="EN"?!1:f.wordlists[Q].every((ee,k)=>ee===c[k]))[0]}src$1.getDefaultWordlist=Z;var J=require_wordlists();return src$1.wordlists=J.wordlists,src$1}var srcExports=requireSrc$1(),hmac={},hash$1={},hasRequiredHash;function requireHash(){if(hasRequiredHash)return hash$1;hasRequiredHash=1,Object.defineProperty(hash$1,"__esModule",{value:!0});function s(a){return typeof a.saveState<"u"&&typeof a.restoreState<"u"&&typeof a.cleanSavedState<"u"}return hash$1.isSerializableHash=s,hash$1}var hasRequiredHmac;function requireHmac(){if(hasRequiredHmac)return hmac;hasRequiredHmac=1,Object.defineProperty(hmac,"__esModule",{value:!0});var s=requireHash(),a=requireConstantTime(),u=requireWipe(),l=function(){function c(h,p){this._finished=!1,this._inner=new h,this._outer=new h,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var v=new Uint8Array(this.blockSize);p.length>this.blockSize?this._inner.update(p).finish(v).clean():v.set(p);for(var y=0;y<v.length;y++)v[y]^=54;this._inner.update(v);for(var y=0;y<v.length;y++)v[y]^=106;this._outer.update(v),s.isSerializableHash(this._inner)&&s.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),u.wipe(v)}return c.prototype.reset=function(){if(!s.isSerializableHash(this._inner)||!s.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},c.prototype.clean=function(){s.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),s.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},c.prototype.update=function(h){return this._inner.update(h),this},c.prototype.finish=function(h){return this._finished?(this._outer.finish(h),this):(this._inner.finish(h),this._outer.update(h.subarray(0,this.digestLength)).finish(h),this._finished=!0,this)},c.prototype.digest=function(){var h=new Uint8Array(this.digestLength);return this.finish(h),h},c.prototype.saveState=function(){if(!s.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},c.prototype.restoreState=function(h){if(!s.isSerializableHash(this._inner)||!s.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(h),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},c.prototype.cleanSavedState=function(h){if(!s.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(h)},c}();hmac.HMAC=l;function f(c,h,p){var v=new l(c,h);v.update(p);var y=v.digest();return v.clean(),y}return hmac.hmac=f,hmac.equal=a.equal,hmac}var hmacExports=requireHmac(),sha512Exports=requireSha512$1(),bnExports=requireBn$4();const BN=getDefaultExportFromCjs(bnExports);function __awaiter$7(s,a,u,l){function f(c){return c instanceof u?c:new u(function(h){h(c)})}return new(u||(u=Promise))(function(c,h){function p(b){try{y(l.next(b))}catch(S){h(S)}}function v(b){try{y(l.throw(b))}catch(S){h(S)}}function y(b){b.done?c(b.value):f(b.value).then(p,v)}y((l=l.apply(s,[])).next())})}typeof SuppressedError=="function"&&SuppressedError;class Tz1{constructor(a,u,l){this.key=a;const f=a.substring(0,u?5:4);if(!isValidPrefix(f))throw new InvalidKeyError(`${invalidDetail(ValidationResult.NO_PREFIX_MATCHED)} expecting either '${Prefix.EDESK}' or '${Prefix.EDSK}'.`);if(this._key=l(b58cdecode(this.key,prefix[f])),this._publicKey=this._key.slice(32),!this._key)throw new InvalidKeyError("unable to decode");this.isInit=this.init()}init(){return __awaiter$7(this,void 0,void 0,function*(){if(this._key.length!==64){const{publicKey:a,secretKey:u}=ed25519Exports.generateKeyPairFromSeed(new Uint8Array(this._key));this._publicKey=a,this._key=u}return!0})}sign(a,u){return __awaiter$7(this,void 0,void 0,function*(){yield this.isInit;const l=ed25519Exports.sign(new Uint8Array(this._key),new Uint8Array(u)),f=toBuffer(l),c=a+buf2hex(f);return{bytes:a,sig:b58cencode(l,prefix.sig),prefixSig:b58cencode(l,prefix.edsig),sbytes:c}})}publicKey(){return __awaiter$7(this,void 0,void 0,function*(){return yield this.isInit,b58cencode(this._publicKey,prefix.edpk)})}publicKeyHash(){return __awaiter$7(this,void 0,void 0,function*(){return yield this.isInit,b58cencode(blake2bExports.hash(new Uint8Array(this._publicKey),20),prefix.tz1)})}secretKey(){return __awaiter$7(this,void 0,void 0,function*(){yield this.isInit;let a=this._key;const{secretKey:u}=ed25519Exports.generateKeyPairFromSeed(new Uint8Array(a).slice(0,32));return a=toBuffer(u),b58cencode(a,prefix.edsk)})}}const pref={p256:{pk:prefix.p2pk,sk:prefix.p2sk,pkh:prefix.tz3,sig:prefix.p2sig},secp256k1:{pk:prefix.sppk,sk:prefix.spsk,pkh:prefix.tz2,sig:prefix.spsig}};class ECKey{constructor(a,u,l,f){this.curve=a,this.key=u;const c=u.substring(0,l?5:4);if(!isValidPrefix(c))throw new InvalidKeyError(invalidDetail(ValidationResult.NO_PREFIX_MATCHED)+` expecting one of the following prefix '${Prefix.SPSK}', '${Prefix.SPESK}', '${Prefix.P2SK}' or '${Prefix.P2ESK}'.`);this._key=f(b58cdecode(this.key,prefix[c]));const h=new elliptic.ec(this.curve).keyFromPrivate(this._key),p=h.getPublic().getY().toArray(),y=(p.length<32?p[p.length-1]:p[31])%2?3:2,b=new Array(32).fill(0);this._publicKey=toBuffer(new Uint8Array([y].concat(b.concat(h.getPublic().getX().toArray()).slice(-32))))}sign(a,u){return __awaiter$7(this,void 0,void 0,function*(){const f=new elliptic.ec(this.curve).keyFromPrivate(this._key).sign(u,{canonical:!0}),c=f.r.toString("hex",64)+f.s.toString("hex",64),h=a+c;return{bytes:a,sig:b58cencode(c,prefix.sig),prefixSig:b58cencode(c,pref[this.curve].sig),sbytes:h}})}publicKey(){return __awaiter$7(this,void 0,void 0,function*(){return b58cencode(this._publicKey,pref[this.curve].pk)})}publicKeyHash(){return __awaiter$7(this,void 0,void 0,function*(){return b58cencode(blake2bExports.hash(new Uint8Array(this._publicKey),20),pref[this.curve].pkh)})}secretKey(){return __awaiter$7(this,void 0,void 0,function*(){const a=this._key;return b58cencode(a,pref[this.curve].sk)})}}const Tz3=ECKey.bind(null,"p256"),Tz2=ECKey.bind(null,"secp256k1");function parseHex(s){const a=[];for(let u=0;u<s.length;u+=2){const l=s.slice(u,u+2),f=parseInt(l,16);if(Number.isNaN(f))throw new InvalidHexStringError(l);a.push(f)}return new Uint8Array(a)}class InvalidMnemonicError extends ParameterValidationError{constructor(a){super(),this.mnemonic=a,this.name="InvalidMnemonicError",this.message=`Invalid mnemonic "${a}"`}}class InvalidBitSize extends ParameterValidationError{constructor(a){super(),this.message=a,this.name="InvalidBitSize"}}class InvalidCurveError extends ParameterValidationError{constructor(a){super(),this.message=a,this.name="InvalidCurveError"}}class InvalidSeedLengthError extends ParameterValidationError{constructor(a){super(),this.seedLength=a,this.name="InvalidSeedLengthError",this.message=`Invalid seed length "${a}" expecting length between 16 to 64.`}}class ToBeImplemented extends UnsupportedActionError{constructor(){super(),this.name="ToBeImplemented",this.message="This feature is under developement"}}class InvalidPassphraseError extends ParameterValidationError{constructor(a){super(),this.message=a,this.name="InvalidPassphraseError"}}const seedKey={p256:"Nist256p1 seed",secp256k1:"Bitcoin seed"},minSeedSize$1=16,maxSeedSize$1=64;let PrivateKey$1=class Bd{constructor(a,u){this.chainCode=u,this.keyPair=a}static fromSeed(a,u){var l,f;let c=typeof a=="string"?parseHex(a):a;if(c.length<minSeedSize$1||c.length>maxSeedSize$1)throw new InvalidSeedLengthError(c.length);if(!Object.prototype.hasOwnProperty.call(seedKey,u))throw new InvalidCurveError(`Unsupported curve "${u}" expecting either "p256" or "secp256k1"`);const h=new ellipticExports.ec(u);if(((l=h.n)===null||l===void 0?void 0:l.bitLength())!==256)throw new InvalidBitSize(`Invalid curve "${u}" with bit size "${(f=h.n)===null||f===void 0?void 0:f.bitLength()}" expecting bit size "256"`);const p=new TextEncoder().encode(seedKey[u]);let v=null,y=new Uint8Array,b=0;for(;b===0;){const E=new hmacExports.HMAC(sha512Exports.SHA512,p).update(c).digest();v=new BN(E.subarray(0,32)),y=E.subarray(32),v.isZero()||v.cmp(h.n)>=0?c=E:b++}const S=h.keyPair({});return S.priv=v,new Bd(S,y)}derive(a){const u=new Uint8Array(37);a&Hard?u.set(this.keyPair.getPrivate().toArray(),1):u.set(this.keyPair.getPublic().encodeCompressed(),0),new DataView(u.buffer).setUint32(33,a);let l=new BN(0),f=new Uint8Array,c=0;for(;c===0;){const p=new hmacExports.HMAC(sha512Exports.SHA512,this.chainCode).update(u).digest();l=new BN(p.subarray(0,32)),f=p.subarray(32),this.keyPair.ec.n&&l.cmp(this.keyPair.ec.n)<0&&(l=l.add(this.keyPair.getPrivate()).mod(this.keyPair.ec.n),l.isZero()||c++),u.set(f,1),u[0]=1}const h=this.keyPair.ec.keyPair({});return h.priv=l,new Bd(h,f)}derivePath(a){let u=this;for(const l of a)u=u.derive(l);return u}bytes(){if(!this.keyPair.priv)throw new InvalidKeyError("missing private key");const a=this.keyPair.priv.toArray(),u=new Uint8Array(32);return u.set(a,u.length-a.length),u}};const Hard=2147483648;class Path extends Array{static from(a){return super.from(a).map(u=>u>>>0)}static fromString(a){if(a.length===0)return new Path;let u=a.split("/");const l=[];u[0]==="m"&&(u=u.slice(1));for(let f of u){if(f.length===0)throw new InvalidDerivationPathError(a,": Invalid BIP32 path");let c=0;const h=f[f.length-1];(h==="'"||h==="h"||h==="H")&&(c=Hard,f=f.slice(0,f.length-1));const p=(parseInt(f,10)|c)>>>0;l.push(p)}return Path.from(l)}}const minSeedSize=16,maxSeedSize=64,ed25519Key="ed25519 seed";class PrivateKey{constructor(a,u){this.priv=a,this.chainCode=u}static fromSeed(a){const u=typeof a=="string"?parseHex(a):a;if(u.length<minSeedSize||u.length>maxSeedSize)throw new InvalidSeedLengthError(u.length);const l=new TextEncoder().encode(ed25519Key),f=new hmacExports.HMAC(sha512Exports.SHA512,l).update(u).digest();return new PrivateKey(ed25519Exports.generateKeyPairFromSeed(f.subarray(0,32)).secretKey,f.subarray(32))}seed(){return this.priv.subarray(0,32)}derive(a){if(!(a&Hard))throw new InvalidDerivationPathError(a.toString(),": Non-hardened derivation path.");const u=new Uint8Array(37);u.set(this.seed(),1),new DataView(u.buffer).setUint32(33,a);const l=new hmacExports.HMAC(sha512Exports.SHA512,this.chainCode).update(u).digest();return new PrivateKey(ed25519Exports.generateKeyPairFromSeed(l.subarray(0,32)).secretKey,l.subarray(32))}derivePath(a){let u=this;for(const l of a)u=u.derive(l);return u}}const generateSecretKey=(s,a,u)=>{const l=Path.fromString(a);let f;switch(u){case"ed25519":return f=PrivateKey.fromSeed(s).derivePath(l),b58cencode(f.seed().slice(0,32),prefix.edsk2);case"secp256k1":case"p256":{const c=u==="secp256k1"?prefix.spsk:prefix.p2sk;let h=PrivateKey$1.fromSeed(s,u);h=h.derivePath(l);const p=new Uint8Array(h.keyPair.getPrivate().toArray());return b58cencode(p,c)}case"bip25519":throw new ToBeImplemented;default:throw new InvalidCurveError(`Unsupported curve "${u}" expecting one of the following "ed25519", "secp256k1", "p256"`)}};class InMemorySigner{static fromFundraiser(a,u,l){if(!srcExports.validateMnemonic(l))throw new InvalidMnemonicError(l);const f=srcExports.mnemonicToSeedSync(l,`${a}${u}`),c=b58cencode(f.slice(0,32),prefix.edsk2);return new InMemorySigner(c)}static fromSecretKey(a,u){return __awaiter$7(this,void 0,void 0,function*(){return new InMemorySigner(a,u)})}static fromMnemonic({mnemonic:a,password:u="",derivationPath:l="44'/1729'/0'/0'",curve:f="ed25519"}){if(!srcExports.validateMnemonic(a))throw new InvalidMnemonicError(a);const c=srcExports.mnemonicToSeedSync(a,u),h=generateSecretKey(c,l,f);return new InMemorySigner(h)}constructor(a,u){const l=a.substring(2,3)==="e";let f=c=>c;if(l){if(!u)throw new InvalidPassphraseError("No passphrase provided to decrypt encrypted key");f=c=>{const h=toBuffer(c.slice(0,8)),p=c.slice(8),v=pbkdf2$1.pbkdf2Sync(u,h,32768,32,"sha512");return naclExports.openSecretBox(new Uint8Array(v),new Uint8Array(24),new Uint8Array(p))}}switch(a.substring(0,4)){case"edes":case"edsk":this._key=new Tz1(a,l,f);break;case"spsk":case"spes":this._key=new Tz2(a,l,f);break;case"p2sk":case"p2es":this._key=new Tz3(a,l,f);break;default:throw new InvalidKeyError(`${invalidDetail(ValidationResult.NO_PREFIX_MATCHED)} expecting one of the following '${Prefix.EDESK}', '${Prefix.EDSK}', '${Prefix.SPSK}', '${Prefix.SPESK}', '${Prefix.P2SK}' or '${Prefix.P2ESK}'.`)}}sign(a,u){return __awaiter$7(this,void 0,void 0,function*(){let l=hex2buf(a);typeof u<"u"&&(l=mergebuf(u,l));const f=blake2bExports.hash(l,32);return this._key.sign(a,f)})}publicKey(){return __awaiter$7(this,void 0,void 0,function*(){return this._key.publicKey()})}publicKeyHash(){return __awaiter$7(this,void 0,void 0,function*(){return this._key.publicKeyHash()})}secretKey(){return __awaiter$7(this,void 0,void 0,function*(){return this._key.secretKey()})}}function ownKeys(s,a){var u=Object.keys(s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(s);a&&(l=l.filter(function(f){return Object.getOwnPropertyDescriptor(s,f).enumerable})),u.push.apply(u,l)}return u}function _objectSpread2(s){for(var a=1;a<arguments.length;a++){var u=arguments[a]!=null?arguments[a]:{};a%2?ownKeys(Object(u),!0).forEach(function(l){_defineProperty(s,l,u[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(u)):ownKeys(Object(u)).forEach(function(l){Object.defineProperty(s,l,Object.getOwnPropertyDescriptor(u,l))})}return s}var lodash_merge={exports:{}};lodash_merge.exports;var hasRequiredLodash_merge;function requireLodash_merge(){return hasRequiredLodash_merge||(hasRequiredLodash_merge=1,function(s,a){var u=200,l="__lodash_hash_undefined__",f=800,c=16,h=9007199254740991,p="[object Arguments]",v="[object Array]",y="[object AsyncFunction]",b="[object Boolean]",S="[object Date]",E="[object Error]",R="[object Function]",O="[object GeneratorFunction]",I="[object Map]",B="[object Number]",N="[object Null]",D="[object Object]",G="[object Proxy]",V="[object RegExp]",U="[object Set]",te="[object String]",Z="[object Undefined]",J="[object WeakMap]",Q="[object ArrayBuffer]",ee="[object DataView]",k="[object Float32Array]",d="[object Float64Array]",g="[object Int8Array]",_="[object Int16Array]",w="[object Int32Array]",x="[object Uint8Array]",P="[object Uint8ClampedArray]",$="[object Uint16Array]",T="[object Uint32Array]",m=/[\\^$.*+?()[\]{}|]/g,M=/^\[object .+?Constructor\]$/,W=/^(?:0|[1-9]\d*)$/,Y={};Y[k]=Y[d]=Y[g]=Y[_]=Y[w]=Y[x]=Y[P]=Y[$]=Y[T]=!0,Y[p]=Y[v]=Y[Q]=Y[b]=Y[ee]=Y[S]=Y[E]=Y[R]=Y[I]=Y[B]=Y[D]=Y[V]=Y[U]=Y[te]=Y[J]=!1;var ue=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,ge=typeof self=="object"&&self&&self.Object===Object&&self,he=ue||ge||Function("return this")(),ae=a&&!a.nodeType&&a,de=ae&&!0&&s&&!s.nodeType&&s,pe=de&&de.exports===ae,oe=pe&&ue.process,le=function(){try{var we=de&&de.require&&de.require("util").types;return we||oe&&oe.binding&&oe.binding("util")}catch{}}(),me=le&&le.isTypedArray;function xe(we,Te,$e){switch($e.length){case 0:return we.call(Te);case 1:return we.call(Te,$e[0]);case 2:return we.call(Te,$e[0],$e[1]);case 3:return we.call(Te,$e[0],$e[1],$e[2])}return we.apply(Te,$e)}function Ne(we,Te){for(var $e=-1,_t=Array(we);++$e<we;)_t[$e]=Te($e);return _t}function Pe(we){return function(Te){return we(Te)}}function Ie(we,Te){return we==null?void 0:we[Te]}function Ke(we,Te){return function($e){return we(Te($e))}}var Le=Array.prototype,Ce=Function.prototype,at=Object.prototype,Oe=he["__core-js_shared__"],De=Ce.toString,yt=at.hasOwnProperty,Ue=function(){var we=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||"");return we?"Symbol(src)_1."+we:""}(),ze=at.toString,Mt=De.call(Object),se=RegExp("^"+De.call(yt).replace(m,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),j=pe?he.Buffer:void 0,X=he.Symbol,ce=he.Uint8Array;j&&j.allocUnsafe;var be=Ke(Object.getPrototypeOf,Object),Re=Object.create,Se=at.propertyIsEnumerable,qe=Le.splice,bt=X?X.toStringTag:void 0,je=function(){try{var we=lo(Object,"defineProperty");return we({},"",{}),we}catch{}}(),We=j?j.isBuffer:void 0,St=Math.max,ut=Date.now,vt=lo(he,"Map"),zt=lo(Object,"create"),st=function(){function we(){}return function(Te){if(!mn(Te))return{};if(Re)return Re(Te);we.prototype=Te;var $e=new we;return we.prototype=void 0,$e}}();function nt(we){var Te=-1,$e=we==null?0:we.length;for(this.clear();++Te<$e;){var _t=we[Te];this.set(_t[0],_t[1])}}function Vt(){this.__data__=zt?zt(null):{},this.size=0}function tt(we){var Te=this.has(we)&&delete this.__data__[we];return this.size-=Te?1:0,Te}function ft(we){var Te=this.__data__;if(zt){var $e=Te[we];return $e===l?void 0:$e}return yt.call(Te,we)?Te[we]:void 0}function Ft(we){var Te=this.__data__;return zt?Te[we]!==void 0:yt.call(Te,we)}function Qe(we,Te){var $e=this.__data__;return this.size+=this.has(we)?0:1,$e[we]=zt&&Te===void 0?l:Te,this}nt.prototype.clear=Vt,nt.prototype.delete=tt,nt.prototype.get=ft,nt.prototype.has=Ft,nt.prototype.set=Qe;function rt(we){var Te=-1,$e=we==null?0:we.length;for(this.clear();++Te<$e;){var _t=we[Te];this.set(_t[0],_t[1])}}function Bt(){this.__data__=[],this.size=0}function Xe(we){var Te=this.__data__,$e=fr(Te,we);if($e<0)return!1;var _t=Te.length-1;return $e==_t?Te.pop():qe.call(Te,$e,1),--this.size,!0}function ct(we){var Te=this.__data__,$e=fr(Te,we);return $e<0?void 0:Te[$e][1]}function Ut(we){return fr(this.__data__,we)>-1}function Je(we,Te){var $e=this.__data__,_t=fr($e,we);return _t<0?(++this.size,$e.push([we,Te])):$e[_t][1]=Te,this}rt.prototype.clear=Bt,rt.prototype.delete=Xe,rt.prototype.get=ct,rt.prototype.has=Ut,rt.prototype.set=Je;function it(we){var Te=-1,$e=we==null?0:we.length;for(this.clear();++Te<$e;){var _t=we[Te];this.set(_t[0],_t[1])}}function qt(){this.size=0,this.__data__={hash:new nt,map:new(vt||rt),string:new nt}}function et(we){var Te=li(this,we).delete(we);return this.size-=Te?1:0,Te}function ht(we){return li(this,we).get(we)}function ar(we){return li(this,we).has(we)}function dt(we,Te){var $e=li(this,we),_t=$e.size;return $e.set(we,Te),this.size+=$e.size==_t?0:1,this}it.prototype.clear=qt,it.prototype.delete=et,it.prototype.get=ht,it.prototype.has=ar,it.prototype.set=dt;function mt(we){var Te=this.__data__=new rt(we);this.size=Te.size}function Xt(){this.__data__=new rt,this.size=0}function er(we){var Te=this.__data__,$e=Te.delete(we);return this.size=Te.size,$e}function kr(we){return this.__data__.get(we)}function Ar(we){return this.__data__.has(we)}function Tr(we,Te){var $e=this.__data__;if($e instanceof rt){var _t=$e.__data__;if(!vt||_t.length<u-1)return _t.push([we,Te]),this.size=++$e.size,this;$e=this.__data__=new it(_t)}return $e.set(we,Te),this.size=$e.size,this}mt.prototype.clear=Xt,mt.prototype.delete=er,mt.prototype.get=kr,mt.prototype.has=Ar,mt.prototype.set=Tr;function Rr(we,Te){var $e=Rn(we),_t=!$e&&Tn(we),It=!$e&&!_t&&Mi(we),Kt=!$e&&!_t&&!It&&$o(we),Jt=$e||_t||It||Kt,Ct=Jt?Ne(we.length,String):[],Zt=Ct.length;for(var Pr in we)Jt&&(Pr=="length"||It&&(Pr=="offset"||Pr=="parent")||Kt&&(Pr=="buffer"||Pr=="byteLength"||Pr=="byteOffset")||Ti(Pr,Zt))||Ct.push(Pr);return Ct}function pr(we,Te,$e){($e!==void 0&&!qn(we[Te],$e)||$e===void 0&&!(Te in we))&&Ht(we,Te,$e)}function _r(we,Te,$e){var _t=we[Te];(!(yt.call(we,Te)&&qn(_t,$e))||$e===void 0&&!(Te in we))&&Ht(we,Te,$e)}function fr(we,Te){for(var $e=we.length;$e--;)if(qn(we[$e][0],Te))return $e;return-1}function Ht(we,Te,$e){Te=="__proto__"&&je?je(we,Te,{configurable:!0,enumerable:!0,value:$e,writable:!0}):we[Te]=$e}var Cr=Ai();function ur(we){return we==null?we===void 0?Z:N:bt&&bt in Object(we)?Co(we):oa(we)}function wr(we){return cn(we)&&ur(we)==p}function yr(we){if(!mn(we)||fo(we))return!1;var Te=Pn(we)?se:M;return Te.test(Oo(we))}function Mr(we){return cn(we)&&ua(we.length)&&!!Y[ur(we)]}function Er(we){if(!mn(we))return Ri(we);var Te=br(we),$e=[];for(var _t in we)_t=="constructor"&&(Te||!yt.call(we,_t))||$e.push(_t);return $e}function gr(we,Te,$e,_t,It){we!==Te&&Cr(Te,function(Kt,Jt){if(It||(It=new mt),mn(Kt))sr(we,Te,Jt,$e,gr,_t,It);else{var Ct=_t?_t(Hi(we,Jt),Kt,Jt+"",we,Te,It):void 0;Ct===void 0&&(Ct=Kt),pr(we,Jt,Ct)}},Lo)}function sr(we,Te,$e,_t,It,Kt,Jt){var Ct=Hi(we,$e),Zt=Hi(Te,$e),Pr=Jt.get(Zt);if(Pr){pr(we,$e,Pr);return}var qr=Kt?Kt(Ct,Zt,$e+"",we,Te,Jt):void 0,gn=qr===void 0;if(gn){var Zr=Rn(Zt),Pi=!Zr&&Mi(Zt),rn=!Zr&&!Pi&&$o(Zt);qr=Zt,Zr||Pi||rn?Rn(Ct)?qr=Ct:Ki(Ct)?qr=zi(Ct):Pi?(gn=!1,qr=ji(Zt)):rn?(gn=!1,qr=La(Zt)):qr=[]:gs(Zt)||Tn(Zt)?(qr=Ct,Tn(Ct)?qr=No(Ct):(!mn(Ct)||Pn(Ct))&&(qr=ia(Zt))):gn=!1}gn&&(Jt.set(Zt,qr),It(qr,Zt,_t,Kt,Jt),Jt.delete(Zt)),pr(we,$e,qr)}function Ir(we,Te){return aa(Io(we,Te,xr),we+"")}var ln=je?function(we,Te){return je(we,"toString",{configurable:!0,enumerable:!1,value:Or(Te),writable:!0})}:xr;function ji(we,Te){return we.slice()}function Na(we){var Te=new we.constructor(we.byteLength);return new ce(Te).set(new ce(we)),Te}function La(we,Te){var $e=Na(we.buffer);return new we.constructor($e,we.byteOffset,we.length)}function zi(we,Te){var $e=-1,_t=we.length;for(Te||(Te=Array(_t));++$e<_t;)Te[$e]=we[$e];return Te}function ko(we,Te,$e,_t){var It=!$e;$e||($e={});for(var Kt=-1,Jt=Te.length;++Kt<Jt;){var Ct=Te[Kt],Zt=void 0;Zt===void 0&&(Zt=we[Ct]),It?Ht($e,Ct,Zt):_r($e,Ct,Zt)}return $e}function Vi(we){return Ir(function(Te,$e){var _t=-1,It=$e.length,Kt=It>1?$e[It-1]:void 0,Jt=It>2?$e[2]:void 0;for(Kt=we.length>3&&typeof Kt=="function"?(It--,Kt):void 0,Jt&&co($e[0],$e[1],Jt)&&(Kt=It<3?void 0:Kt,It=1),Te=Object(Te);++_t<It;){var Ct=$e[_t];Ct&&we(Te,Ct,_t,Kt)}return Te})}function Ai(we){return function(Te,$e,_t){for(var It=-1,Kt=Object(Te),Jt=_t(Te),Ct=Jt.length;Ct--;){var Zt=Jt[++It];if($e(Kt[Zt],Zt,Kt)===!1)break}return Te}}function li(we,Te){var $e=we.__data__;return Ba(Te)?$e[typeof Te=="string"?"string":"hash"]:$e.map}function lo(we,Te){var $e=Ie(we,Te);return yr($e)?$e:void 0}function Co(we){var Te=yt.call(we,bt),$e=we[bt];try{we[bt]=void 0;var _t=!0}catch{}var It=ze.call(we);return _t&&(Te?we[bt]=$e:delete we[bt]),It}function ia(we){return typeof we.constructor=="function"&&!br(we)?st(be(we)):{}}function Ti(we,Te){var $e=typeof we;return Te=Te??h,!!Te&&($e=="number"||$e!="symbol"&&W.test(we))&&we>-1&&we%1==0&&we<Te}function co(we,Te,$e){if(!mn($e))return!1;var _t=typeof Te;return(_t=="number"?Mn($e)&&Ti(Te,$e.length):_t=="string"&&Te in $e)?qn($e[Te],we):!1}function Ba(we){var Te=typeof we;return Te=="string"||Te=="number"||Te=="symbol"||Te=="boolean"?we!=="__proto__":we===null}function fo(we){return!!Ue&&Ue in we}function br(we){var Te=we&&we.constructor,$e=typeof Te=="function"&&Te.prototype||at;return we===$e}function Ri(we){var Te=[];if(we!=null)for(var $e in Object(we))Te.push($e);return Te}function oa(we){return ze.call(we)}function Io(we,Te,$e){return Te=St(Te===void 0?we.length-1:Te,0),function(){for(var _t=arguments,It=-1,Kt=St(_t.length-Te,0),Jt=Array(Kt);++It<Kt;)Jt[It]=_t[Te+It];It=-1;for(var Ct=Array(Te+1);++It<Te;)Ct[It]=_t[It];return Ct[Te]=$e(Jt),xe(we,this,Ct)}}function Hi(we,Te){if(!(Te==="constructor"&&typeof we[Te]=="function")&&Te!="__proto__")return we[Te]}var aa=sa(ln);function sa(we){var Te=0,$e=0;return function(){var _t=ut(),It=c-(_t-$e);if($e=_t,It>0){if(++Te>=f)return arguments[0]}else Te=0;return we.apply(void 0,arguments)}}function Oo(we){if(we!=null){try{return De.call(we)}catch{}try{return we+""}catch{}}return""}function qn(we,Te){return we===Te||we!==we&&Te!==Te}var Tn=wr(function(){return arguments}())?wr:function(we){return cn(we)&&yt.call(we,"callee")&&!Se.call(we,"callee")},Rn=Array.isArray;function Mn(we){return we!=null&&ua(we.length)&&!Pn(we)}function Ki(we){return cn(we)&&Mn(we)}var Mi=We||Gi;function Pn(we){if(!mn(we))return!1;var Te=ur(we);return Te==R||Te==O||Te==y||Te==G}function ua(we){return typeof we=="number"&&we>-1&&we%1==0&&we<=h}function mn(we){var Te=typeof we;return we!=null&&(Te=="object"||Te=="function")}function cn(we){return we!=null&&typeof we=="object"}function gs(we){if(!cn(we)||ur(we)!=D)return!1;var Te=be(we);if(Te===null)return!0;var $e=yt.call(Te,"constructor")&&Te.constructor;return typeof $e=="function"&&$e instanceof $e&&De.call($e)==Mt}var $o=me?Pe(me):Mr;function No(we){return ko(we,Lo(we))}function Lo(we){return Mn(we)?Rr(we):Er(we)}var vs=Vi(function(we,Te,$e){gr(we,Te,$e)});function Or(we){return function(){return we}}function xr(we){return we}function Gi(){return!1}s.exports=vs}(lodash_merge,lodash_merge.exports)),lodash_merge.exports}var lodash_mergeExports=requireLodash_merge();const deepmerge=getDefaultExportFromCjs(lodash_mergeExports);var loglevel$f={exports:{}},loglevel$e=loglevel$f.exports,hasRequiredLoglevel$6;function requireLoglevel$6(){return hasRequiredLoglevel$6||(hasRequiredLoglevel$6=1,function(s){(function(a,u){s.exports?s.exports=u():a.log=u()})(loglevel$e,function(){var a=function(){},u="undefined",l=typeof window!==u&&typeof window.navigator!==u&&/Trident\/|MSIE /.test(window.navigator.userAgent),f=["trace","debug","info","warn","error"],c={},h=null;function p(I,B){var N=I[B];if(typeof N.bind=="function")return N.bind(I);try{return Function.prototype.bind.call(N,I)}catch{return function(){return Function.prototype.apply.apply(N,[I,arguments])}}}function v(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function y(I){return I==="debug"&&(I="log"),typeof console===u?!1:I==="trace"&&l?v:console[I]!==void 0?p(console,I):console.log!==void 0?p(console,"log"):a}function b(){for(var I=this.getLevel(),B=0;B<f.length;B++){var N=f[B];this[N]=B<I?a:this.methodFactory(N,I,this.name)}if(this.log=this.debug,typeof console===u&&I<this.levels.SILENT)return"No console available for logging"}function S(I){return function(){typeof console!==u&&(b.call(this),this[I].apply(this,arguments))}}function E(I,B,N){return y(I)||S.apply(this,arguments)}function R(I,B){var N=this,D,G,V,U="loglevel";typeof I=="string"?U+=":"+I:typeof I=="symbol"&&(U=void 0);function te(k){var d=(f[k]||"silent").toUpperCase();if(!(typeof window===u||!U)){try{window.localStorage[U]=d;return}catch{}try{window.document.cookie=encodeURIComponent(U)+"="+d+";"}catch{}}}function Z(){var k;if(!(typeof window===u||!U)){try{k=window.localStorage[U]}catch{}if(typeof k===u)try{var d=window.document.cookie,g=encodeURIComponent(U),_=d.indexOf(g+"=");_!==-1&&(k=/^([^;]+)/.exec(d.slice(_+g.length+1))[1])}catch{}return N.levels[k]===void 0&&(k=void 0),k}}function J(){if(!(typeof window===u||!U)){try{window.localStorage.removeItem(U)}catch{}try{window.document.cookie=encodeURIComponent(U)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function Q(k){var d=k;if(typeof d=="string"&&N.levels[d.toUpperCase()]!==void 0&&(d=N.levels[d.toUpperCase()]),typeof d=="number"&&d>=0&&d<=N.levels.SILENT)return d;throw new TypeError("log.setLevel() called with invalid level: "+k)}N.name=I,N.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},N.methodFactory=B||E,N.getLevel=function(){return V??G??D},N.setLevel=function(k,d){return V=Q(k),d!==!1&&te(V),b.call(N)},N.setDefaultLevel=function(k){G=Q(k),Z()||N.setLevel(k,!1)},N.resetLevel=function(){V=null,J(),b.call(N)},N.enableAll=function(k){N.setLevel(N.levels.TRACE,k)},N.disableAll=function(k){N.setLevel(N.levels.SILENT,k)},N.rebuild=function(){if(h!==N&&(D=Q(h.getLevel())),b.call(N),h===N)for(var k in c)c[k].rebuild()},D=Q(h?h.getLevel():"WARN");var ee=Z();ee!=null&&(V=Q(ee)),b.call(N)}h=new R,h.getLogger=function(B){if(typeof B!="symbol"&&typeof B!="string"||B==="")throw new TypeError("You must supply a name when creating a logger.");var N=c[B];return N||(N=c[B]=new R(B,h.methodFactory)),N};var O=typeof window!==u?window.log:void 0;return h.noConflict=function(){return typeof window!==u&&window.log===h&&(window.log=O),h},h.getLoggers=function(){return c},h.default=h,h})}(loglevel$f)),loglevel$f.exports}var loglevelExports$6=requireLoglevel$6();const log$1$1=getDefaultExportFromCjs(loglevelExports$6),log$9=log$1$1.getLogger("http-helpers");log$9.setLevel(loglevelExports$6.levels.INFO);let apiKey$2="torus-default";const gatewayAuthHeader$2="x-api-key";async function fetchAndTrace$2(s,a){let u=null;try{u=new URL(s)}catch{}return fetch(s,a)}function getApiKeyHeaders$2(){const s={};return s[gatewayAuthHeader$2]=apiKey$2,s}function debugLogResponse$2(s){log$9.info(`Response: ${s.status} ${s.statusText}`),log$9.info(`Url: ${s.url}`)}function logTracingHeader$1(s){log$9.info(`Request tracing with traceID=${s.headers.get("x-web3-correlation-id")}`)}const promiseTimeout$1=(s,a)=>{const u=new Promise((l,f)=>{const c=setTimeout(()=>{clearTimeout(c),f(new Error(`Timed out in ${s}ms`))},s)});return Promise.race([a,u])},get$2=async function(s){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const l={mode:"cors",headers:{}};u.useAPIKey&&(l.headers=_objectSpread2(_objectSpread2({},l.headers),getApiKeyHeaders$2()));const f=deepmerge(l,a,{method:"GET"}),c=await fetchAndTrace$2(s,f);if(c.ok){const h=c.headers.get("content-type");return h!=null&&h.includes("application/json")?c.json():c.text()}throw debugLogResponse$2(c),c},post$1=function(s){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const f={mode:"cors",headers:{"Content-Type":"application/json; charset=utf-8"}};l.useAPIKey&&(f.headers=_objectSpread2(_objectSpread2({},f.headers),getApiKeyHeaders$2()));const c=deepmerge(f,u,{method:"POST"});return l.isUrlEncodedData?(c.body=a,c.headers["Content-Type"]==="application/json; charset=utf-8"&&delete c.headers["Content-Type"]):c.body=JSON.stringify(a),promiseTimeout$1(l.timeout||6e4,fetchAndTrace$2(s,c).then(h=>{if(l.logTracingHeader&&logTracingHeader$1(h),h.ok){const p=h.headers.get("content-type");return p!=null&&p.includes("application/json")?h.json():h.text()}throw debugLogResponse$2(h),h}))};function _objectWithoutProperties(s,a){if(s==null)return{};var u,l,f=_objectWithoutPropertiesLoose(s,a);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(s);for(l=0;l<c.length;l++)u=c[l],a.includes(u)||{}.propertyIsEnumerable.call(s,u)&&(f[u]=s[u])}return f}const BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class Utils{static getFirstMatch(a,u){const l=u.match(a);return l&&l.length>0&&l[1]||""}static getSecondMatch(a,u){const l=u.match(a);return l&&l.length>1&&l[2]||""}static matchAndReturnConst(a,u,l){if(a.test(u))return l}static getWindowsVersionName(a){switch(a){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(a){const u=a.split(".").splice(0,2).map(l=>parseInt(l,10)||0);if(u.push(0),u[0]===10)switch(u[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(a){const u=a.split(".").splice(0,2).map(l=>parseInt(l,10)||0);if(u.push(0),!(u[0]===1&&u[1]<5)){if(u[0]===1&&u[1]<6)return"Cupcake";if(u[0]===1&&u[1]>=6)return"Donut";if(u[0]===2&&u[1]<2)return"Eclair";if(u[0]===2&&u[1]===2)return"Froyo";if(u[0]===2&&u[1]>2)return"Gingerbread";if(u[0]===3)return"Honeycomb";if(u[0]===4&&u[1]<1)return"Ice Cream Sandwich";if(u[0]===4&&u[1]<4)return"Jelly Bean";if(u[0]===4&&u[1]>=4)return"KitKat";if(u[0]===5)return"Lollipop";if(u[0]===6)return"Marshmallow";if(u[0]===7)return"Nougat";if(u[0]===8)return"Oreo";if(u[0]===9)return"Pie"}}static getVersionPrecision(a){return a.split(".").length}static compareVersions(a,u,l=!1){const f=Utils.getVersionPrecision(a),c=Utils.getVersionPrecision(u);let h=Math.max(f,c),p=0;const v=Utils.map([a,u],y=>{const b=h-Utils.getVersionPrecision(y),S=y+new Array(b+1).join(".0");return Utils.map(S.split("."),E=>new Array(20-E.length).join("0")+E).reverse()});for(l&&(p=h-Math.min(f,c)),h-=1;h>=p;){if(v[0][h]>v[1][h])return 1;if(v[0][h]===v[1][h]){if(h===p)return 0;h-=1}else if(v[0][h]<v[1][h])return-1}}static map(a,u){const l=[];let f;if(Array.prototype.map)return Array.prototype.map.call(a,u);for(f=0;f<a.length;f+=1)l.push(u(a[f]));return l}static find(a,u){let l,f;if(Array.prototype.find)return Array.prototype.find.call(a,u);for(l=0,f=a.length;l<f;l+=1){const c=a[l];if(u(c,l))return c}}static assign(a,...u){const l=a;let f,c;if(Object.assign)return Object.assign(a,...u);for(f=0,c=u.length;f<c;f+=1){const h=u[f];typeof h=="object"&&h!==null&&Object.keys(h).forEach(v=>{l[v]=h[v]})}return a}static getBrowserAlias(a){return BROWSER_ALIASES_MAP[a]}static getBrowserTypeByAlias(a){return BROWSER_MAP[a]||""}}const commonVersionIdentifier=/version\/(\d+(\.?_?\d+)+)/i,browsersList=[{test:[/googlebot/i],describe(s){const a={name:"Googlebot"},u=Utils.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,s)||Utils.getFirstMatch(commonVersionIdentifier,s);return u&&(a.version=u),a}},{test:[/opera/i],describe(s){const a={name:"Opera"},u=Utils.getFirstMatch(commonVersionIdentifier,s)||Utils.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,s);return u&&(a.version=u),a}},{test:[/opr\/|opios/i],describe(s){const a={name:"Opera"},u=Utils.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,s)||Utils.getFirstMatch(commonVersionIdentifier,s);return u&&(a.version=u),a}},{test:[/SamsungBrowser/i],describe(s){const a={name:"Samsung Internet for Android"},u=Utils.getFirstMatch(commonVersionIdentifier,s)||Utils.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,s);return u&&(a.version=u),a}},{test:[/Whale/i],describe(s){const a={name:"NAVER Whale Browser"},u=Utils.getFirstMatch(commonVersionIdentifier,s)||Utils.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,s);return u&&(a.version=u),a}},{test:[/MZBrowser/i],describe(s){const a={name:"MZ Browser"},u=Utils.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,s)||Utils.getFirstMatch(commonVersionIdentifier,s);return u&&(a.version=u),a}},{test:[/focus/i],describe(s){const a={name:"Focus"},u=Utils.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,s)||Utils.getFirstMatch(commonVersionIdentifier,s);return u&&(a.version=u),a}},{test:[/swing/i],describe(s){const a={name:"Swing"},u=Utils.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,s)||Utils.getFirstMatch(commonVersionIdentifier,s);return u&&(a.version=u),a}},{test:[/coast/i],describe(s){const a={name:"Opera Coast"},u=Utils.getFirstMatch(commonVersionIdentifier,s)||Utils.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,s);return u&&(a.version=u),a}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(s){const a={name:"Opera Touch"},u=Utils.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,s)||Utils.getFirstMatch(commonVersionIdentifier,s);return u&&(a.version=u),a}},{test:[/yabrowser/i],describe(s){const a={name:"Yandex Browser"},u=Utils.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,s)||Utils.getFirstMatch(commonVersionIdentifier,s);return u&&(a.version=u),a}},{test:[/ucbrowser/i],describe(s){const a={name:"UC Browser"},u=Utils.getFirstMatch(commonVersionIdentifier,s)||Utils.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,s);return u&&(a.version=u),a}},{test:[/Maxthon|mxios/i],describe(s){const a={name:"Maxthon"},u=Utils.getFirstMatch(commonVersionIdentifier,s)||Utils.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,s);return u&&(a.version=u),a}},{test:[/epiphany/i],describe(s){const a={name:"Epiphany"},u=Utils.getFirstMatch(commonVersionIdentifier,s)||Utils.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,s);return u&&(a.version=u),a}},{test:[/puffin/i],describe(s){const a={name:"Puffin"},u=Utils.getFirstMatch(commonVersionIdentifier,s)||Utils.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,s);return u&&(a.version=u),a}},{test:[/sleipnir/i],describe(s){const a={name:"Sleipnir"},u=Utils.getFirstMatch(commonVersionIdentifier,s)||Utils.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,s);return u&&(a.version=u),a}},{test:[/k-meleon/i],describe(s){const a={name:"K-Meleon"},u=Utils.getFirstMatch(commonVersionIdentifier,s)||Utils.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,s);return u&&(a.version=u),a}},{test:[/micromessenger/i],describe(s){const a={name:"WeChat"},u=Utils.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,s)||Utils.getFirstMatch(commonVersionIdentifier,s);return u&&(a.version=u),a}},{test:[/qqbrowser/i],describe(s){const a={name:/qqbrowserlite/i.test(s)?"QQ Browser Lite":"QQ Browser"},u=Utils.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,s)||Utils.getFirstMatch(commonVersionIdentifier,s);return u&&(a.version=u),a}},{test:[/msie|trident/i],describe(s){const a={name:"Internet Explorer"},u=Utils.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,s);return u&&(a.version=u),a}},{test:[/\sedg\//i],describe(s){const a={name:"Microsoft Edge"},u=Utils.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,s);return u&&(a.version=u),a}},{test:[/edg([ea]|ios)/i],describe(s){const a={name:"Microsoft Edge"},u=Utils.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,s);return u&&(a.version=u),a}},{test:[/vivaldi/i],describe(s){const a={name:"Vivaldi"},u=Utils.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,s);return u&&(a.version=u),a}},{test:[/seamonkey/i],describe(s){const a={name:"SeaMonkey"},u=Utils.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,s);return u&&(a.version=u),a}},{test:[/sailfish/i],describe(s){const a={name:"Sailfish"},u=Utils.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,s);return u&&(a.version=u),a}},{test:[/silk/i],describe(s){const a={name:"Amazon Silk"},u=Utils.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,s);return u&&(a.version=u),a}},{test:[/phantom/i],describe(s){const a={name:"PhantomJS"},u=Utils.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,s);return u&&(a.version=u),a}},{test:[/slimerjs/i],describe(s){const a={name:"SlimerJS"},u=Utils.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,s);return u&&(a.version=u),a}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(s){const a={name:"BlackBerry"},u=Utils.getFirstMatch(commonVersionIdentifier,s)||Utils.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,s);return u&&(a.version=u),a}},{test:[/(web|hpw)[o0]s/i],describe(s){const a={name:"WebOS Browser"},u=Utils.getFirstMatch(commonVersionIdentifier,s)||Utils.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,s);return u&&(a.version=u),a}},{test:[/bada/i],describe(s){const a={name:"Bada"},u=Utils.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,s);return u&&(a.version=u),a}},{test:[/tizen/i],describe(s){const a={name:"Tizen"},u=Utils.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,s)||Utils.getFirstMatch(commonVersionIdentifier,s);return u&&(a.version=u),a}},{test:[/qupzilla/i],describe(s){const a={name:"QupZilla"},u=Utils.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,s)||Utils.getFirstMatch(commonVersionIdentifier,s);return u&&(a.version=u),a}},{test:[/firefox|iceweasel|fxios/i],describe(s){const a={name:"Firefox"},u=Utils.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,s);return u&&(a.version=u),a}},{test:[/electron/i],describe(s){const a={name:"Electron"},u=Utils.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,s);return u&&(a.version=u),a}},{test:[/MiuiBrowser/i],describe(s){const a={name:"Miui"},u=Utils.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,s);return u&&(a.version=u),a}},{test:[/chromium/i],describe(s){const a={name:"Chromium"},u=Utils.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,s)||Utils.getFirstMatch(commonVersionIdentifier,s);return u&&(a.version=u),a}},{test:[/chrome|crios|crmo/i],describe(s){const a={name:"Chrome"},u=Utils.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,s);return u&&(a.version=u),a}},{test:[/GSA/i],describe(s){const a={name:"Google Search"},u=Utils.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,s);return u&&(a.version=u),a}},{test(s){const a=!s.test(/like android/i),u=s.test(/android/i);return a&&u},describe(s){const a={name:"Android Browser"},u=Utils.getFirstMatch(commonVersionIdentifier,s);return u&&(a.version=u),a}},{test:[/playstation 4/i],describe(s){const a={name:"PlayStation 4"},u=Utils.getFirstMatch(commonVersionIdentifier,s);return u&&(a.version=u),a}},{test:[/safari|applewebkit/i],describe(s){const a={name:"Safari"},u=Utils.getFirstMatch(commonVersionIdentifier,s);return u&&(a.version=u),a}},{test:[/.*/i],describe(s){const a=/^(.*)\/(.*) /,u=/^(.*)\/(.*)[ \t]\((.*)/,f=s.search("\\(")!==-1?u:a;return{name:Utils.getFirstMatch(f,s),version:Utils.getSecondMatch(f,s)}}}],osParsersList=[{test:[/Roku\/DVP/],describe(s){const a=Utils.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,s);return{name:OS_MAP.Roku,version:a}}},{test:[/windows phone/i],describe(s){const a=Utils.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,s);return{name:OS_MAP.WindowsPhone,version:a}}},{test:[/windows /i],describe(s){const a=Utils.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,s),u=Utils.getWindowsVersionName(a);return{name:OS_MAP.Windows,version:a,versionName:u}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(s){const a={name:OS_MAP.iOS},u=Utils.getSecondMatch(/(Version\/)(\d[\d.]+)/,s);return u&&(a.version=u),a}},{test:[/macintosh/i],describe(s){const a=Utils.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,s).replace(/[_\s]/g,"."),u=Utils.getMacOSVersionName(a),l={name:OS_MAP.MacOS,version:a};return u&&(l.versionName=u),l}},{test:[/(ipod|iphone|ipad)/i],describe(s){const a=Utils.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,s).replace(/[_\s]/g,".");return{name:OS_MAP.iOS,version:a}}},{test(s){const a=!s.test(/like android/i),u=s.test(/android/i);return a&&u},describe(s){const a=Utils.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,s),u=Utils.getAndroidVersionName(a),l={name:OS_MAP.Android,version:a};return u&&(l.versionName=u),l}},{test:[/(web|hpw)[o0]s/i],describe(s){const a=Utils.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,s),u={name:OS_MAP.WebOS};return a&&a.length&&(u.version=a),u}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(s){const a=Utils.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,s)||Utils.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,s)||Utils.getFirstMatch(/\bbb(\d+)/i,s);return{name:OS_MAP.BlackBerry,version:a}}},{test:[/bada/i],describe(s){const a=Utils.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,s);return{name:OS_MAP.Bada,version:a}}},{test:[/tizen/i],describe(s){const a=Utils.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,s);return{name:OS_MAP.Tizen,version:a}}},{test:[/linux/i],describe(){return{name:OS_MAP.Linux}}},{test:[/CrOS/],describe(){return{name:OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe(s){const a=Utils.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,s);return{name:OS_MAP.PlayStation4,version:a}}}],platformParsersList=[{test:[/googlebot/i],describe(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe(s){const a=Utils.getFirstMatch(/(can-l01)/i,s)&&"Nova",u={type:PLATFORMS_MAP.mobile,vendor:"Huawei"};return a&&(u.model=a),u}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe(){return{type:PLATFORMS_MAP.tablet}}},{test(s){const a=s.test(/ipod|iphone/i),u=s.test(/like (ipod|iphone)/i);return a&&!u},describe(s){const a=Utils.getFirstMatch(/(ipod|iphone)/i,s);return{type:PLATFORMS_MAP.mobile,vendor:"Apple",model:a}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe(){return{type:PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe(){return{type:PLATFORMS_MAP.mobile}}},{test(s){return s.getBrowserName(!0)==="blackberry"},describe(){return{type:PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test(s){return s.getBrowserName(!0)==="bada"},describe(){return{type:PLATFORMS_MAP.mobile}}},{test(s){return s.getBrowserName()==="windows phone"},describe(){return{type:PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test(s){const a=Number(String(s.getOSVersion()).split(".")[0]);return s.getOSName(!0)==="android"&&a>=3},describe(){return{type:PLATFORMS_MAP.tablet}}},{test(s){return s.getOSName(!0)==="android"},describe(){return{type:PLATFORMS_MAP.mobile}}},{test(s){return s.getOSName(!0)==="macos"},describe(){return{type:PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test(s){return s.getOSName(!0)==="windows"},describe(){return{type:PLATFORMS_MAP.desktop}}},{test(s){return s.getOSName(!0)==="linux"},describe(){return{type:PLATFORMS_MAP.desktop}}},{test(s){return s.getOSName(!0)==="playstation 4"},describe(){return{type:PLATFORMS_MAP.tv}}},{test(s){return s.getOSName(!0)==="roku"},describe(){return{type:PLATFORMS_MAP.tv}}}],enginesParsersList=[{test(s){return s.getBrowserName(!0)==="microsoft edge"},describe(s){if(/\sedg\//i.test(s))return{name:ENGINE_MAP.Blink};const u=Utils.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,s);return{name:ENGINE_MAP.EdgeHTML,version:u}}},{test:[/trident/i],describe(s){const a={name:ENGINE_MAP.Trident},u=Utils.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,s);return u&&(a.version=u),a}},{test(s){return s.test(/presto/i)},describe(s){const a={name:ENGINE_MAP.Presto},u=Utils.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,s);return u&&(a.version=u),a}},{test(s){const a=s.test(/gecko/i),u=s.test(/like gecko/i);return a&&!u},describe(s){const a={name:ENGINE_MAP.Gecko},u=Utils.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,s);return u&&(a.version=u),a}},{test:[/(apple)?webkit\/537\.36/i],describe(){return{name:ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe(s){const a={name:ENGINE_MAP.WebKit},u=Utils.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,s);return u&&(a.version=u),a}}];let Parser$2=class{constructor(a,u=!1){if(a==null||a==="")throw new Error("UserAgent parameter can't be empty");this._ua=a,this.parsedResult={},u!==!0&&this.parse()}getUA(){return this._ua}test(a){return a.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const a=Utils.find(browsersList,u=>{if(typeof u.test=="function")return u.test(this);if(u.test instanceof Array)return u.test.some(l=>this.test(l));throw new Error("Browser's test function is not valid")});return a&&(this.parsedResult.browser=a.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(a){return a?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const a=Utils.find(osParsersList,u=>{if(typeof u.test=="function")return u.test(this);if(u.test instanceof Array)return u.test.some(l=>this.test(l));throw new Error("Browser's test function is not valid")});return a&&(this.parsedResult.os=a.describe(this.getUA())),this.parsedResult.os}getOSName(a){const{name:u}=this.getOS();return a?String(u).toLowerCase()||"":u||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(a=!1){const{type:u}=this.getPlatform();return a?String(u).toLowerCase()||"":u||""}parsePlatform(){this.parsedResult.platform={};const a=Utils.find(platformParsersList,u=>{if(typeof u.test=="function")return u.test(this);if(u.test instanceof Array)return u.test.some(l=>this.test(l));throw new Error("Browser's test function is not valid")});return a&&(this.parsedResult.platform=a.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(a){return a?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const a=Utils.find(enginesParsersList,u=>{if(typeof u.test=="function")return u.test(this);if(u.test instanceof Array)return u.test.some(l=>this.test(l));throw new Error("Browser's test function is not valid")});return a&&(this.parsedResult.engine=a.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return Utils.assign({},this.parsedResult)}satisfies(a){const u={};let l=0;const f={};let c=0;if(Object.keys(a).forEach(p=>{const v=a[p];typeof v=="string"?(f[p]=v,c+=1):typeof v=="object"&&(u[p]=v,l+=1)}),l>0){const p=Object.keys(u),v=Utils.find(p,b=>this.isOS(b));if(v){const b=this.satisfies(u[v]);if(b!==void 0)return b}const y=Utils.find(p,b=>this.isPlatform(b));if(y){const b=this.satisfies(u[y]);if(b!==void 0)return b}}if(c>0){const p=Object.keys(f),v=Utils.find(p,y=>this.isBrowser(y,!0));if(v!==void 0)return this.compareVersion(f[v])}}isBrowser(a,u=!1){const l=this.getBrowserName().toLowerCase();let f=a.toLowerCase();const c=Utils.getBrowserTypeByAlias(f);return u&&c&&(f=c.toLowerCase()),f===l}compareVersion(a){let u=[0],l=a,f=!1;const c=this.getBrowserVersion();if(typeof c=="string")return a[0]===">"||a[0]==="<"?(l=a.substr(1),a[1]==="="?(f=!0,l=a.substr(2)):u=[],a[0]===">"?u.push(1):u.push(-1)):a[0]==="="?l=a.substr(1):a[0]==="~"&&(f=!0,l=a.substr(1)),u.indexOf(Utils.compareVersions(c,l,f))>-1}isOS(a){return this.getOSName(!0)===String(a).toLowerCase()}isPlatform(a){return this.getPlatformType(!0)===String(a).toLowerCase()}isEngine(a){return this.getEngineName(!0)===String(a).toLowerCase()}is(a,u=!1){return this.isBrowser(a,u)||this.isOS(a)||this.isPlatform(a)}some(a=[]){return a.some(u=>this.is(u))}};/*!
 * Bowser - a browser detector
 * https://github.com/lancedikson/bowser
 * MIT License | (c) Dustin Diaz 2012-2015
 * MIT License | (c) Denis Demchenko 2015-2019
 */class Bowser{static getParser(a,u=!1){if(typeof a!="string")throw new Error("UserAgent should be a string");return new Parser$2(a,u)}static parse(a){return new Parser$2(a).getResult()}static get BROWSER_MAP(){return BROWSER_MAP}static get ENGINE_MAP(){return ENGINE_MAP}static get OS_MAP(){return OS_MAP}static get PLATFORMS_MAP(){return PLATFORMS_MAP}}var loglevel$d={exports:{}},loglevel$c=loglevel$d.exports,hasRequiredLoglevel$5;function requireLoglevel$5(){return hasRequiredLoglevel$5||(hasRequiredLoglevel$5=1,function(s){(function(a,u){s.exports?s.exports=u():a.log=u()})(loglevel$c,function(){var a=function(){},u="undefined",l=typeof window!==u&&typeof window.navigator!==u&&/Trident\/|MSIE /.test(window.navigator.userAgent),f=["trace","debug","info","warn","error"],c={},h=null;function p(I,B){var N=I[B];if(typeof N.bind=="function")return N.bind(I);try{return Function.prototype.bind.call(N,I)}catch{return function(){return Function.prototype.apply.apply(N,[I,arguments])}}}function v(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function y(I){return I==="debug"&&(I="log"),typeof console===u?!1:I==="trace"&&l?v:console[I]!==void 0?p(console,I):console.log!==void 0?p(console,"log"):a}function b(){for(var I=this.getLevel(),B=0;B<f.length;B++){var N=f[B];this[N]=B<I?a:this.methodFactory(N,I,this.name)}if(this.log=this.debug,typeof console===u&&I<this.levels.SILENT)return"No console available for logging"}function S(I){return function(){typeof console!==u&&(b.call(this),this[I].apply(this,arguments))}}function E(I,B,N){return y(I)||S.apply(this,arguments)}function R(I,B){var N=this,D,G,V,U="loglevel";typeof I=="string"?U+=":"+I:typeof I=="symbol"&&(U=void 0);function te(k){var d=(f[k]||"silent").toUpperCase();if(!(typeof window===u||!U)){try{window.localStorage[U]=d;return}catch{}try{window.document.cookie=encodeURIComponent(U)+"="+d+";"}catch{}}}function Z(){var k;if(!(typeof window===u||!U)){try{k=window.localStorage[U]}catch{}if(typeof k===u)try{var d=window.document.cookie,g=encodeURIComponent(U),_=d.indexOf(g+"=");_!==-1&&(k=/^([^;]+)/.exec(d.slice(_+g.length+1))[1])}catch{}return N.levels[k]===void 0&&(k=void 0),k}}function J(){if(!(typeof window===u||!U)){try{window.localStorage.removeItem(U)}catch{}try{window.document.cookie=encodeURIComponent(U)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function Q(k){var d=k;if(typeof d=="string"&&N.levels[d.toUpperCase()]!==void 0&&(d=N.levels[d.toUpperCase()]),typeof d=="number"&&d>=0&&d<=N.levels.SILENT)return d;throw new TypeError("log.setLevel() called with invalid level: "+k)}N.name=I,N.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},N.methodFactory=B||E,N.getLevel=function(){return V??G??D},N.setLevel=function(k,d){return V=Q(k),d!==!1&&te(V),b.call(N)},N.setDefaultLevel=function(k){G=Q(k),Z()||N.setLevel(k,!1)},N.resetLevel=function(){V=null,J(),b.call(N)},N.enableAll=function(k){N.setLevel(N.levels.TRACE,k)},N.disableAll=function(k){N.setLevel(N.levels.SILENT,k)},N.rebuild=function(){if(h!==N&&(D=Q(h.getLevel())),b.call(N),h===N)for(var k in c)c[k].rebuild()},D=Q(h?h.getLevel():"WARN");var ee=Z();ee!=null&&(V=Q(ee)),b.call(N)}h=new R,h.getLogger=function(B){if(typeof B!="symbol"&&typeof B!="string"||B==="")throw new TypeError("You must supply a name when creating a logger.");var N=c[B];return N||(N=c[B]=new R(B,h.methodFactory)),N};var O=typeof window!==u?window.log:void 0;return h.noConflict=function(){return typeof window!==u&&window.log===h&&(window.log=O),h},h.getLoggers=function(){return c},h.default=h,h})}(loglevel$d)),loglevel$d.exports}var loglevelExports$5=requireLoglevel$5();const loglevel$b=getDefaultExportFromCjs(loglevelExports$5);function isPromise$1(s){return!!(s&&typeof s.then=="function")}Promise.resolve(!1);Promise.resolve(!0);var PROMISE_RESOLVED_VOID=Promise.resolve();function sleep(s,a){return s||(s=0),new Promise(function(u){return setTimeout(function(){return u(a)},s)})}function randomInt(s,a){return Math.floor(Math.random()*(a-s+1)+s)}function randomToken(){return Math.random().toString(36).substring(2)}var lastMs=0,additional=0;function microSeconds$5(){var s=new Date().getTime();return s===lastMs?(additional++,s*1e3+additional):(lastMs=s,additional=0,s*1e3)}function are3PCSupported$1(){if(typeof navigator>"u")return!1;var s=Bowser.parse(navigator.userAgent);log$8.info(JSON.stringify(s),"current browser info");var a=!0;return navigator.brave&&(a=!1),(s.engine.name===Bowser.ENGINE_MAP.WebKit||s.engine.name===Bowser.ENGINE_MAP.Gecko)&&(a=!1),a}var log$8=loglevel$b.getLogger("broadcast-channel");log$8.setLevel("error");var microSeconds$4=microSeconds$5,type$4="native";function create$4(s){var a={messagesCallback:null,bc:new BroadcastChannel(s),subFns:[]};return a.bc.onmessage=function(u){a.messagesCallback&&a.messagesCallback(u.data)},a}function close$4(s){s.bc.close(),s.subFns=[]}function postMessage$4(s,a){try{return s.bc.postMessage(a,!1),PROMISE_RESOLVED_VOID}catch(u){return Promise.reject(u)}}function onMessage$4(s,a){s.messagesCallback=a}function canBeUsed$4(s){if(typeof window>"u"||!s.support3PC)return!1;if(typeof BroadcastChannel=="function"){if(BroadcastChannel._pubkey)throw new Error("BroadcastChannel: Do not overwrite window.BroadcastChannel with this module, this is not a polyfill");return!0}else return!1}function averageResponseTime$4(){return 150}const NativeMethod={create:create$4,close:close$4,onMessage:onMessage$4,postMessage:postMessage$4,canBeUsed:canBeUsed$4,type:type$4,averageResponseTime:averageResponseTime$4,microSeconds:microSeconds$4};var ObliviousSet=function(){function s(a){this.ttl=a,this.map=new Map,this._to=!1}return s.prototype.has=function(a){return this.map.has(a)},s.prototype.add=function(a){var u=this;this.map.set(a,now()),this._to||(this._to=!0,setTimeout(function(){u._to=!1,removeTooOldValues(u)},0))},s.prototype.clear=function(){this.map.clear()},s}();function removeTooOldValues(s){for(var a=now()-s.ttl,u=s.map[Symbol.iterator]();;){var l=u.next().value;if(!l)return;var f=l[0],c=l[1];if(c<a)s.map.delete(f);else return}}function now(){return new Date().getTime()}function fillOptionsWithDefaults(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=JSON.parse(JSON.stringify(s));return typeof a.support3PC>"u"&&(a.support3PC=are3PCSupported$1()),typeof a.webWorkerSupport>"u"&&(a.webWorkerSupport=!0),a.idb||(a.idb={}),a.idb.ttl||(a.idb.ttl=1e3*45),a.idb.fallbackInterval||(a.idb.fallbackInterval=150),s.idb&&typeof s.idb.onclose=="function"&&(a.idb.onclose=s.idb.onclose),a.localstorage||(a.localstorage={}),a.localstorage.removeTimeout||(a.localstorage.removeTimeout=1e3*60),a.server||(a.server={}),a.server.url||(a.server.url="https://broadcast-server.tor.us"),a.server.removeTimeout||(a.server.removeTimeout=1e3*60*5),s.methods&&(a.methods=s.methods),a}var microSeconds$3=microSeconds$5,DB_PREFIX="pubkey.broadcast-channel-0-",OBJECT_STORE_ID="messages",TRANSACTION_SETTINGS={durability:"relaxed"},type$3="idb";function getIdb(){if(typeof indexedDB<"u")return indexedDB;if(typeof window<"u"){if(typeof window.mozIndexedDB<"u")return window.mozIndexedDB;if(typeof window.webkitIndexedDB<"u")return window.webkitIndexedDB;if(typeof window.msIndexedDB<"u")return window.msIndexedDB}return!1}function commitIndexedDBTransaction(s){s.commit&&s.commit()}function createDatabase(s){var a=getIdb(),u=DB_PREFIX+s,l=a.open(u);l.onupgradeneeded=function(c){var h=c.target.result;h.createObjectStore(OBJECT_STORE_ID,{keyPath:"id",autoIncrement:!0})};var f=new Promise(function(c,h){l.onerror=function(p){return h(p)},l.onsuccess=function(){c(l.result)}});return f}function writeMessage(s,a,u){var l=new Date().getTime(),f={uuid:a,time:l,data:u},c=s.transaction([OBJECT_STORE_ID],"readwrite",TRANSACTION_SETTINGS);return new Promise(function(h,p){c.oncomplete=function(){return h()},c.onerror=function(y){return p(y)};var v=c.objectStore(OBJECT_STORE_ID);v.add(f),commitIndexedDBTransaction(c)})}function getMessagesHigherThan(s,a){var u=s.transaction(OBJECT_STORE_ID,"readonly",TRANSACTION_SETTINGS),l=u.objectStore(OBJECT_STORE_ID),f=[],c=IDBKeyRange.bound(a+1,1/0);if(l.getAll){var h=l.getAll(c);return new Promise(function(v,y){h.onerror=function(b){return y(b)},h.onsuccess=function(b){v(b.target.result)}})}function p(){try{return c=IDBKeyRange.bound(a+1,1/0),l.openCursor(c)}catch{return l.openCursor()}}return new Promise(function(v,y){var b=p();b.onerror=function(S){return y(S)},b.onsuccess=function(S){var E=S.target.result;E?E.value.id<a+1?E.continue(a+1):(f.push(E.value),E.continue()):(commitIndexedDBTransaction(u),v(f))}})}function removeMessagesById(s,a){var u=s.transaction([OBJECT_STORE_ID],"readwrite",TRANSACTION_SETTINGS),l=u.objectStore(OBJECT_STORE_ID);return Promise.all(a.map(function(f){var c=l.delete(f);return new Promise(function(h){c.onsuccess=function(){return h()}})}))}function getOldMessages(s,a){var u=new Date().getTime()-a,l=s.transaction(OBJECT_STORE_ID,"readonly",TRANSACTION_SETTINGS),f=l.objectStore(OBJECT_STORE_ID),c=[];return new Promise(function(h){f.openCursor().onsuccess=function(p){var v=p.target.result;if(v){var y=v.value;if(y.time<u)c.push(y),v.continue();else{commitIndexedDBTransaction(l),h(c);return}}else h(c)}})}function cleanOldMessages(s,a){return getOldMessages(s,a).then(function(u){return removeMessagesById(s,u.map(function(l){return l.id}))})}function create$3(s,a){return a=fillOptionsWithDefaults(a),createDatabase(s).then(function(u){var l={closed:!1,lastCursorId:0,channelName:s,options:a,uuid:randomToken(),eMIs:new ObliviousSet(a.idb.ttl*2),writeBlockPromise:PROMISE_RESOLVED_VOID,messagesCallback:null,readQueuePromises:[],db:u};return u.onclose=function(){l.closed=!0,a.idb.onclose&&a.idb.onclose()},_readLoop(l),l})}function _readLoop(s){s.closed||readNewMessages(s).then(function(){return sleep(s.options.idb.fallbackInterval)}).then(function(){return _readLoop(s)})}function _filterMessage(s,a){return!(s.uuid===a.uuid||a.eMIs.has(s.id)||s.data.time<a.messagesCallbackTime)}function readNewMessages(s){return s.closed||!s.messagesCallback?PROMISE_RESOLVED_VOID:getMessagesHigherThan(s.db,s.lastCursorId).then(function(a){var u=a.filter(function(l){return!!l}).map(function(l){return l.id>s.lastCursorId&&(s.lastCursorId=l.id),l}).filter(function(l){return _filterMessage(l,s)}).sort(function(l,f){return l.time-f.time});return u.forEach(function(l){s.messagesCallback&&(s.eMIs.add(l.id),s.messagesCallback(l.data))}),PROMISE_RESOLVED_VOID})}function close$3(s){s.closed=!0,s.db.close()}function postMessage$3(s,a){return s.writeBlockPromise=s.writeBlockPromise.then(function(){return writeMessage(s.db,s.uuid,a)}).then(function(){randomInt(0,10)===0&&cleanOldMessages(s.db,s.options.idb.ttl)}),s.writeBlockPromise}function onMessage$3(s,a,u){s.messagesCallbackTime=u,s.messagesCallback=a,readNewMessages(s)}function canBeUsed$3(s){if(!s.support3PC)return!1;var a=getIdb();return!!a}function averageResponseTime$3(s){return s.idb.fallbackInterval*2}const IndexeDbMethod={create:create$3,close:close$3,onMessage:onMessage$3,postMessage:postMessage$3,canBeUsed:canBeUsed$3,type:type$3,averageResponseTime:averageResponseTime$3,microSeconds:microSeconds$3};var microSeconds$2=microSeconds$5,KEY_PREFIX$1="pubkey.broadcastChannel-",type$2="localstorage";function getLocalStorage(){var s;if(typeof window>"u")return null;try{s=window.localStorage,s=window["ie8-eventlistener/storage"]||window.localStorage}catch{}return s}function storageKey$1(s){return KEY_PREFIX$1+s}function postMessage$2(s,a){return new Promise(function(u){sleep().then(function(){var l=storageKey$1(s.channelName),f={token:randomToken(),time:new Date().getTime(),data:a,uuid:s.uuid},c=JSON.stringify(f);getLocalStorage().setItem(l,c);var h=document.createEvent("Event");h.initEvent("storage",!0,!0),h.key=l,h.newValue=c,window.dispatchEvent(h),u()})})}function addStorageEventListener(s,a){var u=storageKey$1(s),l=function(c){c.key===u&&a(JSON.parse(c.newValue))};return window.addEventListener("storage",l),l}function removeStorageEventListener(s){window.removeEventListener("storage",s)}function create$2(s,a){if(a=fillOptionsWithDefaults(a),!canBeUsed$2(a))throw new Error("BroadcastChannel: localstorage cannot be used");var u=randomToken(),l=new ObliviousSet(a.localstorage.removeTimeout),f={channelName:s,uuid:u,eMIs:l};return f.listener=addStorageEventListener(s,function(c){f.messagesCallback&&c.uuid!==u&&(!c.token||l.has(c.token)||c.data.time&&c.data.time<f.messagesCallbackTime||(l.add(c.token),f.messagesCallback(c.data)))}),f}function close$2(s){removeStorageEventListener(s.listener)}function onMessage$2(s,a,u){s.messagesCallbackTime=u,s.messagesCallback=a}function canBeUsed$2(s){if(!s.support3PC)return!1;var a=getLocalStorage();if(!a)return!1;try{var u="__broadcastchannel_check";a.setItem(u,"works"),a.removeItem(u)}catch{return!1}return!0}function averageResponseTime$2(){var s=120,a=navigator.userAgent.toLowerCase();return a.includes("safari")&&!a.includes("chrome")?s*2:s}const LocalstorageMethod={create:create$2,close:close$2,onMessage:onMessage$2,postMessage:postMessage$2,canBeUsed:canBeUsed$2,type:type$2,averageResponseTime:averageResponseTime$2,microSeconds:microSeconds$2};function asyncGeneratorStep(s,a,u,l,f,c,h){try{var p=s[c](h),v=p.value}catch(y){return void u(y)}p.done?a(v):Promise.resolve(v).then(l,f)}function _asyncToGenerator(s){return function(){var a=this,u=arguments;return new Promise(function(l,f){var c=s.apply(a,u);function h(v){asyncGeneratorStep(c,l,f,h,p,"next",v)}function p(v){asyncGeneratorStep(c,l,f,h,p,"throw",v)}h(void 0)})}}var regeneratorRuntime$1={exports:{}},_typeof={exports:{}},hasRequired_typeof;function require_typeof(){return hasRequired_typeof||(hasRequired_typeof=1,function(s){function a(u){"@babel/helpers - typeof";return s.exports=a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},s.exports.__esModule=!0,s.exports.default=s.exports,a(u)}s.exports=a,s.exports.__esModule=!0,s.exports.default=s.exports}(_typeof)),_typeof.exports}var hasRequiredRegeneratorRuntime;function requireRegeneratorRuntime(){return hasRequiredRegeneratorRuntime||(hasRequiredRegeneratorRuntime=1,function(s){var a=require_typeof().default;function u(){s.exports=u=function(){return f},s.exports.__esModule=!0,s.exports.default=s.exports;var l,f={},c=Object.prototype,h=c.hasOwnProperty,p=Object.defineProperty||function(T,m,M){T[m]=M.value},v=typeof Symbol=="function"?Symbol:{},y=v.iterator||"@@iterator",b=v.asyncIterator||"@@asyncIterator",S=v.toStringTag||"@@toStringTag";function E(T,m,M){return Object.defineProperty(T,m,{value:M,enumerable:!0,configurable:!0,writable:!0}),T[m]}try{E({},"")}catch{E=function(M,W,Y){return M[W]=Y}}function R(T,m,M,W){var Y=m&&m.prototype instanceof V?m:V,ue=Object.create(Y.prototype),ge=new P(W||[]);return p(ue,"_invoke",{value:g(T,M,ge)}),ue}function O(T,m,M){try{return{type:"normal",arg:T.call(m,M)}}catch(W){return{type:"throw",arg:W}}}f.wrap=R;var I="suspendedStart",B="suspendedYield",N="executing",D="completed",G={};function V(){}function U(){}function te(){}var Z={};E(Z,y,function(){return this});var J=Object.getPrototypeOf,Q=J&&J(J($([])));Q&&Q!==c&&h.call(Q,y)&&(Z=Q);var ee=te.prototype=V.prototype=Object.create(Z);function k(T){["next","throw","return"].forEach(function(m){E(T,m,function(M){return this._invoke(m,M)})})}function d(T,m){function M(Y,ue,ge,he){var ae=O(T[Y],T,ue);if(ae.type!=="throw"){var de=ae.arg,pe=de.value;return pe&&a(pe)=="object"&&h.call(pe,"__await")?m.resolve(pe.__await).then(function(oe){M("next",oe,ge,he)},function(oe){M("throw",oe,ge,he)}):m.resolve(pe).then(function(oe){de.value=oe,ge(de)},function(oe){return M("throw",oe,ge,he)})}he(ae.arg)}var W;p(this,"_invoke",{value:function(ue,ge){function he(){return new m(function(ae,de){M(ue,ge,ae,de)})}return W=W?W.then(he,he):he()}})}function g(T,m,M){var W=I;return function(Y,ue){if(W===N)throw Error("Generator is already running");if(W===D){if(Y==="throw")throw ue;return{value:l,done:!0}}for(M.method=Y,M.arg=ue;;){var ge=M.delegate;if(ge){var he=_(ge,M);if(he){if(he===G)continue;return he}}if(M.method==="next")M.sent=M._sent=M.arg;else if(M.method==="throw"){if(W===I)throw W=D,M.arg;M.dispatchException(M.arg)}else M.method==="return"&&M.abrupt("return",M.arg);W=N;var ae=O(T,m,M);if(ae.type==="normal"){if(W=M.done?D:B,ae.arg===G)continue;return{value:ae.arg,done:M.done}}ae.type==="throw"&&(W=D,M.method="throw",M.arg=ae.arg)}}}function _(T,m){var M=m.method,W=T.iterator[M];if(W===l)return m.delegate=null,M==="throw"&&T.iterator.return&&(m.method="return",m.arg=l,_(T,m),m.method==="throw")||M!=="return"&&(m.method="throw",m.arg=new TypeError("The iterator does not provide a '"+M+"' method")),G;var Y=O(W,T.iterator,m.arg);if(Y.type==="throw")return m.method="throw",m.arg=Y.arg,m.delegate=null,G;var ue=Y.arg;return ue?ue.done?(m[T.resultName]=ue.value,m.next=T.nextLoc,m.method!=="return"&&(m.method="next",m.arg=l),m.delegate=null,G):ue:(m.method="throw",m.arg=new TypeError("iterator result is not an object"),m.delegate=null,G)}function w(T){var m={tryLoc:T[0]};1 in T&&(m.catchLoc=T[1]),2 in T&&(m.finallyLoc=T[2],m.afterLoc=T[3]),this.tryEntries.push(m)}function x(T){var m=T.completion||{};m.type="normal",delete m.arg,T.completion=m}function P(T){this.tryEntries=[{tryLoc:"root"}],T.forEach(w,this),this.reset(!0)}function $(T){if(T||T===""){var m=T[y];if(m)return m.call(T);if(typeof T.next=="function")return T;if(!isNaN(T.length)){var M=-1,W=function Y(){for(;++M<T.length;)if(h.call(T,M))return Y.value=T[M],Y.done=!1,Y;return Y.value=l,Y.done=!0,Y};return W.next=W}}throw new TypeError(a(T)+" is not iterable")}return U.prototype=te,p(ee,"constructor",{value:te,configurable:!0}),p(te,"constructor",{value:U,configurable:!0}),U.displayName=E(te,S,"GeneratorFunction"),f.isGeneratorFunction=function(T){var m=typeof T=="function"&&T.constructor;return!!m&&(m===U||(m.displayName||m.name)==="GeneratorFunction")},f.mark=function(T){return Object.setPrototypeOf?Object.setPrototypeOf(T,te):(T.__proto__=te,E(T,S,"GeneratorFunction")),T.prototype=Object.create(ee),T},f.awrap=function(T){return{__await:T}},k(d.prototype),E(d.prototype,b,function(){return this}),f.AsyncIterator=d,f.async=function(T,m,M,W,Y){Y===void 0&&(Y=Promise);var ue=new d(R(T,m,M,W),Y);return f.isGeneratorFunction(m)?ue:ue.next().then(function(ge){return ge.done?ge.value:ue.next()})},k(ee),E(ee,S,"Generator"),E(ee,y,function(){return this}),E(ee,"toString",function(){return"[object Generator]"}),f.keys=function(T){var m=Object(T),M=[];for(var W in m)M.push(W);return M.reverse(),function Y(){for(;M.length;){var ue=M.pop();if(ue in m)return Y.value=ue,Y.done=!1,Y}return Y.done=!0,Y}},f.values=$,P.prototype={constructor:P,reset:function(m){if(this.prev=0,this.next=0,this.sent=this._sent=l,this.done=!1,this.delegate=null,this.method="next",this.arg=l,this.tryEntries.forEach(x),!m)for(var M in this)M.charAt(0)==="t"&&h.call(this,M)&&!isNaN(+M.slice(1))&&(this[M]=l)},stop:function(){this.done=!0;var m=this.tryEntries[0].completion;if(m.type==="throw")throw m.arg;return this.rval},dispatchException:function(m){if(this.done)throw m;var M=this;function W(de,pe){return ge.type="throw",ge.arg=m,M.next=de,pe&&(M.method="next",M.arg=l),!!pe}for(var Y=this.tryEntries.length-1;Y>=0;--Y){var ue=this.tryEntries[Y],ge=ue.completion;if(ue.tryLoc==="root")return W("end");if(ue.tryLoc<=this.prev){var he=h.call(ue,"catchLoc"),ae=h.call(ue,"finallyLoc");if(he&&ae){if(this.prev<ue.catchLoc)return W(ue.catchLoc,!0);if(this.prev<ue.finallyLoc)return W(ue.finallyLoc)}else if(he){if(this.prev<ue.catchLoc)return W(ue.catchLoc,!0)}else{if(!ae)throw Error("try statement without catch or finally");if(this.prev<ue.finallyLoc)return W(ue.finallyLoc)}}}},abrupt:function(m,M){for(var W=this.tryEntries.length-1;W>=0;--W){var Y=this.tryEntries[W];if(Y.tryLoc<=this.prev&&h.call(Y,"finallyLoc")&&this.prev<Y.finallyLoc){var ue=Y;break}}ue&&(m==="break"||m==="continue")&&ue.tryLoc<=M&&M<=ue.finallyLoc&&(ue=null);var ge=ue?ue.completion:{};return ge.type=m,ge.arg=M,ue?(this.method="next",this.next=ue.finallyLoc,G):this.complete(ge)},complete:function(m,M){if(m.type==="throw")throw m.arg;return m.type==="break"||m.type==="continue"?this.next=m.arg:m.type==="return"?(this.rval=this.arg=m.arg,this.method="return",this.next="end"):m.type==="normal"&&M&&(this.next=M),G},finish:function(m){for(var M=this.tryEntries.length-1;M>=0;--M){var W=this.tryEntries[M];if(W.finallyLoc===m)return this.complete(W.completion,W.afterLoc),x(W),G}},catch:function(m){for(var M=this.tryEntries.length-1;M>=0;--M){var W=this.tryEntries[M];if(W.tryLoc===m){var Y=W.completion;if(Y.type==="throw"){var ue=Y.arg;x(W)}return ue}}throw Error("illegal catch attempt")},delegateYield:function(m,M,W){return this.delegate={iterator:$(m),resultName:M,nextLoc:W},this.method==="next"&&(this.arg=l),G}},f}s.exports=u,s.exports.__esModule=!0,s.exports.default=s.exports}(regeneratorRuntime$1)),regeneratorRuntime$1.exports}var regenerator,hasRequiredRegenerator;function requireRegenerator(){if(hasRequiredRegenerator)return regenerator;hasRequiredRegenerator=1;var s=requireRegeneratorRuntime()();regenerator=s;try{regeneratorRuntime=s}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=s:Function("r","regeneratorRuntime = r")(s)}return regenerator}var regeneratorExports=requireRegenerator();const _regeneratorRuntime=getDefaultExportFromCjs(regeneratorExports),PACKET_TYPES=Object.create(null);PACKET_TYPES.open="0";PACKET_TYPES.close="1";PACKET_TYPES.ping="2";PACKET_TYPES.pong="3";PACKET_TYPES.message="4";PACKET_TYPES.upgrade="5";PACKET_TYPES.noop="6";const PACKET_TYPES_REVERSE=Object.create(null);Object.keys(PACKET_TYPES).forEach(s=>{PACKET_TYPES_REVERSE[PACKET_TYPES[s]]=s});const ERROR_PACKET={type:"error",data:"parser error"},withNativeBlob$1=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",withNativeArrayBuffer$2=typeof ArrayBuffer=="function",isView$2=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer,encodePacket=({type:s,data:a},u,l)=>withNativeBlob$1&&a instanceof Blob?u?l(a):encodeBlobAsBase64(a,l):withNativeArrayBuffer$2&&(a instanceof ArrayBuffer||isView$2(a))?u?l(a):encodeBlobAsBase64(new Blob([a]),l):l(PACKET_TYPES[s]+(a||"")),encodeBlobAsBase64=(s,a)=>{const u=new FileReader;return u.onload=function(){const l=u.result.split(",")[1];a("b"+(l||""))},u.readAsDataURL(s)};function toArray(s){return s instanceof Uint8Array?s:s instanceof ArrayBuffer?new Uint8Array(s):new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}let TEXT_ENCODER;function encodePacketToBinary(s,a){if(withNativeBlob$1&&s.data instanceof Blob)return s.data.arrayBuffer().then(toArray).then(a);if(withNativeArrayBuffer$2&&(s.data instanceof ArrayBuffer||isView$2(s.data)))return a(toArray(s.data));encodePacket(s,!1,u=>{TEXT_ENCODER||(TEXT_ENCODER=new TextEncoder),a(TEXT_ENCODER.encode(u))})}const chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lookup$1=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let s=0;s<chars.length;s++)lookup$1[chars.charCodeAt(s)]=s;const decode$2=s=>{let a=s.length*.75,u=s.length,l,f=0,c,h,p,v;s[s.length-1]==="="&&(a--,s[s.length-2]==="="&&a--);const y=new ArrayBuffer(a),b=new Uint8Array(y);for(l=0;l<u;l+=4)c=lookup$1[s.charCodeAt(l)],h=lookup$1[s.charCodeAt(l+1)],p=lookup$1[s.charCodeAt(l+2)],v=lookup$1[s.charCodeAt(l+3)],b[f++]=c<<2|h>>4,b[f++]=(h&15)<<4|p>>2,b[f++]=(p&3)<<6|v&63;return y},withNativeArrayBuffer$1=typeof ArrayBuffer=="function",decodePacket=(s,a)=>{if(typeof s!="string")return{type:"message",data:mapBinary(s,a)};const u=s.charAt(0);return u==="b"?{type:"message",data:decodeBase64Packet(s.substring(1),a)}:PACKET_TYPES_REVERSE[u]?s.length>1?{type:PACKET_TYPES_REVERSE[u],data:s.substring(1)}:{type:PACKET_TYPES_REVERSE[u]}:ERROR_PACKET},decodeBase64Packet=(s,a)=>{if(withNativeArrayBuffer$1){const u=decode$2(s);return mapBinary(u,a)}else return{base64:!0,data:s}},mapBinary=(s,a)=>{switch(a){case"blob":return s instanceof Blob?s:new Blob([s]);case"arraybuffer":default:return s instanceof ArrayBuffer?s:s.buffer}},SEPARATOR="",encodePayload=(s,a)=>{const u=s.length,l=new Array(u);let f=0;s.forEach((c,h)=>{encodePacket(c,!1,p=>{l[h]=p,++f===u&&a(l.join(SEPARATOR))})})},decodePayload=(s,a)=>{const u=s.split(SEPARATOR),l=[];for(let f=0;f<u.length;f++){const c=decodePacket(u[f],a);if(l.push(c),c.type==="error")break}return l};function createPacketEncoderStream(){return new TransformStream({transform(s,a){encodePacketToBinary(s,u=>{const l=u.length;let f;if(l<126)f=new Uint8Array(1),new DataView(f.buffer).setUint8(0,l);else if(l<65536){f=new Uint8Array(3);const c=new DataView(f.buffer);c.setUint8(0,126),c.setUint16(1,l)}else{f=new Uint8Array(9);const c=new DataView(f.buffer);c.setUint8(0,127),c.setBigUint64(1,BigInt(l))}s.data&&typeof s.data!="string"&&(f[0]|=128),a.enqueue(f),a.enqueue(u)})}})}let TEXT_DECODER;function totalLength(s){return s.reduce((a,u)=>a+u.length,0)}function concatChunks(s,a){if(s[0].length===a)return s.shift();const u=new Uint8Array(a);let l=0;for(let f=0;f<a;f++)u[f]=s[0][l++],l===s[0].length&&(s.shift(),l=0);return s.length&&l<s[0].length&&(s[0]=s[0].slice(l)),u}function createPacketDecoderStream(s,a){TEXT_DECODER||(TEXT_DECODER=new TextDecoder);const u=[];let l=0,f=-1,c=!1;return new TransformStream({transform(h,p){for(u.push(h);;){if(l===0){if(totalLength(u)<1)break;const v=concatChunks(u,1);c=(v[0]&128)===128,f=v[0]&127,f<126?l=3:f===126?l=1:l=2}else if(l===1){if(totalLength(u)<2)break;const v=concatChunks(u,2);f=new DataView(v.buffer,v.byteOffset,v.length).getUint16(0),l=3}else if(l===2){if(totalLength(u)<8)break;const v=concatChunks(u,8),y=new DataView(v.buffer,v.byteOffset,v.length),b=y.getUint32(0);if(b>Math.pow(2,21)-1){p.enqueue(ERROR_PACKET);break}f=b*Math.pow(2,32)+y.getUint32(4),l=3}else{if(totalLength(u)<f)break;const v=concatChunks(u,f);p.enqueue(decodePacket(c?v:TEXT_DECODER.decode(v),a)),l=0}if(f===0||f>s){p.enqueue(ERROR_PACKET);break}}}})}const protocol$1=4;function Emitter(s){if(s)return mixin(s)}function mixin(s){for(var a in Emitter.prototype)s[a]=Emitter.prototype[a];return s}Emitter.prototype.on=Emitter.prototype.addEventListener=function(s,a){return this._callbacks=this._callbacks||{},(this._callbacks["$"+s]=this._callbacks["$"+s]||[]).push(a),this};Emitter.prototype.once=function(s,a){function u(){this.off(s,u),a.apply(this,arguments)}return u.fn=a,this.on(s,u),this};Emitter.prototype.off=Emitter.prototype.removeListener=Emitter.prototype.removeAllListeners=Emitter.prototype.removeEventListener=function(s,a){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var u=this._callbacks["$"+s];if(!u)return this;if(arguments.length==1)return delete this._callbacks["$"+s],this;for(var l,f=0;f<u.length;f++)if(l=u[f],l===a||l.fn===a){u.splice(f,1);break}return u.length===0&&delete this._callbacks["$"+s],this};Emitter.prototype.emit=function(s){this._callbacks=this._callbacks||{};for(var a=new Array(arguments.length-1),u=this._callbacks["$"+s],l=1;l<arguments.length;l++)a[l-1]=arguments[l];if(u){u=u.slice(0);for(var l=0,f=u.length;l<f;++l)u[l].apply(this,a)}return this};Emitter.prototype.emitReserved=Emitter.prototype.emit;Emitter.prototype.listeners=function(s){return this._callbacks=this._callbacks||{},this._callbacks["$"+s]||[]};Emitter.prototype.hasListeners=function(s){return!!this.listeners(s).length};const globalThisShim=typeof self<"u"?self:typeof window<"u"?window:Function("return this")();function pick(s,...a){return a.reduce((u,l)=>(s.hasOwnProperty(l)&&(u[l]=s[l]),u),{})}const NATIVE_SET_TIMEOUT=globalThisShim.setTimeout,NATIVE_CLEAR_TIMEOUT=globalThisShim.clearTimeout;function installTimerFunctions(s,a){a.useNativeTimers?(s.setTimeoutFn=NATIVE_SET_TIMEOUT.bind(globalThisShim),s.clearTimeoutFn=NATIVE_CLEAR_TIMEOUT.bind(globalThisShim)):(s.setTimeoutFn=globalThisShim.setTimeout.bind(globalThisShim),s.clearTimeoutFn=globalThisShim.clearTimeout.bind(globalThisShim))}const BASE64_OVERHEAD=1.33;function byteLength(s){return typeof s=="string"?utf8Length(s):Math.ceil((s.byteLength||s.size)*BASE64_OVERHEAD)}function utf8Length(s){let a=0,u=0;for(let l=0,f=s.length;l<f;l++)a=s.charCodeAt(l),a<128?u+=1:a<2048?u+=2:a<55296||a>=57344?u+=3:(l++,u+=4);return u}function encode$2(s){let a="";for(let u in s)s.hasOwnProperty(u)&&(a.length&&(a+="&"),a+=encodeURIComponent(u)+"="+encodeURIComponent(s[u]));return a}function decode$1(s){let a={},u=s.split("&");for(let l=0,f=u.length;l<f;l++){let c=u[l].split("=");a[decodeURIComponent(c[0])]=decodeURIComponent(c[1])}return a}let TransportError$1=class extends Error{constructor(a,u,l){super(a),this.description=u,this.context=l,this.type="TransportError"}},Transport$1=class extends Emitter{constructor(a){super(),this.writable=!1,installTimerFunctions(this,a),this.opts=a,this.query=a.query,this.socket=a.socket}onError(a,u,l){return super.emitReserved("error",new TransportError$1(a,u,l)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(a){this.readyState==="open"&&this.write(a)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(a){const u=decodePacket(a,this.socket.binaryType);this.onPacket(u)}onPacket(a){super.emitReserved("packet",a)}onClose(a){this.readyState="closed",super.emitReserved("close",a)}pause(a){}createUri(a,u={}){return a+"://"+this._hostname()+this._port()+this.opts.path+this._query(u)}_hostname(){const a=this.opts.hostname;return a.indexOf(":")===-1?a:"["+a+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(a){const u=encode$2(a);return u.length?"?"+u:""}};const alphabet="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),length=64,map$1={};let seed=0,i$1=0,prev;function encode$1(s){let a="";do a=alphabet[s%length]+a,s=Math.floor(s/length);while(s>0);return a}function yeast(){const s=encode$1(+new Date);return s!==prev?(seed=0,prev=s):s+"."+encode$1(seed++)}for(;i$1<length;i$1++)map$1[alphabet[i$1]]=i$1;let value=!1;try{value=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch(s){}const hasCORS=value;function XHR(s){const a=s.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!a||hasCORS))return new XMLHttpRequest}catch{}if(!a)try{return new globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function createCookieJar(){}function empty(){}const hasXHR2=function(){return new XHR({xdomain:!1}).responseType!=null}();class Polling extends Transport$1{constructor(a){if(super(a),this.polling=!1,typeof location<"u"){const l=location.protocol==="https:";let f=location.port;f||(f=l?"443":"80"),this.xd=typeof location<"u"&&a.hostname!==location.hostname||f!==a.port}const u=a&&a.forceBase64;this.supportsBinary=hasXHR2&&!u,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(a){this.readyState="pausing";const u=()=>{this.readyState="paused",a()};if(this.polling||!this.writable){let l=0;this.polling&&(l++,this.once("pollComplete",function(){--l||u()})),this.writable||(l++,this.once("drain",function(){--l||u()}))}else u()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(a){const u=l=>{if(this.readyState==="opening"&&l.type==="open"&&this.onOpen(),l.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(l)};decodePayload(a,this.socket.binaryType).forEach(u),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const a=()=>{this.write([{type:"close"}])};this.readyState==="open"?a():this.once("open",a)}write(a){this.writable=!1,encodePayload(a,u=>{this.doWrite(u,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const a=this.opts.secure?"https":"http",u=this.query||{};return this.opts.timestampRequests!==!1&&(u[this.opts.timestampParam]=yeast()),!this.supportsBinary&&!u.sid&&(u.b64=1),this.createUri(a,u)}request(a={}){return Object.assign(a,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Request(this.uri(),a)}doWrite(a,u){const l=this.request({method:"POST",data:a});l.on("success",u),l.on("error",(f,c)=>{this.onError("xhr post error",f,c)})}doPoll(){const a=this.request();a.on("data",this.onData.bind(this)),a.on("error",(u,l)=>{this.onError("xhr poll error",u,l)}),this.pollXhr=a}}class Request extends Emitter{constructor(a,u){super(),installTimerFunctions(this,u),this.opts=u,this.method=u.method||"GET",this.uri=a,this.data=u.data!==void 0?u.data:null,this.create()}create(){var a;const u=pick(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");u.xdomain=!!this.opts.xd;const l=this.xhr=new XHR(u);try{l.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){l.setDisableHeaderCheck&&l.setDisableHeaderCheck(!0);for(let f in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(f)&&l.setRequestHeader(f,this.opts.extraHeaders[f])}}catch{}if(this.method==="POST")try{l.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{l.setRequestHeader("Accept","*/*")}catch{}(a=this.opts.cookieJar)===null||a===void 0||a.addCookies(l),"withCredentials"in l&&(l.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(l.timeout=this.opts.requestTimeout),l.onreadystatechange=()=>{var f;l.readyState===3&&((f=this.opts.cookieJar)===null||f===void 0||f.parseCookies(l)),l.readyState===4&&(l.status===200||l.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof l.status=="number"?l.status:0)},0))},l.send(this.data)}catch(f){this.setTimeoutFn(()=>{this.onError(f)},0);return}typeof document<"u"&&(this.index=Request.requestsCount++,Request.requests[this.index]=this)}onError(a){this.emitReserved("error",a,this.xhr),this.cleanup(!0)}cleanup(a){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=empty,a)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Request.requests[this.index],this.xhr=null}}onLoad(){const a=this.xhr.responseText;a!==null&&(this.emitReserved("data",a),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}Request.requestsCount=0;Request.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",unloadHandler);else if(typeof addEventListener=="function"){const s="onpagehide"in globalThisShim?"pagehide":"unload";addEventListener(s,unloadHandler,!1)}}function unloadHandler(){for(let s in Request.requests)Request.requests.hasOwnProperty(s)&&Request.requests[s].abort()}const nextTick=typeof Promise=="function"&&typeof Promise.resolve=="function"?a=>Promise.resolve().then(a):(a,u)=>u(a,0),WebSocket=globalThisShim.WebSocket||globalThisShim.MozWebSocket,usingBrowserWebSocket=!0,defaultBinaryType="arraybuffer",isReactNative=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class WS extends Transport$1{constructor(a){super(a),this.supportsBinary=!a.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const a=this.uri(),u=this.opts.protocols,l=isReactNative?{}:pick(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(l.headers=this.opts.extraHeaders);try{this.ws=usingBrowserWebSocket&&!isReactNative?u?new WebSocket(a,u):new WebSocket(a):new WebSocket(a,u,l)}catch(f){return this.emitReserved("error",f)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=a=>this.onClose({description:"websocket connection closed",context:a}),this.ws.onmessage=a=>this.onData(a.data),this.ws.onerror=a=>this.onError("websocket error",a)}write(a){this.writable=!1;for(let u=0;u<a.length;u++){const l=a[u],f=u===a.length-1;encodePacket(l,this.supportsBinary,c=>{const h={};try{usingBrowserWebSocket&&this.ws.send(c)}catch{}f&&nextTick(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const a=this.opts.secure?"wss":"ws",u=this.query||{};return this.opts.timestampRequests&&(u[this.opts.timestampParam]=yeast()),this.supportsBinary||(u.b64=1),this.createUri(a,u)}check(){return!!WebSocket}}class WT extends Transport$1{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(a=>{this.onError("webtransport error",a)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(a=>{const u=createPacketDecoderStream(Number.MAX_SAFE_INTEGER,this.socket.binaryType),l=a.readable.pipeThrough(u).getReader(),f=createPacketEncoderStream();f.readable.pipeTo(a.writable),this.writer=f.writable.getWriter();const c=()=>{l.read().then(({done:p,value:v})=>{p||(this.onPacket(v),c())}).catch(p=>{})};c();const h={type:"open"};this.query.sid&&(h.data=`{"sid":"${this.query.sid}"}`),this.writer.write(h).then(()=>this.onOpen())})}))}write(a){this.writable=!1;for(let u=0;u<a.length;u++){const l=a[u],f=u===a.length-1;this.writer.write(l).then(()=>{f&&nextTick(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var a;(a=this.transport)===null||a===void 0||a.close()}}const transports={websocket:WS,webtransport:WT,polling:Polling},re$1=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,parts=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function parse$1(s){if(s.length>2e3)throw"URI too long";const a=s,u=s.indexOf("["),l=s.indexOf("]");u!=-1&&l!=-1&&(s=s.substring(0,u)+s.substring(u,l).replace(/:/g,";")+s.substring(l,s.length));let f=re$1.exec(s||""),c={},h=14;for(;h--;)c[parts[h]]=f[h]||"";return u!=-1&&l!=-1&&(c.source=a,c.host=c.host.substring(1,c.host.length-1).replace(/;/g,":"),c.authority=c.authority.replace("[","").replace("]","").replace(/;/g,":"),c.ipv6uri=!0),c.pathNames=pathNames(c,c.path),c.queryKey=queryKey(c,c.query),c}function pathNames(s,a){const u=/\/{2,9}/g,l=a.replace(u,"/").split("/");return(a.slice(0,1)=="/"||a.length===0)&&l.splice(0,1),a.slice(-1)=="/"&&l.splice(l.length-1,1),l}function queryKey(s,a){const u={};return a.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(l,f,c){f&&(u[f]=c)}),u}let Socket$1=class gl extends Emitter{constructor(a,u={}){super(),this.binaryType=defaultBinaryType,this.writeBuffer=[],a&&typeof a=="object"&&(u=a,a=null),a?(a=parse$1(a),u.hostname=a.host,u.secure=a.protocol==="https"||a.protocol==="wss",u.port=a.port,a.query&&(u.query=a.query)):u.host&&(u.hostname=parse$1(u.host).host),installTimerFunctions(this,u),this.secure=u.secure!=null?u.secure:typeof location<"u"&&location.protocol==="https:",u.hostname&&!u.port&&(u.port=this.secure?"443":"80"),this.hostname=u.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=u.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=u.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},u),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=decode$1(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(a){const u=Object.assign({},this.opts.query);u.EIO=protocol$1,u.transport=a,this.id&&(u.sid=this.id);const l=Object.assign({},this.opts,{query:u,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[a]);return new transports[a](l)}open(){let a;if(this.opts.rememberUpgrade&&gl.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)a="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else a=this.transports[0];this.readyState="opening";try{a=this.createTransport(a)}catch{this.transports.shift(),this.open();return}a.open(),this.setTransport(a)}setTransport(a){this.transport&&this.transport.removeAllListeners(),this.transport=a,a.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",u=>this.onClose("transport close",u))}probe(a){let u=this.createTransport(a),l=!1;gl.priorWebsocketSuccess=!1;const f=()=>{l||(u.send([{type:"ping",data:"probe"}]),u.once("packet",S=>{if(!l)if(S.type==="pong"&&S.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",u),!u)return;gl.priorWebsocketSuccess=u.name==="websocket",this.transport.pause(()=>{l||this.readyState!=="closed"&&(b(),this.setTransport(u),u.send([{type:"upgrade"}]),this.emitReserved("upgrade",u),u=null,this.upgrading=!1,this.flush())})}else{const E=new Error("probe error");E.transport=u.name,this.emitReserved("upgradeError",E)}}))};function c(){l||(l=!0,b(),u.close(),u=null)}const h=S=>{const E=new Error("probe error: "+S);E.transport=u.name,c(),this.emitReserved("upgradeError",E)};function p(){h("transport closed")}function v(){h("socket closed")}function y(S){u&&S.name!==u.name&&c()}const b=()=>{u.removeListener("open",f),u.removeListener("error",h),u.removeListener("close",p),this.off("close",v),this.off("upgrading",y)};u.once("open",f),u.once("error",h),u.once("close",p),this.once("close",v),this.once("upgrading",y),this.upgrades.indexOf("webtransport")!==-1&&a!=="webtransport"?this.setTimeoutFn(()=>{l||u.open()},200):u.open()}onOpen(){if(this.readyState="open",gl.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let a=0;const u=this.upgrades.length;for(;a<u;a++)this.probe(this.upgrades[a])}}onPacket(a){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",a),this.emitReserved("heartbeat"),this.resetPingTimeout(),a.type){case"open":this.onHandshake(JSON.parse(a.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const u=new Error("server error");u.code=a.data,this.onError(u);break;case"message":this.emitReserved("data",a.data),this.emitReserved("message",a.data);break}}onHandshake(a){this.emitReserved("handshake",a),this.id=a.sid,this.transport.query.sid=a.sid,this.upgrades=this.filterUpgrades(a.upgrades),this.pingInterval=a.pingInterval,this.pingTimeout=a.pingTimeout,this.maxPayload=a.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const a=this.getWritablePackets();this.transport.send(a),this.prevBufferLen=a.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let u=1;for(let l=0;l<this.writeBuffer.length;l++){const f=this.writeBuffer[l].data;if(f&&(u+=byteLength(f)),l>0&&u>this.maxPayload)return this.writeBuffer.slice(0,l);u+=2}return this.writeBuffer}write(a,u,l){return this.sendPacket("message",a,u,l),this}send(a,u,l){return this.sendPacket("message",a,u,l),this}sendPacket(a,u,l,f){if(typeof u=="function"&&(f=u,u=void 0),typeof l=="function"&&(f=l,l=null),this.readyState==="closing"||this.readyState==="closed")return;l=l||{},l.compress=l.compress!==!1;const c={type:a,data:u,options:l};this.emitReserved("packetCreate",c),this.writeBuffer.push(c),f&&this.once("flush",f),this.flush()}close(){const a=()=>{this.onClose("forced close"),this.transport.close()},u=()=>{this.off("upgrade",u),this.off("upgradeError",u),a()},l=()=>{this.once("upgrade",u),this.once("upgradeError",u)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?l():a()}):this.upgrading?l():a()),this}onError(a){gl.priorWebsocketSuccess=!1,this.emitReserved("error",a),this.onClose("transport error",a)}onClose(a,u){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",a,u),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(a){const u=[];let l=0;const f=a.length;for(;l<f;l++)~this.transports.indexOf(a[l])&&u.push(a[l]);return u}};Socket$1.protocol=protocol$1;function url(s,a="",u){let l=s;u=u||typeof location<"u"&&location,s==null&&(s=u.protocol+"//"+u.host),typeof s=="string"&&(s.charAt(0)==="/"&&(s.charAt(1)==="/"?s=u.protocol+s:s=u.host+s),/^(https?|wss?):\/\//.test(s)||(typeof u<"u"?s=u.protocol+"//"+s:s="https://"+s),l=parse$1(s)),l.port||(/^(http|ws)$/.test(l.protocol)?l.port="80":/^(http|ws)s$/.test(l.protocol)&&(l.port="443")),l.path=l.path||"/";const c=l.host.indexOf(":")!==-1?"["+l.host+"]":l.host;return l.id=l.protocol+"://"+c+":"+l.port+a,l.href=l.protocol+"://"+c+(u&&u.port===l.port?"":":"+l.port),l}const withNativeArrayBuffer=typeof ArrayBuffer=="function",isView$1=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s.buffer instanceof ArrayBuffer,toString=Object.prototype.toString,withNativeBlob=typeof Blob=="function"||typeof Blob<"u"&&toString.call(Blob)==="[object BlobConstructor]",withNativeFile=typeof File=="function"||typeof File<"u"&&toString.call(File)==="[object FileConstructor]";function isBinary(s){return withNativeArrayBuffer&&(s instanceof ArrayBuffer||isView$1(s))||withNativeBlob&&s instanceof Blob||withNativeFile&&s instanceof File}function hasBinary(s,a){if(!s||typeof s!="object")return!1;if(Array.isArray(s)){for(let u=0,l=s.length;u<l;u++)if(hasBinary(s[u]))return!0;return!1}if(isBinary(s))return!0;if(s.toJSON&&typeof s.toJSON=="function"&&arguments.length===1)return hasBinary(s.toJSON(),!0);for(const u in s)if(Object.prototype.hasOwnProperty.call(s,u)&&hasBinary(s[u]))return!0;return!1}function deconstructPacket(s){const a=[],u=s.data,l=s;return l.data=_deconstructPacket(u,a),l.attachments=a.length,{packet:l,buffers:a}}function _deconstructPacket(s,a){if(!s)return s;if(isBinary(s)){const u={_placeholder:!0,num:a.length};return a.push(s),u}else if(Array.isArray(s)){const u=new Array(s.length);for(let l=0;l<s.length;l++)u[l]=_deconstructPacket(s[l],a);return u}else if(typeof s=="object"&&!(s instanceof Date)){const u={};for(const l in s)Object.prototype.hasOwnProperty.call(s,l)&&(u[l]=_deconstructPacket(s[l],a));return u}return s}function reconstructPacket(s,a){return s.data=_reconstructPacket(s.data,a),delete s.attachments,s}function _reconstructPacket(s,a){if(!s)return s;if(s&&s._placeholder===!0){if(typeof s.num=="number"&&s.num>=0&&s.num<a.length)return a[s.num];throw new Error("illegal attachments")}else if(Array.isArray(s))for(let u=0;u<s.length;u++)s[u]=_reconstructPacket(s[u],a);else if(typeof s=="object")for(const u in s)Object.prototype.hasOwnProperty.call(s,u)&&(s[u]=_reconstructPacket(s[u],a));return s}const RESERVED_EVENTS$1=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],protocol=5;var PacketType;(function(s){s[s.CONNECT=0]="CONNECT",s[s.DISCONNECT=1]="DISCONNECT",s[s.EVENT=2]="EVENT",s[s.ACK=3]="ACK",s[s.CONNECT_ERROR=4]="CONNECT_ERROR",s[s.BINARY_EVENT=5]="BINARY_EVENT",s[s.BINARY_ACK=6]="BINARY_ACK"})(PacketType||(PacketType={}));class Encoder{constructor(a){this.replacer=a}encode(a){return(a.type===PacketType.EVENT||a.type===PacketType.ACK)&&hasBinary(a)?this.encodeAsBinary({type:a.type===PacketType.EVENT?PacketType.BINARY_EVENT:PacketType.BINARY_ACK,nsp:a.nsp,data:a.data,id:a.id}):[this.encodeAsString(a)]}encodeAsString(a){let u=""+a.type;return(a.type===PacketType.BINARY_EVENT||a.type===PacketType.BINARY_ACK)&&(u+=a.attachments+"-"),a.nsp&&a.nsp!=="/"&&(u+=a.nsp+","),a.id!=null&&(u+=a.id),a.data!=null&&(u+=JSON.stringify(a.data,this.replacer)),u}encodeAsBinary(a){const u=deconstructPacket(a),l=this.encodeAsString(u.packet),f=u.buffers;return f.unshift(l),f}}function isObject$1(s){return Object.prototype.toString.call(s)==="[object Object]"}class Decoder extends Emitter{constructor(a){super(),this.reviver=a}add(a){let u;if(typeof a=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");u=this.decodeString(a);const l=u.type===PacketType.BINARY_EVENT;l||u.type===PacketType.BINARY_ACK?(u.type=l?PacketType.EVENT:PacketType.ACK,this.reconstructor=new BinaryReconstructor(u),u.attachments===0&&super.emitReserved("decoded",u)):super.emitReserved("decoded",u)}else if(isBinary(a)||a.base64)if(this.reconstructor)u=this.reconstructor.takeBinaryData(a),u&&(this.reconstructor=null,super.emitReserved("decoded",u));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+a)}decodeString(a){let u=0;const l={type:Number(a.charAt(0))};if(PacketType[l.type]===void 0)throw new Error("unknown packet type "+l.type);if(l.type===PacketType.BINARY_EVENT||l.type===PacketType.BINARY_ACK){const c=u+1;for(;a.charAt(++u)!=="-"&&u!=a.length;);const h=a.substring(c,u);if(h!=Number(h)||a.charAt(u)!=="-")throw new Error("Illegal attachments");l.attachments=Number(h)}if(a.charAt(u+1)==="/"){const c=u+1;for(;++u&&!(a.charAt(u)===","||u===a.length););l.nsp=a.substring(c,u)}else l.nsp="/";const f=a.charAt(u+1);if(f!==""&&Number(f)==f){const c=u+1;for(;++u;){const h=a.charAt(u);if(h==null||Number(h)!=h){--u;break}if(u===a.length)break}l.id=Number(a.substring(c,u+1))}if(a.charAt(++u)){const c=this.tryParse(a.substr(u));if(Decoder.isPayloadValid(l.type,c))l.data=c;else throw new Error("invalid payload")}return l}tryParse(a){try{return JSON.parse(a,this.reviver)}catch{return!1}}static isPayloadValid(a,u){switch(a){case PacketType.CONNECT:return isObject$1(u);case PacketType.DISCONNECT:return u===void 0;case PacketType.CONNECT_ERROR:return typeof u=="string"||isObject$1(u);case PacketType.EVENT:case PacketType.BINARY_EVENT:return Array.isArray(u)&&(typeof u[0]=="number"||typeof u[0]=="string"&&RESERVED_EVENTS$1.indexOf(u[0])===-1);case PacketType.ACK:case PacketType.BINARY_ACK:return Array.isArray(u)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class BinaryReconstructor{constructor(a){this.packet=a,this.buffers=[],this.reconPack=a}takeBinaryData(a){if(this.buffers.push(a),this.buffers.length===this.reconPack.attachments){const u=reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),u}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const parser$1=Object.freeze(Object.defineProperty({__proto__:null,Decoder,Encoder,get PacketType(){return PacketType},protocol},Symbol.toStringTag,{value:"Module"}));function on(s,a,u){return s.on(a,u),function(){s.off(a,u)}}const RESERVED_EVENTS=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Socket extends Emitter{constructor(a,u,l){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=a,this.nsp=u,l&&l.auth&&(this.auth=l.auth),this._opts=Object.assign({},l),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const a=this.io;this.subs=[on(a,"open",this.onopen.bind(this)),on(a,"packet",this.onpacket.bind(this)),on(a,"error",this.onerror.bind(this)),on(a,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...a){return a.unshift("message"),this.emit.apply(this,a),this}emit(a,...u){if(RESERVED_EVENTS.hasOwnProperty(a))throw new Error('"'+a.toString()+'" is a reserved event name');if(u.unshift(a),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(u),this;const l={type:PacketType.EVENT,data:u};if(l.options={},l.options.compress=this.flags.compress!==!1,typeof u[u.length-1]=="function"){const h=this.ids++,p=u.pop();this._registerAckCallback(h,p),l.id=h}const f=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!f||!this.connected)||(this.connected?(this.notifyOutgoingListeners(l),this.packet(l)):this.sendBuffer.push(l)),this.flags={},this}_registerAckCallback(a,u){var l;const f=(l=this.flags.timeout)!==null&&l!==void 0?l:this._opts.ackTimeout;if(f===void 0){this.acks[a]=u;return}const c=this.io.setTimeoutFn(()=>{delete this.acks[a];for(let p=0;p<this.sendBuffer.length;p++)this.sendBuffer[p].id===a&&this.sendBuffer.splice(p,1);u.call(this,new Error("operation has timed out"))},f),h=(...p)=>{this.io.clearTimeoutFn(c),u.apply(this,p)};h.withError=!0,this.acks[a]=h}emitWithAck(a,...u){return new Promise((l,f)=>{const c=(h,p)=>h?f(h):l(p);c.withError=!0,u.push(c),this.emit(a,...u)})}_addToQueue(a){let u;typeof a[a.length-1]=="function"&&(u=a.pop());const l={id:this._queueSeq++,tryCount:0,pending:!1,args:a,flags:Object.assign({fromQueue:!0},this.flags)};a.push((f,...c)=>l!==this._queue[0]?void 0:(f!==null?l.tryCount>this._opts.retries&&(this._queue.shift(),u&&u(f)):(this._queue.shift(),u&&u(null,...c)),l.pending=!1,this._drainQueue())),this._queue.push(l),this._drainQueue()}_drainQueue(a=!1){if(!this.connected||this._queue.length===0)return;const u=this._queue[0];u.pending&&!a||(u.pending=!0,u.tryCount++,this.flags=u.flags,this.emit.apply(this,u.args))}packet(a){a.nsp=this.nsp,this.io._packet(a)}onopen(){typeof this.auth=="function"?this.auth(a=>{this._sendConnectPacket(a)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(a){this.packet({type:PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},a):a})}onerror(a){this.connected||this.emitReserved("connect_error",a)}onclose(a,u){this.connected=!1,delete this.id,this.emitReserved("disconnect",a,u),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(a=>{if(!this.sendBuffer.some(l=>String(l.id)===a)){const l=this.acks[a];delete this.acks[a],l.withError&&l.call(this,new Error("socket has been disconnected"))}})}onpacket(a){if(a.nsp===this.nsp)switch(a.type){case PacketType.CONNECT:a.data&&a.data.sid?this.onconnect(a.data.sid,a.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case PacketType.EVENT:case PacketType.BINARY_EVENT:this.onevent(a);break;case PacketType.ACK:case PacketType.BINARY_ACK:this.onack(a);break;case PacketType.DISCONNECT:this.ondisconnect();break;case PacketType.CONNECT_ERROR:this.destroy();const l=new Error(a.data.message);l.data=a.data.data,this.emitReserved("connect_error",l);break}}onevent(a){const u=a.data||[];a.id!=null&&u.push(this.ack(a.id)),this.connected?this.emitEvent(u):this.receiveBuffer.push(Object.freeze(u))}emitEvent(a){if(this._anyListeners&&this._anyListeners.length){const u=this._anyListeners.slice();for(const l of u)l.apply(this,a)}super.emit.apply(this,a),this._pid&&a.length&&typeof a[a.length-1]=="string"&&(this._lastOffset=a[a.length-1])}ack(a){const u=this;let l=!1;return function(...f){l||(l=!0,u.packet({type:PacketType.ACK,id:a,data:f}))}}onack(a){const u=this.acks[a.id];typeof u=="function"&&(delete this.acks[a.id],u.withError&&a.data.unshift(null),u.apply(this,a.data))}onconnect(a,u){this.id=a,this.recovered=u&&this._pid===u,this._pid=u,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(a=>this.emitEvent(a)),this.receiveBuffer=[],this.sendBuffer.forEach(a=>{this.notifyOutgoingListeners(a),this.packet(a)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(a=>a()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:PacketType.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(a){return this.flags.compress=a,this}get volatile(){return this.flags.volatile=!0,this}timeout(a){return this.flags.timeout=a,this}onAny(a){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(a),this}prependAny(a){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(a),this}offAny(a){if(!this._anyListeners)return this;if(a){const u=this._anyListeners;for(let l=0;l<u.length;l++)if(a===u[l])return u.splice(l,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(a){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(a),this}prependAnyOutgoing(a){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(a),this}offAnyOutgoing(a){if(!this._anyOutgoingListeners)return this;if(a){const u=this._anyOutgoingListeners;for(let l=0;l<u.length;l++)if(a===u[l])return u.splice(l,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(a){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const u=this._anyOutgoingListeners.slice();for(const l of u)l.apply(this,a.data)}}}function Backoff(s){s=s||{},this.ms=s.min||100,this.max=s.max||1e4,this.factor=s.factor||2,this.jitter=s.jitter>0&&s.jitter<=1?s.jitter:0,this.attempts=0}Backoff.prototype.duration=function(){var s=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var a=Math.random(),u=Math.floor(a*this.jitter*s);s=Math.floor(a*10)&1?s+u:s-u}return Math.min(s,this.max)|0};Backoff.prototype.reset=function(){this.attempts=0};Backoff.prototype.setMin=function(s){this.ms=s};Backoff.prototype.setMax=function(s){this.max=s};Backoff.prototype.setJitter=function(s){this.jitter=s};class Manager extends Emitter{constructor(a,u){var l;super(),this.nsps={},this.subs=[],a&&typeof a=="object"&&(u=a,a=void 0),u=u||{},u.path=u.path||"/socket.io",this.opts=u,installTimerFunctions(this,u),this.reconnection(u.reconnection!==!1),this.reconnectionAttempts(u.reconnectionAttempts||1/0),this.reconnectionDelay(u.reconnectionDelay||1e3),this.reconnectionDelayMax(u.reconnectionDelayMax||5e3),this.randomizationFactor((l=u.randomizationFactor)!==null&&l!==void 0?l:.5),this.backoff=new Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(u.timeout==null?2e4:u.timeout),this._readyState="closed",this.uri=a;const f=u.parser||parser$1;this.encoder=new f.Encoder,this.decoder=new f.Decoder,this._autoConnect=u.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(a){return arguments.length?(this._reconnection=!!a,this):this._reconnection}reconnectionAttempts(a){return a===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=a,this)}reconnectionDelay(a){var u;return a===void 0?this._reconnectionDelay:(this._reconnectionDelay=a,(u=this.backoff)===null||u===void 0||u.setMin(a),this)}randomizationFactor(a){var u;return a===void 0?this._randomizationFactor:(this._randomizationFactor=a,(u=this.backoff)===null||u===void 0||u.setJitter(a),this)}reconnectionDelayMax(a){var u;return a===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=a,(u=this.backoff)===null||u===void 0||u.setMax(a),this)}timeout(a){return arguments.length?(this._timeout=a,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(a){if(~this._readyState.indexOf("open"))return this;this.engine=new Socket$1(this.uri,this.opts);const u=this.engine,l=this;this._readyState="opening",this.skipReconnect=!1;const f=on(u,"open",function(){l.onopen(),a&&a()}),c=p=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",p),a?a(p):this.maybeReconnectOnOpen()},h=on(u,"error",c);if(this._timeout!==!1){const p=this._timeout,v=this.setTimeoutFn(()=>{f(),c(new Error("timeout")),u.close()},p);this.opts.autoUnref&&v.unref(),this.subs.push(()=>{this.clearTimeoutFn(v)})}return this.subs.push(f),this.subs.push(h),this}connect(a){return this.open(a)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const a=this.engine;this.subs.push(on(a,"ping",this.onping.bind(this)),on(a,"data",this.ondata.bind(this)),on(a,"error",this.onerror.bind(this)),on(a,"close",this.onclose.bind(this)),on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(a){try{this.decoder.add(a)}catch(u){this.onclose("parse error",u)}}ondecoded(a){nextTick(()=>{this.emitReserved("packet",a)},this.setTimeoutFn)}onerror(a){this.emitReserved("error",a)}socket(a,u){let l=this.nsps[a];return l?this._autoConnect&&!l.active&&l.connect():(l=new Socket(this,a,u),this.nsps[a]=l),l}_destroy(a){const u=Object.keys(this.nsps);for(const l of u)if(this.nsps[l].active)return;this._close()}_packet(a){const u=this.encoder.encode(a);for(let l=0;l<u.length;l++)this.engine.write(u[l],a.options)}cleanup(){this.subs.forEach(a=>a()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(a,u){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",a,u),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const a=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const u=this.backoff.duration();this._reconnecting=!0;const l=this.setTimeoutFn(()=>{a.skipReconnect||(this.emitReserved("reconnect_attempt",a.backoff.attempts),!a.skipReconnect&&a.open(f=>{f?(a._reconnecting=!1,a.reconnect(),this.emitReserved("reconnect_error",f)):a.onreconnect()}))},u);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}}onreconnect(){const a=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",a)}}const cache={};function lookup(s,a){typeof s=="object"&&(a=s,s=void 0),a=a||{};const u=url(s,a.path||"/socket.io"),l=u.source,f=u.id,c=u.path,h=cache[f]&&c in cache[f].nsps,p=a.forceNew||a["force new connection"]||a.multiplex===!1||h;let v;return p?v=new Manager(l,a):(cache[f]||(cache[f]=new Manager(l,a)),v=cache[f]),u.query&&!a.query&&(a.query=u.queryKey),v.socket(u.path,a)}Object.assign(lookup,{Manager,Socket,io:lookup,connect:lookup});var cryptoBrowserifyExports=requireCryptoBrowserify();const nodeCrypto=getDefaultExportFromCjs(cryptoBrowserifyExports),ec$2=new ellipticExports.ec("secp256k1"),browserCrypto=distExports.global.crypto||distExports.global.msCrypto||{},subtle=browserCrypto.subtle||browserCrypto.webkitSubtle,EC_GROUP_ORDER=distExports.Buffer.from("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141","hex"),ZERO32=distExports.Buffer.alloc(32,0);function assert$1(s,a){if(!s)throw new Error(a||"Assertion failed")}function isScalar(s){return distExports.Buffer.isBuffer(s)&&s.length===32}function isValidPrivateKey(s){return isScalar(s)?s.compare(ZERO32)>0&&s.compare(EC_GROUP_ORDER)<0:!1}function equalConstTime(s,a){if(s.length!==a.length)return!1;let u=0;for(let l=0;l<s.length;l++)u|=s[l]^a[l];return u===0}function randomBytes(s){const a=new Uint8Array(s);return typeof browserCrypto.getRandomValues>"u"?distExports.Buffer.from(nodeCrypto.randomBytes(s)):(browserCrypto.getRandomValues(a),distExports.Buffer.from(a))}async function sha512(s){if(subtle){const l=await subtle.digest("SHA-512",s);return new Uint8Array(l)}const u=nodeCrypto.createHash("sha512").update(s).digest();return new Uint8Array(u)}function getAes(s){return async function(a,u,l){if(subtle){const f={name:"AES-CBC"},c=await subtle.importKey("raw",u,f,!1,[s]),h={name:"AES-CBC",iv:a},p=await subtle[s](h,c,l);return distExports.Buffer.from(new Uint8Array(p))}else if(s==="encrypt"){const f=nodeCrypto.createCipheriv("aes-256-cbc",u,a),c=f.update(l),h=f.final();return distExports.Buffer.concat([c,h])}else if(s==="decrypt"){const f=nodeCrypto.createDecipheriv("aes-256-cbc",u,a),c=f.update(l),h=f.final();return distExports.Buffer.concat([c,h])}throw new Error(`Unsupported operation: ${s}`)}}const aesCbcEncrypt=getAes("encrypt"),aesCbcDecrypt=getAes("decrypt");async function hmacSha256Sign(s,a){if(subtle){const f={name:"HMAC",hash:{name:"SHA-256"}},c=await subtle.importKey("raw",new Uint8Array(s),f,!1,["sign","verify"]),h=await subtle.sign("HMAC",c,a);return distExports.Buffer.from(new Uint8Array(h))}const u=nodeCrypto.createHmac("sha256",distExports.Buffer.from(s));return u.update(a),u.digest()}async function hmacSha256Verify(s,a,u){const l=await hmacSha256Sign(s,a);return equalConstTime(l,u)}const generatePrivate=function(){let s=randomBytes(32);for(;!isValidPrivateKey(s);)s=randomBytes(32);return s},getPublic=function(s){return assert$1(s.length===32,"Bad private key"),assert$1(isValidPrivateKey(s),"Bad private key"),distExports.Buffer.from(ec$2.keyFromPrivate(s).getPublic("array"))},sign=async function(s,a){return assert$1(s.length===32,"Bad private key"),assert$1(isValidPrivateKey(s),"Bad private key"),assert$1(a.length>0,"Message should not be empty"),assert$1(a.length<=32,"Message is too long"),distExports.Buffer.from(ec$2.sign(a,s,{canonical:!0}).toDER())},derive=async function(s,a){assert$1(distExports.Buffer.isBuffer(s),"Bad private key"),assert$1(distExports.Buffer.isBuffer(a),"Bad public key"),assert$1(s.length===32,"Bad private key"),assert$1(isValidPrivateKey(s),"Bad private key"),assert$1(a.length===65||a.length===33,"Bad public key"),a.length===65&&assert$1(a[0]===4,"Bad public key"),a.length===33&&assert$1(a[0]===2||a[0]===3,"Bad public key");const u=ec$2.keyFromPrivate(s),l=ec$2.keyFromPublic(a),f=u.derive(l.getPublic());return distExports.Buffer.from(f.toArray())},deriveUnpadded=derive,derivePadded=async function(s,a){assert$1(distExports.Buffer.isBuffer(s),"Bad private key"),assert$1(distExports.Buffer.isBuffer(a),"Bad public key"),assert$1(s.length===32,"Bad private key"),assert$1(isValidPrivateKey(s),"Bad private key"),assert$1(a.length===65||a.length===33,"Bad public key"),a.length===65&&assert$1(a[0]===4,"Bad public key"),a.length===33&&assert$1(a[0]===2||a[0]===3,"Bad public key");const u=ec$2.keyFromPrivate(s),l=ec$2.keyFromPublic(a),f=u.derive(l.getPublic());return distExports.Buffer.from(f.toString(16,64),"hex")},encrypt=async function(s,a,u){u=u||{};let l=u.ephemPrivateKey||randomBytes(32);for(;!isValidPrivateKey(l);)l=u.ephemPrivateKey||randomBytes(32);const f=getPublic(l),c=await deriveUnpadded(l,s),h=await sha512(c),p=u.iv||randomBytes(16),v=h.slice(0,32),y=h.slice(32),S=await aesCbcEncrypt(p,distExports.Buffer.from(v),a),E=distExports.Buffer.concat([p,f,S]),R=await hmacSha256Sign(distExports.Buffer.from(y),E);return{iv:p,ephemPublicKey:f,ciphertext:S,mac:R}},decrypt=async function(s,a,u){const l=u??!1,c=await(l?derivePadded:deriveUnpadded)(s,a.ephemPublicKey),h=await sha512(c),p=h.slice(0,32),v=h.slice(32),y=distExports.Buffer.concat([a.iv,a.ephemPublicKey,a.ciphertext]),b=await hmacSha256Verify(distExports.Buffer.from(v),y,a.mac);if(!b&&l===!1)return decrypt(s,a,!0);if(!b&&l===!0)throw new Error("bad MAC after trying padded");const S=await aesCbcDecrypt(a.iv,distExports.Buffer.from(p),a.ciphertext);return distExports.Buffer.from(new Uint8Array(S))};var loglevel$a={exports:{}},loglevel$9=loglevel$a.exports,hasRequiredLoglevel$4;function requireLoglevel$4(){return hasRequiredLoglevel$4||(hasRequiredLoglevel$4=1,function(s){(function(a,u){s.exports?s.exports=u():a.log=u()})(loglevel$9,function(){var a=function(){},u="undefined",l=typeof window!==u&&typeof window.navigator!==u&&/Trident\/|MSIE /.test(window.navigator.userAgent),f=["trace","debug","info","warn","error"],c={},h=null;function p(I,B){var N=I[B];if(typeof N.bind=="function")return N.bind(I);try{return Function.prototype.bind.call(N,I)}catch{return function(){return Function.prototype.apply.apply(N,[I,arguments])}}}function v(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function y(I){return I==="debug"&&(I="log"),typeof console===u?!1:I==="trace"&&l?v:console[I]!==void 0?p(console,I):console.log!==void 0?p(console,"log"):a}function b(){for(var I=this.getLevel(),B=0;B<f.length;B++){var N=f[B];this[N]=B<I?a:this.methodFactory(N,I,this.name)}if(this.log=this.debug,typeof console===u&&I<this.levels.SILENT)return"No console available for logging"}function S(I){return function(){typeof console!==u&&(b.call(this),this[I].apply(this,arguments))}}function E(I,B,N){return y(I)||S.apply(this,arguments)}function R(I,B){var N=this,D,G,V,U="loglevel";typeof I=="string"?U+=":"+I:typeof I=="symbol"&&(U=void 0);function te(k){var d=(f[k]||"silent").toUpperCase();if(!(typeof window===u||!U)){try{window.localStorage[U]=d;return}catch{}try{window.document.cookie=encodeURIComponent(U)+"="+d+";"}catch{}}}function Z(){var k;if(!(typeof window===u||!U)){try{k=window.localStorage[U]}catch{}if(typeof k===u)try{var d=window.document.cookie,g=encodeURIComponent(U),_=d.indexOf(g+"=");_!==-1&&(k=/^([^;]+)/.exec(d.slice(_+g.length+1))[1])}catch{}return N.levels[k]===void 0&&(k=void 0),k}}function J(){if(!(typeof window===u||!U)){try{window.localStorage.removeItem(U)}catch{}try{window.document.cookie=encodeURIComponent(U)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function Q(k){var d=k;if(typeof d=="string"&&N.levels[d.toUpperCase()]!==void 0&&(d=N.levels[d.toUpperCase()]),typeof d=="number"&&d>=0&&d<=N.levels.SILENT)return d;throw new TypeError("log.setLevel() called with invalid level: "+k)}N.name=I,N.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},N.methodFactory=B||E,N.getLevel=function(){return V??G??D},N.setLevel=function(k,d){return V=Q(k),d!==!1&&te(V),b.call(N)},N.setDefaultLevel=function(k){G=Q(k),Z()||N.setLevel(k,!1)},N.resetLevel=function(){V=null,J(),b.call(N)},N.enableAll=function(k){N.setLevel(N.levels.TRACE,k)},N.disableAll=function(k){N.setLevel(N.levels.SILENT,k)},N.rebuild=function(){if(h!==N&&(D=Q(h.getLevel())),b.call(N),h===N)for(var k in c)c[k].rebuild()},D=Q(h?h.getLevel():"WARN");var ee=Z();ee!=null&&(V=Q(ee)),b.call(N)}h=new R,h.getLogger=function(B){if(typeof B!="symbol"&&typeof B!="string"||B==="")throw new TypeError("You must supply a name when creating a logger.");var N=c[B];return N||(N=c[B]=new R(B,h.methodFactory)),N};var O=typeof window!==u?window.log:void 0;return h.noConflict=function(){return typeof window!==u&&window.log===h&&(window.log=O),h},h.getLoggers=function(){return c},h.default=h,h})}(loglevel$a)),loglevel$a.exports}var loglevelExports$4=requireLoglevel$4();const logLevel$2=getDefaultExportFromCjs(loglevelExports$4),log$7=logLevel$2.getLogger("http-helpers");log$7.setLevel(loglevelExports$4.levels.INFO);var jsonify={},parse,hasRequiredParse$2;function requireParse$2(){if(hasRequiredParse$2)return parse;hasRequiredParse$2=1;var s,a,u={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
`,r:"\r",t:"	"},l;function f(R){throw{name:"SyntaxError",message:R,at:s,text:l}}function c(R){return R&&R!==a&&f("Expected '"+R+"' instead of '"+a+"'"),a=l.charAt(s),s+=1,a}function h(){var R,O="";for(a==="-"&&(O="-",c("-"));a>="0"&&a<="9";)O+=a,c();if(a===".")for(O+=".";c()&&a>="0"&&a<="9";)O+=a;if(a==="e"||a==="E")for(O+=a,c(),(a==="-"||a==="+")&&(O+=a,c());a>="0"&&a<="9";)O+=a,c();return R=Number(O),isFinite(R)||f("Bad number"),R}function p(){var R,O,I="",B;if(a==='"')for(;c();){if(a==='"')return c(),I;if(a==="\\")if(c(),a==="u"){for(B=0,O=0;O<4&&(R=parseInt(c(),16),!!isFinite(R));O+=1)B=B*16+R;I+=String.fromCharCode(B)}else if(typeof u[a]=="string")I+=u[a];else break;else I+=a}f("Bad string")}function v(){for(;a&&a<=" ";)c()}function y(){switch(a){case"t":return c("t"),c("r"),c("u"),c("e"),!0;case"f":return c("f"),c("a"),c("l"),c("s"),c("e"),!1;case"n":return c("n"),c("u"),c("l"),c("l"),null;default:f("Unexpected '"+a+"'")}}function b(){var R=[];if(a==="["){if(c("["),v(),a==="]")return c("]"),R;for(;a;){if(R.push(E()),v(),a==="]")return c("]"),R;c(","),v()}}f("Bad array")}function S(){var R,O={};if(a==="{"){if(c("{"),v(),a==="}")return c("}"),O;for(;a;){if(R=p(),v(),c(":"),Object.prototype.hasOwnProperty.call(O,R)&&f('Duplicate key "'+R+'"'),O[R]=E(),v(),a==="}")return c("}"),O;c(","),v()}}f("Bad object")}function E(){switch(v(),a){case"{":return S();case"[":return b();case'"':return p();case"-":return h();default:return a>="0"&&a<="9"?h():y()}}return parse=function(R,O){var I;return l=R,s=0,a=" ",I=E(),v(),a&&f("Syntax error"),typeof O=="function"?function B(N,D){var G,V,U=N[D];if(U&&typeof U=="object")for(G in E)Object.prototype.hasOwnProperty.call(U,G)&&(V=B(U,G),typeof V>"u"?delete U[G]:U[G]=V);return O.call(N,D,U)}({"":I},""):I},parse}var stringify$3,hasRequiredStringify$2;function requireStringify$2(){if(hasRequiredStringify$2)return stringify$3;hasRequiredStringify$2=1;var s=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a,u,l={"\b":"\\b","	":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},f;function c(p){return s.lastIndex=0,s.test(p)?'"'+p.replace(s,function(v){var y=l[v];return typeof y=="string"?y:"\\u"+("0000"+v.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+p+'"'}function h(p,v){var y,b,S,E,R=a,O,I=v[p];switch(I&&typeof I=="object"&&typeof I.toJSON=="function"&&(I=I.toJSON(p)),typeof f=="function"&&(I=f.call(v,p,I)),typeof I){case"string":return c(I);case"number":return isFinite(I)?String(I):"null";case"boolean":case"null":return String(I);case"object":if(!I)return"null";if(a+=u,O=[],Object.prototype.toString.apply(I)==="[object Array]"){for(E=I.length,y=0;y<E;y+=1)O[y]=h(y,I)||"null";return S=O.length===0?"[]":a?`[
`+a+O.join(`,
`+a)+`
`+R+"]":"["+O.join(",")+"]",a=R,S}if(f&&typeof f=="object")for(E=f.length,y=0;y<E;y+=1)b=f[y],typeof b=="string"&&(S=h(b,I),S&&O.push(c(b)+(a?": ":":")+S));else for(b in I)Object.prototype.hasOwnProperty.call(I,b)&&(S=h(b,I),S&&O.push(c(b)+(a?": ":":")+S));return S=O.length===0?"{}":a?`{
`+a+O.join(`,
`+a)+`
`+R+"}":"{"+O.join(",")+"}",a=R,S}}return stringify$3=function(p,v,y){var b;if(a="",u="",typeof y=="number")for(b=0;b<y;b+=1)u+=" ";else typeof y=="string"&&(u=y);if(f=v,v&&typeof v!="function"&&(typeof v!="object"||typeof v.length!="number"))throw new Error("JSON.stringify");return h("",{"":p})},stringify$3}var hasRequiredJsonify;function requireJsonify(){return hasRequiredJsonify||(hasRequiredJsonify=1,jsonify.parse=requireParse$2(),jsonify.stringify=requireStringify$2()),jsonify}var isarray,hasRequiredIsarray;function requireIsarray(){if(hasRequiredIsarray)return isarray;hasRequiredIsarray=1;var s={}.toString;return isarray=Array.isArray||function(a){return s.call(a)=="[object Array]"},isarray}var isArguments,hasRequiredIsArguments;function requireIsArguments(){if(hasRequiredIsArguments)return isArguments;hasRequiredIsArguments=1;var s=Object.prototype.toString;return isArguments=function(u){var l=s.call(u),f=l==="[object Arguments]";return f||(f=l!=="[object Array]"&&u!==null&&typeof u=="object"&&typeof u.length=="number"&&u.length>=0&&s.call(u.callee)==="[object Function]"),f},isArguments}var implementation,hasRequiredImplementation;function requireImplementation(){if(hasRequiredImplementation)return implementation;hasRequiredImplementation=1;var s;if(!Object.keys){var a=Object.prototype.hasOwnProperty,u=Object.prototype.toString,l=requireIsArguments(),f=Object.prototype.propertyIsEnumerable,c=!f.call({toString:null},"toString"),h=f.call(function(){},"prototype"),p=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],v=function(E){var R=E.constructor;return R&&R.prototype===E},y={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},b=function(){if(typeof window>"u")return!1;for(var E in window)try{if(!y["$"+E]&&a.call(window,E)&&window[E]!==null&&typeof window[E]=="object")try{v(window[E])}catch{return!0}}catch{return!0}return!1}(),S=function(E){if(typeof window>"u"||!b)return v(E);try{return v(E)}catch{return!1}};s=function(R){var O=R!==null&&typeof R=="object",I=u.call(R)==="[object Function]",B=l(R),N=O&&u.call(R)==="[object String]",D=[];if(!O&&!I&&!B)throw new TypeError("Object.keys called on a non-object");var G=h&&I;if(N&&R.length>0&&!a.call(R,0))for(var V=0;V<R.length;++V)D.push(String(V));if(B&&R.length>0)for(var U=0;U<R.length;++U)D.push(String(U));else for(var te in R)!(G&&te==="prototype")&&a.call(R,te)&&D.push(String(te));if(c)for(var Z=S(R),J=0;J<p.length;++J)!(Z&&p[J]==="constructor")&&a.call(R,p[J])&&D.push(p[J]);return D}}return implementation=s,implementation}var objectKeys,hasRequiredObjectKeys;function requireObjectKeys(){if(hasRequiredObjectKeys)return objectKeys;hasRequiredObjectKeys=1;var s=Array.prototype.slice,a=requireIsArguments(),u=Object.keys,l=u?function(h){return u(h)}:requireImplementation(),f=Object.keys;return l.shim=function(){if(Object.keys){var h=function(){var p=Object.keys(arguments);return p&&p.length===arguments.length}(1,2);h||(Object.keys=function(v){return a(v)?f(s.call(v)):f(v)})}else Object.keys=l;return Object.keys||l},objectKeys=l,objectKeys}var callBind={exports:{}},applyBind,hasRequiredApplyBind;function requireApplyBind(){if(hasRequiredApplyBind)return applyBind;hasRequiredApplyBind=1;var s=requireFunctionBind(),a=requireFunctionApply(),u=requireActualApply();return applyBind=function(){return u(s,a,arguments)},applyBind}var hasRequiredCallBind;function requireCallBind(){return hasRequiredCallBind||(hasRequiredCallBind=1,function(s){var a=requireSetFunctionLength(),u=requireEsDefineProperty$3(),l=requireCallBindApplyHelpers(),f=requireApplyBind();s.exports=function(h){var p=l(arguments),v=h.length-(arguments.length-1);return a(p,1+(v>0?v:0),!0)},u?u(s.exports,"apply",{value:f}):s.exports.apply=f}(callBind)),callBind.exports}var callBound,hasRequiredCallBound;function requireCallBound(){if(hasRequiredCallBound)return callBound;hasRequiredCallBound=1;var s=requireGetIntrinsic$2(),a=requireCallBind(),u=a(s("String.prototype.indexOf"));return callBound=function(f,c){var h=s(f,!!c);return typeof h=="function"&&u(f,".prototype.")>-1?a(h):h},callBound}var jsonStableStringify,hasRequiredJsonStableStringify;function requireJsonStableStringify(){if(hasRequiredJsonStableStringify)return jsonStableStringify;hasRequiredJsonStableStringify=1;var s=(typeof JSON<"u"?JSON:requireJsonify()).stringify,a=requireIsarray(),u=requireObjectKeys(),l=requireCallBind(),f=requireCallBound(),c=f("Array.prototype.join"),h=f("Array.prototype.push"),p=function(b,S){for(var E="",R=0;R<b;R+=1)E+=S;return E},v=function(y,b,S){return S};return jsonStableStringify=function(b){var S=arguments.length>1?arguments[1]:void 0,E=S&&S.space||"";typeof E=="number"&&(E=p(E," "));var R=!!S&&typeof S.cycles=="boolean"&&S.cycles,O=S&&S.replacer?l(S.replacer):v,I=typeof S=="function"?S:S&&S.cmp,B=I&&function(D){var G=I.length>2&&function(U){return D[U]};return function(V,U){return I({key:V,value:D[V]},{key:U,value:D[U]},G?{__proto__:null,get:G}:void 0)}},N=[];return function D(G,V,U,te){var Z=E?`
`+p(te,E):"",J=E?": ":":";if(U&&U.toJSON&&typeof U.toJSON=="function"&&(U=U.toJSON()),U=O(G,V,U),U!==void 0){if(typeof U!="object"||U===null)return s(U);if(a(U)){for(var d=[],Q=0;Q<U.length;Q++){var ee=D(U,Q,U[Q],te+1)||s(null);h(d,Z+E+ee)}return"["+c(d,",")+Z+"]"}if(N.indexOf(U)!==-1){if(R)return s("__cycle__");throw new TypeError("Converting circular structure to JSON")}else h(N,U);for(var k=u(U).sort(B&&B(U)),d=[],Q=0;Q<k.length;Q++){var V=k[Q],g=D(U,V,U[V],te+1);if(g){var _=s(V)+J+g;h(d,Z+E+_)}}return N.splice(N.indexOf(U),1),"{"+c(d,",")+Z+"}"}}({"":b},"",b,0)},jsonStableStringify}var jsonStableStringifyExports=requireJsonStableStringify();const stringify$2=getDefaultExportFromCjs(jsonStableStringifyExports);function number(s){if(!Number.isSafeInteger(s)||s<0)throw new Error(`positive integer expected, not ${s}`)}function bool(s){if(typeof s!="boolean")throw new Error(`boolean expected, not ${s}`)}function isBytes$1(s){return s instanceof Uint8Array||s!=null&&typeof s=="object"&&s.constructor.name==="Uint8Array"}function bytes$1(s,...a){if(!isBytes$1(s))throw new Error("Uint8Array expected");if(a.length>0&&!a.includes(s.length))throw new Error(`Uint8Array expected of length ${a}, not of length=${s.length}`)}function hash(s){if(typeof s!="function"||typeof s.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number(s.outputLen),number(s.blockLen)}function exists(s,a=!0){if(s.destroyed)throw new Error("Hash instance has been destroyed");if(a&&s.finished)throw new Error("Hash#digest() has already been called")}function output(s,a){bytes$1(s);const u=a.outputLen;if(s.length<u)throw new Error(`digestInto() expects output buffer of length at least ${u}`)}const assert={number,bool,bytes:bytes$1,hash,exists,output},U32_MASK64=BigInt(2**32-1),_32n=BigInt(32);function fromBig(s,a=!1){return a?{h:Number(s&U32_MASK64),l:Number(s>>_32n&U32_MASK64)}:{h:Number(s>>_32n&U32_MASK64)|0,l:Number(s&U32_MASK64)|0}}function split(s,a=!1){let u=new Uint32Array(s.length),l=new Uint32Array(s.length);for(let f=0;f<s.length;f++){const{h:c,l:h}=fromBig(s[f],a);[u[f],l[f]]=[c,h]}return[u,l]}const rotlSH=(s,a,u)=>s<<u|a>>>32-u,rotlSL=(s,a,u)=>a<<u|s>>>32-u,rotlBH=(s,a,u)=>a<<u-32|s>>>64-u,rotlBL=(s,a,u)=>s<<u-32|a>>>64-u;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const u32=s=>new Uint32Array(s.buffer,s.byteOffset,Math.floor(s.byteLength/4)),isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,byteSwap=s=>s<<24&4278190080|s<<8&16711680|s>>>8&65280|s>>>24&255;function byteSwap32(s){for(let a=0;a<s.length;a++)s[a]=byteSwap(s[a])}function utf8ToBytes(s){if(typeof s!="string")throw new Error(`utf8ToBytes expected string, got ${typeof s}`);return new Uint8Array(new TextEncoder().encode(s))}function toBytes(s){return typeof s=="string"&&(s=utf8ToBytes(s)),bytes$1(s),s}class Hash{clone(){return this._cloneInto()}}function wrapConstructor(s){const a=l=>s().update(toBytes(l)).digest(),u=s();return a.outputLen=u.outputLen,a.blockLen=u.blockLen,a.create=()=>s(),a}const SHA3_PI=[],SHA3_ROTL=[],_SHA3_IOTA=[],_0n=BigInt(0),_1n=BigInt(1),_2n=BigInt(2),_7n=BigInt(7),_256n=BigInt(256),_0x71n=BigInt(113);for(let s=0,a=_1n,u=1,l=0;s<24;s++){[u,l]=[l,(2*u+3*l)%5],SHA3_PI.push(2*(5*l+u)),SHA3_ROTL.push((s+1)*(s+2)/2%64);let f=_0n;for(let c=0;c<7;c++)a=(a<<_1n^(a>>_7n)*_0x71n)%_256n,a&_2n&&(f^=_1n<<(_1n<<BigInt(c))-_1n);_SHA3_IOTA.push(f)}const[SHA3_IOTA_H,SHA3_IOTA_L]=split(_SHA3_IOTA,!0),rotlH=(s,a,u)=>u>32?rotlBH(s,a,u):rotlSH(s,a,u),rotlL=(s,a,u)=>u>32?rotlBL(s,a,u):rotlSL(s,a,u);function keccakP(s,a=24){const u=new Uint32Array(10);for(let l=24-a;l<24;l++){for(let h=0;h<10;h++)u[h]=s[h]^s[h+10]^s[h+20]^s[h+30]^s[h+40];for(let h=0;h<10;h+=2){const p=(h+8)%10,v=(h+2)%10,y=u[v],b=u[v+1],S=rotlH(y,b,1)^u[p],E=rotlL(y,b,1)^u[p+1];for(let R=0;R<50;R+=10)s[h+R]^=S,s[h+R+1]^=E}let f=s[2],c=s[3];for(let h=0;h<24;h++){const p=SHA3_ROTL[h],v=rotlH(f,c,p),y=rotlL(f,c,p),b=SHA3_PI[h];f=s[b],c=s[b+1],s[b]=v,s[b+1]=y}for(let h=0;h<50;h+=10){for(let p=0;p<10;p++)u[p]=s[h+p];for(let p=0;p<10;p++)s[h+p]^=~u[(p+2)%10]&u[(p+4)%10]}s[0]^=SHA3_IOTA_H[l],s[1]^=SHA3_IOTA_L[l]}u.fill(0)}class Keccak extends Hash{constructor(a,u,l,f=!1,c=24){if(super(),this.blockLen=a,this.suffix=u,this.outputLen=l,this.enableXOF=f,this.rounds=c,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,number(l),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=u32(this.state)}keccak(){isLE||byteSwap32(this.state32),keccakP(this.state32,this.rounds),isLE||byteSwap32(this.state32),this.posOut=0,this.pos=0}update(a){exists(this);const{blockLen:u,state:l}=this;a=toBytes(a);const f=a.length;for(let c=0;c<f;){const h=Math.min(u-this.pos,f-c);for(let p=0;p<h;p++)l[this.pos++]^=a[c++];this.pos===u&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:a,suffix:u,pos:l,blockLen:f}=this;a[l]^=u,u&128&&l===f-1&&this.keccak(),a[f-1]^=128,this.keccak()}writeInto(a){exists(this,!1),bytes$1(a),this.finish();const u=this.state,{blockLen:l}=this;for(let f=0,c=a.length;f<c;){this.posOut>=l&&this.keccak();const h=Math.min(l-this.posOut,c-f);a.set(u.subarray(this.posOut,this.posOut+h),f),this.posOut+=h,f+=h}return a}xofInto(a){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(a)}xof(a){return number(a),this.xofInto(new Uint8Array(a))}digestInto(a){if(output(a,this),this.finished)throw new Error("digest() was already called");return this.writeInto(a),this.destroy(),a}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(a){const{blockLen:u,suffix:l,outputLen:f,rounds:c,enableXOF:h}=this;return a||(a=new Keccak(u,l,f,h,c)),a.state32.set(this.state32),a.pos=this.pos,a.posOut=this.posOut,a.finished=this.finished,a.rounds=c,a.suffix=l,a.outputLen=f,a.enableXOF=h,a.destroyed=this.destroyed,a}}const gen=(s,a,u)=>wrapConstructor(()=>new Keccak(a,s,u)),keccak_256=gen(1,136,256/8);function wrapHash(s){return a=>(assert.bytes(a),s(a))}(()=>{const s=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,a=typeof module<"u"&&typeof module.require=="function"&&module.require.bind(module);return{node:a&&!s?a("crypto"):void 0,web:s}})();const keccak256$3=(()=>{const s=wrapHash(keccak_256);return s.create=keccak_256.create,s})();function keccak256$2(s){return distExports.Buffer.from(keccak256$3(s))}const ec$1=new ellipticExports.ec("secp256k1");function encParamsHexToBuf$2(s){return{iv:distExports.Buffer.from(s.iv,"hex"),ephemPublicKey:distExports.Buffer.from(s.ephemPublicKey,"hex"),ciphertext:distExports.Buffer.from(s.ciphertext,"hex"),mac:distExports.Buffer.from(s.mac,"hex")}}function encParamsBufToHex$2(s){return{iv:distExports.Buffer.from(s.iv).toString("hex"),ephemPublicKey:distExports.Buffer.from(s.ephemPublicKey).toString("hex"),ciphertext:distExports.Buffer.from(s.ciphertext).toString("hex"),mac:distExports.Buffer.from(s.mac).toString("hex")}}async function encryptData$1(s,a){const u=JSON.stringify(a),l=distExports.Buffer.from(u,"utf-8"),f=await encrypt(getPublic(distExports.Buffer.from(s,"hex")),l),c=encParamsBufToHex$2(f);return JSON.stringify(c)}async function decryptData$1(s,a){const u=JSON.parse(a),l=encParamsHexToBuf$2(u),f=ec$1.keyFromPrivate(s),h=(await decrypt(distExports.Buffer.from(f.getPrivate().toString("hex",64),"hex"),l)).toString("utf-8");return JSON.parse(h)}var microSeconds$1=microSeconds$5,KEY_PREFIX="pubkey.broadcastChannel-",type$1="server",SOCKET_CONN_INSTANCE=null,runningChannels=new Set;function storageKey(s){return KEY_PREFIX+s}function postMessage$1(s,a){return new Promise(function(u,l){sleep().then(_asyncToGenerator(_regeneratorRuntime.mark(function f(){var c,h,p,v;return _regeneratorRuntime.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return c=storageKey(s.channelName),h=keccak256$2(distExports.Buffer.from(c,"utf8")),b.next=4,encryptData$1(h.toString("hex"),{token:randomToken(),time:new Date().getTime(),data:a,uuid:s.uuid});case 4:return p=b.sent,b.t0=getPublic(h).toString("hex"),b.t1=p,b.next=9,sign(h,keccak256$2(distExports.Buffer.from(p,"utf8")));case 9:return b.t2=b.sent.toString("hex"),v={key:b.t0,data:b.t1,signature:b.t2},s.timeout&&(v.timeout=s.timeout),b.abrupt("return",fetch(s.serverUrl+"/channel/set",{method:"POST",body:JSON.stringify(v),headers:{"Content-Type":"application/json; charset=utf-8"}}).then(u).catch(l));case 13:case"end":return b.stop()}},f)})))})}function getSocketInstance(s){if(SOCKET_CONN_INSTANCE)return SOCKET_CONN_INSTANCE;var a=lookup(s,{transports:["websocket","polling"],withCredentials:!0,reconnectionDelayMax:1e4,reconnectionAttempts:10});return a.on("connect_error",function(u){a.io.opts.transports=["polling","websocket"],log$8.error("connect error",u)}),a.on("connect",_asyncToGenerator(_regeneratorRuntime.mark(function u(){var l;return _regeneratorRuntime.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:l=a.io.engine,log$8.debug("initially connected to",l.transport.name),l.once("upgrade",function(){log$8.debug("upgraded",l.transport.name)}),l.once("close",function(h){log$8.debug("connection closed",h)});case 4:case"end":return c.stop()}},u)}))),a.on("error",function(u){log$8.error("socket errored",u),a.disconnect()}),SOCKET_CONN_INSTANCE=a,a}function setupSocketConnection(s,a,u){var l=getSocketInstance(s),f=storageKey(a),c=keccak256$2(distExports.Buffer.from(f,"utf8")),h=getPublic(c).toString("hex");l.connected?l.emit("check_auth_status",h):l.once("connect",function(){log$8.debug("connected with socket"),l.emit("check_auth_status",h)});var p=function(){l.once("connect",_asyncToGenerator(_regeneratorRuntime.mark(function S(){return _regeneratorRuntime.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:l.emit("check_auth_status",h);case 1:case"end":return R.stop()}},S)})))},v=function b(){if(!l){document.removeEventListener("visibilitychange",b);return}!l.connected&&document.visibilityState==="visible"&&p()},y=function(){var b=_asyncToGenerator(_regeneratorRuntime.mark(function S(E){var R;return _regeneratorRuntime.wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.prev=0,I.next=3,decryptData$1(c.toString("hex"),E);case 3:R=I.sent,log$8.info(R),u(R),I.next=11;break;case 8:I.prev=8,I.t0=I.catch(0),log$8.error(I.t0);case 11:case"end":return I.stop()}},S,null,[[0,8]])}));return function(E){return b.apply(this,arguments)}}();return l.on("disconnect",function(){log$8.debug("socket disconnected"),runningChannels.has(a)&&(log$8.error("socket disconnected unexpectedly, reconnecting socket"),p())}),l.on(h+"_success",y),typeof document<"u"&&document.addEventListener("visibilitychange",v),l}function create$1(s,a){a=fillOptionsWithDefaults(a);var u=randomToken(),l=new ObliviousSet(a.server.removeTimeout),f={channelName:s,uuid:u,eMIs:l,serverUrl:a.server.url};return a.server.timeout&&(f.timeout=a.server.timeout),setupSocketConnection(a.server.url,s,function(c){f.messagesCallback&&c.uuid!==f.uuid&&(!c.token||f.eMIs.has(c.token)||(f.eMIs.add(c.token),f.messagesCallback(c.data)))}),runningChannels.add(s),f}function close$1(s){runningChannels.delete(s.channelName)}function onMessage$1(s,a,u){s.messagesCallbackTime=u,s.messagesCallback=a}function canBeUsed$1(){return!0}function averageResponseTime$1(){var s=500;return s}const ServerMethod={create:create$1,close:close$1,onMessage:onMessage$1,postMessage:postMessage$1,canBeUsed:canBeUsed$1,type:type$1,averageResponseTime:averageResponseTime$1,microSeconds:microSeconds$1};var microSeconds=microSeconds$5,type="simulate",SIMULATE_CHANNELS=new Set;function create(s){var a={name:s,messagesCallback:null};return SIMULATE_CHANNELS.add(a),a}function close(s){SIMULATE_CHANNELS.delete(s)}function postMessage(s,a){return new Promise(function(u){return setTimeout(function(){var l=Array.from(SIMULATE_CHANNELS);l.filter(function(f){return f.name===s.name}).filter(function(f){return f!==s}).filter(function(f){return!!f.messagesCallback}).forEach(function(f){return f.messagesCallback(a)}),u()},5)})}function onMessage(s,a){s.messagesCallback=a}function canBeUsed(){return!0}function averageResponseTime(){return 5}const SimulateMethod={create,close,onMessage,postMessage,canBeUsed,type,averageResponseTime,microSeconds};var METHODS=[NativeMethod,IndexeDbMethod,LocalstorageMethod,ServerMethod];function chooseMethod(s){var a=[].concat(s.methods,METHODS).filter(Boolean);if(s.type){if(s.type==="simulate")return SimulateMethod;var u=a.find(function(f){return f.type===s.type});if(u)return u;throw new Error("method-type "+s.type+" not found")}s.webWorkerSupport||(a=a.filter(function(f){return f.type!=="idb"}));var l=a.find(function(f){return f.canBeUsed(s)});if(l)return l;throw new Error("No useable method found in "+JSON.stringify(METHODS.map(function(f){return f.type})))}var OPEN_BROADCAST_CHANNELS=new Set,lastId=0,BroadcastChannel$1=function s(a,u){this.id=lastId++,OPEN_BROADCAST_CHANNELS.add(this),this.name=a,ENFORCED_OPTIONS&&(u=ENFORCED_OPTIONS),this.options=fillOptionsWithDefaults(u),this.method=chooseMethod(this.options),this._iL=!1,this._onML=null,this._addEL={message:[],internal:[]},this._uMP=new Set,this._befC=[],this._prepP=null,_prepareChannel(this)};BroadcastChannel$1._pubkey=!0;var ENFORCED_OPTIONS;BroadcastChannel$1.prototype={postMessage:function s(a){if(this.closed)throw new Error("BroadcastChannel.postMessage(): Cannot post message after channel has closed "+JSON.stringify(a));return _post(this,"message",a)},postInternal:function s(a){return _post(this,"internal",a)},set onmessage(s){var a=this.method.microSeconds(),u={time:a,fn:s};_removeListenerObject(this,"message",this._onML),s&&typeof s=="function"?(this._onML=u,_addListenerObject(this,"message",u)):this._onML=null},addEventListener:function s(a,u){var l=this.method.microSeconds(),f={time:l,fn:u};_addListenerObject(this,a,f)},removeEventListener:function s(a,u){var l=this._addEL[a].find(function(f){return f.fn===u});_removeListenerObject(this,a,l)},close:function s(){var a=this;if(!this.closed){OPEN_BROADCAST_CHANNELS.delete(this),this.closed=!0;var u=this._prepP?this._prepP:PROMISE_RESOLVED_VOID;return this._onML=null,this._addEL.message=[],u.then(function(){return Promise.all(Array.from(a._uMP))}).then(function(){return Promise.all(a._befC.map(function(l){return l()}))}).then(function(){return a.method.close(a._state)})}},get type(){return this.method.type},get isClosed(){return this.closed}};function _post(s,a,u){var l=s.method.microSeconds(),f={time:l,type:a,data:u},c=s._prepP?s._prepP:PROMISE_RESOLVED_VOID;return c.then(function(){var h=s.method.postMessage(s._state,f);return s._uMP.add(h),h.catch().then(function(){return s._uMP.delete(h)}),h})}function _prepareChannel(s){var a=s.method.create(s.name,s.options);isPromise$1(a)?(s._prepP=a,a.then(function(u){s._state=u})):s._state=a}function _hasMessageListeners(s){return s._addEL.message.length>0||s._addEL.internal.length>0}function _addListenerObject(s,a,u){s._addEL[a].push(u),_startListening(s)}function _removeListenerObject(s,a,u){s._addEL[a]=s._addEL[a].filter(function(l){return l!==u}),_stopListening(s)}function _startListening(s){if(!s._iL&&_hasMessageListeners(s)){var a=function(f){s._addEL[f.type].forEach(function(c){var h=1e5,p=c.time-h;(f.time>=p||s.method.type==="server")&&c.fn(f.data)})},u=s.method.microSeconds();s._prepP?s._prepP.then(function(){s._iL=!0,s.method.onMessage(s._state,a,u)}):(s._iL=!0,s.method.onMessage(s._state,a,u))}}function _stopListening(s){if(s._iL&&!_hasMessageListeners(s)){s._iL=!1;var a=s.method.microSeconds();s.method.onMessage(s._state,null,a)}}var base64url$2={exports:{}},base64url$1={},padString={},hasRequiredPadString;function requirePadString(){if(hasRequiredPadString)return padString;hasRequiredPadString=1,Object.defineProperty(padString,"__esModule",{value:!0});function s(a){var u=4,l=a.length,f=l%u;if(!f)return a;var c=l,h=u-f,p=l+h,v=distExports.Buffer.alloc(p);for(v.write(a);h--;)v.write("=",c++);return v.toString()}return padString.default=s,padString}var hasRequiredBase64url$1;function requireBase64url$1(){if(hasRequiredBase64url$1)return base64url$1;hasRequiredBase64url$1=1,Object.defineProperty(base64url$1,"__esModule",{value:!0});var s=requirePadString();function a(p,v){return v===void 0&&(v="utf8"),distExports.Buffer.isBuffer(p)?f(p.toString("base64")):f(distExports.Buffer.from(p,v).toString("base64"))}function u(p,v){return v===void 0&&(v="utf8"),distExports.Buffer.from(l(p),"base64").toString(v)}function l(p){return p=p.toString(),s.default(p).replace(/\-/g,"+").replace(/_/g,"/")}function f(p){return p.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function c(p){return distExports.Buffer.from(l(p),"base64")}var h=a;return h.encode=a,h.decode=u,h.toBase64=l,h.fromBase64=f,h.toBuffer=c,base64url$1.default=h,base64url$1}var hasRequiredBase64url;function requireBase64url(){return hasRequiredBase64url||(hasRequiredBase64url=1,function(s){s.exports=requireBase64url$1().default,s.exports.default=s.exports}(base64url$2)),base64url$2.exports}var base64urlExports=requireBase64url();const base64url=getDefaultExportFromCjs(base64urlExports);var eventsExports=requireEvents();const EventEmitter=getDefaultExportFromCjs(eventsExports);function e(s){this.message=s}e.prototype=new Error,e.prototype.name="InvalidCharacterError";var r=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(s){var a=String(s).replace(/=+$/,"");if(a.length%4==1)throw new e("'atob' failed: The string to be decoded is not correctly encoded.");for(var u,l,f=0,c=0,h="";l=a.charAt(c++);~l&&(u=f%4?64*u+l:l,f++%4)?h+=String.fromCharCode(255&u>>(-2*f&6)):0)l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(l);return h};function t(s){var a=s.replace(/-/g,"+").replace(/_/g,"/");switch(a.length%4){case 0:break;case 2:a+="==";break;case 3:a+="=";break;default:throw"Illegal base64url string!"}try{return function(u){return decodeURIComponent(r(u).replace(/(.)/g,function(l,f){var c=f.charCodeAt(0).toString(16).toUpperCase();return c.length<2&&(c="0"+c),"%"+c}))}(a)}catch{return r(a)}}function n(s){this.message=s}function o(s,a){if(typeof s!="string")throw new n("Invalid token specified");var u=(a=a||{}).header===!0?0:1;try{return JSON.parse(t(s.split(".")[u]))}catch(l){throw new n("Invalid token specified: "+l.message)}}n.prototype=new Error,n.prototype.name="InvalidTokenError";const TORUS_LEGACY_NETWORK$2={MAINNET:"mainnet",TESTNET:"testnet",CYAN:"cyan",AQUA:"aqua",CELESTE:"celeste"},TORUS_SAPPHIRE_NETWORK$2={SAPPHIRE_DEVNET:"sapphire_devnet",SAPPHIRE_MAINNET:"sapphire_mainnet"},MULTI_CLUSTER_NETWORKS=[],METADATA_MAP={[TORUS_LEGACY_NETWORK$2.MAINNET]:"https://metadata.web3auth.io",[TORUS_LEGACY_NETWORK$2.TESTNET]:"https://metadata.web3auth.io",[TORUS_LEGACY_NETWORK$2.CYAN]:"https://metadata.web3auth.io",[TORUS_LEGACY_NETWORK$2.AQUA]:"https://metadata.web3auth.io",[TORUS_LEGACY_NETWORK$2.CELESTE]:"https://metadata.web3auth.io"},FND_SERVER="https://fnd.web3auth.io",KEY_TYPE$1={SECP256K1:"secp256k1",ED25519:"ed25519"},TORUS_LEGACY_NETWORK$1={MAINNET:"mainnet",TESTNET:"testnet",CYAN:"cyan",AQUA:"aqua",CELESTE:"celeste"},TORUS_SAPPHIRE_NETWORK$1={SAPPHIRE_DEVNET:"sapphire_devnet",SAPPHIRE_MAINNET:"sapphire_mainnet"},LEGACY_NETWORKS_ROUTE_MAP$1={[TORUS_LEGACY_NETWORK$1.AQUA]:{migrationCompleted:!0,networkIdentifier:"aqua",networkMigratedTo:TORUS_SAPPHIRE_NETWORK$1.SAPPHIRE_MAINNET},[TORUS_LEGACY_NETWORK$1.CELESTE]:{migrationCompleted:!0,networkIdentifier:"celeste",networkMigratedTo:TORUS_SAPPHIRE_NETWORK$1.SAPPHIRE_MAINNET},[TORUS_LEGACY_NETWORK$1.CYAN]:{migrationCompleted:!0,networkIdentifier:"cyan",networkMigratedTo:TORUS_SAPPHIRE_NETWORK$1.SAPPHIRE_MAINNET},[TORUS_LEGACY_NETWORK$1.MAINNET]:{migrationCompleted:!0,networkIdentifier:"mainnet",networkMigratedTo:TORUS_SAPPHIRE_NETWORK$1.SAPPHIRE_MAINNET},[TORUS_LEGACY_NETWORK$1.TESTNET]:{migrationCompleted:!0,networkIdentifier:"teal",networkMigratedTo:TORUS_SAPPHIRE_NETWORK$1.SAPPHIRE_DEVNET}},KEY_TYPE={SECP256K1:"secp256k1",ED25519:"ed25519"},SAPPHIRE_NETWORK_URLS={[TORUS_SAPPHIRE_NETWORK$1.SAPPHIRE_DEVNET]:["https://node-1.dev-node.web3auth.io","https://node-2.dev-node.web3auth.io","https://node-3.dev-node.web3auth.io","https://node-4.dev-node.web3auth.io","https://node-5.dev-node.web3auth.io"],[TORUS_SAPPHIRE_NETWORK$1.SAPPHIRE_MAINNET]:["https://node-1.node.web3auth.io","https://node-2.node.web3auth.io","https://node-3.node.web3auth.io","https://node-4.node.web3auth.io","https://node-5.node.web3auth.io"]},getSSSEndpoints=(s,a)=>{const u=SAPPHIRE_NETWORK_URLS[s];if(!u||u.length===0)throw new Error(`Unsupported network: ${s}`);const l=LEGACY_NETWORKS_ROUTE_MAP$1[a];return u.map(f=>l&&l.networkIdentifier?`${f}/sss/${l.networkIdentifier}/jrpc`:`${f}/sss/jrpc`)},getRSSEndpoints=(s,a)=>{const u=SAPPHIRE_NETWORK_URLS[s];if(!u||u.length===0)throw new Error(`Unsupported network: ${s}`);const l=LEGACY_NETWORKS_ROUTE_MAP$1[a];return u.map(f=>l&&l.networkIdentifier?`${f}/rss/${l.networkIdentifier}`:`${f}/rss`)},getTSSEndpoints=function(s,a){let u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:KEY_TYPE.SECP256K1;const l=SAPPHIRE_NETWORK_URLS[s];if(!l||l.length===0)throw new Error(`Unsupported network: ${s}`);const f=u===KEY_TYPE.ED25519?"tss-frost":"tss",c=LEGACY_NETWORKS_ROUTE_MAP$1[a];return l.map(h=>c&&c.networkIdentifier?`${h}/${f}/${c.networkIdentifier}`:`${h}/${f}`)},SAPPHIRE_NODE_PUB_KEYS={[TORUS_SAPPHIRE_NETWORK$1.SAPPHIRE_MAINNET]:[{X:"e0925898fee0e9e941fdca7ee88deec99939ae9407e923535c4d4a3a3ff8b052",Y:"54b9fea924e3f3e40791f9987f4234ae4222412d65b74068032fa5d8b63375c1"},{X:"9124cf1e280aab32ba50dffd2de81cecabc13d82d2c1fe9de82f3b3523f9b637",Y:"fca939a1ceb42ce745c55b21ef094f543b457630cb63a94ef4f1afeee2b1f107"},{X:"555f681a63d469cc6c3a58a97e29ebd277425f0e6159708e7c7bf05f18f89476",Y:"606f2bcc0884fa5b64366fc3e8362e4939841b56acd60d5f4553cf36b891ac4e"},{X:"2b5f58d8e340f1ab922e89b3a69a68930edfe51364644a456335e179bc130128",Y:"4b4daa05939426e3cbe7d08f0e773d2bf36f64c00d04620ee6df2a7af4d2247"},{X:"3ecbb6a68afe72cf34ec6c0a12b5cb78a0d2e83ba402983b6adbc5f36219861a",Y:"dc1031c5cc8f0472bd521a62a64ebca9e163902c247bf05937daf4ae835091e4"}],[TORUS_SAPPHIRE_NETWORK$1.SAPPHIRE_DEVNET]:[{X:"f74389b0a4c8d10d2a687ae575f69b20f412d41ab7f1fe6b358aa14871327247",Y:"54e3a73098ed9bced3ef8821736e9794f9264a1420c0c7ad15d2fa617ba35ef7"},{X:"bc38813a6873e526087918507c78fc3a61624670ee851ecfb4f3bef55d027b5a",Y:"ac4b21229f662a0aefdfdac21cf17c3261a392c74a8790db218b34e3e4c1d56a"},{X:"b56541684ea5fa40c8337b7688d502f0e9e092098962ad344c34e94f06d293fb",Y:"759a998cef79d389082f9a75061a29190eec0cac99b8c25ddcf6b58569dad55c"},{X:"7bcb058d4c6ffc6ba4bfdfd93d141af35a66338a62c7c27cdad2ae3f8289b767",Y:"336ab1935e41ed4719e162587f0ab55518db4207a1eb36cc72303f1b86689d2b"},{X:"bf12a136ef94399ea098f926f04e26a4ec4ac70f69cce274e8893704c4951773",Y:"bdd44828020f52ce510e026338216ada184a6867eb4e19fb4c2d495d4a7e15e4"}]},getSapphireNodeDetails=(s,a,u)=>({currentEpoch:"1",torusNodeEndpoints:getSSSEndpoints(s,a),torusNodeSSSEndpoints:getSSSEndpoints(s,a),torusNodeRSSEndpoints:getRSSEndpoints(s,a),torusNodeTSSEndpoints:getTSSEndpoints(s,a,u),torusIndexes:[1,2,3,4,5],torusNodePub:SAPPHIRE_NODE_PUB_KEYS[s]});function fetchLocalConfig(s,a){if(Object.values(TORUS_SAPPHIRE_NETWORK$1).includes(s))return getSapphireNodeDetails(s,void 0,a);if(Object.values(TORUS_LEGACY_NETWORK$1).includes(s)){const u=LEGACY_NETWORKS_ROUTE_MAP$1[s];if(u.migrationCompleted)return getSapphireNodeDetails(u.networkMigratedTo,s,a)}}var loglevel$8={exports:{}},loglevel$7=loglevel$8.exports,hasRequiredLoglevel$3;function requireLoglevel$3(){return hasRequiredLoglevel$3||(hasRequiredLoglevel$3=1,function(s){(function(a,u){s.exports?s.exports=u():a.log=u()})(loglevel$7,function(){var a=function(){},u="undefined",l=typeof window!==u&&typeof window.navigator!==u&&/Trident\/|MSIE /.test(window.navigator.userAgent),f=["trace","debug","info","warn","error"],c={},h=null;function p(I,B){var N=I[B];if(typeof N.bind=="function")return N.bind(I);try{return Function.prototype.bind.call(N,I)}catch{return function(){return Function.prototype.apply.apply(N,[I,arguments])}}}function v(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function y(I){return I==="debug"&&(I="log"),typeof console===u?!1:I==="trace"&&l?v:console[I]!==void 0?p(console,I):console.log!==void 0?p(console,"log"):a}function b(){for(var I=this.getLevel(),B=0;B<f.length;B++){var N=f[B];this[N]=B<I?a:this.methodFactory(N,I,this.name)}if(this.log=this.debug,typeof console===u&&I<this.levels.SILENT)return"No console available for logging"}function S(I){return function(){typeof console!==u&&(b.call(this),this[I].apply(this,arguments))}}function E(I,B,N){return y(I)||S.apply(this,arguments)}function R(I,B){var N=this,D,G,V,U="loglevel";typeof I=="string"?U+=":"+I:typeof I=="symbol"&&(U=void 0);function te(k){var d=(f[k]||"silent").toUpperCase();if(!(typeof window===u||!U)){try{window.localStorage[U]=d;return}catch{}try{window.document.cookie=encodeURIComponent(U)+"="+d+";"}catch{}}}function Z(){var k;if(!(typeof window===u||!U)){try{k=window.localStorage[U]}catch{}if(typeof k===u)try{var d=window.document.cookie,g=encodeURIComponent(U),_=d.indexOf(g+"=");_!==-1&&(k=/^([^;]+)/.exec(d.slice(_+g.length+1))[1])}catch{}return N.levels[k]===void 0&&(k=void 0),k}}function J(){if(!(typeof window===u||!U)){try{window.localStorage.removeItem(U)}catch{}try{window.document.cookie=encodeURIComponent(U)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function Q(k){var d=k;if(typeof d=="string"&&N.levels[d.toUpperCase()]!==void 0&&(d=N.levels[d.toUpperCase()]),typeof d=="number"&&d>=0&&d<=N.levels.SILENT)return d;throw new TypeError("log.setLevel() called with invalid level: "+k)}N.name=I,N.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},N.methodFactory=B||E,N.getLevel=function(){return V??G??D},N.setLevel=function(k,d){return V=Q(k),d!==!1&&te(V),b.call(N)},N.setDefaultLevel=function(k){G=Q(k),Z()||N.setLevel(k,!1)},N.resetLevel=function(){V=null,J(),b.call(N)},N.enableAll=function(k){N.setLevel(N.levels.TRACE,k)},N.disableAll=function(k){N.setLevel(N.levels.SILENT,k)},N.rebuild=function(){if(h!==N&&(D=Q(h.getLevel())),b.call(N),h===N)for(var k in c)c[k].rebuild()},D=Q(h?h.getLevel():"WARN");var ee=Z();ee!=null&&(V=Q(ee)),b.call(N)}h=new R,h.getLogger=function(B){if(typeof B!="symbol"&&typeof B!="string"||B==="")throw new TypeError("You must supply a name when creating a logger.");var N=c[B];return N||(N=c[B]=new R(B,h.methodFactory)),N};var O=typeof window!==u?window.log:void 0;return h.noConflict=function(){return typeof window!==u&&window.log===h&&(window.log=O),h},h.getLoggers=function(){return c},h.default=h,h})}(loglevel$8)),loglevel$8.exports}var loglevelExports$3=requireLoglevel$3();const logLevel$1=getDefaultExportFromCjs(loglevelExports$3),log$6=logLevel$1.getLogger("http-helpers");log$6.setLevel(loglevelExports$3.levels.INFO);let apiKey$1="torus-default";const gatewayAuthHeader$1="x-api-key";async function fetchAndTrace$1(s,a){let u=null;try{u=new URL(s)}catch{}return fetch(s,a)}function getApiKeyHeaders$1(){const s={};return s[gatewayAuthHeader$1]=apiKey$1,s}function debugLogResponse$1(s){log$6.info(`Response: ${s.status} ${s.statusText}`),log$6.info(`Url: ${s.url}`)}const get$1=async function(s){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const l={mode:"cors",headers:{}};u.useAPIKey&&(l.headers=_objectSpread2(_objectSpread2({},l.headers),getApiKeyHeaders$1()));const f=deepmerge(l,a,{method:"GET"}),c=await fetchAndTrace$1(s,f);if(c.ok){const h=c.headers.get("content-type");return h!=null&&h.includes("application/json")?c.json():c.text()}throw debugLogResponse$1(c),c};var loglevel$6={exports:{}},loglevel$5=loglevel$6.exports,hasRequiredLoglevel$2;function requireLoglevel$2(){return hasRequiredLoglevel$2||(hasRequiredLoglevel$2=1,function(s){(function(a,u){s.exports?s.exports=u():a.log=u()})(loglevel$5,function(){var a=function(){},u="undefined",l=typeof window!==u&&typeof window.navigator!==u&&/Trident\/|MSIE /.test(window.navigator.userAgent),f=["trace","debug","info","warn","error"],c={},h=null;function p(I,B){var N=I[B];if(typeof N.bind=="function")return N.bind(I);try{return Function.prototype.bind.call(N,I)}catch{return function(){return Function.prototype.apply.apply(N,[I,arguments])}}}function v(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function y(I){return I==="debug"&&(I="log"),typeof console===u?!1:I==="trace"&&l?v:console[I]!==void 0?p(console,I):console.log!==void 0?p(console,"log"):a}function b(){for(var I=this.getLevel(),B=0;B<f.length;B++){var N=f[B];this[N]=B<I?a:this.methodFactory(N,I,this.name)}if(this.log=this.debug,typeof console===u&&I<this.levels.SILENT)return"No console available for logging"}function S(I){return function(){typeof console!==u&&(b.call(this),this[I].apply(this,arguments))}}function E(I,B,N){return y(I)||S.apply(this,arguments)}function R(I,B){var N=this,D,G,V,U="loglevel";typeof I=="string"?U+=":"+I:typeof I=="symbol"&&(U=void 0);function te(k){var d=(f[k]||"silent").toUpperCase();if(!(typeof window===u||!U)){try{window.localStorage[U]=d;return}catch{}try{window.document.cookie=encodeURIComponent(U)+"="+d+";"}catch{}}}function Z(){var k;if(!(typeof window===u||!U)){try{k=window.localStorage[U]}catch{}if(typeof k===u)try{var d=window.document.cookie,g=encodeURIComponent(U),_=d.indexOf(g+"=");_!==-1&&(k=/^([^;]+)/.exec(d.slice(_+g.length+1))[1])}catch{}return N.levels[k]===void 0&&(k=void 0),k}}function J(){if(!(typeof window===u||!U)){try{window.localStorage.removeItem(U)}catch{}try{window.document.cookie=encodeURIComponent(U)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function Q(k){var d=k;if(typeof d=="string"&&N.levels[d.toUpperCase()]!==void 0&&(d=N.levels[d.toUpperCase()]),typeof d=="number"&&d>=0&&d<=N.levels.SILENT)return d;throw new TypeError("log.setLevel() called with invalid level: "+k)}N.name=I,N.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},N.methodFactory=B||E,N.getLevel=function(){return V??G??D},N.setLevel=function(k,d){return V=Q(k),d!==!1&&te(V),b.call(N)},N.setDefaultLevel=function(k){G=Q(k),Z()||N.setLevel(k,!1)},N.resetLevel=function(){V=null,J(),b.call(N)},N.enableAll=function(k){N.setLevel(N.levels.TRACE,k)},N.disableAll=function(k){N.setLevel(N.levels.SILENT,k)},N.rebuild=function(){if(h!==N&&(D=Q(h.getLevel())),b.call(N),h===N)for(var k in c)c[k].rebuild()},D=Q(h?h.getLevel():"WARN");var ee=Z();ee!=null&&(V=Q(ee)),b.call(N)}h=new R,h.getLogger=function(B){if(typeof B!="symbol"&&typeof B!="string"||B==="")throw new TypeError("You must supply a name when creating a logger.");var N=c[B];return N||(N=c[B]=new R(B,h.methodFactory)),N};var O=typeof window!==u?window.log:void 0;return h.noConflict=function(){return typeof window!==u&&window.log===h&&(window.log=O),h},h.getLoggers=function(){return c},h.default=h,h})}(loglevel$6)),loglevel$6.exports}var loglevelExports$2=requireLoglevel$2();const logger=getDefaultExportFromCjs(loglevelExports$2),log$5=logger.getLogger("fnd");class NodeDetailManager{constructor(){let{network:a=TORUS_SAPPHIRE_NETWORK$2.SAPPHIRE_MAINNET,keyType:u=KEY_TYPE$1.SECP256K1,fndServerEndpoint:l,enableLogging:f=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_defineProperty(this,"fndServerEndpoint",`${FND_SERVER}/node-details`),_defineProperty(this,"_currentEpoch","1"),_defineProperty(this,"_keyType",void 0),_defineProperty(this,"_torusNodeEndpoints",[]),_defineProperty(this,"_torusNodeRSSEndpoints",[]),_defineProperty(this,"_torusNodeSSSEndpoints",[]),_defineProperty(this,"_torusNodeTSSEndpoints",[]),_defineProperty(this,"_torusNodePub",[]),_defineProperty(this,"_torusIndexes",[]),_defineProperty(this,"updated",void 0),_defineProperty(this,"network",void 0),this.network=a,this._keyType=u,this.updated=!1,l&&(this.fndServerEndpoint=l),f?log$5.enableAll():log$5.disableAll()}get _nodeDetails(){return{currentEpoch:this._currentEpoch,torusNodeEndpoints:this._torusNodeEndpoints,torusNodeSSSEndpoints:this._torusNodeSSSEndpoints,torusNodeRSSEndpoints:this._torusNodeRSSEndpoints,torusNodeTSSEndpoints:this._torusNodeTSSEndpoints,torusNodePub:this._torusNodePub,torusIndexes:this._torusIndexes,updated:this.updated}}async getNodeDetails(a){let{verifier:u,verifierId:l}=a;try{if(this.updated&&!MULTI_CLUSTER_NETWORKS.includes(this.network))return this._nodeDetails;try{const{nodeDetails:c}=await get$1(`${this.fndServerEndpoint}?network=${this.network}&verifier=${u}&verifierId=${l}&keyType=${this._keyType}`);return this.setNodeDetails(c),this._nodeDetails}catch(c){log$5.error("Failed to fetch node details from server, using local.",c)}const f=fetchLocalConfig(this.network,this._keyType);if(!f)throw new Error("Failed to fetch node details");return this.setNodeDetails(f),this._nodeDetails}catch(f){throw log$5.error("Failed to fetch node details",f),f}}async getMetadataUrl(){return Object.values(TORUS_LEGACY_NETWORK$2).includes(this.network)?METADATA_MAP[this.network]:(await this.getNodeDetails({verifier:"test-verifier",verifierId:"test-verifier-id"})).torusNodeEndpoints[0].replace("/sss/jrpc","/metadata")}setNodeDetails(a){const{currentEpoch:u,torusNodeEndpoints:l,torusNodeSSSEndpoints:f,torusNodeRSSEndpoints:c,torusNodeTSSEndpoints:h,torusNodePub:p,torusIndexes:v}=a;this._torusNodeEndpoints=l,this._torusNodeSSSEndpoints=f||[],this._torusNodeRSSEndpoints=c||[],this._torusNodeTSSEndpoints=h||[],this._torusNodePub=p,this._torusIndexes=v,this._currentEpoch=u,this.updated=!0}}var loglevel$4={exports:{}},loglevel$3=loglevel$4.exports,hasRequiredLoglevel$1;function requireLoglevel$1(){return hasRequiredLoglevel$1||(hasRequiredLoglevel$1=1,function(s){(function(a,u){s.exports?s.exports=u():a.log=u()})(loglevel$3,function(){var a=function(){},u="undefined",l=typeof window!==u&&typeof window.navigator!==u&&/Trident\/|MSIE /.test(window.navigator.userAgent),f=["trace","debug","info","warn","error"],c={},h=null;function p(I,B){var N=I[B];if(typeof N.bind=="function")return N.bind(I);try{return Function.prototype.bind.call(N,I)}catch{return function(){return Function.prototype.apply.apply(N,[I,arguments])}}}function v(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function y(I){return I==="debug"&&(I="log"),typeof console===u?!1:I==="trace"&&l?v:console[I]!==void 0?p(console,I):console.log!==void 0?p(console,"log"):a}function b(){for(var I=this.getLevel(),B=0;B<f.length;B++){var N=f[B];this[N]=B<I?a:this.methodFactory(N,I,this.name)}if(this.log=this.debug,typeof console===u&&I<this.levels.SILENT)return"No console available for logging"}function S(I){return function(){typeof console!==u&&(b.call(this),this[I].apply(this,arguments))}}function E(I,B,N){return y(I)||S.apply(this,arguments)}function R(I,B){var N=this,D,G,V,U="loglevel";typeof I=="string"?U+=":"+I:typeof I=="symbol"&&(U=void 0);function te(k){var d=(f[k]||"silent").toUpperCase();if(!(typeof window===u||!U)){try{window.localStorage[U]=d;return}catch{}try{window.document.cookie=encodeURIComponent(U)+"="+d+";"}catch{}}}function Z(){var k;if(!(typeof window===u||!U)){try{k=window.localStorage[U]}catch{}if(typeof k===u)try{var d=window.document.cookie,g=encodeURIComponent(U),_=d.indexOf(g+"=");_!==-1&&(k=/^([^;]+)/.exec(d.slice(_+g.length+1))[1])}catch{}return N.levels[k]===void 0&&(k=void 0),k}}function J(){if(!(typeof window===u||!U)){try{window.localStorage.removeItem(U)}catch{}try{window.document.cookie=encodeURIComponent(U)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function Q(k){var d=k;if(typeof d=="string"&&N.levels[d.toUpperCase()]!==void 0&&(d=N.levels[d.toUpperCase()]),typeof d=="number"&&d>=0&&d<=N.levels.SILENT)return d;throw new TypeError("log.setLevel() called with invalid level: "+k)}N.name=I,N.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},N.methodFactory=B||E,N.getLevel=function(){return V??G??D},N.setLevel=function(k,d){return V=Q(k),d!==!1&&te(V),b.call(N)},N.setDefaultLevel=function(k){G=Q(k),Z()||N.setLevel(k,!1)},N.resetLevel=function(){V=null,J(),b.call(N)},N.enableAll=function(k){N.setLevel(N.levels.TRACE,k)},N.disableAll=function(k){N.setLevel(N.levels.SILENT,k)},N.rebuild=function(){if(h!==N&&(D=Q(h.getLevel())),b.call(N),h===N)for(var k in c)c[k].rebuild()},D=Q(h?h.getLevel():"WARN");var ee=Z();ee!=null&&(V=Q(ee)),b.call(N)}h=new R,h.getLogger=function(B){if(typeof B!="symbol"&&typeof B!="string"||B==="")throw new TypeError("You must supply a name when creating a logger.");var N=c[B];return N||(N=c[B]=new R(B,h.methodFactory)),N};var O=typeof window!==u?window.log:void 0;return h.noConflict=function(){return typeof window!==u&&window.log===h&&(window.log=O),h},h.getLoggers=function(){return c},h.default=h,h})}(loglevel$4)),loglevel$4.exports}var loglevelExports$1=requireLoglevel$1();const loglevel$2=getDefaultExportFromCjs(loglevelExports$1),log$4=loglevel$2.getLogger("http-helpers");log$4.setLevel(loglevelExports$1.levels.INFO);let apiKey="torus-default",embedHost="";const gatewayAuthHeader="x-api-key",gatewayEmbedHostHeader="x-embed-host";function setEmbedHost(s){embedHost=s}function setAPIKey(s){apiKey=s}async function fetchAndTrace(s,a){let u=null;try{u=new URL(s)}catch{}return fetch(s,a)}function getApiKeyHeaders(){const s={};return apiKey&&(s[gatewayAuthHeader]=apiKey),embedHost&&(s[gatewayEmbedHostHeader]=embedHost),s}function debugLogResponse(s){log$4.info(`Response: ${s.status} ${s.statusText}`),log$4.info(`Url: ${s.url}`)}function logTracingHeader(s){log$4.info(`Request tracing with traceID=${s.headers.get("x-web3-correlation-id")}`)}const promiseTimeout=(s,a)=>{const u=new Promise((l,f)=>{const c=setTimeout(()=>{clearTimeout(c),f(new Error(`Timed out in ${s}ms`))},s)});return Promise.race([a,u])},get=async function(s){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const l={mode:"cors",headers:{}};u.useAPIKey&&(l.headers=_objectSpread2(_objectSpread2({},l.headers),getApiKeyHeaders()));const f=deepmerge(l,a,{method:"GET"}),c=await fetchAndTrace(s,f);if(c.ok){const h=c.headers.get("content-type");return h!=null&&h.includes("application/json")?c.json():c.text()}throw debugLogResponse(c),c},post=function(s){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const f={mode:"cors",headers:{"Content-Type":"application/json; charset=utf-8"}};l.useAPIKey&&(f.headers=_objectSpread2(_objectSpread2({},f.headers),getApiKeyHeaders()));const c=deepmerge(f,u,{method:"POST"});return l.isUrlEncodedData?(c.body=a,c.headers["Content-Type"]==="application/json; charset=utf-8"&&delete c.headers["Content-Type"]):c.body=JSON.stringify(a),promiseTimeout(l.timeout||6e4,fetchAndTrace(s,c).then(h=>{if(l.logTracingHeader&&logTracingHeader(h),h.ok){const p=h.headers.get("content-type");return p!=null&&p.includes("application/json")?h.json():h.text()}throw debugLogResponse(h),h}))},generateJsonRPCObject=(s,a)=>({jsonrpc:"2.0",method:s,id:10,params:a}),TORUS_LEGACY_NETWORK={MAINNET:"mainnet",TESTNET:"testnet",CYAN:"cyan",AQUA:"aqua",CELESTE:"celeste"},TORUS_SAPPHIRE_NETWORK={SAPPHIRE_DEVNET:"sapphire_devnet",SAPPHIRE_MAINNET:"sapphire_mainnet"},LEGACY_NETWORKS_ROUTE_MAP={[TORUS_LEGACY_NETWORK.AQUA]:{migrationCompleted:!0,networkIdentifier:"aqua",networkMigratedTo:TORUS_SAPPHIRE_NETWORK.SAPPHIRE_MAINNET},[TORUS_LEGACY_NETWORK.CELESTE]:{migrationCompleted:!0,networkIdentifier:"celeste",networkMigratedTo:TORUS_SAPPHIRE_NETWORK.SAPPHIRE_MAINNET},[TORUS_LEGACY_NETWORK.CYAN]:{migrationCompleted:!0,networkIdentifier:"cyan",networkMigratedTo:TORUS_SAPPHIRE_NETWORK.SAPPHIRE_MAINNET},[TORUS_LEGACY_NETWORK.MAINNET]:{migrationCompleted:!0,networkIdentifier:"mainnet",networkMigratedTo:TORUS_SAPPHIRE_NETWORK.SAPPHIRE_MAINNET},[TORUS_LEGACY_NETWORK.TESTNET]:{migrationCompleted:!0,networkIdentifier:"teal",networkMigratedTo:TORUS_SAPPHIRE_NETWORK.SAPPHIRE_DEVNET}},SIGNER_MAP={[TORUS_SAPPHIRE_NETWORK.SAPPHIRE_MAINNET]:"https://signer.web3auth.io",[TORUS_SAPPHIRE_NETWORK.SAPPHIRE_DEVNET]:"https://signer.web3auth.io",[TORUS_LEGACY_NETWORK.MAINNET]:"https://signer.web3auth.io",[TORUS_LEGACY_NETWORK.TESTNET]:"https://signer.web3auth.io",[TORUS_LEGACY_NETWORK.CYAN]:"https://signer-polygon.web3auth.io",[TORUS_LEGACY_NETWORK.AQUA]:"https://signer-polygon.web3auth.io",[TORUS_LEGACY_NETWORK.CELESTE]:"https://signer-polygon.web3auth.io"},JRPC_METHODS={GET_OR_SET_KEY:"GetPubKeyOrKeyAssign",COMMITMENT_REQUEST:"CommitmentRequest",IMPORT_SHARE:"ImportShare",GET_SHARE_OR_KEY_ASSIGN:"GetShareOrKeyAssign"},LEGACY_METADATA_HOST="https://metadata.tor.us",normalizeKeysResult=s=>{const a={keys:[],is_new_key:s.is_new_key};return s&&s.keys&&s.keys.length>0&&(a.keys=s.keys.map(u=>({pub_key_X:u.pub_key_X,pub_key_Y:u.pub_key_Y,address:u.address}))),a},kCombinations=(s,a)=>{let u=s;if(typeof u=="number"&&(u=Array.from({length:u},(c,h)=>h)),a>u.length||a<=0)return[];if(a===u.length)return[u];if(a===1)return u.reduce((c,h)=>[...c,[h]],[]);const l=[];let f=[];for(let c=0;c<=u.length-a+1;c+=1){f=kCombinations(u.slice(c+1),a-1);for(let h=0;h<f.length;h+=1)l.push([u[c],...f[h]])}return l},thresholdSame=(s,a)=>{const u={};for(let l=0;l<s.length;l+=1){const f=stringify$2(s[l]);if(u[f]=u[f]?u[f]+1:1,u[f]===a)return s[l]}};function encParamsBufToHex$1(s){return{iv:distExports.Buffer.from(s.iv).toString("hex"),ephemPublicKey:distExports.Buffer.from(s.ephemPublicKey).toString("hex"),ciphertext:distExports.Buffer.from(s.ciphertext).toString("hex"),mac:distExports.Buffer.from(s.mac).toString("hex"),mode:"AES256"}}function encParamsHexToBuf$1(s){return{ephemPublicKey:distExports.Buffer.from(s.ephemPublicKey,"hex"),iv:distExports.Buffer.from(s.iv,"hex"),mac:distExports.Buffer.from(s.mac,"hex")}}class GetOrSetNonceError extends Error{}const log$3=loglevel$2.getLogger("torus.js");log$3.disableAll();function keccak256$1(s){return`0x${distExports.Buffer.from(keccak256$3(s)).toString("hex")}`}function stripHexPrefix(s){return s.startsWith("0x")?s.slice(2):s}function toChecksumAddress(s){const a=stripHexPrefix(s).toLowerCase(),u=distExports.Buffer.from(a,"utf8"),l=distExports.Buffer.from(keccak256$3(u)).toString("hex");let f="0x";for(let c=0;c<a.length;c++)parseInt(l[c],16)>=8?f+=a[c].toUpperCase():f+=a[c];return f}function generateAddressFromPrivKey(s,a){const l=s.keyFromPrivate(a.toString("hex",64),"hex").getPublic().encode("hex",!1).slice(2);log$3.info(l,"public key");const f=`0x${keccak256$1(distExports.Buffer.from(l,"hex")).slice(26)}`;return toChecksumAddress(f)}function generateAddressFromPubKey(s,a,u){const l=s.keyFromPublic({x:a.toString("hex",64),y:u.toString("hex",64)}),f=l.getPublic().encode("hex",!1).slice(2);log$3.info(l.getPublic().encode("hex",!1),"public key");const c=`0x${keccak256$1(distExports.Buffer.from(f,"hex")).slice(26)}`;return toChecksumAddress(c)}class Share{constructor(a,u){_defineProperty(this,"share",void 0),_defineProperty(this,"shareIndex",void 0),this.share=new BN(u,"hex"),this.shareIndex=new BN(a,"hex")}static fromJSON(a){const{share:u,shareIndex:l}=a;return new Share(l,u)}toJSON(){return{share:this.share.toString("hex"),shareIndex:this.shareIndex.toString("hex")}}}class Polynomial{constructor(a,u){_defineProperty(this,"polynomial",void 0),_defineProperty(this,"ecCurve",void 0),this.polynomial=a,this.ecCurve=u}getThreshold(){return this.polynomial.length}polyEval(a){const u=new BN(a,"hex");let l=new BN(u),f=new BN(0);f=f.add(this.polynomial[0]);for(let c=1;c<this.polynomial.length;c+=1){const h=l.mul(this.polynomial[c]);f=f.add(h),f=f.umod(this.ecCurve.curve.n),l=l.mul(new BN(u)),l=l.umod(this.ecCurve.curve.n)}return f}generateShares(a){const u=a.map(f=>typeof f=="number"?new BN(f):f instanceof BN?f:typeof f=="string"?new BN(f,"hex"):f),l={};for(let f=0;f<u.length;f+=1)l[u[f].toString("hex",64)]=new Share(u[f],this.polyEval(u[f]));return l}}function generatePrivateExcludingIndexes(s){const a=new BN(generatePrivate());return s.find(u=>u.eq(a))?generatePrivateExcludingIndexes(s):a}function lagrangeInterpolation(s,a,u){if(a.length!==u.length)throw new Error("shares not equal to nodeIndex length in lagrangeInterpolation");let l=new BN(0);for(let f=0;f<a.length;f+=1){let c=new BN(1),h=new BN(1);for(let v=0;v<a.length;v+=1)if(f!==v){c=c.mul(u[v].neg()),c=c.umod(s.curve.n);let y=u[f].sub(u[v]);y=y.umod(s.curve.n),h=h.mul(y).umod(s.curve.n)}let p=c.mul(h.invm(s.curve.n)).umod(s.curve.n);p=p.mul(a[f]).umod(s.curve.n),l=l.add(p)}return l.umod(s.curve.n)}function generateRandomPolynomial(s,a,u,l){let f=u;u||(f=generatePrivateExcludingIndexes([new BN(0)]));{const c=[f];for(let h=0;h<a;h+=1){const p=generatePrivateExcludingIndexes(c);c.push(p)}return new Polynomial(c,s)}}async function decryptNodeData(s,a,u){const l=encParamsHexToBuf$1(s);return await decrypt(u,_objectSpread2(_objectSpread2({},l),{},{ciphertext:distExports.Buffer.from(a,"hex")}))}function generateMetadataParams(s,a,u,l){const f=s.keyFromPrivate(l.toString("hex",64)),c={data:u,timestamp:new BN(~~(a+Date.now()/1e3)).toString(16)},h=f.sign(keccak256$1(distExports.Buffer.from(stringify$2(c),"utf8")).slice(2));return{pub_key_X:f.getPublic().getX().toString("hex"),pub_key_Y:f.getPublic().getY().toString("hex"),set_data:c,signature:distExports.Buffer.from(h.r.toString(16,64)+h.s.toString(16,64)+new BN("").toString(16,2),"hex").toString("base64")}}async function getMetadata(s,a){let u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};try{const l=await post(`${s}/get`,a,u,{useAPIKey:!0});return!l||!l.message?new BN(0):new BN(l.message,16)}catch(l){return loglevel$2.error("get metadata error",l),new BN(0)}}async function getOrSetNonce(s,a,u,l,f,c){let h=arguments.length>6&&arguments[6]!==void 0?arguments[6]:!1,p;const v=h?"getNonce":"getOrSetNonce";return c?p=generateMetadataParams(a,u,v,c):p={pub_key_X:l,pub_key_Y:f,set_data:{data:v}},post(`${s}/get_or_set_nonce`,p,void 0,{useAPIKey:!0})}async function getNonce(s,a,u,l,f,c){return getOrSetNonce(s,a,u,l,f,c,!0)}const config$2={logRequestTracing:!1};function capitalizeFirstLetter(s){return s.charAt(0).toUpperCase()+s.slice(1)}class SomeError extends Error{constructor(a){let{errors:u,responses:l,predicate:f}=a;super("Unable to resolve enough promises."),_defineProperty(this,"errors",void 0),_defineProperty(this,"responses",void 0),_defineProperty(this,"predicate",void 0),this.errors=u,this.responses=l,this.predicate=f}get message(){return`${super.message}. ${this.errors.length} errors: ${this.errors.map(a=>a.message||a).join(", ")} and ${this.responses.length} responses: ${JSON.stringify(this.responses)}`}toString(){return this.message}}const Some=(s,a)=>new Promise((u,l)=>{let f=0;const c={resolved:!1},h=new Array(s.length).fill(void 0),p=new Array(s.length).fill(void 0);let v;return s.forEach((y,b)=>y.then(S=>{p[b]=S}).catch(S=>{h[b]=S}).finally(()=>{if(!c.resolved)return a(p.slice(0),c).then(S=>{c.resolved=!0,u(S)}).catch(S=>{v=S}).finally(()=>{if(f+=1,f===s.length){const E=Object.values(p.reduce((R,O)=>{if(O){var I;const{id:B,error:N}=O;(N==null||(I=N.data)===null||I===void 0?void 0:I.length)>0&&(N.data.startsWith("Error occurred while verifying params")?R[B]=capitalizeFirstLetter(N.data):R[B]=N.data)}return R},{}));if(E.length>0){const R=E.length>1?`
${E.map(O=>`• ${O}`).join(`
`)}`:E[0];l(new Error(R))}else{var S;l(new SomeError({errors:h,responses:p,predicate:((S=v)===null||S===void 0?void 0:S.message)||v}))}}})}))}),GetPubKeyOrKeyAssign=async s=>{const{endpoints:a,network:u,verifier:l,verifierId:f,extendedVerifierId:c}=s,h=a.map(b=>post(b,generateJsonRPCObject(JRPC_METHODS.GET_OR_SET_KEY,{verifier:l,verifier_id:f.toString(),extended_verifier_id:c,one_key_flow:!0,fetch_node_index:!0}),null,{logTracingHeader:config$2.logRequestTracing}).catch(S=>log$3.error(`${JRPC_METHODS.GET_OR_SET_KEY} request failed`,S)));let p;const v=[];return await Some(h,b=>{const S=b.filter(O=>{if(O&&!O.error){if(!p){var I;((I=O.result)===null||I===void 0||(I=I.keys[0].nonce_data)===null||I===void 0||(I=I.pubNonce)===null||I===void 0?void 0:I.x)&&(p=O.result.keys[0].nonce_data)}return O}return!1}),E=thresholdSame(S.map(O=>O&&O.error),~~(a.length/2)+1),R=thresholdSame(S.map(O=>O&&normalizeKeysResult(O.result)),~~(a.length/2)+1);return R&&(p||c||LEGACY_NETWORKS_ROUTE_MAP[u])||E?(R&&b.forEach(O=>{if(O&&O.result){const I=O.result.keys[0].pub_key_X.toLowerCase(),B=R.keys[0].pub_key_X.toLowerCase();if(I===B){const N=parseInt(O.result.node_index);N&&v.push(N)}}}),Promise.resolve({keyResult:R,nodeIndexes:v,errorResult:E,nonceResult:p})):Promise.reject(new Error(`invalid public key result: ${JSON.stringify(b)} and nonce result:${JSON.stringify(p||{})} for verifier: ${l}, verifierId: ${f} and extendedVerifierId: ${c} `))})};async function retrieveOrImportShare(s){const{legacyMetadataHost:a,serverTimeOffset:u,enableOneKey:l,ecCurve:f,allowHost:c,network:h,clientId:p,endpoints:v,verifier:y,verifierParams:b,idToken:S,importedShares:E,extraParams:R}=s;await get(c,{headers:{verifier:y,verifierId:b.verifier_id,network:h,clientId:p}},{useAPIKey:!0});const O=[],I=generatePrivate(),B=getPublic(I).toString("hex"),N=B.slice(2,66),D=B.slice(66),G=keccak256$1(distExports.Buffer.from(S,"utf8"));let V=!1;if(E&&E.length>0){if(E.length!==v.length)throw new Error("Invalid imported shares length");V=!0}for(let U=0;U<v.length;U+=1){const te=post(v[U],generateJsonRPCObject(JRPC_METHODS.COMMITMENT_REQUEST,{messageprefix:"mug00",tokencommitment:G.slice(2),temppubx:N,temppuby:D,verifieridentifier:y}),null,{logTracingHeader:config$2.logRequestTracing}).catch(Z=>{log$3.error("commitment error",Z)});O.push(te)}return Some(O,U=>{const te=U.filter(Z=>!(!Z||typeof Z!="object"||Z.error));return E.length>0&&te.length===v.length||E.length===0&&te.length>=~~(v.length*3/4)+1&&te.find(J=>{var Q;return!!(J&&((Q=J.result)===null||Q===void 0?void 0:Q.nodeindex)==="1")})?Promise.resolve(U):Promise.reject(new Error(`invalid ${JSON.stringify(U)}`))}).then(U=>{const te=[],Z=[];for(let Q=0;Q<U.length;Q+=1){const ee=U[Q];!ee||typeof ee!="object"||ee.error||ee&&Z.push(ee.result)}for(let Q=0;Q<v.length;Q+=1){const ee=U[Q];if(!(!ee||typeof ee!="object")&&!ee.error)if(V){const k=E[Q],d=post(v[Q],generateJsonRPCObject(JRPC_METHODS.IMPORT_SHARE,{encrypted:"yes",use_temp:!0,item:[_objectSpread2(_objectSpread2({},b),{},{idtoken:S,nodesignatures:Z,verifieridentifier:y,pub_key_x:k.pub_key_x,pub_key_y:k.pub_key_y,encrypted_share:k.encrypted_share,encrypted_share_metadata:k.encrypted_share_metadata,node_index:k.node_index,key_type:k.key_type,nonce_data:k.nonce_data,nonce_signature:k.nonce_signature},R)],one_key_flow:!0}),null,{logTracingHeader:config$2.logRequestTracing}).catch(g=>log$3.error("share req",g));te.push(d)}else{const k=post(v[Q],generateJsonRPCObject(JRPC_METHODS.GET_SHARE_OR_KEY_ASSIGN,{encrypted:"yes",use_temp:!0,item:[_objectSpread2(_objectSpread2({},b),{},{idtoken:S,nodesignatures:Z,verifieridentifier:y},R)],one_key_flow:!0}),null,{logTracingHeader:config$2.logRequestTracing}).catch(d=>log$3.error("share req",d));te.push(k)}}let J;return Some(te,async(Q,ee)=>{const k=Q.filter(P=>!(!P||typeof P!="object"||P.error)),d=Q.map(P=>{if(P&&P.result&&P.result.keys[0].public_key){if(!J&&!b.extended_verifier_id){var $;(($=P.result.keys[0].nonce_data)===null||$===void 0||($=$.pubNonce)===null||$===void 0?void 0:$.x)&&(J=P.result.keys[0].nonce_data)}return P.result.keys[0].public_key}}),g=thresholdSame(d,~~(v.length/2)+1);if(!g)throw new Error("invalid result from nodes, threshold number of public key results are not matching");if(!J&&!b.extended_verifier_id&&!LEGACY_NETWORKS_ROUTE_MAP[h])throw new Error(`invalid metadata result from nodes, nonce metadata is empty for verifier: ${y} and verifierId: ${b.verifier_id}`);const _=E.length>0?v.length:~~(v.length/2)+1;if(k.length>=_&&g&&(J||b.extended_verifier_id||LEGACY_NETWORKS_ROUTE_MAP[h])){const P=[],$=[],T=[],m=[],M=[],W=[];for(let Ne=0;Ne<k.length;Ne+=1){const Pe=k[Ne],{session_tokens:Ie,session_token_metadata:Ke,session_token_sigs:Le,session_token_sig_metadata:Ce,keys:at,is_new_key:Oe}=Pe.result;if(W.push(Oe),(Le==null?void 0:Le.length)>0){var w;Ce&&(w=Ce[0])!==null&&w!==void 0&&w.ephemPublicKey?$.push(decryptNodeData(Ce[0],Le[0],I).catch(De=>log$3.debug("session sig decryption",De))):$.push(Promise.resolve(distExports.Buffer.from(Le[0],"hex")))}else $.push(Promise.resolve(void 0));if((Ie==null?void 0:Ie.length)>0){var x;Ke&&(x=Ke[0])!==null&&x!==void 0&&x.ephemPublicKey?T.push(decryptNodeData(Ke[0],Ie[0],I).catch(De=>log$3.debug("session token sig decryption",De))):T.push(Promise.resolve(distExports.Buffer.from(Ie[0],"base64")))}else T.push(Promise.resolve(void 0));if((at==null?void 0:at.length)>0){const De=Pe.result.keys[0];m.push(new BN(De.node_index)),De.share_metadata&&P.push(decryptNodeData(De.share_metadata,distExports.Buffer.from(De.share,"base64").toString("binary").padStart(64,"0"),I).catch(yt=>log$3.debug("share decryption",yt)))}else m.push(void 0),P.push(Promise.resolve(void 0))}const Y=await Promise.all(P.concat($).concat(T)),ue=Y.slice(0,P.length),ge=Y.slice(P.length,P.length+$.length),he=Y.slice(P.length+$.length,Y.length),ae=ge.filter(Ne=>!!Ne),de=~~(v.length/2)+1;if(!b.extended_verifier_id&&ae.length<de)throw new Error(`Insufficient number of signatures from nodes, required: ${de}, found: ${ae.length}`);const pe=he.filter(Ne=>!!Ne);if(!b.extended_verifier_id&&pe.length<de)throw new Error(`Insufficient number of session tokens from nodes, required: ${de}, found: ${pe.length}`);if(he.forEach((Ne,Pe)=>{Ne?M.push({token:Ne.toString("base64"),signature:ge[Pe].toString("hex"),node_pubx:k[Pe].result.node_pubx,node_puby:k[Pe].result.node_puby}):M.push(void 0)}),ee.resolved)return;const oe=ue.reduce((Ne,Pe,Ie)=>(Pe&&Ne.push({index:m[Ie],value:new BN(Pe)}),Ne),[]),le=kCombinations(oe.length,~~(v.length/2)+1);let me=null;for(let Ne=0;Ne<le.length;Ne+=1){const Pe=le[Ne],Ie=oe.filter((yt,Ue)=>Pe.includes(Ue)),Ke=Ie.map(yt=>yt.value),Le=Ie.map(yt=>yt.index),Ce=lagrangeInterpolation(f,Ke,Le);if(!Ce)continue;const at=getPublic(distExports.Buffer.from(Ce.toString(16,64),"hex")).toString("hex"),Oe=at.slice(2,66),De=at.slice(66);if(new BN(Oe,16).cmp(new BN(g.X,16))===0&&new BN(De,16).cmp(new BN(g.Y,16))===0){me=Ce;break}}if(me==null)throw new Error("could not derive private key");const xe=thresholdSame(W,~~(v.length/2)+1);return{privateKey:me,sessionTokenData:M,thresholdNonceData:J,nodeIndexes:m,isNewKey:xe==="true"}}throw new Error("Invalid")})}).then(async U=>{var te;const{privateKey:Z,sessionTokenData:J,thresholdNonceData:Q,nodeIndexes:ee,isNewKey:k}=U;let d=Q;if(!Z)throw new Error("Invalid private key returned");const g=Z,_=getPublic(distExports.Buffer.from(g.toString(16,64),"hex")).toString("hex"),w=_.slice(2,66),x=_.slice(66);let P=new BN((te=d)!==null&&te!==void 0&&te.nonce?d.nonce.padStart(64,"0"):"0","hex"),$,T,m="v1";if(b.extended_verifier_id)m="v2",$=f.keyFromPublic({x:w,y:x}).getPublic();else if(LEGACY_NETWORKS_ROUTE_MAP[h])if(l)if(d=await getOrSetNonce(a,f,u,w,x,g,!k),P=new BN(d.nonce||"0",16),m=d.typeOfUser,m==="v2")T={X:d.pubNonce.x,Y:d.pubNonce.y},$=f.keyFromPublic({x:w,y:x}).getPublic().add(f.keyFromPublic({x:d.pubNonce.x,y:d.pubNonce.y}).getPublic());else{m="v1",P=await getMetadata(a,{pub_key_X:w,pub_key_Y:x});const ge=g.add(P).umod(f.curve.n);$=f.keyFromPrivate(ge.toString(16,64),"hex").getPublic()}else{m="v1",P=await getMetadata(a,{pub_key_X:w,pub_key_Y:x});const ge=g.add(P).umod(f.curve.n);$=f.keyFromPrivate(ge.toString(16,64),"hex").getPublic()}else m="v2",$=f.keyFromPublic({x:w,y:x}).getPublic().add(f.keyFromPublic({x:d.pubNonce.x,y:d.pubNonce.y}).getPublic()),T={X:d.pubNonce.x,Y:d.pubNonce.y};if(!$)throw new Error("Invalid public key, this might be a bug, please report this to web3auth team");const M=generateAddressFromPrivKey(f,g),W=generateAddressFromPubKey(f,$.getX(),$.getY());log$3.debug("> torus.js/retrieveShares",{finalEvmAddress:W});let Y="";(m==="v1"||m==="v2"&&P.gt(new BN(0)))&&(Y=g.add(P).umod(f.curve.n).toString("hex",64));let ue=!1;return m==="v1"?ue=null:m==="v2"&&(ue=P.eq(new BN("0"))),{finalKeyData:{evmAddress:W,X:$.getX().toString(16,64),Y:$.getY().toString(16,64),privKey:Y},oAuthKeyData:{evmAddress:M,X:w,Y:x,privKey:g.toString("hex",64).padStart(64,"0")},sessionData:{sessionTokenData:J,sessionAuthKey:I.toString("hex").padStart(64,"0")},metadata:{pubNonce:T,nonce:P,typeOfUser:m,upgraded:ue},nodesData:{nodeIndexes:ee.map(ge=>ge.toNumber())}}})}const legacyKeyLookup=async(s,a,u)=>{const l=s.map(f=>post(f,generateJsonRPCObject("VerifierLookupRequest",{verifier:a,verifier_id:u.toString()})).catch(c=>log$3.error("lookup request failed",c)));return Some(l,f=>{const c=f.filter(v=>v),h=thresholdSame(c.map(v=>v&&v.error),~~(s.length/2)+1),p=thresholdSame(c.map(v=>v&&v.result),~~(s.length/2)+1);return p||h?Promise.resolve({keyResult:p,errorResult:h}):Promise.reject(new Error(`invalid results ${JSON.stringify(f)}`))})},legacyKeyAssign=async s=>{let{endpoints:a,torusNodePubs:u,lastPoint:l,firstPoint:f,verifier:c,verifierId:h,signerHost:p,network:v,clientId:y}=s,b,S;if(l===void 0?(b=Math.floor(Math.random()*a.length),log$3.info("keyassign",b,a[b]),S=b):b=l%a.length,b===f)throw new Error("Looped through all");f!==void 0&&(S=f);const E=generateJsonRPCObject("KeyAssign",{verifier:c,verifier_id:h.toString()});try{const R=await post(p,E,{headers:{pubKeyX:u[b].X,pubKeyY:u[b].Y,network:v,clientId:y}},{useAPIKey:!0});return await post(a[b],_objectSpread2(_objectSpread2({},E),R),{headers:{"Content-Type":"application/json; charset=utf-8"}})}catch(R){const O=R;log$3.error(O.status,O.message,O,"key assign error");const I=["Timed out","Failed to fetch","cancelled","NetworkError when attempting to fetch resource.","TypeError: Failed to fetch","TypeError: cancelled","TypeError: NetworkError when attempting to fetch resource."];if((O==null?void 0:O.status)===502||(O==null?void 0:O.status)===504||(O==null?void 0:O.status)===401||I.includes(O.message)||I.some(B=>{var N;return(N=O.message)===null||N===void 0?void 0:N.includes(B)})||O.message&&O.message.includes("reason: getaddrinfo EAI_AGAIN"))return legacyKeyAssign({endpoints:a,torusNodePubs:u,lastPoint:b+1,firstPoint:S,verifier:c,verifierId:h,signerHost:p,network:v,clientId:y});throw new Error(`Sorry, the Torus Network that powers Web3Auth is currently very busy.
    We will generate your key in time. Pls try again later. 

    ${O.message||""}`)}},legacyWaitKeyLookup=(s,a,u,l)=>new Promise((f,c)=>{setTimeout(()=>{legacyKeyLookup(s,a,u).then(f).catch(c)},l)});class Torus{constructor(a){let{enableOneKey:u=!1,clientId:l,network:f,serverTimeOffset:c=0,allowHost:h="https://signer.tor.us/api/allow",legacyMetadataHost:p=LEGACY_METADATA_HOST}=a;if(_defineProperty(this,"allowHost",void 0),_defineProperty(this,"serverTimeOffset",void 0),_defineProperty(this,"network",void 0),_defineProperty(this,"clientId",void 0),_defineProperty(this,"ec",void 0),_defineProperty(this,"enableOneKey",void 0),_defineProperty(this,"signerHost",void 0),_defineProperty(this,"legacyMetadataHost",void 0),!l)throw Error("Please provide a valid clientId in constructor");if(!f)throw Error("Please provide a valid network in constructor");this.ec=new ellipticExports.ec("secp256k1"),this.serverTimeOffset=c||0,this.network=f,this.clientId=l,this.allowHost=h,this.enableOneKey=u,this.legacyMetadataHost=p,this.signerHost=`${SIGNER_MAP[f]}/api/sign`}get isLegacyNetwork(){const a=LEGACY_NETWORKS_ROUTE_MAP[this.network];return!!(a&&!a.migrationCompleted)}static enableLogging(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)?(log$3.enableAll(),config$2.logRequestTracing=!0):log$3.disableAll()}static setAPIKey(a){setAPIKey(a)}static setEmbedHost(a){setEmbedHost(a)}static isGetOrSetNonceError(a){return a instanceof GetOrSetNonceError}static getPostboxKey(a){return a.metadata.typeOfUser==="v1"&&a.finalKeyData.privKey||a.oAuthKeyData.privKey}async retrieveShares(a,u,l,f,c){let h=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};return this.isLegacyNetwork?this.legacyRetrieveShares(a,u,l,f,c,h):retrieveOrImportShare({legacyMetadataHost:this.legacyMetadataHost,serverTimeOffset:this.serverTimeOffset,enableOneKey:this.enableOneKey,ecCurve:this.ec,allowHost:this.allowHost,network:this.network,clientId:this.clientId,endpoints:a,verifier:l,verifierParams:f,idToken:c,importedShares:[],extraParams:h})}async getPublicAddress(a,u,l){let{verifier:f,verifierId:c,extendedVerifierId:h}=l;return this.isLegacyNetwork?this.getLegacyPublicAddress(a,u,{verifier:f,verifierId:c},this.enableOneKey):this.getNewPublicAddress(a,{verifier:f,verifierId:c,extendedVerifierId:h},this.enableOneKey)}async importPrivateKey(a,u,l,f,c,h,p){let v=arguments.length>7&&arguments[7]!==void 0?arguments[7]:{};if(this.isLegacyNetwork)throw new Error("This function is not supported on legacy networks");if(a.length!==u.length)throw new Error("length of endpoints array must be same as length of nodeIndexes array");const b=~~(a.length/2)+1-1,S=[],E=this.ec.keyFromPrivate(p.padStart(64,"0"),"hex");for(const J of u)S.push(new BN(J));const R=E.getPrivate(),O=new BN(generatePrivate()),I=R.sub(O).umod(this.ec.curve.n),B=this.ec.keyFromPrivate(I.toString("hex").padStart(64,"0")).getPublic(),D=generateRandomPolynomial(this.ec,b,I).generateShares(S),G=this.generateNonceMetadataParams("getOrSetNonce",I,O),V=distExports.Buffer.from(stringify$2(G.set_data),"utf8").toString("base64"),U=[],te=[];for(let J=0;J<S.length;J++){const Q=D[S[J].toString("hex",64)].toJSON();if(!l[J])throw new Error(`Missing node pub key for node index: ${S[J].toString("hex",64)}`);const ee=this.ec.keyFromPublic({x:l[J].X,y:l[J].Y});te.push(encrypt(distExports.Buffer.from(ee.getPublic().encodeCompressed("hex"),"hex"),distExports.Buffer.from(Q.share,"hex")))}const Z=await Promise.all(te);for(let J=0;J<S.length;J++){const Q=D[S[J].toString("hex",64)].toJSON(),ee=Z[J],k=encParamsBufToHex$1(ee),d={pub_key_x:B.getX().toString("hex",64),pub_key_y:B.getY().toString("hex",64),encrypted_share:k.ciphertext,encrypted_share_metadata:k,node_index:Number.parseInt(Q.shareIndex,16),key_type:"secp256k1",nonce_data:V,nonce_signature:G.signature};U.push(d)}return retrieveOrImportShare({legacyMetadataHost:this.legacyMetadataHost,serverTimeOffset:this.serverTimeOffset,enableOneKey:this.enableOneKey,ecCurve:this.ec,allowHost:this.allowHost,network:this.network,clientId:this.clientId,endpoints:a,verifier:f,verifierParams:c,idToken:h,importedShares:U,extraParams:v})}async getUserTypeAndAddress(a,u,l){let{verifier:f,verifierId:c,extendedVerifierId:h}=l;return this.isLegacyNetwork?this.getLegacyPublicAddress(a,u,{verifier:f,verifierId:c},!0):this.getNewPublicAddress(a,{verifier:f,verifierId:c,extendedVerifierId:h},!0)}async legacyRetrieveShares(a,u,l,f,c){let h=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};const p=[];await get(this.allowHost,{headers:{verifier:l,verifierId:f.verifier_id,network:this.network,clientId:this.clientId}},{useAPIKey:!0});const v=generatePrivate(),y=getPublic(v).toString("hex"),b=y.slice(2,66),S=y.slice(66),E=keccak256$1(distExports.Buffer.from(c,"utf8"));for(let R=0;R<a.length;R+=1){const O=post(a[R],generateJsonRPCObject("CommitmentRequest",{messageprefix:"mug00",tokencommitment:E.slice(2),temppubx:b,temppuby:S,verifieridentifier:l})).catch(I=>{log$3.error("commitment",I)});p.push(O)}return Some(p,R=>R.filter(I=>!(!I||typeof I!="object"||I.error)).length>=~~(a.length/4)*3+1?Promise.resolve(R):Promise.reject(new Error(`invalid ${JSON.stringify(R)}`))).then(R=>{const O=[],I=[];for(let B=0;B<R.length;B+=1)R[B]&&I.push(R[B].result);for(let B=0;B<a.length;B+=1){const N=post(a[B],generateJsonRPCObject("ShareRequest",{encrypted:"yes",item:[_objectSpread2(_objectSpread2({},f),{},{idtoken:c,nodesignatures:I,verifieridentifier:l},h)]})).catch(D=>log$3.error("share req",D));O.push(N)}return Some(O,async(B,N)=>{const D=B.filter(U=>U),G=thresholdSame(B.map(U=>U&&U.result&&U.result.keys[0].PublicKey),~~(a.length/2)+1);if(D.length>=~~(a.length/2)+1&&G){const U=[],te=[];for(let k=0;k<B.length;k+=1){var V;const d=B[k];if((d==null||(V=d.result)===null||V===void 0||(V=V.keys)===null||V===void 0?void 0:V.length)>0){d.result.keys.sort((_,w)=>new BN(_.Index,16).cmp(new BN(w.Index,16)));const g=d.result.keys[0];if(g.Metadata){const _={ephemPublicKey:distExports.Buffer.from(g.Metadata.ephemPublicKey,"hex"),iv:distExports.Buffer.from(g.Metadata.iv,"hex"),mac:distExports.Buffer.from(g.Metadata.mac,"hex")};U.push(decrypt(v,_objectSpread2(_objectSpread2({},_),{},{ciphertext:distExports.Buffer.from(distExports.Buffer.from(g.Share,"base64").toString("binary").padStart(64,"0"),"hex")})).catch(w=>log$3.debug("share decryption",w)))}else U.push(Promise.resolve(distExports.Buffer.from(g.Share.padStart(64,"0"),"hex")))}else U.push(Promise.resolve(void 0));te.push(new BN(u[k],16))}const Z=await Promise.all(U);if(N.resolved)return;const J=Z.reduce((k,d,g)=>(d&&k.push({index:te[g],value:new BN(d)}),k),[]),Q=kCombinations(J.length,~~(a.length/2)+1);let ee=null;for(let k=0;k<Q.length;k+=1){const d=Q[k],g=J.filter((m,M)=>d.includes(M)),_=g.map(m=>m.value),w=g.map(m=>m.index),x=lagrangeInterpolation(this.ec,_,w);if(!x)continue;const P=getPublic(distExports.Buffer.from(x.toString(16,64),"hex")).toString("hex"),$=P.slice(2,66),T=P.slice(66);if(new BN($,16).cmp(new BN(G.X,16))===0&&new BN(T,16).cmp(new BN(G.Y,16))===0){ee=x;break}}if(ee==null)throw new Error("could not derive private key");return ee}throw new Error("invalid")})}).then(async R=>{const O=R;if(!O)throw new Error("Invalid private key returned");const I=getPublic(distExports.Buffer.from(O.toString(16,64),"hex")).toString("hex"),B=I.slice(2,66),N=I.slice(66);let D,G,V="v1",U;if(this.enableOneKey){const ee=await getNonce(this.legacyMetadataHost,this.ec,this.serverTimeOffset,B,N,O);if(D=new BN(ee.nonce||"0",16),V=ee.typeOfUser,V==="v2")G=this.ec.keyFromPublic({x:B,y:N}).getPublic().add(this.ec.keyFromPublic({x:ee.pubNonce.x,y:ee.pubNonce.y}).getPublic()),U={X:ee.pubNonce.x,Y:ee.pubNonce.y};else{D=await getMetadata(this.legacyMetadataHost,{pub_key_X:B,pub_key_Y:N});const k=O.add(D).umod(this.ec.curve.n);G=this.ec.keyFromPrivate(k.toString("hex"),"hex").getPublic()}}else{D=await getMetadata(this.legacyMetadataHost,{pub_key_X:B,pub_key_Y:N});const ee=O.add(D).umod(this.ec.curve.n);G=this.ec.keyFromPrivate(ee.toString("hex"),"hex").getPublic()}const te=generateAddressFromPrivKey(this.ec,O);let Z="";(V==="v1"||V==="v2"&&D.gt(new BN(0)))&&(Z=O.add(D).umod(this.ec.curve.n).toString("hex",64).padStart(64,"0"));let J=!1;V==="v1"?J=null:V==="v2"&&(J=D.eq(new BN("0")));let Q="";if(G)Q=generateAddressFromPubKey(this.ec,G.getX(),G.getY()),log$3.debug("> torus.js/retrieveShares",{finalEvmAddress:Q});else throw new Error("Invalid public key, this might be a bug, please report this to web3auth team");return{finalKeyData:{evmAddress:Q,X:G?G.getX().toString(16,64):"",Y:G?G.getY().toString(16,64):"",privKey:Z},oAuthKeyData:{evmAddress:te,X:B,Y:N,privKey:O.toString("hex",64).padStart(64,"0")},sessionData:{sessionTokenData:[],sessionAuthKey:""},metadata:{pubNonce:U,nonce:D,typeOfUser:V,upgraded:J},nodesData:{nodeIndexes:[]}}})}async getLegacyPublicAddress(a,u,l,f){let{verifier:c,verifierId:h}=l;log$3.debug("> torus.js/getPublicAddress",{endpoints:a,torusNodePubs:u,verifier:c,verifierId:h});let p,v=!1;const{keyResult:y,errorResult:b}=await legacyKeyLookup(a,c,h)||{};if(b&&JSON.stringify(b).includes("Verifier not supported"))throw new Error(`Verifier not supported. Check if you: 

      1. Are on the right network (Torus testnet/mainnet) 

      2. Have setup a verifier on dashboard.web3auth.io?`);if(b&&JSON.stringify(b).includes("Verifier + VerifierID has not yet been assigned")){await legacyKeyAssign({endpoints:a,torusNodePubs:u,lastPoint:void 0,firstPoint:void 0,verifier:c,verifierId:h,signerHost:this.signerHost,network:this.network,clientId:this.clientId});const S=await legacyWaitKeyLookup(a,c,h,1e3);p=S==null?void 0:S.keyResult,v=!0}else if(y)p=y;else throw new Error(`node results do not match at first lookup ${JSON.stringify(y||{})}, ${JSON.stringify(b||{})}`);if(log$3.debug("> torus.js/getPublicAddress",{finalKeyResult:p,isNewKey:v}),p)return this.formatLegacyPublicKeyData({finalKeyResult:p,isNewKey:v,enableOneKey:f});throw new Error(`node results do not match at final lookup ${JSON.stringify(y||{})}, ${JSON.stringify(b||{})}`)}generateNonceMetadataParams(a,u,l){const f=this.ec.keyFromPrivate(u.toString("hex",64)),c={operation:a,timestamp:new BN(~~(this.serverTimeOffset+Date.now()/1e3)).toString(16)};l&&(c.data=l.toString("hex",64));const h=f.sign(keccak256$1(distExports.Buffer.from(stringify$2(c),"utf8")).slice(2));return{pub_key_X:f.getPublic().getX().toString("hex",64),pub_key_Y:f.getPublic().getY().toString("hex",64),set_data:c,signature:distExports.Buffer.from(h.r.toString(16,64)+h.s.toString(16,64)+new BN("").toString(16,2),"hex").toString("base64")}}async getNewPublicAddress(a,u,l){let{verifier:f,verifierId:c,extendedVerifierId:h}=u;log$3.debug("> torus.js/getPublicAddress",{endpoints:a,verifier:f,verifierId:c});const p=await GetPubKeyOrKeyAssign({endpoints:a,network:this.network,verifier:f,verifierId:c,extendedVerifierId:h}),{errorResult:v,keyResult:y,nodeIndexes:b=[]}=p,{nonceResult:S}=p;if(v&&JSON.stringify(v).toLowerCase().includes("verifier not supported"))throw new Error(`Verifier not supported. Check if you: 

      1. Are on the right network (Torus testnet/mainnet) 

      2. Have setup a verifier on dashboard.web3auth.io?`);if(v)throw new Error(`node results do not match at first lookup ${JSON.stringify(y||{})}, ${JSON.stringify(v||{})}`);if(log$3.debug("> torus.js/getPublicAddress",{keyResult:y}),!(y!=null&&y.keys))throw new Error(`node results do not match at final lookup ${JSON.stringify(y||{})}, ${JSON.stringify(v||{})}`);if(!S&&!h&&!LEGACY_NETWORKS_ROUTE_MAP[this.network])throw new GetOrSetNonceError("metadata nonce is missing in share response");const{pub_key_X:E,pub_key_Y:R}=y.keys[0];let O;const I=new BN((S==null?void 0:S.nonce)||"0",16);let B,N;if(h)N=this.ec.keyFromPublic({x:E,y:R}).getPublic(),B=N;else{if(LEGACY_NETWORKS_ROUTE_MAP[this.network])return this.formatLegacyPublicKeyData({isNewKey:y.is_new_key,enableOneKey:l,finalKeyResult:{keys:y.keys}});{const J=S;B=this.ec.keyFromPublic({x:E,y:R}).getPublic(),N=this.ec.keyFromPublic({x:E,y:R}).getPublic().add(this.ec.keyFromPublic({x:J.pubNonce.x,y:J.pubNonce.y}).getPublic()),O={X:J.pubNonce.x,Y:J.pubNonce.y}}}if(!B)throw new Error("Unable to derive oAuthPubKey");const D=B.getX().toString(16,64),G=B.getY().toString(16,64),V=generateAddressFromPubKey(this.ec,B.getX(),B.getY());if(log$3.debug("> torus.js/getPublicAddress, oAuthKeyData",{X:D,Y:G,oAuthAddress:V,nonce:I==null?void 0:I.toString(16),pubNonce:O}),!N)throw new Error("Unable to derive finalPubKey");const U=N?N.getX().toString(16,64):"",te=N?N.getY().toString(16,64):"",Z=N?generateAddressFromPubKey(this.ec,N.getX(),N.getY()):"";return{oAuthKeyData:{evmAddress:V,X:D,Y:G},finalKeyData:{evmAddress:Z,X:U,Y:te},metadata:{pubNonce:O,nonce:I,upgraded:(S==null?void 0:S.upgraded)||!1,typeOfUser:"v2"},nodesData:{nodeIndexes:b}}}async formatLegacyPublicKeyData(a){var u,l;const{finalKeyResult:f,enableOneKey:c,isNewKey:h}=a,{pub_key_X:p,pub_key_Y:v}=f.keys[0];let y,b,S,E,R;const O=this.ec.keyFromPublic({x:p,y:v}).getPublic();if(c){try{y=await getOrSetNonce(this.legacyMetadataHost,this.ec,this.serverTimeOffset,p,v,void 0,!h),b=new BN(y.nonce||"0",16),E=y.typeOfUser}catch{throw new GetOrSetNonceError}if(y.typeOfUser==="v1")b=await getMetadata(this.legacyMetadataHost,{pub_key_X:p,pub_key_Y:v}),S=this.ec.keyFromPublic({x:p,y:v}).getPublic().add(this.ec.keyFromPrivate(b.toString(16,64),"hex").getPublic());else if(y.typeOfUser==="v2")S=this.ec.keyFromPublic({x:p,y:v}).getPublic().add(this.ec.keyFromPublic({x:y.pubNonce.x,y:y.pubNonce.y}).getPublic()),R={X:y.pubNonce.x,Y:y.pubNonce.y};else throw new Error("getOrSetNonce should always return typeOfUser.")}else E="v1",b=await getMetadata(this.legacyMetadataHost,{pub_key_X:p,pub_key_Y:v}),S=this.ec.keyFromPublic({x:p,y:v}).getPublic().add(this.ec.keyFromPrivate(b.toString(16,64),"hex").getPublic());if(!O)throw new Error("Unable to derive oAuthPubKey");const I=O.getX().toString(16,64),B=O.getY().toString(16,64),N=generateAddressFromPubKey(this.ec,O.getX(),O.getY());if(log$3.debug("> torus.js/getPublicAddress, oAuthKeyData",{X:I,Y:B,oAuthAddress:N,nonce:(u=b)===null||u===void 0?void 0:u.toString(16),pubNonce:R}),E==="v2"&&!S)throw new Error("Unable to derive finalPubKey");const D=S?S.getX().toString(16,64):"",G=S?S.getY().toString(16,64):"",V=S?generateAddressFromPubKey(this.ec,S.getX(),S.getY()):"";return{oAuthKeyData:{evmAddress:N,X:I,Y:B},finalKeyData:{evmAddress:V,X:D,Y:G},metadata:{pubNonce:R,nonce:b,upgraded:((l=y)===null||l===void 0?void 0:l.upgraded)||!1,typeOfUser:E},nodesData:{nodeIndexes:[]}}}}var registerServiceWorker$1={},hasRequiredRegisterServiceWorker;function requireRegisterServiceWorker(){if(hasRequiredRegisterServiceWorker)return registerServiceWorker$1;hasRequiredRegisterServiceWorker=1;var s=function(){return!!(window.location.hostname==="localhost"||window.location.hostname==="[::1]"||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/))},a;typeof window<"u"&&(typeof document<"u"&&(document.readyState==="interactive"||document.readyState==="complete")?a=Promise.resolve():typeof Promise<"u"?a=new Promise(function(c){return window.addEventListener("load",c)}):a={then:function(c){return window.addEventListener("load",c)}}),registerServiceWorker$1.register=function(h,p){p===void 0&&(p={});var v=p.registrationOptions;v===void 0&&(v={}),delete p.registrationOptions;var y=function(b){for(var S=[],E=arguments.length-1;E-- >0;)S[E]=arguments[E+1];p&&p[b]&&p[b].apply(p,S)};"serviceWorker"in navigator&&a.then(function(){s()?(f(h,y,v),navigator.serviceWorker.ready.then(function(b){y("ready",b)}).catch(function(b){return u(y,b)})):(l(h,y,v),navigator.serviceWorker.ready.then(function(b){y("ready",b)}).catch(function(b){return u(y,b)}))})};function u(c,h){navigator.onLine||c("offline"),c("error",h)}function l(c,h,p){navigator.serviceWorker.register(c,p).then(function(v){if(h("registered",v),v.waiting){h("updated",v);return}v.onupdatefound=function(){h("updatefound",v);var y=v.installing;y.onstatechange=function(){y.state==="installed"&&(navigator.serviceWorker.controller?h("updated",v):h("cached",v))}}}).catch(function(v){return u(h,v)})}function f(c,h,p){fetch(c).then(function(v){v.status===404?(h("error",new Error("Service worker not found at "+c)),unregister()):v.headers.get("content-type").indexOf("javascript")===-1?(h("error",new Error("Expected "+c+" to have javascript content-type, but received "+v.headers.get("content-type"))),unregister()):l(c,h,p)}).catch(function(v){return u(h,v)})}return registerServiceWorker$1.unregister=function(){"serviceWorker"in navigator&&navigator.serviceWorker.ready.then(function(h){h.unregister()}).catch(function(h){return u(emit,h)})},registerServiceWorker$1}var registerServiceWorkerExports=requireRegisterServiceWorker(),loglevel$1={exports:{}},loglevel=loglevel$1.exports,hasRequiredLoglevel;function requireLoglevel(){return hasRequiredLoglevel||(hasRequiredLoglevel=1,function(s){(function(a,u){s.exports?s.exports=u():a.log=u()})(loglevel,function(){var a=function(){},u="undefined",l=typeof window!==u&&typeof window.navigator!==u&&/Trident\/|MSIE /.test(window.navigator.userAgent),f=["trace","debug","info","warn","error"],c={},h=null;function p(I,B){var N=I[B];if(typeof N.bind=="function")return N.bind(I);try{return Function.prototype.bind.call(N,I)}catch{return function(){return Function.prototype.apply.apply(N,[I,arguments])}}}function v(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function y(I){return I==="debug"&&(I="log"),typeof console===u?!1:I==="trace"&&l?v:console[I]!==void 0?p(console,I):console.log!==void 0?p(console,"log"):a}function b(){for(var I=this.getLevel(),B=0;B<f.length;B++){var N=f[B];this[N]=B<I?a:this.methodFactory(N,I,this.name)}if(this.log=this.debug,typeof console===u&&I<this.levels.SILENT)return"No console available for logging"}function S(I){return function(){typeof console!==u&&(b.call(this),this[I].apply(this,arguments))}}function E(I,B,N){return y(I)||S.apply(this,arguments)}function R(I,B){var N=this,D,G,V,U="loglevel";typeof I=="string"?U+=":"+I:typeof I=="symbol"&&(U=void 0);function te(k){var d=(f[k]||"silent").toUpperCase();if(!(typeof window===u||!U)){try{window.localStorage[U]=d;return}catch{}try{window.document.cookie=encodeURIComponent(U)+"="+d+";"}catch{}}}function Z(){var k;if(!(typeof window===u||!U)){try{k=window.localStorage[U]}catch{}if(typeof k===u)try{var d=window.document.cookie,g=encodeURIComponent(U),_=d.indexOf(g+"=");_!==-1&&(k=/^([^;]+)/.exec(d.slice(_+g.length+1))[1])}catch{}return N.levels[k]===void 0&&(k=void 0),k}}function J(){if(!(typeof window===u||!U)){try{window.localStorage.removeItem(U)}catch{}try{window.document.cookie=encodeURIComponent(U)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function Q(k){var d=k;if(typeof d=="string"&&N.levels[d.toUpperCase()]!==void 0&&(d=N.levels[d.toUpperCase()]),typeof d=="number"&&d>=0&&d<=N.levels.SILENT)return d;throw new TypeError("log.setLevel() called with invalid level: "+k)}N.name=I,N.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},N.methodFactory=B||E,N.getLevel=function(){return V??G??D},N.setLevel=function(k,d){return V=Q(k),d!==!1&&te(V),b.call(N)},N.setDefaultLevel=function(k){G=Q(k),Z()||N.setLevel(k,!1)},N.resetLevel=function(){V=null,J(),b.call(N)},N.enableAll=function(k){N.setLevel(N.levels.TRACE,k)},N.disableAll=function(k){N.setLevel(N.levels.SILENT,k)},N.rebuild=function(){if(h!==N&&(D=Q(h.getLevel())),b.call(N),h===N)for(var k in c)c[k].rebuild()},D=Q(h?h.getLevel():"WARN");var ee=Z();ee!=null&&(V=Q(ee)),b.call(N)}h=new R,h.getLogger=function(B){if(typeof B!="symbol"&&typeof B!="string"||B==="")throw new TypeError("You must supply a name when creating a logger.");var N=c[B];return N||(N=c[B]=new R(B,h.methodFactory)),N};var O=typeof window!==u?window.log:void 0;return h.noConflict=function(){return typeof window!==u&&window.log===h&&(window.log=O),h},h.getLoggers=function(){return c},h.default=h,h})}(loglevel$1)),loglevel$1.exports}var loglevelExports=requireLoglevel();const logLevel=getDefaultExportFromCjs(loglevelExports),log$2=logLevel.getLogger("http-helpers");log$2.setLevel(loglevelExports.levels.INFO);function keccak256(s){return distExports.Buffer.from(keccak256$3(s))}const ec=new ellipticExports.ec("secp256k1");function encParamsHexToBuf(s){return{iv:distExports.Buffer.from(s.iv,"hex"),ephemPublicKey:distExports.Buffer.from(s.ephemPublicKey,"hex"),ciphertext:distExports.Buffer.from(s.ciphertext,"hex"),mac:distExports.Buffer.from(s.mac,"hex")}}function encParamsBufToHex(s){return{iv:distExports.Buffer.from(s.iv).toString("hex"),ephemPublicKey:distExports.Buffer.from(s.ephemPublicKey).toString("hex"),ciphertext:distExports.Buffer.from(s.ciphertext).toString("hex"),mac:distExports.Buffer.from(s.mac).toString("hex")}}async function encryptData(s,a){const u=JSON.stringify(a),l=distExports.Buffer.from(u,"utf-8"),f=await encrypt(getPublic(distExports.Buffer.from(s,"hex")),l),c=encParamsBufToHex(f);return JSON.stringify(c)}async function decryptData(s,a){const u=JSON.parse(a),l=encParamsHexToBuf(u),f=ec.keyFromPrivate(s),h=(await decrypt(distExports.Buffer.from(f.getPrivate().toString("hex",64),"hex"),l)).toString("utf-8");return JSON.parse(h)}const LOGIN={GOOGLE:"google",FACEBOOK:"facebook",REDDIT:"reddit",DISCORD:"discord",TWITCH:"twitch",APPLE:"apple",GITHUB:"github",LINKEDIN:"linkedin",TWITTER:"twitter",WEIBO:"weibo",LINE:"line",EMAIL_PASSWORD:"email_password",PASSWORDLESS:"passwordless",JWT:"jwt",WEBAUTHN:"webauthn"},AGGREGATE_VERIFIER={SINGLE_VERIFIER_ID:"single_id_verifier"},UX_MODE={POPUP:"popup",REDIRECT:"redirect"},REDIRECT_PARAMS_STORAGE_METHOD={LOCAL_STORAGE:"localStorage",SESSION_STORAGE:"sessionStorage",SERVER:"server"},TORUS_METHOD={TRIGGER_LOGIN:"triggerLogin",TRIGGER_AGGREGATE_LOGIN:"triggerAggregateLogin",TRIGGER_AGGREGATE_HYBRID_LOGIN:"triggerHybridAggregateLogin"},SENTRY_TXNS={FETCH_NODE_DETAILS:"fetchNodeDetails",PUB_ADDRESS_LOOKUP:"pubAddressLookup",FETCH_SHARES:"fetchShares"};var log$1=log$1$1.getLogger("customauth");const loginToConnectionMap={[LOGIN.APPLE]:"apple",[LOGIN.GITHUB]:"github",[LOGIN.LINKEDIN]:"linkedin",[LOGIN.TWITTER]:"twitter",[LOGIN.WEIBO]:"weibo",[LOGIN.LINE]:"line",[LOGIN.EMAIL_PASSWORD]:"Username-Password-Authentication",[LOGIN.PASSWORDLESS]:"email"},padUrlString=s=>s.href.endsWith("/")?s.href:`${s.href}/`,randomId=()=>Math.random().toString(36).slice(2),broadcastChannelOptions={webWorkerSupport:!1};function caseSensitiveField(s,a){return a?s:s.toLowerCase()}const getVerifierId=function(s,a,u){let l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;const{name:f,sub:c}=s;if(u)return caseSensitiveField(s[u],l);switch(a){case LOGIN.PASSWORDLESS:case LOGIN.EMAIL_PASSWORD:return caseSensitiveField(f,l);case LOGIN.WEIBO:case LOGIN.GITHUB:case LOGIN.TWITTER:case LOGIN.APPLE:case LOGIN.LINKEDIN:case LOGIN.LINE:case LOGIN.JWT:return caseSensitiveField(c,l);default:throw new Error("Invalid login type")}},handleRedirectParameters=(s,a)=>{const u=s.split("&").reduce((c,h)=>{const[p,v]=h.split("=");return c[p]=v,c},{});log$1.info(u,a);let l={},f="";return Object.keys(u).length>0&&u.state?(l=JSON.parse(base64url.decode(decodeURIComponent(decodeURIComponent(u.state))))||{},f=u.error_description||u.error||f):Object.keys(a).length>0&&a.state&&(l=JSON.parse(base64url.decode(decodeURIComponent(decodeURIComponent(a.state))))||{},a.error&&(f=a.error)),{error:f,instanceParameters:l,hashParameters:u}};function storageAvailable(s){let a;try{a=window[s];const u="__storage_test__";return a.setItem(u,u),a.removeItem(u),!0}catch(u){const l=u;return l&&(l.code===22||l.code===1014||l.name==="QuotaExceededError"||l.name==="NS_ERROR_DOM_QUOTA_REACHED")&&a&&a.length!==0}}function getPopupFeatures(){const s=window.screenLeft!==void 0?window.screenLeft:window.screenX,a=window.screenTop!==void 0?window.screenTop:window.screenY,u=1200,l=700,f=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:window.screen.width,c=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:window.screen.height,h=1,p=Math.abs((f-u)/2/h+s),v=Math.abs((c-l)/2/h+a);return`titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=${l/h},width=${u/h},top=${v},left=${p}`}const isFirefox=()=>{var s;return((s=window)===null||s===void 0||(s=s.navigator)===null||s===void 0?void 0:s.userAgent.toLowerCase().indexOf("firefox"))>-1||!1};function constructURL(s){const{baseURL:a,query:u,hash:l}=s,f=new URL(a);if(u&&Object.keys(u).forEach(c=>{f.searchParams.append(c,u[c])}),l){const c=new URL(constructURL({baseURL:a,query:l})).searchParams.toString();f.hash=c}return f.toString()}function are3PCSupported(){var s;const a=Bowser.parse(navigator.userAgent);log$1.info(JSON.stringify(a),"current browser info");let u=!0;return(s=navigator)!==null&&s!==void 0&&s.brave&&(u=!1),(a.engine.name===Bowser.ENGINE_MAP.WebKit||a.engine.name===Bowser.ENGINE_MAP.Gecko)&&(u=!1),u}const validateAndConstructUrl=s=>{try{return new URL(decodeURIComponent(s))}catch(a){throw new Error(`${(a==null?void 0:a.message)||""}, Note: Your jwt domain: (i.e ${s}) must have http:// or https:// prefix`)}};function isMobileOrTablet(){const a=Bowser.getParser(navigator.userAgent).getPlatform();return a.type===Bowser.PLATFORMS_MAP.tablet||a.type===Bowser.PLATFORMS_MAP.mobile}function getTimeout(s){return(s===LOGIN.FACEBOOK||s===LOGIN.LINE)&&isMobileOrTablet()?1e3*60:1e3*10}class PopupHandler extends eventsExports.EventEmitter{constructor(a){let{url:u,target:l,features:f,timeout:c=3e4}=a;super(),_defineProperty(this,"url",void 0),_defineProperty(this,"target",void 0),_defineProperty(this,"features",void 0),_defineProperty(this,"window",void 0),_defineProperty(this,"windowTimer",void 0),_defineProperty(this,"iClosedWindow",void 0),_defineProperty(this,"timeout",void 0),this.url=u,this.target=l||"_blank",this.features=f||getPopupFeatures(),this.window=void 0,this.windowTimer=void 0,this.iClosedWindow=!1,this.timeout=c,this._setupTimer()}_setupTimer(){this.windowTimer=Number(setInterval(()=>{this.window&&this.window.closed&&(clearInterval(this.windowTimer),setTimeout(()=>{this.iClosedWindow||this.emit("close"),this.iClosedWindow=!1,this.window=void 0},this.timeout)),this.window===void 0&&clearInterval(this.windowTimer)},500))}open(){var a;return this.window=window.open(this.url.href,this.target,this.features),(a=this.window)!==null&&a!==void 0&&a.focus&&this.window.focus(),Promise.resolve()}close(){this.iClosedWindow=!0,this.window&&this.window.close()}redirect(a){a?window.location.replace(this.url.href):window.location.href=this.url.href}}const _excluded$2=["access_token","id_token"];class AbstractLoginHandler{constructor(a,u,l,f,c,h,p,v){this.clientId=a,this.verifier=u,this.redirect_uri=l,this.typeOfLogin=f,this.uxMode=c,this.redirectToOpener=h,this.jwtParams=p,this.customState=v,_defineProperty(this,"nonce",randomId()),_defineProperty(this,"finalURL",void 0)}get state(){return encodeURIComponent(base64url.encode(JSON.stringify(_objectSpread2(_objectSpread2({},this.customState||{}),{},{instanceId:this.nonce,verifier:this.verifier,typeOfLogin:this.typeOfLogin,redirectToOpener:this.redirectToOpener||!1}))))}handleLoginWindow(a){const u=new PopupHandler({url:this.finalURL,features:a.popupFeatures,timeout:getTimeout(this.typeOfLogin)});if(this.uxMode===UX_MODE.REDIRECT)u.redirect(a.locationReplaceOnRedirect);else return new Promise((l,f)=>{let c;const h=async p=>{try{const{error:v,data:y}=p,b=y||{},{instanceParams:S,hashParams:{access_token:E,id_token:R}}=b,O=_objectWithoutProperties(b.hashParams,_excluded$2);if(v){log$1.error(p),f(new Error(`Error: ${v}. Info: ${JSON.stringify(p.data||{})}`));return}p.data&&S.verifier===this.verifier&&(log$1.info(p.data),!this.redirectToOpener&&c&&await c.postMessage({success:!0}),l(_objectSpread2(_objectSpread2({accessToken:E,idToken:R||""},O),{},{state:S})))}catch(v){log$1.error(v),f(v)}};if(!this.redirectToOpener)c=new BroadcastChannel$1(`redirect_channel_${this.nonce}`,broadcastChannelOptions),c.addEventListener("message",async p=>{await h(p),c.close(),u.close()});else{const p=async v=>{if(!v.data)return;const y=v.data;y.channel===`redirect_channel_${this.nonce}`&&(window.removeEventListener("message",p),h(y),u.close())};window.addEventListener("message",p)}u.open(),u.once("close",()=>{c&&c.close(),f(new Error("user closed popup"))})});return null}}class DiscordHandler extends AbstractLoginHandler{constructor(a,u,l,f,c,h,p,v){super(a,u,l,f,c,h,p,v),this.clientId=a,this.verifier=u,this.redirect_uri=l,this.typeOfLogin=f,this.uxMode=c,this.redirectToOpener=h,this.jwtParams=p,this.customState=v,_defineProperty(this,"RESPONSE_TYPE","token"),_defineProperty(this,"SCOPE","identify email"),this.setFinalUrl()}setFinalUrl(){const a=new URL("https://discord.com/api/oauth2/authorize"),u=JSON.parse(JSON.stringify(this.jwtParams||{})),l=deepmerge({state:this.state,response_type:this.RESPONSE_TYPE,client_id:this.clientId,redirect_uri:this.redirect_uri,scope:this.SCOPE},u);Object.keys(l).forEach(f=>{l[f]&&a.searchParams.append(f,l[f])}),this.finalURL=a}async getUserInfo(a){const{accessToken:u}=a,l=await get$2("https://discord.com/api/users/@me",{headers:{Authorization:`Bearer ${u}`}}),{id:f,avatar:c,email:h="",username:p="",discriminator:v=""}=l;return{profileImage:c===null?`https://cdn.discordapp.com/embed/avatars/${Number(v)%5}.png`:`https://cdn.discordapp.com/avatars/${f}/${c}.png?size=2048`,name:`${p}#${v}`,email:h,verifierId:f,verifier:this.verifier,typeOfLogin:this.typeOfLogin}}}class FacebookHandler extends AbstractLoginHandler{constructor(a,u,l,f,c,h,p,v){super(a,u,l,f,c,h,p,v),this.clientId=a,this.verifier=u,this.redirect_uri=l,this.typeOfLogin=f,this.uxMode=c,this.redirectToOpener=h,this.jwtParams=p,this.customState=v,_defineProperty(this,"RESPONSE_TYPE","token"),_defineProperty(this,"SCOPE","public_profile email"),this.setFinalUrl()}setFinalUrl(){const a=new URL("https://www.facebook.com/v15.0/dialog/oauth"),u=JSON.parse(JSON.stringify(this.jwtParams||{})),l=deepmerge({state:this.state,response_type:this.RESPONSE_TYPE,client_id:this.clientId,redirect_uri:this.redirect_uri,scope:this.SCOPE},u);Object.keys(l).forEach(f=>{l[f]&&a.searchParams.append(f,l[f])}),this.finalURL=a}async getUserInfo(a){const{accessToken:u}=a,l=await get$2("https://graph.facebook.com/me?fields=name,email,picture.type(large)",{headers:{Authorization:`Bearer ${u}`}}),{name:f="",id:c,picture:h,email:p=""}=l;return{email:p,name:f,profileImage:h.data.url||"",verifier:this.verifier,verifierId:c,typeOfLogin:this.typeOfLogin}}}class GoogleHandler extends AbstractLoginHandler{constructor(a,u,l,f,c,h,p,v){super(a,u,l,f,c,h,p,v),this.clientId=a,this.verifier=u,this.redirect_uri=l,this.typeOfLogin=f,this.uxMode=c,this.redirectToOpener=h,this.jwtParams=p,this.customState=v,_defineProperty(this,"RESPONSE_TYPE","token id_token"),_defineProperty(this,"SCOPE","profile email openid"),_defineProperty(this,"PROMPT","consent select_account"),this.setFinalUrl()}setFinalUrl(){const a=new URL("https://accounts.google.com/o/oauth2/v2/auth"),u=JSON.parse(JSON.stringify(this.jwtParams||{})),l=deepmerge({state:this.state,response_type:this.RESPONSE_TYPE,client_id:this.clientId,prompt:this.PROMPT,redirect_uri:this.redirect_uri,scope:this.SCOPE,nonce:this.nonce},u);Object.keys(l).forEach(f=>{l[f]&&a.searchParams.append(f,l[f])}),this.finalURL=a}async getUserInfo(a){const{accessToken:u}=a,l=await get$2("https://www.googleapis.com/userinfo/v2/me",{headers:{Authorization:`Bearer ${u}`}}),{picture:f="",email:c="",name:h=""}=l;return{email:c,name:h,profileImage:f,verifier:this.verifier,verifierId:c.toLowerCase(),typeOfLogin:this.typeOfLogin}}}let JwtHandler$1=class extends AbstractLoginHandler{constructor(a,u,l,f,c,h,p,v){super(a,u,l,f,c,h,p,v),this.clientId=a,this.verifier=u,this.redirect_uri=l,this.typeOfLogin=f,this.uxMode=c,this.redirectToOpener=h,this.jwtParams=p,this.customState=v,_defineProperty(this,"SCOPE","openid profile email"),_defineProperty(this,"RESPONSE_TYPE","token id_token"),_defineProperty(this,"PROMPT","login"),this.setFinalUrl()}setFinalUrl(){const{domain:a}=this.jwtParams,u=validateAndConstructUrl(a);u.pathname+=u.pathname.endsWith("/")?"authorize":"/authorize";const l=JSON.parse(JSON.stringify(this.jwtParams));delete l.domain;const f=deepmerge({state:this.state,response_type:this.RESPONSE_TYPE,client_id:this.clientId,prompt:this.PROMPT,redirect_uri:this.redirect_uri,scope:this.SCOPE,connection:loginToConnectionMap[this.typeOfLogin],nonce:this.nonce},l);Object.keys(f).forEach(c=>{f[c]&&u.searchParams.append(c,f[c])}),this.finalURL=u}async getUserInfo(a){const{idToken:u,accessToken:l}=a,{domain:f,verifierIdField:c,isVerifierIdCaseSensitive:h,user_info_route:p="userinfo"}=this.jwtParams;if(l)try{const v=new URL(f),y=await get$2(`${padUrlString(v)}${p}`,{headers:{Authorization:`Bearer ${l}`}}),{picture:b,name:S,email:E}=y;return{email:E,name:S,profileImage:b,verifierId:getVerifierId(y,this.typeOfLogin,c,h),verifier:this.verifier,typeOfLogin:this.typeOfLogin}}catch(v){log$1$1.warn(v,"Unable to get userinfo from endpoint")}if(u){const v=o(u),{name:y,email:b,picture:S}=v;return{profileImage:S,name:y,email:b,verifierId:getVerifierId(v,this.typeOfLogin,c,h),verifier:this.verifier,typeOfLogin:this.typeOfLogin}}throw new Error("Access/id token not available")}};class MockLoginHandler extends AbstractLoginHandler{constructor(a,u,l,f,c,h,p,v){super(a,u,l,f,c,h,p,v),this.clientId=a,this.verifier=u,this.redirect_uri=l,this.typeOfLogin=f,this.uxMode=c,this.redirectToOpener=h,this.jwtParams=p,this.customState=v,this.setFinalUrl()}setFinalUrl(){const a=JSON.parse(JSON.stringify(this.jwtParams));delete a.domain;const u=deepmerge({state:this.state,client_id:this.clientId,nonce:this.nonce},a);this.finalURL=new URL(constructURL({baseURL:this.redirect_uri,query:null,hash:u}))}async getUserInfo(a){const{idToken:u,accessToken:l}=a,{domain:f,verifierIdField:c,isVerifierIdCaseSensitive:h,user_info_route:p="userinfo"}=this.jwtParams;if(l)try{const v=new URL(f),y=await get$2(`${padUrlString(v)}${p}`,{headers:{Authorization:`Bearer ${l}`}}),{picture:b,name:S,email:E}=y;return{email:E,name:S,profileImage:b,verifierId:getVerifierId(y,this.typeOfLogin,c,h),verifier:this.verifier,typeOfLogin:this.typeOfLogin}}catch(v){log$1$1.warn(v,"Unable to get userinfo from endpoint")}if(u){const v=o(u),{name:y,email:b,picture:S}=v;return{profileImage:S,name:y,email:b,verifierId:getVerifierId(v,this.typeOfLogin,c,h),verifier:this.verifier,typeOfLogin:this.typeOfLogin}}throw new Error("Access/id token not available")}handleLoginWindow(a){const{id_token:u,access_token:l}=this.jwtParams,f=new PopupHandler({url:this.finalURL,features:a.popupFeatures});if(this.uxMode===UX_MODE.REDIRECT)f.redirect(a.locationReplaceOnRedirect);else return Promise.resolve({state:{},idToken:u,accessToken:l});return null}}const _excluded$1=["access_token","id_token"];class JwtHandler extends AbstractLoginHandler{constructor(a,u,l,f,c,h,p,v){super(a,u,l,f,c,h,p,v),this.clientId=a,this.verifier=u,this.redirect_uri=l,this.typeOfLogin=f,this.uxMode=c,this.redirectToOpener=h,this.jwtParams=p,this.customState=v,_defineProperty(this,"SCOPE","openid profile email"),_defineProperty(this,"RESPONSE_TYPE","token id_token"),_defineProperty(this,"PROMPT","login"),this.setFinalUrl()}setFinalUrl(){const{domain:a}=this.jwtParams,u=validateAndConstructUrl(a);u.pathname="/passwordless/start",this.finalURL=u}async getUserInfo(a){const{idToken:u,accessToken:l}=a,{domain:f,verifierIdField:c,isVerifierIdCaseSensitive:h}=this.jwtParams;try{const p=new URL(f),v=await get$2(`${padUrlString(p)}userinfo`,{headers:{Authorization:`Bearer ${l}`}}),{picture:y,name:b,email:S}=v;return{email:S,name:b,profileImage:y,verifierId:getVerifierId(v,this.typeOfLogin,c,h),verifier:this.verifier,typeOfLogin:this.typeOfLogin}}catch(p){log$1.error(p);const v=o(u),{name:y,email:b,picture:S}=v;return{profileImage:S,name:y,email:b,verifierId:getVerifierId(v,this.typeOfLogin,c,h),verifier:this.verifier,typeOfLogin:this.typeOfLogin}}}handleLoginWindow(){return new Promise((a,u)=>{if(this.redirectToOpener){u(new Error("Cannot use redirect to opener for passwordless"));return}const l=c=>{try{const{error:h,data:p}=c,v=p||{},{instanceParams:y,hashParams:{access_token:b,id_token:S}}=v,E=_objectWithoutProperties(v.hashParams,_excluded$1);if(h){log$1.error(c.error),u(new Error(h));return}c.data&&y.verifier===this.verifier&&(log$1.info(c.data),a(_objectSpread2(_objectSpread2({accessToken:b,idToken:S||""},E),{},{state:y})))}catch(h){log$1.error(h),u(h)}},f=new BroadcastChannel$1(`redirect_channel_${this.nonce}`,broadcastChannelOptions);f.addEventListener("message",async c=>{l(c),f.close()});try{const{connection:c="email",login_hint:h}=this.jwtParams,p=deepmerge({client_id:this.clientId,connection:c,email:c==="email"?h:void 0,phone_number:c==="sms"?h:void 0,send:"link",authParams:{scope:this.SCOPE,state:this.state,response_type:this.RESPONSE_TYPE,redirect_uri:this.redirect_uri,nonce:this.nonce,prompt:this.PROMPT}},{authParams:this.jwtParams});post$1(this.finalURL.href,JSON.parse(JSON.stringify(p))).then(v=>{log$1.info("posted",v)}).catch(v=>{log$1.error(v),u(v)})}catch(c){log$1.error(c),u(c)}})}}class RedditHandler extends AbstractLoginHandler{constructor(a,u,l,f,c,h,p,v){super(a,u,l,f,c,h,p,v),this.clientId=a,this.verifier=u,this.redirect_uri=l,this.typeOfLogin=f,this.uxMode=c,this.redirectToOpener=h,this.jwtParams=p,this.customState=v,_defineProperty(this,"RESPONSE_TYPE","token"),_defineProperty(this,"SCOPE","identity"),this.setFinalUrl()}setFinalUrl(){const a=new URL(`https://www.reddit.com/api/v1/authorize${window.innerWidth<600?".compact":""}`),u=JSON.parse(JSON.stringify(this.jwtParams||{})),l=deepmerge({state:this.state,response_type:this.RESPONSE_TYPE,client_id:this.clientId,redirect_uri:this.redirect_uri,scope:this.SCOPE},u);Object.keys(l).forEach(f=>{l[f]&&a.searchParams.append(f,l[f])}),this.finalURL=a}async getUserInfo(a){const{accessToken:u}=a,l=await get$2("https://oauth.reddit.com/api/v1/me",{headers:{Authorization:`Bearer ${u}`}}),{icon_img:f="",name:c=""}=l;return{email:"",name:c,profileImage:f.split("?").length>0?f.split("?")[0]:f,verifier:this.verifier,verifierId:c.toLowerCase(),typeOfLogin:this.typeOfLogin}}}class TwitchHandler extends AbstractLoginHandler{constructor(a,u,l,f,c,h,p,v){super(a,u,l,f,c,h,p,v),this.clientId=a,this.verifier=u,this.redirect_uri=l,this.typeOfLogin=f,this.uxMode=c,this.redirectToOpener=h,this.jwtParams=p,this.customState=v,_defineProperty(this,"RESPONSE_TYPE","token"),_defineProperty(this,"SCOPE","user:read:email"),this.setFinalUrl()}setFinalUrl(){const a=new URL("https://id.twitch.tv/oauth2/authorize"),u=JSON.parse(JSON.stringify(this.jwtParams||{})),l=deepmerge({state:this.state,response_type:this.RESPONSE_TYPE,client_id:this.clientId,redirect_uri:this.redirect_uri,scope:this.SCOPE,force_verify:!0},u);Object.keys(l).forEach(f=>{l[f]&&a.searchParams.append(f,l[f])}),this.finalURL=a}async getUserInfo(a){const{accessToken:u}=a,l=await get$2("https://api.twitch.tv/helix/users",{headers:{Authorization:`Bearer ${u}`,"Client-ID":this.clientId}}),[{profile_image_url:f="",display_name:c="",email:h="",id:p}]=l.data||[];return{profileImage:f,name:c,email:h,verifierId:p,verifier:this.verifier,typeOfLogin:this.typeOfLogin}}}const WEBAUTHN_LOOKUP_SERVER="https://api.webauthn.openlogin.com";class WebAuthnHandler extends AbstractLoginHandler{constructor(a,u,l,f,c,h,p,v,y){super(a,u,l,f,c,h,p,v),this.clientId=a,this.verifier=u,this.redirect_uri=l,this.typeOfLogin=f,this.uxMode=c,this.redirectToOpener=h,this.jwtParams=p,this.customState=v,this.registerOnly=y,this.setFinalUrl()}setFinalUrl(){const{webauthnURL:a}=this.customState||{},u=a?new URL(a):new URL("https://webauthn.openlogin.com"),l=JSON.parse(JSON.stringify(this.jwtParams||{})),f=deepmerge({register_only:!!this.registerOnly,state:this.state,client_id:this.clientId,redirect_uri:this.redirect_uri},l);Object.keys(f).forEach(c=>{f[c]&&u.searchParams.append(c,f[c])}),this.finalURL=u}async getUserInfo(a){const{idToken:u,ref:l,extraParamsPassed:f,extraParams:c}=a;let h,p,v,y,b,S,E,R,O;if(f==="true"){log$1.debug("extraParamsPassed is true, using extraParams passed through hashParams");try{({verifier_id:h,signature:p,clientDataJSON:v,authenticatorData:y,publicKey:b,challenge:S,rpOrigin:E,credId:R,transports:O}=JSON.parse(base64url.decode(c)))}catch(I){log$1.warn("unable to parse extraParams",I),{verifier_id:h,signature:p,clientDataJSON:v,authenticatorData:y,publicKey:b,challenge:S,rpOrigin:E,credId:R,transports:O}=await get$2(`${WEBAUTHN_LOOKUP_SERVER}/signature/fetch/${u}`)}}else log$1.debug("extraParamsPassed is false, using extraParams passed through bridge server"),{verifier_id:h,signature:p,clientDataJSON:v,authenticatorData:y,publicKey:b,challenge:S,rpOrigin:E,credId:R,transports:O}=await get$2(`${WEBAUTHN_LOOKUP_SERVER}/signature/fetch/${u}`);if(p!==u)throw new Error("idtoken should be equal to signature");return{email:"",name:"WebAuthn Login",profileImage:"",verifier:this.verifier,verifierId:h,typeOfLogin:this.typeOfLogin,ref:l,registerOnly:this.registerOnly,extraVerifierParams:{signature:p,clientDataJSON:v,authenticatorData:y,publicKey:b,challenge:S,rpOrigin:E,credId:R,transports:O}}}}const createHandler=s=>{let{clientId:a,redirect_uri:u,typeOfLogin:l,verifier:f,jwtParams:c,redirectToOpener:h,uxMode:p,customState:v,registerOnly:y}=s;if(!f||!l||!a)throw new Error("Invalid params");const{domain:b,login_hint:S,id_token:E,access_token:R}=c||{};switch(l){case LOGIN.GOOGLE:return new GoogleHandler(a,f,u,l,p,h,c,v);case LOGIN.FACEBOOK:return new FacebookHandler(a,f,u,l,p,h,c,v);case LOGIN.TWITCH:return new TwitchHandler(a,f,u,l,p,h,c,v);case LOGIN.REDDIT:return new RedditHandler(a,f,u,l,p,h,c,v);case LOGIN.DISCORD:return new DiscordHandler(a,f,u,l,p,h,c,v);case LOGIN.PASSWORDLESS:if(!b||!S)throw new Error("Invalid params");return new JwtHandler(a,f,u,l,p,h,c,v);case LOGIN.APPLE:case LOGIN.GITHUB:case LOGIN.LINKEDIN:case LOGIN.TWITTER:case LOGIN.WEIBO:case LOGIN.LINE:case LOGIN.EMAIL_PASSWORD:case LOGIN.JWT:if(E||R)return new MockLoginHandler(a,f,u,l,p,h,c,v);if(!b)throw new Error("Invalid params");return new JwtHandler$1(a,f,u,l,p,h,c,v);case LOGIN.WEBAUTHN:return new WebAuthnHandler(a,f,u,l,p,h,c,v,y);default:throw new Error("Invalid login type")}},registerServiceWorker=s=>new Promise((a,u)=>{const l=`${s}sw.js`;"serviceWorker"in window.navigator?registerServiceWorkerExports.register(l,{ready(){log$1.info(`App is being served from cache by a service worker.
 For more details, visit https://goo.gl/AFskqB`),a(void 0)},registered(){log$1.info("Service worker has been registered."),a(void 0)},cached(){log$1.info("Content has been cached for offline use."),a(void 0)},updatefound(){log$1.info("New content is downloading.")},updated(){log$1.info("New content is available; please refresh.")},offline(){log$1.info("No internet connection found. App is running in offline mode."),u(new Error("App is offline"))},error(f){log$1.error("Error during service worker registration:",f),u(f)}}):u(new Error("Service workers are not supported"))});class SentryHandler{constructor(a){_defineProperty(this,"sentry",null),this.sentry=a}startTransaction(a){if(this.sentry)return this.sentry.startTransaction(a)}finishTransaction(a){a&&a.finish()}}class StorageHelper{constructor(a){_defineProperty(this,"currentStorageMethod",REDIRECT_PARAMS_STORAGE_METHOD.LOCAL_STORAGE),_defineProperty(this,"isInitialized",!1),_defineProperty(this,"storageServerUrl","https://broadcast-server.tor.us"),this.storageServerUrl=a}init(){const a=are3PCSupported(),u=storageAvailable(REDIRECT_PARAMS_STORAGE_METHOD.LOCAL_STORAGE);a&&u?this.currentStorageMethod=REDIRECT_PARAMS_STORAGE_METHOD.LOCAL_STORAGE:this.currentStorageMethod=REDIRECT_PARAMS_STORAGE_METHOD.SERVER,this.isInitialized=!0}async storeLoginDetails(a,u){if(!this.isInitialized)throw new Error("StorageHelper is not initialized");if(this.currentStorageMethod===REDIRECT_PARAMS_STORAGE_METHOD.SERVER){const l=keccak256(distExports.Buffer.from(u,"utf8")),f=l.toString("hex"),c=getPublic(l).toString("hex"),h=await encryptData(f,a),p=(await sign(l,keccak256(distExports.Buffer.from(h,"utf8")))).toString("hex");await post$1(`${this.storageServerUrl}/store/set`,{key:c,data:h,signature:p})}else window.localStorage.setItem(`torus_login_${u}`,JSON.stringify(a))}async retrieveLoginDetails(a){if(!this.isInitialized)throw new Error("StorageHelper is not initialized");if(this.currentStorageMethod===REDIRECT_PARAMS_STORAGE_METHOD.SERVER){const l=keccak256(distExports.Buffer.from(a,"utf8")),f=l.toString("hex"),c=getPublic(l).toString("hex");try{const h=await get$2(`${this.storageServerUrl}/store/get?key=${c}`);if(h.message)return await decryptData(f,h.message)}catch(h){if(h.status===404)log$1.warn(h,"Session likely expired");else throw h}}const u=window.localStorage.getItem(`torus_login_${a}`);return JSON.parse(u||"{}")}clearLoginDetailsStorage(a){if(!this.isInitialized)throw new Error("StorageHelper is not initialized");this.currentStorageMethod===REDIRECT_PARAMS_STORAGE_METHOD.LOCAL_STORAGE&&window.localStorage.removeItem(`torus_login_${a}`)}clearOrphanedLoginDetails(){if(!this.isInitialized)throw new Error("StorageHelper is not initialized");this.currentStorageMethod===REDIRECT_PARAMS_STORAGE_METHOD.LOCAL_STORAGE&&Object.keys(window.localStorage).forEach(u=>{u.startsWith("torus_login_")&&window.localStorage.removeItem(u)})}}const _excluded=["access_token","id_token"],_excluded2=["access_token","id_token"],_excluded3=["access_token","id_token"],_excluded4=["args","method"];class CustomAuth{constructor(a){let{baseUrl:u,network:l,enableLogging:f=!1,redirectToOpener:c=!1,redirectPathName:h="redirect",apiKey:p="torus-default",uxMode:v=UX_MODE.POPUP,locationReplaceOnRedirect:y=!1,popupFeatures:b,storageServerUrl:S="https://broadcast-server.tor.us",sentry:E,enableOneKey:R=!1,web3AuthClientId:O,metadataUrl:I="https://metadata.tor.us"}=a;if(_defineProperty(this,"isInitialized",void 0),_defineProperty(this,"config",void 0),_defineProperty(this,"torus",void 0),_defineProperty(this,"nodeDetailManager",void 0),_defineProperty(this,"storageHelper",void 0),_defineProperty(this,"sentryHandler",void 0),!O)throw new Error("Please provide a valid web3AuthClientId in constructor");if(!l)throw new Error("Please provide a valid network in constructor");this.isInitialized=!1;const B=new URL(u);this.config={baseUrl:padUrlString(B),get redirect_uri(){return`${this.baseUrl}${h}`},redirectToOpener:c,uxMode:v,locationReplaceOnRedirect:y,popupFeatures:b};const N=new Torus({network:l,clientId:O,enableOneKey:R,legacyMetadataHost:I});Torus.setAPIKey(p),this.torus=N,this.nodeDetailManager=new NodeDetailManager({network:l}),f?log$1.enableAll():log$1.disableAll(),this.storageHelper=new StorageHelper(S),this.sentryHandler=new SentryHandler(E)}async init(){let{skipSw:a=!1,skipInit:u=!1,skipPrefetch:l=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this.storageHelper.init(),u){this.isInitialized=!0;return}if(!a)if((await fetch(`${this.config.baseUrl}sw.js`,{cache:"reload"})).ok)try{await registerServiceWorker(this.config.baseUrl),this.isInitialized=!0;return}catch(c){log$1.warn(c)}else throw new Error("Service worker is not being served. Please serve it");if(!l){if(isFirefox()){this.isInitialized=!0;return}await this.handlePrefetchRedirectUri();return}this.isInitialized=!0}async triggerLogin(a){const{verifier:u,typeOfLogin:l,clientId:f,jwtParams:c,hash:h,queryParameters:p,customState:v,registerOnly:y}=a;if(log$1.info("Verifier: ",u),!this.isInitialized)throw new Error("Not initialized yet");if(y&&l!==LOGIN.WEBAUTHN)throw new Error("registerOnly flag can only be passed for webauthn");const b=createHandler({typeOfLogin:l,clientId:f,verifier:u,redirect_uri:this.config.redirect_uri,redirectToOpener:this.config.redirectToOpener,jwtParams:c,uxMode:this.config.uxMode,customState:v,registerOnly:y});let S;if(h&&p){const{error:O,hashParameters:I,instanceParameters:B}=handleRedirectParameters(h,p);if(O)throw new Error(O);const{access_token:N,id_token:D}=I,G=_objectWithoutProperties(I,_excluded);S=_objectSpread2(_objectSpread2({accessToken:N,idToken:D},G),{},{state:B})}else if(this.storageHelper.clearOrphanedLoginDetails(),this.config.uxMode===UX_MODE.REDIRECT&&await this.storageHelper.storeLoginDetails({method:TORUS_METHOD.TRIGGER_LOGIN,args:a},b.nonce),S=await b.handleLoginWindow({locationReplaceOnRedirect:this.config.locationReplaceOnRedirect,popupFeatures:this.config.popupFeatures}),this.config.uxMode===UX_MODE.REDIRECT)return null;const E=await b.getUserInfo(S);if(y){const O=this.sentryHandler.startTransaction({name:SENTRY_TXNS.FETCH_NODE_DETAILS}),I=await this.nodeDetailManager.getNodeDetails({verifier:u,verifierId:E.verifierId});this.sentryHandler.finishTransaction(O);const B=this.sentryHandler.startTransaction({name:SENTRY_TXNS.PUB_ADDRESS_LOOKUP}),N=await this.torus.getPublicAddress(I.torusNodeEndpoints,I.torusNodePub,{verifier:u,verifierId:E.verifierId});this.sentryHandler.finishTransaction(B);const D={userInfo:_objectSpread2(_objectSpread2({},E),S)};return _objectSpread2(_objectSpread2(_objectSpread2({},D),N),{},{finalKeyData:_objectSpread2(_objectSpread2({},N.finalKeyData),{},{privKey:void 0}),oAuthKeyData:_objectSpread2(_objectSpread2({},N.finalKeyData),{},{privKey:void 0}),metadata:_objectSpread2(_objectSpread2({},N.metadata),{},{nonce:void 0}),sessionData:void 0})}const R=await this.getTorusKey(u,E.verifierId,{verifier_id:E.verifierId},S.idToken||S.accessToken,E.extraVerifierParams);return _objectSpread2(_objectSpread2({},R),{},{userInfo:_objectSpread2(_objectSpread2({},E),S)})}async triggerAggregateLogin(a){const{aggregateVerifierType:u,verifierIdentifier:l,subVerifierDetailsArray:f}=a;if(!this.isInitialized)throw new Error("Not initialized yet");if(!u||!l||!Array.isArray(f))throw new Error("Invalid params");if(u===AGGREGATE_VERIFIER.SINGLE_VERIFIER_ID&&f.length!==1)throw new Error("Single id verifier can only have one sub verifier");const c=[],h=[];for(const I of f){const{clientId:B,typeOfLogin:N,verifier:D,jwtParams:G,hash:V,queryParameters:U,customState:te}=I,Z=createHandler({typeOfLogin:N,clientId:B,verifier:D,redirect_uri:this.config.redirect_uri,redirectToOpener:this.config.redirectToOpener,jwtParams:G,uxMode:this.config.uxMode,customState:te});let J;if(V&&U){const{error:Q,hashParameters:ee,instanceParameters:k}=handleRedirectParameters(V,U);if(Q)throw new Error(Q);const{access_token:d,id_token:g}=ee,_=_objectWithoutProperties(ee,_excluded2);J=_objectSpread2(_objectSpread2({accessToken:d,idToken:g},_),{},{state:k})}else if(this.storageHelper.clearOrphanedLoginDetails(),this.config.uxMode===UX_MODE.REDIRECT&&await this.storageHelper.storeLoginDetails({method:TORUS_METHOD.TRIGGER_AGGREGATE_LOGIN,args:a},Z.nonce),J=await Z.handleLoginWindow({locationReplaceOnRedirect:this.config.locationReplaceOnRedirect,popupFeatures:this.config.popupFeatures}),this.config.uxMode===UX_MODE.REDIRECT)return null;c.push(Z.getUserInfo(J)),h.push(J)}const v=(await Promise.all(c)).map(I=>_objectSpread2(_objectSpread2({},I),{},{aggregateVerifier:l})),y={verify_params:[],sub_verifier_ids:[],verifier_id:""},b=[];let S="",E={};for(let I=0;I<f.length;I+=1){const B=h[I],{idToken:N,accessToken:D}=B,G=v[I];y.verify_params.push({verifier_id:G.verifierId,idtoken:N||D}),y.sub_verifier_ids.push(G.verifier),b.push(N||D),S=G.verifierId,E=G.extraVerifierParams}b.sort();const R=keccak256$1(distExports.Buffer.from(b.join(""),"utf8")).slice(2);y.verifier_id=S;const O=await this.getTorusKey(l,S,y,R,E);return _objectSpread2(_objectSpread2({},O),{},{userInfo:v.map((I,B)=>_objectSpread2(_objectSpread2({},I),h[B]))})}async triggerHybridAggregateLogin(a){const{singleLogin:u,aggregateLoginParams:l}=a;if(!this.isInitialized)throw new Error("Not initialized yet");if(!l.aggregateVerifierType||!l.verifierIdentifier||!Array.isArray(l.subVerifierDetailsArray))throw new Error("Invalid params");if(l.aggregateVerifierType===AGGREGATE_VERIFIER.SINGLE_VERIFIER_ID&&l.subVerifierDetailsArray.length!==1)throw new Error("Single id verifier can only have one sub verifier");const{typeOfLogin:f,clientId:c,verifier:h,jwtParams:p,hash:v,queryParameters:y,customState:b}=u,S=createHandler({typeOfLogin:f,clientId:c,verifier:h,redirect_uri:this.config.redirect_uri,redirectToOpener:this.config.redirectToOpener,jwtParams:p,uxMode:this.config.uxMode,customState:b});let E;if(v&&y){const{error:J,hashParameters:Q,instanceParameters:ee}=handleRedirectParameters(v,y);if(J)throw new Error(J);const{access_token:k,id_token:d}=Q,g=_objectWithoutProperties(Q,_excluded3);E=_objectSpread2(_objectSpread2({accessToken:k,idToken:d},g),{},{state:ee})}else if(this.storageHelper.clearOrphanedLoginDetails(),this.config.uxMode===UX_MODE.REDIRECT&&await this.storageHelper.storeLoginDetails({method:TORUS_METHOD.TRIGGER_AGGREGATE_HYBRID_LOGIN,args:a},S.nonce),E=await S.handleLoginWindow({locationReplaceOnRedirect:this.config.locationReplaceOnRedirect,popupFeatures:this.config.popupFeatures}),this.config.uxMode===UX_MODE.REDIRECT)return null;const R=await S.getUserInfo(E),O=this.getTorusKey(h,R.verifierId,{verifier_id:R.verifierId},E.idToken||E.accessToken,R.extraVerifierParams),{verifierIdentifier:I,subVerifierDetailsArray:B}=l,N={verify_params:[],sub_verifier_ids:[],verifier_id:""},D=[];let G="";for(let J=0;J<B.length;J+=1){const Q=B[J],{idToken:ee,accessToken:k}=E;N.verify_params.push({verifier_id:R.verifierId,idtoken:ee||k}),N.sub_verifier_ids.push(Q.verifier),D.push(ee||k),G=R.verifierId}D.sort();const V=keccak256$1(distExports.Buffer.from(D.join(""),"utf8")).slice(2);N.verifier_id=G;const U=this.getTorusKey(I,G,N,V,R.extraVerifierParams),[te,Z]=await Promise.all([O,U]);return{singleLogin:_objectSpread2({userInfo:_objectSpread2(_objectSpread2({},R),E)},te),aggregateLogins:[Z]}}async getTorusKey(a,u,l,f,c){const h=this.sentryHandler.startTransaction({name:SENTRY_TXNS.FETCH_NODE_DETAILS}),p=await this.nodeDetailManager.getNodeDetails({verifier:a,verifierId:u});if(this.sentryHandler.finishTransaction(h),this.torus.isLegacyNetwork){const b=this.sentryHandler.startTransaction({name:SENTRY_TXNS.PUB_ADDRESS_LOOKUP}),S=await this.torus.getPublicAddress(p.torusNodeEndpoints,p.torusNodePub,{verifier:a,verifierId:u});this.sentryHandler.finishTransaction(b),log$1.debug("torus-direct/getTorusKey",{getPublicAddress:S})}log$1.debug("torus-direct/getTorusKey",{torusNodeEndpoints:p.torusNodeEndpoints});const v=this.sentryHandler.startTransaction({name:SENTRY_TXNS.FETCH_SHARES}),y=await this.torus.retrieveShares(p.torusNodeEndpoints,p.torusIndexes,a,l,f,_objectSpread2({},c));return this.sentryHandler.finishTransaction(v),log$1.debug("torus-direct/getTorusKey",{retrieveShares:y}),y}async getAggregateTorusKey(a,u,l){const f={verify_params:[],sub_verifier_ids:[],verifier_id:""},c=[];let h={};for(let v=0;v<l.length;v+=1){const y=l[v];f.verify_params.push({verifier_id:u,idtoken:y.idToken}),f.sub_verifier_ids.push(y.verifier),c.push(y.idToken),h=y.extraVerifierParams}c.sort();const p=keccak256$1(distExports.Buffer.from(c.join(""),"utf8")).slice(2);return f.verifier_id=u,this.getTorusKey(a,u,f,p,h)}async getRedirectResult(){let{replaceUrl:a=!0,clearLoginDetails:u=!0}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};await this.init({skipInit:!0});const l=new URL(window.location.href),f=l.hash.substring(1),c={};if(l.searchParams.forEach((I,B)=>{c[B]=I}),a){const I=window.location.origin+window.location.pathname;window.history.replaceState(_objectSpread2(_objectSpread2({},window.history.state),{},{as:I,url:I}),"",I)}if(!f&&Object.keys(c).length===0)throw new Error("Unable to fetch result from OAuth login");const{error:h,instanceParameters:p,hashParameters:v}=handleRedirectParameters(f,c),{instanceId:y}=p;log$1.info(y,"instanceId");const b=await this.storageHelper.retrieveLoginDetails(y),{args:S,method:E}=b,R=_objectWithoutProperties(b,_excluded4);if(log$1.info(S,E),u&&this.storageHelper.clearLoginDetailsStorage(y),h)return{error:h,state:p||{},method:E,result:{},hashParameters:v,args:S};let O;try{if(E===TORUS_METHOD.TRIGGER_LOGIN){const I=S;I.hash=f,I.queryParameters=c,O=await this.triggerLogin(I)}else if(E===TORUS_METHOD.TRIGGER_AGGREGATE_LOGIN){const I=S;I.subVerifierDetailsArray.forEach(B=>{B.hash=f,B.queryParameters=c}),O=await this.triggerAggregateLogin(I)}else if(E===TORUS_METHOD.TRIGGER_AGGREGATE_HYBRID_LOGIN){const I=S;I.singleLogin.hash=f,I.singleLogin.queryParameters=c,O=await this.triggerHybridAggregateLogin(I)}}catch(I){return log$1.error(I),_objectSpread2({error:`Could not get result from torus nodes 
 ${(I==null?void 0:I.message)||""}`,state:p||{},method:E,result:{},hashParameters:v,args:S},R)}return _objectSpread2(O?{method:E,result:O,state:p||{},hashParameters:v,args:S}:{error:"Unsupported method type",state:p||{},method:E,result:{},hashParameters:v,args:S},R)}async handlePrefetchRedirectUri(){return document?new Promise((a,u)=>{const l=document.createElement("link");l.href=this.config.redirect_uri,window.location.origin!==new URL(this.config.redirect_uri).origin&&(l.crossOrigin="anonymous"),l.type="text/html",l.rel="prefetch";const f=()=>{this.isInitialized=!0,a()};try{l.relList&&l.relList.supports&&l.relList.supports("prefetch")?(l.onload=f,l.onerror=()=>{u(new Error(`Please serve redirect.html present in serviceworker folder of this package on ${this.config.redirect_uri}`))},document.head.appendChild(l)):f()}catch{f()}}):Promise.resolve()}}var WEB3_AUTH_CLIENT_ID="BBQoFIabI50S1-0QsGHGTM4qID_FDjja0ZxIxKPyFqc0El--M-EG0c2giaBYVTVVE6RC9WCUzCJyW24aJrR_Lzc",Auth=class{async getTorusClient(){const s=new CustomAuth({web3AuthClientId:WEB3_AUTH_CLIENT_ID,baseUrl:"https://umamiwallet.com/auth/v2.2.0/",redirectPathName:"redirect.html",redirectToOpener:window.location.origin,uxMode:"popup",network:"mainnet"});return await s.init({skipSw:!0}),s}async getCredentials(){const s=await this.login(),a=s.finalKeyData.privKey||s.oAuthKeyData.privKey,u=b58cencode(a,prefix.spsk),l=Array.isArray(s.userInfo)?s.userInfo[0]:s.userInfo;return{secretKey:u,id:l.verifierId||l.name,name:l.name,email:l.email,imageUrl:l.profileImage}}},JWT_AUTH_DOMAIN="https://kukai.eu.auth0.com",EmailAuth=class extends Auth{constructor(){super(...arguments);ei(this,"clientId","LTg6fVsacafGmhv14TZlrWF1EavwQoDZ");ei(this,"idpName","email")}async login(){return(await this.getTorusClient()).triggerAggregateLogin({verifierIdentifier:"tezos-google",aggregateVerifierType:"single_id_verifier",subVerifierDetailsArray:[{verifier:"web-kukai-email",typeOfLogin:"jwt",clientId:this.clientId,jwtParams:{connection:"",verifierIdField:"name",domain:JWT_AUTH_DOMAIN}}]})}},FacebookAuth=class extends Auth{constructor(){super(...arguments);ei(this,"idpName","facebook");ei(this,"clientId","523634882377310")}async login(){return(await this.getTorusClient()).triggerLogin({verifier:"tezos-facebook",clientId:this.clientId,typeOfLogin:"facebook",jwtParams:{scope:"public_profile email"}})}},GoogleAuth=class extends Auth{constructor(){super(...arguments);ei(this,"idpName","google");ei(this,"clientId","1070572364808-d31nlkneam5ee6dr0tu28fjjbsdkfta5.apps.googleusercontent.com")}async login(){return(await this.getTorusClient()).triggerAggregateLogin({verifierIdentifier:"tezos-google",aggregateVerifierType:"single_id_verifier",subVerifierDetailsArray:[{clientId:this.clientId,typeOfLogin:"google",verifier:"umami"}]})}},RedditAuth=class extends Auth{constructor(){super(...arguments);ei(this,"idpName","reddit");ei(this,"clientId","zyQ9tnKfdg3VNyj6MGhZq4dHbBzbmEvl")}async login(){return(await this.getTorusClient()).triggerAggregateLogin({verifierIdentifier:"tezos-reddit",aggregateVerifierType:"single_id_verifier",subVerifierDetailsArray:[{verifier:"web-kukai",typeOfLogin:"jwt",clientId:this.clientId,jwtParams:{connection:"Reddit",verifierIdField:"name",domain:JWT_AUTH_DOMAIN}}]})}},TwitterAuth=class extends Auth{constructor(){super(...arguments);ei(this,"idpName","twitter");ei(this,"clientId","3aCoxh3pw8g8JeFsdlJNUGwdgtLwdwgE")}async login(){return(await this.getTorusClient()).triggerLogin({verifier:"tezos-twitter",clientId:this.clientId,typeOfLogin:"twitter",jwtParams:{domain:JWT_AUTH_DOMAIN}})}},forIDP=s=>{switch(s){case"google":return new GoogleAuth;case"email":return new EmailAuth;case"reddit":return new RedditAuth;case"facebook":return new FacebookAuth;case"twitter":return new TwitterAuth;case"apple":throw new Error("Apple Auth is not supported yet")}};const FacebookLogoIcon=s=>jsxRuntimeExports.jsx(Icon,{width:"22px",height:"22px",fill:"none",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg",...s,children:jsxRuntimeExports.jsx("path",{d:"M21.5 11.0642C21.5 5.22975 16.799 0.5 11 0.5C5.20101 0.5 0.5 5.22975 0.5 11.0642C0.5 16.3371 4.3397 20.7075 9.35938 21.5V14.1179H6.69336V11.0642H9.35938V8.73677C9.35938 6.08911 10.927 4.62664 13.3254 4.62664C14.4742 4.62664 15.6758 4.83297 15.6758 4.83297V7.43275H14.3517C13.0474 7.43275 12.6406 8.24707 12.6406 9.08253V11.0642H15.5527L15.0872 14.1179H12.6406V21.5C17.6603 20.7075 21.5 16.3371 21.5 11.0642Z",fill:"#1977F2",clipRule:"evenodd",fillRule:"evenodd"})}),GoogleLogoIcon=s=>jsxRuntimeExports.jsxs(Icon,{width:"18px",height:"18px",fill:"none",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...s,children:[jsxRuntimeExports.jsx("path",{d:"M17.6396 9.20437C17.6396 8.5662 17.5823 7.95257 17.476 7.36349H8.99976V10.8448H13.8433C13.6347 11.9698 13.0006 12.9229 12.0474 13.5611V15.8193H14.956C16.6578 14.2525 17.6396 11.9452 17.6396 9.20437Z",fill:"#4285F4",clipRule:"evenodd",fillRule:"evenodd"}),jsxRuntimeExports.jsx("path",{d:"M9.00061 18.0001C11.4306 18.0001 13.4678 17.1942 14.9569 15.8197L12.0483 13.5615C11.2424 14.1015 10.2115 14.4206 9.00061 14.4206C6.65655 14.4206 4.67249 12.8374 3.96478 10.7102H0.958008V13.042C2.43889 15.9833 5.48248 18.0001 9.00061 18.0001Z",fill:"#34A853",clipRule:"evenodd",fillRule:"evenodd"}),jsxRuntimeExports.jsx("path",{d:"M3.96403 10.71C3.78403 10.17 3.68176 9.59318 3.68176 9.00001C3.68176 8.40683 3.78403 7.83002 3.96403 7.29003V4.95825H0.957257C0.347722 6.17323 0 7.54776 0 9.00001C0 10.4523 0.347722 11.8268 0.957257 13.0418L3.96403 10.71Z",fill:"#FBBC05",clipRule:"evenodd",fillRule:"evenodd"}),jsxRuntimeExports.jsx("path",{d:"M9.00061 3.57949C10.3219 3.57949 11.5083 4.03357 12.441 4.92537L15.0223 2.34405C13.4637 0.891804 11.4265 0 9.00061 0C5.48248 0 2.43889 2.01679 0.958008 4.9581L3.96478 7.28988C4.67249 5.16264 6.65655 3.57949 9.00061 3.57949Z",fill:"#EA4335",clipRule:"evenodd",fillRule:"evenodd"})]}),RedditLogoIcon=s=>jsxRuntimeExports.jsxs(Icon,{width:"18px",height:"18px",fill:"none",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...s,children:[jsxRuntimeExports.jsx("path",{d:"M9 0C4.02961 0 0 4.02961 0 9C0 11.4855 1.00758 13.7355 2.63602 15.364L0.921797 17.0782C0.581484 17.4185 0.822656 18 1.30359 18H9C13.9704 18 18 13.9704 18 9C18 4.02961 13.9704 0 9 0Z",fill:"#FF4500"}),jsxRuntimeExports.jsx("path",{d:"M10.8311 4.24441C10.9871 4.90605 11.5813 5.39895 12.2907 5.39895C13.119 5.39895 13.7905 4.72746 13.7905 3.89918C13.7905 3.0709 13.119 2.39941 12.2907 2.39941C11.5665 2.39941 10.9625 2.9127 10.8219 3.59543C9.60902 3.72551 8.66191 4.75418 8.66191 6.00082C8.66191 6.00363 8.66191 6.00574 8.66191 6.00855C7.34285 6.0641 6.1384 6.43957 5.18215 7.0323C4.82707 6.75738 4.38129 6.59355 3.89754 6.59355C2.73668 6.59355 1.7959 7.53434 1.7959 8.6952C1.7959 9.53754 2.2909 10.2632 3.00598 10.5986C3.07559 13.0384 5.7341 15.0008 9.00434 15.0008C12.2746 15.0008 14.9366 13.0363 15.0027 10.5943C15.7121 10.2568 16.2029 9.53332 16.2029 8.6959C16.2029 7.53504 15.2621 6.59426 14.1013 6.59426C13.6196 6.59426 13.176 6.75668 12.8216 7.02949C11.8569 6.43254 10.6391 6.05707 9.30668 6.00715C9.30668 6.00504 9.30668 6.00363 9.30668 6.00152C9.30668 5.10855 9.97043 4.36746 10.8311 4.24582V4.24441ZM5.09777 10.029C5.13293 9.26684 5.63918 8.68184 6.2277 8.68184C6.81621 8.68184 7.26621 9.29988 7.23105 10.0621C7.1959 10.8243 6.75645 11.1013 6.16723 11.1013C5.57801 11.1013 5.06262 10.7912 5.09777 10.029ZM11.7817 8.68184C12.3709 8.68184 12.8771 9.26684 12.9116 10.029C12.9468 10.7912 12.4307 11.1013 11.8421 11.1013C11.2536 11.1013 10.8135 10.825 10.7783 10.0621C10.7432 9.29988 11.1925 8.68184 11.7817 8.68184ZM11.0814 11.7925C11.1918 11.8037 11.2621 11.9183 11.2192 12.021C10.8571 12.8865 10.0021 13.4947 9.00434 13.4947C8.0066 13.4947 7.1523 12.8865 6.78949 12.021C6.7466 11.9183 6.81691 11.8037 6.9273 11.7925C7.57418 11.7271 8.27379 11.6912 9.00434 11.6912C9.73488 11.6912 10.4338 11.7271 11.0814 11.7925Z",fill:"white"})]});function mode(s,a){return u=>u.colorMode==="dark"?a:s}const light={red:"#E53E3E",redDark:"#C53030",blue:"#0052FF",blueDark:"#003EE0",green:"#38A169",greenDark:"#25855A",grey:{black:"#10121B",white:"#FFFFFF",900:"#171923",800:"#1A202C",700:"#2D3748",600:"#4A5568",500:"#718096",450:"#E0E6EE",400:"#A0AEC0",300:"#CBD5E0",200:"#E2E8F0",100:"#EDF2F7",50:"#F7FAFC"}},dark={red:"#E53E3E",redDark:"#C53030",blue:"#0052FF",blueDark:"#003EE0",green:"#38A169",greenDark:"#25855A",grey:{black:"#FFFFFF",white:"#10121B",900:"#F7FAFC",800:"#EDF2F7",700:"#E2E8F0",600:"#CBD5E0",500:"#A0AEC0",450:"#E0E6EE",400:"#718096",300:"#4A5568",200:"#10121B",100:"#2D3748",50:"#171923"}},useColor=()=>{const s=useColorMode();return reactExports.useCallback((a,u)=>{const l=light.grey[a]||light[a]||a,f=u?dark.grey[u]||dark[u]||u:dark.grey[a]||dark[a]||a;return mode(l,f)(s)},[s])},TezosLogoIcon=s=>{const a=useColor();return jsxRuntimeExports.jsx(Icon,{width:"87px",height:"30px",fill:"none",viewBox:"0 0 87 30",xmlns:"http://www.w3.org/2000/svg",...s,children:jsxRuntimeExports.jsx("path",{d:"M43.1417 6.75202H37.8085V21.159H36.4989V6.75202H31.1793V5.6469H43.1417V6.75202ZM48.0698 21.3881C47.0841 21.3881 46.193 21.1456 45.4099 20.6604C44.6269 20.1752 43.9923 19.5013 43.5602 18.6388C43.1147 17.7763 42.8987 16.8059 42.8987 15.7412V15.283C42.8987 14.1779 43.1147 13.1806 43.5467 12.2911C43.9788 11.4016 44.5728 10.7008 45.3424 10.2022C46.112 9.7035 46.9491 9.43396 47.8402 9.43396C49.2444 9.43396 50.3515 9.90566 51.1751 10.8625C51.9987 11.8194 52.4038 13.1267 52.4038 14.7844V15.4987H44.1543V15.7412C44.1543 17.0485 44.5323 18.1402 45.2749 19.0027C46.031 19.8787 46.9761 20.31 48.1103 20.31C48.7988 20.31 49.3929 20.1887 49.9195 19.9326C50.446 19.69 50.9186 19.2857 51.3507 18.7332L52.1472 19.3396C51.2291 20.7008 49.8655 21.3881 48.0698 21.3881ZM47.8402 10.5121C46.8816 10.5121 46.0715 10.8625 45.4099 11.5633C44.7484 12.2642 44.3568 13.2075 44.2083 14.3935H51.1346V14.2588C51.0941 13.1536 50.7836 12.2507 50.1895 11.5499C49.5954 10.8491 48.8123 10.5121 47.8402 10.5121ZM56.1842 20.0943H63.6911V21.1725H54.6045V20.2291L61.6119 10.7412H54.8206V9.63612H63.2186V10.593L56.1842 20.0943ZM65.5273 15.2291C65.5273 14.124 65.7433 13.1267 66.1754 12.2372C66.6074 11.3477 67.215 10.6604 67.9981 10.1617C68.7812 9.66307 69.6723 9.42049 70.6714 9.42049C72.2106 9.42049 73.4528 9.95957 74.4114 11.0377C75.37 12.1159 75.8425 13.5445 75.8425 15.3235V15.593C75.8425 16.7116 75.6265 17.7089 75.1945 18.5984C74.7624 19.4879 74.1548 20.1752 73.3717 20.6604C72.5887 21.1456 71.6976 21.3881 70.6984 21.3881C69.1728 21.3881 67.9171 20.8491 66.9585 19.7709C65.9999 18.6927 65.5273 17.2642 65.5273 15.4852V15.2291ZM66.81 15.5795C66.81 16.9542 67.1745 18.0863 67.8766 18.9757C68.5922 19.8652 69.5238 20.2965 70.6849 20.2965C71.8326 20.2965 72.7777 19.8518 73.4933 18.9757C74.2088 18.0863 74.5599 16.9272 74.5599 15.4717V15.2291C74.5599 14.3531 74.3979 13.5445 74.0738 12.8032C73.7498 12.0755 73.2907 11.5094 72.6967 11.1051C72.1026 10.7008 71.4275 10.4987 70.6714 10.4987C69.5373 10.4987 68.6057 10.9434 67.8766 11.8329C67.161 12.7224 66.7965 13.8949 66.7965 15.3369L66.81 15.5795ZM85.4017 18.2345C85.4017 17.6011 85.1451 17.0889 84.6321 16.7116C84.119 16.3342 83.3629 16.0243 82.3233 15.8086C81.2837 15.593 80.5006 15.3369 79.9335 15.0674C79.3665 14.7844 78.9479 14.4474 78.6779 14.0431C78.4078 13.6388 78.2593 13.1536 78.2593 12.5741C78.2593 11.6577 78.6374 10.9164 79.407 10.3235C80.1631 9.73046 81.1487 9.43396 82.3368 9.43396C83.6195 9.43396 84.6591 9.75741 85.4422 10.3908C86.2253 11.0243 86.6168 11.8598 86.6168 12.8841H85.3342C85.3342 12.2102 85.0506 11.6442 84.4836 11.1995C83.9165 10.7547 83.2009 10.5256 82.3368 10.5256C81.4997 10.5256 80.8246 10.7143 80.3116 11.0782C79.7985 11.4555 79.542 11.9407 79.542 12.5337C79.542 13.1132 79.758 13.558 80.1766 13.8679C80.5951 14.1779 81.3782 14.4744 82.4988 14.7439C83.6195 15.0135 84.4566 15.283 85.0236 15.5795C85.5772 15.876 85.9957 16.2399 86.2658 16.6577C86.5358 17.0755 86.6708 17.5876 86.6708 18.1806C86.6708 19.1509 86.2793 19.9326 85.4962 20.5121C84.7131 21.0916 83.687 21.3881 82.4178 21.3881C81.0677 21.3881 79.974 21.0647 79.1504 20.4178C78.3133 19.7709 77.8948 18.9488 77.8948 17.9515H79.1774C79.2314 18.6927 79.542 19.2722 80.1225 19.69C80.7031 20.1078 81.4727 20.31 82.4313 20.31C83.3224 20.31 84.038 20.1078 84.5916 19.7305C85.1316 19.3261 85.4017 18.8275 85.4017 18.2345ZM21.7417 22.035C21.4311 16.5499 14.5183 14.0566 13.8567 13.8005C13.8297 13.7871 13.8297 13.7601 13.8432 13.7332L20.9721 6.5903V5.8221C20.9721 5.70081 20.864 5.59299 20.7425 5.59299H7.60548V0L2.75841 1.01078V1.73854H3.02844C3.02844 1.73854 4.21658 1.73854 4.21658 2.92453V5.57951H0.463141C0.395633 5.57951 0.328125 5.6469 0.328125 5.71429V7.39892H4.23009V16.5499C4.23009 19.4205 6.07981 21.4151 9.32019 21.1456C10.0088 21.0916 10.6433 20.8221 11.1834 20.4717C11.4264 20.31 11.575 20.0539 11.575 19.7574V18.8544C10.5218 19.5553 9.63072 19.5148 9.63072 19.5148C7.57848 19.5148 7.61899 16.9137 7.61899 16.9137V7.39892H17.0701L10.2653 14.2453C10.2518 15.1482 10.2383 15.8491 10.2383 15.8625C10.2383 15.8895 10.2518 15.903 10.2788 15.903C16.5165 16.9542 18.2042 20.9838 18.2042 22.1563C18.2042 22.1563 18.8793 27.8571 13.1681 28.248C13.1681 28.248 9.4282 28.4097 8.76662 26.9137C8.73962 26.8598 8.76662 26.8059 8.82063 26.779C9.4417 26.496 9.86025 25.9434 9.86025 25.2022C9.86025 24.097 9.18517 23.1941 7.7675 23.1941C6.61987 23.1941 5.67476 24.097 5.67476 25.2022C5.67476 25.2022 5.13469 30 13.1546 29.8652C22.3087 29.7035 21.7417 22.035 21.7417 22.035Z",fill:a("500")})})},TwitterLogoIcon=s=>jsxRuntimeExports.jsx(Icon,{width:"15px",height:"14px",fill:"none",viewBox:"0 0 15 14",xmlns:"http://www.w3.org/2000/svg",...s,children:jsxRuntimeExports.jsx("path",{d:"M0.535098 0.25L6.104 7.69602L0.5 13.75H1.76134L6.66774 8.44953L10.6318 13.75H14.9239L9.04155 5.88523L14.2578 0.25H12.9964L8.47805 5.13148L4.82717 0.25H0.535098ZM2.38995 1.179H4.36171L13.0688 12.821H11.0971L2.38995 1.179Z",fill:"#121212"})}),UmamiLogoIcon=s=>jsxRuntimeExports.jsxs(Icon,{width:"30px",height:"30px",fill:"none",viewBox:"0 0 30 30",xmlns:"http://www.w3.org/2000/svg",...s,children:[jsxRuntimeExports.jsx("rect",{width:"30.0001",height:"30",fill:"white",rx:"8",x:"-6.10352e-05"}),jsxRuntimeExports.jsx("path",{d:"M27.6311 20.7436C27.3638 21.2076 27.0351 21.64 26.6464 22.0289C25.4861 23.189 23.9436 23.8279 22.303 23.8279H19.6172V27.6314H21.1611H22.303C23.7263 27.6314 25.0643 27.0771 26.0707 26.0708C27.077 25.0644 27.6312 23.7263 27.6311 22.3032V20.7436Z",fill:"black"}),jsxRuntimeExports.jsx("path",{d:"M27.6313 16.5348C27.364 16.9988 27.0353 17.4312 26.6465 17.82C25.4863 18.9802 23.9438 19.6191 22.3032 19.6191H14.9993C14.0615 19.6193 13.3015 20.3795 13.3015 21.3173C13.3015 22.2551 14.0615 23.0153 14.9993 23.0155H22.3033C23.7264 23.0155 25.0644 22.4614 26.0708 21.455C27.0769 20.4489 27.6311 19.1112 27.6313 17.6885V16.5348ZM14.9997 21.9759C14.636 21.9759 14.3411 21.681 14.3411 21.3172C14.3411 20.9535 14.636 20.6586 14.9997 20.6586C15.3635 20.6586 15.6584 20.9535 15.6584 21.3172C15.6584 21.681 15.3635 21.9759 14.9997 21.9759Z",fill:"black"}),jsxRuntimeExports.jsx("path",{d:"M27.6316 7.69653C27.6316 4.75855 25.2414 2.36841 22.3033 2.36841H7.69663C4.75863 2.36841 2.36841 4.75855 2.36841 7.69653V22.3035C2.36841 25.2415 4.75863 27.6316 7.69656 27.6316H18.8034V23.8282H14.9996C13.612 23.8282 12.4872 22.7034 12.4872 21.3159C12.4872 19.9284 13.612 18.8036 14.9996 18.8036H18.8034V14.9999H7.69656C5.20348 14.9999 3.18246 12.9791 3.18246 10.4861V7.69661C3.18246 5.20362 5.20348 3.1826 7.69656 3.1826H22.3033C24.7963 3.1826 26.8173 5.20362 26.8173 7.69661V10.4861C26.8173 12.9792 24.7965 15.0001 22.3034 15.0001L19.6177 14.9999V18.8036H22.3035C23.7267 18.8036 25.0647 18.2493 26.071 17.243C27.0771 16.2369 27.6313 14.8993 27.6316 13.4766V7.69653Z",fill:"black"}),jsxRuntimeExports.jsx("path",{d:"M22.3034 3.18297C24.7965 3.18297 26.8175 5.20396 26.8175 7.69701V10.4864C26.8175 12.9795 24.7966 15.0004 22.3035 15.0004L7.69669 15.0003C5.20366 15.0003 3.18262 12.9795 3.18262 10.4865V7.69702C3.18262 5.20396 5.20363 3.18297 7.69669 3.18297H22.3034Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M22.3029 5.31522C23.3765 5.31522 24.2868 6.02869 24.5832 7.00673C24.6252 7.14562 24.5147 7.28331 24.3697 7.27743C22.331 7.1948 20.4286 6.57545 18.801 5.55627C18.6903 5.48691 18.7408 5.31522 18.8714 5.31522H22.3029Z",fill:"#F74F18"}),jsxRuntimeExports.jsx("path",{d:"M17.3662 5.54591C19.2854 7.03266 21.6572 7.96114 24.2368 8.08634C24.4872 8.09849 24.6851 8.30252 24.6851 8.55324V10.1606C24.6847 10.1939 24.6837 10.2983 24.6819 10.4097C24.6791 10.5906 24.5281 10.7328 24.3473 10.727C20.0457 10.5881 16.2011 8.61047 13.5739 5.55696C13.4924 5.46215 13.5591 5.31522 13.6842 5.31522H16.6928C16.9367 5.31522 17.1734 5.39655 17.3662 5.54591Z",fill:"#F74F18"}),jsxRuntimeExports.jsx("path",{d:"M12.6043 5.66289C15.3672 9.11005 19.5539 11.3694 24.2646 11.5386C24.3456 11.5415 24.3952 11.6296 24.3539 11.6993C23.9385 12.3991 23.1747 12.8693 22.3031 12.8693H18.2571C18.1041 12.8693 17.9522 12.8404 17.8109 12.7815C14.2776 11.3086 11.3012 8.75728 9.29578 5.541C9.23449 5.44272 9.30631 5.31522 9.42213 5.31522H11.8819C12.1632 5.31522 12.4285 5.44348 12.6043 5.66289Z",fill:"#F74F18"}),jsxRuntimeExports.jsx("path",{d:"M7.69753 5.31522H7.98484C8.12657 5.31522 8.25671 5.39118 8.32835 5.51347C10.0861 8.51398 12.6377 10.9954 15.6938 12.6662C15.7923 12.7201 15.7541 12.8693 15.6419 12.8693H11.9361C11.4985 12.8693 11.0729 12.7173 10.74 12.4334C8.79703 10.7768 7.14823 8.78416 5.88421 6.54655C5.80221 6.40137 5.82302 6.21889 5.93525 6.09558C6.3716 5.61613 6.99964 5.31522 7.69753 5.31522Z",fill:"#F74F18"}),jsxRuntimeExports.jsx("path",{d:"M9.71679 12.6181C9.81483 12.7067 9.75181 12.8694 9.61965 12.8694H7.66992C6.36815 12.8549 5.31421 11.7918 5.31421 10.4871V7.69768L5.31435 7.53612C5.31445 7.44036 5.44054 7.40496 5.48993 7.487C6.64135 9.39951 8.06866 11.1284 9.71679 12.6181Z",fill:"#F74F18"})]}),getErrorContext$1=s=>{let a="Something went wrong";typeof s=="object"&&"message"in s?a=s.message:typeof s=="string"&&(a=s);let u="";return typeof s=="object"&&"stack"in s&&(u=s.stack),{timestamp:new Date().toISOString(),description:a,stacktrace:u}},withTimeout=(s,a,u)=>Promise.race([s(),new Promise((l,f)=>setTimeout(()=>{f(new Error("The operation has timed out"))},a))]),LoginButtonComponent=({onClick:s,loginType:a,prefix:u})=>jsxRuntimeExports.jsxs(Button,{position:"relative",width:"100%",onClick:s,size:"lg",borderRadius:"36px",padding:"0px",children:[jsxRuntimeExports.jsx(Box,{position:"absolute",left:"0px",top:"50%",transform:"translateY(-50%)",children:jsxRuntimeExports.jsx(LogoIconWithBackground,{loginType:a})}),jsxRuntimeExports.jsx(Heading,{textAlign:"center",flex:"1",fontSize:"14px",lineHeight:"18px",children:u?`${u} ${socialLabel(a)}`:socialLabel(a)})]}),LogoIconWithBackground=({loginType:s})=>jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"center",width:"36px",height:"36px",borderRadius:"50%",backgroundColor:"white",margin:"6px",shadow:"0px 0px 12px 1px rgba(45, 55, 72, 0.08)",children:jsxRuntimeExports.jsx(LogoIcon,{loginType:s})}),LogoIcon=({loginType:s})=>{switch(s){case"facebook":return jsxRuntimeExports.jsx(FacebookLogoIcon,{});case"google":return jsxRuntimeExports.jsx(GoogleLogoIcon,{});case"twitter":return jsxRuntimeExports.jsx(TwitterLogoIcon,{});case"reddit":return jsxRuntimeExports.jsx(RedditLogoIcon,{})}},socialLabel=s=>{switch(s){case"facebook":return"Facebook";case"google":return"Google";case"twitter":return"X";case"reddit":return"Reddit"}};function __awaiter$6(s,a,u,l){function f(c){return c instanceof u?c:new u(function(h){h(c)})}return new(u||(u=Promise))(function(c,h){function p(b){try{y(l.next(b))}catch(S){h(S)}}function v(b){try{y(l.throw(b))}catch(S){h(S)}}function y(b){b.done?c(b.value):f(b.value).then(p,v)}y((l=l.apply(s,a||[])).next())})}typeof SuppressedError=="function"&&SuppressedError;class HttpRequestFailed extends NetworkError$1{constructor(a,u,l){super(),this.method=a,this.url=u,this.cause=l,this.name="HttpRequestFailed",this.message=`${a} ${u} ${String(l)}`}}class HttpResponseError extends NetworkError$1{constructor(a,u,l,f,c){super(),this.message=a,this.status=u,this.statusText=l,this.body=f,this.url=c,this.name="HttpResponseError"}}class HttpTimeoutError extends NetworkError$1{constructor(a,u){super(),this.timeout=a,this.url=u,this.name="HttpTimeoutError",this.message=`HTTP request timeout of ${a}ms exceeded`}}var STATUS_CODE;(function(s){s[s.CONTINUE=100]="CONTINUE",s[s.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",s[s.PROCESSING=102]="PROCESSING",s[s.OK=200]="OK",s[s.CREATED=201]="CREATED",s[s.ACCEPTED=202]="ACCEPTED",s[s.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",s[s.NO_CONTENT=204]="NO_CONTENT",s[s.RESET_CONTENT=205]="RESET_CONTENT",s[s.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",s[s.MULTI_STATUS=207]="MULTI_STATUS",s[s.ALREADY_REPORTED=208]="ALREADY_REPORTED",s[s.IM_USED=226]="IM_USED",s[s.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",s[s.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",s[s.FOUND=302]="FOUND",s[s.SEE_OTHER=303]="SEE_OTHER",s[s.NOT_MODIFIED=304]="NOT_MODIFIED",s[s.USE_PROXY=305]="USE_PROXY",s[s.SWITCH_PROXY=306]="SWITCH_PROXY",s[s.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",s[s.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",s[s.BAD_REQUEST=400]="BAD_REQUEST",s[s.UNAUTHORIZED=401]="UNAUTHORIZED",s[s.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",s[s.FORBIDDEN=403]="FORBIDDEN",s[s.NOT_FOUND=404]="NOT_FOUND",s[s.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",s[s.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",s[s.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",s[s.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",s[s.CONFLICT=409]="CONFLICT",s[s.GONE=410]="GONE",s[s.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",s[s.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",s[s.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",s[s.URI_TOO_LONG=414]="URI_TOO_LONG",s[s.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",s[s.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",s[s.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",s[s.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",s[s.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",s[s.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",s[s.LOCKED=423]="LOCKED",s[s.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",s[s.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",s[s.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",s[s.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",s[s.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",s[s.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",s[s.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",s[s.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",s[s.BAD_GATEWAY=502]="BAD_GATEWAY",s[s.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",s[s.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",s[s.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",s[s.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",s[s.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",s[s.LOOP_DETECTED=508]="LOOP_DETECTED",s[s.NOT_EXTENDED=510]="NOT_EXTENDED",s[s.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"})(STATUS_CODE||(STATUS_CODE={}));var _a$3;let fetch$1=globalThis==null?void 0:globalThis.fetch;const isNode=typeof distExports.process<"u"&&!!(!((_a$3=distExports.process===null||distExports.process===void 0?void 0:distExports.process.versions)===null||_a$3===void 0)&&_a$3.node);isNode&&(fetch$1=require("node-fetch"));class HttpBackend{constructor(a=3e4){this.timeout=a}serialize(a){if(!a)return"";const u=[];for(const f in a)if(a.hasOwnProperty(f)&&typeof a[f]<"u"){const c=typeof a[f].toJSON=="function"?a[f].toJSON():a[f];if(c===null){u.push(encodeURIComponent(f));continue}if(Array.isArray(c)){c.forEach(h=>{u.push(encodeURIComponent(f)+"="+encodeURIComponent(h))});continue}u.push(encodeURIComponent(f)+"="+encodeURIComponent(c))}const l=u.join("&");return l?`?${l}`:""}createRequest(a,u){return __awaiter$6(this,arguments,void 0,function*({url:l,method:f,timeout:c=this.timeout,query:h,headers:p={},json:v=!0},y){const b=l+this.serialize(h);p["Content-Type"]||(p["Content-Type"]="application/json");const S=new AbortController,E=setTimeout(()=>S.abort(),c);try{const R=yield fetch$1(b,{keepalive:!1,method:f,headers:p,body:JSON.stringify(y),signal:S.signal});if(typeof R>"u")throw new Error("Response is undefined");if(R.status>=400){const O=yield R.text();throw new HttpResponseError(`Http error response: (${R.status}) ${O}`,R.status,R.statusText,O,b)}return v?R.json():R.text()}catch(R){throw R instanceof Error&&R.name==="AbortError"?new HttpTimeoutError(c,b):R instanceof HttpResponseError?R:new HttpRequestFailed(String(f),b,R)}finally{clearTimeout(E)}})}}function __rest$2(s,a){var u={};for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&a.indexOf(l)<0&&(u[l]=s[l]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,l=Object.getOwnPropertySymbols(s);f<l.length;f++)a.indexOf(l[f])<0&&Object.prototype.propertyIsEnumerable.call(s,l[f])&&(u[l[f]]=s[l[f]]);return u}function __awaiter$5(s,a,u,l){function f(c){return c instanceof u?c:new u(function(h){h(c)})}return new(u||(u=Promise))(function(c,h){function p(b){try{y(l.next(b))}catch(S){h(S)}}function v(b){try{y(l.throw(b))}catch(S){h(S)}}function y(b){b.done?c(b.value):f(b.value).then(p,v)}y((l=l.apply(s,a||[])).next())})}typeof SuppressedError=="function"&&SuppressedError;const defaultChain="main",defaultRPCOptions={block:"head"};var RPCMethodName;(function(s){s.GET_BAKING_RIGHTS="getBakingRights",s.GET_BALLOTS="getBallots",s.GET_BALLOT_LIST="getBallotList",s.GET_BIG_MAP_KEY="getBigMapKey",s.GET_BIG_MAP_EXPR="getBigMapExpr",s.GET_BLOCK_HASH="getBlockHash",s.GET_BLOCK="getBlock",s.GET_BLOCK_HEADER="getBlockHeader",s.GET_BLOCK_METADATA="getBlockMetadata",s.GET_BALANCE="getBalance",s.GET_SPENDABLE="getSpendable",s.GET_BALANCE_AND_FROZEN_BONDS="getBalanceAndFrozenBonds",s.GET_SPENDABLE_AND_FROZEN_BONDS="getSpendableAndFrozenBonds",s.GET_FULL_BALANCE="getFullBalance",s.GET_STAKED_BALANCE="getStakedBalance",s.GET_UNSTAKED_FINALIZABLE_BALANCE="getUnstakedFinalizableBalance",s.GET_UNSTAKED_FROZEN_BALANCE="getUnstakedFrozenBalance",s.GET_UNSTAKE_REQUESTS="getUnstakeRequests",s.GET_CHAIN_ID="getChainId",s.GET_CONSTANTS="getConstants",s.GET_CONTRACT="getContract",s.GET_CURRENT_PERIOD="getCurrentPeriod",s.GET_CURRENT_PROPOSAL="getCurrentProposal",s.GET_CURRENT_QUORUM="getCurrentQuorum",s.GET_DELEGATE="getDelegate",s.GET_ALL_DELEGATES="getAllDelegates",s.GET_DELEGATES="getDelegates",s.GET_VOTING_INFO="getVotingInfo",s.GET_ATTESTATION_RIGHTS="getAttestationRights",s.GET_ENTRYPOINTS="getEntrypoints",s.GET_LIVE_BLOCKS="getLiveBlocks",s.GET_MANAGER_KEY="getManagerKey",s.GET_NORMALIZED_SCRIPT="getNormalizedScript",s.GET_PROPOSALS="getProposals",s.GET_PROTOCOLS="getProtocols",s.GET_SAPLING_DIFF_BY_CONTRACT="getSaplingDiffByContract",s.GET_SAPLING_DIFF_BY_ID="getSaplingDiffById",s.GET_SCRIPT="getScript",s.GET_STORAGE="getStorage",s.GET_SUCCESSOR_PERIOD="getSuccessorPeriod",s.GET_VOTES_LISTINGS="getVotesListings",s.PACK_DATA="packData",s.GET_STORAGE_USED_SPACE="getStorageUsedSpace",s.GET_STORAGE_PAID_SPACE="getStoragePaidSpace",s.GET_TICKET_BALANCE="getTicketBalance",s.GET_ALL_TICKET_BALANCES="getAllTicketBalances",s.GET_ADAPTIVE_ISSUANCE_LAUNCH_CYCLE="getAdaptiveIssuanceLaunchCycle",s.GET_PENDING_OPERATIONS="getPendingOperations"})(RPCMethodName||(RPCMethodName={}));function castToBigNumber(s,a){const u=Array.isArray(s);typeof a>"u"&&(a=Object.keys(s));const l=u?[]:{};return a.forEach(f=>{const c=s[f];let h;if(!(typeof c>"u")){if(Array.isArray(c)){h=castToBigNumber(c),l[f]=h;return}h=new BigNumber(c),l[f]=h}}),l}var OPERATION_METADATA;(function(s){s.TOO_LARGE="too large"})(OPERATION_METADATA||(OPERATION_METADATA={}));var METADATA_BALANCE_UPDATES_CATEGORY;(function(s){s.BAKING_BONUSES="baking bonuses",s.BAKING_REWARDS="baking rewards",s.BLOCK_FEES="block fees",s.BONDS="bonds",s.BOOTSTRAP="bootstrap",s.BURNED="burned",s.COMMITMENT="commitment",s.DELEGATE_DENOMINATOR="delegate_denominator",s.DELEGATOR_NUMERATOR="delegator_numerator",s.DEPOSITS="deposits",s.ENDORSING_REWARDS="endorsing rewards",s.INVOICE="invoice",s.LOST_ENDORSING_REWARDS="lost endorsing rewards",s.LOST_ATTESTING_REWARDS="lost attesting rewards",s.MINTED="minted",s.NONCE_REVELATION_REWARDS="nonce revelation rewards",s.PUNISHMENTS="punishments",s.SMART_ROLLUP_REFUTATION_PUNISHMENTS="smart_rollup_refutation_punishments",s.SMART_ROLLUP_REFUTATION_REWARDS="smart_rollup_refutation_rewards",s.STORAGE_FEES="storage fees",s.SUBSIDY="subsidy",s.UNSTAKED_DEPOSITS="unstaked_deposits",s.DOUBLE_SIGNING_EVIDENCE_REWARDS="double signing evidence rewards",s.FEES="fees",s.LEGACY_DEPOSITS="legacy_deposits",s.LEGACY_FEES="legacy_fees",s.LEGACY_REWARDS="legacy_rewards",s.REWARDS="rewards"})(METADATA_BALANCE_UPDATES_CATEGORY||(METADATA_BALANCE_UPDATES_CATEGORY={}));var PvmKind;(function(s){s.WASM2="wasm_2_0_0",s.ARITH="arith",s.RISCV="riscv"})(PvmKind||(PvmKind={}));var SmartRollupRefutationOptions;(function(s){s.START="start",s.MOVE="move"})(SmartRollupRefutationOptions||(SmartRollupRefutationOptions={}));var SmartRollupInputProofKind;(function(s){s.INBOX_PROOF="inbox_proof",s.REVEAL_PROOF="reveal_proof",s.FIRST_INPUT="first_input"})(SmartRollupInputProofKind||(SmartRollupInputProofKind={}));var SmartRollupRefuteRevealProofKind;(function(s){s.RAW_DATA_PROOF="raw_data_proof",s.METADATA_PROOF="metadata_proof",s.DAL_PAGE_PROOF="dal_page_proof",s.DAL_PARAMETERS_PROOF="dal_parameters_proof"})(SmartRollupRefuteRevealProofKind||(SmartRollupRefuteRevealProofKind={}));var SmartRollupRefuteGameStatusOptions;(function(s){s.ONGOING="ongoing",s.ENDED="ended"})(SmartRollupRefuteGameStatusOptions||(SmartRollupRefuteGameStatusOptions={}));var SmartRollupRefuteGameEndedPlayerOutcomes;(function(s){s.LOSER="loser",s.DRAW="draw"})(SmartRollupRefuteGameEndedPlayerOutcomes||(SmartRollupRefuteGameEndedPlayerOutcomes={}));var SmartRollupRefuteGameEndedReason;(function(s){s.CONFLICT_RESOLVED="conflict_resolved",s.TIMEOUT="timeout"})(SmartRollupRefuteGameEndedReason||(SmartRollupRefuteGameEndedReason={}));var OpKind;(function(s){s.ORIGINATION="origination",s.DELEGATION="delegation",s.REVEAL="reveal",s.TRANSACTION="transaction",s.ACTIVATION="activate_account",s.ATTESTATION="attestation",s.ENDORSEMENT="endorsement",s.PREATTESTATION="preattestation",s.PREENDORSEMENT="preendorsement",s.SET_DEPOSITS_LIMIT="set_deposits_limit",s.DOUBLE_PREATTESTATION_EVIDENCE="double_preattestation_evidence",s.DOUBLE_PREENDORSEMENT_EVIDENCE="double_preendorsement_evidence",s.ATTESTATION_WITH_DAL="attestation_with_dal",s.ENDORSEMENT_WITH_DAL="endorsement_with_dal",s.SEED_NONCE_REVELATION="seed_nonce_revelation",s.DOUBLE_ATTESTATION_EVIDENCE="double_attestation_evidence",s.DOUBLE_ENDORSEMENT_EVIDENCE="double_endorsement_evidence",s.DOUBLE_BAKING_EVIDENCE="double_baking_evidence",s.PROPOSALS="proposals",s.BALLOT="ballot",s.FAILING_NOOP="failing_noop",s.REGISTER_GLOBAL_CONSTANT="register_global_constant",s.TRANSFER_TICKET="transfer_ticket",s.INCREASE_PAID_STORAGE="increase_paid_storage",s.UPDATE_CONSENSUS_KEY="update_consensus_key",s.DRAIN_DELEGATE="drain_delegate",s.VDF_REVELATION="vdf_revelation",s.EVENT="event",s.TICKET_UPDATES="ticket_updates",s.SMART_ROLLUP_ORIGINATE="smart_rollup_originate",s.SMART_ROLLUP_ADD_MESSAGES="smart_rollup_add_messages",s.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE="smart_rollup_execute_outbox_message",s.SMART_ROLLUP_PUBLISH="smart_rollup_publish",s.SMART_ROLLUP_CEMENT="smart_rollup_cement",s.SMART_ROLLUP_RECOVER_BOND="smart_rollup_recover_bond",s.SMART_ROLLUP_REFUTE="smart_rollup_refute",s.SMART_ROLLUP_TIMEOUT="smart_rollup_timeout",s.DAL_PUBLISH_COMMITMENT="dal_publish_commitment"})(OpKind||(OpKind={}));class RpcClient{constructor(a,u=defaultChain,l=new HttpBackend){this.url=a,this.chain=u,this.httpBackend=l}createURL(a){let u=this.url;for(;u.endsWith("/");)u=u.slice(0,-1);return`${u}${a}`}validateAddress(a){const u=validateAddress(a);if(u!==ValidationResult.VALID)throw new InvalidAddressError(a,invalidDetail(u))}validateContract(a){const u=validateContractAddress(a);if(u!==ValidationResult.VALID)throw new InvalidContractAddressError(a,invalidDetail(u))}getBlockHash(){return __awaiter$5(this,arguments,void 0,function*({block:a}=defaultRPCOptions){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${a}/hash`),method:"GET"})})}getLiveBlocks(){return __awaiter$5(this,arguments,void 0,function*({block:a}=defaultRPCOptions){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${a}/live_blocks`),method:"GET"})})}getBalance(a){return __awaiter$5(this,arguments,void 0,function*(u,{block:l}=defaultRPCOptions){this.validateAddress(u);const f=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${l}/context/contracts/${u}/balance`),method:"GET"});return new BigNumber(f)})}getSpendable(a){return __awaiter$5(this,arguments,void 0,function*(u,{block:l}=defaultRPCOptions){this.validateAddress(u);const f=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${l}/context/contracts/${u}/spendable`),method:"GET"});return new BigNumber(f)})}getBalanceAndFrozenBonds(a){return __awaiter$5(this,arguments,void 0,function*(u,{block:l}=defaultRPCOptions){this.validateAddress(u);const f=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${l}/context/contracts/${u}/balance_and_frozen_bonds`),method:"GET"});return new BigNumber(f)})}getSpendableAndFrozenBonds(a){return __awaiter$5(this,arguments,void 0,function*(u,{block:l}=defaultRPCOptions){this.validateAddress(u);const f=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${l}/context/contracts/${u}/spendable_and_frozen_bonds`),method:"GET"});return new BigNumber(f)})}getFullBalance(a){return __awaiter$5(this,arguments,void 0,function*(u,{block:l}=defaultRPCOptions){this.validateAddress(u);const f=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${l}/context/contracts/${u}/full_balance`),method:"GET"});return new BigNumber(f)})}getStakedBalance(a){return __awaiter$5(this,arguments,void 0,function*(u,{block:l}=defaultRPCOptions){this.validateAddress(u);const f=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${l}/context/contracts/${u}/staked_balance`),method:"GET"});return new BigNumber(f)})}getUnstakedFinalizableBalance(a){return __awaiter$5(this,arguments,void 0,function*(u,{block:l}=defaultRPCOptions){this.validateAddress(u);const f=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${l}/context/contracts/${u}/unstaked_finalizable_balance`),method:"GET"});return new BigNumber(f)})}getUnstakedFrozenBalance(a){return __awaiter$5(this,arguments,void 0,function*(u,{block:l}=defaultRPCOptions){this.validateAddress(u);const f=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${l}/context/contracts/${u}/unstaked_frozen_balance`),method:"GET"});return new BigNumber(f)})}getUnstakeRequests(a){return __awaiter$5(this,arguments,void 0,function*(u,{block:l}=defaultRPCOptions){this.validateAddress(u);const f=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${l}/context/contracts/${u}/unstake_requests`),method:"GET"});return f===null?null:{finalizable:f.finalizable.map(c=>{var{amount:h}=c,p=__rest$2(c,["amount"]);const v=castToBigNumber({amount:h},["amount"]);return Object.assign(Object.assign({},p),{amount:v.amount})}),unfinalizable:{delegate:f.unfinalizable.delegate,requests:f.unfinalizable.requests.map(({amount:c,cycle:h})=>{const p=castToBigNumber({amount:c},["amount"]);return{cycle:h,amount:p.amount}})}}})}getStorage(a){return __awaiter$5(this,arguments,void 0,function*(u,{block:l}=defaultRPCOptions){return this.validateContract(u),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${l}/context/contracts/${u}/storage`),method:"GET"})})}getScript(a){return __awaiter$5(this,arguments,void 0,function*(u,{block:l}=defaultRPCOptions){return this.validateContract(u),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${l}/context/contracts/${u}/script`),method:"GET"})})}getNormalizedScript(a){return __awaiter$5(this,arguments,void 0,function*(u,l={unparsing_mode:"Readable"},{block:f}=defaultRPCOptions){return this.validateContract(u),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${f}/context/contracts/${u}/script/normalized`),method:"POST"},l)})}getContract(a){return __awaiter$5(this,arguments,void 0,function*(u,{block:l}=defaultRPCOptions){this.validateAddress(u);const f=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${l}/context/contracts/${u}`),method:"GET"});return Object.assign(Object.assign({},f),{balance:new BigNumber(f.balance)})})}getManagerKey(a){return __awaiter$5(this,arguments,void 0,function*(u,{block:l}=defaultRPCOptions){return this.validateAddress(u),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${l}/context/contracts/${u}/manager_key`),method:"GET"})})}getDelegate(a){return __awaiter$5(this,arguments,void 0,function*(u,{block:l}=defaultRPCOptions){this.validateAddress(u);let f;try{f=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${l}/context/contracts/${u}/delegate`),method:"GET"})}catch(c){if(c instanceof HttpResponseError&&c.status===STATUS_CODE.NOT_FOUND)f=null;else throw c}return f})}getBigMapKey(a,u){return __awaiter$5(this,arguments,void 0,function*(l,f,{block:c}=defaultRPCOptions){return this.validateAddress(l),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${c}/context/contracts/${l}/big_map_get`),method:"POST"},f)})}getBigMapExpr(a,u){return __awaiter$5(this,arguments,void 0,function*(l,f,{block:c}=defaultRPCOptions){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${c}/context/big_maps/${l}/${f}`),method:"GET"})})}getAllDelegates(){return __awaiter$5(this,arguments,void 0,function*(a={},{block:u}=defaultRPCOptions){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${u}/context/delegates`),method:"GET",query:a})})}getDelegates(a){return __awaiter$5(this,arguments,void 0,function*(u,{block:l}=defaultRPCOptions){this.validateAddress(u);const f=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${l}/context/delegates/${u}`),method:"GET"}),c=castToBigNumber(f,["balance","full_balance","current_frozen_deposits","frozen_deposits","frozen_balance","frozen_deposits_limit","staking_balance","delegated_balance","voting_power","total_delegated_stake","staking_denominator"]);return Object.assign(Object.assign(Object.assign({},f),c),{frozen_balance_by_cycle:f.frozen_balance_by_cycle?f.frozen_balance_by_cycle.map(h=>{var{deposit:p,deposits:v,fees:y,rewards:b}=h,S=__rest$2(h,["deposit","deposits","fees","rewards"]);const E=castToBigNumber({deposit:p,deposits:v,fees:y,rewards:b},["deposit","deposits","fees","rewards"]);return Object.assign(Object.assign({},S),{deposit:E.deposit,deposits:E.deposits,fees:E.fees,rewards:E.rewards})}):void 0})})}getVotingInfo(a){return __awaiter$5(this,arguments,void 0,function*(u,{block:l}=defaultRPCOptions){return this.validateAddress(u),yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${l}/context/delegates/${u}/voting_info`),method:"GET"})})}getConstants(){return __awaiter$5(this,arguments,void 0,function*({block:a}=defaultRPCOptions){const u=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${a}/context/constants`),method:"GET"}),l=castToBigNumber(u,["time_between_blocks","hard_gas_limit_per_operation","hard_gas_limit_per_block","proof_of_work_threshold","tokens_per_roll","seed_nonce_revelation_tip","block_security_deposit","endorsement_security_deposit","block_reward","endorsement_reward","cost_per_byte","hard_storage_limit_per_operation","test_chain_duration","baking_reward_per_endorsement","delay_per_missing_endorsement","minimal_block_delay","liquidity_baking_subsidy","cache_layout","baking_reward_fixed_portion","baking_reward_bonus_per_slot","endorsing_reward_per_slot","double_baking_punishment","delay_increment_per_round","tx_rollup_commitment_bond","vdf_difficulty","sc_rollup_stake_amount","minimal_stake"]);return Object.assign(Object.assign({},u),l)})}getBlock(){return __awaiter$5(this,arguments,void 0,function*({block:a,version:u}=defaultRPCOptions){const l={url:this.createURL(`/chains/${this.chain}/blocks/${a}`),method:"GET"};return u!==void 0&&(l.query={version:u}),yield this.httpBackend.createRequest(l)})}getBlockHeader(){return __awaiter$5(this,arguments,void 0,function*({block:a}=defaultRPCOptions){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${a}/header`),method:"GET"})})}getBlockMetadata(){return __awaiter$5(this,arguments,void 0,function*({block:a,version:u}=defaultRPCOptions){const l={url:this.createURL(`/chains/${this.chain}/blocks/${a}/metadata`),method:"GET"};return u!==void 0&&(l.query={version:u}),yield this.httpBackend.createRequest(l)})}getBakingRights(){return __awaiter$5(this,arguments,void 0,function*(a={},{block:u}=defaultRPCOptions){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${u}/helpers/baking_rights`),method:"GET",query:a})})}getAttestationRights(){return __awaiter$5(this,arguments,void 0,function*(a={},{block:u}=defaultRPCOptions){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${u}/helpers/attestation_rights`),method:"GET",query:a})})}getBallotList(){return __awaiter$5(this,arguments,void 0,function*({block:a}=defaultRPCOptions){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${a}/votes/ballot_list`),method:"GET"})})}getBallots(){return __awaiter$5(this,arguments,void 0,function*({block:a}=defaultRPCOptions){const u=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${a}/votes/ballots`),method:"GET"});return castToBigNumber(u,["yay","nay","pass"])})}getCurrentProposal(){return __awaiter$5(this,arguments,void 0,function*({block:a}=defaultRPCOptions){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${a}/votes/current_proposal`),method:"GET"})})}getCurrentQuorum(){return __awaiter$5(this,arguments,void 0,function*({block:a}=defaultRPCOptions){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${a}/votes/current_quorum`),method:"GET"})})}getVotesListings(){return __awaiter$5(this,arguments,void 0,function*({block:a}=defaultRPCOptions){const u=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${a}/votes/listings`),method:"GET"});return u.map(l=>(l.voting_power&&(l.voting_power=new BigNumber(l.voting_power)),l)),u})}getProposals(){return __awaiter$5(this,arguments,void 0,function*({block:a}=defaultRPCOptions){const u=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${a}/votes/proposals`),method:"GET"});return u.map(l=>l[1]=new BigNumber(l[1])),u})}forgeOperations(a){return __awaiter$5(this,arguments,void 0,function*(u,{block:l}=defaultRPCOptions){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${l}/helpers/forge/operations`),method:"POST"},u)})}injectOperation(a){return __awaiter$5(this,void 0,void 0,function*(){return this.httpBackend.createRequest({url:this.createURL("/injection/operation"),method:"POST"},a)})}preapplyOperations(a){return __awaiter$5(this,arguments,void 0,function*(u,{block:l,version:f}=defaultRPCOptions){const c={url:this.createURL(`/chains/${this.chain}/blocks/${l}/helpers/preapply/operations`),method:"POST"};return f!==void 0&&(c.query={version:f}),yield this.httpBackend.createRequest(c,u)})}getEntrypoints(a){return __awaiter$5(this,arguments,void 0,function*(u,{block:l}=defaultRPCOptions){return this.validateContract(u),yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${l}/context/contracts/${u}/entrypoints`),method:"GET"})})}runOperation(a){return __awaiter$5(this,arguments,void 0,function*(u,{block:l,version:f}=defaultRPCOptions){const c={url:this.createURL(`/chains/${this.chain}/blocks/${l}/helpers/scripts/run_operation`),method:"POST"};return f!==void 0&&(c.query={version:f}),yield this.httpBackend.createRequest(c,u)})}simulateOperation(a){return __awaiter$5(this,arguments,void 0,function*(u,{block:l,version:f}=defaultRPCOptions){const c={url:this.createURL(`/chains/${this.chain}/blocks/${l}/helpers/scripts/simulate_operation`),method:"POST"};return f!==void 0&&(c.query={version:f}),yield this.httpBackend.createRequest(c,u)})}runCode(a){return __awaiter$5(this,arguments,void 0,function*(u,{block:l}=defaultRPCOptions){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${l}/helpers/scripts/run_code`),method:"POST"},u)})}runScriptView(a,u){return __awaiter$5(this,void 0,void 0,function*(){var{unparsing_mode:l="Readable"}=a,f=__rest$2(a,["unparsing_mode"]),c=u===void 0?defaultRPCOptions:u,h=c.block;return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${h}/helpers/scripts/run_script_view`),method:"POST"},Object.assign({unparsing_mode:l},f))})}runView(a,u){return __awaiter$5(this,void 0,void 0,function*(){var{unparsing_mode:l="Readable"}=a,f=__rest$2(a,["unparsing_mode"]),c=u===void 0?defaultRPCOptions:u,h=c.block;return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${h}/helpers/scripts/run_view`),method:"POST"},Object.assign({unparsing_mode:l},f))})}getChainId(){return __awaiter$5(this,void 0,void 0,function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/chain_id`),method:"GET"})})}packData(a){return __awaiter$5(this,arguments,void 0,function*(u,{block:l}=defaultRPCOptions){const f=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${l}/helpers/scripts/pack_data`),method:"POST"},u),{gas:c}=f,h=__rest$2(f,["gas"]);let p=c;const v=new BigNumber(c||"");return v.isNaN()||(p=v),Object.assign({gas:p},h)})}getRpcUrl(){return this.url}getCurrentPeriod(){return __awaiter$5(this,arguments,void 0,function*({block:a}=defaultRPCOptions){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${a}/votes/current_period`),method:"GET"})})}getSuccessorPeriod(){return __awaiter$5(this,arguments,void 0,function*({block:a}=defaultRPCOptions){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${a}/votes/successor_period`),method:"GET"})})}getSaplingDiffById(a){return __awaiter$5(this,arguments,void 0,function*(u,{block:l}=defaultRPCOptions){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${l}/context/sapling/${u}/get_diff`),method:"GET"})})}getSaplingDiffByContract(a){return __awaiter$5(this,arguments,void 0,function*(u,{block:l}=defaultRPCOptions){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${l}/context/contracts/${u}/single_sapling_get_diff`),method:"GET"})})}getProtocols(){return __awaiter$5(this,arguments,void 0,function*({block:a}=defaultRPCOptions){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${a}/protocols`),method:"GET"})})}getStorageUsedSpace(a){return __awaiter$5(this,arguments,void 0,function*(u,{block:l}=defaultRPCOptions){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${l}/context/contracts/${u}/storage/used_space`),method:"GET"})})}getStoragePaidSpace(a){return __awaiter$5(this,arguments,void 0,function*(u,{block:l}=defaultRPCOptions){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${l}/context/contracts/${u}/storage/paid_space`),method:"GET"})})}getTicketBalance(a,u){return __awaiter$5(this,arguments,void 0,function*(l,f,{block:c}=defaultRPCOptions){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${c}/context/contracts/${l}/ticket_balance`),method:"POST"},f)})}getAllTicketBalances(a){return __awaiter$5(this,arguments,void 0,function*(u,{block:l}=defaultRPCOptions){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${l}/context/contracts/${u}/all_ticket_balances`),method:"GET"})})}getAdaptiveIssuanceLaunchCycle(){return __awaiter$5(this,arguments,void 0,function*({block:a}=defaultRPCOptions){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${a}/context/adaptive_issuance_launch_cycle`),method:"GET"})})}getPendingOperations(){return __awaiter$5(this,arguments,void 0,function*(a={}){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/mempool/pending_operations`),method:"GET",query:a})})}}function isFunction$1(s){return typeof s=="function"}function createErrorClass(s){var a=function(l){Error.call(l),l.stack=new Error().stack},u=s(a);return u.prototype=Object.create(Error.prototype),u.prototype.constructor=u,u}var UnsubscriptionError=createErrorClass(function(s){return function(u){s(this),this.message=u?u.length+` errors occurred during unsubscription:
`+u.map(function(l,f){return f+1+") "+l.toString()}).join(`
  `):"",this.name="UnsubscriptionError",this.errors=u}});function arrRemove(s,a){if(s){var u=s.indexOf(a);0<=u&&s.splice(u,1)}}var Subscription=function(){function s(a){this.initialTeardown=a,this.closed=!1,this._parentage=null,this._finalizers=null}return s.prototype.unsubscribe=function(){var a,u,l,f,c;if(!this.closed){this.closed=!0;var h=this._parentage;if(h)if(this._parentage=null,Array.isArray(h))try{for(var p=__values(h),v=p.next();!v.done;v=p.next()){var y=v.value;y.remove(this)}}catch(I){a={error:I}}finally{try{v&&!v.done&&(u=p.return)&&u.call(p)}finally{if(a)throw a.error}}else h.remove(this);var b=this.initialTeardown;if(isFunction$1(b))try{b()}catch(I){c=I instanceof UnsubscriptionError?I.errors:[I]}var S=this._finalizers;if(S){this._finalizers=null;try{for(var E=__values(S),R=E.next();!R.done;R=E.next()){var O=R.value;try{execFinalizer(O)}catch(I){c=c??[],I instanceof UnsubscriptionError?c=__spreadArray(__spreadArray([],__read(c)),__read(I.errors)):c.push(I)}}}catch(I){l={error:I}}finally{try{R&&!R.done&&(f=E.return)&&f.call(E)}finally{if(l)throw l.error}}}if(c)throw new UnsubscriptionError(c)}},s.prototype.add=function(a){var u;if(a&&a!==this)if(this.closed)execFinalizer(a);else{if(a instanceof s){if(a.closed||a._hasParent(this))return;a._addParent(this)}(this._finalizers=(u=this._finalizers)!==null&&u!==void 0?u:[]).push(a)}},s.prototype._hasParent=function(a){var u=this._parentage;return u===a||Array.isArray(u)&&u.includes(a)},s.prototype._addParent=function(a){var u=this._parentage;this._parentage=Array.isArray(u)?(u.push(a),u):u?[u,a]:a},s.prototype._removeParent=function(a){var u=this._parentage;u===a?this._parentage=null:Array.isArray(u)&&arrRemove(u,a)},s.prototype.remove=function(a){var u=this._finalizers;u&&arrRemove(u,a),a instanceof s&&a._removeParent(this)},s.EMPTY=function(){var a=new s;return a.closed=!0,a}(),s}(),EMPTY_SUBSCRIPTION=Subscription.EMPTY;function isSubscription(s){return s instanceof Subscription||s&&"closed"in s&&isFunction$1(s.remove)&&isFunction$1(s.add)&&isFunction$1(s.unsubscribe)}function execFinalizer(s){isFunction$1(s)?s():s.unsubscribe()}var config$1={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},timeoutProvider={setTimeout:function(s,a){for(var u=[],l=2;l<arguments.length;l++)u[l-2]=arguments[l];return setTimeout.apply(void 0,__spreadArray([s,a],__read(u)))},clearTimeout:function(s){var a=timeoutProvider.delegate;return((a==null?void 0:a.clearTimeout)||clearTimeout)(s)},delegate:void 0};function reportUnhandledError(s){timeoutProvider.setTimeout(function(){throw s})}function noop(){}function errorContext(s){s()}var Subscriber=function(s){__extends$1(a,s);function a(u){var l=s.call(this)||this;return l.isStopped=!1,u?(l.destination=u,isSubscription(u)&&u.add(l)):l.destination=EMPTY_OBSERVER,l}return a.create=function(u,l,f){return new SafeSubscriber(u,l,f)},a.prototype.next=function(u){this.isStopped||this._next(u)},a.prototype.error=function(u){this.isStopped||(this.isStopped=!0,this._error(u))},a.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},a.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,s.prototype.unsubscribe.call(this),this.destination=null)},a.prototype._next=function(u){this.destination.next(u)},a.prototype._error=function(u){try{this.destination.error(u)}finally{this.unsubscribe()}},a.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},a}(Subscription),_bind=Function.prototype.bind;function bind(s,a){return _bind.call(s,a)}var ConsumerObserver=function(){function s(a){this.partialObserver=a}return s.prototype.next=function(a){var u=this.partialObserver;if(u.next)try{u.next(a)}catch(l){handleUnhandledError(l)}},s.prototype.error=function(a){var u=this.partialObserver;if(u.error)try{u.error(a)}catch(l){handleUnhandledError(l)}else handleUnhandledError(a)},s.prototype.complete=function(){var a=this.partialObserver;if(a.complete)try{a.complete()}catch(u){handleUnhandledError(u)}},s}(),SafeSubscriber=function(s){__extends$1(a,s);function a(u,l,f){var c=s.call(this)||this,h;if(isFunction$1(u)||!u)h={next:u??void 0,error:l??void 0,complete:f??void 0};else{var p;c&&config$1.useDeprecatedNextContext?(p=Object.create(u),p.unsubscribe=function(){return c.unsubscribe()},h={next:u.next&&bind(u.next,p),error:u.error&&bind(u.error,p),complete:u.complete&&bind(u.complete,p)}):h=u}return c.destination=new ConsumerObserver(h),c}return a}(Subscriber);function handleUnhandledError(s){reportUnhandledError(s)}function defaultErrorHandler(s){throw s}var EMPTY_OBSERVER={closed:!0,next:noop,error:defaultErrorHandler,complete:noop},observable=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function identity(s){return s}function pipeFromArray(s){return s.length===0?identity:s.length===1?s[0]:function(u){return s.reduce(function(l,f){return f(l)},u)}}var Observable=function(){function s(a){a&&(this._subscribe=a)}return s.prototype.lift=function(a){var u=new s;return u.source=this,u.operator=a,u},s.prototype.subscribe=function(a,u,l){var f=this,c=isSubscriber(a)?a:new SafeSubscriber(a,u,l);return errorContext(function(){var h=f,p=h.operator,v=h.source;c.add(p?p.call(c,v):v?f._subscribe(c):f._trySubscribe(c))}),c},s.prototype._trySubscribe=function(a){try{return this._subscribe(a)}catch(u){a.error(u)}},s.prototype.forEach=function(a,u){var l=this;return u=getPromiseCtor(u),new u(function(f,c){var h=new SafeSubscriber({next:function(p){try{a(p)}catch(v){c(v),h.unsubscribe()}},error:c,complete:f});l.subscribe(h)})},s.prototype._subscribe=function(a){var u;return(u=this.source)===null||u===void 0?void 0:u.subscribe(a)},s.prototype[observable]=function(){return this},s.prototype.pipe=function(){for(var a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];return pipeFromArray(a)(this)},s.prototype.toPromise=function(a){var u=this;return a=getPromiseCtor(a),new a(function(l,f){var c;u.subscribe(function(h){return c=h},function(h){return f(h)},function(){return l(c)})})},s.create=function(a){return new s(a)},s}();function getPromiseCtor(s){var a;return(a=s??config$1.Promise)!==null&&a!==void 0?a:Promise}function isObserver(s){return s&&isFunction$1(s.next)&&isFunction$1(s.error)&&isFunction$1(s.complete)}function isSubscriber(s){return s&&s instanceof Subscriber||isObserver(s)&&isSubscription(s)}function hasLift(s){return isFunction$1(s==null?void 0:s.lift)}function operate(s){return function(a){if(hasLift(a))return a.lift(function(u){try{return s(u,this)}catch(l){this.error(l)}});throw new TypeError("Unable to lift unknown Observable type")}}function createOperatorSubscriber(s,a,u,l,f){return new OperatorSubscriber(s,a,u,l,f)}var OperatorSubscriber=function(s){__extends$1(a,s);function a(u,l,f,c,h,p){var v=s.call(this,u)||this;return v.onFinalize=h,v.shouldUnsubscribe=p,v._next=l?function(y){try{l(y)}catch(b){u.error(b)}}:s.prototype._next,v._error=c?function(y){try{c(y)}catch(b){u.error(b)}finally{this.unsubscribe()}}:s.prototype._error,v._complete=f?function(){try{f()}catch(y){u.error(y)}finally{this.unsubscribe()}}:s.prototype._complete,v}return a.prototype.unsubscribe=function(){var u;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var l=this.closed;s.prototype.unsubscribe.call(this),!l&&((u=this.onFinalize)===null||u===void 0||u.call(this))}},a}(Subscriber);function refCount(){return operate(function(s,a){var u=null;s._refCount++;var l=createOperatorSubscriber(a,void 0,void 0,void 0,function(){if(!s||s._refCount<=0||0<--s._refCount){u=null;return}var f=s._connection,c=u;u=null,f&&(!c||f===c)&&f.unsubscribe(),a.unsubscribe()});s.subscribe(l),l.closed||(u=s.connect())})}var ConnectableObservable=function(s){__extends$1(a,s);function a(u,l){var f=s.call(this)||this;return f.source=u,f.subjectFactory=l,f._subject=null,f._refCount=0,f._connection=null,hasLift(u)&&(f.lift=u.lift),f}return a.prototype._subscribe=function(u){return this.getSubject().subscribe(u)},a.prototype.getSubject=function(){var u=this._subject;return(!u||u.isStopped)&&(this._subject=this.subjectFactory()),this._subject},a.prototype._teardown=function(){this._refCount=0;var u=this._connection;this._subject=this._connection=null,u==null||u.unsubscribe()},a.prototype.connect=function(){var u=this,l=this._connection;if(!l){l=this._connection=new Subscription;var f=this.getSubject();l.add(this.source.subscribe(createOperatorSubscriber(f,void 0,function(){u._teardown(),f.complete()},function(c){u._teardown(),f.error(c)},function(){return u._teardown()}))),l.closed&&(this._connection=null,l=Subscription.EMPTY)}return l},a.prototype.refCount=function(){return refCount()(this)},a}(Observable),ObjectUnsubscribedError=createErrorClass(function(s){return function(){s(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Subject=function(s){__extends$1(a,s);function a(){var u=s.call(this)||this;return u.closed=!1,u.currentObservers=null,u.observers=[],u.isStopped=!1,u.hasError=!1,u.thrownError=null,u}return a.prototype.lift=function(u){var l=new AnonymousSubject(this,this);return l.operator=u,l},a.prototype._throwIfClosed=function(){if(this.closed)throw new ObjectUnsubscribedError},a.prototype.next=function(u){var l=this;errorContext(function(){var f,c;if(l._throwIfClosed(),!l.isStopped){l.currentObservers||(l.currentObservers=Array.from(l.observers));try{for(var h=__values(l.currentObservers),p=h.next();!p.done;p=h.next()){var v=p.value;v.next(u)}}catch(y){f={error:y}}finally{try{p&&!p.done&&(c=h.return)&&c.call(h)}finally{if(f)throw f.error}}}})},a.prototype.error=function(u){var l=this;errorContext(function(){if(l._throwIfClosed(),!l.isStopped){l.hasError=l.isStopped=!0,l.thrownError=u;for(var f=l.observers;f.length;)f.shift().error(u)}})},a.prototype.complete=function(){var u=this;errorContext(function(){if(u._throwIfClosed(),!u.isStopped){u.isStopped=!0;for(var l=u.observers;l.length;)l.shift().complete()}})},a.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(a.prototype,"observed",{get:function(){var u;return((u=this.observers)===null||u===void 0?void 0:u.length)>0},enumerable:!1,configurable:!0}),a.prototype._trySubscribe=function(u){return this._throwIfClosed(),s.prototype._trySubscribe.call(this,u)},a.prototype._subscribe=function(u){return this._throwIfClosed(),this._checkFinalizedStatuses(u),this._innerSubscribe(u)},a.prototype._innerSubscribe=function(u){var l=this,f=this,c=f.hasError,h=f.isStopped,p=f.observers;return c||h?EMPTY_SUBSCRIPTION:(this.currentObservers=null,p.push(u),new Subscription(function(){l.currentObservers=null,arrRemove(p,u)}))},a.prototype._checkFinalizedStatuses=function(u){var l=this,f=l.hasError,c=l.thrownError,h=l.isStopped;f?u.error(c):h&&u.complete()},a.prototype.asObservable=function(){var u=new Observable;return u.source=this,u},a.create=function(u,l){return new AnonymousSubject(u,l)},a}(Observable),AnonymousSubject=function(s){__extends$1(a,s);function a(u,l){var f=s.call(this)||this;return f.destination=u,f.source=l,f}return a.prototype.next=function(u){var l,f;(f=(l=this.destination)===null||l===void 0?void 0:l.next)===null||f===void 0||f.call(l,u)},a.prototype.error=function(u){var l,f;(f=(l=this.destination)===null||l===void 0?void 0:l.error)===null||f===void 0||f.call(l,u)},a.prototype.complete=function(){var u,l;(l=(u=this.destination)===null||u===void 0?void 0:u.complete)===null||l===void 0||l.call(u)},a.prototype._subscribe=function(u){var l,f;return(f=(l=this.source)===null||l===void 0?void 0:l.subscribe(u))!==null&&f!==void 0?f:EMPTY_SUBSCRIPTION},a}(Subject),BehaviorSubject=function(s){__extends$1(a,s);function a(u){var l=s.call(this)||this;return l._value=u,l}return Object.defineProperty(a.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),a.prototype._subscribe=function(u){var l=s.prototype._subscribe.call(this,u);return!l.closed&&u.next(this._value),l},a.prototype.getValue=function(){var u=this,l=u.hasError,f=u.thrownError,c=u._value;if(l)throw f;return this._throwIfClosed(),c},a.prototype.next=function(u){s.prototype.next.call(this,this._value=u)},a}(Subject),dateTimestampProvider={now:function(){return(dateTimestampProvider.delegate||Date).now()},delegate:void 0},ReplaySubject=function(s){__extends$1(a,s);function a(u,l,f){u===void 0&&(u=1/0),l===void 0&&(l=1/0),f===void 0&&(f=dateTimestampProvider);var c=s.call(this)||this;return c._bufferSize=u,c._windowTime=l,c._timestampProvider=f,c._buffer=[],c._infiniteTimeWindow=!0,c._infiniteTimeWindow=l===1/0,c._bufferSize=Math.max(1,u),c._windowTime=Math.max(1,l),c}return a.prototype.next=function(u){var l=this,f=l.isStopped,c=l._buffer,h=l._infiniteTimeWindow,p=l._timestampProvider,v=l._windowTime;f||(c.push(u),!h&&c.push(p.now()+v)),this._trimBuffer(),s.prototype.next.call(this,u)},a.prototype._subscribe=function(u){this._throwIfClosed(),this._trimBuffer();for(var l=this._innerSubscribe(u),f=this,c=f._infiniteTimeWindow,h=f._buffer,p=h.slice(),v=0;v<p.length&&!u.closed;v+=c?1:2)u.next(p[v]);return this._checkFinalizedStatuses(u),l},a.prototype._trimBuffer=function(){var u=this,l=u._bufferSize,f=u._timestampProvider,c=u._buffer,h=u._infiniteTimeWindow,p=(h?1:2)*l;if(l<1/0&&p<c.length&&c.splice(0,c.length-p),!h){for(var v=f.now(),y=0,b=1;b<c.length&&c[b]<=v;b+=2)y=b;y&&c.splice(0,y+1)}},a}(Subject),Action=function(s){__extends$1(a,s);function a(u,l){return s.call(this)||this}return a.prototype.schedule=function(u,l){return this},a}(Subscription),intervalProvider={setInterval:function(s,a){for(var u=[],l=2;l<arguments.length;l++)u[l-2]=arguments[l];return setInterval.apply(void 0,__spreadArray([s,a],__read(u)))},clearInterval:function(s){return clearInterval(s)},delegate:void 0},AsyncAction=function(s){__extends$1(a,s);function a(u,l){var f=s.call(this,u,l)||this;return f.scheduler=u,f.work=l,f.pending=!1,f}return a.prototype.schedule=function(u,l){var f;if(l===void 0&&(l=0),this.closed)return this;this.state=u;var c=this.id,h=this.scheduler;return c!=null&&(this.id=this.recycleAsyncId(h,c,l)),this.pending=!0,this.delay=l,this.id=(f=this.id)!==null&&f!==void 0?f:this.requestAsyncId(h,this.id,l),this},a.prototype.requestAsyncId=function(u,l,f){return f===void 0&&(f=0),intervalProvider.setInterval(u.flush.bind(u,this),f)},a.prototype.recycleAsyncId=function(u,l,f){if(f===void 0&&(f=0),f!=null&&this.delay===f&&this.pending===!1)return l;l!=null&&intervalProvider.clearInterval(l)},a.prototype.execute=function(u,l){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var f=this._execute(u,l);if(f)return f;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},a.prototype._execute=function(u,l){var f=!1,c;try{this.work(u)}catch(h){f=!0,c=h||new Error("Scheduled action threw falsy error")}if(f)return this.unsubscribe(),c},a.prototype.unsubscribe=function(){if(!this.closed){var u=this,l=u.id,f=u.scheduler,c=f.actions;this.work=this.state=this.scheduler=null,this.pending=!1,arrRemove(c,this),l!=null&&(this.id=this.recycleAsyncId(f,l,null)),this.delay=null,s.prototype.unsubscribe.call(this)}},a}(Action),Scheduler=function(){function s(a,u){u===void 0&&(u=s.now),this.schedulerActionCtor=a,this.now=u}return s.prototype.schedule=function(a,u,l){return u===void 0&&(u=0),new this.schedulerActionCtor(this,a).schedule(l,u)},s.now=dateTimestampProvider.now,s}(),AsyncScheduler=function(s){__extends$1(a,s);function a(u,l){l===void 0&&(l=Scheduler.now);var f=s.call(this,u,l)||this;return f.actions=[],f._active=!1,f}return a.prototype.flush=function(u){var l=this.actions;if(this._active){l.push(u);return}var f;this._active=!0;do if(f=u.execute(u.state,u.delay))break;while(u=l.shift());if(this._active=!1,f){for(;u=l.shift();)u.unsubscribe();throw f}},a}(Scheduler),asyncScheduler=new AsyncScheduler(AsyncAction),async=asyncScheduler,EMPTY=new Observable(function(s){return s.complete()});function isScheduler(s){return s&&isFunction$1(s.schedule)}function last(s){return s[s.length-1]}function popResultSelector(s){return isFunction$1(last(s))?s.pop():void 0}function popScheduler(s){return isScheduler(last(s))?s.pop():void 0}var isArrayLike=function(s){return s&&typeof s.length=="number"&&typeof s!="function"};function isPromise(s){return isFunction$1(s==null?void 0:s.then)}function isInteropObservable(s){return isFunction$1(s[observable])}function isAsyncIterable(s){return Symbol.asyncIterator&&isFunction$1(s==null?void 0:s[Symbol.asyncIterator])}function createInvalidObservableTypeError(s){return new TypeError("You provided "+(s!==null&&typeof s=="object"?"an invalid object":"'"+s+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function getSymbolIterator(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var iterator=getSymbolIterator();function isIterable(s){return isFunction$1(s==null?void 0:s[iterator])}function readableStreamLikeToAsyncGenerator(s){return __asyncGenerator(this,arguments,function(){var u,l,f,c;return __generator$2(this,function(h){switch(h.label){case 0:u=s.getReader(),h.label=1;case 1:h.trys.push([1,,9,10]),h.label=2;case 2:return[4,__await(u.read())];case 3:return l=h.sent(),f=l.value,c=l.done,c?[4,__await(void 0)]:[3,5];case 4:return[2,h.sent()];case 5:return[4,__await(f)];case 6:return[4,h.sent()];case 7:return h.sent(),[3,2];case 8:return[3,10];case 9:return u.releaseLock(),[7];case 10:return[2]}})})}function isReadableStreamLike(s){return isFunction$1(s==null?void 0:s.getReader)}function innerFrom(s){if(s instanceof Observable)return s;if(s!=null){if(isInteropObservable(s))return fromInteropObservable(s);if(isArrayLike(s))return fromArrayLike(s);if(isPromise(s))return fromPromise(s);if(isAsyncIterable(s))return fromAsyncIterable(s);if(isIterable(s))return fromIterable(s);if(isReadableStreamLike(s))return fromReadableStreamLike(s)}throw createInvalidObservableTypeError(s)}function fromInteropObservable(s){return new Observable(function(a){var u=s[observable]();if(isFunction$1(u.subscribe))return u.subscribe(a);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function fromArrayLike(s){return new Observable(function(a){for(var u=0;u<s.length&&!a.closed;u++)a.next(s[u]);a.complete()})}function fromPromise(s){return new Observable(function(a){s.then(function(u){a.closed||(a.next(u),a.complete())},function(u){return a.error(u)}).then(null,reportUnhandledError)})}function fromIterable(s){return new Observable(function(a){var u,l;try{for(var f=__values(s),c=f.next();!c.done;c=f.next()){var h=c.value;if(a.next(h),a.closed)return}}catch(p){u={error:p}}finally{try{c&&!c.done&&(l=f.return)&&l.call(f)}finally{if(u)throw u.error}}a.complete()})}function fromAsyncIterable(s){return new Observable(function(a){process(s,a).catch(function(u){return a.error(u)})})}function fromReadableStreamLike(s){return fromAsyncIterable(readableStreamLikeToAsyncGenerator(s))}function process(s,a){var u,l,f,c;return __awaiter$8(this,void 0,void 0,function(){var h,p;return __generator$2(this,function(v){switch(v.label){case 0:v.trys.push([0,5,6,11]),u=__asyncValues(s),v.label=1;case 1:return[4,u.next()];case 2:if(l=v.sent(),!!l.done)return[3,4];if(h=l.value,a.next(h),a.closed)return[2];v.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return p=v.sent(),f={error:p},[3,11];case 6:return v.trys.push([6,,9,10]),l&&!l.done&&(c=u.return)?[4,c.call(u)]:[3,8];case 7:v.sent(),v.label=8;case 8:return[3,10];case 9:if(f)throw f.error;return[7];case 10:return[7];case 11:return a.complete(),[2]}})})}function executeSchedule(s,a,u,l,f){l===void 0&&(l=0),f===void 0&&(f=!1);var c=a.schedule(function(){u(),f?s.add(this.schedule(null,l)):this.unsubscribe()},l);if(s.add(c),!f)return c}function observeOn(s,a){return a===void 0&&(a=0),operate(function(u,l){u.subscribe(createOperatorSubscriber(l,function(f){return executeSchedule(l,s,function(){return l.next(f)},a)},function(){return executeSchedule(l,s,function(){return l.complete()},a)},function(f){return executeSchedule(l,s,function(){return l.error(f)},a)}))})}function subscribeOn(s,a){return a===void 0&&(a=0),operate(function(u,l){l.add(s.schedule(function(){return u.subscribe(l)},a))})}function scheduleObservable(s,a){return innerFrom(s).pipe(subscribeOn(a),observeOn(a))}function schedulePromise(s,a){return innerFrom(s).pipe(subscribeOn(a),observeOn(a))}function scheduleArray(s,a){return new Observable(function(u){var l=0;return a.schedule(function(){l===s.length?u.complete():(u.next(s[l++]),u.closed||this.schedule())})})}function scheduleIterable(s,a){return new Observable(function(u){var l;return executeSchedule(u,a,function(){l=s[iterator](),executeSchedule(u,a,function(){var f,c,h;try{f=l.next(),c=f.value,h=f.done}catch(p){u.error(p);return}h?u.complete():u.next(c)},0,!0)}),function(){return isFunction$1(l==null?void 0:l.return)&&l.return()}})}function scheduleAsyncIterable(s,a){if(!s)throw new Error("Iterable cannot be null");return new Observable(function(u){executeSchedule(u,a,function(){var l=s[Symbol.asyncIterator]();executeSchedule(u,a,function(){l.next().then(function(f){f.done?u.complete():u.next(f.value)})},0,!0)})})}function scheduleReadableStreamLike(s,a){return scheduleAsyncIterable(readableStreamLikeToAsyncGenerator(s),a)}function scheduled(s,a){if(s!=null){if(isInteropObservable(s))return scheduleObservable(s,a);if(isArrayLike(s))return scheduleArray(s,a);if(isPromise(s))return schedulePromise(s,a);if(isAsyncIterable(s))return scheduleAsyncIterable(s,a);if(isIterable(s))return scheduleIterable(s,a);if(isReadableStreamLike(s))return scheduleReadableStreamLike(s,a)}throw createInvalidObservableTypeError(s)}function from(s,a){return a?scheduled(s,a):innerFrom(s)}function of(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];var u=popScheduler(s);return from(s,u)}function throwError(s,a){var u=isFunction$1(s)?s:function(){return s},l=function(f){return f.error(u())};return new Observable(l)}var EmptyError=createErrorClass(function(s){return function(){s(this),this.name="EmptyError",this.message="no elements in sequence"}});function isValidDate(s){return s instanceof Date&&!isNaN(s)}var TimeoutError=createErrorClass(function(s){return function(u){u===void 0&&(u=null),s(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=u}});function timeout(s,a){var u=isValidDate(s)?{first:s}:typeof s=="number"?{each:s}:s,l=u.first,f=u.each,c=u.with,h=c===void 0?timeoutErrorFactory:c,p=u.scheduler,v=p===void 0?asyncScheduler:p,y=u.meta,b=y===void 0?null:y;if(l==null&&f==null)throw new TypeError("No timeout provided.");return operate(function(S,E){var R,O,I=null,B=0,N=function(D){O=executeSchedule(E,v,function(){try{R.unsubscribe(),innerFrom(h({meta:b,lastValue:I,seen:B})).subscribe(E)}catch(G){E.error(G)}},D)};R=S.subscribe(createOperatorSubscriber(E,function(D){O==null||O.unsubscribe(),B++,E.next(I=D),f>0&&N(f)},void 0,void 0,function(){O!=null&&O.closed||O==null||O.unsubscribe(),I=null})),!B&&N(l!=null?typeof l=="number"?l:+l-v.now():f)})}function timeoutErrorFactory(s){throw new TimeoutError(s)}function map(s,a){return operate(function(u,l){var f=0;u.subscribe(createOperatorSubscriber(l,function(c){l.next(s.call(a,c,f++))}))})}var isArray$1=Array.isArray;function callOrApply(s,a){return isArray$1(a)?s.apply(void 0,__spreadArray([],__read(a))):s(a)}function mapOneOrManyArgs(s){return map(function(a){return callOrApply(s,a)})}var isArray=Array.isArray,getPrototypeOf=Object.getPrototypeOf,objectProto=Object.prototype,getKeys=Object.keys;function argsArgArrayOrObject(s){if(s.length===1){var a=s[0];if(isArray(a))return{args:a,keys:null};if(isPOJO(a)){var u=getKeys(a);return{args:u.map(function(l){return a[l]}),keys:u}}}return{args:s,keys:null}}function isPOJO(s){return s&&typeof s=="object"&&getPrototypeOf(s)===objectProto}function createObject(s,a){return s.reduce(function(u,l,f){return u[l]=a[f],u},{})}function combineLatest(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];var u=popScheduler(s),l=popResultSelector(s),f=argsArgArrayOrObject(s),c=f.args,h=f.keys;if(c.length===0)return from([],u);var p=new Observable(combineLatestInit(c,u,h?function(v){return createObject(h,v)}:identity));return l?p.pipe(mapOneOrManyArgs(l)):p}function combineLatestInit(s,a,u){return u===void 0&&(u=identity),function(l){maybeSchedule(a,function(){for(var f=s.length,c=new Array(f),h=f,p=f,v=function(b){maybeSchedule(a,function(){var S=from(s[b],a),E=!1;S.subscribe(createOperatorSubscriber(l,function(R){c[b]=R,E||(E=!0,p--),p||l.next(u(c.slice()))},function(){--h||l.complete()}))},l)},y=0;y<f;y++)v(y)},l)}}function maybeSchedule(s,a,u){s?executeSchedule(u,s,a):a()}function mergeInternals(s,a,u,l,f,c,h,p){var v=[],y=0,b=0,S=!1,E=function(){S&&!v.length&&!y&&a.complete()},R=function(I){return y<l?O(I):v.push(I)},O=function(I){y++;var B=!1;innerFrom(u(I,b++)).subscribe(createOperatorSubscriber(a,function(N){a.next(N)},function(){B=!0},void 0,function(){if(B)try{y--;for(var N=function(){var D=v.shift();h||O(D)};v.length&&y<l;)N();E()}catch(D){a.error(D)}}))};return s.subscribe(createOperatorSubscriber(a,R,function(){S=!0,E()})),function(){}}function mergeMap(s,a,u){return u===void 0&&(u=1/0),isFunction$1(a)?mergeMap(function(l,f){return map(function(c,h){return a(l,c,f,h)})(innerFrom(s(l,f)))},u):(typeof a=="number"&&(u=a),operate(function(l,f){return mergeInternals(l,f,s,u)}))}function mergeAll(s){return mergeMap(identity,s)}function concatAll(){return mergeAll(1)}function concat(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];return concatAll()(from(s,popScheduler(s)))}function defer(s){return new Observable(function(a){innerFrom(s()).subscribe(a)})}function timer(s,a,u){s===void 0&&(s=0),u===void 0&&(u=async);var l=-1;return a!=null&&(isScheduler(a)?u=a:l=a),new Observable(function(f){var c=isValidDate(s)?+s-u.now():s;c<0&&(c=0);var h=0;return u.schedule(function(){f.closed||(f.next(h++),0<=l?this.schedule(void 0,l):f.complete())},c)})}var NEVER$1=new Observable(noop);function filter(s,a){return operate(function(u,l){var f=0;u.subscribe(createOperatorSubscriber(l,function(c){return s.call(a,c,f++)&&l.next(c)}))})}function range$1(s,a,u){if(a==null&&(a=s,s=0),a<=0)return EMPTY;var l=a+s;return new Observable(function(f){for(var c=s;c<l&&!f.closed;)f.next(c++);f.complete()})}function catchError(s){return operate(function(a,u){var l=null,f=!1,c;l=a.subscribe(createOperatorSubscriber(u,void 0,void 0,function(h){c=innerFrom(s(h,catchError(s)(a))),l?(l.unsubscribe(),l=null,c.subscribe(u)):f=!0})),f&&(l.unsubscribe(),l=null,c.subscribe(u))})}function concatMap(s,a){return isFunction$1(a)?mergeMap(s,a,1):mergeMap(s,1)}function fromSubscribable(s){return new Observable(function(a){return s.subscribe(a)})}var DEFAULT_CONFIG={connector:function(){return new Subject}};function connect(s,a){a===void 0&&(a=DEFAULT_CONFIG);var u=a.connector;return operate(function(l,f){var c=u();innerFrom(s(fromSubscribable(c))).subscribe(f),f.add(l.subscribe(c))})}function defaultIfEmpty(s){return operate(function(a,u){var l=!1;a.subscribe(createOperatorSubscriber(u,function(f){l=!0,u.next(f)},function(){l||u.next(s),u.complete()}))})}function take(s){return s<=0?function(){return EMPTY}:operate(function(a,u){var l=0;a.subscribe(createOperatorSubscriber(u,function(f){++l<=s&&(u.next(f),s<=l&&u.complete())}))})}function distinctUntilChanged(s,a){return a===void 0&&(a=identity),s=s??defaultCompare,operate(function(u,l){var f,c=!0;u.subscribe(createOperatorSubscriber(l,function(h){var p=a(h);(c||!s(f,p))&&(c=!1,f=p,l.next(h))}))})}function defaultCompare(s,a){return s===a}function distinctUntilKeyChanged(s,a){return distinctUntilChanged(function(u,l){return u[s]===l[s]})}function throwIfEmpty(s){return s===void 0&&(s=defaultErrorFactory),operate(function(a,u){var l=!1;a.subscribe(createOperatorSubscriber(u,function(f){l=!0,u.next(f)},function(){return l?u.complete():u.error(s())}))})}function defaultErrorFactory(){return new EmptyError}function endWith(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];return function(u){return concat(u,of.apply(void 0,__spreadArray([],__read(s))))}}function first(s,a){var u=arguments.length>=2;return function(l){return l.pipe(identity,take(1),u?defaultIfEmpty(a):throwIfEmpty(function(){return new EmptyError}))}}function multicast(s,a){var u=isFunction$1(s)?s:function(){return s};return isFunction$1(a)?connect(a,{connector:u}):function(l){return new ConnectableObservable(l,u)}}function pluck(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];var u=s.length;if(u===0)throw new Error("list of properties cannot be empty.");return map(function(l){for(var f=l,c=0;c<u;c++){var h=f==null?void 0:f[s[c]];if(typeof h<"u")f=h;else return}return f})}function publish(s){return s?function(a){return connect(s)(a)}:function(a){return multicast(new Subject)(a)}}function retry$2(s){s===void 0&&(s=1/0);var a;s&&typeof s=="object"?a=s:a={count:s};var u=a.count,l=u===void 0?1/0:u,f=a.delay,c=a.resetOnSuccess,h=c===void 0?!1:c;return l<=0?identity:operate(function(p,v){var y=0,b,S=function(){var E=!1;b=p.subscribe(createOperatorSubscriber(v,function(R){h&&(y=0),v.next(R)},void 0,function(R){if(y++<l){var O=function(){b?(b.unsubscribe(),b=null,S()):E=!0};if(f!=null){var I=typeof f=="number"?timer(f):innerFrom(f(R,y)),B=createOperatorSubscriber(v,function(){B.unsubscribe(),O()},function(){v.complete()});I.subscribe(B)}else O()}else v.error(R)})),E&&(b.unsubscribe(),b=null,S())};S()})}function share(s){s===void 0&&(s={});var a=s.connector,u=a===void 0?function(){return new Subject}:a,l=s.resetOnError,f=l===void 0?!0:l,c=s.resetOnComplete,h=c===void 0?!0:c,p=s.resetOnRefCountZero,v=p===void 0?!0:p;return function(y){var b,S,E,R=0,O=!1,I=!1,B=function(){S==null||S.unsubscribe(),S=void 0},N=function(){B(),b=E=void 0,O=I=!1},D=function(){var G=b;N(),G==null||G.unsubscribe()};return operate(function(G,V){R++,!I&&!O&&B();var U=E=E??u();V.add(function(){R--,R===0&&!I&&!O&&(S=handleReset(D,v))}),U.subscribe(V),!b&&R>0&&(b=new SafeSubscriber({next:function(te){return U.next(te)},error:function(te){I=!0,B(),S=handleReset(N,f,te),U.error(te)},complete:function(){O=!0,B(),S=handleReset(N,h),U.complete()}}),innerFrom(G).subscribe(b))})(y)}}function handleReset(s,a){for(var u=[],l=2;l<arguments.length;l++)u[l-2]=arguments[l];if(a===!0){s();return}if(a!==!1){var f=new SafeSubscriber({next:function(){f.unsubscribe(),s()}});return innerFrom(a.apply(void 0,__spreadArray([],__read(u)))).subscribe(f)}}function shareReplay(s,a,u){var l,f,c,h,p=!1;return s&&typeof s=="object"?(l=s.bufferSize,h=l===void 0?1/0:l,f=s.windowTime,a=f===void 0?1/0:f,c=s.refCount,p=c===void 0?!1:c,u=s.scheduler):h=s??1/0,share({connector:function(){return new ReplaySubject(h,a,u)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:p})}function startWith(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];var u=popScheduler(s);return operate(function(l,f){(u?concat(s,l,u):concat(s,l)).subscribe(f)})}function switchMap(s,a){return operate(function(u,l){var f=null,c=0,h=!1,p=function(){return h&&!f&&l.complete()};u.subscribe(createOperatorSubscriber(l,function(v){f==null||f.unsubscribe();var y=0,b=c++;innerFrom(s(v,b)).subscribe(f=createOperatorSubscriber(l,function(S){return l.next(a?a(v,S,b,y++):S)},function(){f=null,p()}))},function(){h=!0,p()}))})}function takeUntil(s){return operate(function(a,u){innerFrom(s).subscribe(createOperatorSubscriber(u,function(){return u.complete()},noop)),!u.closed&&a.subscribe(u)})}function takeWhile(s,a){return operate(function(u,l){var f=0;u.subscribe(createOperatorSubscriber(l,function(c){var h=s(c,f++);(h||a)&&l.next(c),!h&&l.complete()}))})}function tap(s,a,u){var l=isFunction$1(s)||a||u?{next:s,error:a,complete:u}:s;return l?operate(function(f,c){var h;(h=l.subscribe)===null||h===void 0||h.call(l);var p=!0;f.subscribe(createOperatorSubscriber(c,function(v){var y;(y=l.next)===null||y===void 0||y.call(l,v),c.next(v)},function(){var v;p=!1,(v=l.complete)===null||v===void 0||v.call(l),c.complete()},function(v){var y;p=!1,(y=l.error)===null||y===void 0||y.call(l,v),c.error(v)},function(){var v,y;p&&((v=l.unsubscribe)===null||v===void 0||v.call(l)),(y=l.finalize)===null||y===void 0||y.call(l)}))}):identity}var fastJsonStableStringify,hasRequiredFastJsonStableStringify;function requireFastJsonStableStringify(){return hasRequiredFastJsonStableStringify||(hasRequiredFastJsonStableStringify=1,fastJsonStableStringify=function(s,a){a||(a={}),typeof a=="function"&&(a={cmp:a});var u=typeof a.cycles=="boolean"?a.cycles:!1,l=a.cmp&&function(c){return function(h){return function(p,v){var y={key:p,value:h[p]},b={key:v,value:h[v]};return c(y,b)}}}(a.cmp),f=[];return function c(h){if(h&&h.toJSON&&typeof h.toJSON=="function"&&(h=h.toJSON()),h!==void 0){if(typeof h=="number")return isFinite(h)?""+h:"null";if(typeof h!="object")return JSON.stringify(h);var p,v;if(Array.isArray(h)){for(v="[",p=0;p<h.length;p++)p&&(v+=","),v+=c(h[p])||"null";return v+"]"}if(h===null)return"null";if(f.indexOf(h)!==-1){if(u)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var y=f.push(h)-1,b=Object.keys(h).sort(l&&l(h));for(v="",p=0;p<b.length;p++){var S=b[p],E=c(h[S]);E&&(v&&(v+=","),v+=JSON.stringify(S)+":"+E)}return f.splice(y,1),"{"+v+"}"}}(s)}),fastJsonStableStringify}var fastJsonStableStringifyExports=requireFastJsonStableStringify();const stringify$1=getDefaultExportFromCjs(fastJsonStableStringifyExports);var _a$1;class InvalidMapTypeError extends TaquitoError{constructor(a,u){super(),this.mapType=a,this.reason=u,this.message=`The map type '${JSON.stringify(a)}' is invalid. Reason: ${u}.`,this.name="InvalidMapTypeError"}}const michelsonMapTypeSymbol=Symbol.for("taquito-michelson-map-type-symbol");function validateMapType(s){if(!("prim"in s))throw new InvalidMapTypeError(s,"Missing 'prim' field");if(!["map","big_map"].includes(s.prim))throw new InvalidMapTypeError(s,"The prim field should be 'map' or 'big_map'");if(!("args"in s))throw new InvalidMapTypeError(s,"Missing 'args' field");if(!Array.isArray(s.args))throw new InvalidMapTypeError(s,"The 'args' field should be an array");if(s.args.length!==2)throw new InvalidMapTypeError(s,"The 'args' field should have 2 elements")}class MapTypecheckError extends TaquitoError{constructor(a,u,l,f){super(),this.value=a,this.type=u,this.reason=f,this.name="MapTypecheckError",this.message=`The ${l} provided: ${JSON.stringify(a)} is not compatible with the expected michelson type: ${JSON.stringify(u)}. Reason: ${JSON.stringify(f)}.`,this.name="MapTypecheckError"}}class MichelsonMap{static isMichelsonMap(a){return a&&a[michelsonMapTypeSymbol]===!0}constructor(a){this.valueMap=new Map,this.keyMap=new Map,this[_a$1]=!0,a&&this.setType(a)}setType(a){validateMapType(a),this.keySchema=new Schema(a.args[0]),this.valueSchema=new Schema(a.args[1])}removeType(){this.keySchema=void 0,this.valueSchema=void 0}static fromLiteral(a,u){const l=new MichelsonMap(u);return Object.keys(a).forEach(f=>{l.set(f,a[f])}),l}typecheckKey(a){this.keySchema&&this.keySchema.Typecheck(a)}typecheckValue(a){this.valueSchema&&this.valueSchema.Typecheck(a)}assertTypecheckValue(a){try{this.typecheckValue(a)}catch(u){throw new MapTypecheckError(a,this.valueSchema,"value",u)}}assertTypecheckKey(a){try{this.typecheckKey(a)}catch(u){throw new MapTypecheckError(a,this.keySchema,"key",u)}}serializeDeterministically(a){return stringify$1(a)}*keys(){for(const[a]of this.entries())yield a}*values(){for(const[,a]of this.entries())yield a}*entries(){for(const a of this.valueMap.keys())yield[this.keyMap.get(a),this.valueMap.get(a)]}get(a){this.assertTypecheckKey(a);const u=this.serializeDeterministically(a);return this.valueMap.get(u)}set(a,u){this.assertTypecheckKey(a),this.assertTypecheckValue(u);const l=this.serializeDeterministically(a);this.keyMap.set(l,a),this.valueMap.set(l,u)}delete(a){this.assertTypecheckKey(a),this.keyMap.delete(this.serializeDeterministically(a)),this.valueMap.delete(this.serializeDeterministically(a))}has(a){this.assertTypecheckKey(a);const u=this.serializeDeterministically(a);return this.keyMap.has(u)&&this.valueMap.has(u)}clear(){this.keyMap.clear(),this.valueMap.clear()}get size(){return this.keyMap.size}forEach(a){for(const[u,l]of this.entries())a(l,u,this)}}_a$1=michelsonMapTypeSymbol;class TokenValidationError extends TaquitoError{constructor(a,u,l){super(),this.value=a,this.token=u,this.name="TokenValidationError";const f=this.token.annot(),c=f?`[${f}] `:"";this.message=`${c}${l}`}}class Token{static get fieldNumberingStrategy(){return Token._fieldNumberingStrategy}static set fieldNumberingStrategy(a){Token._fieldNumberingStrategy=a}constructor(a,u,l,f){this.val=a,this.idx=u,this.fac=l,this.parentTokenType=f,this.createToken=this.fac}typeWithoutAnnotations(){const a=l=>{if(typeof l=="object"){if(Array.isArray(l))return l.map(h=>a(h));const f=l;return f.args?{prim:f.prim,args:f.args.map(c=>a(c))}:{prim:f.prim}}return l};return(l=>l.args?{prim:l.prim,args:l.args.map(f=>a(f))}:{prim:l.prim})(this.val)}annot(){return(Array.isArray(this.val.annots)&&this.val.annots.length>0?this.val.annots[0]:String(this.idx)).replace(/(%|:)(_Liq_entry_)?/,"")}hasAnnotations(){return Array.isArray(this.val.annots)&&this.val.annots.length}get tokenVal(){return this.val}ExtractSignature(){return[[this.ExtractSchema()]]}}Token._fieldNumberingStrategy="Latest";class ComparableToken extends Token{compare(a,u){return a===u?0:a<u?-1:1}}class BigMapValidationError extends TokenValidationError{constructor(a,u,l){super(a,u,l),this.value=a,this.token=u,this.name="BigMapValidationError"}}class BigMapToken extends Token{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}get ValueSchema(){return this.createToken(this.val.args[1],0)}get KeySchema(){return this.createToken(this.val.args[0],0)}ExtractSchema(){return{big_map:{key:this.KeySchema.ExtractSchema(),value:this.ValueSchema.ExtractSchema()}}}generateSchema(){return{__michelsonType:BigMapToken.prim,schema:{key:this.KeySchema.generateSchema(),value:this.ValueSchema.generateSchema()}}}validate(a){if(!MichelsonMap.isMichelsonMap(a))throw new BigMapValidationError(a,this,`Value ${JSON.stringify(a)} is not a MichelsonMap`)}objLitToMichelsonMap(a){return a instanceof MichelsonMap?a:typeof a=="object"?Object.keys(a).length===0?new MichelsonMap:MichelsonMap.fromLiteral(a):a}Encode(a){const u=this.objLitToMichelsonMap(a.pop());return this.validate(u),Array.from(u.keys()).sort((l,f)=>this.KeySchema.compare(l,f)).map(l=>({prim:"Elt",args:[this.KeySchema.EncodeObject(l),this.ValueSchema.EncodeObject(u.get(l))]}))}EncodeObject(a,u){const l=this.objLitToMichelsonMap(a);return this.validate(l),u&&u[BigMapToken.prim]?u[BigMapToken.prim](l,this.val):Array.from(l.keys()).sort((f,c)=>this.KeySchema.compare(f,c)).map(f=>({prim:"Elt",args:[this.KeySchema.EncodeObject(f),this.ValueSchema.EncodeObject(l.get(f))]}))}Execute(a,u){if(u&&u[BigMapToken.prim])return u[BigMapToken.prim](a,this.val);if(Array.isArray(a)){const l=new MichelsonMap(this.val);return a.forEach(f=>{l.set(this.KeySchema.ToKey(f.args[0]),this.ValueSchema.Execute(f.args[1]))}),l}else{if("int"in a)return a.int;throw new BigMapValidationError(a,this,`Big map is expecting either an array (Athens) or an object with an int property (Babylon). Got ${JSON.stringify(a)}`)}}findAndReturnTokens(a,u){return BigMapToken.prim===a&&u.push(this),this.KeySchema.findAndReturnTokens(a,u),this.ValueSchema.findAndReturnTokens(a,u),u}}BigMapToken.prim="big_map";class OrValidationError extends TokenValidationError{constructor(a,u,l){super(a,u,l),this.value=a,this.token=u,this.name="OrValidationError"}}class OrToken extends ComparableToken{constructor(a,u,l,f){super(a,u,l,f),this.val=a,this.idx=u,this.fac=l,this.parentTokenType=f}Encode(a){const u=a[a.length-1],l=this.createToken(this.val.args[0],this.getIdxForChildren(),"Or");let f=1;l instanceof OrToken&&(f=Object.keys(l.ExtractSchema()).length);const c=this.createToken(this.val.args[1],this.getIdxForChildren()+f,"Or");if(String(l.annot())===String(u)&&!(l instanceof OrToken))return a.pop(),{prim:"Left",args:[l.Encode(a)]};if(String(c.annot())===String(u)&&!(c instanceof OrToken))return a.pop(),{prim:"Right",args:[c.Encode(a)]};if(l instanceof OrToken){const h=l.Encode(a);if(h)return{prim:"Left",args:[h]}}if(c instanceof OrToken){const h=c.Encode(a);if(h)return{prim:"Right",args:[h]}}return null}ExtractSignature(){const a=this.createToken(this.val.args[0],this.getIdxForChildren(),"Or");let u=1;a instanceof OrToken&&(u=Object.keys(a.ExtractSchema()).length);const l=this.createToken(this.val.args[1],this.getIdxForChildren()+u,"Or"),f=[];if(a instanceof OrToken)f.push(...a.ExtractSignature());else for(const c of a.ExtractSignature())f.push([a.annot(),...c]);if(l instanceof OrToken)f.push(...l.ExtractSignature());else for(const c of l.ExtractSignature())f.push([l.annot(),...c]);return f}EncodeObject(a,u){this.validateJavascriptObject(a);const l=Object.keys(a)[0],f=this.createToken(this.val.args[0],this.getIdxForChildren(),"Or");let c=1;f instanceof OrToken&&(c=Object.keys(f.ExtractSchema()).length);const h=this.createToken(this.val.args[1],this.getIdxForChildren()+c,"Or");if(String(f.annot())===String(l)&&!(f instanceof OrToken))return{prim:"Left",args:[f.EncodeObject(a[l],u)]};if(String(h.annot())===String(l)&&!(h instanceof OrToken))return{prim:"Right",args:[h.EncodeObject(a[l],u)]};if(f instanceof OrToken){const p=f.EncodeObject(a,u);if(p)return{prim:"Left",args:[p]}}if(h instanceof OrToken){const p=h.EncodeObject(a,u);if(p)return{prim:"Right",args:[p]}}return null}validateJavascriptObject(a){if(typeof a!="object"||Array.isArray(a)||a===null||Object.keys(a).length!==1)throw new OrValidationError(a,this,`EncodeObject expects an object with a single key but got: ${JSON.stringify(a)}`)}Execute(a,u){const l=this.createToken(this.val.args[0],this.getIdxForChildren(),"Or");let f=1;l instanceof OrToken&&(f=Object.keys(l.ExtractSchema()).length);const c=this.createToken(this.val.args[1],this.getIdxForChildren()+f,"Or");if(a.prim==="Right")return c instanceof OrToken?c.Execute(a.args[0],u):{[c.annot()]:c.Execute(a.args[0],u)};if(a.prim==="Left")return l instanceof OrToken?l.Execute(a.args[0],u):{[l.annot()]:l.Execute(a.args[0],u)};throw new OrValidationError(a,this,`Was expecting Left or Right prim but got: ${JSON.stringify(a.prim)}`)}traversal(a,u,l){const f=this.createToken(this.val.args[0],this.getIdxForChildren(),"Or");let c=1,h;f instanceof OrToken?(h=a(f),c=Object.keys(f.ExtractSchema()).length):h={[f.annot()]:a(f)};const p=this.createToken(this.val.args[1],this.getIdxForChildren()+c,"Or");let v;return p instanceof OrToken?v=u(p):v={[p.annot()]:u(p)},l(h,v)}ExtractSchema(){return this.traversal(a=>a.ExtractSchema(),a=>a.ExtractSchema(),(a,u)=>Object.assign(Object.assign({},a),u))}generateSchema(){return{__michelsonType:OrToken.prim,schema:this.traversal(a=>a instanceof OrToken?a.generateSchema().schema:a.generateSchema(),a=>a instanceof OrToken?a.generateSchema().schema:a.generateSchema(),(a,u)=>Object.assign(Object.assign({},a),u))}}findToken(a){const u=this.createToken(this.val.args[0],this.getIdxForChildren(),"Or");let l=1;u instanceof OrToken&&(l=Object.keys(u.ExtractSchema()).length);const f=this.createToken(this.val.args[1],this.getIdxForChildren()+l,"Or");if(String(u.annot())===String(a)&&!(u instanceof OrToken)&&u instanceof ComparableToken)return u;if(String(f.annot())===String(a)&&!(f instanceof OrToken)&&f instanceof ComparableToken)return f;if(u instanceof OrToken){const c=u.findToken(a);if(c)return c}if(f instanceof OrToken){const c=f.findToken(a);if(c)return c}return null}compare(a,u){const l=Object.keys(a)[0],f=Object.keys(u)[0];if(l===f){const c=this.findToken(l);if(c instanceof ComparableToken)return c.compare(a[l],u[l])}else{const c=JSON.stringify(this.EncodeObject(a)),h=JSON.stringify(this.EncodeObject(u));return c<h?-1:1}}ToKey(a){return this.Execute(a)}ToBigMapKey(a){return{key:this.EncodeObject(a),type:this.typeWithoutAnnotations()}}findAndReturnTokens(a,u){return OrToken.prim===a&&u.push(this),this.traversal(l=>l.findAndReturnTokens(a,u),l=>l.findAndReturnTokens(a,u),(l,f)=>Object.assign(Object.assign({},l),f)),u}getIdxForChildren(){return Token.fieldNumberingStrategy==="Legacy"?this.idx:this.parentTokenType==="Or"?this.idx:0}}OrToken.prim="or";class TokenArgumentValidationError extends TaquitoError{constructor(a){super(a),this.message=a,this.name="TokenArgumentValidationError"}}class TokenComparisonError extends TaquitoError{constructor(a,u){super(),this.val1=a,this.val2=u,this.name="TokenComparisonError",this.message=`Tokens ${JSON.stringify(a)} and ${JSON.stringify(u)} are not comparable`}}function collapse$1(s,a=PairToken.prim){if(Array.isArray(s))return collapse$1({prim:a,args:s},a);if(s.args===void 0)throw new TokenArgumentValidationError(`The value ${JSON.stringify(s)} is an invalid PairToken with no arguments, a pair must have two or more arguments.`);return s.args.length>2?[s.args[0],{prim:a,args:s.args.slice(1)}]:[s.args[0],s.args[1]]}class PairToken extends ComparableToken{constructor(a,u,l,f){super(Array.isArray(a)?{prim:PairToken.prim,args:a}:a.prim?a:{prim:PairToken.prim,args:a},u,l,f)}args(){return collapse$1(this.val)}tokens(){let a=0;return this.args().map(u=>{const l=this.createToken(u,this.getIdxForChildren()+a,"Pair");return l instanceof PairToken?a+=Object.keys(l.ExtractSchema()).length:a++,l})}Encode(a){return{prim:"Pair",args:this.tokens().map(u=>u.Encode(a))}}ExtractSignature(){const a=this.args(),u=this.createToken(a[0],this.getIdxForChildren(),"Pair");let l=1;u instanceof OrToken&&(l=Object.keys(u.ExtractSchema()).length);const f=this.createToken(a[1],this.getIdxForChildren()+l,"Pair"),c=[];for(const h of u.ExtractSignature())for(const p of f.ExtractSignature())c.push([...h,...p]);return c}ToBigMapKey(a){return{key:this.EncodeObject(a),type:this.typeWithoutAnnotations()}}ToKey(a){return this.Execute(a)}EncodeObject(a,u){const[l,f]=this.tokens();let c;l instanceof PairToken&&!l.hasAnnotations()?c=a:c=a[l.annot()];let h;return f instanceof PairToken&&!f.hasAnnotations()?h=a:h=a[f.annot()],{prim:"Pair",args:[l.EncodeObject(c,u),f.EncodeObject(h,u)]}}traversal(a,u){const l=this.args(),f=this.createToken(l[0],this.getIdxForChildren(),"Pair");let c=1,h;f instanceof PairToken&&!f.hasAnnotations()?(h=a(f),f instanceof PairToken&&(c=Object.keys(f.ExtractSchema()).length)):h={[f.annot()]:a(f)};const p=this.createToken(l[1],this.getIdxForChildren()+c,"Pair");let v;return p instanceof PairToken&&!p.hasAnnotations()?v=u(p):v={[p.annot()]:u(p)},Object.assign(Object.assign({},h),v)}Execute(a,u){const l=collapse$1(a,"Pair");return this.traversal(f=>f.Execute(l[0],u),f=>f.Execute(l[1],u))}ExtractSchema(){return this.traversal(a=>a.ExtractSchema(),a=>a.ExtractSchema())}generateSchema(){return{__michelsonType:PairToken.prim,schema:this.traversal(a=>a instanceof PairToken&&!a.hasAnnotations()?a.generateSchema().schema:a.generateSchema(),a=>a instanceof PairToken&&!a.hasAnnotations()?a.generateSchema().schema:a.generateSchema())}}compare(a,u){const[l,f]=this.tokens(),c=(h,p)=>h instanceof PairToken&&!h.hasAnnotations()?p:p[h.annot()];if(l instanceof ComparableToken&&f instanceof ComparableToken){const h=l.compare(c(l,a),c(l,u));return h===0?f.compare(c(f,a),c(f,u)):h}throw new TokenComparisonError(a,u)}findAndReturnTokens(a,u){return PairToken.prim===a&&u.push(this),this.tokens().map(l=>l.findAndReturnTokens(a,u)),u}getIdxForChildren(){return Token.fieldNumberingStrategy==="Legacy"?this.idx:this.parentTokenType==="Pair"?this.idx:0}}PairToken.prim="pair";class NatValidationError extends TokenValidationError{constructor(a,u,l){super(a,u,l),this.value=a,this.token=u,this.name="NatValidationError"}}class NatToken extends ComparableToken{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}Execute(a){return new BigNumber(a[Object.keys(a)[0]])}Encode(a){const u=a.pop();return this.validate(u),{int:new BigNumber(u).toFixed()}}validate(a){const u=new BigNumber(a);if(u.isNaN())throw new NatValidationError(a,this,`Value is not a number: ${JSON.stringify(a)}`);if(u.isNegative())throw new NatValidationError(a,this,`Value cannot be negative: ${JSON.stringify(a)}`)}EncodeObject(a,u){return this.validate(a),u&&u[NatToken.prim]?u[NatToken.prim](a):{int:new BigNumber(a).toFixed()}}ExtractSchema(){return NatToken.prim}generateSchema(){return{__michelsonType:NatToken.prim,schema:NatToken.prim}}ToBigMapKey(a){return{key:{int:String(a)},type:{prim:NatToken.prim}}}ToKey({int:a}){return new BigNumber(a)}compare(a,u){const l=Number(a),f=Number(u);return l===f?0:l<f?-1:1}findAndReturnTokens(a,u){return NatToken.prim===a&&u.push(this),u}}NatToken.prim="nat";class StringToken extends ComparableToken{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}Execute(a){return a[Object.keys(a)[0]]}ExtractSchema(){return StringToken.prim}generateSchema(){return{__michelsonType:StringToken.prim,schema:StringToken.prim}}Encode(a){return{string:a.pop()}}EncodeObject(a,u){return u&&u[StringToken.prim]?u[StringToken.prim](a):{string:a}}ToKey({string:a}){return a}ToBigMapKey(a){return{key:{string:a},type:{prim:StringToken.prim}}}findAndReturnTokens(a,u){return StringToken.prim===a&&u.push(this),u}}StringToken.prim="string";class AddressValidationError extends TokenValidationError{constructor(a,u,l){super(a,u,l),this.value=a,this.token=u,this.name="AddressValidationError"}}class AddressToken extends ComparableToken{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}ToBigMapKey(a){return{key:{bytes:b58decode(a)},type:{prim:"bytes"}}}validate(a){if(validateAddress(a)!==ValidationResult.VALID)throw new AddressValidationError(a,this,`Address is not valid: ${JSON.stringify(a)}`)}Encode(a){const u=a.pop();return this.validate(u),{string:u}}EncodeObject(a,u){return this.validate(a),u&&u[AddressToken.prim]?u[AddressToken.prim](a):{string:a}}Execute(a){if(a.string)return a.string;if(!a.bytes)throw new AddressValidationError(a,this,`cannot be missing both string and bytes: ${JSON.stringify(a)}`);return encodeAddress(a.bytes)}ExtractSchema(){return AddressToken.prim}generateSchema(){return{__michelsonType:AddressToken.prim,schema:AddressToken.prim}}ToKey({bytes:a,string:u}){if(u)return u;if(!a)throw new AddressValidationError({bytes:a,string:u},this,`cannot be missing both string and bytes ${JSON.stringify({string:u,bytes:a})}`);return encodeAddress(a)}compare(a,u){const l=h=>h.startsWith("tz"),f=l(a),c=l(u);return f&&!c?-1:c&&!f?1:super.compare(a,u)}findAndReturnTokens(a,u){return AddressToken.prim===a&&u.push(this),u}}AddressToken.prim="address";class MapValidationError extends TokenValidationError{constructor(a,u,l){super(a,u,l),this.value=a,this.token=u,this.name="MapValidationError"}}class MapToken extends Token{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}get ValueSchema(){return this.createToken(this.val.args[1],0)}get KeySchema(){return this.createToken(this.val.args[0],0)}validate(a){if(!MichelsonMap.isMichelsonMap(a))throw new MapValidationError(a,this,`Value ${JSON.stringify(a)} is not a valid MichelsonMap`)}Execute(a,u){const l=new MichelsonMap(this.val);return a.forEach(f=>{l.set(this.KeySchema.ToKey(f.args[0]),this.ValueSchema.Execute(f.args[1],u))}),l}objLitToMichelsonMap(a){return a instanceof MichelsonMap?a:typeof a=="object"?Object.keys(a).length===0?new MichelsonMap:MichelsonMap.fromLiteral(a):a}Encode(a){const u=this.objLitToMichelsonMap(a.pop());return this.validate(u),Array.from(u.keys()).sort((l,f)=>this.KeySchema.compare(l,f)).map(l=>({prim:"Elt",args:[this.KeySchema.EncodeObject(l),this.ValueSchema.EncodeObject(u.get(l))]}))}EncodeObject(a,u){const l=this.objLitToMichelsonMap(a);return this.validate(l),u&&u[MapToken.prim]?u[MapToken.prim](l):Array.from(l.keys()).sort((f,c)=>this.KeySchema.compare(f,c)).map(f=>({prim:"Elt",args:[this.KeySchema.EncodeObject(f),this.ValueSchema.EncodeObject(l.get(f))]}))}ExtractSchema(){return{map:{key:this.KeySchema.ExtractSchema(),value:this.ValueSchema.ExtractSchema()}}}generateSchema(){return{__michelsonType:MapToken.prim,schema:{key:this.KeySchema.generateSchema(),value:this.ValueSchema.generateSchema()}}}findAndReturnTokens(a,u){return MapToken.prim===a&&u.push(this),this.KeySchema.findAndReturnTokens(a,u),this.ValueSchema.findAndReturnTokens(a,u),u}}MapToken.prim="map";class BoolToken extends ComparableToken{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}Execute(a){return String(a.prim).toLowerCase()==="true"}Encode(a){return{prim:a.pop()?"True":"False"}}EncodeObject(a,u){return u&&u[BoolToken.prim]?u[BoolToken.prim](a):{prim:a?"True":"False"}}ExtractSchema(){return BoolToken.prim}generateSchema(){return{__michelsonType:BoolToken.prim,schema:BoolToken.prim}}ToBigMapKey(a){return{key:this.EncodeObject(a),type:{prim:BoolToken.prim}}}ToKey(a){return this.EncodeObject(a)}compare(a,u){return a&&u||!a&&!u?0:a?1:-1}findAndReturnTokens(a,u){return BoolToken.prim===a&&u.push(this),u}}BoolToken.prim="bool";class ContractValidationError extends TokenValidationError{constructor(a,u,l){super(a,u,l),this.value=a,this.token=u,this.name="ContractValidationError"}}class ContractToken extends Token{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}validate(a){if(validateAddress(a)!==ValidationResult.VALID)throw new ContractValidationError(a,this,`Value ${JSON.stringify(a)} is not a valid contract address.`);return null}Execute(a){if(a.string)return a.string;if(!a.bytes)throw new ContractValidationError(a,this,`Value ${JSON.stringify(a)} is not a valid contract address. must contain bytes or string.`);return encodeAddress(a.bytes)}Encode(a){const u=a.pop();return this.validate(u),{string:u}}EncodeObject(a,u){return this.validate(a),u&&u[ContractToken.prim]?u[ContractToken.prim](a):{string:a}}ExtractSchema(){return ContractToken.prim}generateSchema(){const a=this.createToken(this.val.args[0],0);return{__michelsonType:ContractToken.prim,schema:{parameter:this.val.args[0]?a.generateSchema():{}}}}findAndReturnTokens(a,u){return ContractToken.prim===a&&u.push(this),u}}ContractToken.prim="contract";class ListValidationError extends TokenValidationError{constructor(a,u,l){super(a,u,l),this.value=a,this.token=u,this.name="ListValidationError"}}class ListToken extends Token{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}get valueSchema(){return this.createToken(this.val.args[0],this.idx)}validate(a){if(!Array.isArray(a))throw new ListValidationError(a,this,`Value ${JSON.stringify(a)} is not a valid array`)}Encode(a){const u=a.pop();this.validate(u);const l=this.createToken(this.val.args[0],0);return u.reduce((f,c)=>[...f,l.EncodeObject(c)],[])}Execute(a,u){const l=this.createToken(this.val.args[0],0);return this.validate(a),a.reduce((f,c)=>[...f,l.Execute(c,u)],[])}EncodeObject(a,u){const l=this.createToken(this.val.args[0],0);return this.validate(a),u&&u[ListToken.prim]?u[ListToken.prim](a):a.reduce((f,c)=>[...f,l.EncodeObject(c)],[])}ExtractSchema(){return{[ListToken.prim]:this.valueSchema.ExtractSchema()}}generateSchema(){return{__michelsonType:ListToken.prim,schema:this.valueSchema.generateSchema()}}findAndReturnTokens(a,u){return ListToken.prim===a&&u.push(this),this.createToken(this.val.args[0],this.idx).findAndReturnTokens(a,u),u}}ListToken.prim="list";class MutezValidationError extends TokenValidationError{constructor(a,u,l){super(a,u,l),this.value=a,this.token=u,this.name="MutezValidationError"}}class MutezToken extends ComparableToken{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}Execute(a){return new BigNumber(a[Object.keys(a)[0]])}ExtractSchema(){return MutezToken.prim}generateSchema(){return{__michelsonType:MutezToken.prim,schema:MutezToken.prim}}validate(a){if(new BigNumber(a).isNaN())throw new MutezValidationError(a,this,`Value is not a number: ${a}`)}Encode(a){const u=a.pop();return this.validate(u),{int:String(u).toString()}}EncodeObject(a,u){return this.validate(a),u&&u[MutezToken.prim]?u[MutezToken.prim](a):{int:String(a).toString()}}ToBigMapKey(a){return{key:{int:String(a)},type:{prim:MutezToken.prim}}}ToKey({int:a}){return a}compare(a,u){const l=Number(a),f=Number(u);return l===f?0:l<f?-1:1}findAndReturnTokens(a,u){return MutezToken.prim===a&&u.push(this),u}}MutezToken.prim="mutez";class BytesValidationError extends TokenValidationError{constructor(a,u,l){super(a,u,l),this.value=a,this.token=u,this.name="BytesValidationError"}}class BytesToken extends ComparableToken{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}ToBigMapKey(a){return{key:{bytes:a},type:{prim:BytesToken.prim}}}validate(a){if(!(typeof a=="string"&&/^[0-9a-fA-F]*$/.test(a)&&a.length%2===0))throw new BytesValidationError(a,this,`Invalid bytes: ${a}`)}convertUint8ArrayToHexString(a){return a.constructor===Uint8Array?distExports.Buffer.from(a).toString("hex"):a}Encode(a){let u=a.pop();return u=stripHexPrefix$1(this.convertUint8ArrayToHexString(u)),this.validate(u),{bytes:String(u).toString()}}EncodeObject(a,u){return a=this.convertUint8ArrayToHexString(a),typeof a=="string"&&(a=stripHexPrefix$1(a)),this.validate(a),u&&u[BytesToken.prim]?u[BytesToken.prim](a):{bytes:String(a).toString()}}Execute(a){return a.bytes}ExtractSchema(){return BytesToken.prim}generateSchema(){return{__michelsonType:BytesToken.prim,schema:BytesToken.prim}}ToKey({bytes:a,string:u}){return u||a}findAndReturnTokens(a,u){return BytesToken.prim===a&&u.push(this),u}}BytesToken.prim="bytes";class OptionToken extends ComparableToken{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}subToken(){return this.createToken(this.val.args[0],this.idx)}schema(){return this.createToken(this.val.args[0],0)}annot(){return Array.isArray(this.val.annots)?super.annot():this.createToken(this.val.args[0],this.idx).annot()}Encode(a){const u=a;return u==null?{prim:"None"}:Array.isArray(u)&&(u[u.length-1]===void 0||u[u.length-1]===null)?(u.pop(),{prim:"None"}):{prim:"Some",args:[this.schema().Encode(a)]}}EncodeObject(a,u){let l=a;return l==null?{prim:"None"}:(l=typeof l=="object"&&"Some"in l?l.Some:l,{prim:"Some",args:[this.schema().EncodeObject(l,u)]})}Execute(a,u){return a.prim==="None"?null:{Some:this.schema().Execute(a.args[0],u)}}ExtractSchema(){return{Some:this.schema().ExtractSchema()}}generateSchema(){return{__michelsonType:OptionToken.prim,schema:this.schema().generateSchema()}}ExtractSignature(){return[...this.schema().ExtractSignature()]}get KeySchema(){return this.schema()}compare(a,u){if(a){if(!u)return 1}else return-1;return this.KeySchema.compare(a,u)}ToKey(a){return this.Execute(a)}ToBigMapKey(a){return{key:this.EncodeObject(a),type:this.typeWithoutAnnotations()}}findAndReturnTokens(a,u){return OptionToken.prim===a&&u.push(this),this.subToken().findAndReturnTokens(a,u),u}}OptionToken.prim="option";class TimestampToken extends ComparableToken{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}Execute(a){if(a.string&&/^\d+$/.test(a.string))return new Date(Number(a.string)*1e3).toISOString();if(a.string)return new Date(a.string).toISOString();if(a.int)return new Date(Number(a.int)*1e3).toISOString()}Encode(a){const u=a.pop();return typeof u=="number"?{int:String(u)}:{string:u}}EncodeObject(a,u){return u&&u[TimestampToken.prim]?u[TimestampToken.prim](a):typeof a=="number"?{int:String(a)}:{string:a}}ExtractSchema(){return TimestampToken.prim}generateSchema(){return{__michelsonType:TimestampToken.prim,schema:TimestampToken.prim}}ToKey({string:a}){return a}ToBigMapKey(a){return{key:{string:a},type:{prim:TimestampToken.prim}}}findAndReturnTokens(a,u){return TimestampToken.prim===a&&u.push(this),u}}TimestampToken.prim="timestamp";class IntValidationError extends TokenValidationError{constructor(a,u,l){super(a,u,l),this.value=a,this.token=u,this.name="IntValidationError"}}class IntToken extends ComparableToken{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}Execute(a){return new BigNumber(a[Object.keys(a)[0]])}ExtractSchema(){return IntToken.prim}generateSchema(){return{__michelsonType:IntToken.prim,schema:IntToken.prim}}validate(a){if(new BigNumber(a).isNaN())throw new IntValidationError(a,this,`Value is not a number: ${JSON.stringify(a)}`)}Encode(a){const u=a.pop();return this.validate(u),{int:new BigNumber(u).toFixed()}}EncodeObject(a,u){return this.validate(a),u&&u[IntToken.prim]?u[IntToken.prim](a):{int:new BigNumber(a).toFixed()}}ToBigMapKey(a){return{key:{int:String(a)},type:{prim:IntToken.prim}}}ToKey({int:a}){return a}compare(a,u){const l=Number(a),f=Number(u);return l===f?0:l<f?-1:1}findAndReturnTokens(a,u){return IntToken.prim===a&&u.push(this),u}}IntToken.prim="int";class UnitToken extends ComparableToken{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}Encode(a){return a.pop(),{prim:"Unit"}}EncodeObject(a,u){return u&&u[UnitToken.prim]?u[UnitToken.prim](a):{prim:"Unit"}}Execute(a){return UnitValue}ExtractSchema(){return UnitToken.prim}generateSchema(){return{__michelsonType:UnitToken.prim,schema:UnitToken.prim}}compare(a,u){return 0}ToKey(a){return UnitValue}ToBigMapKey(a){return{key:{prim:"Unit"},type:{prim:UnitToken.prim}}}findAndReturnTokens(a,u){return UnitToken.prim===a&&u.push(this),u}}UnitToken.prim="unit";const publicKeyPrefixLength=4;class KeyValidationError extends TokenValidationError{constructor(a,u,l){super(a,u,l),this.value=a,this.token=u,this.name="KeyValidationError"}}class KeyToken extends ComparableToken{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}Execute(a){return a.string?a.string:encodeKey(a.bytes)}validate(a){if(validatePublicKey(a)!==ValidationResult.VALID)throw new KeyValidationError(a,this,"Key is not valid")}Encode(a){const u=a.pop();return this.validate(u),{string:u}}EncodeObject(a,u){return this.validate(a),u&&u[KeyToken.prim]?u[KeyToken.prim](a):{string:a}}ExtractSchema(){return KeyToken.prim}generateSchema(){return{__michelsonType:KeyToken.prim,schema:KeyToken.prim}}ToKey(a){return this.Execute(a)}ToBigMapKey(a){return{key:{string:a},type:{prim:KeyToken.prim}}}compare(a,u){const l=this.getPrefix(a),f=this.getPrefix(u);if(l===Prefix.EDPK&&f!==Prefix.EDPK)return-1;if(l===Prefix.SPPK&&f!==Prefix.SPPK)return f===Prefix.EDPK?1:-1;if(l===Prefix.P2PK){if(f!==Prefix.P2PK)return 1;const c=this.getP256PublicKeyComparableBytes(a),h=this.getP256PublicKeyComparableBytes(u);return distExports.Buffer.compare(c,h)}return super.compare(a,u)}getPrefix(a){return a.substring(0,publicKeyPrefixLength)}getP256PublicKeyComparableBytes(a){return b58cdecode(a,prefix[Prefix.P2PK]).slice(1)}findAndReturnTokens(a,u){return KeyToken.prim===a&&u.push(this),u}}KeyToken.prim="key";class KeyHashValidationError extends TokenValidationError{constructor(a,u,l){super(a,u,l),this.value=a,this.token=u,this.name="KeyHashValidationError"}}class KeyHashToken extends ComparableToken{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}Execute(a){return a.string?a.string:encodeKeyHash(a.bytes)}validate(a){if(validateKeyHash(a)!==ValidationResult.VALID)throw new KeyHashValidationError(a,this,`KeyHash is not valid: ${JSON.stringify(a)}`)}Encode(a){const u=a.pop();return this.validate(u),{string:u}}EncodeObject(a,u){return this.validate(a),u&&u[KeyHashToken.prim]?u[KeyHashToken.prim](a):{string:a}}ExtractSchema(){return KeyHashToken.prim}generateSchema(){return{__michelsonType:KeyHashToken.prim,schema:KeyHashToken.prim}}ToKey({string:a,bytes:u}){return a||encodeKeyHash(u)}ToBigMapKey(a){return{key:{string:a},type:{prim:KeyHashToken.prim}}}findAndReturnTokens(a,u){return KeyHashToken.prim===a&&u.push(this),u}}KeyHashToken.prim="key_hash";class SignatureValidationError extends TokenValidationError{constructor(a,u,l){super(a,u,l),this.value=a,this.token=u,this.name="SignatureValidationError"}}class SignatureToken extends ComparableToken{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}Execute(a){return a.string?a.string:a.bytes}validate(a){if(validateSignature(a)!==ValidationResult.VALID)throw new SignatureValidationError(a,this,"Signature is not valid")}Encode(a){const u=a.pop();return this.validate(u),{string:u}}EncodeObject(a,u){return this.validate(a),u&&u[SignatureToken.prim]?u[SignatureToken.prim](a):{string:a}}ExtractSchema(){return SignatureToken.prim}generateSchema(){return{__michelsonType:SignatureToken.prim,schema:SignatureToken.prim}}ToKey(a){return this.Execute(a)}ToBigMapKey(a){return{key:{string:a},type:{prim:SignatureToken.prim}}}findAndReturnTokens(a,u){return SignatureToken.prim===a&&u.push(this),u}}SignatureToken.prim="signature";class LambdaToken extends Token{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}get paramSchema(){return this.createToken(this.val.args[0],this.idx)}get returnSchema(){return this.createToken(this.val.args[1],this.idx+1)}Execute(a){return a.string?a.string:a}Encode(a){return a.pop()}EncodeObject(a,u){return u&&u[LambdaToken.prim]?u[LambdaToken.prim](a):a}ExtractSchema(){return{[LambdaToken.prim]:{parameters:this.paramSchema.ExtractSchema(),returns:this.returnSchema.ExtractSchema()}}}generateSchema(){return{__michelsonType:LambdaToken.prim,schema:{parameters:this.paramSchema.generateSchema(),returns:this.returnSchema.generateSchema()}}}findAndReturnTokens(a,u){return LambdaToken.prim===a&&u.push(this),this.createToken(this.val.args[0],this.idx).findAndReturnTokens(a,u),this.createToken(this.val.args[1],this.idx).findAndReturnTokens(a,u),u}}LambdaToken.prim="lambda";class OperationToken extends Token{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}Execute(a){return a.string}Encode(...a){return{string:a.pop()}}EncodeObject(a,u){return u&&u[OperationToken.prim]?u[OperationToken.prim](a):{string:a}}ExtractSchema(){return OperationToken.prim}generateSchema(){return{__michelsonType:OperationToken.prim,schema:OperationToken.prim}}findAndReturnTokens(a,u){return OperationToken.prim===a&&u.push(this),u}}OperationToken.prim="operation";class SetValidationError extends TokenValidationError{constructor(a,u,l){super(a,u,l),this.value=a,this.token=u,this.name="SetValidationError"}}class SetToken extends Token{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}get KeySchema(){return this.createToken(this.val.args[0],0)}validate(a){if(!Array.isArray(a))throw new SetValidationError(a,this,`Value ${JSON.stringify(a)} is not an array`)}Encode(a){const u=a.pop();return this.validate(u),u.sort((l,f)=>this.KeySchema.compare(l,f)).reduce((l,f)=>[...l,this.KeySchema.EncodeObject(f)],[])}Execute(a,u){return a.reduce((l,f)=>[...l,this.KeySchema.Execute(f,u)],[])}EncodeObject(a,u){return this.validate(a),u&&u[SetToken.prim]?u[SetToken.prim](a):a.sort((l,f)=>this.KeySchema.compare(l,f)).reduce((l,f)=>[...l,this.KeySchema.EncodeObject(f)],[])}ExtractSchema(){return SetToken.prim}generateSchema(){return{__michelsonType:SetToken.prim,schema:this.KeySchema.generateSchema()}}findAndReturnTokens(a,u){return SetToken.prim===a&&u.push(this),this.KeySchema.findAndReturnTokens(a,u),u}}SetToken.prim="set";class ChainIDValidationError extends TokenValidationError{constructor(a,u,l){super(a,u,l),this.value=a,this.token=u,this.name="ChainIDValidationError"}}class ChainIDToken extends ComparableToken{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}validate(a){if(validateChain(a)!==ValidationResult.VALID)throw new ChainIDValidationError(a,this,`Value ${JSON.stringify(a)} is not a valid ChainID`)}Execute(a){return a[Object.keys(a)[0]]}ExtractSchema(){return ChainIDToken.prim}generateSchema(){return{__michelsonType:ChainIDToken.prim,schema:ChainIDToken.prim}}Encode(a){const u=a.pop();return this.validate(u),{string:u}}EncodeObject(a,u){return this.validate(a),u&&u[ChainIDToken.prim]?u[ChainIDToken.prim](a):{string:a}}ToKey({string:a}){return a}ToBigMapKey(a){return{key:{string:a},type:{prim:ChainIDToken.prim}}}findAndReturnTokens(a,u){return ChainIDToken.prim===a&&u.push(this),u}}ChainIDToken.prim="chain_id";class EncodeTicketError extends TaquitoError{constructor(){super(),this.name="TicketEncodeError",this.message="Tickets cannot be sent to the blockchain; they are created on-chain"}}const ticketerType$1={prim:"contract"},amountType$1={prim:"int"};class TicketToken extends Token{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}get valueToken(){return this.createToken(this.val.args[0],this.idx)}Encode(a){throw new EncodeTicketError}EncodeObject(a,u){if(u&&u[TicketToken.prim])return u[TicketToken.prim](a,this.val);throw new EncodeTicketError}Execute(a,u){if(u&&u[TicketToken.prim])return u[TicketToken.prim](a,this.val);const l=this.createToken(ticketerType$1,this.idx),f=this.valueToken,c=this.createToken(amountType$1,this.idx);return a.args[2]===void 0&&a.args[1].args!==void 0?{ticketer:l.Execute(a.args[0],u),value:f.Execute(a.args[1].args[0],u),amount:c.Execute(a.args[1].args[1],u)}:{ticketer:l.Execute(a.args[0],u),value:f.Execute(a.args[1],u),amount:c.Execute(a.args[2],u)}}ExtractSchema(){return{ticketer:ContractToken.prim,value:this.valueToken.ExtractSchema(),amount:IntToken.prim}}generateSchema(){return{__michelsonType:TicketToken.prim,schema:{value:this.valueToken.generateSchema(),ticketer:{__michelsonType:ContractToken.prim,schema:ContractToken.prim},amount:{__michelsonType:IntToken.prim,schema:IntToken.prim}}}}findAndReturnTokens(a,u){return TicketToken.prim===a&&u.push(this),this.valueToken.findAndReturnTokens(a,u),u}}TicketToken.prim="ticket";class EncodeTicketDeprecatedError extends TaquitoError{constructor(){super(),this.name="TicketDeprecatedEncodeError",this.message="Ticket_deprecated cannot be sent to the blockchain; they are created on-chain"}}const ticketerType={prim:"contract"},amountType={prim:"int"};class TicketDeprecatedToken extends Token{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}get valueToken(){return this.createToken(this.val.args[0],this.idx)}Encode(a){throw new EncodeTicketDeprecatedError}EncodeObject(a,u){if(u&&u[TicketDeprecatedToken.prim])return u[TicketDeprecatedToken.prim](a,this.val);throw new EncodeTicketDeprecatedError}Execute(a,u){if(u&&u[TicketDeprecatedToken.prim])return u[TicketDeprecatedToken.prim](a,this.val);const l=this.createToken(ticketerType,this.idx),f=this.valueToken,c=this.createToken(amountType,this.idx);return a.args[2]===void 0&&a.args[1].args!==void 0?{ticketer:l.Execute(a.args[0],u),value:f.Execute(a.args[1].args[0],u),amount:c.Execute(a.args[1].args[1],u)}:{ticketer:l.Execute(a.args[0],u),value:f.Execute(a.args[1],u),amount:c.Execute(a.args[2],u)}}ExtractSchema(){return{ticketer:ContractToken.prim,value:this.valueToken.ExtractSchema(),amount:IntToken.prim}}generateSchema(){return{__michelsonType:TicketDeprecatedToken.prim,schema:{value:this.valueToken.generateSchema(),ticketer:{__michelsonType:ContractToken.prim,schema:ContractToken.prim},amount:{__michelsonType:IntToken.prim,schema:IntToken.prim}}}}findAndReturnTokens(a,u){return TicketDeprecatedToken.prim===a&&u.push(this),this.valueToken.findAndReturnTokens(a,u),u}}TicketDeprecatedToken.prim="ticket_deprecated";class NeverTokenError extends TokenValidationError{constructor(a,u,l){super(a,u,l),this.value=a,this.token=u,this.name="NeverTokenError"}}class NeverToken extends Token{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}Encode(a){const u=a.pop();throw new NeverTokenError(u,this,`Assigning a value to the type never is forbidden. Trying to assign ${JSON.stringify(u)}.`)}EncodeObject(a,u){if(u&&u[NeverToken.prim])return u[NeverToken.prim](a);throw new NeverTokenError(a,this,`Assigning a value to the type never is forbidden. Trying to assign ${JSON.stringify(a)}.`)}Execute(a){throw new NeverTokenError(a,this,`There is no literal value for the type never. Trying to execute ${JSON.stringify(a)}.`)}ExtractSchema(){return NeverToken.prim}generateSchema(){return{__michelsonType:NeverToken.prim,schema:NeverToken.prim}}findAndReturnTokens(a,u){return NeverToken.prim===a&&u.push(this),u}}NeverToken.prim="never";class SaplingStateValidationError extends TokenValidationError{constructor(a,u,l){super(a,u,l),this.value=a,this.token=u,this.name="SaplingStateValidationError"}}class SaplingStateToken extends Token{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}isValid(a){return typeof a=="object"&&Object.keys(a).length===0}Execute(a,u){if(u&&u[SaplingStateToken.prim])return u[SaplingStateToken.prim](a,this.val);if("int"in a)return a.int;throw new SaplingStateValidationError(a,this,`Sapling state is expecting an object with an int property. Got ${JSON.stringify(a)}`)}Encode(a){const u=a.pop();if(this.isValid(u))return[];throw new SaplingStateValidationError(u,this,`Invalid sapling_state. Received: ${JSON.stringify(u)} while expecting: {}`)}EncodeObject(a,u){if(u&&u[SaplingStateToken.prim])return u[SaplingStateToken.prim](a);if(this.isValid(a))return[];throw new SaplingStateValidationError(a,this,`Invalid sapling_state. Received: ${JSON.stringify(a)} while expecting: {}`)}ExtractSchema(){return{[SaplingStateToken.prim]:{"memo-size":Number(this.val.args[0].int)}}}generateSchema(){return{__michelsonType:SaplingStateToken.prim,schema:{memoSize:this.val.args[0].int}}}findAndReturnTokens(a,u){return SaplingStateToken.prim===a&&u.push(this),u}}SaplingStateToken.prim="sapling_state";class SaplingTransactionValidationError extends TokenValidationError{constructor(a,u,l){super(a,u,l),this.value=a,this.token=u,this.name="SaplingTransactionValidationError"}}class SaplingTransactionToken extends Token{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}Execute(a){throw new SaplingTransactionValidationError(a,this,`There is no literal value for the sapling_transaction type. Got: ${JSON.stringify(a)}.`)}validateBytes(a){const u=/^(0x|0X)?([0-9a-fA-F]*$)/.exec(a);if(u&&u[2].length%2===0)return u[2];throw new SaplingTransactionValidationError(a,this,`Invalid bytes: ${JSON.stringify(a)}`)}convertUint8ArrayToHexString(a){return a.constructor===Uint8Array?distExports.Buffer.from(a).toString("hex"):a}Encode(a){let u=a.pop();return u=this.validateBytes(this.convertUint8ArrayToHexString(u)),{bytes:String(u).toString()}}EncodeObject(a,u){return a=this.validateBytes(this.convertUint8ArrayToHexString(a)),u&&u[SaplingTransactionToken.prim]?u[SaplingTransactionToken.prim](a):{bytes:String(a).toString()}}ExtractSchema(){return{[SaplingTransactionToken.prim]:{"memo-size":Number(this.val.args[0].int)}}}generateSchema(){return{__michelsonType:SaplingTransactionToken.prim,schema:{memoSize:this.val.args[0].int}}}findAndReturnTokens(a,u){return SaplingTransactionToken.prim===a&&u.push(this),u}}SaplingTransactionToken.prim="sapling_transaction";class SaplingTransactionDeprecatedValidationError extends TokenValidationError{constructor(a,u,l){super(a,u,l),this.value=a,this.token=u,this.name="SaplingTransactionDeprecatedValidationError"}}class SaplingTransactionDeprecatedToken extends Token{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}Execute(a){throw new SaplingTransactionDeprecatedValidationError(a,this,`There is no literal value for the sapling_transaction_deprecated type. Got: ${JSON.stringify(a)}.`)}validateBytes(a){const u=/^(0x|0X)?([0-9a-fA-F]*$)/.exec(a);if(u&&u[2].length%2===0)return u[2];throw new SaplingTransactionDeprecatedValidationError(a,this,`Invalid bytes: ${JSON.stringify(a)}`)}convertUint8ArrayToHexString(a){return a.constructor===Uint8Array?distExports.Buffer.from(a).toString("hex"):a}Encode(a){let u=a.pop();return u=this.validateBytes(this.convertUint8ArrayToHexString(u)),{bytes:String(u).toString()}}EncodeObject(a,u){return a=this.validateBytes(this.convertUint8ArrayToHexString(a)),u&&u[SaplingTransactionDeprecatedToken.prim]?u[SaplingTransactionDeprecatedToken.prim](a):{bytes:String(a).toString()}}ExtractSchema(){return{[SaplingTransactionDeprecatedToken.prim]:{"memo-size":Number(this.val.args[0].int)}}}generateSchema(){return{__michelsonType:SaplingTransactionDeprecatedToken.prim,schema:{memoSize:this.val.args[0].int}}}findAndReturnTokens(a,u){return SaplingTransactionDeprecatedToken.prim===a&&u.push(this),u}}SaplingTransactionDeprecatedToken.prim="sapling_transaction_deprecated";class Bls12381frValidationError extends TokenValidationError{constructor(a,u,l){super(a,u,l),this.value=a,this.token=u,this.name="Bls12381frValidationError"}}class Bls12381frToken extends Token{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}validate(a){if(!(/^[0-9a-fA-F]*$/.test(a)&&a.length%2===0))throw new Bls12381frValidationError(a,this,`Invalid bytes: ${JSON.stringify(a)}`)}convertUint8ArrayToHexString(a){return a.constructor===Uint8Array?distExports.Buffer.from(a).toString("hex"):a}Encode(a){let u=a.pop();return typeof u=="number"?{int:u.toString()}:(u=this.convertUint8ArrayToHexString(u),this.validate(u),{bytes:u})}EncodeObject(a,u){return u&&u[Bls12381frToken.prim]?u[Bls12381frToken.prim](a):typeof a=="number"?{int:a.toString()}:(a=this.convertUint8ArrayToHexString(a),this.validate(a),{bytes:a})}Execute(a){return a.bytes}ExtractSchema(){return Bls12381frToken.prim}generateSchema(){return{__michelsonType:Bls12381frToken.prim,schema:Bls12381frToken.prim}}findAndReturnTokens(a,u){return Bls12381frToken.prim===a&&u.push(this),u}}Bls12381frToken.prim="bls12_381_fr";class Bls12381g1ValidationError extends TokenValidationError{constructor(a,u,l){super(a,u,l),this.value=a,this.token=u,this.name="Bls12381g1ValidationError"}}class Bls12381g1Token extends Token{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}validate(a){if(!(/^[0-9a-fA-F]*$/.test(a)&&a.length%2===0))throw new Bls12381g1ValidationError(a,this,`Invalid bytes: ${JSON.stringify(a)}`)}convertUint8ArrayToHexString(a){return a.constructor===Uint8Array?distExports.Buffer.from(a).toString("hex"):a}Encode(a){let u=a.pop();return u=this.convertUint8ArrayToHexString(u),this.validate(u),{bytes:u}}EncodeObject(a,u){return a=this.convertUint8ArrayToHexString(a),this.validate(a),u&&u[Bls12381g1Token.prim]?u[Bls12381g1Token.prim](a):{bytes:a}}Execute(a){return a.bytes}ExtractSchema(){return Bls12381g1Token.prim}generateSchema(){return{__michelsonType:Bls12381g1Token.prim,schema:Bls12381g1Token.prim}}findAndReturnTokens(a,u){return Bls12381g1Token.prim===a&&u.push(this),u}}Bls12381g1Token.prim="bls12_381_g1";class Bls12381g2ValidationError extends TokenValidationError{constructor(a,u,l){super(a,u,l),this.value=a,this.token=u,this.name="Bls12381g2ValidationError"}}class Bls12381g2Token extends Token{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}validate(a){if(!(/^[0-9a-fA-F]*$/.test(a)&&a.length%2===0))throw new Bls12381g2ValidationError(a,this,`Invalid bytes: ${JSON.stringify(a)}`)}convertUint8ArrayToHexString(a){return a.constructor===Uint8Array?distExports.Buffer.from(a).toString("hex"):a}Encode(a){let u=a.pop();return u=this.convertUint8ArrayToHexString(u),this.validate(u),{bytes:u}}EncodeObject(a,u){return a=this.convertUint8ArrayToHexString(a),this.validate(a),u&&u[Bls12381g2Token.prim]?u[Bls12381g2Token.prim](a):{bytes:a}}Execute(a){return a.bytes}ExtractSchema(){return Bls12381g2Token.prim}generateSchema(){return{__michelsonType:Bls12381g2Token.prim,schema:Bls12381g2Token.prim}}findAndReturnTokens(a,u){return Bls12381g2Token.prim===a&&u.push(this),u}}Bls12381g2Token.prim="bls12_381_g2";class ChestValidationError extends TokenValidationError{constructor(a,u,l){super(a,u,l),this.value=a,this.token=u,this.name="ChestValidationError"}}class ChestToken extends Token{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}validate(a){if(!(/^[0-9a-fA-F]*$/.test(a)&&a.length%2==0))throw new ChestValidationError(a,this,`Invalid bytes: ${JSON.stringify(a)}`)}convertUint8ArrayToHexString(a){return a.constructor===Uint8Array?distExports.Buffer.from(a).toString("hex"):a}Encode(a){let u=a.pop();return u=this.convertUint8ArrayToHexString(u),this.validate(u),{bytes:u}}EncodeObject(a,u){return a=this.convertUint8ArrayToHexString(a),this.validate(a),u&&u[ChestToken.prim]?u[ChestToken.prim](a):{bytes:a}}Execute(a){return a.bytes}ExtractSchema(){return ChestToken.prim}generateSchema(){return{__michelsonType:ChestToken.prim,schema:ChestToken.prim}}findAndReturnTokens(a,u){return ChestToken.prim===a&&u.push(this),u}}ChestToken.prim="chest";class ChestKeyValidationError extends TokenValidationError{constructor(a,u,l){super(a,u,l),this.value=a,this.token=u,this.name="ChestKeyValidationError"}}class ChestKeyToken extends Token{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}validate(a){if(!(/^[0-9a-fA-F]*$/.test(a)&&a.length%2===0))throw new ChestKeyValidationError(a,this,`Invalid bytes: ${JSON.stringify(a)}`)}convertUint8ArrayToHexString(a){return a.constructor===Uint8Array?distExports.Buffer.from(a).toString("hex"):a}Encode(a){let u=a.pop();return u=this.convertUint8ArrayToHexString(u),this.validate(u),{bytes:u}}EncodeObject(a,u){return a=this.convertUint8ArrayToHexString(a),this.validate(a),u&&u[ChestKeyToken.prim]?u[ChestKeyToken.prim](a):{bytes:a}}Execute(a){return a.bytes}ExtractSchema(){return ChestKeyToken.prim}generateSchema(){return{__michelsonType:ChestKeyToken.prim,schema:ChestKeyToken.prim}}findAndReturnTokens(a,u){return ChestKeyToken.prim===a&&u.push(this),u}}ChestKeyToken.prim="chest_key";class GlobalConstantEncodingError extends TokenValidationError{constructor(a,u,l){super(a,u,l),this.value=a,this.token=u,this.name="GlobalConstantEncodingError"}}class GlobalConstantDecodingError extends TokenValidationError{constructor(a,u,l){super(a,u,l),this.value=a,this.token=u,this.name="GlobalConstantDecodingError"}}class GlobalConstantToken extends Token{constructor(a,u,l){super(a,u,l),this.val=a,this.idx=u,this.fac=l}Execute(a,u){if(u&&u[GlobalConstantToken.prim])return u[GlobalConstantToken.prim](a,this.val);throw new GlobalConstantDecodingError(a,this,`Unable to decode a value represented by a global constants. Please provide an expanded script to the Michelson-Encoder or semantics for the decoding. The following global constant hash was encountered: ${this.val.args[0].string}.`)}Encode(a){throw new GlobalConstantEncodingError(a,this,`Unable to encode a script containing global constants. Please provide an expanded script to the Michelson-Encoder. The following global constant hash was encountered: ${this.val.args[0].string}.`)}EncodeObject(a,u){if(u&&u[GlobalConstantToken.prim])return u[GlobalConstantToken.prim](a);throw new GlobalConstantEncodingError(a,this,`Unable to encode a script containing global constants. Please provide an expanded script to the Michelson-Encoder. The following global constant hash was encountered: ${this.val.args[0].string}.`)}ExtractSchema(){return GlobalConstantToken.prim}generateSchema(){return{__michelsonType:GlobalConstantToken.prim,schema:{hash:this.val.args[0].string}}}findAndReturnTokens(a,u){return GlobalConstantToken.prim===a&&u.push(this),u}}GlobalConstantToken.prim="constant";const tokens=[PairToken,NatToken,StringToken,BigMapToken,AddressToken,MapToken,BoolToken,OrToken,ContractToken,ListToken,MutezToken,BytesToken,OptionToken,TimestampToken,IntToken,UnitToken,KeyToken,KeyHashToken,SignatureToken,LambdaToken,OperationToken,SetToken,ChainIDToken,TicketToken,TicketDeprecatedToken,NeverToken,SaplingStateToken,SaplingTransactionToken,SaplingTransactionDeprecatedToken,Bls12381frToken,Bls12381g1Token,Bls12381g2Token,ChestToken,ChestKeyToken,GlobalConstantToken];class InvalidTokenError extends TaquitoError{constructor(a,u){super(a),this.message=a,this.data=u,this.name="Invalid token error"}}function createToken(s,a,u){if(Array.isArray(s))return new PairToken(s,a,createToken,u);const l=tokens.find(f=>f.prim===s.prim);if(!l)throw new InvalidTokenError(`Malformed data: ${JSON.stringify(s)}. Expected a value with a valid prim property`,s);return new l(s,a,createToken,u)}class ParameterEncodingError extends InvalidViewParameterError{constructor(a,u,l,f){super(a,u,l,f),this.viewName=a,this.sigs=u,this.args=l,this.cause=f,this.name="ParameterEncodingError",this.message=`Could not encode parameter ${JSON.stringify(l)} received for name "${a}" expecting one of the following signatures ${JSON.stringify(u)}`}}class InvalidScriptError extends TaquitoError{constructor(a,u){super(),this.script=a,this.reason=u,this.name="InvalidScriptError";let l="Invalid on-chain view found in the following script.";u&&(l+=` Reason: ${u}.`),l+=`Script: ${JSON.stringify(a)}`,this.message=l}}class InvalidRpcResponseError extends TaquitoError{constructor(a,u){super(),this.script=a,this.reason=u,this.name="InvalidRpcResponseError";let l="Invalid RPC response passed as argument(s).";u&&(l+=` Reason: ${u}.`),l+=` Received: ${JSON.stringify(a)}`,this.message=l}}class InvalidBigMapSchemaError extends TaquitoError{constructor(a){super(a),this.message=a,this.name="InvalidBigMapSchemaError"}}class InvalidBigMapDiffError extends TaquitoError{constructor(a,u){super(a),this.message=a,this.value=u,this.name="InvalidBigMapDiffError"}}class BigMapEncodingError extends TaquitoError{constructor(a,u,l,f){super(),this.details=u,this.schema=l,this.value=f,this.name="BigMapEncodingError",this.message=`Unable to encode the big map ${a}. Schema is: ${JSON.stringify(l)}. The ${a} is: ${JSON.stringify(f)}. Error details: ${u}`}}class StorageEncodingError extends TaquitoError{constructor(a,u,l,f,c){super(),this.details=u,this.schema=l,this.value=f,this.semantics=c,this.name="StorageEncodingError",this.message=`Unable to encode ${a}. The schema is: ${JSON.stringify(l)}, the value is: ${JSON.stringify(f)}.${c?`And the semantic is: ${JSON.stringify(c)}`:""}. Error details: ${u}`}}class MissingArgumentError extends TaquitoError{constructor(a){super(a),this.message=a,this.name="MissingArgumentError"}}var _a$2;const schemaTypeSymbol=Symbol.for("taquito-schema-type-symbol");function collapse(s,a=PairToken.prim){var u,l;if(Array.isArray(s))return collapse({prim:a,args:s},a);const f=s;return f.prim===a&&f.args&&f.args.length>2?Object.assign(Object.assign({},f),{args:[(u=f.args)===null||u===void 0?void 0:u[0],{prim:a,args:(l=f.args)===null||l===void 0?void 0:l.slice(1)}]}):f}function deepEqual(s,a){if(s===void 0||a===void 0)return s===a;const u=collapse(s),l=collapse(a);return u.prim===l.prim&&(u.args===void 0&&l.args===void 0||u.args!==void 0&&l.args!==void 0&&u.args.length===l.args.length&&u.args.every((f,c)=>{var h,p;return deepEqual(f,(p=(h=l.args)===null||h===void 0?void 0:h[c])!==null&&p!==void 0?p:{})}))&&(u.annots===void 0&&l.annots===void 0||u.annots!==void 0&&l.annots!==void 0&&u.annots.length===l.annots.length&&u.annots.every((f,c)=>{var h;return f===((h=l.annots)===null||h===void 0?void 0:h[c])}))}class Schema{static isSchema(a){return a&&a[schemaTypeSymbol]===!0}static fromRPCResponse(a){if(!a)throw new InvalidRpcResponseError(a,"the RPC response is empty");if(!a.script)throw new InvalidRpcResponseError(a,"the RPC response has no script");if(!Array.isArray(a.script.code))throw new InvalidRpcResponseError(a,"The response.script.code should be an array");let u=a.script.code;for(;u.length===1&&Array.isArray(u[0]);)u=u[0];const l=u.find(f=>"prim"in f&&f.prim==="storage");if(!l||!Array.isArray(l.args))throw new InvalidRpcResponseError(a,'The response.script.code has an element of type {prim: "storage"}, but its args is not an array');return new Schema(l.args[0])}isExpressionExtended(a){return"prim"in a&&Array.isArray(a.args)}constructor(a){if(this.val=a,this[_a$2]=!0,this.root=createToken(a,0),this.root instanceof BigMapToken)this.bigMap=this.root;else if(this.isExpressionExtended(a)&&a.prim==="pair"){const u=a.args[0];this.isExpressionExtended(u)&&u.prim==="big_map"&&(this.bigMap=new BigMapToken(u,0,createToken))}}removeTopLevelAnnotation(a){return(this.root instanceof PairToken||this.root instanceof OrToken)&&this.root.hasAnnotations()&&typeof a=="object"&&Object.keys(a).length===1?a[Object.keys(a)[0]]:a}Execute(a,u){const l=this.root.Execute(a,u);return this.removeTopLevelAnnotation(l)}Typecheck(a){this.root instanceof BigMapToken&&Number.isInteger(Number(a))||this.root instanceof TicketToken&&a.ticketer&&a.value&&a.amount||this.root instanceof TicketDeprecatedToken&&a.ticketer&&a.value&&a.amount||this.root instanceof MapToken&&this.root.ValueSchema instanceof BigMapToken||this.root.EncodeObject(a)}ExecuteOnBigMapDiff(a,u){if(!this.bigMap)throw new InvalidBigMapSchemaError("Big map schema is undefined");if(!Array.isArray(a))throw new InvalidBigMapDiffError(`Big map diff must be an array, got: ${JSON.stringify(a)}`,a);const l=a.map(({key:f,value:c})=>({args:[f,c]}));return this.bigMap.Execute(l,u)}ExecuteOnBigMapValue(a,u){if(!this.bigMap)throw new InvalidBigMapSchemaError("Big map schema is undefined");return this.bigMap.ValueSchema.Execute(a,u)}EncodeBigMapKey(a){if(!this.bigMap)throw new InvalidBigMapSchemaError("Big map schema is undefined");try{return this.bigMap.KeySchema.ToBigMapKey(a)}catch(u){throw new BigMapEncodingError("key",u,this.bigMap.KeySchema,a)}}Encode(a,u){try{return this.root.EncodeObject(a,u)}catch(l){throw l instanceof TokenValidationError?l:new StorageEncodingError("storage object",l,this.root,a,u)}}ExtractSchema(){return this.removeTopLevelAnnotation(this.root.ExtractSchema())}generateSchema(){return this.removeTopLevelAnnotation(this.root.generateSchema())}ComputeState(a,u){if(!this.bigMap)throw new InvalidBigMapSchemaError("Big map schema is undefined");const l=a.reduce((f,c)=>Object.assign(Object.assign({},f),this.ExecuteOnBigMapDiff(c.contents[0].metadata.operation_result.big_map_diff)),{});return Object.assign(Object.assign({},this.Execute(u)),{[this.bigMap.annot()]:l})}FindFirstInTopLevelPair(a,u){return this.findValue(this.root.val,a,u)}findValue(a,u,l){if(deepEqual(l,a))return u;if(Array.isArray(a)||a.prim==="pair"){const f=collapse(a),c=collapse(u,"Pair");if(f.args===void 0||c.args===void 0)throw new MissingArgumentError("Tokens have no arguments");if(f.args[0])return this.findValue(f.args[0],c.args[0],l)||this.findValue(f.args[1],c.args[1],l)}}findToken(a){const u=[];return this.root.findAndReturnTokens(a,u)}}_a$2=schemaTypeSymbol;class ParameterSchema{static fromRPCResponse(a){if(!a)throw new InvalidRpcResponseError(a,"the RPC response is empty");if(!a.script)throw new InvalidRpcResponseError(a,"the RPC response has no script");if(!Array.isArray(a.script.code))throw new InvalidRpcResponseError(a,"The response.script.code should be an array");const u=a.script.code.find(l=>"prim"in l&&l.prim==="parameter");if(!u)throw new InvalidRpcResponseError(a,'The response.script.code should have an element of type {prim: "parameter"}');if(!Array.isArray(u.args))throw new InvalidRpcResponseError(a,'The response.script.code has an element of type {prim: "parameter"}, but its args is not an array');return new ParameterSchema(u.args[0])}get isMultipleEntryPoint(){return this.root instanceof OrToken||this.root instanceof OptionToken&&this.root.subToken()instanceof OrToken}get hasAnnotation(){return this.isMultipleEntryPoint?Object.keys(this.ExtractSchema())[0]!=="0":!0}constructor(a){this.root=createToken(a,0)}Execute(a,u){return this.root.Execute(a,u)}Encode(...a){try{return this.root.Encode(a.reverse())}catch(u){throw u instanceof TokenValidationError?u:new ParameterEncodingError("Unable to encode parameter",this.root,a,u)}}EncodeObject(a,u){try{return this.root.EncodeObject(a,u)}catch(l){throw l instanceof TokenValidationError?l:new ParameterEncodingError("Unable to encode parameter object",this.root,a,l)}}ExtractSchema(){return this.root.ExtractSchema()}generateSchema(){return this.root.generateSchema()}ExtractSignatures(){return this.root.ExtractSignature()}}class ViewSchema{static fromRPCResponse(a){const u=[],l=a&&a.script&&Array.isArray(a.script.code)&&a.script.code.filter(f=>f.prim==="view");return l&&l.forEach(f=>{u.push(new ViewSchema(f.args))}),u}constructor(a){if(!a)throw new InvalidScriptError(a,"the args are not defined");if(a.length!==4)throw new InvalidScriptError(a,"there should be exactly 4 arguments");if(!("string"in a[0])||!a[0].string)throw new InvalidScriptError(a,"The first argument should be a string, representing the view name. It should be in the form: { string: 'viewName' }");this.viewName=a[0].string,this.viewArgsType=a[1],this.viewReturnType=a[2],this.instructions=a[3],this.rootArgsType=createToken(this.viewArgsType,0),this.rootReturnType=createToken(this.viewReturnType,0)}encodeViewArgs(a){try{return this.rootArgsType.EncodeObject(a)}catch(u){throw new ParameterEncodingError(this.viewName,void 0,a,u)}}decodeViewResult(a,u){return this.rootReturnType.Execute(a,u)}extractArgsSchema(){return this.rootArgsType.ExtractSchema()}extractResultSchema(){return this.rootReturnType.ExtractSchema()}}class EventSchema{constructor(a,u){this.tag=a,this.type=u}static fromMichelineValue(a){var u,l;return new EventSchema((u=a.annots)===null||u===void 0?void 0:u[0],(l=a.args)===null||l===void 0?void 0:l[0])}static fromRPCResponse(a){const u=[];return a.script.code.forEach(l=>{!("prim"in l)||l.prim!=="code"||!("args"in l)||!l.args||u.push(...EventSchema.extractEventsRecursively(l.args))}),EventSchema.removeDuplicates(u)}static removeDuplicates(a){const u=[];return a.forEach(l=>{u.findIndex(c=>c.tag===l.tag&&deepEqual(c.type,l.type))===-1&&u.push(l)}),u}static extractEventsRecursively(a){return Array.isArray(a)?a.flatMap(u=>EventSchema.extractEventsRecursively(u)):"prim"in a?a.prim==="EMIT"?[EventSchema.fromMichelineValue(a)]:!("args"in a)||!a.args?[]:a.args.flatMap(u=>EventSchema.extractEventsRecursively(u)):[]}}const UnitValue=Symbol(),sourceReference=Symbol("source_reference");class ScanError extends TaquitoError{constructor(a,u,l){super(),this.src=a,this.idx=u,this.message=l,this.name="ScanError"}}var Literal;(function(s){s[s.Comment=0]="Comment",s[s.Number=1]="Number",s[s.String=2]="String",s[s.Bytes=3]="Bytes",s[s.Ident=4]="Ident"})(Literal||(Literal={}));const isSpace=new RegExp("\\s"),isIdentStart=new RegExp("[:@%_A-Za-z]"),isIdent=new RegExp("[@%_\\.A-Za-z0-9]"),isDigit=new RegExp("[0-9]"),isHex=new RegExp("[0-9a-fA-F]");function*scan(s,a=!1){let u=0;for(;u<s.length;){for(;u<s.length&&isSpace.test(s[u]);)u++;if(u===s.length)return;const l=s[u],f=u;if(isIdentStart.test(l)){for(u++;u<s.length&&isIdent.test(s[u]);)u++;yield{t:Literal.Ident,v:s.slice(f,u),first:f,last:u}}else if(s.length-u>1&&s.substring(u,u+2)==="0x"){for(u+=2;u<s.length&&isHex.test(s[u]);)u++;if(u-f&1)throw new ScanError(s,u,"Bytes literal length is expected to be power of two");yield{t:Literal.Bytes,v:s.slice(f,u),first:f,last:u}}else if(isDigit.test(l)||l==="-"){l==="-"&&u++;const c=u;for(;u<s.length&&isDigit.test(s[u]);)u++;if(c===u)throw new ScanError(s,u,"Number literal is too short");yield{t:Literal.Number,v:s.slice(f,u),first:f,last:u}}else if(l==='"'){u++;let c=!1;for(;u<s.length&&(c||s[u]!=='"');u++)!c&&s[u]==="\\"?c=!0:c=!1;if(u===s.length)throw new ScanError(s,u,"Unterminated string literal");u++,yield{t:Literal.String,v:s.slice(f,u),first:f,last:u}}else if(l==="#"){for(u++;u<s.length&&s[u]!==`
`;)u++;a&&(yield{t:Literal.Comment,v:s.slice(f,u),first:f,last:u})}else if(s.length-u>1&&s.substring(u,u+2)==="/*"){for(u+=2;u<s.length&&!(s.length-u>1&&s.substring(u,u+2)==="*/");)u++;if(u===s.length)throw new ScanError(s,u,"Unterminated C style comment");u+=2,a&&(yield{t:Literal.Comment,v:s.slice(f,u),first:f,last:u})}else if(l==="("||l===")"||l==="{"||l==="}"||l===";")u++,yield{t:l,v:l,first:f,last:u};else throw new ScanError(s,u,`Invalid character at offset ${u}: \`${l}'`)}}const refContract=Symbol("ref_contract");var Protocol;(function(s){s.Ps9mPmXa="Ps9mPmXaRzmzk35gbAYNCAw6UXdE2qoABTHbN2oEEc1qM7CwT9P",s.PtCJ7pwo="PtCJ7pwoxe8JasnHY8YonnLYjcVHmhiARPJvqcC6VfHT5s8k8sY",s.PsYLVpVv="PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt",s.PsddFKi3="PsddFKi32cMJ2qPjf43Qv5GDWLDPZb3T3bF6fLKiF5HtvHNU7aP",s.Pt24m4xi="Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd",s.PsBABY5H="PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",s.PsBabyM1="PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS",s.PsCARTHA="PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb",s.PsDELPH1="PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo",s.PtEdoTez="PtEdoTezd3RHSC31mpxxo1npxFjoWWcFgQtxapi51Z8TLu6v6Uq",s.PtEdo2Zk="PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA",s.PsFLorena="PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i",s.PtGRANADs="PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV",s.PtHangzH="PtHangzHogokSuiMHemCuowEavgYTP8J5qQ9fQS793MHYFpCY3r",s.PtHangz2="PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx",s.PsiThaCa="PsiThaCaT47Zboaw71QWScM8sXeMM7bbQFncK9FLqYc6EKdpjVP",s.Psithaca2="Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A",s.PtJakarta="PtJakartaiDz69SfDDLXJSiuZqTSeSKRDbKVZC8MNzJnvRjvnGw",s.PtJakart2="PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY",s.PtKathman="PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg",s.PtLimaPtL="PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW",s.PtMumbaii="PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc",s.PtMumbai2="PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1",s.PtNairobi="PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf",s.ProxfordY="ProxfordYmVfjWnRcgjWH36fW6PArwqykTFzotUxRs6gmTcZDuH",s.PtParisBx="PtParisBxoLz5gzMmn3d9WBQNoPSZakgnkMC2VNuQ3KXfUtUQeZ",s.PsParisCZ="PsParisCZo7KAh1Z1smVd9ZMZ1HHn5gkzbM94V3PLCpknFWhUAi",s.PsQuebecn="PsQuebecnLByd3JwTiGadoG4nGWi3HYiLXUjkibeFV8dCFeVMUg",s.ProtoALpha="ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK"})(Protocol||(Protocol={}));const DefaultProtocol=Protocol.PsParisCZ,protoLevel={Ps9mPmXaRzmzk35gbAYNCAw6UXdE2qoABTHbN2oEEc1qM7CwT9P:0,PtCJ7pwoxe8JasnHY8YonnLYjcVHmhiARPJvqcC6VfHT5s8k8sY:1,PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt:2,PsddFKi32cMJ2qPjf43Qv5GDWLDPZb3T3bF6fLKiF5HtvHNU7aP:3,Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd:4,PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU:5,PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS:5,PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb:6,PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo:7,PtEdoTezd3RHSC31mpxxo1npxFjoWWcFgQtxapi51Z8TLu6v6Uq:8,PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA:8,PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i:9,PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV:10,PtHangzHogokSuiMHemCuowEavgYTP8J5qQ9fQS793MHYFpCY3r:11,PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx:11,PsiThaCaT47Zboaw71QWScM8sXeMM7bbQFncK9FLqYc6EKdpjVP:12,Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A:12,PtJakartaiDz69SfDDLXJSiuZqTSeSKRDbKVZC8MNzJnvRjvnGw:13,PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY:13,PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg:14,PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW:15,PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc:16,PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1:16,PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf:17,ProxfordYmVfjWnRcgjWH36fW6PArwqykTFzotUxRs6gmTcZDuH:19,PtParisBxoLz5gzMmn3d9WBQNoPSZakgnkMC2VNuQ3KXfUtUQeZ:20,PsParisCZo7KAh1Z1smVd9ZMZ1HHn5gkzbM94V3PLCpknFWhUAi:20,PsQuebecnLByd3JwTiGadoG4nGWi3HYiLXUjkibeFV8dCFeVMUg:21,ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK:22};function ProtoInferiorTo(s,a){return protoLevel[s]<protoLevel[a]}class MacroError extends TaquitoError{constructor(a,u){super(),this.prim=a,this.message=u,this.name="MacroError"}}function assertArgs$1(s,a){var u,l;if(a===0&&s.args===void 0||((u=s.args)===null||u===void 0?void 0:u.length)===a)return!0;throw new MacroError(s,`macro ${s.prim} expects ${a} arguments, was given ${(l=s.args)===null||l===void 0?void 0:l.length}`)}function assertNoAnnots(s){if(s.annots===void 0)return!0;throw new MacroError(s,`unexpected annotation on macro ${s.prim}: ${s.annots}`)}function assertIntArg(s,a){if("int"in a)return!0;throw new MacroError(s,`macro ${s.prim} expects int argument`)}function parsePairUnpairExpr(s,a,u,l){let f=0,c=0;const h=[null,null];let p;if(f===a.length)throw new MacroError(s,`unexpected end: ${s.prim}`);let v=a[f++];switch(v){case"P":{const{r:b,n:S,an:E}=parsePairUnpairExpr(s,a.slice(f),u.slice(c),l);p=b,f+=S,c+=E;break}case"A":c!==u.length&&(h[0]=u[c++]);break;default:throw new MacroError(s,`${s.prim}: unexpected character: ${v}`)}let y;if(f===a.length)throw new MacroError(s,`unexpected end: ${s.prim}`);switch(v=a[f++],v){case"P":{const{r:b,n:S,an:E}=parsePairUnpairExpr(s,a.slice(f),u.slice(c),l);y=b.map(([R,O])=>[R+1,O]),f+=S,c+=E;break}case"I":c!==u.length&&(h[1]=u[c++]);break;default:throw new MacroError(s,`${s.prim}: unexpected character: ${v}`)}return{r:l(p,y,[0,h]),n:f,an:c}}function parseSetMapCadr(s,a,u,l){const f=a[0];switch(f){case"A":return a.length>1?[{prim:"DUP"},{prim:"DIP",args:[[{prim:"CAR",annots:["@%%"]},parseSetMapCadr(s,a.slice(1),[],l)]]},{prim:"CDR",annots:["@%%"]},{prim:"SWAP"},{prim:"PAIR",annots:["%@","%@",...u]}]:l.a;case"D":return a.length>1?[{prim:"DUP"},{prim:"DIP",args:[[{prim:"CDR",annots:["@%%"]},parseSetMapCadr(s,a.slice(1),[],l)]]},{prim:"CAR",annots:["@%%"]},{prim:"PAIR",annots:["%@","%@",...u]}]:l.d;default:throw new MacroError(s,`${s.prim}: unexpected character: ${f}`)}}function trimLast(s,a){let u=s.length;for(;u>0&&s[u-1]===a;)u--;return s.slice(0,u)}function filterAnnotations(s){const a=[],u=[];if(s!==void 0)for(const l of s)(l.length!==0&&l[0]==="%"?a:u).push(l);return{fields:a,rest:u}}function mkPrim({prim:s,annots:a,args:u}){return Object.assign(Object.assign({prim:s},a&&{annots:a}),u&&{args:u})}const pairRe=/^P[PAI]{3,}R$/,unpairRe=/^UNP[PAI]{2,}R$/,cadrRe=/^C[AD]{2,}R$/,setCadrRe=/^SET_C[AD]+R$/,mapCadrRe=/^MAP_C[AD]+R$/,diipRe=/^DI{2,}P$/,duupRe=/^DU+P$/;function expandMacros(s,a){const u=(a==null?void 0:a.protocol)||DefaultProtocol;function l(f){return f!==void 0?[{prim:"RENAME",annots:f}]:[]}switch(s.prim){case"CMPEQ":case"CMPNEQ":case"CMPLT":case"CMPGT":case"CMPLE":case"CMPGE":if(assertArgs$1(s,0))return[{prim:"COMPARE"},mkPrim({prim:s.prim.slice(3),annots:s.annots})];break;case"IFEQ":case"IFNEQ":case"IFLT":case"IFGT":case"IFLE":case"IFGE":if(assertArgs$1(s,2))return[{prim:s.prim.slice(2)},mkPrim({prim:"IF",annots:s.annots,args:s.args})];break;case"IFCMPEQ":case"IFCMPNEQ":case"IFCMPLT":case"IFCMPGT":case"IFCMPLE":case"IFCMPGE":if(assertArgs$1(s,2))return[{prim:"COMPARE"},{prim:s.prim.slice(5)},mkPrim({prim:"IF",annots:s.annots,args:s.args})];break;case"FAIL":if(assertArgs$1(s,0)&&assertNoAnnots(s))return[{prim:"UNIT"},{prim:"FAILWITH"}];break;case"ASSERT":if(assertArgs$1(s,0)&&assertNoAnnots(s))return[{prim:"IF",args:[[],[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_EQ":case"ASSERT_NEQ":case"ASSERT_LT":case"ASSERT_GT":case"ASSERT_LE":case"ASSERT_GE":if(assertArgs$1(s,0)&&assertNoAnnots(s))return[{prim:s.prim.slice(7)},{prim:"IF",args:[[],[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_CMPEQ":case"ASSERT_CMPNEQ":case"ASSERT_CMPLT":case"ASSERT_CMPGT":case"ASSERT_CMPLE":case"ASSERT_CMPGE":if(assertArgs$1(s,0)&&assertNoAnnots(s))return[[{prim:"COMPARE"},{prim:s.prim.slice(10)}],{prim:"IF",args:[[],[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_NONE":if(assertArgs$1(s,0)&&assertNoAnnots(s))return[{prim:"IF_NONE",args:[[],[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_SOME":if(assertArgs$1(s,0))return[{prim:"IF_NONE",args:[[[{prim:"UNIT"},{prim:"FAILWITH"}]],l(s.annots)]}];break;case"ASSERT_LEFT":if(assertArgs$1(s,0))return[{prim:"IF_LEFT",args:[l(s.annots),[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_RIGHT":if(assertArgs$1(s,0))return[{prim:"IF_LEFT",args:[[[{prim:"UNIT"},{prim:"FAILWITH"}]],l(s.annots)]}];break;case"IF_SOME":if(assertArgs$1(s,2))return[mkPrim({prim:"IF_NONE",annots:s.annots,args:[s.args[1],s.args[0]]})];break;case"IF_RIGHT":if(assertArgs$1(s,2))return[mkPrim({prim:"IF_LEFT",annots:s.annots,args:[s.args[1],s.args[0]]})];break;case"CAR":case"CDR":if(s.args!==void 0){if(assertArgs$1(s,1)&&assertIntArg(s,s.args[0])){const f=parseInt(s.args[0].int,10);return mkPrim({prim:"GET",args:[{int:s.prim==="CAR"?String(f*2+1):String(f*2)}],annots:s.annots})}}else return s}if(pairRe.test(s.prim)&&assertArgs$1(s,0)){const{fields:f,rest:c}=filterAnnotations(s.annots),{r:h}=parsePairUnpairExpr(s,s.prim.slice(1),f,(p,v,y)=>[...p||[],...v||[],y]);return h.map(([p,v],y)=>{const b=[...trimLast(v,null).map(E=>E===null?"%":E),...p===0&&y===h.length-1?c:[]],S=mkPrim({prim:"PAIR",annots:b.length!==0?b:void 0});return p===0?S:{prim:"DIP",args:p===1?[[S]]:[{int:String(p)},[S]]}})}if(unpairRe.test(s.prim))if(ProtoInferiorTo(u,Protocol.PtEdo2Zk)&&assertArgs$1(s,0)){const{r:f}=parsePairUnpairExpr(s,s.prim.slice(3),s.annots||[],(c,h,p)=>[p,...h||[],...c||[]]);return f.map(([c,h])=>{const p=[{prim:"DUP"},mkPrim({prim:"CAR",annots:h[0]!==null?[h[0]]:void 0}),{prim:"DIP",args:[[mkPrim({prim:"CDR",annots:h[1]!==null?[h[1]]:void 0})]]}];return c===0?p:{prim:"DIP",args:c===1?[[p]]:[{int:String(c)},[p]]}})}else{if(s.prim==="UNPAIR")return s;if(assertArgs$1(s,0)){const{r:f}=parsePairUnpairExpr(s,s.prim.slice(3),[],(c,h,p)=>[p,...h||[],...c||[]]);return f.map(([c])=>{const h=mkPrim({prim:"UNPAIR"});return c===0?h:{prim:"DIP",args:c===1?[[h]]:[{int:String(c)},[h]]}})}}if(cadrRe.test(s.prim)&&assertArgs$1(s,0)){const f=[...s.prim.slice(1,s.prim.length-1)];return f.map((c,h)=>{const p=h===f.length-1?s.annots:void 0;switch(c){case"A":return mkPrim({prim:"CAR",annots:p});case"D":return mkPrim({prim:"CDR",annots:p});default:throw new MacroError(s,`unexpected character: ${c}`)}})}if(setCadrRe.test(s.prim)&&assertArgs$1(s,0)){const{fields:f,rest:c}=filterAnnotations(s.annots);if(f.length>1)throw new MacroError(s,`unexpected annotation on macro ${s.prim}: ${f}`);const h=f.length!==0?{a:[{prim:"DUP"},{prim:"CAR",annots:f},{prim:"DROP"},{prim:"CDR",annots:["@%%"]},{prim:"SWAP"},{prim:"PAIR",annots:[f[0],"%@"]}],d:[{prim:"DUP"},{prim:"CDR",annots:f},{prim:"DROP"},{prim:"CAR",annots:["@%%"]},{prim:"PAIR",annots:["%@",f[0]]}]}:{a:[{prim:"CDR",annots:["@%%"]},{prim:"SWAP"},{prim:"PAIR",annots:["%","%@"]}],d:[{prim:"CAR",annots:["@%%"]},{prim:"PAIR",annots:["%@","%"]}]};return parseSetMapCadr(s,s.prim.slice(5,s.prim.length-1),c,h)}if(mapCadrRe.test(s.prim)&&assertArgs$1(s,1)){const{fields:f}=filterAnnotations(s.annots);if(f.length>1)throw new MacroError(s,`unexpected annotation on macro ${s.prim}: ${f}`);const c={a:[{prim:"DUP"},{prim:"CDR",annots:["@%%"]},{prim:"DIP",args:[[mkPrim({prim:"CAR",annots:f.length!==0?["@"+f[0].slice(1)]:void 0}),s.args[0]]]},{prim:"SWAP"},{prim:"PAIR",annots:[f.length!==0?f[0]:"%","%@"]}],d:[{prim:"DUP"},mkPrim({prim:"CDR",annots:f.length!==0?["@"+f[0].slice(1)]:void 0}),s.args[0],{prim:"SWAP"},{prim:"CAR",annots:["@%%"]},{prim:"PAIR",annots:["%@",f.length!==0?f[0]:"%"]}]};return parseSetMapCadr(s,s.prim.slice(5,s.prim.length-1),[],c)}if(diipRe.test(s.prim)&&assertArgs$1(s,1)){let f=0;for(;s.prim[1+f]==="I";)f++;return mkPrim({prim:"DIP",args:[{int:String(f)},s.args[0]]})}if(duupRe.test(s.prim)){let f=0;for(;s.prim[1+f]==="U";)f++;if(ProtoInferiorTo(u,Protocol.PtEdo2Zk)){if(f===1){if(s.args===void 0)return s;assertArgs$1(s,1)&&assertIntArg(s,s.args[0])&&(f=parseInt(s.args[0].int,10))}else assertArgs$1(s,0);return f===1?[mkPrim({prim:"DUP",annots:s.annots})]:f===2?[{prim:"DIP",args:[[mkPrim({prim:"DUP",annots:s.annots})]]},{prim:"SWAP"}]:[{prim:"DIP",args:[{int:String(f-1)},[mkPrim({prim:"DUP",annots:s.annots})]]},{prim:"DIG",args:[{int:String(f)}]}]}else{if(f===1)return s;if(assertArgs$1(s,0))return mkPrim({prim:"DUP",args:[{int:String(f)}],annots:s.annots})}}return s}function expandGlobalConstants(s,a){return s.args!==void 0&&s.args.length===1&&"string"in s.args[0]&&s.args[0].string in a?a[s.args[0].string]:s}class MichelineParseError extends TaquitoError{constructor(a,u){super(),this.token=a,this.message=u,this.name="MichelineParseError"}}class JSONParseError extends TaquitoError{constructor(a,u){super(),this.node=a,this.message=u,this.name="JSONParseError"}}const errEOF=new MichelineParseError(null,"Unexpected EOF");function isAnnotation(s){return s.t===Literal.Ident&&(s.v[0]==="@"||s.v[0]==="%"||s.v[0]===":")}const intRe=new RegExp("^-?[0-9]+$"),bytesRe=new RegExp("^([0-9a-fA-F]{2})*$");let Parser$1=class{constructor(a){this.opt=a}expand(a){var u,l,f;if(((u=this.opt)===null||u===void 0?void 0:u.expandGlobalConstant)!==void 0&&a.prim==="constant"){const c=expandGlobalConstants(a,this.opt.expandGlobalConstant);return c!==a&&(c[sourceReference]=Object.assign(Object.assign({},a[sourceReference]||{first:0,last:0}),{globalConstant:a})),c}if(((l=this.opt)===null||l===void 0?void 0:l.expandMacros)===void 0||!((f=this.opt)===null||f===void 0)&&f.expandMacros){const c=expandMacros(a,this.opt);return c!==a&&(c[sourceReference]=Object.assign(Object.assign({},a[sourceReference]||{first:0,last:0}),{macro:a})),c}else return a}parseListExpr(a,u){var l;const f={first:u.first,last:u.last},c=u.t==="(";let h;if(c){if(h=a.next(),h.done)throw errEOF;f.last=h.value.last}else h={value:u};if(h.value.t!==Literal.Ident)throw new MichelineParseError(h.value,`not an identifier: ${h.value.v}`);const p={prim:h.value.v,[sourceReference]:f};for(;;){const v=a.next();if(v.done){if(c)throw errEOF;break}else if(v.value.t===")"){if(!c)throw new MichelineParseError(v.value,"unexpected closing bracket");f.last=v.value.last;break}else if(isAnnotation(v.value))p.annots=p.annots||[],p.annots.push(v.value.v),f.last=v.value.last;else{p.args=p.args||[];const y=this.parseExpr(a,v.value);f.last=((l=y[sourceReference])===null||l===void 0?void 0:l.last)||f.last,p.args.push(y)}}return this.expand(p)}parseArgs(a,u){var l;const f={first:u.first,last:u.last},c={prim:u.v,[sourceReference]:f};for(;;){const h=a.next();if(h.done||h.value.t==="}"||h.value.t===";")return[c,h];if(isAnnotation(h.value))f.last=h.value.last,c.annots=c.annots||[],c.annots.push(h.value.v);else{const p=this.parseExpr(a,h.value);f.last=((l=p[sourceReference])===null||l===void 0?void 0:l.last)||f.last,c.args=c.args||[],c.args.push(p)}}}parseSequenceExpr(a,u){var l,f;const c={first:u.first,last:u.last},h=[];h[sourceReference]=c;const p=u.t==="{";let v=u.t==="{"?null:{value:u};for(;;){if(v===null&&(v=a.next(),v.done||(c.last=v.value.last)),v.done){if(p)throw errEOF;return h}if(v.value.t==="}"){if(p)return h;throw new MichelineParseError(v.value,"unexpected closing bracket")}else if(v.value.t===Literal.Ident){const[y,b]=this.parseArgs(a,v.value);c.last=((l=y[sourceReference])===null||l===void 0?void 0:l.last)||c.last,h.push(this.expand(y)),v=b}else{const y=this.parseExpr(a,v.value);c.last=((f=y[sourceReference])===null||f===void 0?void 0:f.last)||c.last,h.push(y),v=null}v===null&&(v=a.next(),v.done||(c.last=v.value.last)),!v.done&&v.value.t===";"&&(v=null)}}parseExpr(a,u){switch(u.t){case Literal.Ident:return this.expand({prim:u.v,[sourceReference]:{first:u.first,last:u.last}});case Literal.Number:return{int:u.v,[sourceReference]:{first:u.first,last:u.last}};case Literal.String:return{string:JSON.parse(u.v),[sourceReference]:{first:u.first,last:u.last}};case Literal.Bytes:return{bytes:u.v.slice(2),[sourceReference]:{first:u.first,last:u.last}};case"{":return this.parseSequenceExpr(a,u);default:return this.parseListExpr(a,u)}}parseSequence(a){if(typeof a!="string")throw new TypeError(`string type was expected, got ${typeof a} instead`);const u=scan(a),l=u.next();return l.done?null:this.parseSequenceExpr(u,l.value)}parseList(a){if(typeof a!="string")throw new TypeError(`string type was expected, got ${typeof a} instead`);const u=scan(a),l=u.next();return l.done?null:this.parseListExpr(u,l.value)}parseMichelineExpression(a){if(typeof a!="string")throw new TypeError(`string type was expected, got ${typeof a} instead`);const u=scan(a),l=u.next();return l.done?null:this.parseExpr(u,l.value)}parseScript(a){return this.parseSequence(a)}parseData(a){return this.parseList(a)}parseJSON(a){if(typeof a!="object")throw new TypeError(`object type was expected, got ${typeof a} instead`);if(Array.isArray(a)){const u=[];for(const l of a){if(l===null||typeof l!="object")throw new JSONParseError(l,`unexpected sequence element: ${l}`);u.push(this.parseJSON(l))}return u}else if("prim"in a){const u=a;if(typeof u.prim=="string"&&(u.annots===void 0||Array.isArray(u.annots))&&(u.args===void 0||Array.isArray(u.args))){const l={prim:u.prim};if(u.annots!==void 0){for(const f of u.annots)if(typeof f!="string")throw new JSONParseError(f,`string expected: ${f}`);l.annots=u.annots}if(u.args!==void 0){l.args=[];for(const f of u.args){if(f===null||typeof f!="object")throw new JSONParseError(f,`unexpected argument: ${f}`);l.args.push(this.parseJSON(f))}}return this.expand(l)}throw new JSONParseError(a,`malformed prim expression: ${a}`)}else if("string"in a){if(typeof a.string=="string")return{string:a.string};throw new JSONParseError(a,`malformed string literal: ${a}`)}else if("int"in a){if(typeof a.int=="string"&&intRe.test(a.int))return{int:a.int};throw new JSONParseError(a,`malformed int literal: ${a}`)}else if("bytes"in a){if(typeof a.bytes=="string"&&bytesRe.test(a.bytes))return{bytes:a.bytes};throw new JSONParseError(a,`malformed bytes literal: ${a}`)}else throw new JSONParseError(a,`unexpected object: ${a}`)}};const H=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],K=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998];class Base58DecodingError extends TaquitoError{constructor(a){super(),this.message=a,this.name="Base58DecodingError"}}function sha256(s){const a=(s.length+9)%64,u=a===0?0:64-a;if(s.length>268435455)throw new InvalidMessageError("",`: Invalid length ${s.length} is too big -- SHA-256.`);const l=s.length<<3,f=[...s,128,...new Array(u).fill(0),0,0,0,0,l>>24&255,l>>16&255,l>>8&255,l&255];function c(b,S){return b>>>S|b<<32-S}const h=[...H],p=new Array(64),v=new Array(8);for(let b=0;b<f.length;b+=64){let S=b,E=0;for(;E<16;)p[E]=f[S]<<24|f[S+1]<<16|f[S+2]<<8|f[S+3],S+=4,E++;for(;E<64;){const R=c(p[E-15],7)^c(p[E-15],18)^p[E-15]>>>3,O=c(p[E-2],17)^c(p[E-2],19)^p[E-2]>>>10;p[E]=(O|0)+p[E-7]+R+p[E-16]|0,E++}for(let R=0;R<8;R++)v[R]=h[R];for(let R=0;R<64;R++){const O=c(v[0],2)^c(v[0],13)^c(v[0],22),I=c(v[4],6)^c(v[4],11)^c(v[4],25),B=v[7]+I+(v[4]&v[5]^~v[4]&v[6])+K[R]+p[R]|0,N=O+(v[0]&v[1]^v[0]&v[2]^v[1]&v[2])|0;v[7]=v[6],v[6]=v[5],v[5]=v[4],v[4]=v[3]+B|0,v[3]=v[2],v[2]=v[1],v[1]=v[0],v[0]=B+N|0}for(let R=0;R<8;R++)h[R]=h[R]+v[R]|0}const y=[];for(const b of h)y.push(b>>24&255),y.push(b>>16&255),y.push(b>>8&255),y.push(b&255);return y}const base58alphabetFwd=[0,1,2,3,4,5,6,7,8,-1,-1,-1,-1,-1,-1,-1,9,10,11,12,13,14,15,16,-1,17,18,19,20,21,-1,22,23,24,25,26,27,28,29,30,31,32,-1,-1,-1,-1,-1,-1,33,34,35,36,37,38,39,40,41,42,43,-1,44,45,46,47,48,49,50,51,52,53,54,55,56,57],base58alphabetBwd=[0,1,2,3,4,5,6,7,8,16,17,18,19,20,21,22,23,25,26,27,28,29,31,32,33,34,35,36,37,38,39,40,41,48,49,50,51,52,53,54,55,56,57,58,60,61,62,63,64,65,66,67,68,69,70,71,72,73];function byteAt(s,a){const u=s.charCodeAt(a)-49;if(u>=base58alphabetFwd.length||base58alphabetFwd[u]===-1)throw new Base58DecodingError(`Unexpected character at position ${a}: ${s[a]}`);return base58alphabetFwd[u]}function decodeBase58(s){const a=[];let u=0;for(;u<s.length&&byteAt(s,u)===0;)u++;let l=u;for(;u<s.length;){let f=byteAt(s,u++),c=0;for(;f!==0||c<a.length;){const h=(a[c]||0)*58+f;a[c++]=h%256,f=Math.floor(h/256)}}for(;l-- >0;)a.push(0);return a.reverse()}function encodeBase58(s){const a=[];let u=0;for(;u<s.length&&s[u]===0;)u++;let l=u;for(;u<s.length;){let f=s[u++],c=0;for(;f!==0||c<a.length;){const h=(a[c]||0)*256+f;a[c++]=h%58,f=Math.floor(h/58)}}for(;l-- >0;)a.push(0);return a.reverse(),String.fromCharCode(...a.map(f=>base58alphabetBwd[f]+49))}function decodeBase58Check(s){const a=decodeBase58(s);if(a.length<4)throw new Base58DecodingError(`Data is too short ${a.length}`);const u=a.slice(0,a.length-4),l=a.slice(a.length-4),f=sha256(sha256(u));if(l[0]!==f[0]||l[1]!==f[1]||l[2]!==f[2]||l[3]!==f[3])throw new Base58DecodingError("Invalid checksum");return u}function encodeBase58Check(s){const a=sha256(sha256(s));return encodeBase58([...s,...a.slice(0,4)])}class InvalidMichelsonError extends ParameterValidationError{constructor(a){super(),this.message=a,this.name="InvalidMichelsonError"}}class InvalidTypeExpressionError extends ParameterValidationError{constructor(a){super(),this.message=a,this.name="InvalidTypeExpressionError"}}class InvalidDataExpressionError extends ParameterValidationError{constructor(a){super(),this.message=a,this.name="InvalidDataExpressionError"}}class InvalidEntrypointError extends ParameterValidationError{constructor(a){super(),this.entrypoint=a,this.name="InvalidEntrypointError",this.message=`Contract has no entrypoint named: "${a}"`}}class TezosIdEncodeError extends ParameterValidationError{constructor(a){super(),this.message=a,this.name="TezosIdEncodeError"}}class LongIntegerError extends TaquitoError{constructor(a){super(),this.message=a,this.name="LongIntegerError"}}class MichelsonError extends TaquitoError{constructor(a,u){super(),this.val=a,this.message=u,this.name="MichelsonError"}}class MichelsonTypeError extends MichelsonError{constructor(a,u,l){super(a,u),this.val=a,this.message=u,this.name="MichelsonTypeError",l!==void 0&&(this.data=l)}}class LongInteger{append(a){let u=0;for(;a!==0||u<this.buf.length;){const l=(this.buf[u]||0)*10+a;this.buf[u++]=l%256,a=Math.floor(l/256)}}constructor(a){if(this.neg=!1,this.buf=[],a!==void 0)if(typeof a=="string")for(let u=0;u<a.length;u++){const l=a.charCodeAt(u);if(u===0&&l===45)this.neg=!0;else{if(l<48||l>57)throw new LongIntegerError(`unexpected character in integer constant "${a[u]}"`);this.append(l-48)}}else a<0?(this.neg=!0,this.append(-a)):this.append(a)}cmp(a){if(this.neg!==a.neg)return(a.neg?1:0)-(this.neg?1:0);{let u=0;if(this.buf.length!==a.buf.length)u=this.buf.length<a.buf.length?-1:1;else if(this.buf.length!==0){let l=a.buf.length-1;for(;l>=0&&this.buf[l]===a.buf[l];)l--;u=l<0?0:this.buf[l]<a.buf[l]?-1:1}return this.neg?u===0?0:-u:u}}get sign(){return this.buf.length===0?0:this.neg?-1:1}}function parseBytes(s){const a=[];for(let u=0;u<s.length;u+=2){const l=parseInt(s.slice(u,u+2),16);if(Number.isNaN(l))return null;a.push(l)}return a}function isDecimal(s){try{return new LongInteger(s),!0}catch{return!1}}function isNatural(s){try{return new LongInteger(s).sign>=0}catch{return!1}}const annRe=/^(@%|@%%|%@|[@:%]([_0-9a-zA-Z][_0-9a-zA-Z.%@]*)?)$/;function unpackAnnotations(s,a){if(Array.isArray(s))return{};let u,l,f;if(s.annots!==void 0){for(const c of s.annots)if(c.length!==0){if(!annRe.test(c)||!(a!=null&&a.specialVar)&&(c==="@%"||c==="@%%")||!(a!=null&&a.specialFields)&&c==="%@")throw new MichelsonError(s,`${s.prim}: unexpected annotation: ${c}`);switch(c[0]){case"%":(a!=null&&a.emptyFields||c.length>1)&&(u=u||[],u.push(c));break;case":":c.length>1&&(l=l||[],l.push(c));break;case"@":(a!=null&&a.emptyVar||c.length>1)&&(f=f||[],f.push(c));break}}}return{f:u,t:l,v:f}}const tezosPrefix={BlockHash:[32,[1,52]],OperationHash:[32,[5,116]],OperationListHash:[32,[133,233]],OperationListListHash:[32,[29,159,109]],ProtocolHash:[32,[2,170]],ContextHash:[32,[79,199]],ED25519PublicKeyHash:[20,[6,161,159]],SECP256K1PublicKeyHash:[20,[6,161,161]],P256PublicKeyHash:[20,[6,161,164]],ContractHash:[20,[2,90,121]],CryptoboxPublicKeyHash:[16,[153,103]],ED25519Seed:[32,[13,15,58,7]],ED25519PublicKey:[32,[13,15,37,217]],SECP256K1SecretKey:[32,[17,162,224,201]],P256SecretKey:[32,[16,81,238,189]],ED25519EncryptedSeed:[56,[7,90,60,179,41]],SECP256K1EncryptedSecretKey:[56,[9,237,241,174,150]],P256EncryptedSecretKey:[56,[9,48,57,115,171]],SECP256K1PublicKey:[33,[3,254,226,86]],P256PublicKey:[33,[3,178,139,127]],SECP256K1Scalar:[33,[38,248,136]],SECP256K1Element:[33,[5,92,0]],ED25519SecretKey:[64,[43,246,78,7]],ED25519Signature:[64,[9,245,205,134,18]],SECP256K1Signature:[64,[13,115,101,19,63]],P256Signature:[64,[54,240,44,52]],GenericSignature:[64,[4,130,43]],ChainID:[4,[87,82,0]],RollupAddress:[20,[1,128,120,31]]};function checkDecodeTezosID(s,...a){const u=decodeBase58Check(s);for(const l of a){const[f,c]=tezosPrefix[l];if(u.length===f+c.length){let h=0;for(;h<c.length&&u[h]===c[h];)h++;if(h===c.length)return[l,u.slice(c.length)]}}return null}function encodeTezosID(s,a){const[u,l]=tezosPrefix[s];if(a.length!==u)throw new TezosIdEncodeError(`Incorrect data length for ${s}: ${a.length}`);return encodeBase58Check([...l,...a])}function unpackComb(s,a){const u=a,l=Array.isArray(u)?u:u.args;return l.length===2?s==="pair"?{prim:"pair",args:l}:{prim:"Pair",args:l}:Object.assign(Object.assign({},Array.isArray(u)?{prim:s}:u),{args:[l[0],{prim:s,args:l.slice(1)}]})}function isPairType(s){return Array.isArray(s)||s.prim==="pair"}function isPairData(s){return Array.isArray(s)||"prim"in s&&s.prim==="Pair"}const rfc3339Re=/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])[T ]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):([0-5][0-9]))$/;function parseDate(s){if("string"in s){if(isNatural(s.string))return new Date(parseInt(s.string,10));if(rfc3339Re.test(s.string)){const a=new Date(s.string);if(!Number.isNaN(a.valueOf))return a}}else if(isDecimal(s.int))return new Date(parseInt(s.int,10));return null}function hexBytes(s){return s.map(a=>(a>>4&15).toString(16)+(a&15).toString(16)).join("")}const maxViewNameLength=31,noArgInstructionIDs={ABS:!0,ADD:!0,ADDRESS:!0,AMOUNT:!0,AND:!0,APPLY:!0,BALANCE:!0,BLAKE2B:!0,CAR:!0,CDR:!0,CHAIN_ID:!0,CHECK_SIGNATURE:!0,COMPARE:!0,CONCAT:!0,CONS:!0,EDIV:!0,EQ:!0,EXEC:!0,FAILWITH:!0,GE:!0,GET_AND_UPDATE:!0,GT:!0,HASH_KEY:!0,IMPLICIT_ACCOUNT:!0,INT:!0,ISNAT:!0,JOIN_TICKETS:!0,KECCAK:!0,LE:!0,LEVEL:!0,LSL:!0,LSR:!0,LT:!0,MEM:!0,MUL:!0,NEG:!0,NEQ:!0,NEVER:!0,NOT:!0,NOW:!0,OR:!0,PACK:!0,PAIRING_CHECK:!0,READ_TICKET:!0,SAPLING_VERIFY_UPDATE:!0,SELF:!0,SELF_ADDRESS:!0,SENDER:!0,SET_DELEGATE:!0,SHA256:!0,SHA3:!0,SHA512:!0,SIZE:!0,SLICE:!0,SOME:!0,SOURCE:!0,SPLIT_TICKET:!0,SUB:!0,SWAP:!0,TICKET:!0,TICKET_DEPRECATED:!0,TOTAL_VOTING_POWER:!0,TRANSFER_TOKENS:!0,UNIT:!0,VOTING_POWER:!0,XOR:!0,RENAME:!0,OPEN_CHEST:!0,SUB_MUTEZ:!0,MIN_BLOCK_TIME:!0,BYTES:!0,NAT:!0},instructionIDs=Object.assign({},noArgInstructionIDs,{CONTRACT:!0,CREATE_CONTRACT:!0,DIG:!0,DIP:!0,DROP:!0,DUG:!0,DUP:!0,EMIT:!0,EMPTY_BIG_MAP:!0,EMPTY_MAP:!0,EMPTY_SET:!0,GET:!0,IF:!0,IF_CONS:!0,IF_LEFT:!0,IF_NONE:!0,ITER:!0,LAMBDA:!0,LAMBDA_REC:!0,LEFT:!0,LOOP:!0,LOOP_LEFT:!0,MAP:!0,NIL:!0,NONE:!0,PAIR:!0,PUSH:!0,RIGHT:!0,SAPLING_EMPTY_STATE:!0,UNPACK:!0,UNPAIR:!0,UPDATE:!0,CAST:!0,VIEW:!0}),simpleComparableTypeIDs={unit:!0,never:!0,bool:!0,int:!0,nat:!0,string:!0,chain_id:!0,bytes:!0,mutez:!0,key_hash:!0,key:!0,signature:!0,timestamp:!0,address:!0,tx_rollup_l2_address:!0},typeIDs=Object.assign({},simpleComparableTypeIDs,{or:!0,pair:!0,set:!0,big_map:!0,contract:!0,lambda:!0,list:!0,map:!0,operation:!0,option:!0,bls12_381_g1:!0,bls12_381_g2:!0,bls12_381_fr:!0,sapling_transaction:!0,sapling_transaction_deprecated:!0,sapling_state:!0,ticket:!0,chest_key:!0,chest:!0});class MichelsonValidationError extends MichelsonError{constructor(a,u){super(a,u),this.val=a,this.message=u,this.name="MichelsonValidationError"}}function isPrim$1(s){return"prim"in s}function isPrimOrSeq(s){return Array.isArray(s)||"prim"in s}function assertPrim(s){if(isPrim$1(s))return!0;throw new MichelsonValidationError(s,"prim expression expected")}function assertSeq(s){if(Array.isArray(s))return!0;throw new MichelsonValidationError(s,"sequence expression expected")}function assertPrimOrSeq(s){if(isPrimOrSeq(s))return!0;throw new MichelsonValidationError(s,"prim or sequence expression expected")}function assertNatural(s){if(s.int[0]==="-")throw new MichelsonValidationError(s,"natural number expected")}function assertIntLiteral(s){if("int"in s)return!0;throw new MichelsonValidationError(s,"int literal expected")}function assertStringLiteral(s){if("string"in s)return!0;throw new MichelsonValidationError(s,"string literal expected")}function assertStringOrBytes(s){if("string"in s||"bytes"in s)return!0;throw new MichelsonValidationError(s,"string or bytes literal expected")}function assertArgs(s,a){var u;if(a===0&&s.args===void 0||((u=s.args)===null||u===void 0?void 0:u.length)===a)return!0;throw new MichelsonValidationError(s,`${a} arguments expected`)}function assertMichelsonInstruction(s){var a,u;if(Array.isArray(s)){for(const l of s){if(!Array.isArray(l)&&!isPrim$1(l))throw new MichelsonValidationError(s,"sequence or prim expected");assertMichelsonInstruction(l)}return!0}if(assertPrim(s)){if(Object.prototype.hasOwnProperty.call(noArgInstructionIDs,s.prim))return assertArgs(s,0),!0;switch(s.prim){case"DROP":case"PAIR":case"UNPAIR":case"DUP":case"UPDATE":case"GET":s.args!==void 0&&assertArgs(s,1)&&assertIntLiteral(s.args[0])&&assertNatural(s.args[0]);break;case"DIG":case"DUG":case"SAPLING_EMPTY_STATE":assertArgs(s,1)&&assertIntLiteral(s.args[0])&&assertNatural(s.args[0]);break;case"NONE":case"LEFT":case"RIGHT":case"NIL":case"CAST":assertArgs(s,1)&&assertMichelsonType(s.args[0]);break;case"UNPACK":assertArgs(s,1)&&assertMichelsonPackableType(s.args[0]);break;case"CONTRACT":assertArgs(s,1)&&assertMichelsonPassableType(s.args[0]);break;case"IF_NONE":case"IF_LEFT":case"IF_CONS":case"IF":assertArgs(s,2)&&(assertSeq(s.args[0])&&assertMichelsonInstruction(s.args[0]),assertSeq(s.args[1])&&assertMichelsonInstruction(s.args[1]));break;case"MAP":case"ITER":case"LOOP":case"LOOP_LEFT":assertArgs(s,1)&&assertMichelsonInstruction(s.args[0]);break;case"CREATE_CONTRACT":assertArgs(s,1)&&assertMichelsonContract(s.args[0]);break;case"DIP":if(((a=s.args)===null||a===void 0?void 0:a.length)===2)assertIntLiteral(s.args[0])&&assertNatural(s.args[0]),assertSeq(s.args[1])&&assertMichelsonInstruction(s.args[1]);else if(((u=s.args)===null||u===void 0?void 0:u.length)===1)assertSeq(s.args[0])&&assertMichelsonInstruction(s.args[0]);else throw new MichelsonValidationError(s,"1 or 2 arguments expected");break;case"PUSH":assertArgs(s,2)&&(assertMichelsonPushableType(s.args[0]),assertMichelsonData(s.args[1]));break;case"EMPTY_SET":assertArgs(s,1)&&assertMichelsonComparableType(s.args[0]);break;case"EMPTY_MAP":assertArgs(s,2)&&(assertMichelsonComparableType(s.args[0]),assertMichelsonType(s.args[1]));break;case"EMPTY_BIG_MAP":assertArgs(s,2)&&(assertMichelsonComparableType(s.args[0]),assertMichelsonBigMapStorableType(s.args[1]));break;case"LAMBDA_REC":case"LAMBDA":assertArgs(s,3)&&(assertMichelsonType(s.args[0]),assertMichelsonType(s.args[1]),assertSeq(s.args[2])&&assertMichelsonInstruction(s.args[2]));break;case"VIEW":assertArgs(s,2)&&(assertStringLiteral(s.args[0])&&assertViewNameValid(s.args[0]),assertMichelsonType(s.args[1])&&assertMichelsonPushableType(s.args[1]));break;case"EMIT":s.args&&s.args.length>0?assertArgs(s,1):assertArgs(s,0);break;default:throw new MichelsonValidationError(s,"instruction expected")}}return!0}function assertMichelsonComparableType(s){if(assertPrimOrSeq(s)){if(Array.isArray(s)||s.prim==="pair"||s.prim==="or"||s.prim==="option")traverseType(s,a=>assertMichelsonComparableType(a));else if(!Object.prototype.hasOwnProperty.call(simpleComparableTypeIDs,s.prim))throw new MichelsonValidationError(s,`${s.prim}: type is not comparable`)}return!0}function assertMichelsonPackableType(s){if(assertPrimOrSeq(s)&&isPrim$1(s)){if(!Object.prototype.hasOwnProperty.call(typeIDs,s.prim)||s.prim==="big_map"||s.prim==="operation"||s.prim==="sapling_state"||s.prim==="ticket")throw new MichelsonValidationError(s,`${s.prim}: type can't be used inside PACK/UNPACK instructions`);traverseType(s,a=>assertMichelsonPackableType(a))}return!0}function assertMichelsonPushableType(s){if(assertPrimOrSeq(s)&&isPrim$1(s)){if(!Object.prototype.hasOwnProperty.call(typeIDs,s.prim)||s.prim==="big_map"||s.prim==="operation"||s.prim==="sapling_state"||s.prim==="ticket"||s.prim==="contract")throw new MichelsonValidationError(s,`${s.prim}: type can't be pushed`);traverseType(s,a=>assertMichelsonPushableType(a))}return!0}function assertMichelsonStorableType(s){if(assertPrimOrSeq(s)&&isPrim$1(s)){if(!Object.prototype.hasOwnProperty.call(typeIDs,s.prim)||s.prim==="operation"||s.prim==="contract")throw new MichelsonValidationError(s,`${s.prim}: type can't be used as part of a storage`);traverseType(s,a=>assertMichelsonStorableType(a))}return!0}function assertMichelsonPassableType(s){if(assertPrimOrSeq(s)&&isPrim$1(s)){if(!Object.prototype.hasOwnProperty.call(typeIDs,s.prim)||s.prim==="operation")throw new MichelsonValidationError(s,`${s.prim}: type can't be used as part of a parameter`);traverseType(s,a=>assertMichelsonPassableType(a))}return!0}function assertMichelsonBigMapStorableType(s){if(assertPrimOrSeq(s)&&isPrim$1(s)){if(!Object.prototype.hasOwnProperty.call(typeIDs,s.prim)||s.prim==="big_map"||s.prim==="operation"||s.prim==="sapling_state")throw new MichelsonValidationError(s,`${s.prim}: type can't be used inside a big_map`);traverseType(s,a=>assertMichelsonBigMapStorableType(a))}return!0}const viewRe=new RegExp("^[a-zA-Z0-9_.%@]*$");function assertViewNameValid(s){if(s.string.length>maxViewNameLength)throw new MichelsonValidationError(s,`view name too long: ${s.string}`);if(!viewRe.test(s.string))throw new MichelsonValidationError(s,`invalid character(s) in view name: ${s.string}`)}function assertMichelsonType(s){if(assertPrimOrSeq(s)&&isPrim$1(s)){if(!Object.prototype.hasOwnProperty.call(typeIDs,s.prim))throw new MichelsonValidationError(s,"type expected");traverseType(s,a=>assertMichelsonType(a))}return!0}function traverseType(s,a){if(Array.isArray(s)||s.prim==="pair"){const u=Array.isArray(s)?s:s.args;if(u===void 0||u.length<2)throw new MichelsonValidationError(s,"at least 2 arguments expected");return u.forEach(l=>{assertPrimOrSeq(l)&&a(l)}),!0}switch(s.prim){case"option":case"list":assertArgs(s,1)&&assertPrimOrSeq(s.args[0])&&a(s.args[0]);break;case"contract":assertArgs(s,1)&&assertMichelsonPassableType(s.args[0]);break;case"or":assertArgs(s,2)&&assertPrimOrSeq(s.args[0])&&assertPrimOrSeq(s.args[1])&&(a(s.args[0]),a(s.args[1]));break;case"lambda":assertArgs(s,2)&&(assertMichelsonType(s.args[0]),assertMichelsonType(s.args[1]));break;case"set":assertArgs(s,1)&&assertMichelsonComparableType(s.args[0]);break;case"map":assertArgs(s,2)&&assertPrimOrSeq(s.args[0])&&assertPrimOrSeq(s.args[1])&&(assertMichelsonComparableType(s.args[0]),a(s.args[1]));break;case"big_map":assertArgs(s,2)&&assertPrimOrSeq(s.args[0])&&assertPrimOrSeq(s.args[1])&&(assertMichelsonComparableType(s.args[0]),assertMichelsonBigMapStorableType(s.args[1]),a(s.args[1]));break;case"ticket":assertArgs(s,1)&&assertPrimOrSeq(s.args[0])&&assertMichelsonComparableType(s.args[0]);break;case"sapling_state":case"sapling_transaction":assertArgs(s,1)&&assertIntLiteral(s.args[0]);break;default:assertArgs(s,0)}return!0}function assertMichelsonData(s){if("int"in s||"string"in s||"bytes"in s)return!0;if(Array.isArray(s)){let a=0;for(const u of s)isPrim$1(u)&&u.prim==="Elt"?(assertArgs(u,2)&&(assertMichelsonData(u.args[0]),assertMichelsonData(u.args[1])),a++):assertMichelsonData(u);if(a!==0&&a!==s.length)throw new MichelsonValidationError(s,"data entries and map elements can't be intermixed");return!0}if(isPrim$1(s))switch(s.prim){case"Unit":case"True":case"False":case"None":assertArgs(s,0);break;case"Pair":if(s.args===void 0||s.args.length<2)throw new MichelsonValidationError(s,"at least 2 arguments expected");for(const a of s.args)assertMichelsonData(a);break;case"Left":case"Right":case"Some":assertArgs(s,1)&&assertMichelsonData(s.args[0]);break;case"Lambda_rec":s.args&&assertMichelsonInstruction(s.args);break;case"Ticket":assertArgs(s,4)&&(assertStringOrBytes(s.args[0]),assertMichelsonType(s.args[1]),assertMichelsonData(s.args[2]),assertIntLiteral(s.args[3]));break;default:if(Object.prototype.hasOwnProperty.call(instructionIDs,s.prim))assertMichelsonInstruction(s);else throw new MichelsonValidationError(s,"data entry or instruction expected")}else throw new MichelsonValidationError(s,"data entry expected");return!0}function assertMichelsonContract(s){if(assertSeq(s)){const a={},u={};for(const l of s)if(assertPrim(l)){if(l.prim!=="view"){if(l.prim in a)throw new MichelsonValidationError(s,`duplicate contract section: ${l.prim}`);a[l.prim]=!0}switch(l.prim){case"code":assertArgs(l,1)&&assertSeq(l.args[0])&&assertMichelsonInstruction(l.args[0]);break;case"parameter":if(assertArgs(l,1)&&assertMichelsonPassableType(l.args[0]),l.annots)throw new MichelsonValidationError(l,"Annotation must be part of the parameter type");break;case"storage":assertArgs(l,1)&&assertMichelsonStorableType(l.args[0]);break;case"view":if(assertArgs(l,4)){if(assertStringLiteral(l.args[0])){const f=l.args[0];if(f.string in u)throw new MichelsonValidationError(s,`duplicate view name: ${f.string}`);u[f.string]=!0,assertViewNameValid(f)}assertMichelsonPushableType(l.args[1]),assertMichelsonPushableType(l.args[2]),assertSeq(l.args[3])&&assertMichelsonInstruction(l.args[3])}break;default:throw new MichelsonValidationError(s,`unexpected contract section: ${l.prim}`)}}}return!0}function isInstruction(s){return Object.prototype.hasOwnProperty.call(instructionIDs,s.prim)}function assertDataListIfAny(s){if(!Array.isArray(s))return!1;for(const a of s)if("prim"in a){if(isInstruction(a))throw new MichelsonError(s,`Instruction outside of a lambda: ${JSON.stringify(s)}`);if(a.prim==="Elt")throw new MichelsonError(s,`Elt item outside of a map literal: ${JSON.stringify(s)}`)}return!0}function __rest$1(s,a){var u={};for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&a.indexOf(l)<0&&(u[l]=s[l]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,l=Object.getOwnPropertySymbols(s);f<l.length;f++)a.indexOf(l[f])<0&&Object.prototype.propertyIsEnumerable.call(s,l[f])&&(u[l[f]]=s[l[f]]);return u}typeof SuppressedError=="function"&&SuppressedError;const primitives=["parameter","storage","code","False","Elt","Left","None","Pair","Right","Some","True","Unit","PACK","UNPACK","BLAKE2B","SHA256","SHA512","ABS","ADD","AMOUNT","AND","BALANCE","CAR","CDR","CHECK_SIGNATURE","COMPARE","CONCAT","CONS","CREATE_ACCOUNT","CREATE_CONTRACT","IMPLICIT_ACCOUNT","DIP","DROP","DUP","EDIV","EMPTY_MAP","EMPTY_SET","EQ","EXEC","FAILWITH","GE","GET","GT","HASH_KEY","IF","IF_CONS","IF_LEFT","IF_NONE","INT","LAMBDA","LE","LEFT","LOOP","LSL","LSR","LT","MAP","MEM","MUL","NEG","NEQ","NIL","NONE","NOT","NOW","OR","PAIR","PUSH","RIGHT","SIZE","SOME","SOURCE","SENDER","SELF","STEPS_TO_QUOTA","SUB","SWAP","TRANSFER_TOKENS","SET_DELEGATE","UNIT","UPDATE","XOR","ITER","LOOP_LEFT","ADDRESS","CONTRACT","ISNAT","CAST","RENAME","bool","contract","int","key","key_hash","lambda","list","map","big_map","nat","option","or","pair","set","signature","string","bytes","mutez","timestamp","unit","operation","address","SLICE","DIG","DUG","EMPTY_BIG_MAP","APPLY","chain_id","CHAIN_ID","LEVEL","SELF_ADDRESS","never","NEVER","UNPAIR","VOTING_POWER","TOTAL_VOTING_POWER","KECCAK","SHA3","PAIRING_CHECK","bls12_381_g1","bls12_381_g2","bls12_381_fr","sapling_state","sapling_transaction_deprecated","SAPLING_EMPTY_STATE","SAPLING_VERIFY_UPDATE","ticket","TICKET_DEPRECATED","READ_TICKET","SPLIT_TICKET","JOIN_TICKETS","GET_AND_UPDATE","chest","chest_key","OPEN_CHEST","VIEW","view","constant","SUB_MUTEZ","tx_rollup_l2_address","MIN_BLOCK_TIME","sapling_transaction","EMIT","Lambda_rec","LAMBDA_REC","TICKET","BYTES","NAT","Ticket"];Object.assign({},...primitives.map((s,a)=>({[s]:a})));var Tag;(function(s){s[s.Int=0]="Int",s[s.String=1]="String",s[s.Sequence=2]="Sequence",s[s.Prim0=3]="Prim0",s[s.Prim0Annot=4]="Prim0Annot",s[s.Prim1=5]="Prim1",s[s.Prim1Annot=6]="Prim1Annot",s[s.Prim2=7]="Prim2",s[s.Prim2Annot=8]="Prim2Annot",s[s.Prim=9]="Prim",s[s.Bytes=10]="Bytes"})(Tag||(Tag={}));const boundsErr=new Error("bounds out of range");class Reader{constructor(a,u=0,l=a.length){this.buffer=a,this.idx=u,this.cap=l}get length(){return this.cap-this.idx}readBytes(a){if(this.cap-this.idx<a)throw boundsErr;const u=this.buffer.slice(this.idx,this.idx+a);return this.idx+=a,u}reader(a){if(this.cap-this.idx<a)throw boundsErr;const u=new Reader(this.buffer,this.idx,this.idx+a);return this.idx+=a,u}copy(){return new Reader(this.buffer,this.idx,this.cap)}readUint8(){if(this.cap-this.idx<1)throw boundsErr;return this.buffer[this.idx++]>>>0}readUint16(){if(this.cap-this.idx<2)throw boundsErr;const a=this.buffer[this.idx++],u=this.buffer[this.idx++];return(a<<8|u)>>>0}readUint32(){if(this.cap-this.idx<4)throw boundsErr;const a=this.buffer[this.idx++],u=this.buffer[this.idx++],l=this.buffer[this.idx++],f=this.buffer[this.idx++];return(a<<24|u<<16|l<<8|f)>>>0}readInt8(){if(this.cap-this.idx<1)throw boundsErr;return this.buffer[this.idx++]<<24>>24}readInt16(){if(this.cap-this.idx<2)throw boundsErr;const a=this.buffer[this.idx++],u=this.buffer[this.idx++];return(a<<8|u)<<16>>16}readInt32(){if(this.cap-this.idx<4)throw boundsErr;const a=this.buffer[this.idx++],u=this.buffer[this.idx++],l=this.buffer[this.idx++],f=this.buffer[this.idx++];return a<<24|u<<16|l<<8|f}}var ContractID;(function(s){s[s.Implicit=0]="Implicit",s[s.Originated=1]="Originated"})(ContractID||(ContractID={}));var PublicKeyHashID;(function(s){s[s.ED25519=0]="ED25519",s[s.SECP256K1=1]="SECP256K1",s[s.P256=2]="P256"})(PublicKeyHashID||(PublicKeyHashID={}));function readPublicKeyHash(s){let a;const u=s.readUint8();switch(u){case PublicKeyHashID.ED25519:a="ED25519PublicKeyHash";break;case PublicKeyHashID.SECP256K1:a="SECP256K1PublicKeyHash";break;case PublicKeyHashID.P256:a="P256PublicKeyHash";break;default:throw new Error(`unknown public key hash tag: ${u}`)}return{type:a,hash:s.readBytes(20)}}function readAddress(s){let a;const u=s.readUint8();switch(u){case ContractID.Implicit:a=readPublicKeyHash(s);break;case ContractID.Originated:a={type:"ContractHash",hash:s.readBytes(20)},s.readBytes(1);break;default:throw new Error(`unknown address tag: ${u}`)}if(s.length!==0){const l=new TextDecoder;a.entryPoint=l.decode(new Uint8Array(s.readBytes(s.length)))}return a}var PublicKeyID;(function(s){s[s.ED25519=0]="ED25519",s[s.SECP256K1=1]="SECP256K1",s[s.P256=2]="P256"})(PublicKeyID||(PublicKeyID={}));function readPublicKey(s){let a,u;const l=s.readUint8();switch(l){case PublicKeyID.ED25519:u="ED25519PublicKey",a=32;break;case PublicKeyID.SECP256K1:u="SECP256K1PublicKey",a=33;break;case PublicKeyID.P256:u="P256PublicKey",a=33;break;default:throw new Error(`unknown public key tag: ${l}`)}return{type:u,publicKey:s.readBytes(a)}}function readExpr(s,a){function*u(){for(;;)yield readPassThrough}const[l,f]=a,c=s.readUint8();switch(c){case Tag.Int:{const h=[];let p;do p=s.readInt8(),h.push(p);while(p&128);let v=BigInt(0),y=!1;for(let b=h.length-1;b>=0;b--){const S=BigInt(b===0?6:7),E=BigInt(h[b]);v<<=S,v|=E&(BigInt(1)<<S)-BigInt(1),b===0&&(y=!!(E&BigInt(64)))}return y&&(v=-v),f({int:String(v)})}case Tag.String:{const h=s.readUint32(),p=s.readBytes(h),v=new TextDecoder;return f({string:v.decode(new Uint8Array(p))})}case Tag.Bytes:{const h=s.readUint32(),p=s.readBytes(h),v=hexBytes(Array.from(p));return f({bytes:v})}case Tag.Sequence:{const h=s.readUint32();let p=[],v=s.copy(),y=u();for(let b=0;b<2;b++){const S=v.reader(h);for(p=[];S.length>0;){const E=y.next();if(E.done)throw new Error("REPORT ME: iterator is done");p.push(readExpr(S,E.value))}y=l(p),v=s}return f(p)}default:{if(c>9)throw new Error(`Unknown tag: ${c}`);const h=s.readUint8();if(h>=primitives.length)throw new Error(`Unknown primitive tag: ${h}`);const p=primitives[h],v=c-3>>1;let y={prim:p},b=u(),S=s.copy();for(let E=0;E<2;E++){if(y={prim:p},v<3)for(let R=0;R<v;R++){const O=b.next();if(O.done)throw new Error("REPORT ME: iterator is done");y.args=y.args||[],y.args.push(readExpr(S,O.value))}else{y.args=y.args||[];const R=S.readUint32(),O=S.reader(R);for(;O.length>0;){const I=b.next();if(I.done)throw new Error("REPORT ME: iterator is done");y.args.push(readExpr(O,I.value))}}b=l(y),S=s}if((c-3&1)===1||v===3){const E=s.readUint32();if(E!==0){const R=s.readBytes(E),O=new TextDecoder;y.annots=O.decode(new Uint8Array(R)).split(" ")}}return f(y)}}}const isOrData=s=>"prim"in s&&(s.prim==="Left"||s.prim==="Right"),isOptionData=s=>"prim"in s&&(s.prim==="Some"||s.prim==="None"),isPushInstruction=s=>"prim"in s&&s.prim==="PUSH",getReadTransformFuncs=s=>{if(isPairType(s))return[a=>{if(!isPairData(a))throw new MichelsonTypeError(s,`pair expected: ${JSON.stringify(a)}`,a);const u=unpackComb("pair",s);return function*(){for(const l of u.args)yield getReadTransformFuncs(l)}()},a=>a];switch(s.prim){case"or":return[a=>{if(!isOrData(a))throw new MichelsonTypeError(s,`or expected: ${JSON.stringify(a)}`,a);return function*(){yield getReadTransformFuncs(s.args[a.prim==="Left"?0:1])}()},a=>a];case"option":return[a=>{if(!isOptionData(a))throw new MichelsonTypeError(s,`option expected: ${JSON.stringify(a)}`,a);return function*(){a.prim==="Some"&&(yield getReadTransformFuncs(s.args[0]))}()},a=>a];case"list":case"set":return[a=>{if(!Array.isArray(a))throw new MichelsonTypeError(s,`${s.prim} expected: ${JSON.stringify(a)}`,a);return function*(){for(;;)yield getReadTransformFuncs(s.args[0])}()},a=>a];case"map":return[a=>{if(!Array.isArray(a))throw new MichelsonTypeError(s,`map expected: ${JSON.stringify(a)}`,a);return function*(){for(;;)yield[u=>{if(!("prim"in u)||u.prim!=="Elt")throw new MichelsonTypeError(s,`map element expected: ${JSON.stringify(u)}`,u);return function*(){for(const l of s.args)yield getReadTransformFuncs(l)}()},u=>u]}()},a=>a];case"chain_id":return[()=>[][Symbol.iterator](),a=>{if(!("bytes"in a)&&!("string"in a))throw new MichelsonTypeError(s,`chain id expected: ${JSON.stringify(a)}`,a);if("string"in a)return a;const u=parseBytes(a.bytes);if(u===null)throw new MichelsonTypeError(s,`can't parse bytes: ${a.bytes}`,a);return{string:encodeTezosID("ChainID",u)}}];case"signature":return[()=>[][Symbol.iterator](),a=>{if(!("bytes"in a)&&!("string"in a))throw new MichelsonTypeError(s,`signature expected: ${JSON.stringify(a)}`,a);if("string"in a)return a;const u=parseBytes(a.bytes);if(u===null)throw new MichelsonTypeError(s,`can't parse bytes: ${a.bytes}`,a);return{string:encodeTezosID("GenericSignature",u)}}];case"key_hash":return[()=>[][Symbol.iterator](),a=>{if(!("bytes"in a)&&!("string"in a))throw new MichelsonTypeError(s,`key hash expected: ${JSON.stringify(a)}`,a);if("string"in a)return a;const u=parseBytes(a.bytes);if(u===null)throw new MichelsonTypeError(s,`can't parse bytes: ${a.bytes}`,a);const l=new Reader(new Uint8Array(u)),f=readPublicKeyHash(l);return{string:encodeTezosID(f.type,f.hash)+(f.entryPoint?"%"+f.entryPoint:"")}}];case"key":return[()=>[][Symbol.iterator](),a=>{if(!("bytes"in a)&&!("string"in a))throw new MichelsonTypeError(s,`public key expected: ${JSON.stringify(a)}`,a);if("string"in a)return a;const u=parseBytes(a.bytes);if(u===null)throw new MichelsonTypeError(s,`can't parse bytes: ${a.bytes}`,a);const l=new Reader(new Uint8Array(u)),f=readPublicKey(l);return{string:encodeTezosID(f.type,f.publicKey)}}];case"address":return[()=>[][Symbol.iterator](),a=>{if(!("bytes"in a)&&!("string"in a))throw new MichelsonTypeError(s,`address expected: ${JSON.stringify(a)}`,a);if("string"in a)return a;const u=parseBytes(a.bytes);if(u===null)throw new MichelsonTypeError(s,`can't parse bytes: ${a.bytes}`,a);const l=new Reader(new Uint8Array(u)),f=readAddress(l);return{string:encodeTezosID(f.type,f.hash)+(f.entryPoint?"%"+f.entryPoint:"")}}];case"timestamp":return[()=>[][Symbol.iterator](),a=>{if(!("int"in a)&&!("string"in a))throw new MichelsonTypeError(s,`address expected: ${JSON.stringify(a)}`,a);return"string"in a?a:{string:new Date(parseInt(a.int,10)*1e3).toISOString().slice(0,19)+"Z"}}];default:return readPassThrough}},readPassThrough=[s=>isPushInstruction(s)?(assertMichelsonInstruction(s),function*(){yield readPassThrough,yield getReadTransformFuncs(s.args[0])}()):function*(){for(;;)yield readPassThrough}(),s=>s];function unpackData(s,a){const u=new Reader(s);if(u.readUint8()!==5)throw new Error("incorrect packed data magic number");const l=readExpr(u,readPassThrough);if(assertMichelsonData(l))return l;throw new Error}function decodeAddressBytes(s){const a=parseBytes(s.bytes);if(a===null)throw new Error(`can't parse bytes: "${s.bytes}"`);const u=new Reader(new Uint8Array(a));return readAddress(u)}function decodePublicKeyHashBytes(s){const a=parseBytes(s.bytes);if(a===null)throw new Error(`can't parse bytes: "${s.bytes}"`);const u=new Reader(new Uint8Array(a));return readPublicKeyHash(u)}function decodePublicKeyBytes(s){const a=parseBytes(s.bytes);if(a===null)throw new Error(`can't parse bytes: "${s.bytes}"`);const u=new Reader(new Uint8Array(a));return readPublicKey(u)}class MichelsonInstructionError extends MichelsonError{constructor(a,u,l){super(a,l),this.val=a,this.stackState=u,this.message=l,this.name="MichelsonInstructionError"}}function typeID(s){return Array.isArray(s)?"pair":s.prim}function typeArgs(s){return"prim"in s?s.args:s}function assertScalarTypesEqual(s,a,u=!1){if(typeID(s)!==typeID(a))throw new MichelsonTypeError(s,`types mismatch: ${typeID(s)} != ${typeID(a)}`,void 0);const l=[unpackAnnotations(s),unpackAnnotations(a)];if(l[0].t&&l[1].t&&l[0].t[0]!==l[1].t[0])throw new MichelsonTypeError(s,`${typeID(s)}: type names mismatch: ${l[0].t[0]} != ${l[1].t[0]}`,void 0);if(u&&l[0].f&&l[1].f&&l[0].f[0]!==l[1].f[0])throw new MichelsonTypeError(s,`${typeID(s)}: field names mismatch: ${l[0].f[0]} != ${l[1].f}`,void 0);if(isPairType(s)){const f=unpackComb("pair",s),c=unpackComb("pair",a);assertScalarTypesEqual(f.args[0],c.args[0],!0),assertScalarTypesEqual(f.args[1],c.args[1],!0);return}switch(s.prim){case"option":case"list":case"contract":case"set":case"ticket":assertScalarTypesEqual(s.args[0],a.args[0]);break;case"or":assertScalarTypesEqual(s.args[0],a.args[0],!0),assertScalarTypesEqual(s.args[1],a.args[1],!0);break;case"lambda":case"map":case"big_map":assertScalarTypesEqual(s.args[0],a.args[0]),assertScalarTypesEqual(s.args[1],a.args[1]);break;case"sapling_state":case"sapling_transaction":if(parseInt(s.args[0].int,10)!==parseInt(a.args[0].int,10))throw new MichelsonTypeError(s,`${typeID(s)}: type argument mismatch: ${s.args[0].int} != ${a.args[0].int}`,void 0)}}function assertStacksEqual(s,a){if(s.length!==a.length)throw new MichelsonTypeError(s,`stack length mismatch: ${s.length} != ${a.length}`,void 0);for(let u=0;u<s.length;u++)assertScalarTypesEqual(s[u],a[u])}function assertTypeAnnotationsValid(s,a=!1){var u,l,f;if(!Array.isArray(s)){const c=unpackAnnotations(s);if((((u=c.t)===null||u===void 0?void 0:u.length)||0)>1)throw new MichelsonTypeError(s,`${s.prim}: at most one type annotation allowed: ${s.annots}`,void 0);if(a){if((((l=c.f)===null||l===void 0?void 0:l.length)||0)>1)throw new MichelsonTypeError(s,`${s.prim}: at most one field annotation allowed: ${s.annots}`,void 0)}else if((((f=c.f)===null||f===void 0?void 0:f.length)||0)>0)throw new MichelsonTypeError(s,`${s.prim}: field annotations aren't allowed: ${s.annots}`,void 0)}if(isPairType(s)){const c=typeArgs(s);for(const h of c)assertTypeAnnotationsValid(h,!0);return}switch(s.prim){case"option":case"list":case"contract":case"set":assertTypeAnnotationsValid(s.args[0]);break;case"or":for(const c of s.args)assertTypeAnnotationsValid(c,!0);break;case"lambda":case"map":case"big_map":assertTypeAnnotationsValid(s.args[0]),assertTypeAnnotationsValid(s.args[1])}}function isFunction(s){if(!Array.isArray(s))return!1;for(const a of s)if(!(Array.isArray(a)&&isFunction(a)||"prim"in a&&isInstruction(a)))return!1;return!0}function assertDataValidInternal(s,a,u){if(isPairType(a)){if(isPairData(s)){assertDataListIfAny(s);const l=unpackComb("Pair",s),f=unpackComb("pair",a);assertDataValidInternal(l.args[0],f.args[0],u),assertDataValidInternal(l.args[1],f.args[1],u);return}throw new MichelsonTypeError(a,`pair expected: ${JSON.stringify(s)}`,s)}switch(a.prim){case"int":if("int"in s&&isDecimal(s.int))return;throw new MichelsonTypeError(a,`integer value expected: ${JSON.stringify(s)}`,s);case"nat":case"mutez":if("int"in s&&isNatural(s.int))return;throw new MichelsonTypeError(a,`natural value expected: ${JSON.stringify(s)}`,s);case"string":if("string"in s)return;throw new MichelsonTypeError(a,`string value expected: ${JSON.stringify(s)}`,s);case"bytes":case"bls12_381_g1":case"bls12_381_g2":if("bytes"in s&&parseBytes(s.bytes)!==null)return;throw new MichelsonTypeError(a,`bytes value expected: ${JSON.stringify(s)}`,s);case"bool":if("prim"in s&&(s.prim==="True"||s.prim==="False"))return;throw new MichelsonTypeError(a,`boolean value expected: ${JSON.stringify(s)}`,s);case"key_hash":if("string"in s&&checkDecodeTezosID(s.string,"ED25519PublicKeyHash","SECP256K1PublicKeyHash","P256PublicKeyHash")!==null)return;if("bytes"in s)try{decodePublicKeyHashBytes(s);return}catch{}throw new MichelsonTypeError(a,`key hash expected: ${JSON.stringify(s)}`,s);case"timestamp":if(("string"in s||"int"in s)&&parseDate(s)!==null)return;throw new MichelsonTypeError(a,`timestamp expected: ${JSON.stringify(s)}`,s);case"address":if("string"in s){let l=s.string;const f=s.string.indexOf("%");if(f>=0&&(l=s.string.slice(0,f)),checkDecodeTezosID(l,"ED25519PublicKeyHash","SECP256K1PublicKeyHash","P256PublicKeyHash","ContractHash","RollupAddress")!==null)return}else if("bytes"in s)try{decodeAddressBytes(s);return}catch{}throw new MichelsonTypeError(a,`address expected: ${JSON.stringify(s)}`,s);case"key":if("string"in s&&checkDecodeTezosID(s.string,"ED25519PublicKey","SECP256K1PublicKey","P256PublicKey")!==null)return;if("bytes"in s)try{decodePublicKeyBytes(s);return}catch{}throw new MichelsonTypeError(a,`public key expected: ${JSON.stringify(s)}`,s);case"unit":if("prim"in s&&s.prim==="Unit")return;throw new MichelsonTypeError(a,`unit value expected: ${JSON.stringify(s)}`,s);case"signature":if("bytes"in s||"string"in s&&checkDecodeTezosID(s.string,"ED25519Signature","SECP256K1Signature","P256Signature","GenericSignature")!==null)return;throw new MichelsonTypeError(a,`signature expected: ${JSON.stringify(s)}`,s);case"chain_id":if(("bytes"in s||"string"in s)&&("string"in s?decodeBase58Check(s.string):parseBytes(s.bytes))!==null)return;throw new MichelsonTypeError(a,`chain id expected: ${JSON.stringify(s)}`,s);case"option":if("prim"in s){if(s.prim==="None")return;if(s.prim==="Some"){assertDataValidInternal(s.args[0],a.args[0],u);return}}throw new MichelsonTypeError(a,`option expected: ${JSON.stringify(s)}`,s);case"list":case"set":if(assertDataListIfAny(s)){for(const l of s)assertDataValidInternal(l,a.args[0],u);return}throw new MichelsonTypeError(a,`${a.prim} expected: ${JSON.stringify(s)}`,s);case"or":if("prim"in s){if(s.prim==="Left"){assertDataValidInternal(s.args[0],a.args[0],u);return}else if(s.prim==="Right"){assertDataValidInternal(s.args[0],a.args[1],u);return}}throw new MichelsonTypeError(a,`union (or) expected: ${JSON.stringify(s)}`,s);case"lambda":if(isFunction(s)){const l=functionTypeInternal(s,[a.args[0]],u);if("failed"in l)throw new MichelsonTypeError(a,`function is failed with error type: ${l.failed}`,s);if(l.length!==1)throw new MichelsonTypeError(a,"function must return a value",s);assertScalarTypesEqual(a.args[1],l[0]);return}throw new MichelsonTypeError(a,`function expected: ${JSON.stringify(s)}`,s);case"map":case"big_map":if(Array.isArray(s)){for(const l of s){if(!("prim"in l)||l.prim!=="Elt")throw new MichelsonTypeError(a,`map elements expected: ${JSON.stringify(s)}`,s);assertDataValidInternal(l.args[0],a.args[0],u),assertDataValidInternal(l.args[1],a.args[1],u)}return}throw new MichelsonTypeError(a,`${a.prim} expected: ${JSON.stringify(s)}`,s);case"bls12_381_fr":if("int"in s&&isDecimal(s.int)||"bytes"in s&&parseBytes(s.bytes)!==null)return;throw new MichelsonTypeError(a,`BLS12-381 element expected: ${JSON.stringify(s)}`,s);case"sapling_state":if(Array.isArray(s))return;throw new MichelsonTypeError(a,`sapling state expected: ${JSON.stringify(s)}`,s);case"ticket":if("prim"in s&&s.prim==="Ticket"){assertDataValidInternal(s.args[0],{prim:"address"},u),assertTypesEqual(s.args[1],a.args[0]),assertDataValidInternal(s.args[2],a.args[0],u),assertDataValidInternal(s.args[3],{prim:"nat"},u);return}else if(isPairData(s)){assertDataValidInternal(s,{prim:"pair",args:[{prim:"address"},a.args[0],{prim:"nat"}]},u);return}throw new MichelsonTypeError(a,`ticket expected: ${JSON.stringify(s)}`,s);default:throw new MichelsonTypeError(a,`type ${typeID(a)} don't have Michelson literal representation`,s)}}function instructionListType(s,a,u){let l=a,f=a,c=0;for(const h of s){const p=functionTypeInternal(h,f,u);if(l=p,"failed"in p)break;f=p,c++}if("failed"in l&&l.level==0&&(!("prim"in l.failed)||l.failed.prim!=="never")&&c!==s.length-1)throw new MichelsonInstructionError(s,l,"FAIL must appear in a tail position");if((u==null?void 0:u.traceCallback)!==void 0){const h={op:s,in:a,out:l};u.traceCallback(h)}return"failed"in l?{failed:l.failed,level:l.level+1}:l}function functionTypeInternal(s,a,u){const l=(u==null?void 0:u.protocol)||DefaultProtocol;if(Array.isArray(s))return instructionListType(s,a,u);const f=s;function c(ee,...k){if(a.length<k.length+ee)throw new MichelsonInstructionError(f,a,`${f.prim}: stack must have at least ${k.length} element(s)`);let d=ee;for(const g of k){if(g!==null&&g.length!==0){let _=0;for(;_<g.length&&g[_]!==typeID(a[d]);)_++;if(_===g.length)throw new MichelsonInstructionError(f,a,`${f.prim}: stack type mismatch: [${d}] expected to be ${g}, got ${typeID(a[d])} instead`)}d++}return a.slice(ee,k.length+ee)}function h(ee){return(...k)=>{try{return ee(...k)}catch(d){throw d instanceof MichelsonError?new MichelsonInstructionError(f,a,d.message):d}}}function p(ee){return k=>{try{return ee(k)}catch(d){throw d instanceof MichelsonError?new MichelsonInstructionError(f,a,d.message):d}}}const v=h(unpackAnnotations),y=h(assertStacksEqual),b=h(assertScalarTypesEqual),S=p(assertMichelsonComparableType),E=p(assertMichelsonPackableType),R=p(assertMichelsonStorableType),O=p(assertMichelsonPushableType),I=p(assertMichelsonBigMapStorableType);function B(ee,k){const d=v(f,Object.assign(Object.assign({},k),{emptyFields:ee.f!==void 0&&ee.f>1,emptyVar:ee.v!==void 0&&ee.v>1})),g=(_,w,x)=>{if(_&&_.length>(w||0))throw new MichelsonInstructionError(f,a,`${f.prim}: at most ${w||0} ${x} annotations allowed`)};return g(d.f,ee.f,"field"),g(d.t,ee.t,"type"),g(d.v,ee.v,"variable"),d}function N(ee,k){const d=ee,g=Array.isArray(d)?{prim:"pair",args:d}:d,_=v(g),w=k.v!==void 0||k.t!==void 0||k.f!==void 0?[...(k.v===null?_.v:k.v)||[],...(k.t===null?_.t:k.t)||[],...(k.f===null?_.f:k.f)||[]]:void 0,x=__rest$1(g,["annots"]);return Object.assign(Object.assign({},x),w&&w.length!==0&&{annots:w})}function D(ee,k){const d=B({v:1});return N(ee,{v:d.v!==void 0?d.v:k!==void 0?[k]:null,t:null})}function G(ee,k,d,g,_){var w,x,P,$;const T=(w=v(k).f)===null||w===void 0?void 0:w[0],m=(x=d.f)===null||x===void 0?void 0:x[g];if(m!==void 0&&m!=="%"&&T!==void 0&&m!==T)throw new MichelsonInstructionError(f,a,`${f.prim}: field names doesn't match: ${m} !== ${T}`);const M=(P=d.v)===null||P===void 0?void 0:P[g],W=($=v(ee).v)===null||$===void 0?void 0:$[0];return N(k,{t:null,v:M?M==="@%"?T?["@"+T.slice(1)]:void 0:M==="@%%"?W?["@"+W.slice(1)+"."+(T?T.slice(1):_)]:T?["@"+T.slice(1)]:void 0:[M]:null})}function V(ee,k,d=k){const g=unpackComb("pair",ee);if(d===1)return[g.args[0]];if(d===2)return g.args;const _=g.args[1];if(isPairType(_))return[g.args[0],...V(_,k,d-1)];throw new MichelsonInstructionError(f,a,`${f.prim}: at least ${k} fields are expected`)}function U(ee,k,d=k){if(d===0)return ee;const g=unpackComb("pair",ee);if(d===1)return g.args[0];const _=g.args[1];if(isPairType(_))return U(_,k,d-2);if(d===2)return _;throw new MichelsonInstructionError(f,a,`${f.prim}: at least ${k+1} fields are expected`)}function te(ee,k,d,g=d){if(g===0)return k;const _=unpackComb("pair",ee);if(g===1)return Object.assign(Object.assign({},_),{args:[k,_.args[1]]});const w=_.args[1];if(isPairType(w))return Object.assign(Object.assign({},_),{args:[_.args[0],te(w,k,d,g-2)]});if(g===2)return Object.assign(Object.assign({},_),{args:[_.args[0],k]});throw new MichelsonInstructionError(f,a,`${f.prim}: at least ${d+1} fields are expected`)}const Z=(ee,k)=>["@"+(ee.v?ee.v[0].slice(1)+".":"")+k];function J(ee,k){return"failed"in ee||"failed"in k?"failed"in ee?k:ee:(y(ee,k),ee)}const Q=(ee=>{var k,d,g,_,w;switch(ee.prim){case"DUP":{const x=ee.args?parseInt(ee.args[0].int,10):1;if(x===0)throw new MichelsonInstructionError(ee,a,"DUP 0 is forbidden");const P=c(x-1,null)[0];if(typeID(P)==="ticket")throw new MichelsonInstructionError(ee,a,"ticket can't be DUPed");return[P,...a]}case"SWAP":{const x=c(0,null,null);return B({}),[x[1],x[0],...a.slice(2)]}case"SOME":return[N({prim:"option",args:[c(0,null)[0]]},B({t:1,v:1})),...a.slice(1)];case"UNIT":return[N({prim:"unit"},B({v:1,t:1})),...a];case"PAIR":{const x=ee.args?parseInt(ee.args[0].int,10):2;if(x<2)throw new MichelsonInstructionError(ee,a,`PAIR ${x} is forbidden`);const P=c(0,...new Array(x).fill(null)),$=B({f:x,t:1,v:1},{specialFields:!0}),T=M=>{const W=M.lastIndexOf(".");return M.slice(W>0?W+1:1)},m=P.map((M,W)=>{var Y;const ue=v(M),ge=$.f&&$.f.length>W&&$.f[W]!=="%"?$.f[W]==="%@"?ue.v?["%"+T(((Y=ue.v)===null||Y===void 0?void 0:Y[0])||"")]:void 0:[$.f[W]]:void 0;return N(M,{v:null,t:null,f:ge})});return[N({prim:"pair",args:m},{t:$.t,v:$.v}),...a.slice(x)]}case"UNPAIR":{const x=ee.args?parseInt(ee.args[0].int,10):2;if(x<2)throw new MichelsonInstructionError(ee,a,`UNPAIR ${x} is forbidden`);const P=c(0,["pair"])[0],$=B({f:2,v:2},{specialVar:!0});return[...V(P,x).map((m,M)=>G(P,m,$,M,M===0?"car":"cdr")),...a.slice(1)]}case"CAR":case"CDR":{const x=unpackComb("pair",c(0,["pair"])[0]),P=x.args[ee.prim==="CAR"?0:1],$=B({f:1,v:1},{specialVar:!0});return[G(x,P,$,0,ee.prim.toLocaleLowerCase()),...a.slice(1)]}case"CONS":{const x=c(0,null,["list"]);return b(x[0],x[1].args[0]),[D({prim:"list",args:[x[1].args[0]]}),...a.slice(2)]}case"SIZE":return c(0,["string","list","set","map","bytes"]),[D({prim:"nat"}),...a.slice(1)];case"MEM":{const x=c(0,null,["set","map","big_map"]);return S(x[0]),b(x[0],x[1].args[0]),[D({prim:"bool"}),...a.slice(2)]}case"GET":if(ee.args){const x=parseInt(ee.args[0].int,10),P=c(0,["pair"])[0];return[D(U(P,x)),...a.slice(1)]}else{const x=c(0,null,["map","big_map"]);return S(x[0]),b(x[0],x[1].args[0]),[D({prim:"option",args:[x[1].args[1]]}),...a.slice(2)]}case"UPDATE":if(ee.args){const x=parseInt(ee.args[0].int,10),P=c(0,null,["pair"]);return[D(te(P[1],P[0],x)),...a.slice(2)]}else{const x=c(0,null,["bool","option"]);if(S(x[0]),x[1].prim==="bool"){const $=c(2,["set"]);return b(x[0],$[0].args[0]),[D({prim:"set",args:[N(x[0],{t:null})]}),...a.slice(3)]}const P=c(2,["map","big_map"]);return b(x[0],P[0].args[0]),P[0].prim==="map"?[D({prim:"map",args:[N(x[0],{t:null}),N(x[1].args[0],{t:null})]}),...a.slice(3)]:(I(x[1].args[0]),[D({prim:"big_map",args:[N(x[0],{t:null}),N(x[1].args[0],{t:null})]}),...a.slice(3)])}case"GET_AND_UPDATE":{const x=B({v:2}),P=c(0,null,["option"],["map","big_map"]);S(P[0]),b(P[0],P[2].args[0]),b(P[1].args[0],P[2].args[1]);const $=(k=x.v)===null||k===void 0?void 0:k.map(T=>T!=="@"?[T]:void 0);return P[2].prim==="map"?[N({prim:"option",args:[P[2].args[1]]},{v:$==null?void 0:$[0]}),N({prim:"map",args:[N(P[0],{t:null}),N(P[1].args[0],{t:null})]},{v:$==null?void 0:$[1]}),...a.slice(3)]:(I(P[1].args[0]),[N({prim:"option",args:[P[2].args[1]]},{v:$==null?void 0:$[0]}),N({prim:"big_map",args:[N(P[0],{t:null}),N(P[1].args[0],{t:null})]},{v:$==null?void 0:$[1]}),...a.slice(3)])}case"EXEC":{const x=c(0,null,["lambda"]);return b(x[0],x[1].args[0]),[D(x[1].args[1]),...a.slice(2)]}case"APPLY":{const x=c(0,null,["lambda"]);if(R(x[0]),O(x[0]),!isPairType(x[1].args[0]))throw new MichelsonInstructionError(ee,a,`${ee.prim}: function's argument must be a pair: ${typeID(x[1].args[0])}`);const P=x[1].args[0];return b(x[0],typeArgs(P)[0]),[D({prim:"lambda",args:[typeArgs(P)[1],x[1].args[1]]}),...a.slice(2)]}case"FAILWITH":{const x=c(0,null)[0];return ProtoInferiorTo(l,Protocol.PtEdo2Zk)||E(x),{failed:x,level:0}}case"NEVER":return c(0,["never"]),{failed:{prim:"never"},level:0};case"RENAME":return[D(c(0,null)[0]),...a.slice(1)];case"CONCAT":{const x=c(0,["string","list","bytes"]);if(x[0].prim==="list"){if(typeID(x[0].args[0])!=="string"&&typeID(x[0].args[0])!=="bytes")throw new MichelsonInstructionError(ee,a,`${ee.prim}: can't concatenate list of ${typeID(x[0].args[0])}'s`);return[D(x[0].args[0]),...a.slice(1)]}const P=c(1,["string","bytes"]);if(x[0].prim!==P[0].prim)throw new MichelsonInstructionError(ee,a,`${ee.prim}: can't concatenate ${x[0].prim} with ${P[0].prim}`);return[D(P[0]),...a.slice(2)]}case"SLICE":return[D({prim:"option",args:[c(0,["nat"],["nat"],["string","bytes"])[2]]},"@slice"),...a.slice(3)];case"PACK":{const x=c(0,null)[0];return E(x),[D({prim:"bytes"},"@packed"),...a.slice(1)]}case"ADD":{const x=c(0,["nat","int","timestamp","mutez","bls12_381_g1","bls12_381_g2","bls12_381_fr"],["nat","int","timestamp","mutez","bls12_381_g1","bls12_381_g2","bls12_381_fr"]);if(x[0].prim==="nat"&&x[1].prim==="int"||x[0].prim==="int"&&x[1].prim==="nat")return[D({prim:"int"}),...a.slice(2)];if(x[0].prim==="int"&&x[1].prim==="timestamp"||x[0].prim==="timestamp"&&x[1].prim==="int")return[D({prim:"timestamp"}),...a.slice(2)];if((x[0].prim==="int"||x[0].prim==="nat"||x[0].prim==="mutez"||x[0].prim==="bls12_381_g1"||x[0].prim==="bls12_381_g2"||x[0].prim==="bls12_381_fr")&&x[0].prim===x[1].prim)return[D(x[0]),...a.slice(2)];throw new MichelsonInstructionError(ee,a,`${ee.prim}: can't add ${x[0].prim} to ${x[1].prim}`)}case"SUB":{const x=ProtoInferiorTo(l,Protocol.PsiThaCa)?c(0,["nat","int","timestamp","mutez"],["nat","int","timestamp","mutez"]):c(0,["nat","int","timestamp"],["nat","int","timestamp"]);if((x[0].prim==="nat"||x[0].prim==="int")&&(x[1].prim==="nat"||x[1].prim==="int")||x[0].prim==="timestamp"&&x[1].prim==="timestamp")return[D({prim:"int"}),...a.slice(2)];if(x[0].prim==="timestamp"&&x[1].prim==="int")return[D({prim:"timestamp"}),...a.slice(2)];if(x[0].prim==="mutez"&&x[1].prim==="mutez")return[D({prim:"mutez"}),...a.slice(2)];throw new MichelsonInstructionError(ee,a,`${ee.prim}: can't subtract ${x[0].prim} from ${x[1].prim}`)}case"SUB_MUTEZ":return c(0,["mutez"],["mutez"]),[D({prim:"option",args:[{prim:"mutez"}]}),...a.slice(2)];case"MUL":{const x=c(0,["nat","int","mutez","bls12_381_g1","bls12_381_g2","bls12_381_fr"],["nat","int","mutez","bls12_381_g1","bls12_381_g2","bls12_381_fr"]);if(x[0].prim==="nat"&&x[1].prim==="int"||x[0].prim==="int"&&x[1].prim==="nat")return[D({prim:"int"}),...a.slice(2)];if(x[0].prim==="nat"&&x[1].prim==="mutez"||x[0].prim==="mutez"&&x[1].prim==="nat")return[D({prim:"mutez"}),...a.slice(2)];if((x[0].prim==="bls12_381_g1"||x[0].prim==="bls12_381_g2"||x[0].prim==="bls12_381_fr")&&x[1].prim==="bls12_381_fr"||(x[0].prim==="nat"||x[0].prim==="int")&&x[0].prim===x[1].prim)return[D(x[0]),...a.slice(2)];if((x[0].prim==="nat"||x[0].prim==="int")&&x[1].prim==="bls12_381_fr"||(x[1].prim==="nat"||x[1].prim==="int")&&x[0].prim==="bls12_381_fr")return[D({prim:"bls12_381_fr"}),...a.slice(2)];throw new MichelsonInstructionError(ee,a,`${ee.prim}: can't multiply ${x[0].prim} by ${x[1].prim}`)}case"EDIV":{const x=($,T)=>({prim:"option",args:[{prim:"pair",args:[{prim:$},{prim:T}]}]}),P=c(0,["nat","int","mutez"],["nat","int","mutez"]);if(P[0].prim==="nat"&&P[1].prim==="nat")return[D(x("nat","nat")),...a.slice(2)];if((P[0].prim==="nat"||P[0].prim==="int")&&(P[1].prim==="nat"||P[1].prim==="int"))return[D(x("int","nat")),...a.slice(2)];if(P[0].prim==="mutez"&&P[1].prim==="nat")return[D(x("mutez","mutez")),...a.slice(2)];if(P[0].prim==="mutez"&&P[1].prim==="mutez")return[D(x("nat","mutez")),...a.slice(2)];throw new MichelsonInstructionError(ee,a,`${ee.prim}: can't euclideally divide ${P[0].prim} by ${P[1].prim}`)}case"ABS":return c(0,["int"]),[D({prim:"nat"}),...a.slice(1)];case"ISNAT":return c(0,["int"]),[D({prim:"option",args:[{prim:"nat"}]}),...a.slice(1)];case"INT":return c(0,["nat","bls12_381_fr","bytes"]),[D({prim:"int"}),...a.slice(1)];case"BYTES":return c(0,["nat","int"]),[D({prim:"bytes"}),...a.slice(1)];case"NAT":return c(0,["bytes"]),[D({prim:"nat"}),...a.slice(1)];case"NEG":{const x=c(0,["nat","int","bls12_381_g1","bls12_381_g2","bls12_381_fr"])[0];return x.prim==="nat"||x.prim==="int"?[D({prim:"int"}),...a.slice(1)]:[D(x),...a.slice(1)]}case"LSL":case"LSR":return c(0,["nat","bytes"],["nat","bytes"]),[D({prim:"nat"}),...a.slice(2)];case"OR":case"XOR":{const x=c(0,["nat","bytes","bool"],["nat","bytes","bool"]);if(x[0].prim!==x[1].prim)throw new MichelsonInstructionError(ee,a,`${ee.prim}: both arguments must be of the same type: ${x[0].prim}, ${x[1].prim}`);return[D(x[1]),...a.slice(2)]}case"AND":{const x=c(0,["nat","bytes","bool","int"],["nat","bytes","bool"]);if((x[0].prim!=="int"||x[1].prim!=="nat")&&x[0].prim!==x[1].prim)throw new MichelsonInstructionError(ee,a,`${ee.prim}: both arguments must be of the same type: ${x[0].prim}, ${x[1].prim}`);return[D(x[1]),...a.slice(2)]}case"NOT":return c(0,["nat","bytes","bool","int"])[0].prim==="bool"?[D({prim:"bool"}),...a.slice(1)]:[D({prim:"int"}),...a.slice(1)];case"COMPARE":{const x=c(0,null,null);return S(x[0]),S(x[1]),[D({prim:"int"}),...a.slice(2)]}case"EQ":case"NEQ":case"LT":case"GT":case"LE":case"GE":return c(0,["int"]),[D({prim:"bool"}),...a.slice(1)];case"SELF":{if((u==null?void 0:u.contract)===void 0)throw new MichelsonInstructionError(ee,a,`${ee.prim}: contract required`);const x=B({f:1,v:1}),P=contractEntryPoint(u.contract,(d=x.f)===null||d===void 0?void 0:d[0]);if(P===null)throw new MichelsonInstructionError(ee,a,`${ee.prim}: contract has no entrypoint ${P}`);return[N({prim:"contract",args:[P]},{v:x.v?x.v:["@self"]}),...a]}case"TRANSFER_TOKENS":{const x=c(0,null,["mutez"],["contract"]);return b(x[0],x[2].args[0]),[D({prim:"operation"}),...a.slice(3)]}case"SET_DELEGATE":{const x=c(0,["option"])[0];if(typeID(x.args[0])!=="key_hash")throw new MichelsonInstructionError(ee,a,`${ee.prim}: key hash expected: ${typeID(x.args[0])}`);return[D({prim:"operation"}),...a.slice(1)]}case"IMPLICIT_ACCOUNT":return c(0,["key_hash"]),[D({prim:"contract",args:[{prim:"unit"}]}),...a.slice(1)];case"NOW":return[D({prim:"timestamp"},"@now"),...a];case"AMOUNT":return[D({prim:"mutez"},"@amount"),...a];case"BALANCE":return[D({prim:"mutez"},"@balance"),...a];case"CHECK_SIGNATURE":return c(0,["key"],["signature"],["bytes"]),[D({prim:"bool"}),...a.slice(3)];case"BLAKE2B":case"SHA256":case"SHA512":case"KECCAK":case"SHA3":return c(0,["bytes"]),[D({prim:"bytes"}),...a.slice(1)];case"HASH_KEY":return c(0,["key"]),[D({prim:"key_hash"}),...a.slice(1)];case"SOURCE":return[D({prim:"address"},"@source"),...a];case"SENDER":return[D({prim:"address"},"@sender"),...a];case"ADDRESS":{const x=c(0,["contract"])[0],P=B({v:1});return[N({prim:"address",[refContract]:x},{v:P.v?P.v:Z(v(x),"address")}),...a.slice(1)]}case"SELF_ADDRESS":{const x={prim:"address"};return(u==null?void 0:u.contract)!==void 0&&(x[refContract]={prim:"contract",args:[contractSection(u.contract,"parameter").args[0]]}),[D(x,"@address"),...a]}case"CHAIN_ID":return[D({prim:"chain_id"}),...a];case"DROP":{B({});const x=ee.args!==void 0?parseInt(ee.args[0].int,10):1;return c(x-1,null),a.slice(x)}case"DIG":{B({});const x=parseInt(ee.args[0].int,10);return[c(x,null)[0],...a.slice(0,x),...a.slice(x+1)]}case"DUG":{B({});const x=parseInt(ee.args[0].int,10);return[...a.slice(1,x+1),c(0,null)[0],...a.slice(x+1)]}case"NONE":return assertTypeAnnotationsValid(ee.args[0]),[N({prim:"option",args:[ee.args[0]]},B({t:1,v:1})),...a];case"LEFT":case"RIGHT":{const x=c(0,null)[0],P=B({f:2,t:1,v:1},{specialFields:!0}),$=v(x),T=[N(x,{t:null,v:null,f:P.f&&P.f.length>0&&P.f[0]!=="%"?P.f[0]==="%@"?$.v?["%"+$.v[0].slice(1)]:void 0:P.f:void 0}),N(ee.args[0],{t:null,f:P.f&&P.f.length>1&&P.f[1]!=="%"?P.f:void 0})];return[N({prim:"or",args:ee.prim==="LEFT"?T:[T[1],T[0]]},{t:P.t,v:P.v}),...a.slice(1)]}case"NIL":return assertTypeAnnotationsValid(ee.args[0]),[N({prim:"list",args:[ee.args[0]]},B({t:1,v:1})),...a];case"UNPACK":return c(0,["bytes"]),assertTypeAnnotationsValid(ee.args[0]),[D({prim:"option",args:[ee.args[0]]},"@unpacked"),...a.slice(1)];case"CONTRACT":{const x=c(0,["address"])[0];assertTypeAnnotationsValid(ee.args[0]);const P=B({v:1,f:1}),$=x[refContract];if($!==void 0){const T=contractEntryPoint($,(g=P.f)===null||g===void 0?void 0:g[0]);if(T===null)throw new MichelsonInstructionError(ee,a,`${ee.prim}: contract has no entrypoint ${T}`);b(T,ee.args[0])}return[N({prim:"option",args:[{prim:"contract",args:[ee.args[0]]}]},{v:P.v?P.v:Z(v(x),"contract")}),...a.slice(1)]}case"CAST":{B({});const x=c(0,null)[0];return assertTypeAnnotationsValid(ee.args[0]),b(ee.args[0],x),[ee.args[0],...a.slice(1)]}case"IF_NONE":{B({});const x=c(0,["option"])[0],P=a.slice(1),$=functionTypeInternal(ee.args[0],P,u),T=functionTypeInternal(ee.args[1],[N(x.args[0],{t:null,v:Z(v(x),"some")}),...P],u);return J($,T)}case"IF_LEFT":{B({});const x=c(0,["or"])[0],P=v(x),$=v(x.args[0]),T=v(x.args[1]),m=a.slice(1),M=functionTypeInternal(ee.args[0],[N(x.args[0],{t:null,v:Z(P,$.f?$.f[0].slice(1):"left")}),...m],u),W=functionTypeInternal(ee.args[1],[N(x.args[1],{t:null,v:Z(P,T.f?T.f[0].slice(1):"right")}),...m],u);return J(M,W)}case"IF_CONS":{B({});const x=c(0,["list"])[0],P=v(x),$=a.slice(1),T=functionTypeInternal(ee.args[0],[N(x.args[0],{t:null,v:Z(P,"hd")}),N(x,{t:null,v:Z(P,"tl")}),...$],u),m=functionTypeInternal(ee.args[1],$,u);return J(T,m)}case"IF":{B({}),c(0,["bool"]);const x=a.slice(1),P=functionTypeInternal(ee.args[0],x,u),$=functionTypeInternal(ee.args[1],x,u);return J(P,$)}case"MAP":{const x=c(0,["list","map","option"])[0],P=a.slice(1),$=x.prim==="map"?{prim:"pair",args:x.args}:x.args[0],T=functionTypeInternal(ee.args[0],[N($,{t:null,v:Z(v(x),"elt")}),...P],u);if("failed"in T){if(!("prim"in T.failed)||T.failed.prim!=="never")throw new MichelsonInstructionError(ee,a,`${ee.prim}: FAIL is not allowed in MAP`);return{failed:T.failed,level:T.level+1}}if(T.length<1)throw new MichelsonInstructionError(ee,a,`${ee.prim}: function must return a value`);return y(T.slice(1),P),x.prim==="list"?[D({prim:"list",args:[T[0]]}),...P]:x.prim==="map"?[D({prim:"map",args:[x.args[0],T[0]]}),...P]:[D({prim:"option",args:[T[0]]}),...P]}case"ITER":{B({});const x=c(0,["set","list","map"])[0],P=a.slice(1),$=x.prim==="map"?{prim:"pair",args:x.args}:x.args[0],T=functionTypeInternal(ee.args[0],[N($,{t:null,v:Z(v(x),"elt")}),...P],u);return"failed"in T?{failed:T.failed,level:T.level+1}:(y(T,P),P)}case"LOOP":{B({}),c(0,["bool"]);const x=a.slice(1),P=functionTypeInternal(ee.args[0],x,u);return"failed"in P?{failed:P.failed,level:P.level+1}:(y(P,[{prim:"bool"},...x]),x)}case"LOOP_LEFT":{B({});const x=c(0,["or"])[0],P=a.slice(1),$=functionTypeInternal(ee.args[0],[N(x.args[0],{t:null,v:Z(v(x),"left")}),...P],u);return"failed"in $?{failed:$.failed,level:$.level+1}:(y($,[x,...P]),[N(x.args[1],{t:null,v:B({v:1}).v}),...P])}case"DIP":{B({});const x=ee.args.length===2?parseInt(ee.args[0].int,10):1;c(x-1,null);const P=a.slice(0,x),$=a.slice(x),T=ee.args.length===2?functionTypeInternal(ee.args[1],$,u):functionTypeInternal(ee.args[0],$,u);return"failed"in T?{failed:T.failed,level:T.level+1}:[...P,...T]}case"CREATE_CONTRACT":{const x=B({v:2}),P=c(0,["option"],["mutez"],null);if(typeID(P[0].args[0])!=="key_hash")throw new MichelsonInstructionError(ee,a,`${ee.prim}: key hash expected: ${typeID(P[0].args[0])}`);R(P[2])&&(assertContractValid(ee.args[0]),assertScalarTypesEqual(contractSection(ee.args[0],"storage").args[0],P[2]));const $=(_=x.v)===null||_===void 0?void 0:_.map(T=>T!=="@"?[T]:void 0);return[N({prim:"operation"},{v:$==null?void 0:$[0]}),N({prim:"address",[refContract]:{prim:"contract",args:[contractSection(ee.args[0],"parameter").args[0]]}},{v:$==null?void 0:$[1]}),...a.slice(3)]}case"PUSH":return assertTypeAnnotationsValid(ee.args[0]),assertDataValidInternal(ee.args[1],ee.args[0],Object.assign(Object.assign({},u),{contract:void 0})),[D(ee.args[0]),...a];case"EMPTY_SET":return assertTypeAnnotationsValid(ee.args[0]),S(ee.args[0]),[N({prim:"set",args:ee.args},B({t:1,v:1})),...a];case"EMPTY_MAP":return assertTypeAnnotationsValid(ee.args[0]),S(ee.args[0]),assertTypeAnnotationsValid(ee.args[1]),[N({prim:"map",args:ee.args},B({t:1,v:1})),...a];case"EMPTY_BIG_MAP":return assertTypeAnnotationsValid(ee.args[0]),S(ee.args[0]),assertTypeAnnotationsValid(ee.args[1]),I(ee.args[0]),[N({prim:"big_map",args:ee.args},B({t:1,v:1})),...a];case"LAMBDA_REC":case"LAMBDA":{assertTypeAnnotationsValid(ee.args[0]),assertTypeAnnotationsValid(ee.args[1]);const x=[ee.args[0]];ee.prim==="LAMBDA_REC"&&x.push({prim:"lambda",args:[ee.args[0],ee.args[1]]});const P=functionTypeInternal(ee.args[2],x,Object.assign(Object.assign({},u),{contract:void 0}));if("failed"in P)return{failed:P.failed,level:P.level+1};if(P.length!==1)throw new MichelsonInstructionError(ee,a,`${ee.prim}: function must return a value`);return b(ee.args[1],P[0]),[D({prim:"lambda",args:[ee.args[0],ee.args[1]]}),...a]}case"LEVEL":return[D({prim:"nat"},"@level"),...a];case"TOTAL_VOTING_POWER":return[D({prim:"nat"}),...a];case"VOTING_POWER":return c(0,["key_hash"]),[D({prim:"nat"}),...a.slice(1)];case"TICKET":{const x=c(0,null,["nat"])[0];return S(x),ProtoInferiorTo(l,Protocol.PtLimaPtL)?[N({prim:"ticket",args:[x]},B({t:1,v:1})),...a.slice(2)]:[D({prim:"option",args:[N({prim:"ticket",args:[x]},B({t:1,v:1}))]}),...a.slice(2)]}case"JOIN_TICKETS":{const x=unpackComb("pair",c(0,["pair"])[0]);if(typeID(x.args[0])!=="ticket")throw new MichelsonInstructionError(ee,a,`${ee.prim}: ticket expected: ${typeID(x.args[0])}`);return b(x.args[0],x.args[1]),[D({prim:"option",args:[N(x.args[0],{t:null})]}),...a.slice(1)]}case"SPLIT_TICKET":{const x=c(0,["ticket"],["pair"]),P=unpackComb("pair",x[1]);if(typeID(P.args[0])!=="nat")throw new MichelsonInstructionError(ee,a,`${ee.prim}: nat expected: ${typeID(P.args[0])}`);return b(P.args[0],P.args[1]),[D({prim:"option",args:[{prim:"pair",args:[N(x[0],{t:null}),N(x[0],{t:null})]}]}),...a.slice(2)]}case"READ_TICKET":{const x=B({v:2}),P=c(0,["ticket"])[0],$=(w=x.v)===null||w===void 0?void 0:w.map(T=>T!=="@"?[T]:void 0);return[N({prim:"pair",args:[{prim:"address"},N(P.args[0],{t:null}),{prim:"nat"}]},{v:$==null?void 0:$[0]}),N(P,{v:$==null?void 0:$[1],t:null}),...a.slice(1)]}case"PAIRING_CHECK":{const x=c(0,["list"])[0].args[0];if(!isPairType(x))throw new MichelsonInstructionError(ee,a,`${ee.prim}: pair expected: ${typeID(x)}`);const P=unpackComb("pair",x);if(typeID(P.args[0])!=="bls12_381_g1")throw new MichelsonInstructionError(ee,a,`${ee.prim}: bls12_381_g1 expected: ${typeID(P.args[0])}`);if(typeID(P.args[1])!=="bls12_381_g2")throw new MichelsonInstructionError(ee,a,`${ee.prim}: bls12_381_g2 expected: ${typeID(P.args[1])}`);return[D({prim:"bool"}),...a.slice(1)]}case"SAPLING_EMPTY_STATE":return[N({prim:"sapling_state",args:[ee.args[0]]},B({v:1,t:1})),...a];case"SAPLING_VERIFY_UPDATE":{const x=c(0,["sapling_transaction"],["sapling_state"]);if(parseInt(x[0].args[0].int,10)!==parseInt(x[1].args[0].int,10))throw new MichelsonInstructionError(ee,a,`${ee.prim}: sapling memo size mismatch: ${x[0].args[0].int} != ${x[1].args[0].int}`);return ProtoInferiorTo(l,Protocol.PtJakarta)?[D({prim:"option",args:[{prim:"pair",args:[{prim:"int"},N(x[1],{t:null})]}]}),...a.slice(2)]:[D({prim:"option",args:[{prim:"pair",args:[{prim:"bytes"},{prim:"pair",args:[{prim:"int"},N(x[1],{t:null})]}]}]}),...a.slice(2)]}case"OPEN_CHEST":return c(0,["chest_key"],["chest"],["nat"]),[D({prim:"or",args:[{prim:"bytes"},{prim:"bool"}]}),...a.slice(3)];case"VIEW":{const x=c(0,null,["address"]);return O(x[0]),[D({prim:"option",args:[ee.args[1]]}),...a.slice(2)]}case"MIN_BLOCK_TIME":return[D({prim:"nat"}),...a];case"EMIT":{const x=B({f:1,t:1});if(ee.args){const P=c(0,null);return b(P[0],ee.args[0]),[N({prim:"operation"},x),...a.slice(1)]}return[N({prim:"operation"},x),...a.slice(1)]}default:throw new MichelsonError(ee,`unexpected instruction: ${ee.prim}`)}})(f);if((u==null?void 0:u.traceCallback)!==void 0){const ee={op:f,in:a,out:Q};u.traceCallback(ee)}return Q}function contractSection(s,a){for(const u of s)if(u.prim===a)return u;throw new MichelsonError(s,`missing contract section: ${a}`)}function contractViews(s){const a={};for(const u of s)u.prim==="view"&&(a[u.args[0].string]=u);return a}function isContract(s){if(Array.isArray(s)){for(const a of s)if("prim"in a&&(a.prim==="parameter"||a.prim==="storage"||a.prim==="code"))return!0}return!1}function contractEntryPoint(s,a){a=a||"%default";const u=contractEntryPoints(s).find(l=>l[0]===a);return u!==void 0?u[1]:a==="%default"?isContract(s)?contractSection(s,"parameter").args[0]:s:null}function isOrType(s){return Array.isArray(s)||s.prim==="or"}function contractEntryPoints(s){if(isContract(s)){const a=contractSection(s,"parameter"),u=contractEntryPoints(a.args[0]),l=unpackAnnotations(a);return l.f?[[l.f[0],a.args[0]],...u]:u}if(isOrType(s)){const a=typeArgs(s),u=l=>{const f=unpackAnnotations(a[l]);if(typeID(a[l])==="or"){const c=contractEntryPoints(a[l]);return f.f?[[f.f[0],a[l]],...c]:c}return f.f?[[f.f[0],a[l]]]:[]};return[...u(0),...u(1)]}return[]}function assertContractValid(s,a){const u=(v,y,b,S)=>{assertTypeAnnotationsValid(v,!0),assertTypeAnnotationsValid(y);const E={prim:"pair",args:[Object.assign(Object.assign({},v),{annots:["@parameter"]}),Object.assign(Object.assign({},y),{annots:["@storage"]})]},R=functionTypeInternal(S,[E],Object.assign(Object.assign({},a),{contract:s}));if("failed"in R)return R;try{assertStacksEqual(R,[b])}catch(O){throw O instanceof MichelsonError?new MichelsonInstructionError(S,R,O.message):O}return R},l=contractSection(s,"parameter").args[0],f=contractSection(s,"storage").args[0],c=contractSection(s,"code").args[0],p=u(l,f,{prim:"pair",args:[{prim:"list",args:[{prim:"operation"}]},f]},c);for(const v of Object.values(contractViews(s)))u(v.args[1],f,v.args[2],v.args[3]);return p}function assertDataValid(s,a,u){assertTypeAnnotationsValid(a),assertDataValidInternal(s,a,u||null)}function functionType$1(s,a,u){for(const l of a)assertTypeAnnotationsValid(l);if((u==null?void 0:u.contract)!==void 0)for(const l of["parameter","storage"]){const f=contractSection(u.contract,l).args[0];assertTypeAnnotationsValid(f)}return functionTypeInternal(s,a,u||null)}function assertTypesEqual(s,a,u=!1){if(Array.isArray(s)){for(const l of s)assertTypeAnnotationsValid(l);for(const l of a)assertTypeAnnotationsValid(l)}else assertTypeAnnotationsValid(s),assertTypeAnnotationsValid(a);assertScalarTypesEqual(s,a,u)}function isDataValid(s,a,u){try{return assertDataValid(s,a,u),!0}catch{return!1}}class Contract{constructor(a,u){this.contract=a,this.ctx=Object.assign({contract:a},u),this.output=assertContractValid(a,this.ctx)}static parse(a,u){const l=new Parser$1(u),f=typeof a=="string"?l.parseScript(a):l.parseJSON(a);if(f===null)throw new InvalidMichelsonError("empty Michelson");if(assertMichelsonContract(f))return new Contract(f,u)}static parseTypeExpression(a,u){const l=new Parser$1(u),f=typeof a=="string"?l.parseScript(a):l.parseJSON(a);if(f===null)throw new InvalidTypeExpressionError("empty type expression");if(assertMichelsonType(f))return assertTypeAnnotationsValid(f),f}static parseDataExpression(a,u){const l=new Parser$1(u),f=typeof a=="string"?l.parseScript(a):l.parseJSON(a);if(f===null)throw new InvalidDataExpressionError("empty data expression");if(assertMichelsonData(f))return f;throw void 0}section(a){return contractSection(this.contract,a)}entryPoints(){return contractEntryPoints(this.contract)}entryPoint(a){return contractEntryPoint(this.contract,a)}assertDataValid(a,u){assertDataValid(a,u,this.ctx)}isDataValid(a,u){return isDataValid(a,u,this.ctx)}assertParameterValid(a,u){const l=this.entryPoint(a||void 0);if(l===null)throw new InvalidEntrypointError(a==null?void 0:a.toString());this.assertDataValid(u,l)}isParameterValid(a,u){try{return this.assertParameterValid(a,u),!0}catch{return!1}}functionType(a,u){return functionType$1(a,u,this.ctx)}}new Contract([{prim:"parameter",args:[{prim:"unit"}]},{prim:"storage",args:[{prim:"unit"}]},{prim:"code",args:[[{prim:"CAR"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PAIR"}]]}]);const toHexString=s=>s.reduce((a,u)=>a+u.toString(16).padStart(2,"0"),""),pad=(s,a=8)=>s.toString(16).padStart(a,"0"),ENTRYPOINT_MAX_LENGTH=31;var CODEC;(function(s){s.SECRET="secret",s.RAW="raw",s.TZ1="tz1",s.BRANCH="branch",s.ZARITH="zarith",s.PUBLIC_KEY="public_key",s.PKH="pkh",s.PKH_ARR="pkhArr",s.DELEGATE="delegate",s.SCRIPT="script",s.BALLOT_STATEMENT="ballotStmt",s.PROPOSAL="proposal",s.PROPOSAL_ARR="proposalArr",s.INT32="int32",s.INT16="int16",s.PARAMETERS="parameters",s.ADDRESS="address",s.SMART_CONTRACT_ADDRESS="smart_contract_address",s.SMART_ROLLUP_ADDRESS="smart_rollup_address",s.SMART_ROLLUP_COMMITMENT_HASH="smart_rollup_commitment_hash",s.VALUE="value",s.PADDED_BYTES="padded_bytes",s.SMART_ROLLUP_MESSAGE="smart_rollup_message",s.MANAGER="manager",s.BLOCK_PAYLOAD_HASH="blockPayloadHash",s.ENTRYPOINT="entrypoint",s.OPERATION="operation",s.OP_ACTIVATE_ACCOUNT="activate_account",s.OP_DELEGATION="delegation",s.OP_TRANSACTION="transaction",s.OP_ORIGINATION="origination",s.OP_BALLOT="ballot",s.OP_FAILING_NOOP="failing_noop",s.OP_ATTESTATION="attestation",s.OP_ATTESTATION_WITH_DAL="attestation_with_dal",s.OP_SEED_NONCE_REVELATION="seed_nonce_revelation",s.OP_REVEAL="reveal",s.OP_PROPOSALS="proposals",s.OP_REGISTER_GLOBAL_CONSTANT="register_global_constant",s.OP_TRANSFER_TICKET="transfer_ticket",s.BURN_LIMIT="burn_limit",s.OP_INCREASE_PAID_STORAGE="increase_paid_storage",s.OP_UPDATE_CONSENSUS_KEY="update_consensus_key",s.OP_DRAIN_DELEGATE="drain_delegate",s.DEPOSITS_LIMIT="deposits_limit",s.OP_SET_DEPOSITS_LIMIT="set_deposits_limit",s.OP_SMART_ROLLUP_ORIGINATE="smart_rollup_originate",s.PVM_KIND="pvm_kind",s.OP_SMART_ROLLUP_ADD_MESSAGES="smart_rollup_add_messages",s.OP_SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE="smart_rollup_execute_outbox_message",s.OP_DAL_PUBLISH_COMMITMENT="dal_publish_commitment",s.SLOT_HEADER="slot_header"})(CODEC||(CODEC={}));const opMapping={"00":"parameter","01":"storage","02":"code","03":"False","04":"Elt","05":"Left","06":"None","07":"Pair","08":"Right","09":"Some","0a":"True","0b":"Unit","0c":"PACK","0d":"UNPACK","0e":"BLAKE2B","0f":"SHA256",10:"SHA512",11:"ABS",12:"ADD",13:"AMOUNT",14:"AND",15:"BALANCE",16:"CAR",17:"CDR",18:"CHECK_SIGNATURE",19:"COMPARE","1a":"CONCAT","1b":"CONS","1c":"CREATE_ACCOUNT","1d":"CREATE_CONTRACT","1e":"IMPLICIT_ACCOUNT","1f":"DIP",20:"DROP",21:"DUP",22:"EDIV",23:"EMPTY_MAP",24:"EMPTY_SET",25:"EQ",26:"EXEC",27:"FAILWITH",28:"GE",29:"GET","2a":"GT","2b":"HASH_KEY","2c":"IF","2d":"IF_CONS","2e":"IF_LEFT","2f":"IF_NONE",30:"INT",31:"LAMBDA",32:"LE",33:"LEFT",34:"LOOP",35:"LSL",36:"LSR",37:"LT",38:"MAP",39:"MEM","3a":"MUL","3b":"NEG","3c":"NEQ","3d":"NIL","3e":"NONE","3f":"NOT",40:"NOW",41:"OR",42:"PAIR",43:"PUSH",44:"RIGHT",45:"SIZE",46:"SOME",47:"SOURCE",48:"SENDER",49:"SELF","4a":"STEPS_TO_QUOTA","4b":"SUB","4c":"SWAP","4d":"TRANSFER_TOKENS","4e":"SET_DELEGATE","4f":"UNIT",50:"UPDATE",51:"XOR",52:"ITER",53:"LOOP_LEFT",54:"ADDRESS",55:"CONTRACT",56:"ISNAT",57:"CAST",58:"RENAME",59:"bool","5a":"contract","5b":"int","5c":"key","5d":"key_hash","5e":"lambda","5f":"list",60:"map",61:"big_map",62:"nat",63:"option",64:"or",65:"pair",66:"set",67:"signature",68:"string",69:"bytes","6a":"mutez","6b":"timestamp","6c":"unit","6d":"operation","6e":"address","6f":"SLICE",70:"DIG",71:"DUG",72:"EMPTY_BIG_MAP",73:"APPLY",74:"chain_id",75:"CHAIN_ID",76:"LEVEL",77:"SELF_ADDRESS",78:"never",79:"NEVER","7a":"UNPAIR","7b":"VOTING_POWER","7c":"TOTAL_VOTING_POWER","7d":"KECCAK","7e":"SHA3","7f":"PAIRING_CHECK",80:"bls12_381_g1",81:"bls12_381_g2",82:"bls12_381_fr",83:"sapling_state",84:"sapling_transaction_deprecated",85:"SAPLING_EMPTY_STATE",86:"SAPLING_VERIFY_UPDATE",87:"ticket",88:"TICKET_DEPRECATED",89:"READ_TICKET","8a":"SPLIT_TICKET","8b":"JOIN_TICKETS","8c":"GET_AND_UPDATE","8d":"chest","8e":"chest_key","8f":"OPEN_CHEST",90:"VIEW",91:"view",92:"constant",93:"SUB_MUTEZ",94:"tx_rollup_l2_address",95:"MIN_BLOCK_TIME",96:"sapling_transaction",97:"EMIT",98:"Lambda_rec",99:"LAMBDA_REC","9a":"TICKET","9b":"BYTES","9c":"NAT","9d":"Ticket"},opMappingReverse=(()=>{const s={};return Object.keys(opMapping).forEach(a=>{s[opMapping[a]]=a}),s})(),kindMapping={4:"activate_account",107:"reveal",110:"delegation",108:"transaction",109:"origination",6:"ballot",21:"attestation",23:"attestation_with_dal",1:"seed_nonce_revelation",5:"proposals",111:"register_global_constant",158:"transfer_ticket",112:"set_deposits_limit",113:"increase_paid_storage",114:"update_consensus_key",9:"drain_delegate",200:"smart_rollup_originate",201:"smart_rollup_add_messages",206:"smart_rollup_execute_outbox_message",230:"dal_publish_commitment",17:"failing_noop"},kindMappingReverse=(()=>{const s={};return Object.keys(kindMapping).forEach(a=>{const u=typeof a=="string"?parseInt(a,10):a;s[kindMapping[u]]=pad(u,2)}),s})(),entrypointMapping={"00":"default","01":"root","02":"do","03":"set_delegate","04":"remove_delegate","05":"deposit","06":"stake","07":"unstake","08":"finalize_unstake","09":"set_delegate_parameters"},entrypointMappingReverse=(()=>{const s={};return Object.keys(entrypointMapping).forEach(a=>{s[entrypointMapping[a]]=a}),s})();class InvalidOperationSchemaError extends ParameterValidationError{constructor(a,u){super(),this.operation=a,this.errorDetail=u,this.name="InvalidOperationSchemaError",this.message="Invalid operation content recevied",u&&(this.message+=` ${u}.`)}}class OversizedEntryPointError extends ParameterValidationError{constructor(a){super(),this.entrypoint=a,this.name="OversizedEntryPointError",this.message=`Invalid entrypoint length "${a.length}", maximum length is "${ENTRYPOINT_MAX_LENGTH}".`}}class InvalidBallotValueError extends ParameterValidationError{constructor(a){super(),this.ballotValue=a,this.name="InvalidBallotValueError",this.message=`Invalid ballot value "${a}" expecting one of the following: "yay", "nay", "pass".`}}class DecodeBallotValueError extends ParameterValidationError{constructor(a){super(),this.ballotValue=a,this.name="DecodeBallotValueError",this.message=`Invalid ballot value "${a}", cannot be decoded.`}}class UnexpectedMichelsonValueError extends ParameterValidationError{constructor(a){super(),this.value=a,this.name="UnexpectedMichelsonValueError",this.message=`Invalid Michelson value "${a}", unalbe to encode.`}}class OperationDecodingError extends ParameterValidationError{constructor(a){super(),this.message=a,this.name="OperationDecodingError"}}class OperationEncodingError extends ParameterValidationError{constructor(a){super(),this.message=a,this.name="OperationEncodingError"}}class UnsupportedOperationError extends ParameterValidationError{constructor(a){super(),this.op=a,this.name="UnsupportedOperationError",this.message=`Unsupported operation "${a}", can submit an issue on our github for feature request.`}}class UnsupportedPvmKindError extends ParameterValidationError{constructor(a){super(),this.pvm=a,this.name="UnsupportedPvmKindError",this.message=`Invalid Pvm kind "${a}" expecting either "arith" or "wasm_2_0_0".`}}class DecodePvmKindError extends ParameterValidationError{constructor(a){super(),this.pvm=a,this.name="DecodePvmKindError",this.message=`Invalid Pvm kind "${a}", cannot be decoded.`}}class InvalidSmartRollupAddressError extends ParameterValidationError{constructor(a,u){super(),this.address=a,this.errorDetail=u,this.name="InvalidSmartRollupAddress",this.message=`Invalid smart rollup address "${a}"`,u&&(this.message+=` ${u}.`)}}class InvalidSmartRollupCommitmentHashError extends ParameterValidationError{constructor(a,u){super(),this.hash=a,this.errorDetail=u,this.name="InvalidSmartRollupCommitmentHashError",this.message=`Invalid smart rollup commitment hash "${a}"`,u&&(this.message+=` ${u}.`)}}class InvalidDalCommitmentError extends ParameterValidationError{constructor(a,u){super(),this.commitment=a,this.errorDetail=u,this.name="InvalidDalCommitmentError",this.message=`Invalid dal commitment "${a}"`,u&&(this.message+=` ${u}.`)}}class Uint8ArrayConsumer{static fromHexString(a){const u=a.toLowerCase();if(/^(([a-f]|\d){2})*$/.test(u)){const l=new Uint8Array((u.match(/([a-z]|\d){2}/g)||[]).map(f=>parseInt(f,16)));return new Uint8ArrayConsumer(l)}else throw new InvalidHexStringError(u)}constructor(a,u=0){this.arr=a,this.offset=u}consume(a){const u=this.arr.subarray(this.offset,this.offset+a);return this.offset+=a,u}get(a){return this.arr[this.offset+a]}length(){return this.arr.length-this.offset}slice(a,u){return new Uint8ArrayConsumer(this.arr.slice(a,u))}}const isPrim=s=>"prim"in s,isBytes=s=>"bytes"in s&&typeof s.bytes=="string",isString=s=>"string"in s&&typeof s.string=="string",isInt=s=>"int"in s&&typeof s.int=="string",scriptEncoder=s=>{const a=valueEncoder(s.code),u=valueEncoder(s.storage);return`${pad(a.length/2,8)}${a}${pad(u.length/2,8)}${u}`},scriptDecoder=s=>{const a=extractRequiredLen(s),u=extractRequiredLen(s);return{code:valueDecoder(new Uint8ArrayConsumer(a)),storage:valueDecoder(new Uint8ArrayConsumer(u))}},valueEncoder=s=>{if(Array.isArray(s)){const a=s.map(l=>valueEncoder(l)).join(""),u=a.length/2;return`02${pad(u)}${a}`}else{if(isPrim(s))return primEncoder(s);if(isBytes(s))return bytesEncoder(s);if(isString(s))return stringEncoder(s);if(isInt(s))return intEncoder(s)}throw new UnexpectedMichelsonValueError(JSON.stringify(s))},valueDecoder=s=>{const a=s.consume(1);switch(a[0]){case 10:return bytesDecoder(s);case 1:return stringDecoder(s);case 0:return intDecoder(s);case 2:{const u=new Uint8ArrayConsumer(extractRequiredLen(s)),l=[];for(;u.length()>0;)l.push(valueDecoder(u));return l}default:return primDecoder(s,a)}},extractRequiredLen=(s,a=4)=>{const u=s.consume(a),l=parseInt(distExports.Buffer.from(u).toString("hex"),16);return s.consume(l)},stripLengthPrefixFromBytes=(s,a=4)=>{const u=[];let l=s;for(;l.length();){const f=l.consume(a),c=parseInt(distExports.Buffer.from(f).toString("hex"),16);u.push(l.consume(c)),l=l.slice(c+a)}return u},bytesEncoder=s=>{if(!/^([A-Fa-f0-9]{2})*$/.test(s.bytes))throw new InvalidHexStringError(s.bytes);const a=s.bytes.length/2;return`0a${pad(a)}${s.bytes}`},bytesDecoder=s=>{const a=extractRequiredLen(s);return{bytes:distExports.Buffer.from(a).toString("hex")}},stringEncoder=s=>{const a=distExports.Buffer.from(s.string,"utf8").toString("hex"),u=a.length/2;return`01${pad(u)}${a}`},stringDecoder=s=>{const a=extractRequiredLen(s);return{string:distExports.Buffer.from(a).toString("utf8")}},intEncoder=({int:s})=>{const a=new BigNumber(s,10),u=a.toString(2)[0]==="-"?"1":"0",l=a.toString(2).replace(/-/g,""),f=l.length<=6?6:(l.length-6)%7?l.length+7-(l.length-6)%7:l.length,h=l.padStart(f,"0").match(/\d{6,7}/g).reverse();return h[0]=u+h[0],`00${h.map((v,y)=>parseInt((y===h.length-1?"0":"1")+v,2).toString(16).padStart(2,"0")).join("")}`},intDecoder=s=>{let a=s.consume(1)[0];const u=[],l=128;for(;a&l;)u.push(a),a=s.consume(1)[0];u.push(a);const f=!!(64&u[0]);u[0]=u[0]&127;const c=u.map((p,v)=>p.toString(2).slice(v===0?-6:-7).padStart(v===0?6:7,"0")).reverse();let h=new BigNumber(c.join(""),2);return f&&(h=h.times(-1)),{int:h.toFixed()}},primEncoder=s=>{const a=+Array.isArray(s.annots),u=Array.isArray(s.args)?s.args.length:0,l=pad(Math.min(2*u+a+3,9),2),f=opMappingReverse[s.prim];let c=(s.args||[]).map(p=>valueEncoder(p)).join("");const h=Array.isArray(s.annots)?encodeAnnots(s.annots):"";return(s.prim==="LAMBDA"||s.prim==="LAMBDA_REC")&&u&&(c=pad(c.length/2)+c+pad(0)),(s.prim==="pair"||s.prim==="Pair")&&u>2&&(c=h===""?pad(c.length/2)+c+pad(0):pad(c.length/2)+c),s.prim==="view"&&s.args&&(c=pad(c.length/2)+c+pad(0)),`${l}${f}${c}${h}`},primDecoder=(s,a)=>{const u=(a[0]-3)%2===1;let l=Math.floor((a[0]-3)/2);const f=s.consume(1)[0].toString(16).padStart(2,"0"),c={prim:opMapping[f]};if((opMapping[f]==="LAMBDA"||opMapping[f]==="LAMBDA_REC")&&s.consume(4),opMapping[f]==="view")return l!=0?primViewDecoder(s,c):c;let h,p;(opMapping[f]==="pair"||opMapping[f]==="Pair")&&l>2&&(h=decodeCombPair(s),l=0,p=decodeAnnots(s));const v=new Array(l).fill(0).map(()=>valueDecoder(s));return(opMapping[f]==="LAMBDA"||opMapping[f]==="LAMBDA_REC")&&s.consume(4),h?c.args=h:v.length&&(c.args=v),p&&p[0]!==""?c.annots=p:u&&(c.annots=decodeAnnots(s)),c},primViewDecoder=(s,a)=>(s.consume(4),a.args=new Array(4).fill(0).map(()=>valueDecoder(s)),s.consume(4),a),decodeCombPair=s=>{const a=new Uint8ArrayConsumer(extractRequiredLen(s)),u=[];for(;a.length()>0;)u.push(valueDecoder(a));return u},encodeAnnots=s=>{const a=s.map(l=>distExports.Buffer.from(l,"utf8").toString("hex")).join("20"),u=a.length/2;return`${pad(u)}${a}`},decodeAnnots=s=>{const a=s.consume(4),u=parseInt(distExports.Buffer.from(a).toString("hex"),16),l=s.consume(u);return distExports.Buffer.from(l).toString("hex").split("20").map(c=>distExports.Buffer.from(c,"hex").toString("utf8"))},prefixEncoder=s=>a=>buf2hex(distExports.Buffer.from(b58cdecode(a,prefix[s]))),prefixDecoder=s=>a=>{const u=a.consume(prefixLength[s]);return b58cencode(u,prefix[s])},tz1Decoder=prefixDecoder(Prefix.TZ1),branchDecoder=prefixDecoder(Prefix.B),publicKeyHashDecoder=s=>{const a=s.consume(1);if(a[0]===0)return prefixDecoder(Prefix.TZ1)(s);if(a[0]===1)return prefixDecoder(Prefix.TZ2)(s);if(a[0]===2)return prefixDecoder(Prefix.TZ3)(s)},publicKeyHashesDecoder=s=>{if(!boolDecoder(s))return;const a=[];for(s.consume(4);s.length()>0;)a.push(publicKeyHashDecoder(s));return a},branchEncoder=prefixEncoder(Prefix.B),tz1Encoder=prefixEncoder(Prefix.TZ1),boolEncoder=s=>s?"ff":"00",proposalEncoder=s=>prefixEncoder(Prefix.P)(s),proposalDecoder=s=>prefixDecoder(Prefix.P)(s),proposalsDecoder=s=>{const a=[];for(s.consume(4);s.length()>0;)a.push(proposalDecoder(s));return a},proposalsEncoder=s=>pad(32*s.length)+s.map(a=>proposalEncoder(a)).join(""),ballotEncoder=s=>{switch(s){case"yay":return"00";case"nay":return"01";case"pass":return"02";default:throw new InvalidBallotValueError(s)}},ballotDecoder=s=>{const a=s.consume(1);switch(a[0]){case 0:return"yay";case 1:return"nay";case 2:return"pass";default:throw new DecodeBallotValueError(a[0].toString())}},pvmKindEncoder=s=>{switch(s){case"arith":return"00";case"wasm_2_0_0":return"01";case"riscv":return"02";default:throw new UnsupportedPvmKindError(s)}},pvmKindDecoder=s=>{const a=s.consume(1);switch(a[0]){case 0:return"arith";case 1:return"wasm_2_0_0";case 2:return"riscv";default:throw new DecodePvmKindError(a[0].toString())}},delegateEncoder=s=>s?boolEncoder(!0)+publicKeyHashEncoder(s):boolEncoder(!1),int32Encoder=s=>{const a=parseInt(String(s),10),u=[];for(let l=0;l<4;l++){const f=(4-(l+1))*8;u.push((a&255<<f)>>f)}return distExports.Buffer.from(u).toString("hex")},int32Decoder=s=>{const a=s.consume(4);let u=0;for(let l=0;l<a.length;l++)u=u|a[l]<<(a.length-(l+1))*8;return u},int16Encoder=s=>{const a=parseInt(String(s),10),u=[];for(let l=0;l<2;l++){const f=(2-(l+1))*8;u.push((a&255<<f)>>f)}return distExports.Buffer.from(u).toString("hex")},int16Decoder=s=>{const a=s.consume(2);let u=0;for(let l=0;l<a.length;l++)u=u|a[l]<<(a.length-(l+1))*8;return u},boolDecoder=s=>s.consume(1)[0]===255,delegateDecoder=s=>{if(boolDecoder(s))return publicKeyHashDecoder(s)},publicKeyHashEncoder=s=>{switch(s.substring(0,3)){case Prefix.TZ1:return"00"+prefixEncoder(Prefix.TZ1)(s);case Prefix.TZ2:return"01"+prefixEncoder(Prefix.TZ2)(s);case Prefix.TZ3:return"02"+prefixEncoder(Prefix.TZ3)(s);case Prefix.TZ4:return"03"+prefixEncoder(Prefix.TZ4)(s);default:throw new InvalidKeyHashError(s,invalidDetail(ValidationResult.NO_PREFIX_MATCHED)+` expecting one for the following "${Prefix.TZ1}", "${Prefix.TZ2}", "${Prefix.TZ3}" or "${Prefix.TZ4}".`)}},publicKeyHashesEncoder=s=>{if(!s)return boolEncoder(!1);if(s.length===0)return boolEncoder(!0)+pad(0);const a=s.reduce((u,l)=>u+publicKeyHashEncoder(l),"");return boolEncoder(!0)+pad(a.length/2)+a},publicKeyEncoder=s=>{switch(s.substring(0,4)){case Prefix.EDPK:return"00"+prefixEncoder(Prefix.EDPK)(s);case Prefix.SPPK:return"01"+prefixEncoder(Prefix.SPPK)(s);case Prefix.P2PK:return"02"+prefixEncoder(Prefix.P2PK)(s);default:throw new InvalidPublicKeyError(s,invalidDetail(ValidationResult.NO_PREFIX_MATCHED)+` expecting one of the following '${Prefix.EDPK}', '${Prefix.SPPK}', '${Prefix.P2PK}' or '${Prefix.BLPK}'.`)}},addressEncoder=s=>{switch(s.substring(0,3)){case Prefix.TZ1:case Prefix.TZ2:case Prefix.TZ3:case Prefix.TZ4:return"00"+publicKeyHashEncoder(s);case Prefix.KT1:return"01"+prefixEncoder(Prefix.KT1)(s)+"00";default:throw new InvalidAddressError(s,invalidDetail(ValidationResult.NO_PREFIX_MATCHED)+` expecting one of the following prefix '${Prefix.TZ1}', ${Prefix.TZ2}', '${Prefix.TZ3}', '${Prefix.TZ4}' or '${Prefix.KT1}'.`)}},smartRollupAddressEncoder=s=>{if(s.substring(0,3)!==Prefix.SR1)throw new InvalidSmartRollupAddressError(s,invalidDetail(ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${Prefix.SR1}'.`);return prefixEncoder(Prefix.SR1)(s)},smartContractAddressEncoder=s=>{if(s.substring(0,3)===Prefix.KT1)return"01"+prefixEncoder(Prefix.KT1)(s)+"00";throw new InvalidContractAddressError(s,invalidDetail(ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${Prefix.KT1}'.`)},publicKeyDecoder=s=>{switch(s.consume(1)[0]){case 0:return prefixDecoder(Prefix.EDPK)(s);case 1:return prefixDecoder(Prefix.SPPK)(s);case 2:return prefixDecoder(Prefix.P2PK)(s);default:throw new InvalidPublicKeyError(s.toString(),invalidDetail(ValidationResult.NO_PREFIX_MATCHED))}},smartRollupCommitmentHashEncoder=s=>{if(s.substring(0,4)===Prefix.SRC1)return prefixEncoder(Prefix.SRC1)(s);throw new InvalidSmartRollupCommitmentHashError(s,invalidDetail(ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${Prefix.SRC1}'`)},addressDecoder=s=>{switch(s.consume(1)[0]){case 0:return publicKeyHashDecoder(s);case 1:{const u=prefixDecoder(Prefix.KT1)(s);return s.consume(1),u}default:throw new InvalidAddressError(s.toString(),": Unable to decode.")}},smartRollupAddressDecoder=s=>{const a=prefixDecoder(Prefix.SR1)(s);if(a.substring(0,3)!==Prefix.SR1)throw new InvalidSmartRollupAddressError(a,invalidDetail(ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${Prefix.SR1}'.`);return a},smartContractAddressDecoder=s=>{if(s.consume(1)[0]===1){const u=prefixDecoder(Prefix.KT1)(s);return s.consume(1),u}throw new InvalidContractAddressError(s.toString(),invalidDetail(ValidationResult.NO_PREFIX_MATCHED))},smartRollupCommitmentHashDecoder=s=>{const a=prefixDecoder(Prefix.SRC1)(s);if(a.substring(0,4)!==Prefix.SRC1)throw new InvalidSmartRollupCommitmentHashError(a,invalidDetail(ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${Prefix.SRC1}'`);return a},zarithEncoder=s=>{const a=[];let u=new BigNumber(s,10);if(u.isNaN())throw new TypeError(`Invalid zarith number ${s}`);for(;;)if(u.lt(128)){u.lt(16)&&a.push("0"),a.push(u.toString(16));break}else{let l=u.mod(128);u=u.minus(l),u=u.dividedBy(128),l=l.plus(128),a.push(l.toString(16))}return a.join("")},zarithDecoder=s=>{let a=0;for(;a<s.length()&&s.get(a)&128;)a+=1;let u=new BigNumber(0);for(let l=a;l>=0;l-=1){const f=s.get(l)&127;u=u.multipliedBy(128),u=u.plus(f)}return s.consume(a+1),new BigNumber(u).toString()},entrypointDecoder=s=>{const a=pad(s.consume(1)[0],2);if(a in entrypointMapping)return entrypointMapping[a];{const u=extractRequiredLen(s,1),l=distExports.Buffer.from(u).toString("utf8");if(l.length>ENTRYPOINT_MAX_LENGTH)throw new OversizedEntryPointError(l);return l}},parametersDecoder=s=>{if(s.consume(1)[0]!==0){const u=entrypointDecoder(s),l=extractRequiredLen(s),f=valueDecoder(new Uint8ArrayConsumer(l));return{entrypoint:u,value:f}}},entrypointEncoder=s=>{if(s in entrypointMappingReverse)return`${entrypointMappingReverse[s]}`;if(s.length>ENTRYPOINT_MAX_LENGTH)throw new OversizedEntryPointError(s);return`ff${valueEncoder({string:s}).slice(8)}`},parametersEncoder=s=>{if(!s||s.entrypoint==="default"&&"prim"in s.value&&s.value.prim==="Unit")return"00";const a=entrypointEncoder(s.entrypoint),u=valueEncoder(s.value),l=pad(u.length/2);return`ff${a}${l}${u}`},valueParameterEncoder=s=>{const a=valueEncoder(s);return`${pad(a.length/2)}${a}`},valueParameterDecoder=s=>{const a=extractRequiredLen(s);return valueDecoder(new Uint8ArrayConsumer(a))},blockPayloadHashEncoder=prefixEncoder(Prefix.VH),blockPayloadHashDecoder=prefixDecoder(Prefix.VH),entrypointNameEncoder=s=>`${valueEncoder({string:s}).slice(2)}`,entrypointNameDecoder=s=>{const a=extractRequiredLen(s);return distExports.Buffer.from(a).toString("utf8")},burnLimitEncoder=s=>s?`ff${zarithEncoder(s)}`:"00",burnLimitDecoder=s=>{const a=s.consume(1);if(distExports.Buffer.from(a).toString("hex")!=="00")return zarithDecoder(s)},depositsLimitEncoder=s=>s?`ff${zarithEncoder(s)}`:"00",depositsLimitDecoder=s=>{const a=s.consume(1);if(distExports.Buffer.from(a).toString("hex")!=="00")return zarithDecoder(s)},paddedBytesEncoder=(s,a=8)=>`${pad(s.length/2,a)}${s}`,paddedBytesDecoder=s=>{const a=extractRequiredLen(s);return distExports.Buffer.from(a).toString("hex")},smartRollupMessageEncoder=s=>{const a=s.reduce((u,l)=>u+`${pad(l.length/2)}${l}`,"");return`${pad(a.length/2)}${a}`},smartRollupMessageDecoder=s=>{const a=extractRequiredLen(s);return stripLengthPrefixFromBytes(new Uint8ArrayConsumer(a)).map(l=>distExports.Buffer.from(l).toString("hex"))},dalCommitmentEncoder=s=>{if(s.substring(0,2)===Prefix.SH)return prefixEncoder(Prefix.SH)(s);throw new InvalidDalCommitmentError(s,invalidDetail(ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${Prefix.SH}'`)},dalCommitmentDecoder=s=>{const a=prefixDecoder(Prefix.SH)(s);if(a.substring(0,2)!==Prefix.SH)throw new InvalidDalCommitmentError(a,invalidDetail(ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${Prefix.SH}'`);return a},slotHeaderEncoder=s=>pad(s.slot_index,2)+dalCommitmentEncoder(s.commitment)+s.commitment_proof,slotHeaderDecoder=s=>{const a=s.consume(1);return{slot_index:Number(a[0].toString(10)),commitment:dalCommitmentDecoder(s),commitment_proof:toHexString(s.consume(96))}},ManagerOperationSchema={branch:CODEC.BRANCH,contents:[CODEC.OPERATION]},ActivationSchema={pkh:CODEC.TZ1,secret:CODEC.SECRET},RevealSchema={source:CODEC.PKH,fee:CODEC.ZARITH,counter:CODEC.ZARITH,gas_limit:CODEC.ZARITH,storage_limit:CODEC.ZARITH,public_key:CODEC.PUBLIC_KEY},DelegationSchema={source:CODEC.PKH,fee:CODEC.ZARITH,counter:CODEC.ZARITH,gas_limit:CODEC.ZARITH,storage_limit:CODEC.ZARITH,delegate:CODEC.DELEGATE},TransactionSchema={source:CODEC.PKH,fee:CODEC.ZARITH,counter:CODEC.ZARITH,gas_limit:CODEC.ZARITH,storage_limit:CODEC.ZARITH,amount:CODEC.ZARITH,destination:CODEC.ADDRESS,parameters:CODEC.PARAMETERS},OriginationSchema={source:CODEC.PKH,fee:CODEC.ZARITH,counter:CODEC.ZARITH,gas_limit:CODEC.ZARITH,storage_limit:CODEC.ZARITH,balance:CODEC.ZARITH,delegate:CODEC.DELEGATE,script:CODEC.SCRIPT},BallotSchema={source:CODEC.PKH,period:CODEC.INT32,proposal:CODEC.PROPOSAL,ballot:CODEC.BALLOT_STATEMENT},AttestationSchema={slot:CODEC.INT16,level:CODEC.INT32,round:CODEC.INT32,block_payload_hash:CODEC.BLOCK_PAYLOAD_HASH},AttestationWithDalSchema={slot:CODEC.INT16,level:CODEC.INT32,round:CODEC.INT32,block_payload_hash:CODEC.BLOCK_PAYLOAD_HASH,dal_attestation:CODEC.ZARITH},SeedNonceRevelationSchema={level:CODEC.INT32,nonce:CODEC.RAW},ProposalsSchema={source:CODEC.PKH,period:CODEC.INT32,proposals:CODEC.PROPOSAL_ARR},RegisterGlobalConstantSchema={source:CODEC.PKH,fee:CODEC.ZARITH,counter:CODEC.ZARITH,gas_limit:CODEC.ZARITH,storage_limit:CODEC.ZARITH,value:CODEC.VALUE},TransferTicketSchema={source:CODEC.PKH,fee:CODEC.ZARITH,counter:CODEC.ZARITH,gas_limit:CODEC.ZARITH,storage_limit:CODEC.ZARITH,ticket_contents:CODEC.VALUE,ticket_ty:CODEC.VALUE,ticket_ticketer:CODEC.ADDRESS,ticket_amount:CODEC.ZARITH,destination:CODEC.ADDRESS,entrypoint:CODEC.ENTRYPOINT},IncreasePaidStorageSchema={source:CODEC.PKH,fee:CODEC.ZARITH,counter:CODEC.ZARITH,gas_limit:CODEC.ZARITH,storage_limit:CODEC.ZARITH,amount:CODEC.ZARITH,destination:CODEC.SMART_CONTRACT_ADDRESS},UpdateConsensusKeySchema={source:CODEC.PKH,fee:CODEC.ZARITH,counter:CODEC.ZARITH,gas_limit:CODEC.ZARITH,storage_limit:CODEC.ZARITH,pk:CODEC.PUBLIC_KEY},DrainDelegateSchema={consensus_key:CODEC.PKH,delegate:CODEC.PKH,destination:CODEC.PKH},SetDepositsLimitSchema={source:CODEC.PKH,fee:CODEC.ZARITH,counter:CODEC.ZARITH,gas_limit:CODEC.ZARITH,storage_limit:CODEC.ZARITH,limit:CODEC.DEPOSITS_LIMIT},SmartRollupOriginateSchema={source:CODEC.PKH,fee:CODEC.ZARITH,counter:CODEC.ZARITH,gas_limit:CODEC.ZARITH,storage_limit:CODEC.ZARITH,pvm_kind:CODEC.PVM_KIND,kernel:CODEC.PADDED_BYTES,parameters_ty:CODEC.VALUE,whitelist:CODEC.PKH_ARR},SmartRollupAddMessagesSchema={source:CODEC.PKH,fee:CODEC.ZARITH,counter:CODEC.ZARITH,gas_limit:CODEC.ZARITH,storage_limit:CODEC.ZARITH,message:CODEC.SMART_ROLLUP_MESSAGE},SmartRollupExecuteOutboxMessageSchema={source:CODEC.PKH,fee:CODEC.ZARITH,counter:CODEC.ZARITH,gas_limit:CODEC.ZARITH,storage_limit:CODEC.ZARITH,rollup:CODEC.SMART_ROLLUP_ADDRESS,cemented_commitment:CODEC.SMART_ROLLUP_COMMITMENT_HASH,output_proof:CODEC.PADDED_BYTES},DalPublishCommitmentSchema={source:CODEC.PKH,fee:CODEC.ZARITH,counter:CODEC.ZARITH,gas_limit:CODEC.ZARITH,storage_limit:CODEC.ZARITH,slot_header:CODEC.SLOT_HEADER},FailingNoopSchema={arbitrary:CODEC.PADDED_BYTES},operationEncoder=s=>a=>{if(!(a.kind in s)||!(a.kind in kindMappingReverse))throw new InvalidOperationKindError(a.kind);return kindMappingReverse[a.kind]+s[a.kind](a)},operationDecoder=s=>a=>{const u=a.consume(1),l=kindMapping[u[0]];if(l===void 0)throw new UnsupportedOperationError(u[0].toString());const f=s[l](a);if(typeof f!="object")throw new OperationDecodingError("Invalid operation, cannot be decoded.");return Object.assign({kind:l},f)},schemaEncoder=s=>a=>u=>Object.keys(a).reduce((f,c)=>{const h=a[c];if(u&&Array.isArray(h)){const p=s[h[0]],v=u[c];if(!Array.isArray(v))throw new OperationEncodingError(`Invalid operation value "${JSON.stringify(v)}" of key "${c}, expected value to be Array.`);return f+v.reduce((y,b)=>y+p(b),"")}else{const p=s[h];return f+p(u[c])}},""),schemaDecoder=s=>a=>u=>Object.keys(a).reduce((f,c)=>{const h=a[c];if(Array.isArray(h)){const p=s[h[0]],v=[],y=u.length();for(;u.length()>0;)if(v.push(p(u)),y===u.length())throw new OperationDecodingError("Unable to decode value");return Object.assign(Object.assign({},f),{[c]:v})}else{const p=s[h],v=p(u);return typeof v<"u"?Object.assign(Object.assign({},f),{[c]:v}):Object.assign({},f)}},{}),decoders={[CODEC.SECRET]:s=>toHexString(s.consume(20)),[CODEC.RAW]:s=>toHexString(s.consume(32)),[CODEC.TZ1]:tz1Decoder,[CODEC.BRANCH]:branchDecoder,[CODEC.ZARITH]:zarithDecoder,[CODEC.PUBLIC_KEY]:publicKeyDecoder,[CODEC.PKH]:publicKeyHashDecoder,[CODEC.PKH_ARR]:publicKeyHashesDecoder,[CODEC.DELEGATE]:delegateDecoder,[CODEC.INT32]:int32Decoder,[CODEC.SCRIPT]:scriptDecoder,[CODEC.BALLOT_STATEMENT]:ballotDecoder,[CODEC.PROPOSAL]:proposalDecoder,[CODEC.PROPOSAL_ARR]:proposalsDecoder,[CODEC.PARAMETERS]:parametersDecoder,[CODEC.ADDRESS]:addressDecoder,[CODEC.SMART_ROLLUP_ADDRESS]:smartRollupAddressDecoder,[CODEC.SMART_CONTRACT_ADDRESS]:smartContractAddressDecoder,[CODEC.SMART_ROLLUP_COMMITMENT_HASH]:smartRollupCommitmentHashDecoder,[CODEC.VALUE]:valueParameterDecoder,[CODEC.INT16]:int16Decoder,[CODEC.BLOCK_PAYLOAD_HASH]:blockPayloadHashDecoder,[CODEC.ENTRYPOINT]:entrypointNameDecoder,[CODEC.BURN_LIMIT]:burnLimitDecoder,[CODEC.DEPOSITS_LIMIT]:depositsLimitDecoder,[CODEC.PVM_KIND]:pvmKindDecoder,[CODEC.PADDED_BYTES]:paddedBytesDecoder,[CODEC.SMART_ROLLUP_MESSAGE]:smartRollupMessageDecoder,[CODEC.SLOT_HEADER]:slotHeaderDecoder};decoders[CODEC.OPERATION]=operationDecoder(decoders);decoders[CODEC.OP_ACTIVATE_ACCOUNT]=s=>schemaDecoder(decoders)(ActivationSchema)(s);decoders[CODEC.OP_FAILING_NOOP]=s=>schemaDecoder(decoders)(FailingNoopSchema)(s);decoders[CODEC.OP_DELEGATION]=s=>schemaDecoder(decoders)(DelegationSchema)(s);decoders[CODEC.OP_TRANSACTION]=s=>schemaDecoder(decoders)(TransactionSchema)(s);decoders[CODEC.OP_ORIGINATION]=s=>schemaDecoder(decoders)(OriginationSchema)(s);decoders[CODEC.OP_BALLOT]=s=>schemaDecoder(decoders)(BallotSchema)(s);decoders[CODEC.OP_ATTESTATION]=s=>schemaDecoder(decoders)(AttestationSchema)(s);decoders[CODEC.OP_ATTESTATION_WITH_DAL]=s=>schemaDecoder(decoders)(AttestationWithDalSchema)(s);decoders[CODEC.OP_SEED_NONCE_REVELATION]=s=>schemaDecoder(decoders)(SeedNonceRevelationSchema)(s);decoders[CODEC.OP_PROPOSALS]=s=>schemaDecoder(decoders)(ProposalsSchema)(s);decoders[CODEC.OP_REVEAL]=s=>schemaDecoder(decoders)(RevealSchema)(s);decoders[CODEC.OP_REGISTER_GLOBAL_CONSTANT]=s=>schemaDecoder(decoders)(RegisterGlobalConstantSchema)(s);decoders[CODEC.OP_TRANSFER_TICKET]=s=>schemaDecoder(decoders)(TransferTicketSchema)(s);decoders[CODEC.OP_INCREASE_PAID_STORAGE]=s=>schemaDecoder(decoders)(IncreasePaidStorageSchema)(s);decoders[CODEC.OP_UPDATE_CONSENSUS_KEY]=s=>schemaDecoder(decoders)(UpdateConsensusKeySchema)(s);decoders[CODEC.OP_DRAIN_DELEGATE]=s=>schemaDecoder(decoders)(DrainDelegateSchema)(s);decoders[CODEC.OP_SMART_ROLLUP_ORIGINATE]=s=>schemaDecoder(decoders)(SmartRollupOriginateSchema)(s);decoders[CODEC.OP_SMART_ROLLUP_ADD_MESSAGES]=s=>schemaDecoder(decoders)(SmartRollupAddMessagesSchema)(s);decoders[CODEC.OP_SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE]=s=>schemaDecoder(decoders)(SmartRollupExecuteOutboxMessageSchema)(s);decoders[CODEC.OP_DAL_PUBLISH_COMMITMENT]=s=>schemaDecoder(decoders)(DalPublishCommitmentSchema)(s);decoders[CODEC.MANAGER]=schemaDecoder(decoders)(ManagerOperationSchema);decoders[CODEC.OP_SET_DEPOSITS_LIMIT]=s=>schemaDecoder(decoders)(SetDepositsLimitSchema)(s);const encoders={[CODEC.SECRET]:s=>s,[CODEC.RAW]:s=>s,[CODEC.TZ1]:tz1Encoder,[CODEC.BRANCH]:branchEncoder,[CODEC.ZARITH]:zarithEncoder,[CODEC.PUBLIC_KEY]:publicKeyEncoder,[CODEC.PKH]:publicKeyHashEncoder,[CODEC.PKH_ARR]:publicKeyHashesEncoder,[CODEC.DELEGATE]:delegateEncoder,[CODEC.SCRIPT]:scriptEncoder,[CODEC.BALLOT_STATEMENT]:ballotEncoder,[CODEC.PROPOSAL]:proposalEncoder,[CODEC.PROPOSAL_ARR]:proposalsEncoder,[CODEC.INT32]:int32Encoder,[CODEC.PARAMETERS]:parametersEncoder,[CODEC.ADDRESS]:addressEncoder,[CODEC.SMART_ROLLUP_ADDRESS]:smartRollupAddressEncoder,[CODEC.SMART_CONTRACT_ADDRESS]:smartContractAddressEncoder,[CODEC.SMART_ROLLUP_COMMITMENT_HASH]:smartRollupCommitmentHashEncoder,[CODEC.VALUE]:valueParameterEncoder,[CODEC.INT16]:int16Encoder,[CODEC.BLOCK_PAYLOAD_HASH]:blockPayloadHashEncoder,[CODEC.ENTRYPOINT]:entrypointNameEncoder,[CODEC.BURN_LIMIT]:burnLimitEncoder,[CODEC.DEPOSITS_LIMIT]:depositsLimitEncoder,[CODEC.PVM_KIND]:pvmKindEncoder,[CODEC.PADDED_BYTES]:paddedBytesEncoder,[CODEC.SMART_ROLLUP_MESSAGE]:smartRollupMessageEncoder,[CODEC.SLOT_HEADER]:slotHeaderEncoder};encoders[CODEC.OPERATION]=operationEncoder(encoders);encoders[CODEC.OP_ACTIVATE_ACCOUNT]=s=>schemaEncoder(encoders)(ActivationSchema)(s);encoders[CODEC.OP_DELEGATION]=s=>schemaEncoder(encoders)(DelegationSchema)(s);encoders[CODEC.OP_TRANSACTION]=s=>schemaEncoder(encoders)(TransactionSchema)(s);encoders[CODEC.OP_ORIGINATION]=s=>schemaEncoder(encoders)(OriginationSchema)(s);encoders[CODEC.OP_BALLOT]=s=>schemaEncoder(encoders)(BallotSchema)(s);encoders[CODEC.OP_ATTESTATION]=s=>schemaEncoder(encoders)(AttestationSchema)(s);encoders[CODEC.OP_ATTESTATION_WITH_DAL]=s=>schemaEncoder(encoders)(AttestationWithDalSchema)(s);encoders[CODEC.OP_SEED_NONCE_REVELATION]=s=>schemaEncoder(encoders)(SeedNonceRevelationSchema)(s);encoders[CODEC.OP_PROPOSALS]=s=>schemaEncoder(encoders)(ProposalsSchema)(s);encoders[CODEC.OP_REVEAL]=s=>schemaEncoder(encoders)(RevealSchema)(s);encoders[CODEC.OP_REGISTER_GLOBAL_CONSTANT]=s=>schemaEncoder(encoders)(RegisterGlobalConstantSchema)(s);encoders[CODEC.OP_TRANSFER_TICKET]=s=>schemaEncoder(encoders)(TransferTicketSchema)(s);encoders[CODEC.OP_INCREASE_PAID_STORAGE]=s=>schemaEncoder(encoders)(IncreasePaidStorageSchema)(s);encoders[CODEC.OP_UPDATE_CONSENSUS_KEY]=s=>schemaEncoder(encoders)(UpdateConsensusKeySchema)(s);encoders[CODEC.OP_DRAIN_DELEGATE]=s=>schemaEncoder(encoders)(DrainDelegateSchema)(s);encoders[CODEC.OP_SMART_ROLLUP_ORIGINATE]=s=>schemaEncoder(encoders)(SmartRollupOriginateSchema)(s);encoders[CODEC.OP_SMART_ROLLUP_ADD_MESSAGES]=s=>schemaEncoder(encoders)(SmartRollupAddMessagesSchema)(s);encoders[CODEC.OP_SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE]=s=>schemaEncoder(encoders)(SmartRollupExecuteOutboxMessageSchema)(s);encoders[CODEC.OP_DAL_PUBLISH_COMMITMENT]=s=>schemaEncoder(encoders)(DalPublishCommitmentSchema)(s);encoders[CODEC.MANAGER]=schemaEncoder(encoders)(ManagerOperationSchema);encoders[CODEC.OP_SET_DEPOSITS_LIMIT]=s=>schemaEncoder(encoders)(SetDepositsLimitSchema)(s);encoders[CODEC.OP_FAILING_NOOP]=s=>schemaEncoder(encoders)(FailingNoopSchema)(s);const OperationKindMapping={activate_account:ActivationSchema,reveal:RevealSchema,delegation:DelegationSchema,transaction:TransactionSchema,origination:OriginationSchema,ballot:BallotSchema,attestation:AttestationSchema,attestation_with_dal:AttestationWithDalSchema,seed_nonce_revelation:SeedNonceRevelationSchema,proposals:ProposalsSchema,register_global_constant:RegisterGlobalConstantSchema,transfer_ticket:TransferTicketSchema,increase_paid_storage:IncreasePaidStorageSchema,update_consensus_key:UpdateConsensusKeySchema,drain_delegate:DrainDelegateSchema,set_deposits_limit:SetDepositsLimitSchema,smart_rollup_originate:SmartRollupOriginateSchema,smart_rollup_add_messages:SmartRollupAddMessagesSchema,smart_rollup_execute_outbox_message:SmartRollupExecuteOutboxMessageSchema,dal_publish_commitment:DalPublishCommitmentSchema,failing_noop:FailingNoopSchema},getArrayDifference=(s,a)=>a.filter(u=>!s.includes(u)),deleteArrayElementByValue=(s,a)=>s.filter(u=>u!==a),validateOperationKind=s=>Object.keys(OperationKindMapping).includes(s),validateMissingProperty=s=>{const a=s.kind,u=Object.keys(s),l=deleteArrayElementByValue(u,"kind"),f=Object.keys(OperationKindMapping[a]);return getArrayDifference(l,f)};var ProtocolsHash;(function(s){s.Pt24m4xi="Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd",s.PsBABY5H="PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",s.PsBabyM1="PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS",s.PsCARTHA="PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb",s.PsDELPH1="PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo",s.PtEdo2Zk="PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA",s.PsFLorena="PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i",s.PtGRANADs="PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV",s.PtHangz2="PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx",s.Psithaca2="Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A",s.PtJakart2="PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY",s.PtKathman="PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg",s.PtLimaPtL="PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW",s.PtMumbaii="PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc",s.PtMumbai2="PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1",s.PtNairobi="PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf",s.ProxfordY="ProxfordYmVfjWnRcgjWH36fW6PArwqykTFzotUxRs6gmTcZDuH",s.PtParisBx="PtParisBxoLz5gzMmn3d9WBQNoPSZakgnkMC2VNuQ3KXfUtUQeZ",s.PsParisCZ="PsParisCZo7KAh1Z1smVd9ZMZ1HHn5gkzbM94V3PLCpknFWhUAi",s.PsQuebecn="PsQuebecnLByd3JwTiGadoG4nGWi3HYiLXUjkibeFV8dCFeVMUg",s.ProtoALpha="ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK"})(ProtocolsHash||(ProtocolsHash={}));const PROTOCOL_CURRENT=ProtocolsHash.PsQuebecn;function getCodec(s,a){return{encoder:encoders[s],decoder:u=>{const l=Uint8ArrayConsumer.fromHexString(u);return decoders[s](l)}}}class LocalForger{constructor(a=PROTOCOL_CURRENT){this.protocolHash=a,this.codec=getCodec(CODEC.MANAGER,this.protocolHash)}forge(a){const u=validateBlock(a.branch);if(u!==ValidationResult.VALID)throw new InvalidBlockHashError(a.branch,invalidDetail(u));for(const f of a.contents){if(!validateOperationKind(f.kind))throw new InvalidOperationKindError(f.kind);const c=validateMissingProperty(f);if(c.length===1){if(f.kind==="delegation"&&c[0]==="delegate")continue;if(f.kind==="origination"&&c[0]==="delegate")continue;if(f.kind==="transaction"&&c[0]==="parameters")continue;if(f.kind==="set_deposits_limit"&&c[0]==="limit")continue;if(f.kind==="smart_rollup_originate"&&c[0]==="whitelist")continue;throw new InvalidOperationSchemaError(f,`missing properties "${c.join(", ")}"`)}else if(c.length>1)throw new InvalidOperationSchemaError(f,`missing properties "${c.join(", ")}"`)}const l=this.codec.encoder(a).toLowerCase();return Promise.resolve(l)}parse(a){return Promise.resolve(this.codec.decoder(a))}}new LocalForger;function __rest(s,a){var u={};for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&a.indexOf(l)<0&&(u[l]=s[l]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,l=Object.getOwnPropertySymbols(s);f<l.length;f++)a.indexOf(l[f])<0&&Object.prototype.propertyIsEnumerable.call(s,l[f])&&(u[l[f]]=s[l[f]]);return u}function __awaiter$4(s,a,u,l){function f(c){return c instanceof u?c:new u(function(h){h(c)})}return new(u||(u=Promise))(function(c,h){function p(b){try{y(l.next(b))}catch(S){h(S)}}function v(b){try{y(l.throw(b))}catch(S){h(S)}}function y(b){b.done?c(b.value):f(b.value).then(p,v)}y((l=l.apply(s,a||[])).next())})}function __classPrivateFieldGet$1(s,a,u,l){if(u==="a"&&!l)throw new TypeError("Private accessor was defined without a getter");if(typeof a=="function"?s!==a||!l:!a.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return u==="m"?l:u==="a"?l.call(s):l?l.value:a.get(s)}function __classPrivateFieldSet$1(s,a,u,l,f){if(typeof a=="function"?s!==a||!f:!a.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a.set(s,u),u}typeof SuppressedError=="function"&&SuppressedError;function formatErrorMessage(s,a){const u=JSON.parse(s.body);if(u[0]&&u[0].kind&&u[0].msg){const l=JSON.stringify({kind:u[0].kind,id:u[0].id,msg:u[0].msg.replace(a,"")});return new HttpResponseError(`Http error response: (${s.status}) ${l}`,s.status,s.statusText,l,s.url)}else return s}class RpcInjector{constructor(a){this.context=a}inject(a){return __awaiter$4(this,void 0,void 0,function*(){let u;try{u=yield this.context.rpc.injectOperation(a)}catch(l){const f=". You may want to use --replace to provide adequate fee and replace it";throw l instanceof HttpResponseError&&l.message.includes(f)?formatErrorMessage(l,f):l}return u})}}class UnconfiguredSignerError extends TezosToolkitConfigError{constructor(){super(),this.name="UnconfiguredSignerError",this.message="No signer has been configured. Please configure one by calling setProvider({signer}) on your TezosToolkit instance."}}class NoopSigner{publicKey(){return __awaiter$4(this,void 0,void 0,function*(){throw new UnconfiguredSignerError})}publicKeyHash(){return __awaiter$4(this,void 0,void 0,function*(){throw new UnconfiguredSignerError})}secretKey(){return __awaiter$4(this,void 0,void 0,function*(){throw new UnconfiguredSignerError})}sign(a,u){return __awaiter$4(this,void 0,void 0,function*(){throw new UnconfiguredSignerError})}}function createObservableFromSubscription(s){return new Observable(a=>(s.on("data",u=>{a.next(u)}),s.on("error",u=>{a.error(u)}),s.on("close",()=>{a.complete()}),()=>{s.close()}))}const REVEAL_GAS_LIMIT={TZ1:169,TZ2:155,TZ3:445,TZ4:1674},REVEAL_FEE={TZ1:276,TZ2:276,TZ3:305,TZ4:477},REVEAL_STORAGE_LIMIT=0,COST_PER_BYTE=250;var Protocols;(function(s){s.Pt24m4xi="Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd",s.PsBABY5H="PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",s.PsBabyM1="PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS",s.PsCARTHA="PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb",s.PsDELPH1="PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo",s.PtEdo2Zk="PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA",s.PsFLorena="PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i",s.PtGRANADs="PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV",s.PtHangz2="PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx",s.PsiThaCa="PsiThaCaT47Zboaw71QWScM8sXeMM7bbQFncK9FLqYc6EKdpjVP",s.Psithaca2="Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A",s.PtJakart2="PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY",s.PtKathman="PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg",s.PtLimaPtL="PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW",s.PtMumbaii="PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc",s.PtMumbai2="PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1",s.PtNairobi="PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf",s.ProxfordY="ProxfordYmVfjWnRcgjWH36fW6PArwqykTFzotUxRs6gmTcZDuH",s.PtParisBx="PtParisBxoLz5gzMmn3d9WBQNoPSZakgnkMC2VNuQ3KXfUtUQeZ",s.PsParisCZ="PsParisCZo7KAh1Z1smVd9ZMZ1HHn5gkzbM94V3PLCpknFWhUAi",s.PsQuebecn="PsQuebecnLByd3JwTiGadoG4nGWi3HYiLXUjkibeFV8dCFeVMUg",s.ProtoALpha="ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK"})(Protocols||(Protocols={}));Protocols.Pt24m4xi,Protocols.PsBABY5H,Protocols.PsBabyM1,Protocols.PsCARTHA,Protocols.PsDELPH1,Protocols.PtEdo2Zk,Protocols.PsFLorena,Protocols.PtGRANADs,Protocols.PtHangz2,Protocols.PsiThaCa,Protocols.Psithaca2,Protocols.PtJakart2,Protocols.PtKathman,Protocols.PtLimaPtL,Protocols.PtMumbai2,Protocols.PtNairobi,Protocols.ProxfordY,Protocols.PtParisBx,Protocols.PsParisCZ,Protocols.PsQuebecn,Protocols.ProtoALpha;var ChainIds;(function(s){s.MAINNET="NetXdQprcVkpaWU",s.CARTHAGENET="NetXjD3HPJJjmcd",s.DELPHINET="NetXm8tYqnMWky1",s.EDONET="NetXSgo1ZT2DRUG",s.FLORENCENET="NetXxkAx4woPLyu",s.GRANADANET="NetXz969SFaFn8k",s.HANGZHOUNET="NetXZSsxBpMQeAT",s.ITHACANET="NetXbhmtAbMukLc",s.ITHACANET2="NetXnHfVqm9iesp",s.JAKARTANET2="NetXLH1uAxK7CCh",s.KATHMANDUNET="NetXazhm4yetmff",s.LIMANET="NetXizpkH94bocH",s.MUMBAINET="NetXQw6nWSnrJ5t",s.MUMBAINET2="NetXgbcrNtXD2yA",s.NAIROBINET="NetXyuzvDo2Ugzb",s.OXFORDNET2="NetXxWsskGahzQB",s.PARISBNET="NetXo8SqH1c38SS",s.PARISCNET="NetXXWAHLEvre9b",s.PsQuebecn="NetXuTeGinLEqxp"})(ChainIds||(ChainIds={}));const getRevealGasLimit=s=>Math.round(getRevealGasLimitInternal(s)*37/10),getRevealGasLimitInternal=s=>{switch(s.substring(0,3)){case"tz1":return REVEAL_GAS_LIMIT.TZ1;case"tz2":return REVEAL_GAS_LIMIT.TZ2;case"tz3":return REVEAL_GAS_LIMIT.TZ3;case"tz4":return REVEAL_GAS_LIMIT.TZ4;default:throw new Error(`Cannot estimate reveal gas limit for ${s}`)}},getRevealFee=s=>Math.round(getRevealFeeInternal(s)*12/10),getRevealFeeInternal=s=>{switch(s.substring(0,3)){case"tz1":return REVEAL_FEE.TZ1;case"tz2":return REVEAL_FEE.TZ2;case"tz3":return REVEAL_FEE.TZ3;case"tz4":return REVEAL_FEE.TZ4;default:throw new Error(`Cannot estimate reveal fee for ${s}`)}};class InvalidParameterError extends ParameterValidationError{constructor(a,u,l){super(),this.smartContractMethodName=a,this.sigs=u,this.invalidParams=l,this.name="InvalidParameterError",this.message=`${a} Received ${l.length} arguments while expecting one of the following signatures (${JSON.stringify(u)})`}}class InvalidDelegationSource extends ParameterValidationError{constructor(a){super(),this.source=a,this.name="InvalidDelegationSource",this.message=`Since Babylon delegation source can no longer be a contract address ${a}. Please use the smart contract abstraction to set your delegate.`}}class InvalidCodeParameter extends ParameterValidationError{constructor(a,u){super(),this.message=a,this.data=u,this.name="InvalidCodeParameter"}}class InvalidInitParameter extends ParameterValidationError{constructor(a,u){super(),this.message=a,this.data=u,this.name="InvalidInitParameter"}}class ViewSimulationError extends RpcError{constructor(a,u,l,f){super(),this.message=a,this.viewName=u,this.failWith=l,this.cause=f,this.name="ViewSimulationError"}}const validateAndExtractFailwith=s=>{if(isJsonString(s.body)){const a=JSON.parse(s.body);if(Array.isArray(a)&&"with"in a[a.length-1])return a[a.length-1].with}},isJsonString=s=>{try{JSON.parse(s)}catch{return!1}return!0};class InvalidViewSimulationContext extends ParameterValidationError{constructor(a){super(),this.info=a,this.name="InvalidViewSimulationContext",this.message=`${a} Please configure the context of the view execution in the executeView method.`}}class RevealOperationError extends RpcError{constructor(a){super(),this.message=a,this.name="RevealOperationError"}}class OriginationParameterError extends ParameterValidationError{constructor(a){super(),this.message=a,this.name}}class InvalidBalanceError extends ParameterValidationError{constructor(a){super(),this.message=a,this.name="InvalidBalanceError"}}const createActivationOperation=s=>__awaiter$4(void 0,[s],void 0,function*({pkh:a,secret:u}){return{kind:OpKind.ACTIVATION,pkh:a,secret:u}}),createOriginationOperation=s=>__awaiter$4(void 0,[s],void 0,function*({code:a,init:u,balance:l="0",delegate:f,storage:c,fee:h,gasLimit:p,storageLimit:v,mutez:y=!1}){if(c!==void 0&&u!==void 0)throw new OriginationParameterError("Storage and Init cannot be set a the same time. Please either use storage or init but not both.");if(!Array.isArray(a))throw new InvalidCodeParameter("Wrong code parameter type, expected an array",a);let b;if(c!==void 0){const R=a.find(I=>"prim"in I&&I.prim==="storage");if((R==null?void 0:R.args)===void 0)throw new InvalidCodeParameter("The storage section is missing from the script",a);b=new Schema(R.args[0]).Encode(c)}else if(u!==void 0&&typeof u=="object")b=u;else throw new InvalidInitParameter("Wrong init parameter type, expected JSON Michelson",u);const S={code:a,storage:b};if(isNaN(Number(l)))throw new InvalidBalanceError(`Invalid Balance "${l}", cannot be converted to a number`);const E={kind:OpKind.ORIGINATION,fee:h,gas_limit:p,storage_limit:v,balance:y?l.toString():format("tz","mutez",l).toString(),script:S};return f&&(E.delegate=f),E}),createTransferOperation=s=>__awaiter$4(void 0,[s],void 0,function*({to:a,amount:u,parameter:l,fee:f,gasLimit:c,storageLimit:h,mutez:p=!1}){return{kind:OpKind.TRANSACTION,fee:f,gas_limit:c,storage_limit:h,amount:p?u.toString():format("tz","mutez",u).toString(),destination:a,parameters:l}}),createSetDelegateOperation=s=>__awaiter$4(void 0,[s],void 0,function*({delegate:a,source:u,fee:l,gasLimit:f,storageLimit:c}){return{kind:OpKind.DELEGATION,source:u,fee:l,gas_limit:f,storage_limit:c,delegate:a}}),createRegisterDelegateOperation=(s,a)=>__awaiter$4(void 0,[s,a],void 0,function*({fee:u,gasLimit:l,storageLimit:f},c){return{kind:OpKind.DELEGATION,fee:u,gas_limit:l,storage_limit:f,delegate:c}}),createRevealOperation=(s,a,u)=>__awaiter$4(void 0,[s,a,u],void 0,function*({fee:l,gasLimit:f,storageLimit:c},h,p){return{kind:OpKind.REVEAL,fee:l,public_key:p,source:h,gas_limit:f??getRevealGasLimit(h),storage_limit:c}}),createRegisterGlobalConstantOperation=s=>__awaiter$4(void 0,[s],void 0,function*({value:a,source:u,fee:l,gasLimit:f,storageLimit:c}){return{kind:OpKind.REGISTER_GLOBAL_CONSTANT,value:a,fee:l,gas_limit:f,storage_limit:c,source:u}}),createTransferTicketOperation=s=>__awaiter$4(void 0,[s],void 0,function*({ticketContents:a,ticketTy:u,ticketTicketer:l,ticketAmount:f,destination:c,entrypoint:h,source:p,fee:v,gasLimit:y,storageLimit:b}){return{kind:OpKind.TRANSFER_TICKET,fee:v,gas_limit:y,storage_limit:b,source:p,ticket_contents:a,ticket_ty:u,ticket_ticketer:l,ticket_amount:f,destination:c,entrypoint:h}}),createIncreasePaidStorageOperation=s=>__awaiter$4(void 0,[s],void 0,function*({source:a,fee:u,gasLimit:l,storageLimit:f,amount:c,destination:h}){return{kind:OpKind.INCREASE_PAID_STORAGE,source:a,fee:u,gas_limit:l,storage_limit:f,amount:c,destination:h}}),createDrainDelegateOperation=s=>__awaiter$4(void 0,[s],void 0,function*({consensus_key:a,delegate:u,destination:l}){return{kind:OpKind.DRAIN_DELEGATE,consensus_key:a,delegate:u,destination:l}}),createBallotOperation=s=>__awaiter$4(void 0,[s],void 0,function*({source:a,proposal:u,ballot:l}){return{kind:OpKind.BALLOT,source:a,proposal:u,ballot:l}}),createProposalsOperation=s=>__awaiter$4(void 0,[s],void 0,function*({source:a,proposals:u}){return{kind:OpKind.PROPOSALS,source:a,proposals:u}}),createUpdateConsensusKeyOperation=s=>__awaiter$4(void 0,[s],void 0,function*({source:a,fee:u,gasLimit:l,storageLimit:f,pk:c}){return{kind:OpKind.UPDATE_CONSENSUS_KEY,source:a,fee:u,gas_limit:l,storage_limit:f,pk:c}}),createSmartRollupAddMessagesOperation=s=>__awaiter$4(void 0,[s],void 0,function*({source:a,fee:u,gasLimit:l,storageLimit:f,message:c}){return{kind:OpKind.SMART_ROLLUP_ADD_MESSAGES,source:a,fee:u,gas_limit:l,storage_limit:f,message:c}}),createSmartRollupOriginateOperation=s=>__awaiter$4(void 0,[s],void 0,function*({source:a,fee:u,gasLimit:l,storageLimit:f,pvmKind:c,kernel:h,parametersType:p}){return{kind:OpKind.SMART_ROLLUP_ORIGINATE,source:a,fee:u,gas_limit:l,storage_limit:f,pvm_kind:c,kernel:h,parameters_ty:p}}),createSmartRollupExecuteOutboxMessageOperation=s=>__awaiter$4(void 0,[s],void 0,function*({source:a,fee:u,gasLimit:l,storageLimit:f,rollup:c,cementedCommitment:h,outputProof:p}){return{kind:OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE,source:a,fee:u,gas_limit:l,storage_limit:f,rollup:c,cemented_commitment:h,output_proof:p}}),attachKind=(s,a)=>Object.assign(Object.assign({},s),{kind:a}),findWithKind=(s,a)=>{if(Array.isArray(s)){const u=s.find(l=>l.kind===a);if(u&&isKind(u,a))return u}},isKind=(s,a)=>s.kind===a,isOpWithGasBuffer=s=>s.kind===OpKind.TRANSACTION&&s.parameters?!0:["origination","register_global_constant","transfer_ticket","update_consensus_key","smart_rollup_add_messages","smart_rollup_originate"].indexOf(s.kind)!==-1,isOpWithFee=s=>["transaction","delegation","origination","reveal","register_global_constant","increase_paid_storage","transfer_ticket","update_consensus_key","smart_rollup_add_messages","smart_rollup_originate","smart_rollup_execute_outbox_message"].indexOf(s.kind)!==-1,isOpRequireReveal=s=>["transaction","delegation","origination","register_global_constant","increase_paid_storage","transfer_ticket","update_consensus_key","smart_rollup_add_messages","smart_rollup_originate","smart_rollup_execute_outbox_message"].indexOf(s.kind)!==-1,hasMetadata=s=>"metadata"in s,hasMetadataWithResult=s=>hasMetadata(s)&&"operation_result"in s.metadata,hasMetadataWithInternalOperationResult=s=>hasMetadata(s)&&"internal_operation_results"in s.metadata,isErrorWithMessage=s=>"with"in s;class TezosOperationError extends RpcError{constructor(a,u,l){super(),this.errors=a,this.errorDetails=u,this.operationsWithResults=l,this.name="TezosOperationError",this.lastError=a[a.length-1],this.message=`(${this.kind}) ${this.id}`,isErrorWithMessage(this.lastError)&&(this.lastError.with.string?this.message=this.lastError.with.string:this.lastError.with.int?this.message=this.lastError.with.int:this.message=JSON.stringify(this.lastError.with))}get id(){return this.lastError.id}get kind(){return this.lastError.kind}}class TezosPreapplyFailureError extends Error{constructor(a){super(),this.result=a,this.name="TezosPreapplyFailureError",this.message="Preapply returned an unexpected result"}}const flattenOperationResult=s=>{const a=Array.isArray(s)?s:[s],u=[];for(let l=0;l<a.length;l++)for(let f=0;f<a[l].contents.length;f++){const c=a[l].contents[f];hasMetadataWithResult(c)&&"fee"in c&&(u.push(Object.assign({fee:c.fee},c.metadata.operation_result)),Array.isArray(c.metadata.internal_operation_results)&&c.metadata.internal_operation_results.forEach(h=>u.push(h.result)))}return u},flattenErrors=(s,a="failed")=>{const u=Array.isArray(s)?s:[s];let l=[];for(let f=0;f<u.length;f++)for(let c=0;c<u[f].contents.length;c++){const h=u[f].contents[c];if(hasMetadata(h)&&(hasMetadataWithResult(h)&&h.metadata.operation_result.status===a&&(l=l.concat(h.metadata.operation_result.errors||[])),hasMetadataWithInternalOperationResult(h)&&Array.isArray(h.metadata.internal_operation_results)))for(const p of h.metadata.internal_operation_results)"result"in p&&p.result.status===a&&(l=l.concat(p.result.errors||[]))}return l};class OriginationOperationError extends TaquitoError{constructor(a){super(),this.message=a,this.name="OriginationOperationError"}}class InvalidEstimateValueError extends ParameterValidationError{constructor(a){super(),this.message=a,this.name="InvalidEstimateValueError"}}class InvalidConfirmationCountError extends ParameterValidationError{constructor(a){super(),this.invalidConfirmations=a,this.name="InvalidConfirmationCountError",this.message=`Invalid confirmation count ${a} expecting at least 1`}}class ConfirmationTimeoutError extends NetworkError$1{constructor(a){super(),this.message=a,this.name="ConfirmationTimeoutError"}}class RPCResponseError extends RpcError{constructor(a,u){super(),this.message=a,this.cause=u,this.name="RPCResponseError"}}class Operation{get includedInBlock(){return this._foundAt}constructor(a,u,l,f){if(this.hash=a,this.raw=u,this.results=l,this.context=f,this._pollingConfig$=new ReplaySubject(1),this.currentHead$=this._pollingConfig$.pipe(switchMap(c=>new BehaviorSubject(c).pipe(timeout({each:c.timeout*1e3,with:()=>throwError(()=>new ConfirmationTimeoutError("Confirmation polling timed out"))}))),switchMap(()=>defer(()=>createObservableFromSubscription(this.context.stream.subscribeBlock("head"))).pipe(switchMap(c=>{var h,p;const v=(p=(h=this.lastHead)===null||h===void 0?void 0:h.header.level)!==null&&p!==void 0?p:c.header.level-1;return range$1(v+1,c.header.level-v-1).pipe(concatMap(y=>this.context.readProvider.getBlock(y)),endWith(c))}),tap(c=>this.lastHead=c))),shareReplay({refCount:!0})),this.confirmed$=this.currentHead$.pipe(map(c=>{for(let h=3;h>=0;h--)c.operations[h].forEach(p=>{p.hash===this.hash&&(this._foundAt=c.header.level)});if(c.header.level-this._foundAt>=0)return this._foundAt}),filter(c=>c!==void 0),first(),shareReplay()),this._foundAt=Number.POSITIVE_INFINITY,validateOperation(this.hash)!==ValidationResult.VALID)throw new InvalidOperationHashError(this.hash);this.confirmed$.pipe(first(),catchError(()=>of(EMPTY))).subscribe()}get revealOperation(){return Array.isArray(this.results)&&this.results.find(a=>a.kind==="reveal")}get revealStatus(){return this.revealOperation?this.revealOperation.metadata.operation_result.status:"unknown"}get status(){return this.results.map(a=>hasMetadataWithResult(a)?a.metadata.operation_result.status:"unknown")[0]||"unknown"}confirmation(a,u){return __awaiter$4(this,void 0,void 0,function*(){if(typeof a<"u"&&a<1)throw new InvalidConfirmationCountError(a);const{defaultConfirmationCount:l,confirmationPollingTimeoutSecond:f}=this.context.config;this._pollingConfig$.next({timeout:u||f});const c=a!==void 0?a:l;return new Promise((h,p)=>{this.confirmed$.pipe(switchMap(()=>this.currentHead$),filter(v=>v.header.level-this._foundAt>=c-1),first()).subscribe({error:v=>p(v),complete:()=>h(this._foundAt+(c-1))})})})}}class BatchOperation extends Operation{constructor(a,u,l,f,c,h){super(a,f,c,h),this.params=u,this.source=l}sumProp(a,u){return a.reduce((l,f)=>u in f?Number(f[u])+l:l,0)}getOriginatedContractAddresses(){const a=this.results.filter(l=>l.kind==="origination");let u=[];for(const l of a)l.metadata.operation_result.originated_contracts&&(u=[...u,...l.metadata.operation_result.originated_contracts]);return u}get status(){return this.results.filter(a=>BATCH_KINDS.indexOf(a.kind)!==-1).map(a=>hasMetadataWithResult(a)?a.metadata.operation_result.status:"unknown")[0]||"unknown"}get fee(){return this.sumProp(this.params,"fee")}get gasLimit(){return this.sumProp(this.params,"gas_limit")}get storageLimit(){return this.sumProp(this.params,"storage_limit")}get consumedGas(){return BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:BigNumber.ROUND_UP}),new BigNumber(this.consumedMilliGas).dividedBy(1e3).toString()}get consumedMilliGas(){return String(this.sumProp(flattenOperationResult({contents:this.results}),"consumed_milligas"))}get storageDiff(){return String(this.sumProp(flattenOperationResult({contents:this.results}),"paid_storage_size_diff"))}get errors(){return flattenErrors({contents:this.results})}}class Provider{get rpc(){return this.context.rpc}get signer(){return this.context.signer}constructor(a){this.context=a}forge(a){return __awaiter$4(this,arguments,void 0,function*({opOb:{branch:u,contents:l,protocol:f},counter:c}){return{opbytes:yield this.context.forger.forge({branch:u,contents:l}),opOb:{branch:u,contents:l,protocol:f},counter:c}})}estimate(a,u){return __awaiter$4(this,void 0,void 0,function*(){var{fee:l,gasLimit:f,storageLimit:c}=a,h=__rest(a,["fee","gasLimit","storageLimit"]);let p=l,v=f,y=c;if(p&&p%1!==0)throw new InvalidEstimateValueError(`Fee value must not be a decimal: ${p}`);if(v&&v%1!==0)throw new InvalidEstimateValueError(`Gas Limit value must not be a decimal: ${v}`);if(y&&y%1!==0)throw new InvalidEstimateValueError(`Storage Limit value must not be a decimal: ${y}`);if(l===void 0||f===void 0||c===void 0){const b=yield u(Object.assign({fee:l,gasLimit:f,storageLimit:c},h));p??(p=b.suggestedFeeMutez),v??(v=b.gasLimit),y??(y=b.storageLimit)}return{fee:p,gasLimit:v,storageLimit:y}})}getRPCOp(a){return __awaiter$4(this,void 0,void 0,function*(){switch(a.kind){case OpKind.TRANSACTION:return createTransferOperation(Object.assign({},a));case OpKind.ORIGINATION:return createOriginationOperation(yield this.context.parser.prepareCodeOrigination(Object.assign({},a)));case OpKind.DELEGATION:return createSetDelegateOperation(Object.assign({},a));case OpKind.REGISTER_GLOBAL_CONSTANT:return createRegisterGlobalConstantOperation(Object.assign({},a));case OpKind.INCREASE_PAID_STORAGE:return createIncreasePaidStorageOperation(Object.assign({},a));case OpKind.TRANSFER_TICKET:return createTransferTicketOperation(Object.assign({},a));case OpKind.SMART_ROLLUP_ADD_MESSAGES:return createSmartRollupAddMessagesOperation(Object.assign({},a));case OpKind.SMART_ROLLUP_ORIGINATE:return createSmartRollupOriginateOperation(Object.assign({},a));case OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE:return createSmartRollupExecuteOutboxMessageOperation(Object.assign({},a));default:throw new InvalidOperationKindError(a.kind)}})}runOperation(a){return __awaiter$4(this,void 0,void 0,function*(){return{opResponse:yield this.rpc.runOperation(a),op:a,context:this.context.clone()}})}simulate(a){return __awaiter$4(this,void 0,void 0,function*(){return{opResponse:yield this.rpc.simulateOperation(a),op:a,context:this.context.clone()}})}isRevealOpNeeded(a,u){return __awaiter$4(this,void 0,void 0,function*(){return!(!(yield this.isAccountRevealRequired(u))||!this.isRevealRequiredForOpType(a))})}isAccountRevealRequired(a){return __awaiter$4(this,void 0,void 0,function*(){return!(yield this.context.readProvider.isAccountRevealed(a,"head"))})}isRevealRequiredForOpType(a){let u=!1;for(const l of a)isOpRequireReveal(l)&&(u=!0);return u}signAndInject(a){return __awaiter$4(this,void 0,void 0,function*(){const u=yield this.signer.sign(a.opbytes,new Uint8Array([3]));a.opbytes=u.sbytes,a.opOb.signature=u.prefixSig;const l=[],f=yield this.rpc.preapplyOperations([a.opOb]);if(!Array.isArray(f))throw new TezosPreapplyFailureError(f);for(let h=0;h<f.length;h++)for(let p=0;p<f[h].contents.length;p++)l.push(f[h].contents[p]);const c=flattenErrors(f);if(c.length)throw new TezosOperationError(c,"Error occurred during validation simulation of operation",l);return{hash:yield this.context.injector.inject(a.opbytes),forgedBytes:a,opResponse:l,context:this.context.clone()}})}}class WalletOperationBatch{constructor(a,u){this.walletProvider=a,this.context=u,this.operations=[]}withTransfer(a){const u=validateAddress(a.to);if(u!==ValidationResult.VALID)throw new InvalidAddressError(a.to,invalidDetail(u));return this.operations.push(Object.assign({kind:OpKind.TRANSACTION},a)),this}withContractCall(a,u={}){return this.withTransfer(a.toTransferParams(u))}withDelegation(a){var u;const l=validateAddress((u=a.delegate)!==null&&u!==void 0?u:"");if(a.delegate&&l!==ValidationResult.VALID)throw new InvalidAddressError(a.delegate,invalidDetail(l));return this.operations.push(Object.assign({kind:OpKind.DELEGATION},a)),this}withOrigination(a){return this.operations.push(Object.assign({kind:OpKind.ORIGINATION},a)),this}withIncreasePaidStorage(a){const u=validateAddress(a.destination);if(u!==ValidationResult.VALID)throw new InvalidAddressError(a.destination,invalidDetail(u));return this.operations.push(Object.assign({kind:OpKind.INCREASE_PAID_STORAGE},a)),this}withTransferTicket(a){const u=validateAddress(a.destination);if(u!==ValidationResult.VALID)throw new InvalidAddressError(a.destination,invalidDetail(u));return this.operations.push(Object.assign({kind:OpKind.TRANSFER_TICKET},a)),this}mapOperation(a){return __awaiter$4(this,void 0,void 0,function*(){switch(a.kind){case OpKind.TRANSACTION:return this.walletProvider.mapTransferParamsToWalletParams(()=>__awaiter$4(this,void 0,void 0,function*(){return a}));case OpKind.ORIGINATION:return this.walletProvider.mapOriginateParamsToWalletParams(()=>__awaiter$4(this,void 0,void 0,function*(){return this.context.parser.prepareCodeOrigination(Object.assign({},a))}));case OpKind.DELEGATION:return this.walletProvider.mapDelegateParamsToWalletParams(()=>__awaiter$4(this,void 0,void 0,function*(){return a}));case OpKind.INCREASE_PAID_STORAGE:return this.walletProvider.mapIncreasePaidStorageWalletParams(()=>__awaiter$4(this,void 0,void 0,function*(){return a}));default:throw new InvalidOperationKindError(JSON.stringify(a.kind))}})}with(a){for(const u of a)switch(u.kind){case OpKind.TRANSACTION:this.withTransfer(u);break;case OpKind.ORIGINATION:this.withOrigination(u);break;case OpKind.DELEGATION:this.withDelegation(u);break;case OpKind.INCREASE_PAID_STORAGE:this.withIncreasePaidStorage(u);break;default:throw new InvalidOperationKindError(JSON.stringify(u.kind))}return this}send(){return __awaiter$4(this,void 0,void 0,function*(){const a=[];for(const l of this.operations)a.push(yield this.mapOperation(l));const u=yield this.walletProvider.sendOperations(a);return this.context.operationFactory.createBatchOperation(u)})}}class Wallet{constructor(a){this.context=a,this.walletCommand=u=>({send:u})}get walletProvider(){return this.context.walletProvider}pkh(){return __awaiter$4(this,arguments,void 0,function*({forceRefetch:a}={}){return(!this._pkh||a)&&(this._pkh=yield this.walletProvider.getPKH()),this._pkh})}pk(){return __awaiter$4(this,arguments,void 0,function*({forceRefetch:a}={}){return(!this._pk||a)&&(this._pk=yield this.walletProvider.getPK()),this._pk})}originate(a){return this.walletCommand(()=>__awaiter$4(this,void 0,void 0,function*(){const u=yield this.walletProvider.mapOriginateParamsToWalletParams(()=>this.context.parser.prepareCodeOrigination(Object.assign({},a))),l=yield this.walletProvider.sendOperations([u]);return this.context.operationFactory.createOriginationOperation(l)}))}setDelegate(a){var u;const l=validateAddress((u=a.delegate)!==null&&u!==void 0?u:"");if(a.delegate&&l!==ValidationResult.VALID)throw new InvalidAddressError(a.delegate,invalidDetail(l));return this.walletCommand(()=>__awaiter$4(this,void 0,void 0,function*(){const f=yield this.walletProvider.mapDelegateParamsToWalletParams(()=>__awaiter$4(this,void 0,void 0,function*(){return a})),c=yield this.walletProvider.sendOperations([f]);return this.context.operationFactory.createDelegationOperation(c)}))}signFailingNoop(a){return __awaiter$4(this,void 0,void 0,function*(){const u={kind:OpKind.FAILING_NOOP,arbitrary:a.arbitrary},l=yield this.context.readProvider.getBlockHash(a.basedOnBlock),f=yield this.context.forger.forge({branch:l,contents:[u]});return{signature:yield this.walletProvider.sign(f,Uint8Array.from([3])),bytes:f,signedContent:{branch:l,contents:[{kind:OpKind.FAILING_NOOP,arbitrary:a.arbitrary}]}}})}registerDelegate(){return this.walletCommand(()=>__awaiter$4(this,void 0,void 0,function*(){const a=yield this.walletProvider.mapDelegateParamsToWalletParams(()=>__awaiter$4(this,void 0,void 0,function*(){return{delegate:yield this.pkh()}})),u=yield this.walletProvider.sendOperations([a]);return this.context.operationFactory.createDelegationOperation(u)}))}transfer(a){const u=validateAddress(a.to);if(u!==ValidationResult.VALID)throw new InvalidAddressError(a.to,invalidDetail(u));return this.walletCommand(()=>__awaiter$4(this,void 0,void 0,function*(){const l=yield this.walletProvider.mapTransferParamsToWalletParams(()=>__awaiter$4(this,void 0,void 0,function*(){return a})),f=yield this.walletProvider.sendOperations([l]);return this.context.operationFactory.createTransactionOperation(f)}))}transferTicket(a){const u=validateAddress(a.destination);if(u!==ValidationResult.VALID)throw new InvalidAddressError(a.destination,invalidDetail(u));return this.walletCommand(()=>__awaiter$4(this,void 0,void 0,function*(){const l=yield this.walletProvider.mapTransferTicketParamsToWalletParams(()=>__awaiter$4(this,void 0,void 0,function*(){return a})),f=yield this.walletProvider.sendOperations([l]);return this.context.operationFactory.createTransferTicketOperation(f)}))}stake(a){return this.walletCommand(()=>__awaiter$4(this,void 0,void 0,function*(){const u=yield this.walletProvider.mapStakeParamsToWalletParams(()=>__awaiter$4(this,void 0,void 0,function*(){const f=yield this.pkh();if(a.to||(a.to=f),a.to!==f)throw new InvalidStakingAddressError(a.to);return a.parameter={entrypoint:"stake",value:{prim:"Unit"}},a})),l=yield this.walletProvider.sendOperations([u]);return this.context.operationFactory.createTransactionOperation(l)}))}unstake(a){return this.walletCommand(()=>__awaiter$4(this,void 0,void 0,function*(){const u=yield this.walletProvider.mapUnstakeParamsToWalletParams(()=>__awaiter$4(this,void 0,void 0,function*(){const f=yield this.pkh();if(a.to||(a.to=f),a.to!==f)throw new InvalidStakingAddressError(a.to);return a.parameter={entrypoint:"unstake",value:{prim:"Unit"}},a})),l=yield this.walletProvider.sendOperations([u]);return yield this.context.operationFactory.createTransactionOperation(l)}))}finalizeUnstake(a){return this.walletCommand(()=>__awaiter$4(this,void 0,void 0,function*(){const u=yield this.walletProvider.mapFinalizeUnstakeParamsToWalletParams(()=>__awaiter$4(this,void 0,void 0,function*(){const f=yield this.pkh();if(a.to||(a.to=f),a.to!==f)throw new InvalidStakingAddressError(a.to);if(a.amount||(a.amount=0),a.amount!==0)throw new InvalidFinalizeUnstakeAmountError("Amount must be 0 to finalize unstake.");return a.parameter={entrypoint:"finalize_unstake",value:{prim:"Unit"}},a})),l=yield this.walletProvider.sendOperations([u]);return yield this.context.operationFactory.createTransactionOperation(l)}))}increasePaidStorage(a){const u=validateAddress(a.destination);if(u!==ValidationResult.VALID)throw new InvalidAddressError(a.destination,invalidDetail(u));return this.walletCommand(()=>__awaiter$4(this,void 0,void 0,function*(){const l=yield this.walletProvider.mapIncreasePaidStorageWalletParams(()=>__awaiter$4(this,void 0,void 0,function*(){return a})),f=yield this.walletProvider.sendOperations([l]);return this.context.operationFactory.createIncreasePaidStorageOperation(f)}))}batch(a){const u=new WalletOperationBatch(this.walletProvider,this.context);return Array.isArray(a)&&u.with(a),u}at(a){return __awaiter$4(this,arguments,void 0,function*(u,l=f=>f){const f=validateContractAddress(u);if(f!==ValidationResult.VALID)throw new InvalidContractAddressError(u,invalidDetail(f));const c=this.context.withExtensions().rpc,h=this.context.withExtensions().readProvider,p=yield h.getScript(u,"head"),v=yield h.getEntrypoints(u),y=new ContractAbstraction(u,p,this,this.context.contract,v,c,h);return l(y,this.context)})}getPK(){return __awaiter$4(this,void 0,void 0,function*(){return yield this.pk()})}}const receiptFromOperation=(s,{ALLOCATION_BURN:a,ORIGINATION_BURN:u}={ALLOCATION_BURN:257,ORIGINATION_BURN:257})=>{BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:BigNumber.ROUND_UP});const l=flattenOperationResult({contents:s});let f=new BigNumber(0),c=new BigNumber(0),h=new BigNumber(0),p=new BigNumber(0),v=new BigNumber(0),y=new BigNumber(0);return l.forEach(b=>{h=h.plus(b.fee||0),p=p.plus(Array.isArray(b.originated_contracts)?b.originated_contracts.length*u:0),v=v.plus("allocated_destination_contract"in b?a:0),f=f.plus(b.consumed_milligas||0),y=y.plus("paid_storage_size_diff"in b&&Number(b.paid_storage_size_diff)||0)}),c=c.plus(v).plus(p).plus(y),{totalFee:h,totalMilliGas:f,totalGas:f.dividedBy(1e3),totalStorage:c,totalAllocationBurn:v,totalOriginationBurn:p,totalPaidStorageDiff:y,totalStorageBurn:new BigNumber(c.multipliedBy(COST_PER_BYTE))}};class ConfirmationUndefinedError extends TezosToolkitConfigError{constructor(){super(),this.name="ConfirmationUndefinedError",this.message="Default confirmation count can not be undefined"}}class ObservableError extends NetworkError$1{constructor(a){super(),this.message=a,this.name="ObservableError"}}const MAX_BRANCH_ANCESTORS=60;class WalletOperation{operationResults(){return __awaiter$4(this,void 0,void 0,function*(){return this._operationResult.pipe(first()).toPromise()})}receipt(){return __awaiter$4(this,void 0,void 0,function*(){const a=yield this.operationResults();if(!a)throw new ObservableError("Unable to get operation results");return receiptFromOperation(a)})}constructor(a,u,l){if(this.opHash=a,this.context=u,this._newHead$=l,this._operationResult=new ReplaySubject(1),this._includedInBlock=new ReplaySubject(1),this._included=!1,this.newHead$=this._newHead$.pipe(switchMap(f=>{var c,h;const p=(h=(c=this.lastHead)===null||c===void 0?void 0:c.header.level)!==null&&h!==void 0?h:f.header.level-1;return range$1(p+1,f.header.level-p-1).pipe(concatMap(v=>this.context.readProvider.getBlock(v)),endWith(f))}),tap(f=>this.lastHead=f),share({connector:()=>new ReplaySubject(1),resetOnError:!1,resetOnComplete:!1,resetOnRefCountZero:!1})),this.confirmed$=this.newHead$.pipe(map(f=>{for(const c of f.operations)for(const h of c)if(h.hash===this.opHash)return this._included=!0,this._includedInBlock.next(f),this._operationResult.next(h.contents),f}),filter(f=>typeof f<"u"),first(),share({connector:()=>new ReplaySubject(1),resetOnError:!1,resetOnComplete:!1,resetOnRefCountZero:!1})),validateOperation(this.opHash)!==ValidationResult.VALID)throw new InvalidOperationHashError(this.opHash);this.confirmed$.pipe(first(),catchError(()=>of(void 0))).subscribe()}getCurrentConfirmation(){return __awaiter$4(this,void 0,void 0,function*(){return this._included?combineLatest([this._includedInBlock,from(this.context.readProvider.getBlock("head"))]).pipe(map(([a,u])=>u.header.level-a.header.level+1),first()).toPromise():0})}isInCurrentBranch(){return __awaiter$4(this,arguments,void 0,function*(a="head"){if(!this._included)return!0;const u=yield this.context.readProvider.getBlockLevel(a),l=yield this._includedInBlock.pipe(first()).toPromise();if(!l)throw new ObservableError("Inclusion block is undefined");const f=u-l.header.level;if(f<=0)return!0;const c=Math.min(l.header.level+f,l.header.level+MAX_BRANCH_ANCESTORS);return new Set(yield this.context.readProvider.getLiveBlocks(c)).has(l.hash)})}confirmationObservable(a){if(typeof a<"u"&&a<1)throw new InvalidConfirmationCountError(a);const{defaultConfirmationCount:u}=this.context.config,l=a!==void 0?a:u;if(l===void 0)throw new ConfirmationUndefinedError;return combineLatest([this._includedInBlock,this.newHead$]).pipe(distinctUntilChanged(([,f],[,c])=>f.hash===c.hash),map(([f,c])=>({block:c,expectedConfirmation:l,currentConfirmation:c.header.level-f.header.level+1,completed:c.header.level-f.header.level>=l-1,isInCurrentBranch:()=>this.isInCurrentBranch(c.hash)})),takeWhile(({completed:f})=>!f,!0))}confirmation(a){return this.confirmationObservable(a).toPromise()}}class TransactionWalletOperation extends WalletOperation{constructor(a,u,l){super(a,u,l),this.opHash=a,this.context=u}revealOperation(){return __awaiter$4(this,void 0,void 0,function*(){const a=yield this.operationResults();if(!a)throw new ObservableError("operationResult returned undefined");return a.find(u=>u.kind===OpKind.REVEAL)})}transactionOperation(){return __awaiter$4(this,void 0,void 0,function*(){const a=yield this.operationResults();if(!a)throw new ObservableError("operationResult returned undefined");return a.find(u=>u.kind===OpKind.TRANSACTION)})}status(){return __awaiter$4(this,void 0,void 0,function*(){if(!this._included)return"pending";const a=yield this.transactionOperation();return a?a.metadata.operation_result.status:"unknown"})}}class OriginationWalletOperation extends WalletOperation{constructor(a,u,l){super(a,u,l),this.opHash=a,this.context=u}originationOperation(){return __awaiter$4(this,void 0,void 0,function*(){const a=yield this.operationResults();if(a)return findWithKind(a,OpKind.ORIGINATION);throw new ObservableError("Unable to fetch operation result")})}revealOperation(){return __awaiter$4(this,void 0,void 0,function*(){const a=yield this.operationResults();if(a)return findWithKind(a,OpKind.REVEAL);throw new ObservableError("Unable to fetch operation result")})}status(){return __awaiter$4(this,void 0,void 0,function*(){if(!this._included)return"pending";const a=yield this.originationOperation();return a?a.metadata.operation_result.status:"unknown"})}contract(){return __awaiter$4(this,void 0,void 0,function*(){const a=yield this.originationOperation(),u=((a==null?void 0:a.metadata.operation_result.originated_contracts)||[])[0];return this.context.wallet.at(u)})}}class DelegationWalletOperation extends WalletOperation{constructor(a,u,l){super(a,u,l),this.opHash=a,this.context=u}revealOperation(){return __awaiter$4(this,void 0,void 0,function*(){const a=yield this.operationResults();if(a)return a.find(u=>u.kind===OpKind.REVEAL);throw new ObservableError("Unable to fetch operation result")})}delegationOperation(){return __awaiter$4(this,void 0,void 0,function*(){const a=yield this.operationResults();if(a)return a.find(u=>u.kind===OpKind.DELEGATION);throw new ObservableError("Unable to fetch operation result")})}status(){return __awaiter$4(this,void 0,void 0,function*(){if(!this._included)return"pending";const a=yield this.delegationOperation();return a?a.metadata.operation_result.status:"unknown"})}}class TransferTicketWalletOperation extends WalletOperation{constructor(a,u,l){super(a,u,l),this.opHash=a,this.context=u}revealOperation(){return __awaiter$4(this,void 0,void 0,function*(){const a=yield this.operationResults();if(!a)throw new ObservableError("operationResult returned undefined");return a.find(u=>u.kind===OpKind.REVEAL)})}transferTicketOperation(){return __awaiter$4(this,void 0,void 0,function*(){const a=yield this.operationResults();if(!a)throw new ObservableError("operationResult returned undefined");return a.find(u=>u.kind===OpKind.TRANSFER_TICKET)})}status(){return __awaiter$4(this,void 0,void 0,function*(){if(!this._included)return"pending";const a=yield this.transferTicketOperation();return a?a.metadata.operation_result.status:"unknown"})}}class LegacyWalletProvider{constructor(a){this.context=a}getPKH(){return __awaiter$4(this,void 0,void 0,function*(){return this.context.signer.publicKeyHash()})}getPK(){return __awaiter$4(this,void 0,void 0,function*(){return this.context.signer.publicKey()})}mapTransferParamsToWalletParams(a){return __awaiter$4(this,void 0,void 0,function*(){return attachKind(yield a(),OpKind.TRANSACTION)})}mapStakeParamsToWalletParams(a){return __awaiter$4(this,void 0,void 0,function*(){return attachKind(yield a(),OpKind.TRANSACTION)})}mapUnstakeParamsToWalletParams(a){return __awaiter$4(this,void 0,void 0,function*(){return attachKind(yield a(),OpKind.TRANSACTION)})}mapFinalizeUnstakeParamsToWalletParams(a){return __awaiter$4(this,void 0,void 0,function*(){return attachKind(yield a(),OpKind.TRANSACTION)})}mapOriginateParamsToWalletParams(a){return __awaiter$4(this,void 0,void 0,function*(){return attachKind(yield a(),OpKind.ORIGINATION)})}mapDelegateParamsToWalletParams(a){return __awaiter$4(this,void 0,void 0,function*(){return attachKind(yield a(),OpKind.DELEGATION)})}mapIncreasePaidStorageWalletParams(a){return __awaiter$4(this,void 0,void 0,function*(){return attachKind(yield a(),OpKind.INCREASE_PAID_STORAGE)})}mapTransferTicketParamsToWalletParams(a){return __awaiter$4(this,void 0,void 0,function*(){return attachKind(yield a(),OpKind.TRANSFER_TICKET)})}sendOperations(a){return __awaiter$4(this,void 0,void 0,function*(){return(yield this.context.batch.batch(a).send()).hash})}sign(a,u){return __awaiter$4(this,void 0,void 0,function*(){const{prefixSig:l}=yield this.context.signer.sign(a,u);return l})}}class ContractMethodObject{constructor(a,u,l,f,c="unit",h=!0,p=!1){this.provider=a,this.address=u,this.parameterSchema=l,this.name=f,this.args=c,this.isMultipleEntrypoint=h,this.isAnonymous=p}getSignature(){return this.isAnonymous?this.parameterSchema.ExtractSchema()[this.name]:this.parameterSchema.ExtractSchema()}send(a={}){return this.provider instanceof Wallet?this.provider.transfer(this.toTransferParams(a)).send():this.provider.transfer(this.toTransferParams(a))}toTransferParams({fee:a,gasLimit:u,storageLimit:l,source:f,amount:c=0,mutez:h=!1}={}){return{to:this.address,amount:c,fee:a,mutez:h,source:f,gasLimit:u,storageLimit:l,parameter:{entrypoint:this.isMultipleEntrypoint?this.name:DEFAULT_SMART_CONTRACT_METHOD_NAME,value:this.isAnonymous?this.parameterSchema.EncodeObject({[this.name]:this.args}):this.parameterSchema.EncodeObject(this.args)}}}}class ContractMethod{constructor(a,u,l,f,c,h=!0,p=!1){this.provider=a,this.address=u,this.parameterSchema=l,this.name=f,this.args=c,this.isMultipleEntrypoint=h,this.isAnonymous=p}validateArgs(a,u,l){const f=u.ExtractSignatures();if(!f.find(c=>c.length===a.length))throw new InvalidParameterError(l,f,a)}get schema(){return this.isAnonymous?this.parameterSchema.ExtractSchema()[this.name]:this.parameterSchema.ExtractSchema()}getSignature(){if(this.isAnonymous){const a=this.parameterSchema.ExtractSignatures().find(u=>u[0]===this.name);if(a)return a.shift(),a}else{const a=this.parameterSchema.ExtractSignatures();return a.length==1?a[0]:a}}send(a={}){return this.provider instanceof Wallet?this.provider.transfer(this.toTransferParams(a)).send():this.provider.transfer(this.toTransferParams(a))}toTransferParams({fee:a,gasLimit:u,storageLimit:l,source:f,amount:c=0,mutez:h=!1}={}){return{to:this.address,amount:c,fee:a,mutez:h,source:f,gasLimit:u,storageLimit:l,parameter:{entrypoint:this.isMultipleEntrypoint?this.name:DEFAULT_SMART_CONTRACT_METHOD_NAME,value:this.isAnonymous?this.parameterSchema.Encode(this.name,...this.args):this.parameterSchema.Encode(...this.args)}}}}class OnChainView{constructor(a,u,l,f,c,h="Unit"){this._rpc=a,this._readProvider=u,this._contractAddress=l,this._smartContractViewSchema=f,this._contractStorageType=c,this._args=h}getSignature(){return{parameter:this._smartContractViewSchema.extractArgsSchema(),result:this._smartContractViewSchema.extractResultSchema()}}executeView(a){return __awaiter$4(this,void 0,void 0,function*(){this.verifyContextExecution(a);const u=yield this._readProvider.getChainId(),l=this.transformArgsToMichelson(),f={contract:this._contractAddress,view:this._smartContractViewSchema.viewName,input:l,chain_id:u,source:a.viewCaller};return a.source&&(f.payer=a.source),this.executeViewAndDecodeResult(f)})}verifyContextExecution(a){if(a.source&&validateAddress(a.source)!==ValidationResult.VALID)throw new InvalidViewSimulationContext(`The source account who initialized the view execution is invalid: ${a.source}.`);if(!a.viewCaller||validateAddress(a.viewCaller)!==ValidationResult.VALID)throw new InvalidViewSimulationContext(`The contract which is the caller of view is invalid: ${a.viewCaller}.`)}transformArgsToMichelson(){try{return this._smartContractViewSchema.encodeViewArgs(this._args)}catch(a){throw new InvalidViewParameterError(this._smartContractViewSchema.viewName,this.getSignature(),this._args,a)}}adaptViewCodeToContext(a,u,l){const f={BALANCE:[{prim:"PUSH",args:[{prim:"mutez"},{int:l}]}],SENDER:[{prim:"PUSH",args:[{prim:"address"},{string:u}]}],SELF_ADDRESS:[{prim:"PUSH",args:[{prim:"address"},{string:this._contractAddress}]}],AMOUNT:[{prim:"PUSH",args:[{prim:"mutez"},{int:"0"}]}]};return a.forEach((c,h)=>{c.prim in f&&(a[h]=Object(f)[c.prim]),c.args&&c.args.length!==0?this.adaptViewCodeToContext(c.args,u,l):Array.isArray(c)&&this.adaptViewCodeToContext(c,u,l)}),a}executeViewAndDecodeResult(a){return __awaiter$4(this,void 0,void 0,function*(){let u;try{u=(yield this._rpc.runScriptView(a)).data}catch(l){const f=validateAndExtractFailwith(l);throw f?new ViewSimulationError(`The simulation of the on-chain view named ${this._smartContractViewSchema.viewName} failed with: ${JSON.stringify(f)}`,this._smartContractViewSchema.viewName,f,l):l}return this._smartContractViewSchema.decodeViewResult(u)})}}class ContractMethodFactory{constructor(a,u){this.provider=a,this.contractAddress=u}createContractMethodFlatParams(a,u,l,f=!0,c=!1){return new ContractMethod(this.provider,this.contractAddress,a,u,l,f,c)}createContractMethodObjectParam(a,u,l,f=!0,c=!1){return new ContractMethodObject(this.provider,this.contractAddress,a,u,l,f,c)}createContractViewObjectParam(a,u,l,f,c){return new OnChainView(a,u,this.contractAddress,l,f,c)}}const DEFAULT_SMART_CONTRACT_METHOD_NAME="default";class ContractView{constructor(a,u,l,f,c,h,p){this.currentContract=a,this.name=u,this.callbackParametersSchema=l,this.parameterSchema=f,this.args=c,this.rpc=h,this.readProvider=p}read(a){return __awaiter$4(this,void 0,void 0,function*(){const u=validateChain(a??"");if(validateContractAddress(a??"")==ValidationResult.VALID)throw new DeprecationError("Since version 12, the lambda view no longer depends on a lambda contract. The read method no longer accepts a contract address as a parameter.");if(a&&u!==ValidationResult.VALID)throw new InvalidChainIdError(a,invalidDetail(u));const l=this.parameterSchema.Encode(...this.args),f=yield this.rpc.runView({contract:this.currentContract.address,entrypoint:this.name,input:l,chain_id:a||(yield this.readProvider.getChainId())});return this.callbackParametersSchema.Execute(f.data)})}}const validateArgs=(s,a,u)=>{const l=a.ExtractSignatures();if(!l.find(f=>f.length===s.length))throw new InvalidParameterError(u,l,s)},isView=s=>{let a=!1;if("prim"in s&&s.prim==="pair"&&s.args){const u=s.args[s.args.length-1];"prim"in u&&u.prim==="contract"&&(a=!0)}return a};class ContractAbstraction{constructor(a,u,l,f,c,h,p){this.address=a,this.script=u,this.storageProvider=f,this.entrypoints=c,this.rpc=h,this.readProvider=p,this.methods={},this.methodsObject={},this.views={},this.contractViews={},this.contractMethodFactory=new ContractMethodFactory(l,a),this.schema=Schema.fromRPCResponse({script:this.script}),this.parameterSchema=ParameterSchema.fromRPCResponse({script:this.script}),this.viewSchema=ViewSchema.fromRPCResponse({script:this.script}),this.viewSchema.length!==0&&this._initializeOnChainViews(this,h,this.readProvider,this.viewSchema),this.eventSchema=EventSchema.fromRPCResponse({script:this.script}),this._initializeMethods(this,this.entrypoints.entrypoints,this.rpc,this.readProvider)}_initializeMethods(a,u,l,f){const c=this.parameterSchema,h=Object.keys(u);if(c.isMultipleEntryPoint)h.forEach(v=>{const y=new ParameterSchema(u[v]);if(this.methods[v]=function(...b){return a.contractMethodFactory.createContractMethodFlatParams(y,v,b)},this.methodsObject[v]=function(b){return a.contractMethodFactory.createContractMethodObjectParam(y,v,b)},isView(u[v])){const b=function(...S){const E=u[v].args[0],R=new ParameterSchema(E),O=u[v].args[1].args[0],I=new ParameterSchema(O);return validateArgs(S,R,v),new ContractView(a,v,I,R,S,l,f)};this.views[v]=b}}),Object.keys(c.ExtractSchema()).filter(v=>Object.keys(u).indexOf(v)===-1).forEach(v=>{this.methods[v]=function(...y){return a.contractMethodFactory.createContractMethodFlatParams(c,v,y,!1,!0)},this.methodsObject[v]=function(y){return a.contractMethodFactory.createContractMethodObjectParam(c,v,y,!1,!0)}});else{const p=this.parameterSchema;this.methods[DEFAULT_SMART_CONTRACT_METHOD_NAME]=function(...v){return a.contractMethodFactory.createContractMethodFlatParams(p,DEFAULT_SMART_CONTRACT_METHOD_NAME,v,!1)},this.methodsObject[DEFAULT_SMART_CONTRACT_METHOD_NAME]=function(v){return a.contractMethodFactory.createContractMethodObjectParam(p,DEFAULT_SMART_CONTRACT_METHOD_NAME,v,!1)}}}_initializeOnChainViews(a,u,l,f){const c=this.schema.val;f.forEach(h=>{this.contractViews[h.viewName]=function(p){return a.contractMethodFactory.createContractViewObjectParam(u,l,h,c,p)}})}storage(){return this.storageProvider.getStorage(this.address,this.schema)}bigMap(a){return this.storageProvider.getBigMapKey(this.address,a,this.schema)}}const setDelegate=s=>[{prim:"DROP"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PUSH",args:[{prim:"key_hash"},{string:s}]},{prim:"SOME"},{prim:"SET_DELEGATE"},{prim:"CONS"}],transferImplicit=(s,a)=>[{prim:"DROP"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PUSH",args:[{prim:"key_hash"},{string:s}]},{prim:"IMPLICIT_ACCOUNT"},{prim:"PUSH",args:[{prim:"mutez"},{int:`${a}`}]},{prim:"UNIT"},{prim:"TRANSFER_TOKENS"},{prim:"CONS"}],removeDelegate=()=>[{prim:"DROP"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"NONE",args:[{prim:"key_hash"}]},{prim:"SET_DELEGATE"},{prim:"CONS"}],transferToContract=(s,a)=>[{prim:"DROP"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PUSH",args:[{prim:"address"},{string:s}]},{prim:"CONTRACT",args:[{prim:"unit"}]},{prim:"IF_NONE",args:[[{prim:"UNIT"},{prim:"FAILWITH"}],[]]},{prim:"PUSH",args:[{prim:"mutez"},{int:`${a}`}]},{prim:"UNIT"},{prim:"TRANSFER_TOKENS"},{prim:"CONS"}],MANAGER_LAMBDA={setDelegate,removeDelegate,transferImplicit,transferToContract};class SaplingStateAbstraction{constructor(a,u){this.id=a,this.provider=u}getSaplingDiff(a){return __awaiter$4(this,void 0,void 0,function*(){return this.provider.getSaplingDiffByID(this.id.toString(),a)})}getId(){return this.id.toString()}}class BigMapAbstraction{constructor(a,u,l){this.id=a,this.schema=u,this.provider=l}get(a,u){return __awaiter$4(this,void 0,void 0,function*(){try{return yield this.provider.getBigMapKeyByID(this.id.toString(),a,this.schema,u)}catch(l){if(l instanceof HttpResponseError&&l.status===STATUS_CODE.NOT_FOUND)return;throw l}})}getMultipleValues(a,u){return __awaiter$4(this,arguments,void 0,function*(l,f,c=5){return this.provider.getBigMapKeysByID(this.id.toString(),l,this.schema,f,c)})}toJSON(){return this.id.toString()}toString(){return this.id.toString()}}const smartContractAbstractionSemantic=s=>({big_map:(a,u)=>{if(!a||!("int"in a)||a.int===void 0)return{};{const l=new Schema(u);return new BigMapAbstraction(new BigNumber(a.int),l,s)}},sapling_state:a=>!a||!("int"in a)||a.int===void 0?{}:new SaplingStateAbstraction(new BigNumber(a.int),s)});var _PrepareProvider_counters;const mergeLimits=(s,a)=>{var u,l,f;return{fee:(u=s.fee)!==null&&u!==void 0?u:a.fee,gasLimit:(l=s.gasLimit)!==null&&l!==void 0?l:a.gasLimit,storageLimit:(f=s.storageLimit)!==null&&f!==void 0?f:a.storageLimit}};class PrepareProvider extends Provider{constructor(a){super(a),this.context=a,_PrepareProvider_counters.set(this,void 0),__classPrivateFieldSet$1(this,_PrepareProvider_counters,{})}getBlockHash(a){return __awaiter$4(this,void 0,void 0,function*(){return this.context.readProvider.getBlockHash(a??"head~2")})}getProtocolHash(){return __awaiter$4(this,void 0,void 0,function*(){return this.context.readProvider.getNextProtocol("head")})}getHeadCounter(a){return __awaiter$4(this,void 0,void 0,function*(){var u;return(u=this.context.readProvider.getCounter(a,"head"))!==null&&u!==void 0?u:"0"})}adjustGasForBatchOperation(a,u,l){return BigNumber.min(u,a.div(l+1))}getOperationLimits(a,u){return __awaiter$4(this,void 0,void 0,function*(){const{hard_gas_limit_per_operation:l,hard_gas_limit_per_block:f,hard_storage_limit_per_operation:c}=a;return{fee:0,gasLimit:u?Math.floor(this.adjustGasForBatchOperation(f,l,u).toNumber()):l.toNumber(),storageLimit:c.toNumber()}})}getFee(a,u,l){return(!__classPrivateFieldGet$1(this,_PrepareProvider_counters,"f")[u]||__classPrivateFieldGet$1(this,_PrepareProvider_counters,"f")[u]<l)&&(__classPrivateFieldGet$1(this,_PrepareProvider_counters,"f")[u]=l),{counter:`${++__classPrivateFieldGet$1(this,_PrepareProvider_counters,"f")[u]}`,fee:typeof a.fee>"u"?"0":`${a.fee}`,gas_limit:typeof a.gas_limit>"u"?"0":`${a.gas_limit}`,storage_limit:typeof a.storage_limit>"u"?"0":`${a.storage_limit}`}}getSource(a,u,l){return{source:typeof a.source>"u"?l||u:a.source}}addRevealOperationIfNeeded(a,u){return __awaiter$4(this,void 0,void 0,function*(){if(isOpRequireReveal(a)){const l=[a],{publicKey:f,pkh:c}=yield this.getKeys();if(yield this.isAccountRevealRequired(u)){if(!f)throw new PublicKeyNotFoundError(c);return l.unshift(yield createRevealOperation({fee:getRevealFee(c),storageLimit:REVEAL_STORAGE_LIMIT,gasLimit:getRevealGasLimit(c)},u,f)),l}}return a})}getKeys(){return __awaiter$4(this,void 0,void 0,function*(){const a=this.context.isAnySignerConfigured();return{pkh:a?yield this.signer.publicKeyHash():yield this.context.walletProvider.getPKH(),publicKey:a?yield this.signer.publicKey():void 0}})}convertIntoArray(a){return Array.isArray(a)?[...a]:[a]}constructOpContents(a,u,l,f,c){return a.map(h=>{switch(h.kind){case OpKind.ACTIVATION:case OpKind.DRAIN_DELEGATE:return Object.assign({},h);case OpKind.ORIGINATION:return Object.assign(Object.assign(Object.assign(Object.assign({},h),{balance:typeof h.balance<"u"?`${h.balance}`:"0"}),this.getSource(h,l,f)),this.getFee(h,l,u));case OpKind.TRANSACTION:{const p=Object.assign(Object.assign(Object.assign(Object.assign({},h),{amount:typeof h.amount<"u"?`${h.amount}`:"0"}),this.getSource(h,l,f)),this.getFee(h,l,u));if(p.source.toLowerCase().startsWith("kt1"))throw new DeprecationError(`KT1 addresses are not supported as source since ${Protocols.PsBabyM1}`);return p}case OpKind.REVEAL:case OpKind.DELEGATION:case OpKind.REGISTER_GLOBAL_CONSTANT:case OpKind.UPDATE_CONSENSUS_KEY:case OpKind.SMART_ROLLUP_ADD_MESSAGES:case OpKind.SMART_ROLLUP_ORIGINATE:case OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE:return Object.assign(Object.assign(Object.assign({},h),this.getSource(h,l,f)),this.getFee(h,l,u));case OpKind.TRANSFER_TICKET:return Object.assign(Object.assign(Object.assign(Object.assign({},h),{ticket_amount:`${h.ticket_amount}`}),this.getSource(h,l,f)),this.getFee(h,l,u));case OpKind.INCREASE_PAID_STORAGE:return Object.assign(Object.assign(Object.assign(Object.assign({},h),{amount:`${h.amount}`}),this.getSource(h,l,f)),this.getFee(h,l,u));case OpKind.BALLOT:if(c===void 0)throw new RPCResponseError("Failed to get the current voting period index");return Object.assign(Object.assign({},h),{period:c==null?void 0:c.voting_period.index});case OpKind.PROPOSALS:if(c===void 0)throw new RPCResponseError("Failed to get the current voting period index");return Object.assign(Object.assign({},h),{period:c==null?void 0:c.voting_period.index});default:throw new InvalidOperationKindError(h.kind)}})}activate(a){return __awaiter$4(this,arguments,void 0,function*({pkh:u,secret:l}){const f=yield createActivationOperation({pkh:u,secret:l}),c=this.convertIntoArray(f),h=yield this.getBlockHash(),p=yield this.getProtocolHash();__classPrivateFieldSet$1(this,_PrepareProvider_counters,{});const v=parseInt(yield this.getHeadCounter(u),10),y=this.constructOpContents(c,v,u);return{opOb:{branch:h,contents:y,protocol:p},counter:v}})}reveal(a){return __awaiter$4(this,arguments,void 0,function*({fee:u,gasLimit:l,storageLimit:f}){const{pkh:c,publicKey:h}=yield this.getKeys();if(!h)throw new PublicKeyNotFoundError(c);const p=yield this.context.readProvider.getProtocolConstants("head"),v=yield this.getOperationLimits(p),y=mergeLimits({fee:u,storageLimit:f,gasLimit:l},v),b=yield createRevealOperation({fee:y.fee,gasLimit:y.gasLimit,storageLimit:y.storageLimit},c,h),S=this.convertIntoArray(b),E=yield this.getBlockHash(),R=yield this.getProtocolHash();__classPrivateFieldSet$1(this,_PrepareProvider_counters,{});const O=parseInt(yield this.getHeadCounter(c),10),I=this.constructOpContents(S,O,c);return{opOb:{branch:E,contents:I,protocol:R},counter:O}})}originate(a,u){return __awaiter$4(this,void 0,void 0,function*(){var{fee:l,storageLimit:f,gasLimit:c}=a,h=__rest(a,["fee","storageLimit","gasLimit"]);const{pkh:p}=yield this.getKeys(),v=yield this.context.readProvider.getProtocolConstants("head"),y=yield this.getOperationLimits(v),b=yield createOriginationOperation(yield this.context.parser.prepareCodeOrigination(Object.assign(Object.assign({},h),mergeLimits({fee:l,storageLimit:f,gasLimit:c},y)))),S=yield this.addRevealOperationIfNeeded(b,p),E=this.convertIntoArray(S),R=yield this.getBlockHash(),O=yield this.getProtocolHash();__classPrivateFieldSet$1(this,_PrepareProvider_counters,{});const I=parseInt(yield this.getHeadCounter(p),10),B=this.constructOpContents(E,I,p,u);return{opOb:{branch:R,contents:B,protocol:O},counter:I}})}transaction(a){return __awaiter$4(this,void 0,void 0,function*(){var{fee:u,storageLimit:l,gasLimit:f}=a,c=__rest(a,["fee","storageLimit","gasLimit"]);const{pkh:h}=yield this.getKeys(),p=yield this.context.readProvider.getProtocolConstants("head"),v=yield this.getOperationLimits(p),y=yield createTransferOperation(Object.assign(Object.assign({},c),mergeLimits({fee:u,storageLimit:l,gasLimit:f},v))),b=yield this.addRevealOperationIfNeeded(y,h),S=this.convertIntoArray(b),E=yield this.getBlockHash(),R=yield this.getProtocolHash();__classPrivateFieldSet$1(this,_PrepareProvider_counters,{});const O=parseInt(yield this.getHeadCounter(h),10),I=this.constructOpContents(S,O,h,c.source);return{opOb:{branch:E,contents:I,protocol:R},counter:O}})}stake(a){return __awaiter$4(this,void 0,void 0,function*(){var{fee:u,storageLimit:l,gasLimit:f}=a,c=__rest(a,["fee","storageLimit","gasLimit"]);const{pkh:h}=yield this.getKeys(),p=yield this.context.readProvider.getProtocolConstants("head"),v=yield this.getOperationLimits(p),y=yield createTransferOperation(Object.assign(Object.assign(Object.assign(Object.assign({},c),{to:h}),mergeLimits({fee:u,storageLimit:l,gasLimit:f},v)),{parameter:{entrypoint:"stake",value:{prim:"Unit"}}})),b=yield this.addRevealOperationIfNeeded(y,h),S=this.convertIntoArray(b),E=yield this.getBlockHash(),R=yield this.getProtocolHash();__classPrivateFieldSet$1(this,_PrepareProvider_counters,{});const O=parseInt(yield this.getHeadCounter(h),10),I=this.constructOpContents(S,O,h,c.source);return{opOb:{branch:E,contents:I,protocol:R},counter:O}})}unstake(a){return __awaiter$4(this,void 0,void 0,function*(){var{fee:u,storageLimit:l,gasLimit:f}=a,c=__rest(a,["fee","storageLimit","gasLimit"]);const{pkh:h}=yield this.getKeys(),p=yield this.context.readProvider.getProtocolConstants("head"),v=yield this.getOperationLimits(p),y=yield createTransferOperation(Object.assign(Object.assign(Object.assign(Object.assign({},c),{to:h}),mergeLimits({fee:u,storageLimit:l,gasLimit:f},v)),{parameter:{entrypoint:"unstake",value:{prim:"Unit"}}})),b=yield this.addRevealOperationIfNeeded(y,h),S=this.convertIntoArray(b),E=yield this.getBlockHash(),R=yield this.getProtocolHash();__classPrivateFieldSet$1(this,_PrepareProvider_counters,{});const O=parseInt(yield this.getHeadCounter(h),10),I=this.constructOpContents(S,O,h,c.source);return{opOb:{branch:E,contents:I,protocol:R},counter:O}})}finalizeUnstake(a){return __awaiter$4(this,void 0,void 0,function*(){var{fee:u,storageLimit:l,gasLimit:f}=a,c=__rest(a,["fee","storageLimit","gasLimit"]);const{pkh:h}=yield this.getKeys(),p=yield this.context.readProvider.getProtocolConstants("head"),v=yield this.getOperationLimits(p),y=yield createTransferOperation(Object.assign(Object.assign(Object.assign(Object.assign({},c),{to:h,amount:0}),mergeLimits({fee:u,storageLimit:l,gasLimit:f},v)),{parameter:{entrypoint:"finalize_unstake",value:{prim:"Unit"}}})),b=yield this.addRevealOperationIfNeeded(y,h),S=this.convertIntoArray(b),E=yield this.getBlockHash(),R=yield this.getProtocolHash();__classPrivateFieldSet$1(this,_PrepareProvider_counters,{});const O=parseInt(yield this.getHeadCounter(h),10),I=this.constructOpContents(S,O,h,c.source);return{opOb:{branch:E,contents:I,protocol:R},counter:O}})}delegation(a){return __awaiter$4(this,void 0,void 0,function*(){var{fee:u,storageLimit:l,gasLimit:f}=a,c=__rest(a,["fee","storageLimit","gasLimit"]);const{pkh:h}=yield this.getKeys(),p=yield this.context.readProvider.getProtocolConstants("head"),v=yield this.getOperationLimits(p),y=yield createSetDelegateOperation(Object.assign(Object.assign({},c),mergeLimits({fee:u,storageLimit:l,gasLimit:f},v))),b=yield this.addRevealOperationIfNeeded(y,h),S=this.convertIntoArray(b),E=yield this.getBlockHash(),R=yield this.getProtocolHash();__classPrivateFieldSet$1(this,_PrepareProvider_counters,{});const O=parseInt(yield this.getHeadCounter(h),10),I=this.constructOpContents(S,O,h,c.source);return{opOb:{branch:E,contents:I,protocol:R},counter:O}})}registerDelegate(a,u){return __awaiter$4(this,arguments,void 0,function*({fee:l,storageLimit:f,gasLimit:c},h){const{pkh:p}=yield this.getKeys(),v=yield this.context.readProvider.getProtocolConstants("head"),y=yield this.getOperationLimits(v),b=mergeLimits({fee:l,storageLimit:f,gasLimit:c},y),S=yield createRegisterDelegateOperation({fee:b.fee,storageLimit:b.storageLimit,gasLimit:b.gasLimit},p),E=yield this.addRevealOperationIfNeeded(S,p),R=this.convertIntoArray(E),O=yield this.getBlockHash(),I=yield this.getProtocolHash();__classPrivateFieldSet$1(this,_PrepareProvider_counters,{});const B=parseInt(yield this.getHeadCounter(p),10),N=this.constructOpContents(R,B,p,h);return{opOb:{branch:O,contents:N,protocol:I},counter:B}})}registerGlobalConstant(a){return __awaiter$4(this,void 0,void 0,function*(){var{fee:u,storageLimit:l,gasLimit:f}=a,c=__rest(a,["fee","storageLimit","gasLimit"]);const{pkh:h}=yield this.getKeys(),p=yield this.context.readProvider.getProtocolConstants("head"),v=yield this.getOperationLimits(p),y=yield createRegisterGlobalConstantOperation(Object.assign(Object.assign({},c),mergeLimits({fee:u,storageLimit:l,gasLimit:f},v))),b=yield this.addRevealOperationIfNeeded(y,h),S=this.convertIntoArray(b),E=yield this.getBlockHash(),R=yield this.getProtocolHash();__classPrivateFieldSet$1(this,_PrepareProvider_counters,{});const O=parseInt(yield this.getHeadCounter(h),10),I=this.constructOpContents(S,O,h,c.source);return{opOb:{branch:E,contents:I,protocol:R},counter:O}})}updateConsensusKey(a,u){return __awaiter$4(this,void 0,void 0,function*(){var{fee:l,storageLimit:f,gasLimit:c}=a,h=__rest(a,["fee","storageLimit","gasLimit"]);const{pkh:p}=yield this.getKeys(),v=yield this.context.readProvider.getProtocolConstants("head"),y=yield this.getOperationLimits(v),b=yield createUpdateConsensusKeyOperation(Object.assign(Object.assign({},h),mergeLimits({fee:l,storageLimit:f,gasLimit:c},y))),S=yield this.addRevealOperationIfNeeded(b,p),E=this.convertIntoArray(S),R=yield this.getBlockHash(),O=yield this.getProtocolHash();__classPrivateFieldSet$1(this,_PrepareProvider_counters,{});const I=parseInt(yield this.getHeadCounter(p),10),B=this.constructOpContents(E,I,p,u);return{opOb:{branch:R,contents:B,protocol:O},counter:I}})}increasePaidStorage(a){return __awaiter$4(this,void 0,void 0,function*(){var{fee:u,storageLimit:l,gasLimit:f}=a,c=__rest(a,["fee","storageLimit","gasLimit"]);const{pkh:h}=yield this.getKeys(),p=yield this.context.readProvider.getProtocolConstants("head"),v=yield this.getOperationLimits(p),y=yield createIncreasePaidStorageOperation(Object.assign(Object.assign({},c),mergeLimits({fee:u,storageLimit:l,gasLimit:f},v))),b=yield this.addRevealOperationIfNeeded(y,h),S=this.convertIntoArray(b),E=yield this.getBlockHash(),R=yield this.getProtocolHash();__classPrivateFieldSet$1(this,_PrepareProvider_counters,{});const O=parseInt(yield this.getHeadCounter(h),10),I=this.constructOpContents(S,O,h,c.source);return{opOb:{branch:E,contents:I,protocol:R},counter:O}})}ballot(a){return __awaiter$4(this,void 0,void 0,function*(){const{pkh:u}=yield this.getKeys(),l=yield createBallotOperation(Object.assign({},a)),f=this.convertIntoArray(l),c=yield this.getBlockHash(),h=yield this.getProtocolHash();__classPrivateFieldSet$1(this,_PrepareProvider_counters,{});const p=parseInt(yield this.getHeadCounter(u),10);let v;try{v=yield this.rpc.getCurrentPeriod()}catch{throw new RPCResponseError("Failed to get the current voting period index")}const y=this.constructOpContents(f,p,u,void 0,v);return{opOb:{branch:c,contents:y,protocol:h},counter:p}})}proposals(a){return __awaiter$4(this,void 0,void 0,function*(){const{pkh:u}=yield this.getKeys(),l=yield createProposalsOperation(Object.assign({},a)),f=this.convertIntoArray(l),c=yield this.getBlockHash(),h=yield this.getProtocolHash();__classPrivateFieldSet$1(this,_PrepareProvider_counters,{});const p=parseInt(yield this.getHeadCounter(u),10);let v;try{v=yield this.rpc.getCurrentPeriod()}catch{throw new RPCResponseError("Failed to get the current voting period index")}const y=this.constructOpContents(f,p,u,void 0,v);return{opOb:{branch:c,contents:y,protocol:h},counter:p}})}drainDelegate(a,u){return __awaiter$4(this,void 0,void 0,function*(){const{pkh:l}=yield this.getKeys(),f=yield createDrainDelegateOperation(Object.assign({},a)),c=this.convertIntoArray(f),h=yield this.getBlockHash(),p=yield this.getProtocolHash();__classPrivateFieldSet$1(this,_PrepareProvider_counters,{});const v=parseInt(yield this.getHeadCounter(l),10),y=this.constructOpContents(c,v,l,u);return{opOb:{branch:h,contents:y,protocol:p},counter:v}})}transferTicket(a){return __awaiter$4(this,void 0,void 0,function*(){var{fee:u,storageLimit:l,gasLimit:f}=a,c=__rest(a,["fee","storageLimit","gasLimit"]);const{pkh:h}=yield this.getKeys(),p=yield this.context.readProvider.getProtocolConstants("head"),v=yield this.getOperationLimits(p),y=yield createTransferTicketOperation(Object.assign(Object.assign({},c),mergeLimits({fee:u,storageLimit:l,gasLimit:f},v))),b=yield this.addRevealOperationIfNeeded(y,h),S=this.convertIntoArray(b),E=yield this.getBlockHash(),R=yield this.getProtocolHash();__classPrivateFieldSet$1(this,_PrepareProvider_counters,{});const O=parseInt(yield this.getHeadCounter(h),10),I=this.constructOpContents(S,O,h,c.source);return{opOb:{branch:E,contents:I,protocol:R},counter:O}})}smartRollupAddMessages(a){return __awaiter$4(this,void 0,void 0,function*(){var{fee:u,storageLimit:l,gasLimit:f}=a,c=__rest(a,["fee","storageLimit","gasLimit"]);const{pkh:h}=yield this.getKeys(),p=yield this.context.readProvider.getProtocolConstants("head"),v=yield this.getOperationLimits(p),y=yield createSmartRollupAddMessagesOperation(Object.assign(Object.assign({},c),mergeLimits({fee:u,storageLimit:l,gasLimit:f},v))),b=yield this.addRevealOperationIfNeeded(y,h),S=this.convertIntoArray(b),E=yield this.getBlockHash(),R=yield this.getProtocolHash();__classPrivateFieldSet$1(this,_PrepareProvider_counters,{});const O=parseInt(yield this.getHeadCounter(h),10),I=this.constructOpContents(S,O,h,c.source);return{opOb:{branch:E,contents:I,protocol:R},counter:O}})}smartRollupOriginate(a){return __awaiter$4(this,void 0,void 0,function*(){var{fee:u,storageLimit:l,gasLimit:f}=a,c=__rest(a,["fee","storageLimit","gasLimit"]);const{pkh:h}=yield this.getKeys(),p=yield this.context.readProvider.getProtocolConstants("head"),v=yield this.getOperationLimits(p),y=yield createSmartRollupOriginateOperation(Object.assign(Object.assign({},mergeLimits({fee:u,storageLimit:l,gasLimit:f},v)),c)),b=yield this.addRevealOperationIfNeeded(y,h),S=this.convertIntoArray(b),E=yield this.getBlockHash(),R=yield this.getProtocolHash();__classPrivateFieldSet$1(this,_PrepareProvider_counters,{});const O=parseInt(yield this.getHeadCounter(h),10),I=this.constructOpContents(S,O,h,c.source);return{opOb:{branch:E,contents:I,protocol:R},counter:O}})}smartRollupExecuteOutboxMessage(a){return __awaiter$4(this,void 0,void 0,function*(){var{fee:u,storageLimit:l,gasLimit:f}=a,c=__rest(a,["fee","storageLimit","gasLimit"]);const{pkh:h}=yield this.getKeys(),p=yield this.context.readProvider.getProtocolConstants("head"),v=yield this.getOperationLimits(p),y=yield createSmartRollupExecuteOutboxMessageOperation(Object.assign(Object.assign({},c),mergeLimits({fee:u,storageLimit:l,gasLimit:f},v))),b=yield this.addRevealOperationIfNeeded(y,h),S=this.convertIntoArray(b),E=yield this.getBlockHash(),R=yield this.getProtocolHash();__classPrivateFieldSet$1(this,_PrepareProvider_counters,{});const O=parseInt(yield this.getHeadCounter(h),10),I=this.constructOpContents(S,O,h,c.source);return{opOb:{branch:E,contents:I,protocol:R},counter:O}})}batch(a,u){return __awaiter$4(this,void 0,void 0,function*(){const{pkh:l,publicKey:f}=yield this.getKeys(),c=yield this.context.readProvider.getProtocolConstants("head"),h=yield this.getOperationLimits(c,a.length),p=yield this.isRevealOpNeeded(a,l),v=[];if(u)for(const R of a)if(isOpWithFee(R)){const O=u.shift(),I=mergeLimits(R,{fee:O.suggestedFeeMutez,storageLimit:O.storageLimit,gasLimit:O.gasLimit});v.push(yield this.getRPCOp(Object.assign(Object.assign({},R),I)))}else v.push(Object.assign({},R));else for(const R of a)if(isOpWithFee(R)){const O=mergeLimits(R,h);v.push(yield this.getRPCOp(Object.assign(Object.assign({},R),O)))}else v.push(Object.assign({},R));if(p){if(!f)throw new PublicKeyNotFoundError(l);v.unshift(yield createRevealOperation({fee:getRevealFee(l),storageLimit:REVEAL_STORAGE_LIMIT,gasLimit:getRevealGasLimit(l)},l,f))}const y=yield this.getBlockHash(),b=yield this.getProtocolHash();__classPrivateFieldSet$1(this,_PrepareProvider_counters,{});const S=parseInt(yield this.getHeadCounter(l),10),E=this.constructOpContents(v,S,l);return{opOb:{branch:y,contents:E,protocol:b},counter:S}})}contractCall(a){return __awaiter$4(this,void 0,void 0,function*(){var u,l,f;const c=yield this.getBlockHash(),h=yield this.getProtocolHash(),{pkh:p}=yield this.getKeys();__classPrivateFieldSet$1(this,_PrepareProvider_counters,{});const v=parseInt(yield this.getHeadCounter(p),10),y=a.toTransferParams(),b=yield this.context.readProvider.getProtocolConstants("head"),S=yield this.getOperationLimits(b),E=mergeLimits({fee:y.fee,storageLimit:y.storageLimit,gasLimit:y.gasLimit},S),R={kind:OpKind.TRANSACTION,fee:(u=y.fee)!==null&&u!==void 0?u:E.fee,gas_limit:(l=y.gasLimit)!==null&&l!==void 0?l:E.gasLimit,storage_limit:(f=y.storageLimit)!==null&&f!==void 0?f:E.storageLimit,amount:String(y.amount),destination:y.to,parameters:y.parameter},O=yield this.addRevealOperationIfNeeded(R,p),I=this.convertIntoArray(O),B=this.constructOpContents(I,v,p);return{opOb:{branch:c,contents:B,protocol:h},counter:v}})}toPreapply(a){return __awaiter$4(this,void 0,void 0,function*(){const{opOb:{contents:u,branch:l,protocol:f}}=a,c=this.toForge(a),h=yield this.context.forger.forge(c),p=yield this.context.signer.sign(h,new Uint8Array([3]));return[{contents:u,branch:l,protocol:f,signature:p.prefixSig}]})}toForge({opOb:{contents:a,branch:u}}){return{branch:u,contents:a}}}_PrepareProvider_counters=new WeakMap;const BATCH_KINDS=[OpKind.ACTIVATION,OpKind.ORIGINATION,OpKind.TRANSACTION,OpKind.DELEGATION];class OperationBatch extends Provider{constructor(a,u){super(a),this.estimator=u,this.operations=[],this.prepare=new PrepareProvider(this.context)}withTransfer(a){const u=validateAddress(a.to);if(a.amount<0)throw new InvalidAmountError(a.amount.toString());if(u!==ValidationResult.VALID)throw new InvalidAddressError(a.to,invalidDetail(u));return this.operations.push(Object.assign({kind:OpKind.TRANSACTION},a)),this}withTransferTicket(a){const u=validateAddress(a.destination);if(u!==ValidationResult.VALID)throw new InvalidAddressError(a.destination,invalidDetail(u));return this.operations.push(Object.assign({kind:OpKind.TRANSFER_TICKET},a)),this}withContractCall(a,u={}){return this.withTransfer(a.toTransferParams(u))}withDelegation(a){var u;const l=validateAddress(a.source);if(a.source&&l!==ValidationResult.VALID)throw new InvalidAddressError(a.source,invalidDetail(l));const f=validateAddress((u=a.delegate)!==null&&u!==void 0?u:"");if(a.delegate&&f!==ValidationResult.VALID)throw new InvalidAddressError(a.delegate,invalidDetail(f));return this.operations.push(Object.assign({kind:OpKind.DELEGATION},a)),this}withActivation({pkh:a,secret:u}){const l=validateKeyHash(a);if(l!==ValidationResult.VALID)throw new InvalidKeyHashError(a,invalidDetail(l));return this.operations.push({kind:OpKind.ACTIVATION,pkh:a,secret:u}),this}withOrigination(a){return this.operations.push(Object.assign({kind:OpKind.ORIGINATION},a)),this}withRegisterGlobalConstant(a){return this.operations.push(Object.assign({kind:OpKind.REGISTER_GLOBAL_CONSTANT},a)),this}withIncreasePaidStorage(a){return this.operations.push(Object.assign({kind:OpKind.INCREASE_PAID_STORAGE},a)),this}withSmartRollupAddMessages(a){return this.operations.push(Object.assign({kind:OpKind.SMART_ROLLUP_ADD_MESSAGES},a)),this}withSmartRollupOriginate(a){return this.operations.push(Object.assign({kind:OpKind.SMART_ROLLUP_ORIGINATE},a)),this}withSmartRollupExecuteOutboxMessage(a){return this.operations.push(Object.assign({kind:OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE},a)),this}getRPCOp(a){return __awaiter$4(this,void 0,void 0,function*(){switch(a.kind){case OpKind.TRANSACTION:return createTransferOperation(Object.assign({},a));case OpKind.ORIGINATION:return createOriginationOperation(yield this.context.parser.prepareCodeOrigination(Object.assign({},a)));case OpKind.DELEGATION:return createSetDelegateOperation(Object.assign({},a));case OpKind.REGISTER_GLOBAL_CONSTANT:return createRegisterGlobalConstantOperation(Object.assign({},a));case OpKind.INCREASE_PAID_STORAGE:return createIncreasePaidStorageOperation(Object.assign({},a));case OpKind.TRANSFER_TICKET:return createTransferTicketOperation(Object.assign({},a));case OpKind.SMART_ROLLUP_ADD_MESSAGES:return createSmartRollupAddMessagesOperation(Object.assign({},a));case OpKind.SMART_ROLLUP_ORIGINATE:return createSmartRollupOriginateOperation(Object.assign({},a));case OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE:return createSmartRollupExecuteOutboxMessageOperation(Object.assign({},a));default:throw new InvalidOperationKindError(JSON.stringify(a.kind))}})}with(a){for(const u of a)switch(u.kind){case OpKind.TRANSACTION:this.withTransfer(u);break;case OpKind.ORIGINATION:this.withOrigination(u);break;case OpKind.DELEGATION:this.withDelegation(u);break;case OpKind.ACTIVATION:this.withActivation(u);break;case OpKind.REGISTER_GLOBAL_CONSTANT:this.withRegisterGlobalConstant(u);break;case OpKind.INCREASE_PAID_STORAGE:this.withIncreasePaidStorage(u);break;case OpKind.TRANSFER_TICKET:this.withTransferTicket(u);break;case OpKind.SMART_ROLLUP_ADD_MESSAGES:this.withSmartRollupAddMessages(u);break;case OpKind.SMART_ROLLUP_ORIGINATE:this.withSmartRollupOriginate(u);break;case OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE:this.withSmartRollupExecuteOutboxMessage(u);break;default:throw new InvalidOperationKindError(JSON.stringify(u.kind))}return this}send(a){return __awaiter$4(this,void 0,void 0,function*(){const u=yield this.signer.publicKeyHash(),l=a&&a.source||u,f=yield this.estimator.batch(this.operations);f.length!==this.operations.length&&f.shift();const c=yield this.prepare.batch(this.operations,f),h=yield this.forge(c),{hash:p,context:v,forgedBytes:y,opResponse:b}=yield this.signAndInject(h);return new BatchOperation(p,c.opOb.contents,l,y,b,v)})}}class RPCBatchProvider{constructor(a,u){this.context=a,this.estimator=u}batch(a){const u=new OperationBatch(this.context,this.estimator);return Array.isArray(a)&&u.with(a),u}}class BatchWalletOperation extends WalletOperation{constructor(a,u,l){super(a,u,l),this.opHash=a,this.context=u,this.getOriginatedContractAddresses=()=>__awaiter$4(this,void 0,void 0,function*(){const f=yield this.operationResults();if(f){const c=f.filter(p=>p.kind==="origination");let h=[];for(const p of c)p.metadata.operation_result.originated_contracts&&(h=[...h,...p.metadata.operation_result.originated_contracts]);return h}else throw new ObservableError("Unable to fetch operation results")})}revealOperation(){return __awaiter$4(this,void 0,void 0,function*(){const a=yield this.operationResults();if(a)return a.find(u=>u.kind===OpKind.REVEAL);throw new ObservableError("Unable to fetch operation results")})}status(){return __awaiter$4(this,void 0,void 0,function*(){if(!this._included)return"pending";const a=yield this.operationResults();if(a)return a.filter(u=>BATCH_KINDS.indexOf(u.kind)!==-1).map(u=>hasMetadataWithResult(u)?u.metadata.operation_result.status:"unknown")[0]||"unknown";throw new ObservableError("Unable to fetch operation results")})}}class IncreasePaidStorageWalletOperation extends WalletOperation{constructor(a,u,l){super(a,u,l),this.opHash=a,this.context=u}revealOperation(){return __awaiter$4(this,void 0,void 0,function*(){const a=yield this.operationResults();if(a)return a.find(u=>u.kind===OpKind.REVEAL);throw new ObservableError("Unable to fetch operation result")})}increasePaidStorageOperation(){return __awaiter$4(this,void 0,void 0,function*(){const a=yield this.operationResults();if(a)return a.find(u=>u.kind===OpKind.INCREASE_PAID_STORAGE);throw new ObservableError("Unable to fetch operation result")})}status(){return __awaiter$4(this,void 0,void 0,function*(){if(!this._included)return"pending";const a=yield this.increasePaidStorageOperation();return a?a.metadata.operation_result.status:"unknown"})}}function timeoutAfter(s){return function(u){return new BehaviorSubject(null).pipe(timeout({each:s,with:()=>throwError(()=>new ConfirmationTimeoutError("Confirmation polling timed out"))}),mergeMap(()=>u))}}const createNewPollingBasedHeadObservable=(s,a,u)=>s.pipe(timeoutAfter(a.config.confirmationPollingTimeoutSecond*1e3),share({connector:()=>new ReplaySubject(1),resetOnError:!1,resetOnComplete:!1,resetOnRefCountZero:!1}));class OperationFactory{constructor(a){this.context=a,this.sharedHeadObs=defer(()=>createObservableFromSubscription(this.context.stream.subscribeBlock("head")))}createNewHeadObservable(){return __awaiter$4(this,void 0,void 0,function*(){return createNewPollingBasedHeadObservable(this.sharedHeadObs,this.context)})}createPastBlockWalker(a,u=1){return from(this.context.readProvider.getBlock(a)).pipe(switchMap(l=>u===1?of(l):range$1(l.header.level,u-1).pipe(startWith(l),concatMap(f=>__awaiter$4(this,void 0,void 0,function*(){return this.context.readProvider.getBlock(typeof f=="number"?f:f.header.level)})))))}createHeadObservableFromConfig(a){return __awaiter$4(this,arguments,void 0,function*({blockIdentifier:u}){const l=[];return u&&l.push(this.createPastBlockWalker(u)),l.push(yield this.createNewHeadObservable()),concat(...l)})}createOperation(a){return __awaiter$4(this,arguments,void 0,function*(u,l={}){return new WalletOperation(u,this.context.clone(),yield this.createHeadObservableFromConfig(l))})}createBatchOperation(a){return __awaiter$4(this,arguments,void 0,function*(u,l={}){return new BatchWalletOperation(u,this.context.clone(),yield this.createHeadObservableFromConfig(l))})}createTransactionOperation(a){return __awaiter$4(this,arguments,void 0,function*(u,l={}){return new TransactionWalletOperation(u,this.context.clone(),yield this.createHeadObservableFromConfig(l))})}createTransferTicketOperation(a){return __awaiter$4(this,arguments,void 0,function*(u,l={}){return new TransferTicketWalletOperation(u,this.context.clone(),yield this.createHeadObservableFromConfig(l))})}createDelegationOperation(a){return __awaiter$4(this,arguments,void 0,function*(u,l={}){return new DelegationWalletOperation(u,this.context.clone(),yield this.createHeadObservableFromConfig(l))})}createOriginationOperation(a){return __awaiter$4(this,arguments,void 0,function*(u,l={}){return new OriginationWalletOperation(u,this.context.clone(),yield this.createHeadObservableFromConfig(l))})}createIncreasePaidStorageOperation(a){return __awaiter$4(this,arguments,void 0,function*(u,l={}){return new IncreasePaidStorageWalletOperation(u,this.context.clone(),yield this.createHeadObservableFromConfig(l))})}}class RpcTzProvider extends Provider{constructor(a){super(a),this.prepare=new PrepareProvider(this.context)}getBalance(a){return __awaiter$4(this,void 0,void 0,function*(){const u=validateAddress(a);if(u!==ValidationResult.VALID)throw new InvalidAddressError(a,invalidDetail(u));return this.context.readProvider.getBalance(a,"head")})}getSpendable(a){return __awaiter$4(this,void 0,void 0,function*(){const u=validateAddress(a);if(u!==ValidationResult.VALID)throw new InvalidAddressError(a,invalidDetail(u));return this.context.readProvider.getSpendable(a,"head")})}getDelegate(a){return __awaiter$4(this,void 0,void 0,function*(){const u=validateAddress(a);if(u!==ValidationResult.VALID)throw new InvalidAddressError(a,invalidDetail(u));return this.context.readProvider.getDelegate(a,"head")})}activate(a,u){return __awaiter$4(this,void 0,void 0,function*(){const l=validateKeyHash(a);if(l!==ValidationResult.VALID)throw new InvalidKeyHashError(a,invalidDetail(l));const f=yield this.prepare.activate({pkh:a,secret:u}),c=yield this.forge(f),h=`${c.opbytes}00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000`;return new Operation(yield this.rpc.injectOperation(h),Object.assign(Object.assign({},c),{opbytes:h}),[],this.context.clone())})}}const MINIMAL_FEE_MUTEZ=100,MINIMAL_FEE_PER_BYTE_MUTEZ=1,MINIMAL_FEE_PER_GAS_MUTEZ=.1;class Estimate{constructor(a,u,l,f,c=MINIMAL_FEE_MUTEZ){this._milligasLimit=a,this._storageLimit=u,this.opSize=l,this.minimalFeePerStorageByteMutez=f,this.baseFeeMutez=c}get burnFeeMutez(){return this.roundUp(Number(this.storageLimit)*Number(this.minimalFeePerStorageByteMutez))}get storageLimit(){return Math.max(Number(this._storageLimit),0)}get gasLimit(){return this.roundUp(Number(this._milligasLimit)/1e3)}get operationFeeMutez(){return this.gasLimit*MINIMAL_FEE_PER_GAS_MUTEZ+Number(this.opSize)*MINIMAL_FEE_PER_BYTE_MUTEZ}roundUp(a){return Math.ceil(Number(a))}get minimalFeeMutez(){return this.roundUp(this.operationFeeMutez+MINIMAL_FEE_MUTEZ)}get suggestedFeeMutez(){return this.roundUp(this.operationFeeMutez+MINIMAL_FEE_MUTEZ*1.2)}get usingBaseFeeMutez(){return Math.max(Number(this.baseFeeMutez),MINIMAL_FEE_MUTEZ)+this.roundUp(this.operationFeeMutez)}get totalCost(){return this.minimalFeeMutez+this.burnFeeMutez}get consumedMilligas(){return Number(this._milligasLimit)}static createEstimateInstanceFromProperties(a){let u=0,l=0,f=0,c=0,h;return a.forEach(p=>{u+=p.milligasLimit,l+=p.storageLimit,f+=p.opSize,c=Math.max(p.minimalFeePerStorageByteMutez,c),p.baseFeeMutez&&(h=h?h+p.baseFeeMutez:p.baseFeeMutez)}),new Estimate(u,l,f,c,h)}static createArrayEstimateInstancesFromProperties(a){return a.map(u=>new Estimate(u.milligasLimit,u.storageLimit,u.opSize,u.minimalFeePerStorageByteMutez,u.baseFeeMutez))}}class RevealEstimateError extends TaquitoError{constructor(){super(),this.name="RevealEstimateError",this.message="Public key is unknown, unable to estimate the reveal operation in Wallet API."}}const STUB_SIGNATURE="edsigtkpiSSschcaCt9pUVrpNPf7TTcgvgDEDD6NCEHMy8NNQJCGnMfLZzYoQj74yLjo9wx6MPVV29CvVzgi7qEcEUok3k7AuMg";class RPCEstimateProvider extends Provider{constructor(){super(...arguments),this.OP_SIZE_REVEAL=324,this.MILLIGAS_BUFFER=100*1e3,this.STORAGE_BUFFER=20,this.prepare=new PrepareProvider(this.context)}getKeys(){return __awaiter$4(this,void 0,void 0,function*(){const a=this.context.isAnySignerConfigured();return{publicKeyHash:a?yield this.signer.publicKeyHash():yield this.context.walletProvider.getPKH(),publicKey:a?yield this.signer.publicKey():void 0}})}getEstimationPropertiesFromOperationContent(a,u,l,f){const c=flattenOperationResult({contents:[a]});let h=0,p=0;return c.forEach(v=>{h+=Number(v.consumed_milligas)||0,p+="allocated_destination_contract"in v?f:0,p+="originated_contracts"in v&&Array.isArray(v.originated_contracts)?v.originated_contracts.length*f:0,p+="storage_size"in v&&"global_address"in v&&Number(v.storage_size)||0,p+="paid_storage_size_diff"in v&&Number(v.paid_storage_size_diff)||0,p+="genesis_commitment_hash"in v&&Number(v.size)||0}),isOpWithFee(a)?{milligasLimit:isOpWithGasBuffer(a)?h+Number(this.MILLIGAS_BUFFER):h,storageLimit:p>0?p+this.STORAGE_BUFFER:0,opSize:u,minimalFeePerStorageByteMutez:l.toNumber()}:{milligasLimit:0,storageLimit:0,opSize:u,minimalFeePerStorageByteMutez:l.toNumber(),baseFeeMutez:0}}calculateEstimates(a,u){return __awaiter$4(this,void 0,void 0,function*(){const{opbytes:l,opOb:{branch:f,contents:c}}=yield this.forge(a),h={operation:{branch:f,contents:c,signature:STUB_SIGNATURE},chain_id:yield this.context.readProvider.getChainId()},{opResponse:p}=yield this.simulate(h),{cost_per_byte:v,origination_size:y}=u,b=[...flattenErrors(p,"backtracked"),...flattenErrors(p)];if(b.length)throw new TezosOperationError(b,"Error occurred during estimation",p.contents);let S=1;return Array.isArray(a.opOb.contents)&&a.opOb.contents.length>1&&(S=p.contents[0].kind==="reveal"?a.opOb.contents.length-1:a.opOb.contents.length),p.contents.map(E=>this.getEstimationPropertiesFromOperationContent(E,E.kind==="reveal"?this.OP_SIZE_REVEAL/2:(l.length+130)/2/S,v,y??257))})}originate(a){return __awaiter$4(this,void 0,void 0,function*(){const u=yield this.prepare.originate(a),l=yield this.context.readProvider.getProtocolConstants("head"),f=yield this.calculateEstimates(u,l);return u.opOb.contents[0].kind==="reveal"&&(f.shift(),f[0].opSize-=this.OP_SIZE_REVEAL/2),Estimate.createEstimateInstanceFromProperties(f)})}transfer(a){return __awaiter$4(this,void 0,void 0,function*(){var u,{fee:l,storageLimit:f,gasLimit:c}=a,h=__rest(a,["fee","storageLimit","gasLimit"]);const p=validateAddress(h.to);if(p!==ValidationResult.VALID)throw new InvalidAddressError(h.to,invalidDetail(p));const v=validateAddress((u=h.source)!==null&&u!==void 0?u:"");if(h.source&&v!==ValidationResult.VALID)throw new InvalidAddressError(h.source,invalidDetail(v));if(h.amount<0)throw new InvalidAmountError(h.amount.toString());const y=yield this.prepare.transaction(Object.assign({fee:l,storageLimit:f,gasLimit:c},h)),b=yield this.context.readProvider.getProtocolConstants("head"),S=yield this.calculateEstimates(y,b);return y.opOb.contents[0].kind==="reveal"&&(S.shift(),S[0].opSize-=this.OP_SIZE_REVEAL/2),Estimate.createEstimateInstanceFromProperties(S)})}stake(a){return __awaiter$4(this,void 0,void 0,function*(){var u,{fee:l,storageLimit:f,gasLimit:c}=a,h=__rest(a,["fee","storageLimit","gasLimit"]);const p=validateAddress((u=h.source)!==null&&u!==void 0?u:"");if(h.source&&p!==ValidationResult.VALID)throw new InvalidAddressError(h.source,invalidDetail(p));if(h.to||(h.to=h.source),h.to&&h.to!==h.source)throw new InvalidStakingAddressError(h.to);if(h.amount<0)throw new InvalidAmountError(h.amount.toString());const v=yield this.prepare.stake(Object.assign({fee:l,storageLimit:f,gasLimit:c},h)),y=yield this.context.readProvider.getProtocolConstants("head"),b=yield this.calculateEstimates(v,y);return v.opOb.contents[0].kind==="reveal"&&(b.shift(),b[0].opSize-=this.OP_SIZE_REVEAL/2),Estimate.createEstimateInstanceFromProperties(b)})}unstake(a){return __awaiter$4(this,void 0,void 0,function*(){var u,{fee:l,storageLimit:f,gasLimit:c}=a,h=__rest(a,["fee","storageLimit","gasLimit"]);const p=validateAddress((u=h.source)!==null&&u!==void 0?u:"");if(h.source&&p!==ValidationResult.VALID)throw new InvalidAddressError(h.source,invalidDetail(p));if(h.to||(h.to=h.source),h.to&&h.to!==h.source)throw new InvalidStakingAddressError(h.to);if(h.amount<0)throw new InvalidAmountError(h.amount.toString());const v=yield this.prepare.unstake(Object.assign({fee:l,storageLimit:f,gasLimit:c},h)),y=yield this.context.readProvider.getProtocolConstants("head"),b=yield this.calculateEstimates(v,y);return v.opOb.contents[0].kind==="reveal"&&(b.shift(),b[0].opSize-=this.OP_SIZE_REVEAL/2),Estimate.createEstimateInstanceFromProperties(b)})}finalizeUnstake(a){return __awaiter$4(this,void 0,void 0,function*(){var u,{fee:l,storageLimit:f,gasLimit:c}=a,h=__rest(a,["fee","storageLimit","gasLimit"]);const p=validateAddress((u=h.source)!==null&&u!==void 0?u:"");if(h.source&&p!==ValidationResult.VALID)throw new InvalidAddressError(h.source,invalidDetail(p));if(h.to||(h.to=h.source),h.to&&h.to!==h.source)throw new InvalidStakingAddressError(h.to);if(h.amount||(h.amount=0),h.amount!==void 0&&h.amount!==0)throw new Error("Amount must be 0 for finalize_unstake operation");const v=yield this.prepare.finalizeUnstake(Object.assign({fee:l,storageLimit:f,gasLimit:c},h)),y=yield this.context.readProvider.getProtocolConstants("head"),b=yield this.calculateEstimates(v,y);return v.opOb.contents[0].kind==="reveal"&&(b.shift(),b[0].opSize-=this.OP_SIZE_REVEAL/2),Estimate.createEstimateInstanceFromProperties(b)})}transferTicket(a){return __awaiter$4(this,void 0,void 0,function*(){var u,{fee:l,storageLimit:f,gasLimit:c}=a,h=__rest(a,["fee","storageLimit","gasLimit"]);const p=validateAddress(h.destination);if(p!==ValidationResult.VALID)throw new InvalidAddressError(h.destination,invalidDetail(p));const v=validateAddress((u=h.source)!==null&&u!==void 0?u:"");if(h.source&&v!==ValidationResult.VALID)throw new InvalidAddressError(h.source,invalidDetail(v));const y=yield this.context.readProvider.getProtocolConstants("head"),b=yield this.prepare.transferTicket(Object.assign({fee:l,storageLimit:f,gasLimit:c},h)),S=yield this.calculateEstimates(b,y);return b.opOb.contents[0].kind==="reveal"&&(S.shift(),S[0].opSize-=this.OP_SIZE_REVEAL/2),Estimate.createEstimateInstanceFromProperties(S)})}setDelegate(a){return __awaiter$4(this,void 0,void 0,function*(){var u,{fee:l,gasLimit:f,storageLimit:c}=a,h=__rest(a,["fee","gasLimit","storageLimit"]);const p=validateAddress(h.source);if(h.source&&p!==ValidationResult.VALID)throw new InvalidAddressError(h.source,invalidDetail(p));const v=validateAddress((u=h.delegate)!==null&&u!==void 0?u:"");if(h.delegate&&v!==ValidationResult.VALID)throw new InvalidAddressError(h.delegate,invalidDetail(v));const y=yield this.prepare.delegation(Object.assign({fee:l,storageLimit:c,gasLimit:f},h)),b=yield this.context.readProvider.getProtocolConstants("head"),S=yield this.calculateEstimates(y,b);return y.opOb.contents[0].kind==="reveal"&&(S.shift(),S[0].opSize-=this.OP_SIZE_REVEAL/2),Estimate.createEstimateInstanceFromProperties(S)})}batch(a){return __awaiter$4(this,void 0,void 0,function*(){const u=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.prepare.batch(a),f=yield this.calculateEstimates(l,u);return Estimate.createArrayEstimateInstancesFromProperties(f)})}registerDelegate(a,u){return __awaiter$4(this,void 0,void 0,function*(){var{fee:l,storageLimit:f,gasLimit:c}=a,h=__rest(a,["fee","storageLimit","gasLimit"]);const p=(yield this.getKeys()).publicKeyHash,v=yield this.context.readProvider.getProtocolConstants("head"),y=u||p,b=yield this.prepare.registerDelegate(Object.assign({fee:l,storageLimit:f,gasLimit:c},h),y),S=yield this.calculateEstimates(b,v);return b.opOb.contents[0].kind==="reveal"&&(S.shift(),S[0].opSize-=this.OP_SIZE_REVEAL/2),Estimate.createEstimateInstanceFromProperties(S)})}reveal(a){return __awaiter$4(this,void 0,void 0,function*(){const{publicKeyHash:u,publicKey:l}=yield this.getKeys();if(!l)throw new RevealEstimateError;if(yield this.isAccountRevealRequired(u)){const f=yield this.context.readProvider.getProtocolConstants("head"),c=a?yield this.prepare.reveal(a):yield this.prepare.reveal({}),h=yield this.calculateEstimates(c,f);return Estimate.createEstimateInstanceFromProperties(h)}})}registerGlobalConstant(a){return __awaiter$4(this,void 0,void 0,function*(){var{fee:u,storageLimit:l,gasLimit:f}=a,c=__rest(a,["fee","storageLimit","gasLimit"]);const h=yield this.prepare.registerGlobalConstant(Object.assign({fee:u,storageLimit:l,gasLimit:f},c)),p=yield this.context.readProvider.getProtocolConstants("head"),v=yield this.calculateEstimates(h,p);return h.opOb.contents[0].kind==="reveal"&&(v.shift(),v[0].opSize-=this.OP_SIZE_REVEAL/2),Estimate.createEstimateInstanceFromProperties(v)})}increasePaidStorage(a){return __awaiter$4(this,void 0,void 0,function*(){var{fee:u,storageLimit:l,gasLimit:f}=a,c=__rest(a,["fee","storageLimit","gasLimit"]);if(c.amount<0)throw new InvalidAmountError(c.amount.toString());const h=yield this.context.readProvider.getProtocolConstants("head"),p=yield this.prepare.increasePaidStorage(Object.assign({fee:u,storageLimit:l,gasLimit:f},c)),v=yield this.calculateEstimates(p,h);return p.opOb.contents[0].kind==="reveal"&&(v.shift(),v[0].opSize-=this.OP_SIZE_REVEAL/2),Estimate.createEstimateInstanceFromProperties(v)})}updateConsensusKey(a){return __awaiter$4(this,void 0,void 0,function*(){const u=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.prepare.updateConsensusKey(a),f=yield this.calculateEstimates(l,u);return l.opOb.contents[0].kind==="reveal"&&(f.shift(),f[0].opSize-=this.OP_SIZE_REVEAL/2),Estimate.createEstimateInstanceFromProperties(f)})}smartRollupAddMessages(a){return __awaiter$4(this,void 0,void 0,function*(){const u=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.prepare.smartRollupAddMessages(a),f=yield this.calculateEstimates(l,u);return l.opOb.contents[0].kind==="reveal"&&(f.shift(),f[0].opSize-=this.OP_SIZE_REVEAL/2),Estimate.createEstimateInstanceFromProperties(f)})}smartRollupOriginate(a){return __awaiter$4(this,void 0,void 0,function*(){const u=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.prepare.smartRollupOriginate(a),f=yield this.calculateEstimates(l,u);return l.opOb.contents[0].kind==="reveal"&&(f.shift(),f[0].opSize-=this.OP_SIZE_REVEAL/2),Estimate.createEstimateInstanceFromProperties(f)})}smartRollupExecuteOutboxMessage(a){return __awaiter$4(this,void 0,void 0,function*(){const u=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.prepare.smartRollupExecuteOutboxMessage(a),f=yield this.calculateEstimates(l,u);return l.opOb.contents[0].kind==="reveal"&&f.shift(),Estimate.createEstimateInstanceFromProperties(f)})}contractCall(a){return __awaiter$4(this,void 0,void 0,function*(){const u=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.prepare.contractCall(a),f=yield this.calculateEstimates(l,u);return l.opOb.contents[0].kind==="reveal"&&(f.shift(),f[0].opSize-=this.OP_SIZE_REVEAL/2),Estimate.createEstimateInstanceFromProperties(f)})}}class DelegateOperation extends Operation{constructor(a,u,l,f,c,h){super(a,f,c,h),this.params=u,this.source=l}get operationResults(){const a=Array.isArray(this.results)&&this.results.find(l=>l.kind==="delegation"),u=a&&a.metadata&&a.metadata.operation_result;return u||void 0}get status(){var a,u;return(u=(a=this.operationResults)===null||a===void 0?void 0:a.status)!==null&&u!==void 0?u:"unknown"}get delegate(){return this.params.delegate}get isRegisterOperation(){return this.delegate===this.source}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get consumedGas(){return BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:BigNumber.ROUND_UP}),this.consumedMilliGas?new BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var a;return(a=this.operationResults)===null||a===void 0?void 0:a.consumed_milligas}get errors(){var a;return(a=this.operationResults)===null||a===void 0?void 0:a.errors}}class OriginationOperation extends Operation{constructor(a,u,l,f,c,h){super(a,l,f,c),this.params=u,this.contractProvider=h;const p=this.operationResults&&this.operationResults.originated_contracts;Array.isArray(p)&&(this.contractAddress=p[0])}get status(){var a,u;return(u=(a=this.operationResults)===null||a===void 0?void 0:a.status)!==null&&u!==void 0?u:"unknown"}get operationResults(){const a=Array.isArray(this.results)&&this.results.find(l=>l.kind==="origination"),u=a&&hasMetadataWithResult(a)&&a.metadata.operation_result;return u||void 0}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get consumedGas(){return BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:BigNumber.ROUND_UP}),this.consumedMilliGas?new BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var a;return(a=this.operationResults)===null||a===void 0?void 0:a.consumed_milligas}get storageDiff(){const a=this.operationResults&&this.operationResults.paid_storage_size_diff;return a||void 0}get storageSize(){const a=this.operationResults&&this.operationResults.storage_size;return a||void 0}get errors(){var a;return(a=this.operationResults)===null||a===void 0?void 0:a.errors}contract(a,u){return __awaiter$4(this,void 0,void 0,function*(){if(!this.contractAddress)throw new OriginationOperationError("No contract was originated in this operation");return yield this.confirmation(a,u),this.contractProvider.at(this.contractAddress)})}}class RegisterGlobalConstantOperation extends Operation{constructor(a,u,l,f,c,h){super(a,f,c,h),this.params=u,this.source=l,this.globalConstantHash=this.operationResults&&this.operationResults.global_address}get operationResults(){const a=Array.isArray(this.results)&&this.results.find(l=>l.kind==="register_global_constant"),u=a&&a.metadata&&a.metadata.operation_result;return u||void 0}get status(){var a,u;return(u=(a=this.operationResults)===null||a===void 0?void 0:a.status)!==null&&u!==void 0?u:"unknown"}get registeredExpression(){return this.params.value}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get errors(){var a;return(a=this.operationResults)===null||a===void 0?void 0:a.errors}get consumedGas(){return BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:BigNumber.ROUND_UP}),this.consumedMilliGas?new BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var a;return(a=this.operationResults)===null||a===void 0?void 0:a.consumed_milligas}}class RevealOperation extends Operation{constructor(a,u,l,f,c,h){super(a,f,c,h),this.params=u,this.source=l}get operationResults(){const a=Array.isArray(this.results)&&this.results.find(u=>u.kind==="reveal");return a?[a]:[]}get status(){const u=this.operationResults[0];return u?u.metadata.operation_result.status:"unknown"}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get publicKey(){return this.params.public_key}sumProp(a,u){return a.reduce((l,f)=>u in f?Number(f[u])+l:l,0)}get consumedGas(){return BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:BigNumber.ROUND_UP}),new BigNumber(this.consumedMilliGas).dividedBy(1e3).toString()}get consumedMilliGas(){return String(this.sumProp(flattenOperationResult({contents:this.operationResults}),"consumed_milligas"))}get storageDiff(){return String(this.sumProp(flattenOperationResult({contents:this.operationResults}),"paid_storage_size_diff"))}get storageSize(){return String(this.sumProp(flattenOperationResult({contents:this.operationResults}),"storage_size"))}get errors(){return flattenErrors({contents:this.operationResults})}}class TransactionOperation extends Operation{constructor(a,u,l,f,c,h){super(a,f,c,h),this.params=u,this.source=l}get operationResults(){const a=Array.isArray(this.results)&&this.results.find(u=>u.kind==="transaction");return a?[a]:[]}get status(){const u=this.operationResults[0];return u?u.metadata.operation_result.status:"unknown"}get amount(){return new BigNumber(this.params.amount)}get destination(){return this.params.destination}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}sumProp(a,u){return a.reduce((l,f)=>u in f?Number(f[u])+l:l,0)}get consumedGas(){return BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:BigNumber.ROUND_UP}),new BigNumber(this.consumedMilliGas).dividedBy(1e3).toString()}get consumedMilliGas(){return String(this.sumProp(flattenOperationResult({contents:this.operationResults}),"consumed_milligas"))}get storageDiff(){return String(this.sumProp(flattenOperationResult({contents:this.operationResults}),"paid_storage_size_diff"))}get storageSize(){return String(this.sumProp(flattenOperationResult({contents:this.operationResults}),"storage_size"))}get errors(){return flattenErrors({contents:this.operationResults})}}class IncreasePaidStorageOperation extends Operation{constructor(a,u,l,f,c,h){super(a,f,c,h),this.params=u,this.source=l}get operationResults(){const a=Array.isArray(this.results)&&this.results.find(l=>l.kind==="increase_paid_storage"),u=a&&a.metadata&&a.metadata.operation_result;return u||void 0}get status(){var a,u;return(u=(a=this.operationResults)===null||a===void 0?void 0:a.status)!==null&&u!==void 0?u:"unknown"}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get errors(){var a;return(a=this.operationResults)===null||a===void 0?void 0:a.errors}get consumedMilliGas(){var a;return(a=this.operationResults)===null||a===void 0?void 0:a.consumed_milligas}get amount(){return this.params.amount}get destination(){return this.params.destination}}class UpdateConsensusKeyOperation extends Operation{constructor(a,u,l,f,c,h){super(a,f,c,h),this.params=u,this.source=l}get operationResults(){const a=Array.isArray(this.results)&&this.results.find(l=>l.kind==="update_consensus_key"),u=a&&a.metadata&&a.metadata.operation_result;return u||void 0}get status(){var a,u;return(u=(a=this.operationResults)===null||a===void 0?void 0:a.status)!==null&&u!==void 0?u:"unknown"}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get pk(){return this.params.pk}get consumedMilliGas(){var a;return(a=this.operationResults)===null||a===void 0?void 0:a.consumed_milligas}get errors(){var a;return(a=this.operationResults)===null||a===void 0?void 0:a.errors}}class SmartRollupAddMessagesOperation extends Operation{constructor(a,u,l,f,c,h){super(a,f,c,h),this.params=u,this.source=l}get operationResults(){const a=Array.isArray(this.results)&&this.results.find(l=>l.kind==="smart_rollup_add_messages"),u=a&&a.metadata&&a.metadata.operation_result;return u||void 0}get status(){var a,u;return(u=(a=this.operationResults)===null||a===void 0?void 0:a.status)!==null&&u!==void 0?u:"unknown"}get message(){return this.params.message}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get consumedMilliGas(){var a;return(a=this.operationResults)===null||a===void 0?void 0:a.consumed_milligas}get errors(){var a;return(a=this.operationResults)===null||a===void 0?void 0:a.errors}}class SmartRollupOriginateOperation extends Operation{constructor(a,u,l,f,c,h){super(a,f,c,h),this.params=u,this.source=l}get operationResults(){const a=Array.isArray(this.results)&&this.results.find(l=>l.kind===OpKind.SMART_ROLLUP_ORIGINATE),u=a&&a.metadata&&a.metadata.operation_result;return u||void 0}get status(){var a,u;return(u=(a=this.operationResults)===null||a===void 0?void 0:a.status)!==null&&u!==void 0?u:"unknown"}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get consumedMilliGas(){var a;return(a=this.operationResults)===null||a===void 0?void 0:a.consumed_milligas}get pvmKind(){return this.params.pvm_kind}get kernel(){return this.params.kernel}get errors(){var a;return(a=this.operationResults)===null||a===void 0?void 0:a.errors}}class BallotOperation extends Operation{constructor(a,u,l,f,c,h){super(a,f,c,h),this.params=u,this.source=l}get operationResults(){const u=Array.isArray(this.results)&&this.results.find(l=>l.kind==="ballot");return u||void 0}get period(){var a;return(a=this.operationResults)===null||a===void 0?void 0:a.period}get proposal(){return this.params.proposal}get ballot(){return this.params.ballot}}class DrainDelegateOperation extends Operation{constructor(a,u,l,f,c){super(a,l,f,c),this.params=u}get operationResults(){const a=Array.isArray(this.results)&&this.results.find(l=>l.kind==="drain_delegate"),u=a&&a.metadata&&a.metadata.balance_updates;return u||void 0}get consensusKey(){return this.params.consensus_key}get delegate(){return this.params.delegate}get destination(){return this.params.destination}}class ProposalsOperation extends Operation{constructor(a,u,l,f,c,h){super(a,f,c,h),this.params=u,this.source=l}get operationResults(){const u=Array.isArray(this.results)&&this.results.find(l=>l.kind==="proposals");return u||void 0}get proposals(){return this.params.proposals}get period(){var a;return(a=this.operationResults)===null||a===void 0?void 0:a.period}}class TransferTicketOperation extends Operation{constructor(a,u,l,f,c,h){super(a,f,c,h),this.params=u,this.source=l}get operationResults(){const a=Array.isArray(this.results)&&this.results.find(l=>l.kind===OpKind.TRANSFER_TICKET),u=a&&a.metadata&&a.metadata.operation_result;return u||void 0}get status(){var a,u;return(u=(a=this.operationResults)===null||a===void 0?void 0:a.status)!==null&&u!==void 0?u:"unknown"}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get consumedGas(){return BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:BigNumber.ROUND_UP}),this.consumedMilliGas?new BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var a;return(a=this.operationResults)===null||a===void 0?void 0:a.consumed_milligas}}class SmartRollupExecuteOutboxMessageOperation extends Operation{constructor(a,u,l,f,c,h){super(a,f,c,h),this.params=u,this.source=l}get operationResults(){const a=Array.isArray(this.results)&&this.results.find(l=>l.kind===OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE),u=a&&a.metadata&&a.metadata.operation_result;return u||void 0}get status(){var a,u;return(u=(a=this.operationResults)===null||a===void 0?void 0:a.status)!==null&&u!==void 0?u:"unknown"}get rollup(){return this.params.rollup}get cementedCommitment(){return this.params.cemented_commitment}get outputProof(){return this.params.output_proof}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get consumedMilliGas(){var a;return(a=this.operationResults)===null||a===void 0?void 0:a.consumed_milligas}get errors(){var a;return(a=this.operationResults)===null||a===void 0?void 0:a.errors}}class RpcContractProvider extends Provider{constructor(a,u){super(a),this.estimator=u,this.contractProviderTypeSymbol=Symbol.for("taquito-contract-provider-type-symbol"),this.prepare=new PrepareProvider(this.context)}getStorage(a,u){return __awaiter$4(this,void 0,void 0,function*(){const l=validateContractAddress(a);if(l!==ValidationResult.VALID)throw new InvalidContractAddressError(a,invalidDetail(l));const f=yield this.context.readProvider.getScript(a,"head");u||(u=f);let c;return Schema.isSchema(u)?c=u:c=Schema.fromRPCResponse({script:u}),c.Execute(f.storage,smartContractAbstractionSemantic(this))})}getBigMapKey(a,u,l){return __awaiter$4(this,void 0,void 0,function*(){const f=validateContractAddress(a);if(f!==ValidationResult.VALID)throw new InvalidContractAddressError(a,invalidDetail(f));l||(l=(yield this.rpc.getContract(a)).script);let c;Schema.isSchema(l)?c=l:c=Schema.fromRPCResponse({script:l});const h=c.EncodeBigMapKey(u),p=yield this.rpc.getBigMapKey(a,h);return c.ExecuteOnBigMapValue(p)})}getBigMapKeyByID(a,u,l,f){return __awaiter$4(this,void 0,void 0,function*(){const{key:c,type:h}=l.EncodeBigMapKey(u),{packed:p}=yield this.context.packer.packData({data:c,type:h}),v=encodeExpr(p),y=f?yield this.context.readProvider.getBigMapValue({id:a.toString(),expr:v},f):yield this.context.readProvider.getBigMapValue({id:a.toString(),expr:v},"head");return l.ExecuteOnBigMapValue(y,smartContractAbstractionSemantic(this))})}getBigMapKeysByID(a,u,l,f){return __awaiter$4(this,arguments,void 0,function*(c,h,p,v,y=5){const b=yield this.getBlockForRequest(h,v),S=new MichelsonMap;let E=0,R=[];for(;E<h.length;){const I=h.slice(E,E+y).map(B=>this.getBigMapValueOrUndefined(B,c,p,b));R=[...R,...yield Promise.all(I)],E+=y}for(let O=0;O<R.length;O++)S.set(h[O],R[O]);return S})}getBlockForRequest(a,u){return __awaiter$4(this,void 0,void 0,function*(){return a.length===1||typeof u<"u"?u:yield this.context.readProvider.getBlockLevel("head")})}getBigMapValueOrUndefined(a,u,l,f){return __awaiter$4(this,void 0,void 0,function*(){try{return yield this.getBigMapKeyByID(u,a,l,f)}catch(c){if(c instanceof HttpResponseError&&c.status===STATUS_CODE.NOT_FOUND)return;throw c}})}getSaplingDiffByID(a,u){return __awaiter$4(this,void 0,void 0,function*(){return u?yield this.context.readProvider.getSaplingDiffById({id:a.toString()},u):yield this.context.readProvider.getSaplingDiffById({id:a.toString()},"head")})}originate(a){return __awaiter$4(this,void 0,void 0,function*(){const u=yield this.estimate(a,this.estimator.originate.bind(this.estimator)),l=yield this.prepare.originate(Object.assign(Object.assign({},a),u)),f=l.opOb.contents.find(b=>b.kind===OpKind.ORIGINATION),c=yield this.forge(l),{hash:h,context:p,forgedBytes:v,opResponse:y}=yield this.signAndInject(c);return new OriginationOperation(h,f,v,y,p,this)})}setDelegate(a){return __awaiter$4(this,void 0,void 0,function*(){var u;const l=validateAddress(a.source);if(a.source&&l!==ValidationResult.VALID)throw new InvalidAddressError(a.source,invalidDetail(l));const f=validateAddress((u=a.delegate)!==null&&u!==void 0?u:"");if(a.delegate&&f!==ValidationResult.VALID)throw new InvalidAddressError(a.delegate,invalidDetail(f));if(/kt1/i.test(a.source))throw new InvalidDelegationSource(a.source);const c=yield this.signer.publicKeyHash(),h=a.source||c,p=yield this.estimate(a,this.estimator.setDelegate.bind(this.estimator)),v=yield this.prepare.delegation(Object.assign(Object.assign({},a),p)),y=v.opOb.contents.find(I=>I.kind===OpKind.DELEGATION),b=yield this.forge(v),{hash:S,context:E,forgedBytes:R,opResponse:O}=yield this.signAndInject(b);return new DelegateOperation(S,y,h,R,O,E)})}registerDelegate(a){return __awaiter$4(this,void 0,void 0,function*(){const u=yield this.estimate(a,this.estimator.registerDelegate.bind(this.estimator)),l=yield this.signer.publicKeyHash(),f=yield this.prepare.registerDelegate(Object.assign(Object.assign({},a),u)),c=f.opOb.contents.find(S=>S.kind===OpKind.DELEGATION),h=yield this.forge(f),{hash:p,context:v,forgedBytes:y,opResponse:b}=yield this.signAndInject(h);return new DelegateOperation(p,c,l,y,b,v)})}transfer(a){return __awaiter$4(this,void 0,void 0,function*(){var u;const l=validateAddress(a.to);if(l!==ValidationResult.VALID)throw new InvalidAddressError(a.to,invalidDetail(l));const f=validateAddress((u=a.source)!==null&&u!==void 0?u:"");if(a.source&&f!==ValidationResult.VALID)throw new InvalidAddressError(a.source,invalidDetail(f));if(a.amount<0)throw new InvalidAmountError(a.amount.toString());const c=yield this.signer.publicKeyHash(),h=yield this.estimate(a,this.estimator.transfer.bind(this.estimator)),p=a.source||c,v=yield this.prepare.transaction(Object.assign(Object.assign({},a),h)),y=v.opOb.contents.find(I=>I.kind===OpKind.TRANSACTION),b=yield this.forge(v),{hash:S,context:E,forgedBytes:R,opResponse:O}=yield this.signAndInject(b);return new TransactionOperation(S,y,p,R,O,E)})}stake(a){return __awaiter$4(this,void 0,void 0,function*(){var u;const l=validateAddress((u=a.source)!==null&&u!==void 0?u:"");if(a.source&&l!==ValidationResult.VALID)throw new InvalidAddressError(a.source,invalidDetail(l));if(a.to||(a.to=a.source),a.to&&a.to!==a.source)throw new InvalidStakingAddressError(a.to);if(a.amount<0)throw new InvalidAmountError(a.amount.toString());const f=yield this.signer.publicKeyHash(),c=yield this.estimate(a,this.estimator.stake.bind(this.estimator)),h=a.source||f,p=yield this.prepare.stake(Object.assign(Object.assign({},a),c)),v=p.opOb.contents.find(O=>O.kind===OpKind.TRANSACTION),y=yield this.forge(p),{hash:b,context:S,forgedBytes:E,opResponse:R}=yield this.signAndInject(y);return new TransactionOperation(b,v,h,E,R,S)})}unstake(a){return __awaiter$4(this,void 0,void 0,function*(){var u;const l=validateAddress((u=a.source)!==null&&u!==void 0?u:"");if(a.source&&l!==ValidationResult.VALID)throw new InvalidAddressError(a.source,invalidDetail(l));if(a.to||(a.to=a.source),a.to&&a.to!==a.source)throw new InvalidStakingAddressError(a.to);if(a.amount<0)throw new InvalidAmountError(a.amount.toString());const f=yield this.signer.publicKeyHash(),c=yield this.estimate(a,this.estimator.unstake.bind(this.estimator)),h=a.source||f,p=yield this.prepare.unstake(Object.assign(Object.assign({},a),c)),v=p.opOb.contents.find(O=>O.kind===OpKind.TRANSACTION),y=yield this.forge(p),{hash:b,context:S,forgedBytes:E,opResponse:R}=yield this.signAndInject(y);return new TransactionOperation(b,v,h,E,R,S)})}finalizeUnstake(a){return __awaiter$4(this,void 0,void 0,function*(){var u;const l=validateAddress((u=a.source)!==null&&u!==void 0?u:"");if(a.source&&l!==ValidationResult.VALID)throw new InvalidAddressError(a.source,invalidDetail(l));if(a.to||(a.to=a.source),a.to&&a.to!==a.source)throw new InvalidStakingAddressError(a.to);if(a.amount||(a.amount=0),a.amount!==void 0&&a.amount>0)throw new InvalidFinalizeUnstakeAmountError("Amount must be 0 to finalize unstake.");const f=yield this.signer.publicKeyHash(),c=yield this.estimate(a,this.estimator.finalizeUnstake.bind(this.estimator)),h=a.source||f,p=yield this.prepare.finalizeUnstake(Object.assign(Object.assign({},a),c)),v=p.opOb.contents.find(O=>O.kind===OpKind.TRANSACTION),y=yield this.forge(p),{hash:b,context:S,forgedBytes:E,opResponse:R}=yield this.signAndInject(y);return new TransactionOperation(b,v,h,E,R,S)})}transferTicket(a){return __awaiter$4(this,void 0,void 0,function*(){var u,l;const f=validateAddress(a.destination);if(f!==ValidationResult.VALID)throw new InvalidAddressError(a.destination,invalidDetail(f));const c=validateAddress((u=a.source)!==null&&u!==void 0?u:"");if(a.source&&c!==ValidationResult.VALID)throw new InvalidAddressError(a.source,invalidDetail(c));const h=yield this.signer.publicKeyHash(),p=(l=a.source)!==null&&l!==void 0?l:h,v=yield this.estimate(a,this.estimator.transferTicket.bind(this.estimator)),y=yield this.prepare.transferTicket(Object.assign(Object.assign({},a),v)),b=y.opOb.contents.find(B=>B.kind===OpKind.TRANSFER_TICKET),S=yield this.forge(y),{hash:E,context:R,forgedBytes:O,opResponse:I}=yield this.signAndInject(S);return new TransferTicketOperation(E,b,p,O,I,R)})}reveal(a){return __awaiter$4(this,void 0,void 0,function*(){const u=yield this.signer.publicKeyHash(),l=yield this.estimator.reveal(a);if(l){const f=yield this.estimate(a,()=>__awaiter$4(this,void 0,void 0,function*(){return l})),c=yield this.prepare.reveal(Object.assign(Object.assign({},a),f)),h=c.opOb.contents.find(E=>E.kind===OpKind.REVEAL),p=yield this.forge(c),{hash:v,context:y,forgedBytes:b,opResponse:S}=yield this.signAndInject(p);return new RevealOperation(v,h,u,b,S,y)}else throw new RevealOperationError(`The publicKeyHash '${u}' has already been revealed.`)})}registerGlobalConstant(a){return __awaiter$4(this,void 0,void 0,function*(){const u=yield this.signer.publicKeyHash(),l=yield this.estimate(a,this.estimator.registerGlobalConstant.bind(this.estimator)),f=yield this.prepare.registerGlobalConstant(Object.assign(Object.assign({},a),l)),c=f.opOb.contents.find(S=>S.kind===OpKind.REGISTER_GLOBAL_CONSTANT),h=yield this.forge(f),{hash:p,context:v,forgedBytes:y,opResponse:b}=yield this.signAndInject(h);return new RegisterGlobalConstantOperation(p,c,u,y,b,v)})}increasePaidStorage(a){return __awaiter$4(this,void 0,void 0,function*(){if(a.amount<0)throw new InvalidAmountError(a.amount.toString());const u=yield this.signer.publicKeyHash(),l=yield this.estimate(a,this.estimator.increasePaidStorage.bind(this.estimator)),f=yield this.prepare.increasePaidStorage(Object.assign(Object.assign({},a),l)),c=f.opOb.contents.find(S=>S.kind===OpKind.INCREASE_PAID_STORAGE),h=yield this.forge(f),{hash:p,context:v,forgedBytes:y,opResponse:b}=yield this.signAndInject(h);return new IncreasePaidStorageOperation(p,c,u,y,b,v)})}drainDelegate(a){return __awaiter$4(this,void 0,void 0,function*(){const u=yield this.prepare.drainDelegate(a),l=u.opOb.contents.find(y=>y.kind===OpKind.DRAIN_DELEGATE),f=yield this.forge(u),{hash:c,context:h,forgedBytes:p,opResponse:v}=yield this.signAndInject(f);return new DrainDelegateOperation(c,l,p,v,h)})}ballot(a){return __awaiter$4(this,void 0,void 0,function*(){var u,l;const f=yield this.signer.publicKeyHash(),c=validateAddress((u=a.source)!==null&&u!==void 0?u:"");if(a.source&&c!==ValidationResult.VALID)throw new InvalidAddressError(a.source,invalidDetail(c));const h=(l=a.source)!==null&&l!==void 0?l:f,p=yield this.prepare.ballot(Object.assign(Object.assign({},a),{source:h})),v=p.opOb.contents.find(O=>O.kind===OpKind.BALLOT),y=yield this.forge(p),{hash:b,context:S,forgedBytes:E,opResponse:R}=yield this.signAndInject(y);return new BallotOperation(b,v,f,E,R,S)})}proposals(a){return __awaiter$4(this,void 0,void 0,function*(){var u,l;const f=yield this.signer.publicKeyHash(),c=validateAddress((u=a.source)!==null&&u!==void 0?u:"");if(a.source&&c!==ValidationResult.VALID)throw new InvalidAddressError(a.source,invalidDetail(c));const h=(l=a.source)!==null&&l!==void 0?l:f,p=yield this.prepare.proposals(Object.assign(Object.assign({},a),{source:h})),v=p.opOb.contents.find(O=>O.kind===OpKind.PROPOSALS),y=yield this.forge(p),{hash:b,context:S,forgedBytes:E,opResponse:R}=yield this.signAndInject(y);return new ProposalsOperation(b,v,f,E,R,S)})}updateConsensusKey(a){return __awaiter$4(this,void 0,void 0,function*(){const u=yield this.signer.publicKeyHash(),l=yield this.estimate(a,this.estimator.updateConsensusKey.bind(this.estimator)),f=yield this.prepare.updateConsensusKey(Object.assign(Object.assign({},a),l)),c=f.opOb.contents.find(S=>S.kind===OpKind.UPDATE_CONSENSUS_KEY),h=yield this.forge(f),{hash:p,context:v,forgedBytes:y,opResponse:b}=yield this.signAndInject(h);return new UpdateConsensusKeyOperation(p,c,u,y,b,v)})}smartRollupAddMessages(a){return __awaiter$4(this,void 0,void 0,function*(){const u=yield this.signer.publicKeyHash(),l=yield this.estimate(a,this.estimator.smartRollupAddMessages.bind(this.estimator)),f=yield this.prepare.smartRollupAddMessages(Object.assign(Object.assign({},a),l)),c=f.opOb.contents.find(S=>S.kind===OpKind.SMART_ROLLUP_ADD_MESSAGES),h=yield this.forge(f),{hash:p,context:v,forgedBytes:y,opResponse:b}=yield this.signAndInject(h);return new SmartRollupAddMessagesOperation(p,c,u,y,b,v)})}smartRollupOriginate(a){return __awaiter$4(this,void 0,void 0,function*(){const u=yield this.signer.publicKeyHash(),l=yield this.estimate(a,this.estimator.smartRollupOriginate.bind(this.estimator)),f=yield this.prepare.smartRollupOriginate(Object.assign(Object.assign({},a),l)),c=f.opOb.contents.find(S=>S.kind===OpKind.SMART_ROLLUP_ORIGINATE),h=yield this.forge(f),{hash:p,context:v,forgedBytes:y,opResponse:b}=yield this.signAndInject(h);return new SmartRollupOriginateOperation(p,c,u,y,b,v)})}smartRollupExecuteOutboxMessage(a){return __awaiter$4(this,void 0,void 0,function*(){const u=yield this.signer.publicKeyHash(),l=yield this.estimate(a,this.estimator.smartRollupExecuteOutboxMessage.bind(this.estimator)),f=yield this.prepare.smartRollupExecuteOutboxMessage(Object.assign(Object.assign({},a),l)),c=f.opOb.contents.find(S=>S.kind===OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE),h=yield this.forge(f),{hash:p,context:v,forgedBytes:y,opResponse:b}=yield this.signAndInject(h);return new SmartRollupExecuteOutboxMessageOperation(p,c,u,y,b,v)})}failingNoop(a){return __awaiter$4(this,void 0,void 0,function*(){const u={kind:OpKind.FAILING_NOOP,arbitrary:a.arbitrary},l=yield this.context.readProvider.getBlockHash(a.basedOnBlock),f=yield this.context.forger.forge({branch:l,contents:[u]}),{prefixSig:c}=yield this.signer.sign(f,new Uint8Array([3]));return{signature:c,bytes:f,signedContent:{branch:l,contents:[{kind:OpKind.FAILING_NOOP,arbitrary:a.arbitrary}]}}})}at(a){return __awaiter$4(this,arguments,void 0,function*(u,l=f=>f){const f=validateContractAddress(u);if(f!==ValidationResult.VALID)throw new InvalidContractAddressError(u,invalidDetail(f));const c=this.context.withExtensions().rpc,h=this.context.withExtensions().readProvider,p=yield h.getScript(u,"head"),v=yield h.getEntrypoints(u),y=new ContractAbstraction(u,p,this,this,v,c,h);return l(y,this.context)})}batch(a){const u=new OperationBatch(this.context,this.estimator);return Array.isArray(a)&&u.with(a),u}}class MichelCodecParser{constructor(a){this.context=a}getNextProto(){return __awaiter$4(this,void 0,void 0,function*(){if(!this.context.proto){const a=yield this.context.readProvider.getNextProtocol("head");this.context.proto=a}return this.context.proto})}parseScript(a){return __awaiter$4(this,void 0,void 0,function*(){return new Parser$1({protocol:yield this.getNextProto()}).parseScript(a)})}parseMichelineExpression(a){return __awaiter$4(this,void 0,void 0,function*(){return new Parser$1({protocol:yield this.getNextProto()}).parseMichelineExpression(a)})}parseJSON(a){return __awaiter$4(this,void 0,void 0,function*(){return new Parser$1({protocol:yield this.getNextProto()}).parseJSON(a)})}prepareCodeOrigination(a){return __awaiter$4(this,void 0,void 0,function*(){const u=a;if(u.code=yield this.formatCodeParam(a.code),a.init)u.init=yield this.formatInitParam(a.init);else if(a.storage){const l=u.code.find(h=>"prim"in h&&h.prim==="storage");if(!(l!=null&&l.args))throw new InvalidCodeParameter("The storage section is missing from the script",a.code);const f=new Schema(l.args[0]),c=yield this.findGlobalConstantsHashAndValue(f);if(Object.keys(c).length!==0){const p=new Parser$1({expandGlobalConstant:c}).parseJSON(l.args[0]),v=new Schema(p);u.init=v.Encode(a.storage)}else u.init=f.Encode(a.storage);delete u.storage}return u})}formatCodeParam(a){return __awaiter$4(this,void 0,void 0,function*(){let u;if(typeof a=="string"){const l=yield this.parseScript(a);if(l===null)throw new InvalidCodeParameter("Unable to parse",a);u=l}else{const l=yield this.parseJSON(a),f=["parameter","storage","code"];u=l.sort((c,h)=>f.indexOf(c.prim)-f.indexOf(h.prim))}return u})}formatInitParam(a){return __awaiter$4(this,void 0,void 0,function*(){let u;if(typeof a=="string"){const l=yield this.parseMichelineExpression(a);if(l===null)throw new InvalidInitParameter("Invalid init parameter",a);u=l}else u=yield this.parseJSON(a);return u})}findGlobalConstantsHashAndValue(a){return __awaiter$4(this,void 0,void 0,function*(){const u=a.findToken("constant"),l={};if(u.length!==0)for(const f of u){const c=f.tokenVal.args;if(c){const h=c[0];if(h.string){const p=h.string,v=yield this.context.globalConstantsProvider.getGlobalConstantByHash(p);Object.assign(l,{[p]:v})}}}return l})}}class RpcPacker{constructor(a){this.context=a}packData(a){return __awaiter$4(this,void 0,void 0,function*(){return this.context.rpc.packData(a)})}}class UnconfiguredGlobalConstantsProviderError extends TezosToolkitConfigError{constructor(){super(),this.name="UnconfiguredGlobalConstantsProviderError",this.message="No global constants provider has been configured. Please configure one by calling setGlobalConstantsProvider({globalConstantsProvider}) on your TezosToolkit instance."}}class NoopGlobalConstantsProvider{getGlobalConstantByHash(a){return __awaiter$4(this,void 0,void 0,function*(){throw new UnconfiguredGlobalConstantsProviderError})}}class RpcReadAdapter{constructor(a){this.rpc=a}getBalance(a,u){return __awaiter$4(this,void 0,void 0,function*(){return this.rpc.getBalance(a,{block:String(u)})})}getSpendable(a,u){return __awaiter$4(this,void 0,void 0,function*(){return this.rpc.getSpendable(a,{block:String(u)})})}getDelegate(a,u){return __awaiter$4(this,void 0,void 0,function*(){return this.rpc.getDelegate(a,{block:String(u)})})}getNextProtocol(a){return __awaiter$4(this,void 0,void 0,function*(){return(yield this.rpc.getProtocols({block:String(a)})).next_protocol})}getProtocolConstants(a){return __awaiter$4(this,void 0,void 0,function*(){const{time_between_blocks:u,minimal_block_delay:l,hard_gas_limit_per_operation:f,hard_gas_limit_per_block:c,hard_storage_limit_per_operation:h,cost_per_byte:p,smart_rollup_origination_size:v}=yield this.rpc.getConstants({block:String(a)});return{time_between_blocks:u,minimal_block_delay:l,hard_gas_limit_per_operation:f,hard_gas_limit_per_block:c,hard_storage_limit_per_operation:h,cost_per_byte:p,smart_rollup_origination_size:v}})}getScript(a,u){return __awaiter$4(this,void 0,void 0,function*(){const{script:l}=yield this.rpc.getContract(a,{block:String(u)});return l})}getStorage(a,u){return __awaiter$4(this,void 0,void 0,function*(){return this.rpc.getStorage(a,{block:String(u)})})}getBlockHash(a){return __awaiter$4(this,void 0,void 0,function*(){const{hash:u}=yield this.rpc.getBlockHeader({block:String(a)});return u})}getBlockLevel(a){return __awaiter$4(this,void 0,void 0,function*(){const{level:u}=yield this.rpc.getBlockHeader({block:String(a)});return u})}getCounter(a,u){return __awaiter$4(this,void 0,void 0,function*(){const{counter:l}=yield this.rpc.getContract(a,{block:String(u)});return l||"0"})}getBlockTimestamp(a){return __awaiter$4(this,void 0,void 0,function*(){const{timestamp:u}=yield this.rpc.getBlockHeader({block:String(a)});return u})}getBigMapValue(a,u){return __awaiter$4(this,void 0,void 0,function*(){return this.rpc.getBigMapExpr(a.id,a.expr,{block:String(u)})})}getSaplingDiffById(a,u){return __awaiter$4(this,void 0,void 0,function*(){return this.rpc.getSaplingDiffById(a.id,{block:String(u)})})}getSaplingDiffByContract(a,u){return __awaiter$4(this,void 0,void 0,function*(){return this.rpc.getSaplingDiffByContract(a,{block:String(u)})})}getEntrypoints(a){return __awaiter$4(this,void 0,void 0,function*(){return this.rpc.getEntrypoints(a)})}getChainId(){return __awaiter$4(this,void 0,void 0,function*(){return this.rpc.getChainId()})}isAccountRevealed(a,u){return __awaiter$4(this,void 0,void 0,function*(){const l=yield this.rpc.getManagerKey(a,{block:String(u)});return l&&typeof l=="object"?!!l.key:!!l})}getBlock(a){return __awaiter$4(this,void 0,void 0,function*(){return this.rpc.getBlock({block:String(a)})})}getLiveBlocks(a){return this.rpc.getLiveBlocks({block:String(a)})}getAdaptiveIssuanceLaunchCycle(a){return this.rpc.getAdaptiveIssuanceLaunchCycle({block:String(a)})}}class UnsupportedEventError extends ParameterValidationError{constructor(a){super(),this.type=a,this.name="UnsupportedEventError",this.message=`Unsupported event type "${a}" expecting one of the "data", "error", or "close".`}}class InvalidFilterExpressionError extends ParameterValidationError{constructor(a){super(),this.invalidExpression=a,this.name="InvalidFilterExpressionError",this.message="Invalid filter expression expecting the object to contain either and/or property"}}const opHashFilter=(s,a)=>s.hash===a.opHash,sourceFilter=(s,a)=>{switch(s.kind){case"attestation":return"metadata"in s&&s.metadata.delegate===a.source;case"activate_account":return"metadata"in s&&s.pkh===a.source;default:return"source"in s&&s.source===a.source}},kindFilter=(s,a)=>"kind"in s&&s.kind===a.kind,destinationFilter=(s,a)=>{switch(s.kind){case"delegation":return s.delegate===a.destination;case"origination":if("metadata"in s&&"operation_result"in s.metadata&&"originated_contracts"in s.metadata.operation_result&&Array.isArray(s.metadata.operation_result.originated_contracts))return s.metadata.operation_result.originated_contracts.some(u=>u===a.destination);break;case"transaction":return s.destination===a.destination;default:return!1}},eventFilter=(s,a,u,l)=>!(s.kind!=="event"||u&&s.tag!==u||a&&s.source!==a||l&&s.result.status!=="applied"),evaluateOpFilter=(s,a)=>"opHash"in a?opHashFilter(s,a):"source"in a?sourceFilter(s,a):"kind"in a?kindFilter(s,a):"destination"in a?destinationFilter(s,a):!1,evaluateExpression=(s,a)=>{if(Array.isArray(a.and))return a.and.every(u=>evaluateFilter(s,u));if(Array.isArray(a.or))return a.or.some(u=>evaluateFilter(s,u));throw new InvalidFilterExpressionError(a)},evaluateFilter=(s,a)=>{const u=[];return Array.isArray(a)?u.push(...a):u.push(a),u.every(l=>"and"in l||"or"in l?evaluateExpression(s,l):evaluateOpFilter(s,l))};class ObservableSubscription{constructor(a,u=!1,l=retry$2()){this.shouldRetry=u,this.operatorFunction=l,this.errorListeners=[],this.messageListeners=[],this.closeListeners=[],this.completed$=new Subject,a.pipe(takeUntil(this.completed$),tap(f=>{this.call(this.messageListeners,f)},f=>{this.call(this.errorListeners,f)},()=>{this.call(this.closeListeners)}),this.shouldRetry?l:tap(),catchError(()=>NEVER$1)).subscribe()}call(a,u){for(const l of a)try{l(u)}catch(f){console.error(f)}}remove(a,u){const l=a.indexOf(u);l!==-1&&a.splice(l,1)}on(a,u){switch(a){case"data":this.messageListeners.push(u);break;case"error":this.errorListeners.push(u);break;case"close":this.closeListeners.push(u);break;default:throw new UnsupportedEventError(a)}}off(a,u){switch(a){case"data":this.remove(this.messageListeners,u);break;case"error":this.remove(this.errorListeners,u);break;case"close":this.remove(this.closeListeners,u);break;default:throw new UnsupportedEventError(a)}}close(){this.completed$.next()}}const defaultConfigStreamer={shouldObservableSubscriptionRetry:!1,observableSubscriptionRetryFunction:retry$2()},getLastBlock=s=>from(s.rpc.getBlock()).pipe(first()),applyFilter=s=>concatMap(a=>new Observable(u=>{for(const l of a.operations)for(const f of l)for(const c of f.contents)evaluateFilter(Object.assign({hash:f.hash},c),s)&&u.next(Object.assign({hash:f.hash},c));u.complete()})),applyEventFilter=s=>concatMap(a=>new Observable(u=>{for(const l of a.operations)for(const f of l)for(const c of f.contents){const p=c.metadata.internal_operation_results;if(p)for(const v of p)eventFilter(v,s==null?void 0:s.address,s==null?void 0:s.tag,s==null?void 0:s.excludeFailedOperations)&&u.next(Object.assign({opHash:f.hash,blockHash:a.hash,level:a.header.level},v))}u.complete()}));class PollingSubscribeProvider{constructor(a,u={}){this.context=a,this._config$=new BehaviorSubject(Object.assign(Object.assign({},defaultConfigStreamer),u)),this.timer$=this._config$.pipe(pluck("pollingIntervalMilliseconds"),switchMap(l=>l?timer(0,l):from(this.getConfirmationPollingInterval()).pipe(switchMap(f=>timer(0,f))))),this.newBlock$=this.timer$.pipe(switchMap(()=>getLastBlock(this.context)),distinctUntilKeyChanged("hash"),publish(),refCount())}get config(){return this._config$.getValue()}getConfirmationPollingInterval(){return __awaiter$4(this,void 0,void 0,function*(){if(!this.config.pollingIntervalMilliseconds)try{const l=yield this.context.readProvider.getProtocolConstants("head"),c=(l.minimal_block_delay?l.minimal_block_delay.multipliedBy(1e3):new BigNumber(5e3)).dividedBy(3);this.config.pollingIntervalMilliseconds=c.toNumber()===0?1e3:c.toNumber()}catch{return 5e3}return this.config.pollingIntervalMilliseconds})}subscribeBlock(a){return new ObservableSubscription(this.newBlock$,this.config.shouldObservableSubscriptionRetry,this.config.observableSubscriptionRetryFunction)}subscribe(a){return new ObservableSubscription(this.newBlock$.pipe(pluck("hash")),this.config.shouldObservableSubscriptionRetry,this.config.observableSubscriptionRetryFunction)}subscribeOperation(a){return new ObservableSubscription(this.newBlock$.pipe(applyFilter(a)),this.config.shouldObservableSubscriptionRetry,this.config.observableSubscriptionRetryFunction)}subscribeEvent(a){return new ObservableSubscription(this.newBlock$.pipe(applyEventFilter(a)),this.config.shouldObservableSubscriptionRetry,this.config.observableSubscriptionRetryFunction)}}class TaquitoLocalForger{constructor(a){this.context=a}getNextProto(){return __awaiter$4(this,void 0,void 0,function*(){if(!this.context.proto){const a=yield this.context.readProvider.getNextProtocol("head");this.context.proto=a}return this.context.proto})}forge(a){return __awaiter$4(this,arguments,void 0,function*({branch:u,contents:l}){return new LocalForger(yield this.getNextProto()).forge({branch:u,contents:l})})}}const defaultConfigConfirmation={defaultConfirmationCount:1,confirmationPollingTimeoutSecond:180};class Context{constructor(a,u=new NoopSigner,l,f=new BehaviorSubject(Object.assign({},defaultConfigConfirmation)),c,h,p,v,y,b,S,E){this._rpc=a,this._signer=u,this._proto=l,this._config=f,this.providerDecorator=[],this.tz=new RpcTzProvider(this),this.estimate=new RPCEstimateProvider(this),this.contract=new RpcContractProvider(this,this.estimate),this.prepare=new PrepareProvider(this),this.batch=new RPCBatchProvider(this,this.estimate),this.wallet=new Wallet(this),this.withExtensions=()=>{let R=this.clone();return this.providerDecorator.forEach(O=>{R=O(R)}),R},typeof this._rpc=="string"?this._rpcClient=new RpcClient(this._rpc):this._rpcClient=this._rpc,this._forger=c||new TaquitoLocalForger(this),this._injector=h||new RpcInjector(this),this.operationFactory=new OperationFactory(this),this._walletProvider=v||new LegacyWalletProvider(this),this._parser=y||new MichelCodecParser(this),this._packer=p||new RpcPacker(this),this._globalConstantsProvider=b||new NoopGlobalConstantsProvider,this._readProvider=S||new RpcReadAdapter(this._rpcClient),this._stream=E||new PollingSubscribeProvider(this)}get config(){return this._config.getValue()}set config(a){this._config.next(Object.assign({},a))}setPartialConfig(a){this._config.next(Object.assign(Object.assign({},this._config.getValue()),a))}get rpc(){return this._rpcClient}set rpc(a){this._rpcClient=a}get injector(){return this._injector}set injector(a){this._injector=a}get forger(){return this._forger}set forger(a){this._forger=a}get signer(){return this._signer}set signer(a){this._signer=a}get walletProvider(){return this._walletProvider}set walletProvider(a){this._walletProvider=a}set proto(a){this._proto=a}get proto(){return this._proto}get parser(){return this._parser}set parser(a){this._parser=a}get packer(){return this._packer}set packer(a){this._packer=a}get globalConstantsProvider(){return this._globalConstantsProvider}set globalConstantsProvider(a){this._globalConstantsProvider=a}get readProvider(){return this._readProvider}set readProvider(a){this._readProvider=a}get stream(){return this._stream}set stream(a){this._stream=a}isAnyProtocolActive(){return __awaiter$4(this,arguments,void 0,function*(a=[]){if(this._proto)return a.includes(this._proto);{const u=yield this.readProvider.getNextProtocol("head");return a.includes(u)}})}isAnySignerConfigured(){return!(this.signer instanceof NoopSigner)}clone(){return new Context(this.rpc,this.signer,this.proto,this._config,this.forger,this._injector,this.packer,this._walletProvider,this._parser,this._globalConstantsProvider,this._readProvider,this._stream)}registerProviderDecorator(a){this.providerDecorator.push(a)}}const VERSION={commitHash:"8f78637e9787ae942916332501f41b35d6b98f2d",version:"21.0.0"};class TezosToolkit{constructor(a){this._rpc=a,this._options={},this.format=format,typeof this._rpc=="string"?this._rpcClient=new RpcClient(this._rpc):this._rpcClient=this._rpc,this._context=new Context(a),this._wallet=new Wallet(this._context),this.setProvider({rpc:this._rpcClient}),this.batch=this._context.batch.batch.bind(this._context.batch)}setProvider({rpc:a,stream:u,signer:l,protocol:f,config:c,forger:h,wallet:p,packer:v,globalConstantsProvider:y,readProvider:b,parserProvider:S,injectorProvider:E}){this.setRpcProvider(a),this.setStreamProvider(u),this.setSignerProvider(l),this.setForgerProvider(h),this.setWalletProvider(p),this.setPackerProvider(v),this.setGlobalConstantsProvider(y),this.setReadProvider(b),this.setParserProvider(S),this.setInjectorProvider(E),this._context.proto=f,c&&this._context.setPartialConfig(c)}setSignerProvider(a){!this._options.signer&&typeof a>"u"?(this._context.signer=new NoopSigner,this._options.signer=a):typeof a<"u"&&(this._context.signer=a,this._options.signer=a)}setRpcProvider(a){typeof a=="string"?this._rpcClient=new RpcClient(a):a===void 0||(this._rpcClient=a),this._options.rpc=this._rpcClient,this._context.rpc=this._rpcClient}setForgerProvider(a){if(typeof a<"u")this._options.forger=a,this._context.forger=a;else if(this._options.forger===void 0){const u=this.getFactory(TaquitoLocalForger)();this._options.forger=u,this._context.forger=u}}setStreamProvider(a){if(typeof a=="string"){const u=new PollingSubscribeProvider(new Context(new RpcClient(a)));this._options.stream=u,this._context.stream=u}else if(typeof a<"u")this._options.stream=a,this._context.stream=a;else if(this._options.stream===void 0){const u=this.getFactory(PollingSubscribeProvider)();this._options.stream=u,this._context.stream=u}}setWalletProvider(a){if(!this._options.wallet&&typeof a>"u"){const u=this.getFactory(LegacyWalletProvider)();this._options.wallet=u,this._context.walletProvider=u}else typeof a<"u"&&(this._options.wallet=a,this._context.walletProvider=a)}setPackerProvider(a){if(!this._options.packer&&typeof a>"u"){const u=this.getFactory(RpcPacker)();this._context.packer=u,this._options.packer=u}else typeof a<"u"&&(this._context.packer=a,this._options.packer=a)}setGlobalConstantsProvider(a){if(!this._options.globalConstantsProvider&&typeof a>"u"){const u=new NoopGlobalConstantsProvider;this._context.globalConstantsProvider=u,this._options.globalConstantsProvider=u}else typeof a<"u"&&(this._context.globalConstantsProvider=a,this._options.globalConstantsProvider=a)}setReadProvider(a){const u=a||new RpcReadAdapter(this._context.rpc);this._options.readProvider=u,this._context.readProvider=u}setParserProvider(a){if(!this._options.parserProvider&&typeof a>"u"){const u=new MichelCodecParser(this._context);this._context.parser=u,this._options.parserProvider=u}else typeof a<"u"&&(this._context.parser=a,this._options.parserProvider=a)}setInjectorProvider(a){if(!this._options.injectorProvider&&typeof a>"u"){const u=new RpcInjector(this._context);this._context.injector=u,this._options.injectorProvider=u}else typeof a<"u"&&(this._context.injector=a,this._options.injectorProvider=a)}setFieldNumberingStrategy(a){Token.fieldNumberingStrategy=a}get tz(){return this._context.tz}get contract(){return this._context.contract}get prepare(){return this._context.prepare}get wallet(){return this._wallet}get operation(){return this._context.operationFactory}get estimate(){return this._context.estimate}get stream(){return this._context.stream}get rpc(){return this._context.rpc}get signer(){return this._context.signer}get globalConstants(){return this._context.globalConstantsProvider}addExtension(a){Array.isArray(a)?a.forEach(u=>u.configureContext(this._context)):a.configureContext(this._context)}getFactory(a){return(...u)=>new a(this._context,...u)}getVersionInfo(){return VERSION}}var lib$5={},Parser={},Tokenizer={},decode={},decodeDataHtml={},hasRequiredDecodeDataHtml;function requireDecodeDataHtml(){return hasRequiredDecodeDataHtml||(hasRequiredDecodeDataHtml=1,Object.defineProperty(decodeDataHtml,"__esModule",{value:!0}),decodeDataHtml.default=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTǇǋǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉ǲኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻ǲᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤĳạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ﬃɩᾹ\0\0᾽g;耀ﬀig;耀ﬄ;쀀𝔣lig;耀ﬁlig;쀀fjƀaltῙ῜ῡt;晭ig;耀ﬂns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒α‚‰‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସǳ⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗǈⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼ǲ㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(function(s){return s.charCodeAt(0)}))),decodeDataHtml}var decodeDataXml={},hasRequiredDecodeDataXml;function requireDecodeDataXml(){return hasRequiredDecodeDataXml||(hasRequiredDecodeDataXml=1,Object.defineProperty(decodeDataXml,"__esModule",{value:!0}),decodeDataXml.default=new Uint16Array("Ȁaglq	\x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(function(s){return s.charCodeAt(0)}))),decodeDataXml}var decode_codepoint={},hasRequiredDecode_codepoint;function requireDecode_codepoint(){return hasRequiredDecode_codepoint||(hasRequiredDecode_codepoint=1,function(s){var a;Object.defineProperty(s,"__esModule",{value:!0}),s.replaceCodePoint=s.fromCodePoint=void 0;var u=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);s.fromCodePoint=(a=String.fromCodePoint)!==null&&a!==void 0?a:function(c){var h="";return c>65535&&(c-=65536,h+=String.fromCharCode(c>>>10&1023|55296),c=56320|c&1023),h+=String.fromCharCode(c),h};function l(c){var h;return c>=55296&&c<=57343||c>1114111?65533:(h=u.get(c))!==null&&h!==void 0?h:c}s.replaceCodePoint=l;function f(c){return(0,s.fromCodePoint)(l(c))}s.default=f}(decode_codepoint)),decode_codepoint}var hasRequiredDecode;function requireDecode(){return hasRequiredDecode||(hasRequiredDecode=1,function(s){var a=decode&&decode.__createBinding||(Object.create?function(k,d,g,_){_===void 0&&(_=g);var w=Object.getOwnPropertyDescriptor(d,g);(!w||("get"in w?!d.__esModule:w.writable||w.configurable))&&(w={enumerable:!0,get:function(){return d[g]}}),Object.defineProperty(k,_,w)}:function(k,d,g,_){_===void 0&&(_=g),k[_]=d[g]}),u=decode&&decode.__setModuleDefault||(Object.create?function(k,d){Object.defineProperty(k,"default",{enumerable:!0,value:d})}:function(k,d){k.default=d}),l=decode&&decode.__importStar||function(k){if(k&&k.__esModule)return k;var d={};if(k!=null)for(var g in k)g!=="default"&&Object.prototype.hasOwnProperty.call(k,g)&&a(d,k,g);return u(d,k),d},f=decode&&decode.__importDefault||function(k){return k&&k.__esModule?k:{default:k}};Object.defineProperty(s,"__esModule",{value:!0}),s.decodeXML=s.decodeHTMLStrict=s.decodeHTMLAttribute=s.decodeHTML=s.determineBranch=s.EntityDecoder=s.DecodingMode=s.BinTrieFlags=s.fromCodePoint=s.replaceCodePoint=s.decodeCodePoint=s.xmlDecodeTree=s.htmlDecodeTree=void 0;var c=f(requireDecodeDataHtml());s.htmlDecodeTree=c.default;var h=f(requireDecodeDataXml());s.xmlDecodeTree=h.default;var p=l(requireDecode_codepoint());s.decodeCodePoint=p.default;var v=requireDecode_codepoint();Object.defineProperty(s,"replaceCodePoint",{enumerable:!0,get:function(){return v.replaceCodePoint}}),Object.defineProperty(s,"fromCodePoint",{enumerable:!0,get:function(){return v.fromCodePoint}});var y;(function(k){k[k.NUM=35]="NUM",k[k.SEMI=59]="SEMI",k[k.EQUALS=61]="EQUALS",k[k.ZERO=48]="ZERO",k[k.NINE=57]="NINE",k[k.LOWER_A=97]="LOWER_A",k[k.LOWER_F=102]="LOWER_F",k[k.LOWER_X=120]="LOWER_X",k[k.LOWER_Z=122]="LOWER_Z",k[k.UPPER_A=65]="UPPER_A",k[k.UPPER_F=70]="UPPER_F",k[k.UPPER_Z=90]="UPPER_Z"})(y||(y={}));var b=32,S;(function(k){k[k.VALUE_LENGTH=49152]="VALUE_LENGTH",k[k.BRANCH_LENGTH=16256]="BRANCH_LENGTH",k[k.JUMP_TABLE=127]="JUMP_TABLE"})(S=s.BinTrieFlags||(s.BinTrieFlags={}));function E(k){return k>=y.ZERO&&k<=y.NINE}function R(k){return k>=y.UPPER_A&&k<=y.UPPER_F||k>=y.LOWER_A&&k<=y.LOWER_F}function O(k){return k>=y.UPPER_A&&k<=y.UPPER_Z||k>=y.LOWER_A&&k<=y.LOWER_Z||E(k)}function I(k){return k===y.EQUALS||O(k)}var B;(function(k){k[k.EntityStart=0]="EntityStart",k[k.NumericStart=1]="NumericStart",k[k.NumericDecimal=2]="NumericDecimal",k[k.NumericHex=3]="NumericHex",k[k.NamedEntity=4]="NamedEntity"})(B||(B={}));var N;(function(k){k[k.Legacy=0]="Legacy",k[k.Strict=1]="Strict",k[k.Attribute=2]="Attribute"})(N=s.DecodingMode||(s.DecodingMode={}));var D=function(){function k(d,g,_){this.decodeTree=d,this.emitCodePoint=g,this.errors=_,this.state=B.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=N.Strict}return k.prototype.startEntity=function(d){this.decodeMode=d,this.state=B.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1},k.prototype.write=function(d,g){switch(this.state){case B.EntityStart:return d.charCodeAt(g)===y.NUM?(this.state=B.NumericStart,this.consumed+=1,this.stateNumericStart(d,g+1)):(this.state=B.NamedEntity,this.stateNamedEntity(d,g));case B.NumericStart:return this.stateNumericStart(d,g);case B.NumericDecimal:return this.stateNumericDecimal(d,g);case B.NumericHex:return this.stateNumericHex(d,g);case B.NamedEntity:return this.stateNamedEntity(d,g)}},k.prototype.stateNumericStart=function(d,g){return g>=d.length?-1:(d.charCodeAt(g)|b)===y.LOWER_X?(this.state=B.NumericHex,this.consumed+=1,this.stateNumericHex(d,g+1)):(this.state=B.NumericDecimal,this.stateNumericDecimal(d,g))},k.prototype.addToNumericResult=function(d,g,_,w){if(g!==_){var x=_-g;this.result=this.result*Math.pow(w,x)+parseInt(d.substr(g,x),w),this.consumed+=x}},k.prototype.stateNumericHex=function(d,g){for(var _=g;g<d.length;){var w=d.charCodeAt(g);if(E(w)||R(w))g+=1;else return this.addToNumericResult(d,_,g,16),this.emitNumericEntity(w,3)}return this.addToNumericResult(d,_,g,16),-1},k.prototype.stateNumericDecimal=function(d,g){for(var _=g;g<d.length;){var w=d.charCodeAt(g);if(E(w))g+=1;else return this.addToNumericResult(d,_,g,10),this.emitNumericEntity(w,2)}return this.addToNumericResult(d,_,g,10),-1},k.prototype.emitNumericEntity=function(d,g){var _;if(this.consumed<=g)return(_=this.errors)===null||_===void 0||_.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(d===y.SEMI)this.consumed+=1;else if(this.decodeMode===N.Strict)return 0;return this.emitCodePoint((0,p.replaceCodePoint)(this.result),this.consumed),this.errors&&(d!==y.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed},k.prototype.stateNamedEntity=function(d,g){for(var _=this.decodeTree,w=_[this.treeIndex],x=(w&S.VALUE_LENGTH)>>14;g<d.length;g++,this.excess++){var P=d.charCodeAt(g);if(this.treeIndex=V(_,w,this.treeIndex+Math.max(1,x),P),this.treeIndex<0)return this.result===0||this.decodeMode===N.Attribute&&(x===0||I(P))?0:this.emitNotTerminatedNamedEntity();if(w=_[this.treeIndex],x=(w&S.VALUE_LENGTH)>>14,x!==0){if(P===y.SEMI)return this.emitNamedEntityData(this.treeIndex,x,this.consumed+this.excess);this.decodeMode!==N.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1},k.prototype.emitNotTerminatedNamedEntity=function(){var d,g=this,_=g.result,w=g.decodeTree,x=(w[_]&S.VALUE_LENGTH)>>14;return this.emitNamedEntityData(_,x,this.consumed),(d=this.errors)===null||d===void 0||d.missingSemicolonAfterCharacterReference(),this.consumed},k.prototype.emitNamedEntityData=function(d,g,_){var w=this.decodeTree;return this.emitCodePoint(g===1?w[d]&~S.VALUE_LENGTH:w[d+1],_),g===3&&this.emitCodePoint(w[d+2],_),_},k.prototype.end=function(){var d;switch(this.state){case B.NamedEntity:return this.result!==0&&(this.decodeMode!==N.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case B.NumericDecimal:return this.emitNumericEntity(0,2);case B.NumericHex:return this.emitNumericEntity(0,3);case B.NumericStart:return(d=this.errors)===null||d===void 0||d.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case B.EntityStart:return 0}},k}();s.EntityDecoder=D;function G(k){var d="",g=new D(k,function(_){return d+=(0,p.fromCodePoint)(_)});return function(w,x){for(var P=0,$=0;($=w.indexOf("&",$))>=0;){d+=w.slice(P,$),g.startEntity(x);var T=g.write(w,$+1);if(T<0){P=$+g.end();break}P=$+T,$=T===0?P+1:P}var m=d+w.slice(P);return d="",m}}function V(k,d,g,_){var w=(d&S.BRANCH_LENGTH)>>7,x=d&S.JUMP_TABLE;if(w===0)return x!==0&&_===x?g:-1;if(x){var P=_-x;return P<0||P>=w?-1:k[g+P]-1}for(var $=g,T=$+w-1;$<=T;){var m=$+T>>>1,M=k[m];if(M<_)$=m+1;else if(M>_)T=m-1;else return k[m+w]}return-1}s.determineBranch=V;var U=G(c.default),te=G(h.default);function Z(k,d){return d===void 0&&(d=N.Legacy),U(k,d)}s.decodeHTML=Z;function J(k){return U(k,N.Attribute)}s.decodeHTMLAttribute=J;function Q(k){return U(k,N.Strict)}s.decodeHTMLStrict=Q;function ee(k){return te(k,N.Strict)}s.decodeXML=ee}(decode)),decode}var hasRequiredTokenizer;function requireTokenizer(){return hasRequiredTokenizer||(hasRequiredTokenizer=1,function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.QuoteType=void 0;var a=requireDecode(),u;(function(E){E[E.Tab=9]="Tab",E[E.NewLine=10]="NewLine",E[E.FormFeed=12]="FormFeed",E[E.CarriageReturn=13]="CarriageReturn",E[E.Space=32]="Space",E[E.ExclamationMark=33]="ExclamationMark",E[E.Number=35]="Number",E[E.Amp=38]="Amp",E[E.SingleQuote=39]="SingleQuote",E[E.DoubleQuote=34]="DoubleQuote",E[E.Dash=45]="Dash",E[E.Slash=47]="Slash",E[E.Zero=48]="Zero",E[E.Nine=57]="Nine",E[E.Semi=59]="Semi",E[E.Lt=60]="Lt",E[E.Eq=61]="Eq",E[E.Gt=62]="Gt",E[E.Questionmark=63]="Questionmark",E[E.UpperA=65]="UpperA",E[E.LowerA=97]="LowerA",E[E.UpperF=70]="UpperF",E[E.LowerF=102]="LowerF",E[E.UpperZ=90]="UpperZ",E[E.LowerZ=122]="LowerZ",E[E.LowerX=120]="LowerX",E[E.OpeningSquareBracket=91]="OpeningSquareBracket"})(u||(u={}));var l;(function(E){E[E.Text=1]="Text",E[E.BeforeTagName=2]="BeforeTagName",E[E.InTagName=3]="InTagName",E[E.InSelfClosingTag=4]="InSelfClosingTag",E[E.BeforeClosingTagName=5]="BeforeClosingTagName",E[E.InClosingTagName=6]="InClosingTagName",E[E.AfterClosingTagName=7]="AfterClosingTagName",E[E.BeforeAttributeName=8]="BeforeAttributeName",E[E.InAttributeName=9]="InAttributeName",E[E.AfterAttributeName=10]="AfterAttributeName",E[E.BeforeAttributeValue=11]="BeforeAttributeValue",E[E.InAttributeValueDq=12]="InAttributeValueDq",E[E.InAttributeValueSq=13]="InAttributeValueSq",E[E.InAttributeValueNq=14]="InAttributeValueNq",E[E.BeforeDeclaration=15]="BeforeDeclaration",E[E.InDeclaration=16]="InDeclaration",E[E.InProcessingInstruction=17]="InProcessingInstruction",E[E.BeforeComment=18]="BeforeComment",E[E.CDATASequence=19]="CDATASequence",E[E.InSpecialComment=20]="InSpecialComment",E[E.InCommentLike=21]="InCommentLike",E[E.BeforeSpecialS=22]="BeforeSpecialS",E[E.SpecialStartSequence=23]="SpecialStartSequence",E[E.InSpecialTag=24]="InSpecialTag",E[E.BeforeEntity=25]="BeforeEntity",E[E.BeforeNumericEntity=26]="BeforeNumericEntity",E[E.InNamedEntity=27]="InNamedEntity",E[E.InNumericEntity=28]="InNumericEntity",E[E.InHexEntity=29]="InHexEntity"})(l||(l={}));function f(E){return E===u.Space||E===u.NewLine||E===u.Tab||E===u.FormFeed||E===u.CarriageReturn}function c(E){return E===u.Slash||E===u.Gt||f(E)}function h(E){return E>=u.Zero&&E<=u.Nine}function p(E){return E>=u.LowerA&&E<=u.LowerZ||E>=u.UpperA&&E<=u.UpperZ}function v(E){return E>=u.UpperA&&E<=u.UpperF||E>=u.LowerA&&E<=u.LowerF}var y;(function(E){E[E.NoValue=0]="NoValue",E[E.Unquoted=1]="Unquoted",E[E.Single=2]="Single",E[E.Double=3]="Double"})(y=s.QuoteType||(s.QuoteType={}));var b={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101])},S=function(){function E(R,O){var I=R.xmlMode,B=I===void 0?!1:I,N=R.decodeEntities,D=N===void 0?!0:N;this.cbs=O,this.state=l.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=l.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.currentSequence=void 0,this.sequenceIndex=0,this.trieIndex=0,this.trieCurrent=0,this.entityResult=0,this.entityExcess=0,this.xmlMode=B,this.decodeEntities=D,this.entityTrie=B?a.xmlDecodeTree:a.htmlDecodeTree}return E.prototype.reset=function(){this.state=l.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=l.Text,this.currentSequence=void 0,this.running=!0,this.offset=0},E.prototype.write=function(R){this.offset+=this.buffer.length,this.buffer=R,this.parse()},E.prototype.end=function(){this.running&&this.finish()},E.prototype.pause=function(){this.running=!1},E.prototype.resume=function(){this.running=!0,this.index<this.buffer.length+this.offset&&this.parse()},E.prototype.getIndex=function(){return this.index},E.prototype.getSectionStart=function(){return this.sectionStart},E.prototype.stateText=function(R){R===u.Lt||!this.decodeEntities&&this.fastForwardTo(u.Lt)?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=l.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&R===u.Amp&&(this.state=l.BeforeEntity)},E.prototype.stateSpecialStartSequence=function(R){var O=this.sequenceIndex===this.currentSequence.length,I=O?c(R):(R|32)===this.currentSequence[this.sequenceIndex];if(!I)this.isSpecial=!1;else if(!O){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=l.InTagName,this.stateInTagName(R)},E.prototype.stateInSpecialTag=function(R){if(this.sequenceIndex===this.currentSequence.length){if(R===u.Gt||f(R)){var O=this.index-this.currentSequence.length;if(this.sectionStart<O){var I=this.index;this.index=O,this.cbs.ontext(this.sectionStart,O),this.index=I}this.isSpecial=!1,this.sectionStart=O+2,this.stateInClosingTagName(R);return}this.sequenceIndex=0}(R|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:this.sequenceIndex===0?this.currentSequence===b.TitleEnd?this.decodeEntities&&R===u.Amp&&(this.state=l.BeforeEntity):this.fastForwardTo(u.Lt)&&(this.sequenceIndex=1):this.sequenceIndex=+(R===u.Lt)},E.prototype.stateCDATASequence=function(R){R===b.Cdata[this.sequenceIndex]?++this.sequenceIndex===b.Cdata.length&&(this.state=l.InCommentLike,this.currentSequence=b.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=l.InDeclaration,this.stateInDeclaration(R))},E.prototype.fastForwardTo=function(R){for(;++this.index<this.buffer.length+this.offset;)if(this.buffer.charCodeAt(this.index-this.offset)===R)return!0;return this.index=this.buffer.length+this.offset-1,!1},E.prototype.stateInCommentLike=function(R){R===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===b.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index,2):this.cbs.oncomment(this.sectionStart,this.index,2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=l.Text):this.sequenceIndex===0?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):R!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)},E.prototype.isTagStartChar=function(R){return this.xmlMode?!c(R):p(R)},E.prototype.startSpecial=function(R,O){this.isSpecial=!0,this.currentSequence=R,this.sequenceIndex=O,this.state=l.SpecialStartSequence},E.prototype.stateBeforeTagName=function(R){if(R===u.ExclamationMark)this.state=l.BeforeDeclaration,this.sectionStart=this.index+1;else if(R===u.Questionmark)this.state=l.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(R)){var O=R|32;this.sectionStart=this.index,!this.xmlMode&&O===b.TitleEnd[2]?this.startSpecial(b.TitleEnd,3):this.state=!this.xmlMode&&O===b.ScriptEnd[2]?l.BeforeSpecialS:l.InTagName}else R===u.Slash?this.state=l.BeforeClosingTagName:(this.state=l.Text,this.stateText(R))},E.prototype.stateInTagName=function(R){c(R)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=l.BeforeAttributeName,this.stateBeforeAttributeName(R))},E.prototype.stateBeforeClosingTagName=function(R){f(R)||(R===u.Gt?this.state=l.Text:(this.state=this.isTagStartChar(R)?l.InClosingTagName:l.InSpecialComment,this.sectionStart=this.index))},E.prototype.stateInClosingTagName=function(R){(R===u.Gt||f(R))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=l.AfterClosingTagName,this.stateAfterClosingTagName(R))},E.prototype.stateAfterClosingTagName=function(R){(R===u.Gt||this.fastForwardTo(u.Gt))&&(this.state=l.Text,this.baseState=l.Text,this.sectionStart=this.index+1)},E.prototype.stateBeforeAttributeName=function(R){R===u.Gt?(this.cbs.onopentagend(this.index),this.isSpecial?(this.state=l.InSpecialTag,this.sequenceIndex=0):this.state=l.Text,this.baseState=this.state,this.sectionStart=this.index+1):R===u.Slash?this.state=l.InSelfClosingTag:f(R)||(this.state=l.InAttributeName,this.sectionStart=this.index)},E.prototype.stateInSelfClosingTag=function(R){R===u.Gt?(this.cbs.onselfclosingtag(this.index),this.state=l.Text,this.baseState=l.Text,this.sectionStart=this.index+1,this.isSpecial=!1):f(R)||(this.state=l.BeforeAttributeName,this.stateBeforeAttributeName(R))},E.prototype.stateInAttributeName=function(R){(R===u.Eq||c(R))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=-1,this.state=l.AfterAttributeName,this.stateAfterAttributeName(R))},E.prototype.stateAfterAttributeName=function(R){R===u.Eq?this.state=l.BeforeAttributeValue:R===u.Slash||R===u.Gt?(this.cbs.onattribend(y.NoValue,this.index),this.state=l.BeforeAttributeName,this.stateBeforeAttributeName(R)):f(R)||(this.cbs.onattribend(y.NoValue,this.index),this.state=l.InAttributeName,this.sectionStart=this.index)},E.prototype.stateBeforeAttributeValue=function(R){R===u.DoubleQuote?(this.state=l.InAttributeValueDq,this.sectionStart=this.index+1):R===u.SingleQuote?(this.state=l.InAttributeValueSq,this.sectionStart=this.index+1):f(R)||(this.sectionStart=this.index,this.state=l.InAttributeValueNq,this.stateInAttributeValueNoQuotes(R))},E.prototype.handleInAttributeValue=function(R,O){R===O||!this.decodeEntities&&this.fastForwardTo(O)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(O===u.DoubleQuote?y.Double:y.Single,this.index),this.state=l.BeforeAttributeName):this.decodeEntities&&R===u.Amp&&(this.baseState=this.state,this.state=l.BeforeEntity)},E.prototype.stateInAttributeValueDoubleQuotes=function(R){this.handleInAttributeValue(R,u.DoubleQuote)},E.prototype.stateInAttributeValueSingleQuotes=function(R){this.handleInAttributeValue(R,u.SingleQuote)},E.prototype.stateInAttributeValueNoQuotes=function(R){f(R)||R===u.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(y.Unquoted,this.index),this.state=l.BeforeAttributeName,this.stateBeforeAttributeName(R)):this.decodeEntities&&R===u.Amp&&(this.baseState=this.state,this.state=l.BeforeEntity)},E.prototype.stateBeforeDeclaration=function(R){R===u.OpeningSquareBracket?(this.state=l.CDATASequence,this.sequenceIndex=0):this.state=R===u.Dash?l.BeforeComment:l.InDeclaration},E.prototype.stateInDeclaration=function(R){(R===u.Gt||this.fastForwardTo(u.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=l.Text,this.sectionStart=this.index+1)},E.prototype.stateInProcessingInstruction=function(R){(R===u.Gt||this.fastForwardTo(u.Gt))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=l.Text,this.sectionStart=this.index+1)},E.prototype.stateBeforeComment=function(R){R===u.Dash?(this.state=l.InCommentLike,this.currentSequence=b.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=l.InDeclaration},E.prototype.stateInSpecialComment=function(R){(R===u.Gt||this.fastForwardTo(u.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=l.Text,this.sectionStart=this.index+1)},E.prototype.stateBeforeSpecialS=function(R){var O=R|32;O===b.ScriptEnd[3]?this.startSpecial(b.ScriptEnd,4):O===b.StyleEnd[3]?this.startSpecial(b.StyleEnd,4):(this.state=l.InTagName,this.stateInTagName(R))},E.prototype.stateBeforeEntity=function(R){this.entityExcess=1,this.entityResult=0,R===u.Number?this.state=l.BeforeNumericEntity:R===u.Amp||(this.trieIndex=0,this.trieCurrent=this.entityTrie[0],this.state=l.InNamedEntity,this.stateInNamedEntity(R))},E.prototype.stateInNamedEntity=function(R){if(this.entityExcess+=1,this.trieIndex=(0,a.determineBranch)(this.entityTrie,this.trieCurrent,this.trieIndex+1,R),this.trieIndex<0){this.emitNamedEntity(),this.index--;return}this.trieCurrent=this.entityTrie[this.trieIndex];var O=this.trieCurrent&a.BinTrieFlags.VALUE_LENGTH;if(O){var I=(O>>14)-1;if(!this.allowLegacyEntity()&&R!==u.Semi)this.trieIndex+=I;else{var B=this.index-this.entityExcess+1;B>this.sectionStart&&this.emitPartial(this.sectionStart,B),this.entityResult=this.trieIndex,this.trieIndex+=I,this.entityExcess=0,this.sectionStart=this.index+1,I===0&&this.emitNamedEntity()}}},E.prototype.emitNamedEntity=function(){if(this.state=this.baseState,this.entityResult!==0){var R=(this.entityTrie[this.entityResult]&a.BinTrieFlags.VALUE_LENGTH)>>14;switch(R){case 1:{this.emitCodePoint(this.entityTrie[this.entityResult]&~a.BinTrieFlags.VALUE_LENGTH);break}case 2:{this.emitCodePoint(this.entityTrie[this.entityResult+1]);break}case 3:this.emitCodePoint(this.entityTrie[this.entityResult+1]),this.emitCodePoint(this.entityTrie[this.entityResult+2])}}},E.prototype.stateBeforeNumericEntity=function(R){(R|32)===u.LowerX?(this.entityExcess++,this.state=l.InHexEntity):(this.state=l.InNumericEntity,this.stateInNumericEntity(R))},E.prototype.emitNumericEntity=function(R){var O=this.index-this.entityExcess-1,I=O+2+ +(this.state===l.InHexEntity);I!==this.index&&(O>this.sectionStart&&this.emitPartial(this.sectionStart,O),this.sectionStart=this.index+Number(R),this.emitCodePoint((0,a.replaceCodePoint)(this.entityResult))),this.state=this.baseState},E.prototype.stateInNumericEntity=function(R){R===u.Semi?this.emitNumericEntity(!0):h(R)?(this.entityResult=this.entityResult*10+(R-u.Zero),this.entityExcess++):(this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state=this.baseState,this.index--)},E.prototype.stateInHexEntity=function(R){R===u.Semi?this.emitNumericEntity(!0):h(R)?(this.entityResult=this.entityResult*16+(R-u.Zero),this.entityExcess++):v(R)?(this.entityResult=this.entityResult*16+((R|32)-u.LowerA+10),this.entityExcess++):(this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state=this.baseState,this.index--)},E.prototype.allowLegacyEntity=function(){return!this.xmlMode&&(this.baseState===l.Text||this.baseState===l.InSpecialTag)},E.prototype.cleanup=function(){this.running&&this.sectionStart!==this.index&&(this.state===l.Text||this.state===l.InSpecialTag&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===l.InAttributeValueDq||this.state===l.InAttributeValueSq||this.state===l.InAttributeValueNq)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))},E.prototype.shouldContinue=function(){return this.index<this.buffer.length+this.offset&&this.running},E.prototype.parse=function(){for(;this.shouldContinue();){var R=this.buffer.charCodeAt(this.index-this.offset);switch(this.state){case l.Text:{this.stateText(R);break}case l.SpecialStartSequence:{this.stateSpecialStartSequence(R);break}case l.InSpecialTag:{this.stateInSpecialTag(R);break}case l.CDATASequence:{this.stateCDATASequence(R);break}case l.InAttributeValueDq:{this.stateInAttributeValueDoubleQuotes(R);break}case l.InAttributeName:{this.stateInAttributeName(R);break}case l.InCommentLike:{this.stateInCommentLike(R);break}case l.InSpecialComment:{this.stateInSpecialComment(R);break}case l.BeforeAttributeName:{this.stateBeforeAttributeName(R);break}case l.InTagName:{this.stateInTagName(R);break}case l.InClosingTagName:{this.stateInClosingTagName(R);break}case l.BeforeTagName:{this.stateBeforeTagName(R);break}case l.AfterAttributeName:{this.stateAfterAttributeName(R);break}case l.InAttributeValueSq:{this.stateInAttributeValueSingleQuotes(R);break}case l.BeforeAttributeValue:{this.stateBeforeAttributeValue(R);break}case l.BeforeClosingTagName:{this.stateBeforeClosingTagName(R);break}case l.AfterClosingTagName:{this.stateAfterClosingTagName(R);break}case l.BeforeSpecialS:{this.stateBeforeSpecialS(R);break}case l.InAttributeValueNq:{this.stateInAttributeValueNoQuotes(R);break}case l.InSelfClosingTag:{this.stateInSelfClosingTag(R);break}case l.InDeclaration:{this.stateInDeclaration(R);break}case l.BeforeDeclaration:{this.stateBeforeDeclaration(R);break}case l.BeforeComment:{this.stateBeforeComment(R);break}case l.InProcessingInstruction:{this.stateInProcessingInstruction(R);break}case l.InNamedEntity:{this.stateInNamedEntity(R);break}case l.BeforeEntity:{this.stateBeforeEntity(R);break}case l.InHexEntity:{this.stateInHexEntity(R);break}case l.InNumericEntity:{this.stateInNumericEntity(R);break}default:this.stateBeforeNumericEntity(R)}this.index++}this.cleanup()},E.prototype.finish=function(){this.state===l.InNamedEntity&&this.emitNamedEntity(),this.sectionStart<this.index&&this.handleTrailingData(),this.cbs.onend()},E.prototype.handleTrailingData=function(){var R=this.buffer.length+this.offset;this.state===l.InCommentLike?this.currentSequence===b.CdataEnd?this.cbs.oncdata(this.sectionStart,R,0):this.cbs.oncomment(this.sectionStart,R,0):this.state===l.InNumericEntity&&this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state===l.InHexEntity&&this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state===l.InTagName||this.state===l.BeforeAttributeName||this.state===l.BeforeAttributeValue||this.state===l.AfterAttributeName||this.state===l.InAttributeName||this.state===l.InAttributeValueSq||this.state===l.InAttributeValueDq||this.state===l.InAttributeValueNq||this.state===l.InClosingTagName||this.cbs.ontext(this.sectionStart,R)},E.prototype.emitPartial=function(R,O){this.baseState!==l.Text&&this.baseState!==l.InSpecialTag?this.cbs.onattribdata(R,O):this.cbs.ontext(R,O)},E.prototype.emitCodePoint=function(R){this.baseState!==l.Text&&this.baseState!==l.InSpecialTag?this.cbs.onattribentity(R):this.cbs.ontextentity(R)},E}();s.default=S}(Tokenizer)),Tokenizer}var hasRequiredParser$1;function requireParser$1(){if(hasRequiredParser$1)return Parser;hasRequiredParser$1=1;var s=Parser&&Parser.__createBinding||(Object.create?function(B,N,D,G){G===void 0&&(G=D);var V=Object.getOwnPropertyDescriptor(N,D);(!V||("get"in V?!N.__esModule:V.writable||V.configurable))&&(V={enumerable:!0,get:function(){return N[D]}}),Object.defineProperty(B,G,V)}:function(B,N,D,G){G===void 0&&(G=D),B[G]=N[D]}),a=Parser&&Parser.__setModuleDefault||(Object.create?function(B,N){Object.defineProperty(B,"default",{enumerable:!0,value:N})}:function(B,N){B.default=N}),u=Parser&&Parser.__importStar||function(B){if(B&&B.__esModule)return B;var N={};if(B!=null)for(var D in B)D!=="default"&&Object.prototype.hasOwnProperty.call(B,D)&&s(N,B,D);return a(N,B),N};Object.defineProperty(Parser,"__esModule",{value:!0}),Parser.Parser=void 0;var l=u(requireTokenizer()),f=requireDecode(),c=new Set(["input","option","optgroup","select","button","datalist","textarea"]),h=new Set(["p"]),p=new Set(["thead","tbody"]),v=new Set(["dd","dt"]),y=new Set(["rt","rp"]),b=new Map([["tr",new Set(["tr","th","td"])],["th",new Set(["th"])],["td",new Set(["thead","th","td"])],["body",new Set(["head","link","script"])],["li",new Set(["li"])],["p",h],["h1",h],["h2",h],["h3",h],["h4",h],["h5",h],["h6",h],["select",c],["input",c],["output",c],["button",c],["datalist",c],["textarea",c],["option",new Set(["option"])],["optgroup",new Set(["optgroup","option"])],["dd",v],["dt",v],["address",h],["article",h],["aside",h],["blockquote",h],["details",h],["div",h],["dl",h],["fieldset",h],["figcaption",h],["figure",h],["footer",h],["form",h],["header",h],["hr",h],["main",h],["nav",h],["ol",h],["pre",h],["section",h],["table",h],["ul",h],["rt",y],["rp",y],["tbody",p],["tfoot",p]]),S=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),E=new Set(["math","svg"]),R=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignobject","desc","title"]),O=/\s|\//,I=function(){function B(N,D){D===void 0&&(D={});var G,V,U,te,Z;this.options=D,this.startIndex=0,this.endIndex=0,this.openTagStart=0,this.tagname="",this.attribname="",this.attribvalue="",this.attribs=null,this.stack=[],this.foreignContext=[],this.buffers=[],this.bufferOffset=0,this.writeIndex=0,this.ended=!1,this.cbs=N??{},this.lowerCaseTagNames=(G=D.lowerCaseTags)!==null&&G!==void 0?G:!D.xmlMode,this.lowerCaseAttributeNames=(V=D.lowerCaseAttributeNames)!==null&&V!==void 0?V:!D.xmlMode,this.tokenizer=new((U=D.Tokenizer)!==null&&U!==void 0?U:l.default)(this.options,this),(Z=(te=this.cbs).onparserinit)===null||Z===void 0||Z.call(te,this)}return B.prototype.ontext=function(N,D){var G,V,U=this.getSlice(N,D);this.endIndex=D-1,(V=(G=this.cbs).ontext)===null||V===void 0||V.call(G,U),this.startIndex=D},B.prototype.ontextentity=function(N){var D,G,V=this.tokenizer.getSectionStart();this.endIndex=V-1,(G=(D=this.cbs).ontext)===null||G===void 0||G.call(D,(0,f.fromCodePoint)(N)),this.startIndex=V},B.prototype.isVoidElement=function(N){return!this.options.xmlMode&&S.has(N)},B.prototype.onopentagname=function(N,D){this.endIndex=D;var G=this.getSlice(N,D);this.lowerCaseTagNames&&(G=G.toLowerCase()),this.emitOpenTag(G)},B.prototype.emitOpenTag=function(N){var D,G,V,U;this.openTagStart=this.startIndex,this.tagname=N;var te=!this.options.xmlMode&&b.get(N);if(te)for(;this.stack.length>0&&te.has(this.stack[this.stack.length-1]);){var Z=this.stack.pop();(G=(D=this.cbs).onclosetag)===null||G===void 0||G.call(D,Z,!0)}this.isVoidElement(N)||(this.stack.push(N),E.has(N)?this.foreignContext.push(!0):R.has(N)&&this.foreignContext.push(!1)),(U=(V=this.cbs).onopentagname)===null||U===void 0||U.call(V,N),this.cbs.onopentag&&(this.attribs={})},B.prototype.endOpenTag=function(N){var D,G;this.startIndex=this.openTagStart,this.attribs&&((G=(D=this.cbs).onopentag)===null||G===void 0||G.call(D,this.tagname,this.attribs,N),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""},B.prototype.onopentagend=function(N){this.endIndex=N,this.endOpenTag(!1),this.startIndex=N+1},B.prototype.onclosetag=function(N,D){var G,V,U,te,Z,J;this.endIndex=D;var Q=this.getSlice(N,D);if(this.lowerCaseTagNames&&(Q=Q.toLowerCase()),(E.has(Q)||R.has(Q))&&this.foreignContext.pop(),this.isVoidElement(Q))!this.options.xmlMode&&Q==="br"&&((V=(G=this.cbs).onopentagname)===null||V===void 0||V.call(G,"br"),(te=(U=this.cbs).onopentag)===null||te===void 0||te.call(U,"br",{},!0),(J=(Z=this.cbs).onclosetag)===null||J===void 0||J.call(Z,"br",!1));else{var ee=this.stack.lastIndexOf(Q);if(ee!==-1)if(this.cbs.onclosetag)for(var k=this.stack.length-ee;k--;)this.cbs.onclosetag(this.stack.pop(),k!==0);else this.stack.length=ee;else!this.options.xmlMode&&Q==="p"&&(this.emitOpenTag("p"),this.closeCurrentTag(!0))}this.startIndex=D+1},B.prototype.onselfclosingtag=function(N){this.endIndex=N,this.options.xmlMode||this.options.recognizeSelfClosing||this.foreignContext[this.foreignContext.length-1]?(this.closeCurrentTag(!1),this.startIndex=N+1):this.onopentagend(N)},B.prototype.closeCurrentTag=function(N){var D,G,V=this.tagname;this.endOpenTag(N),this.stack[this.stack.length-1]===V&&((G=(D=this.cbs).onclosetag)===null||G===void 0||G.call(D,V,!N),this.stack.pop())},B.prototype.onattribname=function(N,D){this.startIndex=N;var G=this.getSlice(N,D);this.attribname=this.lowerCaseAttributeNames?G.toLowerCase():G},B.prototype.onattribdata=function(N,D){this.attribvalue+=this.getSlice(N,D)},B.prototype.onattribentity=function(N){this.attribvalue+=(0,f.fromCodePoint)(N)},B.prototype.onattribend=function(N,D){var G,V;this.endIndex=D,(V=(G=this.cbs).onattribute)===null||V===void 0||V.call(G,this.attribname,this.attribvalue,N===l.QuoteType.Double?'"':N===l.QuoteType.Single?"'":N===l.QuoteType.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=""},B.prototype.getInstructionName=function(N){var D=N.search(O),G=D<0?N:N.substr(0,D);return this.lowerCaseTagNames&&(G=G.toLowerCase()),G},B.prototype.ondeclaration=function(N,D){this.endIndex=D;var G=this.getSlice(N,D);if(this.cbs.onprocessinginstruction){var V=this.getInstructionName(G);this.cbs.onprocessinginstruction("!".concat(V),"!".concat(G))}this.startIndex=D+1},B.prototype.onprocessinginstruction=function(N,D){this.endIndex=D;var G=this.getSlice(N,D);if(this.cbs.onprocessinginstruction){var V=this.getInstructionName(G);this.cbs.onprocessinginstruction("?".concat(V),"?".concat(G))}this.startIndex=D+1},B.prototype.oncomment=function(N,D,G){var V,U,te,Z;this.endIndex=D,(U=(V=this.cbs).oncomment)===null||U===void 0||U.call(V,this.getSlice(N,D-G)),(Z=(te=this.cbs).oncommentend)===null||Z===void 0||Z.call(te),this.startIndex=D+1},B.prototype.oncdata=function(N,D,G){var V,U,te,Z,J,Q,ee,k,d,g;this.endIndex=D;var _=this.getSlice(N,D-G);this.options.xmlMode||this.options.recognizeCDATA?((U=(V=this.cbs).oncdatastart)===null||U===void 0||U.call(V),(Z=(te=this.cbs).ontext)===null||Z===void 0||Z.call(te,_),(Q=(J=this.cbs).oncdataend)===null||Q===void 0||Q.call(J)):((k=(ee=this.cbs).oncomment)===null||k===void 0||k.call(ee,"[CDATA[".concat(_,"]]")),(g=(d=this.cbs).oncommentend)===null||g===void 0||g.call(d)),this.startIndex=D+1},B.prototype.onend=function(){var N,D;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(var G=this.stack.length;G>0;this.cbs.onclosetag(this.stack[--G],!0));}(D=(N=this.cbs).onend)===null||D===void 0||D.call(N)},B.prototype.reset=function(){var N,D,G,V;(D=(N=this.cbs).onreset)===null||D===void 0||D.call(N),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,(V=(G=this.cbs).onparserinit)===null||V===void 0||V.call(G,this),this.buffers.length=0,this.bufferOffset=0,this.writeIndex=0,this.ended=!1},B.prototype.parseComplete=function(N){this.reset(),this.end(N)},B.prototype.getSlice=function(N,D){for(;N-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();for(var G=this.buffers[0].slice(N-this.bufferOffset,D-this.bufferOffset);D-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),G+=this.buffers[0].slice(0,D-this.bufferOffset);return G},B.prototype.shiftBuffer=function(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()},B.prototype.write=function(N){var D,G;if(this.ended){(G=(D=this.cbs).onerror)===null||G===void 0||G.call(D,new Error(".write() after done!"));return}this.buffers.push(N),this.tokenizer.running&&(this.tokenizer.write(N),this.writeIndex++)},B.prototype.end=function(N){var D,G;if(this.ended){(G=(D=this.cbs).onerror)===null||G===void 0||G.call(D,new Error(".end() after done!"));return}N&&this.write(N),this.ended=!0,this.tokenizer.end()},B.prototype.pause=function(){this.tokenizer.pause()},B.prototype.resume=function(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex<this.buffers.length;)this.tokenizer.write(this.buffers[this.writeIndex++]);this.ended&&this.tokenizer.end()},B.prototype.parseChunk=function(N){this.write(N)},B.prototype.done=function(N){this.end(N)},B}();return Parser.Parser=I,Parser}var lib$4={},lib$3={},hasRequiredLib$5;function requireLib$5(){return hasRequiredLib$5||(hasRequiredLib$5=1,function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.Doctype=s.CDATA=s.Tag=s.Style=s.Script=s.Comment=s.Directive=s.Text=s.Root=s.isTag=s.ElementType=void 0;var a;(function(l){l.Root="root",l.Text="text",l.Directive="directive",l.Comment="comment",l.Script="script",l.Style="style",l.Tag="tag",l.CDATA="cdata",l.Doctype="doctype"})(a=s.ElementType||(s.ElementType={}));function u(l){return l.type===a.Tag||l.type===a.Script||l.type===a.Style}s.isTag=u,s.Root=a.Root,s.Text=a.Text,s.Directive=a.Directive,s.Comment=a.Comment,s.Script=a.Script,s.Style=a.Style,s.Tag=a.Tag,s.CDATA=a.CDATA,s.Doctype=a.Doctype}(lib$3)),lib$3}var node$1={},hasRequiredNode$1;function requireNode$1(){if(hasRequiredNode$1)return node$1;hasRequiredNode$1=1;var s=node$1&&node$1.__extends||function(){var U=function(te,Z){return U=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var ee in Q)Object.prototype.hasOwnProperty.call(Q,ee)&&(J[ee]=Q[ee])},U(te,Z)};return function(te,Z){if(typeof Z!="function"&&Z!==null)throw new TypeError("Class extends value "+String(Z)+" is not a constructor or null");U(te,Z);function J(){this.constructor=te}te.prototype=Z===null?Object.create(Z):(J.prototype=Z.prototype,new J)}}(),a=node$1&&node$1.__assign||function(){return a=Object.assign||function(U){for(var te,Z=1,J=arguments.length;Z<J;Z++){te=arguments[Z];for(var Q in te)Object.prototype.hasOwnProperty.call(te,Q)&&(U[Q]=te[Q])}return U},a.apply(this,arguments)};Object.defineProperty(node$1,"__esModule",{value:!0}),node$1.cloneNode=node$1.hasChildren=node$1.isDocument=node$1.isDirective=node$1.isComment=node$1.isText=node$1.isCDATA=node$1.isTag=node$1.Element=node$1.Document=node$1.CDATA=node$1.NodeWithChildren=node$1.ProcessingInstruction=node$1.Comment=node$1.Text=node$1.DataNode=node$1.Node=void 0;var u=requireLib$5(),l=function(){function U(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(U.prototype,"parentNode",{get:function(){return this.parent},set:function(te){this.parent=te},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"previousSibling",{get:function(){return this.prev},set:function(te){this.prev=te},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"nextSibling",{get:function(){return this.next},set:function(te){this.next=te},enumerable:!1,configurable:!0}),U.prototype.cloneNode=function(te){return te===void 0&&(te=!1),G(this,te)},U}();node$1.Node=l;var f=function(U){s(te,U);function te(Z){var J=U.call(this)||this;return J.data=Z,J}return Object.defineProperty(te.prototype,"nodeValue",{get:function(){return this.data},set:function(Z){this.data=Z},enumerable:!1,configurable:!0}),te}(l);node$1.DataNode=f;var c=function(U){s(te,U);function te(){var Z=U!==null&&U.apply(this,arguments)||this;return Z.type=u.ElementType.Text,Z}return Object.defineProperty(te.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),te}(f);node$1.Text=c;var h=function(U){s(te,U);function te(){var Z=U!==null&&U.apply(this,arguments)||this;return Z.type=u.ElementType.Comment,Z}return Object.defineProperty(te.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),te}(f);node$1.Comment=h;var p=function(U){s(te,U);function te(Z,J){var Q=U.call(this,J)||this;return Q.name=Z,Q.type=u.ElementType.Directive,Q}return Object.defineProperty(te.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),te}(f);node$1.ProcessingInstruction=p;var v=function(U){s(te,U);function te(Z){var J=U.call(this)||this;return J.children=Z,J}return Object.defineProperty(te.prototype,"firstChild",{get:function(){var Z;return(Z=this.children[0])!==null&&Z!==void 0?Z:null},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"childNodes",{get:function(){return this.children},set:function(Z){this.children=Z},enumerable:!1,configurable:!0}),te}(l);node$1.NodeWithChildren=v;var y=function(U){s(te,U);function te(){var Z=U!==null&&U.apply(this,arguments)||this;return Z.type=u.ElementType.CDATA,Z}return Object.defineProperty(te.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),te}(v);node$1.CDATA=y;var b=function(U){s(te,U);function te(){var Z=U!==null&&U.apply(this,arguments)||this;return Z.type=u.ElementType.Root,Z}return Object.defineProperty(te.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),te}(v);node$1.Document=b;var S=function(U){s(te,U);function te(Z,J,Q,ee){Q===void 0&&(Q=[]),ee===void 0&&(ee=Z==="script"?u.ElementType.Script:Z==="style"?u.ElementType.Style:u.ElementType.Tag);var k=U.call(this,Q)||this;return k.name=Z,k.attribs=J,k.type=ee,k}return Object.defineProperty(te.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"tagName",{get:function(){return this.name},set:function(Z){this.name=Z},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"attributes",{get:function(){var Z=this;return Object.keys(this.attribs).map(function(J){var Q,ee;return{name:J,value:Z.attribs[J],namespace:(Q=Z["x-attribsNamespace"])===null||Q===void 0?void 0:Q[J],prefix:(ee=Z["x-attribsPrefix"])===null||ee===void 0?void 0:ee[J]}})},enumerable:!1,configurable:!0}),te}(v);node$1.Element=S;function E(U){return(0,u.isTag)(U)}node$1.isTag=E;function R(U){return U.type===u.ElementType.CDATA}node$1.isCDATA=R;function O(U){return U.type===u.ElementType.Text}node$1.isText=O;function I(U){return U.type===u.ElementType.Comment}node$1.isComment=I;function B(U){return U.type===u.ElementType.Directive}node$1.isDirective=B;function N(U){return U.type===u.ElementType.Root}node$1.isDocument=N;function D(U){return Object.prototype.hasOwnProperty.call(U,"children")}node$1.hasChildren=D;function G(U,te){te===void 0&&(te=!1);var Z;if(O(U))Z=new c(U.data);else if(I(U))Z=new h(U.data);else if(E(U)){var J=te?V(U.children):[],Q=new S(U.name,a({},U.attribs),J);J.forEach(function(g){return g.parent=Q}),U.namespace!=null&&(Q.namespace=U.namespace),U["x-attribsNamespace"]&&(Q["x-attribsNamespace"]=a({},U["x-attribsNamespace"])),U["x-attribsPrefix"]&&(Q["x-attribsPrefix"]=a({},U["x-attribsPrefix"])),Z=Q}else if(R(U)){var J=te?V(U.children):[],ee=new y(J);J.forEach(function(_){return _.parent=ee}),Z=ee}else if(N(U)){var J=te?V(U.children):[],k=new b(J);J.forEach(function(_){return _.parent=k}),U["x-mode"]&&(k["x-mode"]=U["x-mode"]),Z=k}else if(B(U)){var d=new p(U.name,U.data);U["x-name"]!=null&&(d["x-name"]=U["x-name"],d["x-publicId"]=U["x-publicId"],d["x-systemId"]=U["x-systemId"]),Z=d}else throw new Error("Not implemented yet: ".concat(U.type));return Z.startIndex=U.startIndex,Z.endIndex=U.endIndex,U.sourceCodeLocation!=null&&(Z.sourceCodeLocation=U.sourceCodeLocation),Z}node$1.cloneNode=G;function V(U){for(var te=U.map(function(J){return G(J,!0)}),Z=1;Z<te.length;Z++)te[Z].prev=te[Z-1],te[Z-1].next=te[Z];return te}return node$1}var hasRequiredLib$4;function requireLib$4(){return hasRequiredLib$4||(hasRequiredLib$4=1,function(s){var a=lib$4&&lib$4.__createBinding||(Object.create?function(p,v,y,b){b===void 0&&(b=y);var S=Object.getOwnPropertyDescriptor(v,y);(!S||("get"in S?!v.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return v[y]}}),Object.defineProperty(p,b,S)}:function(p,v,y,b){b===void 0&&(b=y),p[b]=v[y]}),u=lib$4&&lib$4.__exportStar||function(p,v){for(var y in p)y!=="default"&&!Object.prototype.hasOwnProperty.call(v,y)&&a(v,p,y)};Object.defineProperty(s,"__esModule",{value:!0}),s.DomHandler=void 0;var l=requireLib$5(),f=requireNode$1();u(requireNode$1(),s);var c={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},h=function(){function p(v,y,b){this.dom=[],this.root=new f.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof y=="function"&&(b=y,y=c),typeof v=="object"&&(y=v,v=void 0),this.callback=v??null,this.options=y??c,this.elementCB=b??null}return p.prototype.onparserinit=function(v){this.parser=v},p.prototype.onreset=function(){this.dom=[],this.root=new f.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},p.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},p.prototype.onerror=function(v){this.handleCallback(v)},p.prototype.onclosetag=function(){this.lastNode=null;var v=this.tagStack.pop();this.options.withEndIndices&&(v.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(v)},p.prototype.onopentag=function(v,y){var b=this.options.xmlMode?l.ElementType.Tag:void 0,S=new f.Element(v,y,void 0,b);this.addNode(S),this.tagStack.push(S)},p.prototype.ontext=function(v){var y=this.lastNode;if(y&&y.type===l.ElementType.Text)y.data+=v,this.options.withEndIndices&&(y.endIndex=this.parser.endIndex);else{var b=new f.Text(v);this.addNode(b),this.lastNode=b}},p.prototype.oncomment=function(v){if(this.lastNode&&this.lastNode.type===l.ElementType.Comment){this.lastNode.data+=v;return}var y=new f.Comment(v);this.addNode(y),this.lastNode=y},p.prototype.oncommentend=function(){this.lastNode=null},p.prototype.oncdatastart=function(){var v=new f.Text(""),y=new f.CDATA([v]);this.addNode(y),v.parent=y,this.lastNode=v},p.prototype.oncdataend=function(){this.lastNode=null},p.prototype.onprocessinginstruction=function(v,y){var b=new f.ProcessingInstruction(v,y);this.addNode(b)},p.prototype.handleCallback=function(v){if(typeof this.callback=="function")this.callback(v,this.dom);else if(v)throw v},p.prototype.addNode=function(v){var y=this.tagStack[this.tagStack.length-1],b=y.children[y.children.length-1];this.options.withStartIndices&&(v.startIndex=this.parser.startIndex),this.options.withEndIndices&&(v.endIndex=this.parser.endIndex),y.children.push(v),b&&(v.prev=b,b.next=v),v.parent=y,this.lastNode=null},p}();s.DomHandler=h,s.default=h}(lib$4)),lib$4}var lib$2={},stringify={},lib$1={},lib={},encode={},encodeHtml={},hasRequiredEncodeHtml;function requireEncodeHtml(){if(hasRequiredEncodeHtml)return encodeHtml;hasRequiredEncodeHtml=1,Object.defineProperty(encodeHtml,"__esModule",{value:!0});function s(a){for(var u=1;u<a.length;u++)a[u][0]+=a[u-1][0]+1;return a}return encodeHtml.default=new Map(s([[9,"&Tab;"],[0,"&NewLine;"],[22,"&excl;"],[0,"&quot;"],[0,"&num;"],[0,"&dollar;"],[0,"&percnt;"],[0,"&amp;"],[0,"&apos;"],[0,"&lpar;"],[0,"&rpar;"],[0,"&ast;"],[0,"&plus;"],[0,"&comma;"],[1,"&period;"],[0,"&sol;"],[10,"&colon;"],[0,"&semi;"],[0,{v:"&lt;",n:8402,o:"&nvlt;"}],[0,{v:"&equals;",n:8421,o:"&bne;"}],[0,{v:"&gt;",n:8402,o:"&nvgt;"}],[0,"&quest;"],[0,"&commat;"],[26,"&lbrack;"],[0,"&bsol;"],[0,"&rbrack;"],[0,"&Hat;"],[0,"&lowbar;"],[0,"&DiacriticalGrave;"],[5,{n:106,o:"&fjlig;"}],[20,"&lbrace;"],[0,"&verbar;"],[0,"&rbrace;"],[34,"&nbsp;"],[0,"&iexcl;"],[0,"&cent;"],[0,"&pound;"],[0,"&curren;"],[0,"&yen;"],[0,"&brvbar;"],[0,"&sect;"],[0,"&die;"],[0,"&copy;"],[0,"&ordf;"],[0,"&laquo;"],[0,"&not;"],[0,"&shy;"],[0,"&circledR;"],[0,"&macr;"],[0,"&deg;"],[0,"&PlusMinus;"],[0,"&sup2;"],[0,"&sup3;"],[0,"&acute;"],[0,"&micro;"],[0,"&para;"],[0,"&centerdot;"],[0,"&cedil;"],[0,"&sup1;"],[0,"&ordm;"],[0,"&raquo;"],[0,"&frac14;"],[0,"&frac12;"],[0,"&frac34;"],[0,"&iquest;"],[0,"&Agrave;"],[0,"&Aacute;"],[0,"&Acirc;"],[0,"&Atilde;"],[0,"&Auml;"],[0,"&angst;"],[0,"&AElig;"],[0,"&Ccedil;"],[0,"&Egrave;"],[0,"&Eacute;"],[0,"&Ecirc;"],[0,"&Euml;"],[0,"&Igrave;"],[0,"&Iacute;"],[0,"&Icirc;"],[0,"&Iuml;"],[0,"&ETH;"],[0,"&Ntilde;"],[0,"&Ograve;"],[0,"&Oacute;"],[0,"&Ocirc;"],[0,"&Otilde;"],[0,"&Ouml;"],[0,"&times;"],[0,"&Oslash;"],[0,"&Ugrave;"],[0,"&Uacute;"],[0,"&Ucirc;"],[0,"&Uuml;"],[0,"&Yacute;"],[0,"&THORN;"],[0,"&szlig;"],[0,"&agrave;"],[0,"&aacute;"],[0,"&acirc;"],[0,"&atilde;"],[0,"&auml;"],[0,"&aring;"],[0,"&aelig;"],[0,"&ccedil;"],[0,"&egrave;"],[0,"&eacute;"],[0,"&ecirc;"],[0,"&euml;"],[0,"&igrave;"],[0,"&iacute;"],[0,"&icirc;"],[0,"&iuml;"],[0,"&eth;"],[0,"&ntilde;"],[0,"&ograve;"],[0,"&oacute;"],[0,"&ocirc;"],[0,"&otilde;"],[0,"&ouml;"],[0,"&div;"],[0,"&oslash;"],[0,"&ugrave;"],[0,"&uacute;"],[0,"&ucirc;"],[0,"&uuml;"],[0,"&yacute;"],[0,"&thorn;"],[0,"&yuml;"],[0,"&Amacr;"],[0,"&amacr;"],[0,"&Abreve;"],[0,"&abreve;"],[0,"&Aogon;"],[0,"&aogon;"],[0,"&Cacute;"],[0,"&cacute;"],[0,"&Ccirc;"],[0,"&ccirc;"],[0,"&Cdot;"],[0,"&cdot;"],[0,"&Ccaron;"],[0,"&ccaron;"],[0,"&Dcaron;"],[0,"&dcaron;"],[0,"&Dstrok;"],[0,"&dstrok;"],[0,"&Emacr;"],[0,"&emacr;"],[2,"&Edot;"],[0,"&edot;"],[0,"&Eogon;"],[0,"&eogon;"],[0,"&Ecaron;"],[0,"&ecaron;"],[0,"&Gcirc;"],[0,"&gcirc;"],[0,"&Gbreve;"],[0,"&gbreve;"],[0,"&Gdot;"],[0,"&gdot;"],[0,"&Gcedil;"],[1,"&Hcirc;"],[0,"&hcirc;"],[0,"&Hstrok;"],[0,"&hstrok;"],[0,"&Itilde;"],[0,"&itilde;"],[0,"&Imacr;"],[0,"&imacr;"],[2,"&Iogon;"],[0,"&iogon;"],[0,"&Idot;"],[0,"&imath;"],[0,"&IJlig;"],[0,"&ijlig;"],[0,"&Jcirc;"],[0,"&jcirc;"],[0,"&Kcedil;"],[0,"&kcedil;"],[0,"&kgreen;"],[0,"&Lacute;"],[0,"&lacute;"],[0,"&Lcedil;"],[0,"&lcedil;"],[0,"&Lcaron;"],[0,"&lcaron;"],[0,"&Lmidot;"],[0,"&lmidot;"],[0,"&Lstrok;"],[0,"&lstrok;"],[0,"&Nacute;"],[0,"&nacute;"],[0,"&Ncedil;"],[0,"&ncedil;"],[0,"&Ncaron;"],[0,"&ncaron;"],[0,"&napos;"],[0,"&ENG;"],[0,"&eng;"],[0,"&Omacr;"],[0,"&omacr;"],[2,"&Odblac;"],[0,"&odblac;"],[0,"&OElig;"],[0,"&oelig;"],[0,"&Racute;"],[0,"&racute;"],[0,"&Rcedil;"],[0,"&rcedil;"],[0,"&Rcaron;"],[0,"&rcaron;"],[0,"&Sacute;"],[0,"&sacute;"],[0,"&Scirc;"],[0,"&scirc;"],[0,"&Scedil;"],[0,"&scedil;"],[0,"&Scaron;"],[0,"&scaron;"],[0,"&Tcedil;"],[0,"&tcedil;"],[0,"&Tcaron;"],[0,"&tcaron;"],[0,"&Tstrok;"],[0,"&tstrok;"],[0,"&Utilde;"],[0,"&utilde;"],[0,"&Umacr;"],[0,"&umacr;"],[0,"&Ubreve;"],[0,"&ubreve;"],[0,"&Uring;"],[0,"&uring;"],[0,"&Udblac;"],[0,"&udblac;"],[0,"&Uogon;"],[0,"&uogon;"],[0,"&Wcirc;"],[0,"&wcirc;"],[0,"&Ycirc;"],[0,"&ycirc;"],[0,"&Yuml;"],[0,"&Zacute;"],[0,"&zacute;"],[0,"&Zdot;"],[0,"&zdot;"],[0,"&Zcaron;"],[0,"&zcaron;"],[19,"&fnof;"],[34,"&imped;"],[63,"&gacute;"],[65,"&jmath;"],[142,"&circ;"],[0,"&caron;"],[16,"&breve;"],[0,"&DiacriticalDot;"],[0,"&ring;"],[0,"&ogon;"],[0,"&DiacriticalTilde;"],[0,"&dblac;"],[51,"&DownBreve;"],[127,"&Alpha;"],[0,"&Beta;"],[0,"&Gamma;"],[0,"&Delta;"],[0,"&Epsilon;"],[0,"&Zeta;"],[0,"&Eta;"],[0,"&Theta;"],[0,"&Iota;"],[0,"&Kappa;"],[0,"&Lambda;"],[0,"&Mu;"],[0,"&Nu;"],[0,"&Xi;"],[0,"&Omicron;"],[0,"&Pi;"],[0,"&Rho;"],[1,"&Sigma;"],[0,"&Tau;"],[0,"&Upsilon;"],[0,"&Phi;"],[0,"&Chi;"],[0,"&Psi;"],[0,"&ohm;"],[7,"&alpha;"],[0,"&beta;"],[0,"&gamma;"],[0,"&delta;"],[0,"&epsi;"],[0,"&zeta;"],[0,"&eta;"],[0,"&theta;"],[0,"&iota;"],[0,"&kappa;"],[0,"&lambda;"],[0,"&mu;"],[0,"&nu;"],[0,"&xi;"],[0,"&omicron;"],[0,"&pi;"],[0,"&rho;"],[0,"&sigmaf;"],[0,"&sigma;"],[0,"&tau;"],[0,"&upsi;"],[0,"&phi;"],[0,"&chi;"],[0,"&psi;"],[0,"&omega;"],[7,"&thetasym;"],[0,"&Upsi;"],[2,"&phiv;"],[0,"&piv;"],[5,"&Gammad;"],[0,"&digamma;"],[18,"&kappav;"],[0,"&rhov;"],[3,"&epsiv;"],[0,"&backepsilon;"],[10,"&IOcy;"],[0,"&DJcy;"],[0,"&GJcy;"],[0,"&Jukcy;"],[0,"&DScy;"],[0,"&Iukcy;"],[0,"&YIcy;"],[0,"&Jsercy;"],[0,"&LJcy;"],[0,"&NJcy;"],[0,"&TSHcy;"],[0,"&KJcy;"],[1,"&Ubrcy;"],[0,"&DZcy;"],[0,"&Acy;"],[0,"&Bcy;"],[0,"&Vcy;"],[0,"&Gcy;"],[0,"&Dcy;"],[0,"&IEcy;"],[0,"&ZHcy;"],[0,"&Zcy;"],[0,"&Icy;"],[0,"&Jcy;"],[0,"&Kcy;"],[0,"&Lcy;"],[0,"&Mcy;"],[0,"&Ncy;"],[0,"&Ocy;"],[0,"&Pcy;"],[0,"&Rcy;"],[0,"&Scy;"],[0,"&Tcy;"],[0,"&Ucy;"],[0,"&Fcy;"],[0,"&KHcy;"],[0,"&TScy;"],[0,"&CHcy;"],[0,"&SHcy;"],[0,"&SHCHcy;"],[0,"&HARDcy;"],[0,"&Ycy;"],[0,"&SOFTcy;"],[0,"&Ecy;"],[0,"&YUcy;"],[0,"&YAcy;"],[0,"&acy;"],[0,"&bcy;"],[0,"&vcy;"],[0,"&gcy;"],[0,"&dcy;"],[0,"&iecy;"],[0,"&zhcy;"],[0,"&zcy;"],[0,"&icy;"],[0,"&jcy;"],[0,"&kcy;"],[0,"&lcy;"],[0,"&mcy;"],[0,"&ncy;"],[0,"&ocy;"],[0,"&pcy;"],[0,"&rcy;"],[0,"&scy;"],[0,"&tcy;"],[0,"&ucy;"],[0,"&fcy;"],[0,"&khcy;"],[0,"&tscy;"],[0,"&chcy;"],[0,"&shcy;"],[0,"&shchcy;"],[0,"&hardcy;"],[0,"&ycy;"],[0,"&softcy;"],[0,"&ecy;"],[0,"&yucy;"],[0,"&yacy;"],[1,"&iocy;"],[0,"&djcy;"],[0,"&gjcy;"],[0,"&jukcy;"],[0,"&dscy;"],[0,"&iukcy;"],[0,"&yicy;"],[0,"&jsercy;"],[0,"&ljcy;"],[0,"&njcy;"],[0,"&tshcy;"],[0,"&kjcy;"],[1,"&ubrcy;"],[0,"&dzcy;"],[7074,"&ensp;"],[0,"&emsp;"],[0,"&emsp13;"],[0,"&emsp14;"],[1,"&numsp;"],[0,"&puncsp;"],[0,"&ThinSpace;"],[0,"&hairsp;"],[0,"&NegativeMediumSpace;"],[0,"&zwnj;"],[0,"&zwj;"],[0,"&lrm;"],[0,"&rlm;"],[0,"&dash;"],[2,"&ndash;"],[0,"&mdash;"],[0,"&horbar;"],[0,"&Verbar;"],[1,"&lsquo;"],[0,"&CloseCurlyQuote;"],[0,"&lsquor;"],[1,"&ldquo;"],[0,"&CloseCurlyDoubleQuote;"],[0,"&bdquo;"],[1,"&dagger;"],[0,"&Dagger;"],[0,"&bull;"],[2,"&nldr;"],[0,"&hellip;"],[9,"&permil;"],[0,"&pertenk;"],[0,"&prime;"],[0,"&Prime;"],[0,"&tprime;"],[0,"&backprime;"],[3,"&lsaquo;"],[0,"&rsaquo;"],[3,"&oline;"],[2,"&caret;"],[1,"&hybull;"],[0,"&frasl;"],[10,"&bsemi;"],[7,"&qprime;"],[7,{v:"&MediumSpace;",n:8202,o:"&ThickSpace;"}],[0,"&NoBreak;"],[0,"&af;"],[0,"&InvisibleTimes;"],[0,"&ic;"],[72,"&euro;"],[46,"&tdot;"],[0,"&DotDot;"],[37,"&complexes;"],[2,"&incare;"],[4,"&gscr;"],[0,"&hamilt;"],[0,"&Hfr;"],[0,"&Hopf;"],[0,"&planckh;"],[0,"&hbar;"],[0,"&imagline;"],[0,"&Ifr;"],[0,"&lagran;"],[0,"&ell;"],[1,"&naturals;"],[0,"&numero;"],[0,"&copysr;"],[0,"&weierp;"],[0,"&Popf;"],[0,"&Qopf;"],[0,"&realine;"],[0,"&real;"],[0,"&reals;"],[0,"&rx;"],[3,"&trade;"],[1,"&integers;"],[2,"&mho;"],[0,"&zeetrf;"],[0,"&iiota;"],[2,"&bernou;"],[0,"&Cayleys;"],[1,"&escr;"],[0,"&Escr;"],[0,"&Fouriertrf;"],[1,"&Mellintrf;"],[0,"&order;"],[0,"&alefsym;"],[0,"&beth;"],[0,"&gimel;"],[0,"&daleth;"],[12,"&CapitalDifferentialD;"],[0,"&dd;"],[0,"&ee;"],[0,"&ii;"],[10,"&frac13;"],[0,"&frac23;"],[0,"&frac15;"],[0,"&frac25;"],[0,"&frac35;"],[0,"&frac45;"],[0,"&frac16;"],[0,"&frac56;"],[0,"&frac18;"],[0,"&frac38;"],[0,"&frac58;"],[0,"&frac78;"],[49,"&larr;"],[0,"&ShortUpArrow;"],[0,"&rarr;"],[0,"&darr;"],[0,"&harr;"],[0,"&updownarrow;"],[0,"&nwarr;"],[0,"&nearr;"],[0,"&LowerRightArrow;"],[0,"&LowerLeftArrow;"],[0,"&nlarr;"],[0,"&nrarr;"],[1,{v:"&rarrw;",n:824,o:"&nrarrw;"}],[0,"&Larr;"],[0,"&Uarr;"],[0,"&Rarr;"],[0,"&Darr;"],[0,"&larrtl;"],[0,"&rarrtl;"],[0,"&LeftTeeArrow;"],[0,"&mapstoup;"],[0,"&map;"],[0,"&DownTeeArrow;"],[1,"&hookleftarrow;"],[0,"&hookrightarrow;"],[0,"&larrlp;"],[0,"&looparrowright;"],[0,"&harrw;"],[0,"&nharr;"],[1,"&lsh;"],[0,"&rsh;"],[0,"&ldsh;"],[0,"&rdsh;"],[1,"&crarr;"],[0,"&cularr;"],[0,"&curarr;"],[2,"&circlearrowleft;"],[0,"&circlearrowright;"],[0,"&leftharpoonup;"],[0,"&DownLeftVector;"],[0,"&RightUpVector;"],[0,"&LeftUpVector;"],[0,"&rharu;"],[0,"&DownRightVector;"],[0,"&dharr;"],[0,"&dharl;"],[0,"&RightArrowLeftArrow;"],[0,"&udarr;"],[0,"&LeftArrowRightArrow;"],[0,"&leftleftarrows;"],[0,"&upuparrows;"],[0,"&rightrightarrows;"],[0,"&ddarr;"],[0,"&leftrightharpoons;"],[0,"&Equilibrium;"],[0,"&nlArr;"],[0,"&nhArr;"],[0,"&nrArr;"],[0,"&DoubleLeftArrow;"],[0,"&DoubleUpArrow;"],[0,"&DoubleRightArrow;"],[0,"&dArr;"],[0,"&DoubleLeftRightArrow;"],[0,"&DoubleUpDownArrow;"],[0,"&nwArr;"],[0,"&neArr;"],[0,"&seArr;"],[0,"&swArr;"],[0,"&lAarr;"],[0,"&rAarr;"],[1,"&zigrarr;"],[6,"&larrb;"],[0,"&rarrb;"],[15,"&DownArrowUpArrow;"],[7,"&loarr;"],[0,"&roarr;"],[0,"&hoarr;"],[0,"&forall;"],[0,"&comp;"],[0,{v:"&part;",n:824,o:"&npart;"}],[0,"&exist;"],[0,"&nexist;"],[0,"&empty;"],[1,"&Del;"],[0,"&Element;"],[0,"&NotElement;"],[1,"&ni;"],[0,"&notni;"],[2,"&prod;"],[0,"&coprod;"],[0,"&sum;"],[0,"&minus;"],[0,"&MinusPlus;"],[0,"&dotplus;"],[1,"&Backslash;"],[0,"&lowast;"],[0,"&compfn;"],[1,"&radic;"],[2,"&prop;"],[0,"&infin;"],[0,"&angrt;"],[0,{v:"&ang;",n:8402,o:"&nang;"}],[0,"&angmsd;"],[0,"&angsph;"],[0,"&mid;"],[0,"&nmid;"],[0,"&DoubleVerticalBar;"],[0,"&NotDoubleVerticalBar;"],[0,"&and;"],[0,"&or;"],[0,{v:"&cap;",n:65024,o:"&caps;"}],[0,{v:"&cup;",n:65024,o:"&cups;"}],[0,"&int;"],[0,"&Int;"],[0,"&iiint;"],[0,"&conint;"],[0,"&Conint;"],[0,"&Cconint;"],[0,"&cwint;"],[0,"&ClockwiseContourIntegral;"],[0,"&awconint;"],[0,"&there4;"],[0,"&becaus;"],[0,"&ratio;"],[0,"&Colon;"],[0,"&dotminus;"],[1,"&mDDot;"],[0,"&homtht;"],[0,{v:"&sim;",n:8402,o:"&nvsim;"}],[0,{v:"&backsim;",n:817,o:"&race;"}],[0,{v:"&ac;",n:819,o:"&acE;"}],[0,"&acd;"],[0,"&VerticalTilde;"],[0,"&NotTilde;"],[0,{v:"&eqsim;",n:824,o:"&nesim;"}],[0,"&sime;"],[0,"&NotTildeEqual;"],[0,"&cong;"],[0,"&simne;"],[0,"&ncong;"],[0,"&ap;"],[0,"&nap;"],[0,"&ape;"],[0,{v:"&apid;",n:824,o:"&napid;"}],[0,"&backcong;"],[0,{v:"&asympeq;",n:8402,o:"&nvap;"}],[0,{v:"&bump;",n:824,o:"&nbump;"}],[0,{v:"&bumpe;",n:824,o:"&nbumpe;"}],[0,{v:"&doteq;",n:824,o:"&nedot;"}],[0,"&doteqdot;"],[0,"&efDot;"],[0,"&erDot;"],[0,"&Assign;"],[0,"&ecolon;"],[0,"&ecir;"],[0,"&circeq;"],[1,"&wedgeq;"],[0,"&veeeq;"],[1,"&triangleq;"],[2,"&equest;"],[0,"&ne;"],[0,{v:"&Congruent;",n:8421,o:"&bnequiv;"}],[0,"&nequiv;"],[1,{v:"&le;",n:8402,o:"&nvle;"}],[0,{v:"&ge;",n:8402,o:"&nvge;"}],[0,{v:"&lE;",n:824,o:"&nlE;"}],[0,{v:"&gE;",n:824,o:"&ngE;"}],[0,{v:"&lnE;",n:65024,o:"&lvertneqq;"}],[0,{v:"&gnE;",n:65024,o:"&gvertneqq;"}],[0,{v:"&ll;",n:new Map(s([[824,"&nLtv;"],[7577,"&nLt;"]]))}],[0,{v:"&gg;",n:new Map(s([[824,"&nGtv;"],[7577,"&nGt;"]]))}],[0,"&between;"],[0,"&NotCupCap;"],[0,"&nless;"],[0,"&ngt;"],[0,"&nle;"],[0,"&nge;"],[0,"&lesssim;"],[0,"&GreaterTilde;"],[0,"&nlsim;"],[0,"&ngsim;"],[0,"&LessGreater;"],[0,"&gl;"],[0,"&NotLessGreater;"],[0,"&NotGreaterLess;"],[0,"&pr;"],[0,"&sc;"],[0,"&prcue;"],[0,"&sccue;"],[0,"&PrecedesTilde;"],[0,{v:"&scsim;",n:824,o:"&NotSucceedsTilde;"}],[0,"&NotPrecedes;"],[0,"&NotSucceeds;"],[0,{v:"&sub;",n:8402,o:"&NotSubset;"}],[0,{v:"&sup;",n:8402,o:"&NotSuperset;"}],[0,"&nsub;"],[0,"&nsup;"],[0,"&sube;"],[0,"&supe;"],[0,"&NotSubsetEqual;"],[0,"&NotSupersetEqual;"],[0,{v:"&subne;",n:65024,o:"&varsubsetneq;"}],[0,{v:"&supne;",n:65024,o:"&varsupsetneq;"}],[1,"&cupdot;"],[0,"&UnionPlus;"],[0,{v:"&sqsub;",n:824,o:"&NotSquareSubset;"}],[0,{v:"&sqsup;",n:824,o:"&NotSquareSuperset;"}],[0,"&sqsube;"],[0,"&sqsupe;"],[0,{v:"&sqcap;",n:65024,o:"&sqcaps;"}],[0,{v:"&sqcup;",n:65024,o:"&sqcups;"}],[0,"&CirclePlus;"],[0,"&CircleMinus;"],[0,"&CircleTimes;"],[0,"&osol;"],[0,"&CircleDot;"],[0,"&circledcirc;"],[0,"&circledast;"],[1,"&circleddash;"],[0,"&boxplus;"],[0,"&boxminus;"],[0,"&boxtimes;"],[0,"&dotsquare;"],[0,"&RightTee;"],[0,"&dashv;"],[0,"&DownTee;"],[0,"&bot;"],[1,"&models;"],[0,"&DoubleRightTee;"],[0,"&Vdash;"],[0,"&Vvdash;"],[0,"&VDash;"],[0,"&nvdash;"],[0,"&nvDash;"],[0,"&nVdash;"],[0,"&nVDash;"],[0,"&prurel;"],[1,"&LeftTriangle;"],[0,"&RightTriangle;"],[0,{v:"&LeftTriangleEqual;",n:8402,o:"&nvltrie;"}],[0,{v:"&RightTriangleEqual;",n:8402,o:"&nvrtrie;"}],[0,"&origof;"],[0,"&imof;"],[0,"&multimap;"],[0,"&hercon;"],[0,"&intcal;"],[0,"&veebar;"],[1,"&barvee;"],[0,"&angrtvb;"],[0,"&lrtri;"],[0,"&bigwedge;"],[0,"&bigvee;"],[0,"&bigcap;"],[0,"&bigcup;"],[0,"&diam;"],[0,"&sdot;"],[0,"&sstarf;"],[0,"&divideontimes;"],[0,"&bowtie;"],[0,"&ltimes;"],[0,"&rtimes;"],[0,"&leftthreetimes;"],[0,"&rightthreetimes;"],[0,"&backsimeq;"],[0,"&curlyvee;"],[0,"&curlywedge;"],[0,"&Sub;"],[0,"&Sup;"],[0,"&Cap;"],[0,"&Cup;"],[0,"&fork;"],[0,"&epar;"],[0,"&lessdot;"],[0,"&gtdot;"],[0,{v:"&Ll;",n:824,o:"&nLl;"}],[0,{v:"&Gg;",n:824,o:"&nGg;"}],[0,{v:"&leg;",n:65024,o:"&lesg;"}],[0,{v:"&gel;",n:65024,o:"&gesl;"}],[2,"&cuepr;"],[0,"&cuesc;"],[0,"&NotPrecedesSlantEqual;"],[0,"&NotSucceedsSlantEqual;"],[0,"&NotSquareSubsetEqual;"],[0,"&NotSquareSupersetEqual;"],[2,"&lnsim;"],[0,"&gnsim;"],[0,"&precnsim;"],[0,"&scnsim;"],[0,"&nltri;"],[0,"&NotRightTriangle;"],[0,"&nltrie;"],[0,"&NotRightTriangleEqual;"],[0,"&vellip;"],[0,"&ctdot;"],[0,"&utdot;"],[0,"&dtdot;"],[0,"&disin;"],[0,"&isinsv;"],[0,"&isins;"],[0,{v:"&isindot;",n:824,o:"&notindot;"}],[0,"&notinvc;"],[0,"&notinvb;"],[1,{v:"&isinE;",n:824,o:"&notinE;"}],[0,"&nisd;"],[0,"&xnis;"],[0,"&nis;"],[0,"&notnivc;"],[0,"&notnivb;"],[6,"&barwed;"],[0,"&Barwed;"],[1,"&lceil;"],[0,"&rceil;"],[0,"&LeftFloor;"],[0,"&rfloor;"],[0,"&drcrop;"],[0,"&dlcrop;"],[0,"&urcrop;"],[0,"&ulcrop;"],[0,"&bnot;"],[1,"&profline;"],[0,"&profsurf;"],[1,"&telrec;"],[0,"&target;"],[5,"&ulcorn;"],[0,"&urcorn;"],[0,"&dlcorn;"],[0,"&drcorn;"],[2,"&frown;"],[0,"&smile;"],[9,"&cylcty;"],[0,"&profalar;"],[7,"&topbot;"],[6,"&ovbar;"],[1,"&solbar;"],[60,"&angzarr;"],[51,"&lmoustache;"],[0,"&rmoustache;"],[2,"&OverBracket;"],[0,"&bbrk;"],[0,"&bbrktbrk;"],[37,"&OverParenthesis;"],[0,"&UnderParenthesis;"],[0,"&OverBrace;"],[0,"&UnderBrace;"],[2,"&trpezium;"],[4,"&elinters;"],[59,"&blank;"],[164,"&circledS;"],[55,"&boxh;"],[1,"&boxv;"],[9,"&boxdr;"],[3,"&boxdl;"],[3,"&boxur;"],[3,"&boxul;"],[3,"&boxvr;"],[7,"&boxvl;"],[7,"&boxhd;"],[7,"&boxhu;"],[7,"&boxvh;"],[19,"&boxH;"],[0,"&boxV;"],[0,"&boxdR;"],[0,"&boxDr;"],[0,"&boxDR;"],[0,"&boxdL;"],[0,"&boxDl;"],[0,"&boxDL;"],[0,"&boxuR;"],[0,"&boxUr;"],[0,"&boxUR;"],[0,"&boxuL;"],[0,"&boxUl;"],[0,"&boxUL;"],[0,"&boxvR;"],[0,"&boxVr;"],[0,"&boxVR;"],[0,"&boxvL;"],[0,"&boxVl;"],[0,"&boxVL;"],[0,"&boxHd;"],[0,"&boxhD;"],[0,"&boxHD;"],[0,"&boxHu;"],[0,"&boxhU;"],[0,"&boxHU;"],[0,"&boxvH;"],[0,"&boxVh;"],[0,"&boxVH;"],[19,"&uhblk;"],[3,"&lhblk;"],[3,"&block;"],[8,"&blk14;"],[0,"&blk12;"],[0,"&blk34;"],[13,"&square;"],[8,"&blacksquare;"],[0,"&EmptyVerySmallSquare;"],[1,"&rect;"],[0,"&marker;"],[2,"&fltns;"],[1,"&bigtriangleup;"],[0,"&blacktriangle;"],[0,"&triangle;"],[2,"&blacktriangleright;"],[0,"&rtri;"],[3,"&bigtriangledown;"],[0,"&blacktriangledown;"],[0,"&dtri;"],[2,"&blacktriangleleft;"],[0,"&ltri;"],[6,"&loz;"],[0,"&cir;"],[32,"&tridot;"],[2,"&bigcirc;"],[8,"&ultri;"],[0,"&urtri;"],[0,"&lltri;"],[0,"&EmptySmallSquare;"],[0,"&FilledSmallSquare;"],[8,"&bigstar;"],[0,"&star;"],[7,"&phone;"],[49,"&female;"],[1,"&male;"],[29,"&spades;"],[2,"&clubs;"],[1,"&hearts;"],[0,"&diamondsuit;"],[3,"&sung;"],[2,"&flat;"],[0,"&natural;"],[0,"&sharp;"],[163,"&check;"],[3,"&cross;"],[8,"&malt;"],[21,"&sext;"],[33,"&VerticalSeparator;"],[25,"&lbbrk;"],[0,"&rbbrk;"],[84,"&bsolhsub;"],[0,"&suphsol;"],[28,"&LeftDoubleBracket;"],[0,"&RightDoubleBracket;"],[0,"&lang;"],[0,"&rang;"],[0,"&Lang;"],[0,"&Rang;"],[0,"&loang;"],[0,"&roang;"],[7,"&longleftarrow;"],[0,"&longrightarrow;"],[0,"&longleftrightarrow;"],[0,"&DoubleLongLeftArrow;"],[0,"&DoubleLongRightArrow;"],[0,"&DoubleLongLeftRightArrow;"],[1,"&longmapsto;"],[2,"&dzigrarr;"],[258,"&nvlArr;"],[0,"&nvrArr;"],[0,"&nvHarr;"],[0,"&Map;"],[6,"&lbarr;"],[0,"&bkarow;"],[0,"&lBarr;"],[0,"&dbkarow;"],[0,"&drbkarow;"],[0,"&DDotrahd;"],[0,"&UpArrowBar;"],[0,"&DownArrowBar;"],[2,"&Rarrtl;"],[2,"&latail;"],[0,"&ratail;"],[0,"&lAtail;"],[0,"&rAtail;"],[0,"&larrfs;"],[0,"&rarrfs;"],[0,"&larrbfs;"],[0,"&rarrbfs;"],[2,"&nwarhk;"],[0,"&nearhk;"],[0,"&hksearow;"],[0,"&hkswarow;"],[0,"&nwnear;"],[0,"&nesear;"],[0,"&seswar;"],[0,"&swnwar;"],[8,{v:"&rarrc;",n:824,o:"&nrarrc;"}],[1,"&cudarrr;"],[0,"&ldca;"],[0,"&rdca;"],[0,"&cudarrl;"],[0,"&larrpl;"],[2,"&curarrm;"],[0,"&cularrp;"],[7,"&rarrpl;"],[2,"&harrcir;"],[0,"&Uarrocir;"],[0,"&lurdshar;"],[0,"&ldrushar;"],[2,"&LeftRightVector;"],[0,"&RightUpDownVector;"],[0,"&DownLeftRightVector;"],[0,"&LeftUpDownVector;"],[0,"&LeftVectorBar;"],[0,"&RightVectorBar;"],[0,"&RightUpVectorBar;"],[0,"&RightDownVectorBar;"],[0,"&DownLeftVectorBar;"],[0,"&DownRightVectorBar;"],[0,"&LeftUpVectorBar;"],[0,"&LeftDownVectorBar;"],[0,"&LeftTeeVector;"],[0,"&RightTeeVector;"],[0,"&RightUpTeeVector;"],[0,"&RightDownTeeVector;"],[0,"&DownLeftTeeVector;"],[0,"&DownRightTeeVector;"],[0,"&LeftUpTeeVector;"],[0,"&LeftDownTeeVector;"],[0,"&lHar;"],[0,"&uHar;"],[0,"&rHar;"],[0,"&dHar;"],[0,"&luruhar;"],[0,"&ldrdhar;"],[0,"&ruluhar;"],[0,"&rdldhar;"],[0,"&lharul;"],[0,"&llhard;"],[0,"&rharul;"],[0,"&lrhard;"],[0,"&udhar;"],[0,"&duhar;"],[0,"&RoundImplies;"],[0,"&erarr;"],[0,"&simrarr;"],[0,"&larrsim;"],[0,"&rarrsim;"],[0,"&rarrap;"],[0,"&ltlarr;"],[1,"&gtrarr;"],[0,"&subrarr;"],[1,"&suplarr;"],[0,"&lfisht;"],[0,"&rfisht;"],[0,"&ufisht;"],[0,"&dfisht;"],[5,"&lopar;"],[0,"&ropar;"],[4,"&lbrke;"],[0,"&rbrke;"],[0,"&lbrkslu;"],[0,"&rbrksld;"],[0,"&lbrksld;"],[0,"&rbrkslu;"],[0,"&langd;"],[0,"&rangd;"],[0,"&lparlt;"],[0,"&rpargt;"],[0,"&gtlPar;"],[0,"&ltrPar;"],[3,"&vzigzag;"],[1,"&vangrt;"],[0,"&angrtvbd;"],[6,"&ange;"],[0,"&range;"],[0,"&dwangle;"],[0,"&uwangle;"],[0,"&angmsdaa;"],[0,"&angmsdab;"],[0,"&angmsdac;"],[0,"&angmsdad;"],[0,"&angmsdae;"],[0,"&angmsdaf;"],[0,"&angmsdag;"],[0,"&angmsdah;"],[0,"&bemptyv;"],[0,"&demptyv;"],[0,"&cemptyv;"],[0,"&raemptyv;"],[0,"&laemptyv;"],[0,"&ohbar;"],[0,"&omid;"],[0,"&opar;"],[1,"&operp;"],[1,"&olcross;"],[0,"&odsold;"],[1,"&olcir;"],[0,"&ofcir;"],[0,"&olt;"],[0,"&ogt;"],[0,"&cirscir;"],[0,"&cirE;"],[0,"&solb;"],[0,"&bsolb;"],[3,"&boxbox;"],[3,"&trisb;"],[0,"&rtriltri;"],[0,{v:"&LeftTriangleBar;",n:824,o:"&NotLeftTriangleBar;"}],[0,{v:"&RightTriangleBar;",n:824,o:"&NotRightTriangleBar;"}],[11,"&iinfin;"],[0,"&infintie;"],[0,"&nvinfin;"],[4,"&eparsl;"],[0,"&smeparsl;"],[0,"&eqvparsl;"],[5,"&blacklozenge;"],[8,"&RuleDelayed;"],[1,"&dsol;"],[9,"&bigodot;"],[0,"&bigoplus;"],[0,"&bigotimes;"],[1,"&biguplus;"],[1,"&bigsqcup;"],[5,"&iiiint;"],[0,"&fpartint;"],[2,"&cirfnint;"],[0,"&awint;"],[0,"&rppolint;"],[0,"&scpolint;"],[0,"&npolint;"],[0,"&pointint;"],[0,"&quatint;"],[0,"&intlarhk;"],[10,"&pluscir;"],[0,"&plusacir;"],[0,"&simplus;"],[0,"&plusdu;"],[0,"&plussim;"],[0,"&plustwo;"],[1,"&mcomma;"],[0,"&minusdu;"],[2,"&loplus;"],[0,"&roplus;"],[0,"&Cross;"],[0,"&timesd;"],[0,"&timesbar;"],[1,"&smashp;"],[0,"&lotimes;"],[0,"&rotimes;"],[0,"&otimesas;"],[0,"&Otimes;"],[0,"&odiv;"],[0,"&triplus;"],[0,"&triminus;"],[0,"&tritime;"],[0,"&intprod;"],[2,"&amalg;"],[0,"&capdot;"],[1,"&ncup;"],[0,"&ncap;"],[0,"&capand;"],[0,"&cupor;"],[0,"&cupcap;"],[0,"&capcup;"],[0,"&cupbrcap;"],[0,"&capbrcup;"],[0,"&cupcup;"],[0,"&capcap;"],[0,"&ccups;"],[0,"&ccaps;"],[2,"&ccupssm;"],[2,"&And;"],[0,"&Or;"],[0,"&andand;"],[0,"&oror;"],[0,"&orslope;"],[0,"&andslope;"],[1,"&andv;"],[0,"&orv;"],[0,"&andd;"],[0,"&ord;"],[1,"&wedbar;"],[6,"&sdote;"],[3,"&simdot;"],[2,{v:"&congdot;",n:824,o:"&ncongdot;"}],[0,"&easter;"],[0,"&apacir;"],[0,{v:"&apE;",n:824,o:"&napE;"}],[0,"&eplus;"],[0,"&pluse;"],[0,"&Esim;"],[0,"&Colone;"],[0,"&Equal;"],[1,"&ddotseq;"],[0,"&equivDD;"],[0,"&ltcir;"],[0,"&gtcir;"],[0,"&ltquest;"],[0,"&gtquest;"],[0,{v:"&leqslant;",n:824,o:"&nleqslant;"}],[0,{v:"&geqslant;",n:824,o:"&ngeqslant;"}],[0,"&lesdot;"],[0,"&gesdot;"],[0,"&lesdoto;"],[0,"&gesdoto;"],[0,"&lesdotor;"],[0,"&gesdotol;"],[0,"&lap;"],[0,"&gap;"],[0,"&lne;"],[0,"&gne;"],[0,"&lnap;"],[0,"&gnap;"],[0,"&lEg;"],[0,"&gEl;"],[0,"&lsime;"],[0,"&gsime;"],[0,"&lsimg;"],[0,"&gsiml;"],[0,"&lgE;"],[0,"&glE;"],[0,"&lesges;"],[0,"&gesles;"],[0,"&els;"],[0,"&egs;"],[0,"&elsdot;"],[0,"&egsdot;"],[0,"&el;"],[0,"&eg;"],[2,"&siml;"],[0,"&simg;"],[0,"&simlE;"],[0,"&simgE;"],[0,{v:"&LessLess;",n:824,o:"&NotNestedLessLess;"}],[0,{v:"&GreaterGreater;",n:824,o:"&NotNestedGreaterGreater;"}],[1,"&glj;"],[0,"&gla;"],[0,"&ltcc;"],[0,"&gtcc;"],[0,"&lescc;"],[0,"&gescc;"],[0,"&smt;"],[0,"&lat;"],[0,{v:"&smte;",n:65024,o:"&smtes;"}],[0,{v:"&late;",n:65024,o:"&lates;"}],[0,"&bumpE;"],[0,{v:"&PrecedesEqual;",n:824,o:"&NotPrecedesEqual;"}],[0,{v:"&sce;",n:824,o:"&NotSucceedsEqual;"}],[2,"&prE;"],[0,"&scE;"],[0,"&precneqq;"],[0,"&scnE;"],[0,"&prap;"],[0,"&scap;"],[0,"&precnapprox;"],[0,"&scnap;"],[0,"&Pr;"],[0,"&Sc;"],[0,"&subdot;"],[0,"&supdot;"],[0,"&subplus;"],[0,"&supplus;"],[0,"&submult;"],[0,"&supmult;"],[0,"&subedot;"],[0,"&supedot;"],[0,{v:"&subE;",n:824,o:"&nsubE;"}],[0,{v:"&supE;",n:824,o:"&nsupE;"}],[0,"&subsim;"],[0,"&supsim;"],[2,{v:"&subnE;",n:65024,o:"&varsubsetneqq;"}],[0,{v:"&supnE;",n:65024,o:"&varsupsetneqq;"}],[2,"&csub;"],[0,"&csup;"],[0,"&csube;"],[0,"&csupe;"],[0,"&subsup;"],[0,"&supsub;"],[0,"&subsub;"],[0,"&supsup;"],[0,"&suphsub;"],[0,"&supdsub;"],[0,"&forkv;"],[0,"&topfork;"],[0,"&mlcp;"],[8,"&Dashv;"],[1,"&Vdashl;"],[0,"&Barv;"],[0,"&vBar;"],[0,"&vBarv;"],[1,"&Vbar;"],[0,"&Not;"],[0,"&bNot;"],[0,"&rnmid;"],[0,"&cirmid;"],[0,"&midcir;"],[0,"&topcir;"],[0,"&nhpar;"],[0,"&parsim;"],[9,{v:"&parsl;",n:8421,o:"&nparsl;"}],[44343,{n:new Map(s([[56476,"&Ascr;"],[1,"&Cscr;"],[0,"&Dscr;"],[2,"&Gscr;"],[2,"&Jscr;"],[0,"&Kscr;"],[2,"&Nscr;"],[0,"&Oscr;"],[0,"&Pscr;"],[0,"&Qscr;"],[1,"&Sscr;"],[0,"&Tscr;"],[0,"&Uscr;"],[0,"&Vscr;"],[0,"&Wscr;"],[0,"&Xscr;"],[0,"&Yscr;"],[0,"&Zscr;"],[0,"&ascr;"],[0,"&bscr;"],[0,"&cscr;"],[0,"&dscr;"],[1,"&fscr;"],[1,"&hscr;"],[0,"&iscr;"],[0,"&jscr;"],[0,"&kscr;"],[0,"&lscr;"],[0,"&mscr;"],[0,"&nscr;"],[1,"&pscr;"],[0,"&qscr;"],[0,"&rscr;"],[0,"&sscr;"],[0,"&tscr;"],[0,"&uscr;"],[0,"&vscr;"],[0,"&wscr;"],[0,"&xscr;"],[0,"&yscr;"],[0,"&zscr;"],[52,"&Afr;"],[0,"&Bfr;"],[1,"&Dfr;"],[0,"&Efr;"],[0,"&Ffr;"],[0,"&Gfr;"],[2,"&Jfr;"],[0,"&Kfr;"],[0,"&Lfr;"],[0,"&Mfr;"],[0,"&Nfr;"],[0,"&Ofr;"],[0,"&Pfr;"],[0,"&Qfr;"],[1,"&Sfr;"],[0,"&Tfr;"],[0,"&Ufr;"],[0,"&Vfr;"],[0,"&Wfr;"],[0,"&Xfr;"],[0,"&Yfr;"],[1,"&afr;"],[0,"&bfr;"],[0,"&cfr;"],[0,"&dfr;"],[0,"&efr;"],[0,"&ffr;"],[0,"&gfr;"],[0,"&hfr;"],[0,"&ifr;"],[0,"&jfr;"],[0,"&kfr;"],[0,"&lfr;"],[0,"&mfr;"],[0,"&nfr;"],[0,"&ofr;"],[0,"&pfr;"],[0,"&qfr;"],[0,"&rfr;"],[0,"&sfr;"],[0,"&tfr;"],[0,"&ufr;"],[0,"&vfr;"],[0,"&wfr;"],[0,"&xfr;"],[0,"&yfr;"],[0,"&zfr;"],[0,"&Aopf;"],[0,"&Bopf;"],[1,"&Dopf;"],[0,"&Eopf;"],[0,"&Fopf;"],[0,"&Gopf;"],[1,"&Iopf;"],[0,"&Jopf;"],[0,"&Kopf;"],[0,"&Lopf;"],[0,"&Mopf;"],[1,"&Oopf;"],[3,"&Sopf;"],[0,"&Topf;"],[0,"&Uopf;"],[0,"&Vopf;"],[0,"&Wopf;"],[0,"&Xopf;"],[0,"&Yopf;"],[1,"&aopf;"],[0,"&bopf;"],[0,"&copf;"],[0,"&dopf;"],[0,"&eopf;"],[0,"&fopf;"],[0,"&gopf;"],[0,"&hopf;"],[0,"&iopf;"],[0,"&jopf;"],[0,"&kopf;"],[0,"&lopf;"],[0,"&mopf;"],[0,"&nopf;"],[0,"&oopf;"],[0,"&popf;"],[0,"&qopf;"],[0,"&ropf;"],[0,"&sopf;"],[0,"&topf;"],[0,"&uopf;"],[0,"&vopf;"],[0,"&wopf;"],[0,"&xopf;"],[0,"&yopf;"],[0,"&zopf;"]]))}],[8906,"&fflig;"],[0,"&filig;"],[0,"&fllig;"],[0,"&ffilig;"],[0,"&ffllig;"]])),encodeHtml}var _escape={},hasRequired_escape;function require_escape(){return hasRequired_escape||(hasRequired_escape=1,function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.escapeText=s.escapeAttribute=s.escapeUTF8=s.escape=s.encodeXML=s.getCodePoint=s.xmlReplacer=void 0,s.xmlReplacer=/["&'<>$\x80-\uFFFF]/g;var a=new Map([[34,"&quot;"],[38,"&amp;"],[39,"&apos;"],[60,"&lt;"],[62,"&gt;"]]);s.getCodePoint=String.prototype.codePointAt!=null?function(f,c){return f.codePointAt(c)}:function(f,c){return(f.charCodeAt(c)&64512)===55296?(f.charCodeAt(c)-55296)*1024+f.charCodeAt(c+1)-56320+65536:f.charCodeAt(c)};function u(f){for(var c="",h=0,p;(p=s.xmlReplacer.exec(f))!==null;){var v=p.index,y=f.charCodeAt(v),b=a.get(y);b!==void 0?(c+=f.substring(h,v)+b,h=v+1):(c+="".concat(f.substring(h,v),"&#x").concat((0,s.getCodePoint)(f,v).toString(16),";"),h=s.xmlReplacer.lastIndex+=+((y&64512)===55296))}return c+f.substr(h)}s.encodeXML=u,s.escape=u;function l(f,c){return function(p){for(var v,y=0,b="";v=f.exec(p);)y!==v.index&&(b+=p.substring(y,v.index)),b+=c.get(v[0].charCodeAt(0)),y=v.index+1;return b+p.substring(y)}}s.escapeUTF8=l(/[&<>'"]/g,a),s.escapeAttribute=l(/["&\u00A0]/g,new Map([[34,"&quot;"],[38,"&amp;"],[160,"&nbsp;"]])),s.escapeText=l(/[&<>\u00A0]/g,new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[160,"&nbsp;"]]))}(_escape)),_escape}var hasRequiredEncode;function requireEncode(){if(hasRequiredEncode)return encode;hasRequiredEncode=1;var s=encode&&encode.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(encode,"__esModule",{value:!0}),encode.encodeNonAsciiHTML=encode.encodeHTML=void 0;var a=s(requireEncodeHtml()),u=require_escape(),l=/[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g;function f(p){return h(l,p)}encode.encodeHTML=f;function c(p){return h(u.xmlReplacer,p)}encode.encodeNonAsciiHTML=c;function h(p,v){for(var y="",b=0,S;(S=p.exec(v))!==null;){var E=S.index;y+=v.substring(b,E);var R=v.charCodeAt(E),O=a.default.get(R);if(typeof O=="object"){if(E+1<v.length){var I=v.charCodeAt(E+1),B=typeof O.n=="number"?O.n===I?O.o:void 0:O.n.get(I);if(B!==void 0){y+=B,b=p.lastIndex+=1;continue}}O=O.v}if(O!==void 0)y+=O,b=E+1;else{var N=(0,u.getCodePoint)(v,E);y+="&#x".concat(N.toString(16),";"),b=p.lastIndex+=+(N!==R)}}return y+v.substr(b)}return encode}var hasRequiredLib$3;function requireLib$3(){return hasRequiredLib$3||(hasRequiredLib$3=1,function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.decodeXMLStrict=s.decodeHTML5Strict=s.decodeHTML4Strict=s.decodeHTML5=s.decodeHTML4=s.decodeHTMLAttribute=s.decodeHTMLStrict=s.decodeHTML=s.decodeXML=s.DecodingMode=s.EntityDecoder=s.encodeHTML5=s.encodeHTML4=s.encodeNonAsciiHTML=s.encodeHTML=s.escapeText=s.escapeAttribute=s.escapeUTF8=s.escape=s.encodeXML=s.encode=s.decodeStrict=s.decode=s.EncodingMode=s.EntityLevel=void 0;var a=requireDecode(),u=requireEncode(),l=require_escape(),f;(function(E){E[E.XML=0]="XML",E[E.HTML=1]="HTML"})(f=s.EntityLevel||(s.EntityLevel={}));var c;(function(E){E[E.UTF8=0]="UTF8",E[E.ASCII=1]="ASCII",E[E.Extensive=2]="Extensive",E[E.Attribute=3]="Attribute",E[E.Text=4]="Text"})(c=s.EncodingMode||(s.EncodingMode={}));function h(E,R){R===void 0&&(R=f.XML);var O=typeof R=="number"?R:R.level;if(O===f.HTML){var I=typeof R=="object"?R.mode:void 0;return(0,a.decodeHTML)(E,I)}return(0,a.decodeXML)(E)}s.decode=h;function p(E,R){var O;R===void 0&&(R=f.XML);var I=typeof R=="number"?{level:R}:R;return(O=I.mode)!==null&&O!==void 0||(I.mode=a.DecodingMode.Strict),h(E,I)}s.decodeStrict=p;function v(E,R){R===void 0&&(R=f.XML);var O=typeof R=="number"?{level:R}:R;return O.mode===c.UTF8?(0,l.escapeUTF8)(E):O.mode===c.Attribute?(0,l.escapeAttribute)(E):O.mode===c.Text?(0,l.escapeText)(E):O.level===f.HTML?O.mode===c.ASCII?(0,u.encodeNonAsciiHTML)(E):(0,u.encodeHTML)(E):(0,l.encodeXML)(E)}s.encode=v;var y=require_escape();Object.defineProperty(s,"encodeXML",{enumerable:!0,get:function(){return y.encodeXML}}),Object.defineProperty(s,"escape",{enumerable:!0,get:function(){return y.escape}}),Object.defineProperty(s,"escapeUTF8",{enumerable:!0,get:function(){return y.escapeUTF8}}),Object.defineProperty(s,"escapeAttribute",{enumerable:!0,get:function(){return y.escapeAttribute}}),Object.defineProperty(s,"escapeText",{enumerable:!0,get:function(){return y.escapeText}});var b=requireEncode();Object.defineProperty(s,"encodeHTML",{enumerable:!0,get:function(){return b.encodeHTML}}),Object.defineProperty(s,"encodeNonAsciiHTML",{enumerable:!0,get:function(){return b.encodeNonAsciiHTML}}),Object.defineProperty(s,"encodeHTML4",{enumerable:!0,get:function(){return b.encodeHTML}}),Object.defineProperty(s,"encodeHTML5",{enumerable:!0,get:function(){return b.encodeHTML}});var S=requireDecode();Object.defineProperty(s,"EntityDecoder",{enumerable:!0,get:function(){return S.EntityDecoder}}),Object.defineProperty(s,"DecodingMode",{enumerable:!0,get:function(){return S.DecodingMode}}),Object.defineProperty(s,"decodeXML",{enumerable:!0,get:function(){return S.decodeXML}}),Object.defineProperty(s,"decodeHTML",{enumerable:!0,get:function(){return S.decodeHTML}}),Object.defineProperty(s,"decodeHTMLStrict",{enumerable:!0,get:function(){return S.decodeHTMLStrict}}),Object.defineProperty(s,"decodeHTMLAttribute",{enumerable:!0,get:function(){return S.decodeHTMLAttribute}}),Object.defineProperty(s,"decodeHTML4",{enumerable:!0,get:function(){return S.decodeHTML}}),Object.defineProperty(s,"decodeHTML5",{enumerable:!0,get:function(){return S.decodeHTML}}),Object.defineProperty(s,"decodeHTML4Strict",{enumerable:!0,get:function(){return S.decodeHTMLStrict}}),Object.defineProperty(s,"decodeHTML5Strict",{enumerable:!0,get:function(){return S.decodeHTMLStrict}}),Object.defineProperty(s,"decodeXMLStrict",{enumerable:!0,get:function(){return S.decodeXML}})}(lib)),lib}var foreignNames={},hasRequiredForeignNames;function requireForeignNames(){return hasRequiredForeignNames||(hasRequiredForeignNames=1,Object.defineProperty(foreignNames,"__esModule",{value:!0}),foreignNames.attributeNames=foreignNames.elementNames=void 0,foreignNames.elementNames=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(function(s){return[s.toLowerCase(),s]})),foreignNames.attributeNames=new Map(["definitionURL","attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(function(s){return[s.toLowerCase(),s]}))),foreignNames}var hasRequiredLib$2;function requireLib$2(){if(hasRequiredLib$2)return lib$1;hasRequiredLib$2=1;var s=lib$1&&lib$1.__assign||function(){return s=Object.assign||function(V){for(var U,te=1,Z=arguments.length;te<Z;te++){U=arguments[te];for(var J in U)Object.prototype.hasOwnProperty.call(U,J)&&(V[J]=U[J])}return V},s.apply(this,arguments)},a=lib$1&&lib$1.__createBinding||(Object.create?function(V,U,te,Z){Z===void 0&&(Z=te);var J=Object.getOwnPropertyDescriptor(U,te);(!J||("get"in J?!U.__esModule:J.writable||J.configurable))&&(J={enumerable:!0,get:function(){return U[te]}}),Object.defineProperty(V,Z,J)}:function(V,U,te,Z){Z===void 0&&(Z=te),V[Z]=U[te]}),u=lib$1&&lib$1.__setModuleDefault||(Object.create?function(V,U){Object.defineProperty(V,"default",{enumerable:!0,value:U})}:function(V,U){V.default=U}),l=lib$1&&lib$1.__importStar||function(V){if(V&&V.__esModule)return V;var U={};if(V!=null)for(var te in V)te!=="default"&&Object.prototype.hasOwnProperty.call(V,te)&&a(U,V,te);return u(U,V),U};Object.defineProperty(lib$1,"__esModule",{value:!0}),lib$1.render=void 0;var f=l(requireLib$5()),c=requireLib$3(),h=requireForeignNames(),p=new Set(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]);function v(V){return V.replace(/"/g,"&quot;")}function y(V,U){var te;if(V){var Z=((te=U.encodeEntities)!==null&&te!==void 0?te:U.decodeEntities)===!1?v:U.xmlMode||U.encodeEntities!=="utf8"?c.encodeXML:c.escapeAttribute;return Object.keys(V).map(function(J){var Q,ee,k=(Q=V[J])!==null&&Q!==void 0?Q:"";return U.xmlMode==="foreign"&&(J=(ee=h.attributeNames.get(J))!==null&&ee!==void 0?ee:J),!U.emptyAttrs&&!U.xmlMode&&k===""?J:"".concat(J,'="').concat(Z(k),'"')}).join(" ")}}var b=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]);function S(V,U){U===void 0&&(U={});for(var te=("length"in V)?V:[V],Z="",J=0;J<te.length;J++)Z+=E(te[J],U);return Z}lib$1.render=S,lib$1.default=S;function E(V,U){switch(V.type){case f.Root:return S(V.children,U);case f.Doctype:case f.Directive:return B(V);case f.Comment:return G(V);case f.CDATA:return D(V);case f.Script:case f.Style:case f.Tag:return I(V,U);case f.Text:return N(V,U)}}var R=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]),O=new Set(["svg","math"]);function I(V,U){var te;U.xmlMode==="foreign"&&(V.name=(te=h.elementNames.get(V.name))!==null&&te!==void 0?te:V.name,V.parent&&R.has(V.parent.name)&&(U=s(s({},U),{xmlMode:!1}))),!U.xmlMode&&O.has(V.name)&&(U=s(s({},U),{xmlMode:"foreign"}));var Z="<".concat(V.name),J=y(V.attribs,U);return J&&(Z+=" ".concat(J)),V.children.length===0&&(U.xmlMode?U.selfClosingTags!==!1:U.selfClosingTags&&b.has(V.name))?(U.xmlMode||(Z+=" "),Z+="/>"):(Z+=">",V.children.length>0&&(Z+=S(V.children,U)),(U.xmlMode||!b.has(V.name))&&(Z+="</".concat(V.name,">"))),Z}function B(V){return"<".concat(V.data,">")}function N(V,U){var te,Z=V.data||"";return((te=U.encodeEntities)!==null&&te!==void 0?te:U.decodeEntities)!==!1&&!(!U.xmlMode&&V.parent&&p.has(V.parent.name))&&(Z=U.xmlMode||U.encodeEntities!=="utf8"?(0,c.encodeXML)(Z):(0,c.escapeText)(Z)),Z}function D(V){return"<![CDATA[".concat(V.children[0].data,"]]>")}function G(V){return"<!--".concat(V.data,"-->")}return lib$1}var hasRequiredStringify$1;function requireStringify$1(){if(hasRequiredStringify$1)return stringify;hasRequiredStringify$1=1;var s=stringify&&stringify.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(stringify,"__esModule",{value:!0}),stringify.innerText=stringify.textContent=stringify.getText=stringify.getInnerHTML=stringify.getOuterHTML=void 0;var a=requireLib$4(),u=s(requireLib$2()),l=requireLib$5();function f(y,b){return(0,u.default)(y,b)}stringify.getOuterHTML=f;function c(y,b){return(0,a.hasChildren)(y)?y.children.map(function(S){return f(S,b)}).join(""):""}stringify.getInnerHTML=c;function h(y){return Array.isArray(y)?y.map(h).join(""):(0,a.isTag)(y)?y.name==="br"?`
`:h(y.children):(0,a.isCDATA)(y)?h(y.children):(0,a.isText)(y)?y.data:""}stringify.getText=h;function p(y){return Array.isArray(y)?y.map(p).join(""):(0,a.hasChildren)(y)&&!(0,a.isComment)(y)?p(y.children):(0,a.isText)(y)?y.data:""}stringify.textContent=p;function v(y){return Array.isArray(y)?y.map(v).join(""):(0,a.hasChildren)(y)&&(y.type===l.ElementType.Tag||(0,a.isCDATA)(y))?v(y.children):(0,a.isText)(y)?y.data:""}return stringify.innerText=v,stringify}var traversal={},hasRequiredTraversal;function requireTraversal(){if(hasRequiredTraversal)return traversal;hasRequiredTraversal=1,Object.defineProperty(traversal,"__esModule",{value:!0}),traversal.prevElementSibling=traversal.nextElementSibling=traversal.getName=traversal.hasAttrib=traversal.getAttributeValue=traversal.getSiblings=traversal.getParent=traversal.getChildren=void 0;var s=requireLib$4();function a(y){return(0,s.hasChildren)(y)?y.children:[]}traversal.getChildren=a;function u(y){return y.parent||null}traversal.getParent=u;function l(y){var b,S,E=u(y);if(E!=null)return a(E);for(var R=[y],O=y.prev,I=y.next;O!=null;)R.unshift(O),b=O,O=b.prev;for(;I!=null;)R.push(I),S=I,I=S.next;return R}traversal.getSiblings=l;function f(y,b){var S;return(S=y.attribs)===null||S===void 0?void 0:S[b]}traversal.getAttributeValue=f;function c(y,b){return y.attribs!=null&&Object.prototype.hasOwnProperty.call(y.attribs,b)&&y.attribs[b]!=null}traversal.hasAttrib=c;function h(y){return y.name}traversal.getName=h;function p(y){for(var b,S=y.next;S!==null&&!(0,s.isTag)(S);)b=S,S=b.next;return S}traversal.nextElementSibling=p;function v(y){for(var b,S=y.prev;S!==null&&!(0,s.isTag)(S);)b=S,S=b.prev;return S}return traversal.prevElementSibling=v,traversal}var manipulation={},hasRequiredManipulation;function requireManipulation(){if(hasRequiredManipulation)return manipulation;hasRequiredManipulation=1,Object.defineProperty(manipulation,"__esModule",{value:!0}),manipulation.prepend=manipulation.prependChild=manipulation.append=manipulation.appendChild=manipulation.replaceElement=manipulation.removeElement=void 0;function s(h){if(h.prev&&(h.prev.next=h.next),h.next&&(h.next.prev=h.prev),h.parent){var p=h.parent.children,v=p.lastIndexOf(h);v>=0&&p.splice(v,1)}h.next=null,h.prev=null,h.parent=null}manipulation.removeElement=s;function a(h,p){var v=p.prev=h.prev;v&&(v.next=p);var y=p.next=h.next;y&&(y.prev=p);var b=p.parent=h.parent;if(b){var S=b.children;S[S.lastIndexOf(h)]=p,h.parent=null}}manipulation.replaceElement=a;function u(h,p){if(s(p),p.next=null,p.parent=h,h.children.push(p)>1){var v=h.children[h.children.length-2];v.next=p,p.prev=v}else p.prev=null}manipulation.appendChild=u;function l(h,p){s(p);var v=h.parent,y=h.next;if(p.next=y,p.prev=h,h.next=p,p.parent=v,y){if(y.prev=p,v){var b=v.children;b.splice(b.lastIndexOf(y),0,p)}}else v&&v.children.push(p)}manipulation.append=l;function f(h,p){if(s(p),p.parent=h,p.prev=null,h.children.unshift(p)!==1){var v=h.children[1];v.prev=p,p.next=v}else p.next=null}manipulation.prependChild=f;function c(h,p){s(p);var v=h.parent;if(v){var y=v.children;y.splice(y.indexOf(h),0,p)}h.prev&&(h.prev.next=p),p.parent=v,p.prev=h.prev,p.next=h,h.prev=p}return manipulation.prepend=c,manipulation}var querying={},hasRequiredQuerying;function requireQuerying(){if(hasRequiredQuerying)return querying;hasRequiredQuerying=1,Object.defineProperty(querying,"__esModule",{value:!0}),querying.findAll=querying.existsOne=querying.findOne=querying.findOneChild=querying.find=querying.filter=void 0;var s=requireLib$4();function a(p,v,y,b){return y===void 0&&(y=!0),b===void 0&&(b=1/0),u(p,Array.isArray(v)?v:[v],y,b)}querying.filter=a;function u(p,v,y,b){for(var S=[],E=[v],R=[0];;){if(R[0]>=E[0].length){if(R.length===1)return S;E.shift(),R.shift();continue}var O=E[0][R[0]++];if(p(O)&&(S.push(O),--b<=0))return S;y&&(0,s.hasChildren)(O)&&O.children.length>0&&(R.unshift(0),E.unshift(O.children))}}querying.find=u;function l(p,v){return v.find(p)}querying.findOneChild=l;function f(p,v,y){y===void 0&&(y=!0);for(var b=null,S=0;S<v.length&&!b;S++){var E=v[S];if((0,s.isTag)(E))p(E)?b=E:y&&E.children.length>0&&(b=f(p,E.children,!0));else continue}return b}querying.findOne=f;function c(p,v){return v.some(function(y){return(0,s.isTag)(y)&&(p(y)||c(p,y.children))})}querying.existsOne=c;function h(p,v){for(var y=[],b=[v],S=[0];;){if(S[0]>=b[0].length){if(b.length===1)return y;b.shift(),S.shift();continue}var E=b[0][S[0]++];(0,s.isTag)(E)&&(p(E)&&y.push(E),E.children.length>0&&(S.unshift(0),b.unshift(E.children)))}}return querying.findAll=h,querying}var legacy={},hasRequiredLegacy;function requireLegacy(){if(hasRequiredLegacy)return legacy;hasRequiredLegacy=1,Object.defineProperty(legacy,"__esModule",{value:!0}),legacy.getElementsByTagType=legacy.getElementsByTagName=legacy.getElementById=legacy.getElements=legacy.testElement=void 0;var s=requireLib$4(),a=requireQuerying(),u={tag_name:function(S){return typeof S=="function"?function(E){return(0,s.isTag)(E)&&S(E.name)}:S==="*"?s.isTag:function(E){return(0,s.isTag)(E)&&E.name===S}},tag_type:function(S){return typeof S=="function"?function(E){return S(E.type)}:function(E){return E.type===S}},tag_contains:function(S){return typeof S=="function"?function(E){return(0,s.isText)(E)&&S(E.data)}:function(E){return(0,s.isText)(E)&&E.data===S}}};function l(S,E){return typeof E=="function"?function(R){return(0,s.isTag)(R)&&E(R.attribs[S])}:function(R){return(0,s.isTag)(R)&&R.attribs[S]===E}}function f(S,E){return function(R){return S(R)||E(R)}}function c(S){var E=Object.keys(S).map(function(R){var O=S[R];return Object.prototype.hasOwnProperty.call(u,R)?u[R](O):l(R,O)});return E.length===0?null:E.reduce(f)}function h(S,E){var R=c(S);return R?R(E):!0}legacy.testElement=h;function p(S,E,R,O){O===void 0&&(O=1/0);var I=c(S);return I?(0,a.filter)(I,E,R,O):[]}legacy.getElements=p;function v(S,E,R){return R===void 0&&(R=!0),Array.isArray(E)||(E=[E]),(0,a.findOne)(l("id",S),E,R)}legacy.getElementById=v;function y(S,E,R,O){return R===void 0&&(R=!0),O===void 0&&(O=1/0),(0,a.filter)(u.tag_name(S),E,R,O)}legacy.getElementsByTagName=y;function b(S,E,R,O){return R===void 0&&(R=!0),O===void 0&&(O=1/0),(0,a.filter)(u.tag_type(S),E,R,O)}return legacy.getElementsByTagType=b,legacy}var helpers={},hasRequiredHelpers;function requireHelpers(){return hasRequiredHelpers||(hasRequiredHelpers=1,function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.uniqueSort=s.compareDocumentPosition=s.DocumentPosition=s.removeSubsets=void 0;var a=requireLib$4();function u(h){for(var p=h.length;--p>=0;){var v=h[p];if(p>0&&h.lastIndexOf(v,p-1)>=0){h.splice(p,1);continue}for(var y=v.parent;y;y=y.parent)if(h.includes(y)){h.splice(p,1);break}}return h}s.removeSubsets=u;var l;(function(h){h[h.DISCONNECTED=1]="DISCONNECTED",h[h.PRECEDING=2]="PRECEDING",h[h.FOLLOWING=4]="FOLLOWING",h[h.CONTAINS=8]="CONTAINS",h[h.CONTAINED_BY=16]="CONTAINED_BY"})(l=s.DocumentPosition||(s.DocumentPosition={}));function f(h,p){var v=[],y=[];if(h===p)return 0;for(var b=(0,a.hasChildren)(h)?h:h.parent;b;)v.unshift(b),b=b.parent;for(b=(0,a.hasChildren)(p)?p:p.parent;b;)y.unshift(b),b=b.parent;for(var S=Math.min(v.length,y.length),E=0;E<S&&v[E]===y[E];)E++;if(E===0)return l.DISCONNECTED;var R=v[E-1],O=R.children,I=v[E],B=y[E];return O.indexOf(I)>O.indexOf(B)?R===p?l.FOLLOWING|l.CONTAINED_BY:l.FOLLOWING:R===h?l.PRECEDING|l.CONTAINS:l.PRECEDING}s.compareDocumentPosition=f;function c(h){return h=h.filter(function(p,v,y){return!y.includes(p,v+1)}),h.sort(function(p,v){var y=f(p,v);return y&l.PRECEDING?-1:y&l.FOLLOWING?1:0}),h}s.uniqueSort=c}(helpers)),helpers}var feeds={},hasRequiredFeeds;function requireFeeds(){if(hasRequiredFeeds)return feeds;hasRequiredFeeds=1,Object.defineProperty(feeds,"__esModule",{value:!0}),feeds.getFeed=void 0;var s=requireStringify$1(),a=requireLegacy();function u(E){var R=v(S,E);return R?R.name==="feed"?l(R):f(R):null}feeds.getFeed=u;function l(E){var R,O=E.children,I={type:"atom",items:(0,a.getElementsByTagName)("entry",O).map(function(D){var G,V=D.children,U={media:p(V)};b(U,"id","id",V),b(U,"title","title",V);var te=(G=v("link",V))===null||G===void 0?void 0:G.attribs.href;te&&(U.link=te);var Z=y("summary",V)||y("content",V);Z&&(U.description=Z);var J=y("updated",V);return J&&(U.pubDate=new Date(J)),U})};b(I,"id","id",O),b(I,"title","title",O);var B=(R=v("link",O))===null||R===void 0?void 0:R.attribs.href;B&&(I.link=B),b(I,"description","subtitle",O);var N=y("updated",O);return N&&(I.updated=new Date(N)),b(I,"author","email",O,!0),I}function f(E){var R,O,I=(O=(R=v("channel",E.children))===null||R===void 0?void 0:R.children)!==null&&O!==void 0?O:[],B={type:E.name.substr(0,3),id:"",items:(0,a.getElementsByTagName)("item",E.children).map(function(D){var G=D.children,V={media:p(G)};b(V,"id","guid",G),b(V,"title","title",G),b(V,"link","link",G),b(V,"description","description",G);var U=y("pubDate",G)||y("dc:date",G);return U&&(V.pubDate=new Date(U)),V})};b(B,"title","title",I),b(B,"link","link",I),b(B,"description","description",I);var N=y("lastBuildDate",I);return N&&(B.updated=new Date(N)),b(B,"author","managingEditor",I,!0),B}var c=["url","type","lang"],h=["fileSize","bitrate","framerate","samplingrate","channels","duration","height","width"];function p(E){return(0,a.getElementsByTagName)("media:content",E).map(function(R){for(var O=R.attribs,I={medium:O.medium,isDefault:!!O.isDefault},B=0,N=c;B<N.length;B++){var D=N[B];O[D]&&(I[D]=O[D])}for(var G=0,V=h;G<V.length;G++){var D=V[G];O[D]&&(I[D]=parseInt(O[D],10))}return O.expression&&(I.expression=O.expression),I})}function v(E,R){return(0,a.getElementsByTagName)(E,R,!0,1)[0]}function y(E,R,O){return O===void 0&&(O=!1),(0,s.textContent)((0,a.getElementsByTagName)(E,R,O,1)).trim()}function b(E,R,O,I,B){B===void 0&&(B=!1);var N=y(O,I,B);N&&(E[R]=N)}function S(E){return E==="rss"||E==="feed"||E==="rdf:RDF"}return feeds}var hasRequiredLib$1;function requireLib$1(){return hasRequiredLib$1||(hasRequiredLib$1=1,function(s){var a=lib$2&&lib$2.__createBinding||(Object.create?function(f,c,h,p){p===void 0&&(p=h);var v=Object.getOwnPropertyDescriptor(c,h);(!v||("get"in v?!c.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return c[h]}}),Object.defineProperty(f,p,v)}:function(f,c,h,p){p===void 0&&(p=h),f[p]=c[h]}),u=lib$2&&lib$2.__exportStar||function(f,c){for(var h in f)h!=="default"&&!Object.prototype.hasOwnProperty.call(c,h)&&a(c,f,h)};Object.defineProperty(s,"__esModule",{value:!0}),s.hasChildren=s.isDocument=s.isComment=s.isText=s.isCDATA=s.isTag=void 0,u(requireStringify$1(),s),u(requireTraversal(),s),u(requireManipulation(),s),u(requireQuerying(),s),u(requireLegacy(),s),u(requireHelpers(),s),u(requireFeeds(),s);var l=requireLib$4();Object.defineProperty(s,"isTag",{enumerable:!0,get:function(){return l.isTag}}),Object.defineProperty(s,"isCDATA",{enumerable:!0,get:function(){return l.isCDATA}}),Object.defineProperty(s,"isText",{enumerable:!0,get:function(){return l.isText}}),Object.defineProperty(s,"isComment",{enumerable:!0,get:function(){return l.isComment}}),Object.defineProperty(s,"isDocument",{enumerable:!0,get:function(){return l.isDocument}}),Object.defineProperty(s,"hasChildren",{enumerable:!0,get:function(){return l.hasChildren}})}(lib$2)),lib$2}var hasRequiredLib;function requireLib(){return hasRequiredLib||(hasRequiredLib=1,function(s){var a=lib$5&&lib$5.__createBinding||(Object.create?function(N,D,G,V){V===void 0&&(V=G);var U=Object.getOwnPropertyDescriptor(D,G);(!U||("get"in U?!D.__esModule:U.writable||U.configurable))&&(U={enumerable:!0,get:function(){return D[G]}}),Object.defineProperty(N,V,U)}:function(N,D,G,V){V===void 0&&(V=G),N[V]=D[G]}),u=lib$5&&lib$5.__setModuleDefault||(Object.create?function(N,D){Object.defineProperty(N,"default",{enumerable:!0,value:D})}:function(N,D){N.default=D}),l=lib$5&&lib$5.__importStar||function(N){if(N&&N.__esModule)return N;var D={};if(N!=null)for(var G in N)G!=="default"&&Object.prototype.hasOwnProperty.call(N,G)&&a(D,N,G);return u(D,N),D},f=lib$5&&lib$5.__importDefault||function(N){return N&&N.__esModule?N:{default:N}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomUtils=s.parseFeed=s.getFeed=s.ElementType=s.Tokenizer=s.createDomStream=s.parseDOM=s.parseDocument=s.DefaultHandler=s.DomHandler=s.Parser=void 0;var c=requireParser$1(),h=requireParser$1();Object.defineProperty(s,"Parser",{enumerable:!0,get:function(){return h.Parser}});var p=requireLib$4(),v=requireLib$4();Object.defineProperty(s,"DomHandler",{enumerable:!0,get:function(){return v.DomHandler}}),Object.defineProperty(s,"DefaultHandler",{enumerable:!0,get:function(){return v.DomHandler}});function y(N,D){var G=new p.DomHandler(void 0,D);return new c.Parser(G,D).end(N),G.root}s.parseDocument=y;function b(N,D){return y(N,D).children}s.parseDOM=b;function S(N,D,G){var V=new p.DomHandler(N,D,G);return new c.Parser(V,D)}s.createDomStream=S;var E=requireTokenizer();Object.defineProperty(s,"Tokenizer",{enumerable:!0,get:function(){return f(E).default}}),s.ElementType=l(requireLib$5());var R=requireLib$1(),O=requireLib$1();Object.defineProperty(s,"getFeed",{enumerable:!0,get:function(){return O.getFeed}});var I={xmlMode:!0};function B(N,D){return D===void 0&&(D=I),(0,R.getFeed)(b(N,D))}s.parseFeed=B,s.DomUtils=l(requireLib$1())}(lib$5)),lib$5}var escapeStringRegexp,hasRequiredEscapeStringRegexp;function requireEscapeStringRegexp(){return hasRequiredEscapeStringRegexp||(hasRequiredEscapeStringRegexp=1,escapeStringRegexp=s=>{if(typeof s!="string")throw new TypeError("Expected a string");return s.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}),escapeStringRegexp}var isPlainObject={},hasRequiredIsPlainObject;function requireIsPlainObject(){if(hasRequiredIsPlainObject)return isPlainObject;hasRequiredIsPlainObject=1,Object.defineProperty(isPlainObject,"__esModule",{value:!0});/*!
 * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
 *
 * Copyright (c) 2014-2017, Jon Schlinkert.
 * Released under the MIT License.
 */function s(u){return Object.prototype.toString.call(u)==="[object Object]"}function a(u){var l,f;return s(u)===!1?!1:(l=u.constructor,l===void 0?!0:(f=l.prototype,!(s(f)===!1||f.hasOwnProperty("isPrototypeOf")===!1)))}return isPlainObject.isPlainObject=a,isPlainObject}var cjs,hasRequiredCjs;function requireCjs(){if(hasRequiredCjs)return cjs;hasRequiredCjs=1;var s=function(D){return a(D)&&!u(D)};function a(N){return!!N&&typeof N=="object"}function u(N){var D=Object.prototype.toString.call(N);return D==="[object RegExp]"||D==="[object Date]"||c(N)}var l=typeof Symbol=="function"&&Symbol.for,f=l?Symbol.for("react.element"):60103;function c(N){return N.$$typeof===f}function h(N){return Array.isArray(N)?[]:{}}function p(N,D){return D.clone!==!1&&D.isMergeableObject(N)?I(h(N),N,D):N}function v(N,D,G){return N.concat(D).map(function(V){return p(V,G)})}function y(N,D){if(!D.customMerge)return I;var G=D.customMerge(N);return typeof G=="function"?G:I}function b(N){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(N).filter(function(D){return Object.propertyIsEnumerable.call(N,D)}):[]}function S(N){return Object.keys(N).concat(b(N))}function E(N,D){try{return D in N}catch{return!1}}function R(N,D){return E(N,D)&&!(Object.hasOwnProperty.call(N,D)&&Object.propertyIsEnumerable.call(N,D))}function O(N,D,G){var V={};return G.isMergeableObject(N)&&S(N).forEach(function(U){V[U]=p(N[U],G)}),S(D).forEach(function(U){R(N,U)||(E(N,U)&&G.isMergeableObject(D[U])?V[U]=y(U,G)(N[U],D[U],G):V[U]=p(D[U],G))}),V}function I(N,D,G){G=G||{},G.arrayMerge=G.arrayMerge||v,G.isMergeableObject=G.isMergeableObject||s,G.cloneUnlessOtherwiseSpecified=p;var V=Array.isArray(D),U=Array.isArray(N),te=V===U;return te?V?G.arrayMerge(N,D,G):O(N,D,G):p(D,G)}I.all=function(D,G){if(!Array.isArray(D))throw new Error("first argument should be an array");return D.reduce(function(V,U){return I(V,U,G)},{})};var B=I;return cjs=B,cjs}var parseSrcset$1={exports:{}},parseSrcset=parseSrcset$1.exports,hasRequiredParseSrcset;function requireParseSrcset(){return hasRequiredParseSrcset||(hasRequiredParseSrcset=1,function(s){(function(a,u){s.exports?s.exports=u():a.parseSrcset=u()})(parseSrcset,function(){return function(a){function u(V){return V===" "||V==="	"||V===`
`||V==="\f"||V==="\r"}function l(V){var U,te=V.exec(a.substring(B));if(te)return U=te[0],B+=U.length,U}for(var f=a.length,c=/^[ \t\n\r\u000c]+/,h=/^[, \t\n\r\u000c]+/,p=/^[^ \t\n\r\u000c]+/,v=/[,]+$/,y=/^\d+$/,b=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/,S,E,R,O,I,B=0,N=[];;){if(l(h),B>=f)return N;S=l(p),E=[],S.slice(-1)===","?(S=S.replace(v,""),G()):D()}function D(){for(l(c),R="",O="in descriptor";;){if(I=a.charAt(B),O==="in descriptor")if(u(I))R&&(E.push(R),R="",O="after descriptor");else if(I===","){B+=1,R&&E.push(R),G();return}else if(I==="(")R=R+I,O="in parens";else if(I===""){R&&E.push(R),G();return}else R=R+I;else if(O==="in parens")if(I===")")R=R+I,O="in descriptor";else if(I===""){E.push(R),G();return}else R=R+I;else if(O==="after descriptor"&&!u(I))if(I===""){G();return}else O="in descriptor",B-=1;B+=1}}function G(){var V=!1,U,te,Z,J,Q={},ee,k,d,g,_;for(J=0;J<E.length;J++)ee=E[J],k=ee[ee.length-1],d=ee.substring(0,ee.length-1),g=parseInt(d,10),_=parseFloat(d),y.test(d)&&k==="w"?((U||te)&&(V=!0),g===0?V=!0:U=g):b.test(d)&&k==="x"?((U||te||Z)&&(V=!0),_<0?V=!0:te=_):y.test(d)&&k==="h"?((Z||te)&&(V=!0),g===0?V=!0:Z=g):V=!0;V?console&&console.log&&console.log("Invalid srcset descriptor found in '"+a+"' at '"+ee+"'."):(Q.url=S,U&&(Q.w=U),te&&(Q.d=te),Z&&(Q.h=Z),N.push(Q))}}})}(parseSrcset$1)),parseSrcset$1.exports}var picocolors_browser={exports:{}},hasRequiredPicocolors_browser;function requirePicocolors_browser(){if(hasRequiredPicocolors_browser)return picocolors_browser.exports;hasRequiredPicocolors_browser=1;var s=String,a=function(){return{isColorSupported:!1,reset:s,bold:s,dim:s,italic:s,underline:s,inverse:s,hidden:s,strikethrough:s,black:s,red:s,green:s,yellow:s,blue:s,magenta:s,cyan:s,white:s,gray:s,bgBlack:s,bgRed:s,bgGreen:s,bgYellow:s,bgBlue:s,bgMagenta:s,bgCyan:s,bgWhite:s,blackBright:s,redBright:s,greenBright:s,yellowBright:s,blueBright:s,magentaBright:s,cyanBright:s,whiteBright:s,bgBlackBright:s,bgRedBright:s,bgGreenBright:s,bgYellowBright:s,bgBlueBright:s,bgMagentaBright:s,bgCyanBright:s,bgWhiteBright:s}};return picocolors_browser.exports=a(),picocolors_browser.exports.createColors=a,picocolors_browser.exports}var cssSyntaxError,hasRequiredCssSyntaxError;function requireCssSyntaxError(){if(hasRequiredCssSyntaxError)return cssSyntaxError;hasRequiredCssSyntaxError=1;let s=requirePicocolors_browser(),a=require$$2$1;class u extends Error{constructor(f,c,h,p,v,y){super(f),this.name="CssSyntaxError",this.reason=f,v&&(this.file=v),p&&(this.source=p),y&&(this.plugin=y),typeof c<"u"&&typeof h<"u"&&(typeof c=="number"?(this.line=c,this.column=h):(this.line=c.line,this.column=c.column,this.endLine=h.line,this.endColumn=h.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,u)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(f){if(!this.source)return"";let c=this.source;f==null&&(f=s.isColorSupported);let h=R=>R,p=R=>R,v=R=>R;if(f){let{bold:R,gray:O,red:I}=s.createColors(!0);p=B=>R(I(B)),h=B=>O(B),a&&(v=B=>a(B))}let y=c.split(/\r?\n/),b=Math.max(this.line-3,0),S=Math.min(this.line+2,y.length),E=String(S).length;return y.slice(b,S).map((R,O)=>{let I=b+1+O,B=" "+(" "+I).slice(-E)+" | ";if(I===this.line){if(R.length>160){let D=20,G=Math.max(0,this.column-D),V=Math.max(this.column+D,this.endColumn+D),U=R.slice(G,V),te=h(B.replace(/\d/g," "))+R.slice(0,Math.min(this.column-1,D-1)).replace(/[^\t]/g," ");return p(">")+h(B)+v(U)+`
 `+te+p("^")}let N=h(B.replace(/\d/g," "))+R.slice(0,this.column-1).replace(/[^\t]/g," ");return p(">")+h(B)+v(R)+`
 `+N+p("^")}return" "+h(B)+v(R)}).join(`
`)}toString(){let f=this.showSourceCode();return f&&(f=`

`+f+`
`),this.name+": "+this.message+f}}return cssSyntaxError=u,u.default=u,cssSyntaxError}var stringifier,hasRequiredStringifier;function requireStringifier(){if(hasRequiredStringifier)return stringifier;hasRequiredStringifier=1;const s={after:`
`,beforeClose:`
`,beforeComment:`
`,beforeDecl:`
`,beforeOpen:" ",beforeRule:`
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:"    ",semicolon:!1};function a(l){return l[0].toUpperCase()+l.slice(1)}class u{constructor(f){this.builder=f}atrule(f,c){let h="@"+f.name,p=f.params?this.rawValue(f,"params"):"";if(typeof f.raws.afterName<"u"?h+=f.raws.afterName:p&&(h+=" "),f.nodes)this.block(f,h+p);else{let v=(f.raws.between||"")+(c?";":"");this.builder(h+p+v,f)}}beforeAfter(f,c){let h;f.type==="decl"?h=this.raw(f,null,"beforeDecl"):f.type==="comment"?h=this.raw(f,null,"beforeComment"):c==="before"?h=this.raw(f,null,"beforeRule"):h=this.raw(f,null,"beforeClose");let p=f.parent,v=0;for(;p&&p.type!=="root";)v+=1,p=p.parent;if(h.includes(`
`)){let y=this.raw(f,null,"indent");if(y.length)for(let b=0;b<v;b++)h+=y}return h}block(f,c){let h=this.raw(f,"between","beforeOpen");this.builder(c+h+"{",f,"start");let p;f.nodes&&f.nodes.length?(this.body(f),p=this.raw(f,"after")):p=this.raw(f,"after","emptyBody"),p&&this.builder(p),this.builder("}",f,"end")}body(f){let c=f.nodes.length-1;for(;c>0&&f.nodes[c].type==="comment";)c-=1;let h=this.raw(f,"semicolon");for(let p=0;p<f.nodes.length;p++){let v=f.nodes[p],y=this.raw(v,"before");y&&this.builder(y),this.stringify(v,c!==p||h)}}comment(f){let c=this.raw(f,"left","commentLeft"),h=this.raw(f,"right","commentRight");this.builder("/*"+c+f.text+h+"*/",f)}decl(f,c){let h=this.raw(f,"between","colon"),p=f.prop+h+this.rawValue(f,"value");f.important&&(p+=f.raws.important||" !important"),c&&(p+=";"),this.builder(p,f)}document(f){this.body(f)}raw(f,c,h){let p;if(h||(h=c),c&&(p=f.raws[c],typeof p<"u"))return p;let v=f.parent;if(h==="before"&&(!v||v.type==="root"&&v.first===f||v&&v.type==="document"))return"";if(!v)return s[h];let y=f.root();if(y.rawCache||(y.rawCache={}),typeof y.rawCache[h]<"u")return y.rawCache[h];if(h==="before"||h==="after")return this.beforeAfter(f,h);{let b="raw"+a(h);this[b]?p=this[b](y,f):y.walk(S=>{if(p=S.raws[c],typeof p<"u")return!1})}return typeof p>"u"&&(p=s[h]),y.rawCache[h]=p,p}rawBeforeClose(f){let c;return f.walk(h=>{if(h.nodes&&h.nodes.length>0&&typeof h.raws.after<"u")return c=h.raws.after,c.includes(`
`)&&(c=c.replace(/[^\n]+$/,"")),!1}),c&&(c=c.replace(/\S/g,"")),c}rawBeforeComment(f,c){let h;return f.walkComments(p=>{if(typeof p.raws.before<"u")return h=p.raws.before,h.includes(`
`)&&(h=h.replace(/[^\n]+$/,"")),!1}),typeof h>"u"?h=this.raw(c,null,"beforeDecl"):h&&(h=h.replace(/\S/g,"")),h}rawBeforeDecl(f,c){let h;return f.walkDecls(p=>{if(typeof p.raws.before<"u")return h=p.raws.before,h.includes(`
`)&&(h=h.replace(/[^\n]+$/,"")),!1}),typeof h>"u"?h=this.raw(c,null,"beforeRule"):h&&(h=h.replace(/\S/g,"")),h}rawBeforeOpen(f){let c;return f.walk(h=>{if(h.type!=="decl"&&(c=h.raws.between,typeof c<"u"))return!1}),c}rawBeforeRule(f){let c;return f.walk(h=>{if(h.nodes&&(h.parent!==f||f.first!==h)&&typeof h.raws.before<"u")return c=h.raws.before,c.includes(`
`)&&(c=c.replace(/[^\n]+$/,"")),!1}),c&&(c=c.replace(/\S/g,"")),c}rawColon(f){let c;return f.walkDecls(h=>{if(typeof h.raws.between<"u")return c=h.raws.between.replace(/[^\s:]/g,""),!1}),c}rawEmptyBody(f){let c;return f.walk(h=>{if(h.nodes&&h.nodes.length===0&&(c=h.raws.after,typeof c<"u"))return!1}),c}rawIndent(f){if(f.raws.indent)return f.raws.indent;let c;return f.walk(h=>{let p=h.parent;if(p&&p!==f&&p.parent&&p.parent===f&&typeof h.raws.before<"u"){let v=h.raws.before.split(`
`);return c=v[v.length-1],c=c.replace(/\S/g,""),!1}}),c}rawSemicolon(f){let c;return f.walk(h=>{if(h.nodes&&h.nodes.length&&h.last.type==="decl"&&(c=h.raws.semicolon,typeof c<"u"))return!1}),c}rawValue(f,c){let h=f[c],p=f.raws[c];return p&&p.value===h?p.raw:h}root(f){this.body(f),f.raws.after&&this.builder(f.raws.after)}rule(f){this.block(f,this.rawValue(f,"selector")),f.raws.ownSemicolon&&this.builder(f.raws.ownSemicolon,f,"end")}stringify(f,c){if(!this[f.type])throw new Error("Unknown AST node type "+f.type+". Maybe you need to change PostCSS stringifier.");this[f.type](f,c)}}return stringifier=u,u.default=u,stringifier}var stringify_1,hasRequiredStringify;function requireStringify(){if(hasRequiredStringify)return stringify_1;hasRequiredStringify=1;let s=requireStringifier();function a(u,l){new s(l).stringify(u)}return stringify_1=a,a.default=a,stringify_1}var symbols={},hasRequiredSymbols;function requireSymbols(){return hasRequiredSymbols||(hasRequiredSymbols=1,symbols.isClean=Symbol("isClean"),symbols.my=Symbol("my")),symbols}var node,hasRequiredNode;function requireNode(){if(hasRequiredNode)return node;hasRequiredNode=1;let s=requireCssSyntaxError(),a=requireStringifier(),u=requireStringify(),{isClean:l,my:f}=requireSymbols();function c(v,y){let b=new v.constructor;for(let S in v){if(!Object.prototype.hasOwnProperty.call(v,S)||S==="proxyCache")continue;let E=v[S],R=typeof E;S==="parent"&&R==="object"?y&&(b[S]=y):S==="source"?b[S]=E:Array.isArray(E)?b[S]=E.map(O=>c(O,b)):(R==="object"&&E!==null&&(E=c(E)),b[S]=E)}return b}function h(v,y){if(y&&typeof y.offset<"u")return y.offset;let b=1,S=1,E=0;for(let R=0;R<v.length;R++){if(S===y.line&&b===y.column){E=R;break}v[R]===`
`?(b=1,S+=1):b+=1}return E}class p{constructor(y={}){this.raws={},this[l]=!1,this[f]=!0;for(let b in y)if(b==="nodes"){this.nodes=[];for(let S of y[b])typeof S.clone=="function"?this.append(S.clone()):this.append(S)}else this[b]=y[b]}addToError(y){if(y.postcssNode=this,y.stack&&this.source&&/\n\s{4}at /.test(y.stack)){let b=this.source;y.stack=y.stack.replace(/\n\s{4}at /,`$&${b.input.from}:${b.start.line}:${b.start.column}$&`)}return y}after(y){return this.parent.insertAfter(this,y),this}assign(y={}){for(let b in y)this[b]=y[b];return this}before(y){return this.parent.insertBefore(this,y),this}cleanRaws(y){delete this.raws.before,delete this.raws.after,y||delete this.raws.between}clone(y={}){let b=c(this);for(let S in y)b[S]=y[S];return b}cloneAfter(y={}){let b=this.clone(y);return this.parent.insertAfter(this,b),b}cloneBefore(y={}){let b=this.clone(y);return this.parent.insertBefore(this,b),b}error(y,b={}){if(this.source){let{end:S,start:E}=this.rangeBy(b);return this.source.input.error(y,{column:E.column,line:E.line},{column:S.column,line:S.line},b)}return new s(y)}getProxyProcessor(){return{get(y,b){return b==="proxyOf"?y:b==="root"?()=>y.root().toProxy():y[b]},set(y,b,S){return y[b]===S||(y[b]=S,(b==="prop"||b==="value"||b==="name"||b==="params"||b==="important"||b==="text")&&y.markDirty()),!0}}}markClean(){this[l]=!0}markDirty(){if(this[l]){this[l]=!1;let y=this;for(;y=y.parent;)y[l]=!1}}next(){if(!this.parent)return;let y=this.parent.index(this);return this.parent.nodes[y+1]}positionBy(y){let b=this.source.start;if(y.index)b=this.positionInside(y.index);else if(y.word){let E=this.source.input.css.slice(h(this.source.input.css,this.source.start),h(this.source.input.css,this.source.end)).indexOf(y.word);E!==-1&&(b=this.positionInside(E))}return b}positionInside(y){let b=this.source.start.column,S=this.source.start.line,E=h(this.source.input.css,this.source.start),R=E+y;for(let O=E;O<R;O++)this.source.input.css[O]===`
`?(b=1,S+=1):b+=1;return{column:b,line:S}}prev(){if(!this.parent)return;let y=this.parent.index(this);return this.parent.nodes[y-1]}rangeBy(y){let b={column:this.source.start.column,line:this.source.start.line},S=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:b.column+1,line:b.line};if(y.word){let R=this.source.input.css.slice(h(this.source.input.css,this.source.start),h(this.source.input.css,this.source.end)).indexOf(y.word);R!==-1&&(b=this.positionInside(R),S=this.positionInside(R+y.word.length))}else y.start?b={column:y.start.column,line:y.start.line}:y.index&&(b=this.positionInside(y.index)),y.end?S={column:y.end.column,line:y.end.line}:typeof y.endIndex=="number"?S=this.positionInside(y.endIndex):y.index&&(S=this.positionInside(y.index+1));return(S.line<b.line||S.line===b.line&&S.column<=b.column)&&(S={column:b.column+1,line:b.line}),{end:S,start:b}}raw(y,b){return new a().raw(this,y,b)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...y){if(this.parent){let b=this,S=!1;for(let E of y)E===this?S=!0:S?(this.parent.insertAfter(b,E),b=E):this.parent.insertBefore(b,E);S||this.remove()}return this}root(){let y=this;for(;y.parent&&y.parent.type!=="document";)y=y.parent;return y}toJSON(y,b){let S={},E=b==null;b=b||new Map;let R=0;for(let O in this){if(!Object.prototype.hasOwnProperty.call(this,O)||O==="parent"||O==="proxyCache")continue;let I=this[O];if(Array.isArray(I))S[O]=I.map(B=>typeof B=="object"&&B.toJSON?B.toJSON(null,b):B);else if(typeof I=="object"&&I.toJSON)S[O]=I.toJSON(null,b);else if(O==="source"){let B=b.get(I.input);B==null&&(B=R,b.set(I.input,R),R++),S[O]={end:I.end,inputId:B,start:I.start}}else S[O]=I}return E&&(S.inputs=[...b.keys()].map(O=>O.toJSON())),S}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(y=u){y.stringify&&(y=y.stringify);let b="";return y(this,S=>{b+=S}),b}warn(y,b,S){let E={node:this};for(let R in S)E[R]=S[R];return y.warn(b,E)}get proxyOf(){return this}}return node=p,p.default=p,node}var comment,hasRequiredComment;function requireComment(){if(hasRequiredComment)return comment;hasRequiredComment=1;let s=requireNode();class a extends s{constructor(l){super(l),this.type="comment"}}return comment=a,a.default=a,comment}var declaration,hasRequiredDeclaration;function requireDeclaration(){if(hasRequiredDeclaration)return declaration;hasRequiredDeclaration=1;let s=requireNode();class a extends s{constructor(l){l&&typeof l.value<"u"&&typeof l.value!="string"&&(l={...l,value:String(l.value)}),super(l),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}}return declaration=a,a.default=a,declaration}var container,hasRequiredContainer;function requireContainer(){if(hasRequiredContainer)return container;hasRequiredContainer=1;let s=requireComment(),a=requireDeclaration(),u=requireNode(),{isClean:l,my:f}=requireSymbols(),c,h,p,v;function y(E){return E.map(R=>(R.nodes&&(R.nodes=y(R.nodes)),delete R.source,R))}function b(E){if(E[l]=!1,E.proxyOf.nodes)for(let R of E.proxyOf.nodes)b(R)}class S extends u{append(...R){for(let O of R){let I=this.normalize(O,this.last);for(let B of I)this.proxyOf.nodes.push(B)}return this.markDirty(),this}cleanRaws(R){if(super.cleanRaws(R),this.nodes)for(let O of this.nodes)O.cleanRaws(R)}each(R){if(!this.proxyOf.nodes)return;let O=this.getIterator(),I,B;for(;this.indexes[O]<this.proxyOf.nodes.length&&(I=this.indexes[O],B=R(this.proxyOf.nodes[I],I),B!==!1);)this.indexes[O]+=1;return delete this.indexes[O],B}every(R){return this.nodes.every(R)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let R=this.lastEach;return this.indexes[R]=0,R}getProxyProcessor(){return{get(R,O){return O==="proxyOf"?R:R[O]?O==="each"||typeof O=="string"&&O.startsWith("walk")?(...I)=>R[O](...I.map(B=>typeof B=="function"?(N,D)=>B(N.toProxy(),D):B)):O==="every"||O==="some"?I=>R[O]((B,...N)=>I(B.toProxy(),...N)):O==="root"?()=>R.root().toProxy():O==="nodes"?R.nodes.map(I=>I.toProxy()):O==="first"||O==="last"?R[O].toProxy():R[O]:R[O]},set(R,O,I){return R[O]===I||(R[O]=I,(O==="name"||O==="params"||O==="selector")&&R.markDirty()),!0}}}index(R){return typeof R=="number"?R:(R.proxyOf&&(R=R.proxyOf),this.proxyOf.nodes.indexOf(R))}insertAfter(R,O){let I=this.index(R),B=this.normalize(O,this.proxyOf.nodes[I]).reverse();I=this.index(R);for(let D of B)this.proxyOf.nodes.splice(I+1,0,D);let N;for(let D in this.indexes)N=this.indexes[D],I<N&&(this.indexes[D]=N+B.length);return this.markDirty(),this}insertBefore(R,O){let I=this.index(R),B=I===0?"prepend":!1,N=this.normalize(O,this.proxyOf.nodes[I],B).reverse();I=this.index(R);for(let G of N)this.proxyOf.nodes.splice(I,0,G);let D;for(let G in this.indexes)D=this.indexes[G],I<=D&&(this.indexes[G]=D+N.length);return this.markDirty(),this}normalize(R,O){if(typeof R=="string")R=y(h(R).nodes);else if(typeof R>"u")R=[];else if(Array.isArray(R)){R=R.slice(0);for(let B of R)B.parent&&B.parent.removeChild(B,"ignore")}else if(R.type==="root"&&this.type!=="document"){R=R.nodes.slice(0);for(let B of R)B.parent&&B.parent.removeChild(B,"ignore")}else if(R.type)R=[R];else if(R.prop){if(typeof R.value>"u")throw new Error("Value field is missed in node creation");typeof R.value!="string"&&(R.value=String(R.value)),R=[new a(R)]}else if(R.selector||R.selectors)R=[new v(R)];else if(R.name)R=[new c(R)];else if(R.text)R=[new s(R)];else throw new Error("Unknown node type in node creation");return R.map(B=>(B[f]||S.rebuild(B),B=B.proxyOf,B.parent&&B.parent.removeChild(B),B[l]&&b(B),B.raws||(B.raws={}),typeof B.raws.before>"u"&&O&&typeof O.raws.before<"u"&&(B.raws.before=O.raws.before.replace(/\S/g,"")),B.parent=this.proxyOf,B))}prepend(...R){R=R.reverse();for(let O of R){let I=this.normalize(O,this.first,"prepend").reverse();for(let B of I)this.proxyOf.nodes.unshift(B);for(let B in this.indexes)this.indexes[B]=this.indexes[B]+I.length}return this.markDirty(),this}push(R){return R.parent=this,this.proxyOf.nodes.push(R),this}removeAll(){for(let R of this.proxyOf.nodes)R.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(R){R=this.index(R),this.proxyOf.nodes[R].parent=void 0,this.proxyOf.nodes.splice(R,1);let O;for(let I in this.indexes)O=this.indexes[I],O>=R&&(this.indexes[I]=O-1);return this.markDirty(),this}replaceValues(R,O,I){return I||(I=O,O={}),this.walkDecls(B=>{O.props&&!O.props.includes(B.prop)||O.fast&&!B.value.includes(O.fast)||(B.value=B.value.replace(R,I))}),this.markDirty(),this}some(R){return this.nodes.some(R)}walk(R){return this.each((O,I)=>{let B;try{B=R(O,I)}catch(N){throw O.addToError(N)}return B!==!1&&O.walk&&(B=O.walk(R)),B})}walkAtRules(R,O){return O?R instanceof RegExp?this.walk((I,B)=>{if(I.type==="atrule"&&R.test(I.name))return O(I,B)}):this.walk((I,B)=>{if(I.type==="atrule"&&I.name===R)return O(I,B)}):(O=R,this.walk((I,B)=>{if(I.type==="atrule")return O(I,B)}))}walkComments(R){return this.walk((O,I)=>{if(O.type==="comment")return R(O,I)})}walkDecls(R,O){return O?R instanceof RegExp?this.walk((I,B)=>{if(I.type==="decl"&&R.test(I.prop))return O(I,B)}):this.walk((I,B)=>{if(I.type==="decl"&&I.prop===R)return O(I,B)}):(O=R,this.walk((I,B)=>{if(I.type==="decl")return O(I,B)}))}walkRules(R,O){return O?R instanceof RegExp?this.walk((I,B)=>{if(I.type==="rule"&&R.test(I.selector))return O(I,B)}):this.walk((I,B)=>{if(I.type==="rule"&&I.selector===R)return O(I,B)}):(O=R,this.walk((I,B)=>{if(I.type==="rule")return O(I,B)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return S.registerParse=E=>{h=E},S.registerRule=E=>{v=E},S.registerAtRule=E=>{c=E},S.registerRoot=E=>{p=E},container=S,S.default=S,S.rebuild=E=>{E.type==="atrule"?Object.setPrototypeOf(E,c.prototype):E.type==="rule"?Object.setPrototypeOf(E,v.prototype):E.type==="decl"?Object.setPrototypeOf(E,a.prototype):E.type==="comment"?Object.setPrototypeOf(E,s.prototype):E.type==="root"&&Object.setPrototypeOf(E,p.prototype),E[f]=!0,E.nodes&&E.nodes.forEach(R=>{S.rebuild(R)})},container}var atRule,hasRequiredAtRule;function requireAtRule(){if(hasRequiredAtRule)return atRule;hasRequiredAtRule=1;let s=requireContainer();class a extends s{constructor(l){super(l),this.type="atrule"}append(...l){return this.proxyOf.nodes||(this.nodes=[]),super.append(...l)}prepend(...l){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...l)}}return atRule=a,a.default=a,s.registerAtRule(a),atRule}var document$1,hasRequiredDocument;function requireDocument(){if(hasRequiredDocument)return document$1;hasRequiredDocument=1;let s=requireContainer(),a,u;class l extends s{constructor(c){super({type:"document",...c}),this.nodes||(this.nodes=[])}toResult(c={}){return new a(new u,this,c).stringify()}}return l.registerLazyResult=f=>{a=f},l.registerProcessor=f=>{u=f},document$1=l,l.default=l,document$1}var nonSecure,hasRequiredNonSecure;function requireNonSecure(){if(hasRequiredNonSecure)return nonSecure;hasRequiredNonSecure=1;let s="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return nonSecure={nanoid:(l=21)=>{let f="",c=l;for(;c--;)f+=s[Math.random()*64|0];return f},customAlphabet:(l,f=21)=>(c=f)=>{let h="",p=c;for(;p--;)h+=l[Math.random()*l.length|0];return h}},nonSecure}var previousMap,hasRequiredPreviousMap;function requirePreviousMap(){if(hasRequiredPreviousMap)return previousMap;hasRequiredPreviousMap=1;let{existsSync:s,readFileSync:a}=require$$2$1,{dirname:u,join:l}=require$$2$1,{SourceMapConsumer:f,SourceMapGenerator:c}=require$$2$1;function h(v){return distExports.Buffer?distExports.Buffer.from(v,"base64").toString():window.atob(v)}class p{constructor(y,b){if(b.map===!1)return;this.loadAnnotation(y),this.inline=this.startWith(this.annotation,"data:");let S=b.map?b.map.prev:void 0,E=this.loadMap(b.from,S);!this.mapFile&&b.from&&(this.mapFile=b.from),this.mapFile&&(this.root=u(this.mapFile)),E&&(this.text=E)}consumer(){return this.consumerCache||(this.consumerCache=new f(this.text)),this.consumerCache}decodeInline(y){let b=/^data:application\/json;charset=utf-?8;base64,/,S=/^data:application\/json;base64,/,E=/^data:application\/json;charset=utf-?8,/,R=/^data:application\/json,/,O=y.match(E)||y.match(R);if(O)return decodeURIComponent(y.substr(O[0].length));let I=y.match(b)||y.match(S);if(I)return h(y.substr(I[0].length));let B=y.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+B)}getAnnotationURL(y){return y.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(y){return typeof y!="object"?!1:typeof y.mappings=="string"||typeof y._mappings=="string"||Array.isArray(y.sections)}loadAnnotation(y){let b=y.match(/\/\*\s*# sourceMappingURL=/g);if(!b)return;let S=y.lastIndexOf(b.pop()),E=y.indexOf("*/",S);S>-1&&E>-1&&(this.annotation=this.getAnnotationURL(y.substring(S,E)))}loadFile(y){if(this.root=u(y),s(y))return this.mapFile=y,a(y,"utf-8").toString().trim()}loadMap(y,b){if(b===!1)return!1;if(b){if(typeof b=="string")return b;if(typeof b=="function"){let S=b(y);if(S){let E=this.loadFile(S);if(!E)throw new Error("Unable to load previous source map: "+S.toString());return E}}else{if(b instanceof f)return c.fromSourceMap(b).toString();if(b instanceof c)return b.toString();if(this.isMap(b))return JSON.stringify(b);throw new Error("Unsupported previous source map format: "+b.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let S=this.annotation;return y&&(S=l(u(y),S)),this.loadFile(S)}}}startWith(y,b){return y?y.substr(0,b.length)===b:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return previousMap=p,p.default=p,previousMap}var input,hasRequiredInput;function requireInput(){if(hasRequiredInput)return input;hasRequiredInput=1;let{nanoid:s}=requireNonSecure(),{isAbsolute:a,resolve:u}=require$$2$1,{SourceMapConsumer:l,SourceMapGenerator:f}=require$$2$1,{fileURLToPath:c,pathToFileURL:h}=require$$2$1,p=requireCssSyntaxError(),v=requirePreviousMap(),y=require$$2$1,b=Symbol("fromOffsetCache"),S=!!(l&&f),E=!!(u&&a);class R{constructor(I,B={}){if(I===null||typeof I>"u"||typeof I=="object"&&!I.toString)throw new Error(`PostCSS received ${I} instead of CSS string`);if(this.css=I.toString(),this.css[0]==="\uFEFF"||this.css[0]==="￾"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,B.from&&(!E||/^\w+:\/\//.test(B.from)||a(B.from)?this.file=B.from:this.file=u(B.from)),E&&S){let N=new v(this.css,B);if(N.text){this.map=N;let D=N.consumer().file;!this.file&&D&&(this.file=this.mapResolve(D))}}this.file||(this.id="<input css "+s(6)+">"),this.map&&(this.map.file=this.from)}error(I,B,N,D={}){let G,V,U;if(B&&typeof B=="object"){let Z=B,J=N;if(typeof Z.offset=="number"){let Q=this.fromOffset(Z.offset);B=Q.line,N=Q.col}else B=Z.line,N=Z.column;if(typeof J.offset=="number"){let Q=this.fromOffset(J.offset);V=Q.line,G=Q.col}else V=J.line,G=J.column}else if(!N){let Z=this.fromOffset(B);B=Z.line,N=Z.col}let te=this.origin(B,N,V,G);return te?U=new p(I,te.endLine===void 0?te.line:{column:te.column,line:te.line},te.endLine===void 0?te.column:{column:te.endColumn,line:te.endLine},te.source,te.file,D.plugin):U=new p(I,V===void 0?B:{column:N,line:B},V===void 0?N:{column:G,line:V},this.css,this.file,D.plugin),U.input={column:N,endColumn:G,endLine:V,line:B,source:this.css},this.file&&(h&&(U.input.url=h(this.file).toString()),U.input.file=this.file),U}fromOffset(I){let B,N;if(this[b])N=this[b];else{let G=this.css.split(`
`);N=new Array(G.length);let V=0;for(let U=0,te=G.length;U<te;U++)N[U]=V,V+=G[U].length+1;this[b]=N}B=N[N.length-1];let D=0;if(I>=B)D=N.length-1;else{let G=N.length-2,V;for(;D<G;)if(V=D+(G-D>>1),I<N[V])G=V-1;else if(I>=N[V+1])D=V+1;else{D=V;break}}return{col:I-N[D]+1,line:D+1}}mapResolve(I){return/^\w+:\/\//.test(I)?I:u(this.map.consumer().sourceRoot||this.map.root||".",I)}origin(I,B,N,D){if(!this.map)return!1;let G=this.map.consumer(),V=G.originalPositionFor({column:B,line:I});if(!V.source)return!1;let U;typeof N=="number"&&(U=G.originalPositionFor({column:D,line:N}));let te;a(V.source)?te=h(V.source):te=new URL(V.source,this.map.consumer().sourceRoot||h(this.map.mapFile));let Z={column:V.column,endColumn:U&&U.column,endLine:U&&U.line,line:V.line,url:te.toString()};if(te.protocol==="file:")if(c)Z.file=c(te);else throw new Error("file: protocol is not available in this PostCSS build");let J=G.sourceContentFor(V.source);return J&&(Z.source=J),Z}toJSON(){let I={};for(let B of["hasBOM","css","file","id"])this[B]!=null&&(I[B]=this[B]);return this.map&&(I.map={...this.map},I.map.consumerCache&&(I.map.consumerCache=void 0)),I}get from(){return this.file||this.id}}return input=R,R.default=R,y&&y.registerInput&&y.registerInput(R),input}var root,hasRequiredRoot;function requireRoot(){if(hasRequiredRoot)return root;hasRequiredRoot=1;let s=requireContainer(),a,u;class l extends s{constructor(c){super(c),this.type="root",this.nodes||(this.nodes=[])}normalize(c,h,p){let v=super.normalize(c);if(h){if(p==="prepend")this.nodes.length>1?h.raws.before=this.nodes[1].raws.before:delete h.raws.before;else if(this.first!==h)for(let y of v)y.raws.before=h.raws.before}return v}removeChild(c,h){let p=this.index(c);return!h&&p===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[p].raws.before),super.removeChild(c)}toResult(c={}){return new a(new u,this,c).stringify()}}return l.registerLazyResult=f=>{a=f},l.registerProcessor=f=>{u=f},root=l,l.default=l,s.registerRoot(l),root}var list_1,hasRequiredList;function requireList(){if(hasRequiredList)return list_1;hasRequiredList=1;let s={comma(a){return s.split(a,[","],!0)},space(a){let u=[" ",`
`,"	"];return s.split(a,u)},split(a,u,l){let f=[],c="",h=!1,p=0,v=!1,y="",b=!1;for(let S of a)b?b=!1:S==="\\"?b=!0:v?S===y&&(v=!1):S==='"'||S==="'"?(v=!0,y=S):S==="("?p+=1:S===")"?p>0&&(p-=1):p===0&&u.includes(S)&&(h=!0),h?(c!==""&&f.push(c.trim()),c="",h=!1):c+=S;return(l||c!=="")&&f.push(c.trim()),f}};return list_1=s,s.default=s,list_1}var rule,hasRequiredRule;function requireRule(){if(hasRequiredRule)return rule;hasRequiredRule=1;let s=requireContainer(),a=requireList();class u extends s{constructor(f){super(f),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return a.comma(this.selector)}set selectors(f){let c=this.selector?this.selector.match(/,\s*/):null,h=c?c[0]:","+this.raw("between","beforeOpen");this.selector=f.join(h)}}return rule=u,u.default=u,s.registerRule(u),rule}var fromJSON_1,hasRequiredFromJSON;function requireFromJSON(){if(hasRequiredFromJSON)return fromJSON_1;hasRequiredFromJSON=1;let s=requireAtRule(),a=requireComment(),u=requireDeclaration(),l=requireInput(),f=requirePreviousMap(),c=requireRoot(),h=requireRule();function p(v,y){if(Array.isArray(v))return v.map(E=>p(E));let{inputs:b,...S}=v;if(b){y=[];for(let E of b){let R={...E,__proto__:l.prototype};R.map&&(R.map={...R.map,__proto__:f.prototype}),y.push(R)}}if(S.nodes&&(S.nodes=v.nodes.map(E=>p(E,y))),S.source){let{inputId:E,...R}=S.source;S.source=R,E!=null&&(S.source.input=y[E])}if(S.type==="root")return new c(S);if(S.type==="decl")return new u(S);if(S.type==="rule")return new h(S);if(S.type==="comment")return new a(S);if(S.type==="atrule")return new s(S);throw new Error("Unknown node type: "+v.type)}return fromJSON_1=p,p.default=p,fromJSON_1}var mapGenerator,hasRequiredMapGenerator;function requireMapGenerator(){if(hasRequiredMapGenerator)return mapGenerator;hasRequiredMapGenerator=1;let{dirname:s,relative:a,resolve:u,sep:l}=require$$2$1,{SourceMapConsumer:f,SourceMapGenerator:c}=require$$2$1,{pathToFileURL:h}=require$$2$1,p=requireInput(),v=!!(f&&c),y=!!(s&&u&&a&&l);class b{constructor(E,R,O,I){this.stringify=E,this.mapOpts=O.map||{},this.root=R,this.opts=O,this.css=I,this.originalCSS=I,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let E;this.isInline()?E="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?E=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?E=this.mapOpts.annotation(this.opts.to,this.root):E=this.outputFile()+".map";let R=`
`;this.css.includes(`\r
`)&&(R=`\r
`),this.css+=R+"/*# sourceMappingURL="+E+" */"}applyPrevMaps(){for(let E of this.previous()){let R=this.toUrl(this.path(E.file)),O=E.root||s(E.file),I;this.mapOpts.sourcesContent===!1?(I=new f(E.text),I.sourcesContent&&(I.sourcesContent=null)):I=E.consumer(),this.map.applySourceMap(I,R,this.toUrl(this.path(O)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let E;for(let R=this.root.nodes.length-1;R>=0;R--)E=this.root.nodes[R],E.type==="comment"&&E.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(R)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),y&&v&&this.isMap())return this.generateMap();{let E="";return this.stringify(this.root,R=>{E+=R}),[E]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let E=this.previous()[0].consumer();E.file=this.outputFile(),this.map=c.fromSourceMap(E,{ignoreInvalidMapping:!0})}else this.map=new c({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new c({file:this.outputFile(),ignoreInvalidMapping:!0});let E=1,R=1,O="<no source>",I={generated:{column:0,line:0},original:{column:0,line:0},source:""},B,N;this.stringify(this.root,(D,G,V)=>{if(this.css+=D,G&&V!=="end"&&(I.generated.line=E,I.generated.column=R-1,G.source&&G.source.start?(I.source=this.sourcePath(G),I.original.line=G.source.start.line,I.original.column=G.source.start.column-1,this.map.addMapping(I)):(I.source=O,I.original.line=1,I.original.column=0,this.map.addMapping(I))),N=D.match(/\n/g),N?(E+=N.length,B=D.lastIndexOf(`
`),R=D.length-B):R+=D.length,G&&V!=="start"){let U=G.parent||{raws:{}};(!(G.type==="decl"||G.type==="atrule"&&!G.nodes)||G!==U.last||U.raws.semicolon)&&(G.source&&G.source.end?(I.source=this.sourcePath(G),I.original.line=G.source.end.line,I.original.column=G.source.end.column-1,I.generated.line=E,I.generated.column=R-2,this.map.addMapping(I)):(I.source=O,I.original.line=1,I.original.column=0,I.generated.line=E,I.generated.column=R-1,this.map.addMapping(I)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(E=>E.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let E=this.mapOpts.annotation;return typeof E<"u"&&E!==!0?!1:this.previous().length?this.previous().some(R=>R.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(E=>E.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(E){if(this.mapOpts.absolute||E.charCodeAt(0)===60||/^\w+:\/\//.test(E))return E;let R=this.memoizedPaths.get(E);if(R)return R;let O=this.opts.to?s(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(O=s(u(O,this.mapOpts.annotation)));let I=a(O,E);return this.memoizedPaths.set(E,I),I}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(E=>{if(E.source&&E.source.input.map){let R=E.source.input.map;this.previousMaps.includes(R)||this.previousMaps.push(R)}});else{let E=new p(this.originalCSS,this.opts);E.map&&this.previousMaps.push(E.map)}return this.previousMaps}setSourcesContent(){let E={};if(this.root)this.root.walk(R=>{if(R.source){let O=R.source.input.from;if(O&&!E[O]){E[O]=!0;let I=this.usesFileUrls?this.toFileUrl(O):this.toUrl(this.path(O));this.map.setSourceContent(I,R.source.input.css)}}});else if(this.css){let R=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(R,this.css)}}sourcePath(E){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(E.source.input.from):this.toUrl(this.path(E.source.input.from))}toBase64(E){return distExports.Buffer?distExports.Buffer.from(E).toString("base64"):window.btoa(unescape(encodeURIComponent(E)))}toFileUrl(E){let R=this.memoizedFileURLs.get(E);if(R)return R;if(h){let O=h(E).toString();return this.memoizedFileURLs.set(E,O),O}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(E){let R=this.memoizedURLs.get(E);if(R)return R;l==="\\"&&(E=E.replace(/\\/g,"/"));let O=encodeURI(E).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(E,O),O}}return mapGenerator=b,mapGenerator}var tokenize,hasRequiredTokenize;function requireTokenize(){if(hasRequiredTokenize)return tokenize;hasRequiredTokenize=1;const s=39,a=34,u=92,l=47,f=10,c=32,h=12,p=9,v=13,y=91,b=93,S=40,E=41,R=123,O=125,I=59,B=42,N=58,D=64,G=/[\t\n\f\r "#'()/;[\\\]{}]/g,V=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,U=/.[\r\n"'(/\\]/,te=/[\da-f]/i;return tokenize=function(J,Q={}){let ee=J.css.valueOf(),k=Q.ignoreErrors,d,g,_,w,x,P,$,T,m,M,W=ee.length,Y=0,ue=[],ge=[];function he(){return Y}function ae(le){throw J.error("Unclosed "+le,Y)}function de(){return ge.length===0&&Y>=W}function pe(le){if(ge.length)return ge.pop();if(Y>=W)return;let me=le?le.ignoreUnclosed:!1;switch(d=ee.charCodeAt(Y),d){case f:case c:case p:case v:case h:{w=Y;do w+=1,d=ee.charCodeAt(w);while(d===c||d===f||d===p||d===v||d===h);P=["space",ee.slice(Y,w)],Y=w-1;break}case y:case b:case R:case O:case N:case I:case E:{let xe=String.fromCharCode(d);P=[xe,xe,Y];break}case S:{if(M=ue.length?ue.pop()[1]:"",m=ee.charCodeAt(Y+1),M==="url"&&m!==s&&m!==a&&m!==c&&m!==f&&m!==p&&m!==h&&m!==v){w=Y;do{if($=!1,w=ee.indexOf(")",w+1),w===-1)if(k||me){w=Y;break}else ae("bracket");for(T=w;ee.charCodeAt(T-1)===u;)T-=1,$=!$}while($);P=["brackets",ee.slice(Y,w+1),Y,w],Y=w}else w=ee.indexOf(")",Y+1),g=ee.slice(Y,w+1),w===-1||U.test(g)?P=["(","(",Y]:(P=["brackets",g,Y,w],Y=w);break}case s:case a:{x=d===s?"'":'"',w=Y;do{if($=!1,w=ee.indexOf(x,w+1),w===-1)if(k||me){w=Y+1;break}else ae("string");for(T=w;ee.charCodeAt(T-1)===u;)T-=1,$=!$}while($);P=["string",ee.slice(Y,w+1),Y,w],Y=w;break}case D:{G.lastIndex=Y+1,G.test(ee),G.lastIndex===0?w=ee.length-1:w=G.lastIndex-2,P=["at-word",ee.slice(Y,w+1),Y,w],Y=w;break}case u:{for(w=Y,_=!0;ee.charCodeAt(w+1)===u;)w+=1,_=!_;if(d=ee.charCodeAt(w+1),_&&d!==l&&d!==c&&d!==f&&d!==p&&d!==v&&d!==h&&(w+=1,te.test(ee.charAt(w)))){for(;te.test(ee.charAt(w+1));)w+=1;ee.charCodeAt(w+1)===c&&(w+=1)}P=["word",ee.slice(Y,w+1),Y,w],Y=w;break}default:{d===l&&ee.charCodeAt(Y+1)===B?(w=ee.indexOf("*/",Y+2)+1,w===0&&(k||me?w=ee.length:ae("comment")),P=["comment",ee.slice(Y,w+1),Y,w],Y=w):(V.lastIndex=Y+1,V.test(ee),V.lastIndex===0?w=ee.length-1:w=V.lastIndex-2,P=["word",ee.slice(Y,w+1),Y,w],ue.push(P),Y=w);break}}return Y++,P}function oe(le){ge.push(le)}return{back:oe,endOfFile:de,nextToken:pe,position:he}},tokenize}var parser,hasRequiredParser;function requireParser(){if(hasRequiredParser)return parser;hasRequiredParser=1;let s=requireAtRule(),a=requireComment(),u=requireDeclaration(),l=requireRoot(),f=requireRule(),c=requireTokenize();const h={empty:!0,space:!0};function p(y){for(let b=y.length-1;b>=0;b--){let S=y[b],E=S[3]||S[2];if(E)return E}}class v{constructor(b){this.input=b,this.root=new l,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:b,start:{column:1,line:1,offset:0}}}atrule(b){let S=new s;S.name=b[1].slice(1),S.name===""&&this.unnamedAtrule(S,b),this.init(S,b[2]);let E,R,O,I=!1,B=!1,N=[],D=[];for(;!this.tokenizer.endOfFile();){if(b=this.tokenizer.nextToken(),E=b[0],E==="("||E==="["?D.push(E==="("?")":"]"):E==="{"&&D.length>0?D.push("}"):E===D[D.length-1]&&D.pop(),D.length===0)if(E===";"){S.source.end=this.getPosition(b[2]),S.source.end.offset++,this.semicolon=!0;break}else if(E==="{"){B=!0;break}else if(E==="}"){if(N.length>0){for(O=N.length-1,R=N[O];R&&R[0]==="space";)R=N[--O];R&&(S.source.end=this.getPosition(R[3]||R[2]),S.source.end.offset++)}this.end(b);break}else N.push(b);else N.push(b);if(this.tokenizer.endOfFile()){I=!0;break}}S.raws.between=this.spacesAndCommentsFromEnd(N),N.length?(S.raws.afterName=this.spacesAndCommentsFromStart(N),this.raw(S,"params",N),I&&(b=N[N.length-1],S.source.end=this.getPosition(b[3]||b[2]),S.source.end.offset++,this.spaces=S.raws.between,S.raws.between="")):(S.raws.afterName="",S.params=""),B&&(S.nodes=[],this.current=S)}checkMissedSemicolon(b){let S=this.colon(b);if(S===!1)return;let E=0,R;for(let O=S-1;O>=0&&(R=b[O],!(R[0]!=="space"&&(E+=1,E===2)));O--);throw this.input.error("Missed semicolon",R[0]==="word"?R[3]+1:R[2])}colon(b){let S=0,E,R,O;for(let[I,B]of b.entries()){if(R=B,O=R[0],O==="("&&(S+=1),O===")"&&(S-=1),S===0&&O===":")if(!E)this.doubleColon(R);else{if(E[0]==="word"&&E[1]==="progid")continue;return I}E=R}return!1}comment(b){let S=new a;this.init(S,b[2]),S.source.end=this.getPosition(b[3]||b[2]),S.source.end.offset++;let E=b[1].slice(2,-2);if(/^\s*$/.test(E))S.text="",S.raws.left=E,S.raws.right="";else{let R=E.match(/^(\s*)([^]*\S)(\s*)$/);S.text=R[2],S.raws.left=R[1],S.raws.right=R[3]}}createTokenizer(){this.tokenizer=c(this.input)}decl(b,S){let E=new u;this.init(E,b[0][2]);let R=b[b.length-1];for(R[0]===";"&&(this.semicolon=!0,b.pop()),E.source.end=this.getPosition(R[3]||R[2]||p(b)),E.source.end.offset++;b[0][0]!=="word";)b.length===1&&this.unknownWord(b),E.raws.before+=b.shift()[1];for(E.source.start=this.getPosition(b[0][2]),E.prop="";b.length;){let D=b[0][0];if(D===":"||D==="space"||D==="comment")break;E.prop+=b.shift()[1]}E.raws.between="";let O;for(;b.length;)if(O=b.shift(),O[0]===":"){E.raws.between+=O[1];break}else O[0]==="word"&&/\w/.test(O[1])&&this.unknownWord([O]),E.raws.between+=O[1];(E.prop[0]==="_"||E.prop[0]==="*")&&(E.raws.before+=E.prop[0],E.prop=E.prop.slice(1));let I=[],B;for(;b.length&&(B=b[0][0],!(B!=="space"&&B!=="comment"));)I.push(b.shift());this.precheckMissedSemicolon(b);for(let D=b.length-1;D>=0;D--){if(O=b[D],O[1].toLowerCase()==="!important"){E.important=!0;let G=this.stringFrom(b,D);G=this.spacesFromEnd(b)+G,G!==" !important"&&(E.raws.important=G);break}else if(O[1].toLowerCase()==="important"){let G=b.slice(0),V="";for(let U=D;U>0;U--){let te=G[U][0];if(V.trim().startsWith("!")&&te!=="space")break;V=G.pop()[1]+V}V.trim().startsWith("!")&&(E.important=!0,E.raws.important=V,b=G)}if(O[0]!=="space"&&O[0]!=="comment")break}b.some(D=>D[0]!=="space"&&D[0]!=="comment")&&(E.raws.between+=I.map(D=>D[1]).join(""),I=[]),this.raw(E,"value",I.concat(b),S),E.value.includes(":")&&!S&&this.checkMissedSemicolon(b)}doubleColon(b){throw this.input.error("Double colon",{offset:b[2]},{offset:b[2]+b[1].length})}emptyRule(b){let S=new f;this.init(S,b[2]),S.selector="",S.raws.between="",this.current=S}end(b){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(b[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(b)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(b){if(this.spaces+=b[1],this.current.nodes){let S=this.current.nodes[this.current.nodes.length-1];S&&S.type==="rule"&&!S.raws.ownSemicolon&&(S.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(b){let S=this.input.fromOffset(b);return{column:S.col,line:S.line,offset:b}}init(b,S){this.current.push(b),b.source={input:this.input,start:this.getPosition(S)},b.raws.before=this.spaces,this.spaces="",b.type!=="comment"&&(this.semicolon=!1)}other(b){let S=!1,E=null,R=!1,O=null,I=[],B=b[1].startsWith("--"),N=[],D=b;for(;D;){if(E=D[0],N.push(D),E==="("||E==="[")O||(O=D),I.push(E==="("?")":"]");else if(B&&R&&E==="{")O||(O=D),I.push("}");else if(I.length===0)if(E===";")if(R){this.decl(N,B);return}else break;else if(E==="{"){this.rule(N);return}else if(E==="}"){this.tokenizer.back(N.pop()),S=!0;break}else E===":"&&(R=!0);else E===I[I.length-1]&&(I.pop(),I.length===0&&(O=null));D=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(S=!0),I.length>0&&this.unclosedBracket(O),S&&R){if(!B)for(;N.length&&(D=N[N.length-1][0],!(D!=="space"&&D!=="comment"));)this.tokenizer.back(N.pop());this.decl(N,B)}else this.unknownWord(N)}parse(){let b;for(;!this.tokenizer.endOfFile();)switch(b=this.tokenizer.nextToken(),b[0]){case"space":this.spaces+=b[1];break;case";":this.freeSemicolon(b);break;case"}":this.end(b);break;case"comment":this.comment(b);break;case"at-word":this.atrule(b);break;case"{":this.emptyRule(b);break;default:this.other(b);break}this.endFile()}precheckMissedSemicolon(){}raw(b,S,E,R){let O,I,B=E.length,N="",D=!0,G,V;for(let U=0;U<B;U+=1)O=E[U],I=O[0],I==="space"&&U===B-1&&!R?D=!1:I==="comment"?(V=E[U-1]?E[U-1][0]:"empty",G=E[U+1]?E[U+1][0]:"empty",!h[V]&&!h[G]?N.slice(-1)===","?D=!1:N+=O[1]:D=!1):N+=O[1];if(!D){let U=E.reduce((te,Z)=>te+Z[1],"");b.raws[S]={raw:U,value:N}}b[S]=N}rule(b){b.pop();let S=new f;this.init(S,b[0][2]),S.raws.between=this.spacesAndCommentsFromEnd(b),this.raw(S,"selector",b),this.current=S}spacesAndCommentsFromEnd(b){let S,E="";for(;b.length&&(S=b[b.length-1][0],!(S!=="space"&&S!=="comment"));)E=b.pop()[1]+E;return E}spacesAndCommentsFromStart(b){let S,E="";for(;b.length&&(S=b[0][0],!(S!=="space"&&S!=="comment"));)E+=b.shift()[1];return E}spacesFromEnd(b){let S,E="";for(;b.length&&(S=b[b.length-1][0],S==="space");)E=b.pop()[1]+E;return E}stringFrom(b,S){let E="";for(let R=S;R<b.length;R++)E+=b[R][1];return b.splice(S,b.length-S),E}unclosedBlock(){let b=this.current.source.start;throw this.input.error("Unclosed block",b.line,b.column)}unclosedBracket(b){throw this.input.error("Unclosed bracket",{offset:b[2]},{offset:b[2]+1})}unexpectedClose(b){throw this.input.error("Unexpected }",{offset:b[2]},{offset:b[2]+1})}unknownWord(b){throw this.input.error("Unknown word",{offset:b[0][2]},{offset:b[0][2]+b[0][1].length})}unnamedAtrule(b,S){throw this.input.error("At-rule without name",{offset:S[2]},{offset:S[2]+S[1].length})}}return parser=v,parser}var parse_1$1,hasRequiredParse$1;function requireParse$1(){if(hasRequiredParse$1)return parse_1$1;hasRequiredParse$1=1;let s=requireContainer(),a=requireInput(),u=requireParser();function l(f,c){let h=new a(f,c),p=new u(h);try{p.parse()}catch(v){throw v}return p.root}return parse_1$1=l,l.default=l,s.registerParse(l),parse_1$1}var warning,hasRequiredWarning;function requireWarning(){if(hasRequiredWarning)return warning;hasRequiredWarning=1;class s{constructor(u,l={}){if(this.type="warning",this.text=u,l.node&&l.node.source){let f=l.node.rangeBy(l);this.line=f.start.line,this.column=f.start.column,this.endLine=f.end.line,this.endColumn=f.end.column}for(let f in l)this[f]=l[f]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}return warning=s,s.default=s,warning}var result,hasRequiredResult;function requireResult(){if(hasRequiredResult)return result;hasRequiredResult=1;let s=requireWarning();class a{constructor(l,f,c){this.processor=l,this.messages=[],this.root=f,this.opts=c,this.css=void 0,this.map=void 0}toString(){return this.css}warn(l,f={}){f.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(f.plugin=this.lastPlugin.postcssPlugin);let c=new s(l,f);return this.messages.push(c),c}warnings(){return this.messages.filter(l=>l.type==="warning")}get content(){return this.css}}return result=a,a.default=a,result}var lazyResult,hasRequiredLazyResult;function requireLazyResult(){if(hasRequiredLazyResult)return lazyResult;hasRequiredLazyResult=1;let s=requireContainer(),a=requireDocument(),u=requireMapGenerator(),l=requireParse$1(),f=requireResult(),c=requireRoot(),h=requireStringify(),{isClean:p,my:v}=requireSymbols();const y={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},b={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},S={Once:!0,postcssPlugin:!0,prepare:!0},E=0;function R(G){return typeof G=="object"&&typeof G.then=="function"}function O(G){let V=!1,U=y[G.type];return G.type==="decl"?V=G.prop.toLowerCase():G.type==="atrule"&&(V=G.name.toLowerCase()),V&&G.append?[U,U+"-"+V,E,U+"Exit",U+"Exit-"+V]:V?[U,U+"-"+V,U+"Exit",U+"Exit-"+V]:G.append?[U,E,U+"Exit"]:[U,U+"Exit"]}function I(G){let V;return G.type==="document"?V=["Document",E,"DocumentExit"]:G.type==="root"?V=["Root",E,"RootExit"]:V=O(G),{eventIndex:0,events:V,iterator:0,node:G,visitorIndex:0,visitors:[]}}function B(G){return G[p]=!1,G.nodes&&G.nodes.forEach(V=>B(V)),G}let N={};class D{constructor(V,U,te){this.stringified=!1,this.processed=!1;let Z;if(typeof U=="object"&&U!==null&&(U.type==="root"||U.type==="document"))Z=B(U);else if(U instanceof D||U instanceof f)Z=B(U.root),U.map&&(typeof te.map>"u"&&(te.map={}),te.map.inline||(te.map.inline=!1),te.map.prev=U.map);else{let J=l;te.syntax&&(J=te.syntax.parse),te.parser&&(J=te.parser),J.parse&&(J=J.parse);try{Z=J(U,te)}catch(Q){this.processed=!0,this.error=Q}Z&&!Z[v]&&s.rebuild(Z)}this.result=new f(V,Z,te),this.helpers={...N,postcss:N,result:this.result},this.plugins=this.processor.plugins.map(J=>typeof J=="object"&&J.prepare?{...J,...J.prepare(this.result)}:J)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(V){return this.async().catch(V)}finally(V){return this.async().then(V,V)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(V,U){let te=this.result.lastPlugin;try{U&&U.addToError(V),this.error=V,V.name==="CssSyntaxError"&&!V.plugin?(V.plugin=te.postcssPlugin,V.setMessage()):te.postcssVersion}catch(Z){console&&console.error&&console.error(Z)}return V}prepareVisitors(){this.listeners={};let V=(U,te,Z)=>{this.listeners[te]||(this.listeners[te]=[]),this.listeners[te].push([U,Z])};for(let U of this.plugins)if(typeof U=="object")for(let te in U){if(!b[te]&&/^[A-Z]/.test(te))throw new Error(`Unknown event ${te} in ${U.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!S[te])if(typeof U[te]=="object")for(let Z in U[te])Z==="*"?V(U,te,U[te][Z]):V(U,te+"-"+Z.toLowerCase(),U[te][Z]);else typeof U[te]=="function"&&V(U,te,U[te])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let V=0;V<this.plugins.length;V++){let U=this.plugins[V],te=this.runOnRoot(U);if(R(te))try{await te}catch(Z){throw this.handleError(Z)}}if(this.prepareVisitors(),this.hasListener){let V=this.result.root;for(;!V[p];){V[p]=!0;let U=[I(V)];for(;U.length>0;){let te=this.visitTick(U);if(R(te))try{await te}catch(Z){let J=U[U.length-1].node;throw this.handleError(Z,J)}}}if(this.listeners.OnceExit)for(let[U,te]of this.listeners.OnceExit){this.result.lastPlugin=U;try{if(V.type==="document"){let Z=V.nodes.map(J=>te(J,this.helpers));await Promise.all(Z)}else await te(V,this.helpers)}catch(Z){throw this.handleError(Z)}}}return this.processed=!0,this.stringify()}runOnRoot(V){this.result.lastPlugin=V;try{if(typeof V=="object"&&V.Once){if(this.result.root.type==="document"){let U=this.result.root.nodes.map(te=>V.Once(te,this.helpers));return R(U[0])?Promise.all(U):U}return V.Once(this.result.root,this.helpers)}else if(typeof V=="function")return V(this.result.root,this.result)}catch(U){throw this.handleError(U)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let V=this.result.opts,U=h;V.syntax&&(U=V.syntax.stringify),V.stringifier&&(U=V.stringifier),U.stringify&&(U=U.stringify);let Z=new u(U,this.result.root,this.result.opts).generate();return this.result.css=Z[0],this.result.map=Z[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let V of this.plugins){let U=this.runOnRoot(V);if(R(U))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let V=this.result.root;for(;!V[p];)V[p]=!0,this.walkSync(V);if(this.listeners.OnceExit)if(V.type==="document")for(let U of V.nodes)this.visitSync(this.listeners.OnceExit,U);else this.visitSync(this.listeners.OnceExit,V)}return this.result}then(V,U){return this.async().then(V,U)}toString(){return this.css}visitSync(V,U){for(let[te,Z]of V){this.result.lastPlugin=te;let J;try{J=Z(U,this.helpers)}catch(Q){throw this.handleError(Q,U.proxyOf)}if(U.type!=="root"&&U.type!=="document"&&!U.parent)return!0;if(R(J))throw this.getAsyncError()}}visitTick(V){let U=V[V.length-1],{node:te,visitors:Z}=U;if(te.type!=="root"&&te.type!=="document"&&!te.parent){V.pop();return}if(Z.length>0&&U.visitorIndex<Z.length){let[Q,ee]=Z[U.visitorIndex];U.visitorIndex+=1,U.visitorIndex===Z.length&&(U.visitors=[],U.visitorIndex=0),this.result.lastPlugin=Q;try{return ee(te.toProxy(),this.helpers)}catch(k){throw this.handleError(k,te)}}if(U.iterator!==0){let Q=U.iterator,ee;for(;ee=te.nodes[te.indexes[Q]];)if(te.indexes[Q]+=1,!ee[p]){ee[p]=!0,V.push(I(ee));return}U.iterator=0,delete te.indexes[Q]}let J=U.events;for(;U.eventIndex<J.length;){let Q=J[U.eventIndex];if(U.eventIndex+=1,Q===E){te.nodes&&te.nodes.length&&(te[p]=!0,U.iterator=te.getIterator());return}else if(this.listeners[Q]){U.visitors=this.listeners[Q];return}}V.pop()}walkSync(V){V[p]=!0;let U=O(V);for(let te of U)if(te===E)V.nodes&&V.each(Z=>{Z[p]||this.walkSync(Z)});else{let Z=this.listeners[te];if(Z&&this.visitSync(Z,V.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return D.registerPostcss=G=>{N=G},lazyResult=D,D.default=D,c.registerLazyResult(D),a.registerLazyResult(D),lazyResult}var noWorkResult,hasRequiredNoWorkResult;function requireNoWorkResult(){if(hasRequiredNoWorkResult)return noWorkResult;hasRequiredNoWorkResult=1;let s=requireMapGenerator(),a=requireParse$1();const u=requireResult();let l=requireStringify();class f{constructor(h,p,v){p=p.toString(),this.stringified=!1,this._processor=h,this._css=p,this._opts=v,this._map=void 0;let y,b=l;this.result=new u(this._processor,y,this._opts),this.result.css=p;let S=this;Object.defineProperty(this.result,"root",{get(){return S.root}});let E=new s(b,y,this._opts,p);if(E.isMap()){let[R,O]=E.generate();R&&(this.result.css=R),O&&(this.result.map=O)}else E.clearAnnotation(),this.result.css=E.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(h){return this.async().catch(h)}finally(h){return this.async().then(h,h)}sync(){if(this.error)throw this.error;return this.result}then(h,p){return this.async().then(h,p)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let h,p=a;try{h=p(this._css,this._opts)}catch(v){this.error=v}if(this.error)throw this.error;return this._root=h,h}get[Symbol.toStringTag](){return"NoWorkResult"}}return noWorkResult=f,f.default=f,noWorkResult}var processor,hasRequiredProcessor;function requireProcessor(){if(hasRequiredProcessor)return processor;hasRequiredProcessor=1;let s=requireDocument(),a=requireLazyResult(),u=requireNoWorkResult(),l=requireRoot();class f{constructor(h=[]){this.version="8.4.49",this.plugins=this.normalize(h)}normalize(h){let p=[];for(let v of h)if(v.postcss===!0?v=v():v.postcss&&(v=v.postcss),typeof v=="object"&&Array.isArray(v.plugins))p=p.concat(v.plugins);else if(typeof v=="object"&&v.postcssPlugin)p.push(v);else if(typeof v=="function")p.push(v);else if(!(typeof v=="object"&&(v.parse||v.stringify)))throw new Error(v+" is not a PostCSS plugin");return p}process(h,p={}){return!this.plugins.length&&!p.parser&&!p.stringifier&&!p.syntax?new u(this,h,p):new a(this,h,p)}use(h){return this.plugins=this.plugins.concat(this.normalize([h])),this}}return processor=f,f.default=f,l.registerProcessor(f),s.registerProcessor(f),processor}var postcss_1,hasRequiredPostcss;function requirePostcss(){if(hasRequiredPostcss)return postcss_1;hasRequiredPostcss=1;var s={};let a=requireAtRule(),u=requireComment(),l=requireContainer(),f=requireCssSyntaxError(),c=requireDeclaration(),h=requireDocument(),p=requireFromJSON(),v=requireInput(),y=requireLazyResult(),b=requireList(),S=requireNode(),E=requireParse$1(),R=requireProcessor(),O=requireResult(),I=requireRoot(),B=requireRule(),N=requireStringify(),D=requireWarning();function G(...V){return V.length===1&&Array.isArray(V[0])&&(V=V[0]),new R(V)}return G.plugin=function(U,te){let Z=!1;function J(...ee){console&&console.warn&&!Z&&(Z=!0,console.warn(U+`: postcss.plugin was deprecated. Migration guide:
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),s.LANG&&s.LANG.startsWith("cn")&&console.warn(U+`: 里面 postcss.plugin 被弃用. 迁移指南:
https://www.w3ctech.com/topic/2226`));let k=te(...ee);return k.postcssPlugin=U,k.postcssVersion=new R().version,k}let Q;return Object.defineProperty(J,"postcss",{get(){return Q||(Q=J()),Q}}),J.process=function(ee,k,d){return G([J(d)]).process(ee,k)},J},G.stringify=N,G.parse=E,G.fromJSON=p,G.list=b,G.comment=V=>new u(V),G.atRule=V=>new a(V),G.decl=V=>new c(V),G.rule=V=>new B(V),G.root=V=>new I(V),G.document=V=>new h(V),G.CssSyntaxError=f,G.Declaration=c,G.Container=l,G.Processor=R,G.Document=h,G.Comment=u,G.Warning=D,G.AtRule=a,G.Result=O,G.Input=v,G.Rule=B,G.Root=I,G.Node=S,y.registerPostcss(G),postcss_1=G,G.default=G,postcss_1}var sanitizeHtml_1,hasRequiredSanitizeHtml;function requireSanitizeHtml(){if(hasRequiredSanitizeHtml)return sanitizeHtml_1;hasRequiredSanitizeHtml=1;const s=requireLib(),a=requireEscapeStringRegexp(),{isPlainObject:u}=requireIsPlainObject(),l=requireCjs(),f=requireParseSrcset(),{parse:c}=requirePostcss(),h=["img","audio","video","picture","svg","object","map","iframe","embed"],p=["script","style"];function v(B,N){B&&Object.keys(B).forEach(function(D){N(B[D],D)})}function y(B,N){return{}.hasOwnProperty.call(B,N)}function b(B,N){const D=[];return v(B,function(G){N(G)&&D.push(G)}),D}function S(B){for(const N in B)if(y(B,N))return!1;return!0}function E(B){return B.map(function(N){if(!N.url)throw new Error("URL missing");return N.url+(N.w?` ${N.w}w`:"")+(N.h?` ${N.h}h`:"")+(N.d?` ${N.d}x`:"")}).join(", ")}sanitizeHtml_1=O;const R=/^[^\0\t\n\f\r /<=>]+$/;function O(B,N,D){if(B==null)return"";typeof B=="number"&&(B=B.toString());let G="",V="";function U(le,me){const xe=this;this.tag=le,this.attribs=me||{},this.tagPosition=G.length,this.text="",this.mediaChildren=[],this.updateParentNodeText=function(){if(x.length){const Ne=x[x.length-1];Ne.text+=xe.text}},this.updateParentNodeMediaChildren=function(){x.length&&h.includes(this.tag)&&x[x.length-1].mediaChildren.push(this.tag)}}N=Object.assign({},O.defaults,N),N.parser=Object.assign({},I,N.parser);const te=function(le){return N.allowedTags===!1||(N.allowedTags||[]).indexOf(le)>-1};p.forEach(function(le){te(le)&&!N.allowVulnerableTags&&console.warn(`

⚠️ Your \`allowedTags\` option includes, \`${le}\`, which is inherently
vulnerable to XSS attacks. Please remove it from \`allowedTags\`.
Or, to disable this warning, add the \`allowVulnerableTags\` option
and ensure you are accounting for this risk.

`)});const Z=N.nonTextTags||["script","style","textarea","option"];let J,Q;N.allowedAttributes&&(J={},Q={},v(N.allowedAttributes,function(le,me){J[me]=[];const xe=[];le.forEach(function(Ne){typeof Ne=="string"&&Ne.indexOf("*")>=0?xe.push(a(Ne).replace(/\\\*/g,".*")):J[me].push(Ne)}),xe.length&&(Q[me]=new RegExp("^("+xe.join("|")+")$"))}));const ee={},k={},d={};v(N.allowedClasses,function(le,me){if(J&&(y(J,me)||(J[me]=[]),J[me].push("class")),ee[me]=le,Array.isArray(le)){const xe=[];ee[me]=[],d[me]=[],le.forEach(function(Ne){typeof Ne=="string"&&Ne.indexOf("*")>=0?xe.push(a(Ne).replace(/\\\*/g,".*")):Ne instanceof RegExp?d[me].push(Ne):ee[me].push(Ne)}),xe.length&&(k[me]=new RegExp("^("+xe.join("|")+")$"))}});const g={};let _;v(N.transformTags,function(le,me){let xe;typeof le=="function"?xe=le:typeof le=="string"&&(xe=O.simpleTransform(le)),me==="*"?_=xe:g[me]=xe});let w,x,P,$,T,m,M=!1;Y();const W=new s.Parser({onopentag:function(le,me){if(N.enforceHtmlBoundary&&le==="html"&&Y(),T){m++;return}const xe=new U(le,me);x.push(xe);let Ne=!1;const Pe=!!xe.text;let Ie;if(y(g,le)&&(Ie=g[le](le,me),xe.attribs=me=Ie.attribs,Ie.text!==void 0&&(xe.innerText=Ie.text),le!==Ie.tagName&&(xe.name=le=Ie.tagName,$[w]=Ie.tagName)),_&&(Ie=_(le,me),xe.attribs=me=Ie.attribs,le!==Ie.tagName&&(xe.name=le=Ie.tagName,$[w]=Ie.tagName)),(!te(le)||N.disallowedTagsMode==="recursiveEscape"&&!S(P)||N.nestingLimit!=null&&w>=N.nestingLimit)&&(Ne=!0,P[w]=!0,(N.disallowedTagsMode==="discard"||N.disallowedTagsMode==="completelyDiscard")&&Z.indexOf(le)!==-1&&(T=!0,m=1),P[w]=!0),w++,Ne){if(N.disallowedTagsMode==="discard"||N.disallowedTagsMode==="completelyDiscard"){if(xe.innerText&&!Pe){const Ke=ue(xe.innerText);N.textFilter?G+=N.textFilter(Ke,le):G+=ue(xe.innerText),M=!0}return}V=G,G=""}G+="<"+le,le==="script"&&(N.allowedScriptHostnames||N.allowedScriptDomains)&&(xe.innerText=""),(!J||y(J,le)||J["*"])&&v(me,function(Ke,Le){if(!R.test(Le)){delete xe.attribs[Le];return}if(Ke===""&&!N.allowedEmptyAttributes.includes(Le)&&(N.nonBooleanAttributes.includes(Le)||N.nonBooleanAttributes.includes("*"))){delete xe.attribs[Le];return}let Ce=!1;if(!J||y(J,le)&&J[le].indexOf(Le)!==-1||J["*"]&&J["*"].indexOf(Le)!==-1||y(Q,le)&&Q[le].test(Le)||Q["*"]&&Q["*"].test(Le))Ce=!0;else if(J&&J[le]){for(const at of J[le])if(u(at)&&at.name&&at.name===Le){Ce=!0;let Oe="";if(at.multiple===!0){const De=Ke.split(" ");for(const yt of De)at.values.indexOf(yt)!==-1&&(Oe===""?Oe=yt:Oe+=" "+yt)}else at.values.indexOf(Ke)>=0&&(Oe=Ke);Ke=Oe}}if(Ce){if(N.allowedSchemesAppliedToAttributes.indexOf(Le)!==-1&&ge(le,Ke)){delete xe.attribs[Le];return}if(le==="script"&&Le==="src"){let at=!0;try{const Oe=he(Ke);if(N.allowedScriptHostnames||N.allowedScriptDomains){const De=(N.allowedScriptHostnames||[]).find(function(Ue){return Ue===Oe.url.hostname}),yt=(N.allowedScriptDomains||[]).find(function(Ue){return Oe.url.hostname===Ue||Oe.url.hostname.endsWith(`.${Ue}`)});at=De||yt}}catch{at=!1}if(!at){delete xe.attribs[Le];return}}if(le==="iframe"&&Le==="src"){let at=!0;try{const Oe=he(Ke);if(Oe.isRelativeUrl)at=y(N,"allowIframeRelativeUrls")?N.allowIframeRelativeUrls:!N.allowedIframeHostnames&&!N.allowedIframeDomains;else if(N.allowedIframeHostnames||N.allowedIframeDomains){const De=(N.allowedIframeHostnames||[]).find(function(Ue){return Ue===Oe.url.hostname}),yt=(N.allowedIframeDomains||[]).find(function(Ue){return Oe.url.hostname===Ue||Oe.url.hostname.endsWith(`.${Ue}`)});at=De||yt}}catch{at=!1}if(!at){delete xe.attribs[Le];return}}if(Le==="srcset")try{let at=f(Ke);if(at.forEach(function(Oe){ge("srcset",Oe.url)&&(Oe.evil=!0)}),at=b(at,function(Oe){return!Oe.evil}),at.length)Ke=E(b(at,function(Oe){return!Oe.evil})),xe.attribs[Le]=Ke;else{delete xe.attribs[Le];return}}catch{delete xe.attribs[Le];return}if(Le==="class"){const at=ee[le],Oe=ee["*"],De=k[le],yt=d[le],Ue=d["*"],ze=k["*"],Mt=[De,ze].concat(yt,Ue).filter(function(se){return se});if(at&&Oe?Ke=oe(Ke,l(at,Oe),Mt):Ke=oe(Ke,at||Oe,Mt),!Ke.length){delete xe.attribs[Le];return}}if(Le==="style"){if(N.parseStyleAttributes)try{const at=c(le+" {"+Ke+"}",{map:!1}),Oe=ae(at,N.allowedStyles);if(Ke=de(Oe),Ke.length===0){delete xe.attribs[Le];return}}catch{typeof window<"u"&&console.warn('Failed to parse "'+le+" {"+Ke+`}", If you're running this in a browser, we recommend to disable style parsing: options.parseStyleAttributes: false, since this only works in a node environment due to a postcss dependency, More info: https://github.com/apostrophecms/sanitize-html/issues/547`),delete xe.attribs[Le];return}else if(N.allowedStyles)throw new Error("allowedStyles option cannot be used together with parseStyleAttributes: false.")}G+=" "+Le,Ke&&Ke.length?G+='="'+ue(Ke,!0)+'"':N.allowedEmptyAttributes.includes(Le)&&(G+='=""')}else delete xe.attribs[Le]}),N.selfClosing.indexOf(le)!==-1?G+=" />":(G+=">",xe.innerText&&!Pe&&!N.textFilter&&(G+=ue(xe.innerText),M=!0)),Ne&&(G=V+ue(G),V="")},ontext:function(le){if(T)return;const me=x[x.length-1];let xe;if(me&&(xe=me.tag,le=me.innerText!==void 0?me.innerText:le),N.disallowedTagsMode==="completelyDiscard"&&!te(xe))le="";else if((N.disallowedTagsMode==="discard"||N.disallowedTagsMode==="completelyDiscard")&&(xe==="script"||xe==="style"))G+=le;else{const Ne=ue(le,!1);N.textFilter&&!M?G+=N.textFilter(Ne,xe):M||(G+=Ne)}if(x.length){const Ne=x[x.length-1];Ne.text+=le}},onclosetag:function(le,me){if(T)if(m--,!m)T=!1;else return;const xe=x.pop();if(!xe)return;if(xe.tag!==le){x.push(xe);return}T=N.enforceHtmlBoundary?le==="html":!1,w--;const Ne=P[w];if(Ne){if(delete P[w],N.disallowedTagsMode==="discard"||N.disallowedTagsMode==="completelyDiscard"){xe.updateParentNodeText();return}V=G,G=""}if($[w]&&(le=$[w],delete $[w]),N.exclusiveFilter&&N.exclusiveFilter(xe)){G=G.substr(0,xe.tagPosition);return}if(xe.updateParentNodeMediaChildren(),xe.updateParentNodeText(),N.selfClosing.indexOf(le)!==-1||me&&!te(le)&&["escape","recursiveEscape"].indexOf(N.disallowedTagsMode)>=0){Ne&&(G=V,V="");return}G+="</"+le+">",Ne&&(G=V+ue(G),V=""),M=!1}},N.parser);return W.write(B),W.end(),G;function Y(){G="",w=0,x=[],P={},$={},T=!1,m=0}function ue(le,me){return typeof le!="string"&&(le=le+""),N.parser.decodeEntities&&(le=le.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),me&&(le=le.replace(/"/g,"&quot;"))),le=le.replace(/&(?![a-zA-Z0-9#]{1,20};)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),me&&(le=le.replace(/"/g,"&quot;")),le}function ge(le,me){for(me=me.replace(/[\x00-\x20]+/g,"");;){const Pe=me.indexOf("<!--");if(Pe===-1)break;const Ie=me.indexOf("-->",Pe+4);if(Ie===-1)break;me=me.substring(0,Pe)+me.substring(Ie+3)}const xe=me.match(/^([a-zA-Z][a-zA-Z0-9.\-+]*):/);if(!xe)return me.match(/^[/\\]{2}/)?!N.allowProtocolRelative:!1;const Ne=xe[1].toLowerCase();return y(N.allowedSchemesByTag,le)?N.allowedSchemesByTag[le].indexOf(Ne)===-1:!N.allowedSchemes||N.allowedSchemes.indexOf(Ne)===-1}function he(le){if(le=le.replace(/^(\w+:)?\s*[\\/]\s*[\\/]/,"$1//"),le.startsWith("relative:"))throw new Error("relative: exploit attempt");let me="relative://relative-site";for(let Pe=0;Pe<100;Pe++)me+=`/${Pe}`;const xe=new URL(le,me);return{isRelativeUrl:xe&&xe.hostname==="relative-site"&&xe.protocol==="relative:",url:xe}}function ae(le,me){if(!me)return le;const xe=le.nodes[0];let Ne;return me[xe.selector]&&me["*"]?Ne=l(me[xe.selector],me["*"]):Ne=me[xe.selector]||me["*"],Ne&&(le.nodes[0].nodes=xe.nodes.reduce(pe(Ne),[])),le}function de(le){return le.nodes[0].nodes.reduce(function(me,xe){return me.push(`${xe.prop}:${xe.value}${xe.important?" !important":""}`),me},[]).join(";")}function pe(le){return function(me,xe){return y(le,xe.prop)&&le[xe.prop].some(function(Pe){return Pe.test(xe.value)})&&me.push(xe),me}}function oe(le,me,xe){return me?(le=le.split(/\s+/),le.filter(function(Ne){return me.indexOf(Ne)!==-1||xe.some(function(Pe){return Pe.test(Ne)})}).join(" ")):le}}const I={decodeEntities:!0};return O.defaults={allowedTags:["address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","hgroup","main","nav","section","blockquote","dd","div","dl","dt","figcaption","figure","hr","li","main","ol","p","pre","ul","a","abbr","b","bdi","bdo","br","cite","code","data","dfn","em","i","kbd","mark","q","rb","rp","rt","rtc","ruby","s","samp","small","span","strong","sub","sup","time","u","var","wbr","caption","col","colgroup","table","tbody","td","tfoot","th","thead","tr"],nonBooleanAttributes:["abbr","accept","accept-charset","accesskey","action","allow","alt","as","autocapitalize","autocomplete","blocking","charset","cite","class","color","cols","colspan","content","contenteditable","coords","crossorigin","data","datetime","decoding","dir","dirname","download","draggable","enctype","enterkeyhint","fetchpriority","for","form","formaction","formenctype","formmethod","formtarget","headers","height","hidden","high","href","hreflang","http-equiv","id","imagesizes","imagesrcset","inputmode","integrity","is","itemid","itemprop","itemref","itemtype","kind","label","lang","list","loading","low","max","maxlength","media","method","min","minlength","name","nonce","optimum","pattern","ping","placeholder","popover","popovertarget","popovertargetaction","poster","preload","referrerpolicy","rel","rows","rowspan","sandbox","scope","shape","size","sizes","slot","span","spellcheck","src","srcdoc","srclang","srcset","start","step","style","tabindex","target","title","translate","type","usemap","value","width","wrap","onauxclick","onafterprint","onbeforematch","onbeforeprint","onbeforeunload","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","onhashchange","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onlanguagechange","onload","onloadeddata","onloadedmetadata","onloadstart","onmessage","onmessageerror","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onoffline","ononline","onpagehide","onpageshow","onpaste","onpause","onplay","onplaying","onpopstate","onprogress","onratechange","onreset","onresize","onrejectionhandled","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onstorage","onsubmit","onsuspend","ontimeupdate","ontoggle","onunhandledrejection","onunload","onvolumechange","onwaiting","onwheel"],disallowedTagsMode:"discard",allowedAttributes:{a:["href","name","target"],img:["src","srcset","alt","title","width","height","loading"]},allowedEmptyAttributes:["alt"],selfClosing:["img","br","hr","area","base","basefont","input","link","meta"],allowedSchemes:["http","https","ftp","mailto","tel"],allowedSchemesByTag:{},allowedSchemesAppliedToAttributes:["href","src","cite"],allowProtocolRelative:!0,enforceHtmlBoundary:!1,parseStyleAttributes:!0},O.simpleTransform=function(B,N,D){return D=D===void 0?!0:D,N=N||{},function(G,V){let U;if(D)for(U in N)V[U]=N[U];else V=N;return{tagName:B,attribs:V}}},sanitizeHtml_1}var sanitizeHtmlExports=requireSanitizeHtml();const sanitizeHtml=getDefaultExportFromCjs(sanitizeHtmlExports);var TezosRpcErrors={Badly_formed_constant_expression:{description:"Badly formed constant expression. Found a badly formed constant expression. The 'constant' primitive must always be followed by a string of the hash of the expression it points to. ",category:"temporary"},"Bounded_history_repr.Smart_rollup_inbox_history.key_bound_to_different_value":{description:"Key already bound to a different value. Smart_rollup_inbox_history: Remember called with a key that is already bound to a different value. ",category:"temporary"},"Bounded_history_repr.Smart_rollup_level_inbox_history.key_bound_to_different_value":{description:"Key already bound to a different value. Smart_rollup_level_inbox_history: Remember called with a key that is already bound to a different value. ",category:"temporary"},"Bounded_history_repr.dal_slots_cache.key_bound_to_different_value":{description:"Key already bound to a different value. Remember called with a key that is already bound to a different value. ",category:"temporary"},Dal_data_availibility_attester_not_in_committee:{description:"The attester is not part of the DAL committee for this level. The attester is not part of the DAL committee for this level ",category:"temporary"},"Dal_slot_repr.add_element_in_slots_skip_list_violates_ordering":{description:"Add an element in slots skip list that violates ordering. Attempting to add an element on top of the Dal confirmed slots skip list that violates the ordering. ",category:"temporary"},"Dal_slot_repr.invalid_proof_deserialization":{description:"Dal invalid proof deserialization. Error occured during dal proof deserialization ",category:"temporary"},"Dal_slot_repr.invalid_proof_serialization":{description:"Dal invalid proof serialization. Error occured during dal proof serialization ",category:"temporary"},Dissecting_during_final_move:{description:"Tried to play a dissecting when the final move started. Tried to play a dissecting when the final move started ",category:"temporary"},Dissection_choice_not_found:{description:"Dissection choice not found. Dissection choice not found ",category:"temporary"},Dissection_unexpected_section_size:{description:"The distance for a proof should be equal to 1. The distance for a proof should be equal to 1 ",category:"temporary"},Expected_binary_proof:{description:"Expected binary proof. An invalid proof has been submitted ",category:"temporary"},Expression_already_registered:{description:"Expression already registered. Attempted to register an expression as global constant that has already been registered. ",category:"temporary"},Expression_too_deep:{description:"Expression too deep. Attempted to register an expression that, after fully expanding all referenced global constants, would result in too many levels of nesting. ",category:"temporary"},Expression_too_large:{description:"Expression too large. Encountered an expression that, after expanding all constants, is larger than the expression size limit. ",category:"temporary"},Failed_to_get_script:{description:"Failed to get script for contract. Failed to get script for contract when scanning operations for tickets ",category:"temporary"},Failed_to_hash_node:{description:"Failed to hash node. Failed to hash node for a key in the ticket-balance table ",category:"temporary"},Failed_to_load_big_map_value_type:{description:"Failed to load big-map value type. Failed to load big-map value type when computing ticket diffs. ",category:"temporary"},Merkle_list_invalid_position:{description:"Invalid position in merkle list. Merkle_list_invalid_position ",category:"temporary"},Negative_ticket_balance:{description:"Negative ticket balance. Attempted to set a negative ticket balance value ",category:"temporary"},Nonexistent_global:{description:"Tried to look up nonexistent global. No registered global was found at the given hash in storage. ",category:"temporary"},Proof_start_state_hash_mismatch:{description:"The start state hash of the proof is invalid. The start state hash of the proof is invalid ",category:"temporary"},Proof_stop_state_hash_failed_to_refute:{description:"Failed to refute the stop state hash with the proof. Failed to refute the stop state hash with the proof ",category:"temporary"},Proof_stop_state_hash_failed_to_validate:{description:"Failed to validate the stop state hash with the proof. Failed to validate the stop state hash with the proof ",category:"temporary"},Unsupported_non_empty_overlay:{description:"Unsupported non empty overlay. Unsupported big-map value with non-empty overlay ",category:"temporary"},Unsupported_type_operation:{description:"Unsupported type operation. Types embedding operations are not supported ",category:"temporary"},Used_storage_underflow:{description:"Ticket balance used storage underflow. Attempt to free more bytes than allocated for the tickets balance ",category:"temporary"},"apply.missing_shell_header":{description:"Missing shell_header during finalisation of a block. During finalisation of a block header in Application mode or Full construction mode, a shell header should be provided so that a cache nonce can be computed. ",category:"temporary"},"baking.insufficient_attestation_power":{description:"Insufficient attestation power. The attestation power is insufficient to satisfy the consensus threshold. ",category:"temporary"},"block.multiple_revelation":{description:"Multiple revelations were included in a manager operation. A manager operation should not contain more than one revelation ",category:"temporary"},"block_header.invalid_block_signature":{description:"Invalid block signature. A block was not signed with the expected private key. ",category:"temporary"},"block_header.invalid_commitment":{description:"Invalid commitment in block header. The block header has invalid commitment. ",category:"temporary"},"block_header.invalid_payload_round":{description:"Invalid payload round. The given payload round is invalid. ",category:"temporary"},"block_header.invalid_stamp":{description:"Insufficient block proof-of-work stamp. The block's proof-of-work stamp is insufficient ",category:"temporary"},"block_header.wrong_timestamp":{description:"Wrong timestamp. Block timestamp not the expected one. ",category:"temporary"},"bootstrap.unrevealed_public_key":{description:"Forbidden delegation from unrevealed public key. Tried to delegate from an unrevealed public key ",category:"temporary"},cannot_retrieve_predecessor_level:{description:"Cannot retrieve predecessor level. Cannot retrieve predecessor level. ",category:"temporary"},"constants.invalid_protocol_constants":{description:"Invalid protocol constants. The provided protocol constants are not coherent. ",category:"temporary"},"context.failed_to_decode_parameter":{description:"Failed to decode parameter. Unexpected JSON object. ",category:"temporary"},"context.failed_to_parse_parameter":{description:"Failed to parse parameter. The protocol parameters are not valid JSON. ",category:"temporary"},"context.storage_error":{description:"Storage error (fatal internal error). An error that should never happen unless something has been deleted or corrupted in the database. ",category:"temporary"},"contract.balance_too_low":{description:"Balance too low. An operation tried to spend more tokens than the contract has ",category:"temporary"},"contract.cannot_pay_storage_fee":{description:"Cannot pay storage fee. The storage fee is higher than the contract balance ",category:"temporary"},"contract.counter_in_the_future":{description:"Invalid counter (not yet reached) in a manager operation. An operation assumed a contract counter in the future ",category:"temporary"},"contract.counter_in_the_past":{description:"Invalid counter (already used) in a manager operation. An operation assumed a contract counter in the past ",category:"temporary"},"contract.empty_transaction":{description:"Empty transaction. Forbidden to credit 0ꜩ to a contract without code. ",category:"temporary"},"contract.failure":{description:"Contract storage failure. Unexpected contract storage error ",category:"temporary"},"contract.invalid_contract_notation":{description:"Invalid contract notation. A malformed contract notation was given to an RPC or in a script. ",category:"temporary"},"contract.manager.inconsistent_hash":{description:"Inconsistent public key hash. A revealed manager public key is inconsistent with the announced hash ",category:"temporary"},"contract.manager.inconsistent_public_key":{description:"Inconsistent public key. A provided manager public key is different with the public key stored in the contract ",category:"temporary"},"contract.manager.unregistered_delegate":{description:"Unregistered delegate. A contract cannot be delegated to an unregistered delegate ",category:"temporary"},"contract.missing_manager_contract":{description:"Missing manager contract. The manager contract is missing from the storage ",category:"temporary"},"contract.negative_storage_input":{description:"Negative storage input. The storage amount asked for an operation is null or negative ",category:"temporary"},"contract.non_empty_transaction_from_source":{description:"Unexpected non-empty transaction. This address cannot initiate non-empty transactions ",category:"temporary"},"contract.non_existing_contract":{description:"Non existing contract. A contract handle is not present in the context (either it never was or it has been destroyed) ",category:"temporary"},"contract.previously_revealed_key":{description:"Manager operation already revealed. One tried to reveal twice a manager public key ",category:"temporary"},"contract.unrevealed_key":{description:"Manager operation precedes key revelation. One tried to apply a manager operation without revealing the manager public key ",category:"temporary"},contract_not_originated:{description:"Contract not originated. Non originated contract detected in ticket update. ",category:"temporary"},dal_attestation_size_limit_exceeded:{description:"DAL attestation exceeded the limit. The attestation for data availability is a too big ",category:"temporary"},dal_cryptobox_error:{description:"DAL cryptobox error. Error occurred while initialising the cryptobox ",category:"temporary"},"dal_page_index_repr.index.invalid_index":{description:"Invalid Dal page index. The given index is out of range of representable page indices ",category:"temporary"},dal_publish_commitment_duplicate:{description:"DAL publish slot header duplicate. A slot header for this slot was already proposed ",category:"temporary"},dal_publish_commitment_invalid_index:{description:"DAL slot header invalid index. Bad index for slot header ",category:"temporary"},dal_publish_commitment_invalid_proof:{description:"DAL publish slot header invalid proof. The slot header's commitment proof does not check ",category:"temporary"},dal_publish_commitment_with_low_fees:{description:"DAL slot header with low fees. Slot header with too low fees ",category:"temporary"},dal_register_invalid_slot:{description:"Dal register invalid slot. Attempt to register a slot which is invalid (the index is out of bounds). ",category:"temporary"},dal_slot_index_negative_orabove_hard_limit:{description:"DAL slot index negative or above hard limit. Slot index above hard limit ",category:"temporary"},"dal_slot_index_repr.index.invalid_index":{description:"Invalid Dal slot index. The given index is out of range of representable slot indices ",category:"temporary"},"dal_slot_repr.shard_with_proof.dal_shard_proof_error":{description:"DAL shard proof error. An error occurred while validating the DAL shard proof. ",category:"temporary"},"dal_slot_repr.shard_with_proof.share_is_trap_error":{description:"encoding error in Dal.share_is_trap. An encoding error occurred while checking whether a shard is a trap. ",category:"temporary"},"dal_slot_repr.slots_history.dal_proof_error":{description:"DAL page proof error. Error occurred during DAL page proof production or validation ",category:"temporary"},"dal_slot_repr.slots_history.unexpected_page_size":{description:"Unexpected page size. The size of the given page content doesn't match the expected one. ",category:"temporary"},"delegate.already_active":{description:"Delegate already active. Useless delegate reactivation ",category:"temporary"},"delegate.consensus_key.active":{description:"Active consensus key. The delegate consensus key is already used by another delegate ",category:"temporary"},"delegate.consensus_key.invalid_noop":{description:"Invalid key for consensus key update. Tried to update the consensus key with the active key ",category:"temporary"},"delegate.consensus_key.tz4":{description:"Consensus key cannot be a tz4. Consensus key cannot be a tz4 (BLS public key). ",category:"temporary"},"delegate.empty_delegate_account":{description:"Empty delegate account. Cannot register a delegate when its implicit account is empty ",category:"temporary"},"delegate.forbidden_tz4":{description:"Forbidden delegate. Delegates are forbidden to be tz4 (BLS) accounts. ",category:"temporary"},"delegate.no_deletion":{description:"Forbidden delegate deletion. Tried to unregister a delegate ",category:"temporary"},"delegate.not_registered":{description:"Not a registered delegate. The provided public key hash is not the address of a registered delegate. ",category:"temporary"},"delegate.stake_distribution_not_set":{description:"Stake distribution not set. The stake distribution for the current cycle is not set. ",category:"temporary"},"delegate.unchanged":{description:"Unchanged delegated. Contract already delegated to the given delegate ",category:"temporary"},"delegate_service.balance_rpc_on_non_delegate":{description:"Balance request for an unregistered delegate. The account whose balance was requested is not a delegate. ",category:"temporary"},"destination_repr.invalid_b58check":{description:"Destination decoding failed. Failed to read a valid destination from a b58check_encoding data ",category:"temporary"},"durations.non_increasing_rounds":{description:"Non increasing round. The provided rounds are not increasing. ",category:"temporary"},"env.bitfield_invalid_position":{description:"Invalid bitfield’s position. Bitfields do not accept negative positions ",category:"temporary"},failure:{description:"Exception. Exception safely wrapped in an error ",category:"temporary"},"frozen_bonds.must_be_spent_at_once":{description:"Partial spending of frozen bonds. Frozen bonds must be spent at once. ",category:"temporary"},"gas_exhausted.block":{description:"Gas quota exceeded for the block. The sum of gas consumed by all the operations in the block exceeds the hard gas limit per block ",category:"temporary"},"gas_exhausted.operation":{description:"Gas quota exceeded for the operation. A script or one of its callee took more time than the operation said it would ",category:"temporary"},gas_limit_too_high:{description:"Gas limit out of protocol hard bounds. A transaction tried to exceed the hard limit on gas ",category:"temporary"},illformedViewType:{description:"An entrypoint type is incompatible with TZIP-4 view type. An entrypoint type is incompatible with TZIP-4 view type. ",category:"temporary"},"implicit.empty_implicit_contract":{description:"Empty implicit contract. No manager operations are allowed on an empty implicit contract. This account has zero balance. Fund it before using. ",category:"temporary"},"implicit.empty_implicit_delegated_contract":{description:"Empty implicit delegated contract. Emptying an implicit delegated account is not allowed. ",category:"temporary"},"indexable.index_cannot_be_negative":{description:"Index of values cannot be negative. A negative integer cannot be used as an index for a value. ",category:"temporary"},"internal.smart_rollup_add_zero_messages":{description:"Internal error: trying to add zero messages. Message adding functions must be called with a positive number of messages ",category:"temporary"},"internal.smart_rollup_inbox_proof_error":{description:"Internal error: error occurred during proof production or validation. An inbox proof error. ",category:"temporary"},"internal.smart_rollup_merklized_payload_hashes_proof":{description:"Internal error: error occurred during proof production or validation. A merkelized payload hashes proof error. ",category:"temporary"},internal_operation_replay:{description:"Internal operation replay. An internal operation was emitted twice by a script ",category:"temporary"},invalid_arg:{description:"Invalid arg. Negative multiple of periods are not allowed. ",category:"temporary"},invalid_binary_format:{description:"Invalid binary format. Could not deserialize some piece of data from its binary representation ",category:"temporary"},invalid_fitness:{description:"Invalid fitness. Fitness representation should be exactly 4 times 4 bytes long. ",category:"temporary"},invalid_ticket_transfer:{description:"Invalid ticket transfer. Invalid ticket transfer detected in ticket balance update. ",category:"temporary"},level_not_in_alpha:{description:"Level not in Alpha family. Level not in Alpha family ",category:"temporary"},level_offset_too_high:{description:"level offset too high. The block's level offset is too high. ",category:"temporary"},"level_repr.invalid_cycle_eras":{description:"Invalid cycle eras. The cycles eras are not valid: empty list or non-decreasing first levels or first cycles. ",category:"temporary"},locked_round_not_less_than_round:{description:"Locked round not smaller than round. The round is smaller than or equal to the locked round. ",category:"temporary"},"main.begin_application.cannot_apply_in_partial_validation":{description:"cannot_apply_in_partial_validation. Cannot instantiate an application state using the 'Partial_validation' mode. ",category:"temporary"},malformed_period:{description:"Malformed period. Period is negative. ",category:"temporary"},"michelson_v1.bad_contract_parameter":{description:"Contract supplied an invalid parameter. Either no parameter was supplied to a contract with a non-unit parameter type, a non-unit parameter was passed to an account, or a parameter was supplied of the wrong type ",category:"temporary"},"michelson_v1.bad_dupn_argument":{description:"0 passed to DUP n. DUP expects an argument of at least 1 (passed 0) ",category:"temporary"},"michelson_v1.bad_dupn_stack":{description:"Stack too short when typing DUP n. Stack present when typing DUP n was too short ",category:"temporary"},"michelson_v1.bad_pair_argument":{description:"0 or 1 passed to PAIR. PAIR expects an argument of at least 2 ",category:"temporary"},"michelson_v1.bad_return":{description:"Bad return. Unexpected stack at the end of a lambda or script. ",category:"temporary"},"michelson_v1.bad_stack":{description:"Bad stack. The stack has an unexpected length or contents. ",category:"temporary"},"michelson_v1.bad_stack_item":{description:"Bad stack item. The type of a stack item is unexpected (this error is always accompanied by a more precise one). ",category:"temporary"},"michelson_v1.bad_unpair_argument":{description:"0 or 1 passed to UNPAIR. UNPAIR expects an argument of at least 2 ",category:"temporary"},"michelson_v1.bad_view_name":{description:"Bad view name. In a view declaration, the view name must be a string ",category:"temporary"},"michelson_v1.cannot_serialize_failure":{description:"Not enough gas to serialize argument of FAILWITH. Argument of FAILWITH was too big to be serialized with the provided gas ",category:"temporary"},"michelson_v1.cannot_serialize_log":{description:"Not enough gas to serialize execution trace. Execution trace with stacks was to big to be serialized with the provided gas ",category:"temporary"},"michelson_v1.cannot_serialize_storage":{description:"Not enough gas to serialize execution storage. The returned storage was too big to be serialized with the provided gas ",category:"temporary"},"michelson_v1.comparable_type_expected":{description:"Comparable type expected. A non comparable type was used in a place where only comparable types are accepted. ",category:"temporary"},"michelson_v1.deprecated_instruction":{description:"Script is using a deprecated instruction. A deprecated instruction usage is disallowed in newly created contracts ",category:"temporary"},"michelson_v1.duplicate_entrypoint":{description:"Duplicate entrypoint (type error). Two entrypoints have the same name. ",category:"temporary"},"michelson_v1.duplicate_map_keys":{description:"Duplicate map keys. Map literals cannot contain duplicated keys ",category:"temporary"},"michelson_v1.duplicate_script_field":{description:"Script has a duplicated field (parse error). When parsing script, a field was found more than once ",category:"temporary"},"michelson_v1.duplicate_set_values_in_literal":{description:"Sets literals cannot contain duplicate elements. Set literals cannot contain duplicate elements, but a duplicate was found while parsing. ",category:"temporary"},"michelson_v1.duplicated_view_name":{description:"Duplicated view name. The name of view in toplevel should be unique. ",category:"temporary"},"michelson_v1.entrypoint_name_too_long":{description:"Entrypoint name too long (type error). An entrypoint name exceeds the maximum length of 31 characters. ",category:"temporary"},"michelson_v1.fail_not_in_tail_position":{description:"FAIL not in tail position. There is non trivial garbage code after a FAIL instruction. ",category:"temporary"},"michelson_v1.forbidden_instr_in_context":{description:"Forbidden instruction in context. An instruction was encountered in a context where it is forbidden. ",category:"temporary"},"michelson_v1.forbidden_zero_amount_ticket":{description:"Zero ticket amount is not allowed. It is not allowed to use a zero amount ticket in this operation. ",category:"temporary"},"michelson_v1.ill_formed_type":{description:"Ill formed type. The toplevel error thrown when trying to parse a type expression (always followed by more precise errors). ",category:"temporary"},"michelson_v1.ill_typed_contract":{description:"Ill typed contract. The toplevel error thrown when trying to typecheck a contract code against given input, output and storage types (always followed by more precise errors). ",category:"temporary"},"michelson_v1.ill_typed_data":{description:"Ill typed data. The toplevel error thrown when trying to typecheck a data expression against a given type (always followed by more precise errors). ",category:"temporary"},"michelson_v1.ill_typed_view":{description:"Ill typed view. The return of a view block did not match the expected type ",category:"temporary"},"michelson_v1.inconsistent_memo_sizes":{description:"Inconsistent memo sizes. Memo sizes of two sapling states or transactions do not match ",category:"temporary"},"michelson_v1.inconsistent_stack_lengths":{description:"Inconsistent stack lengths. A stack was of an unexpected length (this error is always in the context of a located error). ",category:"temporary"},"michelson_v1.inconsistent_type_sizes":{description:"Inconsistent type sizes. Two types were expected to be equal but they have different sizes. ",category:"temporary"},"michelson_v1.inconsistent_types":{description:"Inconsistent types. This is the basic type clash error, that appears in several places where the equality of two types have to be proven, it is always accompanied with another error that provides more context. ",category:"temporary"},"michelson_v1.invalid_arity":{description:"Invalid arity. In a script or data expression, a primitive was applied to an unsupported number of arguments. ",category:"temporary"},"michelson_v1.invalid_big_map":{description:"Invalid big_map. A script or data expression references a big_map that does not exist or assumes a wrong type for an existing big_map. ",category:"temporary"},"michelson_v1.invalid_constant":{description:"Invalid constant. A data expression was invalid for its expected type. ",category:"temporary"},"michelson_v1.invalid_contract":{description:"Invalid contract. A script or data expression references a contract that does not exist or assumes a wrong type for an existing contract. ",category:"temporary"},"michelson_v1.invalid_expression_kind":{description:"Invalid expression kind. In a script or data expression, an expression was of the wrong kind (for instance a string where only a primitive applications can appear). ",category:"temporary"},"michelson_v1.invalid_iter_body":{description:"ITER body returned wrong stack type. The body of an ITER instruction must result in the same stack type as before the ITER. ",category:"temporary"},"michelson_v1.invalid_map_block_fail":{description:"FAIL instruction occurred as body of map block. FAIL cannot be the only instruction in the body. The proper type of the return list cannot be inferred. ",category:"temporary"},"michelson_v1.invalid_map_body":{description:"Invalid map body. The body of a map block did not match the expected type ",category:"temporary"},"michelson_v1.invalid_never_expr":{description:"Invalid expression for type never. In a script or data expression, an expression was provided but a value of type never was expected. No expression can have type never. ",category:"temporary"},"michelson_v1.invalid_primitive":{description:"Invalid primitive. In a script or data expression, a primitive was unknown. ",category:"temporary"},"michelson_v1.invalid_primitive_name":{description:"Invalid primitive name. In a script or data expression, a primitive name is unknown or has a wrong case. ",category:"temporary"},"michelson_v1.invalid_primitive_name_case":{description:"Invalid primitive name case. In a script or data expression, a primitive name is neither uppercase, lowercase or capitalized. ",category:"temporary"},"michelson_v1.invalid_primitive_namespace":{description:"Invalid primitive namespace. In a script or data expression, a primitive was of the wrong namespace. ",category:"temporary"},"michelson_v1.invalid_seq_arity":{description:"Invalid sequence arity. In a script or data expression, a sequence was used with a number of elements too small. ",category:"temporary"},"michelson_v1.invalid_syntactic_constant":{description:"Invalid constant (parse error). A compile-time constant was invalid for its expected form. ",category:"temporary"},"michelson_v1.invalid_tx_rollup_ticket_amount":{description:"Invalid ticket amount. Ticket amount to be deposited in a transaction rollup should be strictly positive and fit in a signed 64-bit integer ",category:"temporary"},"michelson_v1.missing_script_field":{description:"Script is missing a field (parse error). When parsing script, a field was expected, but not provided ",category:"temporary"},"michelson_v1.no_such_entrypoint":{description:"No such entrypoint (type error). An entrypoint was not found when calling a contract. ",category:"temporary"},"michelson_v1.non_dupable_type":{description:"Non-dupable type duplication attempt. DUP was used on a non-dupable type (e.g. tickets). ",category:"temporary"},"michelson_v1.non_printable_character":{description:"Non printable character in a Michelson string. Michelson strings are only allowed to contain printable characters (either the newline character or characters in the [32, 126] ASCII range). ",category:"temporary"},"michelson_v1.runtime_error":{description:"Script runtime error. Toplevel error for all runtime script errors ",category:"temporary"},"michelson_v1.sc_rollup_disabled":{description:"Sc rollup are disabled. Cannot use smart rollup features as they are disabled. ",category:"temporary"},"michelson_v1.script_overflow":{description:"Script failed (overflow error). While interpreting a Michelson script, an overflow was detected ",category:"temporary"},"michelson_v1.script_rejected":{description:"Script failed. A FAILWITH instruction was reached ",category:"temporary"},"michelson_v1.tx_rollup_bad_deposit_parameter":{description:"Bad deposit parameter. The parameter to the deposit entrypoint of a transaction rollup should be a pair of a ticket and the address of a recipient transaction rollup. ",category:"temporary"},"michelson_v1.type_too_large":{description:"Stack item type too large. An instruction generated a type larger than the limit. ",category:"temporary"},"michelson_v1.typechecking_too_many_recursive_calls":{description:"Too many recursive calls during typechecking. Too many recursive calls were needed for typechecking ",category:"temporary"},"michelson_v1.undefined_binop":{description:"Undefined binop. A binary operation is called on operands of types over which it is not defined. ",category:"temporary"},"michelson_v1.undefined_unop":{description:"Undefined unop. A unary operation is called on an operand of type over which it is not defined. ",category:"temporary"},"michelson_v1.unexpected_annotation":{description:"An annotation was encountered where no annotation is expected. A node in the syntax tree was improperly annotated ",category:"temporary"},"michelson_v1.unexpected_contract":{description:"Contract in unauthorized position (type error). When parsing script, a contract type was found in the storage or parameter field. ",category:"temporary"},"michelson_v1.unexpected_default_entrypoint":{description:"The annotation ‘default’ was encountered where an entrypoint is expected. A node in the syntax tree was improperly annotated. An annotation used to designate an entrypoint cannot be exactly 'default'. ",category:"temporary"},"michelson_v1.unexpected_forged_value":{description:"Unexpected forged value. A forged value was encountered but disallowed for that position. ",category:"temporary"},"michelson_v1.unexpected_implicit_account_parameters_type":{description:"Unexpected implicit account parameters type. An implicit account can only accept either a unit or a ticket value as a call parameter. ",category:"temporary"},"michelson_v1.unexpected_lazy_storage":{description:"Lazy storage in unauthorized position (type error). When parsing script, a big_map or sapling_state type was found in a position where it could end up stored inside a big_map, which is forbidden for now. ",category:"temporary"},"michelson_v1.unexpected_operation":{description:"Operation in unauthorized position (type error). When parsing script, an operation type was found in the storage or parameter field. ",category:"temporary"},"michelson_v1.unexpected_ticket":{description:"Ticket in unauthorized position (type error). A ticket type has been found ",category:"temporary"},"michelson_v1.unexpected_ticket_owner":{description:"Unexpected ticket owner. Ticket can only be created by a smart contract ",category:"temporary"},"michelson_v1.ungrouped_annotations":{description:"Annotations of the same kind were found spread apart. Annotations of the same kind must be grouped ",category:"temporary"},"michelson_v1.unknown_primitive_name":{description:"Unknown primitive name. In a script or data expression, a primitive was unknown. ",category:"temporary"},"michelson_v1.unmatched_branches":{description:"Unmatched branches. At the join point at the end of two code branches the stacks have inconsistent lengths or contents. ",category:"temporary"},"michelson_v1.unordered_map_literal":{description:"Invalid map key order. Map keys must be in strictly increasing order ",category:"temporary"},"michelson_v1.unordered_set_literal":{description:"Invalid set value order. Set values must be in strictly increasing order ",category:"temporary"},"michelson_v1.unparsing_stack_overflow":{description:"Too many recursive calls during unparsing. Too many recursive calls were needed for unparsing ",category:"temporary"},"michelson_v1.unreachable_entrypoint":{description:"Unreachable entrypoint (type error). An entrypoint in the contract is not reachable. ",category:"temporary"},"michelson_v1.view_name_too_long":{description:"View name too long (type error). A view name exceeds the maximum length of 31 characters. ",category:"temporary"},negative_level_and_offset_sum:{description:"Negative sum of level and offset. Negative sum of level and offset ",category:"temporary"},negative_level_offset:{description:"The specified level offset is negative. The specified level offset is negative ",category:"temporary"},negative_round:{description:"Negative round. Round cannot be built out of negative integers. ",category:"temporary"},"nonce.already_revealed":{description:"Already revealed nonce. Duplicated revelation for a nonce. ",category:"temporary"},"nonce.inconsistent":{description:"Inconsistent nonce. The provided nonce is inconsistent with the committed nonce hash. ",category:"temporary"},"nonce.too_early_revelation":{description:"Too early nonce revelation. Nonce revelation happens before cycle end ",category:"temporary"},"nonce.too_late_revelation":{description:"Too late nonce revelation. Nonce revelation happens too late ",category:"temporary"},"operation.arith_pvm_disabled":{description:"The Arith PVM is disabled. Arith PVM is disabled in this network. ",category:"temporary"},"operation.ballot_from_unregistered_delegate":{description:"Ballot from an unregistered delegate. Cannot cast a ballot for an unregistered delegate. ",category:"temporary"},"operation.cannot_parse":{description:"Cannot parse operation. The operation is ill-formed or for another protocol version ",category:"temporary"},"operation.cannot_stake_with_unfinalizable_unstake_requests_to_another_delegate":{description:"Cannot stake with unfinalizable unstake requests to another delegate. A contract tries to stake to its delegate while having unstake requests to a previous delegate that cannot be finalized yet. Try again in a later cycle (no more than consensus_rights_delay + max_slashing_period). ",category:"temporary"},"operation.cannot_unstake_with_unfinalizable_unstake_requests_to_another_delegate":{description:"Cannot unstake with unfinalizable unstake requests to another delegate. Cannot unstake with unfinalizable unstake requests to another delegate ",category:"temporary"},"operation.contents_list_error":{description:"Invalid list of operation contents. An operation contents list has an unexpected shape; it should be either a single operation or a non-empty list of manager operations ",category:"temporary"},"operation.dal_disabled":{description:"DAL is disabled. Data-availability layer will be enabled in a future proposal. ",category:"temporary"},"operation.dal_incentives_disabled":{description:"DAL incentives are disabled. Incentives for the DAL are not yet enabled. ",category:"temporary"},"operation.double_inclusion_of_consensus_operation":{description:"Double inclusion of consensus operation. double inclusion of consensus operation ",category:"temporary"},"operation.drain_delegate_key_on_unregistered_delegate":{description:"Drain delegate key on an unregistered delegate. Cannot drain an unregistered delegate. ",category:"temporary"},"operation.error_while_taking_fees":{description:"Error while taking the fees of a manager operation. There was an error while taking the fees, which should not happen and means that the operation's validation was faulty. ",category:"temporary"},"operation.faulty_validation_wrong_slot":{description:"Faulty validation (wrong slot for consensus operation). The consensus operation uses an invalid slot. This error should not happen: the operation validation should have failed earlier. ",category:"temporary"},"operation.invalid_drain.inactive_key":{description:"Drain delegate with an inactive consensus key. Cannot drain with an inactive consensus key. ",category:"temporary"},"operation.invalid_drain.insufficient_funds_for_burn_or_fees":{description:"Drain delegate without enough balance for allocation burn or drain fees. Cannot drain without enough allocation burn and drain fees. ",category:"temporary"},"operation.invalid_drain.no_consensus_key":{description:"Drain a delegate without consensus key. Cannot drain a delegate without consensus key. ",category:"temporary"},"operation.invalid_drain.noop":{description:"Invalid drain delegate: noop. Cannot drain a delegate to itself. ",category:"temporary"},"operation.invalid_signature":{description:"Invalid operation signature. The operation signature is ill-formed or has been made with the wrong public key ",category:"temporary"},"operation.missing_signature":{description:"Missing operation signature. The operation is of a kind that must be signed, but the signature is missing ",category:"temporary"},"operation.proposals_from_unregistered_delegate":{description:"Proposals from an unregistered delegate. Cannot submit proposals with an unregistered delegate. ",category:"temporary"},"operation.riscv_pvm_disabled":{description:"The RISCV PVM is disabled. RISCV PVM is disabled in this network. ",category:"temporary"},"operation.rollup_invalid_entrypoint":{description:"Only the default entrypoint is allowed for rollups. Rollups only support transactions to the default entrypoint. ",category:"temporary"},"operation.rollup_invalid_transaction_amount":{description:"Transaction amount to a rollup must be zero. Because rollups are outside of the delegation mechanism of Tezos, they cannot own Tez, and therefore transactions targeting a rollup must have its amount field set to zero. ",category:"temporary"},"operation.set_deposits_limit_on_unregistered_delegate":{description:"Set deposits limit on an unregistered delegate. Cannot set deposits limit on an unregistered delegate. ",category:"temporary"},"operation.set_deposits_limit_when_automated_staking_off":{description:"Set deposits limit when automated staking off. Cannot set deposits limit when automated staking is off or Adaptive Issuance is active. ",category:"temporary"},"operation.update_consensus_key_on_unregistered_delegate":{description:"Update consensus key on an unregistered delegate. Cannot update consensus key an unregistered delegate. ",category:"temporary"},"operation.zk_rollup_deposit_as_external":{description:"attempted a deposit through an external op. Zk_rollup: attempted a deposit through an external op ",category:"temporary"},"operation.zk_rollup_disabled":{description:"ZK rollups are disabled. ZK rollups will be enabled in a future proposal. ",category:"temporary"},"operation.zk_rollup_failed_verification":{description:"failed verification. Zk_rollup_update: failed verification ",category:"temporary"},"operation.zk_rollup_inconsistent_state_update":{description:"inconsistent state update. Zk_rollup_update: new state is of incorrect size ",category:"temporary"},"operation.zk_rollup_invalid_circuit":{description:"invalid circuit. Zk_rollup_update: invalid circuit ",category:"temporary"},"operation.zk_rollup_invalid_deposit_amount":{description:"attempted a deposit with an invalid amount. Zk_rollup: attempted a deposit with an invalid amount ",category:"temporary"},"operation.zk_rollup_invalid_deposit_ticket":{description:"attempted a deposit with an invalid ticket. Zk_rollup: attempted a deposit with an invalid ticket ",category:"temporary"},"operation.zk_rollup_negative_nb_ops":{description:"ZK rollups negative number of operations. The value of [nb_ops] should never be negative. ",category:"temporary"},"operation.zk_rollup_pending_bound":{description:"update with fewer pending ops than allowed. Zk_rollup_update: update with fewer pending ops than allowed ",category:"temporary"},"operation.zk_rollup_wrong_deposit_parameters":{description:"attempted a deposit with invalid parameters. Zk_rollup: attempted a deposit with invalid parameters ",category:"temporary"},"operations.cannot_stake_on_fully_slashed_delegate":{description:"Cannot stake on fully slashed delegate. The delegate has been fully slashed, so its external stakers can no longer stake. This restriction is permanent. If they wish to be able to stake again, the stakers must change delegates. ",category:"temporary"},"operations.invalid_nonzero_transaction_amount":{description:"Invalid non-zero transaction amount. A transaction expected a zero-amount but got non-zero. ",category:"temporary"},"operations.invalid_self_transaction_destination":{description:"Invalid destination for a pseudo-transaction. A pseudo-transaction destination must equal its sender. ",category:"temporary"},"operations.invalid_sender":{description:"Invalid sender for an internal operation. Invalid sender for an internal operation restricted to implicit and originated accounts. ",category:"temporary"},"operations.invalid_staking_parameters":{description:"Invalid parameters for staking parameters. The staking parameters are invalid. ",category:"temporary"},"operations.invalid_staking_parameters_sender":{description:"Invalid staking parameters sender. The staking parameters can only be set by delegates. ",category:"temporary"},"operations.invalid_transfer_to_smart_rollup_from_implicit_account":{description:"Invalid transfer to smart rollup. Invalid transfer to smart rollup from implicit account ",category:"temporary"},"operations.stake_modification_with_no_delegate_set":{description:"(Un)staking without any delegate set. (Un)Stake operations are only allowed when delegate is set. ",category:"temporary"},"operations.staking_for_delegator_while_external_staking_disabled":{description:"Staking for a delegator while external staking is disabled. As long as external staking is not enabled, staking operations are only allowed from delegates. ",category:"temporary"},"operations.staking_to_delegate_that_refuses_external_staking":{description:"Staking to delegate that does not accept external staking. The delegate currently does not accept staking operations from sources other than itself: its `limit_of_staking_over_baking` parameter is set to 0. ",category:"temporary"},out_of_bound_issuance_bonus:{description:"Out of bound issuance bonus. Computed issuance bonus is out of bound ",category:"temporary"},outdated_fitness:{description:"Outdated fitness. Outdated fitness: referring to a previous version ",category:"temporary"},period_overflow:{description:"Period overflow. Last operation generated an integer overflow. ",category:"temporary"},"prefilter.Consensus_operation_in_far_future":{description:"Consensus operation in far future. Consensus operation too far in the future are not accepted. ",category:"temporary"},"prefilter.fees_too_low":{description:"Operation fees are too low. Operation fees are too low ",category:"temporary"},"prefilter.wrong_operation":{description:"Wrong operation. Failing_noop operations are not accepted in the mempool. ",category:"temporary"},published_slot_headers_not_initialized:{description:"The published slot headers bucket not initialized in the context. The published slot headers bucket is not initialized in the context ",category:"temporary"},"raw_context.consensus.slot_map_not_found":{description:"Slot map not found. Pre-computed map by first slot not found. ",category:"temporary"},"rollup.error_zk_rollup_address_generation":{description:"Error while generating rollup address. Error while generating rollup address ",category:"temporary"},round_of_past_timestamp:{description:"Round_of_timestamp for past timestamp. Provided timestamp is before the expected level start. ",category:"temporary"},round_overflow:{description:"Round overflow. Round cannot be built out of integer greater than maximum int32 value. ",category:"temporary"},round_too_high:{description:"round too high. block round too high. ",category:"temporary"},run_operation_does_not_support_consensus_operations:{description:"Run operation does not support consensus operations. The run_operation RPC does not support consensus operations. ",category:"temporary"},sampler_already_set:{description:"Sampler already set. Internal error: Raw_context.set_sampler_for_cycle was called twice for a given cycle ",category:"temporary"},"seed.unknown_seed":{description:"Unknown seed. The requested seed is not available ",category:"temporary"},"slot.invalid_slot":{description:"invalid slot. Invalid slot ",category:"temporary"},smart_rollup_add_zero_messages:{description:"Tried to add zero messages to a smart rollup. Tried to add zero messages to a smart rollup ",category:"temporary"},smart_rollup_address_generation:{description:"Error while generating a smart rollup address. Error while generating a smart rollup address ",category:"temporary"},smart_rollup_arith_invalid_claim_about_outbox:{description:"Invalid claim about outbox. Invalid claim about outbox ",category:"temporary"},smart_rollup_arith_output_proof_production_failed:{description:"Output proof production failed. Output proof production failed ",category:"temporary"},smart_rollup_arith_proof_production_failed:{description:"Proof production failed. Proof production failed ",category:"temporary"},smart_rollup_bad_commitment_serialization:{description:"Could not serialize commitment. Unable to hash the commitment serialization. ",category:"temporary"},smart_rollup_bad_inbox_level:{description:"Committing to a bad inbox level. Attempted to commit to a bad inbox level. ",category:"temporary"},smart_rollup_commitment_disputed:{description:"Commitment disputed. Attempted to cement a disputed commitment. ",category:"temporary"},smart_rollup_commitment_from_future:{description:"Commitment from future. Commitment inbox level is greater or equal than current level ",category:"temporary"},smart_rollup_commitment_past_curfew:{description:"Commitment past curfew. A commitment exists for this inbox level for longer than the curfew period. ",category:"temporary"},smart_rollup_commitment_too_old:{description:"Published commitment is too old. Published commitment is too old ",category:"temporary"},smart_rollup_commitment_too_recent:{description:"Commitment too recent. Attempted to cement a commitment before its refutation deadline. ",category:"temporary"},smart_rollup_dissection_edge_ticks_mismatch:{description:"Mismatch in the edge ticks of the dissection. Mismatch in the edge ticks of the dissection ",category:"temporary"},smart_rollup_dissection_invalid_distribution:{description:"Ticks should only increase in dissection. Ticks should only increase in dissection ",category:"temporary"},smart_rollup_dissection_invalid_number_of_sections:{description:"Invalid number of sections in the dissection. Invalid number of sections in the dissection ",category:"temporary"},smart_rollup_dissection_invalid_successive_states_shape:{description:"Cannot recover from a blocked state in a dissection. Cannot recover from a blocked state in a dissection ",category:"temporary"},smart_rollup_dissection_number_of_sections_mismatch:{description:"Mismatch in the number of sections in the dissection. Mismatch in the number of sections in the dissection ",category:"temporary"},smart_rollup_dissection_start_hash_mismatch:{description:"Mismatch in the start hash of the dissection. Mismatch in the start hash of the dissection ",category:"temporary"},smart_rollup_dissection_stop_hash_mismatch:{description:"Mismatch in the stop hash of the dissection. Mismatch in the stop hash of the dissection ",category:"temporary"},smart_rollup_dissection_ticks_not_increasing:{description:"Ticks should only increase in dissection. Ticks should only increase in dissection ",category:"temporary"},smart_rollup_does_not_exist:{description:"Smart rollup does not exist. Attempted to use a smart rollup that has not been originated. ",category:"temporary"},smart_rollup_double_publish:{description:"The commitment was published twice by the operator. No commitment to cement ",category:"temporary"},smart_rollup_duplicated_key_in_whitelist:{description:"No commitment to cement. No commitment to cement ",category:"temporary"},smart_rollup_empty_whitelist:{description:"Invalid whitelist: whitelist cannot be empty. Smart rollup whitelist cannot be empty ",category:"temporary"},smart_rollup_game_already_started:{description:"Refutation game already started. Refutation game already started, must play with is_opening_move = false. ",category:"temporary"},smart_rollup_inbox_level_reached_message_limit:{description:"Inbox level reached messages limit. There can be only 1000000 messages in an inbox level, the limit has been reached. ",category:"temporary"},smart_rollup_inbox_message_decoding:{description:"Failed to decode a smart rollup management protocol inbox message value. Failed to decode a smart rollup management protocol inbox message value ",category:"temporary"},smart_rollup_inbox_message_encoding:{description:"Failed to encode a rollup management protocol inbox message value. Failed to encode a rollup management protocol inbox message value ",category:"temporary"},smart_rollup_invalid_last_cemented_commitment:{description:"Invalid last-cemented-commitment. Invalid last-cemented-commitment ",category:"temporary"},smart_rollup_invalid_outbox_level:{description:"Invalid outbox level. Invalid outbox level ",category:"temporary"},smart_rollup_invalid_outbox_message_index:{description:"Invalid rollup outbox message index. Invalid rollup outbox message index ",category:"temporary"},smart_rollup_invalid_output_proof:{description:"Invalid output proof. Invalid output proof ",category:"temporary"},smart_rollup_invalid_parameters_type:{description:"Invalid parameters type. Invalid parameters type for smart rollup ",category:"temporary"},smart_rollup_invalid_serialized_inbox_proof:{description:"Invalid serialized inbox proof. The serialized inbox proof can not be de-serialized ",category:"temporary"},smart_rollup_management_protocol_invalid_destination:{description:"Invalid destination. Invalid destination ",category:"temporary"},smart_rollup_max_number_of_messages_reached_for_commitment_period:{description:"Maximum number of messages reached for commitment period. Maximum number of messages reached for commitment period ",category:"temporary"},smart_rollup_maximal_number_of_parallel_games_reached:{description:"Maximal number of parallel games reached. Maximal number of parallel games reached ",category:"temporary"},smart_rollup_no_commitment_to_cement:{description:"No commitment to cement. No commitment to cement ",category:"temporary"},smart_rollup_no_conflict:{description:"No conflict. No conflict. ",category:"temporary"},smart_rollup_no_game:{description:"Refutation game does not exist. Refutation game does not exist ",category:"temporary"},smart_rollup_no_stakers:{description:"No stakers. No stakers for the targeted smart rollup. ",category:"temporary"},smart_rollup_no_valid_commitment_to_cement:{description:"No valid commitment to cement. Attempted to cement a commitment but there is no valid commitment to cement. ",category:"temporary"},smart_rollup_not_staked:{description:"Unknown staker. This implicit account is not a staker of this smart rollup. ",category:"temporary"},smart_rollup_not_staked_on_lcc_or_ancestor:{description:"Smart rollup not staked on LCC or its ancestor. Attempted to withdraw while not staked on the last cemented commitment or its ancestor. ",category:"temporary"},smart_rollup_not_valid_commitments_conflict:{description:"Conflicting commitments do not have a common ancestor. Conflicting commitments do not have a common ancestor ",category:"temporary"},smart_rollup_outbox_level_expired:{description:"Outbox level expired. Outbox level expired ",category:"temporary"},smart_rollup_outbox_message_already_applied:{description:"Outbox message already applied. Outbox message already applied ",category:"temporary"},"smart_rollup_outbox_message_repr.error_decoding_outbox_message":{description:"Failed to decode a rollup management protocol outbox message value. Failed to decode a rollup management protocol outbox message value ",category:"temporary"},"smart_rollup_outbox_message_repr.error_encoding_outbox_message":{description:"Failed to encode a rollup management protocol outbox message value. Failed to encode a rollup management protocol outbox message value ",category:"temporary"},smart_rollup_outdated_whitelist_update:{description:"Outdated whitelist update. Outdated whitelist update ",category:"temporary"},smart_rollup_parent_not_lcc:{description:"Parent is not the last cemented commitment. Parent is not the last cemented commitment. ",category:"temporary"},smart_rollup_proof_check:{description:"Invalid proof. An invalid proof has been submitted ",category:"temporary"},smart_rollup_remove_lcc_or_ancestor:{description:"Can not remove a staker. Can not remove a staker committed on cemented. ",category:"temporary"},smart_rollup_riscv_output_proof_verification_failed:{description:"Output proof verification failed. Output proof verification failed ",category:"temporary"},smart_rollup_riscv_proof_production_failed:{description:"Proof production failed. Proof production failed ",category:"temporary"},smart_rollup_riscv_proof_verification_failed:{description:"Proof verification failed. Proof verification failed ",category:"temporary"},smart_rollup_rollup_is_public:{description:"No commitment to cement. No commitment to cement ",category:"temporary"},smart_rollup_staker_double_stake:{description:"Staker tried to double stake. Staker tried to double stake. ",category:"temporary"},smart_rollup_staker_funds_too_low:{description:"Staker does not have enough funds to make a deposit. Staker doesn't have enough funds to make a smart rollup deposit. ",category:"temporary"},smart_rollup_staker_in_game:{description:"Staker is already playing a game. Attempted to start a game where one staker is already busy ",category:"temporary"},smart_rollup_staker_not_in_whitelist:{description:"No commitment to cement. No commitment to cement ",category:"temporary"},smart_rollup_timeout_level_not_reached:{description:"Attempt to timeout game too early. Attempt to timeout game too early ",category:"temporary"},smart_rollup_too_far_ahead:{description:"Commitment too far ahead. Commitment is too far ahead of the last cemented commitment. ",category:"temporary"},smart_rollup_unknown_commitment:{description:"Unknown commitment. Unknown commitment. ",category:"temporary"},smart_rollup_wasm_invalid_claim_about_outbox:{description:"Invalid claim about outbox. Invalid claim about outbox ",category:"temporary"},smart_rollup_wasm_invalid_dissection_distribution:{description:"Invalid dissection distribution: not all ticks are a multiplier of the maximum number of ticks of a snapshot. Invalid dissection distribution: not all ticks are a multiplier of the maximum number of ticks of a snapshot ",category:"temporary"},smart_rollup_wasm_output_proof_production_failed:{description:"Output proof production failed. Output proof production failed ",category:"temporary"},smart_rollup_wasm_output_proof_verification_failed:{description:"Output proof verification failed. Output proof verification failed ",category:"temporary"},smart_rollup_wasm_proof_production_failed:{description:"Proof production failed. Proof production failed ",category:"temporary"},smart_rollup_wasm_proof_verification_failed:{description:"Proof verification failed. Proof verification failed ",category:"temporary"},smart_rollup_whitelist_disabled:{description:"Invalid whitelist: must be None when the feature is deactivated. The whitelist must be None when the feature is deactivated. ",category:"temporary"},smart_rollup_wrong_staker_for_conflict_commitment:{description:"Given commitment is not staked by given staker. Given commitment is not staked by given staker ",category:"temporary"},smart_rollup_wrong_turn:{description:"Attempt to play move but not staker’s turn. Attempt to play move but not staker's turn ",category:"temporary"},smart_rollup_zero_tick_commitment:{description:"Tried to publish a 0 tick commitment. Tried to publish a 0 tick commitment ",category:"temporary"},"storage_exhausted.operation":{description:"Storage quota exceeded for the operation. A script or one of its callee wrote more bytes than the operation said it would ",category:"temporary"},storage_limit_too_high:{description:"Storage limit out of protocol hard bounds. A transaction tried to exceed the hard limit on storage ",category:"temporary"},"tez.addition_overflow":{description:"Overflowing tez addition. An addition of two tez amounts overflowed ",category:"temporary"},"tez.invalid_divisor":{description:"Invalid tez divisor. Multiplication of a tez amount by a non positive integer ",category:"temporary"},"tez.multiplication_overflow":{description:"Overflowing tez multiplication. A multiplication of a tez amount by an integer overflowed ",category:"temporary"},"tez.negative_multiplicator":{description:"Negative tez multiplicator. Multiplication of a tez amount by a negative integer ",category:"temporary"},"tez.subtraction_underflow":{description:"Underflowing tez subtraction. A subtraction of two tez amounts underflowed (i.e., would have led to a negative amount) ",category:"temporary"},timestamp_add:{description:"Timestamp add. Overflow when adding timestamps. ",category:"temporary"},timestamp_sub:{description:"Timestamp sub. Subtracting timestamps resulted in negative period. ",category:"temporary"},too_many_internal_operations:{description:"Too many internal operations. A transaction exceeded the hard limit of internal operations it can emit ",category:"temporary"},undefined_operation_nonce:{description:"Ill timed access to the origination nonce. An origination was attempted out of the scope of a manager operation ",category:"temporary"},undetermined_issuance_coeff_for_cycle:{description:"Undetermined issuance coeff for cycle. Issuance coefficient is only determined for the current cycle and the next [consensus_rights_delay] cycles to come. Requested cycle is not in this window. ",category:"temporary"},unexpected_level:{description:"Unexpected level. Level must be non-negative. ",category:"temporary"},unexpected_nonce_length:{description:"Unexpected nonce length. Nonce length is incorrect. ",category:"temporary"},"validate.block.inconsistent_validation_passes_in_block":{description:"Inconsistent validation passes in block. Validation of operation should be ordered by their validation passes in a block. ",category:"temporary"},"validate.block.insufficient_locked_round_evidence":{description:"Insufficient locked round evidence. Insufficient locked round evidence. ",category:"temporary"},"validate.block.invalid_double_baking_evidence":{description:"Invalid double baking evidence. A double-baking evidence is inconsistent (two distinct levels) ",category:"temporary"},"validate.block.invalid_payload_hash":{description:"Invalid payload hash. Invalid payload hash. ",category:"temporary"},"validate.block.locked_round_after_block_round":{description:"Locked round after block round. Locked round after block round. ",category:"temporary"},"validate.block.not_enough_attestations":{description:"Not enough attestations. The block being validated does not include the required minimum number of attestations. ",category:"temporary"},"validate.consensus_operation_for_future_level":{description:"Consensus operation for future level. Consensus operation for future level. ",category:"temporary"},"validate.consensus_operation_for_future_round":{description:"Consensus operation for future round. Consensus operation for future round. ",category:"temporary"},"validate.consensus_operation_for_old_level":{description:"Consensus operation for old level. Consensus operation for old level. ",category:"temporary"},"validate.consensus_operation_for_old_round":{description:"Consensus operation for old round. Consensus operation for old round. ",category:"temporary"},"validate.consensus_operation_not_allowed":{description:"Consensus operation not allowed. Consensus operation not allowed. ",category:"temporary"},"validate.double_inclusion_of_consensus_operation":{description:"Double inclusion of consensus operation. Double inclusion of consensus operation. ",category:"temporary"},"validate.operation.already_dal_denounced":{description:"Already denounced for DAL entrapement. The same DAL denunciation has already been validated. ",category:"temporary"},"validate.operation.already_denounced":{description:"Already denounced. The same denunciation has already been validated. ",category:"temporary"},"validate.operation.already_proposed":{description:"Already proposed. The delegate has already submitted one of the operation's proposals. ",category:"temporary"},"validate.operation.already_submitted_a_ballot":{description:"Already submitted a ballot. The delegate has already submitted a ballot for the current voting period. ",category:"temporary"},"validate.operation.ballot_for_wrong_proposal":{description:"Ballot for wrong proposal. Ballot provided for a proposal that is not the current one. ",category:"temporary"},"validate.operation.block.dal_denunciation_not_allowed_just_after_migration":{description:"DAL denunciations are not allowed just after migration. DAL denunciations are not allows just after the migration. ",category:"temporary"},"validate.operation.block.inconsistent_denunciation":{description:"Inconsistent denunciation. A denunciation operation is inconsistent (two distinct delegates) ",category:"temporary"},"validate.operation.block.invalid_dal_shard_index":{description:"Invalid DAL shard index. The given shard index is out of range of representable shard indices ",category:"temporary"},"validate.operation.block.invalid_denunciation":{description:"Invalid denunciation. A denunciation is malformed ",category:"temporary"},"validate.operation.block.outdated_dal_denunciation":{description:"Outdated DAL denunciation. A DAL denunciation is outdated. ",category:"temporary"},"validate.operation.block.outdated_denunciation":{description:"Outdated denunciation. A denunciation is outdated. ",category:"temporary"},"validate.operation.block.too_early_dal_denunciation":{description:"Too early DAL denunciation. A DAL denunciation is for a future level ",category:"temporary"},"validate.operation.block.too_early_denunciation":{description:"Too early denunciation. A denunciation is for a future level ",category:"temporary"},"validate.operation.conflict_too_many_proposals":{description:"Conflict too many proposals. The delegate exceeded the maximum number of allowed proposals due to, among others, previous Proposals operations in the current block/mempool. ",category:"temporary"},"validate.operation.conflicting_activation":{description:"Account already activated in current validation_state. The account has already been activated by a previous operation in the current validation state. ",category:"temporary"},"validate.operation.conflicting_ballot":{description:"Conflicting ballot. The delegate has already submitted a ballot in a previously validated operation of the current block or mempool. ",category:"temporary"},"validate.operation.conflicting_dal_entrapment":{description:"Conflicting DAL entrapment in the current validation state). A DAL entrapment evidence for the same level and a larger DAL attestation has already been validated for the current validation state. ",category:"temporary"},"validate.operation.conflicting_denunciation":{description:"Conflicting denunciation in current validation state. The same denunciation has already been validated in the current validation state. ",category:"temporary"},"validate.operation.conflicting_drain":{description:"Conflicting drain in the current validation state). A manager operation or another drain operation is in conflict. ",category:"temporary"},"validate.operation.conflicting_nonce_revelation":{description:"Conflicting nonce revelation in the current validation state). A revelation for the same nonce has already been validated for the current validation state. ",category:"temporary"},"validate.operation.conflicting_proposals":{description:"Conflicting proposals. The current block/mempool already contains a testnest dictator proposals operation, so it cannot have any other voting operation. ",category:"temporary"},"validate.operation.conflicting_vdf_revelation":{description:"Conflicting vdf revelation in the current validation state). A revelation for the same vdf has already been validated for the current validation state. ",category:"temporary"},"validate.operation.empty_proposals":{description:"Empty proposals. Proposal list cannot be empty. ",category:"temporary"},"validate.operation.failing_noop_error":{description:"Failing_noop error. A failing_noop operation can never be validated. ",category:"temporary"},"validate.operation.gas_quota_exceeded_init_deserialize":{description:"Not enough gas for initial deserialization of script expressions. Gas limit was not high enough to deserialize the transaction parameters or origination script code or initial storage etc., making the operation impossible to parse within the provided gas bounds. ",category:"temporary"},"validate.operation.inconsistent_counters":{description:"Inconsistent counters in operation. Inconsistent counters in operation batch. Counters must be increasing and consecutive. ",category:"temporary"},"validate.operation.inconsistent_sources":{description:"Inconsistent sources in operation batch. Inconsistent sources in operation batch. All operations in a batch must have the same source. ",category:"temporary"},"validate.operation.incorrect_reveal_position":{description:"Incorrect reveal position. Incorrect reveal operation position in batch: only allowed in first position. ",category:"temporary"},"validate.operation.insufficient_gas_for_manager":{description:"Not enough gas for initial manager cost. Gas limit is too low to cover the initial cost of manager operations: a minimum of 100 gas units is required. ",category:"temporary"},"validate.operation.invalid_activation":{description:"Invalid activation. The given key and secret do not correspond to any existing preallocated contract. ",category:"temporary"},"validate.operation.manager_restriction":{description:"Manager restriction. An operation with the same manager has already been validated in the current block. ",category:"temporary"},"validate.operation.proposals_contain_duplicate":{description:"Proposals contain duplicate. The list of proposals contains a duplicate element. ",category:"temporary"},"validate.operation.source_not_in_vote_listings":{description:"Source not in vote listings. The delegate is not in the vote listings. ",category:"temporary"},"validate.operation.testnet_dictator_multiple_proposals":{description:"Testnet dictator multiple proposals. A testnet dictator cannot submit more than one proposal at a time. ",category:"temporary"},"validate.operation.wrong_voting_period_index":{description:"Wrong voting period index. The voting operation contains a voting period index different from the current one. ",category:"temporary"},"validate.operation.wrong_voting_period_kind":{description:"Wrong voting period kind. The voting operation is incompatible the current voting period kind. ",category:"temporary"},"validate.operation.zk_rollup_disabled":{description:"ZK rollups are disabled. ZK rollups will be enabled in a future proposal. ",category:"temporary"},"validate.preattestation_round_too_high":{description:"Preattestation round too high. Preattestation round too high. ",category:"temporary"},"validate.temporarily_forbidden_delegate":{description:"Temporarily forbidden delegate. The delegate has committed too many misbehaviours. ",category:"temporary"},"validate.unexpected_attestation_in_block":{description:"Unexpected attestation in block. Unexpected attestation in block. ",category:"temporary"},"validate.unexpected_preattestation_in_block":{description:"Unexpected preattestation in block. Unexpected preattestation in block. ",category:"temporary"},"validate.wrong_payload_hash_for_consensus_operation":{description:"Wrong payload hash for consensus operation. Wrong payload hash for consensus operation. ",category:"temporary"},"validate.wrong_slot_for_consensus_operation":{description:"Wrong slot for consensus operation. Wrong slot used for a preattestation or attestation. ",category:"temporary"},"vdf.previously_revealed":{description:"Previously revealed VDF. Duplicate VDF revelation in cycle ",category:"temporary"},"vdf.too_early_revelation":{description:"Too early VDF revelation. VDF revelation before the end of the nonce revelation period ",category:"temporary"},"vdf.unverified_result":{description:"Unverified VDF. VDF verification failed ",category:"temporary"},viewCallbackOriginationFailed:{description:"View callback origination failed. View callback origination failed ",category:"temporary"},viewNeverReturns:{description:"A view never returned a transaction to the given callback contract. A view never initiated a transaction to the given callback contract. ",category:"temporary"},viewNotFound:{description:"A view could not be found. The contract does not have a view of the given name. ",category:"temporary"},viewUnexpectedReturn:{description:"A view returned an unexpected list of operations. A view initiated a list of operations while the TZIP-4 standard expects only a transaction to the given callback contract. ",category:"temporary"},viewedContractHasNoScript:{description:"Viewed contract has no script. A view was called on a contract with no script. ",category:"temporary"},viewerUnexpectedStorage:{description:"A VIEW instruction returned an unexpected value. A VIEW instruction returned an unexpected value. ",category:"temporary"},wrong_fitness:{description:"Wrong fitness. Wrong fitness. ",category:"temporary"},zk_rollup_does_not_exist:{description:"ZK Rollup does not exist. Attempted to use a ZK rollup that has not been originated. ",category:"temporary"},"zk_rollup_invalid_op code":{description:"Invalid op code in append. Invalid op code in append ",category:"temporary"},zk_rollup_negative_length:{description:"Negative length for pending list prefix. Negative length for pending list prefix ",category:"temporary"},zk_rollup_pending_list_too_short:{description:"Pending list is too short. Pending list is too short ",category:"temporary"},zk_rollup_ticket_payload_size_limit_exceeded:{description:"The payload of the deposited ticket exceeded the size limit. The payload of the deposited ticket exceeded the size limit ",category:"temporary"},"node.bootstrap_pipeline.invalid_locator":{description:"Invalid block locator. Block locator is invalid. ",category:"permanent"},"node.bootstrap_pipeline.too_short_locator":{description:"Too short locator. Block locator is too short. ",category:"permanent"},"node.config.trusted_setup_not_found":{description:"No trusted setup found. No trusted setup found in the explored paths ",category:"permanent"},"node.mempool.rejected_by_full_mempool":{description:"Operation fees are too low to be considered in full mempool. Operation fees are too low to be considered in full mempool ",category:"temporary"},"node.mempool.removed_from_full_mempool":{description:"Operation removed from full mempool because its fees are too low. Operation removed from full mempool because its fees are too low ",category:"temporary"},"node.p2p_conn.peer_discovery_disabled":{description:"Peer discovery disabled. The peer discovery is disabled, sending advertise messages is forbidden. ",category:"permanent"},"node.p2p_connect_handler.identity_check_failure":{description:"Unexpected peer identity. Peer announced an identity which does not match the one specified on the command-line. ",category:"permanent"},"node.p2p_io_scheduler.connection_closed":{description:"Connection closed. IO error: connection with a peer is closed. ",category:"permanent"},"node.p2p_io_scheduler.connection_error":{description:"Connection error. IO error: connection error while reading from a peer. ",category:"permanent"},"node.p2p_maintenance.disabled":{description:"Maintenance disabled. Attempt to trigger the maintenance failed as the maintenance is disabled. ",category:"permanent"},"node.p2p_pool.connected":{description:"Connected. Fail to connect with a peer: a connection is already established. ",category:"permanent"},"node.p2p_pool.connection_failed":{description:"TCP connection failed. TCP connection failed (refused or no route to host). ",category:"permanent"},"node.p2p_pool.disabled":{description:"P2P layer disabled. The P2P layer on this node is not active. ",category:"permanent"},"node.p2p_pool.peer_banned":{description:"Peer Banned. The peer identity you tried to connect is banned. ",category:"permanent"},"node.p2p_pool.pending_connection":{description:"Pending connection. Fail to connect with a peer: a connection is already pending. ",category:"permanent"},"node.p2p_pool.point_banned":{description:"Point Banned. The address you tried to connect is banned. ",category:"permanent"},"node.p2p_pool.private_mode":{description:"Private mode. Node is in private mode. ",category:"permanent"},"node.p2p_pool.rejected":{description:"Rejected peer. Connection to peer was rejected by us. ",category:"permanent"},"node.p2p_pool.too_many_connections":{description:"Too many connections. Too many connections. ",category:"permanent"},"node.p2p_socket.decipher_error":{description:"Decipher error. An error occurred while deciphering. ",category:"permanent"},"node.p2p_socket.decoding_error":{description:"Decoding error. An error occurred while decoding. ",category:"permanent"},"node.p2p_socket.invalid_auth":{description:"Invalid authentication. Rejected peer connection: invalid authentication. ",category:"permanent"},"node.p2p_socket.invalid_chunks_size":{description:"Invalid chunks size. Size of chunks is not valid. ",category:"permanent"},"node.p2p_socket.invalid_incoming_ciphertext_size":{description:"Invalid incoming ciphertext size. The announced size for the incoming ciphertext is invalid. ",category:"permanent"},"node.p2p_socket.invalid_message_size":{description:"Invalid message size. The size of the message to be written is invalid. ",category:"permanent"},"node.p2p_socket.myself":{description:"Myself. Remote peer is actually yourself. ",category:"permanent"},"node.p2p_socket.not_enough_proof_of_work":{description:"Not enough proof of work. Remote peer cannot be authenticated: not enough proof of work. ",category:"permanent"},"node.p2p_socket.rejected_by_nack":{description:"Rejected socket connection by Nack. Rejected peer connection: The peer rejected the socket connection by Nack with a list of alternative peers. ",category:"permanent"},"node.p2p_socket.rejected_no_common_protocol":{description:"Rejected socket connection - no common network protocol. Rejected peer connection: rejected socket connection as we have no common network protocol with the peer. ",category:"permanent"},"node.p2p_socket.rejected_socket_connection":{description:"Rejected socket connection. Rejected peer connection: rejected socket connection. ",category:"permanent"},"node.p2p_socket.rejecting_incoming":{description:"Rejecting socket connection. Rejecting peer connection with motive. ",category:"permanent"},"node.peer_validator.known_invalid":{description:"Known invalid. Known invalid block found in the peer's chain ",category:"permanent"},"node.peer_validator.unknown_ancestor":{description:"Unknown ancestor. Unknown ancestor block found in the peer's chain ",category:"permanent"},"node.prevalidation.future_block_header":{description:"Future block header. The block was annotated with a time too far in the future. ",category:"temporary"},"node.prevalidation.oversized_operation":{description:"Oversized operation. The operation size is bigger than allowed. ",category:"permanent"},"node.prevalidation.parse_error":{description:"Parsing error in prevalidation. Raised when an operation has not been parsed correctly during prevalidation. ",category:"permanent"},"node.prevalidation.too_many_operations":{description:"Too many pending operations in prevalidation. The prevalidation context is full. ",category:"temporary"},"node.protocol_validator.cannot_load_protocol":{description:"Cannot load protocol. Cannot load protocol from disk ",category:"permanent"},"node.protocol_validator.invalid_protocol":{description:"Invalid protocol. Invalid protocol. ",category:"permanent"},"node.state.bad_data_dir":{description:"Bad data directory. The data directory could not be read. This could be because it was generated with an old version of the octez-node program. Deleting and regenerating this directory may fix the problem. ",category:"permanent"},"node.state.block.inconsistent_context_hash":{description:"Inconsistent commit hash. When committing the context of a block, the announced context hash was not the one computed at commit time. ",category:"permanent"},"node.state.block.missing_block_metadata_hash":{description:"Missing block metadata hash. A block was expected to commit to a block metadata hash, however none was given. ",category:"permanent"},"node.state.block.missing_operation_metadata_hashes":{description:"Missing operation metadata hashes. A block was expected to commit to operation metadata hashes, however none were given. ",category:"permanent"},"node.state.block_not_invalid":{description:"Block not invalid. The invalid block to be unmarked was not actually invalid. ",category:"permanent"},"node.state.unknown_chain":{description:"Unknown chain. The chain identifier could not be found in the chain identifiers table. ",category:"permanent"},"node.validator.checkpoint_error":{description:"Block incompatible with the current checkpoint. The block belongs to a branch that is not compatible with the current checkpoint. ",category:"branch"},"node.validator.inactive_chain":{description:"Inactive chain. Attempted validation of a block from an inactive chain. ",category:"branch"},"validator.cannot_process_request_while_shutting_down":{description:"Cannot process request while shutting down. Cannot process request while the node is shutting down. ",category:"temporary"},"validator.inconsistent_operations_hash":{description:"Invalid merkle tree. The provided list of operations is inconsistent with the block header. ",category:"temporary"},"validator.invalid_block":{description:"Invalid block. Invalid block. ",category:"permanent"},"validator.missing_test_protocol":{description:"Missing test protocol. Missing test protocol when forking the test chain ",category:"temporary"},"validator.unavailable_protocol":{description:"Missing protocol. The protocol required for validating a block is missing. ",category:"temporary"},"validator.validation_process_failed":{description:"Validation process failed. Failed to validate block using external validation process. ",category:"temporary"},"micheline.parse_error.annotation_exceeds_max_length":{description:"Micheline parser error: annotation exceeds max length. While parsing a piece of Micheline source, an annotation exceeded the maximum length (255). ",category:"permanent"},"micheline.parse_error.empty_expression":{description:"Micheline parser error: empty_expression. Tried to interpret an empty piece or Micheline source as a single expression. ",category:"permanent"},"micheline.parse_error.extra_token":{description:"Micheline parser error: extra token. While parsing a piece of Micheline source, an extra semi colon or parenthesis was encountered. ",category:"permanent"},"micheline.parse_error.invalid_hex_bytes":{description:"Micheline parser error: invalid hex bytes. While parsing a piece of Micheline source, a byte sequence (0x...) was not valid as a hex byte. ",category:"permanent"},"micheline.parse_error.invalid_utf8_sequence":{description:"Micheline parser error: invalid UTF-8 sequence. While parsing a piece of Micheline source, a sequence of bytes that is not valid UTF-8 was encountered. ",category:"permanent"},"micheline.parse_error.misaligned_node":{description:"Micheline parser error: misaligned node. While parsing a piece of Micheline source, an expression was not aligned with its siblings of the same mother application or sequence. ",category:"permanent"},"micheline.parse_error.missing_break_after_number":{description:"Micheline parser error: missing break after number. While parsing a piece of Micheline source, a number was not visually separated from its follower token, leading to misreadability. ",category:"permanent"},"micheline.parse_error.unclosed_token":{description:"Micheline parser error: unclosed token. While parsing a piece of Micheline source, a parenthesis or a brace was unclosed. ",category:"permanent"},"micheline.parse_error.undefined_escape_sequence":{description:"Micheline parser error: undefined escape sequence. While parsing a piece of Micheline source, an unexpected escape sequence was encountered in a string. ",category:"permanent"},"micheline.parse_error.unexpected_character":{description:"Micheline parser error: unexpected character. While parsing a piece of Micheline source, an unexpected character was encountered. ",category:"permanent"},"micheline.parse_error.unexpected_token":{description:"Micheline parser error: unexpected token. While parsing a piece of Micheline source, an unexpected token was encountered. ",category:"permanent"},"micheline.parse_error.unterminated_comment":{description:"Micheline parser error: unterminated comment. While parsing a piece of Micheline source, a commentX was not terminated. ",category:"permanent"},"micheline.parse_error.unterminated_integer":{description:"Micheline parser error: unterminated integer. While parsing a piece of Micheline source, an integer was not terminated. ",category:"permanent"},"micheline.parse_error.unterminated_string":{description:"Micheline parser error: unterminated string. While parsing a piece of Micheline source, a string was not terminated. ",category:"permanent"},"rpc_client.request_failed":{description:"Request failed. ",category:"permanent"},"Block_validator_process.applying_non_validated_block":{description:"Applying non validated block. Applying non validated block ",category:"permanent"},"Block_validator_process.failed_to_checkout_context":{description:"Fail during checkout context. The context checkout failed using a given hash ",category:"permanent"},"RPC.Empty_error_list":{description:"RPC returned an empty list of errors. The RPC returned with an error code but no associated error. ",category:"branch"},"RPC.Unexpected_error_encoding":{description:"RPC fails with an unparsable error message. The RPC returned with an error code, and the associated body was not a valid error trace. It is likely that the answer does not comes directly from a compatible node. ",category:"branch"},"RPC_context.Gone":{description:"RPC lookup failed because of deleted data. RPC lookup failed. Block has been pruned and requested data deleted. ",category:"branch"},"RPC_context.Not_found":{description:"RPC lookup failed. RPC lookup failed. No RPC exists at the URL or the RPC tried to access non-existent data. ",category:"branch"},"RPC_error.bad_version":{description:"Unknown RPC version. The RPC was called with a bad version number. ",category:"permanent"},"Validator_process.system_error_while_validating":{description:"Failed to validate block because of a system error. The validator failed because of a system error ",category:"temporary"},bitfield_invalid_input:{description:"Invalid argument. A bitset function was provided an invalid input ",category:"permanent"},bitfield_invalid_position:{description:"Invalid bitfield’s position. Bitfields do not accept negative positions ",category:"permanent"},"block_validation.cannot_serialize_metadata":{description:"Cannot serialize metadata. Unable to serialize metadata ",category:"permanent"},"brassaia.context_hash.unsupported_version":{description:"Unsupported context hash version. Unsupported context hash version. ",category:"permanent"},canceled:{description:"Canceled. A promise was unexpectedly canceled ",category:"temporary"},cannot_connect_to_node_socket:{description:"Cannot connect to node socket. External validator failed to connect to the node's socket ",category:"temporary"},"cli.key.invalid_uri":{description:"Invalid key uri. A key has been provided with an invalid uri. ",category:"permanent"},"cli.signature_mismatch":{description:"Signature mismatch. The signer produced an invalid signature ",category:"permanent"},"cli.unexisting_scheme":{description:"Unexisting scheme. The requested scheme does not exist ",category:"permanent"},"cli.unregistered_key_scheme":{description:"Unregistered key scheme. A key has been provided with an unregistered scheme (no corresponding plugin) ",category:"permanent"},"cli.wrong_key_scheme":{description:"Wrong key scheme. A certain scheme type has been requested but another one was found ",category:"permanent"},"client.alpha.Bad deserialized counter":{description:"Deserialized counter does not match the stored one. The byte sequence references a multisig counter that does not match the one currently stored in the given multisig contract ",category:"permanent"},"client.alpha.ForbiddenNegativeInt":{description:"Forbidden negative int. invalid number, must a non negative natural  ",category:"permanent"},"client.alpha.InvalidAddressForSmartContract":{description:"Invalid address for smart contract. Invalid input, expected a smart contract address in base58 check notation (KT1...) ",category:"permanent"},"client.alpha.actionDeserialisation":{description:"The expression is not a valid multisig action. When trying to deserialise an action from a sequence of bytes, we got an expression that does not correspond to a known multisig action ",category:"permanent"},"client.alpha.actionUnwrappingError":{description:"The argument is not for an FA1.2 parameter. The argument's type does not correspond to that of the corresponding FA1.2 entrypoint. ",category:"permanent"},"client.alpha.badDeserializedContract":{description:"The byte sequence is not for the given multisig contract. When trying to deserialise an action from a sequence of bytes, we got an action for another multisig contract ",category:"permanent"},"client.alpha.badMaxPriorityArg":{description:"Bad -max-priority arg. invalid priority in -max-priority ",category:"permanent"},"client.alpha.badMaxWaitingTimeArg":{description:"Bad -max-waiting-time arg. invalid duration in -max-waiting-time ",category:"permanent"},"client.alpha.badMinimalFeesArg":{description:"Bad -minimal-fees arg. invalid fee threshold in -fee-threshold ",category:"permanent"},"client.alpha.badPreservedLevelsArg":{description:"Bad -preserved-levels arg. invalid number of levels in -preserved-levels ",category:"permanent"},"client.alpha.badTezArg":{description:"Bad Tez Arg. Invalid ꜩ notation in parameter. ",category:"permanent"},"client.alpha.bytesDeserialisation":{description:"The byte sequence is not a valid multisig action. When trying to deserialise an action from a sequence of bytes, we got an error ",category:"permanent"},"client.alpha.contractHasNoScript":{description:"The given contract is not a multisig contract because it has no script. A multisig command has referenced a scriptless smart contract instead of a multisig smart contract. ",category:"permanent"},"client.alpha.contractHasNoStorage":{description:"The given contract is not a multisig contract because it has no storage. A multisig command has referenced a smart contract without storage instead of a multisig smart contract. ",category:"permanent"},"client.alpha.contractHasUnexpectedStorage":{description:"The storage of the given contract is not of the shape expected for a multisig contract. A multisig command has referenced a smart contract whose storage is of a different shape than the expected one. ",category:"permanent"},"client.alpha.contractWithoutCode":{description:"The given contract has no code. Attempt to get the code of a contract failed because it has nocode. No scriptless contract should remain. ",category:"permanent"},"client.alpha.entrypointMismatch":{description:"The given contract does not implement the FA1.2 interface. An FA1.2 command has referenced a smart contract whose script does not implement at least one FA1.2 entrypoint, or with an incompatible type. See TZIP-7 (https://gitlab.com/tezos/tzip/-/blob/master/proposals/tzip-7/tzip-7.md) for documentation on FA1.2. ",category:"permanent"},"client.alpha.fa12ContractHasNoScript":{description:"The given contract is not a smart contract. An FA1.2 command has referenced a scriptless contract. ",category:"permanent"},"client.alpha.fa12ContractHasNoStorage":{description:"The given contract has no storage. An FA1.2 command made a call on a contract that has no storage. ",category:"permanent"},"client.alpha.fa12UnexpectedError":{description:"Unexpected error during FA1.2 contract interpretation. An unexpected Michelson error was reached during the interpretation of an FA1.2 contract. ",category:"permanent"},"client.alpha.illTypedArgumentForMultisig":{description:"Ill-typed argument in multi-signed transfer. The provided argument for a transfer from a multisig contract is ill-typed ",category:"permanent"},"client.alpha.illTypedLambdaForMultisig":{description:"Ill-typed lambda for multi-signed transfer. The provided lambda for a transfer from a multisig contract is ill-typed ",category:"permanent"},"client.alpha.invalidSignature":{description:"The following signature did not match a public key in the given multisig contract. A signature was given for a multisig contract that matched none of the public keys of the contract signers ",category:"permanent"},"client.alpha.michelson.macros.bas_arity":{description:"Wrong number of arguments to macro. A wrong number of arguments was provided to a macro ",category:"permanent"},"client.alpha.michelson.macros.sequence_expected":{description:"Macro expects a sequence. An macro expects a sequence, but a sequence was not provided ",category:"permanent"},"client.alpha.michelson.macros.unexpected_annotation":{description:"Unexpected annotation. A macro had an annotation, but no annotation was permitted on this macro. ",category:"permanent"},"client.alpha.michelson.stack.wrong_stack":{description:"Wrong stack. Failed to parse a typed stack. ",category:"permanent"},"client.alpha.michelson.stack.wrong_stack_item":{description:"Wrong stack item. Failed to parse an item in a typed stack. ",category:"permanent"},"client.alpha.michelson.wrong_extra_big_maps":{description:"Wrong description of a list of extra big maps. Failed to parse a description of extra big maps. ",category:"permanent"},"client.alpha.michelson.wrong_extra_big_maps_item":{description:"Wrong description of an extra big map. Failed to parse an item in a description of extra big maps. ",category:"permanent"},"client.alpha.michelson.wrong_other_contracts":{description:"Wrong description of a list of other contracts. Failed to parse a description of other contracts. ",category:"permanent"},"client.alpha.michelson.wrong_other_contracts_item":{description:"Wrong description of an other contract. Failed to parse an item in a description of other contracts. ",category:"permanent"},"client.alpha.nonPositiveThreshold":{description:"Given threshold is not positive. A multisig threshold should be a positive number ",category:"permanent"},"client.alpha.notASupportedMultisigContract":{description:"The given contract is not one of the supported contracts. A multisig command has referenced a smart contract whose script is not one of the known multisig contract scripts. ",category:"permanent"},"client.alpha.notAViewableEntrypoint":{description:"The entrypoint is not viewable. A transaction made a call on an entrypoint expecting it to implement the 'view' type. ",category:"permanent"},"client.alpha.notAnEntrypoint":{description:"The expression is not for an entrypoint. The parameter value of the contract call refers to a non-existing entrypoint. ",category:"permanent"},"client.alpha.notEnoughAllowance":{description:"The sender does not have enough allowance. An FA1.2 transfer failed because the receiver does not have enough allowance to ask for a transfer from the sender. ",category:"permanent"},"client.alpha.notEnoughBalance":{description:"The sender does not have enough balance. An FA1.2 transfer failed because the sender does not have enough balance. ",category:"permanent"},"client.alpha.notEnoughSignatures":{description:"Not enough signatures were provided for this multisig action. To run an action on a multisig contract, you should provide at least as many signatures as indicated by the threshold stored in the multisig contract. ",category:"permanent"},"client.alpha.thresholdTooHigh":{description:"Given threshold is too high. The given threshold is higher than the number of keys, this would lead to a frozen multisig contract ",category:"permanent"},"client.alpha.tzt.duplicated_toplevel":{description:"Duplicated TZT toplevel primitive. A toplevel TZT primitive was used several times. ",category:"permanent"},"client.alpha.tzt.invalid_format":{description:"Invalid format for a TZT toplevel primitive. Invalid format for a TZT toplevel primitive ",category:"permanent"},"client.alpha.tzt.invalid_toplevel":{description:"Invalid format for TZT toplevel entry. Invalid format for a TZT toplevel entry ",category:"permanent"},"client.alpha.tzt.missing_mandatory":{description:"Missing TZT mandatory toplevel primitive. A mandatory toplevel TZT primitive was missing. ",category:"permanent"},"client.alpha.tzt.unknown_toplevel":{description:"Unknown TZT toplevel primitive. A toplevel TZT primitive was unknown. ",category:"permanent"},"client.alpha.tzt.wrong_toplevel_arity":{description:"Wrong arity for a TZT toplevel primitive. A known toplevel TZT primitive was used with a bad arity. ",category:"permanent"},"client.alpha.unsafeAllowanceChange":{description:"The allowance change is unsafe. An FA1.2 non-zero allowance change failed because the current allowance is non-zero. For more explanation on why such allowance change is unsafe, please look at TZIP-7 (https://gitlab.com/tezos/tzip/-/blob/master/proposals/tzip-7/tzip-7.md#approve). ",category:"permanent"},"client.alpha.unsupportedGenericMultisigFeature":{description:"Unsupported multisig feature: generic call. This multisig contract does not feature calling contracts with arguments ",category:"permanent"},"client.alpha.unsupportedGenericMultisigFeatureTy":{description:"Unsupported multisig feature: generic call to non-unit entrypoint. This multisig contract does not feature calling contracts with arguments ",category:"permanent"},"client.alpha.unsupportedGenericMultisigLambda":{description:"Unsupported multisig feature: running lambda. This multisig contract does not feature running lambdas ",category:"permanent"},"config_file.cannot_switch_history_mode":{description:"Cannot switch history mode. Cannot switch history mode. ",category:"permanent"},"context_hash.unsupported_version":{description:"Unsupported context hash version. Unsupported context hash version. ",category:"permanent"},"dal.node.invalid_precomputation_hash":{description:"Invalid_precomputation_hash. Unexpected precomputation hash ",category:"permanent"},"dal.node.trusted_setup_loading_failed":{description:"Trusted setup loading failed. Trusted setup failed to load ",category:"permanent"},decoding_error:{description:"Decoding error. Error while decoding a value ",category:"permanent"},encoding_error:{description:"Encoding error. Error while encoding a value for a socket ",category:"permanent"},"external_process.cannot_create_socket":{description:"Cannot create socket. Cannot create socket for external process. ",category:"temporary"},"external_process.socket_path_too_long":{description:"Socket path too long. Socket path too long. ",category:"temporary"},"external_process.socket_path_wrong_permission":{description:"Wrong permission for socket path. Wrong permission for socket path. ",category:"temporary"},injection_operation_error_case:{description:"Injection operation error. The injection of this operation failed. The error trace are the following errors in this list. ",category:"permanent"},injection_operation_succeed_case:{description:"Injection operation succeed. The injection of this operation succeed among a list of injections containing at least one error. ",category:"permanent"},injection_operations_error:{description:"Injection operations error. While injecting several operations at once, one or several injections failed. ",category:"permanent"},"internal-event-activation-error":{description:"Internal Event Sink: Wrong Activation URI. Activation of an Internal Event SINK with an URI failed ",category:"permanent"},io_error:{description:"IO error. IO error ",category:"permanent"},"prevalidation.operation_conflict":{description:"Operation conflict. The operation cannot be added because the mempool already contains a conflicting operation. ",category:"temporary"},"prevalidation.operation_replacement":{description:"Operation replacement. The operation has been replaced. ",category:"temporary"},"snapshots.inconsistent_operation_hashes":{description:"Inconsistent operation hashes. The operations given do not match their hashes. ",category:"permanent"},"socket.unexpected_size_of_decoded_value":{description:"Unexpected size of decoded value. A decoded value comes from a buffer of unexpected size. ",category:"permanent"},"stdlib_unix.cannot_load_stored_data":{description:"Cannod load stored data. Failed to load stored data ",category:"permanent"},"stdlib_unix.closed":{description:"Key value stored was closed. Action performed while the store is closed ",category:"permanent"},"stdlib_unix.corrupted_data":{description:"key value store data is corrupted. A data of the key value store was corrupted ",category:"permanent"},"stdlib_unix.decoding_failed":{description:"key value store failed to decode the data. A failure was triggered while decoding the data ",category:"permanent"},"stdlib_unix.encoding_failed":{description:"key value store failed to encode the data. A failure was triggered while encoding the data ",category:"permanent"},"stdlib_unix.missing_kvs_data":{description:"Missing stored data from KVS. Failed to load stored data from KVS ",category:"permanent"},"stdlib_unix.wrong_encoded_value_size":{description:"Wrong encoded value size. Try to write a value that does not match the expected size ",category:"permanent"},"store.bad_head_invariant":{description:"Bad head invariant. Bad invariant during Store.set_head ",category:"permanent"},"store.bad_level":{description:"Bad level. Read a block at level past our current head. ",category:"permanent"},"store.bad_ordering_invariant":{description:"Bad ordering invariant. The ordering invariant does not hold ",category:"permanent"},"store.block_not_found":{description:"Block not found. Block not found ",category:"permanent"},"store.cannot_cement_blocks":{description:"Cannot cement blocks. Cannot cement blocks ",category:"temporary"},"store.cannot_cement_blocks_metadata":{description:"Cannot cement blocks metadata. Cannot cement blocks metadata ",category:"temporary"},"store.cannot_checkout_context":{description:"Cannot checkout context. Failed to checkout context ",category:"temporary"},"store.cannot_encode_block":{description:"Cannot encode block. Failed to encode block ",category:"temporary"},"store.cannot_find_chain_dir":{description:"Cannot find chain dir. Cannot find chain dir while upgrading storage ",category:"permanent"},"store.cannot_find_protocol":{description:"Cannot find protocol. Cannot find protocol ",category:"temporary"},"store.cannot_fork_testchain":{description:"Cannot fork testchain. Failed to fork testchain ",category:"temporary"},"store.cannot_instanciate_temporary_floating_store":{description:"Cannot instanciate temporary floating store. Cannot instanciate temporary floating store ",category:"temporary"},"store.cannot_load_degraded_store":{description:"Cannot load degraded store. Cannot load a degraded block store. ",category:"permanent"},"store.cannot_load_testchain":{description:"Cannot load testchain. Failed to load the testchain ",category:"temporary"},"store.cannot_merge_store":{description:"Cannot merge store. Cannot merge the store. ",category:"permanent"},"store.cannot_retrieve_savepoint":{description:"Cannot retrieve savepoint. Failed to retrieve savepoint ",category:"temporary"},"store.cannot_set_target":{description:"Cannot set target. The given block to be set as target is invalid. ",category:"temporary"},"store.cannot_store_block":{description:"Cannot store block. Failed to store block ",category:"temporary"},"store.cannot_update_floating_store":{description:"Cannot update floating store. Cannot update floating store ",category:"temporary"},"store.cannot_write_in_readonly":{description:"Cannot write in readonly. Cannot write data in store when in readonly ",category:"permanent"},"store.corrupted_store":{description:"Corrupted store. The store is corrupted ",category:"permanent"},"store.failed_to_get_live_blocks":{description:"Fail to get live blocks. Unable to compute live blocks from a given block. ",category:"permanent"},"store.failed_to_init_cemented_block_store":{description:"Failed to init cemented block store. Failed to initialize the cemented block store ",category:"temporary"},"store.fork_testchain_not_allowed":{description:"Fork testchain not allowed. Forking the test chain is not allowed ",category:"temporary"},"store.inconsistent_block_hash":{description:"Inconsistent block hash. Inconsistent block hash found ",category:"temporary"},"store.inconsistent_block_predecessor":{description:"Inconsistent block predecessor. Inconsistent block predecessor ",category:"temporary"},"store.inconsistent_cemented_file":{description:"Inconsistent cemented file. Failed to read a cemented file ",category:"temporary"},"store.inconsistent_cemented_store":{description:"Inconsistent cemented store. Failed to check indexes consistency ",category:"temporary"},"store.inconsistent_cementing_highwatermark":{description:"Inconsistent cementing highwatermark. The stored cementing highwatermark is inconsistent with the store. ",category:"permanent"},"store.inconsistent_chain_store":{description:"Inconsistent chain store. Failed to load chain store ",category:"temporary"},"store.inconsistent_genesis":{description:"Inconsistent genesis. The given genesis block is inconsistent with the store. ",category:"permanent"},"store.inconsistent_history_mode":{description:"Inconsistent history mode. The history mode does not correspond to the store. ",category:"permanent"},"store.inconsistent_protocol_commit_info":{description:"Inconsistent protocol commit info. Inconsistent protocol commit info while restoring snapshot ",category:"temporary"},"store.inconsistent_store_state":{description:"Inconsistent store state. Inconsistent store state ",category:"temporary"},"store.invalid_blocks_to_cement":{description:"Invalid blocks to cement. Invalid block list to cement ",category:"temporary"},"store.invalid_genesis_marking":{description:"Invalid genesis marking. Cannot mark genesis as invalid ",category:"temporary"},"store.invalid_head_switch":{description:"Invalid head switch. The given head is not consistent with the current store's savepoint ",category:"permanent"},"store.merge_already_running":{description:"Merge already running. The store's merge is already running ",category:"temporary"},"store.merge_error":{description:"Merge error. Error while merging the store ",category:"temporary"},"store.metadata_not_found":{description:"Block metadata not found. Block metadata not found ",category:"permanent"},"store.missing_activation_block":{description:"Missing activation block. Missing activation block while restoring snapshot ",category:"temporary"},"store.missing_commit_info":{description:"Missing commit info. Failed to retreive commit info ",category:"temporary"},"store.missing_last_preserved_block":{description:"Missing last preserved block. Current head's last preserved block (or its associated metadata) cannot be found in the store. ",category:"temporary"},"store.protocol_not_found":{description:"Protocol not found. Protocol not found ",category:"permanent"},"store.resulting_context_hash_not_found":{description:"Resulting context hash not found. Resulting context hash not found ",category:"permanent"},"store.target_mismatch":{description:"target mismatch. Target is reached but it is not a head's ancestor. ",category:"permanent"},"store.temporary_cemented_file_exists":{description:"Temporary cemented file exists. The temporary cemented file already exists ",category:"temporary"},"store.unexpected_missing_activation_block":{description:"Unexpected missing activaiton block. An activation block is unexpectedly missing from the store. ",category:"permanent"},"store.unexpected_missing_block":{description:"Unexpected missing block. A block is unexpectedly missing from the store. ",category:"permanent"},"store.unexpected_missing_block_metadata":{description:"Unexpected missing block metadata. A block's metadata is unexpectedly missing from the store. ",category:"permanent"},"store.unexpected_missing_protocol":{description:"Unexpected missing protocol. A protocol is unexpectedly missing from the store. ",category:"permanent"},"store.wrong_floating_kind_swap":{description:"Wrong floating kind swap. Try to swap wrong floating store kind ",category:"temporary"},"store.wrong_predecessor":{description:"Wrong predecessor. Failed to get block's predecessor ",category:"temporary"},unexpected_size_of_encoded_value:{description:"Unexpected size of encoded value. An encoded value is not of the expected size. ",category:"permanent"},"unix.system_info":{description:"Unix System_info failure. Unix System_info failure ",category:"temporary"},unix_error:{description:"Unix error. An unhandled unix exception ",category:"temporary"},"utils.Timeout":{description:"Timeout. Timeout ",category:"temporary"}},CustomError=class extends Error{constructor(s){super(s),this.name="CustomError"}},BeaconError=class extends CustomError{constructor(a,u){super(a);ei(this,"errorType");this.name="BeaconError",this.errorType=u}},WalletConnectError=class extends CustomError{constructor(a,u,l,f){const c=(l==null?void 0:l.peer.metadata.name)??"unknown";super(l?`Request from ${c} is rejected. ${a}`:a);ei(this,"code");ei(this,"context");this.name="WalletConnectError",this.code=u,this.context=f}},getTezErrorMessage=s=>{if(s.includes("subtraction_underflow"))return"Insufficient balance, please make sure you have enough funds.";if(s.includes("contract.non_existing_contract"))return"Contract does not exist, please check if the correct network is selected.";if(s.includes("staking_to_delegate_that_refuses_external_staking"))return"The baker you are trying to stake to does not accept external staking.";if(s.includes("empty_implicit_delegated_contract"))return"Emptying an implicit delegated account is not allowed. End delegation before trying again.";if(s.includes("delegate.unchanged"))return"The delegate is unchanged. Delegation to this address is already done.";if(s.includes("contract.manager.unregistered_delegate"))return"The provided delegate address is not registered as a delegate. Verify the delegate address and ensure it is active.";if(s.includes("michelson_v1.script_rejected"))return"The contract code failed to run. Please check the contract.";for(const[a,{description:u}]of Object.entries(TezosRpcErrors))if(s.includes(a))return u},getHttpErrorMessage=s=>{const a="Please try again later or contact support.";return{400:"Bad Request - The server could not understand the request. Please check your input and try again.",401:"Unauthorized - Authentication is required or has failed. Please log in and try again.",403:"Forbidden - You do not have permission to access the requested resource. Contact support if you believe this is an error.",404:`Not Found - The requested resource could not be found. ${a}`,405:`Method Not Allowed - The HTTP method is not supported by the resource. ${a}`,408:"Request Timeout - The server timed out waiting for the request. Please check your network connection and try again.",409:`Conflict - There is a conflict with the current state of the resource. ${a}`,410:`Gone - The resource is no longer available. It may have been removed or retired. ${a}`,500:`Internal Server Error - An unexpected error occurred on the server. ${a}`,501:"Not Implemented - The server does not support the functionality required to fulfill the request. Contact support for assistance.",502:"Bad Gateway - The server received an invalid response from the upstream server. Please try again later.",503:`Service Unavailable - The server is temporarily unable to handle the request. ${a}`,504:"Gateway Timeout - The server did not receive a timely response from the upstream server. Check your network and try again."}[s]||`Unknown Error - Status code: ${s}. Please try again later or contact support.`};function stripHtmlTags(s){return sanitizeHtml(s,{allowedTags:[],allowedAttributes:{}}).replace(/[\r\n]/g," ").replace(/\s+/g," ").trim()}var isTezosOperationErrorWithMessage=s=>"with"in s,getErrorContext=(s,a=!1)=>{const u="Something went wrong. Please try again. Contact support if the issue persists.";let l=u,f,c=-32603;const h=typeof s=="string"?s:s.message;let p="";if(typeof s=="object"&&"stack"in s?p=s.stack:typeof s=="string"&&(f=s),s instanceof BeaconError)l=h;else if(s instanceof WalletConnectError)c=s.code,l=h,f=s.context;else if(s instanceof CustomError)l=h;else if(s instanceof TezosOperationError){c=4009;const v=s.lastError;if(l="Rejected by chain. "+(getTezErrorMessage(v.id)??"")+`
Details: `+h,isTezosOperationErrorWithMessage(v)){const y=v.with;f=[v.id,{with:y}]}else f=[v.id]}else if(typeof s=="object"&&s!==null&&"status"in s&&typeof s.status=="number"&&"url"in s&&typeof s.url=="string"){const v=getHttpErrorMessage(s.status),y=stripHtmlTags(s.message);l=`HTTP request failed for ${s.url} (${s.status}) ${v}`,c=s.status,c===500&&(l=`${l}
Details: ${y}`),f=[s.status,v,s.url,y]}else(s instanceof Error||Object.prototype.hasOwnProperty.call(s,"message"))&&(l=getTezErrorMessage(h)??u,f=h);return a||console.error("Request failed",c,l,f,s),{timestamp:new Date().toISOString(),description:l,stacktrace:p,technicalDetails:f,code:c}};reactExports.createContext(void 0);const errorClasses={},deserializers={},addCustomErrorDeserializer=(s,a)=>{deserializers[s]=a},createCustomErrorClass=s=>{class a extends Error{constructor(l,f,c){if(super(l||s,c),Object.setPrototypeOf(this,a.prototype),this.name=s,f)for(const h in f)this[h]=f[h];if(c&&isObject(c)&&"cause"in c&&!("cause"in this)){const h=c.cause;this.cause=h,"stack"in h&&(this.stack=this.stack+`
CAUSE: `+h.stack)}}}return errorClasses[s]=a,a};function isObject(s){return typeof s=="object"}const deserializeError=s=>{if(s&&typeof s=="object"){try{if(typeof s.message=="string"){const u=JSON.parse(s.message);u.message&&u.name&&(s=u)}}catch{}let a;if(typeof s.name=="string"){const{name:u}=s,l=deserializers[u];if(l)a=l(s);else{let f=u==="Error"?Error:errorClasses[u];f||(console.warn("deserializing an unknown class '"+u+"'"),f=createCustomErrorClass(u)),a=Object.create(f.prototype);try{for(const c in s)s.hasOwnProperty(c)&&(a[c]=s[c])}catch{}}}else typeof s.message=="string"&&(a=new Error(s.message));return a&&!a.stack&&Error.captureStackTrace&&Error.captureStackTrace(a,deserializeError),a}return new Error(String(s))},serializeError=s=>s&&(typeof s=="object"?destroyCircular(s,[]):typeof s=="function"?`[Function: ${s.name||"anonymous"}]`:s);function destroyCircular(s,a){const u={};a.push(s);for(const l of Object.keys(s)){const f=s[l];if(typeof f!="function"){if(!f||typeof f!="object"){u[l]=f;continue}if(a.indexOf(s[l])===-1){u[l]=destroyCircular(s[l],a.slice(0));continue}u[l]="[Circular]"}}return typeof s.name=="string"&&(u.name=s.name),typeof s.message=="string"&&(u.message=s.message),typeof s.stack=="string"&&(u.stack=s.stack),u}const AccountNameRequiredError=createCustomErrorClass("AccountNameRequired"),AccountNotSupported=createCustomErrorClass("AccountNotSupported"),AccountAwaitingSendPendingOperations=createCustomErrorClass("AccountAwaitingSendPendingOperations"),AmountRequired=createCustomErrorClass("AmountRequired"),BluetoothRequired=createCustomErrorClass("BluetoothRequired"),BtcUnmatchedApp=createCustomErrorClass("BtcUnmatchedApp"),CantOpenDevice=createCustomErrorClass("CantOpenDevice"),CashAddrNotSupported=createCustomErrorClass("CashAddrNotSupported"),ClaimRewardsFeesWarning=createCustomErrorClass("ClaimRewardsFeesWarning"),CurrencyNotSupported=createCustomErrorClass("CurrencyNotSupported"),DeviceAppVerifyNotSupported=createCustomErrorClass("DeviceAppVerifyNotSupported"),DeviceGenuineSocketEarlyClose=createCustomErrorClass("DeviceGenuineSocketEarlyClose"),DeviceNotGenuineError=createCustomErrorClass("DeviceNotGenuine"),DeviceOnDashboardExpected=createCustomErrorClass("DeviceOnDashboardExpected"),DeviceOnDashboardUnexpected=createCustomErrorClass("DeviceOnDashboardUnexpected"),DeviceInOSUExpected=createCustomErrorClass("DeviceInOSUExpected"),DeviceHalted=createCustomErrorClass("DeviceHalted"),DeviceNameInvalid=createCustomErrorClass("DeviceNameInvalid"),DeviceSocketFail=createCustomErrorClass("DeviceSocketFail"),DeviceSocketNoBulkStatus=createCustomErrorClass("DeviceSocketNoBulkStatus"),DeviceNeedsRestart=createCustomErrorClass("DeviceSocketNoBulkStatus"),UnresponsiveDeviceError=createCustomErrorClass("UnresponsiveDeviceError"),DisconnectedDevice=createCustomErrorClass("DisconnectedDevice"),DisconnectedDeviceDuringOperation=createCustomErrorClass("DisconnectedDeviceDuringOperation"),DeviceExtractOnboardingStateError=createCustomErrorClass("DeviceExtractOnboardingStateError"),DeviceOnboardingStatePollingError=createCustomErrorClass("DeviceOnboardingStatePollingError"),EnpointConfigError=createCustomErrorClass("EnpointConfig"),EthAppPleaseEnableContractData=createCustomErrorClass("EthAppPleaseEnableContractData"),FeeEstimationFailed=createCustomErrorClass("FeeEstimationFailed"),FirmwareNotRecognized=createCustomErrorClass("FirmwareNotRecognized"),HardResetFail=createCustomErrorClass("HardResetFail"),InvalidXRPTag=createCustomErrorClass("InvalidXRPTag"),InvalidAddress=createCustomErrorClass("InvalidAddress"),InvalidNonce=createCustomErrorClass("InvalidNonce"),InvalidAddressBecauseDestinationIsAlsoSource=createCustomErrorClass("InvalidAddressBecauseDestinationIsAlsoSource"),LatestMCUInstalledError=createCustomErrorClass("LatestMCUInstalledError"),UnknownMCU=createCustomErrorClass("UnknownMCU"),LedgerAPIError=createCustomErrorClass("LedgerAPIError"),LedgerAPIErrorWithMessage=createCustomErrorClass("LedgerAPIErrorWithMessage"),LedgerAPINotAvailable=createCustomErrorClass("LedgerAPINotAvailable"),ManagerAppAlreadyInstalledError=createCustomErrorClass("ManagerAppAlreadyInstalled"),ManagerAppRelyOnBTCError=createCustomErrorClass("ManagerAppRelyOnBTC"),ManagerAppDepInstallRequired=createCustomErrorClass("ManagerAppDepInstallRequired"),ManagerAppDepUninstallRequired=createCustomErrorClass("ManagerAppDepUninstallRequired"),ManagerDeviceLockedError=createCustomErrorClass("ManagerDeviceLocked"),ManagerFirmwareNotEnoughSpaceError=createCustomErrorClass("ManagerFirmwareNotEnoughSpace"),ManagerNotEnoughSpaceError=createCustomErrorClass("ManagerNotEnoughSpace"),ManagerUninstallBTCDep=createCustomErrorClass("ManagerUninstallBTCDep"),NetworkDown=createCustomErrorClass("NetworkDown"),NetworkError=createCustomErrorClass("NetworkError"),NoAddressesFound=createCustomErrorClass("NoAddressesFound"),NotEnoughBalance=createCustomErrorClass("NotEnoughBalance"),NotEnoughBalanceSwap=createCustomErrorClass("NotEnoughBalanceSwap"),NotEnoughBalanceToDelegate=createCustomErrorClass("NotEnoughBalanceToDelegate"),NotEnoughBalanceInParentAccount=createCustomErrorClass("NotEnoughBalanceInParentAccount"),NotEnoughSpendableBalance=createCustomErrorClass("NotEnoughSpendableBalance"),NotEnoughBalanceBecauseDestinationNotCreated=createCustomErrorClass("NotEnoughBalanceBecauseDestinationNotCreated"),NoAccessToCamera=createCustomErrorClass("NoAccessToCamera"),NotEnoughGas=createCustomErrorClass("NotEnoughGas"),NotEnoughGasSwap=createCustomErrorClass("NotEnoughGasSwap"),TronEmptyAccount=createCustomErrorClass("TronEmptyAccount"),MaybeKeepTronAccountAlive=createCustomErrorClass("MaybeKeepTronAccountAlive"),NotSupportedLegacyAddress=createCustomErrorClass("NotSupportedLegacyAddress"),GasLessThanEstimate=createCustomErrorClass("GasLessThanEstimate"),PriorityFeeTooLow=createCustomErrorClass("PriorityFeeTooLow"),PriorityFeeTooHigh=createCustomErrorClass("PriorityFeeTooHigh"),PriorityFeeHigherThanMaxFee=createCustomErrorClass("PriorityFeeHigherThanMaxFee"),MaxFeeTooLow=createCustomErrorClass("MaxFeeTooLow"),PasswordsDontMatchError=createCustomErrorClass("PasswordsDontMatch"),PasswordIncorrectError=createCustomErrorClass("PasswordIncorrect"),RecommendSubAccountsToEmpty=createCustomErrorClass("RecommendSubAccountsToEmpty"),RecommendUndelegation=createCustomErrorClass("RecommendUndelegation"),TimeoutTagged=createCustomErrorClass("TimeoutTagged"),UnexpectedBootloader=createCustomErrorClass("UnexpectedBootloader"),MCUNotGenuineToDashboard=createCustomErrorClass("MCUNotGenuineToDashboard"),RecipientRequired=createCustomErrorClass("RecipientRequired"),UnavailableTezosOriginatedAccountReceive=createCustomErrorClass("UnavailableTezosOriginatedAccountReceive"),UnavailableTezosOriginatedAccountSend=createCustomErrorClass("UnavailableTezosOriginatedAccountSend"),UpdateFetchFileFail=createCustomErrorClass("UpdateFetchFileFail"),UpdateIncorrectHash=createCustomErrorClass("UpdateIncorrectHash"),UpdateIncorrectSig=createCustomErrorClass("UpdateIncorrectSig"),UpdateYourApp=createCustomErrorClass("UpdateYourApp"),UserRefusedDeviceNameChange=createCustomErrorClass("UserRefusedDeviceNameChange"),UserRefusedAddress=createCustomErrorClass("UserRefusedAddress"),UserRefusedFirmwareUpdate=createCustomErrorClass("UserRefusedFirmwareUpdate"),UserRefusedAllowManager=createCustomErrorClass("UserRefusedAllowManager"),UserRefusedOnDevice=createCustomErrorClass("UserRefusedOnDevice"),PinNotSet=createCustomErrorClass("PinNotSet"),ExpertModeRequired=createCustomErrorClass("ExpertModeRequired"),TransportOpenUserCancelled=createCustomErrorClass("TransportOpenUserCancelled"),TransportInterfaceNotAvailable=createCustomErrorClass("TransportInterfaceNotAvailable"),TransportRaceCondition=createCustomErrorClass("TransportRaceCondition"),TransportWebUSBGestureRequired=createCustomErrorClass("TransportWebUSBGestureRequired"),TransactionHasBeenValidatedError=createCustomErrorClass("TransactionHasBeenValidatedError"),TransportExchangeTimeoutError=createCustomErrorClass("TransportExchangeTimeoutError"),DeviceShouldStayInApp=createCustomErrorClass("DeviceShouldStayInApp"),WebsocketConnectionError=createCustomErrorClass("WebsocketConnectionError"),WebsocketConnectionFailed=createCustomErrorClass("WebsocketConnectionFailed"),WrongDeviceForAccount=createCustomErrorClass("WrongDeviceForAccount"),WrongDeviceForAccountPayout=createCustomErrorClass("WrongDeviceForAccountPayout"),WrongDeviceForAccountRefund=createCustomErrorClass("WrongDeviceForAccountRefund"),WrongAppForCurrency=createCustomErrorClass("WrongAppForCurrency"),ETHAddressNonEIP=createCustomErrorClass("ETHAddressNonEIP"),CantScanQRCode=createCustomErrorClass("CantScanQRCode"),FeeNotLoaded=createCustomErrorClass("FeeNotLoaded"),FeeNotLoadedSwap=createCustomErrorClass("FeeNotLoadedSwap"),FeeRequired=createCustomErrorClass("FeeRequired"),FeeTooHigh=createCustomErrorClass("FeeTooHigh"),PendingOperation=createCustomErrorClass("PendingOperation"),SyncError=createCustomErrorClass("SyncError"),PairingFailed=createCustomErrorClass("PairingFailed"),PeerRemovedPairing=createCustomErrorClass("PeerRemovedPairing"),GenuineCheckFailed=createCustomErrorClass("GenuineCheckFailed"),LedgerAPI4xx=createCustomErrorClass("LedgerAPI4xx"),LedgerAPI5xx=createCustomErrorClass("LedgerAPI5xx"),FirmwareOrAppUpdateRequired=createCustomErrorClass("FirmwareOrAppUpdateRequired"),ReplacementTransactionUnderpriced=createCustomErrorClass("ReplacementTransactionUnderpriced"),OpReturnDataSizeLimit=createCustomErrorClass("OpReturnSizeLimit"),DustLimit=createCustomErrorClass("DustLimit"),LanguageNotFound=createCustomErrorClass("LanguageNotFound"),NoDBPathGiven=createCustomErrorClass("NoDBPathGiven"),DBWrongPassword=createCustomErrorClass("DBWrongPassword"),DBNotReset=createCustomErrorClass("DBNotReset"),SequenceNumberError=createCustomErrorClass("SequenceNumberError"),DisabledTransactionBroadcastError=createCustomErrorClass("DisabledTransactionBroadcastError");var HwTransportErrorType;(function(s){s.Unknown="Unknown",s.LocationServicesDisabled="LocationServicesDisabled",s.LocationServicesUnauthorized="LocationServicesUnauthorized",s.BluetoothScanStartFailed="BluetoothScanStartFailed"})(HwTransportErrorType||(HwTransportErrorType={}));class HwTransportError extends Error{constructor(a,u){super(u),this.name="HwTransportError",this.type=a,Object.setPrototypeOf(this,HwTransportError.prototype)}}class TransportError extends Error{constructor(a,u){const l="TransportError";super(a||l),this.name=l,this.message=a,this.stack=new Error(a).stack,this.id=u}}addCustomErrorDeserializer("TransportError",s=>new TransportError(s.message,s.id));const StatusCodes={ACCESS_CONDITION_NOT_FULFILLED:38916,ALGORITHM_NOT_SUPPORTED:38020,CLA_NOT_SUPPORTED:28160,CODE_BLOCKED:38976,CODE_NOT_INITIALIZED:38914,COMMAND_INCOMPATIBLE_FILE_STRUCTURE:27009,CONDITIONS_OF_USE_NOT_SATISFIED:27013,CONTRADICTION_INVALIDATION:38928,CONTRADICTION_SECRET_CODE_STATUS:38920,DEVICE_IN_RECOVERY_MODE:26159,CUSTOM_IMAGE_EMPTY:26158,FILE_ALREADY_EXISTS:27273,FILE_NOT_FOUND:37892,GP_AUTH_FAILED:25344,HALTED:28586,INCONSISTENT_FILE:37896,INCORRECT_DATA:27264,INCORRECT_LENGTH:26368,INCORRECT_P1_P2:27392,INS_NOT_SUPPORTED:27904,DEVICE_NOT_ONBOARDED:27911,DEVICE_NOT_ONBOARDED_2:26129,INVALID_KCV:38021,INVALID_OFFSET:37890,LICENSING:28482,LOCKED_DEVICE:21781,MAX_VALUE_REACHED:38992,MEMORY_PROBLEM:37440,MISSING_CRITICAL_PARAMETER:26624,NO_EF_SELECTED:37888,NOT_ENOUGH_MEMORY_SPACE:27268,OK:36864,PIN_REMAINING_ATTEMPTS:25536,REFERENCED_DATA_NOT_FOUND:27272,SECURITY_STATUS_NOT_SATISFIED:27010,TECHNICAL_PROBLEM:28416,UNKNOWN_APDU:27906,USER_REFUSED_ON_DEVICE:21761,NOT_ENOUGH_SPACE:20738,APP_NOT_FOUND_OR_INVALID_CONTEXT:20771,INVALID_APP_NAME_LENGTH:26378,GEN_AES_KEY_FAILED:21529,INTERNAL_CRYPTO_OPERATION_FAILED:21530,INTERNAL_COMPUTE_AES_CMAC_FAILED:21531,ENCRYPT_APP_STORAGE_FAILED:21532,INVALID_BACKUP_STATE:26178,PIN_NOT_SET:21762,INVALID_BACKUP_LENGTH:26419,INVALID_RESTORE_STATE:26179,INVALID_CHUNK_LENGTH:26420,INVALID_BACKUP_HEADER:26698,TRUSTCHAIN_WRONG_SEED:45063};function getAltStatusMessage(s){switch(s){case 26368:return"Incorrect length";case 26624:return"Missing critical parameter";case 27010:return"Security not satisfied (dongle locked or have invalid access rights)";case 27013:return"Condition of use not satisfied (denied by the user?)";case 27264:return"Invalid data received";case 27392:return"Invalid parameter received";case 21781:return"Locked device"}if(28416<=s&&s<=28671)return"Internal error, please report"}class TransportStatusError extends Error{constructor(a,{canBeMappedToChildError:u=!0}={}){const l=Object.keys(StatusCodes).find(p=>StatusCodes[p]===a)||"UNKNOWN_ERROR",f=getAltStatusMessage(a)||l,c=a.toString(16),h=`Ledger device: ${f} (0x${c})`;if(super(h),this.name="TransportStatusError",this.statusCode=a,this.statusText=l,Object.setPrototypeOf(this,TransportStatusError.prototype),u&&a===StatusCodes.LOCKED_DEVICE)return new LockedDeviceError(h)}}class LockedDeviceError extends TransportStatusError{constructor(a){super(StatusCodes.LOCKED_DEVICE,{canBeMappedToChildError:!1}),a&&(this.message=a),this.name="LockedDeviceError",Object.setPrototypeOf(this,LockedDeviceError.prototype)}}addCustomErrorDeserializer("TransportStatusError",s=>new TransportStatusError(s.statusCode));const libEs=Object.freeze(Object.defineProperty({__proto__:null,AccountAwaitingSendPendingOperations,AccountNameRequiredError,AccountNotSupported,AmountRequired,BluetoothRequired,BtcUnmatchedApp,CantOpenDevice,CantScanQRCode,CashAddrNotSupported,ClaimRewardsFeesWarning,CurrencyNotSupported,DBNotReset,DBWrongPassword,DeviceAppVerifyNotSupported,DeviceExtractOnboardingStateError,DeviceGenuineSocketEarlyClose,DeviceHalted,DeviceInOSUExpected,DeviceNameInvalid,DeviceNeedsRestart,DeviceNotGenuineError,DeviceOnDashboardExpected,DeviceOnDashboardUnexpected,DeviceOnboardingStatePollingError,DeviceShouldStayInApp,DeviceSocketFail,DeviceSocketNoBulkStatus,DisabledTransactionBroadcastError,DisconnectedDevice,DisconnectedDeviceDuringOperation,DustLimit,ETHAddressNonEIP,EnpointConfigError,EthAppPleaseEnableContractData,ExpertModeRequired,FeeEstimationFailed,FeeNotLoaded,FeeNotLoadedSwap,FeeRequired,FeeTooHigh,FirmwareNotRecognized,FirmwareOrAppUpdateRequired,GasLessThanEstimate,GenuineCheckFailed,HardResetFail,HwTransportError,get HwTransportErrorType(){return HwTransportErrorType},InvalidAddress,InvalidAddressBecauseDestinationIsAlsoSource,InvalidNonce,InvalidXRPTag,LanguageNotFound,LatestMCUInstalledError,LedgerAPI4xx,LedgerAPI5xx,LedgerAPIError,LedgerAPIErrorWithMessage,LedgerAPINotAvailable,LockedDeviceError,MCUNotGenuineToDashboard,ManagerAppAlreadyInstalledError,ManagerAppDepInstallRequired,ManagerAppDepUninstallRequired,ManagerAppRelyOnBTCError,ManagerDeviceLockedError,ManagerFirmwareNotEnoughSpaceError,ManagerNotEnoughSpaceError,ManagerUninstallBTCDep,MaxFeeTooLow,MaybeKeepTronAccountAlive,NetworkDown,NetworkError,NoAccessToCamera,NoAddressesFound,NoDBPathGiven,NotEnoughBalance,NotEnoughBalanceBecauseDestinationNotCreated,NotEnoughBalanceInParentAccount,NotEnoughBalanceSwap,NotEnoughBalanceToDelegate,NotEnoughGas,NotEnoughGasSwap,NotEnoughSpendableBalance,NotSupportedLegacyAddress,OpReturnDataSizeLimit,PairingFailed,PasswordIncorrectError,PasswordsDontMatchError,PeerRemovedPairing,PendingOperation,PinNotSet,PriorityFeeHigherThanMaxFee,PriorityFeeTooHigh,PriorityFeeTooLow,RecipientRequired,RecommendSubAccountsToEmpty,RecommendUndelegation,ReplacementTransactionUnderpriced,SequenceNumberError,StatusCodes,SyncError,TimeoutTagged,TransactionHasBeenValidatedError,TransportError,TransportExchangeTimeoutError,TransportInterfaceNotAvailable,TransportOpenUserCancelled,TransportRaceCondition,TransportStatusError,TransportWebUSBGestureRequired,TronEmptyAccount,UnavailableTezosOriginatedAccountReceive,UnavailableTezosOriginatedAccountSend,UnexpectedBootloader,UnknownMCU,UnresponsiveDeviceError,UpdateFetchFileFail,UpdateIncorrectHash,UpdateIncorrectSig,UpdateYourApp,UserRefusedAddress,UserRefusedAllowManager,UserRefusedDeviceNameChange,UserRefusedFirmwareUpdate,UserRefusedOnDevice,WebsocketConnectionError,WebsocketConnectionFailed,WrongAppForCurrency,WrongDeviceForAccount,WrongDeviceForAccountPayout,WrongDeviceForAccountRefund,addCustomErrorDeserializer,createCustomErrorClass,deserializeError,getAltStatusMessage,serializeError},Symbol.toStringTag,{value:"Module"}));let id$1=0;const subscribers=[],log=(s,a,u)=>{const l={type:s,id:String(++id$1),date:new Date};a&&(l.message=a),dispatch(l)},trace=({type:s,message:a,data:u,context:l})=>{const f={type:s,id:String(++id$1),date:new Date};a&&(f.message=a),u&&(f.data=u),l&&(f.context=l),dispatch(f)};class LocalTracer{constructor(a,u){this.type=a,this.context=u}trace(a,u){trace({type:this.type,message:a,data:u,context:this.context})}getContext(){return this.context}setContext(a){this.context=a}updateContext(a){this.context=Object.assign(Object.assign({},this.context),a)}getType(){return this.type}setType(a){this.type=a}withType(a){return new LocalTracer(a,this.context)}withContext(a){return new LocalTracer(this.type,a)}withUpdatedContext(a){return new LocalTracer(this.type,Object.assign(Object.assign({},this.context),a))}}const listen=s=>(subscribers.push(s),()=>{const a=subscribers.indexOf(s);a!==-1&&(subscribers[a]=subscribers[subscribers.length-1],subscribers.pop())});function dispatch(s){for(let a=0;a<subscribers.length;a++)try{subscribers[a](s)}catch(u){console.error(u)}}typeof window<"u"&&(window.__ledgerLogsListen=listen);var __awaiter$3=function(s,a,u,l){function f(c){return c instanceof u?c:new u(function(h){h(c)})}return new(u||(u=Promise))(function(c,h){function p(b){try{y(l.next(b))}catch(S){h(S)}}function v(b){try{y(l.throw(b))}catch(S){h(S)}}function y(b){b.done?c(b.value):f(b.value).then(p,v)}y((l=l.apply(s,a||[])).next())})};const DEFAULT_LOG_TYPE="transport";class Transport{constructor({context:a,logType:u}={}){this.exchangeTimeout=3e4,this.unresponsiveTimeout=15e3,this.deviceModel=null,this._events=new EventEmitter,this.send=(l,f,c,h,...p)=>__awaiter$3(this,[l,f,c,h,...p],void 0,function*(v,y,b,S,E=distExports.Buffer.alloc(0),R=[StatusCodes.OK],{abortTimeoutMs:O}={}){const I=this.tracer.withUpdatedContext({function:"send"});if(E.length>=256)throw I.trace("data.length exceeded 256 bytes limit",{dataLength:E.length}),new TransportError("data.length exceed 256 bytes limit. Got: "+E.length,"DataLengthTooBig");I.trace("Starting an exchange",{abortTimeoutMs:O});const B=yield this.exchange(distExports.Buffer.concat([distExports.Buffer.from([v,y,b,S]),distExports.Buffer.from([E.length]),E]),{abortTimeoutMs:O});I.trace("Received response from exchange");const N=B.readUInt16BE(B.length-2);if(!R.some(D=>D===N))throw new TransportStatusError(N);return B}),this._appAPIlock=null,this.tracer=new LocalTracer(u??DEFAULT_LOG_TYPE,a)}exchange(a,{abortTimeoutMs:u}={}){throw new Error("exchange not implemented")}exchangeBulk(a,u){let l=!1;const f=()=>{l=!0};return __awaiter$3(this,void 0,void 0,function*(){if(!l)for(const h of a){const p=yield this.exchange(h);if(l)return;const v=p.readUInt16BE(p.length-2);if(v!==StatusCodes.OK)throw new TransportStatusError(v);u.next(p)}}).then(()=>!l&&u.complete(),h=>!l&&u.error(h)),{unsubscribe:f}}setScrambleKey(a){}close(){return Promise.resolve()}on(a,u){this._events.on(a,u)}off(a,u){this._events.removeListener(a,u)}emit(a,...u){this._events.emit(a,...u)}setDebugMode(){console.warn("setDebugMode is deprecated. use @ledgerhq/logs instead. No logs are emitted in this anymore.")}setExchangeTimeout(a){this.exchangeTimeout=a}setExchangeUnresponsiveTimeout(a){this.unresponsiveTimeout=a}static create(a=3e3,u){return new Promise((l,f)=>{let c=!1;const h=this.listen({next:v=>{c=!0,h&&h.unsubscribe(),p&&clearTimeout(p),this.open(v.descriptor,a).then(l,f)},error:v=>{p&&clearTimeout(p),f(v)},complete:()=>{p&&clearTimeout(p),c||f(new TransportError(this.ErrorMessage_NoDeviceFound,"NoDeviceFound"))}}),p=u?setTimeout(()=>{h.unsubscribe(),f(new TransportError(this.ErrorMessage_ListenTimeout,"ListenTimeout"))},u):null})}exchangeAtomicImpl(a){return __awaiter$3(this,void 0,void 0,function*(){const u=this.tracer.withUpdatedContext({function:"exchangeAtomicImpl",unresponsiveTimeout:this.unresponsiveTimeout});if(this.exchangeBusyPromise)throw u.trace("Atomic exchange is already busy"),new TransportRaceCondition("An action was already pending on the Ledger device. Please deny or reconnect.");let l;const f=new Promise(p=>{l=p});this.exchangeBusyPromise=f;let c=!1;const h=setTimeout(()=>{u.trace('Timeout reached, emitting Transport event "unresponsive"',{unresponsiveTimeout:this.unresponsiveTimeout}),c=!0,this.emit("unresponsive")},this.unresponsiveTimeout);try{const p=yield a();return c&&(u.trace("Device was unresponsive, emitting responsive"),this.emit("responsive")),p}finally{u.trace("Finalize, clearing busy guard"),clearTimeout(h),l&&l(),this.exchangeBusyPromise=null}})}decorateAppAPIMethods(a,u,l){for(const f of u)a[f]=this.decorateAppAPIMethod(f,a[f],a,l)}decorateAppAPIMethod(a,u,l,f){return(...c)=>__awaiter$3(this,void 0,void 0,function*(){const{_appAPIlock:h}=this;if(h)return Promise.reject(new TransportError("Ledger Device is busy (lock "+h+")","TransportLocked"));try{return this._appAPIlock=a,this.setScrambleKey(f),yield u.apply(l,c)}finally{this._appAPIlock=null}})}setTraceContext(a){this.tracer=this.tracer.withContext(a)}updateTraceContext(a){this.tracer.updateContext(a)}getTraceContext(){return this.tracer.getContext()}}Transport.ErrorMessage_ListenTimeout="No Ledger device found (timeout)";Transport.ErrorMessage_NoDeviceFound="No Ledger device found";var hidFraming$1={};const require$$0=getAugmentedNamespace(libEs);var hasRequiredHidFraming;function requireHidFraming(){return hasRequiredHidFraming||(hasRequiredHidFraming=1,function(s){s.__esModule=!0;var a=require$$0,u=5;function l(h){var p=distExports.Buffer.alloc(2);return p.writeUInt16BE(h,0),p}var f={data:distExports.Buffer.alloc(0),dataLength:0,sequence:0},c=function(h,p){return{makeBlocks:function(v){var y=distExports.Buffer.concat([l(v.length),v]),b=p-5,S=Math.ceil(y.length/b);y=distExports.Buffer.concat([y,distExports.Buffer.alloc(S*b-y.length+1).fill(0)]);for(var E=[],R=0;R<S;R++){var O=distExports.Buffer.alloc(5);O.writeUInt16BE(h,0),O.writeUInt8(u,2),O.writeUInt16BE(R,3);var I=y.slice(R*b,(R+1)*b);E.push(distExports.Buffer.concat([O,I]))}return E},reduceResponse:function(v,y){var b=v||f,S=b.data,E=b.dataLength,R=b.sequence;if(y.readUInt16BE(0)!==h)throw new a.TransportError("Invalid channel","InvalidChannel");if(y.readUInt8(2)!==u)throw new a.TransportError("Invalid tag","InvalidTag");if(y.readUInt16BE(3)!==R)throw new a.TransportError("Invalid sequence","InvalidSequence");v||(E=y.readUInt16BE(5)),R++;var O=y.slice(v?5:7);return S=distExports.Buffer.concat([S,O]),S.length>E&&(S=S.slice(0,E)),{data:S,dataLength:E,sequence:R}},getReducedResult:function(v){if(v&&v.dataLength===v.data.length)return v.data}}};s.default=c}(hidFraming$1)),hidFraming$1}var hidFramingExports=requireHidFraming();const hidFraming=getDefaultExportFromCjs(hidFramingExports);var re={exports:{}},constants,hasRequiredConstants;function requireConstants(){if(hasRequiredConstants)return constants;hasRequiredConstants=1;const s="2.0.0",a=256,u=Number.MAX_SAFE_INTEGER||9007199254740991,l=16,f=a-6;return constants={MAX_LENGTH:a,MAX_SAFE_COMPONENT_LENGTH:l,MAX_SAFE_BUILD_LENGTH:f,MAX_SAFE_INTEGER:u,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:s,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},constants}var debug_1,hasRequiredDebug;function requireDebug(){if(hasRequiredDebug)return debug_1;hasRequiredDebug=1;var s={};return debug_1=typeof distExports.process=="object"&&s&&s.NODE_DEBUG&&/\bsemver\b/i.test(s.NODE_DEBUG)?(...u)=>console.error("SEMVER",...u):()=>{},debug_1}var hasRequiredRe;function requireRe(){return hasRequiredRe||(hasRequiredRe=1,function(s,a){const{MAX_SAFE_COMPONENT_LENGTH:u,MAX_SAFE_BUILD_LENGTH:l,MAX_LENGTH:f}=requireConstants(),c=requireDebug();a=s.exports={};const h=a.re=[],p=a.safeRe=[],v=a.src=[],y=a.t={};let b=0;const S="[a-zA-Z0-9-]",E=[["\\s",1],["\\d",f],[S,l]],R=I=>{for(const[B,N]of E)I=I.split(`${B}*`).join(`${B}{0,${N}}`).split(`${B}+`).join(`${B}{1,${N}}`);return I},O=(I,B,N)=>{const D=R(B),G=b++;c(I,G,B),y[I]=G,v[G]=B,h[G]=new RegExp(B,N?"g":void 0),p[G]=new RegExp(D,N?"g":void 0)};O("NUMERICIDENTIFIER","0|[1-9]\\d*"),O("NUMERICIDENTIFIERLOOSE","\\d+"),O("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${S}*`),O("MAINVERSION",`(${v[y.NUMERICIDENTIFIER]})\\.(${v[y.NUMERICIDENTIFIER]})\\.(${v[y.NUMERICIDENTIFIER]})`),O("MAINVERSIONLOOSE",`(${v[y.NUMERICIDENTIFIERLOOSE]})\\.(${v[y.NUMERICIDENTIFIERLOOSE]})\\.(${v[y.NUMERICIDENTIFIERLOOSE]})`),O("PRERELEASEIDENTIFIER",`(?:${v[y.NUMERICIDENTIFIER]}|${v[y.NONNUMERICIDENTIFIER]})`),O("PRERELEASEIDENTIFIERLOOSE",`(?:${v[y.NUMERICIDENTIFIERLOOSE]}|${v[y.NONNUMERICIDENTIFIER]})`),O("PRERELEASE",`(?:-(${v[y.PRERELEASEIDENTIFIER]}(?:\\.${v[y.PRERELEASEIDENTIFIER]})*))`),O("PRERELEASELOOSE",`(?:-?(${v[y.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${v[y.PRERELEASEIDENTIFIERLOOSE]})*))`),O("BUILDIDENTIFIER",`${S}+`),O("BUILD",`(?:\\+(${v[y.BUILDIDENTIFIER]}(?:\\.${v[y.BUILDIDENTIFIER]})*))`),O("FULLPLAIN",`v?${v[y.MAINVERSION]}${v[y.PRERELEASE]}?${v[y.BUILD]}?`),O("FULL",`^${v[y.FULLPLAIN]}$`),O("LOOSEPLAIN",`[v=\\s]*${v[y.MAINVERSIONLOOSE]}${v[y.PRERELEASELOOSE]}?${v[y.BUILD]}?`),O("LOOSE",`^${v[y.LOOSEPLAIN]}$`),O("GTLT","((?:<|>)?=?)"),O("XRANGEIDENTIFIERLOOSE",`${v[y.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),O("XRANGEIDENTIFIER",`${v[y.NUMERICIDENTIFIER]}|x|X|\\*`),O("XRANGEPLAIN",`[v=\\s]*(${v[y.XRANGEIDENTIFIER]})(?:\\.(${v[y.XRANGEIDENTIFIER]})(?:\\.(${v[y.XRANGEIDENTIFIER]})(?:${v[y.PRERELEASE]})?${v[y.BUILD]}?)?)?`),O("XRANGEPLAINLOOSE",`[v=\\s]*(${v[y.XRANGEIDENTIFIERLOOSE]})(?:\\.(${v[y.XRANGEIDENTIFIERLOOSE]})(?:\\.(${v[y.XRANGEIDENTIFIERLOOSE]})(?:${v[y.PRERELEASELOOSE]})?${v[y.BUILD]}?)?)?`),O("XRANGE",`^${v[y.GTLT]}\\s*${v[y.XRANGEPLAIN]}$`),O("XRANGELOOSE",`^${v[y.GTLT]}\\s*${v[y.XRANGEPLAINLOOSE]}$`),O("COERCEPLAIN",`(^|[^\\d])(\\d{1,${u}})(?:\\.(\\d{1,${u}}))?(?:\\.(\\d{1,${u}}))?`),O("COERCE",`${v[y.COERCEPLAIN]}(?:$|[^\\d])`),O("COERCEFULL",v[y.COERCEPLAIN]+`(?:${v[y.PRERELEASE]})?(?:${v[y.BUILD]})?(?:$|[^\\d])`),O("COERCERTL",v[y.COERCE],!0),O("COERCERTLFULL",v[y.COERCEFULL],!0),O("LONETILDE","(?:~>?)"),O("TILDETRIM",`(\\s*)${v[y.LONETILDE]}\\s+`,!0),a.tildeTrimReplace="$1~",O("TILDE",`^${v[y.LONETILDE]}${v[y.XRANGEPLAIN]}$`),O("TILDELOOSE",`^${v[y.LONETILDE]}${v[y.XRANGEPLAINLOOSE]}$`),O("LONECARET","(?:\\^)"),O("CARETTRIM",`(\\s*)${v[y.LONECARET]}\\s+`,!0),a.caretTrimReplace="$1^",O("CARET",`^${v[y.LONECARET]}${v[y.XRANGEPLAIN]}$`),O("CARETLOOSE",`^${v[y.LONECARET]}${v[y.XRANGEPLAINLOOSE]}$`),O("COMPARATORLOOSE",`^${v[y.GTLT]}\\s*(${v[y.LOOSEPLAIN]})$|^$`),O("COMPARATOR",`^${v[y.GTLT]}\\s*(${v[y.FULLPLAIN]})$|^$`),O("COMPARATORTRIM",`(\\s*)${v[y.GTLT]}\\s*(${v[y.LOOSEPLAIN]}|${v[y.XRANGEPLAIN]})`,!0),a.comparatorTrimReplace="$1$2$3",O("HYPHENRANGE",`^\\s*(${v[y.XRANGEPLAIN]})\\s+-\\s+(${v[y.XRANGEPLAIN]})\\s*$`),O("HYPHENRANGELOOSE",`^\\s*(${v[y.XRANGEPLAINLOOSE]})\\s+-\\s+(${v[y.XRANGEPLAINLOOSE]})\\s*$`),O("STAR","(<|>)?=?\\s*\\*"),O("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),O("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(re,re.exports)),re.exports}var parseOptions_1,hasRequiredParseOptions;function requireParseOptions(){if(hasRequiredParseOptions)return parseOptions_1;hasRequiredParseOptions=1;const s=Object.freeze({loose:!0}),a=Object.freeze({});return parseOptions_1=l=>l?typeof l!="object"?s:l:a,parseOptions_1}var identifiers,hasRequiredIdentifiers;function requireIdentifiers(){if(hasRequiredIdentifiers)return identifiers;hasRequiredIdentifiers=1;const s=/^[0-9]+$/,a=(l,f)=>{const c=s.test(l),h=s.test(f);return c&&h&&(l=+l,f=+f),l===f?0:c&&!h?-1:h&&!c?1:l<f?-1:1};return identifiers={compareIdentifiers:a,rcompareIdentifiers:(l,f)=>a(f,l)},identifiers}var semver$2,hasRequiredSemver$1;function requireSemver$1(){if(hasRequiredSemver$1)return semver$2;hasRequiredSemver$1=1;const s=requireDebug(),{MAX_LENGTH:a,MAX_SAFE_INTEGER:u}=requireConstants(),{safeRe:l,t:f}=requireRe(),c=requireParseOptions(),{compareIdentifiers:h}=requireIdentifiers();class p{constructor(y,b){if(b=c(b),y instanceof p){if(y.loose===!!b.loose&&y.includePrerelease===!!b.includePrerelease)return y;y=y.version}else if(typeof y!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof y}".`);if(y.length>a)throw new TypeError(`version is longer than ${a} characters`);s("SemVer",y,b),this.options=b,this.loose=!!b.loose,this.includePrerelease=!!b.includePrerelease;const S=y.trim().match(b.loose?l[f.LOOSE]:l[f.FULL]);if(!S)throw new TypeError(`Invalid Version: ${y}`);if(this.raw=y,this.major=+S[1],this.minor=+S[2],this.patch=+S[3],this.major>u||this.major<0)throw new TypeError("Invalid major version");if(this.minor>u||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>u||this.patch<0)throw new TypeError("Invalid patch version");S[4]?this.prerelease=S[4].split(".").map(E=>{if(/^[0-9]+$/.test(E)){const R=+E;if(R>=0&&R<u)return R}return E}):this.prerelease=[],this.build=S[5]?S[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(y){if(s("SemVer.compare",this.version,this.options,y),!(y instanceof p)){if(typeof y=="string"&&y===this.version)return 0;y=new p(y,this.options)}return y.version===this.version?0:this.compareMain(y)||this.comparePre(y)}compareMain(y){return y instanceof p||(y=new p(y,this.options)),h(this.major,y.major)||h(this.minor,y.minor)||h(this.patch,y.patch)}comparePre(y){if(y instanceof p||(y=new p(y,this.options)),this.prerelease.length&&!y.prerelease.length)return-1;if(!this.prerelease.length&&y.prerelease.length)return 1;if(!this.prerelease.length&&!y.prerelease.length)return 0;let b=0;do{const S=this.prerelease[b],E=y.prerelease[b];if(s("prerelease compare",b,S,E),S===void 0&&E===void 0)return 0;if(E===void 0)return 1;if(S===void 0)return-1;if(S===E)continue;return h(S,E)}while(++b)}compareBuild(y){y instanceof p||(y=new p(y,this.options));let b=0;do{const S=this.build[b],E=y.build[b];if(s("build compare",b,S,E),S===void 0&&E===void 0)return 0;if(E===void 0)return 1;if(S===void 0)return-1;if(S===E)continue;return h(S,E)}while(++b)}inc(y,b,S){switch(y){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",b,S);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",b,S);break;case"prepatch":this.prerelease.length=0,this.inc("patch",b,S),this.inc("pre",b,S);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",b,S),this.inc("pre",b,S);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const E=Number(S)?1:0;if(!b&&S===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[E];else{let R=this.prerelease.length;for(;--R>=0;)typeof this.prerelease[R]=="number"&&(this.prerelease[R]++,R=-2);if(R===-1){if(b===this.prerelease.join(".")&&S===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(E)}}if(b){let R=[b,E];S===!1&&(R=[b]),h(this.prerelease[0],b)===0?isNaN(this.prerelease[1])&&(this.prerelease=R):this.prerelease=R}break}default:throw new Error(`invalid increment argument: ${y}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return semver$2=p,semver$2}var parse_1,hasRequiredParse;function requireParse(){if(hasRequiredParse)return parse_1;hasRequiredParse=1;const s=requireSemver$1();return parse_1=(u,l,f=!1)=>{if(u instanceof s)return u;try{return new s(u,l)}catch(c){if(!f)return null;throw c}},parse_1}var valid_1,hasRequiredValid$1;function requireValid$1(){if(hasRequiredValid$1)return valid_1;hasRequiredValid$1=1;const s=requireParse();return valid_1=(u,l)=>{const f=s(u,l);return f?f.version:null},valid_1}var clean_1,hasRequiredClean;function requireClean(){if(hasRequiredClean)return clean_1;hasRequiredClean=1;const s=requireParse();return clean_1=(u,l)=>{const f=s(u.trim().replace(/^[=v]+/,""),l);return f?f.version:null},clean_1}var inc_1,hasRequiredInc;function requireInc(){if(hasRequiredInc)return inc_1;hasRequiredInc=1;const s=requireSemver$1();return inc_1=(u,l,f,c,h)=>{typeof f=="string"&&(h=c,c=f,f=void 0);try{return new s(u instanceof s?u.version:u,f).inc(l,c,h).version}catch{return null}},inc_1}var diff_1,hasRequiredDiff;function requireDiff(){if(hasRequiredDiff)return diff_1;hasRequiredDiff=1;const s=requireParse();return diff_1=(u,l)=>{const f=s(u,null,!0),c=s(l,null,!0),h=f.compare(c);if(h===0)return null;const p=h>0,v=p?f:c,y=p?c:f,b=!!v.prerelease.length;if(!!y.prerelease.length&&!b)return!y.patch&&!y.minor?"major":v.patch?"patch":v.minor?"minor":"major";const E=b?"pre":"";return f.major!==c.major?E+"major":f.minor!==c.minor?E+"minor":f.patch!==c.patch?E+"patch":"prerelease"},diff_1}var major_1,hasRequiredMajor;function requireMajor(){if(hasRequiredMajor)return major_1;hasRequiredMajor=1;const s=requireSemver$1();return major_1=(u,l)=>new s(u,l).major,major_1}var minor_1,hasRequiredMinor;function requireMinor(){if(hasRequiredMinor)return minor_1;hasRequiredMinor=1;const s=requireSemver$1();return minor_1=(u,l)=>new s(u,l).minor,minor_1}var patch_1,hasRequiredPatch;function requirePatch(){if(hasRequiredPatch)return patch_1;hasRequiredPatch=1;const s=requireSemver$1();return patch_1=(u,l)=>new s(u,l).patch,patch_1}var prerelease_1,hasRequiredPrerelease;function requirePrerelease(){if(hasRequiredPrerelease)return prerelease_1;hasRequiredPrerelease=1;const s=requireParse();return prerelease_1=(u,l)=>{const f=s(u,l);return f&&f.prerelease.length?f.prerelease:null},prerelease_1}var compare_1,hasRequiredCompare;function requireCompare(){if(hasRequiredCompare)return compare_1;hasRequiredCompare=1;const s=requireSemver$1();return compare_1=(u,l,f)=>new s(u,f).compare(new s(l,f)),compare_1}var rcompare_1,hasRequiredRcompare;function requireRcompare(){if(hasRequiredRcompare)return rcompare_1;hasRequiredRcompare=1;const s=requireCompare();return rcompare_1=(u,l,f)=>s(l,u,f),rcompare_1}var compareLoose_1,hasRequiredCompareLoose;function requireCompareLoose(){if(hasRequiredCompareLoose)return compareLoose_1;hasRequiredCompareLoose=1;const s=requireCompare();return compareLoose_1=(u,l)=>s(u,l,!0),compareLoose_1}var compareBuild_1,hasRequiredCompareBuild;function requireCompareBuild(){if(hasRequiredCompareBuild)return compareBuild_1;hasRequiredCompareBuild=1;const s=requireSemver$1();return compareBuild_1=(u,l,f)=>{const c=new s(u,f),h=new s(l,f);return c.compare(h)||c.compareBuild(h)},compareBuild_1}var sort_1,hasRequiredSort;function requireSort(){if(hasRequiredSort)return sort_1;hasRequiredSort=1;const s=requireCompareBuild();return sort_1=(u,l)=>u.sort((f,c)=>s(f,c,l)),sort_1}var rsort_1,hasRequiredRsort;function requireRsort(){if(hasRequiredRsort)return rsort_1;hasRequiredRsort=1;const s=requireCompareBuild();return rsort_1=(u,l)=>u.sort((f,c)=>s(c,f,l)),rsort_1}var gt_1,hasRequiredGt;function requireGt(){if(hasRequiredGt)return gt_1;hasRequiredGt=1;const s=requireCompare();return gt_1=(u,l,f)=>s(u,l,f)>0,gt_1}var lt_1,hasRequiredLt;function requireLt(){if(hasRequiredLt)return lt_1;hasRequiredLt=1;const s=requireCompare();return lt_1=(u,l,f)=>s(u,l,f)<0,lt_1}var eq_1$1,hasRequiredEq$1;function requireEq$1(){if(hasRequiredEq$1)return eq_1$1;hasRequiredEq$1=1;const s=requireCompare();return eq_1$1=(u,l,f)=>s(u,l,f)===0,eq_1$1}var neq_1,hasRequiredNeq;function requireNeq(){if(hasRequiredNeq)return neq_1;hasRequiredNeq=1;const s=requireCompare();return neq_1=(u,l,f)=>s(u,l,f)!==0,neq_1}var gte_1,hasRequiredGte;function requireGte(){if(hasRequiredGte)return gte_1;hasRequiredGte=1;const s=requireCompare();return gte_1=(u,l,f)=>s(u,l,f)>=0,gte_1}var lte_1,hasRequiredLte;function requireLte(){if(hasRequiredLte)return lte_1;hasRequiredLte=1;const s=requireCompare();return lte_1=(u,l,f)=>s(u,l,f)<=0,lte_1}var cmp_1,hasRequiredCmp;function requireCmp(){if(hasRequiredCmp)return cmp_1;hasRequiredCmp=1;const s=requireEq$1(),a=requireNeq(),u=requireGt(),l=requireGte(),f=requireLt(),c=requireLte();return cmp_1=(p,v,y,b)=>{switch(v){case"===":return typeof p=="object"&&(p=p.version),typeof y=="object"&&(y=y.version),p===y;case"!==":return typeof p=="object"&&(p=p.version),typeof y=="object"&&(y=y.version),p!==y;case"":case"=":case"==":return s(p,y,b);case"!=":return a(p,y,b);case">":return u(p,y,b);case">=":return l(p,y,b);case"<":return f(p,y,b);case"<=":return c(p,y,b);default:throw new TypeError(`Invalid operator: ${v}`)}},cmp_1}var coerce_1,hasRequiredCoerce;function requireCoerce(){if(hasRequiredCoerce)return coerce_1;hasRequiredCoerce=1;const s=requireSemver$1(),a=requireParse(),{safeRe:u,t:l}=requireRe();return coerce_1=(c,h)=>{if(c instanceof s)return c;if(typeof c=="number"&&(c=String(c)),typeof c!="string")return null;h=h||{};let p=null;if(!h.rtl)p=c.match(h.includePrerelease?u[l.COERCEFULL]:u[l.COERCE]);else{const R=h.includePrerelease?u[l.COERCERTLFULL]:u[l.COERCERTL];let O;for(;(O=R.exec(c))&&(!p||p.index+p[0].length!==c.length);)(!p||O.index+O[0].length!==p.index+p[0].length)&&(p=O),R.lastIndex=O.index+O[1].length+O[2].length;R.lastIndex=-1}if(p===null)return null;const v=p[2],y=p[3]||"0",b=p[4]||"0",S=h.includePrerelease&&p[5]?`-${p[5]}`:"",E=h.includePrerelease&&p[6]?`+${p[6]}`:"";return a(`${v}.${y}.${b}${S}${E}`,h)},coerce_1}var lrucache,hasRequiredLrucache;function requireLrucache(){if(hasRequiredLrucache)return lrucache;hasRequiredLrucache=1;class s{constructor(){this.max=1e3,this.map=new Map}get(u){const l=this.map.get(u);if(l!==void 0)return this.map.delete(u),this.map.set(u,l),l}delete(u){return this.map.delete(u)}set(u,l){if(!this.delete(u)&&l!==void 0){if(this.map.size>=this.max){const c=this.map.keys().next().value;this.delete(c)}this.map.set(u,l)}return this}}return lrucache=s,lrucache}var range,hasRequiredRange;function requireRange(){if(hasRequiredRange)return range;hasRequiredRange=1;const s=/\s+/g;class a{constructor(w,x){if(x=f(x),w instanceof a)return w.loose===!!x.loose&&w.includePrerelease===!!x.includePrerelease?w:new a(w.raw,x);if(w instanceof c)return this.raw=w.value,this.set=[[w]],this.formatted=void 0,this;if(this.options=x,this.loose=!!x.loose,this.includePrerelease=!!x.includePrerelease,this.raw=w.trim().replace(s," "),this.set=this.raw.split("||").map(P=>this.parseRange(P.trim())).filter(P=>P.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const P=this.set[0];if(this.set=this.set.filter($=>!I($[0])),this.set.length===0)this.set=[P];else if(this.set.length>1){for(const $ of this.set)if($.length===1&&B($[0])){this.set=[$];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let w=0;w<this.set.length;w++){w>0&&(this.formatted+="||");const x=this.set[w];for(let P=0;P<x.length;P++)P>0&&(this.formatted+=" "),this.formatted+=x[P].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(w){const P=((this.options.includePrerelease&&R)|(this.options.loose&&O))+":"+w,$=l.get(P);if($)return $;const T=this.options.loose,m=T?v[y.HYPHENRANGELOOSE]:v[y.HYPHENRANGE];w=w.replace(m,d(this.options.includePrerelease)),h("hyphen replace",w),w=w.replace(v[y.COMPARATORTRIM],b),h("comparator trim",w),w=w.replace(v[y.TILDETRIM],S),h("tilde trim",w),w=w.replace(v[y.CARETTRIM],E),h("caret trim",w);let M=w.split(" ").map(ge=>D(ge,this.options)).join(" ").split(/\s+/).map(ge=>k(ge,this.options));T&&(M=M.filter(ge=>(h("loose invalid filter",ge,this.options),!!ge.match(v[y.COMPARATORLOOSE])))),h("range list",M);const W=new Map,Y=M.map(ge=>new c(ge,this.options));for(const ge of Y){if(I(ge))return[ge];W.set(ge.value,ge)}W.size>1&&W.has("")&&W.delete("");const ue=[...W.values()];return l.set(P,ue),ue}intersects(w,x){if(!(w instanceof a))throw new TypeError("a Range is required");return this.set.some(P=>N(P,x)&&w.set.some($=>N($,x)&&P.every(T=>$.every(m=>T.intersects(m,x)))))}test(w){if(!w)return!1;if(typeof w=="string")try{w=new p(w,this.options)}catch{return!1}for(let x=0;x<this.set.length;x++)if(g(this.set[x],w,this.options))return!0;return!1}}range=a;const u=requireLrucache(),l=new u,f=requireParseOptions(),c=requireComparator(),h=requireDebug(),p=requireSemver$1(),{safeRe:v,t:y,comparatorTrimReplace:b,tildeTrimReplace:S,caretTrimReplace:E}=requireRe(),{FLAG_INCLUDE_PRERELEASE:R,FLAG_LOOSE:O}=requireConstants(),I=_=>_.value==="<0.0.0-0",B=_=>_.value==="",N=(_,w)=>{let x=!0;const P=_.slice();let $=P.pop();for(;x&&P.length;)x=P.every(T=>$.intersects(T,w)),$=P.pop();return x},D=(_,w)=>(h("comp",_,w),_=te(_,w),h("caret",_),_=V(_,w),h("tildes",_),_=J(_,w),h("xrange",_),_=ee(_,w),h("stars",_),_),G=_=>!_||_.toLowerCase()==="x"||_==="*",V=(_,w)=>_.trim().split(/\s+/).map(x=>U(x,w)).join(" "),U=(_,w)=>{const x=w.loose?v[y.TILDELOOSE]:v[y.TILDE];return _.replace(x,(P,$,T,m,M)=>{h("tilde",_,P,$,T,m,M);let W;return G($)?W="":G(T)?W=`>=${$}.0.0 <${+$+1}.0.0-0`:G(m)?W=`>=${$}.${T}.0 <${$}.${+T+1}.0-0`:M?(h("replaceTilde pr",M),W=`>=${$}.${T}.${m}-${M} <${$}.${+T+1}.0-0`):W=`>=${$}.${T}.${m} <${$}.${+T+1}.0-0`,h("tilde return",W),W})},te=(_,w)=>_.trim().split(/\s+/).map(x=>Z(x,w)).join(" "),Z=(_,w)=>{h("caret",_,w);const x=w.loose?v[y.CARETLOOSE]:v[y.CARET],P=w.includePrerelease?"-0":"";return _.replace(x,($,T,m,M,W)=>{h("caret",_,$,T,m,M,W);let Y;return G(T)?Y="":G(m)?Y=`>=${T}.0.0${P} <${+T+1}.0.0-0`:G(M)?T==="0"?Y=`>=${T}.${m}.0${P} <${T}.${+m+1}.0-0`:Y=`>=${T}.${m}.0${P} <${+T+1}.0.0-0`:W?(h("replaceCaret pr",W),T==="0"?m==="0"?Y=`>=${T}.${m}.${M}-${W} <${T}.${m}.${+M+1}-0`:Y=`>=${T}.${m}.${M}-${W} <${T}.${+m+1}.0-0`:Y=`>=${T}.${m}.${M}-${W} <${+T+1}.0.0-0`):(h("no pr"),T==="0"?m==="0"?Y=`>=${T}.${m}.${M}${P} <${T}.${m}.${+M+1}-0`:Y=`>=${T}.${m}.${M}${P} <${T}.${+m+1}.0-0`:Y=`>=${T}.${m}.${M} <${+T+1}.0.0-0`),h("caret return",Y),Y})},J=(_,w)=>(h("replaceXRanges",_,w),_.split(/\s+/).map(x=>Q(x,w)).join(" ")),Q=(_,w)=>{_=_.trim();const x=w.loose?v[y.XRANGELOOSE]:v[y.XRANGE];return _.replace(x,(P,$,T,m,M,W)=>{h("xRange",_,P,$,T,m,M,W);const Y=G(T),ue=Y||G(m),ge=ue||G(M),he=ge;return $==="="&&he&&($=""),W=w.includePrerelease?"-0":"",Y?$===">"||$==="<"?P="<0.0.0-0":P="*":$&&he?(ue&&(m=0),M=0,$===">"?($=">=",ue?(T=+T+1,m=0,M=0):(m=+m+1,M=0)):$==="<="&&($="<",ue?T=+T+1:m=+m+1),$==="<"&&(W="-0"),P=`${$+T}.${m}.${M}${W}`):ue?P=`>=${T}.0.0${W} <${+T+1}.0.0-0`:ge&&(P=`>=${T}.${m}.0${W} <${T}.${+m+1}.0-0`),h("xRange return",P),P})},ee=(_,w)=>(h("replaceStars",_,w),_.trim().replace(v[y.STAR],"")),k=(_,w)=>(h("replaceGTE0",_,w),_.trim().replace(v[w.includePrerelease?y.GTE0PRE:y.GTE0],"")),d=_=>(w,x,P,$,T,m,M,W,Y,ue,ge,he)=>(G(P)?x="":G($)?x=`>=${P}.0.0${_?"-0":""}`:G(T)?x=`>=${P}.${$}.0${_?"-0":""}`:m?x=`>=${x}`:x=`>=${x}${_?"-0":""}`,G(Y)?W="":G(ue)?W=`<${+Y+1}.0.0-0`:G(ge)?W=`<${Y}.${+ue+1}.0-0`:he?W=`<=${Y}.${ue}.${ge}-${he}`:_?W=`<${Y}.${ue}.${+ge+1}-0`:W=`<=${W}`,`${x} ${W}`.trim()),g=(_,w,x)=>{for(let P=0;P<_.length;P++)if(!_[P].test(w))return!1;if(w.prerelease.length&&!x.includePrerelease){for(let P=0;P<_.length;P++)if(h(_[P].semver),_[P].semver!==c.ANY&&_[P].semver.prerelease.length>0){const $=_[P].semver;if($.major===w.major&&$.minor===w.minor&&$.patch===w.patch)return!0}return!1}return!0};return range}var comparator,hasRequiredComparator;function requireComparator(){if(hasRequiredComparator)return comparator;hasRequiredComparator=1;const s=Symbol("SemVer ANY");class a{static get ANY(){return s}constructor(b,S){if(S=u(S),b instanceof a){if(b.loose===!!S.loose)return b;b=b.value}b=b.trim().split(/\s+/).join(" "),h("comparator",b,S),this.options=S,this.loose=!!S.loose,this.parse(b),this.semver===s?this.value="":this.value=this.operator+this.semver.version,h("comp",this)}parse(b){const S=this.options.loose?l[f.COMPARATORLOOSE]:l[f.COMPARATOR],E=b.match(S);if(!E)throw new TypeError(`Invalid comparator: ${b}`);this.operator=E[1]!==void 0?E[1]:"",this.operator==="="&&(this.operator=""),E[2]?this.semver=new p(E[2],this.options.loose):this.semver=s}toString(){return this.value}test(b){if(h("Comparator.test",b,this.options.loose),this.semver===s||b===s)return!0;if(typeof b=="string")try{b=new p(b,this.options)}catch{return!1}return c(b,this.operator,this.semver,this.options)}intersects(b,S){if(!(b instanceof a))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new v(b.value,S).test(this.value):b.operator===""?b.value===""?!0:new v(this.value,S).test(b.semver):(S=u(S),S.includePrerelease&&(this.value==="<0.0.0-0"||b.value==="<0.0.0-0")||!S.includePrerelease&&(this.value.startsWith("<0.0.0")||b.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&b.operator.startsWith(">")||this.operator.startsWith("<")&&b.operator.startsWith("<")||this.semver.version===b.semver.version&&this.operator.includes("=")&&b.operator.includes("=")||c(this.semver,"<",b.semver,S)&&this.operator.startsWith(">")&&b.operator.startsWith("<")||c(this.semver,">",b.semver,S)&&this.operator.startsWith("<")&&b.operator.startsWith(">")))}}comparator=a;const u=requireParseOptions(),{safeRe:l,t:f}=requireRe(),c=requireCmp(),h=requireDebug(),p=requireSemver$1(),v=requireRange();return comparator}var satisfies_1,hasRequiredSatisfies;function requireSatisfies(){if(hasRequiredSatisfies)return satisfies_1;hasRequiredSatisfies=1;const s=requireRange();return satisfies_1=(u,l,f)=>{try{l=new s(l,f)}catch{return!1}return l.test(u)},satisfies_1}var toComparators_1,hasRequiredToComparators;function requireToComparators(){if(hasRequiredToComparators)return toComparators_1;hasRequiredToComparators=1;const s=requireRange();return toComparators_1=(u,l)=>new s(u,l).set.map(f=>f.map(c=>c.value).join(" ").trim().split(" ")),toComparators_1}var maxSatisfying_1,hasRequiredMaxSatisfying;function requireMaxSatisfying(){if(hasRequiredMaxSatisfying)return maxSatisfying_1;hasRequiredMaxSatisfying=1;const s=requireSemver$1(),a=requireRange();return maxSatisfying_1=(l,f,c)=>{let h=null,p=null,v=null;try{v=new a(f,c)}catch{return null}return l.forEach(y=>{v.test(y)&&(!h||p.compare(y)===-1)&&(h=y,p=new s(h,c))}),h},maxSatisfying_1}var minSatisfying_1,hasRequiredMinSatisfying;function requireMinSatisfying(){if(hasRequiredMinSatisfying)return minSatisfying_1;hasRequiredMinSatisfying=1;const s=requireSemver$1(),a=requireRange();return minSatisfying_1=(l,f,c)=>{let h=null,p=null,v=null;try{v=new a(f,c)}catch{return null}return l.forEach(y=>{v.test(y)&&(!h||p.compare(y)===1)&&(h=y,p=new s(h,c))}),h},minSatisfying_1}var minVersion_1,hasRequiredMinVersion;function requireMinVersion(){if(hasRequiredMinVersion)return minVersion_1;hasRequiredMinVersion=1;const s=requireSemver$1(),a=requireRange(),u=requireGt();return minVersion_1=(f,c)=>{f=new a(f,c);let h=new s("0.0.0");if(f.test(h)||(h=new s("0.0.0-0"),f.test(h)))return h;h=null;for(let p=0;p<f.set.length;++p){const v=f.set[p];let y=null;v.forEach(b=>{const S=new s(b.semver.version);switch(b.operator){case">":S.prerelease.length===0?S.patch++:S.prerelease.push(0),S.raw=S.format();case"":case">=":(!y||u(S,y))&&(y=S);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${b.operator}`)}}),y&&(!h||u(h,y))&&(h=y)}return h&&f.test(h)?h:null},minVersion_1}var valid,hasRequiredValid;function requireValid(){if(hasRequiredValid)return valid;hasRequiredValid=1;const s=requireRange();return valid=(u,l)=>{try{return new s(u,l).range||"*"}catch{return null}},valid}var outside_1,hasRequiredOutside;function requireOutside(){if(hasRequiredOutside)return outside_1;hasRequiredOutside=1;const s=requireSemver$1(),a=requireComparator(),{ANY:u}=a,l=requireRange(),f=requireSatisfies(),c=requireGt(),h=requireLt(),p=requireLte(),v=requireGte();return outside_1=(b,S,E,R)=>{b=new s(b,R),S=new l(S,R);let O,I,B,N,D;switch(E){case">":O=c,I=p,B=h,N=">",D=">=";break;case"<":O=h,I=v,B=c,N="<",D="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(f(b,S,R))return!1;for(let G=0;G<S.set.length;++G){const V=S.set[G];let U=null,te=null;if(V.forEach(Z=>{Z.semver===u&&(Z=new a(">=0.0.0")),U=U||Z,te=te||Z,O(Z.semver,U.semver,R)?U=Z:B(Z.semver,te.semver,R)&&(te=Z)}),U.operator===N||U.operator===D||(!te.operator||te.operator===N)&&I(b,te.semver))return!1;if(te.operator===D&&B(b,te.semver))return!1}return!0},outside_1}var gtr_1,hasRequiredGtr;function requireGtr(){if(hasRequiredGtr)return gtr_1;hasRequiredGtr=1;const s=requireOutside();return gtr_1=(u,l,f)=>s(u,l,">",f),gtr_1}var ltr_1,hasRequiredLtr;function requireLtr(){if(hasRequiredLtr)return ltr_1;hasRequiredLtr=1;const s=requireOutside();return ltr_1=(u,l,f)=>s(u,l,"<",f),ltr_1}var intersects_1,hasRequiredIntersects;function requireIntersects(){if(hasRequiredIntersects)return intersects_1;hasRequiredIntersects=1;const s=requireRange();return intersects_1=(u,l,f)=>(u=new s(u,f),l=new s(l,f),u.intersects(l,f)),intersects_1}var simplify,hasRequiredSimplify;function requireSimplify(){if(hasRequiredSimplify)return simplify;hasRequiredSimplify=1;const s=requireSatisfies(),a=requireCompare();return simplify=(u,l,f)=>{const c=[];let h=null,p=null;const v=u.sort((E,R)=>a(E,R,f));for(const E of v)s(E,l,f)?(p=E,h||(h=E)):(p&&c.push([h,p]),p=null,h=null);h&&c.push([h,null]);const y=[];for(const[E,R]of c)E===R?y.push(E):!R&&E===v[0]?y.push("*"):R?E===v[0]?y.push(`<=${R}`):y.push(`${E} - ${R}`):y.push(`>=${E}`);const b=y.join(" || "),S=typeof l.raw=="string"?l.raw:String(l);return b.length<S.length?b:l},simplify}var subset_1,hasRequiredSubset;function requireSubset(){if(hasRequiredSubset)return subset_1;hasRequiredSubset=1;const s=requireRange(),a=requireComparator(),{ANY:u}=a,l=requireSatisfies(),f=requireCompare(),c=(S,E,R={})=>{if(S===E)return!0;S=new s(S,R),E=new s(E,R);let O=!1;e:for(const I of S.set){for(const B of E.set){const N=v(I,B,R);if(O=O||N!==null,N)continue e}if(O)return!1}return!0},h=[new a(">=0.0.0-0")],p=[new a(">=0.0.0")],v=(S,E,R)=>{if(S===E)return!0;if(S.length===1&&S[0].semver===u){if(E.length===1&&E[0].semver===u)return!0;R.includePrerelease?S=h:S=p}if(E.length===1&&E[0].semver===u){if(R.includePrerelease)return!0;E=p}const O=new Set;let I,B;for(const J of S)J.operator===">"||J.operator===">="?I=y(I,J,R):J.operator==="<"||J.operator==="<="?B=b(B,J,R):O.add(J.semver);if(O.size>1)return null;let N;if(I&&B){if(N=f(I.semver,B.semver,R),N>0)return null;if(N===0&&(I.operator!==">="||B.operator!=="<="))return null}for(const J of O){if(I&&!l(J,String(I),R)||B&&!l(J,String(B),R))return null;for(const Q of E)if(!l(J,String(Q),R))return!1;return!0}let D,G,V,U,te=B&&!R.includePrerelease&&B.semver.prerelease.length?B.semver:!1,Z=I&&!R.includePrerelease&&I.semver.prerelease.length?I.semver:!1;te&&te.prerelease.length===1&&B.operator==="<"&&te.prerelease[0]===0&&(te=!1);for(const J of E){if(U=U||J.operator===">"||J.operator===">=",V=V||J.operator==="<"||J.operator==="<=",I){if(Z&&J.semver.prerelease&&J.semver.prerelease.length&&J.semver.major===Z.major&&J.semver.minor===Z.minor&&J.semver.patch===Z.patch&&(Z=!1),J.operator===">"||J.operator===">="){if(D=y(I,J,R),D===J&&D!==I)return!1}else if(I.operator===">="&&!l(I.semver,String(J),R))return!1}if(B){if(te&&J.semver.prerelease&&J.semver.prerelease.length&&J.semver.major===te.major&&J.semver.minor===te.minor&&J.semver.patch===te.patch&&(te=!1),J.operator==="<"||J.operator==="<="){if(G=b(B,J,R),G===J&&G!==B)return!1}else if(B.operator==="<="&&!l(B.semver,String(J),R))return!1}if(!J.operator&&(B||I)&&N!==0)return!1}return!(I&&V&&!B&&N!==0||B&&U&&!I&&N!==0||Z||te)},y=(S,E,R)=>{if(!S)return E;const O=f(S.semver,E.semver,R);return O>0?S:O<0||E.operator===">"&&S.operator===">="?E:S},b=(S,E,R)=>{if(!S)return E;const O=f(S.semver,E.semver,R);return O<0?S:O>0||E.operator==="<"&&S.operator==="<="?E:S};return subset_1=c,subset_1}var semver$1,hasRequiredSemver;function requireSemver(){if(hasRequiredSemver)return semver$1;hasRequiredSemver=1;const s=requireRe(),a=requireConstants(),u=requireSemver$1(),l=requireIdentifiers(),f=requireParse(),c=requireValid$1(),h=requireClean(),p=requireInc(),v=requireDiff(),y=requireMajor(),b=requireMinor(),S=requirePatch(),E=requirePrerelease(),R=requireCompare(),O=requireRcompare(),I=requireCompareLoose(),B=requireCompareBuild(),N=requireSort(),D=requireRsort(),G=requireGt(),V=requireLt(),U=requireEq$1(),te=requireNeq(),Z=requireGte(),J=requireLte(),Q=requireCmp(),ee=requireCoerce(),k=requireComparator(),d=requireRange(),g=requireSatisfies(),_=requireToComparators(),w=requireMaxSatisfying(),x=requireMinSatisfying(),P=requireMinVersion(),$=requireValid(),T=requireOutside(),m=requireGtr(),M=requireLtr(),W=requireIntersects(),Y=requireSimplify(),ue=requireSubset();return semver$1={parse:f,valid:c,clean:h,inc:p,diff:v,major:y,minor:b,patch:S,prerelease:E,compare:R,rcompare:O,compareLoose:I,compareBuild:B,sort:N,rsort:D,gt:G,lt:V,eq:U,neq:te,gte:Z,lte:J,cmp:Q,coerce:ee,Comparator:k,Range:d,satisfies:g,toComparators:_,maxSatisfying:w,minSatisfying:x,minVersion:P,validRange:$,outside:T,gtr:m,ltr:M,intersects:W,simplifyRange:Y,subset:ue,SemVer:u,re:s.re,src:s.src,tokens:s.t,SEMVER_SPEC_VERSION:a.SEMVER_SPEC_VERSION,RELEASE_TYPES:a.RELEASE_TYPES,compareIdentifiers:l.compareIdentifiers,rcompareIdentifiers:l.rcompareIdentifiers},semver$1}var semverExports=requireSemver();const semver=getDefaultExportFromCjs(semverExports);var __assign=function(){return __assign=Object.assign||function(s){for(var a,u=1,l=arguments.length;u<l;u++){a=arguments[u];for(var f in a)Object.prototype.hasOwnProperty.call(a,f)&&(s[f]=a[f])}return s},__assign.apply(this,arguments)},_a,DeviceModelId;(function(s){s.blue="blue",s.nanoS="nanoS",s.nanoSP="nanoSP",s.nanoX="nanoX",s.nanoFTS="nanoFTS"})(DeviceModelId||(DeviceModelId={}));var devices=(_a={},_a[DeviceModelId.blue]={id:DeviceModelId.blue,productName:"Ledger Blue",productIdMM:0,legacyUsbProductId:0,usbOnly:!0,memorySize:480*1024,masks:[822083584,822149120],getBlockSize:function(s){return 4*1024}},_a[DeviceModelId.nanoS]={id:DeviceModelId.nanoS,productName:"Ledger Nano S",productIdMM:16,legacyUsbProductId:1,usbOnly:!0,memorySize:320*1024,masks:[823132160],getBlockSize:function(s){var a;return semver.lt((a=semver.coerce(s))!==null&&a!==void 0?a:"","2.0.0")?4*1024:2*1024}},_a[DeviceModelId.nanoSP]={id:DeviceModelId.nanoSP,productName:"Ledger Nano S Plus",productIdMM:80,legacyUsbProductId:5,usbOnly:!0,memorySize:1536*1024,masks:[856686592],getBlockSize:function(s){return 32}},_a[DeviceModelId.nanoX]={id:DeviceModelId.nanoX,productName:"Ledger Nano X",productIdMM:64,legacyUsbProductId:4,usbOnly:!1,memorySize:2*1024*1024,masks:[855638016],getBlockSize:function(s){return 4*1024},bluetoothSpec:[{serviceUuid:"13d63400-2c97-0004-0000-4c6564676572",notifyUuid:"13d63400-2c97-0004-0001-4c6564676572",writeUuid:"13d63400-2c97-0004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-0004-0003-4c6564676572"}]},_a[DeviceModelId.nanoFTS]={id:DeviceModelId.nanoFTS,productName:"Ledger Nano FTS",productIdMM:96,legacyUsbProductId:6,usbOnly:!1,memorySize:2*1024*1024,masks:[857735168],getBlockSize:function(s){return 4*1024},bluetoothSpec:[{serviceUuid:"13d63400-2c97-6004-0000-4c6564676572",notifyUuid:"13d63400-2c97-6004-0001-4c6564676572",writeUuid:"13d63400-2c97-6004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-6004-0003-4c6564676572"}]},_a);DeviceModelId.blue,DeviceModelId.nanoS,DeviceModelId.nanoSP,DeviceModelId.nanoX,DeviceModelId.nanoFTS;var devicesList=Object.values(devices),ledgerUSBVendorId=11415,identifyUSBProductId=function(s){var a=devicesList.find(function(f){return f.legacyUsbProductId===s});if(a)return a;var u=s>>8,l=devicesList.find(function(f){return f.productIdMM===u});return l},bluetoothServices=[],serviceUuidToInfos={};for(var id in devices){var deviceModel=devices[id],bluetoothSpec=deviceModel.bluetoothSpec;if(bluetoothSpec)for(var i=0;i<bluetoothSpec.length;i++){var spec=bluetoothSpec[i];bluetoothServices.push(spec.serviceUuid),serviceUuidToInfos[spec.serviceUuid]=serviceUuidToInfos[spec.serviceUuid.replace(/-/g,"")]=__assign({deviceModel},spec)}}var __awaiter$2=function(s,a,u,l){function f(c){return c instanceof u?c:new u(function(h){h(c)})}return new(u||(u=Promise))(function(c,h){function p(b){try{y(l.next(b))}catch(S){h(S)}}function v(b){try{y(l.throw(b))}catch(S){h(S)}}function y(b){b.done?c(b.value):f(b.value).then(p,v)}y((l=l.apply(s,a||[])).next())})},__generator$1=function(s,a){var u={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},l,f,c,h;return h={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function p(y){return function(b){return v([y,b])}}function v(y){if(l)throw new TypeError("Generator is already executing.");for(;u;)try{if(l=1,f&&(c=y[0]&2?f.return:y[0]?f.throw||((c=f.return)&&c.call(f),0):f.next)&&!(c=c.call(f,y[1])).done)return c;switch(f=0,c&&(y=[y[0]&2,c.value]),y[0]){case 0:case 1:c=y;break;case 4:return u.label++,{value:y[1],done:!1};case 5:u.label++,f=y[1],y=[0];continue;case 7:y=u.ops.pop(),u.trys.pop();continue;default:if(c=u.trys,!(c=c.length>0&&c[c.length-1])&&(y[0]===6||y[0]===2)){u=0;continue}if(y[0]===3&&(!c||y[1]>c[0]&&y[1]<c[3])){u.label=y[1];break}if(y[0]===6&&u.label<c[1]){u.label=c[1],c=y;break}if(c&&u.label<c[2]){u.label=c[2],u.ops.push(y);break}c[2]&&u.ops.pop(),u.trys.pop();continue}y=a.call(s,u)}catch(b){y=[6,b],f=0}finally{l=c=0}if(y[0]&5)throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}},ledgerDevices=[{vendorId:ledgerUSBVendorId}];function requestLedgerDevice(){return __awaiter$2(this,void 0,void 0,function(){var s;return __generator$1(this,function(a){switch(a.label){case 0:return[4,navigator.usb.requestDevice({filters:ledgerDevices})];case 1:return s=a.sent(),[2,s]}})})}function getLedgerDevices(){return __awaiter$2(this,void 0,void 0,function(){var s;return __generator$1(this,function(a){switch(a.label){case 0:return[4,navigator.usb.getDevices()];case 1:return s=a.sent(),[2,s.filter(function(u){return u.vendorId===ledgerUSBVendorId})]}})})}function getFirstLedgerDevice(){return __awaiter$2(this,void 0,void 0,function(){var s;return __generator$1(this,function(a){switch(a.label){case 0:return[4,getLedgerDevices()];case 1:return s=a.sent(),s.length>0?[2,s[0]]:[2,requestLedgerDevice()]}})})}var isSupported=function(){return Promise.resolve(!!navigator&&!!navigator.usb&&typeof navigator.usb.getDevices=="function")},__extends=function(){var s=function(a,u){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,f){l.__proto__=f}||function(l,f){for(var c in f)Object.prototype.hasOwnProperty.call(f,c)&&(l[c]=f[c])},s(a,u)};return function(a,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");s(a,u);function l(){this.constructor=a}a.prototype=u===null?Object.create(u):(l.prototype=u.prototype,new l)}}(),__awaiter$1=function(s,a,u,l){function f(c){return c instanceof u?c:new u(function(h){h(c)})}return new(u||(u=Promise))(function(c,h){function p(b){try{y(l.next(b))}catch(S){h(S)}}function v(b){try{y(l.throw(b))}catch(S){h(S)}}function y(b){b.done?c(b.value):f(b.value).then(p,v)}y((l=l.apply(s,a||[])).next())})},__generator=function(s,a){var u={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},l,f,c,h;return h={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function p(y){return function(b){return v([y,b])}}function v(y){if(l)throw new TypeError("Generator is already executing.");for(;u;)try{if(l=1,f&&(c=y[0]&2?f.return:y[0]?f.throw||((c=f.return)&&c.call(f),0):f.next)&&!(c=c.call(f,y[1])).done)return c;switch(f=0,c&&(y=[y[0]&2,c.value]),y[0]){case 0:case 1:c=y;break;case 4:return u.label++,{value:y[1],done:!1};case 5:u.label++,f=y[1],y=[0];continue;case 7:y=u.ops.pop(),u.trys.pop();continue;default:if(c=u.trys,!(c=c.length>0&&c[c.length-1])&&(y[0]===6||y[0]===2)){u=0;continue}if(y[0]===3&&(!c||y[1]>c[0]&&y[1]<c[3])){u.label=y[1];break}if(y[0]===6&&u.label<c[1]){u.label=c[1],c=y;break}if(c&&u.label<c[2]){u.label=c[2],u.ops.push(y);break}c[2]&&u.ops.pop(),u.trys.pop();continue}y=a.call(s,u)}catch(b){y=[6,b],f=0}finally{l=c=0}if(y[0]&5)throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}},configurationValue=1,endpointNumber=3,TransportWebUSB=function(s){__extends(a,s);function a(u,l){var f=s.call(this)||this;return f.channel=Math.floor(Math.random()*65535),f.packetSize=64,f._disconnectEmitted=!1,f._emitDisconnect=function(c){f._disconnectEmitted||(f._disconnectEmitted=!0,f.emit("disconnect",c))},f.device=u,f.interfaceNumber=l,f.deviceModel=identifyUSBProductId(u.productId),f}return a.request=function(){return __awaiter$1(this,void 0,void 0,function(){var u;return __generator(this,function(l){switch(l.label){case 0:return[4,requestLedgerDevice()];case 1:return u=l.sent(),[2,a.open(u)]}})})},a.openConnected=function(){return __awaiter$1(this,void 0,void 0,function(){var u;return __generator(this,function(l){switch(l.label){case 0:return[4,getLedgerDevices()];case 1:return u=l.sent(),u.length===0?[2,null]:[2,a.open(u[0])]}})})},a.open=function(u){return __awaiter$1(this,void 0,void 0,function(){var l,f,c,h,p;return __generator(this,function(v){switch(v.label){case 0:return[4,u.open()];case 1:return v.sent(),u.configuration!==null?[3,3]:[4,u.selectConfiguration(configurationValue)];case 2:v.sent(),v.label=3;case 3:return[4,gracefullyResetDevice(u)];case 4:if(v.sent(),l=u.configurations[0].interfaces.find(function(y){var b=y.alternates;return b.some(function(S){return S.interfaceClass===255})}),!l)throw new TransportInterfaceNotAvailable("No WebUSB interface found for your Ledger device. Please upgrade firmware or contact techsupport.");f=l.interfaceNumber,v.label=5;case 5:return v.trys.push([5,7,,9]),[4,u.claimInterface(f)];case 6:return v.sent(),[3,9];case 7:return c=v.sent(),[4,u.close()];case 8:throw v.sent(),new TransportInterfaceNotAvailable(c.message);case 9:return h=new a(u,f),p=function(y){u===y.device&&(navigator.usb.removeEventListener("disconnect",p),h._emitDisconnect(new DisconnectedDevice))},navigator.usb.addEventListener("disconnect",p),[2,h]}})})},a.prototype.close=function(){return __awaiter$1(this,void 0,void 0,function(){return __generator(this,function(u){switch(u.label){case 0:return[4,this.exchangeBusyPromise];case 1:return u.sent(),[4,this.device.releaseInterface(this.interfaceNumber)];case 2:return u.sent(),[4,gracefullyResetDevice(this.device)];case 3:return u.sent(),[4,this.device.close()];case 4:return u.sent(),[2]}})})},a.prototype.exchange=function(u){return __awaiter$1(this,void 0,void 0,function(){var l,f=this;return __generator(this,function(c){switch(c.label){case 0:return[4,this.exchangeAtomicImpl(function(){return __awaiter$1(f,void 0,void 0,function(){var h,p,v,y,b,S,E,R,O,I;return __generator(this,function(B){switch(B.label){case 0:h=this,p=h.channel,v=h.packetSize,log("apdu","=> "+u.toString("hex")),y=hidFraming(p,v),b=y.makeBlocks(u),S=0,B.label=1;case 1:return S<b.length?[4,this.device.transferOut(endpointNumber,b[S])]:[3,4];case 2:B.sent(),B.label=3;case 3:return S++,[3,1];case 4:return(E=y.getReducedResult(R))?[3,6]:[4,this.device.transferIn(endpointNumber,v)];case 5:return O=B.sent(),I=distExports.Buffer.from(O.data.buffer),R=y.reduceResponse(R,I),[3,4];case 6:return log("apdu","<= "+E.toString("hex")),[2,E]}})})}).catch(function(h){throw h&&h.message&&h.message.includes("disconnected")?(f._emitDisconnect(h),new DisconnectedDeviceDuringOperation(h.message)):h})];case 1:return l=c.sent(),[2,l]}})})},a.prototype.setScrambleKey=function(){},a.isSupported=isSupported,a.list=getLedgerDevices,a.listen=function(u){var l=!1;getFirstLedgerDevice().then(function(c){if(!l){var h=identifyUSBProductId(c.productId);u.next({type:"add",descriptor:c,deviceModel:h}),u.complete()}},function(c){window.DOMException&&c instanceof window.DOMException&&c.code===18?u.error(new TransportWebUSBGestureRequired(c.message)):u.error(new TransportOpenUserCancelled(c.message))});function f(){l=!0}return{unsubscribe:f}},a}(Transport);function gracefullyResetDevice(s){return __awaiter$1(this,void 0,void 0,function(){var a;return __generator(this,function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),[4,s.reset()];case 1:return u.sent(),[3,3];case 2:return a=u.sent(),console.warn(a),[3,3];case 3:return[2]}})})}function __awaiter(s,a,u,l){function f(c){return c instanceof u?c:new u(function(h){h(c)})}return new(u||(u=Promise))(function(c,h){function p(b){try{y(l.next(b))}catch(S){h(S)}}function v(b){try{y(l.throw(b))}catch(S){h(S)}}function y(b){b.done?c(b.value):f(b.value).then(p,v)}y((l=l.apply(s,[])).next())})}typeof SuppressedError=="function"&&SuppressedError;const MAX_CHUNK_SIZE=230;function transformPathToBuffer(s){const a=[];s.split("/").forEach(f=>{let c=parseInt(f,10);Number.isNaN(c)||(f.length>1&&f[f.length-1]==="'"&&(c+=2147483648),a.push(c))});const l=distExports.Buffer.alloc(1+a.length*4);return l[0]=a.length,a.forEach((f,c)=>{l.writeUInt32BE(f,1+4*c)}),l}function compressPublicKey(s,a){return a===0||a===3?s=s.slice(1):(s[0]=2+(s[64]&1),s=s.slice(0,33)),s}function appendWatermark(s,a){let u=s;return typeof a<"u"&&(u=distExports.Buffer.from(a).toString("hex").concat(s)),u}function chunkOperation(s,a){let u=0;for(;u!==a.length;){const l=u+MAX_CHUNK_SIZE>=a.length?a.length-u:MAX_CHUNK_SIZE,f=distExports.Buffer.alloc(l);a.copy(f,0,u,u+l),s.push(f),u+=l}return s}function validateResponse(s){let a=!0;s[0]!==49&&s[0]!==48&&(a=!1),s[1]+4!==s.length&&(a=!1),s[2]!==2&&(a=!1);const u=s[3];s[4+u]!==2&&(a=!1);const l=5+u,f=s[l];return l+1+f+2!==s.length&&(a=!1),a}function extractValue(s,a){const u=distExports.Buffer.alloc(32);u.fill(0);let l=a[s],f=s+1;return l>32&&(f+=l-32,l=32),a.copy(u,32-l,f,f+l),{buffer:u,idxValueStart:f,length:l}}class InvalidLedgerResponseError extends TaquitoError{constructor(a){super(),this.message=a,this.name="InvalidLedgerResponseError"}}class PublicKeyRetrievalError extends TaquitoError{constructor(a){super(),this.cause=a,this.name="PublicKeyRetrievalError",this.message="Unable to retrieve Public Key from Ledger"}}class PublicKeyHashRetrievalError extends TaquitoError{constructor(){super(),this.name="PublicKeyHashRetrievalError",this.message="Unable to retrieve Public Key Hash from Ledger"}}class InvalidDerivationTypeError extends ParameterValidationError{constructor(a){super(),this.derivationType=a,this.name="InvalidDerivationTypeError",this.message=`Invalid derivation type ${a} expecting one of the following: DerivationType.ED25519, DerivationType.SECP256K1, DerivationType.P256 or DerivationType.BIP32_ED25519`}}var DerivationType;(function(s){s[s.ED25519=0]="ED25519",s[s.SECP256K1=1]="SECP256K1",s[s.P256=2]="P256",s[s.BIP32_ED25519=3]="BIP32_ED25519"})(DerivationType||(DerivationType={}));class LedgerSigner{constructor(a,u="44'/1729'/0'/0'",l=!0,f=DerivationType.ED25519){if(this.transport=a,this.path=u,this.prompt=l,this.derivationType=f,this.CLA=128,this.INS_GET_PUBLIC_KEY=2,this.INS_PROMPT_PUBLIC_KEY=3,this.INS_SIGN=4,this.FIRST_MESSAGE_SEQUENCE=0,this.LAST_MESSAGE_SEQUENCE=129,this.OTHER_MESSAGE_SEQUENCE=1,this.transport.setScrambleKey("XTZ"),!u.startsWith("44'/1729'"))throw new InvalidDerivationPathError(u,`${invalidDetail(ValidationResult.NO_PREFIX_MATCHED)} expecting prefix "44'/1729'".`);if(!Object.values(DerivationType).includes(f))throw new InvalidDerivationTypeError(f.toString())}publicKeyHash(){return __awaiter(this,void 0,void 0,function*(){if(this._publicKeyHash||(yield this.publicKey()),this._publicKeyHash)return this._publicKeyHash;throw new PublicKeyHashRetrievalError})}publicKey(){return __awaiter(this,void 0,void 0,function*(){if(this._publicKey)return this._publicKey;const a=yield this.getLedgerPublicKey(),u=a[0],l=a.slice(1,1+u),f=compressPublicKey(l,this.derivationType),c=this.getPrefixes(),h=b58cencode(f,c.prefPk),p=b58cencode(blake2bExports.hash(f,20),c.prefPkh);return this._publicKey=h,this._publicKeyHash=p,h})}getLedgerPublicKey(){return __awaiter(this,void 0,void 0,function*(){try{let a=this.INS_PROMPT_PUBLIC_KEY;return this.prompt===!1&&(a=this.INS_GET_PUBLIC_KEY),yield this.transport.send(this.CLA,a,this.FIRST_MESSAGE_SEQUENCE,this.derivationType,transformPathToBuffer(this.path))}catch(a){throw new PublicKeyRetrievalError(a)}})}secretKey(){return __awaiter(this,void 0,void 0,function*(){throw new ProhibitedActionError("Secret key cannot be exposed")})}sign(a,u){return __awaiter(this,void 0,void 0,function*(){const l=appendWatermark(a,u),f=distExports.Buffer.from(l,"hex");let c=[];c.push(transformPathToBuffer(this.path)),c=chunkOperation(c,f);const h=yield this.signWithLedger(c);let p;if(this.derivationType===DerivationType.ED25519||this.derivationType===DerivationType.BIP32_ED25519)p=h.slice(0,h.length-2).toString("hex");else{if(!validateResponse(h))throw new InvalidLedgerResponseError("Invalid signature return by ledger unable to parse the response");const y=extractValue(3,h),b=y.idxValueStart+y.length+1,S=extractValue(b,h);p=distExports.Buffer.concat([y.buffer,S.buffer]).toString("hex")}return{bytes:a,sig:b58cencode(p,prefix[Prefix.SIG]),prefixSig:b58cencode(p,this.getPrefixes().prefSig),sbytes:a+p}})}signWithLedger(a){return __awaiter(this,void 0,void 0,function*(){let u=yield this.transport.send(this.CLA,this.INS_SIGN,this.FIRST_MESSAGE_SEQUENCE,this.derivationType,a[0]);for(let l=1;l<a.length;l++){const f=l===a.length-1?this.LAST_MESSAGE_SEQUENCE:this.OTHER_MESSAGE_SEQUENCE;u=yield this.transport.send(this.CLA,this.INS_SIGN,f,this.derivationType,a[l])}return u})}getPrefixes(){return this.derivationType===DerivationType.ED25519||this.derivationType===DerivationType.BIP32_ED25519?{prefPk:prefix[Prefix.EDPK],prefPkh:prefix[Prefix.TZ1],prefSig:prefix[Prefix.EDSIG]}:this.derivationType===DerivationType.SECP256K1?{prefPk:prefix[Prefix.SPPK],prefPkh:prefix[Prefix.TZ2],prefSig:prefix[Prefix.SPSIG]}:{prefPk:prefix[Prefix.P2PK],prefPkh:prefix[Prefix.TZ3],prefSig:prefix[Prefix.P2SIG]}}}var parsePkh=s=>{if(isValidContractPkh(s))return parseContractPkh(s);if(isValidImplicitPkh(s))return parseImplicitPkh(s);if(isValidSmartRollupPkh(s))return parseSmartRollupPkh(s);throw new CustomError(`Cannot parse address type: ${s}`)},isAddressValid=s=>validateAddress(s)===ValidationResult.VALID,isValidContractPkh=s=>isAddressValid(s)&&!!s.match(/^KT1\w+/),isValidImplicitPkh=s=>isAddressValid(s)&&!!s.match(/^tz[1234]\w+/),isValidSmartRollupPkh=s=>isAddressValid(s)&&!!s.match(/^sr1\w+/),parseContractPkh=s=>{if(isValidContractPkh(s))return{type:"contract",pkh:s};throw new CustomError(`Invalid contract address: ${s}`)},parseImplicitPkh=s=>{if(isValidImplicitPkh(s))return{type:"implicit",pkh:s};throw new CustomError(`Invalid implicit address: ${s}`)},parseSmartRollupPkh=s=>{if(isValidSmartRollupPkh(s))return{type:"smart_rollup",pkh:s};throw new CustomError(`Invalid smart rollup address: ${s}`)},TEZ="ꜩ",TEZ_DECIMALS=6,FakeSigner=class{constructor(s,a){ei(this,"pk");ei(this,"pkh");this.pk=s,this.pkh=a}publicKey(){return Promise.resolve(this.pk)}publicKeyHash(){return Promise.resolve(this.pkh)}sign(){return Promise.reject(new Error("`sign` method not available"))}secretKey(){return Promise.reject(new Error("empty secret key"))}},isAccountRevealed=async(s,a)=>{const u=`${a.tzktApiUrl}/v1/accounts/${s}?select.fields=type,revealed`,{type:l,revealed:f}=await fetch(u).then(c=>c.json());return l!=="empty"&&f},mutezToTez=s=>format("mutez","tz",s),formatTezAmount=s=>{const a=BigNumber(mutezToTez(s)).toNumber();return new Intl.NumberFormat("en-US",{minimumFractionDigits:TEZ_DECIMALS,maximumFractionDigits:TEZ_DECIMALS}).format(a)},prettyTezAmount=s=>`${formatTezAmount(s)} ${TEZ}`,curveToDerivationType=s=>{switch(s){case"ed25519":return DerivationType.ED25519;case"secp256k1":return DerivationType.SECP256K1;case"p256":return DerivationType.P256;case"bip25519":throw new CustomError("bip25519 is not supported in Tezos")}},makeSigner=async s=>{switch(s.type){case"social":case"mnemonic":case"secret_key":return new InMemorySigner(s.secretKey);case"ledger":{const a=await TransportWebUSB.list();for(let f=0;f<a.length;f++)a[f].close();const u=await TransportWebUSB.create();return new LedgerSigner(u,s.account.derivationPath,!1,curveToDerivationType(s.account.curve))}case"fake":return new FakeSigner(s.signer.pk,s.signer.address.pkh)}},makeToolkit=async s=>{const a=new TezosToolkit(s.network.rpcUrl),u=await makeSigner(s);return a.setSignerProvider(u),a},isValidMichelson=s=>{try{return new Parser$1().parseJSON(s),!0}catch{return!1}},MAINNET={name:"mainnet",rpcUrl:"https://mainnet.tezos.ecadinfra.com",tzktApiUrl:"https://api.mainnet.tzkt.io",tzktExplorerUrl:"https://tzkt.io",buyTezUrl:"https://widget.wert.io"},GHOSTNET={name:"ghostnet",rpcUrl:"https://ghostnet.tezos.ecadinfra.com",tzktApiUrl:"https://api.ghostnet.tzkt.io",tzktExplorerUrl:"https://ghostnet.tzkt.io",buyTezUrl:"https://faucet.ghostnet.teztnets.com/"};const sendResponse=s=>window.parent.postMessage(JSON.stringify(s),"*"),sendLoginErrorResponse=s=>{sendResponse({type:"login_response",error:"login_failed",errorMessage:s})},sendComputationErrorResponse=s=>{sendResponse({type:"computation_completed_response",error:"operation_failed",errorMessage:s})},sendOperationErrorResponse=s=>{sendResponse({type:"operation_response",error:"operation_failed",errorMessage:s})},sendSignPayloadErrorResponse=s=>{sendResponse({type:"sign_response",error:"sign_failed",errorMessage:s})},toTezosNetwork=s=>{switch(s){case"ghostnet":return GHOSTNET;case"mainnet":return MAINNET}},toSocialAccount=s=>({label:s.id,type:"social",idp:s.typeOfLogin,address:{type:"implicit",pkh:s.pkh},pk:s.pk}),USER_DATA_KEY="umami-embed-user-data",EmbedAppContext=reactExports.createContext(void 0),EmbedAppProvider=({children:s})=>{const a=reactExports.useRef(JSON.parse(localStorage.getItem(USER_DATA_KEY)||"null")),u=reactExports.useRef(null),l=reactExports.useRef(["google","reddit","twitter","facebook"]),f=reactExports.useRef(""),c=()=>a.current,h=()=>u.current,p=()=>l.current,v=()=>f.current,y=R=>{R!==null?localStorage.setItem(USER_DATA_KEY,JSON.stringify(R)):localStorage.removeItem(USER_DATA_KEY),a.current=R},b=R=>u.current=R,S=R=>l.current=R,E=R=>f.current=R;return jsxRuntimeExports.jsx(EmbedAppContext.Provider,{value:{getUserData:c,getNetwork:h,getLoginOptions:p,setUserData:y,setNetwork:b,setLoginOptions:S,getDAppOrigin:v,setDAppOrigin:E},children:s})},useEmbedApp=()=>{const s=reactExports.useContext(EmbedAppContext);if(s===void 0)throw new Error("useEmbedApp must be used within a EmbedAppProvider");return s},LoginModalContext=reactExports.createContext(void 0),LoginModalProvider=({children:s})=>{const{isOpen:a,onOpen:u,onClose:l}=useDisclosure(),[f,c]=reactExports.useState(!1);return jsxRuntimeExports.jsx(LoginModalContext.Provider,{value:{isOpen:a,onOpen:u,onClose:l,isLoading:f,setIsLoading:c},children:s})},useLoginModalContext=()=>{const s=reactExports.useContext(LoginModalContext);if(s===void 0)throw new Error("useLoginModalContext must be used within a LoginModalProvider");return s},LOGIN_TIMEOUT=3*60*1e3,LoginModalContent=()=>{const{isOpen:s,onClose:a,isLoading:u,setIsLoading:l}=useLoginModalContext(),{setUserData:f,getNetwork:c,getLoginOptions:h,getDAppOrigin:p}=useEmbedApp(),v=useColor();reactExports.useEffect(()=>{s&&!u&&h().length===1&&y(h()[0])},[s]);const y=async b=>{const S=`${c()}_${b}`;l(!0),track("login_button_click",{details:S,dAppOrigin:p()});try{const{secretKey:E,id:R,name:O,email:I,imageUrl:B}=await withTimeout(async()=>forIDP(b).getCredentials(),LOGIN_TIMEOUT),N=new InMemorySigner(E),{pk:D,pkh:G}={pk:await N.publicKey(),pkh:await N.publicKeyHash()},V={pk:D,pkh:G,typeOfLogin:b,id:R,name:O,emailAddress:I,imageUrl:B};f(V),track("successful_login",{details:S,dAppOrigin:p()}),sendResponse({...V,type:"login_response"})}catch(E){sendLoginErrorResponse(getErrorContext$1(E).description)}finally{l(!1),a()}};return jsxRuntimeExports.jsxs(VStack,{spacing:"0",children:[jsxRuntimeExports.jsx(Box,{marginBottom:"10px",children:jsxRuntimeExports.jsx(UmamiLogoIcon,{})}),jsxRuntimeExports.jsx(Heading,{marginBottom:"30px",fontSize:"16px",lineHeight:"22px",children:"Continue With"}),jsxRuntimeExports.jsx(Box,{position:"relative",width:"100%",children:jsxRuntimeExports.jsx(VStack,{width:"100%",spacing:"10px",children:h().map(b=>jsxRuntimeExports.jsx(LoginButtonComponent,{loginType:b,onClick:()=>y(b)},b))})}),jsxRuntimeExports.jsxs(Center,{marginTop:"30px",children:[jsxRuntimeExports.jsx(Text,{marginRight:"10px",color:v("500"),fontSize:"xs",lineHeight:"14px",children:"Powered by"}),jsxRuntimeExports.jsx(TezosLogoIcon,{})]})]})},MotionPath=motion.path,TezosSpinner=s=>{const a=useColor();return jsxRuntimeExports.jsxs(Icon,{width:"67",height:"67",viewBox:"0 0 67 67",fill:"none",xmlns:"http://www.w3.org/2000/svg",...s,children:[jsxRuntimeExports.jsx(motion.circle,{cx:"33.5",cy:"33.5",r:"32.5",stroke:a("black"),strokeWidth:"2",initial:{pathLength:.25},animate:{rotate:360},transition:{repeat:1/0,ease:"linear",duration:1}}),jsxRuntimeExports.jsx(MotionPath,{d:"M46.7777 41.5638C46.3997 34.9513 38.0831 31.9451 37.2851 31.6331C37.2551 31.6151 37.2551 31.5851 37.2671 31.5491L45.8477 22.9385V22.0145C45.8477 21.8705 45.7217 21.7385 45.5716 21.7385H29.7606V16.5541V15L23.9342 16.2181V17.1001H24.2582C24.2582 17.1001 25.6863 17.1001 25.6863 18.5282V21.7325H21.168C21.084 21.7325 21 21.8165 21 21.9005V23.9286H25.6923V34.9633C25.6923 38.4256 27.9185 40.8317 31.8127 40.5077C32.6408 40.4417 33.4088 40.1177 34.0569 39.6977C34.3509 39.4996 34.5309 39.1936 34.5309 38.8396V37.7475C33.2648 38.5876 32.1907 38.5456 32.1907 38.5456C29.7246 38.5456 29.7666 35.4074 29.7666 35.4074V23.9346H41.1373L32.9468 32.1851C32.9288 33.2772 32.9168 34.1173 32.9168 34.1353C32.9168 34.1653 32.9348 34.1833 32.9648 34.1833C40.4713 35.4494 42.4994 40.3037 42.4994 41.7198C42.4994 41.7198 43.3095 48.5962 36.439 49.0583C36.439 49.0583 31.9387 49.2563 31.1467 47.4502C31.1167 47.3842 31.1467 47.3242 31.2127 47.2822C31.9567 46.9461 32.4608 46.2741 32.4608 45.38C32.4608 44.0479 31.6507 42.9559 29.9406 42.9559C28.2305 42.9559 27.4204 44.0479 27.4204 45.38C27.4204 45.38 26.7724 51.1644 36.421 50.9964C47.4378 50.7984 46.7537 41.5578 46.7537 41.5578H46.7717L46.7777 41.5638Z",fill:a("black")})]})},ModalLoadingOverlay=()=>{const s=useColorMode();return jsxRuntimeExports.jsx(Flex,{position:"absolute",top:"0",right:"0",bottom:"0",left:"0",alignItems:"center",justifyContent:"center",borderRadius:"30px",backgroundColor:mode("rgba(255, 255, 255, 0.85)","rgba(16, 18, 27, 0.85)")(s),children:jsxRuntimeExports.jsx(TezosSpinner,{})})},useLoginModal=()=>{const{isOpen:s,onOpen:a,onClose:u,isLoading:l}=useLoginModalContext(),{getNetwork:f,getDAppOrigin:c}=useEmbedApp(),h=()=>{sendLoginErrorResponse("User closed the modal"),u()};return{modalElement:jsxRuntimeExports.jsx(Center,{children:jsxRuntimeExports.jsx(Modal,{autoFocus:!1,closeOnOverlayClick:!1,isCentered:!0,isOpen:s,onClose:u,children:jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsx(ModalCloseButton,{onClick:h}),jsxRuntimeExports.jsx(LoginModalContent,{}),l&&jsxRuntimeExports.jsx(ModalLoadingOverlay,{})]})})}),onOpen:()=>{track("login_modal_opened",{network:f(),dAppOrigin:c()}),a()}}},JsValueWrap=({value:s,space:a=2,...u})=>{const l=useColor();return jsxRuntimeExports.jsx(Card,{background:l("100"),borderRadius:"5px",...u,children:jsxRuntimeExports.jsx(CardBody,{children:jsxRuntimeExports.jsx("pre",{style:{whiteSpace:"pre-wrap",fontSize:"12px",lineHeight:"18px"},children:JSON.stringify(s,null,a)})})})};var ExposedPromiseStatus$1;(function(s){s.PENDING="pending",s.RESOLVED="resolved",s.REJECTED="rejected"})(ExposedPromiseStatus$1||(ExposedPromiseStatus$1={}));var src,hasRequiredSrc;function requireSrc(){if(hasRequiredSrc)return src;hasRequiredSrc=1;var s=requireSafeBuffer$2().Buffer;function a(u){if(u.length>=255)throw new TypeError("Alphabet too long");for(var l=new Uint8Array(256),f=0;f<l.length;f++)l[f]=255;for(var c=0;c<u.length;c++){var h=u.charAt(c),p=h.charCodeAt(0);if(l[p]!==255)throw new TypeError(h+" is ambiguous");l[p]=c}var v=u.length,y=u.charAt(0),b=Math.log(v)/Math.log(256),S=Math.log(256)/Math.log(v);function E(I){if((Array.isArray(I)||I instanceof Uint8Array)&&(I=s.from(I)),!s.isBuffer(I))throw new TypeError("Expected Buffer");if(I.length===0)return"";for(var B=0,N=0,D=0,G=I.length;D!==G&&I[D]===0;)D++,B++;for(var V=(G-D)*S+1>>>0,U=new Uint8Array(V);D!==G;){for(var te=I[D],Z=0,J=V-1;(te!==0||Z<N)&&J!==-1;J--,Z++)te+=256*U[J]>>>0,U[J]=te%v>>>0,te=te/v>>>0;if(te!==0)throw new Error("Non-zero carry");N=Z,D++}for(var Q=V-N;Q!==V&&U[Q]===0;)Q++;for(var ee=y.repeat(B);Q<V;++Q)ee+=u.charAt(U[Q]);return ee}function R(I){if(typeof I!="string")throw new TypeError("Expected String");if(I.length===0)return s.alloc(0);for(var B=0,N=0,D=0;I[B]===y;)N++,B++;for(var G=(I.length-B)*b+1>>>0,V=new Uint8Array(G);B<I.length;){var U=l[I.charCodeAt(B)];if(U===255)return;for(var te=0,Z=G-1;(U!==0||te<D)&&Z!==-1;Z--,te++)U+=v*V[Z]>>>0,V[Z]=U%256>>>0,U=U/256>>>0;if(U!==0)throw new Error("Non-zero carry");D=te,B++}for(var J=G-D;J!==G&&V[J]===0;)J++;var Q=s.allocUnsafe(N+(G-J));Q.fill(0,0,N);for(var ee=N;J!==G;)Q[ee++]=V[J++];return Q}function O(I){var B=R(I);if(B)return B;throw new Error("Non-base"+v+" character")}return{encode:E,decodeUnsafe:R,decode:O}}return src=a,src}var bs58,hasRequiredBs58;function requireBs58(){if(hasRequiredBs58)return bs58;hasRequiredBs58=1;var s=requireSrc(),a="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";return bs58=s(a),bs58}var base,hasRequiredBase;function requireBase(){if(hasRequiredBase)return base;hasRequiredBase=1;var s=requireBs58(),a=requireSafeBuffer$2().Buffer;return base=function(u){function l(p){var v=u(p);return s.encode(a.concat([p,v],p.length+4))}function f(p){var v=p.slice(0,-4),y=p.slice(-4),b=u(v);if(!(y[0]^b[0]|y[1]^b[1]|y[2]^b[2]|y[3]^b[3]))return v}function c(p){var v=s.decodeUnsafe(p);if(v)return f(v)}function h(p){var v=s.decode(p),y=f(v);if(!y)throw new Error("Invalid checksum");return y}return{encode:l,decode:h,decodeUnsafe:c}},base}var bs58check,hasRequiredBs58check;function requireBs58check(){if(hasRequiredBs58check)return bs58check;hasRequiredBs58check=1;var s=requireBrowser$9(),a=requireBase();function u(l){var f=s("sha256").update(l).digest();return s("sha256").update(f).digest()}return bs58check=a(u),bs58check}requireBs58check();requireRandom();var utf8={},hasRequiredUtf8;function requireUtf8(){if(hasRequiredUtf8)return utf8;hasRequiredUtf8=1,Object.defineProperty(utf8,"__esModule",{value:!0}),utf8.decode=utf8.encodedLength=utf8.encode=void 0;const s="utf8: invalid string",a="utf8: invalid source encoding";function u(c){const h=new Uint8Array(l(c));let p=0;for(let v=0;v<c.length;v++){let y=c.charCodeAt(v);y>=55296&&y<=56319&&(y=(y-55296<<10)+(c.charCodeAt(++v)-56320)+65536),y<128?h[p++]=y:y<2048?(h[p++]=192|y>>6,h[p++]=128|y&63):y<65536?(h[p++]=224|y>>12,h[p++]=128|y>>6&63,h[p++]=128|y&63):(h[p++]=240|y>>18,h[p++]=128|y>>12&63,h[p++]=128|y>>6&63,h[p++]=128|y&63)}return h}utf8.encode=u;function l(c){let h=0;for(let p=0;p<c.length;p++){let v=c.charCodeAt(p);if(v>=55296&&v<=56319){if(p===c.length-1)throw new Error(s);p++;const y=c.charCodeAt(p);if(y<56320||y>57343)throw new Error(s);v=(v-55296<<10)+(y-56320)+65536}v<128?h+=1:v<2048?h+=2:v<65536?h+=3:h+=4}return h}utf8.encodedLength=l;function f(c){const h=[];for(let p=0;p<c.length;p++){let v=c[p];if(v&128){let y;if(v<224){if(p>=c.length)throw new Error(a);const b=c[++p];if((b&192)!==128)throw new Error(a);v=(v&31)<<6|b&63,y=128}else if(v<240){if(p>=c.length-1)throw new Error(a);const b=c[++p],S=c[++p];if((b&192)!==128||(S&192)!==128)throw new Error(a);v=(v&15)<<12|(b&63)<<6|S&63,y=2048}else if(v<248){if(p>=c.length-2)throw new Error(a);const b=c[++p],S=c[++p],E=c[++p];if((b&192)!==128||(S&192)!==128||(E&192)!==128)throw new Error(a);v=(v&15)<<18|(b&63)<<12|(S&63)<<6|E&63,y=65536}else throw new Error(a);if(v<y||v>=55296&&v<=57343)throw new Error(a);if(v>=65536){if(v>1114111)throw new Error(a);v-=65536,h.push(String.fromCharCode(55296|v>>10)),v=56320|v&1023}}h.push(String.fromCharCode(v))}return h.join("")}return utf8.decode=f,utf8}requireUtf8();var bytes={},hasRequiredBytes;function requireBytes(){if(hasRequiredBytes)return bytes;hasRequiredBytes=1,Object.defineProperty(bytes,"__esModule",{value:!0});function s(){for(var a=0,u=0;u<arguments.length;u++)a+=arguments[u].length;for(var l=new Uint8Array(a),f=0,u=0;u<arguments.length;u++){var c=arguments[u];l.set(c,f),f+=c.length}return l}return bytes.concat=s,bytes}requireBytes();var BeaconMessageType;(function(s){s.BlockchainRequest="blockchain_request",s.PermissionRequest="permission_request",s.SignPayloadRequest="sign_payload_request",s.OperationRequest="operation_request",s.BroadcastRequest="broadcast_request",s.ChangeAccountRequest="change_account_request",s.BlockchainResponse="blockchain_response",s.PermissionResponse="permission_response",s.SignPayloadResponse="sign_payload_response",s.ProofOfEventChallengeRequest="proof_of_event_challenge_request",s.ProofOfEventChallengeResponse="proof_of_event_challenge_response",s.SimulatedProofOfEventChallengeRequest="simulated_proof_of_event_challenge_request",s.SimulatedProofOfEventChallengeResponse="simulated_proof_of_event_challenge_response",s.OperationResponse="operation_response",s.BroadcastResponse="broadcast_response",s.Acknowledge="acknowledge",s.Disconnect="disconnect",s.Error="error"})(BeaconMessageType||(BeaconMessageType={}));var PermissionScope;(function(s){s.SIGN="sign",s.OPERATION_REQUEST="operation_request",s.ENCRYPT="encrypt",s.NOTIFICATION="notification",s.THRESHOLD="threshold"})(PermissionScope||(PermissionScope={}));var NetworkType;(function(s){s.MAINNET="mainnet",s.GHOSTNET="ghostnet",s.WEEKLYNET="weeklynet",s.DAILYNET="dailynet",s.DELPHINET="delphinet",s.EDONET="edonet",s.FLORENCENET="florencenet",s.GRANADANET="granadanet",s.HANGZHOUNET="hangzhounet",s.ITHACANET="ithacanet",s.JAKARTANET="jakartanet",s.KATHMANDUNET="kathmandunet",s.LIMANET="limanet",s.MUMBAINET="mumbainet",s.NAIROBINET="nairobinet",s.OXFORDNET="oxfordnet",s.PARISNET="parisnet",s.CUSTOM="custom"})(NetworkType||(NetworkType={}));var TezosOperationType;(function(s){s.ORIGINATION="origination",s.DELEGATION="delegation",s.REVEAL="reveal",s.TRANSACTION="transaction",s.ACTIVATE_ACCOUNT="activate_account",s.ENDORSEMENT="endorsement",s.SEED_NONCE_REVELATION="seed_nonce_revelation",s.DOUBLE_ENDORSEMENT_EVIDENCE="double_endorsement_evidence",s.DOUBLE_BAKING_EVIDENCE="double_baking_evidence",s.PROPOSALS="proposals",s.BALLOT="ballot",s.ATTESTATION="attestation",s.PREATTESTATION="preattestation",s.PREENDORSEMENT="preendorsement",s.SET_DEPOSITS_LIMIT="set_deposits_limit",s.DOUBLE_PREATTESTATION_EVIDENCE="double_preattestation_evidence",s.DOUBLE_PREENDORSEMENT_EVIDENCE="double_preendorsement_evidence",s.ATTESTATION_WITH_SLOT="attestation_with_slot",s.ENDORSEMENT_WITH_SLOT="endorsement_with_slot",s.DOUBLE_ATTESTATION_EVIDENCE="double_attestation_evidence",s.FAILING_NOOP="failing_noop",s.REGISTER_GLOBAL_CONSTANT="register_global_constant",s.TRANSFER_TICKET="transfer_ticket",s.INCREASE_PAID_STORAGE="increase_paid_storage",s.UPDATE_CONSENSUS_KEY="update_consensus_key",s.DRAIN_DELEGATE="drain_delegate",s.VDF_REVELATION="vdf_revelation",s.EVENT="event",s.TICKET_UPDATES="ticket_updates",s.SMART_ROLLUP_ORIGINATE="smart_rollup_originate",s.SMART_ROLLUP_ADD_MESSAGES="smart_rollup_add_messages",s.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE="smart_rollup_execute_outbox_message",s.SMART_ROLLUP_PUBLISH="smart_rollup_publish",s.SMART_ROLLUP_CEMENT="smart_rollup_cement",s.SMART_ROLLUP_RECOVER_BOND="smart_rollup_recover_bond",s.SMART_ROLLUP_REFUTE="smart_rollup_refute",s.SMART_ROLLUP_TIMEOUT="smart_rollup_timeout",s.DAL_PUBLISH_COMMITMENT="dal_publish_commitment"})(TezosOperationType||(TezosOperationType={}));var Origin;(function(s){s.WEBSITE="website",s.EXTENSION="extension",s.P2P="p2p",s.WALLETCONNECT="walletconnect"})(Origin||(Origin={}));var ExtensionMessageTarget;(function(s){s.BACKGROUND="toBackground",s.PAGE="toPage",s.EXTENSION="toExtension"})(ExtensionMessageTarget||(ExtensionMessageTarget={}));var BeaconErrorType;(function(s){s.BROADCAST_ERROR="BROADCAST_ERROR",s.NETWORK_NOT_SUPPORTED="NETWORK_NOT_SUPPORTED",s.NO_ADDRESS_ERROR="NO_ADDRESS_ERROR",s.NO_PRIVATE_KEY_FOUND_ERROR="NO_PRIVATE_KEY_FOUND_ERROR",s.NOT_GRANTED_ERROR="NOT_GRANTED_ERROR",s.PARAMETERS_INVALID_ERROR="PARAMETERS_INVALID_ERROR",s.TOO_MANY_OPERATIONS="TOO_MANY_OPERATIONS",s.TRANSACTION_INVALID_ERROR="TRANSACTION_INVALID_ERROR",s.SIGNATURE_TYPE_NOT_SUPPORTED="SIGNATURE_TYPE_NOT_SUPPORTED",s.ABORTED_ERROR="ABORTED_ERROR",s.UNKNOWN_ERROR="UNKNOWN_ERROR"})(BeaconErrorType||(BeaconErrorType={}));var TransportStatus;(function(s){s.NOT_CONNECTED="NOT_CONNECTED",s.CONNECTING="CONNECTING",s.CONNECTED="CONNECTED",s.SECONDARY_TAB_CONNECTED="SECONDARY_TAB_CONNECTED"})(TransportStatus||(TransportStatus={}));var TransportType;(function(s){s.CHROME_MESSAGE="chrome_message",s.WALLETCONNECT="walletconnect",s.POST_MESSAGE="post_message",s.LEDGER="ledger",s.P2P="p2p"})(TransportType||(TransportType={}));var StorageKey;(function(s){s.TRANSPORT_P2P_PEERS_DAPP="beacon:communication-peers-dapp",s.TRANSPORT_P2P_PEERS_WALLET="beacon:communication-peers-wallet",s.TRANSPORT_POSTMESSAGE_PEERS_DAPP="beacon:postmessage-peers-dapp",s.TRANSPORT_POSTMESSAGE_PEERS_WALLET="beacon:postmessage-peers-wallet",s.TRANSPORT_WALLETCONNECT_PEERS_DAPP="beacon:walletconnect-peers-dapp",s.LAST_SELECTED_WALLET="beacon:last-selected-wallet",s.ACCOUNTS="beacon:accounts",s.ACTIVE_ACCOUNT="beacon:active-account",s.PUSH_TOKENS="beacon:push-tokens",s.BEACON_SDK_SECRET_SEED="beacon:sdk-secret-seed",s.APP_METADATA_LIST="beacon:app-metadata-list",s.PERMISSION_LIST="beacon:permissions",s.ONGOING_PROOF_OF_EVENT_CHALLENGES="beacon:ongoing-proof-of-event-challenges",s.BEACON_SDK_VERSION="beacon:sdk_version",s.MATRIX_PRESERVED_STATE="beacon:sdk-matrix-preserved-state",s.MATRIX_PEER_ROOM_IDS="beacon:matrix-peer-rooms",s.MATRIX_SELECTED_NODE="beacon:matrix-selected-node",s.MULTI_NODE_SETUP_DONE="beacon:multi-node-setup",s.USER_ID="beacon:user-id",s.ENABLE_METRICS="beacon:enable_metrics",s.WC_INIT_ERROR="beacon:wc-init-error",s.WC_2_CORE_PAIRING="wc@2:core:0.3:pairing",s.WC_2_CLIENT_SESSION="wc@2:client:0.3:session",s.WC_2_CORE_KEYCHAIN="wc@2:core:0.3:keychain",s.WC_2_CORE_MESSAGES="wc@2:core:0.3:messages",s.WC_2_CLIENT_PROPOSAL="wc@2:client:0.3:proposal",s.WC_2_CORE_SUBSCRIPTION="wc@2:core:0.3:subscription",s.WC_2_CORE_HISTORY="wc@2:core:0.3:history",s.WC_2_CORE_EXPIRER="wc@2:core:0.3:expirer"})(StorageKey||(StorageKey={}));StorageKey.TRANSPORT_P2P_PEERS_DAPP+"",StorageKey.TRANSPORT_P2P_PEERS_WALLET+"",StorageKey.TRANSPORT_POSTMESSAGE_PEERS_DAPP+"",StorageKey.TRANSPORT_POSTMESSAGE_PEERS_WALLET+"",StorageKey.TRANSPORT_WALLETCONNECT_PEERS_DAPP+"",StorageKey.LAST_SELECTED_WALLET+"",StorageKey.ACCOUNTS+"",StorageKey.ACTIVE_ACCOUNT+"",StorageKey.PUSH_TOKENS+"",StorageKey.BEACON_SDK_SECRET_SEED+"",StorageKey.APP_METADATA_LIST+"",StorageKey.PERMISSION_LIST+"",StorageKey.ONGOING_PROOF_OF_EVENT_CHALLENGES+"",StorageKey.BEACON_SDK_VERSION+"",StorageKey.MATRIX_PRESERVED_STATE+"",StorageKey.MATRIX_PEER_ROOM_IDS+"",StorageKey.MATRIX_SELECTED_NODE+"",StorageKey.MULTI_NODE_SETUP_DONE+"",StorageKey.WC_2_CLIENT_SESSION+"",StorageKey.USER_ID+"",StorageKey.ENABLE_METRICS+"",StorageKey.WC_INIT_ERROR+"",StorageKey.WC_2_CORE_PAIRING+"",StorageKey.WC_2_CORE_KEYCHAIN+"",StorageKey.WC_2_CORE_MESSAGES+"",StorageKey.WC_2_CLIENT_PROPOSAL+"",StorageKey.WC_2_CORE_SUBSCRIPTION+"",StorageKey.WC_2_CORE_HISTORY+"",StorageKey.WC_2_CORE_EXPIRER+"";var SigningType;(function(s){s.RAW="raw",s.OPERATION="operation",s.MICHELINE="micheline"})(SigningType||(SigningType={}));var ColorMode;(function(s){s.LIGHT="light",s.DARK="dark"})(ColorMode||(ColorMode={}));var Regions;(function(s){s.EUROPE_EAST="europe-east",s.EUROPE_WEST="europe-west",s.NORTH_AMERICA_EAST="north-america-east",s.NORTH_AMERICA_WEST="north-america-west",s.CENTRAL_AMERICA="central-america",s.SOUTH_AMERICA="south-america",s.ASIA_EAST="asia-east",s.ASIA_WEST="asia-west",s.AFRICA="africa",s.AUSTRALIA="australia"})(Regions||(Regions={}));const cbs$1=[s=>{}];let windowRef$1={postMessage:(s,a)=>{console.log("GOT MOCK POST MESSAGE",s),cbs$1.forEach(u=>{u({data:s})})},addEventListener:(s,a)=>{cbs$1.push(a)},removeEventListener:(s,a)=>{cbs$1.splice(cbs$1.indexOf(u=>u===a),1)},location:{origin:"*"}};try{typeof window<"u"&&(windowRef$1=window)}catch(s){console.log(`not defined: ${s}`)}let debug$1=!!windowRef$1.beaconSdkDebugEnabled;debug$1&&console.log("[BEACON]: Debug mode is ON (turned on either by the developer or a browser extension)");var x25519Session={},keyagreement={},hasRequiredKeyagreement;function requireKeyagreement(){return hasRequiredKeyagreement||(hasRequiredKeyagreement=1,function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.X25519Session=s.SECRET_SEED_LENGTH=s.SAVED_STATE_LENGTH=s.ACCEPT_MESSAGE_LENGTH=s.OFFER_MESSAGE_LENGTH=void 0;const a=requireRandom(),u=requireWipe(),l=requireX25519(),f=requireX25519Session();s.OFFER_MESSAGE_LENGTH=l.PUBLIC_KEY_LENGTH,s.ACCEPT_MESSAGE_LENGTH=l.PUBLIC_KEY_LENGTH,s.SAVED_STATE_LENGTH=l.SECRET_KEY_LENGTH,s.SECRET_SEED_LENGTH=l.SECRET_KEY_LENGTH;class c{constructor(p,v){this.offerMessageLength=s.OFFER_MESSAGE_LENGTH,this.acceptMessageLength=s.ACCEPT_MESSAGE_LENGTH,this.sharedKeyLength=l.SHARED_KEY_LENGTH,this.savedStateLength=s.SAVED_STATE_LENGTH,this._seed=p||(0,a.randomBytes)(l.SECRET_KEY_LENGTH,v)}saveState(){return new Uint8Array(this._seed)}restoreState(p){return this._seed=new Uint8Array(p),this}clean(){this._seed&&(0,u.wipe)(this._seed),this._keyPair&&((0,u.wipe)(this._keyPair.secretKey),(0,u.wipe)(this._keyPair.publicKey)),this._sharedKey&&(0,u.wipe)(this._sharedKey),this._sessionKeys&&((0,u.wipe)(this._sessionKeys.receive),(0,u.wipe)(this._sessionKeys.send))}offer(){return this._keyPair=(0,l.generateKeyPairFromSeed)(this._seed),new Uint8Array(this._keyPair.publicKey)}accept(p){if(this._keyPair)throw new Error("X25519Session: accept shouldn't be called by offering party");if(p.length!==this.offerMessageLength)throw new Error("X25519Session: incorrect offer message length");if(this._sharedKey)throw new Error("X25519Session: accept was already called");const v=(0,l.generateKeyPairFromSeed)(this._seed);return this._sharedKey=(0,l.sharedKey)(v.secretKey,p),this._sessionKeys=(0,f.clientSessionKeysFromSharedKey)(this._sharedKey,v.publicKey,p),(0,u.wipe)(v.secretKey),v.publicKey}finish(p){if(p.length!==this.acceptMessageLength)throw new Error("X25519Session: incorrect accept message length");if(!this._keyPair)throw new Error("X25519Session: no offer state");if(this._sharedKey)throw new Error("X25519Session: finish was already called");return this._sharedKey=(0,l.sharedKey)(this._keyPair.secretKey,p),this._sessionKeys=(0,f.serverSessionKeysFromSharedKey)(this._sharedKey,this._keyPair.publicKey,p),this}getSharedKey(){if(!this._sharedKey)throw new Error("X25519Session: no shared key established");return new Uint8Array(this._sharedKey)}getSessionKeys(){if(!this._sessionKeys)throw new Error("X25519Session: no shared key established");return{receive:new Uint8Array(this._sessionKeys.receive),send:new Uint8Array(this._sessionKeys.send)}}}s.X25519Session=c}(keyagreement)),keyagreement}var hasRequiredX25519Session;function requireX25519Session(){return hasRequiredX25519Session||(hasRequiredX25519Session=1,function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.clientSessionKeys=s.serverSessionKeys=s.clientSessionKeysFromSharedKey=s.serverSessionKeysFromSharedKey=s.X25519Session=void 0;const a=requireBlake2b$1(),u=requireX25519();var l=requireKeyagreement();Object.defineProperty(s,"X25519Session",{enumerable:!0,get:function(){return l.X25519Session}});const f=32;function c(y,b,S,E=a.BLAKE2b){const R=new E;if(R.digestLength!==f*2)throw new Error("X25519: incorrect digest length");const O=R.update(y).update(S).update(b).digest();return{send:O.subarray(0,f),receive:O.subarray(f)}}s.serverSessionKeysFromSharedKey=c;function h(y,b,S,E=a.BLAKE2b){const R=new E;if(R.digestLength!==f*2)throw new Error("X25519: incorrect digest length");const O=R.update(y).update(b).update(S).digest();return{receive:O.subarray(0,f),send:O.subarray(f)}}s.clientSessionKeysFromSharedKey=h;function p(y,b,S=a.BLAKE2b){const E=(0,u.sharedKey)(y.secretKey,b);return c(E,y.publicKey,b,S)}s.serverSessionKeys=p;function v(y,b,S=a.BLAKE2b){const E=(0,u.sharedKey)(y.secretKey,b);return h(E,y.publicKey,b,S)}s.clientSessionKeys=v}(x25519Session)),x25519Session}requireX25519Session();var ExposedPromiseStatus;(function(s){s.PENDING="pending",s.RESOLVED="resolved",s.REJECTED="rejected"})(ExposedPromiseStatus||(ExposedPromiseStatus={}));const cbs=[s=>{}];let windowRef={postMessage:(s,a)=>{console.log("GOT MOCK POST MESSAGE",s),cbs.forEach(u=>{u({data:s})})},addEventListener:(s,a)=>{cbs.push(a)},removeEventListener:(s,a)=>{cbs.splice(cbs.indexOf(u=>u===a),1)},location:{origin:"*"}};try{typeof window<"u"&&(windowRef=window)}catch(s){console.log(`not defined: ${s}`)}let debug=!!windowRef.beaconSdkDebugEnabled;debug&&console.log("[BEACON]: Debug mode is ON (turned on either by the developer or a browser extension)");var MatrixMessageType;(function(s){s.TEXT="m.text"})(MatrixMessageType||(MatrixMessageType={}));var MatrixRoomStatus;(function(s){s[s.UNKNOWN=0]="UNKNOWN",s[s.JOINED=1]="JOINED",s[s.INVITED=2]="INVITED",s[s.LEFT=3]="LEFT"})(MatrixRoomStatus||(MatrixRoomStatus={}));var MatrixClientEventType;(function(s){s.INVITE="invite",s.MESSAGE="message"})(MatrixClientEventType||(MatrixClientEventType={}));Regions.EUROPE_WEST+"",Regions.NORTH_AMERICA_EAST+"",Regions.NORTH_AMERICA_WEST+"",Regions.ASIA_EAST+"",Regions.AUSTRALIA+"";var lodash$1={exports:{}};/**
 * @license
 * Lodash <https://lodash.com/>
 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
 * Released under MIT license <https://lodash.com/license>
 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
 */var lodash=lodash$1.exports,hasRequiredLodash;function requireLodash(){return hasRequiredLodash||(hasRequiredLodash=1,function(s,a){(function(){var u,l="4.17.21",f=200,c="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",h="Expected a function",p="Invalid `variable` option passed into `_.template`",v="__lodash_hash_undefined__",y=500,b="__lodash_placeholder__",S=1,E=2,R=4,O=1,I=2,B=1,N=2,D=4,G=8,V=16,U=32,te=64,Z=128,J=256,Q=512,ee=30,k="...",d=800,g=16,_=1,w=2,x=3,P=1/0,$=9007199254740991,T=17976931348623157e292,m=NaN,M=4294967295,W=M-1,Y=M>>>1,ue=[["ary",Z],["bind",B],["bindKey",N],["curry",G],["curryRight",V],["flip",Q],["partial",U],["partialRight",te],["rearg",J]],ge="[object Arguments]",he="[object Array]",ae="[object AsyncFunction]",de="[object Boolean]",pe="[object Date]",oe="[object DOMException]",le="[object Error]",me="[object Function]",xe="[object GeneratorFunction]",Ne="[object Map]",Pe="[object Number]",Ie="[object Null]",Ke="[object Object]",Le="[object Promise]",Ce="[object Proxy]",at="[object RegExp]",Oe="[object Set]",De="[object String]",yt="[object Symbol]",Ue="[object Undefined]",ze="[object WeakMap]",Mt="[object WeakSet]",se="[object ArrayBuffer]",j="[object DataView]",X="[object Float32Array]",ce="[object Float64Array]",be="[object Int8Array]",Re="[object Int16Array]",Se="[object Int32Array]",qe="[object Uint8Array]",bt="[object Uint8ClampedArray]",je="[object Uint16Array]",We="[object Uint32Array]",St=/\b__p \+= '';/g,ut=/\b(__p \+=) '' \+/g,vt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,zt=/&(?:amp|lt|gt|quot|#39);/g,st=/[&<>"']/g,nt=RegExp(zt.source),Vt=RegExp(st.source),tt=/<%-([\s\S]+?)%>/g,ft=/<%([\s\S]+?)%>/g,Ft=/<%=([\s\S]+?)%>/g,Qe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,rt=/^\w*$/,Bt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xe=/[\\^$.*+?()[\]{}|]/g,ct=RegExp(Xe.source),Ut=/^\s+/,Je=/\s/,it=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,qt=/\{\n\/\* \[wrapped with (.+)\] \*/,et=/,? & /,ht=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ar=/[()=,{}\[\]\/\s]/,dt=/\\(\\)?/g,mt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Xt=/\w*$/,er=/^[-+]0x[0-9a-f]+$/i,kr=/^0b[01]+$/i,Ar=/^\[object .+?Constructor\]$/,Tr=/^0o[0-7]+$/i,Rr=/^(?:0|[1-9]\d*)$/,pr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_r=/($^)/,fr=/['\n\r\u2028\u2029\\]/g,Ht="\\ud800-\\udfff",Cr="\\u0300-\\u036f",ur="\\ufe20-\\ufe2f",wr="\\u20d0-\\u20ff",yr=Cr+ur+wr,Mr="\\u2700-\\u27bf",Er="a-z\\xdf-\\xf6\\xf8-\\xff",gr="\\xac\\xb1\\xd7\\xf7",sr="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ir="\\u2000-\\u206f",ln=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ji="A-Z\\xc0-\\xd6\\xd8-\\xde",Na="\\ufe0e\\ufe0f",La=gr+sr+Ir+ln,zi="['’]",ko="["+Ht+"]",Vi="["+La+"]",Ai="["+yr+"]",li="\\d+",lo="["+Mr+"]",Co="["+Er+"]",ia="[^"+Ht+La+li+Mr+Er+ji+"]",Ti="\\ud83c[\\udffb-\\udfff]",co="(?:"+Ai+"|"+Ti+")",Ba="[^"+Ht+"]",fo="(?:\\ud83c[\\udde6-\\uddff]){2}",br="[\\ud800-\\udbff][\\udc00-\\udfff]",Ri="["+ji+"]",oa="\\u200d",Io="(?:"+Co+"|"+ia+")",Hi="(?:"+Ri+"|"+ia+")",aa="(?:"+zi+"(?:d|ll|m|re|s|t|ve))?",sa="(?:"+zi+"(?:D|LL|M|RE|S|T|VE))?",Oo=co+"?",qn="["+Na+"]?",Tn="(?:"+oa+"(?:"+[Ba,fo,br].join("|")+")"+qn+Oo+")*",Rn="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Mn="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ki=qn+Oo+Tn,Mi="(?:"+[lo,fo,br].join("|")+")"+Ki,Pn="(?:"+[Ba+Ai+"?",Ai,fo,br,ko].join("|")+")",ua=RegExp(zi,"g"),mn=RegExp(Ai,"g"),cn=RegExp(Ti+"(?="+Ti+")|"+Pn+Ki,"g"),gs=RegExp([Ri+"?"+Co+"+"+aa+"(?="+[Vi,Ri,"$"].join("|")+")",Hi+"+"+sa+"(?="+[Vi,Ri+Io,"$"].join("|")+")",Ri+"?"+Io+"+"+aa,Ri+"+"+sa,Mn,Rn,li,Mi].join("|"),"g"),$o=RegExp("["+oa+Ht+yr+Na+"]"),No=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Lo=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],vs=-1,Or={};Or[X]=Or[ce]=Or[be]=Or[Re]=Or[Se]=Or[qe]=Or[bt]=Or[je]=Or[We]=!0,Or[ge]=Or[he]=Or[se]=Or[de]=Or[j]=Or[pe]=Or[le]=Or[me]=Or[Ne]=Or[Pe]=Or[Ke]=Or[at]=Or[Oe]=Or[De]=Or[ze]=!1;var xr={};xr[ge]=xr[he]=xr[se]=xr[j]=xr[de]=xr[pe]=xr[X]=xr[ce]=xr[be]=xr[Re]=xr[Se]=xr[Ne]=xr[Pe]=xr[Ke]=xr[at]=xr[Oe]=xr[De]=xr[yt]=xr[qe]=xr[bt]=xr[je]=xr[We]=!0,xr[le]=xr[me]=xr[ze]=!1;var Gi={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",Ĳ:"IJ",ĳ:"ij",Œ:"Oe",œ:"oe",ŉ:"'n",ſ:"s"},we={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Te={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},$e={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},_t=parseFloat,It=parseInt,Kt=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,Jt=typeof self=="object"&&self&&self.Object===Object&&self,Ct=Kt||Jt||Function("return this")(),Zt=a&&!a.nodeType&&a,Pr=Zt&&!0&&s&&!s.nodeType&&s,qr=Pr&&Pr.exports===Zt,gn=qr&&Kt.process,Zr=function(){try{var Ze=Pr&&Pr.require&&Pr.require("util").types;return Ze||gn&&gn.binding&&gn.binding("util")}catch{}}(),Pi=Zr&&Zr.isArrayBuffer,rn=Zr&&Zr.isDate,la=Zr&&Zr.isMap,nu=Zr&&Zr.isRegExp,Da=Zr&&Zr.isSet,kc=Zr&&Zr.isTypedArray;function Fn(Ze,wt,pt){switch(pt.length){case 0:return Ze.call(wt);case 1:return Ze.call(wt,pt[0]);case 2:return Ze.call(wt,pt[0],pt[1]);case 3:return Ze.call(wt,pt[0],pt[1],pt[2])}return Ze.apply(wt,pt)}function vl(Ze,wt,pt,$t){for(var or=-1,Lr=Ze==null?0:Ze.length;++or<Lr;){var nn=Ze[or];wt($t,nn,pt(nn),Ze)}return $t}function kn(Ze,wt){for(var pt=-1,$t=Ze==null?0:Ze.length;++pt<$t&&wt(Ze[pt],pt,Ze)!==!1;);return Ze}function iu(Ze,wt){for(var pt=Ze==null?0:Ze.length;pt--&&wt(Ze[pt],pt,Ze)!==!1;);return Ze}function yl(Ze,wt){for(var pt=-1,$t=Ze==null?0:Ze.length;++pt<$t;)if(!wt(Ze[pt],pt,Ze))return!1;return!0}function Bo(Ze,wt){for(var pt=-1,$t=Ze==null?0:Ze.length,or=0,Lr=[];++pt<$t;){var nn=Ze[pt];wt(nn,pt,Ze)&&(Lr[or++]=nn)}return Lr}function ou(Ze,wt){var pt=Ze==null?0:Ze.length;return!!pt&&qa(Ze,wt,0)>-1}function bl(Ze,wt,pt){for(var $t=-1,or=Ze==null?0:Ze.length;++$t<or;)if(pt(wt,Ze[$t]))return!0;return!1}function jr(Ze,wt){for(var pt=-1,$t=Ze==null?0:Ze.length,or=Array($t);++pt<$t;)or[pt]=wt(Ze[pt],pt,Ze);return or}function Do(Ze,wt){for(var pt=-1,$t=wt.length,or=Ze.length;++pt<$t;)Ze[or+pt]=wt[pt];return Ze}function _l(Ze,wt,pt,$t){var or=-1,Lr=Ze==null?0:Ze.length;for($t&&Lr&&(pt=Ze[++or]);++or<Lr;)pt=wt(pt,Ze[or],or,Ze);return pt}function Vf(Ze,wt,pt,$t){var or=Ze==null?0:Ze.length;for($t&&or&&(pt=Ze[--or]);or--;)pt=wt(pt,Ze[or],or,Ze);return pt}function wl(Ze,wt){for(var pt=-1,$t=Ze==null?0:Ze.length;++pt<$t;)if(wt(Ze[pt],pt,Ze))return!0;return!1}var Hf=El("length");function Cc(Ze){return Ze.split("")}function Kf(Ze){return Ze.match(ht)||[]}function Ic(Ze,wt,pt){var $t;return pt(Ze,function(or,Lr,nn){if(wt(or,Lr,nn))return $t=Lr,!1}),$t}function au(Ze,wt,pt,$t){for(var or=Ze.length,Lr=pt+($t?1:-1);$t?Lr--:++Lr<or;)if(wt(Ze[Lr],Lr,Ze))return Lr;return-1}function qa(Ze,wt,pt){return wt===wt?lu(Ze,wt,pt):au(Ze,Oc,pt)}function xl(Ze,wt,pt,$t){for(var or=pt-1,Lr=Ze.length;++or<Lr;)if($t(Ze[or],wt))return or;return-1}function Oc(Ze){return Ze!==Ze}function $c(Ze,wt){var pt=Ze==null?0:Ze.length;return pt?Sl(Ze,wt)/pt:m}function El(Ze){return function(wt){return wt==null?u:wt[Ze]}}function su(Ze){return function(wt){return Ze==null?u:Ze[wt]}}function Nc(Ze,wt,pt,$t,or){return or(Ze,function(Lr,nn,Fr){pt=$t?($t=!1,Lr):wt(pt,Lr,nn,Fr)}),pt}function Gf(Ze,wt){var pt=Ze.length;for(Ze.sort(wt);pt--;)Ze[pt]=Ze[pt].value;return Ze}function Sl(Ze,wt){for(var pt,$t=-1,or=Ze.length;++$t<or;){var Lr=wt(Ze[$t]);Lr!==u&&(pt=pt===u?Lr:pt+Lr)}return pt}function Al(Ze,wt){for(var pt=-1,$t=Array(Ze);++pt<Ze;)$t[pt]=wt(pt);return $t}function Wf(Ze,wt){return jr(wt,function(pt){return[pt,Ze[pt]]})}function Lc(Ze){return Ze&&Ze.slice(0,cu(Ze)+1).replace(Ut,"")}function ti(Ze){return function(wt){return Ze(wt)}}function ys(Ze,wt){return jr(wt,function(pt){return Ze[pt]})}function ho(Ze,wt){return Ze.has(wt)}function Bc(Ze,wt){for(var pt=-1,$t=Ze.length;++pt<$t&&qa(wt,Ze[pt],0)>-1;);return pt}function Tl(Ze,wt){for(var pt=Ze.length;pt--&&qa(wt,Ze[pt],0)>-1;);return pt}function Dc(Ze,wt){for(var pt=Ze.length,$t=0;pt--;)Ze[pt]===wt&&++$t;return $t}var qc=su(Gi),Fc=su(we);function Uc(Ze){return"\\"+$e[Ze]}function Fa(Ze,wt){return Ze==null?u:Ze[wt]}function Ua(Ze){return $o.test(Ze)}function Zf(Ze){return No.test(Ze)}function Yf(Ze){for(var wt,pt=[];!(wt=Ze.next()).done;)pt.push(wt.value);return pt}function uu(Ze){var wt=-1,pt=Array(Ze.size);return Ze.forEach(function($t,or){pt[++wt]=[or,$t]}),pt}function Rl(Ze,wt){return function(pt){return Ze(wt(pt))}}function ci(Ze,wt){for(var pt=-1,$t=Ze.length,or=0,Lr=[];++pt<$t;){var nn=Ze[pt];(nn===wt||nn===b)&&(Ze[pt]=b,Lr[or++]=pt)}return Lr}function qo(Ze){var wt=-1,pt=Array(Ze.size);return Ze.forEach(function($t){pt[++wt]=$t}),pt}function Xf(Ze){var wt=-1,pt=Array(Ze.size);return Ze.forEach(function($t){pt[++wt]=[$t,$t]}),pt}function lu(Ze,wt,pt){for(var $t=pt-1,or=Ze.length;++$t<or;)if(Ze[$t]===wt)return $t;return-1}function Jf(Ze,wt,pt){for(var $t=pt+1;$t--;)if(Ze[$t]===wt)return $t;return $t}function ca(Ze){return Ua(Ze)?zc(Ze):Hf(Ze)}function ri(Ze){return Ua(Ze)?Vc(Ze):Cc(Ze)}function cu(Ze){for(var wt=Ze.length;wt--&&Je.test(Ze.charAt(wt)););return wt}var jc=su(Te);function zc(Ze){for(var wt=cn.lastIndex=0;cn.test(Ze);)++wt;return wt}function Vc(Ze){return Ze.match(cn)||[]}function Qf(Ze){return Ze.match(gs)||[]}var ed=function Ze(wt){wt=wt==null?Ct:ja.defaults(Ct.Object(),wt,ja.pick(Ct,Lo));var pt=wt.Array,$t=wt.Date,or=wt.Error,Lr=wt.Function,nn=wt.Math,Fr=wt.Object,bs=wt.RegExp,td=wt.String,fi=wt.TypeError,po=pt.prototype,Ml=Lr.prototype,Wi=Fr.prototype,za=wt["__core-js_shared__"],_s=Ml.toString,Br=Wi.hasOwnProperty,Va=0,fu=function(){var L=/[^.]+$/.exec(za&&za.keys&&za.keys.IE_PROTO||"");return L?"Symbol(src)_1."+L:""}(),ws=Wi.toString,du=_s.call(Fr),Hc=Ct._,Kc=bs("^"+_s.call(Br).replace(Xe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),xs=qr?wt.Buffer:u,mo=wt.Symbol,Es=wt.Uint8Array,Pl=xs?xs.allocUnsafe:u,ki=Rl(Fr.getPrototypeOf,Fr),hu=Fr.create,pu=Wi.propertyIsEnumerable,mu=po.splice,Gc=mo?mo.isConcatSpreadable:u,go=mo?mo.iterator:u,fa=mo?mo.toStringTag:u,Ss=function(){try{var L=Yo(Fr,"defineProperty");return L({},"",{}),L}catch{}}(),Wc=wt.clearTimeout!==Ct.clearTimeout&&wt.clearTimeout,Vr=$t&&$t.now!==Ct.Date.now&&$t.now,kl=wt.setTimeout!==Ct.setTimeout&&wt.setTimeout,da=nn.ceil,Fo=nn.floor,gu=Fr.getOwnPropertySymbols,Cl=xs?xs.isBuffer:u,Ha=wt.isFinite,vu=po.join,Ka=Rl(Fr.keys,Fr),an=nn.max,Cn=nn.min,rd=$t.now,Zc=wt.parseInt,As=nn.random,yu=po.reverse,Ts=Yo(wt,"DataView"),ha=Yo(wt,"Map"),Rs=Yo(wt,"Promise"),Uo=Yo(wt,"Set"),Ms=Yo(wt,"WeakMap"),Ga=Yo(Fr,"create"),bu=Ms&&new Ms,Wa={},Il=Xo(Ts),jo=Xo(ha),Yc=Xo(Rs),Za=Xo(Uo),Zi=Xo(Ms),zo=mo?mo.prototype:u,ni=zo?zo.valueOf:u,_u=zo?zo.toString:u;function Me(L){if(un(L)&&!cr(L)&&!(L instanceof lr)){if(L instanceof In)return L;if(Br.call(L,"__wrapped__"))return Rf(L)}return new In(L)}var Ya=function(){function L(){}return function(q){if(!tn(q))return{};if(hu)return hu(q);L.prototype=q;var ie=new L;return L.prototype=u,ie}}();function Yi(){}function In(L,q){this.__wrapped__=L,this.__actions__=[],this.__chain__=!!q,this.__index__=0,this.__values__=u}Me.templateSettings={escape:tt,evaluate:ft,interpolate:Ft,variable:"",imports:{_:Me}},Me.prototype=Yi.prototype,Me.prototype.constructor=Me,In.prototype=Ya(Yi.prototype),In.prototype.constructor=In;function lr(L){this.__wrapped__=L,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=M,this.__views__=[]}function wu(){var L=new lr(this.__wrapped__);return L.__actions__=jn(this.__actions__),L.__dir__=this.__dir__,L.__filtered__=this.__filtered__,L.__iteratees__=jn(this.__iteratees__),L.__takeCount__=this.__takeCount__,L.__views__=jn(this.__views__),L}function Ol(){if(this.__filtered__){var L=new lr(this);L.__dir__=-1,L.__filtered__=!0}else L=this.clone(),L.__dir__*=-1;return L}function Xa(){var L=this.__wrapped__.value(),q=this.__dir__,ie=cr(L),ye=q<0,Ee=ie?L.length:0,ke=uc(0,Ee,this.__views__),Fe=ke.start,He=ke.end,Ye=He-Fe,xt=ye?He:Fe-1,Et=this.__iteratees__,Rt=Et.length,Ot=0,Wt=Cn(Ye,this.__takeCount__);if(!ie||!ye&&Ee==Ye&&Wt==Ye)return os(L,this.__actions__);var nr=[];e:for(;Ye--&&Ot<Wt;){xt+=q;for(var vr=-1,ir=L[xt];++vr<Rt;){var Sr=Et[vr],Nr=Sr.iteratee,Fi=Sr.type,ui=Nr(ir);if(Fi==w)ir=ui;else if(!ui){if(Fi==_)continue e;break e}}nr[Ot++]=ir}return nr}lr.prototype=Ya(Yi.prototype),lr.prototype.constructor=lr;function Gn(L){var q=-1,ie=L==null?0:L.length;for(this.clear();++q<ie;){var ye=L[q];this.set(ye[0],ye[1])}}function Hr(){this.__data__=Ga?Ga(null):{},this.size=0}function zr(L){var q=this.has(L)&&delete this.__data__[L];return this.size-=q?1:0,q}function Vo(L){var q=this.__data__;if(Ga){var ie=q[L];return ie===v?u:ie}return Br.call(q,L)?q[L]:u}function On(L){var q=this.__data__;return Ga?q[L]!==u:Br.call(q,L)}function Wn(L,q){var ie=this.__data__;return this.size+=this.has(L)?0:1,ie[L]=Ga&&q===u?v:q,this}Gn.prototype.clear=Hr,Gn.prototype.delete=zr,Gn.prototype.get=Vo,Gn.prototype.has=On,Gn.prototype.set=Wn;function Un(L){var q=-1,ie=L==null?0:L.length;for(this.clear();++q<ie;){var ye=L[q];this.set(ye[0],ye[1])}}function Ja(){this.__data__=[],this.size=0}function Zn(L){var q=this.__data__,ie=Nn(q,L);if(ie<0)return!1;var ye=q.length-1;return ie==ye?q.pop():mu.call(q,ie,1),--this.size,!0}function xu(L){var q=this.__data__,ie=Nn(q,L);return ie<0?u:q[ie][1]}function Xc(L){return Nn(this.__data__,L)>-1}function Jc(L,q){var ie=this.__data__,ye=Nn(ie,L);return ye<0?(++this.size,ie.push([L,q])):ie[ye][1]=q,this}Un.prototype.clear=Ja,Un.prototype.delete=Zn,Un.prototype.get=xu,Un.prototype.has=Xc,Un.prototype.set=Jc;function di(L){var q=-1,ie=L==null?0:L.length;for(this.clear();++q<ie;){var ye=L[q];this.set(ye[0],ye[1])}}function Qc(){this.size=0,this.__data__={hash:new Gn,map:new(ha||Un),string:new Gn}}function vo(L){var q=Vs(this,L).delete(L);return this.size-=q?1:0,q}function Eu(L){return Vs(this,L).get(L)}function $l(L){return Vs(this,L).has(L)}function ef(L,q){var ie=Vs(this,L),ye=ie.size;return ie.set(L,q),this.size+=ie.size==ye?0:1,this}di.prototype.clear=Qc,di.prototype.delete=vo,di.prototype.get=Eu,di.prototype.has=$l,di.prototype.set=ef;function pa(L){var q=-1,ie=L==null?0:L.length;for(this.__data__=new di;++q<ie;)this.add(L[q])}function Ho(L){return this.__data__.set(L,v),this}function Qa(L){return this.__data__.has(L)}pa.prototype.add=pa.prototype.push=Ho,pa.prototype.has=Qa;function $n(L){var q=this.__data__=new Un(L);this.size=q.size}function Su(){this.__data__=new Un,this.size=0}function Au(L){var q=this.__data__,ie=q.delete(L);return this.size=q.size,ie}function hi(L){return this.__data__.get(L)}function pi(L){return this.__data__.has(L)}function ma(L,q){var ie=this.__data__;if(ie instanceof Un){var ye=ie.__data__;if(!ha||ye.length<f-1)return ye.push([L,q]),this.size=++ie.size,this;ie=this.__data__=new di(ye)}return ie.set(L,q),this.size=ie.size,this}$n.prototype.clear=Su,$n.prototype.delete=Au,$n.prototype.get=hi,$n.prototype.has=pi,$n.prototype.set=ma;function Xi(L,q){var ie=cr(L),ye=!ie&&ru(L),Ee=!ie&&!ye&&ms(L),ke=!ie&&!ye&&!Ee&&pl(L),Fe=ie||ye||Ee||ke,He=Fe?Al(L.length,td):[],Ye=He.length;for(var xt in L)(q||Br.call(L,xt))&&!(Fe&&(xt=="length"||Ee&&(xt=="offset"||xt=="parent")||ke&&(xt=="buffer"||xt=="byteLength"||xt=="byteOffset")||Wr(xt,Ye)))&&He.push(xt);return He}function Ji(L){var q=L.length;return q?L[ns(0,q-1)]:u}function ga(L,q){return Xu(jn(L),yo(q,0,L.length))}function tf(L){return Xu(jn(L))}function Ps(L,q,ie){(ie!==u&&!Mo(L[q],ie)||ie===u&&!(q in L))&&Qi(L,q,ie)}function va(L,q,ie){var ye=L[q];(!(Br.call(L,q)&&Mo(ye,ie))||ie===u&&!(q in L))&&Qi(L,q,ie)}function Nn(L,q){for(var ie=L.length;ie--;)if(Mo(L[ie][0],q))return ie;return-1}function ii(L,q,ie,ye){return to(L,function(Ee,ke,Fe){q(ye,Ee,ie(Ee),Fe)}),ye}function Kr(L,q){return L&&Ii(q,Dn(q),L)}function Ci(L,q){return L&&Ii(q,Ei(q),L)}function Qi(L,q,ie){q=="__proto__"&&Ss?Ss(L,q,{configurable:!0,enumerable:!0,value:ie,writable:!0}):L[q]=ie}function Tu(L,q){for(var ie=-1,ye=q.length,Ee=pt(ye),ke=L==null;++ie<ye;)Ee[ie]=ke?u:Md(L,q[ie]);return Ee}function yo(L,q,ie){return L===L&&(ie!==u&&(L=L<=ie?L:ie),q!==u&&(L=L>=q?L:q)),L}function Yn(L,q,ie,ye,Ee,ke){var Fe,He=q&S,Ye=q&E,xt=q&R;if(ie&&(Fe=Ee?ie(L,ye,Ee,ke):ie(L)),Fe!==u)return Fe;if(!tn(L))return L;var Et=cr(L);if(Et){if(Fe=Ks(L),!He)return jn(L,Fe)}else{var Rt=En(L),Ot=Rt==me||Rt==xe;if(ms(L))return Zl(L,He);if(Rt==Ke||Rt==ge||Ot&&!Ee){if(Fe=Ye||Ot?{}:Sn(L),!He)return Ye?od(L,Ci(Fe,L)):qu(L,Kr(Fe,L))}else{if(!xr[Rt])return Ee?L:{};Fe=ad(L,Rt,He)}}ke||(ke=new $n);var Wt=ke.get(L);if(Wt)return Wt;ke.set(L,Fe),Ud(L)?L.forEach(function(ir){Fe.add(Yn(ir,q,ie,ir,L,ke))}):qd(L)&&L.forEach(function(ir,Sr){Fe.set(Sr,Yn(ir,q,ie,Sr,L,ke))});var nr=xt?Ye?zs:js:Ye?Ei:Dn,vr=Et?u:nr(L);return kn(vr||L,function(ir,Sr){vr&&(Sr=ir,ir=L[Sr]),va(Fe,Sr,Yn(ir,q,ie,Sr,L,ke))}),Fe}function rf(L){var q=Dn(L);return function(ie){return ks(ie,L,q)}}function ks(L,q,ie){var ye=ie.length;if(L==null)return!ye;for(L=Fr(L);ye--;){var Ee=ie[ye],ke=q[Ee],Fe=L[Ee];if(Fe===u&&!(Ee in L)||!ke(Fe))return!1}return!0}function Nl(L,q,ie){if(typeof L!="function")throw new fi(h);return ds(function(){L.apply(u,ie)},q)}function eo(L,q,ie,ye){var Ee=-1,ke=ou,Fe=!0,He=L.length,Ye=[],xt=q.length;if(!He)return Ye;ie&&(q=jr(q,ti(ie))),ye?(ke=bl,Fe=!1):q.length>=f&&(ke=ho,Fe=!1,q=new pa(q));e:for(;++Ee<He;){var Et=L[Ee],Rt=ie==null?Et:ie(Et);if(Et=ye||Et!==0?Et:0,Fe&&Rt===Rt){for(var Ot=xt;Ot--;)if(q[Ot]===Rt)continue e;Ye.push(Et)}else ke(q,Rt,ye)||Ye.push(Et)}return Ye}var to=bi(oi),nf=bi(Ko,!0);function Cs(L,q){var ie=!0;return to(L,function(ye,Ee,ke){return ie=!!q(ye,Ee,ke),ie}),ie}function ya(L,q,ie){for(var ye=-1,Ee=L.length;++ye<Ee;){var ke=L[ye],Fe=q(ke);if(Fe!=null&&(He===u?Fe===Fe&&!qi(Fe):ie(Fe,He)))var He=Fe,Ye=ke}return Ye}function af(L,q,ie,ye){var Ee=L.length;for(ie=hr(ie),ie<0&&(ie=-ie>Ee?0:Ee+ie),ye=ye===u||ye>Ee?Ee:hr(ye),ye<0&&(ye+=Ee),ye=ie>ye?0:zd(ye);ie<ye;)L[ie++]=q;return L}function Ll(L,q){var ie=[];return to(L,function(ye,Ee,ke){q(ye,Ee,ke)&&ie.push(ye)}),ie}function Jr(L,q,ie,ye,Ee){var ke=-1,Fe=L.length;for(ie||(ie=Wu),Ee||(Ee=[]);++ke<Fe;){var He=L[ke];q>0&&ie(He)?q>1?Jr(He,q-1,ie,ye,Ee):Do(Ee,He):ye||(Ee[Ee.length]=He)}return Ee}var Ru=Uu(),Is=Uu(!0);function oi(L,q){return L&&Ru(L,q,Dn)}function Ko(L,q){return L&&Is(L,q,Dn)}function es(L,q){return Bo(q,function(ie){return Ia(L[ie])})}function bo(L,q){q=io(q,L);for(var ie=0,ye=q.length;L!=null&&ie<ye;)L=L[Li(q[ie++])];return ie&&ie==ye?L:u}function Mu(L,q,ie){var ye=q(L);return cr(L)?ye:Do(ye,ie(L))}function wn(L){return L==null?L===u?Ue:Ie:fa&&fa in Fr(L)?Gu(L):cc(L)}function Go(L,q){return L>q}function mi(L,q){return L!=null&&Br.call(L,q)}function ba(L,q){return L!=null&&q in Fr(L)}function Bl(L,q,ie){return L>=Cn(q,ie)&&L<an(q,ie)}function Pu(L,q,ie){for(var ye=ie?bl:ou,Ee=L[0].length,ke=L.length,Fe=ke,He=pt(ke),Ye=1/0,xt=[];Fe--;){var Et=L[Fe];Fe&&q&&(Et=jr(Et,ti(q))),Ye=Cn(Et.length,Ye),He[Fe]=!ie&&(q||Ee>=120&&Et.length>=120)?new pa(Fe&&Et):u}Et=L[0];var Rt=-1,Ot=He[0];e:for(;++Rt<Ee&&xt.length<Ye;){var Wt=Et[Rt],nr=q?q(Wt):Wt;if(Wt=ie||Wt!==0?Wt:0,!(Ot?ho(Ot,nr):ye(xt,nr,ie))){for(Fe=ke;--Fe;){var vr=He[Fe];if(!(vr?ho(vr,nr):ye(L[Fe],nr,ie)))continue e}Ot&&Ot.push(nr),xt.push(Wt)}}return xt}function _o(L,q,ie,ye){return oi(L,function(Ee,ke,Fe){q(ye,ie(Ee),ke,Fe)}),ye}function gi(L,q,ie){q=io(q,L),L=vn(L,q);var ye=L==null?L:L[Li(Hn(q))];return ye==null?u:Fn(ye,L,ie)}function ku(L){return un(L)&&wn(L)==ge}function sf(L){return un(L)&&wn(L)==se}function wo(L){return un(L)&&wn(L)==pe}function vi(L,q,ie,ye,Ee){return L===q?!0:L==null||q==null||!un(L)&&!un(q)?L!==L&&q!==q:Cu(L,q,ie,ye,vi,Ee)}function Cu(L,q,ie,ye,Ee,ke){var Fe=cr(L),He=cr(q),Ye=Fe?he:En(L),xt=He?he:En(q);Ye=Ye==ge?Ke:Ye,xt=xt==ge?Ke:xt;var Et=Ye==Ke,Rt=xt==Ke,Ot=Ye==xt;if(Ot&&ms(L)){if(!ms(q))return!1;Fe=!0,Et=!1}if(Ot&&!Et)return ke||(ke=new $n),Fe||pl(L)?ac(L,q,ie,ye,Ee,ke):sc(L,q,Ye,ie,ye,Ee,ke);if(!(ie&O)){var Wt=Et&&Br.call(L,"__wrapped__"),nr=Rt&&Br.call(q,"__wrapped__");if(Wt||nr){var vr=Wt?L.value():L,ir=nr?q.value():q;return ke||(ke=new $n),Ee(vr,ir,ie,ye,ke)}}return Ot?(ke||(ke=new $n),yf(L,q,ie,ye,Ee,ke)):!1}function uf(L){return un(L)&&En(L)==Ne}function ts(L,q,ie,ye){var Ee=ie.length,ke=Ee,Fe=!ye;if(L==null)return!ke;for(L=Fr(L);Ee--;){var He=ie[Ee];if(Fe&&He[2]?He[1]!==L[He[0]]:!(He[0]in L))return!1}for(;++Ee<ke;){He=ie[Ee];var Ye=He[0],xt=L[Ye],Et=He[1];if(Fe&&He[2]){if(xt===u&&!(Ye in L))return!1}else{var Rt=new $n;if(ye)var Ot=ye(xt,Et,Ye,L,q,Rt);if(!(Ot===u?vi(Et,xt,O|I,ye,Rt):Ot))return!1}}return!0}function Dl(L){if(!tn(L)||xf(L))return!1;var q=Ia(L)?Kc:Ar;return q.test(Xo(L))}function Os(L){return un(L)&&wn(L)==at}function ro(L){return un(L)&&En(L)==Oe}function $s(L){return un(L)&&Uf(L.length)&&!!Or[wn(L)]}function rs(L){return typeof L=="function"?L:L==null?Si:typeof L=="object"?cr(L)?Gr(L[0],L[1]):Iu(L):eh(L)}function xo(L){if(!To(L))return Ka(L);var q=[];for(var ie in Fr(L))Br.call(L,ie)&&ie!="constructor"&&q.push(ie);return q}function ql(L){if(!tn(L))return Af(L);var q=To(L),ie=[];for(var ye in L)ye=="constructor"&&(q||!Br.call(L,ye))||ie.push(ye);return ie}function Wo(L,q){return L<q}function Fl(L,q){var ie=-1,ye=xi(L)?pt(L.length):[];return to(L,function(Ee,ke,Fe){ye[++ie]=q(Ee,ke,Fe)}),ye}function Iu(L){var q=Hs(L);return q.length==1&&q[0][2]?Zu(q[0][0],q[0][1]):function(ie){return ie===L||ts(ie,L,q)}}function Gr(L,q){return Lt(L)&&Ws(q)?Zu(Li(L),q):function(ie){var ye=Md(ie,L);return ye===u&&ye===q?Pd(ie,L):vi(q,ye,O|I)}}function wa(L,q,ie,ye,Ee){L!==q&&Ru(q,function(ke,Fe){if(Ee||(Ee=new $n),tn(ke))Ul(L,q,Fe,ie,wa,ye,Ee);else{var He=ye?ye(so(L,Fe),ke,Fe+"",L,q,Ee):u;He===u&&(He=ke),Ps(L,Fe,He)}},Ei)}function Ul(L,q,ie,ye,Ee,ke,Fe){var He=so(L,ie),Ye=so(q,ie),xt=Fe.get(Ye);if(xt){Ps(L,ie,xt);return}var Et=ke?ke(He,Ye,ie+"",L,q,Fe):u,Rt=Et===u;if(Rt){var Ot=cr(Ye),Wt=!Ot&&ms(Ye),nr=!Ot&&!Wt&&pl(Ye);Et=Ye,Ot||Wt||nr?cr(He)?Et=He:hn(He)?Et=jn(He):Wt?(Rt=!1,Et=Zl(Ye,!0)):nr?(Rt=!1,Et=hf(Ye,!0)):Et=[]:Pc(Ye)||ru(Ye)?(Et=He,ru(He)?Et=Vd(He):(!tn(He)||Ia(He))&&(Et=Sn(Ye))):Rt=!1}Rt&&(Fe.set(Ye,Et),Ee(Et,Ye,ye,ke,Fe),Fe.delete(Ye)),Ps(L,ie,Et)}function Ou(L,q){var ie=L.length;if(ie)return q+=q<0?ie:0,Wr(q,ie)?L[q]:u}function Ns(L,q,ie){q.length?q=jr(q,function(ke){return cr(ke)?function(Fe){return bo(Fe,ke.length===1?ke[0]:ke)}:ke}):q=[Si];var ye=-1;q=jr(q,ti(tr()));var Ee=Fl(L,function(ke,Fe,He){var Ye=jr(q,function(xt){return xt(ke)});return{criteria:Ye,index:++ye,value:ke}});return Gf(Ee,function(ke,Fe){return nd(ke,Fe,ie)})}function jl(L,q){return Zo(L,q,function(ie,ye){return Pd(L,ye)})}function Zo(L,q,ie){for(var ye=-1,Ee=q.length,ke={};++ye<Ee;){var Fe=q[ye],He=bo(L,Fe);ie(He,Fe)&&Ea(ke,io(Fe,L),He)}return ke}function Yr(L){return function(q){return bo(q,L)}}function Qr(L,q,ie,ye){var Ee=ye?xl:qa,ke=-1,Fe=q.length,He=L;for(L===q&&(q=jn(q)),ie&&(He=jr(L,ti(ie)));++ke<Fe;)for(var Ye=0,xt=q[ke],Et=ie?ie(xt):xt;(Ye=Ee(He,Et,Ye,ye))>-1;)He!==L&&mu.call(He,Ye,1),mu.call(L,Ye,1);return L}function fn(L,q){for(var ie=L?q.length:0,ye=ie-1;ie--;){var Ee=q[ie];if(ie==ye||Ee!==ke){var ke=Ee;Wr(Ee)?mu.call(L,Ee,1):Lu(L,Ee)}}return L}function ns(L,q){return L+Fo(As()*(q-L+1))}function Ls(L,q,ie,ye){for(var Ee=-1,ke=an(da((q-L)/(ie||1)),0),Fe=pt(ke);ke--;)Fe[ye?ke:++Ee]=L,L+=ie;return Fe}function xa(L,q){var ie="";if(!L||q<1||q>$)return ie;do q%2&&(ie+=L),q=Fo(q/2),q&&(L+=L);while(q);return ie}function dr(L,q){return ai(Yu(L,q,Si),L+"")}function Ln(L){return Ji(ml(L))}function zl(L,q){var ie=ml(L);return Xu(ie,yo(q,0,ie.length))}function Ea(L,q,ie,ye){if(!tn(L))return L;q=io(q,L);for(var Ee=-1,ke=q.length,Fe=ke-1,He=L;He!=null&&++Ee<ke;){var Ye=Li(q[Ee]),xt=ie;if(Ye==="__proto__"||Ye==="constructor"||Ye==="prototype")return L;if(Ee!=Fe){var Et=He[Ye];xt=ye?ye(Et,Ye,He):u,xt===u&&(xt=tn(Et)?Et:Wr(q[Ee+1])?[]:{})}va(He,Ye,xt),He=He[Ye]}return L}var $u=bu?function(L,q){return bu.set(L,q),L}:Si,no=Ss?function(L,q){return Ss(L,"toString",{configurable:!0,enumerable:!1,value:Cd(q),writable:!0})}:Si;function yi(L){return Xu(ml(L))}function Bn(L,q,ie){var ye=-1,Ee=L.length;q<0&&(q=-q>Ee?0:Ee+q),ie=ie>Ee?Ee:ie,ie<0&&(ie+=Ee),Ee=q>ie?0:ie-q>>>0,q>>>=0;for(var ke=pt(Ee);++ye<Ee;)ke[ye]=L[ye+q];return ke}function Vl(L,q){var ie;return to(L,function(ye,Ee,ke){return ie=q(ye,Ee,ke),!ie}),!!ie}function is(L,q,ie){var ye=0,Ee=L==null?ye:L.length;if(typeof q=="number"&&q===q&&Ee<=Y){for(;ye<Ee;){var ke=ye+Ee>>>1,Fe=L[ke];Fe!==null&&!qi(Fe)&&(ie?Fe<=q:Fe<q)?ye=ke+1:Ee=ke}return Ee}return Nu(L,q,Si,ie)}function Nu(L,q,ie,ye){var Ee=0,ke=L==null?0:L.length;if(ke===0)return 0;q=ie(q);for(var Fe=q!==q,He=q===null,Ye=qi(q),xt=q===u;Ee<ke;){var Et=Fo((Ee+ke)/2),Rt=ie(L[Et]),Ot=Rt!==u,Wt=Rt===null,nr=Rt===Rt,vr=qi(Rt);if(Fe)var ir=ye||nr;else xt?ir=nr&&(ye||Ot):He?ir=nr&&Ot&&(ye||!Wt):Ye?ir=nr&&Ot&&!Wt&&(ye||!vr):Wt||vr?ir=!1:ir=ye?Rt<=q:Rt<q;ir?Ee=Et+1:ke=Et}return Cn(ke,W)}function Hl(L,q){for(var ie=-1,ye=L.length,Ee=0,ke=[];++ie<ye;){var Fe=L[ie],He=q?q(Fe):Fe;if(!ie||!Mo(He,Ye)){var Ye=He;ke[Ee++]=Fe===0?0:Fe}}return ke}function Kl(L){return typeof L=="number"?L:qi(L)?m:+L}function Xn(L){if(typeof L=="string")return L;if(cr(L))return jr(L,Xn)+"";if(qi(L))return _u?_u.call(L):"";var q=L+"";return q=="0"&&1/L==-P?"-0":q}function Eo(L,q,ie){var ye=-1,Ee=ou,ke=L.length,Fe=!0,He=[],Ye=He;if(ie)Fe=!1,Ee=bl;else if(ke>=f){var xt=q?null:vf(L);if(xt)return qo(xt);Fe=!1,Ee=ho,Ye=new pa}else Ye=q?[]:He;e:for(;++ye<ke;){var Et=L[ye],Rt=q?q(Et):Et;if(Et=ie||Et!==0?Et:0,Fe&&Rt===Rt){for(var Ot=Ye.length;Ot--;)if(Ye[Ot]===Rt)continue e;q&&Ye.push(Rt),He.push(Et)}else Ee(Ye,Rt,ie)||(Ye!==He&&Ye.push(Rt),He.push(Et))}return He}function Lu(L,q){return q=io(q,L),L=vn(L,q),L==null||delete L[Li(Hn(q))]}function Gl(L,q,ie,ye){return Ea(L,q,ie(bo(L,q)),ye)}function Bs(L,q,ie,ye){for(var Ee=L.length,ke=ye?Ee:-1;(ye?ke--:++ke<Ee)&&q(L[ke],ke,L););return ie?Bn(L,ye?0:ke,ye?ke+1:Ee):Bn(L,ye?ke+1:0,ye?Ee:ke)}function os(L,q){var ie=L;return ie instanceof lr&&(ie=ie.value()),_l(q,function(ye,Ee){return Ee.func.apply(Ee.thisArg,Do([ye],Ee.args))},ie)}function Bu(L,q,ie){var ye=L.length;if(ye<2)return ye?Eo(L[0]):[];for(var Ee=-1,ke=pt(ye);++Ee<ye;)for(var Fe=L[Ee],He=-1;++He<ye;)He!=Ee&&(ke[Ee]=eo(ke[Ee]||Fe,L[He],q,ie));return Eo(Jr(ke,1),q,ie)}function Ds(L,q,ie){for(var ye=-1,Ee=L.length,ke=q.length,Fe={};++ye<Ee;){var He=ye<ke?q[ye]:u;ie(Fe,L[ye],He)}return Fe}function as(L){return hn(L)?L:[]}function Du(L){return typeof L=="function"?L:Si}function io(L,q){return cr(L)?L:Lt(L,q)?[L]:hc(Ur(L))}var lf=dr;function So(L,q,ie){var ye=L.length;return ie=ie===u?ye:ie,!q&&ie>=ye?L:Bn(L,q,ie)}var Wl=Wc||function(L){return Ct.clearTimeout(L)};function Zl(L,q){if(q)return L.slice();var ie=L.length,ye=Pl?Pl(ie):new L.constructor(ie);return L.copy(ye),ye}function qs(L){var q=new L.constructor(L.byteLength);return new Es(q).set(new Es(L)),q}function cf(L,q){var ie=q?qs(L.buffer):L.buffer;return new L.constructor(ie,L.byteOffset,L.byteLength)}function ff(L){var q=new L.constructor(L.source,Xt.exec(L));return q.lastIndex=L.lastIndex,q}function df(L){return ni?Fr(ni.call(L)):{}}function hf(L,q){var ie=q?qs(L.buffer):L.buffer;return new L.constructor(ie,L.byteOffset,L.length)}function Yl(L,q){if(L!==q){var ie=L!==u,ye=L===null,Ee=L===L,ke=qi(L),Fe=q!==u,He=q===null,Ye=q===q,xt=qi(q);if(!He&&!xt&&!ke&&L>q||ke&&Fe&&Ye&&!He&&!xt||ye&&Fe&&Ye||!ie&&Ye||!Ee)return 1;if(!ye&&!ke&&!xt&&L<q||xt&&ie&&Ee&&!ye&&!ke||He&&ie&&Ee||!Fe&&Ee||!Ye)return-1}return 0}function nd(L,q,ie){for(var ye=-1,Ee=L.criteria,ke=q.criteria,Fe=Ee.length,He=ie.length;++ye<Fe;){var Ye=Yl(Ee[ye],ke[ye]);if(Ye){if(ye>=He)return Ye;var xt=ie[ye];return Ye*(xt=="desc"?-1:1)}}return L.index-q.index}function pf(L,q,ie,ye){for(var Ee=-1,ke=L.length,Fe=ie.length,He=-1,Ye=q.length,xt=an(ke-Fe,0),Et=pt(Ye+xt),Rt=!ye;++He<Ye;)Et[He]=q[He];for(;++Ee<Fe;)(Rt||Ee<ke)&&(Et[ie[Ee]]=L[Ee]);for(;xt--;)Et[He++]=L[Ee++];return Et}function Xl(L,q,ie,ye){for(var Ee=-1,ke=L.length,Fe=-1,He=ie.length,Ye=-1,xt=q.length,Et=an(ke-He,0),Rt=pt(Et+xt),Ot=!ye;++Ee<Et;)Rt[Ee]=L[Ee];for(var Wt=Ee;++Ye<xt;)Rt[Wt+Ye]=q[Ye];for(;++Fe<He;)(Ot||Ee<ke)&&(Rt[Wt+ie[Fe]]=L[Ee++]);return Rt}function jn(L,q){var ie=-1,ye=L.length;for(q||(q=pt(ye));++ie<ye;)q[ie]=L[ie];return q}function Ii(L,q,ie,ye){var Ee=!ie;ie||(ie={});for(var ke=-1,Fe=q.length;++ke<Fe;){var He=q[ke],Ye=ye?ye(ie[He],L[He],He,ie,L):u;Ye===u&&(Ye=L[He]),Ee?Qi(ie,He,Ye):va(ie,He,Ye)}return ie}function qu(L,q){return Ii(L,Oi(L),q)}function od(L,q){return Ii(L,bf(L),q)}function Fu(L,q){return function(ie,ye){var Ee=cr(ie)?vl:ii,ke=q?q():{};return Ee(ie,L,tr(ye,2),ke)}}function ss(L){return dr(function(q,ie){var ye=-1,Ee=ie.length,ke=Ee>1?ie[Ee-1]:u,Fe=Ee>2?ie[2]:u;for(ke=L.length>3&&typeof ke=="function"?(Ee--,ke):u,Fe&&Vn(ie[0],ie[1],Fe)&&(ke=Ee<3?u:ke,Ee=1),q=Fr(q);++ye<Ee;){var He=ie[ye];He&&L(q,He,ye,ke)}return q})}function bi(L,q){return function(ie,ye){if(ie==null)return ie;if(!xi(ie))return L(ie,ye);for(var Ee=ie.length,ke=q?Ee:-1,Fe=Fr(ie);(q?ke--:++ke<Ee)&&ye(Fe[ke],ke,Fe)!==!1;);return ie}}function Uu(L){return function(q,ie,ye){for(var Ee=-1,ke=Fr(q),Fe=ye(q),He=Fe.length;He--;){var Ye=Fe[L?He:++Ee];if(ie(ke[Ye],Ye,ke)===!1)break}return q}}function ju(L,q,ie){var ye=q&B,Ee=us(L);function ke(){var Fe=this&&this!==Ct&&this instanceof ke?Ee:L;return Fe.apply(ye?ie:this,arguments)}return ke}function Jl(L){return function(q){q=Ur(q);var ie=Ua(q)?ri(q):u,ye=ie?ie[0]:q.charAt(0),Ee=ie?So(ie,1).join(""):q.slice(1);return ye[L]()+Ee}}function Sa(L){return function(q){return _l(Jd(Xd(q).replace(ua,"")),L,"")}}function us(L){return function(){var q=arguments;switch(q.length){case 0:return new L;case 1:return new L(q[0]);case 2:return new L(q[0],q[1]);case 3:return new L(q[0],q[1],q[2]);case 4:return new L(q[0],q[1],q[2],q[3]);case 5:return new L(q[0],q[1],q[2],q[3],q[4]);case 6:return new L(q[0],q[1],q[2],q[3],q[4],q[5]);case 7:return new L(q[0],q[1],q[2],q[3],q[4],q[5],q[6])}var ie=Ya(L.prototype),ye=L.apply(ie,q);return tn(ye)?ye:ie}}function Ql(L,q,ie){var ye=us(L);function Ee(){for(var ke=arguments.length,Fe=pt(ke),He=ke,Ye=Ao(Ee);He--;)Fe[He]=arguments[He];var xt=ke<3&&Fe[0]!==Ye&&Fe[ke-1]!==Ye?[]:ci(Fe,Ye);if(ke-=xt.length,ke<ie)return zn(L,q,ls,Ee.placeholder,u,Fe,xt,u,u,ie-ke);var Et=this&&this!==Ct&&this instanceof Ee?ye:L;return Fn(Et,this,Fe)}return Ee}function Aa(L){return function(q,ie,ye){var Ee=Fr(q);if(!xi(q)){var ke=tr(ie,3);q=Dn(q),ie=function(He){return ke(Ee[He],He,Ee)}}var Fe=L(q,ie,ye);return Fe>-1?Ee[ke?q[Fe]:Fe]:u}}function zu(L){return ao(function(q){var ie=q.length,ye=ie,Ee=In.prototype.thru;for(L&&q.reverse();ye--;){var ke=q[ye];if(typeof ke!="function")throw new fi(h);if(Ee&&!Fe&&cs(ke)=="wrapper")var Fe=new In([],!0)}for(ye=Fe?ye:ie;++ye<ie;){ke=q[ye];var He=cs(ke),Ye=He=="wrapper"?Ku(ke):u;Ye&&Gs(Ye[0])&&Ye[1]==(Z|G|U|J)&&!Ye[4].length&&Ye[9]==1?Fe=Fe[cs(Ye[0])].apply(Fe,Ye[3]):Fe=ke.length==1&&Gs(ke)?Fe[He]():Fe.thru(ke)}return function(){var xt=arguments,Et=xt[0];if(Fe&&xt.length==1&&cr(Et))return Fe.plant(Et).value();for(var Rt=0,Ot=ie?q[Rt].apply(this,xt):Et;++Rt<ie;)Ot=q[Rt].call(this,Ot);return Ot}})}function ls(L,q,ie,ye,Ee,ke,Fe,He,Ye,xt){var Et=q&Z,Rt=q&B,Ot=q&N,Wt=q&(G|V),nr=q&Q,vr=Ot?u:us(L);function ir(){for(var Sr=arguments.length,Nr=pt(Sr),Fi=Sr;Fi--;)Nr[Fi]=arguments[Fi];if(Wt)var ui=Ao(ir),Ui=Dc(Nr,ui);if(ye&&(Nr=pf(Nr,ye,Ee,Wt)),ke&&(Nr=Xl(Nr,ke,Fe,Wt)),Sr-=Ui,Wt&&Sr<xt){var pn=ci(Nr,ui);return zn(L,q,ls,ir.placeholder,ie,Nr,pn,He,Ye,xt-Sr)}var Po=Rt?ie:this,$a=Ot?Po[L]:L;return Sr=Nr.length,He?Nr=$i(Nr,He):nr&&Sr>1&&Nr.reverse(),Et&&Ye<Sr&&(Nr.length=Ye),this&&this!==Ct&&this instanceof ir&&($a=vr||us($a)),$a.apply(Po,Nr)}return ir}function mf(L,q){return function(ie,ye){return _o(ie,L,q(ye),{})}}function Fs(L,q){return function(ie,ye){var Ee;if(ie===u&&ye===u)return q;if(ie!==u&&(Ee=ie),ye!==u){if(Ee===u)return ye;typeof ie=="string"||typeof ye=="string"?(ie=Xn(ie),ye=Xn(ye)):(ie=Kl(ie),ye=Kl(ye)),Ee=L(ie,ye)}return Ee}}function Vu(L){return ao(function(q){return q=jr(q,ti(tr())),dr(function(ie){var ye=this;return L(q,function(Ee){return Fn(Ee,ye,ie)})})})}function Us(L,q){q=q===u?" ":Xn(q);var ie=q.length;if(ie<2)return ie?xa(q,L):q;var ye=xa(q,da(L/ca(q)));return Ua(q)?So(ri(ye),0,L).join(""):ye.slice(0,L)}function gf(L,q,ie,ye){var Ee=q&B,ke=us(L);function Fe(){for(var He=-1,Ye=arguments.length,xt=-1,Et=ye.length,Rt=pt(Et+Ye),Ot=this&&this!==Ct&&this instanceof Fe?ke:L;++xt<Et;)Rt[xt]=ye[xt];for(;Ye--;)Rt[xt++]=arguments[++He];return Fn(Ot,Ee?ie:this,Rt)}return Fe}function tc(L){return function(q,ie,ye){return ye&&typeof ye!="number"&&Vn(q,ie,ye)&&(ie=ye=u),q=Oa(q),ie===u?(ie=q,q=0):ie=Oa(ie),ye=ye===u?q<ie?1:-1:Oa(ye),Ls(q,ie,ye,L)}}function Hu(L){return function(q,ie){return typeof q=="string"&&typeof ie=="string"||(q=uo(q),ie=uo(ie)),L(q,ie)}}function zn(L,q,ie,ye,Ee,ke,Fe,He,Ye,xt){var Et=q&G,Rt=Et?Fe:u,Ot=Et?u:Fe,Wt=Et?ke:u,nr=Et?u:ke;q|=Et?U:te,q&=~(Et?te:U),q&D||(q&=~(B|N));var vr=[L,q,Ee,Wt,Rt,nr,Ot,He,Ye,xt],ir=ie.apply(u,vr);return Gs(L)&&fc(ir,vr),ir.placeholder=ye,dc(ir,L,q)}function xn(L){var q=nn[L];return function(ie,ye){if(ie=uo(ie),ye=ye==null?0:Cn(hr(ye),292),ye&&Ha(ie)){var Ee=(Ur(ie)+"e").split("e"),ke=q(Ee[0]+"e"+(+Ee[1]+ye));return Ee=(Ur(ke)+"e").split("e"),+(Ee[0]+"e"+(+Ee[1]-ye))}return q(ie)}}var vf=Uo&&1/qo(new Uo([,-0]))[1]==P?function(L){return new Uo(L)}:$d;function rc(L){return function(q){var ie=En(q);return ie==Ne?uu(q):ie==Oe?Xf(q):Wf(q,L(q))}}function oo(L,q,ie,ye,Ee,ke,Fe,He){var Ye=q&N;if(!Ye&&typeof L!="function")throw new fi(h);var xt=ye?ye.length:0;if(xt||(q&=~(U|te),ye=Ee=u),Fe=Fe===u?Fe:an(hr(Fe),0),He=He===u?He:hr(He),xt-=Ee?Ee.length:0,q&te){var Et=ye,Rt=Ee;ye=Ee=u}var Ot=Ye?u:Ku(L),Wt=[L,q,ie,ye,Ee,Et,Rt,ke,Fe,He];if(Ot&&Sf(Wt,Ot),L=Wt[0],q=Wt[1],ie=Wt[2],ye=Wt[3],Ee=Wt[4],He=Wt[9]=Wt[9]===u?Ye?0:L.length:an(Wt[9]-xt,0),!He&&q&(G|V)&&(q&=~(G|V)),!q||q==B)var nr=ju(L,q,ie);else q==G||q==V?nr=Ql(L,q,He):(q==U||q==(B|U))&&!Ee.length?nr=gf(L,q,ie,ye):nr=ls.apply(u,Wt);var vr=Ot?$u:fc;return dc(vr(nr,Wt),L,q)}function nc(L,q,ie,ye){return L===u||Mo(L,Wi[ie])&&!Br.call(ye,ie)?q:L}function ic(L,q,ie,ye,Ee,ke){return tn(L)&&tn(q)&&(ke.set(q,L),wa(L,q,u,ic,ke),ke.delete(q)),L}function oc(L){return Pc(L)?u:L}function ac(L,q,ie,ye,Ee,ke){var Fe=ie&O,He=L.length,Ye=q.length;if(He!=Ye&&!(Fe&&Ye>He))return!1;var xt=ke.get(L),Et=ke.get(q);if(xt&&Et)return xt==q&&Et==L;var Rt=-1,Ot=!0,Wt=ie&I?new pa:u;for(ke.set(L,q),ke.set(q,L);++Rt<He;){var nr=L[Rt],vr=q[Rt];if(ye)var ir=Fe?ye(vr,nr,Rt,q,L,ke):ye(nr,vr,Rt,L,q,ke);if(ir!==u){if(ir)continue;Ot=!1;break}if(Wt){if(!wl(q,function(Sr,Nr){if(!ho(Wt,Nr)&&(nr===Sr||Ee(nr,Sr,ie,ye,ke)))return Wt.push(Nr)})){Ot=!1;break}}else if(!(nr===vr||Ee(nr,vr,ie,ye,ke))){Ot=!1;break}}return ke.delete(L),ke.delete(q),Ot}function sc(L,q,ie,ye,Ee,ke,Fe){switch(ie){case j:if(L.byteLength!=q.byteLength||L.byteOffset!=q.byteOffset)return!1;L=L.buffer,q=q.buffer;case se:return!(L.byteLength!=q.byteLength||!ke(new Es(L),new Es(q)));case de:case pe:case Pe:return Mo(+L,+q);case le:return L.name==q.name&&L.message==q.message;case at:case De:return L==q+"";case Ne:var He=uu;case Oe:var Ye=ye&O;if(He||(He=qo),L.size!=q.size&&!Ye)return!1;var xt=Fe.get(L);if(xt)return xt==q;ye|=I,Fe.set(L,q);var Et=ac(He(L),He(q),ye,Ee,ke,Fe);return Fe.delete(L),Et;case yt:if(ni)return ni.call(L)==ni.call(q)}return!1}function yf(L,q,ie,ye,Ee,ke){var Fe=ie&O,He=js(L),Ye=He.length,xt=js(q),Et=xt.length;if(Ye!=Et&&!Fe)return!1;for(var Rt=Ye;Rt--;){var Ot=He[Rt];if(!(Fe?Ot in q:Br.call(q,Ot)))return!1}var Wt=ke.get(L),nr=ke.get(q);if(Wt&&nr)return Wt==q&&nr==L;var vr=!0;ke.set(L,q),ke.set(q,L);for(var ir=Fe;++Rt<Ye;){Ot=He[Rt];var Sr=L[Ot],Nr=q[Ot];if(ye)var Fi=Fe?ye(Nr,Sr,Ot,q,L,ke):ye(Sr,Nr,Ot,L,q,ke);if(!(Fi===u?Sr===Nr||Ee(Sr,Nr,ie,ye,ke):Fi)){vr=!1;break}ir||(ir=Ot=="constructor")}if(vr&&!ir){var ui=L.constructor,Ui=q.constructor;ui!=Ui&&"constructor"in L&&"constructor"in q&&!(typeof ui=="function"&&ui instanceof ui&&typeof Ui=="function"&&Ui instanceof Ui)&&(vr=!1)}return ke.delete(L),ke.delete(q),vr}function ao(L){return ai(Yu(L,u,Qu),L+"")}function js(L){return Mu(L,Dn,Oi)}function zs(L){return Mu(L,Ei,bf)}var Ku=bu?function(L){return bu.get(L)}:$d;function cs(L){for(var q=L.name+"",ie=Wa[q],ye=Br.call(Wa,q)?ie.length:0;ye--;){var Ee=ie[ye],ke=Ee.func;if(ke==null||ke==L)return Ee.name}return q}function Ao(L){var q=Br.call(Me,"placeholder")?Me:L;return q.placeholder}function tr(){var L=Me.iteratee||Id;return L=L===Id?rs:L,arguments.length?L(arguments[0],arguments[1]):L}function Vs(L,q){var ie=L.__data__;return fs(q)?ie[typeof q=="string"?"string":"hash"]:ie.map}function Hs(L){for(var q=Dn(L),ie=q.length;ie--;){var ye=q[ie],Ee=L[ye];q[ie]=[ye,Ee,Ws(Ee)]}return q}function Yo(L,q){var ie=Fa(L,q);return Dl(ie)?ie:u}function Gu(L){var q=Br.call(L,fa),ie=L[fa];try{L[fa]=u;var ye=!0}catch{}var Ee=ws.call(L);return ye&&(q?L[fa]=ie:delete L[fa]),Ee}var Oi=gu?function(L){return L==null?[]:(L=Fr(L),Bo(gu(L),function(q){return pu.call(L,q)}))}:Nd,bf=gu?function(L){for(var q=[];L;)Do(q,Oi(L)),L=ki(L);return q}:Nd,En=wn;(Ts&&En(new Ts(new ArrayBuffer(1)))!=j||ha&&En(new ha)!=Ne||Rs&&En(Rs.resolve())!=Le||Uo&&En(new Uo)!=Oe||Ms&&En(new Ms)!=ze)&&(En=function(L){var q=wn(L),ie=q==Ke?L.constructor:u,ye=ie?Xo(ie):"";if(ye)switch(ye){case Il:return j;case jo:return Ne;case Yc:return Le;case Za:return Oe;case Zi:return ze}return q});function uc(L,q,ie){for(var ye=-1,Ee=ie.length;++ye<Ee;){var ke=ie[ye],Fe=ke.size;switch(ke.type){case"drop":L+=Fe;break;case"dropRight":q-=Fe;break;case"take":q=Cn(q,L+Fe);break;case"takeRight":L=an(L,q-Fe);break}}return{start:L,end:q}}function wf(L){var q=L.match(qt);return q?q[1].split(et):[]}function lc(L,q,ie){q=io(q,L);for(var ye=-1,Ee=q.length,ke=!1;++ye<Ee;){var Fe=Li(q[ye]);if(!(ke=L!=null&&ie(L,Fe)))break;L=L[Fe]}return ke||++ye!=Ee?ke:(Ee=L==null?0:L.length,!!Ee&&Uf(Ee)&&Wr(Fe,Ee)&&(cr(L)||ru(L)))}function Ks(L){var q=L.length,ie=new L.constructor(q);return q&&typeof L[0]=="string"&&Br.call(L,"index")&&(ie.index=L.index,ie.input=L.input),ie}function Sn(L){return typeof L.constructor=="function"&&!To(L)?Ya(ki(L)):{}}function ad(L,q,ie){var ye=L.constructor;switch(q){case se:return qs(L);case de:case pe:return new ye(+L);case j:return cf(L,ie);case X:case ce:case be:case Re:case Se:case qe:case bt:case je:case We:return hf(L,ie);case Ne:return new ye;case Pe:case De:return new ye(L);case at:return ff(L);case Oe:return new ye;case yt:return df(L)}}function sd(L,q){var ie=q.length;if(!ie)return L;var ye=ie-1;return q[ye]=(ie>1?"& ":"")+q[ye],q=q.join(ie>2?", ":" "),L.replace(it,`{
/* [wrapped with `+q+`] */
`)}function Wu(L){return cr(L)||ru(L)||!!(Gc&&L&&L[Gc])}function Wr(L,q){var ie=typeof L;return q=q??$,!!q&&(ie=="number"||ie!="symbol"&&Rr.test(L))&&L>-1&&L%1==0&&L<q}function Vn(L,q,ie){if(!tn(ie))return!1;var ye=typeof q;return(ye=="number"?xi(ie)&&Wr(q,ie.length):ye=="string"&&q in ie)?Mo(ie[q],L):!1}function Lt(L,q){if(cr(L))return!1;var ie=typeof L;return ie=="number"||ie=="symbol"||ie=="boolean"||L==null||qi(L)?!0:rt.test(L)||!Qe.test(L)||q!=null&&L in Fr(q)}function fs(L){var q=typeof L;return q=="string"||q=="number"||q=="symbol"||q=="boolean"?L!=="__proto__":L===null}function Gs(L){var q=cs(L),ie=Me[q];if(typeof ie!="function"||!(q in lr.prototype))return!1;if(L===ie)return!0;var ye=Ku(ie);return!!ye&&L===ye[0]}function xf(L){return!!fu&&fu in L}var ud=za?Ia:Ld;function To(L){var q=L&&L.constructor,ie=typeof q=="function"&&q.prototype||Wi;return L===ie}function Ws(L){return L===L&&!tn(L)}function Zu(L,q){return function(ie){return ie==null?!1:ie[L]===q&&(q!==u||L in Fr(ie))}}function Ef(L){var q=lt(L,function(ye){return ie.size===y&&ie.clear(),ye}),ie=q.cache;return q}function Sf(L,q){var ie=L[1],ye=q[1],Ee=ie|ye,ke=Ee<(B|N|Z),Fe=ye==Z&&ie==G||ye==Z&&ie==J&&L[7].length<=q[8]||ye==(Z|J)&&q[7].length<=q[8]&&ie==G;if(!(ke||Fe))return L;ye&B&&(L[2]=q[2],Ee|=ie&B?0:D);var He=q[3];if(He){var Ye=L[3];L[3]=Ye?pf(Ye,He,q[4]):He,L[4]=Ye?ci(L[3],b):q[4]}return He=q[5],He&&(Ye=L[5],L[5]=Ye?Xl(Ye,He,q[6]):He,L[6]=Ye?ci(L[5],b):q[6]),He=q[7],He&&(L[7]=He),ye&Z&&(L[8]=L[8]==null?q[8]:Cn(L[8],q[8])),L[9]==null&&(L[9]=q[9]),L[0]=q[0],L[1]=Ee,L}function Af(L){var q=[];if(L!=null)for(var ie in Fr(L))q.push(ie);return q}function cc(L){return ws.call(L)}function Yu(L,q,ie){return q=an(q===u?L.length-1:q,0),function(){for(var ye=arguments,Ee=-1,ke=an(ye.length-q,0),Fe=pt(ke);++Ee<ke;)Fe[Ee]=ye[q+Ee];Ee=-1;for(var He=pt(q+1);++Ee<q;)He[Ee]=ye[Ee];return He[q]=ie(Fe),Fn(L,this,He)}}function vn(L,q){return q.length<2?L:bo(L,Bn(q,0,-1))}function $i(L,q){for(var ie=L.length,ye=Cn(q.length,ie),Ee=jn(L);ye--;){var ke=q[ye];L[ye]=Wr(ke,ie)?Ee[ke]:u}return L}function so(L,q){if(!(q==="constructor"&&typeof L[q]=="function")&&q!="__proto__")return L[q]}var fc=Ni($u),ds=kl||function(L,q){return Ct.setTimeout(L,q)},ai=Ni(no);function dc(L,q,ie){var ye=q+"";return ai(L,sd(ye,Tf(wf(ye),ie)))}function Ni(L){var q=0,ie=0;return function(){var ye=rd(),Ee=g-(ye-ie);if(ie=ye,Ee>0){if(++q>=d)return arguments[0]}else q=0;return L.apply(u,arguments)}}function Xu(L,q){var ie=-1,ye=L.length,Ee=ye-1;for(q=q===u?ye:q;++ie<q;){var ke=ns(ie,Ee),Fe=L[ke];L[ke]=L[ie],L[ie]=Fe}return L.length=q,L}var hc=Ef(function(L){var q=[];return L.charCodeAt(0)===46&&q.push(""),L.replace(Bt,function(ie,ye,Ee,ke){q.push(Ee?ke.replace(dt,"$1"):ye||ie)}),q});function Li(L){if(typeof L=="string"||qi(L))return L;var q=L+"";return q=="0"&&1/L==-P?"-0":q}function Xo(L){if(L!=null){try{return _s.call(L)}catch{}try{return L+""}catch{}}return""}function Tf(L,q){return kn(ue,function(ie){var ye="_."+ie[0];q&ie[1]&&!ou(L,ye)&&L.push(ye)}),L.sort()}function Rf(L){if(L instanceof lr)return L.clone();var q=new In(L.__wrapped__,L.__chain__);return q.__actions__=jn(L.__actions__),q.__index__=L.__index__,q.__values__=L.__values__,q}function Ju(L,q,ie){(ie?Vn(L,q,ie):q===u)?q=1:q=an(hr(q),0);var ye=L==null?0:L.length;if(!ye||q<1)return[];for(var Ee=0,ke=0,Fe=pt(da(ye/q));Ee<ye;)Fe[ke++]=Bn(L,Ee,Ee+=q);return Fe}function pc(L){for(var q=-1,ie=L==null?0:L.length,ye=0,Ee=[];++q<ie;){var ke=L[q];ke&&(Ee[ye++]=ke)}return Ee}function _i(){var L=arguments.length;if(!L)return[];for(var q=pt(L-1),ie=arguments[0],ye=L;ye--;)q[ye-1]=arguments[ye];return Do(cr(ie)?jn(ie):[ie],Jr(q,1))}var $r=dr(function(L,q){return hn(L)?eo(L,Jr(q,1,hn,!0)):[]}),yn=dr(function(L,q){var ie=Hn(q);return hn(ie)&&(ie=u),hn(L)?eo(L,Jr(q,1,hn,!0),tr(ie,2)):[]}),sn=dr(function(L,q){var ie=Hn(q);return hn(ie)&&(ie=u),hn(L)?eo(L,Jr(q,1,hn,!0),u,ie):[]});function An(L,q,ie){var ye=L==null?0:L.length;return ye?(q=ie||q===u?1:hr(q),Bn(L,q<0?0:q,ye)):[]}function si(L,q,ie){var ye=L==null?0:L.length;return ye?(q=ie||q===u?1:hr(q),q=ye-q,Bn(L,0,q<0?0:q)):[]}function hs(L,q){return L&&L.length?Bs(L,tr(q,3),!0,!0):[]}function dn(L,q){return L&&L.length?Bs(L,tr(q,3),!0):[]}function Zs(L,q,ie,ye){var Ee=L==null?0:L.length;return Ee?(ie&&typeof ie!="number"&&Vn(L,q,ie)&&(ie=0,ye=Ee),af(L,q,ie,ye)):[]}function Jo(L,q,ie){var ye=L==null?0:L.length;if(!ye)return-1;var Ee=ie==null?0:hr(ie);return Ee<0&&(Ee=an(ye+Ee,0)),au(L,tr(q,3),Ee)}function Ys(L,q,ie){var ye=L==null?0:L.length;if(!ye)return-1;var Ee=ye-1;return ie!==u&&(Ee=hr(ie),Ee=ie<0?an(ye+Ee,0):Cn(Ee,ye-1)),au(L,tr(q,3),Ee,!0)}function Qu(L){var q=L==null?0:L.length;return q?Jr(L,1):[]}function Xs(L){var q=L==null?0:L.length;return q?Jr(L,P):[]}function Jn(L,q){var ie=L==null?0:L.length;return ie?(q=q===u?1:hr(q),Jr(L,q)):[]}function mc(L){for(var q=-1,ie=L==null?0:L.length,ye={};++q<ie;){var Ee=L[q];ye[Ee[0]]=Ee[1]}return ye}function Ta(L){return L&&L.length?L[0]:u}function Ro(L,q,ie){var ye=L==null?0:L.length;if(!ye)return-1;var Ee=ie==null?0:hr(ie);return Ee<0&&(Ee=an(ye+Ee,0)),qa(L,q,Ee)}function el(L){var q=L==null?0:L.length;return q?Bn(L,0,-1):[]}var gc=dr(function(L){var q=jr(L,as);return q.length&&q[0]===L[0]?Pu(q):[]}),Qo=dr(function(L){var q=Hn(L),ie=jr(L,as);return q===Hn(ie)?q=u:ie.pop(),ie.length&&ie[0]===L[0]?Pu(ie,tr(q,2)):[]}),tl=dr(function(L){var q=Hn(L),ie=jr(L,as);return q=typeof q=="function"?q:u,q&&ie.pop(),ie.length&&ie[0]===L[0]?Pu(ie,u,q):[]});function ea(L,q){return L==null?"":vu.call(L,q)}function Hn(L){var q=L==null?0:L.length;return q?L[q-1]:u}function Js(L,q,ie){var ye=L==null?0:L.length;if(!ye)return-1;var Ee=ye;return ie!==u&&(Ee=hr(ie),Ee=Ee<0?an(ye+Ee,0):Cn(Ee,ye-1)),q===q?Jf(L,q,Ee):au(L,Oc,Ee,!0)}function vc(L,q){return L&&L.length?Ou(L,hr(q)):u}var rl=dr(Qs);function Qs(L,q){return L&&L.length&&q&&q.length?Qr(L,q):L}function Kn(L,q,ie){return L&&L.length&&q&&q.length?Qr(L,q,tr(ie,2)):L}function ta(L,q,ie){return L&&L.length&&q&&q.length?Qr(L,q,u,ie):L}var Bi=ao(function(L,q){var ie=L==null?0:L.length,ye=Tu(L,q);return fn(L,jr(q,function(Ee){return Wr(Ee,ie)?+Ee:Ee}).sort(Yl)),ye});function Qn(L,q){var ie=[];if(!(L&&L.length))return ie;var ye=-1,Ee=[],ke=L.length;for(q=tr(q,3);++ye<ke;){var Fe=L[ye];q(Fe,ye,L)&&(ie.push(Fe),Ee.push(ye))}return fn(L,Ee),ie}function nl(L){return L==null?L:yu.call(L)}function yc(L,q,ie){var ye=L==null?0:L.length;return ye?(ie&&typeof ie!="number"&&Vn(L,q,ie)?(q=0,ie=ye):(q=q==null?0:hr(q),ie=ie===u?ye:hr(ie)),Bn(L,q,ie)):[]}function bc(L,q){return is(L,q)}function ld(L,q,ie){return Nu(L,q,tr(ie,2))}function ra(L,q){var ie=L==null?0:L.length;if(ie){var ye=is(L,q);if(ye<ie&&Mo(L[ye],q))return ye}return-1}function Mf(L,q){return is(L,q,!0)}function wc(L,q,ie){return Nu(L,q,tr(ie,2),!0)}function Ra(L,q){var ie=L==null?0:L.length;if(ie){var ye=is(L,q,!0)-1;if(Mo(L[ye],q))return ye}return-1}function xc(L){return L&&L.length?Hl(L):[]}function Ma(L,q){return L&&L.length?Hl(L,tr(q,2)):[]}function Pf(L){var q=L==null?0:L.length;return q?Bn(L,1,q):[]}function kf(L,q,ie){return L&&L.length?(q=ie||q===u?1:hr(q),Bn(L,0,q<0?0:q)):[]}function Ec(L,q,ie){var ye=L==null?0:L.length;return ye?(q=ie||q===u?1:hr(q),q=ye-q,Bn(L,q<0?0:q,ye)):[]}function il(L,q){return L&&L.length?Bs(L,tr(q,3),!1,!0):[]}function cd(L,q){return L&&L.length?Bs(L,tr(q,3)):[]}var fd=dr(function(L){return Eo(Jr(L,1,hn,!0))}),Cf=dr(function(L){var q=Hn(L);return hn(q)&&(q=u),Eo(Jr(L,1,hn,!0),tr(q,2))}),If=dr(function(L){var q=Hn(L);return q=typeof q=="function"?q:u,Eo(Jr(L,1,hn,!0),u,q)});function Pa(L){return L&&L.length?Eo(L):[]}function dd(L,q){return L&&L.length?Eo(L,tr(q,2)):[]}function ps(L,q){return q=typeof q=="function"?q:u,L&&L.length?Eo(L,u,q):[]}function ol(L){if(!(L&&L.length))return[];var q=0;return L=Bo(L,function(ie){if(hn(ie))return q=an(ie.length,q),!0}),Al(q,function(ie){return jr(L,El(ie))})}function Xr(L,q){if(!(L&&L.length))return[];var ie=ol(L);return q==null?ie:jr(ie,function(ye){return Fn(q,u,ye)})}var hd=dr(function(L,q){return hn(L)?eo(L,q):[]}),Of=dr(function(L){return Bu(Bo(L,hn))}),pd=dr(function(L){var q=Hn(L);return hn(q)&&(q=u),Bu(Bo(L,hn),tr(q,2))}),md=dr(function(L){var q=Hn(L);return q=typeof q=="function"?q:u,Bu(Bo(L,hn),u,q)}),$f=dr(ol);function Nf(L,q){return Ds(L||[],q||[],va)}function gd(L,q){return Ds(L||[],q||[],Ea)}var wi=dr(function(L){var q=L.length,ie=q>1?L[q-1]:u;return ie=typeof ie=="function"?(L.pop(),ie):u,Xr(L,ie)});function al(L){var q=Me(L);return q.__chain__=!0,q}function vd(L,q){return q(L),L}function Di(L,q){return q(L)}var sl=ao(function(L){var q=L.length,ie=q?L[0]:0,ye=this.__wrapped__,Ee=function(ke){return Tu(ke,L)};return q>1||this.__actions__.length||!(ye instanceof lr)||!Wr(ie)?this.thru(Ee):(ye=ye.slice(ie,+ie+(q?1:0)),ye.__actions__.push({func:Di,args:[Ee],thisArg:u}),new In(ye,this.__chain__).thru(function(ke){return q&&!ke.length&&ke.push(u),ke}))});function ka(){return al(this)}function ul(){return new In(this.value(),this.__chain__)}function Sc(){this.__values__===u&&(this.__values__=jd(this.value()));var L=this.__index__>=this.__values__.length,q=L?u:this.__values__[this.__index__++];return{done:L,value:q}}function Ac(){return this}function yd(L){for(var q,ie=this;ie instanceof Yi;){var ye=Rf(ie);ye.__index__=0,ye.__values__=u,q?Ee.__wrapped__=ye:q=ye;var Ee=ye;ie=ie.__wrapped__}return Ee.__wrapped__=L,q}function Tc(){var L=this.__wrapped__;if(L instanceof lr){var q=L;return this.__actions__.length&&(q=new lr(this)),q=q.reverse(),q.__actions__.push({func:Di,args:[nl],thisArg:u}),new In(q,this.__chain__)}return this.thru(nl)}function bd(){return os(this.__wrapped__,this.__actions__)}var Lf=Fu(function(L,q,ie){Br.call(L,ie)?++L[ie]:Qi(L,ie,1)});function Bf(L,q,ie){var ye=cr(L)?yl:Cs;return ie&&Vn(L,q,ie)&&(q=u),ye(L,tr(q,3))}function ll(L,q){var ie=cr(L)?Bo:Ll;return ie(L,tr(q,3))}var cl=Aa(Jo),Df=Aa(Ys);function Rc(L,q){return Jr(Ca(L,q),1)}function wd(L,q){return Jr(Ca(L,q),P)}function qf(L,q,ie){return ie=ie===u?1:hr(ie),Jr(Ca(L,q),ie)}function fl(L,q){var ie=cr(L)?kn:to;return ie(L,tr(q,3))}function eu(L,q){var ie=cr(L)?iu:nf;return ie(L,tr(q,3))}var Mc=Fu(function(L,q,ie){Br.call(L,ie)?L[ie].push(q):Qi(L,ie,[q])});function dl(L,q,ie,ye){L=xi(L)?L:ml(L),ie=ie&&!ye?hr(ie):0;var Ee=L.length;return ie<0&&(ie=an(Ee+ie,0)),jf(L)?ie<=Ee&&L.indexOf(q,ie)>-1:!!Ee&&qa(L,q,ie)>-1}var Ff=dr(function(L,q,ie){var ye=-1,Ee=typeof q=="function",ke=xi(L)?pt(L.length):[];return to(L,function(Fe){ke[++ye]=Ee?Fn(q,Fe,ie):gi(Fe,q,ie)}),ke}),xd=Fu(function(L,q,ie){Qi(L,ie,q)});function Ca(L,q){var ie=cr(L)?jr:Fl;return ie(L,tr(q,3))}function Ed(L,q,ie,ye){return L==null?[]:(cr(q)||(q=q==null?[]:[q]),ie=ye?u:ie,cr(ie)||(ie=ie==null?[]:[ie]),Ns(L,q,ie))}var tu=Fu(function(L,q,ie){L[ie?0:1].push(q)},function(){return[[],[]]});function Sd(L,q,ie){var ye=cr(L)?_l:Nc,Ee=arguments.length<3;return ye(L,tr(q,4),ie,Ee,to)}function hl(L,q,ie){var ye=cr(L)?Vf:Nc,Ee=arguments.length<3;return ye(L,tr(q,4),ie,Ee,nf)}function A(L,q){var ie=cr(L)?Bo:Ll;return ie(L,kt(tr(q,3)))}function C(L){var q=cr(L)?Ji:Ln;return q(L)}function F(L,q,ie){(ie?Vn(L,q,ie):q===u)?q=1:q=hr(q);var ye=cr(L)?ga:zl;return ye(L,q)}function ne(L){var q=cr(L)?tf:yi;return q(L)}function fe(L){if(L==null)return 0;if(xi(L))return jf(L)?ca(L):L.length;var q=En(L);return q==Ne||q==Oe?L.size:xo(L).length}function ve(L,q,ie){var ye=cr(L)?wl:Vl;return ie&&Vn(L,q,ie)&&(q=u),ye(L,tr(q,3))}var Ae=dr(function(L,q){if(L==null)return[];var ie=q.length;return ie>1&&Vn(L,q[0],q[1])?q=[]:ie>2&&Vn(q[0],q[1],q[2])&&(q=[q[0]]),Ns(L,Jr(q,1),[])}),Be=Vr||function(){return Ct.Date.now()};function Ve(L,q){if(typeof q!="function")throw new fi(h);return L=hr(L),function(){if(--L<1)return q.apply(this,arguments)}}function gt(L,q,ie){return q=ie?u:q,q=L&&q==null?L.length:q,oo(L,Z,u,u,u,u,q)}function Tt(L,q){var ie;if(typeof q!="function")throw new fi(h);return L=hr(L),function(){return--L>0&&(ie=q.apply(this,arguments)),L<=1&&(q=u),ie}}var Pt=dr(function(L,q,ie){var ye=B;if(ie.length){var Ee=ci(ie,Ao(Pt));ye|=U}return oo(L,ye,q,ie,Ee)}),At=dr(function(L,q,ie){var ye=B|N;if(ie.length){var Ee=ci(ie,Ao(At));ye|=U}return oo(q,ye,L,ie,Ee)});function Nt(L,q,ie){q=ie?u:q;var ye=oo(L,G,u,u,u,u,u,q);return ye.placeholder=Nt.placeholder,ye}function Dt(L,q,ie){q=ie?u:q;var ye=oo(L,V,u,u,u,u,u,q);return ye.placeholder=Dt.placeholder,ye}function jt(L,q,ie){var ye,Ee,ke,Fe,He,Ye,xt=0,Et=!1,Rt=!1,Ot=!0;if(typeof L!="function")throw new fi(h);q=uo(q)||0,tn(ie)&&(Et=!!ie.leading,Rt="maxWait"in ie,ke=Rt?an(uo(ie.maxWait)||0,q):ke,Ot="trailing"in ie?!!ie.trailing:Ot);function Wt(pn){var Po=ye,$a=Ee;return ye=Ee=u,xt=pn,Fe=L.apply($a,Po),Fe}function nr(pn){return xt=pn,He=ds(Sr,q),Et?Wt(pn):Fe}function vr(pn){var Po=pn-Ye,$a=pn-xt,th=q-Po;return Rt?Cn(th,ke-$a):th}function ir(pn){var Po=pn-Ye,$a=pn-xt;return Ye===u||Po>=q||Po<0||Rt&&$a>=ke}function Sr(){var pn=Be();if(ir(pn))return Nr(pn);He=ds(Sr,vr(pn))}function Nr(pn){return He=u,Ot&&ye?Wt(pn):(ye=Ee=u,Fe)}function Fi(){He!==u&&Wl(He),xt=0,ye=Ye=Ee=He=u}function ui(){return He===u?Fe:Nr(Be())}function Ui(){var pn=Be(),Po=ir(pn);if(ye=arguments,Ee=this,Ye=pn,Po){if(He===u)return nr(Ye);if(Rt)return Wl(He),He=ds(Sr,q),Wt(Ye)}return He===u&&(He=ds(Sr,q)),Fe}return Ui.cancel=Fi,Ui.flush=ui,Ui}var en=dr(function(L,q){return Nl(L,1,q)}),ot=dr(function(L,q,ie){return Nl(L,uo(q)||0,ie)});function Ge(L){return oo(L,Q)}function lt(L,q){if(typeof L!="function"||q!=null&&typeof q!="function")throw new fi(h);var ie=function(){var ye=arguments,Ee=q?q.apply(this,ye):ye[0],ke=ie.cache;if(ke.has(Ee))return ke.get(Ee);var Fe=L.apply(this,ye);return ie.cache=ke.set(Ee,Fe)||ke,Fe};return ie.cache=new(lt.Cache||di),ie}lt.Cache=di;function kt(L){if(typeof L!="function")throw new fi(h);return function(){var q=arguments;switch(q.length){case 0:return!L.call(this);case 1:return!L.call(this,q[0]);case 2:return!L.call(this,q[0],q[1]);case 3:return!L.call(this,q[0],q[1],q[2])}return!L.apply(this,q)}}function Gt(L){return Tt(2,L)}var Qt=lf(function(L,q){q=q.length==1&&cr(q[0])?jr(q[0],ti(tr())):jr(Jr(q,1),ti(tr()));var ie=q.length;return dr(function(ye){for(var Ee=-1,ke=Cn(ye.length,ie);++Ee<ke;)ye[Ee]=q[Ee].call(this,ye[Ee]);return Fn(L,this,ye)})}),Yt=dr(function(L,q){var ie=ci(q,Ao(Yt));return oo(L,U,u,q,ie)}),rr=dr(function(L,q){var ie=ci(q,Ao(rr));return oo(L,te,u,q,ie)}),_n=ao(function(L,q){return oo(L,J,u,u,u,q)});function Dr(L,q){if(typeof L!="function")throw new fi(h);return q=q===u?q:hr(q),dr(L,q)}function na(L,q){if(typeof L!="function")throw new fi(h);return q=q==null?0:an(hr(q),0),dr(function(ie){var ye=ie[q],Ee=So(ie,0,q);return ye&&Do(Ee,ye),Fn(L,this,Ee)})}function Ad(L,q,ie){var ye=!0,Ee=!0;if(typeof L!="function")throw new fi(h);return tn(ie)&&(ye="leading"in ie?!!ie.leading:ye,Ee="trailing"in ie?!!ie.trailing:Ee),jt(L,q,{leading:ye,maxWait:q,trailing:Ee})}function rh(L){return gt(L,1)}function nh(L,q){return Yt(Du(q),L)}function ih(){if(!arguments.length)return[];var L=arguments[0];return cr(L)?L:[L]}function oh(L){return Yn(L,R)}function ah(L,q){return q=typeof q=="function"?q:u,Yn(L,R,q)}function sh(L){return Yn(L,S|R)}function uh(L,q){return q=typeof q=="function"?q:u,Yn(L,S|R,q)}function lh(L,q){return q==null||ks(L,q,Dn(q))}function Mo(L,q){return L===q||L!==L&&q!==q}var ch=Hu(Go),fh=Hu(function(L,q){return L>=q}),ru=ku(function(){return arguments}())?ku:function(L){return un(L)&&Br.call(L,"callee")&&!pu.call(L,"callee")},cr=pt.isArray,hh=Pi?ti(Pi):sf;function xi(L){return L!=null&&Uf(L.length)&&!Ia(L)}function hn(L){return un(L)&&xi(L)}function ph(L){return L===!0||L===!1||un(L)&&wn(L)==de}var ms=Cl||Ld,mh=rn?ti(rn):wo;function gh(L){return un(L)&&L.nodeType===1&&!Pc(L)}function yh(L){if(L==null)return!0;if(xi(L)&&(cr(L)||typeof L=="string"||typeof L.splice=="function"||ms(L)||pl(L)||ru(L)))return!L.length;var q=En(L);if(q==Ne||q==Oe)return!L.size;if(To(L))return!xo(L).length;for(var ie in L)if(Br.call(L,ie))return!1;return!0}function bh(L,q){return vi(L,q)}function wh(L,q,ie){ie=typeof ie=="function"?ie:u;var ye=ie?ie(L,q):u;return ye===u?vi(L,q,u,ie):!!ye}function Td(L){if(!un(L))return!1;var q=wn(L);return q==le||q==oe||typeof L.message=="string"&&typeof L.name=="string"&&!Pc(L)}function xh(L){return typeof L=="number"&&Ha(L)}function Ia(L){if(!tn(L))return!1;var q=wn(L);return q==me||q==xe||q==ae||q==Ce}function Dd(L){return typeof L=="number"&&L==hr(L)}function Uf(L){return typeof L=="number"&&L>-1&&L%1==0&&L<=$}function tn(L){var q=typeof L;return L!=null&&(q=="object"||q=="function")}function un(L){return L!=null&&typeof L=="object"}var qd=la?ti(la):uf;function Eh(L,q){return L===q||ts(L,q,Hs(q))}function Sh(L,q,ie){return ie=typeof ie=="function"?ie:u,ts(L,q,Hs(q),ie)}function Ah(L){return Fd(L)&&L!=+L}function Th(L){if(ud(L))throw new or(c);return Dl(L)}function Rh(L){return L===null}function Mh(L){return L==null}function Fd(L){return typeof L=="number"||un(L)&&wn(L)==Pe}function Pc(L){if(!un(L)||wn(L)!=Ke)return!1;var q=ki(L);if(q===null)return!0;var ie=Br.call(q,"constructor")&&q.constructor;return typeof ie=="function"&&ie instanceof ie&&_s.call(ie)==du}var Rd=nu?ti(nu):Os;function Ph(L){return Dd(L)&&L>=-$&&L<=$}var Ud=Da?ti(Da):ro;function jf(L){return typeof L=="string"||!cr(L)&&un(L)&&wn(L)==De}function qi(L){return typeof L=="symbol"||un(L)&&wn(L)==yt}var pl=kc?ti(kc):$s;function kh(L){return L===u}function Ch(L){return un(L)&&En(L)==ze}function Ih(L){return un(L)&&wn(L)==Mt}var Oh=Hu(Wo),$h=Hu(function(L,q){return L<=q});function jd(L){if(!L)return[];if(xi(L))return jf(L)?ri(L):jn(L);if(go&&L[go])return Yf(L[go]());var q=En(L),ie=q==Ne?uu:q==Oe?qo:ml;return ie(L)}function Oa(L){if(!L)return L===0?L:0;if(L=uo(L),L===P||L===-P){var q=L<0?-1:1;return q*T}return L===L?L:0}function hr(L){var q=Oa(L),ie=q%1;return q===q?ie?q-ie:q:0}function zd(L){return L?yo(hr(L),0,M):0}function uo(L){if(typeof L=="number")return L;if(qi(L))return m;if(tn(L)){var q=typeof L.valueOf=="function"?L.valueOf():L;L=tn(q)?q+"":q}if(typeof L!="string")return L===0?L:+L;L=Lc(L);var ie=kr.test(L);return ie||Tr.test(L)?It(L.slice(2),ie?2:8):er.test(L)?m:+L}function Vd(L){return Ii(L,Ei(L))}function Nh(L){return L?yo(hr(L),-$,$):L===0?L:0}function Ur(L){return L==null?"":Xn(L)}var Lh=ss(function(L,q){if(To(q)||xi(q)){Ii(q,Dn(q),L);return}for(var ie in q)Br.call(q,ie)&&va(L,ie,q[ie])}),Hd=ss(function(L,q){Ii(q,Ei(q),L)}),zf=ss(function(L,q,ie,ye){Ii(q,Ei(q),L,ye)}),Bh=ss(function(L,q,ie,ye){Ii(q,Dn(q),L,ye)}),Dh=ao(Tu);function qh(L,q){var ie=Ya(L);return q==null?ie:Kr(ie,q)}var Fh=dr(function(L,q){L=Fr(L);var ie=-1,ye=q.length,Ee=ye>2?q[2]:u;for(Ee&&Vn(q[0],q[1],Ee)&&(ye=1);++ie<ye;)for(var ke=q[ie],Fe=Ei(ke),He=-1,Ye=Fe.length;++He<Ye;){var xt=Fe[He],Et=L[xt];(Et===u||Mo(Et,Wi[xt])&&!Br.call(L,xt))&&(L[xt]=ke[xt])}return L}),Uh=dr(function(L){return L.push(u,ic),Fn(Kd,u,L)});function jh(L,q){return Ic(L,tr(q,3),oi)}function zh(L,q){return Ic(L,tr(q,3),Ko)}function Vh(L,q){return L==null?L:Ru(L,tr(q,3),Ei)}function Hh(L,q){return L==null?L:Is(L,tr(q,3),Ei)}function Kh(L,q){return L&&oi(L,tr(q,3))}function Gh(L,q){return L&&Ko(L,tr(q,3))}function Wh(L){return L==null?[]:es(L,Dn(L))}function Zh(L){return L==null?[]:es(L,Ei(L))}function Md(L,q,ie){var ye=L==null?u:bo(L,q);return ye===u?ie:ye}function Yh(L,q){return L!=null&&lc(L,q,mi)}function Pd(L,q){return L!=null&&lc(L,q,ba)}var Xh=mf(function(L,q,ie){q!=null&&typeof q.toString!="function"&&(q=ws.call(q)),L[q]=ie},Cd(Si)),Jh=mf(function(L,q,ie){q!=null&&typeof q.toString!="function"&&(q=ws.call(q)),Br.call(L,q)?L[q].push(ie):L[q]=[ie]},tr),Qh=dr(gi);function Dn(L){return xi(L)?Xi(L):xo(L)}function Ei(L){return xi(L)?Xi(L,!0):ql(L)}function ep(L,q){var ie={};return q=tr(q,3),oi(L,function(ye,Ee,ke){Qi(ie,q(ye,Ee,ke),ye)}),ie}function tp(L,q){var ie={};return q=tr(q,3),oi(L,function(ye,Ee,ke){Qi(ie,Ee,q(ye,Ee,ke))}),ie}var rp=ss(function(L,q,ie){wa(L,q,ie)}),Kd=ss(function(L,q,ie,ye){wa(L,q,ie,ye)}),np=ao(function(L,q){var ie={};if(L==null)return ie;var ye=!1;q=jr(q,function(ke){return ke=io(ke,L),ye||(ye=ke.length>1),ke}),Ii(L,zs(L),ie),ye&&(ie=Yn(ie,S|E|R,oc));for(var Ee=q.length;Ee--;)Lu(ie,q[Ee]);return ie});function ip(L,q){return Gd(L,kt(tr(q)))}var op=ao(function(L,q){return L==null?{}:jl(L,q)});function Gd(L,q){if(L==null)return{};var ie=jr(zs(L),function(ye){return[ye]});return q=tr(q),Zo(L,ie,function(ye,Ee){return q(ye,Ee[0])})}function ap(L,q,ie){q=io(q,L);var ye=-1,Ee=q.length;for(Ee||(Ee=1,L=u);++ye<Ee;){var ke=L==null?u:L[Li(q[ye])];ke===u&&(ye=Ee,ke=ie),L=Ia(ke)?ke.call(L):ke}return L}function sp(L,q,ie){return L==null?L:Ea(L,q,ie)}function up(L,q,ie,ye){return ye=typeof ye=="function"?ye:u,L==null?L:Ea(L,q,ie,ye)}var Wd=rc(Dn),Zd=rc(Ei);function lp(L,q,ie){var ye=cr(L),Ee=ye||ms(L)||pl(L);if(q=tr(q,4),ie==null){var ke=L&&L.constructor;Ee?ie=ye?new ke:[]:tn(L)?ie=Ia(ke)?Ya(ki(L)):{}:ie={}}return(Ee?kn:oi)(L,function(Fe,He,Ye){return q(ie,Fe,He,Ye)}),ie}function cp(L,q){return L==null?!0:Lu(L,q)}function fp(L,q,ie){return L==null?L:Gl(L,q,Du(ie))}function dp(L,q,ie,ye){return ye=typeof ye=="function"?ye:u,L==null?L:Gl(L,q,Du(ie),ye)}function ml(L){return L==null?[]:ys(L,Dn(L))}function hp(L){return L==null?[]:ys(L,Ei(L))}function pp(L,q,ie){return ie===u&&(ie=q,q=u),ie!==u&&(ie=uo(ie),ie=ie===ie?ie:0),q!==u&&(q=uo(q),q=q===q?q:0),yo(uo(L),q,ie)}function mp(L,q,ie){return q=Oa(q),ie===u?(ie=q,q=0):ie=Oa(ie),L=uo(L),Bl(L,q,ie)}function gp(L,q,ie){if(ie&&typeof ie!="boolean"&&Vn(L,q,ie)&&(q=ie=u),ie===u&&(typeof q=="boolean"?(ie=q,q=u):typeof L=="boolean"&&(ie=L,L=u)),L===u&&q===u?(L=0,q=1):(L=Oa(L),q===u?(q=L,L=0):q=Oa(q)),L>q){var ye=L;L=q,q=ye}if(ie||L%1||q%1){var Ee=As();return Cn(L+Ee*(q-L+_t("1e-"+((Ee+"").length-1))),q)}return ns(L,q)}var vp=Sa(function(L,q,ie){return q=q.toLowerCase(),L+(ie?Yd(q):q)});function Yd(L){return kd(Ur(L).toLowerCase())}function Xd(L){return L=Ur(L),L&&L.replace(pr,qc).replace(mn,"")}function yp(L,q,ie){L=Ur(L),q=Xn(q);var ye=L.length;ie=ie===u?ye:yo(hr(ie),0,ye);var Ee=ie;return ie-=q.length,ie>=0&&L.slice(ie,Ee)==q}function bp(L){return L=Ur(L),L&&Vt.test(L)?L.replace(st,Fc):L}function _p(L){return L=Ur(L),L&&ct.test(L)?L.replace(Xe,"\\$&"):L}var wp=Sa(function(L,q,ie){return L+(ie?"-":"")+q.toLowerCase()}),xp=Sa(function(L,q,ie){return L+(ie?" ":"")+q.toLowerCase()}),Ep=Jl("toLowerCase");function Sp(L,q,ie){L=Ur(L),q=hr(q);var ye=q?ca(L):0;if(!q||ye>=q)return L;var Ee=(q-ye)/2;return Us(Fo(Ee),ie)+L+Us(da(Ee),ie)}function Ap(L,q,ie){L=Ur(L),q=hr(q);var ye=q?ca(L):0;return q&&ye<q?L+Us(q-ye,ie):L}function Tp(L,q,ie){L=Ur(L),q=hr(q);var ye=q?ca(L):0;return q&&ye<q?Us(q-ye,ie)+L:L}function Rp(L,q,ie){return ie||q==null?q=0:q&&(q=+q),Zc(Ur(L).replace(Ut,""),q||0)}function Mp(L,q,ie){return(ie?Vn(L,q,ie):q===u)?q=1:q=hr(q),xa(Ur(L),q)}function Pp(){var L=arguments,q=Ur(L[0]);return L.length<3?q:q.replace(L[1],L[2])}var kp=Sa(function(L,q,ie){return L+(ie?"_":"")+q.toLowerCase()});function Cp(L,q,ie){return ie&&typeof ie!="number"&&Vn(L,q,ie)&&(q=ie=u),ie=ie===u?M:ie>>>0,ie?(L=Ur(L),L&&(typeof q=="string"||q!=null&&!Rd(q))&&(q=Xn(q),!q&&Ua(L))?So(ri(L),0,ie):L.split(q,ie)):[]}var Ip=Sa(function(L,q,ie){return L+(ie?" ":"")+kd(q)});function Op(L,q,ie){return L=Ur(L),ie=ie==null?0:yo(hr(ie),0,L.length),q=Xn(q),L.slice(ie,ie+q.length)==q}function $p(L,q,ie){var ye=Me.templateSettings;ie&&Vn(L,q,ie)&&(q=u),L=Ur(L),q=zf({},q,ye,nc);var Ee=zf({},q.imports,ye.imports,nc),ke=Dn(Ee),Fe=ys(Ee,ke),He,Ye,xt=0,Et=q.interpolate||_r,Rt="__p += '",Ot=bs((q.escape||_r).source+"|"+Et.source+"|"+(Et===Ft?mt:_r).source+"|"+(q.evaluate||_r).source+"|$","g"),Wt="//# sourceURL="+(Br.call(q,"sourceURL")?(q.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++vs+"]")+`
`;L.replace(Ot,function(ir,Sr,Nr,Fi,ui,Ui){return Nr||(Nr=Fi),Rt+=L.slice(xt,Ui).replace(fr,Uc),Sr&&(He=!0,Rt+=`' +
__e(`+Sr+`) +
'`),ui&&(Ye=!0,Rt+=`';
`+ui+`;
__p += '`),Nr&&(Rt+=`' +
((__t = (`+Nr+`)) == null ? '' : __t) +
'`),xt=Ui+ir.length,ir}),Rt+=`';
`;var nr=Br.call(q,"variable")&&q.variable;if(!nr)Rt=`with (obj) {
`+Rt+`
}
`;else if(ar.test(nr))throw new or(p);Rt=(Ye?Rt.replace(St,""):Rt).replace(ut,"$1").replace(vt,"$1;"),Rt="function("+(nr||"obj")+`) {
`+(nr?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(He?", __e = _.escape":"")+(Ye?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+Rt+`return __p
}`;var vr=Qd(function(){return Lr(ke,Wt+"return "+Rt).apply(u,Fe)});if(vr.source=Rt,Td(vr))throw vr;return vr}function Np(L){return Ur(L).toLowerCase()}function Lp(L){return Ur(L).toUpperCase()}function Bp(L,q,ie){if(L=Ur(L),L&&(ie||q===u))return Lc(L);if(!L||!(q=Xn(q)))return L;var ye=ri(L),Ee=ri(q),ke=Bc(ye,Ee),Fe=Tl(ye,Ee)+1;return So(ye,ke,Fe).join("")}function Dp(L,q,ie){if(L=Ur(L),L&&(ie||q===u))return L.slice(0,cu(L)+1);if(!L||!(q=Xn(q)))return L;var ye=ri(L),Ee=Tl(ye,ri(q))+1;return So(ye,0,Ee).join("")}function qp(L,q,ie){if(L=Ur(L),L&&(ie||q===u))return L.replace(Ut,"");if(!L||!(q=Xn(q)))return L;var ye=ri(L),Ee=Bc(ye,ri(q));return So(ye,Ee).join("")}function Fp(L,q){var ie=ee,ye=k;if(tn(q)){var Ee="separator"in q?q.separator:Ee;ie="length"in q?hr(q.length):ie,ye="omission"in q?Xn(q.omission):ye}L=Ur(L);var ke=L.length;if(Ua(L)){var Fe=ri(L);ke=Fe.length}if(ie>=ke)return L;var He=ie-ca(ye);if(He<1)return ye;var Ye=Fe?So(Fe,0,He).join(""):L.slice(0,He);if(Ee===u)return Ye+ye;if(Fe&&(He+=Ye.length-He),Rd(Ee)){if(L.slice(He).search(Ee)){var xt,Et=Ye;for(Ee.global||(Ee=bs(Ee.source,Ur(Xt.exec(Ee))+"g")),Ee.lastIndex=0;xt=Ee.exec(Et);)var Rt=xt.index;Ye=Ye.slice(0,Rt===u?He:Rt)}}else if(L.indexOf(Xn(Ee),He)!=He){var Ot=Ye.lastIndexOf(Ee);Ot>-1&&(Ye=Ye.slice(0,Ot))}return Ye+ye}function Up(L){return L=Ur(L),L&&nt.test(L)?L.replace(zt,jc):L}var jp=Sa(function(L,q,ie){return L+(ie?" ":"")+q.toUpperCase()}),kd=Jl("toUpperCase");function Jd(L,q,ie){return L=Ur(L),q=ie?u:q,q===u?Zf(L)?Qf(L):Kf(L):L.match(q)||[]}var Qd=dr(function(L,q){try{return Fn(L,u,q)}catch(ie){return Td(ie)?ie:new or(ie)}}),zp=ao(function(L,q){return kn(q,function(ie){ie=Li(ie),Qi(L,ie,Pt(L[ie],L))}),L});function Vp(L){var q=L==null?0:L.length,ie=tr();return L=q?jr(L,function(ye){if(typeof ye[1]!="function")throw new fi(h);return[ie(ye[0]),ye[1]]}):[],dr(function(ye){for(var Ee=-1;++Ee<q;){var ke=L[Ee];if(Fn(ke[0],this,ye))return Fn(ke[1],this,ye)}})}function Hp(L){return rf(Yn(L,S))}function Cd(L){return function(){return L}}function Kp(L,q){return L==null||L!==L?q:L}var Gp=zu(),Wp=zu(!0);function Si(L){return L}function Id(L){return rs(typeof L=="function"?L:Yn(L,S))}function Zp(L){return Iu(Yn(L,S))}function Yp(L,q){return Gr(L,Yn(q,S))}var Xp=dr(function(L,q){return function(ie){return gi(ie,L,q)}}),Jp=dr(function(L,q){return function(ie){return gi(L,ie,q)}});function Od(L,q,ie){var ye=Dn(q),Ee=es(q,ye);ie==null&&!(tn(q)&&(Ee.length||!ye.length))&&(ie=q,q=L,L=this,Ee=es(q,Dn(q)));var ke=!(tn(ie)&&"chain"in ie)||!!ie.chain,Fe=Ia(L);return kn(Ee,function(He){var Ye=q[He];L[He]=Ye,Fe&&(L.prototype[He]=function(){var xt=this.__chain__;if(ke||xt){var Et=L(this.__wrapped__),Rt=Et.__actions__=jn(this.__actions__);return Rt.push({func:Ye,args:arguments,thisArg:L}),Et.__chain__=xt,Et}return Ye.apply(L,Do([this.value()],arguments))})}),L}function Qp(){return Ct._===this&&(Ct._=Hc),this}function $d(){}function e0(L){return L=hr(L),dr(function(q){return Ou(q,L)})}var t0=Vu(jr),r0=Vu(yl),n0=Vu(wl);function eh(L){return Lt(L)?El(Li(L)):Yr(L)}function i0(L){return function(q){return L==null?u:bo(L,q)}}var o0=tc(),a0=tc(!0);function Nd(){return[]}function Ld(){return!1}function s0(){return{}}function u0(){return""}function l0(){return!0}function c0(L,q){if(L=hr(L),L<1||L>$)return[];var ie=M,ye=Cn(L,M);q=tr(q),L-=M;for(var Ee=Al(ye,q);++ie<L;)q(ie);return Ee}function f0(L){return cr(L)?jr(L,Li):qi(L)?[L]:jn(hc(Ur(L)))}function d0(L){var q=++Va;return Ur(L)+q}var h0=Fs(function(L,q){return L+q},0),p0=xn("ceil"),m0=Fs(function(L,q){return L/q},1),g0=xn("floor");function v0(L){return L&&L.length?ya(L,Si,Go):u}function y0(L,q){return L&&L.length?ya(L,tr(q,2),Go):u}function b0(L){return $c(L,Si)}function _0(L,q){return $c(L,tr(q,2))}function w0(L){return L&&L.length?ya(L,Si,Wo):u}function x0(L,q){return L&&L.length?ya(L,tr(q,2),Wo):u}var E0=Fs(function(L,q){return L*q},1),S0=xn("round"),A0=Fs(function(L,q){return L-q},0);function T0(L){return L&&L.length?Sl(L,Si):0}function R0(L,q){return L&&L.length?Sl(L,tr(q,2)):0}return Me.after=Ve,Me.ary=gt,Me.assign=Lh,Me.assignIn=Hd,Me.assignInWith=zf,Me.assignWith=Bh,Me.at=Dh,Me.before=Tt,Me.bind=Pt,Me.bindAll=zp,Me.bindKey=At,Me.castArray=ih,Me.chain=al,Me.chunk=Ju,Me.compact=pc,Me.concat=_i,Me.cond=Vp,Me.conforms=Hp,Me.constant=Cd,Me.countBy=Lf,Me.create=qh,Me.curry=Nt,Me.curryRight=Dt,Me.debounce=jt,Me.defaults=Fh,Me.defaultsDeep=Uh,Me.defer=en,Me.delay=ot,Me.difference=$r,Me.differenceBy=yn,Me.differenceWith=sn,Me.drop=An,Me.dropRight=si,Me.dropRightWhile=hs,Me.dropWhile=dn,Me.fill=Zs,Me.filter=ll,Me.flatMap=Rc,Me.flatMapDeep=wd,Me.flatMapDepth=qf,Me.flatten=Qu,Me.flattenDeep=Xs,Me.flattenDepth=Jn,Me.flip=Ge,Me.flow=Gp,Me.flowRight=Wp,Me.fromPairs=mc,Me.functions=Wh,Me.functionsIn=Zh,Me.groupBy=Mc,Me.initial=el,Me.intersection=gc,Me.intersectionBy=Qo,Me.intersectionWith=tl,Me.invert=Xh,Me.invertBy=Jh,Me.invokeMap=Ff,Me.iteratee=Id,Me.keyBy=xd,Me.keys=Dn,Me.keysIn=Ei,Me.map=Ca,Me.mapKeys=ep,Me.mapValues=tp,Me.matches=Zp,Me.matchesProperty=Yp,Me.memoize=lt,Me.merge=rp,Me.mergeWith=Kd,Me.method=Xp,Me.methodOf=Jp,Me.mixin=Od,Me.negate=kt,Me.nthArg=e0,Me.omit=np,Me.omitBy=ip,Me.once=Gt,Me.orderBy=Ed,Me.over=t0,Me.overArgs=Qt,Me.overEvery=r0,Me.overSome=n0,Me.partial=Yt,Me.partialRight=rr,Me.partition=tu,Me.pick=op,Me.pickBy=Gd,Me.property=eh,Me.propertyOf=i0,Me.pull=rl,Me.pullAll=Qs,Me.pullAllBy=Kn,Me.pullAllWith=ta,Me.pullAt=Bi,Me.range=o0,Me.rangeRight=a0,Me.rearg=_n,Me.reject=A,Me.remove=Qn,Me.rest=Dr,Me.reverse=nl,Me.sampleSize=F,Me.set=sp,Me.setWith=up,Me.shuffle=ne,Me.slice=yc,Me.sortBy=Ae,Me.sortedUniq=xc,Me.sortedUniqBy=Ma,Me.split=Cp,Me.spread=na,Me.tail=Pf,Me.take=kf,Me.takeRight=Ec,Me.takeRightWhile=il,Me.takeWhile=cd,Me.tap=vd,Me.throttle=Ad,Me.thru=Di,Me.toArray=jd,Me.toPairs=Wd,Me.toPairsIn=Zd,Me.toPath=f0,Me.toPlainObject=Vd,Me.transform=lp,Me.unary=rh,Me.union=fd,Me.unionBy=Cf,Me.unionWith=If,Me.uniq=Pa,Me.uniqBy=dd,Me.uniqWith=ps,Me.unset=cp,Me.unzip=ol,Me.unzipWith=Xr,Me.update=fp,Me.updateWith=dp,Me.values=ml,Me.valuesIn=hp,Me.without=hd,Me.words=Jd,Me.wrap=nh,Me.xor=Of,Me.xorBy=pd,Me.xorWith=md,Me.zip=$f,Me.zipObject=Nf,Me.zipObjectDeep=gd,Me.zipWith=wi,Me.entries=Wd,Me.entriesIn=Zd,Me.extend=Hd,Me.extendWith=zf,Od(Me,Me),Me.add=h0,Me.attempt=Qd,Me.camelCase=vp,Me.capitalize=Yd,Me.ceil=p0,Me.clamp=pp,Me.clone=oh,Me.cloneDeep=sh,Me.cloneDeepWith=uh,Me.cloneWith=ah,Me.conformsTo=lh,Me.deburr=Xd,Me.defaultTo=Kp,Me.divide=m0,Me.endsWith=yp,Me.eq=Mo,Me.escape=bp,Me.escapeRegExp=_p,Me.every=Bf,Me.find=cl,Me.findIndex=Jo,Me.findKey=jh,Me.findLast=Df,Me.findLastIndex=Ys,Me.findLastKey=zh,Me.floor=g0,Me.forEach=fl,Me.forEachRight=eu,Me.forIn=Vh,Me.forInRight=Hh,Me.forOwn=Kh,Me.forOwnRight=Gh,Me.get=Md,Me.gt=ch,Me.gte=fh,Me.has=Yh,Me.hasIn=Pd,Me.head=Ta,Me.identity=Si,Me.includes=dl,Me.indexOf=Ro,Me.inRange=mp,Me.invoke=Qh,Me.isArguments=ru,Me.isArray=cr,Me.isArrayBuffer=hh,Me.isArrayLike=xi,Me.isArrayLikeObject=hn,Me.isBoolean=ph,Me.isBuffer=ms,Me.isDate=mh,Me.isElement=gh,Me.isEmpty=yh,Me.isEqual=bh,Me.isEqualWith=wh,Me.isError=Td,Me.isFinite=xh,Me.isFunction=Ia,Me.isInteger=Dd,Me.isLength=Uf,Me.isMap=qd,Me.isMatch=Eh,Me.isMatchWith=Sh,Me.isNaN=Ah,Me.isNative=Th,Me.isNil=Mh,Me.isNull=Rh,Me.isNumber=Fd,Me.isObject=tn,Me.isObjectLike=un,Me.isPlainObject=Pc,Me.isRegExp=Rd,Me.isSafeInteger=Ph,Me.isSet=Ud,Me.isString=jf,Me.isSymbol=qi,Me.isTypedArray=pl,Me.isUndefined=kh,Me.isWeakMap=Ch,Me.isWeakSet=Ih,Me.join=ea,Me.kebabCase=wp,Me.last=Hn,Me.lastIndexOf=Js,Me.lowerCase=xp,Me.lowerFirst=Ep,Me.lt=Oh,Me.lte=$h,Me.max=v0,Me.maxBy=y0,Me.mean=b0,Me.meanBy=_0,Me.min=w0,Me.minBy=x0,Me.stubArray=Nd,Me.stubFalse=Ld,Me.stubObject=s0,Me.stubString=u0,Me.stubTrue=l0,Me.multiply=E0,Me.nth=vc,Me.noConflict=Qp,Me.noop=$d,Me.now=Be,Me.pad=Sp,Me.padEnd=Ap,Me.padStart=Tp,Me.parseInt=Rp,Me.random=gp,Me.reduce=Sd,Me.reduceRight=hl,Me.repeat=Mp,Me.replace=Pp,Me.result=ap,Me.round=S0,Me.runInContext=Ze,Me.sample=C,Me.size=fe,Me.snakeCase=kp,Me.some=ve,Me.sortedIndex=bc,Me.sortedIndexBy=ld,Me.sortedIndexOf=ra,Me.sortedLastIndex=Mf,Me.sortedLastIndexBy=wc,Me.sortedLastIndexOf=Ra,Me.startCase=Ip,Me.startsWith=Op,Me.subtract=A0,Me.sum=T0,Me.sumBy=R0,Me.template=$p,Me.times=c0,Me.toFinite=Oa,Me.toInteger=hr,Me.toLength=zd,Me.toLower=Np,Me.toNumber=uo,Me.toSafeInteger=Nh,Me.toString=Ur,Me.toUpper=Lp,Me.trim=Bp,Me.trimEnd=Dp,Me.trimStart=qp,Me.truncate=Fp,Me.unescape=Up,Me.uniqueId=d0,Me.upperCase=jp,Me.upperFirst=kd,Me.each=fl,Me.eachRight=eu,Me.first=Ta,Od(Me,function(){var L={};return oi(Me,function(q,ie){Br.call(Me.prototype,ie)||(L[ie]=q)}),L}(),{chain:!1}),Me.VERSION=l,kn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(L){Me[L].placeholder=Me}),kn(["drop","take"],function(L,q){lr.prototype[L]=function(ie){ie=ie===u?1:an(hr(ie),0);var ye=this.__filtered__&&!q?new lr(this):this.clone();return ye.__filtered__?ye.__takeCount__=Cn(ie,ye.__takeCount__):ye.__views__.push({size:Cn(ie,M),type:L+(ye.__dir__<0?"Right":"")}),ye},lr.prototype[L+"Right"]=function(ie){return this.reverse()[L](ie).reverse()}}),kn(["filter","map","takeWhile"],function(L,q){var ie=q+1,ye=ie==_||ie==x;lr.prototype[L]=function(Ee){var ke=this.clone();return ke.__iteratees__.push({iteratee:tr(Ee,3),type:ie}),ke.__filtered__=ke.__filtered__||ye,ke}}),kn(["head","last"],function(L,q){var ie="take"+(q?"Right":"");lr.prototype[L]=function(){return this[ie](1).value()[0]}}),kn(["initial","tail"],function(L,q){var ie="drop"+(q?"":"Right");lr.prototype[L]=function(){return this.__filtered__?new lr(this):this[ie](1)}}),lr.prototype.compact=function(){return this.filter(Si)},lr.prototype.find=function(L){return this.filter(L).head()},lr.prototype.findLast=function(L){return this.reverse().find(L)},lr.prototype.invokeMap=dr(function(L,q){return typeof L=="function"?new lr(this):this.map(function(ie){return gi(ie,L,q)})}),lr.prototype.reject=function(L){return this.filter(kt(tr(L)))},lr.prototype.slice=function(L,q){L=hr(L);var ie=this;return ie.__filtered__&&(L>0||q<0)?new lr(ie):(L<0?ie=ie.takeRight(-L):L&&(ie=ie.drop(L)),q!==u&&(q=hr(q),ie=q<0?ie.dropRight(-q):ie.take(q-L)),ie)},lr.prototype.takeRightWhile=function(L){return this.reverse().takeWhile(L).reverse()},lr.prototype.toArray=function(){return this.take(M)},oi(lr.prototype,function(L,q){var ie=/^(?:filter|find|map|reject)|While$/.test(q),ye=/^(?:head|last)$/.test(q),Ee=Me[ye?"take"+(q=="last"?"Right":""):q],ke=ye||/^find/.test(q);Ee&&(Me.prototype[q]=function(){var Fe=this.__wrapped__,He=ye?[1]:arguments,Ye=Fe instanceof lr,xt=He[0],Et=Ye||cr(Fe),Rt=function(Sr){var Nr=Ee.apply(Me,Do([Sr],He));return ye&&Ot?Nr[0]:Nr};Et&&ie&&typeof xt=="function"&&xt.length!=1&&(Ye=Et=!1);var Ot=this.__chain__,Wt=!!this.__actions__.length,nr=ke&&!Ot,vr=Ye&&!Wt;if(!ke&&Et){Fe=vr?Fe:new lr(this);var ir=L.apply(Fe,He);return ir.__actions__.push({func:Di,args:[Rt],thisArg:u}),new In(ir,Ot)}return nr&&vr?L.apply(this,He):(ir=this.thru(Rt),nr?ye?ir.value()[0]:ir.value():ir)})}),kn(["pop","push","shift","sort","splice","unshift"],function(L){var q=po[L],ie=/^(?:push|sort|unshift)$/.test(L)?"tap":"thru",ye=/^(?:pop|shift)$/.test(L);Me.prototype[L]=function(){var Ee=arguments;if(ye&&!this.__chain__){var ke=this.value();return q.apply(cr(ke)?ke:[],Ee)}return this[ie](function(Fe){return q.apply(cr(Fe)?Fe:[],Ee)})}}),oi(lr.prototype,function(L,q){var ie=Me[q];if(ie){var ye=ie.name+"";Br.call(Wa,ye)||(Wa[ye]=[]),Wa[ye].push({name:q,func:ie})}}),Wa[ls(u,N).name]=[{name:"wrapper",func:u}],lr.prototype.clone=wu,lr.prototype.reverse=Ol,lr.prototype.value=Xa,Me.prototype.at=sl,Me.prototype.chain=ka,Me.prototype.commit=ul,Me.prototype.next=Sc,Me.prototype.plant=yd,Me.prototype.reverse=Tc,Me.prototype.toJSON=Me.prototype.valueOf=Me.prototype.value=bd,Me.prototype.first=Me.prototype.head,go&&(Me.prototype[go]=Ac),Me},ja=ed();Pr?((Pr.exports=ja)._=ja,Zt._=ja):Ct._=ja}).call(lodash)}(lodash$1,lodash$1.exports)),lodash$1.exports}var lodashExports=requireLodash(),errCode,hasRequiredErrCode;function requireErrCode(){if(hasRequiredErrCode)return errCode;hasRequiredErrCode=1;function s(u,l){for(const f in l)Object.defineProperty(u,f,{value:l[f],enumerable:!0,configurable:!0});return u}function a(u,l,f){if(!u||typeof u=="string")throw new TypeError("Please pass an Error to err-code");f||(f={}),typeof l=="object"&&(f=l,l=void 0),l!=null&&(f.code=l);try{return s(u,f)}catch{f.message=u.message,f.stack=u.stack;const h=function(){};return h.prototype=Object.create(Object.getPrototypeOf(u)),s(new h,f)}}return errCode=a,errCode}var retry$1={},retry_operation,hasRequiredRetry_operation;function requireRetry_operation(){if(hasRequiredRetry_operation)return retry_operation;hasRequiredRetry_operation=1;function s(a,u){typeof u=="boolean"&&(u={forever:u}),this._originalTimeouts=JSON.parse(JSON.stringify(a)),this._timeouts=a,this._options=u||{},this._maxRetryTime=u&&u.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}return retry_operation=s,s.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts},s.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null},s.prototype.retry=function(a){if(this._timeout&&clearTimeout(this._timeout),!a)return!1;var u=new Date().getTime();if(a&&u-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(a);var l=this._timeouts.shift();if(l===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),l=this._timeouts.shift();else return!1;var f=this,c=setTimeout(function(){f._attempts++,f._operationTimeoutCb&&(f._timeout=setTimeout(function(){f._operationTimeoutCb(f._attempts)},f._operationTimeout),f._options.unref&&f._timeout.unref()),f._fn(f._attempts)},l);return this._options.unref&&c.unref(),!0},s.prototype.attempt=function(a,u){this._fn=a,u&&(u.timeout&&(this._operationTimeout=u.timeout),u.cb&&(this._operationTimeoutCb=u.cb));var l=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){l._operationTimeoutCb()},l._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},s.prototype.try=function(a){console.log("Using RetryOperation.try() is deprecated"),this.attempt(a)},s.prototype.start=function(a){console.log("Using RetryOperation.start() is deprecated"),this.attempt(a)},s.prototype.start=s.prototype.try,s.prototype.errors=function(){return this._errors},s.prototype.attempts=function(){return this._attempts},s.prototype.mainError=function(){if(this._errors.length===0)return null;for(var a={},u=null,l=0,f=0;f<this._errors.length;f++){var c=this._errors[f],h=c.message,p=(a[h]||0)+1;a[h]=p,p>=l&&(u=c,l=p)}return u},retry_operation}var hasRequiredRetry$1;function requireRetry$1(){return hasRequiredRetry$1||(hasRequiredRetry$1=1,function(s){var a=requireRetry_operation();s.operation=function(u){var l=s.timeouts(u);return new a(l,{forever:u&&u.forever,unref:u&&u.unref,maxRetryTime:u&&u.maxRetryTime})},s.timeouts=function(u){if(u instanceof Array)return[].concat(u);var l={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var f in u)l[f]=u[f];if(l.minTimeout>l.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var c=[],h=0;h<l.retries;h++)c.push(this.createTimeout(h,l));return u&&u.forever&&!c.length&&c.push(this.createTimeout(h,l)),c.sort(function(p,v){return p-v}),c},s.createTimeout=function(u,l){var f=l.randomize?Math.random()+1:1,c=Math.round(f*l.minTimeout*Math.pow(l.factor,u));return c=Math.min(c,l.maxTimeout),c},s.wrap=function(u,l,f){if(l instanceof Array&&(f=l,l=null),!f){f=[];for(var c in u)typeof u[c]=="function"&&f.push(c)}for(var h=0;h<f.length;h++){var p=f[h],v=u[p];u[p]=(function(b){var S=s.operation(l),E=Array.prototype.slice.call(arguments,1),R=E.pop();E.push(function(O){S.retry(O)||(O&&(arguments[0]=S.mainError()),R.apply(this,arguments))}),S.attempt(function(){b.apply(u,E)})}).bind(u,v),u[p].options=l}}}(retry$1)),retry$1}var retry,hasRequiredRetry;function requireRetry(){return hasRequiredRetry||(hasRequiredRetry=1,retry=requireRetry$1()),retry}var promiseRetry_1,hasRequiredPromiseRetry;function requirePromiseRetry(){if(hasRequiredPromiseRetry)return promiseRetry_1;hasRequiredPromiseRetry=1;var s=requireErrCode(),a=requireRetry(),u=Object.prototype.hasOwnProperty;function l(c){return c&&c.code==="EPROMISERETRY"&&u.call(c,"retried")}function f(c,h){var p,v;return typeof c=="object"&&typeof h=="function"&&(p=h,h=c,c=p),v=a.operation(h),new Promise(function(y,b){v.attempt(function(S){Promise.resolve().then(function(){return c(function(E){throw l(E)&&(E=E.retried),s(new Error("Retrying"),"EPROMISERETRY",{retried:E})},S)}).then(y,function(E){l(E)&&(E=E.retried,v.retry(E||new Error))||b(E)})})})}return promiseRetry_1=f,promiseRetry_1}requirePromiseRetry();var util;(function(s){s.assertEqual=f=>f;function a(f){}s.assertIs=a;function u(f){throw new Error}s.assertNever=u,s.arrayToEnum=f=>{const c={};for(const h of f)c[h]=h;return c},s.getValidEnumValues=f=>{const c=s.objectKeys(f).filter(p=>typeof f[f[p]]!="number"),h={};for(const p of c)h[p]=f[p];return s.objectValues(h)},s.objectValues=f=>s.objectKeys(f).map(function(c){return f[c]}),s.objectKeys=typeof Object.keys=="function"?f=>Object.keys(f):f=>{const c=[];for(const h in f)Object.prototype.hasOwnProperty.call(f,h)&&c.push(h);return c},s.find=(f,c)=>{for(const h of f)if(c(h))return h},s.isInteger=typeof Number.isInteger=="function"?f=>Number.isInteger(f):f=>typeof f=="number"&&isFinite(f)&&Math.floor(f)===f;function l(f,c=" | "){return f.map(h=>typeof h=="string"?`'${h}'`:h).join(c)}s.joinValues=l,s.jsonStringifyReplacer=(f,c)=>typeof c=="bigint"?c.toString():c})(util||(util={}));var objectUtil;(function(s){s.mergeShapes=(a,u)=>({...a,...u})})(objectUtil||(objectUtil={}));const ZodParsedType=util.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=s=>{switch(typeof s){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return isNaN(s)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(s)?ZodParsedType.array:s===null?ZodParsedType.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?ZodParsedType.promise:typeof Map<"u"&&s instanceof Map?ZodParsedType.map:typeof Set<"u"&&s instanceof Set?ZodParsedType.set:typeof Date<"u"&&s instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),quotelessJson=s=>JSON.stringify(s,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{get errors(){return this.issues}constructor(a){super(),this.issues=[],this.addIssue=l=>{this.issues=[...this.issues,l]},this.addIssues=(l=[])=>{this.issues=[...this.issues,...l]};const u=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,u):this.__proto__=u,this.name="ZodError",this.issues=a}format(a){const u=a||function(c){return c.message},l={_errors:[]},f=c=>{for(const h of c.issues)if(h.code==="invalid_union")h.unionErrors.map(f);else if(h.code==="invalid_return_type")f(h.returnTypeError);else if(h.code==="invalid_arguments")f(h.argumentsError);else if(h.path.length===0)l._errors.push(u(h));else{let p=l,v=0;for(;v<h.path.length;){const y=h.path[v];v===h.path.length-1?(p[y]=p[y]||{_errors:[]},p[y]._errors.push(u(h))):p[y]=p[y]||{_errors:[]},p=p[y],v++}}};return f(this),l}static assert(a){if(!(a instanceof ZodError))throw new Error(`Not a ZodError: ${a}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(a=u=>u.message){const u={},l=[];for(const f of this.issues)f.path.length>0?(u[f.path[0]]=u[f.path[0]]||[],u[f.path[0]].push(a(f))):l.push(a(f));return{formErrors:l,fieldErrors:u}}get formErrors(){return this.flatten()}}ZodError.create=s=>new ZodError(s);const errorMap=(s,a)=>{let u;switch(s.code){case ZodIssueCode.invalid_type:s.received===ZodParsedType.undefined?u="Required":u=`Expected ${s.expected}, received ${s.received}`;break;case ZodIssueCode.invalid_literal:u=`Invalid literal value, expected ${JSON.stringify(s.expected,util.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:u=`Unrecognized key(s) in object: ${util.joinValues(s.keys,", ")}`;break;case ZodIssueCode.invalid_union:u="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:u=`Invalid discriminator value. Expected ${util.joinValues(s.options)}`;break;case ZodIssueCode.invalid_enum_value:u=`Invalid enum value. Expected ${util.joinValues(s.options)}, received '${s.received}'`;break;case ZodIssueCode.invalid_arguments:u="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:u="Invalid function return type";break;case ZodIssueCode.invalid_date:u="Invalid date";break;case ZodIssueCode.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(u=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(u=`${u} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?u=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?u=`Invalid input: must end with "${s.validation.endsWith}"`:util.assertNever(s.validation):s.validation!=="regex"?u=`Invalid ${s.validation}`:u="Invalid";break;case ZodIssueCode.too_small:s.type==="array"?u=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?u=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?u=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?u=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:u="Invalid input";break;case ZodIssueCode.too_big:s.type==="array"?u=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?u=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?u=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?u=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?u=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:u="Invalid input";break;case ZodIssueCode.custom:u="Invalid input";break;case ZodIssueCode.invalid_intersection_types:u="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:u=`Number must be a multiple of ${s.multipleOf}`;break;case ZodIssueCode.not_finite:u="Number must be finite";break;default:u=a.defaultError,util.assertNever(s)}return{message:u}};let overrideErrorMap=errorMap;function setErrorMap(s){overrideErrorMap=s}function getErrorMap(){return overrideErrorMap}const makeIssue=s=>{const{data:a,path:u,errorMaps:l,issueData:f}=s,c=[...u,...f.path||[]],h={...f,path:c};if(f.message!==void 0)return{...f,path:c,message:f.message};let p="";const v=l.filter(y=>!!y).slice().reverse();for(const y of v)p=y(h,{data:a,defaultError:p}).message;return{...f,path:c,message:p}},EMPTY_PATH=[];function addIssueToContext(s,a){const u=getErrorMap(),l=makeIssue({issueData:a,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,u,u===errorMap?void 0:errorMap].filter(f=>!!f)});s.common.issues.push(l)}class ParseStatus{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(a,u){const l=[];for(const f of u){if(f.status==="aborted")return INVALID;f.status==="dirty"&&a.dirty(),l.push(f.value)}return{status:a.value,value:l}}static async mergeObjectAsync(a,u){const l=[];for(const f of u){const c=await f.key,h=await f.value;l.push({key:c,value:h})}return ParseStatus.mergeObjectSync(a,l)}static mergeObjectSync(a,u){const l={};for(const f of u){const{key:c,value:h}=f;if(c.status==="aborted"||h.status==="aborted")return INVALID;c.status==="dirty"&&a.dirty(),h.status==="dirty"&&a.dirty(),c.value!=="__proto__"&&(typeof h.value<"u"||f.alwaysSet)&&(l[c.value]=h.value)}return{status:a.value,value:l}}}const INVALID=Object.freeze({status:"aborted"}),DIRTY=s=>({status:"dirty",value:s}),OK=s=>({status:"valid",value:s}),isAborted=s=>s.status==="aborted",isDirty=s=>s.status==="dirty",isValid=s=>s.status==="valid",isAsync=s=>typeof Promise<"u"&&s instanceof Promise;function __classPrivateFieldGet(s,a,u,l){if(typeof a=="function"?s!==a||!l:!a.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a.get(s)}function __classPrivateFieldSet(s,a,u,l,f){if(typeof a=="function"?s!==a||!f:!a.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a.set(s,u),u}typeof SuppressedError=="function"&&SuppressedError;var errorUtil;(function(s){s.errToObj=a=>typeof a=="string"?{message:a}:a||{},s.toString=a=>typeof a=="string"?a:a==null?void 0:a.message})(errorUtil||(errorUtil={}));var _ZodEnum_cache,_ZodNativeEnum_cache;class ParseInputLazyPath{constructor(a,u,l,f){this._cachedPath=[],this.parent=a,this.data=u,this._path=l,this._key=f}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(s,a)=>{if(isValid(a))return{success:!0,data:a.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const u=new ZodError(s.common.issues);return this._error=u,this._error}}};function processCreateParams(s){if(!s)return{};const{errorMap:a,invalid_type_error:u,required_error:l,description:f}=s;if(a&&(u||l))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return a?{errorMap:a,description:f}:{errorMap:(h,p)=>{var v,y;const{message:b}=s;return h.code==="invalid_enum_value"?{message:b??p.defaultError}:typeof p.data>"u"?{message:(v=b??l)!==null&&v!==void 0?v:p.defaultError}:h.code!=="invalid_type"?{message:p.defaultError}:{message:(y=b??u)!==null&&y!==void 0?y:p.defaultError}},description:f}}class ZodType{get description(){return this._def.description}_getType(a){return getParsedType(a.data)}_getOrReturnCtx(a,u){return u||{common:a.parent.common,data:a.data,parsedType:getParsedType(a.data),schemaErrorMap:this._def.errorMap,path:a.path,parent:a.parent}}_processInputParams(a){return{status:new ParseStatus,ctx:{common:a.parent.common,data:a.data,parsedType:getParsedType(a.data),schemaErrorMap:this._def.errorMap,path:a.path,parent:a.parent}}}_parseSync(a){const u=this._parse(a);if(isAsync(u))throw new Error("Synchronous parse encountered promise.");return u}_parseAsync(a){const u=this._parse(a);return Promise.resolve(u)}parse(a,u){const l=this.safeParse(a,u);if(l.success)return l.data;throw l.error}safeParse(a,u){var l;const f={common:{issues:[],async:(l=u==null?void 0:u.async)!==null&&l!==void 0?l:!1,contextualErrorMap:u==null?void 0:u.errorMap},path:(u==null?void 0:u.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:a,parsedType:getParsedType(a)},c=this._parseSync({data:a,path:f.path,parent:f});return handleResult(f,c)}"~validate"(a){var u,l;const f={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:a,parsedType:getParsedType(a)};if(!this["~standard"].async)try{const c=this._parseSync({data:a,path:[],parent:f});return isValid(c)?{value:c.value}:{issues:f.common.issues}}catch(c){!((l=(u=c==null?void 0:c.message)===null||u===void 0?void 0:u.toLowerCase())===null||l===void 0)&&l.includes("encountered")&&(this["~standard"].async=!0),f.common={issues:[],async:!0}}return this._parseAsync({data:a,path:[],parent:f}).then(c=>isValid(c)?{value:c.value}:{issues:f.common.issues})}async parseAsync(a,u){const l=await this.safeParseAsync(a,u);if(l.success)return l.data;throw l.error}async safeParseAsync(a,u){const l={common:{issues:[],contextualErrorMap:u==null?void 0:u.errorMap,async:!0},path:(u==null?void 0:u.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:a,parsedType:getParsedType(a)},f=this._parse({data:a,path:l.path,parent:l}),c=await(isAsync(f)?f:Promise.resolve(f));return handleResult(l,c)}refine(a,u){const l=f=>typeof u=="string"||typeof u>"u"?{message:u}:typeof u=="function"?u(f):u;return this._refinement((f,c)=>{const h=a(f),p=()=>c.addIssue({code:ZodIssueCode.custom,...l(f)});return typeof Promise<"u"&&h instanceof Promise?h.then(v=>v?!0:(p(),!1)):h?!0:(p(),!1)})}refinement(a,u){return this._refinement((l,f)=>a(l)?!0:(f.addIssue(typeof u=="function"?u(l,f):u),!1))}_refinement(a){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:a}})}superRefine(a){return this._refinement(a)}constructor(a){this.spa=this.safeParseAsync,this._def=a,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:u=>this["~validate"](u)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(a){return ZodUnion.create([this,a],this._def)}and(a){return ZodIntersection.create(this,a,this._def)}transform(a){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:a}})}default(a){const u=typeof a=="function"?a:()=>a;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:u,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(a){const u=typeof a=="function"?a:()=>a;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:u,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(a){const u=this.constructor;return new u({...this._def,description:a})}pipe(a){return ZodPipeline.create(this,a)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[0-9a-z]+$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/i,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nanoidRegex=/^[a-z0-9_-]{21}$/i,jwtRegex=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,durationRegex=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let emojiRegex;const ipv4Regex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4CidrRegex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6Regex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ipv6CidrRegex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64Regex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64urlRegex=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dateRegexSource="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",dateRegex=new RegExp(`^${dateRegexSource}$`);function timeRegexSource(s){let a="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return s.precision?a=`${a}\\.\\d{${s.precision}}`:s.precision==null&&(a=`${a}(\\.\\d+)?`),a}function timeRegex(s){return new RegExp(`^${timeRegexSource(s)}$`)}function datetimeRegex(s){let a=`${dateRegexSource}T${timeRegexSource(s)}`;const u=[];return u.push(s.local?"Z?":"Z"),s.offset&&u.push("([+-]\\d{2}:?\\d{2})"),a=`${a}(${u.join("|")})`,new RegExp(`^${a}$`)}function isValidIP(s,a){return!!((a==="v4"||!a)&&ipv4Regex.test(s)||(a==="v6"||!a)&&ipv6Regex.test(s))}function isValidJWT(s,a){if(!jwtRegex.test(s))return!1;try{const[u]=s.split("."),l=u.replace(/-/g,"+").replace(/_/g,"/").padEnd(u.length+(4-u.length%4)%4,"="),f=JSON.parse(atob(l));return!(typeof f!="object"||f===null||!f.typ||!f.alg||a&&f.alg!==a)}catch{return!1}}function isValidCidr(s,a){return!!((a==="v4"||!a)&&ipv4CidrRegex.test(s)||(a==="v6"||!a)&&ipv6CidrRegex.test(s))}class ZodString extends ZodType{_parse(a){if(this._def.coerce&&(a.data=String(a.data)),this._getType(a)!==ZodParsedType.string){const c=this._getOrReturnCtx(a);return addIssueToContext(c,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:c.parsedType}),INVALID}const l=new ParseStatus;let f;for(const c of this._def.checks)if(c.kind==="min")a.data.length<c.value&&(f=this._getOrReturnCtx(a,f),addIssueToContext(f,{code:ZodIssueCode.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),l.dirty());else if(c.kind==="max")a.data.length>c.value&&(f=this._getOrReturnCtx(a,f),addIssueToContext(f,{code:ZodIssueCode.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),l.dirty());else if(c.kind==="length"){const h=a.data.length>c.value,p=a.data.length<c.value;(h||p)&&(f=this._getOrReturnCtx(a,f),h?addIssueToContext(f,{code:ZodIssueCode.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}):p&&addIssueToContext(f,{code:ZodIssueCode.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}),l.dirty())}else if(c.kind==="email")emailRegex.test(a.data)||(f=this._getOrReturnCtx(a,f),addIssueToContext(f,{validation:"email",code:ZodIssueCode.invalid_string,message:c.message}),l.dirty());else if(c.kind==="emoji")emojiRegex||(emojiRegex=new RegExp(_emojiRegex,"u")),emojiRegex.test(a.data)||(f=this._getOrReturnCtx(a,f),addIssueToContext(f,{validation:"emoji",code:ZodIssueCode.invalid_string,message:c.message}),l.dirty());else if(c.kind==="uuid")uuidRegex.test(a.data)||(f=this._getOrReturnCtx(a,f),addIssueToContext(f,{validation:"uuid",code:ZodIssueCode.invalid_string,message:c.message}),l.dirty());else if(c.kind==="nanoid")nanoidRegex.test(a.data)||(f=this._getOrReturnCtx(a,f),addIssueToContext(f,{validation:"nanoid",code:ZodIssueCode.invalid_string,message:c.message}),l.dirty());else if(c.kind==="cuid")cuidRegex.test(a.data)||(f=this._getOrReturnCtx(a,f),addIssueToContext(f,{validation:"cuid",code:ZodIssueCode.invalid_string,message:c.message}),l.dirty());else if(c.kind==="cuid2")cuid2Regex.test(a.data)||(f=this._getOrReturnCtx(a,f),addIssueToContext(f,{validation:"cuid2",code:ZodIssueCode.invalid_string,message:c.message}),l.dirty());else if(c.kind==="ulid")ulidRegex.test(a.data)||(f=this._getOrReturnCtx(a,f),addIssueToContext(f,{validation:"ulid",code:ZodIssueCode.invalid_string,message:c.message}),l.dirty());else if(c.kind==="url")try{new URL(a.data)}catch{f=this._getOrReturnCtx(a,f),addIssueToContext(f,{validation:"url",code:ZodIssueCode.invalid_string,message:c.message}),l.dirty()}else c.kind==="regex"?(c.regex.lastIndex=0,c.regex.test(a.data)||(f=this._getOrReturnCtx(a,f),addIssueToContext(f,{validation:"regex",code:ZodIssueCode.invalid_string,message:c.message}),l.dirty())):c.kind==="trim"?a.data=a.data.trim():c.kind==="includes"?a.data.includes(c.value,c.position)||(f=this._getOrReturnCtx(a,f),addIssueToContext(f,{code:ZodIssueCode.invalid_string,validation:{includes:c.value,position:c.position},message:c.message}),l.dirty()):c.kind==="toLowerCase"?a.data=a.data.toLowerCase():c.kind==="toUpperCase"?a.data=a.data.toUpperCase():c.kind==="startsWith"?a.data.startsWith(c.value)||(f=this._getOrReturnCtx(a,f),addIssueToContext(f,{code:ZodIssueCode.invalid_string,validation:{startsWith:c.value},message:c.message}),l.dirty()):c.kind==="endsWith"?a.data.endsWith(c.value)||(f=this._getOrReturnCtx(a,f),addIssueToContext(f,{code:ZodIssueCode.invalid_string,validation:{endsWith:c.value},message:c.message}),l.dirty()):c.kind==="datetime"?datetimeRegex(c).test(a.data)||(f=this._getOrReturnCtx(a,f),addIssueToContext(f,{code:ZodIssueCode.invalid_string,validation:"datetime",message:c.message}),l.dirty()):c.kind==="date"?dateRegex.test(a.data)||(f=this._getOrReturnCtx(a,f),addIssueToContext(f,{code:ZodIssueCode.invalid_string,validation:"date",message:c.message}),l.dirty()):c.kind==="time"?timeRegex(c).test(a.data)||(f=this._getOrReturnCtx(a,f),addIssueToContext(f,{code:ZodIssueCode.invalid_string,validation:"time",message:c.message}),l.dirty()):c.kind==="duration"?durationRegex.test(a.data)||(f=this._getOrReturnCtx(a,f),addIssueToContext(f,{validation:"duration",code:ZodIssueCode.invalid_string,message:c.message}),l.dirty()):c.kind==="ip"?isValidIP(a.data,c.version)||(f=this._getOrReturnCtx(a,f),addIssueToContext(f,{validation:"ip",code:ZodIssueCode.invalid_string,message:c.message}),l.dirty()):c.kind==="jwt"?isValidJWT(a.data,c.alg)||(f=this._getOrReturnCtx(a,f),addIssueToContext(f,{validation:"jwt",code:ZodIssueCode.invalid_string,message:c.message}),l.dirty()):c.kind==="cidr"?isValidCidr(a.data,c.version)||(f=this._getOrReturnCtx(a,f),addIssueToContext(f,{validation:"cidr",code:ZodIssueCode.invalid_string,message:c.message}),l.dirty()):c.kind==="base64"?base64Regex.test(a.data)||(f=this._getOrReturnCtx(a,f),addIssueToContext(f,{validation:"base64",code:ZodIssueCode.invalid_string,message:c.message}),l.dirty()):c.kind==="base64url"?base64urlRegex.test(a.data)||(f=this._getOrReturnCtx(a,f),addIssueToContext(f,{validation:"base64url",code:ZodIssueCode.invalid_string,message:c.message}),l.dirty()):util.assertNever(c);return{status:l.value,value:a.data}}_regex(a,u,l){return this.refinement(f=>a.test(f),{validation:u,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(l)})}_addCheck(a){return new ZodString({...this._def,checks:[...this._def.checks,a]})}email(a){return this._addCheck({kind:"email",...errorUtil.errToObj(a)})}url(a){return this._addCheck({kind:"url",...errorUtil.errToObj(a)})}emoji(a){return this._addCheck({kind:"emoji",...errorUtil.errToObj(a)})}uuid(a){return this._addCheck({kind:"uuid",...errorUtil.errToObj(a)})}nanoid(a){return this._addCheck({kind:"nanoid",...errorUtil.errToObj(a)})}cuid(a){return this._addCheck({kind:"cuid",...errorUtil.errToObj(a)})}cuid2(a){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(a)})}ulid(a){return this._addCheck({kind:"ulid",...errorUtil.errToObj(a)})}base64(a){return this._addCheck({kind:"base64",...errorUtil.errToObj(a)})}base64url(a){return this._addCheck({kind:"base64url",...errorUtil.errToObj(a)})}jwt(a){return this._addCheck({kind:"jwt",...errorUtil.errToObj(a)})}ip(a){return this._addCheck({kind:"ip",...errorUtil.errToObj(a)})}cidr(a){return this._addCheck({kind:"cidr",...errorUtil.errToObj(a)})}datetime(a){var u,l;return typeof a=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:a}):this._addCheck({kind:"datetime",precision:typeof(a==null?void 0:a.precision)>"u"?null:a==null?void 0:a.precision,offset:(u=a==null?void 0:a.offset)!==null&&u!==void 0?u:!1,local:(l=a==null?void 0:a.local)!==null&&l!==void 0?l:!1,...errorUtil.errToObj(a==null?void 0:a.message)})}date(a){return this._addCheck({kind:"date",message:a})}time(a){return typeof a=="string"?this._addCheck({kind:"time",precision:null,message:a}):this._addCheck({kind:"time",precision:typeof(a==null?void 0:a.precision)>"u"?null:a==null?void 0:a.precision,...errorUtil.errToObj(a==null?void 0:a.message)})}duration(a){return this._addCheck({kind:"duration",...errorUtil.errToObj(a)})}regex(a,u){return this._addCheck({kind:"regex",regex:a,...errorUtil.errToObj(u)})}includes(a,u){return this._addCheck({kind:"includes",value:a,position:u==null?void 0:u.position,...errorUtil.errToObj(u==null?void 0:u.message)})}startsWith(a,u){return this._addCheck({kind:"startsWith",value:a,...errorUtil.errToObj(u)})}endsWith(a,u){return this._addCheck({kind:"endsWith",value:a,...errorUtil.errToObj(u)})}min(a,u){return this._addCheck({kind:"min",value:a,...errorUtil.errToObj(u)})}max(a,u){return this._addCheck({kind:"max",value:a,...errorUtil.errToObj(u)})}length(a,u){return this._addCheck({kind:"length",value:a,...errorUtil.errToObj(u)})}nonempty(a){return this.min(1,errorUtil.errToObj(a))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(a=>a.kind==="datetime")}get isDate(){return!!this._def.checks.find(a=>a.kind==="date")}get isTime(){return!!this._def.checks.find(a=>a.kind==="time")}get isDuration(){return!!this._def.checks.find(a=>a.kind==="duration")}get isEmail(){return!!this._def.checks.find(a=>a.kind==="email")}get isURL(){return!!this._def.checks.find(a=>a.kind==="url")}get isEmoji(){return!!this._def.checks.find(a=>a.kind==="emoji")}get isUUID(){return!!this._def.checks.find(a=>a.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(a=>a.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(a=>a.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(a=>a.kind==="cuid2")}get isULID(){return!!this._def.checks.find(a=>a.kind==="ulid")}get isIP(){return!!this._def.checks.find(a=>a.kind==="ip")}get isCIDR(){return!!this._def.checks.find(a=>a.kind==="cidr")}get isBase64(){return!!this._def.checks.find(a=>a.kind==="base64")}get isBase64url(){return!!this._def.checks.find(a=>a.kind==="base64url")}get minLength(){let a=null;for(const u of this._def.checks)u.kind==="min"&&(a===null||u.value>a)&&(a=u.value);return a}get maxLength(){let a=null;for(const u of this._def.checks)u.kind==="max"&&(a===null||u.value<a)&&(a=u.value);return a}}ZodString.create=s=>{var a;return new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:(a=s==null?void 0:s.coerce)!==null&&a!==void 0?a:!1,...processCreateParams(s)})};function floatSafeRemainder(s,a){const u=(s.toString().split(".")[1]||"").length,l=(a.toString().split(".")[1]||"").length,f=u>l?u:l,c=parseInt(s.toFixed(f).replace(".","")),h=parseInt(a.toFixed(f).replace(".",""));return c%h/Math.pow(10,f)}class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(a){if(this._def.coerce&&(a.data=Number(a.data)),this._getType(a)!==ZodParsedType.number){const c=this._getOrReturnCtx(a);return addIssueToContext(c,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:c.parsedType}),INVALID}let l;const f=new ParseStatus;for(const c of this._def.checks)c.kind==="int"?util.isInteger(a.data)||(l=this._getOrReturnCtx(a,l),addIssueToContext(l,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:c.message}),f.dirty()):c.kind==="min"?(c.inclusive?a.data<c.value:a.data<=c.value)&&(l=this._getOrReturnCtx(a,l),addIssueToContext(l,{code:ZodIssueCode.too_small,minimum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),f.dirty()):c.kind==="max"?(c.inclusive?a.data>c.value:a.data>=c.value)&&(l=this._getOrReturnCtx(a,l),addIssueToContext(l,{code:ZodIssueCode.too_big,maximum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),f.dirty()):c.kind==="multipleOf"?floatSafeRemainder(a.data,c.value)!==0&&(l=this._getOrReturnCtx(a,l),addIssueToContext(l,{code:ZodIssueCode.not_multiple_of,multipleOf:c.value,message:c.message}),f.dirty()):c.kind==="finite"?Number.isFinite(a.data)||(l=this._getOrReturnCtx(a,l),addIssueToContext(l,{code:ZodIssueCode.not_finite,message:c.message}),f.dirty()):util.assertNever(c);return{status:f.value,value:a.data}}gte(a,u){return this.setLimit("min",a,!0,errorUtil.toString(u))}gt(a,u){return this.setLimit("min",a,!1,errorUtil.toString(u))}lte(a,u){return this.setLimit("max",a,!0,errorUtil.toString(u))}lt(a,u){return this.setLimit("max",a,!1,errorUtil.toString(u))}setLimit(a,u,l,f){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:a,value:u,inclusive:l,message:errorUtil.toString(f)}]})}_addCheck(a){return new ZodNumber({...this._def,checks:[...this._def.checks,a]})}int(a){return this._addCheck({kind:"int",message:errorUtil.toString(a)})}positive(a){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(a)})}negative(a){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(a)})}nonpositive(a){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(a)})}nonnegative(a){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(a)})}multipleOf(a,u){return this._addCheck({kind:"multipleOf",value:a,message:errorUtil.toString(u)})}finite(a){return this._addCheck({kind:"finite",message:errorUtil.toString(a)})}safe(a){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(a)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(a)})}get minValue(){let a=null;for(const u of this._def.checks)u.kind==="min"&&(a===null||u.value>a)&&(a=u.value);return a}get maxValue(){let a=null;for(const u of this._def.checks)u.kind==="max"&&(a===null||u.value<a)&&(a=u.value);return a}get isInt(){return!!this._def.checks.find(a=>a.kind==="int"||a.kind==="multipleOf"&&util.isInteger(a.value))}get isFinite(){let a=null,u=null;for(const l of this._def.checks){if(l.kind==="finite"||l.kind==="int"||l.kind==="multipleOf")return!0;l.kind==="min"?(u===null||l.value>u)&&(u=l.value):l.kind==="max"&&(a===null||l.value<a)&&(a=l.value)}return Number.isFinite(u)&&Number.isFinite(a)}}ZodNumber.create=s=>new ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:(s==null?void 0:s.coerce)||!1,...processCreateParams(s)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(a){if(this._def.coerce)try{a.data=BigInt(a.data)}catch{return this._getInvalidInput(a)}if(this._getType(a)!==ZodParsedType.bigint)return this._getInvalidInput(a);let l;const f=new ParseStatus;for(const c of this._def.checks)c.kind==="min"?(c.inclusive?a.data<c.value:a.data<=c.value)&&(l=this._getOrReturnCtx(a,l),addIssueToContext(l,{code:ZodIssueCode.too_small,type:"bigint",minimum:c.value,inclusive:c.inclusive,message:c.message}),f.dirty()):c.kind==="max"?(c.inclusive?a.data>c.value:a.data>=c.value)&&(l=this._getOrReturnCtx(a,l),addIssueToContext(l,{code:ZodIssueCode.too_big,type:"bigint",maximum:c.value,inclusive:c.inclusive,message:c.message}),f.dirty()):c.kind==="multipleOf"?a.data%c.value!==BigInt(0)&&(l=this._getOrReturnCtx(a,l),addIssueToContext(l,{code:ZodIssueCode.not_multiple_of,multipleOf:c.value,message:c.message}),f.dirty()):util.assertNever(c);return{status:f.value,value:a.data}}_getInvalidInput(a){const u=this._getOrReturnCtx(a);return addIssueToContext(u,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:u.parsedType}),INVALID}gte(a,u){return this.setLimit("min",a,!0,errorUtil.toString(u))}gt(a,u){return this.setLimit("min",a,!1,errorUtil.toString(u))}lte(a,u){return this.setLimit("max",a,!0,errorUtil.toString(u))}lt(a,u){return this.setLimit("max",a,!1,errorUtil.toString(u))}setLimit(a,u,l,f){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:a,value:u,inclusive:l,message:errorUtil.toString(f)}]})}_addCheck(a){return new ZodBigInt({...this._def,checks:[...this._def.checks,a]})}positive(a){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(a)})}negative(a){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(a)})}nonpositive(a){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(a)})}nonnegative(a){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(a)})}multipleOf(a,u){return this._addCheck({kind:"multipleOf",value:a,message:errorUtil.toString(u)})}get minValue(){let a=null;for(const u of this._def.checks)u.kind==="min"&&(a===null||u.value>a)&&(a=u.value);return a}get maxValue(){let a=null;for(const u of this._def.checks)u.kind==="max"&&(a===null||u.value<a)&&(a=u.value);return a}}ZodBigInt.create=s=>{var a;return new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:(a=s==null?void 0:s.coerce)!==null&&a!==void 0?a:!1,...processCreateParams(s)})};class ZodBoolean extends ZodType{_parse(a){if(this._def.coerce&&(a.data=!!a.data),this._getType(a)!==ZodParsedType.boolean){const l=this._getOrReturnCtx(a);return addIssueToContext(l,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:l.parsedType}),INVALID}return OK(a.data)}}ZodBoolean.create=s=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:(s==null?void 0:s.coerce)||!1,...processCreateParams(s)});class ZodDate extends ZodType{_parse(a){if(this._def.coerce&&(a.data=new Date(a.data)),this._getType(a)!==ZodParsedType.date){const c=this._getOrReturnCtx(a);return addIssueToContext(c,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:c.parsedType}),INVALID}if(isNaN(a.data.getTime())){const c=this._getOrReturnCtx(a);return addIssueToContext(c,{code:ZodIssueCode.invalid_date}),INVALID}const l=new ParseStatus;let f;for(const c of this._def.checks)c.kind==="min"?a.data.getTime()<c.value&&(f=this._getOrReturnCtx(a,f),addIssueToContext(f,{code:ZodIssueCode.too_small,message:c.message,inclusive:!0,exact:!1,minimum:c.value,type:"date"}),l.dirty()):c.kind==="max"?a.data.getTime()>c.value&&(f=this._getOrReturnCtx(a,f),addIssueToContext(f,{code:ZodIssueCode.too_big,message:c.message,inclusive:!0,exact:!1,maximum:c.value,type:"date"}),l.dirty()):util.assertNever(c);return{status:l.value,value:new Date(a.data.getTime())}}_addCheck(a){return new ZodDate({...this._def,checks:[...this._def.checks,a]})}min(a,u){return this._addCheck({kind:"min",value:a.getTime(),message:errorUtil.toString(u)})}max(a,u){return this._addCheck({kind:"max",value:a.getTime(),message:errorUtil.toString(u)})}get minDate(){let a=null;for(const u of this._def.checks)u.kind==="min"&&(a===null||u.value>a)&&(a=u.value);return a!=null?new Date(a):null}get maxDate(){let a=null;for(const u of this._def.checks)u.kind==="max"&&(a===null||u.value<a)&&(a=u.value);return a!=null?new Date(a):null}}ZodDate.create=s=>new ZodDate({checks:[],coerce:(s==null?void 0:s.coerce)||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(s)});class ZodSymbol extends ZodType{_parse(a){if(this._getType(a)!==ZodParsedType.symbol){const l=this._getOrReturnCtx(a);return addIssueToContext(l,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:l.parsedType}),INVALID}return OK(a.data)}}ZodSymbol.create=s=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(s)});class ZodUndefined extends ZodType{_parse(a){if(this._getType(a)!==ZodParsedType.undefined){const l=this._getOrReturnCtx(a);return addIssueToContext(l,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:l.parsedType}),INVALID}return OK(a.data)}}ZodUndefined.create=s=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(s)});class ZodNull extends ZodType{_parse(a){if(this._getType(a)!==ZodParsedType.null){const l=this._getOrReturnCtx(a);return addIssueToContext(l,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:l.parsedType}),INVALID}return OK(a.data)}}ZodNull.create=s=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(s)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(a){return OK(a.data)}}ZodAny.create=s=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(s)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(a){return OK(a.data)}}ZodUnknown.create=s=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(s)});class ZodNever extends ZodType{_parse(a){const u=this._getOrReturnCtx(a);return addIssueToContext(u,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:u.parsedType}),INVALID}}ZodNever.create=s=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(s)});class ZodVoid extends ZodType{_parse(a){if(this._getType(a)!==ZodParsedType.undefined){const l=this._getOrReturnCtx(a);return addIssueToContext(l,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:l.parsedType}),INVALID}return OK(a.data)}}ZodVoid.create=s=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(s)});class ZodArray extends ZodType{_parse(a){const{ctx:u,status:l}=this._processInputParams(a),f=this._def;if(u.parsedType!==ZodParsedType.array)return addIssueToContext(u,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:u.parsedType}),INVALID;if(f.exactLength!==null){const h=u.data.length>f.exactLength.value,p=u.data.length<f.exactLength.value;(h||p)&&(addIssueToContext(u,{code:h?ZodIssueCode.too_big:ZodIssueCode.too_small,minimum:p?f.exactLength.value:void 0,maximum:h?f.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:f.exactLength.message}),l.dirty())}if(f.minLength!==null&&u.data.length<f.minLength.value&&(addIssueToContext(u,{code:ZodIssueCode.too_small,minimum:f.minLength.value,type:"array",inclusive:!0,exact:!1,message:f.minLength.message}),l.dirty()),f.maxLength!==null&&u.data.length>f.maxLength.value&&(addIssueToContext(u,{code:ZodIssueCode.too_big,maximum:f.maxLength.value,type:"array",inclusive:!0,exact:!1,message:f.maxLength.message}),l.dirty()),u.common.async)return Promise.all([...u.data].map((h,p)=>f.type._parseAsync(new ParseInputLazyPath(u,h,u.path,p)))).then(h=>ParseStatus.mergeArray(l,h));const c=[...u.data].map((h,p)=>f.type._parseSync(new ParseInputLazyPath(u,h,u.path,p)));return ParseStatus.mergeArray(l,c)}get element(){return this._def.type}min(a,u){return new ZodArray({...this._def,minLength:{value:a,message:errorUtil.toString(u)}})}max(a,u){return new ZodArray({...this._def,maxLength:{value:a,message:errorUtil.toString(u)}})}length(a,u){return new ZodArray({...this._def,exactLength:{value:a,message:errorUtil.toString(u)}})}nonempty(a){return this.min(1,a)}}ZodArray.create=(s,a)=>new ZodArray({type:s,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(a)});function deepPartialify(s){if(s instanceof ZodObject){const a={};for(const u in s.shape){const l=s.shape[u];a[u]=ZodOptional.create(deepPartialify(l))}return new ZodObject({...s._def,shape:()=>a})}else return s instanceof ZodArray?new ZodArray({...s._def,type:deepPartialify(s.element)}):s instanceof ZodOptional?ZodOptional.create(deepPartialify(s.unwrap())):s instanceof ZodNullable?ZodNullable.create(deepPartialify(s.unwrap())):s instanceof ZodTuple?ZodTuple.create(s.items.map(a=>deepPartialify(a))):s}class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const a=this._def.shape(),u=util.objectKeys(a);return this._cached={shape:a,keys:u}}_parse(a){if(this._getType(a)!==ZodParsedType.object){const y=this._getOrReturnCtx(a);return addIssueToContext(y,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:y.parsedType}),INVALID}const{status:l,ctx:f}=this._processInputParams(a),{shape:c,keys:h}=this._getCached(),p=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip"))for(const y in f.data)h.includes(y)||p.push(y);const v=[];for(const y of h){const b=c[y],S=f.data[y];v.push({key:{status:"valid",value:y},value:b._parse(new ParseInputLazyPath(f,S,f.path,y)),alwaysSet:y in f.data})}if(this._def.catchall instanceof ZodNever){const y=this._def.unknownKeys;if(y==="passthrough")for(const b of p)v.push({key:{status:"valid",value:b},value:{status:"valid",value:f.data[b]}});else if(y==="strict")p.length>0&&(addIssueToContext(f,{code:ZodIssueCode.unrecognized_keys,keys:p}),l.dirty());else if(y!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const y=this._def.catchall;for(const b of p){const S=f.data[b];v.push({key:{status:"valid",value:b},value:y._parse(new ParseInputLazyPath(f,S,f.path,b)),alwaysSet:b in f.data})}}return f.common.async?Promise.resolve().then(async()=>{const y=[];for(const b of v){const S=await b.key,E=await b.value;y.push({key:S,value:E,alwaysSet:b.alwaysSet})}return y}).then(y=>ParseStatus.mergeObjectSync(l,y)):ParseStatus.mergeObjectSync(l,v)}get shape(){return this._def.shape()}strict(a){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...a!==void 0?{errorMap:(u,l)=>{var f,c,h,p;const v=(h=(c=(f=this._def).errorMap)===null||c===void 0?void 0:c.call(f,u,l).message)!==null&&h!==void 0?h:l.defaultError;return u.code==="unrecognized_keys"?{message:(p=errorUtil.errToObj(a).message)!==null&&p!==void 0?p:v}:{message:v}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(a){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...a})})}merge(a){return new ZodObject({unknownKeys:a._def.unknownKeys,catchall:a._def.catchall,shape:()=>({...this._def.shape(),...a._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(a,u){return this.augment({[a]:u})}catchall(a){return new ZodObject({...this._def,catchall:a})}pick(a){const u={};return util.objectKeys(a).forEach(l=>{a[l]&&this.shape[l]&&(u[l]=this.shape[l])}),new ZodObject({...this._def,shape:()=>u})}omit(a){const u={};return util.objectKeys(this.shape).forEach(l=>{a[l]||(u[l]=this.shape[l])}),new ZodObject({...this._def,shape:()=>u})}deepPartial(){return deepPartialify(this)}partial(a){const u={};return util.objectKeys(this.shape).forEach(l=>{const f=this.shape[l];a&&!a[l]?u[l]=f:u[l]=f.optional()}),new ZodObject({...this._def,shape:()=>u})}required(a){const u={};return util.objectKeys(this.shape).forEach(l=>{if(a&&!a[l])u[l]=this.shape[l];else{let c=this.shape[l];for(;c instanceof ZodOptional;)c=c._def.innerType;u[l]=c}}),new ZodObject({...this._def,shape:()=>u})}keyof(){return createZodEnum(util.objectKeys(this.shape))}}ZodObject.create=(s,a)=>new ZodObject({shape:()=>s,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(a)});ZodObject.strictCreate=(s,a)=>new ZodObject({shape:()=>s,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(a)});ZodObject.lazycreate=(s,a)=>new ZodObject({shape:s,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(a)});class ZodUnion extends ZodType{_parse(a){const{ctx:u}=this._processInputParams(a),l=this._def.options;function f(c){for(const p of c)if(p.result.status==="valid")return p.result;for(const p of c)if(p.result.status==="dirty")return u.common.issues.push(...p.ctx.common.issues),p.result;const h=c.map(p=>new ZodError(p.ctx.common.issues));return addIssueToContext(u,{code:ZodIssueCode.invalid_union,unionErrors:h}),INVALID}if(u.common.async)return Promise.all(l.map(async c=>{const h={...u,common:{...u.common,issues:[]},parent:null};return{result:await c._parseAsync({data:u.data,path:u.path,parent:h}),ctx:h}})).then(f);{let c;const h=[];for(const v of l){const y={...u,common:{...u.common,issues:[]},parent:null},b=v._parseSync({data:u.data,path:u.path,parent:y});if(b.status==="valid")return b;b.status==="dirty"&&!c&&(c={result:b,ctx:y}),y.common.issues.length&&h.push(y.common.issues)}if(c)return u.common.issues.push(...c.ctx.common.issues),c.result;const p=h.map(v=>new ZodError(v));return addIssueToContext(u,{code:ZodIssueCode.invalid_union,unionErrors:p}),INVALID}}get options(){return this._def.options}}ZodUnion.create=(s,a)=>new ZodUnion({options:s,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(a)});const getDiscriminator=s=>s instanceof ZodLazy?getDiscriminator(s.schema):s instanceof ZodEffects?getDiscriminator(s.innerType()):s instanceof ZodLiteral?[s.value]:s instanceof ZodEnum?s.options:s instanceof ZodNativeEnum?util.objectValues(s.enum):s instanceof ZodDefault?getDiscriminator(s._def.innerType):s instanceof ZodUndefined?[void 0]:s instanceof ZodNull?[null]:s instanceof ZodOptional?[void 0,...getDiscriminator(s.unwrap())]:s instanceof ZodNullable?[null,...getDiscriminator(s.unwrap())]:s instanceof ZodBranded||s instanceof ZodReadonly?getDiscriminator(s.unwrap()):s instanceof ZodCatch?getDiscriminator(s._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(a){const{ctx:u}=this._processInputParams(a);if(u.parsedType!==ZodParsedType.object)return addIssueToContext(u,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:u.parsedType}),INVALID;const l=this.discriminator,f=u.data[l],c=this.optionsMap.get(f);return c?u.common.async?c._parseAsync({data:u.data,path:u.path,parent:u}):c._parseSync({data:u.data,path:u.path,parent:u}):(addIssueToContext(u,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[l]}),INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(a,u,l){const f=new Map;for(const c of u){const h=getDiscriminator(c.shape[a]);if(!h.length)throw new Error(`A discriminator value for key \`${a}\` could not be extracted from all schema options`);for(const p of h){if(f.has(p))throw new Error(`Discriminator property ${String(a)} has duplicate value ${String(p)}`);f.set(p,c)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:a,options:u,optionsMap:f,...processCreateParams(l)})}}function mergeValues(s,a){const u=getParsedType(s),l=getParsedType(a);if(s===a)return{valid:!0,data:s};if(u===ZodParsedType.object&&l===ZodParsedType.object){const f=util.objectKeys(a),c=util.objectKeys(s).filter(p=>f.indexOf(p)!==-1),h={...s,...a};for(const p of c){const v=mergeValues(s[p],a[p]);if(!v.valid)return{valid:!1};h[p]=v.data}return{valid:!0,data:h}}else if(u===ZodParsedType.array&&l===ZodParsedType.array){if(s.length!==a.length)return{valid:!1};const f=[];for(let c=0;c<s.length;c++){const h=s[c],p=a[c],v=mergeValues(h,p);if(!v.valid)return{valid:!1};f.push(v.data)}return{valid:!0,data:f}}else return u===ZodParsedType.date&&l===ZodParsedType.date&&+s==+a?{valid:!0,data:s}:{valid:!1}}class ZodIntersection extends ZodType{_parse(a){const{status:u,ctx:l}=this._processInputParams(a),f=(c,h)=>{if(isAborted(c)||isAborted(h))return INVALID;const p=mergeValues(c.value,h.value);return p.valid?((isDirty(c)||isDirty(h))&&u.dirty(),{status:u.value,value:p.data}):(addIssueToContext(l,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return l.common.async?Promise.all([this._def.left._parseAsync({data:l.data,path:l.path,parent:l}),this._def.right._parseAsync({data:l.data,path:l.path,parent:l})]).then(([c,h])=>f(c,h)):f(this._def.left._parseSync({data:l.data,path:l.path,parent:l}),this._def.right._parseSync({data:l.data,path:l.path,parent:l}))}}ZodIntersection.create=(s,a,u)=>new ZodIntersection({left:s,right:a,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(u)});class ZodTuple extends ZodType{_parse(a){const{status:u,ctx:l}=this._processInputParams(a);if(l.parsedType!==ZodParsedType.array)return addIssueToContext(l,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:l.parsedType}),INVALID;if(l.data.length<this._def.items.length)return addIssueToContext(l,{code:ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),INVALID;!this._def.rest&&l.data.length>this._def.items.length&&(addIssueToContext(l,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),u.dirty());const c=[...l.data].map((h,p)=>{const v=this._def.items[p]||this._def.rest;return v?v._parse(new ParseInputLazyPath(l,h,l.path,p)):null}).filter(h=>!!h);return l.common.async?Promise.all(c).then(h=>ParseStatus.mergeArray(u,h)):ParseStatus.mergeArray(u,c)}get items(){return this._def.items}rest(a){return new ZodTuple({...this._def,rest:a})}}ZodTuple.create=(s,a)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:s,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(a)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(a){const{status:u,ctx:l}=this._processInputParams(a);if(l.parsedType!==ZodParsedType.object)return addIssueToContext(l,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:l.parsedType}),INVALID;const f=[],c=this._def.keyType,h=this._def.valueType;for(const p in l.data)f.push({key:c._parse(new ParseInputLazyPath(l,p,l.path,p)),value:h._parse(new ParseInputLazyPath(l,l.data[p],l.path,p)),alwaysSet:p in l.data});return l.common.async?ParseStatus.mergeObjectAsync(u,f):ParseStatus.mergeObjectSync(u,f)}get element(){return this._def.valueType}static create(a,u,l){return u instanceof ZodType?new ZodRecord({keyType:a,valueType:u,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(l)}):new ZodRecord({keyType:ZodString.create(),valueType:a,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(u)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(a){const{status:u,ctx:l}=this._processInputParams(a);if(l.parsedType!==ZodParsedType.map)return addIssueToContext(l,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:l.parsedType}),INVALID;const f=this._def.keyType,c=this._def.valueType,h=[...l.data.entries()].map(([p,v],y)=>({key:f._parse(new ParseInputLazyPath(l,p,l.path,[y,"key"])),value:c._parse(new ParseInputLazyPath(l,v,l.path,[y,"value"]))}));if(l.common.async){const p=new Map;return Promise.resolve().then(async()=>{for(const v of h){const y=await v.key,b=await v.value;if(y.status==="aborted"||b.status==="aborted")return INVALID;(y.status==="dirty"||b.status==="dirty")&&u.dirty(),p.set(y.value,b.value)}return{status:u.value,value:p}})}else{const p=new Map;for(const v of h){const y=v.key,b=v.value;if(y.status==="aborted"||b.status==="aborted")return INVALID;(y.status==="dirty"||b.status==="dirty")&&u.dirty(),p.set(y.value,b.value)}return{status:u.value,value:p}}}}ZodMap.create=(s,a,u)=>new ZodMap({valueType:a,keyType:s,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(u)});class ZodSet extends ZodType{_parse(a){const{status:u,ctx:l}=this._processInputParams(a);if(l.parsedType!==ZodParsedType.set)return addIssueToContext(l,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:l.parsedType}),INVALID;const f=this._def;f.minSize!==null&&l.data.size<f.minSize.value&&(addIssueToContext(l,{code:ZodIssueCode.too_small,minimum:f.minSize.value,type:"set",inclusive:!0,exact:!1,message:f.minSize.message}),u.dirty()),f.maxSize!==null&&l.data.size>f.maxSize.value&&(addIssueToContext(l,{code:ZodIssueCode.too_big,maximum:f.maxSize.value,type:"set",inclusive:!0,exact:!1,message:f.maxSize.message}),u.dirty());const c=this._def.valueType;function h(v){const y=new Set;for(const b of v){if(b.status==="aborted")return INVALID;b.status==="dirty"&&u.dirty(),y.add(b.value)}return{status:u.value,value:y}}const p=[...l.data.values()].map((v,y)=>c._parse(new ParseInputLazyPath(l,v,l.path,y)));return l.common.async?Promise.all(p).then(v=>h(v)):h(p)}min(a,u){return new ZodSet({...this._def,minSize:{value:a,message:errorUtil.toString(u)}})}max(a,u){return new ZodSet({...this._def,maxSize:{value:a,message:errorUtil.toString(u)}})}size(a,u){return this.min(a,u).max(a,u)}nonempty(a){return this.min(1,a)}}ZodSet.create=(s,a)=>new ZodSet({valueType:s,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(a)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(a){const{ctx:u}=this._processInputParams(a);if(u.parsedType!==ZodParsedType.function)return addIssueToContext(u,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:u.parsedType}),INVALID;function l(p,v){return makeIssue({data:p,path:u.path,errorMaps:[u.common.contextualErrorMap,u.schemaErrorMap,getErrorMap(),errorMap].filter(y=>!!y),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:v}})}function f(p,v){return makeIssue({data:p,path:u.path,errorMaps:[u.common.contextualErrorMap,u.schemaErrorMap,getErrorMap(),errorMap].filter(y=>!!y),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:v}})}const c={errorMap:u.common.contextualErrorMap},h=u.data;if(this._def.returns instanceof ZodPromise){const p=this;return OK(async function(...v){const y=new ZodError([]),b=await p._def.args.parseAsync(v,c).catch(R=>{throw y.addIssue(l(v,R)),y}),S=await Reflect.apply(h,this,b);return await p._def.returns._def.type.parseAsync(S,c).catch(R=>{throw y.addIssue(f(S,R)),y})})}else{const p=this;return OK(function(...v){const y=p._def.args.safeParse(v,c);if(!y.success)throw new ZodError([l(v,y.error)]);const b=Reflect.apply(h,this,y.data),S=p._def.returns.safeParse(b,c);if(!S.success)throw new ZodError([f(b,S.error)]);return S.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...a){return new ZodFunction({...this._def,args:ZodTuple.create(a).rest(ZodUnknown.create())})}returns(a){return new ZodFunction({...this._def,returns:a})}implement(a){return this.parse(a)}strictImplement(a){return this.parse(a)}static create(a,u,l){return new ZodFunction({args:a||ZodTuple.create([]).rest(ZodUnknown.create()),returns:u||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(l)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(a){const{ctx:u}=this._processInputParams(a);return this._def.getter()._parse({data:u.data,path:u.path,parent:u})}}ZodLazy.create=(s,a)=>new ZodLazy({getter:s,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(a)});class ZodLiteral extends ZodType{_parse(a){if(a.data!==this._def.value){const u=this._getOrReturnCtx(a);return addIssueToContext(u,{received:u.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:"valid",value:a.data}}get value(){return this._def.value}}ZodLiteral.create=(s,a)=>new ZodLiteral({value:s,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(a)});function createZodEnum(s,a){return new ZodEnum({values:s,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(a)})}class ZodEnum extends ZodType{constructor(){super(...arguments),_ZodEnum_cache.set(this,void 0)}_parse(a){if(typeof a.data!="string"){const u=this._getOrReturnCtx(a),l=this._def.values;return addIssueToContext(u,{expected:util.joinValues(l),received:u.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(__classPrivateFieldGet(this,_ZodEnum_cache)||__classPrivateFieldSet(this,_ZodEnum_cache,new Set(this._def.values)),!__classPrivateFieldGet(this,_ZodEnum_cache).has(a.data)){const u=this._getOrReturnCtx(a),l=this._def.values;return addIssueToContext(u,{received:u.data,code:ZodIssueCode.invalid_enum_value,options:l}),INVALID}return OK(a.data)}get options(){return this._def.values}get enum(){const a={};for(const u of this._def.values)a[u]=u;return a}get Values(){const a={};for(const u of this._def.values)a[u]=u;return a}get Enum(){const a={};for(const u of this._def.values)a[u]=u;return a}extract(a,u=this._def){return ZodEnum.create(a,{...this._def,...u})}exclude(a,u=this._def){return ZodEnum.create(this.options.filter(l=>!a.includes(l)),{...this._def,...u})}}_ZodEnum_cache=new WeakMap;ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{constructor(){super(...arguments),_ZodNativeEnum_cache.set(this,void 0)}_parse(a){const u=util.getValidEnumValues(this._def.values),l=this._getOrReturnCtx(a);if(l.parsedType!==ZodParsedType.string&&l.parsedType!==ZodParsedType.number){const f=util.objectValues(u);return addIssueToContext(l,{expected:util.joinValues(f),received:l.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(__classPrivateFieldGet(this,_ZodNativeEnum_cache)||__classPrivateFieldSet(this,_ZodNativeEnum_cache,new Set(util.getValidEnumValues(this._def.values))),!__classPrivateFieldGet(this,_ZodNativeEnum_cache).has(a.data)){const f=util.objectValues(u);return addIssueToContext(l,{received:l.data,code:ZodIssueCode.invalid_enum_value,options:f}),INVALID}return OK(a.data)}get enum(){return this._def.values}}_ZodNativeEnum_cache=new WeakMap;ZodNativeEnum.create=(s,a)=>new ZodNativeEnum({values:s,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(a)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(a){const{ctx:u}=this._processInputParams(a);if(u.parsedType!==ZodParsedType.promise&&u.common.async===!1)return addIssueToContext(u,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:u.parsedType}),INVALID;const l=u.parsedType===ZodParsedType.promise?u.data:Promise.resolve(u.data);return OK(l.then(f=>this._def.type.parseAsync(f,{path:u.path,errorMap:u.common.contextualErrorMap})))}}ZodPromise.create=(s,a)=>new ZodPromise({type:s,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(a)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(a){const{status:u,ctx:l}=this._processInputParams(a),f=this._def.effect||null,c={addIssue:h=>{addIssueToContext(l,h),h.fatal?u.abort():u.dirty()},get path(){return l.path}};if(c.addIssue=c.addIssue.bind(c),f.type==="preprocess"){const h=f.transform(l.data,c);if(l.common.async)return Promise.resolve(h).then(async p=>{if(u.value==="aborted")return INVALID;const v=await this._def.schema._parseAsync({data:p,path:l.path,parent:l});return v.status==="aborted"?INVALID:v.status==="dirty"||u.value==="dirty"?DIRTY(v.value):v});{if(u.value==="aborted")return INVALID;const p=this._def.schema._parseSync({data:h,path:l.path,parent:l});return p.status==="aborted"?INVALID:p.status==="dirty"||u.value==="dirty"?DIRTY(p.value):p}}if(f.type==="refinement"){const h=p=>{const v=f.refinement(p,c);if(l.common.async)return Promise.resolve(v);if(v instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return p};if(l.common.async===!1){const p=this._def.schema._parseSync({data:l.data,path:l.path,parent:l});return p.status==="aborted"?INVALID:(p.status==="dirty"&&u.dirty(),h(p.value),{status:u.value,value:p.value})}else return this._def.schema._parseAsync({data:l.data,path:l.path,parent:l}).then(p=>p.status==="aborted"?INVALID:(p.status==="dirty"&&u.dirty(),h(p.value).then(()=>({status:u.value,value:p.value}))))}if(f.type==="transform")if(l.common.async===!1){const h=this._def.schema._parseSync({data:l.data,path:l.path,parent:l});if(!isValid(h))return h;const p=f.transform(h.value,c);if(p instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:u.value,value:p}}else return this._def.schema._parseAsync({data:l.data,path:l.path,parent:l}).then(h=>isValid(h)?Promise.resolve(f.transform(h.value,c)).then(p=>({status:u.value,value:p})):h);util.assertNever(f)}}ZodEffects.create=(s,a,u)=>new ZodEffects({schema:s,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:a,...processCreateParams(u)});ZodEffects.createWithPreprocess=(s,a,u)=>new ZodEffects({schema:a,effect:{type:"preprocess",transform:s},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(u)});class ZodOptional extends ZodType{_parse(a){return this._getType(a)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(a)}unwrap(){return this._def.innerType}}ZodOptional.create=(s,a)=>new ZodOptional({innerType:s,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(a)});class ZodNullable extends ZodType{_parse(a){return this._getType(a)===ZodParsedType.null?OK(null):this._def.innerType._parse(a)}unwrap(){return this._def.innerType}}ZodNullable.create=(s,a)=>new ZodNullable({innerType:s,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(a)});class ZodDefault extends ZodType{_parse(a){const{ctx:u}=this._processInputParams(a);let l=u.data;return u.parsedType===ZodParsedType.undefined&&(l=this._def.defaultValue()),this._def.innerType._parse({data:l,path:u.path,parent:u})}removeDefault(){return this._def.innerType}}ZodDefault.create=(s,a)=>new ZodDefault({innerType:s,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof a.default=="function"?a.default:()=>a.default,...processCreateParams(a)});class ZodCatch extends ZodType{_parse(a){const{ctx:u}=this._processInputParams(a),l={...u,common:{...u.common,issues:[]}},f=this._def.innerType._parse({data:l.data,path:l.path,parent:{...l}});return isAsync(f)?f.then(c=>({status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new ZodError(l.common.issues)},input:l.data})})):{status:"valid",value:f.status==="valid"?f.value:this._def.catchValue({get error(){return new ZodError(l.common.issues)},input:l.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(s,a)=>new ZodCatch({innerType:s,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof a.catch=="function"?a.catch:()=>a.catch,...processCreateParams(a)});class ZodNaN extends ZodType{_parse(a){if(this._getType(a)!==ZodParsedType.nan){const l=this._getOrReturnCtx(a);return addIssueToContext(l,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:l.parsedType}),INVALID}return{status:"valid",value:a.data}}}ZodNaN.create=s=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(s)});const BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(a){const{ctx:u}=this._processInputParams(a),l=u.data;return this._def.type._parse({data:l,path:u.path,parent:u})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(a){const{status:u,ctx:l}=this._processInputParams(a);if(l.common.async)return(async()=>{const c=await this._def.in._parseAsync({data:l.data,path:l.path,parent:l});return c.status==="aborted"?INVALID:c.status==="dirty"?(u.dirty(),DIRTY(c.value)):this._def.out._parseAsync({data:c.value,path:l.path,parent:l})})();{const f=this._def.in._parseSync({data:l.data,path:l.path,parent:l});return f.status==="aborted"?INVALID:f.status==="dirty"?(u.dirty(),{status:"dirty",value:f.value}):this._def.out._parseSync({data:f.value,path:l.path,parent:l})}}static create(a,u){return new ZodPipeline({in:a,out:u,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(a){const u=this._def.innerType._parse(a),l=f=>(isValid(f)&&(f.value=Object.freeze(f.value)),f);return isAsync(u)?u.then(f=>l(f)):l(u)}unwrap(){return this._def.innerType}}ZodReadonly.create=(s,a)=>new ZodReadonly({innerType:s,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(a)});function custom(s,a={},u){return s?ZodAny.create().superRefine((l,f)=>{var c,h;if(!s(l)){const p=typeof a=="function"?a(l):typeof a=="string"?{message:a}:a,v=(h=(c=p.fatal)!==null&&c!==void 0?c:u)!==null&&h!==void 0?h:!0,y=typeof p=="string"?{message:p}:p;f.addIssue({code:"custom",...y,fatal:v})}}):ZodAny.create()}const late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const instanceOfType=(s,a={message:`Input not instance of ${s.name}`})=>custom(u=>u instanceof s,a),stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,ostring=()=>stringType().optional(),onumber=()=>numberType().optional(),oboolean=()=>booleanType().optional(),coerce={string:s=>ZodString.create({...s,coerce:!0}),number:s=>ZodNumber.create({...s,coerce:!0}),boolean:s=>ZodBoolean.create({...s,coerce:!0}),bigint:s=>ZodBigInt.create({...s,coerce:!0}),date:s=>ZodDate.create({...s,coerce:!0})},NEVER=INVALID;var z=Object.freeze({__proto__:null,defaultErrorMap:errorMap,setErrorMap,getErrorMap,makeIssue,EMPTY_PATH,addIssueToContext,ParseStatus,INVALID,DIRTY,OK,isAborted,isDirty,isValid,isAsync,get util(){return util},get objectUtil(){return objectUtil},ZodParsedType,getParsedType,ZodType,datetimeRegex,ZodString,ZodNumber,ZodBigInt,ZodBoolean,ZodDate,ZodSymbol,ZodUndefined,ZodNull,ZodAny,ZodUnknown,ZodNever,ZodVoid,ZodArray,ZodObject,ZodUnion,ZodDiscriminatedUnion,ZodIntersection,ZodTuple,ZodRecord,ZodMap,ZodSet,ZodFunction,ZodLazy,ZodLiteral,ZodEnum,ZodNativeEnum,ZodPromise,ZodEffects,ZodTransformer:ZodEffects,ZodOptional,ZodNullable,ZodDefault,ZodCatch,ZodNaN,BRAND,ZodBranded,ZodPipeline,ZodReadonly,custom,Schema:ZodType,ZodSchema:ZodType,late,get ZodFirstPartyTypeKind(){return ZodFirstPartyTypeKind},coerce,any:anyType,array:arrayType,bigint:bigIntType,boolean:booleanType,date:dateType,discriminatedUnion:discriminatedUnionType,effect:effectsType,enum:enumType,function:functionType,instanceof:instanceOfType,intersection:intersectionType,lazy:lazyType,literal:literalType,map:mapType,nan:nanType,nativeEnum:nativeEnumType,never:neverType,null:nullType,nullable:nullableType,number:numberType,object:objectType,oboolean,onumber,optional:optionalType,ostring,pipeline:pipelineType,preprocess:preprocessType,promise:promiseType,record:recordType,set:setType,strictObject:strictObjectType,string:stringType,symbol:symbolType,transformer:effectsType,tuple:tupleType,undefined:undefinedType,union:unionType,unknown:unknownType,void:voidType,NEVER,ZodIssueCode,quotelessJson,ZodError}),AddressSchema=z.object({address:z.string(),alias:z.string().optional()});z.object({standard:z.string().regex(/^fa1\.2$/i),contract:AddressSchema});z.object({standard:z.string().regex(/^fa2$/i),tokenId:z.string(),contract:AddressSchema});z.object({id:z.number(),standard:z.string().regex(/^fa2$/i),tokenId:z.string(),contract:AddressSchema,totalSupply:z.string().optional(),metadata:z.object({displayUri:z.string(),decimals:z.void().or(z.string().regex(/^0$/))})});var _baseRepeat,hasRequired_baseRepeat;function require_baseRepeat(){if(hasRequired_baseRepeat)return _baseRepeat;hasRequired_baseRepeat=1;var s=9007199254740991,a=Math.floor;function u(l,f){var c="";if(!l||f<1||f>s)return c;do f%2&&(c+=l),f=a(f/2),f&&(l+=l);while(f);return c}return _baseRepeat=u,_baseRepeat}var eq_1,hasRequiredEq;function requireEq(){if(hasRequiredEq)return eq_1;hasRequiredEq=1;function s(a,u){return a===u||a!==a&&u!==u}return eq_1=s,eq_1}var _freeGlobal,hasRequired_freeGlobal;function require_freeGlobal(){if(hasRequired_freeGlobal)return _freeGlobal;hasRequired_freeGlobal=1;var s=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal;return _freeGlobal=s,_freeGlobal}var _root,hasRequired_root;function require_root(){if(hasRequired_root)return _root;hasRequired_root=1;var s=require_freeGlobal(),a=typeof self=="object"&&self&&self.Object===Object&&self,u=s||a||Function("return this")();return _root=u,_root}var _Symbol,hasRequired_Symbol;function require_Symbol(){if(hasRequired_Symbol)return _Symbol;hasRequired_Symbol=1;var s=require_root(),a=s.Symbol;return _Symbol=a,_Symbol}var _getRawTag,hasRequired_getRawTag;function require_getRawTag(){if(hasRequired_getRawTag)return _getRawTag;hasRequired_getRawTag=1;var s=require_Symbol(),a=Object.prototype,u=a.hasOwnProperty,l=a.toString,f=s?s.toStringTag:void 0;function c(h){var p=u.call(h,f),v=h[f];try{h[f]=void 0;var y=!0}catch{}var b=l.call(h);return y&&(p?h[f]=v:delete h[f]),b}return _getRawTag=c,_getRawTag}var _objectToString,hasRequired_objectToString;function require_objectToString(){if(hasRequired_objectToString)return _objectToString;hasRequired_objectToString=1;var s=Object.prototype,a=s.toString;function u(l){return a.call(l)}return _objectToString=u,_objectToString}var _baseGetTag,hasRequired_baseGetTag;function require_baseGetTag(){if(hasRequired_baseGetTag)return _baseGetTag;hasRequired_baseGetTag=1;var s=require_Symbol(),a=require_getRawTag(),u=require_objectToString(),l="[object Null]",f="[object Undefined]",c=s?s.toStringTag:void 0;function h(p){return p==null?p===void 0?f:l:c&&c in Object(p)?a(p):u(p)}return _baseGetTag=h,_baseGetTag}var isObject_1,hasRequiredIsObject;function requireIsObject(){if(hasRequiredIsObject)return isObject_1;hasRequiredIsObject=1;function s(a){var u=typeof a;return a!=null&&(u=="object"||u=="function")}return isObject_1=s,isObject_1}var isFunction_1,hasRequiredIsFunction;function requireIsFunction(){if(hasRequiredIsFunction)return isFunction_1;hasRequiredIsFunction=1;var s=require_baseGetTag(),a=requireIsObject(),u="[object AsyncFunction]",l="[object Function]",f="[object GeneratorFunction]",c="[object Proxy]";function h(p){if(!a(p))return!1;var v=s(p);return v==l||v==f||v==u||v==c}return isFunction_1=h,isFunction_1}var isLength_1,hasRequiredIsLength;function requireIsLength(){if(hasRequiredIsLength)return isLength_1;hasRequiredIsLength=1;var s=9007199254740991;function a(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=s}return isLength_1=a,isLength_1}var isArrayLike_1,hasRequiredIsArrayLike;function requireIsArrayLike(){if(hasRequiredIsArrayLike)return isArrayLike_1;hasRequiredIsArrayLike=1;var s=requireIsFunction(),a=requireIsLength();function u(l){return l!=null&&a(l.length)&&!s(l)}return isArrayLike_1=u,isArrayLike_1}var _isIndex,hasRequired_isIndex;function require_isIndex(){if(hasRequired_isIndex)return _isIndex;hasRequired_isIndex=1;var s=9007199254740991,a=/^(?:0|[1-9]\d*)$/;function u(l,f){var c=typeof l;return f=f??s,!!f&&(c=="number"||c!="symbol"&&a.test(l))&&l>-1&&l%1==0&&l<f}return _isIndex=u,_isIndex}var _isIterateeCall,hasRequired_isIterateeCall;function require_isIterateeCall(){if(hasRequired_isIterateeCall)return _isIterateeCall;hasRequired_isIterateeCall=1;var s=requireEq(),a=requireIsArrayLike(),u=require_isIndex(),l=requireIsObject();function f(c,h,p){if(!l(p))return!1;var v=typeof h;return(v=="number"?a(p)&&u(h,p.length):v=="string"&&h in p)?s(p[h],c):!1}return _isIterateeCall=f,_isIterateeCall}var _trimmedEndIndex,hasRequired_trimmedEndIndex;function require_trimmedEndIndex(){if(hasRequired_trimmedEndIndex)return _trimmedEndIndex;hasRequired_trimmedEndIndex=1;var s=/\s/;function a(u){for(var l=u.length;l--&&s.test(u.charAt(l)););return l}return _trimmedEndIndex=a,_trimmedEndIndex}var _baseTrim,hasRequired_baseTrim;function require_baseTrim(){if(hasRequired_baseTrim)return _baseTrim;hasRequired_baseTrim=1;var s=require_trimmedEndIndex(),a=/^\s+/;function u(l){return l&&l.slice(0,s(l)+1).replace(a,"")}return _baseTrim=u,_baseTrim}var isObjectLike_1,hasRequiredIsObjectLike;function requireIsObjectLike(){if(hasRequiredIsObjectLike)return isObjectLike_1;hasRequiredIsObjectLike=1;function s(a){return a!=null&&typeof a=="object"}return isObjectLike_1=s,isObjectLike_1}var isSymbol_1,hasRequiredIsSymbol;function requireIsSymbol(){if(hasRequiredIsSymbol)return isSymbol_1;hasRequiredIsSymbol=1;var s=require_baseGetTag(),a=requireIsObjectLike(),u="[object Symbol]";function l(f){return typeof f=="symbol"||a(f)&&s(f)==u}return isSymbol_1=l,isSymbol_1}var toNumber_1,hasRequiredToNumber;function requireToNumber(){if(hasRequiredToNumber)return toNumber_1;hasRequiredToNumber=1;var s=require_baseTrim(),a=requireIsObject(),u=requireIsSymbol(),l=NaN,f=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,h=/^0o[0-7]+$/i,p=parseInt;function v(y){if(typeof y=="number")return y;if(u(y))return l;if(a(y)){var b=typeof y.valueOf=="function"?y.valueOf():y;y=a(b)?b+"":b}if(typeof y!="string")return y===0?y:+y;y=s(y);var S=c.test(y);return S||h.test(y)?p(y.slice(2),S?2:8):f.test(y)?l:+y}return toNumber_1=v,toNumber_1}var toFinite_1,hasRequiredToFinite;function requireToFinite(){if(hasRequiredToFinite)return toFinite_1;hasRequiredToFinite=1;var s=requireToNumber(),a=1/0,u=17976931348623157e292;function l(f){if(!f)return f===0?f:0;if(f=s(f),f===a||f===-a){var c=f<0?-1:1;return c*u}return f===f?f:0}return toFinite_1=l,toFinite_1}var toInteger_1,hasRequiredToInteger;function requireToInteger(){if(hasRequiredToInteger)return toInteger_1;hasRequiredToInteger=1;var s=requireToFinite();function a(u){var l=s(u),f=l%1;return l===l?f?l-f:l:0}return toInteger_1=a,toInteger_1}var _arrayMap,hasRequired_arrayMap;function require_arrayMap(){if(hasRequired_arrayMap)return _arrayMap;hasRequired_arrayMap=1;function s(a,u){for(var l=-1,f=a==null?0:a.length,c=Array(f);++l<f;)c[l]=u(a[l],l,a);return c}return _arrayMap=s,_arrayMap}var isArray_1,hasRequiredIsArray;function requireIsArray(){if(hasRequiredIsArray)return isArray_1;hasRequiredIsArray=1;var s=Array.isArray;return isArray_1=s,isArray_1}var _baseToString,hasRequired_baseToString;function require_baseToString(){if(hasRequired_baseToString)return _baseToString;hasRequired_baseToString=1;var s=require_Symbol(),a=require_arrayMap(),u=requireIsArray(),l=requireIsSymbol(),f=1/0,c=s?s.prototype:void 0,h=c?c.toString:void 0;function p(v){if(typeof v=="string")return v;if(u(v))return a(v,p)+"";if(l(v))return h?h.call(v):"";var y=v+"";return y=="0"&&1/v==-f?"-0":y}return _baseToString=p,_baseToString}var toString_1,hasRequiredToString;function requireToString(){if(hasRequiredToString)return toString_1;hasRequiredToString=1;var s=require_baseToString();function a(u){return u==null?"":s(u)}return toString_1=a,toString_1}var repeat_1,hasRequiredRepeat;function requireRepeat(){if(hasRequiredRepeat)return repeat_1;hasRequiredRepeat=1;var s=require_baseRepeat(),a=require_isIterateeCall(),u=requireToInteger(),l=requireToString();function f(c,h,p){return(p?a(c,h,p):h===void 0)?h=1:h=u(h),s(l(c),h)}return repeat_1=f,repeat_1}requireRepeat();var totalFee=s=>s.map(a=>a.fee).reduce((a,u)=>a.plus(u),BigNumber(0)).toNumber(),CustomError2=class extends Error{constructor(s){super(s),this.name="CustomError"}},decodeBeaconPayload=(s,a)=>{try{if(!s.length)return{result:""};let u=s;switch(a){case SigningType.MICHELINE:case SigningType.OPERATION:{if(getSigningTypeFromPayload(s)!==a)throw new CustomError2("Invalid prefix for signing type");try{const l=Uint8ArrayConsumer.fromHexString(s),f=l.consume(l.length()),c=unpackData(f);"string"in c&&Object.keys(c).length===1?u=c.string:u=JSON.stringify(c)}catch{const l=a===SigningType.MICHELINE?12:2;if(u=bytesToString(s.slice(l)),u.length===0)throw new CustomError2("Invalid payload. Failed to decode.")}break}case SigningType.RAW:{try{u=JSON.stringify(parseOperationMicheline(s))}catch{u=new TextDecoder("utf-8",{fatal:!0}).decode(hex2buf(s))}break}default:throw new CustomError2(`Unsupported signing type: ${a}`)}if(!isValidASCII(u))throw new CustomError2("Invalid payload. Only ASCII characters are supported.");return{result:u}}catch(u){return console.error(u),{result:s,error:"Cannot parse Beacon payload"}}},isValidASCII=s=>s.split("").every(a=>a.charCodeAt(0)<128),parseOperationMicheline=s=>getCodec(CODEC.MANAGER).decoder(s),getSigningTypeFromPayload=s=>s.startsWith("05")?SigningType.MICHELINE:s.startsWith("03")?SigningType.OPERATION:SigningType.RAW,LAMBDA_HEADER=[{prim:"DROP"},{prim:"NIL",args:[{prim:"operation"}]}],makeMultisigProposeOperation=(s,a)=>{const u=toBatchLambda(a);return makeContractCallOperation(s,"propose",u)},makeContractCallOperation=(s,a,u,l="0")=>({type:"contract_call",contract:s,entrypoint:a,args:u,amount:l}),headlessLambda=s=>lodashExports.isEqual(s.slice(0,2),LAMBDA_HEADER)?s.slice(2):s,toLambda=s=>{switch(s.type){case"tez":switch(s.recipient.type){case"implicit":return MANAGER_LAMBDA.transferImplicit(s.recipient.pkh,Number(s.amount));case"contract":return MANAGER_LAMBDA.transferToContract(s.recipient.pkh,Number(s.amount));default:throw new CustomError(`${s.recipient.type} is not supported yet`)}case"fa1.2":return contractLambda(s,FA12_TRANSFER_ARG_TYPES,makeFA12TransactionParameter(s));case"fa2":return contractLambda(s,FA2_TRANSFER_ARG_TYPES,makeFA2TransactionParameter(s));case"delegation":return MANAGER_LAMBDA.setDelegate(s.recipient.pkh);case"undelegation":return MANAGER_LAMBDA.removeDelegate();case"contract_origination":case"contract_call":case"stake":case"unstake":case"finalize_unstake":throw new CustomError(`${s.type} is not supported yet`)}},toBatchLambda=s=>{const a=s.map(toLambda).flatMap(headlessLambda);return[...LAMBDA_HEADER,...a]},FA2_TRANSFER_ARG_TYPES={args:[{args:[{annots:["%from_"],prim:"address"},{annots:["%txs"],args:[{args:[{annots:["%to_"],prim:"address"},{args:[{annots:["%token_id"],prim:"nat"},{annots:["%amount"],prim:"nat"}],prim:"pair"}],prim:"pair"}],prim:"list"}],prim:"pair"}],prim:"list"},FA12_TRANSFER_ARG_TYPES={args:[{annots:[":from"],prim:"address"},{args:[{annots:[":to"],prim:"address"},{annots:[":value"],prim:"nat"}],prim:"pair"}],prim:"pair"},contractLambda=(s,a,u)=>[...LAMBDA_HEADER,{prim:"PUSH",args:[{prim:"address"},{string:s.contract.pkh+"%"+u.entrypoint}]},{prim:"CONTRACT",args:[a]},[{prim:"IF_NONE",args:[[{prim:"UNIT"},{prim:"FAILWITH"}],[]]}],{prim:"PUSH",args:[{prim:"mutez"},{int:"0"}]},{prim:"PUSH",args:[a,u.value]},{prim:"TRANSFER_TOKENS"},{prim:"CONS"}],makeFA12TransactionParameter=({sender:s,recipient:a,amount:u})=>({entrypoint:"transfer",value:{prim:"Pair",args:[{string:s.pkh},{prim:"Pair",args:[{string:a.pkh},{int:u}]}]}}),makeFA2TransactionParameter=({sender:s,recipient:a,tokenId:u,amount:l})=>({entrypoint:"transfer",value:[{prim:"Pair",args:[{string:s.pkh},[{prim:"Pair",args:[{string:a.pkh},{prim:"Pair",args:[{int:u},{int:l}]}]}]]}]}),operationToTaquitoOperation=s=>{switch(s.type){case"tez":return{kind:OpKind.TRANSACTION,to:s.recipient.pkh,amount:parseInt(s.amount),mutez:!0};case"contract_call":return{kind:OpKind.TRANSACTION,to:s.contract.pkh,amount:parseInt(s.amount),mutez:!0,parameter:{entrypoint:s.entrypoint,value:s.args}};case"delegation":return{kind:OpKind.DELEGATION,source:s.sender.pkh,delegate:s.recipient.pkh};case"undelegation":return{kind:OpKind.DELEGATION,source:s.sender.pkh,delegate:void 0};case"fa1.2":return{kind:OpKind.TRANSACTION,amount:0,to:s.contract.pkh,parameter:makeFA12TransactionParameter(s)};case"fa2":return{kind:OpKind.TRANSACTION,amount:0,to:s.contract.pkh,parameter:makeFA2TransactionParameter(s)};case"contract_origination":return isValidMichelson(s.storage)?{kind:OpKind.ORIGINATION,code:s.code,init:s.storage}:{kind:OpKind.ORIGINATION,code:s.code,storage:s.storage};case"stake":return{kind:OpKind.TRANSACTION,amount:parseInt(s.amount),source:s.sender.pkh,to:s.sender.pkh,parameter:{entrypoint:"stake",value:{prim:"Unit"}},mutez:!0};case"unstake":return{kind:OpKind.TRANSACTION,amount:parseInt(s.amount),source:s.sender.pkh,to:s.sender.pkh,parameter:{entrypoint:"unstake",value:{prim:"Unit"}},mutez:!0};case"finalize_unstake":return{kind:OpKind.TRANSACTION,amount:0,source:s.sender.pkh,to:s.sender.pkh,parameter:{entrypoint:"finalize_unstake",value:{prim:"Unit"}}}}},operationsToBatchParams=({type:s,operations:a,sender:u})=>(s==="implicit"?a:[makeMultisigProposeOperation(u.address,a)]).map(operationToTaquitoOperation),operationsToWalletParams=s=>lodashExports.zipWith(operationsToBatchParams(s),s.estimates,(a,u)=>({...a,...u})),estimate=async(s,a)=>{const u=await makeToolkit({type:"fake",signer:s.signer,network:a});try{const l=await u.estimate.batch(operationsToBatchParams(s));let f;return l.length>s.operations.length&&(f=estimateToEstimation(l.shift())),{...s,estimates:l.map(estimateToEstimation),revealEstimate:f}}catch(l){throw await isAccountRevealed(s.signer.address.pkh,a)?l:new CustomError2(`Signer address is not revealed on the ${a.name}.`)}},estimateToEstimation=s=>({storageLimit:s.storageLimit,gasLimit:s.gasLimit,fee:Math.max(s.suggestedFeeMutez,s.totalCost)}),executeOperations=async(s,a)=>{const u=operationsToWalletParams(s);return a.wallet.batch(u).send()},toAccountOperations=(s,a)=>{if(s.length===0)throw new CustomError("Empty operation details!");const u=s.map(l=>partialOperationToOperation(l,a));return{type:"implicit",sender:a,operations:u,signer:a}},partialOperationToOperation=(s,a)=>{switch(s.kind){case TezosOperationType.TRANSACTION:{const{destination:u,amount:l,parameters:f}=s;if(f){if(isValidImplicitPkh(u))switch(f.entrypoint){case"stake":return{type:"stake",amount:l,sender:parseImplicitPkh(u)};case"unstake":return{type:"unstake",amount:l,sender:parseImplicitPkh(u)};case"finalize_unstake":return{type:"finalize_unstake",sender:parseImplicitPkh(u)}}return{type:"contract_call",amount:l,contract:parsePkh(u),entrypoint:f.entrypoint,args:f.value}}return{type:"tez",amount:l,recipient:parseImplicitPkh(s.destination)}}case TezosOperationType.DELEGATION:{const{delegate:u}=s;return u?{type:"delegation",sender:a.address,recipient:parseImplicitPkh(u)}:{type:"undelegation",sender:a.address}}case TezosOperationType.ORIGINATION:{const{script:u}=s,{code:l,storage:f}=u;return{type:"contract_origination",sender:a.address,code:l,storage:f}}default:throw new CustomError(`Unsupported operation kind: ${s.kind}`)}};const OperationModalContext=reactExports.createContext(void 0),OperationModalProvider=({children:s})=>{const{isOpen:a,onOpen:u,onClose:l}=useDisclosure(),[f,c]=reactExports.useState(!1),[h,p]=reactExports.useState(null);return jsxRuntimeExports.jsx(OperationModalContext.Provider,{value:{isOpen:a,onOpen:u,onClose:l,isLoading:f,setIsLoading:c,estimatedOperations:h,setEstimatedOperations:p},children:s})},useOperationModalContext=()=>{const s=reactExports.useContext(OperationModalContext);if(s===void 0)throw new Error("useOperationModalContext must be used within a OperationModalProvider");return s},SIGN_TIMEOUT$1=5*60*1e3,OperationModalContent=()=>{const{onClose:s,setIsLoading:a,estimatedOperations:u}=useOperationModalContext(),{getNetwork:l,getUserData:f,getDAppOrigin:c}=useEmbedApp(),h=useColor(),p=getDAppByOrigin(c()),v=async()=>{a(!0);try{const{secretKey:y}=await withTimeout(async()=>forIDP(f().typeOfLogin).getCredentials(),SIGN_TIMEOUT$1),b=await makeToolkit({type:"social",secretKey:y,network:toTezosNetwork(l())}),{opHash:S}=await executeOperations(u,b);console.log("request sent",S),sendResponse({type:"operation_response",opHash:S})}catch(y){sendOperationErrorResponse(getErrorContext$1(y).description)}finally{a(!1),s()}};return jsxRuntimeExports.jsxs(VStack,{spacing:"0",children:[jsxRuntimeExports.jsx(Box,{marginBottom:"10px",children:jsxRuntimeExports.jsx(UmamiLogoIcon,{})}),jsxRuntimeExports.jsx(Heading,{marginBottom:"10px",fontSize:"16px",lineHeight:"22px",children:"Confirm Operation"}),jsxRuntimeExports.jsx(Flex,{justifyContent:"center",marginBottom:"16px",children:jsxRuntimeExports.jsxs(Text,{color:h("900"),size:"sm",lineHeight:"14px",textAlign:"center",children:[jsxRuntimeExports.jsx(Text,{as:"span",children:p||c()}),jsxRuntimeExports.jsx(Text,{as:"span",color:h("500"),marginLeft:"5px",children:"is requesting permission to sign this operation"})]})}),jsxRuntimeExports.jsx(Accordion,{allowToggle:!0,width:"100%",marginBottom:"10px",children:jsxRuntimeExports.jsxs(AccordionItem,{border:"none",children:[jsxRuntimeExports.jsxs(AccordionButton,{children:[jsxRuntimeExports.jsx(Heading,{flex:"1",textAlign:"left",paddingY:"6px",size:"sm",children:"Show Details"}),jsxRuntimeExports.jsx(AccordionIcon,{})]}),jsxRuntimeExports.jsxs(AccordionPanel,{width:"100%",children:[jsxRuntimeExports.jsx(JsValueWrap,{background:h("100"),overflowY:"auto",maxHeight:"200px",value:u.operations,marginBottom:"16px"}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",children:[jsxRuntimeExports.jsxs(Flex,{marginRight:"110px",children:[jsxRuntimeExports.jsx(Text,{marginRight:"4px",color:h("500"),size:"xs",children:"Count:"}),jsxRuntimeExports.jsx(Text,{color:h("900"),"data-testid":"transaction-length",size:"xs",children:u.operations.length})]}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",marginBottom:"5px",children:[jsxRuntimeExports.jsx(Text,{marginRight:"4px",color:h("500"),size:"xs",children:"Fee:"}),jsxRuntimeExports.jsx(Text,{color:h("900"),"data-testid":"fee",size:"xs",children:prettyTezAmount(totalFee(u.estimates))})]})]}),jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",children:[jsxRuntimeExports.jsx(Text,{color:h("500"),size:"xs",lineHeight:"14px",marginRight:"5px",children:"Network:"}),jsxRuntimeExports.jsx(Text,{color:h("900"),size:"xs",lineHeight:"14px",children:l()})]})]})]})}),jsxRuntimeExports.jsx(LoginButtonComponent,{loginType:f().typeOfLogin,prefix:"Confirm with",onClick:v})]})},useOperationModal=()=>{const{isOpen:s,onOpen:a,onClose:u,isLoading:l,setEstimatedOperations:f}=useOperationModalContext(),{getNetwork:c,getUserData:h}=useEmbedApp(),p=()=>{sendOperationErrorResponse("User closed the modal"),u()};return{modalElement:jsxRuntimeExports.jsx(Center,{children:jsxRuntimeExports.jsx(Modal,{autoFocus:!1,closeOnOverlayClick:!1,isCentered:!0,isOpen:s,onClose:u,children:jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsx(ModalCloseButton,{onClick:p}),jsxRuntimeExports.jsx(OperationModalContent,{}),l&&jsxRuntimeExports.jsx(ModalLoadingOverlay,{})]})})}),onOpen:async v=>{try{const y=toAccountOperations(v,toSocialAccount(h())),b=await estimate(y,toTezosNetwork(c()));f(b),a(),sendResponse({type:"computation_completed_response"})}catch(y){sendComputationErrorResponse(getErrorContext(y).description),u()}}}},SignPayloadModalContext=reactExports.createContext(void 0),SignPayloadModalProvider=({children:s})=>{const{isOpen:a,onOpen:u,onClose:l}=useDisclosure(),[f,c]=reactExports.useState(!1),[h,p]=reactExports.useState(null),[v,y]=reactExports.useState(null);return jsxRuntimeExports.jsx(SignPayloadModalContext.Provider,{value:{isOpen:a,onOpen:u,onClose:l,isLoading:f,setIsLoading:c,signingType:h,setSigningType:p,payload:v,setPayload:y},children:s})},useSignPayloadModalContext=()=>{const s=reactExports.useContext(SignPayloadModalContext);if(s===void 0)throw new Error("useSignPayloadModalContext must be used within a SignPayloadModalProvider");return s},WarningIcon=createIcon({d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z",displayName:"WarningIcon"}),SIGN_TIMEOUT=5*60*1e3,SignPayloadModalContent=()=>{const[s,a]=reactExports.useState(!1),{onClose:u,setIsLoading:l,signingType:f,payload:c}=useSignPayloadModalContext(),{getNetwork:h,getUserData:p,getDAppOrigin:v}=useEmbedApp(),{result:y,error:b}=decodeBeaconPayload(c,f),S=useColor(),E=getDAppByOrigin(v()),R=async()=>{l(!0);try{const{secretKey:O}=await withTimeout(async()=>forIDP(p().typeOfLogin).getCredentials(),SIGN_TIMEOUT),B=await(await makeToolkit({type:"social",secretKey:O,network:toTezosNetwork(h())})).signer.sign(c);sendResponse({type:"sign_response",signingType:f,signature:B.prefixSig})}catch(O){sendOperationErrorResponse(getErrorContext$1(O).description)}finally{l(!1),u()}};return jsxRuntimeExports.jsxs(VStack,{spacing:"0",children:[jsxRuntimeExports.jsx(Box,{marginBottom:"10px",children:jsxRuntimeExports.jsx(UmamiLogoIcon,{})}),jsxRuntimeExports.jsx(Heading,{marginBottom:"10px",fontSize:"16px",lineHeight:"22px",children:"Sign Payload"}),jsxRuntimeExports.jsx(Flex,{justifyContent:"center",marginBottom:"16px",children:jsxRuntimeExports.jsxs(Text,{color:S("900"),size:"sm",lineHeight:"14px",textAlign:"center",children:[jsxRuntimeExports.jsx(Text,{as:"span",children:E||v()}),jsxRuntimeExports.jsx(Text,{as:"span",color:S("500"),marginLeft:"5px",children:"is requesting permission to sign this payload"})]})}),jsxRuntimeExports.jsxs(Box,{width:"100%",marginBottom:"20px",overflowY:"auto",maxHeight:"200px",padding:"16px",borderRadius:"5px",backgroundColor:S("100"),children:[jsxRuntimeExports.jsx(Text,{size:"sm",children:s?c:y.trim()}),b&&jsxRuntimeExports.jsxs(Flex,{alignItems:"center",gap:"4px",marginTop:"4px",children:[jsxRuntimeExports.jsx(WarningIcon,{width:"15px",height:"15px"}),jsxRuntimeExports.jsx(Text,{color:"red",size:"xs",children:"Raw Payload. Parsing failed"})]})]}),!b&&jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"flex-end",gap:"4px",marginBottom:"20px",ml:"auto",children:[jsxRuntimeExports.jsx(Text,{children:"Raw"}),jsxRuntimeExports.jsx(Switch,{onChange:()=>a(O=>!O)})]}),jsxRuntimeExports.jsx(LoginButtonComponent,{loginType:p().typeOfLogin,prefix:"Sign with",onClick:R})]})},useSignPayloadModal=()=>{const{isOpen:s,onOpen:a,onClose:u,isLoading:l,setSigningType:f,setPayload:c}=useSignPayloadModalContext(),h=()=>{sendSignPayloadErrorResponse("User closed the modal"),u()};return{modalElement:jsxRuntimeExports.jsx(Center,{children:jsxRuntimeExports.jsx(Modal,{autoFocus:!1,closeOnOverlayClick:!1,isCentered:!0,isOpen:s,onClose:u,children:jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsx(ModalCloseButton,{onClick:h}),jsxRuntimeExports.jsx(SignPayloadModalContent,{}),l&&jsxRuntimeExports.jsx(ModalLoadingOverlay,{})]})})}),onOpen:(p,v)=>{f(p),c(v),a()}}},ENVIRONMENT="ghostnet";function EmbeddedComponent(){const{getNetwork:s,getUserData:a,setNetwork:u,setUserData:l,setLoginOptions:f,setDAppOrigin:c}=useEmbedApp(),{setColorMode:h}=useColorMode(),{onOpen:p,modalElement:v}=useLoginModal(),{onOpen:y,modalElement:b}=useOperationModal(),{onOpen:S,modalElement:E}=useSignPayloadModal();reactExports.useEffect(()=>{if(window.addEventListener)window.addEventListener("message",R,!1);else if(window.attachEvent)window.attachEvent("onmessage",R);else throw new Error("Umami-embed does not support this browser");return a()!==null?sendResponse({type:"init_complete",userData:a()}):sendResponse({type:"init_complete"}),()=>{window.removeEventListener?window.removeEventListener("message",R,!1):window.detachEvent&&window.detachEvent("onmessage",R)}},[]);const R=D=>{try{const G=JSON.parse(D.data);if(console.log(`Received ${D.data} from ${D.origin}`),!I(D.origin,G))return;switch(c(D.origin),G.type){case"config_request":O(G.config),sendResponse({type:"config_response"});break;case"login_request":a()!==null?sendResponse({type:"login_response",error:"user_already_logged_in",errorMessage:"UserData is already available"}):p();break;case"logout_request":l(null),sendResponse({type:"logout_response"});break;case"operation_request":B(G.type)&&y(G.operations);break;case"sign_request":B(G.type)&&S(G.signingType,G.payload)}}catch{}},O=D=>{u(D.network),D.loginOptions&&(D.loginOptions.length===0&&sendResponse({type:"config_response",error:"empty_login_options",errorMessage:"Login options must include at least one login type value."}),f(D.loginOptions),a()!==null&&!D.loginOptions.includes(a().typeOfLogin)&&l(null)),h(D.theme??"light")},I=(D,G)=>{if(G.type==="config_request")return N(G.config.network,G.type);if(s()===null)return sendResponse({type:toMatchingResponseType(G.type),error:"no_network_data",errorMessage:"Network data is not available. Try restarting the component."}),!1;if(s()==="ghostnet")return!0;if(!N(s(),G.type))return!1;const V=getPermissionsForOrigin(D);if(!V)return console.error(`No permissions for origin (${D})`),sendResponse({type:toMatchingResponseType(G.type),error:"no_permissions",errorMessage:"No permissions found for given origin"}),!1;switch(G.type){case"login_request":case"logout_request":if(!V.login)return sendResponse({type:toMatchingResponseType(G.type),error:"no_permissions",errorMessage:"No permissions found for login actions"}),!1;break;case"operation_request":if(!V.operations)return sendResponse({type:toMatchingResponseType(G.type),error:"no_permissions",errorMessage:"No permissions found for operation actions"}),!1;break;case"sign_request":if(!V.signPayload)return sendResponse({type:toMatchingResponseType(G.type),error:"no_permissions",errorMessage:"No permissions found for sign actions"}),!1}return!0},B=D=>a()===null?(sendResponse({type:toMatchingResponseType(D),error:"no_login_data",errorMessage:"User's login data is not available. Please login first."}),!1):s()===null?(sendResponse({type:toMatchingResponseType(D),error:"no_network_data",errorMessage:"Network data is not available. Try restarting the component."}),!1):!0,N=(D,G)=>D==="mainnet"&&ENVIRONMENT!=="mainnet"?(sendResponse({type:toMatchingResponseType(G),error:"invalid_network",errorMessage:"Mainnet is not supported in this environment"}),!1):!0;return jsxRuntimeExports.jsxs(Box,{className:"embedded-component",children:[v,b,E]})}const config={initialColorMode:"light",useSystemColorMode:!1},sizes={xs:{fontSize:"12px"},sm:{fontSize:"14px"},md:{fontSize:"16px"},lg:{fontSize:"18px"},xl:{fontSize:"20px"},"2xl":{fontSize:"24px"},"3xl":{fontSize:"30px"},"4xl":{fontSize:"36px"},"5xl":{fontSize:"48px"},"6xl":{fontSize:"69px"}},theme=extendTheme({components:{Text:{baseStyle:s=>({fontWeight:"400",fontFamily:"Inter",color:mode(light.grey[900],dark.grey[900])(s)}),sizes},Heading:{baseStyle:s=>({fontWeight:"600",fontFamily:"Inter",color:mode(light.grey[900],dark.grey[900])(s)}),sizes},Button:{sizes:{md:{height:"38px",fontSize:"14px",minWidth:"38px"},lg:{height:"48px",fontSize:"16px",minWidth:"48px"}},variants:{primary:s=>({bg:mode(light.grey.white,dark.grey.white)(s),border:"1.5px solid",borderColor:mode(light.grey[100],dark.grey[100])(s),_hover:{border:"1.5px solid",borderColor:mode(light.grey[100],dark.grey[100])(s),bg:mode(light.grey[100],dark.grey[100])(s)}})},defaultProps:{variant:"primary",size:"md"}},Modal:{baseStyle:s=>({dialog:{padding:{base:"36px",lg:"42px"},background:mode(light.grey.white,dark.grey.white)(s),border:"1.5px solid",borderTopRightRadius:"30px",borderTopLeftRadius:"30px",borderBottomRightRadius:{lg:"30px",base:0},borderBottomLeftRadius:{lg:"30px",base:0},borderColor:mode(light.grey[100],dark.grey[100])(s),boxShadow:"2px 4px 12px 0px rgba(45, 55, 72, 0.05)",marginBottom:{lg:"auto"},minWidth:{base:"100%",lg:"384px"},width:{lg:"384px"}},closeButton:{top:"10px",position:"absolute",color:mode(light.grey[400],dark.grey[400])(s),borderRadius:"18px",insetEnd:"10px"},body:{padding:0},footer:{padding:"32px 0 0 0"},header:{padding:0}}),sizes:{md:{dialog:{maxW:"384px"}}}}},config,styles:{global:s=>({body:{background:"rgba(16, 18, 27, 0.85)",backdropFilter:"blur(5px)",fontFamily:"Inter",color:mode(light.grey[900],dark.grey[900])(s),minWidth:"300px",minHeight:"100vh",display:"flex",margin:0,placeItems:"center"},":root":{"--chakra-colors-gray-black":mode(light.grey.black,dark.grey.black)(s),"--chakra-colors-gray-white":mode(light.grey.white,dark.grey.white)(s),"--chakra-colors-gray-50":mode(light.grey[50],dark.grey[50])(s),"--chakra-colors-gray-100":mode(light.grey[100],dark.grey[100])(s),"--chakra-colors-gray-200":mode(light.grey[200],dark.grey[200])(s),"--chakra-colors-gray-300":mode(light.grey[300],dark.grey[300])(s),"--chakra-colors-gray-400":mode(light.grey[400],dark.grey[400])(s),"--chakra-colors-gray-500":mode(light.grey[500],dark.grey[500])(s),"--chakra-colors-gray-600":mode(light.grey[600],dark.grey[600])(s),"--chakra-colors-gray-700":mode(light.grey[700],dark.grey[700])(s),"--chakra-colors-gray-800":mode(light.grey[800],dark.grey[800])(s),"--chakra-colors-gray-900":mode(light.grey[900],dark.grey[900])(s),"--chakra-fontWeights-bold":600,"--chakra-colors-chakra-body-bg":"","--chakra-colors-chakra-subtle-bg":""}})}});var name="@vercel/analytics",version="1.4.1",initQueue=()=>{window.va||(window.va=function(...a){(window.vaq=window.vaq||[]).push(a)})};function isBrowser(){return typeof window<"u"}function detectEnvironment(){try{const s="production"}catch{}return"production"}function setMode(s="auto"){if(s==="auto"){window.vam=detectEnvironment();return}window.vam=s}function getMode(){return(isBrowser()?window.vam:detectEnvironment())||"production"}function isDevelopment(){return getMode()==="development"}var DEV_SCRIPT_URL="https://va.vercel-scripts.com/v1/script.debug.js",PROD_SCRIPT_URL="/_vercel/insights/script.js";function inject(s={debug:!0}){var a;if(!isBrowser())return;setMode(s.mode),initQueue(),s.beforeSend&&((a=window.va)==null||a.call(window,"beforeSend",s.beforeSend));const u=s.scriptSrc||(isDevelopment()?DEV_SCRIPT_URL:PROD_SCRIPT_URL);if(document.head.querySelector(`script[src*="${u}"]`))return;const l=document.createElement("script");l.src=u,l.defer=!0,l.dataset.sdkn=name+(s.framework?`/${s.framework}`:""),l.dataset.sdkv=version,s.disableAutoTrack&&(l.dataset.disableAutoTrack="1"),s.endpoint&&(l.dataset.endpoint=s.endpoint),s.dsn&&(l.dataset.dsn=s.dsn),l.onerror=()=>{const f=isDevelopment()?"Please check if any ad blockers are enabled and try again.":"Be sure to enable Web Analytics for your project and deploy again. See https://vercel.com/docs/analytics/quickstart for more information.";console.log(`[Vercel Web Analytics] Failed to load script from ${u}. ${f}`)},isDevelopment()&&s.debug===!1&&(l.dataset.debug="false"),document.head.appendChild(l)}function pageview({route:s,path:a}){var u;(u=window.va)==null||u.call(window,"pageview",{route:s,path:a})}function Analytics(s){return reactExports.useEffect(()=>{var a;s.beforeSend&&((a=window.va)==null||a.call(window,"beforeSend",s.beforeSend))},[s.beforeSend]),reactExports.useEffect(()=>{inject({framework:s.framework||"react",...s.route!==void 0&&{disableAutoTrack:!0},...s})},[]),reactExports.useEffect(()=>{s.route&&s.path&&pageview({route:s.route,path:s.path})},[s.route,s.path]),null}const rootElement=document.getElementById("root");ReactDOM.createRoot(rootElement).render(jsxRuntimeExports.jsx(reactExports.StrictMode,{children:jsxRuntimeExports.jsx(ChakraProvider,{theme,children:jsxRuntimeExports.jsx(EmbedAppProvider,{children:jsxRuntimeExports.jsx(LoginModalProvider,{children:jsxRuntimeExports.jsx(OperationModalProvider,{children:jsxRuntimeExports.jsxs(SignPayloadModalProvider,{children:[jsxRuntimeExports.jsx(ColorModeScript,{initialColorMode:theme.config.initialColorMode}),jsxRuntimeExports.jsx(EmbeddedComponent,{}),jsxRuntimeExports.jsx(Analytics,{})]})})})})})}))});export default C0();
