@dcl/auth-site 1.3.1-7743847636.commit-51766c3 → 1.3.2-7900126256.commit-8819962
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{index-045baeaf.css → index-55093405.css} +3 -3
- package/assets/{index-024f0b5b.js → index-621e4b40.js} +2 -2
- package/assets/{index-024f0b5b.js.map → index-621e4b40.js.map} +1 -1
- package/assets/{index-8fd6ac54.js → index-dd4a7035.js} +5 -5
- package/assets/{index-8fd6ac54.js.map → index-dd4a7035.js.map} +1 -1
- package/assets/{index-0854237e.js → index-eea45a12.js} +2 -2
- package/assets/{index-0854237e.js.map → index-eea45a12.js.map} +1 -1
- package/index.html +2 -2
- package/package.json +3 -3
|
@@ -122,7 +122,7 @@ Instead of \``+Xr+"`, did you mean:",ho.map(function(go){return`
|
|
|
122
122
|
border-radius: 0;
|
|
123
123
|
z-index: 2147483647;
|
|
124
124
|
}
|
|
125
|
-
`}])),fortmatic}var __createBinding$9=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function($r,pr,Mr,Nr){Nr===void 0&&(Nr=Mr),Object.defineProperty($r,Nr,{enumerable:!0,get:function(){return pr[Mr]}})}:function($r,pr,Mr,Nr){Nr===void 0&&(Nr=Mr),$r[Nr]=pr[Mr]}),__setModuleDefault$8=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function($r,pr){Object.defineProperty($r,"default",{enumerable:!0,value:pr})}:function($r,pr){$r.default=pr}),__importStar$9=commonjsGlobal&&commonjsGlobal.__importStar||function($r){if($r&&$r.__esModule)return $r;var pr={};if($r!=null)for(var Mr in $r)Mr!=="default"&&Object.prototype.hasOwnProperty.call($r,Mr)&&__createBinding$9(pr,$r,Mr);return __setModuleDefault$8(pr,$r),pr};Object.defineProperty(FortmaticConnector$1,"__esModule",{value:!0});FortmaticConnector$1.FortmaticConnector=void 0;const abstract_connector_1=require$$0$7,schemas_1$4=dist$6,configuration_1$5=configuration$1;class FortmaticConnector extends abstract_connector_1.AbstractConnector{constructor(pr){const Mr=configuration_1$5.getConfiguration()[schemas_1$4.ProviderType.FORTMATIC],Nr=Object.keys(Mr.apiKeys).map(Dr=>Number(Dr));if(!Nr.includes(pr))throw new Error(`Invariant error: Unsupported chainId ${pr}`);super({supportedChainIds:Nr}),this.apiKey=Mr.apiKeys[pr],this.chainId=pr,this.rpcUrl=Mr.urls[pr]}async activate(){if(!this.fortmatic){const{default:Mr}=await Promise.resolve().then(()=>__importStar$9(requireFortmatic()));this.fortmatic=new Mr(this.apiKey,{rpcUrl:this.rpcUrl,chainId:this.chainId})}const pr=await this.fortmatic.getProvider().enable().then(Mr=>Mr[0]);return{provider:this.fortmatic.getProvider(),chainId:this.chainId,account:pr}}getApiKey(){return this.apiKey}async getProvider(){return this.fortmatic.getProvider()}async getChainId(){return this.chainId}async getAccount(){return this.fortmatic.getProvider().send("eth_accounts").then(pr=>pr[0])}deactivate(){}async close(){await this.fortmatic.user.logout(),this.emitDeactivate()}}FortmaticConnector$1.FortmaticConnector=FortmaticConnector;var InjectedConnector$2={};function warning$2($r,pr){}function _extends$4(){return _extends$4=Object.assign||function($r){for(var pr=1;pr<arguments.length;pr++){var Mr=arguments[pr];for(var Nr in Mr)Object.prototype.hasOwnProperty.call(Mr,Nr)&&($r[Nr]=Mr[Nr])}return $r},_extends$4.apply(this,arguments)}function _inheritsLoose$4($r,pr){$r.prototype=Object.create(pr.prototype),$r.prototype.constructor=$r,$r.__proto__=pr}function _getPrototypeOf$x($r){return _getPrototypeOf$x=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$x($r)}function _setPrototypeOf$z($r,pr){return _setPrototypeOf$z=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$z($r,pr)}function isNativeReflectConstruct(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function _construct$1($r,pr,Mr){return isNativeReflectConstruct()?_construct$1=Reflect.construct:_construct$1=function(Dr,Br,Lr){var jr=[null];jr.push.apply(jr,Br);var Ur=Function.bind.apply(Dr,jr),Gr=new Ur;return Lr&&_setPrototypeOf$z(Gr,Lr.prototype),Gr},_construct$1.apply(null,arguments)}function _isNativeFunction$1($r){return Function.toString.call($r).indexOf("[native code]")!==-1}function _wrapNativeSuper$1($r){var pr=typeof Map=="function"?new Map:void 0;return _wrapNativeSuper$1=function(Nr){if(Nr===null||!_isNativeFunction$1(Nr))return Nr;if(typeof Nr!="function")throw new TypeError("Super expression must either be null or a function");if(typeof pr<"u"){if(pr.has(Nr))return pr.get(Nr);pr.set(Nr,Dr)}function Dr(){return _construct$1(Nr,arguments,_getPrototypeOf$x(this).constructor)}return Dr.prototype=Object.create(Nr.prototype,{constructor:{value:Dr,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf$z(Dr,Nr)},_wrapNativeSuper$1($r)}function _assertThisInitialized$y($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}typeof Symbol<"u"&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")));typeof Symbol<"u"&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));function _catch($r,pr){try{var Mr=$r()}catch(Nr){return pr(Nr)}return Mr&&Mr.then?Mr.then(void 0,pr):Mr}function parseSendReturn($r){return $r.hasOwnProperty("result")?$r.result:$r}var NoEthereumProviderError=function($r){_inheritsLoose$4(pr,$r);function pr(){var Mr;return Mr=$r.call(this)||this,Mr.name=Mr.constructor.name,Mr.message="No Ethereum provider was found on window.ethereum.",Mr}return pr}(_wrapNativeSuper$1(Error)),UserRejectedRequestError=function($r){_inheritsLoose$4(pr,$r);function pr(){var Mr;return Mr=$r.call(this)||this,Mr.name=Mr.constructor.name,Mr.message="The user rejected the request.",Mr}return pr}(_wrapNativeSuper$1(Error)),InjectedConnector$1=function($r){_inheritsLoose$4(pr,$r);function pr(Nr){var Dr;return Dr=$r.call(this,Nr)||this,Dr.handleNetworkChanged=Dr.handleNetworkChanged.bind(_assertThisInitialized$y(Dr)),Dr.handleChainChanged=Dr.handleChainChanged.bind(_assertThisInitialized$y(Dr)),Dr.handleAccountsChanged=Dr.handleAccountsChanged.bind(_assertThisInitialized$y(Dr)),Dr.handleClose=Dr.handleClose.bind(_assertThisInitialized$y(Dr)),Dr}var Mr=pr.prototype;return Mr.handleChainChanged=function(Dr){this.emitUpdate({chainId:Dr,provider:window.ethereum})},Mr.handleAccountsChanged=function(Dr){Dr.length===0?this.emitDeactivate():this.emitUpdate({account:Dr[0]})},Mr.handleClose=function(Dr,Br){this.emitDeactivate()},Mr.handleNetworkChanged=function(Dr){this.emitUpdate({chainId:Dr,provider:window.ethereum})},Mr.activate=function(){try{var Dr=function(Yr){if(Br)return Yr;function Qr(){return _extends$4({provider:window.ethereum},jr?{account:jr}:{})}var Wn=function(){if(!jr)return Promise.resolve(window.ethereum.enable().then(function(ga){return ga&&parseSendReturn(ga)[0]})).then(function(ga){jr=ga})}();return Wn&&Wn.then?Wn.then(Qr):Qr(Wn)},Br=!1,Lr=this;if(!window.ethereum)throw new NoEthereumProviderError;window.ethereum.on&&(window.ethereum.on("chainChanged",Lr.handleChainChanged),window.ethereum.on("accountsChanged",Lr.handleAccountsChanged),window.ethereum.on("close",Lr.handleClose),window.ethereum.on("networkChanged",Lr.handleNetworkChanged)),window.ethereum.isMetaMask&&(window.ethereum.autoRefreshOnNetworkChange=!1);var jr,Ur=_catch(function(){return Promise.resolve(window.ethereum.send("eth_requestAccounts").then(function(Gr){return parseSendReturn(Gr)[0]})).then(function(Gr){jr=Gr})},function(Gr){if(Gr.code===4001)throw new UserRejectedRequestError});return Promise.resolve(Ur&&Ur.then?Ur.then(Dr):Dr(Ur))}catch(Gr){return Promise.reject(Gr)}},Mr.getProvider=function(){try{return Promise.resolve(window.ethereum)}catch(Dr){return Promise.reject(Dr)}},Mr.getChainId=function(){try{var Dr=function(){function Ur(){if(!Br)try{Br=parseSendReturn(window.ethereum.send({method:"net_version"}))}catch{}return Br||(window.ethereum.isDapper?Br=parseSendReturn(window.ethereum.cachedResults.net_version):Br=window.ethereum.chainId||window.ethereum.netVersion||window.ethereum.networkVersion||window.ethereum._chainId),Br}var Gr=function(){if(!Br){var Yr=_catch(function(){return Promise.resolve(window.ethereum.send("net_version").then(parseSendReturn)).then(function(Qr){Br=Qr})},function(){});if(Yr&&Yr.then)return Yr.then(function(){})}}();return Gr&&Gr.then?Gr.then(Ur):Ur(Gr)};if(!window.ethereum)throw new NoEthereumProviderError;var Br,Lr=_catch(function(){return Promise.resolve(window.ethereum.send("eth_chainId").then(parseSendReturn)).then(function(jr){Br=jr})},function(){});return Promise.resolve(Lr&&Lr.then?Lr.then(Dr):Dr(Lr))}catch(jr){return Promise.reject(jr)}},Mr.getAccount=function(){try{var Dr=function(){function Ur(){return Br||(Br=parseSendReturn(window.ethereum.send({method:"eth_accounts"}))[0]),Br}var Gr=function(){if(!Br){var Yr=_catch(function(){return Promise.resolve(window.ethereum.enable().then(function(Qr){return parseSendReturn(Qr)[0]})).then(function(Qr){Br=Qr})},function(){});if(Yr&&Yr.then)return Yr.then(function(){})}}();return Gr&&Gr.then?Gr.then(Ur):Ur(Gr)};if(!window.ethereum)throw new NoEthereumProviderError;var Br,Lr=_catch(function(){return Promise.resolve(window.ethereum.send("eth_accounts").then(function(jr){return parseSendReturn(jr)[0]})).then(function(jr){Br=jr})},function(){});return Promise.resolve(Lr&&Lr.then?Lr.then(Dr):Dr(Lr))}catch(jr){return Promise.reject(jr)}},Mr.deactivate=function(){window.ethereum&&window.ethereum.removeListener&&(window.ethereum.removeListener("chainChanged",this.handleChainChanged),window.ethereum.removeListener("accountsChanged",this.handleAccountsChanged),window.ethereum.removeListener("close",this.handleClose),window.ethereum.removeListener("networkChanged",this.handleNetworkChanged))},Mr.isAuthorized=function(){try{return window.ethereum?Promise.resolve(_catch(function(){return Promise.resolve(window.ethereum.send("eth_accounts").then(function(Dr){return parseSendReturn(Dr).length>0}))},function(){return!1})):Promise.resolve(!1)}catch(Dr){return Promise.reject(Dr)}},pr}(AbstractConnector);const injectedConnector_esm=Object.freeze(Object.defineProperty({__proto__:null,InjectedConnector:InjectedConnector$1,NoEthereumProviderError,UserRejectedRequestError},Symbol.toStringTag,{value:"Module"})),require$$0$6=getAugmentedNamespace(injectedConnector_esm);Object.defineProperty(InjectedConnector$2,"__esModule",{value:!0});InjectedConnector$2.InjectedConnector=void 0;const injected_connector_1=require$$0$6;class InjectedConnector extends injected_connector_1.InjectedConnector{constructor(pr){super({supportedChainIds:[pr]})}}InjectedConnector$2.InjectedConnector=InjectedConnector;var NetworkConnector$2={},prefix="Invariant failed";function invariant($r,pr){if(!$r)throw new Error(prefix)}function _inheritsLoose$3($r,pr){$r.prototype=Object.create(pr.prototype),$r.prototype.constructor=$r,_setPrototypeOf$y($r,pr)}function _getPrototypeOf$w($r){return _getPrototypeOf$w=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$w($r)}function _setPrototypeOf$y($r,pr){return _setPrototypeOf$y=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$y($r,pr)}function _isNativeReflectConstruct$w(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function _construct($r,pr,Mr){return _isNativeReflectConstruct$w()?_construct=Reflect.construct:_construct=function(Dr,Br,Lr){var jr=[null];jr.push.apply(jr,Br);var Ur=Function.bind.apply(Dr,jr),Gr=new Ur;return Lr&&_setPrototypeOf$y(Gr,Lr.prototype),Gr},_construct.apply(null,arguments)}function _isNativeFunction($r){return Function.toString.call($r).indexOf("[native code]")!==-1}function _wrapNativeSuper($r){var pr=typeof Map=="function"?new Map:void 0;return _wrapNativeSuper=function(Nr){if(Nr===null||!_isNativeFunction(Nr))return Nr;if(typeof Nr!="function")throw new TypeError("Super expression must either be null or a function");if(typeof pr<"u"){if(pr.has(Nr))return pr.get(Nr);pr.set(Nr,Dr)}function Dr(){return _construct(Nr,arguments,_getPrototypeOf$w(this).constructor)}return Dr.prototype=Object.create(Nr.prototype,{constructor:{value:Dr,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf$y(Dr,Nr)},_wrapNativeSuper($r)}var RequestError=function($r){_inheritsLoose$3(pr,$r);function pr(Mr,Nr,Dr){var Br;return Br=$r.call(this)||this,Br.code=Nr,Br.data=Dr,Br.name=Br.constructor.name,Br.message=Mr,Br}return pr}(_wrapNativeSuper(Error)),MiniRpcProvider=function(pr,Mr){var Nr=this,Dr=this;this.isMetaMask=!1,this.sendAsync=function(Lr,jr){console.log("sendAsync",Lr.method,Lr.params),Dr.request(Lr.method,Lr.params).then(function(Ur){return jr(null,{jsonrpc:"2.0",id:Lr.id,result:Ur})}).catch(function(Ur){return jr(Ur,null)})},this.request=function(Lr,jr){try{return typeof Lr!="string"&&(jr=Lr.params,Lr=Lr.method),Promise.resolve(fetch(Nr.url,{method:"POST",body:JSON.stringify({jsonrpc:"2.0",id:1,method:Lr,params:jr}),headers:{"Content-Type":"application/json"}})).then(function(Ur){if(!Ur.ok)throw new RequestError(Ur.status+": "+Ur.statusText,-32e3);return Promise.resolve(Ur.json()).then(function(Gr){if("error"in Gr){var Yr,Qr,Wn;throw new RequestError(Gr==null||(Yr=Gr.error)==null?void 0:Yr.message,Gr==null||(Qr=Gr.error)==null?void 0:Qr.code,Gr==null||(Wn=Gr.error)==null?void 0:Wn.data)}else{if("result"in Gr)return Gr.result;throw new RequestError("Received unexpected JSON-RPC response to "+Lr+" request.",-32e3,Gr)}})})}catch(Ur){return Promise.reject(Ur)}},this.chainId=pr,this.url=Mr;var Br=new URL(Mr);this.host=Br.host,this.path=Br.pathname},NetworkConnector$1=function($r){_inheritsLoose$3(pr,$r);function pr(Nr){var Dr,Br=Nr.urls,Lr=Nr.defaultChainId;return Lr||Object.keys(Br).length===1||invariant(!1),Dr=$r.call(this,{supportedChainIds:Object.keys(Br).map(function(jr){return Number(jr)})})||this,Dr.currentChainId=Lr||Number(Object.keys(Br)[0]),Dr.providers=Object.keys(Br).reduce(function(jr,Ur){return jr[Number(Ur)]=new MiniRpcProvider(Number(Ur),Br[Number(Ur)]),jr},{}),Dr}var Mr=pr.prototype;return Mr.activate=function(){try{var Dr=this;return Promise.resolve({provider:Dr.providers[Dr.currentChainId],chainId:Dr.currentChainId,account:null})}catch(Br){return Promise.reject(Br)}},Mr.getProvider=function(){try{var Dr=this;return Promise.resolve(Dr.providers[Dr.currentChainId])}catch(Br){return Promise.reject(Br)}},Mr.getChainId=function(){try{var Dr=this;return Promise.resolve(Dr.currentChainId)}catch(Br){return Promise.reject(Br)}},Mr.getAccount=function(){return Promise.resolve(null)},Mr.deactivate=function(){},Mr.changeChainId=function(Dr){Object.keys(this.providers).includes(Dr.toString())||invariant(!1),this.currentChainId=Dr,this.emitUpdate({provider:this.providers[this.currentChainId],chainId:Dr})},pr}(AbstractConnector);const networkConnector_esm=Object.freeze(Object.defineProperty({__proto__:null,NetworkConnector:NetworkConnector$1,RequestError},Symbol.toStringTag,{value:"Module"})),require$$1$4=getAugmentedNamespace(networkConnector_esm);Object.defineProperty(NetworkConnector$2,"__esModule",{value:!0});NetworkConnector$2.NetworkConnector=void 0;const provider_type_1$1=providerType,network_connector_1=require$$1$4,configuration_1$4=configuration$1;class NetworkConnector extends network_connector_1.NetworkConnector{constructor(pr){super({urls:configuration_1$4.getConfiguration()[provider_type_1$1.ProviderType.NETWORK].urls,defaultChainId:pr})}}NetworkConnector$2.NetworkConnector=NetworkConnector;var WalletLinkConnector$2={};const scriptRel="modulepreload",assetsURL=function($r){return"https://cdn.decentraland.org/@dcl/auth-site/1.3.1-7743847636.commit-51766c3/"+$r},seen={},__vitePreload=function(pr,Mr,Nr){if(!Mr||Mr.length===0)return pr();const Dr=document.getElementsByTagName("link");return Promise.all(Mr.map(Br=>{if(Br=assetsURL(Br),Br in seen)return;seen[Br]=!0;const Lr=Br.endsWith(".css"),jr=Lr?'[rel="stylesheet"]':"";if(!!Nr)for(let Yr=Dr.length-1;Yr>=0;Yr--){const Qr=Dr[Yr];if(Qr.href===Br&&(!Lr||Qr.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${Br}"]${jr}`))return;const Gr=document.createElement("link");if(Gr.rel=Lr?"stylesheet":scriptRel,Lr||(Gr.as="script",Gr.crossOrigin=""),Gr.href=Br,document.head.appendChild(Gr),Lr)return new Promise((Yr,Qr)=>{Gr.addEventListener("load",Yr),Gr.addEventListener("error",()=>Qr(new Error(`Unable to preload CSS for ${Br}`)))})})).then(()=>pr()).catch(Br=>{const Lr=new Event("vite:preloadError",{cancelable:!0});if(Lr.payload=Br,window.dispatchEvent(Lr),!Lr.defaultPrevented)throw Br})};function _extends$3(){return _extends$3=Object.assign||function($r){for(var pr=1;pr<arguments.length;pr++){var Mr=arguments[pr];for(var Nr in Mr)Object.prototype.hasOwnProperty.call(Mr,Nr)&&($r[Nr]=Mr[Nr])}return $r},_extends$3.apply(this,arguments)}function _inheritsLoose$2($r,pr){$r.prototype=Object.create(pr.prototype),$r.prototype.constructor=$r,_setPrototypeOf$x($r,pr)}function _setPrototypeOf$x($r,pr){return _setPrototypeOf$x=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$x($r,pr)}function _assertThisInitialized$x($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}var CHAIN_ID=1,WalletLinkConnector$1=function($r){_inheritsLoose$2(pr,$r);function pr(Nr){var Dr,Br=Nr.url,Lr=Nr.appName,jr=Nr.appLogoUrl,Ur=Nr.darkMode,Gr=Nr.supportedChainIds;return Dr=$r.call(this,{supportedChainIds:Gr})||this,Dr.url=Br,Dr.appName=Lr,Dr.appLogoUrl=jr,Dr.darkMode=Ur||!1,Dr.handleChainChanged=Dr.handleChainChanged.bind(_assertThisInitialized$x(Dr)),Dr.handleAccountsChanged=Dr.handleAccountsChanged.bind(_assertThisInitialized$x(Dr)),Dr}var Mr=pr.prototype;return Mr.activate=function(){try{var Dr=this,Br=function(){return Promise.resolve(Dr.provider.request({method:"eth_requestAccounts"})).then(function(Ur){var Gr=Ur[0];return Dr.provider.on("chainChanged",Dr.handleChainChanged),Dr.provider.on("accountsChanged",Dr.handleAccountsChanged),{provider:Dr.provider,account:Gr}})},Lr=function(){if(window.ethereum&&window.ethereum.isCoinbaseWallet===!0)Dr.provider=window.ethereum;else{var jr=function(){if(!Dr.walletLink)return Promise.resolve(__vitePreload(()=>import("./index-0854237e.js").then(Ur=>Ur.i),[]).then(function(Ur){var Gr;return(Gr=Ur==null?void 0:Ur.default)!=null?Gr:Ur})).then(function(Ur){Dr.walletLink=new Ur(_extends$3({appName:Dr.appName,darkMode:Dr.darkMode},Dr.appLogoUrl?{appLogoUrl:Dr.appLogoUrl}:{})),Dr.provider=Dr.walletLink.makeWeb3Provider(Dr.url,CHAIN_ID)})}();if(jr&&jr.then)return jr.then(function(){})}}();return Promise.resolve(Lr&&Lr.then?Lr.then(Br):Br(Lr))}catch(jr){return Promise.reject(jr)}},Mr.getProvider=function(){try{var Dr=this;return Promise.resolve(Dr.provider)}catch(Br){return Promise.reject(Br)}},Mr.getChainId=function(){try{var Dr=this;return Promise.resolve(Dr.provider.chainId)}catch(Br){return Promise.reject(Br)}},Mr.getAccount=function(){try{var Dr=this;return Promise.resolve(Dr.provider.request({method:"eth_requestAccounts"})).then(function(Br){return Br[0]})}catch(Br){return Promise.reject(Br)}},Mr.deactivate=function(){this.provider.removeListener("chainChanged",this.handleChainChanged),this.provider.removeListener("accountsChanged",this.handleAccountsChanged)},Mr.close=function(){try{var Dr=this;return Dr.provider.close(),Dr.emitDeactivate(),Promise.resolve()}catch(Br){return Promise.reject(Br)}},Mr.handleChainChanged=function(Dr){this.emitUpdate({chainId:Dr})},Mr.handleAccountsChanged=function(Dr){this.emitUpdate({account:Dr[0]})},pr}(AbstractConnector);const walletlinkConnector_esm=Object.freeze(Object.defineProperty({__proto__:null,WalletLinkConnector:WalletLinkConnector$1},Symbol.toStringTag,{value:"Module"})),require$$1$3=getAugmentedNamespace(walletlinkConnector_esm);Object.defineProperty(WalletLinkConnector$2,"__esModule",{value:!0});WalletLinkConnector$2.WalletLinkConnector=void 0;const schemas_1$3=dist$6,walletlink_connector_1=require$$1$3,configuration_1$3=configuration$1;class WalletLinkConnector extends walletlink_connector_1.WalletLinkConnector{constructor(pr){const Mr=configuration_1$3.getConfiguration()[schemas_1$3.ProviderType.WALLET_LINK];super({url:Mr.urls[pr],appName:Mr.appName,supportedChainIds:[pr]})}}WalletLinkConnector$2.WalletLinkConnector=WalletLinkConnector;var WalletConnectV2Connector$1={};const t=Symbol(),s$1=Object.getPrototypeOf,c$2=new WeakMap,l$1=$r=>$r&&(c$2.has($r)?c$2.get($r):s$1($r)===Object.prototype||s$1($r)===Array.prototype),y$5=$r=>l$1($r)&&$r[t]||null,h$4=($r,pr=!0)=>{c$2.set($r,pr)},isObject$1=$r=>typeof $r=="object"&&$r!==null,proxyStateMap=new WeakMap,refSet=new WeakSet,buildProxyFunction=($r=Object.is,pr=(Gr,Yr)=>new Proxy(Gr,Yr),Mr=Gr=>isObject$1(Gr)&&!refSet.has(Gr)&&(Array.isArray(Gr)||!(Symbol.iterator in Gr))&&!(Gr instanceof WeakMap)&&!(Gr instanceof WeakSet)&&!(Gr instanceof Error)&&!(Gr instanceof Number)&&!(Gr instanceof Date)&&!(Gr instanceof String)&&!(Gr instanceof RegExp)&&!(Gr instanceof ArrayBuffer),Nr=Gr=>{switch(Gr.status){case"fulfilled":return Gr.value;case"rejected":throw Gr.reason;default:throw Gr}},Dr=new WeakMap,Br=(Gr,Yr,Qr=Nr)=>{const Wn=Dr.get(Gr);if((Wn==null?void 0:Wn[0])===Yr)return Wn[1];const ga=Array.isArray(Gr)?[]:Object.create(Object.getPrototypeOf(Gr));return h$4(ga,!0),Dr.set(Gr,[Yr,ga]),Reflect.ownKeys(Gr).forEach(eo=>{if(Object.getOwnPropertyDescriptor(ga,eo))return;const _i=Reflect.get(Gr,eo),va={value:_i,enumerable:!0,configurable:!0};if(refSet.has(_i))h$4(_i,!1);else if(_i instanceof Promise)delete va.value,va.get=()=>Qr(_i);else if(proxyStateMap.has(_i)){const[io,no]=proxyStateMap.get(_i);va.value=Br(io,no(),Qr)}Object.defineProperty(ga,eo,va)}),Object.preventExtensions(ga)},Lr=new WeakMap,jr=[1,1],Ur=Gr=>{if(!isObject$1(Gr))throw new Error("object required");const Yr=Lr.get(Gr);if(Yr)return Yr;let Qr=jr[0];const Wn=new Set,ga=(mo,$o=++jr[0])=>{Qr!==$o&&(Qr=$o,Wn.forEach(Xn=>Xn(mo,$o)))};let eo=jr[1];const _i=(mo=++jr[1])=>(eo!==mo&&!Wn.size&&(eo=mo,io.forEach(([$o])=>{const Xn=$o[1](mo);Xn>Qr&&(Qr=Xn)})),Qr),va=mo=>($o,Xn)=>{const Fr=[...$o];Fr[1]=[mo,...Fr[1]],ga(Fr,Xn)},io=new Map,no=(mo,$o)=>{if(Wn.size){const Xn=$o[3](va(mo));io.set(mo,[$o,Xn])}else io.set(mo,[$o])},so=mo=>{var $o;const Xn=io.get(mo);Xn&&(io.delete(mo),($o=Xn[1])==null||$o.call(Xn))},ao=mo=>(Wn.add(mo),Wn.size===1&&io.forEach(([Xn,Fr],Vr)=>{const Wr=Xn[3](va(Vr));io.set(Vr,[Xn,Wr])}),()=>{Wn.delete(mo),Wn.size===0&&io.forEach(([Xn,Fr],Vr)=>{Fr&&(Fr(),io.set(Vr,[Xn]))})}),fo=Array.isArray(Gr)?[]:Object.create(Object.getPrototypeOf(Gr)),oo=pr(fo,{deleteProperty(mo,$o){const Xn=Reflect.get(mo,$o);so($o);const Fr=Reflect.deleteProperty(mo,$o);return Fr&&ga(["delete",[$o],Xn]),Fr},set(mo,$o,Xn,Fr){const Vr=Reflect.has(mo,$o),Wr=Reflect.get(mo,$o,Fr);if(Vr&&($r(Wr,Xn)||Lr.has(Xn)&&$r(Wr,Lr.get(Xn))))return!0;so($o),isObject$1(Xn)&&(Xn=y$5(Xn)||Xn);let Jr=Xn;if(Xn instanceof Promise)Xn.then(Gn=>{Xn.status="fulfilled",Xn.value=Gn,ga(["resolve",[$o],Gn])}).catch(Gn=>{Xn.status="rejected",Xn.reason=Gn,ga(["reject",[$o],Gn])});else{!proxyStateMap.has(Xn)&&Mr(Xn)&&(Jr=Ur(Xn));const Gn=!refSet.has(Jr)&&proxyStateMap.get(Jr);Gn&&no($o,Gn)}return Reflect.set(mo,$o,Jr,Fr),ga(["set",[$o],Xn,Wr]),!0}});Lr.set(Gr,oo);const po=[fo,_i,Br,ao];return proxyStateMap.set(oo,po),Reflect.ownKeys(Gr).forEach(mo=>{const $o=Object.getOwnPropertyDescriptor(Gr,mo);"value"in $o&&(oo[mo]=Gr[mo],delete $o.value,delete $o.writable),Object.defineProperty(fo,mo,$o)}),oo})=>[Ur,proxyStateMap,refSet,$r,pr,Mr,Nr,Dr,Br,Lr,jr],[defaultProxyFunction]=buildProxyFunction();function proxy($r={}){return defaultProxyFunction($r)}function subscribe($r,pr,Mr){const Nr=proxyStateMap.get($r);let Dr;const Br=[],Lr=Nr[3];let jr=!1;const Gr=Lr(Yr=>{if(Br.push(Yr),Mr){pr(Br.splice(0));return}Dr||(Dr=Promise.resolve().then(()=>{Dr=void 0,jr&&pr(Br.splice(0))}))});return jr=!0,()=>{jr=!1,Gr()}}function snapshot($r,pr){const Mr=proxyStateMap.get($r),[Nr,Dr,Br]=Mr;return Br(Nr,Dr(),pr)}const o$1=proxy({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),T$2={state:o$1,subscribe($r){return subscribe(o$1,()=>$r(o$1))},push($r,pr){$r!==o$1.view&&(o$1.view=$r,pr&&(o$1.data=pr),o$1.history.push($r))},reset($r){o$1.view=$r,o$1.history=[$r]},replace($r){o$1.history.length>1&&(o$1.history[o$1.history.length-1]=$r,o$1.view=$r)},goBack(){if(o$1.history.length>1){o$1.history.pop();const[$r]=o$1.history.slice(-1);o$1.view=$r}},setData($r){o$1.data=$r}},a$1={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return a$1.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const $r=navigator.userAgent.toLowerCase();return a$1.isMobile()&&($r.includes("iphone")||$r.includes("ipad"))},isHttpUrl($r){return $r.startsWith("http://")||$r.startsWith("https://")},isArray($r){return Array.isArray($r)&&$r.length>0},formatNativeUrl($r,pr,Mr){if(a$1.isHttpUrl($r))return this.formatUniversalUrl($r,pr,Mr);let Nr=$r;Nr.includes("://")||(Nr=$r.replaceAll("/","").replaceAll(":",""),Nr=`${Nr}://`),Nr.endsWith("/")||(Nr=`${Nr}/`),this.setWalletConnectDeepLink(Nr,Mr);const Dr=encodeURIComponent(pr);return`${Nr}wc?uri=${Dr}`},formatUniversalUrl($r,pr,Mr){if(!a$1.isHttpUrl($r))return this.formatNativeUrl($r,pr,Mr);let Nr=$r;Nr.endsWith("/")||(Nr=`${Nr}/`),this.setWalletConnectDeepLink(Nr,Mr);const Dr=encodeURIComponent(pr);return`${Nr}wc?uri=${Dr}`},async wait($r){return new Promise(pr=>{setTimeout(pr,$r)})},openHref($r,pr){window.open($r,pr,"noreferrer noopener")},setWalletConnectDeepLink($r,pr){try{localStorage.setItem(a$1.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:$r,name:pr}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink($r){try{const[pr]=$r.split("?");localStorage.setItem(a$1.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:pr,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(a$1.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(a$1.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var $r;const pr=($r=T$2.state.data)==null?void 0:$r.Wallet;if(!pr)throw new Error('Missing "Wallet" view data');return pr}},_$5=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),r$2=proxy({enabled:_$5,userSessionId:"",events:[],connectedWalletId:void 0}),R$5={state:r$2,subscribe($r){return subscribe(r$2.events,()=>$r(snapshot(r$2.events[r$2.events.length-1])))},initialize(){r$2.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(r$2.userSessionId=crypto.randomUUID())},setConnectedWalletId($r){r$2.connectedWalletId=$r},click($r){if(r$2.enabled){const pr={type:"CLICK",name:$r.name,userSessionId:r$2.userSessionId,timestamp:Date.now(),data:$r};r$2.events.push(pr)}},track($r){if(r$2.enabled){const pr={type:"TRACK",name:$r.name,userSessionId:r$2.userSessionId,timestamp:Date.now(),data:$r};r$2.events.push(pr)}},view($r){if(r$2.enabled){const pr={type:"VIEW",name:$r.name,userSessionId:r$2.userSessionId,timestamp:Date.now(),data:$r};r$2.events.push(pr)}}},c$1=proxy({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),p$4={state:c$1,subscribe($r){return subscribe(c$1,()=>$r(c$1))},setChains($r){c$1.chains=$r},setWalletConnectUri($r){c$1.walletConnectUri=$r},setIsCustomDesktop($r){c$1.isCustomDesktop=$r},setIsCustomMobile($r){c$1.isCustomMobile=$r},setIsDataLoaded($r){c$1.isDataLoaded=$r},setIsUiLoaded($r){c$1.isUiLoaded=$r},setIsAuth($r){c$1.isAuth=$r}},W$8=proxy({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),y$4={state:W$8,subscribe($r){return subscribe(W$8,()=>$r(W$8))},setConfig($r){var pr,Mr;R$5.initialize(),p$4.setChains($r.chains),p$4.setIsAuth(!!$r.enableAuthMode),p$4.setIsCustomMobile(!!((pr=$r.mobileWallets)!=null&&pr.length)),p$4.setIsCustomDesktop(!!((Mr=$r.desktopWallets)!=null&&Mr.length)),a$1.setModalVersionInStorage(),Object.assign(W$8,$r)}};var V$3=Object.defineProperty,D$5=Object.getOwnPropertySymbols,H$1=Object.prototype.hasOwnProperty,B$3=Object.prototype.propertyIsEnumerable,M$3=($r,pr,Mr)=>pr in $r?V$3($r,pr,{enumerable:!0,configurable:!0,writable:!0,value:Mr}):$r[pr]=Mr,K$7=($r,pr)=>{for(var Mr in pr||(pr={}))H$1.call(pr,Mr)&&M$3($r,Mr,pr[Mr]);if(D$5)for(var Mr of D$5(pr))B$3.call(pr,Mr)&&M$3($r,Mr,pr[Mr]);return $r};const L$2="https://explorer-api.walletconnect.com",E$4="wcm",O$5="js-2.6.2";async function w$3($r,pr){const Mr=K$7({sdkType:E$4,sdkVersion:O$5},pr),Nr=new URL($r,L$2);return Nr.searchParams.append("projectId",y$4.state.projectId),Object.entries(Mr).forEach(([Dr,Br])=>{Br&&Nr.searchParams.append(Dr,String(Br))}),(await fetch(Nr)).json()}const m$5={async getDesktopListings($r){return w$3("/w3m/v1/getDesktopListings",$r)},async getMobileListings($r){return w$3("/w3m/v1/getMobileListings",$r)},async getInjectedListings($r){return w$3("/w3m/v1/getInjectedListings",$r)},async getAllListings($r){return w$3("/w3m/v1/getAllListings",$r)},getWalletImageUrl($r){return`${L$2}/w3m/v1/getWalletImage/${$r}?projectId=${y$4.state.projectId}&sdkType=${E$4}&sdkVersion=${O$5}`},getAssetImageUrl($r){return`${L$2}/w3m/v1/getAssetImage/${$r}?projectId=${y$4.state.projectId}&sdkType=${E$4}&sdkVersion=${O$5}`}};var z$2=Object.defineProperty,j$3=Object.getOwnPropertySymbols,J$2=Object.prototype.hasOwnProperty,q$4=Object.prototype.propertyIsEnumerable,k$2=($r,pr,Mr)=>pr in $r?z$2($r,pr,{enumerable:!0,configurable:!0,writable:!0,value:Mr}):$r[pr]=Mr,F$4=($r,pr)=>{for(var Mr in pr||(pr={}))J$2.call(pr,Mr)&&k$2($r,Mr,pr[Mr]);if(j$3)for(var Mr of j$3(pr))q$4.call(pr,Mr)&&k$2($r,Mr,pr[Mr]);return $r};const N$3=a$1.isMobile(),d$2=proxy({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),te$3={state:d$2,async getRecomendedWallets(){const{explorerRecommendedWalletIds:$r,explorerExcludedWalletIds:pr}=y$4.state;if($r==="NONE"||pr==="ALL"&&!$r)return d$2.recomendedWallets;if(a$1.isArray($r)){const Mr={recommendedIds:$r.join(",")},{listings:Nr}=await m$5.getAllListings(Mr),Dr=Object.values(Nr);Dr.sort((Br,Lr)=>{const jr=$r.indexOf(Br.id),Ur=$r.indexOf(Lr.id);return jr-Ur}),d$2.recomendedWallets=Dr}else{const{chains:Mr,isAuth:Nr}=p$4.state,Dr=Mr==null?void 0:Mr.join(","),Br=a$1.isArray(pr),Lr={page:1,sdks:Nr?"auth_v1":void 0,entries:a$1.RECOMMENDED_WALLET_AMOUNT,chains:Dr,version:2,excludedIds:Br?pr.join(","):void 0},{listings:jr}=N$3?await m$5.getMobileListings(Lr):await m$5.getDesktopListings(Lr);d$2.recomendedWallets=Object.values(jr)}return d$2.recomendedWallets},async getWallets($r){const pr=F$4({},$r),{explorerRecommendedWalletIds:Mr,explorerExcludedWalletIds:Nr}=y$4.state,{recomendedWallets:Dr}=d$2;if(Nr==="ALL")return d$2.wallets;Dr.length?pr.excludedIds=Dr.map(Qr=>Qr.id).join(","):a$1.isArray(Mr)&&(pr.excludedIds=Mr.join(",")),a$1.isArray(Nr)&&(pr.excludedIds=[pr.excludedIds,Nr].filter(Boolean).join(",")),p$4.state.isAuth&&(pr.sdks="auth_v1");const{page:Br,search:Lr}=$r,{listings:jr,total:Ur}=N$3?await m$5.getMobileListings(pr):await m$5.getDesktopListings(pr),Gr=Object.values(jr),Yr=Lr?"search":"wallets";return d$2[Yr]={listings:[...d$2[Yr].listings,...Gr],total:Ur,page:Br??1},{listings:Gr,total:Ur}},getWalletImageUrl($r){return m$5.getWalletImageUrl($r)},getAssetImageUrl($r){return m$5.getAssetImageUrl($r)},resetSearch(){d$2.search={listings:[],total:0,page:1}}},I$3=proxy({open:!1}),se$2={state:I$3,subscribe($r){return subscribe(I$3,()=>$r(I$3))},async open($r){return new Promise(pr=>{const{isUiLoaded:Mr,isDataLoaded:Nr}=p$4.state;if(a$1.removeWalletConnectDeepLink(),p$4.setWalletConnectUri($r==null?void 0:$r.uri),p$4.setChains($r==null?void 0:$r.chains),T$2.reset("ConnectWallet"),Mr&&Nr)I$3.open=!0,pr();else{const Dr=setInterval(()=>{const Br=p$4.state;Br.isUiLoaded&&Br.isDataLoaded&&(clearInterval(Dr),I$3.open=!0,pr())},200)}})},close(){I$3.open=!1}};var G$5=Object.defineProperty,$$3=Object.getOwnPropertySymbols,Q$5=Object.prototype.hasOwnProperty,X$4=Object.prototype.propertyIsEnumerable,S$4=($r,pr,Mr)=>pr in $r?G$5($r,pr,{enumerable:!0,configurable:!0,writable:!0,value:Mr}):$r[pr]=Mr,Y$1=($r,pr)=>{for(var Mr in pr||(pr={}))Q$5.call(pr,Mr)&&S$4($r,Mr,pr[Mr]);if($$3)for(var Mr of $$3(pr))X$4.call(pr,Mr)&&S$4($r,Mr,pr[Mr]);return $r};function Z$3(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const C=proxy({themeMode:Z$3()?"dark":"light"}),ne$1={state:C,subscribe($r){return subscribe(C,()=>$r(C))},setThemeConfig($r){const{themeMode:pr,themeVariables:Mr}=$r;pr&&(C.themeMode=pr),Mr&&(C.themeVariables=Y$1({},Mr))}},g$6=proxy({open:!1,message:"",variant:"success"}),oe$3={state:g$6,subscribe($r){return subscribe(g$6,()=>$r(g$6))},openToast($r,pr){g$6.open=!0,g$6.message=$r,g$6.variant=pr},closeToast(){g$6.open=!1}};let d$1=class{constructor(pr){this.openModal=se$2.open,this.closeModal=se$2.close,this.subscribeModal=se$2.subscribe,this.setTheme=ne$1.setThemeConfig,ne$1.setThemeConfig(pr),y$4.setConfig(pr),this.initUi()}async initUi(){if(typeof window<"u"){await __vitePreload(()=>import("./index-024f0b5b.js"),[]);const pr=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",pr),p$4.setIsUiLoaded(!0)}}};const dist$5=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:d$1},Symbol.toStringTag,{value:"Module"})),require$$0$5=getAugmentedNamespace(dist$5);var chacha20poly1305={},chacha={},binary={},int={};(function($r){Object.defineProperty($r,"__esModule",{value:!0});function pr(jr,Ur){var Gr=jr>>>16&65535,Yr=jr&65535,Qr=Ur>>>16&65535,Wn=Ur&65535;return Yr*Wn+(Gr*Wn+Yr*Qr<<16>>>0)|0}$r.mul=Math.imul||pr;function Mr(jr,Ur){return jr+Ur|0}$r.add=Mr;function Nr(jr,Ur){return jr-Ur|0}$r.sub=Nr;function Dr(jr,Ur){return jr<<Ur|jr>>>32-Ur}$r.rotl=Dr;function Br(jr,Ur){return jr<<32-Ur|jr>>>Ur}$r.rotr=Br;function Lr(jr){return typeof jr=="number"&&isFinite(jr)&&Math.floor(jr)===jr}$r.isInteger=Number.isInteger||Lr,$r.MAX_SAFE_INTEGER=9007199254740991,$r.isSafeInteger=function(jr){return $r.isInteger(jr)&&jr>=-$r.MAX_SAFE_INTEGER&&jr<=$r.MAX_SAFE_INTEGER}})(int);Object.defineProperty(binary,"__esModule",{value:!0});var int_1=int;function readInt16BE($r,pr){return pr===void 0&&(pr=0),($r[pr+0]<<8|$r[pr+1])<<16>>16}binary.readInt16BE=readInt16BE;function readUint16BE($r,pr){return pr===void 0&&(pr=0),($r[pr+0]<<8|$r[pr+1])>>>0}binary.readUint16BE=readUint16BE;function readInt16LE($r,pr){return pr===void 0&&(pr=0),($r[pr+1]<<8|$r[pr])<<16>>16}binary.readInt16LE=readInt16LE;function readUint16LE($r,pr){return pr===void 0&&(pr=0),($r[pr+1]<<8|$r[pr])>>>0}binary.readUint16LE=readUint16LE;function writeUint16BE($r,pr,Mr){return pr===void 0&&(pr=new Uint8Array(2)),Mr===void 0&&(Mr=0),pr[Mr+0]=$r>>>8,pr[Mr+1]=$r>>>0,pr}binary.writeUint16BE=writeUint16BE;binary.writeInt16BE=writeUint16BE;function writeUint16LE($r,pr,Mr){return pr===void 0&&(pr=new Uint8Array(2)),Mr===void 0&&(Mr=0),pr[Mr+0]=$r>>>0,pr[Mr+1]=$r>>>8,pr}binary.writeUint16LE=writeUint16LE;binary.writeInt16LE=writeUint16LE;function readInt32BE($r,pr){return pr===void 0&&(pr=0),$r[pr]<<24|$r[pr+1]<<16|$r[pr+2]<<8|$r[pr+3]}binary.readInt32BE=readInt32BE;function readUint32BE($r,pr){return pr===void 0&&(pr=0),($r[pr]<<24|$r[pr+1]<<16|$r[pr+2]<<8|$r[pr+3])>>>0}binary.readUint32BE=readUint32BE;function readInt32LE($r,pr){return pr===void 0&&(pr=0),$r[pr+3]<<24|$r[pr+2]<<16|$r[pr+1]<<8|$r[pr]}binary.readInt32LE=readInt32LE;function readUint32LE($r,pr){return pr===void 0&&(pr=0),($r[pr+3]<<24|$r[pr+2]<<16|$r[pr+1]<<8|$r[pr])>>>0}binary.readUint32LE=readUint32LE;function writeUint32BE($r,pr,Mr){return pr===void 0&&(pr=new Uint8Array(4)),Mr===void 0&&(Mr=0),pr[Mr+0]=$r>>>24,pr[Mr+1]=$r>>>16,pr[Mr+2]=$r>>>8,pr[Mr+3]=$r>>>0,pr}binary.writeUint32BE=writeUint32BE;binary.writeInt32BE=writeUint32BE;function writeUint32LE($r,pr,Mr){return pr===void 0&&(pr=new Uint8Array(4)),Mr===void 0&&(Mr=0),pr[Mr+0]=$r>>>0,pr[Mr+1]=$r>>>8,pr[Mr+2]=$r>>>16,pr[Mr+3]=$r>>>24,pr}binary.writeUint32LE=writeUint32LE;binary.writeInt32LE=writeUint32LE;function readInt64BE($r,pr){pr===void 0&&(pr=0);var Mr=readInt32BE($r,pr),Nr=readInt32BE($r,pr+4);return Mr*4294967296+Nr-(Nr>>31)*4294967296}binary.readInt64BE=readInt64BE;function readUint64BE($r,pr){pr===void 0&&(pr=0);var Mr=readUint32BE($r,pr),Nr=readUint32BE($r,pr+4);return Mr*4294967296+Nr}binary.readUint64BE=readUint64BE;function readInt64LE($r,pr){pr===void 0&&(pr=0);var Mr=readInt32LE($r,pr),Nr=readInt32LE($r,pr+4);return Nr*4294967296+Mr-(Mr>>31)*4294967296}binary.readInt64LE=readInt64LE;function readUint64LE($r,pr){pr===void 0&&(pr=0);var Mr=readUint32LE($r,pr),Nr=readUint32LE($r,pr+4);return Nr*4294967296+Mr}binary.readUint64LE=readUint64LE;function writeUint64BE($r,pr,Mr){return pr===void 0&&(pr=new Uint8Array(8)),Mr===void 0&&(Mr=0),writeUint32BE($r/4294967296>>>0,pr,Mr),writeUint32BE($r>>>0,pr,Mr+4),pr}binary.writeUint64BE=writeUint64BE;binary.writeInt64BE=writeUint64BE;function writeUint64LE($r,pr,Mr){return pr===void 0&&(pr=new Uint8Array(8)),Mr===void 0&&(Mr=0),writeUint32LE($r>>>0,pr,Mr),writeUint32LE($r/4294967296>>>0,pr,Mr+4),pr}binary.writeUint64LE=writeUint64LE;binary.writeInt64LE=writeUint64LE;function readUintBE($r,pr,Mr){if(Mr===void 0&&(Mr=0),$r%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if($r/8>pr.length-Mr)throw new Error("readUintBE: array is too short for the given bitLength");for(var Nr=0,Dr=1,Br=$r/8+Mr-1;Br>=Mr;Br--)Nr+=pr[Br]*Dr,Dr*=256;return Nr}binary.readUintBE=readUintBE;function readUintLE($r,pr,Mr){if(Mr===void 0&&(Mr=0),$r%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if($r/8>pr.length-Mr)throw new Error("readUintLE: array is too short for the given bitLength");for(var Nr=0,Dr=1,Br=Mr;Br<Mr+$r/8;Br++)Nr+=pr[Br]*Dr,Dr*=256;return Nr}binary.readUintLE=readUintLE;function writeUintBE($r,pr,Mr,Nr){if(Mr===void 0&&(Mr=new Uint8Array($r/8)),Nr===void 0&&(Nr=0),$r%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!int_1.isSafeInteger(pr))throw new Error("writeUintBE value must be an integer");for(var Dr=1,Br=$r/8+Nr-1;Br>=Nr;Br--)Mr[Br]=pr/Dr&255,Dr*=256;return Mr}binary.writeUintBE=writeUintBE;function writeUintLE($r,pr,Mr,Nr){if(Mr===void 0&&(Mr=new Uint8Array($r/8)),Nr===void 0&&(Nr=0),$r%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!int_1.isSafeInteger(pr))throw new Error("writeUintLE value must be an integer");for(var Dr=1,Br=Nr;Br<Nr+$r/8;Br++)Mr[Br]=pr/Dr&255,Dr*=256;return Mr}binary.writeUintLE=writeUintLE;function readFloat32BE($r,pr){pr===void 0&&(pr=0);var Mr=new DataView($r.buffer,$r.byteOffset,$r.byteLength);return Mr.getFloat32(pr)}binary.readFloat32BE=readFloat32BE;function readFloat32LE($r,pr){pr===void 0&&(pr=0);var Mr=new DataView($r.buffer,$r.byteOffset,$r.byteLength);return Mr.getFloat32(pr,!0)}binary.readFloat32LE=readFloat32LE;function readFloat64BE($r,pr){pr===void 0&&(pr=0);var Mr=new DataView($r.buffer,$r.byteOffset,$r.byteLength);return Mr.getFloat64(pr)}binary.readFloat64BE=readFloat64BE;function readFloat64LE($r,pr){pr===void 0&&(pr=0);var Mr=new DataView($r.buffer,$r.byteOffset,$r.byteLength);return Mr.getFloat64(pr,!0)}binary.readFloat64LE=readFloat64LE;function writeFloat32BE($r,pr,Mr){pr===void 0&&(pr=new Uint8Array(4)),Mr===void 0&&(Mr=0);var Nr=new DataView(pr.buffer,pr.byteOffset,pr.byteLength);return Nr.setFloat32(Mr,$r),pr}binary.writeFloat32BE=writeFloat32BE;function writeFloat32LE($r,pr,Mr){pr===void 0&&(pr=new Uint8Array(4)),Mr===void 0&&(Mr=0);var Nr=new DataView(pr.buffer,pr.byteOffset,pr.byteLength);return Nr.setFloat32(Mr,$r,!0),pr}binary.writeFloat32LE=writeFloat32LE;function writeFloat64BE($r,pr,Mr){pr===void 0&&(pr=new Uint8Array(8)),Mr===void 0&&(Mr=0);var Nr=new DataView(pr.buffer,pr.byteOffset,pr.byteLength);return Nr.setFloat64(Mr,$r),pr}binary.writeFloat64BE=writeFloat64BE;function writeFloat64LE($r,pr,Mr){pr===void 0&&(pr=new Uint8Array(8)),Mr===void 0&&(Mr=0);var Nr=new DataView(pr.buffer,pr.byteOffset,pr.byteLength);return Nr.setFloat64(Mr,$r,!0),pr}binary.writeFloat64LE=writeFloat64LE;var wipe$1={};Object.defineProperty(wipe$1,"__esModule",{value:!0});function wipe($r){for(var pr=0;pr<$r.length;pr++)$r[pr]=0;return $r}wipe$1.wipe=wipe;Object.defineProperty(chacha,"__esModule",{value:!0});var binary_1=binary,wipe_1$3=wipe$1,ROUNDS=20;function core$1($r,pr,Mr){for(var Nr=1634760805,Dr=857760878,Br=2036477234,Lr=1797285236,jr=Mr[3]<<24|Mr[2]<<16|Mr[1]<<8|Mr[0],Ur=Mr[7]<<24|Mr[6]<<16|Mr[5]<<8|Mr[4],Gr=Mr[11]<<24|Mr[10]<<16|Mr[9]<<8|Mr[8],Yr=Mr[15]<<24|Mr[14]<<16|Mr[13]<<8|Mr[12],Qr=Mr[19]<<24|Mr[18]<<16|Mr[17]<<8|Mr[16],Wn=Mr[23]<<24|Mr[22]<<16|Mr[21]<<8|Mr[20],ga=Mr[27]<<24|Mr[26]<<16|Mr[25]<<8|Mr[24],eo=Mr[31]<<24|Mr[30]<<16|Mr[29]<<8|Mr[28],_i=pr[3]<<24|pr[2]<<16|pr[1]<<8|pr[0],va=pr[7]<<24|pr[6]<<16|pr[5]<<8|pr[4],io=pr[11]<<24|pr[10]<<16|pr[9]<<8|pr[8],no=pr[15]<<24|pr[14]<<16|pr[13]<<8|pr[12],so=Nr,ao=Dr,fo=Br,lo=Lr,oo=jr,po=Ur,mo=Gr,$o=Yr,Xn=Qr,Fr=Wn,Vr=ga,Wr=eo,Jr=_i,Gn=va,to=io,ro=no,Un=0;Un<ROUNDS;Un+=2)so=so+oo|0,Jr^=so,Jr=Jr>>>32-16|Jr<<16,Xn=Xn+Jr|0,oo^=Xn,oo=oo>>>32-12|oo<<12,ao=ao+po|0,Gn^=ao,Gn=Gn>>>32-16|Gn<<16,Fr=Fr+Gn|0,po^=Fr,po=po>>>32-12|po<<12,fo=fo+mo|0,to^=fo,to=to>>>32-16|to<<16,Vr=Vr+to|0,mo^=Vr,mo=mo>>>32-12|mo<<12,lo=lo+$o|0,ro^=lo,ro=ro>>>32-16|ro<<16,Wr=Wr+ro|0,$o^=Wr,$o=$o>>>32-12|$o<<12,fo=fo+mo|0,to^=fo,to=to>>>32-8|to<<8,Vr=Vr+to|0,mo^=Vr,mo=mo>>>32-7|mo<<7,lo=lo+$o|0,ro^=lo,ro=ro>>>32-8|ro<<8,Wr=Wr+ro|0,$o^=Wr,$o=$o>>>32-7|$o<<7,ao=ao+po|0,Gn^=ao,Gn=Gn>>>32-8|Gn<<8,Fr=Fr+Gn|0,po^=Fr,po=po>>>32-7|po<<7,so=so+oo|0,Jr^=so,Jr=Jr>>>32-8|Jr<<8,Xn=Xn+Jr|0,oo^=Xn,oo=oo>>>32-7|oo<<7,so=so+po|0,ro^=so,ro=ro>>>32-16|ro<<16,Vr=Vr+ro|0,po^=Vr,po=po>>>32-12|po<<12,ao=ao+mo|0,Jr^=ao,Jr=Jr>>>32-16|Jr<<16,Wr=Wr+Jr|0,mo^=Wr,mo=mo>>>32-12|mo<<12,fo=fo+$o|0,Gn^=fo,Gn=Gn>>>32-16|Gn<<16,Xn=Xn+Gn|0,$o^=Xn,$o=$o>>>32-12|$o<<12,lo=lo+oo|0,to^=lo,to=to>>>32-16|to<<16,Fr=Fr+to|0,oo^=Fr,oo=oo>>>32-12|oo<<12,fo=fo+$o|0,Gn^=fo,Gn=Gn>>>32-8|Gn<<8,Xn=Xn+Gn|0,$o^=Xn,$o=$o>>>32-7|$o<<7,lo=lo+oo|0,to^=lo,to=to>>>32-8|to<<8,Fr=Fr+to|0,oo^=Fr,oo=oo>>>32-7|oo<<7,ao=ao+mo|0,Jr^=ao,Jr=Jr>>>32-8|Jr<<8,Wr=Wr+Jr|0,mo^=Wr,mo=mo>>>32-7|mo<<7,so=so+po|0,ro^=so,ro=ro>>>32-8|ro<<8,Vr=Vr+ro|0,po^=Vr,po=po>>>32-7|po<<7;binary_1.writeUint32LE(so+Nr|0,$r,0),binary_1.writeUint32LE(ao+Dr|0,$r,4),binary_1.writeUint32LE(fo+Br|0,$r,8),binary_1.writeUint32LE(lo+Lr|0,$r,12),binary_1.writeUint32LE(oo+jr|0,$r,16),binary_1.writeUint32LE(po+Ur|0,$r,20),binary_1.writeUint32LE(mo+Gr|0,$r,24),binary_1.writeUint32LE($o+Yr|0,$r,28),binary_1.writeUint32LE(Xn+Qr|0,$r,32),binary_1.writeUint32LE(Fr+Wn|0,$r,36),binary_1.writeUint32LE(Vr+ga|0,$r,40),binary_1.writeUint32LE(Wr+eo|0,$r,44),binary_1.writeUint32LE(Jr+_i|0,$r,48),binary_1.writeUint32LE(Gn+va|0,$r,52),binary_1.writeUint32LE(to+io|0,$r,56),binary_1.writeUint32LE(ro+no|0,$r,60)}function streamXOR($r,pr,Mr,Nr,Dr){if(Dr===void 0&&(Dr=0),$r.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(Nr.length<Mr.length)throw new Error("ChaCha: destination is shorter than source");var Br,Lr;if(Dr===0){if(pr.length!==8&&pr.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");Br=new Uint8Array(16),Lr=Br.length-pr.length,Br.set(pr,Lr)}else{if(pr.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");Br=pr,Lr=Dr}for(var jr=new Uint8Array(64),Ur=0;Ur<Mr.length;Ur+=64){core$1(jr,Br,$r);for(var Gr=Ur;Gr<Ur+64&&Gr<Mr.length;Gr++)Nr[Gr]=Mr[Gr]^jr[Gr-Ur];incrementCounter(Br,0,Lr)}return wipe_1$3.wipe(jr),Dr===0&&wipe_1$3.wipe(Br),Nr}chacha.streamXOR=streamXOR;function stream($r,pr,Mr,Nr){return Nr===void 0&&(Nr=0),wipe_1$3.wipe(Mr),streamXOR($r,pr,Mr,Mr,Nr)}chacha.stream=stream;function incrementCounter($r,pr,Mr){for(var Nr=1;Mr--;)Nr=Nr+($r[pr]&255)|0,$r[pr]=Nr&255,Nr>>>=8,pr++;if(Nr>0)throw new Error("ChaCha: counter overflow")}var poly1305={},constantTime={};Object.defineProperty(constantTime,"__esModule",{value:!0});function select($r,pr,Mr){return~($r-1)&pr|$r-1&Mr}constantTime.select=select;function lessOrEqual($r,pr){return($r|0)-(pr|0)-1>>>31&1}constantTime.lessOrEqual=lessOrEqual;function compare$1($r,pr){if($r.length!==pr.length)return 0;for(var Mr=0,Nr=0;Nr<$r.length;Nr++)Mr|=$r[Nr]^pr[Nr];return 1&Mr-1>>>8}constantTime.compare=compare$1;function equal$1($r,pr){return $r.length===0||pr.length===0?!1:compare$1($r,pr)!==0}constantTime.equal=equal$1;(function($r){Object.defineProperty($r,"__esModule",{value:!0});var pr=constantTime,Mr=wipe$1;$r.DIGEST_LENGTH=16;var Nr=function(){function Lr(jr){this.digestLength=$r.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 Ur=jr[0]|jr[1]<<8;this._r[0]=Ur&8191;var Gr=jr[2]|jr[3]<<8;this._r[1]=(Ur>>>13|Gr<<3)&8191;var Yr=jr[4]|jr[5]<<8;this._r[2]=(Gr>>>10|Yr<<6)&7939;var Qr=jr[6]|jr[7]<<8;this._r[3]=(Yr>>>7|Qr<<9)&8191;var Wn=jr[8]|jr[9]<<8;this._r[4]=(Qr>>>4|Wn<<12)&255,this._r[5]=Wn>>>1&8190;var ga=jr[10]|jr[11]<<8;this._r[6]=(Wn>>>14|ga<<2)&8191;var eo=jr[12]|jr[13]<<8;this._r[7]=(ga>>>11|eo<<5)&8065;var _i=jr[14]|jr[15]<<8;this._r[8]=(eo>>>8|_i<<8)&8191,this._r[9]=_i>>>5&127,this._pad[0]=jr[16]|jr[17]<<8,this._pad[1]=jr[18]|jr[19]<<8,this._pad[2]=jr[20]|jr[21]<<8,this._pad[3]=jr[22]|jr[23]<<8,this._pad[4]=jr[24]|jr[25]<<8,this._pad[5]=jr[26]|jr[27]<<8,this._pad[6]=jr[28]|jr[29]<<8,this._pad[7]=jr[30]|jr[31]<<8}return Lr.prototype._blocks=function(jr,Ur,Gr){for(var Yr=this._fin?0:2048,Qr=this._h[0],Wn=this._h[1],ga=this._h[2],eo=this._h[3],_i=this._h[4],va=this._h[5],io=this._h[6],no=this._h[7],so=this._h[8],ao=this._h[9],fo=this._r[0],lo=this._r[1],oo=this._r[2],po=this._r[3],mo=this._r[4],$o=this._r[5],Xn=this._r[6],Fr=this._r[7],Vr=this._r[8],Wr=this._r[9];Gr>=16;){var Jr=jr[Ur+0]|jr[Ur+1]<<8;Qr+=Jr&8191;var Gn=jr[Ur+2]|jr[Ur+3]<<8;Wn+=(Jr>>>13|Gn<<3)&8191;var to=jr[Ur+4]|jr[Ur+5]<<8;ga+=(Gn>>>10|to<<6)&8191;var ro=jr[Ur+6]|jr[Ur+7]<<8;eo+=(to>>>7|ro<<9)&8191;var Un=jr[Ur+8]|jr[Ur+9]<<8;_i+=(ro>>>4|Un<<12)&8191,va+=Un>>>1&8191;var Hr=jr[Ur+10]|jr[Ur+11]<<8;io+=(Un>>>14|Hr<<2)&8191;var Xr=jr[Ur+12]|jr[Ur+13]<<8;no+=(Hr>>>11|Xr<<5)&8191;var co=jr[Ur+14]|jr[Ur+15]<<8;so+=(Xr>>>8|co<<8)&8191,ao+=co>>>5|Yr;var ho=0,go=ho;go+=Qr*fo,go+=Wn*(5*Wr),go+=ga*(5*Vr),go+=eo*(5*Fr),go+=_i*(5*Xn),ho=go>>>13,go&=8191,go+=va*(5*$o),go+=io*(5*mo),go+=no*(5*po),go+=so*(5*oo),go+=ao*(5*lo),ho+=go>>>13,go&=8191;var bo=ho;bo+=Qr*lo,bo+=Wn*fo,bo+=ga*(5*Wr),bo+=eo*(5*Vr),bo+=_i*(5*Fr),ho=bo>>>13,bo&=8191,bo+=va*(5*Xn),bo+=io*(5*$o),bo+=no*(5*mo),bo+=so*(5*po),bo+=ao*(5*oo),ho+=bo>>>13,bo&=8191;var Eo=ho;Eo+=Qr*oo,Eo+=Wn*lo,Eo+=ga*fo,Eo+=eo*(5*Wr),Eo+=_i*(5*Vr),ho=Eo>>>13,Eo&=8191,Eo+=va*(5*Fr),Eo+=io*(5*Xn),Eo+=no*(5*$o),Eo+=so*(5*mo),Eo+=ao*(5*po),ho+=Eo>>>13,Eo&=8191;var wo=ho;wo+=Qr*po,wo+=Wn*oo,wo+=ga*lo,wo+=eo*fo,wo+=_i*(5*Wr),ho=wo>>>13,wo&=8191,wo+=va*(5*Vr),wo+=io*(5*Fr),wo+=no*(5*Xn),wo+=so*(5*$o),wo+=ao*(5*mo),ho+=wo>>>13,wo&=8191;var Io=ho;Io+=Qr*mo,Io+=Wn*po,Io+=ga*oo,Io+=eo*lo,Io+=_i*fo,ho=Io>>>13,Io&=8191,Io+=va*(5*Wr),Io+=io*(5*Vr),Io+=no*(5*Fr),Io+=so*(5*Xn),Io+=ao*(5*$o),ho+=Io>>>13,Io&=8191;var Po=ho;Po+=Qr*$o,Po+=Wn*mo,Po+=ga*po,Po+=eo*oo,Po+=_i*lo,ho=Po>>>13,Po&=8191,Po+=va*fo,Po+=io*(5*Wr),Po+=no*(5*Vr),Po+=so*(5*Fr),Po+=ao*(5*Xn),ho+=Po>>>13,Po&=8191;var yo=ho;yo+=Qr*Xn,yo+=Wn*$o,yo+=ga*mo,yo+=eo*po,yo+=_i*oo,ho=yo>>>13,yo&=8191,yo+=va*lo,yo+=io*fo,yo+=no*(5*Wr),yo+=so*(5*Vr),yo+=ao*(5*Fr),ho+=yo>>>13,yo&=8191;var xo=ho;xo+=Qr*Fr,xo+=Wn*Xn,xo+=ga*$o,xo+=eo*mo,xo+=_i*po,ho=xo>>>13,xo&=8191,xo+=va*oo,xo+=io*lo,xo+=no*fo,xo+=so*(5*Wr),xo+=ao*(5*Vr),ho+=xo>>>13,xo&=8191;var Mo=ho;Mo+=Qr*Vr,Mo+=Wn*Fr,Mo+=ga*Xn,Mo+=eo*$o,Mo+=_i*mo,ho=Mo>>>13,Mo&=8191,Mo+=va*po,Mo+=io*oo,Mo+=no*lo,Mo+=so*fo,Mo+=ao*(5*Wr),ho+=Mo>>>13,Mo&=8191;var qo=ho;qo+=Qr*Wr,qo+=Wn*Vr,qo+=ga*Fr,qo+=eo*Xn,qo+=_i*$o,ho=qo>>>13,qo&=8191,qo+=va*mo,qo+=io*po,qo+=no*oo,qo+=so*lo,qo+=ao*fo,ho+=qo>>>13,qo&=8191,ho=(ho<<2)+ho|0,ho=ho+go|0,go=ho&8191,ho=ho>>>13,bo+=ho,Qr=go,Wn=bo,ga=Eo,eo=wo,_i=Io,va=Po,io=yo,no=xo,so=Mo,ao=qo,Ur+=16,Gr-=16}this._h[0]=Qr,this._h[1]=Wn,this._h[2]=ga,this._h[3]=eo,this._h[4]=_i,this._h[5]=va,this._h[6]=io,this._h[7]=no,this._h[8]=so,this._h[9]=ao},Lr.prototype.finish=function(jr,Ur){Ur===void 0&&(Ur=0);var Gr=new Uint16Array(10),Yr,Qr,Wn,ga;if(this._leftover){for(ga=this._leftover,this._buffer[ga++]=1;ga<16;ga++)this._buffer[ga]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(Yr=this._h[1]>>>13,this._h[1]&=8191,ga=2;ga<10;ga++)this._h[ga]+=Yr,Yr=this._h[ga]>>>13,this._h[ga]&=8191;for(this._h[0]+=Yr*5,Yr=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=Yr,Yr=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=Yr,Gr[0]=this._h[0]+5,Yr=Gr[0]>>>13,Gr[0]&=8191,ga=1;ga<10;ga++)Gr[ga]=this._h[ga]+Yr,Yr=Gr[ga]>>>13,Gr[ga]&=8191;for(Gr[9]-=8192,Qr=(Yr^1)-1,ga=0;ga<10;ga++)Gr[ga]&=Qr;for(Qr=~Qr,ga=0;ga<10;ga++)this._h[ga]=this._h[ga]&Qr|Gr[ga];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,Wn=this._h[0]+this._pad[0],this._h[0]=Wn&65535,ga=1;ga<8;ga++)Wn=(this._h[ga]+this._pad[ga]|0)+(Wn>>>16)|0,this._h[ga]=Wn&65535;return jr[Ur+0]=this._h[0]>>>0,jr[Ur+1]=this._h[0]>>>8,jr[Ur+2]=this._h[1]>>>0,jr[Ur+3]=this._h[1]>>>8,jr[Ur+4]=this._h[2]>>>0,jr[Ur+5]=this._h[2]>>>8,jr[Ur+6]=this._h[3]>>>0,jr[Ur+7]=this._h[3]>>>8,jr[Ur+8]=this._h[4]>>>0,jr[Ur+9]=this._h[4]>>>8,jr[Ur+10]=this._h[5]>>>0,jr[Ur+11]=this._h[5]>>>8,jr[Ur+12]=this._h[6]>>>0,jr[Ur+13]=this._h[6]>>>8,jr[Ur+14]=this._h[7]>>>0,jr[Ur+15]=this._h[7]>>>8,this._finished=!0,this},Lr.prototype.update=function(jr){var Ur=0,Gr=jr.length,Yr;if(this._leftover){Yr=16-this._leftover,Yr>Gr&&(Yr=Gr);for(var Qr=0;Qr<Yr;Qr++)this._buffer[this._leftover+Qr]=jr[Ur+Qr];if(Gr-=Yr,Ur+=Yr,this._leftover+=Yr,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(Gr>=16&&(Yr=Gr-Gr%16,this._blocks(jr,Ur,Yr),Ur+=Yr,Gr-=Yr),Gr){for(var Qr=0;Qr<Gr;Qr++)this._buffer[this._leftover+Qr]=jr[Ur+Qr];this._leftover+=Gr}return this},Lr.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var jr=new Uint8Array(16);return this.finish(jr),jr},Lr.prototype.clean=function(){return Mr.wipe(this._buffer),Mr.wipe(this._r),Mr.wipe(this._h),Mr.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},Lr}();$r.Poly1305=Nr;function Dr(Lr,jr){var Ur=new Nr(Lr);Ur.update(jr);var Gr=Ur.digest();return Ur.clean(),Gr}$r.oneTimeAuth=Dr;function Br(Lr,jr){return Lr.length!==$r.DIGEST_LENGTH||jr.length!==$r.DIGEST_LENGTH?!1:pr.equal(Lr,jr)}$r.equal=Br})(poly1305);(function($r){Object.defineProperty($r,"__esModule",{value:!0});var pr=chacha,Mr=poly1305,Nr=wipe$1,Dr=binary,Br=constantTime;$r.KEY_LENGTH=32,$r.NONCE_LENGTH=12,$r.TAG_LENGTH=16;var Lr=new Uint8Array(16),jr=function(){function Ur(Gr){if(this.nonceLength=$r.NONCE_LENGTH,this.tagLength=$r.TAG_LENGTH,Gr.length!==$r.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(Gr)}return Ur.prototype.seal=function(Gr,Yr,Qr,Wn){if(Gr.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var ga=new Uint8Array(16);ga.set(Gr,ga.length-Gr.length);var eo=new Uint8Array(32);pr.stream(this._key,ga,eo,4);var _i=Yr.length+this.tagLength,va;if(Wn){if(Wn.length!==_i)throw new Error("ChaCha20Poly1305: incorrect destination length");va=Wn}else va=new Uint8Array(_i);return pr.streamXOR(this._key,ga,Yr,va,4),this._authenticate(va.subarray(va.length-this.tagLength,va.length),eo,va.subarray(0,va.length-this.tagLength),Qr),Nr.wipe(ga),va},Ur.prototype.open=function(Gr,Yr,Qr,Wn){if(Gr.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(Yr.length<this.tagLength)return null;var ga=new Uint8Array(16);ga.set(Gr,ga.length-Gr.length);var eo=new Uint8Array(32);pr.stream(this._key,ga,eo,4);var _i=new Uint8Array(this.tagLength);if(this._authenticate(_i,eo,Yr.subarray(0,Yr.length-this.tagLength),Qr),!Br.equal(_i,Yr.subarray(Yr.length-this.tagLength,Yr.length)))return null;var va=Yr.length-this.tagLength,io;if(Wn){if(Wn.length!==va)throw new Error("ChaCha20Poly1305: incorrect destination length");io=Wn}else io=new Uint8Array(va);return pr.streamXOR(this._key,ga,Yr.subarray(0,Yr.length-this.tagLength),io,4),Nr.wipe(ga),io},Ur.prototype.clean=function(){return Nr.wipe(this._key),this},Ur.prototype._authenticate=function(Gr,Yr,Qr,Wn){var ga=new Mr.Poly1305(Yr);Wn&&(ga.update(Wn),Wn.length%16>0&&ga.update(Lr.subarray(Wn.length%16))),ga.update(Qr),Qr.length%16>0&&ga.update(Lr.subarray(Qr.length%16));var eo=new Uint8Array(8);Wn&&Dr.writeUint64LE(Wn.length,eo),ga.update(eo),Dr.writeUint64LE(Qr.length,eo),ga.update(eo);for(var _i=ga.digest(),va=0;va<_i.length;va++)Gr[va]=_i[va];ga.clean(),Nr.wipe(_i),Nr.wipe(eo)},Ur}();$r.ChaCha20Poly1305=jr})(chacha20poly1305);var hkdf={},hmac$3={},hash$7={};Object.defineProperty(hash$7,"__esModule",{value:!0});function isSerializableHash($r){return typeof $r.saveState<"u"&&typeof $r.restoreState<"u"&&typeof $r.cleanSavedState<"u"}hash$7.isSerializableHash=isSerializableHash;Object.defineProperty(hmac$3,"__esModule",{value:!0});var hash_1=hash$7,constant_time_1=constantTime,wipe_1$2=wipe$1,HMAC=function(){function $r(pr,Mr){this._finished=!1,this._inner=new pr,this._outer=new pr,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var Nr=new Uint8Array(this.blockSize);Mr.length>this.blockSize?this._inner.update(Mr).finish(Nr).clean():Nr.set(Mr);for(var Dr=0;Dr<Nr.length;Dr++)Nr[Dr]^=54;this._inner.update(Nr);for(var Dr=0;Dr<Nr.length;Dr++)Nr[Dr]^=106;this._outer.update(Nr),hash_1.isSerializableHash(this._inner)&&hash_1.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),wipe_1$2.wipe(Nr)}return $r.prototype.reset=function(){if(!hash_1.isSerializableHash(this._inner)||!hash_1.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},$r.prototype.clean=function(){hash_1.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),hash_1.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},$r.prototype.update=function(pr){return this._inner.update(pr),this},$r.prototype.finish=function(pr){return this._finished?(this._outer.finish(pr),this):(this._inner.finish(pr),this._outer.update(pr.subarray(0,this.digestLength)).finish(pr),this._finished=!0,this)},$r.prototype.digest=function(){var pr=new Uint8Array(this.digestLength);return this.finish(pr),pr},$r.prototype.saveState=function(){if(!hash_1.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},$r.prototype.restoreState=function(pr){if(!hash_1.isSerializableHash(this._inner)||!hash_1.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(pr),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},$r.prototype.cleanSavedState=function(pr){if(!hash_1.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(pr)},$r}();hmac$3.HMAC=HMAC;function hmac$2($r,pr,Mr){var Nr=new HMAC($r,pr);Nr.update(Mr);var Dr=Nr.digest();return Nr.clean(),Dr}hmac$3.hmac=hmac$2;hmac$3.equal=constant_time_1.equal;Object.defineProperty(hkdf,"__esModule",{value:!0});var hmac_1=hmac$3,wipe_1$1=wipe$1,HKDF=function(){function $r(pr,Mr,Nr,Dr){Nr===void 0&&(Nr=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=pr,this._info=Dr;var Br=hmac_1.hmac(this._hash,Nr,Mr);this._hmac=new hmac_1.HMAC(pr,Br),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return $r.prototype._fillBuffer=function(){this._counter[0]++;var pr=this._counter[0];if(pr===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),pr>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},$r.prototype.expand=function(pr){for(var Mr=new Uint8Array(pr),Nr=0;Nr<Mr.length;Nr++)this._bufpos===this._buffer.length&&this._fillBuffer(),Mr[Nr]=this._buffer[this._bufpos++];return Mr},$r.prototype.clean=function(){this._hmac.clean(),wipe_1$1.wipe(this._buffer),wipe_1$1.wipe(this._counter),this._bufpos=0},$r}(),HKDF_1=hkdf.HKDF=HKDF,random={},system={},browser$g={};Object.defineProperty(browser$g,"__esModule",{value:!0});browser$g.BrowserRandomSource=void 0;const QUOTA=65536;class BrowserRandomSource{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const pr=typeof self<"u"?self.crypto||self.msCrypto:null;pr&&pr.getRandomValues!==void 0&&(this._crypto=pr,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(pr){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const Mr=new Uint8Array(pr);for(let Nr=0;Nr<Mr.length;Nr+=QUOTA)this._crypto.getRandomValues(Mr.subarray(Nr,Nr+Math.min(Mr.length-Nr,QUOTA)));return Mr}}browser$g.BrowserRandomSource=BrowserRandomSource;function commonjsRequire($r){throw new Error('Could not dynamically require "'+$r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var node$1={},cryptoBrowserify={},browser$f={exports:{}},safeBuffer$1={exports:{}};const require$$0$4=getAugmentedNamespace(dist$b);/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function($r,pr){var Mr=require$$0$4,Nr=Mr.Buffer;function Dr(Lr,jr){for(var Ur in Lr)jr[Ur]=Lr[Ur]}Nr.from&&Nr.alloc&&Nr.allocUnsafe&&Nr.allocUnsafeSlow?$r.exports=Mr:(Dr(Mr,pr),pr.Buffer=Br);function Br(Lr,jr,Ur){return Nr(Lr,jr,Ur)}Br.prototype=Object.create(Nr.prototype),Dr(Nr,Br),Br.from=function(Lr,jr,Ur){if(typeof Lr=="number")throw new TypeError("Argument must not be a number");return Nr(Lr,jr,Ur)},Br.alloc=function(Lr,jr,Ur){if(typeof Lr!="number")throw new TypeError("Argument must be a number");var Gr=Nr(Lr);return jr!==void 0?typeof Ur=="string"?Gr.fill(jr,Ur):Gr.fill(jr):Gr.fill(0),Gr},Br.allocUnsafe=function(Lr){if(typeof Lr!="number")throw new TypeError("Argument must be a number");return Nr(Lr)},Br.allocUnsafeSlow=function(Lr){if(typeof Lr!="number")throw new TypeError("Argument must be a number");return Mr.SlowBuffer(Lr)}})(safeBuffer$1,safeBuffer$1.exports);var safeBufferExports=safeBuffer$1.exports,MAX_BYTES=65536,MAX_UINT32=4294967295;function oldBrowser$1(){throw new Error(`Secure random number generation is not supported by this browser.
|
|
125
|
+
`}])),fortmatic}var __createBinding$9=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function($r,pr,Mr,Nr){Nr===void 0&&(Nr=Mr),Object.defineProperty($r,Nr,{enumerable:!0,get:function(){return pr[Mr]}})}:function($r,pr,Mr,Nr){Nr===void 0&&(Nr=Mr),$r[Nr]=pr[Mr]}),__setModuleDefault$8=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function($r,pr){Object.defineProperty($r,"default",{enumerable:!0,value:pr})}:function($r,pr){$r.default=pr}),__importStar$9=commonjsGlobal&&commonjsGlobal.__importStar||function($r){if($r&&$r.__esModule)return $r;var pr={};if($r!=null)for(var Mr in $r)Mr!=="default"&&Object.prototype.hasOwnProperty.call($r,Mr)&&__createBinding$9(pr,$r,Mr);return __setModuleDefault$8(pr,$r),pr};Object.defineProperty(FortmaticConnector$1,"__esModule",{value:!0});FortmaticConnector$1.FortmaticConnector=void 0;const abstract_connector_1=require$$0$7,schemas_1$4=dist$6,configuration_1$5=configuration$1;class FortmaticConnector extends abstract_connector_1.AbstractConnector{constructor(pr){const Mr=configuration_1$5.getConfiguration()[schemas_1$4.ProviderType.FORTMATIC],Nr=Object.keys(Mr.apiKeys).map(Dr=>Number(Dr));if(!Nr.includes(pr))throw new Error(`Invariant error: Unsupported chainId ${pr}`);super({supportedChainIds:Nr}),this.apiKey=Mr.apiKeys[pr],this.chainId=pr,this.rpcUrl=Mr.urls[pr]}async activate(){if(!this.fortmatic){const{default:Mr}=await Promise.resolve().then(()=>__importStar$9(requireFortmatic()));this.fortmatic=new Mr(this.apiKey,{rpcUrl:this.rpcUrl,chainId:this.chainId})}const pr=await this.fortmatic.getProvider().enable().then(Mr=>Mr[0]);return{provider:this.fortmatic.getProvider(),chainId:this.chainId,account:pr}}getApiKey(){return this.apiKey}async getProvider(){return this.fortmatic.getProvider()}async getChainId(){return this.chainId}async getAccount(){return this.fortmatic.getProvider().send("eth_accounts").then(pr=>pr[0])}deactivate(){}async close(){await this.fortmatic.user.logout(),this.emitDeactivate()}}FortmaticConnector$1.FortmaticConnector=FortmaticConnector;var InjectedConnector$2={};function warning$2($r,pr){}function _extends$4(){return _extends$4=Object.assign||function($r){for(var pr=1;pr<arguments.length;pr++){var Mr=arguments[pr];for(var Nr in Mr)Object.prototype.hasOwnProperty.call(Mr,Nr)&&($r[Nr]=Mr[Nr])}return $r},_extends$4.apply(this,arguments)}function _inheritsLoose$4($r,pr){$r.prototype=Object.create(pr.prototype),$r.prototype.constructor=$r,$r.__proto__=pr}function _getPrototypeOf$x($r){return _getPrototypeOf$x=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$x($r)}function _setPrototypeOf$z($r,pr){return _setPrototypeOf$z=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$z($r,pr)}function isNativeReflectConstruct(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function _construct$1($r,pr,Mr){return isNativeReflectConstruct()?_construct$1=Reflect.construct:_construct$1=function(Dr,Br,Lr){var jr=[null];jr.push.apply(jr,Br);var Ur=Function.bind.apply(Dr,jr),Gr=new Ur;return Lr&&_setPrototypeOf$z(Gr,Lr.prototype),Gr},_construct$1.apply(null,arguments)}function _isNativeFunction$1($r){return Function.toString.call($r).indexOf("[native code]")!==-1}function _wrapNativeSuper$1($r){var pr=typeof Map=="function"?new Map:void 0;return _wrapNativeSuper$1=function(Nr){if(Nr===null||!_isNativeFunction$1(Nr))return Nr;if(typeof Nr!="function")throw new TypeError("Super expression must either be null or a function");if(typeof pr<"u"){if(pr.has(Nr))return pr.get(Nr);pr.set(Nr,Dr)}function Dr(){return _construct$1(Nr,arguments,_getPrototypeOf$x(this).constructor)}return Dr.prototype=Object.create(Nr.prototype,{constructor:{value:Dr,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf$z(Dr,Nr)},_wrapNativeSuper$1($r)}function _assertThisInitialized$y($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}typeof Symbol<"u"&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")));typeof Symbol<"u"&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));function _catch($r,pr){try{var Mr=$r()}catch(Nr){return pr(Nr)}return Mr&&Mr.then?Mr.then(void 0,pr):Mr}function parseSendReturn($r){return $r.hasOwnProperty("result")?$r.result:$r}var NoEthereumProviderError=function($r){_inheritsLoose$4(pr,$r);function pr(){var Mr;return Mr=$r.call(this)||this,Mr.name=Mr.constructor.name,Mr.message="No Ethereum provider was found on window.ethereum.",Mr}return pr}(_wrapNativeSuper$1(Error)),UserRejectedRequestError=function($r){_inheritsLoose$4(pr,$r);function pr(){var Mr;return Mr=$r.call(this)||this,Mr.name=Mr.constructor.name,Mr.message="The user rejected the request.",Mr}return pr}(_wrapNativeSuper$1(Error)),InjectedConnector$1=function($r){_inheritsLoose$4(pr,$r);function pr(Nr){var Dr;return Dr=$r.call(this,Nr)||this,Dr.handleNetworkChanged=Dr.handleNetworkChanged.bind(_assertThisInitialized$y(Dr)),Dr.handleChainChanged=Dr.handleChainChanged.bind(_assertThisInitialized$y(Dr)),Dr.handleAccountsChanged=Dr.handleAccountsChanged.bind(_assertThisInitialized$y(Dr)),Dr.handleClose=Dr.handleClose.bind(_assertThisInitialized$y(Dr)),Dr}var Mr=pr.prototype;return Mr.handleChainChanged=function(Dr){this.emitUpdate({chainId:Dr,provider:window.ethereum})},Mr.handleAccountsChanged=function(Dr){Dr.length===0?this.emitDeactivate():this.emitUpdate({account:Dr[0]})},Mr.handleClose=function(Dr,Br){this.emitDeactivate()},Mr.handleNetworkChanged=function(Dr){this.emitUpdate({chainId:Dr,provider:window.ethereum})},Mr.activate=function(){try{var Dr=function(Yr){if(Br)return Yr;function Qr(){return _extends$4({provider:window.ethereum},jr?{account:jr}:{})}var Wn=function(){if(!jr)return Promise.resolve(window.ethereum.enable().then(function(ga){return ga&&parseSendReturn(ga)[0]})).then(function(ga){jr=ga})}();return Wn&&Wn.then?Wn.then(Qr):Qr(Wn)},Br=!1,Lr=this;if(!window.ethereum)throw new NoEthereumProviderError;window.ethereum.on&&(window.ethereum.on("chainChanged",Lr.handleChainChanged),window.ethereum.on("accountsChanged",Lr.handleAccountsChanged),window.ethereum.on("close",Lr.handleClose),window.ethereum.on("networkChanged",Lr.handleNetworkChanged)),window.ethereum.isMetaMask&&(window.ethereum.autoRefreshOnNetworkChange=!1);var jr,Ur=_catch(function(){return Promise.resolve(window.ethereum.send("eth_requestAccounts").then(function(Gr){return parseSendReturn(Gr)[0]})).then(function(Gr){jr=Gr})},function(Gr){if(Gr.code===4001)throw new UserRejectedRequestError});return Promise.resolve(Ur&&Ur.then?Ur.then(Dr):Dr(Ur))}catch(Gr){return Promise.reject(Gr)}},Mr.getProvider=function(){try{return Promise.resolve(window.ethereum)}catch(Dr){return Promise.reject(Dr)}},Mr.getChainId=function(){try{var Dr=function(){function Ur(){if(!Br)try{Br=parseSendReturn(window.ethereum.send({method:"net_version"}))}catch{}return Br||(window.ethereum.isDapper?Br=parseSendReturn(window.ethereum.cachedResults.net_version):Br=window.ethereum.chainId||window.ethereum.netVersion||window.ethereum.networkVersion||window.ethereum._chainId),Br}var Gr=function(){if(!Br){var Yr=_catch(function(){return Promise.resolve(window.ethereum.send("net_version").then(parseSendReturn)).then(function(Qr){Br=Qr})},function(){});if(Yr&&Yr.then)return Yr.then(function(){})}}();return Gr&&Gr.then?Gr.then(Ur):Ur(Gr)};if(!window.ethereum)throw new NoEthereumProviderError;var Br,Lr=_catch(function(){return Promise.resolve(window.ethereum.send("eth_chainId").then(parseSendReturn)).then(function(jr){Br=jr})},function(){});return Promise.resolve(Lr&&Lr.then?Lr.then(Dr):Dr(Lr))}catch(jr){return Promise.reject(jr)}},Mr.getAccount=function(){try{var Dr=function(){function Ur(){return Br||(Br=parseSendReturn(window.ethereum.send({method:"eth_accounts"}))[0]),Br}var Gr=function(){if(!Br){var Yr=_catch(function(){return Promise.resolve(window.ethereum.enable().then(function(Qr){return parseSendReturn(Qr)[0]})).then(function(Qr){Br=Qr})},function(){});if(Yr&&Yr.then)return Yr.then(function(){})}}();return Gr&&Gr.then?Gr.then(Ur):Ur(Gr)};if(!window.ethereum)throw new NoEthereumProviderError;var Br,Lr=_catch(function(){return Promise.resolve(window.ethereum.send("eth_accounts").then(function(jr){return parseSendReturn(jr)[0]})).then(function(jr){Br=jr})},function(){});return Promise.resolve(Lr&&Lr.then?Lr.then(Dr):Dr(Lr))}catch(jr){return Promise.reject(jr)}},Mr.deactivate=function(){window.ethereum&&window.ethereum.removeListener&&(window.ethereum.removeListener("chainChanged",this.handleChainChanged),window.ethereum.removeListener("accountsChanged",this.handleAccountsChanged),window.ethereum.removeListener("close",this.handleClose),window.ethereum.removeListener("networkChanged",this.handleNetworkChanged))},Mr.isAuthorized=function(){try{return window.ethereum?Promise.resolve(_catch(function(){return Promise.resolve(window.ethereum.send("eth_accounts").then(function(Dr){return parseSendReturn(Dr).length>0}))},function(){return!1})):Promise.resolve(!1)}catch(Dr){return Promise.reject(Dr)}},pr}(AbstractConnector);const injectedConnector_esm=Object.freeze(Object.defineProperty({__proto__:null,InjectedConnector:InjectedConnector$1,NoEthereumProviderError,UserRejectedRequestError},Symbol.toStringTag,{value:"Module"})),require$$0$6=getAugmentedNamespace(injectedConnector_esm);Object.defineProperty(InjectedConnector$2,"__esModule",{value:!0});InjectedConnector$2.InjectedConnector=void 0;const injected_connector_1=require$$0$6;class InjectedConnector extends injected_connector_1.InjectedConnector{constructor(pr){super({supportedChainIds:[pr]})}}InjectedConnector$2.InjectedConnector=InjectedConnector;var NetworkConnector$2={},prefix="Invariant failed";function invariant($r,pr){if(!$r)throw new Error(prefix)}function _inheritsLoose$3($r,pr){$r.prototype=Object.create(pr.prototype),$r.prototype.constructor=$r,_setPrototypeOf$y($r,pr)}function _getPrototypeOf$w($r){return _getPrototypeOf$w=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$w($r)}function _setPrototypeOf$y($r,pr){return _setPrototypeOf$y=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$y($r,pr)}function _isNativeReflectConstruct$w(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function _construct($r,pr,Mr){return _isNativeReflectConstruct$w()?_construct=Reflect.construct:_construct=function(Dr,Br,Lr){var jr=[null];jr.push.apply(jr,Br);var Ur=Function.bind.apply(Dr,jr),Gr=new Ur;return Lr&&_setPrototypeOf$y(Gr,Lr.prototype),Gr},_construct.apply(null,arguments)}function _isNativeFunction($r){return Function.toString.call($r).indexOf("[native code]")!==-1}function _wrapNativeSuper($r){var pr=typeof Map=="function"?new Map:void 0;return _wrapNativeSuper=function(Nr){if(Nr===null||!_isNativeFunction(Nr))return Nr;if(typeof Nr!="function")throw new TypeError("Super expression must either be null or a function");if(typeof pr<"u"){if(pr.has(Nr))return pr.get(Nr);pr.set(Nr,Dr)}function Dr(){return _construct(Nr,arguments,_getPrototypeOf$w(this).constructor)}return Dr.prototype=Object.create(Nr.prototype,{constructor:{value:Dr,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf$y(Dr,Nr)},_wrapNativeSuper($r)}var RequestError=function($r){_inheritsLoose$3(pr,$r);function pr(Mr,Nr,Dr){var Br;return Br=$r.call(this)||this,Br.code=Nr,Br.data=Dr,Br.name=Br.constructor.name,Br.message=Mr,Br}return pr}(_wrapNativeSuper(Error)),MiniRpcProvider=function(pr,Mr){var Nr=this,Dr=this;this.isMetaMask=!1,this.sendAsync=function(Lr,jr){console.log("sendAsync",Lr.method,Lr.params),Dr.request(Lr.method,Lr.params).then(function(Ur){return jr(null,{jsonrpc:"2.0",id:Lr.id,result:Ur})}).catch(function(Ur){return jr(Ur,null)})},this.request=function(Lr,jr){try{return typeof Lr!="string"&&(jr=Lr.params,Lr=Lr.method),Promise.resolve(fetch(Nr.url,{method:"POST",body:JSON.stringify({jsonrpc:"2.0",id:1,method:Lr,params:jr}),headers:{"Content-Type":"application/json"}})).then(function(Ur){if(!Ur.ok)throw new RequestError(Ur.status+": "+Ur.statusText,-32e3);return Promise.resolve(Ur.json()).then(function(Gr){if("error"in Gr){var Yr,Qr,Wn;throw new RequestError(Gr==null||(Yr=Gr.error)==null?void 0:Yr.message,Gr==null||(Qr=Gr.error)==null?void 0:Qr.code,Gr==null||(Wn=Gr.error)==null?void 0:Wn.data)}else{if("result"in Gr)return Gr.result;throw new RequestError("Received unexpected JSON-RPC response to "+Lr+" request.",-32e3,Gr)}})})}catch(Ur){return Promise.reject(Ur)}},this.chainId=pr,this.url=Mr;var Br=new URL(Mr);this.host=Br.host,this.path=Br.pathname},NetworkConnector$1=function($r){_inheritsLoose$3(pr,$r);function pr(Nr){var Dr,Br=Nr.urls,Lr=Nr.defaultChainId;return Lr||Object.keys(Br).length===1||invariant(!1),Dr=$r.call(this,{supportedChainIds:Object.keys(Br).map(function(jr){return Number(jr)})})||this,Dr.currentChainId=Lr||Number(Object.keys(Br)[0]),Dr.providers=Object.keys(Br).reduce(function(jr,Ur){return jr[Number(Ur)]=new MiniRpcProvider(Number(Ur),Br[Number(Ur)]),jr},{}),Dr}var Mr=pr.prototype;return Mr.activate=function(){try{var Dr=this;return Promise.resolve({provider:Dr.providers[Dr.currentChainId],chainId:Dr.currentChainId,account:null})}catch(Br){return Promise.reject(Br)}},Mr.getProvider=function(){try{var Dr=this;return Promise.resolve(Dr.providers[Dr.currentChainId])}catch(Br){return Promise.reject(Br)}},Mr.getChainId=function(){try{var Dr=this;return Promise.resolve(Dr.currentChainId)}catch(Br){return Promise.reject(Br)}},Mr.getAccount=function(){return Promise.resolve(null)},Mr.deactivate=function(){},Mr.changeChainId=function(Dr){Object.keys(this.providers).includes(Dr.toString())||invariant(!1),this.currentChainId=Dr,this.emitUpdate({provider:this.providers[this.currentChainId],chainId:Dr})},pr}(AbstractConnector);const networkConnector_esm=Object.freeze(Object.defineProperty({__proto__:null,NetworkConnector:NetworkConnector$1,RequestError},Symbol.toStringTag,{value:"Module"})),require$$1$4=getAugmentedNamespace(networkConnector_esm);Object.defineProperty(NetworkConnector$2,"__esModule",{value:!0});NetworkConnector$2.NetworkConnector=void 0;const provider_type_1$1=providerType,network_connector_1=require$$1$4,configuration_1$4=configuration$1;class NetworkConnector extends network_connector_1.NetworkConnector{constructor(pr){super({urls:configuration_1$4.getConfiguration()[provider_type_1$1.ProviderType.NETWORK].urls,defaultChainId:pr})}}NetworkConnector$2.NetworkConnector=NetworkConnector;var WalletLinkConnector$2={};const scriptRel="modulepreload",assetsURL=function($r){return"https://cdn.decentraland.org/@dcl/auth-site/1.3.2-7900126256.commit-8819962/"+$r},seen={},__vitePreload=function(pr,Mr,Nr){if(!Mr||Mr.length===0)return pr();const Dr=document.getElementsByTagName("link");return Promise.all(Mr.map(Br=>{if(Br=assetsURL(Br),Br in seen)return;seen[Br]=!0;const Lr=Br.endsWith(".css"),jr=Lr?'[rel="stylesheet"]':"";if(!!Nr)for(let Yr=Dr.length-1;Yr>=0;Yr--){const Qr=Dr[Yr];if(Qr.href===Br&&(!Lr||Qr.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${Br}"]${jr}`))return;const Gr=document.createElement("link");if(Gr.rel=Lr?"stylesheet":scriptRel,Lr||(Gr.as="script",Gr.crossOrigin=""),Gr.href=Br,document.head.appendChild(Gr),Lr)return new Promise((Yr,Qr)=>{Gr.addEventListener("load",Yr),Gr.addEventListener("error",()=>Qr(new Error(`Unable to preload CSS for ${Br}`)))})})).then(()=>pr()).catch(Br=>{const Lr=new Event("vite:preloadError",{cancelable:!0});if(Lr.payload=Br,window.dispatchEvent(Lr),!Lr.defaultPrevented)throw Br})};function _extends$3(){return _extends$3=Object.assign||function($r){for(var pr=1;pr<arguments.length;pr++){var Mr=arguments[pr];for(var Nr in Mr)Object.prototype.hasOwnProperty.call(Mr,Nr)&&($r[Nr]=Mr[Nr])}return $r},_extends$3.apply(this,arguments)}function _inheritsLoose$2($r,pr){$r.prototype=Object.create(pr.prototype),$r.prototype.constructor=$r,_setPrototypeOf$x($r,pr)}function _setPrototypeOf$x($r,pr){return _setPrototypeOf$x=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$x($r,pr)}function _assertThisInitialized$x($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}var CHAIN_ID=1,WalletLinkConnector$1=function($r){_inheritsLoose$2(pr,$r);function pr(Nr){var Dr,Br=Nr.url,Lr=Nr.appName,jr=Nr.appLogoUrl,Ur=Nr.darkMode,Gr=Nr.supportedChainIds;return Dr=$r.call(this,{supportedChainIds:Gr})||this,Dr.url=Br,Dr.appName=Lr,Dr.appLogoUrl=jr,Dr.darkMode=Ur||!1,Dr.handleChainChanged=Dr.handleChainChanged.bind(_assertThisInitialized$x(Dr)),Dr.handleAccountsChanged=Dr.handleAccountsChanged.bind(_assertThisInitialized$x(Dr)),Dr}var Mr=pr.prototype;return Mr.activate=function(){try{var Dr=this,Br=function(){return Promise.resolve(Dr.provider.request({method:"eth_requestAccounts"})).then(function(Ur){var Gr=Ur[0];return Dr.provider.on("chainChanged",Dr.handleChainChanged),Dr.provider.on("accountsChanged",Dr.handleAccountsChanged),{provider:Dr.provider,account:Gr}})},Lr=function(){if(window.ethereum&&window.ethereum.isCoinbaseWallet===!0)Dr.provider=window.ethereum;else{var jr=function(){if(!Dr.walletLink)return Promise.resolve(__vitePreload(()=>import("./index-eea45a12.js").then(Ur=>Ur.i),[]).then(function(Ur){var Gr;return(Gr=Ur==null?void 0:Ur.default)!=null?Gr:Ur})).then(function(Ur){Dr.walletLink=new Ur(_extends$3({appName:Dr.appName,darkMode:Dr.darkMode},Dr.appLogoUrl?{appLogoUrl:Dr.appLogoUrl}:{})),Dr.provider=Dr.walletLink.makeWeb3Provider(Dr.url,CHAIN_ID)})}();if(jr&&jr.then)return jr.then(function(){})}}();return Promise.resolve(Lr&&Lr.then?Lr.then(Br):Br(Lr))}catch(jr){return Promise.reject(jr)}},Mr.getProvider=function(){try{var Dr=this;return Promise.resolve(Dr.provider)}catch(Br){return Promise.reject(Br)}},Mr.getChainId=function(){try{var Dr=this;return Promise.resolve(Dr.provider.chainId)}catch(Br){return Promise.reject(Br)}},Mr.getAccount=function(){try{var Dr=this;return Promise.resolve(Dr.provider.request({method:"eth_requestAccounts"})).then(function(Br){return Br[0]})}catch(Br){return Promise.reject(Br)}},Mr.deactivate=function(){this.provider.removeListener("chainChanged",this.handleChainChanged),this.provider.removeListener("accountsChanged",this.handleAccountsChanged)},Mr.close=function(){try{var Dr=this;return Dr.provider.close(),Dr.emitDeactivate(),Promise.resolve()}catch(Br){return Promise.reject(Br)}},Mr.handleChainChanged=function(Dr){this.emitUpdate({chainId:Dr})},Mr.handleAccountsChanged=function(Dr){this.emitUpdate({account:Dr[0]})},pr}(AbstractConnector);const walletlinkConnector_esm=Object.freeze(Object.defineProperty({__proto__:null,WalletLinkConnector:WalletLinkConnector$1},Symbol.toStringTag,{value:"Module"})),require$$1$3=getAugmentedNamespace(walletlinkConnector_esm);Object.defineProperty(WalletLinkConnector$2,"__esModule",{value:!0});WalletLinkConnector$2.WalletLinkConnector=void 0;const schemas_1$3=dist$6,walletlink_connector_1=require$$1$3,configuration_1$3=configuration$1;class WalletLinkConnector extends walletlink_connector_1.WalletLinkConnector{constructor(pr){const Mr=configuration_1$3.getConfiguration()[schemas_1$3.ProviderType.WALLET_LINK];super({url:Mr.urls[pr],appName:Mr.appName,supportedChainIds:[pr]})}}WalletLinkConnector$2.WalletLinkConnector=WalletLinkConnector;var WalletConnectV2Connector$1={};const t=Symbol(),s$1=Object.getPrototypeOf,c$2=new WeakMap,l$1=$r=>$r&&(c$2.has($r)?c$2.get($r):s$1($r)===Object.prototype||s$1($r)===Array.prototype),y$5=$r=>l$1($r)&&$r[t]||null,h$4=($r,pr=!0)=>{c$2.set($r,pr)},isObject$1=$r=>typeof $r=="object"&&$r!==null,proxyStateMap=new WeakMap,refSet=new WeakSet,buildProxyFunction=($r=Object.is,pr=(Gr,Yr)=>new Proxy(Gr,Yr),Mr=Gr=>isObject$1(Gr)&&!refSet.has(Gr)&&(Array.isArray(Gr)||!(Symbol.iterator in Gr))&&!(Gr instanceof WeakMap)&&!(Gr instanceof WeakSet)&&!(Gr instanceof Error)&&!(Gr instanceof Number)&&!(Gr instanceof Date)&&!(Gr instanceof String)&&!(Gr instanceof RegExp)&&!(Gr instanceof ArrayBuffer),Nr=Gr=>{switch(Gr.status){case"fulfilled":return Gr.value;case"rejected":throw Gr.reason;default:throw Gr}},Dr=new WeakMap,Br=(Gr,Yr,Qr=Nr)=>{const Wn=Dr.get(Gr);if((Wn==null?void 0:Wn[0])===Yr)return Wn[1];const ga=Array.isArray(Gr)?[]:Object.create(Object.getPrototypeOf(Gr));return h$4(ga,!0),Dr.set(Gr,[Yr,ga]),Reflect.ownKeys(Gr).forEach(eo=>{if(Object.getOwnPropertyDescriptor(ga,eo))return;const _i=Reflect.get(Gr,eo),va={value:_i,enumerable:!0,configurable:!0};if(refSet.has(_i))h$4(_i,!1);else if(_i instanceof Promise)delete va.value,va.get=()=>Qr(_i);else if(proxyStateMap.has(_i)){const[io,no]=proxyStateMap.get(_i);va.value=Br(io,no(),Qr)}Object.defineProperty(ga,eo,va)}),Object.preventExtensions(ga)},Lr=new WeakMap,jr=[1,1],Ur=Gr=>{if(!isObject$1(Gr))throw new Error("object required");const Yr=Lr.get(Gr);if(Yr)return Yr;let Qr=jr[0];const Wn=new Set,ga=(mo,$o=++jr[0])=>{Qr!==$o&&(Qr=$o,Wn.forEach(Xn=>Xn(mo,$o)))};let eo=jr[1];const _i=(mo=++jr[1])=>(eo!==mo&&!Wn.size&&(eo=mo,io.forEach(([$o])=>{const Xn=$o[1](mo);Xn>Qr&&(Qr=Xn)})),Qr),va=mo=>($o,Xn)=>{const Fr=[...$o];Fr[1]=[mo,...Fr[1]],ga(Fr,Xn)},io=new Map,no=(mo,$o)=>{if(Wn.size){const Xn=$o[3](va(mo));io.set(mo,[$o,Xn])}else io.set(mo,[$o])},so=mo=>{var $o;const Xn=io.get(mo);Xn&&(io.delete(mo),($o=Xn[1])==null||$o.call(Xn))},ao=mo=>(Wn.add(mo),Wn.size===1&&io.forEach(([Xn,Fr],Vr)=>{const Wr=Xn[3](va(Vr));io.set(Vr,[Xn,Wr])}),()=>{Wn.delete(mo),Wn.size===0&&io.forEach(([Xn,Fr],Vr)=>{Fr&&(Fr(),io.set(Vr,[Xn]))})}),fo=Array.isArray(Gr)?[]:Object.create(Object.getPrototypeOf(Gr)),oo=pr(fo,{deleteProperty(mo,$o){const Xn=Reflect.get(mo,$o);so($o);const Fr=Reflect.deleteProperty(mo,$o);return Fr&&ga(["delete",[$o],Xn]),Fr},set(mo,$o,Xn,Fr){const Vr=Reflect.has(mo,$o),Wr=Reflect.get(mo,$o,Fr);if(Vr&&($r(Wr,Xn)||Lr.has(Xn)&&$r(Wr,Lr.get(Xn))))return!0;so($o),isObject$1(Xn)&&(Xn=y$5(Xn)||Xn);let Jr=Xn;if(Xn instanceof Promise)Xn.then(Gn=>{Xn.status="fulfilled",Xn.value=Gn,ga(["resolve",[$o],Gn])}).catch(Gn=>{Xn.status="rejected",Xn.reason=Gn,ga(["reject",[$o],Gn])});else{!proxyStateMap.has(Xn)&&Mr(Xn)&&(Jr=Ur(Xn));const Gn=!refSet.has(Jr)&&proxyStateMap.get(Jr);Gn&&no($o,Gn)}return Reflect.set(mo,$o,Jr,Fr),ga(["set",[$o],Xn,Wr]),!0}});Lr.set(Gr,oo);const po=[fo,_i,Br,ao];return proxyStateMap.set(oo,po),Reflect.ownKeys(Gr).forEach(mo=>{const $o=Object.getOwnPropertyDescriptor(Gr,mo);"value"in $o&&(oo[mo]=Gr[mo],delete $o.value,delete $o.writable),Object.defineProperty(fo,mo,$o)}),oo})=>[Ur,proxyStateMap,refSet,$r,pr,Mr,Nr,Dr,Br,Lr,jr],[defaultProxyFunction]=buildProxyFunction();function proxy($r={}){return defaultProxyFunction($r)}function subscribe($r,pr,Mr){const Nr=proxyStateMap.get($r);let Dr;const Br=[],Lr=Nr[3];let jr=!1;const Gr=Lr(Yr=>{if(Br.push(Yr),Mr){pr(Br.splice(0));return}Dr||(Dr=Promise.resolve().then(()=>{Dr=void 0,jr&&pr(Br.splice(0))}))});return jr=!0,()=>{jr=!1,Gr()}}function snapshot($r,pr){const Mr=proxyStateMap.get($r),[Nr,Dr,Br]=Mr;return Br(Nr,Dr(),pr)}const o$1=proxy({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),T$2={state:o$1,subscribe($r){return subscribe(o$1,()=>$r(o$1))},push($r,pr){$r!==o$1.view&&(o$1.view=$r,pr&&(o$1.data=pr),o$1.history.push($r))},reset($r){o$1.view=$r,o$1.history=[$r]},replace($r){o$1.history.length>1&&(o$1.history[o$1.history.length-1]=$r,o$1.view=$r)},goBack(){if(o$1.history.length>1){o$1.history.pop();const[$r]=o$1.history.slice(-1);o$1.view=$r}},setData($r){o$1.data=$r}},a$1={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return a$1.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const $r=navigator.userAgent.toLowerCase();return a$1.isMobile()&&($r.includes("iphone")||$r.includes("ipad"))},isHttpUrl($r){return $r.startsWith("http://")||$r.startsWith("https://")},isArray($r){return Array.isArray($r)&&$r.length>0},formatNativeUrl($r,pr,Mr){if(a$1.isHttpUrl($r))return this.formatUniversalUrl($r,pr,Mr);let Nr=$r;Nr.includes("://")||(Nr=$r.replaceAll("/","").replaceAll(":",""),Nr=`${Nr}://`),Nr.endsWith("/")||(Nr=`${Nr}/`),this.setWalletConnectDeepLink(Nr,Mr);const Dr=encodeURIComponent(pr);return`${Nr}wc?uri=${Dr}`},formatUniversalUrl($r,pr,Mr){if(!a$1.isHttpUrl($r))return this.formatNativeUrl($r,pr,Mr);let Nr=$r;Nr.endsWith("/")||(Nr=`${Nr}/`),this.setWalletConnectDeepLink(Nr,Mr);const Dr=encodeURIComponent(pr);return`${Nr}wc?uri=${Dr}`},async wait($r){return new Promise(pr=>{setTimeout(pr,$r)})},openHref($r,pr){window.open($r,pr,"noreferrer noopener")},setWalletConnectDeepLink($r,pr){try{localStorage.setItem(a$1.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:$r,name:pr}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink($r){try{const[pr]=$r.split("?");localStorage.setItem(a$1.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:pr,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(a$1.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(a$1.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var $r;const pr=($r=T$2.state.data)==null?void 0:$r.Wallet;if(!pr)throw new Error('Missing "Wallet" view data');return pr}},_$5=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),r$2=proxy({enabled:_$5,userSessionId:"",events:[],connectedWalletId:void 0}),R$5={state:r$2,subscribe($r){return subscribe(r$2.events,()=>$r(snapshot(r$2.events[r$2.events.length-1])))},initialize(){r$2.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(r$2.userSessionId=crypto.randomUUID())},setConnectedWalletId($r){r$2.connectedWalletId=$r},click($r){if(r$2.enabled){const pr={type:"CLICK",name:$r.name,userSessionId:r$2.userSessionId,timestamp:Date.now(),data:$r};r$2.events.push(pr)}},track($r){if(r$2.enabled){const pr={type:"TRACK",name:$r.name,userSessionId:r$2.userSessionId,timestamp:Date.now(),data:$r};r$2.events.push(pr)}},view($r){if(r$2.enabled){const pr={type:"VIEW",name:$r.name,userSessionId:r$2.userSessionId,timestamp:Date.now(),data:$r};r$2.events.push(pr)}}},c$1=proxy({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),p$4={state:c$1,subscribe($r){return subscribe(c$1,()=>$r(c$1))},setChains($r){c$1.chains=$r},setWalletConnectUri($r){c$1.walletConnectUri=$r},setIsCustomDesktop($r){c$1.isCustomDesktop=$r},setIsCustomMobile($r){c$1.isCustomMobile=$r},setIsDataLoaded($r){c$1.isDataLoaded=$r},setIsUiLoaded($r){c$1.isUiLoaded=$r},setIsAuth($r){c$1.isAuth=$r}},W$8=proxy({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),y$4={state:W$8,subscribe($r){return subscribe(W$8,()=>$r(W$8))},setConfig($r){var pr,Mr;R$5.initialize(),p$4.setChains($r.chains),p$4.setIsAuth(!!$r.enableAuthMode),p$4.setIsCustomMobile(!!((pr=$r.mobileWallets)!=null&&pr.length)),p$4.setIsCustomDesktop(!!((Mr=$r.desktopWallets)!=null&&Mr.length)),a$1.setModalVersionInStorage(),Object.assign(W$8,$r)}};var V$3=Object.defineProperty,D$5=Object.getOwnPropertySymbols,H$1=Object.prototype.hasOwnProperty,B$3=Object.prototype.propertyIsEnumerable,M$3=($r,pr,Mr)=>pr in $r?V$3($r,pr,{enumerable:!0,configurable:!0,writable:!0,value:Mr}):$r[pr]=Mr,K$7=($r,pr)=>{for(var Mr in pr||(pr={}))H$1.call(pr,Mr)&&M$3($r,Mr,pr[Mr]);if(D$5)for(var Mr of D$5(pr))B$3.call(pr,Mr)&&M$3($r,Mr,pr[Mr]);return $r};const L$2="https://explorer-api.walletconnect.com",E$4="wcm",O$5="js-2.6.2";async function w$3($r,pr){const Mr=K$7({sdkType:E$4,sdkVersion:O$5},pr),Nr=new URL($r,L$2);return Nr.searchParams.append("projectId",y$4.state.projectId),Object.entries(Mr).forEach(([Dr,Br])=>{Br&&Nr.searchParams.append(Dr,String(Br))}),(await fetch(Nr)).json()}const m$5={async getDesktopListings($r){return w$3("/w3m/v1/getDesktopListings",$r)},async getMobileListings($r){return w$3("/w3m/v1/getMobileListings",$r)},async getInjectedListings($r){return w$3("/w3m/v1/getInjectedListings",$r)},async getAllListings($r){return w$3("/w3m/v1/getAllListings",$r)},getWalletImageUrl($r){return`${L$2}/w3m/v1/getWalletImage/${$r}?projectId=${y$4.state.projectId}&sdkType=${E$4}&sdkVersion=${O$5}`},getAssetImageUrl($r){return`${L$2}/w3m/v1/getAssetImage/${$r}?projectId=${y$4.state.projectId}&sdkType=${E$4}&sdkVersion=${O$5}`}};var z$2=Object.defineProperty,j$3=Object.getOwnPropertySymbols,J$2=Object.prototype.hasOwnProperty,q$4=Object.prototype.propertyIsEnumerable,k$2=($r,pr,Mr)=>pr in $r?z$2($r,pr,{enumerable:!0,configurable:!0,writable:!0,value:Mr}):$r[pr]=Mr,F$4=($r,pr)=>{for(var Mr in pr||(pr={}))J$2.call(pr,Mr)&&k$2($r,Mr,pr[Mr]);if(j$3)for(var Mr of j$3(pr))q$4.call(pr,Mr)&&k$2($r,Mr,pr[Mr]);return $r};const N$3=a$1.isMobile(),d$2=proxy({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),te$3={state:d$2,async getRecomendedWallets(){const{explorerRecommendedWalletIds:$r,explorerExcludedWalletIds:pr}=y$4.state;if($r==="NONE"||pr==="ALL"&&!$r)return d$2.recomendedWallets;if(a$1.isArray($r)){const Mr={recommendedIds:$r.join(",")},{listings:Nr}=await m$5.getAllListings(Mr),Dr=Object.values(Nr);Dr.sort((Br,Lr)=>{const jr=$r.indexOf(Br.id),Ur=$r.indexOf(Lr.id);return jr-Ur}),d$2.recomendedWallets=Dr}else{const{chains:Mr,isAuth:Nr}=p$4.state,Dr=Mr==null?void 0:Mr.join(","),Br=a$1.isArray(pr),Lr={page:1,sdks:Nr?"auth_v1":void 0,entries:a$1.RECOMMENDED_WALLET_AMOUNT,chains:Dr,version:2,excludedIds:Br?pr.join(","):void 0},{listings:jr}=N$3?await m$5.getMobileListings(Lr):await m$5.getDesktopListings(Lr);d$2.recomendedWallets=Object.values(jr)}return d$2.recomendedWallets},async getWallets($r){const pr=F$4({},$r),{explorerRecommendedWalletIds:Mr,explorerExcludedWalletIds:Nr}=y$4.state,{recomendedWallets:Dr}=d$2;if(Nr==="ALL")return d$2.wallets;Dr.length?pr.excludedIds=Dr.map(Qr=>Qr.id).join(","):a$1.isArray(Mr)&&(pr.excludedIds=Mr.join(",")),a$1.isArray(Nr)&&(pr.excludedIds=[pr.excludedIds,Nr].filter(Boolean).join(",")),p$4.state.isAuth&&(pr.sdks="auth_v1");const{page:Br,search:Lr}=$r,{listings:jr,total:Ur}=N$3?await m$5.getMobileListings(pr):await m$5.getDesktopListings(pr),Gr=Object.values(jr),Yr=Lr?"search":"wallets";return d$2[Yr]={listings:[...d$2[Yr].listings,...Gr],total:Ur,page:Br??1},{listings:Gr,total:Ur}},getWalletImageUrl($r){return m$5.getWalletImageUrl($r)},getAssetImageUrl($r){return m$5.getAssetImageUrl($r)},resetSearch(){d$2.search={listings:[],total:0,page:1}}},I$3=proxy({open:!1}),se$2={state:I$3,subscribe($r){return subscribe(I$3,()=>$r(I$3))},async open($r){return new Promise(pr=>{const{isUiLoaded:Mr,isDataLoaded:Nr}=p$4.state;if(a$1.removeWalletConnectDeepLink(),p$4.setWalletConnectUri($r==null?void 0:$r.uri),p$4.setChains($r==null?void 0:$r.chains),T$2.reset("ConnectWallet"),Mr&&Nr)I$3.open=!0,pr();else{const Dr=setInterval(()=>{const Br=p$4.state;Br.isUiLoaded&&Br.isDataLoaded&&(clearInterval(Dr),I$3.open=!0,pr())},200)}})},close(){I$3.open=!1}};var G$5=Object.defineProperty,$$3=Object.getOwnPropertySymbols,Q$5=Object.prototype.hasOwnProperty,X$4=Object.prototype.propertyIsEnumerable,S$4=($r,pr,Mr)=>pr in $r?G$5($r,pr,{enumerable:!0,configurable:!0,writable:!0,value:Mr}):$r[pr]=Mr,Y$1=($r,pr)=>{for(var Mr in pr||(pr={}))Q$5.call(pr,Mr)&&S$4($r,Mr,pr[Mr]);if($$3)for(var Mr of $$3(pr))X$4.call(pr,Mr)&&S$4($r,Mr,pr[Mr]);return $r};function Z$3(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const C=proxy({themeMode:Z$3()?"dark":"light"}),ne$1={state:C,subscribe($r){return subscribe(C,()=>$r(C))},setThemeConfig($r){const{themeMode:pr,themeVariables:Mr}=$r;pr&&(C.themeMode=pr),Mr&&(C.themeVariables=Y$1({},Mr))}},g$6=proxy({open:!1,message:"",variant:"success"}),oe$3={state:g$6,subscribe($r){return subscribe(g$6,()=>$r(g$6))},openToast($r,pr){g$6.open=!0,g$6.message=$r,g$6.variant=pr},closeToast(){g$6.open=!1}};let d$1=class{constructor(pr){this.openModal=se$2.open,this.closeModal=se$2.close,this.subscribeModal=se$2.subscribe,this.setTheme=ne$1.setThemeConfig,ne$1.setThemeConfig(pr),y$4.setConfig(pr),this.initUi()}async initUi(){if(typeof window<"u"){await __vitePreload(()=>import("./index-621e4b40.js"),[]);const pr=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",pr),p$4.setIsUiLoaded(!0)}}};const dist$5=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:d$1},Symbol.toStringTag,{value:"Module"})),require$$0$5=getAugmentedNamespace(dist$5);var chacha20poly1305={},chacha={},binary={},int={};(function($r){Object.defineProperty($r,"__esModule",{value:!0});function pr(jr,Ur){var Gr=jr>>>16&65535,Yr=jr&65535,Qr=Ur>>>16&65535,Wn=Ur&65535;return Yr*Wn+(Gr*Wn+Yr*Qr<<16>>>0)|0}$r.mul=Math.imul||pr;function Mr(jr,Ur){return jr+Ur|0}$r.add=Mr;function Nr(jr,Ur){return jr-Ur|0}$r.sub=Nr;function Dr(jr,Ur){return jr<<Ur|jr>>>32-Ur}$r.rotl=Dr;function Br(jr,Ur){return jr<<32-Ur|jr>>>Ur}$r.rotr=Br;function Lr(jr){return typeof jr=="number"&&isFinite(jr)&&Math.floor(jr)===jr}$r.isInteger=Number.isInteger||Lr,$r.MAX_SAFE_INTEGER=9007199254740991,$r.isSafeInteger=function(jr){return $r.isInteger(jr)&&jr>=-$r.MAX_SAFE_INTEGER&&jr<=$r.MAX_SAFE_INTEGER}})(int);Object.defineProperty(binary,"__esModule",{value:!0});var int_1=int;function readInt16BE($r,pr){return pr===void 0&&(pr=0),($r[pr+0]<<8|$r[pr+1])<<16>>16}binary.readInt16BE=readInt16BE;function readUint16BE($r,pr){return pr===void 0&&(pr=0),($r[pr+0]<<8|$r[pr+1])>>>0}binary.readUint16BE=readUint16BE;function readInt16LE($r,pr){return pr===void 0&&(pr=0),($r[pr+1]<<8|$r[pr])<<16>>16}binary.readInt16LE=readInt16LE;function readUint16LE($r,pr){return pr===void 0&&(pr=0),($r[pr+1]<<8|$r[pr])>>>0}binary.readUint16LE=readUint16LE;function writeUint16BE($r,pr,Mr){return pr===void 0&&(pr=new Uint8Array(2)),Mr===void 0&&(Mr=0),pr[Mr+0]=$r>>>8,pr[Mr+1]=$r>>>0,pr}binary.writeUint16BE=writeUint16BE;binary.writeInt16BE=writeUint16BE;function writeUint16LE($r,pr,Mr){return pr===void 0&&(pr=new Uint8Array(2)),Mr===void 0&&(Mr=0),pr[Mr+0]=$r>>>0,pr[Mr+1]=$r>>>8,pr}binary.writeUint16LE=writeUint16LE;binary.writeInt16LE=writeUint16LE;function readInt32BE($r,pr){return pr===void 0&&(pr=0),$r[pr]<<24|$r[pr+1]<<16|$r[pr+2]<<8|$r[pr+3]}binary.readInt32BE=readInt32BE;function readUint32BE($r,pr){return pr===void 0&&(pr=0),($r[pr]<<24|$r[pr+1]<<16|$r[pr+2]<<8|$r[pr+3])>>>0}binary.readUint32BE=readUint32BE;function readInt32LE($r,pr){return pr===void 0&&(pr=0),$r[pr+3]<<24|$r[pr+2]<<16|$r[pr+1]<<8|$r[pr]}binary.readInt32LE=readInt32LE;function readUint32LE($r,pr){return pr===void 0&&(pr=0),($r[pr+3]<<24|$r[pr+2]<<16|$r[pr+1]<<8|$r[pr])>>>0}binary.readUint32LE=readUint32LE;function writeUint32BE($r,pr,Mr){return pr===void 0&&(pr=new Uint8Array(4)),Mr===void 0&&(Mr=0),pr[Mr+0]=$r>>>24,pr[Mr+1]=$r>>>16,pr[Mr+2]=$r>>>8,pr[Mr+3]=$r>>>0,pr}binary.writeUint32BE=writeUint32BE;binary.writeInt32BE=writeUint32BE;function writeUint32LE($r,pr,Mr){return pr===void 0&&(pr=new Uint8Array(4)),Mr===void 0&&(Mr=0),pr[Mr+0]=$r>>>0,pr[Mr+1]=$r>>>8,pr[Mr+2]=$r>>>16,pr[Mr+3]=$r>>>24,pr}binary.writeUint32LE=writeUint32LE;binary.writeInt32LE=writeUint32LE;function readInt64BE($r,pr){pr===void 0&&(pr=0);var Mr=readInt32BE($r,pr),Nr=readInt32BE($r,pr+4);return Mr*4294967296+Nr-(Nr>>31)*4294967296}binary.readInt64BE=readInt64BE;function readUint64BE($r,pr){pr===void 0&&(pr=0);var Mr=readUint32BE($r,pr),Nr=readUint32BE($r,pr+4);return Mr*4294967296+Nr}binary.readUint64BE=readUint64BE;function readInt64LE($r,pr){pr===void 0&&(pr=0);var Mr=readInt32LE($r,pr),Nr=readInt32LE($r,pr+4);return Nr*4294967296+Mr-(Mr>>31)*4294967296}binary.readInt64LE=readInt64LE;function readUint64LE($r,pr){pr===void 0&&(pr=0);var Mr=readUint32LE($r,pr),Nr=readUint32LE($r,pr+4);return Nr*4294967296+Mr}binary.readUint64LE=readUint64LE;function writeUint64BE($r,pr,Mr){return pr===void 0&&(pr=new Uint8Array(8)),Mr===void 0&&(Mr=0),writeUint32BE($r/4294967296>>>0,pr,Mr),writeUint32BE($r>>>0,pr,Mr+4),pr}binary.writeUint64BE=writeUint64BE;binary.writeInt64BE=writeUint64BE;function writeUint64LE($r,pr,Mr){return pr===void 0&&(pr=new Uint8Array(8)),Mr===void 0&&(Mr=0),writeUint32LE($r>>>0,pr,Mr),writeUint32LE($r/4294967296>>>0,pr,Mr+4),pr}binary.writeUint64LE=writeUint64LE;binary.writeInt64LE=writeUint64LE;function readUintBE($r,pr,Mr){if(Mr===void 0&&(Mr=0),$r%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if($r/8>pr.length-Mr)throw new Error("readUintBE: array is too short for the given bitLength");for(var Nr=0,Dr=1,Br=$r/8+Mr-1;Br>=Mr;Br--)Nr+=pr[Br]*Dr,Dr*=256;return Nr}binary.readUintBE=readUintBE;function readUintLE($r,pr,Mr){if(Mr===void 0&&(Mr=0),$r%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if($r/8>pr.length-Mr)throw new Error("readUintLE: array is too short for the given bitLength");for(var Nr=0,Dr=1,Br=Mr;Br<Mr+$r/8;Br++)Nr+=pr[Br]*Dr,Dr*=256;return Nr}binary.readUintLE=readUintLE;function writeUintBE($r,pr,Mr,Nr){if(Mr===void 0&&(Mr=new Uint8Array($r/8)),Nr===void 0&&(Nr=0),$r%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!int_1.isSafeInteger(pr))throw new Error("writeUintBE value must be an integer");for(var Dr=1,Br=$r/8+Nr-1;Br>=Nr;Br--)Mr[Br]=pr/Dr&255,Dr*=256;return Mr}binary.writeUintBE=writeUintBE;function writeUintLE($r,pr,Mr,Nr){if(Mr===void 0&&(Mr=new Uint8Array($r/8)),Nr===void 0&&(Nr=0),$r%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!int_1.isSafeInteger(pr))throw new Error("writeUintLE value must be an integer");for(var Dr=1,Br=Nr;Br<Nr+$r/8;Br++)Mr[Br]=pr/Dr&255,Dr*=256;return Mr}binary.writeUintLE=writeUintLE;function readFloat32BE($r,pr){pr===void 0&&(pr=0);var Mr=new DataView($r.buffer,$r.byteOffset,$r.byteLength);return Mr.getFloat32(pr)}binary.readFloat32BE=readFloat32BE;function readFloat32LE($r,pr){pr===void 0&&(pr=0);var Mr=new DataView($r.buffer,$r.byteOffset,$r.byteLength);return Mr.getFloat32(pr,!0)}binary.readFloat32LE=readFloat32LE;function readFloat64BE($r,pr){pr===void 0&&(pr=0);var Mr=new DataView($r.buffer,$r.byteOffset,$r.byteLength);return Mr.getFloat64(pr)}binary.readFloat64BE=readFloat64BE;function readFloat64LE($r,pr){pr===void 0&&(pr=0);var Mr=new DataView($r.buffer,$r.byteOffset,$r.byteLength);return Mr.getFloat64(pr,!0)}binary.readFloat64LE=readFloat64LE;function writeFloat32BE($r,pr,Mr){pr===void 0&&(pr=new Uint8Array(4)),Mr===void 0&&(Mr=0);var Nr=new DataView(pr.buffer,pr.byteOffset,pr.byteLength);return Nr.setFloat32(Mr,$r),pr}binary.writeFloat32BE=writeFloat32BE;function writeFloat32LE($r,pr,Mr){pr===void 0&&(pr=new Uint8Array(4)),Mr===void 0&&(Mr=0);var Nr=new DataView(pr.buffer,pr.byteOffset,pr.byteLength);return Nr.setFloat32(Mr,$r,!0),pr}binary.writeFloat32LE=writeFloat32LE;function writeFloat64BE($r,pr,Mr){pr===void 0&&(pr=new Uint8Array(8)),Mr===void 0&&(Mr=0);var Nr=new DataView(pr.buffer,pr.byteOffset,pr.byteLength);return Nr.setFloat64(Mr,$r),pr}binary.writeFloat64BE=writeFloat64BE;function writeFloat64LE($r,pr,Mr){pr===void 0&&(pr=new Uint8Array(8)),Mr===void 0&&(Mr=0);var Nr=new DataView(pr.buffer,pr.byteOffset,pr.byteLength);return Nr.setFloat64(Mr,$r,!0),pr}binary.writeFloat64LE=writeFloat64LE;var wipe$1={};Object.defineProperty(wipe$1,"__esModule",{value:!0});function wipe($r){for(var pr=0;pr<$r.length;pr++)$r[pr]=0;return $r}wipe$1.wipe=wipe;Object.defineProperty(chacha,"__esModule",{value:!0});var binary_1=binary,wipe_1$3=wipe$1,ROUNDS=20;function core$1($r,pr,Mr){for(var Nr=1634760805,Dr=857760878,Br=2036477234,Lr=1797285236,jr=Mr[3]<<24|Mr[2]<<16|Mr[1]<<8|Mr[0],Ur=Mr[7]<<24|Mr[6]<<16|Mr[5]<<8|Mr[4],Gr=Mr[11]<<24|Mr[10]<<16|Mr[9]<<8|Mr[8],Yr=Mr[15]<<24|Mr[14]<<16|Mr[13]<<8|Mr[12],Qr=Mr[19]<<24|Mr[18]<<16|Mr[17]<<8|Mr[16],Wn=Mr[23]<<24|Mr[22]<<16|Mr[21]<<8|Mr[20],ga=Mr[27]<<24|Mr[26]<<16|Mr[25]<<8|Mr[24],eo=Mr[31]<<24|Mr[30]<<16|Mr[29]<<8|Mr[28],_i=pr[3]<<24|pr[2]<<16|pr[1]<<8|pr[0],va=pr[7]<<24|pr[6]<<16|pr[5]<<8|pr[4],io=pr[11]<<24|pr[10]<<16|pr[9]<<8|pr[8],no=pr[15]<<24|pr[14]<<16|pr[13]<<8|pr[12],so=Nr,ao=Dr,fo=Br,lo=Lr,oo=jr,po=Ur,mo=Gr,$o=Yr,Xn=Qr,Fr=Wn,Vr=ga,Wr=eo,Jr=_i,Gn=va,to=io,ro=no,Un=0;Un<ROUNDS;Un+=2)so=so+oo|0,Jr^=so,Jr=Jr>>>32-16|Jr<<16,Xn=Xn+Jr|0,oo^=Xn,oo=oo>>>32-12|oo<<12,ao=ao+po|0,Gn^=ao,Gn=Gn>>>32-16|Gn<<16,Fr=Fr+Gn|0,po^=Fr,po=po>>>32-12|po<<12,fo=fo+mo|0,to^=fo,to=to>>>32-16|to<<16,Vr=Vr+to|0,mo^=Vr,mo=mo>>>32-12|mo<<12,lo=lo+$o|0,ro^=lo,ro=ro>>>32-16|ro<<16,Wr=Wr+ro|0,$o^=Wr,$o=$o>>>32-12|$o<<12,fo=fo+mo|0,to^=fo,to=to>>>32-8|to<<8,Vr=Vr+to|0,mo^=Vr,mo=mo>>>32-7|mo<<7,lo=lo+$o|0,ro^=lo,ro=ro>>>32-8|ro<<8,Wr=Wr+ro|0,$o^=Wr,$o=$o>>>32-7|$o<<7,ao=ao+po|0,Gn^=ao,Gn=Gn>>>32-8|Gn<<8,Fr=Fr+Gn|0,po^=Fr,po=po>>>32-7|po<<7,so=so+oo|0,Jr^=so,Jr=Jr>>>32-8|Jr<<8,Xn=Xn+Jr|0,oo^=Xn,oo=oo>>>32-7|oo<<7,so=so+po|0,ro^=so,ro=ro>>>32-16|ro<<16,Vr=Vr+ro|0,po^=Vr,po=po>>>32-12|po<<12,ao=ao+mo|0,Jr^=ao,Jr=Jr>>>32-16|Jr<<16,Wr=Wr+Jr|0,mo^=Wr,mo=mo>>>32-12|mo<<12,fo=fo+$o|0,Gn^=fo,Gn=Gn>>>32-16|Gn<<16,Xn=Xn+Gn|0,$o^=Xn,$o=$o>>>32-12|$o<<12,lo=lo+oo|0,to^=lo,to=to>>>32-16|to<<16,Fr=Fr+to|0,oo^=Fr,oo=oo>>>32-12|oo<<12,fo=fo+$o|0,Gn^=fo,Gn=Gn>>>32-8|Gn<<8,Xn=Xn+Gn|0,$o^=Xn,$o=$o>>>32-7|$o<<7,lo=lo+oo|0,to^=lo,to=to>>>32-8|to<<8,Fr=Fr+to|0,oo^=Fr,oo=oo>>>32-7|oo<<7,ao=ao+mo|0,Jr^=ao,Jr=Jr>>>32-8|Jr<<8,Wr=Wr+Jr|0,mo^=Wr,mo=mo>>>32-7|mo<<7,so=so+po|0,ro^=so,ro=ro>>>32-8|ro<<8,Vr=Vr+ro|0,po^=Vr,po=po>>>32-7|po<<7;binary_1.writeUint32LE(so+Nr|0,$r,0),binary_1.writeUint32LE(ao+Dr|0,$r,4),binary_1.writeUint32LE(fo+Br|0,$r,8),binary_1.writeUint32LE(lo+Lr|0,$r,12),binary_1.writeUint32LE(oo+jr|0,$r,16),binary_1.writeUint32LE(po+Ur|0,$r,20),binary_1.writeUint32LE(mo+Gr|0,$r,24),binary_1.writeUint32LE($o+Yr|0,$r,28),binary_1.writeUint32LE(Xn+Qr|0,$r,32),binary_1.writeUint32LE(Fr+Wn|0,$r,36),binary_1.writeUint32LE(Vr+ga|0,$r,40),binary_1.writeUint32LE(Wr+eo|0,$r,44),binary_1.writeUint32LE(Jr+_i|0,$r,48),binary_1.writeUint32LE(Gn+va|0,$r,52),binary_1.writeUint32LE(to+io|0,$r,56),binary_1.writeUint32LE(ro+no|0,$r,60)}function streamXOR($r,pr,Mr,Nr,Dr){if(Dr===void 0&&(Dr=0),$r.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(Nr.length<Mr.length)throw new Error("ChaCha: destination is shorter than source");var Br,Lr;if(Dr===0){if(pr.length!==8&&pr.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");Br=new Uint8Array(16),Lr=Br.length-pr.length,Br.set(pr,Lr)}else{if(pr.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");Br=pr,Lr=Dr}for(var jr=new Uint8Array(64),Ur=0;Ur<Mr.length;Ur+=64){core$1(jr,Br,$r);for(var Gr=Ur;Gr<Ur+64&&Gr<Mr.length;Gr++)Nr[Gr]=Mr[Gr]^jr[Gr-Ur];incrementCounter(Br,0,Lr)}return wipe_1$3.wipe(jr),Dr===0&&wipe_1$3.wipe(Br),Nr}chacha.streamXOR=streamXOR;function stream($r,pr,Mr,Nr){return Nr===void 0&&(Nr=0),wipe_1$3.wipe(Mr),streamXOR($r,pr,Mr,Mr,Nr)}chacha.stream=stream;function incrementCounter($r,pr,Mr){for(var Nr=1;Mr--;)Nr=Nr+($r[pr]&255)|0,$r[pr]=Nr&255,Nr>>>=8,pr++;if(Nr>0)throw new Error("ChaCha: counter overflow")}var poly1305={},constantTime={};Object.defineProperty(constantTime,"__esModule",{value:!0});function select($r,pr,Mr){return~($r-1)&pr|$r-1&Mr}constantTime.select=select;function lessOrEqual($r,pr){return($r|0)-(pr|0)-1>>>31&1}constantTime.lessOrEqual=lessOrEqual;function compare$1($r,pr){if($r.length!==pr.length)return 0;for(var Mr=0,Nr=0;Nr<$r.length;Nr++)Mr|=$r[Nr]^pr[Nr];return 1&Mr-1>>>8}constantTime.compare=compare$1;function equal$1($r,pr){return $r.length===0||pr.length===0?!1:compare$1($r,pr)!==0}constantTime.equal=equal$1;(function($r){Object.defineProperty($r,"__esModule",{value:!0});var pr=constantTime,Mr=wipe$1;$r.DIGEST_LENGTH=16;var Nr=function(){function Lr(jr){this.digestLength=$r.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 Ur=jr[0]|jr[1]<<8;this._r[0]=Ur&8191;var Gr=jr[2]|jr[3]<<8;this._r[1]=(Ur>>>13|Gr<<3)&8191;var Yr=jr[4]|jr[5]<<8;this._r[2]=(Gr>>>10|Yr<<6)&7939;var Qr=jr[6]|jr[7]<<8;this._r[3]=(Yr>>>7|Qr<<9)&8191;var Wn=jr[8]|jr[9]<<8;this._r[4]=(Qr>>>4|Wn<<12)&255,this._r[5]=Wn>>>1&8190;var ga=jr[10]|jr[11]<<8;this._r[6]=(Wn>>>14|ga<<2)&8191;var eo=jr[12]|jr[13]<<8;this._r[7]=(ga>>>11|eo<<5)&8065;var _i=jr[14]|jr[15]<<8;this._r[8]=(eo>>>8|_i<<8)&8191,this._r[9]=_i>>>5&127,this._pad[0]=jr[16]|jr[17]<<8,this._pad[1]=jr[18]|jr[19]<<8,this._pad[2]=jr[20]|jr[21]<<8,this._pad[3]=jr[22]|jr[23]<<8,this._pad[4]=jr[24]|jr[25]<<8,this._pad[5]=jr[26]|jr[27]<<8,this._pad[6]=jr[28]|jr[29]<<8,this._pad[7]=jr[30]|jr[31]<<8}return Lr.prototype._blocks=function(jr,Ur,Gr){for(var Yr=this._fin?0:2048,Qr=this._h[0],Wn=this._h[1],ga=this._h[2],eo=this._h[3],_i=this._h[4],va=this._h[5],io=this._h[6],no=this._h[7],so=this._h[8],ao=this._h[9],fo=this._r[0],lo=this._r[1],oo=this._r[2],po=this._r[3],mo=this._r[4],$o=this._r[5],Xn=this._r[6],Fr=this._r[7],Vr=this._r[8],Wr=this._r[9];Gr>=16;){var Jr=jr[Ur+0]|jr[Ur+1]<<8;Qr+=Jr&8191;var Gn=jr[Ur+2]|jr[Ur+3]<<8;Wn+=(Jr>>>13|Gn<<3)&8191;var to=jr[Ur+4]|jr[Ur+5]<<8;ga+=(Gn>>>10|to<<6)&8191;var ro=jr[Ur+6]|jr[Ur+7]<<8;eo+=(to>>>7|ro<<9)&8191;var Un=jr[Ur+8]|jr[Ur+9]<<8;_i+=(ro>>>4|Un<<12)&8191,va+=Un>>>1&8191;var Hr=jr[Ur+10]|jr[Ur+11]<<8;io+=(Un>>>14|Hr<<2)&8191;var Xr=jr[Ur+12]|jr[Ur+13]<<8;no+=(Hr>>>11|Xr<<5)&8191;var co=jr[Ur+14]|jr[Ur+15]<<8;so+=(Xr>>>8|co<<8)&8191,ao+=co>>>5|Yr;var ho=0,go=ho;go+=Qr*fo,go+=Wn*(5*Wr),go+=ga*(5*Vr),go+=eo*(5*Fr),go+=_i*(5*Xn),ho=go>>>13,go&=8191,go+=va*(5*$o),go+=io*(5*mo),go+=no*(5*po),go+=so*(5*oo),go+=ao*(5*lo),ho+=go>>>13,go&=8191;var bo=ho;bo+=Qr*lo,bo+=Wn*fo,bo+=ga*(5*Wr),bo+=eo*(5*Vr),bo+=_i*(5*Fr),ho=bo>>>13,bo&=8191,bo+=va*(5*Xn),bo+=io*(5*$o),bo+=no*(5*mo),bo+=so*(5*po),bo+=ao*(5*oo),ho+=bo>>>13,bo&=8191;var Eo=ho;Eo+=Qr*oo,Eo+=Wn*lo,Eo+=ga*fo,Eo+=eo*(5*Wr),Eo+=_i*(5*Vr),ho=Eo>>>13,Eo&=8191,Eo+=va*(5*Fr),Eo+=io*(5*Xn),Eo+=no*(5*$o),Eo+=so*(5*mo),Eo+=ao*(5*po),ho+=Eo>>>13,Eo&=8191;var wo=ho;wo+=Qr*po,wo+=Wn*oo,wo+=ga*lo,wo+=eo*fo,wo+=_i*(5*Wr),ho=wo>>>13,wo&=8191,wo+=va*(5*Vr),wo+=io*(5*Fr),wo+=no*(5*Xn),wo+=so*(5*$o),wo+=ao*(5*mo),ho+=wo>>>13,wo&=8191;var Io=ho;Io+=Qr*mo,Io+=Wn*po,Io+=ga*oo,Io+=eo*lo,Io+=_i*fo,ho=Io>>>13,Io&=8191,Io+=va*(5*Wr),Io+=io*(5*Vr),Io+=no*(5*Fr),Io+=so*(5*Xn),Io+=ao*(5*$o),ho+=Io>>>13,Io&=8191;var Po=ho;Po+=Qr*$o,Po+=Wn*mo,Po+=ga*po,Po+=eo*oo,Po+=_i*lo,ho=Po>>>13,Po&=8191,Po+=va*fo,Po+=io*(5*Wr),Po+=no*(5*Vr),Po+=so*(5*Fr),Po+=ao*(5*Xn),ho+=Po>>>13,Po&=8191;var yo=ho;yo+=Qr*Xn,yo+=Wn*$o,yo+=ga*mo,yo+=eo*po,yo+=_i*oo,ho=yo>>>13,yo&=8191,yo+=va*lo,yo+=io*fo,yo+=no*(5*Wr),yo+=so*(5*Vr),yo+=ao*(5*Fr),ho+=yo>>>13,yo&=8191;var xo=ho;xo+=Qr*Fr,xo+=Wn*Xn,xo+=ga*$o,xo+=eo*mo,xo+=_i*po,ho=xo>>>13,xo&=8191,xo+=va*oo,xo+=io*lo,xo+=no*fo,xo+=so*(5*Wr),xo+=ao*(5*Vr),ho+=xo>>>13,xo&=8191;var Mo=ho;Mo+=Qr*Vr,Mo+=Wn*Fr,Mo+=ga*Xn,Mo+=eo*$o,Mo+=_i*mo,ho=Mo>>>13,Mo&=8191,Mo+=va*po,Mo+=io*oo,Mo+=no*lo,Mo+=so*fo,Mo+=ao*(5*Wr),ho+=Mo>>>13,Mo&=8191;var qo=ho;qo+=Qr*Wr,qo+=Wn*Vr,qo+=ga*Fr,qo+=eo*Xn,qo+=_i*$o,ho=qo>>>13,qo&=8191,qo+=va*mo,qo+=io*po,qo+=no*oo,qo+=so*lo,qo+=ao*fo,ho+=qo>>>13,qo&=8191,ho=(ho<<2)+ho|0,ho=ho+go|0,go=ho&8191,ho=ho>>>13,bo+=ho,Qr=go,Wn=bo,ga=Eo,eo=wo,_i=Io,va=Po,io=yo,no=xo,so=Mo,ao=qo,Ur+=16,Gr-=16}this._h[0]=Qr,this._h[1]=Wn,this._h[2]=ga,this._h[3]=eo,this._h[4]=_i,this._h[5]=va,this._h[6]=io,this._h[7]=no,this._h[8]=so,this._h[9]=ao},Lr.prototype.finish=function(jr,Ur){Ur===void 0&&(Ur=0);var Gr=new Uint16Array(10),Yr,Qr,Wn,ga;if(this._leftover){for(ga=this._leftover,this._buffer[ga++]=1;ga<16;ga++)this._buffer[ga]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(Yr=this._h[1]>>>13,this._h[1]&=8191,ga=2;ga<10;ga++)this._h[ga]+=Yr,Yr=this._h[ga]>>>13,this._h[ga]&=8191;for(this._h[0]+=Yr*5,Yr=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=Yr,Yr=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=Yr,Gr[0]=this._h[0]+5,Yr=Gr[0]>>>13,Gr[0]&=8191,ga=1;ga<10;ga++)Gr[ga]=this._h[ga]+Yr,Yr=Gr[ga]>>>13,Gr[ga]&=8191;for(Gr[9]-=8192,Qr=(Yr^1)-1,ga=0;ga<10;ga++)Gr[ga]&=Qr;for(Qr=~Qr,ga=0;ga<10;ga++)this._h[ga]=this._h[ga]&Qr|Gr[ga];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,Wn=this._h[0]+this._pad[0],this._h[0]=Wn&65535,ga=1;ga<8;ga++)Wn=(this._h[ga]+this._pad[ga]|0)+(Wn>>>16)|0,this._h[ga]=Wn&65535;return jr[Ur+0]=this._h[0]>>>0,jr[Ur+1]=this._h[0]>>>8,jr[Ur+2]=this._h[1]>>>0,jr[Ur+3]=this._h[1]>>>8,jr[Ur+4]=this._h[2]>>>0,jr[Ur+5]=this._h[2]>>>8,jr[Ur+6]=this._h[3]>>>0,jr[Ur+7]=this._h[3]>>>8,jr[Ur+8]=this._h[4]>>>0,jr[Ur+9]=this._h[4]>>>8,jr[Ur+10]=this._h[5]>>>0,jr[Ur+11]=this._h[5]>>>8,jr[Ur+12]=this._h[6]>>>0,jr[Ur+13]=this._h[6]>>>8,jr[Ur+14]=this._h[7]>>>0,jr[Ur+15]=this._h[7]>>>8,this._finished=!0,this},Lr.prototype.update=function(jr){var Ur=0,Gr=jr.length,Yr;if(this._leftover){Yr=16-this._leftover,Yr>Gr&&(Yr=Gr);for(var Qr=0;Qr<Yr;Qr++)this._buffer[this._leftover+Qr]=jr[Ur+Qr];if(Gr-=Yr,Ur+=Yr,this._leftover+=Yr,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(Gr>=16&&(Yr=Gr-Gr%16,this._blocks(jr,Ur,Yr),Ur+=Yr,Gr-=Yr),Gr){for(var Qr=0;Qr<Gr;Qr++)this._buffer[this._leftover+Qr]=jr[Ur+Qr];this._leftover+=Gr}return this},Lr.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var jr=new Uint8Array(16);return this.finish(jr),jr},Lr.prototype.clean=function(){return Mr.wipe(this._buffer),Mr.wipe(this._r),Mr.wipe(this._h),Mr.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},Lr}();$r.Poly1305=Nr;function Dr(Lr,jr){var Ur=new Nr(Lr);Ur.update(jr);var Gr=Ur.digest();return Ur.clean(),Gr}$r.oneTimeAuth=Dr;function Br(Lr,jr){return Lr.length!==$r.DIGEST_LENGTH||jr.length!==$r.DIGEST_LENGTH?!1:pr.equal(Lr,jr)}$r.equal=Br})(poly1305);(function($r){Object.defineProperty($r,"__esModule",{value:!0});var pr=chacha,Mr=poly1305,Nr=wipe$1,Dr=binary,Br=constantTime;$r.KEY_LENGTH=32,$r.NONCE_LENGTH=12,$r.TAG_LENGTH=16;var Lr=new Uint8Array(16),jr=function(){function Ur(Gr){if(this.nonceLength=$r.NONCE_LENGTH,this.tagLength=$r.TAG_LENGTH,Gr.length!==$r.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(Gr)}return Ur.prototype.seal=function(Gr,Yr,Qr,Wn){if(Gr.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var ga=new Uint8Array(16);ga.set(Gr,ga.length-Gr.length);var eo=new Uint8Array(32);pr.stream(this._key,ga,eo,4);var _i=Yr.length+this.tagLength,va;if(Wn){if(Wn.length!==_i)throw new Error("ChaCha20Poly1305: incorrect destination length");va=Wn}else va=new Uint8Array(_i);return pr.streamXOR(this._key,ga,Yr,va,4),this._authenticate(va.subarray(va.length-this.tagLength,va.length),eo,va.subarray(0,va.length-this.tagLength),Qr),Nr.wipe(ga),va},Ur.prototype.open=function(Gr,Yr,Qr,Wn){if(Gr.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(Yr.length<this.tagLength)return null;var ga=new Uint8Array(16);ga.set(Gr,ga.length-Gr.length);var eo=new Uint8Array(32);pr.stream(this._key,ga,eo,4);var _i=new Uint8Array(this.tagLength);if(this._authenticate(_i,eo,Yr.subarray(0,Yr.length-this.tagLength),Qr),!Br.equal(_i,Yr.subarray(Yr.length-this.tagLength,Yr.length)))return null;var va=Yr.length-this.tagLength,io;if(Wn){if(Wn.length!==va)throw new Error("ChaCha20Poly1305: incorrect destination length");io=Wn}else io=new Uint8Array(va);return pr.streamXOR(this._key,ga,Yr.subarray(0,Yr.length-this.tagLength),io,4),Nr.wipe(ga),io},Ur.prototype.clean=function(){return Nr.wipe(this._key),this},Ur.prototype._authenticate=function(Gr,Yr,Qr,Wn){var ga=new Mr.Poly1305(Yr);Wn&&(ga.update(Wn),Wn.length%16>0&&ga.update(Lr.subarray(Wn.length%16))),ga.update(Qr),Qr.length%16>0&&ga.update(Lr.subarray(Qr.length%16));var eo=new Uint8Array(8);Wn&&Dr.writeUint64LE(Wn.length,eo),ga.update(eo),Dr.writeUint64LE(Qr.length,eo),ga.update(eo);for(var _i=ga.digest(),va=0;va<_i.length;va++)Gr[va]=_i[va];ga.clean(),Nr.wipe(_i),Nr.wipe(eo)},Ur}();$r.ChaCha20Poly1305=jr})(chacha20poly1305);var hkdf={},hmac$3={},hash$7={};Object.defineProperty(hash$7,"__esModule",{value:!0});function isSerializableHash($r){return typeof $r.saveState<"u"&&typeof $r.restoreState<"u"&&typeof $r.cleanSavedState<"u"}hash$7.isSerializableHash=isSerializableHash;Object.defineProperty(hmac$3,"__esModule",{value:!0});var hash_1=hash$7,constant_time_1=constantTime,wipe_1$2=wipe$1,HMAC=function(){function $r(pr,Mr){this._finished=!1,this._inner=new pr,this._outer=new pr,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var Nr=new Uint8Array(this.blockSize);Mr.length>this.blockSize?this._inner.update(Mr).finish(Nr).clean():Nr.set(Mr);for(var Dr=0;Dr<Nr.length;Dr++)Nr[Dr]^=54;this._inner.update(Nr);for(var Dr=0;Dr<Nr.length;Dr++)Nr[Dr]^=106;this._outer.update(Nr),hash_1.isSerializableHash(this._inner)&&hash_1.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),wipe_1$2.wipe(Nr)}return $r.prototype.reset=function(){if(!hash_1.isSerializableHash(this._inner)||!hash_1.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},$r.prototype.clean=function(){hash_1.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),hash_1.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},$r.prototype.update=function(pr){return this._inner.update(pr),this},$r.prototype.finish=function(pr){return this._finished?(this._outer.finish(pr),this):(this._inner.finish(pr),this._outer.update(pr.subarray(0,this.digestLength)).finish(pr),this._finished=!0,this)},$r.prototype.digest=function(){var pr=new Uint8Array(this.digestLength);return this.finish(pr),pr},$r.prototype.saveState=function(){if(!hash_1.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},$r.prototype.restoreState=function(pr){if(!hash_1.isSerializableHash(this._inner)||!hash_1.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(pr),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},$r.prototype.cleanSavedState=function(pr){if(!hash_1.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(pr)},$r}();hmac$3.HMAC=HMAC;function hmac$2($r,pr,Mr){var Nr=new HMAC($r,pr);Nr.update(Mr);var Dr=Nr.digest();return Nr.clean(),Dr}hmac$3.hmac=hmac$2;hmac$3.equal=constant_time_1.equal;Object.defineProperty(hkdf,"__esModule",{value:!0});var hmac_1=hmac$3,wipe_1$1=wipe$1,HKDF=function(){function $r(pr,Mr,Nr,Dr){Nr===void 0&&(Nr=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=pr,this._info=Dr;var Br=hmac_1.hmac(this._hash,Nr,Mr);this._hmac=new hmac_1.HMAC(pr,Br),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return $r.prototype._fillBuffer=function(){this._counter[0]++;var pr=this._counter[0];if(pr===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),pr>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},$r.prototype.expand=function(pr){for(var Mr=new Uint8Array(pr),Nr=0;Nr<Mr.length;Nr++)this._bufpos===this._buffer.length&&this._fillBuffer(),Mr[Nr]=this._buffer[this._bufpos++];return Mr},$r.prototype.clean=function(){this._hmac.clean(),wipe_1$1.wipe(this._buffer),wipe_1$1.wipe(this._counter),this._bufpos=0},$r}(),HKDF_1=hkdf.HKDF=HKDF,random={},system={},browser$g={};Object.defineProperty(browser$g,"__esModule",{value:!0});browser$g.BrowserRandomSource=void 0;const QUOTA=65536;class BrowserRandomSource{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const pr=typeof self<"u"?self.crypto||self.msCrypto:null;pr&&pr.getRandomValues!==void 0&&(this._crypto=pr,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(pr){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const Mr=new Uint8Array(pr);for(let Nr=0;Nr<Mr.length;Nr+=QUOTA)this._crypto.getRandomValues(Mr.subarray(Nr,Nr+Math.min(Mr.length-Nr,QUOTA)));return Mr}}browser$g.BrowserRandomSource=BrowserRandomSource;function commonjsRequire($r){throw new Error('Could not dynamically require "'+$r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var node$1={},cryptoBrowserify={},browser$f={exports:{}},safeBuffer$1={exports:{}};const require$$0$4=getAugmentedNamespace(dist$b);/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function($r,pr){var Mr=require$$0$4,Nr=Mr.Buffer;function Dr(Lr,jr){for(var Ur in Lr)jr[Ur]=Lr[Ur]}Nr.from&&Nr.alloc&&Nr.allocUnsafe&&Nr.allocUnsafeSlow?$r.exports=Mr:(Dr(Mr,pr),pr.Buffer=Br);function Br(Lr,jr,Ur){return Nr(Lr,jr,Ur)}Br.prototype=Object.create(Nr.prototype),Dr(Nr,Br),Br.from=function(Lr,jr,Ur){if(typeof Lr=="number")throw new TypeError("Argument must not be a number");return Nr(Lr,jr,Ur)},Br.alloc=function(Lr,jr,Ur){if(typeof Lr!="number")throw new TypeError("Argument must be a number");var Gr=Nr(Lr);return jr!==void 0?typeof Ur=="string"?Gr.fill(jr,Ur):Gr.fill(jr):Gr.fill(0),Gr},Br.allocUnsafe=function(Lr){if(typeof Lr!="number")throw new TypeError("Argument must be a number");return Nr(Lr)},Br.allocUnsafeSlow=function(Lr){if(typeof Lr!="number")throw new TypeError("Argument must be a number");return Mr.SlowBuffer(Lr)}})(safeBuffer$1,safeBuffer$1.exports);var safeBufferExports=safeBuffer$1.exports,MAX_BYTES=65536,MAX_UINT32=4294967295;function oldBrowser$1(){throw new Error(`Secure random number generation is not supported by this browser.
|
|
126
126
|
Use Chrome, Firefox or Internet Explorer 11`)}var Buffer$F=safeBufferExports.Buffer,crypto$4=commonjsGlobal.crypto||commonjsGlobal.msCrypto;crypto$4&&crypto$4.getRandomValues?browser$f.exports=randomBytes$2:browser$f.exports=oldBrowser$1;function randomBytes$2($r,pr){if($r>MAX_UINT32)throw new RangeError("requested too many random bytes");var Mr=Buffer$F.allocUnsafe($r);if($r>0)if($r>MAX_BYTES)for(var Nr=0;Nr<$r;Nr+=MAX_BYTES)crypto$4.getRandomValues(Mr.slice(Nr,Nr+MAX_BYTES));else crypto$4.getRandomValues(Mr);return typeof pr=="function"?process$1.nextTick(function(){pr(null,Mr)}):Mr}var browserExports=browser$f.exports,inherits_browser={exports:{}};typeof Object.create=="function"?inherits_browser.exports=function(pr,Mr){Mr&&(pr.super_=Mr,pr.prototype=Object.create(Mr.prototype,{constructor:{value:pr,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser.exports=function(pr,Mr){if(Mr){pr.super_=Mr;var Nr=function(){};Nr.prototype=Mr.prototype,pr.prototype=new Nr,pr.prototype.constructor=pr}};var inherits_browserExports=inherits_browser.exports,readableBrowser={exports:{}},streamBrowser=eventsExports.EventEmitter,util={},types$5={},toStr=Object.prototype.toString,fnToStr=Function.prototype.toString,isFnRegex=/^\s*(?:function)?\*/,hasToStringTag=shams(),getProto=Object.getPrototypeOf,getGeneratorFunc=function(){if(!hasToStringTag)return!1;try{return Function("return function*() {}")()}catch{}},GeneratorFunction,isGeneratorFunction=function(pr){if(typeof pr!="function")return!1;if(isFnRegex.test(fnToStr.call(pr)))return!0;if(!hasToStringTag){var Mr=toStr.call(pr);return Mr==="[object GeneratorFunction]"}if(!getProto)return!1;if(typeof GeneratorFunction>"u"){var Nr=getGeneratorFunc();GeneratorFunction=Nr?getProto(Nr):!1}return getProto(pr)===GeneratorFunction};(function($r){var pr=isArguments$4,Mr=isGeneratorFunction,Nr=whichTypedArray$2,Dr=isTypedArray$3;function Br(Jo){return Jo.call.bind(Jo)}var Lr=typeof BigInt<"u",jr=typeof Symbol<"u",Ur=Br(Object.prototype.toString),Gr=Br(Number.prototype.valueOf),Yr=Br(String.prototype.valueOf),Qr=Br(Boolean.prototype.valueOf);if(Lr)var Wn=Br(BigInt.prototype.valueOf);if(jr)var ga=Br(Symbol.prototype.valueOf);function eo(Jo,Zu){if(typeof Jo!="object")return!1;try{return Zu(Jo),!0}catch{return!1}}$r.isArgumentsObject=pr,$r.isGeneratorFunction=Mr,$r.isTypedArray=Dr;function _i(Jo){return typeof Promise<"u"&&Jo instanceof Promise||Jo!==null&&typeof Jo=="object"&&typeof Jo.then=="function"&&typeof Jo.catch=="function"}$r.isPromise=_i;function va(Jo){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Jo):Dr(Jo)||ho(Jo)}$r.isArrayBufferView=va;function io(Jo){return Nr(Jo)==="Uint8Array"}$r.isUint8Array=io;function no(Jo){return Nr(Jo)==="Uint8ClampedArray"}$r.isUint8ClampedArray=no;function so(Jo){return Nr(Jo)==="Uint16Array"}$r.isUint16Array=so;function ao(Jo){return Nr(Jo)==="Uint32Array"}$r.isUint32Array=ao;function fo(Jo){return Nr(Jo)==="Int8Array"}$r.isInt8Array=fo;function lo(Jo){return Nr(Jo)==="Int16Array"}$r.isInt16Array=lo;function oo(Jo){return Nr(Jo)==="Int32Array"}$r.isInt32Array=oo;function po(Jo){return Nr(Jo)==="Float32Array"}$r.isFloat32Array=po;function mo(Jo){return Nr(Jo)==="Float64Array"}$r.isFloat64Array=mo;function $o(Jo){return Nr(Jo)==="BigInt64Array"}$r.isBigInt64Array=$o;function Xn(Jo){return Nr(Jo)==="BigUint64Array"}$r.isBigUint64Array=Xn;function Fr(Jo){return Ur(Jo)==="[object Map]"}Fr.working=typeof Map<"u"&&Fr(new Map);function Vr(Jo){return typeof Map>"u"?!1:Fr.working?Fr(Jo):Jo instanceof Map}$r.isMap=Vr;function Wr(Jo){return Ur(Jo)==="[object Set]"}Wr.working=typeof Set<"u"&&Wr(new Set);function Jr(Jo){return typeof Set>"u"?!1:Wr.working?Wr(Jo):Jo instanceof Set}$r.isSet=Jr;function Gn(Jo){return Ur(Jo)==="[object WeakMap]"}Gn.working=typeof WeakMap<"u"&&Gn(new WeakMap);function to(Jo){return typeof WeakMap>"u"?!1:Gn.working?Gn(Jo):Jo instanceof WeakMap}$r.isWeakMap=to;function ro(Jo){return Ur(Jo)==="[object WeakSet]"}ro.working=typeof WeakSet<"u"&&ro(new WeakSet);function Un(Jo){return ro(Jo)}$r.isWeakSet=Un;function Hr(Jo){return Ur(Jo)==="[object ArrayBuffer]"}Hr.working=typeof ArrayBuffer<"u"&&Hr(new ArrayBuffer);function Xr(Jo){return typeof ArrayBuffer>"u"?!1:Hr.working?Hr(Jo):Jo instanceof ArrayBuffer}$r.isArrayBuffer=Xr;function co(Jo){return Ur(Jo)==="[object DataView]"}co.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&co(new DataView(new ArrayBuffer(1),0,1));function ho(Jo){return typeof DataView>"u"?!1:co.working?co(Jo):Jo instanceof DataView}$r.isDataView=ho;var go=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function bo(Jo){return Ur(Jo)==="[object SharedArrayBuffer]"}function Eo(Jo){return typeof go>"u"?!1:(typeof bo.working>"u"&&(bo.working=bo(new go)),bo.working?bo(Jo):Jo instanceof go)}$r.isSharedArrayBuffer=Eo;function wo(Jo){return Ur(Jo)==="[object AsyncFunction]"}$r.isAsyncFunction=wo;function Io(Jo){return Ur(Jo)==="[object Map Iterator]"}$r.isMapIterator=Io;function Po(Jo){return Ur(Jo)==="[object Set Iterator]"}$r.isSetIterator=Po;function yo(Jo){return Ur(Jo)==="[object Generator]"}$r.isGeneratorObject=yo;function xo(Jo){return Ur(Jo)==="[object WebAssembly.Module]"}$r.isWebAssemblyCompiledModule=xo;function Mo(Jo){return eo(Jo,Gr)}$r.isNumberObject=Mo;function qo(Jo){return eo(Jo,Yr)}$r.isStringObject=qo;function pu(Jo){return eo(Jo,Qr)}$r.isBooleanObject=pu;function nu(Jo){return Lr&&eo(Jo,Wn)}$r.isBigIntObject=nu;function eu(Jo){return jr&&eo(Jo,ga)}$r.isSymbolObject=eu;function Uu(Jo){return Mo(Jo)||qo(Jo)||pu(Jo)||nu(Jo)||eu(Jo)}$r.isBoxedPrimitive=Uu;function mu(Jo){return typeof Uint8Array<"u"&&(Xr(Jo)||Eo(Jo))}$r.isAnyArrayBuffer=mu,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Jo){Object.defineProperty($r,Jo,{enumerable:!1,value:function(){throw new Error(Jo+" is not supported in userland")}})})})(types$5);var isBufferBrowser=function(pr){return pr&&typeof pr=="object"&&typeof pr.copy=="function"&&typeof pr.fill=="function"&&typeof pr.readUInt8=="function"};(function($r){var pr=Object.getOwnPropertyDescriptors||function(ho){for(var go=Object.keys(ho),bo={},Eo=0;Eo<go.length;Eo++)bo[go[Eo]]=Object.getOwnPropertyDescriptor(ho,go[Eo]);return bo},Mr=/%[sdj%]/g;$r.format=function(co){if(!fo(co)){for(var ho=[],go=0;go<arguments.length;go++)ho.push(Lr(arguments[go]));return ho.join(" ")}for(var go=1,bo=arguments,Eo=bo.length,wo=String(co).replace(Mr,function(Po){if(Po==="%%")return"%";if(go>=Eo)return Po;switch(Po){case"%s":return String(bo[go++]);case"%d":return Number(bo[go++]);case"%j":try{return JSON.stringify(bo[go++])}catch{return"[Circular]"}default:return Po}}),Io=bo[go];go<Eo;Io=bo[++go])no(Io)||!mo(Io)?wo+=" "+Io:wo+=" "+Lr(Io);return wo},$r.deprecate=function(co,ho){if(typeof process$1<"u"&&process$1.noDeprecation===!0)return co;if(typeof process$1>"u")return function(){return $r.deprecate(co,ho).apply(this,arguments)};var go=!1;function bo(){if(!go){if(process$1.throwDeprecation)throw new Error(ho);process$1.traceDeprecation?console.trace(ho):console.error(ho),go=!0}return co.apply(this,arguments)}return bo};var Nr={},Dr=/^$/;if({}.NODE_DEBUG){var Br={}.NODE_DEBUG;Br=Br.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),Dr=new RegExp("^"+Br+"$","i")}$r.debuglog=function(co){if(co=co.toUpperCase(),!Nr[co])if(Dr.test(co)){var ho=process$1.pid;Nr[co]=function(){var go=$r.format.apply($r,arguments);console.error("%s %d: %s",co,ho,go)}}else Nr[co]=function(){};return Nr[co]};function Lr(co,ho){var go={seen:[],stylize:Ur};return arguments.length>=3&&(go.depth=arguments[2]),arguments.length>=4&&(go.colors=arguments[3]),io(ho)?go.showHidden=ho:ho&&$r._extend(go,ho),oo(go.showHidden)&&(go.showHidden=!1),oo(go.depth)&&(go.depth=2),oo(go.colors)&&(go.colors=!1),oo(go.customInspect)&&(go.customInspect=!0),go.colors&&(go.stylize=jr),Yr(go,co,go.depth)}$r.inspect=Lr,Lr.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]},Lr.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function jr(co,ho){var go=Lr.styles[ho];return go?"\x1B["+Lr.colors[go][0]+"m"+co+"\x1B["+Lr.colors[go][1]+"m":co}function Ur(co,ho){return co}function Gr(co){var ho={};return co.forEach(function(go,bo){ho[go]=!0}),ho}function Yr(co,ho,go){if(co.customInspect&&ho&&Fr(ho.inspect)&&ho.inspect!==$r.inspect&&!(ho.constructor&&ho.constructor.prototype===ho)){var bo=ho.inspect(go,co);return fo(bo)||(bo=Yr(co,bo,go)),bo}var Eo=Qr(co,ho);if(Eo)return Eo;var wo=Object.keys(ho),Io=Gr(wo);if(co.showHidden&&(wo=Object.getOwnPropertyNames(ho)),Xn(ho)&&(wo.indexOf("message")>=0||wo.indexOf("description")>=0))return Wn(ho);if(wo.length===0){if(Fr(ho)){var Po=ho.name?": "+ho.name:"";return co.stylize("[Function"+Po+"]","special")}if(po(ho))return co.stylize(RegExp.prototype.toString.call(ho),"regexp");if($o(ho))return co.stylize(Date.prototype.toString.call(ho),"date");if(Xn(ho))return Wn(ho)}var yo="",xo=!1,Mo=["{","}"];if(va(ho)&&(xo=!0,Mo=["[","]"]),Fr(ho)){var qo=ho.name?": "+ho.name:"";yo=" [Function"+qo+"]"}if(po(ho)&&(yo=" "+RegExp.prototype.toString.call(ho)),$o(ho)&&(yo=" "+Date.prototype.toUTCString.call(ho)),Xn(ho)&&(yo=" "+Wn(ho)),wo.length===0&&(!xo||ho.length==0))return Mo[0]+yo+Mo[1];if(go<0)return po(ho)?co.stylize(RegExp.prototype.toString.call(ho),"regexp"):co.stylize("[Object]","special");co.seen.push(ho);var pu;return xo?pu=ga(co,ho,go,Io,wo):pu=wo.map(function(nu){return eo(co,ho,go,Io,nu,xo)}),co.seen.pop(),_i(pu,yo,Mo)}function Qr(co,ho){if(oo(ho))return co.stylize("undefined","undefined");if(fo(ho)){var go="'"+JSON.stringify(ho).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return co.stylize(go,"string")}if(ao(ho))return co.stylize(""+ho,"number");if(io(ho))return co.stylize(""+ho,"boolean");if(no(ho))return co.stylize("null","null")}function Wn(co){return"["+Error.prototype.toString.call(co)+"]"}function ga(co,ho,go,bo,Eo){for(var wo=[],Io=0,Po=ho.length;Io<Po;++Io)ro(ho,String(Io))?wo.push(eo(co,ho,go,bo,String(Io),!0)):wo.push("");return Eo.forEach(function(yo){yo.match(/^\d+$/)||wo.push(eo(co,ho,go,bo,yo,!0))}),wo}function eo(co,ho,go,bo,Eo,wo){var Io,Po,yo;if(yo=Object.getOwnPropertyDescriptor(ho,Eo)||{value:ho[Eo]},yo.get?yo.set?Po=co.stylize("[Getter/Setter]","special"):Po=co.stylize("[Getter]","special"):yo.set&&(Po=co.stylize("[Setter]","special")),ro(bo,Eo)||(Io="["+Eo+"]"),Po||(co.seen.indexOf(yo.value)<0?(no(go)?Po=Yr(co,yo.value,null):Po=Yr(co,yo.value,go-1),Po.indexOf(`
|
|
127
127
|
`)>-1&&(wo?Po=Po.split(`
|
|
128
128
|
`).map(function(xo){return" "+xo}).join(`
|
|
@@ -184,7 +184,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
184
184
|
- Extension \`${Mr.name}\` supports version(s) \`${Nr}\``:Nr||(pr+=`
|
|
185
185
|
- Extension \`${Mr.name}\` does not support ${m$1.platform} environments.`)}),new A$1(o.IncompatibleExtensions,pr)}function Et($r){let pr=Mr=>{let Nr=Mr+1,Dr=Nr%10,Br=Nr%100;return Dr===1&&Br!==11?`${Nr}st`:Dr===2&&Br!==12?`${Nr}nd`:Dr===3&&Br!==13?`${Nr}rd`:`${Nr}th`};return new A$1(o.InvalidArgument,`Invalid ${pr($r.argument)} argument given to \`${$r.procedure}\`.
|
|
186
186
|
Expected: \`${$r.expected}\`
|
|
187
|
-
Received: \`${$r.received}\``)}function _r(){return new j(_$2.DuplicateIframe,"Duplicate iframes found.")}function yt(){return new j(_$2.SyncWeb3Method,"Non-async web3 methods are deprecated in web3 > 1.0 and are not supported by the Magic web3 provider. Please use an async method instead.")}function gt(){return new j(_$2.ReactNativeEndpointConfiguration,`CUSTOM DOMAINS ARE NOT SUPPORTED WHEN USING MAGIC SDK WITH REACT NATIVE! The \`endpoint\` parameter SHOULD NOT be provided. The Magic \`<iframe>\` is automatically wrapped by a WebView pointed at \`${m$1.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`)}function k($r){let{method:pr,removalVersions:Mr,useInstead:Nr}=$r,Dr=Mr[m$1.sdkName],Br=Nr?` Use \`${Nr}\` instead.`:"",Lr=`\`${pr}\` will be removed from \`${m$1.sdkName}\` in version \`${Dr}\`.${Br}`;return new j(_$2.DeprecationNotice,Lr)}function*Kn(){let $r=0;for(;;)$r<Number.MAX_SAFE_INTEGER?yield++$r:$r=0}var jn=Kn();function Ae(){return jn.next().value}var Rt=Symbol("Payload pre-processed by Magic SDK");function vt($r){return Object.defineProperty($r,Rt,{value:!0,enumerable:!1}),$r}function Bn($r){return!!$r[Rt]}function J($r){var pr,Mr,Nr;return Bn($r)||($r.jsonrpc=(pr=$r.jsonrpc)!=null?pr:"2.0",$r.id=Ae(),$r.method=(Mr=$r.method)!=null?Mr:"noop",$r.params=(Nr=$r.params)!=null?Nr:[],vt($r)),$r}function u$1($r,pr=[]){return vt({params:pr,method:$r,jsonrpc:"2.0",id:Ae()})}var W=class{constructor($r){$r instanceof W?(this._jsonrpc=$r.payload.jsonrpc,this._id=$r.payload.id,this._result=$r.payload.result,this._error=$r.payload.error):ct($r)?(this._jsonrpc=$r.jsonrpc,this._id=$r.id,this._result=$r.result,this._error=$r.error):(this._jsonrpc=$r.jsonrpc,this._id=$r.id,this._result=void 0,this._error=void 0)}applyError($r){return this._error=$r,this}applyResult($r){return this._result=$r,this}get hasError(){return typeof this._error<"u"&&this._error!==null}get hasResult(){return typeof this._result<"u"}get payload(){return{jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}},bt$1=Yt(It()),Ce=class extends bt$1.default{};function fe(){let $r=new Ce;return{emitter:$r,createChainingEmitterMethod:(pr,Mr)=>(...Nr)=>($r[pr].apply($r,Nr),Mr),createBoundEmitterMethod:pr=>(...Mr)=>$r[pr].apply($r,Mr)}}var wt=Symbol("isPromiEvent");function Pt($r){return!!$r[wt]}function V($r){let pr=Le($r),{createBoundEmitterMethod:Mr,createChainingEmitterMethod:Nr}=fe(),Dr=Symbol("Promise.then"),Br=Symbol("Promise.catch"),Lr=Symbol("Promise.finally"),jr=(Yr,Qr)=>(...Wn)=>{let ga=Qr[Yr].apply(Qr,Wn);return Ur(ga)},Ur=Yr=>Object.assign(Yr,{[wt]:!0,[Dr]:Yr[Dr]||Yr.then,[Br]:Yr[Br]||Yr.catch,[Lr]:Yr[Lr]||Yr.finally,then:jr(Dr,Yr),catch:jr(Br,Yr),finally:jr(Lr,Yr),on:Nr("on",Yr),once:Nr("once",Yr),addListener:Nr("addListener",Yr),off:Nr("off",Yr),removeListener:Nr("removeListener",Yr),removeAllListeners:Nr("removeAllListeners",Yr),emit:Mr("emit"),eventNames:Mr("eventNames"),listeners:Mr("listeners"),listenerCount:Mr("listenerCount")}),Gr=Ur(pr.then(Yr=>(Gr.emit("done",Yr),Gr.emit("settled"),Yr),Yr=>{throw Gr.emit("error",Yr),Gr.emit("settled"),Yr}));return Gr}function Le($r){return new Promise((pr,Mr)=>{let Nr=$r(pr,Mr);Promise.resolve(Nr).catch(Mr)})}var P=class{constructor($r){this.sdk=$r}get overlay(){return this.sdk.overlay}request($r){let pr=this.overlay.post(g$1.MAGIC_HANDLE_REQUEST,J($r)),Mr=V((Dr,Br)=>{pr.then(Lr=>{if(Nr(),Lr.hasError)Br(new O$1(Lr.payload.error));else if(Lr.hasResult)Dr(Lr.payload.result);else throw mt()}).catch(Lr=>{Nr(),Br(Lr)})}),Nr=this.overlay.on(u$2.MAGIC_HANDLE_EVENT,Dr=>{var Br;let{response:Lr}=Dr.data;if(Lr.id===$r.id&&((Br=Lr.result)!=null&&Br.event)){let{event:jr,params:Ur=[]}=Lr.result;Mr.emit(jr,...Ur)}});return Mr}createIntermediaryEvent($r,pr){return Mr=>{let Nr=u$1(l.IntermediaryEvent,[{payloadId:pr,eventType:$r,args:Mr}]);this.request(Nr)}}};function Mt($r,pr){let[Mr]=$r.split(".").map(Number);return Mr>=pr}var U$1={"magic-sdk":"v18.0.0","@magic-sdk/react-native":"v14.0.0","@magic-sdk/react-native-bare":"v19.0.0","@magic-sdk/react-native-expo":"v19.0.0"},ye=class extends P{loginWithMagicLink($r){let pr=m$1.sdkName==="@magic-sdk/react-native"||m$1.sdkName==="@magic-sdk/react-native-bare"||m$1.sdkName==="@magic-sdk/react-native-expo";if(pr&&Mt(m$1.version,19))throw new Error("loginWithMagicLink() is deprecated for this package, please utlize a passcode method like loginWithSMS or loginWithEmailOTP instead.");pr&&k({method:"auth.loginWithMagicLink()",removalVersions:U$1,useInstead:"auth.loginWithEmailOTP()"}).log();let{email:Mr,showUI:Nr=!0,redirectURI:Dr,overrides:Br}=$r,Lr=u$1(this.sdk.testMode?l.LoginWithMagicLinkTestMode:l.LoginWithMagicLink,[{email:Mr,showUI:Nr,redirectURI:Dr,overrides:Br}]);return this.request(Lr)}loginWithSMS($r){let{phoneNumber:pr}=$r,Mr=u$1(this.sdk.testMode?l.LoginWithSmsTestMode:l.LoginWithSms,[{phoneNumber:pr,showUI:!0}]);return this.request(Mr)}loginWithEmailOTP($r){let{email:pr,showUI:Mr,deviceCheckUI:Nr,overrides:Dr}=$r,Br=u$1(this.sdk.testMode?l.LoginWithEmailOTPTestMode:l.LoginWithEmailOTP,[{email:pr,showUI:Mr,deviceCheckUI:Nr,overrides:Dr}]),Lr=this.request(Br);return!Nr&&Lr&&Lr.on(T$1.Retry,()=>{this.createIntermediaryEvent(T$1.Retry,Br.id)()}),!Mr&&Lr&&(Lr.on(I$1.VerifyEmailOtp,jr=>{this.createIntermediaryEvent(I$1.VerifyEmailOtp,Br.id)(jr)}),Lr.on(I$1.Cancel,()=>{this.createIntermediaryEvent(I$1.Cancel,Br.id)()})),Lr}loginWithCredential($r){let pr=$r??"";if(!$r&&m$1.platform==="web"){pr=window.location.search;let Nr=window.location.origin+window.location.pathname;window.history.replaceState(null,"",Nr)}let Mr=u$1(this.sdk.testMode?l.LoginWithCredentialTestMode:l.LoginWithCredential,[pr]);return this.request(Mr)}setAuthorizationToken($r){let pr=u$1(l.SetAuthorizationToken,[{jwt:$r}]);return this.request(pr)}updateEmailWithUI($r){let{email:pr,showUI:Mr=!0}=$r,Nr=u$1(this.sdk.testMode?l.UpdateEmailTestMode:l.UpdateEmail,[{email:pr,showUI:Mr}]);return this.request(Nr)}},re={};Xt(re,{clear:()=>Zn,getItem:()=>y$1,iterate:()=>_e,key:()=>er,keys:()=>tr,length:()=>Qn,removeItem:()=>S,setItem:()=>x$1});var ge$1;function F($r){return(...pr)=>f$1(this,null,function*(){return ge$1||(ge$1=yield m$1.configureStorage()),yield ge$1.ready(),ge$1[$r](...pr)})}var y$1=F("getItem"),x$1=F("setItem"),S=F("removeItem"),Zn=F("clear"),Qn=F("length"),er=F("key"),tr=F("keys"),_e=F("iterate");function Nt(){let $r=window.crypto.getRandomValues(new Uint8Array(16));$r[6]=$r[6]&15|64,$r[8]=$r[8]&191|128;let pr="";return pr+=$r[0].toString(16),pr+=$r[1].toString(16),pr+=$r[2].toString(16),pr+=$r[3].toString(16),pr+="-",pr+=$r[4].toString(16),pr+=$r[5].toString(16),pr+="-",pr+=$r[6].toString(16),pr+=$r[7].toString(16),pr+="-",pr+=$r[8].toString(16),pr+=$r[9].toString(16),pr+="-",pr+=$r[10].toString(16),pr+=$r[11].toString(16),pr+=$r[12].toString(16),pr+=$r[13].toString(16),pr+=$r[14].toString(16),pr+=$r[15].toString(16),pr}var Oe="STORE_KEY_PRIVATE_KEY",Re="STORE_KEY_PUBLIC_JWK",At="ECDSA",nr="P-256",rr$1={name:At,namedCurve:nr};function se$1(){let $r=typeof window<"u"&&!!window.crypto,pr=$r&&!!window.crypto.subtle;return $r&&pr}function St(){return f$1(this,null,function*(){let $r=yield sr();if(!$r){console.info("unable to create public key or webcrypto is unsupported");return}let{subtle:pr}=window.crypto,Mr=yield y$1(Oe);if(!Mr||!pr){console.info("unable to find private key or webcrypto unsupported");return}let Nr={iat:Math.floor(new Date().getTime()/1e3),jti:Nt()},Dr={typ:"dpop+jwt",alg:"ES256",jwk:$r},Br={protected:$t(JSON.stringify(Dr)),claims:$t(JSON.stringify(Nr))},Lr=ir(`${Br.protected}.${Br.claims}`),jr={name:At,hash:{name:"SHA-256"}},Ur=cr(new Uint8Array(yield pr.sign(jr,Mr,Lr)));return`${Br.protected}.${Br.claims}.${Ur}`})}function sr(){return f$1(this,null,function*(){if(!se$1()){console.info("webcrypto is not supported");return}return(yield y$1(Re))||(yield or()),y$1(Re)})}function or(){return f$1(this,null,function*(){let{subtle:$r}=window.crypto,pr=yield $r.generateKey(rr$1,!1,["sign"]),Mr=yield $r.exportKey("jwk",pr.publicKey);yield x$1(Oe,pr.privateKey),yield x$1(Re,Mr)})}function $t($r){return Ct(ar($r))}function ir($r){return new TextEncoder().encode($r)}function Ct($r){return btoa($r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function ar($r){return encodeURIComponent($r).replace(/%([0-9A-F]{2})/g,(pr,Mr)=>String.fromCharCode(parseInt(Mr,16)))}function cr($r){let pr="";return $r.forEach(Mr=>{pr+=String.fromCharCode(Mr)}),Ct(pr)}var ke$1="ds",qe="ek",De="iv",We="AES-GCM",lr=256;function X(){return f$1(this,null,function*(){let $r=[];yield _e((pr,Mr,Nr)=>{Mr.startsWith(`${ke$1}_`)&&$r.push(Mr)});for(let pr of $r)yield S(pr)})}function Lt($r){let pr="",Mr=new Uint8Array($r),Nr=Mr.byteLength;for(let Dr=0;Dr<Nr;Dr++)pr+=String.fromCharCode(Mr[Dr]);return window.btoa(pr)}function _t($r){let pr=window.atob($r),Mr=pr.length,Nr=new Uint8Array(Mr);for(let Dr=0;Dr<Mr;Dr++)Nr[Dr]=pr.charCodeAt(Dr);return Nr.buffer}function dr(){return f$1(this,null,function*(){if(!se$1()){console.info("webcrypto is not supported");return}let{crypto:$r}=window;return(yield y$1(De))||$r.getRandomValues(new Uint8Array(12))})}function ur(){return f$1(this,null,function*(){if(!se$1()){console.info("webcrypto is not supported");return}let{subtle:$r}=window.crypto;return(yield y$1(qe))||(yield $r.generateKey({name:We,length:lr},!1,["encrypt","decrypt"]))})}function Ot($r,pr){return f$1(this,null,function*(){let Mr=yield dr(),Nr=yield ur();if(!Mr||!Nr||!$r)return;let Dr=_t($r),{subtle:Br}=window.crypto,Lr=yield Br.encrypt({name:We,iv:Mr},Nr,Dr),jr=Lt(Lr);yield x$1(`${ke$1}_${pr}`,jr),yield x$1(qe,Nr),yield x$1(De,Mr)})}function kt($r){return f$1(this,null,function*(){let pr=yield y$1(`${ke$1}_${$r}`),Mr=yield y$1(De),Nr=yield y$1(qe);if(!Mr||!pr||!Nr||!se$1())return;let{subtle:Dr}=window.crypto,Br=yield Dr.decrypt({name:We,iv:Mr},Nr,_t(pr));return Lt(Br)})}var ve$1=class extends P{constructor(){super(...arguments),this.localForageKey="mc_active_wallet"}getIdToken(pr){let Mr=u$1(this.sdk.testMode?l.GetIdTokenTestMode:l.GetIdToken,[pr]);return this.request(Mr)}generateIdToken(pr){let Mr=u$1(this.sdk.testMode?l.GenerateIdTokenTestMode:l.GenerateIdToken,[pr]);return this.request(Mr)}getInfo(){return f$1(this,null,function*(){let pr=yield y$1(this.localForageKey),Mr=u$1(l.GetInfo,[{walletType:pr}]);return this.request(Mr)})}isLoggedIn(){let pr=u$1(this.sdk.testMode?l.IsLoggedInTestMode:l.IsLoggedIn);return this.request(pr)}logout(){S(this.localForageKey),X();let pr=u$1(this.sdk.testMode?l.LogoutTestMode:l.Logout);return this.request(pr)}requestInfoWithUI(pr){let Mr=u$1(l.RequestUserInfoWithUI,pr?[pr]:[]);return this.request(Mr)}showSettings(pr){let Mr=u$1(this.sdk.testMode?l.UserSettingsTestMode:l.UserSettings,[pr]);return this.request(Mr)}recoverAccount(pr){let Mr=u$1(this.sdk.testMode?l.RecoverAccountTestMode:l.RecoverAccount,[pr]);return this.request(Mr)}getMetadata(){k({method:"user.getMetadata()",removalVersions:U$1,useInstead:"user.getInfo()"}).log();let pr=u$1(this.sdk.testMode?l.GetMetadataTestMode:l.GetMetadata);return this.request(pr)}updateEmail(pr){k({method:"user.updateEmail()",removalVersions:U$1,useInstead:"auth.updateEmailWithUI()"}).log();let{email:Mr,showUI:Nr=!0}=pr,Dr=u$1(this.sdk.testMode?l.UpdateEmailTestMode:l.UpdateEmail,[{email:Mr,showUI:Nr}]);return this.request(Dr)}};function Ue($r,pr){return pr?new URL($r,pr):new URL($r)}var Te$1=class extends P{constructor(){super(...arguments),this.localForageKey="mc_active_wallet"}connectWithUI(){let pr=V((Mr,Nr)=>f$1(this,null,function*(){try{if(this.isMetaMaskBrowser()&&(yield this.isWalletEnabled(p.MetaMask))){let Ur=yield this.autoConnectIfWalletBrowser(p.MetaMask);Mr(Ur);return}if(this.isCoinbaseWalletBrowser()&&(yield this.isWalletEnabled(p.CoinbaseWallet))){let Ur=yield this.autoConnectIfWalletBrowser(p.CoinbaseWallet);Mr(Ur);return}let Dr=this.getUserEnv(),Br=u$1(l.Login,[Dr]),Lr=this.request(Br);Lr.on(c.WalletSelected,Ur=>this.handleWalletSelected(ae(G({},Ur),{payloadId:Br.id}))),Lr.on("id-token-created",Ur=>{pr.emit("id-token-created",Ur)});let jr=yield Lr;jr.error&&Nr(jr),Mr(jr)}catch(Dr){Nr(Dr)}}));return pr}showUI(){return this.request(u$1(l.ShowUI))}showAddress(){return this.request(u$1(l.ShowAddress))}showSendTokensUI(){return this.request(u$1(l.ShowSendTokensUI))}showOnRamp(){return this.request(u$1(l.ShowOnRamp))}showNFTs(){return this.request(u$1(l.ShowNFTs))}showBalances(){return this.request(u$1(l.ShowBalances))}sendGaslessTransaction(pr,Mr){return this.request(u$1(l.SendGaslessTransaction,[pr,Mr]))}getInfo(){return f$1(this,null,function*(){k({method:"wallet.getInfo()",removalVersions:U$1,useInstead:"user.getInfo()"}).log();let pr=yield y$1(this.localForageKey),Mr=u$1(l.GetInfo,[{walletType:pr}]);return this.request(Mr)})}disconnect(){k({method:"wallet.disconnect()",removalVersions:U$1,useInstead:"user.logout()"}).log(),S(this.localForageKey),X();let pr=u$1(l.Disconnect);return this.request(pr)}requestUserInfoWithUI(pr){k({method:"wallet.requestUserInfoWithUI()",removalVersions:U$1,useInstead:"user.requestUserInfoWithUI()"}).log();let Mr=u$1(l.RequestUserInfoWithUI,pr?[pr]:[]);return this.request(Mr)}getProvider(){return f$1(this,null,function*(){switch(yield y$1(this.localForageKey)){case p.MetaMask:return this.getMetaMaskProvider();case p.CoinbaseWallet:return this.getCoinbaseProvider();default:return this.sdk.rpcProvider}})}isMetaMaskInstalled(){var pr,Mr,Nr;return((pr=window.ethereum)==null?void 0:pr.isMetaMask)||!!((Nr=(Mr=window.ethereum)==null?void 0:Mr.providers)!=null&&Nr.find(Dr=>Dr==null?void 0:Dr.isMetaMask))}isMetaMaskBrowser(){return this.isMobile()&&this.isMetaMaskInstalled()}getMetaMaskProvider(){var pr,Mr;return((Mr=(pr=window.ethereum)==null?void 0:pr.providers)==null?void 0:Mr.find(Nr=>Nr==null?void 0:Nr.isMetaMask))||window.ethereum}connectToMetaMask(){if(this.isMobile()&&!this.isMetaMaskInstalled()){let pr=`https://metamask.app.link/dapp/${window.location.href.replace(/(^\w+:|^)\/\//,"")}`;window.location.href=pr}return this.getMetaMaskProvider().request({method:"eth_requestAccounts"})}isCoinbaseWalletInstalled(){var pr,Mr,Nr;return((pr=window.ethereum)==null?void 0:pr.isCoinbaseWallet)||!!((Nr=(Mr=window.ethereum)==null?void 0:Mr.providers)!=null&&Nr.find(Dr=>Dr==null?void 0:Dr.isCoinbaseWallet))}isCoinbaseWalletBrowser(){var pr;return!!((pr=window.ethereum)!=null&&pr.isCoinbaseBrowser)}getCoinbaseProvider(){var pr,Mr;return((Mr=(pr=window.ethereum)==null?void 0:pr.providers)==null?void 0:Mr.find(Nr=>Nr==null?void 0:Nr.isCoinbaseWallet))||window.ethereum}connectToCoinbaseWallet(){if(this.isMobile()&&!this.isCoinbaseWalletBrowser()){let pr=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(window.location.href)}`;window.location.href=pr}return this.getCoinbaseProvider().request({method:"eth_requestAccounts"})}isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Silk|Opera Mini/i.test(navigator.userAgent)}getUserEnv(){return{env:{isMetaMaskInstalled:this.isMetaMaskInstalled(),isCoinbaseWalletInstalled:this.isCoinbaseWalletInstalled()}}}connectToThirdPartyWallet(pr){switch(pr){case p.MetaMask:return this.connectToMetaMask();case p.CoinbaseWallet:return this.connectToCoinbaseWallet();default:throw new Error(`Invalid provider: ${pr}. Must be one of "metamask" or "coinbase_wallet".`)}}isWalletEnabled(pr){let Mr=u$1("mc_is_wallet_enabled",[{wallet:pr}]);return this.request(Mr)}handleWalletSelected(pr){return f$1(this,null,function*(){try{let Mr=yield this.connectToThirdPartyWallet(pr.wallet);yield x$1(this.localForageKey,pr.wallet),this.createIntermediaryEvent(c.WalletConnected,pr.payloadId)(Mr)}catch(Mr){console.error(Mr),this.createIntermediaryEvent(c.WalletRejected,pr.payloadId)()}})}autoConnectIfWalletBrowser(pr){return f$1(this,null,function*(){let Mr;pr===p.MetaMask&&(Mr=yield this.getMetaMaskProvider().request({method:"eth_requestAccounts"})),pr===p.CoinbaseWallet&&(Mr=yield this.getCoinbaseProvider().request({method:"eth_requestAccounts"})),yield x$1(this.localForageKey,pr);let Nr=u$1(l.AutoConnect,[{wallet:pr,address:Mr}]);return this.request(Nr)})}},{createBoundEmitterMethod:Ie,createChainingEmitterMethod:z}=fe(),be=class extends P{constructor(){super(...arguments),this.isMagic=!0,this.on=z("on",this),this.once=z("once",this),this.addListener=z("addListener",this),this.off=z("off",this),this.removeListener=z("removeListener",this),this.removeAllListeners=z("removeAllListeners",this),this.emit=Ie("emit"),this.eventNames=Ie("eventNames"),this.listeners=Ie("listeners"),this.listenerCount=Ie("listenerCount")}sendAsync($r,pr){if(!pr)throw Et({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:pr===null?"null":typeof pr});if(Array.isArray($r))this.overlay.post(g$1.MAGIC_HANDLE_REQUEST,$r.map(Mr=>{let Nr=J(Mr);return this.prefixPayloadMethodForTestMode(Nr),Nr})).then(Mr=>{pr(null,Mr.map(Nr=>ae(G({},Nr.payload),{error:Nr.hasError?new O$1(Nr.payload.error):null})))});else{let Mr=J($r);this.prefixPayloadMethodForTestMode(Mr),this.overlay.post(g$1.MAGIC_HANDLE_REQUEST,Mr).then(Nr=>{pr(Nr.hasError?new O$1(Nr.payload.error):null,Nr.payload)})}}send($r,pr){if(typeof $r=="string"){let Nr=u$1($r,Array.isArray(pr)?pr:[]);return this.request(Nr)}if(Array.isArray($r)||pr){this.sendAsync($r,pr);return}let Mr=yt();return Mr.log(),new W($r).applyError({code:-32603,message:Mr.rawMessage}).payload}enable(){let $r=u$1(l.Login);return this.request($r)}request($r){return this.prefixPayloadMethodForTestMode($r),super.request($r)}prefixPayloadMethodForTestMode($r){let pr="testMode/eth/";this.sdk.testMode&&($r.method=`${pr}${$r.method}`)}},Dt=["request","overlay","sdk"];function mr($r){let pr=Object.getPrototypeOf($r),Mr=[pr];for(;pr!==P.prototype;)pr=Object.getPrototypeOf(pr),Mr.push(pr);return Mr}var we=class extends P{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:V,isPromiEvent:Pt,encodeJSON:ue,decodeJSON:at$1,createJsonRpcRequestPayload:u$1,standardizeJsonRpcRequestPayload:J,storage:re};let $r=[this,...mr(this)];Dt.forEach(pr=>{let Mr=$r.map(Lr=>Object.getOwnPropertyDescriptor(Lr,pr)),Nr=Mr.findIndex(Lr=>!!Lr),Dr=Nr>0,Br=Mr[Nr];Br&&(this.__sdk_access_field_descriptors__.set(pr,{descriptor:Br,isPrototypeField:Dr}),Object.defineProperty(this,pr,{configurable:!0,get:()=>{throw ht(pr)}}))})}init($r){this.__is_initialized__||(Dt.forEach(pr=>{if(this.__sdk_access_field_descriptors__.has(pr)){let{descriptor:Mr,isPrototypeField:Nr}=this.__sdk_access_field_descriptors__.get(pr);Nr?delete this[pr]:Object.defineProperty(this,pr,Mr)}}),this.sdk=$r,this.__is_initialized__=!0)}createDeprecationWarning($r){let{method:pr,removalVersion:Mr,useInstead:Nr}=$r,Dr=Nr?` Use \`${Nr}\` instead.`:"",Br=`\`${pr}\` will be removed from this Extension in version \`${Mr}\`.${Dr}`;return new te(this,"DEPRECATION_NOTICE",Br)}createWarning($r,pr){return new te(this,$r,pr)}createError($r,pr,Mr){return new B(this,$r,pr,Mr)}},Je$1=class extends we{},q=class extends we{};q.Internal=Je$1,q.Anonymous="anonymous extension";var Pe=class extends P{purchase($r){let pr=u$1(l.NFTPurchase,[$r]);return this.request(pr)}checkout($r){let pr=u$1(l.NFTCheckout,[$r]);return this.request(pr)}transfer($r){let pr=u$1(l.NFTTransfer,[$r]);return this.request(pr)}};function Wt($r){return $r.compat&&$r.compat[m$1.sdkName]!=null?typeof $r.compat[m$1.sdkName]=="string"?ot(it(m$1.version),$r.compat[m$1.sdkName]):!!$r.compat[m$1.sdkName]:!0}function hr($r,pr,Mr){return!pr&&!Mr?`${$r}_eth_mainnet`:Mr?`${$r}_${JSON.stringify(Mr)}`:pr?typeof pr=="string"?`${$r}_eth_${pr}`:`${$r}_${pr.rpcUrl}_${pr.chainId}_${pr.chainType}`:`${$r}_unknown`}function fr($r){var pr;let Mr=(pr=$r==null?void 0:$r.extensions)!=null?pr:[],Nr={},Dr=[];if(Array.isArray(Mr)?Mr.forEach(Br=>{Wt(Br)?(Br.init(this),(Br.name||Br.name!==q.Anonymous)&&(this[Br.name]=Br),Br instanceof q.Internal&&(ee(Br.config)||(Nr[Br.name]=Br.config))):Dr.push(Br)}):Object.keys(Mr).forEach(Br=>{if(Wt(Mr[Br])){Mr[Br].init(this);let Lr=Mr[Br];this[Br]=Lr,Lr instanceof q.Internal&&(ee(Lr.config)||(Nr[Mr[Br].name]=Lr.config))}else Dr.push(Mr[Br])}),Dr.length)throw ft$1(Dr);return Nr}var oe=class{constructor($r,pr){this.apiKey=$r;var Mr;if(!$r)throw ut$1();m$1.platform==="react-native"&&(pr!=null&&pr.endpoint)&>().log();let{defaultEndpoint:Nr,version:Dr}=m$1;this.testMode=!!(pr!=null&&pr.testMode),this.endpoint=Ue((Mr=pr==null?void 0:pr.endpoint)!=null?Mr:Nr).origin,this.auth=new ye(this),this.user=new ve$1(this),this.wallet=new Te$1(this),this.nft=new Pe(this),this.rpcProvider=new be(this);let Br=fr.call(this,pr);this.parameters=ue(G({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:pr==null?void 0:pr.network,host:Ue(this.endpoint).host,sdk:dt[m$1.sdkName],version:Dr,ext:ee(Br)?void 0:Br,locale:(pr==null?void 0:pr.locale)||"en_US"},m$1.bundleId?{bundleId:m$1.bundleId}:{})),this.networkHash=hr(this.apiKey,pr==null?void 0:pr.network,ee(Br)?void 0:Br),pr!=null&&pr.deferPreload||this.preload()}get overlay(){if(!oe.__overlays__.has(this.parameters)){let $r=new m$1.ViewController(this.endpoint,this.parameters,this.networkHash);$r.init(),oe.__overlays__.set(this.parameters,$r)}return oe.__overlays__.get(this.parameters)}preload(){return f$1(this,null,function*(){yield this.overlay.checkIsReadyForRequest})}},Me=oe;Me.__overlays__=new Map;function Er($r,pr){return pr&&Array.isArray($r)?$r.find(Mr=>Mr.id===pr):$r}function yr($r,pr){var Mr;let Nr=(Mr=pr.data.response)==null?void 0:Mr.id,Dr=Er($r,Nr);if(Nr&&Dr){let Br=new W(Dr).applyResult(pr.data.response.result).applyError(pr.data.response.error);return{id:Nr,response:Br}}return{}}function gr($r,pr,Mr){return f$1(this,null,function*(){var Nr;let Dr=yield y$1("rt"),Br;if(m$1.platform==="web")try{Br=(Nr=yield y$1("jwt"))!=null?Nr:yield St()}catch(Ur){console.error("webcrypto error",Ur)}let Lr={msgType:$r,payload:pr};Br&&(Lr.jwt=Br),Br&&Dr&&(Lr.rt=Dr);let jr=yield kt(Mr);return jr&&(Lr.deviceShare=jr),Lr})}function Rr($r){return f$1(this,null,function*(){!$r.data.rt||(yield x$1("rt",$r.data.rt))})}var Ke=class{constructor($r,pr,Mr){this.endpoint=$r,this.parameters=pr,this.networkHash=Mr,this.messageHandlers=new Set,this.isConnectedToInternet=!0,this.checkIsReadyForRequest=this.waitForReady(),this.isReadyForRequest=!1,this.listen()}post($r,pr){return f$1(this,null,function*(){return Le((Mr,Nr)=>f$1(this,null,function*(){if(!this.isConnectedToInternet){let Gr=pt();Nr(Gr)}this.isReadyForRequest||(yield this.waitForReady());let Dr=[],Br=Array.isArray(pr)?pr.map(Gr=>Gr.id):[],Lr=yield gr(`${$r}-${this.parameters}`,pr,this.networkHash);yield this._post(Lr);let jr=Gr=>Yr=>{var Qr;let{id:Wn,response:ga}=yr(pr,Yr);if(Rr(Yr),((Qr=ga==null?void 0:ga.payload.error)==null?void 0:Qr.message)==="User denied account access.")X();else if(Yr.data.deviceShare){let{deviceShare:eo}=Yr.data;Ot(eo,this.networkHash)}Wn&&ga&&Array.isArray(pr)&&Br.includes(Wn)?(Dr.push(ga),Dr.length===pr.length&&(Gr(),Mr(Dr))):Wn&&ga&&!Array.isArray(pr)&&Wn===pr.id&&(Gr(),Mr(ga))},Ur=this.on(u$2.MAGIC_HANDLE_RESPONSE,jr(()=>Ur()))}))})}on($r,pr){let Mr=pr.bind(window),Nr=Dr=>{Dr.data.msgType===`${$r}-${this.parameters}`&&Mr(Dr)};return this.messageHandlers.add(Nr),()=>this.messageHandlers.delete(Nr)}waitForReady(){return new Promise($r=>{let pr=this.on(u$2.MAGIC_OVERLAY_READY,()=>{this.isReadyForRequest=!0,$r(),pr()})})}listen(){this.on(u$2.MAGIC_HIDE_OVERLAY,()=>{this.hideOverlay()}),this.on(u$2.MAGIC_SHOW_OVERLAY,()=>{this.showOverlay()})}},Zr=Object.create,Je=Object.defineProperty,qr=Object.getOwnPropertyDescriptor,kr=Object.getOwnPropertyNames,et=Object.getPrototypeOf,rt=Object.prototype.hasOwnProperty,ve=($r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy($r,{get:(pr,Mr)=>(typeof require<"u"?require:pr)[Mr]}):$r)(function($r){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+$r+'" is not supported')}),$e=($r,pr)=>()=>(pr||$r((pr={exports:{}}).exports,pr),pr.exports),tt=($r,pr,Mr,Nr)=>{if(pr&&typeof pr=="object"||typeof pr=="function")for(let Dr of kr(pr))!rt.call($r,Dr)&&Dr!==Mr&&Je($r,Dr,{get:()=>pr[Dr],enumerable:!(Nr=qr(pr,Dr))||Nr.enumerable});return $r},Ze=($r,pr,Mr)=>(Mr=$r!=null?Zr(et($r)):{},tt(pr||!$r||!$r.__esModule?Je(Mr,"default",{value:$r,enumerable:!0}):Mr,$r)),se=($r,pr,Mr)=>new Promise((Nr,Dr)=>{var Br=Ur=>{try{jr(Mr.next(Ur))}catch(Gr){Dr(Gr)}},Lr=Ur=>{try{jr(Mr.throw(Ur))}catch(Gr){Dr(Gr)}},jr=Ur=>Ur.done?Nr(Ur.value):Promise.resolve(Ur.value).then(Br,Lr);jr((Mr=Mr.apply($r,pr)).next())}),ke=$e(($r,pr)=>{(function(Mr){if(typeof $r=="object"&&typeof pr<"u")pr.exports=Mr();else if(typeof define=="function"&&define.amd)define([],Mr);else{var Nr;typeof window<"u"?Nr=window:typeof global$1<"u"?Nr=global$1:typeof self<"u"?Nr=self:Nr=this,Nr.localforage=Mr()}})(function(){return function Mr(Nr,Dr,Br){function Lr(Gr,Yr){if(!Dr[Gr]){if(!Nr[Gr]){var Qr=typeof ve=="function"&&ve;if(!Yr&&Qr)return Qr(Gr,!0);if(jr)return jr(Gr,!0);var Wn=new Error("Cannot find module '"+Gr+"'");throw Wn.code="MODULE_NOT_FOUND",Wn}var ga=Dr[Gr]={exports:{}};Nr[Gr][0].call(ga.exports,function(eo){var _i=Nr[Gr][1][eo];return Lr(_i||eo)},ga,ga.exports,Mr,Nr,Dr,Br)}return Dr[Gr].exports}for(var jr=typeof ve=="function"&&ve,Ur=0;Ur<Br.length;Ur++)Lr(Br[Ur]);return Lr}({1:[function(Mr,Nr,Dr){(function(Br){var Lr=Br.MutationObserver||Br.WebKitMutationObserver,jr;if(Lr){var Ur=0,Gr=new Lr(eo),Yr=Br.document.createTextNode("");Gr.observe(Yr,{characterData:!0}),jr=function(){Yr.data=Ur=++Ur%2}}else if(!Br.setImmediate&&typeof Br.MessageChannel<"u"){var Qr=new Br.MessageChannel;Qr.port1.onmessage=eo,jr=function(){Qr.port2.postMessage(0)}}else"document"in Br&&"onreadystatechange"in Br.document.createElement("script")?jr=function(){var va=Br.document.createElement("script");va.onreadystatechange=function(){eo(),va.onreadystatechange=null,va.parentNode.removeChild(va),va=null},Br.document.documentElement.appendChild(va)}:jr=function(){setTimeout(eo,0)};var Wn,ga=[];function eo(){Wn=!0;for(var va,io,no=ga.length;no;){for(io=ga,ga=[],va=-1;++va<no;)io[va]();no=ga.length}Wn=!1}Nr.exports=_i;function _i(va){ga.push(va)===1&&!Wn&&jr()}}).call(this,typeof global$1<"u"?global$1:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(Mr,Nr,Dr){var Br=Mr(1);function Lr(){}var jr={},Ur=["REJECTED"],Gr=["FULFILLED"],Yr=["PENDING"];Nr.exports=Qr;function Qr(fo){if(typeof fo!="function")throw new TypeError("resolver must be a function");this.state=Yr,this.queue=[],this.outcome=void 0,fo!==Lr&&_i(this,fo)}Qr.prototype.catch=function(fo){return this.then(null,fo)},Qr.prototype.then=function(fo,lo){if(typeof fo!="function"&&this.state===Gr||typeof lo!="function"&&this.state===Ur)return this;var oo=new this.constructor(Lr);if(this.state!==Yr){var po=this.state===Gr?fo:lo;ga(oo,po,this.outcome)}else this.queue.push(new Wn(oo,fo,lo));return oo};function Wn(fo,lo,oo){this.promise=fo,typeof lo=="function"&&(this.onFulfilled=lo,this.callFulfilled=this.otherCallFulfilled),typeof oo=="function"&&(this.onRejected=oo,this.callRejected=this.otherCallRejected)}Wn.prototype.callFulfilled=function(fo){jr.resolve(this.promise,fo)},Wn.prototype.otherCallFulfilled=function(fo){ga(this.promise,this.onFulfilled,fo)},Wn.prototype.callRejected=function(fo){jr.reject(this.promise,fo)},Wn.prototype.otherCallRejected=function(fo){ga(this.promise,this.onRejected,fo)};function ga(fo,lo,oo){Br(function(){var po;try{po=lo(oo)}catch(mo){return jr.reject(fo,mo)}po===fo?jr.reject(fo,new TypeError("Cannot resolve promise with itself")):jr.resolve(fo,po)})}jr.resolve=function(fo,lo){var oo=va(eo,lo);if(oo.status==="error")return jr.reject(fo,oo.value);var po=oo.value;if(po)_i(fo,po);else{fo.state=Gr,fo.outcome=lo;for(var mo=-1,$o=fo.queue.length;++mo<$o;)fo.queue[mo].callFulfilled(lo)}return fo},jr.reject=function(fo,lo){fo.state=Ur,fo.outcome=lo;for(var oo=-1,po=fo.queue.length;++oo<po;)fo.queue[oo].callRejected(lo);return fo};function eo(fo){var lo=fo&&fo.then;if(fo&&(typeof fo=="object"||typeof fo=="function")&&typeof lo=="function")return function(){lo.apply(fo,arguments)}}function _i(fo,lo){var oo=!1;function po(Fr){oo||(oo=!0,jr.reject(fo,Fr))}function mo(Fr){oo||(oo=!0,jr.resolve(fo,Fr))}function $o(){lo(mo,po)}var Xn=va($o);Xn.status==="error"&&po(Xn.value)}function va(fo,lo){var oo={};try{oo.value=fo(lo),oo.status="success"}catch(po){oo.status="error",oo.value=po}return oo}Qr.resolve=io;function io(fo){return fo instanceof this?fo:jr.resolve(new this(Lr),fo)}Qr.reject=no;function no(fo){var lo=new this(Lr);return jr.reject(lo,fo)}Qr.all=so;function so(fo){var lo=this;if(Object.prototype.toString.call(fo)!=="[object Array]")return this.reject(new TypeError("must be an array"));var oo=fo.length,po=!1;if(!oo)return this.resolve([]);for(var mo=new Array(oo),$o=0,Xn=-1,Fr=new this(Lr);++Xn<oo;)Vr(fo[Xn],Xn);return Fr;function Vr(Wr,Jr){lo.resolve(Wr).then(Gn,function(to){po||(po=!0,jr.reject(Fr,to))});function Gn(to){mo[Jr]=to,++$o===oo&&!po&&(po=!0,jr.resolve(Fr,mo))}}}Qr.race=ao;function ao(fo){var lo=this;if(Object.prototype.toString.call(fo)!=="[object Array]")return this.reject(new TypeError("must be an array"));var oo=fo.length,po=!1;if(!oo)return this.resolve([]);for(var mo=-1,$o=new this(Lr);++mo<oo;)Xn(fo[mo]);return $o;function Xn(Fr){lo.resolve(Fr).then(function(Vr){po||(po=!0,jr.resolve($o,Vr))},function(Vr){po||(po=!0,jr.reject($o,Vr))})}}},{1:1}],3:[function(Mr,Nr,Dr){(function(Br){typeof Br.Promise!="function"&&(Br.Promise=Mr(2))}).call(this,typeof global$1<"u"?global$1:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(Mr,Nr,Dr){var Br=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Ko){return typeof Ko}:function(Ko){return Ko&&typeof Symbol=="function"&&Ko.constructor===Symbol&&Ko!==Symbol.prototype?"symbol":typeof Ko};function Lr(Ko,lu){if(!(Ko instanceof lu))throw new TypeError("Cannot call a class as a function")}function jr(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var Ur=jr();function Gr(){try{if(!Ur||!Ur.open)return!1;var Ko=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),lu=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!Ko||lu)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function Yr(Ko,lu){Ko=Ko||[],lu=lu||{};try{return new Blob(Ko,lu)}catch($u){if($u.name!=="TypeError")throw $u;for(var Wo=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,gu=new Wo,fu=0;fu<Ko.length;fu+=1)gu.append(Ko[fu]);return gu.getBlob(lu.type)}}typeof Promise>"u"&&Mr(3);var Qr=Promise;function Wn(Ko,lu){lu&&Ko.then(function(Wo){lu(null,Wo)},function(Wo){lu(Wo)})}function ga(Ko,lu,Wo){typeof lu=="function"&&Ko.then(lu),typeof Wo=="function"&&Ko.catch(Wo)}function eo(Ko){return typeof Ko!="string"&&(console.warn(Ko+" used as a key, but it is not a string."),Ko=String(Ko)),Ko}function _i(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var va="local-forage-detect-blob-support",io=void 0,no={},so=Object.prototype.toString,ao="readonly",fo="readwrite";function lo(Ko){for(var lu=Ko.length,Wo=new ArrayBuffer(lu),gu=new Uint8Array(Wo),fu=0;fu<lu;fu++)gu[fu]=Ko.charCodeAt(fu);return Wo}function oo(Ko){return new Qr(function(lu){var Wo=Ko.transaction(va,fo),gu=Yr([""]);Wo.objectStore(va).put(gu,"key"),Wo.onabort=function(fu){fu.preventDefault(),fu.stopPropagation(),lu(!1)},Wo.oncomplete=function(){var fu=navigator.userAgent.match(/Chrome\/(\d+)/),$u=navigator.userAgent.match(/Edge\//);lu($u||!fu||parseInt(fu[1],10)>=43)}}).catch(function(){return!1})}function po(Ko){return typeof io=="boolean"?Qr.resolve(io):oo(Ko).then(function(lu){return io=lu,io})}function mo(Ko){var lu=no[Ko.name],Wo={};Wo.promise=new Qr(function(gu,fu){Wo.resolve=gu,Wo.reject=fu}),lu.deferredOperations.push(Wo),lu.dbReady?lu.dbReady=lu.dbReady.then(function(){return Wo.promise}):lu.dbReady=Wo.promise}function $o(Ko){var lu=no[Ko.name],Wo=lu.deferredOperations.pop();if(Wo)return Wo.resolve(),Wo.promise}function Xn(Ko,lu){var Wo=no[Ko.name],gu=Wo.deferredOperations.pop();if(gu)return gu.reject(lu),gu.promise}function Fr(Ko,lu){return new Qr(function(Wo,gu){if(no[Ko.name]=no[Ko.name]||co(),Ko.db)if(lu)mo(Ko),Ko.db.close();else return Wo(Ko.db);var fu=[Ko.name];lu&&fu.push(Ko.version);var $u=Ur.open.apply(Ur,fu);lu&&($u.onupgradeneeded=function(Xu){var dl=$u.result;try{dl.createObjectStore(Ko.storeName),Xu.oldVersion<=1&&dl.createObjectStore(va)}catch(Qu){if(Qu.name==="ConstraintError")console.warn('The database "'+Ko.name+'" has been upgraded from version '+Xu.oldVersion+" to version "+Xu.newVersion+', but the storage "'+Ko.storeName+'" already exists.');else throw Qu}}),$u.onerror=function(Xu){Xu.preventDefault(),gu($u.error)},$u.onsuccess=function(){var Xu=$u.result;Xu.onversionchange=function(dl){dl.target.close()},Wo(Xu),$o(Ko)}})}function Vr(Ko){return Fr(Ko,!1)}function Wr(Ko){return Fr(Ko,!0)}function Jr(Ko,lu){if(!Ko.db)return!0;var Wo=!Ko.db.objectStoreNames.contains(Ko.storeName),gu=Ko.version<Ko.db.version,fu=Ko.version>Ko.db.version;if(gu&&(Ko.version!==lu&&console.warn('The database "'+Ko.name+`" can't be downgraded from version `+Ko.db.version+" to version "+Ko.version+"."),Ko.version=Ko.db.version),fu||Wo){if(Wo){var $u=Ko.db.version+1;$u>Ko.version&&(Ko.version=$u)}return!0}return!1}function Gn(Ko){return new Qr(function(lu,Wo){var gu=new FileReader;gu.onerror=Wo,gu.onloadend=function(fu){var $u=btoa(fu.target.result||"");lu({__local_forage_encoded_blob:!0,data:$u,type:Ko.type})},gu.readAsBinaryString(Ko)})}function to(Ko){var lu=lo(atob(Ko.data));return Yr([lu],{type:Ko.type})}function ro(Ko){return Ko&&Ko.__local_forage_encoded_blob}function Un(Ko){var lu=this,Wo=lu._initReady().then(function(){var gu=no[lu._dbInfo.name];if(gu&&gu.dbReady)return gu.dbReady});return ga(Wo,Ko,Ko),Wo}function Hr(Ko){mo(Ko);for(var lu=no[Ko.name],Wo=lu.forages,gu=0;gu<Wo.length;gu++){var fu=Wo[gu];fu._dbInfo.db&&(fu._dbInfo.db.close(),fu._dbInfo.db=null)}return Ko.db=null,Vr(Ko).then(function($u){return Ko.db=$u,Jr(Ko)?Wr(Ko):$u}).then(function($u){Ko.db=lu.db=$u;for(var Xu=0;Xu<Wo.length;Xu++)Wo[Xu]._dbInfo.db=$u}).catch(function($u){throw Xn(Ko,$u),$u})}function Xr(Ko,lu,Wo,gu){gu===void 0&&(gu=1);try{var fu=Ko.db.transaction(Ko.storeName,lu);Wo(null,fu)}catch($u){if(gu>0&&(!Ko.db||$u.name==="InvalidStateError"||$u.name==="NotFoundError"))return Qr.resolve().then(function(){if(!Ko.db||$u.name==="NotFoundError"&&!Ko.db.objectStoreNames.contains(Ko.storeName)&&Ko.version<=Ko.db.version)return Ko.db&&(Ko.version=Ko.db.version+1),Wr(Ko)}).then(function(){return Hr(Ko).then(function(){Xr(Ko,lu,Wo,gu-1)})}).catch(Wo);Wo($u)}}function co(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function ho(Ko){var lu=this,Wo={db:null};if(Ko)for(var gu in Ko)Wo[gu]=Ko[gu];var fu=no[Wo.name];fu||(fu=co(),no[Wo.name]=fu),fu.forages.push(lu),lu._initReady||(lu._initReady=lu.ready,lu.ready=Un);var $u=[];function Xu(){return Qr.resolve()}for(var dl=0;dl<fu.forages.length;dl++){var Qu=fu.forages[dl];Qu!==lu&&$u.push(Qu._initReady().catch(Xu))}var Wu=fu.forages.slice(0);return Qr.all($u).then(function(){return Wo.db=fu.db,Vr(Wo)}).then(function(ml){return Wo.db=ml,Jr(Wo,lu._defaultConfig.version)?Wr(Wo):ml}).then(function(ml){Wo.db=fu.db=ml,lu._dbInfo=Wo;for(var Cl=0;Cl<Wu.length;Cl++){var rp=Wu[Cl];rp!==lu&&(rp._dbInfo.db=Wo.db,rp._dbInfo.version=Wo.version)}})}function go(Ko,lu){var Wo=this;Ko=eo(Ko);var gu=new Qr(function(fu,$u){Wo.ready().then(function(){Xr(Wo._dbInfo,ao,function(Xu,dl){if(Xu)return $u(Xu);try{var Qu=dl.objectStore(Wo._dbInfo.storeName),Wu=Qu.get(Ko);Wu.onsuccess=function(){var ml=Wu.result;ml===void 0&&(ml=null),ro(ml)&&(ml=to(ml)),fu(ml)},Wu.onerror=function(){$u(Wu.error)}}catch(ml){$u(ml)}})}).catch($u)});return Wn(gu,lu),gu}function bo(Ko,lu){var Wo=this,gu=new Qr(function(fu,$u){Wo.ready().then(function(){Xr(Wo._dbInfo,ao,function(Xu,dl){if(Xu)return $u(Xu);try{var Qu=dl.objectStore(Wo._dbInfo.storeName),Wu=Qu.openCursor(),ml=1;Wu.onsuccess=function(){var Cl=Wu.result;if(Cl){var rp=Cl.value;ro(rp)&&(rp=to(rp));var dp=Ko(rp,Cl.key,ml++);dp!==void 0?fu(dp):Cl.continue()}else fu()},Wu.onerror=function(){$u(Wu.error)}}catch(Cl){$u(Cl)}})}).catch($u)});return Wn(gu,lu),gu}function Eo(Ko,lu,Wo){var gu=this;Ko=eo(Ko);var fu=new Qr(function($u,Xu){var dl;gu.ready().then(function(){return dl=gu._dbInfo,so.call(lu)==="[object Blob]"?po(dl.db).then(function(Qu){return Qu?lu:Gn(lu)}):lu}).then(function(Qu){Xr(gu._dbInfo,fo,function(Wu,ml){if(Wu)return Xu(Wu);try{var Cl=ml.objectStore(gu._dbInfo.storeName);Qu===null&&(Qu=void 0);var rp=Cl.put(Qu,Ko);ml.oncomplete=function(){Qu===void 0&&(Qu=null),$u(Qu)},ml.onabort=ml.onerror=function(){var dp=rp.error?rp.error:rp.transaction.error;Xu(dp)}}catch(dp){Xu(dp)}})}).catch(Xu)});return Wn(fu,Wo),fu}function wo(Ko,lu){var Wo=this;Ko=eo(Ko);var gu=new Qr(function(fu,$u){Wo.ready().then(function(){Xr(Wo._dbInfo,fo,function(Xu,dl){if(Xu)return $u(Xu);try{var Qu=dl.objectStore(Wo._dbInfo.storeName),Wu=Qu.delete(Ko);dl.oncomplete=function(){fu()},dl.onerror=function(){$u(Wu.error)},dl.onabort=function(){var ml=Wu.error?Wu.error:Wu.transaction.error;$u(ml)}}catch(ml){$u(ml)}})}).catch($u)});return Wn(gu,lu),gu}function Io(Ko){var lu=this,Wo=new Qr(function(gu,fu){lu.ready().then(function(){Xr(lu._dbInfo,fo,function($u,Xu){if($u)return fu($u);try{var dl=Xu.objectStore(lu._dbInfo.storeName),Qu=dl.clear();Xu.oncomplete=function(){gu()},Xu.onabort=Xu.onerror=function(){var Wu=Qu.error?Qu.error:Qu.transaction.error;fu(Wu)}}catch(Wu){fu(Wu)}})}).catch(fu)});return Wn(Wo,Ko),Wo}function Po(Ko){var lu=this,Wo=new Qr(function(gu,fu){lu.ready().then(function(){Xr(lu._dbInfo,ao,function($u,Xu){if($u)return fu($u);try{var dl=Xu.objectStore(lu._dbInfo.storeName),Qu=dl.count();Qu.onsuccess=function(){gu(Qu.result)},Qu.onerror=function(){fu(Qu.error)}}catch(Wu){fu(Wu)}})}).catch(fu)});return Wn(Wo,Ko),Wo}function yo(Ko,lu){var Wo=this,gu=new Qr(function(fu,$u){if(Ko<0){fu(null);return}Wo.ready().then(function(){Xr(Wo._dbInfo,ao,function(Xu,dl){if(Xu)return $u(Xu);try{var Qu=dl.objectStore(Wo._dbInfo.storeName),Wu=!1,ml=Qu.openKeyCursor();ml.onsuccess=function(){var Cl=ml.result;if(!Cl){fu(null);return}Ko===0||Wu?fu(Cl.key):(Wu=!0,Cl.advance(Ko))},ml.onerror=function(){$u(ml.error)}}catch(Cl){$u(Cl)}})}).catch($u)});return Wn(gu,lu),gu}function xo(Ko){var lu=this,Wo=new Qr(function(gu,fu){lu.ready().then(function(){Xr(lu._dbInfo,ao,function($u,Xu){if($u)return fu($u);try{var dl=Xu.objectStore(lu._dbInfo.storeName),Qu=dl.openKeyCursor(),Wu=[];Qu.onsuccess=function(){var ml=Qu.result;if(!ml){gu(Wu);return}Wu.push(ml.key),ml.continue()},Qu.onerror=function(){fu(Qu.error)}}catch(ml){fu(ml)}})}).catch(fu)});return Wn(Wo,Ko),Wo}function Mo(Ko,lu){lu=_i.apply(this,arguments);var Wo=this.config();Ko=typeof Ko!="function"&&Ko||{},Ko.name||(Ko.name=Ko.name||Wo.name,Ko.storeName=Ko.storeName||Wo.storeName);var gu=this,fu;if(!Ko.name)fu=Qr.reject("Invalid arguments");else{var $u=Ko.name===Wo.name&&gu._dbInfo.db,Xu=$u?Qr.resolve(gu._dbInfo.db):Vr(Ko).then(function(dl){var Qu=no[Ko.name],Wu=Qu.forages;Qu.db=dl;for(var ml=0;ml<Wu.length;ml++)Wu[ml]._dbInfo.db=dl;return dl});Ko.storeName?fu=Xu.then(function(dl){if(dl.objectStoreNames.contains(Ko.storeName)){var Qu=dl.version+1;mo(Ko);var Wu=no[Ko.name],ml=Wu.forages;dl.close();for(var Cl=0;Cl<ml.length;Cl++){var rp=ml[Cl];rp._dbInfo.db=null,rp._dbInfo.version=Qu}var dp=new Qr(function(up,Ep){var cp=Ur.open(Ko.name,Qu);cp.onerror=function(So){var Co=cp.result;Co.close(),Ep(So)},cp.onupgradeneeded=function(){var So=cp.result;So.deleteObjectStore(Ko.storeName)},cp.onsuccess=function(){var So=cp.result;So.close(),up(So)}});return dp.then(function(up){Wu.db=up;for(var Ep=0;Ep<ml.length;Ep++){var cp=ml[Ep];cp._dbInfo.db=up,$o(cp._dbInfo)}}).catch(function(up){throw(Xn(Ko,up)||Qr.resolve()).catch(function(){}),up})}}):fu=Xu.then(function(dl){mo(Ko);var Qu=no[Ko.name],Wu=Qu.forages;dl.close();for(var ml=0;ml<Wu.length;ml++){var Cl=Wu[ml];Cl._dbInfo.db=null}var rp=new Qr(function(dp,up){var Ep=Ur.deleteDatabase(Ko.name);Ep.onerror=function(){var cp=Ep.result;cp&&cp.close(),up(Ep.error)},Ep.onblocked=function(){console.warn('dropInstance blocked for database "'+Ko.name+'" until all open connections are closed')},Ep.onsuccess=function(){var cp=Ep.result;cp&&cp.close(),dp(cp)}});return rp.then(function(dp){Qu.db=dp;for(var up=0;up<Wu.length;up++){var Ep=Wu[up];$o(Ep._dbInfo)}}).catch(function(dp){throw(Xn(Ko,dp)||Qr.resolve()).catch(function(){}),dp})})}return Wn(fu,lu),fu}var qo={_driver:"asyncStorage",_initStorage:ho,_support:Gr(),iterate:bo,getItem:go,setItem:Eo,removeItem:wo,clear:Io,length:Po,key:yo,keys:xo,dropInstance:Mo};function pu(){return typeof openDatabase=="function"}var nu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",eu="~~local_forage_type~",Uu=/^~~local_forage_type~([^~]+)~/,mu="__lfsc__:",Jo=mu.length,Zu="arbf",su="blob",Ru="si08",tl="ui08",Pu="uic8",Tu="si16",ll="si32",Su="ur16",Ou="ui32",fl="fl32",To="fl64",_o=Jo+Zu.length,Ro=Object.prototype.toString;function No(Ko){var lu=Ko.length*.75,Wo=Ko.length,gu,fu=0,$u,Xu,dl,Qu;Ko[Ko.length-1]==="="&&(lu--,Ko[Ko.length-2]==="="&&lu--);var Wu=new ArrayBuffer(lu),ml=new Uint8Array(Wu);for(gu=0;gu<Wo;gu+=4)$u=nu.indexOf(Ko[gu]),Xu=nu.indexOf(Ko[gu+1]),dl=nu.indexOf(Ko[gu+2]),Qu=nu.indexOf(Ko[gu+3]),ml[fu++]=$u<<2|Xu>>4,ml[fu++]=(Xu&15)<<4|dl>>2,ml[fu++]=(dl&3)<<6|Qu&63;return Wu}function Uo(Ko){var lu=new Uint8Array(Ko),Wo="",gu;for(gu=0;gu<lu.length;gu+=3)Wo+=nu[lu[gu]>>2],Wo+=nu[(lu[gu]&3)<<4|lu[gu+1]>>4],Wo+=nu[(lu[gu+1]&15)<<2|lu[gu+2]>>6],Wo+=nu[lu[gu+2]&63];return lu.length%3===2?Wo=Wo.substring(0,Wo.length-1)+"=":lu.length%3===1&&(Wo=Wo.substring(0,Wo.length-2)+"=="),Wo}function wu(Ko,lu){var Wo="";if(Ko&&(Wo=Ro.call(Ko)),Ko&&(Wo==="[object ArrayBuffer]"||Ko.buffer&&Ro.call(Ko.buffer)==="[object ArrayBuffer]")){var gu,fu=mu;Ko instanceof ArrayBuffer?(gu=Ko,fu+=Zu):(gu=Ko.buffer,Wo==="[object Int8Array]"?fu+=Ru:Wo==="[object Uint8Array]"?fu+=tl:Wo==="[object Uint8ClampedArray]"?fu+=Pu:Wo==="[object Int16Array]"?fu+=Tu:Wo==="[object Uint16Array]"?fu+=Su:Wo==="[object Int32Array]"?fu+=ll:Wo==="[object Uint32Array]"?fu+=Ou:Wo==="[object Float32Array]"?fu+=fl:Wo==="[object Float64Array]"?fu+=To:lu(new Error("Failed to get type for BinaryArray"))),lu(fu+Uo(gu))}else if(Wo==="[object Blob]"){var $u=new FileReader;$u.onload=function(){var Xu=eu+Ko.type+"~"+Uo(this.result);lu(mu+su+Xu)},$u.readAsArrayBuffer(Ko)}else try{lu(JSON.stringify(Ko))}catch(Xu){console.error("Couldn't convert value into a JSON string: ",Ko),lu(null,Xu)}}function au(Ko){if(Ko.substring(0,Jo)!==mu)return JSON.parse(Ko);var lu=Ko.substring(_o),Wo=Ko.substring(Jo,_o),gu;if(Wo===su&&Uu.test(lu)){var fu=lu.match(Uu);gu=fu[1],lu=lu.substring(fu[0].length)}var $u=No(lu);switch(Wo){case Zu:return $u;case su:return Yr([$u],{type:gu});case Ru:return new Int8Array($u);case tl:return new Uint8Array($u);case Pu:return new Uint8ClampedArray($u);case Tu:return new Int16Array($u);case Su:return new Uint16Array($u);case ll:return new Int32Array($u);case Ou:return new Uint32Array($u);case fl:return new Float32Array($u);case To:return new Float64Array($u);default:throw new Error("Unkown type: "+Wo)}}var Nu={serialize:wu,deserialize:au,stringToBuffer:No,bufferToString:Uo};function _l(Ko,lu,Wo,gu){Ko.executeSql("CREATE TABLE IF NOT EXISTS "+lu.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],Wo,gu)}function Du(Ko){var lu=this,Wo={db:null};if(Ko)for(var gu in Ko)Wo[gu]=typeof Ko[gu]!="string"?Ko[gu].toString():Ko[gu];var fu=new Qr(function($u,Xu){try{Wo.db=openDatabase(Wo.name,String(Wo.version),Wo.description,Wo.size)}catch(dl){return Xu(dl)}Wo.db.transaction(function(dl){_l(dl,Wo,function(){lu._dbInfo=Wo,$u()},function(Qu,Wu){Xu(Wu)})},Xu)});return Wo.serializer=Nu,fu}function Fu(Ko,lu,Wo,gu,fu,$u){Ko.executeSql(Wo,gu,fu,function(Xu,dl){dl.code===dl.SYNTAX_ERR?Xu.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[lu.storeName],function(Qu,Wu){Wu.rows.length?$u(Qu,dl):_l(Qu,lu,function(){Qu.executeSql(Wo,gu,fu,$u)},$u)},$u):$u(Xu,dl)},$u)}function vl(Ko,lu){var Wo=this;Ko=eo(Ko);var gu=new Qr(function(fu,$u){Wo.ready().then(function(){var Xu=Wo._dbInfo;Xu.db.transaction(function(dl){Fu(dl,Xu,"SELECT * FROM "+Xu.storeName+" WHERE key = ? LIMIT 1",[Ko],function(Qu,Wu){var ml=Wu.rows.length?Wu.rows.item(0).value:null;ml&&(ml=Xu.serializer.deserialize(ml)),fu(ml)},function(Qu,Wu){$u(Wu)})})}).catch($u)});return Wn(gu,lu),gu}function Lu(Ko,lu){var Wo=this,gu=new Qr(function(fu,$u){Wo.ready().then(function(){var Xu=Wo._dbInfo;Xu.db.transaction(function(dl){Fu(dl,Xu,"SELECT * FROM "+Xu.storeName,[],function(Qu,Wu){for(var ml=Wu.rows,Cl=ml.length,rp=0;rp<Cl;rp++){var dp=ml.item(rp),up=dp.value;if(up&&(up=Xu.serializer.deserialize(up)),up=Ko(up,dp.key,rp+1),up!==void 0){fu(up);return}}fu()},function(Qu,Wu){$u(Wu)})})}).catch($u)});return Wn(gu,lu),gu}function Ku(Ko,lu,Wo,gu){var fu=this;Ko=eo(Ko);var $u=new Qr(function(Xu,dl){fu.ready().then(function(){lu===void 0&&(lu=null);var Qu=lu,Wu=fu._dbInfo;Wu.serializer.serialize(lu,function(ml,Cl){Cl?dl(Cl):Wu.db.transaction(function(rp){Fu(rp,Wu,"INSERT OR REPLACE INTO "+Wu.storeName+" (key, value) VALUES (?, ?)",[Ko,ml],function(){Xu(Qu)},function(dp,up){dl(up)})},function(rp){if(rp.code===rp.QUOTA_ERR){if(gu>0){Xu(Ku.apply(fu,[Ko,Qu,Wo,gu-1]));return}dl(rp)}})})}).catch(dl)});return Wn($u,Wo),$u}function bl(Ko,lu,Wo){return Ku.apply(this,[Ko,lu,Wo,1])}function jo(Ko,lu){var Wo=this;Ko=eo(Ko);var gu=new Qr(function(fu,$u){Wo.ready().then(function(){var Xu=Wo._dbInfo;Xu.db.transaction(function(dl){Fu(dl,Xu,"DELETE FROM "+Xu.storeName+" WHERE key = ?",[Ko],function(){fu()},function(Qu,Wu){$u(Wu)})})}).catch($u)});return Wn(gu,lu),gu}function ko(Ko){var lu=this,Wo=new Qr(function(gu,fu){lu.ready().then(function(){var $u=lu._dbInfo;$u.db.transaction(function(Xu){Fu(Xu,$u,"DELETE FROM "+$u.storeName,[],function(){gu()},function(dl,Qu){fu(Qu)})})}).catch(fu)});return Wn(Wo,Ko),Wo}function iu(Ko){var lu=this,Wo=new Qr(function(gu,fu){lu.ready().then(function(){var $u=lu._dbInfo;$u.db.transaction(function(Xu){Fu(Xu,$u,"SELECT COUNT(key) as c FROM "+$u.storeName,[],function(dl,Qu){var Wu=Qu.rows.item(0).c;gu(Wu)},function(dl,Qu){fu(Qu)})})}).catch(fu)});return Wn(Wo,Ko),Wo}function Ho(Ko,lu){var Wo=this,gu=new Qr(function(fu,$u){Wo.ready().then(function(){var Xu=Wo._dbInfo;Xu.db.transaction(function(dl){Fu(dl,Xu,"SELECT key FROM "+Xu.storeName+" WHERE id = ? LIMIT 1",[Ko+1],function(Qu,Wu){var ml=Wu.rows.length?Wu.rows.item(0).key:null;fu(ml)},function(Qu,Wu){$u(Wu)})})}).catch($u)});return Wn(gu,lu),gu}function ou(Ko){var lu=this,Wo=new Qr(function(gu,fu){lu.ready().then(function(){var $u=lu._dbInfo;$u.db.transaction(function(Xu){Fu(Xu,$u,"SELECT key FROM "+$u.storeName,[],function(dl,Qu){for(var Wu=[],ml=0;ml<Qu.rows.length;ml++)Wu.push(Qu.rows.item(ml).key);gu(Wu)},function(dl,Qu){fu(Qu)})})}).catch(fu)});return Wn(Wo,Ko),Wo}function qu(Ko){return new Qr(function(lu,Wo){Ko.transaction(function(gu){gu.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(fu,$u){for(var Xu=[],dl=0;dl<$u.rows.length;dl++)Xu.push($u.rows.item(dl).name);lu({db:Ko,storeNames:Xu})},function(fu,$u){Wo($u)})},function(gu){Wo(gu)})})}function du(Ko,lu){lu=_i.apply(this,arguments);var Wo=this.config();Ko=typeof Ko!="function"&&Ko||{},Ko.name||(Ko.name=Ko.name||Wo.name,Ko.storeName=Ko.storeName||Wo.storeName);var gu=this,fu;return Ko.name?fu=new Qr(function($u){var Xu;Ko.name===Wo.name?Xu=gu._dbInfo.db:Xu=openDatabase(Ko.name,"","",0),Ko.storeName?$u({db:Xu,storeNames:[Ko.storeName]}):$u(qu(Xu))}).then(function($u){return new Qr(function(Xu,dl){$u.db.transaction(function(Qu){function Wu(dp){return new Qr(function(up,Ep){Qu.executeSql("DROP TABLE IF EXISTS "+dp,[],function(){up()},function(cp,So){Ep(So)})})}for(var ml=[],Cl=0,rp=$u.storeNames.length;Cl<rp;Cl++)ml.push(Wu($u.storeNames[Cl]));Qr.all(ml).then(function(){Xu()}).catch(function(dp){dl(dp)})},function(Qu){dl(Qu)})})}):fu=Qr.reject("Invalid arguments"),Wn(fu,lu),fu}var _u={_driver:"webSQLStorage",_initStorage:Du,_support:pu(),iterate:Lu,getItem:vl,setItem:bl,removeItem:jo,clear:ko,length:iu,key:Ho,keys:ou,dropInstance:du};function al(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function Bo(Ko,lu){var Wo=Ko.name+"/";return Ko.storeName!==lu.storeName&&(Wo+=Ko.storeName+"/"),Wo}function Do(){var Ko="_localforage_support_test";try{return localStorage.setItem(Ko,!0),localStorage.removeItem(Ko),!1}catch{return!0}}function ru(){return!Do()||localStorage.length>0}function Go(Ko){var lu=this,Wo={};if(Ko)for(var gu in Ko)Wo[gu]=Ko[gu];return Wo.keyPrefix=Bo(Ko,lu._defaultConfig),ru()?(lu._dbInfo=Wo,Wo.serializer=Nu,Qr.resolve()):Qr.reject()}function Qo(Ko){var lu=this,Wo=lu.ready().then(function(){for(var gu=lu._dbInfo.keyPrefix,fu=localStorage.length-1;fu>=0;fu--){var $u=localStorage.key(fu);$u.indexOf(gu)===0&&localStorage.removeItem($u)}});return Wn(Wo,Ko),Wo}function nl(Ko,lu){var Wo=this;Ko=eo(Ko);var gu=Wo.ready().then(function(){var fu=Wo._dbInfo,$u=localStorage.getItem(fu.keyPrefix+Ko);return $u&&($u=fu.serializer.deserialize($u)),$u});return Wn(gu,lu),gu}function Au(Ko,lu){var Wo=this,gu=Wo.ready().then(function(){for(var fu=Wo._dbInfo,$u=fu.keyPrefix,Xu=$u.length,dl=localStorage.length,Qu=1,Wu=0;Wu<dl;Wu++){var ml=localStorage.key(Wu);if(ml.indexOf($u)===0){var Cl=localStorage.getItem(ml);if(Cl&&(Cl=fu.serializer.deserialize(Cl)),Cl=Ko(Cl,ml.substring(Xu),Qu++),Cl!==void 0)return Cl}}});return Wn(gu,lu),gu}function Hu(Ko,lu){var Wo=this,gu=Wo.ready().then(function(){var fu=Wo._dbInfo,$u;try{$u=localStorage.key(Ko)}catch{$u=null}return $u&&($u=$u.substring(fu.keyPrefix.length)),$u});return Wn(gu,lu),gu}function yl(Ko){var lu=this,Wo=lu.ready().then(function(){for(var gu=lu._dbInfo,fu=localStorage.length,$u=[],Xu=0;Xu<fu;Xu++){var dl=localStorage.key(Xu);dl.indexOf(gu.keyPrefix)===0&&$u.push(dl.substring(gu.keyPrefix.length))}return $u});return Wn(Wo,Ko),Wo}function $l(Ko){var lu=this,Wo=lu.keys().then(function(gu){return gu.length});return Wn(Wo,Ko),Wo}function Al(Ko,lu){var Wo=this;Ko=eo(Ko);var gu=Wo.ready().then(function(){var fu=Wo._dbInfo;localStorage.removeItem(fu.keyPrefix+Ko)});return Wn(gu,lu),gu}function Rl(Ko,lu,Wo){var gu=this;Ko=eo(Ko);var fu=gu.ready().then(function(){lu===void 0&&(lu=null);var $u=lu;return new Qr(function(Xu,dl){var Qu=gu._dbInfo;Qu.serializer.serialize(lu,function(Wu,ml){if(ml)dl(ml);else try{localStorage.setItem(Qu.keyPrefix+Ko,Wu),Xu($u)}catch(Cl){(Cl.name==="QuotaExceededError"||Cl.name==="NS_ERROR_DOM_QUOTA_REACHED")&&dl(Cl),dl(Cl)}})})});return Wn(fu,Wo),fu}function Nl(Ko,lu){if(lu=_i.apply(this,arguments),Ko=typeof Ko!="function"&&Ko||{},!Ko.name){var Wo=this.config();Ko.name=Ko.name||Wo.name,Ko.storeName=Ko.storeName||Wo.storeName}var gu=this,fu;return Ko.name?fu=new Qr(function($u){Ko.storeName?$u(Bo(Ko,gu._defaultConfig)):$u(Ko.name+"/")}).then(function($u){for(var Xu=localStorage.length-1;Xu>=0;Xu--){var dl=localStorage.key(Xu);dl.indexOf($u)===0&&localStorage.removeItem(dl)}}):fu=Qr.reject("Invalid arguments"),Wn(fu,lu),fu}var El={_driver:"localStorageWrapper",_initStorage:Go,_support:al(),iterate:Au,getItem:nl,setItem:Rl,removeItem:Al,clear:Qo,length:$l,key:Hu,keys:yl,dropInstance:Nl},Ml=function(Ko,lu){return Ko===lu||typeof Ko=="number"&&typeof lu=="number"&&isNaN(Ko)&&isNaN(lu)},kl=function(Ko,lu){for(var Wo=Ko.length,gu=0;gu<Wo;){if(Ml(Ko[gu],lu))return!0;gu++}return!1},Ol=Array.isArray||function(Ko){return Object.prototype.toString.call(Ko)==="[object Array]"},Ul={},Zl={},Hl={INDEXEDDB:qo,WEBSQL:_u,LOCALSTORAGE:El},Xl=[Hl.INDEXEDDB._driver,Hl.WEBSQL._driver,Hl.LOCALSTORAGE._driver],_f=["dropInstance"],Gl=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(_f),jl={description:"",driver:Xl.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function tp(Ko,lu){Ko[lu]=function(){var Wo=arguments;return Ko.ready().then(function(){return Ko[lu].apply(Ko,Wo)})}}function _d(){for(var Ko=1;Ko<arguments.length;Ko++){var lu=arguments[Ko];if(lu)for(var Wo in lu)lu.hasOwnProperty(Wo)&&(Ol(lu[Wo])?arguments[0][Wo]=lu[Wo].slice():arguments[0][Wo]=lu[Wo])}return arguments[0]}var np=function(){function Ko(lu){Lr(this,Ko);for(var Wo in Hl)if(Hl.hasOwnProperty(Wo)){var gu=Hl[Wo],fu=gu._driver;this[Wo]=fu,Ul[fu]||this.defineDriver(gu)}this._defaultConfig=_d({},jl),this._config=_d({},this._defaultConfig,lu),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return Ko.prototype.config=function(lu){if((typeof lu>"u"?"undefined":Br(lu))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var Wo in lu){if(Wo==="storeName"&&(lu[Wo]=lu[Wo].replace(/\W/g,"_")),Wo==="version"&&typeof lu[Wo]!="number")return new Error("Database version must be a number.");this._config[Wo]=lu[Wo]}return"driver"in lu&&lu.driver?this.setDriver(this._config.driver):!0}else return typeof lu=="string"?this._config[lu]:this._config},Ko.prototype.defineDriver=function(lu,Wo,gu){var fu=new Qr(function($u,Xu){try{var dl=lu._driver,Qu=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!lu._driver){Xu(Qu);return}for(var Wu=Gl.concat("_initStorage"),ml=0,Cl=Wu.length;ml<Cl;ml++){var rp=Wu[ml],dp=!kl(_f,rp);if((dp||lu[rp])&&typeof lu[rp]!="function"){Xu(Qu);return}}var up=function(){for(var cp=function(cu){return function(){var bu=new Error("Method "+cu+" is not implemented by the current driver"),Iu=Qr.reject(bu);return Wn(Iu,arguments[arguments.length-1]),Iu}},So=0,Co=_f.length;So<Co;So++){var Fo=_f[So];lu[Fo]||(lu[Fo]=cp(Fo))}};up();var Ep=function(cp){Ul[dl]&&console.info("Redefining LocalForage driver: "+dl),Ul[dl]=lu,Zl[dl]=cp,$u()};"_support"in lu?lu._support&&typeof lu._support=="function"?lu._support().then(Ep,Xu):Ep(!!lu._support):Ep(!0)}catch(cp){Xu(cp)}});return ga(fu,Wo,gu),fu},Ko.prototype.driver=function(){return this._driver||null},Ko.prototype.getDriver=function(lu,Wo,gu){var fu=Ul[lu]?Qr.resolve(Ul[lu]):Qr.reject(new Error("Driver not found."));return ga(fu,Wo,gu),fu},Ko.prototype.getSerializer=function(lu){var Wo=Qr.resolve(Nu);return ga(Wo,lu),Wo},Ko.prototype.ready=function(lu){var Wo=this,gu=Wo._driverSet.then(function(){return Wo._ready===null&&(Wo._ready=Wo._initDriver()),Wo._ready});return ga(gu,lu,lu),gu},Ko.prototype.setDriver=function(lu,Wo,gu){var fu=this;Ol(lu)||(lu=[lu]);var $u=this._getSupportedDrivers(lu);function Xu(){fu._config.driver=fu.driver()}function dl(ml){return fu._extend(ml),Xu(),fu._ready=fu._initStorage(fu._config),fu._ready}function Qu(ml){return function(){var Cl=0;function rp(){for(;Cl<ml.length;){var dp=ml[Cl];return Cl++,fu._dbInfo=null,fu._ready=null,fu.getDriver(dp).then(dl).catch(rp)}Xu();var up=new Error("No available storage method found.");return fu._driverSet=Qr.reject(up),fu._driverSet}return rp()}}var Wu=this._driverSet!==null?this._driverSet.catch(function(){return Qr.resolve()}):Qr.resolve();return this._driverSet=Wu.then(function(){var ml=$u[0];return fu._dbInfo=null,fu._ready=null,fu.getDriver(ml).then(function(Cl){fu._driver=Cl._driver,Xu(),fu._wrapLibraryMethodsWithReady(),fu._initDriver=Qu($u)})}).catch(function(){Xu();var ml=new Error("No available storage method found.");return fu._driverSet=Qr.reject(ml),fu._driverSet}),ga(this._driverSet,Wo,gu),this._driverSet},Ko.prototype.supports=function(lu){return!!Zl[lu]},Ko.prototype._extend=function(lu){_d(this,lu)},Ko.prototype._getSupportedDrivers=function(lu){for(var Wo=[],gu=0,fu=lu.length;gu<fu;gu++){var $u=lu[gu];this.supports($u)&&Wo.push($u)}return Wo},Ko.prototype._wrapLibraryMethodsWithReady=function(){for(var lu=0,Wo=Gl.length;lu<Wo;lu++)tp(this,Gl[lu])},Ko.prototype.createInstance=function(lu){return new Ko(lu)},Ko}(),Xp=new np;Nr.exports=Xp},{3:3}]},{},[4])(4)})}),rr=$e(($r,pr)=>{(function(Mr,Nr){typeof $r=="object"&&typeof pr<"u"?Nr($r):typeof define=="function"&&define.amd?define("localforage-driver-memory",["exports"],Nr):Nr(Mr.LocalforageDriverMemory={})})(typeof self<"u"?self:$r,function(Mr){var Nr="localforage-driver-memory";function Dr(ro){var Un=typeof Symbol=="function"&&ro[Symbol.iterator],Hr=0;return Un?Un.call(ro):{next:function(){return ro&&Hr>=ro.length&&(ro=void 0),{value:ro&&ro[Hr++],done:!ro}}}}function Br(ro,Un){ro=ro||[],Un=Un||{};try{return new Blob(ro,Un)}catch(ho){if(ho.name!=="TypeError")throw ho;for(var Hr=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,Xr=new Hr,co=0;co<ro.length;co+=1)Xr.append(ro[co]);return Xr.getBlob(Un.type)}}var Lr=/^~~local_forage_type~([^~]+)~/,jr=9,Ur=jr+4,Gr=Object.prototype.toString;function Yr(ro){var Un=ro.length*.75,Hr=ro.length;ro[ro.length-1]==="="&&(Un--,ro[ro.length-2]==="="&&Un--);for(var Xr=new ArrayBuffer(Un),co=new Uint8Array(Xr),ho=0,go=0;ho<Hr;ho+=4){var bo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(ro[ho]),Eo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(ro[ho+1]),wo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(ro[ho+2]),Io="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(ro[ho+3]);co[go++]=bo<<2|Eo>>4,co[go++]=(Eo&15)<<4|wo>>2,co[go++]=(wo&3)<<6|Io&63}return Xr}function Qr(ro){for(var Un=new Uint8Array(ro),Hr="",Xr=0;Xr<Un.length;Xr+=3)Hr+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[Un[Xr]>>2],Hr+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(Un[Xr]&3)<<4|Un[Xr+1]>>4],Hr+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(Un[Xr+1]&15)<<2|Un[Xr+2]>>6],Hr+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[Un[Xr+2]&63];return Un.length%3===2?Hr=Hr.substring(0,Hr.length-1)+"=":Un.length%3===1&&(Hr=Hr.substring(0,Hr.length-2)+"=="),Hr}function Wn(ro,Un){var Hr="";if(ro&&(Hr=Gr.call(ro)),ro&&(Hr==="[object ArrayBuffer]"||ro.buffer&&Gr.call(ro.buffer)==="[object ArrayBuffer]")){var Xr=void 0,co="__lfsc__:";ro instanceof ArrayBuffer?(Xr=ro,co+="arbf"):(Xr=ro.buffer,Hr==="[object Int8Array]"?co+="si08":Hr==="[object Uint8Array]"?co+="ui08":Hr==="[object Uint8ClampedArray]"?co+="uic8":Hr==="[object Int16Array]"?co+="si16":Hr==="[object Uint16Array]"?co+="ur16":Hr==="[object Int32Array]"?co+="si32":Hr==="[object Uint32Array]"?co+="ui32":Hr==="[object Float32Array]"?co+="fl32":Hr==="[object Float64Array]"?co+="fl64":Un(new Error("Failed to get type for BinaryArray"))),Un(co+Qr(Xr))}else if(Hr==="[object Blob]"){var ho=new FileReader;ho.onload=function(){var go="~~local_forage_type~"+ro.type+"~"+Qr(this.result);Un("__lfsc__:blob"+go)},ho.readAsArrayBuffer(ro)}else try{Un(JSON.stringify(ro))}catch(go){console.error("Couldn't convert value into a JSON string: ",ro),Un(null,go)}}function ga(ro){if(ro.substring(0,jr)!=="__lfsc__:")return JSON.parse(ro);var Un=ro.substring(Ur),Hr=ro.substring(jr,Ur),Xr;if(Hr==="blob"&&Lr.test(Un)){var co=Un.match(Lr);Xr=co[1],Un=Un.substring(co[0].length)}var ho=Yr(Un);switch(Hr){case"arbf":return ho;case"blob":return Br([ho],{type:Xr});case"si08":return new Int8Array(ho);case"ui08":return new Uint8Array(ho);case"uic8":return new Uint8ClampedArray(ho);case"si16":return new Int16Array(ho);case"ur16":return new Uint16Array(ho);case"si32":return new Int32Array(ho);case"ui32":return new Uint32Array(ho);case"fl32":return new Float32Array(ho);case"fl64":return new Float64Array(ho);default:throw new Error("Unkown type: "+Hr)}}function eo(ro){var Un,Hr;if(ro===null||typeof ro!="object"||"isActiveClone"in ro)return ro;var Xr=ro instanceof Date?new Date(ro):ro.constructor();try{for(var co=Dr(Object.keys(ro)),ho=co.next();!ho.done;ho=co.next()){var go=ho.value;Object.prototype.hasOwnProperty.call(ro,go)&&(ro.isActiveClone=null,Xr[go]=eo(ro[go]),delete ro.isActiveClone)}}catch(bo){Un={error:bo}}finally{try{ho&&!ho.done&&(Hr=co.return)&&Hr.call(co)}finally{if(Un)throw Un.error}}return Xr}function _i(ro,Un){return(ro.name||Un.name)+"/"+(ro.storeName||Un.storeName)+"/"}function va(ro,Un){Un&&ro.then(function(Hr){Un(null,Hr)},function(Hr){Un(Hr)})}function io(){for(var ro=[],Un=0;Un<arguments.length;Un++)ro[Un]=arguments[Un];if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}function no(ro,Un){var Hr=this;if(Un=io.apply(this,arguments),ro=typeof ro!="function"&&ro||{},!ro.name){var Xr=this.config();ro.name=ro.name||Xr.name,ro.storeName=ro.storeName||Xr.storeName}var co;return ro.name?co=new Promise(function(ho){ro.storeName?ho(_i(ro,Hr._defaultConfig)):ho(ro.name+"/")}):co=Promise.reject("Invalid arguments"),{promise:co,callback:Un}}function so(ro){return typeof ro!="string"&&(console.warn(ro+" used as a key, but it is not a string."),ro=String(ro)),ro}var ao={bufferToString:Qr,deserialize:ga,serialize:Wn,stringToBuffer:Yr},fo={},lo=function(){function ro(Un){this.kp=Un,this.data={}}return ro.resolve=function(Un){return fo[Un]||(fo[Un]=new ro(Un)),fo[Un]},ro.prototype.clear=function(){this.data={}},ro.prototype.drop=function(){this.clear(),delete fo[this.kp]},ro.prototype.get=function(Un){return this.data[Un]},ro.prototype.key=function(Un){return this.keys()[Un]},ro.prototype.keys=function(){return Object.keys(this.data)},ro.prototype.rm=function(Un){delete this.data[Un]},ro.prototype.set=function(Un,Hr){this.data[Un]=Hr},ro}();function oo(ro){var Un=ro?eo(ro):{},Hr=_i(Un,this._defaultConfig),Xr=lo.resolve(Hr);return this._dbInfo=Un,this._dbInfo.serializer=ao,this._dbInfo.keyPrefix=Hr,this._dbInfo.mStore=Xr,Promise.resolve()}function po(ro){var Un=this,Hr=this.ready().then(function(){Un._dbInfo.mStore.clear()});return va(Hr,ro),Hr}function mo(ro,Un){var Hr=no.apply(this,arguments),Xr=Hr.promise,co=Hr.callback,ho=Xr.then(function(go){lo.resolve(go).drop()});return va(ho,co),Xr}function $o(ro,Un){var Hr=this;ro=so(ro);var Xr=this.ready().then(function(){var co=Hr._dbInfo.mStore.get(ro);return co==null?null:Hr._dbInfo.serializer.deserialize(co)});return va(Xr,Un),Xr}function Xn(ro,Un){var Hr=this,Xr=this.ready().then(function(){for(var co=Hr._dbInfo.mStore,ho=co.keys(),go=0;go<ho.length;go++){var bo=co.get(ho[go]);if(bo&&(bo=Hr._dbInfo.serializer.deserialize(bo)),bo=ro(bo,ho[go],go+1),bo!==void 0)return bo}});return va(Xr,Un),Xr}function Fr(ro,Un){var Hr=this,Xr=this.ready().then(function(){var co;try{co=Hr._dbInfo.mStore.key(ro),co===void 0&&(co=null)}catch{co=null}return co});return va(Xr,Un),Xr}function Vr(ro){var Un=this,Hr=this.ready().then(function(){return Un._dbInfo.mStore.keys()});return va(Hr,ro),Hr}function Wr(ro){var Un=this.keys().then(function(Hr){return Hr.length});return va(Un,ro),Un}function Jr(ro,Un){var Hr=this;ro=so(ro);var Xr=this.ready().then(function(){Hr._dbInfo.mStore.rm(ro)});return va(Xr,Un),Xr}function Gn(ro,Un,Hr){var Xr=this;ro=so(ro);var co=this.ready().then(function(){Un===void 0&&(Un=null);var ho=Un;return new Promise(function(go,bo){Xr._dbInfo.serializer.serialize(Un,function(Eo,wo){if(wo)bo(wo);else try{Xr._dbInfo.mStore.set(ro,Eo),go(ho)}catch(Io){bo(Io)}})})});return va(co,Hr),co}var to=!0;Mr._support=to,Mr._driver=Nr,Mr._initStorage=oo,Mr.clear=po,Mr.dropInstance=mo,Mr.getItem=$o,Mr.iterate=Xn,Mr.key=Fr,Mr.keys=Vr,Mr.length=Wr,Mr.removeItem=Jr,Mr.setItem=Gn,Object.defineProperty(Mr,"__esModule",{value:!0})})}),ge=Ze(ke()),Te=Ze(rr()),at={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};function ft($r){for(let[pr,Mr]of Object.entries(at))$r.style[pr]=Mr}function ut($r){return!![].slice.call(document.querySelectorAll(".magic-iframe")).find(Mr=>Mr.src.includes($r))}var pe=class extends Ke{constructor(){super(...arguments),this.activeElement=null}init(){this.test="hello",this.iframe=new Promise($r=>{let pr=()=>{if(ut(encodeURIComponent(this.parameters)))_r().log();else{let Mr=document.createElement("iframe");Mr.classList.add("magic-iframe"),Mr.dataset.magicIframeLabel=Ue(this.endpoint).host,Mr.title="Secure Modal",Mr.src=Ue(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,ft(Mr),document.body.appendChild(Mr),$r(Mr)}};["loaded","interactive","complete"].includes(document.readyState)?pr():window.addEventListener("load",pr,!1)}),window.addEventListener("message",$r=>{var pr;if($r.origin===this.endpoint&&$r.data&&$r.data.msgType&&this.messageHandlers.size){$r.data.response=(pr=$r.data.response)!=null?pr:{};for(let Mr of this.messageHandlers.values())Mr($r)}})}showOverlay(){return se(this,null,function*(){let $r=yield this.iframe;$r.style.display="block",this.activeElement=document.activeElement,$r.focus()})}hideOverlay(){return se(this,null,function*(){var $r;let pr=yield this.iframe;pr.style.display="none",($r=this.activeElement)!=null&&$r.focus&&this.activeElement.focus(),this.activeElement=null})}_post($r){return se(this,null,function*(){let pr=yield this.iframe;if(pr&&pr.contentWindow)pr.contentWindow.postMessage($r,this.endpoint);else throw pt()})}},bt=Jn(Me,{platform:"web",sdkName:"magic-sdk",version:"21.4.1",defaultEndpoint:"https://auth.magic.link/",ViewController:pe,configureStorage:()=>se(void 0,null,function*(){let $r=ge.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield $r.defineDriver(Te),yield $r.setDriver([ge.default.INDEXEDDB,ge.default.LOCALSTORAGE,Te._driver]),$r})});const es$1=Object.freeze(Object.defineProperty({__proto__:null,DeepLinkPage:f$2,DeviceVerificationEventEmit:T$1,DeviceVerificationEventOnReceived:A$2,EthChainType:R$2,Events:c,Extension:q,ExtensionError:B,ExtensionWarning:te,LoginWithEmailOTPEventEmit:I$1,LoginWithEmailOTPEventOnReceived:x$2,LoginWithMagicLinkEventEmit:v$1,LoginWithMagicLinkEventOnReceived:E$1,Magic:bt,MagicIncomingWindowMessage:u$2,MagicOutgoingWindowMessage:g$1,MagicPayloadMethod:l,RPCError:O$1,RPCErrorCode:m$2,RecoveryMethodType:N,SDKError:A$1,SDKErrorCode:o,SDKWarning:j,SDKWarningCode:_$2,Wallets:p,isPromiEvent:Pt},Symbol.toStringTag,{value:"Module"})),require$$3=getAugmentedNamespace(es$1);var sha256$1={exports:{}},core={exports:{}},hasRequiredCore;function requireCore(){return hasRequiredCore||(hasRequiredCore=1,function($r,pr){(function(Mr,Nr){$r.exports=Nr()})(commonjsGlobal,function(){var Mr=Mr||function(Nr,Dr){var Br=Object.create||function(){function va(){}return function(io){var no;return va.prototype=io,no=new va,va.prototype=null,no}}(),Lr={},jr=Lr.lib={},Ur=jr.Base=function(){return{extend:function(va){var io=Br(this);return va&&io.mixIn(va),(!io.hasOwnProperty("init")||this.init===io.init)&&(io.init=function(){io.$super.init.apply(this,arguments)}),io.init.prototype=io,io.$super=this,io},create:function(){var va=this.extend();return va.init.apply(va,arguments),va},init:function(){},mixIn:function(va){for(var io in va)va.hasOwnProperty(io)&&(this[io]=va[io]);va.hasOwnProperty("toString")&&(this.toString=va.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),Gr=jr.WordArray=Ur.extend({init:function(va,io){va=this.words=va||[],io!=Dr?this.sigBytes=io:this.sigBytes=va.length*4},toString:function(va){return(va||Qr).stringify(this)},concat:function(va){var io=this.words,no=va.words,so=this.sigBytes,ao=va.sigBytes;if(this.clamp(),so%4)for(var fo=0;fo<ao;fo++){var lo=no[fo>>>2]>>>24-fo%4*8&255;io[so+fo>>>2]|=lo<<24-(so+fo)%4*8}else for(var fo=0;fo<ao;fo+=4)io[so+fo>>>2]=no[fo>>>2];return this.sigBytes+=ao,this},clamp:function(){var va=this.words,io=this.sigBytes;va[io>>>2]&=4294967295<<32-io%4*8,va.length=Nr.ceil(io/4)},clone:function(){var va=Ur.clone.call(this);return va.words=this.words.slice(0),va},random:function(va){for(var io=[],no=function(oo){var oo=oo,po=987654321,mo=4294967295;return function(){po=36969*(po&65535)+(po>>16)&mo,oo=18e3*(oo&65535)+(oo>>16)&mo;var $o=(po<<16)+oo&mo;return $o/=4294967296,$o+=.5,$o*(Nr.random()>.5?1:-1)}},so=0,ao;so<va;so+=4){var fo=no((ao||Nr.random())*4294967296);ao=fo()*987654071,io.push(fo()*4294967296|0)}return new Gr.init(io,va)}}),Yr=Lr.enc={},Qr=Yr.Hex={stringify:function(va){for(var io=va.words,no=va.sigBytes,so=[],ao=0;ao<no;ao++){var fo=io[ao>>>2]>>>24-ao%4*8&255;so.push((fo>>>4).toString(16)),so.push((fo&15).toString(16))}return so.join("")},parse:function(va){for(var io=va.length,no=[],so=0;so<io;so+=2)no[so>>>3]|=parseInt(va.substr(so,2),16)<<24-so%8*4;return new Gr.init(no,io/2)}},Wn=Yr.Latin1={stringify:function(va){for(var io=va.words,no=va.sigBytes,so=[],ao=0;ao<no;ao++){var fo=io[ao>>>2]>>>24-ao%4*8&255;so.push(String.fromCharCode(fo))}return so.join("")},parse:function(va){for(var io=va.length,no=[],so=0;so<io;so++)no[so>>>2]|=(va.charCodeAt(so)&255)<<24-so%4*8;return new Gr.init(no,io)}},ga=Yr.Utf8={stringify:function(va){try{return decodeURIComponent(escape(Wn.stringify(va)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(va){return Wn.parse(unescape(encodeURIComponent(va)))}},eo=jr.BufferedBlockAlgorithm=Ur.extend({reset:function(){this._data=new Gr.init,this._nDataBytes=0},_append:function(va){typeof va=="string"&&(va=ga.parse(va)),this._data.concat(va),this._nDataBytes+=va.sigBytes},_process:function(va){var io=this._data,no=io.words,so=io.sigBytes,ao=this.blockSize,fo=ao*4,lo=so/fo;va?lo=Nr.ceil(lo):lo=Nr.max((lo|0)-this._minBufferSize,0);var oo=lo*ao,po=Nr.min(oo*4,so);if(oo){for(var mo=0;mo<oo;mo+=ao)this._doProcessBlock(no,mo);var $o=no.splice(0,oo);io.sigBytes-=po}return new Gr.init($o,po)},clone:function(){var va=Ur.clone.call(this);return va._data=this._data.clone(),va},_minBufferSize:0});jr.Hasher=eo.extend({cfg:Ur.extend(),init:function(va){this.cfg=this.cfg.extend(va),this.reset()},reset:function(){eo.reset.call(this),this._doReset()},update:function(va){return this._append(va),this._process(),this},finalize:function(va){va&&this._append(va);var io=this._doFinalize();return io},blockSize:16,_createHelper:function(va){return function(io,no){return new va.init(no).finalize(io)}},_createHmacHelper:function(va){return function(io,no){return new _i.HMAC.init(va,no).finalize(io)}}});var _i=Lr.algo={};return Lr}(Math);return Mr})}(core)),core.exports}(function($r,pr){(function(Mr,Nr){$r.exports=Nr(requireCore())})(commonjsGlobal,function(Mr){return function(Nr){var Dr=Mr,Br=Dr.lib,Lr=Br.WordArray,jr=Br.Hasher,Ur=Dr.algo,Gr=[],Yr=[];(function(){function ga(io){for(var no=Nr.sqrt(io),so=2;so<=no;so++)if(!(io%so))return!1;return!0}function eo(io){return(io-(io|0))*4294967296|0}for(var _i=2,va=0;va<64;)ga(_i)&&(va<8&&(Gr[va]=eo(Nr.pow(_i,1/2))),Yr[va]=eo(Nr.pow(_i,1/3)),va++),_i++})();var Qr=[],Wn=Ur.SHA256=jr.extend({_doReset:function(){this._hash=new Lr.init(Gr.slice(0))},_doProcessBlock:function(ga,eo){for(var _i=this._hash.words,va=_i[0],io=_i[1],no=_i[2],so=_i[3],ao=_i[4],fo=_i[5],lo=_i[6],oo=_i[7],po=0;po<64;po++){if(po<16)Qr[po]=ga[eo+po]|0;else{var mo=Qr[po-15],$o=(mo<<25|mo>>>7)^(mo<<14|mo>>>18)^mo>>>3,Xn=Qr[po-2],Fr=(Xn<<15|Xn>>>17)^(Xn<<13|Xn>>>19)^Xn>>>10;Qr[po]=$o+Qr[po-7]+Fr+Qr[po-16]}var Vr=ao&fo^~ao&lo,Wr=va&io^va&no^io&no,Jr=(va<<30|va>>>2)^(va<<19|va>>>13)^(va<<10|va>>>22),Gn=(ao<<26|ao>>>6)^(ao<<21|ao>>>11)^(ao<<7|ao>>>25),to=oo+Gn+Vr+Yr[po]+Qr[po],ro=Jr+Wr;oo=lo,lo=fo,fo=ao,ao=so+to|0,so=no,no=io,io=va,va=to+ro|0}_i[0]=_i[0]+va|0,_i[1]=_i[1]+io|0,_i[2]=_i[2]+no|0,_i[3]=_i[3]+so|0,_i[4]=_i[4]+ao|0,_i[5]=_i[5]+fo|0,_i[6]=_i[6]+lo|0,_i[7]=_i[7]+oo|0},_doFinalize:function(){var ga=this._data,eo=ga.words,_i=this._nDataBytes*8,va=ga.sigBytes*8;return eo[va>>>5]|=128<<24-va%32,eo[(va+64>>>9<<4)+14]=Nr.floor(_i/4294967296),eo[(va+64>>>9<<4)+15]=_i,ga.sigBytes=eo.length*4,this._process(),this._hash},clone:function(){var ga=jr.clone.call(this);return ga._hash=this._hash.clone(),ga}});Dr.SHA256=jr._createHelper(Wn),Dr.HmacSHA256=jr._createHmacHelper(Wn)}(Math),Mr.SHA256})})(sha256$1);var sha256Exports=sha256$1.exports;const I=getDefaultExportFromCjs$1(sha256Exports);var encBase64={exports:{}};(function($r,pr){(function(Mr,Nr){$r.exports=Nr(requireCore())})(commonjsGlobal,function(Mr){return function(){var Nr=Mr,Dr=Nr.lib,Br=Dr.WordArray,Lr=Nr.enc;Lr.Base64={stringify:function(Ur){var Gr=Ur.words,Yr=Ur.sigBytes,Qr=this._map;Ur.clamp();for(var Wn=[],ga=0;ga<Yr;ga+=3)for(var eo=Gr[ga>>>2]>>>24-ga%4*8&255,_i=Gr[ga+1>>>2]>>>24-(ga+1)%4*8&255,va=Gr[ga+2>>>2]>>>24-(ga+2)%4*8&255,io=eo<<16|_i<<8|va,no=0;no<4&&ga+no*.75<Yr;no++)Wn.push(Qr.charAt(io>>>6*(3-no)&63));var so=Qr.charAt(64);if(so)for(;Wn.length%4;)Wn.push(so);return Wn.join("")},parse:function(Ur){var Gr=Ur.length,Yr=this._map,Qr=this._reverseMap;if(!Qr){Qr=this._reverseMap=[];for(var Wn=0;Wn<Yr.length;Wn++)Qr[Yr.charCodeAt(Wn)]=Wn}var ga=Yr.charAt(64);if(ga){var eo=Ur.indexOf(ga);eo!==-1&&(Gr=eo)}return jr(Ur,Gr,Qr)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function jr(Ur,Gr,Yr){for(var Qr=[],Wn=0,ga=0;ga<Gr;ga++)if(ga%4){var eo=Yr[Ur.charCodeAt(ga-1)]<<ga%4*2,_i=Yr[Ur.charCodeAt(ga)]>>>6-ga%4*2;Qr[Wn>>>2]|=(eo|_i)<<24-Wn%4*8,Wn++}return Br.create(Qr,Wn)}}(),Mr.enc.Base64})})(encBase64);var encBase64Exports=encBase64.exports;const b=getDefaultExportFromCjs$1(encBase64Exports);var u=($r,pr,Mr)=>new Promise((Nr,Dr)=>{var Br=Ur=>{try{jr(Mr.next(Ur))}catch(Gr){Dr(Gr)}},Lr=Ur=>{try{jr(Mr.throw(Ur))}catch(Gr){Dr(Gr)}},jr=Ur=>Ur.done?Nr(Ur.value):Promise.resolve(Ur.value).then(Br,Lr);jr((Mr=Mr.apply($r,pr)).next())}),f=($r=>($r.ParseRedirectResult="magic_oauth_parse_redirect_result",$r))(f||{}),_=($r=>($r.InvalidRequest="invalid_request",$r.InvalidClient="invalid_client",$r.InvalidScope="invalid_scope",$r.InvalidGrant="invalid_grant",$r.UnauthorizedClient="unauthorized_client",$r.UnsupportedResponseType="unsupported_response_type",$r.UnsupportedGrantType="unsupported_grant_type",$r.UnsupportedTokenType="unsupported_token_type",$r.AccessDenied="access_denied",$r.ServerError="server_error",$r.TemporarilyUnavailable="temporarily_unavailable",$r))(_||{}),m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",R=typeof window<"u"&&!!window.crypto,w=R&&!!window.crypto.subtle;function U($r){return Array.from($r).map(pr=>m[pr%m.length]).join("")}function y($r){let pr=Mr=>Mr.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");if($r instanceof ArrayBuffer){let Mr=new Uint8Array($r),Nr=Array.from(Mr).map(Br=>String.fromCharCode(Br)).join(""),Dr=btoa(Nr);return pr(Dr)}return pr(b.stringify($r))}function O($r){return u(this,null,function*(){if(w){let pr=new TextEncoder().encode($r);return crypto.subtle.digest("SHA-256",pr).then(y)}return y(I($r))})}function h($r){let pr=new Uint8Array($r);if(R)window.crypto.getRandomValues(pr);else for(let Mr=0;Mr<$r;Mr+=1)pr[Mr]=Math.floor(Math.random()*Math.floor(255));return U(pr)}function A(){return u(this,null,function*(){let $r=h(128),pr=h(128),Mr=yield O(pr);return{verifier:pr,challenge:Mr,state:$r}})}var v=class extends q.Internal{constructor(){super(...arguments),this.name="oauth",this.config={},this.compat={"magic-sdk":">=2.4.6","@magic-sdk/react-native":!1,"@magic-sdk/react-native-bare":!1,"@magic-sdk/react-native-expo":!1}}loginWithRedirect($r){return this.utils.createPromiEvent(pr=>u(this,null,function*(){let{provider:Mr,query:Nr}=yield x.call(this,$r);window.location.href=new URL(`/v1/oauth2/${Mr}/start?${Nr}`,this.sdk.endpoint).href,pr()}))}getRedirectResult(){let $r=window.location.search,pr=window.location.origin+window.location.pathname;return window.history.replaceState(null,"",pr),D.call(this,$r)}},g="oauth_redirect_metadata";function x($r){return u(this,null,function*(){yield this.utils.storage.removeItem(g);let{provider:pr,redirectURI:Mr,scope:Nr,loginHint:Dr}=$r,{verifier:Br,challenge:Lr,state:jr}=yield A(),Ur=JSON.stringify({verifier:Br,state:jr});return yield this.utils.storage.setItem(g,Ur),{query:[`magic_api_key=${encodeURIComponent(this.sdk.apiKey)}`,`magic_challenge=${encodeURIComponent(Lr)}`,`state=${encodeURIComponent(jr)}`,`platform=${encodeURIComponent("web")}`,Nr&&`scope=${encodeURIComponent(Nr.join(" "))}`,Mr&&`redirect_uri=${encodeURIComponent(Mr)}`,Dr&&`login_hint=${encodeURIComponent(Dr)}`].reduce((Gr,Yr)=>Yr?`${Gr}&${Yr}`:Gr),provider:pr,redirectURI:Mr}})}function D($r){return this.utils.createPromiEvent((pr,Mr)=>u(this,null,function*(){var Nr;let Dr=yield this.utils.storage.getItem(g),{verifier:Br,state:Lr}=JSON.parse(Dr);this.utils.storage.removeItem(g);let jr=this.utils.createJsonRpcRequestPayload("magic_oauth_parse_redirect_result",[$r,Br,Lr]),Ur=yield this.request(jr),Gr=Ur,Yr=Ur;Yr.error&&Mr(this.createError(Yr.error,(Nr=Yr.error_description)!=null?Nr:"An error occurred.",{errorURI:Yr.error_uri,provider:Yr.provider})),pr(Gr)}))}const es=Object.freeze(Object.defineProperty({__proto__:null,OAuthErrorCode:_,OAuthExtension:v,OAuthPayloadMethods:f},Symbol.toStringTag,{value:"Module"})),require$$4=getAugmentedNamespace(es);var __createBinding$6=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function($r,pr,Mr,Nr){Nr===void 0&&(Nr=Mr),Object.defineProperty($r,Nr,{enumerable:!0,get:function(){return pr[Mr]}})}:function($r,pr,Mr,Nr){Nr===void 0&&(Nr=Mr),$r[Nr]=pr[Mr]}),__setModuleDefault$6=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function($r,pr){Object.defineProperty($r,"default",{enumerable:!0,value:pr})}:function($r,pr){$r.default=pr}),__importStar$6=commonjsGlobal&&commonjsGlobal.__importStar||function($r){if($r&&$r.__esModule)return $r;var pr={};if($r!=null)for(var Mr in $r)Mr!=="default"&&Object.prototype.hasOwnProperty.call($r,Mr)&&__createBinding$6(pr,$r,Mr);return __setModuleDefault$6(pr,$r),pr};Object.defineProperty(MagicConnector$1,"__esModule",{value:!0});MagicConnector$1.MagicConnector=void 0;const schemas_1$1=dist$6,configuration_1$1=configuration$1,AbstractConnector_1=AbstractConnector$1;class MagicConnector extends AbstractConnector_1.AbstractConnector{constructor(pr){super({supportedChainIds:configuration_1$1.getConfiguration()[schemas_1$1.ProviderType.MAGIC].chains}),this.activate=async()=>{var Mr;if(this.magic=await this.buildMagicInstance(this.chainId),!await this.magic.user.isLoggedIn())throw new Error("Magic: user isn't logged in");const Dr=await this.getProvider(),Br=await Dr.request({method:"eth_accounts"});return this.account=(Mr=Br[0])!==null&&Mr!==void 0?Mr:null,{provider:Dr,chainId:this.chainId,account:this.account}},this.getProvider=async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");const Mr=await this.magic.wallet.getProvider();return Object.assign(Object.assign({},Mr),{request:new Proxy(Mr.request,{apply:async(Nr,Dr,Br)=>{var Lr,jr,Ur;if(((Lr=Br[0])===null||Lr===void 0?void 0:Lr.method)==="wallet_switchEthereumChain")try{const Gr=parseInt((Ur=(jr=Br[0])===null||jr===void 0?void 0:jr.params[0])===null||Ur===void 0?void 0:Ur.chainId,16);return this.supportedChainIds&&!this.supportedChainIds.includes(Gr)?{code:2020202,message:"Unsupported Magic ChainId"}:(this.magic=await this.buildMagicInstance(Gr),this.emitUpdate({chainId:Gr}),null)}catch{return{code:2020201,message:"Error changing the Magic ChainId"}}return Nr.bind(Mr)(...Br)}})})},this.getChainId=async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");return this.chainId},this.getAccount=async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");return this.account},this.deactivate=()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");this.magic.user.logout(),this.emitDeactivate()},this.buildMagicInstance=async Mr=>{const{Magic:Nr}=await Promise.resolve().then(()=>__importStar$6(require$$3)),{OAuthExtension:Dr}=await Promise.resolve().then(()=>__importStar$6(require$$4)),Br=configuration_1$1.getConfiguration()[schemas_1$1.ProviderType.MAGIC];return new Nr(Br.apiKey,{extensions:[new Dr],network:{rpcUrl:Br.urls[Mr],chainId:Mr}})},this.chainId=pr,this.account=null}}MagicConnector$1.MagicConnector=MagicConnector;(function($r){var pr=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Nr,Dr,Br,Lr){Lr===void 0&&(Lr=Br),Object.defineProperty(Nr,Lr,{enumerable:!0,get:function(){return Dr[Br]}})}:function(Nr,Dr,Br,Lr){Lr===void 0&&(Lr=Br),Nr[Lr]=Dr[Br]}),Mr=commonjsGlobal&&commonjsGlobal.__exportStar||function(Nr,Dr){for(var Br in Nr)Br!=="default"&&!Object.prototype.hasOwnProperty.call(Dr,Br)&&pr(Dr,Nr,Br)};Object.defineProperty($r,"__esModule",{value:!0}),Mr(AbstractConnector$1,$r),Mr(FortmaticConnector$1,$r),Mr(InjectedConnector$2,$r),Mr(NetworkConnector$2,$r),Mr(WalletLinkConnector$2,$r),Mr(WalletConnectV2Connector$1,$r),Mr(MagicConnector$1,$r)})(connectors);var storage={},Storage$1={};Object.defineProperty(Storage$1,"__esModule",{value:!0});Storage$1.Storage=void 0;class Storage{}Storage$1.Storage=Storage;var LocalStorage$1={};Object.defineProperty(LocalStorage$1,"__esModule",{value:!0});LocalStorage$1.LocalStorage=void 0;const Storage_1=Storage$1;class LocalStorage extends Storage_1.Storage{get(pr){const Mr=window.localStorage.getItem(pr);return Mr===null?void 0:Mr}set(pr,Mr){window.localStorage.setItem(pr,Mr)}remove(pr){window.localStorage.removeItem(pr)}removeRegExp(pr){for(let Mr=localStorage.length-1;Mr>=0;Mr--){const Nr=localStorage.key(Mr);Nr&&pr.test(Nr)&&localStorage.removeItem(Nr)}}}LocalStorage$1.LocalStorage=LocalStorage;(function($r){var pr=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Nr,Dr,Br,Lr){Lr===void 0&&(Lr=Br),Object.defineProperty(Nr,Lr,{enumerable:!0,get:function(){return Dr[Br]}})}:function(Nr,Dr,Br,Lr){Lr===void 0&&(Lr=Br),Nr[Lr]=Dr[Br]}),Mr=commonjsGlobal&&commonjsGlobal.__exportStar||function(Nr,Dr){for(var Br in Nr)Br!=="default"&&!Object.prototype.hasOwnProperty.call(Dr,Br)&&pr(Dr,Nr,Br)};Object.defineProperty($r,"__esModule",{value:!0}),Mr(Storage$1,$r),Mr(LocalStorage$1,$r)})(storage);var ProviderAdapter$1={};Object.defineProperty(ProviderAdapter$1,"__esModule",{value:!0});ProviderAdapter$1.ProviderAdapter=void 0;class ProviderAdapter{constructor(pr){this.provider=pr,this.id=0,this.on=(Mr,Nr)=>this.provider.on(Mr,Nr),this.emit=(Mr,...Nr)=>this.provider.emit(Mr,Nr),this.removeListener=(Mr,Nr)=>this.provider.removeListener(Mr,Nr),this.request=async({method:Mr,params:Nr})=>this.isModernProvider()?this.provider.request({method:Mr,params:Nr}):this.send(Mr,Nr),this.sendAsync=async(Mr,Nr)=>this.hasSendAsync()?this.provider.sendAsync(Mr,(Dr,Br)=>{Br&&!Br.hasOwnProperty("result")?Nr(Dr,{id:0,jsonrpc:"2.0",result:Br}):Nr(Dr,Br)}):this.send(Mr,Nr)}static adapt(pr){const Mr=new ProviderAdapter(pr);return Object.assign(Object.assign({},pr),{on:Mr.on,emit:Mr.emit,removeListener:Mr.removeListener,request:Mr.request,sendAsync:Mr.sendAsync,send:Mr.send.bind(Mr)})}async send(pr,Mr){let Nr,Dr,Br;const Lr=typeof Mr=="function";if(Lr){const jr=pr;Dr=jr.params||[],Nr=jr.method,Br=Mr}else Nr=pr,Dr=Mr||[],Br=(jr,Ur)=>{if(jr)throw jr;return Ur};if(this.isModernProvider()){const[jr,Ur]=await this.provider.request({method:Nr,params:Dr}).then(Yr=>[null,Yr]).catch(Yr=>[Yr,void 0]);return Br(jr,Lr?{id:"",jsonrpc:"2.0",result:Ur}:Ur)}else{this.patchOldMobile();const[jr,Ur]=Lr?await new Promise(Gr=>this.provider.send(pr,(Yr,Qr)=>{Gr([Yr,Qr])})):await new Promise(Gr=>this.provider.send({jsonrpc:"2.0",id:++this.id,method:Nr,params:Dr},(Yr,Qr)=>{Gr([Qr&&Qr.hasOwnProperty("error")?Qr.error:Yr,Qr&&Qr.hasOwnProperty("result")?Qr.result:Qr])}));return Br(jr,Ur)}}isModernProvider(){return typeof this.provider.request=="function"}hasSendAsync(){return typeof this.provider.sendAsync=="function"}patchOldMobile(){this.provider&&!this.provider.isDapper&&!this.provider.isFortmatic&&!this.provider.isMetamask&&this.hasSendAsync()&&this.provider.send!==this.provider.sendAsync&&(this.provider.send=this.provider.sendAsync)}}ProviderAdapter$1.ProviderAdapter=ProviderAdapter;Object.defineProperty(ConnectionManager$1,"__esModule",{value:!0});ConnectionManager$1.connection=ConnectionManager$1.ConnectionManager=void 0;const chain_id_1=requireChainId(),provider_type_1=providerType,types_1=require$$2$2,connectors_1=connectors,storage_1=storage,configuration_1=configuration$1,ProviderAdapter_1=ProviderAdapter$1;class ConnectionManager{constructor(pr){this.storage=pr,this.getWalletName=()=>{if(this.connector instanceof connectors_1.WalletConnectV2Connector)return this.connector.getWalletName()},this.clearConnectionData=()=>{const{storageKey:Mr}=configuration_1.getConfiguration();this.storage.remove(Mr),connectors_1.WalletConnectV2Connector.clearStorage(this.storage)},this.handleWeb3ReactDeactivate=()=>{this.connector&&(this.connector.removeListener(types_1.ConnectorEvent.Deactivate,this.handleWeb3ReactDeactivate),this.connector.removeAllListeners(types_1.ConnectorEvent.Update)),this.disconnect().catch(console.error)}}async connect(pr,Mr=chain_id_1.ChainId.ETHEREUM_MAINNET){this.connector=this.buildConnector(pr,Mr),this.connector.on(types_1.ConnectorEvent.Deactivate,this.handleWeb3ReactDeactivate),pr===provider_type_1.ProviderType.MAGIC&&this.connector.on(types_1.ConnectorEvent.Update,({chainId:Br})=>{Br&&this.setConnectionData(pr,Br)});const{provider:Nr,account:Dr}=await this.connector.activate();return this.setConnectionData(pr,Mr),{provider:ProviderAdapter_1.ProviderAdapter.adapt(Nr),providerType:pr,account:Dr||"",chainId:Mr}}async tryPreviousConnection(){const pr=this.getConnectionData();if(!pr)throw new Error("Could not find a valid provider. Make sure to call the `connect` method first");const Mr=await this.connect(pr.providerType,pr.chainId);if(Mr.providerType===provider_type_1.ProviderType.INJECTED){const Nr=await Mr.provider.request({method:"eth_chainId"}),Dr=Nr?parseInt(Nr,16):null;Dr&&pr.chainId!==Dr&&this.setConnectionData(pr.providerType,Dr)}return Object.assign(Object.assign({},Mr),{chainId:this.getConnectionData().chainId})}getAvailableProviders(){const pr=[provider_type_1.ProviderType.FORTMATIC,provider_type_1.ProviderType.WALLET_CONNECT,provider_type_1.ProviderType.WALLET_LINK];return typeof window<"u"&&window.ethereum!==void 0?pr.unshift(provider_type_1.ProviderType.INJECTED):pr.unshift(provider_type_1.ProviderType.METAMASK_MOBILE),pr}async disconnect(){this.connector&&(this.connector.deactivate(),this.isClosableConnector()&&await this.connector.close()),this.clearConnectionData(),this.connector=void 0}async getProvider(){if(!this.connector)throw new Error("No valid connector found. Please .connect() first");return this.connector.getProvider()}async createProvider(pr,Mr=chain_id_1.ChainId.ETHEREUM_MAINNET){const Dr=await this.buildConnector(pr,Mr).getProvider();return ProviderAdapter_1.ProviderAdapter.adapt(Dr)}buildConnector(pr,Mr){switch(pr){case provider_type_1.ProviderType.INJECTED:return new connectors_1.InjectedConnector(Mr);case provider_type_1.ProviderType.FORTMATIC:return new connectors_1.FortmaticConnector(Mr);case provider_type_1.ProviderType.MAGIC:return new connectors_1.MagicConnector(Mr);case provider_type_1.ProviderType.WALLET_LINK:return new connectors_1.WalletLinkConnector(Mr);case provider_type_1.ProviderType.NETWORK:return new connectors_1.NetworkConnector(Mr);case provider_type_1.ProviderType.WALLET_CONNECT_V2:return new connectors_1.WalletConnectV2Connector(Mr);default:throw new Error(`Invalid provider ${pr}`)}}getConnectionData(){const{storageKey:pr}=configuration_1.getConfiguration(),Mr=this.storage.get(pr);return Mr?JSON.parse(Mr):void 0}setConnectionData(pr,Mr){const{storageKey:Nr}=configuration_1.getConfiguration(),Dr=JSON.stringify({providerType:pr,chainId:Mr});this.storage.set(Nr,Dr)}isClosableConnector(){return this.connector&&typeof this.connector.close<"u"}}ConnectionManager$1.ConnectionManager=ConnectionManager;ConnectionManager$1.connection=new ConnectionManager(new storage_1.LocalStorage);var types$1={};Object.defineProperty(types$1,"__esModule",{value:!0});(function($r){var pr=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Nr,Dr,Br,Lr){Lr===void 0&&(Lr=Br),Object.defineProperty(Nr,Lr,{enumerable:!0,get:function(){return Dr[Br]}})}:function(Nr,Dr,Br,Lr){Lr===void 0&&(Lr=Br),Nr[Lr]=Dr[Br]}),Mr=commonjsGlobal&&commonjsGlobal.__exportStar||function(Nr,Dr){for(var Br in Nr)Br!=="default"&&!Object.prototype.hasOwnProperty.call(Dr,Br)&&pr(Dr,Nr,Br)};Object.defineProperty($r,"__esModule",{value:!0}),Mr(ConnectionManager$1,$r),Mr(connectors,$r),Mr(configuration$1,$r),Mr(types$1,$r)})(dist$7);const manDefault="https://cdn.decentraland.org/@dcl/auth-site/1.3.1-7743847636.commit-51766c3/assets/ManDefault-cb03f4f3.webp",platformImg="https://cdn.decentraland.org/@dcl/auth-site/1.3.1-7743847636.commit-51766c3/assets/Platform-dfc6309e.webp";function getAnalytics(){return window.analytics}const usePageTracking=()=>{reactExports.useEffect(()=>{const $r=getAnalytics();$r&&$r.page()},[])};var TrackingEvents=($r=>($r.LOGIN_CLICK="Click Login Button",$r.LOGIN_SUCCESS="Login Success",$r.LOGIN_ERROR="Login Error",$r.CLICK="Click Button",$r.AVATAR_EDIT_SUCCESS="Avatar Edit Success",$r.TERMS_OF_SERVICE_SUCCESS="Terms of service success",$r))(TrackingEvents||{}),ClickEvents=($r=>($r.LEARN_MORE="Learn More",$r.DENY_SIGN_IN="Deny Sign In",$r.DENY_WALLET_INTERACTION="Deny Wallet Interaction",$r.APPROVE_SING_IN="Approve Sign In",$r.APPROVE_WALLET_INTERACTION="Approve Wallet Interaction",$r.RANDOMIZE="Randomize default profile",$r.BACK_TO_AVATAR_RANDOMIZATION_VIEW="Back to avatar randomization view",$r.SUBMIT_PROFILE="Submit profile",$r))(ClickEvents||{}),ConnectionType=($r=>($r.WEB3="web3",$r.WEB2="web2",$r.GUEST="guest",$r))(ConnectionType||{});const AUTH_SERVER_URL$2="https://auth-api.decentraland.zone",SEGMENT_API_KEY$2="FQqbzV2KeUKe2RPOeFkedKRPkJAFsU9r",PEER_URL$2="https://peer.decentraland.zone",FEATURE_FLAGS_URL$2="https://feature-flags.decentraland.org",FEATURE_FLAGS_INTERVAL$2="60000",BUILDER_SERVER_URL$2="https://builder-api.decentraland.zone",dev={AUTH_SERVER_URL:AUTH_SERVER_URL$2,SEGMENT_API_KEY:SEGMENT_API_KEY$2,PEER_URL:PEER_URL$2,FEATURE_FLAGS_URL:FEATURE_FLAGS_URL$2,FEATURE_FLAGS_INTERVAL:FEATURE_FLAGS_INTERVAL$2,BUILDER_SERVER_URL:BUILDER_SERVER_URL$2},AUTH_SERVER_URL$1="https://auth-api.decentraland.org",SEGMENT_API_KEY$1="FQqbzV2KeUKe2RPOeFkedKRPkJAFsU9r",PEER_URL$1="https://peer.decentraland.org",FEATURE_FLAGS_URL$1="https://feature-flags.decentraland.org",FEATURE_FLAGS_INTERVAL$1="60000",BUILDER_SERVER_URL$1="https://builder-api.decentraland.today",prod={AUTH_SERVER_URL:AUTH_SERVER_URL$1,SEGMENT_API_KEY:SEGMENT_API_KEY$1,PEER_URL:PEER_URL$1,FEATURE_FLAGS_URL:FEATURE_FLAGS_URL$1,FEATURE_FLAGS_INTERVAL:FEATURE_FLAGS_INTERVAL$1,BUILDER_SERVER_URL:BUILDER_SERVER_URL$1},AUTH_SERVER_URL="https://auth-api.decentraland.today",SEGMENT_API_KEY="FQqbzV2KeUKe2RPOeFkedKRPkJAFsU9r",PEER_URL="https://peer.decentraland.org",FEATURE_FLAGS_URL="https://feature-flags.decentraland.org",FEATURE_FLAGS_INTERVAL="60000",BUILDER_SERVER_URL="https://builder-api.decentraland.org",stg={AUTH_SERVER_URL,SEGMENT_API_KEY,PEER_URL,FEATURE_FLAGS_URL,FEATURE_FLAGS_INTERVAL,BUILDER_SERVER_URL},config=dist$8.createConfig({[dist$8.Env.DEVELOPMENT]:dev,[dist$8.Env.STAGING]:stg,[dist$8.Env.PRODUCTION]:prod},{systemEnvVariables:{REACT_APP_DCL_DEFAULT_ENV:{}.VITE_REACT_APP_DCL_DEFAULT_ENV??"dev"}});async function fetchProfile($r){const pr=config.get("PEER_URL"),Mr=await fetch(`${pr}/lambdas/profiles/${$r}`);return Mr.ok?await Mr.json():null}function isErrorWithMessage($r){return $r!=null&&typeof $r=="object"&&"message"in $r}function isRpcError($r){return $r!=null&&typeof $r=="object"&&"error"in $r&&$r.error!==void 0&&$r.error!==null&&typeof $r.error=="object"&&"message"in $r.error&&"code"in $r.error}const background$2="_background_1ksp2_1",emptyProfile="_emptyProfile_1ksp2_11",main$7="_main_1ksp2_27",left$3="_left_1ksp2_38",right$3="_right_1ksp2_49",wearablePlatform="_wearablePlatform_1ksp2_64",changeAccount="_changeAccount_1ksp2_70",errorLogo="_errorLogo_1ksp2_83",logo$1="_logo_1ksp2_92",title$4="_title_1ksp2_98",description$1="_description_1ksp2_105",code="_code_1ksp2_112",buttons="_buttons_1ksp2_119",closeWindow="_closeWindow_1ksp2_129",errorMessage="_errorMessage_1ksp2_135",noButton="_noButton_1ksp2_145",yesButton="_yesButton_1ksp2_147",wearableDefaultImg="_wearableDefaultImg_1ksp2_164",loading="_loading_1ksp2_176",communityBubble="_communityBubble_1ksp2_180",styles$a={background:background$2,emptyProfile,main:main$7,left:left$3,right:right$3,wearablePlatform,changeAccount,errorLogo,logo:logo$1,title:title$4,description:description$1,code,buttons,closeWindow,errorMessage,noButton,yesButton,wearableDefaultImg,loading,communityBubble},RequestPage=()=>{usePageTracking();const $r=useParams(),pr=useNavigate(),Mr=reactExports.useRef(),[Nr,Dr]=reactExports.useState(2),[Br,Lr]=reactExports.useState(!1),[jr,Ur]=reactExports.useState(),Gr=reactExports.useRef(),[Yr,Qr]=reactExports.useState(),Wn=reactExports.useRef(),ga=reactExports.useRef(),eo=$r.requestId??"",[_i,va]=reactExports.useState(!1),io=reactExports.useCallback(()=>{pr(`/login?redirectTo=/auth/requests/${eo}`)},[]);reactExports.useEffect(()=>((async()=>{try{const mo=await dist$7.connection.tryPreviousConnection();if(Mr.current=new BrowserProvider(mo.provider),!mo.account)throw new Error("No account connected");if(!await fetchProfile(mo.account)){pr(`/setup?redirectTo=/auth/requests/${eo}`);return}}catch{io();return}try{const $o=await(await Mr.current.getSigner()).getAddress();getAnalytics().identify({ethAddress:$o});const Xn=await authServerFetch("recover",{requestId:eo});Gr.current=Xn;const Fr=await fetchProfile($o);if(Ur(Fr),ga.current=$o,va(!0),Xn.sender&&Xn.sender!==$o.toLowerCase()){Dr(1);return}Wn.current=setTimeout(()=>{Dr(0)},new Date(Xn.expiration).getTime()-Date.now()),Xn.method==="dcl_personal_sign"?Dr(4):Dr(8)}catch(mo){Qr(isErrorWithMessage(mo)?mo.message:"Unknown error"),Dr(3)}})(),()=>{clearTimeout(Wn.current)}),[]),reactExports.useEffect(()=>{Nr!==4&&Nr!==8&&clearTimeout(Wn.current)},[Nr]);const no=reactExports.useCallback(async()=>{var mo;Lr(!0),getAnalytics().track(TrackingEvents.CLICK,{action:ClickEvents.DENY_SIGN_IN});try{const $o=await((mo=Mr.current)==null?void 0:mo.getSigner());$o&&await authServerFetch("outcome",{requestId:eo,sender:await $o.getAddress(),error:{code:-32003,message:"Transaction rejected"}})}finally{Lr(!1),Dr(5)}},[]),so=reactExports.useCallback(mo=>{ga.current&&mo.profile===ga.current&&va(!1)},[]),ao=reactExports.useCallback(async()=>{getAnalytics().track(TrackingEvents.CLICK,{action:ClickEvents.APPROVE_SING_IN}),Lr(!0);const mo=Mr.current;try{if(!mo)throw new Error("Provider not created");const $o=await mo.getSigner(),Xn=await $o.signMessage(Gr.current.params[0]),Fr=await authServerFetch("outcome",{requestId:eo,sender:await $o.getAddress(),result:Xn});if(Fr.error)throw new Error(Fr.error);Dr(7)}catch($o){Qr(isErrorWithMessage($o)?$o.message:"Unknown error"),Dr(6)}finally{Lr(!1)}},[Lr]),fo=reactExports.useCallback(()=>{getAnalytics().track(TrackingEvents.CLICK,{action:ClickEvents.DENY_WALLET_INTERACTION}),Dr(9)},[]),lo=reactExports.useCallback(async()=>{var $o;Lr(!0);const mo=Mr.current;try{if(!mo)throw new Error("Provider not created");const Xn=await mo.getSigner(),Fr=await mo.send(Gr.current.method,Gr.current.params);getAnalytics().track(TrackingEvents.CLICK,{action:ClickEvents.APPROVE_WALLET_INTERACTION,method:Gr.current.method});const Vr=await authServerFetch("outcome",{requestId:eo,sender:await Xn.getAddress(),result:Fr});if(Vr.error)throw new Error(Vr.error);Dr(11)}catch(Xn){console.error("Wallet error",JSON.stringify(Xn));const Fr=await(($o=Mr.current)==null?void 0:$o.getSigner());Fr&&(isRpcError(Xn)?await authServerFetch("outcome",{requestId:eo,sender:await Fr.getAddress(),error:Xn.error}):await authServerFetch("outcome",{requestId:eo,sender:await Fr.getAddress(),error:{code:999,message:isErrorWithMessage(Xn)?Xn.message:"Unknown error"}})),Qr(isErrorWithMessage(Xn)?Xn.message:"Unknown error"),Dr(10)}},[]),oo=reactExports.useCallback(async mo=>{mo.preventDefault(),await dist$7.connection.disconnect(),io()},[]),po=reactExports.useCallback(mo=>jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("div",{className:`${styles$a.background} ${(!ga||jr===null)&&Nr!==2?styles$a.emptyProfile:""}`}),jsxRuntimeExports.jsxs("div",{className:styles$a.main,children:[jsxRuntimeExports.jsxs("div",{className:styles$a.left,children:[mo.children,mo.canChangeAccount?jsxRuntimeExports.jsxs("div",{className:styles$a.changeAccount,children:["Use another profile?"," ",jsxRuntimeExports.jsx("a",{href:"/auth/login",onClick:oo,children:"Return to log in"})]}):null]}),jsxRuntimeExports.jsx("div",{className:`${styles$a.right} ${_i?styles$a.loading:""}`,children:ga.current&&jr!==null?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("img",{src:manDefault,alt:"Avatar",className:styles$a.wearableDefaultImg}),jsxRuntimeExports.jsx(WearablePreview_2,{lockBeta:!0,panning:!1,disableBackground:!0,profile:ga.current,dev:!1,onUpdate:so}),jsxRuntimeExports.jsx("img",{src:platformImg,alt:"platform",className:styles$a.wearablePlatform})]}):null}),jsxRuntimeExports.jsx(CommunityBubble$3.CommunityBubble,{className:styles$a.communityBubble})]})]}),[_i,Nr]);return Nr===0?jsxRuntimeExports.jsxs(po,{children:[jsxRuntimeExports.jsx("div",{className:styles$a.errorLogo}),jsxRuntimeExports.jsx("div",{className:styles$a.title,children:"Looks like you took too long and the request has expired"}),jsxRuntimeExports.jsx("div",{className:styles$a.description,children:"Please return to Decentraland's Desktop App to try again."}),jsxRuntimeExports.jsx(CloseWindow,{})]}):Nr===1?jsxRuntimeExports.jsxs(po,{canChangeAccount:!0,children:[jsxRuntimeExports.jsx("div",{className:styles$a.errorLogo}),jsxRuntimeExports.jsx("div",{className:styles$a.title,children:"Looks like you are connected with a different account."}),jsxRuntimeExports.jsx("div",{className:styles$a.description,children:"Please change your wallet account to the one connected to the Desktop App."})]}):Nr===2?jsxRuntimeExports.jsx(po,{children:jsxRuntimeExports.jsx("div",{className:styles$a.left,children:jsxRuntimeExports.jsx(Loader_3,{active:!0,size:"huge"})})}):Nr===3?jsxRuntimeExports.jsxs(po,{children:[jsxRuntimeExports.jsx("div",{className:styles$a.errorLogo}),jsxRuntimeExports.jsx("div",{className:styles$a.title,children:"There was an error recovering the request..."}),jsxRuntimeExports.jsx("div",{className:styles$a.description,children:"The request is not available anymore. Feel free to create a new one and try again."}),jsxRuntimeExports.jsx(CloseWindow,{}),jsxRuntimeExports.jsx("div",{className:styles$a.errorMessage,children:Yr})]}):Nr===4&&Gr.current?jsxRuntimeExports.jsxs(po,{canChangeAccount:!0,isLoading:Br,children:[jsxRuntimeExports.jsx("div",{className:styles$a.logo}),jsxRuntimeExports.jsx("div",{className:styles$a.title,children:"Verify Sign In"}),jsxRuntimeExports.jsx("div",{className:styles$a.description,children:"Do you see the same verification number on your Desktop App?"}),jsxRuntimeExports.jsx("div",{className:styles$a.code,children:Gr.current.code}),jsxRuntimeExports.jsxs("div",{className:styles$a.buttons,children:[jsxRuntimeExports.jsxs(Button$5.Button,{inverted:!0,disabled:Br,onClick:no,className:styles$a.noButton,children:[jsxRuntimeExports.jsx(default_1,{name:"times circle"}),"No, it doesn't"]}),jsxRuntimeExports.jsxs(Button$5.Button,{inverted:!0,loading:Br,disabled:Br,onClick:ao,className:styles$a.yesButton,children:[jsxRuntimeExports.jsx(default_1,{name:"check circle"}),"Yes, they are the same"]})]})]}):Nr===5?jsxRuntimeExports.jsxs(po,{canChangeAccount:!0,children:[jsxRuntimeExports.jsx("div",{className:styles$a.errorLogo}),jsxRuntimeExports.jsx("div",{className:styles$a.title,children:"Did the number not match, or was this action not taken by you?"}),jsxRuntimeExports.jsx("div",{className:styles$a.description,children:"If you're trying to sign in, retry the action. If this action was not initiated by you, dismiss this message."}),jsxRuntimeExports.jsx(CloseWindow,{})]}):Nr===7?jsxRuntimeExports.jsxs(po,{children:[jsxRuntimeExports.jsx("div",{className:styles$a.logo}),jsxRuntimeExports.jsx("div",{className:styles$a.title,children:"Your account is ready!"}),jsxRuntimeExports.jsx("div",{className:styles$a.description,children:"Return to the Desktop App and enjoy Decentraland."}),jsxRuntimeExports.jsx(CloseWindow,{})]}):Nr===8&&Gr.current?jsxRuntimeExports.jsxs(po,{canChangeAccount:!0,isLoading:Br,children:[jsxRuntimeExports.jsx("div",{className:styles$a.logo}),jsxRuntimeExports.jsx("div",{className:styles$a.title,children:"The Desktop App wants to interact with your wallet."}),jsxRuntimeExports.jsx("div",{className:styles$a.description,children:"Review the following data carefully on your wallet before approving it."}),jsxRuntimeExports.jsxs("div",{className:styles$a.buttons,children:[jsxRuntimeExports.jsx(Button$5.Button,{inverted:!0,disabled:Br,onClick:fo,children:"Deny"}),jsxRuntimeExports.jsx(Button$5.Button,{primary:!0,disabled:Br,loading:Br,onClick:lo,children:"Allow"})]})]}):Nr===9?jsxRuntimeExports.jsxs(po,{children:[jsxRuntimeExports.jsx("div",{className:styles$a.errorLogo}),jsxRuntimeExports.jsx("div",{className:styles$a.title,children:"Was this action not initiated by you?"}),jsxRuntimeExports.jsx("div",{className:styles$a.description,children:"If this action was not initiated by you, dismiss this message."}),jsxRuntimeExports.jsx(CloseWindow,{})]}):Nr===11?jsxRuntimeExports.jsxs(po,{children:[jsxRuntimeExports.jsx("div",{className:styles$a.logo}),jsxRuntimeExports.jsx("div",{className:styles$a.title,children:"Wallet interaction complete"}),jsxRuntimeExports.jsx("div",{className:styles$a.description,children:"The action has been executed successfully."}),jsxRuntimeExports.jsx(CloseWindow,{})]}):Nr===6||Nr===10?jsxRuntimeExports.jsxs(po,{children:[jsxRuntimeExports.jsx("div",{className:styles$a.errorLogo}),jsxRuntimeExports.jsx("div",{className:styles$a.title,children:"There was an error while trying to submit the request."}),jsxRuntimeExports.jsx("div",{className:styles$a.description,children:"Return to the Desktop App to try again, or contact support if the error persists."}),jsxRuntimeExports.jsx(CloseWindow,{}),jsxRuntimeExports.jsx("div",{className:styles$a.errorMessage,children:Yr})]}):null},CloseWindow=()=>jsxRuntimeExports.jsx("div",{className:styles$a.closeWindow,children:"You can close this window."}),authServerFetch=async($r,pr)=>{const Mr=config.get("AUTH_SERVER_URL"),Nr=lookup(Mr);await new Promise(Br=>{Nr.on("connect",Br)});const Dr=await Nr.emitWithAck($r,pr);if(Nr.close(),Dr.error)throw new Error(Dr.error);return Dr};var dist$4={},SingleSignOn={},isURL={exports:{}},assertString={exports:{}};(function($r,pr){Object.defineProperty(pr,"__esModule",{value:!0}),pr.default=Nr;function Mr(Dr){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Mr=function(Lr){return typeof Lr}:Mr=function(Lr){return Lr&&typeof Symbol=="function"&&Lr.constructor===Symbol&&Lr!==Symbol.prototype?"symbol":typeof Lr},Mr(Dr)}function Nr(Dr){var Br=typeof Dr=="string"||Dr instanceof String;if(!Br){var Lr=Mr(Dr);throw Dr===null?Lr="null":Lr==="object"&&(Lr=Dr.constructor.name),new TypeError("Expected a string but received a ".concat(Lr))}}$r.exports=pr.default,$r.exports.default=pr.default})(assertString,assertString.exports);var assertStringExports=assertString.exports,isFQDN={exports:{}},merge={exports:{}};(function($r,pr){Object.defineProperty(pr,"__esModule",{value:!0}),pr.default=Mr;function Mr(){var Nr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Dr=arguments.length>1?arguments[1]:void 0;for(var Br in Dr)typeof Nr[Br]>"u"&&(Nr[Br]=Dr[Br]);return Nr}$r.exports=pr.default,$r.exports.default=pr.default})(merge,merge.exports);var mergeExports=merge.exports;(function($r,pr){Object.defineProperty(pr,"__esModule",{value:!0}),pr.default=Lr;var Mr=Dr(assertStringExports),Nr=Dr(mergeExports);function Dr(jr){return jr&&jr.__esModule?jr:{default:jr}}var Br={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};function Lr(jr,Ur){(0,Mr.default)(jr),Ur=(0,Nr.default)(Ur,Br),Ur.allow_trailing_dot&&jr[jr.length-1]==="."&&(jr=jr.substring(0,jr.length-1)),Ur.allow_wildcard===!0&&jr.indexOf("*.")===0&&(jr=jr.substring(2));var Gr=jr.split("."),Yr=Gr[Gr.length-1];return Ur.require_tld&&(Gr.length<2||!Ur.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(Yr)||/\s/.test(Yr))||!Ur.allow_numeric_tld&&/^\d+$/.test(Yr)?!1:Gr.every(function(Qr){return!(Qr.length>63&&!Ur.ignore_max_length||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(Qr)||/[\uff01-\uff5e]/.test(Qr)||/^-|-$/.test(Qr)||!Ur.allow_underscores&&/_/.test(Qr))})}$r.exports=pr.default,$r.exports.default=pr.default})(isFQDN,isFQDN.exports);var isFQDNExports=isFQDN.exports,isIP={exports:{}};(function($r,pr){Object.defineProperty(pr,"__esModule",{value:!0}),pr.default=Gr;var Mr=Nr(assertStringExports);function Nr(Yr){return Yr&&Yr.__esModule?Yr:{default:Yr}}var Dr="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",Br="(".concat(Dr,"[.]){3}").concat(Dr),Lr=new RegExp("^".concat(Br,"$")),jr="(?:[0-9a-fA-F]{1,4})",Ur=new RegExp("^("+"(?:".concat(jr,":){7}(?:").concat(jr,"|:)|")+"(?:".concat(jr,":){6}(?:").concat(Br,"|:").concat(jr,"|:)|")+"(?:".concat(jr,":){5}(?::").concat(Br,"|(:").concat(jr,"){1,2}|:)|")+"(?:".concat(jr,":){4}(?:(:").concat(jr,"){0,1}:").concat(Br,"|(:").concat(jr,"){1,3}|:)|")+"(?:".concat(jr,":){3}(?:(:").concat(jr,"){0,2}:").concat(Br,"|(:").concat(jr,"){1,4}|:)|")+"(?:".concat(jr,":){2}(?:(:").concat(jr,"){0,3}:").concat(Br,"|(:").concat(jr,"){1,5}|:)|")+"(?:".concat(jr,":){1}(?:(:").concat(jr,"){0,4}:").concat(Br,"|(:").concat(jr,"){1,6}|:)|")+"(?::((?::".concat(jr,"){0,5}:").concat(Br,"|(?::").concat(jr,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");function Gr(Yr){var Qr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(0,Mr.default)(Yr),Qr=String(Qr),Qr?Qr==="4"?Lr.test(Yr):Qr==="6"?Ur.test(Yr):!1:Gr(Yr,4)||Gr(Yr,6)}$r.exports=pr.default,$r.exports.default=pr.default})(isIP,isIP.exports);var isIPExports=isIP.exports;(function($r,pr){Object.defineProperty(pr,"__esModule",{value:!0}),pr.default=io;var Mr=Lr(assertStringExports),Nr=Lr(isFQDNExports),Dr=Lr(isIPExports),Br=Lr(mergeExports);function Lr(no){return no&&no.__esModule?no:{default:no}}function jr(no,so){return Wn(no)||Qr(no,so)||Gr(no,so)||Ur()}function Ur(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
187
|
+
Received: \`${$r.received}\``)}function _r(){return new j(_$2.DuplicateIframe,"Duplicate iframes found.")}function yt(){return new j(_$2.SyncWeb3Method,"Non-async web3 methods are deprecated in web3 > 1.0 and are not supported by the Magic web3 provider. Please use an async method instead.")}function gt(){return new j(_$2.ReactNativeEndpointConfiguration,`CUSTOM DOMAINS ARE NOT SUPPORTED WHEN USING MAGIC SDK WITH REACT NATIVE! The \`endpoint\` parameter SHOULD NOT be provided. The Magic \`<iframe>\` is automatically wrapped by a WebView pointed at \`${m$1.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`)}function k($r){let{method:pr,removalVersions:Mr,useInstead:Nr}=$r,Dr=Mr[m$1.sdkName],Br=Nr?` Use \`${Nr}\` instead.`:"",Lr=`\`${pr}\` will be removed from \`${m$1.sdkName}\` in version \`${Dr}\`.${Br}`;return new j(_$2.DeprecationNotice,Lr)}function*Kn(){let $r=0;for(;;)$r<Number.MAX_SAFE_INTEGER?yield++$r:$r=0}var jn=Kn();function Ae(){return jn.next().value}var Rt=Symbol("Payload pre-processed by Magic SDK");function vt($r){return Object.defineProperty($r,Rt,{value:!0,enumerable:!1}),$r}function Bn($r){return!!$r[Rt]}function J($r){var pr,Mr,Nr;return Bn($r)||($r.jsonrpc=(pr=$r.jsonrpc)!=null?pr:"2.0",$r.id=Ae(),$r.method=(Mr=$r.method)!=null?Mr:"noop",$r.params=(Nr=$r.params)!=null?Nr:[],vt($r)),$r}function u$1($r,pr=[]){return vt({params:pr,method:$r,jsonrpc:"2.0",id:Ae()})}var W=class{constructor($r){$r instanceof W?(this._jsonrpc=$r.payload.jsonrpc,this._id=$r.payload.id,this._result=$r.payload.result,this._error=$r.payload.error):ct($r)?(this._jsonrpc=$r.jsonrpc,this._id=$r.id,this._result=$r.result,this._error=$r.error):(this._jsonrpc=$r.jsonrpc,this._id=$r.id,this._result=void 0,this._error=void 0)}applyError($r){return this._error=$r,this}applyResult($r){return this._result=$r,this}get hasError(){return typeof this._error<"u"&&this._error!==null}get hasResult(){return typeof this._result<"u"}get payload(){return{jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}},bt$1=Yt(It()),Ce=class extends bt$1.default{};function fe(){let $r=new Ce;return{emitter:$r,createChainingEmitterMethod:(pr,Mr)=>(...Nr)=>($r[pr].apply($r,Nr),Mr),createBoundEmitterMethod:pr=>(...Mr)=>$r[pr].apply($r,Mr)}}var wt=Symbol("isPromiEvent");function Pt($r){return!!$r[wt]}function V($r){let pr=Le($r),{createBoundEmitterMethod:Mr,createChainingEmitterMethod:Nr}=fe(),Dr=Symbol("Promise.then"),Br=Symbol("Promise.catch"),Lr=Symbol("Promise.finally"),jr=(Yr,Qr)=>(...Wn)=>{let ga=Qr[Yr].apply(Qr,Wn);return Ur(ga)},Ur=Yr=>Object.assign(Yr,{[wt]:!0,[Dr]:Yr[Dr]||Yr.then,[Br]:Yr[Br]||Yr.catch,[Lr]:Yr[Lr]||Yr.finally,then:jr(Dr,Yr),catch:jr(Br,Yr),finally:jr(Lr,Yr),on:Nr("on",Yr),once:Nr("once",Yr),addListener:Nr("addListener",Yr),off:Nr("off",Yr),removeListener:Nr("removeListener",Yr),removeAllListeners:Nr("removeAllListeners",Yr),emit:Mr("emit"),eventNames:Mr("eventNames"),listeners:Mr("listeners"),listenerCount:Mr("listenerCount")}),Gr=Ur(pr.then(Yr=>(Gr.emit("done",Yr),Gr.emit("settled"),Yr),Yr=>{throw Gr.emit("error",Yr),Gr.emit("settled"),Yr}));return Gr}function Le($r){return new Promise((pr,Mr)=>{let Nr=$r(pr,Mr);Promise.resolve(Nr).catch(Mr)})}var P=class{constructor($r){this.sdk=$r}get overlay(){return this.sdk.overlay}request($r){let pr=this.overlay.post(g$1.MAGIC_HANDLE_REQUEST,J($r)),Mr=V((Dr,Br)=>{pr.then(Lr=>{if(Nr(),Lr.hasError)Br(new O$1(Lr.payload.error));else if(Lr.hasResult)Dr(Lr.payload.result);else throw mt()}).catch(Lr=>{Nr(),Br(Lr)})}),Nr=this.overlay.on(u$2.MAGIC_HANDLE_EVENT,Dr=>{var Br;let{response:Lr}=Dr.data;if(Lr.id===$r.id&&((Br=Lr.result)!=null&&Br.event)){let{event:jr,params:Ur=[]}=Lr.result;Mr.emit(jr,...Ur)}});return Mr}createIntermediaryEvent($r,pr){return Mr=>{let Nr=u$1(l.IntermediaryEvent,[{payloadId:pr,eventType:$r,args:Mr}]);this.request(Nr)}}};function Mt($r,pr){let[Mr]=$r.split(".").map(Number);return Mr>=pr}var U$1={"magic-sdk":"v18.0.0","@magic-sdk/react-native":"v14.0.0","@magic-sdk/react-native-bare":"v19.0.0","@magic-sdk/react-native-expo":"v19.0.0"},ye=class extends P{loginWithMagicLink($r){let pr=m$1.sdkName==="@magic-sdk/react-native"||m$1.sdkName==="@magic-sdk/react-native-bare"||m$1.sdkName==="@magic-sdk/react-native-expo";if(pr&&Mt(m$1.version,19))throw new Error("loginWithMagicLink() is deprecated for this package, please utlize a passcode method like loginWithSMS or loginWithEmailOTP instead.");pr&&k({method:"auth.loginWithMagicLink()",removalVersions:U$1,useInstead:"auth.loginWithEmailOTP()"}).log();let{email:Mr,showUI:Nr=!0,redirectURI:Dr,overrides:Br}=$r,Lr=u$1(this.sdk.testMode?l.LoginWithMagicLinkTestMode:l.LoginWithMagicLink,[{email:Mr,showUI:Nr,redirectURI:Dr,overrides:Br}]);return this.request(Lr)}loginWithSMS($r){let{phoneNumber:pr}=$r,Mr=u$1(this.sdk.testMode?l.LoginWithSmsTestMode:l.LoginWithSms,[{phoneNumber:pr,showUI:!0}]);return this.request(Mr)}loginWithEmailOTP($r){let{email:pr,showUI:Mr,deviceCheckUI:Nr,overrides:Dr}=$r,Br=u$1(this.sdk.testMode?l.LoginWithEmailOTPTestMode:l.LoginWithEmailOTP,[{email:pr,showUI:Mr,deviceCheckUI:Nr,overrides:Dr}]),Lr=this.request(Br);return!Nr&&Lr&&Lr.on(T$1.Retry,()=>{this.createIntermediaryEvent(T$1.Retry,Br.id)()}),!Mr&&Lr&&(Lr.on(I$1.VerifyEmailOtp,jr=>{this.createIntermediaryEvent(I$1.VerifyEmailOtp,Br.id)(jr)}),Lr.on(I$1.Cancel,()=>{this.createIntermediaryEvent(I$1.Cancel,Br.id)()})),Lr}loginWithCredential($r){let pr=$r??"";if(!$r&&m$1.platform==="web"){pr=window.location.search;let Nr=window.location.origin+window.location.pathname;window.history.replaceState(null,"",Nr)}let Mr=u$1(this.sdk.testMode?l.LoginWithCredentialTestMode:l.LoginWithCredential,[pr]);return this.request(Mr)}setAuthorizationToken($r){let pr=u$1(l.SetAuthorizationToken,[{jwt:$r}]);return this.request(pr)}updateEmailWithUI($r){let{email:pr,showUI:Mr=!0}=$r,Nr=u$1(this.sdk.testMode?l.UpdateEmailTestMode:l.UpdateEmail,[{email:pr,showUI:Mr}]);return this.request(Nr)}},re={};Xt(re,{clear:()=>Zn,getItem:()=>y$1,iterate:()=>_e,key:()=>er,keys:()=>tr,length:()=>Qn,removeItem:()=>S,setItem:()=>x$1});var ge$1;function F($r){return(...pr)=>f$1(this,null,function*(){return ge$1||(ge$1=yield m$1.configureStorage()),yield ge$1.ready(),ge$1[$r](...pr)})}var y$1=F("getItem"),x$1=F("setItem"),S=F("removeItem"),Zn=F("clear"),Qn=F("length"),er=F("key"),tr=F("keys"),_e=F("iterate");function Nt(){let $r=window.crypto.getRandomValues(new Uint8Array(16));$r[6]=$r[6]&15|64,$r[8]=$r[8]&191|128;let pr="";return pr+=$r[0].toString(16),pr+=$r[1].toString(16),pr+=$r[2].toString(16),pr+=$r[3].toString(16),pr+="-",pr+=$r[4].toString(16),pr+=$r[5].toString(16),pr+="-",pr+=$r[6].toString(16),pr+=$r[7].toString(16),pr+="-",pr+=$r[8].toString(16),pr+=$r[9].toString(16),pr+="-",pr+=$r[10].toString(16),pr+=$r[11].toString(16),pr+=$r[12].toString(16),pr+=$r[13].toString(16),pr+=$r[14].toString(16),pr+=$r[15].toString(16),pr}var Oe="STORE_KEY_PRIVATE_KEY",Re="STORE_KEY_PUBLIC_JWK",At="ECDSA",nr="P-256",rr$1={name:At,namedCurve:nr};function se$1(){let $r=typeof window<"u"&&!!window.crypto,pr=$r&&!!window.crypto.subtle;return $r&&pr}function St(){return f$1(this,null,function*(){let $r=yield sr();if(!$r){console.info("unable to create public key or webcrypto is unsupported");return}let{subtle:pr}=window.crypto,Mr=yield y$1(Oe);if(!Mr||!pr){console.info("unable to find private key or webcrypto unsupported");return}let Nr={iat:Math.floor(new Date().getTime()/1e3),jti:Nt()},Dr={typ:"dpop+jwt",alg:"ES256",jwk:$r},Br={protected:$t(JSON.stringify(Dr)),claims:$t(JSON.stringify(Nr))},Lr=ir(`${Br.protected}.${Br.claims}`),jr={name:At,hash:{name:"SHA-256"}},Ur=cr(new Uint8Array(yield pr.sign(jr,Mr,Lr)));return`${Br.protected}.${Br.claims}.${Ur}`})}function sr(){return f$1(this,null,function*(){if(!se$1()){console.info("webcrypto is not supported");return}return(yield y$1(Re))||(yield or()),y$1(Re)})}function or(){return f$1(this,null,function*(){let{subtle:$r}=window.crypto,pr=yield $r.generateKey(rr$1,!1,["sign"]),Mr=yield $r.exportKey("jwk",pr.publicKey);yield x$1(Oe,pr.privateKey),yield x$1(Re,Mr)})}function $t($r){return Ct(ar($r))}function ir($r){return new TextEncoder().encode($r)}function Ct($r){return btoa($r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function ar($r){return encodeURIComponent($r).replace(/%([0-9A-F]{2})/g,(pr,Mr)=>String.fromCharCode(parseInt(Mr,16)))}function cr($r){let pr="";return $r.forEach(Mr=>{pr+=String.fromCharCode(Mr)}),Ct(pr)}var ke$1="ds",qe="ek",De="iv",We="AES-GCM",lr=256;function X(){return f$1(this,null,function*(){let $r=[];yield _e((pr,Mr,Nr)=>{Mr.startsWith(`${ke$1}_`)&&$r.push(Mr)});for(let pr of $r)yield S(pr)})}function Lt($r){let pr="",Mr=new Uint8Array($r),Nr=Mr.byteLength;for(let Dr=0;Dr<Nr;Dr++)pr+=String.fromCharCode(Mr[Dr]);return window.btoa(pr)}function _t($r){let pr=window.atob($r),Mr=pr.length,Nr=new Uint8Array(Mr);for(let Dr=0;Dr<Mr;Dr++)Nr[Dr]=pr.charCodeAt(Dr);return Nr.buffer}function dr(){return f$1(this,null,function*(){if(!se$1()){console.info("webcrypto is not supported");return}let{crypto:$r}=window;return(yield y$1(De))||$r.getRandomValues(new Uint8Array(12))})}function ur(){return f$1(this,null,function*(){if(!se$1()){console.info("webcrypto is not supported");return}let{subtle:$r}=window.crypto;return(yield y$1(qe))||(yield $r.generateKey({name:We,length:lr},!1,["encrypt","decrypt"]))})}function Ot($r,pr){return f$1(this,null,function*(){let Mr=yield dr(),Nr=yield ur();if(!Mr||!Nr||!$r)return;let Dr=_t($r),{subtle:Br}=window.crypto,Lr=yield Br.encrypt({name:We,iv:Mr},Nr,Dr),jr=Lt(Lr);yield x$1(`${ke$1}_${pr}`,jr),yield x$1(qe,Nr),yield x$1(De,Mr)})}function kt($r){return f$1(this,null,function*(){let pr=yield y$1(`${ke$1}_${$r}`),Mr=yield y$1(De),Nr=yield y$1(qe);if(!Mr||!pr||!Nr||!se$1())return;let{subtle:Dr}=window.crypto,Br=yield Dr.decrypt({name:We,iv:Mr},Nr,_t(pr));return Lt(Br)})}var ve$1=class extends P{constructor(){super(...arguments),this.localForageKey="mc_active_wallet"}getIdToken(pr){let Mr=u$1(this.sdk.testMode?l.GetIdTokenTestMode:l.GetIdToken,[pr]);return this.request(Mr)}generateIdToken(pr){let Mr=u$1(this.sdk.testMode?l.GenerateIdTokenTestMode:l.GenerateIdToken,[pr]);return this.request(Mr)}getInfo(){return f$1(this,null,function*(){let pr=yield y$1(this.localForageKey),Mr=u$1(l.GetInfo,[{walletType:pr}]);return this.request(Mr)})}isLoggedIn(){let pr=u$1(this.sdk.testMode?l.IsLoggedInTestMode:l.IsLoggedIn);return this.request(pr)}logout(){S(this.localForageKey),X();let pr=u$1(this.sdk.testMode?l.LogoutTestMode:l.Logout);return this.request(pr)}requestInfoWithUI(pr){let Mr=u$1(l.RequestUserInfoWithUI,pr?[pr]:[]);return this.request(Mr)}showSettings(pr){let Mr=u$1(this.sdk.testMode?l.UserSettingsTestMode:l.UserSettings,[pr]);return this.request(Mr)}recoverAccount(pr){let Mr=u$1(this.sdk.testMode?l.RecoverAccountTestMode:l.RecoverAccount,[pr]);return this.request(Mr)}getMetadata(){k({method:"user.getMetadata()",removalVersions:U$1,useInstead:"user.getInfo()"}).log();let pr=u$1(this.sdk.testMode?l.GetMetadataTestMode:l.GetMetadata);return this.request(pr)}updateEmail(pr){k({method:"user.updateEmail()",removalVersions:U$1,useInstead:"auth.updateEmailWithUI()"}).log();let{email:Mr,showUI:Nr=!0}=pr,Dr=u$1(this.sdk.testMode?l.UpdateEmailTestMode:l.UpdateEmail,[{email:Mr,showUI:Nr}]);return this.request(Dr)}};function Ue($r,pr){return pr?new URL($r,pr):new URL($r)}var Te$1=class extends P{constructor(){super(...arguments),this.localForageKey="mc_active_wallet"}connectWithUI(){let pr=V((Mr,Nr)=>f$1(this,null,function*(){try{if(this.isMetaMaskBrowser()&&(yield this.isWalletEnabled(p.MetaMask))){let Ur=yield this.autoConnectIfWalletBrowser(p.MetaMask);Mr(Ur);return}if(this.isCoinbaseWalletBrowser()&&(yield this.isWalletEnabled(p.CoinbaseWallet))){let Ur=yield this.autoConnectIfWalletBrowser(p.CoinbaseWallet);Mr(Ur);return}let Dr=this.getUserEnv(),Br=u$1(l.Login,[Dr]),Lr=this.request(Br);Lr.on(c.WalletSelected,Ur=>this.handleWalletSelected(ae(G({},Ur),{payloadId:Br.id}))),Lr.on("id-token-created",Ur=>{pr.emit("id-token-created",Ur)});let jr=yield Lr;jr.error&&Nr(jr),Mr(jr)}catch(Dr){Nr(Dr)}}));return pr}showUI(){return this.request(u$1(l.ShowUI))}showAddress(){return this.request(u$1(l.ShowAddress))}showSendTokensUI(){return this.request(u$1(l.ShowSendTokensUI))}showOnRamp(){return this.request(u$1(l.ShowOnRamp))}showNFTs(){return this.request(u$1(l.ShowNFTs))}showBalances(){return this.request(u$1(l.ShowBalances))}sendGaslessTransaction(pr,Mr){return this.request(u$1(l.SendGaslessTransaction,[pr,Mr]))}getInfo(){return f$1(this,null,function*(){k({method:"wallet.getInfo()",removalVersions:U$1,useInstead:"user.getInfo()"}).log();let pr=yield y$1(this.localForageKey),Mr=u$1(l.GetInfo,[{walletType:pr}]);return this.request(Mr)})}disconnect(){k({method:"wallet.disconnect()",removalVersions:U$1,useInstead:"user.logout()"}).log(),S(this.localForageKey),X();let pr=u$1(l.Disconnect);return this.request(pr)}requestUserInfoWithUI(pr){k({method:"wallet.requestUserInfoWithUI()",removalVersions:U$1,useInstead:"user.requestUserInfoWithUI()"}).log();let Mr=u$1(l.RequestUserInfoWithUI,pr?[pr]:[]);return this.request(Mr)}getProvider(){return f$1(this,null,function*(){switch(yield y$1(this.localForageKey)){case p.MetaMask:return this.getMetaMaskProvider();case p.CoinbaseWallet:return this.getCoinbaseProvider();default:return this.sdk.rpcProvider}})}isMetaMaskInstalled(){var pr,Mr,Nr;return((pr=window.ethereum)==null?void 0:pr.isMetaMask)||!!((Nr=(Mr=window.ethereum)==null?void 0:Mr.providers)!=null&&Nr.find(Dr=>Dr==null?void 0:Dr.isMetaMask))}isMetaMaskBrowser(){return this.isMobile()&&this.isMetaMaskInstalled()}getMetaMaskProvider(){var pr,Mr;return((Mr=(pr=window.ethereum)==null?void 0:pr.providers)==null?void 0:Mr.find(Nr=>Nr==null?void 0:Nr.isMetaMask))||window.ethereum}connectToMetaMask(){if(this.isMobile()&&!this.isMetaMaskInstalled()){let pr=`https://metamask.app.link/dapp/${window.location.href.replace(/(^\w+:|^)\/\//,"")}`;window.location.href=pr}return this.getMetaMaskProvider().request({method:"eth_requestAccounts"})}isCoinbaseWalletInstalled(){var pr,Mr,Nr;return((pr=window.ethereum)==null?void 0:pr.isCoinbaseWallet)||!!((Nr=(Mr=window.ethereum)==null?void 0:Mr.providers)!=null&&Nr.find(Dr=>Dr==null?void 0:Dr.isCoinbaseWallet))}isCoinbaseWalletBrowser(){var pr;return!!((pr=window.ethereum)!=null&&pr.isCoinbaseBrowser)}getCoinbaseProvider(){var pr,Mr;return((Mr=(pr=window.ethereum)==null?void 0:pr.providers)==null?void 0:Mr.find(Nr=>Nr==null?void 0:Nr.isCoinbaseWallet))||window.ethereum}connectToCoinbaseWallet(){if(this.isMobile()&&!this.isCoinbaseWalletBrowser()){let pr=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(window.location.href)}`;window.location.href=pr}return this.getCoinbaseProvider().request({method:"eth_requestAccounts"})}isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Silk|Opera Mini/i.test(navigator.userAgent)}getUserEnv(){return{env:{isMetaMaskInstalled:this.isMetaMaskInstalled(),isCoinbaseWalletInstalled:this.isCoinbaseWalletInstalled()}}}connectToThirdPartyWallet(pr){switch(pr){case p.MetaMask:return this.connectToMetaMask();case p.CoinbaseWallet:return this.connectToCoinbaseWallet();default:throw new Error(`Invalid provider: ${pr}. Must be one of "metamask" or "coinbase_wallet".`)}}isWalletEnabled(pr){let Mr=u$1("mc_is_wallet_enabled",[{wallet:pr}]);return this.request(Mr)}handleWalletSelected(pr){return f$1(this,null,function*(){try{let Mr=yield this.connectToThirdPartyWallet(pr.wallet);yield x$1(this.localForageKey,pr.wallet),this.createIntermediaryEvent(c.WalletConnected,pr.payloadId)(Mr)}catch(Mr){console.error(Mr),this.createIntermediaryEvent(c.WalletRejected,pr.payloadId)()}})}autoConnectIfWalletBrowser(pr){return f$1(this,null,function*(){let Mr;pr===p.MetaMask&&(Mr=yield this.getMetaMaskProvider().request({method:"eth_requestAccounts"})),pr===p.CoinbaseWallet&&(Mr=yield this.getCoinbaseProvider().request({method:"eth_requestAccounts"})),yield x$1(this.localForageKey,pr);let Nr=u$1(l.AutoConnect,[{wallet:pr,address:Mr}]);return this.request(Nr)})}},{createBoundEmitterMethod:Ie,createChainingEmitterMethod:z}=fe(),be=class extends P{constructor(){super(...arguments),this.isMagic=!0,this.on=z("on",this),this.once=z("once",this),this.addListener=z("addListener",this),this.off=z("off",this),this.removeListener=z("removeListener",this),this.removeAllListeners=z("removeAllListeners",this),this.emit=Ie("emit"),this.eventNames=Ie("eventNames"),this.listeners=Ie("listeners"),this.listenerCount=Ie("listenerCount")}sendAsync($r,pr){if(!pr)throw Et({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:pr===null?"null":typeof pr});if(Array.isArray($r))this.overlay.post(g$1.MAGIC_HANDLE_REQUEST,$r.map(Mr=>{let Nr=J(Mr);return this.prefixPayloadMethodForTestMode(Nr),Nr})).then(Mr=>{pr(null,Mr.map(Nr=>ae(G({},Nr.payload),{error:Nr.hasError?new O$1(Nr.payload.error):null})))});else{let Mr=J($r);this.prefixPayloadMethodForTestMode(Mr),this.overlay.post(g$1.MAGIC_HANDLE_REQUEST,Mr).then(Nr=>{pr(Nr.hasError?new O$1(Nr.payload.error):null,Nr.payload)})}}send($r,pr){if(typeof $r=="string"){let Nr=u$1($r,Array.isArray(pr)?pr:[]);return this.request(Nr)}if(Array.isArray($r)||pr){this.sendAsync($r,pr);return}let Mr=yt();return Mr.log(),new W($r).applyError({code:-32603,message:Mr.rawMessage}).payload}enable(){let $r=u$1(l.Login);return this.request($r)}request($r){return this.prefixPayloadMethodForTestMode($r),super.request($r)}prefixPayloadMethodForTestMode($r){let pr="testMode/eth/";this.sdk.testMode&&($r.method=`${pr}${$r.method}`)}},Dt=["request","overlay","sdk"];function mr($r){let pr=Object.getPrototypeOf($r),Mr=[pr];for(;pr!==P.prototype;)pr=Object.getPrototypeOf(pr),Mr.push(pr);return Mr}var we=class extends P{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:V,isPromiEvent:Pt,encodeJSON:ue,decodeJSON:at$1,createJsonRpcRequestPayload:u$1,standardizeJsonRpcRequestPayload:J,storage:re};let $r=[this,...mr(this)];Dt.forEach(pr=>{let Mr=$r.map(Lr=>Object.getOwnPropertyDescriptor(Lr,pr)),Nr=Mr.findIndex(Lr=>!!Lr),Dr=Nr>0,Br=Mr[Nr];Br&&(this.__sdk_access_field_descriptors__.set(pr,{descriptor:Br,isPrototypeField:Dr}),Object.defineProperty(this,pr,{configurable:!0,get:()=>{throw ht(pr)}}))})}init($r){this.__is_initialized__||(Dt.forEach(pr=>{if(this.__sdk_access_field_descriptors__.has(pr)){let{descriptor:Mr,isPrototypeField:Nr}=this.__sdk_access_field_descriptors__.get(pr);Nr?delete this[pr]:Object.defineProperty(this,pr,Mr)}}),this.sdk=$r,this.__is_initialized__=!0)}createDeprecationWarning($r){let{method:pr,removalVersion:Mr,useInstead:Nr}=$r,Dr=Nr?` Use \`${Nr}\` instead.`:"",Br=`\`${pr}\` will be removed from this Extension in version \`${Mr}\`.${Dr}`;return new te(this,"DEPRECATION_NOTICE",Br)}createWarning($r,pr){return new te(this,$r,pr)}createError($r,pr,Mr){return new B(this,$r,pr,Mr)}},Je$1=class extends we{},q=class extends we{};q.Internal=Je$1,q.Anonymous="anonymous extension";var Pe=class extends P{purchase($r){let pr=u$1(l.NFTPurchase,[$r]);return this.request(pr)}checkout($r){let pr=u$1(l.NFTCheckout,[$r]);return this.request(pr)}transfer($r){let pr=u$1(l.NFTTransfer,[$r]);return this.request(pr)}};function Wt($r){return $r.compat&&$r.compat[m$1.sdkName]!=null?typeof $r.compat[m$1.sdkName]=="string"?ot(it(m$1.version),$r.compat[m$1.sdkName]):!!$r.compat[m$1.sdkName]:!0}function hr($r,pr,Mr){return!pr&&!Mr?`${$r}_eth_mainnet`:Mr?`${$r}_${JSON.stringify(Mr)}`:pr?typeof pr=="string"?`${$r}_eth_${pr}`:`${$r}_${pr.rpcUrl}_${pr.chainId}_${pr.chainType}`:`${$r}_unknown`}function fr($r){var pr;let Mr=(pr=$r==null?void 0:$r.extensions)!=null?pr:[],Nr={},Dr=[];if(Array.isArray(Mr)?Mr.forEach(Br=>{Wt(Br)?(Br.init(this),(Br.name||Br.name!==q.Anonymous)&&(this[Br.name]=Br),Br instanceof q.Internal&&(ee(Br.config)||(Nr[Br.name]=Br.config))):Dr.push(Br)}):Object.keys(Mr).forEach(Br=>{if(Wt(Mr[Br])){Mr[Br].init(this);let Lr=Mr[Br];this[Br]=Lr,Lr instanceof q.Internal&&(ee(Lr.config)||(Nr[Mr[Br].name]=Lr.config))}else Dr.push(Mr[Br])}),Dr.length)throw ft$1(Dr);return Nr}var oe=class{constructor($r,pr){this.apiKey=$r;var Mr;if(!$r)throw ut$1();m$1.platform==="react-native"&&(pr!=null&&pr.endpoint)&>().log();let{defaultEndpoint:Nr,version:Dr}=m$1;this.testMode=!!(pr!=null&&pr.testMode),this.endpoint=Ue((Mr=pr==null?void 0:pr.endpoint)!=null?Mr:Nr).origin,this.auth=new ye(this),this.user=new ve$1(this),this.wallet=new Te$1(this),this.nft=new Pe(this),this.rpcProvider=new be(this);let Br=fr.call(this,pr);this.parameters=ue(G({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:pr==null?void 0:pr.network,host:Ue(this.endpoint).host,sdk:dt[m$1.sdkName],version:Dr,ext:ee(Br)?void 0:Br,locale:(pr==null?void 0:pr.locale)||"en_US"},m$1.bundleId?{bundleId:m$1.bundleId}:{})),this.networkHash=hr(this.apiKey,pr==null?void 0:pr.network,ee(Br)?void 0:Br),pr!=null&&pr.deferPreload||this.preload()}get overlay(){if(!oe.__overlays__.has(this.parameters)){let $r=new m$1.ViewController(this.endpoint,this.parameters,this.networkHash);$r.init(),oe.__overlays__.set(this.parameters,$r)}return oe.__overlays__.get(this.parameters)}preload(){return f$1(this,null,function*(){yield this.overlay.checkIsReadyForRequest})}},Me=oe;Me.__overlays__=new Map;function Er($r,pr){return pr&&Array.isArray($r)?$r.find(Mr=>Mr.id===pr):$r}function yr($r,pr){var Mr;let Nr=(Mr=pr.data.response)==null?void 0:Mr.id,Dr=Er($r,Nr);if(Nr&&Dr){let Br=new W(Dr).applyResult(pr.data.response.result).applyError(pr.data.response.error);return{id:Nr,response:Br}}return{}}function gr($r,pr,Mr){return f$1(this,null,function*(){var Nr;let Dr=yield y$1("rt"),Br;if(m$1.platform==="web")try{Br=(Nr=yield y$1("jwt"))!=null?Nr:yield St()}catch(Ur){console.error("webcrypto error",Ur)}let Lr={msgType:$r,payload:pr};Br&&(Lr.jwt=Br),Br&&Dr&&(Lr.rt=Dr);let jr=yield kt(Mr);return jr&&(Lr.deviceShare=jr),Lr})}function Rr($r){return f$1(this,null,function*(){!$r.data.rt||(yield x$1("rt",$r.data.rt))})}var Ke=class{constructor($r,pr,Mr){this.endpoint=$r,this.parameters=pr,this.networkHash=Mr,this.messageHandlers=new Set,this.isConnectedToInternet=!0,this.checkIsReadyForRequest=this.waitForReady(),this.isReadyForRequest=!1,this.listen()}post($r,pr){return f$1(this,null,function*(){return Le((Mr,Nr)=>f$1(this,null,function*(){if(!this.isConnectedToInternet){let Gr=pt();Nr(Gr)}this.isReadyForRequest||(yield this.waitForReady());let Dr=[],Br=Array.isArray(pr)?pr.map(Gr=>Gr.id):[],Lr=yield gr(`${$r}-${this.parameters}`,pr,this.networkHash);yield this._post(Lr);let jr=Gr=>Yr=>{var Qr;let{id:Wn,response:ga}=yr(pr,Yr);if(Rr(Yr),((Qr=ga==null?void 0:ga.payload.error)==null?void 0:Qr.message)==="User denied account access.")X();else if(Yr.data.deviceShare){let{deviceShare:eo}=Yr.data;Ot(eo,this.networkHash)}Wn&&ga&&Array.isArray(pr)&&Br.includes(Wn)?(Dr.push(ga),Dr.length===pr.length&&(Gr(),Mr(Dr))):Wn&&ga&&!Array.isArray(pr)&&Wn===pr.id&&(Gr(),Mr(ga))},Ur=this.on(u$2.MAGIC_HANDLE_RESPONSE,jr(()=>Ur()))}))})}on($r,pr){let Mr=pr.bind(window),Nr=Dr=>{Dr.data.msgType===`${$r}-${this.parameters}`&&Mr(Dr)};return this.messageHandlers.add(Nr),()=>this.messageHandlers.delete(Nr)}waitForReady(){return new Promise($r=>{let pr=this.on(u$2.MAGIC_OVERLAY_READY,()=>{this.isReadyForRequest=!0,$r(),pr()})})}listen(){this.on(u$2.MAGIC_HIDE_OVERLAY,()=>{this.hideOverlay()}),this.on(u$2.MAGIC_SHOW_OVERLAY,()=>{this.showOverlay()})}},Zr=Object.create,Je=Object.defineProperty,qr=Object.getOwnPropertyDescriptor,kr=Object.getOwnPropertyNames,et=Object.getPrototypeOf,rt=Object.prototype.hasOwnProperty,ve=($r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy($r,{get:(pr,Mr)=>(typeof require<"u"?require:pr)[Mr]}):$r)(function($r){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+$r+'" is not supported')}),$e=($r,pr)=>()=>(pr||$r((pr={exports:{}}).exports,pr),pr.exports),tt=($r,pr,Mr,Nr)=>{if(pr&&typeof pr=="object"||typeof pr=="function")for(let Dr of kr(pr))!rt.call($r,Dr)&&Dr!==Mr&&Je($r,Dr,{get:()=>pr[Dr],enumerable:!(Nr=qr(pr,Dr))||Nr.enumerable});return $r},Ze=($r,pr,Mr)=>(Mr=$r!=null?Zr(et($r)):{},tt(pr||!$r||!$r.__esModule?Je(Mr,"default",{value:$r,enumerable:!0}):Mr,$r)),se=($r,pr,Mr)=>new Promise((Nr,Dr)=>{var Br=Ur=>{try{jr(Mr.next(Ur))}catch(Gr){Dr(Gr)}},Lr=Ur=>{try{jr(Mr.throw(Ur))}catch(Gr){Dr(Gr)}},jr=Ur=>Ur.done?Nr(Ur.value):Promise.resolve(Ur.value).then(Br,Lr);jr((Mr=Mr.apply($r,pr)).next())}),ke=$e(($r,pr)=>{(function(Mr){if(typeof $r=="object"&&typeof pr<"u")pr.exports=Mr();else if(typeof define=="function"&&define.amd)define([],Mr);else{var Nr;typeof window<"u"?Nr=window:typeof global$1<"u"?Nr=global$1:typeof self<"u"?Nr=self:Nr=this,Nr.localforage=Mr()}})(function(){return function Mr(Nr,Dr,Br){function Lr(Gr,Yr){if(!Dr[Gr]){if(!Nr[Gr]){var Qr=typeof ve=="function"&&ve;if(!Yr&&Qr)return Qr(Gr,!0);if(jr)return jr(Gr,!0);var Wn=new Error("Cannot find module '"+Gr+"'");throw Wn.code="MODULE_NOT_FOUND",Wn}var ga=Dr[Gr]={exports:{}};Nr[Gr][0].call(ga.exports,function(eo){var _i=Nr[Gr][1][eo];return Lr(_i||eo)},ga,ga.exports,Mr,Nr,Dr,Br)}return Dr[Gr].exports}for(var jr=typeof ve=="function"&&ve,Ur=0;Ur<Br.length;Ur++)Lr(Br[Ur]);return Lr}({1:[function(Mr,Nr,Dr){(function(Br){var Lr=Br.MutationObserver||Br.WebKitMutationObserver,jr;if(Lr){var Ur=0,Gr=new Lr(eo),Yr=Br.document.createTextNode("");Gr.observe(Yr,{characterData:!0}),jr=function(){Yr.data=Ur=++Ur%2}}else if(!Br.setImmediate&&typeof Br.MessageChannel<"u"){var Qr=new Br.MessageChannel;Qr.port1.onmessage=eo,jr=function(){Qr.port2.postMessage(0)}}else"document"in Br&&"onreadystatechange"in Br.document.createElement("script")?jr=function(){var va=Br.document.createElement("script");va.onreadystatechange=function(){eo(),va.onreadystatechange=null,va.parentNode.removeChild(va),va=null},Br.document.documentElement.appendChild(va)}:jr=function(){setTimeout(eo,0)};var Wn,ga=[];function eo(){Wn=!0;for(var va,io,no=ga.length;no;){for(io=ga,ga=[],va=-1;++va<no;)io[va]();no=ga.length}Wn=!1}Nr.exports=_i;function _i(va){ga.push(va)===1&&!Wn&&jr()}}).call(this,typeof global$1<"u"?global$1:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(Mr,Nr,Dr){var Br=Mr(1);function Lr(){}var jr={},Ur=["REJECTED"],Gr=["FULFILLED"],Yr=["PENDING"];Nr.exports=Qr;function Qr(fo){if(typeof fo!="function")throw new TypeError("resolver must be a function");this.state=Yr,this.queue=[],this.outcome=void 0,fo!==Lr&&_i(this,fo)}Qr.prototype.catch=function(fo){return this.then(null,fo)},Qr.prototype.then=function(fo,lo){if(typeof fo!="function"&&this.state===Gr||typeof lo!="function"&&this.state===Ur)return this;var oo=new this.constructor(Lr);if(this.state!==Yr){var po=this.state===Gr?fo:lo;ga(oo,po,this.outcome)}else this.queue.push(new Wn(oo,fo,lo));return oo};function Wn(fo,lo,oo){this.promise=fo,typeof lo=="function"&&(this.onFulfilled=lo,this.callFulfilled=this.otherCallFulfilled),typeof oo=="function"&&(this.onRejected=oo,this.callRejected=this.otherCallRejected)}Wn.prototype.callFulfilled=function(fo){jr.resolve(this.promise,fo)},Wn.prototype.otherCallFulfilled=function(fo){ga(this.promise,this.onFulfilled,fo)},Wn.prototype.callRejected=function(fo){jr.reject(this.promise,fo)},Wn.prototype.otherCallRejected=function(fo){ga(this.promise,this.onRejected,fo)};function ga(fo,lo,oo){Br(function(){var po;try{po=lo(oo)}catch(mo){return jr.reject(fo,mo)}po===fo?jr.reject(fo,new TypeError("Cannot resolve promise with itself")):jr.resolve(fo,po)})}jr.resolve=function(fo,lo){var oo=va(eo,lo);if(oo.status==="error")return jr.reject(fo,oo.value);var po=oo.value;if(po)_i(fo,po);else{fo.state=Gr,fo.outcome=lo;for(var mo=-1,$o=fo.queue.length;++mo<$o;)fo.queue[mo].callFulfilled(lo)}return fo},jr.reject=function(fo,lo){fo.state=Ur,fo.outcome=lo;for(var oo=-1,po=fo.queue.length;++oo<po;)fo.queue[oo].callRejected(lo);return fo};function eo(fo){var lo=fo&&fo.then;if(fo&&(typeof fo=="object"||typeof fo=="function")&&typeof lo=="function")return function(){lo.apply(fo,arguments)}}function _i(fo,lo){var oo=!1;function po(Fr){oo||(oo=!0,jr.reject(fo,Fr))}function mo(Fr){oo||(oo=!0,jr.resolve(fo,Fr))}function $o(){lo(mo,po)}var Xn=va($o);Xn.status==="error"&&po(Xn.value)}function va(fo,lo){var oo={};try{oo.value=fo(lo),oo.status="success"}catch(po){oo.status="error",oo.value=po}return oo}Qr.resolve=io;function io(fo){return fo instanceof this?fo:jr.resolve(new this(Lr),fo)}Qr.reject=no;function no(fo){var lo=new this(Lr);return jr.reject(lo,fo)}Qr.all=so;function so(fo){var lo=this;if(Object.prototype.toString.call(fo)!=="[object Array]")return this.reject(new TypeError("must be an array"));var oo=fo.length,po=!1;if(!oo)return this.resolve([]);for(var mo=new Array(oo),$o=0,Xn=-1,Fr=new this(Lr);++Xn<oo;)Vr(fo[Xn],Xn);return Fr;function Vr(Wr,Jr){lo.resolve(Wr).then(Gn,function(to){po||(po=!0,jr.reject(Fr,to))});function Gn(to){mo[Jr]=to,++$o===oo&&!po&&(po=!0,jr.resolve(Fr,mo))}}}Qr.race=ao;function ao(fo){var lo=this;if(Object.prototype.toString.call(fo)!=="[object Array]")return this.reject(new TypeError("must be an array"));var oo=fo.length,po=!1;if(!oo)return this.resolve([]);for(var mo=-1,$o=new this(Lr);++mo<oo;)Xn(fo[mo]);return $o;function Xn(Fr){lo.resolve(Fr).then(function(Vr){po||(po=!0,jr.resolve($o,Vr))},function(Vr){po||(po=!0,jr.reject($o,Vr))})}}},{1:1}],3:[function(Mr,Nr,Dr){(function(Br){typeof Br.Promise!="function"&&(Br.Promise=Mr(2))}).call(this,typeof global$1<"u"?global$1:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(Mr,Nr,Dr){var Br=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Ko){return typeof Ko}:function(Ko){return Ko&&typeof Symbol=="function"&&Ko.constructor===Symbol&&Ko!==Symbol.prototype?"symbol":typeof Ko};function Lr(Ko,lu){if(!(Ko instanceof lu))throw new TypeError("Cannot call a class as a function")}function jr(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var Ur=jr();function Gr(){try{if(!Ur||!Ur.open)return!1;var Ko=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),lu=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!Ko||lu)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function Yr(Ko,lu){Ko=Ko||[],lu=lu||{};try{return new Blob(Ko,lu)}catch($u){if($u.name!=="TypeError")throw $u;for(var Wo=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,gu=new Wo,fu=0;fu<Ko.length;fu+=1)gu.append(Ko[fu]);return gu.getBlob(lu.type)}}typeof Promise>"u"&&Mr(3);var Qr=Promise;function Wn(Ko,lu){lu&&Ko.then(function(Wo){lu(null,Wo)},function(Wo){lu(Wo)})}function ga(Ko,lu,Wo){typeof lu=="function"&&Ko.then(lu),typeof Wo=="function"&&Ko.catch(Wo)}function eo(Ko){return typeof Ko!="string"&&(console.warn(Ko+" used as a key, but it is not a string."),Ko=String(Ko)),Ko}function _i(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var va="local-forage-detect-blob-support",io=void 0,no={},so=Object.prototype.toString,ao="readonly",fo="readwrite";function lo(Ko){for(var lu=Ko.length,Wo=new ArrayBuffer(lu),gu=new Uint8Array(Wo),fu=0;fu<lu;fu++)gu[fu]=Ko.charCodeAt(fu);return Wo}function oo(Ko){return new Qr(function(lu){var Wo=Ko.transaction(va,fo),gu=Yr([""]);Wo.objectStore(va).put(gu,"key"),Wo.onabort=function(fu){fu.preventDefault(),fu.stopPropagation(),lu(!1)},Wo.oncomplete=function(){var fu=navigator.userAgent.match(/Chrome\/(\d+)/),$u=navigator.userAgent.match(/Edge\//);lu($u||!fu||parseInt(fu[1],10)>=43)}}).catch(function(){return!1})}function po(Ko){return typeof io=="boolean"?Qr.resolve(io):oo(Ko).then(function(lu){return io=lu,io})}function mo(Ko){var lu=no[Ko.name],Wo={};Wo.promise=new Qr(function(gu,fu){Wo.resolve=gu,Wo.reject=fu}),lu.deferredOperations.push(Wo),lu.dbReady?lu.dbReady=lu.dbReady.then(function(){return Wo.promise}):lu.dbReady=Wo.promise}function $o(Ko){var lu=no[Ko.name],Wo=lu.deferredOperations.pop();if(Wo)return Wo.resolve(),Wo.promise}function Xn(Ko,lu){var Wo=no[Ko.name],gu=Wo.deferredOperations.pop();if(gu)return gu.reject(lu),gu.promise}function Fr(Ko,lu){return new Qr(function(Wo,gu){if(no[Ko.name]=no[Ko.name]||co(),Ko.db)if(lu)mo(Ko),Ko.db.close();else return Wo(Ko.db);var fu=[Ko.name];lu&&fu.push(Ko.version);var $u=Ur.open.apply(Ur,fu);lu&&($u.onupgradeneeded=function(Xu){var dl=$u.result;try{dl.createObjectStore(Ko.storeName),Xu.oldVersion<=1&&dl.createObjectStore(va)}catch(Qu){if(Qu.name==="ConstraintError")console.warn('The database "'+Ko.name+'" has been upgraded from version '+Xu.oldVersion+" to version "+Xu.newVersion+', but the storage "'+Ko.storeName+'" already exists.');else throw Qu}}),$u.onerror=function(Xu){Xu.preventDefault(),gu($u.error)},$u.onsuccess=function(){var Xu=$u.result;Xu.onversionchange=function(dl){dl.target.close()},Wo(Xu),$o(Ko)}})}function Vr(Ko){return Fr(Ko,!1)}function Wr(Ko){return Fr(Ko,!0)}function Jr(Ko,lu){if(!Ko.db)return!0;var Wo=!Ko.db.objectStoreNames.contains(Ko.storeName),gu=Ko.version<Ko.db.version,fu=Ko.version>Ko.db.version;if(gu&&(Ko.version!==lu&&console.warn('The database "'+Ko.name+`" can't be downgraded from version `+Ko.db.version+" to version "+Ko.version+"."),Ko.version=Ko.db.version),fu||Wo){if(Wo){var $u=Ko.db.version+1;$u>Ko.version&&(Ko.version=$u)}return!0}return!1}function Gn(Ko){return new Qr(function(lu,Wo){var gu=new FileReader;gu.onerror=Wo,gu.onloadend=function(fu){var $u=btoa(fu.target.result||"");lu({__local_forage_encoded_blob:!0,data:$u,type:Ko.type})},gu.readAsBinaryString(Ko)})}function to(Ko){var lu=lo(atob(Ko.data));return Yr([lu],{type:Ko.type})}function ro(Ko){return Ko&&Ko.__local_forage_encoded_blob}function Un(Ko){var lu=this,Wo=lu._initReady().then(function(){var gu=no[lu._dbInfo.name];if(gu&&gu.dbReady)return gu.dbReady});return ga(Wo,Ko,Ko),Wo}function Hr(Ko){mo(Ko);for(var lu=no[Ko.name],Wo=lu.forages,gu=0;gu<Wo.length;gu++){var fu=Wo[gu];fu._dbInfo.db&&(fu._dbInfo.db.close(),fu._dbInfo.db=null)}return Ko.db=null,Vr(Ko).then(function($u){return Ko.db=$u,Jr(Ko)?Wr(Ko):$u}).then(function($u){Ko.db=lu.db=$u;for(var Xu=0;Xu<Wo.length;Xu++)Wo[Xu]._dbInfo.db=$u}).catch(function($u){throw Xn(Ko,$u),$u})}function Xr(Ko,lu,Wo,gu){gu===void 0&&(gu=1);try{var fu=Ko.db.transaction(Ko.storeName,lu);Wo(null,fu)}catch($u){if(gu>0&&(!Ko.db||$u.name==="InvalidStateError"||$u.name==="NotFoundError"))return Qr.resolve().then(function(){if(!Ko.db||$u.name==="NotFoundError"&&!Ko.db.objectStoreNames.contains(Ko.storeName)&&Ko.version<=Ko.db.version)return Ko.db&&(Ko.version=Ko.db.version+1),Wr(Ko)}).then(function(){return Hr(Ko).then(function(){Xr(Ko,lu,Wo,gu-1)})}).catch(Wo);Wo($u)}}function co(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function ho(Ko){var lu=this,Wo={db:null};if(Ko)for(var gu in Ko)Wo[gu]=Ko[gu];var fu=no[Wo.name];fu||(fu=co(),no[Wo.name]=fu),fu.forages.push(lu),lu._initReady||(lu._initReady=lu.ready,lu.ready=Un);var $u=[];function Xu(){return Qr.resolve()}for(var dl=0;dl<fu.forages.length;dl++){var Qu=fu.forages[dl];Qu!==lu&&$u.push(Qu._initReady().catch(Xu))}var Wu=fu.forages.slice(0);return Qr.all($u).then(function(){return Wo.db=fu.db,Vr(Wo)}).then(function(ml){return Wo.db=ml,Jr(Wo,lu._defaultConfig.version)?Wr(Wo):ml}).then(function(ml){Wo.db=fu.db=ml,lu._dbInfo=Wo;for(var Cl=0;Cl<Wu.length;Cl++){var rp=Wu[Cl];rp!==lu&&(rp._dbInfo.db=Wo.db,rp._dbInfo.version=Wo.version)}})}function go(Ko,lu){var Wo=this;Ko=eo(Ko);var gu=new Qr(function(fu,$u){Wo.ready().then(function(){Xr(Wo._dbInfo,ao,function(Xu,dl){if(Xu)return $u(Xu);try{var Qu=dl.objectStore(Wo._dbInfo.storeName),Wu=Qu.get(Ko);Wu.onsuccess=function(){var ml=Wu.result;ml===void 0&&(ml=null),ro(ml)&&(ml=to(ml)),fu(ml)},Wu.onerror=function(){$u(Wu.error)}}catch(ml){$u(ml)}})}).catch($u)});return Wn(gu,lu),gu}function bo(Ko,lu){var Wo=this,gu=new Qr(function(fu,$u){Wo.ready().then(function(){Xr(Wo._dbInfo,ao,function(Xu,dl){if(Xu)return $u(Xu);try{var Qu=dl.objectStore(Wo._dbInfo.storeName),Wu=Qu.openCursor(),ml=1;Wu.onsuccess=function(){var Cl=Wu.result;if(Cl){var rp=Cl.value;ro(rp)&&(rp=to(rp));var dp=Ko(rp,Cl.key,ml++);dp!==void 0?fu(dp):Cl.continue()}else fu()},Wu.onerror=function(){$u(Wu.error)}}catch(Cl){$u(Cl)}})}).catch($u)});return Wn(gu,lu),gu}function Eo(Ko,lu,Wo){var gu=this;Ko=eo(Ko);var fu=new Qr(function($u,Xu){var dl;gu.ready().then(function(){return dl=gu._dbInfo,so.call(lu)==="[object Blob]"?po(dl.db).then(function(Qu){return Qu?lu:Gn(lu)}):lu}).then(function(Qu){Xr(gu._dbInfo,fo,function(Wu,ml){if(Wu)return Xu(Wu);try{var Cl=ml.objectStore(gu._dbInfo.storeName);Qu===null&&(Qu=void 0);var rp=Cl.put(Qu,Ko);ml.oncomplete=function(){Qu===void 0&&(Qu=null),$u(Qu)},ml.onabort=ml.onerror=function(){var dp=rp.error?rp.error:rp.transaction.error;Xu(dp)}}catch(dp){Xu(dp)}})}).catch(Xu)});return Wn(fu,Wo),fu}function wo(Ko,lu){var Wo=this;Ko=eo(Ko);var gu=new Qr(function(fu,$u){Wo.ready().then(function(){Xr(Wo._dbInfo,fo,function(Xu,dl){if(Xu)return $u(Xu);try{var Qu=dl.objectStore(Wo._dbInfo.storeName),Wu=Qu.delete(Ko);dl.oncomplete=function(){fu()},dl.onerror=function(){$u(Wu.error)},dl.onabort=function(){var ml=Wu.error?Wu.error:Wu.transaction.error;$u(ml)}}catch(ml){$u(ml)}})}).catch($u)});return Wn(gu,lu),gu}function Io(Ko){var lu=this,Wo=new Qr(function(gu,fu){lu.ready().then(function(){Xr(lu._dbInfo,fo,function($u,Xu){if($u)return fu($u);try{var dl=Xu.objectStore(lu._dbInfo.storeName),Qu=dl.clear();Xu.oncomplete=function(){gu()},Xu.onabort=Xu.onerror=function(){var Wu=Qu.error?Qu.error:Qu.transaction.error;fu(Wu)}}catch(Wu){fu(Wu)}})}).catch(fu)});return Wn(Wo,Ko),Wo}function Po(Ko){var lu=this,Wo=new Qr(function(gu,fu){lu.ready().then(function(){Xr(lu._dbInfo,ao,function($u,Xu){if($u)return fu($u);try{var dl=Xu.objectStore(lu._dbInfo.storeName),Qu=dl.count();Qu.onsuccess=function(){gu(Qu.result)},Qu.onerror=function(){fu(Qu.error)}}catch(Wu){fu(Wu)}})}).catch(fu)});return Wn(Wo,Ko),Wo}function yo(Ko,lu){var Wo=this,gu=new Qr(function(fu,$u){if(Ko<0){fu(null);return}Wo.ready().then(function(){Xr(Wo._dbInfo,ao,function(Xu,dl){if(Xu)return $u(Xu);try{var Qu=dl.objectStore(Wo._dbInfo.storeName),Wu=!1,ml=Qu.openKeyCursor();ml.onsuccess=function(){var Cl=ml.result;if(!Cl){fu(null);return}Ko===0||Wu?fu(Cl.key):(Wu=!0,Cl.advance(Ko))},ml.onerror=function(){$u(ml.error)}}catch(Cl){$u(Cl)}})}).catch($u)});return Wn(gu,lu),gu}function xo(Ko){var lu=this,Wo=new Qr(function(gu,fu){lu.ready().then(function(){Xr(lu._dbInfo,ao,function($u,Xu){if($u)return fu($u);try{var dl=Xu.objectStore(lu._dbInfo.storeName),Qu=dl.openKeyCursor(),Wu=[];Qu.onsuccess=function(){var ml=Qu.result;if(!ml){gu(Wu);return}Wu.push(ml.key),ml.continue()},Qu.onerror=function(){fu(Qu.error)}}catch(ml){fu(ml)}})}).catch(fu)});return Wn(Wo,Ko),Wo}function Mo(Ko,lu){lu=_i.apply(this,arguments);var Wo=this.config();Ko=typeof Ko!="function"&&Ko||{},Ko.name||(Ko.name=Ko.name||Wo.name,Ko.storeName=Ko.storeName||Wo.storeName);var gu=this,fu;if(!Ko.name)fu=Qr.reject("Invalid arguments");else{var $u=Ko.name===Wo.name&&gu._dbInfo.db,Xu=$u?Qr.resolve(gu._dbInfo.db):Vr(Ko).then(function(dl){var Qu=no[Ko.name],Wu=Qu.forages;Qu.db=dl;for(var ml=0;ml<Wu.length;ml++)Wu[ml]._dbInfo.db=dl;return dl});Ko.storeName?fu=Xu.then(function(dl){if(dl.objectStoreNames.contains(Ko.storeName)){var Qu=dl.version+1;mo(Ko);var Wu=no[Ko.name],ml=Wu.forages;dl.close();for(var Cl=0;Cl<ml.length;Cl++){var rp=ml[Cl];rp._dbInfo.db=null,rp._dbInfo.version=Qu}var dp=new Qr(function(up,Ep){var cp=Ur.open(Ko.name,Qu);cp.onerror=function(So){var Co=cp.result;Co.close(),Ep(So)},cp.onupgradeneeded=function(){var So=cp.result;So.deleteObjectStore(Ko.storeName)},cp.onsuccess=function(){var So=cp.result;So.close(),up(So)}});return dp.then(function(up){Wu.db=up;for(var Ep=0;Ep<ml.length;Ep++){var cp=ml[Ep];cp._dbInfo.db=up,$o(cp._dbInfo)}}).catch(function(up){throw(Xn(Ko,up)||Qr.resolve()).catch(function(){}),up})}}):fu=Xu.then(function(dl){mo(Ko);var Qu=no[Ko.name],Wu=Qu.forages;dl.close();for(var ml=0;ml<Wu.length;ml++){var Cl=Wu[ml];Cl._dbInfo.db=null}var rp=new Qr(function(dp,up){var Ep=Ur.deleteDatabase(Ko.name);Ep.onerror=function(){var cp=Ep.result;cp&&cp.close(),up(Ep.error)},Ep.onblocked=function(){console.warn('dropInstance blocked for database "'+Ko.name+'" until all open connections are closed')},Ep.onsuccess=function(){var cp=Ep.result;cp&&cp.close(),dp(cp)}});return rp.then(function(dp){Qu.db=dp;for(var up=0;up<Wu.length;up++){var Ep=Wu[up];$o(Ep._dbInfo)}}).catch(function(dp){throw(Xn(Ko,dp)||Qr.resolve()).catch(function(){}),dp})})}return Wn(fu,lu),fu}var qo={_driver:"asyncStorage",_initStorage:ho,_support:Gr(),iterate:bo,getItem:go,setItem:Eo,removeItem:wo,clear:Io,length:Po,key:yo,keys:xo,dropInstance:Mo};function pu(){return typeof openDatabase=="function"}var nu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",eu="~~local_forage_type~",Uu=/^~~local_forage_type~([^~]+)~/,mu="__lfsc__:",Jo=mu.length,Zu="arbf",su="blob",Ru="si08",tl="ui08",Pu="uic8",Tu="si16",ll="si32",Su="ur16",Ou="ui32",fl="fl32",To="fl64",_o=Jo+Zu.length,Ro=Object.prototype.toString;function No(Ko){var lu=Ko.length*.75,Wo=Ko.length,gu,fu=0,$u,Xu,dl,Qu;Ko[Ko.length-1]==="="&&(lu--,Ko[Ko.length-2]==="="&&lu--);var Wu=new ArrayBuffer(lu),ml=new Uint8Array(Wu);for(gu=0;gu<Wo;gu+=4)$u=nu.indexOf(Ko[gu]),Xu=nu.indexOf(Ko[gu+1]),dl=nu.indexOf(Ko[gu+2]),Qu=nu.indexOf(Ko[gu+3]),ml[fu++]=$u<<2|Xu>>4,ml[fu++]=(Xu&15)<<4|dl>>2,ml[fu++]=(dl&3)<<6|Qu&63;return Wu}function Uo(Ko){var lu=new Uint8Array(Ko),Wo="",gu;for(gu=0;gu<lu.length;gu+=3)Wo+=nu[lu[gu]>>2],Wo+=nu[(lu[gu]&3)<<4|lu[gu+1]>>4],Wo+=nu[(lu[gu+1]&15)<<2|lu[gu+2]>>6],Wo+=nu[lu[gu+2]&63];return lu.length%3===2?Wo=Wo.substring(0,Wo.length-1)+"=":lu.length%3===1&&(Wo=Wo.substring(0,Wo.length-2)+"=="),Wo}function wu(Ko,lu){var Wo="";if(Ko&&(Wo=Ro.call(Ko)),Ko&&(Wo==="[object ArrayBuffer]"||Ko.buffer&&Ro.call(Ko.buffer)==="[object ArrayBuffer]")){var gu,fu=mu;Ko instanceof ArrayBuffer?(gu=Ko,fu+=Zu):(gu=Ko.buffer,Wo==="[object Int8Array]"?fu+=Ru:Wo==="[object Uint8Array]"?fu+=tl:Wo==="[object Uint8ClampedArray]"?fu+=Pu:Wo==="[object Int16Array]"?fu+=Tu:Wo==="[object Uint16Array]"?fu+=Su:Wo==="[object Int32Array]"?fu+=ll:Wo==="[object Uint32Array]"?fu+=Ou:Wo==="[object Float32Array]"?fu+=fl:Wo==="[object Float64Array]"?fu+=To:lu(new Error("Failed to get type for BinaryArray"))),lu(fu+Uo(gu))}else if(Wo==="[object Blob]"){var $u=new FileReader;$u.onload=function(){var Xu=eu+Ko.type+"~"+Uo(this.result);lu(mu+su+Xu)},$u.readAsArrayBuffer(Ko)}else try{lu(JSON.stringify(Ko))}catch(Xu){console.error("Couldn't convert value into a JSON string: ",Ko),lu(null,Xu)}}function au(Ko){if(Ko.substring(0,Jo)!==mu)return JSON.parse(Ko);var lu=Ko.substring(_o),Wo=Ko.substring(Jo,_o),gu;if(Wo===su&&Uu.test(lu)){var fu=lu.match(Uu);gu=fu[1],lu=lu.substring(fu[0].length)}var $u=No(lu);switch(Wo){case Zu:return $u;case su:return Yr([$u],{type:gu});case Ru:return new Int8Array($u);case tl:return new Uint8Array($u);case Pu:return new Uint8ClampedArray($u);case Tu:return new Int16Array($u);case Su:return new Uint16Array($u);case ll:return new Int32Array($u);case Ou:return new Uint32Array($u);case fl:return new Float32Array($u);case To:return new Float64Array($u);default:throw new Error("Unkown type: "+Wo)}}var Nu={serialize:wu,deserialize:au,stringToBuffer:No,bufferToString:Uo};function _l(Ko,lu,Wo,gu){Ko.executeSql("CREATE TABLE IF NOT EXISTS "+lu.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],Wo,gu)}function Du(Ko){var lu=this,Wo={db:null};if(Ko)for(var gu in Ko)Wo[gu]=typeof Ko[gu]!="string"?Ko[gu].toString():Ko[gu];var fu=new Qr(function($u,Xu){try{Wo.db=openDatabase(Wo.name,String(Wo.version),Wo.description,Wo.size)}catch(dl){return Xu(dl)}Wo.db.transaction(function(dl){_l(dl,Wo,function(){lu._dbInfo=Wo,$u()},function(Qu,Wu){Xu(Wu)})},Xu)});return Wo.serializer=Nu,fu}function Fu(Ko,lu,Wo,gu,fu,$u){Ko.executeSql(Wo,gu,fu,function(Xu,dl){dl.code===dl.SYNTAX_ERR?Xu.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[lu.storeName],function(Qu,Wu){Wu.rows.length?$u(Qu,dl):_l(Qu,lu,function(){Qu.executeSql(Wo,gu,fu,$u)},$u)},$u):$u(Xu,dl)},$u)}function vl(Ko,lu){var Wo=this;Ko=eo(Ko);var gu=new Qr(function(fu,$u){Wo.ready().then(function(){var Xu=Wo._dbInfo;Xu.db.transaction(function(dl){Fu(dl,Xu,"SELECT * FROM "+Xu.storeName+" WHERE key = ? LIMIT 1",[Ko],function(Qu,Wu){var ml=Wu.rows.length?Wu.rows.item(0).value:null;ml&&(ml=Xu.serializer.deserialize(ml)),fu(ml)},function(Qu,Wu){$u(Wu)})})}).catch($u)});return Wn(gu,lu),gu}function Lu(Ko,lu){var Wo=this,gu=new Qr(function(fu,$u){Wo.ready().then(function(){var Xu=Wo._dbInfo;Xu.db.transaction(function(dl){Fu(dl,Xu,"SELECT * FROM "+Xu.storeName,[],function(Qu,Wu){for(var ml=Wu.rows,Cl=ml.length,rp=0;rp<Cl;rp++){var dp=ml.item(rp),up=dp.value;if(up&&(up=Xu.serializer.deserialize(up)),up=Ko(up,dp.key,rp+1),up!==void 0){fu(up);return}}fu()},function(Qu,Wu){$u(Wu)})})}).catch($u)});return Wn(gu,lu),gu}function Ku(Ko,lu,Wo,gu){var fu=this;Ko=eo(Ko);var $u=new Qr(function(Xu,dl){fu.ready().then(function(){lu===void 0&&(lu=null);var Qu=lu,Wu=fu._dbInfo;Wu.serializer.serialize(lu,function(ml,Cl){Cl?dl(Cl):Wu.db.transaction(function(rp){Fu(rp,Wu,"INSERT OR REPLACE INTO "+Wu.storeName+" (key, value) VALUES (?, ?)",[Ko,ml],function(){Xu(Qu)},function(dp,up){dl(up)})},function(rp){if(rp.code===rp.QUOTA_ERR){if(gu>0){Xu(Ku.apply(fu,[Ko,Qu,Wo,gu-1]));return}dl(rp)}})})}).catch(dl)});return Wn($u,Wo),$u}function bl(Ko,lu,Wo){return Ku.apply(this,[Ko,lu,Wo,1])}function jo(Ko,lu){var Wo=this;Ko=eo(Ko);var gu=new Qr(function(fu,$u){Wo.ready().then(function(){var Xu=Wo._dbInfo;Xu.db.transaction(function(dl){Fu(dl,Xu,"DELETE FROM "+Xu.storeName+" WHERE key = ?",[Ko],function(){fu()},function(Qu,Wu){$u(Wu)})})}).catch($u)});return Wn(gu,lu),gu}function ko(Ko){var lu=this,Wo=new Qr(function(gu,fu){lu.ready().then(function(){var $u=lu._dbInfo;$u.db.transaction(function(Xu){Fu(Xu,$u,"DELETE FROM "+$u.storeName,[],function(){gu()},function(dl,Qu){fu(Qu)})})}).catch(fu)});return Wn(Wo,Ko),Wo}function iu(Ko){var lu=this,Wo=new Qr(function(gu,fu){lu.ready().then(function(){var $u=lu._dbInfo;$u.db.transaction(function(Xu){Fu(Xu,$u,"SELECT COUNT(key) as c FROM "+$u.storeName,[],function(dl,Qu){var Wu=Qu.rows.item(0).c;gu(Wu)},function(dl,Qu){fu(Qu)})})}).catch(fu)});return Wn(Wo,Ko),Wo}function Ho(Ko,lu){var Wo=this,gu=new Qr(function(fu,$u){Wo.ready().then(function(){var Xu=Wo._dbInfo;Xu.db.transaction(function(dl){Fu(dl,Xu,"SELECT key FROM "+Xu.storeName+" WHERE id = ? LIMIT 1",[Ko+1],function(Qu,Wu){var ml=Wu.rows.length?Wu.rows.item(0).key:null;fu(ml)},function(Qu,Wu){$u(Wu)})})}).catch($u)});return Wn(gu,lu),gu}function ou(Ko){var lu=this,Wo=new Qr(function(gu,fu){lu.ready().then(function(){var $u=lu._dbInfo;$u.db.transaction(function(Xu){Fu(Xu,$u,"SELECT key FROM "+$u.storeName,[],function(dl,Qu){for(var Wu=[],ml=0;ml<Qu.rows.length;ml++)Wu.push(Qu.rows.item(ml).key);gu(Wu)},function(dl,Qu){fu(Qu)})})}).catch(fu)});return Wn(Wo,Ko),Wo}function qu(Ko){return new Qr(function(lu,Wo){Ko.transaction(function(gu){gu.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(fu,$u){for(var Xu=[],dl=0;dl<$u.rows.length;dl++)Xu.push($u.rows.item(dl).name);lu({db:Ko,storeNames:Xu})},function(fu,$u){Wo($u)})},function(gu){Wo(gu)})})}function du(Ko,lu){lu=_i.apply(this,arguments);var Wo=this.config();Ko=typeof Ko!="function"&&Ko||{},Ko.name||(Ko.name=Ko.name||Wo.name,Ko.storeName=Ko.storeName||Wo.storeName);var gu=this,fu;return Ko.name?fu=new Qr(function($u){var Xu;Ko.name===Wo.name?Xu=gu._dbInfo.db:Xu=openDatabase(Ko.name,"","",0),Ko.storeName?$u({db:Xu,storeNames:[Ko.storeName]}):$u(qu(Xu))}).then(function($u){return new Qr(function(Xu,dl){$u.db.transaction(function(Qu){function Wu(dp){return new Qr(function(up,Ep){Qu.executeSql("DROP TABLE IF EXISTS "+dp,[],function(){up()},function(cp,So){Ep(So)})})}for(var ml=[],Cl=0,rp=$u.storeNames.length;Cl<rp;Cl++)ml.push(Wu($u.storeNames[Cl]));Qr.all(ml).then(function(){Xu()}).catch(function(dp){dl(dp)})},function(Qu){dl(Qu)})})}):fu=Qr.reject("Invalid arguments"),Wn(fu,lu),fu}var _u={_driver:"webSQLStorage",_initStorage:Du,_support:pu(),iterate:Lu,getItem:vl,setItem:bl,removeItem:jo,clear:ko,length:iu,key:Ho,keys:ou,dropInstance:du};function al(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function Bo(Ko,lu){var Wo=Ko.name+"/";return Ko.storeName!==lu.storeName&&(Wo+=Ko.storeName+"/"),Wo}function Do(){var Ko="_localforage_support_test";try{return localStorage.setItem(Ko,!0),localStorage.removeItem(Ko),!1}catch{return!0}}function ru(){return!Do()||localStorage.length>0}function Go(Ko){var lu=this,Wo={};if(Ko)for(var gu in Ko)Wo[gu]=Ko[gu];return Wo.keyPrefix=Bo(Ko,lu._defaultConfig),ru()?(lu._dbInfo=Wo,Wo.serializer=Nu,Qr.resolve()):Qr.reject()}function Qo(Ko){var lu=this,Wo=lu.ready().then(function(){for(var gu=lu._dbInfo.keyPrefix,fu=localStorage.length-1;fu>=0;fu--){var $u=localStorage.key(fu);$u.indexOf(gu)===0&&localStorage.removeItem($u)}});return Wn(Wo,Ko),Wo}function nl(Ko,lu){var Wo=this;Ko=eo(Ko);var gu=Wo.ready().then(function(){var fu=Wo._dbInfo,$u=localStorage.getItem(fu.keyPrefix+Ko);return $u&&($u=fu.serializer.deserialize($u)),$u});return Wn(gu,lu),gu}function Au(Ko,lu){var Wo=this,gu=Wo.ready().then(function(){for(var fu=Wo._dbInfo,$u=fu.keyPrefix,Xu=$u.length,dl=localStorage.length,Qu=1,Wu=0;Wu<dl;Wu++){var ml=localStorage.key(Wu);if(ml.indexOf($u)===0){var Cl=localStorage.getItem(ml);if(Cl&&(Cl=fu.serializer.deserialize(Cl)),Cl=Ko(Cl,ml.substring(Xu),Qu++),Cl!==void 0)return Cl}}});return Wn(gu,lu),gu}function Hu(Ko,lu){var Wo=this,gu=Wo.ready().then(function(){var fu=Wo._dbInfo,$u;try{$u=localStorage.key(Ko)}catch{$u=null}return $u&&($u=$u.substring(fu.keyPrefix.length)),$u});return Wn(gu,lu),gu}function yl(Ko){var lu=this,Wo=lu.ready().then(function(){for(var gu=lu._dbInfo,fu=localStorage.length,$u=[],Xu=0;Xu<fu;Xu++){var dl=localStorage.key(Xu);dl.indexOf(gu.keyPrefix)===0&&$u.push(dl.substring(gu.keyPrefix.length))}return $u});return Wn(Wo,Ko),Wo}function $l(Ko){var lu=this,Wo=lu.keys().then(function(gu){return gu.length});return Wn(Wo,Ko),Wo}function Al(Ko,lu){var Wo=this;Ko=eo(Ko);var gu=Wo.ready().then(function(){var fu=Wo._dbInfo;localStorage.removeItem(fu.keyPrefix+Ko)});return Wn(gu,lu),gu}function Rl(Ko,lu,Wo){var gu=this;Ko=eo(Ko);var fu=gu.ready().then(function(){lu===void 0&&(lu=null);var $u=lu;return new Qr(function(Xu,dl){var Qu=gu._dbInfo;Qu.serializer.serialize(lu,function(Wu,ml){if(ml)dl(ml);else try{localStorage.setItem(Qu.keyPrefix+Ko,Wu),Xu($u)}catch(Cl){(Cl.name==="QuotaExceededError"||Cl.name==="NS_ERROR_DOM_QUOTA_REACHED")&&dl(Cl),dl(Cl)}})})});return Wn(fu,Wo),fu}function Nl(Ko,lu){if(lu=_i.apply(this,arguments),Ko=typeof Ko!="function"&&Ko||{},!Ko.name){var Wo=this.config();Ko.name=Ko.name||Wo.name,Ko.storeName=Ko.storeName||Wo.storeName}var gu=this,fu;return Ko.name?fu=new Qr(function($u){Ko.storeName?$u(Bo(Ko,gu._defaultConfig)):$u(Ko.name+"/")}).then(function($u){for(var Xu=localStorage.length-1;Xu>=0;Xu--){var dl=localStorage.key(Xu);dl.indexOf($u)===0&&localStorage.removeItem(dl)}}):fu=Qr.reject("Invalid arguments"),Wn(fu,lu),fu}var El={_driver:"localStorageWrapper",_initStorage:Go,_support:al(),iterate:Au,getItem:nl,setItem:Rl,removeItem:Al,clear:Qo,length:$l,key:Hu,keys:yl,dropInstance:Nl},Ml=function(Ko,lu){return Ko===lu||typeof Ko=="number"&&typeof lu=="number"&&isNaN(Ko)&&isNaN(lu)},kl=function(Ko,lu){for(var Wo=Ko.length,gu=0;gu<Wo;){if(Ml(Ko[gu],lu))return!0;gu++}return!1},Ol=Array.isArray||function(Ko){return Object.prototype.toString.call(Ko)==="[object Array]"},Ul={},Zl={},Hl={INDEXEDDB:qo,WEBSQL:_u,LOCALSTORAGE:El},Xl=[Hl.INDEXEDDB._driver,Hl.WEBSQL._driver,Hl.LOCALSTORAGE._driver],_f=["dropInstance"],Gl=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(_f),jl={description:"",driver:Xl.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function tp(Ko,lu){Ko[lu]=function(){var Wo=arguments;return Ko.ready().then(function(){return Ko[lu].apply(Ko,Wo)})}}function _d(){for(var Ko=1;Ko<arguments.length;Ko++){var lu=arguments[Ko];if(lu)for(var Wo in lu)lu.hasOwnProperty(Wo)&&(Ol(lu[Wo])?arguments[0][Wo]=lu[Wo].slice():arguments[0][Wo]=lu[Wo])}return arguments[0]}var np=function(){function Ko(lu){Lr(this,Ko);for(var Wo in Hl)if(Hl.hasOwnProperty(Wo)){var gu=Hl[Wo],fu=gu._driver;this[Wo]=fu,Ul[fu]||this.defineDriver(gu)}this._defaultConfig=_d({},jl),this._config=_d({},this._defaultConfig,lu),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return Ko.prototype.config=function(lu){if((typeof lu>"u"?"undefined":Br(lu))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var Wo in lu){if(Wo==="storeName"&&(lu[Wo]=lu[Wo].replace(/\W/g,"_")),Wo==="version"&&typeof lu[Wo]!="number")return new Error("Database version must be a number.");this._config[Wo]=lu[Wo]}return"driver"in lu&&lu.driver?this.setDriver(this._config.driver):!0}else return typeof lu=="string"?this._config[lu]:this._config},Ko.prototype.defineDriver=function(lu,Wo,gu){var fu=new Qr(function($u,Xu){try{var dl=lu._driver,Qu=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!lu._driver){Xu(Qu);return}for(var Wu=Gl.concat("_initStorage"),ml=0,Cl=Wu.length;ml<Cl;ml++){var rp=Wu[ml],dp=!kl(_f,rp);if((dp||lu[rp])&&typeof lu[rp]!="function"){Xu(Qu);return}}var up=function(){for(var cp=function(cu){return function(){var bu=new Error("Method "+cu+" is not implemented by the current driver"),Iu=Qr.reject(bu);return Wn(Iu,arguments[arguments.length-1]),Iu}},So=0,Co=_f.length;So<Co;So++){var Fo=_f[So];lu[Fo]||(lu[Fo]=cp(Fo))}};up();var Ep=function(cp){Ul[dl]&&console.info("Redefining LocalForage driver: "+dl),Ul[dl]=lu,Zl[dl]=cp,$u()};"_support"in lu?lu._support&&typeof lu._support=="function"?lu._support().then(Ep,Xu):Ep(!!lu._support):Ep(!0)}catch(cp){Xu(cp)}});return ga(fu,Wo,gu),fu},Ko.prototype.driver=function(){return this._driver||null},Ko.prototype.getDriver=function(lu,Wo,gu){var fu=Ul[lu]?Qr.resolve(Ul[lu]):Qr.reject(new Error("Driver not found."));return ga(fu,Wo,gu),fu},Ko.prototype.getSerializer=function(lu){var Wo=Qr.resolve(Nu);return ga(Wo,lu),Wo},Ko.prototype.ready=function(lu){var Wo=this,gu=Wo._driverSet.then(function(){return Wo._ready===null&&(Wo._ready=Wo._initDriver()),Wo._ready});return ga(gu,lu,lu),gu},Ko.prototype.setDriver=function(lu,Wo,gu){var fu=this;Ol(lu)||(lu=[lu]);var $u=this._getSupportedDrivers(lu);function Xu(){fu._config.driver=fu.driver()}function dl(ml){return fu._extend(ml),Xu(),fu._ready=fu._initStorage(fu._config),fu._ready}function Qu(ml){return function(){var Cl=0;function rp(){for(;Cl<ml.length;){var dp=ml[Cl];return Cl++,fu._dbInfo=null,fu._ready=null,fu.getDriver(dp).then(dl).catch(rp)}Xu();var up=new Error("No available storage method found.");return fu._driverSet=Qr.reject(up),fu._driverSet}return rp()}}var Wu=this._driverSet!==null?this._driverSet.catch(function(){return Qr.resolve()}):Qr.resolve();return this._driverSet=Wu.then(function(){var ml=$u[0];return fu._dbInfo=null,fu._ready=null,fu.getDriver(ml).then(function(Cl){fu._driver=Cl._driver,Xu(),fu._wrapLibraryMethodsWithReady(),fu._initDriver=Qu($u)})}).catch(function(){Xu();var ml=new Error("No available storage method found.");return fu._driverSet=Qr.reject(ml),fu._driverSet}),ga(this._driverSet,Wo,gu),this._driverSet},Ko.prototype.supports=function(lu){return!!Zl[lu]},Ko.prototype._extend=function(lu){_d(this,lu)},Ko.prototype._getSupportedDrivers=function(lu){for(var Wo=[],gu=0,fu=lu.length;gu<fu;gu++){var $u=lu[gu];this.supports($u)&&Wo.push($u)}return Wo},Ko.prototype._wrapLibraryMethodsWithReady=function(){for(var lu=0,Wo=Gl.length;lu<Wo;lu++)tp(this,Gl[lu])},Ko.prototype.createInstance=function(lu){return new Ko(lu)},Ko}(),Xp=new np;Nr.exports=Xp},{3:3}]},{},[4])(4)})}),rr=$e(($r,pr)=>{(function(Mr,Nr){typeof $r=="object"&&typeof pr<"u"?Nr($r):typeof define=="function"&&define.amd?define("localforage-driver-memory",["exports"],Nr):Nr(Mr.LocalforageDriverMemory={})})(typeof self<"u"?self:$r,function(Mr){var Nr="localforage-driver-memory";function Dr(ro){var Un=typeof Symbol=="function"&&ro[Symbol.iterator],Hr=0;return Un?Un.call(ro):{next:function(){return ro&&Hr>=ro.length&&(ro=void 0),{value:ro&&ro[Hr++],done:!ro}}}}function Br(ro,Un){ro=ro||[],Un=Un||{};try{return new Blob(ro,Un)}catch(ho){if(ho.name!=="TypeError")throw ho;for(var Hr=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,Xr=new Hr,co=0;co<ro.length;co+=1)Xr.append(ro[co]);return Xr.getBlob(Un.type)}}var Lr=/^~~local_forage_type~([^~]+)~/,jr=9,Ur=jr+4,Gr=Object.prototype.toString;function Yr(ro){var Un=ro.length*.75,Hr=ro.length;ro[ro.length-1]==="="&&(Un--,ro[ro.length-2]==="="&&Un--);for(var Xr=new ArrayBuffer(Un),co=new Uint8Array(Xr),ho=0,go=0;ho<Hr;ho+=4){var bo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(ro[ho]),Eo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(ro[ho+1]),wo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(ro[ho+2]),Io="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(ro[ho+3]);co[go++]=bo<<2|Eo>>4,co[go++]=(Eo&15)<<4|wo>>2,co[go++]=(wo&3)<<6|Io&63}return Xr}function Qr(ro){for(var Un=new Uint8Array(ro),Hr="",Xr=0;Xr<Un.length;Xr+=3)Hr+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[Un[Xr]>>2],Hr+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(Un[Xr]&3)<<4|Un[Xr+1]>>4],Hr+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(Un[Xr+1]&15)<<2|Un[Xr+2]>>6],Hr+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[Un[Xr+2]&63];return Un.length%3===2?Hr=Hr.substring(0,Hr.length-1)+"=":Un.length%3===1&&(Hr=Hr.substring(0,Hr.length-2)+"=="),Hr}function Wn(ro,Un){var Hr="";if(ro&&(Hr=Gr.call(ro)),ro&&(Hr==="[object ArrayBuffer]"||ro.buffer&&Gr.call(ro.buffer)==="[object ArrayBuffer]")){var Xr=void 0,co="__lfsc__:";ro instanceof ArrayBuffer?(Xr=ro,co+="arbf"):(Xr=ro.buffer,Hr==="[object Int8Array]"?co+="si08":Hr==="[object Uint8Array]"?co+="ui08":Hr==="[object Uint8ClampedArray]"?co+="uic8":Hr==="[object Int16Array]"?co+="si16":Hr==="[object Uint16Array]"?co+="ur16":Hr==="[object Int32Array]"?co+="si32":Hr==="[object Uint32Array]"?co+="ui32":Hr==="[object Float32Array]"?co+="fl32":Hr==="[object Float64Array]"?co+="fl64":Un(new Error("Failed to get type for BinaryArray"))),Un(co+Qr(Xr))}else if(Hr==="[object Blob]"){var ho=new FileReader;ho.onload=function(){var go="~~local_forage_type~"+ro.type+"~"+Qr(this.result);Un("__lfsc__:blob"+go)},ho.readAsArrayBuffer(ro)}else try{Un(JSON.stringify(ro))}catch(go){console.error("Couldn't convert value into a JSON string: ",ro),Un(null,go)}}function ga(ro){if(ro.substring(0,jr)!=="__lfsc__:")return JSON.parse(ro);var Un=ro.substring(Ur),Hr=ro.substring(jr,Ur),Xr;if(Hr==="blob"&&Lr.test(Un)){var co=Un.match(Lr);Xr=co[1],Un=Un.substring(co[0].length)}var ho=Yr(Un);switch(Hr){case"arbf":return ho;case"blob":return Br([ho],{type:Xr});case"si08":return new Int8Array(ho);case"ui08":return new Uint8Array(ho);case"uic8":return new Uint8ClampedArray(ho);case"si16":return new Int16Array(ho);case"ur16":return new Uint16Array(ho);case"si32":return new Int32Array(ho);case"ui32":return new Uint32Array(ho);case"fl32":return new Float32Array(ho);case"fl64":return new Float64Array(ho);default:throw new Error("Unkown type: "+Hr)}}function eo(ro){var Un,Hr;if(ro===null||typeof ro!="object"||"isActiveClone"in ro)return ro;var Xr=ro instanceof Date?new Date(ro):ro.constructor();try{for(var co=Dr(Object.keys(ro)),ho=co.next();!ho.done;ho=co.next()){var go=ho.value;Object.prototype.hasOwnProperty.call(ro,go)&&(ro.isActiveClone=null,Xr[go]=eo(ro[go]),delete ro.isActiveClone)}}catch(bo){Un={error:bo}}finally{try{ho&&!ho.done&&(Hr=co.return)&&Hr.call(co)}finally{if(Un)throw Un.error}}return Xr}function _i(ro,Un){return(ro.name||Un.name)+"/"+(ro.storeName||Un.storeName)+"/"}function va(ro,Un){Un&&ro.then(function(Hr){Un(null,Hr)},function(Hr){Un(Hr)})}function io(){for(var ro=[],Un=0;Un<arguments.length;Un++)ro[Un]=arguments[Un];if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}function no(ro,Un){var Hr=this;if(Un=io.apply(this,arguments),ro=typeof ro!="function"&&ro||{},!ro.name){var Xr=this.config();ro.name=ro.name||Xr.name,ro.storeName=ro.storeName||Xr.storeName}var co;return ro.name?co=new Promise(function(ho){ro.storeName?ho(_i(ro,Hr._defaultConfig)):ho(ro.name+"/")}):co=Promise.reject("Invalid arguments"),{promise:co,callback:Un}}function so(ro){return typeof ro!="string"&&(console.warn(ro+" used as a key, but it is not a string."),ro=String(ro)),ro}var ao={bufferToString:Qr,deserialize:ga,serialize:Wn,stringToBuffer:Yr},fo={},lo=function(){function ro(Un){this.kp=Un,this.data={}}return ro.resolve=function(Un){return fo[Un]||(fo[Un]=new ro(Un)),fo[Un]},ro.prototype.clear=function(){this.data={}},ro.prototype.drop=function(){this.clear(),delete fo[this.kp]},ro.prototype.get=function(Un){return this.data[Un]},ro.prototype.key=function(Un){return this.keys()[Un]},ro.prototype.keys=function(){return Object.keys(this.data)},ro.prototype.rm=function(Un){delete this.data[Un]},ro.prototype.set=function(Un,Hr){this.data[Un]=Hr},ro}();function oo(ro){var Un=ro?eo(ro):{},Hr=_i(Un,this._defaultConfig),Xr=lo.resolve(Hr);return this._dbInfo=Un,this._dbInfo.serializer=ao,this._dbInfo.keyPrefix=Hr,this._dbInfo.mStore=Xr,Promise.resolve()}function po(ro){var Un=this,Hr=this.ready().then(function(){Un._dbInfo.mStore.clear()});return va(Hr,ro),Hr}function mo(ro,Un){var Hr=no.apply(this,arguments),Xr=Hr.promise,co=Hr.callback,ho=Xr.then(function(go){lo.resolve(go).drop()});return va(ho,co),Xr}function $o(ro,Un){var Hr=this;ro=so(ro);var Xr=this.ready().then(function(){var co=Hr._dbInfo.mStore.get(ro);return co==null?null:Hr._dbInfo.serializer.deserialize(co)});return va(Xr,Un),Xr}function Xn(ro,Un){var Hr=this,Xr=this.ready().then(function(){for(var co=Hr._dbInfo.mStore,ho=co.keys(),go=0;go<ho.length;go++){var bo=co.get(ho[go]);if(bo&&(bo=Hr._dbInfo.serializer.deserialize(bo)),bo=ro(bo,ho[go],go+1),bo!==void 0)return bo}});return va(Xr,Un),Xr}function Fr(ro,Un){var Hr=this,Xr=this.ready().then(function(){var co;try{co=Hr._dbInfo.mStore.key(ro),co===void 0&&(co=null)}catch{co=null}return co});return va(Xr,Un),Xr}function Vr(ro){var Un=this,Hr=this.ready().then(function(){return Un._dbInfo.mStore.keys()});return va(Hr,ro),Hr}function Wr(ro){var Un=this.keys().then(function(Hr){return Hr.length});return va(Un,ro),Un}function Jr(ro,Un){var Hr=this;ro=so(ro);var Xr=this.ready().then(function(){Hr._dbInfo.mStore.rm(ro)});return va(Xr,Un),Xr}function Gn(ro,Un,Hr){var Xr=this;ro=so(ro);var co=this.ready().then(function(){Un===void 0&&(Un=null);var ho=Un;return new Promise(function(go,bo){Xr._dbInfo.serializer.serialize(Un,function(Eo,wo){if(wo)bo(wo);else try{Xr._dbInfo.mStore.set(ro,Eo),go(ho)}catch(Io){bo(Io)}})})});return va(co,Hr),co}var to=!0;Mr._support=to,Mr._driver=Nr,Mr._initStorage=oo,Mr.clear=po,Mr.dropInstance=mo,Mr.getItem=$o,Mr.iterate=Xn,Mr.key=Fr,Mr.keys=Vr,Mr.length=Wr,Mr.removeItem=Jr,Mr.setItem=Gn,Object.defineProperty(Mr,"__esModule",{value:!0})})}),ge=Ze(ke()),Te=Ze(rr()),at={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};function ft($r){for(let[pr,Mr]of Object.entries(at))$r.style[pr]=Mr}function ut($r){return!![].slice.call(document.querySelectorAll(".magic-iframe")).find(Mr=>Mr.src.includes($r))}var pe=class extends Ke{constructor(){super(...arguments),this.activeElement=null}init(){this.test="hello",this.iframe=new Promise($r=>{let pr=()=>{if(ut(encodeURIComponent(this.parameters)))_r().log();else{let Mr=document.createElement("iframe");Mr.classList.add("magic-iframe"),Mr.dataset.magicIframeLabel=Ue(this.endpoint).host,Mr.title="Secure Modal",Mr.src=Ue(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,ft(Mr),document.body.appendChild(Mr),$r(Mr)}};["loaded","interactive","complete"].includes(document.readyState)?pr():window.addEventListener("load",pr,!1)}),window.addEventListener("message",$r=>{var pr;if($r.origin===this.endpoint&&$r.data&&$r.data.msgType&&this.messageHandlers.size){$r.data.response=(pr=$r.data.response)!=null?pr:{};for(let Mr of this.messageHandlers.values())Mr($r)}})}showOverlay(){return se(this,null,function*(){let $r=yield this.iframe;$r.style.display="block",this.activeElement=document.activeElement,$r.focus()})}hideOverlay(){return se(this,null,function*(){var $r;let pr=yield this.iframe;pr.style.display="none",($r=this.activeElement)!=null&&$r.focus&&this.activeElement.focus(),this.activeElement=null})}_post($r){return se(this,null,function*(){let pr=yield this.iframe;if(pr&&pr.contentWindow)pr.contentWindow.postMessage($r,this.endpoint);else throw pt()})}},bt=Jn(Me,{platform:"web",sdkName:"magic-sdk",version:"21.4.1",defaultEndpoint:"https://auth.magic.link/",ViewController:pe,configureStorage:()=>se(void 0,null,function*(){let $r=ge.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield $r.defineDriver(Te),yield $r.setDriver([ge.default.INDEXEDDB,ge.default.LOCALSTORAGE,Te._driver]),$r})});const es$1=Object.freeze(Object.defineProperty({__proto__:null,DeepLinkPage:f$2,DeviceVerificationEventEmit:T$1,DeviceVerificationEventOnReceived:A$2,EthChainType:R$2,Events:c,Extension:q,ExtensionError:B,ExtensionWarning:te,LoginWithEmailOTPEventEmit:I$1,LoginWithEmailOTPEventOnReceived:x$2,LoginWithMagicLinkEventEmit:v$1,LoginWithMagicLinkEventOnReceived:E$1,Magic:bt,MagicIncomingWindowMessage:u$2,MagicOutgoingWindowMessage:g$1,MagicPayloadMethod:l,RPCError:O$1,RPCErrorCode:m$2,RecoveryMethodType:N,SDKError:A$1,SDKErrorCode:o,SDKWarning:j,SDKWarningCode:_$2,Wallets:p,isPromiEvent:Pt},Symbol.toStringTag,{value:"Module"})),require$$3=getAugmentedNamespace(es$1);var sha256$1={exports:{}},core={exports:{}},hasRequiredCore;function requireCore(){return hasRequiredCore||(hasRequiredCore=1,function($r,pr){(function(Mr,Nr){$r.exports=Nr()})(commonjsGlobal,function(){var Mr=Mr||function(Nr,Dr){var Br=Object.create||function(){function va(){}return function(io){var no;return va.prototype=io,no=new va,va.prototype=null,no}}(),Lr={},jr=Lr.lib={},Ur=jr.Base=function(){return{extend:function(va){var io=Br(this);return va&&io.mixIn(va),(!io.hasOwnProperty("init")||this.init===io.init)&&(io.init=function(){io.$super.init.apply(this,arguments)}),io.init.prototype=io,io.$super=this,io},create:function(){var va=this.extend();return va.init.apply(va,arguments),va},init:function(){},mixIn:function(va){for(var io in va)va.hasOwnProperty(io)&&(this[io]=va[io]);va.hasOwnProperty("toString")&&(this.toString=va.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),Gr=jr.WordArray=Ur.extend({init:function(va,io){va=this.words=va||[],io!=Dr?this.sigBytes=io:this.sigBytes=va.length*4},toString:function(va){return(va||Qr).stringify(this)},concat:function(va){var io=this.words,no=va.words,so=this.sigBytes,ao=va.sigBytes;if(this.clamp(),so%4)for(var fo=0;fo<ao;fo++){var lo=no[fo>>>2]>>>24-fo%4*8&255;io[so+fo>>>2]|=lo<<24-(so+fo)%4*8}else for(var fo=0;fo<ao;fo+=4)io[so+fo>>>2]=no[fo>>>2];return this.sigBytes+=ao,this},clamp:function(){var va=this.words,io=this.sigBytes;va[io>>>2]&=4294967295<<32-io%4*8,va.length=Nr.ceil(io/4)},clone:function(){var va=Ur.clone.call(this);return va.words=this.words.slice(0),va},random:function(va){for(var io=[],no=function(oo){var oo=oo,po=987654321,mo=4294967295;return function(){po=36969*(po&65535)+(po>>16)&mo,oo=18e3*(oo&65535)+(oo>>16)&mo;var $o=(po<<16)+oo&mo;return $o/=4294967296,$o+=.5,$o*(Nr.random()>.5?1:-1)}},so=0,ao;so<va;so+=4){var fo=no((ao||Nr.random())*4294967296);ao=fo()*987654071,io.push(fo()*4294967296|0)}return new Gr.init(io,va)}}),Yr=Lr.enc={},Qr=Yr.Hex={stringify:function(va){for(var io=va.words,no=va.sigBytes,so=[],ao=0;ao<no;ao++){var fo=io[ao>>>2]>>>24-ao%4*8&255;so.push((fo>>>4).toString(16)),so.push((fo&15).toString(16))}return so.join("")},parse:function(va){for(var io=va.length,no=[],so=0;so<io;so+=2)no[so>>>3]|=parseInt(va.substr(so,2),16)<<24-so%8*4;return new Gr.init(no,io/2)}},Wn=Yr.Latin1={stringify:function(va){for(var io=va.words,no=va.sigBytes,so=[],ao=0;ao<no;ao++){var fo=io[ao>>>2]>>>24-ao%4*8&255;so.push(String.fromCharCode(fo))}return so.join("")},parse:function(va){for(var io=va.length,no=[],so=0;so<io;so++)no[so>>>2]|=(va.charCodeAt(so)&255)<<24-so%4*8;return new Gr.init(no,io)}},ga=Yr.Utf8={stringify:function(va){try{return decodeURIComponent(escape(Wn.stringify(va)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(va){return Wn.parse(unescape(encodeURIComponent(va)))}},eo=jr.BufferedBlockAlgorithm=Ur.extend({reset:function(){this._data=new Gr.init,this._nDataBytes=0},_append:function(va){typeof va=="string"&&(va=ga.parse(va)),this._data.concat(va),this._nDataBytes+=va.sigBytes},_process:function(va){var io=this._data,no=io.words,so=io.sigBytes,ao=this.blockSize,fo=ao*4,lo=so/fo;va?lo=Nr.ceil(lo):lo=Nr.max((lo|0)-this._minBufferSize,0);var oo=lo*ao,po=Nr.min(oo*4,so);if(oo){for(var mo=0;mo<oo;mo+=ao)this._doProcessBlock(no,mo);var $o=no.splice(0,oo);io.sigBytes-=po}return new Gr.init($o,po)},clone:function(){var va=Ur.clone.call(this);return va._data=this._data.clone(),va},_minBufferSize:0});jr.Hasher=eo.extend({cfg:Ur.extend(),init:function(va){this.cfg=this.cfg.extend(va),this.reset()},reset:function(){eo.reset.call(this),this._doReset()},update:function(va){return this._append(va),this._process(),this},finalize:function(va){va&&this._append(va);var io=this._doFinalize();return io},blockSize:16,_createHelper:function(va){return function(io,no){return new va.init(no).finalize(io)}},_createHmacHelper:function(va){return function(io,no){return new _i.HMAC.init(va,no).finalize(io)}}});var _i=Lr.algo={};return Lr}(Math);return Mr})}(core)),core.exports}(function($r,pr){(function(Mr,Nr){$r.exports=Nr(requireCore())})(commonjsGlobal,function(Mr){return function(Nr){var Dr=Mr,Br=Dr.lib,Lr=Br.WordArray,jr=Br.Hasher,Ur=Dr.algo,Gr=[],Yr=[];(function(){function ga(io){for(var no=Nr.sqrt(io),so=2;so<=no;so++)if(!(io%so))return!1;return!0}function eo(io){return(io-(io|0))*4294967296|0}for(var _i=2,va=0;va<64;)ga(_i)&&(va<8&&(Gr[va]=eo(Nr.pow(_i,1/2))),Yr[va]=eo(Nr.pow(_i,1/3)),va++),_i++})();var Qr=[],Wn=Ur.SHA256=jr.extend({_doReset:function(){this._hash=new Lr.init(Gr.slice(0))},_doProcessBlock:function(ga,eo){for(var _i=this._hash.words,va=_i[0],io=_i[1],no=_i[2],so=_i[3],ao=_i[4],fo=_i[5],lo=_i[6],oo=_i[7],po=0;po<64;po++){if(po<16)Qr[po]=ga[eo+po]|0;else{var mo=Qr[po-15],$o=(mo<<25|mo>>>7)^(mo<<14|mo>>>18)^mo>>>3,Xn=Qr[po-2],Fr=(Xn<<15|Xn>>>17)^(Xn<<13|Xn>>>19)^Xn>>>10;Qr[po]=$o+Qr[po-7]+Fr+Qr[po-16]}var Vr=ao&fo^~ao&lo,Wr=va&io^va&no^io&no,Jr=(va<<30|va>>>2)^(va<<19|va>>>13)^(va<<10|va>>>22),Gn=(ao<<26|ao>>>6)^(ao<<21|ao>>>11)^(ao<<7|ao>>>25),to=oo+Gn+Vr+Yr[po]+Qr[po],ro=Jr+Wr;oo=lo,lo=fo,fo=ao,ao=so+to|0,so=no,no=io,io=va,va=to+ro|0}_i[0]=_i[0]+va|0,_i[1]=_i[1]+io|0,_i[2]=_i[2]+no|0,_i[3]=_i[3]+so|0,_i[4]=_i[4]+ao|0,_i[5]=_i[5]+fo|0,_i[6]=_i[6]+lo|0,_i[7]=_i[7]+oo|0},_doFinalize:function(){var ga=this._data,eo=ga.words,_i=this._nDataBytes*8,va=ga.sigBytes*8;return eo[va>>>5]|=128<<24-va%32,eo[(va+64>>>9<<4)+14]=Nr.floor(_i/4294967296),eo[(va+64>>>9<<4)+15]=_i,ga.sigBytes=eo.length*4,this._process(),this._hash},clone:function(){var ga=jr.clone.call(this);return ga._hash=this._hash.clone(),ga}});Dr.SHA256=jr._createHelper(Wn),Dr.HmacSHA256=jr._createHmacHelper(Wn)}(Math),Mr.SHA256})})(sha256$1);var sha256Exports=sha256$1.exports;const I=getDefaultExportFromCjs$1(sha256Exports);var encBase64={exports:{}};(function($r,pr){(function(Mr,Nr){$r.exports=Nr(requireCore())})(commonjsGlobal,function(Mr){return function(){var Nr=Mr,Dr=Nr.lib,Br=Dr.WordArray,Lr=Nr.enc;Lr.Base64={stringify:function(Ur){var Gr=Ur.words,Yr=Ur.sigBytes,Qr=this._map;Ur.clamp();for(var Wn=[],ga=0;ga<Yr;ga+=3)for(var eo=Gr[ga>>>2]>>>24-ga%4*8&255,_i=Gr[ga+1>>>2]>>>24-(ga+1)%4*8&255,va=Gr[ga+2>>>2]>>>24-(ga+2)%4*8&255,io=eo<<16|_i<<8|va,no=0;no<4&&ga+no*.75<Yr;no++)Wn.push(Qr.charAt(io>>>6*(3-no)&63));var so=Qr.charAt(64);if(so)for(;Wn.length%4;)Wn.push(so);return Wn.join("")},parse:function(Ur){var Gr=Ur.length,Yr=this._map,Qr=this._reverseMap;if(!Qr){Qr=this._reverseMap=[];for(var Wn=0;Wn<Yr.length;Wn++)Qr[Yr.charCodeAt(Wn)]=Wn}var ga=Yr.charAt(64);if(ga){var eo=Ur.indexOf(ga);eo!==-1&&(Gr=eo)}return jr(Ur,Gr,Qr)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function jr(Ur,Gr,Yr){for(var Qr=[],Wn=0,ga=0;ga<Gr;ga++)if(ga%4){var eo=Yr[Ur.charCodeAt(ga-1)]<<ga%4*2,_i=Yr[Ur.charCodeAt(ga)]>>>6-ga%4*2;Qr[Wn>>>2]|=(eo|_i)<<24-Wn%4*8,Wn++}return Br.create(Qr,Wn)}}(),Mr.enc.Base64})})(encBase64);var encBase64Exports=encBase64.exports;const b=getDefaultExportFromCjs$1(encBase64Exports);var u=($r,pr,Mr)=>new Promise((Nr,Dr)=>{var Br=Ur=>{try{jr(Mr.next(Ur))}catch(Gr){Dr(Gr)}},Lr=Ur=>{try{jr(Mr.throw(Ur))}catch(Gr){Dr(Gr)}},jr=Ur=>Ur.done?Nr(Ur.value):Promise.resolve(Ur.value).then(Br,Lr);jr((Mr=Mr.apply($r,pr)).next())}),f=($r=>($r.ParseRedirectResult="magic_oauth_parse_redirect_result",$r))(f||{}),_=($r=>($r.InvalidRequest="invalid_request",$r.InvalidClient="invalid_client",$r.InvalidScope="invalid_scope",$r.InvalidGrant="invalid_grant",$r.UnauthorizedClient="unauthorized_client",$r.UnsupportedResponseType="unsupported_response_type",$r.UnsupportedGrantType="unsupported_grant_type",$r.UnsupportedTokenType="unsupported_token_type",$r.AccessDenied="access_denied",$r.ServerError="server_error",$r.TemporarilyUnavailable="temporarily_unavailable",$r))(_||{}),m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",R=typeof window<"u"&&!!window.crypto,w=R&&!!window.crypto.subtle;function U($r){return Array.from($r).map(pr=>m[pr%m.length]).join("")}function y($r){let pr=Mr=>Mr.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");if($r instanceof ArrayBuffer){let Mr=new Uint8Array($r),Nr=Array.from(Mr).map(Br=>String.fromCharCode(Br)).join(""),Dr=btoa(Nr);return pr(Dr)}return pr(b.stringify($r))}function O($r){return u(this,null,function*(){if(w){let pr=new TextEncoder().encode($r);return crypto.subtle.digest("SHA-256",pr).then(y)}return y(I($r))})}function h($r){let pr=new Uint8Array($r);if(R)window.crypto.getRandomValues(pr);else for(let Mr=0;Mr<$r;Mr+=1)pr[Mr]=Math.floor(Math.random()*Math.floor(255));return U(pr)}function A(){return u(this,null,function*(){let $r=h(128),pr=h(128),Mr=yield O(pr);return{verifier:pr,challenge:Mr,state:$r}})}var v=class extends q.Internal{constructor(){super(...arguments),this.name="oauth",this.config={},this.compat={"magic-sdk":">=2.4.6","@magic-sdk/react-native":!1,"@magic-sdk/react-native-bare":!1,"@magic-sdk/react-native-expo":!1}}loginWithRedirect($r){return this.utils.createPromiEvent(pr=>u(this,null,function*(){let{provider:Mr,query:Nr}=yield x.call(this,$r);window.location.href=new URL(`/v1/oauth2/${Mr}/start?${Nr}`,this.sdk.endpoint).href,pr()}))}getRedirectResult(){let $r=window.location.search,pr=window.location.origin+window.location.pathname;return window.history.replaceState(null,"",pr),D.call(this,$r)}},g="oauth_redirect_metadata";function x($r){return u(this,null,function*(){yield this.utils.storage.removeItem(g);let{provider:pr,redirectURI:Mr,scope:Nr,loginHint:Dr}=$r,{verifier:Br,challenge:Lr,state:jr}=yield A(),Ur=JSON.stringify({verifier:Br,state:jr});return yield this.utils.storage.setItem(g,Ur),{query:[`magic_api_key=${encodeURIComponent(this.sdk.apiKey)}`,`magic_challenge=${encodeURIComponent(Lr)}`,`state=${encodeURIComponent(jr)}`,`platform=${encodeURIComponent("web")}`,Nr&&`scope=${encodeURIComponent(Nr.join(" "))}`,Mr&&`redirect_uri=${encodeURIComponent(Mr)}`,Dr&&`login_hint=${encodeURIComponent(Dr)}`].reduce((Gr,Yr)=>Yr?`${Gr}&${Yr}`:Gr),provider:pr,redirectURI:Mr}})}function D($r){return this.utils.createPromiEvent((pr,Mr)=>u(this,null,function*(){var Nr;let Dr=yield this.utils.storage.getItem(g),{verifier:Br,state:Lr}=JSON.parse(Dr);this.utils.storage.removeItem(g);let jr=this.utils.createJsonRpcRequestPayload("magic_oauth_parse_redirect_result",[$r,Br,Lr]),Ur=yield this.request(jr),Gr=Ur,Yr=Ur;Yr.error&&Mr(this.createError(Yr.error,(Nr=Yr.error_description)!=null?Nr:"An error occurred.",{errorURI:Yr.error_uri,provider:Yr.provider})),pr(Gr)}))}const es=Object.freeze(Object.defineProperty({__proto__:null,OAuthErrorCode:_,OAuthExtension:v,OAuthPayloadMethods:f},Symbol.toStringTag,{value:"Module"})),require$$4=getAugmentedNamespace(es);var __createBinding$6=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function($r,pr,Mr,Nr){Nr===void 0&&(Nr=Mr),Object.defineProperty($r,Nr,{enumerable:!0,get:function(){return pr[Mr]}})}:function($r,pr,Mr,Nr){Nr===void 0&&(Nr=Mr),$r[Nr]=pr[Mr]}),__setModuleDefault$6=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function($r,pr){Object.defineProperty($r,"default",{enumerable:!0,value:pr})}:function($r,pr){$r.default=pr}),__importStar$6=commonjsGlobal&&commonjsGlobal.__importStar||function($r){if($r&&$r.__esModule)return $r;var pr={};if($r!=null)for(var Mr in $r)Mr!=="default"&&Object.prototype.hasOwnProperty.call($r,Mr)&&__createBinding$6(pr,$r,Mr);return __setModuleDefault$6(pr,$r),pr};Object.defineProperty(MagicConnector$1,"__esModule",{value:!0});MagicConnector$1.MagicConnector=void 0;const schemas_1$1=dist$6,configuration_1$1=configuration$1,AbstractConnector_1=AbstractConnector$1;class MagicConnector extends AbstractConnector_1.AbstractConnector{constructor(pr){super({supportedChainIds:configuration_1$1.getConfiguration()[schemas_1$1.ProviderType.MAGIC].chains}),this.activate=async()=>{var Mr;if(this.magic=await this.buildMagicInstance(this.chainId),!await this.magic.user.isLoggedIn())throw new Error("Magic: user isn't logged in");const Dr=await this.getProvider(),Br=await Dr.request({method:"eth_accounts"});return this.account=(Mr=Br[0])!==null&&Mr!==void 0?Mr:null,{provider:Dr,chainId:this.chainId,account:this.account}},this.getProvider=async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");const Mr=await this.magic.wallet.getProvider();return Object.assign(Object.assign({},Mr),{request:new Proxy(Mr.request,{apply:async(Nr,Dr,Br)=>{var Lr,jr,Ur;if(((Lr=Br[0])===null||Lr===void 0?void 0:Lr.method)==="wallet_switchEthereumChain")try{const Gr=parseInt((Ur=(jr=Br[0])===null||jr===void 0?void 0:jr.params[0])===null||Ur===void 0?void 0:Ur.chainId,16);return this.supportedChainIds&&!this.supportedChainIds.includes(Gr)?{code:2020202,message:"Unsupported Magic ChainId"}:(this.magic=await this.buildMagicInstance(Gr),this.emitUpdate({chainId:Gr}),null)}catch{return{code:2020201,message:"Error changing the Magic ChainId"}}return Nr.bind(Mr)(...Br)}})})},this.getChainId=async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");return this.chainId},this.getAccount=async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");return this.account},this.deactivate=()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");this.magic.user.logout(),this.emitDeactivate()},this.buildMagicInstance=async Mr=>{const{Magic:Nr}=await Promise.resolve().then(()=>__importStar$6(require$$3)),{OAuthExtension:Dr}=await Promise.resolve().then(()=>__importStar$6(require$$4)),Br=configuration_1$1.getConfiguration()[schemas_1$1.ProviderType.MAGIC];return new Nr(Br.apiKey,{extensions:[new Dr],network:{rpcUrl:Br.urls[Mr],chainId:Mr}})},this.chainId=pr,this.account=null}}MagicConnector$1.MagicConnector=MagicConnector;(function($r){var pr=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Nr,Dr,Br,Lr){Lr===void 0&&(Lr=Br),Object.defineProperty(Nr,Lr,{enumerable:!0,get:function(){return Dr[Br]}})}:function(Nr,Dr,Br,Lr){Lr===void 0&&(Lr=Br),Nr[Lr]=Dr[Br]}),Mr=commonjsGlobal&&commonjsGlobal.__exportStar||function(Nr,Dr){for(var Br in Nr)Br!=="default"&&!Object.prototype.hasOwnProperty.call(Dr,Br)&&pr(Dr,Nr,Br)};Object.defineProperty($r,"__esModule",{value:!0}),Mr(AbstractConnector$1,$r),Mr(FortmaticConnector$1,$r),Mr(InjectedConnector$2,$r),Mr(NetworkConnector$2,$r),Mr(WalletLinkConnector$2,$r),Mr(WalletConnectV2Connector$1,$r),Mr(MagicConnector$1,$r)})(connectors);var storage={},Storage$1={};Object.defineProperty(Storage$1,"__esModule",{value:!0});Storage$1.Storage=void 0;class Storage{}Storage$1.Storage=Storage;var LocalStorage$1={};Object.defineProperty(LocalStorage$1,"__esModule",{value:!0});LocalStorage$1.LocalStorage=void 0;const Storage_1=Storage$1;class LocalStorage extends Storage_1.Storage{get(pr){const Mr=window.localStorage.getItem(pr);return Mr===null?void 0:Mr}set(pr,Mr){window.localStorage.setItem(pr,Mr)}remove(pr){window.localStorage.removeItem(pr)}removeRegExp(pr){for(let Mr=localStorage.length-1;Mr>=0;Mr--){const Nr=localStorage.key(Mr);Nr&&pr.test(Nr)&&localStorage.removeItem(Nr)}}}LocalStorage$1.LocalStorage=LocalStorage;(function($r){var pr=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Nr,Dr,Br,Lr){Lr===void 0&&(Lr=Br),Object.defineProperty(Nr,Lr,{enumerable:!0,get:function(){return Dr[Br]}})}:function(Nr,Dr,Br,Lr){Lr===void 0&&(Lr=Br),Nr[Lr]=Dr[Br]}),Mr=commonjsGlobal&&commonjsGlobal.__exportStar||function(Nr,Dr){for(var Br in Nr)Br!=="default"&&!Object.prototype.hasOwnProperty.call(Dr,Br)&&pr(Dr,Nr,Br)};Object.defineProperty($r,"__esModule",{value:!0}),Mr(Storage$1,$r),Mr(LocalStorage$1,$r)})(storage);var ProviderAdapter$1={};Object.defineProperty(ProviderAdapter$1,"__esModule",{value:!0});ProviderAdapter$1.ProviderAdapter=void 0;class ProviderAdapter{constructor(pr){this.provider=pr,this.id=0,this.on=(Mr,Nr)=>this.provider.on(Mr,Nr),this.emit=(Mr,...Nr)=>this.provider.emit(Mr,Nr),this.removeListener=(Mr,Nr)=>this.provider.removeListener(Mr,Nr),this.request=async({method:Mr,params:Nr})=>this.isModernProvider()?this.provider.request({method:Mr,params:Nr}):this.send(Mr,Nr),this.sendAsync=async(Mr,Nr)=>this.hasSendAsync()?this.provider.sendAsync(Mr,(Dr,Br)=>{Br&&!Br.hasOwnProperty("result")?Nr(Dr,{id:0,jsonrpc:"2.0",result:Br}):Nr(Dr,Br)}):this.send(Mr,Nr)}static adapt(pr){const Mr=new ProviderAdapter(pr);return Object.assign(Object.assign({},pr),{on:Mr.on,emit:Mr.emit,removeListener:Mr.removeListener,request:Mr.request,sendAsync:Mr.sendAsync,send:Mr.send.bind(Mr)})}async send(pr,Mr){let Nr,Dr,Br;const Lr=typeof Mr=="function";if(Lr){const jr=pr;Dr=jr.params||[],Nr=jr.method,Br=Mr}else Nr=pr,Dr=Mr||[],Br=(jr,Ur)=>{if(jr)throw jr;return Ur};if(this.isModernProvider()){const[jr,Ur]=await this.provider.request({method:Nr,params:Dr}).then(Yr=>[null,Yr]).catch(Yr=>[Yr,void 0]);return Br(jr,Lr?{id:"",jsonrpc:"2.0",result:Ur}:Ur)}else{this.patchOldMobile();const[jr,Ur]=Lr?await new Promise(Gr=>this.provider.send(pr,(Yr,Qr)=>{Gr([Yr,Qr])})):await new Promise(Gr=>this.provider.send({jsonrpc:"2.0",id:++this.id,method:Nr,params:Dr},(Yr,Qr)=>{Gr([Qr&&Qr.hasOwnProperty("error")?Qr.error:Yr,Qr&&Qr.hasOwnProperty("result")?Qr.result:Qr])}));return Br(jr,Ur)}}isModernProvider(){return typeof this.provider.request=="function"}hasSendAsync(){return typeof this.provider.sendAsync=="function"}patchOldMobile(){this.provider&&!this.provider.isDapper&&!this.provider.isFortmatic&&!this.provider.isMetamask&&this.hasSendAsync()&&this.provider.send!==this.provider.sendAsync&&(this.provider.send=this.provider.sendAsync)}}ProviderAdapter$1.ProviderAdapter=ProviderAdapter;Object.defineProperty(ConnectionManager$1,"__esModule",{value:!0});ConnectionManager$1.connection=ConnectionManager$1.ConnectionManager=void 0;const chain_id_1=requireChainId(),provider_type_1=providerType,types_1=require$$2$2,connectors_1=connectors,storage_1=storage,configuration_1=configuration$1,ProviderAdapter_1=ProviderAdapter$1;class ConnectionManager{constructor(pr){this.storage=pr,this.getWalletName=()=>{if(this.connector instanceof connectors_1.WalletConnectV2Connector)return this.connector.getWalletName()},this.clearConnectionData=()=>{const{storageKey:Mr}=configuration_1.getConfiguration();this.storage.remove(Mr),connectors_1.WalletConnectV2Connector.clearStorage(this.storage)},this.handleWeb3ReactDeactivate=()=>{this.connector&&(this.connector.removeListener(types_1.ConnectorEvent.Deactivate,this.handleWeb3ReactDeactivate),this.connector.removeAllListeners(types_1.ConnectorEvent.Update)),this.disconnect().catch(console.error)}}async connect(pr,Mr=chain_id_1.ChainId.ETHEREUM_MAINNET){this.connector=this.buildConnector(pr,Mr),this.connector.on(types_1.ConnectorEvent.Deactivate,this.handleWeb3ReactDeactivate),pr===provider_type_1.ProviderType.MAGIC&&this.connector.on(types_1.ConnectorEvent.Update,({chainId:Br})=>{Br&&this.setConnectionData(pr,Br)});const{provider:Nr,account:Dr}=await this.connector.activate();return this.setConnectionData(pr,Mr),{provider:ProviderAdapter_1.ProviderAdapter.adapt(Nr),providerType:pr,account:Dr||"",chainId:Mr}}async tryPreviousConnection(){const pr=this.getConnectionData();if(!pr)throw new Error("Could not find a valid provider. Make sure to call the `connect` method first");const Mr=await this.connect(pr.providerType,pr.chainId);if(Mr.providerType===provider_type_1.ProviderType.INJECTED){const Nr=await Mr.provider.request({method:"eth_chainId"}),Dr=Nr?parseInt(Nr,16):null;Dr&&pr.chainId!==Dr&&this.setConnectionData(pr.providerType,Dr)}return Object.assign(Object.assign({},Mr),{chainId:this.getConnectionData().chainId})}getAvailableProviders(){const pr=[provider_type_1.ProviderType.FORTMATIC,provider_type_1.ProviderType.WALLET_CONNECT,provider_type_1.ProviderType.WALLET_LINK];return typeof window<"u"&&window.ethereum!==void 0?pr.unshift(provider_type_1.ProviderType.INJECTED):pr.unshift(provider_type_1.ProviderType.METAMASK_MOBILE),pr}async disconnect(){this.connector&&(this.connector.deactivate(),this.isClosableConnector()&&await this.connector.close()),this.clearConnectionData(),this.connector=void 0}async getProvider(){if(!this.connector)throw new Error("No valid connector found. Please .connect() first");return this.connector.getProvider()}async createProvider(pr,Mr=chain_id_1.ChainId.ETHEREUM_MAINNET){const Dr=await this.buildConnector(pr,Mr).getProvider();return ProviderAdapter_1.ProviderAdapter.adapt(Dr)}buildConnector(pr,Mr){switch(pr){case provider_type_1.ProviderType.INJECTED:return new connectors_1.InjectedConnector(Mr);case provider_type_1.ProviderType.FORTMATIC:return new connectors_1.FortmaticConnector(Mr);case provider_type_1.ProviderType.MAGIC:return new connectors_1.MagicConnector(Mr);case provider_type_1.ProviderType.WALLET_LINK:return new connectors_1.WalletLinkConnector(Mr);case provider_type_1.ProviderType.NETWORK:return new connectors_1.NetworkConnector(Mr);case provider_type_1.ProviderType.WALLET_CONNECT_V2:return new connectors_1.WalletConnectV2Connector(Mr);default:throw new Error(`Invalid provider ${pr}`)}}getConnectionData(){const{storageKey:pr}=configuration_1.getConfiguration(),Mr=this.storage.get(pr);return Mr?JSON.parse(Mr):void 0}setConnectionData(pr,Mr){const{storageKey:Nr}=configuration_1.getConfiguration(),Dr=JSON.stringify({providerType:pr,chainId:Mr});this.storage.set(Nr,Dr)}isClosableConnector(){return this.connector&&typeof this.connector.close<"u"}}ConnectionManager$1.ConnectionManager=ConnectionManager;ConnectionManager$1.connection=new ConnectionManager(new storage_1.LocalStorage);var types$1={};Object.defineProperty(types$1,"__esModule",{value:!0});(function($r){var pr=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Nr,Dr,Br,Lr){Lr===void 0&&(Lr=Br),Object.defineProperty(Nr,Lr,{enumerable:!0,get:function(){return Dr[Br]}})}:function(Nr,Dr,Br,Lr){Lr===void 0&&(Lr=Br),Nr[Lr]=Dr[Br]}),Mr=commonjsGlobal&&commonjsGlobal.__exportStar||function(Nr,Dr){for(var Br in Nr)Br!=="default"&&!Object.prototype.hasOwnProperty.call(Dr,Br)&&pr(Dr,Nr,Br)};Object.defineProperty($r,"__esModule",{value:!0}),Mr(ConnectionManager$1,$r),Mr(connectors,$r),Mr(configuration$1,$r),Mr(types$1,$r)})(dist$7);const manDefault="https://cdn.decentraland.org/@dcl/auth-site/1.3.2-7900126256.commit-8819962/assets/ManDefault-cb03f4f3.webp",platformImg="https://cdn.decentraland.org/@dcl/auth-site/1.3.2-7900126256.commit-8819962/assets/Platform-dfc6309e.webp";function getAnalytics(){return window.analytics}const usePageTracking=()=>{reactExports.useEffect(()=>{const $r=getAnalytics();$r&&$r.page()},[])};var TrackingEvents=($r=>($r.LOGIN_CLICK="Click Login Button",$r.LOGIN_SUCCESS="Login Success",$r.LOGIN_ERROR="Login Error",$r.CLICK="Click Button",$r.AVATAR_EDIT_SUCCESS="Avatar Edit Success",$r.TERMS_OF_SERVICE_SUCCESS="Terms of service success",$r))(TrackingEvents||{}),ClickEvents=($r=>($r.LEARN_MORE="Learn More",$r.DENY_SIGN_IN="Deny Sign In",$r.DENY_WALLET_INTERACTION="Deny Wallet Interaction",$r.APPROVE_SING_IN="Approve Sign In",$r.APPROVE_WALLET_INTERACTION="Approve Wallet Interaction",$r.RANDOMIZE="Randomize default profile",$r.BACK_TO_AVATAR_RANDOMIZATION_VIEW="Back to avatar randomization view",$r.SUBMIT_PROFILE="Submit profile",$r))(ClickEvents||{}),ConnectionType=($r=>($r.WEB3="web3",$r.WEB2="web2",$r.GUEST="guest",$r))(ConnectionType||{});const AUTH_SERVER_URL$2="https://auth-api.decentraland.zone",SEGMENT_API_KEY$2="FQqbzV2KeUKe2RPOeFkedKRPkJAFsU9r",PEER_URL$2="https://peer.decentraland.zone",FEATURE_FLAGS_URL$2="https://feature-flags.decentraland.org",FEATURE_FLAGS_INTERVAL$2="60000",BUILDER_SERVER_URL$2="https://builder-api.decentraland.zone",dev={AUTH_SERVER_URL:AUTH_SERVER_URL$2,SEGMENT_API_KEY:SEGMENT_API_KEY$2,PEER_URL:PEER_URL$2,FEATURE_FLAGS_URL:FEATURE_FLAGS_URL$2,FEATURE_FLAGS_INTERVAL:FEATURE_FLAGS_INTERVAL$2,BUILDER_SERVER_URL:BUILDER_SERVER_URL$2},AUTH_SERVER_URL$1="https://auth-api.decentraland.org",SEGMENT_API_KEY$1="FQqbzV2KeUKe2RPOeFkedKRPkJAFsU9r",PEER_URL$1="https://peer.decentraland.org",FEATURE_FLAGS_URL$1="https://feature-flags.decentraland.org",FEATURE_FLAGS_INTERVAL$1="60000",BUILDER_SERVER_URL$1="https://builder-api.decentraland.today",prod={AUTH_SERVER_URL:AUTH_SERVER_URL$1,SEGMENT_API_KEY:SEGMENT_API_KEY$1,PEER_URL:PEER_URL$1,FEATURE_FLAGS_URL:FEATURE_FLAGS_URL$1,FEATURE_FLAGS_INTERVAL:FEATURE_FLAGS_INTERVAL$1,BUILDER_SERVER_URL:BUILDER_SERVER_URL$1},AUTH_SERVER_URL="https://auth-api.decentraland.today",SEGMENT_API_KEY="FQqbzV2KeUKe2RPOeFkedKRPkJAFsU9r",PEER_URL="https://peer.decentraland.org",FEATURE_FLAGS_URL="https://feature-flags.decentraland.org",FEATURE_FLAGS_INTERVAL="60000",BUILDER_SERVER_URL="https://builder-api.decentraland.org",stg={AUTH_SERVER_URL,SEGMENT_API_KEY,PEER_URL,FEATURE_FLAGS_URL,FEATURE_FLAGS_INTERVAL,BUILDER_SERVER_URL},config=dist$8.createConfig({[dist$8.Env.DEVELOPMENT]:dev,[dist$8.Env.STAGING]:stg,[dist$8.Env.PRODUCTION]:prod},{systemEnvVariables:{REACT_APP_DCL_DEFAULT_ENV:{}.VITE_REACT_APP_DCL_DEFAULT_ENV??"dev"}});async function fetchProfile($r){const pr=config.get("PEER_URL"),Mr=await fetch(`${pr}/lambdas/profiles/${$r}`);return Mr.ok?await Mr.json():null}function isErrorWithMessage($r){return $r!=null&&typeof $r=="object"&&"message"in $r}function isRpcError($r){return $r!=null&&typeof $r=="object"&&"error"in $r&&$r.error!==void 0&&$r.error!==null&&typeof $r.error=="object"&&"message"in $r.error&&"code"in $r.error}const background$2="_background_1ksp2_1",emptyProfile="_emptyProfile_1ksp2_11",main$7="_main_1ksp2_27",left$3="_left_1ksp2_38",right$3="_right_1ksp2_49",wearablePlatform="_wearablePlatform_1ksp2_64",changeAccount="_changeAccount_1ksp2_70",errorLogo="_errorLogo_1ksp2_83",logo$1="_logo_1ksp2_92",title$4="_title_1ksp2_98",description$1="_description_1ksp2_105",code="_code_1ksp2_112",buttons="_buttons_1ksp2_119",closeWindow="_closeWindow_1ksp2_129",errorMessage="_errorMessage_1ksp2_135",noButton="_noButton_1ksp2_145",yesButton="_yesButton_1ksp2_147",wearableDefaultImg="_wearableDefaultImg_1ksp2_164",loading="_loading_1ksp2_176",communityBubble="_communityBubble_1ksp2_180",styles$a={background:background$2,emptyProfile,main:main$7,left:left$3,right:right$3,wearablePlatform,changeAccount,errorLogo,logo:logo$1,title:title$4,description:description$1,code,buttons,closeWindow,errorMessage,noButton,yesButton,wearableDefaultImg,loading,communityBubble},RequestPage=()=>{usePageTracking();const $r=useParams(),pr=useNavigate(),Mr=reactExports.useRef(),[Nr,Dr]=reactExports.useState(2),[Br,Lr]=reactExports.useState(!1),[jr,Ur]=reactExports.useState(),Gr=reactExports.useRef(),[Yr,Qr]=reactExports.useState(),Wn=reactExports.useRef(),ga=reactExports.useRef(),eo=$r.requestId??"",[_i,va]=reactExports.useState(!1),io=reactExports.useCallback(()=>{pr(`/login?redirectTo=/auth/requests/${eo}`)},[]);reactExports.useEffect(()=>((async()=>{try{const mo=await dist$7.connection.tryPreviousConnection();if(Mr.current=new BrowserProvider(mo.provider),!mo.account)throw new Error("No account connected");if(!await fetchProfile(mo.account)){pr(`/setup?redirectTo=/auth/requests/${eo}`);return}}catch{io();return}try{const $o=await(await Mr.current.getSigner()).getAddress();getAnalytics().identify({ethAddress:$o});const Xn=await authServerFetch("recover",{requestId:eo});Gr.current=Xn;const Fr=await fetchProfile($o);if(Ur(Fr),ga.current=$o,va(!0),Xn.sender&&Xn.sender!==$o.toLowerCase()){Dr(1);return}Wn.current=setTimeout(()=>{Dr(0)},new Date(Xn.expiration).getTime()-Date.now()),Xn.method==="dcl_personal_sign"?Dr(4):Dr(8)}catch(mo){Qr(isErrorWithMessage(mo)?mo.message:"Unknown error"),Dr(3)}})(),()=>{clearTimeout(Wn.current)}),[]),reactExports.useEffect(()=>{Nr!==4&&Nr!==8&&clearTimeout(Wn.current)},[Nr]);const no=reactExports.useCallback(async()=>{var mo;Lr(!0),getAnalytics().track(TrackingEvents.CLICK,{action:ClickEvents.DENY_SIGN_IN});try{const $o=await((mo=Mr.current)==null?void 0:mo.getSigner());$o&&await authServerFetch("outcome",{requestId:eo,sender:await $o.getAddress(),error:{code:-32003,message:"Transaction rejected"}})}finally{Lr(!1),Dr(5)}},[]),so=reactExports.useCallback(mo=>{ga.current&&mo.profile===ga.current&&va(!1)},[]),ao=reactExports.useCallback(async()=>{getAnalytics().track(TrackingEvents.CLICK,{action:ClickEvents.APPROVE_SING_IN}),Lr(!0);const mo=Mr.current;try{if(!mo)throw new Error("Provider not created");const $o=await mo.getSigner(),Xn=await $o.signMessage(Gr.current.params[0]),Fr=await authServerFetch("outcome",{requestId:eo,sender:await $o.getAddress(),result:Xn});if(Fr.error)throw new Error(Fr.error);Dr(7)}catch($o){Qr(isErrorWithMessage($o)?$o.message:"Unknown error"),Dr(6)}finally{Lr(!1)}},[Lr]),fo=reactExports.useCallback(()=>{getAnalytics().track(TrackingEvents.CLICK,{action:ClickEvents.DENY_WALLET_INTERACTION}),Dr(9)},[]),lo=reactExports.useCallback(async()=>{var $o;Lr(!0);const mo=Mr.current;try{if(!mo)throw new Error("Provider not created");const Xn=await mo.getSigner(),Fr=await mo.send(Gr.current.method,Gr.current.params);getAnalytics().track(TrackingEvents.CLICK,{action:ClickEvents.APPROVE_WALLET_INTERACTION,method:Gr.current.method});const Vr=await authServerFetch("outcome",{requestId:eo,sender:await Xn.getAddress(),result:Fr});if(Vr.error)throw new Error(Vr.error);Dr(11)}catch(Xn){console.error("Wallet error",JSON.stringify(Xn));const Fr=await(($o=Mr.current)==null?void 0:$o.getSigner());Fr&&(isRpcError(Xn)?await authServerFetch("outcome",{requestId:eo,sender:await Fr.getAddress(),error:Xn.error}):await authServerFetch("outcome",{requestId:eo,sender:await Fr.getAddress(),error:{code:999,message:isErrorWithMessage(Xn)?Xn.message:"Unknown error"}})),Qr(isErrorWithMessage(Xn)?Xn.message:"Unknown error"),Dr(10)}},[]),oo=reactExports.useCallback(async mo=>{mo.preventDefault(),await dist$7.connection.disconnect(),io()},[]),po=reactExports.useCallback(mo=>jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("div",{className:`${styles$a.background} ${(!ga||jr===null)&&Nr!==2?styles$a.emptyProfile:""}`}),jsxRuntimeExports.jsxs("div",{className:styles$a.main,children:[jsxRuntimeExports.jsxs("div",{className:styles$a.left,children:[mo.children,mo.canChangeAccount?jsxRuntimeExports.jsxs("div",{className:styles$a.changeAccount,children:["Use another profile?"," ",jsxRuntimeExports.jsx("a",{href:"/auth/login",onClick:oo,children:"Return to log in"})]}):null]}),jsxRuntimeExports.jsx("div",{className:`${styles$a.right} ${_i?styles$a.loading:""}`,children:ga.current&&jr!==null?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("img",{src:manDefault,alt:"Avatar",className:styles$a.wearableDefaultImg}),jsxRuntimeExports.jsx(WearablePreview_2,{lockBeta:!0,panning:!1,disableBackground:!0,profile:ga.current,dev:!1,onUpdate:so}),jsxRuntimeExports.jsx("img",{src:platformImg,alt:"platform",className:styles$a.wearablePlatform})]}):null}),jsxRuntimeExports.jsx(CommunityBubble$3.CommunityBubble,{className:styles$a.communityBubble})]})]}),[_i,Nr]);return Nr===0?jsxRuntimeExports.jsxs(po,{children:[jsxRuntimeExports.jsx("div",{className:styles$a.errorLogo}),jsxRuntimeExports.jsx("div",{className:styles$a.title,children:"Looks like you took too long and the request has expired"}),jsxRuntimeExports.jsx("div",{className:styles$a.description,children:"Please return to Decentraland's Desktop App to try again."}),jsxRuntimeExports.jsx(CloseWindow,{})]}):Nr===1?jsxRuntimeExports.jsxs(po,{canChangeAccount:!0,children:[jsxRuntimeExports.jsx("div",{className:styles$a.errorLogo}),jsxRuntimeExports.jsx("div",{className:styles$a.title,children:"Looks like you are connected with a different account."}),jsxRuntimeExports.jsx("div",{className:styles$a.description,children:"Please change your wallet account to the one connected to the Desktop App."})]}):Nr===2?jsxRuntimeExports.jsx(po,{children:jsxRuntimeExports.jsx("div",{className:styles$a.left,children:jsxRuntimeExports.jsx(Loader_3,{active:!0,size:"huge"})})}):Nr===3?jsxRuntimeExports.jsxs(po,{children:[jsxRuntimeExports.jsx("div",{className:styles$a.errorLogo}),jsxRuntimeExports.jsx("div",{className:styles$a.title,children:"There was an error recovering the request..."}),jsxRuntimeExports.jsx("div",{className:styles$a.description,children:"The request is not available anymore. Feel free to create a new one and try again."}),jsxRuntimeExports.jsx(CloseWindow,{}),jsxRuntimeExports.jsx("div",{className:styles$a.errorMessage,children:Yr})]}):Nr===4&&Gr.current?jsxRuntimeExports.jsxs(po,{canChangeAccount:!0,isLoading:Br,children:[jsxRuntimeExports.jsx("div",{className:styles$a.logo}),jsxRuntimeExports.jsx("div",{className:styles$a.title,children:"Verify Sign In"}),jsxRuntimeExports.jsx("div",{className:styles$a.description,children:"Do you see the same verification number on your Desktop App?"}),jsxRuntimeExports.jsx("div",{className:styles$a.code,children:Gr.current.code}),jsxRuntimeExports.jsxs("div",{className:styles$a.buttons,children:[jsxRuntimeExports.jsxs(Button$5.Button,{inverted:!0,disabled:Br,onClick:no,className:styles$a.noButton,children:[jsxRuntimeExports.jsx(default_1,{name:"times circle"}),"No, it doesn't"]}),jsxRuntimeExports.jsxs(Button$5.Button,{inverted:!0,loading:Br,disabled:Br,onClick:ao,className:styles$a.yesButton,children:[jsxRuntimeExports.jsx(default_1,{name:"check circle"}),"Yes, they are the same"]})]})]}):Nr===5?jsxRuntimeExports.jsxs(po,{canChangeAccount:!0,children:[jsxRuntimeExports.jsx("div",{className:styles$a.errorLogo}),jsxRuntimeExports.jsx("div",{className:styles$a.title,children:"Did the number not match, or was this action not taken by you?"}),jsxRuntimeExports.jsx("div",{className:styles$a.description,children:"If you're trying to sign in, retry the action. If this action was not initiated by you, dismiss this message."}),jsxRuntimeExports.jsx(CloseWindow,{})]}):Nr===7?jsxRuntimeExports.jsxs(po,{children:[jsxRuntimeExports.jsx("div",{className:styles$a.logo}),jsxRuntimeExports.jsx("div",{className:styles$a.title,children:"Your account is ready!"}),jsxRuntimeExports.jsx("div",{className:styles$a.description,children:"Return to the Desktop App and enjoy Decentraland."}),jsxRuntimeExports.jsx(CloseWindow,{})]}):Nr===8&&Gr.current?jsxRuntimeExports.jsxs(po,{canChangeAccount:!0,isLoading:Br,children:[jsxRuntimeExports.jsx("div",{className:styles$a.logo}),jsxRuntimeExports.jsx("div",{className:styles$a.title,children:"The Desktop App wants to interact with your wallet."}),jsxRuntimeExports.jsx("div",{className:styles$a.description,children:"Review the following data carefully on your wallet before approving it."}),jsxRuntimeExports.jsxs("div",{className:styles$a.buttons,children:[jsxRuntimeExports.jsx(Button$5.Button,{inverted:!0,disabled:Br,onClick:fo,children:"Deny"}),jsxRuntimeExports.jsx(Button$5.Button,{primary:!0,disabled:Br,loading:Br,onClick:lo,children:"Allow"})]})]}):Nr===9?jsxRuntimeExports.jsxs(po,{children:[jsxRuntimeExports.jsx("div",{className:styles$a.errorLogo}),jsxRuntimeExports.jsx("div",{className:styles$a.title,children:"Was this action not initiated by you?"}),jsxRuntimeExports.jsx("div",{className:styles$a.description,children:"If this action was not initiated by you, dismiss this message."}),jsxRuntimeExports.jsx(CloseWindow,{})]}):Nr===11?jsxRuntimeExports.jsxs(po,{children:[jsxRuntimeExports.jsx("div",{className:styles$a.logo}),jsxRuntimeExports.jsx("div",{className:styles$a.title,children:"Wallet interaction complete"}),jsxRuntimeExports.jsx("div",{className:styles$a.description,children:"The action has been executed successfully."}),jsxRuntimeExports.jsx(CloseWindow,{})]}):Nr===6||Nr===10?jsxRuntimeExports.jsxs(po,{children:[jsxRuntimeExports.jsx("div",{className:styles$a.errorLogo}),jsxRuntimeExports.jsx("div",{className:styles$a.title,children:"There was an error while trying to submit the request."}),jsxRuntimeExports.jsx("div",{className:styles$a.description,children:"Return to the Desktop App to try again, or contact support if the error persists."}),jsxRuntimeExports.jsx(CloseWindow,{}),jsxRuntimeExports.jsx("div",{className:styles$a.errorMessage,children:Yr})]}):null},CloseWindow=()=>jsxRuntimeExports.jsx("div",{className:styles$a.closeWindow,children:"You can close this window."}),authServerFetch=async($r,pr)=>{const Mr=config.get("AUTH_SERVER_URL"),Nr=lookup(Mr);await new Promise(Br=>{Nr.on("connect",Br)});const Dr=await Nr.emitWithAck($r,pr);if(Nr.close(),Dr.error)throw new Error(Dr.error);return Dr};var dist$4={},SingleSignOn={},isURL={exports:{}},assertString={exports:{}};(function($r,pr){Object.defineProperty(pr,"__esModule",{value:!0}),pr.default=Nr;function Mr(Dr){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Mr=function(Lr){return typeof Lr}:Mr=function(Lr){return Lr&&typeof Symbol=="function"&&Lr.constructor===Symbol&&Lr!==Symbol.prototype?"symbol":typeof Lr},Mr(Dr)}function Nr(Dr){var Br=typeof Dr=="string"||Dr instanceof String;if(!Br){var Lr=Mr(Dr);throw Dr===null?Lr="null":Lr==="object"&&(Lr=Dr.constructor.name),new TypeError("Expected a string but received a ".concat(Lr))}}$r.exports=pr.default,$r.exports.default=pr.default})(assertString,assertString.exports);var assertStringExports=assertString.exports,isFQDN={exports:{}},merge={exports:{}};(function($r,pr){Object.defineProperty(pr,"__esModule",{value:!0}),pr.default=Mr;function Mr(){var Nr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Dr=arguments.length>1?arguments[1]:void 0;for(var Br in Dr)typeof Nr[Br]>"u"&&(Nr[Br]=Dr[Br]);return Nr}$r.exports=pr.default,$r.exports.default=pr.default})(merge,merge.exports);var mergeExports=merge.exports;(function($r,pr){Object.defineProperty(pr,"__esModule",{value:!0}),pr.default=Lr;var Mr=Dr(assertStringExports),Nr=Dr(mergeExports);function Dr(jr){return jr&&jr.__esModule?jr:{default:jr}}var Br={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};function Lr(jr,Ur){(0,Mr.default)(jr),Ur=(0,Nr.default)(Ur,Br),Ur.allow_trailing_dot&&jr[jr.length-1]==="."&&(jr=jr.substring(0,jr.length-1)),Ur.allow_wildcard===!0&&jr.indexOf("*.")===0&&(jr=jr.substring(2));var Gr=jr.split("."),Yr=Gr[Gr.length-1];return Ur.require_tld&&(Gr.length<2||!Ur.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(Yr)||/\s/.test(Yr))||!Ur.allow_numeric_tld&&/^\d+$/.test(Yr)?!1:Gr.every(function(Qr){return!(Qr.length>63&&!Ur.ignore_max_length||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(Qr)||/[\uff01-\uff5e]/.test(Qr)||/^-|-$/.test(Qr)||!Ur.allow_underscores&&/_/.test(Qr))})}$r.exports=pr.default,$r.exports.default=pr.default})(isFQDN,isFQDN.exports);var isFQDNExports=isFQDN.exports,isIP={exports:{}};(function($r,pr){Object.defineProperty(pr,"__esModule",{value:!0}),pr.default=Gr;var Mr=Nr(assertStringExports);function Nr(Yr){return Yr&&Yr.__esModule?Yr:{default:Yr}}var Dr="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",Br="(".concat(Dr,"[.]){3}").concat(Dr),Lr=new RegExp("^".concat(Br,"$")),jr="(?:[0-9a-fA-F]{1,4})",Ur=new RegExp("^("+"(?:".concat(jr,":){7}(?:").concat(jr,"|:)|")+"(?:".concat(jr,":){6}(?:").concat(Br,"|:").concat(jr,"|:)|")+"(?:".concat(jr,":){5}(?::").concat(Br,"|(:").concat(jr,"){1,2}|:)|")+"(?:".concat(jr,":){4}(?:(:").concat(jr,"){0,1}:").concat(Br,"|(:").concat(jr,"){1,3}|:)|")+"(?:".concat(jr,":){3}(?:(:").concat(jr,"){0,2}:").concat(Br,"|(:").concat(jr,"){1,4}|:)|")+"(?:".concat(jr,":){2}(?:(:").concat(jr,"){0,3}:").concat(Br,"|(:").concat(jr,"){1,5}|:)|")+"(?:".concat(jr,":){1}(?:(:").concat(jr,"){0,4}:").concat(Br,"|(:").concat(jr,"){1,6}|:)|")+"(?::((?::".concat(jr,"){0,5}:").concat(Br,"|(?::").concat(jr,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");function Gr(Yr){var Qr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(0,Mr.default)(Yr),Qr=String(Qr),Qr?Qr==="4"?Lr.test(Yr):Qr==="6"?Ur.test(Yr):!1:Gr(Yr,4)||Gr(Yr,6)}$r.exports=pr.default,$r.exports.default=pr.default})(isIP,isIP.exports);var isIPExports=isIP.exports;(function($r,pr){Object.defineProperty(pr,"__esModule",{value:!0}),pr.default=io;var Mr=Lr(assertStringExports),Nr=Lr(isFQDNExports),Dr=Lr(isIPExports),Br=Lr(mergeExports);function Lr(no){return no&&no.__esModule?no:{default:no}}function jr(no,so){return Wn(no)||Qr(no,so)||Gr(no,so)||Ur()}function Ur(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
188
188
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gr(no,so){if(no){if(typeof no=="string")return Yr(no,so);var ao=Object.prototype.toString.call(no).slice(8,-1);if(ao==="Object"&&no.constructor&&(ao=no.constructor.name),ao==="Map"||ao==="Set")return Array.from(no);if(ao==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ao))return Yr(no,so)}}function Yr(no,so){(so==null||so>no.length)&&(so=no.length);for(var ao=0,fo=new Array(so);ao<so;ao++)fo[ao]=no[ao];return fo}function Qr(no,so){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(no)))){var ao=[],fo=!0,lo=!1,oo=void 0;try{for(var po=no[Symbol.iterator](),mo;!(fo=(mo=po.next()).done)&&(ao.push(mo.value),!(so&&ao.length===so));fo=!0);}catch($o){lo=!0,oo=$o}finally{try{!fo&&po.return!=null&&po.return()}finally{if(lo)throw oo}}return ao}}function Wn(no){if(Array.isArray(no))return no}var ga={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,validate_length:!0},eo=/^\[([^\]]+)\](?::([0-9]+))?$/;function _i(no){return Object.prototype.toString.call(no)==="[object RegExp]"}function va(no,so){for(var ao=0;ao<so.length;ao++){var fo=so[ao];if(no===fo||_i(fo)&&fo.test(no))return!0}return!1}function io(no,so){if((0,Mr.default)(no),!no||/[\s<>]/.test(no)||no.indexOf("mailto:")===0||(so=(0,Br.default)(so,ga),so.validate_length&&no.length>=2083)||!so.allow_fragments&&no.includes("#")||!so.allow_query_components&&(no.includes("?")||no.includes("&")))return!1;var ao,fo,lo,oo,po,mo,$o,Xn;if($o=no.split("#"),no=$o.shift(),$o=no.split("?"),no=$o.shift(),$o=no.split("://"),$o.length>1){if(ao=$o.shift().toLowerCase(),so.require_valid_protocol&&so.protocols.indexOf(ao)===-1)return!1}else{if(so.require_protocol)return!1;if(no.slice(0,2)==="//"){if(!so.allow_protocol_relative_urls)return!1;$o[0]=no.slice(2)}}if(no=$o.join("://"),no==="")return!1;if($o=no.split("/"),no=$o.shift(),no===""&&!so.require_host)return!0;if($o=no.split("@"),$o.length>1){if(so.disallow_auth||$o[0]===""||(fo=$o.shift(),fo.indexOf(":")>=0&&fo.split(":").length>2))return!1;var Fr=fo.split(":"),Vr=jr(Fr,2),Wr=Vr[0],Jr=Vr[1];if(Wr===""&&Jr==="")return!1}oo=$o.join("@"),mo=null,Xn=null;var Gn=oo.match(eo);if(Gn?(lo="",Xn=Gn[1],mo=Gn[2]||null):($o=oo.split(":"),lo=$o.shift(),$o.length&&(mo=$o.join(":"))),mo!==null&&mo.length>0){if(po=parseInt(mo,10),!/^[0-9]+$/.test(mo)||po<=0||po>65535)return!1}else if(so.require_port)return!1;return so.host_whitelist?va(lo,so.host_whitelist):lo===""&&!so.require_host?!0:!(!(0,Dr.default)(lo)&&!(0,Nr.default)(lo,so)&&(!Xn||!(0,Dr.default)(Xn,6))||(lo=lo||Xn,so.host_blacklist&&va(lo,so.host_blacklist)))}$r.exports=pr.default,$r.exports.default=pr.default})(isURL,isURL.exports);var isURLExports=isURL.exports,SingleSignOn_shared={};(function($r){Object.defineProperty($r,"__esModule",{value:!0}),$r.localStorageClearIdentity=$r.localStorageStoreIdentity=$r.localStorageGetIdentity=$r.createMessage=$r.SINGLE_SIGN_ON_TARGET=$r.Action=void 0;var pr;(function(jr){jr.GET="get",jr.STORE="store",jr.CLEAR="clear",jr.PING="ping"})(pr||($r.Action=pr={})),$r.SINGLE_SIGN_ON_TARGET="single-sign-on";function Mr(jr){return{target:$r.SINGLE_SIGN_ON_TARGET,...jr}}$r.createMessage=Mr;function Nr(jr){const Ur=localStorage.getItem(Lr(jr));if(!Ur)return null;let Gr;try{Gr=JSON.parse(Ur)}catch{return Br(jr),null}return Gr.expiration=new Date(Gr.expiration),Gr.expiration.getTime()<=Date.now()?(Br(jr),null):Gr}$r.localStorageGetIdentity=Nr;function Dr(jr,Ur){new Date(Ur.expiration).getTime()>Date.now()&&localStorage.setItem(Lr(jr),JSON.stringify(Ur))}$r.localStorageStoreIdentity=Dr;function Br(jr){localStorage.removeItem(Lr(jr))}$r.localStorageClearIdentity=Br;function Lr(jr){if(!/^0x[a-fA-F0-9]{40}$/.test(jr))throw new Error("User must be a valid ethereum address");return`single-sign-on-${jr.toLowerCase()}`}})(SingleSignOn_shared);Object.defineProperty(SingleSignOn,"__esModule",{value:!0});SingleSignOn.clearIdentity=SingleSignOn.storeIdentity=SingleSignOn.getIdentity=SingleSignOn.init=void 0;const isURL_1=isURLExports,SingleSignOn_shared_1=SingleSignOn_shared,IFRAME_ID=SingleSignOn_shared_1.SINGLE_SIGN_ON_TARGET,GET_IFRAME_TIMEOUT=500,GET_IFRAME_RETRIES=5;let _counter=0,_src="";const defaultOptions$1={protocols:["https"],require_protocol:!0};function init($r,pr={}){if(!(0,isURL_1.default)($r,{...defaultOptions$1,...pr}))throw new Error(`Invalid url: ${$r}`);if(_src)throw new Error("Already initialized");const Mr=document.createElement("iframe");Mr.id=IFRAME_ID,Mr.src=$r,Mr.style.width="0",Mr.style.height="0",Mr.style.border="none",Mr.style.position="absolute",document.body.appendChild(Mr),_src=$r}SingleSignOn.init=init;async function getIdentity($r){let pr;try{pr=(await postMessage(await getIframe(),SingleSignOn_shared_1.Action.GET,{user:$r})).identity??null}catch(Mr){logFallback(Mr),pr=(0,SingleSignOn_shared_1.localStorageGetIdentity)($r)}return pr}SingleSignOn.getIdentity=getIdentity;async function storeIdentity($r,pr){try{await postMessage(await getIframe(),SingleSignOn_shared_1.Action.STORE,{user:$r,identity:pr})}catch(Mr){logFallback(Mr),(0,SingleSignOn_shared_1.localStorageStoreIdentity)($r,pr)}}SingleSignOn.storeIdentity=storeIdentity;async function clearIdentity($r){try{await postMessage(await getIframe(),SingleSignOn_shared_1.Action.CLEAR,{user:$r})}catch(pr){logFallback(pr),(0,SingleSignOn_shared_1.localStorageClearIdentity)($r)}}SingleSignOn.clearIdentity=clearIdentity;async function getIframe(){if(!_src)throw new Error("Not initialized");for(let $r=0;$r<GET_IFRAME_RETRIES;$r++){const pr=document.getElementById(IFRAME_ID),Mr=pr==null?void 0:pr.contentWindow;if(!Mr){await wait$1(GET_IFRAME_TIMEOUT);continue}try{await postMessage(Mr,SingleSignOn_shared_1.Action.PING,{},GET_IFRAME_TIMEOUT)}catch{continue}return Mr}throw new Error("Could not get iframe because it is not ready or cannot be communicated with")}async function postMessage($r,pr,Mr,Nr=0){_counter++;const Dr=_counter;let Br=null;const Lr=new Promise((jr,Ur)=>{Br=({data:Gr})=>{!Gr||Gr.target!==SingleSignOn_shared_1.SINGLE_SIGN_ON_TARGET||Gr.id!==Dr||(Gr.error?Ur(new Error(Gr.error)):jr(Gr))},window.addEventListener("message",Br)});$r.postMessage((0,SingleSignOn_shared_1.createMessage)({id:Dr,action:pr,...Mr}),_src);try{return await(Nr?Promise.race([Lr,new Promise((jr,Ur)=>setTimeout(()=>Ur(new Error("Did not receive a response in time")),Nr))]):Lr)}catch(jr){throw jr}finally{Br&&window.removeEventListener("message",Br)}}function wait$1($r){return new Promise(pr=>setTimeout(pr,$r))}function logFallback($r){console.warn("Could not get identity from iframe, falling back to localStorage. Error:",$r.message)}(function($r){var pr=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Nr,Dr,Br,Lr){Lr===void 0&&(Lr=Br);var jr=Object.getOwnPropertyDescriptor(Dr,Br);(!jr||("get"in jr?!Dr.__esModule:jr.writable||jr.configurable))&&(jr={enumerable:!0,get:function(){return Dr[Br]}}),Object.defineProperty(Nr,Lr,jr)}:function(Nr,Dr,Br,Lr){Lr===void 0&&(Lr=Br),Nr[Lr]=Dr[Br]}),Mr=commonjsGlobal&&commonjsGlobal.__exportStar||function(Nr,Dr){for(var Br in Nr)Br!=="default"&&!Object.prototype.hasOwnProperty.call(Dr,Br)&&pr(Dr,Nr,Br)};Object.defineProperty($r,"__esModule",{value:!0}),Mr(SingleSignOn,$r),Mr(SingleSignOn_shared,$r)})(dist$4);var Checkbox$4={},Checkbox$3={},Checkbox$2={},set_1,hasRequiredSet;function requireSet(){if(hasRequiredSet)return set_1;hasRequiredSet=1;var $r=require_baseSet();function pr(Mr,Nr,Dr){return Mr==null?Mr:$r(Mr,Nr,Dr)}return set_1=pr,set_1}var hasRequiredCheckbox;function requireCheckbox(){if(hasRequiredCheckbox)return Checkbox$2;hasRequiredCheckbox=1;var $r=interopRequireWildcardExports,pr=interopRequireDefaultExports;Checkbox$2.__esModule=!0,Checkbox$2.default=void 0;var Mr=pr(require_extends()),Nr=pr(requireInheritsLoose()),Dr=pr(requireSet()),Br=pr(requireInvoke());pr(requireGet());var Lr=pr(requireIsNil()),jr=require$$4$2,Ur=pr(require$$0$9);pr(requirePropTypes());var Gr=$r(reactExports),Yr=requireLib(),Qr=function(Wn){(0,Nr.default)(ga,Wn);function ga(){for(var _i,va=arguments.length,io=new Array(va),no=0;no<va;no++)io[no]=arguments[no];return _i=Wn.call.apply(Wn,[this].concat(io))||this,_i.inputRef=(0,Gr.createRef)(),_i.labelRef=(0,Gr.createRef)(),_i.canToggle=function(){var so=_i.props,ao=so.disabled,fo=so.radio,lo=so.readOnly,oo=_i.state.checked;return!ao&&!lo&&!(fo&&oo)},_i.computeTabIndex=function(){var so=_i.props,ao=so.disabled,fo=so.tabIndex;return(0,Lr.default)(fo)?ao?-1:0:fo},_i.handleClick=function(so){var ao=_i.props.id,fo=_i.state,lo=fo.checked,oo=fo.indeterminate,po=(0,Br.default)(_i.inputRef.current,"contains",so.target),mo=(0,Br.default)(_i.labelRef.current,"contains",so.target),$o=!mo&&!po,Xn=!(0,Lr.default)(ao),Fr=mo&&Xn;Fr||(0,Br.default)(_i.props,"onClick",so,(0,Mr.default)({},_i.props,{checked:!lo,indeterminate:!!oo})),_i.isClickFromMouse&&(_i.isClickFromMouse=!1,mo&&!Xn&&_i.handleChange(so),$o&&_i.handleChange(so),mo&&Xn&&so.stopPropagation())},_i.handleChange=function(so){var ao=_i.state.checked;_i.canToggle()&&((0,Br.default)(_i.props,"onChange",so,(0,Mr.default)({},_i.props,{checked:!ao,indeterminate:!1})),_i.setState({checked:!ao,indeterminate:!1}))},_i.handleMouseDown=function(so){var ao=_i.state,fo=ao.checked,lo=ao.indeterminate;(0,Br.default)(_i.props,"onMouseDown",so,(0,Mr.default)({},_i.props,{checked:!!fo,indeterminate:!!lo})),so.defaultPrevented||(0,Br.default)(_i.inputRef.current,"focus"),so.preventDefault()},_i.handleMouseUp=function(so){var ao=_i.state,fo=ao.checked,lo=ao.indeterminate;_i.isClickFromMouse=!0,(0,Br.default)(_i.props,"onMouseUp",so,(0,Mr.default)({},_i.props,{checked:!!fo,indeterminate:!!lo}))},_i.setIndeterminate=function(){var so=_i.state.indeterminate;(0,Dr.default)(_i.inputRef,"current.indeterminate",!!so)},_i}var eo=ga.prototype;return eo.componentDidMount=function(){this.setIndeterminate()},eo.componentDidUpdate=function(){this.setIndeterminate()},eo.render=function(){var va=this.props,io=va.className,no=va.disabled,so=va.label,ao=va.id,fo=va.name,lo=va.radio,oo=va.readOnly,po=va.slider,mo=va.toggle,$o=va.type,Xn=va.value,Fr=this.state,Vr=Fr.checked,Wr=Fr.indeterminate,Jr=(0,Ur.default)("ui",(0,Yr.useKeyOnly)(Vr,"checked"),(0,Yr.useKeyOnly)(no,"disabled"),(0,Yr.useKeyOnly)(Wr,"indeterminate"),(0,Yr.useKeyOnly)((0,Lr.default)(so),"fitted"),(0,Yr.useKeyOnly)(lo,"radio"),(0,Yr.useKeyOnly)(oo,"read-only"),(0,Yr.useKeyOnly)(po,"slider"),(0,Yr.useKeyOnly)(mo,"toggle"),"checkbox",io),Gn=(0,Yr.getUnhandledProps)(ga,this.props),to=(0,Yr.getElementType)(ga,this.props),ro=(0,Yr.partitionHTMLProps)(Gn,{htmlProps:Yr.htmlInputAttrs}),Un=ro[0],Hr=ro[1],Xr=(0,Yr.createHTMLLabel)(so,{defaultProps:{htmlFor:ao},autoGenerateKey:!1})||Gr.default.createElement("label",{htmlFor:ao});return Gr.default.createElement(to,(0,Mr.default)({},Hr,{className:Jr,onClick:this.handleClick,onChange:this.handleChange,onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp}),Gr.default.createElement(jr.Ref,{innerRef:this.inputRef},Gr.default.createElement("input",(0,Mr.default)({},Un,{checked:Vr,className:"hidden",disabled:no,id:ao,name:fo,readOnly:!0,tabIndex:this.computeTabIndex(),type:$o,value:Xn}))),Gr.default.createElement(jr.Ref,{innerRef:this.labelRef},Xr))},ga}(Yr.ModernAutoControlledComponent);return Checkbox$2.default=Qr,Qr.handledProps=["as","checked","className","defaultChecked","defaultIndeterminate","disabled","fitted","id","indeterminate","label","name","onChange","onClick","onMouseDown","onMouseUp","radio","readOnly","slider","tabIndex","toggle","type","value"],Qr.propTypes={},Qr.defaultProps={type:"checkbox"},Qr.autoControlledProps=["checked","indeterminate"],Checkbox$2}var _interopRequireDefault$4=interopRequireDefaultExports;Checkbox$3.__esModule=!0;var _Checkbox=_interopRequireDefault$4(requireCheckbox());Checkbox$3.default=_Checkbox.default;const Checkbox$1="";(function($r){var pr=commonjsGlobal&&commonjsGlobal.__importDefault||function(Nr){return Nr&&Nr.__esModule?Nr:{default:Nr}};Object.defineProperty($r,"__esModule",{value:!0}),$r.Checkbox=void 0;var Mr=Checkbox$3;Object.defineProperty($r,"Checkbox",{enumerable:!0,get:function(){return pr(Mr).default}})})(Checkbox$4);var Field$2={};const todayButton="Today",nextMonth="Next month",previousMonth="Previous month",nextYear="Next year",previousYear="Previous year",weekdays=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],months=["January","February","March","April","May","June","July","August","September","October","November","December"],require$$0={todayButton,nextMonth,previousMonth,nextYear,previousYear,weekdays,months};function requiredArgs($r,pr){if(pr.length<$r)throw new TypeError($r+" argument"+($r>1?"s":"")+" required, but only "+pr.length+" present")}function _typeof$y($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$y=function(Mr){return typeof Mr}:_typeof$y=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$y($r)}function isDate($r){return requiredArgs(1,arguments),$r instanceof Date||_typeof$y($r)==="object"&&Object.prototype.toString.call($r)==="[object Date]"}function _typeof$x($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$x=function(Mr){return typeof Mr}:_typeof$x=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$x($r)}function toDate$1($r){requiredArgs(1,arguments);var pr=Object.prototype.toString.call($r);return $r instanceof Date||_typeof$x($r)==="object"&&pr==="[object Date]"?new Date($r.getTime()):typeof $r=="number"||pr==="[object Number]"?new Date($r):((typeof $r=="string"||pr==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function isValid($r){if(requiredArgs(1,arguments),!isDate($r)&&typeof $r!="number")return!1;var pr=toDate$1($r);return!isNaN(Number(pr))}function e($r,pr,Mr){return $r.length+1===pr.length&&pr.endsWith(Mr)}function r($r,pr){if(!pr)return pr;var Mr=String(pr).replace(/[^\da-zA-Z\n|]/g,""),Nr=$r.split(/[^\da-zA-Z\n|]/g).filter(Boolean).map(function(Gr){return Gr.length}),Dr=$r.split(/[\da-zA-Z\n|]/g).filter(Boolean),Br=Dr[0],Lr=Dr[Dr.length-1];if($r.startsWith(Br)){var jr=Dr.reduce(function(Gr,Yr,Qr){var Wn=Nr[Qr],ga=Gr.value.slice(0,Wn),eo=Gr.value.slice(Wn);return{result:ga?Gr.result.concat(Yr,ga):Gr.result,value:eo}},{result:"",value:Mr}).result.slice(0,$r.length);return e(jr,$r,Lr)?jr.concat(Lr):jr}var Ur=Nr.reduce(function(Gr,Yr,Qr){var Wn=Dr[Qr]||"",ga="$1"+Wn+"$2",eo=Yr+Gr.prevSlice+Gr.prevSeparator.length,_i=new RegExp("(.{"+eo+"})(.)");return{prevSeparator:Wn,prevSlice:eo,value:Gr.value.replace(_i,ga)}},{prevSeparator:"",prevSlice:0,value:Mr}).value.slice(0,$r.length);return e(Ur,$r,Lr)?Ur.concat(Lr):Ur}function formatStringByPattern($r,pr){return pr===void 0?function(Mr){return r($r,Mr)}:r($r,pr)}var hasElementType=typeof Element<"u",hasMap=typeof Map=="function",hasSet=typeof Set=="function",hasArrayBuffer=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function equal($r,pr){if($r===pr)return!0;if($r&&pr&&typeof $r=="object"&&typeof pr=="object"){if($r.constructor!==pr.constructor)return!1;var Mr,Nr,Dr;if(Array.isArray($r)){if(Mr=$r.length,Mr!=pr.length)return!1;for(Nr=Mr;Nr--!==0;)if(!equal($r[Nr],pr[Nr]))return!1;return!0}var Br;if(hasMap&&$r instanceof Map&&pr instanceof Map){if($r.size!==pr.size)return!1;for(Br=$r.entries();!(Nr=Br.next()).done;)if(!pr.has(Nr.value[0]))return!1;for(Br=$r.entries();!(Nr=Br.next()).done;)if(!equal(Nr.value[1],pr.get(Nr.value[0])))return!1;return!0}if(hasSet&&$r instanceof Set&&pr instanceof Set){if($r.size!==pr.size)return!1;for(Br=$r.entries();!(Nr=Br.next()).done;)if(!pr.has(Nr.value[0]))return!1;return!0}if(hasArrayBuffer&&ArrayBuffer.isView($r)&&ArrayBuffer.isView(pr)){if(Mr=$r.length,Mr!=pr.length)return!1;for(Nr=Mr;Nr--!==0;)if($r[Nr]!==pr[Nr])return!1;return!0}if($r.constructor===RegExp)return $r.source===pr.source&&$r.flags===pr.flags;if($r.valueOf!==Object.prototype.valueOf)return $r.valueOf()===pr.valueOf();if($r.toString!==Object.prototype.toString)return $r.toString()===pr.toString();if(Dr=Object.keys($r),Mr=Dr.length,Mr!==Object.keys(pr).length)return!1;for(Nr=Mr;Nr--!==0;)if(!Object.prototype.hasOwnProperty.call(pr,Dr[Nr]))return!1;if(hasElementType&&$r instanceof Element)return!1;for(Nr=Mr;Nr--!==0;)if(!((Dr[Nr]==="_owner"||Dr[Nr]==="__v"||Dr[Nr]==="__o")&&$r.$$typeof)&&!equal($r[Dr[Nr]],pr[Dr[Nr]]))return!1;return!0}return $r!==$r&&pr!==pr}var reactFastCompare=function(pr,Mr){try{return equal(pr,Mr)}catch(Nr){if((Nr.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw Nr}};const isEqual$1=getDefaultExportFromCjs$1(reactFastCompare);var convertTokens$1={};Object.defineProperty(convertTokens$1,"__esModule",{value:!0});var tokensMap={M:"L",Mo:"Mo",MM:"LL",MMM:"LLL",MMMM:"LLLL",Q:"q",Qo:"qo",D:"d",Do:"do",DD:"dd",DDD:"D",DDDo:"Do",DDDD:"DDD",d:"i",do:"io",dd:"iiiiii",ddd:"iii",dddd:"iiii",A:"a",a:"a",aa:"aaaa",E:"i",W:"I",Wo:"Io",WW:"II",YY:"yy",YYYY:"yyyy",GG:"RR",GGGG:"RRRR",H:"H",HH:"HH",h:"h",hh:"hh",m:"m",mm:"mm",s:"s",ss:"ss",S:"S",SS:"SS",SSS:"SSS",Z:"xxx",ZZ:"xx",X:"t",x:"T"},v1tokens=Object.keys(tokensMap).sort().reverse(),tokensRegExp=new RegExp("(\\[[^\\[]*\\])|(\\\\)?("+v1tokens.join("|")+"|.)","g");function convertTokens($r){var pr=$r.match(tokensRegExp);return pr?pr.reduce(function(Mr,Nr,Dr){var Br=tokensMap[Nr];if(!Br){var Lr=Nr.match(/^\[(.+)\]$/);Lr?Mr.textBuffer.push(Lr[1]):Mr.textBuffer.push(Nr)}var jr=Dr===pr.length-1;return Mr.textBuffer.length&&(Br||jr)&&(Mr.formatBuffer.push("'"+Mr.textBuffer.join("")+"'"),Mr.textBuffer=[]),Br&&Mr.formatBuffer.push(Br),Mr},{formatBuffer:[],textBuffer:[]}).formatBuffer.join(""):$r}var convertTokens_2=convertTokens$1.convertTokens=convertTokens;function toInteger$2($r){if($r===null||$r===!0||$r===!1)return NaN;var pr=Number($r);return isNaN(pr)?pr:pr<0?Math.ceil(pr):Math.floor(pr)}function addMilliseconds($r,pr){requiredArgs(2,arguments);var Mr=toDate$1($r).getTime(),Nr=toInteger$2(pr);return new Date(Mr+Nr)}function subMilliseconds($r,pr){requiredArgs(2,arguments);var Mr=toInteger$2(pr);return addMilliseconds($r,-Mr)}var MILLISECONDS_IN_DAY=864e5;function getUTCDayOfYear($r){requiredArgs(1,arguments);var pr=toDate$1($r),Mr=pr.getTime();pr.setUTCMonth(0,1),pr.setUTCHours(0,0,0,0);var Nr=pr.getTime(),Dr=Mr-Nr;return Math.floor(Dr/MILLISECONDS_IN_DAY)+1}function startOfUTCISOWeek($r){requiredArgs(1,arguments);var pr=1,Mr=toDate$1($r),Nr=Mr.getUTCDay(),Dr=(Nr<pr?7:0)+Nr-pr;return Mr.setUTCDate(Mr.getUTCDate()-Dr),Mr.setUTCHours(0,0,0,0),Mr}function getUTCISOWeekYear($r){requiredArgs(1,arguments);var pr=toDate$1($r),Mr=pr.getUTCFullYear(),Nr=new Date(0);Nr.setUTCFullYear(Mr+1,0,4),Nr.setUTCHours(0,0,0,0);var Dr=startOfUTCISOWeek(Nr),Br=new Date(0);Br.setUTCFullYear(Mr,0,4),Br.setUTCHours(0,0,0,0);var Lr=startOfUTCISOWeek(Br);return pr.getTime()>=Dr.getTime()?Mr+1:pr.getTime()>=Lr.getTime()?Mr:Mr-1}function startOfUTCISOWeekYear($r){requiredArgs(1,arguments);var pr=getUTCISOWeekYear($r),Mr=new Date(0);Mr.setUTCFullYear(pr,0,4),Mr.setUTCHours(0,0,0,0);var Nr=startOfUTCISOWeek(Mr);return Nr}var MILLISECONDS_IN_WEEK$1=6048e5;function getUTCISOWeek($r){requiredArgs(1,arguments);var pr=toDate$1($r),Mr=startOfUTCISOWeek(pr).getTime()-startOfUTCISOWeekYear(pr).getTime();return Math.round(Mr/MILLISECONDS_IN_WEEK$1)+1}var defaultOptions={};function getDefaultOptions(){return defaultOptions}function startOfUTCWeek($r,pr){var Mr,Nr,Dr,Br,Lr,jr,Ur,Gr;requiredArgs(1,arguments);var Yr=getDefaultOptions(),Qr=toInteger$2((Mr=(Nr=(Dr=(Br=pr==null?void 0:pr.weekStartsOn)!==null&&Br!==void 0?Br:pr==null||(Lr=pr.locale)===null||Lr===void 0||(jr=Lr.options)===null||jr===void 0?void 0:jr.weekStartsOn)!==null&&Dr!==void 0?Dr:Yr.weekStartsOn)!==null&&Nr!==void 0?Nr:(Ur=Yr.locale)===null||Ur===void 0||(Gr=Ur.options)===null||Gr===void 0?void 0:Gr.weekStartsOn)!==null&&Mr!==void 0?Mr:0);if(!(Qr>=0&&Qr<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var Wn=toDate$1($r),ga=Wn.getUTCDay(),eo=(ga<Qr?7:0)+ga-Qr;return Wn.setUTCDate(Wn.getUTCDate()-eo),Wn.setUTCHours(0,0,0,0),Wn}function getUTCWeekYear($r,pr){var Mr,Nr,Dr,Br,Lr,jr,Ur,Gr;requiredArgs(1,arguments);var Yr=toDate$1($r),Qr=Yr.getUTCFullYear(),Wn=getDefaultOptions(),ga=toInteger$2((Mr=(Nr=(Dr=(Br=pr==null?void 0:pr.firstWeekContainsDate)!==null&&Br!==void 0?Br:pr==null||(Lr=pr.locale)===null||Lr===void 0||(jr=Lr.options)===null||jr===void 0?void 0:jr.firstWeekContainsDate)!==null&&Dr!==void 0?Dr:Wn.firstWeekContainsDate)!==null&&Nr!==void 0?Nr:(Ur=Wn.locale)===null||Ur===void 0||(Gr=Ur.options)===null||Gr===void 0?void 0:Gr.firstWeekContainsDate)!==null&&Mr!==void 0?Mr:1);if(!(ga>=1&&ga<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var eo=new Date(0);eo.setUTCFullYear(Qr+1,0,ga),eo.setUTCHours(0,0,0,0);var _i=startOfUTCWeek(eo,pr),va=new Date(0);va.setUTCFullYear(Qr,0,ga),va.setUTCHours(0,0,0,0);var io=startOfUTCWeek(va,pr);return Yr.getTime()>=_i.getTime()?Qr+1:Yr.getTime()>=io.getTime()?Qr:Qr-1}function startOfUTCWeekYear($r,pr){var Mr,Nr,Dr,Br,Lr,jr,Ur,Gr;requiredArgs(1,arguments);var Yr=getDefaultOptions(),Qr=toInteger$2((Mr=(Nr=(Dr=(Br=pr==null?void 0:pr.firstWeekContainsDate)!==null&&Br!==void 0?Br:pr==null||(Lr=pr.locale)===null||Lr===void 0||(jr=Lr.options)===null||jr===void 0?void 0:jr.firstWeekContainsDate)!==null&&Dr!==void 0?Dr:Yr.firstWeekContainsDate)!==null&&Nr!==void 0?Nr:(Ur=Yr.locale)===null||Ur===void 0||(Gr=Ur.options)===null||Gr===void 0?void 0:Gr.firstWeekContainsDate)!==null&&Mr!==void 0?Mr:1),Wn=getUTCWeekYear($r,pr),ga=new Date(0);ga.setUTCFullYear(Wn,0,Qr),ga.setUTCHours(0,0,0,0);var eo=startOfUTCWeek(ga,pr);return eo}var MILLISECONDS_IN_WEEK=6048e5;function getUTCWeek($r,pr){requiredArgs(1,arguments);var Mr=toDate$1($r),Nr=startOfUTCWeek(Mr,pr).getTime()-startOfUTCWeekYear(Mr,pr).getTime();return Math.round(Nr/MILLISECONDS_IN_WEEK)+1}function addLeadingZeros($r,pr){for(var Mr=$r<0?"-":"",Nr=Math.abs($r).toString();Nr.length<pr;)Nr="0"+Nr;return Mr+Nr}var formatters$2={y:function(pr,Mr){var Nr=pr.getUTCFullYear(),Dr=Nr>0?Nr:1-Nr;return addLeadingZeros(Mr==="yy"?Dr%100:Dr,Mr.length)},M:function(pr,Mr){var Nr=pr.getUTCMonth();return Mr==="M"?String(Nr+1):addLeadingZeros(Nr+1,2)},d:function(pr,Mr){return addLeadingZeros(pr.getUTCDate(),Mr.length)},a:function(pr,Mr){var Nr=pr.getUTCHours()/12>=1?"pm":"am";switch(Mr){case"a":case"aa":return Nr.toUpperCase();case"aaa":return Nr;case"aaaaa":return Nr[0];case"aaaa":default:return Nr==="am"?"a.m.":"p.m."}},h:function(pr,Mr){return addLeadingZeros(pr.getUTCHours()%12||12,Mr.length)},H:function(pr,Mr){return addLeadingZeros(pr.getUTCHours(),Mr.length)},m:function(pr,Mr){return addLeadingZeros(pr.getUTCMinutes(),Mr.length)},s:function(pr,Mr){return addLeadingZeros(pr.getUTCSeconds(),Mr.length)},S:function(pr,Mr){var Nr=Mr.length,Dr=pr.getUTCMilliseconds(),Br=Math.floor(Dr*Math.pow(10,Nr-3));return addLeadingZeros(Br,Mr.length)}};const lightFormatters=formatters$2;var dayPeriodEnum={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},formatters={G:function(pr,Mr,Nr){var Dr=pr.getUTCFullYear()>0?1:0;switch(Mr){case"G":case"GG":case"GGG":return Nr.era(Dr,{width:"abbreviated"});case"GGGGG":return Nr.era(Dr,{width:"narrow"});case"GGGG":default:return Nr.era(Dr,{width:"wide"})}},y:function(pr,Mr,Nr){if(Mr==="yo"){var Dr=pr.getUTCFullYear(),Br=Dr>0?Dr:1-Dr;return Nr.ordinalNumber(Br,{unit:"year"})}return lightFormatters.y(pr,Mr)},Y:function(pr,Mr,Nr,Dr){var Br=getUTCWeekYear(pr,Dr),Lr=Br>0?Br:1-Br;if(Mr==="YY"){var jr=Lr%100;return addLeadingZeros(jr,2)}return Mr==="Yo"?Nr.ordinalNumber(Lr,{unit:"year"}):addLeadingZeros(Lr,Mr.length)},R:function(pr,Mr){var Nr=getUTCISOWeekYear(pr);return addLeadingZeros(Nr,Mr.length)},u:function(pr,Mr){var Nr=pr.getUTCFullYear();return addLeadingZeros(Nr,Mr.length)},Q:function(pr,Mr,Nr){var Dr=Math.ceil((pr.getUTCMonth()+1)/3);switch(Mr){case"Q":return String(Dr);case"QQ":return addLeadingZeros(Dr,2);case"Qo":return Nr.ordinalNumber(Dr,{unit:"quarter"});case"QQQ":return Nr.quarter(Dr,{width:"abbreviated",context:"formatting"});case"QQQQQ":return Nr.quarter(Dr,{width:"narrow",context:"formatting"});case"QQQQ":default:return Nr.quarter(Dr,{width:"wide",context:"formatting"})}},q:function(pr,Mr,Nr){var Dr=Math.ceil((pr.getUTCMonth()+1)/3);switch(Mr){case"q":return String(Dr);case"qq":return addLeadingZeros(Dr,2);case"qo":return Nr.ordinalNumber(Dr,{unit:"quarter"});case"qqq":return Nr.quarter(Dr,{width:"abbreviated",context:"standalone"});case"qqqqq":return Nr.quarter(Dr,{width:"narrow",context:"standalone"});case"qqqq":default:return Nr.quarter(Dr,{width:"wide",context:"standalone"})}},M:function(pr,Mr,Nr){var Dr=pr.getUTCMonth();switch(Mr){case"M":case"MM":return lightFormatters.M(pr,Mr);case"Mo":return Nr.ordinalNumber(Dr+1,{unit:"month"});case"MMM":return Nr.month(Dr,{width:"abbreviated",context:"formatting"});case"MMMMM":return Nr.month(Dr,{width:"narrow",context:"formatting"});case"MMMM":default:return Nr.month(Dr,{width:"wide",context:"formatting"})}},L:function(pr,Mr,Nr){var Dr=pr.getUTCMonth();switch(Mr){case"L":return String(Dr+1);case"LL":return addLeadingZeros(Dr+1,2);case"Lo":return Nr.ordinalNumber(Dr+1,{unit:"month"});case"LLL":return Nr.month(Dr,{width:"abbreviated",context:"standalone"});case"LLLLL":return Nr.month(Dr,{width:"narrow",context:"standalone"});case"LLLL":default:return Nr.month(Dr,{width:"wide",context:"standalone"})}},w:function(pr,Mr,Nr,Dr){var Br=getUTCWeek(pr,Dr);return Mr==="wo"?Nr.ordinalNumber(Br,{unit:"week"}):addLeadingZeros(Br,Mr.length)},I:function(pr,Mr,Nr){var Dr=getUTCISOWeek(pr);return Mr==="Io"?Nr.ordinalNumber(Dr,{unit:"week"}):addLeadingZeros(Dr,Mr.length)},d:function(pr,Mr,Nr){return Mr==="do"?Nr.ordinalNumber(pr.getUTCDate(),{unit:"date"}):lightFormatters.d(pr,Mr)},D:function(pr,Mr,Nr){var Dr=getUTCDayOfYear(pr);return Mr==="Do"?Nr.ordinalNumber(Dr,{unit:"dayOfYear"}):addLeadingZeros(Dr,Mr.length)},E:function(pr,Mr,Nr){var Dr=pr.getUTCDay();switch(Mr){case"E":case"EE":case"EEE":return Nr.day(Dr,{width:"abbreviated",context:"formatting"});case"EEEEE":return Nr.day(Dr,{width:"narrow",context:"formatting"});case"EEEEEE":return Nr.day(Dr,{width:"short",context:"formatting"});case"EEEE":default:return Nr.day(Dr,{width:"wide",context:"formatting"})}},e:function(pr,Mr,Nr,Dr){var Br=pr.getUTCDay(),Lr=(Br-Dr.weekStartsOn+8)%7||7;switch(Mr){case"e":return String(Lr);case"ee":return addLeadingZeros(Lr,2);case"eo":return Nr.ordinalNumber(Lr,{unit:"day"});case"eee":return Nr.day(Br,{width:"abbreviated",context:"formatting"});case"eeeee":return Nr.day(Br,{width:"narrow",context:"formatting"});case"eeeeee":return Nr.day(Br,{width:"short",context:"formatting"});case"eeee":default:return Nr.day(Br,{width:"wide",context:"formatting"})}},c:function(pr,Mr,Nr,Dr){var Br=pr.getUTCDay(),Lr=(Br-Dr.weekStartsOn+8)%7||7;switch(Mr){case"c":return String(Lr);case"cc":return addLeadingZeros(Lr,Mr.length);case"co":return Nr.ordinalNumber(Lr,{unit:"day"});case"ccc":return Nr.day(Br,{width:"abbreviated",context:"standalone"});case"ccccc":return Nr.day(Br,{width:"narrow",context:"standalone"});case"cccccc":return Nr.day(Br,{width:"short",context:"standalone"});case"cccc":default:return Nr.day(Br,{width:"wide",context:"standalone"})}},i:function(pr,Mr,Nr){var Dr=pr.getUTCDay(),Br=Dr===0?7:Dr;switch(Mr){case"i":return String(Br);case"ii":return addLeadingZeros(Br,Mr.length);case"io":return Nr.ordinalNumber(Br,{unit:"day"});case"iii":return Nr.day(Dr,{width:"abbreviated",context:"formatting"});case"iiiii":return Nr.day(Dr,{width:"narrow",context:"formatting"});case"iiiiii":return Nr.day(Dr,{width:"short",context:"formatting"});case"iiii":default:return Nr.day(Dr,{width:"wide",context:"formatting"})}},a:function(pr,Mr,Nr){var Dr=pr.getUTCHours(),Br=Dr/12>=1?"pm":"am";switch(Mr){case"a":case"aa":return Nr.dayPeriod(Br,{width:"abbreviated",context:"formatting"});case"aaa":return Nr.dayPeriod(Br,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return Nr.dayPeriod(Br,{width:"narrow",context:"formatting"});case"aaaa":default:return Nr.dayPeriod(Br,{width:"wide",context:"formatting"})}},b:function(pr,Mr,Nr){var Dr=pr.getUTCHours(),Br;switch(Dr===12?Br=dayPeriodEnum.noon:Dr===0?Br=dayPeriodEnum.midnight:Br=Dr/12>=1?"pm":"am",Mr){case"b":case"bb":return Nr.dayPeriod(Br,{width:"abbreviated",context:"formatting"});case"bbb":return Nr.dayPeriod(Br,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return Nr.dayPeriod(Br,{width:"narrow",context:"formatting"});case"bbbb":default:return Nr.dayPeriod(Br,{width:"wide",context:"formatting"})}},B:function(pr,Mr,Nr){var Dr=pr.getUTCHours(),Br;switch(Dr>=17?Br=dayPeriodEnum.evening:Dr>=12?Br=dayPeriodEnum.afternoon:Dr>=4?Br=dayPeriodEnum.morning:Br=dayPeriodEnum.night,Mr){case"B":case"BB":case"BBB":return Nr.dayPeriod(Br,{width:"abbreviated",context:"formatting"});case"BBBBB":return Nr.dayPeriod(Br,{width:"narrow",context:"formatting"});case"BBBB":default:return Nr.dayPeriod(Br,{width:"wide",context:"formatting"})}},h:function(pr,Mr,Nr){if(Mr==="ho"){var Dr=pr.getUTCHours()%12;return Dr===0&&(Dr=12),Nr.ordinalNumber(Dr,{unit:"hour"})}return lightFormatters.h(pr,Mr)},H:function(pr,Mr,Nr){return Mr==="Ho"?Nr.ordinalNumber(pr.getUTCHours(),{unit:"hour"}):lightFormatters.H(pr,Mr)},K:function(pr,Mr,Nr){var Dr=pr.getUTCHours()%12;return Mr==="Ko"?Nr.ordinalNumber(Dr,{unit:"hour"}):addLeadingZeros(Dr,Mr.length)},k:function(pr,Mr,Nr){var Dr=pr.getUTCHours();return Dr===0&&(Dr=24),Mr==="ko"?Nr.ordinalNumber(Dr,{unit:"hour"}):addLeadingZeros(Dr,Mr.length)},m:function(pr,Mr,Nr){return Mr==="mo"?Nr.ordinalNumber(pr.getUTCMinutes(),{unit:"minute"}):lightFormatters.m(pr,Mr)},s:function(pr,Mr,Nr){return Mr==="so"?Nr.ordinalNumber(pr.getUTCSeconds(),{unit:"second"}):lightFormatters.s(pr,Mr)},S:function(pr,Mr){return lightFormatters.S(pr,Mr)},X:function(pr,Mr,Nr,Dr){var Br=Dr._originalDate||pr,Lr=Br.getTimezoneOffset();if(Lr===0)return"Z";switch(Mr){case"X":return formatTimezoneWithOptionalMinutes(Lr);case"XXXX":case"XX":return formatTimezone(Lr);case"XXXXX":case"XXX":default:return formatTimezone(Lr,":")}},x:function(pr,Mr,Nr,Dr){var Br=Dr._originalDate||pr,Lr=Br.getTimezoneOffset();switch(Mr){case"x":return formatTimezoneWithOptionalMinutes(Lr);case"xxxx":case"xx":return formatTimezone(Lr);case"xxxxx":case"xxx":default:return formatTimezone(Lr,":")}},O:function(pr,Mr,Nr,Dr){var Br=Dr._originalDate||pr,Lr=Br.getTimezoneOffset();switch(Mr){case"O":case"OO":case"OOO":return"GMT"+formatTimezoneShort(Lr,":");case"OOOO":default:return"GMT"+formatTimezone(Lr,":")}},z:function(pr,Mr,Nr,Dr){var Br=Dr._originalDate||pr,Lr=Br.getTimezoneOffset();switch(Mr){case"z":case"zz":case"zzz":return"GMT"+formatTimezoneShort(Lr,":");case"zzzz":default:return"GMT"+formatTimezone(Lr,":")}},t:function(pr,Mr,Nr,Dr){var Br=Dr._originalDate||pr,Lr=Math.floor(Br.getTime()/1e3);return addLeadingZeros(Lr,Mr.length)},T:function(pr,Mr,Nr,Dr){var Br=Dr._originalDate||pr,Lr=Br.getTime();return addLeadingZeros(Lr,Mr.length)}};function formatTimezoneShort($r,pr){var Mr=$r>0?"-":"+",Nr=Math.abs($r),Dr=Math.floor(Nr/60),Br=Nr%60;if(Br===0)return Mr+String(Dr);var Lr=pr||"";return Mr+String(Dr)+Lr+addLeadingZeros(Br,2)}function formatTimezoneWithOptionalMinutes($r,pr){if($r%60===0){var Mr=$r>0?"-":"+";return Mr+addLeadingZeros(Math.abs($r)/60,2)}return formatTimezone($r,pr)}function formatTimezone($r,pr){var Mr=pr||"",Nr=$r>0?"-":"+",Dr=Math.abs($r),Br=addLeadingZeros(Math.floor(Dr/60),2),Lr=addLeadingZeros(Dr%60,2);return Nr+Br+Mr+Lr}const formatters$1=formatters;var dateLongFormatter=function(pr,Mr){switch(pr){case"P":return Mr.date({width:"short"});case"PP":return Mr.date({width:"medium"});case"PPP":return Mr.date({width:"long"});case"PPPP":default:return Mr.date({width:"full"})}},timeLongFormatter=function(pr,Mr){switch(pr){case"p":return Mr.time({width:"short"});case"pp":return Mr.time({width:"medium"});case"ppp":return Mr.time({width:"long"});case"pppp":default:return Mr.time({width:"full"})}},dateTimeLongFormatter=function(pr,Mr){var Nr=pr.match(/(P+)(p+)?/)||[],Dr=Nr[1],Br=Nr[2];if(!Br)return dateLongFormatter(pr,Mr);var Lr;switch(Dr){case"P":Lr=Mr.dateTime({width:"short"});break;case"PP":Lr=Mr.dateTime({width:"medium"});break;case"PPP":Lr=Mr.dateTime({width:"long"});break;case"PPPP":default:Lr=Mr.dateTime({width:"full"});break}return Lr.replace("{{date}}",dateLongFormatter(Dr,Mr)).replace("{{time}}",timeLongFormatter(Br,Mr))},longFormatters={p:timeLongFormatter,P:dateTimeLongFormatter};const longFormatters$1=longFormatters;function getTimezoneOffsetInMilliseconds($r){var pr=new Date(Date.UTC($r.getFullYear(),$r.getMonth(),$r.getDate(),$r.getHours(),$r.getMinutes(),$r.getSeconds(),$r.getMilliseconds()));return pr.setUTCFullYear($r.getFullYear()),$r.getTime()-pr.getTime()}var protectedDayOfYearTokens=["D","DD"],protectedWeekYearTokens=["YY","YYYY"];function isProtectedDayOfYearToken($r){return protectedDayOfYearTokens.indexOf($r)!==-1}function isProtectedWeekYearToken($r){return protectedWeekYearTokens.indexOf($r)!==-1}function throwProtectedError($r,pr,Mr){if($r==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(pr,"`) for formatting years to the input `").concat(Mr,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if($r==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(pr,"`) for formatting years to the input `").concat(Mr,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if($r==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(pr,"`) for formatting days of the month to the input `").concat(Mr,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if($r==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(pr,"`) for formatting days of the month to the input `").concat(Mr,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var formatDistanceLocale={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},formatDistance=function(pr,Mr,Nr){var Dr,Br=formatDistanceLocale[pr];return typeof Br=="string"?Dr=Br:Mr===1?Dr=Br.one:Dr=Br.other.replace("{{count}}",Mr.toString()),Nr!=null&&Nr.addSuffix?Nr.comparison&&Nr.comparison>0?"in "+Dr:Dr+" ago":Dr};const formatDistance$1=formatDistance;function buildFormatLongFn($r){return function(){var pr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Mr=pr.width?String(pr.width):$r.defaultWidth,Nr=$r.formats[Mr]||$r.formats[$r.defaultWidth];return Nr}}var dateFormats={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},timeFormats={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dateTimeFormats={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong={date:buildFormatLongFn({formats:dateFormats,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats,defaultWidth:"full"})};const formatLong$1=formatLong;var formatRelativeLocale={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},formatRelative=function(pr,Mr,Nr,Dr){return formatRelativeLocale[pr]};const formatRelative$1=formatRelative;function buildLocalizeFn($r){return function(pr,Mr){var Nr=Mr!=null&&Mr.context?String(Mr.context):"standalone",Dr;if(Nr==="formatting"&&$r.formattingValues){var Br=$r.defaultFormattingWidth||$r.defaultWidth,Lr=Mr!=null&&Mr.width?String(Mr.width):Br;Dr=$r.formattingValues[Lr]||$r.formattingValues[Br]}else{var jr=$r.defaultWidth,Ur=Mr!=null&&Mr.width?String(Mr.width):$r.defaultWidth;Dr=$r.values[Ur]||$r.values[jr]}var Gr=$r.argumentCallback?$r.argumentCallback(pr):pr;return Dr[Gr]}}var eraValues={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},quarterValues={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},monthValues={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},dayValues={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},dayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},formattingDayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ordinalNumber=function(pr,Mr){var Nr=Number(pr),Dr=Nr%100;if(Dr>20||Dr<10)switch(Dr%10){case 1:return Nr+"st";case 2:return Nr+"nd";case 3:return Nr+"rd"}return Nr+"th"},localize={ordinalNumber,era:buildLocalizeFn({values:eraValues,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues,defaultWidth:"wide",argumentCallback:function(pr){return pr-1}}),month:buildLocalizeFn({values:monthValues,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues,defaultWidth:"wide",formattingValues:formattingDayPeriodValues,defaultFormattingWidth:"wide"})};const localize$1=localize;function buildMatchFn($r){return function(pr){var Mr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Nr=Mr.width,Dr=Nr&&$r.matchPatterns[Nr]||$r.matchPatterns[$r.defaultMatchWidth],Br=pr.match(Dr);if(!Br)return null;var Lr=Br[0],jr=Nr&&$r.parsePatterns[Nr]||$r.parsePatterns[$r.defaultParseWidth],Ur=Array.isArray(jr)?findIndex$1(jr,function(Qr){return Qr.test(Lr)}):findKey(jr,function(Qr){return Qr.test(Lr)}),Gr;Gr=$r.valueCallback?$r.valueCallback(Ur):Ur,Gr=Mr.valueCallback?Mr.valueCallback(Gr):Gr;var Yr=pr.slice(Lr.length);return{value:Gr,rest:Yr}}}function findKey($r,pr){for(var Mr in $r)if($r.hasOwnProperty(Mr)&&pr($r[Mr]))return Mr}function findIndex$1($r,pr){for(var Mr=0;Mr<$r.length;Mr++)if(pr($r[Mr]))return Mr}function buildMatchPatternFn($r){return function(pr){var Mr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Nr=pr.match($r.matchPattern);if(!Nr)return null;var Dr=Nr[0],Br=pr.match($r.parsePattern);if(!Br)return null;var Lr=$r.valueCallback?$r.valueCallback(Br[0]):Br[0];Lr=Mr.valueCallback?Mr.valueCallback(Lr):Lr;var jr=pr.slice(Dr.length);return{value:Lr,rest:jr}}}var matchOrdinalNumberPattern=/^(\d+)(th|st|nd|rd)?/i,parseOrdinalNumberPattern=/\d+/i,matchEraPatterns={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},parseEraPatterns={any:[/^b/i,/^(a|c)/i]},matchQuarterPatterns={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},parseQuarterPatterns={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},parseMonthPatterns={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},matchDayPatterns={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},parseDayPatterns={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},matchDayPeriodPatterns={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},parseDayPeriodPatterns={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},match={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern,parsePattern:parseOrdinalNumberPattern,valueCallback:function(pr){return parseInt(pr,10)}}),era:buildMatchFn({matchPatterns:matchEraPatterns,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns,defaultParseWidth:"any",valueCallback:function(pr){return pr+1}}),month:buildMatchFn({matchPatterns:matchMonthPatterns,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns,defaultParseWidth:"any"})};const match$1=match;var locale={code:"en-US",formatDistance:formatDistance$1,formatLong:formatLong$1,formatRelative:formatRelative$1,localize:localize$1,match:match$1,options:{weekStartsOn:0,firstWeekContainsDate:1}};const defaultLocale=locale;var formattingTokensRegExp$1=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,longFormattingTokensRegExp$1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,escapedStringRegExp$1=/^'([^]*?)'?$/,doubleQuoteRegExp$1=/''/g,unescapedLatinCharacterRegExp$1=/[a-zA-Z]/;function format($r,pr,Mr){var Nr,Dr,Br,Lr,jr,Ur,Gr,Yr,Qr,Wn,ga,eo,_i,va,io,no,so,ao;requiredArgs(2,arguments);var fo=String(pr),lo=getDefaultOptions(),oo=(Nr=(Dr=Mr==null?void 0:Mr.locale)!==null&&Dr!==void 0?Dr:lo.locale)!==null&&Nr!==void 0?Nr:defaultLocale,po=toInteger$2((Br=(Lr=(jr=(Ur=Mr==null?void 0:Mr.firstWeekContainsDate)!==null&&Ur!==void 0?Ur:Mr==null||(Gr=Mr.locale)===null||Gr===void 0||(Yr=Gr.options)===null||Yr===void 0?void 0:Yr.firstWeekContainsDate)!==null&&jr!==void 0?jr:lo.firstWeekContainsDate)!==null&&Lr!==void 0?Lr:(Qr=lo.locale)===null||Qr===void 0||(Wn=Qr.options)===null||Wn===void 0?void 0:Wn.firstWeekContainsDate)!==null&&Br!==void 0?Br:1);if(!(po>=1&&po<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var mo=toInteger$2((ga=(eo=(_i=(va=Mr==null?void 0:Mr.weekStartsOn)!==null&&va!==void 0?va:Mr==null||(io=Mr.locale)===null||io===void 0||(no=io.options)===null||no===void 0?void 0:no.weekStartsOn)!==null&&_i!==void 0?_i:lo.weekStartsOn)!==null&&eo!==void 0?eo:(so=lo.locale)===null||so===void 0||(ao=so.options)===null||ao===void 0?void 0:ao.weekStartsOn)!==null&&ga!==void 0?ga:0);if(!(mo>=0&&mo<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!oo.localize)throw new RangeError("locale must contain localize property");if(!oo.formatLong)throw new RangeError("locale must contain formatLong property");var $o=toDate$1($r);if(!isValid($o))throw new RangeError("Invalid time value");var Xn=getTimezoneOffsetInMilliseconds($o),Fr=subMilliseconds($o,Xn),Vr={firstWeekContainsDate:po,weekStartsOn:mo,locale:oo,_originalDate:$o},Wr=fo.match(longFormattingTokensRegExp$1).map(function(Jr){var Gn=Jr[0];if(Gn==="p"||Gn==="P"){var to=longFormatters$1[Gn];return to(Jr,oo.formatLong)}return Jr}).join("").match(formattingTokensRegExp$1).map(function(Jr){if(Jr==="''")return"'";var Gn=Jr[0];if(Gn==="'")return cleanEscapedString$1(Jr);var to=formatters$1[Gn];if(to)return!(Mr!=null&&Mr.useAdditionalWeekYearTokens)&&isProtectedWeekYearToken(Jr)&&throwProtectedError(Jr,pr,String($r)),!(Mr!=null&&Mr.useAdditionalDayOfYearTokens)&&isProtectedDayOfYearToken(Jr)&&throwProtectedError(Jr,pr,String($r)),to(Fr,Jr,oo.localize,Vr);if(Gn.match(unescapedLatinCharacterRegExp$1))throw new RangeError("Format string contains an unescaped latin alphabet character `"+Gn+"`");return Jr}).join("");return Wr}function cleanEscapedString$1($r){var pr=$r.match(escapedStringRegExp$1);return pr?pr[1].replace(doubleQuoteRegExp$1,"'"):$r}function isBefore$1($r,pr){requiredArgs(2,arguments);var Mr=toDate$1($r),Nr=toDate$1(pr);return Mr.getTime()<Nr.getTime()}function assign($r,pr){if($r==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var Mr in pr)Object.prototype.hasOwnProperty.call(pr,Mr)&&($r[Mr]=pr[Mr]);return $r}function _typeof$w($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$w=function(Mr){return typeof Mr}:_typeof$w=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$w($r)}function _inherits$v($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$w($r,pr)}function _setPrototypeOf$w($r,pr){return _setPrototypeOf$w=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$w($r,pr)}function _createSuper$v($r){var pr=_isNativeReflectConstruct$v();return function(){var Nr=_getPrototypeOf$v($r),Dr;if(pr){var Br=_getPrototypeOf$v(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$v(this,Dr)}}function _possibleConstructorReturn$v($r,pr){return pr&&(_typeof$w(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$w($r)}function _assertThisInitialized$w($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$v(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$v($r){return _getPrototypeOf$v=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$v($r)}function _classCallCheck$w($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$x($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$x($r,pr,Mr){return pr&&_defineProperties$x($r.prototype,pr),Mr&&_defineProperties$x($r,Mr),$r}function _defineProperty$v($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var TIMEZONE_UNIT_PRIORITY=10,Setter=function(){function $r(){_classCallCheck$w(this,$r),_defineProperty$v(this,"subPriority",0)}return _createClass$x($r,[{key:"validate",value:function(Mr,Nr){return!0}}]),$r}(),ValueSetter=function($r){_inherits$v(Mr,$r);var pr=_createSuper$v(Mr);function Mr(Nr,Dr,Br,Lr,jr){var Ur;return _classCallCheck$w(this,Mr),Ur=pr.call(this),Ur.value=Nr,Ur.validateValue=Dr,Ur.setValue=Br,Ur.priority=Lr,jr&&(Ur.subPriority=jr),Ur}return _createClass$x(Mr,[{key:"validate",value:function(Dr,Br){return this.validateValue(Dr,this.value,Br)}},{key:"set",value:function(Dr,Br,Lr){return this.setValue(Dr,Br,this.value,Lr)}}]),Mr}(Setter),DateToSystemTimezoneSetter=function($r){_inherits$v(Mr,$r);var pr=_createSuper$v(Mr);function Mr(){var Nr;_classCallCheck$w(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$v(_assertThisInitialized$w(Nr),"priority",TIMEZONE_UNIT_PRIORITY),_defineProperty$v(_assertThisInitialized$w(Nr),"subPriority",-1),Nr}return _createClass$x(Mr,[{key:"set",value:function(Dr,Br){if(Br.timestampIsSet)return Dr;var Lr=new Date(0);return Lr.setFullYear(Dr.getUTCFullYear(),Dr.getUTCMonth(),Dr.getUTCDate()),Lr.setHours(Dr.getUTCHours(),Dr.getUTCMinutes(),Dr.getUTCSeconds(),Dr.getUTCMilliseconds()),Lr}}]),Mr}(Setter);function _classCallCheck$v($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$w($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$w($r,pr,Mr){return pr&&_defineProperties$w($r.prototype,pr),Mr&&_defineProperties$w($r,Mr),$r}var Parser=function(){function $r(){_classCallCheck$v(this,$r)}return _createClass$w($r,[{key:"run",value:function(Mr,Nr,Dr,Br){var Lr=this.parse(Mr,Nr,Dr,Br);return Lr?{setter:new ValueSetter(Lr.value,this.validate,this.set,this.priority,this.subPriority),rest:Lr.rest}:null}},{key:"validate",value:function(Mr,Nr,Dr){return!0}}]),$r}();function _typeof$v($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$v=function(Mr){return typeof Mr}:_typeof$v=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$v($r)}function _classCallCheck$u($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$v($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$v($r,pr,Mr){return pr&&_defineProperties$v($r.prototype,pr),Mr&&_defineProperties$v($r,Mr),$r}function _inherits$u($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$v($r,pr)}function _setPrototypeOf$v($r,pr){return _setPrototypeOf$v=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$v($r,pr)}function _createSuper$u($r){var pr=_isNativeReflectConstruct$u();return function(){var Nr=_getPrototypeOf$u($r),Dr;if(pr){var Br=_getPrototypeOf$u(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$u(this,Dr)}}function _possibleConstructorReturn$u($r,pr){return pr&&(_typeof$v(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$v($r)}function _assertThisInitialized$v($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$u(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$u($r){return _getPrototypeOf$u=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$u($r)}function _defineProperty$u($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var EraParser=function($r){_inherits$u(Mr,$r);var pr=_createSuper$u(Mr);function Mr(){var Nr;_classCallCheck$u(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$u(_assertThisInitialized$v(Nr),"priority",140),_defineProperty$u(_assertThisInitialized$v(Nr),"incompatibleTokens",["R","u","t","T"]),Nr}return _createClass$v(Mr,[{key:"parse",value:function(Dr,Br,Lr){switch(Br){case"G":case"GG":case"GGG":return Lr.era(Dr,{width:"abbreviated"})||Lr.era(Dr,{width:"narrow"});case"GGGGG":return Lr.era(Dr,{width:"narrow"});case"GGGG":default:return Lr.era(Dr,{width:"wide"})||Lr.era(Dr,{width:"abbreviated"})||Lr.era(Dr,{width:"narrow"})}}},{key:"set",value:function(Dr,Br,Lr){return Br.era=Lr,Dr.setUTCFullYear(Lr,0,1),Dr.setUTCHours(0,0,0,0),Dr}}]),Mr}(Parser),millisecondsInMinute=6e4,millisecondsInHour=36e5,millisecondsInSecond=1e3,numericPatterns={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},timezonePatterns={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function mapValue($r,pr){return $r&&{value:pr($r.value),rest:$r.rest}}function parseNumericPattern($r,pr){var Mr=pr.match($r);return Mr?{value:parseInt(Mr[0],10),rest:pr.slice(Mr[0].length)}:null}function parseTimezonePattern($r,pr){var Mr=pr.match($r);if(!Mr)return null;if(Mr[0]==="Z")return{value:0,rest:pr.slice(1)};var Nr=Mr[1]==="+"?1:-1,Dr=Mr[2]?parseInt(Mr[2],10):0,Br=Mr[3]?parseInt(Mr[3],10):0,Lr=Mr[5]?parseInt(Mr[5],10):0;return{value:Nr*(Dr*millisecondsInHour+Br*millisecondsInMinute+Lr*millisecondsInSecond),rest:pr.slice(Mr[0].length)}}function parseAnyDigitsSigned($r){return parseNumericPattern(numericPatterns.anyDigitsSigned,$r)}function parseNDigits($r,pr){switch($r){case 1:return parseNumericPattern(numericPatterns.singleDigit,pr);case 2:return parseNumericPattern(numericPatterns.twoDigits,pr);case 3:return parseNumericPattern(numericPatterns.threeDigits,pr);case 4:return parseNumericPattern(numericPatterns.fourDigits,pr);default:return parseNumericPattern(new RegExp("^\\d{1,"+$r+"}"),pr)}}function parseNDigitsSigned($r,pr){switch($r){case 1:return parseNumericPattern(numericPatterns.singleDigitSigned,pr);case 2:return parseNumericPattern(numericPatterns.twoDigitsSigned,pr);case 3:return parseNumericPattern(numericPatterns.threeDigitsSigned,pr);case 4:return parseNumericPattern(numericPatterns.fourDigitsSigned,pr);default:return parseNumericPattern(new RegExp("^-?\\d{1,"+$r+"}"),pr)}}function dayPeriodEnumToHours($r){switch($r){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function normalizeTwoDigitYear($r,pr){var Mr=pr>0,Nr=Mr?pr:1-pr,Dr;if(Nr<=50)Dr=$r||100;else{var Br=Nr+50,Lr=Math.floor(Br/100)*100,jr=$r>=Br%100;Dr=$r+Lr-(jr?100:0)}return Mr?Dr:1-Dr}function isLeapYearIndex($r){return $r%400===0||$r%4===0&&$r%100!==0}function _typeof$u($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$u=function(Mr){return typeof Mr}:_typeof$u=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$u($r)}function _classCallCheck$t($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$u($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$u($r,pr,Mr){return pr&&_defineProperties$u($r.prototype,pr),Mr&&_defineProperties$u($r,Mr),$r}function _inherits$t($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$u($r,pr)}function _setPrototypeOf$u($r,pr){return _setPrototypeOf$u=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$u($r,pr)}function _createSuper$t($r){var pr=_isNativeReflectConstruct$t();return function(){var Nr=_getPrototypeOf$t($r),Dr;if(pr){var Br=_getPrototypeOf$t(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$t(this,Dr)}}function _possibleConstructorReturn$t($r,pr){return pr&&(_typeof$u(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$u($r)}function _assertThisInitialized$u($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$t(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$t($r){return _getPrototypeOf$t=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$t($r)}function _defineProperty$t($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var YearParser=function($r){_inherits$t(Mr,$r);var pr=_createSuper$t(Mr);function Mr(){var Nr;_classCallCheck$t(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$t(_assertThisInitialized$u(Nr),"priority",130),_defineProperty$t(_assertThisInitialized$u(Nr),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),Nr}return _createClass$u(Mr,[{key:"parse",value:function(Dr,Br,Lr){var jr=function(Gr){return{year:Gr,isTwoDigitYear:Br==="yy"}};switch(Br){case"y":return mapValue(parseNDigits(4,Dr),jr);case"yo":return mapValue(Lr.ordinalNumber(Dr,{unit:"year"}),jr);default:return mapValue(parseNDigits(Br.length,Dr),jr)}}},{key:"validate",value:function(Dr,Br){return Br.isTwoDigitYear||Br.year>0}},{key:"set",value:function(Dr,Br,Lr){var jr=Dr.getUTCFullYear();if(Lr.isTwoDigitYear){var Ur=normalizeTwoDigitYear(Lr.year,jr);return Dr.setUTCFullYear(Ur,0,1),Dr.setUTCHours(0,0,0,0),Dr}var Gr=!("era"in Br)||Br.era===1?Lr.year:1-Lr.year;return Dr.setUTCFullYear(Gr,0,1),Dr.setUTCHours(0,0,0,0),Dr}}]),Mr}(Parser);function _typeof$t($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$t=function(Mr){return typeof Mr}:_typeof$t=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$t($r)}function _classCallCheck$s($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$t($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$t($r,pr,Mr){return pr&&_defineProperties$t($r.prototype,pr),Mr&&_defineProperties$t($r,Mr),$r}function _inherits$s($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$t($r,pr)}function _setPrototypeOf$t($r,pr){return _setPrototypeOf$t=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$t($r,pr)}function _createSuper$s($r){var pr=_isNativeReflectConstruct$s();return function(){var Nr=_getPrototypeOf$s($r),Dr;if(pr){var Br=_getPrototypeOf$s(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$s(this,Dr)}}function _possibleConstructorReturn$s($r,pr){return pr&&(_typeof$t(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$t($r)}function _assertThisInitialized$t($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$s(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$s($r){return _getPrototypeOf$s=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$s($r)}function _defineProperty$s($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var LocalWeekYearParser=function($r){_inherits$s(Mr,$r);var pr=_createSuper$s(Mr);function Mr(){var Nr;_classCallCheck$s(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$s(_assertThisInitialized$t(Nr),"priority",130),_defineProperty$s(_assertThisInitialized$t(Nr),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),Nr}return _createClass$t(Mr,[{key:"parse",value:function(Dr,Br,Lr){var jr=function(Gr){return{year:Gr,isTwoDigitYear:Br==="YY"}};switch(Br){case"Y":return mapValue(parseNDigits(4,Dr),jr);case"Yo":return mapValue(Lr.ordinalNumber(Dr,{unit:"year"}),jr);default:return mapValue(parseNDigits(Br.length,Dr),jr)}}},{key:"validate",value:function(Dr,Br){return Br.isTwoDigitYear||Br.year>0}},{key:"set",value:function(Dr,Br,Lr,jr){var Ur=getUTCWeekYear(Dr,jr);if(Lr.isTwoDigitYear){var Gr=normalizeTwoDigitYear(Lr.year,Ur);return Dr.setUTCFullYear(Gr,0,jr.firstWeekContainsDate),Dr.setUTCHours(0,0,0,0),startOfUTCWeek(Dr,jr)}var Yr=!("era"in Br)||Br.era===1?Lr.year:1-Lr.year;return Dr.setUTCFullYear(Yr,0,jr.firstWeekContainsDate),Dr.setUTCHours(0,0,0,0),startOfUTCWeek(Dr,jr)}}]),Mr}(Parser);function _typeof$s($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$s=function(Mr){return typeof Mr}:_typeof$s=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$s($r)}function _classCallCheck$r($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$s($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$s($r,pr,Mr){return pr&&_defineProperties$s($r.prototype,pr),Mr&&_defineProperties$s($r,Mr),$r}function _inherits$r($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$s($r,pr)}function _setPrototypeOf$s($r,pr){return _setPrototypeOf$s=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$s($r,pr)}function _createSuper$r($r){var pr=_isNativeReflectConstruct$r();return function(){var Nr=_getPrototypeOf$r($r),Dr;if(pr){var Br=_getPrototypeOf$r(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$r(this,Dr)}}function _possibleConstructorReturn$r($r,pr){return pr&&(_typeof$s(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$s($r)}function _assertThisInitialized$s($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$r($r){return _getPrototypeOf$r=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$r($r)}function _defineProperty$r($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var ISOWeekYearParser=function($r){_inherits$r(Mr,$r);var pr=_createSuper$r(Mr);function Mr(){var Nr;_classCallCheck$r(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$r(_assertThisInitialized$s(Nr),"priority",130),_defineProperty$r(_assertThisInitialized$s(Nr),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),Nr}return _createClass$s(Mr,[{key:"parse",value:function(Dr,Br){return parseNDigitsSigned(Br==="R"?4:Br.length,Dr)}},{key:"set",value:function(Dr,Br,Lr){var jr=new Date(0);return jr.setUTCFullYear(Lr,0,4),jr.setUTCHours(0,0,0,0),startOfUTCISOWeek(jr)}}]),Mr}(Parser);function _typeof$r($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$r=function(Mr){return typeof Mr}:_typeof$r=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$r($r)}function _classCallCheck$q($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$r($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$r($r,pr,Mr){return pr&&_defineProperties$r($r.prototype,pr),Mr&&_defineProperties$r($r,Mr),$r}function _inherits$q($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$r($r,pr)}function _setPrototypeOf$r($r,pr){return _setPrototypeOf$r=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$r($r,pr)}function _createSuper$q($r){var pr=_isNativeReflectConstruct$q();return function(){var Nr=_getPrototypeOf$q($r),Dr;if(pr){var Br=_getPrototypeOf$q(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$q(this,Dr)}}function _possibleConstructorReturn$q($r,pr){return pr&&(_typeof$r(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$r($r)}function _assertThisInitialized$r($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$q(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$q($r){return _getPrototypeOf$q=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$q($r)}function _defineProperty$q($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var ExtendedYearParser=function($r){_inherits$q(Mr,$r);var pr=_createSuper$q(Mr);function Mr(){var Nr;_classCallCheck$q(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$q(_assertThisInitialized$r(Nr),"priority",130),_defineProperty$q(_assertThisInitialized$r(Nr),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),Nr}return _createClass$r(Mr,[{key:"parse",value:function(Dr,Br){return parseNDigitsSigned(Br==="u"?4:Br.length,Dr)}},{key:"set",value:function(Dr,Br,Lr){return Dr.setUTCFullYear(Lr,0,1),Dr.setUTCHours(0,0,0,0),Dr}}]),Mr}(Parser);function _typeof$q($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$q=function(Mr){return typeof Mr}:_typeof$q=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$q($r)}function _classCallCheck$p($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$q($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$q($r,pr,Mr){return pr&&_defineProperties$q($r.prototype,pr),Mr&&_defineProperties$q($r,Mr),$r}function _inherits$p($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$q($r,pr)}function _setPrototypeOf$q($r,pr){return _setPrototypeOf$q=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$q($r,pr)}function _createSuper$p($r){var pr=_isNativeReflectConstruct$p();return function(){var Nr=_getPrototypeOf$p($r),Dr;if(pr){var Br=_getPrototypeOf$p(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$p(this,Dr)}}function _possibleConstructorReturn$p($r,pr){return pr&&(_typeof$q(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$q($r)}function _assertThisInitialized$q($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$p(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$p($r){return _getPrototypeOf$p=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$p($r)}function _defineProperty$p($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var QuarterParser=function($r){_inherits$p(Mr,$r);var pr=_createSuper$p(Mr);function Mr(){var Nr;_classCallCheck$p(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$p(_assertThisInitialized$q(Nr),"priority",120),_defineProperty$p(_assertThisInitialized$q(Nr),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),Nr}return _createClass$q(Mr,[{key:"parse",value:function(Dr,Br,Lr){switch(Br){case"Q":case"QQ":return parseNDigits(Br.length,Dr);case"Qo":return Lr.ordinalNumber(Dr,{unit:"quarter"});case"QQQ":return Lr.quarter(Dr,{width:"abbreviated",context:"formatting"})||Lr.quarter(Dr,{width:"narrow",context:"formatting"});case"QQQQQ":return Lr.quarter(Dr,{width:"narrow",context:"formatting"});case"QQQQ":default:return Lr.quarter(Dr,{width:"wide",context:"formatting"})||Lr.quarter(Dr,{width:"abbreviated",context:"formatting"})||Lr.quarter(Dr,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(Dr,Br){return Br>=1&&Br<=4}},{key:"set",value:function(Dr,Br,Lr){return Dr.setUTCMonth((Lr-1)*3,1),Dr.setUTCHours(0,0,0,0),Dr}}]),Mr}(Parser);function _typeof$p($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$p=function(Mr){return typeof Mr}:_typeof$p=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$p($r)}function _classCallCheck$o($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$p($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$p($r,pr,Mr){return pr&&_defineProperties$p($r.prototype,pr),Mr&&_defineProperties$p($r,Mr),$r}function _inherits$o($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$p($r,pr)}function _setPrototypeOf$p($r,pr){return _setPrototypeOf$p=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$p($r,pr)}function _createSuper$o($r){var pr=_isNativeReflectConstruct$o();return function(){var Nr=_getPrototypeOf$o($r),Dr;if(pr){var Br=_getPrototypeOf$o(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$o(this,Dr)}}function _possibleConstructorReturn$o($r,pr){return pr&&(_typeof$p(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$p($r)}function _assertThisInitialized$p($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$o(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$o($r){return _getPrototypeOf$o=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$o($r)}function _defineProperty$o($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var StandAloneQuarterParser=function($r){_inherits$o(Mr,$r);var pr=_createSuper$o(Mr);function Mr(){var Nr;_classCallCheck$o(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$o(_assertThisInitialized$p(Nr),"priority",120),_defineProperty$o(_assertThisInitialized$p(Nr),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),Nr}return _createClass$p(Mr,[{key:"parse",value:function(Dr,Br,Lr){switch(Br){case"q":case"qq":return parseNDigits(Br.length,Dr);case"qo":return Lr.ordinalNumber(Dr,{unit:"quarter"});case"qqq":return Lr.quarter(Dr,{width:"abbreviated",context:"standalone"})||Lr.quarter(Dr,{width:"narrow",context:"standalone"});case"qqqqq":return Lr.quarter(Dr,{width:"narrow",context:"standalone"});case"qqqq":default:return Lr.quarter(Dr,{width:"wide",context:"standalone"})||Lr.quarter(Dr,{width:"abbreviated",context:"standalone"})||Lr.quarter(Dr,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(Dr,Br){return Br>=1&&Br<=4}},{key:"set",value:function(Dr,Br,Lr){return Dr.setUTCMonth((Lr-1)*3,1),Dr.setUTCHours(0,0,0,0),Dr}}]),Mr}(Parser);function _typeof$o($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$o=function(Mr){return typeof Mr}:_typeof$o=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$o($r)}function _classCallCheck$n($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$o($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$o($r,pr,Mr){return pr&&_defineProperties$o($r.prototype,pr),Mr&&_defineProperties$o($r,Mr),$r}function _inherits$n($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$o($r,pr)}function _setPrototypeOf$o($r,pr){return _setPrototypeOf$o=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$o($r,pr)}function _createSuper$n($r){var pr=_isNativeReflectConstruct$n();return function(){var Nr=_getPrototypeOf$n($r),Dr;if(pr){var Br=_getPrototypeOf$n(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$n(this,Dr)}}function _possibleConstructorReturn$n($r,pr){return pr&&(_typeof$o(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$o($r)}function _assertThisInitialized$o($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$n(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$n($r){return _getPrototypeOf$n=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$n($r)}function _defineProperty$n($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var MonthParser=function($r){_inherits$n(Mr,$r);var pr=_createSuper$n(Mr);function Mr(){var Nr;_classCallCheck$n(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$n(_assertThisInitialized$o(Nr),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),_defineProperty$n(_assertThisInitialized$o(Nr),"priority",110),Nr}return _createClass$o(Mr,[{key:"parse",value:function(Dr,Br,Lr){var jr=function(Gr){return Gr-1};switch(Br){case"M":return mapValue(parseNumericPattern(numericPatterns.month,Dr),jr);case"MM":return mapValue(parseNDigits(2,Dr),jr);case"Mo":return mapValue(Lr.ordinalNumber(Dr,{unit:"month"}),jr);case"MMM":return Lr.month(Dr,{width:"abbreviated",context:"formatting"})||Lr.month(Dr,{width:"narrow",context:"formatting"});case"MMMMM":return Lr.month(Dr,{width:"narrow",context:"formatting"});case"MMMM":default:return Lr.month(Dr,{width:"wide",context:"formatting"})||Lr.month(Dr,{width:"abbreviated",context:"formatting"})||Lr.month(Dr,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(Dr,Br){return Br>=0&&Br<=11}},{key:"set",value:function(Dr,Br,Lr){return Dr.setUTCMonth(Lr,1),Dr.setUTCHours(0,0,0,0),Dr}}]),Mr}(Parser);function _typeof$n($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$n=function(Mr){return typeof Mr}:_typeof$n=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$n($r)}function _classCallCheck$m($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$n($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$n($r,pr,Mr){return pr&&_defineProperties$n($r.prototype,pr),Mr&&_defineProperties$n($r,Mr),$r}function _inherits$m($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$n($r,pr)}function _setPrototypeOf$n($r,pr){return _setPrototypeOf$n=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$n($r,pr)}function _createSuper$m($r){var pr=_isNativeReflectConstruct$m();return function(){var Nr=_getPrototypeOf$m($r),Dr;if(pr){var Br=_getPrototypeOf$m(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$m(this,Dr)}}function _possibleConstructorReturn$m($r,pr){return pr&&(_typeof$n(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$n($r)}function _assertThisInitialized$n($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$m(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$m($r){return _getPrototypeOf$m=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$m($r)}function _defineProperty$m($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var StandAloneMonthParser=function($r){_inherits$m(Mr,$r);var pr=_createSuper$m(Mr);function Mr(){var Nr;_classCallCheck$m(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$m(_assertThisInitialized$n(Nr),"priority",110),_defineProperty$m(_assertThisInitialized$n(Nr),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),Nr}return _createClass$n(Mr,[{key:"parse",value:function(Dr,Br,Lr){var jr=function(Gr){return Gr-1};switch(Br){case"L":return mapValue(parseNumericPattern(numericPatterns.month,Dr),jr);case"LL":return mapValue(parseNDigits(2,Dr),jr);case"Lo":return mapValue(Lr.ordinalNumber(Dr,{unit:"month"}),jr);case"LLL":return Lr.month(Dr,{width:"abbreviated",context:"standalone"})||Lr.month(Dr,{width:"narrow",context:"standalone"});case"LLLLL":return Lr.month(Dr,{width:"narrow",context:"standalone"});case"LLLL":default:return Lr.month(Dr,{width:"wide",context:"standalone"})||Lr.month(Dr,{width:"abbreviated",context:"standalone"})||Lr.month(Dr,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(Dr,Br){return Br>=0&&Br<=11}},{key:"set",value:function(Dr,Br,Lr){return Dr.setUTCMonth(Lr,1),Dr.setUTCHours(0,0,0,0),Dr}}]),Mr}(Parser);function setUTCWeek($r,pr,Mr){requiredArgs(2,arguments);var Nr=toDate$1($r),Dr=toInteger$2(pr),Br=getUTCWeek(Nr,Mr)-Dr;return Nr.setUTCDate(Nr.getUTCDate()-Br*7),Nr}function _typeof$m($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$m=function(Mr){return typeof Mr}:_typeof$m=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$m($r)}function _classCallCheck$l($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$m($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$m($r,pr,Mr){return pr&&_defineProperties$m($r.prototype,pr),Mr&&_defineProperties$m($r,Mr),$r}function _inherits$l($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$m($r,pr)}function _setPrototypeOf$m($r,pr){return _setPrototypeOf$m=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$m($r,pr)}function _createSuper$l($r){var pr=_isNativeReflectConstruct$l();return function(){var Nr=_getPrototypeOf$l($r),Dr;if(pr){var Br=_getPrototypeOf$l(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$l(this,Dr)}}function _possibleConstructorReturn$l($r,pr){return pr&&(_typeof$m(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$m($r)}function _assertThisInitialized$m($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$l(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$l($r){return _getPrototypeOf$l=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$l($r)}function _defineProperty$l($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var LocalWeekParser=function($r){_inherits$l(Mr,$r);var pr=_createSuper$l(Mr);function Mr(){var Nr;_classCallCheck$l(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$l(_assertThisInitialized$m(Nr),"priority",100),_defineProperty$l(_assertThisInitialized$m(Nr),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),Nr}return _createClass$m(Mr,[{key:"parse",value:function(Dr,Br,Lr){switch(Br){case"w":return parseNumericPattern(numericPatterns.week,Dr);case"wo":return Lr.ordinalNumber(Dr,{unit:"week"});default:return parseNDigits(Br.length,Dr)}}},{key:"validate",value:function(Dr,Br){return Br>=1&&Br<=53}},{key:"set",value:function(Dr,Br,Lr,jr){return startOfUTCWeek(setUTCWeek(Dr,Lr,jr),jr)}}]),Mr}(Parser);function setUTCISOWeek($r,pr){requiredArgs(2,arguments);var Mr=toDate$1($r),Nr=toInteger$2(pr),Dr=getUTCISOWeek(Mr)-Nr;return Mr.setUTCDate(Mr.getUTCDate()-Dr*7),Mr}function _typeof$l($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$l=function(Mr){return typeof Mr}:_typeof$l=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$l($r)}function _classCallCheck$k($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$l($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$l($r,pr,Mr){return pr&&_defineProperties$l($r.prototype,pr),Mr&&_defineProperties$l($r,Mr),$r}function _inherits$k($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$l($r,pr)}function _setPrototypeOf$l($r,pr){return _setPrototypeOf$l=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$l($r,pr)}function _createSuper$k($r){var pr=_isNativeReflectConstruct$k();return function(){var Nr=_getPrototypeOf$k($r),Dr;if(pr){var Br=_getPrototypeOf$k(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$k(this,Dr)}}function _possibleConstructorReturn$k($r,pr){return pr&&(_typeof$l(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$l($r)}function _assertThisInitialized$l($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$k(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$k($r){return _getPrototypeOf$k=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$k($r)}function _defineProperty$k($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var ISOWeekParser=function($r){_inherits$k(Mr,$r);var pr=_createSuper$k(Mr);function Mr(){var Nr;_classCallCheck$k(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$k(_assertThisInitialized$l(Nr),"priority",100),_defineProperty$k(_assertThisInitialized$l(Nr),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),Nr}return _createClass$l(Mr,[{key:"parse",value:function(Dr,Br,Lr){switch(Br){case"I":return parseNumericPattern(numericPatterns.week,Dr);case"Io":return Lr.ordinalNumber(Dr,{unit:"week"});default:return parseNDigits(Br.length,Dr)}}},{key:"validate",value:function(Dr,Br){return Br>=1&&Br<=53}},{key:"set",value:function(Dr,Br,Lr){return startOfUTCISOWeek(setUTCISOWeek(Dr,Lr))}}]),Mr}(Parser);function _typeof$k($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$k=function(Mr){return typeof Mr}:_typeof$k=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$k($r)}function _classCallCheck$j($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$k($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$k($r,pr,Mr){return pr&&_defineProperties$k($r.prototype,pr),Mr&&_defineProperties$k($r,Mr),$r}function _inherits$j($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$k($r,pr)}function _setPrototypeOf$k($r,pr){return _setPrototypeOf$k=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$k($r,pr)}function _createSuper$j($r){var pr=_isNativeReflectConstruct$j();return function(){var Nr=_getPrototypeOf$j($r),Dr;if(pr){var Br=_getPrototypeOf$j(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$j(this,Dr)}}function _possibleConstructorReturn$j($r,pr){return pr&&(_typeof$k(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$k($r)}function _assertThisInitialized$k($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$j(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$j($r){return _getPrototypeOf$j=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$j($r)}function _defineProperty$j($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var DAYS_IN_MONTH=[31,28,31,30,31,30,31,31,30,31,30,31],DAYS_IN_MONTH_LEAP_YEAR=[31,29,31,30,31,30,31,31,30,31,30,31],DateParser=function($r){_inherits$j(Mr,$r);var pr=_createSuper$j(Mr);function Mr(){var Nr;_classCallCheck$j(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$j(_assertThisInitialized$k(Nr),"priority",90),_defineProperty$j(_assertThisInitialized$k(Nr),"subPriority",1),_defineProperty$j(_assertThisInitialized$k(Nr),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),Nr}return _createClass$k(Mr,[{key:"parse",value:function(Dr,Br,Lr){switch(Br){case"d":return parseNumericPattern(numericPatterns.date,Dr);case"do":return Lr.ordinalNumber(Dr,{unit:"date"});default:return parseNDigits(Br.length,Dr)}}},{key:"validate",value:function(Dr,Br){var Lr=Dr.getUTCFullYear(),jr=isLeapYearIndex(Lr),Ur=Dr.getUTCMonth();return jr?Br>=1&&Br<=DAYS_IN_MONTH_LEAP_YEAR[Ur]:Br>=1&&Br<=DAYS_IN_MONTH[Ur]}},{key:"set",value:function(Dr,Br,Lr){return Dr.setUTCDate(Lr),Dr.setUTCHours(0,0,0,0),Dr}}]),Mr}(Parser);function _typeof$j($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$j=function(Mr){return typeof Mr}:_typeof$j=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$j($r)}function _classCallCheck$i($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$j($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$j($r,pr,Mr){return pr&&_defineProperties$j($r.prototype,pr),Mr&&_defineProperties$j($r,Mr),$r}function _inherits$i($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$j($r,pr)}function _setPrototypeOf$j($r,pr){return _setPrototypeOf$j=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$j($r,pr)}function _createSuper$i($r){var pr=_isNativeReflectConstruct$i();return function(){var Nr=_getPrototypeOf$i($r),Dr;if(pr){var Br=_getPrototypeOf$i(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$i(this,Dr)}}function _possibleConstructorReturn$i($r,pr){return pr&&(_typeof$j(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$j($r)}function _assertThisInitialized$j($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$i(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$i($r){return _getPrototypeOf$i=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$i($r)}function _defineProperty$i($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var DayOfYearParser=function($r){_inherits$i(Mr,$r);var pr=_createSuper$i(Mr);function Mr(){var Nr;_classCallCheck$i(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$i(_assertThisInitialized$j(Nr),"priority",90),_defineProperty$i(_assertThisInitialized$j(Nr),"subpriority",1),_defineProperty$i(_assertThisInitialized$j(Nr),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),Nr}return _createClass$j(Mr,[{key:"parse",value:function(Dr,Br,Lr){switch(Br){case"D":case"DD":return parseNumericPattern(numericPatterns.dayOfYear,Dr);case"Do":return Lr.ordinalNumber(Dr,{unit:"date"});default:return parseNDigits(Br.length,Dr)}}},{key:"validate",value:function(Dr,Br){var Lr=Dr.getUTCFullYear(),jr=isLeapYearIndex(Lr);return jr?Br>=1&&Br<=366:Br>=1&&Br<=365}},{key:"set",value:function(Dr,Br,Lr){return Dr.setUTCMonth(0,Lr),Dr.setUTCHours(0,0,0,0),Dr}}]),Mr}(Parser);function setUTCDay($r,pr,Mr){var Nr,Dr,Br,Lr,jr,Ur,Gr,Yr;requiredArgs(2,arguments);var Qr=getDefaultOptions(),Wn=toInteger$2((Nr=(Dr=(Br=(Lr=Mr==null?void 0:Mr.weekStartsOn)!==null&&Lr!==void 0?Lr:Mr==null||(jr=Mr.locale)===null||jr===void 0||(Ur=jr.options)===null||Ur===void 0?void 0:Ur.weekStartsOn)!==null&&Br!==void 0?Br:Qr.weekStartsOn)!==null&&Dr!==void 0?Dr:(Gr=Qr.locale)===null||Gr===void 0||(Yr=Gr.options)===null||Yr===void 0?void 0:Yr.weekStartsOn)!==null&&Nr!==void 0?Nr:0);if(!(Wn>=0&&Wn<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var ga=toDate$1($r),eo=toInteger$2(pr),_i=ga.getUTCDay(),va=eo%7,io=(va+7)%7,no=(io<Wn?7:0)+eo-_i;return ga.setUTCDate(ga.getUTCDate()+no),ga}function _typeof$i($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$i=function(Mr){return typeof Mr}:_typeof$i=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$i($r)}function _classCallCheck$h($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$i($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$i($r,pr,Mr){return pr&&_defineProperties$i($r.prototype,pr),Mr&&_defineProperties$i($r,Mr),$r}function _inherits$h($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$i($r,pr)}function _setPrototypeOf$i($r,pr){return _setPrototypeOf$i=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$i($r,pr)}function _createSuper$h($r){var pr=_isNativeReflectConstruct$h();return function(){var Nr=_getPrototypeOf$h($r),Dr;if(pr){var Br=_getPrototypeOf$h(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$h(this,Dr)}}function _possibleConstructorReturn$h($r,pr){return pr&&(_typeof$i(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$i($r)}function _assertThisInitialized$i($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$h(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$h($r){return _getPrototypeOf$h=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$h($r)}function _defineProperty$h($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var DayParser=function($r){_inherits$h(Mr,$r);var pr=_createSuper$h(Mr);function Mr(){var Nr;_classCallCheck$h(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$h(_assertThisInitialized$i(Nr),"priority",90),_defineProperty$h(_assertThisInitialized$i(Nr),"incompatibleTokens",["D","i","e","c","t","T"]),Nr}return _createClass$i(Mr,[{key:"parse",value:function(Dr,Br,Lr){switch(Br){case"E":case"EE":case"EEE":return Lr.day(Dr,{width:"abbreviated",context:"formatting"})||Lr.day(Dr,{width:"short",context:"formatting"})||Lr.day(Dr,{width:"narrow",context:"formatting"});case"EEEEE":return Lr.day(Dr,{width:"narrow",context:"formatting"});case"EEEEEE":return Lr.day(Dr,{width:"short",context:"formatting"})||Lr.day(Dr,{width:"narrow",context:"formatting"});case"EEEE":default:return Lr.day(Dr,{width:"wide",context:"formatting"})||Lr.day(Dr,{width:"abbreviated",context:"formatting"})||Lr.day(Dr,{width:"short",context:"formatting"})||Lr.day(Dr,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(Dr,Br){return Br>=0&&Br<=6}},{key:"set",value:function(Dr,Br,Lr,jr){return Dr=setUTCDay(Dr,Lr,jr),Dr.setUTCHours(0,0,0,0),Dr}}]),Mr}(Parser);function _typeof$h($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$h=function(Mr){return typeof Mr}:_typeof$h=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$h($r)}function _classCallCheck$g($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$h($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$h($r,pr,Mr){return pr&&_defineProperties$h($r.prototype,pr),Mr&&_defineProperties$h($r,Mr),$r}function _inherits$g($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$h($r,pr)}function _setPrototypeOf$h($r,pr){return _setPrototypeOf$h=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$h($r,pr)}function _createSuper$g($r){var pr=_isNativeReflectConstruct$g();return function(){var Nr=_getPrototypeOf$g($r),Dr;if(pr){var Br=_getPrototypeOf$g(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$g(this,Dr)}}function _possibleConstructorReturn$g($r,pr){return pr&&(_typeof$h(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$h($r)}function _assertThisInitialized$h($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$g(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$g($r){return _getPrototypeOf$g=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$g($r)}function _defineProperty$g($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var LocalDayParser=function($r){_inherits$g(Mr,$r);var pr=_createSuper$g(Mr);function Mr(){var Nr;_classCallCheck$g(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$g(_assertThisInitialized$h(Nr),"priority",90),_defineProperty$g(_assertThisInitialized$h(Nr),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),Nr}return _createClass$h(Mr,[{key:"parse",value:function(Dr,Br,Lr,jr){var Ur=function(Yr){var Qr=Math.floor((Yr-1)/7)*7;return(Yr+jr.weekStartsOn+6)%7+Qr};switch(Br){case"e":case"ee":return mapValue(parseNDigits(Br.length,Dr),Ur);case"eo":return mapValue(Lr.ordinalNumber(Dr,{unit:"day"}),Ur);case"eee":return Lr.day(Dr,{width:"abbreviated",context:"formatting"})||Lr.day(Dr,{width:"short",context:"formatting"})||Lr.day(Dr,{width:"narrow",context:"formatting"});case"eeeee":return Lr.day(Dr,{width:"narrow",context:"formatting"});case"eeeeee":return Lr.day(Dr,{width:"short",context:"formatting"})||Lr.day(Dr,{width:"narrow",context:"formatting"});case"eeee":default:return Lr.day(Dr,{width:"wide",context:"formatting"})||Lr.day(Dr,{width:"abbreviated",context:"formatting"})||Lr.day(Dr,{width:"short",context:"formatting"})||Lr.day(Dr,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(Dr,Br){return Br>=0&&Br<=6}},{key:"set",value:function(Dr,Br,Lr,jr){return Dr=setUTCDay(Dr,Lr,jr),Dr.setUTCHours(0,0,0,0),Dr}}]),Mr}(Parser);function _typeof$g($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$g=function(Mr){return typeof Mr}:_typeof$g=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$g($r)}function _classCallCheck$f($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$g($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$g($r,pr,Mr){return pr&&_defineProperties$g($r.prototype,pr),Mr&&_defineProperties$g($r,Mr),$r}function _inherits$f($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$g($r,pr)}function _setPrototypeOf$g($r,pr){return _setPrototypeOf$g=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$g($r,pr)}function _createSuper$f($r){var pr=_isNativeReflectConstruct$f();return function(){var Nr=_getPrototypeOf$f($r),Dr;if(pr){var Br=_getPrototypeOf$f(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$f(this,Dr)}}function _possibleConstructorReturn$f($r,pr){return pr&&(_typeof$g(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$g($r)}function _assertThisInitialized$g($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$f(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$f($r){return _getPrototypeOf$f=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$f($r)}function _defineProperty$f($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var StandAloneLocalDayParser=function($r){_inherits$f(Mr,$r);var pr=_createSuper$f(Mr);function Mr(){var Nr;_classCallCheck$f(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$f(_assertThisInitialized$g(Nr),"priority",90),_defineProperty$f(_assertThisInitialized$g(Nr),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),Nr}return _createClass$g(Mr,[{key:"parse",value:function(Dr,Br,Lr,jr){var Ur=function(Yr){var Qr=Math.floor((Yr-1)/7)*7;return(Yr+jr.weekStartsOn+6)%7+Qr};switch(Br){case"c":case"cc":return mapValue(parseNDigits(Br.length,Dr),Ur);case"co":return mapValue(Lr.ordinalNumber(Dr,{unit:"day"}),Ur);case"ccc":return Lr.day(Dr,{width:"abbreviated",context:"standalone"})||Lr.day(Dr,{width:"short",context:"standalone"})||Lr.day(Dr,{width:"narrow",context:"standalone"});case"ccccc":return Lr.day(Dr,{width:"narrow",context:"standalone"});case"cccccc":return Lr.day(Dr,{width:"short",context:"standalone"})||Lr.day(Dr,{width:"narrow",context:"standalone"});case"cccc":default:return Lr.day(Dr,{width:"wide",context:"standalone"})||Lr.day(Dr,{width:"abbreviated",context:"standalone"})||Lr.day(Dr,{width:"short",context:"standalone"})||Lr.day(Dr,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(Dr,Br){return Br>=0&&Br<=6}},{key:"set",value:function(Dr,Br,Lr,jr){return Dr=setUTCDay(Dr,Lr,jr),Dr.setUTCHours(0,0,0,0),Dr}}]),Mr}(Parser);function setUTCISODay($r,pr){requiredArgs(2,arguments);var Mr=toInteger$2(pr);Mr%7===0&&(Mr=Mr-7);var Nr=1,Dr=toDate$1($r),Br=Dr.getUTCDay(),Lr=Mr%7,jr=(Lr+7)%7,Ur=(jr<Nr?7:0)+Mr-Br;return Dr.setUTCDate(Dr.getUTCDate()+Ur),Dr}function _typeof$f($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$f=function(Mr){return typeof Mr}:_typeof$f=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$f($r)}function _classCallCheck$e($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$f($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$f($r,pr,Mr){return pr&&_defineProperties$f($r.prototype,pr),Mr&&_defineProperties$f($r,Mr),$r}function _inherits$e($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$f($r,pr)}function _setPrototypeOf$f($r,pr){return _setPrototypeOf$f=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$f($r,pr)}function _createSuper$e($r){var pr=_isNativeReflectConstruct$e();return function(){var Nr=_getPrototypeOf$e($r),Dr;if(pr){var Br=_getPrototypeOf$e(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$e(this,Dr)}}function _possibleConstructorReturn$e($r,pr){return pr&&(_typeof$f(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$f($r)}function _assertThisInitialized$f($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$e($r){return _getPrototypeOf$e=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$e($r)}function _defineProperty$e($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var ISODayParser=function($r){_inherits$e(Mr,$r);var pr=_createSuper$e(Mr);function Mr(){var Nr;_classCallCheck$e(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$e(_assertThisInitialized$f(Nr),"priority",90),_defineProperty$e(_assertThisInitialized$f(Nr),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),Nr}return _createClass$f(Mr,[{key:"parse",value:function(Dr,Br,Lr){var jr=function(Gr){return Gr===0?7:Gr};switch(Br){case"i":case"ii":return parseNDigits(Br.length,Dr);case"io":return Lr.ordinalNumber(Dr,{unit:"day"});case"iii":return mapValue(Lr.day(Dr,{width:"abbreviated",context:"formatting"})||Lr.day(Dr,{width:"short",context:"formatting"})||Lr.day(Dr,{width:"narrow",context:"formatting"}),jr);case"iiiii":return mapValue(Lr.day(Dr,{width:"narrow",context:"formatting"}),jr);case"iiiiii":return mapValue(Lr.day(Dr,{width:"short",context:"formatting"})||Lr.day(Dr,{width:"narrow",context:"formatting"}),jr);case"iiii":default:return mapValue(Lr.day(Dr,{width:"wide",context:"formatting"})||Lr.day(Dr,{width:"abbreviated",context:"formatting"})||Lr.day(Dr,{width:"short",context:"formatting"})||Lr.day(Dr,{width:"narrow",context:"formatting"}),jr)}}},{key:"validate",value:function(Dr,Br){return Br>=1&&Br<=7}},{key:"set",value:function(Dr,Br,Lr){return Dr=setUTCISODay(Dr,Lr),Dr.setUTCHours(0,0,0,0),Dr}}]),Mr}(Parser);function _typeof$e($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$e=function(Mr){return typeof Mr}:_typeof$e=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$e($r)}function _classCallCheck$d($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$e($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$e($r,pr,Mr){return pr&&_defineProperties$e($r.prototype,pr),Mr&&_defineProperties$e($r,Mr),$r}function _inherits$d($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$e($r,pr)}function _setPrototypeOf$e($r,pr){return _setPrototypeOf$e=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$e($r,pr)}function _createSuper$d($r){var pr=_isNativeReflectConstruct$d();return function(){var Nr=_getPrototypeOf$d($r),Dr;if(pr){var Br=_getPrototypeOf$d(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$d(this,Dr)}}function _possibleConstructorReturn$d($r,pr){return pr&&(_typeof$e(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$e($r)}function _assertThisInitialized$e($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$d(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$d($r){return _getPrototypeOf$d=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$d($r)}function _defineProperty$d($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var AMPMParser=function($r){_inherits$d(Mr,$r);var pr=_createSuper$d(Mr);function Mr(){var Nr;_classCallCheck$d(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$d(_assertThisInitialized$e(Nr),"priority",80),_defineProperty$d(_assertThisInitialized$e(Nr),"incompatibleTokens",["b","B","H","k","t","T"]),Nr}return _createClass$e(Mr,[{key:"parse",value:function(Dr,Br,Lr){switch(Br){case"a":case"aa":case"aaa":return Lr.dayPeriod(Dr,{width:"abbreviated",context:"formatting"})||Lr.dayPeriod(Dr,{width:"narrow",context:"formatting"});case"aaaaa":return Lr.dayPeriod(Dr,{width:"narrow",context:"formatting"});case"aaaa":default:return Lr.dayPeriod(Dr,{width:"wide",context:"formatting"})||Lr.dayPeriod(Dr,{width:"abbreviated",context:"formatting"})||Lr.dayPeriod(Dr,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(Dr,Br,Lr){return Dr.setUTCHours(dayPeriodEnumToHours(Lr),0,0,0),Dr}}]),Mr}(Parser);function _typeof$d($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$d=function(Mr){return typeof Mr}:_typeof$d=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$d($r)}function _classCallCheck$c($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$d($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$d($r,pr,Mr){return pr&&_defineProperties$d($r.prototype,pr),Mr&&_defineProperties$d($r,Mr),$r}function _inherits$c($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$d($r,pr)}function _setPrototypeOf$d($r,pr){return _setPrototypeOf$d=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$d($r,pr)}function _createSuper$c($r){var pr=_isNativeReflectConstruct$c();return function(){var Nr=_getPrototypeOf$c($r),Dr;if(pr){var Br=_getPrototypeOf$c(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$c(this,Dr)}}function _possibleConstructorReturn$c($r,pr){return pr&&(_typeof$d(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$d($r)}function _assertThisInitialized$d($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$c(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$c($r){return _getPrototypeOf$c=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$c($r)}function _defineProperty$c($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var AMPMMidnightParser=function($r){_inherits$c(Mr,$r);var pr=_createSuper$c(Mr);function Mr(){var Nr;_classCallCheck$c(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$c(_assertThisInitialized$d(Nr),"priority",80),_defineProperty$c(_assertThisInitialized$d(Nr),"incompatibleTokens",["a","B","H","k","t","T"]),Nr}return _createClass$d(Mr,[{key:"parse",value:function(Dr,Br,Lr){switch(Br){case"b":case"bb":case"bbb":return Lr.dayPeriod(Dr,{width:"abbreviated",context:"formatting"})||Lr.dayPeriod(Dr,{width:"narrow",context:"formatting"});case"bbbbb":return Lr.dayPeriod(Dr,{width:"narrow",context:"formatting"});case"bbbb":default:return Lr.dayPeriod(Dr,{width:"wide",context:"formatting"})||Lr.dayPeriod(Dr,{width:"abbreviated",context:"formatting"})||Lr.dayPeriod(Dr,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(Dr,Br,Lr){return Dr.setUTCHours(dayPeriodEnumToHours(Lr),0,0,0),Dr}}]),Mr}(Parser);function _typeof$c($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$c=function(Mr){return typeof Mr}:_typeof$c=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$c($r)}function _classCallCheck$b($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$c($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$c($r,pr,Mr){return pr&&_defineProperties$c($r.prototype,pr),Mr&&_defineProperties$c($r,Mr),$r}function _inherits$b($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$c($r,pr)}function _setPrototypeOf$c($r,pr){return _setPrototypeOf$c=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$c($r,pr)}function _createSuper$b($r){var pr=_isNativeReflectConstruct$b();return function(){var Nr=_getPrototypeOf$b($r),Dr;if(pr){var Br=_getPrototypeOf$b(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$b(this,Dr)}}function _possibleConstructorReturn$b($r,pr){return pr&&(_typeof$c(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$c($r)}function _assertThisInitialized$c($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$b(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$b($r){return _getPrototypeOf$b=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$b($r)}function _defineProperty$b($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var DayPeriodParser=function($r){_inherits$b(Mr,$r);var pr=_createSuper$b(Mr);function Mr(){var Nr;_classCallCheck$b(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$b(_assertThisInitialized$c(Nr),"priority",80),_defineProperty$b(_assertThisInitialized$c(Nr),"incompatibleTokens",["a","b","t","T"]),Nr}return _createClass$c(Mr,[{key:"parse",value:function(Dr,Br,Lr){switch(Br){case"B":case"BB":case"BBB":return Lr.dayPeriod(Dr,{width:"abbreviated",context:"formatting"})||Lr.dayPeriod(Dr,{width:"narrow",context:"formatting"});case"BBBBB":return Lr.dayPeriod(Dr,{width:"narrow",context:"formatting"});case"BBBB":default:return Lr.dayPeriod(Dr,{width:"wide",context:"formatting"})||Lr.dayPeriod(Dr,{width:"abbreviated",context:"formatting"})||Lr.dayPeriod(Dr,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(Dr,Br,Lr){return Dr.setUTCHours(dayPeriodEnumToHours(Lr),0,0,0),Dr}}]),Mr}(Parser);function _typeof$b($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$b=function(Mr){return typeof Mr}:_typeof$b=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$b($r)}function _classCallCheck$a($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$b($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$b($r,pr,Mr){return pr&&_defineProperties$b($r.prototype,pr),Mr&&_defineProperties$b($r,Mr),$r}function _inherits$a($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$b($r,pr)}function _setPrototypeOf$b($r,pr){return _setPrototypeOf$b=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$b($r,pr)}function _createSuper$a($r){var pr=_isNativeReflectConstruct$a();return function(){var Nr=_getPrototypeOf$a($r),Dr;if(pr){var Br=_getPrototypeOf$a(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$a(this,Dr)}}function _possibleConstructorReturn$a($r,pr){return pr&&(_typeof$b(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$b($r)}function _assertThisInitialized$b($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$a(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$a($r){return _getPrototypeOf$a=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$a($r)}function _defineProperty$a($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var Hour1to12Parser=function($r){_inherits$a(Mr,$r);var pr=_createSuper$a(Mr);function Mr(){var Nr;_classCallCheck$a(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$a(_assertThisInitialized$b(Nr),"priority",70),_defineProperty$a(_assertThisInitialized$b(Nr),"incompatibleTokens",["H","K","k","t","T"]),Nr}return _createClass$b(Mr,[{key:"parse",value:function(Dr,Br,Lr){switch(Br){case"h":return parseNumericPattern(numericPatterns.hour12h,Dr);case"ho":return Lr.ordinalNumber(Dr,{unit:"hour"});default:return parseNDigits(Br.length,Dr)}}},{key:"validate",value:function(Dr,Br){return Br>=1&&Br<=12}},{key:"set",value:function(Dr,Br,Lr){var jr=Dr.getUTCHours()>=12;return jr&&Lr<12?Dr.setUTCHours(Lr+12,0,0,0):!jr&&Lr===12?Dr.setUTCHours(0,0,0,0):Dr.setUTCHours(Lr,0,0,0),Dr}}]),Mr}(Parser);function _typeof$a($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$a=function(Mr){return typeof Mr}:_typeof$a=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$a($r)}function _classCallCheck$9($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$a($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$a($r,pr,Mr){return pr&&_defineProperties$a($r.prototype,pr),Mr&&_defineProperties$a($r,Mr),$r}function _inherits$9($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$a($r,pr)}function _setPrototypeOf$a($r,pr){return _setPrototypeOf$a=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$a($r,pr)}function _createSuper$9($r){var pr=_isNativeReflectConstruct$9();return function(){var Nr=_getPrototypeOf$9($r),Dr;if(pr){var Br=_getPrototypeOf$9(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$9(this,Dr)}}function _possibleConstructorReturn$9($r,pr){return pr&&(_typeof$a(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$a($r)}function _assertThisInitialized$a($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$9(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$9($r){return _getPrototypeOf$9=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$9($r)}function _defineProperty$9($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var Hour0to23Parser=function($r){_inherits$9(Mr,$r);var pr=_createSuper$9(Mr);function Mr(){var Nr;_classCallCheck$9(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$9(_assertThisInitialized$a(Nr),"priority",70),_defineProperty$9(_assertThisInitialized$a(Nr),"incompatibleTokens",["a","b","h","K","k","t","T"]),Nr}return _createClass$a(Mr,[{key:"parse",value:function(Dr,Br,Lr){switch(Br){case"H":return parseNumericPattern(numericPatterns.hour23h,Dr);case"Ho":return Lr.ordinalNumber(Dr,{unit:"hour"});default:return parseNDigits(Br.length,Dr)}}},{key:"validate",value:function(Dr,Br){return Br>=0&&Br<=23}},{key:"set",value:function(Dr,Br,Lr){return Dr.setUTCHours(Lr,0,0,0),Dr}}]),Mr}(Parser);function _typeof$9($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$9=function(Mr){return typeof Mr}:_typeof$9=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$9($r)}function _classCallCheck$8($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$9($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$9($r,pr,Mr){return pr&&_defineProperties$9($r.prototype,pr),Mr&&_defineProperties$9($r,Mr),$r}function _inherits$8($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$9($r,pr)}function _setPrototypeOf$9($r,pr){return _setPrototypeOf$9=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$9($r,pr)}function _createSuper$8($r){var pr=_isNativeReflectConstruct$8();return function(){var Nr=_getPrototypeOf$8($r),Dr;if(pr){var Br=_getPrototypeOf$8(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$8(this,Dr)}}function _possibleConstructorReturn$8($r,pr){return pr&&(_typeof$9(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$9($r)}function _assertThisInitialized$9($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$8(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$8($r){return _getPrototypeOf$8=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$8($r)}function _defineProperty$8($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var Hour0To11Parser=function($r){_inherits$8(Mr,$r);var pr=_createSuper$8(Mr);function Mr(){var Nr;_classCallCheck$8(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$8(_assertThisInitialized$9(Nr),"priority",70),_defineProperty$8(_assertThisInitialized$9(Nr),"incompatibleTokens",["h","H","k","t","T"]),Nr}return _createClass$9(Mr,[{key:"parse",value:function(Dr,Br,Lr){switch(Br){case"K":return parseNumericPattern(numericPatterns.hour11h,Dr);case"Ko":return Lr.ordinalNumber(Dr,{unit:"hour"});default:return parseNDigits(Br.length,Dr)}}},{key:"validate",value:function(Dr,Br){return Br>=0&&Br<=11}},{key:"set",value:function(Dr,Br,Lr){var jr=Dr.getUTCHours()>=12;return jr&&Lr<12?Dr.setUTCHours(Lr+12,0,0,0):Dr.setUTCHours(Lr,0,0,0),Dr}}]),Mr}(Parser);function _typeof$8($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$8=function(Mr){return typeof Mr}:_typeof$8=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$8($r)}function _classCallCheck$7($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$8($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$8($r,pr,Mr){return pr&&_defineProperties$8($r.prototype,pr),Mr&&_defineProperties$8($r,Mr),$r}function _inherits$7($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$8($r,pr)}function _setPrototypeOf$8($r,pr){return _setPrototypeOf$8=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$8($r,pr)}function _createSuper$7($r){var pr=_isNativeReflectConstruct$7();return function(){var Nr=_getPrototypeOf$7($r),Dr;if(pr){var Br=_getPrototypeOf$7(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$7(this,Dr)}}function _possibleConstructorReturn$7($r,pr){return pr&&(_typeof$8(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$8($r)}function _assertThisInitialized$8($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$7(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$7($r){return _getPrototypeOf$7=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$7($r)}function _defineProperty$7($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var Hour1To24Parser=function($r){_inherits$7(Mr,$r);var pr=_createSuper$7(Mr);function Mr(){var Nr;_classCallCheck$7(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$7(_assertThisInitialized$8(Nr),"priority",70),_defineProperty$7(_assertThisInitialized$8(Nr),"incompatibleTokens",["a","b","h","H","K","t","T"]),Nr}return _createClass$8(Mr,[{key:"parse",value:function(Dr,Br,Lr){switch(Br){case"k":return parseNumericPattern(numericPatterns.hour24h,Dr);case"ko":return Lr.ordinalNumber(Dr,{unit:"hour"});default:return parseNDigits(Br.length,Dr)}}},{key:"validate",value:function(Dr,Br){return Br>=1&&Br<=24}},{key:"set",value:function(Dr,Br,Lr){var jr=Lr<=24?Lr%24:Lr;return Dr.setUTCHours(jr,0,0,0),Dr}}]),Mr}(Parser);function _typeof$7($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$7=function(Mr){return typeof Mr}:_typeof$7=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$7($r)}function _classCallCheck$6($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$7($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$7($r,pr,Mr){return pr&&_defineProperties$7($r.prototype,pr),Mr&&_defineProperties$7($r,Mr),$r}function _inherits$6($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$7($r,pr)}function _setPrototypeOf$7($r,pr){return _setPrototypeOf$7=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$7($r,pr)}function _createSuper$6($r){var pr=_isNativeReflectConstruct$6();return function(){var Nr=_getPrototypeOf$6($r),Dr;if(pr){var Br=_getPrototypeOf$6(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$6(this,Dr)}}function _possibleConstructorReturn$6($r,pr){return pr&&(_typeof$7(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$7($r)}function _assertThisInitialized$7($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$6(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$6($r){return _getPrototypeOf$6=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$6($r)}function _defineProperty$6($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var MinuteParser=function($r){_inherits$6(Mr,$r);var pr=_createSuper$6(Mr);function Mr(){var Nr;_classCallCheck$6(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$6(_assertThisInitialized$7(Nr),"priority",60),_defineProperty$6(_assertThisInitialized$7(Nr),"incompatibleTokens",["t","T"]),Nr}return _createClass$7(Mr,[{key:"parse",value:function(Dr,Br,Lr){switch(Br){case"m":return parseNumericPattern(numericPatterns.minute,Dr);case"mo":return Lr.ordinalNumber(Dr,{unit:"minute"});default:return parseNDigits(Br.length,Dr)}}},{key:"validate",value:function(Dr,Br){return Br>=0&&Br<=59}},{key:"set",value:function(Dr,Br,Lr){return Dr.setUTCMinutes(Lr,0,0),Dr}}]),Mr}(Parser);function _typeof$6($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$6=function(Mr){return typeof Mr}:_typeof$6=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$6($r)}function _classCallCheck$5($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$6($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$6($r,pr,Mr){return pr&&_defineProperties$6($r.prototype,pr),Mr&&_defineProperties$6($r,Mr),$r}function _inherits$5($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$6($r,pr)}function _setPrototypeOf$6($r,pr){return _setPrototypeOf$6=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$6($r,pr)}function _createSuper$5($r){var pr=_isNativeReflectConstruct$5();return function(){var Nr=_getPrototypeOf$5($r),Dr;if(pr){var Br=_getPrototypeOf$5(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$5(this,Dr)}}function _possibleConstructorReturn$5($r,pr){return pr&&(_typeof$6(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$6($r)}function _assertThisInitialized$6($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$5(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$5($r){return _getPrototypeOf$5=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$5($r)}function _defineProperty$5($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var SecondParser=function($r){_inherits$5(Mr,$r);var pr=_createSuper$5(Mr);function Mr(){var Nr;_classCallCheck$5(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$5(_assertThisInitialized$6(Nr),"priority",50),_defineProperty$5(_assertThisInitialized$6(Nr),"incompatibleTokens",["t","T"]),Nr}return _createClass$6(Mr,[{key:"parse",value:function(Dr,Br,Lr){switch(Br){case"s":return parseNumericPattern(numericPatterns.second,Dr);case"so":return Lr.ordinalNumber(Dr,{unit:"second"});default:return parseNDigits(Br.length,Dr)}}},{key:"validate",value:function(Dr,Br){return Br>=0&&Br<=59}},{key:"set",value:function(Dr,Br,Lr){return Dr.setUTCSeconds(Lr,0),Dr}}]),Mr}(Parser);function _typeof$5($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$5=function(Mr){return typeof Mr}:_typeof$5=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$5($r)}function _classCallCheck$4($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$5($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$5($r,pr,Mr){return pr&&_defineProperties$5($r.prototype,pr),Mr&&_defineProperties$5($r,Mr),$r}function _inherits$4($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$5($r,pr)}function _setPrototypeOf$5($r,pr){return _setPrototypeOf$5=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$5($r,pr)}function _createSuper$4($r){var pr=_isNativeReflectConstruct$4();return function(){var Nr=_getPrototypeOf$4($r),Dr;if(pr){var Br=_getPrototypeOf$4(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$4(this,Dr)}}function _possibleConstructorReturn$4($r,pr){return pr&&(_typeof$5(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$5($r)}function _assertThisInitialized$5($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$4(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$4($r){return _getPrototypeOf$4=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$4($r)}function _defineProperty$4($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var FractionOfSecondParser=function($r){_inherits$4(Mr,$r);var pr=_createSuper$4(Mr);function Mr(){var Nr;_classCallCheck$4(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$4(_assertThisInitialized$5(Nr),"priority",30),_defineProperty$4(_assertThisInitialized$5(Nr),"incompatibleTokens",["t","T"]),Nr}return _createClass$5(Mr,[{key:"parse",value:function(Dr,Br){var Lr=function(Ur){return Math.floor(Ur*Math.pow(10,-Br.length+3))};return mapValue(parseNDigits(Br.length,Dr),Lr)}},{key:"set",value:function(Dr,Br,Lr){return Dr.setUTCMilliseconds(Lr),Dr}}]),Mr}(Parser);function _typeof$4($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$4=function(Mr){return typeof Mr}:_typeof$4=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$4($r)}function _classCallCheck$3($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$4($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$4($r,pr,Mr){return pr&&_defineProperties$4($r.prototype,pr),Mr&&_defineProperties$4($r,Mr),$r}function _inherits$3($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$4($r,pr)}function _setPrototypeOf$4($r,pr){return _setPrototypeOf$4=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$4($r,pr)}function _createSuper$3($r){var pr=_isNativeReflectConstruct$3();return function(){var Nr=_getPrototypeOf$3($r),Dr;if(pr){var Br=_getPrototypeOf$3(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$3(this,Dr)}}function _possibleConstructorReturn$3($r,pr){return pr&&(_typeof$4(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$4($r)}function _assertThisInitialized$4($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$3(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$3($r){return _getPrototypeOf$3=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$3($r)}function _defineProperty$3($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var ISOTimezoneWithZParser=function($r){_inherits$3(Mr,$r);var pr=_createSuper$3(Mr);function Mr(){var Nr;_classCallCheck$3(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$3(_assertThisInitialized$4(Nr),"priority",10),_defineProperty$3(_assertThisInitialized$4(Nr),"incompatibleTokens",["t","T","x"]),Nr}return _createClass$4(Mr,[{key:"parse",value:function(Dr,Br){switch(Br){case"X":return parseTimezonePattern(timezonePatterns.basicOptionalMinutes,Dr);case"XX":return parseTimezonePattern(timezonePatterns.basic,Dr);case"XXXX":return parseTimezonePattern(timezonePatterns.basicOptionalSeconds,Dr);case"XXXXX":return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds,Dr);case"XXX":default:return parseTimezonePattern(timezonePatterns.extended,Dr)}}},{key:"set",value:function(Dr,Br,Lr){return Br.timestampIsSet?Dr:new Date(Dr.getTime()-Lr)}}]),Mr}(Parser);function _typeof$3($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$3=function(Mr){return typeof Mr}:_typeof$3=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$3($r)}function _classCallCheck$2($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$3($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$3($r,pr,Mr){return pr&&_defineProperties$3($r.prototype,pr),Mr&&_defineProperties$3($r,Mr),$r}function _inherits$2($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$3($r,pr)}function _setPrototypeOf$3($r,pr){return _setPrototypeOf$3=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$3($r,pr)}function _createSuper$2($r){var pr=_isNativeReflectConstruct$2();return function(){var Nr=_getPrototypeOf$2($r),Dr;if(pr){var Br=_getPrototypeOf$2(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$2(this,Dr)}}function _possibleConstructorReturn$2($r,pr){return pr&&(_typeof$3(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$3($r)}function _assertThisInitialized$3($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$2(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$2($r){return _getPrototypeOf$2=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$2($r)}function _defineProperty$2($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var ISOTimezoneParser=function($r){_inherits$2(Mr,$r);var pr=_createSuper$2(Mr);function Mr(){var Nr;_classCallCheck$2(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$2(_assertThisInitialized$3(Nr),"priority",10),_defineProperty$2(_assertThisInitialized$3(Nr),"incompatibleTokens",["t","T","X"]),Nr}return _createClass$3(Mr,[{key:"parse",value:function(Dr,Br){switch(Br){case"x":return parseTimezonePattern(timezonePatterns.basicOptionalMinutes,Dr);case"xx":return parseTimezonePattern(timezonePatterns.basic,Dr);case"xxxx":return parseTimezonePattern(timezonePatterns.basicOptionalSeconds,Dr);case"xxxxx":return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds,Dr);case"xxx":default:return parseTimezonePattern(timezonePatterns.extended,Dr)}}},{key:"set",value:function(Dr,Br,Lr){return Br.timestampIsSet?Dr:new Date(Dr.getTime()-Lr)}}]),Mr}(Parser);function _typeof$2($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$2=function(Mr){return typeof Mr}:_typeof$2=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$2($r)}function _classCallCheck$1($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$2($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$2($r,pr,Mr){return pr&&_defineProperties$2($r.prototype,pr),Mr&&_defineProperties$2($r,Mr),$r}function _inherits$1($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$2($r,pr)}function _setPrototypeOf$2($r,pr){return _setPrototypeOf$2=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$2($r,pr)}function _createSuper$1($r){var pr=_isNativeReflectConstruct$1();return function(){var Nr=_getPrototypeOf$1($r),Dr;if(pr){var Br=_getPrototypeOf$1(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn$1(this,Dr)}}function _possibleConstructorReturn$1($r,pr){return pr&&(_typeof$2(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$2($r)}function _assertThisInitialized$2($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct$1(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$1($r){return _getPrototypeOf$1=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf$1($r)}function _defineProperty$1($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var TimestampSecondsParser=function($r){_inherits$1(Mr,$r);var pr=_createSuper$1(Mr);function Mr(){var Nr;_classCallCheck$1(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty$1(_assertThisInitialized$2(Nr),"priority",40),_defineProperty$1(_assertThisInitialized$2(Nr),"incompatibleTokens","*"),Nr}return _createClass$2(Mr,[{key:"parse",value:function(Dr){return parseAnyDigitsSigned(Dr)}},{key:"set",value:function(Dr,Br,Lr){return[new Date(Lr*1e3),{timestampIsSet:!0}]}}]),Mr}(Parser);function _typeof$1($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$1=function(Mr){return typeof Mr}:_typeof$1=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof$1($r)}function _classCallCheck($r,pr){if(!($r instanceof pr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$1($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass$1($r,pr,Mr){return pr&&_defineProperties$1($r.prototype,pr),Mr&&_defineProperties$1($r,Mr),$r}function _inherits($r,pr){if(typeof pr!="function"&&pr!==null)throw new TypeError("Super expression must either be null or a function");$r.prototype=Object.create(pr&&pr.prototype,{constructor:{value:$r,writable:!0,configurable:!0}}),pr&&_setPrototypeOf$1($r,pr)}function _setPrototypeOf$1($r,pr){return _setPrototypeOf$1=Object.setPrototypeOf||function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf$1($r,pr)}function _createSuper($r){var pr=_isNativeReflectConstruct();return function(){var Nr=_getPrototypeOf($r),Dr;if(pr){var Br=_getPrototypeOf(this).constructor;Dr=Reflect.construct(Nr,arguments,Br)}else Dr=Nr.apply(this,arguments);return _possibleConstructorReturn(this,Dr)}}function _possibleConstructorReturn($r,pr){return pr&&(_typeof$1(pr)==="object"||typeof pr=="function")?pr:_assertThisInitialized$1($r)}function _assertThisInitialized$1($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function _isNativeReflectConstruct(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf($r){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(Mr){return Mr.__proto__||Object.getPrototypeOf(Mr)},_getPrototypeOf($r)}function _defineProperty($r,pr,Mr){return pr in $r?Object.defineProperty($r,pr,{value:Mr,enumerable:!0,configurable:!0,writable:!0}):$r[pr]=Mr,$r}var TimestampMillisecondsParser=function($r){_inherits(Mr,$r);var pr=_createSuper(Mr);function Mr(){var Nr;_classCallCheck(this,Mr);for(var Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=pr.call.apply(pr,[this].concat(Br)),_defineProperty(_assertThisInitialized$1(Nr),"priority",20),_defineProperty(_assertThisInitialized$1(Nr),"incompatibleTokens","*"),Nr}return _createClass$1(Mr,[{key:"parse",value:function(Dr){return parseAnyDigitsSigned(Dr)}},{key:"set",value:function(Dr,Br,Lr){return[new Date(Lr),{timestampIsSet:!0}]}}]),Mr}(Parser),parsers={G:new EraParser,y:new YearParser,Y:new LocalWeekYearParser,R:new ISOWeekYearParser,u:new ExtendedYearParser,Q:new QuarterParser,q:new StandAloneQuarterParser,M:new MonthParser,L:new StandAloneMonthParser,w:new LocalWeekParser,I:new ISOWeekParser,d:new DateParser,D:new DayOfYearParser,E:new DayParser,e:new LocalDayParser,c:new StandAloneLocalDayParser,i:new ISODayParser,a:new AMPMParser,b:new AMPMMidnightParser,B:new DayPeriodParser,h:new Hour1to12Parser,H:new Hour0to23Parser,K:new Hour0To11Parser,k:new Hour1To24Parser,m:new MinuteParser,s:new SecondParser,S:new FractionOfSecondParser,X:new ISOTimezoneWithZParser,x:new ISOTimezoneParser,t:new TimestampSecondsParser,T:new TimestampMillisecondsParser};function _typeof($r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof=function(Mr){return typeof Mr}:_typeof=function(Mr){return Mr&&typeof Symbol=="function"&&Mr.constructor===Symbol&&Mr!==Symbol.prototype?"symbol":typeof Mr},_typeof($r)}function _createForOfIteratorHelper($r,pr){var Mr;if(typeof Symbol>"u"||$r[Symbol.iterator]==null){if(Array.isArray($r)||(Mr=_unsupportedIterableToArray($r))||pr&&$r&&typeof $r.length=="number"){Mr&&($r=Mr);var Nr=0,Dr=function(){};return{s:Dr,n:function(){return Nr>=$r.length?{done:!0}:{done:!1,value:$r[Nr++]}},e:function(Gr){throw Gr},f:Dr}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
189
189
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Br=!0,Lr=!1,jr;return{s:function(){Mr=$r[Symbol.iterator]()},n:function(){var Gr=Mr.next();return Br=Gr.done,Gr},e:function(Gr){Lr=!0,jr=Gr},f:function(){try{!Br&&Mr.return!=null&&Mr.return()}finally{if(Lr)throw jr}}}}function _unsupportedIterableToArray($r,pr){if($r){if(typeof $r=="string")return _arrayLikeToArray($r,pr);var Mr=Object.prototype.toString.call($r).slice(8,-1);if(Mr==="Object"&&$r.constructor&&(Mr=$r.constructor.name),Mr==="Map"||Mr==="Set")return Array.from($r);if(Mr==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Mr))return _arrayLikeToArray($r,pr)}}function _arrayLikeToArray($r,pr){(pr==null||pr>$r.length)&&(pr=$r.length);for(var Mr=0,Nr=new Array(pr);Mr<pr;Mr++)Nr[Mr]=$r[Mr];return Nr}var formattingTokensRegExp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,longFormattingTokensRegExp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,escapedStringRegExp=/^'([^]*?)'?$/,doubleQuoteRegExp=/''/g,notWhitespaceRegExp=/\S/,unescapedLatinCharacterRegExp=/[a-zA-Z]/;function parse($r,pr,Mr,Nr){var Dr,Br,Lr,jr,Ur,Gr,Yr,Qr,Wn,ga,eo,_i,va,io,no,so,ao,fo;requiredArgs(3,arguments);var lo=String($r),oo=String(pr),po=getDefaultOptions(),mo=(Dr=(Br=Nr==null?void 0:Nr.locale)!==null&&Br!==void 0?Br:po.locale)!==null&&Dr!==void 0?Dr:defaultLocale;if(!mo.match)throw new RangeError("locale must contain match property");var $o=toInteger$2((Lr=(jr=(Ur=(Gr=Nr==null?void 0:Nr.firstWeekContainsDate)!==null&&Gr!==void 0?Gr:Nr==null||(Yr=Nr.locale)===null||Yr===void 0||(Qr=Yr.options)===null||Qr===void 0?void 0:Qr.firstWeekContainsDate)!==null&&Ur!==void 0?Ur:po.firstWeekContainsDate)!==null&&jr!==void 0?jr:(Wn=po.locale)===null||Wn===void 0||(ga=Wn.options)===null||ga===void 0?void 0:ga.firstWeekContainsDate)!==null&&Lr!==void 0?Lr:1);if(!($o>=1&&$o<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var Xn=toInteger$2((eo=(_i=(va=(io=Nr==null?void 0:Nr.weekStartsOn)!==null&&io!==void 0?io:Nr==null||(no=Nr.locale)===null||no===void 0||(so=no.options)===null||so===void 0?void 0:so.weekStartsOn)!==null&&va!==void 0?va:po.weekStartsOn)!==null&&_i!==void 0?_i:(ao=po.locale)===null||ao===void 0||(fo=ao.options)===null||fo===void 0?void 0:fo.weekStartsOn)!==null&&eo!==void 0?eo:0);if(!(Xn>=0&&Xn<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(oo==="")return lo===""?toDate$1(Mr):new Date(NaN);var Fr={firstWeekContainsDate:$o,weekStartsOn:Xn,locale:mo},Vr=[new DateToSystemTimezoneSetter],Wr=oo.match(longFormattingTokensRegExp).map(function(Io){var Po=Io[0];if(Po in longFormatters$1){var yo=longFormatters$1[Po];return yo(Io,mo.formatLong)}return Io}).join("").match(formattingTokensRegExp),Jr=[],Gn=_createForOfIteratorHelper(Wr),to;try{var ro=function(){var Po=to.value;!(Nr!=null&&Nr.useAdditionalWeekYearTokens)&&isProtectedWeekYearToken(Po)&&throwProtectedError(Po,oo,$r),!(Nr!=null&&Nr.useAdditionalDayOfYearTokens)&&isProtectedDayOfYearToken(Po)&&throwProtectedError(Po,oo,$r);var yo=Po[0],xo=parsers[yo];if(xo){var Mo=xo.incompatibleTokens;if(Array.isArray(Mo)){var qo=Jr.find(function(nu){return Mo.includes(nu.token)||nu.token===yo});if(qo)throw new RangeError("The format string mustn't contain `".concat(qo.fullToken,"` and `").concat(Po,"` at the same time"))}else if(xo.incompatibleTokens==="*"&&Jr.length>0)throw new RangeError("The format string mustn't contain `".concat(Po,"` and any other token at the same time"));Jr.push({token:yo,fullToken:Po});var pu=xo.run(lo,Po,mo.match,Fr);if(!pu)return{v:new Date(NaN)};Vr.push(pu.setter),lo=pu.rest}else{if(yo.match(unescapedLatinCharacterRegExp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+yo+"`");if(Po==="''"?Po="'":yo==="'"&&(Po=cleanEscapedString(Po)),lo.indexOf(Po)===0)lo=lo.slice(Po.length);else return{v:new Date(NaN)}}};for(Gn.s();!(to=Gn.n()).done;){var Un=ro();if(_typeof(Un)==="object")return Un.v}}catch(Io){Gn.e(Io)}finally{Gn.f()}if(lo.length>0&¬WhitespaceRegExp.test(lo))return new Date(NaN);var Hr=Vr.map(function(Io){return Io.priority}).sort(function(Io,Po){return Po-Io}).filter(function(Io,Po,yo){return yo.indexOf(Io)===Po}).map(function(Io){return Vr.filter(function(Po){return Po.priority===Io}).sort(function(Po,yo){return yo.subPriority-Po.subPriority})}).map(function(Io){return Io[0]}),Xr=toDate$1(Mr);if(isNaN(Xr.getTime()))return new Date(NaN);var co=subMilliseconds(Xr,getTimezoneOffsetInMilliseconds(Xr)),ho={},go=_createForOfIteratorHelper(Hr),bo;try{for(go.s();!(bo=go.n()).done;){var Eo=bo.value;if(!Eo.validate(co,Fr))return new Date(NaN);var wo=Eo.set(co,ho,Fr);Array.isArray(wo)?(co=wo[0],assign(ho,wo[1])):co=wo}}catch(Io){go.e(Io)}finally{go.f()}return co}function cleanEscapedString($r){return $r.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp,"'")}function startOfDay$1($r){requiredArgs(1,arguments);var pr=toDate$1($r);return pr.setHours(0,0,0,0),pr}var propTypesExports=requirePropTypes();const PropTypes=getDefaultExportFromCjs$1(propTypesExports);function _extends$2(){return _extends$2=Object.assign||function($r){for(var pr=1;pr<arguments.length;pr++){var Mr=arguments[pr];for(var Nr in Mr)Object.prototype.hasOwnProperty.call(Mr,Nr)&&($r[Nr]=Mr[Nr])}return $r},_extends$2.apply(this,arguments)}function _objectWithoutPropertiesLoose$1($r,pr){if($r==null)return{};var Mr={},Nr=Object.keys($r),Dr,Br;for(Br=0;Br<Nr.length;Br++)Dr=Nr[Br],!(pr.indexOf(Dr)>=0)&&(Mr[Dr]=$r[Dr]);return Mr}function toInteger$1($r){if($r===null||$r===!0||$r===!1)return NaN;var pr=Number($r);return isNaN(pr)?pr:pr<0?Math.ceil(pr):Math.floor(pr)}function toDate($r){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var pr=Object.prototype.toString.call($r);return $r instanceof Date||typeof $r=="object"&&pr==="[object Date]"?new Date($r.getTime()):typeof $r=="number"||pr==="[object Number]"?new Date($r):((typeof $r=="string"||pr==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn(new Error().stack)),new Date(NaN))}function addDays($r,pr){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var Mr=toDate($r),Nr=toInteger$1(pr);return Mr.setDate(Mr.getDate()+Nr),Mr}function isBefore($r,pr){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var Mr=toDate($r),Nr=toDate(pr);return Mr.getTime()<Nr.getTime()}function startOfDay($r){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var pr=toDate($r);return pr.setHours(0,0,0,0),pr}function isSameDay$1($r,pr){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var Mr=startOfDay($r),Nr=startOfDay(pr);return Mr.getTime()===Nr.getTime()}function isToday($r){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return isSameDay$1($r,Date.now())}function differenceInCalendarMonths($r,pr){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var Mr=toDate($r),Nr=toDate(pr),Dr=Mr.getFullYear()-Nr.getFullYear(),Br=Mr.getMonth()-Nr.getMonth();return Dr*12+Br}function composeEventHandlers$1(){for(var $r=arguments.length,pr=new Array($r),Mr=0;Mr<$r;Mr++)pr[Mr]=arguments[Mr];return function(Nr){for(var Dr=arguments.length,Br=new Array(Dr>1?Dr-1:0),Lr=1;Lr<Dr;Lr++)Br[Lr-1]=arguments[Lr];return pr.some(function(jr){return jr&&jr.apply(void 0,[Nr].concat(Br)),Nr.defaultPrevented})}}function requiredProp($r,pr){throw new Error('The property "'+pr+'" is required in "'+$r+'"')}function unwrapChildrenForPreact($r){return $r=Array.isArray($r)?$r[0]:$r,$r||noop$1}function noop$1(){}function subtractMonth($r){var pr=$r.calendars,Mr=$r.offset,Nr=$r.minDate;if(Mr>1&&Nr){var Dr=pr[0].firstDayOfMonth,Br=differenceInCalendarMonths(Dr,Nr);Br<Mr&&(Mr=Br)}return Mr}function addMonth($r){var pr=$r.calendars,Mr=$r.offset,Nr=$r.maxDate;if(Mr>1&&Nr){var Dr=pr[pr.length-1].lastDayOfMonth,Br=differenceInCalendarMonths(Nr,Dr);Br<Mr&&(Mr=Br)}return Mr}function isBackDisabled($r){var pr=$r.calendars,Mr=$r.minDate;if(!Mr)return!1;var Nr=pr[0].firstDayOfMonth,Dr=addDays(Nr,-1);return!!isBefore(Dr,Mr)}function isForwardDisabled($r){var pr=$r.calendars,Mr=$r.maxDate;if(!Mr)return!1;var Nr=pr[pr.length-1].lastDayOfMonth,Dr=addDays(Nr,1);return!!isBefore(Mr,Dr)}function getCalendars($r){for(var pr=$r.date,Mr=$r.selected,Nr=$r.monthsToDisplay,Dr=$r.offset,Br=$r.minDate,Lr=$r.maxDate,jr=$r.firstDayOfWeek,Ur=$r.showOutsideDays,Gr=[],Yr=getStartDate(pr,Br,Lr),Qr=0;Qr<Nr;Qr++){var Wn=getMonths({month:Yr.getMonth()+Qr+Dr,year:Yr.getFullYear(),selectedDates:Mr,minDate:Br,maxDate:Lr,firstDayOfWeek:jr,showOutsideDays:Ur});Gr.push(Wn)}return Gr}function getStartDate($r,pr,Mr){var Nr=startOfDay($r);if(pr){var Dr=startOfDay(pr);isBefore(Nr,Dr)&&(Nr=Dr)}if(Mr){var Br=startOfDay(Mr);isBefore(Br,Nr)&&(Nr=Br)}return Nr}function getMonths($r){var pr=$r.month,Mr=$r.year,Nr=$r.selectedDates,Dr=$r.minDate,Br=$r.maxDate,Lr=$r.firstDayOfWeek,jr=$r.showOutsideDays,Ur=getNumDaysMonthYear(pr,Mr),Gr=Ur.daysInMonth;pr=Ur.month,Mr=Ur.year;for(var Yr=[],Qr=1;Qr<=Gr;Qr++){var Wn=new Date(Mr,pr,Qr),ga={date:Wn,selected:isSelected(Nr,Wn),selectable:isSelectable$1(Dr,Br,Wn),today:isToday(Wn),prevMonth:!1,nextMonth:!1};Yr.push(ga)}var eo=new Date(Mr,pr,1),_i=new Date(Mr,pr,Gr),va=fillFrontWeek({firstDayOfMonth:eo,minDate:Dr,maxDate:Br,selectedDates:Nr,firstDayOfWeek:Lr,showOutsideDays:jr}),io=fillBackWeek({lastDayOfMonth:_i,minDate:Dr,maxDate:Br,selectedDates:Nr,firstDayOfWeek:Lr,showOutsideDays:jr});Yr.unshift.apply(Yr,va),Yr.push.apply(Yr,io);var no=getWeeks(Yr);return{firstDayOfMonth:eo,lastDayOfMonth:_i,month:pr,year:Mr,weeks:no}}function fillFrontWeek($r){var pr=$r.firstDayOfMonth,Mr=$r.minDate,Nr=$r.maxDate,Dr=$r.selectedDates,Br=$r.firstDayOfWeek,Lr=$r.showOutsideDays,jr=[],Ur=(pr.getDay()+7-Br)%7;if(Lr)for(var Gr=addDays(pr,-1),Yr=Gr.getDate(),Qr=Gr.getMonth(),Wn=Gr.getFullYear(),ga=0;ga<Ur;){var eo=new Date(Wn,Qr,Yr-ga),_i={date:eo,selected:isSelected(Dr,eo),selectable:isSelectable$1(Mr,Nr,eo),today:!1,prevMonth:!0,nextMonth:!1};jr.unshift(_i),ga++}else for(;Ur>0;)jr.unshift(""),Ur--;return jr}function fillBackWeek($r){var pr=$r.lastDayOfMonth,Mr=$r.minDate,Nr=$r.maxDate,Dr=$r.selectedDates,Br=$r.firstDayOfWeek,Lr=$r.showOutsideDays,jr=[],Ur=(pr.getDay()+7-Br)%7;if(Lr)for(var Gr=addDays(pr,1),Yr=Gr.getMonth(),Qr=Gr.getFullYear(),Wn=0;Wn<6-Ur;){var ga=new Date(Qr,Yr,1+Wn),eo={date:ga,selected:isSelected(Dr,ga),selectable:isSelectable$1(Mr,Nr,ga),today:!1,prevMonth:!1,nextMonth:!0};jr.push(eo),Wn++}else for(;Ur<6;)jr.push(""),Ur++;return jr}function getNumDaysMonthYear($r,pr){var Mr=new Date(pr,$r,1);$r=Mr.getMonth(),pr=Mr.getFullYear();var Nr=32-new Date(pr,$r,32).getDate();return{daysInMonth:Nr,month:$r,year:pr}}function getWeeks($r){for(var pr=Math.ceil($r.length/7),Mr=[],Nr=0;Nr<pr;Nr++){Mr[Nr]=[];for(var Dr=0;Dr<7;Dr++)Mr[Nr].push($r[Nr*7+Dr])}return Mr}function isSelected($r,pr){return $r=Array.isArray($r)?$r:[$r],$r.some(function(Mr){return Mr instanceof Date&&startOfDay(Mr).getTime()===startOfDay(pr).getTime()})}function isSelectable$1($r,pr,Mr){return!($r&&isBefore(Mr,$r)||pr&&isBefore(pr,Mr))}function isOffsetControlled($r){return $r!==void 0}function getOffset($r,pr){return isOffsetControlled($r)?$r:pr}function getDateProps($r,pr){var Mr=pr===void 0?{}:pr,Nr=Mr.onClick,Dr=Mr.dateObj,Br=Dr===void 0?requiredProp("getDateProps","dateObj"):Dr,Lr=_objectWithoutPropertiesLoose$1(Mr,["onClick","dateObj"]);return _extends$2({onClick:composeEventHandlers$1(Nr,function(jr){$r(Br,jr)}),disabled:!Br.selectable,"aria-label":Br.date.toDateString(),"aria-pressed":Br.selected,role:"button"},Lr)}function getBackProps($r,pr){var Mr=$r.minDate,Nr=$r.offsetMonth,Dr=$r.handleOffsetChanged,Br=pr===void 0?{}:pr,Lr=Br.onClick,jr=Br.offset,Ur=jr===void 0?1:jr,Gr=Br.calendars,Yr=Gr===void 0?requiredProp("getBackProps","calendars"):Gr,Qr=_objectWithoutPropertiesLoose$1(Br,["onClick","offset","calendars"]);return _extends$2({onClick:composeEventHandlers$1(Lr,function(){Dr(Nr-subtractMonth({calendars:Yr,offset:Ur,minDate:Mr}))}),disabled:isBackDisabled({calendars:Yr,offset:Ur,minDate:Mr}),"aria-label":"Go back "+Ur+" month"+(Ur===1?"":"s")},Qr)}function getForwardProps($r,pr){var Mr=$r.maxDate,Nr=$r.offsetMonth,Dr=$r.handleOffsetChanged,Br=pr===void 0?{}:pr,Lr=Br.onClick,jr=Br.offset,Ur=jr===void 0?1:jr,Gr=Br.calendars,Yr=Gr===void 0?requiredProp("getForwardProps","calendars"):Gr,Qr=_objectWithoutPropertiesLoose$1(Br,["onClick","offset","calendars"]);return _extends$2({onClick:composeEventHandlers$1(Lr,function(){Dr(Nr+addMonth({calendars:Yr,offset:Ur,maxDate:Mr}))}),disabled:isForwardDisabled({calendars:Yr,offset:Ur,maxDate:Mr}),"aria-label":"Go forward "+Ur+" month"+(Ur===1?"":"s")},Qr)}function useDayzed($r){var pr=$r.date,Mr=pr===void 0?new Date:pr,Nr=$r.maxDate,Dr=$r.minDate,Br=$r.monthsToDisplay,Lr=Br===void 0?1:Br,jr=$r.firstDayOfWeek,Ur=jr===void 0?0:jr,Gr=$r.showOutsideDays,Yr=Gr===void 0?!1:Gr,Qr=$r.offset,Wn=$r.onDateSelected,ga=$r.onOffsetChanged,eo=ga===void 0?function(){}:ga,_i=$r.selected,va=reactExports.useState(0),io=va[0],no=va[1],so=getOffset(Qr,io);function ao(lo){isOffsetControlled(Qr)||no(lo),eo(lo)}var fo=getCalendars({date:Mr,selected:_i,monthsToDisplay:Lr,minDate:Dr,maxDate:Nr,offset:so,firstDayOfWeek:Ur,showOutsideDays:Yr});return{calendars:fo,getDateProps:getDateProps.bind(null,Wn),getBackProps:getBackProps.bind(null,{minDate:Dr,offsetMonth:so,handleOffsetChanged:ao}),getForwardProps:getForwardProps.bind(null,{maxDate:Nr,offsetMonth:so,handleOffsetChanged:ao})}}function Dayzed($r){var pr=useDayzed($r),Mr=unwrapChildrenForPreact($r.render||$r.children);return Mr(pr)}Dayzed.defaultProps={date:new Date,monthsToDisplay:1,onOffsetChanged:function(){},firstDayOfWeek:0,showOutsideDays:!1};Dayzed.propTypes={render:PropTypes.func,children:PropTypes.func,date:PropTypes.instanceOf(Date),maxDate:PropTypes.instanceOf(Date),minDate:PropTypes.instanceOf(Date),monthsToDisplay:PropTypes.number,firstDayOfWeek:PropTypes.number,showOutsideDays:PropTypes.bool,offset:PropTypes.number,onDateSelected:PropTypes.func.isRequired,onOffsetChanged:PropTypes.func,selected:PropTypes.oneOfType([PropTypes.arrayOf(Date),PropTypes.instanceOf(Date)])};function compareAsc($r,pr){requiredArgs(2,arguments);var Mr=toDate$1($r),Nr=toDate$1(pr),Dr=Mr.getTime()-Nr.getTime();return Dr<0?-1:Dr>0?1:Dr}function isSameDay($r,pr){requiredArgs(2,arguments);var Mr=startOfDay$1($r),Nr=startOfDay$1(pr);return Mr.getTime()===Nr.getTime()}function _extends$1(){return _extends$1=Object.assign?Object.assign.bind():function($r){for(var pr=1;pr<arguments.length;pr++){var Mr=arguments[pr];for(var Nr in Mr)Object.prototype.hasOwnProperty.call(Mr,Nr)&&($r[Nr]=Mr[Nr])}return $r},_extends$1.apply(this,arguments)}var isArray=Array.isArray;const isArray$1=isArray;var freeGlobal=typeof global$1=="object"&&global$1&&global$1.Object===Object&&global$1;const freeGlobal$1=freeGlobal;var freeSelf=typeof self=="object"&&self&&self.Object===Object&&self,root=freeGlobal$1||freeSelf||Function("return this")();const root$1=root;var Symbol$1=root$1.Symbol;const Symbol$2=Symbol$1;var objectProto$e=Object.prototype,hasOwnProperty$b=objectProto$e.hasOwnProperty,nativeObjectToString$1=objectProto$e.toString,symToStringTag$1=Symbol$2?Symbol$2.toStringTag:void 0;function getRawTag($r){var pr=hasOwnProperty$b.call($r,symToStringTag$1),Mr=$r[symToStringTag$1];try{$r[symToStringTag$1]=void 0;var Nr=!0}catch{}var Dr=nativeObjectToString$1.call($r);return Nr&&(pr?$r[symToStringTag$1]=Mr:delete $r[symToStringTag$1]),Dr}var objectProto$d=Object.prototype,nativeObjectToString=objectProto$d.toString;function objectToString($r){return nativeObjectToString.call($r)}var nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=Symbol$2?Symbol$2.toStringTag:void 0;function baseGetTag($r){return $r==null?$r===void 0?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object($r)?getRawTag($r):objectToString($r)}function isObjectLike($r){return $r!=null&&typeof $r=="object"}var symbolTag$1="[object Symbol]";function isSymbol($r){return typeof $r=="symbol"||isObjectLike($r)&&baseGetTag($r)==symbolTag$1}var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey($r,pr){if(isArray$1($r))return!1;var Mr=typeof $r;return Mr=="number"||Mr=="symbol"||Mr=="boolean"||$r==null||isSymbol($r)?!0:reIsPlainProp.test($r)||!reIsDeepProp.test($r)||pr!=null&&$r in Object(pr)}function isObject($r){var pr=typeof $r;return $r!=null&&(pr=="object"||pr=="function")}var asyncTag="[object AsyncFunction]",funcTag$1="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction($r){if(!isObject($r))return!1;var pr=baseGetTag($r);return pr==funcTag$1||pr==genTag||pr==asyncTag||pr==proxyTag}var coreJsData=root$1["__core-js_shared__"];const coreJsData$1=coreJsData;var maskSrcKey=function(){var $r=/[^.]+$/.exec(coreJsData$1&&coreJsData$1.keys&&coreJsData$1.keys.IE_PROTO||"");return $r?"Symbol(src)_1."+$r:""}();function isMasked($r){return!!maskSrcKey&&maskSrcKey in $r}var funcProto$2=Function.prototype,funcToString$2=funcProto$2.toString;function toSource($r){if($r!=null){try{return funcToString$2.call($r)}catch{}try{return $r+""}catch{}}return""}var reRegExpChar$1=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto$1=Function.prototype,objectProto$c=Object.prototype,funcToString$1=funcProto$1.toString,hasOwnProperty$a=objectProto$c.hasOwnProperty,reIsNative=RegExp("^"+funcToString$1.call(hasOwnProperty$a).replace(reRegExpChar$1,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative($r){if(!isObject($r)||isMasked($r))return!1;var pr=isFunction($r)?reIsNative:reIsHostCtor;return pr.test(toSource($r))}function getValue($r,pr){return $r==null?void 0:$r[pr]}function getNative($r,pr){var Mr=getValue($r,pr);return baseIsNative(Mr)?Mr:void 0}var nativeCreate=getNative(Object,"create");const nativeCreate$1=nativeCreate;function hashClear(){this.__data__=nativeCreate$1?nativeCreate$1(null):{},this.size=0}function hashDelete($r){var pr=this.has($r)&&delete this.__data__[$r];return this.size-=pr?1:0,pr}var HASH_UNDEFINED$2="__lodash_hash_undefined__",objectProto$b=Object.prototype,hasOwnProperty$9=objectProto$b.hasOwnProperty;function hashGet($r){var pr=this.__data__;if(nativeCreate$1){var Mr=pr[$r];return Mr===HASH_UNDEFINED$2?void 0:Mr}return hasOwnProperty$9.call(pr,$r)?pr[$r]:void 0}var objectProto$a=Object.prototype,hasOwnProperty$8=objectProto$a.hasOwnProperty;function hashHas($r){var pr=this.__data__;return nativeCreate$1?pr[$r]!==void 0:hasOwnProperty$8.call(pr,$r)}var HASH_UNDEFINED$1="__lodash_hash_undefined__";function hashSet($r,pr){var Mr=this.__data__;return this.size+=this.has($r)?0:1,Mr[$r]=nativeCreate$1&&pr===void 0?HASH_UNDEFINED$1:pr,this}function Hash($r){var pr=-1,Mr=$r==null?0:$r.length;for(this.clear();++pr<Mr;){var Nr=$r[pr];this.set(Nr[0],Nr[1])}}Hash.prototype.clear=hashClear;Hash.prototype.delete=hashDelete;Hash.prototype.get=hashGet;Hash.prototype.has=hashHas;Hash.prototype.set=hashSet;function listCacheClear(){this.__data__=[],this.size=0}function eq($r,pr){return $r===pr||$r!==$r&&pr!==pr}function assocIndexOf($r,pr){for(var Mr=$r.length;Mr--;)if(eq($r[Mr][0],pr))return Mr;return-1}var arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete($r){var pr=this.__data__,Mr=assocIndexOf(pr,$r);if(Mr<0)return!1;var Nr=pr.length-1;return Mr==Nr?pr.pop():splice.call(pr,Mr,1),--this.size,!0}function listCacheGet($r){var pr=this.__data__,Mr=assocIndexOf(pr,$r);return Mr<0?void 0:pr[Mr][1]}function listCacheHas($r){return assocIndexOf(this.__data__,$r)>-1}function listCacheSet($r,pr){var Mr=this.__data__,Nr=assocIndexOf(Mr,$r);return Nr<0?(++this.size,Mr.push([$r,pr])):Mr[Nr][1]=pr,this}function ListCache($r){var pr=-1,Mr=$r==null?0:$r.length;for(this.clear();++pr<Mr;){var Nr=$r[pr];this.set(Nr[0],Nr[1])}}ListCache.prototype.clear=listCacheClear;ListCache.prototype.delete=listCacheDelete;ListCache.prototype.get=listCacheGet;ListCache.prototype.has=listCacheHas;ListCache.prototype.set=listCacheSet;var Map$1=getNative(root$1,"Map");const Map$2=Map$1;function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map$2||ListCache),string:new Hash}}function isKeyable($r){var pr=typeof $r;return pr=="string"||pr=="number"||pr=="symbol"||pr=="boolean"?$r!=="__proto__":$r===null}function getMapData($r,pr){var Mr=$r.__data__;return isKeyable(pr)?Mr[typeof pr=="string"?"string":"hash"]:Mr.map}function mapCacheDelete($r){var pr=getMapData(this,$r).delete($r);return this.size-=pr?1:0,pr}function mapCacheGet($r){return getMapData(this,$r).get($r)}function mapCacheHas($r){return getMapData(this,$r).has($r)}function mapCacheSet($r,pr){var Mr=getMapData(this,$r),Nr=Mr.size;return Mr.set($r,pr),this.size+=Mr.size==Nr?0:1,this}function MapCache($r){var pr=-1,Mr=$r==null?0:$r.length;for(this.clear();++pr<Mr;){var Nr=$r[pr];this.set(Nr[0],Nr[1])}}MapCache.prototype.clear=mapCacheClear;MapCache.prototype.delete=mapCacheDelete;MapCache.prototype.get=mapCacheGet;MapCache.prototype.has=mapCacheHas;MapCache.prototype.set=mapCacheSet;var FUNC_ERROR_TEXT="Expected a function";function memoize($r,pr){if(typeof $r!="function"||pr!=null&&typeof pr!="function")throw new TypeError(FUNC_ERROR_TEXT);var Mr=function(){var Nr=arguments,Dr=pr?pr.apply(this,Nr):Nr[0],Br=Mr.cache;if(Br.has(Dr))return Br.get(Dr);var Lr=$r.apply(this,Nr);return Mr.cache=Br.set(Dr,Lr)||Br,Lr};return Mr.cache=new(memoize.Cache||MapCache),Mr}memoize.Cache=MapCache;var MAX_MEMOIZE_SIZE=500;function memoizeCapped($r){var pr=memoize($r,function(Nr){return Mr.size===MAX_MEMOIZE_SIZE&&Mr.clear(),Nr}),Mr=pr.cache;return pr}var rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=memoizeCapped(function($r){var pr=[];return $r.charCodeAt(0)===46&&pr.push(""),$r.replace(rePropName,function(Mr,Nr,Dr,Br){pr.push(Dr?Br.replace(reEscapeChar,"$1"):Nr||Mr)}),pr});const stringToPath$1=stringToPath;function arrayMap($r,pr){for(var Mr=-1,Nr=$r==null?0:$r.length,Dr=Array(Nr);++Mr<Nr;)Dr[Mr]=pr($r[Mr],Mr,$r);return Dr}var INFINITY$3=1/0,symbolProto$1=Symbol$2?Symbol$2.prototype:void 0,symbolToString=symbolProto$1?symbolProto$1.toString:void 0;function baseToString($r){if(typeof $r=="string")return $r;if(isArray$1($r))return arrayMap($r,baseToString)+"";if(isSymbol($r))return symbolToString?symbolToString.call($r):"";var pr=$r+"";return pr=="0"&&1/$r==-INFINITY$3?"-0":pr}function toString($r){return $r==null?"":baseToString($r)}function castPath($r,pr){return isArray$1($r)?$r:isKey($r,pr)?[$r]:stringToPath$1(toString($r))}var argsTag$2="[object Arguments]";function baseIsArguments($r){return isObjectLike($r)&&baseGetTag($r)==argsTag$2}var objectProto$9=Object.prototype,hasOwnProperty$7=objectProto$9.hasOwnProperty,propertyIsEnumerable$1=objectProto$9.propertyIsEnumerable,isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function($r){return isObjectLike($r)&&hasOwnProperty$7.call($r,"callee")&&!propertyIsEnumerable$1.call($r,"callee")};const isArguments$1=isArguments;var MAX_SAFE_INTEGER$1=9007199254740991,reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex($r,pr){var Mr=typeof $r;return pr=pr??MAX_SAFE_INTEGER$1,!!pr&&(Mr=="number"||Mr!="symbol"&&reIsUint.test($r))&&$r>-1&&$r%1==0&&$r<pr}var MAX_SAFE_INTEGER=9007199254740991;function isLength($r){return typeof $r=="number"&&$r>-1&&$r%1==0&&$r<=MAX_SAFE_INTEGER}var INFINITY$2=1/0;function toKey($r){if(typeof $r=="string"||isSymbol($r))return $r;var pr=$r+"";return pr=="0"&&1/$r==-INFINITY$2?"-0":pr}function hasPath($r,pr,Mr){pr=castPath(pr,$r);for(var Nr=-1,Dr=pr.length,Br=!1;++Nr<Dr;){var Lr=toKey(pr[Nr]);if(!(Br=$r!=null&&Mr($r,Lr)))break;$r=$r[Lr]}return Br||++Nr!=Dr?Br:(Dr=$r==null?0:$r.length,!!Dr&&isLength(Dr)&&isIndex(Lr,Dr)&&(isArray$1($r)||isArguments$1($r)))}function apply($r,pr,Mr){switch(Mr.length){case 0:return $r.call(pr);case 1:return $r.call(pr,Mr[0]);case 2:return $r.call(pr,Mr[0],Mr[1]);case 3:return $r.call(pr,Mr[0],Mr[1],Mr[2])}return $r.apply(pr,Mr)}function last($r){var pr=$r==null?0:$r.length;return pr?$r[pr-1]:void 0}function baseGet($r,pr){pr=castPath(pr,$r);for(var Mr=0,Nr=pr.length;$r!=null&&Mr<Nr;)$r=$r[toKey(pr[Mr++])];return Mr&&Mr==Nr?$r:void 0}function baseSlice($r,pr,Mr){var Nr=-1,Dr=$r.length;pr<0&&(pr=-pr>Dr?0:Dr+pr),Mr=Mr>Dr?Dr:Mr,Mr<0&&(Mr+=Dr),Dr=pr>Mr?0:Mr-pr>>>0,pr>>>=0;for(var Br=Array(Dr);++Nr<Dr;)Br[Nr]=$r[Nr+pr];return Br}function parent($r,pr){return pr.length<2?$r:baseGet($r,baseSlice(pr,0,-1))}function baseInvoke($r,pr,Mr){pr=castPath(pr,$r),$r=parent($r,pr);var Nr=$r==null?$r:$r[toKey(last(pr))];return Nr==null?void 0:apply(Nr,$r,Mr)}function identity($r){return $r}var nativeMax$3=Math.max;function overRest($r,pr,Mr){return pr=nativeMax$3(pr===void 0?$r.length-1:pr,0),function(){for(var Nr=arguments,Dr=-1,Br=nativeMax$3(Nr.length-pr,0),Lr=Array(Br);++Dr<Br;)Lr[Dr]=Nr[pr+Dr];Dr=-1;for(var jr=Array(pr+1);++Dr<pr;)jr[Dr]=Nr[Dr];return jr[pr]=Mr(Lr),apply($r,this,jr)}}function constant($r){return function(){return $r}}var defineProperty=function(){try{var $r=getNative(Object,"defineProperty");return $r({},"",{}),$r}catch{}}();const defineProperty$1=defineProperty;var baseSetToString=defineProperty$1?function($r,pr){return defineProperty$1($r,"toString",{configurable:!0,enumerable:!1,value:constant(pr),writable:!0})}:identity;const baseSetToString$1=baseSetToString;var HOT_COUNT=800,HOT_SPAN=16,nativeNow=Date.now;function shortOut($r){var pr=0,Mr=0;return function(){var Nr=nativeNow(),Dr=HOT_SPAN-(Nr-Mr);if(Mr=Nr,Dr>0){if(++pr>=HOT_COUNT)return arguments[0]}else pr=0;return $r.apply(void 0,arguments)}}var setToString=shortOut(baseSetToString$1);const setToString$1=setToString;function baseRest($r,pr){return setToString$1(overRest($r,pr,identity),$r+"")}var invoke=baseRest(baseInvoke);const _invoke=invoke;function _assertThisInitialized($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}function isUndefined($r){return $r===void 0}var reWhitespace=/\s/;function trimmedEndIndex($r){for(var pr=$r.length;pr--&&reWhitespace.test($r.charAt(pr)););return pr}var reTrimStart=/^\s+/;function baseTrim($r){return $r&&$r.slice(0,trimmedEndIndex($r)+1).replace(reTrimStart,"")}var NAN=0/0,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt;function toNumber($r){if(typeof $r=="number")return $r;if(isSymbol($r))return NAN;if(isObject($r)){var pr=typeof $r.valueOf=="function"?$r.valueOf():$r;$r=isObject(pr)?pr+"":pr}if(typeof $r!="string")return $r===0?$r:+$r;$r=baseTrim($r);var Mr=reIsBinary.test($r);return Mr||reIsOctal.test($r)?freeParseInt($r.slice(2),Mr?2:8):reIsBadHex.test($r)?NAN:+$r}var INFINITY$1=1/0,MAX_INTEGER=17976931348623157e292;function toFinite($r){if(!$r)return $r===0?$r:0;if($r=toNumber($r),$r===INFINITY$1||$r===-INFINITY$1){var pr=$r<0?-1:1;return pr*MAX_INTEGER}return $r===$r?$r:0}function toInteger($r){var pr=toFinite($r),Mr=pr%1;return pr===pr?Mr?pr-Mr:pr:0}function arrayFilter($r,pr){for(var Mr=-1,Nr=$r==null?0:$r.length,Dr=0,Br=[];++Mr<Nr;){var Lr=$r[Mr];pr(Lr,Mr,$r)&&(Br[Dr++]=Lr)}return Br}function createBaseFor($r){return function(pr,Mr,Nr){for(var Dr=-1,Br=Object(pr),Lr=Nr(pr),jr=Lr.length;jr--;){var Ur=Lr[$r?jr:++Dr];if(Mr(Br[Ur],Ur,Br)===!1)break}return pr}}var baseFor=createBaseFor();const baseFor$1=baseFor;function baseTimes($r,pr){for(var Mr=-1,Nr=Array($r);++Mr<$r;)Nr[Mr]=pr(Mr);return Nr}function stubFalse(){return!1}var freeExports$1=typeof exports=="object"&&exports&&!exports.nodeType&&exports,freeModule$1=freeExports$1&&typeof module=="object"&&module&&!module.nodeType&&module,moduleExports$1=freeModule$1&&freeModule$1.exports===freeExports$1,Buffer=moduleExports$1?root$1.Buffer:void 0,nativeIsBuffer=Buffer?Buffer.isBuffer:void 0,isBuffer=nativeIsBuffer||stubFalse;const isBuffer$1=isBuffer;var argsTag$1="[object Arguments]",arrayTag$1="[object Array]",boolTag$2="[object Boolean]",dateTag$1="[object Date]",errorTag$1="[object Error]",funcTag="[object Function]",mapTag$4="[object Map]",numberTag$2="[object Number]",objectTag$3="[object Object]",regexpTag$1="[object RegExp]",setTag$4="[object Set]",stringTag$2="[object String]",weakMapTag$1="[object WeakMap]",arrayBufferTag$1="[object ArrayBuffer]",dataViewTag$2="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0;typedArrayTags[argsTag$1]=typedArrayTags[arrayTag$1]=typedArrayTags[arrayBufferTag$1]=typedArrayTags[boolTag$2]=typedArrayTags[dataViewTag$2]=typedArrayTags[dateTag$1]=typedArrayTags[errorTag$1]=typedArrayTags[funcTag]=typedArrayTags[mapTag$4]=typedArrayTags[numberTag$2]=typedArrayTags[objectTag$3]=typedArrayTags[regexpTag$1]=typedArrayTags[setTag$4]=typedArrayTags[stringTag$2]=typedArrayTags[weakMapTag$1]=!1;function baseIsTypedArray($r){return isObjectLike($r)&&isLength($r.length)&&!!typedArrayTags[baseGetTag($r)]}function baseUnary($r){return function(pr){return $r(pr)}}var freeExports=typeof exports=="object"&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&typeof module=="object"&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal$1.process,nodeUtil=function(){try{var $r=freeModule&&freeModule.require&&freeModule.require("util").types;return $r||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch{}}();const nodeUtil$1=nodeUtil;var nodeIsTypedArray=nodeUtil$1&&nodeUtil$1.isTypedArray,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;const isTypedArray$1=isTypedArray;var objectProto$8=Object.prototype,hasOwnProperty$6=objectProto$8.hasOwnProperty;function arrayLikeKeys($r,pr){var Mr=isArray$1($r),Nr=!Mr&&isArguments$1($r),Dr=!Mr&&!Nr&&isBuffer$1($r),Br=!Mr&&!Nr&&!Dr&&isTypedArray$1($r),Lr=Mr||Nr||Dr||Br,jr=Lr?baseTimes($r.length,String):[],Ur=jr.length;for(var Gr in $r)(pr||hasOwnProperty$6.call($r,Gr))&&!(Lr&&(Gr=="length"||Dr&&(Gr=="offset"||Gr=="parent")||Br&&(Gr=="buffer"||Gr=="byteLength"||Gr=="byteOffset")||isIndex(Gr,Ur)))&&jr.push(Gr);return jr}var objectProto$7=Object.prototype;function isPrototype($r){var pr=$r&&$r.constructor,Mr=typeof pr=="function"&&pr.prototype||objectProto$7;return $r===Mr}function overArg($r,pr){return function(Mr){return $r(pr(Mr))}}var nativeKeys=overArg(Object.keys,Object);const nativeKeys$1=nativeKeys;var objectProto$6=Object.prototype,hasOwnProperty$5=objectProto$6.hasOwnProperty;function baseKeys($r){if(!isPrototype($r))return nativeKeys$1($r);var pr=[];for(var Mr in Object($r))hasOwnProperty$5.call($r,Mr)&&Mr!="constructor"&&pr.push(Mr);return pr}function isArrayLike($r){return $r!=null&&isLength($r.length)&&!isFunction($r)}function keys$1($r){return isArrayLike($r)?arrayLikeKeys($r):baseKeys($r)}function baseForOwn($r,pr){return $r&&baseFor$1($r,pr,keys$1)}function createBaseEach($r,pr){return function(Mr,Nr){if(Mr==null)return Mr;if(!isArrayLike(Mr))return $r(Mr,Nr);for(var Dr=Mr.length,Br=pr?Dr:-1,Lr=Object(Mr);(pr?Br--:++Br<Dr)&&Nr(Lr[Br],Br,Lr)!==!1;);return Mr}}var baseEach=createBaseEach(baseForOwn);const baseEach$1=baseEach;function baseFilter($r,pr){var Mr=[];return baseEach$1($r,function(Nr,Dr,Br){pr(Nr,Dr,Br)&&Mr.push(Nr)}),Mr}function stackClear(){this.__data__=new ListCache,this.size=0}function stackDelete($r){var pr=this.__data__,Mr=pr.delete($r);return this.size=pr.size,Mr}function stackGet($r){return this.__data__.get($r)}function stackHas($r){return this.__data__.has($r)}var LARGE_ARRAY_SIZE$2=200;function stackSet($r,pr){var Mr=this.__data__;if(Mr instanceof ListCache){var Nr=Mr.__data__;if(!Map$2||Nr.length<LARGE_ARRAY_SIZE$2-1)return Nr.push([$r,pr]),this.size=++Mr.size,this;Mr=this.__data__=new MapCache(Nr)}return Mr.set($r,pr),this.size=Mr.size,this}function Stack($r){var pr=this.__data__=new ListCache($r);this.size=pr.size}Stack.prototype.clear=stackClear;Stack.prototype.delete=stackDelete;Stack.prototype.get=stackGet;Stack.prototype.has=stackHas;Stack.prototype.set=stackSet;var HASH_UNDEFINED="__lodash_hash_undefined__";function setCacheAdd($r){return this.__data__.set($r,HASH_UNDEFINED),this}function setCacheHas($r){return this.__data__.has($r)}function SetCache($r){var pr=-1,Mr=$r==null?0:$r.length;for(this.__data__=new MapCache;++pr<Mr;)this.add($r[pr])}SetCache.prototype.add=SetCache.prototype.push=setCacheAdd;SetCache.prototype.has=setCacheHas;function arraySome($r,pr){for(var Mr=-1,Nr=$r==null?0:$r.length;++Mr<Nr;)if(pr($r[Mr],Mr,$r))return!0;return!1}function cacheHas($r,pr){return $r.has(pr)}var COMPARE_PARTIAL_FLAG$5=1,COMPARE_UNORDERED_FLAG$3=2;function equalArrays($r,pr,Mr,Nr,Dr,Br){var Lr=Mr&COMPARE_PARTIAL_FLAG$5,jr=$r.length,Ur=pr.length;if(jr!=Ur&&!(Lr&&Ur>jr))return!1;var Gr=Br.get($r),Yr=Br.get(pr);if(Gr&&Yr)return Gr==pr&&Yr==$r;var Qr=-1,Wn=!0,ga=Mr&COMPARE_UNORDERED_FLAG$3?new SetCache:void 0;for(Br.set($r,pr),Br.set(pr,$r);++Qr<jr;){var eo=$r[Qr],_i=pr[Qr];if(Nr)var va=Lr?Nr(_i,eo,Qr,pr,$r,Br):Nr(eo,_i,Qr,$r,pr,Br);if(va!==void 0){if(va)continue;Wn=!1;break}if(ga){if(!arraySome(pr,function(io,no){if(!cacheHas(ga,no)&&(eo===io||Dr(eo,io,Mr,Nr,Br)))return ga.push(no)})){Wn=!1;break}}else if(!(eo===_i||Dr(eo,_i,Mr,Nr,Br))){Wn=!1;break}}return Br.delete($r),Br.delete(pr),Wn}var Uint8Array$1=root$1.Uint8Array;const Uint8Array$2=Uint8Array$1;function mapToArray($r){var pr=-1,Mr=Array($r.size);return $r.forEach(function(Nr,Dr){Mr[++pr]=[Dr,Nr]}),Mr}function setToArray($r){var pr=-1,Mr=Array($r.size);return $r.forEach(function(Nr){Mr[++pr]=Nr}),Mr}var COMPARE_PARTIAL_FLAG$4=1,COMPARE_UNORDERED_FLAG$2=2,boolTag$1="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",mapTag$3="[object Map]",numberTag$1="[object Number]",regexpTag="[object RegExp]",setTag$3="[object Set]",stringTag$1="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag$1="[object DataView]",symbolProto=Symbol$2?Symbol$2.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;function equalByTag($r,pr,Mr,Nr,Dr,Br,Lr){switch(Mr){case dataViewTag$1:if($r.byteLength!=pr.byteLength||$r.byteOffset!=pr.byteOffset)return!1;$r=$r.buffer,pr=pr.buffer;case arrayBufferTag:return!($r.byteLength!=pr.byteLength||!Br(new Uint8Array$2($r),new Uint8Array$2(pr)));case boolTag$1:case dateTag:case numberTag$1:return eq(+$r,+pr);case errorTag:return $r.name==pr.name&&$r.message==pr.message;case regexpTag:case stringTag$1:return $r==pr+"";case mapTag$3:var jr=mapToArray;case setTag$3:var Ur=Nr&COMPARE_PARTIAL_FLAG$4;if(jr||(jr=setToArray),$r.size!=pr.size&&!Ur)return!1;var Gr=Lr.get($r);if(Gr)return Gr==pr;Nr|=COMPARE_UNORDERED_FLAG$2,Lr.set($r,pr);var Yr=equalArrays(jr($r),jr(pr),Nr,Dr,Br,Lr);return Lr.delete($r),Yr;case symbolTag:if(symbolValueOf)return symbolValueOf.call($r)==symbolValueOf.call(pr)}return!1}function arrayPush($r,pr){for(var Mr=-1,Nr=pr.length,Dr=$r.length;++Mr<Nr;)$r[Dr+Mr]=pr[Mr];return $r}function baseGetAllKeys($r,pr,Mr){var Nr=pr($r);return isArray$1($r)?Nr:arrayPush(Nr,Mr($r))}function stubArray(){return[]}var objectProto$5=Object.prototype,propertyIsEnumerable=objectProto$5.propertyIsEnumerable,nativeGetSymbols=Object.getOwnPropertySymbols,getSymbols=nativeGetSymbols?function($r){return $r==null?[]:($r=Object($r),arrayFilter(nativeGetSymbols($r),function(pr){return propertyIsEnumerable.call($r,pr)}))}:stubArray;const getSymbols$1=getSymbols;function getAllKeys($r){return baseGetAllKeys($r,keys$1,getSymbols$1)}var COMPARE_PARTIAL_FLAG$3=1,objectProto$4=Object.prototype,hasOwnProperty$4=objectProto$4.hasOwnProperty;function equalObjects($r,pr,Mr,Nr,Dr,Br){var Lr=Mr&COMPARE_PARTIAL_FLAG$3,jr=getAllKeys($r),Ur=jr.length,Gr=getAllKeys(pr),Yr=Gr.length;if(Ur!=Yr&&!Lr)return!1;for(var Qr=Ur;Qr--;){var Wn=jr[Qr];if(!(Lr?Wn in pr:hasOwnProperty$4.call(pr,Wn)))return!1}var ga=Br.get($r),eo=Br.get(pr);if(ga&&eo)return ga==pr&&eo==$r;var _i=!0;Br.set($r,pr),Br.set(pr,$r);for(var va=Lr;++Qr<Ur;){Wn=jr[Qr];var io=$r[Wn],no=pr[Wn];if(Nr)var so=Lr?Nr(no,io,Wn,pr,$r,Br):Nr(io,no,Wn,$r,pr,Br);if(!(so===void 0?io===no||Dr(io,no,Mr,Nr,Br):so)){_i=!1;break}va||(va=Wn=="constructor")}if(_i&&!va){var ao=$r.constructor,fo=pr.constructor;ao!=fo&&"constructor"in $r&&"constructor"in pr&&!(typeof ao=="function"&&ao instanceof ao&&typeof fo=="function"&&fo instanceof fo)&&(_i=!1)}return Br.delete($r),Br.delete(pr),_i}var DataView$1=getNative(root$1,"DataView");const DataView$2=DataView$1;var Promise$1=getNative(root$1,"Promise");const Promise$2=Promise$1;var Set$1=getNative(root$1,"Set");const Set$2=Set$1;var WeakMap$1=getNative(root$1,"WeakMap");const WeakMap$2=WeakMap$1;var mapTag$2="[object Map]",objectTag$2="[object Object]",promiseTag="[object Promise]",setTag$2="[object Set]",weakMapTag="[object WeakMap]",dataViewTag="[object DataView]",dataViewCtorString=toSource(DataView$2),mapCtorString=toSource(Map$2),promiseCtorString=toSource(Promise$2),setCtorString=toSource(Set$2),weakMapCtorString=toSource(WeakMap$2),getTag=baseGetTag;(DataView$2&&getTag(new DataView$2(new ArrayBuffer(1)))!=dataViewTag||Map$2&&getTag(new Map$2)!=mapTag$2||Promise$2&&getTag(Promise$2.resolve())!=promiseTag||Set$2&&getTag(new Set$2)!=setTag$2||WeakMap$2&&getTag(new WeakMap$2)!=weakMapTag)&&(getTag=function($r){var pr=baseGetTag($r),Mr=pr==objectTag$2?$r.constructor:void 0,Nr=Mr?toSource(Mr):"";if(Nr)switch(Nr){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag$2;case promiseCtorString:return promiseTag;case setCtorString:return setTag$2;case weakMapCtorString:return weakMapTag}return pr});const getTag$1=getTag;var COMPARE_PARTIAL_FLAG$2=1,argsTag="[object Arguments]",arrayTag="[object Array]",objectTag$1="[object Object]",objectProto$3=Object.prototype,hasOwnProperty$3=objectProto$3.hasOwnProperty;function baseIsEqualDeep($r,pr,Mr,Nr,Dr,Br){var Lr=isArray$1($r),jr=isArray$1(pr),Ur=Lr?arrayTag:getTag$1($r),Gr=jr?arrayTag:getTag$1(pr);Ur=Ur==argsTag?objectTag$1:Ur,Gr=Gr==argsTag?objectTag$1:Gr;var Yr=Ur==objectTag$1,Qr=Gr==objectTag$1,Wn=Ur==Gr;if(Wn&&isBuffer$1($r)){if(!isBuffer$1(pr))return!1;Lr=!0,Yr=!1}if(Wn&&!Yr)return Br||(Br=new Stack),Lr||isTypedArray$1($r)?equalArrays($r,pr,Mr,Nr,Dr,Br):equalByTag($r,pr,Ur,Mr,Nr,Dr,Br);if(!(Mr&COMPARE_PARTIAL_FLAG$2)){var ga=Yr&&hasOwnProperty$3.call($r,"__wrapped__"),eo=Qr&&hasOwnProperty$3.call(pr,"__wrapped__");if(ga||eo){var _i=ga?$r.value():$r,va=eo?pr.value():pr;return Br||(Br=new Stack),Dr(_i,va,Mr,Nr,Br)}}return Wn?(Br||(Br=new Stack),equalObjects($r,pr,Mr,Nr,Dr,Br)):!1}function baseIsEqual($r,pr,Mr,Nr,Dr){return $r===pr?!0:$r==null||pr==null||!isObjectLike($r)&&!isObjectLike(pr)?$r!==$r&&pr!==pr:baseIsEqualDeep($r,pr,Mr,Nr,baseIsEqual,Dr)}var COMPARE_PARTIAL_FLAG$1=1,COMPARE_UNORDERED_FLAG$1=2;function baseIsMatch($r,pr,Mr,Nr){var Dr=Mr.length,Br=Dr,Lr=!Nr;if($r==null)return!Br;for($r=Object($r);Dr--;){var jr=Mr[Dr];if(Lr&&jr[2]?jr[1]!==$r[jr[0]]:!(jr[0]in $r))return!1}for(;++Dr<Br;){jr=Mr[Dr];var Ur=jr[0],Gr=$r[Ur],Yr=jr[1];if(Lr&&jr[2]){if(Gr===void 0&&!(Ur in $r))return!1}else{var Qr=new Stack;if(Nr)var Wn=Nr(Gr,Yr,Ur,$r,pr,Qr);if(!(Wn===void 0?baseIsEqual(Yr,Gr,COMPARE_PARTIAL_FLAG$1|COMPARE_UNORDERED_FLAG$1,Nr,Qr):Wn))return!1}}return!0}function isStrictComparable($r){return $r===$r&&!isObject($r)}function getMatchData($r){for(var pr=keys$1($r),Mr=pr.length;Mr--;){var Nr=pr[Mr],Dr=$r[Nr];pr[Mr]=[Nr,Dr,isStrictComparable(Dr)]}return pr}function matchesStrictComparable($r,pr){return function(Mr){return Mr==null?!1:Mr[$r]===pr&&(pr!==void 0||$r in Object(Mr))}}function baseMatches($r){var pr=getMatchData($r);return pr.length==1&&pr[0][2]?matchesStrictComparable(pr[0][0],pr[0][1]):function(Mr){return Mr===$r||baseIsMatch(Mr,$r,pr)}}function get($r,pr,Mr){var Nr=$r==null?void 0:baseGet($r,pr);return Nr===void 0?Mr:Nr}function baseHasIn($r,pr){return $r!=null&&pr in Object($r)}function hasIn($r,pr){return $r!=null&&hasPath($r,pr,baseHasIn)}var COMPARE_PARTIAL_FLAG=1,COMPARE_UNORDERED_FLAG=2;function baseMatchesProperty($r,pr){return isKey($r)&&isStrictComparable(pr)?matchesStrictComparable(toKey($r),pr):function(Mr){var Nr=get(Mr,$r);return Nr===void 0&&Nr===pr?hasIn(Mr,$r):baseIsEqual(pr,Nr,COMPARE_PARTIAL_FLAG|COMPARE_UNORDERED_FLAG)}}function baseProperty($r){return function(pr){return pr==null?void 0:pr[$r]}}function basePropertyDeep($r){return function(pr){return baseGet(pr,$r)}}function property($r){return isKey($r)?baseProperty(toKey($r)):basePropertyDeep($r)}function baseIteratee($r){return typeof $r=="function"?$r:$r==null?identity:typeof $r=="object"?isArray$1($r)?baseMatchesProperty($r[0],$r[1]):baseMatches($r):property($r)}function filter($r,pr){var Mr=isArray$1($r)?arrayFilter:baseFilter;return Mr($r,baseIteratee(pr))}var mapTag$1="[object Map]",setTag$1="[object Set]",objectProto$2=Object.prototype,hasOwnProperty$2=objectProto$2.hasOwnProperty;function isEmpty($r){if($r==null)return!0;if(isArrayLike($r)&&(isArray$1($r)||typeof $r=="string"||typeof $r.splice=="function"||isBuffer$1($r)||isTypedArray$1($r)||isArguments$1($r)))return!$r.length;var pr=getTag$1($r);if(pr==mapTag$1||pr==setTag$1)return!$r.size;if(isPrototype($r))return!baseKeys($r).length;for(var Mr in $r)if(hasOwnProperty$2.call($r,Mr))return!1;return!0}function baseFindIndex($r,pr,Mr,Nr){for(var Dr=$r.length,Br=Mr+(Nr?1:-1);Nr?Br--:++Br<Dr;)if(pr($r[Br],Br,$r))return Br;return-1}function baseIsNaN($r){return $r!==$r}function strictIndexOf($r,pr,Mr){for(var Nr=Mr-1,Dr=$r.length;++Nr<Dr;)if($r[Nr]===pr)return Nr;return-1}function baseIndexOf($r,pr,Mr){return pr===pr?strictIndexOf($r,pr,Mr):baseFindIndex($r,baseIsNaN,Mr)}function arrayIncludes($r,pr){var Mr=$r==null?0:$r.length;return!!Mr&&baseIndexOf($r,pr,0)>-1}function arrayIncludesWith($r,pr,Mr){for(var Nr=-1,Dr=$r==null?0:$r.length;++Nr<Dr;)if(Mr(pr,$r[Nr]))return!0;return!1}function isArrayLikeObject($r){return isObjectLike($r)&&isArrayLike($r)}function arrayEach($r,pr){for(var Mr=-1,Nr=$r==null?0:$r.length;++Mr<Nr&&pr($r[Mr],Mr,$r)!==!1;);return $r}function castFunction($r){return typeof $r=="function"?$r:identity}function forEach($r,pr){var Mr=isArray$1($r)?arrayEach:baseEach$1;return Mr($r,castFunction(pr))}var getDefaultPropName=function(pr){return"default"+(pr[0].toUpperCase()+pr.slice(1))},getAutoControlledStateValue=function(pr,Mr,Nr,Dr){Dr===void 0&&(Dr=!1);var Br=Mr[pr];if(Br!==void 0)return Br;if(Dr){var Lr=Mr[getDefaultPropName(pr)];if(Lr!==void 0)return Lr;if(Nr){var jr=Nr[pr];if(jr!==void 0)return jr}}if(pr==="checked")return!1;if(pr==="value")return Mr.multiple?[]:""},ModernAutoControlledComponent=function($r){_inheritsLoose$6(pr,$r);function pr(){for(var Mr,Nr=arguments.length,Dr=new Array(Nr),Br=0;Br<Nr;Br++)Dr[Br]=arguments[Br];Mr=$r.call.apply($r,[this].concat(Dr))||this;var Lr=Mr.constructor,jr=Lr.autoControlledProps,Ur=Lr.getAutoControlledStateFromProps,Gr=_invoke(_assertThisInitialized(Mr),"getInitialAutoControlledState",Mr.props)||{},Yr=jr.reduce(function(Qr,Wn){return Qr[Wn]=getAutoControlledStateValue(Wn,Mr.props,Gr,!0),Qr},{});return Mr.state=_extends$1({},Gr,Yr,{autoControlledProps:jr,getAutoControlledStateFromProps:Ur}),Mr}return pr.getDerivedStateFromProps=function(Nr,Dr){var Br=Dr.autoControlledProps,Lr=Dr.getAutoControlledStateFromProps,jr=Br.reduce(function(Gr,Yr){var Qr=!isUndefined(Nr[Yr]);return Qr&&(Gr[Yr]=Nr[Yr]),Gr},{});if(Lr){var Ur=Lr(Nr,_extends$1({},Dr,jr),Dr);return _extends$1({},jr,Ur)}return jr},pr.getAutoControlledStateFromProps=function(){return null},pr}(React$5.Component);function createFind($r){return function(pr,Mr,Nr){var Dr=Object(pr);if(!isArrayLike(pr)){var Br=baseIteratee(Mr);pr=keys$1(pr),Mr=function(jr){return Br(Dr[jr],jr,Dr)}}var Lr=$r(pr,Mr,Nr);return Lr>-1?Dr[Br?pr[Lr]:Lr]:void 0}}var nativeMax$2=Math.max;function findIndex($r,pr,Mr){var Nr=$r==null?0:$r.length;if(!Nr)return-1;var Dr=Mr==null?0:toInteger(Mr);return Dr<0&&(Dr=nativeMax$2(Nr+Dr,0)),baseFindIndex($r,baseIteratee(pr),Dr)}var find=createFind(findIndex);const _find=find;function baseSome($r,pr){var Mr;return baseEach$1($r,function(Nr,Dr,Br){return Mr=pr(Nr,Dr,Br),!Mr}),!!Mr}function isIterateeCall($r,pr,Mr){if(!isObject(Mr))return!1;var Nr=typeof pr;return(Nr=="number"?isArrayLike(Mr)&&isIndex(pr,Mr.length):Nr=="string"&&pr in Mr)?eq(Mr[pr],$r):!1}function some($r,pr,Mr){var Nr=isArray$1($r)?arraySome:baseSome;return Mr&&isIterateeCall($r,pr,Mr)&&(pr=void 0),Nr($r,baseIteratee(pr))}var someByType=function(pr,Mr){return some(reactExports.Children.toArray(pr),{type:Mr})},isNil$1=function(pr){return pr==null||Array.isArray(pr)&&pr.length===0},numberToWordMap={1:"one",2:"two",3:"three",4:"four",5:"five",6:"six",7:"seven",8:"eight",9:"nine",10:"ten",11:"eleven",12:"twelve",13:"thirteen",14:"fourteen",15:"fifteen",16:"sixteen"};function numberToWord($r){var pr=typeof $r;return pr==="string"||pr==="number"?numberToWordMap[$r]||$r:""}var useKeyOnly=function(pr,Mr){return pr&&Mr},useValueAndKey=function(pr,Mr){return pr&&pr!==!0&&pr+" "+Mr},useKeyOrValueAndKey=function(pr,Mr){return pr&&(pr===!0?Mr:pr+" "+Mr)},useTextAlignProp=function(pr){return pr==="justified"?"justified":useValueAndKey(pr,"aligned")},useVerticalAlignProp=function(pr){return useValueAndKey(pr,"aligned")},useWidthProp=function(pr,Mr,Nr){if(Mr===void 0&&(Mr=""),Nr===void 0&&(Nr=!1),Nr&&pr==="equal")return"equal width";var Dr=typeof pr;return(Dr==="string"||Dr==="number")&&Mr?numberToWord(pr)+" "+Mr:numberToWord(pr)},LARGE_ARRAY_SIZE$1=200;function baseDifference($r,pr,Mr,Nr){var Dr=-1,Br=arrayIncludes,Lr=!0,jr=$r.length,Ur=[],Gr=pr.length;if(!jr)return Ur;Mr&&(pr=arrayMap(pr,baseUnary(Mr))),Nr?(Br=arrayIncludesWith,Lr=!1):pr.length>=LARGE_ARRAY_SIZE$1&&(Br=cacheHas,Lr=!1,pr=new SetCache(pr));e:for(;++Dr<jr;){var Yr=$r[Dr],Qr=Mr==null?Yr:Mr(Yr);if(Yr=Nr||Yr!==0?Yr:0,Lr&&Qr===Qr){for(var Wn=Gr;Wn--;)if(pr[Wn]===Qr)continue e;Ur.push(Yr)}else Br(pr,Qr,Nr)||Ur.push(Yr)}return Ur}var spreadableSymbol=Symbol$2?Symbol$2.isConcatSpreadable:void 0;function isFlattenable($r){return isArray$1($r)||isArguments$1($r)||!!(spreadableSymbol&&$r&&$r[spreadableSymbol])}function baseFlatten($r,pr,Mr,Nr,Dr){var Br=-1,Lr=$r.length;for(Mr||(Mr=isFlattenable),Dr||(Dr=[]);++Br<Lr;){var jr=$r[Br];pr>0&&Mr(jr)?pr>1?baseFlatten(jr,pr-1,Mr,Nr,Dr):arrayPush(Dr,jr):Nr||(Dr[Dr.length]=jr)}return Dr}var difference=baseRest(function($r,pr){return isArrayLikeObject($r)?baseDifference($r,baseFlatten(pr,1,isArrayLikeObject,!0)):[]});const _difference=difference;var rsAstralRange$1="\\ud800-\\udfff",rsComboMarksRange$2="\\u0300-\\u036f",reComboHalfMarksRange$2="\\ufe20-\\ufe2f",rsComboSymbolsRange$2="\\u20d0-\\u20ff",rsComboRange$2=rsComboMarksRange$2+reComboHalfMarksRange$2+rsComboSymbolsRange$2,rsVarRange$1="\\ufe0e\\ufe0f",rsZWJ$1="\\u200d",reHasUnicode=RegExp("["+rsZWJ$1+rsAstralRange$1+rsComboRange$2+rsVarRange$1+"]");function hasUnicode($r){return reHasUnicode.test($r)}function baseAssignValue($r,pr,Mr){pr=="__proto__"&&defineProperty$1?defineProperty$1($r,pr,{configurable:!0,enumerable:!0,value:Mr,writable:!0}):$r[pr]=Mr}var objectProto$1=Object.prototype,hasOwnProperty$1=objectProto$1.hasOwnProperty;function assignValue($r,pr,Mr){var Nr=$r[pr];(!(hasOwnProperty$1.call($r,pr)&&eq(Nr,Mr))||Mr===void 0&&!(pr in $r))&&baseAssignValue($r,pr,Mr)}function baseSet($r,pr,Mr,Nr){if(!isObject($r))return $r;pr=castPath(pr,$r);for(var Dr=-1,Br=pr.length,Lr=Br-1,jr=$r;jr!=null&&++Dr<Br;){var Ur=toKey(pr[Dr]),Gr=Mr;if(Ur==="__proto__"||Ur==="constructor"||Ur==="prototype")return $r;if(Dr!=Lr){var Yr=jr[Ur];Gr=Nr?Nr(Yr,Ur,jr):void 0,Gr===void 0&&(Gr=isObject(Yr)?Yr:isIndex(pr[Dr+1])?[]:{})}assignValue(jr,Ur,Gr),jr=jr[Ur]}return $r}function basePickBy($r,pr,Mr){for(var Nr=-1,Dr=pr.length,Br={};++Nr<Dr;){var Lr=pr[Nr],jr=baseGet($r,Lr);Mr(jr,Lr)&&baseSet(Br,castPath(Lr,$r),jr)}return Br}function basePick($r,pr){return basePickBy($r,pr,function(Mr,Nr){return hasIn($r,Nr)})}function flatten($r){var pr=$r==null?0:$r.length;return pr?baseFlatten($r,1):[]}function flatRest($r){return setToString$1(overRest($r,void 0,flatten),$r+"")}var pick$1=flatRest(function($r,pr){return $r==null?{}:basePick($r,pr)});const _pick=pick$1;var getPrototype=overArg(Object.getPrototypeOf,Object);const getPrototype$1=getPrototype;var objectTag="[object Object]",funcProto=Function.prototype,objectProto=Object.prototype,funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectCtorString=funcToString.call(Object);function isPlainObject($r){if(!isObjectLike($r)||baseGetTag($r)!=objectTag)return!1;var pr=getPrototype$1($r);if(pr===null)return!0;var Mr=hasOwnProperty.call(pr,"constructor")&&pr.constructor;return typeof Mr=="function"&&Mr instanceof Mr&&funcToString.call(Mr)==objectCtorString}function isNil($r){return $r==null}function baseMap($r,pr){var Mr=-1,Nr=isArrayLike($r)?Array($r.length):[];return baseEach$1($r,function(Dr,Br,Lr){Nr[++Mr]=pr(Dr,Br,Lr)}),Nr}function map($r,pr){var Mr=isArray$1($r)?arrayMap:baseMap;return Mr($r,baseIteratee(pr))}var libExports=requireLib$1();const EventStack=getDefaultExportFromCjs$1(libExports);function noop(){}var INFINITY=1/0,createSet=Set$2&&1/setToArray(new Set$2([,-0]))[1]==INFINITY?function($r){return new Set$2($r)}:noop;const createSet$1=createSet;var LARGE_ARRAY_SIZE=200;function baseUniq($r,pr,Mr){var Nr=-1,Dr=arrayIncludes,Br=$r.length,Lr=!0,jr=[],Ur=jr;if(Mr)Lr=!1,Dr=arrayIncludesWith;else if(Br>=LARGE_ARRAY_SIZE){var Gr=pr?null:createSet$1($r);if(Gr)return setToArray(Gr);Lr=!1,Dr=cacheHas,Ur=new SetCache}else Ur=pr?[]:jr;e:for(;++Nr<Br;){var Yr=$r[Nr],Qr=pr?pr(Yr):Yr;if(Yr=Mr||Yr!==0?Yr:0,Lr&&Qr===Qr){for(var Wn=Ur.length;Wn--;)if(Ur[Wn]===Qr)continue e;pr&&Ur.push(Qr),jr.push(Yr)}else Dr(Ur,Qr,Mr)||(Ur!==jr&&Ur.push(Qr),jr.push(Yr))}return jr}function uniq($r){return $r&&$r.length?baseUniq($r):[]}var numberTag="[object Number]";function isNumber($r){return typeof $r=="number"||isObjectLike($r)&&baseGetTag($r)==numberTag}var stringTag="[object String]";function isString($r){return typeof $r=="string"||!isArray$1($r)&&isObjectLike($r)&&baseGetTag($r)==stringTag}var boolTag="[object Boolean]";function isBoolean($r){return $r===!0||$r===!1||isObjectLike($r)&&baseGetTag($r)==boolTag}function createShorthand($r,pr,Mr,Nr){if(Nr===void 0&&(Nr={}),typeof $r!="function"&&typeof $r!="string")throw new Error("createShorthand() Component must be a string or function.");if(isNil(Mr)||isBoolean(Mr))return null;var Dr=isString(Mr),Br=isNumber(Mr),Lr=isFunction(Mr),jr=reactExports.isValidElement(Mr),Ur=isPlainObject(Mr),Gr=Dr||Br||isArray$1(Mr);if(!Lr&&!jr&&!Ur&&!Gr)return null;var Yr=Nr,Qr=Yr.defaultProps,Wn=Qr===void 0?{}:Qr,ga=jr&&Mr.props||Ur&&Mr||Gr&&pr(Mr),eo=Nr,_i=eo.overrideProps,va=_i===void 0?{}:_i;va=isFunction(va)?va(_extends$1({},Wn,ga)):va;var io=_extends$1({},Wn,ga,va);if(Wn.className||va.className||ga.className){var no=clsx(Wn.className,va.className,ga.className);io.className=uniq(no.split(" ")).join(" ")}if((Wn.style||va.style||ga.style)&&(io.style=_extends$1({},Wn.style,ga.style,va.style)),isNil(io.key)){var so=io.childKey,ao=Nr,fo=ao.autoGenerateKey,lo=fo===void 0?!0:fo;isNil(so)?lo&&(Dr||Br)&&(io.key=Mr):(io.key=typeof so=="function"?so(io):so,delete io.childKey)}if(jr)return reactExports.cloneElement(Mr,io);if(typeof io.children=="function")return io.children($r,_extends$1({},io,{children:void 0}));if(Gr||Ur)return reactExports.createElement($r,io);if(Lr)return Mr($r,io,io.children)}function createShorthandFactory($r,pr){if(typeof $r!="function"&&typeof $r!="string")throw new Error("createShorthandFactory() Component must be a string or function.");return function(Mr,Nr){return createShorthand($r,pr,Mr,Nr)}}var createHTMLInput=createShorthandFactory("input",function($r){return{type:$r}}),createHTMLLabel=createShorthandFactory("label",function($r){return{children:$r}}),getUnhandledProps=function(pr,Mr){var Nr=pr.handledProps,Dr=Nr===void 0?[]:Nr;return Object.keys(Mr).reduce(function(Br,Lr){return Lr==="childKey"||Dr.indexOf(Lr)===-1&&(Br[Lr]=Mr[Lr]),Br},{})};const getUnhandledProps$1=getUnhandledProps;function getElementType($r,pr,Mr){var Nr=$r.defaultProps,Dr=Nr===void 0?{}:Nr;if(pr.as&&pr.as!==Dr.as)return pr.as;if(Mr){var Br=Mr();if(Br)return Br}return pr.href?"a":Dr.as||"div"}function baseValues($r,pr){return arrayMap(pr,function(Mr){return $r[Mr]})}function values($r){return $r==null?[]:baseValues($r,keys$1($r))}var nativeMax$1=Math.max;function includes($r,pr,Mr,Nr){$r=isArrayLike($r)?$r:values($r),Mr=Mr&&!Nr?toInteger(Mr):0;var Dr=$r.length;return Mr<0&&(Mr=nativeMax$1(Dr+Mr,0)),isString($r)?Mr<=Dr&&$r.indexOf(pr,Mr)>-1:!!Dr&&baseIndexOf($r,pr,Mr)>-1}var htmlInputAttrs=["selected","defaultValue","defaultChecked","accept","autoCapitalize","autoComplete","autoCorrect","autoFocus","checked","disabled","enterKeyHint","form","id","inputMode","lang","list","max","maxLength","min","minLength","multiple","name","pattern","placeholder","readOnly","required","step","title","type","value"],htmlInputEvents=["onKeyDown","onKeyPress","onKeyUp","onFocus","onBlur","onChange","onInput","onClick","onContextMenu","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onSelect","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],htmlInputProps=[].concat(htmlInputAttrs,htmlInputEvents),htmlImageProps=["alt","height","src","srcSet","width","loading"],partitionHTMLProps=function(pr,Mr){Mr===void 0&&(Mr={});var Nr=Mr,Dr=Nr.htmlProps,Br=Dr===void 0?htmlInputProps:Dr,Lr=Nr.includeAria,jr=Lr===void 0?!0:Lr,Ur={},Gr={};return forEach(pr,function(Yr,Qr){var Wn=jr&&(/^aria-.*$/.test(Qr)||Qr==="role"),ga=includes(Br,Qr)||Wn?Ur:Gr;ga[Qr]=Yr}),[Ur,Gr]},hasDocument=typeof document=="object"&&document!==null,hasWindow=typeof window=="object"&&window!==null&&window.self===window,isBrowser=function $r(){return isNil($r.override)?hasDocument&&hasWindow:$r.override};const isBrowser$1=isBrowser;var nativeMax=Math.max,nativeMin=Math.min;function baseInRange($r,pr,Mr){return $r>=nativeMin(pr,Mr)&&$r<nativeMax(pr,Mr)}function inRange($r,pr,Mr){return pr=toFinite(pr),Mr===void 0?(Mr=pr,pr=0):Mr=toFinite(Mr),$r=toNumber($r),baseInRange($r,pr,Mr)}function head($r){return $r&&$r.length?$r[0]:void 0}var doesNodeContainClick=function(pr,Mr){if(some([Mr,pr],isNil))return!1;if(Mr.target&&(_invoke(Mr.target,"setAttribute","data-suir-click-target",!0),document.querySelector("[data-suir-click-target=true]")))return _invoke(Mr.target,"removeAttribute","data-suir-click-target"),pr.contains(Mr.target);var Nr=Mr.clientX,Dr=Mr.clientY;if(some([Nr,Dr],isNil))return!1;var Br=pr.getClientRects();if(!pr.offsetWidth||!pr.offsetHeight||!Br||!Br.length)return!1;var Lr=head(Br),jr=Lr.top,Ur=Lr.bottom,Gr=Lr.left,Yr=Lr.right;return some([jr,Ur,Gr,Yr],isNil)?!1:inRange(Dr,jr,Ur+.001)&&inRange(Nr,Gr,Yr+.001)};const doesNodeContainClick$1=doesNodeContainClick;function isEqual($r,pr){return baseIsEqual($r,pr)}var without=baseRest(function($r,pr){return isArrayLikeObject($r)?baseDifference($r,pr):[]});const _without=without;function IconGroup($r){var pr=$r.children,Mr=$r.className,Nr=$r.content,Dr=$r.size,Br=clsx(Dr,"icons",Mr),Lr=getUnhandledProps$1(IconGroup,$r),jr=getElementType(IconGroup,$r);return React$5.createElement(jr,_extends$1({},Lr,{className:Br}),isNil$1(pr)?Nr:pr)}IconGroup.handledProps=["as","children","className","content","size"];IconGroup.propTypes={};IconGroup.defaultProps={as:"i"};var Icon$1=function($r){_inheritsLoose$6(pr,$r);function pr(){for(var Nr,Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=$r.call.apply($r,[this].concat(Br))||this,Nr.handleClick=function(jr){var Ur=Nr.props.disabled;if(Ur){jr.preventDefault();return}_invoke(Nr.props,"onClick",jr,Nr.props)},Nr}var Mr=pr.prototype;return Mr.getIconAriaOptions=function(){var Dr={},Br=this.props,Lr=Br["aria-label"],jr=Br["aria-hidden"];return isNil(Lr)?Dr["aria-hidden"]="true":Dr["aria-label"]=Lr,isNil(jr)||(Dr["aria-hidden"]=jr),Dr},Mr.render=function(){var Dr=this.props,Br=Dr.bordered,Lr=Dr.circular,jr=Dr.className,Ur=Dr.color,Gr=Dr.corner,Yr=Dr.disabled,Qr=Dr.fitted,Wn=Dr.flipped,ga=Dr.inverted,eo=Dr.link,_i=Dr.loading,va=Dr.name,io=Dr.rotated,no=Dr.size,so=clsx(Ur,va,no,useKeyOnly(Br,"bordered"),useKeyOnly(Lr,"circular"),useKeyOnly(Yr,"disabled"),useKeyOnly(Qr,"fitted"),useKeyOnly(ga,"inverted"),useKeyOnly(eo,"link"),useKeyOnly(_i,"loading"),useKeyOrValueAndKey(Gr,"corner"),useValueAndKey(Wn,"flipped"),useValueAndKey(io,"rotated"),"icon",jr),ao=getUnhandledProps$1(pr,this.props),fo=getElementType(pr,this.props),lo=this.getIconAriaOptions();return React$5.createElement(fo,_extends$1({},ao,lo,{className:so,onClick:this.handleClick}))},pr}(reactExports.PureComponent);Icon$1.handledProps=["aria-hidden","aria-label","as","bordered","circular","className","color","corner","disabled","fitted","flipped","inverted","link","loading","name","rotated","size"];Icon$1.propTypes={};Icon$1.defaultProps={as:"i"};Icon$1.Group=IconGroup;Icon$1.create=createShorthandFactory(Icon$1,function($r){return{name:$r}});const Icon$2=Icon$1;var keyboardKeyExports=requireKeyboardKey();const keyboardKey=getDefaultExportFromCjs$1(keyboardKeyExports);var PortalInner=function($r){_inheritsLoose$6(pr,$r);function pr(){for(var Nr,Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=$r.call.apply($r,[this].concat(Br))||this,Nr.handleRef=function(jr){handleRef(Nr.props.innerRef,jr)},Nr}var Mr=pr.prototype;return Mr.componentDidMount=function(){_invoke(this.props,"onMount",null,this.props)},Mr.componentWillUnmount=function(){_invoke(this.props,"onUnmount",null,this.props)},Mr.render=function(){if(!isBrowser$1())return null;var Dr=this.props,Br=Dr.children,Lr=Dr.mountNode,jr=Lr===void 0?document.body:Lr;return reactDomExports.createPortal(React$5.createElement(Ref,{innerRef:this.handleRef},Br),jr)},pr}(reactExports.Component);PortalInner.handledProps=["children","innerRef","mountNode","onMount","onUnmount"];PortalInner.propTypes={};const PortalInner$1=PortalInner;var Portal=function($r){_inheritsLoose$6(pr,$r);function pr(){for(var Nr,Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=$r.call.apply($r,[this].concat(Br))||this,Nr.contentRef=React$5.createRef(),Nr.triggerRef=React$5.createRef(),Nr.latestDocumentMouseDownEvent=null,Nr.handleDocumentMouseDown=function(jr){Nr.latestDocumentMouseDownEvent=jr},Nr.handleDocumentClick=function(jr){var Ur=Nr.props.closeOnDocumentClick,Gr=Nr.latestDocumentMouseDownEvent;Nr.latestDocumentMouseDownEvent=null,!(!Nr.contentRef.current||doesNodeContainClick$1(Nr.triggerRef.current,jr)||Gr&&doesNodeContainClick$1(Nr.contentRef.current,Gr)||doesNodeContainClick$1(Nr.contentRef.current,jr))&&Ur&&Nr.close(jr)},Nr.handleEscape=function(jr){Nr.props.closeOnEscape&&keyboardKey.getCode(jr)===keyboardKey.Escape&&Nr.close(jr)},Nr.handlePortalMouseLeave=function(jr){var Ur=Nr.props,Gr=Ur.closeOnPortalMouseLeave,Yr=Ur.mouseLeaveDelay;Gr&&jr.target===Nr.contentRef.current&&(Nr.mouseLeaveTimer=Nr.closeWithTimeout(jr,Yr))},Nr.handlePortalMouseEnter=function(){var jr=Nr.props.closeOnPortalMouseLeave;jr&&clearTimeout(Nr.mouseLeaveTimer)},Nr.handleTriggerBlur=function(jr){for(var Ur=Nr.props,Gr=Ur.trigger,Yr=Ur.closeOnTriggerBlur,Qr=arguments.length,Wn=new Array(Qr>1?Qr-1:0),ga=1;ga<Qr;ga++)Wn[ga-1]=arguments[ga];_invoke.apply(void 0,[Gr,"props.onBlur",jr].concat(Wn));var eo=jr.relatedTarget||document.activeElement,_i=_invoke(Nr.contentRef.current,"contains",eo);!Yr||_i||Nr.close(jr)},Nr.handleTriggerClick=function(jr){for(var Ur=Nr.props,Gr=Ur.trigger,Yr=Ur.closeOnTriggerClick,Qr=Ur.openOnTriggerClick,Wn=Nr.state.open,ga=arguments.length,eo=new Array(ga>1?ga-1:0),_i=1;_i<ga;_i++)eo[_i-1]=arguments[_i];_invoke.apply(void 0,[Gr,"props.onClick",jr].concat(eo)),Wn&&Yr?Nr.close(jr):!Wn&&Qr&&Nr.open(jr)},Nr.handleTriggerFocus=function(jr){for(var Ur=Nr.props,Gr=Ur.trigger,Yr=Ur.openOnTriggerFocus,Qr=arguments.length,Wn=new Array(Qr>1?Qr-1:0),ga=1;ga<Qr;ga++)Wn[ga-1]=arguments[ga];_invoke.apply(void 0,[Gr,"props.onFocus",jr].concat(Wn)),Yr&&Nr.open(jr)},Nr.handleTriggerMouseLeave=function(jr){clearTimeout(Nr.mouseEnterTimer);for(var Ur=Nr.props,Gr=Ur.trigger,Yr=Ur.closeOnTriggerMouseLeave,Qr=Ur.mouseLeaveDelay,Wn=arguments.length,ga=new Array(Wn>1?Wn-1:0),eo=1;eo<Wn;eo++)ga[eo-1]=arguments[eo];_invoke.apply(void 0,[Gr,"props.onMouseLeave",jr].concat(ga)),Yr&&(Nr.mouseLeaveTimer=Nr.closeWithTimeout(jr,Qr))},Nr.handleTriggerMouseEnter=function(jr){clearTimeout(Nr.mouseLeaveTimer);for(var Ur=Nr.props,Gr=Ur.trigger,Yr=Ur.mouseEnterDelay,Qr=Ur.openOnTriggerMouseEnter,Wn=arguments.length,ga=new Array(Wn>1?Wn-1:0),eo=1;eo<Wn;eo++)ga[eo-1]=arguments[eo];_invoke.apply(void 0,[Gr,"props.onMouseEnter",jr].concat(ga)),Qr&&(Nr.mouseEnterTimer=Nr.openWithTimeout(jr,Yr))},Nr.open=function(jr){_invoke(Nr.props,"onOpen",jr,_extends$1({},Nr.props,{open:!0})),Nr.setState({open:!0})},Nr.openWithTimeout=function(jr,Ur){var Gr=_extends$1({},jr);return setTimeout(function(){return Nr.open(Gr)},Ur||0)},Nr.close=function(jr){Nr.setState({open:!1}),_invoke(Nr.props,"onClose",jr,_extends$1({},Nr.props,{open:!1}))},Nr.closeWithTimeout=function(jr,Ur){var Gr=_extends$1({},jr);return setTimeout(function(){return Nr.close(Gr)},Ur||0)},Nr.handleMount=function(){_invoke(Nr.props,"onMount",null,Nr.props)},Nr.handleUnmount=function(){_invoke(Nr.props,"onUnmount",null,Nr.props)},Nr.handleTriggerRef=function(jr){Nr.triggerRef.current=jr,handleRef(Nr.props.triggerRef,jr)},Nr}var Mr=pr.prototype;return Mr.componentWillUnmount=function(){clearTimeout(this.mouseEnterTimer),clearTimeout(this.mouseLeaveTimer)},Mr.render=function(){var Dr=this.props,Br=Dr.children,Lr=Dr.eventPool,jr=Dr.mountNode,Ur=Dr.trigger,Gr=this.state.open;return React$5.createElement(React$5.Fragment,null,Gr&&React$5.createElement(React$5.Fragment,null,React$5.createElement(PortalInner$1,{innerRef:this.contentRef,mountNode:jr,onMount:this.handleMount,onUnmount:this.handleUnmount},Br),React$5.createElement(EventStack,{name:"mouseleave",on:this.handlePortalMouseLeave,pool:Lr,target:this.contentRef}),React$5.createElement(EventStack,{name:"mouseenter",on:this.handlePortalMouseEnter,pool:Lr,target:this.contentRef}),React$5.createElement(EventStack,{name:"mousedown",on:this.handleDocumentMouseDown,pool:Lr}),React$5.createElement(EventStack,{name:"click",on:this.handleDocumentClick,pool:Lr}),React$5.createElement(EventStack,{name:"keydown",on:this.handleEscape,pool:Lr})),Ur&&React$5.createElement(Ref,{innerRef:this.handleTriggerRef},React$5.cloneElement(Ur,{onBlur:this.handleTriggerBlur,onClick:this.handleTriggerClick,onFocus:this.handleTriggerFocus,onMouseLeave:this.handleTriggerMouseLeave,onMouseEnter:this.handleTriggerMouseEnter})))},pr}(ModernAutoControlledComponent);Portal.handledProps=["children","closeOnDocumentClick","closeOnEscape","closeOnPortalMouseLeave","closeOnTriggerBlur","closeOnTriggerClick","closeOnTriggerMouseLeave","defaultOpen","eventPool","mountNode","mouseEnterDelay","mouseLeaveDelay","onClose","onMount","onOpen","onUnmount","open","openOnTriggerClick","openOnTriggerFocus","openOnTriggerMouseEnter","trigger","triggerRef"];Portal.propTypes={};Portal.defaultProps={closeOnDocumentClick:!0,closeOnEscape:!0,eventPool:"default",openOnTriggerClick:!0};Portal.autoControlledProps=["open"];Portal.Inner=PortalInner$1;const Portal$1=Portal;function DimmerDimmable($r){var pr=$r.blurring,Mr=$r.className,Nr=$r.children,Dr=$r.content,Br=$r.dimmed,Lr=clsx(useKeyOnly(pr,"blurring"),useKeyOnly(Br,"dimmed"),"dimmable",Mr),jr=getUnhandledProps$1(DimmerDimmable,$r),Ur=getElementType(DimmerDimmable,$r);return React$5.createElement(Ur,_extends$1({},jr,{className:Lr}),isNil$1(Nr)?Dr:Nr)}DimmerDimmable.handledProps=["as","blurring","children","className","content","dimmed"];DimmerDimmable.propTypes={};var DimmerInner=function($r){_inheritsLoose$6(pr,$r);function pr(){for(var Nr,Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=$r.call.apply($r,[this].concat(Br))||this,Nr.containerRef=reactExports.createRef(),Nr.contentRef=reactExports.createRef(),Nr.handleClick=function(jr){var Ur=Nr.contentRef.current;_invoke(Nr.props,"onClick",jr,Nr.props),!(Ur&&Ur!==jr.target&&doesNodeContainClick$1(Ur,jr))&&_invoke(Nr.props,"onClickOutside",jr,Nr.props)},Nr}var Mr=pr.prototype;return Mr.componentDidMount=function(){var Dr=this.props.active;this.toggleStyles(Dr)},Mr.componentDidUpdate=function(Dr){var Br=this.props.active,Lr=Dr.active;Lr!==Br&&this.toggleStyles(Br)},Mr.toggleStyles=function(Dr){var Br=this.containerRef.current;!Br||!Br.style||(Dr?Br.style.setProperty("display","flex","important"):Br.style.removeProperty("display"))},Mr.render=function(){var Dr=this.props,Br=Dr.active,Lr=Dr.children,jr=Dr.className,Ur=Dr.content,Gr=Dr.disabled,Yr=Dr.inverted,Qr=Dr.page,Wn=Dr.simple,ga=Dr.verticalAlign,eo=clsx("ui",useKeyOnly(Br,"active transition visible"),useKeyOnly(Gr,"disabled"),useKeyOnly(Yr,"inverted"),useKeyOnly(Qr,"page"),useKeyOnly(Wn,"simple"),useVerticalAlignProp(ga),"dimmer",jr),_i=getUnhandledProps$1(pr,this.props),va=getElementType(pr,this.props),io=isNil$1(Lr)?Ur:Lr;return React$5.createElement(Ref,{innerRef:this.containerRef},React$5.createElement(va,_extends$1({},_i,{className:eo,onClick:this.handleClick}),io&&React$5.createElement("div",{className:"content",ref:this.contentRef},io)))},pr}(reactExports.Component);DimmerInner.handledProps=["active","as","children","className","content","disabled","inverted","onClick","onClickOutside","page","simple","verticalAlign"];DimmerInner.propTypes={};var Dimmer=function($r){_inheritsLoose$6(pr,$r);function pr(){for(var Nr,Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=$r.call.apply($r,[this].concat(Br))||this,Nr.handlePortalMount=function(){isBrowser$1()&&(document.body.classList.add("dimmed"),document.body.classList.add("dimmable"))},Nr.handlePortalUnmount=function(){isBrowser$1()&&(document.body.classList.remove("dimmed"),document.body.classList.remove("dimmable"))},Nr}var Mr=pr.prototype;return Mr.render=function(){var Dr=this.props,Br=Dr.active,Lr=Dr.page,jr=getUnhandledProps$1(pr,this.props);return Lr?React$5.createElement(Portal$1,{closeOnEscape:!1,closeOnDocumentClick:!1,onMount:this.handlePortalMount,onUnmount:this.handlePortalUnmount,open:Br,openOnTriggerClick:!1},React$5.createElement(DimmerInner,_extends$1({},jr,{active:Br,page:Lr}))):React$5.createElement(DimmerInner,_extends$1({},jr,{active:Br,page:Lr}))},pr}(reactExports.Component);Dimmer.handledProps=["active","page"];Dimmer.propTypes={};Dimmer.Dimmable=DimmerDimmable;Dimmer.Inner=DimmerInner;Dimmer.create=createShorthandFactory(Dimmer,function($r){return{content:$r}});function ImageGroup($r){var pr=$r.children,Mr=$r.className,Nr=$r.content,Dr=$r.size,Br=clsx("ui",Dr,Mr,"images"),Lr=getUnhandledProps$1(ImageGroup,$r),jr=getElementType(ImageGroup,$r);return React$5.createElement(jr,_extends$1({},Lr,{className:Br}),isNil$1(pr)?Nr:pr)}ImageGroup.handledProps=["as","children","className","content","size"];ImageGroup.propTypes={};function Image$2($r){var pr=$r.avatar,Mr=$r.bordered,Nr=$r.centered,Dr=$r.children,Br=$r.circular,Lr=$r.className,jr=$r.content,Ur=$r.dimmer,Gr=$r.disabled,Yr=$r.floated,Qr=$r.fluid,Wn=$r.hidden,ga=$r.href,eo=$r.inline,_i=$r.label,va=$r.rounded,io=$r.size,no=$r.spaced,so=$r.verticalAlign,ao=$r.wrapped,fo=$r.ui,lo=clsx(useKeyOnly(fo,"ui"),io,useKeyOnly(pr,"avatar"),useKeyOnly(Mr,"bordered"),useKeyOnly(Br,"circular"),useKeyOnly(Nr,"centered"),useKeyOnly(Gr,"disabled"),useKeyOnly(Qr,"fluid"),useKeyOnly(Wn,"hidden"),useKeyOnly(eo,"inline"),useKeyOnly(va,"rounded"),useKeyOrValueAndKey(no,"spaced"),useValueAndKey(Yr,"floated"),useVerticalAlignProp(so),"image",Lr),oo=getUnhandledProps$1(Image$2,$r),po=partitionHTMLProps(oo,{htmlProps:htmlImageProps}),mo=po[0],$o=po[1],Xn=getElementType(Image$2,$r,function(){if(!isNil(Ur)||!isNil(_i)||!isNil(ao)||!isNil$1(Dr))return"div"});return isNil$1(Dr)?isNil$1(jr)?Xn==="img"?React$5.createElement(Xn,_extends$1({},$o,mo,{className:lo})):React$5.createElement(Xn,_extends$1({},$o,{className:lo,href:ga}),Dimmer.create(Ur,{autoGenerateKey:!1}),Label$1.create(_i,{autoGenerateKey:!1}),React$5.createElement("img",mo)):React$5.createElement(Xn,_extends$1({},oo,{className:lo}),jr):React$5.createElement(Xn,_extends$1({},oo,{className:lo}),Dr)}Image$2.handledProps=["as","avatar","bordered","centered","children","circular","className","content","dimmer","disabled","floated","fluid","hidden","href","inline","label","rounded","size","spaced","ui","verticalAlign","wrapped"];Image$2.Group=ImageGroup;Image$2.propTypes={};Image$2.defaultProps={as:"img",ui:!0};Image$2.create=createShorthandFactory(Image$2,function($r){return{src:$r}});function LabelDetail($r){var pr=$r.children,Mr=$r.className,Nr=$r.content,Dr=clsx("detail",Mr),Br=getUnhandledProps$1(LabelDetail,$r),Lr=getElementType(LabelDetail,$r);return React$5.createElement(Lr,_extends$1({},Br,{className:Dr}),isNil$1(pr)?Nr:pr)}LabelDetail.handledProps=["as","children","className","content"];LabelDetail.propTypes={};LabelDetail.create=createShorthandFactory(LabelDetail,function($r){return{content:$r}});function LabelGroup($r){var pr=$r.children,Mr=$r.circular,Nr=$r.className,Dr=$r.color,Br=$r.content,Lr=$r.size,jr=$r.tag,Ur=clsx("ui",Dr,Lr,useKeyOnly(Mr,"circular"),useKeyOnly(jr,"tag"),"labels",Nr),Gr=getUnhandledProps$1(LabelGroup,$r),Yr=getElementType(LabelGroup,$r);return React$5.createElement(Yr,_extends$1({},Gr,{className:Ur}),isNil$1(pr)?Br:pr)}LabelGroup.handledProps=["as","children","circular","className","color","content","size","tag"];LabelGroup.propTypes={};var Label$1=function($r){_inheritsLoose$6(pr,$r);function pr(){for(var Nr,Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=$r.call.apply($r,[this].concat(Br))||this,Nr.handleClick=function(jr){var Ur=Nr.props.onClick;Ur&&Ur(jr,Nr.props)},Nr.handleIconOverrides=function(jr){return{onClick:function(Gr){_invoke(jr,"onClick",Gr),_invoke(Nr.props,"onRemove",Gr,Nr.props)}}},Nr}var Mr=pr.prototype;return Mr.render=function(){var Dr=this.props,Br=Dr.active,Lr=Dr.attached,jr=Dr.basic,Ur=Dr.children,Gr=Dr.circular,Yr=Dr.className,Qr=Dr.color,Wn=Dr.content,ga=Dr.corner,eo=Dr.detail,_i=Dr.empty,va=Dr.floating,io=Dr.horizontal,no=Dr.icon,so=Dr.image,ao=Dr.onRemove,fo=Dr.pointing,lo=Dr.prompt,oo=Dr.removeIcon,po=Dr.ribbon,mo=Dr.size,$o=Dr.tag,Xn=fo===!0&&"pointing"||(fo==="left"||fo==="right")&&fo+" pointing"||(fo==="above"||fo==="below")&&"pointing "+fo,Fr=clsx("ui",Qr,Xn,mo,useKeyOnly(Br,"active"),useKeyOnly(jr,"basic"),useKeyOnly(Gr,"circular"),useKeyOnly(_i,"empty"),useKeyOnly(va,"floating"),useKeyOnly(io,"horizontal"),useKeyOnly(so===!0,"image"),useKeyOnly(lo,"prompt"),useKeyOnly($o,"tag"),useKeyOrValueAndKey(ga,"corner"),useKeyOrValueAndKey(po,"ribbon"),useValueAndKey(Lr,"attached"),"label",Yr),Vr=getUnhandledProps$1(pr,this.props),Wr=getElementType(pr,this.props);if(!isNil$1(Ur))return React$5.createElement(Wr,_extends$1({},Vr,{className:Fr,onClick:this.handleClick}),Ur);var Jr=isUndefined(oo)?"delete":oo;return React$5.createElement(Wr,_extends$1({className:Fr,onClick:this.handleClick},Vr),Icon$2.create(no,{autoGenerateKey:!1}),typeof so!="boolean"&&Image$2.create(so,{autoGenerateKey:!1}),Wn,LabelDetail.create(eo,{autoGenerateKey:!1}),ao&&Icon$2.create(Jr,{autoGenerateKey:!1,overrideProps:this.handleIconOverrides}))},pr}(reactExports.Component);Label$1.handledProps=["active","as","attached","basic","children","circular","className","color","content","corner","detail","empty","floating","horizontal","icon","image","onClick","onRemove","pointing","prompt","removeIcon","ribbon","size","tag"];Label$1.propTypes={};Label$1.Detail=LabelDetail;Label$1.Group=LabelGroup;Label$1.create=createShorthandFactory(Label$1,function($r){return{content:$r}});function ButtonContent($r){var pr=$r.children,Mr=$r.className,Nr=$r.content,Dr=$r.hidden,Br=$r.visible,Lr=clsx(useKeyOnly(Br,"visible"),useKeyOnly(Dr,"hidden"),"content",Mr),jr=getUnhandledProps$1(ButtonContent,$r),Ur=getElementType(ButtonContent,$r);return React$5.createElement(Ur,_extends$1({},jr,{className:Lr}),isNil$1(pr)?Nr:pr)}ButtonContent.handledProps=["as","children","className","content","hidden","visible"];ButtonContent.propTypes={};function ButtonGroup($r){var pr=$r.attached,Mr=$r.basic,Nr=$r.buttons,Dr=$r.children,Br=$r.className,Lr=$r.color,jr=$r.compact,Ur=$r.content,Gr=$r.floated,Yr=$r.fluid,Qr=$r.icon,Wn=$r.inverted,ga=$r.labeled,eo=$r.negative,_i=$r.positive,va=$r.primary,io=$r.secondary,no=$r.size,so=$r.toggle,ao=$r.vertical,fo=$r.widths,lo=clsx("ui",Lr,no,useKeyOnly(Mr,"basic"),useKeyOnly(jr,"compact"),useKeyOnly(Yr,"fluid"),useKeyOnly(Qr,"icon"),useKeyOnly(Wn,"inverted"),useKeyOnly(ga,"labeled"),useKeyOnly(eo,"negative"),useKeyOnly(_i,"positive"),useKeyOnly(va,"primary"),useKeyOnly(io,"secondary"),useKeyOnly(so,"toggle"),useKeyOnly(ao,"vertical"),useKeyOrValueAndKey(pr,"attached"),useValueAndKey(Gr,"floated"),useWidthProp(fo),"buttons",Br),oo=getUnhandledProps$1(ButtonGroup,$r),po=getElementType(ButtonGroup,$r);return isNil(Nr)?React$5.createElement(po,_extends$1({},oo,{className:lo}),isNil$1(Dr)?Ur:Dr):React$5.createElement(po,_extends$1({},oo,{className:lo}),map(Nr,function(mo){return Button$2.create(mo)}))}ButtonGroup.handledProps=["as","attached","basic","buttons","children","className","color","compact","content","floated","fluid","icon","inverted","labeled","negative","positive","primary","secondary","size","toggle","vertical","widths"];ButtonGroup.propTypes={};function ButtonOr($r){var pr=$r.className,Mr=$r.text,Nr=clsx("or",pr),Dr=getUnhandledProps$1(ButtonOr,$r),Br=getElementType(ButtonOr,$r);return React$5.createElement(Br,_extends$1({},Dr,{className:Nr,"data-text":Mr}))}ButtonOr.handledProps=["as","className","text"];ButtonOr.propTypes={};var Button$1=function($r){_inheritsLoose$6(pr,$r);function pr(){for(var Nr,Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=$r.call.apply($r,[this].concat(Br))||this,Nr.ref=reactExports.createRef(),Nr.computeElementType=function(){var jr=Nr.props,Ur=jr.attached,Gr=jr.label;if(!isNil(Ur)||!isNil(Gr))return"div"},Nr.computeTabIndex=function(jr){var Ur=Nr.props,Gr=Ur.disabled,Yr=Ur.tabIndex;if(!isNil(Yr))return Yr;if(Gr)return-1;if(jr==="div")return 0},Nr.focus=function(jr){return _invoke(Nr.ref.current,"focus",jr)},Nr.handleClick=function(jr){var Ur=Nr.props.disabled;if(Ur){jr.preventDefault();return}_invoke(Nr.props,"onClick",jr,Nr.props)},Nr.hasIconClass=function(){var jr=Nr.props,Ur=jr.labelPosition,Gr=jr.children,Yr=jr.content,Qr=jr.icon;return Qr===!0?!0:Qr&&(Ur||isNil$1(Gr)&&isNil(Yr))},Nr}var Mr=pr.prototype;return Mr.computeButtonAriaRole=function(Dr){var Br=this.props.role;if(!isNil(Br))return Br;if(Dr!=="button")return"button"},Mr.render=function(){var Dr=this.props,Br=Dr.active,Lr=Dr.animated,jr=Dr.attached,Ur=Dr.basic,Gr=Dr.children,Yr=Dr.circular,Qr=Dr.className,Wn=Dr.color,ga=Dr.compact,eo=Dr.content,_i=Dr.disabled,va=Dr.floated,io=Dr.fluid,no=Dr.icon,so=Dr.inverted,ao=Dr.label,fo=Dr.labelPosition,lo=Dr.loading,oo=Dr.negative,po=Dr.positive,mo=Dr.primary,$o=Dr.secondary,Xn=Dr.size,Fr=Dr.toggle,Vr=Dr.type,Wr=clsx(Wn,Xn,useKeyOnly(Br,"active"),useKeyOnly(Ur,"basic"),useKeyOnly(Yr,"circular"),useKeyOnly(ga,"compact"),useKeyOnly(io,"fluid"),useKeyOnly(this.hasIconClass(),"icon"),useKeyOnly(so,"inverted"),useKeyOnly(lo,"loading"),useKeyOnly(oo,"negative"),useKeyOnly(po,"positive"),useKeyOnly(mo,"primary"),useKeyOnly($o,"secondary"),useKeyOnly(Fr,"toggle"),useKeyOrValueAndKey(Lr,"animated"),useKeyOrValueAndKey(jr,"attached")),Jr=clsx(useKeyOrValueAndKey(fo||!!ao,"labeled")),Gn=clsx(useKeyOnly(_i,"disabled"),useValueAndKey(va,"floated")),to=getUnhandledProps$1(pr,this.props),ro=getElementType(pr,this.props,this.computeElementType),Un=this.computeTabIndex(ro);if(!isNil(ao)){var Hr=clsx("ui",Wr,"button",Qr),Xr=clsx("ui",Jr,"button",Qr,Gn),co=Label$1.create(ao,{defaultProps:{basic:!0,pointing:fo==="left"?"right":"left"},autoGenerateKey:!1});return React$5.createElement(ro,_extends$1({},to,{className:Xr,onClick:this.handleClick}),fo==="left"&&co,React$5.createElement(Ref,{innerRef:this.ref},React$5.createElement("button",{className:Hr,"aria-pressed":Fr?!!Br:void 0,disabled:_i,type:Vr,tabIndex:Un},Icon$2.create(no,{autoGenerateKey:!1})," ",eo)),(fo==="right"||!fo)&&co)}var ho=clsx("ui",Wr,Gn,Jr,"button",Qr),go=!isNil$1(Gr),bo=this.computeButtonAriaRole(ro);return React$5.createElement(Ref,{innerRef:this.ref},React$5.createElement(ro,_extends$1({},to,{className:ho,"aria-pressed":Fr?!!Br:void 0,disabled:_i&&ro==="button"||void 0,onClick:this.handleClick,role:bo,type:Vr,tabIndex:Un}),go&&Gr,!go&&Icon$2.create(no,{autoGenerateKey:!1}),!go&&eo))},pr}(reactExports.Component);Button$1.handledProps=["active","animated","as","attached","basic","children","circular","className","color","compact","content","disabled","floated","fluid","icon","inverted","label","labelPosition","loading","negative","onClick","positive","primary","role","secondary","size","tabIndex","toggle","type"];Button$1.propTypes={};Button$1.defaultProps={as:"button"};Button$1.Content=ButtonContent;Button$1.Group=ButtonGroup;Button$1.Or=ButtonOr;Button$1.create=createShorthandFactory(Button$1,function($r){return{content:$r}});const Button$2=Button$1;function arrayReduce($r,pr,Mr,Nr){var Dr=-1,Br=$r==null?0:$r.length;for(Nr&&Br&&(Mr=$r[++Dr]);++Dr<Br;)Mr=pr(Mr,$r[Dr],Dr,$r);return Mr}function baseReduce($r,pr,Mr,Nr,Dr){return Dr($r,function(Br,Lr,jr){Mr=Nr?(Nr=!1,Br):pr(Mr,Br,Lr,jr)}),Mr}function reduce($r,pr,Mr){var Nr=isArray$1($r)?arrayReduce:baseReduce,Dr=arguments.length<3;return Nr($r,baseIteratee(pr),Mr,Dr,baseEach$1)}var shallowequal,hasRequiredShallowequal;function requireShallowequal(){return hasRequiredShallowequal||(hasRequiredShallowequal=1,shallowequal=function(pr,Mr,Nr,Dr){var Br=Nr?Nr.call(Dr,pr,Mr):void 0;if(Br!==void 0)return!!Br;if(pr===Mr)return!0;if(typeof pr!="object"||!pr||typeof Mr!="object"||!Mr)return!1;var Lr=Object.keys(pr),jr=Object.keys(Mr);if(Lr.length!==jr.length)return!1;for(var Ur=Object.prototype.hasOwnProperty.bind(Mr),Gr=0;Gr<Lr.length;Gr++){var Yr=Lr[Gr];if(!Ur(Yr))return!1;var Qr=pr[Yr],Wn=Mr[Yr];if(Br=Nr?Nr.call(Dr,Qr,Wn,Yr):void 0,Br===!1||Br===void 0&&Qr!==Wn)return!1}return!0}),shallowequal}var shallowequalExports=requireShallowequal();const shallowEqual=getDefaultExportFromCjs$1(shallowequalExports);function basePropertyOf($r){return function(pr){return $r==null?void 0:$r[pr]}}var deburredLetters={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},deburrLetter=basePropertyOf(deburredLetters);const deburrLetter$1=deburrLetter;var reLatin=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,rsComboMarksRange$1="\\u0300-\\u036f",reComboHalfMarksRange$1="\\ufe20-\\ufe2f",rsComboSymbolsRange$1="\\u20d0-\\u20ff",rsComboRange$1=rsComboMarksRange$1+reComboHalfMarksRange$1+rsComboSymbolsRange$1,rsCombo$1="["+rsComboRange$1+"]",reComboMark=RegExp(rsCombo$1,"g");function deburr($r){return $r=toString($r),$r&&$r.replace(reLatin,deburrLetter$1).replace(reComboMark,"")}function set($r,pr,Mr){return $r==null?$r:baseSet($r,pr,Mr)}var Checkbox=function($r){_inheritsLoose$6(pr,$r);function pr(){for(var Nr,Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=$r.call.apply($r,[this].concat(Br))||this,Nr.inputRef=reactExports.createRef(),Nr.labelRef=reactExports.createRef(),Nr.canToggle=function(){var jr=Nr.props,Ur=jr.disabled,Gr=jr.radio,Yr=jr.readOnly,Qr=Nr.state.checked;return!Ur&&!Yr&&!(Gr&&Qr)},Nr.computeTabIndex=function(){var jr=Nr.props,Ur=jr.disabled,Gr=jr.tabIndex;return isNil(Gr)?Ur?-1:0:Gr},Nr.handleClick=function(jr){var Ur=Nr.props.id,Gr=Nr.state,Yr=Gr.checked,Qr=Gr.indeterminate,Wn=_invoke(Nr.inputRef.current,"contains",jr.target),ga=_invoke(Nr.labelRef.current,"contains",jr.target),eo=!ga&&!Wn,_i=!isNil(Ur),va=ga&&_i;va||_invoke(Nr.props,"onClick",jr,_extends$1({},Nr.props,{checked:!Yr,indeterminate:!!Qr})),Nr.isClickFromMouse&&(Nr.isClickFromMouse=!1,ga&&!_i&&Nr.handleChange(jr),eo&&Nr.handleChange(jr),ga&&_i&&jr.stopPropagation())},Nr.handleChange=function(jr){var Ur=Nr.state.checked;Nr.canToggle()&&(_invoke(Nr.props,"onChange",jr,_extends$1({},Nr.props,{checked:!Ur,indeterminate:!1})),Nr.setState({checked:!Ur,indeterminate:!1}))},Nr.handleMouseDown=function(jr){var Ur=Nr.state,Gr=Ur.checked,Yr=Ur.indeterminate;_invoke(Nr.props,"onMouseDown",jr,_extends$1({},Nr.props,{checked:!!Gr,indeterminate:!!Yr})),jr.defaultPrevented||_invoke(Nr.inputRef.current,"focus"),jr.preventDefault()},Nr.handleMouseUp=function(jr){var Ur=Nr.state,Gr=Ur.checked,Yr=Ur.indeterminate;Nr.isClickFromMouse=!0,_invoke(Nr.props,"onMouseUp",jr,_extends$1({},Nr.props,{checked:!!Gr,indeterminate:!!Yr}))},Nr.setIndeterminate=function(){var jr=Nr.state.indeterminate;set(Nr.inputRef,"current.indeterminate",!!jr)},Nr}var Mr=pr.prototype;return Mr.componentDidMount=function(){this.setIndeterminate()},Mr.componentDidUpdate=function(){this.setIndeterminate()},Mr.render=function(){var Dr=this.props,Br=Dr.className,Lr=Dr.disabled,jr=Dr.label,Ur=Dr.id,Gr=Dr.name,Yr=Dr.radio,Qr=Dr.readOnly,Wn=Dr.slider,ga=Dr.toggle,eo=Dr.type,_i=Dr.value,va=this.state,io=va.checked,no=va.indeterminate,so=clsx("ui",useKeyOnly(io,"checked"),useKeyOnly(Lr,"disabled"),useKeyOnly(no,"indeterminate"),useKeyOnly(isNil(jr),"fitted"),useKeyOnly(Yr,"radio"),useKeyOnly(Qr,"read-only"),useKeyOnly(Wn,"slider"),useKeyOnly(ga,"toggle"),"checkbox",Br),ao=getUnhandledProps$1(pr,this.props),fo=getElementType(pr,this.props),lo=partitionHTMLProps(ao,{htmlProps:htmlInputAttrs}),oo=lo[0],po=lo[1],mo=createHTMLLabel(jr,{defaultProps:{htmlFor:Ur},autoGenerateKey:!1})||React$5.createElement("label",{htmlFor:Ur});return React$5.createElement(fo,_extends$1({},po,{className:so,onClick:this.handleClick,onChange:this.handleChange,onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp}),React$5.createElement(Ref,{innerRef:this.inputRef},React$5.createElement("input",_extends$1({},oo,{checked:io,className:"hidden",disabled:Lr,id:Ur,name:Gr,readOnly:!0,tabIndex:this.computeTabIndex(),type:eo,value:_i}))),React$5.createElement(Ref,{innerRef:this.labelRef},mo))},pr}(ModernAutoControlledComponent);Checkbox.handledProps=["as","checked","className","defaultChecked","defaultIndeterminate","disabled","fitted","id","indeterminate","label","name","onChange","onClick","onMouseDown","onMouseUp","radio","readOnly","slider","tabIndex","toggle","type","value"];Checkbox.propTypes={};Checkbox.defaultProps={type:"checkbox"};Checkbox.autoControlledProps=["checked","indeterminate"];function Radio($r){var pr=$r.slider,Mr=$r.toggle,Nr=$r.type,Dr=getUnhandledProps$1(Radio,$r),Br=!(pr||Mr)||void 0;return React$5.createElement(Checkbox,_extends$1({},Dr,{type:Nr,radio:Br,slider:pr,toggle:Mr}))}Radio.handledProps=["slider","toggle","type"];Radio.propTypes={};Radio.defaultProps={type:"radio"};function compact($r){for(var pr=-1,Mr=$r==null?0:$r.length,Nr=0,Dr=[];++pr<Mr;){var Br=$r[pr];Br&&(Dr[Nr++]=Br)}return Dr}function arrayEvery($r,pr){for(var Mr=-1,Nr=$r==null?0:$r.length;++Mr<Nr;)if(!pr($r[Mr],Mr,$r))return!1;return!0}function baseEvery($r,pr){var Mr=!0;return baseEach$1($r,function(Nr,Dr,Br){return Mr=!!pr(Nr,Dr,Br),Mr}),Mr}function every($r,pr,Mr){var Nr=isArray$1($r)?arrayEvery:baseEvery;return Mr&&isIterateeCall($r,pr,Mr)&&(pr=void 0),Nr($r,baseIteratee(pr))}function dropRight($r,pr,Mr){var Nr=$r==null?0:$r.length;return Nr?(pr=Mr||pr===void 0?1:toInteger(pr),pr=Nr-pr,baseSlice($r,0,pr<0?0:pr)):[]}var asciiSize=baseProperty("length");const asciiSize$1=asciiSize;var rsAstralRange="\\ud800-\\udfff",rsComboMarksRange="\\u0300-\\u036f",reComboHalfMarksRange="\\ufe20-\\ufe2f",rsComboSymbolsRange="\\u20d0-\\u20ff",rsComboRange=rsComboMarksRange+reComboHalfMarksRange+rsComboSymbolsRange,rsVarRange="\\ufe0e\\ufe0f",rsAstral="["+rsAstralRange+"]",rsCombo="["+rsComboRange+"]",rsFitz="\\ud83c[\\udffb-\\udfff]",rsModifier="(?:"+rsCombo+"|"+rsFitz+")",rsNonAstral="[^"+rsAstralRange+"]",rsRegional="(?:\\ud83c[\\udde6-\\uddff]){2}",rsSurrPair="[\\ud800-\\udbff][\\udc00-\\udfff]",rsZWJ="\\u200d",reOptMod=rsModifier+"?",rsOptVar="["+rsVarRange+"]?",rsOptJoin="(?:"+rsZWJ+"(?:"+[rsNonAstral,rsRegional,rsSurrPair].join("|")+")"+rsOptVar+reOptMod+")*",rsSeq=rsOptVar+reOptMod+rsOptJoin,rsSymbol="(?:"+[rsNonAstral+rsCombo+"?",rsCombo,rsRegional,rsSurrPair,rsAstral].join("|")+")",reUnicode=RegExp(rsFitz+"(?="+rsFitz+")|"+rsSymbol+rsSeq,"g");function unicodeSize($r){for(var pr=reUnicode.lastIndex=0;reUnicode.test($r);)++pr;return pr}function stringSize($r){return hasUnicode($r)?unicodeSize($r):asciiSize$1($r)}var mapTag="[object Map]",setTag="[object Set]";function size($r){if($r==null)return 0;if(isArrayLike($r))return isString($r)?stringSize($r):$r.length;var pr=getTag$1($r);return pr==mapTag||pr==setTag?$r.size:baseKeys($r).length}var union=baseRest(function($r){return baseUniq(baseFlatten($r,1,isArrayLikeObject,!0))});const _union=union;var Flag=function($r){_inheritsLoose$6(pr,$r);function pr(){return $r.apply(this,arguments)||this}var Mr=pr.prototype;return Mr.render=function(){var Dr=this.props,Br=Dr.className,Lr=Dr.name,jr=clsx(Lr,"flag",Br),Ur=getUnhandledProps$1(pr,this.props),Gr=getElementType(pr,this.props);return React$5.createElement(Gr,_extends$1({},Ur,{className:jr}))},pr}(reactExports.PureComponent);Flag.handledProps=["as","className","name"];Flag.propTypes={};Flag.defaultProps={as:"i"};Flag.create=createShorthandFactory(Flag,function($r){return{name:$r}});const Flag$1=Flag;function DropdownDivider($r){var pr=$r.className,Mr=clsx("divider",pr),Nr=getUnhandledProps$1(DropdownDivider,$r),Dr=getElementType(DropdownDivider,$r);return React$5.createElement(Dr,_extends$1({},Nr,{className:Mr}))}DropdownDivider.handledProps=["as","className"];DropdownDivider.propTypes={};var DropdownItem=function($r){_inheritsLoose$6(pr,$r);function pr(){for(var Nr,Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=$r.call.apply($r,[this].concat(Br))||this,Nr.handleClick=function(jr){_invoke(Nr.props,"onClick",jr,Nr.props)},Nr}var Mr=pr.prototype;return Mr.render=function(){var Dr=this.props,Br=Dr.active,Lr=Dr.children,jr=Dr.className,Ur=Dr.content,Gr=Dr.disabled,Yr=Dr.description,Qr=Dr.flag,Wn=Dr.icon,ga=Dr.image,eo=Dr.label,_i=Dr.selected,va=Dr.text,io=clsx(useKeyOnly(Br,"active"),useKeyOnly(Gr,"disabled"),useKeyOnly(_i,"selected"),"item",jr),no=isNil(Wn)?someByType(Lr,"DropdownMenu")&&"dropdown":Wn,so=getUnhandledProps$1(pr,this.props),ao=getElementType(pr,this.props),fo={role:"option","aria-disabled":Gr,"aria-checked":Br,"aria-selected":_i};if(!isNil$1(Lr))return React$5.createElement(ao,_extends$1({},so,fo,{className:io,onClick:this.handleClick}),Lr);var lo=Flag$1.create(Qr,{autoGenerateKey:!1}),oo=Icon$2.create(no,{autoGenerateKey:!1}),po=Image$2.create(ga,{autoGenerateKey:!1}),mo=Label$1.create(eo,{autoGenerateKey:!1}),$o=createShorthand("span",function(Fr){return{children:Fr}},Yr,{defaultProps:{className:"description"},autoGenerateKey:!1}),Xn=createShorthand("span",function(Fr){return{children:Fr}},isNil$1(Ur)?va:Ur,{defaultProps:{className:"text"},autoGenerateKey:!1});return React$5.createElement(ao,_extends$1({},so,fo,{className:io,onClick:this.handleClick}),po,oo,lo,mo,$o,Xn)},pr}(reactExports.Component);DropdownItem.handledProps=["active","as","children","className","content","description","disabled","flag","icon","image","label","onClick","selected","text","value"];DropdownItem.propTypes={};DropdownItem.create=createShorthandFactory(DropdownItem,function($r){return $r});const DropdownItem$1=DropdownItem;function DropdownHeader($r){var pr=$r.children,Mr=$r.className,Nr=$r.content,Dr=$r.icon,Br=clsx("header",Mr),Lr=getUnhandledProps$1(DropdownHeader,$r),jr=getElementType(DropdownHeader,$r);return isNil$1(pr)?React$5.createElement(jr,_extends$1({},Lr,{className:Br}),Icon$2.create(Dr,{autoGenerateKey:!1}),Nr):React$5.createElement(jr,_extends$1({},Lr,{className:Br}),pr)}DropdownHeader.handledProps=["as","children","className","content","icon"];DropdownHeader.propTypes={};DropdownHeader.create=createShorthandFactory(DropdownHeader,function($r){return{content:$r}});function DropdownMenu($r){var pr=$r.children,Mr=$r.className,Nr=$r.content,Dr=$r.direction,Br=$r.open,Lr=$r.scrolling,jr=clsx(Dr,useKeyOnly(Br,"visible"),useKeyOnly(Lr,"scrolling"),"menu transition",Mr),Ur=getUnhandledProps$1(DropdownMenu,$r),Gr=getElementType(DropdownMenu,$r);return React$5.createElement(Gr,_extends$1({},Ur,{className:jr}),isNil$1(pr)?Nr:pr)}DropdownMenu.handledProps=["as","children","className","content","direction","open","scrolling"];DropdownMenu.propTypes={};var DropdownSearchInput=function($r){_inheritsLoose$6(pr,$r);function pr(){for(var Nr,Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=$r.call.apply($r,[this].concat(Br))||this,Nr.handleChange=function(jr){var Ur=get(jr,"target.value");_invoke(Nr.props,"onChange",jr,_extends$1({},Nr.props,{value:Ur}))},Nr}var Mr=pr.prototype;return Mr.render=function(){var Dr=this.props,Br=Dr.autoComplete,Lr=Dr.className,jr=Dr.tabIndex,Ur=Dr.type,Gr=Dr.value,Yr=clsx("search",Lr),Qr=getUnhandledProps$1(pr,this.props);return React$5.createElement("input",_extends$1({},Qr,{"aria-autocomplete":"list",autoComplete:Br,className:Yr,onChange:this.handleChange,tabIndex:jr,type:Ur,value:Gr}))},pr}(reactExports.Component);DropdownSearchInput.handledProps=["as","autoComplete","className","tabIndex","type","value"];DropdownSearchInput.propTypes={};DropdownSearchInput.defaultProps={autoComplete:"off",type:"text"};DropdownSearchInput.create=createShorthandFactory(DropdownSearchInput,function($r){return{type:$r}});const DropdownSearchInput$1=DropdownSearchInput;function DropdownText($r){var pr=$r.children,Mr=$r.className,Nr=$r.content,Dr=clsx("divider",Mr),Br=getUnhandledProps$1(DropdownText,$r),Lr=getElementType(DropdownText,$r);return React$5.createElement(Lr,_extends$1({"aria-atomic":!0,"aria-live":"polite",role:"alert"},Br,{className:Dr}),isNil$1(pr)?Nr:pr)}DropdownText.handledProps=["as","children","className","content"];DropdownText.propTypes={};DropdownText.create=createShorthandFactory(DropdownText,function($r){return{content:$r}});var reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reHasRegExpChar=RegExp(reRegExpChar.source);function escapeRegExp($r){return $r=toString($r),$r&&reHasRegExpChar.test($r)?$r.replace(reRegExpChar,"\\$&"):$r}function getMenuOptions($r){var pr=$r.additionLabel,Mr=$r.additionPosition,Nr=$r.allowAdditions,Dr=$r.deburr,Br=$r.multiple,Lr=$r.options,jr=$r.search,Ur=$r.searchQuery,Gr=$r.value,Yr=Lr;if(Br&&(Yr=filter(Yr,function(_i){return!includes(Gr,_i.value)})),jr&&Ur)if(isFunction(jr))Yr=jr(Yr,Ur);else{var Qr=Dr?deburr(Ur):Ur,Wn=new RegExp(escapeRegExp(Qr),"i");Yr=filter(Yr,function(_i){return Wn.test(Dr?deburr(_i.text):_i.text)})}if(Nr&&jr&&Ur&&!some(Yr,{text:Ur})){var ga=React$5.isValidElement(pr)?React$5.cloneElement(pr,{key:"addition-label"}):pr||"",eo={key:"addition",text:[ga,React$5.createElement("b",{key:"addition-query"},Ur)],value:Ur,className:"addition","data-additional":!0};Mr==="top"?Yr.unshift(eo):Yr.push(eo)}return Yr}getMenuOptions.handledProps=[];function getSelectedIndex($r){var pr=$r.additionLabel,Mr=$r.additionPosition,Nr=$r.allowAdditions,Dr=$r.deburr,Br=$r.multiple,Lr=$r.options,jr=$r.search,Ur=$r.searchQuery,Gr=$r.selectedIndex,Yr=$r.value,Qr=getMenuOptions({value:Yr,options:Lr,searchQuery:Ur,additionLabel:pr,additionPosition:Mr,allowAdditions:Nr,deburr:Dr,multiple:Br,search:jr}),Wn=reduce(Qr,function(va,io,no){return io.disabled||va.push(no),va},[]),ga;if(!Gr||Gr<0){var eo=Wn[0];ga=Br?eo:findIndex(Qr,["value",Yr])||Wn[0]}else if(Br)ga=_find(Wn,function(va){return va>=Gr}),Gr>=Qr.length-1&&(ga=Wn[Wn.length-1]);else{var _i=findIndex(Qr,["value",Yr]);ga=includes(Wn,_i)?_i:void 0}return(!ga||ga<0)&&(ga=Wn[0]),ga}var getKeyOrValue=function(pr,Mr){return isNil(pr)?Mr:pr},getKeyAndValues=function(pr){return pr&&pr.map(function(Mr){return _pick(Mr,["key","value"])})};function renderItemContent($r){var pr=$r.flag,Mr=$r.image,Nr=$r.text;return isFunction(Nr)?Nr:{content:React$5.createElement(React$5.Fragment,null,Flag$1.create(pr),Image$2.create(Mr),Nr)}}var Dropdown=function($r){_inheritsLoose$6(pr,$r);function pr(){for(var Nr,Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=$r.call.apply($r,[this].concat(Br))||this,Nr.searchRef=reactExports.createRef(),Nr.sizerRef=reactExports.createRef(),Nr.ref=reactExports.createRef(),Nr.handleChange=function(jr,Ur){_invoke(Nr.props,"onChange",jr,_extends$1({},Nr.props,{value:Ur}))},Nr.closeOnChange=function(jr){var Ur=Nr.props,Gr=Ur.closeOnChange,Yr=Ur.multiple,Qr=isUndefined(Gr)?!Yr:Gr;Qr&&Nr.close(jr,noop)},Nr.closeOnEscape=function(jr){Nr.props.closeOnEscape&&keyboardKey.getCode(jr)===keyboardKey.Escape&&(jr.preventDefault(),Nr.close(jr))},Nr.moveSelectionOnKeyDown=function(jr){var Ur,Gr=Nr.props,Yr=Gr.multiple,Qr=Gr.selectOnNavigation,Wn=Nr.state.open;if(Wn){var ga=(Ur={},Ur[keyboardKey.ArrowDown]=1,Ur[keyboardKey.ArrowUp]=-1,Ur),eo=ga[keyboardKey.getCode(jr)];if(eo!==void 0){jr.preventDefault();var _i=Nr.getSelectedIndexAfterMove(eo);!Yr&&Qr&&Nr.makeSelectedItemActive(jr,_i),Nr.setState({selectedIndex:_i})}}},Nr.openOnSpace=function(jr){var Ur,Gr,Yr,Qr=Nr.state.focus&&!Nr.state.open&&keyboardKey.getCode(jr)===keyboardKey.Spacebar,Wn=((Ur=jr.target)==null?void 0:Ur.tagName)!=="INPUT"&&((Gr=jr.target)==null?void 0:Gr.tagName)!=="TEXTAREA"&&((Yr=jr.target)==null?void 0:Yr.isContentEditable)!==!0;Qr&&(Wn&&jr.preventDefault(),Nr.open(jr))},Nr.openOnArrow=function(jr){var Ur=Nr.state,Gr=Ur.focus,Yr=Ur.open;if(Gr&&!Yr){var Qr=keyboardKey.getCode(jr);(Qr===keyboardKey.ArrowDown||Qr===keyboardKey.ArrowUp)&&(jr.preventDefault(),Nr.open(jr))}},Nr.makeSelectedItemActive=function(jr,Ur){var Gr=Nr.state,Yr=Gr.open,Qr=Gr.value,Wn=Nr.props.multiple,ga=Nr.getSelectedItem(Ur),eo=get(ga,"value"),_i=get(ga,"disabled");if(isNil(eo)||!Yr||_i)return Qr;var va=Wn?_union(Qr,[eo]):eo,io=Wn?!!_difference(va,Qr).length:va!==Qr;return io&&(Nr.setState({value:va}),Nr.handleChange(jr,va),ga["data-additional"]&&_invoke(Nr.props,"onAddItem",jr,_extends$1({},Nr.props,{value:eo}))),Qr},Nr.selectItemOnEnter=function(jr){var Ur=Nr.props.search,Gr=Nr.state,Yr=Gr.open,Qr=Gr.selectedIndex;if(Yr){var Wn=keyboardKey.getCode(jr)===keyboardKey.Enter||!Ur&&keyboardKey.getCode(jr)===keyboardKey.Spacebar;if(Wn){jr.preventDefault();var ga=size(getMenuOptions({value:Nr.state.value,options:Nr.props.options,searchQuery:Nr.state.searchQuery,additionLabel:Nr.props.additionLabel,additionPosition:Nr.props.additionPosition,allowAdditions:Nr.props.allowAdditions,deburr:Nr.props.deburr,multiple:Nr.props.multiple,search:Nr.props.search}));if(!(Ur&&ga===0)){var eo=Nr.makeSelectedItemActive(jr,Qr);Nr.setState({selectedIndex:getSelectedIndex({additionLabel:Nr.props.additionLabel,additionPosition:Nr.props.additionPosition,allowAdditions:Nr.props.allowAdditions,deburr:Nr.props.deburr,multiple:Nr.props.multiple,search:Nr.props.search,selectedIndex:Qr,value:eo,options:Nr.props.options,searchQuery:""})}),Nr.closeOnChange(jr),Nr.clearSearchQuery(),Ur&&_invoke(Nr.searchRef.current,"focus")}}}},Nr.removeItemOnBackspace=function(jr){var Ur=Nr.props,Gr=Ur.multiple,Yr=Ur.search,Qr=Nr.state,Wn=Qr.searchQuery,ga=Qr.value;if(keyboardKey.getCode(jr)===keyboardKey.Backspace&&!(Wn||!Yr||!Gr||isEmpty(ga))){jr.preventDefault();var eo=dropRight(ga);Nr.setState({value:eo}),Nr.handleChange(jr,eo)}},Nr.closeOnDocumentClick=function(jr){Nr.props.closeOnBlur&&(Nr.ref.current&&doesNodeContainClick$1(Nr.ref.current,jr)||Nr.close())},Nr.handleMouseDown=function(jr){Nr.isMouseDown=!0,_invoke(Nr.props,"onMouseDown",jr,Nr.props),document.addEventListener("mouseup",Nr.handleDocumentMouseUp)},Nr.handleDocumentMouseUp=function(){Nr.isMouseDown=!1,document.removeEventListener("mouseup",Nr.handleDocumentMouseUp)},Nr.handleClick=function(jr){var Ur=Nr.props,Gr=Ur.minCharacters,Yr=Ur.search,Qr=Nr.state,Wn=Qr.open,ga=Qr.searchQuery;if(_invoke(Nr.props,"onClick",jr,Nr.props),jr.stopPropagation(),!Yr)return Nr.toggle(jr);if(Wn){_invoke(Nr.searchRef.current,"focus");return}if(ga.length>=Gr||Gr===1){Nr.open(jr);return}_invoke(Nr.searchRef.current,"focus")},Nr.handleIconClick=function(jr){var Ur=Nr.props.clearable,Gr=Nr.hasValue();_invoke(Nr.props,"onClick",jr,Nr.props),jr.stopPropagation(),Ur&&Gr?Nr.clearValue(jr):Nr.toggle(jr)},Nr.handleItemClick=function(jr,Ur){var Gr=Nr.props,Yr=Gr.multiple,Qr=Gr.search,Wn=Nr.state.value,ga=Ur.value;if(jr.stopPropagation(),(Yr||Ur.disabled)&&jr.nativeEvent.stopImmediatePropagation(),!Ur.disabled){var eo=Ur["data-additional"],_i=Yr?_union(Nr.state.value,[ga]):ga,va=Yr?!!_difference(_i,Wn).length:_i!==Wn;va&&(Nr.setState({value:_i}),Nr.handleChange(jr,_i)),Nr.clearSearchQuery(),_invoke(Qr?Nr.searchRef.current:Nr.ref.current,"focus"),Nr.closeOnChange(jr),eo&&_invoke(Nr.props,"onAddItem",jr,_extends$1({},Nr.props,{value:ga}))}},Nr.handleFocus=function(jr){var Ur=Nr.state.focus;Ur||(_invoke(Nr.props,"onFocus",jr,Nr.props),Nr.setState({focus:!0}))},Nr.handleBlur=function(jr){var Ur=get(jr,"currentTarget");if(!(Ur&&Ur.contains(document.activeElement))){var Gr=Nr.props,Yr=Gr.closeOnBlur,Qr=Gr.multiple,Wn=Gr.selectOnBlur;Nr.isMouseDown||(_invoke(Nr.props,"onBlur",jr,Nr.props),Wn&&!Qr&&(Nr.makeSelectedItemActive(jr,Nr.state.selectedIndex),Yr&&Nr.close()),Nr.setState({focus:!1}),Nr.clearSearchQuery())}},Nr.handleSearchChange=function(jr,Ur){var Gr=Ur.value;jr.stopPropagation();var Yr=Nr.props.minCharacters,Qr=Nr.state.open,Wn=Gr;if(_invoke(Nr.props,"onSearchChange",jr,_extends$1({},Nr.props,{searchQuery:Wn})),Nr.setState({searchQuery:Wn,selectedIndex:0}),!Qr&&Wn.length>=Yr){Nr.open();return}Qr&&Yr!==1&&Wn.length<Yr&&Nr.close()},Nr.handleKeyDown=function(jr){Nr.moveSelectionOnKeyDown(jr),Nr.openOnArrow(jr),Nr.openOnSpace(jr),Nr.selectItemOnEnter(jr),_invoke(Nr.props,"onKeyDown",jr)},Nr.getSelectedItem=function(jr){var Ur=getMenuOptions({value:Nr.state.value,options:Nr.props.options,searchQuery:Nr.state.searchQuery,additionLabel:Nr.props.additionLabel,additionPosition:Nr.props.additionPosition,allowAdditions:Nr.props.allowAdditions,deburr:Nr.props.deburr,multiple:Nr.props.multiple,search:Nr.props.search});return get(Ur,"["+jr+"]")},Nr.getItemByValue=function(jr){var Ur=Nr.props.options;return _find(Ur,{value:jr})},Nr.getDropdownAriaOptions=function(){var jr=Nr.props,Ur=jr.loading,Gr=jr.disabled,Yr=jr.search,Qr=jr.multiple,Wn=Nr.state.open,ga={role:Yr?"combobox":"listbox","aria-busy":Ur,"aria-disabled":Gr,"aria-expanded":!!Wn};return ga.role==="listbox"&&(ga["aria-multiselectable"]=Qr),ga},Nr.clearSearchQuery=function(){var jr=Nr.state.searchQuery;jr===void 0||jr===""||Nr.setState({searchQuery:""})},Nr.handleLabelClick=function(jr,Ur){jr.stopPropagation(),Nr.setState({selectedLabel:Ur.value}),_invoke(Nr.props,"onLabelClick",jr,Ur)},Nr.handleLabelRemove=function(jr,Ur){jr.stopPropagation();var Gr=Nr.state.value,Yr=_without(Gr,Ur.value);Nr.setState({value:Yr}),Nr.handleChange(jr,Yr)},Nr.getSelectedIndexAfterMove=function(jr,Ur){Ur===void 0&&(Ur=Nr.state.selectedIndex);var Gr=getMenuOptions({value:Nr.state.value,options:Nr.props.options,searchQuery:Nr.state.searchQuery,additionLabel:Nr.props.additionLabel,additionPosition:Nr.props.additionPosition,allowAdditions:Nr.props.allowAdditions,deburr:Nr.props.deburr,multiple:Nr.props.multiple,search:Nr.props.search});if(!(Gr===void 0||every(Gr,"disabled"))){var Yr=Gr.length-1,Qr=Nr.props.wrapSelection,Wn=Ur+jr;return!Qr&&(Wn>Yr||Wn<0)?Wn=Ur:Wn>Yr?Wn=0:Wn<0&&(Wn=Yr),Gr[Wn].disabled?Nr.getSelectedIndexAfterMove(jr,Wn):Wn}},Nr.handleIconOverrides=function(jr){var Ur=Nr.props.clearable,Gr=clsx(Ur&&Nr.hasValue()&&"clear",jr.className);return{className:Gr,onClick:function(Qr){_invoke(jr,"onClick",Qr,jr),Nr.handleIconClick(Qr)}}},Nr.clearValue=function(jr){var Ur=Nr.props.multiple,Gr=Ur?[]:"";Nr.setState({value:Gr}),Nr.handleChange(jr,Gr)},Nr.computeSearchInputTabIndex=function(){var jr=Nr.props,Ur=jr.disabled,Gr=jr.tabIndex;return isNil(Gr)?Ur?-1:0:Gr},Nr.computeSearchInputWidth=function(){var jr=Nr.state.searchQuery;if(Nr.sizerRef.current&&jr){Nr.sizerRef.current.style.display="inline",Nr.sizerRef.current.textContent=jr;var Ur=Math.ceil(Nr.sizerRef.current.getBoundingClientRect().width);return Nr.sizerRef.current.style.removeProperty("display"),Ur}},Nr.computeTabIndex=function(){var jr=Nr.props,Ur=jr.disabled,Gr=jr.search,Yr=jr.tabIndex;if(!Gr)return Ur?-1:isNil(Yr)?0:Yr},Nr.handleSearchInputOverrides=function(jr){return{onChange:function(Gr,Yr){_invoke(jr,"onChange",Gr,Yr),Nr.handleSearchChange(Gr,Yr)}}},Nr.hasValue=function(){var jr=Nr.props.multiple,Ur=Nr.state.value;return jr?!isEmpty(Ur):!isNil(Ur)&&Ur!==""},Nr.scrollSelectedItemIntoView=function(){if(Nr.ref.current){var jr=Nr.ref.current.querySelector(".menu.visible");if(jr){var Ur=jr.querySelector(".item.selected");if(Ur){var Gr=Ur.offsetTop<jr.scrollTop,Yr=Ur.offsetTop+Ur.clientHeight>jr.scrollTop+jr.clientHeight;Gr?jr.scrollTop=Ur.offsetTop:Yr&&(jr.scrollTop=Ur.offsetTop+Ur.clientHeight-jr.clientHeight)}}}},Nr.setOpenDirection=function(){if(Nr.ref.current){var jr=Nr.ref.current.querySelector(".menu.visible");if(jr){var Ur=Nr.ref.current.getBoundingClientRect(),Gr=jr.clientHeight,Yr=document.documentElement.clientHeight-Ur.top-Ur.height-Gr,Qr=Ur.top-Gr,Wn=Yr<0&&Qr>Yr;!Wn!=!Nr.state.upward&&Nr.setState({upward:Wn})}}},Nr.open=function(jr,Ur){jr===void 0&&(jr=null),Ur===void 0&&(Ur=!0);var Gr=Nr.props,Yr=Gr.disabled,Qr=Gr.search;Yr||(Qr&&_invoke(Nr.searchRef.current,"focus"),_invoke(Nr.props,"onOpen",jr,Nr.props),Ur&&Nr.setState({open:!0}),Nr.scrollSelectedItemIntoView())},Nr.close=function(jr,Ur){Ur===void 0&&(Ur=Nr.handleClose),Nr.state.open&&(_invoke(Nr.props,"onClose",jr,Nr.props),Nr.setState({open:!1},Ur))},Nr.handleClose=function(){var jr=document.activeElement===Nr.searchRef.current;!jr&&Nr.ref.current&&Nr.ref.current.blur();var Ur=document.activeElement===Nr.ref.current,Gr=jr||Ur;Nr.setState({focus:Gr})},Nr.toggle=function(jr){return Nr.state.open?Nr.close(jr):Nr.open(jr)},Nr.renderText=function(){var jr=Nr.props,Ur=jr.multiple,Gr=jr.placeholder,Yr=jr.search,Qr=jr.text,Wn=Nr.state,ga=Wn.searchQuery,eo=Wn.selectedIndex,_i=Wn.value,va=Wn.open,io=Nr.hasValue(),no=clsx(Gr&&!io&&"default","text",Yr&&ga&&"filtered"),so=Gr,ao;return Qr?so=Qr:va&&!Ur?ao=Nr.getSelectedItem(eo):io&&(ao=Nr.getItemByValue(_i)),DropdownText.create(ao?renderItemContent(ao):so,{defaultProps:{className:no}})},Nr.renderSearchInput=function(){var jr=Nr.props,Ur=jr.search,Gr=jr.searchInput,Yr=Nr.state.searchQuery;return Ur&&React$5.createElement(Ref,{innerRef:Nr.searchRef},DropdownSearchInput$1.create(Gr,{defaultProps:{style:{width:Nr.computeSearchInputWidth()},tabIndex:Nr.computeSearchInputTabIndex(),value:Yr},overrideProps:Nr.handleSearchInputOverrides}))},Nr.renderSearchSizer=function(){var jr=Nr.props,Ur=jr.search,Gr=jr.multiple;return Ur&&Gr&&React$5.createElement("span",{className:"sizer",ref:Nr.sizerRef})},Nr.renderLabels=function(){var jr=Nr.props,Ur=jr.multiple,Gr=jr.renderLabel,Yr=Nr.state,Qr=Yr.selectedLabel,Wn=Yr.value;if(!(!Ur||isEmpty(Wn))){var ga=map(Wn,Nr.getItemByValue);return map(compact(ga),function(eo,_i){var va={active:eo.value===Qr,as:"a",key:getKeyOrValue(eo.key,eo.value),onClick:Nr.handleLabelClick,onRemove:Nr.handleLabelRemove,value:eo.value};return Label$1.create(Gr(eo,_i,va),{defaultProps:va})})}},Nr.renderOptions=function(){var jr=Nr.props,Ur=jr.lazyLoad,Gr=jr.multiple,Yr=jr.search,Qr=jr.noResultsMessage,Wn=Nr.state,ga=Wn.open,eo=Wn.selectedIndex,_i=Wn.value;if(Ur&&!ga)return null;var va=getMenuOptions({value:Nr.state.value,options:Nr.props.options,searchQuery:Nr.state.searchQuery,additionLabel:Nr.props.additionLabel,additionPosition:Nr.props.additionPosition,allowAdditions:Nr.props.allowAdditions,deburr:Nr.props.deburr,multiple:Nr.props.multiple,search:Nr.props.search});if(Qr!==null&&Yr&&isEmpty(va))return React$5.createElement("div",{className:"message"},Qr);var io=Gr?function(no){return includes(_i,no)}:function(no){return no===_i};return map(va,function(no,so){return DropdownItem$1.create(_extends$1({active:io(no.value),selected:eo===so},no,{key:getKeyOrValue(no.key,no.value),style:_extends$1({},no.style,{pointerEvents:"all"})}),{generateKey:!1,overrideProps:function(fo){return{onClick:function(oo,po){fo.onClick==null||fo.onClick(oo,po),Nr.handleItemClick(oo,po)}}}})})},Nr.renderMenu=function(){var jr=Nr.props,Ur=jr.children,Gr=jr.direction,Yr=jr.header,Qr=Nr.state.open,Wn=Nr.getDropdownMenuAriaOptions();if(!isNil$1(Ur)){var ga=reactExports.Children.only(Ur),eo=clsx(Gr,useKeyOnly(Qr,"visible"),ga.props.className);return reactExports.cloneElement(ga,_extends$1({className:eo},Wn))}return React$5.createElement(DropdownMenu,_extends$1({},Wn,{direction:Gr,open:Qr}),DropdownHeader.create(Yr,{autoGenerateKey:!1}),Nr.renderOptions())},Nr}var Mr=pr.prototype;return Mr.getInitialAutoControlledState=function(){return{focus:!1,searchQuery:""}},pr.getAutoControlledStateFromProps=function(Dr,Br,Lr){var jr={__options:Dr.options,__value:Br.value},Ur=!shallowEqual(Lr.__value,Br.value)||!isEqual(getKeyAndValues(Dr.options),getKeyAndValues(Lr.__options));return Ur&&(jr.selectedIndex=getSelectedIndex({additionLabel:Dr.additionLabel,additionPosition:Dr.additionPosition,allowAdditions:Dr.allowAdditions,deburr:Dr.deburr,multiple:Dr.multiple,search:Dr.search,selectedIndex:Br.selectedIndex,value:Br.value,options:Dr.options,searchQuery:Br.searchQuery})),jr},Mr.componentDidMount=function(){var Dr=this.state.open;Dr&&this.open(null,!1)},Mr.shouldComponentUpdate=function(Dr,Br){return!shallowEqual(Dr,this.props)||!shallowEqual(Br,this.state)},Mr.componentDidUpdate=function(Dr,Br){var Lr=this.props,jr=Lr.closeOnBlur,Ur=Lr.minCharacters,Gr=Lr.openOnFocus,Yr=Lr.search;if(!Br.focus&&this.state.focus){if(!this.isMouseDown){var Qr=!Yr||Yr&&Ur===1&&!this.state.open;Gr&&Qr&&this.open()}}else Br.focus&&!this.state.focus&&!this.isMouseDown&&jr&&this.close();!Br.open&&this.state.open?(this.setOpenDirection(),this.scrollSelectedItemIntoView()):Br.open&&this.state.open,Br.selectedIndex!==this.state.selectedIndex&&this.scrollSelectedItemIntoView()},Mr.getDropdownMenuAriaOptions=function(){var Dr=this.props,Br=Dr.search,Lr=Dr.multiple,jr={};return Br&&(jr["aria-multiselectable"]=Lr,jr.role="listbox"),jr},Mr.render=function(){var Dr=this.props,Br=Dr.basic,Lr=Dr.button,jr=Dr.className,Ur=Dr.compact,Gr=Dr.disabled,Yr=Dr.error,Qr=Dr.fluid,Wn=Dr.floating,ga=Dr.icon,eo=Dr.inline,_i=Dr.item,va=Dr.labeled,io=Dr.loading,no=Dr.multiple,so=Dr.pointing,ao=Dr.search,fo=Dr.selection,lo=Dr.scrolling,oo=Dr.simple,po=Dr.trigger,mo=this.state,$o=mo.focus,Xn=mo.open,Fr=mo.upward,Vr=clsx("ui",useKeyOnly(Xn,"active visible"),useKeyOnly(Gr,"disabled"),useKeyOnly(Yr,"error"),useKeyOnly(io,"loading"),useKeyOnly(Br,"basic"),useKeyOnly(Lr,"button"),useKeyOnly(Ur,"compact"),useKeyOnly(Qr,"fluid"),useKeyOnly(Wn,"floating"),useKeyOnly(eo,"inline"),useKeyOnly(va,"labeled"),useKeyOnly(_i,"item"),useKeyOnly(no,"multiple"),useKeyOnly(ao,"search"),useKeyOnly(fo,"selection"),useKeyOnly(oo,"simple"),useKeyOnly(lo,"scrolling"),useKeyOnly(Fr,"upward"),useKeyOrValueAndKey(so,"pointing"),"dropdown",jr),Wr=getUnhandledProps$1(pr,this.props),Jr=getElementType(pr,this.props),Gn=this.getDropdownAriaOptions(Jr,this.props);return React$5.createElement(Ref,{innerRef:this.ref},React$5.createElement(Jr,_extends$1({},Wr,Gn,{className:Vr,onBlur:this.handleBlur,onClick:this.handleClick,onKeyDown:this.handleKeyDown,onMouseDown:this.handleMouseDown,onFocus:this.handleFocus,onChange:this.handleChange,tabIndex:this.computeTabIndex()}),this.renderLabels(),this.renderSearchInput(),this.renderSearchSizer(),po||this.renderText(),Icon$2.create(ga,{overrideProps:this.handleIconOverrides,autoGenerateKey:!1}),this.renderMenu(),Xn&&React$5.createElement(EventStack,{name:"keydown",on:this.closeOnEscape}),Xn&&React$5.createElement(EventStack,{name:"click",on:this.closeOnDocumentClick}),$o&&React$5.createElement(EventStack,{name:"keydown",on:this.removeItemOnBackspace})))},pr}(ModernAutoControlledComponent);Dropdown.handledProps=["additionLabel","additionPosition","allowAdditions","as","basic","button","children","className","clearable","closeOnBlur","closeOnChange","closeOnEscape","compact","deburr","defaultOpen","defaultSearchQuery","defaultSelectedLabel","defaultUpward","defaultValue","direction","disabled","error","floating","fluid","header","icon","inline","item","labeled","lazyLoad","loading","minCharacters","multiple","noResultsMessage","onAddItem","onBlur","onChange","onClick","onClose","onFocus","onLabelClick","onMouseDown","onOpen","onSearchChange","open","openOnFocus","options","placeholder","pointing","renderLabel","scrolling","search","searchInput","searchQuery","selectOnBlur","selectOnNavigation","selectedLabel","selection","simple","tabIndex","text","trigger","upward","value","wrapSelection"];Dropdown.propTypes={};Dropdown.defaultProps={additionLabel:"Add ",additionPosition:"top",closeOnBlur:!0,closeOnEscape:!0,deburr:!1,icon:"dropdown",minCharacters:1,noResultsMessage:"No results found.",openOnFocus:!0,renderLabel:renderItemContent,searchInput:"text",selectOnBlur:!0,selectOnNavigation:!0,wrapSelection:!0};Dropdown.autoControlledProps=["open","searchQuery","selectedLabel","value","upward"];Dropdown.Divider=DropdownDivider;Dropdown.Header=DropdownHeader;Dropdown.Item=DropdownItem$1;Dropdown.Menu=DropdownMenu;Dropdown.SearchInput=DropdownSearchInput$1;Dropdown.Text=DropdownText;function Select($r){return React$5.createElement(Dropdown,_extends$1({},$r,{selection:!0}))}Select.handledProps=["options"];Select.propTypes={};Select.Divider=Dropdown.Divider;Select.Header=Dropdown.Header;Select.Item=Dropdown.Item;Select.Menu=Dropdown.Menu;var TextArea=function($r){_inheritsLoose$6(pr,$r);function pr(){for(var Nr,Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=$r.call.apply($r,[this].concat(Br))||this,Nr.ref=reactExports.createRef(),Nr.focus=function(){return Nr.ref.current.focus()},Nr.handleChange=function(jr){var Ur=get(jr,"target.value");_invoke(Nr.props,"onChange",jr,_extends$1({},Nr.props,{value:Ur}))},Nr.handleInput=function(jr){var Ur=get(jr,"target.value");_invoke(Nr.props,"onInput",jr,_extends$1({},Nr.props,{value:Ur}))},Nr}var Mr=pr.prototype;return Mr.render=function(){var Dr=this.props,Br=Dr.rows,Lr=Dr.value,jr=getUnhandledProps$1(pr,this.props),Ur=getElementType(pr,this.props);return React$5.createElement(Ref,{innerRef:this.ref},React$5.createElement(Ur,_extends$1({},jr,{onChange:this.handleChange,onInput:this.handleInput,rows:Br,value:Lr})))},pr}(reactExports.Component);TextArea.handledProps=["as","onChange","onInput","rows","value"];TextArea.propTypes={};TextArea.defaultProps={as:"textarea",rows:3};const TextArea$1=TextArea;function FormField($r){var pr=$r.children,Mr=$r.className,Nr=$r.content,Dr=$r.control,Br=$r.disabled,Lr=$r.error,jr=$r.inline,Ur=$r.label,Gr=$r.required,Yr=$r.type,Qr=$r.width,Wn=$r.id,ga=clsx(useKeyOnly(Br,"disabled"),useKeyOnly(Lr,"error"),useKeyOnly(jr,"inline"),useKeyOnly(Gr,"required"),useWidthProp(Qr,"wide"),"field",Mr),eo=getUnhandledProps$1(FormField,$r),_i=getElementType(FormField,$r),va=get(Lr,"pointing","above"),io=Label$1.create(Lr,{autoGenerateKey:!1,defaultProps:{prompt:!0,pointing:va,id:Wn?Wn+"-error-message":void 0,role:"alert","aria-atomic":!0}}),no=(va==="below"||va==="right")&&io,so=(va==="above"||va==="left")&&io;if(isNil(Dr))return isNil(Ur)?React$5.createElement(_i,_extends$1({},eo,{className:ga,id:Wn}),isNil$1(pr)?Nr:pr):React$5.createElement(_i,_extends$1({},eo,{className:ga,id:Wn}),no,createHTMLLabel(Ur,{autoGenerateKey:!1}),so);var ao=Wn&&Lr?Wn+"-error-message":null,fo={"aria-describedby":ao,"aria-invalid":Lr?!0:void 0},lo=_extends$1({},eo,{content:Nr,children:pr,disabled:Br,required:Gr,type:Yr,id:Wn});return Dr==="input"&&(Yr==="checkbox"||Yr==="radio")?React$5.createElement(_i,{className:ga},React$5.createElement("label",null,no,reactExports.createElement(Dr,_extends$1({},fo,lo))," ",Ur,so)):Dr===Checkbox||Dr===Radio?React$5.createElement(_i,{className:ga},no,reactExports.createElement(Dr,_extends$1({},fo,lo,{label:Ur})),so):React$5.createElement(_i,{className:ga},createHTMLLabel(Ur,{defaultProps:{htmlFor:Wn},autoGenerateKey:!1}),no,reactExports.createElement(Dr,_extends$1({},fo,lo)),so)}FormField.handledProps=["as","children","className","content","control","disabled","error","id","inline","label","required","type","width"];FormField.propTypes={};function FormButton($r){var pr=$r.control,Mr=getUnhandledProps$1(FormButton,$r),Nr=getElementType(FormButton,$r);return React$5.createElement(Nr,_extends$1({},Mr,{control:pr}))}FormButton.handledProps=["as","control"];FormButton.propTypes={};FormButton.defaultProps={as:FormField,control:Button$2};function FormCheckbox($r){var pr=$r.control,Mr=getUnhandledProps$1(FormCheckbox,$r),Nr=getElementType(FormCheckbox,$r);return React$5.createElement(Nr,_extends$1({},Mr,{control:pr}))}FormCheckbox.handledProps=["as","control"];FormCheckbox.propTypes={};FormCheckbox.defaultProps={as:FormField,control:Checkbox};function FormDropdown($r){var pr=$r.control,Mr=getUnhandledProps$1(FormDropdown,$r),Nr=getElementType(FormDropdown,$r);return React$5.createElement(Nr,_extends$1({},Mr,{control:pr}))}FormDropdown.handledProps=["as","control"];FormDropdown.propTypes={};FormDropdown.defaultProps={as:FormField,control:Dropdown};function FormGroup($r){var pr=$r.children,Mr=$r.className,Nr=$r.grouped,Dr=$r.inline,Br=$r.unstackable,Lr=$r.widths,jr=clsx(useKeyOnly(Nr,"grouped"),useKeyOnly(Dr,"inline"),useKeyOnly(Br,"unstackable"),useWidthProp(Lr,null,!0),"fields",Mr),Ur=getUnhandledProps$1(FormGroup,$r),Gr=getElementType(FormGroup,$r);return React$5.createElement(Gr,_extends$1({},Ur,{className:jr}),pr)}FormGroup.handledProps=["as","children","className","grouped","inline","unstackable","widths"];FormGroup.propTypes={};var Input$2=function($r){_inheritsLoose$6(pr,$r);function pr(){for(var Nr,Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=$r.call.apply($r,[this].concat(Br))||this,Nr.inputRef=reactExports.createRef(),Nr.computeIcon=function(){var jr=Nr.props,Ur=jr.loading,Gr=jr.icon;if(!isNil(Gr))return Gr;if(Ur)return"spinner"},Nr.computeTabIndex=function(){var jr=Nr.props,Ur=jr.disabled,Gr=jr.tabIndex;if(!isNil(Gr))return Gr;if(Ur)return-1},Nr.focus=function(jr){return Nr.inputRef.current.focus(jr)},Nr.select=function(){return Nr.inputRef.current.select()},Nr.handleChange=function(jr){var Ur=get(jr,"target.value");_invoke(Nr.props,"onChange",jr,_extends$1({},Nr.props,{value:Ur}))},Nr.handleChildOverrides=function(jr,Ur){return _extends$1({},Ur,jr.props,{ref:function(Yr){handleRef(jr.ref,Yr),Nr.inputRef.current=Yr}})},Nr.partitionProps=function(){var jr=Nr.props,Ur=jr.disabled,Gr=jr.type,Yr=Nr.computeTabIndex(),Qr=getUnhandledProps$1(pr,Nr.props),Wn=partitionHTMLProps(Qr),ga=Wn[0],eo=Wn[1];return[_extends$1({},ga,{disabled:Ur,type:Gr,tabIndex:Yr,onChange:Nr.handleChange,ref:Nr.inputRef}),eo]},Nr}var Mr=pr.prototype;return Mr.render=function(){var Dr=this,Br=this.props,Lr=Br.action,jr=Br.actionPosition,Ur=Br.children,Gr=Br.className,Yr=Br.disabled,Qr=Br.error,Wn=Br.fluid,ga=Br.focus,eo=Br.icon,_i=Br.iconPosition,va=Br.input,io=Br.inverted,no=Br.label,so=Br.labelPosition,ao=Br.loading,fo=Br.size,lo=Br.transparent,oo=Br.type,po=clsx("ui",fo,useKeyOnly(Yr,"disabled"),useKeyOnly(Qr,"error"),useKeyOnly(Wn,"fluid"),useKeyOnly(ga,"focus"),useKeyOnly(io,"inverted"),useKeyOnly(ao,"loading"),useKeyOnly(lo,"transparent"),useValueAndKey(jr,"action")||useKeyOnly(Lr,"action"),useValueAndKey(_i,"icon")||useKeyOnly(eo||ao,"icon"),useValueAndKey(so,"labeled")||useKeyOnly(no,"labeled"),"input",Gr),mo=getElementType(pr,this.props),$o=this.partitionProps(),Xn=$o[0],Fr=$o[1];if(!isNil$1(Ur)){var Vr=map(reactExports.Children.toArray(Ur),function(Gn){return Gn.type!=="input"?Gn:reactExports.cloneElement(Gn,Dr.handleChildOverrides(Gn,Xn))});return React$5.createElement(mo,_extends$1({},Fr,{className:po}),Vr)}var Wr=Button$2.create(Lr,{autoGenerateKey:!1}),Jr=Label$1.create(no,{defaultProps:{className:clsx("label",includes(so,"corner")&&so)},autoGenerateKey:!1});return React$5.createElement(mo,_extends$1({},Fr,{className:po}),jr==="left"&&Wr,so!=="right"&&Jr,createHTMLInput(va||oo,{defaultProps:Xn,autoGenerateKey:!1}),Icon$2.create(this.computeIcon(),{autoGenerateKey:!1}),jr!=="left"&&Wr,so==="right"&&Jr)},pr}(reactExports.Component);Input$2.handledProps=["action","actionPosition","as","children","className","disabled","error","fluid","focus","icon","iconPosition","input","inverted","label","labelPosition","loading","onChange","size","tabIndex","transparent","type"];Input$2.propTypes={};Input$2.defaultProps={type:"text"};Input$2.create=createShorthandFactory(Input$2,function($r){return{type:$r}});const Input$3=Input$2;function FormInput($r){var pr=$r.control,Mr=getUnhandledProps$1(FormInput,$r),Nr=getElementType(FormInput,$r);return React$5.createElement(Nr,_extends$1({},Mr,{control:pr}))}FormInput.handledProps=["as","control"];FormInput.propTypes={};FormInput.defaultProps={as:FormField,control:Input$3};function FormRadio($r){var pr=$r.control,Mr=getUnhandledProps$1(FormRadio,$r),Nr=getElementType(FormRadio,$r);return React$5.createElement(Nr,_extends$1({},Mr,{control:pr}))}FormRadio.handledProps=["as","control"];FormRadio.propTypes={};FormRadio.defaultProps={as:FormField,control:Radio};function FormSelect($r){var pr=$r.control,Mr=$r.options,Nr=getUnhandledProps$1(FormSelect,$r),Dr=getElementType(FormSelect,$r);return React$5.createElement(Dr,_extends$1({},Nr,{control:pr,options:Mr}))}FormSelect.handledProps=["as","control","options"];FormSelect.propTypes={};FormSelect.defaultProps={as:FormField,control:Select};function FormTextArea($r){var pr=$r.control,Mr=getUnhandledProps$1(FormTextArea,$r),Nr=getElementType(FormTextArea,$r);return React$5.createElement(Nr,_extends$1({},Mr,{control:pr}))}FormTextArea.handledProps=["as","control"];FormTextArea.propTypes={};FormTextArea.defaultProps={as:FormField,control:TextArea$1};var Form=function($r){_inheritsLoose$6(pr,$r);function pr(){for(var Nr,Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=$r.call.apply($r,[this].concat(Br))||this,Nr.handleSubmit=function(jr){var Ur=Nr.props.action;typeof Ur!="string"&&_invoke(jr,"preventDefault");for(var Gr=arguments.length,Yr=new Array(Gr>1?Gr-1:0),Qr=1;Qr<Gr;Qr++)Yr[Qr-1]=arguments[Qr];_invoke.apply(void 0,[Nr.props,"onSubmit",jr,Nr.props].concat(Yr))},Nr}var Mr=pr.prototype;return Mr.render=function(){var Dr=this.props,Br=Dr.action,Lr=Dr.children,jr=Dr.className,Ur=Dr.error,Gr=Dr.inverted,Yr=Dr.loading,Qr=Dr.reply,Wn=Dr.size,ga=Dr.success,eo=Dr.unstackable,_i=Dr.warning,va=Dr.widths,io=clsx("ui",Wn,useKeyOnly(Ur,"error"),useKeyOnly(Gr,"inverted"),useKeyOnly(Yr,"loading"),useKeyOnly(Qr,"reply"),useKeyOnly(ga,"success"),useKeyOnly(eo,"unstackable"),useKeyOnly(_i,"warning"),useWidthProp(va,null,!0),"form",jr),no=getUnhandledProps$1(pr,this.props),so=getElementType(pr,this.props);return React$5.createElement(so,_extends$1({},no,{action:Br,className:io,onSubmit:this.handleSubmit}),Lr)},pr}(reactExports.Component);Form.handledProps=["action","as","children","className","error","inverted","loading","onSubmit","reply","size","success","unstackable","warning","widths"];Form.propTypes={};Form.defaultProps={as:"form"};Form.Field=FormField;Form.Button=FormButton;Form.Checkbox=FormCheckbox;Form.Dropdown=FormDropdown;Form.Group=FormGroup;Form.Input=FormInput;Form.Radio=FormRadio;Form.Select=FormSelect;Form.TextArea=FormTextArea;const Form$1=Form;function SegmentGroup($r){var pr=$r.children,Mr=$r.className,Nr=$r.compact,Dr=$r.content,Br=$r.horizontal,Lr=$r.piled,jr=$r.raised,Ur=$r.size,Gr=$r.stacked,Yr=clsx("ui",Ur,useKeyOnly(Nr,"compact"),useKeyOnly(Br,"horizontal"),useKeyOnly(Lr,"piled"),useKeyOnly(jr,"raised"),useKeyOnly(Gr,"stacked"),"segments",Mr),Qr=getUnhandledProps$1(SegmentGroup,$r),Wn=getElementType(SegmentGroup,$r);return React$5.createElement(Wn,_extends$1({},Qr,{className:Yr}),isNil$1(pr)?Dr:pr)}SegmentGroup.handledProps=["as","children","className","compact","content","horizontal","piled","raised","size","stacked"];SegmentGroup.propTypes={};function SegmentInline($r){var pr=$r.children,Mr=$r.className,Nr=$r.content,Dr=clsx("inline",Mr),Br=getUnhandledProps$1(SegmentInline,$r),Lr=getElementType(SegmentInline,$r);return React$5.createElement(Lr,_extends$1({},Br,{className:Dr}),isNil$1(pr)?Nr:pr)}SegmentInline.handledProps=["as","children","className","content"];SegmentInline.propTypes={};function Segment($r){var pr=$r.attached,Mr=$r.basic,Nr=$r.children,Dr=$r.circular,Br=$r.className,Lr=$r.clearing,jr=$r.color,Ur=$r.compact,Gr=$r.content,Yr=$r.disabled,Qr=$r.floated,Wn=$r.inverted,ga=$r.loading,eo=$r.placeholder,_i=$r.padded,va=$r.piled,io=$r.raised,no=$r.secondary,so=$r.size,ao=$r.stacked,fo=$r.tertiary,lo=$r.textAlign,oo=$r.vertical,po=clsx("ui",jr,so,useKeyOnly(Mr,"basic"),useKeyOnly(Dr,"circular"),useKeyOnly(Lr,"clearing"),useKeyOnly(Ur,"compact"),useKeyOnly(Yr,"disabled"),useKeyOnly(Wn,"inverted"),useKeyOnly(ga,"loading"),useKeyOnly(eo,"placeholder"),useKeyOnly(va,"piled"),useKeyOnly(io,"raised"),useKeyOnly(no,"secondary"),useKeyOnly(ao,"stacked"),useKeyOnly(fo,"tertiary"),useKeyOnly(oo,"vertical"),useKeyOrValueAndKey(pr,"attached"),useKeyOrValueAndKey(_i,"padded"),useTextAlignProp(lo),useValueAndKey(Qr,"floated"),"segment",Br),mo=getUnhandledProps$1(Segment,$r),$o=getElementType(Segment,$r);return React$5.createElement($o,_extends$1({},mo,{className:po}),isNil$1(Nr)?Gr:Nr)}Segment.handledProps=["as","attached","basic","children","circular","className","clearing","color","compact","content","disabled","floated","inverted","loading","padded","piled","placeholder","raised","secondary","size","stacked","tertiary","textAlign","vertical"];Segment.Group=SegmentGroup;Segment.Inline=SegmentInline;Segment.propTypes={};var ManagerReferenceNodeContext=reactExports.createContext(),ManagerReferenceNodeSetterContext=reactExports.createContext();function Manager($r){var pr=$r.children,Mr=reactExports.useState(null),Nr=Mr[0],Dr=Mr[1],Br=reactExports.useRef(!1);reactExports.useEffect(function(){return function(){Br.current=!0}},[]);var Lr=reactExports.useCallback(function(jr){Br.current||Dr(jr)},[]);return reactExports.createElement(ManagerReferenceNodeContext.Provider,{value:Nr},reactExports.createElement(ManagerReferenceNodeSetterContext.Provider,{value:Lr},pr))}var unwrapArray=function(pr){return Array.isArray(pr)?pr[0]:pr},safeInvoke=function(pr){if(typeof pr=="function"){for(var Mr=arguments.length,Nr=new Array(Mr>1?Mr-1:0),Dr=1;Dr<Mr;Dr++)Nr[Dr-1]=arguments[Dr];return pr.apply(void 0,Nr)}},setRef=function(pr,Mr){if(typeof pr=="function")return safeInvoke(pr,Mr);pr!=null&&(pr.current=Mr)},fromEntries=function(pr){return pr.reduce(function(Mr,Nr){var Dr=Nr[0],Br=Nr[1];return Mr[Dr]=Br,Mr},{})},useIsomorphicLayoutEffect=typeof window<"u"&&window.document&&window.document.createElement?reactExports.useLayoutEffect:reactExports.useEffect,top="top",bottom="bottom",right$2="right",left$2="left",auto="auto",basePlacements=[top,bottom,right$2,left$2],start="start",end="end",clippingParents="clippingParents",viewport="viewport",popper="popper",reference="reference",variationPlacements=basePlacements.reduce(function($r,pr){return $r.concat([pr+"-"+start,pr+"-"+end])},[]),placements=[].concat(basePlacements,[auto]).reduce(function($r,pr){return $r.concat([pr,pr+"-"+start,pr+"-"+end])},[]),beforeRead="beforeRead",read="read",afterRead="afterRead",beforeMain="beforeMain",main$6="main",afterMain="afterMain",beforeWrite="beforeWrite",write="write",afterWrite="afterWrite",modifierPhases=[beforeRead,read,afterRead,beforeMain,main$6,afterMain,beforeWrite,write,afterWrite];function getNodeName($r){return $r?($r.nodeName||"").toLowerCase():null}function getWindow($r){if($r==null)return window;if($r.toString()!=="[object Window]"){var pr=$r.ownerDocument;return pr&&pr.defaultView||window}return $r}function isElement($r){var pr=getWindow($r).Element;return $r instanceof pr||$r instanceof Element}function isHTMLElement($r){var pr=getWindow($r).HTMLElement;return $r instanceof pr||$r instanceof HTMLElement}function isShadowRoot($r){if(typeof ShadowRoot>"u")return!1;var pr=getWindow($r).ShadowRoot;return $r instanceof pr||$r instanceof ShadowRoot}function applyStyles($r){var pr=$r.state;Object.keys(pr.elements).forEach(function(Mr){var Nr=pr.styles[Mr]||{},Dr=pr.attributes[Mr]||{},Br=pr.elements[Mr];!isHTMLElement(Br)||!getNodeName(Br)||(Object.assign(Br.style,Nr),Object.keys(Dr).forEach(function(Lr){var jr=Dr[Lr];jr===!1?Br.removeAttribute(Lr):Br.setAttribute(Lr,jr===!0?"":jr)}))})}function effect$2($r){var pr=$r.state,Mr={popper:{position:pr.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(pr.elements.popper.style,Mr.popper),pr.styles=Mr,pr.elements.arrow&&Object.assign(pr.elements.arrow.style,Mr.arrow),function(){Object.keys(pr.elements).forEach(function(Nr){var Dr=pr.elements[Nr],Br=pr.attributes[Nr]||{},Lr=Object.keys(pr.styles.hasOwnProperty(Nr)?pr.styles[Nr]:Mr[Nr]),jr=Lr.reduce(function(Ur,Gr){return Ur[Gr]="",Ur},{});!isHTMLElement(Dr)||!getNodeName(Dr)||(Object.assign(Dr.style,jr),Object.keys(Br).forEach(function(Ur){Dr.removeAttribute(Ur)}))})}}const applyStyles$1={name:"applyStyles",enabled:!0,phase:"write",fn:applyStyles,effect:effect$2,requires:["computeStyles"]};function getBasePlacement($r){return $r.split("-")[0]}var max=Math.max,min=Math.min,round=Math.round;function getUAString(){var $r=navigator.userAgentData;return $r!=null&&$r.brands&&Array.isArray($r.brands)?$r.brands.map(function(pr){return pr.brand+"/"+pr.version}).join(" "):navigator.userAgent}function isLayoutViewport(){return!/^((?!chrome|android).)*safari/i.test(getUAString())}function getBoundingClientRect($r,pr,Mr){pr===void 0&&(pr=!1),Mr===void 0&&(Mr=!1);var Nr=$r.getBoundingClientRect(),Dr=1,Br=1;pr&&isHTMLElement($r)&&(Dr=$r.offsetWidth>0&&round(Nr.width)/$r.offsetWidth||1,Br=$r.offsetHeight>0&&round(Nr.height)/$r.offsetHeight||1);var Lr=isElement($r)?getWindow($r):window,jr=Lr.visualViewport,Ur=!isLayoutViewport()&&Mr,Gr=(Nr.left+(Ur&&jr?jr.offsetLeft:0))/Dr,Yr=(Nr.top+(Ur&&jr?jr.offsetTop:0))/Br,Qr=Nr.width/Dr,Wn=Nr.height/Br;return{width:Qr,height:Wn,top:Yr,right:Gr+Qr,bottom:Yr+Wn,left:Gr,x:Gr,y:Yr}}function getLayoutRect($r){var pr=getBoundingClientRect($r),Mr=$r.offsetWidth,Nr=$r.offsetHeight;return Math.abs(pr.width-Mr)<=1&&(Mr=pr.width),Math.abs(pr.height-Nr)<=1&&(Nr=pr.height),{x:$r.offsetLeft,y:$r.offsetTop,width:Mr,height:Nr}}function contains($r,pr){var Mr=pr.getRootNode&&pr.getRootNode();if($r.contains(pr))return!0;if(Mr&&isShadowRoot(Mr)){var Nr=pr;do{if(Nr&&$r.isSameNode(Nr))return!0;Nr=Nr.parentNode||Nr.host}while(Nr)}return!1}function getComputedStyle($r){return getWindow($r).getComputedStyle($r)}function isTableElement($r){return["table","td","th"].indexOf(getNodeName($r))>=0}function getDocumentElement($r){return((isElement($r)?$r.ownerDocument:$r.document)||window.document).documentElement}function getParentNode($r){return getNodeName($r)==="html"?$r:$r.assignedSlot||$r.parentNode||(isShadowRoot($r)?$r.host:null)||getDocumentElement($r)}function getTrueOffsetParent($r){return!isHTMLElement($r)||getComputedStyle($r).position==="fixed"?null:$r.offsetParent}function getContainingBlock($r){var pr=/firefox/i.test(getUAString()),Mr=/Trident/i.test(getUAString());if(Mr&&isHTMLElement($r)){var Nr=getComputedStyle($r);if(Nr.position==="fixed")return null}var Dr=getParentNode($r);for(isShadowRoot(Dr)&&(Dr=Dr.host);isHTMLElement(Dr)&&["html","body"].indexOf(getNodeName(Dr))<0;){var Br=getComputedStyle(Dr);if(Br.transform!=="none"||Br.perspective!=="none"||Br.contain==="paint"||["transform","perspective"].indexOf(Br.willChange)!==-1||pr&&Br.willChange==="filter"||pr&&Br.filter&&Br.filter!=="none")return Dr;Dr=Dr.parentNode}return null}function getOffsetParent($r){for(var pr=getWindow($r),Mr=getTrueOffsetParent($r);Mr&&isTableElement(Mr)&&getComputedStyle(Mr).position==="static";)Mr=getTrueOffsetParent(Mr);return Mr&&(getNodeName(Mr)==="html"||getNodeName(Mr)==="body"&&getComputedStyle(Mr).position==="static")?pr:Mr||getContainingBlock($r)||pr}function getMainAxisFromPlacement($r){return["top","bottom"].indexOf($r)>=0?"x":"y"}function within($r,pr,Mr){return max($r,min(pr,Mr))}function withinMaxClamp($r,pr,Mr){var Nr=within($r,pr,Mr);return Nr>Mr?Mr:Nr}function getFreshSideObject(){return{top:0,right:0,bottom:0,left:0}}function mergePaddingObject($r){return Object.assign({},getFreshSideObject(),$r)}function expandToHashMap($r,pr){return pr.reduce(function(Mr,Nr){return Mr[Nr]=$r,Mr},{})}var toPaddingObject=function(pr,Mr){return pr=typeof pr=="function"?pr(Object.assign({},Mr.rects,{placement:Mr.placement})):pr,mergePaddingObject(typeof pr!="number"?pr:expandToHashMap(pr,basePlacements))};function arrow($r){var pr,Mr=$r.state,Nr=$r.name,Dr=$r.options,Br=Mr.elements.arrow,Lr=Mr.modifiersData.popperOffsets,jr=getBasePlacement(Mr.placement),Ur=getMainAxisFromPlacement(jr),Gr=[left$2,right$2].indexOf(jr)>=0,Yr=Gr?"height":"width";if(!(!Br||!Lr)){var Qr=toPaddingObject(Dr.padding,Mr),Wn=getLayoutRect(Br),ga=Ur==="y"?top:left$2,eo=Ur==="y"?bottom:right$2,_i=Mr.rects.reference[Yr]+Mr.rects.reference[Ur]-Lr[Ur]-Mr.rects.popper[Yr],va=Lr[Ur]-Mr.rects.reference[Ur],io=getOffsetParent(Br),no=io?Ur==="y"?io.clientHeight||0:io.clientWidth||0:0,so=_i/2-va/2,ao=Qr[ga],fo=no-Wn[Yr]-Qr[eo],lo=no/2-Wn[Yr]/2+so,oo=within(ao,lo,fo),po=Ur;Mr.modifiersData[Nr]=(pr={},pr[po]=oo,pr.centerOffset=oo-lo,pr)}}function effect$1($r){var pr=$r.state,Mr=$r.options,Nr=Mr.element,Dr=Nr===void 0?"[data-popper-arrow]":Nr;Dr!=null&&(typeof Dr=="string"&&(Dr=pr.elements.popper.querySelector(Dr),!Dr)||contains(pr.elements.popper,Dr)&&(pr.elements.arrow=Dr))}const arrow$1={name:"arrow",enabled:!0,phase:"main",fn:arrow,effect:effect$1,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function getVariation($r){return $r.split("-")[1]}var unsetSides={top:"auto",right:"auto",bottom:"auto",left:"auto"};function roundOffsetsByDPR($r,pr){var Mr=$r.x,Nr=$r.y,Dr=pr.devicePixelRatio||1;return{x:round(Mr*Dr)/Dr||0,y:round(Nr*Dr)/Dr||0}}function mapToStyles($r){var pr,Mr=$r.popper,Nr=$r.popperRect,Dr=$r.placement,Br=$r.variation,Lr=$r.offsets,jr=$r.position,Ur=$r.gpuAcceleration,Gr=$r.adaptive,Yr=$r.roundOffsets,Qr=$r.isFixed,Wn=Lr.x,ga=Wn===void 0?0:Wn,eo=Lr.y,_i=eo===void 0?0:eo,va=typeof Yr=="function"?Yr({x:ga,y:_i}):{x:ga,y:_i};ga=va.x,_i=va.y;var io=Lr.hasOwnProperty("x"),no=Lr.hasOwnProperty("y"),so=left$2,ao=top,fo=window;if(Gr){var lo=getOffsetParent(Mr),oo="clientHeight",po="clientWidth";if(lo===getWindow(Mr)&&(lo=getDocumentElement(Mr),getComputedStyle(lo).position!=="static"&&jr==="absolute"&&(oo="scrollHeight",po="scrollWidth")),lo=lo,Dr===top||(Dr===left$2||Dr===right$2)&&Br===end){ao=bottom;var mo=Qr&&lo===fo&&fo.visualViewport?fo.visualViewport.height:lo[oo];_i-=mo-Nr.height,_i*=Ur?1:-1}if(Dr===left$2||(Dr===top||Dr===bottom)&&Br===end){so=right$2;var $o=Qr&&lo===fo&&fo.visualViewport?fo.visualViewport.width:lo[po];ga-=$o-Nr.width,ga*=Ur?1:-1}}var Xn=Object.assign({position:jr},Gr&&unsetSides),Fr=Yr===!0?roundOffsetsByDPR({x:ga,y:_i},getWindow(Mr)):{x:ga,y:_i};if(ga=Fr.x,_i=Fr.y,Ur){var Vr;return Object.assign({},Xn,(Vr={},Vr[ao]=no?"0":"",Vr[so]=io?"0":"",Vr.transform=(fo.devicePixelRatio||1)<=1?"translate("+ga+"px, "+_i+"px)":"translate3d("+ga+"px, "+_i+"px, 0)",Vr))}return Object.assign({},Xn,(pr={},pr[ao]=no?_i+"px":"",pr[so]=io?ga+"px":"",pr.transform="",pr))}function computeStyles($r){var pr=$r.state,Mr=$r.options,Nr=Mr.gpuAcceleration,Dr=Nr===void 0?!0:Nr,Br=Mr.adaptive,Lr=Br===void 0?!0:Br,jr=Mr.roundOffsets,Ur=jr===void 0?!0:jr,Gr={placement:getBasePlacement(pr.placement),variation:getVariation(pr.placement),popper:pr.elements.popper,popperRect:pr.rects.popper,gpuAcceleration:Dr,isFixed:pr.options.strategy==="fixed"};pr.modifiersData.popperOffsets!=null&&(pr.styles.popper=Object.assign({},pr.styles.popper,mapToStyles(Object.assign({},Gr,{offsets:pr.modifiersData.popperOffsets,position:pr.options.strategy,adaptive:Lr,roundOffsets:Ur})))),pr.modifiersData.arrow!=null&&(pr.styles.arrow=Object.assign({},pr.styles.arrow,mapToStyles(Object.assign({},Gr,{offsets:pr.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:Ur})))),pr.attributes.popper=Object.assign({},pr.attributes.popper,{"data-popper-placement":pr.placement})}const computeStyles$1={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:computeStyles,data:{}};var passive={passive:!0};function effect($r){var pr=$r.state,Mr=$r.instance,Nr=$r.options,Dr=Nr.scroll,Br=Dr===void 0?!0:Dr,Lr=Nr.resize,jr=Lr===void 0?!0:Lr,Ur=getWindow(pr.elements.popper),Gr=[].concat(pr.scrollParents.reference,pr.scrollParents.popper);return Br&&Gr.forEach(function(Yr){Yr.addEventListener("scroll",Mr.update,passive)}),jr&&Ur.addEventListener("resize",Mr.update,passive),function(){Br&&Gr.forEach(function(Yr){Yr.removeEventListener("scroll",Mr.update,passive)}),jr&&Ur.removeEventListener("resize",Mr.update,passive)}}const eventListeners={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect,data:{}};var hash$2={left:"right",right:"left",bottom:"top",top:"bottom"};function getOppositePlacement($r){return $r.replace(/left|right|bottom|top/g,function(pr){return hash$2[pr]})}var hash$1={start:"end",end:"start"};function getOppositeVariationPlacement($r){return $r.replace(/start|end/g,function(pr){return hash$1[pr]})}function getWindowScroll($r){var pr=getWindow($r),Mr=pr.pageXOffset,Nr=pr.pageYOffset;return{scrollLeft:Mr,scrollTop:Nr}}function getWindowScrollBarX($r){return getBoundingClientRect(getDocumentElement($r)).left+getWindowScroll($r).scrollLeft}function getViewportRect($r,pr){var Mr=getWindow($r),Nr=getDocumentElement($r),Dr=Mr.visualViewport,Br=Nr.clientWidth,Lr=Nr.clientHeight,jr=0,Ur=0;if(Dr){Br=Dr.width,Lr=Dr.height;var Gr=isLayoutViewport();(Gr||!Gr&&pr==="fixed")&&(jr=Dr.offsetLeft,Ur=Dr.offsetTop)}return{width:Br,height:Lr,x:jr+getWindowScrollBarX($r),y:Ur}}function getDocumentRect($r){var pr,Mr=getDocumentElement($r),Nr=getWindowScroll($r),Dr=(pr=$r.ownerDocument)==null?void 0:pr.body,Br=max(Mr.scrollWidth,Mr.clientWidth,Dr?Dr.scrollWidth:0,Dr?Dr.clientWidth:0),Lr=max(Mr.scrollHeight,Mr.clientHeight,Dr?Dr.scrollHeight:0,Dr?Dr.clientHeight:0),jr=-Nr.scrollLeft+getWindowScrollBarX($r),Ur=-Nr.scrollTop;return getComputedStyle(Dr||Mr).direction==="rtl"&&(jr+=max(Mr.clientWidth,Dr?Dr.clientWidth:0)-Br),{width:Br,height:Lr,x:jr,y:Ur}}function isScrollParent($r){var pr=getComputedStyle($r),Mr=pr.overflow,Nr=pr.overflowX,Dr=pr.overflowY;return/auto|scroll|overlay|hidden/.test(Mr+Dr+Nr)}function getScrollParent($r){return["html","body","#document"].indexOf(getNodeName($r))>=0?$r.ownerDocument.body:isHTMLElement($r)&&isScrollParent($r)?$r:getScrollParent(getParentNode($r))}function listScrollParents($r,pr){var Mr;pr===void 0&&(pr=[]);var Nr=getScrollParent($r),Dr=Nr===((Mr=$r.ownerDocument)==null?void 0:Mr.body),Br=getWindow(Nr),Lr=Dr?[Br].concat(Br.visualViewport||[],isScrollParent(Nr)?Nr:[]):Nr,jr=pr.concat(Lr);return Dr?jr:jr.concat(listScrollParents(getParentNode(Lr)))}function rectToClientRect($r){return Object.assign({},$r,{left:$r.x,top:$r.y,right:$r.x+$r.width,bottom:$r.y+$r.height})}function getInnerBoundingClientRect($r,pr){var Mr=getBoundingClientRect($r,!1,pr==="fixed");return Mr.top=Mr.top+$r.clientTop,Mr.left=Mr.left+$r.clientLeft,Mr.bottom=Mr.top+$r.clientHeight,Mr.right=Mr.left+$r.clientWidth,Mr.width=$r.clientWidth,Mr.height=$r.clientHeight,Mr.x=Mr.left,Mr.y=Mr.top,Mr}function getClientRectFromMixedType($r,pr,Mr){return pr===viewport?rectToClientRect(getViewportRect($r,Mr)):isElement(pr)?getInnerBoundingClientRect(pr,Mr):rectToClientRect(getDocumentRect(getDocumentElement($r)))}function getClippingParents($r){var pr=listScrollParents(getParentNode($r)),Mr=["absolute","fixed"].indexOf(getComputedStyle($r).position)>=0,Nr=Mr&&isHTMLElement($r)?getOffsetParent($r):$r;return isElement(Nr)?pr.filter(function(Dr){return isElement(Dr)&&contains(Dr,Nr)&&getNodeName(Dr)!=="body"}):[]}function getClippingRect($r,pr,Mr,Nr){var Dr=pr==="clippingParents"?getClippingParents($r):[].concat(pr),Br=[].concat(Dr,[Mr]),Lr=Br[0],jr=Br.reduce(function(Ur,Gr){var Yr=getClientRectFromMixedType($r,Gr,Nr);return Ur.top=max(Yr.top,Ur.top),Ur.right=min(Yr.right,Ur.right),Ur.bottom=min(Yr.bottom,Ur.bottom),Ur.left=max(Yr.left,Ur.left),Ur},getClientRectFromMixedType($r,Lr,Nr));return jr.width=jr.right-jr.left,jr.height=jr.bottom-jr.top,jr.x=jr.left,jr.y=jr.top,jr}function computeOffsets($r){var pr=$r.reference,Mr=$r.element,Nr=$r.placement,Dr=Nr?getBasePlacement(Nr):null,Br=Nr?getVariation(Nr):null,Lr=pr.x+pr.width/2-Mr.width/2,jr=pr.y+pr.height/2-Mr.height/2,Ur;switch(Dr){case top:Ur={x:Lr,y:pr.y-Mr.height};break;case bottom:Ur={x:Lr,y:pr.y+pr.height};break;case right$2:Ur={x:pr.x+pr.width,y:jr};break;case left$2:Ur={x:pr.x-Mr.width,y:jr};break;default:Ur={x:pr.x,y:pr.y}}var Gr=Dr?getMainAxisFromPlacement(Dr):null;if(Gr!=null){var Yr=Gr==="y"?"height":"width";switch(Br){case start:Ur[Gr]=Ur[Gr]-(pr[Yr]/2-Mr[Yr]/2);break;case end:Ur[Gr]=Ur[Gr]+(pr[Yr]/2-Mr[Yr]/2);break}}return Ur}function detectOverflow($r,pr){pr===void 0&&(pr={});var Mr=pr,Nr=Mr.placement,Dr=Nr===void 0?$r.placement:Nr,Br=Mr.strategy,Lr=Br===void 0?$r.strategy:Br,jr=Mr.boundary,Ur=jr===void 0?clippingParents:jr,Gr=Mr.rootBoundary,Yr=Gr===void 0?viewport:Gr,Qr=Mr.elementContext,Wn=Qr===void 0?popper:Qr,ga=Mr.altBoundary,eo=ga===void 0?!1:ga,_i=Mr.padding,va=_i===void 0?0:_i,io=mergePaddingObject(typeof va!="number"?va:expandToHashMap(va,basePlacements)),no=Wn===popper?reference:popper,so=$r.rects.popper,ao=$r.elements[eo?no:Wn],fo=getClippingRect(isElement(ao)?ao:ao.contextElement||getDocumentElement($r.elements.popper),Ur,Yr,Lr),lo=getBoundingClientRect($r.elements.reference),oo=computeOffsets({reference:lo,element:so,strategy:"absolute",placement:Dr}),po=rectToClientRect(Object.assign({},so,oo)),mo=Wn===popper?po:lo,$o={top:fo.top-mo.top+io.top,bottom:mo.bottom-fo.bottom+io.bottom,left:fo.left-mo.left+io.left,right:mo.right-fo.right+io.right},Xn=$r.modifiersData.offset;if(Wn===popper&&Xn){var Fr=Xn[Dr];Object.keys($o).forEach(function(Vr){var Wr=[right$2,bottom].indexOf(Vr)>=0?1:-1,Jr=[top,bottom].indexOf(Vr)>=0?"y":"x";$o[Vr]+=Fr[Jr]*Wr})}return $o}function computeAutoPlacement($r,pr){pr===void 0&&(pr={});var Mr=pr,Nr=Mr.placement,Dr=Mr.boundary,Br=Mr.rootBoundary,Lr=Mr.padding,jr=Mr.flipVariations,Ur=Mr.allowedAutoPlacements,Gr=Ur===void 0?placements:Ur,Yr=getVariation(Nr),Qr=Yr?jr?variationPlacements:variationPlacements.filter(function(eo){return getVariation(eo)===Yr}):basePlacements,Wn=Qr.filter(function(eo){return Gr.indexOf(eo)>=0});Wn.length===0&&(Wn=Qr);var ga=Wn.reduce(function(eo,_i){return eo[_i]=detectOverflow($r,{placement:_i,boundary:Dr,rootBoundary:Br,padding:Lr})[getBasePlacement(_i)],eo},{});return Object.keys(ga).sort(function(eo,_i){return ga[eo]-ga[_i]})}function getExpandedFallbackPlacements($r){if(getBasePlacement($r)===auto)return[];var pr=getOppositePlacement($r);return[getOppositeVariationPlacement($r),pr,getOppositeVariationPlacement(pr)]}function flip($r){var pr=$r.state,Mr=$r.options,Nr=$r.name;if(!pr.modifiersData[Nr]._skip){for(var Dr=Mr.mainAxis,Br=Dr===void 0?!0:Dr,Lr=Mr.altAxis,jr=Lr===void 0?!0:Lr,Ur=Mr.fallbackPlacements,Gr=Mr.padding,Yr=Mr.boundary,Qr=Mr.rootBoundary,Wn=Mr.altBoundary,ga=Mr.flipVariations,eo=ga===void 0?!0:ga,_i=Mr.allowedAutoPlacements,va=pr.options.placement,io=getBasePlacement(va),no=io===va,so=Ur||(no||!eo?[getOppositePlacement(va)]:getExpandedFallbackPlacements(va)),ao=[va].concat(so).reduce(function(go,bo){return go.concat(getBasePlacement(bo)===auto?computeAutoPlacement(pr,{placement:bo,boundary:Yr,rootBoundary:Qr,padding:Gr,flipVariations:eo,allowedAutoPlacements:_i}):bo)},[]),fo=pr.rects.reference,lo=pr.rects.popper,oo=new Map,po=!0,mo=ao[0],$o=0;$o<ao.length;$o++){var Xn=ao[$o],Fr=getBasePlacement(Xn),Vr=getVariation(Xn)===start,Wr=[top,bottom].indexOf(Fr)>=0,Jr=Wr?"width":"height",Gn=detectOverflow(pr,{placement:Xn,boundary:Yr,rootBoundary:Qr,altBoundary:Wn,padding:Gr}),to=Wr?Vr?right$2:left$2:Vr?bottom:top;fo[Jr]>lo[Jr]&&(to=getOppositePlacement(to));var ro=getOppositePlacement(to),Un=[];if(Br&&Un.push(Gn[Fr]<=0),jr&&Un.push(Gn[to]<=0,Gn[ro]<=0),Un.every(function(go){return go})){mo=Xn,po=!1;break}oo.set(Xn,Un)}if(po)for(var Hr=eo?3:1,Xr=function(bo){var Eo=ao.find(function(wo){var Io=oo.get(wo);if(Io)return Io.slice(0,bo).every(function(Po){return Po})});if(Eo)return mo=Eo,"break"},co=Hr;co>0;co--){var ho=Xr(co);if(ho==="break")break}pr.placement!==mo&&(pr.modifiersData[Nr]._skip=!0,pr.placement=mo,pr.reset=!0)}}const flip$1={name:"flip",enabled:!0,phase:"main",fn:flip,requiresIfExists:["offset"],data:{_skip:!1}};function getSideOffsets($r,pr,Mr){return Mr===void 0&&(Mr={x:0,y:0}),{top:$r.top-pr.height-Mr.y,right:$r.right-pr.width+Mr.x,bottom:$r.bottom-pr.height+Mr.y,left:$r.left-pr.width-Mr.x}}function isAnySideFullyClipped($r){return[top,right$2,bottom,left$2].some(function(pr){return $r[pr]>=0})}function hide($r){var pr=$r.state,Mr=$r.name,Nr=pr.rects.reference,Dr=pr.rects.popper,Br=pr.modifiersData.preventOverflow,Lr=detectOverflow(pr,{elementContext:"reference"}),jr=detectOverflow(pr,{altBoundary:!0}),Ur=getSideOffsets(Lr,Nr),Gr=getSideOffsets(jr,Dr,Br),Yr=isAnySideFullyClipped(Ur),Qr=isAnySideFullyClipped(Gr);pr.modifiersData[Mr]={referenceClippingOffsets:Ur,popperEscapeOffsets:Gr,isReferenceHidden:Yr,hasPopperEscaped:Qr},pr.attributes.popper=Object.assign({},pr.attributes.popper,{"data-popper-reference-hidden":Yr,"data-popper-escaped":Qr})}const hide$1={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hide};function distanceAndSkiddingToXY($r,pr,Mr){var Nr=getBasePlacement($r),Dr=[left$2,top].indexOf(Nr)>=0?-1:1,Br=typeof Mr=="function"?Mr(Object.assign({},pr,{placement:$r})):Mr,Lr=Br[0],jr=Br[1];return Lr=Lr||0,jr=(jr||0)*Dr,[left$2,right$2].indexOf(Nr)>=0?{x:jr,y:Lr}:{x:Lr,y:jr}}function offset($r){var pr=$r.state,Mr=$r.options,Nr=$r.name,Dr=Mr.offset,Br=Dr===void 0?[0,0]:Dr,Lr=placements.reduce(function(Yr,Qr){return Yr[Qr]=distanceAndSkiddingToXY(Qr,pr.rects,Br),Yr},{}),jr=Lr[pr.placement],Ur=jr.x,Gr=jr.y;pr.modifiersData.popperOffsets!=null&&(pr.modifiersData.popperOffsets.x+=Ur,pr.modifiersData.popperOffsets.y+=Gr),pr.modifiersData[Nr]=Lr}const offset$1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:offset};function popperOffsets($r){var pr=$r.state,Mr=$r.name;pr.modifiersData[Mr]=computeOffsets({reference:pr.rects.reference,element:pr.rects.popper,strategy:"absolute",placement:pr.placement})}const popperOffsets$1={name:"popperOffsets",enabled:!0,phase:"read",fn:popperOffsets,data:{}};function getAltAxis($r){return $r==="x"?"y":"x"}function preventOverflow($r){var pr=$r.state,Mr=$r.options,Nr=$r.name,Dr=Mr.mainAxis,Br=Dr===void 0?!0:Dr,Lr=Mr.altAxis,jr=Lr===void 0?!1:Lr,Ur=Mr.boundary,Gr=Mr.rootBoundary,Yr=Mr.altBoundary,Qr=Mr.padding,Wn=Mr.tether,ga=Wn===void 0?!0:Wn,eo=Mr.tetherOffset,_i=eo===void 0?0:eo,va=detectOverflow(pr,{boundary:Ur,rootBoundary:Gr,padding:Qr,altBoundary:Yr}),io=getBasePlacement(pr.placement),no=getVariation(pr.placement),so=!no,ao=getMainAxisFromPlacement(io),fo=getAltAxis(ao),lo=pr.modifiersData.popperOffsets,oo=pr.rects.reference,po=pr.rects.popper,mo=typeof _i=="function"?_i(Object.assign({},pr.rects,{placement:pr.placement})):_i,$o=typeof mo=="number"?{mainAxis:mo,altAxis:mo}:Object.assign({mainAxis:0,altAxis:0},mo),Xn=pr.modifiersData.offset?pr.modifiersData.offset[pr.placement]:null,Fr={x:0,y:0};if(lo){if(Br){var Vr,Wr=ao==="y"?top:left$2,Jr=ao==="y"?bottom:right$2,Gn=ao==="y"?"height":"width",to=lo[ao],ro=to+va[Wr],Un=to-va[Jr],Hr=ga?-po[Gn]/2:0,Xr=no===start?oo[Gn]:po[Gn],co=no===start?-po[Gn]:-oo[Gn],ho=pr.elements.arrow,go=ga&&ho?getLayoutRect(ho):{width:0,height:0},bo=pr.modifiersData["arrow#persistent"]?pr.modifiersData["arrow#persistent"].padding:getFreshSideObject(),Eo=bo[Wr],wo=bo[Jr],Io=within(0,oo[Gn],go[Gn]),Po=so?oo[Gn]/2-Hr-Io-Eo-$o.mainAxis:Xr-Io-Eo-$o.mainAxis,yo=so?-oo[Gn]/2+Hr+Io+wo+$o.mainAxis:co+Io+wo+$o.mainAxis,xo=pr.elements.arrow&&getOffsetParent(pr.elements.arrow),Mo=xo?ao==="y"?xo.clientTop||0:xo.clientLeft||0:0,qo=(Vr=Xn==null?void 0:Xn[ao])!=null?Vr:0,pu=to+Po-qo-Mo,nu=to+yo-qo,eu=within(ga?min(ro,pu):ro,to,ga?max(Un,nu):Un);lo[ao]=eu,Fr[ao]=eu-to}if(jr){var Uu,mu=ao==="x"?top:left$2,Jo=ao==="x"?bottom:right$2,Zu=lo[fo],su=fo==="y"?"height":"width",Ru=Zu+va[mu],tl=Zu-va[Jo],Pu=[top,left$2].indexOf(io)!==-1,Tu=(Uu=Xn==null?void 0:Xn[fo])!=null?Uu:0,ll=Pu?Ru:Zu-oo[su]-po[su]-Tu+$o.altAxis,Su=Pu?Zu+oo[su]+po[su]-Tu-$o.altAxis:tl,Ou=ga&&Pu?withinMaxClamp(ll,Zu,Su):within(ga?ll:Ru,Zu,ga?Su:tl);lo[fo]=Ou,Fr[fo]=Ou-Zu}pr.modifiersData[Nr]=Fr}}const preventOverflow$1={name:"preventOverflow",enabled:!0,phase:"main",fn:preventOverflow,requiresIfExists:["offset"]};function getHTMLElementScroll($r){return{scrollLeft:$r.scrollLeft,scrollTop:$r.scrollTop}}function getNodeScroll($r){return $r===getWindow($r)||!isHTMLElement($r)?getWindowScroll($r):getHTMLElementScroll($r)}function isElementScaled($r){var pr=$r.getBoundingClientRect(),Mr=round(pr.width)/$r.offsetWidth||1,Nr=round(pr.height)/$r.offsetHeight||1;return Mr!==1||Nr!==1}function getCompositeRect($r,pr,Mr){Mr===void 0&&(Mr=!1);var Nr=isHTMLElement(pr),Dr=isHTMLElement(pr)&&isElementScaled(pr),Br=getDocumentElement(pr),Lr=getBoundingClientRect($r,Dr,Mr),jr={scrollLeft:0,scrollTop:0},Ur={x:0,y:0};return(Nr||!Nr&&!Mr)&&((getNodeName(pr)!=="body"||isScrollParent(Br))&&(jr=getNodeScroll(pr)),isHTMLElement(pr)?(Ur=getBoundingClientRect(pr,!0),Ur.x+=pr.clientLeft,Ur.y+=pr.clientTop):Br&&(Ur.x=getWindowScrollBarX(Br))),{x:Lr.left+jr.scrollLeft-Ur.x,y:Lr.top+jr.scrollTop-Ur.y,width:Lr.width,height:Lr.height}}function order($r){var pr=new Map,Mr=new Set,Nr=[];$r.forEach(function(Br){pr.set(Br.name,Br)});function Dr(Br){Mr.add(Br.name);var Lr=[].concat(Br.requires||[],Br.requiresIfExists||[]);Lr.forEach(function(jr){if(!Mr.has(jr)){var Ur=pr.get(jr);Ur&&Dr(Ur)}}),Nr.push(Br)}return $r.forEach(function(Br){Mr.has(Br.name)||Dr(Br)}),Nr}function orderModifiers($r){var pr=order($r);return modifierPhases.reduce(function(Mr,Nr){return Mr.concat(pr.filter(function(Dr){return Dr.phase===Nr}))},[])}function debounce($r){var pr;return function(){return pr||(pr=new Promise(function(Mr){Promise.resolve().then(function(){pr=void 0,Mr($r())})})),pr}}function mergeByName($r){var pr=$r.reduce(function(Mr,Nr){var Dr=Mr[Nr.name];return Mr[Nr.name]=Dr?Object.assign({},Dr,Nr,{options:Object.assign({},Dr.options,Nr.options),data:Object.assign({},Dr.data,Nr.data)}):Nr,Mr},{});return Object.keys(pr).map(function(Mr){return pr[Mr]})}var DEFAULT_OPTIONS={placement:"bottom",modifiers:[],strategy:"absolute"};function areValidElements(){for(var $r=arguments.length,pr=new Array($r),Mr=0;Mr<$r;Mr++)pr[Mr]=arguments[Mr];return!pr.some(function(Nr){return!(Nr&&typeof Nr.getBoundingClientRect=="function")})}function popperGenerator($r){$r===void 0&&($r={});var pr=$r,Mr=pr.defaultModifiers,Nr=Mr===void 0?[]:Mr,Dr=pr.defaultOptions,Br=Dr===void 0?DEFAULT_OPTIONS:Dr;return function(jr,Ur,Gr){Gr===void 0&&(Gr=Br);var Yr={placement:"bottom",orderedModifiers:[],options:Object.assign({},DEFAULT_OPTIONS,Br),modifiersData:{},elements:{reference:jr,popper:Ur},attributes:{},styles:{}},Qr=[],Wn=!1,ga={state:Yr,setOptions:function(io){var no=typeof io=="function"?io(Yr.options):io;_i(),Yr.options=Object.assign({},Br,Yr.options,no),Yr.scrollParents={reference:isElement(jr)?listScrollParents(jr):jr.contextElement?listScrollParents(jr.contextElement):[],popper:listScrollParents(Ur)};var so=orderModifiers(mergeByName([].concat(Nr,Yr.options.modifiers)));return Yr.orderedModifiers=so.filter(function(ao){return ao.enabled}),eo(),ga.update()},forceUpdate:function(){if(!Wn){var io=Yr.elements,no=io.reference,so=io.popper;if(areValidElements(no,so)){Yr.rects={reference:getCompositeRect(no,getOffsetParent(so),Yr.options.strategy==="fixed"),popper:getLayoutRect(so)},Yr.reset=!1,Yr.placement=Yr.options.placement,Yr.orderedModifiers.forEach(function($o){return Yr.modifiersData[$o.name]=Object.assign({},$o.data)});for(var ao=0;ao<Yr.orderedModifiers.length;ao++){if(Yr.reset===!0){Yr.reset=!1,ao=-1;continue}var fo=Yr.orderedModifiers[ao],lo=fo.fn,oo=fo.options,po=oo===void 0?{}:oo,mo=fo.name;typeof lo=="function"&&(Yr=lo({state:Yr,options:po,name:mo,instance:ga})||Yr)}}}},update:debounce(function(){return new Promise(function(va){ga.forceUpdate(),va(Yr)})}),destroy:function(){_i(),Wn=!0}};if(!areValidElements(jr,Ur))return ga;ga.setOptions(Gr).then(function(va){!Wn&&Gr.onFirstUpdate&&Gr.onFirstUpdate(va)});function eo(){Yr.orderedModifiers.forEach(function(va){var io=va.name,no=va.options,so=no===void 0?{}:no,ao=va.effect;if(typeof ao=="function"){var fo=ao({state:Yr,name:io,instance:ga,options:so}),lo=function(){};Qr.push(fo||lo)}})}function _i(){Qr.forEach(function(va){return va()}),Qr=[]}return ga}}var defaultModifiers=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1,offset$1,flip$1,preventOverflow$1,arrow$1,hide$1],createPopper=popperGenerator({defaultModifiers}),EMPTY_MODIFIERS$1=[],usePopper=function(pr,Mr,Nr){Nr===void 0&&(Nr={});var Dr=reactExports.useRef(null),Br={onFirstUpdate:Nr.onFirstUpdate,placement:Nr.placement||"bottom",strategy:Nr.strategy||"absolute",modifiers:Nr.modifiers||EMPTY_MODIFIERS$1},Lr=reactExports.useState({styles:{popper:{position:Br.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),jr=Lr[0],Ur=Lr[1],Gr=reactExports.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(ga){var eo=ga.state,_i=Object.keys(eo.elements);reactDomExports.flushSync(function(){Ur({styles:fromEntries(_i.map(function(va){return[va,eo.styles[va]||{}]})),attributes:fromEntries(_i.map(function(va){return[va,eo.attributes[va]]}))})})},requires:["computeStyles"]}},[]),Yr=reactExports.useMemo(function(){var Wn={onFirstUpdate:Br.onFirstUpdate,placement:Br.placement,strategy:Br.strategy,modifiers:[].concat(Br.modifiers,[Gr,{name:"applyStyles",enabled:!1}])};return isEqual$1(Dr.current,Wn)?Dr.current||Wn:(Dr.current=Wn,Wn)},[Br.onFirstUpdate,Br.placement,Br.strategy,Br.modifiers,Gr]),Qr=reactExports.useRef();return useIsomorphicLayoutEffect(function(){Qr.current&&Qr.current.setOptions(Yr)},[Yr]),useIsomorphicLayoutEffect(function(){if(!(pr==null||Mr==null)){var Wn=Nr.createPopper||createPopper,ga=Wn(pr,Mr,Yr);return Qr.current=ga,function(){ga.destroy(),Qr.current=null}}},[pr,Mr,Nr.createPopper]),{state:Qr.current?Qr.current.state:null,styles:jr.styles,attributes:jr.attributes,update:Qr.current?Qr.current.update:null,forceUpdate:Qr.current?Qr.current.forceUpdate:null}},NOOP=function(){},NOOP_PROMISE=function(){return Promise.resolve(null)},EMPTY_MODIFIERS=[];function Popper($r){var pr=$r.placement,Mr=pr===void 0?"bottom":pr,Nr=$r.strategy,Dr=Nr===void 0?"absolute":Nr,Br=$r.modifiers,Lr=Br===void 0?EMPTY_MODIFIERS:Br,jr=$r.referenceElement,Ur=$r.onFirstUpdate,Gr=$r.innerRef,Yr=$r.children,Qr=reactExports.useContext(ManagerReferenceNodeContext),Wn=reactExports.useState(null),ga=Wn[0],eo=Wn[1],_i=reactExports.useState(null),va=_i[0],io=_i[1];reactExports.useEffect(function(){setRef(Gr,ga)},[Gr,ga]);var no=reactExports.useMemo(function(){return{placement:Mr,strategy:Dr,onFirstUpdate:Ur,modifiers:[].concat(Lr,[{name:"arrow",enabled:va!=null,options:{element:va}}])}},[Mr,Dr,Ur,Lr,va]),so=usePopper(jr||Qr,ga,no),ao=so.state,fo=so.styles,lo=so.forceUpdate,oo=so.update,po=reactExports.useMemo(function(){return{ref:eo,style:fo.popper,placement:ao?ao.placement:Mr,hasPopperEscaped:ao&&ao.modifiersData.hide?ao.modifiersData.hide.hasPopperEscaped:null,isReferenceHidden:ao&&ao.modifiersData.hide?ao.modifiersData.hide.isReferenceHidden:null,arrowProps:{style:fo.arrow,ref:io},forceUpdate:lo||NOOP,update:oo||NOOP_PROMISE}},[eo,io,Mr,ao,fo,oo,lo]);return unwrapArray(Yr)(po)}var warning=function(){},warning_1=warning;const warning$1=getDefaultExportFromCjs$1(warning_1);function Reference($r){var pr=$r.children,Mr=$r.innerRef,Nr=reactExports.useContext(ManagerReferenceNodeSetterContext),Dr=reactExports.useCallback(function(Br){setRef(Mr,Br),safeInvoke(Nr,Br)},[Mr,Nr]);return reactExports.useEffect(function(){return function(){return setRef(Mr,null)}},[]),reactExports.useEffect(function(){warning$1(!!Nr,"`Reference` should not be used outside of a `Manager` component.")},[Nr]),unwrapArray(pr)({ref:Dr})}const esm=Object.freeze(Object.defineProperty({__proto__:null,Manager,Popper,Reference,usePopper},Symbol.toStringTag,{value:"Module"}));function _defineProperties($r,pr){for(var Mr=0;Mr<pr.length;Mr++){var Nr=pr[Mr];Nr.enumerable=Nr.enumerable||!1,Nr.configurable=!0,"value"in Nr&&(Nr.writable=!0),Object.defineProperty($r,Nr.key,Nr)}}function _createClass($r,pr,Mr){return pr&&_defineProperties($r.prototype,pr),Mr&&_defineProperties($r,Mr),Object.defineProperty($r,"prototype",{writable:!1}),$r}function _extends(){return _extends=Object.assign?Object.assign.bind():function($r){for(var pr=1;pr<arguments.length;pr++){var Mr=arguments[pr];for(var Nr in Mr)Object.prototype.hasOwnProperty.call(Mr,Nr)&&($r[Nr]=Mr[Nr])}return $r},_extends.apply(this,arguments)}function _inheritsLoose($r,pr){$r.prototype=Object.create(pr.prototype),$r.prototype.constructor=$r,_setPrototypeOf($r,pr)}function _setPrototypeOf($r,pr){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Nr,Dr){return Nr.__proto__=Dr,Nr},_setPrototypeOf($r,pr)}function _objectWithoutPropertiesLoose($r,pr){if($r==null)return{};var Mr={},Nr=Object.keys($r),Dr,Br;for(Br=0;Br<Nr.length;Br++)Dr=Nr[Br],!(pr.indexOf(Dr)>=0)&&(Mr[Dr]=$r[Dr]);return Mr}var keys={enter:13,escape:27,space:32},isSelectable=function(pr,Mr,Nr){return!(Mr&&isBefore$1(pr,Mr)||Nr&&isBefore$1(Nr,pr))},getToday=function(pr,Mr){var Nr=new Date;return{date:startOfDay$1(Nr),nextMonth:!1,prevMonth:!1,selectable:isSelectable(Nr,pr,Mr),selected:!1,today:!0}},formatDate=function(pr,Mr,Nr){return pr?format(startOfDay$1(pr),convertTokens_2(Mr),Nr):void 0},omit=function(pr,Mr){var Nr=_extends({},Mr);return pr.forEach(function(Dr){return delete Nr[Dr]}),Nr},pick=function(pr,Mr){var Nr={};return pr.forEach(function(Dr){Nr[Dr]=Mr[Dr]}),Nr},moveElementsByN=function(pr,Mr){return Mr.slice(pr).concat(Mr.slice(0,pr))},formatSelectedDate=function(pr,Mr,Nr){return pr?Array.isArray(pr)?pr.map(function(Dr){return formatDate(Dr,Mr,Nr)}).join(" - "):formatDate(pr,Mr,Nr):""},parseFormatString=function(pr){return pr.replace(/[D, Y]/gi,function(Mr){return Mr.toLowerCase()})},parseOnBlur=function(pr,Mr){return parse(pr,parseFormatString(Mr),new Date)},parseRangeOnBlur=function(pr,Mr){var Nr=parseFormatString(Mr),Dr=pr.split(" - ");return Dr.map(function(Br){return parse(Br,Nr,new Date)}).sort(function(Br,Lr){return Br>Lr?1:-1})},onlyNumbers=function(pr){return pr===void 0&&(pr=""),pr.replace(/[^\d]/g,"")};function getShortDate($r){if($r)return format($r,"yyyy-MM-dd")}function composeEventHandlers(){for(var $r=arguments.length,pr=new Array($r),Mr=0;Mr<$r;Mr++)pr[Mr]=arguments[Mr];return function(Nr){for(var Dr=arguments.length,Br=new Array(Dr>1?Dr-1:0),Lr=1;Lr<Dr;Lr++)Br[Lr-1]=arguments[Lr];return pr.some(function(jr){return jr&&jr.apply(void 0,[Nr].concat(Br)),Nr.defaultPrevented})}}function getArrowKeyHandlers($r){return function(pr){var Mr=pr.keyCode,Nr={37:$r.left,39:$r.right,38:$r.up,40:$r.down}[Mr];Nr&&Nr(pr)}}function isInRange($r,pr){return $r.length===2&&$r[0]<=pr&&$r[1]>=pr}var _excluded$6=["refKey"],_excluded2$1=["children"],BaseDatePicker=function($r){_inheritsLoose(pr,$r);function pr(){for(var Nr,Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=$r.call.apply($r,[this].concat(Br))||this,Nr.state={offset:0},Nr.rootNode=React$5.createRef(),Nr.handleArrowKeys=getArrowKeyHandlers({left:function(){return Nr.getKeyOffset(-1)},right:function(){return Nr.getKeyOffset(1)},up:function(){return Nr.getKeyOffset(-7)},down:function(){return Nr.getKeyOffset(7)}}),Nr.getRootProps=function(jr){var Ur,Gr=jr===void 0?{}:jr,Yr=Gr.refKey,Qr=Yr===void 0?"ref":Yr,Wn=_objectWithoutPropertiesLoose(Gr,_excluded$6);return _extends((Ur={},Ur[Qr]=Nr.rootNode,Ur.onKeyDown=Nr.handleArrowKeys,Ur),Wn)},Nr._handleOffsetChanged=function(jr){Nr.setState({offset:jr})},Nr}var Mr=pr.prototype;return Mr.getKeyOffset=function(Dr){if(this.rootNode.current){var Br=document.activeElement,Lr=Array.from(this.rootNode.current.querySelectorAll("button:not(:disabled)"));Lr.some(function(jr,Ur){var Gr=Ur+Dr;return jr!==Br?!1:Gr<=Lr.length-1&&Gr>=0?(Lr[Gr].focus(),!0):(Lr[0].focus(),!0)})}},Mr.componentDidUpdate=function(Dr){this.props.date!==Dr.date&&this._handleOffsetChanged(0)},Mr.render=function(){var Dr=this,Br=this.props,Lr=Br.children,jr=_objectWithoutPropertiesLoose(Br,_excluded2$1);return jsxRuntimeExports.jsx(Dayzed,_extends({},jr,{offset:this.state.offset,onOffsetChanged:this._handleOffsetChanged,render:function(Gr){return Lr(_extends({},Gr,{getRootProps:Dr.getRootProps}))}}))},pr}(React$5.Component),DatePicker=function($r){_inheritsLoose(pr,$r);function pr(){for(var Nr,Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=$r.call.apply($r,[this].concat(Br))||this,Nr._handleOnDateSelected=function(jr,Ur){var Gr=jr.selectable,Yr=jr.date,Qr=Nr.props,Wn=Qr.clearOnSameDateClick,ga=Qr.selected,eo=Qr.onChange;if(Gr){var _i=Yr;ga&&ga.getTime()===Yr.getTime()&&Wn&&(_i=null),eo&&eo(Ur,_i)}},Nr}var Mr=pr.prototype;return Mr.render=function(){return jsxRuntimeExports.jsx(BaseDatePicker,_extends({},this.props,{onDateSelected:this._handleOnDateSelected}))},pr}(React$5.Component),_excluded$5=["onMouseEnter","onFocus"],_excluded2=["children"],_excluded3=["getRootProps","getDateProps"],RangeDatePicker=function($r){_inheritsLoose(pr,$r);function pr(){for(var Nr,Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=$r.call.apply($r,[this].concat(Br))||this,Nr.state={hoveredDate:null},Nr.setHoveredDate=function(jr){Nr.setState(function(Ur){return Ur.hoveredDate===jr?null:{hoveredDate:jr}})},Nr.onMouseLeave=function(){Nr.setHoveredDate(null)},Nr._handleOnDateSelected=function(jr,Ur){var Gr=jr.selectable,Yr=jr.date,Qr=Nr.props,Wn=Qr.selected,ga=Qr.onChange;if(Gr){var eo=Yr.getTime(),_i=[].concat(Wn);if(Wn.length)if(Wn.length===1){var va=Wn[0].getTime();va<eo?_i.push(Yr):_i.unshift(Yr)}else _i.length===2&&(_i=[Yr]);else _i.push(Yr);ga&&ga(Ur,_i),_i.length===2&&Nr.setHoveredDate(null)}},Nr.getEnhancedDateProps=function(jr,Ur,Gr){var Yr=Gr.onMouseEnter,Qr=Gr.onFocus,Wn=_objectWithoutPropertiesLoose(Gr,_excluded$5),ga=Nr.state.hoveredDate,eo=Wn.dateObj.date;return jr(_extends({},Wn,{inRange:isInRange(Ur,eo),start:Ur[0]&&isSameDay(Ur[0],eo),end:Ur[1]&&isSameDay(Ur[1],eo),hovered:ga&&isSameDay(ga,eo),onMouseEnter:composeEventHandlers(Yr,function(){Nr.onHoverFocusDate(eo)}),onFocus:composeEventHandlers(Qr,function(){Nr.onHoverFocusDate(eo)})}))},Nr.getEnhancedRootProps=function(jr,Ur){return jr(_extends({},Ur,{onMouseLeave:Nr.onMouseLeave}))},Nr}var Mr=pr.prototype;return Mr.onHoverFocusDate=function(Dr){this.props.selected.length===1&&this.setHoveredDate(Dr)},Mr.render=function(){var Dr=this,Br=this.props,Lr=Br.children,jr=_objectWithoutPropertiesLoose(Br,_excluded2),Ur=this.state.hoveredDate,Gr=this.props.selected,Yr=Gr.length===2||!Gr.length||!Ur?Gr:[Gr[0],Ur].sort(compareAsc);return jsxRuntimeExports.jsx(BaseDatePicker,_extends({},jr,{onDateSelected:this._handleOnDateSelected,children:function(Wn){var ga=Wn.getRootProps,eo=Wn.getDateProps,_i=_objectWithoutPropertiesLoose(Wn,_excluded3);return Lr(_extends({},_i,{getRootProps:Dr.getEnhancedRootProps.bind(Dr,ga),getDateProps:Dr.getEnhancedDateProps.bind(Dr,eo,Yr)}))}}))},pr}(React$5.Component);RangeDatePicker.defaultProps={selected:[]};var _excluded$4=["icon"],CustomButton=function(pr){var Mr=pr.icon,Nr=_objectWithoutPropertiesLoose(pr,_excluded$4);return jsxRuntimeExports.jsx(Button$2,_extends({basic:!0,compact:!0,icon:Mr,type:"button"},Nr))};function styleInject($r,pr){pr===void 0&&(pr={});var Mr=pr.insertAt;if(!(!$r||typeof document>"u")){var Nr=document.head||document.getElementsByTagName("head")[0],Dr=document.createElement("style");Dr.type="text/css",Mr==="top"&&Nr.firstChild?Nr.insertBefore(Dr,Nr.firstChild):Nr.appendChild(Dr),Dr.styleSheet?Dr.styleSheet.cssText=$r:Dr.appendChild(document.createTextNode($r))}}var css_248z$1=".clndr-cell{background-color:#fff;border:none;color:inherit;cursor:pointer;font-family:inherit;height:30px;padding:5px 0;transition:all .2s}.clndr-cell.inverted{background-color:#4f4f4f}.clndr-cell.inverted:hover{background-color:#757575;color:inherit}.clndr-cell:hover{background-color:#cacbcd;color:inherit}.clndr-cell-today{background-color:#e0e1e2}.clndr-cell-inrange{background-color:#cacbcd;color:inherit}.clndr-cell-inrange.inverted{background-color:#757575;color:inherit}.clndr-cell-disabled{cursor:default;opacity:.45}.clndr-cell-disabled:hover{background-color:#fff}.clndr-cell-disabled.inverted:hover{background-color:#4f4f4f;color:inherit}.clndr-cell-selected{background-color:#4f4f4f;color:#f2f2f2}.clndr-cell-selected.inverted{background-color:#fff;color:#000}.clndr-cell-other-month{color:#d9d9d9}.clndr-cell-other-month.inverted{color:#a6a6a6}";styleInject(css_248z$1);var _excluded$3=["children","end","hovered","inRange","inverted","nextMonth","prevMonth","selectable","selected","start","today"],CalendarCell=function(pr){var Mr=pr.children,Nr=pr.inRange,Dr=pr.inverted,Br=pr.nextMonth,Lr=pr.prevMonth,jr=pr.selectable,Ur=pr.selected,Gr=pr.today,Yr=_objectWithoutPropertiesLoose(pr,_excluded$3),Qr=classNames("clndr-cell",{inverted:Dr,"clndr-cell-today":Gr,"clndr-cell-disabled":!jr,"clndr-cell-other-month":Br||Lr,"clndr-cell-inrange":Nr,"clndr-cell-selected":Ur});return Mr?jsxRuntimeExports.jsx("button",_extends({className:Qr,disabled:!jr,type:"button"},Yr,{children:Mr})):jsxRuntimeExports.jsx("span",_extends({className:Qr,tabIndex:Mr?0:-1},Yr,{children:Mr}))};CalendarCell.defaultProps={end:!1,hovered:!1,inRange:!1,nextMonth:!1,prevMonth:!1,start:!1};var _excluded$2=["aria-label","children","end","hovered","inRange","nextMonth","prevMonth","selectable","selected","start","today"],style$1={marginTop:10},TodayButton=function(pr){var Mr=pr["aria-label"],Nr=pr.children,Dr=_objectWithoutPropertiesLoose(pr,_excluded$2);return jsxRuntimeExports.jsx(Button$2,_extends({"aria-label":Mr+", "+Nr,className:"clndr-button-today",compact:!0,"data-testid":"datepicker-today-button",fluid:!0,style:style$1,type:"button"},Dr,{children:Nr}))},css_248z=".clndr-calendars-segment{margin-bottom:.25rem!important;margin-top:.25rem!important;text-align:center}.clndr-calendars-segment.clndr-floating{position:absolute!important;z-index:2000}.clndr-calendars-wrapper{grid-gap:1em;display:grid;grid-template-columns:repeat(var(--n,1),1fr)}.clndr-control{align-items:center;display:grid;grid-template-columns:repeat(3,1fr);margin-bottom:10px}.clndr-days{grid-gap:1px;background-color:rgba(0,0,0,.1);border:1px solid rgba(0,0,0,.1);border-radius:.28571429rem;display:grid;grid-template-columns:repeat(7,minmax(2.2rem,1fr));overflow:hidden;text-align:center}.clndr-left{left:0}.clndr-right{right:0}.clndr-top{bottom:100%}.clndr-bottom{top:100%}.clndr-calendars-segment.clndr-top{box-shadow:0 -1px 2px 0 rgba(34,36,38,.15)!important;margin-bottom:.25rem!important}";styleInject(css_248z);var _excluded$1=["ref"],styles$9={leftBtn:{textAlign:"start"},rightBtn:{textAlign:"end"}},pointings={"top left":"clndr-top clndr-left","top right":"clndr-top clndr-right",left:"clndr-left",right:"clndr-right"},Calendar=function(pr){var Mr,Nr=pr.calendars,Dr=pr.filterDate,Br=pr.getBackProps,Lr=pr.getDateProps,jr=pr.getForwardProps,Ur=pr.getRootProps,Gr=pr.inline,Yr=pr.inverted,Qr=pr.maxDate,Wn=pr.minDate,ga=pr.months,eo=pr.nextMonth,_i=pr.nextYear,va=pr.previousMonth,io=pr.previousYear,no=pr.showToday,so=pr.todayButton,ao=pr.weekdays,fo=pr.pointing,lo=Ur(),oo=lo.ref,po=_objectWithoutPropertiesLoose(lo,_excluded$1),mo=reactExports.useRef(),$o=function(Fr){mo.current=Fr.target.getAttribute("aria-label")};return reactExports.useEffect(function(){if(mo.current){var Xn='[aria-label="'+mo.current+'"]',Fr=document.querySelector(Xn);Fr&&document.activeElement!==Fr&&Fr.focus()}}),jsxRuntimeExports.jsx(Ref,{innerRef:oo,children:jsxRuntimeExports.jsxs(Segment,_extends({},po,{inverted:Yr,className:classNames("clndr-calendars-segment",(Mr={"clndr-floating":!Gr},Mr[pointings[fo]]=!Gr,Mr)),children:[jsxRuntimeExports.jsx("div",{className:"clndr-calendars-wrapper",style:{"--n":Nr.length},children:Nr.map(function(Xn,Fr){return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("div",{className:"clndr-control",children:[jsxRuntimeExports.jsx("div",{style:styles$9.leftBtn,children:Fr===0&&jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(CustomButton,_extends({icon:"angle double left",inverted:Yr,title:io,type:"button"},Br({calendars:Nr,"aria-label":io,offset:12,onClick:$o}))),jsxRuntimeExports.jsx(CustomButton,_extends({icon:"angle left",inverted:Yr,style:{marginRight:0},title:va,type:"button"},Br({calendars:Nr,"aria-label":va,onClick:$o})))]})}),jsxRuntimeExports.jsxs("span",{title:ga[Xn.month]+" "+Xn.year,children:[ga[Xn.month].slice(0,3)," ",Xn.year]}),jsxRuntimeExports.jsx("div",{style:styles$9.rightBtn,children:Fr===Nr.length-1&&jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(CustomButton,_extends({icon:"angle right",inverted:Yr,title:eo,type:"button"},jr({calendars:Nr,"aria-label":eo,onClick:$o}))),jsxRuntimeExports.jsx(CustomButton,_extends({icon:"angle double right",inverted:Yr,style:{marginRight:0},title:_i,type:"button"},jr({calendars:Nr,"aria-label":_i,offset:12,onClick:$o})))]})})]}),jsxRuntimeExports.jsxs("div",{className:"clndr-days",children:[ao.map(function(Vr){return jsxRuntimeExports.jsx(CalendarCell,{inverted:Yr,"aria-label":Vr,title:Vr,children:Vr.slice(0,2)},Xn.year+"-"+Xn.month+"-"+Vr)}),Xn.weeks.map(function(Vr){return Vr.map(function(Wr,Jr){var Gn=Xn.year+"-"+Xn.month+"-"+Jr;if(!Wr)return jsxRuntimeExports.jsx(CalendarCell,{inverted:Yr},Gn);var to=Wr.selectable&&Dr(Wr.date),ro=getShortDate(Wr.date);return jsxRuntimeExports.jsx(CalendarCell,_extends({},Wr,Lr({dateObj:_extends({},Wr,{selectable:to}),onClick:$o}),{"data-testid":"datepicker-cell-"+ro,inverted:Yr,selectable:to,children:Wr.date.getDate()}),Gn)})})]})]},Xn.year+"-"+Xn.month)})}),no?jsxRuntimeExports.jsx(TodayButton,_extends({inverted:Yr},getToday(Wn,Qr),Lr({dateObj:getToday(Wn,Qr),onClick:$o}),{children:so})):null]}))})},CustomIcon=function(pr){var Mr=pr.clearIcon,Nr=pr.icon,Dr=pr.isClearIconVisible,Br=pr.onClear,Lr=pr.onClick;return Dr&&Mr&&React$5.isValidElement(Mr)?React$5.cloneElement(Mr,{"data-testid":"datepicker-clear-icon",onClick:Br}):Dr&&Mr&&!React$5.isValidElement(Mr)?jsxRuntimeExports.jsx(Icon$2,{"aria-pressed":"false","data-testid":"datepicker-clear-icon",link:!0,name:Mr,onClick:Br}):Nr&&React$5.isValidElement(Nr)?React$5.cloneElement(Nr,{"data-testid":"datepicker-icon",onClick:Lr}):jsxRuntimeExports.jsx(Icon$2,{"data-testid":"datepicker-icon",name:Nr})},_excluded=["clearIcon","error","icon","isClearIconVisible","label","onClear","onFocus","required","value"],inputData={"data-testid":"datepicker-input"},CustomInput=React$5.forwardRef(function($r,pr){var Mr=$r.clearIcon,Nr=$r.error,Dr=$r.icon,Br=$r.isClearIconVisible,Lr=$r.label,jr=$r.onClear,Ur=$r.onFocus,Gr=$r.required,Yr=$r.value,Qr=_objectWithoutPropertiesLoose($r,_excluded);return jsxRuntimeExports.jsxs(Form$1.Field,{error:Nr,required:Gr,children:[Lr?jsxRuntimeExports.jsx("label",{htmlFor:Qr.id,children:Lr}):null,jsxRuntimeExports.jsx(Input$3,_extends({},Qr,{ref:pr,error:Nr,required:Gr,icon:jsxRuntimeExports.jsx(CustomIcon,{clearIcon:Mr,icon:Dr,isClearIconVisible:Br,onClear:jr,onClick:Ur}),input:inputData,onFocus:Ur,value:Yr}))]})}),style={display:"inline-block",position:"relative"},semanticInputProps=["autoComplete","autoFocus","className","clearIcon","disabled","error","icon","iconPosition","id","label","loading","name","onBlur","onChange","onClick","onContextMenu","onDoubleClick","onFocus","onInput","onKeyDown","onKeyPress","onKeyUp","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","placeholder","required","size","tabIndex","transparent","readOnly"],SemanticDatepicker=function($r){_inheritsLoose(pr,$r);function pr(){for(var Nr,Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=$r.call.apply($r,[this].concat(Br))||this,Nr.el=React$5.createRef(),Nr.inputRef=React$5.createRef(),Nr.state=Nr.initialState,Nr.Component=Nr.isRangeInput?RangeDatePicker:DatePicker,Nr.resetState=function(jr){var Ur=Nr.props,Gr=Ur.keepOpenOnClear,Yr=Ur.onChange,Qr={isVisible:Gr,selectedDate:Nr.isRangeInput?[]:null,selectedDateFormatted:""};Gr&&Nr.focusOnInput(),Nr.setState(Qr,function(){Yr(jr,_extends({},Nr.props,{value:null}))})},Nr.clearInput=function(jr){Nr.resetState(jr)},Nr.mousedownCb=function(jr){var Ur=Nr.state.isVisible;Ur&&Nr.el&&Nr.el.current&&!Nr.el.current.contains(jr.target)&&Nr.close()},Nr.keydownCb=function(jr){var Ur=Nr.state.isVisible;jr.keyCode===keys.escape&&Ur&&Nr.close()},Nr.close=function(){window.removeEventListener("keydown",Nr.keydownCb),window.removeEventListener("mousedown",Nr.mousedownCb),Nr.setState({isVisible:!1})},Nr.focusOnInput=function(){var jr;if((jr=Nr.inputRef)!=null&&jr.current){var Ur=Nr.inputRef.current,Gr=Ur.focus,Yr=Ur.inputRef;document.activeElement!==Yr.current&&Gr()}},Nr.showCalendar=function(jr){var Ur=Nr.props.onFocus;Ur(jr),window.addEventListener("mousedown",Nr.mousedownCb),window.addEventListener("keydown",Nr.keydownCb),Nr.focusOnInput(),Nr.setState({isVisible:!0})},Nr.handleRangeInput=function(jr,Ur){var Gr=Nr.props,Yr=Gr.format,Qr=Gr.keepOpenOnSelect,Wn=Gr.onChange,ga=Gr.formatOptions;if(!jr||!jr.length){Nr.resetState(Ur);return}var eo={selectedDate:jr,selectedDateFormatted:formatSelectedDate(jr,Yr,ga),typedValue:null};Nr.setState(eo,function(){Wn(Ur,_extends({},Nr.props,{value:jr})),jr.length===2&&Nr.setState({isVisible:Qr})})},Nr.handleBasicInput=function(jr,Ur){var Gr=Nr.props,Yr=Gr.format,Qr=Gr.keepOpenOnSelect,Wn=Gr.onChange,ga=Gr.formatOptions;if(!jr){Nr.resetState(Ur);return}var eo={isVisible:Qr,selectedDate:jr,selectedDateFormatted:formatSelectedDate(jr,Yr,ga),typedValue:null};Nr.setState(eo,function(){Wn(Ur,_extends({},Nr.props,{value:jr}))})},Nr.handleBlur=function(jr){var Ur=Nr.props,Gr=Ur.format,Yr=Ur.onBlur,Qr=Ur.onChange,Wn=Nr.state.typedValue;if(jr&&Yr(jr),!!Wn){if(Nr.isRangeInput){var ga=parseRangeOnBlur(String(Wn),Gr),eo=ga.every(isValid);if(eo){Nr.handleRangeInput(ga,jr);return}}else{var _i=parseOnBlur(String(Wn),Gr),va=isValid(_i);if(va){Nr.handleBasicInput(_i,jr);return}}Nr.setState({typedValue:null},function(){Qr(jr,_extends({},Nr.props,{value:null}))})}},Nr.handleChange=function(jr,Ur){var Gr=Ur.value,Yr=Nr.props,Qr=Yr.allowOnlyNumbers,Wn=Yr.format,ga=Yr.onChange,eo=Nr.isRangeInput?Wn+" - "+Wn:Wn,_i=Qr?onlyNumbers(Gr):Gr;if(!_i){var va={selectedDate:Nr.isRangeInput?[]:null,selectedDateFormatted:"",typedValue:null};Nr.setState(va,function(){ga(jr,_extends({},Nr.props,{value:null}))});return}Nr.setState({selectedDate:Nr.isRangeInput?[]:null,selectedDateFormatted:"",typedValue:formatStringByPattern(eo,_i)})},Nr.handleKeyDown=function(jr){jr.keyCode===keys.enter&&Nr.handleBlur()},Nr.onDateSelected=function(jr,Ur){Nr.isRangeInput?Nr.handleRangeInput(Ur,jr):Nr.handleBasicInput(Ur,jr)},Nr}var Mr=pr.prototype;return Mr.componentDidUpdate=function(Dr){var Br=this.props,Lr=Br.locale,jr=Br.value;isEqual$1(jr,Dr.value)||this.onDateSelected(void 0,jr),Lr!==Dr.locale&&this.setState({locale:this.locale})},Mr.render=function(){var Dr=this,Br=this.state,Lr=Br.isVisible,jr=Br.locale,Ur=Br.selectedDate,Gr=Br.selectedDateFormatted,Yr=Br.typedValue,Qr=this.props,Wn=Qr.clearable,ga=Qr.pointing,eo=Qr.filterDate,_i=Qr.inline,va=Qr.inverted,io=Qr.readOnly,no=Qr.datePickerOnly,so=jsxRuntimeExports.jsx(this.Component,_extends({},this.dayzedProps,{monthsToDisplay:this.isRangeInput?2:1,onChange:this.onDateSelected,selected:Ur,date:this.date,children:function(fo){return jsxRuntimeExports.jsx(Calendar,_extends({},Dr.dayzedProps,fo,jr,{filterDate:eo,inverted:va,pointing:ga,weekdays:Dr.weekdays}))}}));return _i?so:jsxRuntimeExports.jsxs("div",{className:"field",style,ref:this.el,children:[jsxRuntimeExports.jsx(CustomInput,_extends({},this.inputProps,{isClearIconVisible:!!(Wn&&Gr),onBlur:this.handleBlur,onChange:this.handleChange,onClear:this.clearInput,onFocus:io?null:this.showCalendar,onKeyDown:this.handleKeyDown,readOnly:io||no,ref:this.inputRef,value:Yr||Gr})),Lr&&so]})},_createClass(pr,[{key:"isRangeInput",get:function(){return this.props.type==="range"}},{key:"initialState",get:function(){var Dr=this.props,Br=Dr.format,Lr=Dr.value,jr=Dr.formatOptions,Ur=this.isRangeInput?[]:null;return{isVisible:!1,locale:this.locale,selectedDate:Lr||Ur,selectedDateFormatted:formatSelectedDate(Lr,Br,jr),typedValue:null}}},{key:"dayzedProps",get:function(){return omit(semanticInputProps,this.props)}},{key:"inputProps",get:function(){var Dr=pick(semanticInputProps,this.props),Br=Dr.placeholder!==void 0?Dr.placeholder:this.props.format;return _extends({},Dr,{placeholder:Br})}},{key:"date",get:function(){var Dr=this.state.selectedDate,Br=this.props.date;return Br||!Dr?Br:this.isRangeInput?Dr[0]:Dr}},{key:"locale",get:function(){var Dr=this.props.locale,Br;try{Br=commonjsRequire("./locales/"+Dr+".json")}catch{console.warn('"'+Dr+'" is not a valid locale'),Br=require$$0}return Br}},{key:"weekdays",get:function(){var Dr=this.dayzedProps.firstDayOfWeek,Br=this.state.locale.weekdays;return moveElementsByN(Dr,Br)}}]),pr}(React$5.Component);SemanticDatepicker.defaultProps={allowOnlyNumbers:!1,autoFocus:!1,clearIcon:"close",clearOnSameDateClick:!0,clearable:!0,date:void 0,filterDate:function(){return!0},firstDayOfWeek:0,format:"YYYY-MM-DD",icon:"calendar",id:void 0,inline:!1,keepOpenOnClear:!1,keepOpenOnSelect:!1,label:void 0,locale:"en-US",name:void 0,onBlur:function(){},onChange:function(){},onFocus:function(){},placeholder:void 0,pointing:"left",readOnly:!1,datePickerOnly:!1,required:!1,showToday:!0,showOutsideDays:!1,type:"basic",value:null,inverted:!1};const reactSemanticUiDatepickers_esm=Object.freeze(Object.defineProperty({__proto__:null,default:SemanticDatepicker},Symbol.toStringTag,{value:"Module"})),require$$2=getAugmentedNamespace(reactSemanticUiDatepickers_esm),reactSemanticUiDatepickers="";var Input$1={},Button={},hasRequiredButton;function requireButton(){if(hasRequiredButton)return Button;hasRequiredButton=1;var $r=interopRequireDefaultExports;Button.__esModule=!0;var pr=$r(requireButton$1());return Button.default=pr.default,Button}var Icon={},hasRequiredIcon;function requireIcon(){if(hasRequiredIcon)return Icon;hasRequiredIcon=1;var $r=interopRequireDefaultExports;Icon.__esModule=!0;var pr=$r(Icon$4);return Icon.default=pr.default,Icon}var Label={},hasRequiredLabel;function requireLabel(){if(hasRequiredLabel)return Label;hasRequiredLabel=1;var $r=interopRequireDefaultExports;Label.__esModule=!0;var pr=$r(requireLabel$1());return Label.default=pr.default,Label}var _interopRequireWildcard$1=interopRequireWildcardExports,_interopRequireDefault$3=interopRequireDefaultExports;Input$1.__esModule=!0;Input$1.default=void 0;var _extends2$2=_interopRequireDefault$3(require_extends()),_inheritsLoose2$1=_interopRequireDefault$3(requireInheritsLoose()),_includes2$1=_interopRequireDefault$3(requireIncludes()),_map2=_interopRequireDefault$3(requireMap()),_invoke2$1=_interopRequireDefault$3(requireInvoke()),_get2=_interopRequireDefault$3(requireGet()),_isNil2=_interopRequireDefault$3(requireIsNil()),_reactComponentRef$1=require$$4$2,_clsx$2=_interopRequireDefault$3(require$$0$9);_interopRequireDefault$3(requirePropTypes());var _react$2=_interopRequireWildcard$1(reactExports),_lib$2=requireLib(),_Button=_interopRequireDefault$3(requireButton()),_Icon$2=_interopRequireDefault$3(requireIcon()),_Label=_interopRequireDefault$3(requireLabel()),Input=function($r){(0,_inheritsLoose2$1.default)(pr,$r);function pr(){for(var Nr,Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=$r.call.apply($r,[this].concat(Br))||this,Nr.inputRef=(0,_react$2.createRef)(),Nr.computeIcon=function(){var jr=Nr.props,Ur=jr.loading,Gr=jr.icon;if(!(0,_isNil2.default)(Gr))return Gr;if(Ur)return"spinner"},Nr.computeTabIndex=function(){var jr=Nr.props,Ur=jr.disabled,Gr=jr.tabIndex;if(!(0,_isNil2.default)(Gr))return Gr;if(Ur)return-1},Nr.focus=function(jr){return Nr.inputRef.current.focus(jr)},Nr.select=function(){return Nr.inputRef.current.select()},Nr.handleChange=function(jr){var Ur=(0,_get2.default)(jr,"target.value");(0,_invoke2$1.default)(Nr.props,"onChange",jr,(0,_extends2$2.default)({},Nr.props,{value:Ur}))},Nr.handleChildOverrides=function(jr,Ur){return(0,_extends2$2.default)({},Ur,jr.props,{ref:function(Yr){(0,_reactComponentRef$1.handleRef)(jr.ref,Yr),Nr.inputRef.current=Yr}})},Nr.partitionProps=function(){var jr=Nr.props,Ur=jr.disabled,Gr=jr.type,Yr=Nr.computeTabIndex(),Qr=(0,_lib$2.getUnhandledProps)(pr,Nr.props),Wn=(0,_lib$2.partitionHTMLProps)(Qr),ga=Wn[0],eo=Wn[1];return[(0,_extends2$2.default)({},ga,{disabled:Ur,type:Gr,tabIndex:Yr,onChange:Nr.handleChange,ref:Nr.inputRef}),eo]},Nr}var Mr=pr.prototype;return Mr.render=function(){var Dr=this,Br=this.props,Lr=Br.action,jr=Br.actionPosition,Ur=Br.children,Gr=Br.className,Yr=Br.disabled,Qr=Br.error,Wn=Br.fluid,ga=Br.focus,eo=Br.icon,_i=Br.iconPosition,va=Br.input,io=Br.inverted,no=Br.label,so=Br.labelPosition,ao=Br.loading,fo=Br.size,lo=Br.transparent,oo=Br.type,po=(0,_clsx$2.default)("ui",fo,(0,_lib$2.useKeyOnly)(Yr,"disabled"),(0,_lib$2.useKeyOnly)(Qr,"error"),(0,_lib$2.useKeyOnly)(Wn,"fluid"),(0,_lib$2.useKeyOnly)(ga,"focus"),(0,_lib$2.useKeyOnly)(io,"inverted"),(0,_lib$2.useKeyOnly)(ao,"loading"),(0,_lib$2.useKeyOnly)(lo,"transparent"),(0,_lib$2.useValueAndKey)(jr,"action")||(0,_lib$2.useKeyOnly)(Lr,"action"),(0,_lib$2.useValueAndKey)(_i,"icon")||(0,_lib$2.useKeyOnly)(eo||ao,"icon"),(0,_lib$2.useValueAndKey)(so,"labeled")||(0,_lib$2.useKeyOnly)(no,"labeled"),"input",Gr),mo=(0,_lib$2.getElementType)(pr,this.props),$o=this.partitionProps(),Xn=$o[0],Fr=$o[1];if(!_lib$2.childrenUtils.isNil(Ur)){var Vr=(0,_map2.default)(_react$2.Children.toArray(Ur),function(Gn){return Gn.type!=="input"?Gn:(0,_react$2.cloneElement)(Gn,Dr.handleChildOverrides(Gn,Xn))});return _react$2.default.createElement(mo,(0,_extends2$2.default)({},Fr,{className:po}),Vr)}var Wr=_Button.default.create(Lr,{autoGenerateKey:!1}),Jr=_Label.default.create(no,{defaultProps:{className:(0,_clsx$2.default)("label",(0,_includes2$1.default)(so,"corner")&&so)},autoGenerateKey:!1});return _react$2.default.createElement(mo,(0,_extends2$2.default)({},Fr,{className:po}),jr==="left"&&Wr,so!=="right"&&Jr,(0,_lib$2.createHTMLInput)(va||oo,{defaultProps:Xn,autoGenerateKey:!1}),_Icon$2.default.create(this.computeIcon(),{autoGenerateKey:!1}),jr!=="left"&&Wr,so==="right"&&Jr)},pr}(_react$2.Component);Input.handledProps=["action","actionPosition","as","children","className","disabled","error","fluid","focus","icon","iconPosition","input","inverted","label","labelPosition","loading","onChange","size","tabIndex","transparent","type"];Input.propTypes={};Input.defaultProps={type:"text"};Input.create=(0,_lib$2.createShorthandFactory)(Input,function($r){return{type:$r}});var _default$3=Input;Input$1.default=_default$3;var input={};Object.defineProperty(input,"__esModule",{value:!0});input.getInputValueLength=void 0;function getInputValueLength($r){return $r==null?0:typeof $r=="string"?$r.length:$r.toString().length}input.getInputValueLength=getInputValueLength;var Blockie$2={},blockies$1={exports:{}};(function($r){(function(){var pr=new Array(4);function Mr(Yr){for(var Qr=0;Qr<pr.length;Qr++)pr[Qr]=0;for(var Qr=0;Qr<Yr.length;Qr++)pr[Qr%4]=(pr[Qr%4]<<5)-pr[Qr%4]+Yr.charCodeAt(Qr)}function Nr(){var Yr=pr[0]^pr[0]<<11;return pr[0]=pr[1],pr[1]=pr[2],pr[2]=pr[3],pr[3]=pr[3]^pr[3]>>19^Yr^Yr>>8,(pr[3]>>>0)/(1<<31>>>0)}function Dr(){var Yr=Math.floor(Nr()*360),Qr=Nr()*60+40+"%",Wn=(Nr()+Nr()+Nr()+Nr())*25+"%",ga="hsl("+Yr+","+Qr+","+Wn+")";return ga}function Br(Yr){for(var Qr=Yr,Wn=Yr,ga=Math.ceil(Qr/2),eo=Qr-ga,_i=[],va=0;va<Wn;va++){for(var io=[],no=0;no<ga;no++)io[no]=Math.floor(Nr()*2.3);var so=io.slice(0,eo);so.reverse(),io=io.concat(so);for(var ao=0;ao<io.length;ao++)_i.push(io[ao])}return _i}function Lr(Yr){var Qr={};return Qr.size=Yr.size||8,Qr.scale=Yr.scale||4,Qr.seed=Yr.seed||Math.floor(Math.random()*Math.pow(10,16)).toString(16),Qr.color=Yr.color||Dr(),Qr.bgcolor=Yr.bgcolor||Dr(),Qr.spotcolor=Yr.spotcolor||Dr(),Mr(Qr.seed),Qr}function jr(Wn,Qr){var Wn=Lr(Wn||{}),ga=Br(Wn.size),eo=Math.sqrt(ga.length);Qr.width=Qr.height=Wn.size*Wn.scale;var _i=Qr.getContext("2d");_i.fillStyle=Wn.bgcolor,_i.fillRect(0,0,Qr.width,Qr.height),_i.fillStyle=Wn.color;for(var va=0;va<ga.length;va++)if(ga[va]){var io=Math.floor(va/eo),no=va%eo;_i.fillStyle=ga[va]==1?Wn.color:Wn.spotcolor,_i.fillRect(no*Wn.scale,io*Wn.scale,Wn.scale,Wn.scale)}return Qr}function Ur(Qr){var Qr=Lr(Qr||{}),Wn=document.createElement("canvas");return jr(Qr,Wn),Wn}var Gr={create:Ur,render:jr};$r.exports=Gr,typeof window<"u"&&(window.blockies=Gr)})()})(blockies$1);var blockiesExports=blockies$1.exports;const Blockie$1="";var __extends$2=commonjsGlobal&&commonjsGlobal.__extends||function(){var $r=function(pr,Mr){return $r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Nr,Dr){Nr.__proto__=Dr}||function(Nr,Dr){for(var Br in Dr)Object.prototype.hasOwnProperty.call(Dr,Br)&&(Nr[Br]=Dr[Br])},$r(pr,Mr)};return function(pr,Mr){if(typeof Mr!="function"&&Mr!==null)throw new TypeError("Class extends value "+String(Mr)+" is not a constructor or null");$r(pr,Mr);function Nr(){this.constructor=pr}pr.prototype=Mr===null?Object.create(Mr):(Nr.prototype=Mr.prototype,new Nr)}}(),__createBinding$5=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function($r,pr,Mr,Nr){Nr===void 0&&(Nr=Mr);var Dr=Object.getOwnPropertyDescriptor(pr,Mr);(!Dr||("get"in Dr?!pr.__esModule:Dr.writable||Dr.configurable))&&(Dr={enumerable:!0,get:function(){return pr[Mr]}}),Object.defineProperty($r,Nr,Dr)}:function($r,pr,Mr,Nr){Nr===void 0&&(Nr=Mr),$r[Nr]=pr[Mr]}),__setModuleDefault$5=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function($r,pr){Object.defineProperty($r,"default",{enumerable:!0,value:pr})}:function($r,pr){$r.default=pr}),__importStar$5=commonjsGlobal&&commonjsGlobal.__importStar||function($r){if($r&&$r.__esModule)return $r;var pr={};if($r!=null)for(var Mr in $r)Mr!=="default"&&Object.prototype.hasOwnProperty.call($r,Mr)&&__createBinding$5(pr,$r,Mr);return __setModuleDefault$5(pr,$r),pr};Object.defineProperty(Blockie$2,"__esModule",{value:!0});Blockie$2.Blockie=void 0;var React$2=__importStar$5(reactExports),blockies=__importStar$5(blockiesExports),Blockie=function($r){__extends$2(pr,$r);function pr(){var Mr=$r!==null&&$r.apply(this,arguments)||this;return Mr.canvas=React$2.createRef(),Mr}return pr.prototype.componentDidMount=function(){this.draw()},pr.prototype.componentDidUpdate=function(){this.draw()},pr.prototype.getOpts=function(){var Mr=this.props,Nr=Mr.seed,Dr=Mr.color,Br=Mr.spotcolor,Lr=Mr.bgcolor,jr=Mr.size,Ur=Mr.scale;return{seed:Nr?Nr.toLowerCase():"",color:Dr,spotcolor:Br,bgcolor:Lr,size:jr,scale:Ur}},pr.prototype.draw=function(){if(!this.canvas||!this.canvas.current)return"🦄";var Mr=this.props,Nr=Mr.size,Dr=Mr.scale,Br=this.canvas.current.getContext("2d");Br.clearRect(0,0,Nr*Dr,Nr*Dr),blockies.render(this.getOpts(),this.canvas.current)},pr.prototype.render=function(){var Mr=this.props,Nr=Mr.size,Dr=Mr.scale,Br=Mr.children,Lr=Mr.className,jr="dcl blockie ".concat(Lr).trim();Dr*Nr<=16?jr+=" mini":Dr*Nr<=24?jr+=" tiny":Dr*Nr<=36&&(jr+=" small");var Ur=React$2.createElement("canvas",{className:jr,ref:this.canvas});return Br?React$2.createElement("span",{className:"dcl blockie-wrapper"},Ur,React$2.createElement("span",{className:"dcl blockie-children"},Br)):Ur},pr.defaultProps={color:"#e449c2",bgcolor:"#3149de",spotcolor:"#e449c2",size:6,scale:6,className:""},pr}(React$2.PureComponent);Blockie$2.Blockie=Blockie;var Header$3={},Header$2={},Image$1={},hasRequiredImage;function requireImage(){if(hasRequiredImage)return Image$1;hasRequiredImage=1;var $r=interopRequireDefaultExports;Image$1.__esModule=!0;var pr=$r(requireImage$1());return Image$1.default=pr.default,Image$1}var HeaderSubheader={},hasRequiredHeaderSubheader;function requireHeaderSubheader(){if(hasRequiredHeaderSubheader)return HeaderSubheader;hasRequiredHeaderSubheader=1;var $r=interopRequireDefaultExports;HeaderSubheader.__esModule=!0,HeaderSubheader.default=void 0;var pr=$r(require_extends()),Mr=$r(require$$0$9);$r(requirePropTypes());var Nr=$r(reactExports),Dr=requireLib();function Br(jr){var Ur=jr.children,Gr=jr.className,Yr=jr.content,Qr=(0,Mr.default)("sub header",Gr),Wn=(0,Dr.getUnhandledProps)(Br,jr),ga=(0,Dr.getElementType)(Br,jr);return Nr.default.createElement(ga,(0,pr.default)({},Wn,{className:Qr}),Dr.childrenUtils.isNil(Ur)?Yr:Ur)}Br.handledProps=["as","children","className","content"],Br.propTypes={},Br.create=(0,Dr.createShorthandFactory)(Br,function(jr){return{content:jr}});var Lr=Br;return HeaderSubheader.default=Lr,HeaderSubheader}var HeaderContent={},hasRequiredHeaderContent;function requireHeaderContent(){if(hasRequiredHeaderContent)return HeaderContent;hasRequiredHeaderContent=1;var $r=interopRequireDefaultExports;HeaderContent.__esModule=!0,HeaderContent.default=void 0;var pr=$r(require_extends()),Mr=$r(require$$0$9);$r(requirePropTypes());var Nr=$r(reactExports),Dr=requireLib();function Br(jr){var Ur=jr.children,Gr=jr.className,Yr=jr.content,Qr=(0,Mr.default)("content",Gr),Wn=(0,Dr.getUnhandledProps)(Br,jr),ga=(0,Dr.getElementType)(Br,jr);return Nr.default.createElement(ga,(0,pr.default)({},Wn,{className:Qr}),Dr.childrenUtils.isNil(Ur)?Yr:Ur)}Br.handledProps=["as","children","className","content"],Br.propTypes={};var Lr=Br;return HeaderContent.default=Lr,HeaderContent}var _interopRequireDefault$2=interopRequireDefaultExports;Header$2.__esModule=!0;Header$2.default=void 0;var _extends2$1=_interopRequireDefault$2(require_extends());_interopRequireDefault$2(requireWithout());var _clsx$1=_interopRequireDefault$2(require$$0$9);_interopRequireDefault$2(requirePropTypes());var _react$1=_interopRequireDefault$2(reactExports),_lib$1=requireLib(),_Icon$1=_interopRequireDefault$2(requireIcon()),_Image=_interopRequireDefault$2(requireImage()),_HeaderSubheader=_interopRequireDefault$2(requireHeaderSubheader()),_HeaderContent=_interopRequireDefault$2(requireHeaderContent());function Header$1($r){var pr=$r.attached,Mr=$r.block,Nr=$r.children,Dr=$r.className,Br=$r.color,Lr=$r.content,jr=$r.disabled,Ur=$r.dividing,Gr=$r.floated,Yr=$r.icon,Qr=$r.image,Wn=$r.inverted,ga=$r.size,eo=$r.sub,_i=$r.subheader,va=$r.textAlign,io=(0,_clsx$1.default)("ui",Br,ga,(0,_lib$1.useKeyOnly)(Mr,"block"),(0,_lib$1.useKeyOnly)(jr,"disabled"),(0,_lib$1.useKeyOnly)(Ur,"dividing"),(0,_lib$1.useValueAndKey)(Gr,"floated"),(0,_lib$1.useKeyOnly)(Yr===!0,"icon"),(0,_lib$1.useKeyOnly)(Qr===!0,"image"),(0,_lib$1.useKeyOnly)(Wn,"inverted"),(0,_lib$1.useKeyOnly)(eo,"sub"),(0,_lib$1.useKeyOrValueAndKey)(pr,"attached"),(0,_lib$1.useTextAlignProp)(va),"header",Dr),no=(0,_lib$1.getUnhandledProps)(Header$1,$r),so=(0,_lib$1.getElementType)(Header$1,$r);if(!_lib$1.childrenUtils.isNil(Nr))return _react$1.default.createElement(so,(0,_extends2$1.default)({},no,{className:io}),Nr);var ao=_Icon$1.default.create(Yr,{autoGenerateKey:!1}),fo=_Image.default.create(Qr,{autoGenerateKey:!1}),lo=_HeaderSubheader.default.create(_i,{autoGenerateKey:!1});return ao||fo?_react$1.default.createElement(so,(0,_extends2$1.default)({},no,{className:io}),ao||fo,(Lr||lo)&&_react$1.default.createElement(_HeaderContent.default,null,Lr,lo)):_react$1.default.createElement(so,(0,_extends2$1.default)({},no,{className:io}),Lr,lo)}Header$1.handledProps=["as","attached","block","children","className","color","content","disabled","dividing","floated","icon","image","inverted","size","sub","subheader","textAlign"];Header$1.propTypes={};Header$1.Content=_HeaderContent.default;Header$1.Subheader=_HeaderSubheader.default;var _default$2=Header$1;Header$2.default=_default$2;const Header="";(function($r){var pr=commonjsGlobal&&commonjsGlobal.__importDefault||function(Nr){return Nr&&Nr.__esModule?Nr:{default:Nr}};Object.defineProperty($r,"__esModule",{value:!0}),$r.Header=void 0;var Mr=Header$2;Object.defineProperty($r,"Header",{enumerable:!0,get:function(){return pr(Mr).default}})})(Header$3);const Field$1="";var __extends$1=commonjsGlobal&&commonjsGlobal.__extends||function(){var $r=function(pr,Mr){return $r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Nr,Dr){Nr.__proto__=Dr}||function(Nr,Dr){for(var Br in Dr)Object.prototype.hasOwnProperty.call(Dr,Br)&&(Nr[Br]=Dr[Br])},$r(pr,Mr)};return function(pr,Mr){if(typeof Mr!="function"&&Mr!==null)throw new TypeError("Class extends value "+String(Mr)+" is not a constructor or null");$r(pr,Mr);function Nr(){this.constructor=pr}pr.prototype=Mr===null?Object.create(Mr):(Nr.prototype=Mr.prototype,new Nr)}}(),__assign=commonjsGlobal&&commonjsGlobal.__assign||function(){return __assign=Object.assign||function($r){for(var pr,Mr=1,Nr=arguments.length;Mr<Nr;Mr++){pr=arguments[Mr];for(var Dr in pr)Object.prototype.hasOwnProperty.call(pr,Dr)&&($r[Dr]=pr[Dr])}return $r},__assign.apply(this,arguments)},__createBinding$4=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function($r,pr,Mr,Nr){Nr===void 0&&(Nr=Mr);var Dr=Object.getOwnPropertyDescriptor(pr,Mr);(!Dr||("get"in Dr?!pr.__esModule:Dr.writable||Dr.configurable))&&(Dr={enumerable:!0,get:function(){return pr[Mr]}}),Object.defineProperty($r,Nr,Dr)}:function($r,pr,Mr,Nr){Nr===void 0&&(Nr=Mr),$r[Nr]=pr[Mr]}),__setModuleDefault$4=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function($r,pr){Object.defineProperty($r,"default",{enumerable:!0,value:pr})}:function($r,pr){$r.default=pr}),__importStar$4=commonjsGlobal&&commonjsGlobal.__importStar||function($r){if($r&&$r.__esModule)return $r;var pr={};if($r!=null)for(var Mr in $r)Mr!=="default"&&Object.prototype.hasOwnProperty.call($r,Mr)&&__createBinding$4(pr,$r,Mr);return __setModuleDefault$4(pr,$r),pr},__rest$1=commonjsGlobal&&commonjsGlobal.__rest||function($r,pr){var Mr={};for(var Nr in $r)Object.prototype.hasOwnProperty.call($r,Nr)&&pr.indexOf(Nr)<0&&(Mr[Nr]=$r[Nr]);if($r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Dr=0,Nr=Object.getOwnPropertySymbols($r);Dr<Nr.length;Dr++)pr.indexOf(Nr[Dr])<0&&Object.prototype.propertyIsEnumerable.call($r,Nr[Dr])&&(Mr[Nr[Dr]]=$r[Nr[Dr]]);return Mr},__importDefault$1=commonjsGlobal&&commonjsGlobal.__importDefault||function($r){return $r&&$r.__esModule?$r:{default:$r}};Object.defineProperty(Field$2,"__esModule",{value:!0});var Field_2=Field$2.Field=void 0,React$1=__importStar$4(reactExports),Icon_1=__importDefault$1(Icon$4),react_semantic_ui_datepickers_1=__importDefault$1(require$$2),Input_1=__importDefault$1(Input$1),classnames_1=__importDefault$1(classnamesExports),input_1=input,Blockie_1=Blockie$2,Button_1=Button$5,Header_1=Header$3,DATE_TYPE="date";function renderMessage($r){var pr=$r.error,Mr=$r.warning,Nr=$r.info,Dr=$r.message;if(pr||Dr)return React$1.createElement(React$1.Fragment,null,pr&&Dr?React$1.createElement(Icon_1.default,{name:"remove circle"}):null," ",Dr);if(Mr)return React$1.createElement(React$1.Fragment,null,React$1.createElement(Icon_1.default,{name:"warning sign"})," ",Mr);if(Nr)return React$1.createElement(React$1.Fragment,null,React$1.createElement(Icon_1.default,{name:"info circle"})," ",Nr)}var Field=function($r){__extends$1(pr,$r);function pr(){var Mr=$r!==null&&$r.apply(this,arguments)||this;return Mr.onChangeDatePicker=function(Nr,Dr){var Br="";if(Dr.value){var Lr=Dr.value&&Dr.value.getFullYear(),jr=Dr.value&&"".concat(Dr.value.getDate()<10?"0":"").concat(Dr.value.getDate()),Ur=Dr.value&&"".concat(Dr.value.getMonth()+1<10?"0":"").concat(Dr.value.getMonth()+1);Br="".concat(Lr,"-").concat(Ur,"-").concat(jr)}var Gr=__assign(__assign({},Mr.props),{value:Br});Mr.props.onChange&&Mr.props.onChange(Nr,Gr)},Mr}return pr.prototype.hasAction=function(){var Mr=this.props,Nr=Mr.loading,Dr=Mr.error,Br=Mr.action,Lr=this.props.onAction!==null&&this.props.onAction!==void 0;return!this.isAddress()&&!Nr&&!Dr&&Br&&Lr},pr.prototype.isAddress=function(){var Mr=this.props.type;return Mr==="address"},pr.prototype.render=function(){var Mr,Nr=this.props,Dr=Nr.value,Br=Nr.label,Lr=Nr.error,jr=Nr.warning,Ur=Nr.info,Gr=Nr.type,Yr=Nr.loading,Qr=Nr.action,Wn=Nr.onAction,ga=Nr.disabled,eo=Nr.kind,_i=Nr.fitContent,va=Nr.isClearable,io=va===void 0?!0:va,no=Nr.id,so=Nr.maxLength,ao=__rest$1(Nr,["value","label","error","warning","info","type","loading","action","onAction","disabled","kind","fitContent","isClearable","id","maxLength"]),fo=this.isAddress(),lo=Lr&&!fo?"warning circle":void 0,oo=(0,classnames_1.default)("dcl field",eo,(Mr={error:Lr,warning:!Lr&&jr,info:!Lr&&!jr&&Ur,disabled:ga,address:fo,resizable:_i},Mr["has-label"]=Br,Mr));return fo&&Qr&&console.warn(`The address fields don't support actions, "`.concat(Qr,'" will be ignored')),React$1.createElement("div",{className:oo},Br||so!==void 0?React$1.createElement(Header_1.Header,{sub:!0},Br?React$1.createElement("label",{htmlFor:no},Br):null,so!==void 0?React$1.createElement("span",{className:"maxLength"},(0,input_1.getInputValueLength)(Dr),"/",so):null):null,Gr===DATE_TYPE?React$1.createElement(react_semantic_ui_datepickers_1.default,__assign({value:Dr?new Date("".concat(Dr," 00:00:00")):void 0,icon:lo||void 0,loading:Yr&&!fo,disabled:ga,showOutsideDays:!0,className:"datePickerWidth",clearable:io},ao,{onChange:this.onChangeDatePicker,id:no})):React$1.createElement(Input_1.default,__assign({id:no,value:Dr,type:fo?"text":Gr,icon:lo,loading:Yr&&!fo,disabled:ga,maxLength:so},ao)),this.hasAction()&&React$1.createElement("div",{className:"overlay"},React$1.createElement(Button_1.Button,{onClick:Wn,disabled:ga,basic:!0},Qr)),this.isAddress()&&Dr?React$1.createElement(Blockie_1.Blockie,{seed:Dr,scale:4}):null,React$1.createElement("p",{className:"message"},renderMessage(this.props)," "))},pr.defaultProps={kind:"simple",fitContent:!1},pr}(React$1.PureComponent);Field_2=Field$2.Field=Field;var Media={},reactResponsive={exports:{}};(function($r,pr){(function(Nr,Dr){$r.exports=Dr(reactExports)})(commonjsGlobal,Mr=>(()=>{var Nr={"./node_modules/css-mediaquery/index.js":(jr,Ur)=>{Ur.match=eo,Ur.parse=_i;var Gr=/(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i,Yr=/\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/,Qr=/^(?:(min|max)-)?(.+)/,Wn=/(em|rem|px|cm|mm|in|pt|pc)?$/,ga=/(dpi|dpcm|dppx)?$/;function eo(so,ao){return _i(so).some(function(fo){var lo=fo.inverse,oo=fo.type==="all"||ao.type===fo.type;if(oo&&lo||!(oo||lo))return!1;var po=fo.expressions.every(function(mo){var $o=mo.feature,Xn=mo.modifier,Fr=mo.value,Vr=ao[$o];if(!Vr)return!1;switch($o){case"orientation":case"scan":return Vr.toLowerCase()===Fr.toLowerCase();case"width":case"height":case"device-width":case"device-height":Fr=no(Fr),Vr=no(Vr);break;case"resolution":Fr=io(Fr),Vr=io(Vr);break;case"aspect-ratio":case"device-aspect-ratio":case"device-pixel-ratio":Fr=va(Fr),Vr=va(Vr);break;case"grid":case"color":case"color-index":case"monochrome":Fr=parseInt(Fr,10)||1,Vr=parseInt(Vr,10)||0;break}switch(Xn){case"min":return Vr>=Fr;case"max":return Vr<=Fr;default:return Vr===Fr}});return po&&!lo||!po&&lo})}function _i(so){return so.split(",").map(function(ao){ao=ao.trim();var fo=ao.match(Gr),lo=fo[1],oo=fo[2],po=fo[3]||"",mo={};return mo.inverse=!!lo&&lo.toLowerCase()==="not",mo.type=oo?oo.toLowerCase():"all",po=po.match(/\([^\)]+\)/g)||[],mo.expressions=po.map(function($o){var Xn=$o.match(Yr),Fr=Xn[1].toLowerCase().match(Qr);return{modifier:Fr[1],feature:Fr[2],value:Xn[2]}}),mo})}function va(so){var ao=Number(so),fo;return ao||(fo=so.match(/^(\d+)\s*\/\s*(\d+)$/),ao=fo[1]/fo[2]),ao}function io(so){var ao=parseFloat(so),fo=String(so).match(ga)[1];switch(fo){case"dpcm":return ao/2.54;case"dppx":return ao*96;default:return ao}}function no(so){var ao=parseFloat(so),fo=String(so).match(Wn)[1];switch(fo){case"em":return ao*16;case"rem":return ao*16;case"cm":return ao*96/2.54;case"mm":return ao*96/2.54/10;case"in":return ao*96;case"pt":return ao*72;case"pc":return ao*72/12;default:return ao}}},"./node_modules/hyphenate-style-name/index.js":(jr,Ur,Gr)=>{Gr.r(Ur),Gr.d(Ur,{default:()=>_i});var Yr=/[A-Z]/g,Qr=/^ms-/,Wn={};function ga(va){return"-"+va.toLowerCase()}function eo(va){if(Wn.hasOwnProperty(va))return Wn[va];var io=va.replace(Yr,ga);return Wn[va]=Qr.test(io)?"-"+io:io}const _i=eo},"./node_modules/matchmediaquery/index.js":(jr,Ur,Gr)=>{var Yr=Gr("./node_modules/css-mediaquery/index.js").match,Qr=typeof window<"u"?window.matchMedia:null;function Wn(eo,_i,va){var io=this;if(Qr&&!va){var no=Qr.call(window,eo);this.matches=no.matches,this.media=no.media,no.addListener(fo)}else this.matches=Yr(eo,_i),this.media=eo;this.addListener=so,this.removeListener=ao,this.dispose=lo;function so(oo){no&&no.addListener(oo)}function ao(oo){no&&no.removeListener(oo)}function fo(oo){io.matches=oo.matches,io.media=oo.media}function lo(){no&&no.removeListener(fo)}}function ga(eo,_i,va){return new Wn(eo,_i,va)}jr.exports=ga},"./node_modules/object-assign/index.js":jr=>{/*
|
|
190
190
|
object-assign
|
|
@@ -198,7 +198,7 @@ Valid keys: `+JSON.stringify(Object.keys(yo),null," "));var Ru=su(Uu,Zu,pu,nu,e
|
|
|
198
198
|
*
|
|
199
199
|
* This source code is licensed under the MIT license found in the
|
|
200
200
|
* LICENSE file in the root directory of this source tree.
|
|
201
|
-
*/(function(){var Gr=typeof Symbol=="function"&&Symbol.for,Yr=Gr?Symbol.for("react.element"):60103,Qr=Gr?Symbol.for("react.portal"):60106,Wn=Gr?Symbol.for("react.fragment"):60107,ga=Gr?Symbol.for("react.strict_mode"):60108,eo=Gr?Symbol.for("react.profiler"):60114,_i=Gr?Symbol.for("react.provider"):60109,va=Gr?Symbol.for("react.context"):60110,io=Gr?Symbol.for("react.async_mode"):60111,no=Gr?Symbol.for("react.concurrent_mode"):60111,so=Gr?Symbol.for("react.forward_ref"):60112,ao=Gr?Symbol.for("react.suspense"):60113,fo=Gr?Symbol.for("react.suspense_list"):60120,lo=Gr?Symbol.for("react.memo"):60115,oo=Gr?Symbol.for("react.lazy"):60116,po=Gr?Symbol.for("react.block"):60121,mo=Gr?Symbol.for("react.fundamental"):60117,$o=Gr?Symbol.for("react.responder"):60118,Xn=Gr?Symbol.for("react.scope"):60119;function Fr(su){return typeof su=="string"||typeof su=="function"||su===Wn||su===no||su===eo||su===ga||su===ao||su===fo||typeof su=="object"&&su!==null&&(su.$$typeof===oo||su.$$typeof===lo||su.$$typeof===_i||su.$$typeof===va||su.$$typeof===so||su.$$typeof===mo||su.$$typeof===$o||su.$$typeof===Xn||su.$$typeof===po)}function Vr(su){if(typeof su=="object"&&su!==null){var Ru=su.$$typeof;switch(Ru){case Yr:var tl=su.type;switch(tl){case io:case no:case Wn:case eo:case ga:case ao:return tl;default:var Pu=tl&&tl.$$typeof;switch(Pu){case va:case so:case oo:case lo:case _i:return Pu;default:return Ru}}case Qr:return Ru}}}var Wr=io,Jr=no,Gn=va,to=_i,ro=Yr,Un=so,Hr=Wn,Xr=oo,co=lo,ho=Qr,go=eo,bo=ga,Eo=ao,wo=!1;function Io(su){return wo||(wo=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),Po(su)||Vr(su)===io}function Po(su){return Vr(su)===no}function yo(su){return Vr(su)===va}function xo(su){return Vr(su)===_i}function Mo(su){return typeof su=="object"&&su!==null&&su.$$typeof===Yr}function qo(su){return Vr(su)===so}function pu(su){return Vr(su)===Wn}function nu(su){return Vr(su)===oo}function eu(su){return Vr(su)===lo}function Uu(su){return Vr(su)===Qr}function mu(su){return Vr(su)===eo}function Jo(su){return Vr(su)===ga}function Zu(su){return Vr(su)===ao}Ur.AsyncMode=Wr,Ur.ConcurrentMode=Jr,Ur.ContextConsumer=Gn,Ur.ContextProvider=to,Ur.Element=ro,Ur.ForwardRef=Un,Ur.Fragment=Hr,Ur.Lazy=Xr,Ur.Memo=co,Ur.Portal=ho,Ur.Profiler=go,Ur.StrictMode=bo,Ur.Suspense=Eo,Ur.isAsyncMode=Io,Ur.isConcurrentMode=Po,Ur.isContextConsumer=yo,Ur.isContextProvider=xo,Ur.isElement=Mo,Ur.isForwardRef=qo,Ur.isFragment=pu,Ur.isLazy=nu,Ur.isMemo=eu,Ur.isPortal=Uu,Ur.isProfiler=mu,Ur.isStrictMode=Jo,Ur.isSuspense=Zu,Ur.isValidElementType=Fr,Ur.typeOf=Vr})()},"./node_modules/react-is/index.js":(jr,Ur,Gr)=>{jr.exports=Gr("./node_modules/react-is/cjs/react-is.development.js")},"./node_modules/shallow-equal/dist/index.esm.js":(jr,Ur,Gr)=>{Gr.r(Ur),Gr.d(Ur,{shallowEqualArrays:()=>Qr,shallowEqualObjects:()=>Yr});function Yr(Wn,ga){if(Wn===ga)return!0;if(!Wn||!ga)return!1;var eo=Object.keys(Wn),_i=Object.keys(ga),va=eo.length;if(_i.length!==va)return!1;for(var io=0;io<va;io++){var no=eo[io];if(Wn[no]!==ga[no]||!Object.prototype.hasOwnProperty.call(ga,no))return!1}return!0}function Qr(Wn,ga){if(Wn===ga)return!0;if(!Wn||!ga)return!1;var eo=Wn.length;if(ga.length!==eo)return!1;for(var _i=0;_i<eo;_i++)if(Wn[_i]!==ga[_i])return!1;return!0}},"./src/Component.ts":function(jr,Ur,Gr){var Yr=this&&this.__rest||function(eo,_i){var va={};for(var io in eo)Object.prototype.hasOwnProperty.call(eo,io)&&_i.indexOf(io)<0&&(va[io]=eo[io]);if(eo!=null&&typeof Object.getOwnPropertySymbols=="function")for(var no=0,io=Object.getOwnPropertySymbols(eo);no<io.length;no++)_i.indexOf(io[no])<0&&Object.prototype.propertyIsEnumerable.call(eo,io[no])&&(va[io[no]]=eo[io[no]]);return va},Qr=this&&this.__importDefault||function(eo){return eo&&eo.__esModule?eo:{default:eo}};Object.defineProperty(Ur,"__esModule",{value:!0});var Wn=Qr(Gr("./src/useMediaQuery.ts")),ga=function(eo){var _i=eo.children,va=eo.device,io=eo.onChange,no=Yr(eo,["children","device","onChange"]),so=(0,Wn.default)(no,va,io);return typeof _i=="function"?_i(so):so?_i:null};Ur.default=ga},"./src/Context.ts":(jr,Ur,Gr)=>{Object.defineProperty(Ur,"__esModule",{value:!0});var Yr=Gr("react"),Qr=(0,Yr.createContext)(void 0);Ur.default=Qr},"./src/index.ts":function(jr,Ur,Gr){var Yr=this&&this.__importDefault||function(_i){return _i&&_i.__esModule?_i:{default:_i}};Object.defineProperty(Ur,"__esModule",{value:!0}),Ur.Context=Ur.toQuery=Ur.useMediaQuery=Ur.default=void 0;var Qr=Yr(Gr("./src/useMediaQuery.ts"));Ur.useMediaQuery=Qr.default;var Wn=Yr(Gr("./src/Component.ts"));Ur.default=Wn.default;var ga=Yr(Gr("./src/toQuery.ts"));Ur.toQuery=ga.default;var eo=Yr(Gr("./src/Context.ts"));Ur.Context=eo.default},"./src/mediaQuery.ts":function(jr,Ur,Gr){var Yr=this&&this.__assign||function(){return Yr=Object.assign||function(ao){for(var fo,lo=1,oo=arguments.length;lo<oo;lo++){fo=arguments[lo];for(var po in fo)Object.prototype.hasOwnProperty.call(fo,po)&&(ao[po]=fo[po])}return ao},Yr.apply(this,arguments)},Qr=this&&this.__rest||function(ao,fo){var lo={};for(var oo in ao)Object.prototype.hasOwnProperty.call(ao,oo)&&fo.indexOf(oo)<0&&(lo[oo]=ao[oo]);if(ao!=null&&typeof Object.getOwnPropertySymbols=="function")for(var po=0,oo=Object.getOwnPropertySymbols(ao);po<oo.length;po++)fo.indexOf(oo[po])<0&&Object.prototype.propertyIsEnumerable.call(ao,oo[po])&&(lo[oo[po]]=ao[oo[po]]);return lo},Wn=this&&this.__importDefault||function(ao){return ao&&ao.__esModule?ao:{default:ao}};Object.defineProperty(Ur,"__esModule",{value:!0});var ga=Wn(Gr("./node_modules/prop-types/index.js")),eo=ga.default.oneOfType([ga.default.string,ga.default.number]),_i={all:ga.default.bool,grid:ga.default.bool,aural:ga.default.bool,braille:ga.default.bool,handheld:ga.default.bool,print:ga.default.bool,projection:ga.default.bool,screen:ga.default.bool,tty:ga.default.bool,tv:ga.default.bool,embossed:ga.default.bool},va={orientation:ga.default.oneOf(["portrait","landscape"]),scan:ga.default.oneOf(["progressive","interlace"]),aspectRatio:ga.default.string,deviceAspectRatio:ga.default.string,height:eo,deviceHeight:eo,width:eo,deviceWidth:eo,color:ga.default.bool,colorIndex:ga.default.bool,monochrome:ga.default.bool,resolution:eo,type:Object.keys(_i)};va.type;var io=Qr(va,["type"]),no=Yr({minAspectRatio:ga.default.string,maxAspectRatio:ga.default.string,minDeviceAspectRatio:ga.default.string,maxDeviceAspectRatio:ga.default.string,minHeight:eo,maxHeight:eo,minDeviceHeight:eo,maxDeviceHeight:eo,minWidth:eo,maxWidth:eo,minDeviceWidth:eo,maxDeviceWidth:eo,minColor:ga.default.number,maxColor:ga.default.number,minColorIndex:ga.default.number,maxColorIndex:ga.default.number,minMonochrome:ga.default.number,maxMonochrome:ga.default.number,minResolution:eo,maxResolution:eo},io),so=Yr(Yr({},_i),no);Ur.default={all:so,types:_i,matchers:va,features:no}},"./src/toQuery.ts":function(jr,Ur,Gr){var Yr=this&&this.__importDefault||function(io){return io&&io.__esModule?io:{default:io}};Object.defineProperty(Ur,"__esModule",{value:!0});var Qr=Yr(Gr("./node_modules/hyphenate-style-name/index.js")),Wn=Yr(Gr("./src/mediaQuery.ts")),ga=function(io){return"not ".concat(io)},eo=function(io,no){var so=(0,Qr.default)(io);return typeof no=="number"&&(no="".concat(no,"px")),no===!0?so:no===!1?ga(so):"(".concat(so,": ").concat(no,")")},_i=function(io){return io.join(" and ")},va=function(io){var no=[];return Object.keys(Wn.default.all).forEach(function(so){var ao=io[so];ao!=null&&no.push(eo(so,ao))}),_i(no)};Ur.default=va},"./src/useMediaQuery.ts":function(jr,Ur,Gr){var Yr=this&&this.__importDefault||function(mo){return mo&&mo.__esModule?mo:{default:mo}};Object.defineProperty(Ur,"__esModule",{value:!0});var Qr=Gr("react"),Wn=Yr(Gr("./node_modules/matchmediaquery/index.js")),ga=Yr(Gr("./node_modules/hyphenate-style-name/index.js")),eo=Gr("./node_modules/shallow-equal/dist/index.esm.js"),_i=Yr(Gr("./src/toQuery.ts")),va=Yr(Gr("./src/Context.ts")),io=function(mo){return mo.query||(0,_i.default)(mo)},no=function(mo){if(mo){var $o=Object.keys(mo);return $o.reduce(function(Xn,Fr){return Xn[(0,ga.default)(Fr)]=mo[Fr],Xn},{})}},so=function(){var mo=(0,Qr.useRef)(!1);return(0,Qr.useEffect)(function(){mo.current=!0},[]),mo.current},ao=function(mo){var $o=(0,Qr.useContext)(va.default),Xn=function(){return no(mo)||no($o)},Fr=(0,Qr.useState)(Xn),Vr=Fr[0],Wr=Fr[1];return(0,Qr.useEffect)(function(){var Jr=Xn();(0,eo.shallowEqualObjects)(Vr,Jr)||Wr(Jr)},[mo,$o]),Vr},fo=function(mo){var $o=function(){return io(mo)},Xn=(0,Qr.useState)($o),Fr=Xn[0],Vr=Xn[1];return(0,Qr.useEffect)(function(){var Wr=$o();Fr!==Wr&&Vr(Wr)},[mo]),Fr},lo=function(mo,$o){var Xn=function(){return(0,Wn.default)(mo,$o||{},!!$o)},Fr=(0,Qr.useState)(Xn),Vr=Fr[0],Wr=Fr[1],Jr=so();return(0,Qr.useEffect)(function(){if(Jr){var Gn=Xn();return Wr(Gn),function(){Gn&&Gn.dispose()}}},[mo,$o]),Vr},oo=function(mo){var $o=(0,Qr.useState)(mo.matches),Xn=$o[0],Fr=$o[1];return(0,Qr.useEffect)(function(){var Vr=function(Wr){Fr(Wr.matches)};return mo.addListener(Vr),Fr(mo.matches),function(){mo.removeListener(Vr)}},[mo]),Xn},po=function(mo,$o,Xn){var Fr=ao($o),Vr=fo(mo);if(!Vr)throw new Error("Invalid or missing MediaQuery!");var Wr=lo(Vr,Fr),Jr=oo(Wr),Gn=so();return(0,Qr.useEffect)(function(){Gn&&Xn&&Xn(Jr)},[Jr]),(0,Qr.useEffect)(function(){return function(){Wr&&Wr.dispose()}},[]),Jr};Ur.default=po},react:jr=>{jr.exports=Mr}},Dr={};function Br(jr){var Ur=Dr[jr];if(Ur!==void 0)return Ur.exports;var Gr=Dr[jr]={exports:{}};return Nr[jr].call(Gr.exports,Gr,Gr.exports,Br),Gr.exports}Br.d=(jr,Ur)=>{for(var Gr in Ur)Br.o(Ur,Gr)&&!Br.o(jr,Gr)&&Object.defineProperty(jr,Gr,{enumerable:!0,get:Ur[Gr]})},Br.o=(jr,Ur)=>Object.prototype.hasOwnProperty.call(jr,Ur),Br.r=jr=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(jr,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(jr,"__esModule",{value:!0})};var Lr=Br("./src/index.ts");return Lr})())})(reactResponsive);var reactResponsiveExports=reactResponsive.exports;Object.defineProperty(Media,"__esModule",{value:!0});Media.useNotMobileMediaQuery=Media.useMobileMediaQuery=Media.useTabletAndBelowMediaQuery=Media.useTabletMediaQuery=Media.useDesktopMediaQuery=Media.useBigDesktopMediaQuery=NotMobile_1=Media.NotMobile=Mobile_1=Media.Mobile=Media.TabletAndBelow=Media.Tablet=Media.Desktop=void 0;var react_responsive_1=reactResponsiveExports,useBigDesktopMediaQuery=function(){return(0,react_responsive_1.useMediaQuery)({minWidth:1920})};Media.useBigDesktopMediaQuery=useBigDesktopMediaQuery;var useDesktopMediaQuery=function(){return(0,react_responsive_1.useMediaQuery)({minWidth:992})};Media.useDesktopMediaQuery=useDesktopMediaQuery;var useTabletMediaQuery=function(){return(0,react_responsive_1.useMediaQuery)({minWidth:768,maxWidth:991})};Media.useTabletMediaQuery=useTabletMediaQuery;var useTabletAndBelowMediaQuery=function(){return(0,react_responsive_1.useMediaQuery)({maxWidth:991})};Media.useTabletAndBelowMediaQuery=useTabletAndBelowMediaQuery;var useMobileMediaQuery=function(){return(0,react_responsive_1.useMediaQuery)({maxWidth:767})};Media.useMobileMediaQuery=useMobileMediaQuery;var useNotMobileMediaQuery=function(){return(0,react_responsive_1.useMediaQuery)({minWidth:768})};Media.useNotMobileMediaQuery=useNotMobileMediaQuery;var Desktop=function($r){var pr=$r.children,Mr=useDesktopMediaQuery();return Mr?pr:null};Media.Desktop=Desktop;var Tablet=function($r){var pr=$r.children,Mr=useTabletMediaQuery();return Mr?pr:null};Media.Tablet=Tablet;var TabletAndBelow=function($r){var pr=$r.children,Mr=useTabletAndBelowMediaQuery();return Mr?pr:null};Media.TabletAndBelow=TabletAndBelow;var Mobile=function($r){var pr=$r.children,Mr=useMobileMediaQuery();return Mr?pr:null},Mobile_1=Media.Mobile=Mobile,NotMobile=function($r){var pr=$r.children,Mr=useNotMobileMediaQuery();return Mr?pr:null},NotMobile_1=Media.NotMobile=NotMobile;const backImg="https://cdn.decentraland.org/@dcl/auth-site/1.3.1-7743847636.commit-51766c3/assets/back-26d3dbd9.svg",diceImg="https://cdn.decentraland.org/@dcl/auth-site/1.3.1-7743847636.commit-51766c3/assets/dice-b919368b.svg",logoSrc="https://cdn.decentraland.org/@dcl/auth-site/1.3.1-7743847636.commit-51766c3/assets/logo-9a364aec.svg",wrongImg="https://cdn.decentraland.org/@dcl/auth-site/1.3.1-7743847636.commit-51766c3/assets/wrong-1ccde1e7.svg",useAfterLoginRedirection=()=>{const $r=useLocation(),Mr=new URLSearchParams($r.search).get("redirectTo"),Nr=Mr?decodeURIComponent(Mr):null;if(Nr!==null)try{let Dr;return Nr.startsWith("/")?Dr=new URL(Nr,window.location.origin):Dr=new URL(Nr),Dr.hostname!==window.location.hostname?void 0:Dr.href}catch{console.error("Can't parse redirectTo URL");return}};var FeatureFlagsKeys=($r=>($r.SIMPLIFIED_AVATAR_SETUP="dapps-simplified-avatar-setup",$r))(FeatureFlagsKeys||{});const defaultFeatureFlagsContextValue={flags:{},initialized:!1},FeatureFlagsContext=reactExports.createContext(defaultFeatureFlagsContextValue),FeatureFlagsProvider=$r=>{const[pr,Mr]=reactExports.useState(defaultFeatureFlagsContextValue),[Nr,Dr]=reactExports.useState(!0),Br=reactExports.useRef();return reactExports.useEffect(()=>{(async()=>{if(Nr){Dr(!1);const Lr=config.get("FEATURE_FLAGS_URL"),Ur=await(await fetch(`${Lr}/dapps.json`)).json();Mr({...pr,flags:Ur.flags,initialized:!0})}})()},[Nr]),reactExports.useEffect(()=>{const Lr=config.get("FEATURE_FLAGS_INTERVAL");return Br.current=setInterval(()=>{Dr(!0)},Number(Lr)),()=>{clearInterval(Br.current)}},[]),jsxRuntimeExports.jsx(FeatureFlagsContext.Provider,{value:pr,children:$r.children})};var dist$3={},fetcher$1={},environment={};Object.defineProperty(environment,"__esModule",{value:!0});environment.isUsingNode=void 0;function isUsingNode(){return typeof process$1<"u"&&process$1.release&&process$1.release.name==="node"}environment.isUsingNode=isUsingNode;var __createBinding$3=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function($r,pr,Mr,Nr){Nr===void 0&&(Nr=Mr);var Dr=Object.getOwnPropertyDescriptor(pr,Mr);(!Dr||("get"in Dr?!pr.__esModule:Dr.writable||Dr.configurable))&&(Dr={enumerable:!0,get:function(){return pr[Mr]}}),Object.defineProperty($r,Nr,Dr)}:function($r,pr,Mr,Nr){Nr===void 0&&(Nr=Mr),$r[Nr]=pr[Mr]}),__setModuleDefault$3=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function($r,pr){Object.defineProperty($r,"default",{enumerable:!0,value:pr})}:function($r,pr){$r.default=pr}),__importStar$3=commonjsGlobal&&commonjsGlobal.__importStar||function($r){if($r&&$r.__esModule)return $r;var pr={};if($r!=null)for(var Mr in $r)Mr!=="default"&&Object.prototype.hasOwnProperty.call($r,Mr)&&__createBinding$3(pr,$r,Mr);return __setModuleDefault$3(pr,$r),pr},__rest=commonjsGlobal&&commonjsGlobal.__rest||function($r,pr){var Mr={};for(var Nr in $r)Object.prototype.hasOwnProperty.call($r,Nr)&&pr.indexOf(Nr)<0&&(Mr[Nr]=$r[Nr]);if($r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Dr=0,Nr=Object.getOwnPropertySymbols($r);Dr<Nr.length;Dr++)pr.indexOf(Nr[Dr])<0&&Object.prototype.propertyIsEnumerable.call($r,Nr[Dr])&&(Mr[Nr[Dr]]=$r[Nr[Dr]]);return Mr};Object.defineProperty(fetcher$1,"__esModule",{value:!0});fetcher$1.createFetchComponent=void 0;const crossFetch=__importStar$3(browserPonyfillExports),environment_1=environment,NON_RETRYABLE_STATUS_CODES=[400,401,403,404],IDEMPOTENT_HTTP_METHODS=["GET","HEAD","OPTIONS","PUT","DELETE"];async function fetchWithRetriesAndTimeout($r,pr){const{timeout:Mr,abortController:Nr,signal:Dr,retryDelay:Br}=pr;let Lr=pr.attempts,jr=null,Ur;do try{Mr&&(jr=setTimeout(()=>{Nr.abort()},Mr));const Gr=crossFetch.default($r.toString(),Object.assign(Object.assign({},pr),{signal:Dr})),Yr=Promise.race([Gr,new Promise((Qr,Wn)=>{Dr.addEventListener("abort",()=>{Qr(new crossFetch.Response("timeout",{status:408,statusText:"Request Timeout"}))})})]);--Lr,Ur=await Yr,jr&&clearTimeout(jr)}finally{if(Ur&&(Ur.ok||NON_RETRYABLE_STATUS_CODES.includes(Ur.status)||Lr===0))break;await new Promise(Gr=>setTimeout(Gr,Br))}while((!Ur||!Ur.ok)&&Lr>0);return Ur}function createFetchComponent($r){async function pr(Mr,Nr){const Br=Object.assign(Object.assign({},$r==null?void 0:$r.defaultFetcherOptions),Nr)||{},{timeout:Lr,method:jr="GET",retryDelay:Ur=0,abortController:Gr}=Br,Yr=__rest(Br,["timeout","method","retryDelay","abortController"]);let Qr=Yr.attempts||1;const Wn=Gr||new AbortController,{signal:ga}=Wn;$r!=null&&$r.defaultHeaders&&(Yr.headers=Object.assign(Object.assign({},$r==null?void 0:$r.defaultHeaders),Yr.headers||{})),IDEMPOTENT_HTTP_METHODS.includes(jr.toUpperCase())||(Qr=1);const eo=await fetchWithRetriesAndTimeout(Mr,Object.assign(Object.assign({},Yr),{attempts:Qr,method:jr,timeout:Lr,retryDelay:Ur,signal:ga,abortController:Wn}));if(!(eo!=null&&eo.ok)){const _i=await(eo==null?void 0:eo.text());throw new Error(`Failed to fetch ${Mr}. Got status ${eo==null?void 0:eo.status}. Response was '${_i}'`)}return!(0,environment_1.isUsingNode)()&&eo&&Object.defineProperty(eo,"buffer",{value:async function(){return Buffer$G.from(await eo.arrayBuffer())},configurable:!0}),ga.aborted?void 0:eo}return{fetch:pr}}fetcher$1.createFetchComponent=createFetchComponent;(function($r){Object.defineProperty($r,"__esModule",{value:!0}),$r.createFetchComponent=void 0;var pr=fetcher$1;Object.defineProperty($r,"createFetchComponent",{enumerable:!0,get:function(){return pr.createFetchComponent}})})(dist$3);var dist$2={},CatalystClient={},ContentClient={},dist$1={exports:{}};dist$1.exports;(function(module){var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__commonJS=($r,pr)=>function(){return pr||(0,$r[__getOwnPropNames($r)[0]])((pr={exports:{}}).exports,pr),pr.exports},__export=($r,pr)=>{for(var Mr in pr)__defProp($r,Mr,{get:pr[Mr],enumerable:!0})},__copyProps=($r,pr,Mr,Nr)=>{if(pr&&typeof pr=="object"||typeof pr=="function")for(let Dr of __getOwnPropNames(pr))!__hasOwnProp.call($r,Dr)&&Dr!==Mr&&__defProp($r,Dr,{get:()=>pr[Dr],enumerable:!(Nr=__getOwnPropDesc(pr,Dr))||Nr.enumerable});return $r},__toESM=($r,pr,Mr)=>(Mr=$r!=null?__create(__getProtoOf($r)):{},__copyProps(pr||!$r||!$r.__esModule?__defProp(Mr,"default",{value:$r,enumerable:!0}):Mr,$r)),__toCommonJS=$r=>__copyProps(__defProp({},"__esModule",{value:!0}),$r),require_err_code=__commonJS({"node_modules/err-code/index.js"($r,pr){function Mr(Dr,Br){for(const Lr in Br)Object.defineProperty(Dr,Lr,{value:Br[Lr],enumerable:!0,configurable:!0});return Dr}function Nr(Dr,Br,Lr){if(!Dr||typeof Dr=="string")throw new TypeError("Please pass an Error to err-code");Lr||(Lr={}),typeof Br=="object"&&(Lr=Br,Br=""),Br&&(Lr.code=Br);try{return Mr(Dr,Lr)}catch{Lr.message=Dr.message,Lr.stack=Dr.stack;const Ur=function(){};return Ur.prototype=Object.create(Object.getPrototypeOf(Dr)),Mr(new Ur,Lr)}}pr.exports=Nr}}),require_aspromise=__commonJS({"node_modules/@protobufjs/aspromise/index.js"($r,pr){pr.exports=Mr;function Mr(Nr,Dr){for(var Br=new Array(arguments.length-1),Lr=0,jr=2,Ur=!0;jr<arguments.length;)Br[Lr++]=arguments[jr++];return new Promise(function(Yr,Qr){Br[Lr]=function(ga){if(Ur)if(Ur=!1,ga)Qr(ga);else{for(var eo=new Array(arguments.length-1),_i=0;_i<eo.length;)eo[_i++]=arguments[_i];Yr.apply(null,eo)}};try{Nr.apply(Dr||null,Br)}catch(Wn){Ur&&(Ur=!1,Qr(Wn))}})}}}),require_base64=__commonJS({"node_modules/@protobufjs/base64/index.js"($r){var pr=$r;pr.length=function(jr){var Ur=jr.length;if(!Ur)return 0;for(var Gr=0;--Ur%4>1&&jr.charAt(Ur)==="=";)++Gr;return Math.ceil(jr.length*3)/4-Gr};var Mr=new Array(64),Nr=new Array(123);for(Dr=0;Dr<64;)Nr[Mr[Dr]=Dr<26?Dr+65:Dr<52?Dr+71:Dr<62?Dr-4:Dr-59|43]=Dr++;var Dr;pr.encode=function(jr,Ur,Gr){for(var Yr=null,Qr=[],Wn=0,ga=0,eo;Ur<Gr;){var _i=jr[Ur++];switch(ga){case 0:Qr[Wn++]=Mr[_i>>2],eo=(_i&3)<<4,ga=1;break;case 1:Qr[Wn++]=Mr[eo|_i>>4],eo=(_i&15)<<2,ga=2;break;case 2:Qr[Wn++]=Mr[eo|_i>>6],Qr[Wn++]=Mr[_i&63],ga=0;break}Wn>8191&&((Yr||(Yr=[])).push(String.fromCharCode.apply(String,Qr)),Wn=0)}return ga&&(Qr[Wn++]=Mr[eo],Qr[Wn++]=61,ga===1&&(Qr[Wn++]=61)),Yr?(Wn&&Yr.push(String.fromCharCode.apply(String,Qr.slice(0,Wn))),Yr.join("")):String.fromCharCode.apply(String,Qr.slice(0,Wn))};var Br="invalid encoding";pr.decode=function(jr,Ur,Gr){for(var Yr=Gr,Qr=0,Wn,ga=0;ga<jr.length;){var eo=jr.charCodeAt(ga++);if(eo===61&&Qr>1)break;if((eo=Nr[eo])===void 0)throw Error(Br);switch(Qr){case 0:Wn=eo,Qr=1;break;case 1:Ur[Gr++]=Wn<<2|(eo&48)>>4,Wn=eo,Qr=2;break;case 2:Ur[Gr++]=(Wn&15)<<4|(eo&60)>>2,Wn=eo,Qr=3;break;case 3:Ur[Gr++]=(Wn&3)<<6|eo,Qr=0;break}}if(Qr===1)throw Error(Br);return Gr-Yr},pr.test=function(jr){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(jr)}}}),require_eventemitter=__commonJS({"node_modules/@protobufjs/eventemitter/index.js"($r,pr){pr.exports=Mr;function Mr(){this._listeners={}}Mr.prototype.on=function(Dr,Br,Lr){return(this._listeners[Dr]||(this._listeners[Dr]=[])).push({fn:Br,ctx:Lr||this}),this},Mr.prototype.off=function(Dr,Br){if(Dr===void 0)this._listeners={};else if(Br===void 0)this._listeners[Dr]=[];else for(var Lr=this._listeners[Dr],jr=0;jr<Lr.length;)Lr[jr].fn===Br?Lr.splice(jr,1):++jr;return this},Mr.prototype.emit=function(Dr){var Br=this._listeners[Dr];if(Br){for(var Lr=[],jr=1;jr<arguments.length;)Lr.push(arguments[jr++]);for(jr=0;jr<Br.length;)Br[jr].fn.apply(Br[jr++].ctx,Lr)}return this}}}),require_float=__commonJS({"node_modules/@protobufjs/float/index.js"($r,pr){pr.exports=Mr(Mr);function Mr(jr){return typeof Float32Array<"u"?function(){var Ur=new Float32Array([-0]),Gr=new Uint8Array(Ur.buffer),Yr=Gr[3]===128;function Qr(_i,va,io){Ur[0]=_i,va[io]=Gr[0],va[io+1]=Gr[1],va[io+2]=Gr[2],va[io+3]=Gr[3]}function Wn(_i,va,io){Ur[0]=_i,va[io]=Gr[3],va[io+1]=Gr[2],va[io+2]=Gr[1],va[io+3]=Gr[0]}jr.writeFloatLE=Yr?Qr:Wn,jr.writeFloatBE=Yr?Wn:Qr;function ga(_i,va){return Gr[0]=_i[va],Gr[1]=_i[va+1],Gr[2]=_i[va+2],Gr[3]=_i[va+3],Ur[0]}function eo(_i,va){return Gr[3]=_i[va],Gr[2]=_i[va+1],Gr[1]=_i[va+2],Gr[0]=_i[va+3],Ur[0]}jr.readFloatLE=Yr?ga:eo,jr.readFloatBE=Yr?eo:ga}():function(){function Ur(Yr,Qr,Wn,ga){var eo=Qr<0?1:0;if(eo&&(Qr=-Qr),Qr===0)Yr(1/Qr>0?0:2147483648,Wn,ga);else if(isNaN(Qr))Yr(2143289344,Wn,ga);else if(Qr>34028234663852886e22)Yr((eo<<31|2139095040)>>>0,Wn,ga);else if(Qr<11754943508222875e-54)Yr((eo<<31|Math.round(Qr/1401298464324817e-60))>>>0,Wn,ga);else{var _i=Math.floor(Math.log(Qr)/Math.LN2),va=Math.round(Qr*Math.pow(2,-_i)*8388608)&8388607;Yr((eo<<31|_i+127<<23|va)>>>0,Wn,ga)}}jr.writeFloatLE=Ur.bind(null,Nr),jr.writeFloatBE=Ur.bind(null,Dr);function Gr(Yr,Qr,Wn){var ga=Yr(Qr,Wn),eo=(ga>>31)*2+1,_i=ga>>>23&255,va=ga&8388607;return _i===255?va?NaN:eo*(1/0):_i===0?eo*1401298464324817e-60*va:eo*Math.pow(2,_i-150)*(va+8388608)}jr.readFloatLE=Gr.bind(null,Br),jr.readFloatBE=Gr.bind(null,Lr)}(),typeof Float64Array<"u"?function(){var Ur=new Float64Array([-0]),Gr=new Uint8Array(Ur.buffer),Yr=Gr[7]===128;function Qr(_i,va,io){Ur[0]=_i,va[io]=Gr[0],va[io+1]=Gr[1],va[io+2]=Gr[2],va[io+3]=Gr[3],va[io+4]=Gr[4],va[io+5]=Gr[5],va[io+6]=Gr[6],va[io+7]=Gr[7]}function Wn(_i,va,io){Ur[0]=_i,va[io]=Gr[7],va[io+1]=Gr[6],va[io+2]=Gr[5],va[io+3]=Gr[4],va[io+4]=Gr[3],va[io+5]=Gr[2],va[io+6]=Gr[1],va[io+7]=Gr[0]}jr.writeDoubleLE=Yr?Qr:Wn,jr.writeDoubleBE=Yr?Wn:Qr;function ga(_i,va){return Gr[0]=_i[va],Gr[1]=_i[va+1],Gr[2]=_i[va+2],Gr[3]=_i[va+3],Gr[4]=_i[va+4],Gr[5]=_i[va+5],Gr[6]=_i[va+6],Gr[7]=_i[va+7],Ur[0]}function eo(_i,va){return Gr[7]=_i[va],Gr[6]=_i[va+1],Gr[5]=_i[va+2],Gr[4]=_i[va+3],Gr[3]=_i[va+4],Gr[2]=_i[va+5],Gr[1]=_i[va+6],Gr[0]=_i[va+7],Ur[0]}jr.readDoubleLE=Yr?ga:eo,jr.readDoubleBE=Yr?eo:ga}():function(){function Ur(Yr,Qr,Wn,ga,eo,_i){var va=ga<0?1:0;if(va&&(ga=-ga),ga===0)Yr(0,eo,_i+Qr),Yr(1/ga>0?0:2147483648,eo,_i+Wn);else if(isNaN(ga))Yr(0,eo,_i+Qr),Yr(2146959360,eo,_i+Wn);else if(ga>17976931348623157e292)Yr(0,eo,_i+Qr),Yr((va<<31|2146435072)>>>0,eo,_i+Wn);else{var io;if(ga<22250738585072014e-324)io=ga/5e-324,Yr(io>>>0,eo,_i+Qr),Yr((va<<31|io/4294967296)>>>0,eo,_i+Wn);else{var no=Math.floor(Math.log(ga)/Math.LN2);no===1024&&(no=1023),io=ga*Math.pow(2,-no),Yr(io*4503599627370496>>>0,eo,_i+Qr),Yr((va<<31|no+1023<<20|io*1048576&1048575)>>>0,eo,_i+Wn)}}}jr.writeDoubleLE=Ur.bind(null,Nr,0,4),jr.writeDoubleBE=Ur.bind(null,Dr,4,0);function Gr(Yr,Qr,Wn,ga,eo){var _i=Yr(ga,eo+Qr),va=Yr(ga,eo+Wn),io=(va>>31)*2+1,no=va>>>20&2047,so=4294967296*(va&1048575)+_i;return no===2047?so?NaN:io*(1/0):no===0?io*5e-324*so:io*Math.pow(2,no-1075)*(so+4503599627370496)}jr.readDoubleLE=Gr.bind(null,Br,0,4),jr.readDoubleBE=Gr.bind(null,Lr,4,0)}(),jr}function Nr(jr,Ur,Gr){Ur[Gr]=jr&255,Ur[Gr+1]=jr>>>8&255,Ur[Gr+2]=jr>>>16&255,Ur[Gr+3]=jr>>>24}function Dr(jr,Ur,Gr){Ur[Gr]=jr>>>24,Ur[Gr+1]=jr>>>16&255,Ur[Gr+2]=jr>>>8&255,Ur[Gr+3]=jr&255}function Br(jr,Ur){return(jr[Ur]|jr[Ur+1]<<8|jr[Ur+2]<<16|jr[Ur+3]<<24)>>>0}function Lr(jr,Ur){return(jr[Ur]<<24|jr[Ur+1]<<16|jr[Ur+2]<<8|jr[Ur+3])>>>0}}}),require_inquire=__commonJS({"node_modules/@protobufjs/inquire/index.js"(exports,module){module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch($r){}return null}}}),require_utf8=__commonJS({"node_modules/@protobufjs/utf8/index.js"($r){var pr=$r;pr.length=function(Nr){for(var Dr=0,Br=0,Lr=0;Lr<Nr.length;++Lr)Br=Nr.charCodeAt(Lr),Br<128?Dr+=1:Br<2048?Dr+=2:(Br&64512)===55296&&(Nr.charCodeAt(Lr+1)&64512)===56320?(++Lr,Dr+=4):Dr+=3;return Dr},pr.read=function(Nr,Dr,Br){var Lr=Br-Dr;if(Lr<1)return"";for(var jr=null,Ur=[],Gr=0,Yr;Dr<Br;)Yr=Nr[Dr++],Yr<128?Ur[Gr++]=Yr:Yr>191&&Yr<224?Ur[Gr++]=(Yr&31)<<6|Nr[Dr++]&63:Yr>239&&Yr<365?(Yr=((Yr&7)<<18|(Nr[Dr++]&63)<<12|(Nr[Dr++]&63)<<6|Nr[Dr++]&63)-65536,Ur[Gr++]=55296+(Yr>>10),Ur[Gr++]=56320+(Yr&1023)):Ur[Gr++]=(Yr&15)<<12|(Nr[Dr++]&63)<<6|Nr[Dr++]&63,Gr>8191&&((jr||(jr=[])).push(String.fromCharCode.apply(String,Ur)),Gr=0);return jr?(Gr&&jr.push(String.fromCharCode.apply(String,Ur.slice(0,Gr))),jr.join("")):String.fromCharCode.apply(String,Ur.slice(0,Gr))},pr.write=function(Nr,Dr,Br){for(var Lr=Br,jr,Ur,Gr=0;Gr<Nr.length;++Gr)jr=Nr.charCodeAt(Gr),jr<128?Dr[Br++]=jr:jr<2048?(Dr[Br++]=jr>>6|192,Dr[Br++]=jr&63|128):(jr&64512)===55296&&((Ur=Nr.charCodeAt(Gr+1))&64512)===56320?(jr=65536+((jr&1023)<<10)+(Ur&1023),++Gr,Dr[Br++]=jr>>18|240,Dr[Br++]=jr>>12&63|128,Dr[Br++]=jr>>6&63|128,Dr[Br++]=jr&63|128):(Dr[Br++]=jr>>12|224,Dr[Br++]=jr>>6&63|128,Dr[Br++]=jr&63|128);return Br-Lr}}}),require_pool=__commonJS({"node_modules/@protobufjs/pool/index.js"($r,pr){pr.exports=Mr;function Mr(Nr,Dr,Br){var Lr=Br||8192,jr=Lr>>>1,Ur=null,Gr=Lr;return function(Qr){if(Qr<1||Qr>jr)return Nr(Qr);Gr+Qr>Lr&&(Ur=Nr(Lr),Gr=0);var Wn=Dr.call(Ur,Gr,Gr+=Qr);return Gr&7&&(Gr=(Gr|7)+1),Wn}}}}),require_longbits=__commonJS({"node_modules/protobufjs/src/util/longbits.js"($r,pr){pr.exports=Nr;var Mr=require_minimal();function Nr(jr,Ur){this.lo=jr>>>0,this.hi=Ur>>>0}var Dr=Nr.zero=new Nr(0,0);Dr.toNumber=function(){return 0},Dr.zzEncode=Dr.zzDecode=function(){return this},Dr.length=function(){return 1};var Br=Nr.zeroHash="\0\0\0\0\0\0\0\0";Nr.fromNumber=function(Ur){if(Ur===0)return Dr;var Gr=Ur<0;Gr&&(Ur=-Ur);var Yr=Ur>>>0,Qr=(Ur-Yr)/4294967296>>>0;return Gr&&(Qr=~Qr>>>0,Yr=~Yr>>>0,++Yr>4294967295&&(Yr=0,++Qr>4294967295&&(Qr=0))),new Nr(Yr,Qr)},Nr.from=function(Ur){if(typeof Ur=="number")return Nr.fromNumber(Ur);if(Mr.isString(Ur))if(Mr.Long)Ur=Mr.Long.fromString(Ur);else return Nr.fromNumber(parseInt(Ur,10));return Ur.low||Ur.high?new Nr(Ur.low>>>0,Ur.high>>>0):Dr},Nr.prototype.toNumber=function(Ur){if(!Ur&&this.hi>>>31){var Gr=~this.lo+1>>>0,Yr=~this.hi>>>0;return Gr||(Yr=Yr+1>>>0),-(Gr+Yr*4294967296)}return this.lo+this.hi*4294967296},Nr.prototype.toLong=function(Ur){return Mr.Long?new Mr.Long(this.lo|0,this.hi|0,!!Ur):{low:this.lo|0,high:this.hi|0,unsigned:!!Ur}};var Lr=String.prototype.charCodeAt;Nr.fromHash=function(Ur){return Ur===Br?Dr:new Nr((Lr.call(Ur,0)|Lr.call(Ur,1)<<8|Lr.call(Ur,2)<<16|Lr.call(Ur,3)<<24)>>>0,(Lr.call(Ur,4)|Lr.call(Ur,5)<<8|Lr.call(Ur,6)<<16|Lr.call(Ur,7)<<24)>>>0)},Nr.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},Nr.prototype.zzEncode=function(){var Ur=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^Ur)>>>0,this.lo=(this.lo<<1^Ur)>>>0,this},Nr.prototype.zzDecode=function(){var Ur=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^Ur)>>>0,this.hi=(this.hi>>>1^Ur)>>>0,this},Nr.prototype.length=function(){var Ur=this.lo,Gr=(this.lo>>>28|this.hi<<4)>>>0,Yr=this.hi>>>24;return Yr===0?Gr===0?Ur<16384?Ur<128?1:2:Ur<2097152?3:4:Gr<16384?Gr<128?5:6:Gr<2097152?7:8:Yr<128?9:10}}}),require_minimal=__commonJS({"node_modules/protobufjs/src/util/minimal.js"($r){var pr=$r;pr.asPromise=require_aspromise(),pr.base64=require_base64(),pr.EventEmitter=require_eventemitter(),pr.float=require_float(),pr.inquire=require_inquire(),pr.utf8=require_utf8(),pr.pool=require_pool(),pr.LongBits=require_longbits(),pr.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),pr.global=pr.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||$r,pr.emptyArray=Object.freeze?Object.freeze([]):[],pr.emptyObject=Object.freeze?Object.freeze({}):{},pr.isInteger=Number.isInteger||function(Br){return typeof Br=="number"&&isFinite(Br)&&Math.floor(Br)===Br},pr.isString=function(Br){return typeof Br=="string"||Br instanceof String},pr.isObject=function(Br){return Br&&typeof Br=="object"},pr.isset=pr.isSet=function(Br,Lr){var jr=Br[Lr];return jr!=null&&Br.hasOwnProperty(Lr)?typeof jr!="object"||(Array.isArray(jr)?jr.length:Object.keys(jr).length)>0:!1},pr.Buffer=function(){try{var Dr=pr.inquire("buffer").Buffer;return Dr.prototype.utf8Write?Dr:null}catch{return null}}(),pr._Buffer_from=null,pr._Buffer_allocUnsafe=null,pr.newBuffer=function(Br){return typeof Br=="number"?pr.Buffer?pr._Buffer_allocUnsafe(Br):new pr.Array(Br):pr.Buffer?pr._Buffer_from(Br):typeof Uint8Array>"u"?Br:new Uint8Array(Br)},pr.Array=typeof Uint8Array<"u"?Uint8Array:Array,pr.Long=pr.global.dcodeIO&&pr.global.dcodeIO.Long||pr.global.Long||pr.inquire("long"),pr.key2Re=/^true|false|0|1$/,pr.key32Re=/^-?(?:0|[1-9][0-9]*)$/,pr.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,pr.longToHash=function(Br){return Br?pr.LongBits.from(Br).toHash():pr.LongBits.zeroHash},pr.longFromHash=function(Br,Lr){var jr=pr.LongBits.fromHash(Br);return pr.Long?pr.Long.fromBits(jr.lo,jr.hi,Lr):jr.toNumber(!!Lr)};function Mr(Dr,Br,Lr){for(var jr=Object.keys(Br),Ur=0;Ur<jr.length;++Ur)(Dr[jr[Ur]]===void 0||!Lr)&&(Dr[jr[Ur]]=Br[jr[Ur]]);return Dr}pr.merge=Mr,pr.lcFirst=function(Br){return Br.charAt(0).toLowerCase()+Br.substring(1)};function Nr(Dr){function Br(Lr,jr){if(!(this instanceof Br))return new Br(Lr,jr);Object.defineProperty(this,"message",{get:function(){return Lr}}),Error.captureStackTrace?Error.captureStackTrace(this,Br):Object.defineProperty(this,"stack",{value:new Error().stack||""}),jr&&Mr(this,jr)}return Br.prototype=Object.create(Error.prototype,{constructor:{value:Br,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return Dr},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),Br}pr.newError=Nr,pr.ProtocolError=Nr("ProtocolError"),pr.oneOfGetter=function(Br){for(var Lr={},jr=0;jr<Br.length;++jr)Lr[Br[jr]]=1;return function(){for(var Ur=Object.keys(this),Gr=Ur.length-1;Gr>-1;--Gr)if(Lr[Ur[Gr]]===1&&this[Ur[Gr]]!==void 0&&this[Ur[Gr]]!==null)return Ur[Gr]}},pr.oneOfSetter=function(Br){return function(Lr){for(var jr=0;jr<Br.length;++jr)Br[jr]!==Lr&&delete this[Br[jr]]}},pr.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},pr._configure=function(){var Dr=pr.Buffer;if(!Dr){pr._Buffer_from=pr._Buffer_allocUnsafe=null;return}pr._Buffer_from=Dr.from!==Uint8Array.from&&Dr.from||function(Lr,jr){return new Dr(Lr,jr)},pr._Buffer_allocUnsafe=Dr.allocUnsafe||function(Lr){return new Dr(Lr)}}}}),require_reader=__commonJS({"node_modules/protobufjs/src/reader.js"($r,pr){pr.exports=jr;var Mr=require_minimal(),Nr,Dr=Mr.LongBits,Br=Mr.utf8;function Lr(ga,eo){return RangeError("index out of range: "+ga.pos+" + "+(eo||1)+" > "+ga.len)}function jr(ga){this.buf=ga,this.pos=0,this.len=ga.length}var Ur=typeof Uint8Array<"u"?function(eo){if(eo instanceof Uint8Array||Array.isArray(eo))return new jr(eo);throw Error("illegal buffer")}:function(eo){if(Array.isArray(eo))return new jr(eo);throw Error("illegal buffer")},Gr=function(){return Mr.Buffer?function(_i){return(jr.create=function(io){return Mr.Buffer.isBuffer(io)?new Nr(io):Ur(io)})(_i)}:Ur};jr.create=Gr(),jr.prototype._slice=Mr.Array.prototype.subarray||Mr.Array.prototype.slice,jr.prototype.uint32=function(){var eo=4294967295;return function(){if(eo=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(eo=(eo|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(eo=(eo|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(eo=(eo|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(eo=(eo|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return eo;if((this.pos+=5)>this.len)throw this.pos=this.len,Lr(this,10);return eo}}(),jr.prototype.int32=function(){return this.uint32()|0},jr.prototype.sint32=function(){var eo=this.uint32();return eo>>>1^-(eo&1)|0};function Yr(){var ga=new Dr(0,0),eo=0;if(this.len-this.pos>4){for(;eo<4;++eo)if(ga.lo=(ga.lo|(this.buf[this.pos]&127)<<eo*7)>>>0,this.buf[this.pos++]<128)return ga;if(ga.lo=(ga.lo|(this.buf[this.pos]&127)<<28)>>>0,ga.hi=(ga.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return ga;eo=0}else{for(;eo<3;++eo){if(this.pos>=this.len)throw Lr(this);if(ga.lo=(ga.lo|(this.buf[this.pos]&127)<<eo*7)>>>0,this.buf[this.pos++]<128)return ga}return ga.lo=(ga.lo|(this.buf[this.pos++]&127)<<eo*7)>>>0,ga}if(this.len-this.pos>4){for(;eo<5;++eo)if(ga.hi=(ga.hi|(this.buf[this.pos]&127)<<eo*7+3)>>>0,this.buf[this.pos++]<128)return ga}else for(;eo<5;++eo){if(this.pos>=this.len)throw Lr(this);if(ga.hi=(ga.hi|(this.buf[this.pos]&127)<<eo*7+3)>>>0,this.buf[this.pos++]<128)return ga}throw Error("invalid varint encoding")}jr.prototype.bool=function(){return this.uint32()!==0};function Qr(ga,eo){return(ga[eo-4]|ga[eo-3]<<8|ga[eo-2]<<16|ga[eo-1]<<24)>>>0}jr.prototype.fixed32=function(){if(this.pos+4>this.len)throw Lr(this,4);return Qr(this.buf,this.pos+=4)},jr.prototype.sfixed32=function(){if(this.pos+4>this.len)throw Lr(this,4);return Qr(this.buf,this.pos+=4)|0};function Wn(){if(this.pos+8>this.len)throw Lr(this,8);return new Dr(Qr(this.buf,this.pos+=4),Qr(this.buf,this.pos+=4))}jr.prototype.float=function(){if(this.pos+4>this.len)throw Lr(this,4);var eo=Mr.float.readFloatLE(this.buf,this.pos);return this.pos+=4,eo},jr.prototype.double=function(){if(this.pos+8>this.len)throw Lr(this,4);var eo=Mr.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,eo},jr.prototype.bytes=function(){var eo=this.uint32(),_i=this.pos,va=this.pos+eo;if(va>this.len)throw Lr(this,eo);return this.pos+=eo,Array.isArray(this.buf)?this.buf.slice(_i,va):_i===va?new this.buf.constructor(0):this._slice.call(this.buf,_i,va)},jr.prototype.string=function(){var eo=this.bytes();return Br.read(eo,0,eo.length)},jr.prototype.skip=function(eo){if(typeof eo=="number"){if(this.pos+eo>this.len)throw Lr(this,eo);this.pos+=eo}else do if(this.pos>=this.len)throw Lr(this);while(this.buf[this.pos++]&128);return this},jr.prototype.skipType=function(ga){switch(ga){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(ga=this.uint32()&7)!==4;)this.skipType(ga);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+ga+" at offset "+this.pos)}return this},jr._configure=function(ga){Nr=ga,jr.create=Gr(),Nr._configure();var eo=Mr.Long?"toLong":"toNumber";Mr.merge(jr.prototype,{int64:function(){return Yr.call(this)[eo](!1)},uint64:function(){return Yr.call(this)[eo](!0)},sint64:function(){return Yr.call(this).zzDecode()[eo](!1)},fixed64:function(){return Wn.call(this)[eo](!0)},sfixed64:function(){return Wn.call(this)[eo](!1)}})}}}),require_reader_buffer=__commonJS({"node_modules/protobufjs/src/reader_buffer.js"($r,pr){pr.exports=Dr;var Mr=require_reader();(Dr.prototype=Object.create(Mr.prototype)).constructor=Dr;var Nr=require_minimal();function Dr(Br){Mr.call(this,Br)}Dr._configure=function(){Nr.Buffer&&(Dr.prototype._slice=Nr.Buffer.prototype.slice)},Dr.prototype.string=function(){var Lr=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+Lr,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+Lr,this.len))},Dr._configure()}}),require_writer=__commonJS({"node_modules/protobufjs/src/writer.js"($r,pr){pr.exports=Yr;var Mr=require_minimal(),Nr,Dr=Mr.LongBits,Br=Mr.base64,Lr=Mr.utf8;function jr(no,so,ao){this.fn=no,this.len=so,this.next=void 0,this.val=ao}function Ur(){}function Gr(no){this.head=no.head,this.tail=no.tail,this.len=no.len,this.next=no.states}function Yr(){this.len=0,this.head=new jr(Ur,0,0),this.tail=this.head,this.states=null}var Qr=function(){return Mr.Buffer?function(){return(Yr.create=function(){return new Nr})()}:function(){return new Yr}};Yr.create=Qr(),Yr.alloc=function(so){return new Mr.Array(so)},Mr.Array!==Array&&(Yr.alloc=Mr.pool(Yr.alloc,Mr.Array.prototype.subarray)),Yr.prototype._push=function(so,ao,fo){return this.tail=this.tail.next=new jr(so,ao,fo),this.len+=ao,this};function Wn(no,so,ao){so[ao]=no&255}function ga(no,so,ao){for(;no>127;)so[ao++]=no&127|128,no>>>=7;so[ao]=no}function eo(no,so){this.len=no,this.next=void 0,this.val=so}eo.prototype=Object.create(jr.prototype),eo.prototype.fn=ga,Yr.prototype.uint32=function(so){return this.len+=(this.tail=this.tail.next=new eo((so=so>>>0)<128?1:so<16384?2:so<2097152?3:so<268435456?4:5,so)).len,this},Yr.prototype.int32=function(so){return so<0?this._push(_i,10,Dr.fromNumber(so)):this.uint32(so)},Yr.prototype.sint32=function(so){return this.uint32((so<<1^so>>31)>>>0)};function _i(no,so,ao){for(;no.hi;)so[ao++]=no.lo&127|128,no.lo=(no.lo>>>7|no.hi<<25)>>>0,no.hi>>>=7;for(;no.lo>127;)so[ao++]=no.lo&127|128,no.lo=no.lo>>>7;so[ao++]=no.lo}Yr.prototype.uint64=function(so){var ao=Dr.from(so);return this._push(_i,ao.length(),ao)},Yr.prototype.int64=Yr.prototype.uint64,Yr.prototype.sint64=function(so){var ao=Dr.from(so).zzEncode();return this._push(_i,ao.length(),ao)},Yr.prototype.bool=function(so){return this._push(Wn,1,so?1:0)};function va(no,so,ao){so[ao]=no&255,so[ao+1]=no>>>8&255,so[ao+2]=no>>>16&255,so[ao+3]=no>>>24}Yr.prototype.fixed32=function(so){return this._push(va,4,so>>>0)},Yr.prototype.sfixed32=Yr.prototype.fixed32,Yr.prototype.fixed64=function(so){var ao=Dr.from(so);return this._push(va,4,ao.lo)._push(va,4,ao.hi)},Yr.prototype.sfixed64=Yr.prototype.fixed64,Yr.prototype.float=function(so){return this._push(Mr.float.writeFloatLE,4,so)},Yr.prototype.double=function(so){return this._push(Mr.float.writeDoubleLE,8,so)};var io=Mr.Array.prototype.set?function(so,ao,fo){ao.set(so,fo)}:function(so,ao,fo){for(var lo=0;lo<so.length;++lo)ao[fo+lo]=so[lo]};Yr.prototype.bytes=function(so){var ao=so.length>>>0;if(!ao)return this._push(Wn,1,0);if(Mr.isString(so)){var fo=Yr.alloc(ao=Br.length(so));Br.decode(so,fo,0),so=fo}return this.uint32(ao)._push(io,ao,so)},Yr.prototype.string=function(so){var ao=Lr.length(so);return ao?this.uint32(ao)._push(Lr.write,ao,so):this._push(Wn,1,0)},Yr.prototype.fork=function(){return this.states=new Gr(this),this.head=this.tail=new jr(Ur,0,0),this.len=0,this},Yr.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new jr(Ur,0,0),this.len=0),this},Yr.prototype.ldelim=function(){var so=this.head,ao=this.tail,fo=this.len;return this.reset().uint32(fo),fo&&(this.tail.next=so.next,this.tail=ao,this.len+=fo),this},Yr.prototype.finish=function(){for(var so=this.head.next,ao=this.constructor.alloc(this.len),fo=0;so;)so.fn(so.val,ao,fo),fo+=so.len,so=so.next;return ao},Yr._configure=function(no){Nr=no,Yr.create=Qr(),Nr._configure()}}}),require_writer_buffer=__commonJS({"node_modules/protobufjs/src/writer_buffer.js"($r,pr){pr.exports=Dr;var Mr=require_writer();(Dr.prototype=Object.create(Mr.prototype)).constructor=Dr;var Nr=require_minimal();function Dr(){Mr.call(this)}Dr._configure=function(){Dr.alloc=Nr._Buffer_allocUnsafe,Dr.writeBytesBuffer=Nr.Buffer&&Nr.Buffer.prototype instanceof Uint8Array&&Nr.Buffer.prototype.set.name==="set"?function(jr,Ur,Gr){Ur.set(jr,Gr)}:function(jr,Ur,Gr){if(jr.copy)jr.copy(Ur,Gr,0,jr.length);else for(var Yr=0;Yr<jr.length;)Ur[Gr++]=jr[Yr++]}},Dr.prototype.bytes=function(jr){Nr.isString(jr)&&(jr=Nr._Buffer_from(jr,"base64"));var Ur=jr.length>>>0;return this.uint32(Ur),Ur&&this._push(Dr.writeBytesBuffer,Ur,jr),this};function Br(Lr,jr,Ur){Lr.length<40?Nr.utf8.write(Lr,jr,Ur):jr.utf8Write?jr.utf8Write(Lr,Ur):jr.write(Lr,Ur)}Dr.prototype.string=function(jr){var Ur=Nr.Buffer.byteLength(jr);return this.uint32(Ur),Ur&&this._push(Br,Ur,jr),this},Dr._configure()}}),require_murmurHash3js=__commonJS({"node_modules/murmurhash3js-revisited/lib/murmurHash3js.js"($r,pr){(function(Mr,Nr){var Dr={version:"3.0.0",x86:{},x64:{},inputValidation:!0};function Br(_i){if(!Array.isArray(_i)&&!ArrayBuffer.isView(_i))return!1;for(var va=0;va<_i.length;va++)if(!Number.isInteger(_i[va])||_i[va]<0||_i[va]>255)return!1;return!0}function Lr(_i,va){return(_i&65535)*va+(((_i>>>16)*va&65535)<<16)}function jr(_i,va){return _i<<va|_i>>>32-va}function Ur(_i){return _i^=_i>>>16,_i=Lr(_i,2246822507),_i^=_i>>>13,_i=Lr(_i,3266489909),_i^=_i>>>16,_i}function Gr(_i,va){_i=[_i[0]>>>16,_i[0]&65535,_i[1]>>>16,_i[1]&65535],va=[va[0]>>>16,va[0]&65535,va[1]>>>16,va[1]&65535];var io=[0,0,0,0];return io[3]+=_i[3]+va[3],io[2]+=io[3]>>>16,io[3]&=65535,io[2]+=_i[2]+va[2],io[1]+=io[2]>>>16,io[2]&=65535,io[1]+=_i[1]+va[1],io[0]+=io[1]>>>16,io[1]&=65535,io[0]+=_i[0]+va[0],io[0]&=65535,[io[0]<<16|io[1],io[2]<<16|io[3]]}function Yr(_i,va){_i=[_i[0]>>>16,_i[0]&65535,_i[1]>>>16,_i[1]&65535],va=[va[0]>>>16,va[0]&65535,va[1]>>>16,va[1]&65535];var io=[0,0,0,0];return io[3]+=_i[3]*va[3],io[2]+=io[3]>>>16,io[3]&=65535,io[2]+=_i[2]*va[3],io[1]+=io[2]>>>16,io[2]&=65535,io[2]+=_i[3]*va[2],io[1]+=io[2]>>>16,io[2]&=65535,io[1]+=_i[1]*va[3],io[0]+=io[1]>>>16,io[1]&=65535,io[1]+=_i[2]*va[2],io[0]+=io[1]>>>16,io[1]&=65535,io[1]+=_i[3]*va[1],io[0]+=io[1]>>>16,io[1]&=65535,io[0]+=_i[0]*va[3]+_i[1]*va[2]+_i[2]*va[1]+_i[3]*va[0],io[0]&=65535,[io[0]<<16|io[1],io[2]<<16|io[3]]}function Qr(_i,va){return va%=64,va===32?[_i[1],_i[0]]:va<32?[_i[0]<<va|_i[1]>>>32-va,_i[1]<<va|_i[0]>>>32-va]:(va-=32,[_i[1]<<va|_i[0]>>>32-va,_i[0]<<va|_i[1]>>>32-va])}function Wn(_i,va){return va%=64,va===0?_i:va<32?[_i[0]<<va|_i[1]>>>32-va,_i[1]<<va]:[_i[1]<<va-32,0]}function ga(_i,va){return[_i[0]^va[0],_i[1]^va[1]]}function eo(_i){return _i=ga(_i,[0,_i[0]>>>1]),_i=Yr(_i,[4283543511,3981806797]),_i=ga(_i,[0,_i[0]>>>1]),_i=Yr(_i,[3301882366,444984403]),_i=ga(_i,[0,_i[0]>>>1]),_i}Dr.x86.hash32=function(_i,va){if(Dr.inputValidation&&!Br(_i))return Nr;va=va||0;for(var io=_i.length%4,no=_i.length-io,so=va,ao=0,fo=3432918353,lo=461845907,oo=0;oo<no;oo=oo+4)ao=_i[oo]|_i[oo+1]<<8|_i[oo+2]<<16|_i[oo+3]<<24,ao=Lr(ao,fo),ao=jr(ao,15),ao=Lr(ao,lo),so^=ao,so=jr(so,13),so=Lr(so,5)+3864292196;switch(ao=0,io){case 3:ao^=_i[oo+2]<<16;case 2:ao^=_i[oo+1]<<8;case 1:ao^=_i[oo],ao=Lr(ao,fo),ao=jr(ao,15),ao=Lr(ao,lo),so^=ao}return so^=_i.length,so=Ur(so),so>>>0},Dr.x86.hash128=function(_i,va){if(Dr.inputValidation&&!Br(_i))return Nr;va=va||0;for(var io=_i.length%16,no=_i.length-io,so=va,ao=va,fo=va,lo=va,oo=0,po=0,mo=0,$o=0,Xn=597399067,Fr=2869860233,Vr=951274213,Wr=2716044179,Jr=0;Jr<no;Jr=Jr+16)oo=_i[Jr]|_i[Jr+1]<<8|_i[Jr+2]<<16|_i[Jr+3]<<24,po=_i[Jr+4]|_i[Jr+5]<<8|_i[Jr+6]<<16|_i[Jr+7]<<24,mo=_i[Jr+8]|_i[Jr+9]<<8|_i[Jr+10]<<16|_i[Jr+11]<<24,$o=_i[Jr+12]|_i[Jr+13]<<8|_i[Jr+14]<<16|_i[Jr+15]<<24,oo=Lr(oo,Xn),oo=jr(oo,15),oo=Lr(oo,Fr),so^=oo,so=jr(so,19),so+=ao,so=Lr(so,5)+1444728091,po=Lr(po,Fr),po=jr(po,16),po=Lr(po,Vr),ao^=po,ao=jr(ao,17),ao+=fo,ao=Lr(ao,5)+197830471,mo=Lr(mo,Vr),mo=jr(mo,17),mo=Lr(mo,Wr),fo^=mo,fo=jr(fo,15),fo+=lo,fo=Lr(fo,5)+2530024501,$o=Lr($o,Wr),$o=jr($o,18),$o=Lr($o,Xn),lo^=$o,lo=jr(lo,13),lo+=so,lo=Lr(lo,5)+850148119;switch(oo=0,po=0,mo=0,$o=0,io){case 15:$o^=_i[Jr+14]<<16;case 14:$o^=_i[Jr+13]<<8;case 13:$o^=_i[Jr+12],$o=Lr($o,Wr),$o=jr($o,18),$o=Lr($o,Xn),lo^=$o;case 12:mo^=_i[Jr+11]<<24;case 11:mo^=_i[Jr+10]<<16;case 10:mo^=_i[Jr+9]<<8;case 9:mo^=_i[Jr+8],mo=Lr(mo,Vr),mo=jr(mo,17),mo=Lr(mo,Wr),fo^=mo;case 8:po^=_i[Jr+7]<<24;case 7:po^=_i[Jr+6]<<16;case 6:po^=_i[Jr+5]<<8;case 5:po^=_i[Jr+4],po=Lr(po,Fr),po=jr(po,16),po=Lr(po,Vr),ao^=po;case 4:oo^=_i[Jr+3]<<24;case 3:oo^=_i[Jr+2]<<16;case 2:oo^=_i[Jr+1]<<8;case 1:oo^=_i[Jr],oo=Lr(oo,Xn),oo=jr(oo,15),oo=Lr(oo,Fr),so^=oo}return so^=_i.length,ao^=_i.length,fo^=_i.length,lo^=_i.length,so+=ao,so+=fo,so+=lo,ao+=so,fo+=so,lo+=so,so=Ur(so),ao=Ur(ao),fo=Ur(fo),lo=Ur(lo),so+=ao,so+=fo,so+=lo,ao+=so,fo+=so,lo+=so,("00000000"+(so>>>0).toString(16)).slice(-8)+("00000000"+(ao>>>0).toString(16)).slice(-8)+("00000000"+(fo>>>0).toString(16)).slice(-8)+("00000000"+(lo>>>0).toString(16)).slice(-8)},Dr.x64.hash128=function(_i,va){if(Dr.inputValidation&&!Br(_i))return Nr;va=va||0;for(var io=_i.length%16,no=_i.length-io,so=[0,va],ao=[0,va],fo=[0,0],lo=[0,0],oo=[2277735313,289559509],po=[1291169091,658871167],mo=0;mo<no;mo=mo+16)fo=[_i[mo+4]|_i[mo+5]<<8|_i[mo+6]<<16|_i[mo+7]<<24,_i[mo]|_i[mo+1]<<8|_i[mo+2]<<16|_i[mo+3]<<24],lo=[_i[mo+12]|_i[mo+13]<<8|_i[mo+14]<<16|_i[mo+15]<<24,_i[mo+8]|_i[mo+9]<<8|_i[mo+10]<<16|_i[mo+11]<<24],fo=Yr(fo,oo),fo=Qr(fo,31),fo=Yr(fo,po),so=ga(so,fo),so=Qr(so,27),so=Gr(so,ao),so=Gr(Yr(so,[0,5]),[0,1390208809]),lo=Yr(lo,po),lo=Qr(lo,33),lo=Yr(lo,oo),ao=ga(ao,lo),ao=Qr(ao,31),ao=Gr(ao,so),ao=Gr(Yr(ao,[0,5]),[0,944331445]);switch(fo=[0,0],lo=[0,0],io){case 15:lo=ga(lo,Wn([0,_i[mo+14]],48));case 14:lo=ga(lo,Wn([0,_i[mo+13]],40));case 13:lo=ga(lo,Wn([0,_i[mo+12]],32));case 12:lo=ga(lo,Wn([0,_i[mo+11]],24));case 11:lo=ga(lo,Wn([0,_i[mo+10]],16));case 10:lo=ga(lo,Wn([0,_i[mo+9]],8));case 9:lo=ga(lo,[0,_i[mo+8]]),lo=Yr(lo,po),lo=Qr(lo,33),lo=Yr(lo,oo),ao=ga(ao,lo);case 8:fo=ga(fo,Wn([0,_i[mo+7]],56));case 7:fo=ga(fo,Wn([0,_i[mo+6]],48));case 6:fo=ga(fo,Wn([0,_i[mo+5]],40));case 5:fo=ga(fo,Wn([0,_i[mo+4]],32));case 4:fo=ga(fo,Wn([0,_i[mo+3]],24));case 3:fo=ga(fo,Wn([0,_i[mo+2]],16));case 2:fo=ga(fo,Wn([0,_i[mo+1]],8));case 1:fo=ga(fo,[0,_i[mo]]),fo=Yr(fo,oo),fo=Qr(fo,31),fo=Yr(fo,po),so=ga(so,fo)}return so=ga(so,[0,_i.length]),ao=ga(ao,[0,_i.length]),so=Gr(so,ao),ao=Gr(ao,so),so=eo(so),ao=eo(ao),so=Gr(so,ao),ao=Gr(ao,so),("00000000"+(so[0]>>>0).toString(16)).slice(-8)+("00000000"+(so[1]>>>0).toString(16)).slice(-8)+("00000000"+(ao[0]>>>0).toString(16)).slice(-8)+("00000000"+(ao[1]>>>0).toString(16)).slice(-8)},typeof $r<"u"?(typeof pr<"u"&&pr.exports&&($r=pr.exports=Dr),$r.murmurHash3=Dr):(Dr._murmurHash3=Mr.murmurHash3,Dr.noConflict=function(){return Mr.murmurHash3=Dr._murmurHash3,Dr._murmurHash3=Nr,Dr.noConflict=Nr,Dr},Mr.murmurHash3=Dr)})($r)}}),require_murmurhash3js_revisited=__commonJS({"node_modules/murmurhash3js-revisited/index.js"($r,pr){pr.exports=require_murmurHash3js()}}),require_sparse_array=__commonJS({"node_modules/sparse-array/index.js"($r,pr){var Mr=7;pr.exports=class{constructor(){this._bitArrays=[],this._data=[],this._length=0,this._changedLength=!1,this._changedData=!1}set(Ur,Gr){let Yr=this._internalPositionFor(Ur,!1);if(Gr===void 0)Yr!==-1&&(this._unsetInternalPos(Yr),this._unsetBit(Ur),this._changedLength=!0,this._changedData=!0);else{let Qr=!1;Yr===-1?(Yr=this._data.length,this._setBit(Ur),this._changedData=!0):Qr=!0,this._setInternalPos(Yr,Ur,Gr,Qr),this._changedLength=!0}}unset(Ur){this.set(Ur,void 0)}get(Ur){this._sortData();const Gr=this._internalPositionFor(Ur,!0);if(Gr!==-1)return this._data[Gr][1]}push(Ur){return this.set(this.length,Ur),this.length}get length(){if(this._sortData(),this._changedLength){const Ur=this._data[this._data.length-1];this._length=Ur?Ur[0]+1:0,this._changedLength=!1}return this._length}forEach(Ur){let Gr=0;for(;Gr<this.length;)Ur(this.get(Gr),Gr,this),Gr++}map(Ur){let Gr=0,Yr=new Array(this.length);for(;Gr<this.length;)Yr[Gr]=Ur(this.get(Gr),Gr,this),Gr++;return Yr}reduce(Ur,Gr){let Yr=0,Qr=Gr;for(;Yr<this.length;){const Wn=this.get(Yr);Qr=Ur(Qr,Wn,Yr),Yr++}return Qr}find(Ur){let Gr=0,Yr,Qr;for(;Gr<this.length&&!Yr;)Qr=this.get(Gr),Yr=Ur(Qr),Gr++;return Yr?Qr:void 0}_internalPositionFor(Ur,Gr){const Yr=this._bytePosFor(Ur,Gr);if(Yr>=this._bitArrays.length)return-1;const Qr=this._bitArrays[Yr],Wn=Ur-Yr*Mr;if(!((Qr&1<<Wn)>0))return-1;const eo=this._bitArrays.slice(0,Yr).reduce(Nr,0),_i=~(4294967295<<Wn+1),va=Dr(Qr&_i);return eo+va-1}_bytePosFor(Ur,Gr){const Yr=Math.floor(Ur/Mr),Qr=Yr+1;for(;!Gr&&this._bitArrays.length<Qr;)this._bitArrays.push(0);return Yr}_setBit(Ur){const Gr=this._bytePosFor(Ur,!1);this._bitArrays[Gr]|=1<<Ur-Gr*Mr}_unsetBit(Ur){const Gr=this._bytePosFor(Ur,!1);this._bitArrays[Gr]&=~(1<<Ur-Gr*Mr)}_setInternalPos(Ur,Gr,Yr,Qr){const Wn=this._data,ga=[Gr,Yr];if(Qr)this._sortData(),Wn[Ur]=ga;else{if(Wn.length)if(Wn[Wn.length-1][0]>=Gr)Wn.push(ga);else if(Wn[0][0]<=Gr)Wn.unshift(ga);else{const eo=Math.round(Wn.length/2);this._data=Wn.slice(0,eo).concat(ga).concat(Wn.slice(eo))}else this._data.push(ga);this._changedData=!0,this._changedLength=!0}}_unsetInternalPos(Ur){this._data.splice(Ur,1)}_sortData(){this._changedData&&this._data.sort(Br),this._changedData=!1}bitField(){const Ur=[];let Gr=8,Yr=0,Qr=0,Wn;const ga=this._bitArrays.slice();for(;ga.length||Yr;){Yr===0&&(Wn=ga.shift(),Yr=7);const _i=Math.min(Yr,Gr),va=~(255<<_i),io=Wn&va;Qr|=io<<8-Gr,Wn=Wn>>>_i,Yr-=_i,Gr-=_i,(!Gr||!Yr&&!ga.length)&&(Ur.push(Qr),Qr=0,Gr=8)}for(var eo=Ur.length-1;eo>0&&Ur[eo]===0;eo--)Ur.pop();return Ur}compactArray(){return this._sortData(),this._data.map(Lr)}};function Nr(jr,Ur){return jr+Dr(Ur)}function Dr(jr){let Ur=jr;return Ur=Ur-(Ur>>1&1431655765),Ur=(Ur&858993459)+(Ur>>2&858993459),(Ur+(Ur>>4)&252645135)*16843009>>24}function Br(jr,Ur){return jr[0]-Ur[0]}function Lr(jr){return jr[1]}}}),src_exports2={};__export(src_exports2,{calculateMultipleHashesADR32:()=>calculateMultipleHashesADR32,calculateMultipleHashesADR32LegacyQmHash:()=>calculateMultipleHashesADR32LegacyQmHash,compareStrings:()=>compareStrings,hashV0:()=>hashV0,hashV1:()=>hashV1,keccak256Hash:()=>keccak256Hash,prepareADR32Data:()=>prepareADR32Data,sortKeys:()=>sortKeys}),module.exports=__toCommonJS(src_exports2);var import_crypto3=__toESM(requireCryptoBrowserify(),1),bytes_exports={};__export(bytes_exports,{coerce:()=>coerce,empty:()=>empty,equals:()=>equals,fromHex:()=>fromHex,fromString:()=>fromString,isBinary:()=>isBinary,toHex:()=>toHex,toString:()=>toString});var empty=new Uint8Array(0),toHex=$r=>$r.reduce((pr,Mr)=>pr+Mr.toString(16).padStart(2,"0"),""),fromHex=$r=>{const pr=$r.match(/../g);return pr?new Uint8Array(pr.map(Mr=>parseInt(Mr,16))):empty},equals=($r,pr)=>{if($r===pr)return!0;if($r.byteLength!==pr.byteLength)return!1;for(let Mr=0;Mr<$r.byteLength;Mr++)if($r[Mr]!==pr[Mr])return!1;return!0},coerce=$r=>{if($r instanceof Uint8Array&&$r.constructor.name==="Uint8Array")return $r;if($r instanceof ArrayBuffer)return new Uint8Array($r);if(ArrayBuffer.isView($r))return new Uint8Array($r.buffer,$r.byteOffset,$r.byteLength);throw new Error("Unknown type, must be binary type")},isBinary=$r=>$r instanceof ArrayBuffer||ArrayBuffer.isView($r),fromString=$r=>new TextEncoder().encode($r),toString=$r=>new TextDecoder().decode($r),encode_1=encode,MSB=128,REST=127,MSBALL=~REST,INT=Math.pow(2,31);function encode($r,pr,Mr){pr=pr||[],Mr=Mr||0;for(var Nr=Mr;$r>=INT;)pr[Mr++]=$r&255|MSB,$r/=128;for(;$r&MSBALL;)pr[Mr++]=$r&255|MSB,$r>>>=7;return pr[Mr]=$r|0,encode.bytes=Mr-Nr+1,pr}var decode=read,MSB$1=128,REST$1=127;function read($r,Nr){var Mr=0,Nr=Nr||0,Dr=0,Br=Nr,Lr,jr=$r.length;do{if(Br>=jr)throw read.bytes=0,new RangeError("Could not decode varint");Lr=$r[Br++],Mr+=Dr<28?(Lr&REST$1)<<Dr:(Lr&REST$1)*Math.pow(2,Dr),Dr+=7}while(Lr>=MSB$1);return read.bytes=Br-Nr,Mr}var N1=Math.pow(2,7),N2=Math.pow(2,14),N3=Math.pow(2,21),N4=Math.pow(2,28),N5=Math.pow(2,35),N6=Math.pow(2,42),N7=Math.pow(2,49),N8=Math.pow(2,56),N9=Math.pow(2,63),length=function($r){return $r<N1?1:$r<N2?2:$r<N3?3:$r<N4?4:$r<N5?5:$r<N6?6:$r<N7?7:$r<N8?8:$r<N9?9:10},varint={encode:encode_1,decode,encodingLength:length},_brrp_varint=varint,varint_default=_brrp_varint,decode2=($r,pr=0)=>[varint_default.decode($r,pr),varint_default.decode.bytes],encodeTo=($r,pr,Mr=0)=>(varint_default.encode($r,pr,Mr),pr),encodingLength=$r=>varint_default.encodingLength($r),create=($r,pr)=>{const Mr=pr.byteLength,Nr=encodingLength($r),Dr=Nr+encodingLength(Mr),Br=new Uint8Array(Dr+Mr);return encodeTo($r,Br,0),encodeTo(Mr,Br,Nr),Br.set(pr,Dr),new Digest($r,Mr,pr,Br)},decode3=$r=>{const pr=coerce($r),[Mr,Nr]=decode2(pr),[Dr,Br]=decode2(pr.subarray(Nr)),Lr=pr.subarray(Nr+Br);if(Lr.byteLength!==Dr)throw new Error("Incorrect length");return new Digest(Mr,Dr,Lr,pr)},equals2=($r,pr)=>{if($r===pr)return!0;{const Mr=pr;return $r.code===Mr.code&&$r.size===Mr.size&&Mr.bytes instanceof Uint8Array&&equals($r.bytes,Mr.bytes)}},Digest=class{constructor($r,pr,Mr,Nr){this.code=$r,this.size=pr,this.digest=Mr,this.bytes=Nr}};function base($r,pr){if($r.length>=255)throw new TypeError("Alphabet too long");for(var Mr=new Uint8Array(256),Nr=0;Nr<Mr.length;Nr++)Mr[Nr]=255;for(var Dr=0;Dr<$r.length;Dr++){var Br=$r.charAt(Dr),Lr=Br.charCodeAt(0);if(Mr[Lr]!==255)throw new TypeError(Br+" is ambiguous");Mr[Lr]=Dr}var jr=$r.length,Ur=$r.charAt(0),Gr=Math.log(jr)/Math.log(256),Yr=Math.log(256)/Math.log(jr);function Qr(eo){if(eo instanceof Uint8Array||(ArrayBuffer.isView(eo)?eo=new Uint8Array(eo.buffer,eo.byteOffset,eo.byteLength):Array.isArray(eo)&&(eo=Uint8Array.from(eo))),!(eo instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(eo.length===0)return"";for(var _i=0,va=0,io=0,no=eo.length;io!==no&&eo[io]===0;)io++,_i++;for(var so=(no-io)*Yr+1>>>0,ao=new Uint8Array(so);io!==no;){for(var fo=eo[io],lo=0,oo=so-1;(fo!==0||lo<va)&&oo!==-1;oo--,lo++)fo+=256*ao[oo]>>>0,ao[oo]=fo%jr>>>0,fo=fo/jr>>>0;if(fo!==0)throw new Error("Non-zero carry");va=lo,io++}for(var po=so-va;po!==so&&ao[po]===0;)po++;for(var mo=Ur.repeat(_i);po<so;++po)mo+=$r.charAt(ao[po]);return mo}function Wn(eo){if(typeof eo!="string")throw new TypeError("Expected String");if(eo.length===0)return new Uint8Array;var _i=0;if(eo[_i]!==" "){for(var va=0,io=0;eo[_i]===Ur;)va++,_i++;for(var no=(eo.length-_i)*Gr+1>>>0,so=new Uint8Array(no);eo[_i];){var ao=Mr[eo.charCodeAt(_i)];if(ao===255)return;for(var fo=0,lo=no-1;(ao!==0||fo<io)&&lo!==-1;lo--,fo++)ao+=jr*so[lo]>>>0,so[lo]=ao%256>>>0,ao=ao/256>>>0;if(ao!==0)throw new Error("Non-zero carry");io=fo,_i++}if(eo[_i]!==" "){for(var oo=no-io;oo!==no&&so[oo]===0;)oo++;for(var po=new Uint8Array(va+(no-oo)),mo=va;oo!==no;)po[mo++]=so[oo++];return po}}}function ga(eo){var _i=Wn(eo);if(_i)return _i;throw new Error(`Non-${pr} character`)}return{encode:Qr,decodeUnsafe:Wn,decode:ga}}var src=base,_brrp__multiformats_scope_baseX=src,base_x_default=_brrp__multiformats_scope_baseX,Encoder=class{constructor($r,pr,Mr){this.name=$r,this.prefix=pr,this.baseEncode=Mr}encode($r){if($r instanceof Uint8Array)return`${this.prefix}${this.baseEncode($r)}`;throw Error("Unknown type, must be binary type")}},Decoder=class{constructor($r,pr,Mr){if(this.name=$r,this.prefix=pr,pr.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=pr.codePointAt(0),this.baseDecode=Mr}decode($r){if(typeof $r=="string"){if($r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify($r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode($r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or($r){return or(this,$r)}},ComposedDecoder=class{constructor($r){this.decoders=$r}or($r){return or(this,$r)}decode($r){const pr=$r[0],Mr=this.decoders[pr];if(Mr)return Mr.decode($r);throw RangeError(`Unable to decode multibase string ${JSON.stringify($r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},or=($r,pr)=>new ComposedDecoder({...$r.decoders||{[$r.prefix]:$r},...pr.decoders||{[pr.prefix]:pr}}),Codec=class{constructor($r,pr,Mr,Nr){this.name=$r,this.prefix=pr,this.baseEncode=Mr,this.baseDecode=Nr,this.encoder=new Encoder($r,pr,Mr),this.decoder=new Decoder($r,pr,Nr)}encode($r){return this.encoder.encode($r)}decode($r){return this.decoder.decode($r)}},from=({name:$r,prefix:pr,encode:Mr,decode:Nr})=>new Codec($r,pr,Mr,Nr),baseX=({prefix:$r,name:pr,alphabet:Mr})=>{const{encode:Nr,decode:Dr}=base_x_default(Mr,pr);return from({prefix:$r,name:pr,encode:Nr,decode:Br=>coerce(Dr(Br))})},decode4=($r,pr,Mr,Nr)=>{const Dr={};for(let Yr=0;Yr<pr.length;++Yr)Dr[pr[Yr]]=Yr;let Br=$r.length;for(;$r[Br-1]==="=";)--Br;const Lr=new Uint8Array(Br*Mr/8|0);let jr=0,Ur=0,Gr=0;for(let Yr=0;Yr<Br;++Yr){const Qr=Dr[$r[Yr]];if(Qr===void 0)throw new SyntaxError(`Non-${Nr} character`);Ur=Ur<<Mr|Qr,jr+=Mr,jr>=8&&(jr-=8,Lr[Gr++]=255&Ur>>jr)}if(jr>=Mr||255&Ur<<8-jr)throw new SyntaxError("Unexpected end of data");return Lr},encode2=($r,pr,Mr)=>{const Nr=pr[pr.length-1]==="=",Dr=(1<<Mr)-1;let Br="",Lr=0,jr=0;for(let Ur=0;Ur<$r.length;++Ur)for(jr=jr<<8|$r[Ur],Lr+=8;Lr>Mr;)Lr-=Mr,Br+=pr[Dr&jr>>Lr];if(Lr&&(Br+=pr[Dr&jr<<Mr-Lr]),Nr)for(;Br.length*Mr&7;)Br+="=";return Br},rfc4648=({name:$r,prefix:pr,bitsPerChar:Mr,alphabet:Nr})=>from({prefix:pr,name:$r,encode(Dr){return encode2(Dr,Nr,Mr)},decode(Dr){return decode4(Dr,Nr,Mr,$r)}}),base58btc=baseX({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"});baseX({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var base32=rfc4648({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5});rfc4648({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),rfc4648({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),rfc4648({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),rfc4648({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),rfc4648({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),rfc4648({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),rfc4648({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),rfc4648({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var format=($r,pr)=>{const{bytes:Mr,version:Nr}=$r;switch(Nr){case 0:return toStringV0(Mr,baseCache($r),pr||base58btc.encoder);default:return toStringV1(Mr,baseCache($r),pr||base32.encoder)}},cache=new WeakMap,baseCache=$r=>{const pr=cache.get($r);if(pr==null){const Mr=new Map;return cache.set($r,Mr),Mr}return pr},CID=class n0{constructor(pr,Mr,Nr,Dr){this.code=Mr,this.version=pr,this.multihash=Nr,this.bytes=Dr,this["/"]=Dr}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{const{code:pr,multihash:Mr}=this;if(pr!==DAG_PB_CODE)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(Mr.code!==SHA_256_CODE)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return n0.createV0(Mr)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{const{code:pr,digest:Mr}=this.multihash,Nr=create(pr,Mr);return n0.createV1(this.code,Nr)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(pr){return n0.equals(this,pr)}static equals(pr,Mr){const Nr=Mr;return Nr&&pr.code===Nr.code&&pr.version===Nr.version&&equals2(pr.multihash,Nr.multihash)}toString(pr){return format(this,pr)}toJSON(){return{"/":format(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(pr){if(pr==null)return null;const Mr=pr;if(Mr instanceof n0)return Mr;if(Mr["/"]!=null&&Mr["/"]===Mr.bytes||Mr.asCID===Mr){const{version:Nr,code:Dr,multihash:Br,bytes:Lr}=Mr;return new n0(Nr,Dr,Br,Lr||encodeCID(Nr,Dr,Br.bytes))}else if(Mr[cidSymbol]===!0){const{version:Nr,multihash:Dr,code:Br}=Mr,Lr=decode3(Dr);return n0.create(Nr,Br,Lr)}else return null}static create(pr,Mr,Nr){if(typeof Mr!="number")throw new Error("String codecs are no longer supported");if(!(Nr.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(pr){case 0:{if(Mr!==DAG_PB_CODE)throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE}) block encoding`);return new n0(pr,Mr,Nr,Nr.bytes)}case 1:{const Dr=encodeCID(pr,Mr,Nr.bytes);return new n0(pr,Mr,Nr,Dr)}default:throw new Error("Invalid version")}}static createV0(pr){return n0.create(0,DAG_PB_CODE,pr)}static createV1(pr,Mr){return n0.create(1,pr,Mr)}static decode(pr){const[Mr,Nr]=n0.decodeFirst(pr);if(Nr.length)throw new Error("Incorrect length");return Mr}static decodeFirst(pr){const Mr=n0.inspectBytes(pr),Nr=Mr.size-Mr.multihashSize,Dr=coerce(pr.subarray(Nr,Nr+Mr.multihashSize));if(Dr.byteLength!==Mr.multihashSize)throw new Error("Incorrect length");const Br=Dr.subarray(Mr.multihashSize-Mr.digestSize),Lr=new Digest(Mr.multihashCode,Mr.digestSize,Br,Dr);return[Mr.version===0?n0.createV0(Lr):n0.createV1(Mr.codec,Lr),pr.subarray(Mr.size)]}static inspectBytes(pr){let Mr=0;const Nr=()=>{const[Qr,Wn]=decode2(pr.subarray(Mr));return Mr+=Wn,Qr};let Dr=Nr(),Br=DAG_PB_CODE;if(Dr===18?(Dr=0,Mr=0):Br=Nr(),Dr!==0&&Dr!==1)throw new RangeError(`Invalid CID version ${Dr}`);const Lr=Mr,jr=Nr(),Ur=Nr(),Gr=Mr+Ur,Yr=Gr-Lr;return{version:Dr,codec:Br,multihashCode:jr,digestSize:Ur,multihashSize:Yr,size:Gr}}static parse(pr,Mr){const[Nr,Dr]=parseCIDtoBytes(pr,Mr),Br=n0.decode(Dr);if(Br.version===0&&pr[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return baseCache(Br).set(Nr,pr),Br}},parseCIDtoBytes=($r,pr)=>{switch($r[0]){case"Q":{const Mr=pr||base58btc;return[base58btc.prefix,Mr.decode(`${base58btc.prefix}${$r}`)]}case base58btc.prefix:{const Mr=pr||base58btc;return[base58btc.prefix,Mr.decode($r)]}case base32.prefix:{const Mr=pr||base32;return[base32.prefix,Mr.decode($r)]}default:{if(pr==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[$r[0],pr.decode($r)]}}},toStringV0=($r,pr,Mr)=>{const{prefix:Nr}=Mr;if(Nr!==base58btc.prefix)throw Error(`Cannot string encode V0 in ${Mr.name} encoding`);const Dr=pr.get(Nr);if(Dr==null){const Br=Mr.encode($r).slice(1);return pr.set(Nr,Br),Br}else return Dr},toStringV1=($r,pr,Mr)=>{const{prefix:Nr}=Mr,Dr=pr.get(Nr);if(Dr==null){const Br=Mr.encode($r);return pr.set(Nr,Br),Br}else return Dr},DAG_PB_CODE=112,SHA_256_CODE=18,encodeCID=($r,pr,Mr)=>{const Nr=encodingLength($r),Dr=Nr+encodingLength(pr),Br=new Uint8Array(Dr+Mr.byteLength);return encodeTo($r,Br,0),encodeTo(pr,Br,Nr),Br.set(Mr,Dr),Br},cidSymbol=Symbol.for("@ipld/js-cid/CID");__toESM(require_err_code(),1);function isAsyncIterable($r){return $r[Symbol.asyncIterator]!=null}function batch($r,pr=1){return pr=Number(pr),isAsyncIterable($r)?async function*(){let Mr=[];if(pr<1&&(pr=1),pr!==Math.round(pr))throw new Error("Batch size must be an integer");for await(const Nr of $r)for(Mr.push(Nr);Mr.length>=pr;)yield Mr.slice(0,pr),Mr=Mr.slice(pr);for(;Mr.length>0;)yield Mr.slice(0,pr),Mr=Mr.slice(pr)}():function*(){let Mr=[];if(pr<1&&(pr=1),pr!==Math.round(pr))throw new Error("Batch size must be an integer");for(const Nr of $r)for(Mr.push(Nr);Mr.length>=pr;)yield Mr.slice(0,pr),Mr=Mr.slice(pr);for(;Mr.length>0;)yield Mr.slice(0,pr),Mr=Mr.slice(pr)}()}var src_default=batch;async function*parallelBatch($r,pr=1){for await(const Mr of src_default($r,pr)){const Nr=Mr.map(async Dr=>Dr().then(Br=>({ok:!0,value:Br}),Br=>({ok:!1,err:Br})));for(let Dr=0;Dr<Nr.length;Dr++){const Br=await Nr[Dr];if(Br.ok)yield Br.value;else throw Br.err}}}function asUint8Array($r){return globalThis.Buffer!=null?new Uint8Array($r.buffer,$r.byteOffset,$r.byteLength):$r}function alloc($r=0){var pr;return((pr=globalThis.Buffer)==null?void 0:pr.alloc)!=null?asUint8Array(globalThis.Buffer.alloc($r)):new Uint8Array($r)}function allocUnsafe($r=0){var pr;return((pr=globalThis.Buffer)==null?void 0:pr.allocUnsafe)!=null?asUint8Array(globalThis.Buffer.allocUnsafe($r)):new Uint8Array($r)}function concat($r,pr){pr==null&&(pr=$r.reduce((Dr,Br)=>Dr+Br.length,0));const Mr=allocUnsafe(pr);let Nr=0;for(const Dr of $r)Mr.set(Dr,Nr),Nr+=Dr.length;return asUint8Array(Mr)}function equals3($r,pr){if($r===pr)return!0;if($r.byteLength!==pr.byteLength)return!1;for(let Mr=0;Mr<$r.byteLength;Mr++)if($r[Mr]!==pr[Mr])return!1;return!0}var symbol=Symbol.for("@achingbrain/uint8arraylist");function findBufAndOffset($r,pr){if(pr==null||pr<0)throw new RangeError("index is out of bounds");let Mr=0;for(const Nr of $r){const Dr=Mr+Nr.byteLength;if(pr<Dr)return{buf:Nr,index:pr-Mr};Mr=Dr}throw new RangeError("index is out of bounds")}function isUint8ArrayList($r){return!!($r!=null&&$r[symbol])}var Uint8ArrayList=class hw{constructor(...pr){Object.defineProperty(this,symbol,{value:!0}),this.bufs=[],this.length=0,pr.length>0&&this.appendAll(pr)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...pr){this.appendAll(pr)}appendAll(pr){let Mr=0;for(const Nr of pr)if(Nr instanceof Uint8Array)Mr+=Nr.byteLength,this.bufs.push(Nr);else if(isUint8ArrayList(Nr))Mr+=Nr.byteLength,this.bufs.push(...Nr.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=Mr}prepend(...pr){this.prependAll(pr)}prependAll(pr){let Mr=0;for(const Nr of pr.reverse())if(Nr instanceof Uint8Array)Mr+=Nr.byteLength,this.bufs.unshift(Nr);else if(isUint8ArrayList(Nr))Mr+=Nr.byteLength,this.bufs.unshift(...Nr.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=Mr}get(pr){const Mr=findBufAndOffset(this.bufs,pr);return Mr.buf[Mr.index]}set(pr,Mr){const Nr=findBufAndOffset(this.bufs,pr);Nr.buf[Nr.index]=Mr}write(pr,Mr=0){if(pr instanceof Uint8Array)for(let Nr=0;Nr<pr.length;Nr++)this.set(Mr+Nr,pr[Nr]);else if(isUint8ArrayList(pr))for(let Nr=0;Nr<pr.length;Nr++)this.set(Mr+Nr,pr.get(Nr));else throw new Error("Could not write value, must be an Uint8Array or a Uint8ArrayList")}consume(pr){if(pr=Math.trunc(pr),!(Number.isNaN(pr)||pr<=0)){if(pr===this.byteLength){this.bufs=[],this.length=0;return}for(;this.bufs.length>0;)if(pr>=this.bufs[0].byteLength)pr-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(pr),this.length-=pr;break}}}slice(pr,Mr){const{bufs:Nr,length:Dr}=this._subList(pr,Mr);return concat(Nr,Dr)}subarray(pr,Mr){const{bufs:Nr,length:Dr}=this._subList(pr,Mr);return Nr.length===1?Nr[0]:concat(Nr,Dr)}sublist(pr,Mr){const{bufs:Nr,length:Dr}=this._subList(pr,Mr),Br=new hw;return Br.length=Dr,Br.bufs=Nr,Br}_subList(pr,Mr){if(pr=pr??0,Mr=Mr??this.length,pr<0&&(pr=this.length+pr),Mr<0&&(Mr=this.length+Mr),pr<0||Mr>this.length)throw new RangeError("index is out of bounds");if(pr===Mr)return{bufs:[],length:0};if(pr===0&&Mr===this.length)return{bufs:[...this.bufs],length:this.length};const Nr=[];let Dr=0;for(let Br=0;Br<this.bufs.length;Br++){const Lr=this.bufs[Br],jr=Dr,Ur=jr+Lr.byteLength;if(Dr=Ur,pr>=Ur)continue;const Gr=pr>=jr&&pr<Ur,Yr=Mr>jr&&Mr<=Ur;if(Gr&&Yr){if(pr===jr&&Mr===Ur){Nr.push(Lr);break}const Qr=pr-jr;Nr.push(Lr.subarray(Qr,Qr+(Mr-pr)));break}if(Gr){if(pr===0){Nr.push(Lr);continue}Nr.push(Lr.subarray(pr-jr));continue}if(Yr){if(Mr===Ur){Nr.push(Lr);break}Nr.push(Lr.subarray(0,Mr-jr));break}Nr.push(Lr)}return{bufs:Nr,length:Mr-pr}}indexOf(pr,Mr=0){if(!isUint8ArrayList(pr)&&!(pr instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');const Nr=pr instanceof Uint8Array?pr:pr.subarray();if(Mr=Number(Mr??0),isNaN(Mr)&&(Mr=0),Mr<0&&(Mr=this.length+Mr),Mr<0&&(Mr=0),pr.length===0)return Mr>this.length?this.length:Mr;const Dr=Nr.byteLength;if(Dr===0)throw new TypeError("search must be at least 1 byte long");const Br=256,Lr=new Int32Array(Br);for(let Qr=0;Qr<Br;Qr++)Lr[Qr]=-1;for(let Qr=0;Qr<Dr;Qr++)Lr[Nr[Qr]]=Qr;const jr=Lr,Ur=this.byteLength-Nr.byteLength,Gr=Nr.byteLength-1;let Yr;for(let Qr=Mr;Qr<=Ur;Qr+=Yr){Yr=0;for(let Wn=Gr;Wn>=0;Wn--){const ga=this.get(Qr+Wn);if(Nr[Wn]!==ga){Yr=Math.max(1,Wn-jr[ga]);break}}if(Yr===0)return Qr}return-1}getInt8(pr){const Mr=this.subarray(pr,pr+1);return new DataView(Mr.buffer,Mr.byteOffset,Mr.byteLength).getInt8(0)}setInt8(pr,Mr){const Nr=allocUnsafe(1);new DataView(Nr.buffer,Nr.byteOffset,Nr.byteLength).setInt8(0,Mr),this.write(Nr,pr)}getInt16(pr,Mr){const Nr=this.subarray(pr,pr+2);return new DataView(Nr.buffer,Nr.byteOffset,Nr.byteLength).getInt16(0,Mr)}setInt16(pr,Mr,Nr){const Dr=alloc(2);new DataView(Dr.buffer,Dr.byteOffset,Dr.byteLength).setInt16(0,Mr,Nr),this.write(Dr,pr)}getInt32(pr,Mr){const Nr=this.subarray(pr,pr+4);return new DataView(Nr.buffer,Nr.byteOffset,Nr.byteLength).getInt32(0,Mr)}setInt32(pr,Mr,Nr){const Dr=alloc(4);new DataView(Dr.buffer,Dr.byteOffset,Dr.byteLength).setInt32(0,Mr,Nr),this.write(Dr,pr)}getBigInt64(pr,Mr){const Nr=this.subarray(pr,pr+8);return new DataView(Nr.buffer,Nr.byteOffset,Nr.byteLength).getBigInt64(0,Mr)}setBigInt64(pr,Mr,Nr){const Dr=alloc(8);new DataView(Dr.buffer,Dr.byteOffset,Dr.byteLength).setBigInt64(0,Mr,Nr),this.write(Dr,pr)}getUint8(pr){const Mr=this.subarray(pr,pr+1);return new DataView(Mr.buffer,Mr.byteOffset,Mr.byteLength).getUint8(0)}setUint8(pr,Mr){const Nr=allocUnsafe(1);new DataView(Nr.buffer,Nr.byteOffset,Nr.byteLength).setUint8(0,Mr),this.write(Nr,pr)}getUint16(pr,Mr){const Nr=this.subarray(pr,pr+2);return new DataView(Nr.buffer,Nr.byteOffset,Nr.byteLength).getUint16(0,Mr)}setUint16(pr,Mr,Nr){const Dr=alloc(2);new DataView(Dr.buffer,Dr.byteOffset,Dr.byteLength).setUint16(0,Mr,Nr),this.write(Dr,pr)}getUint32(pr,Mr){const Nr=this.subarray(pr,pr+4);return new DataView(Nr.buffer,Nr.byteOffset,Nr.byteLength).getUint32(0,Mr)}setUint32(pr,Mr,Nr){const Dr=alloc(4);new DataView(Dr.buffer,Dr.byteOffset,Dr.byteLength).setUint32(0,Mr,Nr),this.write(Dr,pr)}getBigUint64(pr,Mr){const Nr=this.subarray(pr,pr+8);return new DataView(Nr.buffer,Nr.byteOffset,Nr.byteLength).getBigUint64(0,Mr)}setBigUint64(pr,Mr,Nr){const Dr=alloc(8);new DataView(Dr.buffer,Dr.byteOffset,Dr.byteLength).setBigUint64(0,Mr,Nr),this.write(Dr,pr)}getFloat32(pr,Mr){const Nr=this.subarray(pr,pr+4);return new DataView(Nr.buffer,Nr.byteOffset,Nr.byteLength).getFloat32(0,Mr)}setFloat32(pr,Mr,Nr){const Dr=alloc(4);new DataView(Dr.buffer,Dr.byteOffset,Dr.byteLength).setFloat32(0,Mr,Nr),this.write(Dr,pr)}getFloat64(pr,Mr){const Nr=this.subarray(pr,pr+8);return new DataView(Nr.buffer,Nr.byteOffset,Nr.byteLength).getFloat64(0,Mr)}setFloat64(pr,Mr,Nr){const Dr=alloc(8);new DataView(Dr.buffer,Dr.byteOffset,Dr.byteLength).setFloat64(0,Mr,Nr),this.write(Dr,pr)}equals(pr){if(pr==null||!(pr instanceof hw)||pr.bufs.length!==this.bufs.length)return!1;for(let Mr=0;Mr<this.bufs.length;Mr++)if(!equals3(this.bufs[Mr],pr.bufs[Mr]))return!1;return!0}static fromUint8Arrays(pr,Mr){const Nr=new hw;return Nr.bufs=pr,Mr==null&&(Mr=pr.reduce((Dr,Br)=>Dr+Br.byteLength,0)),Nr.length=Mr,Nr}},DEFAULT_CHUNK_SIZE=262144,fixedSize=($r={})=>{const pr=$r.chunkSize??DEFAULT_CHUNK_SIZE;return async function*(Nr){let Dr=new Uint8ArrayList,Br=0,Lr=!1;for await(const jr of Nr)for(Dr.append(jr),Br+=jr.length;Br>=pr;)if(yield Dr.slice(0,pr),Lr=!0,pr===Dr.length)Dr=new Uint8ArrayList,Br=0;else{const Ur=new Uint8ArrayList;Ur.append(Dr.sublist(pr)),Dr=Ur,Br-=pr}(!Lr||Br>0)&&(yield Dr.subarray(0,Br))}},src_exports={};__export(src_exports,{code:()=>code,createLink:()=>createLink,createNode:()=>createNode,decode:()=>decode5,encode:()=>encode3,name:()=>name,prepare:()=>prepare,validate:()=>validate});var textDecoder=new TextDecoder;function decodeVarint($r,pr){let Mr=0;for(let Nr=0;;Nr+=7){if(Nr>=64)throw new Error("protobuf: varint overflow");if(pr>=$r.length)throw new Error("protobuf: unexpected end of data");const Dr=$r[pr++];if(Mr+=Nr<28?(Dr&127)<<Nr:(Dr&127)*2**Nr,Dr<128)break}return[Mr,pr]}function decodeBytes($r,pr){let Mr;[Mr,pr]=decodeVarint($r,pr);const Nr=pr+Mr;if(Mr<0||Nr<0)throw new Error("protobuf: invalid length");if(Nr>$r.length)throw new Error("protobuf: unexpected end of data");return[$r.subarray(pr,Nr),Nr]}function decodeKey($r,pr){let Mr;return[Mr,pr]=decodeVarint($r,pr),[Mr&7,Mr>>3,pr]}function decodeLink($r){const pr={},Mr=$r.length;let Nr=0;for(;Nr<Mr;){let Dr,Br;if([Dr,Br,Nr]=decodeKey($r,Nr),Br===1){if(pr.Hash)throw new Error("protobuf: (PBLink) duplicate Hash section");if(Dr!==2)throw new Error(`protobuf: (PBLink) wrong wireType (${Dr}) for Hash`);if(pr.Name!==void 0)throw new Error("protobuf: (PBLink) invalid order, found Name before Hash");if(pr.Tsize!==void 0)throw new Error("protobuf: (PBLink) invalid order, found Tsize before Hash");[pr.Hash,Nr]=decodeBytes($r,Nr)}else if(Br===2){if(pr.Name!==void 0)throw new Error("protobuf: (PBLink) duplicate Name section");if(Dr!==2)throw new Error(`protobuf: (PBLink) wrong wireType (${Dr}) for Name`);if(pr.Tsize!==void 0)throw new Error("protobuf: (PBLink) invalid order, found Tsize before Name");let Lr;[Lr,Nr]=decodeBytes($r,Nr),pr.Name=textDecoder.decode(Lr)}else if(Br===3){if(pr.Tsize!==void 0)throw new Error("protobuf: (PBLink) duplicate Tsize section");if(Dr!==0)throw new Error(`protobuf: (PBLink) wrong wireType (${Dr}) for Tsize`);[pr.Tsize,Nr]=decodeVarint($r,Nr)}else throw new Error(`protobuf: (PBLink) invalid fieldNumber, expected 1, 2 or 3, got ${Br}`)}if(Nr>Mr)throw new Error("protobuf: (PBLink) unexpected end of data");return pr}function decodeNode($r){const pr=$r.length;let Mr=0,Nr,Dr=!1,Br;for(;Mr<pr;){let jr,Ur;if([jr,Ur,Mr]=decodeKey($r,Mr),jr!==2)throw new Error(`protobuf: (PBNode) invalid wireType, expected 2, got ${jr}`);if(Ur===1){if(Br)throw new Error("protobuf: (PBNode) duplicate Data section");[Br,Mr]=decodeBytes($r,Mr),Nr&&(Dr=!0)}else if(Ur===2){if(Dr)throw new Error("protobuf: (PBNode) duplicate Links section");Nr||(Nr=[]);let Gr;[Gr,Mr]=decodeBytes($r,Mr),Nr.push(decodeLink(Gr))}else throw new Error(`protobuf: (PBNode) invalid fieldNumber, expected 1 or 2, got ${Ur}`)}if(Mr>pr)throw new Error("protobuf: (PBNode) unexpected end of data");const Lr={};return Br&&(Lr.Data=Br),Lr.Links=Nr||[],Lr}var textEncoder=new TextEncoder,maxInt32=2**32,maxUInt32=2**31;function encodeLink($r,pr){let Mr=pr.length;if(typeof $r.Tsize=="number"){if($r.Tsize<0)throw new Error("Tsize cannot be negative");if(!Number.isSafeInteger($r.Tsize))throw new Error("Tsize too large for encoding");Mr=encodeVarint(pr,Mr,$r.Tsize)-1,pr[Mr]=24}if(typeof $r.Name=="string"){const Nr=textEncoder.encode($r.Name);Mr-=Nr.length,pr.set(Nr,Mr),Mr=encodeVarint(pr,Mr,Nr.length)-1,pr[Mr]=18}return $r.Hash&&(Mr-=$r.Hash.length,pr.set($r.Hash,Mr),Mr=encodeVarint(pr,Mr,$r.Hash.length)-1,pr[Mr]=10),pr.length-Mr}function encodeNode($r){const pr=sizeNode($r),Mr=new Uint8Array(pr);let Nr=pr;if($r.Data&&(Nr-=$r.Data.length,Mr.set($r.Data,Nr),Nr=encodeVarint(Mr,Nr,$r.Data.length)-1,Mr[Nr]=10),$r.Links)for(let Dr=$r.Links.length-1;Dr>=0;Dr--){const Br=encodeLink($r.Links[Dr],Mr.subarray(0,Nr));Nr-=Br,Nr=encodeVarint(Mr,Nr,Br)-1,Mr[Nr]=18}return Mr}function sizeLink($r){let pr=0;if($r.Hash){const Mr=$r.Hash.length;pr+=1+Mr+sov(Mr)}if(typeof $r.Name=="string"){const Mr=textEncoder.encode($r.Name).length;pr+=1+Mr+sov(Mr)}return typeof $r.Tsize=="number"&&(pr+=1+sov($r.Tsize)),pr}function sizeNode($r){let pr=0;if($r.Data){const Mr=$r.Data.length;pr+=1+Mr+sov(Mr)}if($r.Links)for(const Mr of $r.Links){const Nr=sizeLink(Mr);pr+=1+Nr+sov(Nr)}return pr}function encodeVarint($r,pr,Mr){pr-=sov(Mr);const Nr=pr;for(;Mr>=maxUInt32;)$r[pr++]=Mr&127|128,Mr/=128;for(;Mr>=128;)$r[pr++]=Mr&127|128,Mr>>>=7;return $r[pr]=Mr,Nr}function sov($r){return $r%2===0&&$r++,Math.floor((len64($r)+6)/7)}function len64($r){let pr=0;return $r>=maxInt32&&($r=Math.floor($r/maxInt32),pr=32),$r>=65536&&($r>>>=16,pr+=16),$r>=256&&($r>>>=8,pr+=8),pr+len8tab[$r]}var len8tab=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8],pbNodeProperties=["Data","Links"],pbLinkProperties=["Hash","Name","Tsize"],textEncoder2=new TextEncoder;function linkComparator($r,pr){if($r===pr)return 0;const Mr=$r.Name?textEncoder2.encode($r.Name):[],Nr=pr.Name?textEncoder2.encode(pr.Name):[];let Dr=Mr.length,Br=Nr.length;for(let Lr=0,jr=Math.min(Dr,Br);Lr<jr;++Lr)if(Mr[Lr]!==Nr[Lr]){Dr=Mr[Lr],Br=Nr[Lr];break}return Dr<Br?-1:Br<Dr?1:0}function hasOnlyProperties($r,pr){return!Object.keys($r).some(Mr=>!pr.includes(Mr))}function asLink($r){if(typeof $r.asCID=="object"){const Mr=CID.asCID($r);if(!Mr)throw new TypeError("Invalid DAG-PB form");return{Hash:Mr}}if(typeof $r!="object"||Array.isArray($r))throw new TypeError("Invalid DAG-PB form");const pr={};if($r.Hash){let Mr=CID.asCID($r.Hash);try{Mr||(typeof $r.Hash=="string"?Mr=CID.parse($r.Hash):$r.Hash instanceof Uint8Array&&(Mr=CID.decode($r.Hash)))}catch(Nr){throw new TypeError(`Invalid DAG-PB form: ${Nr.message}`)}Mr&&(pr.Hash=Mr)}if(!pr.Hash)throw new TypeError("Invalid DAG-PB form");return typeof $r.Name=="string"&&(pr.Name=$r.Name),typeof $r.Tsize=="number"&&(pr.Tsize=$r.Tsize),pr}function prepare($r){if(($r instanceof Uint8Array||typeof $r=="string")&&($r={Data:$r}),typeof $r!="object"||Array.isArray($r))throw new TypeError("Invalid DAG-PB form");const pr={};if($r.Data!==void 0)if(typeof $r.Data=="string")pr.Data=textEncoder2.encode($r.Data);else if($r.Data instanceof Uint8Array)pr.Data=$r.Data;else throw new TypeError("Invalid DAG-PB form");if($r.Links!==void 0)if(Array.isArray($r.Links))pr.Links=$r.Links.map(asLink),pr.Links.sort(linkComparator);else throw new TypeError("Invalid DAG-PB form");else pr.Links=[];return pr}function validate($r){if(!$r||typeof $r!="object"||Array.isArray($r)||$r instanceof Uint8Array||$r["/"]&&$r["/"]===$r.bytes)throw new TypeError("Invalid DAG-PB form");if(!hasOnlyProperties($r,pbNodeProperties))throw new TypeError("Invalid DAG-PB form (extraneous properties)");if($r.Data!==void 0&&!($r.Data instanceof Uint8Array))throw new TypeError("Invalid DAG-PB form (Data must be bytes)");if(!Array.isArray($r.Links))throw new TypeError("Invalid DAG-PB form (Links must be a list)");for(let pr=0;pr<$r.Links.length;pr++){const Mr=$r.Links[pr];if(!Mr||typeof Mr!="object"||Array.isArray(Mr)||Mr instanceof Uint8Array||Mr["/"]&&Mr["/"]===Mr.bytes)throw new TypeError("Invalid DAG-PB form (bad link)");if(!hasOnlyProperties(Mr,pbLinkProperties))throw new TypeError("Invalid DAG-PB form (extraneous properties on link)");if(Mr.Hash===void 0)throw new TypeError("Invalid DAG-PB form (link must have a Hash)");if(Mr.Hash==null||!Mr.Hash["/"]||Mr.Hash["/"]!==Mr.Hash.bytes)throw new TypeError("Invalid DAG-PB form (link Hash must be a CID)");if(Mr.Name!==void 0&&typeof Mr.Name!="string")throw new TypeError("Invalid DAG-PB form (link Name must be a string)");if(Mr.Tsize!==void 0){if(typeof Mr.Tsize!="number"||Mr.Tsize%1!==0)throw new TypeError("Invalid DAG-PB form (link Tsize must be an integer)");if(Mr.Tsize<0)throw new TypeError("Invalid DAG-PB form (link Tsize cannot be negative)")}if(pr>0&&linkComparator(Mr,$r.Links[pr-1])===-1)throw new TypeError("Invalid DAG-PB form (links must be sorted by Name bytes)")}}function createNode($r,pr=[]){return prepare({Data:$r,Links:pr})}function createLink($r,pr,Mr){return asLink({Hash:Mr,Name:$r,Tsize:pr})}var name="dag-pb",code=112;function encode3($r){validate($r);const pr={};return $r.Links&&(pr.Links=$r.Links.map(Mr=>{const Nr={};return Mr.Hash&&(Nr.Hash=Mr.Hash.bytes),Mr.Name!==void 0&&(Nr.Name=Mr.Name),Mr.Tsize!==void 0&&(Nr.Tsize=Mr.Tsize),Nr})),$r.Data&&(pr.Data=$r.Data),encodeNode(pr)}function decode5($r){const pr=decodeNode($r),Mr={};return pr.Data&&(Mr.Data=pr.Data),pr.Links&&(Mr.Links=pr.Links.map(Nr=>{const Dr={};try{Dr.Hash=CID.decode(Nr.Hash)}catch{}if(!Dr.Hash)throw new Error("Invalid Hash field found in link, expected CID");return Nr.Name!==void 0&&(Dr.Name=Nr.Name),Nr.Tsize!==void 0&&(Dr.Tsize=Nr.Tsize),Dr})),Mr}var import_err_code=__toESM(require_err_code(),1),import_reader=__toESM(require_reader(),1),import_reader_buffer=__toESM(require_reader_buffer(),1),import_minimal=__toESM(require_minimal(),1),import_writer=__toESM(require_writer(),1),import_writer_buffer=__toESM(require_writer_buffer(),1);function configure(){import_minimal.default._configure(),import_reader.default._configure(import_reader_buffer.default),import_writer.default._configure(import_writer_buffer.default)}configure();var methods=["uint64","int64","sint64","fixed64","sfixed64"];function patchReader($r){for(const pr of methods){if($r[pr]==null)continue;const Mr=$r[pr];$r[pr]=function(){return BigInt(Mr.call(this).toString())}}return $r}function reader($r){return patchReader(new import_reader.default($r))}function patchWriter($r){for(const pr of methods){if($r[pr]==null)continue;const Mr=$r[pr];$r[pr]=function(Nr){return Mr.call(this,Nr.toString())}}return $r}function writer(){return patchWriter(import_writer.default.create())}function decodeMessage($r,pr){const Mr=reader($r instanceof Uint8Array?$r:$r.subarray());return pr.decode(Mr)}function encodeMessage($r,pr){const Mr=writer();return pr.encode($r,Mr,{lengthDelimited:!1}),Mr.finish()}var CODEC_TYPES;(function($r){$r[$r.VARINT=0]="VARINT",$r[$r.BIT64=1]="BIT64",$r[$r.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",$r[$r.START_GROUP=3]="START_GROUP",$r[$r.END_GROUP=4]="END_GROUP",$r[$r.BIT32=5]="BIT32"})(CODEC_TYPES||(CODEC_TYPES={}));function createCodec($r,pr,Mr,Nr){return{name:$r,type:pr,encode:Mr,decode:Nr}}function enumeration($r){function pr(Dr){if($r[Dr.toString()]==null)throw new Error("Invalid enum value");return $r[Dr]}const Mr=function(Br,Lr){const jr=pr(Br);Lr.int32(jr)},Nr=function(Br){const Lr=Br.int32();return pr(Lr)};return createCodec("enum",CODEC_TYPES.VARINT,Mr,Nr)}function message($r,pr){return createCodec("message",CODEC_TYPES.LENGTH_DELIMITED,$r,pr)}var Data;(function($r){(function(Nr){Nr.Raw="Raw",Nr.Directory="Directory",Nr.File="File",Nr.Metadata="Metadata",Nr.Symlink="Symlink",Nr.HAMTShard="HAMTShard"})($r.DataType||($r.DataType={}));let pr;(function(Nr){Nr[Nr.Raw=0]="Raw",Nr[Nr.Directory=1]="Directory",Nr[Nr.File=2]="File",Nr[Nr.Metadata=3]="Metadata",Nr[Nr.Symlink=4]="Symlink",Nr[Nr.HAMTShard=5]="HAMTShard"})(pr||(pr={})),function(Nr){Nr.codec=()=>enumeration(pr)}($r.DataType||($r.DataType={}));let Mr;$r.codec=()=>(Mr==null&&(Mr=message((Nr,Dr,Br={})=>{if(Br.lengthDelimited!==!1&&Dr.fork(),Nr.Type!=null&&(Dr.uint32(8),$r.DataType.codec().encode(Nr.Type,Dr)),Nr.Data!=null&&(Dr.uint32(18),Dr.bytes(Nr.Data)),Nr.filesize!=null&&(Dr.uint32(24),Dr.uint64(Nr.filesize)),Nr.blocksizes!=null)for(const Lr of Nr.blocksizes)Dr.uint32(32),Dr.uint64(Lr);Nr.hashType!=null&&(Dr.uint32(40),Dr.uint64(Nr.hashType)),Nr.fanout!=null&&(Dr.uint32(48),Dr.uint64(Nr.fanout)),Nr.mode!=null&&(Dr.uint32(56),Dr.uint32(Nr.mode)),Nr.mtime!=null&&(Dr.uint32(66),UnixTime.codec().encode(Nr.mtime,Dr)),Br.lengthDelimited!==!1&&Dr.ldelim()},(Nr,Dr)=>{const Br={blocksizes:[]},Lr=Dr==null?Nr.len:Nr.pos+Dr;for(;Nr.pos<Lr;){const jr=Nr.uint32();switch(jr>>>3){case 1:Br.Type=$r.DataType.codec().decode(Nr);break;case 2:Br.Data=Nr.bytes();break;case 3:Br.filesize=Nr.uint64();break;case 4:Br.blocksizes.push(Nr.uint64());break;case 5:Br.hashType=Nr.uint64();break;case 6:Br.fanout=Nr.uint64();break;case 7:Br.mode=Nr.uint32();break;case 8:Br.mtime=UnixTime.codec().decode(Nr,Nr.uint32());break;default:Nr.skipType(jr&7);break}}return Br})),Mr),$r.encode=Nr=>encodeMessage(Nr,$r.codec()),$r.decode=Nr=>decodeMessage(Nr,$r.codec())})(Data||(Data={}));var UnixTime;(function($r){let pr;$r.codec=()=>(pr==null&&(pr=message((Mr,Nr,Dr={})=>{Dr.lengthDelimited!==!1&&Nr.fork(),Mr.Seconds!=null&&(Nr.uint32(8),Nr.int64(Mr.Seconds)),Mr.FractionalNanoseconds!=null&&(Nr.uint32(21),Nr.fixed32(Mr.FractionalNanoseconds)),Dr.lengthDelimited!==!1&&Nr.ldelim()},(Mr,Nr)=>{const Dr={},Br=Nr==null?Mr.len:Mr.pos+Nr;for(;Mr.pos<Br;){const Lr=Mr.uint32();switch(Lr>>>3){case 1:Dr.Seconds=Mr.int64();break;case 2:Dr.FractionalNanoseconds=Mr.fixed32();break;default:Mr.skipType(Lr&7);break}}return Dr})),pr),$r.encode=Mr=>encodeMessage(Mr,$r.codec()),$r.decode=Mr=>decodeMessage(Mr,$r.codec())})(UnixTime||(UnixTime={}));var Metadata;(function($r){let pr;$r.codec=()=>(pr==null&&(pr=message((Mr,Nr,Dr={})=>{Dr.lengthDelimited!==!1&&Nr.fork(),Mr.MimeType!=null&&(Nr.uint32(10),Nr.string(Mr.MimeType)),Dr.lengthDelimited!==!1&&Nr.ldelim()},(Mr,Nr)=>{const Dr={},Br=Nr==null?Mr.len:Mr.pos+Nr;for(;Mr.pos<Br;){const Lr=Mr.uint32();switch(Lr>>>3){case 1:Dr.MimeType=Mr.string();break;default:Mr.skipType(Lr&7);break}}return Dr})),pr),$r.encode=Mr=>encodeMessage(Mr,$r.codec()),$r.decode=Mr=>decodeMessage(Mr,$r.codec())})(Metadata||(Metadata={}));var types={Raw:"raw",Directory:"directory",File:"file",Metadata:"metadata",Symlink:"symlink",HAMTShard:"hamt-sharded-directory"},dirTypes=["directory","hamt-sharded-directory"],DEFAULT_FILE_MODE=parseInt("0644",8),DEFAULT_DIRECTORY_MODE=parseInt("0755",8),UnixFS=class DE{constructor(pr={type:"file"}){Bu(this,"type");Bu(this,"data");Bu(this,"blockSizes");Bu(this,"hashType");Bu(this,"fanout");Bu(this,"mtime");Bu(this,"_mode");Bu(this,"_originalMode");const{type:Mr,data:Nr,blockSizes:Dr,hashType:Br,fanout:Lr,mtime:jr,mode:Ur}=pr;if(Mr!=null&&!Object.values(types).includes(Mr))throw(0,import_err_code.default)(new Error("Type: "+Mr+" is not valid"),"ERR_INVALID_TYPE");this.type=Mr??"file",this.data=Nr,this.hashType=Br,this.fanout=Lr,this.blockSizes=Dr??[],this._originalMode=0,this.mode=Ur,this.mtime=jr}static unmarshal(pr){const Mr=Data.decode(pr),Nr=new DE({type:types[Mr.Type!=null?Mr.Type.toString():"File"],data:Mr.Data,blockSizes:Mr.blocksizes,mode:Mr.mode,mtime:Mr.mtime!=null?{secs:Mr.mtime.Seconds??0n,nsecs:Mr.mtime.FractionalNanoseconds}:void 0});return Nr._originalMode=Mr.mode??0,Nr}set mode(pr){pr==null?this._mode=this.isDirectory()?DEFAULT_DIRECTORY_MODE:DEFAULT_FILE_MODE:this._mode=pr&4095}get mode(){return this._mode}isDirectory(){return dirTypes.includes(this.type)}addBlockSize(pr){this.blockSizes.push(pr)}removeBlockSize(pr){this.blockSizes.splice(pr,1)}fileSize(){if(this.isDirectory())return 0n;let pr=0n;return this.blockSizes.forEach(Mr=>{pr+=Mr}),this.data!=null&&(pr+=BigInt(this.data.length)),pr}marshal(){let pr;switch(this.type){case"raw":pr=Data.DataType.Raw;break;case"directory":pr=Data.DataType.Directory;break;case"file":pr=Data.DataType.File;break;case"metadata":pr=Data.DataType.Metadata;break;case"symlink":pr=Data.DataType.Symlink;break;case"hamt-sharded-directory":pr=Data.DataType.HAMTShard;break;default:throw(0,import_err_code.default)(new Error(`Type: ${pr} is not valid`),"ERR_INVALID_TYPE")}let Mr=this.data;(this.data==null||this.data.length===0)&&(Mr=void 0);let Nr;this.mode!=null&&(Nr=this._originalMode&4294963200|(this.mode??0),Nr===DEFAULT_FILE_MODE&&!this.isDirectory()&&(Nr=void 0),Nr===DEFAULT_DIRECTORY_MODE&&this.isDirectory()&&(Nr=void 0));let Dr;return this.mtime!=null&&(Dr={Seconds:this.mtime.secs,FractionalNanoseconds:this.mtime.nsecs}),Data.encode({Type:pr,Data:Mr,filesize:this.isDirectory()?void 0:this.fileSize(),blocksizes:this.blockSizes,hashType:this.hashType,fanout:this.fanout,mode:Nr,mtime:Dr})}},raw_exports={};__export(raw_exports,{code:()=>code2,decode:()=>decode6,encode:()=>encode4,name:()=>name2});var equals4=($r,pr)=>{if($r===pr)return!0;if($r.byteLength!==pr.byteLength)return!1;for(let Mr=0;Mr<$r.byteLength;Mr++)if($r[Mr]!==pr[Mr])return!1;return!0},coerce2=$r=>{if($r instanceof Uint8Array&&$r.constructor.name==="Uint8Array")return $r;if($r instanceof ArrayBuffer)return new Uint8Array($r);if(ArrayBuffer.isView($r))return new Uint8Array($r.buffer,$r.byteOffset,$r.byteLength);throw new Error("Unknown type, must be binary type")},name2="raw",code2=85,encode4=$r=>coerce2($r),decode6=$r=>coerce2($r),CustomProgressEvent=class extends Event{constructor($r,pr){super($r),this.detail=pr}},encode_12=encode5,MSB2=128,REST2=127,MSBALL2=~REST2,INT2=Math.pow(2,31);function encode5($r,pr,Mr){pr=pr||[],Mr=Mr||0;for(var Nr=Mr;$r>=INT2;)pr[Mr++]=$r&255|MSB2,$r/=128;for(;$r&MSBALL2;)pr[Mr++]=$r&255|MSB2,$r>>>=7;return pr[Mr]=$r|0,encode5.bytes=Mr-Nr+1,pr}var decode7=read2,MSB$12=128,REST$12=127;function read2($r,Nr){var Mr=0,Nr=Nr||0,Dr=0,Br=Nr,Lr,jr=$r.length;do{if(Br>=jr)throw read2.bytes=0,new RangeError("Could not decode varint");Lr=$r[Br++],Mr+=Dr<28?(Lr&REST$12)<<Dr:(Lr&REST$12)*Math.pow(2,Dr),Dr+=7}while(Lr>=MSB$12);return read2.bytes=Br-Nr,Mr}var N12=Math.pow(2,7),N22=Math.pow(2,14),N32=Math.pow(2,21),N42=Math.pow(2,28),N52=Math.pow(2,35),N62=Math.pow(2,42),N72=Math.pow(2,49),N82=Math.pow(2,56),N92=Math.pow(2,63),length2=function($r){return $r<N12?1:$r<N22?2:$r<N32?3:$r<N42?4:$r<N52?5:$r<N62?6:$r<N72?7:$r<N82?8:$r<N92?9:10},varint2={encode:encode_12,decode:decode7,encodingLength:length2},_brrp_varint2=varint2,varint_default2=_brrp_varint2,decode8=($r,pr=0)=>[varint_default2.decode($r,pr),varint_default2.decode.bytes],encodeTo2=($r,pr,Mr=0)=>(varint_default2.encode($r,pr,Mr),pr),encodingLength2=$r=>varint_default2.encodingLength($r),create2=($r,pr)=>{const Mr=pr.byteLength,Nr=encodingLength2($r),Dr=Nr+encodingLength2(Mr),Br=new Uint8Array(Dr+Mr);return encodeTo2($r,Br,0),encodeTo2(Mr,Br,Nr),Br.set(pr,Dr),new Digest2($r,Mr,pr,Br)},decode9=$r=>{const pr=coerce2($r),[Mr,Nr]=decode8(pr),[Dr,Br]=decode8(pr.subarray(Nr)),Lr=pr.subarray(Nr+Br);if(Lr.byteLength!==Dr)throw new Error("Incorrect length");return new Digest2(Mr,Dr,Lr,pr)},equals5=($r,pr)=>{if($r===pr)return!0;{const Mr=pr;return $r.code===Mr.code&&$r.size===Mr.size&&Mr.bytes instanceof Uint8Array&&equals4($r.bytes,Mr.bytes)}},Digest2=class{constructor($r,pr,Mr,Nr){this.code=$r,this.size=pr,this.digest=Mr,this.bytes=Nr}};function base2($r,pr){if($r.length>=255)throw new TypeError("Alphabet too long");for(var Mr=new Uint8Array(256),Nr=0;Nr<Mr.length;Nr++)Mr[Nr]=255;for(var Dr=0;Dr<$r.length;Dr++){var Br=$r.charAt(Dr),Lr=Br.charCodeAt(0);if(Mr[Lr]!==255)throw new TypeError(Br+" is ambiguous");Mr[Lr]=Dr}var jr=$r.length,Ur=$r.charAt(0),Gr=Math.log(jr)/Math.log(256),Yr=Math.log(256)/Math.log(jr);function Qr(eo){if(eo instanceof Uint8Array||(ArrayBuffer.isView(eo)?eo=new Uint8Array(eo.buffer,eo.byteOffset,eo.byteLength):Array.isArray(eo)&&(eo=Uint8Array.from(eo))),!(eo instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(eo.length===0)return"";for(var _i=0,va=0,io=0,no=eo.length;io!==no&&eo[io]===0;)io++,_i++;for(var so=(no-io)*Yr+1>>>0,ao=new Uint8Array(so);io!==no;){for(var fo=eo[io],lo=0,oo=so-1;(fo!==0||lo<va)&&oo!==-1;oo--,lo++)fo+=256*ao[oo]>>>0,ao[oo]=fo%jr>>>0,fo=fo/jr>>>0;if(fo!==0)throw new Error("Non-zero carry");va=lo,io++}for(var po=so-va;po!==so&&ao[po]===0;)po++;for(var mo=Ur.repeat(_i);po<so;++po)mo+=$r.charAt(ao[po]);return mo}function Wn(eo){if(typeof eo!="string")throw new TypeError("Expected String");if(eo.length===0)return new Uint8Array;var _i=0;if(eo[_i]!==" "){for(var va=0,io=0;eo[_i]===Ur;)va++,_i++;for(var no=(eo.length-_i)*Gr+1>>>0,so=new Uint8Array(no);eo[_i];){var ao=Mr[eo.charCodeAt(_i)];if(ao===255)return;for(var fo=0,lo=no-1;(ao!==0||fo<io)&&lo!==-1;lo--,fo++)ao+=jr*so[lo]>>>0,so[lo]=ao%256>>>0,ao=ao/256>>>0;if(ao!==0)throw new Error("Non-zero carry");io=fo,_i++}if(eo[_i]!==" "){for(var oo=no-io;oo!==no&&so[oo]===0;)oo++;for(var po=new Uint8Array(va+(no-oo)),mo=va;oo!==no;)po[mo++]=so[oo++];return po}}}function ga(eo){var _i=Wn(eo);if(_i)return _i;throw new Error(`Non-${pr} character`)}return{encode:Qr,decodeUnsafe:Wn,decode:ga}}var src2=base2,_brrp__multiformats_scope_baseX2=src2,base_x_default2=_brrp__multiformats_scope_baseX2,Encoder2=class{constructor($r,pr,Mr){this.name=$r,this.prefix=pr,this.baseEncode=Mr}encode($r){if($r instanceof Uint8Array)return`${this.prefix}${this.baseEncode($r)}`;throw Error("Unknown type, must be binary type")}},Decoder2=class{constructor($r,pr,Mr){if(this.name=$r,this.prefix=pr,pr.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=pr.codePointAt(0),this.baseDecode=Mr}decode($r){if(typeof $r=="string"){if($r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify($r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode($r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or($r){return or2(this,$r)}},ComposedDecoder2=class{constructor($r){this.decoders=$r}or($r){return or2(this,$r)}decode($r){const pr=$r[0],Mr=this.decoders[pr];if(Mr)return Mr.decode($r);throw RangeError(`Unable to decode multibase string ${JSON.stringify($r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},or2=($r,pr)=>new ComposedDecoder2({...$r.decoders||{[$r.prefix]:$r},...pr.decoders||{[pr.prefix]:pr}}),Codec2=class{constructor($r,pr,Mr,Nr){this.name=$r,this.prefix=pr,this.baseEncode=Mr,this.baseDecode=Nr,this.encoder=new Encoder2($r,pr,Mr),this.decoder=new Decoder2($r,pr,Nr)}encode($r){return this.encoder.encode($r)}decode($r){return this.decoder.decode($r)}},from2=({name:$r,prefix:pr,encode:Mr,decode:Nr})=>new Codec2($r,pr,Mr,Nr),baseX2=({prefix:$r,name:pr,alphabet:Mr})=>{const{encode:Nr,decode:Dr}=base_x_default2(Mr,pr);return from2({prefix:$r,name:pr,encode:Nr,decode:Br=>coerce2(Dr(Br))})},decode10=($r,pr,Mr,Nr)=>{const Dr={};for(let Yr=0;Yr<pr.length;++Yr)Dr[pr[Yr]]=Yr;let Br=$r.length;for(;$r[Br-1]==="=";)--Br;const Lr=new Uint8Array(Br*Mr/8|0);let jr=0,Ur=0,Gr=0;for(let Yr=0;Yr<Br;++Yr){const Qr=Dr[$r[Yr]];if(Qr===void 0)throw new SyntaxError(`Non-${Nr} character`);Ur=Ur<<Mr|Qr,jr+=Mr,jr>=8&&(jr-=8,Lr[Gr++]=255&Ur>>jr)}if(jr>=Mr||255&Ur<<8-jr)throw new SyntaxError("Unexpected end of data");return Lr},encode6=($r,pr,Mr)=>{const Nr=pr[pr.length-1]==="=",Dr=(1<<Mr)-1;let Br="",Lr=0,jr=0;for(let Ur=0;Ur<$r.length;++Ur)for(jr=jr<<8|$r[Ur],Lr+=8;Lr>Mr;)Lr-=Mr,Br+=pr[Dr&jr>>Lr];if(Lr&&(Br+=pr[Dr&jr<<Mr-Lr]),Nr)for(;Br.length*Mr&7;)Br+="=";return Br},rfc46482=({name:$r,prefix:pr,bitsPerChar:Mr,alphabet:Nr})=>from2({prefix:pr,name:$r,encode(Dr){return encode6(Dr,Nr,Mr)},decode(Dr){return decode10(Dr,Nr,Mr,$r)}}),base58btc2=baseX2({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"});baseX2({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var base322=rfc46482({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5});rfc46482({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),rfc46482({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),rfc46482({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),rfc46482({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),rfc46482({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),rfc46482({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),rfc46482({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),rfc46482({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var format2=($r,pr)=>{const{bytes:Mr,version:Nr}=$r;switch(Nr){case 0:return toStringV02(Mr,baseCache2($r),pr||base58btc2.encoder);default:return toStringV12(Mr,baseCache2($r),pr||base322.encoder)}},cache2=new WeakMap,baseCache2=$r=>{const pr=cache2.get($r);if(pr==null){const Mr=new Map;return cache2.set($r,Mr),Mr}return pr},CID2=class i0{constructor(pr,Mr,Nr,Dr){this.code=Mr,this.version=pr,this.multihash=Nr,this.bytes=Dr,this["/"]=Dr}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{const{code:pr,multihash:Mr}=this;if(pr!==DAG_PB_CODE2)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(Mr.code!==SHA_256_CODE2)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return i0.createV0(Mr)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{const{code:pr,digest:Mr}=this.multihash,Nr=create2(pr,Mr);return i0.createV1(this.code,Nr)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(pr){return i0.equals(this,pr)}static equals(pr,Mr){const Nr=Mr;return Nr&&pr.code===Nr.code&&pr.version===Nr.version&&equals5(pr.multihash,Nr.multihash)}toString(pr){return format2(this,pr)}toJSON(){return{"/":format2(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(pr){if(pr==null)return null;const Mr=pr;if(Mr instanceof i0)return Mr;if(Mr["/"]!=null&&Mr["/"]===Mr.bytes||Mr.asCID===Mr){const{version:Nr,code:Dr,multihash:Br,bytes:Lr}=Mr;return new i0(Nr,Dr,Br,Lr||encodeCID2(Nr,Dr,Br.bytes))}else if(Mr[cidSymbol2]===!0){const{version:Nr,multihash:Dr,code:Br}=Mr,Lr=decode9(Dr);return i0.create(Nr,Br,Lr)}else return null}static create(pr,Mr,Nr){if(typeof Mr!="number")throw new Error("String codecs are no longer supported");if(!(Nr.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(pr){case 0:{if(Mr!==DAG_PB_CODE2)throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE2}) block encoding`);return new i0(pr,Mr,Nr,Nr.bytes)}case 1:{const Dr=encodeCID2(pr,Mr,Nr.bytes);return new i0(pr,Mr,Nr,Dr)}default:throw new Error("Invalid version")}}static createV0(pr){return i0.create(0,DAG_PB_CODE2,pr)}static createV1(pr,Mr){return i0.create(1,pr,Mr)}static decode(pr){const[Mr,Nr]=i0.decodeFirst(pr);if(Nr.length)throw new Error("Incorrect length");return Mr}static decodeFirst(pr){const Mr=i0.inspectBytes(pr),Nr=Mr.size-Mr.multihashSize,Dr=coerce2(pr.subarray(Nr,Nr+Mr.multihashSize));if(Dr.byteLength!==Mr.multihashSize)throw new Error("Incorrect length");const Br=Dr.subarray(Mr.multihashSize-Mr.digestSize),Lr=new Digest2(Mr.multihashCode,Mr.digestSize,Br,Dr);return[Mr.version===0?i0.createV0(Lr):i0.createV1(Mr.codec,Lr),pr.subarray(Mr.size)]}static inspectBytes(pr){let Mr=0;const Nr=()=>{const[Qr,Wn]=decode8(pr.subarray(Mr));return Mr+=Wn,Qr};let Dr=Nr(),Br=DAG_PB_CODE2;if(Dr===18?(Dr=0,Mr=0):Br=Nr(),Dr!==0&&Dr!==1)throw new RangeError(`Invalid CID version ${Dr}`);const Lr=Mr,jr=Nr(),Ur=Nr(),Gr=Mr+Ur,Yr=Gr-Lr;return{version:Dr,codec:Br,multihashCode:jr,digestSize:Ur,multihashSize:Yr,size:Gr}}static parse(pr,Mr){const[Nr,Dr]=parseCIDtoBytes2(pr,Mr),Br=i0.decode(Dr);if(Br.version===0&&pr[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return baseCache2(Br).set(Nr,pr),Br}},parseCIDtoBytes2=($r,pr)=>{switch($r[0]){case"Q":{const Mr=pr||base58btc2;return[base58btc2.prefix,Mr.decode(`${base58btc2.prefix}${$r}`)]}case base58btc2.prefix:{const Mr=pr||base58btc2;return[base58btc2.prefix,Mr.decode($r)]}case base322.prefix:{const Mr=pr||base322;return[base322.prefix,Mr.decode($r)]}default:{if(pr==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[$r[0],pr.decode($r)]}}},toStringV02=($r,pr,Mr)=>{const{prefix:Nr}=Mr;if(Nr!==base58btc2.prefix)throw Error(`Cannot string encode V0 in ${Mr.name} encoding`);const Dr=pr.get(Nr);if(Dr==null){const Br=Mr.encode($r).slice(1);return pr.set(Nr,Br),Br}else return Dr},toStringV12=($r,pr,Mr)=>{const{prefix:Nr}=Mr,Dr=pr.get(Nr);if(Dr==null){const Br=Mr.encode($r);return pr.set(Nr,Br),Br}else return Dr},DAG_PB_CODE2=112,SHA_256_CODE2=18,encodeCID2=($r,pr,Mr)=>{const Nr=encodingLength2($r),Dr=Nr+encodingLength2(pr),Br=new Uint8Array(Dr+Mr.byteLength);return encodeTo2($r,Br,0),encodeTo2(pr,Br,Nr),Br.set(Mr,Dr),Br},cidSymbol2=Symbol.for("@ipld/js-cid/CID"),import_crypto=__toESM(requireCryptoBrowserify(),1),from3=({name:$r,code:pr,encode:Mr})=>new Hasher($r,pr,Mr),Hasher=class{constructor($r,pr,Mr){this.name=$r,this.code=pr,this.encode=Mr}digest($r){if($r instanceof Uint8Array){const pr=this.encode($r);return pr instanceof Uint8Array?create2(this.code,pr):pr.then(Mr=>create2(this.code,Mr))}else throw Error("Unknown type, must be binary type")}},sha256=from3({name:"sha2-256",code:18,encode:$r=>coerce2(import_crypto.default.createHash("sha256").update($r).digest())}),persist=async($r,pr,Mr)=>{Mr.codec==null&&(Mr.codec=src_exports);const Nr=await sha256.digest($r),Dr=CID2.create(Mr.cidVersion,Mr.codec.code,Nr);return await pr.put(Dr,$r,Mr),Dr};function defaultBufferImporter($r){return async function*(Mr,Nr){let Dr=0n;for await(let Br of Mr.content)yield async()=>{var Gr;let Lr;const jr={codec:src_exports,cidVersion:$r.cidVersion,onProgress:$r.onProgress};$r.rawLeaves?(jr.codec=raw_exports,jr.cidVersion=1):(Lr=new UnixFS({type:$r.leafType,data:Br}),Br=encode3({Data:Lr.marshal(),Links:[]}));const Ur=await persist(Br,Nr,jr);return Dr+=BigInt(Br.byteLength),(Gr=$r.onProgress)==null||Gr.call($r,new CustomProgressEvent("unixfs:importer:progress:file:write",{bytesWritten:Dr,cid:Ur,path:Mr.path})),{cid:Ur,unixfs:Lr,size:BigInt(Br.length),block:Br}}}}var import_err_code2=__toESM(require_err_code(),1),dirBuilder=async($r,pr,Mr)=>{const Nr=new UnixFS({type:"directory",mtime:$r.mtime,mode:$r.mode}),Dr=encode3(prepare({Data:Nr.marshal()})),Br=await persist(Dr,pr,Mr),Lr=$r.path;return{cid:Br,path:Lr,unixfs:Nr,size:BigInt(Dr.length),originalPath:$r.originalPath,block:Dr}};async function*buildFileBatch($r,pr,Mr){let Nr=-1,Dr;for await(const Br of parallelBatch(Mr.bufferImporter($r,pr),Mr.blockWriteConcurrency)){if(Nr++,Nr===0){Dr={...Br,single:!0};continue}else Nr===1&&Dr!=null&&(yield{...Dr,block:void 0,single:void 0},Dr=void 0);yield{...Br,block:void 0}}Dr!=null&&(yield Dr)}function isSingleBlockImport($r){return $r.single===!0}var reduce=($r,pr,Mr)=>async function(Dr){var Yr,Qr;if(Dr.length===1&&isSingleBlockImport(Dr[0])&&Mr.reduceSingleLeafToSelf){const Wn=Dr[0];let ga=Wn.block;return isSingleBlockImport(Wn)&&($r.mtime!==void 0||$r.mode!==void 0)&&(Wn.unixfs=new UnixFS({type:"file",mtime:$r.mtime,mode:$r.mode,data:Wn.block}),ga={Data:Wn.unixfs.marshal(),Links:[]},Wn.block=encode3(prepare(ga)),Wn.cid=await persist(Wn.block,pr,{...Mr,cidVersion:Mr.cidVersion}),Wn.size=BigInt(Wn.block.length)),(Yr=Mr.onProgress)==null||Yr.call(Mr,new CustomProgressEvent("unixfs:importer:progress:file:layout",{cid:Wn.cid,path:Wn.originalPath})),{cid:Wn.cid,path:$r.path,unixfs:Wn.unixfs,size:Wn.size,originalPath:Wn.originalPath}}const Br=new UnixFS({type:"file",mtime:$r.mtime,mode:$r.mode}),Lr=Dr.filter(Wn=>{var ga,eo;return Wn.cid.code===code2&&Wn.size>0||Wn.unixfs!=null&&Wn.unixfs.data==null&&Wn.unixfs.fileSize()>0n?!0:!!((eo=(ga=Wn.unixfs)==null?void 0:ga.data)!=null&&eo.length)}).map(Wn=>{var ga;return Wn.cid.code===code2?(Br.addBlockSize(Wn.size),{Name:"",Tsize:Number(Wn.size),Hash:Wn.cid}):(Wn.unixfs==null||Wn.unixfs.data==null?Br.addBlockSize(((ga=Wn.unixfs)==null?void 0:ga.fileSize())??0n):Br.addBlockSize(BigInt(Wn.unixfs.data.length)),{Name:"",Tsize:Number(Wn.size),Hash:Wn.cid})}),jr={Data:Br.marshal(),Links:Lr},Ur=encode3(prepare(jr)),Gr=await persist(Ur,pr,Mr);return(Qr=Mr.onProgress)==null||Qr.call(Mr,new CustomProgressEvent("unixfs:importer:progress:file:layout",{cid:Gr,path:$r.originalPath})),{cid:Gr,path:$r.path,unixfs:Br,size:BigInt(Ur.length+jr.Links.reduce((Wn,ga)=>Wn+(ga.Tsize??0),0)),originalPath:$r.originalPath,block:Ur}},fileBuilder=async($r,pr,Mr)=>Mr.layout(buildFileBatch($r,pr,Mr),reduce($r,pr,Mr));function isIterable($r){return Symbol.iterator in $r}function isAsyncIterable2($r){return Symbol.asyncIterator in $r}function contentAsAsyncIterable($r){try{if($r instanceof Uint8Array)return async function*(){yield $r}();if(isIterable($r))return async function*(){yield*$r}();if(isAsyncIterable2($r))return $r}catch{throw(0,import_err_code2.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT")}throw(0,import_err_code2.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT")}function defaultDagBuilder($r){return async function*(Mr,Nr){for await(const Dr of Mr){let Br;if(Dr.path!=null&&(Br=Dr.path,Dr.path=Dr.path.split("/").filter(Lr=>Lr!=null&&Lr!==".").join("/")),isFileCandidate(Dr)){const Lr={path:Dr.path,mtime:Dr.mtime,mode:Dr.mode,content:async function*(){var Ur;let jr=0n;for await(const Gr of $r.chunker($r.chunkValidator(contentAsAsyncIterable(Dr.content)))){const Yr=BigInt(Gr.byteLength);jr+=Yr,(Ur=$r.onProgress)==null||Ur.call($r,new CustomProgressEvent("unixfs:importer:progress:file:read",{bytesRead:jr,chunkSize:Yr,path:Dr.path})),yield Gr}}(),originalPath:Br};yield async()=>fileBuilder(Lr,Nr,$r)}else if(Dr.path!=null){const Lr={path:Dr.path,mtime:Dr.mtime,mode:Dr.mode,originalPath:Br};yield async()=>dirBuilder(Lr,Nr,$r)}else throw new Error("Import candidate must have content or path or both")}}}function isFileCandidate($r){return $r.content!=null}var import_err_code3=__toESM(require_err_code(),1),identity_exports={};__export(identity_exports,{identity:()=>identity});function base3($r,pr){if($r.length>=255)throw new TypeError("Alphabet too long");for(var Mr=new Uint8Array(256),Nr=0;Nr<Mr.length;Nr++)Mr[Nr]=255;for(var Dr=0;Dr<$r.length;Dr++){var Br=$r.charAt(Dr),Lr=Br.charCodeAt(0);if(Mr[Lr]!==255)throw new TypeError(Br+" is ambiguous");Mr[Lr]=Dr}var jr=$r.length,Ur=$r.charAt(0),Gr=Math.log(jr)/Math.log(256),Yr=Math.log(256)/Math.log(jr);function Qr(eo){if(eo instanceof Uint8Array||(ArrayBuffer.isView(eo)?eo=new Uint8Array(eo.buffer,eo.byteOffset,eo.byteLength):Array.isArray(eo)&&(eo=Uint8Array.from(eo))),!(eo instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(eo.length===0)return"";for(var _i=0,va=0,io=0,no=eo.length;io!==no&&eo[io]===0;)io++,_i++;for(var so=(no-io)*Yr+1>>>0,ao=new Uint8Array(so);io!==no;){for(var fo=eo[io],lo=0,oo=so-1;(fo!==0||lo<va)&&oo!==-1;oo--,lo++)fo+=256*ao[oo]>>>0,ao[oo]=fo%jr>>>0,fo=fo/jr>>>0;if(fo!==0)throw new Error("Non-zero carry");va=lo,io++}for(var po=so-va;po!==so&&ao[po]===0;)po++;for(var mo=Ur.repeat(_i);po<so;++po)mo+=$r.charAt(ao[po]);return mo}function Wn(eo){if(typeof eo!="string")throw new TypeError("Expected String");if(eo.length===0)return new Uint8Array;var _i=0;if(eo[_i]!==" "){for(var va=0,io=0;eo[_i]===Ur;)va++,_i++;for(var no=(eo.length-_i)*Gr+1>>>0,so=new Uint8Array(no);eo[_i];){var ao=Mr[eo.charCodeAt(_i)];if(ao===255)return;for(var fo=0,lo=no-1;(ao!==0||fo<io)&&lo!==-1;lo--,fo++)ao+=jr*so[lo]>>>0,so[lo]=ao%256>>>0,ao=ao/256>>>0;if(ao!==0)throw new Error("Non-zero carry");io=fo,_i++}if(eo[_i]!==" "){for(var oo=no-io;oo!==no&&so[oo]===0;)oo++;for(var po=new Uint8Array(va+(no-oo)),mo=va;oo!==no;)po[mo++]=so[oo++];return po}}}function ga(eo){var _i=Wn(eo);if(_i)return _i;throw new Error(`Non-${pr} character`)}return{encode:Qr,decodeUnsafe:Wn,decode:ga}}var src3=base3,_brrp__multiformats_scope_baseX3=src3,base_x_default3=_brrp__multiformats_scope_baseX3,coerce3=$r=>{if($r instanceof Uint8Array&&$r.constructor.name==="Uint8Array")return $r;if($r instanceof ArrayBuffer)return new Uint8Array($r);if(ArrayBuffer.isView($r))return new Uint8Array($r.buffer,$r.byteOffset,$r.byteLength);throw new Error("Unknown type, must be binary type")},fromString2=$r=>new TextEncoder().encode($r),toString2=$r=>new TextDecoder().decode($r),Encoder3=class{constructor($r,pr,Mr){this.name=$r,this.prefix=pr,this.baseEncode=Mr}encode($r){if($r instanceof Uint8Array)return`${this.prefix}${this.baseEncode($r)}`;throw Error("Unknown type, must be binary type")}},Decoder3=class{constructor($r,pr,Mr){if(this.name=$r,this.prefix=pr,pr.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=pr.codePointAt(0),this.baseDecode=Mr}decode($r){if(typeof $r=="string"){if($r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify($r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode($r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or($r){return or3(this,$r)}},ComposedDecoder3=class{constructor($r){this.decoders=$r}or($r){return or3(this,$r)}decode($r){const pr=$r[0],Mr=this.decoders[pr];if(Mr)return Mr.decode($r);throw RangeError(`Unable to decode multibase string ${JSON.stringify($r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},or3=($r,pr)=>new ComposedDecoder3({...$r.decoders||{[$r.prefix]:$r},...pr.decoders||{[pr.prefix]:pr}}),Codec3=class{constructor($r,pr,Mr,Nr){this.name=$r,this.prefix=pr,this.baseEncode=Mr,this.baseDecode=Nr,this.encoder=new Encoder3($r,pr,Mr),this.decoder=new Decoder3($r,pr,Nr)}encode($r){return this.encoder.encode($r)}decode($r){return this.decoder.decode($r)}},from4=({name:$r,prefix:pr,encode:Mr,decode:Nr})=>new Codec3($r,pr,Mr,Nr),baseX3=({prefix:$r,name:pr,alphabet:Mr})=>{const{encode:Nr,decode:Dr}=base_x_default3(Mr,pr);return from4({prefix:$r,name:pr,encode:Nr,decode:Br=>coerce3(Dr(Br))})},decode11=($r,pr,Mr,Nr)=>{const Dr={};for(let Yr=0;Yr<pr.length;++Yr)Dr[pr[Yr]]=Yr;let Br=$r.length;for(;$r[Br-1]==="=";)--Br;const Lr=new Uint8Array(Br*Mr/8|0);let jr=0,Ur=0,Gr=0;for(let Yr=0;Yr<Br;++Yr){const Qr=Dr[$r[Yr]];if(Qr===void 0)throw new SyntaxError(`Non-${Nr} character`);Ur=Ur<<Mr|Qr,jr+=Mr,jr>=8&&(jr-=8,Lr[Gr++]=255&Ur>>jr)}if(jr>=Mr||255&Ur<<8-jr)throw new SyntaxError("Unexpected end of data");return Lr},encode7=($r,pr,Mr)=>{const Nr=pr[pr.length-1]==="=",Dr=(1<<Mr)-1;let Br="",Lr=0,jr=0;for(let Ur=0;Ur<$r.length;++Ur)for(jr=jr<<8|$r[Ur],Lr+=8;Lr>Mr;)Lr-=Mr,Br+=pr[Dr&jr>>Lr];if(Lr&&(Br+=pr[Dr&jr<<Mr-Lr]),Nr)for(;Br.length*Mr&7;)Br+="=";return Br},rfc46483=({name:$r,prefix:pr,bitsPerChar:Mr,alphabet:Nr})=>from4({prefix:pr,name:$r,encode(Dr){return encode7(Dr,Nr,Mr)},decode(Dr){return decode11(Dr,Nr,Mr,$r)}}),identity=from4({prefix:"\0",name:"identity",encode:$r=>toString2($r),decode:$r=>fromString2($r)}),base2_exports={};__export(base2_exports,{base2:()=>base22});var base22=rfc46483({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),base8_exports={};__export(base8_exports,{base8:()=>base8});var base8=rfc46483({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base10_exports={};__export(base10_exports,{base10:()=>base10});var base10=baseX3({prefix:"9",name:"base10",alphabet:"0123456789"}),base16_exports={};__export(base16_exports,{base16:()=>base16,base16upper:()=>base16upper});var base16=rfc46483({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper=rfc46483({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),base32_exports={};__export(base32_exports,{base32:()=>base323,base32hex:()=>base32hex3,base32hexpad:()=>base32hexpad3,base32hexpadupper:()=>base32hexpadupper3,base32hexupper:()=>base32hexupper3,base32pad:()=>base32pad3,base32padupper:()=>base32padupper3,base32upper:()=>base32upper3,base32z:()=>base32z3});var base323=rfc46483({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper3=rfc46483({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad3=rfc46483({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper3=rfc46483({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex3=rfc46483({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper3=rfc46483({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad3=rfc46483({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper3=rfc46483({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z3=rfc46483({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base36_exports={};__export(base36_exports,{base36:()=>base36,base36upper:()=>base36upper});var base36=baseX3({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper=baseX3({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base58_exports={};__export(base58_exports,{base58btc:()=>base58btc3,base58flickr:()=>base58flickr3});var base58btc3=baseX3({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr3=baseX3({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base64_exports={};__export(base64_exports,{base64:()=>base64,base64pad:()=>base64pad,base64url:()=>base64url,base64urlpad:()=>base64urlpad});var base64=rfc46483({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad=rfc46483({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url=rfc46483({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad=rfc46483({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base256emoji_exports={};__export(base256emoji_exports,{base256emoji:()=>base256emoji});var alphabet=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),alphabetBytesToChars=alphabet.reduce(($r,pr,Mr)=>($r[Mr]=pr,$r),[]),alphabetCharsToBytes=alphabet.reduce(($r,pr,Mr)=>($r[pr.codePointAt(0)]=Mr,$r),[]);function encode8($r){return $r.reduce((pr,Mr)=>(pr+=alphabetBytesToChars[Mr],pr),"")}function decode12($r){const pr=[];for(const Mr of $r){const Nr=alphabetCharsToBytes[Mr.codePointAt(0)];if(Nr===void 0)throw new Error(`Non-base256emoji character: ${Mr}`);pr.push(Nr)}return new Uint8Array(pr)}var base256emoji=from4({prefix:"🚀",name:"base256emoji",encode:encode8,decode:decode12}),sha2_exports={};__export(sha2_exports,{sha256:()=>sha2562,sha512:()=>sha5122});var import_crypto2=__toESM(requireCryptoBrowserify(),1),encode_13=encode9,MSB3=128,REST3=127,MSBALL3=~REST3,INT3=Math.pow(2,31);function encode9($r,pr,Mr){pr=pr||[],Mr=Mr||0;for(var Nr=Mr;$r>=INT3;)pr[Mr++]=$r&255|MSB3,$r/=128;for(;$r&MSBALL3;)pr[Mr++]=$r&255|MSB3,$r>>>=7;return pr[Mr]=$r|0,encode9.bytes=Mr-Nr+1,pr}var decode13=read3,MSB$13=128,REST$13=127;function read3($r,Nr){var Mr=0,Nr=Nr||0,Dr=0,Br=Nr,Lr,jr=$r.length;do{if(Br>=jr)throw read3.bytes=0,new RangeError("Could not decode varint");Lr=$r[Br++],Mr+=Dr<28?(Lr&REST$13)<<Dr:(Lr&REST$13)*Math.pow(2,Dr),Dr+=7}while(Lr>=MSB$13);return read3.bytes=Br-Nr,Mr}var N13=Math.pow(2,7),N23=Math.pow(2,14),N33=Math.pow(2,21),N43=Math.pow(2,28),N53=Math.pow(2,35),N63=Math.pow(2,42),N73=Math.pow(2,49),N83=Math.pow(2,56),N93=Math.pow(2,63),length3=function($r){return $r<N13?1:$r<N23?2:$r<N33?3:$r<N43?4:$r<N53?5:$r<N63?6:$r<N73?7:$r<N83?8:$r<N93?9:10},varint3={encode:encode_13,decode:decode13,encodingLength:length3},_brrp_varint3=varint3,varint_default3=_brrp_varint3,encodeTo3=($r,pr,Mr=0)=>(varint_default3.encode($r,pr,Mr),pr),encodingLength3=$r=>varint_default3.encodingLength($r),create3=($r,pr)=>{const Mr=pr.byteLength,Nr=encodingLength3($r),Dr=Nr+encodingLength3(Mr),Br=new Uint8Array(Dr+Mr);return encodeTo3($r,Br,0),encodeTo3(Mr,Br,Nr),Br.set(pr,Dr),new Digest3($r,Mr,pr,Br)},Digest3=class{constructor($r,pr,Mr,Nr){this.code=$r,this.size=pr,this.digest=Mr,this.bytes=Nr}},from5=({name:$r,code:pr,encode:Mr})=>new Hasher2($r,pr,Mr),Hasher2=class{constructor($r,pr,Mr){this.name=$r,this.code=pr,this.encode=Mr}digest($r){if($r instanceof Uint8Array){const pr=this.encode($r);return pr instanceof Uint8Array?create3(this.code,pr):pr.then(Mr=>create3(this.code,Mr))}else throw Error("Unknown type, must be binary type")}},sha2562=from5({name:"sha2-256",code:18,encode:$r=>coerce3(import_crypto2.default.createHash("sha256").update($r).digest())}),sha5122=from5({name:"sha2-512",code:19,encode:$r=>coerce3(import_crypto2.default.createHash("sha512").update($r).digest())}),identity_exports2={};__export(identity_exports2,{identity:()=>identity2});var code3=0,name3="identity",encode10=coerce3,digest=$r=>create3(code3,encode10($r)),identity2={code:code3,name:name3,encode:encode10,digest};new TextEncoder,new TextDecoder;var bases={...identity_exports,...base2_exports,...base8_exports,...base10_exports,...base16_exports,...base32_exports,...base36_exports,...base58_exports,...base64_exports,...base256emoji_exports};({...sha2_exports,...identity_exports2});function createCodec2($r,pr,Mr,Nr){return{name:$r,prefix:pr,encoder:{name:$r,prefix:pr,encode:Mr},decoder:{decode:Nr}}}var string=createCodec2("utf8","u",$r=>"u"+new TextDecoder("utf8").decode($r),$r=>new TextEncoder().encode($r.substring(1))),ascii=createCodec2("ascii","a",$r=>{let pr="a";for(let Mr=0;Mr<$r.length;Mr++)pr+=String.fromCharCode($r[Mr]);return pr},$r=>{$r=$r.substring(1);const pr=allocUnsafe($r.length);for(let Mr=0;Mr<$r.length;Mr++)pr[Mr]=$r.charCodeAt(Mr);return pr}),BASES={utf8:string,"utf-8":string,hex:bases.base16,latin1:ascii,ascii,binary:ascii,...bases},bases_default=BASES;function fromString3($r,pr="utf8"){const Mr=bases_default[pr];if(Mr==null)throw new Error(`Unsupported encoding "${pr}"`);return(pr==="utf8"||pr==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?asUint8Array(globalThis.Buffer.from($r,"utf-8")):Mr.decoder.decode(`${Mr.prefix}${$r}`)}var defaultChunkValidator=()=>async function*(pr){for await(const Mr of pr){if(Mr.length===void 0)throw(0,import_err_code3.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT");if(typeof Mr=="string"||Mr instanceof String)yield fromString3(Mr.toString());else if(Array.isArray(Mr))yield Uint8Array.from(Mr);else if(Mr instanceof Uint8Array)yield Mr;else throw(0,import_err_code3.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT")}},DEFAULT_MAX_CHILDREN_PER_NODE=174;function balanced($r){const pr=($r==null?void 0:$r.maxChildrenPerNode)??DEFAULT_MAX_CHILDREN_PER_NODE;return async function Mr(Nr,Dr){const Br=[];for await(const Lr of src_default(Nr,pr))Br.push(await Dr(Lr));return Br.length>1?Mr(Br,Dr):Br[0]}}var Dir=class{constructor($r,pr){Bu(this,"options");Bu(this,"root");Bu(this,"dir");Bu(this,"path");Bu(this,"dirty");Bu(this,"flat");Bu(this,"parent");Bu(this,"parentKey");Bu(this,"unixfs");Bu(this,"mode");Bu(this,"mtime");Bu(this,"cid");Bu(this,"size");Bu(this,"nodeSize");this.options=pr??{},this.root=$r.root,this.dir=$r.dir,this.path=$r.path,this.dirty=$r.dirty,this.flat=$r.flat,this.parent=$r.parent,this.parentKey=$r.parentKey,this.unixfs=$r.unixfs,this.mode=$r.mode,this.mtime=$r.mtime}},CID_V0=CID2.parse("QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn"),CID_V1=CID2.parse("zdj7WbTaiJT1fgatdet9Ei9iDB5hdCxkbVyhyh8YTUnXMiwYi"),DirFlat=class extends Dir{constructor(pr,Mr){super(pr,Mr);Bu(this,"_children");this._children=new Map}async put(pr,Mr){this.cid=void 0,this.size=void 0,this.nodeSize=void 0,this._children.set(pr,Mr)}async get(pr){return Promise.resolve(this._children.get(pr))}childCount(){return this._children.size}directChildrenCount(){return this.childCount()}onlyChild(){return this._children.values().next().value}async*eachChildSeries(){for(const[pr,Mr]of this._children.entries())yield{key:pr,child:Mr}}estimateNodeSize(){if(this.nodeSize!==void 0)return this.nodeSize;this.nodeSize=0;for(const[pr,Mr]of this._children.entries())Mr.size!=null&&Mr.cid!=null&&(this.nodeSize+=pr.length+(this.options.cidVersion===1?CID_V1.bytes.byteLength:CID_V0.bytes.byteLength));return this.nodeSize}async*flush(pr){const Mr=[];for(const[Ur,Gr]of this._children.entries()){let Yr=Gr;if(Gr instanceof Dir)for await(const Qr of Gr.flush(pr))Yr=Qr,yield Qr;Yr.size!=null&&Yr.cid!=null&&Mr.push({Name:Ur,Tsize:Number(Yr.size),Hash:Yr.cid})}const Nr=new UnixFS({type:"directory",mtime:this.mtime,mode:this.mode}),Dr={Data:Nr.marshal(),Links:Mr},Br=encode3(prepare(Dr)),Lr=await persist(Br,pr,this.options),jr=Br.length+Dr.Links.reduce((Ur,Gr)=>Ur+(Gr.Tsize==null?0:Gr.Tsize),0);this.cid=Lr,this.size=jr,yield{cid:Lr,unixfs:Nr,path:this.path,size:BigInt(jr)}}},from6=({name:$r,code:pr,encode:Mr})=>new Hasher3($r,pr,Mr),Hasher3=class{constructor($r,pr,Mr){this.name=$r,this.code=pr,this.encode=Mr}digest($r){if($r instanceof Uint8Array){const pr=this.encode($r);return pr instanceof Uint8Array?create(this.code,pr):pr.then(Mr=>create(this.code,Mr))}else throw Error("Unknown type, must be binary type")}},import_murmurhash3js_revisited=__toESM(require_murmurhash3js_revisited(),1),murmur3128=from6({name:"murmur3-128",code:34,encode:$r=>bytes_exports.fromHex(import_murmurhash3js_revisited.default.x64.hash128($r))}),import_sparse_array=__toESM(require_sparse_array(),1),Bucket=class _g{constructor(pr,Mr,Nr=0){this._options=pr,this._popCount=0,this._parent=Mr,this._posAtParent=Nr,this._children=new import_sparse_array.default,this.key=null}async put(pr,Mr){const Nr=await this._findNewBucketAndPos(pr);await Nr.bucket._putAt(Nr,pr,Mr)}async get(pr){const Mr=await this._findChild(pr);if(Mr!=null)return Mr.value}async del(pr){const Mr=await this._findPlace(pr),Nr=Mr.bucket._at(Mr.pos);Nr!=null&&Nr.key===pr&&Mr.bucket._delAt(Mr.pos)}leafCount(){return this._children.compactArray().reduce((Mr,Nr)=>Nr instanceof _g?Mr+Nr.leafCount():Mr+1,0)}childrenCount(){return this._children.length}onlyChild(){return this._children.get(0)}*eachLeafSeries(){const pr=this._children.compactArray();for(const Mr of pr)Mr instanceof _g?yield*Mr.eachLeafSeries():yield Mr}serialize(pr,Mr){const Nr=[];return Mr(this._children.reduce((Dr,Br,Lr)=>(Br!=null&&(Br instanceof _g?Dr.push(Br.serialize(pr,Mr)):Dr.push(pr(Br,Lr))),Dr),Nr))}async asyncTransform(pr,Mr){return await asyncTransformBucket(this,pr,Mr)}toJSON(){return this.serialize(mapNode,reduceNodes)}prettyPrint(){return JSON.stringify(this.toJSON(),null," ")}tableSize(){return Math.pow(2,this._options.bits)}async _findChild(pr){const Mr=await this._findPlace(pr),Nr=Mr.bucket._at(Mr.pos);if(!(Nr instanceof _g)&&Nr!=null&&Nr.key===pr)return Nr}async _findPlace(pr){const Mr=this._options.hash(typeof pr=="string"?fromString3(pr):pr),Nr=await Mr.take(this._options.bits),Dr=this._children.get(Nr);return Dr instanceof _g?await Dr._findPlace(Mr):{bucket:this,pos:Nr,hash:Mr,existingChild:Dr}}async _findNewBucketAndPos(pr){const Mr=await this._findPlace(pr);if(Mr.existingChild!=null&&Mr.existingChild.key!==pr){const Nr=new _g(this._options,Mr.bucket,Mr.pos);Mr.bucket._putObjectAt(Mr.pos,Nr);const Dr=await Nr._findPlace(Mr.existingChild.hash);return Dr.bucket._putAt(Dr,Mr.existingChild.key,Mr.existingChild.value),await Nr._findNewBucketAndPos(Mr.hash)}return Mr}_putAt(pr,Mr,Nr){this._putObjectAt(pr.pos,{key:Mr,value:Nr,hash:pr.hash})}_putObjectAt(pr,Mr){this._children.get(pr)==null&&this._popCount++,this._children.set(pr,Mr)}_delAt(pr){if(pr===-1)throw new Error("Invalid position");this._children.get(pr)!=null&&this._popCount--,this._children.unset(pr),this._level()}_level(){if(this._parent!=null&&this._popCount<=1)if(this._popCount===1){const pr=this._children.find(exists);if(pr!=null&&!(pr instanceof _g)){const Mr=pr.hash;Mr.untake(this._options.bits);const Nr={pos:this._posAtParent,hash:Mr,bucket:this._parent};this._parent._putAt(Nr,pr.key,pr.value)}}else this._parent._delAt(this._posAtParent)}_at(pr){return this._children.get(pr)}};function exists($r){return!!$r}function mapNode($r,pr){return $r.key}function reduceNodes($r){return $r}async function asyncTransformBucket($r,pr,Mr){const Nr=[];for(const Dr of $r._children.compactArray())if(Dr instanceof Bucket)await asyncTransformBucket(Dr,pr,Mr);else{const Br=await pr(Dr);Nr.push({bitField:$r._children.bitField(),children:Br})}return await Mr(Nr)}var START_MASKS=[255,254,252,248,240,224,192,128],STOP_MASKS=[1,3,7,15,31,63,127,255],ConsumableBuffer=class{constructor($r){this._value=$r,this._currentBytePos=$r.length-1,this._currentBitPos=7}availableBits(){return this._currentBitPos+1+this._currentBytePos*8}totalBits(){return this._value.length*8}take($r){let pr=$r,Mr=0;for(;pr>0&&this._haveBits();){const Nr=this._value[this._currentBytePos],Dr=this._currentBitPos+1,Br=Math.min(Dr,pr),Lr=byteBitsToInt(Nr,Dr-Br,Br);Mr=(Mr<<Br)+Lr,pr-=Br,this._currentBitPos-=Br,this._currentBitPos<0&&(this._currentBitPos=7,this._currentBytePos--)}return Mr}untake($r){for(this._currentBitPos+=$r;this._currentBitPos>7;)this._currentBitPos-=8,this._currentBytePos+=1}_haveBits(){return this._currentBytePos>=0}};function byteBitsToInt($r,pr,Mr){const Nr=maskFor(pr,Mr);return($r&Nr)>>>pr}function maskFor($r,pr){return START_MASKS[$r]&STOP_MASKS[Math.min(pr+$r-1,7)]}function wrapHash($r){function pr(Mr){return Mr instanceof InfiniteHash?Mr:new InfiniteHash(Mr,$r)}return pr}var InfiniteHash=class{constructor($r,pr){if(!($r instanceof Uint8Array))throw new Error("can only hash Uint8Arrays");this._value=$r,this._hashFn=pr,this._depth=-1,this._availableBits=0,this._currentBufferIndex=0,this._buffers=[]}async take($r){let pr=$r;for(;this._availableBits<pr;)await this._produceMoreBits();let Mr=0;for(;pr>0;){const Nr=this._buffers[this._currentBufferIndex],Dr=Math.min(Nr.availableBits(),pr),Br=Nr.take(Dr);Mr=(Mr<<Dr)+Br,pr-=Dr,this._availableBits-=Dr,Nr.availableBits()===0&&this._currentBufferIndex++}return Mr}untake($r){let pr=$r;for(;pr>0;){const Mr=this._buffers[this._currentBufferIndex],Nr=Math.min(Mr.totalBits()-Mr.availableBits(),pr);Mr.untake(Nr),pr-=Nr,this._availableBits+=Nr,this._currentBufferIndex>0&&Mr.totalBits()===Mr.availableBits()&&(this._depth--,this._currentBufferIndex--)}}async _produceMoreBits(){this._depth++;const $r=this._depth>0?concat([this._value,Uint8Array.from([this._depth])]):this._value,pr=await this._hashFn($r),Mr=new ConsumableBuffer(pr);this._buffers.push(Mr),this._availableBits+=Mr.availableBits()}};function createHAMT($r){if($r==null||$r.hashFn==null)throw new Error("please define an options.hashFn");const pr={bits:$r.bits??8,hash:wrapHash($r.hashFn)};return new Bucket(pr)}async function hamtHashFn($r){return(await murmur3128.encode($r)).slice(0,8).reverse()}var HAMT_HASH_CODE=BigInt(34),DirSharded=class extends Dir{constructor(pr,Mr){super(pr,Mr);Bu(this,"_bucket");this._bucket=createHAMT({hashFn:hamtHashFn,bits:8})}async put(pr,Mr){this.cid=void 0,this.size=void 0,this.nodeSize=void 0,await this._bucket.put(pr,Mr)}async get(pr){return this._bucket.get(pr)}childCount(){return this._bucket.leafCount()}directChildrenCount(){return this._bucket.childrenCount()}onlyChild(){return this._bucket.onlyChild()}async*eachChildSeries(){for await(const{key:pr,value:Mr}of this._bucket.eachLeafSeries())yield{key:pr,child:Mr}}estimateNodeSize(){return this.nodeSize!==void 0?this.nodeSize:(this.nodeSize=calculateSize(this._bucket,this,this.options),this.nodeSize)}async*flush(pr){for await(const Mr of flush(this._bucket,pr,this,this.options))yield{...Mr,path:this.path}}},dir_sharded_default=DirSharded;async function*flush($r,pr,Mr,Nr){const Dr=$r._children,Br=[];let Lr=0n;for(let ga=0;ga<Dr.length;ga++){const eo=Dr.get(ga);if(eo==null)continue;const _i=ga.toString(16).toUpperCase().padStart(2,"0");if(eo instanceof Bucket){let va;for await(const io of flush(eo,pr,null,Nr))va=io;if(va==null)throw new Error("Could not flush sharded directory, no subshard found");Br.push({Name:_i,Tsize:Number(va.size),Hash:va.cid}),Lr+=va.size}else if(isDir(eo.value)){const va=eo.value;let io;for await(const so of va.flush(pr))io=so,yield io;if(io==null)throw new Error("Did not flush dir");const no=_i+eo.key;Br.push({Name:no,Tsize:Number(io.size),Hash:io.cid}),Lr+=io.size}else{const va=eo.value;if(va.cid==null)continue;const io=_i+eo.key,no=va.size;Br.push({Name:io,Tsize:Number(no),Hash:va.cid}),Lr+=BigInt(no??0)}}const jr=Uint8Array.from(Dr.bitField().reverse()),Ur=new UnixFS({type:"hamt-sharded-directory",data:jr,fanout:BigInt($r.tableSize()),hashType:HAMT_HASH_CODE,mtime:Mr==null?void 0:Mr.mtime,mode:Mr==null?void 0:Mr.mode}),Gr={Data:Ur.marshal(),Links:Br},Yr=encode3(prepare(Gr)),Qr=await persist(Yr,pr,Nr),Wn=BigInt(Yr.byteLength)+Lr;yield{cid:Qr,unixfs:Ur,size:Wn}}function isDir($r){return typeof $r.flush=="function"}function calculateSize($r,pr,Mr){const Nr=$r._children,Dr=[];for(let Ur=0;Ur<Nr.length;Ur++){const Gr=Nr.get(Ur);if(Gr==null)continue;const Yr=Ur.toString(16).toUpperCase().padStart(2,"0");if(Gr instanceof Bucket){const Qr=calculateSize(Gr,null,Mr);Dr.push({Name:Yr,Tsize:Number(Qr),Hash:Mr.cidVersion===0?CID_V0:CID_V1})}else if(typeof Gr.value.flush=="function"){const Wn=Gr.value.nodeSize();Dr.push({Name:Yr+Gr.key,Tsize:Number(Wn),Hash:Mr.cidVersion===0?CID_V0:CID_V1})}else{const Qr=Gr.value;if(Qr.cid==null)continue;const Wn=Yr+Gr.key,ga=Qr.size;Dr.push({Name:Wn,Tsize:Number(ga),Hash:Qr.cid})}}const Br=Uint8Array.from(Nr.bitField().reverse()),Lr=new UnixFS({type:"hamt-sharded-directory",data:Br,fanout:BigInt($r.tableSize()),hashType:HAMT_HASH_CODE,mtime:pr==null?void 0:pr.mtime,mode:pr==null?void 0:pr.mode});return encode3(prepare({Data:Lr.marshal(),Links:Dr})).length}async function flatToShard($r,pr,Mr,Nr){let Dr=pr;pr instanceof DirFlat&&pr.estimateNodeSize()>Mr&&(Dr=await convertToShard(pr,Nr));const Br=Dr.parent;if(Br!=null){if(Dr!==pr){if($r!=null&&($r.parent=Dr),Dr.parentKey==null)throw new Error("No parent key found");await Br.put(Dr.parentKey,Dr)}return flatToShard(Dr,Br,Mr,Nr)}return Dr}async function convertToShard($r,pr){const Mr=new dir_sharded_default({root:$r.root,dir:!0,parent:$r.parent,parentKey:$r.parentKey,path:$r.path,dirty:$r.dirty,flat:!1,mtime:$r.mtime,mode:$r.mode},pr);for await(const{key:Nr,child:Dr}of $r.eachChildSeries())await Mr.put(Nr,Dr);return Mr}var toPathComponents=($r="")=>($r.trim().match(/([^\\/]|\\\/)+/g)??[]).filter(Boolean);async function addToTree($r,pr,Mr){var jr,Ur;const Nr=toPathComponents($r.path??""),Dr=Nr.length-1;let Br=pr,Lr="";for(let Gr=0;Gr<Nr.length;Gr++){const Yr=Nr[Gr];Lr+=`${Lr!==""?"/":""}${Yr}`;const Qr=Gr===Dr;if(Br.dirty=!0,Br.cid=void 0,Br.size=void 0,Qr)await Br.put(Yr,$r),pr=await flatToShard(null,Br,Mr.shardSplitThresholdBytes,Mr);else{let Wn=await Br.get(Yr);(Wn==null||!(Wn instanceof Dir))&&(Wn=new DirFlat({root:!1,dir:!0,parent:Br,parentKey:Yr,path:Lr,dirty:!0,flat:!0,mtime:(jr=Wn==null?void 0:Wn.unixfs)==null?void 0:jr.mtime,mode:(Ur=Wn==null?void 0:Wn.unixfs)==null?void 0:Ur.mode},Mr)),await Br.put(Yr,Wn),Br=Wn}}return pr}async function*flushAndYield($r,pr){var Mr;if(!($r instanceof Dir)){((Mr=$r.unixfs)==null?void 0:Mr.isDirectory())===!0&&(yield $r);return}yield*$r.flush(pr)}function defaultTreeBuilder($r){return async function*(Mr,Nr){let Dr=new DirFlat({root:!0,dir:!0,path:"",dirty:!0,flat:!0},$r),Br,Lr=!1;for await(const jr of Mr){if(jr==null)continue;const Ur=`${jr.originalPath??""}`.split("/")[0];Ur!=null&&Ur!==""&&(Br==null?(Br=Ur,Lr=!0):Br!==Ur&&(Lr=!1)),Dr=await addToTree(jr,Dr,$r),(jr.unixfs==null||!jr.unixfs.isDirectory())&&(yield jr)}if($r.wrapWithDirectory||Lr&&Dr.childCount()>1)yield*flushAndYield(Dr,Nr);else for await(const jr of Dr.eachChildSeries())jr!=null&&(yield*flushAndYield(jr.child,Nr))}}async function*importer($r,pr,Mr={}){let Nr;Symbol.asyncIterator in $r||Symbol.iterator in $r?Nr=$r:Nr=[$r];const Dr=Mr.wrapWithDirectory??!1,Br=Mr.shardSplitThresholdBytes??262144,Lr=Mr.cidVersion??1,jr=Mr.rawLeaves??!0,Ur=Mr.leafType??"file",Gr=Mr.fileImportConcurrency??50,Yr=Mr.blockWriteConcurrency??10,Qr=Mr.reduceSingleLeafToSelf??!0,Wn=Mr.chunker??fixedSize(),ga=Mr.chunkValidator??defaultChunkValidator(),eo=Mr.dagBuilder??defaultDagBuilder({chunker:Wn,chunkValidator:ga,wrapWithDirectory:Dr,layout:Mr.layout??balanced(),bufferImporter:Mr.bufferImporter??defaultBufferImporter({cidVersion:Lr,rawLeaves:jr,leafType:Ur,onProgress:Mr.onProgress}),blockWriteConcurrency:Yr,reduceSingleLeafToSelf:Qr,cidVersion:Lr,onProgress:Mr.onProgress}),_i=Mr.treeBuilder??defaultTreeBuilder({wrapWithDirectory:Dr,shardSplitThresholdBytes:Br,cidVersion:Lr,onProgress:Mr.onProgress});for await(const va of _i(parallelBatch(eo(Nr,pr),Gr),pr))yield{cid:va.cid,path:va.path,unixfs:va.unixfs,size:va.size}}var errors_exports={};__export(errors_exports,{abortedError:()=>abortedError,closeFailedError:()=>closeFailedError,deleteFailedError:()=>deleteFailedError,getFailedError:()=>getFailedError,hasFailedError:()=>hasFailedError,notFoundError:()=>notFoundError,openFailedError:()=>openFailedError,putFailedError:()=>putFailedError});var import_err_code5=__toESM(require_err_code(),1);function openFailedError($r){return $r=$r??new Error("Open failed"),(0,import_err_code5.default)($r,"ERR_OPEN_FAILED")}function closeFailedError($r){return $r=$r??new Error("Close failed"),(0,import_err_code5.default)($r,"ERR_CLOSE_FAILED")}function putFailedError($r){return $r=$r??new Error("Put failed"),(0,import_err_code5.default)($r,"ERR_PUT_FAILED")}function getFailedError($r){return $r=$r??new Error("Get failed"),(0,import_err_code5.default)($r,"ERR_GET_FAILED")}function deleteFailedError($r){return $r=$r??new Error("Delete failed"),(0,import_err_code5.default)($r,"ERR_DELETE_FAILED")}function hasFailedError($r){return $r=$r??new Error("Has failed"),(0,import_err_code5.default)($r,"ERR_HAS_FAILED")}function notFoundError($r){return $r=$r??new Error("Not Found"),(0,import_err_code5.default)($r,"ERR_NOT_FOUND")}function abortedError($r){return $r=$r??new Error("Aborted"),(0,import_err_code5.default)($r,"ERR_ABORTED")}var BaseBlockstore=class{has($r,pr){return Promise.reject(new Error(".has is not implemented"))}put($r,pr,Mr){return Promise.reject(new Error(".put is not implemented"))}async*putMany($r,pr){for await(const{cid:Mr,block:Nr}of $r)await this.put(Mr,Nr,pr),yield Mr}get($r,pr){return Promise.reject(new Error(".get is not implemented"))}async*getMany($r,pr){for await(const Mr of $r)yield{cid:Mr,block:await this.get(Mr,pr)}}async delete($r,pr){await Promise.reject(new Error(".delete is not implemented"))}async*deleteMany($r,pr){for await(const Mr of $r)await this.delete(Mr,pr),yield Mr}async*getAll($r){throw new Error(".getAll is not implemented")}};function base4($r,pr){if($r.length>=255)throw new TypeError("Alphabet too long");for(var Mr=new Uint8Array(256),Nr=0;Nr<Mr.length;Nr++)Mr[Nr]=255;for(var Dr=0;Dr<$r.length;Dr++){var Br=$r.charAt(Dr),Lr=Br.charCodeAt(0);if(Mr[Lr]!==255)throw new TypeError(Br+" is ambiguous");Mr[Lr]=Dr}var jr=$r.length,Ur=$r.charAt(0),Gr=Math.log(jr)/Math.log(256),Yr=Math.log(256)/Math.log(jr);function Qr(eo){if(eo instanceof Uint8Array||(ArrayBuffer.isView(eo)?eo=new Uint8Array(eo.buffer,eo.byteOffset,eo.byteLength):Array.isArray(eo)&&(eo=Uint8Array.from(eo))),!(eo instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(eo.length===0)return"";for(var _i=0,va=0,io=0,no=eo.length;io!==no&&eo[io]===0;)io++,_i++;for(var so=(no-io)*Yr+1>>>0,ao=new Uint8Array(so);io!==no;){for(var fo=eo[io],lo=0,oo=so-1;(fo!==0||lo<va)&&oo!==-1;oo--,lo++)fo+=256*ao[oo]>>>0,ao[oo]=fo%jr>>>0,fo=fo/jr>>>0;if(fo!==0)throw new Error("Non-zero carry");va=lo,io++}for(var po=so-va;po!==so&&ao[po]===0;)po++;for(var mo=Ur.repeat(_i);po<so;++po)mo+=$r.charAt(ao[po]);return mo}function Wn(eo){if(typeof eo!="string")throw new TypeError("Expected String");if(eo.length===0)return new Uint8Array;var _i=0;if(eo[_i]!==" "){for(var va=0,io=0;eo[_i]===Ur;)va++,_i++;for(var no=(eo.length-_i)*Gr+1>>>0,so=new Uint8Array(no);eo[_i];){var ao=Mr[eo.charCodeAt(_i)];if(ao===255)return;for(var fo=0,lo=no-1;(ao!==0||fo<io)&&lo!==-1;lo--,fo++)ao+=jr*so[lo]>>>0,so[lo]=ao%256>>>0,ao=ao/256>>>0;if(ao!==0)throw new Error("Non-zero carry");io=fo,_i++}if(eo[_i]!==" "){for(var oo=no-io;oo!==no&&so[oo]===0;)oo++;for(var po=new Uint8Array(va+(no-oo)),mo=va;oo!==no;)po[mo++]=so[oo++];return po}}}function ga(eo){var _i=Wn(eo);if(_i)return _i;throw new Error(`Non-${pr} character`)}return{encode:Qr,decodeUnsafe:Wn,decode:ga}}var src4=base4,_brrp__multiformats_scope_baseX4=src4,base_x_default4=_brrp__multiformats_scope_baseX4,equals8=($r,pr)=>{if($r===pr)return!0;if($r.byteLength!==pr.byteLength)return!1;for(let Mr=0;Mr<$r.byteLength;Mr++)if($r[Mr]!==pr[Mr])return!1;return!0},coerce4=$r=>{if($r instanceof Uint8Array&&$r.constructor.name==="Uint8Array")return $r;if($r instanceof ArrayBuffer)return new Uint8Array($r);if(ArrayBuffer.isView($r))return new Uint8Array($r.buffer,$r.byteOffset,$r.byteLength);throw new Error("Unknown type, must be binary type")},Encoder4=class{constructor($r,pr,Mr){this.name=$r,this.prefix=pr,this.baseEncode=Mr}encode($r){if($r instanceof Uint8Array)return`${this.prefix}${this.baseEncode($r)}`;throw Error("Unknown type, must be binary type")}},Decoder4=class{constructor($r,pr,Mr){if(this.name=$r,this.prefix=pr,pr.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=pr.codePointAt(0),this.baseDecode=Mr}decode($r){if(typeof $r=="string"){if($r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify($r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode($r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or($r){return or4(this,$r)}},ComposedDecoder4=class{constructor($r){this.decoders=$r}or($r){return or4(this,$r)}decode($r){const pr=$r[0],Mr=this.decoders[pr];if(Mr)return Mr.decode($r);throw RangeError(`Unable to decode multibase string ${JSON.stringify($r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},or4=($r,pr)=>new ComposedDecoder4({...$r.decoders||{[$r.prefix]:$r},...pr.decoders||{[pr.prefix]:pr}}),Codec4=class{constructor($r,pr,Mr,Nr){this.name=$r,this.prefix=pr,this.baseEncode=Mr,this.baseDecode=Nr,this.encoder=new Encoder4($r,pr,Mr),this.decoder=new Decoder4($r,pr,Nr)}encode($r){return this.encoder.encode($r)}decode($r){return this.decoder.decode($r)}},from7=({name:$r,prefix:pr,encode:Mr,decode:Nr})=>new Codec4($r,pr,Mr,Nr),baseX4=({prefix:$r,name:pr,alphabet:Mr})=>{const{encode:Nr,decode:Dr}=base_x_default4(Mr,pr);return from7({prefix:$r,name:pr,encode:Nr,decode:Br=>coerce4(Dr(Br))})},decode16=($r,pr,Mr,Nr)=>{const Dr={};for(let Yr=0;Yr<pr.length;++Yr)Dr[pr[Yr]]=Yr;let Br=$r.length;for(;$r[Br-1]==="=";)--Br;const Lr=new Uint8Array(Br*Mr/8|0);let jr=0,Ur=0,Gr=0;for(let Yr=0;Yr<Br;++Yr){const Qr=Dr[$r[Yr]];if(Qr===void 0)throw new SyntaxError(`Non-${Nr} character`);Ur=Ur<<Mr|Qr,jr+=Mr,jr>=8&&(jr-=8,Lr[Gr++]=255&Ur>>jr)}if(jr>=Mr||255&Ur<<8-jr)throw new SyntaxError("Unexpected end of data");return Lr},encode11=($r,pr,Mr)=>{const Nr=pr[pr.length-1]==="=",Dr=(1<<Mr)-1;let Br="",Lr=0,jr=0;for(let Ur=0;Ur<$r.length;++Ur)for(jr=jr<<8|$r[Ur],Lr+=8;Lr>Mr;)Lr-=Mr,Br+=pr[Dr&jr>>Lr];if(Lr&&(Br+=pr[Dr&jr<<Mr-Lr]),Nr)for(;Br.length*Mr&7;)Br+="=";return Br},rfc46484=({name:$r,prefix:pr,bitsPerChar:Mr,alphabet:Nr})=>from7({prefix:pr,name:$r,encode(Dr){return encode11(Dr,Nr,Mr)},decode(Dr){return decode16(Dr,Nr,Mr,$r)}}),base324=rfc46484({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5});rfc46484({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),rfc46484({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),rfc46484({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),rfc46484({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),rfc46484({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),rfc46484({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),rfc46484({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),rfc46484({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var encode_14=encode12,MSB4=128,REST4=127,MSBALL4=~REST4,INT4=Math.pow(2,31);function encode12($r,pr,Mr){pr=pr||[],Mr=Mr||0;for(var Nr=Mr;$r>=INT4;)pr[Mr++]=$r&255|MSB4,$r/=128;for(;$r&MSBALL4;)pr[Mr++]=$r&255|MSB4,$r>>>=7;return pr[Mr]=$r|0,encode12.bytes=Mr-Nr+1,pr}var decode17=read4,MSB$14=128,REST$14=127;function read4($r,Nr){var Mr=0,Nr=Nr||0,Dr=0,Br=Nr,Lr,jr=$r.length;do{if(Br>=jr)throw read4.bytes=0,new RangeError("Could not decode varint");Lr=$r[Br++],Mr+=Dr<28?(Lr&REST$14)<<Dr:(Lr&REST$14)*Math.pow(2,Dr),Dr+=7}while(Lr>=MSB$14);return read4.bytes=Br-Nr,Mr}var N14=Math.pow(2,7),N24=Math.pow(2,14),N34=Math.pow(2,21),N44=Math.pow(2,28),N54=Math.pow(2,35),N64=Math.pow(2,42),N74=Math.pow(2,49),N84=Math.pow(2,56),N94=Math.pow(2,63),length4=function($r){return $r<N14?1:$r<N24?2:$r<N34?3:$r<N44?4:$r<N54?5:$r<N64?6:$r<N74?7:$r<N84?8:$r<N94?9:10},varint4={encode:encode_14,decode:decode17,encodingLength:length4},_brrp_varint4=varint4,varint_default4=_brrp_varint4,decode18=($r,pr=0)=>[varint_default4.decode($r,pr),varint_default4.decode.bytes],encodeTo4=($r,pr,Mr=0)=>(varint_default4.encode($r,pr,Mr),pr),encodingLength4=$r=>varint_default4.encodingLength($r),create4=($r,pr)=>{const Mr=pr.byteLength,Nr=encodingLength4($r),Dr=Nr+encodingLength4(Mr),Br=new Uint8Array(Dr+Mr);return encodeTo4($r,Br,0),encodeTo4(Mr,Br,Nr),Br.set(pr,Dr),new Digest4($r,Mr,pr,Br)},decode19=$r=>{const pr=coerce4($r),[Mr,Nr]=decode18(pr),[Dr,Br]=decode18(pr.subarray(Nr)),Lr=pr.subarray(Nr+Br);if(Lr.byteLength!==Dr)throw new Error("Incorrect length");return new Digest4(Mr,Dr,Lr,pr)},equals9=($r,pr)=>{if($r===pr)return!0;{const Mr=pr;return $r.code===Mr.code&&$r.size===Mr.size&&Mr.bytes instanceof Uint8Array&&equals8($r.bytes,Mr.bytes)}},Digest4=class{constructor($r,pr,Mr,Nr){this.code=$r,this.size=pr,this.digest=Mr,this.bytes=Nr}},base58btc4=baseX4({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"});baseX4({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var format4=($r,pr)=>{const{bytes:Mr,version:Nr}=$r;switch(Nr){case 0:return toStringV04(Mr,baseCache4($r),pr||base58btc4.encoder);default:return toStringV14(Mr,baseCache4($r),pr||base324.encoder)}},cache4=new WeakMap,baseCache4=$r=>{const pr=cache4.get($r);if(pr==null){const Mr=new Map;return cache4.set($r,Mr),Mr}return pr},CID4=class a0{constructor(pr,Mr,Nr,Dr){this.code=Mr,this.version=pr,this.multihash=Nr,this.bytes=Dr,this["/"]=Dr}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{const{code:pr,multihash:Mr}=this;if(pr!==DAG_PB_CODE4)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(Mr.code!==SHA_256_CODE4)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return a0.createV0(Mr)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{const{code:pr,digest:Mr}=this.multihash,Nr=create4(pr,Mr);return a0.createV1(this.code,Nr)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(pr){return a0.equals(this,pr)}static equals(pr,Mr){const Nr=Mr;return Nr&&pr.code===Nr.code&&pr.version===Nr.version&&equals9(pr.multihash,Nr.multihash)}toString(pr){return format4(this,pr)}toJSON(){return{"/":format4(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(pr){if(pr==null)return null;const Mr=pr;if(Mr instanceof a0)return Mr;if(Mr["/"]!=null&&Mr["/"]===Mr.bytes||Mr.asCID===Mr){const{version:Nr,code:Dr,multihash:Br,bytes:Lr}=Mr;return new a0(Nr,Dr,Br,Lr||encodeCID4(Nr,Dr,Br.bytes))}else if(Mr[cidSymbol4]===!0){const{version:Nr,multihash:Dr,code:Br}=Mr,Lr=decode19(Dr);return a0.create(Nr,Br,Lr)}else return null}static create(pr,Mr,Nr){if(typeof Mr!="number")throw new Error("String codecs are no longer supported");if(!(Nr.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(pr){case 0:{if(Mr!==DAG_PB_CODE4)throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE4}) block encoding`);return new a0(pr,Mr,Nr,Nr.bytes)}case 1:{const Dr=encodeCID4(pr,Mr,Nr.bytes);return new a0(pr,Mr,Nr,Dr)}default:throw new Error("Invalid version")}}static createV0(pr){return a0.create(0,DAG_PB_CODE4,pr)}static createV1(pr,Mr){return a0.create(1,pr,Mr)}static decode(pr){const[Mr,Nr]=a0.decodeFirst(pr);if(Nr.length)throw new Error("Incorrect length");return Mr}static decodeFirst(pr){const Mr=a0.inspectBytes(pr),Nr=Mr.size-Mr.multihashSize,Dr=coerce4(pr.subarray(Nr,Nr+Mr.multihashSize));if(Dr.byteLength!==Mr.multihashSize)throw new Error("Incorrect length");const Br=Dr.subarray(Mr.multihashSize-Mr.digestSize),Lr=new Digest4(Mr.multihashCode,Mr.digestSize,Br,Dr);return[Mr.version===0?a0.createV0(Lr):a0.createV1(Mr.codec,Lr),pr.subarray(Mr.size)]}static inspectBytes(pr){let Mr=0;const Nr=()=>{const[Qr,Wn]=decode18(pr.subarray(Mr));return Mr+=Wn,Qr};let Dr=Nr(),Br=DAG_PB_CODE4;if(Dr===18?(Dr=0,Mr=0):Br=Nr(),Dr!==0&&Dr!==1)throw new RangeError(`Invalid CID version ${Dr}`);const Lr=Mr,jr=Nr(),Ur=Nr(),Gr=Mr+Ur,Yr=Gr-Lr;return{version:Dr,codec:Br,multihashCode:jr,digestSize:Ur,multihashSize:Yr,size:Gr}}static parse(pr,Mr){const[Nr,Dr]=parseCIDtoBytes4(pr,Mr),Br=a0.decode(Dr);if(Br.version===0&&pr[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return baseCache4(Br).set(Nr,pr),Br}},parseCIDtoBytes4=($r,pr)=>{switch($r[0]){case"Q":{const Mr=pr||base58btc4;return[base58btc4.prefix,Mr.decode(`${base58btc4.prefix}${$r}`)]}case base58btc4.prefix:{const Mr=pr||base58btc4;return[base58btc4.prefix,Mr.decode($r)]}case base324.prefix:{const Mr=pr||base324;return[base324.prefix,Mr.decode($r)]}default:{if(pr==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[$r[0],pr.decode($r)]}}},toStringV04=($r,pr,Mr)=>{const{prefix:Nr}=Mr;if(Nr!==base58btc4.prefix)throw Error(`Cannot string encode V0 in ${Mr.name} encoding`);const Dr=pr.get(Nr);if(Dr==null){const Br=Mr.encode($r).slice(1);return pr.set(Nr,Br),Br}else return Dr},toStringV14=($r,pr,Mr)=>{const{prefix:Nr}=Mr,Dr=pr.get(Nr);if(Dr==null){const Br=Mr.encode($r);return pr.set(Nr,Br),Br}else return Dr},DAG_PB_CODE4=112,SHA_256_CODE4=18,encodeCID4=($r,pr,Mr)=>{const Nr=encodingLength4($r),Dr=Nr+encodingLength4(pr),Br=new Uint8Array(Dr+Mr.byteLength);return encodeTo4($r,Br,0),encodeTo4(pr,Br,Nr),Br.set(Mr,Dr),Br},cidSymbol4=Symbol.for("@ipld/js-cid/CID"),code4=85,MemoryBlockstore=class extends BaseBlockstore{constructor(){super();Bu(this,"data");this.data=new Map}put(pr,Mr){return this.data.set(base324.encode(pr.multihash.bytes),Mr),pr}get(pr){const Mr=this.data.get(base324.encode(pr.multihash.bytes));if(Mr==null)throw notFoundError();return Mr}has(pr){return this.data.has(base324.encode(pr.multihash.bytes))}async delete(pr){this.data.delete(base324.encode(pr.multihash.bytes))}async*getAll(){for(const[pr,Mr]of this.data.entries())yield{cid:CID4.createV1(code4,decode19(base324.decode(pr))),block:Mr}}};({...errors_exports});async function hashV0($r){const pr=import_crypto3.default.createHash("sha256");if($r instanceof Uint8Array)pr.update($r);else if(Symbol.asyncIterator in $r)for await(const Mr of $r)pr.update(Mr);else throw new Error("Invalid value provided to hashStreamV0. Expected AsyncGenerator<Uint8Array> | AsyncIterable<Uint8Array> | Uint8Array");return CID.createV0(create(18,pr.digest())).toString()}async function hashV1($r){const pr=new MemoryBlockstore;let Mr;async function*Nr(){yield $r}if($r instanceof Uint8Array)for await(const{cid:Dr}of importer([{content:Nr()}],pr,{cidVersion:1,rawLeaves:!0}))Mr=Dr;else if(Symbol.asyncIterator in $r)for await(const{cid:Dr}of importer([{content:$r}],pr,{cidVersion:1,rawLeaves:!0}))Mr=Dr;else throw new Error("Invalid value provided to hashStreamV1. Expected AsyncGenerator<Uint8Array> | AsyncIterable<Uint8Array> | Uint8Array");return`${Mr}`}function sortKeys($r,pr){return compareStrings($r.hash,pr.hash)||compareStrings($r.file,pr.file)||0}function compareStrings($r,pr){if($r===pr)return 0;for(let Mr=0;Mr<Math.max($r.length,pr.length);Mr++){if($r.charAt(Mr)>pr.charAt(Mr))return 1;if($r.charAt(Mr)<pr.charAt(Mr))return-1}return $r.length>pr.length?1:-1}function prepareADR32Data($r,pr){return new TextEncoder().encode(JSON.stringify({content:$r.sort(sortKeys).map(Mr=>({key:Mr.file,hash:Mr.hash})),metadata:pr}))}async function calculateMultipleHashesADR32($r,pr){const Mr=prepareADR32Data($r,pr);return{data:Mr,hash:await hashV1(Mr)}}async function calculateMultipleHashesADR32LegacyQmHash($r,pr){const Mr=prepareADR32Data($r,pr);return{data:Mr,hash:await hashV0(Mr)}}function number($r){if(!Number.isSafeInteger($r)||$r<0)throw new Error(`Wrong positive integer: ${$r}`)}function bool($r){if(typeof $r!="boolean")throw new Error(`Expected boolean, not ${$r}`)}function bytes($r,...pr){if(!($r instanceof Uint8Array))throw new Error("Expected Uint8Array");if(pr.length>0&&!pr.includes($r.length))throw new Error(`Expected Uint8Array of length ${pr}, not of length=${$r.length}`)}function hash($r){if(typeof $r!="function"||typeof $r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number($r.outputLen),number($r.blockLen)}function exists2($r,pr=!0){if($r.destroyed)throw new Error("Hash instance has been destroyed");if(pr&&$r.finished)throw new Error("Hash#digest() has already been called")}function output($r,pr){bytes($r);const Mr=pr.outputLen;if($r.length<Mr)throw new Error(`digestInto() expects output buffer of length at least ${Mr}`)}var assert={number,bool,bytes,hash,exists:exists2,output},assert_default=assert,U32_MASK64=BigInt(2**32-1),_32n=BigInt(32);function fromBig($r,pr=!1){return pr?{h:Number($r&U32_MASK64),l:Number($r>>_32n&U32_MASK64)}:{h:Number($r>>_32n&U32_MASK64)|0,l:Number($r&U32_MASK64)|0}}function split($r,pr=!1){let Mr=new Uint32Array($r.length),Nr=new Uint32Array($r.length);for(let Dr=0;Dr<$r.length;Dr++){const{h:Br,l:Lr}=fromBig($r[Dr],pr);[Mr[Dr],Nr[Dr]]=[Br,Lr]}return[Mr,Nr]}var toBig=($r,pr)=>BigInt($r>>>0)<<_32n|BigInt(pr>>>0),shrSH=($r,pr,Mr)=>$r>>>Mr,shrSL=($r,pr,Mr)=>$r<<32-Mr|pr>>>Mr,rotrSH=($r,pr,Mr)=>$r>>>Mr|pr<<32-Mr,rotrSL=($r,pr,Mr)=>$r<<32-Mr|pr>>>Mr,rotrBH=($r,pr,Mr)=>$r<<64-Mr|pr>>>Mr-32,rotrBL=($r,pr,Mr)=>$r>>>Mr-32|pr<<64-Mr,rotr32H=($r,pr)=>pr,rotr32L=($r,pr)=>$r,rotlSH=($r,pr,Mr)=>$r<<Mr|pr>>>32-Mr,rotlSL=($r,pr,Mr)=>pr<<Mr|$r>>>32-Mr,rotlBH=($r,pr,Mr)=>pr<<Mr-32|$r>>>64-Mr,rotlBL=($r,pr,Mr)=>$r<<Mr-32|pr>>>64-Mr;function add($r,pr,Mr,Nr){const Dr=(pr>>>0)+(Nr>>>0);return{h:$r+Mr+(Dr/2**32|0)|0,l:Dr|0}}var add3L=($r,pr,Mr)=>($r>>>0)+(pr>>>0)+(Mr>>>0),add3H=($r,pr,Mr,Nr)=>pr+Mr+Nr+($r/2**32|0)|0,add4L=($r,pr,Mr,Nr)=>($r>>>0)+(pr>>>0)+(Mr>>>0)+(Nr>>>0),add4H=($r,pr,Mr,Nr,Dr)=>pr+Mr+Nr+Dr+($r/2**32|0)|0,add5L=($r,pr,Mr,Nr,Dr)=>($r>>>0)+(pr>>>0)+(Mr>>>0)+(Nr>>>0)+(Dr>>>0),add5H=($r,pr,Mr,Nr,Dr,Br)=>pr+Mr+Nr+Dr+Br+($r/2**32|0)|0,u64={fromBig,split,toBig,shrSH,shrSL,rotrSH,rotrSL,rotrBH,rotrBL,rotr32H,rotr32L,rotlSH,rotlSL,rotlBH,rotlBL,add,add3L,add3H,add4L,add4H,add5H,add5L},u64_default=u64,u8a=$r=>$r instanceof Uint8Array,u32=$r=>new Uint32Array($r.buffer,$r.byteOffset,Math.floor($r.byteLength/4)),isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!isLE)throw new Error("Non little-endian hardware is not supported");var hexes=Array.from({length:256},($r,pr)=>pr.toString(16).padStart(2,"0"));function bytesToHex($r){if(!u8a($r))throw new Error("Uint8Array expected");let pr="";for(let Mr=0;Mr<$r.length;Mr++)pr+=hexes[$r[Mr]];return pr}function utf8ToBytes($r){if(typeof $r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof $r}`);return new Uint8Array(new TextEncoder().encode($r))}function toBytes($r){if(typeof $r=="string"&&($r=utf8ToBytes($r)),!u8a($r))throw new Error(`expected Uint8Array, got ${typeof $r}`);return $r}var Hash=class{clone(){return this._cloneInto()}};function wrapConstructor($r){const pr=Nr=>$r().update(toBytes(Nr)).digest(),Mr=$r();return pr.outputLen=Mr.outputLen,pr.blockLen=Mr.blockLen,pr.create=()=>$r(),pr}function wrapXOFConstructorWithOpts($r){const pr=(Nr,Dr)=>$r(Dr).update(toBytes(Nr)).digest(),Mr=$r({});return pr.outputLen=Mr.outputLen,pr.blockLen=Mr.blockLen,pr.create=Nr=>$r(Nr),pr}var[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 $r=0,pr=_1n,Mr=1,Nr=0;$r<24;$r++){[Mr,Nr]=[Nr,(2*Mr+3*Nr)%5],SHA3_PI.push(2*(5*Nr+Mr)),SHA3_ROTL.push(($r+1)*($r+2)/2%64);let Dr=_0n;for(let Br=0;Br<7;Br++)pr=(pr<<_1n^(pr>>_7n)*_0x71n)%_256n,pr&_2n&&(Dr^=_1n<<(_1n<<BigInt(Br))-_1n);_SHA3_IOTA.push(Dr)}var[SHA3_IOTA_H,SHA3_IOTA_L]=u64_default.split(_SHA3_IOTA,!0),rotlH=($r,pr,Mr)=>Mr>32?u64_default.rotlBH($r,pr,Mr):u64_default.rotlSH($r,pr,Mr),rotlL=($r,pr,Mr)=>Mr>32?u64_default.rotlBL($r,pr,Mr):u64_default.rotlSL($r,pr,Mr);function keccakP($r,pr=24){const Mr=new Uint32Array(10);for(let Nr=24-pr;Nr<24;Nr++){for(let Lr=0;Lr<10;Lr++)Mr[Lr]=$r[Lr]^$r[Lr+10]^$r[Lr+20]^$r[Lr+30]^$r[Lr+40];for(let Lr=0;Lr<10;Lr+=2){const jr=(Lr+8)%10,Ur=(Lr+2)%10,Gr=Mr[Ur],Yr=Mr[Ur+1],Qr=rotlH(Gr,Yr,1)^Mr[jr],Wn=rotlL(Gr,Yr,1)^Mr[jr+1];for(let ga=0;ga<50;ga+=10)$r[Lr+ga]^=Qr,$r[Lr+ga+1]^=Wn}let Dr=$r[2],Br=$r[3];for(let Lr=0;Lr<24;Lr++){const jr=SHA3_ROTL[Lr],Ur=rotlH(Dr,Br,jr),Gr=rotlL(Dr,Br,jr),Yr=SHA3_PI[Lr];Dr=$r[Yr],Br=$r[Yr+1],$r[Yr]=Ur,$r[Yr+1]=Gr}for(let Lr=0;Lr<50;Lr+=10){for(let jr=0;jr<10;jr++)Mr[jr]=$r[Lr+jr];for(let jr=0;jr<10;jr++)$r[Lr+jr]^=~Mr[(jr+2)%10]&Mr[(jr+4)%10]}$r[0]^=SHA3_IOTA_H[Nr],$r[1]^=SHA3_IOTA_L[Nr]}Mr.fill(0)}var Keccak=class kE extends Hash{constructor(pr,Mr,Nr,Dr=!1,Br=24){if(super(),this.blockLen=pr,this.suffix=Mr,this.outputLen=Nr,this.enableXOF=Dr,this.rounds=Br,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,assert_default.number(Nr),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(){keccakP(this.state32,this.rounds),this.posOut=0,this.pos=0}update(pr){assert_default.exists(this);const{blockLen:Mr,state:Nr}=this;pr=toBytes(pr);const Dr=pr.length;for(let Br=0;Br<Dr;){const Lr=Math.min(Mr-this.pos,Dr-Br);for(let jr=0;jr<Lr;jr++)Nr[this.pos++]^=pr[Br++];this.pos===Mr&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:pr,suffix:Mr,pos:Nr,blockLen:Dr}=this;pr[Nr]^=Mr,Mr&128&&Nr===Dr-1&&this.keccak(),pr[Dr-1]^=128,this.keccak()}writeInto(pr){assert_default.exists(this,!1),assert_default.bytes(pr),this.finish();const Mr=this.state,{blockLen:Nr}=this;for(let Dr=0,Br=pr.length;Dr<Br;){this.posOut>=Nr&&this.keccak();const Lr=Math.min(Nr-this.posOut,Br-Dr);pr.set(Mr.subarray(this.posOut,this.posOut+Lr),Dr),this.posOut+=Lr,Dr+=Lr}return pr}xofInto(pr){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(pr)}xof(pr){return assert_default.number(pr),this.xofInto(new Uint8Array(pr))}digestInto(pr){if(assert_default.output(pr,this),this.finished)throw new Error("digest() was already called");return this.writeInto(pr),this.destroy(),pr}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(pr){const{blockLen:Mr,suffix:Nr,outputLen:Dr,rounds:Br,enableXOF:Lr}=this;return pr||(pr=new kE(Mr,Nr,Dr,Lr,Br)),pr.state32.set(this.state32),pr.pos=this.pos,pr.posOut=this.posOut,pr.finished=this.finished,pr.rounds=Br,pr.suffix=Nr,pr.outputLen=Dr,pr.enableXOF=Lr,pr.destroyed=this.destroyed,pr}},gen=($r,pr,Mr)=>wrapConstructor(()=>new Keccak(pr,$r,Mr));gen(6,144,224/8),gen(6,136,256/8),gen(6,104,384/8),gen(6,72,512/8),gen(1,144,224/8);var keccak_256=gen(1,136,256/8);gen(1,104,384/8),gen(1,72,512/8);var genShake=($r,pr,Mr)=>wrapXOFConstructorWithOpts((Nr={})=>new Keccak(pr,$r,Nr.dkLen===void 0?Mr:Nr.dkLen,!0));genShake(31,168,128/8),genShake(31,136,256/8);function wrapHash2($r){return pr=>(assert_default.bytes(pr),$r(pr))}(()=>{const $r=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,pr=typeof commonjsRequire=="function"&&commonjsRequire.bind(module);return{node:pr&&!$r?pr("crypto"):void 0,web:$r}})();var keccak256=(()=>{const $r=wrapHash2(keccak_256);return $r.create=keccak_256.create,$r})();function keccak256Hash($r,pr){const Mr=JSON.stringify(pick($r,pr)),Nr=new TextEncoder().encode(Mr),Dr=keccak256(Nr);return bytesToHex(Dr)}var pick=($r,pr)=>Object.fromEntries(pr.filter(Mr=>Mr in $r).map(Mr=>[Mr,$r[Mr]]));/*! Bundled license information:
|
|
201
|
+
*/(function(){var Gr=typeof Symbol=="function"&&Symbol.for,Yr=Gr?Symbol.for("react.element"):60103,Qr=Gr?Symbol.for("react.portal"):60106,Wn=Gr?Symbol.for("react.fragment"):60107,ga=Gr?Symbol.for("react.strict_mode"):60108,eo=Gr?Symbol.for("react.profiler"):60114,_i=Gr?Symbol.for("react.provider"):60109,va=Gr?Symbol.for("react.context"):60110,io=Gr?Symbol.for("react.async_mode"):60111,no=Gr?Symbol.for("react.concurrent_mode"):60111,so=Gr?Symbol.for("react.forward_ref"):60112,ao=Gr?Symbol.for("react.suspense"):60113,fo=Gr?Symbol.for("react.suspense_list"):60120,lo=Gr?Symbol.for("react.memo"):60115,oo=Gr?Symbol.for("react.lazy"):60116,po=Gr?Symbol.for("react.block"):60121,mo=Gr?Symbol.for("react.fundamental"):60117,$o=Gr?Symbol.for("react.responder"):60118,Xn=Gr?Symbol.for("react.scope"):60119;function Fr(su){return typeof su=="string"||typeof su=="function"||su===Wn||su===no||su===eo||su===ga||su===ao||su===fo||typeof su=="object"&&su!==null&&(su.$$typeof===oo||su.$$typeof===lo||su.$$typeof===_i||su.$$typeof===va||su.$$typeof===so||su.$$typeof===mo||su.$$typeof===$o||su.$$typeof===Xn||su.$$typeof===po)}function Vr(su){if(typeof su=="object"&&su!==null){var Ru=su.$$typeof;switch(Ru){case Yr:var tl=su.type;switch(tl){case io:case no:case Wn:case eo:case ga:case ao:return tl;default:var Pu=tl&&tl.$$typeof;switch(Pu){case va:case so:case oo:case lo:case _i:return Pu;default:return Ru}}case Qr:return Ru}}}var Wr=io,Jr=no,Gn=va,to=_i,ro=Yr,Un=so,Hr=Wn,Xr=oo,co=lo,ho=Qr,go=eo,bo=ga,Eo=ao,wo=!1;function Io(su){return wo||(wo=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),Po(su)||Vr(su)===io}function Po(su){return Vr(su)===no}function yo(su){return Vr(su)===va}function xo(su){return Vr(su)===_i}function Mo(su){return typeof su=="object"&&su!==null&&su.$$typeof===Yr}function qo(su){return Vr(su)===so}function pu(su){return Vr(su)===Wn}function nu(su){return Vr(su)===oo}function eu(su){return Vr(su)===lo}function Uu(su){return Vr(su)===Qr}function mu(su){return Vr(su)===eo}function Jo(su){return Vr(su)===ga}function Zu(su){return Vr(su)===ao}Ur.AsyncMode=Wr,Ur.ConcurrentMode=Jr,Ur.ContextConsumer=Gn,Ur.ContextProvider=to,Ur.Element=ro,Ur.ForwardRef=Un,Ur.Fragment=Hr,Ur.Lazy=Xr,Ur.Memo=co,Ur.Portal=ho,Ur.Profiler=go,Ur.StrictMode=bo,Ur.Suspense=Eo,Ur.isAsyncMode=Io,Ur.isConcurrentMode=Po,Ur.isContextConsumer=yo,Ur.isContextProvider=xo,Ur.isElement=Mo,Ur.isForwardRef=qo,Ur.isFragment=pu,Ur.isLazy=nu,Ur.isMemo=eu,Ur.isPortal=Uu,Ur.isProfiler=mu,Ur.isStrictMode=Jo,Ur.isSuspense=Zu,Ur.isValidElementType=Fr,Ur.typeOf=Vr})()},"./node_modules/react-is/index.js":(jr,Ur,Gr)=>{jr.exports=Gr("./node_modules/react-is/cjs/react-is.development.js")},"./node_modules/shallow-equal/dist/index.esm.js":(jr,Ur,Gr)=>{Gr.r(Ur),Gr.d(Ur,{shallowEqualArrays:()=>Qr,shallowEqualObjects:()=>Yr});function Yr(Wn,ga){if(Wn===ga)return!0;if(!Wn||!ga)return!1;var eo=Object.keys(Wn),_i=Object.keys(ga),va=eo.length;if(_i.length!==va)return!1;for(var io=0;io<va;io++){var no=eo[io];if(Wn[no]!==ga[no]||!Object.prototype.hasOwnProperty.call(ga,no))return!1}return!0}function Qr(Wn,ga){if(Wn===ga)return!0;if(!Wn||!ga)return!1;var eo=Wn.length;if(ga.length!==eo)return!1;for(var _i=0;_i<eo;_i++)if(Wn[_i]!==ga[_i])return!1;return!0}},"./src/Component.ts":function(jr,Ur,Gr){var Yr=this&&this.__rest||function(eo,_i){var va={};for(var io in eo)Object.prototype.hasOwnProperty.call(eo,io)&&_i.indexOf(io)<0&&(va[io]=eo[io]);if(eo!=null&&typeof Object.getOwnPropertySymbols=="function")for(var no=0,io=Object.getOwnPropertySymbols(eo);no<io.length;no++)_i.indexOf(io[no])<0&&Object.prototype.propertyIsEnumerable.call(eo,io[no])&&(va[io[no]]=eo[io[no]]);return va},Qr=this&&this.__importDefault||function(eo){return eo&&eo.__esModule?eo:{default:eo}};Object.defineProperty(Ur,"__esModule",{value:!0});var Wn=Qr(Gr("./src/useMediaQuery.ts")),ga=function(eo){var _i=eo.children,va=eo.device,io=eo.onChange,no=Yr(eo,["children","device","onChange"]),so=(0,Wn.default)(no,va,io);return typeof _i=="function"?_i(so):so?_i:null};Ur.default=ga},"./src/Context.ts":(jr,Ur,Gr)=>{Object.defineProperty(Ur,"__esModule",{value:!0});var Yr=Gr("react"),Qr=(0,Yr.createContext)(void 0);Ur.default=Qr},"./src/index.ts":function(jr,Ur,Gr){var Yr=this&&this.__importDefault||function(_i){return _i&&_i.__esModule?_i:{default:_i}};Object.defineProperty(Ur,"__esModule",{value:!0}),Ur.Context=Ur.toQuery=Ur.useMediaQuery=Ur.default=void 0;var Qr=Yr(Gr("./src/useMediaQuery.ts"));Ur.useMediaQuery=Qr.default;var Wn=Yr(Gr("./src/Component.ts"));Ur.default=Wn.default;var ga=Yr(Gr("./src/toQuery.ts"));Ur.toQuery=ga.default;var eo=Yr(Gr("./src/Context.ts"));Ur.Context=eo.default},"./src/mediaQuery.ts":function(jr,Ur,Gr){var Yr=this&&this.__assign||function(){return Yr=Object.assign||function(ao){for(var fo,lo=1,oo=arguments.length;lo<oo;lo++){fo=arguments[lo];for(var po in fo)Object.prototype.hasOwnProperty.call(fo,po)&&(ao[po]=fo[po])}return ao},Yr.apply(this,arguments)},Qr=this&&this.__rest||function(ao,fo){var lo={};for(var oo in ao)Object.prototype.hasOwnProperty.call(ao,oo)&&fo.indexOf(oo)<0&&(lo[oo]=ao[oo]);if(ao!=null&&typeof Object.getOwnPropertySymbols=="function")for(var po=0,oo=Object.getOwnPropertySymbols(ao);po<oo.length;po++)fo.indexOf(oo[po])<0&&Object.prototype.propertyIsEnumerable.call(ao,oo[po])&&(lo[oo[po]]=ao[oo[po]]);return lo},Wn=this&&this.__importDefault||function(ao){return ao&&ao.__esModule?ao:{default:ao}};Object.defineProperty(Ur,"__esModule",{value:!0});var ga=Wn(Gr("./node_modules/prop-types/index.js")),eo=ga.default.oneOfType([ga.default.string,ga.default.number]),_i={all:ga.default.bool,grid:ga.default.bool,aural:ga.default.bool,braille:ga.default.bool,handheld:ga.default.bool,print:ga.default.bool,projection:ga.default.bool,screen:ga.default.bool,tty:ga.default.bool,tv:ga.default.bool,embossed:ga.default.bool},va={orientation:ga.default.oneOf(["portrait","landscape"]),scan:ga.default.oneOf(["progressive","interlace"]),aspectRatio:ga.default.string,deviceAspectRatio:ga.default.string,height:eo,deviceHeight:eo,width:eo,deviceWidth:eo,color:ga.default.bool,colorIndex:ga.default.bool,monochrome:ga.default.bool,resolution:eo,type:Object.keys(_i)};va.type;var io=Qr(va,["type"]),no=Yr({minAspectRatio:ga.default.string,maxAspectRatio:ga.default.string,minDeviceAspectRatio:ga.default.string,maxDeviceAspectRatio:ga.default.string,minHeight:eo,maxHeight:eo,minDeviceHeight:eo,maxDeviceHeight:eo,minWidth:eo,maxWidth:eo,minDeviceWidth:eo,maxDeviceWidth:eo,minColor:ga.default.number,maxColor:ga.default.number,minColorIndex:ga.default.number,maxColorIndex:ga.default.number,minMonochrome:ga.default.number,maxMonochrome:ga.default.number,minResolution:eo,maxResolution:eo},io),so=Yr(Yr({},_i),no);Ur.default={all:so,types:_i,matchers:va,features:no}},"./src/toQuery.ts":function(jr,Ur,Gr){var Yr=this&&this.__importDefault||function(io){return io&&io.__esModule?io:{default:io}};Object.defineProperty(Ur,"__esModule",{value:!0});var Qr=Yr(Gr("./node_modules/hyphenate-style-name/index.js")),Wn=Yr(Gr("./src/mediaQuery.ts")),ga=function(io){return"not ".concat(io)},eo=function(io,no){var so=(0,Qr.default)(io);return typeof no=="number"&&(no="".concat(no,"px")),no===!0?so:no===!1?ga(so):"(".concat(so,": ").concat(no,")")},_i=function(io){return io.join(" and ")},va=function(io){var no=[];return Object.keys(Wn.default.all).forEach(function(so){var ao=io[so];ao!=null&&no.push(eo(so,ao))}),_i(no)};Ur.default=va},"./src/useMediaQuery.ts":function(jr,Ur,Gr){var Yr=this&&this.__importDefault||function(mo){return mo&&mo.__esModule?mo:{default:mo}};Object.defineProperty(Ur,"__esModule",{value:!0});var Qr=Gr("react"),Wn=Yr(Gr("./node_modules/matchmediaquery/index.js")),ga=Yr(Gr("./node_modules/hyphenate-style-name/index.js")),eo=Gr("./node_modules/shallow-equal/dist/index.esm.js"),_i=Yr(Gr("./src/toQuery.ts")),va=Yr(Gr("./src/Context.ts")),io=function(mo){return mo.query||(0,_i.default)(mo)},no=function(mo){if(mo){var $o=Object.keys(mo);return $o.reduce(function(Xn,Fr){return Xn[(0,ga.default)(Fr)]=mo[Fr],Xn},{})}},so=function(){var mo=(0,Qr.useRef)(!1);return(0,Qr.useEffect)(function(){mo.current=!0},[]),mo.current},ao=function(mo){var $o=(0,Qr.useContext)(va.default),Xn=function(){return no(mo)||no($o)},Fr=(0,Qr.useState)(Xn),Vr=Fr[0],Wr=Fr[1];return(0,Qr.useEffect)(function(){var Jr=Xn();(0,eo.shallowEqualObjects)(Vr,Jr)||Wr(Jr)},[mo,$o]),Vr},fo=function(mo){var $o=function(){return io(mo)},Xn=(0,Qr.useState)($o),Fr=Xn[0],Vr=Xn[1];return(0,Qr.useEffect)(function(){var Wr=$o();Fr!==Wr&&Vr(Wr)},[mo]),Fr},lo=function(mo,$o){var Xn=function(){return(0,Wn.default)(mo,$o||{},!!$o)},Fr=(0,Qr.useState)(Xn),Vr=Fr[0],Wr=Fr[1],Jr=so();return(0,Qr.useEffect)(function(){if(Jr){var Gn=Xn();return Wr(Gn),function(){Gn&&Gn.dispose()}}},[mo,$o]),Vr},oo=function(mo){var $o=(0,Qr.useState)(mo.matches),Xn=$o[0],Fr=$o[1];return(0,Qr.useEffect)(function(){var Vr=function(Wr){Fr(Wr.matches)};return mo.addListener(Vr),Fr(mo.matches),function(){mo.removeListener(Vr)}},[mo]),Xn},po=function(mo,$o,Xn){var Fr=ao($o),Vr=fo(mo);if(!Vr)throw new Error("Invalid or missing MediaQuery!");var Wr=lo(Vr,Fr),Jr=oo(Wr),Gn=so();return(0,Qr.useEffect)(function(){Gn&&Xn&&Xn(Jr)},[Jr]),(0,Qr.useEffect)(function(){return function(){Wr&&Wr.dispose()}},[]),Jr};Ur.default=po},react:jr=>{jr.exports=Mr}},Dr={};function Br(jr){var Ur=Dr[jr];if(Ur!==void 0)return Ur.exports;var Gr=Dr[jr]={exports:{}};return Nr[jr].call(Gr.exports,Gr,Gr.exports,Br),Gr.exports}Br.d=(jr,Ur)=>{for(var Gr in Ur)Br.o(Ur,Gr)&&!Br.o(jr,Gr)&&Object.defineProperty(jr,Gr,{enumerable:!0,get:Ur[Gr]})},Br.o=(jr,Ur)=>Object.prototype.hasOwnProperty.call(jr,Ur),Br.r=jr=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(jr,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(jr,"__esModule",{value:!0})};var Lr=Br("./src/index.ts");return Lr})())})(reactResponsive);var reactResponsiveExports=reactResponsive.exports;Object.defineProperty(Media,"__esModule",{value:!0});Media.useNotMobileMediaQuery=Media.useMobileMediaQuery=Media.useTabletAndBelowMediaQuery=Media.useTabletMediaQuery=Media.useDesktopMediaQuery=Media.useBigDesktopMediaQuery=NotMobile_1=Media.NotMobile=Mobile_1=Media.Mobile=Media.TabletAndBelow=Media.Tablet=Media.Desktop=void 0;var react_responsive_1=reactResponsiveExports,useBigDesktopMediaQuery=function(){return(0,react_responsive_1.useMediaQuery)({minWidth:1920})};Media.useBigDesktopMediaQuery=useBigDesktopMediaQuery;var useDesktopMediaQuery=function(){return(0,react_responsive_1.useMediaQuery)({minWidth:992})};Media.useDesktopMediaQuery=useDesktopMediaQuery;var useTabletMediaQuery=function(){return(0,react_responsive_1.useMediaQuery)({minWidth:768,maxWidth:991})};Media.useTabletMediaQuery=useTabletMediaQuery;var useTabletAndBelowMediaQuery=function(){return(0,react_responsive_1.useMediaQuery)({maxWidth:991})};Media.useTabletAndBelowMediaQuery=useTabletAndBelowMediaQuery;var useMobileMediaQuery=function(){return(0,react_responsive_1.useMediaQuery)({maxWidth:767})};Media.useMobileMediaQuery=useMobileMediaQuery;var useNotMobileMediaQuery=function(){return(0,react_responsive_1.useMediaQuery)({minWidth:768})};Media.useNotMobileMediaQuery=useNotMobileMediaQuery;var Desktop=function($r){var pr=$r.children,Mr=useDesktopMediaQuery();return Mr?pr:null};Media.Desktop=Desktop;var Tablet=function($r){var pr=$r.children,Mr=useTabletMediaQuery();return Mr?pr:null};Media.Tablet=Tablet;var TabletAndBelow=function($r){var pr=$r.children,Mr=useTabletAndBelowMediaQuery();return Mr?pr:null};Media.TabletAndBelow=TabletAndBelow;var Mobile=function($r){var pr=$r.children,Mr=useMobileMediaQuery();return Mr?pr:null},Mobile_1=Media.Mobile=Mobile,NotMobile=function($r){var pr=$r.children,Mr=useNotMobileMediaQuery();return Mr?pr:null},NotMobile_1=Media.NotMobile=NotMobile;const backImg="https://cdn.decentraland.org/@dcl/auth-site/1.3.2-7900126256.commit-8819962/assets/back-26d3dbd9.svg",diceImg="https://cdn.decentraland.org/@dcl/auth-site/1.3.2-7900126256.commit-8819962/assets/dice-b919368b.svg",logoSrc="https://cdn.decentraland.org/@dcl/auth-site/1.3.2-7900126256.commit-8819962/assets/logo-9a364aec.svg",wrongImg="https://cdn.decentraland.org/@dcl/auth-site/1.3.2-7900126256.commit-8819962/assets/wrong-1ccde1e7.svg",useAfterLoginRedirection=()=>{const $r=useLocation(),Mr=new URLSearchParams($r.search).get("redirectTo"),Nr=Mr?decodeURIComponent(Mr):null;if(Nr!==null)try{let Dr;return Nr.startsWith("/")?Dr=new URL(Nr,window.location.origin):Dr=new URL(Nr),Dr.hostname!==window.location.hostname?void 0:Dr.href}catch{console.error("Can't parse redirectTo URL");return}};var FeatureFlagsKeys=($r=>($r.SIMPLIFIED_AVATAR_SETUP="dapps-simplified-avatar-setup",$r))(FeatureFlagsKeys||{});const defaultFeatureFlagsContextValue={flags:{},initialized:!1},FeatureFlagsContext=reactExports.createContext(defaultFeatureFlagsContextValue),FeatureFlagsProvider=$r=>{const[pr,Mr]=reactExports.useState(defaultFeatureFlagsContextValue),[Nr,Dr]=reactExports.useState(!0),Br=reactExports.useRef();return reactExports.useEffect(()=>{(async()=>{if(Nr){Dr(!1);const Lr=config.get("FEATURE_FLAGS_URL"),Ur=await(await fetch(`${Lr}/dapps.json`)).json();Mr({...pr,flags:Ur.flags,initialized:!0})}})()},[Nr]),reactExports.useEffect(()=>{const Lr=config.get("FEATURE_FLAGS_INTERVAL");return Br.current=setInterval(()=>{Dr(!0)},Number(Lr)),()=>{clearInterval(Br.current)}},[]),jsxRuntimeExports.jsx(FeatureFlagsContext.Provider,{value:pr,children:$r.children})};var dist$3={},fetcher$1={},environment={};Object.defineProperty(environment,"__esModule",{value:!0});environment.isUsingNode=void 0;function isUsingNode(){return typeof process$1<"u"&&process$1.release&&process$1.release.name==="node"}environment.isUsingNode=isUsingNode;var __createBinding$3=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function($r,pr,Mr,Nr){Nr===void 0&&(Nr=Mr);var Dr=Object.getOwnPropertyDescriptor(pr,Mr);(!Dr||("get"in Dr?!pr.__esModule:Dr.writable||Dr.configurable))&&(Dr={enumerable:!0,get:function(){return pr[Mr]}}),Object.defineProperty($r,Nr,Dr)}:function($r,pr,Mr,Nr){Nr===void 0&&(Nr=Mr),$r[Nr]=pr[Mr]}),__setModuleDefault$3=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function($r,pr){Object.defineProperty($r,"default",{enumerable:!0,value:pr})}:function($r,pr){$r.default=pr}),__importStar$3=commonjsGlobal&&commonjsGlobal.__importStar||function($r){if($r&&$r.__esModule)return $r;var pr={};if($r!=null)for(var Mr in $r)Mr!=="default"&&Object.prototype.hasOwnProperty.call($r,Mr)&&__createBinding$3(pr,$r,Mr);return __setModuleDefault$3(pr,$r),pr},__rest=commonjsGlobal&&commonjsGlobal.__rest||function($r,pr){var Mr={};for(var Nr in $r)Object.prototype.hasOwnProperty.call($r,Nr)&&pr.indexOf(Nr)<0&&(Mr[Nr]=$r[Nr]);if($r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Dr=0,Nr=Object.getOwnPropertySymbols($r);Dr<Nr.length;Dr++)pr.indexOf(Nr[Dr])<0&&Object.prototype.propertyIsEnumerable.call($r,Nr[Dr])&&(Mr[Nr[Dr]]=$r[Nr[Dr]]);return Mr};Object.defineProperty(fetcher$1,"__esModule",{value:!0});fetcher$1.createFetchComponent=void 0;const crossFetch=__importStar$3(browserPonyfillExports),environment_1=environment,NON_RETRYABLE_STATUS_CODES=[400,401,403,404],IDEMPOTENT_HTTP_METHODS=["GET","HEAD","OPTIONS","PUT","DELETE"];async function fetchWithRetriesAndTimeout($r,pr){const{timeout:Mr,abortController:Nr,signal:Dr,retryDelay:Br}=pr;let Lr=pr.attempts,jr=null,Ur;do try{Mr&&(jr=setTimeout(()=>{Nr.abort()},Mr));const Gr=crossFetch.default($r.toString(),Object.assign(Object.assign({},pr),{signal:Dr})),Yr=Promise.race([Gr,new Promise((Qr,Wn)=>{Dr.addEventListener("abort",()=>{Qr(new crossFetch.Response("timeout",{status:408,statusText:"Request Timeout"}))})})]);--Lr,Ur=await Yr,jr&&clearTimeout(jr)}finally{if(Ur&&(Ur.ok||NON_RETRYABLE_STATUS_CODES.includes(Ur.status)||Lr===0))break;await new Promise(Gr=>setTimeout(Gr,Br))}while((!Ur||!Ur.ok)&&Lr>0);return Ur}function createFetchComponent($r){async function pr(Mr,Nr){const Br=Object.assign(Object.assign({},$r==null?void 0:$r.defaultFetcherOptions),Nr)||{},{timeout:Lr,method:jr="GET",retryDelay:Ur=0,abortController:Gr}=Br,Yr=__rest(Br,["timeout","method","retryDelay","abortController"]);let Qr=Yr.attempts||1;const Wn=Gr||new AbortController,{signal:ga}=Wn;$r!=null&&$r.defaultHeaders&&(Yr.headers=Object.assign(Object.assign({},$r==null?void 0:$r.defaultHeaders),Yr.headers||{})),IDEMPOTENT_HTTP_METHODS.includes(jr.toUpperCase())||(Qr=1);const eo=await fetchWithRetriesAndTimeout(Mr,Object.assign(Object.assign({},Yr),{attempts:Qr,method:jr,timeout:Lr,retryDelay:Ur,signal:ga,abortController:Wn}));if(!(eo!=null&&eo.ok)){const _i=await(eo==null?void 0:eo.text());throw new Error(`Failed to fetch ${Mr}. Got status ${eo==null?void 0:eo.status}. Response was '${_i}'`)}return!(0,environment_1.isUsingNode)()&&eo&&Object.defineProperty(eo,"buffer",{value:async function(){return Buffer$G.from(await eo.arrayBuffer())},configurable:!0}),ga.aborted?void 0:eo}return{fetch:pr}}fetcher$1.createFetchComponent=createFetchComponent;(function($r){Object.defineProperty($r,"__esModule",{value:!0}),$r.createFetchComponent=void 0;var pr=fetcher$1;Object.defineProperty($r,"createFetchComponent",{enumerable:!0,get:function(){return pr.createFetchComponent}})})(dist$3);var dist$2={},CatalystClient={},ContentClient={},dist$1={exports:{}};dist$1.exports;(function(module){var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__commonJS=($r,pr)=>function(){return pr||(0,$r[__getOwnPropNames($r)[0]])((pr={exports:{}}).exports,pr),pr.exports},__export=($r,pr)=>{for(var Mr in pr)__defProp($r,Mr,{get:pr[Mr],enumerable:!0})},__copyProps=($r,pr,Mr,Nr)=>{if(pr&&typeof pr=="object"||typeof pr=="function")for(let Dr of __getOwnPropNames(pr))!__hasOwnProp.call($r,Dr)&&Dr!==Mr&&__defProp($r,Dr,{get:()=>pr[Dr],enumerable:!(Nr=__getOwnPropDesc(pr,Dr))||Nr.enumerable});return $r},__toESM=($r,pr,Mr)=>(Mr=$r!=null?__create(__getProtoOf($r)):{},__copyProps(pr||!$r||!$r.__esModule?__defProp(Mr,"default",{value:$r,enumerable:!0}):Mr,$r)),__toCommonJS=$r=>__copyProps(__defProp({},"__esModule",{value:!0}),$r),require_err_code=__commonJS({"node_modules/err-code/index.js"($r,pr){function Mr(Dr,Br){for(const Lr in Br)Object.defineProperty(Dr,Lr,{value:Br[Lr],enumerable:!0,configurable:!0});return Dr}function Nr(Dr,Br,Lr){if(!Dr||typeof Dr=="string")throw new TypeError("Please pass an Error to err-code");Lr||(Lr={}),typeof Br=="object"&&(Lr=Br,Br=""),Br&&(Lr.code=Br);try{return Mr(Dr,Lr)}catch{Lr.message=Dr.message,Lr.stack=Dr.stack;const Ur=function(){};return Ur.prototype=Object.create(Object.getPrototypeOf(Dr)),Mr(new Ur,Lr)}}pr.exports=Nr}}),require_aspromise=__commonJS({"node_modules/@protobufjs/aspromise/index.js"($r,pr){pr.exports=Mr;function Mr(Nr,Dr){for(var Br=new Array(arguments.length-1),Lr=0,jr=2,Ur=!0;jr<arguments.length;)Br[Lr++]=arguments[jr++];return new Promise(function(Yr,Qr){Br[Lr]=function(ga){if(Ur)if(Ur=!1,ga)Qr(ga);else{for(var eo=new Array(arguments.length-1),_i=0;_i<eo.length;)eo[_i++]=arguments[_i];Yr.apply(null,eo)}};try{Nr.apply(Dr||null,Br)}catch(Wn){Ur&&(Ur=!1,Qr(Wn))}})}}}),require_base64=__commonJS({"node_modules/@protobufjs/base64/index.js"($r){var pr=$r;pr.length=function(jr){var Ur=jr.length;if(!Ur)return 0;for(var Gr=0;--Ur%4>1&&jr.charAt(Ur)==="=";)++Gr;return Math.ceil(jr.length*3)/4-Gr};var Mr=new Array(64),Nr=new Array(123);for(Dr=0;Dr<64;)Nr[Mr[Dr]=Dr<26?Dr+65:Dr<52?Dr+71:Dr<62?Dr-4:Dr-59|43]=Dr++;var Dr;pr.encode=function(jr,Ur,Gr){for(var Yr=null,Qr=[],Wn=0,ga=0,eo;Ur<Gr;){var _i=jr[Ur++];switch(ga){case 0:Qr[Wn++]=Mr[_i>>2],eo=(_i&3)<<4,ga=1;break;case 1:Qr[Wn++]=Mr[eo|_i>>4],eo=(_i&15)<<2,ga=2;break;case 2:Qr[Wn++]=Mr[eo|_i>>6],Qr[Wn++]=Mr[_i&63],ga=0;break}Wn>8191&&((Yr||(Yr=[])).push(String.fromCharCode.apply(String,Qr)),Wn=0)}return ga&&(Qr[Wn++]=Mr[eo],Qr[Wn++]=61,ga===1&&(Qr[Wn++]=61)),Yr?(Wn&&Yr.push(String.fromCharCode.apply(String,Qr.slice(0,Wn))),Yr.join("")):String.fromCharCode.apply(String,Qr.slice(0,Wn))};var Br="invalid encoding";pr.decode=function(jr,Ur,Gr){for(var Yr=Gr,Qr=0,Wn,ga=0;ga<jr.length;){var eo=jr.charCodeAt(ga++);if(eo===61&&Qr>1)break;if((eo=Nr[eo])===void 0)throw Error(Br);switch(Qr){case 0:Wn=eo,Qr=1;break;case 1:Ur[Gr++]=Wn<<2|(eo&48)>>4,Wn=eo,Qr=2;break;case 2:Ur[Gr++]=(Wn&15)<<4|(eo&60)>>2,Wn=eo,Qr=3;break;case 3:Ur[Gr++]=(Wn&3)<<6|eo,Qr=0;break}}if(Qr===1)throw Error(Br);return Gr-Yr},pr.test=function(jr){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(jr)}}}),require_eventemitter=__commonJS({"node_modules/@protobufjs/eventemitter/index.js"($r,pr){pr.exports=Mr;function Mr(){this._listeners={}}Mr.prototype.on=function(Dr,Br,Lr){return(this._listeners[Dr]||(this._listeners[Dr]=[])).push({fn:Br,ctx:Lr||this}),this},Mr.prototype.off=function(Dr,Br){if(Dr===void 0)this._listeners={};else if(Br===void 0)this._listeners[Dr]=[];else for(var Lr=this._listeners[Dr],jr=0;jr<Lr.length;)Lr[jr].fn===Br?Lr.splice(jr,1):++jr;return this},Mr.prototype.emit=function(Dr){var Br=this._listeners[Dr];if(Br){for(var Lr=[],jr=1;jr<arguments.length;)Lr.push(arguments[jr++]);for(jr=0;jr<Br.length;)Br[jr].fn.apply(Br[jr++].ctx,Lr)}return this}}}),require_float=__commonJS({"node_modules/@protobufjs/float/index.js"($r,pr){pr.exports=Mr(Mr);function Mr(jr){return typeof Float32Array<"u"?function(){var Ur=new Float32Array([-0]),Gr=new Uint8Array(Ur.buffer),Yr=Gr[3]===128;function Qr(_i,va,io){Ur[0]=_i,va[io]=Gr[0],va[io+1]=Gr[1],va[io+2]=Gr[2],va[io+3]=Gr[3]}function Wn(_i,va,io){Ur[0]=_i,va[io]=Gr[3],va[io+1]=Gr[2],va[io+2]=Gr[1],va[io+3]=Gr[0]}jr.writeFloatLE=Yr?Qr:Wn,jr.writeFloatBE=Yr?Wn:Qr;function ga(_i,va){return Gr[0]=_i[va],Gr[1]=_i[va+1],Gr[2]=_i[va+2],Gr[3]=_i[va+3],Ur[0]}function eo(_i,va){return Gr[3]=_i[va],Gr[2]=_i[va+1],Gr[1]=_i[va+2],Gr[0]=_i[va+3],Ur[0]}jr.readFloatLE=Yr?ga:eo,jr.readFloatBE=Yr?eo:ga}():function(){function Ur(Yr,Qr,Wn,ga){var eo=Qr<0?1:0;if(eo&&(Qr=-Qr),Qr===0)Yr(1/Qr>0?0:2147483648,Wn,ga);else if(isNaN(Qr))Yr(2143289344,Wn,ga);else if(Qr>34028234663852886e22)Yr((eo<<31|2139095040)>>>0,Wn,ga);else if(Qr<11754943508222875e-54)Yr((eo<<31|Math.round(Qr/1401298464324817e-60))>>>0,Wn,ga);else{var _i=Math.floor(Math.log(Qr)/Math.LN2),va=Math.round(Qr*Math.pow(2,-_i)*8388608)&8388607;Yr((eo<<31|_i+127<<23|va)>>>0,Wn,ga)}}jr.writeFloatLE=Ur.bind(null,Nr),jr.writeFloatBE=Ur.bind(null,Dr);function Gr(Yr,Qr,Wn){var ga=Yr(Qr,Wn),eo=(ga>>31)*2+1,_i=ga>>>23&255,va=ga&8388607;return _i===255?va?NaN:eo*(1/0):_i===0?eo*1401298464324817e-60*va:eo*Math.pow(2,_i-150)*(va+8388608)}jr.readFloatLE=Gr.bind(null,Br),jr.readFloatBE=Gr.bind(null,Lr)}(),typeof Float64Array<"u"?function(){var Ur=new Float64Array([-0]),Gr=new Uint8Array(Ur.buffer),Yr=Gr[7]===128;function Qr(_i,va,io){Ur[0]=_i,va[io]=Gr[0],va[io+1]=Gr[1],va[io+2]=Gr[2],va[io+3]=Gr[3],va[io+4]=Gr[4],va[io+5]=Gr[5],va[io+6]=Gr[6],va[io+7]=Gr[7]}function Wn(_i,va,io){Ur[0]=_i,va[io]=Gr[7],va[io+1]=Gr[6],va[io+2]=Gr[5],va[io+3]=Gr[4],va[io+4]=Gr[3],va[io+5]=Gr[2],va[io+6]=Gr[1],va[io+7]=Gr[0]}jr.writeDoubleLE=Yr?Qr:Wn,jr.writeDoubleBE=Yr?Wn:Qr;function ga(_i,va){return Gr[0]=_i[va],Gr[1]=_i[va+1],Gr[2]=_i[va+2],Gr[3]=_i[va+3],Gr[4]=_i[va+4],Gr[5]=_i[va+5],Gr[6]=_i[va+6],Gr[7]=_i[va+7],Ur[0]}function eo(_i,va){return Gr[7]=_i[va],Gr[6]=_i[va+1],Gr[5]=_i[va+2],Gr[4]=_i[va+3],Gr[3]=_i[va+4],Gr[2]=_i[va+5],Gr[1]=_i[va+6],Gr[0]=_i[va+7],Ur[0]}jr.readDoubleLE=Yr?ga:eo,jr.readDoubleBE=Yr?eo:ga}():function(){function Ur(Yr,Qr,Wn,ga,eo,_i){var va=ga<0?1:0;if(va&&(ga=-ga),ga===0)Yr(0,eo,_i+Qr),Yr(1/ga>0?0:2147483648,eo,_i+Wn);else if(isNaN(ga))Yr(0,eo,_i+Qr),Yr(2146959360,eo,_i+Wn);else if(ga>17976931348623157e292)Yr(0,eo,_i+Qr),Yr((va<<31|2146435072)>>>0,eo,_i+Wn);else{var io;if(ga<22250738585072014e-324)io=ga/5e-324,Yr(io>>>0,eo,_i+Qr),Yr((va<<31|io/4294967296)>>>0,eo,_i+Wn);else{var no=Math.floor(Math.log(ga)/Math.LN2);no===1024&&(no=1023),io=ga*Math.pow(2,-no),Yr(io*4503599627370496>>>0,eo,_i+Qr),Yr((va<<31|no+1023<<20|io*1048576&1048575)>>>0,eo,_i+Wn)}}}jr.writeDoubleLE=Ur.bind(null,Nr,0,4),jr.writeDoubleBE=Ur.bind(null,Dr,4,0);function Gr(Yr,Qr,Wn,ga,eo){var _i=Yr(ga,eo+Qr),va=Yr(ga,eo+Wn),io=(va>>31)*2+1,no=va>>>20&2047,so=4294967296*(va&1048575)+_i;return no===2047?so?NaN:io*(1/0):no===0?io*5e-324*so:io*Math.pow(2,no-1075)*(so+4503599627370496)}jr.readDoubleLE=Gr.bind(null,Br,0,4),jr.readDoubleBE=Gr.bind(null,Lr,4,0)}(),jr}function Nr(jr,Ur,Gr){Ur[Gr]=jr&255,Ur[Gr+1]=jr>>>8&255,Ur[Gr+2]=jr>>>16&255,Ur[Gr+3]=jr>>>24}function Dr(jr,Ur,Gr){Ur[Gr]=jr>>>24,Ur[Gr+1]=jr>>>16&255,Ur[Gr+2]=jr>>>8&255,Ur[Gr+3]=jr&255}function Br(jr,Ur){return(jr[Ur]|jr[Ur+1]<<8|jr[Ur+2]<<16|jr[Ur+3]<<24)>>>0}function Lr(jr,Ur){return(jr[Ur]<<24|jr[Ur+1]<<16|jr[Ur+2]<<8|jr[Ur+3])>>>0}}}),require_inquire=__commonJS({"node_modules/@protobufjs/inquire/index.js"(exports,module){module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch($r){}return null}}}),require_utf8=__commonJS({"node_modules/@protobufjs/utf8/index.js"($r){var pr=$r;pr.length=function(Nr){for(var Dr=0,Br=0,Lr=0;Lr<Nr.length;++Lr)Br=Nr.charCodeAt(Lr),Br<128?Dr+=1:Br<2048?Dr+=2:(Br&64512)===55296&&(Nr.charCodeAt(Lr+1)&64512)===56320?(++Lr,Dr+=4):Dr+=3;return Dr},pr.read=function(Nr,Dr,Br){var Lr=Br-Dr;if(Lr<1)return"";for(var jr=null,Ur=[],Gr=0,Yr;Dr<Br;)Yr=Nr[Dr++],Yr<128?Ur[Gr++]=Yr:Yr>191&&Yr<224?Ur[Gr++]=(Yr&31)<<6|Nr[Dr++]&63:Yr>239&&Yr<365?(Yr=((Yr&7)<<18|(Nr[Dr++]&63)<<12|(Nr[Dr++]&63)<<6|Nr[Dr++]&63)-65536,Ur[Gr++]=55296+(Yr>>10),Ur[Gr++]=56320+(Yr&1023)):Ur[Gr++]=(Yr&15)<<12|(Nr[Dr++]&63)<<6|Nr[Dr++]&63,Gr>8191&&((jr||(jr=[])).push(String.fromCharCode.apply(String,Ur)),Gr=0);return jr?(Gr&&jr.push(String.fromCharCode.apply(String,Ur.slice(0,Gr))),jr.join("")):String.fromCharCode.apply(String,Ur.slice(0,Gr))},pr.write=function(Nr,Dr,Br){for(var Lr=Br,jr,Ur,Gr=0;Gr<Nr.length;++Gr)jr=Nr.charCodeAt(Gr),jr<128?Dr[Br++]=jr:jr<2048?(Dr[Br++]=jr>>6|192,Dr[Br++]=jr&63|128):(jr&64512)===55296&&((Ur=Nr.charCodeAt(Gr+1))&64512)===56320?(jr=65536+((jr&1023)<<10)+(Ur&1023),++Gr,Dr[Br++]=jr>>18|240,Dr[Br++]=jr>>12&63|128,Dr[Br++]=jr>>6&63|128,Dr[Br++]=jr&63|128):(Dr[Br++]=jr>>12|224,Dr[Br++]=jr>>6&63|128,Dr[Br++]=jr&63|128);return Br-Lr}}}),require_pool=__commonJS({"node_modules/@protobufjs/pool/index.js"($r,pr){pr.exports=Mr;function Mr(Nr,Dr,Br){var Lr=Br||8192,jr=Lr>>>1,Ur=null,Gr=Lr;return function(Qr){if(Qr<1||Qr>jr)return Nr(Qr);Gr+Qr>Lr&&(Ur=Nr(Lr),Gr=0);var Wn=Dr.call(Ur,Gr,Gr+=Qr);return Gr&7&&(Gr=(Gr|7)+1),Wn}}}}),require_longbits=__commonJS({"node_modules/protobufjs/src/util/longbits.js"($r,pr){pr.exports=Nr;var Mr=require_minimal();function Nr(jr,Ur){this.lo=jr>>>0,this.hi=Ur>>>0}var Dr=Nr.zero=new Nr(0,0);Dr.toNumber=function(){return 0},Dr.zzEncode=Dr.zzDecode=function(){return this},Dr.length=function(){return 1};var Br=Nr.zeroHash="\0\0\0\0\0\0\0\0";Nr.fromNumber=function(Ur){if(Ur===0)return Dr;var Gr=Ur<0;Gr&&(Ur=-Ur);var Yr=Ur>>>0,Qr=(Ur-Yr)/4294967296>>>0;return Gr&&(Qr=~Qr>>>0,Yr=~Yr>>>0,++Yr>4294967295&&(Yr=0,++Qr>4294967295&&(Qr=0))),new Nr(Yr,Qr)},Nr.from=function(Ur){if(typeof Ur=="number")return Nr.fromNumber(Ur);if(Mr.isString(Ur))if(Mr.Long)Ur=Mr.Long.fromString(Ur);else return Nr.fromNumber(parseInt(Ur,10));return Ur.low||Ur.high?new Nr(Ur.low>>>0,Ur.high>>>0):Dr},Nr.prototype.toNumber=function(Ur){if(!Ur&&this.hi>>>31){var Gr=~this.lo+1>>>0,Yr=~this.hi>>>0;return Gr||(Yr=Yr+1>>>0),-(Gr+Yr*4294967296)}return this.lo+this.hi*4294967296},Nr.prototype.toLong=function(Ur){return Mr.Long?new Mr.Long(this.lo|0,this.hi|0,!!Ur):{low:this.lo|0,high:this.hi|0,unsigned:!!Ur}};var Lr=String.prototype.charCodeAt;Nr.fromHash=function(Ur){return Ur===Br?Dr:new Nr((Lr.call(Ur,0)|Lr.call(Ur,1)<<8|Lr.call(Ur,2)<<16|Lr.call(Ur,3)<<24)>>>0,(Lr.call(Ur,4)|Lr.call(Ur,5)<<8|Lr.call(Ur,6)<<16|Lr.call(Ur,7)<<24)>>>0)},Nr.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},Nr.prototype.zzEncode=function(){var Ur=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^Ur)>>>0,this.lo=(this.lo<<1^Ur)>>>0,this},Nr.prototype.zzDecode=function(){var Ur=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^Ur)>>>0,this.hi=(this.hi>>>1^Ur)>>>0,this},Nr.prototype.length=function(){var Ur=this.lo,Gr=(this.lo>>>28|this.hi<<4)>>>0,Yr=this.hi>>>24;return Yr===0?Gr===0?Ur<16384?Ur<128?1:2:Ur<2097152?3:4:Gr<16384?Gr<128?5:6:Gr<2097152?7:8:Yr<128?9:10}}}),require_minimal=__commonJS({"node_modules/protobufjs/src/util/minimal.js"($r){var pr=$r;pr.asPromise=require_aspromise(),pr.base64=require_base64(),pr.EventEmitter=require_eventemitter(),pr.float=require_float(),pr.inquire=require_inquire(),pr.utf8=require_utf8(),pr.pool=require_pool(),pr.LongBits=require_longbits(),pr.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),pr.global=pr.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||$r,pr.emptyArray=Object.freeze?Object.freeze([]):[],pr.emptyObject=Object.freeze?Object.freeze({}):{},pr.isInteger=Number.isInteger||function(Br){return typeof Br=="number"&&isFinite(Br)&&Math.floor(Br)===Br},pr.isString=function(Br){return typeof Br=="string"||Br instanceof String},pr.isObject=function(Br){return Br&&typeof Br=="object"},pr.isset=pr.isSet=function(Br,Lr){var jr=Br[Lr];return jr!=null&&Br.hasOwnProperty(Lr)?typeof jr!="object"||(Array.isArray(jr)?jr.length:Object.keys(jr).length)>0:!1},pr.Buffer=function(){try{var Dr=pr.inquire("buffer").Buffer;return Dr.prototype.utf8Write?Dr:null}catch{return null}}(),pr._Buffer_from=null,pr._Buffer_allocUnsafe=null,pr.newBuffer=function(Br){return typeof Br=="number"?pr.Buffer?pr._Buffer_allocUnsafe(Br):new pr.Array(Br):pr.Buffer?pr._Buffer_from(Br):typeof Uint8Array>"u"?Br:new Uint8Array(Br)},pr.Array=typeof Uint8Array<"u"?Uint8Array:Array,pr.Long=pr.global.dcodeIO&&pr.global.dcodeIO.Long||pr.global.Long||pr.inquire("long"),pr.key2Re=/^true|false|0|1$/,pr.key32Re=/^-?(?:0|[1-9][0-9]*)$/,pr.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,pr.longToHash=function(Br){return Br?pr.LongBits.from(Br).toHash():pr.LongBits.zeroHash},pr.longFromHash=function(Br,Lr){var jr=pr.LongBits.fromHash(Br);return pr.Long?pr.Long.fromBits(jr.lo,jr.hi,Lr):jr.toNumber(!!Lr)};function Mr(Dr,Br,Lr){for(var jr=Object.keys(Br),Ur=0;Ur<jr.length;++Ur)(Dr[jr[Ur]]===void 0||!Lr)&&(Dr[jr[Ur]]=Br[jr[Ur]]);return Dr}pr.merge=Mr,pr.lcFirst=function(Br){return Br.charAt(0).toLowerCase()+Br.substring(1)};function Nr(Dr){function Br(Lr,jr){if(!(this instanceof Br))return new Br(Lr,jr);Object.defineProperty(this,"message",{get:function(){return Lr}}),Error.captureStackTrace?Error.captureStackTrace(this,Br):Object.defineProperty(this,"stack",{value:new Error().stack||""}),jr&&Mr(this,jr)}return Br.prototype=Object.create(Error.prototype,{constructor:{value:Br,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return Dr},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),Br}pr.newError=Nr,pr.ProtocolError=Nr("ProtocolError"),pr.oneOfGetter=function(Br){for(var Lr={},jr=0;jr<Br.length;++jr)Lr[Br[jr]]=1;return function(){for(var Ur=Object.keys(this),Gr=Ur.length-1;Gr>-1;--Gr)if(Lr[Ur[Gr]]===1&&this[Ur[Gr]]!==void 0&&this[Ur[Gr]]!==null)return Ur[Gr]}},pr.oneOfSetter=function(Br){return function(Lr){for(var jr=0;jr<Br.length;++jr)Br[jr]!==Lr&&delete this[Br[jr]]}},pr.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},pr._configure=function(){var Dr=pr.Buffer;if(!Dr){pr._Buffer_from=pr._Buffer_allocUnsafe=null;return}pr._Buffer_from=Dr.from!==Uint8Array.from&&Dr.from||function(Lr,jr){return new Dr(Lr,jr)},pr._Buffer_allocUnsafe=Dr.allocUnsafe||function(Lr){return new Dr(Lr)}}}}),require_reader=__commonJS({"node_modules/protobufjs/src/reader.js"($r,pr){pr.exports=jr;var Mr=require_minimal(),Nr,Dr=Mr.LongBits,Br=Mr.utf8;function Lr(ga,eo){return RangeError("index out of range: "+ga.pos+" + "+(eo||1)+" > "+ga.len)}function jr(ga){this.buf=ga,this.pos=0,this.len=ga.length}var Ur=typeof Uint8Array<"u"?function(eo){if(eo instanceof Uint8Array||Array.isArray(eo))return new jr(eo);throw Error("illegal buffer")}:function(eo){if(Array.isArray(eo))return new jr(eo);throw Error("illegal buffer")},Gr=function(){return Mr.Buffer?function(_i){return(jr.create=function(io){return Mr.Buffer.isBuffer(io)?new Nr(io):Ur(io)})(_i)}:Ur};jr.create=Gr(),jr.prototype._slice=Mr.Array.prototype.subarray||Mr.Array.prototype.slice,jr.prototype.uint32=function(){var eo=4294967295;return function(){if(eo=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(eo=(eo|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(eo=(eo|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(eo=(eo|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(eo=(eo|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return eo;if((this.pos+=5)>this.len)throw this.pos=this.len,Lr(this,10);return eo}}(),jr.prototype.int32=function(){return this.uint32()|0},jr.prototype.sint32=function(){var eo=this.uint32();return eo>>>1^-(eo&1)|0};function Yr(){var ga=new Dr(0,0),eo=0;if(this.len-this.pos>4){for(;eo<4;++eo)if(ga.lo=(ga.lo|(this.buf[this.pos]&127)<<eo*7)>>>0,this.buf[this.pos++]<128)return ga;if(ga.lo=(ga.lo|(this.buf[this.pos]&127)<<28)>>>0,ga.hi=(ga.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return ga;eo=0}else{for(;eo<3;++eo){if(this.pos>=this.len)throw Lr(this);if(ga.lo=(ga.lo|(this.buf[this.pos]&127)<<eo*7)>>>0,this.buf[this.pos++]<128)return ga}return ga.lo=(ga.lo|(this.buf[this.pos++]&127)<<eo*7)>>>0,ga}if(this.len-this.pos>4){for(;eo<5;++eo)if(ga.hi=(ga.hi|(this.buf[this.pos]&127)<<eo*7+3)>>>0,this.buf[this.pos++]<128)return ga}else for(;eo<5;++eo){if(this.pos>=this.len)throw Lr(this);if(ga.hi=(ga.hi|(this.buf[this.pos]&127)<<eo*7+3)>>>0,this.buf[this.pos++]<128)return ga}throw Error("invalid varint encoding")}jr.prototype.bool=function(){return this.uint32()!==0};function Qr(ga,eo){return(ga[eo-4]|ga[eo-3]<<8|ga[eo-2]<<16|ga[eo-1]<<24)>>>0}jr.prototype.fixed32=function(){if(this.pos+4>this.len)throw Lr(this,4);return Qr(this.buf,this.pos+=4)},jr.prototype.sfixed32=function(){if(this.pos+4>this.len)throw Lr(this,4);return Qr(this.buf,this.pos+=4)|0};function Wn(){if(this.pos+8>this.len)throw Lr(this,8);return new Dr(Qr(this.buf,this.pos+=4),Qr(this.buf,this.pos+=4))}jr.prototype.float=function(){if(this.pos+4>this.len)throw Lr(this,4);var eo=Mr.float.readFloatLE(this.buf,this.pos);return this.pos+=4,eo},jr.prototype.double=function(){if(this.pos+8>this.len)throw Lr(this,4);var eo=Mr.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,eo},jr.prototype.bytes=function(){var eo=this.uint32(),_i=this.pos,va=this.pos+eo;if(va>this.len)throw Lr(this,eo);return this.pos+=eo,Array.isArray(this.buf)?this.buf.slice(_i,va):_i===va?new this.buf.constructor(0):this._slice.call(this.buf,_i,va)},jr.prototype.string=function(){var eo=this.bytes();return Br.read(eo,0,eo.length)},jr.prototype.skip=function(eo){if(typeof eo=="number"){if(this.pos+eo>this.len)throw Lr(this,eo);this.pos+=eo}else do if(this.pos>=this.len)throw Lr(this);while(this.buf[this.pos++]&128);return this},jr.prototype.skipType=function(ga){switch(ga){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(ga=this.uint32()&7)!==4;)this.skipType(ga);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+ga+" at offset "+this.pos)}return this},jr._configure=function(ga){Nr=ga,jr.create=Gr(),Nr._configure();var eo=Mr.Long?"toLong":"toNumber";Mr.merge(jr.prototype,{int64:function(){return Yr.call(this)[eo](!1)},uint64:function(){return Yr.call(this)[eo](!0)},sint64:function(){return Yr.call(this).zzDecode()[eo](!1)},fixed64:function(){return Wn.call(this)[eo](!0)},sfixed64:function(){return Wn.call(this)[eo](!1)}})}}}),require_reader_buffer=__commonJS({"node_modules/protobufjs/src/reader_buffer.js"($r,pr){pr.exports=Dr;var Mr=require_reader();(Dr.prototype=Object.create(Mr.prototype)).constructor=Dr;var Nr=require_minimal();function Dr(Br){Mr.call(this,Br)}Dr._configure=function(){Nr.Buffer&&(Dr.prototype._slice=Nr.Buffer.prototype.slice)},Dr.prototype.string=function(){var Lr=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+Lr,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+Lr,this.len))},Dr._configure()}}),require_writer=__commonJS({"node_modules/protobufjs/src/writer.js"($r,pr){pr.exports=Yr;var Mr=require_minimal(),Nr,Dr=Mr.LongBits,Br=Mr.base64,Lr=Mr.utf8;function jr(no,so,ao){this.fn=no,this.len=so,this.next=void 0,this.val=ao}function Ur(){}function Gr(no){this.head=no.head,this.tail=no.tail,this.len=no.len,this.next=no.states}function Yr(){this.len=0,this.head=new jr(Ur,0,0),this.tail=this.head,this.states=null}var Qr=function(){return Mr.Buffer?function(){return(Yr.create=function(){return new Nr})()}:function(){return new Yr}};Yr.create=Qr(),Yr.alloc=function(so){return new Mr.Array(so)},Mr.Array!==Array&&(Yr.alloc=Mr.pool(Yr.alloc,Mr.Array.prototype.subarray)),Yr.prototype._push=function(so,ao,fo){return this.tail=this.tail.next=new jr(so,ao,fo),this.len+=ao,this};function Wn(no,so,ao){so[ao]=no&255}function ga(no,so,ao){for(;no>127;)so[ao++]=no&127|128,no>>>=7;so[ao]=no}function eo(no,so){this.len=no,this.next=void 0,this.val=so}eo.prototype=Object.create(jr.prototype),eo.prototype.fn=ga,Yr.prototype.uint32=function(so){return this.len+=(this.tail=this.tail.next=new eo((so=so>>>0)<128?1:so<16384?2:so<2097152?3:so<268435456?4:5,so)).len,this},Yr.prototype.int32=function(so){return so<0?this._push(_i,10,Dr.fromNumber(so)):this.uint32(so)},Yr.prototype.sint32=function(so){return this.uint32((so<<1^so>>31)>>>0)};function _i(no,so,ao){for(;no.hi;)so[ao++]=no.lo&127|128,no.lo=(no.lo>>>7|no.hi<<25)>>>0,no.hi>>>=7;for(;no.lo>127;)so[ao++]=no.lo&127|128,no.lo=no.lo>>>7;so[ao++]=no.lo}Yr.prototype.uint64=function(so){var ao=Dr.from(so);return this._push(_i,ao.length(),ao)},Yr.prototype.int64=Yr.prototype.uint64,Yr.prototype.sint64=function(so){var ao=Dr.from(so).zzEncode();return this._push(_i,ao.length(),ao)},Yr.prototype.bool=function(so){return this._push(Wn,1,so?1:0)};function va(no,so,ao){so[ao]=no&255,so[ao+1]=no>>>8&255,so[ao+2]=no>>>16&255,so[ao+3]=no>>>24}Yr.prototype.fixed32=function(so){return this._push(va,4,so>>>0)},Yr.prototype.sfixed32=Yr.prototype.fixed32,Yr.prototype.fixed64=function(so){var ao=Dr.from(so);return this._push(va,4,ao.lo)._push(va,4,ao.hi)},Yr.prototype.sfixed64=Yr.prototype.fixed64,Yr.prototype.float=function(so){return this._push(Mr.float.writeFloatLE,4,so)},Yr.prototype.double=function(so){return this._push(Mr.float.writeDoubleLE,8,so)};var io=Mr.Array.prototype.set?function(so,ao,fo){ao.set(so,fo)}:function(so,ao,fo){for(var lo=0;lo<so.length;++lo)ao[fo+lo]=so[lo]};Yr.prototype.bytes=function(so){var ao=so.length>>>0;if(!ao)return this._push(Wn,1,0);if(Mr.isString(so)){var fo=Yr.alloc(ao=Br.length(so));Br.decode(so,fo,0),so=fo}return this.uint32(ao)._push(io,ao,so)},Yr.prototype.string=function(so){var ao=Lr.length(so);return ao?this.uint32(ao)._push(Lr.write,ao,so):this._push(Wn,1,0)},Yr.prototype.fork=function(){return this.states=new Gr(this),this.head=this.tail=new jr(Ur,0,0),this.len=0,this},Yr.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new jr(Ur,0,0),this.len=0),this},Yr.prototype.ldelim=function(){var so=this.head,ao=this.tail,fo=this.len;return this.reset().uint32(fo),fo&&(this.tail.next=so.next,this.tail=ao,this.len+=fo),this},Yr.prototype.finish=function(){for(var so=this.head.next,ao=this.constructor.alloc(this.len),fo=0;so;)so.fn(so.val,ao,fo),fo+=so.len,so=so.next;return ao},Yr._configure=function(no){Nr=no,Yr.create=Qr(),Nr._configure()}}}),require_writer_buffer=__commonJS({"node_modules/protobufjs/src/writer_buffer.js"($r,pr){pr.exports=Dr;var Mr=require_writer();(Dr.prototype=Object.create(Mr.prototype)).constructor=Dr;var Nr=require_minimal();function Dr(){Mr.call(this)}Dr._configure=function(){Dr.alloc=Nr._Buffer_allocUnsafe,Dr.writeBytesBuffer=Nr.Buffer&&Nr.Buffer.prototype instanceof Uint8Array&&Nr.Buffer.prototype.set.name==="set"?function(jr,Ur,Gr){Ur.set(jr,Gr)}:function(jr,Ur,Gr){if(jr.copy)jr.copy(Ur,Gr,0,jr.length);else for(var Yr=0;Yr<jr.length;)Ur[Gr++]=jr[Yr++]}},Dr.prototype.bytes=function(jr){Nr.isString(jr)&&(jr=Nr._Buffer_from(jr,"base64"));var Ur=jr.length>>>0;return this.uint32(Ur),Ur&&this._push(Dr.writeBytesBuffer,Ur,jr),this};function Br(Lr,jr,Ur){Lr.length<40?Nr.utf8.write(Lr,jr,Ur):jr.utf8Write?jr.utf8Write(Lr,Ur):jr.write(Lr,Ur)}Dr.prototype.string=function(jr){var Ur=Nr.Buffer.byteLength(jr);return this.uint32(Ur),Ur&&this._push(Br,Ur,jr),this},Dr._configure()}}),require_murmurHash3js=__commonJS({"node_modules/murmurhash3js-revisited/lib/murmurHash3js.js"($r,pr){(function(Mr,Nr){var Dr={version:"3.0.0",x86:{},x64:{},inputValidation:!0};function Br(_i){if(!Array.isArray(_i)&&!ArrayBuffer.isView(_i))return!1;for(var va=0;va<_i.length;va++)if(!Number.isInteger(_i[va])||_i[va]<0||_i[va]>255)return!1;return!0}function Lr(_i,va){return(_i&65535)*va+(((_i>>>16)*va&65535)<<16)}function jr(_i,va){return _i<<va|_i>>>32-va}function Ur(_i){return _i^=_i>>>16,_i=Lr(_i,2246822507),_i^=_i>>>13,_i=Lr(_i,3266489909),_i^=_i>>>16,_i}function Gr(_i,va){_i=[_i[0]>>>16,_i[0]&65535,_i[1]>>>16,_i[1]&65535],va=[va[0]>>>16,va[0]&65535,va[1]>>>16,va[1]&65535];var io=[0,0,0,0];return io[3]+=_i[3]+va[3],io[2]+=io[3]>>>16,io[3]&=65535,io[2]+=_i[2]+va[2],io[1]+=io[2]>>>16,io[2]&=65535,io[1]+=_i[1]+va[1],io[0]+=io[1]>>>16,io[1]&=65535,io[0]+=_i[0]+va[0],io[0]&=65535,[io[0]<<16|io[1],io[2]<<16|io[3]]}function Yr(_i,va){_i=[_i[0]>>>16,_i[0]&65535,_i[1]>>>16,_i[1]&65535],va=[va[0]>>>16,va[0]&65535,va[1]>>>16,va[1]&65535];var io=[0,0,0,0];return io[3]+=_i[3]*va[3],io[2]+=io[3]>>>16,io[3]&=65535,io[2]+=_i[2]*va[3],io[1]+=io[2]>>>16,io[2]&=65535,io[2]+=_i[3]*va[2],io[1]+=io[2]>>>16,io[2]&=65535,io[1]+=_i[1]*va[3],io[0]+=io[1]>>>16,io[1]&=65535,io[1]+=_i[2]*va[2],io[0]+=io[1]>>>16,io[1]&=65535,io[1]+=_i[3]*va[1],io[0]+=io[1]>>>16,io[1]&=65535,io[0]+=_i[0]*va[3]+_i[1]*va[2]+_i[2]*va[1]+_i[3]*va[0],io[0]&=65535,[io[0]<<16|io[1],io[2]<<16|io[3]]}function Qr(_i,va){return va%=64,va===32?[_i[1],_i[0]]:va<32?[_i[0]<<va|_i[1]>>>32-va,_i[1]<<va|_i[0]>>>32-va]:(va-=32,[_i[1]<<va|_i[0]>>>32-va,_i[0]<<va|_i[1]>>>32-va])}function Wn(_i,va){return va%=64,va===0?_i:va<32?[_i[0]<<va|_i[1]>>>32-va,_i[1]<<va]:[_i[1]<<va-32,0]}function ga(_i,va){return[_i[0]^va[0],_i[1]^va[1]]}function eo(_i){return _i=ga(_i,[0,_i[0]>>>1]),_i=Yr(_i,[4283543511,3981806797]),_i=ga(_i,[0,_i[0]>>>1]),_i=Yr(_i,[3301882366,444984403]),_i=ga(_i,[0,_i[0]>>>1]),_i}Dr.x86.hash32=function(_i,va){if(Dr.inputValidation&&!Br(_i))return Nr;va=va||0;for(var io=_i.length%4,no=_i.length-io,so=va,ao=0,fo=3432918353,lo=461845907,oo=0;oo<no;oo=oo+4)ao=_i[oo]|_i[oo+1]<<8|_i[oo+2]<<16|_i[oo+3]<<24,ao=Lr(ao,fo),ao=jr(ao,15),ao=Lr(ao,lo),so^=ao,so=jr(so,13),so=Lr(so,5)+3864292196;switch(ao=0,io){case 3:ao^=_i[oo+2]<<16;case 2:ao^=_i[oo+1]<<8;case 1:ao^=_i[oo],ao=Lr(ao,fo),ao=jr(ao,15),ao=Lr(ao,lo),so^=ao}return so^=_i.length,so=Ur(so),so>>>0},Dr.x86.hash128=function(_i,va){if(Dr.inputValidation&&!Br(_i))return Nr;va=va||0;for(var io=_i.length%16,no=_i.length-io,so=va,ao=va,fo=va,lo=va,oo=0,po=0,mo=0,$o=0,Xn=597399067,Fr=2869860233,Vr=951274213,Wr=2716044179,Jr=0;Jr<no;Jr=Jr+16)oo=_i[Jr]|_i[Jr+1]<<8|_i[Jr+2]<<16|_i[Jr+3]<<24,po=_i[Jr+4]|_i[Jr+5]<<8|_i[Jr+6]<<16|_i[Jr+7]<<24,mo=_i[Jr+8]|_i[Jr+9]<<8|_i[Jr+10]<<16|_i[Jr+11]<<24,$o=_i[Jr+12]|_i[Jr+13]<<8|_i[Jr+14]<<16|_i[Jr+15]<<24,oo=Lr(oo,Xn),oo=jr(oo,15),oo=Lr(oo,Fr),so^=oo,so=jr(so,19),so+=ao,so=Lr(so,5)+1444728091,po=Lr(po,Fr),po=jr(po,16),po=Lr(po,Vr),ao^=po,ao=jr(ao,17),ao+=fo,ao=Lr(ao,5)+197830471,mo=Lr(mo,Vr),mo=jr(mo,17),mo=Lr(mo,Wr),fo^=mo,fo=jr(fo,15),fo+=lo,fo=Lr(fo,5)+2530024501,$o=Lr($o,Wr),$o=jr($o,18),$o=Lr($o,Xn),lo^=$o,lo=jr(lo,13),lo+=so,lo=Lr(lo,5)+850148119;switch(oo=0,po=0,mo=0,$o=0,io){case 15:$o^=_i[Jr+14]<<16;case 14:$o^=_i[Jr+13]<<8;case 13:$o^=_i[Jr+12],$o=Lr($o,Wr),$o=jr($o,18),$o=Lr($o,Xn),lo^=$o;case 12:mo^=_i[Jr+11]<<24;case 11:mo^=_i[Jr+10]<<16;case 10:mo^=_i[Jr+9]<<8;case 9:mo^=_i[Jr+8],mo=Lr(mo,Vr),mo=jr(mo,17),mo=Lr(mo,Wr),fo^=mo;case 8:po^=_i[Jr+7]<<24;case 7:po^=_i[Jr+6]<<16;case 6:po^=_i[Jr+5]<<8;case 5:po^=_i[Jr+4],po=Lr(po,Fr),po=jr(po,16),po=Lr(po,Vr),ao^=po;case 4:oo^=_i[Jr+3]<<24;case 3:oo^=_i[Jr+2]<<16;case 2:oo^=_i[Jr+1]<<8;case 1:oo^=_i[Jr],oo=Lr(oo,Xn),oo=jr(oo,15),oo=Lr(oo,Fr),so^=oo}return so^=_i.length,ao^=_i.length,fo^=_i.length,lo^=_i.length,so+=ao,so+=fo,so+=lo,ao+=so,fo+=so,lo+=so,so=Ur(so),ao=Ur(ao),fo=Ur(fo),lo=Ur(lo),so+=ao,so+=fo,so+=lo,ao+=so,fo+=so,lo+=so,("00000000"+(so>>>0).toString(16)).slice(-8)+("00000000"+(ao>>>0).toString(16)).slice(-8)+("00000000"+(fo>>>0).toString(16)).slice(-8)+("00000000"+(lo>>>0).toString(16)).slice(-8)},Dr.x64.hash128=function(_i,va){if(Dr.inputValidation&&!Br(_i))return Nr;va=va||0;for(var io=_i.length%16,no=_i.length-io,so=[0,va],ao=[0,va],fo=[0,0],lo=[0,0],oo=[2277735313,289559509],po=[1291169091,658871167],mo=0;mo<no;mo=mo+16)fo=[_i[mo+4]|_i[mo+5]<<8|_i[mo+6]<<16|_i[mo+7]<<24,_i[mo]|_i[mo+1]<<8|_i[mo+2]<<16|_i[mo+3]<<24],lo=[_i[mo+12]|_i[mo+13]<<8|_i[mo+14]<<16|_i[mo+15]<<24,_i[mo+8]|_i[mo+9]<<8|_i[mo+10]<<16|_i[mo+11]<<24],fo=Yr(fo,oo),fo=Qr(fo,31),fo=Yr(fo,po),so=ga(so,fo),so=Qr(so,27),so=Gr(so,ao),so=Gr(Yr(so,[0,5]),[0,1390208809]),lo=Yr(lo,po),lo=Qr(lo,33),lo=Yr(lo,oo),ao=ga(ao,lo),ao=Qr(ao,31),ao=Gr(ao,so),ao=Gr(Yr(ao,[0,5]),[0,944331445]);switch(fo=[0,0],lo=[0,0],io){case 15:lo=ga(lo,Wn([0,_i[mo+14]],48));case 14:lo=ga(lo,Wn([0,_i[mo+13]],40));case 13:lo=ga(lo,Wn([0,_i[mo+12]],32));case 12:lo=ga(lo,Wn([0,_i[mo+11]],24));case 11:lo=ga(lo,Wn([0,_i[mo+10]],16));case 10:lo=ga(lo,Wn([0,_i[mo+9]],8));case 9:lo=ga(lo,[0,_i[mo+8]]),lo=Yr(lo,po),lo=Qr(lo,33),lo=Yr(lo,oo),ao=ga(ao,lo);case 8:fo=ga(fo,Wn([0,_i[mo+7]],56));case 7:fo=ga(fo,Wn([0,_i[mo+6]],48));case 6:fo=ga(fo,Wn([0,_i[mo+5]],40));case 5:fo=ga(fo,Wn([0,_i[mo+4]],32));case 4:fo=ga(fo,Wn([0,_i[mo+3]],24));case 3:fo=ga(fo,Wn([0,_i[mo+2]],16));case 2:fo=ga(fo,Wn([0,_i[mo+1]],8));case 1:fo=ga(fo,[0,_i[mo]]),fo=Yr(fo,oo),fo=Qr(fo,31),fo=Yr(fo,po),so=ga(so,fo)}return so=ga(so,[0,_i.length]),ao=ga(ao,[0,_i.length]),so=Gr(so,ao),ao=Gr(ao,so),so=eo(so),ao=eo(ao),so=Gr(so,ao),ao=Gr(ao,so),("00000000"+(so[0]>>>0).toString(16)).slice(-8)+("00000000"+(so[1]>>>0).toString(16)).slice(-8)+("00000000"+(ao[0]>>>0).toString(16)).slice(-8)+("00000000"+(ao[1]>>>0).toString(16)).slice(-8)},typeof $r<"u"?(typeof pr<"u"&&pr.exports&&($r=pr.exports=Dr),$r.murmurHash3=Dr):(Dr._murmurHash3=Mr.murmurHash3,Dr.noConflict=function(){return Mr.murmurHash3=Dr._murmurHash3,Dr._murmurHash3=Nr,Dr.noConflict=Nr,Dr},Mr.murmurHash3=Dr)})($r)}}),require_murmurhash3js_revisited=__commonJS({"node_modules/murmurhash3js-revisited/index.js"($r,pr){pr.exports=require_murmurHash3js()}}),require_sparse_array=__commonJS({"node_modules/sparse-array/index.js"($r,pr){var Mr=7;pr.exports=class{constructor(){this._bitArrays=[],this._data=[],this._length=0,this._changedLength=!1,this._changedData=!1}set(Ur,Gr){let Yr=this._internalPositionFor(Ur,!1);if(Gr===void 0)Yr!==-1&&(this._unsetInternalPos(Yr),this._unsetBit(Ur),this._changedLength=!0,this._changedData=!0);else{let Qr=!1;Yr===-1?(Yr=this._data.length,this._setBit(Ur),this._changedData=!0):Qr=!0,this._setInternalPos(Yr,Ur,Gr,Qr),this._changedLength=!0}}unset(Ur){this.set(Ur,void 0)}get(Ur){this._sortData();const Gr=this._internalPositionFor(Ur,!0);if(Gr!==-1)return this._data[Gr][1]}push(Ur){return this.set(this.length,Ur),this.length}get length(){if(this._sortData(),this._changedLength){const Ur=this._data[this._data.length-1];this._length=Ur?Ur[0]+1:0,this._changedLength=!1}return this._length}forEach(Ur){let Gr=0;for(;Gr<this.length;)Ur(this.get(Gr),Gr,this),Gr++}map(Ur){let Gr=0,Yr=new Array(this.length);for(;Gr<this.length;)Yr[Gr]=Ur(this.get(Gr),Gr,this),Gr++;return Yr}reduce(Ur,Gr){let Yr=0,Qr=Gr;for(;Yr<this.length;){const Wn=this.get(Yr);Qr=Ur(Qr,Wn,Yr),Yr++}return Qr}find(Ur){let Gr=0,Yr,Qr;for(;Gr<this.length&&!Yr;)Qr=this.get(Gr),Yr=Ur(Qr),Gr++;return Yr?Qr:void 0}_internalPositionFor(Ur,Gr){const Yr=this._bytePosFor(Ur,Gr);if(Yr>=this._bitArrays.length)return-1;const Qr=this._bitArrays[Yr],Wn=Ur-Yr*Mr;if(!((Qr&1<<Wn)>0))return-1;const eo=this._bitArrays.slice(0,Yr).reduce(Nr,0),_i=~(4294967295<<Wn+1),va=Dr(Qr&_i);return eo+va-1}_bytePosFor(Ur,Gr){const Yr=Math.floor(Ur/Mr),Qr=Yr+1;for(;!Gr&&this._bitArrays.length<Qr;)this._bitArrays.push(0);return Yr}_setBit(Ur){const Gr=this._bytePosFor(Ur,!1);this._bitArrays[Gr]|=1<<Ur-Gr*Mr}_unsetBit(Ur){const Gr=this._bytePosFor(Ur,!1);this._bitArrays[Gr]&=~(1<<Ur-Gr*Mr)}_setInternalPos(Ur,Gr,Yr,Qr){const Wn=this._data,ga=[Gr,Yr];if(Qr)this._sortData(),Wn[Ur]=ga;else{if(Wn.length)if(Wn[Wn.length-1][0]>=Gr)Wn.push(ga);else if(Wn[0][0]<=Gr)Wn.unshift(ga);else{const eo=Math.round(Wn.length/2);this._data=Wn.slice(0,eo).concat(ga).concat(Wn.slice(eo))}else this._data.push(ga);this._changedData=!0,this._changedLength=!0}}_unsetInternalPos(Ur){this._data.splice(Ur,1)}_sortData(){this._changedData&&this._data.sort(Br),this._changedData=!1}bitField(){const Ur=[];let Gr=8,Yr=0,Qr=0,Wn;const ga=this._bitArrays.slice();for(;ga.length||Yr;){Yr===0&&(Wn=ga.shift(),Yr=7);const _i=Math.min(Yr,Gr),va=~(255<<_i),io=Wn&va;Qr|=io<<8-Gr,Wn=Wn>>>_i,Yr-=_i,Gr-=_i,(!Gr||!Yr&&!ga.length)&&(Ur.push(Qr),Qr=0,Gr=8)}for(var eo=Ur.length-1;eo>0&&Ur[eo]===0;eo--)Ur.pop();return Ur}compactArray(){return this._sortData(),this._data.map(Lr)}};function Nr(jr,Ur){return jr+Dr(Ur)}function Dr(jr){let Ur=jr;return Ur=Ur-(Ur>>1&1431655765),Ur=(Ur&858993459)+(Ur>>2&858993459),(Ur+(Ur>>4)&252645135)*16843009>>24}function Br(jr,Ur){return jr[0]-Ur[0]}function Lr(jr){return jr[1]}}}),src_exports2={};__export(src_exports2,{calculateMultipleHashesADR32:()=>calculateMultipleHashesADR32,calculateMultipleHashesADR32LegacyQmHash:()=>calculateMultipleHashesADR32LegacyQmHash,compareStrings:()=>compareStrings,hashV0:()=>hashV0,hashV1:()=>hashV1,keccak256Hash:()=>keccak256Hash,prepareADR32Data:()=>prepareADR32Data,sortKeys:()=>sortKeys}),module.exports=__toCommonJS(src_exports2);var import_crypto3=__toESM(requireCryptoBrowserify(),1),bytes_exports={};__export(bytes_exports,{coerce:()=>coerce,empty:()=>empty,equals:()=>equals,fromHex:()=>fromHex,fromString:()=>fromString,isBinary:()=>isBinary,toHex:()=>toHex,toString:()=>toString});var empty=new Uint8Array(0),toHex=$r=>$r.reduce((pr,Mr)=>pr+Mr.toString(16).padStart(2,"0"),""),fromHex=$r=>{const pr=$r.match(/../g);return pr?new Uint8Array(pr.map(Mr=>parseInt(Mr,16))):empty},equals=($r,pr)=>{if($r===pr)return!0;if($r.byteLength!==pr.byteLength)return!1;for(let Mr=0;Mr<$r.byteLength;Mr++)if($r[Mr]!==pr[Mr])return!1;return!0},coerce=$r=>{if($r instanceof Uint8Array&&$r.constructor.name==="Uint8Array")return $r;if($r instanceof ArrayBuffer)return new Uint8Array($r);if(ArrayBuffer.isView($r))return new Uint8Array($r.buffer,$r.byteOffset,$r.byteLength);throw new Error("Unknown type, must be binary type")},isBinary=$r=>$r instanceof ArrayBuffer||ArrayBuffer.isView($r),fromString=$r=>new TextEncoder().encode($r),toString=$r=>new TextDecoder().decode($r),encode_1=encode,MSB=128,REST=127,MSBALL=~REST,INT=Math.pow(2,31);function encode($r,pr,Mr){pr=pr||[],Mr=Mr||0;for(var Nr=Mr;$r>=INT;)pr[Mr++]=$r&255|MSB,$r/=128;for(;$r&MSBALL;)pr[Mr++]=$r&255|MSB,$r>>>=7;return pr[Mr]=$r|0,encode.bytes=Mr-Nr+1,pr}var decode=read,MSB$1=128,REST$1=127;function read($r,Nr){var Mr=0,Nr=Nr||0,Dr=0,Br=Nr,Lr,jr=$r.length;do{if(Br>=jr)throw read.bytes=0,new RangeError("Could not decode varint");Lr=$r[Br++],Mr+=Dr<28?(Lr&REST$1)<<Dr:(Lr&REST$1)*Math.pow(2,Dr),Dr+=7}while(Lr>=MSB$1);return read.bytes=Br-Nr,Mr}var N1=Math.pow(2,7),N2=Math.pow(2,14),N3=Math.pow(2,21),N4=Math.pow(2,28),N5=Math.pow(2,35),N6=Math.pow(2,42),N7=Math.pow(2,49),N8=Math.pow(2,56),N9=Math.pow(2,63),length=function($r){return $r<N1?1:$r<N2?2:$r<N3?3:$r<N4?4:$r<N5?5:$r<N6?6:$r<N7?7:$r<N8?8:$r<N9?9:10},varint={encode:encode_1,decode,encodingLength:length},_brrp_varint=varint,varint_default=_brrp_varint,decode2=($r,pr=0)=>[varint_default.decode($r,pr),varint_default.decode.bytes],encodeTo=($r,pr,Mr=0)=>(varint_default.encode($r,pr,Mr),pr),encodingLength=$r=>varint_default.encodingLength($r),create=($r,pr)=>{const Mr=pr.byteLength,Nr=encodingLength($r),Dr=Nr+encodingLength(Mr),Br=new Uint8Array(Dr+Mr);return encodeTo($r,Br,0),encodeTo(Mr,Br,Nr),Br.set(pr,Dr),new Digest($r,Mr,pr,Br)},decode3=$r=>{const pr=coerce($r),[Mr,Nr]=decode2(pr),[Dr,Br]=decode2(pr.subarray(Nr)),Lr=pr.subarray(Nr+Br);if(Lr.byteLength!==Dr)throw new Error("Incorrect length");return new Digest(Mr,Dr,Lr,pr)},equals2=($r,pr)=>{if($r===pr)return!0;{const Mr=pr;return $r.code===Mr.code&&$r.size===Mr.size&&Mr.bytes instanceof Uint8Array&&equals($r.bytes,Mr.bytes)}},Digest=class{constructor($r,pr,Mr,Nr){this.code=$r,this.size=pr,this.digest=Mr,this.bytes=Nr}};function base($r,pr){if($r.length>=255)throw new TypeError("Alphabet too long");for(var Mr=new Uint8Array(256),Nr=0;Nr<Mr.length;Nr++)Mr[Nr]=255;for(var Dr=0;Dr<$r.length;Dr++){var Br=$r.charAt(Dr),Lr=Br.charCodeAt(0);if(Mr[Lr]!==255)throw new TypeError(Br+" is ambiguous");Mr[Lr]=Dr}var jr=$r.length,Ur=$r.charAt(0),Gr=Math.log(jr)/Math.log(256),Yr=Math.log(256)/Math.log(jr);function Qr(eo){if(eo instanceof Uint8Array||(ArrayBuffer.isView(eo)?eo=new Uint8Array(eo.buffer,eo.byteOffset,eo.byteLength):Array.isArray(eo)&&(eo=Uint8Array.from(eo))),!(eo instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(eo.length===0)return"";for(var _i=0,va=0,io=0,no=eo.length;io!==no&&eo[io]===0;)io++,_i++;for(var so=(no-io)*Yr+1>>>0,ao=new Uint8Array(so);io!==no;){for(var fo=eo[io],lo=0,oo=so-1;(fo!==0||lo<va)&&oo!==-1;oo--,lo++)fo+=256*ao[oo]>>>0,ao[oo]=fo%jr>>>0,fo=fo/jr>>>0;if(fo!==0)throw new Error("Non-zero carry");va=lo,io++}for(var po=so-va;po!==so&&ao[po]===0;)po++;for(var mo=Ur.repeat(_i);po<so;++po)mo+=$r.charAt(ao[po]);return mo}function Wn(eo){if(typeof eo!="string")throw new TypeError("Expected String");if(eo.length===0)return new Uint8Array;var _i=0;if(eo[_i]!==" "){for(var va=0,io=0;eo[_i]===Ur;)va++,_i++;for(var no=(eo.length-_i)*Gr+1>>>0,so=new Uint8Array(no);eo[_i];){var ao=Mr[eo.charCodeAt(_i)];if(ao===255)return;for(var fo=0,lo=no-1;(ao!==0||fo<io)&&lo!==-1;lo--,fo++)ao+=jr*so[lo]>>>0,so[lo]=ao%256>>>0,ao=ao/256>>>0;if(ao!==0)throw new Error("Non-zero carry");io=fo,_i++}if(eo[_i]!==" "){for(var oo=no-io;oo!==no&&so[oo]===0;)oo++;for(var po=new Uint8Array(va+(no-oo)),mo=va;oo!==no;)po[mo++]=so[oo++];return po}}}function ga(eo){var _i=Wn(eo);if(_i)return _i;throw new Error(`Non-${pr} character`)}return{encode:Qr,decodeUnsafe:Wn,decode:ga}}var src=base,_brrp__multiformats_scope_baseX=src,base_x_default=_brrp__multiformats_scope_baseX,Encoder=class{constructor($r,pr,Mr){this.name=$r,this.prefix=pr,this.baseEncode=Mr}encode($r){if($r instanceof Uint8Array)return`${this.prefix}${this.baseEncode($r)}`;throw Error("Unknown type, must be binary type")}},Decoder=class{constructor($r,pr,Mr){if(this.name=$r,this.prefix=pr,pr.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=pr.codePointAt(0),this.baseDecode=Mr}decode($r){if(typeof $r=="string"){if($r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify($r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode($r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or($r){return or(this,$r)}},ComposedDecoder=class{constructor($r){this.decoders=$r}or($r){return or(this,$r)}decode($r){const pr=$r[0],Mr=this.decoders[pr];if(Mr)return Mr.decode($r);throw RangeError(`Unable to decode multibase string ${JSON.stringify($r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},or=($r,pr)=>new ComposedDecoder({...$r.decoders||{[$r.prefix]:$r},...pr.decoders||{[pr.prefix]:pr}}),Codec=class{constructor($r,pr,Mr,Nr){this.name=$r,this.prefix=pr,this.baseEncode=Mr,this.baseDecode=Nr,this.encoder=new Encoder($r,pr,Mr),this.decoder=new Decoder($r,pr,Nr)}encode($r){return this.encoder.encode($r)}decode($r){return this.decoder.decode($r)}},from=({name:$r,prefix:pr,encode:Mr,decode:Nr})=>new Codec($r,pr,Mr,Nr),baseX=({prefix:$r,name:pr,alphabet:Mr})=>{const{encode:Nr,decode:Dr}=base_x_default(Mr,pr);return from({prefix:$r,name:pr,encode:Nr,decode:Br=>coerce(Dr(Br))})},decode4=($r,pr,Mr,Nr)=>{const Dr={};for(let Yr=0;Yr<pr.length;++Yr)Dr[pr[Yr]]=Yr;let Br=$r.length;for(;$r[Br-1]==="=";)--Br;const Lr=new Uint8Array(Br*Mr/8|0);let jr=0,Ur=0,Gr=0;for(let Yr=0;Yr<Br;++Yr){const Qr=Dr[$r[Yr]];if(Qr===void 0)throw new SyntaxError(`Non-${Nr} character`);Ur=Ur<<Mr|Qr,jr+=Mr,jr>=8&&(jr-=8,Lr[Gr++]=255&Ur>>jr)}if(jr>=Mr||255&Ur<<8-jr)throw new SyntaxError("Unexpected end of data");return Lr},encode2=($r,pr,Mr)=>{const Nr=pr[pr.length-1]==="=",Dr=(1<<Mr)-1;let Br="",Lr=0,jr=0;for(let Ur=0;Ur<$r.length;++Ur)for(jr=jr<<8|$r[Ur],Lr+=8;Lr>Mr;)Lr-=Mr,Br+=pr[Dr&jr>>Lr];if(Lr&&(Br+=pr[Dr&jr<<Mr-Lr]),Nr)for(;Br.length*Mr&7;)Br+="=";return Br},rfc4648=({name:$r,prefix:pr,bitsPerChar:Mr,alphabet:Nr})=>from({prefix:pr,name:$r,encode(Dr){return encode2(Dr,Nr,Mr)},decode(Dr){return decode4(Dr,Nr,Mr,$r)}}),base58btc=baseX({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"});baseX({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var base32=rfc4648({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5});rfc4648({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),rfc4648({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),rfc4648({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),rfc4648({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),rfc4648({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),rfc4648({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),rfc4648({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),rfc4648({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var format=($r,pr)=>{const{bytes:Mr,version:Nr}=$r;switch(Nr){case 0:return toStringV0(Mr,baseCache($r),pr||base58btc.encoder);default:return toStringV1(Mr,baseCache($r),pr||base32.encoder)}},cache=new WeakMap,baseCache=$r=>{const pr=cache.get($r);if(pr==null){const Mr=new Map;return cache.set($r,Mr),Mr}return pr},CID=class n0{constructor(pr,Mr,Nr,Dr){this.code=Mr,this.version=pr,this.multihash=Nr,this.bytes=Dr,this["/"]=Dr}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{const{code:pr,multihash:Mr}=this;if(pr!==DAG_PB_CODE)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(Mr.code!==SHA_256_CODE)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return n0.createV0(Mr)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{const{code:pr,digest:Mr}=this.multihash,Nr=create(pr,Mr);return n0.createV1(this.code,Nr)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(pr){return n0.equals(this,pr)}static equals(pr,Mr){const Nr=Mr;return Nr&&pr.code===Nr.code&&pr.version===Nr.version&&equals2(pr.multihash,Nr.multihash)}toString(pr){return format(this,pr)}toJSON(){return{"/":format(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(pr){if(pr==null)return null;const Mr=pr;if(Mr instanceof n0)return Mr;if(Mr["/"]!=null&&Mr["/"]===Mr.bytes||Mr.asCID===Mr){const{version:Nr,code:Dr,multihash:Br,bytes:Lr}=Mr;return new n0(Nr,Dr,Br,Lr||encodeCID(Nr,Dr,Br.bytes))}else if(Mr[cidSymbol]===!0){const{version:Nr,multihash:Dr,code:Br}=Mr,Lr=decode3(Dr);return n0.create(Nr,Br,Lr)}else return null}static create(pr,Mr,Nr){if(typeof Mr!="number")throw new Error("String codecs are no longer supported");if(!(Nr.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(pr){case 0:{if(Mr!==DAG_PB_CODE)throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE}) block encoding`);return new n0(pr,Mr,Nr,Nr.bytes)}case 1:{const Dr=encodeCID(pr,Mr,Nr.bytes);return new n0(pr,Mr,Nr,Dr)}default:throw new Error("Invalid version")}}static createV0(pr){return n0.create(0,DAG_PB_CODE,pr)}static createV1(pr,Mr){return n0.create(1,pr,Mr)}static decode(pr){const[Mr,Nr]=n0.decodeFirst(pr);if(Nr.length)throw new Error("Incorrect length");return Mr}static decodeFirst(pr){const Mr=n0.inspectBytes(pr),Nr=Mr.size-Mr.multihashSize,Dr=coerce(pr.subarray(Nr,Nr+Mr.multihashSize));if(Dr.byteLength!==Mr.multihashSize)throw new Error("Incorrect length");const Br=Dr.subarray(Mr.multihashSize-Mr.digestSize),Lr=new Digest(Mr.multihashCode,Mr.digestSize,Br,Dr);return[Mr.version===0?n0.createV0(Lr):n0.createV1(Mr.codec,Lr),pr.subarray(Mr.size)]}static inspectBytes(pr){let Mr=0;const Nr=()=>{const[Qr,Wn]=decode2(pr.subarray(Mr));return Mr+=Wn,Qr};let Dr=Nr(),Br=DAG_PB_CODE;if(Dr===18?(Dr=0,Mr=0):Br=Nr(),Dr!==0&&Dr!==1)throw new RangeError(`Invalid CID version ${Dr}`);const Lr=Mr,jr=Nr(),Ur=Nr(),Gr=Mr+Ur,Yr=Gr-Lr;return{version:Dr,codec:Br,multihashCode:jr,digestSize:Ur,multihashSize:Yr,size:Gr}}static parse(pr,Mr){const[Nr,Dr]=parseCIDtoBytes(pr,Mr),Br=n0.decode(Dr);if(Br.version===0&&pr[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return baseCache(Br).set(Nr,pr),Br}},parseCIDtoBytes=($r,pr)=>{switch($r[0]){case"Q":{const Mr=pr||base58btc;return[base58btc.prefix,Mr.decode(`${base58btc.prefix}${$r}`)]}case base58btc.prefix:{const Mr=pr||base58btc;return[base58btc.prefix,Mr.decode($r)]}case base32.prefix:{const Mr=pr||base32;return[base32.prefix,Mr.decode($r)]}default:{if(pr==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[$r[0],pr.decode($r)]}}},toStringV0=($r,pr,Mr)=>{const{prefix:Nr}=Mr;if(Nr!==base58btc.prefix)throw Error(`Cannot string encode V0 in ${Mr.name} encoding`);const Dr=pr.get(Nr);if(Dr==null){const Br=Mr.encode($r).slice(1);return pr.set(Nr,Br),Br}else return Dr},toStringV1=($r,pr,Mr)=>{const{prefix:Nr}=Mr,Dr=pr.get(Nr);if(Dr==null){const Br=Mr.encode($r);return pr.set(Nr,Br),Br}else return Dr},DAG_PB_CODE=112,SHA_256_CODE=18,encodeCID=($r,pr,Mr)=>{const Nr=encodingLength($r),Dr=Nr+encodingLength(pr),Br=new Uint8Array(Dr+Mr.byteLength);return encodeTo($r,Br,0),encodeTo(pr,Br,Nr),Br.set(Mr,Dr),Br},cidSymbol=Symbol.for("@ipld/js-cid/CID");__toESM(require_err_code(),1);function isAsyncIterable($r){return $r[Symbol.asyncIterator]!=null}function batch($r,pr=1){return pr=Number(pr),isAsyncIterable($r)?async function*(){let Mr=[];if(pr<1&&(pr=1),pr!==Math.round(pr))throw new Error("Batch size must be an integer");for await(const Nr of $r)for(Mr.push(Nr);Mr.length>=pr;)yield Mr.slice(0,pr),Mr=Mr.slice(pr);for(;Mr.length>0;)yield Mr.slice(0,pr),Mr=Mr.slice(pr)}():function*(){let Mr=[];if(pr<1&&(pr=1),pr!==Math.round(pr))throw new Error("Batch size must be an integer");for(const Nr of $r)for(Mr.push(Nr);Mr.length>=pr;)yield Mr.slice(0,pr),Mr=Mr.slice(pr);for(;Mr.length>0;)yield Mr.slice(0,pr),Mr=Mr.slice(pr)}()}var src_default=batch;async function*parallelBatch($r,pr=1){for await(const Mr of src_default($r,pr)){const Nr=Mr.map(async Dr=>Dr().then(Br=>({ok:!0,value:Br}),Br=>({ok:!1,err:Br})));for(let Dr=0;Dr<Nr.length;Dr++){const Br=await Nr[Dr];if(Br.ok)yield Br.value;else throw Br.err}}}function asUint8Array($r){return globalThis.Buffer!=null?new Uint8Array($r.buffer,$r.byteOffset,$r.byteLength):$r}function alloc($r=0){var pr;return((pr=globalThis.Buffer)==null?void 0:pr.alloc)!=null?asUint8Array(globalThis.Buffer.alloc($r)):new Uint8Array($r)}function allocUnsafe($r=0){var pr;return((pr=globalThis.Buffer)==null?void 0:pr.allocUnsafe)!=null?asUint8Array(globalThis.Buffer.allocUnsafe($r)):new Uint8Array($r)}function concat($r,pr){pr==null&&(pr=$r.reduce((Dr,Br)=>Dr+Br.length,0));const Mr=allocUnsafe(pr);let Nr=0;for(const Dr of $r)Mr.set(Dr,Nr),Nr+=Dr.length;return asUint8Array(Mr)}function equals3($r,pr){if($r===pr)return!0;if($r.byteLength!==pr.byteLength)return!1;for(let Mr=0;Mr<$r.byteLength;Mr++)if($r[Mr]!==pr[Mr])return!1;return!0}var symbol=Symbol.for("@achingbrain/uint8arraylist");function findBufAndOffset($r,pr){if(pr==null||pr<0)throw new RangeError("index is out of bounds");let Mr=0;for(const Nr of $r){const Dr=Mr+Nr.byteLength;if(pr<Dr)return{buf:Nr,index:pr-Mr};Mr=Dr}throw new RangeError("index is out of bounds")}function isUint8ArrayList($r){return!!($r!=null&&$r[symbol])}var Uint8ArrayList=class hw{constructor(...pr){Object.defineProperty(this,symbol,{value:!0}),this.bufs=[],this.length=0,pr.length>0&&this.appendAll(pr)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...pr){this.appendAll(pr)}appendAll(pr){let Mr=0;for(const Nr of pr)if(Nr instanceof Uint8Array)Mr+=Nr.byteLength,this.bufs.push(Nr);else if(isUint8ArrayList(Nr))Mr+=Nr.byteLength,this.bufs.push(...Nr.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=Mr}prepend(...pr){this.prependAll(pr)}prependAll(pr){let Mr=0;for(const Nr of pr.reverse())if(Nr instanceof Uint8Array)Mr+=Nr.byteLength,this.bufs.unshift(Nr);else if(isUint8ArrayList(Nr))Mr+=Nr.byteLength,this.bufs.unshift(...Nr.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=Mr}get(pr){const Mr=findBufAndOffset(this.bufs,pr);return Mr.buf[Mr.index]}set(pr,Mr){const Nr=findBufAndOffset(this.bufs,pr);Nr.buf[Nr.index]=Mr}write(pr,Mr=0){if(pr instanceof Uint8Array)for(let Nr=0;Nr<pr.length;Nr++)this.set(Mr+Nr,pr[Nr]);else if(isUint8ArrayList(pr))for(let Nr=0;Nr<pr.length;Nr++)this.set(Mr+Nr,pr.get(Nr));else throw new Error("Could not write value, must be an Uint8Array or a Uint8ArrayList")}consume(pr){if(pr=Math.trunc(pr),!(Number.isNaN(pr)||pr<=0)){if(pr===this.byteLength){this.bufs=[],this.length=0;return}for(;this.bufs.length>0;)if(pr>=this.bufs[0].byteLength)pr-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(pr),this.length-=pr;break}}}slice(pr,Mr){const{bufs:Nr,length:Dr}=this._subList(pr,Mr);return concat(Nr,Dr)}subarray(pr,Mr){const{bufs:Nr,length:Dr}=this._subList(pr,Mr);return Nr.length===1?Nr[0]:concat(Nr,Dr)}sublist(pr,Mr){const{bufs:Nr,length:Dr}=this._subList(pr,Mr),Br=new hw;return Br.length=Dr,Br.bufs=Nr,Br}_subList(pr,Mr){if(pr=pr??0,Mr=Mr??this.length,pr<0&&(pr=this.length+pr),Mr<0&&(Mr=this.length+Mr),pr<0||Mr>this.length)throw new RangeError("index is out of bounds");if(pr===Mr)return{bufs:[],length:0};if(pr===0&&Mr===this.length)return{bufs:[...this.bufs],length:this.length};const Nr=[];let Dr=0;for(let Br=0;Br<this.bufs.length;Br++){const Lr=this.bufs[Br],jr=Dr,Ur=jr+Lr.byteLength;if(Dr=Ur,pr>=Ur)continue;const Gr=pr>=jr&&pr<Ur,Yr=Mr>jr&&Mr<=Ur;if(Gr&&Yr){if(pr===jr&&Mr===Ur){Nr.push(Lr);break}const Qr=pr-jr;Nr.push(Lr.subarray(Qr,Qr+(Mr-pr)));break}if(Gr){if(pr===0){Nr.push(Lr);continue}Nr.push(Lr.subarray(pr-jr));continue}if(Yr){if(Mr===Ur){Nr.push(Lr);break}Nr.push(Lr.subarray(0,Mr-jr));break}Nr.push(Lr)}return{bufs:Nr,length:Mr-pr}}indexOf(pr,Mr=0){if(!isUint8ArrayList(pr)&&!(pr instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');const Nr=pr instanceof Uint8Array?pr:pr.subarray();if(Mr=Number(Mr??0),isNaN(Mr)&&(Mr=0),Mr<0&&(Mr=this.length+Mr),Mr<0&&(Mr=0),pr.length===0)return Mr>this.length?this.length:Mr;const Dr=Nr.byteLength;if(Dr===0)throw new TypeError("search must be at least 1 byte long");const Br=256,Lr=new Int32Array(Br);for(let Qr=0;Qr<Br;Qr++)Lr[Qr]=-1;for(let Qr=0;Qr<Dr;Qr++)Lr[Nr[Qr]]=Qr;const jr=Lr,Ur=this.byteLength-Nr.byteLength,Gr=Nr.byteLength-1;let Yr;for(let Qr=Mr;Qr<=Ur;Qr+=Yr){Yr=0;for(let Wn=Gr;Wn>=0;Wn--){const ga=this.get(Qr+Wn);if(Nr[Wn]!==ga){Yr=Math.max(1,Wn-jr[ga]);break}}if(Yr===0)return Qr}return-1}getInt8(pr){const Mr=this.subarray(pr,pr+1);return new DataView(Mr.buffer,Mr.byteOffset,Mr.byteLength).getInt8(0)}setInt8(pr,Mr){const Nr=allocUnsafe(1);new DataView(Nr.buffer,Nr.byteOffset,Nr.byteLength).setInt8(0,Mr),this.write(Nr,pr)}getInt16(pr,Mr){const Nr=this.subarray(pr,pr+2);return new DataView(Nr.buffer,Nr.byteOffset,Nr.byteLength).getInt16(0,Mr)}setInt16(pr,Mr,Nr){const Dr=alloc(2);new DataView(Dr.buffer,Dr.byteOffset,Dr.byteLength).setInt16(0,Mr,Nr),this.write(Dr,pr)}getInt32(pr,Mr){const Nr=this.subarray(pr,pr+4);return new DataView(Nr.buffer,Nr.byteOffset,Nr.byteLength).getInt32(0,Mr)}setInt32(pr,Mr,Nr){const Dr=alloc(4);new DataView(Dr.buffer,Dr.byteOffset,Dr.byteLength).setInt32(0,Mr,Nr),this.write(Dr,pr)}getBigInt64(pr,Mr){const Nr=this.subarray(pr,pr+8);return new DataView(Nr.buffer,Nr.byteOffset,Nr.byteLength).getBigInt64(0,Mr)}setBigInt64(pr,Mr,Nr){const Dr=alloc(8);new DataView(Dr.buffer,Dr.byteOffset,Dr.byteLength).setBigInt64(0,Mr,Nr),this.write(Dr,pr)}getUint8(pr){const Mr=this.subarray(pr,pr+1);return new DataView(Mr.buffer,Mr.byteOffset,Mr.byteLength).getUint8(0)}setUint8(pr,Mr){const Nr=allocUnsafe(1);new DataView(Nr.buffer,Nr.byteOffset,Nr.byteLength).setUint8(0,Mr),this.write(Nr,pr)}getUint16(pr,Mr){const Nr=this.subarray(pr,pr+2);return new DataView(Nr.buffer,Nr.byteOffset,Nr.byteLength).getUint16(0,Mr)}setUint16(pr,Mr,Nr){const Dr=alloc(2);new DataView(Dr.buffer,Dr.byteOffset,Dr.byteLength).setUint16(0,Mr,Nr),this.write(Dr,pr)}getUint32(pr,Mr){const Nr=this.subarray(pr,pr+4);return new DataView(Nr.buffer,Nr.byteOffset,Nr.byteLength).getUint32(0,Mr)}setUint32(pr,Mr,Nr){const Dr=alloc(4);new DataView(Dr.buffer,Dr.byteOffset,Dr.byteLength).setUint32(0,Mr,Nr),this.write(Dr,pr)}getBigUint64(pr,Mr){const Nr=this.subarray(pr,pr+8);return new DataView(Nr.buffer,Nr.byteOffset,Nr.byteLength).getBigUint64(0,Mr)}setBigUint64(pr,Mr,Nr){const Dr=alloc(8);new DataView(Dr.buffer,Dr.byteOffset,Dr.byteLength).setBigUint64(0,Mr,Nr),this.write(Dr,pr)}getFloat32(pr,Mr){const Nr=this.subarray(pr,pr+4);return new DataView(Nr.buffer,Nr.byteOffset,Nr.byteLength).getFloat32(0,Mr)}setFloat32(pr,Mr,Nr){const Dr=alloc(4);new DataView(Dr.buffer,Dr.byteOffset,Dr.byteLength).setFloat32(0,Mr,Nr),this.write(Dr,pr)}getFloat64(pr,Mr){const Nr=this.subarray(pr,pr+8);return new DataView(Nr.buffer,Nr.byteOffset,Nr.byteLength).getFloat64(0,Mr)}setFloat64(pr,Mr,Nr){const Dr=alloc(8);new DataView(Dr.buffer,Dr.byteOffset,Dr.byteLength).setFloat64(0,Mr,Nr),this.write(Dr,pr)}equals(pr){if(pr==null||!(pr instanceof hw)||pr.bufs.length!==this.bufs.length)return!1;for(let Mr=0;Mr<this.bufs.length;Mr++)if(!equals3(this.bufs[Mr],pr.bufs[Mr]))return!1;return!0}static fromUint8Arrays(pr,Mr){const Nr=new hw;return Nr.bufs=pr,Mr==null&&(Mr=pr.reduce((Dr,Br)=>Dr+Br.byteLength,0)),Nr.length=Mr,Nr}},DEFAULT_CHUNK_SIZE=262144,fixedSize=($r={})=>{const pr=$r.chunkSize??DEFAULT_CHUNK_SIZE;return async function*(Nr){let Dr=new Uint8ArrayList,Br=0,Lr=!1;for await(const jr of Nr)for(Dr.append(jr),Br+=jr.length;Br>=pr;)if(yield Dr.slice(0,pr),Lr=!0,pr===Dr.length)Dr=new Uint8ArrayList,Br=0;else{const Ur=new Uint8ArrayList;Ur.append(Dr.sublist(pr)),Dr=Ur,Br-=pr}(!Lr||Br>0)&&(yield Dr.subarray(0,Br))}},src_exports={};__export(src_exports,{code:()=>code,createLink:()=>createLink,createNode:()=>createNode,decode:()=>decode5,encode:()=>encode3,name:()=>name,prepare:()=>prepare,validate:()=>validate});var textDecoder=new TextDecoder;function decodeVarint($r,pr){let Mr=0;for(let Nr=0;;Nr+=7){if(Nr>=64)throw new Error("protobuf: varint overflow");if(pr>=$r.length)throw new Error("protobuf: unexpected end of data");const Dr=$r[pr++];if(Mr+=Nr<28?(Dr&127)<<Nr:(Dr&127)*2**Nr,Dr<128)break}return[Mr,pr]}function decodeBytes($r,pr){let Mr;[Mr,pr]=decodeVarint($r,pr);const Nr=pr+Mr;if(Mr<0||Nr<0)throw new Error("protobuf: invalid length");if(Nr>$r.length)throw new Error("protobuf: unexpected end of data");return[$r.subarray(pr,Nr),Nr]}function decodeKey($r,pr){let Mr;return[Mr,pr]=decodeVarint($r,pr),[Mr&7,Mr>>3,pr]}function decodeLink($r){const pr={},Mr=$r.length;let Nr=0;for(;Nr<Mr;){let Dr,Br;if([Dr,Br,Nr]=decodeKey($r,Nr),Br===1){if(pr.Hash)throw new Error("protobuf: (PBLink) duplicate Hash section");if(Dr!==2)throw new Error(`protobuf: (PBLink) wrong wireType (${Dr}) for Hash`);if(pr.Name!==void 0)throw new Error("protobuf: (PBLink) invalid order, found Name before Hash");if(pr.Tsize!==void 0)throw new Error("protobuf: (PBLink) invalid order, found Tsize before Hash");[pr.Hash,Nr]=decodeBytes($r,Nr)}else if(Br===2){if(pr.Name!==void 0)throw new Error("protobuf: (PBLink) duplicate Name section");if(Dr!==2)throw new Error(`protobuf: (PBLink) wrong wireType (${Dr}) for Name`);if(pr.Tsize!==void 0)throw new Error("protobuf: (PBLink) invalid order, found Tsize before Name");let Lr;[Lr,Nr]=decodeBytes($r,Nr),pr.Name=textDecoder.decode(Lr)}else if(Br===3){if(pr.Tsize!==void 0)throw new Error("protobuf: (PBLink) duplicate Tsize section");if(Dr!==0)throw new Error(`protobuf: (PBLink) wrong wireType (${Dr}) for Tsize`);[pr.Tsize,Nr]=decodeVarint($r,Nr)}else throw new Error(`protobuf: (PBLink) invalid fieldNumber, expected 1, 2 or 3, got ${Br}`)}if(Nr>Mr)throw new Error("protobuf: (PBLink) unexpected end of data");return pr}function decodeNode($r){const pr=$r.length;let Mr=0,Nr,Dr=!1,Br;for(;Mr<pr;){let jr,Ur;if([jr,Ur,Mr]=decodeKey($r,Mr),jr!==2)throw new Error(`protobuf: (PBNode) invalid wireType, expected 2, got ${jr}`);if(Ur===1){if(Br)throw new Error("protobuf: (PBNode) duplicate Data section");[Br,Mr]=decodeBytes($r,Mr),Nr&&(Dr=!0)}else if(Ur===2){if(Dr)throw new Error("protobuf: (PBNode) duplicate Links section");Nr||(Nr=[]);let Gr;[Gr,Mr]=decodeBytes($r,Mr),Nr.push(decodeLink(Gr))}else throw new Error(`protobuf: (PBNode) invalid fieldNumber, expected 1 or 2, got ${Ur}`)}if(Mr>pr)throw new Error("protobuf: (PBNode) unexpected end of data");const Lr={};return Br&&(Lr.Data=Br),Lr.Links=Nr||[],Lr}var textEncoder=new TextEncoder,maxInt32=2**32,maxUInt32=2**31;function encodeLink($r,pr){let Mr=pr.length;if(typeof $r.Tsize=="number"){if($r.Tsize<0)throw new Error("Tsize cannot be negative");if(!Number.isSafeInteger($r.Tsize))throw new Error("Tsize too large for encoding");Mr=encodeVarint(pr,Mr,$r.Tsize)-1,pr[Mr]=24}if(typeof $r.Name=="string"){const Nr=textEncoder.encode($r.Name);Mr-=Nr.length,pr.set(Nr,Mr),Mr=encodeVarint(pr,Mr,Nr.length)-1,pr[Mr]=18}return $r.Hash&&(Mr-=$r.Hash.length,pr.set($r.Hash,Mr),Mr=encodeVarint(pr,Mr,$r.Hash.length)-1,pr[Mr]=10),pr.length-Mr}function encodeNode($r){const pr=sizeNode($r),Mr=new Uint8Array(pr);let Nr=pr;if($r.Data&&(Nr-=$r.Data.length,Mr.set($r.Data,Nr),Nr=encodeVarint(Mr,Nr,$r.Data.length)-1,Mr[Nr]=10),$r.Links)for(let Dr=$r.Links.length-1;Dr>=0;Dr--){const Br=encodeLink($r.Links[Dr],Mr.subarray(0,Nr));Nr-=Br,Nr=encodeVarint(Mr,Nr,Br)-1,Mr[Nr]=18}return Mr}function sizeLink($r){let pr=0;if($r.Hash){const Mr=$r.Hash.length;pr+=1+Mr+sov(Mr)}if(typeof $r.Name=="string"){const Mr=textEncoder.encode($r.Name).length;pr+=1+Mr+sov(Mr)}return typeof $r.Tsize=="number"&&(pr+=1+sov($r.Tsize)),pr}function sizeNode($r){let pr=0;if($r.Data){const Mr=$r.Data.length;pr+=1+Mr+sov(Mr)}if($r.Links)for(const Mr of $r.Links){const Nr=sizeLink(Mr);pr+=1+Nr+sov(Nr)}return pr}function encodeVarint($r,pr,Mr){pr-=sov(Mr);const Nr=pr;for(;Mr>=maxUInt32;)$r[pr++]=Mr&127|128,Mr/=128;for(;Mr>=128;)$r[pr++]=Mr&127|128,Mr>>>=7;return $r[pr]=Mr,Nr}function sov($r){return $r%2===0&&$r++,Math.floor((len64($r)+6)/7)}function len64($r){let pr=0;return $r>=maxInt32&&($r=Math.floor($r/maxInt32),pr=32),$r>=65536&&($r>>>=16,pr+=16),$r>=256&&($r>>>=8,pr+=8),pr+len8tab[$r]}var len8tab=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8],pbNodeProperties=["Data","Links"],pbLinkProperties=["Hash","Name","Tsize"],textEncoder2=new TextEncoder;function linkComparator($r,pr){if($r===pr)return 0;const Mr=$r.Name?textEncoder2.encode($r.Name):[],Nr=pr.Name?textEncoder2.encode(pr.Name):[];let Dr=Mr.length,Br=Nr.length;for(let Lr=0,jr=Math.min(Dr,Br);Lr<jr;++Lr)if(Mr[Lr]!==Nr[Lr]){Dr=Mr[Lr],Br=Nr[Lr];break}return Dr<Br?-1:Br<Dr?1:0}function hasOnlyProperties($r,pr){return!Object.keys($r).some(Mr=>!pr.includes(Mr))}function asLink($r){if(typeof $r.asCID=="object"){const Mr=CID.asCID($r);if(!Mr)throw new TypeError("Invalid DAG-PB form");return{Hash:Mr}}if(typeof $r!="object"||Array.isArray($r))throw new TypeError("Invalid DAG-PB form");const pr={};if($r.Hash){let Mr=CID.asCID($r.Hash);try{Mr||(typeof $r.Hash=="string"?Mr=CID.parse($r.Hash):$r.Hash instanceof Uint8Array&&(Mr=CID.decode($r.Hash)))}catch(Nr){throw new TypeError(`Invalid DAG-PB form: ${Nr.message}`)}Mr&&(pr.Hash=Mr)}if(!pr.Hash)throw new TypeError("Invalid DAG-PB form");return typeof $r.Name=="string"&&(pr.Name=$r.Name),typeof $r.Tsize=="number"&&(pr.Tsize=$r.Tsize),pr}function prepare($r){if(($r instanceof Uint8Array||typeof $r=="string")&&($r={Data:$r}),typeof $r!="object"||Array.isArray($r))throw new TypeError("Invalid DAG-PB form");const pr={};if($r.Data!==void 0)if(typeof $r.Data=="string")pr.Data=textEncoder2.encode($r.Data);else if($r.Data instanceof Uint8Array)pr.Data=$r.Data;else throw new TypeError("Invalid DAG-PB form");if($r.Links!==void 0)if(Array.isArray($r.Links))pr.Links=$r.Links.map(asLink),pr.Links.sort(linkComparator);else throw new TypeError("Invalid DAG-PB form");else pr.Links=[];return pr}function validate($r){if(!$r||typeof $r!="object"||Array.isArray($r)||$r instanceof Uint8Array||$r["/"]&&$r["/"]===$r.bytes)throw new TypeError("Invalid DAG-PB form");if(!hasOnlyProperties($r,pbNodeProperties))throw new TypeError("Invalid DAG-PB form (extraneous properties)");if($r.Data!==void 0&&!($r.Data instanceof Uint8Array))throw new TypeError("Invalid DAG-PB form (Data must be bytes)");if(!Array.isArray($r.Links))throw new TypeError("Invalid DAG-PB form (Links must be a list)");for(let pr=0;pr<$r.Links.length;pr++){const Mr=$r.Links[pr];if(!Mr||typeof Mr!="object"||Array.isArray(Mr)||Mr instanceof Uint8Array||Mr["/"]&&Mr["/"]===Mr.bytes)throw new TypeError("Invalid DAG-PB form (bad link)");if(!hasOnlyProperties(Mr,pbLinkProperties))throw new TypeError("Invalid DAG-PB form (extraneous properties on link)");if(Mr.Hash===void 0)throw new TypeError("Invalid DAG-PB form (link must have a Hash)");if(Mr.Hash==null||!Mr.Hash["/"]||Mr.Hash["/"]!==Mr.Hash.bytes)throw new TypeError("Invalid DAG-PB form (link Hash must be a CID)");if(Mr.Name!==void 0&&typeof Mr.Name!="string")throw new TypeError("Invalid DAG-PB form (link Name must be a string)");if(Mr.Tsize!==void 0){if(typeof Mr.Tsize!="number"||Mr.Tsize%1!==0)throw new TypeError("Invalid DAG-PB form (link Tsize must be an integer)");if(Mr.Tsize<0)throw new TypeError("Invalid DAG-PB form (link Tsize cannot be negative)")}if(pr>0&&linkComparator(Mr,$r.Links[pr-1])===-1)throw new TypeError("Invalid DAG-PB form (links must be sorted by Name bytes)")}}function createNode($r,pr=[]){return prepare({Data:$r,Links:pr})}function createLink($r,pr,Mr){return asLink({Hash:Mr,Name:$r,Tsize:pr})}var name="dag-pb",code=112;function encode3($r){validate($r);const pr={};return $r.Links&&(pr.Links=$r.Links.map(Mr=>{const Nr={};return Mr.Hash&&(Nr.Hash=Mr.Hash.bytes),Mr.Name!==void 0&&(Nr.Name=Mr.Name),Mr.Tsize!==void 0&&(Nr.Tsize=Mr.Tsize),Nr})),$r.Data&&(pr.Data=$r.Data),encodeNode(pr)}function decode5($r){const pr=decodeNode($r),Mr={};return pr.Data&&(Mr.Data=pr.Data),pr.Links&&(Mr.Links=pr.Links.map(Nr=>{const Dr={};try{Dr.Hash=CID.decode(Nr.Hash)}catch{}if(!Dr.Hash)throw new Error("Invalid Hash field found in link, expected CID");return Nr.Name!==void 0&&(Dr.Name=Nr.Name),Nr.Tsize!==void 0&&(Dr.Tsize=Nr.Tsize),Dr})),Mr}var import_err_code=__toESM(require_err_code(),1),import_reader=__toESM(require_reader(),1),import_reader_buffer=__toESM(require_reader_buffer(),1),import_minimal=__toESM(require_minimal(),1),import_writer=__toESM(require_writer(),1),import_writer_buffer=__toESM(require_writer_buffer(),1);function configure(){import_minimal.default._configure(),import_reader.default._configure(import_reader_buffer.default),import_writer.default._configure(import_writer_buffer.default)}configure();var methods=["uint64","int64","sint64","fixed64","sfixed64"];function patchReader($r){for(const pr of methods){if($r[pr]==null)continue;const Mr=$r[pr];$r[pr]=function(){return BigInt(Mr.call(this).toString())}}return $r}function reader($r){return patchReader(new import_reader.default($r))}function patchWriter($r){for(const pr of methods){if($r[pr]==null)continue;const Mr=$r[pr];$r[pr]=function(Nr){return Mr.call(this,Nr.toString())}}return $r}function writer(){return patchWriter(import_writer.default.create())}function decodeMessage($r,pr){const Mr=reader($r instanceof Uint8Array?$r:$r.subarray());return pr.decode(Mr)}function encodeMessage($r,pr){const Mr=writer();return pr.encode($r,Mr,{lengthDelimited:!1}),Mr.finish()}var CODEC_TYPES;(function($r){$r[$r.VARINT=0]="VARINT",$r[$r.BIT64=1]="BIT64",$r[$r.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",$r[$r.START_GROUP=3]="START_GROUP",$r[$r.END_GROUP=4]="END_GROUP",$r[$r.BIT32=5]="BIT32"})(CODEC_TYPES||(CODEC_TYPES={}));function createCodec($r,pr,Mr,Nr){return{name:$r,type:pr,encode:Mr,decode:Nr}}function enumeration($r){function pr(Dr){if($r[Dr.toString()]==null)throw new Error("Invalid enum value");return $r[Dr]}const Mr=function(Br,Lr){const jr=pr(Br);Lr.int32(jr)},Nr=function(Br){const Lr=Br.int32();return pr(Lr)};return createCodec("enum",CODEC_TYPES.VARINT,Mr,Nr)}function message($r,pr){return createCodec("message",CODEC_TYPES.LENGTH_DELIMITED,$r,pr)}var Data;(function($r){(function(Nr){Nr.Raw="Raw",Nr.Directory="Directory",Nr.File="File",Nr.Metadata="Metadata",Nr.Symlink="Symlink",Nr.HAMTShard="HAMTShard"})($r.DataType||($r.DataType={}));let pr;(function(Nr){Nr[Nr.Raw=0]="Raw",Nr[Nr.Directory=1]="Directory",Nr[Nr.File=2]="File",Nr[Nr.Metadata=3]="Metadata",Nr[Nr.Symlink=4]="Symlink",Nr[Nr.HAMTShard=5]="HAMTShard"})(pr||(pr={})),function(Nr){Nr.codec=()=>enumeration(pr)}($r.DataType||($r.DataType={}));let Mr;$r.codec=()=>(Mr==null&&(Mr=message((Nr,Dr,Br={})=>{if(Br.lengthDelimited!==!1&&Dr.fork(),Nr.Type!=null&&(Dr.uint32(8),$r.DataType.codec().encode(Nr.Type,Dr)),Nr.Data!=null&&(Dr.uint32(18),Dr.bytes(Nr.Data)),Nr.filesize!=null&&(Dr.uint32(24),Dr.uint64(Nr.filesize)),Nr.blocksizes!=null)for(const Lr of Nr.blocksizes)Dr.uint32(32),Dr.uint64(Lr);Nr.hashType!=null&&(Dr.uint32(40),Dr.uint64(Nr.hashType)),Nr.fanout!=null&&(Dr.uint32(48),Dr.uint64(Nr.fanout)),Nr.mode!=null&&(Dr.uint32(56),Dr.uint32(Nr.mode)),Nr.mtime!=null&&(Dr.uint32(66),UnixTime.codec().encode(Nr.mtime,Dr)),Br.lengthDelimited!==!1&&Dr.ldelim()},(Nr,Dr)=>{const Br={blocksizes:[]},Lr=Dr==null?Nr.len:Nr.pos+Dr;for(;Nr.pos<Lr;){const jr=Nr.uint32();switch(jr>>>3){case 1:Br.Type=$r.DataType.codec().decode(Nr);break;case 2:Br.Data=Nr.bytes();break;case 3:Br.filesize=Nr.uint64();break;case 4:Br.blocksizes.push(Nr.uint64());break;case 5:Br.hashType=Nr.uint64();break;case 6:Br.fanout=Nr.uint64();break;case 7:Br.mode=Nr.uint32();break;case 8:Br.mtime=UnixTime.codec().decode(Nr,Nr.uint32());break;default:Nr.skipType(jr&7);break}}return Br})),Mr),$r.encode=Nr=>encodeMessage(Nr,$r.codec()),$r.decode=Nr=>decodeMessage(Nr,$r.codec())})(Data||(Data={}));var UnixTime;(function($r){let pr;$r.codec=()=>(pr==null&&(pr=message((Mr,Nr,Dr={})=>{Dr.lengthDelimited!==!1&&Nr.fork(),Mr.Seconds!=null&&(Nr.uint32(8),Nr.int64(Mr.Seconds)),Mr.FractionalNanoseconds!=null&&(Nr.uint32(21),Nr.fixed32(Mr.FractionalNanoseconds)),Dr.lengthDelimited!==!1&&Nr.ldelim()},(Mr,Nr)=>{const Dr={},Br=Nr==null?Mr.len:Mr.pos+Nr;for(;Mr.pos<Br;){const Lr=Mr.uint32();switch(Lr>>>3){case 1:Dr.Seconds=Mr.int64();break;case 2:Dr.FractionalNanoseconds=Mr.fixed32();break;default:Mr.skipType(Lr&7);break}}return Dr})),pr),$r.encode=Mr=>encodeMessage(Mr,$r.codec()),$r.decode=Mr=>decodeMessage(Mr,$r.codec())})(UnixTime||(UnixTime={}));var Metadata;(function($r){let pr;$r.codec=()=>(pr==null&&(pr=message((Mr,Nr,Dr={})=>{Dr.lengthDelimited!==!1&&Nr.fork(),Mr.MimeType!=null&&(Nr.uint32(10),Nr.string(Mr.MimeType)),Dr.lengthDelimited!==!1&&Nr.ldelim()},(Mr,Nr)=>{const Dr={},Br=Nr==null?Mr.len:Mr.pos+Nr;for(;Mr.pos<Br;){const Lr=Mr.uint32();switch(Lr>>>3){case 1:Dr.MimeType=Mr.string();break;default:Mr.skipType(Lr&7);break}}return Dr})),pr),$r.encode=Mr=>encodeMessage(Mr,$r.codec()),$r.decode=Mr=>decodeMessage(Mr,$r.codec())})(Metadata||(Metadata={}));var types={Raw:"raw",Directory:"directory",File:"file",Metadata:"metadata",Symlink:"symlink",HAMTShard:"hamt-sharded-directory"},dirTypes=["directory","hamt-sharded-directory"],DEFAULT_FILE_MODE=parseInt("0644",8),DEFAULT_DIRECTORY_MODE=parseInt("0755",8),UnixFS=class DE{constructor(pr={type:"file"}){Bu(this,"type");Bu(this,"data");Bu(this,"blockSizes");Bu(this,"hashType");Bu(this,"fanout");Bu(this,"mtime");Bu(this,"_mode");Bu(this,"_originalMode");const{type:Mr,data:Nr,blockSizes:Dr,hashType:Br,fanout:Lr,mtime:jr,mode:Ur}=pr;if(Mr!=null&&!Object.values(types).includes(Mr))throw(0,import_err_code.default)(new Error("Type: "+Mr+" is not valid"),"ERR_INVALID_TYPE");this.type=Mr??"file",this.data=Nr,this.hashType=Br,this.fanout=Lr,this.blockSizes=Dr??[],this._originalMode=0,this.mode=Ur,this.mtime=jr}static unmarshal(pr){const Mr=Data.decode(pr),Nr=new DE({type:types[Mr.Type!=null?Mr.Type.toString():"File"],data:Mr.Data,blockSizes:Mr.blocksizes,mode:Mr.mode,mtime:Mr.mtime!=null?{secs:Mr.mtime.Seconds??0n,nsecs:Mr.mtime.FractionalNanoseconds}:void 0});return Nr._originalMode=Mr.mode??0,Nr}set mode(pr){pr==null?this._mode=this.isDirectory()?DEFAULT_DIRECTORY_MODE:DEFAULT_FILE_MODE:this._mode=pr&4095}get mode(){return this._mode}isDirectory(){return dirTypes.includes(this.type)}addBlockSize(pr){this.blockSizes.push(pr)}removeBlockSize(pr){this.blockSizes.splice(pr,1)}fileSize(){if(this.isDirectory())return 0n;let pr=0n;return this.blockSizes.forEach(Mr=>{pr+=Mr}),this.data!=null&&(pr+=BigInt(this.data.length)),pr}marshal(){let pr;switch(this.type){case"raw":pr=Data.DataType.Raw;break;case"directory":pr=Data.DataType.Directory;break;case"file":pr=Data.DataType.File;break;case"metadata":pr=Data.DataType.Metadata;break;case"symlink":pr=Data.DataType.Symlink;break;case"hamt-sharded-directory":pr=Data.DataType.HAMTShard;break;default:throw(0,import_err_code.default)(new Error(`Type: ${pr} is not valid`),"ERR_INVALID_TYPE")}let Mr=this.data;(this.data==null||this.data.length===0)&&(Mr=void 0);let Nr;this.mode!=null&&(Nr=this._originalMode&4294963200|(this.mode??0),Nr===DEFAULT_FILE_MODE&&!this.isDirectory()&&(Nr=void 0),Nr===DEFAULT_DIRECTORY_MODE&&this.isDirectory()&&(Nr=void 0));let Dr;return this.mtime!=null&&(Dr={Seconds:this.mtime.secs,FractionalNanoseconds:this.mtime.nsecs}),Data.encode({Type:pr,Data:Mr,filesize:this.isDirectory()?void 0:this.fileSize(),blocksizes:this.blockSizes,hashType:this.hashType,fanout:this.fanout,mode:Nr,mtime:Dr})}},raw_exports={};__export(raw_exports,{code:()=>code2,decode:()=>decode6,encode:()=>encode4,name:()=>name2});var equals4=($r,pr)=>{if($r===pr)return!0;if($r.byteLength!==pr.byteLength)return!1;for(let Mr=0;Mr<$r.byteLength;Mr++)if($r[Mr]!==pr[Mr])return!1;return!0},coerce2=$r=>{if($r instanceof Uint8Array&&$r.constructor.name==="Uint8Array")return $r;if($r instanceof ArrayBuffer)return new Uint8Array($r);if(ArrayBuffer.isView($r))return new Uint8Array($r.buffer,$r.byteOffset,$r.byteLength);throw new Error("Unknown type, must be binary type")},name2="raw",code2=85,encode4=$r=>coerce2($r),decode6=$r=>coerce2($r),CustomProgressEvent=class extends Event{constructor($r,pr){super($r),this.detail=pr}},encode_12=encode5,MSB2=128,REST2=127,MSBALL2=~REST2,INT2=Math.pow(2,31);function encode5($r,pr,Mr){pr=pr||[],Mr=Mr||0;for(var Nr=Mr;$r>=INT2;)pr[Mr++]=$r&255|MSB2,$r/=128;for(;$r&MSBALL2;)pr[Mr++]=$r&255|MSB2,$r>>>=7;return pr[Mr]=$r|0,encode5.bytes=Mr-Nr+1,pr}var decode7=read2,MSB$12=128,REST$12=127;function read2($r,Nr){var Mr=0,Nr=Nr||0,Dr=0,Br=Nr,Lr,jr=$r.length;do{if(Br>=jr)throw read2.bytes=0,new RangeError("Could not decode varint");Lr=$r[Br++],Mr+=Dr<28?(Lr&REST$12)<<Dr:(Lr&REST$12)*Math.pow(2,Dr),Dr+=7}while(Lr>=MSB$12);return read2.bytes=Br-Nr,Mr}var N12=Math.pow(2,7),N22=Math.pow(2,14),N32=Math.pow(2,21),N42=Math.pow(2,28),N52=Math.pow(2,35),N62=Math.pow(2,42),N72=Math.pow(2,49),N82=Math.pow(2,56),N92=Math.pow(2,63),length2=function($r){return $r<N12?1:$r<N22?2:$r<N32?3:$r<N42?4:$r<N52?5:$r<N62?6:$r<N72?7:$r<N82?8:$r<N92?9:10},varint2={encode:encode_12,decode:decode7,encodingLength:length2},_brrp_varint2=varint2,varint_default2=_brrp_varint2,decode8=($r,pr=0)=>[varint_default2.decode($r,pr),varint_default2.decode.bytes],encodeTo2=($r,pr,Mr=0)=>(varint_default2.encode($r,pr,Mr),pr),encodingLength2=$r=>varint_default2.encodingLength($r),create2=($r,pr)=>{const Mr=pr.byteLength,Nr=encodingLength2($r),Dr=Nr+encodingLength2(Mr),Br=new Uint8Array(Dr+Mr);return encodeTo2($r,Br,0),encodeTo2(Mr,Br,Nr),Br.set(pr,Dr),new Digest2($r,Mr,pr,Br)},decode9=$r=>{const pr=coerce2($r),[Mr,Nr]=decode8(pr),[Dr,Br]=decode8(pr.subarray(Nr)),Lr=pr.subarray(Nr+Br);if(Lr.byteLength!==Dr)throw new Error("Incorrect length");return new Digest2(Mr,Dr,Lr,pr)},equals5=($r,pr)=>{if($r===pr)return!0;{const Mr=pr;return $r.code===Mr.code&&$r.size===Mr.size&&Mr.bytes instanceof Uint8Array&&equals4($r.bytes,Mr.bytes)}},Digest2=class{constructor($r,pr,Mr,Nr){this.code=$r,this.size=pr,this.digest=Mr,this.bytes=Nr}};function base2($r,pr){if($r.length>=255)throw new TypeError("Alphabet too long");for(var Mr=new Uint8Array(256),Nr=0;Nr<Mr.length;Nr++)Mr[Nr]=255;for(var Dr=0;Dr<$r.length;Dr++){var Br=$r.charAt(Dr),Lr=Br.charCodeAt(0);if(Mr[Lr]!==255)throw new TypeError(Br+" is ambiguous");Mr[Lr]=Dr}var jr=$r.length,Ur=$r.charAt(0),Gr=Math.log(jr)/Math.log(256),Yr=Math.log(256)/Math.log(jr);function Qr(eo){if(eo instanceof Uint8Array||(ArrayBuffer.isView(eo)?eo=new Uint8Array(eo.buffer,eo.byteOffset,eo.byteLength):Array.isArray(eo)&&(eo=Uint8Array.from(eo))),!(eo instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(eo.length===0)return"";for(var _i=0,va=0,io=0,no=eo.length;io!==no&&eo[io]===0;)io++,_i++;for(var so=(no-io)*Yr+1>>>0,ao=new Uint8Array(so);io!==no;){for(var fo=eo[io],lo=0,oo=so-1;(fo!==0||lo<va)&&oo!==-1;oo--,lo++)fo+=256*ao[oo]>>>0,ao[oo]=fo%jr>>>0,fo=fo/jr>>>0;if(fo!==0)throw new Error("Non-zero carry");va=lo,io++}for(var po=so-va;po!==so&&ao[po]===0;)po++;for(var mo=Ur.repeat(_i);po<so;++po)mo+=$r.charAt(ao[po]);return mo}function Wn(eo){if(typeof eo!="string")throw new TypeError("Expected String");if(eo.length===0)return new Uint8Array;var _i=0;if(eo[_i]!==" "){for(var va=0,io=0;eo[_i]===Ur;)va++,_i++;for(var no=(eo.length-_i)*Gr+1>>>0,so=new Uint8Array(no);eo[_i];){var ao=Mr[eo.charCodeAt(_i)];if(ao===255)return;for(var fo=0,lo=no-1;(ao!==0||fo<io)&&lo!==-1;lo--,fo++)ao+=jr*so[lo]>>>0,so[lo]=ao%256>>>0,ao=ao/256>>>0;if(ao!==0)throw new Error("Non-zero carry");io=fo,_i++}if(eo[_i]!==" "){for(var oo=no-io;oo!==no&&so[oo]===0;)oo++;for(var po=new Uint8Array(va+(no-oo)),mo=va;oo!==no;)po[mo++]=so[oo++];return po}}}function ga(eo){var _i=Wn(eo);if(_i)return _i;throw new Error(`Non-${pr} character`)}return{encode:Qr,decodeUnsafe:Wn,decode:ga}}var src2=base2,_brrp__multiformats_scope_baseX2=src2,base_x_default2=_brrp__multiformats_scope_baseX2,Encoder2=class{constructor($r,pr,Mr){this.name=$r,this.prefix=pr,this.baseEncode=Mr}encode($r){if($r instanceof Uint8Array)return`${this.prefix}${this.baseEncode($r)}`;throw Error("Unknown type, must be binary type")}},Decoder2=class{constructor($r,pr,Mr){if(this.name=$r,this.prefix=pr,pr.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=pr.codePointAt(0),this.baseDecode=Mr}decode($r){if(typeof $r=="string"){if($r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify($r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode($r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or($r){return or2(this,$r)}},ComposedDecoder2=class{constructor($r){this.decoders=$r}or($r){return or2(this,$r)}decode($r){const pr=$r[0],Mr=this.decoders[pr];if(Mr)return Mr.decode($r);throw RangeError(`Unable to decode multibase string ${JSON.stringify($r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},or2=($r,pr)=>new ComposedDecoder2({...$r.decoders||{[$r.prefix]:$r},...pr.decoders||{[pr.prefix]:pr}}),Codec2=class{constructor($r,pr,Mr,Nr){this.name=$r,this.prefix=pr,this.baseEncode=Mr,this.baseDecode=Nr,this.encoder=new Encoder2($r,pr,Mr),this.decoder=new Decoder2($r,pr,Nr)}encode($r){return this.encoder.encode($r)}decode($r){return this.decoder.decode($r)}},from2=({name:$r,prefix:pr,encode:Mr,decode:Nr})=>new Codec2($r,pr,Mr,Nr),baseX2=({prefix:$r,name:pr,alphabet:Mr})=>{const{encode:Nr,decode:Dr}=base_x_default2(Mr,pr);return from2({prefix:$r,name:pr,encode:Nr,decode:Br=>coerce2(Dr(Br))})},decode10=($r,pr,Mr,Nr)=>{const Dr={};for(let Yr=0;Yr<pr.length;++Yr)Dr[pr[Yr]]=Yr;let Br=$r.length;for(;$r[Br-1]==="=";)--Br;const Lr=new Uint8Array(Br*Mr/8|0);let jr=0,Ur=0,Gr=0;for(let Yr=0;Yr<Br;++Yr){const Qr=Dr[$r[Yr]];if(Qr===void 0)throw new SyntaxError(`Non-${Nr} character`);Ur=Ur<<Mr|Qr,jr+=Mr,jr>=8&&(jr-=8,Lr[Gr++]=255&Ur>>jr)}if(jr>=Mr||255&Ur<<8-jr)throw new SyntaxError("Unexpected end of data");return Lr},encode6=($r,pr,Mr)=>{const Nr=pr[pr.length-1]==="=",Dr=(1<<Mr)-1;let Br="",Lr=0,jr=0;for(let Ur=0;Ur<$r.length;++Ur)for(jr=jr<<8|$r[Ur],Lr+=8;Lr>Mr;)Lr-=Mr,Br+=pr[Dr&jr>>Lr];if(Lr&&(Br+=pr[Dr&jr<<Mr-Lr]),Nr)for(;Br.length*Mr&7;)Br+="=";return Br},rfc46482=({name:$r,prefix:pr,bitsPerChar:Mr,alphabet:Nr})=>from2({prefix:pr,name:$r,encode(Dr){return encode6(Dr,Nr,Mr)},decode(Dr){return decode10(Dr,Nr,Mr,$r)}}),base58btc2=baseX2({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"});baseX2({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var base322=rfc46482({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5});rfc46482({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),rfc46482({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),rfc46482({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),rfc46482({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),rfc46482({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),rfc46482({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),rfc46482({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),rfc46482({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var format2=($r,pr)=>{const{bytes:Mr,version:Nr}=$r;switch(Nr){case 0:return toStringV02(Mr,baseCache2($r),pr||base58btc2.encoder);default:return toStringV12(Mr,baseCache2($r),pr||base322.encoder)}},cache2=new WeakMap,baseCache2=$r=>{const pr=cache2.get($r);if(pr==null){const Mr=new Map;return cache2.set($r,Mr),Mr}return pr},CID2=class i0{constructor(pr,Mr,Nr,Dr){this.code=Mr,this.version=pr,this.multihash=Nr,this.bytes=Dr,this["/"]=Dr}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{const{code:pr,multihash:Mr}=this;if(pr!==DAG_PB_CODE2)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(Mr.code!==SHA_256_CODE2)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return i0.createV0(Mr)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{const{code:pr,digest:Mr}=this.multihash,Nr=create2(pr,Mr);return i0.createV1(this.code,Nr)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(pr){return i0.equals(this,pr)}static equals(pr,Mr){const Nr=Mr;return Nr&&pr.code===Nr.code&&pr.version===Nr.version&&equals5(pr.multihash,Nr.multihash)}toString(pr){return format2(this,pr)}toJSON(){return{"/":format2(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(pr){if(pr==null)return null;const Mr=pr;if(Mr instanceof i0)return Mr;if(Mr["/"]!=null&&Mr["/"]===Mr.bytes||Mr.asCID===Mr){const{version:Nr,code:Dr,multihash:Br,bytes:Lr}=Mr;return new i0(Nr,Dr,Br,Lr||encodeCID2(Nr,Dr,Br.bytes))}else if(Mr[cidSymbol2]===!0){const{version:Nr,multihash:Dr,code:Br}=Mr,Lr=decode9(Dr);return i0.create(Nr,Br,Lr)}else return null}static create(pr,Mr,Nr){if(typeof Mr!="number")throw new Error("String codecs are no longer supported");if(!(Nr.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(pr){case 0:{if(Mr!==DAG_PB_CODE2)throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE2}) block encoding`);return new i0(pr,Mr,Nr,Nr.bytes)}case 1:{const Dr=encodeCID2(pr,Mr,Nr.bytes);return new i0(pr,Mr,Nr,Dr)}default:throw new Error("Invalid version")}}static createV0(pr){return i0.create(0,DAG_PB_CODE2,pr)}static createV1(pr,Mr){return i0.create(1,pr,Mr)}static decode(pr){const[Mr,Nr]=i0.decodeFirst(pr);if(Nr.length)throw new Error("Incorrect length");return Mr}static decodeFirst(pr){const Mr=i0.inspectBytes(pr),Nr=Mr.size-Mr.multihashSize,Dr=coerce2(pr.subarray(Nr,Nr+Mr.multihashSize));if(Dr.byteLength!==Mr.multihashSize)throw new Error("Incorrect length");const Br=Dr.subarray(Mr.multihashSize-Mr.digestSize),Lr=new Digest2(Mr.multihashCode,Mr.digestSize,Br,Dr);return[Mr.version===0?i0.createV0(Lr):i0.createV1(Mr.codec,Lr),pr.subarray(Mr.size)]}static inspectBytes(pr){let Mr=0;const Nr=()=>{const[Qr,Wn]=decode8(pr.subarray(Mr));return Mr+=Wn,Qr};let Dr=Nr(),Br=DAG_PB_CODE2;if(Dr===18?(Dr=0,Mr=0):Br=Nr(),Dr!==0&&Dr!==1)throw new RangeError(`Invalid CID version ${Dr}`);const Lr=Mr,jr=Nr(),Ur=Nr(),Gr=Mr+Ur,Yr=Gr-Lr;return{version:Dr,codec:Br,multihashCode:jr,digestSize:Ur,multihashSize:Yr,size:Gr}}static parse(pr,Mr){const[Nr,Dr]=parseCIDtoBytes2(pr,Mr),Br=i0.decode(Dr);if(Br.version===0&&pr[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return baseCache2(Br).set(Nr,pr),Br}},parseCIDtoBytes2=($r,pr)=>{switch($r[0]){case"Q":{const Mr=pr||base58btc2;return[base58btc2.prefix,Mr.decode(`${base58btc2.prefix}${$r}`)]}case base58btc2.prefix:{const Mr=pr||base58btc2;return[base58btc2.prefix,Mr.decode($r)]}case base322.prefix:{const Mr=pr||base322;return[base322.prefix,Mr.decode($r)]}default:{if(pr==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[$r[0],pr.decode($r)]}}},toStringV02=($r,pr,Mr)=>{const{prefix:Nr}=Mr;if(Nr!==base58btc2.prefix)throw Error(`Cannot string encode V0 in ${Mr.name} encoding`);const Dr=pr.get(Nr);if(Dr==null){const Br=Mr.encode($r).slice(1);return pr.set(Nr,Br),Br}else return Dr},toStringV12=($r,pr,Mr)=>{const{prefix:Nr}=Mr,Dr=pr.get(Nr);if(Dr==null){const Br=Mr.encode($r);return pr.set(Nr,Br),Br}else return Dr},DAG_PB_CODE2=112,SHA_256_CODE2=18,encodeCID2=($r,pr,Mr)=>{const Nr=encodingLength2($r),Dr=Nr+encodingLength2(pr),Br=new Uint8Array(Dr+Mr.byteLength);return encodeTo2($r,Br,0),encodeTo2(pr,Br,Nr),Br.set(Mr,Dr),Br},cidSymbol2=Symbol.for("@ipld/js-cid/CID"),import_crypto=__toESM(requireCryptoBrowserify(),1),from3=({name:$r,code:pr,encode:Mr})=>new Hasher($r,pr,Mr),Hasher=class{constructor($r,pr,Mr){this.name=$r,this.code=pr,this.encode=Mr}digest($r){if($r instanceof Uint8Array){const pr=this.encode($r);return pr instanceof Uint8Array?create2(this.code,pr):pr.then(Mr=>create2(this.code,Mr))}else throw Error("Unknown type, must be binary type")}},sha256=from3({name:"sha2-256",code:18,encode:$r=>coerce2(import_crypto.default.createHash("sha256").update($r).digest())}),persist=async($r,pr,Mr)=>{Mr.codec==null&&(Mr.codec=src_exports);const Nr=await sha256.digest($r),Dr=CID2.create(Mr.cidVersion,Mr.codec.code,Nr);return await pr.put(Dr,$r,Mr),Dr};function defaultBufferImporter($r){return async function*(Mr,Nr){let Dr=0n;for await(let Br of Mr.content)yield async()=>{var Gr;let Lr;const jr={codec:src_exports,cidVersion:$r.cidVersion,onProgress:$r.onProgress};$r.rawLeaves?(jr.codec=raw_exports,jr.cidVersion=1):(Lr=new UnixFS({type:$r.leafType,data:Br}),Br=encode3({Data:Lr.marshal(),Links:[]}));const Ur=await persist(Br,Nr,jr);return Dr+=BigInt(Br.byteLength),(Gr=$r.onProgress)==null||Gr.call($r,new CustomProgressEvent("unixfs:importer:progress:file:write",{bytesWritten:Dr,cid:Ur,path:Mr.path})),{cid:Ur,unixfs:Lr,size:BigInt(Br.length),block:Br}}}}var import_err_code2=__toESM(require_err_code(),1),dirBuilder=async($r,pr,Mr)=>{const Nr=new UnixFS({type:"directory",mtime:$r.mtime,mode:$r.mode}),Dr=encode3(prepare({Data:Nr.marshal()})),Br=await persist(Dr,pr,Mr),Lr=$r.path;return{cid:Br,path:Lr,unixfs:Nr,size:BigInt(Dr.length),originalPath:$r.originalPath,block:Dr}};async function*buildFileBatch($r,pr,Mr){let Nr=-1,Dr;for await(const Br of parallelBatch(Mr.bufferImporter($r,pr),Mr.blockWriteConcurrency)){if(Nr++,Nr===0){Dr={...Br,single:!0};continue}else Nr===1&&Dr!=null&&(yield{...Dr,block:void 0,single:void 0},Dr=void 0);yield{...Br,block:void 0}}Dr!=null&&(yield Dr)}function isSingleBlockImport($r){return $r.single===!0}var reduce=($r,pr,Mr)=>async function(Dr){var Yr,Qr;if(Dr.length===1&&isSingleBlockImport(Dr[0])&&Mr.reduceSingleLeafToSelf){const Wn=Dr[0];let ga=Wn.block;return isSingleBlockImport(Wn)&&($r.mtime!==void 0||$r.mode!==void 0)&&(Wn.unixfs=new UnixFS({type:"file",mtime:$r.mtime,mode:$r.mode,data:Wn.block}),ga={Data:Wn.unixfs.marshal(),Links:[]},Wn.block=encode3(prepare(ga)),Wn.cid=await persist(Wn.block,pr,{...Mr,cidVersion:Mr.cidVersion}),Wn.size=BigInt(Wn.block.length)),(Yr=Mr.onProgress)==null||Yr.call(Mr,new CustomProgressEvent("unixfs:importer:progress:file:layout",{cid:Wn.cid,path:Wn.originalPath})),{cid:Wn.cid,path:$r.path,unixfs:Wn.unixfs,size:Wn.size,originalPath:Wn.originalPath}}const Br=new UnixFS({type:"file",mtime:$r.mtime,mode:$r.mode}),Lr=Dr.filter(Wn=>{var ga,eo;return Wn.cid.code===code2&&Wn.size>0||Wn.unixfs!=null&&Wn.unixfs.data==null&&Wn.unixfs.fileSize()>0n?!0:!!((eo=(ga=Wn.unixfs)==null?void 0:ga.data)!=null&&eo.length)}).map(Wn=>{var ga;return Wn.cid.code===code2?(Br.addBlockSize(Wn.size),{Name:"",Tsize:Number(Wn.size),Hash:Wn.cid}):(Wn.unixfs==null||Wn.unixfs.data==null?Br.addBlockSize(((ga=Wn.unixfs)==null?void 0:ga.fileSize())??0n):Br.addBlockSize(BigInt(Wn.unixfs.data.length)),{Name:"",Tsize:Number(Wn.size),Hash:Wn.cid})}),jr={Data:Br.marshal(),Links:Lr},Ur=encode3(prepare(jr)),Gr=await persist(Ur,pr,Mr);return(Qr=Mr.onProgress)==null||Qr.call(Mr,new CustomProgressEvent("unixfs:importer:progress:file:layout",{cid:Gr,path:$r.originalPath})),{cid:Gr,path:$r.path,unixfs:Br,size:BigInt(Ur.length+jr.Links.reduce((Wn,ga)=>Wn+(ga.Tsize??0),0)),originalPath:$r.originalPath,block:Ur}},fileBuilder=async($r,pr,Mr)=>Mr.layout(buildFileBatch($r,pr,Mr),reduce($r,pr,Mr));function isIterable($r){return Symbol.iterator in $r}function isAsyncIterable2($r){return Symbol.asyncIterator in $r}function contentAsAsyncIterable($r){try{if($r instanceof Uint8Array)return async function*(){yield $r}();if(isIterable($r))return async function*(){yield*$r}();if(isAsyncIterable2($r))return $r}catch{throw(0,import_err_code2.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT")}throw(0,import_err_code2.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT")}function defaultDagBuilder($r){return async function*(Mr,Nr){for await(const Dr of Mr){let Br;if(Dr.path!=null&&(Br=Dr.path,Dr.path=Dr.path.split("/").filter(Lr=>Lr!=null&&Lr!==".").join("/")),isFileCandidate(Dr)){const Lr={path:Dr.path,mtime:Dr.mtime,mode:Dr.mode,content:async function*(){var Ur;let jr=0n;for await(const Gr of $r.chunker($r.chunkValidator(contentAsAsyncIterable(Dr.content)))){const Yr=BigInt(Gr.byteLength);jr+=Yr,(Ur=$r.onProgress)==null||Ur.call($r,new CustomProgressEvent("unixfs:importer:progress:file:read",{bytesRead:jr,chunkSize:Yr,path:Dr.path})),yield Gr}}(),originalPath:Br};yield async()=>fileBuilder(Lr,Nr,$r)}else if(Dr.path!=null){const Lr={path:Dr.path,mtime:Dr.mtime,mode:Dr.mode,originalPath:Br};yield async()=>dirBuilder(Lr,Nr,$r)}else throw new Error("Import candidate must have content or path or both")}}}function isFileCandidate($r){return $r.content!=null}var import_err_code3=__toESM(require_err_code(),1),identity_exports={};__export(identity_exports,{identity:()=>identity});function base3($r,pr){if($r.length>=255)throw new TypeError("Alphabet too long");for(var Mr=new Uint8Array(256),Nr=0;Nr<Mr.length;Nr++)Mr[Nr]=255;for(var Dr=0;Dr<$r.length;Dr++){var Br=$r.charAt(Dr),Lr=Br.charCodeAt(0);if(Mr[Lr]!==255)throw new TypeError(Br+" is ambiguous");Mr[Lr]=Dr}var jr=$r.length,Ur=$r.charAt(0),Gr=Math.log(jr)/Math.log(256),Yr=Math.log(256)/Math.log(jr);function Qr(eo){if(eo instanceof Uint8Array||(ArrayBuffer.isView(eo)?eo=new Uint8Array(eo.buffer,eo.byteOffset,eo.byteLength):Array.isArray(eo)&&(eo=Uint8Array.from(eo))),!(eo instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(eo.length===0)return"";for(var _i=0,va=0,io=0,no=eo.length;io!==no&&eo[io]===0;)io++,_i++;for(var so=(no-io)*Yr+1>>>0,ao=new Uint8Array(so);io!==no;){for(var fo=eo[io],lo=0,oo=so-1;(fo!==0||lo<va)&&oo!==-1;oo--,lo++)fo+=256*ao[oo]>>>0,ao[oo]=fo%jr>>>0,fo=fo/jr>>>0;if(fo!==0)throw new Error("Non-zero carry");va=lo,io++}for(var po=so-va;po!==so&&ao[po]===0;)po++;for(var mo=Ur.repeat(_i);po<so;++po)mo+=$r.charAt(ao[po]);return mo}function Wn(eo){if(typeof eo!="string")throw new TypeError("Expected String");if(eo.length===0)return new Uint8Array;var _i=0;if(eo[_i]!==" "){for(var va=0,io=0;eo[_i]===Ur;)va++,_i++;for(var no=(eo.length-_i)*Gr+1>>>0,so=new Uint8Array(no);eo[_i];){var ao=Mr[eo.charCodeAt(_i)];if(ao===255)return;for(var fo=0,lo=no-1;(ao!==0||fo<io)&&lo!==-1;lo--,fo++)ao+=jr*so[lo]>>>0,so[lo]=ao%256>>>0,ao=ao/256>>>0;if(ao!==0)throw new Error("Non-zero carry");io=fo,_i++}if(eo[_i]!==" "){for(var oo=no-io;oo!==no&&so[oo]===0;)oo++;for(var po=new Uint8Array(va+(no-oo)),mo=va;oo!==no;)po[mo++]=so[oo++];return po}}}function ga(eo){var _i=Wn(eo);if(_i)return _i;throw new Error(`Non-${pr} character`)}return{encode:Qr,decodeUnsafe:Wn,decode:ga}}var src3=base3,_brrp__multiformats_scope_baseX3=src3,base_x_default3=_brrp__multiformats_scope_baseX3,coerce3=$r=>{if($r instanceof Uint8Array&&$r.constructor.name==="Uint8Array")return $r;if($r instanceof ArrayBuffer)return new Uint8Array($r);if(ArrayBuffer.isView($r))return new Uint8Array($r.buffer,$r.byteOffset,$r.byteLength);throw new Error("Unknown type, must be binary type")},fromString2=$r=>new TextEncoder().encode($r),toString2=$r=>new TextDecoder().decode($r),Encoder3=class{constructor($r,pr,Mr){this.name=$r,this.prefix=pr,this.baseEncode=Mr}encode($r){if($r instanceof Uint8Array)return`${this.prefix}${this.baseEncode($r)}`;throw Error("Unknown type, must be binary type")}},Decoder3=class{constructor($r,pr,Mr){if(this.name=$r,this.prefix=pr,pr.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=pr.codePointAt(0),this.baseDecode=Mr}decode($r){if(typeof $r=="string"){if($r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify($r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode($r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or($r){return or3(this,$r)}},ComposedDecoder3=class{constructor($r){this.decoders=$r}or($r){return or3(this,$r)}decode($r){const pr=$r[0],Mr=this.decoders[pr];if(Mr)return Mr.decode($r);throw RangeError(`Unable to decode multibase string ${JSON.stringify($r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},or3=($r,pr)=>new ComposedDecoder3({...$r.decoders||{[$r.prefix]:$r},...pr.decoders||{[pr.prefix]:pr}}),Codec3=class{constructor($r,pr,Mr,Nr){this.name=$r,this.prefix=pr,this.baseEncode=Mr,this.baseDecode=Nr,this.encoder=new Encoder3($r,pr,Mr),this.decoder=new Decoder3($r,pr,Nr)}encode($r){return this.encoder.encode($r)}decode($r){return this.decoder.decode($r)}},from4=({name:$r,prefix:pr,encode:Mr,decode:Nr})=>new Codec3($r,pr,Mr,Nr),baseX3=({prefix:$r,name:pr,alphabet:Mr})=>{const{encode:Nr,decode:Dr}=base_x_default3(Mr,pr);return from4({prefix:$r,name:pr,encode:Nr,decode:Br=>coerce3(Dr(Br))})},decode11=($r,pr,Mr,Nr)=>{const Dr={};for(let Yr=0;Yr<pr.length;++Yr)Dr[pr[Yr]]=Yr;let Br=$r.length;for(;$r[Br-1]==="=";)--Br;const Lr=new Uint8Array(Br*Mr/8|0);let jr=0,Ur=0,Gr=0;for(let Yr=0;Yr<Br;++Yr){const Qr=Dr[$r[Yr]];if(Qr===void 0)throw new SyntaxError(`Non-${Nr} character`);Ur=Ur<<Mr|Qr,jr+=Mr,jr>=8&&(jr-=8,Lr[Gr++]=255&Ur>>jr)}if(jr>=Mr||255&Ur<<8-jr)throw new SyntaxError("Unexpected end of data");return Lr},encode7=($r,pr,Mr)=>{const Nr=pr[pr.length-1]==="=",Dr=(1<<Mr)-1;let Br="",Lr=0,jr=0;for(let Ur=0;Ur<$r.length;++Ur)for(jr=jr<<8|$r[Ur],Lr+=8;Lr>Mr;)Lr-=Mr,Br+=pr[Dr&jr>>Lr];if(Lr&&(Br+=pr[Dr&jr<<Mr-Lr]),Nr)for(;Br.length*Mr&7;)Br+="=";return Br},rfc46483=({name:$r,prefix:pr,bitsPerChar:Mr,alphabet:Nr})=>from4({prefix:pr,name:$r,encode(Dr){return encode7(Dr,Nr,Mr)},decode(Dr){return decode11(Dr,Nr,Mr,$r)}}),identity=from4({prefix:"\0",name:"identity",encode:$r=>toString2($r),decode:$r=>fromString2($r)}),base2_exports={};__export(base2_exports,{base2:()=>base22});var base22=rfc46483({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),base8_exports={};__export(base8_exports,{base8:()=>base8});var base8=rfc46483({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base10_exports={};__export(base10_exports,{base10:()=>base10});var base10=baseX3({prefix:"9",name:"base10",alphabet:"0123456789"}),base16_exports={};__export(base16_exports,{base16:()=>base16,base16upper:()=>base16upper});var base16=rfc46483({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper=rfc46483({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),base32_exports={};__export(base32_exports,{base32:()=>base323,base32hex:()=>base32hex3,base32hexpad:()=>base32hexpad3,base32hexpadupper:()=>base32hexpadupper3,base32hexupper:()=>base32hexupper3,base32pad:()=>base32pad3,base32padupper:()=>base32padupper3,base32upper:()=>base32upper3,base32z:()=>base32z3});var base323=rfc46483({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper3=rfc46483({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad3=rfc46483({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper3=rfc46483({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex3=rfc46483({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper3=rfc46483({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad3=rfc46483({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper3=rfc46483({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z3=rfc46483({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base36_exports={};__export(base36_exports,{base36:()=>base36,base36upper:()=>base36upper});var base36=baseX3({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper=baseX3({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base58_exports={};__export(base58_exports,{base58btc:()=>base58btc3,base58flickr:()=>base58flickr3});var base58btc3=baseX3({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr3=baseX3({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base64_exports={};__export(base64_exports,{base64:()=>base64,base64pad:()=>base64pad,base64url:()=>base64url,base64urlpad:()=>base64urlpad});var base64=rfc46483({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad=rfc46483({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url=rfc46483({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad=rfc46483({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base256emoji_exports={};__export(base256emoji_exports,{base256emoji:()=>base256emoji});var alphabet=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),alphabetBytesToChars=alphabet.reduce(($r,pr,Mr)=>($r[Mr]=pr,$r),[]),alphabetCharsToBytes=alphabet.reduce(($r,pr,Mr)=>($r[pr.codePointAt(0)]=Mr,$r),[]);function encode8($r){return $r.reduce((pr,Mr)=>(pr+=alphabetBytesToChars[Mr],pr),"")}function decode12($r){const pr=[];for(const Mr of $r){const Nr=alphabetCharsToBytes[Mr.codePointAt(0)];if(Nr===void 0)throw new Error(`Non-base256emoji character: ${Mr}`);pr.push(Nr)}return new Uint8Array(pr)}var base256emoji=from4({prefix:"🚀",name:"base256emoji",encode:encode8,decode:decode12}),sha2_exports={};__export(sha2_exports,{sha256:()=>sha2562,sha512:()=>sha5122});var import_crypto2=__toESM(requireCryptoBrowserify(),1),encode_13=encode9,MSB3=128,REST3=127,MSBALL3=~REST3,INT3=Math.pow(2,31);function encode9($r,pr,Mr){pr=pr||[],Mr=Mr||0;for(var Nr=Mr;$r>=INT3;)pr[Mr++]=$r&255|MSB3,$r/=128;for(;$r&MSBALL3;)pr[Mr++]=$r&255|MSB3,$r>>>=7;return pr[Mr]=$r|0,encode9.bytes=Mr-Nr+1,pr}var decode13=read3,MSB$13=128,REST$13=127;function read3($r,Nr){var Mr=0,Nr=Nr||0,Dr=0,Br=Nr,Lr,jr=$r.length;do{if(Br>=jr)throw read3.bytes=0,new RangeError("Could not decode varint");Lr=$r[Br++],Mr+=Dr<28?(Lr&REST$13)<<Dr:(Lr&REST$13)*Math.pow(2,Dr),Dr+=7}while(Lr>=MSB$13);return read3.bytes=Br-Nr,Mr}var N13=Math.pow(2,7),N23=Math.pow(2,14),N33=Math.pow(2,21),N43=Math.pow(2,28),N53=Math.pow(2,35),N63=Math.pow(2,42),N73=Math.pow(2,49),N83=Math.pow(2,56),N93=Math.pow(2,63),length3=function($r){return $r<N13?1:$r<N23?2:$r<N33?3:$r<N43?4:$r<N53?5:$r<N63?6:$r<N73?7:$r<N83?8:$r<N93?9:10},varint3={encode:encode_13,decode:decode13,encodingLength:length3},_brrp_varint3=varint3,varint_default3=_brrp_varint3,encodeTo3=($r,pr,Mr=0)=>(varint_default3.encode($r,pr,Mr),pr),encodingLength3=$r=>varint_default3.encodingLength($r),create3=($r,pr)=>{const Mr=pr.byteLength,Nr=encodingLength3($r),Dr=Nr+encodingLength3(Mr),Br=new Uint8Array(Dr+Mr);return encodeTo3($r,Br,0),encodeTo3(Mr,Br,Nr),Br.set(pr,Dr),new Digest3($r,Mr,pr,Br)},Digest3=class{constructor($r,pr,Mr,Nr){this.code=$r,this.size=pr,this.digest=Mr,this.bytes=Nr}},from5=({name:$r,code:pr,encode:Mr})=>new Hasher2($r,pr,Mr),Hasher2=class{constructor($r,pr,Mr){this.name=$r,this.code=pr,this.encode=Mr}digest($r){if($r instanceof Uint8Array){const pr=this.encode($r);return pr instanceof Uint8Array?create3(this.code,pr):pr.then(Mr=>create3(this.code,Mr))}else throw Error("Unknown type, must be binary type")}},sha2562=from5({name:"sha2-256",code:18,encode:$r=>coerce3(import_crypto2.default.createHash("sha256").update($r).digest())}),sha5122=from5({name:"sha2-512",code:19,encode:$r=>coerce3(import_crypto2.default.createHash("sha512").update($r).digest())}),identity_exports2={};__export(identity_exports2,{identity:()=>identity2});var code3=0,name3="identity",encode10=coerce3,digest=$r=>create3(code3,encode10($r)),identity2={code:code3,name:name3,encode:encode10,digest};new TextEncoder,new TextDecoder;var bases={...identity_exports,...base2_exports,...base8_exports,...base10_exports,...base16_exports,...base32_exports,...base36_exports,...base58_exports,...base64_exports,...base256emoji_exports};({...sha2_exports,...identity_exports2});function createCodec2($r,pr,Mr,Nr){return{name:$r,prefix:pr,encoder:{name:$r,prefix:pr,encode:Mr},decoder:{decode:Nr}}}var string=createCodec2("utf8","u",$r=>"u"+new TextDecoder("utf8").decode($r),$r=>new TextEncoder().encode($r.substring(1))),ascii=createCodec2("ascii","a",$r=>{let pr="a";for(let Mr=0;Mr<$r.length;Mr++)pr+=String.fromCharCode($r[Mr]);return pr},$r=>{$r=$r.substring(1);const pr=allocUnsafe($r.length);for(let Mr=0;Mr<$r.length;Mr++)pr[Mr]=$r.charCodeAt(Mr);return pr}),BASES={utf8:string,"utf-8":string,hex:bases.base16,latin1:ascii,ascii,binary:ascii,...bases},bases_default=BASES;function fromString3($r,pr="utf8"){const Mr=bases_default[pr];if(Mr==null)throw new Error(`Unsupported encoding "${pr}"`);return(pr==="utf8"||pr==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?asUint8Array(globalThis.Buffer.from($r,"utf-8")):Mr.decoder.decode(`${Mr.prefix}${$r}`)}var defaultChunkValidator=()=>async function*(pr){for await(const Mr of pr){if(Mr.length===void 0)throw(0,import_err_code3.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT");if(typeof Mr=="string"||Mr instanceof String)yield fromString3(Mr.toString());else if(Array.isArray(Mr))yield Uint8Array.from(Mr);else if(Mr instanceof Uint8Array)yield Mr;else throw(0,import_err_code3.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT")}},DEFAULT_MAX_CHILDREN_PER_NODE=174;function balanced($r){const pr=($r==null?void 0:$r.maxChildrenPerNode)??DEFAULT_MAX_CHILDREN_PER_NODE;return async function Mr(Nr,Dr){const Br=[];for await(const Lr of src_default(Nr,pr))Br.push(await Dr(Lr));return Br.length>1?Mr(Br,Dr):Br[0]}}var Dir=class{constructor($r,pr){Bu(this,"options");Bu(this,"root");Bu(this,"dir");Bu(this,"path");Bu(this,"dirty");Bu(this,"flat");Bu(this,"parent");Bu(this,"parentKey");Bu(this,"unixfs");Bu(this,"mode");Bu(this,"mtime");Bu(this,"cid");Bu(this,"size");Bu(this,"nodeSize");this.options=pr??{},this.root=$r.root,this.dir=$r.dir,this.path=$r.path,this.dirty=$r.dirty,this.flat=$r.flat,this.parent=$r.parent,this.parentKey=$r.parentKey,this.unixfs=$r.unixfs,this.mode=$r.mode,this.mtime=$r.mtime}},CID_V0=CID2.parse("QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn"),CID_V1=CID2.parse("zdj7WbTaiJT1fgatdet9Ei9iDB5hdCxkbVyhyh8YTUnXMiwYi"),DirFlat=class extends Dir{constructor(pr,Mr){super(pr,Mr);Bu(this,"_children");this._children=new Map}async put(pr,Mr){this.cid=void 0,this.size=void 0,this.nodeSize=void 0,this._children.set(pr,Mr)}async get(pr){return Promise.resolve(this._children.get(pr))}childCount(){return this._children.size}directChildrenCount(){return this.childCount()}onlyChild(){return this._children.values().next().value}async*eachChildSeries(){for(const[pr,Mr]of this._children.entries())yield{key:pr,child:Mr}}estimateNodeSize(){if(this.nodeSize!==void 0)return this.nodeSize;this.nodeSize=0;for(const[pr,Mr]of this._children.entries())Mr.size!=null&&Mr.cid!=null&&(this.nodeSize+=pr.length+(this.options.cidVersion===1?CID_V1.bytes.byteLength:CID_V0.bytes.byteLength));return this.nodeSize}async*flush(pr){const Mr=[];for(const[Ur,Gr]of this._children.entries()){let Yr=Gr;if(Gr instanceof Dir)for await(const Qr of Gr.flush(pr))Yr=Qr,yield Qr;Yr.size!=null&&Yr.cid!=null&&Mr.push({Name:Ur,Tsize:Number(Yr.size),Hash:Yr.cid})}const Nr=new UnixFS({type:"directory",mtime:this.mtime,mode:this.mode}),Dr={Data:Nr.marshal(),Links:Mr},Br=encode3(prepare(Dr)),Lr=await persist(Br,pr,this.options),jr=Br.length+Dr.Links.reduce((Ur,Gr)=>Ur+(Gr.Tsize==null?0:Gr.Tsize),0);this.cid=Lr,this.size=jr,yield{cid:Lr,unixfs:Nr,path:this.path,size:BigInt(jr)}}},from6=({name:$r,code:pr,encode:Mr})=>new Hasher3($r,pr,Mr),Hasher3=class{constructor($r,pr,Mr){this.name=$r,this.code=pr,this.encode=Mr}digest($r){if($r instanceof Uint8Array){const pr=this.encode($r);return pr instanceof Uint8Array?create(this.code,pr):pr.then(Mr=>create(this.code,Mr))}else throw Error("Unknown type, must be binary type")}},import_murmurhash3js_revisited=__toESM(require_murmurhash3js_revisited(),1),murmur3128=from6({name:"murmur3-128",code:34,encode:$r=>bytes_exports.fromHex(import_murmurhash3js_revisited.default.x64.hash128($r))}),import_sparse_array=__toESM(require_sparse_array(),1),Bucket=class _g{constructor(pr,Mr,Nr=0){this._options=pr,this._popCount=0,this._parent=Mr,this._posAtParent=Nr,this._children=new import_sparse_array.default,this.key=null}async put(pr,Mr){const Nr=await this._findNewBucketAndPos(pr);await Nr.bucket._putAt(Nr,pr,Mr)}async get(pr){const Mr=await this._findChild(pr);if(Mr!=null)return Mr.value}async del(pr){const Mr=await this._findPlace(pr),Nr=Mr.bucket._at(Mr.pos);Nr!=null&&Nr.key===pr&&Mr.bucket._delAt(Mr.pos)}leafCount(){return this._children.compactArray().reduce((Mr,Nr)=>Nr instanceof _g?Mr+Nr.leafCount():Mr+1,0)}childrenCount(){return this._children.length}onlyChild(){return this._children.get(0)}*eachLeafSeries(){const pr=this._children.compactArray();for(const Mr of pr)Mr instanceof _g?yield*Mr.eachLeafSeries():yield Mr}serialize(pr,Mr){const Nr=[];return Mr(this._children.reduce((Dr,Br,Lr)=>(Br!=null&&(Br instanceof _g?Dr.push(Br.serialize(pr,Mr)):Dr.push(pr(Br,Lr))),Dr),Nr))}async asyncTransform(pr,Mr){return await asyncTransformBucket(this,pr,Mr)}toJSON(){return this.serialize(mapNode,reduceNodes)}prettyPrint(){return JSON.stringify(this.toJSON(),null," ")}tableSize(){return Math.pow(2,this._options.bits)}async _findChild(pr){const Mr=await this._findPlace(pr),Nr=Mr.bucket._at(Mr.pos);if(!(Nr instanceof _g)&&Nr!=null&&Nr.key===pr)return Nr}async _findPlace(pr){const Mr=this._options.hash(typeof pr=="string"?fromString3(pr):pr),Nr=await Mr.take(this._options.bits),Dr=this._children.get(Nr);return Dr instanceof _g?await Dr._findPlace(Mr):{bucket:this,pos:Nr,hash:Mr,existingChild:Dr}}async _findNewBucketAndPos(pr){const Mr=await this._findPlace(pr);if(Mr.existingChild!=null&&Mr.existingChild.key!==pr){const Nr=new _g(this._options,Mr.bucket,Mr.pos);Mr.bucket._putObjectAt(Mr.pos,Nr);const Dr=await Nr._findPlace(Mr.existingChild.hash);return Dr.bucket._putAt(Dr,Mr.existingChild.key,Mr.existingChild.value),await Nr._findNewBucketAndPos(Mr.hash)}return Mr}_putAt(pr,Mr,Nr){this._putObjectAt(pr.pos,{key:Mr,value:Nr,hash:pr.hash})}_putObjectAt(pr,Mr){this._children.get(pr)==null&&this._popCount++,this._children.set(pr,Mr)}_delAt(pr){if(pr===-1)throw new Error("Invalid position");this._children.get(pr)!=null&&this._popCount--,this._children.unset(pr),this._level()}_level(){if(this._parent!=null&&this._popCount<=1)if(this._popCount===1){const pr=this._children.find(exists);if(pr!=null&&!(pr instanceof _g)){const Mr=pr.hash;Mr.untake(this._options.bits);const Nr={pos:this._posAtParent,hash:Mr,bucket:this._parent};this._parent._putAt(Nr,pr.key,pr.value)}}else this._parent._delAt(this._posAtParent)}_at(pr){return this._children.get(pr)}};function exists($r){return!!$r}function mapNode($r,pr){return $r.key}function reduceNodes($r){return $r}async function asyncTransformBucket($r,pr,Mr){const Nr=[];for(const Dr of $r._children.compactArray())if(Dr instanceof Bucket)await asyncTransformBucket(Dr,pr,Mr);else{const Br=await pr(Dr);Nr.push({bitField:$r._children.bitField(),children:Br})}return await Mr(Nr)}var START_MASKS=[255,254,252,248,240,224,192,128],STOP_MASKS=[1,3,7,15,31,63,127,255],ConsumableBuffer=class{constructor($r){this._value=$r,this._currentBytePos=$r.length-1,this._currentBitPos=7}availableBits(){return this._currentBitPos+1+this._currentBytePos*8}totalBits(){return this._value.length*8}take($r){let pr=$r,Mr=0;for(;pr>0&&this._haveBits();){const Nr=this._value[this._currentBytePos],Dr=this._currentBitPos+1,Br=Math.min(Dr,pr),Lr=byteBitsToInt(Nr,Dr-Br,Br);Mr=(Mr<<Br)+Lr,pr-=Br,this._currentBitPos-=Br,this._currentBitPos<0&&(this._currentBitPos=7,this._currentBytePos--)}return Mr}untake($r){for(this._currentBitPos+=$r;this._currentBitPos>7;)this._currentBitPos-=8,this._currentBytePos+=1}_haveBits(){return this._currentBytePos>=0}};function byteBitsToInt($r,pr,Mr){const Nr=maskFor(pr,Mr);return($r&Nr)>>>pr}function maskFor($r,pr){return START_MASKS[$r]&STOP_MASKS[Math.min(pr+$r-1,7)]}function wrapHash($r){function pr(Mr){return Mr instanceof InfiniteHash?Mr:new InfiniteHash(Mr,$r)}return pr}var InfiniteHash=class{constructor($r,pr){if(!($r instanceof Uint8Array))throw new Error("can only hash Uint8Arrays");this._value=$r,this._hashFn=pr,this._depth=-1,this._availableBits=0,this._currentBufferIndex=0,this._buffers=[]}async take($r){let pr=$r;for(;this._availableBits<pr;)await this._produceMoreBits();let Mr=0;for(;pr>0;){const Nr=this._buffers[this._currentBufferIndex],Dr=Math.min(Nr.availableBits(),pr),Br=Nr.take(Dr);Mr=(Mr<<Dr)+Br,pr-=Dr,this._availableBits-=Dr,Nr.availableBits()===0&&this._currentBufferIndex++}return Mr}untake($r){let pr=$r;for(;pr>0;){const Mr=this._buffers[this._currentBufferIndex],Nr=Math.min(Mr.totalBits()-Mr.availableBits(),pr);Mr.untake(Nr),pr-=Nr,this._availableBits+=Nr,this._currentBufferIndex>0&&Mr.totalBits()===Mr.availableBits()&&(this._depth--,this._currentBufferIndex--)}}async _produceMoreBits(){this._depth++;const $r=this._depth>0?concat([this._value,Uint8Array.from([this._depth])]):this._value,pr=await this._hashFn($r),Mr=new ConsumableBuffer(pr);this._buffers.push(Mr),this._availableBits+=Mr.availableBits()}};function createHAMT($r){if($r==null||$r.hashFn==null)throw new Error("please define an options.hashFn");const pr={bits:$r.bits??8,hash:wrapHash($r.hashFn)};return new Bucket(pr)}async function hamtHashFn($r){return(await murmur3128.encode($r)).slice(0,8).reverse()}var HAMT_HASH_CODE=BigInt(34),DirSharded=class extends Dir{constructor(pr,Mr){super(pr,Mr);Bu(this,"_bucket");this._bucket=createHAMT({hashFn:hamtHashFn,bits:8})}async put(pr,Mr){this.cid=void 0,this.size=void 0,this.nodeSize=void 0,await this._bucket.put(pr,Mr)}async get(pr){return this._bucket.get(pr)}childCount(){return this._bucket.leafCount()}directChildrenCount(){return this._bucket.childrenCount()}onlyChild(){return this._bucket.onlyChild()}async*eachChildSeries(){for await(const{key:pr,value:Mr}of this._bucket.eachLeafSeries())yield{key:pr,child:Mr}}estimateNodeSize(){return this.nodeSize!==void 0?this.nodeSize:(this.nodeSize=calculateSize(this._bucket,this,this.options),this.nodeSize)}async*flush(pr){for await(const Mr of flush(this._bucket,pr,this,this.options))yield{...Mr,path:this.path}}},dir_sharded_default=DirSharded;async function*flush($r,pr,Mr,Nr){const Dr=$r._children,Br=[];let Lr=0n;for(let ga=0;ga<Dr.length;ga++){const eo=Dr.get(ga);if(eo==null)continue;const _i=ga.toString(16).toUpperCase().padStart(2,"0");if(eo instanceof Bucket){let va;for await(const io of flush(eo,pr,null,Nr))va=io;if(va==null)throw new Error("Could not flush sharded directory, no subshard found");Br.push({Name:_i,Tsize:Number(va.size),Hash:va.cid}),Lr+=va.size}else if(isDir(eo.value)){const va=eo.value;let io;for await(const so of va.flush(pr))io=so,yield io;if(io==null)throw new Error("Did not flush dir");const no=_i+eo.key;Br.push({Name:no,Tsize:Number(io.size),Hash:io.cid}),Lr+=io.size}else{const va=eo.value;if(va.cid==null)continue;const io=_i+eo.key,no=va.size;Br.push({Name:io,Tsize:Number(no),Hash:va.cid}),Lr+=BigInt(no??0)}}const jr=Uint8Array.from(Dr.bitField().reverse()),Ur=new UnixFS({type:"hamt-sharded-directory",data:jr,fanout:BigInt($r.tableSize()),hashType:HAMT_HASH_CODE,mtime:Mr==null?void 0:Mr.mtime,mode:Mr==null?void 0:Mr.mode}),Gr={Data:Ur.marshal(),Links:Br},Yr=encode3(prepare(Gr)),Qr=await persist(Yr,pr,Nr),Wn=BigInt(Yr.byteLength)+Lr;yield{cid:Qr,unixfs:Ur,size:Wn}}function isDir($r){return typeof $r.flush=="function"}function calculateSize($r,pr,Mr){const Nr=$r._children,Dr=[];for(let Ur=0;Ur<Nr.length;Ur++){const Gr=Nr.get(Ur);if(Gr==null)continue;const Yr=Ur.toString(16).toUpperCase().padStart(2,"0");if(Gr instanceof Bucket){const Qr=calculateSize(Gr,null,Mr);Dr.push({Name:Yr,Tsize:Number(Qr),Hash:Mr.cidVersion===0?CID_V0:CID_V1})}else if(typeof Gr.value.flush=="function"){const Wn=Gr.value.nodeSize();Dr.push({Name:Yr+Gr.key,Tsize:Number(Wn),Hash:Mr.cidVersion===0?CID_V0:CID_V1})}else{const Qr=Gr.value;if(Qr.cid==null)continue;const Wn=Yr+Gr.key,ga=Qr.size;Dr.push({Name:Wn,Tsize:Number(ga),Hash:Qr.cid})}}const Br=Uint8Array.from(Nr.bitField().reverse()),Lr=new UnixFS({type:"hamt-sharded-directory",data:Br,fanout:BigInt($r.tableSize()),hashType:HAMT_HASH_CODE,mtime:pr==null?void 0:pr.mtime,mode:pr==null?void 0:pr.mode});return encode3(prepare({Data:Lr.marshal(),Links:Dr})).length}async function flatToShard($r,pr,Mr,Nr){let Dr=pr;pr instanceof DirFlat&&pr.estimateNodeSize()>Mr&&(Dr=await convertToShard(pr,Nr));const Br=Dr.parent;if(Br!=null){if(Dr!==pr){if($r!=null&&($r.parent=Dr),Dr.parentKey==null)throw new Error("No parent key found");await Br.put(Dr.parentKey,Dr)}return flatToShard(Dr,Br,Mr,Nr)}return Dr}async function convertToShard($r,pr){const Mr=new dir_sharded_default({root:$r.root,dir:!0,parent:$r.parent,parentKey:$r.parentKey,path:$r.path,dirty:$r.dirty,flat:!1,mtime:$r.mtime,mode:$r.mode},pr);for await(const{key:Nr,child:Dr}of $r.eachChildSeries())await Mr.put(Nr,Dr);return Mr}var toPathComponents=($r="")=>($r.trim().match(/([^\\/]|\\\/)+/g)??[]).filter(Boolean);async function addToTree($r,pr,Mr){var jr,Ur;const Nr=toPathComponents($r.path??""),Dr=Nr.length-1;let Br=pr,Lr="";for(let Gr=0;Gr<Nr.length;Gr++){const Yr=Nr[Gr];Lr+=`${Lr!==""?"/":""}${Yr}`;const Qr=Gr===Dr;if(Br.dirty=!0,Br.cid=void 0,Br.size=void 0,Qr)await Br.put(Yr,$r),pr=await flatToShard(null,Br,Mr.shardSplitThresholdBytes,Mr);else{let Wn=await Br.get(Yr);(Wn==null||!(Wn instanceof Dir))&&(Wn=new DirFlat({root:!1,dir:!0,parent:Br,parentKey:Yr,path:Lr,dirty:!0,flat:!0,mtime:(jr=Wn==null?void 0:Wn.unixfs)==null?void 0:jr.mtime,mode:(Ur=Wn==null?void 0:Wn.unixfs)==null?void 0:Ur.mode},Mr)),await Br.put(Yr,Wn),Br=Wn}}return pr}async function*flushAndYield($r,pr){var Mr;if(!($r instanceof Dir)){((Mr=$r.unixfs)==null?void 0:Mr.isDirectory())===!0&&(yield $r);return}yield*$r.flush(pr)}function defaultTreeBuilder($r){return async function*(Mr,Nr){let Dr=new DirFlat({root:!0,dir:!0,path:"",dirty:!0,flat:!0},$r),Br,Lr=!1;for await(const jr of Mr){if(jr==null)continue;const Ur=`${jr.originalPath??""}`.split("/")[0];Ur!=null&&Ur!==""&&(Br==null?(Br=Ur,Lr=!0):Br!==Ur&&(Lr=!1)),Dr=await addToTree(jr,Dr,$r),(jr.unixfs==null||!jr.unixfs.isDirectory())&&(yield jr)}if($r.wrapWithDirectory||Lr&&Dr.childCount()>1)yield*flushAndYield(Dr,Nr);else for await(const jr of Dr.eachChildSeries())jr!=null&&(yield*flushAndYield(jr.child,Nr))}}async function*importer($r,pr,Mr={}){let Nr;Symbol.asyncIterator in $r||Symbol.iterator in $r?Nr=$r:Nr=[$r];const Dr=Mr.wrapWithDirectory??!1,Br=Mr.shardSplitThresholdBytes??262144,Lr=Mr.cidVersion??1,jr=Mr.rawLeaves??!0,Ur=Mr.leafType??"file",Gr=Mr.fileImportConcurrency??50,Yr=Mr.blockWriteConcurrency??10,Qr=Mr.reduceSingleLeafToSelf??!0,Wn=Mr.chunker??fixedSize(),ga=Mr.chunkValidator??defaultChunkValidator(),eo=Mr.dagBuilder??defaultDagBuilder({chunker:Wn,chunkValidator:ga,wrapWithDirectory:Dr,layout:Mr.layout??balanced(),bufferImporter:Mr.bufferImporter??defaultBufferImporter({cidVersion:Lr,rawLeaves:jr,leafType:Ur,onProgress:Mr.onProgress}),blockWriteConcurrency:Yr,reduceSingleLeafToSelf:Qr,cidVersion:Lr,onProgress:Mr.onProgress}),_i=Mr.treeBuilder??defaultTreeBuilder({wrapWithDirectory:Dr,shardSplitThresholdBytes:Br,cidVersion:Lr,onProgress:Mr.onProgress});for await(const va of _i(parallelBatch(eo(Nr,pr),Gr),pr))yield{cid:va.cid,path:va.path,unixfs:va.unixfs,size:va.size}}var errors_exports={};__export(errors_exports,{abortedError:()=>abortedError,closeFailedError:()=>closeFailedError,deleteFailedError:()=>deleteFailedError,getFailedError:()=>getFailedError,hasFailedError:()=>hasFailedError,notFoundError:()=>notFoundError,openFailedError:()=>openFailedError,putFailedError:()=>putFailedError});var import_err_code5=__toESM(require_err_code(),1);function openFailedError($r){return $r=$r??new Error("Open failed"),(0,import_err_code5.default)($r,"ERR_OPEN_FAILED")}function closeFailedError($r){return $r=$r??new Error("Close failed"),(0,import_err_code5.default)($r,"ERR_CLOSE_FAILED")}function putFailedError($r){return $r=$r??new Error("Put failed"),(0,import_err_code5.default)($r,"ERR_PUT_FAILED")}function getFailedError($r){return $r=$r??new Error("Get failed"),(0,import_err_code5.default)($r,"ERR_GET_FAILED")}function deleteFailedError($r){return $r=$r??new Error("Delete failed"),(0,import_err_code5.default)($r,"ERR_DELETE_FAILED")}function hasFailedError($r){return $r=$r??new Error("Has failed"),(0,import_err_code5.default)($r,"ERR_HAS_FAILED")}function notFoundError($r){return $r=$r??new Error("Not Found"),(0,import_err_code5.default)($r,"ERR_NOT_FOUND")}function abortedError($r){return $r=$r??new Error("Aborted"),(0,import_err_code5.default)($r,"ERR_ABORTED")}var BaseBlockstore=class{has($r,pr){return Promise.reject(new Error(".has is not implemented"))}put($r,pr,Mr){return Promise.reject(new Error(".put is not implemented"))}async*putMany($r,pr){for await(const{cid:Mr,block:Nr}of $r)await this.put(Mr,Nr,pr),yield Mr}get($r,pr){return Promise.reject(new Error(".get is not implemented"))}async*getMany($r,pr){for await(const Mr of $r)yield{cid:Mr,block:await this.get(Mr,pr)}}async delete($r,pr){await Promise.reject(new Error(".delete is not implemented"))}async*deleteMany($r,pr){for await(const Mr of $r)await this.delete(Mr,pr),yield Mr}async*getAll($r){throw new Error(".getAll is not implemented")}};function base4($r,pr){if($r.length>=255)throw new TypeError("Alphabet too long");for(var Mr=new Uint8Array(256),Nr=0;Nr<Mr.length;Nr++)Mr[Nr]=255;for(var Dr=0;Dr<$r.length;Dr++){var Br=$r.charAt(Dr),Lr=Br.charCodeAt(0);if(Mr[Lr]!==255)throw new TypeError(Br+" is ambiguous");Mr[Lr]=Dr}var jr=$r.length,Ur=$r.charAt(0),Gr=Math.log(jr)/Math.log(256),Yr=Math.log(256)/Math.log(jr);function Qr(eo){if(eo instanceof Uint8Array||(ArrayBuffer.isView(eo)?eo=new Uint8Array(eo.buffer,eo.byteOffset,eo.byteLength):Array.isArray(eo)&&(eo=Uint8Array.from(eo))),!(eo instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(eo.length===0)return"";for(var _i=0,va=0,io=0,no=eo.length;io!==no&&eo[io]===0;)io++,_i++;for(var so=(no-io)*Yr+1>>>0,ao=new Uint8Array(so);io!==no;){for(var fo=eo[io],lo=0,oo=so-1;(fo!==0||lo<va)&&oo!==-1;oo--,lo++)fo+=256*ao[oo]>>>0,ao[oo]=fo%jr>>>0,fo=fo/jr>>>0;if(fo!==0)throw new Error("Non-zero carry");va=lo,io++}for(var po=so-va;po!==so&&ao[po]===0;)po++;for(var mo=Ur.repeat(_i);po<so;++po)mo+=$r.charAt(ao[po]);return mo}function Wn(eo){if(typeof eo!="string")throw new TypeError("Expected String");if(eo.length===0)return new Uint8Array;var _i=0;if(eo[_i]!==" "){for(var va=0,io=0;eo[_i]===Ur;)va++,_i++;for(var no=(eo.length-_i)*Gr+1>>>0,so=new Uint8Array(no);eo[_i];){var ao=Mr[eo.charCodeAt(_i)];if(ao===255)return;for(var fo=0,lo=no-1;(ao!==0||fo<io)&&lo!==-1;lo--,fo++)ao+=jr*so[lo]>>>0,so[lo]=ao%256>>>0,ao=ao/256>>>0;if(ao!==0)throw new Error("Non-zero carry");io=fo,_i++}if(eo[_i]!==" "){for(var oo=no-io;oo!==no&&so[oo]===0;)oo++;for(var po=new Uint8Array(va+(no-oo)),mo=va;oo!==no;)po[mo++]=so[oo++];return po}}}function ga(eo){var _i=Wn(eo);if(_i)return _i;throw new Error(`Non-${pr} character`)}return{encode:Qr,decodeUnsafe:Wn,decode:ga}}var src4=base4,_brrp__multiformats_scope_baseX4=src4,base_x_default4=_brrp__multiformats_scope_baseX4,equals8=($r,pr)=>{if($r===pr)return!0;if($r.byteLength!==pr.byteLength)return!1;for(let Mr=0;Mr<$r.byteLength;Mr++)if($r[Mr]!==pr[Mr])return!1;return!0},coerce4=$r=>{if($r instanceof Uint8Array&&$r.constructor.name==="Uint8Array")return $r;if($r instanceof ArrayBuffer)return new Uint8Array($r);if(ArrayBuffer.isView($r))return new Uint8Array($r.buffer,$r.byteOffset,$r.byteLength);throw new Error("Unknown type, must be binary type")},Encoder4=class{constructor($r,pr,Mr){this.name=$r,this.prefix=pr,this.baseEncode=Mr}encode($r){if($r instanceof Uint8Array)return`${this.prefix}${this.baseEncode($r)}`;throw Error("Unknown type, must be binary type")}},Decoder4=class{constructor($r,pr,Mr){if(this.name=$r,this.prefix=pr,pr.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=pr.codePointAt(0),this.baseDecode=Mr}decode($r){if(typeof $r=="string"){if($r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify($r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode($r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or($r){return or4(this,$r)}},ComposedDecoder4=class{constructor($r){this.decoders=$r}or($r){return or4(this,$r)}decode($r){const pr=$r[0],Mr=this.decoders[pr];if(Mr)return Mr.decode($r);throw RangeError(`Unable to decode multibase string ${JSON.stringify($r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},or4=($r,pr)=>new ComposedDecoder4({...$r.decoders||{[$r.prefix]:$r},...pr.decoders||{[pr.prefix]:pr}}),Codec4=class{constructor($r,pr,Mr,Nr){this.name=$r,this.prefix=pr,this.baseEncode=Mr,this.baseDecode=Nr,this.encoder=new Encoder4($r,pr,Mr),this.decoder=new Decoder4($r,pr,Nr)}encode($r){return this.encoder.encode($r)}decode($r){return this.decoder.decode($r)}},from7=({name:$r,prefix:pr,encode:Mr,decode:Nr})=>new Codec4($r,pr,Mr,Nr),baseX4=({prefix:$r,name:pr,alphabet:Mr})=>{const{encode:Nr,decode:Dr}=base_x_default4(Mr,pr);return from7({prefix:$r,name:pr,encode:Nr,decode:Br=>coerce4(Dr(Br))})},decode16=($r,pr,Mr,Nr)=>{const Dr={};for(let Yr=0;Yr<pr.length;++Yr)Dr[pr[Yr]]=Yr;let Br=$r.length;for(;$r[Br-1]==="=";)--Br;const Lr=new Uint8Array(Br*Mr/8|0);let jr=0,Ur=0,Gr=0;for(let Yr=0;Yr<Br;++Yr){const Qr=Dr[$r[Yr]];if(Qr===void 0)throw new SyntaxError(`Non-${Nr} character`);Ur=Ur<<Mr|Qr,jr+=Mr,jr>=8&&(jr-=8,Lr[Gr++]=255&Ur>>jr)}if(jr>=Mr||255&Ur<<8-jr)throw new SyntaxError("Unexpected end of data");return Lr},encode11=($r,pr,Mr)=>{const Nr=pr[pr.length-1]==="=",Dr=(1<<Mr)-1;let Br="",Lr=0,jr=0;for(let Ur=0;Ur<$r.length;++Ur)for(jr=jr<<8|$r[Ur],Lr+=8;Lr>Mr;)Lr-=Mr,Br+=pr[Dr&jr>>Lr];if(Lr&&(Br+=pr[Dr&jr<<Mr-Lr]),Nr)for(;Br.length*Mr&7;)Br+="=";return Br},rfc46484=({name:$r,prefix:pr,bitsPerChar:Mr,alphabet:Nr})=>from7({prefix:pr,name:$r,encode(Dr){return encode11(Dr,Nr,Mr)},decode(Dr){return decode16(Dr,Nr,Mr,$r)}}),base324=rfc46484({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5});rfc46484({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),rfc46484({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),rfc46484({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),rfc46484({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),rfc46484({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),rfc46484({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),rfc46484({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),rfc46484({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var encode_14=encode12,MSB4=128,REST4=127,MSBALL4=~REST4,INT4=Math.pow(2,31);function encode12($r,pr,Mr){pr=pr||[],Mr=Mr||0;for(var Nr=Mr;$r>=INT4;)pr[Mr++]=$r&255|MSB4,$r/=128;for(;$r&MSBALL4;)pr[Mr++]=$r&255|MSB4,$r>>>=7;return pr[Mr]=$r|0,encode12.bytes=Mr-Nr+1,pr}var decode17=read4,MSB$14=128,REST$14=127;function read4($r,Nr){var Mr=0,Nr=Nr||0,Dr=0,Br=Nr,Lr,jr=$r.length;do{if(Br>=jr)throw read4.bytes=0,new RangeError("Could not decode varint");Lr=$r[Br++],Mr+=Dr<28?(Lr&REST$14)<<Dr:(Lr&REST$14)*Math.pow(2,Dr),Dr+=7}while(Lr>=MSB$14);return read4.bytes=Br-Nr,Mr}var N14=Math.pow(2,7),N24=Math.pow(2,14),N34=Math.pow(2,21),N44=Math.pow(2,28),N54=Math.pow(2,35),N64=Math.pow(2,42),N74=Math.pow(2,49),N84=Math.pow(2,56),N94=Math.pow(2,63),length4=function($r){return $r<N14?1:$r<N24?2:$r<N34?3:$r<N44?4:$r<N54?5:$r<N64?6:$r<N74?7:$r<N84?8:$r<N94?9:10},varint4={encode:encode_14,decode:decode17,encodingLength:length4},_brrp_varint4=varint4,varint_default4=_brrp_varint4,decode18=($r,pr=0)=>[varint_default4.decode($r,pr),varint_default4.decode.bytes],encodeTo4=($r,pr,Mr=0)=>(varint_default4.encode($r,pr,Mr),pr),encodingLength4=$r=>varint_default4.encodingLength($r),create4=($r,pr)=>{const Mr=pr.byteLength,Nr=encodingLength4($r),Dr=Nr+encodingLength4(Mr),Br=new Uint8Array(Dr+Mr);return encodeTo4($r,Br,0),encodeTo4(Mr,Br,Nr),Br.set(pr,Dr),new Digest4($r,Mr,pr,Br)},decode19=$r=>{const pr=coerce4($r),[Mr,Nr]=decode18(pr),[Dr,Br]=decode18(pr.subarray(Nr)),Lr=pr.subarray(Nr+Br);if(Lr.byteLength!==Dr)throw new Error("Incorrect length");return new Digest4(Mr,Dr,Lr,pr)},equals9=($r,pr)=>{if($r===pr)return!0;{const Mr=pr;return $r.code===Mr.code&&$r.size===Mr.size&&Mr.bytes instanceof Uint8Array&&equals8($r.bytes,Mr.bytes)}},Digest4=class{constructor($r,pr,Mr,Nr){this.code=$r,this.size=pr,this.digest=Mr,this.bytes=Nr}},base58btc4=baseX4({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"});baseX4({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var format4=($r,pr)=>{const{bytes:Mr,version:Nr}=$r;switch(Nr){case 0:return toStringV04(Mr,baseCache4($r),pr||base58btc4.encoder);default:return toStringV14(Mr,baseCache4($r),pr||base324.encoder)}},cache4=new WeakMap,baseCache4=$r=>{const pr=cache4.get($r);if(pr==null){const Mr=new Map;return cache4.set($r,Mr),Mr}return pr},CID4=class a0{constructor(pr,Mr,Nr,Dr){this.code=Mr,this.version=pr,this.multihash=Nr,this.bytes=Dr,this["/"]=Dr}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{const{code:pr,multihash:Mr}=this;if(pr!==DAG_PB_CODE4)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(Mr.code!==SHA_256_CODE4)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return a0.createV0(Mr)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{const{code:pr,digest:Mr}=this.multihash,Nr=create4(pr,Mr);return a0.createV1(this.code,Nr)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(pr){return a0.equals(this,pr)}static equals(pr,Mr){const Nr=Mr;return Nr&&pr.code===Nr.code&&pr.version===Nr.version&&equals9(pr.multihash,Nr.multihash)}toString(pr){return format4(this,pr)}toJSON(){return{"/":format4(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(pr){if(pr==null)return null;const Mr=pr;if(Mr instanceof a0)return Mr;if(Mr["/"]!=null&&Mr["/"]===Mr.bytes||Mr.asCID===Mr){const{version:Nr,code:Dr,multihash:Br,bytes:Lr}=Mr;return new a0(Nr,Dr,Br,Lr||encodeCID4(Nr,Dr,Br.bytes))}else if(Mr[cidSymbol4]===!0){const{version:Nr,multihash:Dr,code:Br}=Mr,Lr=decode19(Dr);return a0.create(Nr,Br,Lr)}else return null}static create(pr,Mr,Nr){if(typeof Mr!="number")throw new Error("String codecs are no longer supported");if(!(Nr.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(pr){case 0:{if(Mr!==DAG_PB_CODE4)throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE4}) block encoding`);return new a0(pr,Mr,Nr,Nr.bytes)}case 1:{const Dr=encodeCID4(pr,Mr,Nr.bytes);return new a0(pr,Mr,Nr,Dr)}default:throw new Error("Invalid version")}}static createV0(pr){return a0.create(0,DAG_PB_CODE4,pr)}static createV1(pr,Mr){return a0.create(1,pr,Mr)}static decode(pr){const[Mr,Nr]=a0.decodeFirst(pr);if(Nr.length)throw new Error("Incorrect length");return Mr}static decodeFirst(pr){const Mr=a0.inspectBytes(pr),Nr=Mr.size-Mr.multihashSize,Dr=coerce4(pr.subarray(Nr,Nr+Mr.multihashSize));if(Dr.byteLength!==Mr.multihashSize)throw new Error("Incorrect length");const Br=Dr.subarray(Mr.multihashSize-Mr.digestSize),Lr=new Digest4(Mr.multihashCode,Mr.digestSize,Br,Dr);return[Mr.version===0?a0.createV0(Lr):a0.createV1(Mr.codec,Lr),pr.subarray(Mr.size)]}static inspectBytes(pr){let Mr=0;const Nr=()=>{const[Qr,Wn]=decode18(pr.subarray(Mr));return Mr+=Wn,Qr};let Dr=Nr(),Br=DAG_PB_CODE4;if(Dr===18?(Dr=0,Mr=0):Br=Nr(),Dr!==0&&Dr!==1)throw new RangeError(`Invalid CID version ${Dr}`);const Lr=Mr,jr=Nr(),Ur=Nr(),Gr=Mr+Ur,Yr=Gr-Lr;return{version:Dr,codec:Br,multihashCode:jr,digestSize:Ur,multihashSize:Yr,size:Gr}}static parse(pr,Mr){const[Nr,Dr]=parseCIDtoBytes4(pr,Mr),Br=a0.decode(Dr);if(Br.version===0&&pr[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return baseCache4(Br).set(Nr,pr),Br}},parseCIDtoBytes4=($r,pr)=>{switch($r[0]){case"Q":{const Mr=pr||base58btc4;return[base58btc4.prefix,Mr.decode(`${base58btc4.prefix}${$r}`)]}case base58btc4.prefix:{const Mr=pr||base58btc4;return[base58btc4.prefix,Mr.decode($r)]}case base324.prefix:{const Mr=pr||base324;return[base324.prefix,Mr.decode($r)]}default:{if(pr==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[$r[0],pr.decode($r)]}}},toStringV04=($r,pr,Mr)=>{const{prefix:Nr}=Mr;if(Nr!==base58btc4.prefix)throw Error(`Cannot string encode V0 in ${Mr.name} encoding`);const Dr=pr.get(Nr);if(Dr==null){const Br=Mr.encode($r).slice(1);return pr.set(Nr,Br),Br}else return Dr},toStringV14=($r,pr,Mr)=>{const{prefix:Nr}=Mr,Dr=pr.get(Nr);if(Dr==null){const Br=Mr.encode($r);return pr.set(Nr,Br),Br}else return Dr},DAG_PB_CODE4=112,SHA_256_CODE4=18,encodeCID4=($r,pr,Mr)=>{const Nr=encodingLength4($r),Dr=Nr+encodingLength4(pr),Br=new Uint8Array(Dr+Mr.byteLength);return encodeTo4($r,Br,0),encodeTo4(pr,Br,Nr),Br.set(Mr,Dr),Br},cidSymbol4=Symbol.for("@ipld/js-cid/CID"),code4=85,MemoryBlockstore=class extends BaseBlockstore{constructor(){super();Bu(this,"data");this.data=new Map}put(pr,Mr){return this.data.set(base324.encode(pr.multihash.bytes),Mr),pr}get(pr){const Mr=this.data.get(base324.encode(pr.multihash.bytes));if(Mr==null)throw notFoundError();return Mr}has(pr){return this.data.has(base324.encode(pr.multihash.bytes))}async delete(pr){this.data.delete(base324.encode(pr.multihash.bytes))}async*getAll(){for(const[pr,Mr]of this.data.entries())yield{cid:CID4.createV1(code4,decode19(base324.decode(pr))),block:Mr}}};({...errors_exports});async function hashV0($r){const pr=import_crypto3.default.createHash("sha256");if($r instanceof Uint8Array)pr.update($r);else if(Symbol.asyncIterator in $r)for await(const Mr of $r)pr.update(Mr);else throw new Error("Invalid value provided to hashStreamV0. Expected AsyncGenerator<Uint8Array> | AsyncIterable<Uint8Array> | Uint8Array");return CID.createV0(create(18,pr.digest())).toString()}async function hashV1($r){const pr=new MemoryBlockstore;let Mr;async function*Nr(){yield $r}if($r instanceof Uint8Array)for await(const{cid:Dr}of importer([{content:Nr()}],pr,{cidVersion:1,rawLeaves:!0}))Mr=Dr;else if(Symbol.asyncIterator in $r)for await(const{cid:Dr}of importer([{content:$r}],pr,{cidVersion:1,rawLeaves:!0}))Mr=Dr;else throw new Error("Invalid value provided to hashStreamV1. Expected AsyncGenerator<Uint8Array> | AsyncIterable<Uint8Array> | Uint8Array");return`${Mr}`}function sortKeys($r,pr){return compareStrings($r.hash,pr.hash)||compareStrings($r.file,pr.file)||0}function compareStrings($r,pr){if($r===pr)return 0;for(let Mr=0;Mr<Math.max($r.length,pr.length);Mr++){if($r.charAt(Mr)>pr.charAt(Mr))return 1;if($r.charAt(Mr)<pr.charAt(Mr))return-1}return $r.length>pr.length?1:-1}function prepareADR32Data($r,pr){return new TextEncoder().encode(JSON.stringify({content:$r.sort(sortKeys).map(Mr=>({key:Mr.file,hash:Mr.hash})),metadata:pr}))}async function calculateMultipleHashesADR32($r,pr){const Mr=prepareADR32Data($r,pr);return{data:Mr,hash:await hashV1(Mr)}}async function calculateMultipleHashesADR32LegacyQmHash($r,pr){const Mr=prepareADR32Data($r,pr);return{data:Mr,hash:await hashV0(Mr)}}function number($r){if(!Number.isSafeInteger($r)||$r<0)throw new Error(`Wrong positive integer: ${$r}`)}function bool($r){if(typeof $r!="boolean")throw new Error(`Expected boolean, not ${$r}`)}function bytes($r,...pr){if(!($r instanceof Uint8Array))throw new Error("Expected Uint8Array");if(pr.length>0&&!pr.includes($r.length))throw new Error(`Expected Uint8Array of length ${pr}, not of length=${$r.length}`)}function hash($r){if(typeof $r!="function"||typeof $r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number($r.outputLen),number($r.blockLen)}function exists2($r,pr=!0){if($r.destroyed)throw new Error("Hash instance has been destroyed");if(pr&&$r.finished)throw new Error("Hash#digest() has already been called")}function output($r,pr){bytes($r);const Mr=pr.outputLen;if($r.length<Mr)throw new Error(`digestInto() expects output buffer of length at least ${Mr}`)}var assert={number,bool,bytes,hash,exists:exists2,output},assert_default=assert,U32_MASK64=BigInt(2**32-1),_32n=BigInt(32);function fromBig($r,pr=!1){return pr?{h:Number($r&U32_MASK64),l:Number($r>>_32n&U32_MASK64)}:{h:Number($r>>_32n&U32_MASK64)|0,l:Number($r&U32_MASK64)|0}}function split($r,pr=!1){let Mr=new Uint32Array($r.length),Nr=new Uint32Array($r.length);for(let Dr=0;Dr<$r.length;Dr++){const{h:Br,l:Lr}=fromBig($r[Dr],pr);[Mr[Dr],Nr[Dr]]=[Br,Lr]}return[Mr,Nr]}var toBig=($r,pr)=>BigInt($r>>>0)<<_32n|BigInt(pr>>>0),shrSH=($r,pr,Mr)=>$r>>>Mr,shrSL=($r,pr,Mr)=>$r<<32-Mr|pr>>>Mr,rotrSH=($r,pr,Mr)=>$r>>>Mr|pr<<32-Mr,rotrSL=($r,pr,Mr)=>$r<<32-Mr|pr>>>Mr,rotrBH=($r,pr,Mr)=>$r<<64-Mr|pr>>>Mr-32,rotrBL=($r,pr,Mr)=>$r>>>Mr-32|pr<<64-Mr,rotr32H=($r,pr)=>pr,rotr32L=($r,pr)=>$r,rotlSH=($r,pr,Mr)=>$r<<Mr|pr>>>32-Mr,rotlSL=($r,pr,Mr)=>pr<<Mr|$r>>>32-Mr,rotlBH=($r,pr,Mr)=>pr<<Mr-32|$r>>>64-Mr,rotlBL=($r,pr,Mr)=>$r<<Mr-32|pr>>>64-Mr;function add($r,pr,Mr,Nr){const Dr=(pr>>>0)+(Nr>>>0);return{h:$r+Mr+(Dr/2**32|0)|0,l:Dr|0}}var add3L=($r,pr,Mr)=>($r>>>0)+(pr>>>0)+(Mr>>>0),add3H=($r,pr,Mr,Nr)=>pr+Mr+Nr+($r/2**32|0)|0,add4L=($r,pr,Mr,Nr)=>($r>>>0)+(pr>>>0)+(Mr>>>0)+(Nr>>>0),add4H=($r,pr,Mr,Nr,Dr)=>pr+Mr+Nr+Dr+($r/2**32|0)|0,add5L=($r,pr,Mr,Nr,Dr)=>($r>>>0)+(pr>>>0)+(Mr>>>0)+(Nr>>>0)+(Dr>>>0),add5H=($r,pr,Mr,Nr,Dr,Br)=>pr+Mr+Nr+Dr+Br+($r/2**32|0)|0,u64={fromBig,split,toBig,shrSH,shrSL,rotrSH,rotrSL,rotrBH,rotrBL,rotr32H,rotr32L,rotlSH,rotlSL,rotlBH,rotlBL,add,add3L,add3H,add4L,add4H,add5H,add5L},u64_default=u64,u8a=$r=>$r instanceof Uint8Array,u32=$r=>new Uint32Array($r.buffer,$r.byteOffset,Math.floor($r.byteLength/4)),isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!isLE)throw new Error("Non little-endian hardware is not supported");var hexes=Array.from({length:256},($r,pr)=>pr.toString(16).padStart(2,"0"));function bytesToHex($r){if(!u8a($r))throw new Error("Uint8Array expected");let pr="";for(let Mr=0;Mr<$r.length;Mr++)pr+=hexes[$r[Mr]];return pr}function utf8ToBytes($r){if(typeof $r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof $r}`);return new Uint8Array(new TextEncoder().encode($r))}function toBytes($r){if(typeof $r=="string"&&($r=utf8ToBytes($r)),!u8a($r))throw new Error(`expected Uint8Array, got ${typeof $r}`);return $r}var Hash=class{clone(){return this._cloneInto()}};function wrapConstructor($r){const pr=Nr=>$r().update(toBytes(Nr)).digest(),Mr=$r();return pr.outputLen=Mr.outputLen,pr.blockLen=Mr.blockLen,pr.create=()=>$r(),pr}function wrapXOFConstructorWithOpts($r){const pr=(Nr,Dr)=>$r(Dr).update(toBytes(Nr)).digest(),Mr=$r({});return pr.outputLen=Mr.outputLen,pr.blockLen=Mr.blockLen,pr.create=Nr=>$r(Nr),pr}var[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 $r=0,pr=_1n,Mr=1,Nr=0;$r<24;$r++){[Mr,Nr]=[Nr,(2*Mr+3*Nr)%5],SHA3_PI.push(2*(5*Nr+Mr)),SHA3_ROTL.push(($r+1)*($r+2)/2%64);let Dr=_0n;for(let Br=0;Br<7;Br++)pr=(pr<<_1n^(pr>>_7n)*_0x71n)%_256n,pr&_2n&&(Dr^=_1n<<(_1n<<BigInt(Br))-_1n);_SHA3_IOTA.push(Dr)}var[SHA3_IOTA_H,SHA3_IOTA_L]=u64_default.split(_SHA3_IOTA,!0),rotlH=($r,pr,Mr)=>Mr>32?u64_default.rotlBH($r,pr,Mr):u64_default.rotlSH($r,pr,Mr),rotlL=($r,pr,Mr)=>Mr>32?u64_default.rotlBL($r,pr,Mr):u64_default.rotlSL($r,pr,Mr);function keccakP($r,pr=24){const Mr=new Uint32Array(10);for(let Nr=24-pr;Nr<24;Nr++){for(let Lr=0;Lr<10;Lr++)Mr[Lr]=$r[Lr]^$r[Lr+10]^$r[Lr+20]^$r[Lr+30]^$r[Lr+40];for(let Lr=0;Lr<10;Lr+=2){const jr=(Lr+8)%10,Ur=(Lr+2)%10,Gr=Mr[Ur],Yr=Mr[Ur+1],Qr=rotlH(Gr,Yr,1)^Mr[jr],Wn=rotlL(Gr,Yr,1)^Mr[jr+1];for(let ga=0;ga<50;ga+=10)$r[Lr+ga]^=Qr,$r[Lr+ga+1]^=Wn}let Dr=$r[2],Br=$r[3];for(let Lr=0;Lr<24;Lr++){const jr=SHA3_ROTL[Lr],Ur=rotlH(Dr,Br,jr),Gr=rotlL(Dr,Br,jr),Yr=SHA3_PI[Lr];Dr=$r[Yr],Br=$r[Yr+1],$r[Yr]=Ur,$r[Yr+1]=Gr}for(let Lr=0;Lr<50;Lr+=10){for(let jr=0;jr<10;jr++)Mr[jr]=$r[Lr+jr];for(let jr=0;jr<10;jr++)$r[Lr+jr]^=~Mr[(jr+2)%10]&Mr[(jr+4)%10]}$r[0]^=SHA3_IOTA_H[Nr],$r[1]^=SHA3_IOTA_L[Nr]}Mr.fill(0)}var Keccak=class kE extends Hash{constructor(pr,Mr,Nr,Dr=!1,Br=24){if(super(),this.blockLen=pr,this.suffix=Mr,this.outputLen=Nr,this.enableXOF=Dr,this.rounds=Br,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,assert_default.number(Nr),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(){keccakP(this.state32,this.rounds),this.posOut=0,this.pos=0}update(pr){assert_default.exists(this);const{blockLen:Mr,state:Nr}=this;pr=toBytes(pr);const Dr=pr.length;for(let Br=0;Br<Dr;){const Lr=Math.min(Mr-this.pos,Dr-Br);for(let jr=0;jr<Lr;jr++)Nr[this.pos++]^=pr[Br++];this.pos===Mr&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:pr,suffix:Mr,pos:Nr,blockLen:Dr}=this;pr[Nr]^=Mr,Mr&128&&Nr===Dr-1&&this.keccak(),pr[Dr-1]^=128,this.keccak()}writeInto(pr){assert_default.exists(this,!1),assert_default.bytes(pr),this.finish();const Mr=this.state,{blockLen:Nr}=this;for(let Dr=0,Br=pr.length;Dr<Br;){this.posOut>=Nr&&this.keccak();const Lr=Math.min(Nr-this.posOut,Br-Dr);pr.set(Mr.subarray(this.posOut,this.posOut+Lr),Dr),this.posOut+=Lr,Dr+=Lr}return pr}xofInto(pr){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(pr)}xof(pr){return assert_default.number(pr),this.xofInto(new Uint8Array(pr))}digestInto(pr){if(assert_default.output(pr,this),this.finished)throw new Error("digest() was already called");return this.writeInto(pr),this.destroy(),pr}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(pr){const{blockLen:Mr,suffix:Nr,outputLen:Dr,rounds:Br,enableXOF:Lr}=this;return pr||(pr=new kE(Mr,Nr,Dr,Lr,Br)),pr.state32.set(this.state32),pr.pos=this.pos,pr.posOut=this.posOut,pr.finished=this.finished,pr.rounds=Br,pr.suffix=Nr,pr.outputLen=Dr,pr.enableXOF=Lr,pr.destroyed=this.destroyed,pr}},gen=($r,pr,Mr)=>wrapConstructor(()=>new Keccak(pr,$r,Mr));gen(6,144,224/8),gen(6,136,256/8),gen(6,104,384/8),gen(6,72,512/8),gen(1,144,224/8);var keccak_256=gen(1,136,256/8);gen(1,104,384/8),gen(1,72,512/8);var genShake=($r,pr,Mr)=>wrapXOFConstructorWithOpts((Nr={})=>new Keccak(pr,$r,Nr.dkLen===void 0?Mr:Nr.dkLen,!0));genShake(31,168,128/8),genShake(31,136,256/8);function wrapHash2($r){return pr=>(assert_default.bytes(pr),$r(pr))}(()=>{const $r=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,pr=typeof commonjsRequire=="function"&&commonjsRequire.bind(module);return{node:pr&&!$r?pr("crypto"):void 0,web:$r}})();var keccak256=(()=>{const $r=wrapHash2(keccak_256);return $r.create=keccak_256.create,$r})();function keccak256Hash($r,pr){const Mr=JSON.stringify(pick($r,pr)),Nr=new TextEncoder().encode(Mr),Dr=keccak256(Nr);return bytesToHex(Dr)}var pick=($r,pr)=>Object.fromEntries(pr.filter(Mr=>Mr in $r).map(Mr=>[Mr,$r[Mr]]));/*! Bundled license information:
|
|
202
202
|
|
|
203
203
|
@noble/hashes/esm/utils.js:
|
|
204
204
|
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
@@ -215,5 +215,5 @@ Valid keys: `+JSON.stringify(Object.keys(yo),null," "));var Ru=su(Uu,Zu,pu,nu,e
|
|
|
215
215
|
`),(0,eth_connect_1.stringToUtf8Bytes)(String(pr.length)),pr);return(0,eth_connect_1.hexToBytes)((0,eth_connect_1.sha3)(Mr))}crypto$1.createEthereumMessageHash=createEthereumMessageHash;function ethSign($r,pr){return sign($r,createEthereumMessageHash(pr))}crypto$1.ethSign=ethSign;function computeAddress($r){const pr=$r.length===65&&$r[0]===4?$r.slice(1):$r;return(0,eth_connect_1.getAddress)((0,eth_connect_1.sha3)(pr).substring(24))}crypto$1.computeAddress=computeAddress;function createUnsafeIdentity(){const $r=secp256k1_1.utils.randomPrivateKey(),pr=(0,secp256k1_1.getPublicKey)($r).slice(1),Mr=computeAddress(pr);return{privateKey:(0,eth_connect_1.bytesToHex)($r),publicKey:(0,eth_connect_1.bytesToHex)(pr),address:Mr}}crypto$1.createUnsafeIdentity=createUnsafeIdentity;(function($r){var pr=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(mo,$o,Xn,Fr){Fr===void 0&&(Fr=Xn);var Vr=Object.getOwnPropertyDescriptor($o,Xn);(!Vr||("get"in Vr?!$o.__esModule:Vr.writable||Vr.configurable))&&(Vr={enumerable:!0,get:function(){return $o[Xn]}}),Object.defineProperty(mo,Fr,Vr)}:function(mo,$o,Xn,Fr){Fr===void 0&&(Fr=Xn),mo[Fr]=$o[Xn]}),Mr=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(mo,$o){Object.defineProperty(mo,"default",{enumerable:!0,value:$o})}:function(mo,$o){mo.default=$o}),Nr=commonjsGlobal&&commonjsGlobal.__importStar||function(mo){if(mo&&mo.__esModule)return mo;var $o={};if(mo!=null)for(var Xn in mo)Xn!=="default"&&Object.prototype.hasOwnProperty.call(mo,Xn)&&pr($o,mo,Xn);return Mr($o,mo),$o},Dr=commonjsGlobal&&commonjsGlobal.__importDefault||function(mo){return mo&&mo.__esModule?mo:{default:mo}};Object.defineProperty($r,"__esModule",{value:!0}),$r.isValidEIP1271Signature=$r.parseEmphemeralPayload=$r.getSignedIdentitySignatureType=$r.getEphemeralSignatureType=$r.EIP_1654_SIGNED_ENTITY_VALIDATOR=$r.ECDSA_EIP_1654_EPHEMERAL_VALIDATOR=$r.ECDSA_PERSONAL_EPHEMERAL_VALIDATOR=$r.ECDSA_SIGNED_ENTITY_VALIDATOR=$r.SIGNER_VALIDATOR=$r.Authenticator=$r.ERC1654_MAGIC_VALUE=$r.VALID_SIGNATURE=void 0;const Br=Nr(ethConnectExports),Lr=SignatureValidator$1,jr=types,Ur=utils$3,Gr=Dr(blocks),Yr=crypto$1;$r.VALID_SIGNATURE="VALID_SIGNATURE",$r.ERC1654_MAGIC_VALUE="1626ba7e";const Qr=132;var Wn;(function(mo){async function $o(Hr,Xr,co,ho=Date.now()){let go="";if(!mo.isValidAuthChain(Xr))return{ok:!1,message:"ERROR: Malformed authChain"};for(const Eo of Xr){const wo=po(Eo.type);try{const{nextAuthority:Io}=await wo(go,Eo,{provider:co,dateToValidateExpirationInMillis:ho});go=Io||""}catch(Io){return{ok:!1,message:`ERROR. Link type: ${Eo.type}. ${Io.message}.`}}}const bo=go===Hr;return{ok:bo,message:bo?void 0:`ERROR: Invalid final authority. Expected: ${Hr}. Current ${go}.`}}mo.validateSignature=$o;function Xn(Hr){for(const[Xr,co]of Hr.entries())if(Xr===0&&co.type!==jr.AuthLinkType.SIGNER||co.type===jr.AuthLinkType.SIGNER&&Xr!==0)return!1;return!0}mo.isValidAuthChain=Xn;function Fr(Hr){return(0,Br.hexToBytes)((0,Br.sha3)((0,Br.stringToUtf8Bytes)(Hr)))}mo.createEIP1271MessageHash=Fr;function Vr(Hr,Xr,co){return[{type:jr.AuthLinkType.SIGNER,payload:Xr,signature:""},{type:ao(co),payload:Hr,signature:co}]}mo.createSimpleAuthChain=Vr;function Wr(Hr,Xr,co,ho){const go=(0,Ur.moveMinutes)(co),bo=mo.getEphemeralMessage(Xr.address,go),Eo=mo.createSignature(Hr,bo),wo=mo.createSignature(Xr,ho);return[{type:jr.AuthLinkType.SIGNER,payload:Hr.address,signature:""},{type:jr.AuthLinkType.ECDSA_PERSONAL_EPHEMERAL,payload:bo,signature:Eo},{type:jr.AuthLinkType.ECDSA_PERSONAL_SIGNED_ENTITY,payload:ho,signature:wo}]}mo.createAuthChain=Wr;async function Jr(Hr,Xr,co,ho){const go=new Date;go.setMinutes(go.getMinutes()+co);const bo=mo.getEphemeralMessage(Xr.address,go),Eo=await ho(bo),wo=[{type:jr.AuthLinkType.SIGNER,payload:Hr,signature:""},{type:so(Eo),payload:bo,signature:Eo}];return{ephemeralIdentity:Xr,expiration:go,authChain:wo}}mo.initializeAuthChain=Jr;function Gn(Hr,Xr){const co=mo.createSignature(Hr.ephemeralIdentity,Xr);return[...Hr.authChain,{type:jr.AuthLinkType.ECDSA_PERSONAL_SIGNED_ENTITY,payload:Xr,signature:co}]}mo.signPayload=Gn,mo.createEthereumMessageHash=Yr.createEthereumMessageHash;function to(Hr,Xr){return(0,Yr.ethSign)((0,Br.hexToBytes)(Hr.privateKey),Xr)}mo.createSignature=to;function ro(Hr){return Hr.length>0&&Hr[0].type===jr.AuthLinkType.SIGNER?Hr[0].payload:"Invalid-Owner-Address"}mo.ownerAddress=ro;function Un(Hr,Xr){return`Decentraland Login
|
|
216
216
|
Ephemeral address: ${Hr}
|
|
217
217
|
Expiration: ${Xr.toISOString()}`}mo.getEphemeralMessage=Un})(Wn=$r.Authenticator||($r.Authenticator={}));const ga=async(mo,$o)=>({nextAuthority:$o.payload});$r.SIGNER_VALIDATOR=ga;const eo=async(mo,$o)=>{if(!$o.signature)throw new Error("Invalid AuthLink. 'signature' must be present for type 'ECDSA_SIGNED_ENTITY_VALIDATOR'");const Xn=(0,Yr.recoverAddressFromEthSignature)($o.signature,$o.payload),Fr=mo.toLocaleLowerCase(),Vr=Xn.toLocaleLowerCase();if(Fr===Vr)return{nextAuthority:$o.payload};throw new Error(`Invalid signer address. Expected: ${Fr}. Actual: ${Vr}`)};$r.ECDSA_SIGNED_ENTITY_VALIDATOR=eo;const _i=async(mo,$o,Xn)=>{if(!$o.signature)throw new Error("Invalid AuthLink. 'signature' must be present for type 'ECDSA_PERSONAL_EPHEMERAL_VALIDATOR'");const{message:Fr,ephemeralAddress:Vr,expiration:Wr}=fo($o.payload),Jr=Xn.dateToValidateExpirationInMillis?Xn.dateToValidateExpirationInMillis:Date.now();if(Wr>Jr){const Gn=(0,Yr.recoverAddressFromEthSignature)($o.signature,Fr),to=mo.toLocaleLowerCase(),ro=Gn.toLocaleLowerCase();if(to===ro)return{nextAuthority:Vr};throw new Error(`Invalid signer address. Expected: ${to}. Actual: ${ro}`)}throw new Error(`Ephemeral key expired. Expiration: ${Wr}. Test: ${Jr}`)};$r.ECDSA_PERSONAL_EPHEMERAL_VALIDATOR=_i;const va=async(mo,$o,Xn)=>{if(!$o.signature)throw new Error("Invalid AuthLink. 'signature' must be present for type 'ECDSA_EIP_1654_EPHEMERAL_VALIDATOR'");const{message:Fr,ephemeralAddress:Vr,expiration:Wr}=fo($o.payload),Jr=Xn!=null&&Xn.dateToValidateExpirationInMillis?Xn==null?void 0:Xn.dateToValidateExpirationInMillis:Date.now();if(Wr>Jr&&await oo(Xn.provider,mo,Fr,$o.signature,Jr))return{nextAuthority:Vr};throw new Error(`Ephemeral key expired. Expiration: ${Wr}. Test: ${Jr}`)};$r.ECDSA_EIP_1654_EPHEMERAL_VALIDATOR=va;const io=async(mo,$o,Xn)=>{if(!$o.signature)throw new Error("Invalid AuthLink. 'signature' must be present for type 'EIP_1654_SIGNED_ENTITY_VALIDATOR'");if(await oo(Xn.provider,mo,$o.payload,$o.signature,Xn.dateToValidateExpirationInMillis))return{nextAuthority:$o.payload};throw new Error("Invalid validation")};$r.EIP_1654_SIGNED_ENTITY_VALIDATOR=io;const no=async(mo,$o)=>({error:"Error Validator."});function so(mo){return mo.length===Qr?jr.AuthLinkType.ECDSA_PERSONAL_EPHEMERAL:jr.AuthLinkType.ECDSA_EIP_1654_EPHEMERAL}$r.getEphemeralSignatureType=so;function ao(mo){return mo.length===Qr?jr.AuthLinkType.ECDSA_PERSONAL_SIGNED_ENTITY:jr.AuthLinkType.ECDSA_EIP_1654_SIGNED_ENTITY}$r.getSignedIdentitySignatureType=ao;function fo(mo){const $o=mo.replace(/\r/g,""),Xn=$o.split(`
|
|
218
|
-
`),Fr=Xn[1].substring(19),Vr=Xn[2].substring(12),Wr=Date.parse(Vr);return{message:$o,ephemeralAddress:Fr,expiration:Wr}}$r.parseEmphemeralPayload=fo;async function lo(mo,$o,Xn,Fr){const Vr=Wn.createEIP1271MessageHash($o),Wr=(0,Br.hexToBytes)(Xn);let Jr;try{Jr=(0,Br.bytesToHex)(await mo.isValidSignature(Vr,Wr,Fr))}catch{}if(Jr===$r.ERC1654_MAGIC_VALUE)return!0;const Gn=(0,Yr.createEthereumMessageHash)($o);try{Jr=(0,Br.bytesToHex)(await mo.isValidSignature(Gn,Wr,Fr))}catch{}return Jr===$r.ERC1654_MAGIC_VALUE}$r.isValidEIP1271Signature=lo;async function oo(mo,$o,Xn,Fr,Vr){if(!mo)throw new Error("Missing provider");const Wr=new Br.default(mo),Jr=await(0,Lr.SignatureValidator)(Wr,$o);let Gn=await lo(Jr,Xn,Fr);if(Gn)return!0;const to=new Gr.default(Wr);try{const{block:ro}=await to.getDate(Vr,!1);if(Gn=await lo(Jr,Xn,Fr,ro),Gn)return!0}catch(ro){throw new Error(`Invalid validation. Error: ${ro.message}`)}throw new Error(`Invalid validation. Expected: ${$r.ERC1654_MAGIC_VALUE}. Actual: ${Gn}`)}function po(mo){switch(mo){case jr.AuthLinkType.SIGNER:return $r.SIGNER_VALIDATOR;case jr.AuthLinkType.ECDSA_PERSONAL_EPHEMERAL:return $r.ECDSA_PERSONAL_EPHEMERAL_VALIDATOR;case jr.AuthLinkType.ECDSA_PERSONAL_SIGNED_ENTITY:return $r.ECDSA_SIGNED_ENTITY_VALIDATOR;case jr.AuthLinkType.ECDSA_EIP_1654_EPHEMERAL:return $r.ECDSA_EIP_1654_EPHEMERAL_VALIDATOR;case jr.AuthLinkType.ECDSA_EIP_1654_SIGNED_ENTITY:return $r.EIP_1654_SIGNED_ENTITY_VALIDATOR;default:return no}}})(Authenticator);(function($r){var pr=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Nr,Dr,Br,Lr){Lr===void 0&&(Lr=Br);var jr=Object.getOwnPropertyDescriptor(Dr,Br);(!jr||("get"in jr?!Dr.__esModule:jr.writable||jr.configurable))&&(jr={enumerable:!0,get:function(){return Dr[Br]}}),Object.defineProperty(Nr,Lr,jr)}:function(Nr,Dr,Br,Lr){Lr===void 0&&(Lr=Br),Nr[Lr]=Dr[Br]}),Mr=commonjsGlobal&&commonjsGlobal.__exportStar||function(Nr,Dr){for(var Br in Nr)Br!=="default"&&!Object.prototype.hasOwnProperty.call(Dr,Br)&&pr(Dr,Nr,Br)};Object.defineProperty($r,"__esModule",{value:!0}),Mr(Authenticator,$r),Mr(types,$r)})(dist);async function resizeImage($r){return new Promise((Nr,Dr)=>{const Br=new Blob([$r],{type:"image/png"}),Lr=new Image;Lr.onload=()=>{const jr=document.createElement("canvas");jr.width=256,jr.height=256;const Ur=jr.getContext("2d");if(!Ur)return Dr(new Error("Failed to get canvas context"));Ur.drawImage(Lr,0,0,256,256),jr.toBlob(Gr=>{if(!Gr)return Dr(new Error("Failed to convert canvas to blob"));const Yr=new FileReader;Yr.onload=()=>Nr(Buffer$G.from(Yr.result)),Yr.onerror=()=>Dr(new Error("Failed to read blob as buffer")),Yr.readAsArrayBuffer(Gr)},"image/png")},Lr.onerror=()=>Dr(new Error("Failed to load image")),Lr.src=URL.createObjectURL(Br)})}async function subscribeToNewsletter($r){const pr=config.get("BUILDER_SERVER_URL");if(!pr)throw new Error("Missing BUILDER_SERVER_URL.");const Mr=await fetch(pr+"/v1/newsletter",{method:"post",body:JSON.stringify({email:$r,source:"auth"}),headers:{"content-type":"application/json"}});if(!Mr.ok)throw new Error(`Could not subscribe to newsletter. Status: ${Mr.status}`)}async function deployProfileFromDefault({defaultProfile:$r,connectedAccount:pr,deploymentProfileName:Mr,connectedAccountIdentity:Nr}){var so,ao;const Dr=config.get("PEER_URL",""),Br=dist$2.createContentClient({url:Dr+"/content",fetcher:dist$3.createFetchComponent()}),jr=(await Br.fetchEntitiesByPointers([$r]))[0],Ur=jr.id.startsWith("Qm"),Gr="body.png",Yr="face.png",Qr="face256.png",Wn=jr.content.reduce((fo,lo)=>({...fo,[lo.file]:lo.hash}),{}),ga=await Br.downloadContent(Wn[Gr]),eo=Ur?await resizeImage(await Br.downloadContent(Wn[Yr])):await Br.downloadContent(Wn[Qr]),_i=new Map;_i.set(Gr,ga),_i.set(Qr,eo);const va=fo=>fo.replace("dcl://base-avatars/","urn:decentraland:off-chain:base-avatars:"),io=(ao=(so=jr.metadata)==null?void 0:so.avatars)==null?void 0:ao[0];if(io.name=Mr,io.ethAddress=pr,io.userId=pr,io.version=1,io.tutorialStep=0,io.hasClaimedName=!1,io.hasConnectedWeb3=!0,io.avatar.bodyShape=va(jr.metadata.avatars[0].avatar.bodyShape),io.avatar.wearables=jr.metadata.avatars[0].avatar.wearables.map(va),io.avatar.emotes=[],Ur){const[fo,lo]=await Promise.all([distExports.hashV1(ga),distExports.hashV1(eo)]);io.avatar.snapshots={body:fo,face256:lo}}const no=await dist$2.DeploymentBuilder.buildEntity({type:dist$6.EntityType.PROFILE,pointers:[pr],metadata:{avatars:[io]},timestamp:Date.now(),files:_i});await Br.deploy({entityId:no.entityId,files:no.files,authChain:dist.Authenticator.signPayload(Nr,no.entityId)})}const container$1="_container_1bwr6_1",background$1="_background_1bwr6_9",left$1="_left_1bwr6_20",leftInner="_leftInner_1bwr6_48",logo="_logo_1bwr6_54",title$3="_title_1bwr6_59",subtitle$1="_subtitle_1bwr6_66",meetYourAvatar="_meetYourAvatar_1bwr6_72",meetYourAvatarDescription="_meetYourAvatarDescription_1bwr6_79",randomize="_randomize_1bwr6_86",logoSmall="_logoSmall_1bwr6_102",back="_back_1bwr6_9",name="_name_1bwr6_121",agree="_agree_1bwr6_125",error="_error_1bwr6_145",emailError="_emailError_1bwr6_156",agreeError="_agreeError_1bwr6_160",jumpIn="_jumpIn_1bwr6_166",right$1="_right_1bwr6_170",platform="_platform_1bwr6_187",mobileContainer="_mobileContainer_1bwr6_200",mobilePreviewContainer="_mobilePreviewContainer_1bwr6_213",mobileButtons="_mobileButtons_1bwr6_235",mobileCompleteYourProfile="_mobileCompleteYourProfile_1bwr6_260",styles$8={container:container$1,background:background$1,left:left$1,leftInner,logo,title:title$3,subtitle:subtitle$1,meetYourAvatar,meetYourAvatarDescription,randomize,continue:"_continue_1bwr6_97",logoSmall,back,name,agree,error,emailError,agreeError,jumpIn,right:right$1,platform,mobileContainer,mobilePreviewContainer,mobileButtons,mobileCompleteYourProfile};function getRandomDefaultProfile(){return"default"+(Math.floor(Math.random()*(160-1+1))+1)}const Error$1=$r=>jsxRuntimeExports.jsxs("div",{className:classNames(styles$8.error,$r.className),children:[jsxRuntimeExports.jsx("img",{src:wrongImg}),jsxRuntimeExports.jsx("div",{children:$r.message})]}),SetupPage=()=>{const[$r,pr]=reactExports.useState(!1),[Mr,Nr]=reactExports.useState(0),[Dr,Br]=reactExports.useState(getRandomDefaultProfile()),[Lr,jr]=reactExports.useState(""),[Ur,Gr]=reactExports.useState(""),[Yr,Qr]=reactExports.useState(!1),[Wn,ga]=reactExports.useState(!1),[eo,_i]=reactExports.useState(!1),va=reactExports.useRef(),io=reactExports.useRef(),{initialized:no,flags:so}=reactExports.useContext(FeatureFlagsContext),ao=useAfterLoginRedirection(),fo=reactExports.useMemo(()=>Lr.length?Lr.length>=15?"Sorry, usernames can have a maximum of 15 characters.":Lr.includes(" ")?"Sorry, spaces are not permitted.":/^[a-zA-Z0-9]+$/.test(Lr)?"":"Sorry, special characters (!@#$%) are not permitted.":"Please enter your username.",[Lr]),lo=reactExports.useMemo(()=>Ur&&!Ur.includes("@")?"Invalid email, please try again.":"",[Ur]),oo=reactExports.useMemo(()=>Yr?"":"Please accept the terms of use and privacy policy.",[Yr]),po=reactExports.useMemo(()=>{if(ao){if(ao.includes("play"))return"jump into decentraland";const Gn=["marketplace","builder","account","profile","events","places","governance","dao","rewards"];for(const to of Gn)if(ao.includes(to))return`continue to ${to}`}return"continue"},[ao]),mo=reactExports.useCallback(()=>{getAnalytics().track(TrackingEvents.CLICK,{action:ClickEvents.RANDOMIZE}),Br(getRandomDefaultProfile())},[]),$o=reactExports.useCallback(()=>{getAnalytics().track(TrackingEvents.AVATAR_EDIT_SUCCESS,{eth_address:va.current,is_guest:!1,profile:Dr}),Nr(1)},[Dr]),Xn=reactExports.useCallback(()=>{getAnalytics().track(TrackingEvents.CLICK,{action:ClickEvents.BACK_TO_AVATAR_RANDOMIZATION_VIEW}),Nr(0)},[]),Fr=reactExports.useCallback((Gn,to)=>jr(to.value),[]),Vr=reactExports.useCallback((Gn,to)=>Gr(to.value),[]),Wr=reactExports.useCallback(()=>Qr(!Yr),[Yr]),Jr=reactExports.useCallback(async Gn=>{if(Gn.preventDefault(),getAnalytics().track(TrackingEvents.CLICK,{action:ClickEvents.SUBMIT_PROFILE}),ga(!0),!(fo||lo||oo)){if(!va.current||!io.current){console.warn("No account or identity found.");return}try{if(_i(!0),await deployProfileFromDefault({connectedAccount:va.current,connectedAccountIdentity:io.current,defaultProfile:Dr,deploymentProfileName:Lr}),Ur)try{await subscribeToNewsletter(Ur)}catch(to){console.warn("There was an error subscribing to the newsletter",to.message)}getAnalytics().track(TrackingEvents.TERMS_OF_SERVICE_SUCCESS,{eth_address:va.current,is_guest:!1,email:Ur||void 0,name:Lr}),ao?window.location.href=decodeURIComponent(ao):window.location.href="/"}catch(to){_i(!1),console.error("There was an error deploying the profile",to.message)}}},[fo,lo,oo,Lr,Ur,Yr,Dr,ao]);return reactExports.useEffect(()=>{(async()=>{const Gn=()=>{window.location.href="/auth/login"};try{await dist$7.connection.tryPreviousConnection()}catch{console.warn("No previous connection found"),Gn();return}const ro=await(await dist$7.connection.getProvider()).request({method:"eth_accounts"});if(!ro.length){console.warn("No accounts found"),Gn();return}const Un=ro[0];if(va.current=Un,await fetchProfile(Un)){console.warn("Profile already exists"),ao?window.location.href=decodeURIComponent(ao):window.location.href="/";return}const Xr=dist$4.localStorageGetIdentity(Un);if(!Xr){console.warn("No identity found for the connected account"),Gn();return}io.current=Xr,pr(!0)})()},[ao]),!$r||!no?jsxRuntimeExports.jsxs("div",{className:styles$8.container,children:[jsxRuntimeExports.jsx("div",{className:styles$8.background}),jsxRuntimeExports.jsx(Loader_3,{active:!0,size:"huge"})]}):so[FeatureFlagsKeys.SIMPLIFIED_AVATAR_SETUP]?Mr===0?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Mobile_1,{children:jsxRuntimeExports.jsxs("div",{className:styles$8.container,children:[jsxRuntimeExports.jsx("div",{className:styles$8.background}),jsxRuntimeExports.jsxs("div",{className:styles$8.mobileContainer,children:[jsxRuntimeExports.jsx("img",{className:styles$8.logo,src:logoSrc,alt:"logo"}),jsxRuntimeExports.jsx("div",{className:styles$8.title,children:"Welcome to Decentraland!"}),jsxRuntimeExports.jsx("div",{className:styles$8.meetYourAvatar,children:"First, Meet Your Avatar"}),jsxRuntimeExports.jsxs("div",{className:styles$8.meetYourAvatarDescription,children:["Choose an avatar to start your journey.",jsxRuntimeExports.jsx("br",{}),jsxRuntimeExports.jsx("b",{children:"You can customize it later on desktop"}),", where all the magic happens!"]}),jsxRuntimeExports.jsxs("div",{className:styles$8.mobilePreviewContainer,children:[jsxRuntimeExports.jsx(WearablePreview_2,{lockBeta:!0,panning:!1,disableBackground:!0,profile:Dr,dev:!1,emote:dist$6.PreviewEmote.WAVE,disableAutoRotate:!0}),jsxRuntimeExports.jsx(Loader_3,{active:!0}),jsxRuntimeExports.jsx("img",{className:styles$8.platform,src:platformImg,alt:"platform"})]}),jsxRuntimeExports.jsxs("div",{className:styles$8.mobileButtons,children:[jsxRuntimeExports.jsx("div",{className:styles$8.randomize,children:jsxRuntimeExports.jsxs(Button$5.Button,{compact:!0,inverted:!0,onClick:mo,children:[jsxRuntimeExports.jsx("img",{src:diceImg,alt:"diceImg"}),jsxRuntimeExports.jsx("span",{children:"randomize"})]})}),jsxRuntimeExports.jsx("div",{className:styles$8.continue,children:jsxRuntimeExports.jsx(Button$5.Button,{compact:!0,primary:!0,onClick:$o,children:"Continue"})})]})]})]})}),jsxRuntimeExports.jsx(NotMobile_1,{children:jsxRuntimeExports.jsxs("div",{className:styles$8.container,children:[jsxRuntimeExports.jsx("div",{className:styles$8.background}),jsxRuntimeExports.jsx("div",{className:styles$8.left,children:jsxRuntimeExports.jsxs("div",{className:styles$8.leftInner,children:[jsxRuntimeExports.jsx("img",{className:styles$8.logo,src:logoSrc,alt:"logo"}),jsxRuntimeExports.jsx("div",{className:styles$8.title,children:"Welcome to Decentraland!"}),jsxRuntimeExports.jsx("div",{className:styles$8.subtitle,children:"Your journey begins here"}),jsxRuntimeExports.jsx("div",{className:styles$8.meetYourAvatar,children:"First, Meet Your Avatar"}),jsxRuntimeExports.jsxs("div",{className:styles$8.meetYourAvatarDescription,children:["Say hi to your new digital self!",jsxRuntimeExports.jsx("br",{}),"Don't worry, of course they're not quite 'you' yet—soon you'll be able to customize them to your heart's content."]}),jsxRuntimeExports.jsx("div",{className:styles$8.randomize,children:jsxRuntimeExports.jsxs(Button$5.Button,{compact:!0,inverted:!0,onClick:mo,children:[jsxRuntimeExports.jsx("img",{src:diceImg,alt:"diceImg"}),jsxRuntimeExports.jsx("span",{children:"randomize"})]})}),jsxRuntimeExports.jsx("div",{className:styles$8.continue,children:jsxRuntimeExports.jsx(Button$5.Button,{primary:!0,fluid:!0,onClick:$o,children:"Continue"})})]})}),jsxRuntimeExports.jsxs("div",{className:styles$8.right,children:[jsxRuntimeExports.jsx(WearablePreview_2,{lockBeta:!0,panning:!1,disableBackground:!0,profile:Dr,dev:!1,emote:dist$6.PreviewEmote.WAVE,disableAutoRotate:!0}),jsxRuntimeExports.jsx(Loader_3,{active:!0,size:"huge"}),jsxRuntimeExports.jsx("img",{className:styles$8.platform,src:platformImg,alt:"platform"})]})]})})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Mobile_1,{children:jsxRuntimeExports.jsxs("div",{className:styles$8.container,children:[jsxRuntimeExports.jsx("div",{className:styles$8.background}),jsxRuntimeExports.jsxs("div",{className:styles$8.mobileContainer,children:[jsxRuntimeExports.jsxs("div",{className:styles$8.back,onClick:Xn,children:[jsxRuntimeExports.jsx("img",{src:backImg,alt:"backImg"}),jsxRuntimeExports.jsx("span",{children:"BACK"})]}),jsxRuntimeExports.jsx("div",{className:classNames(styles$8.title,styles$8.mobileCompleteYourProfile),children:"Complete your Profile"}),jsxRuntimeExports.jsxs("form",{onSubmit:Jr,children:[jsxRuntimeExports.jsx("div",{className:styles$8.name,children:jsxRuntimeExports.jsx(Field_2,{label:"Username",placeholder:"Enter your Username",onChange:Fr,message:Wn&&fo?jsxRuntimeExports.jsx(Error$1,{message:fo}):void 0})}),jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(Field_2,{label:"Email (optional)",placeholder:"Enter your email",message:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Wn&&lo?jsxRuntimeExports.jsx(Error$1,{className:styles$8.emailError,message:lo}):null,jsxRuntimeExports.jsx("span",{children:"Subscribe to Decentraland's newsletter to receive the latest news about events, updates, contests and more."})]}),onChange:Vr})}),jsxRuntimeExports.jsxs("div",{className:styles$8.agree,children:[jsxRuntimeExports.jsx(Checkbox$4.Checkbox,{onChange:Wr}),jsxRuntimeExports.jsxs("div",{children:["I agree with Decentraland's ",jsxRuntimeExports.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:"https://decentraland.org/terms/",children:"Terms of use"})," and ",jsxRuntimeExports.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:"https://decentraland.org/privacy",children:"Privacy policy"}),"."]})]}),Wn&&oo?jsxRuntimeExports.jsx(Error$1,{className:styles$8.agreeError,message:oo}):null,jsxRuntimeExports.jsx("div",{className:styles$8.jumpIn,children:jsxRuntimeExports.jsx(Button$5.Button,{primary:!0,fluid:!0,type:"submit",disabled:!Yr||eo,loading:eo,children:po})})]})]})]})}),jsxRuntimeExports.jsx(NotMobile_1,{children:jsxRuntimeExports.jsxs("div",{className:styles$8.container,children:[jsxRuntimeExports.jsx("div",{className:styles$8.background}),jsxRuntimeExports.jsx("div",{className:styles$8.left,children:jsxRuntimeExports.jsxs("div",{className:styles$8.leftInner,children:[jsxRuntimeExports.jsx("img",{className:styles$8.logoSmall,src:logoSrc,alt:"logo"}),jsxRuntimeExports.jsxs("div",{className:styles$8.back,onClick:Xn,children:[jsxRuntimeExports.jsx("img",{src:backImg,alt:"backImg"}),jsxRuntimeExports.jsx("span",{children:"BACK"})]}),jsxRuntimeExports.jsx("div",{className:styles$8.title,children:"Complete your Profile"}),jsxRuntimeExports.jsxs("form",{onSubmit:Jr,children:[jsxRuntimeExports.jsx("div",{className:styles$8.name,children:jsxRuntimeExports.jsx(Field_2,{label:"Username",placeholder:"Enter your username",onChange:Fr,message:Wn&&fo?jsxRuntimeExports.jsx(Error$1,{message:fo}):void 0})}),jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(Field_2,{label:"Email (optional)",placeholder:"Enter your email",message:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Wn&&lo?jsxRuntimeExports.jsx(Error$1,{className:styles$8.emailError,message:lo}):null,jsxRuntimeExports.jsx("span",{children:"Subscribe to Decentraland's newsletter to receive the latest news about events, updates, contests and more."})]}),onChange:Vr})}),jsxRuntimeExports.jsxs("div",{className:styles$8.agree,children:[jsxRuntimeExports.jsx(Checkbox$4.Checkbox,{onChange:Wr}),"I agree with Decentraland's ",jsxRuntimeExports.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:"https://decentraland.org/terms/",children:"Terms of use"})," and ",jsxRuntimeExports.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:"https://decentraland.org/privacy",children:"Privacy policy"}),"."]}),Wn&&oo?jsxRuntimeExports.jsx(Error$1,{className:styles$8.agreeError,message:oo}):null,jsxRuntimeExports.jsx("div",{className:styles$8.jumpIn,children:jsxRuntimeExports.jsx(Button$5.Button,{primary:!0,fluid:!0,type:"submit",disabled:!Yr||eo,loading:eo,children:po})})]})]})}),jsxRuntimeExports.jsxs("div",{className:styles$8.right,children:[jsxRuntimeExports.jsx(WearablePreview_2,{lockBeta:!0,panning:!1,disableBackground:!0,profile:Dr,dev:!1,emote:dist$6.PreviewEmote.WAVE,disableAutoRotate:!0}),jsxRuntimeExports.jsx(Loader_3,{active:!0,size:"huge"}),jsxRuntimeExports.jsx("img",{className:styles$8.platform,src:platformImg,alt:"platform"})]})]})})]}):(window.location.href="/",null)},main$4="_main_qbssu_1",styles$7={main:main$4},DefaultPage=()=>{const $r=useNavigate(),pr=useLocation(),Mr=reactExports.useCallback(async()=>{try{const Nr=await dist$7.connection.tryPreviousConnection();return!!(Nr.account&&Nr.provider)}catch{return!1}},[]);return reactExports.useEffect(()=>{Mr().then(Nr=>{Nr?window.location.href="/":$r({pathname:"/login",search:pr.search})})},[Mr,$r]),jsxRuntimeExports.jsx("div",{className:styles$7.main,children:jsxRuntimeExports.jsx(Loader_3,{active:!0,size:"huge"})})};var Modal$3={},Modal$2={},_arrayReduce,hasRequired_arrayReduce;function require_arrayReduce(){if(hasRequired_arrayReduce)return _arrayReduce;hasRequired_arrayReduce=1;function $r(pr,Mr,Nr,Dr){var Br=-1,Lr=pr==null?0:pr.length;for(Dr&&Lr&&(Nr=pr[++Br]);++Br<Lr;)Nr=Mr(Nr,pr[Br],Br,pr);return Nr}return _arrayReduce=$r,_arrayReduce}var _baseReduce,hasRequired_baseReduce;function require_baseReduce(){if(hasRequired_baseReduce)return _baseReduce;hasRequired_baseReduce=1;function $r(pr,Mr,Nr,Dr,Br){return Br(pr,function(Lr,jr,Ur){Nr=Dr?(Dr=!1,Lr):Mr(Nr,Lr,jr,Ur)}),Nr}return _baseReduce=$r,_baseReduce}var reduce_1,hasRequiredReduce;function requireReduce(){if(hasRequiredReduce)return reduce_1;hasRequiredReduce=1;var $r=require_arrayReduce(),pr=require_baseEach(),Mr=require_baseIteratee(),Nr=require_baseReduce(),Dr=requireIsArray();function Br(Lr,jr,Ur){var Gr=Dr(Lr)?$r:Nr,Yr=arguments.length<3;return Gr(Lr,Mr(jr,4),Ur,Yr,pr)}return reduce_1=Br,reduce_1}var ModalActions={},hasRequiredModalActions;function requireModalActions(){if(hasRequiredModalActions)return ModalActions;hasRequiredModalActions=1;var $r=interopRequireWildcardExports,pr=interopRequireDefaultExports;ModalActions.__esModule=!0,ModalActions.default=void 0;var Mr=pr(require_extends()),Nr=pr(requireInheritsLoose()),Dr=pr(requireMap()),Br=pr(requireInvoke()),Lr=pr(require$$0$9);pr(requirePropTypes());var jr=$r(reactExports),Ur=requireLib(),Gr=pr(requireButton()),Yr=function(Qr){(0,Nr.default)(Wn,Qr);function Wn(){for(var eo,_i=arguments.length,va=new Array(_i),io=0;io<_i;io++)va[io]=arguments[io];return eo=Qr.call.apply(Qr,[this].concat(va))||this,eo.handleButtonOverrides=function(no){return{onClick:function(ao,fo){(0,Br.default)(no,"onClick",ao,fo),(0,Br.default)(eo.props,"onActionClick",ao,fo)}}},eo}var ga=Wn.prototype;return ga.render=function(){var _i=this,va=this.props,io=va.actions,no=va.children,so=va.className,ao=va.content,fo=(0,Lr.default)("actions",so),lo=(0,Ur.getUnhandledProps)(Wn,this.props),oo=(0,Ur.getElementType)(Wn,this.props);return Ur.childrenUtils.isNil(no)?Ur.childrenUtils.isNil(ao)?jr.default.createElement(oo,(0,Mr.default)({},lo,{className:fo}),(0,Dr.default)(io,function(po){return Gr.default.create(po,{overrideProps:_i.handleButtonOverrides})})):jr.default.createElement(oo,(0,Mr.default)({},lo,{className:fo}),ao):jr.default.createElement(oo,(0,Mr.default)({},lo,{className:fo}),no)},Wn}(jr.Component);return ModalActions.default=Yr,Yr.handledProps=["actions","as","children","className","content","onActionClick"],Yr.propTypes={},Yr.create=(0,Ur.createShorthandFactory)(Yr,function(Qr){return{actions:Qr}}),ModalActions}var ModalContent$1={},hasRequiredModalContent;function requireModalContent(){if(hasRequiredModalContent)return ModalContent$1;hasRequiredModalContent=1;var $r=interopRequireDefaultExports;ModalContent$1.__esModule=!0,ModalContent$1.default=void 0;var pr=$r(require_extends()),Mr=$r(require$$0$9);$r(requirePropTypes());var Nr=$r(reactExports),Dr=requireLib();function Br(jr){var Ur=jr.children,Gr=jr.className,Yr=jr.content,Qr=jr.image,Wn=jr.scrolling,ga=(0,Mr.default)(Gr,(0,Dr.useKeyOnly)(Qr,"image"),(0,Dr.useKeyOnly)(Wn,"scrolling"),"content"),eo=(0,Dr.getUnhandledProps)(Br,jr),_i=(0,Dr.getElementType)(Br,jr);return Nr.default.createElement(_i,(0,pr.default)({},eo,{className:ga}),Dr.childrenUtils.isNil(Ur)?Yr:Ur)}Br.handledProps=["as","children","className","content","image","scrolling"],Br.propTypes={},Br.create=(0,Dr.createShorthandFactory)(Br,function(jr){return{content:jr}});var Lr=Br;return ModalContent$1.default=Lr,ModalContent$1}var ModalDescription={},hasRequiredModalDescription;function requireModalDescription(){if(hasRequiredModalDescription)return ModalDescription;hasRequiredModalDescription=1;var $r=interopRequireDefaultExports;ModalDescription.__esModule=!0,ModalDescription.default=void 0;var pr=$r(require_extends()),Mr=$r(require$$0$9);$r(requirePropTypes());var Nr=$r(reactExports),Dr=requireLib();function Br(jr){var Ur=jr.children,Gr=jr.className,Yr=jr.content,Qr=(0,Mr.default)("description",Gr),Wn=(0,Dr.getUnhandledProps)(Br,jr),ga=(0,Dr.getElementType)(Br,jr);return Nr.default.createElement(ga,(0,pr.default)({},Wn,{className:Qr}),Dr.childrenUtils.isNil(Ur)?Yr:Ur)}Br.handledProps=["as","children","className","content"],Br.propTypes={};var Lr=Br;return ModalDescription.default=Lr,ModalDescription}var ModalDimmer={},hasRequiredModalDimmer;function requireModalDimmer(){if(hasRequiredModalDimmer)return ModalDimmer;hasRequiredModalDimmer=1;var $r=interopRequireDefaultExports;ModalDimmer.__esModule=!0,ModalDimmer.default=void 0;var pr=$r(require_extends()),Mr=require$$4$2,Nr=$r(require$$0$9);$r(requirePropTypes());var Dr=$r(reactExports),Br=requireLib();function Lr(Ur){var Gr=Ur.blurring,Yr=Ur.children,Qr=Ur.className,Wn=Ur.centered,ga=Ur.content,eo=Ur.inverted,_i=Ur.mountNode,va=Ur.scrolling,io=Dr.default.useRef(),no=(0,Nr.default)("ui",(0,Br.useKeyOnly)(eo,"inverted"),(0,Br.useKeyOnly)(!Wn,"top aligned"),"page modals dimmer transition visible active",Qr),so=(0,Nr.default)("dimmable dimmed",(0,Br.useKeyOnly)(Gr,"blurring"),(0,Br.useKeyOnly)(va,"scrolling")),ao=(0,Br.getUnhandledProps)(Lr,Ur),fo=(0,Br.getElementType)(Lr,Ur);return(0,Br.useClassNamesOnNode)(_i,so),Dr.default.useEffect(function(){io.current&&io.current.style&&io.current.style.setProperty("display","flex","important")},[]),Dr.default.createElement(Mr.Ref,{innerRef:io},Dr.default.createElement(fo,(0,pr.default)({},ao,{className:no}),Br.childrenUtils.isNil(Yr)?ga:Yr))}Lr.handledProps=["as","blurring","centered","children","className","content","inverted","mountNode","scrolling"],Lr.propTypes={},Lr.create=(0,Br.createShorthandFactory)(Lr,function(Ur){return{content:Ur}});var jr=Lr;return ModalDimmer.default=jr,ModalDimmer}var ModalHeader={},hasRequiredModalHeader;function requireModalHeader(){if(hasRequiredModalHeader)return ModalHeader;hasRequiredModalHeader=1;var $r=interopRequireDefaultExports;ModalHeader.__esModule=!0,ModalHeader.default=void 0;var pr=$r(require_extends()),Mr=$r(require$$0$9);$r(requirePropTypes());var Nr=$r(reactExports),Dr=requireLib();function Br(jr){var Ur=jr.children,Gr=jr.className,Yr=jr.content,Qr=(0,Mr.default)("header",Gr),Wn=(0,Dr.getUnhandledProps)(Br,jr),ga=(0,Dr.getElementType)(Br,jr);return Nr.default.createElement(ga,(0,pr.default)({},Wn,{className:Qr}),Dr.childrenUtils.isNil(Ur)?Yr:Ur)}Br.handledProps=["as","children","className","content"],Br.propTypes={},Br.create=(0,Dr.createShorthandFactory)(Br,function(jr){return{content:jr}});var Lr=Br;return ModalHeader.default=Lr,ModalHeader}var utils={},hasRequiredUtils;function requireUtils(){if(hasRequiredUtils)return utils;hasRequiredUtils=1,utils.__esModule=!0,utils.isLegacy=utils.getLegacyStyles=utils.canFit=void 0;var $r=0,pr=50,Mr=function(Lr){var jr=Lr.height+$r,Ur=Lr.height+$r,Gr=window.innerHeight,Yr=Gr/2,Qr=-(Ur/2),Wn=pr,ga=Yr+Qr;return ga+jr+Wn<Gr};utils.canFit=Mr;var Nr=function(Lr,jr,Ur){var Gr=jr&&Lr?-(Ur.height/2):0,Yr=-(Ur.width/2);return{marginLeft:Yr,marginTop:Gr}};utils.getLegacyStyles=Nr;var Dr=function(){return!window.ActiveXObject&&"ActiveXObject"in window};return utils.isLegacy=Dr,utils}var _interopRequireWildcard=interopRequireWildcardExports,_interopRequireDefault$1=interopRequireDefaultExports;Modal$2.__esModule=!0;Modal$2.default=void 0;var _extends2=_interopRequireDefault$1(require_extends()),_inheritsLoose2=_interopRequireDefault$1(requireInheritsLoose()),_isPlainObject2=_interopRequireDefault$1(requireIsPlainObject()),_pick2=_interopRequireDefault$1(requirePick()),_includes2=_interopRequireDefault$1(requireIncludes()),_reduce2=_interopRequireDefault$1(requireReduce()),_isEmpty2=_interopRequireDefault$1(requireIsEmpty()),_invoke2=_interopRequireDefault$1(requireInvoke()),_reactComponentRef=require$$4$2,_clsx=_interopRequireDefault$1(require$$0$9);_interopRequireDefault$1(requirePropTypes());var _react=_interopRequireWildcard(reactExports),_shallowequal=_interopRequireDefault$1(requireShallowequal()),_lib=requireLib(),_Icon=_interopRequireDefault$1(requireIcon()),_Portal=_interopRequireDefault$1(requirePortal()),_ModalActions=_interopRequireDefault$1(requireModalActions()),_ModalContent=_interopRequireDefault$1(requireModalContent()),_ModalDescription=_interopRequireDefault$1(requireModalDescription()),_ModalDimmer=_interopRequireDefault$1(requireModalDimmer()),_ModalHeader=_interopRequireDefault$1(requireModalHeader()),_utils=requireUtils(),Modal$1=function($r){(0,_inheritsLoose2.default)(pr,$r);function pr(){for(var Nr,Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=$r.call.apply($r,[this].concat(Br))||this,Nr.legacy=(0,_lib.isBrowser)()&&(0,_utils.isLegacy)(),Nr.ref=(0,_react.createRef)(),Nr.dimmerRef=(0,_react.createRef)(),Nr.latestDocumentMouseDownEvent=null,Nr.getMountNode=function(){return(0,_lib.isBrowser)()?Nr.props.mountNode||document.body:null},Nr.handleActionsOverrides=function(jr){return{onActionClick:function(Gr,Yr){(0,_invoke2.default)(jr,"onActionClick",Gr,Yr),(0,_invoke2.default)(Nr.props,"onActionClick",Gr,Nr.props),Nr.handleClose(Gr)}}},Nr.handleClose=function(jr){Nr.setState({open:!1}),(0,_invoke2.default)(Nr.props,"onClose",jr,(0,_extends2.default)({},Nr.props,{open:!1}))},Nr.handleDocumentMouseDown=function(jr){Nr.latestDocumentMouseDownEvent=jr},Nr.handleDocumentClick=function(jr){var Ur=Nr.props.closeOnDimmerClick,Gr=Nr.latestDocumentMouseDownEvent;Nr.latestDocumentMouseDownEvent=null,!(!Ur||(0,_lib.doesNodeContainClick)(Nr.ref.current,Gr)||(0,_lib.doesNodeContainClick)(Nr.ref.current,jr))&&(Nr.setState({open:!1}),(0,_invoke2.default)(Nr.props,"onClose",jr,(0,_extends2.default)({},Nr.props,{open:!1})))},Nr.handleIconOverrides=function(jr){return{onClick:function(Gr){(0,_invoke2.default)(jr,"onClick",Gr),Nr.handleClose(Gr)}}},Nr.handleOpen=function(jr){(0,_invoke2.default)(Nr.props,"onOpen",jr,(0,_extends2.default)({},Nr.props,{open:!0})),Nr.setState({open:!0})},Nr.handlePortalMount=function(jr){var Ur=Nr.props.eventPool;Nr.setState({scrolling:!1}),Nr.setPositionAndClassNames(),_lib.eventStack.sub("mousedown",Nr.handleDocumentMouseDown,{pool:Ur,target:Nr.dimmerRef.current}),_lib.eventStack.sub("click",Nr.handleDocumentClick,{pool:Ur,target:Nr.dimmerRef.current}),(0,_invoke2.default)(Nr.props,"onMount",jr,Nr.props)},Nr.handlePortalUnmount=function(jr){var Ur=Nr.props.eventPool;cancelAnimationFrame(Nr.animationRequestId),_lib.eventStack.unsub("mousedown",Nr.handleDocumentMouseDown,{pool:Ur,target:Nr.dimmerRef.current}),_lib.eventStack.unsub("click",Nr.handleDocumentClick,{pool:Ur,target:Nr.dimmerRef.current}),(0,_invoke2.default)(Nr.props,"onUnmount",jr,Nr.props)},Nr.setPositionAndClassNames=function(){var jr=Nr.props.centered,Ur,Gr={};if(Nr.ref.current){var Yr=Nr.ref.current.getBoundingClientRect(),Qr=(0,_utils.canFit)(Yr);Ur=!Qr;var Wn=Nr.legacy?(0,_utils.getLegacyStyles)(Qr,jr,Yr):{};(0,_shallowequal.default)(Nr.state.legacyStyles,Wn)||(Gr.legacyStyles=Wn),Nr.state.scrolling!==Ur&&(Gr.scrolling=Ur)}(0,_isEmpty2.default)(Gr)||Nr.setState(Gr),Nr.animationRequestId=requestAnimationFrame(Nr.setPositionAndClassNames)},Nr.renderContent=function(jr){var Ur=Nr.props,Gr=Ur.actions,Yr=Ur.basic,Qr=Ur.children,Wn=Ur.className,ga=Ur.closeIcon,eo=Ur.content,_i=Ur.header,va=Ur.size,io=Ur.style,no=Nr.state,so=no.legacyStyles,ao=no.scrolling,fo=(0,_clsx.default)("ui",va,(0,_lib.useKeyOnly)(Yr,"basic"),(0,_lib.useKeyOnly)(Nr.legacy,"legacy"),(0,_lib.useKeyOnly)(ao,"scrolling"),"modal transition visible active",Wn),lo=(0,_lib.getElementType)(pr,Nr.props),oo=ga===!0?"close":ga,po=_Icon.default.create(oo,{overrideProps:Nr.handleIconOverrides});return _react.default.createElement(_reactComponentRef.Ref,{innerRef:Nr.ref},_react.default.createElement(lo,(0,_extends2.default)({},jr,{className:fo,style:(0,_extends2.default)({},so,io)}),po,_lib.childrenUtils.isNil(Qr)?_react.default.createElement(_react.default.Fragment,null,_ModalHeader.default.create(_i,{autoGenerateKey:!1}),_ModalContent.default.create(eo,{autoGenerateKey:!1}),_ModalActions.default.create(Gr,{overrideProps:Nr.handleActionsOverrides})):Qr))},Nr}var Mr=pr.prototype;return Mr.componentWillUnmount=function(){this.handlePortalUnmount()},Mr.render=function(){var Dr=this.props,Br=Dr.centered,Lr=Dr.closeOnDocumentClick,jr=Dr.dimmer,Ur=Dr.eventPool,Gr=Dr.trigger,Yr=this.state,Qr=Yr.open,Wn=Yr.scrolling,ga=this.getMountNode();if(!(0,_lib.isBrowser)())return(0,_react.isValidElement)(Gr)?Gr:null;var eo=(0,_lib.getUnhandledProps)(pr,this.props),_i=_Portal.default.handledProps,va=(0,_reduce2.default)(eo,function(no,so,ao){return(0,_includes2.default)(_i,ao)||(no[ao]=so),no},{}),io=(0,_pick2.default)(eo,_i);return _react.default.createElement(_Portal.default,(0,_extends2.default)({closeOnDocumentClick:Lr},io,{trigger:Gr,eventPool:Ur,mountNode:ga,open:Qr,onClose:this.handleClose,onMount:this.handlePortalMount,onOpen:this.handleOpen,onUnmount:this.handlePortalUnmount}),_react.default.createElement(_reactComponentRef.Ref,{innerRef:this.dimmerRef},_ModalDimmer.default.create((0,_isPlainObject2.default)(jr)?jr:{},{autoGenerateKey:!1,defaultProps:{blurring:jr==="blurring",inverted:jr==="inverted"},overrideProps:{children:this.renderContent(va),centered:Br,mountNode:ga,scrolling:Wn}})))},pr}(_lib.ModernAutoControlledComponent);Modal$1.handledProps=["actions","as","basic","centered","children","className","closeIcon","closeOnDimmerClick","closeOnDocumentClick","content","defaultOpen","dimmer","eventPool","header","mountNode","onActionClick","onClose","onMount","onOpen","onUnmount","open","size","style","trigger"];Modal$1.propTypes={};Modal$1.defaultProps={centered:!0,dimmer:!0,closeOnDimmerClick:!0,closeOnDocumentClick:!1,eventPool:"Modal"};Modal$1.autoControlledProps=["open"];Modal$1.Actions=_ModalActions.default;Modal$1.Content=_ModalContent.default;Modal$1.Description=_ModalDescription.default;Modal$1.Dimmer=_ModalDimmer.default;Modal$1.Header=_ModalHeader.default;var _default$1=Modal$1;Modal$2.default=_default$1;const Modal="";(function($r){var pr=commonjsGlobal&&commonjsGlobal.__importDefault||function(Nr){return Nr&&Nr.__esModule?Nr:{default:Nr}};Object.defineProperty($r,"__esModule",{value:!0}),$r.Modal=void 0;var Mr=Modal$2;Object.defineProperty($r,"Modal",{enumerable:!0,get:function(){return pr(Mr).default}})})(Modal$3);const wait=$r=>new Promise(pr=>setTimeout(pr,$r));var ModalContentExports=requireModalContent();const ModalContent=getDefaultExportFromCjs$1(ModalContentExports);var ModalNavigation$2={};const ModalNavigation$1="";var __extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var $r=function(pr,Mr){return $r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Nr,Dr){Nr.__proto__=Dr}||function(Nr,Dr){for(var Br in Dr)Object.prototype.hasOwnProperty.call(Dr,Br)&&(Nr[Br]=Dr[Br])},$r(pr,Mr)};return function(pr,Mr){if(typeof Mr!="function"&&Mr!==null)throw new TypeError("Class extends value "+String(Mr)+" is not a constructor or null");$r(pr,Mr);function Nr(){this.constructor=pr}pr.prototype=Mr===null?Object.create(Mr):(Nr.prototype=Mr.prototype,new Nr)}}(),__createBinding=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function($r,pr,Mr,Nr){Nr===void 0&&(Nr=Mr);var Dr=Object.getOwnPropertyDescriptor(pr,Mr);(!Dr||("get"in Dr?!pr.__esModule:Dr.writable||Dr.configurable))&&(Dr={enumerable:!0,get:function(){return pr[Mr]}}),Object.defineProperty($r,Nr,Dr)}:function($r,pr,Mr,Nr){Nr===void 0&&(Nr=Mr),$r[Nr]=pr[Mr]}),__setModuleDefault=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function($r,pr){Object.defineProperty($r,"default",{enumerable:!0,value:pr})}:function($r,pr){$r.default=pr}),__importStar=commonjsGlobal&&commonjsGlobal.__importStar||function($r){if($r&&$r.__esModule)return $r;var pr={};if($r!=null)for(var Mr in $r)Mr!=="default"&&Object.prototype.hasOwnProperty.call($r,Mr)&&__createBinding(pr,$r,Mr);return __setModuleDefault(pr,$r),pr};Object.defineProperty(ModalNavigation$2,"__esModule",{value:!0});var ModalNavigation_2=ModalNavigation$2.ModalNavigation=void 0,React=__importStar(reactExports),ModalNavigation=function($r){__extends(pr,$r);function pr(){return $r!==null&&$r.apply(this,arguments)||this}return pr.prototype.render=function(){var Mr=this.props,Nr=Mr.title,Dr=Mr.subtitle,Br=Mr.onBack,Lr=Mr.onClose,jr=Mr.onInfo;return React.createElement("div",{className:"dcl modal-navigation"},React.createElement("div",{className:"dcl modal-navigation-title"},Nr),Dr&&React.createElement("div",{className:"dcl modal-navigation-subtitle"},Dr),Br&&React.createElement("div",{className:"dcl modal-navigation-button modal-navigation-back",onClick:Br}),jr&&React.createElement("div",{className:"dcl modal-navigation-button modal-navigation-info",onClick:jr}),Lr&&React.createElement("div",{className:"dcl modal-navigation-button modal-navigation-close",onClick:Lr}))},pr}(React.PureComponent);ModalNavigation_2=ModalNavigation$2.ModalNavigation=ModalNavigation;const warningSrc="https://cdn.decentraland.org/@dcl/auth-site/1.3.1-7743847636.commit-51766c3/assets/warning-057948e8.svg";var ConnectionModalState=($r=>($r.CONNECTING_WALLET="CONNECTING_WALLET",$r.WAITING_FOR_SIGNATURE="WAITING_FOR_SIGNATURE",$r.ERROR="ERROR",$r.LOADING_MAGIC="LOADING_MAGIC",$r.VALIDATING_SIGN_IN="VALIDATING_SIGN_IN",$r.WAITING_FOR_CONFIRMATION="WAITING_FOR_CONFIRMATION",$r))(ConnectionModalState||{});function getConnectionMessage($r,pr){switch($r){case ConnectionModalState.ERROR:return"You did not confirm this action in your digital wallet extension. To continue, please try again.";case ConnectionModalState.CONNECTING_WALLET:case ConnectionModalState.WAITING_FOR_SIGNATURE:return pr===dist$6.ProviderType.MAGIC?"Almost done! Confirm your request to login Decentraland":"Confirm in your digital wallet extension to continue.";case ConnectionModalState.VALIDATING_SIGN_IN:return"Just a moment, we're verifying your login credentials...";case ConnectionModalState.LOADING_MAGIC:return"Redirecting..."}}const main$3="_main_1qx1l_1",content="_content_1qx1l_8",errorImage="_errorImage_1qx1l_16",message="_message_1qx1l_22",loader="_loader_1qx1l_29",styles$6={main:main$3,content,errorImage,message,loader},ConnectionModal=$r=>{const{open:pr,state:Mr,providerType:Nr,onClose:Dr,onTryAgain:Br}=$r,Lr=Mr===ConnectionModalState.CONNECTING_WALLET||Mr===ConnectionModalState.WAITING_FOR_SIGNATURE||Mr===ConnectionModalState.LOADING_MAGIC||Mr===ConnectionModalState.VALIDATING_SIGN_IN;return jsxRuntimeExports.jsxs(Modal$3.Modal,{size:"tiny",open:pr,children:[jsxRuntimeExports.jsx(ModalNavigation_2,{title:"",onClose:Lr?void 0:Dr}),jsxRuntimeExports.jsx("div",{className:styles$6.main,children:jsxRuntimeExports.jsxs("div",{className:styles$6.content,children:[Mr===ConnectionModalState.ERROR&&jsxRuntimeExports.jsx("img",{className:styles$6.errorImage,src:warningSrc}),Lr&&jsxRuntimeExports.jsx(Loader_3,{className:styles$6.loader,size:"huge",inline:!0}),jsxRuntimeExports.jsx("p",{className:styles$6.message,children:getConnectionMessage(Mr,Nr)}),Mr===ConnectionModalState.ERROR&&jsxRuntimeExports.jsx(Button$5.Button,{primary:!0,onClick:Br,children:"Try again"})]})}),jsxRuntimeExports.jsx(ModalContent,{})]})};var Popup={},isElement_1,hasRequiredIsElement;function requireIsElement(){if(hasRequiredIsElement)return isElement_1;hasRequiredIsElement=1;var $r=requireIsObjectLike(),pr=requireIsPlainObject();function Mr(Nr){return $r(Nr)&&Nr.nodeType===1&&!pr(Nr)}return isElement_1=Mr,isElement_1}const require$$17=getAugmentedNamespace(esm);var positions={},_baseInverter,hasRequired_baseInverter;function require_baseInverter(){if(hasRequired_baseInverter)return _baseInverter;hasRequired_baseInverter=1;var $r=require_baseForOwn();function pr(Mr,Nr,Dr,Br){return $r(Mr,function(Lr,jr,Ur){Nr(Br,Dr(Lr),jr,Ur)}),Br}return _baseInverter=pr,_baseInverter}var _createInverter,hasRequired_createInverter;function require_createInverter(){if(hasRequired_createInverter)return _createInverter;hasRequired_createInverter=1;var $r=require_baseInverter();function pr(Mr,Nr){return function(Dr,Br){return $r(Dr,Mr,Nr(Br),{})}}return _createInverter=pr,_createInverter}var invert_1,hasRequiredInvert;function requireInvert(){if(hasRequiredInvert)return invert_1;hasRequiredInvert=1;var $r=requireConstant(),pr=require_createInverter(),Mr=requireIdentity(),Nr=Object.prototype,Dr=Nr.toString,Br=pr(function(Lr,jr,Ur){jr!=null&&typeof jr.toString!="function"&&(jr=Dr.call(jr)),Lr[jr]=Ur},$r(Mr));return invert_1=Br,invert_1}var hasRequiredPositions;function requirePositions(){if(hasRequiredPositions)return positions;hasRequiredPositions=1;var $r=interopRequireDefaultExports;positions.__esModule=!0,positions.placementMapping=positions.positions=positions.positionsMapping=void 0;var pr=$r(requireInvert()),Mr=$r(requireKeys()),Nr={"top center":"top","top left":"top-start","top right":"top-end","bottom center":"bottom","bottom left":"bottom-start","bottom right":"bottom-end","right center":"right","left center":"left"};positions.positionsMapping=Nr;var Dr=(0,Mr.default)(Nr);positions.positions=Dr;var Br=(0,pr.default)(Nr);return positions.placementMapping=Br,positions}var createReferenceProxy={},createClass={exports:{}},toPropertyKey={exports:{}},toPrimitive={exports:{}},hasRequiredToPrimitive;function requireToPrimitive(){return hasRequiredToPrimitive||(hasRequiredToPrimitive=1,function($r){var pr=_typeofExports$2.default;function Mr(Nr,Dr){if(pr(Nr)!=="object"||Nr===null)return Nr;var Br=Nr[Symbol.toPrimitive];if(Br!==void 0){var Lr=Br.call(Nr,Dr||"default");if(pr(Lr)!=="object")return Lr;throw new TypeError("@@toPrimitive must return a primitive value.")}return(Dr==="string"?String:Number)(Nr)}$r.exports=Mr,$r.exports.__esModule=!0,$r.exports.default=$r.exports}(toPrimitive)),toPrimitive.exports}var hasRequiredToPropertyKey;function requireToPropertyKey(){return hasRequiredToPropertyKey||(hasRequiredToPropertyKey=1,function($r){var pr=_typeofExports$2.default,Mr=requireToPrimitive();function Nr(Dr){var Br=Mr(Dr,"string");return pr(Br)==="symbol"?Br:String(Br)}$r.exports=Nr,$r.exports.__esModule=!0,$r.exports.default=$r.exports}(toPropertyKey)),toPropertyKey.exports}var hasRequiredCreateClass;function requireCreateClass(){return hasRequiredCreateClass||(hasRequiredCreateClass=1,function($r){var pr=requireToPropertyKey();function Mr(Dr,Br){for(var Lr=0;Lr<Br.length;Lr++){var jr=Br[Lr];jr.enumerable=jr.enumerable||!1,jr.configurable=!0,"value"in jr&&(jr.writable=!0),Object.defineProperty(Dr,pr(jr.key),jr)}}function Nr(Dr,Br,Lr){return Br&&Mr(Dr.prototype,Br),Lr&&Mr(Dr,Lr),Object.defineProperty(Dr,"prototype",{writable:!1}),Dr}$r.exports=Nr,$r.exports.__esModule=!0,$r.exports.default=$r.exports}(createClass)),createClass.exports}var hasRequiredCreateReferenceProxy;function requireCreateReferenceProxy(){if(hasRequiredCreateReferenceProxy)return createReferenceProxy;hasRequiredCreateReferenceProxy=1;var $r=interopRequireDefaultExports;createReferenceProxy.__esModule=!0,createReferenceProxy.default=void 0;var pr=$r(requireCreateClass()),Mr=$r(requireMemoize()),Nr=$r(requireInvoke()),Dr=require$$4$2,Br=function(){function Ur(Yr){this.ref=Yr}var Gr=Ur.prototype;return Gr.getBoundingClientRect=function(){return(0,Nr.default)(this.ref.current,"getBoundingClientRect")||{}},(0,pr.default)(Ur,[{key:"clientWidth",get:function(){return this.getBoundingClientRect().width}},{key:"clientHeight",get:function(){return this.getBoundingClientRect().height}},{key:"parentNode",get:function(){return this.ref.current?this.ref.current.parentNode:void 0}}]),Ur}(),Lr=(0,Mr.default)(function(Ur){return new Br((0,Dr.isRefObject)(Ur)?Ur:{current:Ur})}),jr=Lr;return createReferenceProxy.default=jr,createReferenceProxy}var PopupContent={},hasRequiredPopupContent;function requirePopupContent(){if(hasRequiredPopupContent)return PopupContent;hasRequiredPopupContent=1;var $r=interopRequireDefaultExports;PopupContent.__esModule=!0,PopupContent.default=Br;var pr=$r(require_extends()),Mr=$r(require$$0$9);$r(requirePropTypes());var Nr=$r(reactExports),Dr=requireLib();function Br(Lr){var jr=Lr.children,Ur=Lr.className,Gr=Lr.content,Yr=(0,Mr.default)("content",Ur),Qr=(0,Dr.getUnhandledProps)(Br,Lr),Wn=(0,Dr.getElementType)(Br,Lr);return Nr.default.createElement(Wn,(0,pr.default)({},Qr,{className:Yr}),Dr.childrenUtils.isNil(jr)?Gr:jr)}return Br.handledProps=["as","children","className","content"],Br.propTypes={},Br.create=(0,Dr.createShorthandFactory)(Br,function(Lr){return{children:Lr}}),PopupContent}var PopupHeader={},hasRequiredPopupHeader;function requirePopupHeader(){if(hasRequiredPopupHeader)return PopupHeader;hasRequiredPopupHeader=1;var $r=interopRequireDefaultExports;PopupHeader.__esModule=!0,PopupHeader.default=Br;var pr=$r(require_extends()),Mr=$r(require$$0$9);$r(requirePropTypes());var Nr=$r(reactExports),Dr=requireLib();function Br(Lr){var jr=Lr.children,Ur=Lr.className,Gr=Lr.content,Yr=(0,Mr.default)("header",Ur),Qr=(0,Dr.getUnhandledProps)(Br,Lr),Wn=(0,Dr.getElementType)(Br,Lr);return Nr.default.createElement(Wn,(0,pr.default)({},Qr,{className:Yr}),Dr.childrenUtils.isNil(jr)?Gr:jr)}return Br.handledProps=["as","children","className","content"],Br.propTypes={},Br.create=(0,Dr.createShorthandFactory)(Br,function(Lr){return{children:Lr}}),PopupHeader}var hasRequiredPopup;function requirePopup(){if(hasRequiredPopup)return Popup;hasRequiredPopup=1;var $r=interopRequireWildcardExports,pr=interopRequireDefaultExports;Popup.__esModule=!0,Popup.default=void 0;var Mr=pr(require_extends()),Nr=pr(requireInheritsLoose());pr(requireWithout());var Dr=pr(requireIsNil()),Br=pr(requireIsUndefined()),Lr=pr(requireInvoke()),jr=pr(requireIsElement()),Ur=pr(requireIsArray()),Gr=pr(requirePick()),Yr=pr(requireIncludes()),Qr=pr(requireReduce()),Wn=pr(requireLib$1()),ga=pr(require$$0$9);pr(requirePropTypes());var eo=$r(reactExports),_i=require$$17,va=pr(requireShallowequal()),io=requireLib(),no=pr(requirePortal()),so=requirePositions(),ao=pr(requireCreateReferenceProxy()),fo=pr(requirePopupContent()),lo=pr(requirePopupHeader()),oo=function(po){(0,Nr.default)(mo,po);function mo(){for(var Xn,Fr=arguments.length,Vr=new Array(Fr),Wr=0;Wr<Fr;Wr++)Vr[Wr]=arguments[Wr];return Xn=po.call.apply(po,[this].concat(Vr))||this,Xn.state={},Xn.open=!1,Xn.zIndexWasSynced=!1,Xn.triggerRef=eo.default.createRef(),Xn.elementRef=eo.default.createRef(),Xn.getPortalProps=function(){var Jr={},Gn=Xn.props,to=Gn.on,ro=Gn.hoverable,Un=(0,Ur.default)(to)?to:[to];return ro&&(Jr.closeOnPortalMouseLeave=!0,Jr.mouseLeaveDelay=300),(0,Yr.default)(Un,"hover")&&(Jr.openOnTriggerClick=!1,Jr.closeOnTriggerClick=!1,Jr.openOnTriggerMouseEnter=!0,Jr.closeOnTriggerMouseLeave=!0,Jr.mouseLeaveDelay=70,Jr.mouseEnterDelay=50),(0,Yr.default)(Un,"click")&&(Jr.openOnTriggerClick=!0,Jr.closeOnTriggerClick=!0,Jr.closeOnDocumentClick=!0),(0,Yr.default)(Un,"focus")&&(Jr.openOnTriggerFocus=!0,Jr.closeOnTriggerBlur=!0),Jr},Xn.hideOnScroll=function(Jr){(0,jr.default)(Jr.target)&&Xn.elementRef.current.contains(Jr.target)||(Xn.setState({closed:!0}),io.eventStack.unsub("scroll",Xn.hideOnScroll,{target:window}),Xn.timeoutId=setTimeout(function(){Xn.setState({closed:!1})},50),Xn.handleClose(Jr))},Xn.handleClose=function(Jr){(0,Lr.default)(Xn.props,"onClose",Jr,(0,Mr.default)({},Xn.props,{open:!1}))},Xn.handleOpen=function(Jr){(0,Lr.default)(Xn.props,"onOpen",Jr,(0,Mr.default)({},Xn.props,{open:!0}))},Xn.handlePortalMount=function(Jr){(0,Lr.default)(Xn.props,"onMount",Jr,Xn.props)},Xn.handlePortalUnmount=function(Jr){Xn.positionUpdate=null,(0,Lr.default)(Xn.props,"onUnmount",Jr,Xn.props)},Xn.renderContent=function(Jr){var Gn=Jr.placement,to=Jr.ref,ro=Jr.update,Un=Jr.style,Hr=Xn.props,Xr=Hr.basic,co=Hr.children,ho=Hr.className,go=Hr.content,bo=Hr.hideOnScroll,Eo=Hr.flowing,wo=Hr.header,Io=Hr.inverted,Po=Hr.popper,yo=Hr.size,xo=Hr.style,Mo=Hr.wide,qo=Xn.state.contentRestProps;Xn.positionUpdate=ro;var pu=(0,ga.default)("ui",so.placementMapping[Gn],yo,(0,io.useKeyOrValueAndKey)(Mo,"wide"),(0,io.useKeyOnly)(Xr,"basic"),(0,io.useKeyOnly)(Eo,"flowing"),(0,io.useKeyOnly)(Io,"inverted"),"popup transition visible",ho),nu=(0,io.getElementType)(mo,Xn.props),eu=(0,Mr.default)({left:"auto",right:"auto",position:"initial"},xo),Uu=eo.default.createElement(nu,(0,Mr.default)({},qo,{className:pu,style:eu,ref:Xn.elementRef}),io.childrenUtils.isNil(co)?eo.default.createElement(eo.default.Fragment,null,lo.default.create(wo,{autoGenerateKey:!1}),fo.default.create(go,{autoGenerateKey:!1})):co,bo&&eo.default.createElement(Wn.default,{on:Xn.hideOnScroll,name:"scroll",target:"window"}));return(0,io.createHTMLDivision)(Po||{},{overrideProps:{children:Uu,ref:to,style:(0,Mr.default)({display:"flex"},Un)}})},Xn}mo.getDerivedStateFromProps=function(Fr,Vr){if(Vr.closed||Vr.disabled)return{};var Wr=(0,io.getUnhandledProps)(mo,Fr),Jr=(0,Qr.default)(Wr,function(to,ro,Un){return(0,Yr.default)(no.default.handledProps,Un)||(to[Un]=ro),to},{}),Gn=(0,Gr.default)(Wr,no.default.handledProps);return{contentRestProps:Jr,portalRestProps:Gn}};var $o=mo.prototype;return $o.componentDidUpdate=function(Fr){var Vr=(0,va.default)(this.props.popperDependencies,Fr.popperDependencies);Vr||this.handleUpdate()},$o.componentWillUnmount=function(){clearTimeout(this.timeoutId)},$o.handleUpdate=function(){this.positionUpdate&&this.positionUpdate()},$o.render=function(){var Fr=this,Vr=this.props,Wr=Vr.context,Jr=Vr.disabled,Gn=Vr.eventsEnabled,to=Vr.offset,ro=Vr.pinned,Un=Vr.popper,Hr=Vr.popperModifiers,Xr=Vr.position,co=Vr.positionFixed,ho=Vr.trigger,go=this.state,bo=go.closed,Eo=go.portalRestProps;if(bo||Jr)return ho;var wo=[{name:"arrow",enabled:!1},{name:"eventListeners",options:{scroll:!!Gn,resize:!!Gn}},{name:"flip",enabled:!ro},{name:"preventOverflow",enabled:!!to},{name:"offset",enabled:!!to,options:{offset:to}}].concat(Hr,[{name:"syncZIndex",enabled:!0,phase:"beforeRead",fn:function(xo){var Mo,qo=xo.state;if(!Fr.zIndexWasSynced){var pu=Un==null||(Mo=Un.style)==null?void 0:Mo.zIndex;(0,Br.default)(pu)&&(qo.elements.popper.style.zIndex=window.getComputedStyle(qo.elements.popper.firstChild).zIndex),Fr.zIndexWasSynced=!0}},effect:function(){return function(){Fr.zIndexWasSynced=!1}}}]),Io=(0,ao.default)((0,Dr.default)(Wr)?this.triggerRef:Wr),Po=(0,Mr.default)({},this.getPortalProps(),Eo);return eo.default.createElement(no.default,(0,Mr.default)({},Po,{onClose:this.handleClose,onMount:this.handlePortalMount,onOpen:this.handleOpen,onUnmount:this.handlePortalUnmount,trigger:ho,triggerRef:this.triggerRef}),eo.default.createElement(_i.Popper,{modifiers:wo,placement:so.positionsMapping[Xr],strategy:co?"fixed":null,referenceElement:Io},this.renderContent))},mo}(eo.Component);return Popup.default=oo,oo.handledProps=["as","basic","children","className","content","context","disabled","eventsEnabled","flowing","header","hideOnScroll","hoverable","inverted","offset","on","onClose","onMount","onOpen","onUnmount","pinned","popper","popperDependencies","popperModifiers","position","positionFixed","size","style","trigger","wide"],oo.propTypes={},oo.defaultProps={disabled:!1,eventsEnabled:!0,on:["click","hover"],pinned:!1,popperModifiers:[],position:"top left"},oo.Content=fo.default,oo.Header=lo.default,Popup}var _interopRequireDefault=interopRequireDefaultExports,_Popup=_interopRequireDefault(requirePopup()),_default=_Popup.default;const capitalize=$r=>$r.charAt(0).toUpperCase()+$r.slice(1),button="_button_1uvkr_1",icon="_icon_1uvkr_5",styles$5={button,icon,"icon-metamask-mobile":"_icon-metamask-mobile_1uvkr_13","icon-metamask":"_icon-metamask_1uvkr_13","icon-dapper":"_icon-dapper_1uvkr_18","icon-fortmatic":"_icon-fortmatic_1uvkr_22","icon-wallet-connect":"_icon-wallet-connect_1uvkr_26","icon-samsung-blockchain-wallet":"_icon-samsung-blockchain-wallet_1uvkr_30","icon-coinbase":"_icon-coinbase_1uvkr_34","icon-wallet-link":"_icon-wallet-link_1uvkr_35","icon-google":"_icon-google_1uvkr_39","icon-discord":"_icon-discord_1uvkr_43","icon-apple":"_icon-apple_1uvkr_47","icon-x":"_icon-x_1uvkr_51"},ConnectionOption=$r=>{const{className:pr,children:Mr,type:Nr,testId:Dr,showTooltip:Br,tooltipPosition:Lr,disabled:jr,info:Ur,loading:Gr,onClick:Yr}=$r;return jsxRuntimeExports.jsx(_default,{position:Br&&Lr?Lr:"top center",disabled:!Br,trigger:jsxRuntimeExports.jsx("span",{children:jsxRuntimeExports.jsxs(Button$5.Button,{primary:!0,size:"small","data-testid":`${Dr}-${Nr}-button`,className:classNames(pr,styles$5.button),onClick:()=>Yr(Nr),disabled:jr,loading:Gr,children:[Gr?null:jsxRuntimeExports.jsx("div",{role:"img","aria-label":Nr,className:classNames(styles$5.icon,styles$5[`icon-${Nr}`],styles$5.primaryImage)}),Mr]},Nr)}),content:Ur??capitalize(Nr),on:"hover"})},SOCIAL_PRIMARY_TEST_ID="social-primary-test-id",SOCIAL_SECONDARY_TEST_ID="social-secondary-test-id",WEB3_PRIMARY_TEST_ID="web3-primary-test-id",WEB3_SECONDARY_TEST_ID="web3-secondary-test-id",SHOW_MORE_BUTTON_TEST_ID="show-more-button-test-id";var ConnectionOptionType=($r=>($r.METAMASK="metamask",$r.DAPPER="dapper",$r.FORTMATIC="fortmatic",$r.COINBASE="coinbase",$r.SAMSUNG="samsung-blockchain-wallet",$r.WALLET_CONNECT="wallet-connect",$r.WALLET_LINK="wallet-link",$r.METAMASK_MOBILE="metamask-mobile",$r.GOOGLE="google",$r.APPLE="apple",$r.DISCORD="discord",$r.X="x",$r))(ConnectionOptionType||{});const connection="_connection_ym3lq_3",dclLogo="_dclLogo_ym3lq_9",title$2="_title_ym3lq_15",subtitle="_subtitle_ym3lq_20",primaryButton="_primaryButton_ym3lq_29",primaryImage="_primaryImage_ym3lq_38",primaryMessage="_primaryMessage_ym3lq_42",primaryMagic="_primaryMagic_ym3lq_51",primaryLearnMore="_primaryLearnMore_ym3lq_60",primary="_primary_ym3lq_29",showMore="_showMore_ym3lq_73",showMoreButton="_showMoreButton_ym3lq_77",showMoreSecondaryOptions="_showMoreSecondaryOptions_ym3lq_86",primaryOption="_primaryOption_ym3lq_100",secondaryOptionButton="_secondaryOptionButton_ym3lq_104",styles$4={connection,dclLogo,title:title$2,subtitle,primaryButton,primaryImage,primaryMessage,primaryMagic,primaryLearnMore,primary,showMore,showMoreButton,showMoreSecondaryOptions,primaryOption,secondaryOptionButton},Primary=({message:$r,children:pr,option:Mr,testId:Nr,loadingOption:Dr,error:Br,onConnect:Lr})=>jsxRuntimeExports.jsxs("div",{className:styles$4.primary,"data-testid":Nr,children:[jsxRuntimeExports.jsx("div",{className:styles$4.primaryMessage,children:$r}),jsxRuntimeExports.jsx(ConnectionOption,{disabled:!!Dr||!!Br,loading:Dr===Mr,showTooltip:!!Br,type:Mr,info:Br,onClick:Lr,className:classNames(styles$4.primaryButton,styles$4.primaryOption),testId:Nr,children:pr})]}),Secondary=({options:$r,tooltipDirection:pr,testId:Mr,loadingOption:Nr,onConnect:Dr})=>jsxRuntimeExports.jsx("div",{className:styles$4.showMoreSecondaryOptions,"data-testid":Mr,children:$r.map(Br=>jsxRuntimeExports.jsx(ConnectionOption,{className:classNames(styles$4.primaryButton,styles$4.secondaryOptionButton),showTooltip:!0,tooltipPosition:pr,type:Br,onClick:Dr,testId:Mr,loading:Nr===Br,disabled:!!Nr},Br))}),defaultProps$2={i18n:{title:"Discover a virtual social world",subtitle:"shaped by its community of creators & explorers.",accessWith:$r=>`Access with ${$r}`,connectWith:$r=>`Connect with ${$r}`,moreOptions:"More Options",socialMessage:$r=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["Access secured by ",$r]}),web3Message:$r=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["Have a digital wallet? ",$r("Learn More")]})}},Connection=$r=>{var eo;const{i18n:pr=defaultProps$2.i18n,onConnect:Mr,onLearnMore:Nr,socialOptions:Dr,web3Options:Br,className:Lr,loadingOption:jr}=$r,[Ur,Gr]=reactExports.useState(!1),Yr=reactExports.useCallback(()=>{Gr(!Ur)},[Ur]),Qr=(eo=window.ethereum)==null?void 0:eo.isMetaMask,Wn=Dr&&Dr.secondary&&Dr.secondary.length>0,ga=Br&&Br.secondary&&Br.secondary.length>0;return jsxRuntimeExports.jsxs("div",{className:classNames(Lr,styles$4.connection),children:[jsxRuntimeExports.jsx("img",{className:styles$4.dclLogo,src:logoSrc,alt:"Decentraland logo"}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h1",{className:styles$4.title,children:pr.title}),jsxRuntimeExports.jsx("h2",{className:styles$4.subtitle,children:pr.subtitle}),Dr?jsxRuntimeExports.jsx(Primary,{onConnect:Mr,testId:SOCIAL_PRIMARY_TEST_ID,option:Dr==null?void 0:Dr.primary,loadingOption:jr,message:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[pr.socialMessage(jsxRuntimeExports.jsx("div",{className:styles$4.primaryMagic,role:"img","aria-label":"Magic"})),jsxRuntimeExports.jsx("span",{className:styles$4.primaryLearnMore,role:"button",onClick:()=>Nr(Dr==null?void 0:Dr.primary),children:"Learn More"})]}),children:jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:pr.accessWith(Dr==null?void 0:Dr.primary)})}):null,Br?jsxRuntimeExports.jsx(Primary,{onConnect:Mr,testId:WEB3_PRIMARY_TEST_ID,option:Br==null?void 0:Br.primary,loadingOption:jr,error:!Qr&&(Br==null?void 0:Br.primary)===ConnectionOptionType.METAMASK?"You need to install the MetaMask Browser Extension to proceed. Please install it and try again.":void 0,message:pr.web3Message(_i=>jsxRuntimeExports.jsx("span",{className:styles$4.primaryLearnMore,role:"button",onClick:()=>Nr(Br.primary),children:_i})),children:jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:pr.connectWith(Br==null?void 0:Br.primary)})}):null]}),jsxRuntimeExports.jsxs("div",{className:styles$4.showMore,children:[(ga||Wn)&&jsxRuntimeExports.jsxs(Button$5.Button,{"data-testid":SHOW_MORE_BUTTON_TEST_ID,basic:!0,size:"medium",fluid:!0,className:styles$4.showMoreButton,onClick:Yr,children:[pr.moreOptions,jsxRuntimeExports.jsx(default_1,{name:Ur?"chevron up":"chevron down"})]}),Ur&&Wn&&jsxRuntimeExports.jsx(Secondary,{testId:SOCIAL_SECONDARY_TEST_ID,options:Dr.secondary,onConnect:Mr,tooltipDirection:"top center",loadingOption:jr}),Ur&&ga&&jsxRuntimeExports.jsx(Secondary,{testId:WEB3_SECONDARY_TEST_ID,options:Br.secondary,onConnect:Mr,tooltipDirection:"bottom center",loadingOption:jr})]})]})},ONE_MONTH_IN_MINUTES=60*24*30,MAGIC_KEY$1=dist$7.getConfiguration().magic.apiKey;function fromConnectionOptionToProviderType($r){switch($r){case ConnectionOptionType.DISCORD:case ConnectionOptionType.X:case ConnectionOptionType.GOOGLE:case ConnectionOptionType.APPLE:return providerType.ProviderType.MAGIC;case ConnectionOptionType.WALLET_CONNECT:case ConnectionOptionType.METAMASK_MOBILE:return providerType.ProviderType.WALLET_CONNECT_V2;case ConnectionOptionType.COINBASE:case ConnectionOptionType.WALLET_LINK:return providerType.ProviderType.WALLET_LINK;case ConnectionOptionType.FORTMATIC:return providerType.ProviderType.FORTMATIC;case ConnectionOptionType.METAMASK:case ConnectionOptionType.DAPPER:case ConnectionOptionType.SAMSUNG:return providerType.ProviderType.INJECTED;default:throw new Error("Invalid provider")}}async function generateIdentity($r,pr){const Mr=new BrowserProvider(pr),Nr=Wallet.createRandom(),Dr={address:Nr.address.toString(),publicKey:hexlify(Nr.publicKey),privateKey:hexlify(Nr.privateKey)},Br=await Mr.getSigner();return dist.Authenticator.initializeAuthChain($r,Dr,ONE_MONTH_IN_MINUTES,Lr=>Br.signMessage(Lr))}async function connectToProvider($r){const pr=fromConnectionOptionToProviderType($r);if(providerType.ProviderType.MAGIC===pr){const{Magic:Nr}=await __vitePreload(()=>Promise.resolve().then(()=>es$1),void 0),{OAuthExtension:Dr}=await __vitePreload(()=>Promise.resolve().then(()=>es),void 0),Br=new Nr(MAGIC_KEY$1,{extensions:[new Dr]}),Lr=new URL(window.location.href);Lr.pathname="/auth/callback",await Br.oauth.loginWithRedirect({provider:$r===ConnectionOptionType.X?"twitter":$r,redirectURI:Lr.href})}const Mr=await dist$7.connection.connect(pr);if(!Mr.account||!Mr.provider)throw new Error("Could not get provider");return Mr}function isSocialLogin($r){return[ConnectionOptionType.APPLE,ConnectionOptionType.GOOGLE,ConnectionOptionType.X,ConnectionOptionType.DISCORD].includes($r)}async function getIdentitySignature($r,pr){let Mr;const Nr=dist$4.localStorageGetIdentity($r);return Nr?Mr=Nr:(Mr=await generateIdentity($r,pr),dist$4.localStorageStoreIdentity($r,Mr)),Mr}const container="_container_1jfc2_1",info$2="_info_1jfc2_19",title$1="_title_1jfc2_28",styles$3={container,info:info$2,title:title$1},MAGIC_KEY=dist$7.getConfiguration().magic.apiKey,CallbackPage=()=>{usePageTracking();const $r=useAfterLoginRedirection(),pr=useNavigate(),[Mr,Nr]=reactExports.useState(ConnectionModalState.WAITING_FOR_CONFIRMATION),{flags:Dr}=reactExports.useContext(FeatureFlagsContext),Br=reactExports.useCallback(async()=>{var Gr;const Ur=await dist$7.connection.connect(dist$6.ProviderType.MAGIC);return await getIdentitySignature(((Gr=Ur.account)==null?void 0:Gr.toLowerCase())??"",Ur.provider),Ur},[]),Lr=reactExports.useCallback(async()=>{const{Magic:Ur}=await __vitePreload(()=>Promise.resolve().then(()=>es$1),void 0),{OAuthExtension:Gr}=await __vitePreload(()=>Promise.resolve().then(()=>es),void 0),Yr=new Ur(MAGIC_KEY,{extensions:[new Gr]});try{Nr(ConnectionModalState.VALIDATING_SIGN_IN),await(Yr==null?void 0:Yr.oauth.getRedirectResult()),Nr(ConnectionModalState.WAITING_FOR_CONFIRMATION)}catch(Qr){console.log(Qr),pr("/login")}},[pr]);reactExports.useEffect(()=>{Lr()},[]);const jr=reactExports.useCallback(async()=>{var Ur;try{Nr(ConnectionModalState.WAITING_FOR_SIGNATURE);const Gr=await Br(),Yr=((Ur=Gr.account)==null?void 0:Ur.toLowerCase())??"";if(getAnalytics().identify({ethAddress:Yr}),getAnalytics().track(TrackingEvents.LOGIN_SUCCESS,{eth_address:Yr}),await wait(800),Dr[FeatureFlagsKeys.SIMPLIFIED_AVATAR_SETUP]&&Gr.account&&!await fetchProfile(Gr.account)){window.location.href="/auth/setup"+($r?`?redirectTo=${$r}`:"");return}$r?window.location.href=decodeURIComponent($r):window.location.href="/"}catch(Gr){console.log(Gr),pr("/login")}},[pr,$r,Dr]);return Mr===ConnectionModalState.WAITING_FOR_CONFIRMATION?jsxRuntimeExports.jsx(Modal$3.Modal,{size:"tiny",open:!0,children:jsxRuntimeExports.jsxs("div",{className:styles$3.container,children:[jsxRuntimeExports.jsx("h3",{className:styles$3.title,children:"Confirm your login"}),jsxRuntimeExports.jsxs("div",{className:styles$3.info,children:[jsxRuntimeExports.jsx("span",{children:"This step only verifies your identity."}),jsxRuntimeExports.jsx("span",{children:"No payments or transactions will occur without your explicit approval."})]}),jsxRuntimeExports.jsx(Button$5.Button,{primary:!0,onClick:jr,children:"Continue"})]})}):jsxRuntimeExports.jsx(ConnectionModal,{open:!0,state:Mr,onTryAgain:Br,providerType:dist$6.ProviderType.MAGIC})},Image1="https://cdn.decentraland.org/@dcl/auth-site/1.3.1-7743847636.commit-51766c3/assets/image1-a4aa795b.webp",Image10="https://cdn.decentraland.org/@dcl/auth-site/1.3.1-7743847636.commit-51766c3/assets/image10-c7fbcc61.webp",Image2="https://cdn.decentraland.org/@dcl/auth-site/1.3.1-7743847636.commit-51766c3/assets/image2-0af6ed59.webp",Image3="https://cdn.decentraland.org/@dcl/auth-site/1.3.1-7743847636.commit-51766c3/assets/image3-c864ad86.webp",Image4="https://cdn.decentraland.org/@dcl/auth-site/1.3.1-7743847636.commit-51766c3/assets/image4-7964be5f.webp",Image5="https://cdn.decentraland.org/@dcl/auth-site/1.3.1-7743847636.commit-51766c3/assets/image5-fcca517e.webp",Image6="https://cdn.decentraland.org/@dcl/auth-site/1.3.1-7743847636.commit-51766c3/assets/image6-c770bdf5.webp",Image7="https://cdn.decentraland.org/@dcl/auth-site/1.3.1-7743847636.commit-51766c3/assets/image7-341595c4.webp",Image8="https://cdn.decentraland.org/@dcl/auth-site/1.3.1-7743847636.commit-51766c3/assets/image8-fea9fe85.webp",Image9="https://cdn.decentraland.org/@dcl/auth-site/1.3.1-7743847636.commit-51766c3/assets/image9-714885ef.webp",main$2="_main_qwc0l_1",title="_title_qwc0l_11",infoModal$1="_infoModal_qwc0l_15",infoContent$1="_infoContent_qwc0l_19",info$1="_info_qwc0l_15",goBackButton$1="_goBackButton_qwc0l_33",styles$2={main:main$2,title,infoModal:infoModal$1,infoContent:infoContent$1,info:info$1,goBackButton:goBackButton$1},defaultProps$1={i18n:{title:"How does Magic work?",subtitle:"Magic handles digital wallet creation & management behind the scenes so you don't have to. Just log into Decentraland with your favorite social account and let Magic handle the rest.<br /> <br />If you'd rather take a more hands-on approach to your digital asset storage (e.g. Wearables, NAMEs, etc.), you can get a digital wallet from a provider such as <a href='https://metamask.io/'>MetaMask</a> and use it to create your Decentraland account.",goBack:"Return to log in page"}},MagicInformationModal=$r=>{const{i18n:pr=defaultProps$1.i18n,onClose:Mr,open:Nr}=$r;return jsxRuntimeExports.jsxs(Modal$3.Modal,{size:"tiny",open:Nr,className:styles$2.infoModal,onClose:Mr,children:[jsxRuntimeExports.jsx(ModalNavigation_2,{title:"",onClose:Mr}),jsxRuntimeExports.jsx(ModalContent,{className:styles$2.infoContent,children:jsxRuntimeExports.jsxs("div",{className:styles$2.main,children:[jsxRuntimeExports.jsx("h1",{className:styles$2.title,children:pr==null?void 0:pr.title}),jsxRuntimeExports.jsx("span",{className:styles$2.info,dangerouslySetInnerHTML:{__html:pr==null?void 0:pr.subtitle}}),jsxRuntimeExports.jsx(Button$5.Button,{className:styles$2.goBackButton,secondary:!0,inverted:!0,onClick:Mr,children:pr==null?void 0:pr.goBack})]})})]})},main$1="_main_1c8le_1",infoModal="_infoModal_1c8le_11",infoContent="_infoContent_1c8le_15",info="_info_1c8le_11",infoImage="_infoImage_1c8le_26",assets="_assets_1c8le_34",login="_login_1c8le_38",goBackButton="_goBackButton_1c8le_42",styles$1={main:main$1,infoModal,infoContent,info,infoImage,assets,login,goBackButton},defaultProps={i18n:{title:"What is a digital wallet?",assets:{title:"A Home For Your Digital Assets",text:"Wallets are used to send, receive, store, and display digital assets, such as your Decentraland Wearables, NAMEs, LANDs, etc."},logIn:{title:"A New Way To Log In",text:"Instead of creating new accounts and passwords on every website, in the world of Web3 all you need to do is just connect your digital wallet."},goBack:"Return to log in page"}},WalletInformationModal=$r=>{const{i18n:pr=defaultProps.i18n,onClose:Mr,open:Nr}=$r;return jsxRuntimeExports.jsxs(Modal$3.Modal,{size:"tiny",open:Nr,className:styles$1.infoModal,onClose:Mr,children:[jsxRuntimeExports.jsx(ModalNavigation_2,{title:"",onClose:Mr}),jsxRuntimeExports.jsx(ModalContent,{className:styles$1.infoContent,children:jsxRuntimeExports.jsxs("div",{className:styles$1.main,children:[jsxRuntimeExports.jsx("h1",{className:styles$1.title,children:pr==null?void 0:pr.title}),jsxRuntimeExports.jsxs("article",{className:styles$1.info,children:[jsxRuntimeExports.jsx("div",{className:classNames(styles$1.infoImage,styles$1.assets)}),jsxRuntimeExports.jsx("h3",{children:pr==null?void 0:pr.assets.title}),jsxRuntimeExports.jsx("p",{children:pr==null?void 0:pr.assets.text})]}),jsxRuntimeExports.jsxs("article",{className:styles$1.info,children:[jsxRuntimeExports.jsx("div",{className:classNames(styles$1.infoImage,styles$1.login)}),jsxRuntimeExports.jsx("h3",{children:pr==null?void 0:pr.logIn.title}),jsxRuntimeExports.jsx("p",{children:pr==null?void 0:pr.logIn.text})]}),jsxRuntimeExports.jsx(Button$5.Button,{className:styles$1.goBackButton,secondary:!0,inverted:!0,onClick:Mr,children:pr==null?void 0:pr.goBack})]})})]})},main="_main_1d9a9_1",background="_background_1d9a9_8",left="_left_1d9a9_32",leftInfo="_leftInfo_1d9a9_42",right="_right_1d9a9_51",footer="_footer_1d9a9_60",guestInfo="_guestInfo_1d9a9_79",styles={main,background,"move-background":"_move-background_1d9a9_1",left,leftInfo,right,footer,guestInfo},BACKGROUND_IMAGES=[Image1,Image2,Image3,Image4,Image5,Image6,Image7,Image8,Image9,Image10],LoginPage=()=>{usePageTracking();const[$r]=useSearchParams(),[pr,Mr]=reactExports.useState(ConnectionModalState.CONNECTING_WALLET),[Nr,Dr]=reactExports.useState(!1),[Br,Lr]=reactExports.useState(!1),[jr,Ur]=reactExports.useState(!1),[Gr,Yr]=reactExports.useState(),Qr=useAfterLoginRedirection(),Wn=Qr&&new URL(Qr).pathname.includes("/play"),[ga,eo]=reactExports.useState(0),{flags:_i}=reactExports.useContext(FeatureFlagsContext),va=reactExports.useCallback(po=>{const mo=po&&isSocialLogin(po);getAnalytics().track(TrackingEvents.CLICK,{action:ClickEvents.LEARN_MORE,type:mo?"Learn more about Magic":"Learn more about wallets"}),mo?Lr(!0):Dr(!0)},[Dr,Lr,Nr]),io=reactExports.useCallback(()=>{Dr(!1),Lr(!1)},[Dr,Lr]),no=reactExports.useCallback(()=>{Lr(!Br)},[Lr,Br]),so=reactExports.useCallback(async()=>{getAnalytics().track(TrackingEvents.LOGIN_CLICK,{type:"guest"}),await wait(800)},[]),ao=reactExports.useMemo(()=>{if(Qr){const po=new URL(Qr);return po.searchParams.append("guest","true"),po.toString()}return""},[Qr]),fo=reactExports.useCallback(async po=>{var $o;const mo=isSocialLogin(po);if(Yr(po),getAnalytics().track(TrackingEvents.LOGIN_CLICK,{method:po,type:mo?ConnectionType.WEB2:ConnectionType.WEB3}),mo)Mr(ConnectionModalState.LOADING_MAGIC),await wait(800),await connectToProvider(po);else try{Ur(!0),Mr(ConnectionModalState.CONNECTING_WALLET);const Xn=await connectToProvider(po);if(Mr(ConnectionModalState.WAITING_FOR_SIGNATURE),await getIdentitySignature((($o=Xn.account)==null?void 0:$o.toLowerCase())??"",Xn.provider),getAnalytics().track(TrackingEvents.LOGIN_SUCCESS,{eth_address:Xn.account}),getAnalytics().identify({ethAddress:Xn.account}),await wait(800),_i[FeatureFlagsKeys.SIMPLIFIED_AVATAR_SETUP]&&Xn.account&&!await fetchProfile(Xn.account)){window.location.href="/auth/setup"+(Qr?`?redirectTo=${Qr}`:""),Ur(!1);return}Qr?window.location.href=decodeURIComponent(Qr):window.location.href="/",Ur(!1)}catch(Xn){console.log("Error",JSON.stringify(Xn)),getAnalytics().track(TrackingEvents.LOGIN_ERROR,{error:isErrorWithMessage(Xn)?Xn.message:Xn}),Mr(ConnectionModalState.ERROR)}},[Mr,Ur,Yr,Qr,$r,_i]),lo=reactExports.useCallback(()=>{Ur(!1),Yr(void 0),Mr(ConnectionModalState.CONNECTING_WALLET)},[Ur]),oo=reactExports.useCallback(()=>{Gr&&fo(Gr)},[Gr]);return reactExports.useEffect(()=>{const po=setInterval(()=>{eo(mo=>mo===BACKGROUND_IMAGES.length-1?0:mo+1)},5e3);return()=>{clearInterval(po)}},[]),jsxRuntimeExports.jsxs("main",{className:styles.main,children:[jsxRuntimeExports.jsx("div",{className:styles.background,style:{backgroundImage:`url(${BACKGROUND_IMAGES[ga]})`}}),jsxRuntimeExports.jsx(WalletInformationModal,{open:Nr,onClose:io}),jsxRuntimeExports.jsx(MagicInformationModal,{open:Br,onClose:no}),jsxRuntimeExports.jsx(ConnectionModal,{open:jr,state:pr,onClose:lo,onTryAgain:oo,providerType:Gr?fromConnectionOptionToProviderType(Gr):null}),jsxRuntimeExports.jsx("div",{className:styles.left,children:jsxRuntimeExports.jsxs("div",{className:styles.leftInfo,children:[jsxRuntimeExports.jsx(Connection,{onLearnMore:va,onConnect:fo,loadingOption:Gr,socialOptions:{primary:ConnectionOptionType.GOOGLE,secondary:[ConnectionOptionType.DISCORD,ConnectionOptionType.APPLE,ConnectionOptionType.X]},web3Options:{primary:ConnectionOptionType.METAMASK,secondary:[ConnectionOptionType.FORTMATIC,ConnectionOptionType.COINBASE,ConnectionOptionType.WALLET_CONNECT]}}),Wn&&jsxRuntimeExports.jsxs("div",{className:styles.guestInfo,children:["Quick dive?"," ",jsxRuntimeExports.jsx("a",{href:ao,onClick:so,children:"Explore as a guest"})]})]})})]})};(function(){const $r=window.analytics=window.analytics||[];if(!$r.initialize){if($r.invoked){window.console&&console.error&&console.error("Segment snippet included twice.");return}$r.invoked=!0,$r.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","user","page","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware"],$r.factory=function(pr){return function(){const Mr=Array.prototype.slice.call(arguments);return Mr.unshift(pr),$r.push(Mr),$r}};for(let pr=0;pr<$r.methods.length;pr++){const Mr=$r.methods[pr];$r[Mr]=$r.factory(Mr)}$r.load=function(pr,Mr){const Nr=document.createElement("script");Nr.type="text/javascript",Nr.async=!0,Nr.src="https://cdn.segment.com/analytics.js/v1/"+pr+"/analytics.min.js";const Dr=document.getElementsByTagName("script")[0];Dr.parentNode.insertBefore(Nr,Dr),$r._loadOptions=Mr},$r.SNIPPET_VERSION="4.15.2"}})();const darkTheme="",index="";getAnalytics().load(config.get("SEGMENT_API_KEY"));ReactDOM.render(jsxRuntimeExports.jsx(React$5.StrictMode,{children:jsxRuntimeExports.jsx(FeatureFlagsProvider,{children:jsxRuntimeExports.jsx(BrowserRouter,{basename:"/auth",children:jsxRuntimeExports.jsxs(Routes,{children:[jsxRuntimeExports.jsx(Route,{path:"/login",element:jsxRuntimeExports.jsx(LoginPage,{})}),jsxRuntimeExports.jsx(Route,{path:"/callback",element:jsxRuntimeExports.jsx(CallbackPage,{})}),jsxRuntimeExports.jsx(Route,{path:"/requests/:requestId",element:jsxRuntimeExports.jsx(RequestPage,{})}),jsxRuntimeExports.jsx(Route,{path:"/setup",element:jsxRuntimeExports.jsx(SetupPage,{})}),jsxRuntimeExports.jsx(Route,{path:"*",element:jsxRuntimeExports.jsx(DefaultPage,{})})]})})})}),document.getElementById("root"));export{Buffer$G as B,R$5 as R,T$2 as T,__extends$3 as _,sha_jsExports as a,bnExports$4 as b,commonjsGlobal as c,require$$0$9 as d,eventsExports as e,getDefaultExportFromCjs$1 as f,getAugmentedNamespace as g,se$2 as h,a$1 as i,p$4 as j,ne$1 as n,oe$3 as o,process$1 as p,readableBrowserExports as r,sideChannel as s,te$3 as t,y$4 as y};
|
|
219
|
-
//# sourceMappingURL=index-
|
|
218
|
+
`),Fr=Xn[1].substring(19),Vr=Xn[2].substring(12),Wr=Date.parse(Vr);return{message:$o,ephemeralAddress:Fr,expiration:Wr}}$r.parseEmphemeralPayload=fo;async function lo(mo,$o,Xn,Fr){const Vr=Wn.createEIP1271MessageHash($o),Wr=(0,Br.hexToBytes)(Xn);let Jr;try{Jr=(0,Br.bytesToHex)(await mo.isValidSignature(Vr,Wr,Fr))}catch{}if(Jr===$r.ERC1654_MAGIC_VALUE)return!0;const Gn=(0,Yr.createEthereumMessageHash)($o);try{Jr=(0,Br.bytesToHex)(await mo.isValidSignature(Gn,Wr,Fr))}catch{}return Jr===$r.ERC1654_MAGIC_VALUE}$r.isValidEIP1271Signature=lo;async function oo(mo,$o,Xn,Fr,Vr){if(!mo)throw new Error("Missing provider");const Wr=new Br.default(mo),Jr=await(0,Lr.SignatureValidator)(Wr,$o);let Gn=await lo(Jr,Xn,Fr);if(Gn)return!0;const to=new Gr.default(Wr);try{const{block:ro}=await to.getDate(Vr,!1);if(Gn=await lo(Jr,Xn,Fr,ro),Gn)return!0}catch(ro){throw new Error(`Invalid validation. Error: ${ro.message}`)}throw new Error(`Invalid validation. Expected: ${$r.ERC1654_MAGIC_VALUE}. Actual: ${Gn}`)}function po(mo){switch(mo){case jr.AuthLinkType.SIGNER:return $r.SIGNER_VALIDATOR;case jr.AuthLinkType.ECDSA_PERSONAL_EPHEMERAL:return $r.ECDSA_PERSONAL_EPHEMERAL_VALIDATOR;case jr.AuthLinkType.ECDSA_PERSONAL_SIGNED_ENTITY:return $r.ECDSA_SIGNED_ENTITY_VALIDATOR;case jr.AuthLinkType.ECDSA_EIP_1654_EPHEMERAL:return $r.ECDSA_EIP_1654_EPHEMERAL_VALIDATOR;case jr.AuthLinkType.ECDSA_EIP_1654_SIGNED_ENTITY:return $r.EIP_1654_SIGNED_ENTITY_VALIDATOR;default:return no}}})(Authenticator);(function($r){var pr=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Nr,Dr,Br,Lr){Lr===void 0&&(Lr=Br);var jr=Object.getOwnPropertyDescriptor(Dr,Br);(!jr||("get"in jr?!Dr.__esModule:jr.writable||jr.configurable))&&(jr={enumerable:!0,get:function(){return Dr[Br]}}),Object.defineProperty(Nr,Lr,jr)}:function(Nr,Dr,Br,Lr){Lr===void 0&&(Lr=Br),Nr[Lr]=Dr[Br]}),Mr=commonjsGlobal&&commonjsGlobal.__exportStar||function(Nr,Dr){for(var Br in Nr)Br!=="default"&&!Object.prototype.hasOwnProperty.call(Dr,Br)&&pr(Dr,Nr,Br)};Object.defineProperty($r,"__esModule",{value:!0}),Mr(Authenticator,$r),Mr(types,$r)})(dist);async function resizeImage($r){return new Promise((Nr,Dr)=>{const Br=new Blob([$r],{type:"image/png"}),Lr=new Image;Lr.onload=()=>{const jr=document.createElement("canvas");jr.width=256,jr.height=256;const Ur=jr.getContext("2d");if(!Ur)return Dr(new Error("Failed to get canvas context"));Ur.drawImage(Lr,0,0,256,256),jr.toBlob(Gr=>{if(!Gr)return Dr(new Error("Failed to convert canvas to blob"));const Yr=new FileReader;Yr.onload=()=>Nr(Buffer$G.from(Yr.result)),Yr.onerror=()=>Dr(new Error("Failed to read blob as buffer")),Yr.readAsArrayBuffer(Gr)},"image/png")},Lr.onerror=()=>Dr(new Error("Failed to load image")),Lr.src=URL.createObjectURL(Br)})}async function subscribeToNewsletter($r){const pr=config.get("BUILDER_SERVER_URL");if(!pr)throw new Error("Missing BUILDER_SERVER_URL.");const Mr=await fetch(pr+"/v1/newsletter",{method:"post",body:JSON.stringify({email:$r,source:"auth"}),headers:{"content-type":"application/json"}});if(!Mr.ok)throw new Error(`Could not subscribe to newsletter. Status: ${Mr.status}`)}async function deployProfileFromDefault({defaultProfile:$r,connectedAccount:pr,deploymentProfileName:Mr,connectedAccountIdentity:Nr}){var so,ao;const Dr=config.get("PEER_URL",""),Br=dist$2.createContentClient({url:Dr+"/content",fetcher:dist$3.createFetchComponent()}),jr=(await Br.fetchEntitiesByPointers([$r]))[0],Ur=jr.id.startsWith("Qm"),Gr="body.png",Yr="face.png",Qr="face256.png",Wn=jr.content.reduce((fo,lo)=>({...fo,[lo.file]:lo.hash}),{}),ga=await Br.downloadContent(Wn[Gr]),eo=Ur?await resizeImage(await Br.downloadContent(Wn[Yr])):await Br.downloadContent(Wn[Qr]),_i=new Map;_i.set(Gr,ga),_i.set(Qr,eo);const va=fo=>fo.replace("dcl://base-avatars/","urn:decentraland:off-chain:base-avatars:"),io=(ao=(so=jr.metadata)==null?void 0:so.avatars)==null?void 0:ao[0];if(io.name=Mr,io.ethAddress=pr,io.userId=pr,io.version=1,io.tutorialStep=0,io.hasClaimedName=!1,io.hasConnectedWeb3=!0,io.avatar.bodyShape=va(jr.metadata.avatars[0].avatar.bodyShape),io.avatar.wearables=jr.metadata.avatars[0].avatar.wearables.map(va),io.avatar.emotes=[],Ur){const[fo,lo]=await Promise.all([distExports.hashV1(ga),distExports.hashV1(eo)]);io.avatar.snapshots={body:fo,face256:lo}}const no=await dist$2.DeploymentBuilder.buildEntity({type:dist$6.EntityType.PROFILE,pointers:[pr],metadata:{avatars:[io]},timestamp:Date.now(),files:_i});await Br.deploy({entityId:no.entityId,files:no.files,authChain:dist.Authenticator.signPayload(Nr,no.entityId)})}const container$1="_container_1bwr6_1",background$1="_background_1bwr6_9",left$1="_left_1bwr6_20",leftInner="_leftInner_1bwr6_48",logo="_logo_1bwr6_54",title$3="_title_1bwr6_59",subtitle$1="_subtitle_1bwr6_66",meetYourAvatar="_meetYourAvatar_1bwr6_72",meetYourAvatarDescription="_meetYourAvatarDescription_1bwr6_79",randomize="_randomize_1bwr6_86",logoSmall="_logoSmall_1bwr6_102",back="_back_1bwr6_9",name="_name_1bwr6_121",agree="_agree_1bwr6_125",error="_error_1bwr6_145",emailError="_emailError_1bwr6_156",agreeError="_agreeError_1bwr6_160",jumpIn="_jumpIn_1bwr6_166",right$1="_right_1bwr6_170",platform="_platform_1bwr6_187",mobileContainer="_mobileContainer_1bwr6_200",mobilePreviewContainer="_mobilePreviewContainer_1bwr6_213",mobileButtons="_mobileButtons_1bwr6_235",mobileCompleteYourProfile="_mobileCompleteYourProfile_1bwr6_260",styles$8={container:container$1,background:background$1,left:left$1,leftInner,logo,title:title$3,subtitle:subtitle$1,meetYourAvatar,meetYourAvatarDescription,randomize,continue:"_continue_1bwr6_97",logoSmall,back,name,agree,error,emailError,agreeError,jumpIn,right:right$1,platform,mobileContainer,mobilePreviewContainer,mobileButtons,mobileCompleteYourProfile};function getRandomDefaultProfile(){return"default"+(Math.floor(Math.random()*(160-1+1))+1)}const Error$1=$r=>jsxRuntimeExports.jsxs("div",{className:classNames(styles$8.error,$r.className),children:[jsxRuntimeExports.jsx("img",{src:wrongImg}),jsxRuntimeExports.jsx("div",{children:$r.message})]}),SetupPage=()=>{const[$r,pr]=reactExports.useState(!1),[Mr,Nr]=reactExports.useState(0),[Dr,Br]=reactExports.useState(getRandomDefaultProfile()),[Lr,jr]=reactExports.useState(""),[Ur,Gr]=reactExports.useState(""),[Yr,Qr]=reactExports.useState(!1),[Wn,ga]=reactExports.useState(!1),[eo,_i]=reactExports.useState(!1),va=reactExports.useRef(),io=reactExports.useRef(),{initialized:no,flags:so}=reactExports.useContext(FeatureFlagsContext),ao=useAfterLoginRedirection(),fo=reactExports.useMemo(()=>Lr.length?Lr.length>=15?"Sorry, usernames can have a maximum of 15 characters.":Lr.includes(" ")?"Sorry, spaces are not permitted.":/^[a-zA-Z0-9]+$/.test(Lr)?"":"Sorry, special characters (!@#$%) are not permitted.":"Please enter your username.",[Lr]),lo=reactExports.useMemo(()=>Ur&&!Ur.includes("@")?"Invalid email, please try again.":"",[Ur]),oo=reactExports.useMemo(()=>Yr?"":"Please accept the terms of use and privacy policy.",[Yr]),po=reactExports.useMemo(()=>{if(ao){if(ao.includes("play"))return"jump into decentraland";const Gn=["marketplace","builder","account","profile","events","places","governance","dao","rewards"];for(const to of Gn)if(ao.includes(to))return`continue to ${to}`}return"continue"},[ao]),mo=reactExports.useCallback(()=>{getAnalytics().track(TrackingEvents.CLICK,{action:ClickEvents.RANDOMIZE}),Br(getRandomDefaultProfile())},[]),$o=reactExports.useCallback(()=>{getAnalytics().track(TrackingEvents.AVATAR_EDIT_SUCCESS,{eth_address:va.current,is_guest:!1,profile:Dr}),Nr(1)},[Dr]),Xn=reactExports.useCallback(()=>{getAnalytics().track(TrackingEvents.CLICK,{action:ClickEvents.BACK_TO_AVATAR_RANDOMIZATION_VIEW}),Nr(0)},[]),Fr=reactExports.useCallback((Gn,to)=>jr(to.value),[]),Vr=reactExports.useCallback((Gn,to)=>Gr(to.value),[]),Wr=reactExports.useCallback(()=>Qr(!Yr),[Yr]),Jr=reactExports.useCallback(async Gn=>{if(Gn.preventDefault(),getAnalytics().track(TrackingEvents.CLICK,{action:ClickEvents.SUBMIT_PROFILE}),ga(!0),!(fo||lo||oo)){if(!va.current||!io.current){console.warn("No account or identity found.");return}try{if(_i(!0),await deployProfileFromDefault({connectedAccount:va.current,connectedAccountIdentity:io.current,defaultProfile:Dr,deploymentProfileName:Lr}),Ur)try{await subscribeToNewsletter(Ur)}catch(to){console.warn("There was an error subscribing to the newsletter",to.message)}getAnalytics().track(TrackingEvents.TERMS_OF_SERVICE_SUCCESS,{eth_address:va.current,is_guest:!1,email:Ur||void 0,name:Lr}),ao?window.location.href=decodeURIComponent(ao):window.location.href="/"}catch(to){_i(!1),console.error("There was an error deploying the profile",to.message)}}},[fo,lo,oo,Lr,Ur,Yr,Dr,ao]);return reactExports.useEffect(()=>{(async()=>{const Gn=()=>{window.location.href="/auth/login"};try{await dist$7.connection.tryPreviousConnection()}catch{console.warn("No previous connection found"),Gn();return}const ro=await(await dist$7.connection.getProvider()).request({method:"eth_accounts"});if(!ro.length){console.warn("No accounts found"),Gn();return}const Un=ro[0];if(va.current=Un,await fetchProfile(Un)){console.warn("Profile already exists"),ao?window.location.href=decodeURIComponent(ao):window.location.href="/";return}const Xr=dist$4.localStorageGetIdentity(Un);if(!Xr){console.warn("No identity found for the connected account"),Gn();return}io.current=Xr,pr(!0)})()},[ao]),!$r||!no?jsxRuntimeExports.jsxs("div",{className:styles$8.container,children:[jsxRuntimeExports.jsx("div",{className:styles$8.background}),jsxRuntimeExports.jsx(Loader_3,{active:!0,size:"huge"})]}):so[FeatureFlagsKeys.SIMPLIFIED_AVATAR_SETUP]?Mr===0?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Mobile_1,{children:jsxRuntimeExports.jsxs("div",{className:styles$8.container,children:[jsxRuntimeExports.jsx("div",{className:styles$8.background}),jsxRuntimeExports.jsxs("div",{className:styles$8.mobileContainer,children:[jsxRuntimeExports.jsx("img",{className:styles$8.logo,src:logoSrc,alt:"logo"}),jsxRuntimeExports.jsx("div",{className:styles$8.title,children:"Welcome to Decentraland!"}),jsxRuntimeExports.jsx("div",{className:styles$8.meetYourAvatar,children:"First, Meet Your Avatar"}),jsxRuntimeExports.jsxs("div",{className:styles$8.meetYourAvatarDescription,children:["Choose an avatar to start your journey.",jsxRuntimeExports.jsx("br",{}),jsxRuntimeExports.jsx("b",{children:"You can customize it later on desktop"}),", where all the magic happens!"]}),jsxRuntimeExports.jsxs("div",{className:styles$8.mobilePreviewContainer,children:[jsxRuntimeExports.jsx(WearablePreview_2,{lockBeta:!0,panning:!1,disableBackground:!0,profile:Dr,dev:!1,emote:dist$6.PreviewEmote.WAVE,disableAutoRotate:!0}),jsxRuntimeExports.jsx(Loader_3,{active:!0}),jsxRuntimeExports.jsx("img",{className:styles$8.platform,src:platformImg,alt:"platform"})]}),jsxRuntimeExports.jsxs("div",{className:styles$8.mobileButtons,children:[jsxRuntimeExports.jsx("div",{className:styles$8.randomize,children:jsxRuntimeExports.jsxs(Button$5.Button,{compact:!0,inverted:!0,onClick:mo,children:[jsxRuntimeExports.jsx("img",{src:diceImg,alt:"diceImg"}),jsxRuntimeExports.jsx("span",{children:"randomize"})]})}),jsxRuntimeExports.jsx("div",{className:styles$8.continue,children:jsxRuntimeExports.jsx(Button$5.Button,{compact:!0,primary:!0,onClick:$o,children:"Continue"})})]})]})]})}),jsxRuntimeExports.jsx(NotMobile_1,{children:jsxRuntimeExports.jsxs("div",{className:styles$8.container,children:[jsxRuntimeExports.jsx("div",{className:styles$8.background}),jsxRuntimeExports.jsx("div",{className:styles$8.left,children:jsxRuntimeExports.jsxs("div",{className:styles$8.leftInner,children:[jsxRuntimeExports.jsx("img",{className:styles$8.logo,src:logoSrc,alt:"logo"}),jsxRuntimeExports.jsx("div",{className:styles$8.title,children:"Welcome to Decentraland!"}),jsxRuntimeExports.jsx("div",{className:styles$8.subtitle,children:"Your journey begins here"}),jsxRuntimeExports.jsx("div",{className:styles$8.meetYourAvatar,children:"First, Meet Your Avatar"}),jsxRuntimeExports.jsxs("div",{className:styles$8.meetYourAvatarDescription,children:["Say hi to your new digital self!",jsxRuntimeExports.jsx("br",{}),"Don't worry, of course they're not quite 'you' yet—soon you'll be able to customize them to your heart's content."]}),jsxRuntimeExports.jsx("div",{className:styles$8.randomize,children:jsxRuntimeExports.jsxs(Button$5.Button,{compact:!0,inverted:!0,onClick:mo,children:[jsxRuntimeExports.jsx("img",{src:diceImg,alt:"diceImg"}),jsxRuntimeExports.jsx("span",{children:"randomize"})]})}),jsxRuntimeExports.jsx("div",{className:styles$8.continue,children:jsxRuntimeExports.jsx(Button$5.Button,{primary:!0,fluid:!0,onClick:$o,children:"Continue"})})]})}),jsxRuntimeExports.jsxs("div",{className:styles$8.right,children:[jsxRuntimeExports.jsx(WearablePreview_2,{lockBeta:!0,panning:!1,disableBackground:!0,profile:Dr,dev:!1,emote:dist$6.PreviewEmote.WAVE,disableAutoRotate:!0}),jsxRuntimeExports.jsx(Loader_3,{active:!0,size:"huge"}),jsxRuntimeExports.jsx("img",{className:styles$8.platform,src:platformImg,alt:"platform"})]})]})})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Mobile_1,{children:jsxRuntimeExports.jsxs("div",{className:styles$8.container,children:[jsxRuntimeExports.jsx("div",{className:styles$8.background}),jsxRuntimeExports.jsxs("div",{className:styles$8.mobileContainer,children:[jsxRuntimeExports.jsxs("div",{className:styles$8.back,onClick:Xn,children:[jsxRuntimeExports.jsx("img",{src:backImg,alt:"backImg"}),jsxRuntimeExports.jsx("span",{children:"BACK"})]}),jsxRuntimeExports.jsx("div",{className:classNames(styles$8.title,styles$8.mobileCompleteYourProfile),children:"Complete your Profile"}),jsxRuntimeExports.jsxs("form",{onSubmit:Jr,children:[jsxRuntimeExports.jsx("div",{className:styles$8.name,children:jsxRuntimeExports.jsx(Field_2,{label:"Username",placeholder:"Enter your Username",onChange:Fr,message:Wn&&fo?jsxRuntimeExports.jsx(Error$1,{message:fo}):void 0})}),jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(Field_2,{label:"Email (optional)",placeholder:"Enter your email",message:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Wn&&lo?jsxRuntimeExports.jsx(Error$1,{className:styles$8.emailError,message:lo}):null,jsxRuntimeExports.jsx("span",{children:"Subscribe to Decentraland's newsletter to receive the latest news about events, updates, contests and more."})]}),onChange:Vr})}),jsxRuntimeExports.jsxs("div",{className:styles$8.agree,children:[jsxRuntimeExports.jsx(Checkbox$4.Checkbox,{onChange:Wr}),jsxRuntimeExports.jsxs("div",{children:["I agree with Decentraland's ",jsxRuntimeExports.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:"https://decentraland.org/terms/",children:"Terms of use"})," and ",jsxRuntimeExports.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:"https://decentraland.org/privacy",children:"Privacy policy"}),"."]})]}),Wn&&oo?jsxRuntimeExports.jsx(Error$1,{className:styles$8.agreeError,message:oo}):null,jsxRuntimeExports.jsx("div",{className:styles$8.jumpIn,children:jsxRuntimeExports.jsx(Button$5.Button,{primary:!0,fluid:!0,type:"submit",disabled:!Yr||eo,loading:eo,children:po})})]})]})]})}),jsxRuntimeExports.jsx(NotMobile_1,{children:jsxRuntimeExports.jsxs("div",{className:styles$8.container,children:[jsxRuntimeExports.jsx("div",{className:styles$8.background}),jsxRuntimeExports.jsx("div",{className:styles$8.left,children:jsxRuntimeExports.jsxs("div",{className:styles$8.leftInner,children:[jsxRuntimeExports.jsx("img",{className:styles$8.logoSmall,src:logoSrc,alt:"logo"}),jsxRuntimeExports.jsxs("div",{className:styles$8.back,onClick:Xn,children:[jsxRuntimeExports.jsx("img",{src:backImg,alt:"backImg"}),jsxRuntimeExports.jsx("span",{children:"BACK"})]}),jsxRuntimeExports.jsx("div",{className:styles$8.title,children:"Complete your Profile"}),jsxRuntimeExports.jsxs("form",{onSubmit:Jr,children:[jsxRuntimeExports.jsx("div",{className:styles$8.name,children:jsxRuntimeExports.jsx(Field_2,{label:"Username",placeholder:"Enter your username",onChange:Fr,message:Wn&&fo?jsxRuntimeExports.jsx(Error$1,{message:fo}):void 0})}),jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(Field_2,{label:"Email (optional)",placeholder:"Enter your email",message:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Wn&&lo?jsxRuntimeExports.jsx(Error$1,{className:styles$8.emailError,message:lo}):null,jsxRuntimeExports.jsx("span",{children:"Subscribe to Decentraland's newsletter to receive the latest news about events, updates, contests and more."})]}),onChange:Vr})}),jsxRuntimeExports.jsxs("div",{className:styles$8.agree,children:[jsxRuntimeExports.jsx(Checkbox$4.Checkbox,{onChange:Wr}),"I agree with Decentraland's ",jsxRuntimeExports.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:"https://decentraland.org/terms/",children:"Terms of use"})," and ",jsxRuntimeExports.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:"https://decentraland.org/privacy",children:"Privacy policy"}),"."]}),Wn&&oo?jsxRuntimeExports.jsx(Error$1,{className:styles$8.agreeError,message:oo}):null,jsxRuntimeExports.jsx("div",{className:styles$8.jumpIn,children:jsxRuntimeExports.jsx(Button$5.Button,{primary:!0,fluid:!0,type:"submit",disabled:!Yr||eo,loading:eo,children:po})})]})]})}),jsxRuntimeExports.jsxs("div",{className:styles$8.right,children:[jsxRuntimeExports.jsx(WearablePreview_2,{lockBeta:!0,panning:!1,disableBackground:!0,profile:Dr,dev:!1,emote:dist$6.PreviewEmote.WAVE,disableAutoRotate:!0}),jsxRuntimeExports.jsx(Loader_3,{active:!0,size:"huge"}),jsxRuntimeExports.jsx("img",{className:styles$8.platform,src:platformImg,alt:"platform"})]})]})})]}):(window.location.href="/",null)},main$4="_main_qbssu_1",styles$7={main:main$4},DefaultPage=()=>{const $r=useNavigate(),pr=useLocation(),Mr=reactExports.useCallback(async()=>{try{const Nr=await dist$7.connection.tryPreviousConnection();return!!(Nr.account&&Nr.provider)}catch{return!1}},[]);return reactExports.useEffect(()=>{Mr().then(Nr=>{Nr?window.location.href="/":$r({pathname:"/login",search:pr.search})})},[Mr,$r]),jsxRuntimeExports.jsx("div",{className:styles$7.main,children:jsxRuntimeExports.jsx(Loader_3,{active:!0,size:"huge"})})};var Modal$3={},Modal$2={},_arrayReduce,hasRequired_arrayReduce;function require_arrayReduce(){if(hasRequired_arrayReduce)return _arrayReduce;hasRequired_arrayReduce=1;function $r(pr,Mr,Nr,Dr){var Br=-1,Lr=pr==null?0:pr.length;for(Dr&&Lr&&(Nr=pr[++Br]);++Br<Lr;)Nr=Mr(Nr,pr[Br],Br,pr);return Nr}return _arrayReduce=$r,_arrayReduce}var _baseReduce,hasRequired_baseReduce;function require_baseReduce(){if(hasRequired_baseReduce)return _baseReduce;hasRequired_baseReduce=1;function $r(pr,Mr,Nr,Dr,Br){return Br(pr,function(Lr,jr,Ur){Nr=Dr?(Dr=!1,Lr):Mr(Nr,Lr,jr,Ur)}),Nr}return _baseReduce=$r,_baseReduce}var reduce_1,hasRequiredReduce;function requireReduce(){if(hasRequiredReduce)return reduce_1;hasRequiredReduce=1;var $r=require_arrayReduce(),pr=require_baseEach(),Mr=require_baseIteratee(),Nr=require_baseReduce(),Dr=requireIsArray();function Br(Lr,jr,Ur){var Gr=Dr(Lr)?$r:Nr,Yr=arguments.length<3;return Gr(Lr,Mr(jr,4),Ur,Yr,pr)}return reduce_1=Br,reduce_1}var ModalActions={},hasRequiredModalActions;function requireModalActions(){if(hasRequiredModalActions)return ModalActions;hasRequiredModalActions=1;var $r=interopRequireWildcardExports,pr=interopRequireDefaultExports;ModalActions.__esModule=!0,ModalActions.default=void 0;var Mr=pr(require_extends()),Nr=pr(requireInheritsLoose()),Dr=pr(requireMap()),Br=pr(requireInvoke()),Lr=pr(require$$0$9);pr(requirePropTypes());var jr=$r(reactExports),Ur=requireLib(),Gr=pr(requireButton()),Yr=function(Qr){(0,Nr.default)(Wn,Qr);function Wn(){for(var eo,_i=arguments.length,va=new Array(_i),io=0;io<_i;io++)va[io]=arguments[io];return eo=Qr.call.apply(Qr,[this].concat(va))||this,eo.handleButtonOverrides=function(no){return{onClick:function(ao,fo){(0,Br.default)(no,"onClick",ao,fo),(0,Br.default)(eo.props,"onActionClick",ao,fo)}}},eo}var ga=Wn.prototype;return ga.render=function(){var _i=this,va=this.props,io=va.actions,no=va.children,so=va.className,ao=va.content,fo=(0,Lr.default)("actions",so),lo=(0,Ur.getUnhandledProps)(Wn,this.props),oo=(0,Ur.getElementType)(Wn,this.props);return Ur.childrenUtils.isNil(no)?Ur.childrenUtils.isNil(ao)?jr.default.createElement(oo,(0,Mr.default)({},lo,{className:fo}),(0,Dr.default)(io,function(po){return Gr.default.create(po,{overrideProps:_i.handleButtonOverrides})})):jr.default.createElement(oo,(0,Mr.default)({},lo,{className:fo}),ao):jr.default.createElement(oo,(0,Mr.default)({},lo,{className:fo}),no)},Wn}(jr.Component);return ModalActions.default=Yr,Yr.handledProps=["actions","as","children","className","content","onActionClick"],Yr.propTypes={},Yr.create=(0,Ur.createShorthandFactory)(Yr,function(Qr){return{actions:Qr}}),ModalActions}var ModalContent$1={},hasRequiredModalContent;function requireModalContent(){if(hasRequiredModalContent)return ModalContent$1;hasRequiredModalContent=1;var $r=interopRequireDefaultExports;ModalContent$1.__esModule=!0,ModalContent$1.default=void 0;var pr=$r(require_extends()),Mr=$r(require$$0$9);$r(requirePropTypes());var Nr=$r(reactExports),Dr=requireLib();function Br(jr){var Ur=jr.children,Gr=jr.className,Yr=jr.content,Qr=jr.image,Wn=jr.scrolling,ga=(0,Mr.default)(Gr,(0,Dr.useKeyOnly)(Qr,"image"),(0,Dr.useKeyOnly)(Wn,"scrolling"),"content"),eo=(0,Dr.getUnhandledProps)(Br,jr),_i=(0,Dr.getElementType)(Br,jr);return Nr.default.createElement(_i,(0,pr.default)({},eo,{className:ga}),Dr.childrenUtils.isNil(Ur)?Yr:Ur)}Br.handledProps=["as","children","className","content","image","scrolling"],Br.propTypes={},Br.create=(0,Dr.createShorthandFactory)(Br,function(jr){return{content:jr}});var Lr=Br;return ModalContent$1.default=Lr,ModalContent$1}var ModalDescription={},hasRequiredModalDescription;function requireModalDescription(){if(hasRequiredModalDescription)return ModalDescription;hasRequiredModalDescription=1;var $r=interopRequireDefaultExports;ModalDescription.__esModule=!0,ModalDescription.default=void 0;var pr=$r(require_extends()),Mr=$r(require$$0$9);$r(requirePropTypes());var Nr=$r(reactExports),Dr=requireLib();function Br(jr){var Ur=jr.children,Gr=jr.className,Yr=jr.content,Qr=(0,Mr.default)("description",Gr),Wn=(0,Dr.getUnhandledProps)(Br,jr),ga=(0,Dr.getElementType)(Br,jr);return Nr.default.createElement(ga,(0,pr.default)({},Wn,{className:Qr}),Dr.childrenUtils.isNil(Ur)?Yr:Ur)}Br.handledProps=["as","children","className","content"],Br.propTypes={};var Lr=Br;return ModalDescription.default=Lr,ModalDescription}var ModalDimmer={},hasRequiredModalDimmer;function requireModalDimmer(){if(hasRequiredModalDimmer)return ModalDimmer;hasRequiredModalDimmer=1;var $r=interopRequireDefaultExports;ModalDimmer.__esModule=!0,ModalDimmer.default=void 0;var pr=$r(require_extends()),Mr=require$$4$2,Nr=$r(require$$0$9);$r(requirePropTypes());var Dr=$r(reactExports),Br=requireLib();function Lr(Ur){var Gr=Ur.blurring,Yr=Ur.children,Qr=Ur.className,Wn=Ur.centered,ga=Ur.content,eo=Ur.inverted,_i=Ur.mountNode,va=Ur.scrolling,io=Dr.default.useRef(),no=(0,Nr.default)("ui",(0,Br.useKeyOnly)(eo,"inverted"),(0,Br.useKeyOnly)(!Wn,"top aligned"),"page modals dimmer transition visible active",Qr),so=(0,Nr.default)("dimmable dimmed",(0,Br.useKeyOnly)(Gr,"blurring"),(0,Br.useKeyOnly)(va,"scrolling")),ao=(0,Br.getUnhandledProps)(Lr,Ur),fo=(0,Br.getElementType)(Lr,Ur);return(0,Br.useClassNamesOnNode)(_i,so),Dr.default.useEffect(function(){io.current&&io.current.style&&io.current.style.setProperty("display","flex","important")},[]),Dr.default.createElement(Mr.Ref,{innerRef:io},Dr.default.createElement(fo,(0,pr.default)({},ao,{className:no}),Br.childrenUtils.isNil(Yr)?ga:Yr))}Lr.handledProps=["as","blurring","centered","children","className","content","inverted","mountNode","scrolling"],Lr.propTypes={},Lr.create=(0,Br.createShorthandFactory)(Lr,function(Ur){return{content:Ur}});var jr=Lr;return ModalDimmer.default=jr,ModalDimmer}var ModalHeader={},hasRequiredModalHeader;function requireModalHeader(){if(hasRequiredModalHeader)return ModalHeader;hasRequiredModalHeader=1;var $r=interopRequireDefaultExports;ModalHeader.__esModule=!0,ModalHeader.default=void 0;var pr=$r(require_extends()),Mr=$r(require$$0$9);$r(requirePropTypes());var Nr=$r(reactExports),Dr=requireLib();function Br(jr){var Ur=jr.children,Gr=jr.className,Yr=jr.content,Qr=(0,Mr.default)("header",Gr),Wn=(0,Dr.getUnhandledProps)(Br,jr),ga=(0,Dr.getElementType)(Br,jr);return Nr.default.createElement(ga,(0,pr.default)({},Wn,{className:Qr}),Dr.childrenUtils.isNil(Ur)?Yr:Ur)}Br.handledProps=["as","children","className","content"],Br.propTypes={},Br.create=(0,Dr.createShorthandFactory)(Br,function(jr){return{content:jr}});var Lr=Br;return ModalHeader.default=Lr,ModalHeader}var utils={},hasRequiredUtils;function requireUtils(){if(hasRequiredUtils)return utils;hasRequiredUtils=1,utils.__esModule=!0,utils.isLegacy=utils.getLegacyStyles=utils.canFit=void 0;var $r=0,pr=50,Mr=function(Lr){var jr=Lr.height+$r,Ur=Lr.height+$r,Gr=window.innerHeight,Yr=Gr/2,Qr=-(Ur/2),Wn=pr,ga=Yr+Qr;return ga+jr+Wn<Gr};utils.canFit=Mr;var Nr=function(Lr,jr,Ur){var Gr=jr&&Lr?-(Ur.height/2):0,Yr=-(Ur.width/2);return{marginLeft:Yr,marginTop:Gr}};utils.getLegacyStyles=Nr;var Dr=function(){return!window.ActiveXObject&&"ActiveXObject"in window};return utils.isLegacy=Dr,utils}var _interopRequireWildcard=interopRequireWildcardExports,_interopRequireDefault$1=interopRequireDefaultExports;Modal$2.__esModule=!0;Modal$2.default=void 0;var _extends2=_interopRequireDefault$1(require_extends()),_inheritsLoose2=_interopRequireDefault$1(requireInheritsLoose()),_isPlainObject2=_interopRequireDefault$1(requireIsPlainObject()),_pick2=_interopRequireDefault$1(requirePick()),_includes2=_interopRequireDefault$1(requireIncludes()),_reduce2=_interopRequireDefault$1(requireReduce()),_isEmpty2=_interopRequireDefault$1(requireIsEmpty()),_invoke2=_interopRequireDefault$1(requireInvoke()),_reactComponentRef=require$$4$2,_clsx=_interopRequireDefault$1(require$$0$9);_interopRequireDefault$1(requirePropTypes());var _react=_interopRequireWildcard(reactExports),_shallowequal=_interopRequireDefault$1(requireShallowequal()),_lib=requireLib(),_Icon=_interopRequireDefault$1(requireIcon()),_Portal=_interopRequireDefault$1(requirePortal()),_ModalActions=_interopRequireDefault$1(requireModalActions()),_ModalContent=_interopRequireDefault$1(requireModalContent()),_ModalDescription=_interopRequireDefault$1(requireModalDescription()),_ModalDimmer=_interopRequireDefault$1(requireModalDimmer()),_ModalHeader=_interopRequireDefault$1(requireModalHeader()),_utils=requireUtils(),Modal$1=function($r){(0,_inheritsLoose2.default)(pr,$r);function pr(){for(var Nr,Dr=arguments.length,Br=new Array(Dr),Lr=0;Lr<Dr;Lr++)Br[Lr]=arguments[Lr];return Nr=$r.call.apply($r,[this].concat(Br))||this,Nr.legacy=(0,_lib.isBrowser)()&&(0,_utils.isLegacy)(),Nr.ref=(0,_react.createRef)(),Nr.dimmerRef=(0,_react.createRef)(),Nr.latestDocumentMouseDownEvent=null,Nr.getMountNode=function(){return(0,_lib.isBrowser)()?Nr.props.mountNode||document.body:null},Nr.handleActionsOverrides=function(jr){return{onActionClick:function(Gr,Yr){(0,_invoke2.default)(jr,"onActionClick",Gr,Yr),(0,_invoke2.default)(Nr.props,"onActionClick",Gr,Nr.props),Nr.handleClose(Gr)}}},Nr.handleClose=function(jr){Nr.setState({open:!1}),(0,_invoke2.default)(Nr.props,"onClose",jr,(0,_extends2.default)({},Nr.props,{open:!1}))},Nr.handleDocumentMouseDown=function(jr){Nr.latestDocumentMouseDownEvent=jr},Nr.handleDocumentClick=function(jr){var Ur=Nr.props.closeOnDimmerClick,Gr=Nr.latestDocumentMouseDownEvent;Nr.latestDocumentMouseDownEvent=null,!(!Ur||(0,_lib.doesNodeContainClick)(Nr.ref.current,Gr)||(0,_lib.doesNodeContainClick)(Nr.ref.current,jr))&&(Nr.setState({open:!1}),(0,_invoke2.default)(Nr.props,"onClose",jr,(0,_extends2.default)({},Nr.props,{open:!1})))},Nr.handleIconOverrides=function(jr){return{onClick:function(Gr){(0,_invoke2.default)(jr,"onClick",Gr),Nr.handleClose(Gr)}}},Nr.handleOpen=function(jr){(0,_invoke2.default)(Nr.props,"onOpen",jr,(0,_extends2.default)({},Nr.props,{open:!0})),Nr.setState({open:!0})},Nr.handlePortalMount=function(jr){var Ur=Nr.props.eventPool;Nr.setState({scrolling:!1}),Nr.setPositionAndClassNames(),_lib.eventStack.sub("mousedown",Nr.handleDocumentMouseDown,{pool:Ur,target:Nr.dimmerRef.current}),_lib.eventStack.sub("click",Nr.handleDocumentClick,{pool:Ur,target:Nr.dimmerRef.current}),(0,_invoke2.default)(Nr.props,"onMount",jr,Nr.props)},Nr.handlePortalUnmount=function(jr){var Ur=Nr.props.eventPool;cancelAnimationFrame(Nr.animationRequestId),_lib.eventStack.unsub("mousedown",Nr.handleDocumentMouseDown,{pool:Ur,target:Nr.dimmerRef.current}),_lib.eventStack.unsub("click",Nr.handleDocumentClick,{pool:Ur,target:Nr.dimmerRef.current}),(0,_invoke2.default)(Nr.props,"onUnmount",jr,Nr.props)},Nr.setPositionAndClassNames=function(){var jr=Nr.props.centered,Ur,Gr={};if(Nr.ref.current){var Yr=Nr.ref.current.getBoundingClientRect(),Qr=(0,_utils.canFit)(Yr);Ur=!Qr;var Wn=Nr.legacy?(0,_utils.getLegacyStyles)(Qr,jr,Yr):{};(0,_shallowequal.default)(Nr.state.legacyStyles,Wn)||(Gr.legacyStyles=Wn),Nr.state.scrolling!==Ur&&(Gr.scrolling=Ur)}(0,_isEmpty2.default)(Gr)||Nr.setState(Gr),Nr.animationRequestId=requestAnimationFrame(Nr.setPositionAndClassNames)},Nr.renderContent=function(jr){var Ur=Nr.props,Gr=Ur.actions,Yr=Ur.basic,Qr=Ur.children,Wn=Ur.className,ga=Ur.closeIcon,eo=Ur.content,_i=Ur.header,va=Ur.size,io=Ur.style,no=Nr.state,so=no.legacyStyles,ao=no.scrolling,fo=(0,_clsx.default)("ui",va,(0,_lib.useKeyOnly)(Yr,"basic"),(0,_lib.useKeyOnly)(Nr.legacy,"legacy"),(0,_lib.useKeyOnly)(ao,"scrolling"),"modal transition visible active",Wn),lo=(0,_lib.getElementType)(pr,Nr.props),oo=ga===!0?"close":ga,po=_Icon.default.create(oo,{overrideProps:Nr.handleIconOverrides});return _react.default.createElement(_reactComponentRef.Ref,{innerRef:Nr.ref},_react.default.createElement(lo,(0,_extends2.default)({},jr,{className:fo,style:(0,_extends2.default)({},so,io)}),po,_lib.childrenUtils.isNil(Qr)?_react.default.createElement(_react.default.Fragment,null,_ModalHeader.default.create(_i,{autoGenerateKey:!1}),_ModalContent.default.create(eo,{autoGenerateKey:!1}),_ModalActions.default.create(Gr,{overrideProps:Nr.handleActionsOverrides})):Qr))},Nr}var Mr=pr.prototype;return Mr.componentWillUnmount=function(){this.handlePortalUnmount()},Mr.render=function(){var Dr=this.props,Br=Dr.centered,Lr=Dr.closeOnDocumentClick,jr=Dr.dimmer,Ur=Dr.eventPool,Gr=Dr.trigger,Yr=this.state,Qr=Yr.open,Wn=Yr.scrolling,ga=this.getMountNode();if(!(0,_lib.isBrowser)())return(0,_react.isValidElement)(Gr)?Gr:null;var eo=(0,_lib.getUnhandledProps)(pr,this.props),_i=_Portal.default.handledProps,va=(0,_reduce2.default)(eo,function(no,so,ao){return(0,_includes2.default)(_i,ao)||(no[ao]=so),no},{}),io=(0,_pick2.default)(eo,_i);return _react.default.createElement(_Portal.default,(0,_extends2.default)({closeOnDocumentClick:Lr},io,{trigger:Gr,eventPool:Ur,mountNode:ga,open:Qr,onClose:this.handleClose,onMount:this.handlePortalMount,onOpen:this.handleOpen,onUnmount:this.handlePortalUnmount}),_react.default.createElement(_reactComponentRef.Ref,{innerRef:this.dimmerRef},_ModalDimmer.default.create((0,_isPlainObject2.default)(jr)?jr:{},{autoGenerateKey:!1,defaultProps:{blurring:jr==="blurring",inverted:jr==="inverted"},overrideProps:{children:this.renderContent(va),centered:Br,mountNode:ga,scrolling:Wn}})))},pr}(_lib.ModernAutoControlledComponent);Modal$1.handledProps=["actions","as","basic","centered","children","className","closeIcon","closeOnDimmerClick","closeOnDocumentClick","content","defaultOpen","dimmer","eventPool","header","mountNode","onActionClick","onClose","onMount","onOpen","onUnmount","open","size","style","trigger"];Modal$1.propTypes={};Modal$1.defaultProps={centered:!0,dimmer:!0,closeOnDimmerClick:!0,closeOnDocumentClick:!1,eventPool:"Modal"};Modal$1.autoControlledProps=["open"];Modal$1.Actions=_ModalActions.default;Modal$1.Content=_ModalContent.default;Modal$1.Description=_ModalDescription.default;Modal$1.Dimmer=_ModalDimmer.default;Modal$1.Header=_ModalHeader.default;var _default$1=Modal$1;Modal$2.default=_default$1;const Modal="";(function($r){var pr=commonjsGlobal&&commonjsGlobal.__importDefault||function(Nr){return Nr&&Nr.__esModule?Nr:{default:Nr}};Object.defineProperty($r,"__esModule",{value:!0}),$r.Modal=void 0;var Mr=Modal$2;Object.defineProperty($r,"Modal",{enumerable:!0,get:function(){return pr(Mr).default}})})(Modal$3);const wait=$r=>new Promise(pr=>setTimeout(pr,$r));var ModalContentExports=requireModalContent();const ModalContent=getDefaultExportFromCjs$1(ModalContentExports);var ModalNavigation$2={};const ModalNavigation$1="";var __extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var $r=function(pr,Mr){return $r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Nr,Dr){Nr.__proto__=Dr}||function(Nr,Dr){for(var Br in Dr)Object.prototype.hasOwnProperty.call(Dr,Br)&&(Nr[Br]=Dr[Br])},$r(pr,Mr)};return function(pr,Mr){if(typeof Mr!="function"&&Mr!==null)throw new TypeError("Class extends value "+String(Mr)+" is not a constructor or null");$r(pr,Mr);function Nr(){this.constructor=pr}pr.prototype=Mr===null?Object.create(Mr):(Nr.prototype=Mr.prototype,new Nr)}}(),__createBinding=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function($r,pr,Mr,Nr){Nr===void 0&&(Nr=Mr);var Dr=Object.getOwnPropertyDescriptor(pr,Mr);(!Dr||("get"in Dr?!pr.__esModule:Dr.writable||Dr.configurable))&&(Dr={enumerable:!0,get:function(){return pr[Mr]}}),Object.defineProperty($r,Nr,Dr)}:function($r,pr,Mr,Nr){Nr===void 0&&(Nr=Mr),$r[Nr]=pr[Mr]}),__setModuleDefault=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function($r,pr){Object.defineProperty($r,"default",{enumerable:!0,value:pr})}:function($r,pr){$r.default=pr}),__importStar=commonjsGlobal&&commonjsGlobal.__importStar||function($r){if($r&&$r.__esModule)return $r;var pr={};if($r!=null)for(var Mr in $r)Mr!=="default"&&Object.prototype.hasOwnProperty.call($r,Mr)&&__createBinding(pr,$r,Mr);return __setModuleDefault(pr,$r),pr};Object.defineProperty(ModalNavigation$2,"__esModule",{value:!0});var ModalNavigation_2=ModalNavigation$2.ModalNavigation=void 0,React=__importStar(reactExports),ModalNavigation=function($r){__extends(pr,$r);function pr(){return $r!==null&&$r.apply(this,arguments)||this}return pr.prototype.render=function(){var Mr=this.props,Nr=Mr.title,Dr=Mr.subtitle,Br=Mr.onBack,Lr=Mr.onClose,jr=Mr.onInfo;return React.createElement("div",{className:"dcl modal-navigation"},React.createElement("div",{className:"dcl modal-navigation-title"},Nr),Dr&&React.createElement("div",{className:"dcl modal-navigation-subtitle"},Dr),Br&&React.createElement("div",{className:"dcl modal-navigation-button modal-navigation-back",onClick:Br}),jr&&React.createElement("div",{className:"dcl modal-navigation-button modal-navigation-info",onClick:jr}),Lr&&React.createElement("div",{className:"dcl modal-navigation-button modal-navigation-close",onClick:Lr}))},pr}(React.PureComponent);ModalNavigation_2=ModalNavigation$2.ModalNavigation=ModalNavigation;const warningSrc="https://cdn.decentraland.org/@dcl/auth-site/1.3.2-7900126256.commit-8819962/assets/warning-057948e8.svg";var ConnectionModalState=($r=>($r.CONNECTING_WALLET="CONNECTING_WALLET",$r.WAITING_FOR_SIGNATURE="WAITING_FOR_SIGNATURE",$r.ERROR="ERROR",$r.LOADING_MAGIC="LOADING_MAGIC",$r.VALIDATING_SIGN_IN="VALIDATING_SIGN_IN",$r.WAITING_FOR_CONFIRMATION="WAITING_FOR_CONFIRMATION",$r))(ConnectionModalState||{});function getConnectionMessage($r,pr){switch($r){case ConnectionModalState.ERROR:return"You did not confirm this action in your digital wallet extension. To continue, please try again.";case ConnectionModalState.CONNECTING_WALLET:case ConnectionModalState.WAITING_FOR_SIGNATURE:return pr===dist$6.ProviderType.MAGIC?"Almost done! Confirm your request to login Decentraland":"Confirm in your digital wallet extension to continue.";case ConnectionModalState.VALIDATING_SIGN_IN:return"Just a moment, we're verifying your login credentials...";case ConnectionModalState.LOADING_MAGIC:return"Redirecting..."}}const main$3="_main_1qx1l_1",content="_content_1qx1l_8",errorImage="_errorImage_1qx1l_16",message="_message_1qx1l_22",loader="_loader_1qx1l_29",styles$6={main:main$3,content,errorImage,message,loader},ConnectionModal=$r=>{const{open:pr,state:Mr,providerType:Nr,onClose:Dr,onTryAgain:Br}=$r,Lr=Mr===ConnectionModalState.CONNECTING_WALLET||Mr===ConnectionModalState.WAITING_FOR_SIGNATURE||Mr===ConnectionModalState.LOADING_MAGIC||Mr===ConnectionModalState.VALIDATING_SIGN_IN;return jsxRuntimeExports.jsxs(Modal$3.Modal,{size:"tiny",open:pr,children:[jsxRuntimeExports.jsx(ModalNavigation_2,{title:"",onClose:Lr?void 0:Dr}),jsxRuntimeExports.jsx("div",{className:styles$6.main,children:jsxRuntimeExports.jsxs("div",{className:styles$6.content,children:[Mr===ConnectionModalState.ERROR&&jsxRuntimeExports.jsx("img",{className:styles$6.errorImage,src:warningSrc}),Lr&&jsxRuntimeExports.jsx(Loader_3,{className:styles$6.loader,size:"huge",inline:!0}),jsxRuntimeExports.jsx("p",{className:styles$6.message,children:getConnectionMessage(Mr,Nr)}),Mr===ConnectionModalState.ERROR&&jsxRuntimeExports.jsx(Button$5.Button,{primary:!0,onClick:Br,children:"Try again"})]})}),jsxRuntimeExports.jsx(ModalContent,{})]})};var Popup={},isElement_1,hasRequiredIsElement;function requireIsElement(){if(hasRequiredIsElement)return isElement_1;hasRequiredIsElement=1;var $r=requireIsObjectLike(),pr=requireIsPlainObject();function Mr(Nr){return $r(Nr)&&Nr.nodeType===1&&!pr(Nr)}return isElement_1=Mr,isElement_1}const require$$17=getAugmentedNamespace(esm);var positions={},_baseInverter,hasRequired_baseInverter;function require_baseInverter(){if(hasRequired_baseInverter)return _baseInverter;hasRequired_baseInverter=1;var $r=require_baseForOwn();function pr(Mr,Nr,Dr,Br){return $r(Mr,function(Lr,jr,Ur){Nr(Br,Dr(Lr),jr,Ur)}),Br}return _baseInverter=pr,_baseInverter}var _createInverter,hasRequired_createInverter;function require_createInverter(){if(hasRequired_createInverter)return _createInverter;hasRequired_createInverter=1;var $r=require_baseInverter();function pr(Mr,Nr){return function(Dr,Br){return $r(Dr,Mr,Nr(Br),{})}}return _createInverter=pr,_createInverter}var invert_1,hasRequiredInvert;function requireInvert(){if(hasRequiredInvert)return invert_1;hasRequiredInvert=1;var $r=requireConstant(),pr=require_createInverter(),Mr=requireIdentity(),Nr=Object.prototype,Dr=Nr.toString,Br=pr(function(Lr,jr,Ur){jr!=null&&typeof jr.toString!="function"&&(jr=Dr.call(jr)),Lr[jr]=Ur},$r(Mr));return invert_1=Br,invert_1}var hasRequiredPositions;function requirePositions(){if(hasRequiredPositions)return positions;hasRequiredPositions=1;var $r=interopRequireDefaultExports;positions.__esModule=!0,positions.placementMapping=positions.positions=positions.positionsMapping=void 0;var pr=$r(requireInvert()),Mr=$r(requireKeys()),Nr={"top center":"top","top left":"top-start","top right":"top-end","bottom center":"bottom","bottom left":"bottom-start","bottom right":"bottom-end","right center":"right","left center":"left"};positions.positionsMapping=Nr;var Dr=(0,Mr.default)(Nr);positions.positions=Dr;var Br=(0,pr.default)(Nr);return positions.placementMapping=Br,positions}var createReferenceProxy={},createClass={exports:{}},toPropertyKey={exports:{}},toPrimitive={exports:{}},hasRequiredToPrimitive;function requireToPrimitive(){return hasRequiredToPrimitive||(hasRequiredToPrimitive=1,function($r){var pr=_typeofExports$2.default;function Mr(Nr,Dr){if(pr(Nr)!=="object"||Nr===null)return Nr;var Br=Nr[Symbol.toPrimitive];if(Br!==void 0){var Lr=Br.call(Nr,Dr||"default");if(pr(Lr)!=="object")return Lr;throw new TypeError("@@toPrimitive must return a primitive value.")}return(Dr==="string"?String:Number)(Nr)}$r.exports=Mr,$r.exports.__esModule=!0,$r.exports.default=$r.exports}(toPrimitive)),toPrimitive.exports}var hasRequiredToPropertyKey;function requireToPropertyKey(){return hasRequiredToPropertyKey||(hasRequiredToPropertyKey=1,function($r){var pr=_typeofExports$2.default,Mr=requireToPrimitive();function Nr(Dr){var Br=Mr(Dr,"string");return pr(Br)==="symbol"?Br:String(Br)}$r.exports=Nr,$r.exports.__esModule=!0,$r.exports.default=$r.exports}(toPropertyKey)),toPropertyKey.exports}var hasRequiredCreateClass;function requireCreateClass(){return hasRequiredCreateClass||(hasRequiredCreateClass=1,function($r){var pr=requireToPropertyKey();function Mr(Dr,Br){for(var Lr=0;Lr<Br.length;Lr++){var jr=Br[Lr];jr.enumerable=jr.enumerable||!1,jr.configurable=!0,"value"in jr&&(jr.writable=!0),Object.defineProperty(Dr,pr(jr.key),jr)}}function Nr(Dr,Br,Lr){return Br&&Mr(Dr.prototype,Br),Lr&&Mr(Dr,Lr),Object.defineProperty(Dr,"prototype",{writable:!1}),Dr}$r.exports=Nr,$r.exports.__esModule=!0,$r.exports.default=$r.exports}(createClass)),createClass.exports}var hasRequiredCreateReferenceProxy;function requireCreateReferenceProxy(){if(hasRequiredCreateReferenceProxy)return createReferenceProxy;hasRequiredCreateReferenceProxy=1;var $r=interopRequireDefaultExports;createReferenceProxy.__esModule=!0,createReferenceProxy.default=void 0;var pr=$r(requireCreateClass()),Mr=$r(requireMemoize()),Nr=$r(requireInvoke()),Dr=require$$4$2,Br=function(){function Ur(Yr){this.ref=Yr}var Gr=Ur.prototype;return Gr.getBoundingClientRect=function(){return(0,Nr.default)(this.ref.current,"getBoundingClientRect")||{}},(0,pr.default)(Ur,[{key:"clientWidth",get:function(){return this.getBoundingClientRect().width}},{key:"clientHeight",get:function(){return this.getBoundingClientRect().height}},{key:"parentNode",get:function(){return this.ref.current?this.ref.current.parentNode:void 0}}]),Ur}(),Lr=(0,Mr.default)(function(Ur){return new Br((0,Dr.isRefObject)(Ur)?Ur:{current:Ur})}),jr=Lr;return createReferenceProxy.default=jr,createReferenceProxy}var PopupContent={},hasRequiredPopupContent;function requirePopupContent(){if(hasRequiredPopupContent)return PopupContent;hasRequiredPopupContent=1;var $r=interopRequireDefaultExports;PopupContent.__esModule=!0,PopupContent.default=Br;var pr=$r(require_extends()),Mr=$r(require$$0$9);$r(requirePropTypes());var Nr=$r(reactExports),Dr=requireLib();function Br(Lr){var jr=Lr.children,Ur=Lr.className,Gr=Lr.content,Yr=(0,Mr.default)("content",Ur),Qr=(0,Dr.getUnhandledProps)(Br,Lr),Wn=(0,Dr.getElementType)(Br,Lr);return Nr.default.createElement(Wn,(0,pr.default)({},Qr,{className:Yr}),Dr.childrenUtils.isNil(jr)?Gr:jr)}return Br.handledProps=["as","children","className","content"],Br.propTypes={},Br.create=(0,Dr.createShorthandFactory)(Br,function(Lr){return{children:Lr}}),PopupContent}var PopupHeader={},hasRequiredPopupHeader;function requirePopupHeader(){if(hasRequiredPopupHeader)return PopupHeader;hasRequiredPopupHeader=1;var $r=interopRequireDefaultExports;PopupHeader.__esModule=!0,PopupHeader.default=Br;var pr=$r(require_extends()),Mr=$r(require$$0$9);$r(requirePropTypes());var Nr=$r(reactExports),Dr=requireLib();function Br(Lr){var jr=Lr.children,Ur=Lr.className,Gr=Lr.content,Yr=(0,Mr.default)("header",Ur),Qr=(0,Dr.getUnhandledProps)(Br,Lr),Wn=(0,Dr.getElementType)(Br,Lr);return Nr.default.createElement(Wn,(0,pr.default)({},Qr,{className:Yr}),Dr.childrenUtils.isNil(jr)?Gr:jr)}return Br.handledProps=["as","children","className","content"],Br.propTypes={},Br.create=(0,Dr.createShorthandFactory)(Br,function(Lr){return{children:Lr}}),PopupHeader}var hasRequiredPopup;function requirePopup(){if(hasRequiredPopup)return Popup;hasRequiredPopup=1;var $r=interopRequireWildcardExports,pr=interopRequireDefaultExports;Popup.__esModule=!0,Popup.default=void 0;var Mr=pr(require_extends()),Nr=pr(requireInheritsLoose());pr(requireWithout());var Dr=pr(requireIsNil()),Br=pr(requireIsUndefined()),Lr=pr(requireInvoke()),jr=pr(requireIsElement()),Ur=pr(requireIsArray()),Gr=pr(requirePick()),Yr=pr(requireIncludes()),Qr=pr(requireReduce()),Wn=pr(requireLib$1()),ga=pr(require$$0$9);pr(requirePropTypes());var eo=$r(reactExports),_i=require$$17,va=pr(requireShallowequal()),io=requireLib(),no=pr(requirePortal()),so=requirePositions(),ao=pr(requireCreateReferenceProxy()),fo=pr(requirePopupContent()),lo=pr(requirePopupHeader()),oo=function(po){(0,Nr.default)(mo,po);function mo(){for(var Xn,Fr=arguments.length,Vr=new Array(Fr),Wr=0;Wr<Fr;Wr++)Vr[Wr]=arguments[Wr];return Xn=po.call.apply(po,[this].concat(Vr))||this,Xn.state={},Xn.open=!1,Xn.zIndexWasSynced=!1,Xn.triggerRef=eo.default.createRef(),Xn.elementRef=eo.default.createRef(),Xn.getPortalProps=function(){var Jr={},Gn=Xn.props,to=Gn.on,ro=Gn.hoverable,Un=(0,Ur.default)(to)?to:[to];return ro&&(Jr.closeOnPortalMouseLeave=!0,Jr.mouseLeaveDelay=300),(0,Yr.default)(Un,"hover")&&(Jr.openOnTriggerClick=!1,Jr.closeOnTriggerClick=!1,Jr.openOnTriggerMouseEnter=!0,Jr.closeOnTriggerMouseLeave=!0,Jr.mouseLeaveDelay=70,Jr.mouseEnterDelay=50),(0,Yr.default)(Un,"click")&&(Jr.openOnTriggerClick=!0,Jr.closeOnTriggerClick=!0,Jr.closeOnDocumentClick=!0),(0,Yr.default)(Un,"focus")&&(Jr.openOnTriggerFocus=!0,Jr.closeOnTriggerBlur=!0),Jr},Xn.hideOnScroll=function(Jr){(0,jr.default)(Jr.target)&&Xn.elementRef.current.contains(Jr.target)||(Xn.setState({closed:!0}),io.eventStack.unsub("scroll",Xn.hideOnScroll,{target:window}),Xn.timeoutId=setTimeout(function(){Xn.setState({closed:!1})},50),Xn.handleClose(Jr))},Xn.handleClose=function(Jr){(0,Lr.default)(Xn.props,"onClose",Jr,(0,Mr.default)({},Xn.props,{open:!1}))},Xn.handleOpen=function(Jr){(0,Lr.default)(Xn.props,"onOpen",Jr,(0,Mr.default)({},Xn.props,{open:!0}))},Xn.handlePortalMount=function(Jr){(0,Lr.default)(Xn.props,"onMount",Jr,Xn.props)},Xn.handlePortalUnmount=function(Jr){Xn.positionUpdate=null,(0,Lr.default)(Xn.props,"onUnmount",Jr,Xn.props)},Xn.renderContent=function(Jr){var Gn=Jr.placement,to=Jr.ref,ro=Jr.update,Un=Jr.style,Hr=Xn.props,Xr=Hr.basic,co=Hr.children,ho=Hr.className,go=Hr.content,bo=Hr.hideOnScroll,Eo=Hr.flowing,wo=Hr.header,Io=Hr.inverted,Po=Hr.popper,yo=Hr.size,xo=Hr.style,Mo=Hr.wide,qo=Xn.state.contentRestProps;Xn.positionUpdate=ro;var pu=(0,ga.default)("ui",so.placementMapping[Gn],yo,(0,io.useKeyOrValueAndKey)(Mo,"wide"),(0,io.useKeyOnly)(Xr,"basic"),(0,io.useKeyOnly)(Eo,"flowing"),(0,io.useKeyOnly)(Io,"inverted"),"popup transition visible",ho),nu=(0,io.getElementType)(mo,Xn.props),eu=(0,Mr.default)({left:"auto",right:"auto",position:"initial"},xo),Uu=eo.default.createElement(nu,(0,Mr.default)({},qo,{className:pu,style:eu,ref:Xn.elementRef}),io.childrenUtils.isNil(co)?eo.default.createElement(eo.default.Fragment,null,lo.default.create(wo,{autoGenerateKey:!1}),fo.default.create(go,{autoGenerateKey:!1})):co,bo&&eo.default.createElement(Wn.default,{on:Xn.hideOnScroll,name:"scroll",target:"window"}));return(0,io.createHTMLDivision)(Po||{},{overrideProps:{children:Uu,ref:to,style:(0,Mr.default)({display:"flex"},Un)}})},Xn}mo.getDerivedStateFromProps=function(Fr,Vr){if(Vr.closed||Vr.disabled)return{};var Wr=(0,io.getUnhandledProps)(mo,Fr),Jr=(0,Qr.default)(Wr,function(to,ro,Un){return(0,Yr.default)(no.default.handledProps,Un)||(to[Un]=ro),to},{}),Gn=(0,Gr.default)(Wr,no.default.handledProps);return{contentRestProps:Jr,portalRestProps:Gn}};var $o=mo.prototype;return $o.componentDidUpdate=function(Fr){var Vr=(0,va.default)(this.props.popperDependencies,Fr.popperDependencies);Vr||this.handleUpdate()},$o.componentWillUnmount=function(){clearTimeout(this.timeoutId)},$o.handleUpdate=function(){this.positionUpdate&&this.positionUpdate()},$o.render=function(){var Fr=this,Vr=this.props,Wr=Vr.context,Jr=Vr.disabled,Gn=Vr.eventsEnabled,to=Vr.offset,ro=Vr.pinned,Un=Vr.popper,Hr=Vr.popperModifiers,Xr=Vr.position,co=Vr.positionFixed,ho=Vr.trigger,go=this.state,bo=go.closed,Eo=go.portalRestProps;if(bo||Jr)return ho;var wo=[{name:"arrow",enabled:!1},{name:"eventListeners",options:{scroll:!!Gn,resize:!!Gn}},{name:"flip",enabled:!ro},{name:"preventOverflow",enabled:!!to},{name:"offset",enabled:!!to,options:{offset:to}}].concat(Hr,[{name:"syncZIndex",enabled:!0,phase:"beforeRead",fn:function(xo){var Mo,qo=xo.state;if(!Fr.zIndexWasSynced){var pu=Un==null||(Mo=Un.style)==null?void 0:Mo.zIndex;(0,Br.default)(pu)&&(qo.elements.popper.style.zIndex=window.getComputedStyle(qo.elements.popper.firstChild).zIndex),Fr.zIndexWasSynced=!0}},effect:function(){return function(){Fr.zIndexWasSynced=!1}}}]),Io=(0,ao.default)((0,Dr.default)(Wr)?this.triggerRef:Wr),Po=(0,Mr.default)({},this.getPortalProps(),Eo);return eo.default.createElement(no.default,(0,Mr.default)({},Po,{onClose:this.handleClose,onMount:this.handlePortalMount,onOpen:this.handleOpen,onUnmount:this.handlePortalUnmount,trigger:ho,triggerRef:this.triggerRef}),eo.default.createElement(_i.Popper,{modifiers:wo,placement:so.positionsMapping[Xr],strategy:co?"fixed":null,referenceElement:Io},this.renderContent))},mo}(eo.Component);return Popup.default=oo,oo.handledProps=["as","basic","children","className","content","context","disabled","eventsEnabled","flowing","header","hideOnScroll","hoverable","inverted","offset","on","onClose","onMount","onOpen","onUnmount","pinned","popper","popperDependencies","popperModifiers","position","positionFixed","size","style","trigger","wide"],oo.propTypes={},oo.defaultProps={disabled:!1,eventsEnabled:!0,on:["click","hover"],pinned:!1,popperModifiers:[],position:"top left"},oo.Content=fo.default,oo.Header=lo.default,Popup}var _interopRequireDefault=interopRequireDefaultExports,_Popup=_interopRequireDefault(requirePopup()),_default=_Popup.default;const capitalize=$r=>$r.charAt(0).toUpperCase()+$r.slice(1),button="_button_1uvkr_1",icon="_icon_1uvkr_5",styles$5={button,icon,"icon-metamask-mobile":"_icon-metamask-mobile_1uvkr_13","icon-metamask":"_icon-metamask_1uvkr_13","icon-dapper":"_icon-dapper_1uvkr_18","icon-fortmatic":"_icon-fortmatic_1uvkr_22","icon-wallet-connect":"_icon-wallet-connect_1uvkr_26","icon-samsung-blockchain-wallet":"_icon-samsung-blockchain-wallet_1uvkr_30","icon-coinbase":"_icon-coinbase_1uvkr_34","icon-wallet-link":"_icon-wallet-link_1uvkr_35","icon-google":"_icon-google_1uvkr_39","icon-discord":"_icon-discord_1uvkr_43","icon-apple":"_icon-apple_1uvkr_47","icon-x":"_icon-x_1uvkr_51"},ConnectionOption=$r=>{const{className:pr,children:Mr,type:Nr,testId:Dr,showTooltip:Br,tooltipPosition:Lr,disabled:jr,info:Ur,loading:Gr,onClick:Yr}=$r;return jsxRuntimeExports.jsx(_default,{position:Br&&Lr?Lr:"top center",disabled:!Br,trigger:jsxRuntimeExports.jsx("span",{children:jsxRuntimeExports.jsxs(Button$5.Button,{primary:!0,size:"small","data-testid":`${Dr}-${Nr}-button`,className:classNames(pr,styles$5.button),onClick:()=>Yr(Nr),disabled:jr,loading:Gr,children:[Gr?null:jsxRuntimeExports.jsx("div",{role:"img","aria-label":Nr,className:classNames(styles$5.icon,styles$5[`icon-${Nr}`],styles$5.primaryImage)}),Mr]},Nr)}),content:Ur??capitalize(Nr),on:"hover"})},SOCIAL_PRIMARY_TEST_ID="social-primary-test-id",SOCIAL_SECONDARY_TEST_ID="social-secondary-test-id",WEB3_PRIMARY_TEST_ID="web3-primary-test-id",WEB3_SECONDARY_TEST_ID="web3-secondary-test-id",SHOW_MORE_BUTTON_TEST_ID="show-more-button-test-id";var ConnectionOptionType=($r=>($r.METAMASK="metamask",$r.DAPPER="dapper",$r.FORTMATIC="fortmatic",$r.COINBASE="coinbase",$r.SAMSUNG="samsung-blockchain-wallet",$r.WALLET_CONNECT="wallet-connect",$r.WALLET_LINK="wallet-link",$r.METAMASK_MOBILE="metamask-mobile",$r.GOOGLE="google",$r.APPLE="apple",$r.DISCORD="discord",$r.X="x",$r))(ConnectionOptionType||{});const connection="_connection_ym3lq_3",dclLogo="_dclLogo_ym3lq_9",title$2="_title_ym3lq_15",subtitle="_subtitle_ym3lq_20",primaryButton="_primaryButton_ym3lq_29",primaryImage="_primaryImage_ym3lq_38",primaryMessage="_primaryMessage_ym3lq_42",primaryMagic="_primaryMagic_ym3lq_51",primaryLearnMore="_primaryLearnMore_ym3lq_60",primary="_primary_ym3lq_29",showMore="_showMore_ym3lq_73",showMoreButton="_showMoreButton_ym3lq_77",showMoreSecondaryOptions="_showMoreSecondaryOptions_ym3lq_86",primaryOption="_primaryOption_ym3lq_100",secondaryOptionButton="_secondaryOptionButton_ym3lq_104",styles$4={connection,dclLogo,title:title$2,subtitle,primaryButton,primaryImage,primaryMessage,primaryMagic,primaryLearnMore,primary,showMore,showMoreButton,showMoreSecondaryOptions,primaryOption,secondaryOptionButton},Primary=({message:$r,children:pr,option:Mr,testId:Nr,loadingOption:Dr,error:Br,onConnect:Lr})=>jsxRuntimeExports.jsxs("div",{className:styles$4.primary,"data-testid":Nr,children:[jsxRuntimeExports.jsx("div",{className:styles$4.primaryMessage,children:$r}),jsxRuntimeExports.jsx(ConnectionOption,{disabled:!!Dr||!!Br,loading:Dr===Mr,showTooltip:!!Br,type:Mr,info:Br,onClick:Lr,className:classNames(styles$4.primaryButton,styles$4.primaryOption),testId:Nr,children:pr})]}),Secondary=({options:$r,tooltipDirection:pr,testId:Mr,loadingOption:Nr,onConnect:Dr})=>jsxRuntimeExports.jsx("div",{className:styles$4.showMoreSecondaryOptions,"data-testid":Mr,children:$r.map(Br=>jsxRuntimeExports.jsx(ConnectionOption,{className:classNames(styles$4.primaryButton,styles$4.secondaryOptionButton),showTooltip:!0,tooltipPosition:pr,type:Br,onClick:Dr,testId:Mr,loading:Nr===Br,disabled:!!Nr},Br))}),defaultProps$2={i18n:{title:"Discover a virtual social world",subtitle:"shaped by its community of creators & explorers.",accessWith:$r=>`Access with ${$r}`,connectWith:$r=>`Connect with ${$r}`,moreOptions:"More Options",socialMessage:$r=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["Access secured by ",$r]}),web3Message:$r=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["Have a digital wallet? ",$r("Learn More")]})}},Connection=$r=>{var eo;const{i18n:pr=defaultProps$2.i18n,onConnect:Mr,onLearnMore:Nr,socialOptions:Dr,web3Options:Br,className:Lr,loadingOption:jr}=$r,[Ur,Gr]=reactExports.useState(!1),Yr=reactExports.useCallback(()=>{Gr(!Ur)},[Ur]),Qr=(eo=window.ethereum)==null?void 0:eo.isMetaMask,Wn=Dr&&Dr.secondary&&Dr.secondary.length>0,ga=Br&&Br.secondary&&Br.secondary.length>0;return jsxRuntimeExports.jsxs("div",{className:classNames(Lr,styles$4.connection),children:[jsxRuntimeExports.jsx("img",{className:styles$4.dclLogo,src:logoSrc,alt:"Decentraland logo"}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h1",{className:styles$4.title,children:pr.title}),jsxRuntimeExports.jsx("h2",{className:styles$4.subtitle,children:pr.subtitle}),Dr?jsxRuntimeExports.jsx(Primary,{onConnect:Mr,testId:SOCIAL_PRIMARY_TEST_ID,option:Dr==null?void 0:Dr.primary,loadingOption:jr,message:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[pr.socialMessage(jsxRuntimeExports.jsx("div",{className:styles$4.primaryMagic,role:"img","aria-label":"Magic"})),jsxRuntimeExports.jsx("span",{className:styles$4.primaryLearnMore,role:"button",onClick:()=>Nr(Dr==null?void 0:Dr.primary),children:"Learn More"})]}),children:jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:pr.accessWith(Dr==null?void 0:Dr.primary)})}):null,Br?jsxRuntimeExports.jsx(Primary,{onConnect:Mr,testId:WEB3_PRIMARY_TEST_ID,option:Br==null?void 0:Br.primary,loadingOption:jr,error:!Qr&&(Br==null?void 0:Br.primary)===ConnectionOptionType.METAMASK?"You need to install the MetaMask Browser Extension to proceed. Please install it and try again.":void 0,message:pr.web3Message(_i=>jsxRuntimeExports.jsx("span",{className:styles$4.primaryLearnMore,role:"button",onClick:()=>Nr(Br.primary),children:_i})),children:jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:pr.connectWith(Br==null?void 0:Br.primary)})}):null]}),jsxRuntimeExports.jsxs("div",{className:styles$4.showMore,children:[(ga||Wn)&&jsxRuntimeExports.jsxs(Button$5.Button,{"data-testid":SHOW_MORE_BUTTON_TEST_ID,basic:!0,size:"medium",fluid:!0,className:styles$4.showMoreButton,onClick:Yr,children:[pr.moreOptions,jsxRuntimeExports.jsx(default_1,{name:Ur?"chevron up":"chevron down"})]}),Ur&&Wn&&jsxRuntimeExports.jsx(Secondary,{testId:SOCIAL_SECONDARY_TEST_ID,options:Dr.secondary,onConnect:Mr,tooltipDirection:"top center",loadingOption:jr}),Ur&&ga&&jsxRuntimeExports.jsx(Secondary,{testId:WEB3_SECONDARY_TEST_ID,options:Br.secondary,onConnect:Mr,tooltipDirection:"bottom center",loadingOption:jr})]})]})},ONE_MONTH_IN_MINUTES=60*24*30,MAGIC_KEY$1=dist$7.getConfiguration().magic.apiKey;function fromConnectionOptionToProviderType($r){switch($r){case ConnectionOptionType.DISCORD:case ConnectionOptionType.X:case ConnectionOptionType.GOOGLE:case ConnectionOptionType.APPLE:return providerType.ProviderType.MAGIC;case ConnectionOptionType.WALLET_CONNECT:case ConnectionOptionType.METAMASK_MOBILE:return providerType.ProviderType.WALLET_CONNECT_V2;case ConnectionOptionType.COINBASE:case ConnectionOptionType.WALLET_LINK:return providerType.ProviderType.WALLET_LINK;case ConnectionOptionType.FORTMATIC:return providerType.ProviderType.FORTMATIC;case ConnectionOptionType.METAMASK:case ConnectionOptionType.DAPPER:case ConnectionOptionType.SAMSUNG:return providerType.ProviderType.INJECTED;default:throw new Error("Invalid provider")}}async function generateIdentity($r,pr){const Mr=new BrowserProvider(pr),Nr=Wallet.createRandom(),Dr={address:Nr.address.toString(),publicKey:hexlify(Nr.publicKey),privateKey:hexlify(Nr.privateKey)},Br=await Mr.getSigner();return dist.Authenticator.initializeAuthChain($r,Dr,ONE_MONTH_IN_MINUTES,Lr=>Br.signMessage(Lr))}async function connectToProvider($r){const pr=fromConnectionOptionToProviderType($r);if(providerType.ProviderType.MAGIC===pr){const{Magic:Nr}=await __vitePreload(()=>Promise.resolve().then(()=>es$1),void 0),{OAuthExtension:Dr}=await __vitePreload(()=>Promise.resolve().then(()=>es),void 0),Br=new Nr(MAGIC_KEY$1,{extensions:[new Dr]}),Lr=new URL(window.location.href);Lr.pathname="/auth/callback",await Br.oauth.loginWithRedirect({provider:$r===ConnectionOptionType.X?"twitter":$r,redirectURI:Lr.href})}const Mr=await dist$7.connection.connect(pr);if(!Mr.account||!Mr.provider)throw new Error("Could not get provider");return Mr}function isSocialLogin($r){return[ConnectionOptionType.APPLE,ConnectionOptionType.GOOGLE,ConnectionOptionType.X,ConnectionOptionType.DISCORD].includes($r)}async function getIdentitySignature($r,pr){let Mr;const Nr=dist$4.localStorageGetIdentity($r);return Nr?Mr=Nr:(Mr=await generateIdentity($r,pr),dist$4.localStorageStoreIdentity($r,Mr)),Mr}const container="_container_1jfc2_1",info$2="_info_1jfc2_19",title$1="_title_1jfc2_28",styles$3={container,info:info$2,title:title$1},MAGIC_KEY=dist$7.getConfiguration().magic.apiKey,CallbackPage=()=>{usePageTracking();const $r=useAfterLoginRedirection(),pr=useNavigate(),[Mr,Nr]=reactExports.useState(ConnectionModalState.WAITING_FOR_CONFIRMATION),{flags:Dr}=reactExports.useContext(FeatureFlagsContext),Br=reactExports.useCallback(async()=>{var Gr;const Ur=await dist$7.connection.connect(dist$6.ProviderType.MAGIC);return await getIdentitySignature(((Gr=Ur.account)==null?void 0:Gr.toLowerCase())??"",Ur.provider),Ur},[]),Lr=reactExports.useCallback(async()=>{const{Magic:Ur}=await __vitePreload(()=>Promise.resolve().then(()=>es$1),void 0),{OAuthExtension:Gr}=await __vitePreload(()=>Promise.resolve().then(()=>es),void 0),Yr=new Ur(MAGIC_KEY,{extensions:[new Gr]});try{Nr(ConnectionModalState.VALIDATING_SIGN_IN),await(Yr==null?void 0:Yr.oauth.getRedirectResult()),Nr(ConnectionModalState.WAITING_FOR_CONFIRMATION)}catch(Qr){console.log(Qr),pr("/login")}},[pr]);reactExports.useEffect(()=>{Lr()},[]);const jr=reactExports.useCallback(async()=>{var Ur;try{Nr(ConnectionModalState.WAITING_FOR_SIGNATURE);const Gr=await Br(),Yr=((Ur=Gr.account)==null?void 0:Ur.toLowerCase())??"";if(getAnalytics().identify({ethAddress:Yr}),getAnalytics().track(TrackingEvents.LOGIN_SUCCESS,{eth_address:Yr}),await wait(800),Dr[FeatureFlagsKeys.SIMPLIFIED_AVATAR_SETUP]&&Gr.account&&!await fetchProfile(Gr.account)){window.location.href="/auth/setup"+($r?`?redirectTo=${$r}`:"");return}$r?window.location.href=decodeURIComponent($r):window.location.href="/"}catch(Gr){console.log(Gr),pr("/login")}},[pr,$r,Dr]);return Mr===ConnectionModalState.WAITING_FOR_CONFIRMATION?jsxRuntimeExports.jsx(Modal$3.Modal,{size:"tiny",open:!0,children:jsxRuntimeExports.jsxs("div",{className:styles$3.container,children:[jsxRuntimeExports.jsx("h3",{className:styles$3.title,children:"Confirm your login"}),jsxRuntimeExports.jsxs("div",{className:styles$3.info,children:[jsxRuntimeExports.jsx("span",{children:"This step only verifies your identity."}),jsxRuntimeExports.jsx("span",{children:"No payments or transactions will occur without your explicit approval."})]}),jsxRuntimeExports.jsx(Button$5.Button,{primary:!0,onClick:jr,children:"Continue"})]})}):jsxRuntimeExports.jsx(ConnectionModal,{open:!0,state:Mr,onTryAgain:Br,providerType:dist$6.ProviderType.MAGIC})},Image1="https://cdn.decentraland.org/@dcl/auth-site/1.3.2-7900126256.commit-8819962/assets/image1-a4aa795b.webp",Image10="https://cdn.decentraland.org/@dcl/auth-site/1.3.2-7900126256.commit-8819962/assets/image10-c7fbcc61.webp",Image2="https://cdn.decentraland.org/@dcl/auth-site/1.3.2-7900126256.commit-8819962/assets/image2-0af6ed59.webp",Image3="https://cdn.decentraland.org/@dcl/auth-site/1.3.2-7900126256.commit-8819962/assets/image3-c864ad86.webp",Image4="https://cdn.decentraland.org/@dcl/auth-site/1.3.2-7900126256.commit-8819962/assets/image4-7964be5f.webp",Image5="https://cdn.decentraland.org/@dcl/auth-site/1.3.2-7900126256.commit-8819962/assets/image5-fcca517e.webp",Image6="https://cdn.decentraland.org/@dcl/auth-site/1.3.2-7900126256.commit-8819962/assets/image6-c770bdf5.webp",Image7="https://cdn.decentraland.org/@dcl/auth-site/1.3.2-7900126256.commit-8819962/assets/image7-341595c4.webp",Image8="https://cdn.decentraland.org/@dcl/auth-site/1.3.2-7900126256.commit-8819962/assets/image8-fea9fe85.webp",Image9="https://cdn.decentraland.org/@dcl/auth-site/1.3.2-7900126256.commit-8819962/assets/image9-714885ef.webp",main$2="_main_qwc0l_1",title="_title_qwc0l_11",infoModal$1="_infoModal_qwc0l_15",infoContent$1="_infoContent_qwc0l_19",info$1="_info_qwc0l_15",goBackButton$1="_goBackButton_qwc0l_33",styles$2={main:main$2,title,infoModal:infoModal$1,infoContent:infoContent$1,info:info$1,goBackButton:goBackButton$1},defaultProps$1={i18n:{title:"How does Magic work?",subtitle:"Magic handles digital wallet creation & management behind the scenes so you don't have to. Just log into Decentraland with your favorite social account and let Magic handle the rest.<br /> <br />If you'd rather take a more hands-on approach to your digital asset storage (e.g. Wearables, NAMEs, etc.), you can get a digital wallet from a provider such as <a href='https://metamask.io/'>MetaMask</a> and use it to create your Decentraland account.",goBack:"Return to log in page"}},MagicInformationModal=$r=>{const{i18n:pr=defaultProps$1.i18n,onClose:Mr,open:Nr}=$r;return jsxRuntimeExports.jsxs(Modal$3.Modal,{size:"tiny",open:Nr,className:styles$2.infoModal,onClose:Mr,children:[jsxRuntimeExports.jsx(ModalNavigation_2,{title:"",onClose:Mr}),jsxRuntimeExports.jsx(ModalContent,{className:styles$2.infoContent,children:jsxRuntimeExports.jsxs("div",{className:styles$2.main,children:[jsxRuntimeExports.jsx("h1",{className:styles$2.title,children:pr==null?void 0:pr.title}),jsxRuntimeExports.jsx("span",{className:styles$2.info,dangerouslySetInnerHTML:{__html:pr==null?void 0:pr.subtitle}}),jsxRuntimeExports.jsx(Button$5.Button,{className:styles$2.goBackButton,secondary:!0,inverted:!0,onClick:Mr,children:pr==null?void 0:pr.goBack})]})})]})},main$1="_main_1c8le_1",infoModal="_infoModal_1c8le_11",infoContent="_infoContent_1c8le_15",info="_info_1c8le_11",infoImage="_infoImage_1c8le_26",assets="_assets_1c8le_34",login="_login_1c8le_38",goBackButton="_goBackButton_1c8le_42",styles$1={main:main$1,infoModal,infoContent,info,infoImage,assets,login,goBackButton},defaultProps={i18n:{title:"What is a digital wallet?",assets:{title:"A Home For Your Digital Assets",text:"Wallets are used to send, receive, store, and display digital assets, such as your Decentraland Wearables, NAMEs, LANDs, etc."},logIn:{title:"A New Way To Log In",text:"Instead of creating new accounts and passwords on every website, in the world of Web3 all you need to do is just connect your digital wallet."},goBack:"Return to log in page"}},WalletInformationModal=$r=>{const{i18n:pr=defaultProps.i18n,onClose:Mr,open:Nr}=$r;return jsxRuntimeExports.jsxs(Modal$3.Modal,{size:"tiny",open:Nr,className:styles$1.infoModal,onClose:Mr,children:[jsxRuntimeExports.jsx(ModalNavigation_2,{title:"",onClose:Mr}),jsxRuntimeExports.jsx(ModalContent,{className:styles$1.infoContent,children:jsxRuntimeExports.jsxs("div",{className:styles$1.main,children:[jsxRuntimeExports.jsx("h1",{className:styles$1.title,children:pr==null?void 0:pr.title}),jsxRuntimeExports.jsxs("article",{className:styles$1.info,children:[jsxRuntimeExports.jsx("div",{className:classNames(styles$1.infoImage,styles$1.assets)}),jsxRuntimeExports.jsx("h3",{children:pr==null?void 0:pr.assets.title}),jsxRuntimeExports.jsx("p",{children:pr==null?void 0:pr.assets.text})]}),jsxRuntimeExports.jsxs("article",{className:styles$1.info,children:[jsxRuntimeExports.jsx("div",{className:classNames(styles$1.infoImage,styles$1.login)}),jsxRuntimeExports.jsx("h3",{children:pr==null?void 0:pr.logIn.title}),jsxRuntimeExports.jsx("p",{children:pr==null?void 0:pr.logIn.text})]}),jsxRuntimeExports.jsx(Button$5.Button,{className:styles$1.goBackButton,secondary:!0,inverted:!0,onClick:Mr,children:pr==null?void 0:pr.goBack})]})})]})},main="_main_1d9a9_1",background="_background_1d9a9_8",left="_left_1d9a9_32",leftInfo="_leftInfo_1d9a9_42",right="_right_1d9a9_51",footer="_footer_1d9a9_60",guestInfo="_guestInfo_1d9a9_79",styles={main,background,"move-background":"_move-background_1d9a9_1",left,leftInfo,right,footer,guestInfo},BACKGROUND_IMAGES=[Image1,Image2,Image3,Image4,Image5,Image6,Image7,Image8,Image9,Image10],LoginPage=()=>{usePageTracking();const[$r]=useSearchParams(),[pr,Mr]=reactExports.useState(ConnectionModalState.CONNECTING_WALLET),[Nr,Dr]=reactExports.useState(!1),[Br,Lr]=reactExports.useState(!1),[jr,Ur]=reactExports.useState(!1),[Gr,Yr]=reactExports.useState(),Qr=useAfterLoginRedirection(),Wn=Qr&&new URL(Qr).pathname.includes("/play"),[ga,eo]=reactExports.useState(0),{flags:_i}=reactExports.useContext(FeatureFlagsContext),va=reactExports.useCallback(po=>{const mo=po&&isSocialLogin(po);getAnalytics().track(TrackingEvents.CLICK,{action:ClickEvents.LEARN_MORE,type:mo?"Learn more about Magic":"Learn more about wallets"}),mo?Lr(!0):Dr(!0)},[Dr,Lr,Nr]),io=reactExports.useCallback(()=>{Dr(!1),Lr(!1)},[Dr,Lr]),no=reactExports.useCallback(()=>{Lr(!Br)},[Lr,Br]),so=reactExports.useCallback(async()=>{getAnalytics().track(TrackingEvents.LOGIN_CLICK,{type:"guest"}),await wait(800)},[]),ao=reactExports.useMemo(()=>{if(Qr){const po=new URL(Qr);return po.searchParams.append("guest","true"),po.toString()}return""},[Qr]),fo=reactExports.useCallback(async po=>{var $o;const mo=isSocialLogin(po);if(Yr(po),getAnalytics().track(TrackingEvents.LOGIN_CLICK,{method:po,type:mo?ConnectionType.WEB2:ConnectionType.WEB3}),mo)Mr(ConnectionModalState.LOADING_MAGIC),await wait(800),await connectToProvider(po);else try{Ur(!0),Mr(ConnectionModalState.CONNECTING_WALLET);const Xn=await connectToProvider(po);if(await wait(800),Mr(ConnectionModalState.WAITING_FOR_SIGNATURE),await getIdentitySignature((($o=Xn.account)==null?void 0:$o.toLowerCase())??"",Xn.provider),getAnalytics().track(TrackingEvents.LOGIN_SUCCESS,{eth_address:Xn.account}),getAnalytics().identify({ethAddress:Xn.account}),await wait(800),_i[FeatureFlagsKeys.SIMPLIFIED_AVATAR_SETUP]&&Xn.account&&!await fetchProfile(Xn.account)){window.location.href="/auth/setup"+(Qr?`?redirectTo=${Qr}`:""),Ur(!1);return}Qr?window.location.href=decodeURIComponent(Qr):window.location.href="/",Ur(!1)}catch(Xn){console.log("Error",JSON.stringify(Xn)),getAnalytics().track(TrackingEvents.LOGIN_ERROR,{error:isErrorWithMessage(Xn)?Xn.message:Xn}),Mr(ConnectionModalState.ERROR)}},[Mr,Ur,Yr,Qr,$r,_i]),lo=reactExports.useCallback(()=>{Ur(!1),Yr(void 0),Mr(ConnectionModalState.CONNECTING_WALLET)},[Ur]),oo=reactExports.useCallback(()=>{Gr&&fo(Gr)},[Gr]);return reactExports.useEffect(()=>{const po=setInterval(()=>{eo(mo=>mo===BACKGROUND_IMAGES.length-1?0:mo+1)},5e3);return()=>{clearInterval(po)}},[]),jsxRuntimeExports.jsxs("main",{className:styles.main,children:[jsxRuntimeExports.jsx("div",{className:styles.background,style:{backgroundImage:`url(${BACKGROUND_IMAGES[ga]})`}}),jsxRuntimeExports.jsx(WalletInformationModal,{open:Nr,onClose:io}),jsxRuntimeExports.jsx(MagicInformationModal,{open:Br,onClose:no}),jsxRuntimeExports.jsx(ConnectionModal,{open:jr,state:pr,onClose:lo,onTryAgain:oo,providerType:Gr?fromConnectionOptionToProviderType(Gr):null}),jsxRuntimeExports.jsx("div",{className:styles.left,children:jsxRuntimeExports.jsxs("div",{className:styles.leftInfo,children:[jsxRuntimeExports.jsx(Connection,{onLearnMore:va,onConnect:fo,loadingOption:Gr,socialOptions:{primary:ConnectionOptionType.GOOGLE,secondary:[ConnectionOptionType.DISCORD,ConnectionOptionType.APPLE,ConnectionOptionType.X]},web3Options:{primary:ConnectionOptionType.METAMASK,secondary:[ConnectionOptionType.FORTMATIC,ConnectionOptionType.COINBASE,ConnectionOptionType.WALLET_CONNECT]}}),Wn&&jsxRuntimeExports.jsxs("div",{className:styles.guestInfo,children:["Quick dive?"," ",jsxRuntimeExports.jsx("a",{href:ao,onClick:so,children:"Explore as a guest"})]})]})})]})};(function(){const $r=window.analytics=window.analytics||[];if(!$r.initialize){if($r.invoked){window.console&&console.error&&console.error("Segment snippet included twice.");return}$r.invoked=!0,$r.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","user","page","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware"],$r.factory=function(pr){return function(){const Mr=Array.prototype.slice.call(arguments);return Mr.unshift(pr),$r.push(Mr),$r}};for(let pr=0;pr<$r.methods.length;pr++){const Mr=$r.methods[pr];$r[Mr]=$r.factory(Mr)}$r.load=function(pr,Mr){const Nr=document.createElement("script");Nr.type="text/javascript",Nr.async=!0,Nr.src="https://cdn.segment.com/analytics.js/v1/"+pr+"/analytics.min.js";const Dr=document.getElementsByTagName("script")[0];Dr.parentNode.insertBefore(Nr,Dr),$r._loadOptions=Mr},$r.SNIPPET_VERSION="4.15.2"}})();const darkTheme="",index="";getAnalytics().load(config.get("SEGMENT_API_KEY"));ReactDOM.render(jsxRuntimeExports.jsx(React$5.StrictMode,{children:jsxRuntimeExports.jsx(FeatureFlagsProvider,{children:jsxRuntimeExports.jsx(BrowserRouter,{basename:"/auth",children:jsxRuntimeExports.jsxs(Routes,{children:[jsxRuntimeExports.jsx(Route,{path:"/login",element:jsxRuntimeExports.jsx(LoginPage,{})}),jsxRuntimeExports.jsx(Route,{path:"/callback",element:jsxRuntimeExports.jsx(CallbackPage,{})}),jsxRuntimeExports.jsx(Route,{path:"/requests/:requestId",element:jsxRuntimeExports.jsx(RequestPage,{})}),jsxRuntimeExports.jsx(Route,{path:"/setup",element:jsxRuntimeExports.jsx(SetupPage,{})}),jsxRuntimeExports.jsx(Route,{path:"*",element:jsxRuntimeExports.jsx(DefaultPage,{})})]})})})}),document.getElementById("root"));export{Buffer$G as B,R$5 as R,T$2 as T,__extends$3 as _,sha_jsExports as a,bnExports$4 as b,commonjsGlobal as c,require$$0$9 as d,eventsExports as e,getDefaultExportFromCjs$1 as f,getAugmentedNamespace as g,se$2 as h,a$1 as i,p$4 as j,ne$1 as n,oe$3 as o,process$1 as p,readableBrowserExports as r,sideChannel as s,te$3 as t,y$4 as y};
|
|
219
|
+
//# sourceMappingURL=index-dd4a7035.js.map
|