@imtbl/sdk 0.13.0-alpha.1 → 0.13.1-alpha
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/README.md +5 -2
- package/dist/blockchain_data.js +1 -1
- package/dist/browser/checkout.js +2 -2
- package/dist/checkout_sdk.d.ts +2 -1
- package/dist/checkout_widgets.d.ts +10 -2
- package/dist/checkout_widgets.js +1 -1
- package/dist/immutablex_client.js +1 -1
- package/dist/index.browser.js +3 -3
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +5 -4
- package/dist/index.d.ts +12 -3
- package/dist/index.js +5 -4
- package/dist/passport.js +3 -2
- package/package.json +1 -1
package/dist/index.browser.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).immutable={})}(this,(function(e){"use strict";var t;!function(e){e.PRODUCTION="production",e.SANDBOX="sandbox"}(t||(t={}));class n{environment;apiKey;constructor(e){this.environment=e.environment,this.apiKey=e.apiKey}}var r=Object.freeze({__proto__:null,get Environment(){return t},ImmutableConfiguration:n});function i(e,t){return function(){return e.apply(t,arguments)}}const{toString:a}=Object.prototype,{getPrototypeOf:o}=Object,s=(u=Object.create(null),e=>{const t=a.call(e);return u[t]||(u[t]=t.slice(8,-1).toLowerCase())});var u;const c=e=>(e=e.toLowerCase(),t=>s(t)===e),f=e=>t=>typeof t===e,{isArray:d}=Array,l=f("undefined");const p=c("ArrayBuffer");const h=f("string"),b=f("function"),m=f("number"),y=e=>null!==e&&"object"==typeof e,g=e=>{if("object"!==s(e))return!1;const t=o(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},v=c("Date"),w=c("File"),_=c("Blob"),E=c("FileList"),T=c("URLSearchParams");function A(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),d(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function R(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const S="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,k=e=>!l(e)&&e!==S;const O=(I="undefined"!=typeof Uint8Array&&o(Uint8Array),e=>I&&e instanceof I);var I;const x=c("HTMLFormElement"),C=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),M=c("RegExp"),N=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};A(n,((n,i)=>{!1!==t(n,i,e)&&(r[i]=n)})),Object.defineProperties(e,r)},P="abcdefghijklmnopqrstuvwxyz",B="0123456789",D={DIGIT:B,ALPHA:P,ALPHA_DIGIT:P+P.toUpperCase()+B};const F=c("AsyncFunction");var L={isArray:d,isArrayBuffer:p,isBuffer:function(e){return null!==e&&!l(e)&&null!==e.constructor&&!l(e.constructor)&&b(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||b(e.append)&&("formdata"===(t=s(e))||"object"===t&&b(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&p(e.buffer),t},isString:h,isNumber:m,isBoolean:e=>!0===e||!1===e,isObject:y,isPlainObject:g,isUndefined:l,isDate:v,isFile:w,isBlob:_,isRegExp:M,isFunction:b,isStream:e=>y(e)&&b(e.pipe),isURLSearchParams:T,isTypedArray:O,isFileList:E,forEach:A,merge:function e(){const{caseless:t}=k(this)&&this||{},n={},r=(r,i)=>{const a=t&&R(n,i)||i;g(n[a])&&g(r)?n[a]=e(n[a],r):g(r)?n[a]=e({},r):d(r)?n[a]=r.slice():n[a]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&A(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(A(t,((t,r)=>{n&&b(t)?e[r]=i(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,a,s;const u={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)s=i[a],r&&!r(s,e,t)||u[s]||(t[s]=e[s],u[s]=!0);e=!1!==n&&o(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:s,kindOfTest:c,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(d(e))return e;let t=e.length;if(!m(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:x,hasOwnProperty:C,hasOwnProp:C,reduceDescriptors:N,freezeMethods:e=>{N(e,((t,n)=>{if(b(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];b(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return d(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:R,global:S,isContextDefined:k,ALPHABET:D,generateString:(e=16,t=D.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&b(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(y(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const i=d(e)?[]:{};return A(e,((e,t)=>{const a=n(e,r+1);!l(a)&&(i[t]=a)})),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:F,isThenable:e=>e&&(y(e)||b(e))&&b(e.then)&&b(e.catch)};function U(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}L.inherits(U,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:L.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const j=U.prototype,q={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{q[e]={value:e}})),Object.defineProperties(U,q),Object.defineProperty(j,"isAxiosError",{value:!0}),U.from=(e,t,n,r,i,a)=>{const o=Object.create(j);return L.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),U.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};function z(e){return L.isPlainObject(e)||L.isArray(e)}function H(e){return L.endsWith(e,"[]")?e.slice(0,-2):e}function V(e,t,n){return e?e.concat(t).map((function(e,t){return e=H(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const G=L.toFlatObject(L,{},null,(function(e){return/^is[A-Z]/.test(e)}));function K(e,t,n){if(!L.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=L.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!L.isUndefined(t[e])}))).metaTokens,i=n.visitor||c,a=n.dots,o=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&L.isSpecCompliantForm(t);if(!L.isFunction(i))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(L.isDate(e))return e.toISOString();if(!s&&L.isBlob(e))throw new U("Blob is not supported. Use a Buffer instead.");return L.isArrayBuffer(e)||L.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,i){let s=e;if(e&&!i&&"object"==typeof e)if(L.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(L.isArray(e)&&function(e){return L.isArray(e)&&!e.some(z)}(e)||(L.isFileList(e)||L.endsWith(n,"[]"))&&(s=L.toArray(e)))return n=H(n),s.forEach((function(e,r){!L.isUndefined(e)&&null!==e&&t.append(!0===o?V([n],r,a):null===o?n:n+"[]",u(e))})),!1;return!!z(e)||(t.append(V(i,n,a),u(e)),!1)}const f=[],d=Object.assign(G,{defaultVisitor:c,convertValue:u,isVisitable:z});if(!L.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!L.isUndefined(n)){if(-1!==f.indexOf(n))throw Error("Circular reference detected in "+r.join("."));f.push(n),L.forEach(n,(function(n,a){!0===(!(L.isUndefined(n)||null===n)&&i.call(t,n,L.isString(a)?a.trim():a,r,d))&&e(n,r?r.concat(a):[a])})),f.pop()}}(e),t}function W(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function X(e,t){this._pairs=[],e&&K(e,this,t)}const $=X.prototype;function J(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Y(e,t,n){if(!t)return e;const r=n&&n.encode||J,i=n&&n.serialize;let a;if(a=i?i(t,n):L.isURLSearchParams(t)?t.toString():new X(t,n).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}$.append=function(e,t){this._pairs.push([e,t])},$.toString=function(e){const t=e?function(t){return e.call(this,t,W)}:W;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var Q=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){L.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Z={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var ee={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:X,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&("undefined"!=typeof window&&"undefined"!=typeof document)})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};function te(e){function t(e,n,r,i){let a=e[i++];const o=Number.isFinite(+a),s=i>=e.length;if(a=!a&&L.isArray(r)?r.length:a,s)return L.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!o;r[a]&&L.isObject(r[a])||(r[a]=[]);return t(e,n,r[a],i)&&L.isArray(r[a])&&(r[a]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}(r[a])),!o}if(L.isFormData(e)&&L.isFunction(e.entries)){const n={};return L.forEachEntry(e,((e,r)=>{t(function(e){return L.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const ne={"Content-Type":void 0};const re={transitional:Z,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=L.isObject(e);i&&L.isHTMLForm(e)&&(e=new FormData(e));if(L.isFormData(e))return r&&r?JSON.stringify(te(e)):e;if(L.isArrayBuffer(e)||L.isBuffer(e)||L.isStream(e)||L.isFile(e)||L.isBlob(e))return e;if(L.isArrayBufferView(e))return e.buffer;if(L.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return K(e,new ee.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return ee.isNode&&L.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=L.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return K(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(L.isString(e))try{return(t||JSON.parse)(e),L.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||re.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&L.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw U.from(e,U.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ee.classes.FormData,Blob:ee.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};L.forEach(["delete","get","head"],(function(e){re.headers[e]={}})),L.forEach(["post","put","patch"],(function(e){re.headers[e]=L.merge(ne)}));var ie=re;const ae=L.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const oe=Symbol("internals");function se(e){return e&&String(e).trim().toLowerCase()}function ue(e){return!1===e||null==e?e:L.isArray(e)?e.map(ue):String(e)}function ce(e,t,n,r,i){return L.isFunction(r)?r.call(this,t,n):(i&&(t=n),L.isString(t)?L.isString(r)?-1!==t.indexOf(r):L.isRegExp(r)?r.test(t):void 0:void 0)}let fe=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=se(t);if(!i)throw new Error("header name must be a non-empty string");const a=L.findKey(r,i);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=ue(e))}const a=(e,t)=>L.forEach(e,((e,n)=>i(e,n,t)));return L.isPlainObject(e)||e instanceof this.constructor?a(e,t):L.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?a((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&ae[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&i(t,e,n),this}get(e,t){if(e=se(e)){const n=L.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(L.isFunction(t))return t.call(this,e,n);if(L.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=se(e)){const n=L.findKey(this,e);return!(!n||void 0===this[n]||t&&!ce(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=se(e)){const i=L.findKey(n,e);!i||t&&!ce(0,n[i],i,t)||(delete n[i],r=!0)}}return L.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!ce(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return L.forEach(this,((r,i)=>{const a=L.findKey(n,i);if(a)return t[a]=ue(r),void delete t[i];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(i):String(i).trim();o!==i&&delete t[i],t[o]=ue(r),n[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return L.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&L.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[oe]=this[oe]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=se(e);t[r]||(!function(e,t){const n=L.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})}))}(n,e),t[r]=!0)}return L.isArray(e)?e.forEach(r):r(e),this}};fe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),L.freezeMethods(fe.prototype),L.freezeMethods(fe);var de=fe;function le(e,t){const n=this||ie,r=t||n,i=de.from(r.headers);let a=r.data;return L.forEach(e,(function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)})),i.normalize(),a}function pe(e){return!(!e||!e.__CANCEL__)}function he(e,t,n){U.call(this,null==e?"canceled":e,U.ERR_CANCELED,t,n),this.name="CanceledError"}L.inherits(he,U,{__CANCEL__:!0});var be=ee.isStandardBrowserEnv?{write:function(e,t,n,r,i,a){const o=[];o.push(e+"="+encodeURIComponent(t)),L.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),L.isString(r)&&o.push("path="+r),L.isString(i)&&o.push("domain="+i),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function me(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var ye=ee.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=L.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function ge(e,t){let n=0;const r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,a=0,o=0;return t=void 0!==t?t:1e3,function(s){const u=Date.now(),c=r[o];i||(i=u),n[a]=s,r[a]=u;let f=o,d=0;for(;f!==a;)d+=n[f++],f%=e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),u-i<t)return;const l=c&&u-c;return l?Math.round(1e3*d/l):void 0}}(50,250);return i=>{const a=i.loaded,o=i.lengthComputable?i.total:void 0,s=a-n,u=r(s);n=a;const c={loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:u||void 0,estimated:u&&o&&a<=o?(o-a)/u:void 0,event:i};c[t?"download":"upload"]=!0,e(c)}}var ve="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const i=de.from(e.headers).normalize(),a=e.responseType;let o;function s(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}L.isFormData(r)&&(ee.isStandardBrowserEnv||ee.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let u=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+n))}const c=me(e.baseURL,e.url);function f(){if(!u)return;const r=de.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new U("Request failed with status code "+n.status,[U.ERR_BAD_REQUEST,U.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),s()}),(function(e){n(e),s()}),{data:a&&"text"!==a&&"json"!==a?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:r,config:e,request:u}),u=null}if(u.open(e.method.toUpperCase(),Y(c,e.params,e.paramsSerializer),!0),u.timeout=e.timeout,"onloadend"in u?u.onloadend=f:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(f)},u.onabort=function(){u&&(n(new U("Request aborted",U.ECONNABORTED,e,u)),u=null)},u.onerror=function(){n(new U("Network Error",U.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||Z;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new U(t,r.clarifyTimeoutError?U.ETIMEDOUT:U.ECONNABORTED,e,u)),u=null},ee.isStandardBrowserEnv){const t=(e.withCredentials||ye(c))&&e.xsrfCookieName&&be.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===r&&i.setContentType(null),"setRequestHeader"in u&&L.forEach(i.toJSON(),(function(e,t){u.setRequestHeader(t,e)})),L.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),a&&"json"!==a&&(u.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&u.addEventListener("progress",ge(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",ge(e.onUploadProgress)),(e.cancelToken||e.signal)&&(o=t=>{u&&(n(!t||t.type?new he(null,e,u):t),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o)));const d=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(c);d&&-1===ee.protocols.indexOf(d)?n(new U("Unsupported protocol "+d+":",U.ERR_BAD_REQUEST,e)):u.send(r||null)}))};const we={http:null,xhr:ve};L.forEach(we,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var _e=e=>{e=L.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let i=0;i<t&&(n=e[i],!(r=L.isString(n)?we[n.toLowerCase()]:n));i++);if(!r){if(!1===r)throw new U(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(L.hasOwnProp(we,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`)}if(!L.isFunction(r))throw new TypeError("adapter is not a function");return r};function Ee(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new he(null,e)}function Te(e){Ee(e),e.headers=de.from(e.headers),e.data=le.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return _e(e.adapter||ie.adapter)(e).then((function(t){return Ee(e),t.data=le.call(e,e.transformResponse,t),t.headers=de.from(t.headers),t}),(function(t){return pe(t)||(Ee(e),t&&t.response&&(t.response.data=le.call(e,e.transformResponse,t.response),t.response.headers=de.from(t.response.headers))),Promise.reject(t)}))}const Ae=e=>e instanceof de?e.toJSON():e;function Re(e,t){t=t||{};const n={};function r(e,t,n){return L.isPlainObject(e)&&L.isPlainObject(t)?L.merge.call({caseless:n},e,t):L.isPlainObject(t)?L.merge({},t):L.isArray(t)?t.slice():t}function i(e,t,n){return L.isUndefined(t)?L.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function a(e,t){if(!L.isUndefined(t))return r(void 0,t)}function o(e,t){return L.isUndefined(t)?L.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,i,a){return a in t?r(n,i):a in e?r(void 0,n):void 0}const u={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(e,t)=>i(Ae(e),Ae(t),!0)};return L.forEach(Object.keys(Object.assign({},e,t)),(function(r){const a=u[r]||i,o=a(e[r],t[r],r);L.isUndefined(o)&&a!==s||(n[r]=o)})),n}const Se="1.4.0",ke={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{ke[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Oe={};ke.transitional=function(e,t,n){function r(e,t){return"[Axios v1.4.0] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,a)=>{if(!1===e)throw new U(r(i," has been removed"+(t?" in "+t:"")),U.ERR_DEPRECATED);return t&&!Oe[i]&&(Oe[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,a)}};var Ie={assertOptions:function(e,t,n){if("object"!=typeof e)throw new U("options must be an object",U.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const a=r[i],o=t[a];if(o){const t=e[a],n=void 0===t||o(t,a,e);if(!0!==n)throw new U("option "+a+" must be "+n,U.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new U("Unknown option "+a,U.ERR_BAD_OPTION)}},validators:ke};const xe=Ie.validators;let Ce=class{constructor(e){this.defaults=e,this.interceptors={request:new Q,response:new Q}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Re(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;let a;void 0!==n&&Ie.assertOptions(n,{silentJSONParsing:xe.transitional(xe.boolean),forcedJSONParsing:xe.transitional(xe.boolean),clarifyTimeoutError:xe.transitional(xe.boolean)},!1),null!=r&&(L.isFunction(r)?t.paramsSerializer={serialize:r}:Ie.assertOptions(r,{encode:xe.function,serialize:xe.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase(),a=i&&L.merge(i.common,i[t.method]),a&&L.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=de.concat(a,i);const o=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));const u=[];let c;this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)}));let f,d=0;if(!s){const e=[Te.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,u),f=e.length,c=Promise.resolve(t);d<f;)c=c.then(e[d++],e[d++]);return c}f=o.length;let l=t;for(d=0;d<f;){const e=o[d++],t=o[d++];try{l=e(l)}catch(e){t.call(this,e);break}}try{c=Te.call(this,l)}catch(e){return Promise.reject(e)}for(d=0,f=u.length;d<f;)c=c.then(u[d++],u[d++]);return c}getUri(e){return Y(me((e=Re(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}};L.forEach(["delete","get","head","options"],(function(e){Ce.prototype[e]=function(t,n){return this.request(Re(n||{},{method:e,url:t,data:(n||{}).data}))}})),L.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,i){return this.request(Re(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ce.prototype[e]=t(),Ce.prototype[e+"Form"]=t(!0)}));var Me=Ce;var Ne=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,i){n.reason||(n.reason=new he(e,r,i),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let t;const n=new e((function(e){t=e}));return{token:n,cancel:t}}};const Pe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Pe).forEach((([e,t])=>{Pe[t]=e}));var Be=Pe;const De=function e(t){const n=new Me(t),r=i(Me.prototype.request,n);return L.extend(r,Me.prototype,n,{allOwnKeys:!0}),L.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Re(t,n))},r}(ie);De.Axios=Me,De.CanceledError=he,De.CancelToken=Ne,De.isCancel=pe,De.VERSION=Se,De.toFormData=K,De.AxiosError=U,De.Cancel=De.CanceledError,De.all=function(e){return Promise.all(e)},De.spread=function(e){return function(t){return e.apply(null,t)}},De.isAxiosError=function(e){return L.isObject(e)&&!0===e.isAxiosError},De.mergeConfig=Re,De.AxiosHeaders=de,De.formToJSON=e=>te(L.isHTMLForm(e)?new FormData(e):e),De.HttpStatusCode=Be,De.default=De;var Fe=De;const Le="https://api.sandbox.immutable.com".replace(/\/+$/,"");let Ue=class{basePath;axios;configuration;constructor(e,t=Le,n=Fe){this.basePath=t,this.axios=n,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}},je=class extends Error{field;name="RequiredError";constructor(e,t){super(t),this.field=e}};const qe="https://example.com",ze=function(e,t,n){if(null==n)throw new je(t,`Required parameter ${t} was null or undefined when calling ${e}.`)};function He(e,t,n=""){"object"==typeof t?Array.isArray(t)?t.forEach((t=>He(e,t,n))):Object.keys(t).forEach((r=>He(e,t[r],`${n}${""!==n?".":""}${r}`))):e.has(n)?e.append(n,t):e.set(n,t)}const Ve=function(e,...t){const n=new URLSearchParams(e.search);He(n,t),e.search=n.toString()},Ge=function(e,t,n){const r="string"!=typeof e;return(r&&n&&n.isJsonMime?n.isJsonMime(t.headers["Content-Type"]):r)?JSON.stringify(void 0!==e?e:{}):e||""},Ke=function(e){return e.pathname+e.search+e.hash},We=function(e,t,n,r){return(i=t,a=n)=>{const o={...e.options,url:(r?.basePath||a)+e.url};return i.request(o)}},Xe=function(e){return{getActivity:async(t,n,r={})=>{ze("getActivity","chainName",t),ze("getActivity","activityId",n);const i="/v1/chains/{chain_name}/activities/{activity_id}".replace("{chain_name}",encodeURIComponent(String(t))).replace("{activity_id}",encodeURIComponent(String(n))),a=new URL(i,qe);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...r};Ve(a,{});let u=o&&o.headers?o.headers:{};return s.headers={...u,...r.headers},{url:Ke(a),options:s}},listActivities:async(t,n,r,i,a,o,s,u,c,f,d={})=>{ze("listActivities","chainName",t);const l="/v1/chains/{chain_name}/activities".replace("{chain_name}",encodeURIComponent(String(t))),p=new URL(l,qe);let h;e&&(h=e.baseOptions);const b={method:"GET",...h,...d},m={};void 0!==n&&(m.contract_address=n),void 0!==r&&(m.token_id=r),void 0!==i&&(m.account_address=i),void 0!==a&&(m.activity_type=a),void 0!==o&&(m.from_indexed_at=o instanceof Date?o.toISOString():o),void 0!==s&&(m.to_indexed_at=s instanceof Date?s.toISOString():s),void 0!==u&&(m.transaction_hash=u),void 0!==c&&(m.page_cursor=c),void 0!==f&&(m.page_size=f),Ve(p,m);let y=h&&h.headers?h.headers:{};return b.headers={...y,...d.headers},{url:Ke(p),options:b}}}},$e=function(e){const t=Xe(e);return{async getActivity(n,r,i){const a=await t.getActivity(n,r,i);return We(a,Fe,Le,e)},async listActivities(n,r,i,a,o,s,u,c,f,d,l){const p=await t.listActivities(n,r,i,a,o,s,u,c,f,d,l);return We(p,Fe,Le,e)}}};class Je extends Ue{getActivity(e,t){return $e(this.configuration).getActivity(e.chainName,e.activityId,t).then((e=>e(this.axios,this.basePath)))}listActivities(e,t){return $e(this.configuration).listActivities(e.chainName,e.contractAddress,e.tokenId,e.accountAddress,e.activityType,e.fromIndexedAt,e.toIndexedAt,e.transactionHash,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}}const Ye=function(e){return{listChains:async(t,n,r={})=>{const i=new URL("/v1/chains",qe);let a;e&&(a=e.baseOptions);const o={method:"GET",...a,...r},s={};void 0!==t&&(s.page_cursor=t),void 0!==n&&(s.page_size=n),Ve(i,s);let u=a&&a.headers?a.headers:{};return o.headers={...u,...r.headers},{url:Ke(i),options:o}}}},Qe=function(e){const t=Ye(e);return{async listChains(n,r,i){const a=await t.listChains(n,r,i);return We(a,Fe,Le,e)}}};class Ze extends Ue{listChains(e={},t){return Qe(this.configuration).listChains(e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}}const et=function(e){return{getCollection:async(t,n,r={})=>{ze("getCollection","contractAddress",t),ze("getCollection","chainName",n);const i="/v1/chains/{chain_name}/collections/{contract_address}".replace("{contract_address}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(n))),a=new URL(i,qe);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...r};Ve(a,{});let u=o&&o.headers?o.headers:{};return s.headers={...u,...r.headers},{url:Ke(a),options:s}},listCollections:async(t,n,r,i={})=>{ze("listCollections","chainName",t);const a="/v1/chains/{chain_name}/collections".replace("{chain_name}",encodeURIComponent(String(t))),o=new URL(a,qe);let s;e&&(s=e.baseOptions);const u={method:"GET",...s,...i},c={};void 0!==n&&(c.page_cursor=n),void 0!==r&&(c.page_size=r),Ve(o,c);let f=s&&s.headers?s.headers:{};return u.headers={...f,...i.headers},{url:Ke(o),options:u}}}},tt=function(e){const t=et(e);return{async getCollection(n,r,i){const a=await t.getCollection(n,r,i);return We(a,Fe,Le,e)},async listCollections(n,r,i,a){const o=await t.listCollections(n,r,i,a);return We(o,Fe,Le,e)}}};class nt extends Ue{getCollection(e,t){return tt(this.configuration).getCollection(e.contractAddress,e.chainName,t).then((e=>e(this.axios,this.basePath)))}listCollections(e,t){return tt(this.configuration).listCollections(e.chainName,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}}const rt=function(e){return{listNFTOwners:async(t,n,r,i,a,o={})=>{ze("listNFTOwners","contractAddress",t),ze("listNFTOwners","tokenId",n),ze("listNFTOwners","chainName",r);const s="/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}/owners".replace("{contract_address}",encodeURIComponent(String(t))).replace("{token_id}",encodeURIComponent(String(n))).replace("{chain_name}",encodeURIComponent(String(r))),u=new URL(s,qe);let c;e&&(c=e.baseOptions);const f={method:"GET",...c,...o},d={};void 0!==i&&(d.page_cursor=i),void 0!==a&&(d.page_size=a),Ve(u,d);let l=c&&c.headers?c.headers:{};return f.headers={...l,...o.headers},{url:Ke(u),options:f}}}},it=function(e){const t=rt(e);return{async listNFTOwners(n,r,i,a,o,s){const u=await t.listNFTOwners(n,r,i,a,o,s);return We(u,Fe,Le,e)}}};class at extends Ue{listNFTOwners(e,t){return it(this.configuration).listNFTOwners(e.contractAddress,e.tokenId,e.chainName,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}}const ot=function(e){return{getNFT:async(t,n,r,i={})=>{ze("getNFT","contractAddress",t),ze("getNFT","tokenId",n),ze("getNFT","chainName",r);const a="/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}".replace("{contract_address}",encodeURIComponent(String(t))).replace("{token_id}",encodeURIComponent(String(n))).replace("{chain_name}",encodeURIComponent(String(r))),o=new URL(a,qe);let s;e&&(s=e.baseOptions);const u={method:"GET",...s,...i};Ve(o,{});let c=s&&s.headers?s.headers:{};return u.headers={...c,...i.headers},{url:Ke(o),options:u}},listNFTs:async(t,n,r,i,a={})=>{ze("listNFTs","contractAddress",t),ze("listNFTs","chainName",n);const o="/v1/chains/{chain_name}/collections/{contract_address}/nfts".replace("{contract_address}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(n))),s=new URL(o,qe);let u;e&&(u=e.baseOptions);const c={method:"GET",...u,...a},f={};void 0!==r&&(f.page_cursor=r),void 0!==i&&(f.page_size=i),Ve(s,f);let d=u&&u.headers?u.headers:{};return c.headers={...d,...a.headers},{url:Ke(s),options:c}},listNFTsByAccountAddress:async(t,n,r,i,a,o={})=>{ze("listNFTsByAccountAddress","accountAddress",t),ze("listNFTsByAccountAddress","chainName",n);const s="/v1/chains/{chain_name}/accounts/{account_address}/nfts".replace("{account_address}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(n))),u=new URL(s,qe);let c;e&&(c=e.baseOptions);const f={method:"GET",...c,...o},d={};void 0!==r&&(d.contract_address=r),void 0!==i&&(d.page_cursor=i),void 0!==a&&(d.page_size=a),Ve(u,d);let l=c&&c.headers?c.headers:{};return f.headers={...l,...o.headers},{url:Ke(u),options:f}}}},st=function(e){const t=ot(e);return{async getNFT(n,r,i,a){const o=await t.getNFT(n,r,i,a);return We(o,Fe,Le,e)},async listNFTs(n,r,i,a,o){const s=await t.listNFTs(n,r,i,a,o);return We(s,Fe,Le,e)},async listNFTsByAccountAddress(n,r,i,a,o,s){const u=await t.listNFTsByAccountAddress(n,r,i,a,o,s);return We(u,Fe,Le,e)}}};class ut extends Ue{getNFT(e,t){return st(this.configuration).getNFT(e.contractAddress,e.tokenId,e.chainName,t).then((e=>e(this.axios,this.basePath)))}listNFTs(e,t){return st(this.configuration).listNFTs(e.contractAddress,e.chainName,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}listNFTsByAccountAddress(e,t){return st(this.configuration).listNFTsByAccountAddress(e.accountAddress,e.chainName,e.contractAddress,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}}const ct=function(e){return{createListing:async(t,n,r={})=>{ze("createListing","chainName",t),ze("createListing","createListingRequestBody",n);const i="/v1/chains/{chain_name}/orders/listings".replace("{chain_name}",encodeURIComponent(String(t))),a=new URL(i,qe);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...r},u={};u["Content-Type"]="application/json",Ve(a,{});let c=o&&o.headers?o.headers:{};return s.headers={...u,...c,...r.headers},s.data=Ge(n,s,e),{url:Ke(a),options:s}},fulfillmentData:async(t,n,r={})=>{ze("fulfillmentData","chainName",t),ze("fulfillmentData","fulfillmentDataRequestInner",n);const i="/v1/chains/{chain_name}/orders/fulfillment_data".replace("{chain_name}",encodeURIComponent(String(t))),a=new URL(i,qe);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...r},u={};u["Content-Type"]="application/json",Ve(a,{});let c=o&&o.headers?o.headers:{};return s.headers={...u,...c,...r.headers},s.data=Ge(n,s,e),{url:Ke(a),options:s}},getListing:async(t,n,r={})=>{ze("getListing","chainName",t),ze("getListing","listingId",n);const i="/v1/chains/{chain_name}/orders/listings/{listing_id}".replace("{chain_name}",encodeURIComponent(String(t))).replace("{listing_id}",encodeURIComponent(String(n))),a=new URL(i,qe);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...r};Ve(a,{});let u=o&&o.headers?o.headers:{};return s.headers={...u,...r.headers},{url:Ke(a),options:s}},listListings:async(t,n,r,i,a,o,s,u,c,f={})=>{ze("listListings","chainName",t);const d="/v1/chains/{chain_name}/orders/listings".replace("{chain_name}",encodeURIComponent(String(t))),l=new URL(d,qe);let p;e&&(p=e.baseOptions);const h={method:"GET",...p,...f},b={};void 0!==n&&(b.status=n),void 0!==r&&(b.sell_item_contract_address=r),void 0!==i&&(b.buy_item_contract_address=i),void 0!==a&&(b.sell_item_token_id=a),void 0!==o&&(b.page_size=o),void 0!==s&&(b.sort_by=s),void 0!==u&&(b.sort_direction=u),void 0!==c&&(b.page_cursor=c),Ve(l,b);let m=p&&p.headers?p.headers:{};return h.headers={...m,...f.headers},{url:Ke(l),options:h}}}},ft=function(e){const t=ct(e);return{async createListing(n,r,i){const a=await t.createListing(n,r,i);return We(a,Fe,Le,e)},async fulfillmentData(n,r,i){const a=await t.fulfillmentData(n,r,i);return We(a,Fe,Le,e)},async getListing(n,r,i){const a=await t.getListing(n,r,i);return We(a,Fe,Le,e)},async listListings(n,r,i,a,o,s,u,c,f,d){const l=await t.listListings(n,r,i,a,o,s,u,c,f,d);return We(l,Fe,Le,e)}}};class dt extends Ue{createListing(e,t){return ft(this.configuration).createListing(e.chainName,e.createListingRequestBody,t).then((e=>e(this.axios,this.basePath)))}fulfillmentData(e,t){return ft(this.configuration).fulfillmentData(e.chainName,e.fulfillmentDataRequestInner,t).then((e=>e(this.axios,this.basePath)))}getListing(e,t){return ft(this.configuration).getListing(e.chainName,e.listingId,t).then((e=>e(this.axios,this.basePath)))}listListings(e,t){return ft(this.configuration).listListings(e.chainName,e.status,e.sellItemContractAddress,e.buyItemContractAddress,e.sellItemTokenId,e.pageSize,e.sortBy,e.sortDirection,e.pageCursor,t).then((e=>e(this.axios,this.basePath)))}}const lt=function(e){return{createCounterfactualAddress:async(t,n={})=>{ze("createCounterfactualAddress","createCounterfactualAddressRequest",t);const r=new URL("/passport-mr/v1/counterfactual-address",qe);let i;e&&(i=e.baseOptions);const a={method:"POST",...i,...n},o={};await async function(e,t){if(t&&t.accessToken){const n="function"==typeof t.accessToken?await t.accessToken():await t.accessToken;e.Authorization="Bearer "+n}}(o,e),o["Content-Type"]="application/json",Ve(r,{});let s=i&&i.headers?i.headers:{};return a.headers={...o,...s,...n.headers},a.data=Ge(t,a,e),{url:Ke(r),options:a}}}},pt=function(e){const t=lt(e);return{async createCounterfactualAddress(n,r){const i=await t.createCounterfactualAddress(n,r);return We(i,Fe,Le,e)}}};class ht extends Ue{createCounterfactualAddress(e,t){return pt(this.configuration).createCounterfactualAddress(e.createCounterfactualAddressRequest,t).then((e=>e(this.axios,this.basePath)))}}const bt=function(e){return{getERC20Token:async(t,n,r={})=>{ze("getERC20Token","contractAddress",t),ze("getERC20Token","chainName",n);const i="/v1/chains/{chain_name}/tokens/{contract_address}".replace("{contract_address}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(n))),a=new URL(i,qe);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...r};Ve(a,{});let u=o&&o.headers?o.headers:{};return s.headers={...u,...r.headers},{url:Ke(a),options:s}},listERC20Tokens:async(t,n,r,i={})=>{ze("listERC20Tokens","chainName",t);const a="/v1/chains/{chain_name}/tokens".replace("{chain_name}",encodeURIComponent(String(t))),o=new URL(a,qe);let s;e&&(s=e.baseOptions);const u={method:"GET",...s,...i},c={};void 0!==n&&(c.page_cursor=n),void 0!==r&&(c.page_size=r),Ve(o,c);let f=s&&s.headers?s.headers:{};return u.headers={...f,...i.headers},{url:Ke(o),options:u}}}},mt=function(e){const t=bt(e);return{async getERC20Token(n,r,i){const a=await t.getERC20Token(n,r,i);return We(a,Fe,Le,e)},async listERC20Tokens(n,r,i,a){const o=await t.listERC20Tokens(n,r,i,a);return We(o,Fe,Le,e)}}};var yt=Object.freeze({__proto__:null,APIError400AllOfCodeEnum:{ValidationError:"VALIDATION_ERROR"},APIError401AllOfCodeEnum:{UnauthorisedRequest:"UNAUTHORISED_REQUEST"},APIError403AllOfCodeEnum:{AuthenticationError:"AUTHENTICATION_ERROR"},APIError404AllOfCodeEnum:{ResourceNotFound:"RESOURCE_NOT_FOUND"},APIError429AllOfCodeEnum:{TooManyRequestsError:"TOO_MANY_REQUESTS_ERROR"},APIError500AllOfCodeEnum:{InternalServerError:"INTERNAL_SERVER_ERROR"},ActivitiesApi:Je,ActivitiesApiAxiosParamCreator:Xe,ActivitiesApiFactory:function(e,t,n){const r=$e(e);return{getActivity:(e,i,a)=>r.getActivity(e,i,a).then((e=>e(n,t))),listActivities:(e,i,a,o,s,u,c,f,d,l,p)=>r.listActivities(e,i,a,o,s,u,c,f,d,l,p).then((e=>e(n,t)))}},ActivitiesApiFp:$e,ActivityType:{Mint:"mint",Burn:"burn",Transfer:"transfer",Sale:"sale",Deposit:"deposit",Withdrawal:"withdrawal"},ChainsApi:Ze,ChainsApiAxiosParamCreator:Ye,ChainsApiFactory:function(e,t,n){const r=Qe(e);return{listChains:(e,i,a)=>r.listChains(e,i,a).then((e=>e(n,t)))}},ChainsApiFp:Qe,CollectionContractType:{Erc721:"ERC721"},CollectionsApi:nt,CollectionsApiAxiosParamCreator:et,CollectionsApiFactory:function(e,t,n){const r=tt(e);return{getCollection:(e,i,a)=>r.getCollection(e,i,a).then((e=>e(n,t))),listCollections:(e,i,a,o)=>r.listCollections(e,i,a,o).then((e=>e(n,t)))}},CollectionsApiFp:tt,Configuration:class{apiKey;username;password;accessToken;basePath;baseOptions;formDataCtor;constructor(e={}){this.apiKey=e.apiKey,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.baseOptions=e.baseOptions,this.formDataCtor=e.formDataCtor}isJsonMime(e){const t=new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$","i");return null!==e&&(t.test(e)||"application/json-patch+json"===e.toLowerCase())}},CreateOrderProtocolDataOrderTypeEnum:{FullRestricted:"FULL_RESTRICTED"},ERC20ItemItemTypeEnum:{Erc20:"ERC20"},ERC721ItemItemTypeEnum:{Erc721:"ERC721"},FeeFeeTypeEnum:{Royalty:"ROYALTY"},NFTContractType:{Erc721:"ERC721"},NativeItemItemTypeEnum:{Native:"NATIVE"},NftOwnersApi:at,NftOwnersApiAxiosParamCreator:rt,NftOwnersApiFactory:function(e,t,n){const r=it(e);return{listNFTOwners:(e,i,a,o,s,u)=>r.listNFTOwners(e,i,a,o,s,u).then((e=>e(n,t)))}},NftOwnersApiFp:it,NftsApi:ut,NftsApiAxiosParamCreator:ot,NftsApiFactory:function(e,t,n){const r=st(e);return{getNFT:(e,i,a,o)=>r.getNFT(e,i,a,o).then((e=>e(n,t))),listNFTs:(e,i,a,o,s)=>r.listNFTs(e,i,a,o,s).then((e=>e(n,t))),listNFTsByAccountAddress:(e,i,a,o,s,u)=>r.listNFTsByAccountAddress(e,i,a,o,s,u).then((e=>e(n,t)))}},NftsApiFp:st,OrderStatus:{Pending:"PENDING",Active:"ACTIVE",Inactive:"INACTIVE",Filled:"FILLED",Cancelled:"CANCELLED",Expired:"EXPIRED"},OrdersApi:dt,OrdersApiAxiosParamCreator:ct,OrdersApiFactory:function(e,t,n){const r=ft(e);return{createListing:(e,i,a)=>r.createListing(e,i,a).then((e=>e(n,t))),fulfillmentData:(e,i,a)=>r.fulfillmentData(e,i,a).then((e=>e(n,t))),getListing:(e,i,a)=>r.getListing(e,i,a).then((e=>e(n,t))),listListings:(e,i,a,o,s,u,c,f,d,l)=>r.listListings(e,i,a,o,s,u,c,f,d,l).then((e=>e(n,t)))}},OrdersApiFp:ft,PassportApi:ht,PassportApiAxiosParamCreator:lt,PassportApiFactory:function(e,t,n){const r=pt(e);return{createCounterfactualAddress:(e,i)=>r.createCounterfactualAddress(e,i).then((e=>e(n,t)))}},PassportApiFp:pt,SaleFeeTypeEnum:{Royalty:"ROYALTY"},TokenContractType:{Erc20:"ERC20"},TokensApi:class extends Ue{getERC20Token(e,t){return mt(this.configuration).getERC20Token(e.contractAddress,e.chainName,t).then((e=>e(this.axios,this.basePath)))}listERC20Tokens(e,t){return mt(this.configuration).listERC20Tokens(e.chainName,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}},TokensApiAxiosParamCreator:bt,TokensApiFactory:function(e,t,n){const r=mt(e);return{getERC20Token:(e,i,a)=>r.getERC20Token(e,i,a).then((e=>e(n,t))),listERC20Tokens:(e,i,a,o)=>r.listERC20Tokens(e,i,a,o).then((e=>e(n,t)))}},TokensApiFp:mt});class gt{config;activitiesApi;chainsApi;collectionApi;nftOwnersApi;nftsApi;ordersApi;passportApi;constructor(e){this.config=e,this.activitiesApi=new Je(e.indexer),this.chainsApi=new Ze(e.indexer),this.collectionApi=new nt(e.indexer),this.nftOwnersApi=new at(e.indexer),this.nftsApi=new ut(e.indexer),this.ordersApi=new dt(e.orderBook),this.passportApi=new ht(e.passport)}}const vt={"x-sdk-version":"ts-immutable-sdk-0.13.0-alpha.1"},wt=({basePath:e,headers:t})=>{if(!e.trim())throw Error("basePath can not be empty");const n={basePath:e,baseOptions:{headers:{...vt,...t||{}}}};return new class{apiKey;username;password;accessToken;basePath;baseOptions;formDataCtor;constructor(e={}){this.apiKey=e.apiKey,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.baseOptions=e.baseOptions,this.formDataCtor=e.formDataCtor}isJsonMime(e){const t=new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$","i");return null!==e&&(t.test(e)||"application/json-patch+json"===e.toLowerCase())}}(n)},_t=()=>({indexer:wt({basePath:"https://indexer-mr.imtbl.com"}),orderBook:wt({basePath:"https://order-book-mr.imtbl.com"}),passport:wt({basePath:"https://api.immutable.com"})}),Et=()=>({indexer:wt({basePath:"https://api.sandbox.immutable.com"}),orderBook:wt({basePath:"https://api.sandbox.immutable.com"}),passport:wt({basePath:"https://api.sandbox.immutable.com"})});class Tt extends Error{code;details;link;traceId;constructor({message:e,code:t,details:n,link:r,trace_id:i}){super(e),this.code=t,this.details=n,this.link=r,this.traceId=i}}const At={sdkVersion:"ts-immutable-sdk-multi-rollup-api-client-0.13.0-alpha.1"},Rt=({basePath:e,headers:t})=>{if(!e.trim())throw Error("basePath can not be empty");const n={basePath:e,baseOptions:{headers:{...t||{},...At}}};return new yt.Configuration(n)},St=()=>Rt({basePath:"https://api.sandbox.immutable.com"});class kt{apiConfig;baseConfig;constructor({baseConfig:e,overrides:n}){if(this.baseConfig=e,n)this.apiConfig=Rt(n);else switch(e.environment){case t.SANDBOX:this.apiConfig=St();break;case t.PRODUCTION:this.apiConfig=Rt({basePath:"https://indexer-mr.imtbl.com"});break;default:this.apiConfig=St()}}}function Ot(e){if(Fe.isAxiosError(e)&&e.response){const t=e.response.data;return t.code&&t.message?new Tt({code:t.code,message:t.message,details:t.details||null,link:t.link||"",trace_id:t.trace_id||""}):new Tt({code:e.code??e.response?.status.toString()??"unknown_error_code",message:String(e),details:null,link:"",trace_id:""})}return new Tt({code:"unknown_error_code",message:String(e),details:null,link:"",trace_id:""})}var It=Object.freeze({__proto__:null,APIError:Tt,BlockchainData:class{config;activities;chains;collections;nfts;nftOwners;tokens;constructor(e){this.config=new kt(e),this.activities=new yt.ActivitiesApi(this.config.apiConfig),this.chains=new yt.ChainsApi(this.config.apiConfig),this.collections=new yt.CollectionsApi(this.config.apiConfig),this.nfts=new yt.NftsApi(this.config.apiConfig),this.nftOwners=new yt.NftOwnersApi(this.config.apiConfig),this.tokens=new yt.TokensApi(this.config.apiConfig)}async listActivities(e){return await this.activities.listActivities(e).then((e=>e.data)).catch((e=>{throw Ot(e)}))}async getActivity(e){return await this.activities.getActivity(e).then((e=>e.data)).catch((e=>{throw Ot(e)}))}async listChains(e){return await this.chains.listChains(e).then((e=>e.data)).catch((e=>{throw Ot(e)}))}async listCollections(e){return await this.collections.listCollections(e).then((e=>e.data)).catch((e=>{throw Ot(e)}))}async getCollection(e){return await this.collections.getCollection(e).then((e=>e.data)).catch((e=>{throw Ot(e)}))}async getNFT(e){return await this.nfts.getNFT(e).then((e=>e.data)).catch((e=>{throw Ot(e)}))}async listNFTs(e){return await this.nfts.listNFTs(e).then((e=>e.data)).catch((e=>{throw Ot(e)}))}async listNFTsByAccountAddress(e){return await this.nfts.listNFTsByAccountAddress(e).then((e=>e.data)).catch((e=>{throw Ot(e)}))}async listNFTOwners(e){return await this.nftOwners.listNFTOwners(e).then((e=>e.data)).catch((e=>{throw Ot(e)}))}async listTokens(e){return await this.tokens.listERC20Tokens(e).then((e=>e.data)).catch((e=>{throw Ot(e)}))}async getToken(e){return await this.tokens.getERC20Token(e).then((e=>e.data)).catch((e=>{throw Ot(e)}))}}}),xt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ct(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Mt(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){if(this instanceof e){var n=[null];return n.push.apply(n,arguments),new(Function.bind.apply(t,n))}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var Nt={exports:{}},Pt="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},Bt=[],Dt=[],Ft="undefined"!=typeof Uint8Array?Uint8Array:Array,Lt=!1;function Ut(){Lt=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)Bt[t]=e[t],Dt[e.charCodeAt(t)]=t;Dt["-".charCodeAt(0)]=62,Dt["_".charCodeAt(0)]=63}function jt(e,t,n){for(var r,i,a=[],o=t;o<n;o+=3)r=(e[o]<<16)+(e[o+1]<<8)+e[o+2],a.push(Bt[(i=r)>>18&63]+Bt[i>>12&63]+Bt[i>>6&63]+Bt[63&i]);return a.join("")}function qt(e){var t;Lt||Ut();for(var n=e.length,r=n%3,i="",a=[],o=16383,s=0,u=n-r;s<u;s+=o)a.push(jt(e,s,s+o>u?u:s+o));return 1===r?(t=e[n-1],i+=Bt[t>>2],i+=Bt[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=Bt[t>>10],i+=Bt[t>>4&63],i+=Bt[t<<2&63],i+="="),a.push(i),a.join("")}function zt(e,t,n,r,i){var a,o,s=8*i-r-1,u=(1<<s)-1,c=u>>1,f=-7,d=n?i-1:0,l=n?-1:1,p=e[t+d];for(d+=l,a=p&(1<<-f)-1,p>>=-f,f+=s;f>0;a=256*a+e[t+d],d+=l,f-=8);for(o=a&(1<<-f)-1,a>>=-f,f+=r;f>0;o=256*o+e[t+d],d+=l,f-=8);if(0===a)a=1-c;else{if(a===u)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,r),a-=c}return(p?-1:1)*o*Math.pow(2,a-r)}function Ht(e,t,n,r,i,a){var o,s,u,c=8*a-i-1,f=(1<<c)-1,d=f>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:a-1,h=r?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=f):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+d>=1?l/u:l*Math.pow(2,1-d))*u>=2&&(o++,u/=2),o+d>=f?(s=0,o=f):o+d>=1?(s=(t*u-1)*Math.pow(2,i),o+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[n+p]=255&s,p+=h,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;e[n+p]=255&o,p+=h,o/=256,c-=8);e[n+p-h]|=128*b}var Vt={}.toString,Gt=Array.isArray||function(e){return"[object Array]"==Vt.call(e)};$t.TYPED_ARRAY_SUPPORT=void 0===Pt.TYPED_ARRAY_SUPPORT||Pt.TYPED_ARRAY_SUPPORT;var Kt=Wt();function Wt(){return $t.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Xt(e,t){if(Wt()<t)throw new RangeError("Invalid typed array length");return $t.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=$t.prototype:(null===e&&(e=new $t(t)),e.length=t),e}function $t(e,t,n){if(!($t.TYPED_ARRAY_SUPPORT||this instanceof $t))return new $t(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return Qt(this,e)}return Jt(this,e,t,n)}function Jt(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);$t.TYPED_ARRAY_SUPPORT?(e=t).__proto__=$t.prototype:e=Zt(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!$t.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|nn(t,n);e=Xt(e,r);var i=e.write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(tn(t)){var n=0|en(t.length);return 0===(e=Xt(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?Xt(e,0):Zt(e,t);if("Buffer"===t.type&&Gt(t.data))return Zt(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function Yt(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function Qt(e,t){if(Yt(t),e=Xt(e,t<0?0:0|en(t)),!$t.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function Zt(e,t){var n=t.length<0?0:0|en(t.length);e=Xt(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function en(e){if(e>=Wt())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Wt().toString(16)+" bytes");return 0|e}function tn(e){return!(null==e||!e._isBuffer)}function nn(e,t){if(tn(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return xn(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Cn(e).length;default:if(r)return xn(e).length;t=(""+t).toLowerCase(),r=!0}}function rn(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return vn(this,t,n);case"utf8":case"utf-8":return bn(this,t,n);case"ascii":return yn(this,t,n);case"latin1":case"binary":return gn(this,t,n);case"base64":return hn(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return wn(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function an(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function on(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=$t.from(t,r)),tn(t))return 0===t.length?-1:sn(e,t,n,r,i);if("number"==typeof t)return t&=255,$t.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):sn(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function sn(e,t,n,r,i){var a,o=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,n/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var f=-1;for(a=n;a<s;a++)if(c(e,a)===c(t,-1===f?0:a-f)){if(-1===f&&(f=a),a-f+1===u)return f*o}else-1!==f&&(a-=a-f),f=-1}else for(n+u>s&&(n=s-u),a=n;a>=0;a--){for(var d=!0,l=0;l<u;l++)if(c(e,a+l)!==c(t,l)){d=!1;break}if(d)return a}return-1}function un(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var o=0;o<r;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[n+o]=s}return o}function cn(e,t,n,r){return Mn(xn(t,e.length-n),e,n,r)}function fn(e,t,n,r){return Mn(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function dn(e,t,n,r){return fn(e,t,n,r)}function ln(e,t,n,r){return Mn(Cn(t),e,n,r)}function pn(e,t,n,r){return Mn(function(e,t){for(var n,r,i,a=[],o=0;o<e.length&&!((t-=2)<0);++o)r=(n=e.charCodeAt(o))>>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function hn(e,t,n){return 0===t&&n===e.length?qt(e):qt(e.slice(t,n))}function bn(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var a,o,s,u,c=e[i],f=null,d=c>239?4:c>223?3:c>191?2:1;if(i+d<=n)switch(d){case 1:c<128&&(f=c);break;case 2:128==(192&(a=e[i+1]))&&(u=(31&c)<<6|63&a)>127&&(f=u);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(u=(15&c)<<12|(63&a)<<6|63&o)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(u=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&u<1114112&&(f=u)}null===f?(f=65533,d=1):f>65535&&(f-=65536,r.push(f>>>10&1023|55296),f=56320|1023&f),r.push(f),i+=d}return function(e){var t=e.length;if(t<=mn)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=mn));return n}(r)}$t.poolSize=8192,$t._augment=function(e){return e.__proto__=$t.prototype,e},$t.from=function(e,t,n){return Jt(null,e,t,n)},$t.TYPED_ARRAY_SUPPORT&&($t.prototype.__proto__=Uint8Array.prototype,$t.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&$t[Symbol.species]),$t.alloc=function(e,t,n){return function(e,t,n,r){return Yt(t),t<=0?Xt(e,t):void 0!==n?"string"==typeof r?Xt(e,t).fill(n,r):Xt(e,t).fill(n):Xt(e,t)}(null,e,t,n)},$t.allocUnsafe=function(e){return Qt(null,e)},$t.allocUnsafeSlow=function(e){return Qt(null,e)},$t.isBuffer=Nn,$t.compare=function(e,t){if(!tn(e)||!tn(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},$t.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},$t.concat=function(e,t){if(!Gt(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return $t.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=$t.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var a=e[n];if(!tn(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i),i+=a.length}return r},$t.byteLength=nn,$t.prototype._isBuffer=!0,$t.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)an(this,t,t+1);return this},$t.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)an(this,t,t+3),an(this,t+1,t+2);return this},$t.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)an(this,t,t+7),an(this,t+1,t+6),an(this,t+2,t+5),an(this,t+3,t+4);return this},$t.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?bn(this,0,e):rn.apply(this,arguments)},$t.prototype.equals=function(e){if(!tn(e))throw new TypeError("Argument must be a Buffer");return this===e||0===$t.compare(this,e)},$t.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},$t.prototype.compare=function(e,t,n,r,i){if(!tn(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0),s=Math.min(a,o),u=this.slice(r,i),c=e.slice(t,n),f=0;f<s;++f)if(u[f]!==c[f]){a=u[f],o=c[f];break}return a<o?-1:o<a?1:0},$t.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},$t.prototype.indexOf=function(e,t,n){return on(this,e,t,n,!0)},$t.prototype.lastIndexOf=function(e,t,n){return on(this,e,t,n,!1)},$t.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return un(this,e,t,n);case"utf8":case"utf-8":return cn(this,e,t,n);case"ascii":return fn(this,e,t,n);case"latin1":case"binary":return dn(this,e,t,n);case"base64":return ln(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pn(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},$t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var mn=4096;function yn(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function gn(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function vn(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",a=t;a<n;++a)i+=In(e[a]);return i}function wn(e,t,n){for(var r=e.slice(t,n),i="",a=0;a<r.length;a+=2)i+=String.fromCharCode(r[a]+256*r[a+1]);return i}function _n(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function En(e,t,n,r,i,a){if(!tn(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function Tn(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-n,2);i<a;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function An(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-n,4);i<a;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function Rn(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Sn(e,t,n,r,i){return i||Rn(e,0,n,4),Ht(e,t,n,r,23,4),n+4}function kn(e,t,n,r,i){return i||Rn(e,0,n,8),Ht(e,t,n,r,52,8),n+8}$t.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),$t.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=$t.prototype;else{var i=t-e;n=new $t(i,void 0);for(var a=0;a<i;++a)n[a]=this[a+e]}return n},$t.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||_n(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r},$t.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||_n(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},$t.prototype.readUInt8=function(e,t){return t||_n(e,1,this.length),this[e]},$t.prototype.readUInt16LE=function(e,t){return t||_n(e,2,this.length),this[e]|this[e+1]<<8},$t.prototype.readUInt16BE=function(e,t){return t||_n(e,2,this.length),this[e]<<8|this[e+1]},$t.prototype.readUInt32LE=function(e,t){return t||_n(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},$t.prototype.readUInt32BE=function(e,t){return t||_n(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},$t.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||_n(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},$t.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||_n(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},$t.prototype.readInt8=function(e,t){return t||_n(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},$t.prototype.readInt16LE=function(e,t){t||_n(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},$t.prototype.readInt16BE=function(e,t){t||_n(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},$t.prototype.readInt32LE=function(e,t){return t||_n(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},$t.prototype.readInt32BE=function(e,t){return t||_n(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},$t.prototype.readFloatLE=function(e,t){return t||_n(e,4,this.length),zt(this,e,!0,23,4)},$t.prototype.readFloatBE=function(e,t){return t||_n(e,4,this.length),zt(this,e,!1,23,4)},$t.prototype.readDoubleLE=function(e,t){return t||_n(e,8,this.length),zt(this,e,!0,52,8)},$t.prototype.readDoubleBE=function(e,t){return t||_n(e,8,this.length),zt(this,e,!1,52,8)},$t.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||En(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},$t.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||En(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},$t.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||En(this,e,t,1,255,0),$t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},$t.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||En(this,e,t,2,65535,0),$t.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Tn(this,e,t,!0),t+2},$t.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||En(this,e,t,2,65535,0),$t.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Tn(this,e,t,!1),t+2},$t.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||En(this,e,t,4,4294967295,0),$t.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):An(this,e,t,!0),t+4},$t.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||En(this,e,t,4,4294967295,0),$t.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):An(this,e,t,!1),t+4},$t.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);En(this,e,t,n,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a<n&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},$t.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);En(this,e,t,n,i-1,-i)}var a=n-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},$t.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||En(this,e,t,1,127,-128),$t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},$t.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||En(this,e,t,2,32767,-32768),$t.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Tn(this,e,t,!0),t+2},$t.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||En(this,e,t,2,32767,-32768),$t.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Tn(this,e,t,!1),t+2},$t.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||En(this,e,t,4,2147483647,-2147483648),$t.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):An(this,e,t,!0),t+4},$t.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||En(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),$t.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):An(this,e,t,!1),t+4},$t.prototype.writeFloatLE=function(e,t,n){return Sn(this,e,t,!0,n)},$t.prototype.writeFloatBE=function(e,t,n){return Sn(this,e,t,!1,n)},$t.prototype.writeDoubleLE=function(e,t,n){return kn(this,e,t,!0,n)},$t.prototype.writeDoubleBE=function(e,t,n){return kn(this,e,t,!1,n)},$t.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,a=r-n;if(this===e&&n<t&&t<r)for(i=a-1;i>=0;--i)e[i+t]=this[i+n];else if(a<1e3||!$t.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},$t.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!$t.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var a;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a<n;++a)this[a]=e;else{var o=tn(e)?e:xn(new $t(e,r).toString()),s=o.length;for(a=0;a<n-t;++a)this[a+t]=o[a%s]}return this};var On=/[^+\/0-9A-Za-z-_]/g;function In(e){return e<16?"0"+e.toString(16):e.toString(16)}function xn(e,t){var n;t=t||1/0;for(var r=e.length,i=null,a=[],o=0;o<r;++o){if((n=e.charCodeAt(o))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function Cn(e){return function(e){var t,n,r,i,a,o;Lt||Ut();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a="="===e[s-2]?2:"="===e[s-1]?1:0,o=new Ft(3*s/4-a),r=a>0?s-4:s;var u=0;for(t=0,n=0;t<r;t+=4,n+=3)i=Dt[e.charCodeAt(t)]<<18|Dt[e.charCodeAt(t+1)]<<12|Dt[e.charCodeAt(t+2)]<<6|Dt[e.charCodeAt(t+3)],o[u++]=i>>16&255,o[u++]=i>>8&255,o[u++]=255&i;return 2===a?(i=Dt[e.charCodeAt(t)]<<2|Dt[e.charCodeAt(t+1)]>>4,o[u++]=255&i):1===a&&(i=Dt[e.charCodeAt(t)]<<10|Dt[e.charCodeAt(t+1)]<<4|Dt[e.charCodeAt(t+2)]>>2,o[u++]=i>>8&255,o[u++]=255&i),o}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(On,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Mn(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Nn(e){return null!=e&&(!!e._isBuffer||Pn(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&Pn(e.slice(0,0))}(e))}function Pn(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var Bn=Mt(Object.freeze({__proto__:null,Buffer:$t,INSPECT_MAX_BYTES:50,SlowBuffer:function(e){return+e!=e&&(e=0),$t.alloc(+e)},isBuffer:Nn,kMaxLength:Kt}));!function(e){!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:Bn.Buffer}catch(e){}function o(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function s(e,t,n){var r=o(e,n);return n-1>=t&&(r|=o(e,n-1)<<4),r}function u(e,t,r,i){for(var a=0,o=0,s=Math.min(e.length,r),u=t;u<s;u++){var c=e.charCodeAt(u)-48;a*=i,o=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&o<i,"Invalid character"),a+=o}return a}function c(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},i.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,o,s=0;if("be"===r)for(i=e.length-1,a=0;i>=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i<e.length;i+=3)o=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this._strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,a=0,o=0;if("be"===n)for(r=e.length-1;r>=t;r-=2)i=s(e,t,r)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(r=(e.length-t)%2==0?t+1:t;r<e.length;r+=2)i=s(e,t,r)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this._strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var a=e.length-n,o=a%r,s=Math.min(a,a-o)+n,c=0,f=n;f<s;f+=r)c=u(e,f,f+r,t),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==o){var d=1;for(c=u(e,f,e.length,t),f=0;f<o;f++)d*=t;this.imuln(d),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this._strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype._move=function(e){c(e,this)},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(e){i.prototype.inspect=f}else i.prototype.inspect=f;function f(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,a=0,o=0;o<this.length;o++){var s=this.words[o],u=(16777215&(s<<i|a)).toString(16);a=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,o--),r=0!==a||o!==this.length-1?d[6-u.length]+u+r:u+r}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=l[e],f=p[e];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var b=h.modrn(f).toString(e);r=(h=h.idivn(f)).isZero()?b+r:d[c-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},a&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function h(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,u=o/67108864|0;n.words[0]=s;for(var c=1;c<r;c++){for(var f=u>>>26,d=67108863&u,l=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=l;p++){var h=c-p|0;f+=(o=(i=0|e.words[h])*(a=0|t.words[p])+d)/67108864|0,d=67108863&o}n.words[c]=0|d,u=0|f}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}i.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,a);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,i),o},i.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,a=0;i<this.length;i++){var o=this.words[i]<<a|r;e[n++]=255&o,n<e.length&&(e[n++]=o>>8&255),n<e.length&&(e[n++]=o>>16&255),6===a?(n<e.length&&(e[n++]=o>>24&255),r=0,a=0):(r=o>>>24,a+=2)}if(n<e.length)for(e[n++]=r;n<e.length;)e[n++]=0},i.prototype._toArrayLikeBE=function(e,t){for(var n=e.length-1,r=0,i=0,a=0;i<this.length;i++){var o=this.words[i]<<a|r;e[n--]=255&o,n>=0&&(e[n--]=o>>8&255),n>=0&&(e[n--]=o>>16&255),6===a?(n>=0&&(e[n--]=o>>24&255),r=0,a=0):(r=o>>>24,a+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var n=this._zeroBits(this.words[t]);if(e+=n,26!==n)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},i.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;n<t.length;n++)this.words[n]=this.words[n]&e.words[n];return this.length=t.length,this._strip()},i.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;r<n.length;r++)this.words[r]=t.words[r]^n.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this._strip()},i.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},i.prototype.iadd=function(e){var t,n,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a<r.length;a++)t=(0|n.words[a])+(0|r.words[a])+i,this.words[a]=67108863&t,i=t>>>26;for(;0!==i&&a<n.length;a++)t=(0|n.words[a])+i,this.words[a]=67108863&t,i=t>>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var a=0,o=0;o<r.length;o++)a=(t=(0|n.words[o])-(0|r.words[o])+a)>>26,this.words[o]=67108863&t;for(;0!==a&&o<n.length;o++)a=(t=(0|n.words[o])+a)>>26,this.words[o]=67108863&t;if(0===a&&o<n.length&&n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this.length=Math.max(this.length,o),n!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var b=function(e,t,n){var r,i,a,o=e.words,s=t.words,u=n.words,c=0,f=0|o[0],d=8191&f,l=f>>>13,p=0|o[1],h=8191&p,b=p>>>13,m=0|o[2],y=8191&m,g=m>>>13,v=0|o[3],w=8191&v,_=v>>>13,E=0|o[4],T=8191&E,A=E>>>13,R=0|o[5],S=8191&R,k=R>>>13,O=0|o[6],I=8191&O,x=O>>>13,C=0|o[7],M=8191&C,N=C>>>13,P=0|o[8],B=8191&P,D=P>>>13,F=0|o[9],L=8191&F,U=F>>>13,j=0|s[0],q=8191&j,z=j>>>13,H=0|s[1],V=8191&H,G=H>>>13,K=0|s[2],W=8191&K,X=K>>>13,$=0|s[3],J=8191&$,Y=$>>>13,Q=0|s[4],Z=8191&Q,ee=Q>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,fe=0|s[8],de=8191&fe,le=fe>>>13,pe=0|s[9],he=8191&pe,be=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var me=(c+(r=Math.imul(d,q))|0)+((8191&(i=(i=Math.imul(d,z))+Math.imul(l,q)|0))<<13)|0;c=((a=Math.imul(l,z))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(h,q),i=(i=Math.imul(h,z))+Math.imul(b,q)|0,a=Math.imul(b,z);var ye=(c+(r=r+Math.imul(d,V)|0)|0)+((8191&(i=(i=i+Math.imul(d,G)|0)+Math.imul(l,V)|0))<<13)|0;c=((a=a+Math.imul(l,G)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(y,q),i=(i=Math.imul(y,z))+Math.imul(g,q)|0,a=Math.imul(g,z),r=r+Math.imul(h,V)|0,i=(i=i+Math.imul(h,G)|0)+Math.imul(b,V)|0,a=a+Math.imul(b,G)|0;var ge=(c+(r=r+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(l,W)|0))<<13)|0;c=((a=a+Math.imul(l,X)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(w,q),i=(i=Math.imul(w,z))+Math.imul(_,q)|0,a=Math.imul(_,z),r=r+Math.imul(y,V)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(g,V)|0,a=a+Math.imul(g,G)|0,r=r+Math.imul(h,W)|0,i=(i=i+Math.imul(h,X)|0)+Math.imul(b,W)|0,a=a+Math.imul(b,X)|0;var ve=(c+(r=r+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,Y)|0)+Math.imul(l,J)|0))<<13)|0;c=((a=a+Math.imul(l,Y)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(T,q),i=(i=Math.imul(T,z))+Math.imul(A,q)|0,a=Math.imul(A,z),r=r+Math.imul(w,V)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(_,V)|0,a=a+Math.imul(_,G)|0,r=r+Math.imul(y,W)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(g,W)|0,a=a+Math.imul(g,X)|0,r=r+Math.imul(h,J)|0,i=(i=i+Math.imul(h,Y)|0)+Math.imul(b,J)|0,a=a+Math.imul(b,Y)|0;var we=(c+(r=r+Math.imul(d,Z)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(l,Z)|0))<<13)|0;c=((a=a+Math.imul(l,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(S,q),i=(i=Math.imul(S,z))+Math.imul(k,q)|0,a=Math.imul(k,z),r=r+Math.imul(T,V)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(A,V)|0,a=a+Math.imul(A,G)|0,r=r+Math.imul(w,W)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,W)|0,a=a+Math.imul(_,X)|0,r=r+Math.imul(y,J)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(g,J)|0,a=a+Math.imul(g,Y)|0,r=r+Math.imul(h,Z)|0,i=(i=i+Math.imul(h,ee)|0)+Math.imul(b,Z)|0,a=a+Math.imul(b,ee)|0;var _e=(c+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(l,ne)|0))<<13)|0;c=((a=a+Math.imul(l,re)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(I,q),i=(i=Math.imul(I,z))+Math.imul(x,q)|0,a=Math.imul(x,z),r=r+Math.imul(S,V)|0,i=(i=i+Math.imul(S,G)|0)+Math.imul(k,V)|0,a=a+Math.imul(k,G)|0,r=r+Math.imul(T,W)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(A,W)|0,a=a+Math.imul(A,X)|0,r=r+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,J)|0,a=a+Math.imul(_,Y)|0,r=r+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(g,Z)|0,a=a+Math.imul(g,ee)|0,r=r+Math.imul(h,ne)|0,i=(i=i+Math.imul(h,re)|0)+Math.imul(b,ne)|0,a=a+Math.imul(b,re)|0;var Ee=(c+(r=r+Math.imul(d,ae)|0)|0)+((8191&(i=(i=i+Math.imul(d,oe)|0)+Math.imul(l,ae)|0))<<13)|0;c=((a=a+Math.imul(l,oe)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(M,q),i=(i=Math.imul(M,z))+Math.imul(N,q)|0,a=Math.imul(N,z),r=r+Math.imul(I,V)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(x,V)|0,a=a+Math.imul(x,G)|0,r=r+Math.imul(S,W)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(k,W)|0,a=a+Math.imul(k,X)|0,r=r+Math.imul(T,J)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(A,J)|0,a=a+Math.imul(A,Y)|0,r=r+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Z)|0,a=a+Math.imul(_,ee)|0,r=r+Math.imul(y,ne)|0,i=(i=i+Math.imul(y,re)|0)+Math.imul(g,ne)|0,a=a+Math.imul(g,re)|0,r=r+Math.imul(h,ae)|0,i=(i=i+Math.imul(h,oe)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0;var Te=(c+(r=r+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(l,ue)|0))<<13)|0;c=((a=a+Math.imul(l,ce)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(B,q),i=(i=Math.imul(B,z))+Math.imul(D,q)|0,a=Math.imul(D,z),r=r+Math.imul(M,V)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(N,V)|0,a=a+Math.imul(N,G)|0,r=r+Math.imul(I,W)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(x,W)|0,a=a+Math.imul(x,X)|0,r=r+Math.imul(S,J)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,Y)|0,r=r+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(A,Z)|0,a=a+Math.imul(A,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(_,ne)|0,a=a+Math.imul(_,re)|0,r=r+Math.imul(y,ae)|0,i=(i=i+Math.imul(y,oe)|0)+Math.imul(g,ae)|0,a=a+Math.imul(g,oe)|0,r=r+Math.imul(h,ue)|0,i=(i=i+Math.imul(h,ce)|0)+Math.imul(b,ue)|0,a=a+Math.imul(b,ce)|0;var Ae=(c+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,le)|0)+Math.imul(l,de)|0))<<13)|0;c=((a=a+Math.imul(l,le)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(L,q),i=(i=Math.imul(L,z))+Math.imul(U,q)|0,a=Math.imul(U,z),r=r+Math.imul(B,V)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(D,V)|0,a=a+Math.imul(D,G)|0,r=r+Math.imul(M,W)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(N,W)|0,a=a+Math.imul(N,X)|0,r=r+Math.imul(I,J)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(x,J)|0,a=a+Math.imul(x,Y)|0,r=r+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(k,Z)|0,a=a+Math.imul(k,ee)|0,r=r+Math.imul(T,ne)|0,i=(i=i+Math.imul(T,re)|0)+Math.imul(A,ne)|0,a=a+Math.imul(A,re)|0,r=r+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,oe)|0)+Math.imul(_,ae)|0,a=a+Math.imul(_,oe)|0,r=r+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(g,ue)|0,a=a+Math.imul(g,ce)|0,r=r+Math.imul(h,de)|0,i=(i=i+Math.imul(h,le)|0)+Math.imul(b,de)|0,a=a+Math.imul(b,le)|0;var Re=(c+(r=r+Math.imul(d,he)|0)|0)+((8191&(i=(i=i+Math.imul(d,be)|0)+Math.imul(l,he)|0))<<13)|0;c=((a=a+Math.imul(l,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(L,V),i=(i=Math.imul(L,G))+Math.imul(U,V)|0,a=Math.imul(U,G),r=r+Math.imul(B,W)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(D,W)|0,a=a+Math.imul(D,X)|0,r=r+Math.imul(M,J)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(N,J)|0,a=a+Math.imul(N,Y)|0,r=r+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(x,Z)|0,a=a+Math.imul(x,ee)|0,r=r+Math.imul(S,ne)|0,i=(i=i+Math.imul(S,re)|0)+Math.imul(k,ne)|0,a=a+Math.imul(k,re)|0,r=r+Math.imul(T,ae)|0,i=(i=i+Math.imul(T,oe)|0)+Math.imul(A,ae)|0,a=a+Math.imul(A,oe)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(_,ue)|0,a=a+Math.imul(_,ce)|0,r=r+Math.imul(y,de)|0,i=(i=i+Math.imul(y,le)|0)+Math.imul(g,de)|0,a=a+Math.imul(g,le)|0;var Se=(c+(r=r+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,be)|0)+Math.imul(b,he)|0))<<13)|0;c=((a=a+Math.imul(b,be)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(L,W),i=(i=Math.imul(L,X))+Math.imul(U,W)|0,a=Math.imul(U,X),r=r+Math.imul(B,J)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(D,J)|0,a=a+Math.imul(D,Y)|0,r=r+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(N,Z)|0,a=a+Math.imul(N,ee)|0,r=r+Math.imul(I,ne)|0,i=(i=i+Math.imul(I,re)|0)+Math.imul(x,ne)|0,a=a+Math.imul(x,re)|0,r=r+Math.imul(S,ae)|0,i=(i=i+Math.imul(S,oe)|0)+Math.imul(k,ae)|0,a=a+Math.imul(k,oe)|0,r=r+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,ce)|0)+Math.imul(A,ue)|0,a=a+Math.imul(A,ce)|0,r=r+Math.imul(w,de)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(_,de)|0,a=a+Math.imul(_,le)|0;var ke=(c+(r=r+Math.imul(y,he)|0)|0)+((8191&(i=(i=i+Math.imul(y,be)|0)+Math.imul(g,he)|0))<<13)|0;c=((a=a+Math.imul(g,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(L,J),i=(i=Math.imul(L,Y))+Math.imul(U,J)|0,a=Math.imul(U,Y),r=r+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(D,Z)|0,a=a+Math.imul(D,ee)|0,r=r+Math.imul(M,ne)|0,i=(i=i+Math.imul(M,re)|0)+Math.imul(N,ne)|0,a=a+Math.imul(N,re)|0,r=r+Math.imul(I,ae)|0,i=(i=i+Math.imul(I,oe)|0)+Math.imul(x,ae)|0,a=a+Math.imul(x,oe)|0,r=r+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(k,ue)|0,a=a+Math.imul(k,ce)|0,r=r+Math.imul(T,de)|0,i=(i=i+Math.imul(T,le)|0)+Math.imul(A,de)|0,a=a+Math.imul(A,le)|0;var Oe=(c+(r=r+Math.imul(w,he)|0)|0)+((8191&(i=(i=i+Math.imul(w,be)|0)+Math.imul(_,he)|0))<<13)|0;c=((a=a+Math.imul(_,be)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(L,Z),i=(i=Math.imul(L,ee))+Math.imul(U,Z)|0,a=Math.imul(U,ee),r=r+Math.imul(B,ne)|0,i=(i=i+Math.imul(B,re)|0)+Math.imul(D,ne)|0,a=a+Math.imul(D,re)|0,r=r+Math.imul(M,ae)|0,i=(i=i+Math.imul(M,oe)|0)+Math.imul(N,ae)|0,a=a+Math.imul(N,oe)|0,r=r+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(x,ue)|0,a=a+Math.imul(x,ce)|0,r=r+Math.imul(S,de)|0,i=(i=i+Math.imul(S,le)|0)+Math.imul(k,de)|0,a=a+Math.imul(k,le)|0;var Ie=(c+(r=r+Math.imul(T,he)|0)|0)+((8191&(i=(i=i+Math.imul(T,be)|0)+Math.imul(A,he)|0))<<13)|0;c=((a=a+Math.imul(A,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(L,ne),i=(i=Math.imul(L,re))+Math.imul(U,ne)|0,a=Math.imul(U,re),r=r+Math.imul(B,ae)|0,i=(i=i+Math.imul(B,oe)|0)+Math.imul(D,ae)|0,a=a+Math.imul(D,oe)|0,r=r+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,ce)|0)+Math.imul(N,ue)|0,a=a+Math.imul(N,ce)|0,r=r+Math.imul(I,de)|0,i=(i=i+Math.imul(I,le)|0)+Math.imul(x,de)|0,a=a+Math.imul(x,le)|0;var xe=(c+(r=r+Math.imul(S,he)|0)|0)+((8191&(i=(i=i+Math.imul(S,be)|0)+Math.imul(k,he)|0))<<13)|0;c=((a=a+Math.imul(k,be)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(L,ae),i=(i=Math.imul(L,oe))+Math.imul(U,ae)|0,a=Math.imul(U,oe),r=r+Math.imul(B,ue)|0,i=(i=i+Math.imul(B,ce)|0)+Math.imul(D,ue)|0,a=a+Math.imul(D,ce)|0,r=r+Math.imul(M,de)|0,i=(i=i+Math.imul(M,le)|0)+Math.imul(N,de)|0,a=a+Math.imul(N,le)|0;var Ce=(c+(r=r+Math.imul(I,he)|0)|0)+((8191&(i=(i=i+Math.imul(I,be)|0)+Math.imul(x,he)|0))<<13)|0;c=((a=a+Math.imul(x,be)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(L,ue),i=(i=Math.imul(L,ce))+Math.imul(U,ue)|0,a=Math.imul(U,ce),r=r+Math.imul(B,de)|0,i=(i=i+Math.imul(B,le)|0)+Math.imul(D,de)|0,a=a+Math.imul(D,le)|0;var Me=(c+(r=r+Math.imul(M,he)|0)|0)+((8191&(i=(i=i+Math.imul(M,be)|0)+Math.imul(N,he)|0))<<13)|0;c=((a=a+Math.imul(N,be)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(L,de),i=(i=Math.imul(L,le))+Math.imul(U,de)|0,a=Math.imul(U,le);var Ne=(c+(r=r+Math.imul(B,he)|0)|0)+((8191&(i=(i=i+Math.imul(B,be)|0)+Math.imul(D,he)|0))<<13)|0;c=((a=a+Math.imul(D,be)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Pe=(c+(r=Math.imul(L,he))|0)+((8191&(i=(i=Math.imul(L,be))+Math.imul(U,he)|0))<<13)|0;return c=((a=Math.imul(U,be))+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,u[0]=me,u[1]=ye,u[2]=ge,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Ee,u[7]=Te,u[8]=Ae,u[9]=Re,u[10]=Se,u[11]=ke,u[12]=Oe,u[13]=Ie,u[14]=xe,u[15]=Ce,u[16]=Me,u[17]=Ne,u[18]=Pe,0!==c&&(u[19]=c,n.length++),n};function m(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,a=0;a<n.length-1;a++){var o=i;i=0;for(var s=67108863&r,u=Math.min(a,t.length-1),c=Math.max(0,a-e.length+1);c<=u;c++){var f=a-c,d=(0|e.words[f])*(0|t.words[c]),l=67108863&d;s=67108863&(l=l+s|0),i+=(o=(o=o+(d/67108864|0)|0)+(l>>>26)|0)>>>26,o&=67108863}n.words[a]=s,r=o,o=i}return 0!==r?n.words[a]=r:n.length--,n._strip()}function y(e,t,n){return m(e,t,n)}Math.imul||(b=h),i.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?b(this,e,t):n<63?h(this,e,t):n<1024?m(this,e,t):y(this,e,t)},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),y(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i<this.length;i++){var a=(0|this.words[i])*e,o=(67108863&a)+(67108863&r);r>>=26,r+=a/67108864|0,r+=o>>>26,this.words[i]=67108863&o}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n<t.length;n++){var r=n/26|0,i=n%26;t[n]=e.words[r]>>>i&1}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r<t.length&&0===t[r];r++,n=n.sqr());if(++r<t.length)for(var a=n.sqr();r<t.length;r++,a=a.sqr())0!==t[r]&&(n=n.mul(a));return n},i.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t<this.length;t++){var s=this.words[t]&a,u=(0|this.words[t])-s<<r;this.words[t]=u|o,o=s>>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this._strip()},i.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<<a,u=r;if(i-=o,i=Math.max(0,i),u){for(var c=0;c<o;c++)u.words[c]=this.words[c];u.length=o}if(0===o);else if(this.length>o)for(this.length-=o,c=0;c<this.length;c++)this.words[c]=this.words[c+o];else this.words[0]=0,this.length=1;var f=0;for(c=this.length-1;c>=0&&(0!==f||c>=i);c--){var d=0|this.words[c];this.words[c]=f<<26-a|d>>>a,f=d&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},i.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this._strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,r){var i,a,o=e.length+r;this._expand(o);var s=0;for(i=0;i<e.length;i++){a=(0|this.words[i+r])+s;var u=(0|e.words[i])*t;s=((a-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&a}for(;i<this.length-r;i++)s=(a=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&a;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(a=-(0|this.words[i])+s)>>26,this.words[i]=67108863&a;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),a=e,o=0|a.words[a.length-1];0!==(n=26-this._countBits(o))&&(a=a.ushln(n),r.iushln(n),o=0|a.words[a.length-1]);var s,u=r.length-a.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var f=r.clone()._ishlnsubmul(a,1,u);0===f.negative&&(r=f,s&&(s.words[u]=1));for(var d=u-1;d>=0;d--){var l=67108864*(0|r.words[a.length+d])+(0|r.words[a.length+d-1]);for(l=Math.min(l/o|0,67108863),r._ishlnsubmul(a,l,d);0!==r.negative;)l--,r.negative=0,r._ishlnsubmul(a,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=l)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(a=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:a,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(a=s.div.neg()),{div:a,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var a,o,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),a=n.cmp(r);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,a=this.length-1;a>=0;a--)i=(r*i+(0|this.words[a]))%e;return t?-i:i},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(0|this.words[i])+67108864*r;this.words[i]=a/e|0,r=a%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new i(1),o=new i(0),s=new i(0),u=new i(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var f=r.clone(),d=t.clone();!t.isZero();){for(var l=0,p=1;0==(t.words[0]&p)&&l<26;++l,p<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(f),o.isub(d)),a.iushrn(1),o.iushrn(1);for(var h=0,b=1;0==(r.words[0]&b)&&h<26;++h,b<<=1);if(h>0)for(r.iushrn(h);h-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s),o.isub(u)):(r.isub(t),s.isub(a),u.isub(o))}return{a:s,b:u,gcd:r.iushln(c)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,o=new i(1),s=new i(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,f=1;0==(t.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var d=0,l=1;0==(r.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(r.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s)):(r.isub(t),s.isub(o))}return(a=0===t.cmpn(1)?o:s).cmpn(0)<0&&a.iadd(e),a},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var a=t;t=n,n=a}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var a=i,o=r;0!==a&&o<this.length;o++){var s=0|this.words[o];a=(s+=a)>>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){r<i?t=-1:r>i&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new A(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function T(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function R(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},r(w,v),w.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i<r;i++)t.words[i]=e.words[i];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var a=e.words[9];for(t.words[t.length++]=a&n,i=10;i<e.length;i++){var o=0|e.words[i];e.words[i-10]=(o&n)<<4|a>>>22,a=o}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n<e.length;n++){var r=0|e.words[n];t+=977*r,e.words[n]=67108863&t,t=64*r+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},r(_,v),r(E,v),r(T,v),T.prototype.imulK=function(e){for(var t=0,n=0;n<e.length;n++){var r=19*(0|e.words[n])+t,i=67108863&r;r>>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new _;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new T}return g[e]=t,t},A.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(c(e,e.umod(this.m)._forceRed(this)),e)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},A.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);n(!a.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var d=this.pow(f,a),l=this.pow(e,a.addn(1).iushrn(1)),p=this.pow(e,a),h=o;0!==p.cmp(s);){for(var b=p,m=0;0!==b.cmp(s);m++)b=b.redSqr();n(m<h);var y=this.pow(d,new i(1).iushln(h-m-1));l=l.redMul(y),d=y.redSqr(),p=p.redMul(d),h=m}return l},A.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},A.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var n=new Array(16);n[0]=new i(1).toRed(this),n[1]=e;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],e);var a=n[0],o=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),r=t.length-1;r>=0;r--){for(var c=t.words[r],f=u-1;f>=0;f--){var d=c>>f&1;a!==n[0]&&(a=this.sqr(a)),0!==d||0!==o?(o<<=1,o|=d,(4===++s||0===r&&0===f)&&(a=this.mul(a,n[o]),s=0,o=0)):s=0}u=26}return a},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new R(e)},r(R,A),R.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},R.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},R.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},R.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=n.isub(r).iushrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},R.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,xt)}(Nt);var Dn=Nt.exports,Fn=Ct(Dn);let Ln=!1,Un=!1;const jn={debug:1,default:2,info:2,warning:3,error:4,off:5};let qn=jn.default,zn=null;const Hn=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(n){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var Vn,Gn;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(Vn||(Vn={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(Gn||(Gn={}));const Kn="0123456789abcdef";let Wn=class e{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const n=e.toLowerCase();null==jn[n]&&this.throwArgumentError("invalid log level name","logLevel",e),qn>jn[n]||console.log.apply(console,t)}debug(...t){this._log(e.levels.DEBUG,t)}info(...t){this._log(e.levels.INFO,t)}warn(...t){this._log(e.levels.WARNING,t)}makeError(t,n,r){if(Un)return this.makeError("censored error",n,{});n||(n=e.errors.UNKNOWN_ERROR),r||(r={});const i=[];Object.keys(r).forEach((e=>{const t=r[e];try{if(t instanceof Uint8Array){let n="";for(let e=0;e<t.length;e++)n+=Kn[t[e]>>4],n+=Kn[15&t[e]];i.push(e+"=Uint8Array(0x"+n+")")}else i.push(e+"="+JSON.stringify(t))}catch(t){i.push(e+"="+JSON.stringify(r[e].toString()))}})),i.push(`code=${n}`),i.push(`version=${this.version}`);const a=t;let o="";switch(n){case Gn.NUMERIC_FAULT:{o="NUMERIC_FAULT";const e=t;switch(e){case"overflow":case"underflow":case"division-by-zero":o+="-"+e;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case Gn.CALL_EXCEPTION:case Gn.INSUFFICIENT_FUNDS:case Gn.MISSING_NEW:case Gn.NONCE_EXPIRED:case Gn.REPLACEMENT_UNDERPRICED:case Gn.TRANSACTION_REPLACED:case Gn.UNPREDICTABLE_GAS_LIMIT:o=n}o&&(t+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(t+=" ("+i.join(", ")+")");const s=new Error(t);return s.reason=a,s.code=n,Object.keys(r).forEach((function(e){s[e]=r[e]})),s}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(t,n,r){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:n,value:r})}assert(e,t,n,r){e||this.throwError(t,n,r)}assertArgument(e,t,n,r){e||this.throwArgumentError(t,n,r)}checkNormalize(t){Hn&&this.throwError("platform missing String.prototype.normalize",e.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Hn})}checkSafeUint53(t,n){"number"==typeof t&&(null==n&&(n="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,n,r){r=r?": "+r:"",t<n&&this.throwError("missing argument"+r,e.errors.MISSING_ARGUMENT,{count:t,expectedCount:n}),t>n&&this.throwError("too many arguments"+r,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:n})}checkNew(t,n){t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:n.name})}checkAbstract(t,n){t===n?this.throwError("cannot instantiate abstract class "+JSON.stringify(n.name)+" directly; use a sub-class",e.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:n.name})}static globalLogger(){return zn||(zn=new e("logger/5.7.0")),zn}static setCensorship(t,n){if(!t&&n&&this.globalLogger().throwError("cannot permanently disable censorship",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Ln){if(!t)return;this.globalLogger().throwError("error censorship permanent",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Un=!!t,Ln=!!n}static setLogLevel(t){const n=jn[t.toLowerCase()];null!=n?qn=n:e.globalLogger().warn("invalid log level - "+t)}static from(t){return new e(t)}};Wn.errors=Gn,Wn.levels=Vn;var Xn=Object.freeze({__proto__:null,get ErrorCode(){return Gn},get LogLevel(){return Vn},Logger:Wn});const $n=new Wn("bytes/5.7.0");function Jn(e){return!!e.toHexString}function Yn(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return Yn(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function Qn(e){return ar(e)&&!(e.length%2)||er(e)}function Zn(e){return"number"==typeof e&&e==e&&e%1==0}function er(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!Zn(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){const n=e[t];if(!Zn(n)||n<0||n>=256)return!1}return!0}function tr(e,t){if(t||(t={}),"number"==typeof e){$n.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),Yn(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Jn(e)&&(e=e.toHexString()),ar(e)){let n=e.substring(2);n.length%2&&("left"===t.hexPad?n="0"+n:"right"===t.hexPad?n+="0":$n.throwArgumentError("hex data is odd-length","value",e));const r=[];for(let e=0;e<n.length;e+=2)r.push(parseInt(n.substring(e,e+2),16));return Yn(new Uint8Array(r))}return er(e)?Yn(new Uint8Array(e)):$n.throwArgumentError("invalid arrayify value","value",e)}function nr(e){const t=e.map((e=>tr(e))),n=t.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(n);return t.reduce(((e,t)=>(r.set(t,e),e+t.length)),0),Yn(r)}function rr(e){let t=tr(e);if(0===t.length)return t;let n=0;for(;n<t.length&&0===t[n];)n++;return n&&(t=t.slice(n)),t}function ir(e,t){(e=tr(e)).length>t&&$n.throwArgumentError("value out of range","value",arguments[0]);const n=new Uint8Array(t);return n.set(e,t-e.length),Yn(n)}function ar(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}const or="0123456789abcdef";function sr(e,t){if(t||(t={}),"number"==typeof e){$n.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=or[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Jn(e))return e.toHexString();if(ar(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":$n.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(er(e)){let t="0x";for(let n=0;n<e.length;n++){let r=e[n];t+=or[(240&r)>>4]+or[15&r]}return t}return $n.throwArgumentError("invalid hexlify value","value",e)}function ur(e){if("string"!=typeof e)e=sr(e);else if(!ar(e)||e.length%2)return null;return(e.length-2)/2}function cr(e,t,n){return"string"!=typeof e?e=sr(e):(!ar(e)||e.length%2)&&$n.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=n?"0x"+e.substring(t,2+2*n):"0x"+e.substring(t)}function fr(e){let t="0x";return e.forEach((e=>{t+=sr(e).substring(2)})),t}function dr(e){const t=lr(sr(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function lr(e){"string"!=typeof e&&(e=sr(e)),ar(e)||$n.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t<e.length&&"0"===e[t];)t++;return"0x"+e.substring(t)}function pr(e,t){for("string"!=typeof e?e=sr(e):ar(e)||$n.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&$n.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function hr(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Qn(e)){let n=tr(e);64===n.length?(t.v=27+(n[32]>>7),n[32]&=127,t.r=sr(n.slice(0,32)),t.s=sr(n.slice(32,64))):65===n.length?(t.r=sr(n.slice(0,32)),t.s=sr(n.slice(32,64)),t.v=n[64]):$n.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:$n.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(n[32]|=128),t._vs=sr(n.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const n=ir(tr(t._vs),32);t._vs=sr(n);const r=n[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=r:t.recoveryParam!==r&&$n.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),n[0]&=127;const i=sr(n);null==t.s?t.s=i:t.s!==i&&$n.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?$n.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{const n=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==n&&$n.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&ar(t.r)?t.r=pr(t.r,32):$n.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&ar(t.s)?t.s=pr(t.s,32):$n.throwArgumentError("signature missing or invalid s","signature",e);const n=tr(t.s);n[0]>=128&&$n.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(n[0]|=128);const r=sr(n);t._vs&&(ar(t._vs)||$n.throwArgumentError("signature invalid _vs","signature",e),t._vs=pr(t._vs,32)),null==t._vs?t._vs=r:t._vs!==r&&$n.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function br(e){return sr(nr([(e=hr(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}var mr=Object.freeze({__proto__:null,arrayify:tr,concat:nr,hexConcat:fr,hexDataLength:ur,hexDataSlice:cr,hexStripZeros:lr,hexValue:dr,hexZeroPad:pr,hexlify:sr,isBytes:er,isBytesLike:Qn,isHexString:ar,joinSignature:br,splitSignature:hr,stripZeros:rr,zeroPad:ir});const yr="bignumber/5.7.0";var gr=Fn.BN;const vr=new Wn(yr),wr={},_r=9007199254740991;let Er=!1,Tr=class e{constructor(e,t){e!==wr&&vr.throwError("cannot call constructor directly; use BigNumber.from",Wn.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Rr(Sr(this).fromTwos(e))}toTwos(e){return Rr(Sr(this).toTwos(e))}abs(){return"-"===this._hex[0]?e.from(this._hex.substring(1)):this}add(e){return Rr(Sr(this).add(Sr(e)))}sub(e){return Rr(Sr(this).sub(Sr(e)))}div(t){return e.from(t).isZero()&&kr("division-by-zero","div"),Rr(Sr(this).div(Sr(t)))}mul(e){return Rr(Sr(this).mul(Sr(e)))}mod(e){const t=Sr(e);return t.isNeg()&&kr("division-by-zero","mod"),Rr(Sr(this).umod(t))}pow(e){const t=Sr(e);return t.isNeg()&&kr("negative-power","pow"),Rr(Sr(this).pow(t))}and(e){const t=Sr(e);return(this.isNegative()||t.isNeg())&&kr("unbound-bitwise-result","and"),Rr(Sr(this).and(t))}or(e){const t=Sr(e);return(this.isNegative()||t.isNeg())&&kr("unbound-bitwise-result","or"),Rr(Sr(this).or(t))}xor(e){const t=Sr(e);return(this.isNegative()||t.isNeg())&&kr("unbound-bitwise-result","xor"),Rr(Sr(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&kr("negative-width","mask"),Rr(Sr(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&kr("negative-width","shl"),Rr(Sr(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&kr("negative-width","shr"),Rr(Sr(this).shrn(e))}eq(e){return Sr(this).eq(Sr(e))}lt(e){return Sr(this).lt(Sr(e))}lte(e){return Sr(this).lte(Sr(e))}gt(e){return Sr(this).gt(Sr(e))}gte(e){return Sr(this).gte(Sr(e))}isNegative(){return"-"===this._hex[0]}isZero(){return Sr(this).isZero()}toNumber(){try{return Sr(this).toNumber()}catch(e){kr("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return vr.throwError("this platform does not support BigInt",Wn.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?Er||(Er=!0,vr.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?vr.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Wn.errors.UNEXPECTED_ARGUMENT,{}):vr.throwError("BigNumber.toString does not accept parameters",Wn.errors.UNEXPECTED_ARGUMENT,{})),Sr(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof e)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new e(wr,Ar(t)):t.match(/^-?[0-9]+$/)?new e(wr,Ar(new gr(t))):vr.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&kr("underflow","BigNumber.from",t),(t>=_r||t<=-_r)&&kr("overflow","BigNumber.from",t),e.from(String(t));const n=t;if("bigint"==typeof n)return e.from(n.toString());if(er(n))return e.from(sr(n));if(n)if(n.toHexString){const t=n.toHexString();if("string"==typeof t)return e.from(t)}else{let t=n._hex;if(null==t&&"BigNumber"===n.type&&(t=n.hex),"string"==typeof t&&(ar(t)||"-"===t[0]&&ar(t.substring(1))))return e.from(t)}return vr.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(e){return!(!e||!e._isBigNumber)}};function Ar(e){if("string"!=typeof e)return Ar(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&vr.throwArgumentError("invalid hex","value",e),"0x00"===(e=Ar(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function Rr(e){return Tr.from(Ar(e))}function Sr(e){const t=Tr.from(e).toHexString();return"-"===t[0]?new gr("-"+t.substring(3),16):new gr(t.substring(2),16)}function kr(e,t,n){const r={fault:e,operation:t};return null!=n&&(r.value=n),vr.throwError(e,Wn.errors.NUMERIC_FAULT,r)}const Or=new Wn(yr),Ir={},xr=Tr.from(0),Cr=Tr.from(-1);function Mr(e,t,n,r){const i={fault:t,operation:n};return void 0!==r&&(i.value=r),Or.throwError(e,Wn.errors.NUMERIC_FAULT,i)}let Nr="0";for(;Nr.length<256;)Nr+=Nr;function Pr(e){if("number"!=typeof e)try{e=Tr.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+Nr.substring(0,e):Or.throwArgumentError("invalid decimal size","decimals",e)}function Br(e,t){null==t&&(t=0);const n=Pr(t),r=(e=Tr.from(e)).lt(xr);r&&(e=e.mul(Cr));let i=e.mod(n).toString();for(;i.length<n.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const a=e.div(n).toString();return e=1===n.length?a:a+"."+i,r&&(e="-"+e),e}function Dr(e,t){null==t&&(t=0);const n=Pr(t);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||Or.throwArgumentError("invalid decimal value","value",e);const r="-"===e.substring(0,1);r&&(e=e.substring(1)),"."===e&&Or.throwArgumentError("missing value","value",e);const i=e.split(".");i.length>2&&Or.throwArgumentError("too many decimal points","value",e);let a=i[0],o=i[1];for(a||(a="0"),o||(o="0");"0"===o[o.length-1];)o=o.substring(0,o.length-1);for(o.length>n.length-1&&Mr("fractional component exceeds decimals","underflow","parseFixed"),""===o&&(o="0");o.length<n.length-1;)o+="0";const s=Tr.from(a),u=Tr.from(o);let c=s.mul(n).add(u);return r&&(c=c.mul(Cr)),c}class Fr{constructor(e,t,n,r){e!==Ir&&Or.throwError("cannot use FixedFormat constructor; use FixedFormat.from",Wn.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=n,this.decimals=r,this.name=(t?"":"u")+"fixed"+String(n)+"x"+String(r),this._multiplier=Pr(r),Object.freeze(this)}static from(e){if(e instanceof Fr)return e;"number"==typeof e&&(e=`fixed128x${e}`);let t=!0,n=128,r=18;if("string"==typeof e)if("fixed"===e);else if("ufixed"===e)t=!1;else{const i=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);i||Or.throwArgumentError("invalid fixed format","format",e),t="u"!==i[1],n=parseInt(i[2]),r=parseInt(i[3])}else if(e){const i=(t,n,r)=>null==e[t]?r:(typeof e[t]!==n&&Or.throwArgumentError("invalid fixed format ("+t+" not "+n+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),n=i("width","number",n),r=i("decimals","number",r)}return n%8&&Or.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),r>80&&Or.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",r),new Fr(Ir,t,n,r)}}class Lr{constructor(e,t,n,r){e!==Ir&&Or.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Wn.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=r,this._hex=t,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&Or.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=Dr(this._value,this.format.decimals),n=Dr(e._value,e.format.decimals);return Lr.fromValue(t.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=Dr(this._value,this.format.decimals),n=Dr(e._value,e.format.decimals);return Lr.fromValue(t.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=Dr(this._value,this.format.decimals),n=Dr(e._value,e.format.decimals);return Lr.fromValue(t.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=Dr(this._value,this.format.decimals),n=Dr(e._value,e.format.decimals);return Lr.fromValue(t.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=Lr.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(t=t.subUnsafe(Ur.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=Lr.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(t=t.addUnsafe(Ur.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&Or.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const n=Lr.from("1"+Nr.substring(0,e),this.format),r=jr.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(r).floor().divUnsafe(n)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&Or.throwArgumentError("invalid byte width","width",e);return pr(Tr.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Lr.fromString(this._value,e)}static fromValue(e,t,n){return null!=n||null==t||function(e){return null!=e&&(Tr.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||ar(e)||"bigint"==typeof e||er(e))}(t)||(n=t,t=null),null==t&&(t=0),null==n&&(n="fixed"),Lr.fromString(Br(e,t),Fr.from(n))}static fromString(e,t){null==t&&(t="fixed");const n=Fr.from(t),r=Dr(e,n.decimals);!n.signed&&r.lt(xr)&&Mr("unsigned value cannot be negative","overflow","value",e);let i=null;n.signed?i=r.toTwos(n.width).toHexString():(i=r.toHexString(),i=pr(i,n.width/8));const a=Br(r,n.decimals);return new Lr(Ir,i,a,n)}static fromBytes(e,t){null==t&&(t="fixed");const n=Fr.from(t);if(tr(e).length>n.width/8)throw new Error("overflow");let r=Tr.from(e);n.signed&&(r=r.fromTwos(n.width));const i=r.toTwos((n.signed?0:1)+n.width).toHexString(),a=Br(r,n.decimals);return new Lr(Ir,i,a,n)}static from(e,t){if("string"==typeof e)return Lr.fromString(e,t);if(er(e))return Lr.fromBytes(e,t);try{return Lr.fromValue(e,0,t)}catch(e){if(e.code!==Wn.errors.INVALID_ARGUMENT)throw e}return Or.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const Ur=Lr.from(1),jr=Lr.from("0.5");var qr=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))};const zr=new Wn("properties/5.7.0");function Hr(e,t,n){Object.defineProperty(e,t,{enumerable:!0,value:n,writable:!1})}function Vr(e,t){for(let n=0;n<32;n++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function Gr(e){return qr(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const n=e[t];return Promise.resolve(n).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function Kr(e,t){e&&"object"==typeof e||zr.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((n=>{t[n]||zr.throwArgumentError("invalid object key - "+n,"transaction:"+n,e)}))}function Wr(e){const t={};for(const n in e)t[n]=e[n];return t}const Xr={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function $r(e){if(null==e||Xr[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let n=0;n<t.length;n++){let r=null;try{r=e[t[n]]}catch(e){continue}if(!$r(r))return!1}return!0}return zr.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function Jr(e){if($r(e))return e;if(Array.isArray(e))return Object.freeze(e.map((e=>Yr(e))));if("object"==typeof e){const t={};for(const n in e){const r=e[n];void 0!==r&&Hr(t,n,Yr(r))}return t}return zr.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function Yr(e){return Jr(e)}let Qr=class{constructor(e){for(const t in e)this[t]=Yr(e[t])}};var Zr=Object.freeze({__proto__:null,Description:Qr,checkProperties:Kr,deepCopy:Yr,defineReadOnly:Hr,getStatic:Vr,resolveProperties:Gr,shallowCopy:Wr});const ei="abi/5.7.0",ti=new Wn(ei),ni={};let ri={calldata:!0,memory:!0,storage:!0},ii={calldata:!0,memory:!0};function ai(e,t){if("bytes"===e||"string"===e){if(ri[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&ii[t])return!0;return(ri[t]||"payable"===t)&&ti.throwArgumentError("invalid modifier","name",t),!1}function oi(e,t){for(let n in t)Hr(e,n,t[n])}const si=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),ui=new RegExp(/^(.*)\[([0-9]*)\]$/);let ci=class e{constructor(t,n){t!==ni&&ti.throwError("use fromString",Wn.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),oi(this,n);let r=this.type.match(ui);oi(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:e.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=si.sighash),si[e]||ti.throwArgumentError("invalid format type","format",e),e===si.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==si.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===si.full?", ":",")+")"):t+=this.type,e!==si.sighash&&(!0===this.indexed&&(t+=" indexed"),e===si.full&&this.name&&(t+=" "+this.name)),t}static from(t,n){return"string"==typeof t?e.fromString(t,n):e.fromObject(t)}static fromObject(t){return e.isParamType(t)?t:new e(ni,{name:t.name||null,type:wi(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(e.fromObject):null})}static fromString(t,n){return r=function(e,t){let n=e;function r(t){ti.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function i(e){let n={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(n.indexed=!1),n}e=e.replace(/\s/g," ");let a={type:"",name:"",state:{allowType:!0}},o=a;for(let n=0;n<e.length;n++){let a=e[n];switch(a){case"(":o.state.allowType&&""===o.type?o.type="tuple":o.state.allowParams||r(n),o.state.allowType=!1,o.type=wi(o.type),o.components=[i(o)],o=o.components[0];break;case")":delete o.state,"indexed"===o.name&&(t||r(n),o.indexed=!0,o.name=""),ai(o.type,o.name)&&(o.name=""),o.type=wi(o.type);let e=o;o=o.parent,o||r(n),delete e.parent,o.state.allowParams=!1,o.state.allowName=!0,o.state.allowArray=!0;break;case",":delete o.state,"indexed"===o.name&&(t||r(n),o.indexed=!0,o.name=""),ai(o.type,o.name)&&(o.name=""),o.type=wi(o.type);let s=i(o.parent);o.parent.components.push(s),delete o.parent,o=s;break;case" ":o.state.allowType&&""!==o.type&&(o.type=wi(o.type),delete o.state.allowType,o.state.allowName=!0,o.state.allowParams=!0),o.state.allowName&&""!==o.name&&("indexed"===o.name?(t||r(n),o.indexed&&r(n),o.indexed=!0,o.name=""):ai(o.type,o.name)?o.name="":o.state.allowName=!1);break;case"[":o.state.allowArray||r(n),o.type+=a,o.state.allowArray=!1,o.state.allowName=!1,o.state.readArray=!0;break;case"]":o.state.readArray||r(n),o.type+=a,o.state.readArray=!1,o.state.allowArray=!0,o.state.allowName=!0;break;default:o.state.allowType?(o.type+=a,o.state.allowParams=!0,o.state.allowArray=!0):o.state.allowName?(o.name+=a,delete o.state.allowArray):o.state.readArray?o.type+=a:r(n)}}return o.parent&&ti.throwArgumentError("unexpected eof","param",e),delete a.state,"indexed"===o.name?(t||r(n.length-7),o.indexed&&r(n.length-7),o.indexed=!0,o.name=""):ai(o.type,o.name)&&(o.name=""),a.type=wi(a.type),a}(t,!!n),e.fromObject({name:r.name,type:r.type,indexed:r.indexed,components:r.components});var r}static isParamType(e){return!(null==e||!e._isParamType)}};function fi(e,t){return function(e){e=e.trim();let t=[],n="",r=0;for(let i=0;i<e.length;i++){let a=e[i];","===a&&0===r?(t.push(n),n=""):(n+=a,"("===a?r++:")"===a&&(r--,-1===r&&ti.throwArgumentError("unbalanced parenthesis","value",e)))}n&&t.push(n);return t}(e).map((e=>ci.fromString(e,t)))}let di=class e{constructor(e,t){e!==ni&&ti.throwError("use a static from method",Wn.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),oi(this,t),this._isFragment=!0,Object.freeze(this)}static from(t){return e.isFragment(t)?t:"string"==typeof t?e.fromString(t):e.fromObject(t)}static fromObject(t){if(e.isFragment(t))return t;switch(t.type){case"function":return yi.fromObject(t);case"event":return li.fromObject(t);case"constructor":return mi.fromObject(t);case"error":return vi.fromObject(t);case"fallback":case"receive":return null}return ti.throwArgumentError("invalid fragment object","value",t)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?li.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?yi.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?mi.fromString(e.trim()):"error"===e.split(" ")[0]?vi.fromString(e.substring(5).trim()):ti.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}},li=class e extends di{format(e){if(e||(e=si.sighash),si[e]||ti.throwArgumentError("invalid format type","format",e),e===si.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==si.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===si.full?", ":",")+") ",e!==si.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(t){return"string"==typeof t?e.fromString(t):e.fromObject(t)}static fromObject(t){if(e.isEventFragment(t))return t;"event"!==t.type&&ti.throwArgumentError("invalid event object","value",t);const n={name:Ei(t.name),anonymous:t.anonymous,inputs:t.inputs?t.inputs.map(ci.fromObject):[],type:"event"};return new e(ni,n)}static fromString(t){let n=t.match(Ti);n||ti.throwArgumentError("invalid event string","value",t);let r=!1;return n[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:ti.warn("unknown modifier: "+e)}})),e.fromObject({name:n[1].trim(),anonymous:r,inputs:fi(n[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}};function pi(e,t){t.gas=null;let n=e.split("@");return 1!==n.length?(n.length>2&&ti.throwArgumentError("invalid human-readable ABI signature","value",e),n[1].match(/^[0-9]+$/)||ti.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=Tr.from(n[1]),n[0]):e}function hi(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function bi(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&ti.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&ti.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||ti.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&ti.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&ti.throwArgumentError("unable to determine stateMutability","value",e),t}let mi=class e extends di{format(e){if(e||(e=si.sighash),si[e]||ti.throwArgumentError("invalid format type","format",e),e===si.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});e===si.sighash&&ti.throwError("cannot format a constructor for sighash",Wn.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===si.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(t){return"string"==typeof t?e.fromString(t):e.fromObject(t)}static fromObject(t){if(e.isConstructorFragment(t))return t;"constructor"!==t.type&&ti.throwArgumentError("invalid constructor object","value",t);let n=bi(t);n.constant&&ti.throwArgumentError("constructor cannot be constant","value",t);const r={name:null,type:t.type,inputs:t.inputs?t.inputs.map(ci.fromObject):[],payable:n.payable,stateMutability:n.stateMutability,gas:t.gas?Tr.from(t.gas):null};return new e(ni,r)}static fromString(t){let n={type:"constructor"},r=(t=pi(t,n)).match(Ti);return r&&"constructor"===r[1].trim()||ti.throwArgumentError("invalid constructor string","value",t),n.inputs=fi(r[2].trim(),!1),hi(r[3].trim(),n),e.fromObject(n)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}},yi=class e extends mi{format(e){if(e||(e=si.sighash),si[e]||ti.throwArgumentError("invalid format type","format",e),e===si.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==si.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===si.full?", ":",")+") ",e!==si.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(t){return"string"==typeof t?e.fromString(t):e.fromObject(t)}static fromObject(t){if(e.isFunctionFragment(t))return t;"function"!==t.type&&ti.throwArgumentError("invalid function object","value",t);let n=bi(t);const r={type:t.type,name:Ei(t.name),constant:n.constant,inputs:t.inputs?t.inputs.map(ci.fromObject):[],outputs:t.outputs?t.outputs.map(ci.fromObject):[],payable:n.payable,stateMutability:n.stateMutability,gas:t.gas?Tr.from(t.gas):null};return new e(ni,r)}static fromString(t){let n={type:"function"},r=(t=pi(t,n)).split(" returns ");r.length>2&&ti.throwArgumentError("invalid function string","value",t);let i=r[0].match(Ti);if(i||ti.throwArgumentError("invalid function signature","value",t),n.name=i[1].trim(),n.name&&Ei(n.name),n.inputs=fi(i[2],!1),hi(i[3].trim(),n),r.length>1){let e=r[1].match(Ti);""==e[1].trim()&&""==e[3].trim()||ti.throwArgumentError("unexpected tokens","value",t),n.outputs=fi(e[2],!1)}else n.outputs=[];return e.fromObject(n)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}};function gi(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||ti.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}let vi=class e extends di{format(e){if(e||(e=si.sighash),si[e]||ti.throwArgumentError("invalid format type","format",e),e===si.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==si.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===si.full?", ":",")+") ",t.trim()}static from(t){return"string"==typeof t?e.fromString(t):e.fromObject(t)}static fromObject(t){if(e.isErrorFragment(t))return t;"error"!==t.type&&ti.throwArgumentError("invalid error object","value",t);const n={type:t.type,name:Ei(t.name),inputs:t.inputs?t.inputs.map(ci.fromObject):[]};return gi(new e(ni,n))}static fromString(t){let n={type:"error"},r=t.match(Ti);return r||ti.throwArgumentError("invalid error signature","value",t),n.name=r[1].trim(),n.name&&Ei(n.name),n.inputs=fi(r[2],!1),gi(e.fromObject(n))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}};function wi(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const _i=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Ei(e){return e&&e.match(_i)||ti.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const Ti=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const Ai=new Wn(ei);function Ri(e){const t=[],n=function(e,r){if(Array.isArray(r))for(let i in r){const a=e.slice();a.push(i);try{n(a,r[i])}catch(e){t.push({path:a,error:e})}}};return n([],e),t}let Si=class{constructor(e,t,n,r){this.name=e,this.type=t,this.localName=n,this.dynamic=r}_throwError(e,t){Ai.throwArgumentError(e,this.localName,t)}},ki=class{constructor(e){Hr(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return fr(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(nr(e._data))}writeBytes(e){let t=tr(e);const n=t.length%this.wordSize;return n&&(t=nr([t,this._padding.slice(n)])),this._writeData(t)}_getValue(e){let t=tr(Tr.from(e));return t.length>this.wordSize&&Ai.throwError("value out-of-bounds",Wn.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=nr([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}};var Oi={exports:{}};
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).immutable={})}(this,(function(e){"use strict";var t;!function(e){e.PRODUCTION="production",e.SANDBOX="sandbox"}(t||(t={}));class n{environment;apiKey;constructor(e){this.environment=e.environment,this.apiKey=e.apiKey}}var r=Object.freeze({__proto__:null,get Environment(){return t},ImmutableConfiguration:n});function i(e,t){return function(){return e.apply(t,arguments)}}const{toString:a}=Object.prototype,{getPrototypeOf:o}=Object,s=(u=Object.create(null),e=>{const t=a.call(e);return u[t]||(u[t]=t.slice(8,-1).toLowerCase())});var u;const c=e=>(e=e.toLowerCase(),t=>s(t)===e),f=e=>t=>typeof t===e,{isArray:d}=Array,l=f("undefined");const p=c("ArrayBuffer");const h=f("string"),b=f("function"),m=f("number"),y=e=>null!==e&&"object"==typeof e,g=e=>{if("object"!==s(e))return!1;const t=o(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},v=c("Date"),w=c("File"),_=c("Blob"),E=c("FileList"),T=c("URLSearchParams");function A(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),d(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function R(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const S="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,k=e=>!l(e)&&e!==S;const O=(I="undefined"!=typeof Uint8Array&&o(Uint8Array),e=>I&&e instanceof I);var I;const x=c("HTMLFormElement"),C=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),M=c("RegExp"),N=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};A(n,((n,i)=>{!1!==t(n,i,e)&&(r[i]=n)})),Object.defineProperties(e,r)},P="abcdefghijklmnopqrstuvwxyz",B="0123456789",D={DIGIT:B,ALPHA:P,ALPHA_DIGIT:P+P.toUpperCase()+B};const F=c("AsyncFunction");var L={isArray:d,isArrayBuffer:p,isBuffer:function(e){return null!==e&&!l(e)&&null!==e.constructor&&!l(e.constructor)&&b(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||b(e.append)&&("formdata"===(t=s(e))||"object"===t&&b(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&p(e.buffer),t},isString:h,isNumber:m,isBoolean:e=>!0===e||!1===e,isObject:y,isPlainObject:g,isUndefined:l,isDate:v,isFile:w,isBlob:_,isRegExp:M,isFunction:b,isStream:e=>y(e)&&b(e.pipe),isURLSearchParams:T,isTypedArray:O,isFileList:E,forEach:A,merge:function e(){const{caseless:t}=k(this)&&this||{},n={},r=(r,i)=>{const a=t&&R(n,i)||i;g(n[a])&&g(r)?n[a]=e(n[a],r):g(r)?n[a]=e({},r):d(r)?n[a]=r.slice():n[a]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&A(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(A(t,((t,r)=>{n&&b(t)?e[r]=i(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,a,s;const u={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)s=i[a],r&&!r(s,e,t)||u[s]||(t[s]=e[s],u[s]=!0);e=!1!==n&&o(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:s,kindOfTest:c,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(d(e))return e;let t=e.length;if(!m(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:x,hasOwnProperty:C,hasOwnProp:C,reduceDescriptors:N,freezeMethods:e=>{N(e,((t,n)=>{if(b(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];b(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return d(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:R,global:S,isContextDefined:k,ALPHABET:D,generateString:(e=16,t=D.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&b(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(y(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const i=d(e)?[]:{};return A(e,((e,t)=>{const a=n(e,r+1);!l(a)&&(i[t]=a)})),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:F,isThenable:e=>e&&(y(e)||b(e))&&b(e.then)&&b(e.catch)};function U(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}L.inherits(U,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:L.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const j=U.prototype,q={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{q[e]={value:e}})),Object.defineProperties(U,q),Object.defineProperty(j,"isAxiosError",{value:!0}),U.from=(e,t,n,r,i,a)=>{const o=Object.create(j);return L.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),U.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};function z(e){return L.isPlainObject(e)||L.isArray(e)}function H(e){return L.endsWith(e,"[]")?e.slice(0,-2):e}function V(e,t,n){return e?e.concat(t).map((function(e,t){return e=H(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const G=L.toFlatObject(L,{},null,(function(e){return/^is[A-Z]/.test(e)}));function K(e,t,n){if(!L.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=L.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!L.isUndefined(t[e])}))).metaTokens,i=n.visitor||c,a=n.dots,o=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&L.isSpecCompliantForm(t);if(!L.isFunction(i))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(L.isDate(e))return e.toISOString();if(!s&&L.isBlob(e))throw new U("Blob is not supported. Use a Buffer instead.");return L.isArrayBuffer(e)||L.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,i){let s=e;if(e&&!i&&"object"==typeof e)if(L.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(L.isArray(e)&&function(e){return L.isArray(e)&&!e.some(z)}(e)||(L.isFileList(e)||L.endsWith(n,"[]"))&&(s=L.toArray(e)))return n=H(n),s.forEach((function(e,r){!L.isUndefined(e)&&null!==e&&t.append(!0===o?V([n],r,a):null===o?n:n+"[]",u(e))})),!1;return!!z(e)||(t.append(V(i,n,a),u(e)),!1)}const f=[],d=Object.assign(G,{defaultVisitor:c,convertValue:u,isVisitable:z});if(!L.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!L.isUndefined(n)){if(-1!==f.indexOf(n))throw Error("Circular reference detected in "+r.join("."));f.push(n),L.forEach(n,(function(n,a){!0===(!(L.isUndefined(n)||null===n)&&i.call(t,n,L.isString(a)?a.trim():a,r,d))&&e(n,r?r.concat(a):[a])})),f.pop()}}(e),t}function W(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function X(e,t){this._pairs=[],e&&K(e,this,t)}const $=X.prototype;function J(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Y(e,t,n){if(!t)return e;const r=n&&n.encode||J,i=n&&n.serialize;let a;if(a=i?i(t,n):L.isURLSearchParams(t)?t.toString():new X(t,n).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}$.append=function(e,t){this._pairs.push([e,t])},$.toString=function(e){const t=e?function(t){return e.call(this,t,W)}:W;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var Q=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){L.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Z={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var ee={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:X,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&("undefined"!=typeof window&&"undefined"!=typeof document)})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};function te(e){function t(e,n,r,i){let a=e[i++];const o=Number.isFinite(+a),s=i>=e.length;if(a=!a&&L.isArray(r)?r.length:a,s)return L.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!o;r[a]&&L.isObject(r[a])||(r[a]=[]);return t(e,n,r[a],i)&&L.isArray(r[a])&&(r[a]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}(r[a])),!o}if(L.isFormData(e)&&L.isFunction(e.entries)){const n={};return L.forEachEntry(e,((e,r)=>{t(function(e){return L.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const ne={"Content-Type":void 0};const re={transitional:Z,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=L.isObject(e);i&&L.isHTMLForm(e)&&(e=new FormData(e));if(L.isFormData(e))return r&&r?JSON.stringify(te(e)):e;if(L.isArrayBuffer(e)||L.isBuffer(e)||L.isStream(e)||L.isFile(e)||L.isBlob(e))return e;if(L.isArrayBufferView(e))return e.buffer;if(L.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return K(e,new ee.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return ee.isNode&&L.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=L.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return K(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(L.isString(e))try{return(t||JSON.parse)(e),L.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||re.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&L.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw U.from(e,U.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ee.classes.FormData,Blob:ee.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};L.forEach(["delete","get","head"],(function(e){re.headers[e]={}})),L.forEach(["post","put","patch"],(function(e){re.headers[e]=L.merge(ne)}));var ie=re;const ae=L.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const oe=Symbol("internals");function se(e){return e&&String(e).trim().toLowerCase()}function ue(e){return!1===e||null==e?e:L.isArray(e)?e.map(ue):String(e)}function ce(e,t,n,r,i){return L.isFunction(r)?r.call(this,t,n):(i&&(t=n),L.isString(t)?L.isString(r)?-1!==t.indexOf(r):L.isRegExp(r)?r.test(t):void 0:void 0)}let fe=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=se(t);if(!i)throw new Error("header name must be a non-empty string");const a=L.findKey(r,i);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=ue(e))}const a=(e,t)=>L.forEach(e,((e,n)=>i(e,n,t)));return L.isPlainObject(e)||e instanceof this.constructor?a(e,t):L.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?a((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&ae[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&i(t,e,n),this}get(e,t){if(e=se(e)){const n=L.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(L.isFunction(t))return t.call(this,e,n);if(L.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=se(e)){const n=L.findKey(this,e);return!(!n||void 0===this[n]||t&&!ce(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=se(e)){const i=L.findKey(n,e);!i||t&&!ce(0,n[i],i,t)||(delete n[i],r=!0)}}return L.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!ce(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return L.forEach(this,((r,i)=>{const a=L.findKey(n,i);if(a)return t[a]=ue(r),void delete t[i];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(i):String(i).trim();o!==i&&delete t[i],t[o]=ue(r),n[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return L.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&L.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[oe]=this[oe]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=se(e);t[r]||(!function(e,t){const n=L.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})}))}(n,e),t[r]=!0)}return L.isArray(e)?e.forEach(r):r(e),this}};fe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),L.freezeMethods(fe.prototype),L.freezeMethods(fe);var de=fe;function le(e,t){const n=this||ie,r=t||n,i=de.from(r.headers);let a=r.data;return L.forEach(e,(function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)})),i.normalize(),a}function pe(e){return!(!e||!e.__CANCEL__)}function he(e,t,n){U.call(this,null==e?"canceled":e,U.ERR_CANCELED,t,n),this.name="CanceledError"}L.inherits(he,U,{__CANCEL__:!0});var be=ee.isStandardBrowserEnv?{write:function(e,t,n,r,i,a){const o=[];o.push(e+"="+encodeURIComponent(t)),L.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),L.isString(r)&&o.push("path="+r),L.isString(i)&&o.push("domain="+i),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function me(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var ye=ee.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=L.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function ge(e,t){let n=0;const r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,a=0,o=0;return t=void 0!==t?t:1e3,function(s){const u=Date.now(),c=r[o];i||(i=u),n[a]=s,r[a]=u;let f=o,d=0;for(;f!==a;)d+=n[f++],f%=e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),u-i<t)return;const l=c&&u-c;return l?Math.round(1e3*d/l):void 0}}(50,250);return i=>{const a=i.loaded,o=i.lengthComputable?i.total:void 0,s=a-n,u=r(s);n=a;const c={loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:u||void 0,estimated:u&&o&&a<=o?(o-a)/u:void 0,event:i};c[t?"download":"upload"]=!0,e(c)}}var ve="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const i=de.from(e.headers).normalize(),a=e.responseType;let o;function s(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}L.isFormData(r)&&(ee.isStandardBrowserEnv||ee.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let u=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+n))}const c=me(e.baseURL,e.url);function f(){if(!u)return;const r=de.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new U("Request failed with status code "+n.status,[U.ERR_BAD_REQUEST,U.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),s()}),(function(e){n(e),s()}),{data:a&&"text"!==a&&"json"!==a?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:r,config:e,request:u}),u=null}if(u.open(e.method.toUpperCase(),Y(c,e.params,e.paramsSerializer),!0),u.timeout=e.timeout,"onloadend"in u?u.onloadend=f:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(f)},u.onabort=function(){u&&(n(new U("Request aborted",U.ECONNABORTED,e,u)),u=null)},u.onerror=function(){n(new U("Network Error",U.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||Z;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new U(t,r.clarifyTimeoutError?U.ETIMEDOUT:U.ECONNABORTED,e,u)),u=null},ee.isStandardBrowserEnv){const t=(e.withCredentials||ye(c))&&e.xsrfCookieName&&be.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===r&&i.setContentType(null),"setRequestHeader"in u&&L.forEach(i.toJSON(),(function(e,t){u.setRequestHeader(t,e)})),L.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),a&&"json"!==a&&(u.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&u.addEventListener("progress",ge(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",ge(e.onUploadProgress)),(e.cancelToken||e.signal)&&(o=t=>{u&&(n(!t||t.type?new he(null,e,u):t),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o)));const d=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(c);d&&-1===ee.protocols.indexOf(d)?n(new U("Unsupported protocol "+d+":",U.ERR_BAD_REQUEST,e)):u.send(r||null)}))};const we={http:null,xhr:ve};L.forEach(we,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var _e=e=>{e=L.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let i=0;i<t&&(n=e[i],!(r=L.isString(n)?we[n.toLowerCase()]:n));i++);if(!r){if(!1===r)throw new U(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(L.hasOwnProp(we,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`)}if(!L.isFunction(r))throw new TypeError("adapter is not a function");return r};function Ee(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new he(null,e)}function Te(e){Ee(e),e.headers=de.from(e.headers),e.data=le.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return _e(e.adapter||ie.adapter)(e).then((function(t){return Ee(e),t.data=le.call(e,e.transformResponse,t),t.headers=de.from(t.headers),t}),(function(t){return pe(t)||(Ee(e),t&&t.response&&(t.response.data=le.call(e,e.transformResponse,t.response),t.response.headers=de.from(t.response.headers))),Promise.reject(t)}))}const Ae=e=>e instanceof de?e.toJSON():e;function Re(e,t){t=t||{};const n={};function r(e,t,n){return L.isPlainObject(e)&&L.isPlainObject(t)?L.merge.call({caseless:n},e,t):L.isPlainObject(t)?L.merge({},t):L.isArray(t)?t.slice():t}function i(e,t,n){return L.isUndefined(t)?L.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function a(e,t){if(!L.isUndefined(t))return r(void 0,t)}function o(e,t){return L.isUndefined(t)?L.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,i,a){return a in t?r(n,i):a in e?r(void 0,n):void 0}const u={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(e,t)=>i(Ae(e),Ae(t),!0)};return L.forEach(Object.keys(Object.assign({},e,t)),(function(r){const a=u[r]||i,o=a(e[r],t[r],r);L.isUndefined(o)&&a!==s||(n[r]=o)})),n}const Se="1.4.0",ke={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{ke[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Oe={};ke.transitional=function(e,t,n){function r(e,t){return"[Axios v1.4.0] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,a)=>{if(!1===e)throw new U(r(i," has been removed"+(t?" in "+t:"")),U.ERR_DEPRECATED);return t&&!Oe[i]&&(Oe[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,a)}};var Ie={assertOptions:function(e,t,n){if("object"!=typeof e)throw new U("options must be an object",U.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const a=r[i],o=t[a];if(o){const t=e[a],n=void 0===t||o(t,a,e);if(!0!==n)throw new U("option "+a+" must be "+n,U.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new U("Unknown option "+a,U.ERR_BAD_OPTION)}},validators:ke};const xe=Ie.validators;let Ce=class{constructor(e){this.defaults=e,this.interceptors={request:new Q,response:new Q}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Re(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;let a;void 0!==n&&Ie.assertOptions(n,{silentJSONParsing:xe.transitional(xe.boolean),forcedJSONParsing:xe.transitional(xe.boolean),clarifyTimeoutError:xe.transitional(xe.boolean)},!1),null!=r&&(L.isFunction(r)?t.paramsSerializer={serialize:r}:Ie.assertOptions(r,{encode:xe.function,serialize:xe.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase(),a=i&&L.merge(i.common,i[t.method]),a&&L.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=de.concat(a,i);const o=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));const u=[];let c;this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)}));let f,d=0;if(!s){const e=[Te.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,u),f=e.length,c=Promise.resolve(t);d<f;)c=c.then(e[d++],e[d++]);return c}f=o.length;let l=t;for(d=0;d<f;){const e=o[d++],t=o[d++];try{l=e(l)}catch(e){t.call(this,e);break}}try{c=Te.call(this,l)}catch(e){return Promise.reject(e)}for(d=0,f=u.length;d<f;)c=c.then(u[d++],u[d++]);return c}getUri(e){return Y(me((e=Re(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}};L.forEach(["delete","get","head","options"],(function(e){Ce.prototype[e]=function(t,n){return this.request(Re(n||{},{method:e,url:t,data:(n||{}).data}))}})),L.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,i){return this.request(Re(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ce.prototype[e]=t(),Ce.prototype[e+"Form"]=t(!0)}));var Me=Ce;var Ne=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,i){n.reason||(n.reason=new he(e,r,i),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let t;const n=new e((function(e){t=e}));return{token:n,cancel:t}}};const Pe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Pe).forEach((([e,t])=>{Pe[t]=e}));var Be=Pe;const De=function e(t){const n=new Me(t),r=i(Me.prototype.request,n);return L.extend(r,Me.prototype,n,{allOwnKeys:!0}),L.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Re(t,n))},r}(ie);De.Axios=Me,De.CanceledError=he,De.CancelToken=Ne,De.isCancel=pe,De.VERSION=Se,De.toFormData=K,De.AxiosError=U,De.Cancel=De.CanceledError,De.all=function(e){return Promise.all(e)},De.spread=function(e){return function(t){return e.apply(null,t)}},De.isAxiosError=function(e){return L.isObject(e)&&!0===e.isAxiosError},De.mergeConfig=Re,De.AxiosHeaders=de,De.formToJSON=e=>te(L.isHTMLForm(e)?new FormData(e):e),De.HttpStatusCode=Be,De.default=De;var Fe=De;const Le="https://api.sandbox.immutable.com".replace(/\/+$/,"");let Ue=class{basePath;axios;configuration;constructor(e,t=Le,n=Fe){this.basePath=t,this.axios=n,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}},je=class extends Error{field;name="RequiredError";constructor(e,t){super(t),this.field=e}};const qe="https://example.com",ze=function(e,t,n){if(null==n)throw new je(t,`Required parameter ${t} was null or undefined when calling ${e}.`)};function He(e,t,n=""){"object"==typeof t?Array.isArray(t)?t.forEach((t=>He(e,t,n))):Object.keys(t).forEach((r=>He(e,t[r],`${n}${""!==n?".":""}${r}`))):e.has(n)?e.append(n,t):e.set(n,t)}const Ve=function(e,...t){const n=new URLSearchParams(e.search);He(n,t),e.search=n.toString()},Ge=function(e,t,n){const r="string"!=typeof e;return(r&&n&&n.isJsonMime?n.isJsonMime(t.headers["Content-Type"]):r)?JSON.stringify(void 0!==e?e:{}):e||""},Ke=function(e){return e.pathname+e.search+e.hash},We=function(e,t,n,r){return(i=t,a=n)=>{const o={...e.options,url:(r?.basePath||a)+e.url};return i.request(o)}},Xe=function(e){return{getActivity:async(t,n,r={})=>{ze("getActivity","chainName",t),ze("getActivity","activityId",n);const i="/v1/chains/{chain_name}/activities/{activity_id}".replace("{chain_name}",encodeURIComponent(String(t))).replace("{activity_id}",encodeURIComponent(String(n))),a=new URL(i,qe);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...r};Ve(a,{});let u=o&&o.headers?o.headers:{};return s.headers={...u,...r.headers},{url:Ke(a),options:s}},listActivities:async(t,n,r,i,a,o,s,u,c,f,d={})=>{ze("listActivities","chainName",t);const l="/v1/chains/{chain_name}/activities".replace("{chain_name}",encodeURIComponent(String(t))),p=new URL(l,qe);let h;e&&(h=e.baseOptions);const b={method:"GET",...h,...d},m={};void 0!==n&&(m.contract_address=n),void 0!==r&&(m.token_id=r),void 0!==i&&(m.account_address=i),void 0!==a&&(m.activity_type=a),void 0!==o&&(m.from_indexed_at=o instanceof Date?o.toISOString():o),void 0!==s&&(m.to_indexed_at=s instanceof Date?s.toISOString():s),void 0!==u&&(m.transaction_hash=u),void 0!==c&&(m.page_cursor=c),void 0!==f&&(m.page_size=f),Ve(p,m);let y=h&&h.headers?h.headers:{};return b.headers={...y,...d.headers},{url:Ke(p),options:b}}}},$e=function(e){const t=Xe(e);return{async getActivity(n,r,i){const a=await t.getActivity(n,r,i);return We(a,Fe,Le,e)},async listActivities(n,r,i,a,o,s,u,c,f,d,l){const p=await t.listActivities(n,r,i,a,o,s,u,c,f,d,l);return We(p,Fe,Le,e)}}};class Je extends Ue{getActivity(e,t){return $e(this.configuration).getActivity(e.chainName,e.activityId,t).then((e=>e(this.axios,this.basePath)))}listActivities(e,t){return $e(this.configuration).listActivities(e.chainName,e.contractAddress,e.tokenId,e.accountAddress,e.activityType,e.fromIndexedAt,e.toIndexedAt,e.transactionHash,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}}const Ye=function(e){return{listChains:async(t,n,r={})=>{const i=new URL("/v1/chains",qe);let a;e&&(a=e.baseOptions);const o={method:"GET",...a,...r},s={};void 0!==t&&(s.page_cursor=t),void 0!==n&&(s.page_size=n),Ve(i,s);let u=a&&a.headers?a.headers:{};return o.headers={...u,...r.headers},{url:Ke(i),options:o}}}},Qe=function(e){const t=Ye(e);return{async listChains(n,r,i){const a=await t.listChains(n,r,i);return We(a,Fe,Le,e)}}};class Ze extends Ue{listChains(e={},t){return Qe(this.configuration).listChains(e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}}const et=function(e){return{getCollection:async(t,n,r={})=>{ze("getCollection","contractAddress",t),ze("getCollection","chainName",n);const i="/v1/chains/{chain_name}/collections/{contract_address}".replace("{contract_address}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(n))),a=new URL(i,qe);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...r};Ve(a,{});let u=o&&o.headers?o.headers:{};return s.headers={...u,...r.headers},{url:Ke(a),options:s}},listCollections:async(t,n,r,i={})=>{ze("listCollections","chainName",t);const a="/v1/chains/{chain_name}/collections".replace("{chain_name}",encodeURIComponent(String(t))),o=new URL(a,qe);let s;e&&(s=e.baseOptions);const u={method:"GET",...s,...i},c={};void 0!==n&&(c.page_cursor=n),void 0!==r&&(c.page_size=r),Ve(o,c);let f=s&&s.headers?s.headers:{};return u.headers={...f,...i.headers},{url:Ke(o),options:u}}}},tt=function(e){const t=et(e);return{async getCollection(n,r,i){const a=await t.getCollection(n,r,i);return We(a,Fe,Le,e)},async listCollections(n,r,i,a){const o=await t.listCollections(n,r,i,a);return We(o,Fe,Le,e)}}};class nt extends Ue{getCollection(e,t){return tt(this.configuration).getCollection(e.contractAddress,e.chainName,t).then((e=>e(this.axios,this.basePath)))}listCollections(e,t){return tt(this.configuration).listCollections(e.chainName,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}}const rt=function(e){return{listNFTOwners:async(t,n,r,i,a,o={})=>{ze("listNFTOwners","contractAddress",t),ze("listNFTOwners","tokenId",n),ze("listNFTOwners","chainName",r);const s="/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}/owners".replace("{contract_address}",encodeURIComponent(String(t))).replace("{token_id}",encodeURIComponent(String(n))).replace("{chain_name}",encodeURIComponent(String(r))),u=new URL(s,qe);let c;e&&(c=e.baseOptions);const f={method:"GET",...c,...o},d={};void 0!==i&&(d.page_cursor=i),void 0!==a&&(d.page_size=a),Ve(u,d);let l=c&&c.headers?c.headers:{};return f.headers={...l,...o.headers},{url:Ke(u),options:f}}}},it=function(e){const t=rt(e);return{async listNFTOwners(n,r,i,a,o,s){const u=await t.listNFTOwners(n,r,i,a,o,s);return We(u,Fe,Le,e)}}};class at extends Ue{listNFTOwners(e,t){return it(this.configuration).listNFTOwners(e.contractAddress,e.tokenId,e.chainName,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}}const ot=function(e){return{getNFT:async(t,n,r,i={})=>{ze("getNFT","contractAddress",t),ze("getNFT","tokenId",n),ze("getNFT","chainName",r);const a="/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}".replace("{contract_address}",encodeURIComponent(String(t))).replace("{token_id}",encodeURIComponent(String(n))).replace("{chain_name}",encodeURIComponent(String(r))),o=new URL(a,qe);let s;e&&(s=e.baseOptions);const u={method:"GET",...s,...i};Ve(o,{});let c=s&&s.headers?s.headers:{};return u.headers={...c,...i.headers},{url:Ke(o),options:u}},listNFTs:async(t,n,r,i,a={})=>{ze("listNFTs","contractAddress",t),ze("listNFTs","chainName",n);const o="/v1/chains/{chain_name}/collections/{contract_address}/nfts".replace("{contract_address}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(n))),s=new URL(o,qe);let u;e&&(u=e.baseOptions);const c={method:"GET",...u,...a},f={};void 0!==r&&(f.page_cursor=r),void 0!==i&&(f.page_size=i),Ve(s,f);let d=u&&u.headers?u.headers:{};return c.headers={...d,...a.headers},{url:Ke(s),options:c}},listNFTsByAccountAddress:async(t,n,r,i,a,o={})=>{ze("listNFTsByAccountAddress","accountAddress",t),ze("listNFTsByAccountAddress","chainName",n);const s="/v1/chains/{chain_name}/accounts/{account_address}/nfts".replace("{account_address}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(n))),u=new URL(s,qe);let c;e&&(c=e.baseOptions);const f={method:"GET",...c,...o},d={};void 0!==r&&(d.contract_address=r),void 0!==i&&(d.page_cursor=i),void 0!==a&&(d.page_size=a),Ve(u,d);let l=c&&c.headers?c.headers:{};return f.headers={...l,...o.headers},{url:Ke(u),options:f}}}},st=function(e){const t=ot(e);return{async getNFT(n,r,i,a){const o=await t.getNFT(n,r,i,a);return We(o,Fe,Le,e)},async listNFTs(n,r,i,a,o){const s=await t.listNFTs(n,r,i,a,o);return We(s,Fe,Le,e)},async listNFTsByAccountAddress(n,r,i,a,o,s){const u=await t.listNFTsByAccountAddress(n,r,i,a,o,s);return We(u,Fe,Le,e)}}};class ut extends Ue{getNFT(e,t){return st(this.configuration).getNFT(e.contractAddress,e.tokenId,e.chainName,t).then((e=>e(this.axios,this.basePath)))}listNFTs(e,t){return st(this.configuration).listNFTs(e.contractAddress,e.chainName,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}listNFTsByAccountAddress(e,t){return st(this.configuration).listNFTsByAccountAddress(e.accountAddress,e.chainName,e.contractAddress,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}}const ct=function(e){return{createListing:async(t,n,r={})=>{ze("createListing","chainName",t),ze("createListing","createListingRequestBody",n);const i="/v1/chains/{chain_name}/orders/listings".replace("{chain_name}",encodeURIComponent(String(t))),a=new URL(i,qe);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...r},u={};u["Content-Type"]="application/json",Ve(a,{});let c=o&&o.headers?o.headers:{};return s.headers={...u,...c,...r.headers},s.data=Ge(n,s,e),{url:Ke(a),options:s}},fulfillmentData:async(t,n,r={})=>{ze("fulfillmentData","chainName",t),ze("fulfillmentData","fulfillmentDataRequestInner",n);const i="/v1/chains/{chain_name}/orders/fulfillment_data".replace("{chain_name}",encodeURIComponent(String(t))),a=new URL(i,qe);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...r},u={};u["Content-Type"]="application/json",Ve(a,{});let c=o&&o.headers?o.headers:{};return s.headers={...u,...c,...r.headers},s.data=Ge(n,s,e),{url:Ke(a),options:s}},getListing:async(t,n,r={})=>{ze("getListing","chainName",t),ze("getListing","listingId",n);const i="/v1/chains/{chain_name}/orders/listings/{listing_id}".replace("{chain_name}",encodeURIComponent(String(t))).replace("{listing_id}",encodeURIComponent(String(n))),a=new URL(i,qe);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...r};Ve(a,{});let u=o&&o.headers?o.headers:{};return s.headers={...u,...r.headers},{url:Ke(a),options:s}},listListings:async(t,n,r,i,a,o,s,u,c,f={})=>{ze("listListings","chainName",t);const d="/v1/chains/{chain_name}/orders/listings".replace("{chain_name}",encodeURIComponent(String(t))),l=new URL(d,qe);let p;e&&(p=e.baseOptions);const h={method:"GET",...p,...f},b={};void 0!==n&&(b.status=n),void 0!==r&&(b.sell_item_contract_address=r),void 0!==i&&(b.buy_item_contract_address=i),void 0!==a&&(b.sell_item_token_id=a),void 0!==o&&(b.page_size=o),void 0!==s&&(b.sort_by=s),void 0!==u&&(b.sort_direction=u),void 0!==c&&(b.page_cursor=c),Ve(l,b);let m=p&&p.headers?p.headers:{};return h.headers={...m,...f.headers},{url:Ke(l),options:h}}}},ft=function(e){const t=ct(e);return{async createListing(n,r,i){const a=await t.createListing(n,r,i);return We(a,Fe,Le,e)},async fulfillmentData(n,r,i){const a=await t.fulfillmentData(n,r,i);return We(a,Fe,Le,e)},async getListing(n,r,i){const a=await t.getListing(n,r,i);return We(a,Fe,Le,e)},async listListings(n,r,i,a,o,s,u,c,f,d){const l=await t.listListings(n,r,i,a,o,s,u,c,f,d);return We(l,Fe,Le,e)}}};class dt extends Ue{createListing(e,t){return ft(this.configuration).createListing(e.chainName,e.createListingRequestBody,t).then((e=>e(this.axios,this.basePath)))}fulfillmentData(e,t){return ft(this.configuration).fulfillmentData(e.chainName,e.fulfillmentDataRequestInner,t).then((e=>e(this.axios,this.basePath)))}getListing(e,t){return ft(this.configuration).getListing(e.chainName,e.listingId,t).then((e=>e(this.axios,this.basePath)))}listListings(e,t){return ft(this.configuration).listListings(e.chainName,e.status,e.sellItemContractAddress,e.buyItemContractAddress,e.sellItemTokenId,e.pageSize,e.sortBy,e.sortDirection,e.pageCursor,t).then((e=>e(this.axios,this.basePath)))}}const lt=function(e){return{createCounterfactualAddress:async(t,n={})=>{ze("createCounterfactualAddress","createCounterfactualAddressRequest",t);const r=new URL("/passport-mr/v1/counterfactual-address",qe);let i;e&&(i=e.baseOptions);const a={method:"POST",...i,...n},o={};await async function(e,t){if(t&&t.accessToken){const n="function"==typeof t.accessToken?await t.accessToken():await t.accessToken;e.Authorization="Bearer "+n}}(o,e),o["Content-Type"]="application/json",Ve(r,{});let s=i&&i.headers?i.headers:{};return a.headers={...o,...s,...n.headers},a.data=Ge(t,a,e),{url:Ke(r),options:a}}}},pt=function(e){const t=lt(e);return{async createCounterfactualAddress(n,r){const i=await t.createCounterfactualAddress(n,r);return We(i,Fe,Le,e)}}};class ht extends Ue{createCounterfactualAddress(e,t){return pt(this.configuration).createCounterfactualAddress(e.createCounterfactualAddressRequest,t).then((e=>e(this.axios,this.basePath)))}}const bt=function(e){return{getERC20Token:async(t,n,r={})=>{ze("getERC20Token","contractAddress",t),ze("getERC20Token","chainName",n);const i="/v1/chains/{chain_name}/tokens/{contract_address}".replace("{contract_address}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(n))),a=new URL(i,qe);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...r};Ve(a,{});let u=o&&o.headers?o.headers:{};return s.headers={...u,...r.headers},{url:Ke(a),options:s}},listERC20Tokens:async(t,n,r,i={})=>{ze("listERC20Tokens","chainName",t);const a="/v1/chains/{chain_name}/tokens".replace("{chain_name}",encodeURIComponent(String(t))),o=new URL(a,qe);let s;e&&(s=e.baseOptions);const u={method:"GET",...s,...i},c={};void 0!==n&&(c.page_cursor=n),void 0!==r&&(c.page_size=r),Ve(o,c);let f=s&&s.headers?s.headers:{};return u.headers={...f,...i.headers},{url:Ke(o),options:u}}}},mt=function(e){const t=bt(e);return{async getERC20Token(n,r,i){const a=await t.getERC20Token(n,r,i);return We(a,Fe,Le,e)},async listERC20Tokens(n,r,i,a){const o=await t.listERC20Tokens(n,r,i,a);return We(o,Fe,Le,e)}}};var yt=Object.freeze({__proto__:null,APIError400AllOfCodeEnum:{ValidationError:"VALIDATION_ERROR"},APIError401AllOfCodeEnum:{UnauthorisedRequest:"UNAUTHORISED_REQUEST"},APIError403AllOfCodeEnum:{AuthenticationError:"AUTHENTICATION_ERROR"},APIError404AllOfCodeEnum:{ResourceNotFound:"RESOURCE_NOT_FOUND"},APIError429AllOfCodeEnum:{TooManyRequestsError:"TOO_MANY_REQUESTS_ERROR"},APIError500AllOfCodeEnum:{InternalServerError:"INTERNAL_SERVER_ERROR"},ActivitiesApi:Je,ActivitiesApiAxiosParamCreator:Xe,ActivitiesApiFactory:function(e,t,n){const r=$e(e);return{getActivity:(e,i,a)=>r.getActivity(e,i,a).then((e=>e(n,t))),listActivities:(e,i,a,o,s,u,c,f,d,l,p)=>r.listActivities(e,i,a,o,s,u,c,f,d,l,p).then((e=>e(n,t)))}},ActivitiesApiFp:$e,ActivityType:{Mint:"mint",Burn:"burn",Transfer:"transfer",Sale:"sale",Deposit:"deposit",Withdrawal:"withdrawal"},ChainsApi:Ze,ChainsApiAxiosParamCreator:Ye,ChainsApiFactory:function(e,t,n){const r=Qe(e);return{listChains:(e,i,a)=>r.listChains(e,i,a).then((e=>e(n,t)))}},ChainsApiFp:Qe,CollectionContractType:{Erc721:"ERC721"},CollectionsApi:nt,CollectionsApiAxiosParamCreator:et,CollectionsApiFactory:function(e,t,n){const r=tt(e);return{getCollection:(e,i,a)=>r.getCollection(e,i,a).then((e=>e(n,t))),listCollections:(e,i,a,o)=>r.listCollections(e,i,a,o).then((e=>e(n,t)))}},CollectionsApiFp:tt,Configuration:class{apiKey;username;password;accessToken;basePath;baseOptions;formDataCtor;constructor(e={}){this.apiKey=e.apiKey,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.baseOptions=e.baseOptions,this.formDataCtor=e.formDataCtor}isJsonMime(e){const t=new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$","i");return null!==e&&(t.test(e)||"application/json-patch+json"===e.toLowerCase())}},CreateOrderProtocolDataOrderTypeEnum:{FullRestricted:"FULL_RESTRICTED"},ERC20ItemItemTypeEnum:{Erc20:"ERC20"},ERC721ItemItemTypeEnum:{Erc721:"ERC721"},FeeFeeTypeEnum:{Royalty:"ROYALTY"},NFTContractType:{Erc721:"ERC721"},NativeItemItemTypeEnum:{Native:"NATIVE"},NftOwnersApi:at,NftOwnersApiAxiosParamCreator:rt,NftOwnersApiFactory:function(e,t,n){const r=it(e);return{listNFTOwners:(e,i,a,o,s,u)=>r.listNFTOwners(e,i,a,o,s,u).then((e=>e(n,t)))}},NftOwnersApiFp:it,NftsApi:ut,NftsApiAxiosParamCreator:ot,NftsApiFactory:function(e,t,n){const r=st(e);return{getNFT:(e,i,a,o)=>r.getNFT(e,i,a,o).then((e=>e(n,t))),listNFTs:(e,i,a,o,s)=>r.listNFTs(e,i,a,o,s).then((e=>e(n,t))),listNFTsByAccountAddress:(e,i,a,o,s,u)=>r.listNFTsByAccountAddress(e,i,a,o,s,u).then((e=>e(n,t)))}},NftsApiFp:st,OrderStatus:{Pending:"PENDING",Active:"ACTIVE",Inactive:"INACTIVE",Filled:"FILLED",Cancelled:"CANCELLED",Expired:"EXPIRED"},OrdersApi:dt,OrdersApiAxiosParamCreator:ct,OrdersApiFactory:function(e,t,n){const r=ft(e);return{createListing:(e,i,a)=>r.createListing(e,i,a).then((e=>e(n,t))),fulfillmentData:(e,i,a)=>r.fulfillmentData(e,i,a).then((e=>e(n,t))),getListing:(e,i,a)=>r.getListing(e,i,a).then((e=>e(n,t))),listListings:(e,i,a,o,s,u,c,f,d,l)=>r.listListings(e,i,a,o,s,u,c,f,d,l).then((e=>e(n,t)))}},OrdersApiFp:ft,PassportApi:ht,PassportApiAxiosParamCreator:lt,PassportApiFactory:function(e,t,n){const r=pt(e);return{createCounterfactualAddress:(e,i)=>r.createCounterfactualAddress(e,i).then((e=>e(n,t)))}},PassportApiFp:pt,SaleFeeTypeEnum:{Royalty:"ROYALTY"},TokenContractType:{Erc20:"ERC20"},TokensApi:class extends Ue{getERC20Token(e,t){return mt(this.configuration).getERC20Token(e.contractAddress,e.chainName,t).then((e=>e(this.axios,this.basePath)))}listERC20Tokens(e,t){return mt(this.configuration).listERC20Tokens(e.chainName,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}},TokensApiAxiosParamCreator:bt,TokensApiFactory:function(e,t,n){const r=mt(e);return{getERC20Token:(e,i,a)=>r.getERC20Token(e,i,a).then((e=>e(n,t))),listERC20Tokens:(e,i,a,o)=>r.listERC20Tokens(e,i,a,o).then((e=>e(n,t)))}},TokensApiFp:mt});class gt{config;activitiesApi;chainsApi;collectionApi;nftOwnersApi;nftsApi;ordersApi;passportApi;constructor(e){this.config=e,this.activitiesApi=new Je(e.indexer),this.chainsApi=new Ze(e.indexer),this.collectionApi=new nt(e.indexer),this.nftOwnersApi=new at(e.indexer),this.nftsApi=new ut(e.indexer),this.ordersApi=new dt(e.orderBook),this.passportApi=new ht(e.passport)}}const vt={"x-sdk-version":"ts-immutable-sdk-0.13.1-alpha"},wt=({basePath:e,headers:t})=>{if(!e.trim())throw Error("basePath can not be empty");const n={basePath:e,baseOptions:{headers:{...vt,...t||{}}}};return new class{apiKey;username;password;accessToken;basePath;baseOptions;formDataCtor;constructor(e={}){this.apiKey=e.apiKey,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.baseOptions=e.baseOptions,this.formDataCtor=e.formDataCtor}isJsonMime(e){const t=new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$","i");return null!==e&&(t.test(e)||"application/json-patch+json"===e.toLowerCase())}}(n)},_t=()=>({indexer:wt({basePath:"https://indexer-mr.imtbl.com"}),orderBook:wt({basePath:"https://order-book-mr.imtbl.com"}),passport:wt({basePath:"https://api.immutable.com"})}),Et=()=>({indexer:wt({basePath:"https://api.sandbox.immutable.com"}),orderBook:wt({basePath:"https://api.sandbox.immutable.com"}),passport:wt({basePath:"https://api.sandbox.immutable.com"})});class Tt extends Error{code;details;link;traceId;constructor({message:e,code:t,details:n,link:r,trace_id:i}){super(e),this.code=t,this.details=n,this.link=r,this.traceId=i}}const At={sdkVersion:"ts-immutable-sdk-multi-rollup-api-client-0.13.1-alpha"},Rt=({basePath:e,headers:t})=>{if(!e.trim())throw Error("basePath can not be empty");const n={basePath:e,baseOptions:{headers:{...t||{},...At}}};return new yt.Configuration(n)},St=()=>Rt({basePath:"https://api.sandbox.immutable.com"});class kt{apiConfig;baseConfig;constructor({baseConfig:e,overrides:n}){if(this.baseConfig=e,n)this.apiConfig=Rt(n);else switch(e.environment){case t.SANDBOX:this.apiConfig=St();break;case t.PRODUCTION:this.apiConfig=Rt({basePath:"https://indexer-mr.imtbl.com"});break;default:this.apiConfig=St()}}}function Ot(e){if(Fe.isAxiosError(e)&&e.response){const t=e.response.data;return t.code&&t.message?new Tt({code:t.code,message:t.message,details:t.details||null,link:t.link||"",trace_id:t.trace_id||""}):new Tt({code:e.code??e.response?.status.toString()??"unknown_error_code",message:String(e),details:null,link:"",trace_id:""})}return new Tt({code:"unknown_error_code",message:String(e),details:null,link:"",trace_id:""})}var It=Object.freeze({__proto__:null,APIError:Tt,BlockchainData:class{config;activities;chains;collections;nfts;nftOwners;tokens;constructor(e){this.config=new kt(e),this.activities=new yt.ActivitiesApi(this.config.apiConfig),this.chains=new yt.ChainsApi(this.config.apiConfig),this.collections=new yt.CollectionsApi(this.config.apiConfig),this.nfts=new yt.NftsApi(this.config.apiConfig),this.nftOwners=new yt.NftOwnersApi(this.config.apiConfig),this.tokens=new yt.TokensApi(this.config.apiConfig)}async listActivities(e){return await this.activities.listActivities(e).then((e=>e.data)).catch((e=>{throw Ot(e)}))}async getActivity(e){return await this.activities.getActivity(e).then((e=>e.data)).catch((e=>{throw Ot(e)}))}async listChains(e){return await this.chains.listChains(e).then((e=>e.data)).catch((e=>{throw Ot(e)}))}async listCollections(e){return await this.collections.listCollections(e).then((e=>e.data)).catch((e=>{throw Ot(e)}))}async getCollection(e){return await this.collections.getCollection(e).then((e=>e.data)).catch((e=>{throw Ot(e)}))}async getNFT(e){return await this.nfts.getNFT(e).then((e=>e.data)).catch((e=>{throw Ot(e)}))}async listNFTs(e){return await this.nfts.listNFTs(e).then((e=>e.data)).catch((e=>{throw Ot(e)}))}async listNFTsByAccountAddress(e){return await this.nfts.listNFTsByAccountAddress(e).then((e=>e.data)).catch((e=>{throw Ot(e)}))}async listNFTOwners(e){return await this.nftOwners.listNFTOwners(e).then((e=>e.data)).catch((e=>{throw Ot(e)}))}async listTokens(e){return await this.tokens.listERC20Tokens(e).then((e=>e.data)).catch((e=>{throw Ot(e)}))}async getToken(e){return await this.tokens.getERC20Token(e).then((e=>e.data)).catch((e=>{throw Ot(e)}))}}}),xt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ct(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Mt(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){if(this instanceof e){var n=[null];return n.push.apply(n,arguments),new(Function.bind.apply(t,n))}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var Nt={exports:{}},Pt="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},Bt=[],Dt=[],Ft="undefined"!=typeof Uint8Array?Uint8Array:Array,Lt=!1;function Ut(){Lt=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)Bt[t]=e[t],Dt[e.charCodeAt(t)]=t;Dt["-".charCodeAt(0)]=62,Dt["_".charCodeAt(0)]=63}function jt(e,t,n){for(var r,i,a=[],o=t;o<n;o+=3)r=(e[o]<<16)+(e[o+1]<<8)+e[o+2],a.push(Bt[(i=r)>>18&63]+Bt[i>>12&63]+Bt[i>>6&63]+Bt[63&i]);return a.join("")}function qt(e){var t;Lt||Ut();for(var n=e.length,r=n%3,i="",a=[],o=16383,s=0,u=n-r;s<u;s+=o)a.push(jt(e,s,s+o>u?u:s+o));return 1===r?(t=e[n-1],i+=Bt[t>>2],i+=Bt[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=Bt[t>>10],i+=Bt[t>>4&63],i+=Bt[t<<2&63],i+="="),a.push(i),a.join("")}function zt(e,t,n,r,i){var a,o,s=8*i-r-1,u=(1<<s)-1,c=u>>1,f=-7,d=n?i-1:0,l=n?-1:1,p=e[t+d];for(d+=l,a=p&(1<<-f)-1,p>>=-f,f+=s;f>0;a=256*a+e[t+d],d+=l,f-=8);for(o=a&(1<<-f)-1,a>>=-f,f+=r;f>0;o=256*o+e[t+d],d+=l,f-=8);if(0===a)a=1-c;else{if(a===u)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,r),a-=c}return(p?-1:1)*o*Math.pow(2,a-r)}function Ht(e,t,n,r,i,a){var o,s,u,c=8*a-i-1,f=(1<<c)-1,d=f>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:a-1,h=r?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=f):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+d>=1?l/u:l*Math.pow(2,1-d))*u>=2&&(o++,u/=2),o+d>=f?(s=0,o=f):o+d>=1?(s=(t*u-1)*Math.pow(2,i),o+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[n+p]=255&s,p+=h,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;e[n+p]=255&o,p+=h,o/=256,c-=8);e[n+p-h]|=128*b}var Vt={}.toString,Gt=Array.isArray||function(e){return"[object Array]"==Vt.call(e)};$t.TYPED_ARRAY_SUPPORT=void 0===Pt.TYPED_ARRAY_SUPPORT||Pt.TYPED_ARRAY_SUPPORT;var Kt=Wt();function Wt(){return $t.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Xt(e,t){if(Wt()<t)throw new RangeError("Invalid typed array length");return $t.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=$t.prototype:(null===e&&(e=new $t(t)),e.length=t),e}function $t(e,t,n){if(!($t.TYPED_ARRAY_SUPPORT||this instanceof $t))return new $t(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return Qt(this,e)}return Jt(this,e,t,n)}function Jt(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);$t.TYPED_ARRAY_SUPPORT?(e=t).__proto__=$t.prototype:e=Zt(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!$t.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|nn(t,n);e=Xt(e,r);var i=e.write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(tn(t)){var n=0|en(t.length);return 0===(e=Xt(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?Xt(e,0):Zt(e,t);if("Buffer"===t.type&&Gt(t.data))return Zt(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function Yt(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function Qt(e,t){if(Yt(t),e=Xt(e,t<0?0:0|en(t)),!$t.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function Zt(e,t){var n=t.length<0?0:0|en(t.length);e=Xt(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function en(e){if(e>=Wt())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Wt().toString(16)+" bytes");return 0|e}function tn(e){return!(null==e||!e._isBuffer)}function nn(e,t){if(tn(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return xn(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Cn(e).length;default:if(r)return xn(e).length;t=(""+t).toLowerCase(),r=!0}}function rn(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return vn(this,t,n);case"utf8":case"utf-8":return bn(this,t,n);case"ascii":return yn(this,t,n);case"latin1":case"binary":return gn(this,t,n);case"base64":return hn(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return wn(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function an(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function on(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=$t.from(t,r)),tn(t))return 0===t.length?-1:sn(e,t,n,r,i);if("number"==typeof t)return t&=255,$t.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):sn(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function sn(e,t,n,r,i){var a,o=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,n/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var f=-1;for(a=n;a<s;a++)if(c(e,a)===c(t,-1===f?0:a-f)){if(-1===f&&(f=a),a-f+1===u)return f*o}else-1!==f&&(a-=a-f),f=-1}else for(n+u>s&&(n=s-u),a=n;a>=0;a--){for(var d=!0,l=0;l<u;l++)if(c(e,a+l)!==c(t,l)){d=!1;break}if(d)return a}return-1}function un(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var o=0;o<r;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[n+o]=s}return o}function cn(e,t,n,r){return Mn(xn(t,e.length-n),e,n,r)}function fn(e,t,n,r){return Mn(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function dn(e,t,n,r){return fn(e,t,n,r)}function ln(e,t,n,r){return Mn(Cn(t),e,n,r)}function pn(e,t,n,r){return Mn(function(e,t){for(var n,r,i,a=[],o=0;o<e.length&&!((t-=2)<0);++o)r=(n=e.charCodeAt(o))>>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function hn(e,t,n){return 0===t&&n===e.length?qt(e):qt(e.slice(t,n))}function bn(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var a,o,s,u,c=e[i],f=null,d=c>239?4:c>223?3:c>191?2:1;if(i+d<=n)switch(d){case 1:c<128&&(f=c);break;case 2:128==(192&(a=e[i+1]))&&(u=(31&c)<<6|63&a)>127&&(f=u);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(u=(15&c)<<12|(63&a)<<6|63&o)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(u=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&u<1114112&&(f=u)}null===f?(f=65533,d=1):f>65535&&(f-=65536,r.push(f>>>10&1023|55296),f=56320|1023&f),r.push(f),i+=d}return function(e){var t=e.length;if(t<=mn)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=mn));return n}(r)}$t.poolSize=8192,$t._augment=function(e){return e.__proto__=$t.prototype,e},$t.from=function(e,t,n){return Jt(null,e,t,n)},$t.TYPED_ARRAY_SUPPORT&&($t.prototype.__proto__=Uint8Array.prototype,$t.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&$t[Symbol.species]),$t.alloc=function(e,t,n){return function(e,t,n,r){return Yt(t),t<=0?Xt(e,t):void 0!==n?"string"==typeof r?Xt(e,t).fill(n,r):Xt(e,t).fill(n):Xt(e,t)}(null,e,t,n)},$t.allocUnsafe=function(e){return Qt(null,e)},$t.allocUnsafeSlow=function(e){return Qt(null,e)},$t.isBuffer=Nn,$t.compare=function(e,t){if(!tn(e)||!tn(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},$t.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},$t.concat=function(e,t){if(!Gt(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return $t.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=$t.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var a=e[n];if(!tn(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i),i+=a.length}return r},$t.byteLength=nn,$t.prototype._isBuffer=!0,$t.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)an(this,t,t+1);return this},$t.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)an(this,t,t+3),an(this,t+1,t+2);return this},$t.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)an(this,t,t+7),an(this,t+1,t+6),an(this,t+2,t+5),an(this,t+3,t+4);return this},$t.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?bn(this,0,e):rn.apply(this,arguments)},$t.prototype.equals=function(e){if(!tn(e))throw new TypeError("Argument must be a Buffer");return this===e||0===$t.compare(this,e)},$t.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},$t.prototype.compare=function(e,t,n,r,i){if(!tn(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0),s=Math.min(a,o),u=this.slice(r,i),c=e.slice(t,n),f=0;f<s;++f)if(u[f]!==c[f]){a=u[f],o=c[f];break}return a<o?-1:o<a?1:0},$t.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},$t.prototype.indexOf=function(e,t,n){return on(this,e,t,n,!0)},$t.prototype.lastIndexOf=function(e,t,n){return on(this,e,t,n,!1)},$t.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return un(this,e,t,n);case"utf8":case"utf-8":return cn(this,e,t,n);case"ascii":return fn(this,e,t,n);case"latin1":case"binary":return dn(this,e,t,n);case"base64":return ln(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pn(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},$t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var mn=4096;function yn(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function gn(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function vn(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",a=t;a<n;++a)i+=In(e[a]);return i}function wn(e,t,n){for(var r=e.slice(t,n),i="",a=0;a<r.length;a+=2)i+=String.fromCharCode(r[a]+256*r[a+1]);return i}function _n(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function En(e,t,n,r,i,a){if(!tn(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function Tn(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-n,2);i<a;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function An(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-n,4);i<a;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function Rn(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Sn(e,t,n,r,i){return i||Rn(e,0,n,4),Ht(e,t,n,r,23,4),n+4}function kn(e,t,n,r,i){return i||Rn(e,0,n,8),Ht(e,t,n,r,52,8),n+8}$t.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),$t.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=$t.prototype;else{var i=t-e;n=new $t(i,void 0);for(var a=0;a<i;++a)n[a]=this[a+e]}return n},$t.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||_n(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r},$t.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||_n(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},$t.prototype.readUInt8=function(e,t){return t||_n(e,1,this.length),this[e]},$t.prototype.readUInt16LE=function(e,t){return t||_n(e,2,this.length),this[e]|this[e+1]<<8},$t.prototype.readUInt16BE=function(e,t){return t||_n(e,2,this.length),this[e]<<8|this[e+1]},$t.prototype.readUInt32LE=function(e,t){return t||_n(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},$t.prototype.readUInt32BE=function(e,t){return t||_n(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},$t.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||_n(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},$t.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||_n(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},$t.prototype.readInt8=function(e,t){return t||_n(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},$t.prototype.readInt16LE=function(e,t){t||_n(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},$t.prototype.readInt16BE=function(e,t){t||_n(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},$t.prototype.readInt32LE=function(e,t){return t||_n(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},$t.prototype.readInt32BE=function(e,t){return t||_n(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},$t.prototype.readFloatLE=function(e,t){return t||_n(e,4,this.length),zt(this,e,!0,23,4)},$t.prototype.readFloatBE=function(e,t){return t||_n(e,4,this.length),zt(this,e,!1,23,4)},$t.prototype.readDoubleLE=function(e,t){return t||_n(e,8,this.length),zt(this,e,!0,52,8)},$t.prototype.readDoubleBE=function(e,t){return t||_n(e,8,this.length),zt(this,e,!1,52,8)},$t.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||En(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},$t.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||En(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},$t.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||En(this,e,t,1,255,0),$t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},$t.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||En(this,e,t,2,65535,0),$t.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Tn(this,e,t,!0),t+2},$t.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||En(this,e,t,2,65535,0),$t.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Tn(this,e,t,!1),t+2},$t.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||En(this,e,t,4,4294967295,0),$t.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):An(this,e,t,!0),t+4},$t.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||En(this,e,t,4,4294967295,0),$t.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):An(this,e,t,!1),t+4},$t.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);En(this,e,t,n,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a<n&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},$t.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);En(this,e,t,n,i-1,-i)}var a=n-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},$t.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||En(this,e,t,1,127,-128),$t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},$t.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||En(this,e,t,2,32767,-32768),$t.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Tn(this,e,t,!0),t+2},$t.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||En(this,e,t,2,32767,-32768),$t.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Tn(this,e,t,!1),t+2},$t.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||En(this,e,t,4,2147483647,-2147483648),$t.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):An(this,e,t,!0),t+4},$t.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||En(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),$t.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):An(this,e,t,!1),t+4},$t.prototype.writeFloatLE=function(e,t,n){return Sn(this,e,t,!0,n)},$t.prototype.writeFloatBE=function(e,t,n){return Sn(this,e,t,!1,n)},$t.prototype.writeDoubleLE=function(e,t,n){return kn(this,e,t,!0,n)},$t.prototype.writeDoubleBE=function(e,t,n){return kn(this,e,t,!1,n)},$t.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,a=r-n;if(this===e&&n<t&&t<r)for(i=a-1;i>=0;--i)e[i+t]=this[i+n];else if(a<1e3||!$t.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},$t.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!$t.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var a;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a<n;++a)this[a]=e;else{var o=tn(e)?e:xn(new $t(e,r).toString()),s=o.length;for(a=0;a<n-t;++a)this[a+t]=o[a%s]}return this};var On=/[^+\/0-9A-Za-z-_]/g;function In(e){return e<16?"0"+e.toString(16):e.toString(16)}function xn(e,t){var n;t=t||1/0;for(var r=e.length,i=null,a=[],o=0;o<r;++o){if((n=e.charCodeAt(o))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function Cn(e){return function(e){var t,n,r,i,a,o;Lt||Ut();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a="="===e[s-2]?2:"="===e[s-1]?1:0,o=new Ft(3*s/4-a),r=a>0?s-4:s;var u=0;for(t=0,n=0;t<r;t+=4,n+=3)i=Dt[e.charCodeAt(t)]<<18|Dt[e.charCodeAt(t+1)]<<12|Dt[e.charCodeAt(t+2)]<<6|Dt[e.charCodeAt(t+3)],o[u++]=i>>16&255,o[u++]=i>>8&255,o[u++]=255&i;return 2===a?(i=Dt[e.charCodeAt(t)]<<2|Dt[e.charCodeAt(t+1)]>>4,o[u++]=255&i):1===a&&(i=Dt[e.charCodeAt(t)]<<10|Dt[e.charCodeAt(t+1)]<<4|Dt[e.charCodeAt(t+2)]>>2,o[u++]=i>>8&255,o[u++]=255&i),o}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(On,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Mn(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Nn(e){return null!=e&&(!!e._isBuffer||Pn(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&Pn(e.slice(0,0))}(e))}function Pn(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var Bn=Mt(Object.freeze({__proto__:null,Buffer:$t,INSPECT_MAX_BYTES:50,SlowBuffer:function(e){return+e!=e&&(e=0),$t.alloc(+e)},isBuffer:Nn,kMaxLength:Kt}));!function(e){!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:Bn.Buffer}catch(e){}function o(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function s(e,t,n){var r=o(e,n);return n-1>=t&&(r|=o(e,n-1)<<4),r}function u(e,t,r,i){for(var a=0,o=0,s=Math.min(e.length,r),u=t;u<s;u++){var c=e.charCodeAt(u)-48;a*=i,o=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&o<i,"Invalid character"),a+=o}return a}function c(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},i.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,o,s=0;if("be"===r)for(i=e.length-1,a=0;i>=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i<e.length;i+=3)o=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this._strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,a=0,o=0;if("be"===n)for(r=e.length-1;r>=t;r-=2)i=s(e,t,r)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(r=(e.length-t)%2==0?t+1:t;r<e.length;r+=2)i=s(e,t,r)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this._strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var a=e.length-n,o=a%r,s=Math.min(a,a-o)+n,c=0,f=n;f<s;f+=r)c=u(e,f,f+r,t),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==o){var d=1;for(c=u(e,f,e.length,t),f=0;f<o;f++)d*=t;this.imuln(d),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this._strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype._move=function(e){c(e,this)},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(e){i.prototype.inspect=f}else i.prototype.inspect=f;function f(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,a=0,o=0;o<this.length;o++){var s=this.words[o],u=(16777215&(s<<i|a)).toString(16);a=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,o--),r=0!==a||o!==this.length-1?d[6-u.length]+u+r:u+r}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=l[e],f=p[e];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var b=h.modrn(f).toString(e);r=(h=h.idivn(f)).isZero()?b+r:d[c-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},a&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function h(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,u=o/67108864|0;n.words[0]=s;for(var c=1;c<r;c++){for(var f=u>>>26,d=67108863&u,l=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=l;p++){var h=c-p|0;f+=(o=(i=0|e.words[h])*(a=0|t.words[p])+d)/67108864|0,d=67108863&o}n.words[c]=0|d,u=0|f}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}i.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,a);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,i),o},i.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,a=0;i<this.length;i++){var o=this.words[i]<<a|r;e[n++]=255&o,n<e.length&&(e[n++]=o>>8&255),n<e.length&&(e[n++]=o>>16&255),6===a?(n<e.length&&(e[n++]=o>>24&255),r=0,a=0):(r=o>>>24,a+=2)}if(n<e.length)for(e[n++]=r;n<e.length;)e[n++]=0},i.prototype._toArrayLikeBE=function(e,t){for(var n=e.length-1,r=0,i=0,a=0;i<this.length;i++){var o=this.words[i]<<a|r;e[n--]=255&o,n>=0&&(e[n--]=o>>8&255),n>=0&&(e[n--]=o>>16&255),6===a?(n>=0&&(e[n--]=o>>24&255),r=0,a=0):(r=o>>>24,a+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var n=this._zeroBits(this.words[t]);if(e+=n,26!==n)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},i.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;n<t.length;n++)this.words[n]=this.words[n]&e.words[n];return this.length=t.length,this._strip()},i.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;r<n.length;r++)this.words[r]=t.words[r]^n.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this._strip()},i.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},i.prototype.iadd=function(e){var t,n,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a<r.length;a++)t=(0|n.words[a])+(0|r.words[a])+i,this.words[a]=67108863&t,i=t>>>26;for(;0!==i&&a<n.length;a++)t=(0|n.words[a])+i,this.words[a]=67108863&t,i=t>>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var a=0,o=0;o<r.length;o++)a=(t=(0|n.words[o])-(0|r.words[o])+a)>>26,this.words[o]=67108863&t;for(;0!==a&&o<n.length;o++)a=(t=(0|n.words[o])+a)>>26,this.words[o]=67108863&t;if(0===a&&o<n.length&&n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this.length=Math.max(this.length,o),n!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var b=function(e,t,n){var r,i,a,o=e.words,s=t.words,u=n.words,c=0,f=0|o[0],d=8191&f,l=f>>>13,p=0|o[1],h=8191&p,b=p>>>13,m=0|o[2],y=8191&m,g=m>>>13,v=0|o[3],w=8191&v,_=v>>>13,E=0|o[4],T=8191&E,A=E>>>13,R=0|o[5],S=8191&R,k=R>>>13,O=0|o[6],I=8191&O,x=O>>>13,C=0|o[7],M=8191&C,N=C>>>13,P=0|o[8],B=8191&P,D=P>>>13,F=0|o[9],L=8191&F,U=F>>>13,j=0|s[0],q=8191&j,z=j>>>13,H=0|s[1],V=8191&H,G=H>>>13,K=0|s[2],W=8191&K,X=K>>>13,$=0|s[3],J=8191&$,Y=$>>>13,Q=0|s[4],Z=8191&Q,ee=Q>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,fe=0|s[8],de=8191&fe,le=fe>>>13,pe=0|s[9],he=8191&pe,be=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var me=(c+(r=Math.imul(d,q))|0)+((8191&(i=(i=Math.imul(d,z))+Math.imul(l,q)|0))<<13)|0;c=((a=Math.imul(l,z))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(h,q),i=(i=Math.imul(h,z))+Math.imul(b,q)|0,a=Math.imul(b,z);var ye=(c+(r=r+Math.imul(d,V)|0)|0)+((8191&(i=(i=i+Math.imul(d,G)|0)+Math.imul(l,V)|0))<<13)|0;c=((a=a+Math.imul(l,G)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(y,q),i=(i=Math.imul(y,z))+Math.imul(g,q)|0,a=Math.imul(g,z),r=r+Math.imul(h,V)|0,i=(i=i+Math.imul(h,G)|0)+Math.imul(b,V)|0,a=a+Math.imul(b,G)|0;var ge=(c+(r=r+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(l,W)|0))<<13)|0;c=((a=a+Math.imul(l,X)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(w,q),i=(i=Math.imul(w,z))+Math.imul(_,q)|0,a=Math.imul(_,z),r=r+Math.imul(y,V)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(g,V)|0,a=a+Math.imul(g,G)|0,r=r+Math.imul(h,W)|0,i=(i=i+Math.imul(h,X)|0)+Math.imul(b,W)|0,a=a+Math.imul(b,X)|0;var ve=(c+(r=r+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,Y)|0)+Math.imul(l,J)|0))<<13)|0;c=((a=a+Math.imul(l,Y)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(T,q),i=(i=Math.imul(T,z))+Math.imul(A,q)|0,a=Math.imul(A,z),r=r+Math.imul(w,V)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(_,V)|0,a=a+Math.imul(_,G)|0,r=r+Math.imul(y,W)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(g,W)|0,a=a+Math.imul(g,X)|0,r=r+Math.imul(h,J)|0,i=(i=i+Math.imul(h,Y)|0)+Math.imul(b,J)|0,a=a+Math.imul(b,Y)|0;var we=(c+(r=r+Math.imul(d,Z)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(l,Z)|0))<<13)|0;c=((a=a+Math.imul(l,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(S,q),i=(i=Math.imul(S,z))+Math.imul(k,q)|0,a=Math.imul(k,z),r=r+Math.imul(T,V)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(A,V)|0,a=a+Math.imul(A,G)|0,r=r+Math.imul(w,W)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,W)|0,a=a+Math.imul(_,X)|0,r=r+Math.imul(y,J)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(g,J)|0,a=a+Math.imul(g,Y)|0,r=r+Math.imul(h,Z)|0,i=(i=i+Math.imul(h,ee)|0)+Math.imul(b,Z)|0,a=a+Math.imul(b,ee)|0;var _e=(c+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(l,ne)|0))<<13)|0;c=((a=a+Math.imul(l,re)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(I,q),i=(i=Math.imul(I,z))+Math.imul(x,q)|0,a=Math.imul(x,z),r=r+Math.imul(S,V)|0,i=(i=i+Math.imul(S,G)|0)+Math.imul(k,V)|0,a=a+Math.imul(k,G)|0,r=r+Math.imul(T,W)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(A,W)|0,a=a+Math.imul(A,X)|0,r=r+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,J)|0,a=a+Math.imul(_,Y)|0,r=r+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(g,Z)|0,a=a+Math.imul(g,ee)|0,r=r+Math.imul(h,ne)|0,i=(i=i+Math.imul(h,re)|0)+Math.imul(b,ne)|0,a=a+Math.imul(b,re)|0;var Ee=(c+(r=r+Math.imul(d,ae)|0)|0)+((8191&(i=(i=i+Math.imul(d,oe)|0)+Math.imul(l,ae)|0))<<13)|0;c=((a=a+Math.imul(l,oe)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(M,q),i=(i=Math.imul(M,z))+Math.imul(N,q)|0,a=Math.imul(N,z),r=r+Math.imul(I,V)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(x,V)|0,a=a+Math.imul(x,G)|0,r=r+Math.imul(S,W)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(k,W)|0,a=a+Math.imul(k,X)|0,r=r+Math.imul(T,J)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(A,J)|0,a=a+Math.imul(A,Y)|0,r=r+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Z)|0,a=a+Math.imul(_,ee)|0,r=r+Math.imul(y,ne)|0,i=(i=i+Math.imul(y,re)|0)+Math.imul(g,ne)|0,a=a+Math.imul(g,re)|0,r=r+Math.imul(h,ae)|0,i=(i=i+Math.imul(h,oe)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0;var Te=(c+(r=r+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(l,ue)|0))<<13)|0;c=((a=a+Math.imul(l,ce)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(B,q),i=(i=Math.imul(B,z))+Math.imul(D,q)|0,a=Math.imul(D,z),r=r+Math.imul(M,V)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(N,V)|0,a=a+Math.imul(N,G)|0,r=r+Math.imul(I,W)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(x,W)|0,a=a+Math.imul(x,X)|0,r=r+Math.imul(S,J)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,Y)|0,r=r+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(A,Z)|0,a=a+Math.imul(A,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(_,ne)|0,a=a+Math.imul(_,re)|0,r=r+Math.imul(y,ae)|0,i=(i=i+Math.imul(y,oe)|0)+Math.imul(g,ae)|0,a=a+Math.imul(g,oe)|0,r=r+Math.imul(h,ue)|0,i=(i=i+Math.imul(h,ce)|0)+Math.imul(b,ue)|0,a=a+Math.imul(b,ce)|0;var Ae=(c+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,le)|0)+Math.imul(l,de)|0))<<13)|0;c=((a=a+Math.imul(l,le)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(L,q),i=(i=Math.imul(L,z))+Math.imul(U,q)|0,a=Math.imul(U,z),r=r+Math.imul(B,V)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(D,V)|0,a=a+Math.imul(D,G)|0,r=r+Math.imul(M,W)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(N,W)|0,a=a+Math.imul(N,X)|0,r=r+Math.imul(I,J)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(x,J)|0,a=a+Math.imul(x,Y)|0,r=r+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(k,Z)|0,a=a+Math.imul(k,ee)|0,r=r+Math.imul(T,ne)|0,i=(i=i+Math.imul(T,re)|0)+Math.imul(A,ne)|0,a=a+Math.imul(A,re)|0,r=r+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,oe)|0)+Math.imul(_,ae)|0,a=a+Math.imul(_,oe)|0,r=r+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(g,ue)|0,a=a+Math.imul(g,ce)|0,r=r+Math.imul(h,de)|0,i=(i=i+Math.imul(h,le)|0)+Math.imul(b,de)|0,a=a+Math.imul(b,le)|0;var Re=(c+(r=r+Math.imul(d,he)|0)|0)+((8191&(i=(i=i+Math.imul(d,be)|0)+Math.imul(l,he)|0))<<13)|0;c=((a=a+Math.imul(l,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(L,V),i=(i=Math.imul(L,G))+Math.imul(U,V)|0,a=Math.imul(U,G),r=r+Math.imul(B,W)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(D,W)|0,a=a+Math.imul(D,X)|0,r=r+Math.imul(M,J)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(N,J)|0,a=a+Math.imul(N,Y)|0,r=r+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(x,Z)|0,a=a+Math.imul(x,ee)|0,r=r+Math.imul(S,ne)|0,i=(i=i+Math.imul(S,re)|0)+Math.imul(k,ne)|0,a=a+Math.imul(k,re)|0,r=r+Math.imul(T,ae)|0,i=(i=i+Math.imul(T,oe)|0)+Math.imul(A,ae)|0,a=a+Math.imul(A,oe)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(_,ue)|0,a=a+Math.imul(_,ce)|0,r=r+Math.imul(y,de)|0,i=(i=i+Math.imul(y,le)|0)+Math.imul(g,de)|0,a=a+Math.imul(g,le)|0;var Se=(c+(r=r+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,be)|0)+Math.imul(b,he)|0))<<13)|0;c=((a=a+Math.imul(b,be)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(L,W),i=(i=Math.imul(L,X))+Math.imul(U,W)|0,a=Math.imul(U,X),r=r+Math.imul(B,J)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(D,J)|0,a=a+Math.imul(D,Y)|0,r=r+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(N,Z)|0,a=a+Math.imul(N,ee)|0,r=r+Math.imul(I,ne)|0,i=(i=i+Math.imul(I,re)|0)+Math.imul(x,ne)|0,a=a+Math.imul(x,re)|0,r=r+Math.imul(S,ae)|0,i=(i=i+Math.imul(S,oe)|0)+Math.imul(k,ae)|0,a=a+Math.imul(k,oe)|0,r=r+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,ce)|0)+Math.imul(A,ue)|0,a=a+Math.imul(A,ce)|0,r=r+Math.imul(w,de)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(_,de)|0,a=a+Math.imul(_,le)|0;var ke=(c+(r=r+Math.imul(y,he)|0)|0)+((8191&(i=(i=i+Math.imul(y,be)|0)+Math.imul(g,he)|0))<<13)|0;c=((a=a+Math.imul(g,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(L,J),i=(i=Math.imul(L,Y))+Math.imul(U,J)|0,a=Math.imul(U,Y),r=r+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(D,Z)|0,a=a+Math.imul(D,ee)|0,r=r+Math.imul(M,ne)|0,i=(i=i+Math.imul(M,re)|0)+Math.imul(N,ne)|0,a=a+Math.imul(N,re)|0,r=r+Math.imul(I,ae)|0,i=(i=i+Math.imul(I,oe)|0)+Math.imul(x,ae)|0,a=a+Math.imul(x,oe)|0,r=r+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(k,ue)|0,a=a+Math.imul(k,ce)|0,r=r+Math.imul(T,de)|0,i=(i=i+Math.imul(T,le)|0)+Math.imul(A,de)|0,a=a+Math.imul(A,le)|0;var Oe=(c+(r=r+Math.imul(w,he)|0)|0)+((8191&(i=(i=i+Math.imul(w,be)|0)+Math.imul(_,he)|0))<<13)|0;c=((a=a+Math.imul(_,be)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(L,Z),i=(i=Math.imul(L,ee))+Math.imul(U,Z)|0,a=Math.imul(U,ee),r=r+Math.imul(B,ne)|0,i=(i=i+Math.imul(B,re)|0)+Math.imul(D,ne)|0,a=a+Math.imul(D,re)|0,r=r+Math.imul(M,ae)|0,i=(i=i+Math.imul(M,oe)|0)+Math.imul(N,ae)|0,a=a+Math.imul(N,oe)|0,r=r+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(x,ue)|0,a=a+Math.imul(x,ce)|0,r=r+Math.imul(S,de)|0,i=(i=i+Math.imul(S,le)|0)+Math.imul(k,de)|0,a=a+Math.imul(k,le)|0;var Ie=(c+(r=r+Math.imul(T,he)|0)|0)+((8191&(i=(i=i+Math.imul(T,be)|0)+Math.imul(A,he)|0))<<13)|0;c=((a=a+Math.imul(A,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(L,ne),i=(i=Math.imul(L,re))+Math.imul(U,ne)|0,a=Math.imul(U,re),r=r+Math.imul(B,ae)|0,i=(i=i+Math.imul(B,oe)|0)+Math.imul(D,ae)|0,a=a+Math.imul(D,oe)|0,r=r+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,ce)|0)+Math.imul(N,ue)|0,a=a+Math.imul(N,ce)|0,r=r+Math.imul(I,de)|0,i=(i=i+Math.imul(I,le)|0)+Math.imul(x,de)|0,a=a+Math.imul(x,le)|0;var xe=(c+(r=r+Math.imul(S,he)|0)|0)+((8191&(i=(i=i+Math.imul(S,be)|0)+Math.imul(k,he)|0))<<13)|0;c=((a=a+Math.imul(k,be)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(L,ae),i=(i=Math.imul(L,oe))+Math.imul(U,ae)|0,a=Math.imul(U,oe),r=r+Math.imul(B,ue)|0,i=(i=i+Math.imul(B,ce)|0)+Math.imul(D,ue)|0,a=a+Math.imul(D,ce)|0,r=r+Math.imul(M,de)|0,i=(i=i+Math.imul(M,le)|0)+Math.imul(N,de)|0,a=a+Math.imul(N,le)|0;var Ce=(c+(r=r+Math.imul(I,he)|0)|0)+((8191&(i=(i=i+Math.imul(I,be)|0)+Math.imul(x,he)|0))<<13)|0;c=((a=a+Math.imul(x,be)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(L,ue),i=(i=Math.imul(L,ce))+Math.imul(U,ue)|0,a=Math.imul(U,ce),r=r+Math.imul(B,de)|0,i=(i=i+Math.imul(B,le)|0)+Math.imul(D,de)|0,a=a+Math.imul(D,le)|0;var Me=(c+(r=r+Math.imul(M,he)|0)|0)+((8191&(i=(i=i+Math.imul(M,be)|0)+Math.imul(N,he)|0))<<13)|0;c=((a=a+Math.imul(N,be)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(L,de),i=(i=Math.imul(L,le))+Math.imul(U,de)|0,a=Math.imul(U,le);var Ne=(c+(r=r+Math.imul(B,he)|0)|0)+((8191&(i=(i=i+Math.imul(B,be)|0)+Math.imul(D,he)|0))<<13)|0;c=((a=a+Math.imul(D,be)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Pe=(c+(r=Math.imul(L,he))|0)+((8191&(i=(i=Math.imul(L,be))+Math.imul(U,he)|0))<<13)|0;return c=((a=Math.imul(U,be))+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,u[0]=me,u[1]=ye,u[2]=ge,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Ee,u[7]=Te,u[8]=Ae,u[9]=Re,u[10]=Se,u[11]=ke,u[12]=Oe,u[13]=Ie,u[14]=xe,u[15]=Ce,u[16]=Me,u[17]=Ne,u[18]=Pe,0!==c&&(u[19]=c,n.length++),n};function m(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,a=0;a<n.length-1;a++){var o=i;i=0;for(var s=67108863&r,u=Math.min(a,t.length-1),c=Math.max(0,a-e.length+1);c<=u;c++){var f=a-c,d=(0|e.words[f])*(0|t.words[c]),l=67108863&d;s=67108863&(l=l+s|0),i+=(o=(o=o+(d/67108864|0)|0)+(l>>>26)|0)>>>26,o&=67108863}n.words[a]=s,r=o,o=i}return 0!==r?n.words[a]=r:n.length--,n._strip()}function y(e,t,n){return m(e,t,n)}Math.imul||(b=h),i.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?b(this,e,t):n<63?h(this,e,t):n<1024?m(this,e,t):y(this,e,t)},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),y(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i<this.length;i++){var a=(0|this.words[i])*e,o=(67108863&a)+(67108863&r);r>>=26,r+=a/67108864|0,r+=o>>>26,this.words[i]=67108863&o}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n<t.length;n++){var r=n/26|0,i=n%26;t[n]=e.words[r]>>>i&1}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r<t.length&&0===t[r];r++,n=n.sqr());if(++r<t.length)for(var a=n.sqr();r<t.length;r++,a=a.sqr())0!==t[r]&&(n=n.mul(a));return n},i.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t<this.length;t++){var s=this.words[t]&a,u=(0|this.words[t])-s<<r;this.words[t]=u|o,o=s>>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this._strip()},i.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<<a,u=r;if(i-=o,i=Math.max(0,i),u){for(var c=0;c<o;c++)u.words[c]=this.words[c];u.length=o}if(0===o);else if(this.length>o)for(this.length-=o,c=0;c<this.length;c++)this.words[c]=this.words[c+o];else this.words[0]=0,this.length=1;var f=0;for(c=this.length-1;c>=0&&(0!==f||c>=i);c--){var d=0|this.words[c];this.words[c]=f<<26-a|d>>>a,f=d&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},i.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this._strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,r){var i,a,o=e.length+r;this._expand(o);var s=0;for(i=0;i<e.length;i++){a=(0|this.words[i+r])+s;var u=(0|e.words[i])*t;s=((a-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&a}for(;i<this.length-r;i++)s=(a=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&a;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(a=-(0|this.words[i])+s)>>26,this.words[i]=67108863&a;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),a=e,o=0|a.words[a.length-1];0!==(n=26-this._countBits(o))&&(a=a.ushln(n),r.iushln(n),o=0|a.words[a.length-1]);var s,u=r.length-a.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var f=r.clone()._ishlnsubmul(a,1,u);0===f.negative&&(r=f,s&&(s.words[u]=1));for(var d=u-1;d>=0;d--){var l=67108864*(0|r.words[a.length+d])+(0|r.words[a.length+d-1]);for(l=Math.min(l/o|0,67108863),r._ishlnsubmul(a,l,d);0!==r.negative;)l--,r.negative=0,r._ishlnsubmul(a,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=l)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(a=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:a,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(a=s.div.neg()),{div:a,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var a,o,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),a=n.cmp(r);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,a=this.length-1;a>=0;a--)i=(r*i+(0|this.words[a]))%e;return t?-i:i},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(0|this.words[i])+67108864*r;this.words[i]=a/e|0,r=a%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new i(1),o=new i(0),s=new i(0),u=new i(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var f=r.clone(),d=t.clone();!t.isZero();){for(var l=0,p=1;0==(t.words[0]&p)&&l<26;++l,p<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(f),o.isub(d)),a.iushrn(1),o.iushrn(1);for(var h=0,b=1;0==(r.words[0]&b)&&h<26;++h,b<<=1);if(h>0)for(r.iushrn(h);h-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s),o.isub(u)):(r.isub(t),s.isub(a),u.isub(o))}return{a:s,b:u,gcd:r.iushln(c)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,o=new i(1),s=new i(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,f=1;0==(t.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var d=0,l=1;0==(r.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(r.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s)):(r.isub(t),s.isub(o))}return(a=0===t.cmpn(1)?o:s).cmpn(0)<0&&a.iadd(e),a},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var a=t;t=n,n=a}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var a=i,o=r;0!==a&&o<this.length;o++){var s=0|this.words[o];a=(s+=a)>>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){r<i?t=-1:r>i&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new A(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function T(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function R(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},r(w,v),w.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i<r;i++)t.words[i]=e.words[i];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var a=e.words[9];for(t.words[t.length++]=a&n,i=10;i<e.length;i++){var o=0|e.words[i];e.words[i-10]=(o&n)<<4|a>>>22,a=o}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n<e.length;n++){var r=0|e.words[n];t+=977*r,e.words[n]=67108863&t,t=64*r+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},r(_,v),r(E,v),r(T,v),T.prototype.imulK=function(e){for(var t=0,n=0;n<e.length;n++){var r=19*(0|e.words[n])+t,i=67108863&r;r>>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new _;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new T}return g[e]=t,t},A.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(c(e,e.umod(this.m)._forceRed(this)),e)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},A.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);n(!a.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var d=this.pow(f,a),l=this.pow(e,a.addn(1).iushrn(1)),p=this.pow(e,a),h=o;0!==p.cmp(s);){for(var b=p,m=0;0!==b.cmp(s);m++)b=b.redSqr();n(m<h);var y=this.pow(d,new i(1).iushln(h-m-1));l=l.redMul(y),d=y.redSqr(),p=p.redMul(d),h=m}return l},A.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},A.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var n=new Array(16);n[0]=new i(1).toRed(this),n[1]=e;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],e);var a=n[0],o=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),r=t.length-1;r>=0;r--){for(var c=t.words[r],f=u-1;f>=0;f--){var d=c>>f&1;a!==n[0]&&(a=this.sqr(a)),0!==d||0!==o?(o<<=1,o|=d,(4===++s||0===r&&0===f)&&(a=this.mul(a,n[o]),s=0,o=0)):s=0}u=26}return a},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new R(e)},r(R,A),R.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},R.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},R.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},R.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=n.isub(r).iushrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},R.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,xt)}(Nt);var Dn=Nt.exports,Fn=Ct(Dn);let Ln=!1,Un=!1;const jn={debug:1,default:2,info:2,warning:3,error:4,off:5};let qn=jn.default,zn=null;const Hn=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(n){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var Vn,Gn;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(Vn||(Vn={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(Gn||(Gn={}));const Kn="0123456789abcdef";let Wn=class e{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const n=e.toLowerCase();null==jn[n]&&this.throwArgumentError("invalid log level name","logLevel",e),qn>jn[n]||console.log.apply(console,t)}debug(...t){this._log(e.levels.DEBUG,t)}info(...t){this._log(e.levels.INFO,t)}warn(...t){this._log(e.levels.WARNING,t)}makeError(t,n,r){if(Un)return this.makeError("censored error",n,{});n||(n=e.errors.UNKNOWN_ERROR),r||(r={});const i=[];Object.keys(r).forEach((e=>{const t=r[e];try{if(t instanceof Uint8Array){let n="";for(let e=0;e<t.length;e++)n+=Kn[t[e]>>4],n+=Kn[15&t[e]];i.push(e+"=Uint8Array(0x"+n+")")}else i.push(e+"="+JSON.stringify(t))}catch(t){i.push(e+"="+JSON.stringify(r[e].toString()))}})),i.push(`code=${n}`),i.push(`version=${this.version}`);const a=t;let o="";switch(n){case Gn.NUMERIC_FAULT:{o="NUMERIC_FAULT";const e=t;switch(e){case"overflow":case"underflow":case"division-by-zero":o+="-"+e;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case Gn.CALL_EXCEPTION:case Gn.INSUFFICIENT_FUNDS:case Gn.MISSING_NEW:case Gn.NONCE_EXPIRED:case Gn.REPLACEMENT_UNDERPRICED:case Gn.TRANSACTION_REPLACED:case Gn.UNPREDICTABLE_GAS_LIMIT:o=n}o&&(t+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(t+=" ("+i.join(", ")+")");const s=new Error(t);return s.reason=a,s.code=n,Object.keys(r).forEach((function(e){s[e]=r[e]})),s}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(t,n,r){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:n,value:r})}assert(e,t,n,r){e||this.throwError(t,n,r)}assertArgument(e,t,n,r){e||this.throwArgumentError(t,n,r)}checkNormalize(t){Hn&&this.throwError("platform missing String.prototype.normalize",e.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Hn})}checkSafeUint53(t,n){"number"==typeof t&&(null==n&&(n="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,n,r){r=r?": "+r:"",t<n&&this.throwError("missing argument"+r,e.errors.MISSING_ARGUMENT,{count:t,expectedCount:n}),t>n&&this.throwError("too many arguments"+r,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:n})}checkNew(t,n){t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:n.name})}checkAbstract(t,n){t===n?this.throwError("cannot instantiate abstract class "+JSON.stringify(n.name)+" directly; use a sub-class",e.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:n.name})}static globalLogger(){return zn||(zn=new e("logger/5.7.0")),zn}static setCensorship(t,n){if(!t&&n&&this.globalLogger().throwError("cannot permanently disable censorship",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Ln){if(!t)return;this.globalLogger().throwError("error censorship permanent",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Un=!!t,Ln=!!n}static setLogLevel(t){const n=jn[t.toLowerCase()];null!=n?qn=n:e.globalLogger().warn("invalid log level - "+t)}static from(t){return new e(t)}};Wn.errors=Gn,Wn.levels=Vn;var Xn=Object.freeze({__proto__:null,get ErrorCode(){return Gn},get LogLevel(){return Vn},Logger:Wn});const $n=new Wn("bytes/5.7.0");function Jn(e){return!!e.toHexString}function Yn(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return Yn(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function Qn(e){return ar(e)&&!(e.length%2)||er(e)}function Zn(e){return"number"==typeof e&&e==e&&e%1==0}function er(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!Zn(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){const n=e[t];if(!Zn(n)||n<0||n>=256)return!1}return!0}function tr(e,t){if(t||(t={}),"number"==typeof e){$n.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),Yn(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Jn(e)&&(e=e.toHexString()),ar(e)){let n=e.substring(2);n.length%2&&("left"===t.hexPad?n="0"+n:"right"===t.hexPad?n+="0":$n.throwArgumentError("hex data is odd-length","value",e));const r=[];for(let e=0;e<n.length;e+=2)r.push(parseInt(n.substring(e,e+2),16));return Yn(new Uint8Array(r))}return er(e)?Yn(new Uint8Array(e)):$n.throwArgumentError("invalid arrayify value","value",e)}function nr(e){const t=e.map((e=>tr(e))),n=t.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(n);return t.reduce(((e,t)=>(r.set(t,e),e+t.length)),0),Yn(r)}function rr(e){let t=tr(e);if(0===t.length)return t;let n=0;for(;n<t.length&&0===t[n];)n++;return n&&(t=t.slice(n)),t}function ir(e,t){(e=tr(e)).length>t&&$n.throwArgumentError("value out of range","value",arguments[0]);const n=new Uint8Array(t);return n.set(e,t-e.length),Yn(n)}function ar(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}const or="0123456789abcdef";function sr(e,t){if(t||(t={}),"number"==typeof e){$n.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=or[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Jn(e))return e.toHexString();if(ar(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":$n.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(er(e)){let t="0x";for(let n=0;n<e.length;n++){let r=e[n];t+=or[(240&r)>>4]+or[15&r]}return t}return $n.throwArgumentError("invalid hexlify value","value",e)}function ur(e){if("string"!=typeof e)e=sr(e);else if(!ar(e)||e.length%2)return null;return(e.length-2)/2}function cr(e,t,n){return"string"!=typeof e?e=sr(e):(!ar(e)||e.length%2)&&$n.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=n?"0x"+e.substring(t,2+2*n):"0x"+e.substring(t)}function fr(e){let t="0x";return e.forEach((e=>{t+=sr(e).substring(2)})),t}function dr(e){const t=lr(sr(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function lr(e){"string"!=typeof e&&(e=sr(e)),ar(e)||$n.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t<e.length&&"0"===e[t];)t++;return"0x"+e.substring(t)}function pr(e,t){for("string"!=typeof e?e=sr(e):ar(e)||$n.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&$n.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function hr(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Qn(e)){let n=tr(e);64===n.length?(t.v=27+(n[32]>>7),n[32]&=127,t.r=sr(n.slice(0,32)),t.s=sr(n.slice(32,64))):65===n.length?(t.r=sr(n.slice(0,32)),t.s=sr(n.slice(32,64)),t.v=n[64]):$n.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:$n.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(n[32]|=128),t._vs=sr(n.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const n=ir(tr(t._vs),32);t._vs=sr(n);const r=n[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=r:t.recoveryParam!==r&&$n.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),n[0]&=127;const i=sr(n);null==t.s?t.s=i:t.s!==i&&$n.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?$n.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{const n=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==n&&$n.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&ar(t.r)?t.r=pr(t.r,32):$n.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&ar(t.s)?t.s=pr(t.s,32):$n.throwArgumentError("signature missing or invalid s","signature",e);const n=tr(t.s);n[0]>=128&&$n.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(n[0]|=128);const r=sr(n);t._vs&&(ar(t._vs)||$n.throwArgumentError("signature invalid _vs","signature",e),t._vs=pr(t._vs,32)),null==t._vs?t._vs=r:t._vs!==r&&$n.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function br(e){return sr(nr([(e=hr(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}var mr=Object.freeze({__proto__:null,arrayify:tr,concat:nr,hexConcat:fr,hexDataLength:ur,hexDataSlice:cr,hexStripZeros:lr,hexValue:dr,hexZeroPad:pr,hexlify:sr,isBytes:er,isBytesLike:Qn,isHexString:ar,joinSignature:br,splitSignature:hr,stripZeros:rr,zeroPad:ir});const yr="bignumber/5.7.0";var gr=Fn.BN;const vr=new Wn(yr),wr={},_r=9007199254740991;let Er=!1,Tr=class e{constructor(e,t){e!==wr&&vr.throwError("cannot call constructor directly; use BigNumber.from",Wn.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Rr(Sr(this).fromTwos(e))}toTwos(e){return Rr(Sr(this).toTwos(e))}abs(){return"-"===this._hex[0]?e.from(this._hex.substring(1)):this}add(e){return Rr(Sr(this).add(Sr(e)))}sub(e){return Rr(Sr(this).sub(Sr(e)))}div(t){return e.from(t).isZero()&&kr("division-by-zero","div"),Rr(Sr(this).div(Sr(t)))}mul(e){return Rr(Sr(this).mul(Sr(e)))}mod(e){const t=Sr(e);return t.isNeg()&&kr("division-by-zero","mod"),Rr(Sr(this).umod(t))}pow(e){const t=Sr(e);return t.isNeg()&&kr("negative-power","pow"),Rr(Sr(this).pow(t))}and(e){const t=Sr(e);return(this.isNegative()||t.isNeg())&&kr("unbound-bitwise-result","and"),Rr(Sr(this).and(t))}or(e){const t=Sr(e);return(this.isNegative()||t.isNeg())&&kr("unbound-bitwise-result","or"),Rr(Sr(this).or(t))}xor(e){const t=Sr(e);return(this.isNegative()||t.isNeg())&&kr("unbound-bitwise-result","xor"),Rr(Sr(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&kr("negative-width","mask"),Rr(Sr(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&kr("negative-width","shl"),Rr(Sr(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&kr("negative-width","shr"),Rr(Sr(this).shrn(e))}eq(e){return Sr(this).eq(Sr(e))}lt(e){return Sr(this).lt(Sr(e))}lte(e){return Sr(this).lte(Sr(e))}gt(e){return Sr(this).gt(Sr(e))}gte(e){return Sr(this).gte(Sr(e))}isNegative(){return"-"===this._hex[0]}isZero(){return Sr(this).isZero()}toNumber(){try{return Sr(this).toNumber()}catch(e){kr("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return vr.throwError("this platform does not support BigInt",Wn.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?Er||(Er=!0,vr.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?vr.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Wn.errors.UNEXPECTED_ARGUMENT,{}):vr.throwError("BigNumber.toString does not accept parameters",Wn.errors.UNEXPECTED_ARGUMENT,{})),Sr(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof e)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new e(wr,Ar(t)):t.match(/^-?[0-9]+$/)?new e(wr,Ar(new gr(t))):vr.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&kr("underflow","BigNumber.from",t),(t>=_r||t<=-_r)&&kr("overflow","BigNumber.from",t),e.from(String(t));const n=t;if("bigint"==typeof n)return e.from(n.toString());if(er(n))return e.from(sr(n));if(n)if(n.toHexString){const t=n.toHexString();if("string"==typeof t)return e.from(t)}else{let t=n._hex;if(null==t&&"BigNumber"===n.type&&(t=n.hex),"string"==typeof t&&(ar(t)||"-"===t[0]&&ar(t.substring(1))))return e.from(t)}return vr.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(e){return!(!e||!e._isBigNumber)}};function Ar(e){if("string"!=typeof e)return Ar(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&vr.throwArgumentError("invalid hex","value",e),"0x00"===(e=Ar(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function Rr(e){return Tr.from(Ar(e))}function Sr(e){const t=Tr.from(e).toHexString();return"-"===t[0]?new gr("-"+t.substring(3),16):new gr(t.substring(2),16)}function kr(e,t,n){const r={fault:e,operation:t};return null!=n&&(r.value=n),vr.throwError(e,Wn.errors.NUMERIC_FAULT,r)}const Or=new Wn(yr),Ir={},xr=Tr.from(0),Cr=Tr.from(-1);function Mr(e,t,n,r){const i={fault:t,operation:n};return void 0!==r&&(i.value=r),Or.throwError(e,Wn.errors.NUMERIC_FAULT,i)}let Nr="0";for(;Nr.length<256;)Nr+=Nr;function Pr(e){if("number"!=typeof e)try{e=Tr.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+Nr.substring(0,e):Or.throwArgumentError("invalid decimal size","decimals",e)}function Br(e,t){null==t&&(t=0);const n=Pr(t),r=(e=Tr.from(e)).lt(xr);r&&(e=e.mul(Cr));let i=e.mod(n).toString();for(;i.length<n.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const a=e.div(n).toString();return e=1===n.length?a:a+"."+i,r&&(e="-"+e),e}function Dr(e,t){null==t&&(t=0);const n=Pr(t);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||Or.throwArgumentError("invalid decimal value","value",e);const r="-"===e.substring(0,1);r&&(e=e.substring(1)),"."===e&&Or.throwArgumentError("missing value","value",e);const i=e.split(".");i.length>2&&Or.throwArgumentError("too many decimal points","value",e);let a=i[0],o=i[1];for(a||(a="0"),o||(o="0");"0"===o[o.length-1];)o=o.substring(0,o.length-1);for(o.length>n.length-1&&Mr("fractional component exceeds decimals","underflow","parseFixed"),""===o&&(o="0");o.length<n.length-1;)o+="0";const s=Tr.from(a),u=Tr.from(o);let c=s.mul(n).add(u);return r&&(c=c.mul(Cr)),c}class Fr{constructor(e,t,n,r){e!==Ir&&Or.throwError("cannot use FixedFormat constructor; use FixedFormat.from",Wn.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=n,this.decimals=r,this.name=(t?"":"u")+"fixed"+String(n)+"x"+String(r),this._multiplier=Pr(r),Object.freeze(this)}static from(e){if(e instanceof Fr)return e;"number"==typeof e&&(e=`fixed128x${e}`);let t=!0,n=128,r=18;if("string"==typeof e)if("fixed"===e);else if("ufixed"===e)t=!1;else{const i=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);i||Or.throwArgumentError("invalid fixed format","format",e),t="u"!==i[1],n=parseInt(i[2]),r=parseInt(i[3])}else if(e){const i=(t,n,r)=>null==e[t]?r:(typeof e[t]!==n&&Or.throwArgumentError("invalid fixed format ("+t+" not "+n+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),n=i("width","number",n),r=i("decimals","number",r)}return n%8&&Or.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),r>80&&Or.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",r),new Fr(Ir,t,n,r)}}class Lr{constructor(e,t,n,r){e!==Ir&&Or.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Wn.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=r,this._hex=t,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&Or.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=Dr(this._value,this.format.decimals),n=Dr(e._value,e.format.decimals);return Lr.fromValue(t.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=Dr(this._value,this.format.decimals),n=Dr(e._value,e.format.decimals);return Lr.fromValue(t.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=Dr(this._value,this.format.decimals),n=Dr(e._value,e.format.decimals);return Lr.fromValue(t.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=Dr(this._value,this.format.decimals),n=Dr(e._value,e.format.decimals);return Lr.fromValue(t.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=Lr.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(t=t.subUnsafe(Ur.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=Lr.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(t=t.addUnsafe(Ur.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&Or.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const n=Lr.from("1"+Nr.substring(0,e),this.format),r=jr.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(r).floor().divUnsafe(n)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&Or.throwArgumentError("invalid byte width","width",e);return pr(Tr.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Lr.fromString(this._value,e)}static fromValue(e,t,n){return null!=n||null==t||function(e){return null!=e&&(Tr.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||ar(e)||"bigint"==typeof e||er(e))}(t)||(n=t,t=null),null==t&&(t=0),null==n&&(n="fixed"),Lr.fromString(Br(e,t),Fr.from(n))}static fromString(e,t){null==t&&(t="fixed");const n=Fr.from(t),r=Dr(e,n.decimals);!n.signed&&r.lt(xr)&&Mr("unsigned value cannot be negative","overflow","value",e);let i=null;n.signed?i=r.toTwos(n.width).toHexString():(i=r.toHexString(),i=pr(i,n.width/8));const a=Br(r,n.decimals);return new Lr(Ir,i,a,n)}static fromBytes(e,t){null==t&&(t="fixed");const n=Fr.from(t);if(tr(e).length>n.width/8)throw new Error("overflow");let r=Tr.from(e);n.signed&&(r=r.fromTwos(n.width));const i=r.toTwos((n.signed?0:1)+n.width).toHexString(),a=Br(r,n.decimals);return new Lr(Ir,i,a,n)}static from(e,t){if("string"==typeof e)return Lr.fromString(e,t);if(er(e))return Lr.fromBytes(e,t);try{return Lr.fromValue(e,0,t)}catch(e){if(e.code!==Wn.errors.INVALID_ARGUMENT)throw e}return Or.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const Ur=Lr.from(1),jr=Lr.from("0.5");var qr=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))};const zr=new Wn("properties/5.7.0");function Hr(e,t,n){Object.defineProperty(e,t,{enumerable:!0,value:n,writable:!1})}function Vr(e,t){for(let n=0;n<32;n++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function Gr(e){return qr(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const n=e[t];return Promise.resolve(n).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function Kr(e,t){e&&"object"==typeof e||zr.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((n=>{t[n]||zr.throwArgumentError("invalid object key - "+n,"transaction:"+n,e)}))}function Wr(e){const t={};for(const n in e)t[n]=e[n];return t}const Xr={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function $r(e){if(null==e||Xr[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let n=0;n<t.length;n++){let r=null;try{r=e[t[n]]}catch(e){continue}if(!$r(r))return!1}return!0}return zr.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function Jr(e){if($r(e))return e;if(Array.isArray(e))return Object.freeze(e.map((e=>Yr(e))));if("object"==typeof e){const t={};for(const n in e){const r=e[n];void 0!==r&&Hr(t,n,Yr(r))}return t}return zr.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function Yr(e){return Jr(e)}let Qr=class{constructor(e){for(const t in e)this[t]=Yr(e[t])}};var Zr=Object.freeze({__proto__:null,Description:Qr,checkProperties:Kr,deepCopy:Yr,defineReadOnly:Hr,getStatic:Vr,resolveProperties:Gr,shallowCopy:Wr});const ei="abi/5.7.0",ti=new Wn(ei),ni={};let ri={calldata:!0,memory:!0,storage:!0},ii={calldata:!0,memory:!0};function ai(e,t){if("bytes"===e||"string"===e){if(ri[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&ii[t])return!0;return(ri[t]||"payable"===t)&&ti.throwArgumentError("invalid modifier","name",t),!1}function oi(e,t){for(let n in t)Hr(e,n,t[n])}const si=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),ui=new RegExp(/^(.*)\[([0-9]*)\]$/);let ci=class e{constructor(t,n){t!==ni&&ti.throwError("use fromString",Wn.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),oi(this,n);let r=this.type.match(ui);oi(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:e.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=si.sighash),si[e]||ti.throwArgumentError("invalid format type","format",e),e===si.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==si.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===si.full?", ":",")+")"):t+=this.type,e!==si.sighash&&(!0===this.indexed&&(t+=" indexed"),e===si.full&&this.name&&(t+=" "+this.name)),t}static from(t,n){return"string"==typeof t?e.fromString(t,n):e.fromObject(t)}static fromObject(t){return e.isParamType(t)?t:new e(ni,{name:t.name||null,type:wi(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(e.fromObject):null})}static fromString(t,n){return r=function(e,t){let n=e;function r(t){ti.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function i(e){let n={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(n.indexed=!1),n}e=e.replace(/\s/g," ");let a={type:"",name:"",state:{allowType:!0}},o=a;for(let n=0;n<e.length;n++){let a=e[n];switch(a){case"(":o.state.allowType&&""===o.type?o.type="tuple":o.state.allowParams||r(n),o.state.allowType=!1,o.type=wi(o.type),o.components=[i(o)],o=o.components[0];break;case")":delete o.state,"indexed"===o.name&&(t||r(n),o.indexed=!0,o.name=""),ai(o.type,o.name)&&(o.name=""),o.type=wi(o.type);let e=o;o=o.parent,o||r(n),delete e.parent,o.state.allowParams=!1,o.state.allowName=!0,o.state.allowArray=!0;break;case",":delete o.state,"indexed"===o.name&&(t||r(n),o.indexed=!0,o.name=""),ai(o.type,o.name)&&(o.name=""),o.type=wi(o.type);let s=i(o.parent);o.parent.components.push(s),delete o.parent,o=s;break;case" ":o.state.allowType&&""!==o.type&&(o.type=wi(o.type),delete o.state.allowType,o.state.allowName=!0,o.state.allowParams=!0),o.state.allowName&&""!==o.name&&("indexed"===o.name?(t||r(n),o.indexed&&r(n),o.indexed=!0,o.name=""):ai(o.type,o.name)?o.name="":o.state.allowName=!1);break;case"[":o.state.allowArray||r(n),o.type+=a,o.state.allowArray=!1,o.state.allowName=!1,o.state.readArray=!0;break;case"]":o.state.readArray||r(n),o.type+=a,o.state.readArray=!1,o.state.allowArray=!0,o.state.allowName=!0;break;default:o.state.allowType?(o.type+=a,o.state.allowParams=!0,o.state.allowArray=!0):o.state.allowName?(o.name+=a,delete o.state.allowArray):o.state.readArray?o.type+=a:r(n)}}return o.parent&&ti.throwArgumentError("unexpected eof","param",e),delete a.state,"indexed"===o.name?(t||r(n.length-7),o.indexed&&r(n.length-7),o.indexed=!0,o.name=""):ai(o.type,o.name)&&(o.name=""),a.type=wi(a.type),a}(t,!!n),e.fromObject({name:r.name,type:r.type,indexed:r.indexed,components:r.components});var r}static isParamType(e){return!(null==e||!e._isParamType)}};function fi(e,t){return function(e){e=e.trim();let t=[],n="",r=0;for(let i=0;i<e.length;i++){let a=e[i];","===a&&0===r?(t.push(n),n=""):(n+=a,"("===a?r++:")"===a&&(r--,-1===r&&ti.throwArgumentError("unbalanced parenthesis","value",e)))}n&&t.push(n);return t}(e).map((e=>ci.fromString(e,t)))}let di=class e{constructor(e,t){e!==ni&&ti.throwError("use a static from method",Wn.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),oi(this,t),this._isFragment=!0,Object.freeze(this)}static from(t){return e.isFragment(t)?t:"string"==typeof t?e.fromString(t):e.fromObject(t)}static fromObject(t){if(e.isFragment(t))return t;switch(t.type){case"function":return yi.fromObject(t);case"event":return li.fromObject(t);case"constructor":return mi.fromObject(t);case"error":return vi.fromObject(t);case"fallback":case"receive":return null}return ti.throwArgumentError("invalid fragment object","value",t)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?li.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?yi.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?mi.fromString(e.trim()):"error"===e.split(" ")[0]?vi.fromString(e.substring(5).trim()):ti.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}},li=class e extends di{format(e){if(e||(e=si.sighash),si[e]||ti.throwArgumentError("invalid format type","format",e),e===si.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==si.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===si.full?", ":",")+") ",e!==si.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(t){return"string"==typeof t?e.fromString(t):e.fromObject(t)}static fromObject(t){if(e.isEventFragment(t))return t;"event"!==t.type&&ti.throwArgumentError("invalid event object","value",t);const n={name:Ei(t.name),anonymous:t.anonymous,inputs:t.inputs?t.inputs.map(ci.fromObject):[],type:"event"};return new e(ni,n)}static fromString(t){let n=t.match(Ti);n||ti.throwArgumentError("invalid event string","value",t);let r=!1;return n[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:ti.warn("unknown modifier: "+e)}})),e.fromObject({name:n[1].trim(),anonymous:r,inputs:fi(n[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}};function pi(e,t){t.gas=null;let n=e.split("@");return 1!==n.length?(n.length>2&&ti.throwArgumentError("invalid human-readable ABI signature","value",e),n[1].match(/^[0-9]+$/)||ti.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=Tr.from(n[1]),n[0]):e}function hi(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function bi(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&ti.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&ti.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||ti.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&ti.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&ti.throwArgumentError("unable to determine stateMutability","value",e),t}let mi=class e extends di{format(e){if(e||(e=si.sighash),si[e]||ti.throwArgumentError("invalid format type","format",e),e===si.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});e===si.sighash&&ti.throwError("cannot format a constructor for sighash",Wn.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===si.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(t){return"string"==typeof t?e.fromString(t):e.fromObject(t)}static fromObject(t){if(e.isConstructorFragment(t))return t;"constructor"!==t.type&&ti.throwArgumentError("invalid constructor object","value",t);let n=bi(t);n.constant&&ti.throwArgumentError("constructor cannot be constant","value",t);const r={name:null,type:t.type,inputs:t.inputs?t.inputs.map(ci.fromObject):[],payable:n.payable,stateMutability:n.stateMutability,gas:t.gas?Tr.from(t.gas):null};return new e(ni,r)}static fromString(t){let n={type:"constructor"},r=(t=pi(t,n)).match(Ti);return r&&"constructor"===r[1].trim()||ti.throwArgumentError("invalid constructor string","value",t),n.inputs=fi(r[2].trim(),!1),hi(r[3].trim(),n),e.fromObject(n)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}},yi=class e extends mi{format(e){if(e||(e=si.sighash),si[e]||ti.throwArgumentError("invalid format type","format",e),e===si.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==si.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===si.full?", ":",")+") ",e!==si.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(t){return"string"==typeof t?e.fromString(t):e.fromObject(t)}static fromObject(t){if(e.isFunctionFragment(t))return t;"function"!==t.type&&ti.throwArgumentError("invalid function object","value",t);let n=bi(t);const r={type:t.type,name:Ei(t.name),constant:n.constant,inputs:t.inputs?t.inputs.map(ci.fromObject):[],outputs:t.outputs?t.outputs.map(ci.fromObject):[],payable:n.payable,stateMutability:n.stateMutability,gas:t.gas?Tr.from(t.gas):null};return new e(ni,r)}static fromString(t){let n={type:"function"},r=(t=pi(t,n)).split(" returns ");r.length>2&&ti.throwArgumentError("invalid function string","value",t);let i=r[0].match(Ti);if(i||ti.throwArgumentError("invalid function signature","value",t),n.name=i[1].trim(),n.name&&Ei(n.name),n.inputs=fi(i[2],!1),hi(i[3].trim(),n),r.length>1){let e=r[1].match(Ti);""==e[1].trim()&&""==e[3].trim()||ti.throwArgumentError("unexpected tokens","value",t),n.outputs=fi(e[2],!1)}else n.outputs=[];return e.fromObject(n)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}};function gi(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||ti.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}let vi=class e extends di{format(e){if(e||(e=si.sighash),si[e]||ti.throwArgumentError("invalid format type","format",e),e===si.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==si.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===si.full?", ":",")+") ",t.trim()}static from(t){return"string"==typeof t?e.fromString(t):e.fromObject(t)}static fromObject(t){if(e.isErrorFragment(t))return t;"error"!==t.type&&ti.throwArgumentError("invalid error object","value",t);const n={type:t.type,name:Ei(t.name),inputs:t.inputs?t.inputs.map(ci.fromObject):[]};return gi(new e(ni,n))}static fromString(t){let n={type:"error"},r=t.match(Ti);return r||ti.throwArgumentError("invalid error signature","value",t),n.name=r[1].trim(),n.name&&Ei(n.name),n.inputs=fi(r[2],!1),gi(e.fromObject(n))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}};function wi(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const _i=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Ei(e){return e&&e.match(_i)||ti.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const Ti=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const Ai=new Wn(ei);function Ri(e){const t=[],n=function(e,r){if(Array.isArray(r))for(let i in r){const a=e.slice();a.push(i);try{n(a,r[i])}catch(e){t.push({path:a,error:e})}}};return n([],e),t}let Si=class{constructor(e,t,n,r){this.name=e,this.type=t,this.localName=n,this.dynamic=r}_throwError(e,t){Ai.throwArgumentError(e,this.localName,t)}},ki=class{constructor(e){Hr(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return fr(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(nr(e._data))}writeBytes(e){let t=tr(e);const n=t.length%this.wordSize;return n&&(t=nr([t,this._padding.slice(n)])),this._writeData(t)}_getValue(e){let t=tr(Tr.from(e));return t.length>this.wordSize&&Ai.throwError("value out-of-bounds",Wn.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=nr([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}};var Oi={exports:{}};
|
|
2
2
|
/**
|
|
3
3
|
* [js-sha3]{@link https://github.com/emn178/js-sha3}
|
|
4
4
|
*
|
|
@@ -28,7 +28,7 @@ e.exports=n=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exp
|
|
|
28
28
|
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
29
29
|
* @copyright Chen, Yi-Cyuan 2015-2018
|
|
30
30
|
* @license MIT
|
|
31
|
-
*/HC=VC,function(){var e="input is invalid type",t="object"==typeof window,n=t?window:{};n.JS_SHA3_NO_WINDOW&&(t=!1);var r=!t&&"object"==typeof self;!n.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?n=PI:r&&(n=self);var i=!n.JS_SHA3_NO_COMMON_JS&&HC.exports,a=!n.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,o="0123456789abcdef".split(""),s=[4,1024,262144,67108864],u=[0,8,16,24],c=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],f=[224,256,384,512],d=[128,256],l=["hex","buffer","arrayBuffer","array","digest"],p={128:168,256:136};!n.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!a||!n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var h=function(e,t,n){return function(r){return new I(e,t,e).update(r)[n]()}},b=function(e,t,n){return function(r,i){return new I(e,t,i).update(r)[n]()}},m=function(e,t,n){return function(t,r,i,a){return _["cshake"+e].update(t,r,i,a)[n]()}},y=function(e,t,n){return function(t,r,i,a){return _["kmac"+e].update(t,r,i,a)[n]()}},g=function(e,t,n,r){for(var i=0;i<l.length;++i){var a=l[i];e[a]=t(n,r,a)}return e},v=function(e,t){var n=h(e,t,"hex");return n.create=function(){return new I(e,t,e)},n.update=function(e){return n.create().update(e)},g(n,h,e,t)},w=[{name:"keccak",padding:[1,256,65536,16777216],bits:f,createMethod:v},{name:"sha3",padding:[6,1536,393216,100663296],bits:f,createMethod:v},{name:"shake",padding:[31,7936,2031616,520093696],bits:d,createMethod:function(e,t){var n=b(e,t,"hex");return n.create=function(n){return new I(e,t,n)},n.update=function(e,t){return n.create(t).update(e)},g(n,b,e,t)}},{name:"cshake",padding:s,bits:d,createMethod:function(e,t){var n=p[e],r=m(e,0,"hex");return r.create=function(r,i,a){return i||a?new I(e,t,r).bytepad([i,a],n):_["shake"+e].create(r)},r.update=function(e,t,n,i){return r.create(t,n,i).update(e)},g(r,m,e,t)}},{name:"kmac",padding:s,bits:d,createMethod:function(e,t){var n=p[e],r=y(e,0,"hex");return r.create=function(r,i,a){return new x(e,t,i).bytepad(["KMAC",a],n).bytepad([r],n)},r.update=function(e,t,n,i){return r.create(e,n,i).update(t)},g(r,y,e,t)}}],_={},E=[],T=0;T<w.length;++T)for(var A=w[T],R=A.bits,S=0;S<R.length;++S){var k=A.name+"_"+R[S];if(E.push(k),_[k]=A.createMethod(R[S],A.padding),"sha3"!==A.name){var O=A.name+R[S];E.push(O),_[O]=_[k]}}function I(e,t,n){this.blocks=[],this.s=[],this.padding=t,this.outputBits=n,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var r=0;r<50;++r)this.s[r]=0}function x(e,t,n){I.call(this,e,t,n)}I.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var n,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(e);if(null===t)throw new Error(e);if(a&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||a&&ArrayBuffer.isView(t)))throw new Error(e);n=!0}for(var i,o,s=this.blocks,c=this.byteCount,f=t.length,d=this.blockCount,l=0,p=this.s;l<f;){if(this.reset)for(this.reset=!1,s[0]=this.block,i=1;i<d+1;++i)s[i]=0;if(n)for(i=this.start;l<f&&i<c;++l)s[i>>2]|=t[l]<<u[3&i++];else for(i=this.start;l<f&&i<c;++l)(o=t.charCodeAt(l))<128?s[i>>2]|=o<<u[3&i++]:o<2048?(s[i>>2]|=(192|o>>6)<<u[3&i++],s[i>>2]|=(128|63&o)<<u[3&i++]):o<55296||o>=57344?(s[i>>2]|=(224|o>>12)<<u[3&i++],s[i>>2]|=(128|o>>6&63)<<u[3&i++],s[i>>2]|=(128|63&o)<<u[3&i++]):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++l)),s[i>>2]|=(240|o>>18)<<u[3&i++],s[i>>2]|=(128|o>>12&63)<<u[3&i++],s[i>>2]|=(128|o>>6&63)<<u[3&i++],s[i>>2]|=(128|63&o)<<u[3&i++]);if(this.lastByteIndex=i,i>=c){for(this.start=i-c,this.block=s[d],i=0;i<d;++i)p[i]^=s[i];C(p),this.reset=!0}else this.start=i}return this},I.prototype.encode=function(e,t){var n=255&e,r=1,i=[n];for(n=255&(e>>=8);n>0;)i.unshift(n),n=255&(e>>=8),++r;return t?i.push(r):i.unshift(r),this.update(i),i.length},I.prototype.encodeString=function(t){var n,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(e);if(null===t)throw new Error(e);if(a&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||a&&ArrayBuffer.isView(t)))throw new Error(e);n=!0}var i=0,o=t.length;if(n)i=o;else for(var s=0;s<t.length;++s){var u=t.charCodeAt(s);u<128?i+=1:u<2048?i+=2:u<55296||u>=57344?i+=3:(u=65536+((1023&u)<<10|1023&t.charCodeAt(++s)),i+=4)}return i+=this.encode(8*i),this.update(t),i},I.prototype.bytepad=function(e,t){for(var n=this.encode(t),r=0;r<e.length;++r)n+=this.encodeString(e[r]);var i=t-n%t,a=[];return a.length=i,this.update(a),this},I.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,n=this.blockCount,r=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[n],t=1;t<n+1;++t)e[t]=0;for(e[n-1]|=2147483648,t=0;t<n;++t)r[t]^=e[t];C(r)}},I.prototype.toString=I.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,a=0,s=0,u="";s<r;){for(a=0;a<t&&s<r;++a,++s)e=n[a],u+=o[e>>4&15]+o[15&e]+o[e>>12&15]+o[e>>8&15]+o[e>>20&15]+o[e>>16&15]+o[e>>28&15]+o[e>>24&15];s%t==0&&(C(n),a=0)}return i&&(e=n[a],u+=o[e>>4&15]+o[15&e],i>1&&(u+=o[e>>12&15]+o[e>>8&15]),i>2&&(u+=o[e>>20&15]+o[e>>16&15])),u},I.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,a=0,o=0,s=this.outputBits>>3;e=i?new ArrayBuffer(r+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(e);o<r;){for(a=0;a<t&&o<r;++a,++o)u[o]=n[a];o%t==0&&C(n)}return i&&(u[a]=n[a],e=e.slice(0,s)),e},I.prototype.buffer=I.prototype.arrayBuffer,I.prototype.digest=I.prototype.array=function(){this.finalize();for(var e,t,n=this.blockCount,r=this.s,i=this.outputBlocks,a=this.extraBytes,o=0,s=0,u=[];s<i;){for(o=0;o<n&&s<i;++o,++s)e=s<<2,t=r[o],u[e]=255&t,u[e+1]=t>>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;s%n==0&&C(r)}return a&&(e=s<<2,t=r[o],u[e]=255&t,a>1&&(u[e+1]=t>>8&255),a>2&&(u[e+2]=t>>16&255)),u},x.prototype=new I,x.prototype.finalize=function(){return this.encode(this.outputBits,!0),I.prototype.finalize.call(this)};var C=function(e){var t,n,r,i,a,o,s,u,f,d,l,p,h,b,m,y,g,v,w,_,E,T,A,R,S,k,O,I,x,C,M,N,P,B,D,F,L,U,j,q,z,H,V,G,K,W,X,$,J,Y,Q,Z,ee,te,ne,re,ie,ae,oe,se,ue,ce,fe;for(r=0;r<48;r+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],a=e[1]^e[11]^e[21]^e[31]^e[41],o=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],f=e[5]^e[15]^e[25]^e[35]^e[45],d=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(p=e[8]^e[18]^e[28]^e[38]^e[48])^(o<<1|s>>>31),n=(h=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|o>>>31),e[0]^=t,e[1]^=n,e[10]^=t,e[11]^=n,e[20]^=t,e[21]^=n,e[30]^=t,e[31]^=n,e[40]^=t,e[41]^=n,t=i^(u<<1|f>>>31),n=a^(f<<1|u>>>31),e[2]^=t,e[3]^=n,e[12]^=t,e[13]^=n,e[22]^=t,e[23]^=n,e[32]^=t,e[33]^=n,e[42]^=t,e[43]^=n,t=o^(d<<1|l>>>31),n=s^(l<<1|d>>>31),e[4]^=t,e[5]^=n,e[14]^=t,e[15]^=n,e[24]^=t,e[25]^=n,e[34]^=t,e[35]^=n,e[44]^=t,e[45]^=n,t=u^(p<<1|h>>>31),n=f^(h<<1|p>>>31),e[6]^=t,e[7]^=n,e[16]^=t,e[17]^=n,e[26]^=t,e[27]^=n,e[36]^=t,e[37]^=n,e[46]^=t,e[47]^=n,t=d^(i<<1|a>>>31),n=l^(a<<1|i>>>31),e[8]^=t,e[9]^=n,e[18]^=t,e[19]^=n,e[28]^=t,e[29]^=n,e[38]^=t,e[39]^=n,e[48]^=t,e[49]^=n,b=e[0],m=e[1],W=e[11]<<4|e[10]>>>28,X=e[10]<<4|e[11]>>>28,I=e[20]<<3|e[21]>>>29,x=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,H=e[40]<<18|e[41]>>>14,V=e[41]<<18|e[40]>>>14,B=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,y=e[13]<<12|e[12]>>>20,g=e[12]<<12|e[13]>>>20,$=e[22]<<10|e[23]>>>22,J=e[23]<<10|e[22]>>>22,C=e[33]<<13|e[32]>>>19,M=e[32]<<13|e[33]>>>19,ce=e[42]<<2|e[43]>>>30,fe=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,ne=e[4]<<30|e[5]>>>2,F=e[14]<<6|e[15]>>>26,L=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Y=e[34]<<15|e[35]>>>17,Q=e[35]<<15|e[34]>>>17,N=e[45]<<29|e[44]>>>3,P=e[44]<<29|e[45]>>>3,R=e[6]<<28|e[7]>>>4,S=e[7]<<28|e[6]>>>4,re=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,j=e[27]<<25|e[26]>>>7,_=e[36]<<21|e[37]>>>11,E=e[37]<<21|e[36]>>>11,Z=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,G=e[8]<<27|e[9]>>>5,K=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,O=e[19]<<20|e[18]>>>12,ae=e[29]<<7|e[28]>>>25,oe=e[28]<<7|e[29]>>>25,q=e[38]<<8|e[39]>>>24,z=e[39]<<8|e[38]>>>24,T=e[48]<<14|e[49]>>>18,A=e[49]<<14|e[48]>>>18,e[0]=b^~y&v,e[1]=m^~g&w,e[10]=R^~k&I,e[11]=S^~O&x,e[20]=B^~F&U,e[21]=D^~L&j,e[30]=G^~W&$,e[31]=K^~X&J,e[40]=te^~re&ae,e[41]=ne^~ie&oe,e[2]=y^~v&_,e[3]=g^~w&E,e[12]=k^~I&C,e[13]=O^~x&M,e[22]=F^~U&q,e[23]=L^~j&z,e[32]=W^~$&Y,e[33]=X^~J&Q,e[42]=re^~ae&se,e[43]=ie^~oe&ue,e[4]=v^~_&T,e[5]=w^~E&A,e[14]=I^~C&N,e[15]=x^~M&P,e[24]=U^~q&H,e[25]=j^~z&V,e[34]=$^~Y&Z,e[35]=J^~Q&ee,e[44]=ae^~se&ce,e[45]=oe^~ue&fe,e[6]=_^~T&b,e[7]=E^~A&m,e[16]=C^~N&R,e[17]=M^~P&S,e[26]=q^~H&B,e[27]=z^~V&D,e[36]=Y^~Z&G,e[37]=Q^~ee&K,e[46]=se^~ce&te,e[47]=ue^~fe&ne,e[8]=T^~b&y,e[9]=A^~m&g,e[18]=N^~R&k,e[19]=P^~S&O,e[28]=H^~B&F,e[29]=V^~D&L,e[38]=Z^~G&W,e[39]=ee^~K&X,e[48]=ce^~te&re,e[49]=fe^~ne&ie,e[0]^=c[r],e[1]^=c[r+1]};if(i)HC.exports=_;else for(T=0;T<E.length;++T)n[E[T]]=_[E[T]]}();var GC=VC.exports;function KC(e){return"0x"+GC.keccak_256(tr(e))}let WC=!1,XC=!1;const $C={debug:1,default:2,info:2,warning:3,error:4,off:5};let JC=$C.default,YC=null;const QC=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(n){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var ZC,eM;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(ZC||(ZC={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(eM||(eM={}));const tM="0123456789abcdef";let nM=class e{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const n=e.toLowerCase();null==$C[n]&&this.throwArgumentError("invalid log level name","logLevel",e),JC>$C[n]||console.log.apply(console,t)}debug(...t){this._log(e.levels.DEBUG,t)}info(...t){this._log(e.levels.INFO,t)}warn(...t){this._log(e.levels.WARNING,t)}makeError(t,n,r){if(XC)return this.makeError("censored error",n,{});n||(n=e.errors.UNKNOWN_ERROR),r||(r={});const i=[];Object.keys(r).forEach((e=>{const t=r[e];try{if(t instanceof Uint8Array){let n="";for(let e=0;e<t.length;e++)n+=tM[t[e]>>4],n+=tM[15&t[e]];i.push(e+"=Uint8Array(0x"+n+")")}else i.push(e+"="+JSON.stringify(t))}catch(t){i.push(e+"="+JSON.stringify(r[e].toString()))}})),i.push(`code=${n}`),i.push(`version=${this.version}`);const a=t;let o="";switch(n){case eM.NUMERIC_FAULT:{o="NUMERIC_FAULT";const e=t;switch(e){case"overflow":case"underflow":case"division-by-zero":o+="-"+e;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case eM.CALL_EXCEPTION:case eM.INSUFFICIENT_FUNDS:case eM.MISSING_NEW:case eM.NONCE_EXPIRED:case eM.REPLACEMENT_UNDERPRICED:case eM.TRANSACTION_REPLACED:case eM.UNPREDICTABLE_GAS_LIMIT:o=n}o&&(t+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(t+=" ("+i.join(", ")+")");const s=new Error(t);return s.reason=a,s.code=n,Object.keys(r).forEach((function(e){s[e]=r[e]})),s}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(t,n,r){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:n,value:r})}assert(e,t,n,r){e||this.throwError(t,n,r)}assertArgument(e,t,n,r){e||this.throwArgumentError(t,n,r)}checkNormalize(t){QC&&this.throwError("platform missing String.prototype.normalize",e.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:QC})}checkSafeUint53(t,n){"number"==typeof t&&(null==n&&(n="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,n,r){r=r?": "+r:"",t<n&&this.throwError("missing argument"+r,e.errors.MISSING_ARGUMENT,{count:t,expectedCount:n}),t>n&&this.throwError("too many arguments"+r,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:n})}checkNew(t,n){t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:n.name})}checkAbstract(t,n){t===n?this.throwError("cannot instantiate abstract class "+JSON.stringify(n.name)+" directly; use a sub-class",e.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:n.name})}static globalLogger(){return YC||(YC=new e("logger/5.7.0")),YC}static setCensorship(t,n){if(!t&&n&&this.globalLogger().throwError("cannot permanently disable censorship",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),WC){if(!t)return;this.globalLogger().throwError("error censorship permanent",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}XC=!!t,WC=!!n}static setLogLevel(t){const n=$C[t.toLowerCase()];null!=n?JC=n:e.globalLogger().warn("invalid log level - "+t)}static from(t){return new e(t)}};nM.errors=eM,nM.levels=ZC;var rM=Fn.BN;const iM=new nM("bignumber/5.7.0"),aM={};let oM=!1,sM=class e{constructor(e,t){e!==aM&&iM.throwError("cannot call constructor directly; use BigNumber.from",nM.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return cM(fM(this).fromTwos(e))}toTwos(e){return cM(fM(this).toTwos(e))}abs(){return"-"===this._hex[0]?e.from(this._hex.substring(1)):this}add(e){return cM(fM(this).add(fM(e)))}sub(e){return cM(fM(this).sub(fM(e)))}div(t){return e.from(t).isZero()&&dM("division-by-zero","div"),cM(fM(this).div(fM(t)))}mul(e){return cM(fM(this).mul(fM(e)))}mod(e){const t=fM(e);return t.isNeg()&&dM("division-by-zero","mod"),cM(fM(this).umod(t))}pow(e){const t=fM(e);return t.isNeg()&&dM("negative-power","pow"),cM(fM(this).pow(t))}and(e){const t=fM(e);return(this.isNegative()||t.isNeg())&&dM("unbound-bitwise-result","and"),cM(fM(this).and(t))}or(e){const t=fM(e);return(this.isNegative()||t.isNeg())&&dM("unbound-bitwise-result","or"),cM(fM(this).or(t))}xor(e){const t=fM(e);return(this.isNegative()||t.isNeg())&&dM("unbound-bitwise-result","xor"),cM(fM(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&dM("negative-width","mask"),cM(fM(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&dM("negative-width","shl"),cM(fM(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&dM("negative-width","shr"),cM(fM(this).shrn(e))}eq(e){return fM(this).eq(fM(e))}lt(e){return fM(this).lt(fM(e))}lte(e){return fM(this).lte(fM(e))}gt(e){return fM(this).gt(fM(e))}gte(e){return fM(this).gte(fM(e))}isNegative(){return"-"===this._hex[0]}isZero(){return fM(this).isZero()}toNumber(){try{return fM(this).toNumber()}catch(e){dM("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return iM.throwError("this platform does not support BigInt",nM.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?oM||(oM=!0,iM.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?iM.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",nM.errors.UNEXPECTED_ARGUMENT,{}):iM.throwError("BigNumber.toString does not accept parameters",nM.errors.UNEXPECTED_ARGUMENT,{})),fM(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof e)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new e(aM,uM(t)):t.match(/^-?[0-9]+$/)?new e(aM,uM(new rM(t))):iM.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&dM("underflow","BigNumber.from",t),(t>=9007199254740991||t<=-9007199254740991)&&dM("overflow","BigNumber.from",t),e.from(String(t));const n=t;if("bigint"==typeof n)return e.from(n.toString());if(er(n))return e.from(sr(n));if(n)if(n.toHexString){const t=n.toHexString();if("string"==typeof t)return e.from(t)}else{let t=n._hex;if(null==t&&"BigNumber"===n.type&&(t=n.hex),"string"==typeof t&&(ar(t)||"-"===t[0]&&ar(t.substring(1))))return e.from(t)}return iM.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(e){return!(!e||!e._isBigNumber)}};function uM(e){if("string"!=typeof e)return uM(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&iM.throwArgumentError("invalid hex","value",e),"0x00"===(e=uM(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function cM(e){return sM.from(uM(e))}function fM(e){const t=sM.from(e).toHexString();return"-"===t[0]?new rM("-"+t.substring(3),16):new rM(t.substring(2),16)}function dM(e,t,n){const r={fault:e,operation:t};return null!=n&&(r.value=n),iM.throwError(e,nM.errors.NUMERIC_FAULT,r)}const lM=new nM("bignumber/5.7.0"),pM={},hM=sM.from(0),bM=sM.from(-1);function mM(e,t,n,r){const i={fault:t,operation:n};return void 0!==r&&(i.value=r),lM.throwError(e,nM.errors.NUMERIC_FAULT,i)}let yM="0";for(;yM.length<256;)yM+=yM;function gM(e){if("number"!=typeof e)try{e=sM.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+yM.substring(0,e):lM.throwArgumentError("invalid decimal size","decimals",e)}function vM(e,t){null==t&&(t=0);const n=gM(t),r=(e=sM.from(e)).lt(hM);r&&(e=e.mul(bM));let i=e.mod(n).toString();for(;i.length<n.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const a=e.div(n).toString();return e=1===n.length?a:a+"."+i,r&&(e="-"+e),e}function wM(e,t){null==t&&(t=0);const n=gM(t);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||lM.throwArgumentError("invalid decimal value","value",e);const r="-"===e.substring(0,1);r&&(e=e.substring(1)),"."===e&&lM.throwArgumentError("missing value","value",e);const i=e.split(".");i.length>2&&lM.throwArgumentError("too many decimal points","value",e);let a=i[0],o=i[1];for(a||(a="0"),o||(o="0");"0"===o[o.length-1];)o=o.substring(0,o.length-1);for(o.length>n.length-1&&mM("fractional component exceeds decimals","underflow","parseFixed"),""===o&&(o="0");o.length<n.length-1;)o+="0";const s=sM.from(a),u=sM.from(o);let c=s.mul(n).add(u);return r&&(c=c.mul(bM)),c}let _M=class e{constructor(e,t,n,r){e!==pM&&lM.throwError("cannot use FixedFormat constructor; use FixedFormat.from",nM.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=n,this.decimals=r,this.name=(t?"":"u")+"fixed"+String(n)+"x"+String(r),this._multiplier=gM(r),Object.freeze(this)}static from(t){if(t instanceof e)return t;"number"==typeof t&&(t=`fixed128x${t}`);let n=!0,r=128,i=18;if("string"==typeof t)if("fixed"===t);else if("ufixed"===t)n=!1;else{const e=t.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);e||lM.throwArgumentError("invalid fixed format","format",t),n="u"!==e[1],r=parseInt(e[2]),i=parseInt(e[3])}else if(t){const e=(e,n,r)=>null==t[e]?r:(typeof t[e]!==n&&lM.throwArgumentError("invalid fixed format ("+e+" not "+n+")","format."+e,t[e]),t[e]);n=e("signed","boolean",n),r=e("width","number",r),i=e("decimals","number",i)}return r%8&&lM.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),i>80&&lM.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new e(pM,n,r,i)}},EM=class e{constructor(e,t,n,r){e!==pM&&lM.throwError("cannot use FixedNumber constructor; use FixedNumber.from",nM.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=r,this._hex=t,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&lM.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(t){this._checkFormat(t);const n=wM(this._value,this.format.decimals),r=wM(t._value,t.format.decimals);return e.fromValue(n.add(r),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);const n=wM(this._value,this.format.decimals),r=wM(t._value,t.format.decimals);return e.fromValue(n.sub(r),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);const n=wM(this._value,this.format.decimals),r=wM(t._value,t.format.decimals);return e.fromValue(n.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);const n=wM(this._value,this.format.decimals),r=wM(t._value,t.format.decimals);return e.fromValue(n.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const t=this.toString().split(".");1===t.length&&t.push("0");let n=e.from(t[0],this.format);const r=!t[1].match(/^(0*)$/);return this.isNegative()&&r&&(n=n.subUnsafe(TM.toFormat(n.format))),n}ceiling(){const t=this.toString().split(".");1===t.length&&t.push("0");let n=e.from(t[0],this.format);const r=!t[1].match(/^(0*)$/);return!this.isNegative()&&r&&(n=n.addUnsafe(TM.toFormat(n.format))),n}round(t){null==t&&(t=0);const n=this.toString().split(".");if(1===n.length&&n.push("0"),(t<0||t>80||t%1)&&lM.throwArgumentError("invalid decimal count","decimals",t),n[1].length<=t)return this;const r=e.from("1"+yM.substring(0,t),this.format),i=AM.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(i).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&lM.throwArgumentError("invalid byte width","width",e);return pr(sM.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return e.fromString(this._value,t)}static fromValue(t,n,r){return null!=r||null==n||function(e){return null!=e&&(sM.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||ar(e)||"bigint"==typeof e||er(e))}(n)||(r=n,n=null),null==n&&(n=0),null==r&&(r="fixed"),e.fromString(vM(t,n),_M.from(r))}static fromString(t,n){null==n&&(n="fixed");const r=_M.from(n),i=wM(t,r.decimals);!r.signed&&i.lt(hM)&&mM("unsigned value cannot be negative","overflow","value",t);let a=null;r.signed?a=i.toTwos(r.width).toHexString():(a=i.toHexString(),a=pr(a,r.width/8));const o=vM(i,r.decimals);return new e(pM,a,o,r)}static fromBytes(t,n){null==n&&(n="fixed");const r=_M.from(n);if(tr(t).length>r.width/8)throw new Error("overflow");let i=sM.from(t);r.signed&&(i=i.fromTwos(r.width));const a=i.toTwos((r.signed?0:1)+r.width).toHexString(),o=vM(i,r.decimals);return new e(pM,a,o,r)}static from(t,n){if("string"==typeof t)return e.fromString(t,n);if(er(t))return e.fromBytes(t,n);try{return e.fromValue(t,0,n)}catch(t){if(t.code!==nM.errors.INVALID_ARGUMENT)throw t}return lM.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}};const TM=EM.from(1),AM=EM.from("0.5"),RM=new nM("strings/5.7.0");var SM,kM;function OM(e,t=SM.current){t!=SM.current&&(RM.checkNormalize(),e=e.normalize(t));let n=[];for(let t=0;t<e.length;t++){const r=e.charCodeAt(t);if(r<128)n.push(r);else if(r<2048)n.push(r>>6|192),n.push(63&r|128);else if(55296==(64512&r)){t++;const i=e.charCodeAt(t);if(t>=e.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const a=65536+((1023&r)<<10)+(1023&i);n.push(a>>18|240),n.push(a>>12&63|128),n.push(a>>6&63|128),n.push(63&a|128)}else n.push(r>>12|224),n.push(r>>6&63|128),n.push(63&r|128)}return tr(n)}function IM(e,t){t||(t=function(e){return[parseInt(e,16)]});let n=0,r={};return e.split(",").forEach((e=>{let i=e.split(":");n+=parseInt(i[0],16),r[n]=t(i[1])})),r}function xM(e){let t=0;return e.split(",").map((e=>{let n=e.split("-");1===n.length?n[1]="0":""===n[1]&&(n[1]="1");let r=t+parseInt(n[0],16);return t=parseInt(n[1],16),{l:r,h:t}}))}function CM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function MM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?CM(Object(n),!0).forEach((function(t){pI(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CM(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function NM(e,t,n){return PM.apply(this,arguments)}function PM(){return(PM=NI(LI.mark((function e(t,n,r){var i,a,o,s,u,c,f,d;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n.users.map((function(e){return{ether_key:e.user,tokens:e.tokens.map((function(e){return MM({id:e.id,blueprint:e.blueprint},e.royalties&&e.royalties.length>0&&{royalties:e.royalties.map((function(e){return{recipient:e.recipient,percentage:e.percentage}}))})}))}})),a=n.royalties,o=MM(MM({contract_address:n.contract_address},a&&a.length>0&&{royalties:a.map((function(e){return{recipient:e.recipient,percentage:e.percentage}}))}),{},{users:i,auth_signature:""}),s=KC(OM(JSON.stringify(o))),e.next=6,zI(s,t);case 6:return u=e.sent,c=MM(MM({users:o.users.map((function(e){return{user:e.ether_key,tokens:e.tokens}}))},a&&a.length>0&&{royalties:a}),{},{contract_address:n.contract_address,auth_signature:u}),f={mintTokensRequestV2:[c]},e.next=11,r.mintTokens(f);case 11:return d=e.sent,e.abrupt("return",d.data);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function BM(e){switch(e.type){case"ERC721":return{type:"ERC721",data:{token_id:e.tokenId,token_address:e.tokenAddress}};case"ERC20":return{type:"ERC20",data:{token_address:e.tokenAddress}};case"ETH":return{type:"ETH",data:{decimals:18}}}}function DM(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return FM(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?FM(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function FM(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function LM(e){return UM.apply(this,arguments)}function UM(){return(UM=NI(LI.mark((function e(t){var n,r,i,a,o,s,u,c,f,d,l,p,h,b,m;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.ethSigner,i=t.starkSigner,a=t.request,o=t.transfersApi,e.next=3,r.getAddress();case 3:return s=e.sent,u="ERC721"===a.type?"1":a.amount,e.next=7,o.getSignableTransferV1({getSignableTransferRequest:{sender:s,token:BM(a),amount:u,receiver:a.receiver}});case 7:return c=e.sent,f=c.data,d=f.signable_message,l=f.payload_hash,e.next=11,zI(d,r);case 11:return p=e.sent,e.next=14,i.signMessage(l);case 14:return h=e.sent,b={sender_stark_key:c.data.sender_stark_key,sender_vault_id:c.data.sender_vault_id,receiver_stark_key:c.data.receiver_stark_key,receiver_vault_id:c.data.receiver_vault_id,asset_id:c.data.asset_id,amount:c.data.amount,nonce:c.data.nonce,expiration_timestamp:c.data.expiration_timestamp,stark_signature:h},e.next=18,o.createTransferV1({createTransferRequest:b,xImxEthAddress:s,xImxEthSignature:p});case 18:return m=e.sent,e.abrupt("return",{sent_signature:null==m?void 0:m.data.sent_signature,status:null==m||null===(n=m.data.status)||void 0===n?void 0:n.toString(),time:null==m?void 0:m.data.time,transfer_id:null==m?void 0:m.data.transfer_id});case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jM(e){return qM.apply(this,arguments)}function qM(){return(qM=NI(LI.mark((function e(t){var n,r,i,a,o,s,u,c,f,d,l,p,h,b,m,y,g;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.ethSigner,r=t.starkSigner,i=t.request,a=t.transfersApi,e.next=3,n.getAddress();case 3:return o=e.sent,s=i.map((function(e){return{amount:"1",token:BM({type:"ERC721",tokenId:e.tokenId,tokenAddress:e.tokenAddress}),receiver:e.receiver}})),e.next=7,a.getSignableTransfer({getSignableTransferRequestV2:{sender_ether_key:o,signable_requests:s}});case 7:if(u=e.sent,void 0!==(c=u.data.signable_message)){e.next=11;break}throw new Error("Invalid response from Signable registration offchain");case 11:return e.next=13,zI(c,n);case 13:f=e.sent,d=[],l=DM(u.data.signable_responses),e.prev=16,l.s();case 18:if((p=l.n()).done){e.next=27;break}return h=p.value,e.next=22,r.signMessage(h.payload_hash);case 22:b=e.sent,m={sender_vault_id:h.sender_vault_id,receiver_stark_key:h.receiver_stark_key,receiver_vault_id:h.receiver_vault_id,asset_id:h.asset_id,amount:h.amount,nonce:h.nonce,expiration_timestamp:h.expiration_timestamp,stark_signature:b},d.push(m);case 25:e.next=18;break;case 27:e.next=32;break;case 29:e.prev=29,e.t0=e.catch(16),l.e(e.t0);case 32:return e.prev=32,l.f(),e.finish(32);case 35:return y={sender_stark_key:u.data.sender_stark_key,requests:d},e.next=38,a.createTransfer({createTransferRequestV2:y,xImxEthAddress:o,xImxEthSignature:f});case 38:return g=e.sent,e.abrupt("return",{transfer_ids:null==g?void 0:g.data.transfer_ids});case 40:case"end":return e.stop()}}),e,null,[[16,29,32,35]])})))).apply(this,arguments)}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(SM||(SM={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(kM||(kM={})),xM("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e=>parseInt(e,16))),IM("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),IM("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),IM("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!=0)throw new Error("bad data");let t=[];for(let n=0;n<e.length;n+=4)t.push(parseInt(e.substring(n,n+4),16));return t})),xM("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");const zM=new nM("units/5.7.0"),HM=["wei","kwei","mwei","gwei","szabo","finney","ether"];function VM(e,t){if("string"!=typeof e&&zM.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=HM.indexOf(t);-1!==e&&(t=3*e)}return wM(e,null!=t?t:18)}function GM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function KM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?GM(Object(n),!0).forEach((function(t){pI(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GM(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function WM(e,t,n,r,i,a,o){return XM.apply(this,arguments)}function XM(){return(XM=NI(LI.mark((function e(t,n,r,i,a,o,s){var u,c,f;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return u=e.sent,e.next=5,qC(u,i,s);case 5:return c=e.sent,e.next=8,o.populateTransaction.registerAndDepositEth(u,i,c.operator_signature,r,a);case 8:return f=e.sent,e.abrupt("return",t.sendTransaction(KM(KM({},f),{},{value:n})));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $M(e,t,n,r,i,a){return JM.apply(this,arguments)}function JM(){return(JM=NI(LI.mark((function e(t,n,r,i,a,o){var s;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.populateTransaction["deposit(uint256,uint256,uint256)"](i,r,a);case 2:return s=e.sent,e.abrupt("return",t.sendTransaction(KM(KM({},s),{},{value:n})));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function YM(e,t,n,r,i,a){return QM.apply(this,arguments)}function QM(){return(QM=NI(LI.mark((function e(t,n,r,i,a,o){var s,u,c,f,d,l,p,h,b,m,y;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return s=e.sent,u={decimals:18},c=VM(n.amount,"wei"),f={user:s,token:{type:n.type,data:u},amount:c.toString()},e.next=8,r.getSignableDeposit({getSignableDepositRequest:f});case 8:return d=e.sent,e.next=11,a.encodeAsset({assetType:"asset",encodeAssetRequest:{token:{type:n.type}}});case 11:return l=e.sent,p=l.data.asset_type,h=d.data.stark_key,b=d.data.vault_id,m=wI.connect(o.ethConfiguration.coreContractAddress,t),y=xI.connect(o.ethConfiguration.registrationContractAddress,t),e.next=19,UC(h,y);case 19:if(e.sent){e.next=24;break}return e.abrupt("return",WM(t,c,p,h,b,m,i));case 24:return e.abrupt("return",$M(t,c,p,h,b,m));case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ZM(e,t,n,r,i,a){return eN.apply(this,arguments)}function eN(){return(eN=NI(LI.mark((function e(t,n,r,i,a,o){var s;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.populateTransaction.depositERC20(i,r,a,n);case 2:return s=e.sent,e.abrupt("return",t.sendTransaction(s));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function tN(e,t,n,r,i,a,o){return nN.apply(this,arguments)}function nN(){return(nN=NI(LI.mark((function e(t,n,r,i,a,o,s){var u,c,f;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return u=e.sent,e.next=5,qC(u,i,s);case 5:return c=e.sent,e.next=8,o.populateTransaction.registerAndDepositERC20(u,i,c.operator_signature,r,a,n);case 8:return f=e.sent,e.abrupt("return",t.sendTransaction(f));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function rN(e,t,n,r,i,a,o){return iN.apply(this,arguments)}function iN(){return(iN=NI(LI.mark((function e(t,n,r,i,a,o,s){var u,c,f,d,l,p,h,b,m,y,g,v,w,_,E,T;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return u=e.sent,e.next=5,a.getToken({address:n.tokenAddress});case 5:return c=e.sent,f=parseInt(c.data.decimals),d={decimals:f,token_address:n.tokenAddress},l=VM(n.amount,0),p=bI.connect(n.tokenAddress,t),e.next=12,p.populateTransaction.approve(s.ethConfiguration.coreContractAddress,l);case 12:return h=e.sent,e.next=15,t.sendTransaction(h);case 15:return b={user:u,token:{type:n.type,data:d},amount:l.toString()},e.next=18,r.getSignableDeposit({getSignableDepositRequest:b});case 18:return m=e.sent,e.next=21,o.encodeAsset({assetType:"asset",encodeAssetRequest:{token:{type:n.type,data:{token_address:n.tokenAddress}}}});case 21:return y=e.sent,g=y.data.asset_type,v=m.data.stark_key,w=m.data.vault_id,_=sM.from(m.data.amount),E=wI.connect(s.ethConfiguration.coreContractAddress,t),T=xI.connect(s.ethConfiguration.registrationContractAddress,t),e.next=30,UC(v,T);case 30:if(e.sent){e.next=35;break}return e.abrupt("return",tN(t,_,g,v,w,E,i));case 35:return e.abrupt("return",ZM(t,_,g,v,w,E));case 36:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function aN(e,t,n,r,i,a){return oN.apply(this,arguments)}function oN(){return(oN=NI(LI.mark((function e(t,n,r,i,a,o){var s;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.populateTransaction.depositNft(i,r,a,n);case 2:return s=e.sent,e.abrupt("return",t.sendTransaction(s));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function sN(e,t,n,r,i,a){return uN.apply(this,arguments)}function uN(){return(uN=NI(LI.mark((function e(t,n,r,i,a,o){var s,u,c,f,d,l,p,h,b,m,y,g,v,w;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return s=e.sent,u={token_address:n.tokenAddress,token_id:n.tokenId},c={user:s,token:{type:n.type,data:u},amount:"1".toString()},e.next=8,r.getSignableDeposit({getSignableDepositRequest:c});case 8:return f=e.sent,e.next=11,a.encodeAsset({assetType:"asset",encodeAssetRequest:{token:{type:n.type,data:{token_address:n.tokenAddress,token_id:n.tokenId}}}});case 11:return d=e.sent,l=d.data.asset_type,p=f.data.stark_key,h=f.data.vault_id,b=wI.connect(o.ethConfiguration.coreContractAddress,t),m=xI.connect(o.ethConfiguration.registrationContractAddress,t),e.next=19,UC(p,m);case 19:return y=e.sent,g=yI.connect(n.tokenAddress,t),v=o.ethConfiguration.coreContractAddress,e.next=24,g.isApprovedForAll(s,v);case 24:if(e.sent){e.next=28;break}return e.next=28,g.setApprovalForAll(v,!0);case 28:if(y){e.next=34;break}return e.next=31,qC(s,p,i);case 31:return w=e.sent,e.next=34,b.registerUser(s,p,w.operator_signature);case 34:return e.abrupt("return",aN(t,n.tokenId,l,p,h,b));case 35:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var cN=function(e){if(void 0!==e)return e;throw new Error("undefined field exception")};function fN(e){return dN.apply(this,arguments)}function dN(){return(dN=NI(LI.mark((function e(t){var n,r,i,a,o,s,u,c,f,d,l,p,h;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.ethSigner,r=t.starkSigner,i=t.withdrawalsApi,a="ERC721"===t.type?"1":t.amount,e.t0=i,e.next=5,n.getAddress();case 5:return e.t1=e.sent,e.t2=BM(t),e.t3=a,e.t4={user:e.t1,token:e.t2,amount:e.t3},e.t5={getSignableWithdrawalRequest:e.t4},e.next=12,e.t0.getSignableWithdrawal.call(e.t0,e.t5);case 12:return o=e.sent,s=o.data,u=s.signable_message,c=s.payload_hash,e.next=16,r.signMessage(c);case 16:return f=e.sent,e.next=19,KI(u,n);case 19:return d=e.sent,l=d.ethAddress,p=d.ethSignature,e.next=24,i.createWithdrawal({createWithdrawalRequest:{stark_key:cN(o.data.stark_key),amount:a,asset_id:cN(o.data.asset_id),vault_id:cN(o.data.vault_id),nonce:cN(o.data.nonce),stark_signature:f},xImxEthAddress:l,xImxEthSignature:p});case 24:return h=e.sent,e.abrupt("return",h.data);case 26:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function lN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lN(Object(n),!0).forEach((function(t){pI(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lN(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function hN(e,t,n,r){return bN.apply(this,arguments)}function bN(){return(bN=NI(LI.mark((function e(t,n,r,i){var a;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.encodeAsset({assetType:t,encodeAssetRequest:{token:pN({type:n},i&&{data:i})}});case 2:return a=e.sent,e.abrupt("return",a.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function mN(e,t,n,r,i){return yN.apply(this,arguments)}function yN(){return(yN=NI(LI.mark((function e(t,n,r,i,a){var o,s,u;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return o=e.sent,e.next=5,qC(o,r,a);case 5:return s=e.sent,e.next=8,i.populateTransaction.registerAndWithdraw(o,r,s.operator_signature,n);case 8:return u=e.sent,e.abrupt("return",t.sendTransaction(u));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function gN(e,t,n,r){return vN.apply(this,arguments)}function vN(){return(vN=NI(LI.mark((function e(t,n,r,i){var a;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.populateTransaction.withdraw(r,n);case 2:return a=e.sent,e.abrupt("return",t.sendTransaction(a));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wN(e,t,n,r,i,a){return _N.apply(this,arguments)}function _N(){return(_N=NI(LI.mark((function e(t,n,r,i,a,o){var s,u,c;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,hN("asset","ERC20",i,{token_address:r.tokenAddress});case 2:return s=e.sent,u=wI.connect(o.ethConfiguration.coreContractAddress,t),c=xI.connect(o.ethConfiguration.registrationContractAddress,t),e.next=7,UC(n,c);case 7:if(e.sent){e.next=12;break}return e.abrupt("return",mN(t,s.asset_type,n,c,a));case 12:return e.abrupt("return",gN(t,s.asset_type,n,u));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function EN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function TN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?EN(Object(n),!0).forEach((function(t){pI(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EN(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function AN(e,t,n,r,i){return RN.apply(this,arguments)}function RN(){return(RN=NI(LI.mark((function e(t,n,r,i,a){var o;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.populateTransaction.withdrawAndMint(r,n,i);case 2:return o=e.sent,e.abrupt("return",t.sendTransaction(o));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function SN(e,t,n,r,i,a){return kN.apply(this,arguments)}function kN(){return(kN=NI(LI.mark((function e(t,n,r,i,a,o){var s,u,c;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return s=e.sent,e.next=5,qC(s,r,o);case 5:return u=e.sent,e.next=8,a.populateTransaction.regsiterAndWithdrawAndMint(s,r,u.operator_signature,n,i);case 8:return c=e.sent,e.abrupt("return",t.sendTransaction(c));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ON(e){var t=e.data.id,n=e.data.blueprint||"";return am(Db("{".concat(t,"}:{").concat(n,"}")))}function IN(e,t,n,r,i,a){return xN.apply(this,arguments)}function xN(){return(xN=NI(LI.mark((function e(t,n,r,i,a,o){var s,u,c,f;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,hN("mintable-asset","ERC721",i,TN({id:r.data.id,token_address:r.data.tokenAddress},r.data.blueprint&&{blueprint:r.data.blueprint}));case 2:return s=e.sent,u=ON(r),c=wI.connect(o.ethConfiguration.coreContractAddress,t),f=xI.connect(o.ethConfiguration.registrationContractAddress,t),e.next=8,UC(n,f);case 8:if(e.sent){e.next=13;break}return e.abrupt("return",SN(t,s.asset_type,n,u,f,a));case 13:return e.abrupt("return",AN(t,s.asset_type,n,u,c));case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function CN(e,t,n,r,i,a){return MN.apply(this,arguments)}function MN(){return(MN=NI(LI.mark((function e(t,n,r,i,a,o){var s,u,c;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return s=e.sent,e.next=5,qC(s,r,o);case 5:return u=e.sent,e.next=8,a.populateTransaction.registerAndWithdrawNft(s,r,u.operator_signature,n,i);case 8:return c=e.sent,e.abrupt("return",t.sendTransaction(c));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function NN(e,t,n,r,i){return PN.apply(this,arguments)}function PN(){return(PN=NI(LI.mark((function e(t,n,r,i,a){var o;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.populateTransaction.withdrawNft(r,n,i);case 2:return o=e.sent,e.abrupt("return",t.sendTransaction(o));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function BN(e,t,n,r,i,a){return DN.apply(this,arguments)}function DN(){return(DN=NI(LI.mark((function e(t,n,r,i,a,o){var s,u,c;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,hN("asset","ERC721",i,{token_id:r.tokenId,token_address:r.tokenAddress});case 2:return s=e.sent,u=wI.connect(o.ethConfiguration.coreContractAddress,t),c=xI.connect(o.ethConfiguration.registrationContractAddress,t),e.next=7,UC(n,c);case 7:if(e.sent){e.next=12;break}return e.abrupt("return",CN(t,s.asset_type,n,r.tokenId,c,a));case 12:return e.abrupt("return",NN(t,s.asset_type,n,r.tokenId,u));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function FN(e,t,n,r,i,a,o){return LN.apply(this,arguments)}function LN(){return(LN=NI(LI.mark((function e(t,n,r,i,a,o,s){var u,c;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=r.tokenAddress,c=r.tokenId,e.next=4,a.getMintableTokenDetailsByClientTokenId({tokenAddress:u,tokenId:c}).then((function(e){return IN(t,n,{type:"ERC721",data:{id:c,tokenAddress:u,blueprint:e.data.blueprint}},i,o,s)})).catch((function(e){var a;if(404===(null===(a=e.response)||void 0===a?void 0:a.status))return BN(t,n,r,i,o,s);throw e}));case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function UN(e,t,n,r,i){return jN.apply(this,arguments)}function jN(){return(jN=NI(LI.mark((function e(t,n,r,i,a){var o,s,u;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return o=e.sent,e.next=5,qC(o,r,a);case 5:return s=e.sent,e.next=8,i.populateTransaction.registerAndWithdraw(o,r,s.operator_signature,n);case 8:return u=e.sent,e.abrupt("return",t.sendTransaction(u));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qN(e,t,n,r){return zN.apply(this,arguments)}function zN(){return(zN=NI(LI.mark((function e(t,n,r,i){var a;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.populateTransaction.withdraw(r,n);case 2:return a=e.sent,e.abrupt("return",t.sendTransaction(a));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function HN(e,t,n,r,i){return VN.apply(this,arguments)}function VN(){return(VN=NI(LI.mark((function e(t,n,r,i,a){var o,s,u;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,hN("asset","ETH",r);case 2:return o=e.sent,s=wI.connect(a.ethConfiguration.coreContractAddress,t),u=xI.connect(a.ethConfiguration.registrationContractAddress,t),e.next=7,UC(n,u);case 7:if(e.sent){e.next=12;break}return e.abrupt("return",UN(t,o.asset_type,n,u,i));case 12:return e.abrupt("return",qN(t,o.asset_type,n,s));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function GN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function KN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?GN(Object(n),!0).forEach((function(t){pI(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GN(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function WN(e){return XN.apply(this,arguments)}function XN(){return(XN=NI(LI.mark((function e(t){var n,r,i,a,o,s,u,c,f,d,l,p,h,b,m,y,g;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.ethSigner,r=t.starkSigner,i=t.request,a=t.ordersApi,e.next=3,n.getAddress();case 3:return o=e.sent,s="ERC721"===i.sell.type?"1":i.sell.amount,u="ERC721"===i.buy.type?"1":i.buy.amount,c={user:o,amount_buy:u,token_buy:BM(i.buy),amount_sell:s,token_sell:BM(i.sell),fees:i.fees,expiration_timestamp:i.expiration_timestamp,split_fees:!0},e.next=9,a.getSignableOrder({getSignableOrderRequestV3:c});case 9:return f=e.sent,d=f.data,l=d.signable_message,p=d.payload_hash,e.next=13,zI(l,n);case 13:return h=e.sent,e.next=16,r.signMessage(p);case 16:return b=e.sent,m=f.data,y={createOrderRequest:{amount_buy:m.amount_buy,amount_sell:m.amount_sell,asset_id_buy:m.asset_id_buy,asset_id_sell:m.asset_id_sell,expiration_timestamp:m.expiration_timestamp,include_fees:!0,fees:i.fees,nonce:m.nonce,stark_key:m.stark_key,stark_signature:b,vault_id_buy:m.vault_id_buy,vault_id_sell:m.vault_id_sell},xImxEthAddress:o,xImxEthSignature:h},e.next=21,a.createOrderV3(y);case 21:return g=e.sent,e.abrupt("return",KN({},g.data));case 23:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $N(e){return JN.apply(this,arguments)}function JN(){return(JN=NI(LI.mark((function e(t){var n,r,i,a,o,s,u,c,f,d,l,p;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.ethSigner,r=t.starkSigner,i=t.request,a=t.ordersApi,e.next=3,a.getSignableCancelOrderV3({getSignableCancelOrderRequest:{order_id:i.order_id}});case 3:return o=e.sent,s=o.data,u=s.signable_message,c=s.payload_hash,e.next=7,zI(u,n);case 7:return f=e.sent,e.next=10,r.signMessage(c);case 10:return d=e.sent,e.next=13,n.getAddress();case 13:return l=e.sent,e.next=16,a.cancelOrderV3({id:i.order_id.toString(),cancelOrderRequest:{order_id:i.order_id,stark_signature:d},xImxEthAddress:l,xImxEthSignature:f});case 16:return p=e.sent,e.abrupt("return",{order_id:p.data.order_id,status:p.data.status});case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function YN(e){return QN.apply(this,arguments)}function QN(){return(QN=NI(LI.mark((function e(t){var n,r,i,a,o,s,u,c,f,d,l,p;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.ethSigner,r=t.starkSigner,i=t.request,a=t.tradesApi,e.next=3,n.getAddress();case 3:return o=e.sent,e.next=6,a.getSignableTrade({getSignableTradeRequest:{user:o,order_id:i.order_id,fees:i.fees}});case 6:return s=e.sent,u=s.data,c=u.signable_message,f=u.payload_hash,e.next=10,zI(c,n);case 10:return d=e.sent,e.next=13,r.signMessage(f);case 13:return l=e.sent,e.next=16,a.createTradeV3({createTradeRequest:{amount_buy:s.data.amount_buy,amount_sell:s.data.amount_sell,asset_id_buy:s.data.asset_id_buy,asset_id_sell:s.data.asset_id_sell,expiration_timestamp:s.data.expiration_timestamp,fee_info:s.data.fee_info,fees:i.fees,include_fees:!0,nonce:s.data.nonce,order_id:i.order_id,stark_key:s.data.stark_key,vault_id_buy:s.data.vault_id_buy,vault_id_sell:s.data.vault_id_sell,stark_signature:l},xImxEthAddress:o,xImxEthSignature:d});case 16:return p=e.sent,e.abrupt("return",p.data);case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ZN(e){return eP.apply(this,arguments)}function eP(){return(eP=NI(LI.mark((function e(t){var n,r,i,a,o,s,u,c,f,d,l,p,h,b,m;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.ethSigner,i=t.starkSigner,a=t.request,o=t.exchangesApi,e.next=3,r.getAddress();case 3:return s=e.sent,u=a.amount,e.next=7,o.getExchangeSignableTransfer({id:a.transactionID,getSignableTransferRequest:{sender:s,token:BM(a),amount:u,receiver:a.receiver}});case 7:return c=e.sent,f=c.data,d=f.signable_message,l=f.payload_hash,e.next=11,zI(d,r);case 11:return p=e.sent,e.next=14,i.signMessage(l);case 14:return h=e.sent,b={sender_stark_key:c.data.sender_stark_key,sender_vault_id:c.data.sender_vault_id,receiver_stark_key:c.data.receiver_stark_key,receiver_vault_id:c.data.receiver_vault_id,asset_id:c.data.asset_id,amount:c.data.amount,nonce:c.data.nonce,expiration_timestamp:c.data.expiration_timestamp,stark_signature:h},e.next=18,o.createExchangeTransfer({id:a.transactionID,createTransferRequest:b,xImxEthAddress:s,xImxEthSignature:p});case 18:return m=e.sent,e.abrupt("return",{sent_signature:null==m?void 0:m.data.sent_signature,status:null==m||null===(n=m.data.status)||void 0===n?void 0:n.toString(),time:null==m?void 0:m.data.time,transfer_id:null==m?void 0:m.data.transfer_id});case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function tP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function nP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tP(Object(n),!0).forEach((function(t){pI(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tP(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var rP=function(){function e(t){fI(this,e),this.config=t;var n=t.apiConfiguration;this.config=t,this.depositsApi=new Fx(n),this.encodingApi=new qx(n),this.mintsApi=new rC(n),this.ordersApi=new dC(n),this.tokensApi=new vC(n),this.tradesApi=new TC(n),this.transfersApi=new kC(n),this.usersApi=new CC(n),this.withdrawalsApi=new BC(n),this.projectsApi=new bC(n),this.collectionsApi=new Nx(n),this.metadataApi=new $x(n),this.metadataRefreshesApi=new Zx(n),this.exchangesApi=new Gx(n)}var t,n,r,i,a,o,s,u,c,f,d,l,p,h,b,m,y,g,v,w,_,E,T,A,R,S,k,O;return lI(e,[{key:"isChainValid",value:function(e){return e===this.config.ethConfiguration.chainID}},{key:"validateChain",value:(O=NI(LI.mark((function e(t){var n;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getChainId();case 2:if(n=e.sent,this.isChainValid(n)){e.next=5;break}throw new Error("The wallet used for this operation is not from the correct network.");case 5:case"end":return e.stop()}}),e,this)}))),function(e){return O.apply(this,arguments)})},{key:"registerOffchain",value:(k=NI(LI.mark((function e(t){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",FC(nP(nP({},t),{},{usersApi:this.usersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return k.apply(this,arguments)})},{key:"isRegisteredOnchain",value:(S=NI(LI.mark((function e(t){var n,r;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return n=xI.connect(this.config.ethConfiguration.registrationContractAddress,t.ethSigner),e.next=5,t.starkSigner.getAddress();case 5:return r=e.sent,e.abrupt("return",UC(r,n));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return S.apply(this,arguments)})},{key:"mint",value:(R=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",NM(t,n,this.mintsApi));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return R.apply(this,arguments)})},{key:"transfer",value:(A=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",LM(nP(nP({},t),{},{request:n,transfersApi:this.transfersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return A.apply(this,arguments)})},{key:"exchangeTransfer",value:(T=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",ZN(nP(nP({},t),{},{request:n,exchangesApi:this.exchangesApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return T.apply(this,arguments)})},{key:"batchNftTransfer",value:(E=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",jM(nP(nP({},t),{},{request:n,transfersApi:this.transfersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return E.apply(this,arguments)})},{key:"deposit",value:(_=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=n.type,e.next="ETH"===e.t0?3:"ERC20"===e.t0?4:"ERC721"===e.t0?5:6;break;case 3:return e.abrupt("return",this.depositEth(t,n));case 4:return e.abrupt("return",this.depositERC20(t,n));case 5:return e.abrupt("return",this.depositERC721(t,n));case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return _.apply(this,arguments)})},{key:"depositEth",value:(w=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",YM(t,n,this.depositsApi,this.usersApi,this.encodingApi,this.config));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return w.apply(this,arguments)})},{key:"depositERC20",value:(v=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",rN(t,n,this.depositsApi,this.usersApi,this.tokensApi,this.encodingApi,this.config));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"depositERC721",value:(g=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",sN(t,n,this.depositsApi,this.usersApi,this.encodingApi,this.config));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"prepareWithdrawal",value:(y=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",fN(nP(nP(nP({},t),n),{},{withdrawalsApi:this.withdrawalsApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"completeWithdrawal",value:function(e,t,n){switch(n.type){case"ETH":return this.completeEthWithdrawal(e,t);case"ERC20":return this.completeERC20Withdrawal(e,t,n);case"ERC721":return this.completeERC721Withdrawal(e,t,n)}}},{key:"completeEthWithdrawal",value:(m=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",HN(t,n,this.encodingApi,this.usersApi,this.config));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return m.apply(this,arguments)})},{key:"completeERC20Withdrawal",value:(b=NI(LI.mark((function e(t,n,r){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",wN(t,n,r,this.encodingApi,this.usersApi,this.config));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return b.apply(this,arguments)})},{key:"completeERC721Withdrawal",value:function(){var e=NI(LI.mark((function e(t,n,r){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",FN(t,n,r,this.encodingApi,this.mintsApi,this.usersApi,this.config));case 3:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"createOrder",value:(h=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",WN(nP(nP({},t),{},{request:n,ordersApi:this.ordersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"cancelOrder",value:(p=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",$N(nP(nP({},t),{},{request:n,ordersApi:this.ordersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"createTrade",value:(l=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",YN(nP(nP({},t),{},{request:n,tradesApi:this.tradesApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"createProject",value:(d=NI(LI.mark((function e(t,n){var r;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,VI(t);case 2:return r=e.sent,e.abrupt("return",this.projectsApi.createProject({iMXSignature:r.signature,iMXTimestamp:r.timestamp,createProjectRequest:n}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"getProject",value:(f=NI(LI.mark((function e(t,n){var r;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,VI(t);case 2:return r=e.sent,e.abrupt("return",this.projectsApi.getProject({id:n,iMXSignature:r.signature,iMXTimestamp:r.timestamp}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})},{key:"getProjects",value:(c=NI(LI.mark((function e(t,n,r,i,a){var o;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,VI(t);case 2:return o=e.sent,e.abrupt("return",this.projectsApi.getProjects({iMXSignature:o.signature,iMXTimestamp:o.timestamp,pageSize:n,cursor:r,orderBy:i,direction:a}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r,i){return c.apply(this,arguments)})},{key:"createCollection",value:(u=NI(LI.mark((function e(t,n){var r;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,VI(t);case 2:return r=e.sent,e.abrupt("return",this.collectionsApi.createCollection({iMXSignature:r.signature,iMXTimestamp:r.timestamp,createCollectionRequest:n}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"updateCollection",value:(s=NI(LI.mark((function e(t,n,r){var i;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,VI(t);case 2:return i=e.sent,e.abrupt("return",this.collectionsApi.updateCollection({iMXSignature:i.signature,iMXTimestamp:i.timestamp,address:n,updateCollectionRequest:r}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return s.apply(this,arguments)})},{key:"addMetadataSchemaToCollection",value:(o=NI(LI.mark((function e(t,n,r){var i;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,VI(t);case 2:return i=e.sent,e.abrupt("return",this.metadataApi.addMetadataSchemaToCollection({iMXSignature:i.signature,iMXTimestamp:i.timestamp,addMetadataSchemaToCollectionRequest:r,address:n}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return o.apply(this,arguments)})},{key:"updateMetadataSchemaByName",value:(a=NI(LI.mark((function e(t,n,r,i){var a;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,VI(t);case 2:return a=e.sent,e.abrupt("return",this.metadataApi.updateMetadataSchemaByName({iMXSignature:a.signature,iMXTimestamp:a.timestamp,address:n,name:r,metadataSchemaRequest:i}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return a.apply(this,arguments)})},{key:"listMetadataRefreshes",value:(i=NI(LI.mark((function e(t,n,r,i){var a,o;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,VI(t);case 2:return a=e.sent,e.next=5,t.getAddress();case 5:return o=e.sent,e.abrupt("return",this.metadataRefreshesApi.getAListOfMetadataRefreshes({xImxEthSignature:a.signature,xImxEthTimestamp:a.timestamp,xImxEthAddress:o,collectionAddress:n,pageSize:r,cursor:i}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return i.apply(this,arguments)})},{key:"getMetadataRefreshErrors",value:(r=NI(LI.mark((function e(t,n,r,i){var a,o;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,VI(t);case 2:return a=e.sent,e.next=5,t.getAddress();case 5:return o=e.sent,e.abrupt("return",this.metadataRefreshesApi.getMetadataRefreshErrors({xImxEthSignature:a.signature,xImxEthTimestamp:a.timestamp,xImxEthAddress:o,refreshId:n,pageSize:r,cursor:i}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,n,i){return r.apply(this,arguments)})},{key:"getMetadataRefreshResults",value:(n=NI(LI.mark((function e(t,n){var r,i;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,VI(t);case 2:return r=e.sent,e.next=5,t.getAddress();case 5:return i=e.sent,e.abrupt("return",this.metadataRefreshesApi.getMetadataRefreshResults({xImxEthSignature:r.signature,xImxEthTimestamp:r.timestamp,xImxEthAddress:i,refreshId:n}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"createMetadataRefresh",value:(t=NI(LI.mark((function e(t,n){var r,i;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,VI(t);case 2:return r=e.sent,e.next=5,t.getAddress();case 5:return i=e.sent,e.abrupt("return",this.metadataRefreshesApi.requestAMetadataRefresh({xImxEthSignature:r.signature,xImxEthTimestamp:r.timestamp,xImxEthAddress:i,createMetadataRefreshRequest:n}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})}]),e}();var iP=function(e){AI(n,cx(Error));var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=_I(e);if(t){var i=_I(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return kI(this,n)}}(n);function n(e){var r,i=e.code,a=e.details,o=e.message;return fI(this,n),(r=t.call(this,o)).code=i,r.details=a,r}return lI(n)}();function aP(e){if(cI.isAxiosError(e)&&e.response){var t,n,r,i=e.response.data;return i.code&&i.message?new iP({code:i.code,details:i.details,message:i.message}):new iP({code:null!==(t=null!==(n=e.code)&&void 0!==n?n:null===(r=e.response)||void 0===r?void 0:r.status.toString())&&void 0!==t?t:"unknown_error_code",message:String(e)})}return new iP({code:"unknown_error_code",message:String(e)})}var oP=function(){function e(t){fI(this,e),this.depositsApi=new Fx(t.apiConfiguration),this.mintsApi=new rC(t.apiConfiguration),this.ordersApi=new dC(t.apiConfiguration),this.tokensApi=new vC(t.apiConfiguration),this.tradesApi=new TC(t.apiConfiguration),this.transfersApi=new kC(t.apiConfiguration),this.exchangeApi=new Gx(t.apiConfiguration),this.usersApi=new CC(t.apiConfiguration),this.withdrawalsApi=new BC(t.apiConfiguration),this.balanceApi=new Ix(t.apiConfiguration),this.assetApi=new Rx(t.apiConfiguration),this.collectionApi=new Nx(t.apiConfiguration),this.metadataApi=new $x(t.apiConfiguration),this.metadataRefreshesApi=new Zx(t.apiConfiguration),this.nftCheckoutPrimaryApi=new sC(t.apiConfiguration),this.projectsApi=new bC(t.apiConfiguration),this.workflows=new rP(t)}var t,n,r;return lI(e,[{key:"deposit",value:function(e,t){return this.workflows.deposit(e,t).catch((function(e){throw aP(e)}))}},{key:"getDeposit",value:function(e){return this.depositsApi.getDeposit(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"listDeposits",value:function(e){return this.depositsApi.listDeposits(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"registerOffchain",value:function(e){return this.workflows.registerOffchain(e).catch((function(e){throw aP(e)}))}},{key:"isRegisteredOnchain",value:function(e){return this.workflows.isRegisteredOnchain(e).catch((function(e){throw aP(e)}))}},{key:"getUser",value:function(e){return this.usersApi.getUsers({user:e}).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"getAsset",value:function(e){return this.assetApi.getAsset(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"listAssets",value:function(e){return this.assetApi.listAssets(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"createCollection",value:function(e,t){return this.workflows.createCollection(e,t).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"getCollection",value:function(e){return this.collectionApi.getCollection(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"listCollectionFilters",value:function(e){return this.collectionApi.listCollectionFilters(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"listCollections",value:function(e){return this.collectionApi.listCollections(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"updateCollection",value:function(e,t,n){return this.workflows.updateCollection(e,t,n).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"addMetadataSchemaToCollection",value:function(e,t,n){return this.workflows.addMetadataSchemaToCollection(e,t,n).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"getMetadataSchema",value:function(e){return this.metadataApi.getMetadataSchema(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"updateMetadataSchemaByName",value:function(e,t,n,r){return this.workflows.updateMetadataSchemaByName(e,t,n,r).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"listMetadataRefreshes",value:function(e,t,n,r){return this.workflows.listMetadataRefreshes(e,t,n,r).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"getMetadataRefreshErrors",value:function(e,t,n,r){return this.workflows.getMetadataRefreshErrors(e,t,n,r).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"getMetadataRefreshResults",value:function(e,t){return this.workflows.getMetadataRefreshResults(e,t).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"createMetadataRefresh",value:function(e,t){return this.workflows.createMetadataRefresh(e,t).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"createProject",value:(r=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.workflows.createProject(t,n).then((function(e){return e.data})).catch((function(e){throw aP(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"getProject",value:(n=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.workflows.getProject(t,n).then((function(e){return e.data})).catch((function(e){throw aP(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"getProjects",value:(t=NI(LI.mark((function e(t,n,r,i,a){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.workflows.getProjects(t,n,r,i,a).then((function(e){return e.data})).catch((function(e){throw aP(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,n,r,i,a){return t.apply(this,arguments)})},{key:"getBalance",value:function(e){return this.balanceApi.getBalance(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"listBalances",value:function(e){return this.balanceApi.listBalances(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"getMint",value:function(e){return this.mintsApi.getMint(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"listMints",value:function(e){return this.mintsApi.listMints(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"mint",value:function(e,t){return this.workflows.mint(e,t).catch((function(e){throw aP(e)}))}},{key:"listWithdrawals",value:function(e){return this.withdrawalsApi.listWithdrawals(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"getWithdrawal",value:function(e){return this.withdrawalsApi.getWithdrawal(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"prepareWithdrawal",value:function(e,t){return this.workflows.prepareWithdrawal(e,t).catch((function(e){throw aP(e)}))}},{key:"completeWithdrawal",value:function(e,t,n){return this.workflows.completeWithdrawal(e,t,n).catch((function(e){throw aP(e)}))}},{key:"getOrder",value:function(e){return this.ordersApi.getOrderV3(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"listOrders",value:function(e){return this.ordersApi.listOrdersV3(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"createOrder",value:function(e,t){return this.workflows.createOrder(e,t).catch((function(e){throw aP(e)}))}},{key:"cancelOrder",value:function(e,t){return this.workflows.cancelOrder(e,t).catch((function(e){throw aP(e)}))}},{key:"getTrade",value:function(e){return this.tradesApi.getTrade(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"listTrades",value:function(e){return this.tradesApi.listTradesV3(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"createTrade",value:function(e,t){return this.workflows.createTrade(e,t).catch((function(e){throw aP(e)}))}},{key:"getToken",value:function(e){return this.tokensApi.getToken(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"listTokens",value:function(e){return this.tokensApi.listTokens(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"getTransfer",value:function(e){return this.transfersApi.getTransfer(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"listTransfers",value:function(e){return this.transfersApi.listTransfers(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"transfer",value:function(e,t){return this.workflows.transfer(e,t).catch((function(e){throw aP(e)}))}},{key:"batchNftTransfer",value:function(e,t){return this.workflows.batchNftTransfer(e,t).catch((function(e){throw aP(e)}))}},{key:"createExchange",value:function(e){return this.exchangeApi.createExchange(e).catch((function(e){throw aP(e)}))}},{key:"getExchange",value:function(e){return this.exchangeApi.getExchange(e).catch((function(e){throw aP(e)}))}},{key:"getExchanges",value:function(e){return this.exchangeApi.getExchanges(e).catch((function(e){throw aP(e)}))}},{key:"exchangeTransfer",value:function(e,t){return this.workflows.exchangeTransfer(e,t).catch((function(e){throw aP(e)}))}},{key:"createNftPrimary",value:function(e){return this.nftCheckoutPrimaryApi.createNftPrimary(e).catch((function(e){throw aP(e)}))}},{key:"getCurrenciesNFTCheckoutPrimary",value:function(e){return this.nftCheckoutPrimaryApi.getCurrenciesNFTCheckoutPrimary(e).catch((function(e){throw aP(e)}))}},{key:"getNftPrimaryTransaction",value:function(e){return this.nftCheckoutPrimaryApi.getNftPrimaryTransaction(e).catch((function(e){throw aP(e)}))}},{key:"getNftPrimaryTransactions",value:function(e){return this.nftCheckoutPrimaryApi.getNftPrimaryTransactions(e).catch((function(e){throw aP(e)}))}}]),e}();function sP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function uP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sP(Object(n),!0).forEach((function(t){pI(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sP(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var cP={"x-sdk-version":"imx-core-sdk-ts-".concat("2.0.2")},fP=function(e){var t=e.coreContractAddress,n=e.registrationContractAddress,r=e.chainID,i=e.basePath,a=e.headers,o=e.sdkVersion;if(!i.trim())throw Error("basePath can not be empty");return o&&(cP["x-sdk-version"]=o),a=uP(uP({},a||{}),cP),{apiConfiguration:new DC({basePath:i,baseOptions:{headers:a}}),ethConfiguration:{coreContractAddress:t,registrationContractAddress:n,chainID:r}}},dP={get PRODUCTION(){return fP({basePath:"https://api.x.immutable.com",chainID:1,coreContractAddress:"0x5FDCCA53617f4d2b9134B29090C87D01058e27e9",registrationContractAddress:"0x72a06bf2a1CE5e39cBA06c0CAb824960B587d64c"})},get SANDBOX(){return fP({basePath:"https://api.sandbox.x.immutable.com",chainID:5,coreContractAddress:"0x7917eDb51ecD6CdB3F9854c3cc593F33de10c623",registrationContractAddress:"0x1C97Ada273C9A52253f463042f29117090Cd7D83"})},createConfig:fP},lP=new Fn("08000000 00000010 ffffffff ffffffff b781126d cae7b232 1e66a241 adc64d2f",16);new um.ec(new um.curves.PresetCurve({type:"short",prime:null,p:"08000000 00000011 00000000 00000000 00000000 00000000 00000000 00000001",a:"00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000001",b:"06f21413 efbe40de 150e596d 72f7a8c5 609ad26c 15c915c1 f4cdfcb9 9cee9e89",n:lP.toString("hex"),hash:gc.sha256,gRed:!1,g:["1ef15c18599971b7beced415a40f0c7deacfd9b0d1819e03d723d8bc943cfca","5668060aa49730b7be4801df46ec62de53ecd11abe43a32873000c36e8dc1f"]}));var pP=function(){var e=new Fn("1 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000",16);return e.sub(e.mod(lP))};function hP(e,t){return new Fn(gc.sha256().update(xb(nm(e)+Qb(Fb(t),2))).digest("hex"),16)}function bP(e){for(var t=pP(),n=hP(e.toString("hex",64),0),r=0;n.gte(t);r++)n=hP(n.toString("hex"),r);return n.umod(lP).toString("hex")}function mP(e){for(var t=pP(),n=hP(e.toString("hex",64),0),r=1;n.gte(t);r++)n=hP(n.toString("hex"),r);return n.umod(lP).toString("hex")}function yP(e){var t=pP();return hP(e.toString("hex",64),0).gte(t)}function gP(e){return vP.apply(this,arguments)}function vP(){return(vP=NI(LI.mark((function e(t){var n,r;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=new oP(dP.PRODUCTION),e.next=4,n.getUser(t);case 4:if(!((r=e.sent).accounts.length>0)){e.next=7;break}return e.abrupt("return",{starkPublicKey:r.accounts[0],accountNotFound:!1});case 7:e.next=14;break;case 9:if(e.prev=9,e.t0=e.catch(0),!(e.t0 instanceof iP&&"account_not_found"==e.t0.code)){e.next=13;break}return e.abrupt("return",{starkPublicKey:"",accountNotFound:!0});case 13:throw e.t0;case 14:case"end":return e.stop()}}),e,null,[[0,9]])})))).apply(this,arguments)}function wP(e,t){var n=Ak.hdkey.fromMasterSeed(Buffer.from(e.slice(2),"hex")).derivePath(t).getWallet().getPrivateKey();return new Fn(n)}function _P(e,t,n){return EP.apply(this,arguments)}function EP(){return(EP=NI(LI.mark((function e(t,n,r){var i,a,o,s,u,c,f,d;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=wP(t,n),a=mP(i),yP(i)){e.next=4;break}return e.abrupt("return",a);case 4:return e.next=6,gP(r);case 6:if(void 0!==(o=e.sent)){e.next=9;break}throw new Error("Error fetching stark public key from IMX");case 9:if(!o.accountNotFound){e.next=11;break}return e.abrupt("return",a);case 11:return s=new Fn(nm(o.starkPublicKey),16),e.next=14,sx(a).getAddress();case 14:if(u=e.sent,!s.eq(new Fn(nm(u),16))){e.next=17;break}return e.abrupt("return",a);case 17:return c=bP(i),e.next=20,sx(c).getAddress();case 20:if(u=e.sent,!s.eq(new Fn(nm(u),16))){e.next=23;break}return e.abrupt("return",c);case 23:return f=ax(t,n),d=ix(f),e.next=27,sx(d).getAddress();case 27:if(u=e.sent,!s.eq(new Fn(nm(u),16))){e.next=30;break}return e.abrupt("return",d);case 30:throw new Error("Can not deterministically generate stark private key - please contact support");case 31:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function TP(e){return AP.apply(this,arguments)}function AP(){return(AP=NI(LI.mark((function e(t){var n,r,i,a,o;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return n=e.sent.toLowerCase(),e.next=5,t.signMessage("Only sign this request if you’ve initiated an action with Immutable X.");case 5:return r=e.sent,i=hr(r).s,a=nx("starkex","immutablex",n,"1"),e.next=10,_P(i,a,n);case 10:return o=e.sent,e.abrupt("return",o.padStart(64,"0"));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}nM.errors.INSUFFICIENT_FUNDS,nM.errors.NONCE_EXPIRED,nM.errors.REPLACEMENT_UNDERPRICED;const RP=({basePath:e,chainID:t,coreContractAddress:n,registrationContractAddress:r})=>dP.createConfig({basePath:e,chainID:t,coreContractAddress:n,registrationContractAddress:r,sdkVersion:"ts-immutable-sdk-0.13.0-alpha.1"}),SP=()=>RP({basePath:"https://api.sandbox.x.immutable.com",chainID:5,coreContractAddress:"0x7917eDb51ecD6CdB3F9854c3cc593F33de10c623",registrationContractAddress:"0x1C97Ada273C9A52253f463042f29117090Cd7D83"});class kP{immutableXConfig;baseConfig;constructor({baseConfig:e,overrides:n}){if(this.baseConfig=e,n)this.immutableXConfig=n.immutableXConfig;else switch(e.environment){case t.SANDBOX:this.immutableXConfig=SP();break;case t.PRODUCTION:this.immutableXConfig=RP({basePath:"https://api.x.immutable.com",chainID:1,coreContractAddress:"0x5FDCCA53617f4d2b9134B29090C87D01058e27e9",registrationContractAddress:"0x72a06bf2a1CE5e39cBA06c0CAb824960B587d64c"});break;default:this.immutableXConfig=SP()}}}class OP{immutableX;depositsApi;mintsApi;ordersApi;tokensApi;tradesApi;transfersApi;exchangeApi;nftCheckoutPrimaryApi;usersApi;withdrawalsApi;balanceApi;assetApi;collectionApi;metadataApi;metadataRefreshesApi;projectsApi;constructor(e){const t=new kP(e);this.immutableX=new oP(t.immutableXConfig),this.depositsApi=this.immutableX.depositsApi,this.mintsApi=this.immutableX.mintsApi,this.ordersApi=this.immutableX.ordersApi,this.tokensApi=this.immutableX.tokensApi,this.tradesApi=this.immutableX.tradesApi,this.transfersApi=this.immutableX.transfersApi,this.exchangeApi=this.immutableX.exchangeApi,this.usersApi=this.immutableX.usersApi,this.withdrawalsApi=this.immutableX.withdrawalsApi,this.balanceApi=this.immutableX.balanceApi,this.assetApi=this.immutableX.assetApi,this.collectionApi=this.immutableX.collectionApi,this.metadataApi=this.immutableX.metadataApi,this.metadataRefreshesApi=this.immutableX.metadataRefreshesApi,this.nftCheckoutPrimaryApi=this.immutableX.nftCheckoutPrimaryApi,this.projectsApi=this.immutableX.projectsApi}getDeposit(e){return this.immutableX.getDeposit(e)}listDeposits(e){return this.immutableX.listDeposits(e)}getUser(e){return this.immutableX.getUser(e)}getAsset(e){return this.immutableX.getAsset(e)}listAssets(e){return this.immutableX.listAssets(e)}createCollection(e,t){return this.immutableX.createCollection(e,t)}getCollection(e){return this.immutableX.getCollection(e)}listCollectionFilters(e){return this.immutableX.listCollectionFilters(e)}listCollections(e){return this.collectionApi.listCollections(e).then((e=>e.data))}updateCollection(e,t,n){return this.immutableX.updateCollection(e,t,n)}addMetadataSchemaToCollection(e,t,n){return this.immutableX.addMetadataSchemaToCollection(e,t,n)}getMetadataSchema(e){return this.immutableX.getMetadataSchema(e)}updateMetadataSchemaByName(e,t,n,r){return this.immutableX.updateMetadataSchemaByName(e,t,n,r)}listMetadataRefreshes(e,t,n,r){return this.immutableX.listMetadataRefreshes(e,t,n,r)}getMetadataRefreshErrors(e,t,n,r){return this.immutableX.getMetadataRefreshErrors(e,t,n,r)}getMetadataRefreshResults(e,t){return this.immutableX.getMetadataRefreshResults(e,t)}createMetadataRefresh(e,t){return this.immutableX.createMetadataRefresh(e,t)}async createProject(e,t){return this.immutableX.createProject(e,t)}async getProject(e,t){return this.immutableX.getProject(e,t)}async getProjects(e,t,n,r,i){return this.immutableX.getProjects(e,t,n,r,i)}getBalance(e){return this.immutableX.getBalance(e)}listBalances(e){return this.immutableX.listBalances(e)}getMint(e){return this.immutableX.getMint(e)}listMints(e){return this.immutableX.listMints(e)}mint(e,t){return this.immutableX.mint(e,t)}listWithdrawals(e){return this.immutableX.listWithdrawals(e)}getWithdrawal(e){return this.immutableX.getWithdrawal(e)}getOrder(e){return this.immutableX.getOrder(e)}listOrders(e){return this.immutableX.listOrders(e)}getTrade(e){return this.immutableX.getTrade(e)}listTrades(e){return this.immutableX.listTrades(e)}getToken(e){return this.immutableX.getToken(e)}listTokens(e){return this.immutableX.listTokens(e)}getTransfer(e){return this.immutableX.getTransfer(e)}listTransfers(e){return this.immutableX.listTransfers(e)}createExchange(e){return this.immutableX.createExchange(e).then((e=>e.data))}getExchange(e){return this.immutableX.getExchange(e).then((e=>e.data))}getExchanges(e){return this.immutableX.getExchanges(e).then((e=>e.data))}exchangeTransfer(e,t){return this.immutableX.exchangeTransfer(e,t)}createNftPrimary(e){return this.immutableX.createNftPrimary(e).then((e=>e.data))}getCurrenciesNFTCheckoutPrimary(e){return this.immutableX.getCurrenciesNFTCheckoutPrimary(e).then((e=>e.data))}getNftPrimaryTransaction(e){return this.immutableX.getNftPrimaryTransaction(e).then((e=>e.data))}getNftPrimaryTransactions(e){return this.immutableX.getNftPrimaryTransactions(e).then((e=>e.data))}}var IP=Object.freeze({__proto__:null,ImmutableXClient:OP,imxClientCreateStarkSigner:sx,imxClientGenerateLegacyStarkPrivateKey:TP});var xP={exports:{}};!function(e,t){e.exports=function(){var e=e||function(e,t){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==xt&&xt.crypto&&(n=xt.crypto),!n)try{n=mm}catch(e){}var r=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),a={},o=a.lib={},s=o.Base={extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=o.WordArray=s.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||f).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var a=0;a<i;a++){var o=n[a>>>2]>>>24-a%4*8&255;t[r+a>>>2]|=o<<24-(r+a)%4*8}else for(var s=0;s<i;s+=4)t[r+s>>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(r());return new u.init(t,e)}}),c=a.enc={},f=c.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var a=t[i>>>2]>>>24-i%4*8&255;r.push((a>>>4).toString(16)),r.push((15&a).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new u.init(n,t/2)}},d=c.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var a=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(a))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new u.init(n,t)}},l=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},p=o.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,i=r.words,a=r.sigBytes,o=this.blockSize,s=a/(4*o),c=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*o,f=e.min(4*c,a);if(c){for(var d=0;d<c;d+=o)this._doProcessBlock(i,d);n=i.splice(0,c),r.sigBytes-=f}return new u.init(n,f)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});o.Hasher=p.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new h.HMAC.init(e,n).finalize(t)}}});var h=a.algo={};return a}(Math);return e}()}(xP);var CP=xP.exports,MP=Ct(CP),NP={exports:{}};!function(e,t){e.exports=function(e){return function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.algo,s=[],u=[];!function(){function e(e){for(var n=t.sqrt(e),r=2;r<=n;r++)if(!(e%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(s[i]=n(t.pow(r,.5))),u[i]=n(t.pow(r,1/3)),i++),r++}();var c=[],f=o.SHA256=a.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],f=n[5],d=n[6],l=n[7],p=0;p<64;p++){if(p<16)c[p]=0|e[t+p];else{var h=c[p-15],b=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,m=c[p-2],y=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;c[p]=b+c[p-7]+y+c[p-16]}var g=r&i^r&a^i&a,v=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),w=l+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&f^~s&d)+u[p]+c[p];l=d,d=f,f=s,s=o+w|0,o=a,a=i,i=r,r=w+(v+g)|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+a|0,n[3]=n[3]+o|0,n[4]=n[4]+s|0,n[5]=n[5]+f|0,n[6]=n[6]+d|0,n[7]=n[7]+l|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=t.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});n.SHA256=a._createHelper(f),n.HmacSHA256=a._createHmacHelper(f)}(Math),e.SHA256}(CP)}(NP);var PP=Ct(NP.exports),BP={exports:{}};!function(e,t){e.exports=function(e){return function(){var t=e,n=t.lib.WordArray;function r(e,t,r){for(var i=[],a=0,o=0;o<t;o++)if(o%4){var s=r[e.charCodeAt(o-1)]<<o%4*2|r[e.charCodeAt(o)]>>>6-o%4*2;i[a>>>2]|=s<<24-a%4*8,a++}return n.create(i,a)}t.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var i=[],a=0;a<n;a+=3)for(var o=(t[a>>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.75*s<n;s++)i.push(r.charAt(o>>>6*(3-s)&63));var u=r.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(e){var t=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a<n.length;a++)i[n.charCodeAt(a)]=a}var o=n.charAt(64);if(o){var s=e.indexOf(o);-1!==s&&(t=s)}return r(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64}(CP)}(BP);var DP=Ct(BP.exports),FP={exports:{}};!function(e,t){e.exports=function(e){return e.enc.Utf8}(CP)}(FP);var LP=Ct(FP.exports);function UP(e){this.message=e}UP.prototype=new Error,UP.prototype.name="InvalidCharacterError";var jP="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new UP("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,i=0,a=0,o="";r=t.charAt(a++);~r&&(n=i%4?64*n+r:r,i++%4)?o+=String.fromCharCode(255&n>>(-2*i&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return o};function qP(e){this.message=e}function zP(e,t){if("string"!=typeof e)throw new qP("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(jP(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return jP(t)}}(e.split(".")[n]))}catch(e){throw new qP("Invalid token specified: "+e.message)}}qP.prototype=new Error,qP.prototype.name="InvalidTokenError";var HP,VP,GP,KP={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},WP=(e=>(e[e.NONE=0]="NONE",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG",e))(WP||{});(GP=WP||(WP={})).reset=function(){HP=3,VP=KP},GP.setLevel=function(e){if(!(0<=e&&e<=4))throw new Error("Invalid log level");HP=e},GP.setLogger=function(e){VP=e};var XP=class{constructor(e){this._name=e}debug(...e){HP>=4&&VP.debug(XP._format(this._name,this._method),...e)}info(...e){HP>=3&&VP.info(XP._format(this._name,this._method),...e)}warn(...e){HP>=2&&VP.warn(XP._format(this._name,this._method),...e)}error(...e){HP>=1&&VP.error(XP._format(this._name,this._method),...e)}throw(e){throw this.error(e),e}create(e){const t=Object.create(this);return t._method=e,t.debug("begin"),t}static createStatic(e,t){const n=new XP(`${e}.${t}`);return n.debug("begin"),n}static _format(e,t){const n=`[${e}]`;return t?`${n} ${t}:`:n}static debug(e,...t){HP>=4&&VP.debug(XP._format(e),...t)}static info(e,...t){HP>=3&&VP.info(XP._format(e),...t)}static warn(e,...t){HP>=2&&VP.warn(XP._format(e),...t)}static error(e,...t){HP>=1&&VP.error(XP._format(e),...t)}};WP.reset();var $P=class{static _randomWord(){return MP.lib.WordArray.random(1).words[0]}static generateUUIDv4(){const e="10000000-1000-4000-8000-100000000000".replace(/[018]/g,(e=>(+e^$P._randomWord()&15>>+e/4).toString(16)));return e.replace(/-/g,"")}static generateCodeVerifier(){return $P.generateUUIDv4()+$P.generateUUIDv4()+$P.generateUUIDv4()}static generateCodeChallenge(e){try{const t=PP(e);return DP.stringify(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(e){throw XP.error("CryptoUtils.generateCodeChallenge",e),e}}static generateBasicAuth(e,t){const n=LP.parse([e,t].join(":"));return DP.stringify(n)}},JP=class{constructor(e){this._name=e,this._logger=new XP(`Event('${this._name}')`),this._callbacks=[]}addHandler(e){return this._callbacks.push(e),()=>this.removeHandler(e)}removeHandler(e){const t=this._callbacks.lastIndexOf(e);t>=0&&this._callbacks.splice(t,1)}raise(...e){this._logger.debug("raise:",...e);for(const t of this._callbacks)t(...e)}},YP=class{static decode(e){try{return zP(e)}catch(e){throw XP.error("JwtUtils.decode",e),e}}},QP=class{static center({...e}){var t;return null==e.width&&(e.width=null!=(t=[800,720,600,480].find((e=>e<=window.outerWidth/1.618)))?t:360),null!=e.left||(e.left=Math.max(0,Math.round(window.screenX+(window.outerWidth-e.width)/2))),null!=e.height&&(null!=e.top||(e.top=Math.max(0,Math.round(window.screenY+(window.outerHeight-e.height)/2)))),e}static serialize(e){return Object.entries(e).filter((([,e])=>null!=e)).map((([e,t])=>`${e}=${"boolean"!=typeof t?t:t?"yes":"no"}`)).join(",")}},ZP=class extends JP{constructor(){super(...arguments),this._logger=new XP(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const e=this._expiration-ZP.getEpochTime();this._logger.debug("timer completes in",e),this._expiration<=ZP.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(e){const t=this._logger.create("init");e=Math.max(Math.floor(e),1);const n=ZP.getEpochTime()+e;if(this.expiration===n&&this._timerHandle)return void t.debug("skipping since already initialized for expiration at",this.expiration);this.cancel(),t.debug("using duration",e),this._expiration=n;const r=Math.min(e,5);this._timerHandle=setInterval(this._callback,1e3*r)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},eB=class{static readParams(e,t="query"){if(!e)throw new TypeError("Invalid URL");const n=new URL(e,"http://127.0.0.1")["fragment"===t?"hash":"search"];return new URLSearchParams(n.slice(1))}},tB=class extends Error{constructor(e,t){var n,r,i;if(super(e.error_description||e.error||""),this.form=t,this.name="ErrorResponse",!e.error)throw XP.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=e.error,this.error_description=null!=(n=e.error_description)?n:null,this.error_uri=null!=(r=e.error_uri)?r:null,this.state=e.userState,this.session_state=null!=(i=e.session_state)?i:null}},nB=class extends Error{constructor(e){super(e),this.name="ErrorTimeout"}},rB=class{constructor(e){this._logger=new XP("AccessTokenEvents"),this._expiringTimer=new ZP("Access token expiring"),this._expiredTimer=new ZP("Access token expired"),this._expiringNotificationTimeInSeconds=e.expiringNotificationTimeInSeconds}load(e){const t=this._logger.create("load");if(e.access_token&&void 0!==e.expires_in){const n=e.expires_in;if(t.debug("access token present, remaining duration:",n),n>0){let e=n-this._expiringNotificationTimeInSeconds;e<=0&&(e=1),t.debug("registering expiring timer, raising in",e,"seconds"),this._expiringTimer.init(e)}else t.debug("canceling existing expiring timer because we're past expiration."),this._expiringTimer.cancel();const r=n+1;t.debug("registering expired timer, raising in",r,"seconds"),this._expiredTimer.init(r)}else this._expiringTimer.cancel(),this._expiredTimer.cancel()}unload(){this._logger.debug("unload: canceling existing access token timers"),this._expiringTimer.cancel(),this._expiredTimer.cancel()}addAccessTokenExpiring(e){return this._expiringTimer.addHandler(e)}removeAccessTokenExpiring(e){this._expiringTimer.removeHandler(e)}addAccessTokenExpired(e){return this._expiredTimer.addHandler(e)}removeAccessTokenExpired(e){this._expiredTimer.removeHandler(e)}},iB=class{constructor(){this._logger=new XP("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(e){return this._logger.create(`getItem('${e}')`),this._data[e]}setItem(e,t){this._logger.create(`setItem('${e}')`),this._data[e]=t}removeItem(e){this._logger.create(`removeItem('${e}')`),delete this._data[e]}get length(){return Object.getOwnPropertyNames(this._data).length}key(e){return Object.getOwnPropertyNames(this._data)[e]}},aB=class{constructor(e=[],t=null,n={}){this._jwtHandler=t,this._extraHeaders=n,this._logger=new XP("JsonService"),this._contentTypes=[],this._contentTypes.push(...e,"application/json"),t&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(e,t={}){const{timeoutInSeconds:n,...r}=t;if(!n)return await fetch(e,r);const i=new AbortController,a=setTimeout((()=>i.abort()),1e3*n);try{return await fetch(e,{...t,signal:i.signal})}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)throw new nB("Network timed out");throw e}finally{clearTimeout(a)}}async getJson(e,{token:t,credentials:n}={}){const r=this._logger.create("getJson"),i={Accept:this._contentTypes.join(", ")};let a;t&&(r.debug("token passed, setting Authorization header"),i.Authorization="Bearer "+t),this.appendExtraHeaders(i);try{r.debug("url:",e),a=await this.fetchWithTimeout(e,{method:"GET",headers:i,credentials:n})}catch(e){throw r.error("Network Error"),e}r.debug("HTTP response received, status",a.status);const o=a.headers.get("Content-Type");if(o&&!this._contentTypes.find((e=>o.startsWith(e)))&&r.throw(new Error(`Invalid response Content-Type: ${null!=o?o:"undefined"}, from URL: ${e}`)),a.ok&&this._jwtHandler&&(null==o?void 0:o.startsWith("application/jwt")))return await this._jwtHandler(await a.text());let s;try{s=await a.json()}catch(e){if(r.error("Error parsing JSON response",e),a.ok)throw e;throw new Error(`${a.statusText} (${a.status})`)}if(!a.ok){if(r.error("Error from server:",s),s.error)throw new tB(s);throw new Error(`${a.statusText} (${a.status}): ${JSON.stringify(s)}`)}return s}async postForm(e,{body:t,basicAuth:n,timeoutInSeconds:r,initCredentials:i}){const a=this._logger.create("postForm"),o={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded"};let s;void 0!==n&&(o.Authorization="Basic "+n),this.appendExtraHeaders(o);try{a.debug("url:",e),s=await this.fetchWithTimeout(e,{method:"POST",headers:o,body:t,timeoutInSeconds:r,credentials:i})}catch(e){throw a.error("Network error"),e}a.debug("HTTP response received, status",s.status);const u=s.headers.get("Content-Type");if(u&&!this._contentTypes.find((e=>u.startsWith(e))))throw new Error(`Invalid response Content-Type: ${null!=u?u:"undefined"}, from URL: ${e}`);const c=await s.text();let f={};if(c)try{f=JSON.parse(c)}catch(e){if(a.error("Error parsing JSON response",e),s.ok)throw e;throw new Error(`${s.statusText} (${s.status})`)}if(!s.ok){if(a.error("Error from server:",f),f.error)throw new tB(f,t);throw new Error(`${s.statusText} (${s.status}): ${JSON.stringify(f)}`)}return f}appendExtraHeaders(e){const t=this._logger.create("appendExtraHeaders"),n=Object.keys(this._extraHeaders),r=["authorization","accept","content-type"];0!==n.length&&n.forEach((n=>{if(r.includes(n.toLocaleLowerCase()))return void t.warn("Protected header could not be overridden",n,r);const i="function"==typeof this._extraHeaders[n]?this._extraHeaders[n]():this._extraHeaders[n];i&&""!==i&&(e[n]=i)}))}},oB=class{constructor({prefix:e="oidc.",store:t=localStorage}={}){this._logger=new XP("WebStorageStateStore"),this._store=t,this._prefix=e}async set(e,t){this._logger.create(`set('${e}')`),e=this._prefix+e,await this._store.setItem(e,t)}async get(e){this._logger.create(`get('${e}')`),e=this._prefix+e;return await this._store.getItem(e)}async remove(e){this._logger.create(`remove('${e}')`),e=this._prefix+e;const t=await this._store.getItem(e);return await this._store.removeItem(e),t}async getAllKeys(){this._logger.create("getAllKeys");const e=await this._store.length,t=[];for(let n=0;n<e;n++){const e=await this._store.key(n);e&&0===e.indexOf(this._prefix)&&t.push(e.substr(this._prefix.length))}return t}},sB=class{constructor({authority:e,metadataUrl:t,metadata:n,signingKeys:r,metadataSeed:i,client_id:a,client_secret:o,response_type:s="code",scope:u="openid",redirect_uri:c,post_logout_redirect_uri:f,client_authentication:d="client_secret_post",prompt:l,display:p,max_age:h,ui_locales:b,acr_values:m,resource:y,response_mode:g="query",filterProtocolClaims:v=!0,loadUserInfo:w=!1,staleStateAgeInSeconds:_=900,clockSkewInSeconds:E=300,userInfoJwtIssuer:T="OP",mergeClaims:A=!1,disablePKCE:R=!1,stateStore:S,refreshTokenCredentials:k,revokeTokenAdditionalContentTypes:O,fetchRequestCredentials:I,refreshTokenAllowedScope:x,extraQueryParams:C={},extraTokenParams:M={},extraHeaders:N={}}){if(this.authority=e,t?this.metadataUrl=t:(this.metadataUrl=e,e&&(this.metadataUrl.endsWith("/")||(this.metadataUrl+="/"),this.metadataUrl+=".well-known/openid-configuration")),this.metadata=n,this.metadataSeed=i,this.signingKeys=r,this.client_id=a,this.client_secret=o,this.response_type=s,this.scope=u,this.redirect_uri=c,this.post_logout_redirect_uri=f,this.client_authentication=d,this.prompt=l,this.display=p,this.max_age=h,this.ui_locales=b,this.acr_values=m,this.resource=y,this.response_mode=g,this.filterProtocolClaims=null==v||v,this.loadUserInfo=!!w,this.staleStateAgeInSeconds=_,this.clockSkewInSeconds=E,this.userInfoJwtIssuer=T,this.mergeClaims=!!A,this.disablePKCE=!!R,this.revokeTokenAdditionalContentTypes=O,I&&k&&console.warn("Both fetchRequestCredentials and refreshTokenCredentials is set. Only fetchRequestCredentials will be used."),this.fetchRequestCredentials=I||(k||"same-origin"),S)this.stateStore=S;else{const e="undefined"!=typeof window?window.localStorage:new iB;this.stateStore=new oB({store:e})}this.refreshTokenAllowedScope=x,this.extraQueryParams=C,this.extraTokenParams=M,this.extraHeaders=N}},uB=class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new XP("TokenClient"),this._jsonService=new aB(this._settings.revokeTokenAdditionalContentTypes,null,this._settings.extraHeaders)}async exchangeCode({grant_type:e="authorization_code",redirect_uri:t=this._settings.redirect_uri,client_id:n=this._settings.client_id,client_secret:r=this._settings.client_secret,...i}){const a=this._logger.create("exchangeCode");n||a.throw(new Error("A client_id is required")),t||a.throw(new Error("A redirect_uri is required")),i.code||a.throw(new Error("A code is required"));const o=new URLSearchParams({grant_type:e,redirect_uri:t});for(const[e,t]of Object.entries(i))null!=t&&o.set(e,t);let s;switch(this._settings.client_authentication){case"client_secret_basic":if(!r)throw a.throw(new Error("A client_secret is required")),null;s=$P.generateBasicAuth(n,r);break;case"client_secret_post":o.append("client_id",n),r&&o.append("client_secret",r)}const u=await this._metadataService.getTokenEndpoint(!1);a.debug("got token endpoint");const c=await this._jsonService.postForm(u,{body:o,basicAuth:s,initCredentials:this._settings.fetchRequestCredentials});return a.debug("got response"),c}async exchangeCredentials({grant_type:e="password",client_id:t=this._settings.client_id,client_secret:n=this._settings.client_secret,scope:r=this._settings.scope,...i}){const a=this._logger.create("exchangeCredentials");t||a.throw(new Error("A client_id is required"));const o=new URLSearchParams({grant_type:e,scope:r});for(const[e,t]of Object.entries(i))null!=t&&o.set(e,t);let s;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw a.throw(new Error("A client_secret is required")),null;s=$P.generateBasicAuth(t,n);break;case"client_secret_post":o.append("client_id",t),n&&o.append("client_secret",n)}const u=await this._metadataService.getTokenEndpoint(!1);a.debug("got token endpoint");const c=await this._jsonService.postForm(u,{body:o,basicAuth:s,initCredentials:this._settings.fetchRequestCredentials});return a.debug("got response"),c}async exchangeRefreshToken({grant_type:e="refresh_token",client_id:t=this._settings.client_id,client_secret:n=this._settings.client_secret,timeoutInSeconds:r,...i}){const a=this._logger.create("exchangeRefreshToken");t||a.throw(new Error("A client_id is required")),i.refresh_token||a.throw(new Error("A refresh_token is required"));const o=new URLSearchParams({grant_type:e});for(const[e,t]of Object.entries(i))null!=t&&o.set(e,t);let s;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw a.throw(new Error("A client_secret is required")),null;s=$P.generateBasicAuth(t,n);break;case"client_secret_post":o.append("client_id",t),n&&o.append("client_secret",n)}const u=await this._metadataService.getTokenEndpoint(!1);a.debug("got token endpoint");const c=await this._jsonService.postForm(u,{body:o,basicAuth:s,timeoutInSeconds:r,initCredentials:this._settings.fetchRequestCredentials});return a.debug("got response"),c}async revoke(e){var t;const n=this._logger.create("revoke");e.token||n.throw(new Error("A token is required"));const r=await this._metadataService.getRevocationEndpoint(!1);n.debug(`got revocation endpoint, revoking ${null!=(t=e.token_type_hint)?t:"default token type"}`);const i=new URLSearchParams;for(const[t,n]of Object.entries(e))null!=n&&i.set(t,n);i.set("client_id",this._settings.client_id),this._settings.client_secret&&i.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(r,{body:i}),n.debug("got response")}},cB=class{constructor(e){this.id=e.id||$P.generateUUIDv4(),this.data=e.data,e.created&&e.created>0?this.created=e.created:this.created=ZP.getEpochTime(),this.request_type=e.request_type}toStorageString(){return new XP("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type})}static fromStorageString(e){return XP.createStatic("State","fromStorageString"),new cB(JSON.parse(e))}static async clearStaleState(e,t){const n=XP.createStatic("State","clearStaleState"),r=ZP.getEpochTime()-t,i=await e.getAllKeys();n.debug("got keys",i);for(let t=0;t<i.length;t++){const a=i[t],o=await e.get(a);let s=!1;if(o)try{const e=cB.fromStorageString(o);n.debug("got item from key:",a,e.created),e.created<=r&&(s=!0)}catch(e){n.error("Error parsing state for key:",a,e),s=!0}else n.debug("no item in storage for key:",a),s=!0;s&&(n.debug("removed item for key:",a),e.remove(a))}}},fB=class extends cB{constructor(e){super(e),!0===e.code_verifier?this.code_verifier=$P.generateCodeVerifier():e.code_verifier&&(this.code_verifier=e.code_verifier),this.code_verifier&&(this.code_challenge=$P.generateCodeChallenge(this.code_verifier)),this.authority=e.authority,this.client_id=e.client_id,this.redirect_uri=e.redirect_uri,this.scope=e.scope,this.client_secret=e.client_secret,this.extraTokenParams=e.extraTokenParams,this.response_mode=e.response_mode,this.skipUserInfo=e.skipUserInfo}toStorageString(){return new XP("SigninState").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,code_verifier:this.code_verifier,authority:this.authority,client_id:this.client_id,redirect_uri:this.redirect_uri,scope:this.scope,client_secret:this.client_secret,extraTokenParams:this.extraTokenParams,response_mode:this.response_mode,skipUserInfo:this.skipUserInfo})}static fromStorageString(e){XP.createStatic("SigninState","fromStorageString");const t=JSON.parse(e);return new fB(t)}},dB=class{constructor(e){this.access_token="",this.token_type="",this.profile={},this.state=e.get("state"),this.session_state=e.get("session_state"),this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri"),this.code=e.get("code")}get expires_in(){if(void 0!==this.expires_at)return this.expires_at-ZP.getEpochTime()}set expires_in(e){"string"==typeof e&&(e=Number(e)),void 0!==e&&e>=0&&(this.expires_at=Math.floor(e)+ZP.getEpochTime())}get isOpenId(){var e;return(null==(e=this.scope)?void 0:e.split(" ").includes("openid"))||!!this.id_token}},lB=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],pB=["sub","iss","aud","exp","iat"],hB=class{constructor(e){var t;this.id_token=e.id_token,this.session_state=null!=(t=e.session_state)?t:null,this.access_token=e.access_token,this.refresh_token=e.refresh_token,this.token_type=e.token_type,this.scope=e.scope,this.profile=e.profile,this.expires_at=e.expires_at,this.state=e.userState}get expires_in(){if(void 0!==this.expires_at)return this.expires_at-ZP.getEpochTime()}set expires_in(e){void 0!==e&&(this.expires_at=Math.floor(e)+ZP.getEpochTime())}get expired(){const e=this.expires_in;if(void 0!==e)return e<=0}get scopes(){var e,t;return null!=(t=null==(e=this.scope)?void 0:e.split(" "))?t:[]}toStorageString(){return new XP("User").create("toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})}static fromStorageString(e){return XP.createStatic("User","fromStorageString"),new hB(JSON.parse(e))}},bB="oidc-client",mB=class{constructor(){this._abort=new JP("Window navigation aborted"),this._disposeHandlers=new Set,this._window=null}async navigate(e){const t=this._logger.create("navigate");if(!this._window)throw new Error("Attempted to navigate on a disposed window");t.debug("setting URL in window"),this._window.location.replace(e.url);const{url:n,keepOpen:r}=await new Promise(((n,r)=>{const i=i=>{var a;const o=i.data,s=null!=(a=e.scriptOrigin)?a:window.location.origin;if(i.origin===s&&(null==o?void 0:o.source)===bB){try{const n=eB.readParams(o.url,e.response_mode).get("state");if(n||t.warn("no state found in response url"),i.source!==this._window&&n!==e.state)return}catch(e){this._dispose(),r(new Error("Invalid response from window"))}n(o)}};window.addEventListener("message",i,!1),this._disposeHandlers.add((()=>window.removeEventListener("message",i,!1))),this._disposeHandlers.add(this._abort.addHandler((e=>{this._dispose(),r(e)})))}));return t.debug("got response from window"),this._dispose(),r||this.close(),{url:n}}_dispose(){this._logger.create("_dispose");for(const e of this._disposeHandlers)e();this._disposeHandlers.clear()}static _notifyParent(e,t,n=!1,r=window.location.origin){e.postMessage({source:bB,url:t,keepOpen:n},r)}},yB={location:!1,toolbar:!1,height:640},gB="_blank",vB=60,wB=2,_B=10,EB=class extends sB{constructor(e){const{popup_redirect_uri:t=e.redirect_uri,popup_post_logout_redirect_uri:n=e.post_logout_redirect_uri,popupWindowFeatures:r=yB,popupWindowTarget:i=gB,redirectMethod:a="assign",redirectTarget:o="self",iframeNotifyParentOrigin:s=e.iframeNotifyParentOrigin,iframeScriptOrigin:u=e.iframeScriptOrigin,silent_redirect_uri:c=e.redirect_uri,silentRequestTimeoutInSeconds:f=_B,automaticSilentRenew:d=!0,validateSubOnSilentRenew:l=!0,includeIdTokenInSilentRenew:p=!1,monitorSession:h=!1,monitorAnonymousSession:b=!1,checkSessionIntervalInSeconds:m=wB,query_status_response_type:y="code",stopCheckSessionOnError:g=!0,revokeTokenTypes:v=["access_token","refresh_token"],revokeTokensOnSignout:w=!1,includeIdTokenInSilentSignout:_=!1,accessTokenExpiringNotificationTimeInSeconds:E=vB,userStore:T}=e;if(super(e),this.popup_redirect_uri=t,this.popup_post_logout_redirect_uri=n,this.popupWindowFeatures=r,this.popupWindowTarget=i,this.redirectMethod=a,this.redirectTarget=o,this.iframeNotifyParentOrigin=s,this.iframeScriptOrigin=u,this.silent_redirect_uri=c,this.silentRequestTimeoutInSeconds=f,this.automaticSilentRenew=d,this.validateSubOnSilentRenew=l,this.includeIdTokenInSilentRenew=p,this.monitorSession=h,this.monitorAnonymousSession=b,this.checkSessionIntervalInSeconds=m,this.stopCheckSessionOnError=g,this.query_status_response_type=y,this.revokeTokenTypes=v,this.revokeTokensOnSignout=w,this.includeIdTokenInSilentSignout=_,this.accessTokenExpiringNotificationTimeInSeconds=E,T)this.userStore=T;else{const e="undefined"!=typeof window?window.sessionStorage:new iB;this.userStore=new oB({store:e})}}},TB=class extends mB{constructor({silentRequestTimeoutInSeconds:e=_B}){super(),this._logger=new XP("IFrameWindow"),this._timeoutInSeconds=e,this._frame=TB.createHiddenIframe(),this._window=this._frame.contentWindow}static createHiddenIframe(){const e=window.document.createElement("iframe");return e.style.visibility="hidden",e.style.position="fixed",e.style.left="-1000px",e.style.top="0",e.width="0",e.height="0",e.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),window.document.body.appendChild(e),e}async navigate(e){this._logger.debug("navigate: Using timeout of:",this._timeoutInSeconds);const t=setTimeout((()=>this._abort.raise(new nB("IFrame timed out without a response"))),1e3*this._timeoutInSeconds);return this._disposeHandlers.add((()=>clearTimeout(t))),await super.navigate(e)}close(){var e;this._frame&&(this._frame.parentNode&&(this._frame.addEventListener("load",(e=>{var t;const n=e.target;null==(t=n.parentNode)||t.removeChild(n),this._abort.raise(new Error("IFrame removed from DOM"))}),!0),null==(e=this._frame.contentWindow)||e.location.replace("about:blank")),this._frame=null),this._window=null}static notifyParent(e,t){return super._notifyParent(window.parent,e,!1,t)}},AB=class extends mB{constructor({popupWindowTarget:e=gB,popupWindowFeatures:t={}}){super(),this._logger=new XP("PopupWindow");const n=QP.center({...yB,...t});this._window=window.open(void 0,e,QP.serialize(n))}async navigate(e){var t;null==(t=this._window)||t.focus();const n=setInterval((()=>{this._window&&!this._window.closed||this._abort.raise(new Error("Popup closed by user"))}),500);return this._disposeHandlers.add((()=>clearInterval(n))),await super.navigate(e)}close(){this._window&&(this._window.closed||(this._window.close(),this._abort.raise(new Error("Popup closed")))),this._window=null}static notifyOpener(e,t){if(!window.opener)throw new Error("No window.opener. Can't complete notification.");return super._notifyParent(window.opener,e,t)}},RB=class extends rB{constructor(e){super({expiringNotificationTimeInSeconds:e.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new XP("UserManagerEvents"),this._userLoaded=new JP("User loaded"),this._userUnloaded=new JP("User unloaded"),this._silentRenewError=new JP("Silent renew error"),this._userSignedIn=new JP("User signed in"),this._userSignedOut=new JP("User signed out"),this._userSessionChanged=new JP("User session changed")}load(e,t=!0){super.load(e),t&&this._userLoaded.raise(e)}unload(){super.unload(),this._userUnloaded.raise()}addUserLoaded(e){return this._userLoaded.addHandler(e)}removeUserLoaded(e){return this._userLoaded.removeHandler(e)}addUserUnloaded(e){return this._userUnloaded.addHandler(e)}removeUserUnloaded(e){return this._userUnloaded.removeHandler(e)}addSilentRenewError(e){return this._silentRenewError.addHandler(e)}removeSilentRenewError(e){return this._silentRenewError.removeHandler(e)}_raiseSilentRenewError(e){this._silentRenewError.raise(e)}addUserSignedIn(e){return this._userSignedIn.addHandler(e)}removeUserSignedIn(e){this._userSignedIn.removeHandler(e)}_raiseUserSignedIn(){this._userSignedIn.raise()}addUserSignedOut(e){return this._userSignedOut.addHandler(e)}removeUserSignedOut(e){this._userSignedOut.removeHandler(e)}_raiseUserSignedOut(){this._userSignedOut.raise()}addUserSessionChanged(e){return this._userSessionChanged.addHandler(e)}removeUserSessionChanged(e){this._userSessionChanged.removeHandler(e)}_raiseUserSessionChanged(){this._userSessionChanged.raise()}},SB=(e=>(e.MissingApiKey="MISSING_API_KEY",e.ModalNotReady="MODAL_NOT_READY",e.MalformedResponse="MALFORMED_RESPONSE",e.InvalidArgument="INVALID_ARGUMENT",e.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",e.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",e))(SB||{}),kB=(e=>(e.SyncWeb3Method="SYNC_WEB3_METHOD",e.DuplicateIframe="DUPLICATE_IFRAME",e.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",e.DeprecationNotice="DEPRECATION_NOTICE",e))(kB||{}),OB=(e=>(e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",e[e.MagicLinkExpired=-10001]="MagicLinkExpired",e[e.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",e[e.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",e[e.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",e[e.UpdateEmailFailed=-10004]="UpdateEmailFailed",e[e.UserRequestEditEmail=-10005]="UserRequestEditEmail",e[e.InactiveRecipient=-10010]="InactiveRecipient",e[e.AccessDeniedToUser=-10011]="AccessDeniedToUser",e))(OB||{}),IB=(e=>(e.LoginWithSms="magic_auth_login_with_sms",e.LoginWithEmailOTP="magic_auth_login_with_email_otp",e.LoginWithMagicLink="magic_auth_login_with_magic_link",e.LoginWithCredential="magic_auth_login_with_credential",e.GetIdToken="magic_auth_get_id_token",e.GenerateIdToken="magic_auth_generate_id_token",e.GetMetadata="magic_auth_get_metadata",e.IsLoggedIn="magic_auth_is_logged_in",e.Logout="magic_auth_logout",e.UpdateEmail="magic_auth_update_email",e.UserSettings="magic_auth_settings",e.UserSettingsTestMode="magic_auth_settings_testing_mode",e.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",e.LoginWithEmailOTPTestMode="magic_auth_login_with_email_otp_testing_mode",e.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",e.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",e.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",e.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",e.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",e.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",e.LogoutTestMode="magic_auth_logout_testing_mode",e.UpdateEmailTestMode="magic_auth_update_email_testing_mode",e.IntermediaryEvent="magic_intermediary_event",e.RequestAccounts="eth_requestAccounts",e.GetInfo="mc_get_wallet_info",e.ShowUI="mc_wallet",e.NFTPurchase="magic_nft_purchase",e.RequestUserInfoWithUI="mc_request_user_info",e.Disconnect="mc_disconnect",e.UpdatePhoneNumber="magic_auth_update_phone_number",e.UpdatePhoneNumberTestMode="magic_auth_update_phone_number_testing_mode",e.RecoverAccount="magic_auth_recover_account",e.RecoverAccountTestMode="magic_auth_recover_account_testing_mode",e))(IB||{}),xB=(e=>(e.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",e.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",e.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",e.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",e.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",e))(xB||{}),CB=(e=>(e.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",e))(CB||{}),MB=(e=>(e.Harmony="HARMONY",e))(MB||{}),NB=Object.create,PB=Object.defineProperty,BB=Object.defineProperties,DB=Object.getOwnPropertyDescriptor,FB=Object.getOwnPropertyDescriptors,LB=Object.getOwnPropertyNames,UB=Object.getOwnPropertySymbols,jB=Object.getPrototypeOf,qB=Object.prototype.hasOwnProperty,zB=Object.prototype.propertyIsEnumerable,HB=(e,t,n)=>t in e?PB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,VB=(e,t)=>{for(var n in t||(t={}))qB.call(t,n)&&HB(e,n,t[n]);if(UB)for(var n of UB(t))zB.call(t,n)&&HB(e,n,t[n]);return e},GB=(e,t,n)=>new Promise(((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())})),KB=((e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports))(((e,t)=>{var n=Object.prototype.hasOwnProperty,r="~";function i(){}function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new a(n,i||e,o),u=r?r+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function u(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),u.prototype.eventNames=function(){var e,t,i=[];if(0===this._eventsCount)return i;for(t in e=this._events)n.call(e,t)&&i.push(r?t.slice(1):t);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},u.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=new Array(a);i<a;i++)o[i]=n[i].fn;return o},u.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},u.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var u,c,f=this._events[s],d=arguments.length;if(f.fn){switch(f.once&&this.removeListener(e,f.fn,void 0,!0),d){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,t),!0;case 3:return f.fn.call(f.context,t,n),!0;case 4:return f.fn.call(f.context,t,n,i),!0;case 5:return f.fn.call(f.context,t,n,i,a),!0;case 6:return f.fn.call(f.context,t,n,i,a,o),!0}for(c=1,u=new Array(d-1);c<d;c++)u[c-1]=arguments[c];f.fn.apply(f.context,u)}else{var l,p=f.length;for(c=0;c<p;c++)switch(f[c].once&&this.removeListener(e,f[c].fn,void 0,!0),d){case 1:f[c].fn.call(f[c].context);break;case 2:f[c].fn.call(f[c].context,t);break;case 3:f[c].fn.call(f[c].context,t,n);break;case 4:f[c].fn.call(f[c].context,t,n,i);break;default:if(!u)for(l=1,u=new Array(d-1);l<d;l++)u[l-1]=arguments[l];f[c].fn.apply(f[c].context,u)}}return!0},u.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},u.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},u.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var u=0,c=[],f=o.length;u<f;u++)(o[u].fn!==t||i&&!o[u].once||n&&o[u].context!==n)&&c.push(o[u]);c.length?this._events[a]=1===c.length?c[0]:c:s(this,a)}return this},u.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=r,u.EventEmitter=u,typeof t<"u"&&(t.exports=u)}));var WB={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH:16},XB="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{},$B=XB,JB=function(e){let t={exports:{}};return e(t,t.exports),t.exports}((function(e,t){let{MAX_SAFE_COMPONENT_LENGTH:n}=WB,r=(t=e.exports={}).re=[],i=t.src=[],a=t.t={},o=0,s=(e,t,n)=>{let s=o++;$B(s,t),a[e]=s,i[s]=t,r[s]=new RegExp(t,n?"g":void 0)};s("NUMERICIDENTIFIER","0|[1-9]\\d*"),s("NUMERICIDENTIFIERLOOSE","[0-9]+"),s("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),s("MAINVERSION",`(${i[a.NUMERICIDENTIFIER]})\\.(${i[a.NUMERICIDENTIFIER]})\\.(${i[a.NUMERICIDENTIFIER]})`),s("MAINVERSIONLOOSE",`(${i[a.NUMERICIDENTIFIERLOOSE]})\\.(${i[a.NUMERICIDENTIFIERLOOSE]})\\.(${i[a.NUMERICIDENTIFIERLOOSE]})`),s("PRERELEASEIDENTIFIER",`(?:${i[a.NUMERICIDENTIFIER]}|${i[a.NONNUMERICIDENTIFIER]})`),s("PRERELEASEIDENTIFIERLOOSE",`(?:${i[a.NUMERICIDENTIFIERLOOSE]}|${i[a.NONNUMERICIDENTIFIER]})`),s("PRERELEASE",`(?:-(${i[a.PRERELEASEIDENTIFIER]}(?:\\.${i[a.PRERELEASEIDENTIFIER]})*))`),s("PRERELEASELOOSE",`(?:-?(${i[a.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${i[a.PRERELEASEIDENTIFIERLOOSE]})*))`),s("BUILDIDENTIFIER","[0-9A-Za-z-]+"),s("BUILD",`(?:\\+(${i[a.BUILDIDENTIFIER]}(?:\\.${i[a.BUILDIDENTIFIER]})*))`),s("FULLPLAIN",`v?${i[a.MAINVERSION]}${i[a.PRERELEASE]}?${i[a.BUILD]}?`),s("FULL",`^${i[a.FULLPLAIN]}$`),s("LOOSEPLAIN",`[v=\\s]*${i[a.MAINVERSIONLOOSE]}${i[a.PRERELEASELOOSE]}?${i[a.BUILD]}?`),s("LOOSE",`^${i[a.LOOSEPLAIN]}$`),s("GTLT","((?:<|>)?=?)"),s("XRANGEIDENTIFIERLOOSE",`${i[a.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),s("XRANGEIDENTIFIER",`${i[a.NUMERICIDENTIFIER]}|x|X|\\*`),s("XRANGEPLAIN",`[v=\\s]*(${i[a.XRANGEIDENTIFIER]})(?:\\.(${i[a.XRANGEIDENTIFIER]})(?:\\.(${i[a.XRANGEIDENTIFIER]})(?:${i[a.PRERELEASE]})?${i[a.BUILD]}?)?)?`),s("XRANGEPLAINLOOSE",`[v=\\s]*(${i[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[a.XRANGEIDENTIFIERLOOSE]})(?:${i[a.PRERELEASELOOSE]})?${i[a.BUILD]}?)?)?`),s("XRANGE",`^${i[a.GTLT]}\\s*${i[a.XRANGEPLAIN]}$`),s("XRANGELOOSE",`^${i[a.GTLT]}\\s*${i[a.XRANGEPLAINLOOSE]}$`),s("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),s("COERCERTL",i[a.COERCE],!0),s("LONETILDE","(?:~>?)"),s("TILDETRIM",`(\\s*)${i[a.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",s("TILDE",`^${i[a.LONETILDE]}${i[a.XRANGEPLAIN]}$`),s("TILDELOOSE",`^${i[a.LONETILDE]}${i[a.XRANGEPLAINLOOSE]}$`),s("LONECARET","(?:\\^)"),s("CARETTRIM",`(\\s*)${i[a.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",s("CARET",`^${i[a.LONECARET]}${i[a.XRANGEPLAIN]}$`),s("CARETLOOSE",`^${i[a.LONECARET]}${i[a.XRANGEPLAINLOOSE]}$`),s("COMPARATORLOOSE",`^${i[a.GTLT]}\\s*(${i[a.LOOSEPLAIN]})$|^$`),s("COMPARATOR",`^${i[a.GTLT]}\\s*(${i[a.FULLPLAIN]})$|^$`),s("COMPARATORTRIM",`(\\s*)${i[a.GTLT]}\\s*(${i[a.LOOSEPLAIN]}|${i[a.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",s("HYPHENRANGE",`^\\s*(${i[a.XRANGEPLAIN]})\\s+-\\s+(${i[a.XRANGEPLAIN]})\\s*$`),s("HYPHENRANGELOOSE",`^\\s*(${i[a.XRANGEPLAINLOOSE]})\\s+-\\s+(${i[a.XRANGEPLAINLOOSE]})\\s*$`),s("STAR","(<|>)?=?\\s*\\*"),s("GTE0","^\\s*>=\\s*0.0.0\\s*$"),s("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")})),YB=/^[0-9]+$/,QB=(e,t)=>{let n=YB.test(e),r=YB.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1},ZB={compareIdentifiers:QB,rcompareIdentifiers:(e,t)=>QB(t,e)},{MAX_LENGTH:eD,MAX_SAFE_INTEGER:tD}=WB,{re:nD,t:rD}=JB,{compareIdentifiers:iD}=ZB,aD=class{constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof aD){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid Version: ${e}`);if(e.length>eD)throw new TypeError(`version is longer than ${eD} characters`);$B("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let n=e.trim().match(t.loose?nD[rD.LOOSE]:nD[rD.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>tD||this.major<0)throw new TypeError("Invalid major version");if(this.minor>tD||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>tD||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<tD)return t}return e})):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if($B("SemVer.compare",this.version,this.options,e),!(e instanceof aD)){if("string"==typeof e&&e===this.version)return 0;e=new aD(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof aD||(e=new aD(e,this.options)),iD(this.major,e.major)||iD(this.minor,e.minor)||iD(this.patch,e.patch)}comparePre(e){if(e instanceof aD||(e=new aD(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let n=this.prerelease[t],r=e.prerelease[t];if($B("prerelease compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return iD(n,r)}while(++t)}compareBuild(e){e instanceof aD||(e=new aD(e,this.options));let t=0;do{let n=this.build[t],r=e.build[t];if($B("prerelease compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return iD(n,r)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{let e=this.prerelease.length;for(;--e>=0;)"number"==typeof this.prerelease[e]&&(this.prerelease[e]++,e=-2);-1===e&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}},oD=(e,t,n)=>new aD(e,n).compare(new aD(t,n)),sD=(e,t,n)=>0===oD(e,t,n),uD=(e,t,n)=>0!==oD(e,t,n),cD=(e,t,n)=>oD(e,t,n)>0,fD=(e,t,n)=>oD(e,t,n)>=0,dD=(e,t,n)=>oD(e,t,n)<0,lD=(e,t,n)=>oD(e,t,n)<=0,pD=(e,t,n,r)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return sD(e,n,r);case"!=":return uD(e,n,r);case">":return cD(e,n,r);case">=":return fD(e,n,r);case"<":return dD(e,n,r);case"<=":return lD(e,n,r);default:throw new TypeError(`Invalid operator: ${t}`)}},hD=Symbol("SemVer ANY"),bD=class{static get ANY(){return hD}constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof bD){if(e.loose===!!t.loose)return e;e=e.value}$B("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===hD?this.value="":this.value=this.operator+this.semver.version,$B("comp",this)}parse(e){let t=this.options.loose?mD[yD.COMPARATORLOOSE]:mD[yD.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new aD(n[2],this.options.loose):this.semver=hD}toString(){return this.value}test(e){if($B("Comparator.test",e,this.options.loose),this.semver===hD||e===hD)return!0;if("string"==typeof e)try{e=new aD(e,this.options)}catch(e){return!1}return pD(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof bD))throw new TypeError("a Comparator is required");if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||new gD(e.value,t).test(this.value);if(""===e.operator)return""===e.value||new gD(this.value,t).test(e.semver);let n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),r=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),o=pD(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),s=pD(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||r||i&&a||o||s}},{re:mD,t:yD}=JB,gD=class{constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof gD)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new gD(e.raw,t);if(e instanceof bD)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){let{loose:t}=this.options;e=e.trim();let n=t?vD[wD.HYPHENRANGELOOSE]:vD[wD.HYPHENRANGE];e=e.replace(n,BD(this.options.includePrerelease)),$B("hyphen replace",e),e=e.replace(vD[wD.COMPARATORTRIM],_D),$B("comparator trim",e,vD[wD.COMPARATORTRIM]),e=(e=(e=e.replace(vD[wD.TILDETRIM],ED)).replace(vD[wD.CARETTRIM],TD)).split(/\s+/).join(" ");let r=t?vD[wD.COMPARATORLOOSE]:vD[wD.COMPARATOR];return e.split(" ").map((e=>RD(e,this.options))).join(" ").split(/\s+/).map((e=>PD(e,this.options))).filter(this.options.loose?e=>!!e.match(r):()=>!0).map((e=>new bD(e,this.options)))}intersects(e,t){if(!(e instanceof gD))throw new TypeError("a Range is required");return this.set.some((n=>AD(n,t)&&e.set.some((e=>AD(e,t)&&n.every((n=>e.every((e=>n.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new aD(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(DD(this.set[t],e,this.options))return!0;return!1}},{re:vD,t:wD,comparatorTrimReplace:_D,tildeTrimReplace:ED,caretTrimReplace:TD}=JB,AD=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every((e=>i.intersects(e,t))),i=r.pop();return n},RD=(e,t)=>($B("comp",e,t),e=ID(e,t),$B("caret",e),e=kD(e,t),$B("tildes",e),e=CD(e,t),$B("xrange",e),e=ND(e,t),$B("stars",e),e),SD=e=>!e||"x"===e.toLowerCase()||"*"===e,kD=(e,t)=>e.trim().split(/\s+/).map((e=>OD(e,t))).join(" "),OD=(e,t)=>{let n=t.loose?vD[wD.TILDELOOSE]:vD[wD.TILDE];return e.replace(n,((t,n,r,i,a)=>{let o;return $B("tilde",e,t,n,r,i,a),SD(n)?o="":SD(r)?o=`>=${n}.0.0 <${+n+1}.0.0-0`:SD(i)?o=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?($B("replaceTilde pr",a),o=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):o=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,$B("tilde return",o),o}))},ID=(e,t)=>e.trim().split(/\s+/).map((e=>xD(e,t))).join(" "),xD=(e,t)=>{$B("caret",e,t);let n=t.loose?vD[wD.CARETLOOSE]:vD[wD.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,((t,n,i,a,o)=>{let s;return $B("caret",e,t,n,i,a,o),SD(n)?s="":SD(i)?s=`>=${n}.0.0${r} <${+n+1}.0.0-0`:SD(a)?s="0"===n?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:o?($B("replaceCaret pr",o),s="0"===n?"0"===i?`>=${n}.${i}.${a}-${o} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${o} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${o} <${+n+1}.0.0-0`):($B("no pr"),s="0"===n?"0"===i?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),$B("caret return",s),s}))},CD=(e,t)=>($B("replaceXRanges",e,t),e.split(/\s+/).map((e=>MD(e,t))).join(" ")),MD=(e,t)=>{e=e.trim();let n=t.loose?vD[wD.XRANGELOOSE]:vD[wD.XRANGE];return e.replace(n,((n,r,i,a,o,s)=>{$B("xRange",e,n,r,i,a,o,s);let u=SD(i),c=u||SD(a),f=c||SD(o),d=f;return"="===r&&d&&(r=""),s=t.includePrerelease?"-0":"",u?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(c&&(a=0),o=0,">"===r?(r=">=",c?(i=+i+1,a=0,o=0):(a=+a+1,o=0)):"<="===r&&(r="<",c?i=+i+1:a=+a+1),"<"===r&&(s="-0"),n=`${r+i}.${a}.${o}${s}`):c?n=`>=${i}.0.0${s} <${+i+1}.0.0-0`:f&&(n=`>=${i}.${a}.0${s} <${i}.${+a+1}.0-0`),$B("xRange return",n),n}))},ND=(e,t)=>($B("replaceStars",e,t),e.trim().replace(vD[wD.STAR],"")),PD=(e,t)=>($B("replaceGTE0",e,t),e.trim().replace(vD[t.includePrerelease?wD.GTE0PRE:wD.GTE0],"")),BD=e=>(t,n,r,i,a,o,s,u,c,f,d,l,p)=>`${n=SD(r)?"":SD(i)?`>=${r}.0.0${e?"-0":""}`:SD(a)?`>=${r}.${i}.0${e?"-0":""}`:o?`>=${n}`:`>=${n}${e?"-0":""}`} ${u=SD(c)?"":SD(f)?`<${+c+1}.0.0-0`:SD(d)?`<${c}.${+f+1}.0-0`:l?`<=${c}.${f}.${d}-${l}`:e?`<${c}.${f}.${+d+1}-0`:`<=${u}`}`.trim(),DD=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if($B(e[n].semver),e[n].semver!==bD.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0},FD=(e,t,n)=>{try{t=new gD(t,n)}catch(e){return!1}return t.test(e)},{MAX_LENGTH:LD}=WB,{re:UD,t:jD}=JB,qD=(e,t)=>{if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof aD)return e;if("string"!=typeof e||e.length>LD||!(t.loose?UD[jD.LOOSE]:UD[jD.FULL]).test(e))return null;try{return new aD(e,t)}catch(e){return null}},{re:zD,t:HD}=JB,VD=(e,t)=>{if(e instanceof aD)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){let t;for(;(t=zD[HD.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&t.index+t[0].length===n.index+n[0].length||(n=t),zD[HD.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;zD[HD.COERCERTL].lastIndex=-1}else n=e.match(zD[HD.COERCE]);return null===n?null:qD(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)};function GD(e){return String.fromCharCode(parseInt(e.slice(1),16))}function KD(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}function WD(e){return function(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,GD))}(JSON.stringify(e))}function XD(e){return JSON.parse(function(e){return decodeURIComponent(Array.from(atob(e),KD).join(""))}(e))}function $D(e){return void 0===e}function JD(e){return function(e){return null===e}(e)||$D(e)}function YD(e){if(!e)return!0;for(let t in e)if(Object.hasOwnProperty.call(e,t))return!1;return!0}var QD={};var ZD={"magic-sdk":"magic-sdk","@magic-sdk/react-native":"magic-sdk-rn","@magic-sdk/react-native-bare":"magic-sdk-rn-bare","@magic-sdk/react-native-expo":"magic-sdk-rn-expo"},eF=class extends Error{constructor(e,t){super(`Magic SDK Error: [${e}] ${t}`),this.code=e,this.rawMessage=t,this.__proto__=Error,Object.setPrototypeOf(this,eF.prototype)}},tF=class extends Error{constructor(e){super(),this.__proto__=Error;let t=Number(null==e?void 0:e.code);this.rawMessage=(null==e?void 0:e.message)||"Internal error",this.code=function(e){return!JD(e)&&"number"==typeof e&&Object.values(OB).includes(e)}(t)?t:OB.InternalError,this.message=`Magic RPC Error: [${this.code}] ${this.rawMessage}`,this.data=(null==e?void 0:e.data)||void 0,Object.setPrototypeOf(this,tF.prototype)}},nF=class{constructor(e,t){this.code=e,this.rawMessage=t,this.message=`Magic SDK Warning: [${e}] ${t}`}log(){console.warn(this.message)}},rF=class extends Error{constructor(e,t,n,r){super(`Magic Extension Error (${e.name}): [${t}] ${n}`),this.code=t,this.rawMessage=n,this.data=r,this.__proto__=Error,Object.setPrototypeOf(this,rF.prototype)}},iF=class{constructor(e,t,n){this.code=t,this.rawMessage=n,this.message=`Magic Extension Warning (${e.name}): [${t}] ${n}`}log(){console.warn(this.message)}};function aF(){return new eF(SB.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.")}function oF(){return new eF(SB.MalformedResponse,"Response from the Magic iframe is malformed.")}function sF(e){return new eF(SB.ExtensionNotInitialized,`Extensions must be initialized with a Magic SDK instance before \`Extension.${e}\` can be accessed. Do not invoke \`Extension.${e}\` inside an extension constructor.`)}function uF(e){let t=`Some extensions are incompatible with \`${QD.sdkName}@${QD.version}\`:`;return e.filter((e=>void 0!==e.compat&&null!==e.compat)).forEach((e=>{let n=e.compat[QD.sdkName];"string"==typeof n?t+=`\n - Extension \`${e.name}\` supports version(s) \`${n}\``:n||(t+=`\n - Extension \`${e.name}\` does not support ${QD.platform} environments.`)})),new eF(SB.IncompatibleExtensions,t)}function cF(e){return new eF(SB.InvalidArgument,`Invalid ${(e=>{let t=e+1,n=t%10,r=t%100;return 1===n&&11!==r?`${t}st`:2===n&&12!==r?`${t}nd`:3===n&&13!==r?`${t}rd`:`${t}th`})(e.argument)} argument given to \`${e.procedure}\`.\n Expected: \`${e.expected}\`\n Received: \`${e.received}\``)}function fF(){return new nF(kB.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 \`${QD.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`)}var dF=function*(){let e=0;for(;;)e<Number.MAX_SAFE_INTEGER?yield++e:e=0}();function lF(){return dF.next().value}var pF=Symbol("Payload pre-processed by Magic SDK");function hF(e){return Object.defineProperty(e,pF,{value:!0,enumerable:!1}),e}function bF(e){var t,n,r;return function(e){return!!e[pF]}(e)||(e.jsonrpc=null!=(t=e.jsonrpc)?t:"2.0",e.id=lF(),e.method=null!=(n=e.method)?n:"noop",e.params=null!=(r=e.params)?r:[],hF(e)),e}function mF(e,t=[]){return hF({params:t,method:e,jsonrpc:"2.0",id:lF()})}var yF=class{constructor(e){e instanceof yF?(this._jsonrpc=e.payload.jsonrpc,this._id=e.payload.id,this._result=e.payload.result,this._error=e.payload.error):function(e){return!JD(e)&&!($D(e.jsonrpc)||$D(e.id)||$D(e.result)&&$D(e.error))}(e)?(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=e.result,this._error=e.error):(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=void 0,this._error=void 0)}applyError(e){return this._error=e,this}applyResult(e){return this._result=e,this}get hasError(){return void 0!==this._error&&null!==this._error}get hasResult(){return void 0!==this._result}get payload(){return{jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}},gF=((e,t,n)=>(n=null!=e?NB(jB(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of LB(t))!qB.call(e,i)&&i!==n&&PB(e,i,{get:()=>t[i],enumerable:!(r=DB(t,i))||r.enumerable});return e})(!t&&e&&e.__esModule?n:PB(n,"default",{value:e,enumerable:!0}),e)))(KB()),vF=class extends gF.default{};function wF(){let e=new vF;return{emitter:e,createChainingEmitterMethod:(t,n)=>(...r)=>(e[t].apply(e,r),n),createBoundEmitterMethod:t=>(...n)=>e[t].apply(e,n)}}var _F=Symbol("isPromiEvent");function EF(e){return!!e[_F]}function TF(e){let t=AF(e),{createBoundEmitterMethod:n,createChainingEmitterMethod:r}=wF(),i=Symbol("Promise.then"),a=Symbol("Promise.catch"),o=Symbol("Promise.finally"),s=(e,t)=>(...n)=>{let r=t[e].apply(t,n);return u(r)},u=e=>Object.assign(e,{[_F]:!0,[i]:e[i]||e.then,[a]:e[a]||e.catch,[o]:e[o]||e.finally,then:s(i,e),catch:s(a,e),finally:s(o,e),on:r("on",e),once:r("once",e),addListener:r("addListener",e),off:r("off",e),removeListener:r("removeListener",e),removeAllListeners:r("removeAllListeners",e),emit:n("emit"),eventNames:n("eventNames"),listeners:n("listeners"),listenerCount:n("listenerCount")}),c=u(t.then((e=>(c.emit("done",e),c.emit("settled"),e)),(e=>{throw c.emit("error",e),c.emit("settled"),e})));return c}function AF(e){return new Promise(((t,n)=>{let r=e(t,n);Promise.resolve(r).catch(n)}))}var RF,SF=class{constructor(e){this.sdk=e}get overlay(){return this.sdk.overlay}request(e){let t=this.overlay.post(CB.MAGIC_HANDLE_REQUEST,bF(e)),n=TF(((e,n)=>{t.then((t=>{if(r(),t.hasError)n(new tF(t.payload.error));else{if(!t.hasResult)throw oF();e(t.payload.result)}})).catch((e=>{r(),n(e)}))})),r=this.overlay.on(xB.MAGIC_HANDLE_EVENT,(t=>{var r;let{response:i}=t.data;if(i.id===e.id&&(null==(r=i.result)?void 0:r.event)){let{event:e,params:t=[]}=i.result;n.emit(e,...t)}}));return n}createIntermediaryEvent(e,t){return n=>{let r=mF(IB.IntermediaryEvent,[{payloadId:t,eventType:e,args:n}]);this.request(r)}}},kF=class extends SF{loginWithMagicLink(e){let{email:t,showUI:n=!0,redirectURI:r}=e,i=mF(this.sdk.testMode?IB.LoginWithMagicLinkTestMode:IB.LoginWithMagicLink,[{email:t,showUI:n,redirectURI:r}]);return this.request(i)}loginWithSMS(e){let{phoneNumber:t}=e,n=mF(this.sdk.testMode?IB.LoginWithSmsTestMode:IB.LoginWithSms,[{phoneNumber:t,showUI:!0}]);return this.request(n)}loginWithEmailOTP(e){let{email:t,showUI:n}=e,r=mF(this.sdk.testMode?IB.LoginWithEmailOTPTestMode:IB.LoginWithEmailOTP,[{email:t,showUI:n}]);if(!n){let e=this.request(r);return e&&e.on("otp-input-sent",(e=>{this.createIntermediaryEvent("verify-email-otp",r.id)(e)})),e}return this.request(r)}loginWithCredential(e){let t=null!=e?e:"";if(!e&&"web"===QD.platform){t=window.location.search;let e=window.location.origin+window.location.pathname;window.history.replaceState(null,"",e)}let n=mF(this.sdk.testMode?IB.LoginWithCredentialTestMode:IB.LoginWithCredential,[t]);return this.request(n)}},OF={};function IF(e){return(...t)=>GB(this,null,(function*(){return RF||(RF=yield QD.configureStorage()),yield RF.ready(),RF[e](...t)}))}((e,t)=>{for(var n in t)PB(e,n,{get:t[n],enumerable:!0})})(OF,{clear:()=>NF,getItem:()=>xF,iterate:()=>FF,key:()=>BF,keys:()=>DF,length:()=>PF,removeItem:()=>MF,setItem:()=>CF});var xF=IF("getItem"),CF=IF("setItem"),MF=IF("removeItem"),NF=IF("clear"),PF=IF("length"),BF=IF("key"),DF=IF("keys"),FF=IF("iterate");function LF(){let e=window.crypto.getRandomValues(new Uint8Array(16));e[6]=15&e[6]|64,e[8]=191&e[8]|128;let t="";return t+=e[0].toString(16),t+=e[1].toString(16),t+=e[2].toString(16),t+=e[3].toString(16),t+="-",t+=e[4].toString(16),t+=e[5].toString(16),t+="-",t+=e[6].toString(16),t+=e[7].toString(16),t+="-",t+=e[8].toString(16),t+=e[9].toString(16),t+="-",t+=e[10].toString(16),t+=e[11].toString(16),t+=e[12].toString(16),t+=e[13].toString(16),t+=e[14].toString(16),t+=e[15].toString(16),t}var UF="STORE_KEY_PRIVATE_KEY",jF="STORE_KEY_PUBLIC_JWK",qF="ECDSA",zF="P-256",HF={name:qF,namedCurve:zF},VF={name:qF,namedCurve:zF};function GF(){MF(jF),MF(UF)}function KF(){return GB(this,null,(function*(){let e=yield function(){return GB(this,null,(function*(){if(function(){let e="undefined"!=typeof window&&!!window.crypto,t=e&&!!window.crypto.subtle;return e&&t}())return(yield xF(jF))||(yield function(){return GB(this,null,(function*(){let e=null,{subtle:t}=window.crypto,n=yield t.generateKey(HF,!0,["sign"]),r=yield t.exportKey("jwk",n.privateKey);e=yield t.exportKey("jwk",n.publicKey);let i=yield t.importKey("jwk",r,VF,!1,["sign"]);yield CF(UF,i),yield CF(jF,e)}))}()),xF(jF);console.info("webcrypto is not supported")}))}();if(!e)return void console.info("unable to create public key or webcrypto is unsupported");let{subtle:t}=window.crypto,n=yield xF(UF);if(!n||!t)return void console.info("unable to find private key or webcrypto unsupported");let r={iat:Math.floor((new Date).getTime()/1e3),jti:LF()},i={typ:"dpop+jwt",alg:"ES256",jwk:e},a=WF(JSON.stringify(i)),o=WF(JSON.stringify(r)),s=function(e){return(new TextEncoder).encode(e)}(`${a}.${o}`),u={name:qF,hash:{name:"SHA-256"}},c=function(e){let t="";return e.forEach((e=>{t+=String.fromCharCode(e)})),XF(t)}(new Uint8Array(yield t.sign(u,n,s)));return`${a}.${o}.${c}`}))}function WF(e){return XF(function(e){return encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(parseInt(t,16))))}(e))}function XF(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}var $F=class extends SF{getIdToken(e){let t=mF(this.sdk.testMode?IB.GetIdTokenTestMode:IB.GetIdToken,[e]);return this.request(t)}generateIdToken(e){let t=mF(this.sdk.testMode?IB.GenerateIdTokenTestMode:IB.GenerateIdToken,[e]);return this.request(t)}getMetadata(){let e=mF(this.sdk.testMode?IB.GetMetadataTestMode:IB.GetMetadata);return this.request(e)}updateEmail(e){let{email:t,showUI:n=!0}=e,r=mF(this.sdk.testMode?IB.UpdateEmailTestMode:IB.UpdateEmail,[{email:t,showUI:n}]);return this.request(r)}isLoggedIn(){let e=mF(this.sdk.testMode?IB.IsLoggedInTestMode:IB.IsLoggedIn);return this.request(e)}logout(){GF();let e=mF(this.sdk.testMode?IB.LogoutTestMode:IB.Logout);return this.request(e)}showSettings(){let e=mF(this.sdk.testMode?IB.UserSettingsTestMode:IB.UserSettings);return this.request(e)}updatePhoneNumber(){let e=mF(this.sdk.testMode?IB.UpdatePhoneNumberTestMode:IB.UpdatePhoneNumber);return this.request(e)}recoverAccount(e){let t=mF(this.sdk.testMode?IB.RecoverAccountTestMode:IB.RecoverAccount,[e]);return this.request(t)}},JF=class extends SF{connectWithUI(){let e=mF(IB.RequestAccounts);return this.request(e)}showUI(){let e=mF(IB.ShowUI);return this.request(e)}getInfo(){let e=mF(IB.GetInfo);return this.request(e)}requestUserInfoWithUI(e){let t=mF(IB.RequestUserInfoWithUI,e?[e]:[]);return this.request(t)}disconnect(){GF();let e=mF(IB.Disconnect);return this.request(e)}},{createBoundEmitterMethod:YF,createChainingEmitterMethod:QF}=wF(),ZF=class extends SF{constructor(){super(...arguments),this.isMagic=!0,this.on=QF("on",this),this.once=QF("once",this),this.addListener=QF("addListener",this),this.off=QF("off",this),this.removeListener=QF("removeListener",this),this.removeAllListeners=QF("removeAllListeners",this),this.emit=YF("emit"),this.eventNames=YF("eventNames"),this.listeners=YF("listeners"),this.listenerCount=YF("listenerCount")}sendAsync(e,t){if(!t)throw cF({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:null===t?"null":typeof t});if(Array.isArray(e))this.overlay.post(CB.MAGIC_HANDLE_REQUEST,e.map((e=>{let t=bF(e);return this.prefixPayloadMethodForTestMode(t),t}))).then((e=>{t(null,e.map((e=>((e,t)=>BB(e,FB(t)))(VB({},e.payload),{error:e.hasError?new tF(e.payload.error):null}))))}));else{let n=bF(e);this.prefixPayloadMethodForTestMode(n),this.overlay.post(CB.MAGIC_HANDLE_REQUEST,n).then((e=>{t(e.hasError?new tF(e.payload.error):null,e.payload)}))}}send(e,t){if("string"==typeof e){let n=mF(e,Array.isArray(t)?t:[]);return this.request(n)}if(Array.isArray(e)||t)return void this.sendAsync(e,t);let n=new nF(kB.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.");return n.log(),new yF(e).applyError({code:-32603,message:n.rawMessage}).payload}enable(){let e=mF("eth_accounts");return this.request(e)}request(e){return this.prefixPayloadMethodForTestMode(e),super.request(e)}prefixPayloadMethodForTestMode(e){this.sdk.testMode&&(e.method=`testMode/eth/${e.method}`)}};function eL(e,t){return t?new URL(e,t):new URL(e)}var tL=["request","overlay","sdk"];function nL(e){let t=Object.getPrototypeOf(e),n=[t];for(;t!==SF.prototype;)t=Object.getPrototypeOf(t),n.push(t);return n}var rL=class extends SF{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:TF,isPromiEvent:EF,encodeJSON:WD,decodeJSON:XD,createJsonRpcRequestPayload:mF,standardizeJsonRpcRequestPayload:bF,storage:OF};let e=[this,...nL(this)];tL.forEach((t=>{let n=e.map((e=>Object.getOwnPropertyDescriptor(e,t))),r=n.findIndex((e=>!!e)),i=r>0,a=n[r];a&&(this.__sdk_access_field_descriptors__.set(t,{descriptor:a,isPrototypeField:i}),Object.defineProperty(this,t,{configurable:!0,get:()=>{throw sF(t)}}))}))}init(e){this.__is_initialized__||(tL.forEach((e=>{if(this.__sdk_access_field_descriptors__.has(e)){let{descriptor:t,isPrototypeField:n}=this.__sdk_access_field_descriptors__.get(e);n?delete this[e]:Object.defineProperty(this,e,t)}})),this.sdk=e,this.__is_initialized__=!0)}createDeprecationWarning(e){let{method:t,removalVersion:n,useInstead:r}=e;return new iF(this,"DEPRECATION_NOTICE",`\`${t}\` will be removed from this Extension in version \`${n}\`.${r?` Use \`${r}\` instead.`:""}`)}createWarning(e,t){return new iF(this,e,t)}createError(e,t,n){return new rF(this,e,t,n)}},iL=class extends rL{};iL.Internal=class extends rL{},iL.Anonymous="anonymous extension";var aL=class extends SF{purchase(e){let t=mF(IB.NFTPurchase,[e]);return this.request(t)}};function oL(e){return!e.compat||null==e.compat[QD.sdkName]||("string"==typeof e.compat[QD.sdkName]?FD(VD(QD.version),e.compat[QD.sdkName]):!!e.compat[QD.sdkName])}function sL(e){var t;let n=null!=(t=null==e?void 0:e.extensions)?t:[],r={},i=[];if(Array.isArray(n)?n.forEach((e=>{oL(e)?(e.init(this),(e.name||e.name!==iL.Anonymous)&&(this[e.name]=e),e instanceof iL.Internal&&(YD(e.config)||(r[e.name]=e.config))):i.push(e)})):Object.keys(n).forEach((e=>{if(oL(n[e])){n[e].init(this);let t=n[e];this[e]=t,t instanceof iL.Internal&&(YD(t.config)||(r[n[e].name]=t.config))}else i.push(n[e])})),i.length)throw uF(i);return r}var uL=class{constructor(e,t){var n;if(this.apiKey=e,!e)throw aF();"react-native"===QD.platform&&(null==t?void 0:t.endpoint)&&fF().log();let{defaultEndpoint:r,version:i}=QD;this.testMode=!(null==t||!t.testMode),this.endpoint=eL(null!=(n=null==t?void 0:t.endpoint)?n:r).origin,this.auth=new kF(this),this.user=new $F(this),this.wallet=new JF(this),this.nft=new aL(this),this.rpcProvider=new ZF(this);let a=sL.call(this,t);this.parameters=WD(VB({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:null==t?void 0:t.network,host:eL(this.endpoint).host,sdk:ZD[QD.sdkName],version:i,ext:YD(a)?void 0:a,locale:(null==t?void 0:t.locale)||"en_US"},QD.bundleId?{bundleId:QD.bundleId}:{}))}get overlay(){if(!uL.__overlays__.has(this.parameters)){let e=new QD.ViewController(this.endpoint,this.parameters);e.init(),uL.__overlays__.set(this.parameters,e)}return uL.__overlays__.get(this.parameters)}preload(){return GB(this,null,(function*(){yield this.overlay.ready}))}},cL=uL;function fL(e,t){var n;let r=null==(n=t.data.response)?void 0:n.id,i=function(e,t){return t&&Array.isArray(e)?e.find((e=>e.id===t)):e}(e,r);if(r&&i){return{id:r,response:new yF(i).applyResult(t.data.response.result).applyError(t.data.response.error)}}return{}}cL.__overlays__=new Map;var dL=class{constructor(e,t){this.endpoint=e,this.parameters=t,this.messageHandlers=new Set,this.ready=this.waitForReady(),this.listen()}post(e,t){return GB(this,null,(function*(){return AF((n=>GB(this,null,(function*(){yield this.ready;let r=[],i=Array.isArray(t)?t.map((e=>e.id)):[],a=yield function(e,t){return GB(this,null,(function*(){let n,r=yield xF("rt");if("web"===QD.platform)try{n=yield KF()}catch(e){console.error("webcrypto error",e)}return n?r?{msgType:e,payload:t,jwt:n,rt:r}:{msgType:e,payload:t,jwt:n}:{msgType:e,payload:t}}))}(`${e}-${this.parameters}`,t);yield this._post(a);let o=this.on(xB.MAGIC_HANDLE_RESPONSE,(e=>a=>{let{id:o,response:s}=fL(t,a);(function(e){GB(this,null,(function*(){!e.data.rt||(yield CF("rt",e.data.rt))}))})(a),o&&s&&Array.isArray(t)&&i.includes(o)?(r.push(s),r.length===t.length&&(e(),n(r))):o&&s&&!Array.isArray(t)&&o===t.id&&(e(),n(s))})((()=>o())))}))))}))}on(e,t){let n=t.bind(window),r=t=>{t.data.msgType===`${e}-${this.parameters}`&&n(t)};return this.messageHandlers.add(r),()=>this.messageHandlers.delete(r)}waitForReady(){return new Promise((e=>{this.on(xB.MAGIC_OVERLAY_READY,(()=>e()))}))}listen(){this.on(xB.MAGIC_HIDE_OVERLAY,(()=>{this.hideOverlay()})),this.on(xB.MAGIC_SHOW_OVERLAY,(()=>{this.showOverlay()}))}},lL=Object.create,pL=Object.defineProperty,hL=Object.getOwnPropertyDescriptor,bL=Object.getOwnPropertyNames,mL=Object.getPrototypeOf,yL=Object.prototype.hasOwnProperty,gL=(e=>"undefined"!=typeof require?require:"undefined"!=typeof Proxy?new Proxy(e,{get:(e,t)=>("undefined"!=typeof require?require:e)[t]}):e)((function(e){if("undefined"!=typeof require)return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')})),vL=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),wL=(e,t,n)=>(n=null!=e?lL(mL(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of bL(t))!yL.call(e,i)&&i!==n&&pL(e,i,{get:()=>t[i],enumerable:!(r=hL(t,i))||r.enumerable});return e})(!t&&e&&e.__esModule?n:pL(n,"default",{value:e,enumerable:!0}),e)),_L=(e,t,n)=>new Promise(((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())})),EL=vL(((e,t)=>{!function(n){if("object"==typeof e&&typeof t<"u")t.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{(typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this).localforage=n()}}((function(){return function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var u="function"==typeof gL&&gL;if(!s&&u)return u(o,!0);if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var f=n[o]={exports:{}};t[o][0].call(f.exports,(function(e){return i(t[o][1][e]||e)}),f,f.exports,e,t,n,r)}return n[o].exports}for(var a="function"==typeof gL&&gL,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){(function(e){var n,r=e.MutationObserver||e.WebKitMutationObserver;if(r){var i=0,a=new r(f),o=e.document.createTextNode("");a.observe(o,{characterData:!0}),n=function(){o.data=i=++i%2}}else if(!e.setImmediate&&typeof e.MessageChannel<"u"){var s=new e.MessageChannel;s.port1.onmessage=f,n=function(){s.port2.postMessage(0)}}else n="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){f(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(f,0)};var u,c=[];function f(){u=!0;for(var e,t,n=c.length;n;){for(t=c,c=[],e=-1;++e<n;)t[e]();n=c.length}u=!1}t.exports=function(e){1===c.push(e)&&!u&&n()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(e,t,n){var r=e(1);function i(){}var a={},o=["REJECTED"],s=["FULFILLED"],u=["PENDING"];function c(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,e!==i&&p(this,e)}function f(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function d(e,t,n){r((function(){var r;try{r=t(n)}catch(t){return a.reject(e,t)}r===e?a.reject(e,new TypeError("Cannot resolve promise with itself")):a.resolve(e,r)}))}function l(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function p(e,t){var n=!1;function r(t){n||(n=!0,a.reject(e,t))}function i(t){n||(n=!0,a.resolve(e,t))}var o=h((function(){t(i,r)}));"error"===o.status&&r(o.value)}function h(e,t){var n={};try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}t.exports=c,c.prototype.catch=function(e){return this.then(null,e)},c.prototype.then=function(e,t){if("function"!=typeof e&&this.state===s||"function"!=typeof t&&this.state===o)return this;var n=new this.constructor(i);this.state!==u?d(n,this.state===s?e:t,this.outcome):this.queue.push(new f(n,e,t));return n},f.prototype.callFulfilled=function(e){a.resolve(this.promise,e)},f.prototype.otherCallFulfilled=function(e){d(this.promise,this.onFulfilled,e)},f.prototype.callRejected=function(e){a.reject(this.promise,e)},f.prototype.otherCallRejected=function(e){d(this.promise,this.onRejected,e)},a.resolve=function(e,t){var n=h(l,t);if("error"===n.status)return a.reject(e,n.value);var r=n.value;if(r)p(e,r);else{e.state=s,e.outcome=t;for(var i=-1,o=e.queue.length;++i<o;)e.queue[i].callFulfilled(t)}return e},a.reject=function(e,t){e.state=o,e.outcome=t;for(var n=-1,r=e.queue.length;++n<r;)e.queue[n].callRejected(t);return e},c.resolve=function(e){return e instanceof this?e:a.resolve(new this(i),e)},c.reject=function(e){var t=new this(i);return a.reject(t,e)},c.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var o=new Array(n),s=0,u=-1,c=new this(i);++u<n;)f(e[u],u);return c;function f(e,i){t.resolve(e).then((function(e){o[i]=e,++s===n&&!r&&(r=!0,a.resolve(c,o))}),(function(e){r||(r=!0,a.reject(c,e))}))}},c.race=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var o=-1,s=new this(i);++o<n;)u(e[o]);return s;function u(e){t.resolve(e).then((function(e){r||(r=!0,a.resolve(s,e))}),(function(e){r||(r=!0,a.reject(s,e))}))}}},{1:1}],3:[function(e,t,n){(function(t){"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(e,t,n){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i=function(){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}}();function a(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(i){if("TypeError"!==i.name)throw i;for(var n=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),r=0;r<e.length;r+=1)n.append(e[r]);return n.getBlob(t.type)}}typeof Promise>"u"&&e(3);var o=Promise;function s(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))}function u(e,t,n){"function"==typeof t&&e.then(t),"function"==typeof n&&e.catch(n)}function c(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function f(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var d="local-forage-detect-blob-support",l=void 0,p={},h=Object.prototype.toString,b="readonly",m="readwrite";function y(e){return"boolean"==typeof l?o.resolve(l):function(e){return new o((function(t){var n=e.transaction(d,m),r=a([""]);n.objectStore(d).put(r,"key"),n.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},n.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);t(n||!e||parseInt(e[1],10)>=43)}})).catch((function(){return!1}))}(e).then((function(e){return l=e}))}function g(e){var t=p[e.name],n={};n.promise=new o((function(e,t){n.resolve=e,n.reject=t})),t.deferredOperations.push(n),t.dbReady?t.dbReady=t.dbReady.then((function(){return n.promise})):t.dbReady=n.promise}function v(e){var t=p[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function w(e,t){var n=p[e.name].deferredOperations.pop();if(n)return n.reject(t),n.promise}function _(e,t){return new o((function(n,r){if(p[e.name]=p[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!t)return n(e.db);g(e),e.db.close()}var a=[e.name];t&&a.push(e.version);var o=i.open.apply(i,a);t&&(o.onupgradeneeded=function(t){var n=o.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore(d)}catch(n){if("ConstraintError"!==n.name)throw n;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),o.onerror=function(e){e.preventDefault(),r(o.error)},o.onsuccess=function(){var t=o.result;t.onversionchange=function(e){e.target.close()},n(t),v(e)}}))}function E(e){return _(e,!1)}function T(e){return _(e,!0)}function A(e,t){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),r=e.version<e.db.version,i=e.version>e.db.version;if(r&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),i||n){if(n){var a=e.db.version+1;a>e.version&&(e.version=a)}return!0}return!1}function R(e){var t=function(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),i=0;i<t;i++)r[i]=e.charCodeAt(i);return n}(atob(e.data));return a([t],{type:e.type})}function S(e){return e&&e.__local_forage_encoded_blob}function k(e){var t=this,n=t._initReady().then((function(){var e=p[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return u(n,e,e),n}function O(e,t,n,r){void 0===r&&(r=1);try{var i=e.db.transaction(e.storeName,t);n(null,i)}catch(i){if(r>0&&(!e.db||"InvalidStateError"===i.name||"NotFoundError"===i.name))return o.resolve().then((function(){if(!e.db||"NotFoundError"===i.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),T(e)})).then((function(){return function(e){g(e);for(var t=p[e.name],n=t.forages,r=0;r<n.length;r++){var i=n[r];i._dbInfo.db&&(i._dbInfo.db.close(),i._dbInfo.db=null)}return e.db=null,E(e).then((function(t){return e.db=t,A(e)?T(e):t})).then((function(r){e.db=t.db=r;for(var i=0;i<n.length;i++)n[i]._dbInfo.db=r})).catch((function(t){throw w(e,t),t}))}(e).then((function(){O(e,t,n,r-1)}))})).catch(n);n(i)}}var I={_driver:"asyncStorage",_initStorage:function(e){var t=this,n={db:null};if(e)for(var r in e)n[r]=e[r];var i=p[n.name];i||(i={forages:[],db:null,dbReady:null,deferredOperations:[]},p[n.name]=i),i.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=k);var a=[];function s(){return o.resolve()}for(var u=0;u<i.forages.length;u++){var c=i.forages[u];c!==t&&a.push(c._initReady().catch(s))}var f=i.forages.slice(0);return o.all(a).then((function(){return n.db=i.db,E(n)})).then((function(e){return n.db=e,A(n,t._defaultConfig.version)?T(n):e})).then((function(e){n.db=i.db=e,t._dbInfo=n;for(var r=0;r<f.length;r++){var a=f[r];a!==t&&(a._dbInfo.db=n.db,a._dbInfo.version=n.version)}}))},_support:function(){try{if(!i||!i.open)return!1;var e=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}(),iterate:function(e,t){var n=this,r=new o((function(t,r){n.ready().then((function(){O(n._dbInfo,b,(function(i,a){if(i)return r(i);try{var o=a.objectStore(n._dbInfo.storeName).openCursor(),s=1;o.onsuccess=function(){var n=o.result;if(n){var r=n.value;S(r)&&(r=R(r));var i=e(r,n.key,s++);void 0!==i?t(i):n.continue()}else t()},o.onerror=function(){r(o.error)}}catch(e){r(e)}}))})).catch(r)}));return s(r,t),r},getItem:function(e,t){var n=this;e=c(e);var r=new o((function(t,r){n.ready().then((function(){O(n._dbInfo,b,(function(i,a){if(i)return r(i);try{var o=a.objectStore(n._dbInfo.storeName).get(e);o.onsuccess=function(){var e=o.result;void 0===e&&(e=null),S(e)&&(e=R(e)),t(e)},o.onerror=function(){r(o.error)}}catch(e){r(e)}}))})).catch(r)}));return s(r,t),r},setItem:function(e,t,n){var r=this;e=c(e);var i=new o((function(n,i){var a;r.ready().then((function(){return a=r._dbInfo,"[object Blob]"===h.call(t)?y(a.db).then((function(e){return e?t:function(e){return new o((function(t,n){var r=new FileReader;r.onerror=n,r.onloadend=function(n){var r=btoa(n.target.result||"");t({__local_forage_encoded_blob:!0,data:r,type:e.type})},r.readAsBinaryString(e)}))}(t)})):t})).then((function(t){O(r._dbInfo,m,(function(a,o){if(a)return i(a);try{var s=o.objectStore(r._dbInfo.storeName);null===t&&(t=void 0);var u=s.put(t,e);o.oncomplete=function(){void 0===t&&(t=null),n(t)},o.onabort=o.onerror=function(){var e=u.error?u.error:u.transaction.error;i(e)}}catch(e){i(e)}}))})).catch(i)}));return s(i,n),i},removeItem:function(e,t){var n=this;e=c(e);var r=new o((function(t,r){n.ready().then((function(){O(n._dbInfo,m,(function(i,a){if(i)return r(i);try{var o=a.objectStore(n._dbInfo.storeName).delete(e);a.oncomplete=function(){t()},a.onerror=function(){r(o.error)},a.onabort=function(){var e=o.error?o.error:o.transaction.error;r(e)}}catch(e){r(e)}}))})).catch(r)}));return s(r,t),r},clear:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){O(t._dbInfo,m,(function(r,i){if(r)return n(r);try{var a=i.objectStore(t._dbInfo.storeName).clear();i.oncomplete=function(){e()},i.onabort=i.onerror=function(){var e=a.error?a.error:a.transaction.error;n(e)}}catch(e){n(e)}}))})).catch(n)}));return s(n,e),n},length:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){O(t._dbInfo,b,(function(r,i){if(r)return n(r);try{var a=i.objectStore(t._dbInfo.storeName).count();a.onsuccess=function(){e(a.result)},a.onerror=function(){n(a.error)}}catch(e){n(e)}}))})).catch(n)}));return s(n,e),n},key:function(e,t){var n=this,r=new o((function(t,r){e<0?t(null):n.ready().then((function(){O(n._dbInfo,b,(function(i,a){if(i)return r(i);try{var o=a.objectStore(n._dbInfo.storeName),s=!1,u=o.openKeyCursor();u.onsuccess=function(){var n=u.result;n?0===e||s?t(n.key):(s=!0,n.advance(e)):t(null)},u.onerror=function(){r(u.error)}}catch(e){r(e)}}))})).catch(r)}));return s(r,t),r},keys:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){O(t._dbInfo,b,(function(r,i){if(r)return n(r);try{var a=i.objectStore(t._dbInfo.storeName).openKeyCursor(),o=[];a.onsuccess=function(){var t=a.result;t?(o.push(t.key),t.continue()):e(o)},a.onerror=function(){n(a.error)}}catch(e){n(e)}}))})).catch(n)}));return s(n,e),n},dropInstance:function(e,t){t=f.apply(this,arguments);var n,r=this.config();if((e="function"!=typeof e&&e||{}).name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName),e.name){var a=e.name===r.name&&this._dbInfo.db?o.resolve(this._dbInfo.db):E(e).then((function(t){var n=p[e.name],r=n.forages;n.db=t;for(var i=0;i<r.length;i++)r[i]._dbInfo.db=t;return t}));n=e.storeName?a.then((function(t){if(t.objectStoreNames.contains(e.storeName)){var n=t.version+1;g(e);var r=p[e.name],a=r.forages;t.close();for(var s=0;s<a.length;s++){var u=a[s];u._dbInfo.db=null,u._dbInfo.version=n}var c=new o((function(t,r){var a=i.open(e.name,n);a.onerror=function(e){a.result.close(),r(e)},a.onupgradeneeded=function(){a.result.deleteObjectStore(e.storeName)},a.onsuccess=function(){var e=a.result;e.close(),t(e)}}));return c.then((function(e){r.db=e;for(var t=0;t<a.length;t++){var n=a[t];n._dbInfo.db=e,v(n._dbInfo)}})).catch((function(t){throw(w(e,t)||o.resolve()).catch((function(){})),t}))}})):a.then((function(t){g(e);var n=p[e.name],r=n.forages;t.close();for(var a=0;a<r.length;a++){r[a]._dbInfo.db=null}var s=new o((function(t,n){var r=i.deleteDatabase(e.name);r.onerror=function(){var e=r.result;e&&e.close(),n(r.error)},r.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},r.onsuccess=function(){var e=r.result;e&&e.close(),t(e)}}));return s.then((function(e){n.db=e;for(var t=0;t<r.length;t++){v(r[t]._dbInfo)}})).catch((function(t){throw(w(e,t)||o.resolve()).catch((function(){})),t}))}))}else n=o.reject("Invalid arguments");return s(n,t),n}};var x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",C=/^~~local_forage_type~([^~]+)~/,M="__lfsc__:",N="arbf",P="blob",B="si08",D="ui08",F="uic8",L="si16",U="si32",j="ur16",q="ui32",z="fl32",H="fl64",V=Object.prototype.toString;function G(e){var t,n,r,i,a,o=.75*e.length,s=e.length,u=0;"="===e[e.length-1]&&(o--,"="===e[e.length-2]&&o--);var c=new ArrayBuffer(o),f=new Uint8Array(c);for(t=0;t<s;t+=4)n=x.indexOf(e[t]),r=x.indexOf(e[t+1]),i=x.indexOf(e[t+2]),a=x.indexOf(e[t+3]),f[u++]=n<<2|r>>4,f[u++]=(15&r)<<4|i>>2,f[u++]=(3&i)<<6|63&a;return c}function K(e){var t,n=new Uint8Array(e),r="";for(t=0;t<n.length;t+=3)r+=x[n[t]>>2],r+=x[(3&n[t])<<4|n[t+1]>>4],r+=x[(15&n[t+1])<<2|n[t+2]>>6],r+=x[63&n[t+2]];return n.length%3==2?r=r.substring(0,r.length-1)+"=":n.length%3==1&&(r=r.substring(0,r.length-2)+"=="),r}var W={serialize:function(e,t){var n="";if(e&&(n=V.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===V.call(e.buffer))){var r,i=M;e instanceof ArrayBuffer?(r=e,i+=N):(r=e.buffer,"[object Int8Array]"===n?i+=B:"[object Uint8Array]"===n?i+=D:"[object Uint8ClampedArray]"===n?i+=F:"[object Int16Array]"===n?i+=L:"[object Uint16Array]"===n?i+=j:"[object Int32Array]"===n?i+=U:"[object Uint32Array]"===n?i+=q:"[object Float32Array]"===n?i+=z:"[object Float64Array]"===n?i+=H:t(new Error("Failed to get type for BinaryArray"))),t(i+K(r))}else if("[object Blob]"===n){var a=new FileReader;a.onload=function(){var n="~~local_forage_type~"+e.type+"~"+K(this.result);t(M+P+n)},a.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error("Couldn't convert value into a JSON string: ",e),t(null,n)}},deserialize:function(e){if(e.substring(0,9)!==M)return JSON.parse(e);var t,n=e.substring(13),r=e.substring(9,13);if(r===P&&C.test(n)){var i=n.match(C);t=i[1],n=n.substring(i[0].length)}var o=G(n);switch(r){case N:return o;case P:return a([o],{type:t});case B:return new Int8Array(o);case D:return new Uint8Array(o);case F:return new Uint8ClampedArray(o);case L:return new Int16Array(o);case j:return new Uint16Array(o);case U:return new Int32Array(o);case q:return new Uint32Array(o);case z:return new Float32Array(o);case H:return new Float64Array(o);default:throw new Error("Unkown type: "+r)}},stringToBuffer:G,bufferToString:K};function X(e,t,n,r){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,r)}function $(e,t,n,r,i,a){e.executeSql(n,r,i,(function(e,o){o.code===o.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,s){s.rows.length?a(e,o):X(e,t,(function(){e.executeSql(n,r,i,a)}),a)}),a):a(e,o)}),a)}function J(e,t,n,r){var i=this;e=c(e);var a=new o((function(a,o){i.ready().then((function(){void 0===t&&(t=null);var s=t,u=i._dbInfo;u.serializer.serialize(t,(function(t,c){c?o(c):u.db.transaction((function(n){$(n,u,"INSERT OR REPLACE INTO "+u.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){a(s)}),(function(e,t){o(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(r>0)return void a(J.apply(i,[e,s,n,r-1]));o(t)}}))}))})).catch(o)}));return s(a,n),a}var Y={_driver:"webSQLStorage",_initStorage:function(e){var t=this,n={db:null};if(e)for(var r in e)n[r]="string"!=typeof e[r]?e[r].toString():e[r];var i=new o((function(e,r){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(e){return r(e)}n.db.transaction((function(i){X(i,n,(function(){t._dbInfo=n,e()}),(function(e,t){r(t)}))}),r)}));return n.serializer=W,i},_support:"function"==typeof openDatabase,iterate:function(e,t){var n=this,r=new o((function(t,r){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){$(n,i,"SELECT * FROM "+i.storeName,[],(function(n,r){for(var a=r.rows,o=a.length,s=0;s<o;s++){var u=a.item(s),c=u.value;if(c&&(c=i.serializer.deserialize(c)),void 0!==(c=e(c,u.key,s+1)))return void t(c)}t()}),(function(e,t){r(t)}))}))})).catch(r)}));return s(r,t),r},getItem:function(e,t){var n=this;e=c(e);var r=new o((function(t,r){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){$(n,i,"SELECT * FROM "+i.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,n){var r=n.rows.length?n.rows.item(0).value:null;r&&(r=i.serializer.deserialize(r)),t(r)}),(function(e,t){r(t)}))}))})).catch(r)}));return s(r,t),r},setItem:function(e,t,n){return J.apply(this,[e,t,n,1])},removeItem:function(e,t){var n=this;e=c(e);var r=new o((function(t,r){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){$(n,i,"DELETE FROM "+i.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){r(t)}))}))})).catch(r)}));return s(r,t),r},clear:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){var r=t._dbInfo;r.db.transaction((function(t){$(t,r,"DELETE FROM "+r.storeName,[],(function(){e()}),(function(e,t){n(t)}))}))})).catch(n)}));return s(n,e),n},length:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){var r=t._dbInfo;r.db.transaction((function(t){$(t,r,"SELECT COUNT(key) as c FROM "+r.storeName,[],(function(t,n){var r=n.rows.item(0).c;e(r)}),(function(e,t){n(t)}))}))})).catch(n)}));return s(n,e),n},key:function(e,t){var n=this,r=new o((function(t,r){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){$(n,i,"SELECT key FROM "+i.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,n){var r=n.rows.length?n.rows.item(0).key:null;t(r)}),(function(e,t){r(t)}))}))})).catch(r)}));return s(r,t),r},keys:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){var r=t._dbInfo;r.db.transaction((function(t){$(t,r,"SELECT key FROM "+r.storeName,[],(function(t,n){for(var r=[],i=0;i<n.rows.length;i++)r.push(n.rows.item(i).key);e(r)}),(function(e,t){n(t)}))}))})).catch(n)}));return s(n,e),n},dropInstance:function(e,t){t=f.apply(this,arguments);var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var r,i=this;return r=e.name?new o((function(t){var r;r=e.name===n.name?i._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?t({db:r,storeNames:[e.storeName]}):t(function(e){return new o((function(t,n){e.transaction((function(r){r.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(n,r){for(var i=[],a=0;a<r.rows.length;a++)i.push(r.rows.item(a).name);t({db:e,storeNames:i})}),(function(e,t){n(t)}))}),(function(e){n(e)}))}))}(r))})).then((function(e){return new o((function(t,n){e.db.transaction((function(r){function i(e){return new o((function(t,n){r.executeSql("DROP TABLE IF EXISTS "+e,[],(function(){t()}),(function(e,t){n(t)}))}))}for(var a=[],s=0,u=e.storeNames.length;s<u;s++)a.push(i(e.storeNames[s]));o.all(a).then((function(){t()})).catch((function(e){n(e)}))}),(function(e){n(e)}))}))})):o.reject("Invalid arguments"),s(r,t),r}};function Q(e,t){var n=e.name+"/";return e.storeName!==t.storeName&&(n+=e.storeName+"/"),n}function Z(){return!function(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch{return!0}}()||localStorage.length>0}var ee={_driver:"localStorageWrapper",_initStorage:function(e){var t={};if(e)for(var n in e)t[n]=e[n];return t.keyPrefix=Q(e,this._defaultConfig),Z()?(this._dbInfo=t,t.serializer=W,o.resolve()):o.reject()},_support:function(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}(),iterate:function(e,t){var n=this,r=n.ready().then((function(){for(var t=n._dbInfo,r=t.keyPrefix,i=r.length,a=localStorage.length,o=1,s=0;s<a;s++){var u=localStorage.key(s);if(0===u.indexOf(r)){var c=localStorage.getItem(u);if(c&&(c=t.serializer.deserialize(c)),void 0!==(c=e(c,u.substring(i),o++)))return c}}}));return s(r,t),r},getItem:function(e,t){var n=this;e=c(e);var r=n.ready().then((function(){var t=n._dbInfo,r=localStorage.getItem(t.keyPrefix+e);return r&&(r=t.serializer.deserialize(r)),r}));return s(r,t),r},setItem:function(e,t,n){var r=this;e=c(e);var i=r.ready().then((function(){void 0===t&&(t=null);var n=t;return new o((function(i,a){var o=r._dbInfo;o.serializer.serialize(t,(function(t,r){if(r)a(r);else try{localStorage.setItem(o.keyPrefix+e,t),i(n)}catch(e){("QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&a(e),a(e)}}))}))}));return s(i,n),i},removeItem:function(e,t){var n=this;e=c(e);var r=n.ready().then((function(){var t=n._dbInfo;localStorage.removeItem(t.keyPrefix+e)}));return s(r,t),r},clear:function(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var r=localStorage.key(n);0===r.indexOf(e)&&localStorage.removeItem(r)}}));return s(n,e),n},length:function(e){var t=this.keys().then((function(e){return e.length}));return s(t,e),t},key:function(e,t){var n=this,r=n.ready().then((function(){var t,r=n._dbInfo;try{t=localStorage.key(e)}catch{t=null}return t&&(t=t.substring(r.keyPrefix.length)),t}));return s(r,t),r},keys:function(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo,n=localStorage.length,r=[],i=0;i<n;i++){var a=localStorage.key(i);0===a.indexOf(e.keyPrefix)&&r.push(a.substring(e.keyPrefix.length))}return r}));return s(n,e),n},dropInstance:function(e,t){if(t=f.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var n=this.config();e.name=e.name||n.name,e.storeName=e.storeName||n.storeName}var r,i=this;return r=e.name?new o((function(t){e.storeName?t(Q(e,i._defaultConfig)):t(e.name+"/")})).then((function(e){for(var t=localStorage.length-1;t>=0;t--){var n=localStorage.key(t);0===n.indexOf(e)&&localStorage.removeItem(n)}})):o.reject("Invalid arguments"),s(r,t),r}},te=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},ne=function(e,t){for(var n=e.length,r=0;r<n;){if(te(e[r],t))return!0;r++}return!1},re=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},ie={},ae={},oe={INDEXEDDB:I,WEBSQL:Y,LOCALSTORAGE:ee},se=[oe.INDEXEDDB._driver,oe.WEBSQL._driver,oe.LOCALSTORAGE._driver],ue=["dropInstance"],ce=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ue),fe={description:"",driver:se.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function de(e,t){e[t]=function(){var n=arguments;return e.ready().then((function(){return e[t].apply(e,n)}))}}function le(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var n in t)t.hasOwnProperty(n)&&(re(t[n])?arguments[0][n]=t[n].slice():arguments[0][n]=t[n])}return arguments[0]}var pe=function(){function e(t){for(var n in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),oe)if(oe.hasOwnProperty(n)){var r=oe[n],i=r._driver;this[n]=i,ie[i]||this.defineDriver(r)}this._defaultConfig=le({},fe),this._config=le({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return e.prototype.config=function(e){if("object"===(typeof e>"u"?"undefined":r(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e)||!e.driver||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,n){var r=new o((function(t,n){try{var r=e._driver,i=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void n(i);for(var a=ce.concat("_initStorage"),u=0,c=a.length;u<c;u++){var f=a[u];if((!ne(ue,f)||e[f])&&"function"!=typeof e[f])return void n(i)}!function(){for(var t=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),n=o.reject(t);return s(n,arguments[arguments.length-1]),n}},n=0,r=ue.length;n<r;n++){var i=ue[n];e[i]||(e[i]=t(i))}}();var d=function(n){ie[r]&&console.info("Redefining LocalForage driver: "+r),ie[r]=e,ae[r]=n,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(d,n):d(!!e._support):d(!0)}catch(e){n(e)}}));return u(r,t,n),r},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,n){var r=ie[e]?o.resolve(ie[e]):o.reject(new Error("Driver not found."));return u(r,t,n),r},e.prototype.getSerializer=function(e){var t=o.resolve(W);return u(t,e),t},e.prototype.ready=function(e){var t=this,n=t._driverSet.then((function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready}));return u(n,e,e),n},e.prototype.setDriver=function(e,t,n){var r=this;re(e)||(e=[e]);var i=this._getSupportedDrivers(e);function a(){r._config.driver=r.driver()}function s(e){return r._extend(e),a(),r._ready=r._initStorage(r._config),r._ready}var c=null!==this._driverSet?this._driverSet.catch((function(){return o.resolve()})):o.resolve();return this._driverSet=c.then((function(){var e=i[0];return r._dbInfo=null,r._ready=null,r.getDriver(e).then((function(e){r._driver=e._driver,a(),r._wrapLibraryMethodsWithReady(),r._initDriver=function(e){return function(){var t=0;return function n(){for(;t<e.length;){var i=e[t];return t++,r._dbInfo=null,r._ready=null,r.getDriver(i).then(s).catch(n)}a();var u=new Error("No available storage method found.");return r._driverSet=o.reject(u),r._driverSet}()}}(i)}))})).catch((function(){a();var e=new Error("No available storage method found.");return r._driverSet=o.reject(e),r._driverSet})),u(this._driverSet,t,n),this._driverSet},e.prototype.supports=function(e){return!!ae[e]},e.prototype._extend=function(e){le(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];this.supports(i)&&t.push(i)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=ce.length;e<t;e++)de(this,ce[e])},e.prototype.createInstance=function(t){return new e(t)},e}(),he=new pe;t.exports=he},{3:3}]},{},[4])(4)}))})),TL=vL(((e,t)=>{!function(n,r){"object"==typeof e&&typeof t<"u"?r(e):"function"==typeof define&&define.amd?define("localforage-driver-memory",["exports"],r):r(n.LocalforageDriverMemory={})}(typeof self<"u"?self:e,(function(e){var t=/^~~local_forage_type~([^~]+)~/,n=Object.prototype.toString;function r(e){var t=.75*e.length,n=e.length;"="===e[e.length-1]&&(t--,"="===e[e.length-2]&&t--);for(var r=new ArrayBuffer(t),i=new Uint8Array(r),a=0,o=0;a<n;a+=4){var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[a]),u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[a+1]),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[a+2]),f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[a+3]);i[o++]=s<<2|u>>4,i[o++]=(15&u)<<4|c>>2,i[o++]=(3&c)<<6|63&f}return r}function i(e){for(var t=new Uint8Array(e),n="",r=0;r<t.length;r+=3)n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[t[r]>>2],n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&t[r])<<4|t[r+1]>>4],n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&t[r+1])<<2|t[r+2]>>6],n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[63&t[r+2]];return t.length%3==2?n=n.substring(0,n.length-1)+"=":t.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}function a(e){var t,n;if(null===e||"object"!=typeof e||"isActiveClone"in e)return e;var r=e instanceof Date?new Date(e):e.constructor();try{for(var i=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(Object.keys(e)),o=i.next();!o.done;o=i.next()){var s=o.value;Object.prototype.hasOwnProperty.call(e,s)&&(e.isActiveClone=null,r[s]=a(e[s]),delete e.isActiveClone)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}function o(e,t){return(e.name||t.name)+"/"+(e.storeName||t.storeName)+"/"}function s(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))}function u(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}function c(e,t){var n,r=this;if(t=u.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var i=this.config();e.name=e.name||i.name,e.storeName=e.storeName||i.storeName}return n=e.name?new Promise((function(t){e.storeName?t(o(e,r._defaultConfig)):t(e.name+"/")})):Promise.reject("Invalid arguments"),{promise:n,callback:t}}function f(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}var d={bufferToString:i,deserialize:function(e){if("__lfsc__:"!==e.substring(0,9))return JSON.parse(e);var n,i=e.substring(13),a=e.substring(9,13);if("blob"===a&&t.test(i)){var o=i.match(t);n=o[1],i=i.substring(o[0].length)}var s=r(i);switch(a){case"arbf":return s;case"blob":return function(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(i){if("TypeError"!==i.name)throw i;for(var n=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),r=0;r<e.length;r+=1)n.append(e[r]);return n.getBlob(t.type)}}([s],{type:n});case"si08":return new Int8Array(s);case"ui08":return new Uint8Array(s);case"uic8":return new Uint8ClampedArray(s);case"si16":return new Int16Array(s);case"ur16":return new Uint16Array(s);case"si32":return new Int32Array(s);case"ui32":return new Uint32Array(s);case"fl32":return new Float32Array(s);case"fl64":return new Float64Array(s);default:throw new Error("Unkown type: "+a)}},serialize:function(e,t){var r="";if(e&&(r=n.call(e)),e&&("[object ArrayBuffer]"===r||e.buffer&&"[object ArrayBuffer]"===n.call(e.buffer))){var a=void 0,o="__lfsc__:";e instanceof ArrayBuffer?(a=e,o+="arbf"):(a=e.buffer,"[object Int8Array]"===r?o+="si08":"[object Uint8Array]"===r?o+="ui08":"[object Uint8ClampedArray]"===r?o+="uic8":"[object Int16Array]"===r?o+="si16":"[object Uint16Array]"===r?o+="ur16":"[object Int32Array]"===r?o+="si32":"[object Uint32Array]"===r?o+="ui32":"[object Float32Array]"===r?o+="fl32":"[object Float64Array]"===r?o+="fl64":t(new Error("Failed to get type for BinaryArray"))),t(o+i(a))}else if("[object Blob]"===r){var s=new FileReader;s.onload=function(){var n="~~local_forage_type~"+e.type+"~"+i(this.result);t("__lfsc__:blob"+n)},s.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error("Couldn't convert value into a JSON string: ",e),t(null,n)}},stringToBuffer:r},l={},p=function(){function e(e){this.kp=e,this.data={}}return e.resolve=function(t){return l[t]||(l[t]=new e(t)),l[t]},e.prototype.clear=function(){this.data={}},e.prototype.drop=function(){this.clear(),delete l[this.kp]},e.prototype.get=function(e){return this.data[e]},e.prototype.key=function(e){return this.keys()[e]},e.prototype.keys=function(){return Object.keys(this.data)},e.prototype.rm=function(e){delete this.data[e]},e.prototype.set=function(e,t){this.data[e]=t},e}();e._support=!0,e._driver="localforage-driver-memory",e._initStorage=function(e){var t=e?a(e):{},n=o(t,this._defaultConfig),r=p.resolve(n);return this._dbInfo=t,this._dbInfo.serializer=d,this._dbInfo.keyPrefix=n,this._dbInfo.mStore=r,Promise.resolve()},e.clear=function(e){var t=this,n=this.ready().then((function(){t._dbInfo.mStore.clear()}));return s(n,e),n},e.dropInstance=function(e,t){var n=c.apply(this,arguments),r=n.promise,i=n.callback,a=r.then((function(e){p.resolve(e).drop()}));return s(a,i),r},e.getItem=function(e,t){var n=this;e=f(e);var r=this.ready().then((function(){var t=n._dbInfo.mStore.get(e);return null==t?null:n._dbInfo.serializer.deserialize(t)}));return s(r,t),r},e.iterate=function(e,t){var n=this,r=this.ready().then((function(){for(var t=n._dbInfo.mStore,r=t.keys(),i=0;i<r.length;i++){var a=t.get(r[i]);if(a&&(a=n._dbInfo.serializer.deserialize(a)),void 0!==(a=e(a,r[i],i+1)))return a}}));return s(r,t),r},e.key=function(e,t){var n=this,r=this.ready().then((function(){var t;try{void 0===(t=n._dbInfo.mStore.key(e))&&(t=null)}catch{t=null}return t}));return s(r,t),r},e.keys=function(e){var t=this,n=this.ready().then((function(){return t._dbInfo.mStore.keys()}));return s(n,e),n},e.length=function(e){var t=this.keys().then((function(e){return e.length}));return s(t,e),t},e.removeItem=function(e,t){var n=this;e=f(e);var r=this.ready().then((function(){n._dbInfo.mStore.rm(e)}));return s(r,t),r},e.setItem=function(e,t,n){var r=this;e=f(e);var i=this.ready().then((function(){void 0===t&&(t=null);var n=t;return new Promise((function(i,a){r._dbInfo.serializer.serialize(t,(function(t,o){if(o)a(o);else try{r._dbInfo.mStore.set(e,t),i(n)}catch(e){a(e)}}))}))}));return s(i,n),i},Object.defineProperty(e,"__esModule",{value:!0})}))})),AL=wL(EL()),RL=wL(TL()),SL={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};var kL=function(e,t){return Object.assign(QD,t),e}(cL,{platform:"web",sdkName:"magic-sdk",version:"13.6.2",defaultEndpoint:"https://auth.magic.link/",ViewController:class extends dL{constructor(){super(...arguments),this.activeElement=null}init(){this.test="hello",this.iframe=new Promise((e=>{let t=()=>{if(function(e){let t=[].slice.call(document.querySelectorAll(".magic-iframe"));return Boolean(t.find((t=>t.src.includes(e))))}(encodeURIComponent(this.parameters)))new nF(kB.DuplicateIframe,"Duplicate iframes found.").log();else{let t=document.createElement("iframe");t.classList.add("magic-iframe"),t.dataset.magicIframeLabel=eL(this.endpoint).host,t.title="Secure Modal",t.src=eL(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,function(e){for(let[t,n]of Object.entries(SL))e.style[t]=n}(t),document.body.appendChild(t),e(t)}};["loaded","interactive","complete"].includes(document.readyState)?t():window.addEventListener("load",t,!1)})),window.addEventListener("message",(e=>{var t;if(e.origin===this.endpoint&&e.data&&e.data.msgType&&this.messageHandlers.size){e.data.response=null!=(t=e.data.response)?t:{};for(let t of this.messageHandlers.values())t(e)}}))}showOverlay(){return _L(this,null,(function*(){let e=yield this.iframe;e.style.display="block",this.activeElement=document.activeElement,e.focus()}))}hideOverlay(){return _L(this,null,(function*(){var e;(yield this.iframe).style.display="none",null!=(e=this.activeElement)&&e.focus&&this.activeElement.focus(),this.activeElement=null}))}_post(e){return _L(this,null,(function*(){let t=yield this.iframe;if(!t||!t.contentWindow)throw new eF(SB.ModalNotReady,"Modal is not ready.");t.contentWindow.postMessage(e,this.endpoint)}))}},configureStorage:()=>_L(void 0,null,(function*(){let e=AL.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield e.defineDriver(RL),yield e.setDriver([AL.default.INDEXEDDB,AL.default.LOCALSTORAGE,RL._driver]),e}))}),OL=(e=>(e.LoginWithOIDC="magic_auth_login_with_oidc",e))(OL||{}),IL=class extends iL.Internal{constructor(){super(...arguments),this.name="openid",this.config={}}loginWithOIDC(e){let t=this.utils.createJsonRpcRequestPayload("magic_auth_login_with_oidc",[e]);return this.request(t)}};function xL(e,t){return function(){return e.apply(t,arguments)}}const{toString:CL}=Object.prototype,{getPrototypeOf:ML}=Object,NL=(e=>t=>{const n=CL.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),PL=e=>(e=e.toLowerCase(),t=>NL(t)===e),BL=e=>t=>typeof t===e,{isArray:DL}=Array,FL=BL("undefined");const LL=PL("ArrayBuffer");const UL=BL("string"),jL=BL("function"),qL=BL("number"),zL=e=>null!==e&&"object"==typeof e,HL=e=>{if("object"!==NL(e))return!1;const t=ML(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},VL=PL("Date"),GL=PL("File"),KL=PL("Blob"),WL=PL("FileList"),XL=PL("URLSearchParams");function $L(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),DL(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function JL(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const YL="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,QL=e=>!FL(e)&&e!==YL;const ZL=(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&ML(Uint8Array)),eU=PL("HTMLFormElement"),tU=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),nU=PL("RegExp"),rU=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};$L(n,((n,i)=>{!1!==t(n,i,e)&&(r[i]=n)})),Object.defineProperties(e,r)},iU="abcdefghijklmnopqrstuvwxyz",aU="0123456789",oU={DIGIT:aU,ALPHA:iU,ALPHA_DIGIT:iU+iU.toUpperCase()+aU};const sU=PL("AsyncFunction");var uU={isArray:DL,isArrayBuffer:LL,isBuffer:function(e){return null!==e&&!FL(e)&&null!==e.constructor&&!FL(e.constructor)&&jL(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||jL(e.append)&&("formdata"===(t=NL(e))||"object"===t&&jL(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&LL(e.buffer),t},isString:UL,isNumber:qL,isBoolean:e=>!0===e||!1===e,isObject:zL,isPlainObject:HL,isUndefined:FL,isDate:VL,isFile:GL,isBlob:KL,isRegExp:nU,isFunction:jL,isStream:e=>zL(e)&&jL(e.pipe),isURLSearchParams:XL,isTypedArray:ZL,isFileList:WL,forEach:$L,merge:function e(){const{caseless:t}=QL(this)&&this||{},n={},r=(r,i)=>{const a=t&&JL(n,i)||i;HL(n[a])&&HL(r)?n[a]=e(n[a],r):HL(r)?n[a]=e({},r):DL(r)?n[a]=r.slice():n[a]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&$L(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>($L(t,((t,r)=>{n&&jL(t)?e[r]=xL(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,a,o;const s={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],r&&!r(o,e,t)||s[o]||(t[o]=e[o],s[o]=!0);e=!1!==n&&ML(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:NL,kindOfTest:PL,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(DL(e))return e;let t=e.length;if(!qL(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:eU,hasOwnProperty:tU,hasOwnProp:tU,reduceDescriptors:rU,freezeMethods:e=>{rU(e,((t,n)=>{if(jL(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];jL(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return DL(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:JL,global:YL,isContextDefined:QL,ALPHABET:oU,generateString:(e=16,t=oU.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&jL(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(zL(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const i=DL(e)?[]:{};return $L(e,((e,t)=>{const a=n(e,r+1);!FL(a)&&(i[t]=a)})),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:sU,isThenable:e=>e&&(zL(e)||jL(e))&&jL(e.then)&&jL(e.catch)};function cU(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}uU.inherits(cU,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:uU.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const fU=cU.prototype,dU={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{dU[e]={value:e}})),Object.defineProperties(cU,dU),Object.defineProperty(fU,"isAxiosError",{value:!0}),cU.from=(e,t,n,r,i,a)=>{const o=Object.create(fU);return uU.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),cU.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};function lU(e){return uU.isPlainObject(e)||uU.isArray(e)}function pU(e){return uU.endsWith(e,"[]")?e.slice(0,-2):e}function hU(e,t,n){return e?e.concat(t).map((function(e,t){return e=pU(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const bU=uU.toFlatObject(uU,{},null,(function(e){return/^is[A-Z]/.test(e)}));function mU(e,t,n){if(!uU.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=uU.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!uU.isUndefined(t[e])}))).metaTokens,i=n.visitor||c,a=n.dots,o=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&uU.isSpecCompliantForm(t);if(!uU.isFunction(i))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(uU.isDate(e))return e.toISOString();if(!s&&uU.isBlob(e))throw new cU("Blob is not supported. Use a Buffer instead.");return uU.isArrayBuffer(e)||uU.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,i){let s=e;if(e&&!i&&"object"==typeof e)if(uU.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(uU.isArray(e)&&function(e){return uU.isArray(e)&&!e.some(lU)}(e)||(uU.isFileList(e)||uU.endsWith(n,"[]"))&&(s=uU.toArray(e)))return n=pU(n),s.forEach((function(e,r){!uU.isUndefined(e)&&null!==e&&t.append(!0===o?hU([n],r,a):null===o?n:n+"[]",u(e))})),!1;return!!lU(e)||(t.append(hU(i,n,a),u(e)),!1)}const f=[],d=Object.assign(bU,{defaultVisitor:c,convertValue:u,isVisitable:lU});if(!uU.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!uU.isUndefined(n)){if(-1!==f.indexOf(n))throw Error("Circular reference detected in "+r.join("."));f.push(n),uU.forEach(n,(function(n,a){!0===(!(uU.isUndefined(n)||null===n)&&i.call(t,n,uU.isString(a)?a.trim():a,r,d))&&e(n,r?r.concat(a):[a])})),f.pop()}}(e),t}function yU(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function gU(e,t){this._pairs=[],e&&mU(e,this,t)}const vU=gU.prototype;function wU(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function _U(e,t,n){if(!t)return e;const r=n&&n.encode||wU,i=n&&n.serialize;let a;if(a=i?i(t,n):uU.isURLSearchParams(t)?t.toString():new gU(t,n).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}vU.append=function(e,t){this._pairs.push([e,t])},vU.toString=function(e){const t=e?function(t){return e.call(this,t,yU)}:yU;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var EU=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){uU.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},TU={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var AU={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:gU,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&("undefined"!=typeof window&&"undefined"!=typeof document)})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};function RU(e){function t(e,n,r,i){let a=e[i++];const o=Number.isFinite(+a),s=i>=e.length;if(a=!a&&uU.isArray(r)?r.length:a,s)return uU.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!o;r[a]&&uU.isObject(r[a])||(r[a]=[]);return t(e,n,r[a],i)&&uU.isArray(r[a])&&(r[a]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}(r[a])),!o}if(uU.isFormData(e)&&uU.isFunction(e.entries)){const n={};return uU.forEachEntry(e,((e,r)=>{t(function(e){return uU.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const SU={"Content-Type":void 0};const kU={transitional:TU,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=uU.isObject(e);i&&uU.isHTMLForm(e)&&(e=new FormData(e));if(uU.isFormData(e))return r&&r?JSON.stringify(RU(e)):e;if(uU.isArrayBuffer(e)||uU.isBuffer(e)||uU.isStream(e)||uU.isFile(e)||uU.isBlob(e))return e;if(uU.isArrayBufferView(e))return e.buffer;if(uU.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return mU(e,new AU.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return AU.isNode&&uU.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=uU.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return mU(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(uU.isString(e))try{return(t||JSON.parse)(e),uU.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||kU.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&uU.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw cU.from(e,cU.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:AU.classes.FormData,Blob:AU.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};uU.forEach(["delete","get","head"],(function(e){kU.headers[e]={}})),uU.forEach(["post","put","patch"],(function(e){kU.headers[e]=uU.merge(SU)}));var OU=kU;const IU=uU.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const xU=Symbol("internals");function CU(e){return e&&String(e).trim().toLowerCase()}function MU(e){return!1===e||null==e?e:uU.isArray(e)?e.map(MU):String(e)}function NU(e,t,n,r,i){return uU.isFunction(r)?r.call(this,t,n):(i&&(t=n),uU.isString(t)?uU.isString(r)?-1!==t.indexOf(r):uU.isRegExp(r)?r.test(t):void 0:void 0)}class PU{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=CU(t);if(!i)throw new Error("header name must be a non-empty string");const a=uU.findKey(r,i);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=MU(e))}const a=(e,t)=>uU.forEach(e,((e,n)=>i(e,n,t)));return uU.isPlainObject(e)||e instanceof this.constructor?a(e,t):uU.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?a((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&IU[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&i(t,e,n),this}get(e,t){if(e=CU(e)){const n=uU.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(uU.isFunction(t))return t.call(this,e,n);if(uU.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=CU(e)){const n=uU.findKey(this,e);return!(!n||void 0===this[n]||t&&!NU(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=CU(e)){const i=uU.findKey(n,e);!i||t&&!NU(0,n[i],i,t)||(delete n[i],r=!0)}}return uU.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!NU(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return uU.forEach(this,((r,i)=>{const a=uU.findKey(n,i);if(a)return t[a]=MU(r),void delete t[i];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(i):String(i).trim();o!==i&&delete t[i],t[o]=MU(r),n[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return uU.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&uU.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[xU]=this[xU]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=CU(e);t[r]||(!function(e,t){const n=uU.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})}))}(n,e),t[r]=!0)}return uU.isArray(e)?e.forEach(r):r(e),this}}PU.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),uU.freezeMethods(PU.prototype),uU.freezeMethods(PU);var BU=PU;function DU(e,t){const n=this||OU,r=t||n,i=BU.from(r.headers);let a=r.data;return uU.forEach(e,(function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)})),i.normalize(),a}function FU(e){return!(!e||!e.__CANCEL__)}function LU(e,t,n){cU.call(this,null==e?"canceled":e,cU.ERR_CANCELED,t,n),this.name="CanceledError"}uU.inherits(LU,cU,{__CANCEL__:!0});var UU=AU.isStandardBrowserEnv?{write:function(e,t,n,r,i,a){const o=[];o.push(e+"="+encodeURIComponent(t)),uU.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),uU.isString(r)&&o.push("path="+r),uU.isString(i)&&o.push("domain="+i),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function jU(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var qU=AU.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=uU.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function zU(e,t){let n=0;const r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,a=0,o=0;return t=void 0!==t?t:1e3,function(s){const u=Date.now(),c=r[o];i||(i=u),n[a]=s,r[a]=u;let f=o,d=0;for(;f!==a;)d+=n[f++],f%=e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),u-i<t)return;const l=c&&u-c;return l?Math.round(1e3*d/l):void 0}}(50,250);return i=>{const a=i.loaded,o=i.lengthComputable?i.total:void 0,s=a-n,u=r(s);n=a;const c={loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:u||void 0,estimated:u&&o&&a<=o?(o-a)/u:void 0,event:i};c[t?"download":"upload"]=!0,e(c)}}var HU="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const i=BU.from(e.headers).normalize(),a=e.responseType;let o;function s(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}uU.isFormData(r)&&(AU.isStandardBrowserEnv||AU.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let u=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+n))}const c=jU(e.baseURL,e.url);function f(){if(!u)return;const r=BU.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new cU("Request failed with status code "+n.status,[cU.ERR_BAD_REQUEST,cU.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),s()}),(function(e){n(e),s()}),{data:a&&"text"!==a&&"json"!==a?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:r,config:e,request:u}),u=null}if(u.open(e.method.toUpperCase(),_U(c,e.params,e.paramsSerializer),!0),u.timeout=e.timeout,"onloadend"in u?u.onloadend=f:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(f)},u.onabort=function(){u&&(n(new cU("Request aborted",cU.ECONNABORTED,e,u)),u=null)},u.onerror=function(){n(new cU("Network Error",cU.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||TU;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new cU(t,r.clarifyTimeoutError?cU.ETIMEDOUT:cU.ECONNABORTED,e,u)),u=null},AU.isStandardBrowserEnv){const t=(e.withCredentials||qU(c))&&e.xsrfCookieName&&UU.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===r&&i.setContentType(null),"setRequestHeader"in u&&uU.forEach(i.toJSON(),(function(e,t){u.setRequestHeader(t,e)})),uU.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),a&&"json"!==a&&(u.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&u.addEventListener("progress",zU(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",zU(e.onUploadProgress)),(e.cancelToken||e.signal)&&(o=t=>{u&&(n(!t||t.type?new LU(null,e,u):t),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o)));const d=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(c);d&&-1===AU.protocols.indexOf(d)?n(new cU("Unsupported protocol "+d+":",cU.ERR_BAD_REQUEST,e)):u.send(r||null)}))};const VU={http:null,xhr:HU};uU.forEach(VU,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var GU=e=>{e=uU.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let i=0;i<t&&(n=e[i],!(r=uU.isString(n)?VU[n.toLowerCase()]:n));i++);if(!r){if(!1===r)throw new cU(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(uU.hasOwnProp(VU,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`)}if(!uU.isFunction(r))throw new TypeError("adapter is not a function");return r};function KU(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new LU(null,e)}function WU(e){KU(e),e.headers=BU.from(e.headers),e.data=DU.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return GU(e.adapter||OU.adapter)(e).then((function(t){return KU(e),t.data=DU.call(e,e.transformResponse,t),t.headers=BU.from(t.headers),t}),(function(t){return FU(t)||(KU(e),t&&t.response&&(t.response.data=DU.call(e,e.transformResponse,t.response),t.response.headers=BU.from(t.response.headers))),Promise.reject(t)}))}const XU=e=>e instanceof BU?e.toJSON():e;function $U(e,t){t=t||{};const n={};function r(e,t,n){return uU.isPlainObject(e)&&uU.isPlainObject(t)?uU.merge.call({caseless:n},e,t):uU.isPlainObject(t)?uU.merge({},t):uU.isArray(t)?t.slice():t}function i(e,t,n){return uU.isUndefined(t)?uU.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function a(e,t){if(!uU.isUndefined(t))return r(void 0,t)}function o(e,t){return uU.isUndefined(t)?uU.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,i,a){return a in t?r(n,i):a in e?r(void 0,n):void 0}const u={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(e,t)=>i(XU(e),XU(t),!0)};return uU.forEach(Object.keys(Object.assign({},e,t)),(function(r){const a=u[r]||i,o=a(e[r],t[r],r);uU.isUndefined(o)&&a!==s||(n[r]=o)})),n}const JU="1.4.0",YU={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{YU[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const QU={};YU.transitional=function(e,t,n){function r(e,t){return"[Axios v1.4.0] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,a)=>{if(!1===e)throw new cU(r(i," has been removed"+(t?" in "+t:"")),cU.ERR_DEPRECATED);return t&&!QU[i]&&(QU[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,a)}};var ZU={assertOptions:function(e,t,n){if("object"!=typeof e)throw new cU("options must be an object",cU.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const a=r[i],o=t[a];if(o){const t=e[a],n=void 0===t||o(t,a,e);if(!0!==n)throw new cU("option "+a+" must be "+n,cU.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new cU("Unknown option "+a,cU.ERR_BAD_OPTION)}},validators:YU};const ej=ZU.validators;class tj{constructor(e){this.defaults=e,this.interceptors={request:new EU,response:new EU}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=$U(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;let a;void 0!==n&&ZU.assertOptions(n,{silentJSONParsing:ej.transitional(ej.boolean),forcedJSONParsing:ej.transitional(ej.boolean),clarifyTimeoutError:ej.transitional(ej.boolean)},!1),null!=r&&(uU.isFunction(r)?t.paramsSerializer={serialize:r}:ZU.assertOptions(r,{encode:ej.function,serialize:ej.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase(),a=i&&uU.merge(i.common,i[t.method]),a&&uU.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=BU.concat(a,i);const o=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));const u=[];let c;this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)}));let f,d=0;if(!s){const e=[WU.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,u),f=e.length,c=Promise.resolve(t);d<f;)c=c.then(e[d++],e[d++]);return c}f=o.length;let l=t;for(d=0;d<f;){const e=o[d++],t=o[d++];try{l=e(l)}catch(e){t.call(this,e);break}}try{c=WU.call(this,l)}catch(e){return Promise.reject(e)}for(d=0,f=u.length;d<f;)c=c.then(u[d++],u[d++]);return c}getUri(e){return _U(jU((e=$U(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}uU.forEach(["delete","get","head","options"],(function(e){tj.prototype[e]=function(t,n){return this.request($U(n||{},{method:e,url:t,data:(n||{}).data}))}})),uU.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,i){return this.request($U(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}tj.prototype[e]=t(),tj.prototype[e+"Form"]=t(!0)}));var nj=tj;class rj{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,i){n.reason||(n.reason=new LU(e,r,i),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;const t=new rj((function(t){e=t}));return{token:t,cancel:e}}}var ij=rj;const aj={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(aj).forEach((([e,t])=>{aj[t]=e}));var oj=aj;const sj=function e(t){const n=new nj(t),r=xL(nj.prototype.request,n);return uU.extend(r,nj.prototype,n,{allOwnKeys:!0}),uU.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e($U(t,n))},r}(OU);sj.Axios=nj,sj.CanceledError=LU,sj.CancelToken=ij,sj.isCancel=FU,sj.VERSION=JU,sj.toFormData=mU,sj.AxiosError=cU,sj.Cancel=sj.CanceledError,sj.all=function(e){return Promise.all(e)},sj.spread=function(e){return function(t){return e.apply(null,t)}},sj.isAxiosError=function(e){return uU.isObject(e)&&!0===e.isAxiosError},sj.mergeConfig=$U,sj.AxiosHeaders=BU,sj.formToJSON=e=>RU(uU.isHTMLForm(e)?new FormData(e):e),sj.HttpStatusCode=oj,sj.default=sj;var uj=sj;const cj="https://guardian.sandbox.imtbl.com".replace(/\/+$/,"");class fj{basePath;axios;configuration;constructor(e,t=cj,n=uj){this.basePath=t,this.axios=n,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}}class dj extends Error{field;constructor(e,t){super(t),this.field=e,this.name="RequiredError"}}const lj="https://example.com",pj=function(e,t,n){if(null==n)throw new dj(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},hj=async function(e,t){if(t&&t.accessToken){const n="function"==typeof t.accessToken?await t.accessToken():await t.accessToken;e.Authorization="Bearer "+n}};function bj(e,t,n=""){null!=t&&("object"==typeof t?Array.isArray(t)?t.forEach((t=>bj(e,t,n))):Object.keys(t).forEach((r=>bj(e,t[r],`${n}${""!==n?".":""}${r}`))):e.has(n)?e.append(n,t):e.set(n,t))}const mj=function(e,...t){const n=new URLSearchParams(e.search);bj(n,t),e.search=n.toString()},yj=function(e,t,n){const r="string"!=typeof e;return(r&&n&&n.isJsonMime?n.isJsonMime(t.headers["Content-Type"]):r)?JSON.stringify(void 0!==e?e:{}):e||""},gj=function(e){return e.pathname+e.search+e.hash},vj=function(e,t,n,r){return(i=t,a=n)=>{const o={...e.options,url:(r?.basePath||a)+e.url};return i.request(o)}},wj=function(e){const t=function(e){return{approvePendingTransaction:async(t,n,r={})=>{pj("approvePendingTransaction","payloadHash",t),pj("approvePendingTransaction","transactionApprovalRequest",n);const i="/guardian/v1/transactions/{payloadHash}/approve".replace("{payloadHash}",encodeURIComponent(String(t))),a=new URL(i,lj);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...r},u={};await hj(u,e),u["Content-Type"]="application/json",mj(a,{});let c=o&&o.headers?o.headers:{};return s.headers={...u,...c,...r.headers},s.data=yj(n,s,e),{url:gj(a),options:s}},evaluateTransaction:async(t,n,r={})=>{pj("evaluateTransaction","id",t),pj("evaluateTransaction","transactionEvaluationRequest",n);const i="/guardian/v1/transactions/{id}/evaluate".replace("{id}",encodeURIComponent(String(t))),a=new URL(i,lj);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...r},u={};await hj(u,e),u["Content-Type"]="application/json",mj(a,{});let c=o&&o.headers?o.headers:{};return s.headers={...u,...c,...r.headers},s.data=yj(n,s,e),{url:gj(a),options:s}},getTransactionByID:async(t,n,r,i={})=>{pj("getTransactionByID","transactionID",t),pj("getTransactionByID","chainType",n);const a="/guardian/v1/transactions/{transactionID}".replace("{transactionID}",encodeURIComponent(String(t))),o=new URL(a,lj);let s;e&&(s=e.baseOptions);const u={method:"GET",...s,...i},c={},f={};await hj(c,e),void 0!==n&&(f.chainType=n),void 0!==r&&(f.chainID=r),mj(o,f);let d=s&&s.headers?s.headers:{};return u.headers={...c,...d,...i.headers},{url:gj(o),options:u}}}}(e);return{async approvePendingTransaction(n,r,i){const a=await t.approvePendingTransaction(n,r,i);return vj(a,uj,cj,e)},async evaluateTransaction(n,r,i){const a=await t.evaluateTransaction(n,r,i);return vj(a,uj,cj,e)},async getTransactionByID(n,r,i,a){const o=await t.getTransactionByID(n,r,i,a);return vj(o,uj,cj,e)}}};class _j extends fj{approvePendingTransaction(e,t){return wj(this.configuration).approvePendingTransaction(e.payloadHash,e.transactionApprovalRequest,t).then((e=>e(this.axios,this.basePath)))}evaluateTransaction(e,t){return wj(this.configuration).evaluateTransaction(e.id,e.transactionEvaluationRequest,t).then((e=>e(this.axios,this.basePath)))}getTransactionByID(e,t){return wj(this.configuration).getTransactionByID(e.transactionID,e.chainType,e.chainID,t).then((e=>e(this.axios,this.basePath)))}}class Ej{apiKey;username;password;accessToken;basePath;baseOptions;formDataCtor;constructor(e={}){this.apiKey=e.apiKey,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.baseOptions=e.baseOptions,this.formDataCtor=e.formDataCtor}isJsonMime(e){const t=new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$","i");return null!==e&&(t.test(e)||"application/json-patch+json"===e.toLowerCase())}}const Tj="starkex",Aj="evm";function Rj(e){const t=-1!==new Fn(e,16).cmp(new Fn(27))?new Fn(e,16).sub(new Fn(27)).toNumber():new Fn(e,16).toNumber();return e.trim()?t:void 0}async function Sj(e,t){const n=function(e,t=64){const n=nm(e);return{r:new Fn(n.substring(0,t),"hex"),s:new Fn(n.substring(t,2*t),"hex"),recoveryParam:Rj(n.substring(2*t,2*t+2))}}(await t.signMessage(e));return im(em((r=n).r.toString(16),64)+em(r.s.toString(16),64)+em(r.recoveryParam?.toString(16)||"",2));var r}function kj(e){switch(e.type){case"ERC721":return{type:"ERC721",data:{token_id:e.tokenId,token_address:e.tokenAddress}};case"ERC20":return{type:"ERC20",data:{token_address:e.tokenAddress}};default:return{type:"ETH",data:{decimals:18}}}}const Oj={erc1271:Object.freeze({__proto__:null,abi:[{type:"function",name:"isValidSignature",constant:!0,inputs:[{type:"bytes32"},{type:"bytes"}],outputs:[{type:"bytes4"}],payable:!1,stateMutability:"view"}],returns:{isValidSignatureBytes32:"0x1626ba7e"}}),factory:Object.freeze({__proto__:null,abi:[{type:"function",name:"deploy",constant:!1,inputs:[{type:"address"},{type:"bytes32"}],outputs:[],payable:!0,stateMutability:"payable"}]}),mainModule:Object.freeze({__proto__:null,abi:[{type:"function",name:"nonce",constant:!0,inputs:[],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"readNonce",constant:!0,inputs:[{type:"uint256"}],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"updateImplementation",constant:!1,inputs:[{type:"address"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"selfExecute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"execute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"},{type:"uint256"},{type:"bytes"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"createContract",inputs:[{type:"bytes"}],payable:!0,stateMutability:"payable"}]}),mainModuleUpgradable:Object.freeze({__proto__:null,abi:[{type:"function",name:"updateImageHash",constant:!0,inputs:[{type:"bytes32"}],outputs:[],payable:!1,stateMutability:"view"},{type:"function",name:"imageHash",constant:!0,inputs:[],outputs:[{type:"bytes32"}],payable:!1,stateMutability:"view"}]}),sequenceUtils:Object.freeze({__proto__:null,abi:[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_mainModule",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"bytes32",name:"_imageHash",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"_threshold",type:"uint256"},{indexed:!1,internalType:"bytes",name:"_signers",type:"bytes"}],name:"RequiredConfig",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"address",name:"_signer",type:"address"}],name:"RequiredSigner",type:"event"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callBalanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callBlockNumber",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_i",type:"uint256"}],name:"callBlockhash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"callChainId",outputs:[{internalType:"uint256",name:"id",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCode",outputs:[{internalType:"bytes",name:"code",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeHash",outputs:[{internalType:"bytes32",name:"codeHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeSize",outputs:[{internalType:"uint256",name:"size",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callCoinbase",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callDifficulty",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLeft",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLimit",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callOrigin",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callTimestamp",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"knownImageHashes",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"lastImageHashUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastSignerUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastWalletUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"bool",name:"delegateCall",type:"bool"},{internalType:"bool",name:"revertOnError",type:"bool"},{internalType:"uint256",name:"gasLimit",type:"uint256"},{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],internalType:"struct IModuleCalls.Transaction[]",name:"_txs",type:"tuple[]"}],name:"multiCall",outputs:[{internalType:"bool[]",name:"_successes",type:"bool[]"},{internalType:"bytes[]",name:"_results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_threshold",type:"uint256"},{components:[{internalType:"uint256",name:"weight",type:"uint256"},{internalType:"address",name:"signer",type:"address"}],internalType:"struct RequireUtils.Member[]",name:"_members",type:"tuple[]"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishConfig",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"uint256",name:"_sizeMembers",type:"uint256"},{internalType:"bytes",name:"_signature",type:"bytes"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishInitialSigners",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_nonce",type:"uint256"}],name:"requireMinNonce",outputs:[],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_expiration",type:"uint256"}],name:"requireNonExpired",outputs:[],stateMutability:"view",type:"function"}]}),requireFreshSigner:Object.freeze({__proto__:null,abi:[{inputs:[{internalType:"address",name:"",type:"address"}],name:"requireFreshSigner",outputs:[],stateMutability:"nonpayable",type:"function"}]})};function Ij(){return Ij=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ij.apply(this,arguments)}var xj;!function(e){e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.DISABLED=5]="DISABLED"}(xj||(xj={}));function Cj(e,t){return function(...n){const r=Array.prototype.slice.call(n);return new Promise((async(n,i)=>{try{r.push(((e,t)=>e?i(e):n(t))),await e.apply(t,r)}catch(e){i(e)}}))}}new class{constructor(e){this.config=e,this.logLevel=void 0,this.configure(e)}configure(e){switch(this.config=Ij({},this.config,e),this.config.logLevel){case"DEBUG":this.logLevel=xj.DEBUG;break;case"INFO":default:this.logLevel=xj.INFO;break;case"WARN":this.logLevel=xj.WARN;break;case"ERROR":this.logLevel=xj.ERROR;break;case"DISABLED":this.logLevel=xj.DISABLED}void 0===this.config.silence&&(this.config.silence=!1)}debug(e,...t){!0!==this.config.silence&&this.logLevel===xj.DEBUG&&console.log(e,...t)}info(e,...t){!0!==this.config.silence&&this.logLevel<=xj.INFO&&console.log(e,...t)}warn(e,...t){!0!==this.config.silence&&this.logLevel<=xj.WARN&&(console.warn(e,...t),this.config.onwarn&&this.config.onwarn(e,t))}error(e,...t){!0!==this.config.silence&&this.logLevel<=xj.ERROR&&(console.error(e,...t),this.config.onerror&&this.config.onerror(e,t))}}({logLevel:"INFO",silence:!0});const Mj=(e=0,t=Number.MAX_SAFE_INTEGER)=>(e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e);function Nj(){return Nj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nj.apply(this,arguments)}const Pj=(e,t=!1)=>(((e,t=!1,n=!1)=>{if(!e)throw new Error("invalid network config: empty config");const r=[];if(Array.isArray(e)?r.push(...e):r.push(e),0===r.length){if(t)throw new Error("invalid network config: empty config");return!1}const i=r.map((e=>e.chainId)).sort(),a=i.filter(((e,t)=>i.indexOf(e)!==t));if(a.length>0){if(t)throw new Error(`invalid network config: duplicate chainIds ${a}`);return!1}r.forEach((e=>e.name=e.name.toLowerCase()));const o=r.map((e=>e.name)).sort(),s=o.filter(((e,t)=>o.indexOf(e)!==t));if(s.length>0){if(t)throw new Error(`invalid network config: duplicate network names ${s}`);return!1}let u=!1,c=!1;for(let e=0;e<r.length;e++){const i=r[e];if(!(i.rpcUrl&&""!==i.rpcUrl||i.provider)){if(t)throw new Error(`invalid network config for chainId ${i.chainId}: rpcUrl or provider must be provided`);return!1}if(!n&&!i.relayer){if(t)throw new Error(`invalid network config for chainId ${i.chainId}: relayer must be provided`);return!1}if(i.isDefaultChain){if(u){if(t)throw new Error(`invalid network config for chainId ${i.chainId}: DefaultChain is already set by another config`);return!1}u=!0}if(i.isAuthChain){if(c&&t)throw new Error(`invalid network config for chainId ${i.chainId}: AuthChain is already set by another config`);c=!0}}if(!u){if(t)throw new Error("invalid network config: DefaultChain must be set");return!1}if(!c){if(t)throw new Error("invalid network config: AuthChain must be set");return!1}})(e,!0,t),e),Bj=e=>Pj(Dj(e)),Dj=e=>{if(!e)return[];const t=e.sort(((e,t)=>e.chainId===t.chainId?0:e.chainId<t.chainId?-1:1)),n=t.findIndex((e=>e.isDefaultChain));n>0&&t.splice(0,0,t.splice(n,1)[0]);const r=t.findIndex((e=>e.isAuthChain&&!0!==e.isDefaultChain));return r>0&&t.splice(1,0,t.splice(r,1)[0]),t},Fj=(e,t)=>"string"==typeof e?(t=t||{},e.replace(/\$\{\s*([$#@\-\d\w]+)\s*\}/gim,(function(e,n){let r=t[n];return r="function"==typeof r?r():null==r?"":"object"==typeof r||"symbol"==typeof r?r.toString():r.valueOf(),r}))):"";let Lj;!function(e){e[e.MAINNET=1]="MAINNET",e[e.ROPSTEN=3]="ROPSTEN",e[e.RINKEBY=4]="RINKEBY",e[e.GOERLI=5]="GOERLI",e[e.KOVAN=42]="KOVAN",e[e.POLYGON=137]="POLYGON",e[e.POLYGON_MUMBAI=80001]="POLYGON_MUMBAI",e[e.POLYGON_ZKEVM=1101]="POLYGON_ZKEVM",e[e.BSC=56]="BSC",e[e.BSC_TESTNET=97]="BSC_TESTNET",e[e.OPTIMISM=10]="OPTIMISM",e[e.OPTIMISM_TESTNET=69]="OPTIMISM_TESTNET",e[e.ARBITRUM=42161]="ARBITRUM",e[e.ARBITRUM_GOERLI=421613]="ARBITRUM_GOERLI",e[e.ARBITRUM_NOVA=42170]="ARBITRUM_NOVA",e[e.AVALANCHE=43114]="AVALANCHE",e[e.AVALANCHE_TESTNET=43113]="AVALANCHE_TESTNET",e[e.FANTOM=250]="FANTOM",e[e.FANTOM_TESTNET=4002]="FANTOM_TESTNET",e[e.GNOSIS=100]="GNOSIS",e[e.AURORA=1313161554]="AURORA",e[e.AURORA_TESTNET=1313161556]="AURORA_TESTNET",e[e.BASE_GOERLI=84531]="BASE_GOERLI"}(Lj||(Lj={}));const Uj=e=>Fj("https://${network}-indexer.sequence.app",{network:e}),jj=e=>Fj("https://${network}-relayer.sequence.app",{network:e}),qj=e=>Fj("https://nodes.sequence.app/${network}",{network:e}),zj={[Lj.MAINNET]:{chainId:Lj.MAINNET,name:"mainnet",title:"Ethereum",blockExplorer:{name:"Etherscan",rootUrl:"https://etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},[Lj.ROPSTEN]:{chainId:Lj.ROPSTEN,name:"ropsten",title:"Ropsten",testnet:!0,blockExplorer:{name:"Etherscan (Ropsten)",rootUrl:"https://ropsten.etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},[Lj.RINKEBY]:{chainId:Lj.RINKEBY,name:"rinkeby",title:"Rinkeby",testnet:!0,blockExplorer:{name:"Etherscan (Rinkeby)",rootUrl:"https://rinkeby.etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",disabled:!0},[Lj.GOERLI]:{chainId:Lj.GOERLI,name:"goerli",title:"Goerli",testnet:!0,blockExplorer:{name:"Etherscan (Goerli)",rootUrl:"https://goerli.etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},[Lj.KOVAN]:{chainId:Lj.KOVAN,name:"kovan",title:"Kovan",testnet:!0,blockExplorer:{name:"Etherscan (Kovan)",rootUrl:"https://kovan.etherscan.io/"}},[Lj.POLYGON]:{chainId:Lj.POLYGON,name:"polygon",title:"Polygon",blockExplorer:{name:"Polygonscan",rootUrl:"https://polygonscan.com/"}},[Lj.POLYGON_MUMBAI]:{chainId:Lj.POLYGON_MUMBAI,name:"mumbai",title:"Polygon Mumbai",testnet:!0,blockExplorer:{name:"Polygonscan (Mumbai)",rootUrl:"https://mumbai.polygonscan.com/"}},[Lj.POLYGON_ZKEVM]:{chainId:Lj.POLYGON_ZKEVM,name:"polygon-zkevm",title:"Polygon zkEVM",blockExplorer:{name:"Polygonscan (zkEVM)",rootUrl:"https://zkevm.polygonscan.com/"}},[Lj.BSC]:{chainId:Lj.BSC,name:"bsc",title:"BNB Smart Chain",blockExplorer:{name:"BSCScan",rootUrl:"https://bscscan.com/"}},[Lj.BSC_TESTNET]:{chainId:Lj.BSC_TESTNET,name:"bsc-testnet",title:"BNB Smart Chain Testnet",testnet:!0,blockExplorer:{name:"BSCScan (Testnet)",rootUrl:"https://testnet.bscscan.com/"}},[Lj.OPTIMISM]:{chainId:Lj.OPTIMISM,name:"optimism",title:"Optimism",blockExplorer:{name:"Etherscan (Optimism)",rootUrl:"https://optimistic.etherscan.io/"}},[Lj.OPTIMISM_TESTNET]:{chainId:Lj.OPTIMISM_TESTNET,name:"optimism-testnet",title:"Optimistic Kovan",testnet:!0,blockExplorer:{name:"Etherscan (Optimism Testnet)",rootUrl:"https://kovan-optimistic.etherscan.io/"}},[Lj.ARBITRUM]:{chainId:Lj.ARBITRUM,name:"arbitrum",title:"Arbitrum One",blockExplorer:{name:"Arbiscan",rootUrl:"https://arbiscan.io/"}},[Lj.ARBITRUM_GOERLI]:{chainId:Lj.ARBITRUM_GOERLI,name:"arbitrum-goerli",title:"Arbitrum Goerli",testnet:!0,blockExplorer:{name:"Arbiscan (Testnet)",rootUrl:"https://testnet.arbiscan.io/"}},[Lj.ARBITRUM_NOVA]:{chainId:Lj.ARBITRUM_NOVA,name:"arbitrum-nova",title:"Arbitrum Nova",blockExplorer:{name:"Nova Explorer",rootUrl:"https://nova-explorer.arbitrum.io/"}},[Lj.AVALANCHE]:{chainId:Lj.AVALANCHE,name:"avalanche",title:"Avalanche",blockExplorer:{name:"Snowtrace",rootUrl:"https://snowtrace.io/"}},[Lj.AVALANCHE_TESTNET]:{chainId:Lj.AVALANCHE_TESTNET,name:"avalanche-testnet",title:"Avalanche Testnet",testnet:!0,blockExplorer:{name:"Snowtrace (Testnet)",rootUrl:"https://testnet.snowtrace.io/"}},[Lj.FANTOM]:{chainId:Lj.FANTOM,name:"fantom",title:"Fantom",blockExplorer:{name:"FTMScan",rootUrl:"https://ftmscan.com/"}},[Lj.FANTOM_TESTNET]:{chainId:Lj.FANTOM_TESTNET,name:"fantom-testnet",title:"Fantom Testnet",testnet:!0,blockExplorer:{name:"FTMScan (Testnet)",rootUrl:"https://testnet.ftmscan.com/"}},[Lj.GNOSIS]:{chainId:Lj.GNOSIS,name:"gnosis",title:"Gnosis Chain",blockExplorer:{name:"Gnosis Chain Explorer",rootUrl:"https://blockscout.com/xdai/mainnet/"}},[Lj.AURORA]:{chainId:Lj.AURORA,name:"aurora",title:"Aurora",blockExplorer:{name:"Aurora Explorer",rootUrl:"https://aurorascan.dev/"}},[Lj.AURORA_TESTNET]:{chainId:Lj.AURORA_TESTNET,name:"aurora-testnet",title:"Aurora Testnet",blockExplorer:{name:"Aurora Explorer (Testnet)",rootUrl:"https://testnet.aurorascan.dev/"}},[Lj.BASE_GOERLI]:{chainId:Lj.BASE_GOERLI,name:"base-goerli",title:"Base Goerli",blockExplorer:{name:"Base Goerli Explorer",rootUrl:"https://goerli.basescan.org/"}}};Bj([Nj({},zj[Lj.MAINNET],{rpcUrl:qj("mainnet"),relayer:{url:jj("mainnet")},indexerUrl:Uj("mainnet")}),Nj({},zj[Lj.POLYGON],{rpcUrl:qj("polygon"),relayer:{url:jj("polygon")},indexerUrl:Uj("polygon"),isDefaultChain:!0,isAuthChain:!0}),Nj({},zj[Lj.BSC],{rpcUrl:qj("bsc"),indexerUrl:Uj("bsc"),relayer:{url:jj("bsc")}}),Nj({},zj[Lj.AVALANCHE],{rpcUrl:qj("avalanche"),indexerUrl:Uj("avalanche"),relayer:{url:jj("avalanche")}}),Nj({},zj[Lj.ARBITRUM],{rpcUrl:qj("arbitrum"),indexerUrl:Uj("arbitrum"),relayer:{url:jj("arbitrum")}}),Nj({},zj[Lj.ARBITRUM_NOVA],{rpcUrl:qj("arbitrum-nova"),indexerUrl:Uj("arbitrum-nova"),relayer:{url:jj("arbitrum-nova")}}),Nj({},zj[Lj.OPTIMISM],{rpcUrl:qj("optimism"),indexerUrl:Uj("optimism"),relayer:{url:jj("optimism")}}),Nj({},zj[Lj.POLYGON_ZKEVM],{rpcUrl:qj("polygon-zkevm"),indexerUrl:Uj("polygon-zkevm"),relayer:{url:jj("polygon-zkevm")}}),Nj({},zj[Lj.GNOSIS],{rpcUrl:qj("gnosis"),indexerUrl:Uj("gnosis"),relayer:{url:jj("gnosis")}})]),Bj([Nj({},zj[Lj.RINKEBY],{rpcUrl:qj("rinkeby"),relayer:{url:jj("rinkeby")},indexerUrl:Uj("rinkeby")}),Nj({},zj[Lj.GOERLI],{rpcUrl:qj("goerli"),relayer:{url:jj("goerli")},indexerUrl:Uj("goerli")}),Nj({},zj[Lj.POLYGON_MUMBAI],{rpcUrl:qj("mumbai"),relayer:{url:jj("mumbai")},indexerUrl:Uj("mumbai"),isDefaultChain:!0,isAuthChain:!0}),Nj({},zj[Lj.BSC_TESTNET],{rpcUrl:qj("bsc-testnet"),relayer:{url:jj("bsc-testnet")},indexerUrl:Uj("bsc-testnet")}),Nj({},zj[Lj.ARBITRUM_GOERLI],{rpcUrl:qj("arbitrum-goerli"),relayer:{url:jj("arbitrum-goerli")},indexerUrl:Uj("arbitrum-goerli")}),Nj({},zj[Lj.BASE_GOERLI],{rpcUrl:qj("base-goerli"),relayer:{url:jj("base-goerli")},indexerUrl:Uj("base-goerli")})]);const Hj="2.0";function Vj(){return Vj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vj.apply(this,arguments)}let Gj;function Kj(e,t){return e.reduce((function(e,n,r){return t(n,r)?e[0].push(n):e[1].push(n),e}),[[],[]])}!function(e){e.ethCall="eth_call",e.ethGetBalance="eth_getBalance",e.ethGetCode="eth_getCode"}(Gj||(Gj={}));const Wj={batchSize:50,timeWindow:50,contract:"0xd130B43062D875a4B7aF3f8fc036Bc6e9D3E1B3E",verbose:!1};let Xj=class e{constructor(t){var n=this;if(this.batchableJsonRpcMethods=[Gj.ethCall,Gj.ethGetCode,Gj.ethGetBalance],this.multicallInterface=new os(Oj.sequenceUtils.abi),this.options=void 0,this.timeout=void 0,this.queue=[],this.scheduleExecution=()=>{this.queue.length>0&&(this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(this.run,this.options.timeWindow))},this.handle=(e,t,n)=>this.batchableJsonRpcMethods.find((e=>e===t.method))?(this.queue.push({request:t,callback:n,next:e}),this.options.verbose&&console.log("Scheduling call",t.method),void this.scheduleExecution()):(this.options.verbose&&console.log("Forwarded call",t.method),e(t,n)),this.run=async function(){n.options.verbose&&console.log("Processing multicall");const e=Math.min(n.options.batchSize,n.queue.length);if(0===e)return;if(1===e)return n.forward(n.queue[0]),n.queue=[],void(n.options.verbose&&console.log("Skip multicall, single item"));n.options.verbose&&console.log("Resolving",e);var t=n.queue.slice(0,e);n.queue=e===n.queue.length?[]:n.queue.slice(e),n.options.verbose&&console.log("Updated queue",n.queue.length),0!==n.queue.length&&n.scheduleExecution();const r=t[0].next;let i;var[t,a]=Kj(t,(e=>{try{if(e.next!==r)return!1;switch(e.request.method){case Gj.ethCall:if(e.request.params[0].from||e.request.params[0].gasPrice||e.request.params[0].value)return!1;case Gj.ethGetBalance:case Gj.ethGetCode:const t=function(e){if(void 0===e)return"latest";switch(e){case"earliest":case"latest":case"pending":return e}return Tr.from(e)}(e.request.params[1]);if(void 0===i&&(i=t),!function(e,t){return e===t||(Tr.isBigNumber(e)?!!Tr.isBigNumber(t)&&e.eq(t):!Tr.isBigNumber(t)&&e===t)}(t,i))return!1}return!0}catch(e){return!1}}));if(0!==a.length&&(n.options.verbose&&console.log("Forwarding incompatible calls",a.length),n.forward(a),0===t.length))return;let o=t.map((e=>{try{switch(e.request.method){case Gj.ethCall:return{delegateCall:!1,revertOnError:!1,target:e.request.params[0].to,data:e.request.params[0].data,gasLimit:e.request.params[0].gas?e.request.params[0].gas:0,value:0};case Gj.ethGetCode:return{delegateCall:!1,revertOnError:!1,target:n.options.contract,gasLimit:0,value:0,data:n.multicallInterface.encodeFunctionData(n.multicallInterface.getFunction("callCode"),[e.request.params[0]])};case Gj.ethGetBalance:return{delegateCall:!1,revertOnError:!1,target:n.options.contract,gasLimit:0,value:0,data:n.multicallInterface.encodeFunctionData(n.multicallInterface.getFunction("callBalanceOf"),[e.request.params[0]])};default:return null}}catch(e){return null}}));var[t,a]=Kj(t,((e,t)=>void 0!==o[t]));if(o=o.filter((e=>e)),0!==a.length&&(n.options.verbose&&console.log("Forwarding calls on error",a.length),n.forward(a),0===t.length))return;let s;try{s=n.multicallInterface.encodeFunctionData(n.multicallInterface.getFunction("multiCall"),[o])}catch(e){return void n.forward(t)}const u=Mj(),c=await async function(e,t){try{return await e}catch(e){return t instanceof Function?t(e):t}}(Cj(r)({id:u,jsonrpc:Hj,method:Gj.ethCall,params:[{to:n.options.contract,value:0,data:s},Tr.isBigNumber(i)?i.toNumber():i]}),(e=>({jsonrpc:Hj,id:u,result:void 0,error:e})));if(c.error)return n.forward(t);let f;try{f=n.multicallInterface.decodeFunctionResult(n.multicallInterface.getFunction("multiCall"),c.result)}catch(e){return void n.forward(t)}n.options.verbose&&console.log("Got response for",t.length),t.forEach(((e,t)=>{if(f[0][t])switch(e.request.method){case Gj.ethCall:e.callback(void 0,{jsonrpc:e.request.jsonrpc,id:e.request.id,result:f[1][t]});break;case Gj.ethGetCode:e.callback(void 0,{jsonrpc:e.request.jsonrpc,id:e.request.id,result:Za.decode(["bytes"],f[1][t])[0]});break;case Gj.ethGetBalance:e.callback(void 0,{jsonrpc:e.request.jsonrpc,id:e.request.id,result:Za.decode(["uint256"],f[1][t])[0]})}else n.forward(e)}))},this.options=t?Vj({},e.DefaultOptions,t):e.DefaultOptions,this.options.batchSize<=0)throw new Error(`Invalid batch size of ${this.options.batchSize}`)}forward(e){Array.isArray(e)?e.forEach((e=>e.next(e.request,e.callback))):e.next(e.request,e.callback)}static isMulticall(t){return t&&void 0!==t.handle&&void 0!==t.conf&&e.isMulticallOptions(t.options)}static isMulticallOptions(e){return void 0!==e&&void 0!==e.batchSize&&void 0!==e.timeWindow&&void 0!==e.contract}};Xj.DefaultOptions=Vj({},Wj);const $j=["getNetwork","getBlockNumber","getGasPrice","getTransactionCount","getStorageAt","sendTransaction","estimateGas","getBlock","getTransaction","getTransactionReceipt","getLogs","emit","litenerCount","addListener","removeListener","waitForTransaction","detectNetwork","getBlockWithTransactions"];var Jj=Object.freeze({__proto__:null,ProxyMethods:$j,MulticallProvider:class extends gp{constructor(e,t){var n;super(e.getNetwork()),n=this,this.provider=e,this.multicall=void 0,this.listenerCount=this.provider.listenerCount,this.getResolver=async function(e){const t=n.provider;if(t.getResolver){const r=await t.getResolver(await e);return r?new bp(n,r.address,r.name):null}return t.getResolver(await e)},this.next=async function(e,t){try{switch(e.method){case Gj.ethCall:n.callback(e,t,await n.provider.call(e.params[0],e.params[1]));break;case Gj.ethGetCode:n.callback(e,t,await n.provider.getCode(e.params[0],e.params[1]));break;case Gj.ethGetBalance:n.callback(e,t,await n.provider.getBalance(e.params[0],e.params[1]))}}catch(r){n.callback(e,t,void 0,r)}},this.multicall=Xj.isMulticall(t)?t:new Xj(t),$j.forEach((t=>{void 0!==e[t]&&(this[t]=(...n)=>e[t](...n))}))}callback(e,t,n,r){t(r,{jsonrpc:Hj,id:e.id,result:n,error:r})}async call(e,t){return this.rpcCall(Gj.ethCall,e,t)}async getCode(e,t){return this.rpcCall(Gj.ethGetCode,e,t)}async getBalance(e,t){return this.rpcCall(Gj.ethGetBalance,e,t)}async rpcCall(e,...t){const n=Mj();return(await Cj(this.multicall.handle)(this.next,{jsonrpc:Hj,id:n,method:e,params:t})).result}},MulticallExternalProvider:class{constructor(e,t){if(this.provider=e,this.multicall=void 0,this.multicall=Xj.isMulticall(t)?t:new Xj(t),e.send){const t=async function(t,n){e.send(t,n)};this.send=(e,n)=>{this.multicall.handle(t,e,n)}}if(e.sendAsync){const t=async function(t,n){e.sendAsync(t,n)};this.sendAsync=(e,n)=>{this.multicall.handle(t,e,n)}}}get isMetaMask(){return this.provider.isMetaMask}get isStatus(){return this.provider.isStatus}},multicallMiddleware:e=>t=>{const n=Xj.isMulticall(e)?e:new Xj(e);return(e,r)=>n.handle(t,e,r)}}),Yj=Object.freeze({__proto__:null,Multicall:Xj,providers:Jj});let Qj,Zj;try{Qj=localStorage}catch(e){const t=new Map;Qj={getItem:e=>{var n;return null!=(n=t.get(e))?n:null},setItem:(e,n)=>t.set(e,n),removeItem:e=>t.delete(e)}}function eq(e){return void 0!==e.address&&!function(e){return tq(e)||nq(e)||rq(e)}(e)}function tq(e){const t=e;return void 0!==t.signature&&void 0===t.address}function nq(e){const t=e;return void 0!==t.r&&void 0!==t.s&&void 0!==t.v&&void 0!==t.t}function rq(e){const t=e;return void 0!==t.address&&void 0!==t.signature}!function(e){e[e.EOA=0]="EOA",e[e.Address=1]="Address",e[e.Full=2]="Full"}(Zj||(Zj={}));const iq=e=>{if("string"==typeof e)return iq((e=>{if("string"!=typeof e)return e;const t=e.replace("0x",""),n=Tr.from(`0x${t.slice(0,4)}`).toNumber(),r=[];for(let e=4;e<t.length;){const n=Tr.from(t.slice(e,e+2)).toNumber();e+=2;const i=Tr.from(`0x${t.slice(e,e+2)}`).toNumber();switch(e+=2,n){case Zj.Address:const n=Ki(t.slice(e,e+40));e+=40,r.push({weight:i,address:n});break;case Zj.EOA:const a=tr(`0x${t.slice(e,e+132)}`);e+=132;const o=hr(a.slice(0,65)),s=o.r,u=o.s,c=o.v,f=Tr.from(a[a.length-1]).toNumber();r.push({weight:i,signature:a,r:s,s:u,v:c,t:f});break;case Zj.Full:const d=Ki(t.slice(e,e+40));e+=40;const l=Tr.from(`0x${t.slice(e,e+4)}`).mul(2).toNumber();e+=4;const p=tr(`0x${t.slice(e,e+l)}`);e+=l,r.push({weight:i,address:d,signature:p});break;default:throw Error("Signature type not supported")}}return{threshold:n,signers:r}})(e));const t=e.signers.map((e=>{if(eq(e))return Hh(["uint8","uint8","address"],[Zj.Address,e.weight,e.address]);if(nq(e))return Hh(["uint8","uint8","bytes32","bytes32","uint8","uint8"],[Zj.EOA,e.weight,e.r,e.s,e.v,e.t]);if(rq(e)){const t=tr(e.signature).length;return Hh(["uint8","uint8","address","uint16","bytes"],[Zj.Full,e.weight,e.address,t,e.signature])}if(tq(e))return Hh(["uint8","uint8","bytes"],[Zj.EOA,e.weight,e.signature]);throw Error("Unkwnown signature part type")}));return Hh(["uint16",...Array(t.length).fill("bytes")],[e.threshold,...t])};var aq;!function(e){e.AUTHENTICATION_ERROR="AUTHENTICATION_ERROR",e.INVALID_CONFIGURATION="INVALID_CONFIGURATION",e.WALLET_CONNECTION_ERROR="WALLET_CONNECTION_ERROR",e.NOT_LOGGED_IN_ERROR="NOT_LOGGED_IN_ERROR",e.SILENT_LOGIN_ERROR="SILENT_LOGIN_ERROR",e.REFRESH_TOKEN_ERROR="REFRESH_TOKEN_ERROR",e.USER_REGISTRATION_ERROR="USER_REGISTRATION_ERROR",e.LOGOUT_ERROR="LOGOUT_ERROR",e.TRANSFER_ERROR="TRANSFER_ERROR",e.CREATE_ORDER_ERROR="CREATE_ORDER_ERROR",e.CANCEL_ORDER_ERROR="CANCEL_ORDER_ERROR",e.EXCHANGE_TRANSFER_ERROR="EXCHANGE_TRANSFER_ERROR",e.CREATE_TRADE_ERROR="CREATE_TRADE_ERROR",e.OPERATION_NOT_SUPPORTED_ERROR="OPERATION_NOT_SUPPORTED_ERROR"}(aq||(aq={}));class oq extends Error{type;constructor(e,t){super(e),this.type=t}}const sq=async(e,t)=>{try{return await e()}catch(e){const n=`${t}: ${e.message}`||"UnknownError";throw new oq(n,t)}},uq="passport_credentials",cq="pkce_state",fq="pkce_verifier";class dq{saveCredentials(e){if(!this.areValid(e))throw Error("Invalid credentials.");localStorage.setItem(uq,JSON.stringify(e))}getCredentials(){const e=localStorage.getItem(uq);return e?JSON.parse(e):null}areValid(e){if(e){const t=this.isTokenValid(e.access_token),n=this.isTokenValid(e.id_token);return t&&n}return!1}isTokenValid(e){try{const t=zP(e).exp??0;return t>Date.now()/1e3+3600}catch(e){return!1}}clearCredentials(){localStorage.removeItem(uq)}savePKCEData(e){localStorage.setItem(cq,e.state),localStorage.setItem(fq,e.verifier)}getPKCEData(){const e=localStorage.getItem(cq),t=localStorage.getItem(fq);return e&&t?{state:e,verifier:t}:null}}const lq={headers:{"Content-Type":"application/x-www-form-urlencoded"}};function pq(e){return new Promise((t=>{setTimeout(t,e)}))}class hq{userManager;config;deviceCredentialsManager;logoutMode;constructor(e){this.config=e,this.userManager=new class{constructor(e){this._logger=new XP("UserManager"),this.settings=new EB(e),this._client=new class{constructor(e){this._logger=new XP("OidcClient"),this.settings=new sB(e),this.metadataService=new class{constructor(e){this._settings=e,this._logger=new XP("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new aB(["application/jwk-set+json"],null,this._settings.extraHeaders),this._settings.signingKeys&&(this._logger.debug("using signingKeys from settings"),this._signingKeys=this._settings.signingKeys),this._settings.metadata&&(this._logger.debug("using metadata from settings"),this._metadata=this._settings.metadata),this._settings.fetchRequestCredentials&&(this._logger.debug("using fetchRequestCredentials from settings"),this._fetchRequestCredentials=this._settings.fetchRequestCredentials)}resetSigningKeys(){this._signingKeys=null}async getMetadata(){const e=this._logger.create("getMetadata");if(this._metadata)return e.debug("using cached values"),this._metadata;if(!this._metadataUrl)throw e.throw(new Error("No authority or metadataUrl configured on settings")),null;e.debug("getting metadata from",this._metadataUrl);const t=await this._jsonService.getJson(this._metadataUrl,{credentials:this._fetchRequestCredentials});return e.debug("merging remote JSON with seed metadata"),this._metadata=Object.assign({},this._settings.metadataSeed,t),this._metadata}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(e=!0){return this._getMetadataProperty("token_endpoint",e)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(e=!0){return this._getMetadataProperty("revocation_endpoint",e)}getKeysEndpoint(e=!0){return this._getMetadataProperty("jwks_uri",e)}async _getMetadataProperty(e,t=!1){const n=this._logger.create(`_getMetadataProperty('${e}')`),r=await this.getMetadata();if(n.debug("resolved"),void 0===r[e]){if(!0===t)return void n.warn("Metadata does not contain optional property");n.throw(new Error("Metadata does not contain property "+e))}return r[e]}async getSigningKeys(){const e=this._logger.create("getSigningKeys");if(this._signingKeys)return e.debug("returning signingKeys from cache"),this._signingKeys;const t=await this.getKeysEndpoint(!1);e.debug("got jwks_uri",t);const n=await this._jsonService.getJson(t);if(e.debug("got key set",n),!Array.isArray(n.keys))throw e.throw(new Error("Missing keys on keyset")),null;return this._signingKeys=n.keys,this._signingKeys}}(this.settings),this._claimsService=new class{constructor(e){this._settings=e,this._logger=new XP("ClaimsService")}filterProtocolClaims(e){const t={...e};if(this._settings.filterProtocolClaims){let e;e=Array.isArray(this._settings.filterProtocolClaims)?this._settings.filterProtocolClaims:lB;for(const n of e)pB.includes(n)||delete t[n]}return t}mergeClaims(e,t){const n={...e};for(const[e,r]of Object.entries(t))for(const t of Array.isArray(r)?r:[r]){const r=n[e];r?Array.isArray(r)?r.includes(t)||r.push(t):n[e]!==t&&("object"==typeof t&&this._settings.mergeClaims?n[e]=this.mergeClaims(r,t):n[e]=[r,t]):n[e]=t}return n}}(this.settings),this._validator=new class{constructor(e,t,n){this._settings=e,this._metadataService=t,this._claimsService=n,this._logger=new XP("ResponseValidator"),this._userInfoService=new class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new XP("UserInfoService"),this._getClaimsFromJwt=async e=>{const t=this._logger.create("_getClaimsFromJwt");try{const n=YP.decode(e);return t.debug("JWT decoding successful"),n}catch(e){throw t.error("Error parsing JWT response"),e}},this._jsonService=new aB(void 0,this._getClaimsFromJwt,this._settings.extraHeaders)}async getClaims(e){const t=this._logger.create("getClaims");e||this._logger.throw(new Error("No token passed"));const n=await this._metadataService.getUserInfoEndpoint();t.debug("got userinfo url",n);const r=await this._jsonService.getJson(n,{token:e,credentials:this._settings.fetchRequestCredentials});return t.debug("got claims",r),r}}(this._settings,this._metadataService),this._tokenClient=new uB(this._settings,this._metadataService)}async validateSigninResponse(e,t){const n=this._logger.create("validateSigninResponse");this._processSigninState(e,t),n.debug("state processed"),await this._processCode(e,t),n.debug("code processed"),e.isOpenId&&this._validateIdTokenAttributes(e),n.debug("tokens validated"),await this._processClaims(e,null==t?void 0:t.skipUserInfo,e.isOpenId),n.debug("claims processed")}async validateCredentialsResponse(e,t){const n=this._logger.create("validateCredentialsResponse");e.isOpenId&&this._validateIdTokenAttributes(e),n.debug("tokens validated"),await this._processClaims(e,t,e.isOpenId),n.debug("claims processed")}async validateRefreshResponse(e,t){const n=this._logger.create("validateRefreshResponse");e.userState=t.data,null!=e.session_state||(e.session_state=t.session_state),null!=e.scope||(e.scope=t.scope),e.isOpenId&&e.id_token&&(this._validateIdTokenAttributes(e,t.id_token),n.debug("ID Token validated")),e.id_token||(e.id_token=t.id_token,e.profile=t.profile);const r=e.isOpenId&&!!e.id_token;await this._processClaims(e,!1,r),n.debug("claims processed")}validateSignoutResponse(e,t){const n=this._logger.create("validateSignoutResponse");if(t.id!==e.state&&n.throw(new Error("State does not match")),n.debug("state validated"),e.userState=t.data,e.error)throw n.warn("Response was error",e.error),new tB(e)}_processSigninState(e,t){const n=this._logger.create("_processSigninState");if(t.id!==e.state&&n.throw(new Error("State does not match")),t.client_id||n.throw(new Error("No client_id on state")),t.authority||n.throw(new Error("No authority on state")),this._settings.authority!==t.authority&&n.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==t.client_id&&n.throw(new Error("client_id mismatch on settings vs. signin state")),n.debug("state validated"),e.userState=t.data,null!=e.scope||(e.scope=t.scope),e.error)throw n.warn("Response was error",e.error),new tB(e);t.code_verifier&&!e.code&&n.throw(new Error("Expected code in response"))}async _processClaims(e,t=!1,n=!0){const r=this._logger.create("_processClaims");if(e.profile=this._claimsService.filterProtocolClaims(e.profile),t||!this._settings.loadUserInfo||!e.access_token)return void r.debug("not loading user info");r.debug("loading user info");const i=await this._userInfoService.getClaims(e.access_token);r.debug("user info claims received from user info endpoint"),n&&i.sub!==e.profile.sub&&r.throw(new Error("subject from UserInfo response does not match subject in ID Token")),e.profile=this._claimsService.mergeClaims(e.profile,this._claimsService.filterProtocolClaims(i)),r.debug("user info claims received, updated profile:",e.profile)}async _processCode(e,t){const n=this._logger.create("_processCode");if(e.code){n.debug("Validating code");const r=await this._tokenClient.exchangeCode({client_id:t.client_id,client_secret:t.client_secret,code:e.code,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier,...t.extraTokenParams});Object.assign(e,r)}else n.debug("No code to process")}_validateIdTokenAttributes(e,t){var n;const r=this._logger.create("_validateIdTokenAttributes");r.debug("decoding ID Token JWT");const i=YP.decode(null!=(n=e.id_token)?n:"");if(i.sub||r.throw(new Error("ID Token is missing a subject claim")),t){const e=YP.decode(t);i.sub!==e.sub&&r.throw(new Error("sub in id_token does not match current sub")),i.auth_time&&i.auth_time!==e.auth_time&&r.throw(new Error("auth_time in id_token does not match original auth_time")),i.azp&&i.azp!==e.azp&&r.throw(new Error("azp in id_token does not match original azp")),!i.azp&&e.azp&&r.throw(new Error("azp not in id_token, but present in original id_token"))}e.profile=i}}(this.settings,this.metadataService,this._claimsService),this._tokenClient=new uB(this.settings,this.metadataService)}async createSigninRequest({state:e,request:t,request_uri:n,request_type:r,id_token_hint:i,login_hint:a,skipUserInfo:o,nonce:s,response_type:u=this.settings.response_type,scope:c=this.settings.scope,redirect_uri:f=this.settings.redirect_uri,prompt:d=this.settings.prompt,display:l=this.settings.display,max_age:p=this.settings.max_age,ui_locales:h=this.settings.ui_locales,acr_values:b=this.settings.acr_values,resource:m=this.settings.resource,response_mode:y=this.settings.response_mode,extraQueryParams:g=this.settings.extraQueryParams,extraTokenParams:v=this.settings.extraTokenParams}){const w=this._logger.create("createSigninRequest");if("code"!==u)throw new Error("Only the Authorization Code flow (with PKCE) is supported");const _=await this.metadataService.getAuthorizationEndpoint();w.debug("Received authorization endpoint",_);const E=new class{constructor({url:e,authority:t,client_id:n,redirect_uri:r,response_type:i,scope:a,state_data:o,response_mode:s,request_type:u,client_secret:c,nonce:f,resource:d,skipUserInfo:l,extraQueryParams:p,extraTokenParams:h,disablePKCE:b,...m}){if(this._logger=new XP("SigninRequest"),!e)throw this._logger.error("ctor: No url passed"),new Error("url");if(!n)throw this._logger.error("ctor: No client_id passed"),new Error("client_id");if(!r)throw this._logger.error("ctor: No redirect_uri passed"),new Error("redirect_uri");if(!i)throw this._logger.error("ctor: No response_type passed"),new Error("response_type");if(!a)throw this._logger.error("ctor: No scope passed"),new Error("scope");if(!t)throw this._logger.error("ctor: No authority passed"),new Error("authority");this.state=new fB({data:o,request_type:u,code_verifier:!b,client_id:n,authority:t,redirect_uri:r,response_mode:s,client_secret:c,scope:a,extraTokenParams:h,skipUserInfo:l});const y=new URL(e);y.searchParams.append("client_id",n),y.searchParams.append("redirect_uri",r),y.searchParams.append("response_type",i),y.searchParams.append("scope",a),f&&y.searchParams.append("nonce",f),y.searchParams.append("state",this.state.id),this.state.code_challenge&&(y.searchParams.append("code_challenge",this.state.code_challenge),y.searchParams.append("code_challenge_method","S256")),d&&(Array.isArray(d)?d:[d]).forEach((e=>y.searchParams.append("resource",e)));for(const[e,t]of Object.entries({response_mode:s,...m,...p}))null!=t&&y.searchParams.append(e,t.toString());this.url=y.href}}({url:_,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:f,response_type:u,scope:c,state_data:e,prompt:d,display:l,max_age:p,ui_locales:h,id_token_hint:i,login_hint:a,acr_values:b,resource:m,request:t,request_uri:n,extraQueryParams:g,extraTokenParams:v,request_type:r,response_mode:y,client_secret:this.settings.client_secret,skipUserInfo:o,nonce:s,disablePKCE:this.settings.disablePKCE});await this.clearStaleState();const T=E.state;return await this.settings.stateStore.set(T.id,T.toStorageString()),E}async readSigninResponseState(e,t=!1){const n=this._logger.create("readSigninResponseState"),r=new dB(eB.readParams(e,this.settings.response_mode));if(!r.state)throw n.throw(new Error("No state in response")),null;const i=await this.settings.stateStore[t?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:fB.fromStorageString(i),response:r}}async processSigninResponse(e){const t=this._logger.create("processSigninResponse"),{state:n,response:r}=await this.readSigninResponseState(e,!0);return t.debug("received state from storage; validating response"),await this._validator.validateSigninResponse(r,n),r}async processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:n=!1,extraTokenParams:r={}}){const i=await this._tokenClient.exchangeCredentials({username:e,password:t,...r}),a=new dB(new URLSearchParams);return Object.assign(a,i),await this._validator.validateCredentialsResponse(a,n),a}async useRefreshToken({state:e,timeoutInSeconds:t}){var n;const r=this._logger.create("useRefreshToken");let i;if(void 0===this.settings.refreshTokenAllowedScope)i=e.scope;else{const t=this.settings.refreshTokenAllowedScope.split(" ");i=((null==(n=e.scope)?void 0:n.split(" "))||[]).filter((e=>t.includes(e))).join(" ")}const a=await this._tokenClient.exchangeRefreshToken({refresh_token:e.refresh_token,scope:i,timeoutInSeconds:t}),o=new dB(new URLSearchParams);return Object.assign(o,a),r.debug("validating response",o),await this._validator.validateRefreshResponse(o,{...e,scope:i}),o}async createSignoutRequest({state:e,id_token_hint:t,request_type:n,post_logout_redirect_uri:r=this.settings.post_logout_redirect_uri,extraQueryParams:i=this.settings.extraQueryParams}={}){const a=this._logger.create("createSignoutRequest"),o=await this.metadataService.getEndSessionEndpoint();if(!o)throw a.throw(new Error("No end session endpoint")),null;a.debug("Received end session endpoint",o);const s=new class{constructor({url:e,state_data:t,id_token_hint:n,post_logout_redirect_uri:r,extraQueryParams:i,request_type:a}){if(this._logger=new XP("SignoutRequest"),!e)throw this._logger.error("ctor: No url passed"),new Error("url");const o=new URL(e);n&&o.searchParams.append("id_token_hint",n),r&&(o.searchParams.append("post_logout_redirect_uri",r),t&&(this.state=new cB({data:t,request_type:a}),o.searchParams.append("state",this.state.id)));for(const[e,t]of Object.entries({...i}))null!=t&&o.searchParams.append(e,t.toString());this.url=o.href}}({url:o,id_token_hint:t,post_logout_redirect_uri:r,state_data:e,extraQueryParams:i,request_type:n});await this.clearStaleState();const u=s.state;return u&&(a.debug("Signout request has state to persist"),await this.settings.stateStore.set(u.id,u.toStorageString())),s}async readSignoutResponseState(e,t=!1){const n=this._logger.create("readSignoutResponseState"),r=new class{constructor(e){this.state=e.get("state"),this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri")}}(eB.readParams(e,this.settings.response_mode));if(!r.state){if(n.debug("No state in response"),r.error)throw n.warn("Response was error:",r.error),new tB(r);return{state:void 0,response:r}}const i=await this.settings.stateStore[t?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:cB.fromStorageString(i),response:r}}async processSignoutResponse(e){const t=this._logger.create("processSignoutResponse"),{state:n,response:r}=await this.readSignoutResponseState(e,!0);return n?(t.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(r,n)):t.debug("No state from storage; skipping response validation"),r}clearStaleState(){return this._logger.create("clearStaleState"),cB.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}async revokeToken(e,t){return this._logger.create("revokeToken"),await this._tokenClient.revoke({token:e,token_type_hint:t})}}(e),this._redirectNavigator=new class{constructor(e){this._settings=e,this._logger=new XP("RedirectNavigator")}async prepare({redirectMethod:e=this._settings.redirectMethod,redirectTarget:t=this._settings.redirectTarget}){var n;this._logger.create("prepare");let r=window.self;"top"===t&&(r=null!=(n=window.top)?n:window.self);const i=r.location[e].bind(r.location);let a;return{navigate:async e=>{this._logger.create("navigate");const t=new Promise(((e,t)=>{a=t}));return i(e.url),await t},close:()=>{this._logger.create("close"),null==a||a(new Error("Redirect aborted")),r.stop()}}}}(this.settings),this._popupNavigator=new class{constructor(e){this._settings=e,this._logger=new XP("PopupNavigator")}async prepare({popupWindowFeatures:e=this._settings.popupWindowFeatures,popupWindowTarget:t=this._settings.popupWindowTarget}){return new AB({popupWindowFeatures:e,popupWindowTarget:t})}async callback(e,t=!1){this._logger.create("callback"),AB.notifyOpener(e,t)}}(this.settings),this._iframeNavigator=new class{constructor(e){this._settings=e,this._logger=new XP("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:e=this._settings.silentRequestTimeoutInSeconds}){return new TB({silentRequestTimeoutInSeconds:e})}async callback(e){this._logger.create("callback"),TB.notifyParent(e,this._settings.iframeNotifyParentOrigin)}}(this.settings),this._events=new RB(this.settings),this._silentRenewService=new class{constructor(e){this._userManager=e,this._logger=new XP("SilentRenewService"),this._isStarted=!1,this._retryTimer=new ZP("Retry Silent Renew"),this._tokenExpiring=async()=>{const e=this._logger.create("_tokenExpiring");try{await this._userManager.signinSilent(),e.debug("silent token renewal successful")}catch(t){if(t instanceof nB)return e.warn("ErrorTimeout from signinSilent:",t,"retry in 5s"),void this._retryTimer.init(5);e.error("Error from signinSilent:",t),this._userManager.events._raiseSilentRenewError(t)}}}async start(){const e=this._logger.create("start");if(!this._isStarted){this._isStarted=!0,this._userManager.events.addAccessTokenExpiring(this._tokenExpiring),this._retryTimer.addHandler(this._tokenExpiring);try{await this._userManager.getUser()}catch(t){e.error("getUser error",t)}}}stop(){this._isStarted&&(this._retryTimer.cancel(),this._retryTimer.removeHandler(this._tokenExpiring),this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring),this._isStarted=!1)}}(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new class{constructor(e){this._userManager=e,this._logger=new XP("SessionMonitor"),this._start=async e=>{const t=e.session_state;if(!t)return;const n=this._logger.create("_start");if(e.profile?(this._sub=e.profile.sub,this._sid=e.profile.sid,n.debug("session_state",t,", sub",this._sub)):(this._sub=void 0,this._sid=void 0,n.debug("session_state",t,", anonymous user")),this._checkSessionIFrame)this._checkSessionIFrame.start(t);else try{const e=await this._userManager.metadataService.getCheckSessionIframe();if(e){n.debug("initializing check session iframe");const r=this._userManager.settings.client_id,i=this._userManager.settings.checkSessionIntervalInSeconds,a=this._userManager.settings.stopCheckSessionOnError,o=new class{constructor(e,t,n,r,i){this._callback=e,this._client_id=t,this._intervalInSeconds=r,this._stopOnError=i,this._logger=new XP("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=e=>{e.origin===this._frame_origin&&e.source===this._frame.contentWindow&&("error"===e.data?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):"changed"===e.data?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(e.data+" message from check session op iframe"))};const a=new URL(n);this._frame_origin=a.origin,this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="fixed",this._frame.style.left="-1000px",this._frame.style.top="0",this._frame.width="0",this._frame.height="0",this._frame.src=a.href}load(){return new Promise((e=>{this._frame.onload=()=>{e()},window.document.body.appendChild(this._frame),window.addEventListener("message",this._message,!1)}))}start(e){if(this._session_state===e)return;this._logger.create("start"),this.stop(),this._session_state=e;const t=()=>{this._frame.contentWindow&&this._session_state&&this._frame.contentWindow.postMessage(this._client_id+" "+this._session_state,this._frame_origin)};t(),this._timer=setInterval(t,1e3*this._intervalInSeconds)}stop(){this._logger.create("stop"),this._session_state=null,this._timer&&(clearInterval(this._timer),this._timer=null)}}(this._callback,r,e,i,a);await o.load(),this._checkSessionIFrame=o,o.start(t)}else n.warn("no check session iframe found in the metadata")}catch(e){n.error("Error from getCheckSessionIframe:",e instanceof Error?e.message:e)}},this._stop=()=>{const e=this._logger.create("_stop");if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&this._checkSessionIFrame.stop(),this._userManager.settings.monitorAnonymousSession){const t=setInterval((async()=>{clearInterval(t);try{const e=await this._userManager.querySessionStatus();if(e){const t={session_state:e.session_state,profile:e.sub&&e.sid?{sub:e.sub,sid:e.sid}:null};this._start(t)}}catch(t){e.error("error from querySessionStatus",t instanceof Error?t.message:t)}}),1e3)}},this._callback=async()=>{const e=this._logger.create("_callback");try{const t=await this._userManager.querySessionStatus();let n=!0;t&&this._checkSessionIFrame?t.sub===this._sub?(n=!1,this._checkSessionIFrame.start(t.session_state),t.sid===this._sid?e.debug("same sub still logged in at OP, restarting check session iframe; session_state",t.session_state):(e.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state",t.session_state),this._userManager.events._raiseUserSessionChanged())):e.debug("different subject signed into OP",t.sub):e.debug("subject no longer signed into OP"),n?this._sub?this._userManager.events._raiseUserSignedOut():this._userManager.events._raiseUserSignedIn():e.debug("no change in session detected, no event to raise")}catch(t){this._sub&&(e.debug("Error calling queryCurrentSigninSession; raising signed out event",t),this._userManager.events._raiseUserSignedOut())}},e||this._logger.throw(new Error("No user manager passed")),this._userManager.events.addUserLoaded(this._start),this._userManager.events.addUserUnloaded(this._stop),this._init().catch((e=>{this._logger.error(e)}))}async _init(){this._logger.create("_init");const e=await this._userManager.getUser();if(e)this._start(e);else if(this._userManager.settings.monitorAnonymousSession){const e=await this._userManager.querySessionStatus();if(e){const t={session_state:e.session_state,profile:e.sub&&e.sid?{sub:e.sub,sid:e.sid}:null};this._start(t)}}}}(this))}get events(){return this._events}get metadataService(){return this._client.metadataService}async getUser(){const e=this._logger.create("getUser"),t=await this._loadUser();return t?(e.info("user loaded"),this._events.load(t,!1),t):(e.info("user not found in storage"),null)}async removeUser(){const e=this._logger.create("removeUser");await this.storeUser(null),e.info("user removed from storage"),this._events.unload()}async signinRedirect(e={}){this._logger.create("signinRedirect");const{redirectMethod:t,...n}=e,r=await this._redirectNavigator.prepare({redirectMethod:t});await this._signinStart({request_type:"si:r",...n},r)}async signinRedirectCallback(e=window.location.href){const t=this._logger.create("signinRedirectCallback"),n=await this._signinEnd(e);return n.profile&&n.profile.sub?t.info("success, signed in subject",n.profile.sub):t.info("no subject"),n}async signinResourceOwnerCredentials({username:e,password:t,skipUserInfo:n=!1}){const r=this._logger.create("signinResourceOwnerCredential"),i=await this._client.processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:n,extraTokenParams:this.settings.extraTokenParams});r.debug("got signin response");const a=await this._buildUser(i);return a.profile&&a.profile.sub?r.info("success, signed in subject",a.profile.sub):r.info("no subject"),a}async signinPopup(e={}){const t=this._logger.create("signinPopup"),{popupWindowFeatures:n,popupWindowTarget:r,...i}=e,a=this.settings.popup_redirect_uri;a||t.throw(new Error("No popup_redirect_uri configured"));const o=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r}),s=await this._signin({request_type:"si:p",redirect_uri:a,display:"popup",...i},o);return s&&(s.profile&&s.profile.sub?t.info("success, signed in subject",s.profile.sub):t.info("no subject")),s}async signinPopupCallback(e=window.location.href,t=!1){const n=this._logger.create("signinPopupCallback");await this._popupNavigator.callback(e,t),n.info("success")}async signinSilent(e={}){var t;const n=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:r,...i}=e;let a=await this._loadUser();if(null==a?void 0:a.refresh_token){n.debug("using refresh token");const e=new class{constructor(e){this.refresh_token=e.refresh_token,this.id_token=e.id_token,this.session_state=e.session_state,this.scope=e.scope,this.profile=e.profile,this.data=e.state}}(a);return await this._useRefreshToken(e)}const o=this.settings.silent_redirect_uri;let s;o||n.throw(new Error("No silent_redirect_uri configured")),a&&this.settings.validateSubOnSilentRenew&&(n.debug("subject prior to silent renew:",a.profile.sub),s=a.profile.sub);const u=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});return a=await this._signin({request_type:"si:s",redirect_uri:o,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?null==a?void 0:a.id_token:void 0,...i},u,s),a&&((null==(t=a.profile)?void 0:t.sub)?n.info("success, signed in subject",a.profile.sub):n.info("no subject")),a}async _useRefreshToken(e){const t=await this._client.useRefreshToken({state:e,timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds}),n=new hB({...e,...t});return await this.storeUser(n),this._events.load(n),n}async signinSilentCallback(e=window.location.href){const t=this._logger.create("signinSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async signinCallback(e=window.location.href){const{state:t}=await this._client.readSigninResponseState(e);switch(t.request_type){case"si:r":return await this.signinRedirectCallback(e);case"si:p":return await this.signinPopupCallback(e);case"si:s":return await this.signinSilentCallback(e);default:throw new Error("invalid response_type in state")}}async signoutCallback(e=window.location.href,t=!1){const{state:n}=await this._client.readSignoutResponseState(e);if(n)switch(n.request_type){case"so:r":await this.signoutRedirectCallback(e);break;case"so:p":await this.signoutPopupCallback(e,t);break;case"so:s":await this.signoutSilentCallback(e);break;default:throw new Error("invalid response_type in state")}}async querySessionStatus(e={}){const t=this._logger.create("querySessionStatus"),{silentRequestTimeoutInSeconds:n,...r}=e,i=this.settings.silent_redirect_uri;i||t.throw(new Error("No silent_redirect_uri configured"));const a=await this._loadUser(),o=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:n}),s=await this._signinStart({request_type:"si:s",redirect_uri:i,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?null==a?void 0:a.id_token:void 0,response_type:this.settings.query_status_response_type,scope:"openid",skipUserInfo:!0,...r},o);try{const e=await this._client.processSigninResponse(s.url);return t.debug("got signin response"),e.session_state&&e.profile.sub?(t.info("success for subject",e.profile.sub),{session_state:e.session_state,sub:e.profile.sub,sid:e.profile.sid}):(t.info("success, user not authenticated"),null)}catch(e){if(this.settings.monitorAnonymousSession&&e instanceof tB)switch(e.error){case"login_required":case"consent_required":case"interaction_required":case"account_selection_required":return t.info("success for anonymous user"),{session_state:e.session_state}}throw e}}async _signin(e,t,n){const r=await this._signinStart(e,t);return await this._signinEnd(r.url,n)}async _signinStart(e,t){const n=this._logger.create("_signinStart");try{const r=await this._client.createSigninRequest(e);return n.debug("got signin request"),await t.navigate({url:r.url,state:r.state.id,response_mode:r.state.response_mode,scriptOrigin:this.settings.iframeScriptOrigin})}catch(e){throw n.debug("error after preparing navigator, closing navigator window"),t.close(),e}}async _signinEnd(e,t){const n=this._logger.create("_signinEnd"),r=await this._client.processSigninResponse(e);return n.debug("got signin response"),await this._buildUser(r,t)}async _buildUser(e,t){const n=this._logger.create("_buildUser"),r=new hB(e);if(t){if(t!==r.profile.sub)throw n.debug("current user does not match user returned from signin. sub from signin:",r.profile.sub),new tB({...e,error:"login_required"});n.debug("current user matches user returned from signin")}return await this.storeUser(r),n.debug("user stored"),this._events.load(r),r}async signoutRedirect(e={}){const t=this._logger.create("signoutRedirect"),{redirectMethod:n,...r}=e,i=await this._redirectNavigator.prepare({redirectMethod:n});await this._signoutStart({request_type:"so:r",post_logout_redirect_uri:this.settings.post_logout_redirect_uri,...r},i),t.info("success")}async signoutRedirectCallback(e=window.location.href){const t=this._logger.create("signoutRedirectCallback"),n=await this._signoutEnd(e);return t.info("success"),n}async signoutPopup(e={}){const t=this._logger.create("signoutPopup"),{popupWindowFeatures:n,popupWindowTarget:r,...i}=e,a=this.settings.popup_post_logout_redirect_uri,o=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r});await this._signout({request_type:"so:p",post_logout_redirect_uri:a,state:null==a?void 0:{},...i},o),t.info("success")}async signoutPopupCallback(e=window.location.href,t=!1){const n=this._logger.create("signoutPopupCallback");await this._popupNavigator.callback(e,t),n.info("success")}async _signout(e,t){const n=await this._signoutStart(e,t);return await this._signoutEnd(n.url)}async _signoutStart(e={},t){var n;const r=this._logger.create("_signoutStart");try{const i=await this._loadUser();r.debug("loaded current user from storage"),this.settings.revokeTokensOnSignout&&await this._revokeInternal(i);const a=e.id_token_hint||i&&i.id_token;a&&(r.debug("setting id_token_hint in signout request"),e.id_token_hint=a),await this.removeUser(),r.debug("user removed, creating signout request");const o=await this._client.createSignoutRequest(e);return r.debug("got signout request"),await t.navigate({url:o.url,state:null==(n=o.state)?void 0:n.id})}catch(e){throw r.debug("error after preparing navigator, closing navigator window"),t.close(),e}}async _signoutEnd(e){const t=this._logger.create("_signoutEnd"),n=await this._client.processSignoutResponse(e);return t.debug("got signout response"),n}async signoutSilent(e={}){var t;const n=this._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:r,...i}=e,a=this.settings.includeIdTokenInSilentSignout?null==(t=await this._loadUser())?void 0:t.id_token:void 0,o=this.settings.popup_post_logout_redirect_uri,s=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});await this._signout({request_type:"so:s",post_logout_redirect_uri:o,id_token_hint:a,...i},s),n.info("success")}async signoutSilentCallback(e=window.location.href){const t=this._logger.create("signoutSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async revokeTokens(e){const t=await this._loadUser();await this._revokeInternal(t,e)}async _revokeInternal(e,t=this.settings.revokeTokenTypes){const n=this._logger.create("_revokeInternal");if(!e)return;const r=t.filter((t=>"string"==typeof e[t]));if(r.length){for(const t of r)await this._client.revokeToken(e[t],t),n.info(`${t} revoked successfully`),"access_token"!==t&&(e[t]=null);await this.storeUser(e),n.debug("user stored"),this._events.load(e)}else n.debug("no need to revoke due to no token(s)")}startSilentRenew(){this._logger.create("startSilentRenew"),this._silentRenewService.start()}stopSilentRenew(){this._silentRenewService.stop()}get _userStoreKey(){return`user:${this.settings.authority}:${this.settings.client_id}`}async _loadUser(){const e=this._logger.create("_loadUser"),t=await this.settings.userStore.get(this._userStoreKey);return t?(e.debug("user storageString loaded"),hB.fromStorageString(t)):(e.debug("no user storageString"),null)}async storeUser(e){const t=this._logger.create("storeUser");if(e){t.debug("storing user");const n=e.toStorageString();await this.settings.userStore.set(this._userStoreKey,n)}else this._logger.debug("removing user"),await this.settings.userStore.remove(this._userStoreKey)}async clearStaleState(){await this._client.clearStaleState()}}((({oidcConfiguration:e,authenticationDomain:t})=>{const n={authority:t,redirect_uri:e.redirectUri,popup_redirect_uri:e.redirectUri,client_id:e.clientId,metadata:{authorization_endpoint:`${t}/authorize`,token_endpoint:`${t}/oauth/token`,userinfo_endpoint:`${t}/userinfo`,end_session_endpoint:`${t}/v2/logout?returnTo=${encodeURIComponent(e.logoutRedirectUri)}&client_id=${e.clientId}`},mergeClaims:!0,loadUserInfo:!0,scope:e.scope};return e.audience&&(n.extraQueryParams={audience:e.audience}),n})(e)),this.deviceCredentialsManager=new dq,this.logoutMode=e.oidcConfiguration.logoutMode||"redirect"}static mapOidcUserToDomainModel=e=>{const t=e.profile?.passport,n={expired:e.expired,idToken:e.id_token,accessToken:e.access_token,refreshToken:e.refresh_token,profile:{sub:e.profile.sub,email:e.profile.email,nickname:e.profile.nickname}};return t?.imx_eth_address&&(n.imx={ethAddress:t?.imx_eth_address,starkAddress:t?.imx_stark_address,userAdminAddress:t?.imx_user_admin_address}),t?.zkevm_eth_address&&(n.zkEvm={ethAddress:t?.zkevm_eth_address,userAdminAddress:t?.zkevm_user_admin_address}),n};static mapDeviceTokenResponseToDomainUserModel=e=>{const t=zP(e.id_token),n={idToken:e.id_token,accessToken:e.access_token,refreshToken:e.refresh_token,profile:{sub:t.sub,email:t.email,nickname:t.nickname}};return t?.passport?.imx_eth_address&&(n.imx={ethAddress:t?.passport?.imx_eth_address,starkAddress:t?.passport?.imx_stark_address,userAdminAddress:t?.passport?.imx_user_admin_address}),n};async login(){return sq((async()=>{const e=await this.userManager.signinPopup({popupWindowFeatures:{width:410,height:450}});return hq.mapOidcUserToDomainModel(e)}),aq.AUTHENTICATION_ERROR)}async loginCallback(){return sq((async()=>this.userManager.signinPopupCallback()),aq.AUTHENTICATION_ERROR)}async loginWithDeviceFlow(){return sq((async()=>{const e=await Fe.post(`${this.config.authenticationDomain}/oauth/device/code`,{client_id:this.config.oidcConfiguration.clientId,scope:this.config.oidcConfiguration.scope,audience:this.config.oidcConfiguration.audience},lq);return{code:e.data.user_code,deviceCode:e.data.device_code,url:e.data.verification_uri_complete,interval:e.data.interval}}),aq.AUTHENTICATION_ERROR)}async connectImxDeviceFlow(e,t,n){return sq((async()=>{const r=Date.now();for(;;){if(null!=n&&Date.now()-r>n)throw new Error("Timed out");await pq(1e3*t);try{const t=await this.getDeviceFlowToken(e),n=hq.mapDeviceTokenResponseToDomainUserModel(t);return n.imx?.ethAddress&&n.imx?.starkAddress&&n.imx?.userAdminAddress&&this.deviceCredentialsManager.saveCredentials(t),n}catch(e){if(!Fe.isAxiosError(e))throw e;{const t=e.response?.data;switch(t.error){case"authorization_pending":case"slow_down":break;case"expired_token":throw new Error("Token expired, please log in again");case"access_denied":throw new Error("User denied access");default:throw new Error("Error getting token")}}}}throw new Error("Failed to get credentials")}),aq.AUTHENTICATION_ERROR)}async getDeviceFlowToken(e){return(await Fe.post(`${this.config.authenticationDomain}/oauth/token`,{client_id:this.config.oidcConfiguration.clientId,grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:e},lq)).data}static base64URLEncode(e){return e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}static sha256(e){return(void 0)("sha256").update(e).digest()}getPKCEAuthorizationUrl(){const e=hq.base64URLEncode((void 0)(32)),t=hq.base64URLEncode(hq.sha256(e)),n=hq.base64URLEncode((void 0)(32));return this.deviceCredentialsManager.savePKCEData({state:n,verifier:e}),`${this.config.authenticationDomain}/authorize?response_type=code&code_challenge=${t}&code_challenge_method=S256&client_id=${this.config.oidcConfiguration.clientId}&redirect_uri=${this.config.oidcConfiguration.redirectUri}&scope=${this.config.oidcConfiguration.scope}&state=${n}&audience=${this.config.oidcConfiguration.audience}`}async connectImxPKCEFlow(e,t){return sq((async()=>{const n=this.deviceCredentialsManager.getPKCEData();if(!n)throw new Error("No code verifier or state for PKCE");if(t!==n.state)throw new Error("Provided state does not match stored state");const r=await this.getPKCEToken(e,n.verifier),i=hq.mapDeviceTokenResponseToDomainUserModel(r);return i.imx?.ethAddress&&i.imx?.starkAddress&&i.imx?.userAdminAddress&&this.deviceCredentialsManager.saveCredentials(r),i}),aq.AUTHENTICATION_ERROR)}async getPKCEToken(e,t){return(await Fe.post(`${this.config.authenticationDomain}/oauth/token`,{client_id:this.config.oidcConfiguration.clientId,grant_type:"authorization_code",code_verifier:t,code:e,redirect_uri:this.config.oidcConfiguration.redirectUri},lq)).data}async connectImxWithCredentials(e){return sq((async()=>{if(this.deviceCredentialsManager.areValid(e))return hq.mapDeviceTokenResponseToDomainUserModel(e);const t=e?.refresh_token??null;if(t){const e=await this.refreshToken(t);return hq.mapDeviceTokenResponseToDomainUserModel(e)}return null}),aq.AUTHENTICATION_ERROR)}async refreshToken(e){return(await Fe.post(`${this.config.authenticationDomain}/oauth/token`,{client_id:this.config.oidcConfiguration.clientId,grant_type:"refresh_token",refresh_token:e},lq)).data}async logout(){return sq((async()=>"silent"===this.logoutMode?this.userManager.signoutSilent():this.userManager.signoutRedirect()),aq.LOGOUT_ERROR)}async logoutSilentCallback(e){return this.userManager.signoutSilentCallback(e)}async logoutDeviceFlow(){return sq((async()=>{this.deviceCredentialsManager.clearCredentials()}),aq.LOGOUT_ERROR)}async loginSilent(){return sq((async()=>{if(!await this.getUser())return null;const e=await this.userManager.signinSilent();return e?hq.mapOidcUserToDomainModel(e):null}),aq.SILENT_LOGIN_ERROR)}async getUser(){return sq((async()=>{const e=await this.userManager.getUser();if(e)return hq.mapOidcUserToDomainModel(e);const t=this.deviceCredentialsManager.getCredentials();return t?hq.mapDeviceTokenResponseToDomainUserModel(t):null}),aq.NOT_LOGGED_IN_ERROR)}async getUserDeviceFlow(){return sq((async()=>{const e=this.deviceCredentialsManager.getCredentials();return e?hq.mapDeviceTokenResponseToDomainUserModel(e):null}),aq.NOT_LOGGED_IN_ERROR)}checkStoredDeviceFlowCredentials(){return this.deviceCredentialsManager.getCredentials()}}class bq{config;magicClient;constructor(e){this.config=e}async login(e,t){return sq((async()=>(this.magicClient=new kL(this.config.magicPublishableApiKey,{extensions:[new IL],network:t}),await this.magicClient.openid.loginWithOIDC({jwt:e,providerId:this.config.magicProviderId}),this.magicClient.rpcProvider)),aq.WALLET_CONNECTION_ERROR)}async logout(){this.magicClient?.user&&await this.magicClient.user.logout()}}const mq=1e3,yq=3,gq=async(e,t)=>{const{retries:n=yq,interval:r=mq,finalErr:i=Error("Retry failed"),finallyFn:a=(()=>{})}=t||{};try{return await e()}catch(t){return n<=0?Promise.reject(i):(await(o=r,new Promise((e=>{setTimeout((()=>e()),o)}))),gq(e,{retries:n-1,finalErr:i,finallyFn:a}))}finally{n<=0&&a()}var o};var vq,wq;!function(e){e[e.USER_REJECTED_REQUEST=4001]="USER_REJECTED_REQUEST",e[e.UNAUTHORIZED=4100]="UNAUTHORIZED",e[e.UNSUPPORTED_METHOD=4200]="UNSUPPORTED_METHOD",e[e.DISCONNECTED=4900]="DISCONNECTED"}(vq||(vq={})),function(e){e[e.RPC_SERVER_ERROR=-32e3]="RPC_SERVER_ERROR",e[e.INVALID_REQUEST=-32600]="INVALID_REQUEST",e[e.METHOD_NOT_FOUND=-32601]="METHOD_NOT_FOUND",e[e.INVALID_PARAMS=-32602]="INVALID_PARAMS",e[e.INTERNAL_ERROR=-32603]="INTERNAL_ERROR",e[e.PARSE_ERROR=-32700]="PARSE_ERROR",e[e.TRANSACTION_REJECTED=-32003]="TRANSACTION_REJECTED"}(wq||(wq={}));class _q extends Error{message;code;constructor(e,t){super(t),this.message=t,this.code=e}}const Eq="Transaction requires confirmation but this functionality is not supported in this environment. Please contact Immutable support if you need to enable this feature.",Tq=e=>Tr.from(e).toString();class Aq{transactionAPI;confirmationScreen;imxEtherAddress;crossSdkBridgeEnabled;constructor({accessToken:e,confirmationScreen:t,imxEtherAddress:n,config:r}){this.confirmationScreen=t,this.transactionAPI=new _j(new Ej({accessToken:e,basePath:r.imxPublicApiDomain})),this.imxEtherAddress=n,this.crossSdkBridgeEnabled=r.crossSdkBridgeEnabled}withConfirmationScreen(e){return t=>this.withConfirmationScreenTask(e)(t)()}withConfirmationScreenTask(e){return t=>async()=>{this.confirmationScreen.loading(e);try{return await t()}catch(e){throw this.confirmationScreen.closeWindow(),e}}}withDefaultConfirmationScreenTask(e){return this.withConfirmationScreenTask()(e)}async validate({payloadHash:e}){if(!(await gq((async()=>this.transactionAPI.getTransactionByID({transactionID:e,chainType:"starkex"})),{finallyFn:()=>{this.confirmationScreen.closeWindow()}})).data.id)throw new Error("Transaction doesn't exists");const t=await this.transactionAPI.evaluateTransaction({id:e,transactionEvaluationRequest:{chainType:"starkex"}}),{confirmationRequired:n}=t.data;if(n){if(this.crossSdkBridgeEnabled)throw new Error(Eq);if(!(await this.confirmationScreen.requestConfirmation(e,this.imxEtherAddress,Tj)).confirmed)throw new Error("Transaction rejected by user")}else this.confirmationScreen.closeWindow()}async evaluateEVMTransaction({chainId:e,nonce:t,user:n,metaTransactions:r}){const i={Authorization:`Bearer ${n.accessToken}`},a=(e=>{try{return e.map((e=>({delegateCall:!0===e.delegateCall,revertOnError:!0===e.revertOnError,gasLimit:e.gasLimit?Tq(e.gasLimit):"0",target:e.to??ca,value:e.value?Tq(e.value):"0",data:e.data?e.data.toString():"0x"})))}catch(e){const t=e instanceof Error?e.message:String(e);throw new _q(wq.INVALID_PARAMS,`Transaction failed to parsing: ${t}`)}})(r);try{return(await this.transactionAPI.evaluateTransaction({id:"evm",transactionEvaluationRequest:{chainType:"evm",chainId:e,transactionData:{nonce:t,userAddress:n.zkEvm.ethAddress,metaTransactions:a}}},{headers:i})).data}catch(e){const t=e instanceof Error?e.message:String(e);throw new _q(wq.INTERNAL_ERROR,`Transaction failed to validate with error: ${t}`)}}async validateEVMTransaction({chainId:e,nonce:t,user:n,metaTransactions:r}){const i=await this.evaluateEVMTransaction({chainId:e,nonce:t,user:n,metaTransactions:r}),{confirmationRequired:a,transactionId:o}=i;if(a&&this.crossSdkBridgeEnabled)throw new _q(wq.TRANSACTION_REJECTED,Eq);if(a&&o){if(!(await this.confirmationScreen.requestConfirmation(o,this.imxEtherAddress,Aj,e)).confirmed)throw new _q(wq.TRANSACTION_REJECTED,"Transaction rejected by user")}else this.confirmationScreen.closeWindow()}}var Rq,Sq;!function(e){e.LOGGED_OUT="loggedOut"}(Rq||(Rq={})),function(e){e.PRODUCTION="mainnet",e.SANDBOX="goerli"}(Sq||(Sq={}));const kq="ERC721";const Oq="ERC721";class Iq{user;starkSigner;immutableXClient;confirmationScreen;guardianClient;constructor({user:e,starkSigner:t,immutableXClient:n,confirmationScreen:r,config:i,passportEventEmitter:a}){this.user=e,this.starkSigner=t,this.immutableXClient=n,this.confirmationScreen=r,this.guardianClient=new Aq({accessToken:e.accessToken,confirmationScreen:r,imxEtherAddress:e.imx.ethAddress,config:i}),a.on(Rq.LOGGED_OUT,this.handleLogout)}handleLogout=()=>{this.user=void 0,this.starkSigner=void 0};checkIsLoggedIn(){if(void 0===this.user||void 0===this.starkSigner)throw new oq("User has been logged out",aq.NOT_LOGGED_IN_ERROR)}async transfer(e){return this.checkIsLoggedIn(),async function({request:e,transfersApi:t,starkSigner:n,user:r,guardianClient:i}){return sq(i.withDefaultConfirmationScreenTask((async()=>{const a=e.type===Oq?"1":e.amount,o={sender:r.imx.ethAddress,token:kj(e),amount:a,receiver:e.receiver},s={Authorization:`Bearer ${r.accessToken}`},u=await t.getSignableTransferV1({getSignableTransferRequest:o},{headers:s});await i.validate({payloadHash:u.data.payload_hash});const c=u.data,{payload_hash:f}=c,d=await n.signMessage(f),l=await n.getAddress(),p={createTransferRequest:{sender_stark_key:c.sender_stark_key||l,sender_vault_id:c.sender_vault_id,receiver_stark_key:c.receiver_stark_key,receiver_vault_id:c.receiver_vault_id,asset_id:c.asset_id,amount:c.amount,nonce:c.nonce,expiration_timestamp:c.expiration_timestamp,stark_signature:d}},{data:h}=await t.createTransferV1(p,{headers:s});return{sent_signature:h.sent_signature,status:h.status?.toString(),time:h.time,transfer_id:h.transfer_id}})),aq.TRANSFER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,transfersApi:this.immutableXClient.transfersApi,guardianClient:this.guardianClient})}registerOffchain(){throw new oq("Operation not supported",aq.OPERATION_NOT_SUPPORTED_ERROR)}isRegisteredOnchain(){throw new oq("Operation not supported",aq.OPERATION_NOT_SUPPORTED_ERROR)}createOrder(e){return this.checkIsLoggedIn(),async function({starkSigner:e,user:t,request:n,ordersApi:r,guardianClient:i}){return sq(i.withDefaultConfirmationScreenTask((async()=>{const{ethAddress:a}=t.imx,o=n.sell.type===kq?"1":n.sell.amount,s=n.buy.type===kq?"1":n.buy.amount,u={Authorization:`Bearer ${t.accessToken}`},c={user:a,amount_buy:s,token_buy:kj(n.buy),amount_sell:o,token_sell:kj(n.sell),fees:n.fees,split_fees:!0,expiration_timestamp:n.expiration_timestamp},f=await r.getSignableOrder({getSignableOrderRequestV3:c},{headers:u});await i.validate({payloadHash:f.data.payload_hash});const{payload_hash:d}=f.data,l=await e.signMessage(d),p=f.data,h={createOrderRequest:{include_fees:!0,fees:n.fees,stark_signature:l,amount_buy:p.amount_buy,amount_sell:p.amount_sell,asset_id_buy:p.asset_id_buy,asset_id_sell:p.asset_id_sell,expiration_timestamp:p.expiration_timestamp,nonce:p.nonce,stark_key:p.stark_key,vault_id_buy:p.vault_id_buy,vault_id_sell:p.vault_id_sell}};return{...(await r.createOrderV3(h,{headers:u})).data}})),aq.CREATE_ORDER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,ordersApi:this.immutableXClient.ordersApi,guardianClient:this.guardianClient})}cancelOrder(e){return this.checkIsLoggedIn(),async function({user:e,starkSigner:t,request:n,ordersApi:r,guardianClient:i}){return sq(i.withDefaultConfirmationScreenTask((async()=>{const a={order_id:n.order_id},o={Authorization:`Bearer ${e.accessToken}`},s=await r.getSignableCancelOrderV3({getSignableCancelOrderRequest:a},{headers:o});await i.validate({payloadHash:s.data.payload_hash});const{payload_hash:u}=s.data,c=await t.signMessage(u),f=await r.cancelOrderV3({id:n.order_id.toString(),cancelOrderRequest:{order_id:n.order_id,stark_signature:c}},{headers:o});return{order_id:f.data.order_id,status:f.data.status}})),aq.CANCEL_ORDER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,ordersApi:this.immutableXClient.ordersApi,guardianClient:this.guardianClient})}createTrade(e){return this.checkIsLoggedIn(),async function({request:e,tradesApi:t,user:n,starkSigner:r,guardianClient:i}){return sq(i.withDefaultConfirmationScreenTask((async()=>{const{ethAddress:a}=n.imx,o={expiration_timestamp:e.expiration_timestamp,fees:e.fees,order_id:e.order_id,user:a},s={Authorization:`Bearer ${n.accessToken}`},u=await t.getSignableTrade({getSignableTradeRequest:o},{headers:s});await i.validate({payloadHash:u.data.payload_hash});const{payload_hash:c}=u.data,f=await r.signMessage(c),{data:d}=u,l={createTradeRequest:{include_fees:!0,fees:e?.fees,stark_signature:f,order_id:e?.order_id,fee_info:d.fee_info,amount_buy:d.amount_buy,amount_sell:d.amount_sell,asset_id_buy:d.asset_id_buy,asset_id_sell:d.asset_id_sell,expiration_timestamp:d.expiration_timestamp,nonce:d.nonce,stark_key:d.stark_key,vault_id_buy:d.vault_id_buy,vault_id_sell:d.vault_id_sell}},{data:p}=await t.createTradeV3(l,{headers:s});return p})),aq.CREATE_TRADE_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,tradesApi:this.immutableXClient.tradesApi,guardianClient:this.guardianClient})}batchNftTransfer(e){return this.checkIsLoggedIn(),async function({user:e,starkSigner:t,request:n,transfersApi:r,guardianClient:i}){return sq(i.withConfirmationScreenTask({width:480,height:784})((async()=>{const{ethAddress:a}=e.imx,o={sender_ether_key:a,signable_requests:n.map((e=>({amount:"1",token:kj({type:Oq,tokenId:e.tokenId,tokenAddress:e.tokenAddress}),receiver:e.receiver})))},s={Authorization:`Bearer ${e.accessToken}`},u=await r.getSignableTransfer({getSignableTransferRequestV2:o},{headers:s});await i.validate({payloadHash:u.data.signable_responses[0]?.payload_hash});const c=await Promise.all(u.data.signable_responses.map((async e=>{const n=await t.signMessage(e.payload_hash);return{sender_vault_id:e.sender_vault_id,receiver_stark_key:e.receiver_stark_key,receiver_vault_id:e.receiver_vault_id,asset_id:e.asset_id,amount:e.amount,nonce:e.nonce,expiration_timestamp:e.expiration_timestamp,stark_signature:n}}))),f={sender_stark_key:u.data.sender_stark_key,requests:c},d=await r.createTransfer({createTransferRequestV2:f},{headers:s});return{transfer_ids:d?.data.transfer_ids}})),aq.TRANSFER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,transfersApi:this.immutableXClient.transfersApi,guardianClient:this.guardianClient})}exchangeTransfer(e){return this.checkIsLoggedIn(),async function({user:e,starkSigner:t,request:n,exchangesApi:r}){return sq((async()=>{const{ethAddress:i}=e.imx,a=n.amount,o=await r.getExchangeSignableTransfer({id:n.transactionID,getSignableTransferRequest:{sender:i,token:kj(n),amount:a,receiver:n.receiver}}),s=await t.getAddress(),{payload_hash:u}=o.data,c=await t.signMessage(u),f={sender_stark_key:o.data.sender_stark_key||s,sender_vault_id:o.data.sender_vault_id,receiver_stark_key:o.data.receiver_stark_key,receiver_vault_id:o.data.receiver_vault_id,asset_id:o.data.asset_id,amount:o.data.amount,nonce:o.data.nonce,expiration_timestamp:o.data.expiration_timestamp,stark_signature:c},d={Authorization:`Bearer ${e.accessToken}`},l=await r.createExchangeTransfer({id:n.transactionID,createTransferRequest:f},{headers:d});return{sent_signature:l?.data.sent_signature,status:l?.data.status?.toString(),time:l?.data.time,transfer_id:l?.data.transfer_id}}),aq.EXCHANGE_TRANSFER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,exchangesApi:this.immutableXClient.exchangeApi})}deposit(e){throw new oq("Operation not supported",aq.OPERATION_NOT_SUPPORTED_ERROR)}prepareWithdrawal(e){throw new oq("Operation not supported",aq.OPERATION_NOT_SUPPORTED_ERROR)}completeWithdrawal(e,t){throw new oq("Operation not supported",aq.OPERATION_NOT_SUPPORTED_ERROR)}getAddress(){return this.checkIsLoggedIn(),Promise.resolve(this.user.imx.ethAddress)}}class xq{authManager;config;confirmationScreen;immutableXClient;magicAdapter;passportEventEmitter;constructor({authManager:e,config:t,confirmationScreen:n,immutableXClient:r,magicAdapter:i,passportEventEmitter:a}){this.authManager=e,this.config=t,this.confirmationScreen=n,this.immutableXClient=r,this.magicAdapter=i,this.passportEventEmitter=a}async getProvider(){const e=await this.authManager.login();return this.createProviderInstance(e)}async getProviderSilent(){const e=await this.authManager.loginSilent();return e?this.createProviderInstance(e):null}async getProviderWithDeviceFlow(e,t,n){const r=await this.authManager.connectImxDeviceFlow(e,t,n);return this.createProviderInstance(r)}async getProviderWithPKCEFlow(e,t){const n=await this.authManager.connectImxPKCEFlow(e,t);return this.createProviderInstance(n)}async getProviderWithCredentials(e){const t=await this.authManager.connectImxWithCredentials(e);return t?this.createProviderInstance(t):null}async createProviderInstance(e){if(!e.idToken)throw new oq("Failed to initialise",aq.WALLET_CONNECTION_ERROR);const t=await this.magicAdapter.login(e.idToken,this.config.network),n=new Nh(t).getSigner(),r=await(async e=>sq((async()=>sx(await TP(e))),aq.WALLET_CONNECTION_ERROR))(n);if(!e.imx?.ethAddress){const t=await this.registerStarkEx(n,r,e.accessToken);return new Iq({user:t,starkSigner:r,immutableXClient:this.immutableXClient,confirmationScreen:this.confirmationScreen,config:this.config,passportEventEmitter:this.passportEventEmitter})}return new Iq({user:e,starkSigner:r,immutableXClient:this.immutableXClient,confirmationScreen:this.confirmationScreen,config:this.config,passportEventEmitter:this.passportEventEmitter})}async registerStarkEx(e,t,n){return sq((async()=>{await async function({ethSigner:e,starkSigner:t,usersApi:n},r){return sq((async()=>{const i=await e.getAddress(),a=await t.getAddress(),o=await n.getSignableRegistrationOffchain({getSignableRegistrationRequest:{ether_key:i,stark_key:a}}),{signable_message:s,payload_hash:u}=o.data,c=await Sj(s,e),f=await t.signMessage(u);return(await n.registerPassportUser({authorization:`Bearer ${r}`,registerPassportUserRequest:{eth_signature:c,ether_key:i,stark_signature:f,stark_key:a}})).statusText}),aq.USER_REGISTRATION_ERROR)}({ethSigner:e,starkSigner:t,usersApi:this.immutableXClient.usersApi},n);return await gq((async()=>{const e=await this.authManager.loginSilent();return!!e?.imx?e:Promise.reject(new Error("user wallet addresses not exist"))}))}),aq.REFRESH_TOKEN_ERROR)}}const Cq=(e,t,n)=>{const r=t.map((t=>!e[t]&&t)).filter((e=>e)).join(", ");if(""!==r){throw new oq(n?`${n} - ${r} cannot be null`:`${r} cannot be null`,aq.INVALID_CONFIGURATION)}};class Mq{network;authenticationDomain;passportDomain;imxPublicApiDomain;magicPublishableApiKey;magicProviderId;oidcConfiguration;baseConfig;zkEvmRpcUrl;relayerUrl;multiRollupConfig;crossSdkBridgeEnabled;constructor({baseConfig:e,overrides:n,crossSdkBridgeEnabled:r,...i}){if(Cq(i,["clientId","logoutRedirectUri","redirectUri"]),this.oidcConfiguration=i,this.baseConfig=e,this.crossSdkBridgeEnabled=r||!1,n)Cq(n,["network","authenticationDomain","passportDomain","magicPublishableApiKey","magicProviderId","zkEvmRpcUrl","relayerUrl","imxPublicApiDomain","indexerMrBasePath","orderBookMrBasePath","passportMrBasePath"],"overrides"),this.network=n.network,this.authenticationDomain=n.authenticationDomain,this.passportDomain=n.passportDomain,this.imxPublicApiDomain=n.imxPublicApiDomain,this.magicPublishableApiKey=n.magicPublishableApiKey,this.magicProviderId=n.magicProviderId,this.zkEvmRpcUrl=n.zkEvmRpcUrl,this.relayerUrl=n.relayerUrl,this.multiRollupConfig={indexer:wt({basePath:n.indexerMrBasePath}),orderBook:wt({basePath:n.orderBookMrBasePath}),passport:wt({basePath:n.passportMrBasePath})};else switch(e.environment){case t.PRODUCTION:this.network=Sq.PRODUCTION,this.authenticationDomain="https://auth.immutable.com",this.magicPublishableApiKey="pk_live_10F423798A540ED7",this.magicProviderId="fSMzaRQ4O7p4fttl7pCyGVtJS_G70P8SNsLXtPPGHo0=",this.passportDomain="https://passport.immutable.com",this.imxPublicApiDomain="https://api.immutable.com",this.zkEvmRpcUrl="",this.relayerUrl="https://api.immutable.com/relayer-mr",this.multiRollupConfig=_t();break;case t.SANDBOX:default:this.network=Sq.SANDBOX,this.authenticationDomain="https://auth.immutable.com",this.magicPublishableApiKey="pk_live_10F423798A540ED7",this.magicProviderId="fSMzaRQ4O7p4fttl7pCyGVtJS_G70P8SNsLXtPPGHo0=",this.passportDomain="https://passport.sandbox.immutable.com",this.imxPublicApiDomain="https://api.sandbox.immutable.com",this.zkEvmRpcUrl="https://rpc.testnet.immutable.com",this.relayerUrl="https://api.sandbox.immutable.com/relayer-mr",this.multiRollupConfig=Et()}}}var Nq;!function(e){e.CONFIRMATION_WINDOW_READY="confirmation_window_ready",e.TRANSACTION_CONFIRMED="transaction_confirmed",e.TRANSACTION_ERROR="transaction_error"}(Nq||(Nq={}));class Pq{config;confirmationWindow;constructor(e){this.config=e}requestConfirmation(e,t,n,r){return new Promise(((i,a)=>{const o=({data:e,origin:t})=>{if(t===this.config.passportDomain&&"imx_passport_confirmation"===e.eventType)switch(e.messageType){case Nq.CONFIRMATION_WINDOW_READY:break;case Nq.TRANSACTION_CONFIRMED:i({confirmed:!0});break;case Nq.TRANSACTION_ERROR:a(new Error("Transaction error"));break;default:a(new Error("Unsupported message type"))}};if(window.addEventListener("message",o),!this.confirmationWindow)return void i({confirmed:!1});let s="";s=n===Tj?`${this.config.passportDomain}/transaction-confirmation/transaction.html?transactionId=${e}&imxEtherAddress=${t}&chainType=starkex`:`${this.config.passportDomain}/transaction-confirmation/zkevm?transactionId=${e}&imxEtherAddress=${t}&chainType=evm&chainId=${r}`,this.confirmationWindow.location.href=s;const u=setInterval((()=>{this.confirmationWindow?.closed&&(clearInterval(u),window.removeEventListener("message",o),i({confirmed:!1}))}),1e3)}))}loading(e){this.config.crossSdkBridgeEnabled||(this.confirmationWindow=(({url:e,title:t,width:n,height:r})=>{const i=Math.max(0,Math.round(window.screenX+(window.outerWidth-n)/2)),a=Math.max(0,Math.round(window.screenY+(window.outerHeight-r)/2)),o=window.open(e,t,`\n scrollbars=yes,\n width=${n}, \n height=${r}, \n top=${a}, \n left=${i}\n `);if(!o)throw new Error("Failed to open confirmation screen");return o.focus(),o})({url:`${this.config.passportDomain}/transaction-confirmation/loading.html`,title:"Confirm this transaction",width:e?.width||480,height:e?.height||380}))}closeWindow(){this.confirmationWindow?.close()}}var Bq,Dq;!function(e){e.PENDING="PENDING",e.SUBMITTED="SUBMITTED",e.SUCCESSFUL="SUCCESSFUL",e.REVERTED="REVERTED",e.FAILED="FAILED"}(Bq||(Bq={})),function(e){e.ACCOUNTS_CHANGED="accountsChanged"}(Dq||(Dq={}));class Fq{emitter=new Qw;emit(e,...t){this.emitter.emit(e,...t)}on(e,t){this.emitter.on(e,t)}removeListener(e,t){this.emitter.removeListener(e,t)}}const Lq=async(e,t,n,r,i)=>{const a=e.map((e=>({delegateCall:!0===e.delegateCall,revertOnError:!0===e.revertOnError,gasLimit:e.gasLimit??da,target:e.to??ca,value:e.value??da,data:e.data??[]})));const o=function(e,t){return xi(Za.encode(["uint256","tuple(\n bool delegateCall,\n bool revertOnError,\n uint256 gasLimit,\n address target,\n uint256 value,\n bytes data\n)[]"],[e,t]))}(t,a),s=tr(xi(Hh(["string","uint256","address","bytes32"],["",n,r,o]))),u=await i.signMessage(s),c=iq({threshold:1,signers:[{weight:1,signature:`${u}02`}]}),f=new os(Oj.mainModule.abi);return f.encodeFunctionData(f.getFunction("execute"),[a,t,c])},Uq=e=>`eip155:${e}`;class jq{config;jsonRpcProvider;user;constructor({config:e,jsonRpcProvider:t,user:n}){this.config=e,this.jsonRpcProvider=t,this.user=n}async postToRelayer(e){const t={id:1,jsonrpc:"2.0",...e},n=await fetch(`${this.config.relayerUrl}/v1/transactions`,{method:"POST",headers:{Authorization:`Bearer ${this.user.accessToken}`,"Content-Type":"application/json"},body:JSON.stringify(t)}),r=await n.json();if(r.error)throw r.error;return r}async ethSendTransaction(e,t){const{chainId:n}=await this.jsonRpcProvider.ready,r={method:"eth_sendTransaction",params:[{to:e,data:t,chainId:Uq(n)}]},{result:i}=await this.postToRelayer(r);return i}async imGetTransactionByHash(e){const t={method:"im_getTransactionByHash",params:[e]},{result:n}=await this.postToRelayer(t);return n}async imGetFeeOptions(e,t){const{chainId:n}=await this.jsonRpcProvider.ready,r={method:"im_getFeeOptions",params:[{userAddress:e,data:t,chainId:Uq(n)}]},{result:i}=await this.postToRelayer(r);return i}}const qq=async({authManager:e,config:t,magicAdapter:n,multiRollupApiClients:r})=>{const i=await e.getUser()||await e.login();if(!i.idToken)throw new Error("User is missing idToken");const a=await n.login(i.idToken,t.network);if(!i.zkEvm){const t=await async function({authManager:e,magicProvider:t,multiRollupApiClients:n,accessToken:r}){const i=new Nh(t).getSigner(),a=await i.getAddress(),o=await Sj("Only sign this message from Immutable Passport",i),s={Authorization:`Bearer ${r}`};try{await n.passportApi.createCounterfactualAddress({createCounterfactualAddressRequest:{ethereumAddress:a,ethereumSignature:o}},{headers:s})}catch(e){throw new _q(wq.INTERNAL_ERROR,`Failed to create counterfactual address: ${e}`)}const u=await e.loginSilent();if(!u?.zkEvm)throw new _q(wq.INTERNAL_ERROR,"Failed to refresh user details");return u}({authManager:e,magicProvider:a,multiRollupApiClients:r,accessToken:i.accessToken});return{user:t,magicProvider:a}}return{user:i,magicProvider:a}},zq=({params:e,magicProvider:t,jsonRpcProvider:n,relayerClient:r,guardianClient:i,user:a})=>i.withConfirmationScreen({width:480,height:520})((async()=>{const o=e[0];if(!o.to)throw new _q(wq.INVALID_PARAMS,'eth_sendTransaction requires a "to" field');const{chainId:s}=await n.ready,u=Tr.from(s),c=new Nh(t).getSigner(),f=await(async(e,t)=>{const n=await e.send("eth_getCode",[t,"latest"]);if(n&&"0x"!==n)return new Hf(t,Oj.mainModule.abi,e).nonce();return 0})(n,a.zkEvm.ethAddress),d={to:o.to,data:o.data,nonce:f,value:o.value,revertOnError:!0},l=await Lq([d],f,u,a.zkEvm.ethAddress,c),p=(await r.imGetFeeOptions(a.zkEvm.ethAddress,l)).find((e=>"IMX"===e.tokenSymbol));if(!p)throw new Error("Failed to retrieve fees for IMX token");const h={nonce:f,to:p.recipientAddress,value:p.tokenPrice,revertOnError:!0};await i.validateEVMTransaction({chainId:Uq(s),nonce:Tq(f),user:a,metaTransactions:[d,h]});const b=await Lq([d,h],f,u,a.zkEvm.ethAddress,c),m=await r.ethSendTransaction(a.zkEvm.ethAddress,b),y=await gq((async()=>{const e=await r.imGetTransactionByHash(m);if(e.status===Bq.PENDING)throw new Error;return e}),{retries:30,interval:1e3,finalErr:new _q(wq.RPC_SERVER_ERROR,"transaction hash not generated in time")});if(![Bq.SUBMITTED,Bq.SUCCESSFUL].includes(y.status))throw new _q(wq.RPC_SERVER_ERROR,`Transaction failed to submit with status ${y.status}`);return y.hash}));class Hq{authManager;config;confirmationScreen;magicAdapter;multiRollupApiClients;jsonRpcProvider;eventEmitter;guardianClient;relayerClient;magicProvider;user;isPassport=!0;constructor({authManager:e,magicAdapter:t,config:n,confirmationScreen:r,multiRollupApiClients:i,passportEventEmitter:a}){this.authManager=e,this.magicAdapter=t,this.config=n,this.confirmationScreen=r,this.jsonRpcProvider=new Cp(this.config.zkEvmRpcUrl),this.multiRollupApiClients=i,this.eventEmitter=new Fq,a.on(Rq.LOGGED_OUT,this.handleLogout)}handleLogout=()=>{const e=this.isLoggedIn();this.magicProvider=void 0,this.user=void 0,this.relayerClient=void 0,this.guardianClient=void 0,e&&this.eventEmitter.emit(Dq.ACCOUNTS_CHANGED,[])};isLoggedIn(){return void 0!==this.magicProvider&&void 0!==this.user&&void 0!==this.relayerClient&&void 0!==this.guardianClient}async performRequest(e){switch(e.method){case"eth_requestAccounts":{if(this.isLoggedIn())return[this.user.zkEvm.ethAddress];const{magicProvider:e,user:t}=await qq({authManager:this.authManager,config:this.config,magicAdapter:this.magicAdapter,multiRollupApiClients:this.multiRollupApiClients});return this.user=t,this.magicProvider=e,this.relayerClient=new jq({config:this.config,jsonRpcProvider:this.jsonRpcProvider,user:this.user}),this.guardianClient=new Aq({accessToken:this.user.accessToken,confirmationScreen:this.confirmationScreen,imxEtherAddress:this.user.zkEvm.ethAddress,config:this.config}),this.eventEmitter.emit(Dq.ACCOUNTS_CHANGED,[this.user.zkEvm.ethAddress]),[this.user.zkEvm.ethAddress]}case"eth_sendTransaction":if(!this.isLoggedIn())throw new _q(vq.UNAUTHORIZED,"Unauthorised - call eth_requestAccounts first");return zq({params:e.params||[],magicProvider:this.magicProvider,guardianClient:this.guardianClient,jsonRpcProvider:this.jsonRpcProvider,relayerClient:this.relayerClient,user:this.user});case"eth_accounts":return this.isLoggedIn()?[this.user.zkEvm.ethAddress]:[];case"eth_gasPrice":case"eth_getBalance":case"eth_getStorageAt":case"eth_estimateGas":case"eth_call":case"eth_blockNumber":case"eth_chainId":case"eth_getBlockByHash":case"eth_getBlockByNumber":case"eth_getTransactionByHash":case"eth_getTransactionReceipt":case"eth_getTransactionCount":return this.jsonRpcProvider.send(e.method,e.params||[]);default:throw new _q(vq.UNSUPPORTED_METHOD,"Method not supported")}}async performJsonRpcRequest(e){const{id:t,jsonrpc:n}=e;try{return{id:t,jsonrpc:n,result:await this.performRequest(e)}}catch(e){let r;return r=e instanceof _q?e:e instanceof Error?new _q(wq.INTERNAL_ERROR,e.message):new _q(wq.INTERNAL_ERROR,"Internal error"),{id:t,jsonrpc:n,error:r}}}async request(e){try{return this.performRequest(e)}catch(e){if(e instanceof _q)throw e;if(e instanceof Error)throw new _q(wq.INTERNAL_ERROR,e.message);throw new _q(wq.INTERNAL_ERROR,"Internal error")}}sendAsync(e,t){if(!t)throw new Error("No callback provided");Array.isArray(e)?Promise.all(e.map(this.performJsonRpcRequest)).then((e=>{t(null,e)})).catch((e=>{t(e,[])})):this.performJsonRpcRequest(e).then((e=>{t(null,e)})).catch((e=>{t(e,null)}))}async send(e,t,n){if("string"==typeof e)return"function"==typeof t?this.sendAsync({method:e,params:[]},t):n?this.sendAsync({method:e,params:Array.isArray(t)?t:[]},n):this.request({method:e,params:Array.isArray(t)?t:[]});if("function"==typeof t)return this.sendAsync(e,t);if(!Array.isArray(e)&&"object"==typeof e)return this.performJsonRpcRequest(e);throw new _q(wq.INVALID_REQUEST,"Invalid request")}on(e,t){this.eventEmitter.on(e,t)}removeListener(e,t){this.eventEmitter.removeListener(e,t)}}var Vq=Object.freeze({__proto__:null,JsonRpcError:_q,get Networks(){return Sq},Passport:class{authManager;config;confirmationScreen;immutableXClient;magicAdapter;multiRollupApiClients;passportImxProviderFactory;passportEventEmitter;constructor(e){this.config=new Mq(e),this.authManager=new hq(this.config),this.magicAdapter=new bq(this.config),this.confirmationScreen=new Pq(this.config),this.immutableXClient=e.overrides?.immutableXClient||new OP({baseConfig:e.baseConfig}),this.multiRollupApiClients=new gt(this.config.multiRollupConfig),this.passportEventEmitter=new Fq,this.passportImxProviderFactory=new xq({authManager:this.authManager,config:this.config,confirmationScreen:this.confirmationScreen,immutableXClient:this.immutableXClient,magicAdapter:this.magicAdapter,passportEventEmitter:this.passportEventEmitter})}async connectImxSilent(){return this.passportImxProviderFactory.getProviderSilent()}async connectImx(){return this.passportImxProviderFactory.getProvider()}async loginWithDeviceFlow(){return this.authManager.loginWithDeviceFlow()}async connectImxDeviceFlow(e,t,n){return this.passportImxProviderFactory.getProviderWithDeviceFlow(e,t,n)}getPKCEAuthorizationUrl(){return this.authManager.getPKCEAuthorizationUrl()}async connectImxPKCEFlow(e,t){return this.passportImxProviderFactory.getProviderWithPKCEFlow(e,t)}checkStoredDeviceFlowCredentials(){return this.authManager.checkStoredDeviceFlowCredentials()}async connectImxWithCredentials(e){return this.passportImxProviderFactory.getProviderWithCredentials(e)}connectEvm(){if(this.config.network===Sq.PRODUCTION)throw new Error("EVM is not supported on production network");return new Hq({passportEventEmitter:this.passportEventEmitter,authManager:this.authManager,magicAdapter:this.magicAdapter,config:this.config,confirmationScreen:this.confirmationScreen,multiRollupApiClients:this.multiRollupApiClients})}async loginCallback(){return this.authManager.loginCallback()}async logout(){await this.authManager.logout(),await this.magicAdapter.logout(),this.passportEventEmitter.emit(Rq.LOGGED_OUT)}async logoutSilentCallback(e){return this.authManager.logoutSilentCallback(e)}async logoutDeviceFlow(){return this.authManager.logoutDeviceFlow()}async getUserInfo(){const e=await this.authManager.getUser();return e?.profile}async getUserInfoDeviceFlow(){const e=await this.authManager.getUserDeviceFlow();return e?.profile}async getIdToken(){const e=await this.authManager.getUser();return e?.idToken}async getAccessToken(){const e=await this.authManager.getUser();return e?.accessToken}},PassportError:oq,get ProviderErrorCode(){return vq},get ProviderEvent(){return Dq},get RpcErrorCode(){return wq}}),Gq=Ct("object"==typeof self?self.FormData:window.FormData),Kq={},Wq={},Xq=Mt(Yj),$q=Mt(ab),Jq={},Yq=Mt(ss),Qq=Mt(Yi),Zq=Mt(io),ez=Mt($f),tz=Mt(mr),nz=Mt(Qo),rz=Mt(Rd),iz=Mt(ul),az=Mt(Ci),oz=Mt(Xn),sz=Mt(td),uz=Mt(Kh),cz=Mt(Cd),fz=Mt(Zr),dz=Mt(ji),lz=Mt(cf),pz=Mt(Ka),hz=Mt(kf),bz=Mt(eb),mz=Mt(hl),yz=Mt(Ml);!function(e){var t=xt&&xt.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=xt&&xt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=xt&&xt.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.formatBytes32String=e.Utf8ErrorFuncs=e.toUtf8String=e.toUtf8CodePoints=e.toUtf8Bytes=e._toEscapedUtf8String=e.nameprep=e.hexDataSlice=e.hexDataLength=e.hexZeroPad=e.hexValue=e.hexStripZeros=e.hexConcat=e.isHexString=e.hexlify=e.base64=e.base58=e.TransactionDescription=e.LogDescription=e.Interface=e.SigningKey=e.HDNode=e.defaultPath=e.isBytesLike=e.isBytes=e.zeroPad=e.stripZeros=e.concat=e.arrayify=e.shallowCopy=e.resolveProperties=e.getStatic=e.defineReadOnly=e.deepCopy=e.checkProperties=e.poll=e.fetchJson=e._fetchData=e.RLP=e.Logger=e.checkResultErrors=e.FormatTypes=e.ParamType=e.FunctionFragment=e.EventFragment=e.ErrorFragment=e.ConstructorFragment=e.Fragment=e.defaultAbiCoder=e.AbiCoder=void 0,e.Indexed=e.Utf8ErrorReason=e.UnicodeNormalizationForm=e.SupportedAlgorithm=e.mnemonicToSeed=e.isValidMnemonic=e.entropyToMnemonic=e.mnemonicToEntropy=e.getAccountPath=e.verifyTypedData=e.verifyMessage=e.recoverPublicKey=e.computePublicKey=e.recoverAddress=e.computeAddress=e.getJsonWalletAddress=e.TransactionTypes=e.serializeTransaction=e.parseTransaction=e.accessListify=e.joinSignature=e.splitSignature=e.soliditySha256=e.solidityKeccak256=e.solidityPack=e.shuffled=e.randomBytes=e.sha512=e.sha256=e.ripemd160=e.keccak256=e.computeHmac=e.commify=e.parseUnits=e.formatUnits=e.parseEther=e.formatEther=e.isAddress=e.getCreate2Address=e.getContractAddress=e.getIcapAddress=e.getAddress=e._TypedDataEncoder=e.id=e.isValidName=e.namehash=e.hashMessage=e.dnsEncode=e.parseBytes32String=void 0;var i=Yq;Object.defineProperty(e,"AbiCoder",{enumerable:!0,get:function(){return i.AbiCoder}}),Object.defineProperty(e,"checkResultErrors",{enumerable:!0,get:function(){return i.checkResultErrors}}),Object.defineProperty(e,"ConstructorFragment",{enumerable:!0,get:function(){return i.ConstructorFragment}}),Object.defineProperty(e,"defaultAbiCoder",{enumerable:!0,get:function(){return i.defaultAbiCoder}}),Object.defineProperty(e,"ErrorFragment",{enumerable:!0,get:function(){return i.ErrorFragment}}),Object.defineProperty(e,"EventFragment",{enumerable:!0,get:function(){return i.EventFragment}}),Object.defineProperty(e,"FormatTypes",{enumerable:!0,get:function(){return i.FormatTypes}}),Object.defineProperty(e,"Fragment",{enumerable:!0,get:function(){return i.Fragment}}),Object.defineProperty(e,"FunctionFragment",{enumerable:!0,get:function(){return i.FunctionFragment}}),Object.defineProperty(e,"Indexed",{enumerable:!0,get:function(){return i.Indexed}}),Object.defineProperty(e,"Interface",{enumerable:!0,get:function(){return i.Interface}}),Object.defineProperty(e,"LogDescription",{enumerable:!0,get:function(){return i.LogDescription}}),Object.defineProperty(e,"ParamType",{enumerable:!0,get:function(){return i.ParamType}}),Object.defineProperty(e,"TransactionDescription",{enumerable:!0,get:function(){return i.TransactionDescription}});var a=Qq;Object.defineProperty(e,"getAddress",{enumerable:!0,get:function(){return a.getAddress}}),Object.defineProperty(e,"getCreate2Address",{enumerable:!0,get:function(){return a.getCreate2Address}}),Object.defineProperty(e,"getContractAddress",{enumerable:!0,get:function(){return a.getContractAddress}}),Object.defineProperty(e,"getIcapAddress",{enumerable:!0,get:function(){return a.getIcapAddress}}),Object.defineProperty(e,"isAddress",{enumerable:!0,get:function(){return a.isAddress}});var o=r(Zq);e.base64=o;var s=ez;Object.defineProperty(e,"base58",{enumerable:!0,get:function(){return s.Base58}});var u=tz;Object.defineProperty(e,"arrayify",{enumerable:!0,get:function(){return u.arrayify}}),Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return u.concat}}),Object.defineProperty(e,"hexConcat",{enumerable:!0,get:function(){return u.hexConcat}}),Object.defineProperty(e,"hexDataSlice",{enumerable:!0,get:function(){return u.hexDataSlice}}),Object.defineProperty(e,"hexDataLength",{enumerable:!0,get:function(){return u.hexDataLength}}),Object.defineProperty(e,"hexlify",{enumerable:!0,get:function(){return u.hexlify}}),Object.defineProperty(e,"hexStripZeros",{enumerable:!0,get:function(){return u.hexStripZeros}}),Object.defineProperty(e,"hexValue",{enumerable:!0,get:function(){return u.hexValue}}),Object.defineProperty(e,"hexZeroPad",{enumerable:!0,get:function(){return u.hexZeroPad}}),Object.defineProperty(e,"isBytes",{enumerable:!0,get:function(){return u.isBytes}}),Object.defineProperty(e,"isBytesLike",{enumerable:!0,get:function(){return u.isBytesLike}}),Object.defineProperty(e,"isHexString",{enumerable:!0,get:function(){return u.isHexString}}),Object.defineProperty(e,"joinSignature",{enumerable:!0,get:function(){return u.joinSignature}}),Object.defineProperty(e,"zeroPad",{enumerable:!0,get:function(){return u.zeroPad}}),Object.defineProperty(e,"splitSignature",{enumerable:!0,get:function(){return u.splitSignature}}),Object.defineProperty(e,"stripZeros",{enumerable:!0,get:function(){return u.stripZeros}});var c=nz;Object.defineProperty(e,"_TypedDataEncoder",{enumerable:!0,get:function(){return c._TypedDataEncoder}}),Object.defineProperty(e,"dnsEncode",{enumerable:!0,get:function(){return c.dnsEncode}}),Object.defineProperty(e,"hashMessage",{enumerable:!0,get:function(){return c.hashMessage}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return c.id}}),Object.defineProperty(e,"isValidName",{enumerable:!0,get:function(){return c.isValidName}}),Object.defineProperty(e,"namehash",{enumerable:!0,get:function(){return c.namehash}});var f=rz;Object.defineProperty(e,"defaultPath",{enumerable:!0,get:function(){return f.defaultPath}}),Object.defineProperty(e,"entropyToMnemonic",{enumerable:!0,get:function(){return f.entropyToMnemonic}}),Object.defineProperty(e,"getAccountPath",{enumerable:!0,get:function(){return f.getAccountPath}}),Object.defineProperty(e,"HDNode",{enumerable:!0,get:function(){return f.HDNode}}),Object.defineProperty(e,"isValidMnemonic",{enumerable:!0,get:function(){return f.isValidMnemonic}}),Object.defineProperty(e,"mnemonicToEntropy",{enumerable:!0,get:function(){return f.mnemonicToEntropy}}),Object.defineProperty(e,"mnemonicToSeed",{enumerable:!0,get:function(){return f.mnemonicToSeed}});var d=iz;Object.defineProperty(e,"getJsonWalletAddress",{enumerable:!0,get:function(){return d.getJsonWalletAddress}});var l=az;Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return l.keccak256}});var p=oz;Object.defineProperty(e,"Logger",{enumerable:!0,get:function(){return p.Logger}});var h=sz;Object.defineProperty(e,"computeHmac",{enumerable:!0,get:function(){return h.computeHmac}}),Object.defineProperty(e,"ripemd160",{enumerable:!0,get:function(){return h.ripemd160}}),Object.defineProperty(e,"sha256",{enumerable:!0,get:function(){return h.sha256}}),Object.defineProperty(e,"sha512",{enumerable:!0,get:function(){return h.sha512}});var b=uz;Object.defineProperty(e,"solidityKeccak256",{enumerable:!0,get:function(){return b.keccak256}}),Object.defineProperty(e,"solidityPack",{enumerable:!0,get:function(){return b.pack}}),Object.defineProperty(e,"soliditySha256",{enumerable:!0,get:function(){return b.sha256}});var m=cz;Object.defineProperty(e,"randomBytes",{enumerable:!0,get:function(){return m.randomBytes}}),Object.defineProperty(e,"shuffled",{enumerable:!0,get:function(){return m.shuffled}});var y=fz;Object.defineProperty(e,"checkProperties",{enumerable:!0,get:function(){return y.checkProperties}}),Object.defineProperty(e,"deepCopy",{enumerable:!0,get:function(){return y.deepCopy}}),Object.defineProperty(e,"defineReadOnly",{enumerable:!0,get:function(){return y.defineReadOnly}}),Object.defineProperty(e,"getStatic",{enumerable:!0,get:function(){return y.getStatic}}),Object.defineProperty(e,"resolveProperties",{enumerable:!0,get:function(){return y.resolveProperties}}),Object.defineProperty(e,"shallowCopy",{enumerable:!0,get:function(){return y.shallowCopy}});var g=r(dz);e.RLP=g;var v=lz;Object.defineProperty(e,"computePublicKey",{enumerable:!0,get:function(){return v.computePublicKey}}),Object.defineProperty(e,"recoverPublicKey",{enumerable:!0,get:function(){return v.recoverPublicKey}}),Object.defineProperty(e,"SigningKey",{enumerable:!0,get:function(){return v.SigningKey}});var w=pz;Object.defineProperty(e,"formatBytes32String",{enumerable:!0,get:function(){return w.formatBytes32String}}),Object.defineProperty(e,"nameprep",{enumerable:!0,get:function(){return w.nameprep}}),Object.defineProperty(e,"parseBytes32String",{enumerable:!0,get:function(){return w.parseBytes32String}}),Object.defineProperty(e,"_toEscapedUtf8String",{enumerable:!0,get:function(){return w._toEscapedUtf8String}}),Object.defineProperty(e,"toUtf8Bytes",{enumerable:!0,get:function(){return w.toUtf8Bytes}}),Object.defineProperty(e,"toUtf8CodePoints",{enumerable:!0,get:function(){return w.toUtf8CodePoints}}),Object.defineProperty(e,"toUtf8String",{enumerable:!0,get:function(){return w.toUtf8String}}),Object.defineProperty(e,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return w.Utf8ErrorFuncs}});var _=hz;Object.defineProperty(e,"accessListify",{enumerable:!0,get:function(){return _.accessListify}}),Object.defineProperty(e,"computeAddress",{enumerable:!0,get:function(){return _.computeAddress}}),Object.defineProperty(e,"parseTransaction",{enumerable:!0,get:function(){return _.parse}}),Object.defineProperty(e,"recoverAddress",{enumerable:!0,get:function(){return _.recoverAddress}}),Object.defineProperty(e,"serializeTransaction",{enumerable:!0,get:function(){return _.serialize}}),Object.defineProperty(e,"TransactionTypes",{enumerable:!0,get:function(){return _.TransactionTypes}});var E=bz;Object.defineProperty(e,"commify",{enumerable:!0,get:function(){return E.commify}}),Object.defineProperty(e,"formatEther",{enumerable:!0,get:function(){return E.formatEther}}),Object.defineProperty(e,"parseEther",{enumerable:!0,get:function(){return E.parseEther}}),Object.defineProperty(e,"formatUnits",{enumerable:!0,get:function(){return E.formatUnits}}),Object.defineProperty(e,"parseUnits",{enumerable:!0,get:function(){return E.parseUnits}});var T=mz;Object.defineProperty(e,"verifyMessage",{enumerable:!0,get:function(){return T.verifyMessage}}),Object.defineProperty(e,"verifyTypedData",{enumerable:!0,get:function(){return T.verifyTypedData}});var A=yz;Object.defineProperty(e,"_fetchData",{enumerable:!0,get:function(){return A._fetchData}}),Object.defineProperty(e,"fetchJson",{enumerable:!0,get:function(){return A.fetchJson}}),Object.defineProperty(e,"poll",{enumerable:!0,get:function(){return A.poll}});var R=sz;Object.defineProperty(e,"SupportedAlgorithm",{enumerable:!0,get:function(){return R.SupportedAlgorithm}});var S=pz;Object.defineProperty(e,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return S.UnicodeNormalizationForm}}),Object.defineProperty(e,"Utf8ErrorReason",{enumerable:!0,get:function(){return S.Utf8ErrorReason}})}(Jq);var gz={};Object.defineProperty(gz,"__esModule",{value:!0}),gz.DomainRegistryABI=void 0;gz.DomainRegistryABI=[{inputs:[{internalType:"string",name:"domain",type:"string"}],name:"DomainAlreadyRegistered",type:"error"},{inputs:[{internalType:"bytes4",name:"tag",type:"bytes4"},{internalType:"uint256",name:"maxIndex",type:"uint256"},{internalType:"uint256",name:"suppliedIndex",type:"uint256"}],name:"DomainIndexOutOfRange",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"domain",type:"string"},{indexed:!1,internalType:"bytes4",name:"tag",type:"bytes4"},{indexed:!1,internalType:"uint256",name:"index",type:"uint256"}],name:"DomainRegistered",type:"event"},{inputs:[{internalType:"bytes4",name:"tag",type:"bytes4"},{internalType:"uint256",name:"index",type:"uint256"}],name:"getDomain",outputs:[{internalType:"string",name:"domain",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"tag",type:"bytes4"}],name:"getDomains",outputs:[{internalType:"string[]",name:"domains",type:"string[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"tag",type:"bytes4"}],name:"getNumberOfDomains",outputs:[{internalType:"uint256",name:"totalDomains",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"string",name:"domain",type:"string"}],name:"setDomain",outputs:[{internalType:"bytes4",name:"tag",type:"bytes4"}],stateMutability:"nonpayable",type:"function"}];var vz={};Object.defineProperty(vz,"__esModule",{value:!0}),vz.SeaportABIv14=void 0;vz.SeaportABIv14=[{inputs:[{internalType:"address",name:"conduitController",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"BadContractSignature",type:"error"},{inputs:[],name:"BadFraction",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"BadReturnValueFromERC20OnTransfer",type:"error"},{inputs:[{internalType:"uint8",name:"v",type:"uint8"}],name:"BadSignatureV",type:"error"},{inputs:[],name:"CannotCancelOrder",type:"error"},{inputs:[],name:"ConsiderationCriteriaResolverOutOfRange",type:"error"},{inputs:[],name:"ConsiderationLengthNotEqualToTotalOriginal",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"considerationIndex",type:"uint256"},{internalType:"uint256",name:"shortfallAmount",type:"uint256"}],name:"ConsiderationNotMet",type:"error"},{inputs:[],name:"CriteriaNotEnabledForItem",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"identifiers",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],name:"ERC1155BatchTransferGenericFailure",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"EtherTransferGenericFailure",type:"error"},{inputs:[],name:"InexactFraction",type:"error"},{inputs:[],name:"InsufficientEtherSupplied",type:"error"},{inputs:[],name:"Invalid1155BatchTransferEncoding",type:"error"},{inputs:[],name:"InvalidBasicOrderParameterEncoding",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"InvalidCallToConduit",type:"error"},{inputs:[{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"address",name:"conduit",type:"address"}],name:"InvalidConduit",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"InvalidContractOrder",type:"error"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"InvalidERC721TransferAmount",type:"error"},{inputs:[],name:"InvalidFulfillmentComponentData",type:"error"},{inputs:[{internalType:"uint256",name:"value",type:"uint256"}],name:"InvalidMsgValue",type:"error"},{inputs:[],name:"InvalidNativeOfferItem",type:"error"},{inputs:[],name:"InvalidProof",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"InvalidRestrictedOrder",type:"error"},{inputs:[],name:"InvalidSignature",type:"error"},{inputs:[],name:"InvalidSigner",type:"error"},{inputs:[{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"}],name:"InvalidTime",type:"error"},{inputs:[{internalType:"uint256",name:"fulfillmentIndex",type:"uint256"}],name:"MismatchedFulfillmentOfferAndConsiderationComponents",type:"error"},{inputs:[{internalType:"enum Side",name:"side",type:"uint8"}],name:"MissingFulfillmentComponentOnAggregation",type:"error"},{inputs:[],name:"MissingItemAmount",type:"error"},{inputs:[],name:"MissingOriginalConsiderationItems",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"NoContract",type:"error"},{inputs:[],name:"NoReentrantCalls",type:"error"},{inputs:[],name:"NoSpecifiedOrdersAvailable",type:"error"},{inputs:[],name:"OfferAndConsiderationRequiredOnFulfillment",type:"error"},{inputs:[],name:"OfferCriteriaResolverOutOfRange",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderAlreadyFilled",type:"error"},{inputs:[{internalType:"enum Side",name:"side",type:"uint8"}],name:"OrderCriteriaResolverOutOfRange",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderIsCancelled",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderPartiallyFilled",type:"error"},{inputs:[],name:"PartialFillsNotEnabledForOrder",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"TokenTransferGenericFailure",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"considerationIndex",type:"uint256"}],name:"UnresolvedConsiderationCriteria",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"offerIndex",type:"uint256"}],name:"UnresolvedOfferCriteria",type:"error"},{inputs:[],name:"UnusedItemParameters",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"newCounter",type:"uint256"},{indexed:!0,internalType:"address",name:"offerer",type:"address"}],name:"CounterIncremented",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"}],name:"OrderCancelled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"},{indexed:!1,internalType:"address",name:"recipient",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],indexed:!1,internalType:"struct SpentItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],indexed:!1,internalType:"struct ReceivedItem[]",name:"consideration",type:"tuple[]"}],name:"OrderFulfilled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],indexed:!1,internalType:"struct OrderParameters",name:"orderParameters",type:"tuple"}],name:"OrderValidated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32[]",name:"orderHashes",type:"bytes32[]"}],name:"OrdersMatched",type:"event"},{inputs:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"counter",type:"uint256"}],internalType:"struct OrderComponents[]",name:"orders",type:"tuple[]"}],name:"cancel",outputs:[{internalType:"bool",name:"cancelled",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"uint120",name:"numerator",type:"uint120"},{internalType:"uint120",name:"denominator",type:"uint120"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes",name:"extraData",type:"bytes"}],internalType:"struct AdvancedOrder",name:"advancedOrder",type:"tuple"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"enum Side",name:"side",type:"uint8"},{internalType:"uint256",name:"index",type:"uint256"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"bytes32[]",name:"criteriaProof",type:"bytes32[]"}],internalType:"struct CriteriaResolver[]",name:"criteriaResolvers",type:"tuple[]"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"address",name:"recipient",type:"address"}],name:"fulfillAdvancedOrder",outputs:[{internalType:"bool",name:"fulfilled",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"uint120",name:"numerator",type:"uint120"},{internalType:"uint120",name:"denominator",type:"uint120"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes",name:"extraData",type:"bytes"}],internalType:"struct AdvancedOrder[]",name:"advancedOrders",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"enum Side",name:"side",type:"uint8"},{internalType:"uint256",name:"index",type:"uint256"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"bytes32[]",name:"criteriaProof",type:"bytes32[]"}],internalType:"struct CriteriaResolver[]",name:"criteriaResolvers",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"offerFulfillments",type:"tuple[][]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"considerationFulfillments",type:"tuple[][]"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"maximumFulfilled",type:"uint256"}],name:"fulfillAvailableAdvancedOrders",outputs:[{internalType:"bool[]",name:"availableOrders",type:"bool[]"},{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"executions",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order[]",name:"orders",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"offerFulfillments",type:"tuple[][]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"considerationFulfillments",type:"tuple[][]"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"uint256",name:"maximumFulfilled",type:"uint256"}],name:"fulfillAvailableOrders",outputs:[{internalType:"bool[]",name:"availableOrders",type:"bool[]"},{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"executions",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"considerationToken",type:"address"},{internalType:"uint256",name:"considerationIdentifier",type:"uint256"},{internalType:"uint256",name:"considerationAmount",type:"uint256"},{internalType:"address payable",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{internalType:"address",name:"offerToken",type:"address"},{internalType:"uint256",name:"offerIdentifier",type:"uint256"},{internalType:"uint256",name:"offerAmount",type:"uint256"},{internalType:"enum BasicOrderType",name:"basicOrderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"offererConduitKey",type:"bytes32"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalAdditionalRecipients",type:"uint256"},{components:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct AdditionalRecipient[]",name:"additionalRecipients",type:"tuple[]"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct BasicOrderParameters",name:"parameters",type:"tuple"}],name:"fulfillBasicOrder",outputs:[{internalType:"bool",name:"fulfilled",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order",name:"order",type:"tuple"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"}],name:"fulfillOrder",outputs:[{internalType:"bool",name:"fulfilled",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"contractOfferer",type:"address"}],name:"getContractOffererNonce",outputs:[{internalType:"uint256",name:"nonce",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"offerer",type:"address"}],name:"getCounter",outputs:[{internalType:"uint256",name:"counter",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"counter",type:"uint256"}],internalType:"struct OrderComponents",name:"order",type:"tuple"}],name:"getOrderHash",outputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"getOrderStatus",outputs:[{internalType:"bool",name:"isValidated",type:"bool"},{internalType:"bool",name:"isCancelled",type:"bool"},{internalType:"uint256",name:"totalFilled",type:"uint256"},{internalType:"uint256",name:"totalSize",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"incrementCounter",outputs:[{internalType:"uint256",name:"newCounter",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"information",outputs:[{internalType:"string",name:"version",type:"string"},{internalType:"bytes32",name:"domainSeparator",type:"bytes32"},{internalType:"address",name:"conduitController",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"uint120",name:"numerator",type:"uint120"},{internalType:"uint120",name:"denominator",type:"uint120"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes",name:"extraData",type:"bytes"}],internalType:"struct AdvancedOrder[]",name:"orders",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"enum Side",name:"side",type:"uint8"},{internalType:"uint256",name:"index",type:"uint256"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"bytes32[]",name:"criteriaProof",type:"bytes32[]"}],internalType:"struct CriteriaResolver[]",name:"criteriaResolvers",type:"tuple[]"},{components:[{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"offerComponents",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"considerationComponents",type:"tuple[]"}],internalType:"struct Fulfillment[]",name:"fulfillments",type:"tuple[]"},{internalType:"address",name:"recipient",type:"address"}],name:"matchAdvancedOrders",outputs:[{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"executions",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order[]",name:"orders",type:"tuple[]"},{components:[{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"offerComponents",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"considerationComponents",type:"tuple[]"}],internalType:"struct Fulfillment[]",name:"fulfillments",type:"tuple[]"}],name:"matchOrders",outputs:[{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"executions",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"contractName",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order[]",name:"orders",type:"tuple[]"}],name:"validate",outputs:[{internalType:"bool",name:"validated",type:"bool"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}];var wz={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DOMAIN_REGISTRY_ADDRESS=e.CROSS_CHAIN_SEAPORT_V1_5_ADDRESS=e.CROSS_CHAIN_SEAPORT_V1_4_ADDRESS=e.KNOWN_CONDUIT_KEYS_TO_CONDUIT=e.NO_CONDUIT=e.ONE_HUNDRED_PERCENT_BP=e.MAX_INT=e.BasicOrderRouteType=e.Side=e.ItemType=e.OrderType=e.EIP_712_BULK_ORDER_TYPE=e.EIP_712_ORDER_TYPE=e.OPENSEA_CONDUIT_ADDRESS=e.OPENSEA_CONDUIT_KEY=e.SEAPORT_CONTRACT_VERSION_V1_5=e.SEAPORT_CONTRACT_VERSION_V1_4=e.SEAPORT_CONTRACT_NAME=void 0;const t=$q;var n,r,i,a;e.SEAPORT_CONTRACT_NAME="Seaport",e.SEAPORT_CONTRACT_VERSION_V1_4="1.4",e.SEAPORT_CONTRACT_VERSION_V1_5="1.5",e.OPENSEA_CONDUIT_KEY="0x0000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f0000",e.OPENSEA_CONDUIT_ADDRESS="0x1e0049783f008a0085193e00003d00cd54003c71",e.EIP_712_ORDER_TYPE={OrderComponents:[{name:"offerer",type:"address"},{name:"zone",type:"address"},{name:"offer",type:"OfferItem[]"},{name:"consideration",type:"ConsiderationItem[]"},{name:"orderType",type:"uint8"},{name:"startTime",type:"uint256"},{name:"endTime",type:"uint256"},{name:"zoneHash",type:"bytes32"},{name:"salt",type:"uint256"},{name:"conduitKey",type:"bytes32"},{name:"counter",type:"uint256"}],OfferItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"}],ConsiderationItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"},{name:"recipient",type:"address"}]},e.EIP_712_BULK_ORDER_TYPE={BulkOrder:[{name:"tree",type:"OrderComponents[2][2][2][2][2][2][2]"}],OrderComponents:[{name:"offerer",type:"address"},{name:"zone",type:"address"},{name:"offer",type:"OfferItem[]"},{name:"consideration",type:"ConsiderationItem[]"},{name:"orderType",type:"uint8"},{name:"startTime",type:"uint256"},{name:"endTime",type:"uint256"},{name:"zoneHash",type:"bytes32"},{name:"salt",type:"uint256"},{name:"conduitKey",type:"bytes32"},{name:"counter",type:"uint256"}],OfferItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"}],ConsiderationItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"},{name:"recipient",type:"address"}]},function(e){e[e.FULL_OPEN=0]="FULL_OPEN",e[e.PARTIAL_OPEN=1]="PARTIAL_OPEN",e[e.FULL_RESTRICTED=2]="FULL_RESTRICTED",e[e.PARTIAL_RESTRICTED=3]="PARTIAL_RESTRICTED"}(n||(e.OrderType=n={})),function(e){e[e.NATIVE=0]="NATIVE",e[e.ERC20=1]="ERC20",e[e.ERC721=2]="ERC721",e[e.ERC1155=3]="ERC1155",e[e.ERC721_WITH_CRITERIA=4]="ERC721_WITH_CRITERIA",e[e.ERC1155_WITH_CRITERIA=5]="ERC1155_WITH_CRITERIA"}(r||(e.ItemType=r={})),function(e){e[e.OFFER=0]="OFFER",e[e.CONSIDERATION=1]="CONSIDERATION"}(i||(e.Side=i={})),function(e){e[e.ETH_TO_ERC721=0]="ETH_TO_ERC721",e[e.ETH_TO_ERC1155=1]="ETH_TO_ERC1155",e[e.ERC20_TO_ERC721=2]="ERC20_TO_ERC721",e[e.ERC20_TO_ERC1155=3]="ERC20_TO_ERC1155",e[e.ERC721_TO_ERC20=4]="ERC721_TO_ERC20",e[e.ERC1155_TO_ERC20=5]="ERC1155_TO_ERC20"}(a||(e.BasicOrderRouteType=a={})),e.MAX_INT=t.BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),e.ONE_HUNDRED_PERCENT_BP=1e4,e.NO_CONDUIT="0x0000000000000000000000000000000000000000000000000000000000000000",e.KNOWN_CONDUIT_KEYS_TO_CONDUIT={[e.OPENSEA_CONDUIT_KEY]:e.OPENSEA_CONDUIT_ADDRESS},e.CROSS_CHAIN_SEAPORT_V1_4_ADDRESS="0x00000000000001ad428e4906aE43D8F9852d0dD6",e.CROSS_CHAIN_SEAPORT_V1_5_ADDRESS="0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC",e.DOMAIN_REGISTRY_ADDRESS="0x000000000DaD0DE04D2B2D4a5A74581EBA94124A"}(wz);var _z={},Ez={};Object.defineProperty(Ez,"__esModule",{value:!0}),Ez.ERC20ABI=void 0;Ez.ERC20ABI=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"PERMIT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}];var Tz={};Object.defineProperty(Tz,"__esModule",{value:!0}),Tz.ERC721ABI=void 0;Tz.ERC721ABI=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"pure",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}];var Az,Rz={},Sz={};function kz(){if(Az)return Sz;Az=1,Object.defineProperty(Sz,"__esModule",{value:!0}),Sz.getItemToCriteriaMap=Sz.generateCriteriaResolvers=void 0;const e=wz,t=xz();Sz.generateCriteriaResolvers=({orders:n,offerCriterias:r=[[]],considerationCriterias:i=[[]]})=>{const a=n.flatMap(((n,r)=>n.parameters.offer.map(((t,n)=>({orderIndex:r,item:t,index:n,side:e.Side.OFFER}))).filter((({item:e})=>(0,t.isCriteriaItem)(e.itemType))))),o=n.flatMap(((n,r)=>n.parameters.consideration.map(((t,n)=>({orderIndex:r,item:t,index:n,side:e.Side.CONSIDERATION}))).filter((({item:e})=>(0,t.isCriteriaItem)(e.itemType))))),s=(e,t)=>e.map((({orderIndex:e,item:n,index:r,side:i})=>{const a=n.identifierOrCriteria||"0",o=t[e][r];return{orderIndex:e,index:r,side:i,identifier:o.identifier,criteriaProof:"0"===a?[]:o.proof}}));return[...s(a,r),...s(o,i)]};return Sz.getItemToCriteriaMap=(e,n)=>{const r=[...n];return e.reduce(((e,n)=>((0,t.isCriteriaItem)(n.itemType)&&e.set(n,r.shift()),e)),new Map)},Sz}var Oz,Iz={};function xz(){return Oz||(Oz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMaximumSizeForOrder=e.getSummedTokenAndIdentifierAmounts=e.getPresentItemAmount=e.isCriteriaItem=e.isErc1155Item=e.isErc721Item=e.isErc20Item=e.isNativeCurrencyItem=e.isCurrencyItem=void 0;const t=$q,n=wz,r=kz(),i=Iz;e.isCurrencyItem=({itemType:e})=>[n.ItemType.NATIVE,n.ItemType.ERC20].includes(e);e.isNativeCurrencyItem=({itemType:e})=>e===n.ItemType.NATIVE;e.isErc20Item=e=>e===n.ItemType.ERC20;e.isErc721Item=e=>[n.ItemType.ERC721,n.ItemType.ERC721_WITH_CRITERIA].includes(e);e.isErc1155Item=e=>[n.ItemType.ERC1155,n.ItemType.ERC1155_WITH_CRITERIA].includes(e);e.isCriteriaItem=e=>[n.ItemType.ERC721_WITH_CRITERIA,n.ItemType.ERC1155_WITH_CRITERIA].includes(e);e.getPresentItemAmount=({startAmount:e,endAmount:n,timeBasedItemParams:r})=>{const i=t.BigNumber.from(e),a=t.BigNumber.from(n);if(!r)return i.gt(a)?i:a;const{isConsiderationItem:o,currentBlockTimestamp:s,ascendingAmountTimestampBuffer:u,startTime:c,endTime:f}=r,d=t.BigNumber.from(f).sub(c),l=a.gt(e),p=t.BigNumber.from(l?s+u:s);if(p.lt(c))return i;const h=(p.gt(f)?t.BigNumber.from(f):p).sub(c),b=d.sub(h);return i.mul(b).add(a.mul(h)).add(o?d.sub(1):0).div(d)};e.getSummedTokenAndIdentifierAmounts=({items:n,criterias:i,timeBasedItemParams:a})=>{const o=(0,r.getItemToCriteriaMap)(n,i),s=n.reduce(((n,r)=>{var i,s,u,c;const f=null!==(s=null===(i=o.get(r))||void 0===i?void 0:i.identifier)&&void 0!==s?s:r.identifierOrCriteria;return Object.assign(Object.assign({},n),{[r.token]:Object.assign(Object.assign({},n[r.token]),{[f]:(null!==(c=null===(u=n[r.token])||void 0===u?void 0:u[f])&&void 0!==c?c:t.BigNumber.from(0)).add((0,e.getPresentItemAmount)({startAmount:r.startAmount,endAmount:r.endAmount,timeBasedItemParams:a}))})})}),{});return s};e.getMaximumSizeForOrder=({parameters:{offer:e,consideration:t}})=>{const n=[...e,...t].flatMap((({startAmount:e,endAmount:t})=>[e,t]));return(0,i.findGcd)(n)}}(Rz)),Rz}!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.findGcd=e.gcd=void 0;const t=$q;e.gcd=(n,r)=>{const i=t.BigNumber.from(n),a=t.BigNumber.from(r);return i.eq(0)?a:(0,e.gcd)(a.mod(n),i)};e.findGcd=n=>{let r=t.BigNumber.from(n[0]);for(let t=1;t<n.length;t++)if(r=(0,e.gcd)(n[t],r),r.eq(1))return r;return r}}(Iz);var Cz={};!function(e){var t=xt&&xt.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.getTagFromDomain=e.getTransactionMethods=e.executeAllActions=void 0;const n=Jq;e.executeAllActions=e=>t(void 0,void 0,void 0,(function*(){for(let t=0;t<e.length-1;t++){const n=e[t];if("approval"===n.type){const e=yield n.transactionMethods.transact();yield e.wait()}}const t=e[e.length-1];switch(t.type){case"create":return t.createOrder();case"createBulk":return t.createBulkOrders();default:return t.transactionMethods.transact()}}));e.getTransactionMethods=(n,r,i,a)=>{const o=i[i.length-1];let s;(e=>{const t=["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","type","accessList","customData","ccipReadEnabled","value","blockTag","CallOverrides"];return void 0===e||Object.keys(e).every((e=>t.includes(e)))})(o)&&(s=o,i.pop());const u=o=>t(void 0,void 0,void 0,(function*(){const t=Object.assign(Object.assign({},s),o),u=yield n.populateTransaction[r](...i,t);if(a){const t=(0,e.getTagFromDomain)(a);u.data=u.data+t}return u}));return{callStatic:e=>{const t=Object.assign(Object.assign({},s),e);return n.callStatic[r](...i,t)},estimateGas:e=>{const t=Object.assign(Object.assign({},s),e);return n.estimateGas[r](...i,t)},transact:e=>t(void 0,void 0,void 0,(function*(){const t=Object.assign(Object.assign({},s),e),r=yield u(t);return n.signer.sendTransaction(r)})),buildTransaction:u}};e.getTagFromDomain=e=>(0,n.keccak256)((0,n.toUtf8Bytes)(e)).slice(2,10)}(Cz);var Mz=xt&&xt.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(_z,"__esModule",{value:!0}),_z.getApprovalActions=_z.approvedItemAmount=void 0;const Nz=$q,Pz=Ez,Bz=Tz,Dz=wz,Fz=xz(),Lz=Cz;_z.approvedItemAmount=(e,t,n,r)=>Mz(void 0,void 0,void 0,(function*(){if((0,Fz.isErc721Item)(t.itemType)||(0,Fz.isErc1155Item)(t.itemType)){return new Nz.Contract(t.token,Bz.ERC721ABI,r).isApprovedForAll(e,n).then((e=>e?Dz.MAX_INT:Nz.BigNumber.from(0)))}if(t.itemType===Dz.ItemType.ERC20){return new Nz.Contract(t.token,Pz.ERC20ABI,r).allowance(e,n)}return Dz.MAX_INT})),_z.getApprovalActions=function(e,t,n){return e.filter(((t,n)=>n===e.length-1||e[n+1].token!==t.token)).map((({token:e,operator:r,itemType:i,identifierOrCriteria:a,requiredApprovedAmount:o})=>{const s=(0,Fz.isErc1155Item)(i);if((0,Fz.isErc721Item)(i)||s){const o=new Nz.Contract(e,Bz.ERC721ABI,n);return{type:"approval",token:e,identifierOrCriteria:a,itemType:i,operator:r,transactionMethods:(0,Lz.getTransactionMethods)(o.connect(n),t&&!s?"approve":"setApprovalForAll",[r,!(t&&!s)||a])}}{const s=new Nz.Contract(e,Pz.ERC20ABI,n);return{type:"approval",token:e,identifierOrCriteria:a,itemType:i,transactionMethods:(0,Lz.getTransactionMethods)(s.connect(n),"approve",[r,t?o:Dz.MAX_INT]),operator:r}}}))};var Uz={},jz={},qz={};Object.defineProperty(qz,"__esModule",{value:!0}),qz.ERC1155ABI=void 0;qz.ERC1155ABI=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"amounts",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"owners",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"balances",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"uri",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}];var zz=xt&&xt.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(jz,"__esModule",{value:!0}),jz.balanceOf=void 0;const Hz=$q,Vz=qz,Gz=Ez,Kz=Tz,Wz=wz,Xz=xz();jz.balanceOf=(e,t,n,r)=>zz(void 0,void 0,void 0,(function*(){if((0,Xz.isErc721Item)(t.itemType)){const i=new Hz.Contract(t.token,Kz.ERC721ABI,n);return t.itemType===Wz.ItemType.ERC721_WITH_CRITERIA?r?i.ownerOf(r.identifier).then((t=>Hz.BigNumber.from(Number(t.toLowerCase()===e.toLowerCase())))):i.balanceOf(e):i.ownerOf(t.identifierOrCriteria).then((t=>Hz.BigNumber.from(Number(t.toLowerCase()===e.toLowerCase()))))}if((0,Xz.isErc1155Item)(t.itemType)){const i=new Hz.Contract(t.token,Vz.ERC1155ABI,n);if(t.itemType===Wz.ItemType.ERC1155_WITH_CRITERIA){if(!r){const e=Hz.BigNumber.from(t.startAmount),n=Hz.BigNumber.from(t.endAmount);return e.gt(n)?e:n}return i.balanceOf(e,r.identifier)}return i.balanceOf(e,t.identifierOrCriteria)}if((0,Xz.isErc20Item)(t.itemType)){return new Hz.Contract(t.token,Gz.ERC20ABI,n).balanceOf(e)}return n.getBalance(e)})),function(e){var t=xt&&xt.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.validateStandardFulfillBalancesAndApprovals=e.validateBasicFulfillBalancesAndApprovals=e.validateOfferBalancesAndApprovals=e.getInsufficientBalanceAndApprovalAmounts=e.getBalancesAndApprovals=void 0;const n=$q,r=wz,i=_z,a=jz,o=kz(),s=xz(),u=(e,t,n)=>{const r=e.find((({token:e,identifierOrCriteria:r})=>t.toLowerCase()===e.toLowerCase()&&r.toLowerCase()===n.toLowerCase()));if(!r)throw new Error("Balances and approvals didn't contain all tokens and identifiers");return r};e.getBalancesAndApprovals=({owner:e,items:u,criterias:c,operator:f,multicallProvider:d})=>t(void 0,void 0,void 0,(function*(){const l=(0,o.getItemToCriteriaMap)(u,c);return Promise.all(u.map((o=>t(void 0,void 0,void 0,(function*(){var t,u;let c=Promise.resolve(n.BigNumber.from(0));return c=(0,s.isErc721Item)(o.itemType)||(0,s.isErc1155Item)(o.itemType)||(0,s.isErc20Item)(o.itemType)?(0,i.approvedItemAmount)(e,o,f,d):Promise.resolve(r.MAX_INT),{token:o.token,identifierOrCriteria:null!==(u=null===(t=l.get(o))||void 0===t?void 0:t.identifier)&&void 0!==u?u:o.identifierOrCriteria,balance:yield(0,a.balanceOf)(e,o,d,l.get(o)),approvedAmount:yield c,itemType:o.itemType}})))))}));e.getInsufficientBalanceAndApprovalAmounts=({balancesAndApprovals:e,tokenAndIdentifierAmounts:t,operator:n})=>{const r=[...Object.entries(t).map((([e,t])=>Object.entries(t).map((([t,n])=>[e,t,n]))))].flat(),i=t=>r.filter((([n,r,i])=>u(e,n,r)[t].lt(i))).map((([n,r,i])=>{const a=u(e,n,r);return{token:n,identifierOrCriteria:r,requiredAmount:i,amountHave:a[t],itemType:a.itemType}})),[a,o]=[i("balance"),i("approvedAmount").map((e=>({token:e.token,identifierOrCriteria:e.identifierOrCriteria,approvedAmount:e.amountHave,requiredApprovedAmount:e.requiredAmount,itemType:e.itemType,operator:n})))];return{insufficientBalances:a,insufficientApprovals:o}};e.validateOfferBalancesAndApprovals=({offer:t,criterias:n,balancesAndApprovals:r,timeBasedItemParams:i,throwOnInsufficientBalances:a=!0,throwOnInsufficientApprovals:o,operator:u})=>{const{insufficientBalances:c,insufficientApprovals:f}=(0,e.getInsufficientBalanceAndApprovalAmounts)({balancesAndApprovals:r,tokenAndIdentifierAmounts:(0,s.getSummedTokenAndIdentifierAmounts)({items:t,criterias:n,timeBasedItemParams:i?Object.assign(Object.assign({},i),{isConsiderationItem:!1}):void 0}),operator:u});if(a&&c.length>0)throw new Error("The offerer does not have the amount needed to create or fulfill.");if(o&&f.length>0)throw new Error("The offerer does not have the sufficient approvals.");return f};e.validateBasicFulfillBalancesAndApprovals=({offer:t,consideration:n,offererBalancesAndApprovals:r,fulfillerBalancesAndApprovals:i,timeBasedItemParams:a,offererOperator:o,fulfillerOperator:u})=>{(0,e.validateOfferBalancesAndApprovals)({offer:t,criterias:[],balancesAndApprovals:r,timeBasedItemParams:a,throwOnInsufficientApprovals:!0,operator:o});const c=n.filter((e=>e.itemType!==t[0].itemType)),{insufficientBalances:f,insufficientApprovals:d}=(0,e.getInsufficientBalanceAndApprovalAmounts)({balancesAndApprovals:i,tokenAndIdentifierAmounts:(0,s.getSummedTokenAndIdentifierAmounts)({items:c,criterias:[],timeBasedItemParams:Object.assign(Object.assign({},a),{isConsiderationItem:!0})}),operator:u});if(f.length>0)throw new Error("The fulfiller does not have the balances needed to fulfill.");return d};e.validateStandardFulfillBalancesAndApprovals=({offer:t,consideration:n,offerCriteria:r,considerationCriteria:i,offererBalancesAndApprovals:a,fulfillerBalancesAndApprovals:o,timeBasedItemParams:u,offererOperator:f,fulfillerOperator:d})=>{(0,e.validateOfferBalancesAndApprovals)({offer:t,criterias:r,balancesAndApprovals:a,timeBasedItemParams:u,throwOnInsufficientApprovals:!0,operator:f});const l=c({items:t,criterias:r,balancesAndApprovals:o,timeBasedItemParams:u}),{insufficientBalances:p,insufficientApprovals:h}=(0,e.getInsufficientBalanceAndApprovalAmounts)({balancesAndApprovals:l,tokenAndIdentifierAmounts:(0,s.getSummedTokenAndIdentifierAmounts)({items:n,criterias:i,timeBasedItemParams:Object.assign(Object.assign({},u),{isConsiderationItem:!0})}),operator:d});if(p.length>0)throw new Error("The fulfiller does not have the balances needed to fulfill.");return h};const c=({items:e,criterias:t,timeBasedItemParams:n,balancesAndApprovals:r})=>{const i=(0,s.getSummedTokenAndIdentifierAmounts)({items:e,criterias:t,timeBasedItemParams:Object.assign(Object.assign({},n),{isConsiderationItem:!1})}),a=r.map((e=>Object.assign({},e)));return Object.entries(i).forEach((([e,t])=>Object.entries(t).forEach((([t,n])=>{const r=u(a,e,t),i=a.indexOf(r);a[i].balance=a[i].balance.add(n)})))),a}}(Uz);var $z,Jz={},Yz={},Qz={},Zz={},eH={exports:{}},tH={exports:{}};function nH(){return $z||($z=1,function(e,t){e.exports=function(){var e=e||function(e,t){var n=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),r={},i=r.lib={},a=i.Base={extend:function(e){var t=n(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},o=i.WordArray=a.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var a=0;a<i;a++){var o=n[a>>>2]>>>24-a%4*8&255;t[r+a>>>2]|=o<<24-(r+a)%4*8}else for(a=0;a<i;a+=4)t[r+a>>>2]=n[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n,r=[],i=function(t){var n=987654321,r=4294967295;return function(){var i=((n=36969*(65535&n)+(n>>16)&r)<<16)+(t=18e3*(65535&t)+(t>>16)&r)&r;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}},a=0;a<t;a+=4){var s=i(4294967296*(n||e.random()));n=987654071*s(),r.push(4294967296*s()|0)}return new o.init(r,t)}}),s=r.enc={},u=s.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var a=t[i>>>2]>>>24-i%4*8&255;r.push((a>>>4).toString(16)),r.push((15&a).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new o.init(n,t/2)}},c=s.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var a=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(a))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new o.init(n,t)}},f=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},d=i.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,i=n.sigBytes,a=this.blockSize,s=i/(4*a),u=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,c=e.min(4*u,i);if(u){for(var f=0;f<u;f+=a)this._doProcessBlock(r,f);var d=r.splice(0,u);n.sigBytes-=c}return new o.init(d,c)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});i.Hasher=d.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new l.HMAC.init(e,n).finalize(t)}}});var l=r.algo={};return r}(Math);return e}()}(tH)),tH.exports}!function(e,t){e.exports=function(e){return function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.algo,s=[],u=[];!function(){function e(e){for(var n=t.sqrt(e),r=2;r<=n;r++)if(!(e%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(s[i]=n(t.pow(r,.5))),u[i]=n(t.pow(r,1/3)),i++),r++}();var c=[],f=o.SHA256=a.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],f=n[5],d=n[6],l=n[7],p=0;p<64;p++){if(p<16)c[p]=0|e[t+p];else{var h=c[p-15],b=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,m=c[p-2],y=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;c[p]=b+c[p-7]+y+c[p-16]}var g=r&i^r&a^i&a,v=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),w=l+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&f^~s&d)+u[p]+c[p];l=d,d=f,f=s,s=o+w|0,o=a,a=i,i=r,r=w+(v+g)|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+a|0,n[3]=n[3]+o|0,n[4]=n[4]+s|0,n[5]=n[5]+f|0,n[6]=n[6]+d|0,n[7]=n[7]+l|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=t.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});n.SHA256=a._createHelper(f),n.HmacSHA256=a._createHmacHelper(f)}(Math),e.SHA256}(nH())}(eH);var rH=eH.exports,iH={exports:{}};!function(e,t){e.exports=function(){function e(e,t){var n=t?"└":"├";return n+=e?"─ ":"──┐"}function t(e,t){var n=[];for(var r in e)e.hasOwnProperty(r)&&(t&&"function"==typeof e[r]||n.push(r));return n}function n(r,i,a,o,s,u,c){var f,d,l="",p=0,h=o.slice(0);if(h.push([i,a])&&o.length>0&&(o.forEach((function(e,t){t>0&&(l+=(e[1]?" ":"│")+" "),d||e[0]!==i||(d=!0)})),l+=e(r,a)+r,s&&("object"!=typeof i||i instanceof Date)&&(l+=": "+i),d&&(l+=" (circular ref.)"),c(l)),!d&&"object"==typeof i){var b=t(i,u);b.forEach((function(e){f=++p===b.length,n(e,i[e],f,h,s,u,c)}))}}var r={asLines:function(e,t,r,i){n(".",e,!1,[],t,"function"!=typeof r&&r,i||r)},asTree:function(e,t,r){var i="";return n(".",e,!1,[],t,r,(function(e){i+=e+"\n"})),i}};return r}()}(iH);var aH,oH=iH.exports,sH={},uH={exports:{}},cH={exports:{}};function fH(){return aH||(aH=1,function(e,t){e.exports=function(e){return function(t){var n=e,r=n.lib,i=r.Base,a=r.WordArray,o=n.x64={};o.Word=i.extend({init:function(e,t){this.high=e,this.low=t}}),o.WordArray=i.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:8*e.length},toX32:function(){for(var e=this.words,t=e.length,n=[],r=0;r<t;r++){var i=e[r];n.push(i.high),n.push(i.low)}return a.create(n,this.sigBytes)},clone:function(){for(var e=i.clone.call(this),t=e.words=this.words.slice(0),n=t.length,r=0;r<n;r++)t[r]=t[r].clone();return e}})}(),e}(nH())}(cH)),cH.exports}var dH,lH={exports:{}};function pH(){return dH||(dH=1,function(e,t){e.exports=function(e){return function(){if("function"==typeof ArrayBuffer){var t=e.lib.WordArray,n=t.init,r=t.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var t=e.byteLength,r=[],i=0;i<t;i++)r[i>>>2]|=e[i]<<24-i%4*8;n.call(this,r,t)}else n.apply(this,arguments)};r.prototype=t}}(),e.lib.WordArray}(nH())}(lH)),lH.exports}var hH,bH={exports:{}};function mH(){return hH||(hH=1,function(e,t){e.exports=function(e){return function(){var t=e,n=t.lib.WordArray,r=t.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}r.Utf16=r.Utf16BE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i+=2){var a=t[i>>>2]>>>16-i%4*8&65535;r.push(String.fromCharCode(a))}return r.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i<t;i++)r[i>>>1]|=e.charCodeAt(i)<<16-i%2*16;return n.create(r,2*t)}},r.Utf16LE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],a=0;a<n;a+=2){var o=i(t[a>>>2]>>>16-a%4*8&65535);r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,r=[],a=0;a<t;a++)r[a>>>1]|=i(e.charCodeAt(a)<<16-a%2*16);return n.create(r,2*t)}}}(),e.enc.Utf16}(nH())}(bH)),bH.exports}var yH,gH={exports:{}};function vH(){return yH||(yH=1,function(e,t){e.exports=function(e){return function(){var t=e,n=t.lib.WordArray;function r(e,t,r){for(var i=[],a=0,o=0;o<t;o++)if(o%4){var s=r[e.charCodeAt(o-1)]<<o%4*2,u=r[e.charCodeAt(o)]>>>6-o%4*2;i[a>>>2]|=(s|u)<<24-a%4*8,a++}return n.create(i,a)}t.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var i=[],a=0;a<n;a+=3)for(var o=(t[a>>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.75*s<n;s++)i.push(r.charAt(o>>>6*(3-s)&63));var u=r.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(e){var t=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a<n.length;a++)i[n.charCodeAt(a)]=a}var o=n.charAt(64);if(o){var s=e.indexOf(o);-1!==s&&(t=s)}return r(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64}(nH())}(gH)),gH.exports}var wH,_H={exports:{}};function EH(){return wH||(wH=1,function(e,t){e.exports=function(e){return function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*t.abs(t.sin(e+1))|0}();var u=o.MD5=a.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var a=this._hash.words,o=e[t+0],u=e[t+1],p=e[t+2],h=e[t+3],b=e[t+4],m=e[t+5],y=e[t+6],g=e[t+7],v=e[t+8],w=e[t+9],_=e[t+10],E=e[t+11],T=e[t+12],A=e[t+13],R=e[t+14],S=e[t+15],k=a[0],O=a[1],I=a[2],x=a[3];k=c(k,O,I,x,o,7,s[0]),x=c(x,k,O,I,u,12,s[1]),I=c(I,x,k,O,p,17,s[2]),O=c(O,I,x,k,h,22,s[3]),k=c(k,O,I,x,b,7,s[4]),x=c(x,k,O,I,m,12,s[5]),I=c(I,x,k,O,y,17,s[6]),O=c(O,I,x,k,g,22,s[7]),k=c(k,O,I,x,v,7,s[8]),x=c(x,k,O,I,w,12,s[9]),I=c(I,x,k,O,_,17,s[10]),O=c(O,I,x,k,E,22,s[11]),k=c(k,O,I,x,T,7,s[12]),x=c(x,k,O,I,A,12,s[13]),I=c(I,x,k,O,R,17,s[14]),k=f(k,O=c(O,I,x,k,S,22,s[15]),I,x,u,5,s[16]),x=f(x,k,O,I,y,9,s[17]),I=f(I,x,k,O,E,14,s[18]),O=f(O,I,x,k,o,20,s[19]),k=f(k,O,I,x,m,5,s[20]),x=f(x,k,O,I,_,9,s[21]),I=f(I,x,k,O,S,14,s[22]),O=f(O,I,x,k,b,20,s[23]),k=f(k,O,I,x,w,5,s[24]),x=f(x,k,O,I,R,9,s[25]),I=f(I,x,k,O,h,14,s[26]),O=f(O,I,x,k,v,20,s[27]),k=f(k,O,I,x,A,5,s[28]),x=f(x,k,O,I,p,9,s[29]),I=f(I,x,k,O,g,14,s[30]),k=d(k,O=f(O,I,x,k,T,20,s[31]),I,x,m,4,s[32]),x=d(x,k,O,I,v,11,s[33]),I=d(I,x,k,O,E,16,s[34]),O=d(O,I,x,k,R,23,s[35]),k=d(k,O,I,x,u,4,s[36]),x=d(x,k,O,I,b,11,s[37]),I=d(I,x,k,O,g,16,s[38]),O=d(O,I,x,k,_,23,s[39]),k=d(k,O,I,x,A,4,s[40]),x=d(x,k,O,I,o,11,s[41]),I=d(I,x,k,O,h,16,s[42]),O=d(O,I,x,k,y,23,s[43]),k=d(k,O,I,x,w,4,s[44]),x=d(x,k,O,I,T,11,s[45]),I=d(I,x,k,O,S,16,s[46]),k=l(k,O=d(O,I,x,k,p,23,s[47]),I,x,o,6,s[48]),x=l(x,k,O,I,g,10,s[49]),I=l(I,x,k,O,R,15,s[50]),O=l(O,I,x,k,m,21,s[51]),k=l(k,O,I,x,T,6,s[52]),x=l(x,k,O,I,h,10,s[53]),I=l(I,x,k,O,_,15,s[54]),O=l(O,I,x,k,u,21,s[55]),k=l(k,O,I,x,v,6,s[56]),x=l(x,k,O,I,S,10,s[57]),I=l(I,x,k,O,y,15,s[58]),O=l(O,I,x,k,A,21,s[59]),k=l(k,O,I,x,b,6,s[60]),x=l(x,k,O,I,E,10,s[61]),I=l(I,x,k,O,p,15,s[62]),O=l(O,I,x,k,w,21,s[63]),a[0]=a[0]+k|0,a[1]=a[1]+O|0,a[2]=a[2]+I|0,a[3]=a[3]+x|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;n[i>>>5]|=128<<24-i%32;var a=t.floor(r/4294967296),o=r;n[15+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),n[14+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),e.sigBytes=4*(n.length+1),this._process();for(var s=this._hash,u=s.words,c=0;c<4;c++){var f=u[c];u[c]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return s},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});function c(e,t,n,r,i,a,o){var s=e+(t&n|~t&r)+i+o;return(s<<a|s>>>32-a)+t}function f(e,t,n,r,i,a,o){var s=e+(t&r|n&~r)+i+o;return(s<<a|s>>>32-a)+t}function d(e,t,n,r,i,a,o){var s=e+(t^n^r)+i+o;return(s<<a|s>>>32-a)+t}function l(e,t,n,r,i,a,o){var s=e+(n^(t|~r))+i+o;return(s<<a|s>>>32-a)+t}n.MD5=a._createHelper(u),n.HmacMD5=a._createHmacHelper(u)}(Math),e.MD5}(nH())}(_H)),_H.exports}var TH,AH={exports:{}};function RH(){return TH||(TH=1,function(e,t){e.exports=function(e){return function(){var t=e,n=t.lib,r=n.WordArray,i=n.Hasher,a=t.algo,o=[],s=a.SHA1=i.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],s=n[3],u=n[4],c=0;c<80;c++){if(c<16)o[c]=0|e[t+c];else{var f=o[c-3]^o[c-8]^o[c-14]^o[c-16];o[c]=f<<1|f>>>31}var d=(r<<5|r>>>27)+u+o[c];d+=c<20?1518500249+(i&a|~i&s):c<40?1859775393+(i^a^s):c<60?(i&a|i&s|a&s)-1894007588:(i^a^s)-899497514,u=s,s=a,a=i<<30|i>>>2,i=r,r=d}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+a|0,n[3]=n[3]+s|0,n[4]=n[4]+u|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=i._createHelper(s),t.HmacSHA1=i._createHmacHelper(s)}(),e.SHA1}(nH())}(AH)),AH.exports}var SH,kH={exports:{}};var OH,IH={exports:{}};function xH(){return OH||(OH=1,function(e,t){e.exports=function(e){return function(){var t=e,n=t.lib.Hasher,r=t.x64,i=r.Word,a=r.WordArray,o=t.algo;function s(){return i.create.apply(i,arguments)}var u=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],c=[];!function(){for(var e=0;e<80;e++)c[e]=s()}();var f=o.SHA512=n.extend({_doReset:function(){this._hash=new a.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],f=n[5],d=n[6],l=n[7],p=r.high,h=r.low,b=i.high,m=i.low,y=a.high,g=a.low,v=o.high,w=o.low,_=s.high,E=s.low,T=f.high,A=f.low,R=d.high,S=d.low,k=l.high,O=l.low,I=p,x=h,C=b,M=m,N=y,P=g,B=v,D=w,F=_,L=E,U=T,j=A,q=R,z=S,H=k,V=O,G=0;G<80;G++){var K=c[G];if(G<16)var W=K.high=0|e[t+2*G],X=K.low=0|e[t+2*G+1];else{var $=c[G-15],J=$.high,Y=$.low,Q=(J>>>1|Y<<31)^(J>>>8|Y<<24)^J>>>7,Z=(Y>>>1|J<<31)^(Y>>>8|J<<24)^(Y>>>7|J<<25),ee=c[G-2],te=ee.high,ne=ee.low,re=(te>>>19|ne<<13)^(te<<3|ne>>>29)^te>>>6,ie=(ne>>>19|te<<13)^(ne<<3|te>>>29)^(ne>>>6|te<<26),ae=c[G-7],oe=ae.high,se=ae.low,ue=c[G-16],ce=ue.high,fe=ue.low;W=(W=(W=Q+oe+((X=Z+se)>>>0<Z>>>0?1:0))+re+((X+=ie)>>>0<ie>>>0?1:0))+ce+((X+=fe)>>>0<fe>>>0?1:0),K.high=W,K.low=X}var de,le=F&U^~F&q,pe=L&j^~L&z,he=I&C^I&N^C&N,be=x&M^x&P^M&P,me=(I>>>28|x<<4)^(I<<30|x>>>2)^(I<<25|x>>>7),ye=(x>>>28|I<<4)^(x<<30|I>>>2)^(x<<25|I>>>7),ge=(F>>>14|L<<18)^(F>>>18|L<<14)^(F<<23|L>>>9),ve=(L>>>14|F<<18)^(L>>>18|F<<14)^(L<<23|F>>>9),we=u[G],_e=we.high,Ee=we.low,Te=H+ge+((de=V+ve)>>>0<V>>>0?1:0),Ae=ye+be;H=q,V=z,q=U,z=j,U=F,j=L,F=B+(Te=(Te=(Te=Te+le+((de+=pe)>>>0<pe>>>0?1:0))+_e+((de+=Ee)>>>0<Ee>>>0?1:0))+W+((de+=X)>>>0<X>>>0?1:0))+((L=D+de|0)>>>0<D>>>0?1:0)|0,B=N,D=P,N=C,P=M,C=I,M=x,I=Te+(me+he+(Ae>>>0<ye>>>0?1:0))+((x=de+Ae|0)>>>0<de>>>0?1:0)|0}h=r.low=h+x,r.high=p+I+(h>>>0<x>>>0?1:0),m=i.low=m+M,i.high=b+C+(m>>>0<M>>>0?1:0),g=a.low=g+P,a.high=y+N+(g>>>0<P>>>0?1:0),w=o.low=w+D,o.high=v+B+(w>>>0<D>>>0?1:0),E=s.low=E+L,s.high=_+F+(E>>>0<L>>>0?1:0),A=f.low=A+j,f.high=T+U+(A>>>0<j>>>0?1:0),S=d.low=S+z,d.high=R+q+(S>>>0<z>>>0?1:0),O=l.low=O+V,l.high=k+H+(O>>>0<V>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(r+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});t.SHA512=n._createHelper(f),t.HmacSHA512=n._createHmacHelper(f)}(),e.SHA512}(nH(),fH())}(IH)),IH.exports}var CH,MH={exports:{}};var NH,PH={exports:{}};function BH(){return NH||(NH=1,function(e,t){e.exports=function(e){return function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.x64.Word,s=n.algo,u=[],c=[],f=[];!function(){for(var e=1,t=0,n=0;n<24;n++){u[e+5*t]=(n+1)*(n+2)/2%64;var r=(2*e+3*t)%5;e=t%5,t=r}for(e=0;e<5;e++)for(t=0;t<5;t++)c[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,a=0;a<24;a++){for(var s=0,d=0,l=0;l<7;l++){if(1&i){var p=(1<<l)-1;p<32?d^=1<<p:s^=1<<p-32}128&i?i=i<<1^113:i<<=1}f[a]=o.create(s,d)}}();var d=[];!function(){for(var e=0;e<25;e++)d[e]=o.create()}();var l=s.SHA3=a.extend({cfg:a.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new o.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var n=this._state,r=this.blockSize/2,i=0;i<r;i++){var a=e[t+2*i],o=e[t+2*i+1];a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),(O=n[i]).high^=o,O.low^=a}for(var s=0;s<24;s++){for(var l=0;l<5;l++){for(var p=0,h=0,b=0;b<5;b++)p^=(O=n[l+5*b]).high,h^=O.low;var m=d[l];m.high=p,m.low=h}for(l=0;l<5;l++){var y=d[(l+4)%5],g=d[(l+1)%5],v=g.high,w=g.low;for(p=y.high^(v<<1|w>>>31),h=y.low^(w<<1|v>>>31),b=0;b<5;b++)(O=n[l+5*b]).high^=p,O.low^=h}for(var _=1;_<25;_++){var E=(O=n[_]).high,T=O.low,A=u[_];A<32?(p=E<<A|T>>>32-A,h=T<<A|E>>>32-A):(p=T<<A-32|E>>>64-A,h=E<<A-32|T>>>64-A);var R=d[c[_]];R.high=p,R.low=h}var S=d[0],k=n[0];for(S.high=k.high,S.low=k.low,l=0;l<5;l++)for(b=0;b<5;b++){var O=n[_=l+5*b],I=d[_],x=d[(l+1)%5+5*b],C=d[(l+2)%5+5*b];O.high=I.high^~x.high&C.high,O.low=I.low^~x.low&C.low}O=n[0];var M=f[s];O.high^=M.high,O.low^=M.low}},_doFinalize:function(){var e=this._data,n=e.words;this._nDataBytes;var r=8*e.sigBytes,a=32*this.blockSize;n[r>>>5]|=1<<24-r%32,n[(t.ceil((r+1)/a)*a>>>5)-1]|=128,e.sigBytes=4*n.length,this._process();for(var o=this._state,s=this.cfg.outputLength/8,u=s/8,c=[],f=0;f<u;f++){var d=o[f],l=d.high,p=d.low;l=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),c.push(p),c.push(l)}return new i.init(c,s)},clone:function(){for(var e=a.clone.call(this),t=e._state=this._state.slice(0),n=0;n<25;n++)t[n]=t[n].clone();return e}});n.SHA3=a._createHelper(l),n.HmacSHA3=a._createHmacHelper(l)}(Math),e.SHA3}(nH(),fH())}(PH)),PH.exports}var DH,FH={exports:{}};var LH,UH={exports:{}};function jH(){return LH||(LH=1,function(e,t){e.exports=function(e){!function(){var t=e,n=t.lib.Base,r=t.enc.Utf8;t.algo.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=r.parse(t));var n=e.blockSize,i=4*n;t.sigBytes>i&&(t=e.finalize(t)),t.clamp();for(var a=this._oKey=t.clone(),o=this._iKey=t.clone(),s=a.words,u=o.words,c=0;c<n;c++)s[c]^=1549556828,u[c]^=909522486;a.sigBytes=o.sigBytes=i,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})}()}(nH())}(UH)),UH.exports}var qH,zH={exports:{}};var HH,VH={exports:{}};function GH(){return HH||(HH=1,function(e,t){e.exports=function(e){return function(){var t=e,n=t.lib,r=n.Base,i=n.WordArray,a=t.algo,o=a.MD5,s=a.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,r=n.hasher.create(),a=i.create(),o=a.words,s=n.keySize,u=n.iterations;o.length<s;){c&&r.update(c);var c=r.update(e).finalize(t);r.reset();for(var f=1;f<u;f++)c=r.finalize(c),r.reset();a.concat(c)}return a.sigBytes=4*s,a}});t.EvpKDF=function(e,t,n){return s.create(n).compute(e,t)}}(),e.EvpKDF}(nH(),RH(),jH())}(VH)),VH.exports}var KH,WH={exports:{}};function XH(){return KH||(KH=1,function(e,t){e.exports=function(e){e.lib.Cipher||function(t){var n=e,r=n.lib,i=r.Base,a=r.WordArray,o=r.BufferedBlockAlgorithm,s=n.enc;s.Utf8;var u=s.Base64,c=n.algo.EvpKDF,f=r.Cipher=o.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?v:y}return function(t){return{encrypt:function(n,r,i){return e(r).encrypt(t,n,r,i)},decrypt:function(n,r,i){return e(r).decrypt(t,n,r,i)}}}}()});r.StreamCipher=f.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var d=n.mode={},l=r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),p=d.CBC=function(){var e=l.extend();function n(e,n,r){var i=this._iv;if(i){var a=i;this._iv=t}else a=this._prevBlock;for(var o=0;o<r;o++)e[n+o]^=a[o]}return e.Encryptor=e.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize;n.call(this,e,t,i),r.encryptBlock(e,t),this._prevBlock=e.slice(t,t+i)}}),e.Decryptor=e.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,a=e.slice(t,t+i);r.decryptBlock(e,t),n.call(this,e,t,i),this._prevBlock=a}}),e}(),h=(n.pad={}).Pkcs7={pad:function(e,t){for(var n=4*t,r=n-e.sigBytes%n,i=r<<24|r<<16|r<<8|r,o=[],s=0;s<r;s+=4)o.push(i);var u=a.create(o,r);e.concat(u)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}};r.BlockCipher=f.extend({cfg:f.cfg.extend({mode:p,padding:h}),reset:function(){f.reset.call(this);var e=this.cfg,t=e.iv,n=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var r=n.createEncryptor;else r=n.createDecryptor,this._minBufferSize=1;this._mode&&this._mode.__creator==r?this._mode.init(this,t&&t.words):(this._mode=r.call(n,this,t&&t.words),this._mode.__creator=r)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4});var b=r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),m=(n.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;if(n)var r=a.create([1398893684,1701076831]).concat(n).concat(t);else r=t;return r.toString(u)},parse:function(e){var t=u.parse(e),n=t.words;if(1398893684==n[0]&&1701076831==n[1]){var r=a.create(n.slice(2,4));n.splice(0,4),t.sigBytes-=16}return b.create({ciphertext:t,salt:r})}},y=r.SerializableCipher=i.extend({cfg:i.extend({format:m}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r),a=i.finalize(t),o=i.cfg;return b.create({ciphertext:a,key:n,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),g=(n.kdf={}).OpenSSL={execute:function(e,t,n,r){r||(r=a.random(8));var i=c.create({keySize:t+n}).compute(e,r),o=a.create(i.words.slice(t),4*n);return i.sigBytes=4*t,b.create({key:i,iv:o,salt:r})}},v=r.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:g}),encrypt:function(e,t,n,r){var i=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize);r.iv=i.iv;var a=y.encrypt.call(this,e,t,i.key,r);return a.mixIn(i),a},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var i=r.kdf.execute(n,e.keySize,e.ivSize,t.salt);return r.iv=i.iv,y.decrypt.call(this,e,t,i.key,r)}})}()}(nH(),GH())}(WH)),WH.exports}var $H,JH={exports:{}};function YH(){return $H||($H=1,function(e,t){e.exports=function(e){return e.mode.CFB=function(){var t=e.lib.BlockCipherMode.extend();function n(e,t,n,r){var i=this._iv;if(i){var a=i.slice(0);this._iv=void 0}else a=this._prevBlock;r.encryptBlock(a,0);for(var o=0;o<n;o++)e[t+o]^=a[o]}return t.Encryptor=t.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize;n.call(this,e,t,i,r),this._prevBlock=e.slice(t,t+i)}}),t.Decryptor=t.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,a=e.slice(t,t+i);n.call(this,e,t,i,r),this._prevBlock=a}}),t}(),e.mode.CFB}(nH(),XH())}(JH)),JH.exports}var QH,ZH={exports:{}};function eV(){return QH||(QH=1,function(e,t){e.exports=function(e){return e.mode.CTR=(t=e.lib.BlockCipherMode.extend(),n=t.Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,i=this._iv,a=this._counter;i&&(a=this._counter=i.slice(0),this._iv=void 0);var o=a.slice(0);n.encryptBlock(o,0),a[r-1]=a[r-1]+1|0;for(var s=0;s<r;s++)e[t+s]^=o[s]}}),t.Decryptor=n,t),e.mode.CTR;var t,n}(nH(),XH())}(ZH)),ZH.exports}var tV,nV={exports:{}};function rV(){return tV||(tV=1,function(e,t){e.exports=function(e){
|
|
31
|
+
*/HC=VC,function(){var e="input is invalid type",t="object"==typeof window,n=t?window:{};n.JS_SHA3_NO_WINDOW&&(t=!1);var r=!t&&"object"==typeof self;!n.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?n=PI:r&&(n=self);var i=!n.JS_SHA3_NO_COMMON_JS&&HC.exports,a=!n.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,o="0123456789abcdef".split(""),s=[4,1024,262144,67108864],u=[0,8,16,24],c=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],f=[224,256,384,512],d=[128,256],l=["hex","buffer","arrayBuffer","array","digest"],p={128:168,256:136};!n.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!a||!n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var h=function(e,t,n){return function(r){return new I(e,t,e).update(r)[n]()}},b=function(e,t,n){return function(r,i){return new I(e,t,i).update(r)[n]()}},m=function(e,t,n){return function(t,r,i,a){return _["cshake"+e].update(t,r,i,a)[n]()}},y=function(e,t,n){return function(t,r,i,a){return _["kmac"+e].update(t,r,i,a)[n]()}},g=function(e,t,n,r){for(var i=0;i<l.length;++i){var a=l[i];e[a]=t(n,r,a)}return e},v=function(e,t){var n=h(e,t,"hex");return n.create=function(){return new I(e,t,e)},n.update=function(e){return n.create().update(e)},g(n,h,e,t)},w=[{name:"keccak",padding:[1,256,65536,16777216],bits:f,createMethod:v},{name:"sha3",padding:[6,1536,393216,100663296],bits:f,createMethod:v},{name:"shake",padding:[31,7936,2031616,520093696],bits:d,createMethod:function(e,t){var n=b(e,t,"hex");return n.create=function(n){return new I(e,t,n)},n.update=function(e,t){return n.create(t).update(e)},g(n,b,e,t)}},{name:"cshake",padding:s,bits:d,createMethod:function(e,t){var n=p[e],r=m(e,0,"hex");return r.create=function(r,i,a){return i||a?new I(e,t,r).bytepad([i,a],n):_["shake"+e].create(r)},r.update=function(e,t,n,i){return r.create(t,n,i).update(e)},g(r,m,e,t)}},{name:"kmac",padding:s,bits:d,createMethod:function(e,t){var n=p[e],r=y(e,0,"hex");return r.create=function(r,i,a){return new x(e,t,i).bytepad(["KMAC",a],n).bytepad([r],n)},r.update=function(e,t,n,i){return r.create(e,n,i).update(t)},g(r,y,e,t)}}],_={},E=[],T=0;T<w.length;++T)for(var A=w[T],R=A.bits,S=0;S<R.length;++S){var k=A.name+"_"+R[S];if(E.push(k),_[k]=A.createMethod(R[S],A.padding),"sha3"!==A.name){var O=A.name+R[S];E.push(O),_[O]=_[k]}}function I(e,t,n){this.blocks=[],this.s=[],this.padding=t,this.outputBits=n,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var r=0;r<50;++r)this.s[r]=0}function x(e,t,n){I.call(this,e,t,n)}I.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var n,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(e);if(null===t)throw new Error(e);if(a&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||a&&ArrayBuffer.isView(t)))throw new Error(e);n=!0}for(var i,o,s=this.blocks,c=this.byteCount,f=t.length,d=this.blockCount,l=0,p=this.s;l<f;){if(this.reset)for(this.reset=!1,s[0]=this.block,i=1;i<d+1;++i)s[i]=0;if(n)for(i=this.start;l<f&&i<c;++l)s[i>>2]|=t[l]<<u[3&i++];else for(i=this.start;l<f&&i<c;++l)(o=t.charCodeAt(l))<128?s[i>>2]|=o<<u[3&i++]:o<2048?(s[i>>2]|=(192|o>>6)<<u[3&i++],s[i>>2]|=(128|63&o)<<u[3&i++]):o<55296||o>=57344?(s[i>>2]|=(224|o>>12)<<u[3&i++],s[i>>2]|=(128|o>>6&63)<<u[3&i++],s[i>>2]|=(128|63&o)<<u[3&i++]):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++l)),s[i>>2]|=(240|o>>18)<<u[3&i++],s[i>>2]|=(128|o>>12&63)<<u[3&i++],s[i>>2]|=(128|o>>6&63)<<u[3&i++],s[i>>2]|=(128|63&o)<<u[3&i++]);if(this.lastByteIndex=i,i>=c){for(this.start=i-c,this.block=s[d],i=0;i<d;++i)p[i]^=s[i];C(p),this.reset=!0}else this.start=i}return this},I.prototype.encode=function(e,t){var n=255&e,r=1,i=[n];for(n=255&(e>>=8);n>0;)i.unshift(n),n=255&(e>>=8),++r;return t?i.push(r):i.unshift(r),this.update(i),i.length},I.prototype.encodeString=function(t){var n,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(e);if(null===t)throw new Error(e);if(a&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||a&&ArrayBuffer.isView(t)))throw new Error(e);n=!0}var i=0,o=t.length;if(n)i=o;else for(var s=0;s<t.length;++s){var u=t.charCodeAt(s);u<128?i+=1:u<2048?i+=2:u<55296||u>=57344?i+=3:(u=65536+((1023&u)<<10|1023&t.charCodeAt(++s)),i+=4)}return i+=this.encode(8*i),this.update(t),i},I.prototype.bytepad=function(e,t){for(var n=this.encode(t),r=0;r<e.length;++r)n+=this.encodeString(e[r]);var i=t-n%t,a=[];return a.length=i,this.update(a),this},I.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,n=this.blockCount,r=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[n],t=1;t<n+1;++t)e[t]=0;for(e[n-1]|=2147483648,t=0;t<n;++t)r[t]^=e[t];C(r)}},I.prototype.toString=I.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,a=0,s=0,u="";s<r;){for(a=0;a<t&&s<r;++a,++s)e=n[a],u+=o[e>>4&15]+o[15&e]+o[e>>12&15]+o[e>>8&15]+o[e>>20&15]+o[e>>16&15]+o[e>>28&15]+o[e>>24&15];s%t==0&&(C(n),a=0)}return i&&(e=n[a],u+=o[e>>4&15]+o[15&e],i>1&&(u+=o[e>>12&15]+o[e>>8&15]),i>2&&(u+=o[e>>20&15]+o[e>>16&15])),u},I.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,a=0,o=0,s=this.outputBits>>3;e=i?new ArrayBuffer(r+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(e);o<r;){for(a=0;a<t&&o<r;++a,++o)u[o]=n[a];o%t==0&&C(n)}return i&&(u[a]=n[a],e=e.slice(0,s)),e},I.prototype.buffer=I.prototype.arrayBuffer,I.prototype.digest=I.prototype.array=function(){this.finalize();for(var e,t,n=this.blockCount,r=this.s,i=this.outputBlocks,a=this.extraBytes,o=0,s=0,u=[];s<i;){for(o=0;o<n&&s<i;++o,++s)e=s<<2,t=r[o],u[e]=255&t,u[e+1]=t>>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;s%n==0&&C(r)}return a&&(e=s<<2,t=r[o],u[e]=255&t,a>1&&(u[e+1]=t>>8&255),a>2&&(u[e+2]=t>>16&255)),u},x.prototype=new I,x.prototype.finalize=function(){return this.encode(this.outputBits,!0),I.prototype.finalize.call(this)};var C=function(e){var t,n,r,i,a,o,s,u,f,d,l,p,h,b,m,y,g,v,w,_,E,T,A,R,S,k,O,I,x,C,M,N,P,B,D,F,L,U,j,q,z,H,V,G,K,W,X,$,J,Y,Q,Z,ee,te,ne,re,ie,ae,oe,se,ue,ce,fe;for(r=0;r<48;r+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],a=e[1]^e[11]^e[21]^e[31]^e[41],o=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],f=e[5]^e[15]^e[25]^e[35]^e[45],d=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(p=e[8]^e[18]^e[28]^e[38]^e[48])^(o<<1|s>>>31),n=(h=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|o>>>31),e[0]^=t,e[1]^=n,e[10]^=t,e[11]^=n,e[20]^=t,e[21]^=n,e[30]^=t,e[31]^=n,e[40]^=t,e[41]^=n,t=i^(u<<1|f>>>31),n=a^(f<<1|u>>>31),e[2]^=t,e[3]^=n,e[12]^=t,e[13]^=n,e[22]^=t,e[23]^=n,e[32]^=t,e[33]^=n,e[42]^=t,e[43]^=n,t=o^(d<<1|l>>>31),n=s^(l<<1|d>>>31),e[4]^=t,e[5]^=n,e[14]^=t,e[15]^=n,e[24]^=t,e[25]^=n,e[34]^=t,e[35]^=n,e[44]^=t,e[45]^=n,t=u^(p<<1|h>>>31),n=f^(h<<1|p>>>31),e[6]^=t,e[7]^=n,e[16]^=t,e[17]^=n,e[26]^=t,e[27]^=n,e[36]^=t,e[37]^=n,e[46]^=t,e[47]^=n,t=d^(i<<1|a>>>31),n=l^(a<<1|i>>>31),e[8]^=t,e[9]^=n,e[18]^=t,e[19]^=n,e[28]^=t,e[29]^=n,e[38]^=t,e[39]^=n,e[48]^=t,e[49]^=n,b=e[0],m=e[1],W=e[11]<<4|e[10]>>>28,X=e[10]<<4|e[11]>>>28,I=e[20]<<3|e[21]>>>29,x=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,H=e[40]<<18|e[41]>>>14,V=e[41]<<18|e[40]>>>14,B=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,y=e[13]<<12|e[12]>>>20,g=e[12]<<12|e[13]>>>20,$=e[22]<<10|e[23]>>>22,J=e[23]<<10|e[22]>>>22,C=e[33]<<13|e[32]>>>19,M=e[32]<<13|e[33]>>>19,ce=e[42]<<2|e[43]>>>30,fe=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,ne=e[4]<<30|e[5]>>>2,F=e[14]<<6|e[15]>>>26,L=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Y=e[34]<<15|e[35]>>>17,Q=e[35]<<15|e[34]>>>17,N=e[45]<<29|e[44]>>>3,P=e[44]<<29|e[45]>>>3,R=e[6]<<28|e[7]>>>4,S=e[7]<<28|e[6]>>>4,re=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,j=e[27]<<25|e[26]>>>7,_=e[36]<<21|e[37]>>>11,E=e[37]<<21|e[36]>>>11,Z=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,G=e[8]<<27|e[9]>>>5,K=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,O=e[19]<<20|e[18]>>>12,ae=e[29]<<7|e[28]>>>25,oe=e[28]<<7|e[29]>>>25,q=e[38]<<8|e[39]>>>24,z=e[39]<<8|e[38]>>>24,T=e[48]<<14|e[49]>>>18,A=e[49]<<14|e[48]>>>18,e[0]=b^~y&v,e[1]=m^~g&w,e[10]=R^~k&I,e[11]=S^~O&x,e[20]=B^~F&U,e[21]=D^~L&j,e[30]=G^~W&$,e[31]=K^~X&J,e[40]=te^~re&ae,e[41]=ne^~ie&oe,e[2]=y^~v&_,e[3]=g^~w&E,e[12]=k^~I&C,e[13]=O^~x&M,e[22]=F^~U&q,e[23]=L^~j&z,e[32]=W^~$&Y,e[33]=X^~J&Q,e[42]=re^~ae&se,e[43]=ie^~oe&ue,e[4]=v^~_&T,e[5]=w^~E&A,e[14]=I^~C&N,e[15]=x^~M&P,e[24]=U^~q&H,e[25]=j^~z&V,e[34]=$^~Y&Z,e[35]=J^~Q&ee,e[44]=ae^~se&ce,e[45]=oe^~ue&fe,e[6]=_^~T&b,e[7]=E^~A&m,e[16]=C^~N&R,e[17]=M^~P&S,e[26]=q^~H&B,e[27]=z^~V&D,e[36]=Y^~Z&G,e[37]=Q^~ee&K,e[46]=se^~ce&te,e[47]=ue^~fe&ne,e[8]=T^~b&y,e[9]=A^~m&g,e[18]=N^~R&k,e[19]=P^~S&O,e[28]=H^~B&F,e[29]=V^~D&L,e[38]=Z^~G&W,e[39]=ee^~K&X,e[48]=ce^~te&re,e[49]=fe^~ne&ie,e[0]^=c[r],e[1]^=c[r+1]};if(i)HC.exports=_;else for(T=0;T<E.length;++T)n[E[T]]=_[E[T]]}();var GC=VC.exports;function KC(e){return"0x"+GC.keccak_256(tr(e))}let WC=!1,XC=!1;const $C={debug:1,default:2,info:2,warning:3,error:4,off:5};let JC=$C.default,YC=null;const QC=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(n){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var ZC,eM;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(ZC||(ZC={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(eM||(eM={}));const tM="0123456789abcdef";let nM=class e{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const n=e.toLowerCase();null==$C[n]&&this.throwArgumentError("invalid log level name","logLevel",e),JC>$C[n]||console.log.apply(console,t)}debug(...t){this._log(e.levels.DEBUG,t)}info(...t){this._log(e.levels.INFO,t)}warn(...t){this._log(e.levels.WARNING,t)}makeError(t,n,r){if(XC)return this.makeError("censored error",n,{});n||(n=e.errors.UNKNOWN_ERROR),r||(r={});const i=[];Object.keys(r).forEach((e=>{const t=r[e];try{if(t instanceof Uint8Array){let n="";for(let e=0;e<t.length;e++)n+=tM[t[e]>>4],n+=tM[15&t[e]];i.push(e+"=Uint8Array(0x"+n+")")}else i.push(e+"="+JSON.stringify(t))}catch(t){i.push(e+"="+JSON.stringify(r[e].toString()))}})),i.push(`code=${n}`),i.push(`version=${this.version}`);const a=t;let o="";switch(n){case eM.NUMERIC_FAULT:{o="NUMERIC_FAULT";const e=t;switch(e){case"overflow":case"underflow":case"division-by-zero":o+="-"+e;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case eM.CALL_EXCEPTION:case eM.INSUFFICIENT_FUNDS:case eM.MISSING_NEW:case eM.NONCE_EXPIRED:case eM.REPLACEMENT_UNDERPRICED:case eM.TRANSACTION_REPLACED:case eM.UNPREDICTABLE_GAS_LIMIT:o=n}o&&(t+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(t+=" ("+i.join(", ")+")");const s=new Error(t);return s.reason=a,s.code=n,Object.keys(r).forEach((function(e){s[e]=r[e]})),s}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(t,n,r){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:n,value:r})}assert(e,t,n,r){e||this.throwError(t,n,r)}assertArgument(e,t,n,r){e||this.throwArgumentError(t,n,r)}checkNormalize(t){QC&&this.throwError("platform missing String.prototype.normalize",e.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:QC})}checkSafeUint53(t,n){"number"==typeof t&&(null==n&&(n="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,n,r){r=r?": "+r:"",t<n&&this.throwError("missing argument"+r,e.errors.MISSING_ARGUMENT,{count:t,expectedCount:n}),t>n&&this.throwError("too many arguments"+r,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:n})}checkNew(t,n){t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:n.name})}checkAbstract(t,n){t===n?this.throwError("cannot instantiate abstract class "+JSON.stringify(n.name)+" directly; use a sub-class",e.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:n.name})}static globalLogger(){return YC||(YC=new e("logger/5.7.0")),YC}static setCensorship(t,n){if(!t&&n&&this.globalLogger().throwError("cannot permanently disable censorship",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),WC){if(!t)return;this.globalLogger().throwError("error censorship permanent",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}XC=!!t,WC=!!n}static setLogLevel(t){const n=$C[t.toLowerCase()];null!=n?JC=n:e.globalLogger().warn("invalid log level - "+t)}static from(t){return new e(t)}};nM.errors=eM,nM.levels=ZC;var rM=Fn.BN;const iM=new nM("bignumber/5.7.0"),aM={};let oM=!1,sM=class e{constructor(e,t){e!==aM&&iM.throwError("cannot call constructor directly; use BigNumber.from",nM.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return cM(fM(this).fromTwos(e))}toTwos(e){return cM(fM(this).toTwos(e))}abs(){return"-"===this._hex[0]?e.from(this._hex.substring(1)):this}add(e){return cM(fM(this).add(fM(e)))}sub(e){return cM(fM(this).sub(fM(e)))}div(t){return e.from(t).isZero()&&dM("division-by-zero","div"),cM(fM(this).div(fM(t)))}mul(e){return cM(fM(this).mul(fM(e)))}mod(e){const t=fM(e);return t.isNeg()&&dM("division-by-zero","mod"),cM(fM(this).umod(t))}pow(e){const t=fM(e);return t.isNeg()&&dM("negative-power","pow"),cM(fM(this).pow(t))}and(e){const t=fM(e);return(this.isNegative()||t.isNeg())&&dM("unbound-bitwise-result","and"),cM(fM(this).and(t))}or(e){const t=fM(e);return(this.isNegative()||t.isNeg())&&dM("unbound-bitwise-result","or"),cM(fM(this).or(t))}xor(e){const t=fM(e);return(this.isNegative()||t.isNeg())&&dM("unbound-bitwise-result","xor"),cM(fM(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&dM("negative-width","mask"),cM(fM(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&dM("negative-width","shl"),cM(fM(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&dM("negative-width","shr"),cM(fM(this).shrn(e))}eq(e){return fM(this).eq(fM(e))}lt(e){return fM(this).lt(fM(e))}lte(e){return fM(this).lte(fM(e))}gt(e){return fM(this).gt(fM(e))}gte(e){return fM(this).gte(fM(e))}isNegative(){return"-"===this._hex[0]}isZero(){return fM(this).isZero()}toNumber(){try{return fM(this).toNumber()}catch(e){dM("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return iM.throwError("this platform does not support BigInt",nM.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?oM||(oM=!0,iM.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?iM.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",nM.errors.UNEXPECTED_ARGUMENT,{}):iM.throwError("BigNumber.toString does not accept parameters",nM.errors.UNEXPECTED_ARGUMENT,{})),fM(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof e)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new e(aM,uM(t)):t.match(/^-?[0-9]+$/)?new e(aM,uM(new rM(t))):iM.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&dM("underflow","BigNumber.from",t),(t>=9007199254740991||t<=-9007199254740991)&&dM("overflow","BigNumber.from",t),e.from(String(t));const n=t;if("bigint"==typeof n)return e.from(n.toString());if(er(n))return e.from(sr(n));if(n)if(n.toHexString){const t=n.toHexString();if("string"==typeof t)return e.from(t)}else{let t=n._hex;if(null==t&&"BigNumber"===n.type&&(t=n.hex),"string"==typeof t&&(ar(t)||"-"===t[0]&&ar(t.substring(1))))return e.from(t)}return iM.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(e){return!(!e||!e._isBigNumber)}};function uM(e){if("string"!=typeof e)return uM(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&iM.throwArgumentError("invalid hex","value",e),"0x00"===(e=uM(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function cM(e){return sM.from(uM(e))}function fM(e){const t=sM.from(e).toHexString();return"-"===t[0]?new rM("-"+t.substring(3),16):new rM(t.substring(2),16)}function dM(e,t,n){const r={fault:e,operation:t};return null!=n&&(r.value=n),iM.throwError(e,nM.errors.NUMERIC_FAULT,r)}const lM=new nM("bignumber/5.7.0"),pM={},hM=sM.from(0),bM=sM.from(-1);function mM(e,t,n,r){const i={fault:t,operation:n};return void 0!==r&&(i.value=r),lM.throwError(e,nM.errors.NUMERIC_FAULT,i)}let yM="0";for(;yM.length<256;)yM+=yM;function gM(e){if("number"!=typeof e)try{e=sM.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+yM.substring(0,e):lM.throwArgumentError("invalid decimal size","decimals",e)}function vM(e,t){null==t&&(t=0);const n=gM(t),r=(e=sM.from(e)).lt(hM);r&&(e=e.mul(bM));let i=e.mod(n).toString();for(;i.length<n.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const a=e.div(n).toString();return e=1===n.length?a:a+"."+i,r&&(e="-"+e),e}function wM(e,t){null==t&&(t=0);const n=gM(t);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||lM.throwArgumentError("invalid decimal value","value",e);const r="-"===e.substring(0,1);r&&(e=e.substring(1)),"."===e&&lM.throwArgumentError("missing value","value",e);const i=e.split(".");i.length>2&&lM.throwArgumentError("too many decimal points","value",e);let a=i[0],o=i[1];for(a||(a="0"),o||(o="0");"0"===o[o.length-1];)o=o.substring(0,o.length-1);for(o.length>n.length-1&&mM("fractional component exceeds decimals","underflow","parseFixed"),""===o&&(o="0");o.length<n.length-1;)o+="0";const s=sM.from(a),u=sM.from(o);let c=s.mul(n).add(u);return r&&(c=c.mul(bM)),c}let _M=class e{constructor(e,t,n,r){e!==pM&&lM.throwError("cannot use FixedFormat constructor; use FixedFormat.from",nM.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=n,this.decimals=r,this.name=(t?"":"u")+"fixed"+String(n)+"x"+String(r),this._multiplier=gM(r),Object.freeze(this)}static from(t){if(t instanceof e)return t;"number"==typeof t&&(t=`fixed128x${t}`);let n=!0,r=128,i=18;if("string"==typeof t)if("fixed"===t);else if("ufixed"===t)n=!1;else{const e=t.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);e||lM.throwArgumentError("invalid fixed format","format",t),n="u"!==e[1],r=parseInt(e[2]),i=parseInt(e[3])}else if(t){const e=(e,n,r)=>null==t[e]?r:(typeof t[e]!==n&&lM.throwArgumentError("invalid fixed format ("+e+" not "+n+")","format."+e,t[e]),t[e]);n=e("signed","boolean",n),r=e("width","number",r),i=e("decimals","number",i)}return r%8&&lM.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),i>80&&lM.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new e(pM,n,r,i)}},EM=class e{constructor(e,t,n,r){e!==pM&&lM.throwError("cannot use FixedNumber constructor; use FixedNumber.from",nM.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=r,this._hex=t,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&lM.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(t){this._checkFormat(t);const n=wM(this._value,this.format.decimals),r=wM(t._value,t.format.decimals);return e.fromValue(n.add(r),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);const n=wM(this._value,this.format.decimals),r=wM(t._value,t.format.decimals);return e.fromValue(n.sub(r),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);const n=wM(this._value,this.format.decimals),r=wM(t._value,t.format.decimals);return e.fromValue(n.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);const n=wM(this._value,this.format.decimals),r=wM(t._value,t.format.decimals);return e.fromValue(n.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const t=this.toString().split(".");1===t.length&&t.push("0");let n=e.from(t[0],this.format);const r=!t[1].match(/^(0*)$/);return this.isNegative()&&r&&(n=n.subUnsafe(TM.toFormat(n.format))),n}ceiling(){const t=this.toString().split(".");1===t.length&&t.push("0");let n=e.from(t[0],this.format);const r=!t[1].match(/^(0*)$/);return!this.isNegative()&&r&&(n=n.addUnsafe(TM.toFormat(n.format))),n}round(t){null==t&&(t=0);const n=this.toString().split(".");if(1===n.length&&n.push("0"),(t<0||t>80||t%1)&&lM.throwArgumentError("invalid decimal count","decimals",t),n[1].length<=t)return this;const r=e.from("1"+yM.substring(0,t),this.format),i=AM.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(i).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&lM.throwArgumentError("invalid byte width","width",e);return pr(sM.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return e.fromString(this._value,t)}static fromValue(t,n,r){return null!=r||null==n||function(e){return null!=e&&(sM.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||ar(e)||"bigint"==typeof e||er(e))}(n)||(r=n,n=null),null==n&&(n=0),null==r&&(r="fixed"),e.fromString(vM(t,n),_M.from(r))}static fromString(t,n){null==n&&(n="fixed");const r=_M.from(n),i=wM(t,r.decimals);!r.signed&&i.lt(hM)&&mM("unsigned value cannot be negative","overflow","value",t);let a=null;r.signed?a=i.toTwos(r.width).toHexString():(a=i.toHexString(),a=pr(a,r.width/8));const o=vM(i,r.decimals);return new e(pM,a,o,r)}static fromBytes(t,n){null==n&&(n="fixed");const r=_M.from(n);if(tr(t).length>r.width/8)throw new Error("overflow");let i=sM.from(t);r.signed&&(i=i.fromTwos(r.width));const a=i.toTwos((r.signed?0:1)+r.width).toHexString(),o=vM(i,r.decimals);return new e(pM,a,o,r)}static from(t,n){if("string"==typeof t)return e.fromString(t,n);if(er(t))return e.fromBytes(t,n);try{return e.fromValue(t,0,n)}catch(t){if(t.code!==nM.errors.INVALID_ARGUMENT)throw t}return lM.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}};const TM=EM.from(1),AM=EM.from("0.5"),RM=new nM("strings/5.7.0");var SM,kM;function OM(e,t=SM.current){t!=SM.current&&(RM.checkNormalize(),e=e.normalize(t));let n=[];for(let t=0;t<e.length;t++){const r=e.charCodeAt(t);if(r<128)n.push(r);else if(r<2048)n.push(r>>6|192),n.push(63&r|128);else if(55296==(64512&r)){t++;const i=e.charCodeAt(t);if(t>=e.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const a=65536+((1023&r)<<10)+(1023&i);n.push(a>>18|240),n.push(a>>12&63|128),n.push(a>>6&63|128),n.push(63&a|128)}else n.push(r>>12|224),n.push(r>>6&63|128),n.push(63&r|128)}return tr(n)}function IM(e,t){t||(t=function(e){return[parseInt(e,16)]});let n=0,r={};return e.split(",").forEach((e=>{let i=e.split(":");n+=parseInt(i[0],16),r[n]=t(i[1])})),r}function xM(e){let t=0;return e.split(",").map((e=>{let n=e.split("-");1===n.length?n[1]="0":""===n[1]&&(n[1]="1");let r=t+parseInt(n[0],16);return t=parseInt(n[1],16),{l:r,h:t}}))}function CM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function MM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?CM(Object(n),!0).forEach((function(t){pI(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CM(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function NM(e,t,n){return PM.apply(this,arguments)}function PM(){return(PM=NI(LI.mark((function e(t,n,r){var i,a,o,s,u,c,f,d;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n.users.map((function(e){return{ether_key:e.user,tokens:e.tokens.map((function(e){return MM({id:e.id,blueprint:e.blueprint},e.royalties&&e.royalties.length>0&&{royalties:e.royalties.map((function(e){return{recipient:e.recipient,percentage:e.percentage}}))})}))}})),a=n.royalties,o=MM(MM({contract_address:n.contract_address},a&&a.length>0&&{royalties:a.map((function(e){return{recipient:e.recipient,percentage:e.percentage}}))}),{},{users:i,auth_signature:""}),s=KC(OM(JSON.stringify(o))),e.next=6,zI(s,t);case 6:return u=e.sent,c=MM(MM({users:o.users.map((function(e){return{user:e.ether_key,tokens:e.tokens}}))},a&&a.length>0&&{royalties:a}),{},{contract_address:n.contract_address,auth_signature:u}),f={mintTokensRequestV2:[c]},e.next=11,r.mintTokens(f);case 11:return d=e.sent,e.abrupt("return",d.data);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function BM(e){switch(e.type){case"ERC721":return{type:"ERC721",data:{token_id:e.tokenId,token_address:e.tokenAddress}};case"ERC20":return{type:"ERC20",data:{token_address:e.tokenAddress}};case"ETH":return{type:"ETH",data:{decimals:18}}}}function DM(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return FM(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?FM(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function FM(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function LM(e){return UM.apply(this,arguments)}function UM(){return(UM=NI(LI.mark((function e(t){var n,r,i,a,o,s,u,c,f,d,l,p,h,b,m;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.ethSigner,i=t.starkSigner,a=t.request,o=t.transfersApi,e.next=3,r.getAddress();case 3:return s=e.sent,u="ERC721"===a.type?"1":a.amount,e.next=7,o.getSignableTransferV1({getSignableTransferRequest:{sender:s,token:BM(a),amount:u,receiver:a.receiver}});case 7:return c=e.sent,f=c.data,d=f.signable_message,l=f.payload_hash,e.next=11,zI(d,r);case 11:return p=e.sent,e.next=14,i.signMessage(l);case 14:return h=e.sent,b={sender_stark_key:c.data.sender_stark_key,sender_vault_id:c.data.sender_vault_id,receiver_stark_key:c.data.receiver_stark_key,receiver_vault_id:c.data.receiver_vault_id,asset_id:c.data.asset_id,amount:c.data.amount,nonce:c.data.nonce,expiration_timestamp:c.data.expiration_timestamp,stark_signature:h},e.next=18,o.createTransferV1({createTransferRequest:b,xImxEthAddress:s,xImxEthSignature:p});case 18:return m=e.sent,e.abrupt("return",{sent_signature:null==m?void 0:m.data.sent_signature,status:null==m||null===(n=m.data.status)||void 0===n?void 0:n.toString(),time:null==m?void 0:m.data.time,transfer_id:null==m?void 0:m.data.transfer_id});case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jM(e){return qM.apply(this,arguments)}function qM(){return(qM=NI(LI.mark((function e(t){var n,r,i,a,o,s,u,c,f,d,l,p,h,b,m,y,g;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.ethSigner,r=t.starkSigner,i=t.request,a=t.transfersApi,e.next=3,n.getAddress();case 3:return o=e.sent,s=i.map((function(e){return{amount:"1",token:BM({type:"ERC721",tokenId:e.tokenId,tokenAddress:e.tokenAddress}),receiver:e.receiver}})),e.next=7,a.getSignableTransfer({getSignableTransferRequestV2:{sender_ether_key:o,signable_requests:s}});case 7:if(u=e.sent,void 0!==(c=u.data.signable_message)){e.next=11;break}throw new Error("Invalid response from Signable registration offchain");case 11:return e.next=13,zI(c,n);case 13:f=e.sent,d=[],l=DM(u.data.signable_responses),e.prev=16,l.s();case 18:if((p=l.n()).done){e.next=27;break}return h=p.value,e.next=22,r.signMessage(h.payload_hash);case 22:b=e.sent,m={sender_vault_id:h.sender_vault_id,receiver_stark_key:h.receiver_stark_key,receiver_vault_id:h.receiver_vault_id,asset_id:h.asset_id,amount:h.amount,nonce:h.nonce,expiration_timestamp:h.expiration_timestamp,stark_signature:b},d.push(m);case 25:e.next=18;break;case 27:e.next=32;break;case 29:e.prev=29,e.t0=e.catch(16),l.e(e.t0);case 32:return e.prev=32,l.f(),e.finish(32);case 35:return y={sender_stark_key:u.data.sender_stark_key,requests:d},e.next=38,a.createTransfer({createTransferRequestV2:y,xImxEthAddress:o,xImxEthSignature:f});case 38:return g=e.sent,e.abrupt("return",{transfer_ids:null==g?void 0:g.data.transfer_ids});case 40:case"end":return e.stop()}}),e,null,[[16,29,32,35]])})))).apply(this,arguments)}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(SM||(SM={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(kM||(kM={})),xM("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e=>parseInt(e,16))),IM("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),IM("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),IM("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!=0)throw new Error("bad data");let t=[];for(let n=0;n<e.length;n+=4)t.push(parseInt(e.substring(n,n+4),16));return t})),xM("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");const zM=new nM("units/5.7.0"),HM=["wei","kwei","mwei","gwei","szabo","finney","ether"];function VM(e,t){if("string"!=typeof e&&zM.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=HM.indexOf(t);-1!==e&&(t=3*e)}return wM(e,null!=t?t:18)}function GM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function KM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?GM(Object(n),!0).forEach((function(t){pI(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GM(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function WM(e,t,n,r,i,a,o){return XM.apply(this,arguments)}function XM(){return(XM=NI(LI.mark((function e(t,n,r,i,a,o,s){var u,c,f;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return u=e.sent,e.next=5,qC(u,i,s);case 5:return c=e.sent,e.next=8,o.populateTransaction.registerAndDepositEth(u,i,c.operator_signature,r,a);case 8:return f=e.sent,e.abrupt("return",t.sendTransaction(KM(KM({},f),{},{value:n})));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $M(e,t,n,r,i,a){return JM.apply(this,arguments)}function JM(){return(JM=NI(LI.mark((function e(t,n,r,i,a,o){var s;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.populateTransaction["deposit(uint256,uint256,uint256)"](i,r,a);case 2:return s=e.sent,e.abrupt("return",t.sendTransaction(KM(KM({},s),{},{value:n})));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function YM(e,t,n,r,i,a){return QM.apply(this,arguments)}function QM(){return(QM=NI(LI.mark((function e(t,n,r,i,a,o){var s,u,c,f,d,l,p,h,b,m,y;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return s=e.sent,u={decimals:18},c=VM(n.amount,"wei"),f={user:s,token:{type:n.type,data:u},amount:c.toString()},e.next=8,r.getSignableDeposit({getSignableDepositRequest:f});case 8:return d=e.sent,e.next=11,a.encodeAsset({assetType:"asset",encodeAssetRequest:{token:{type:n.type}}});case 11:return l=e.sent,p=l.data.asset_type,h=d.data.stark_key,b=d.data.vault_id,m=wI.connect(o.ethConfiguration.coreContractAddress,t),y=xI.connect(o.ethConfiguration.registrationContractAddress,t),e.next=19,UC(h,y);case 19:if(e.sent){e.next=24;break}return e.abrupt("return",WM(t,c,p,h,b,m,i));case 24:return e.abrupt("return",$M(t,c,p,h,b,m));case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ZM(e,t,n,r,i,a){return eN.apply(this,arguments)}function eN(){return(eN=NI(LI.mark((function e(t,n,r,i,a,o){var s;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.populateTransaction.depositERC20(i,r,a,n);case 2:return s=e.sent,e.abrupt("return",t.sendTransaction(s));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function tN(e,t,n,r,i,a,o){return nN.apply(this,arguments)}function nN(){return(nN=NI(LI.mark((function e(t,n,r,i,a,o,s){var u,c,f;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return u=e.sent,e.next=5,qC(u,i,s);case 5:return c=e.sent,e.next=8,o.populateTransaction.registerAndDepositERC20(u,i,c.operator_signature,r,a,n);case 8:return f=e.sent,e.abrupt("return",t.sendTransaction(f));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function rN(e,t,n,r,i,a,o){return iN.apply(this,arguments)}function iN(){return(iN=NI(LI.mark((function e(t,n,r,i,a,o,s){var u,c,f,d,l,p,h,b,m,y,g,v,w,_,E,T;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return u=e.sent,e.next=5,a.getToken({address:n.tokenAddress});case 5:return c=e.sent,f=parseInt(c.data.decimals),d={decimals:f,token_address:n.tokenAddress},l=VM(n.amount,0),p=bI.connect(n.tokenAddress,t),e.next=12,p.populateTransaction.approve(s.ethConfiguration.coreContractAddress,l);case 12:return h=e.sent,e.next=15,t.sendTransaction(h);case 15:return b={user:u,token:{type:n.type,data:d},amount:l.toString()},e.next=18,r.getSignableDeposit({getSignableDepositRequest:b});case 18:return m=e.sent,e.next=21,o.encodeAsset({assetType:"asset",encodeAssetRequest:{token:{type:n.type,data:{token_address:n.tokenAddress}}}});case 21:return y=e.sent,g=y.data.asset_type,v=m.data.stark_key,w=m.data.vault_id,_=sM.from(m.data.amount),E=wI.connect(s.ethConfiguration.coreContractAddress,t),T=xI.connect(s.ethConfiguration.registrationContractAddress,t),e.next=30,UC(v,T);case 30:if(e.sent){e.next=35;break}return e.abrupt("return",tN(t,_,g,v,w,E,i));case 35:return e.abrupt("return",ZM(t,_,g,v,w,E));case 36:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function aN(e,t,n,r,i,a){return oN.apply(this,arguments)}function oN(){return(oN=NI(LI.mark((function e(t,n,r,i,a,o){var s;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.populateTransaction.depositNft(i,r,a,n);case 2:return s=e.sent,e.abrupt("return",t.sendTransaction(s));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function sN(e,t,n,r,i,a){return uN.apply(this,arguments)}function uN(){return(uN=NI(LI.mark((function e(t,n,r,i,a,o){var s,u,c,f,d,l,p,h,b,m,y,g,v,w;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return s=e.sent,u={token_address:n.tokenAddress,token_id:n.tokenId},c={user:s,token:{type:n.type,data:u},amount:"1".toString()},e.next=8,r.getSignableDeposit({getSignableDepositRequest:c});case 8:return f=e.sent,e.next=11,a.encodeAsset({assetType:"asset",encodeAssetRequest:{token:{type:n.type,data:{token_address:n.tokenAddress,token_id:n.tokenId}}}});case 11:return d=e.sent,l=d.data.asset_type,p=f.data.stark_key,h=f.data.vault_id,b=wI.connect(o.ethConfiguration.coreContractAddress,t),m=xI.connect(o.ethConfiguration.registrationContractAddress,t),e.next=19,UC(p,m);case 19:return y=e.sent,g=yI.connect(n.tokenAddress,t),v=o.ethConfiguration.coreContractAddress,e.next=24,g.isApprovedForAll(s,v);case 24:if(e.sent){e.next=28;break}return e.next=28,g.setApprovalForAll(v,!0);case 28:if(y){e.next=34;break}return e.next=31,qC(s,p,i);case 31:return w=e.sent,e.next=34,b.registerUser(s,p,w.operator_signature);case 34:return e.abrupt("return",aN(t,n.tokenId,l,p,h,b));case 35:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var cN=function(e){if(void 0!==e)return e;throw new Error("undefined field exception")};function fN(e){return dN.apply(this,arguments)}function dN(){return(dN=NI(LI.mark((function e(t){var n,r,i,a,o,s,u,c,f,d,l,p,h;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.ethSigner,r=t.starkSigner,i=t.withdrawalsApi,a="ERC721"===t.type?"1":t.amount,e.t0=i,e.next=5,n.getAddress();case 5:return e.t1=e.sent,e.t2=BM(t),e.t3=a,e.t4={user:e.t1,token:e.t2,amount:e.t3},e.t5={getSignableWithdrawalRequest:e.t4},e.next=12,e.t0.getSignableWithdrawal.call(e.t0,e.t5);case 12:return o=e.sent,s=o.data,u=s.signable_message,c=s.payload_hash,e.next=16,r.signMessage(c);case 16:return f=e.sent,e.next=19,KI(u,n);case 19:return d=e.sent,l=d.ethAddress,p=d.ethSignature,e.next=24,i.createWithdrawal({createWithdrawalRequest:{stark_key:cN(o.data.stark_key),amount:a,asset_id:cN(o.data.asset_id),vault_id:cN(o.data.vault_id),nonce:cN(o.data.nonce),stark_signature:f},xImxEthAddress:l,xImxEthSignature:p});case 24:return h=e.sent,e.abrupt("return",h.data);case 26:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function lN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lN(Object(n),!0).forEach((function(t){pI(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lN(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function hN(e,t,n,r){return bN.apply(this,arguments)}function bN(){return(bN=NI(LI.mark((function e(t,n,r,i){var a;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.encodeAsset({assetType:t,encodeAssetRequest:{token:pN({type:n},i&&{data:i})}});case 2:return a=e.sent,e.abrupt("return",a.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function mN(e,t,n,r,i){return yN.apply(this,arguments)}function yN(){return(yN=NI(LI.mark((function e(t,n,r,i,a){var o,s,u;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return o=e.sent,e.next=5,qC(o,r,a);case 5:return s=e.sent,e.next=8,i.populateTransaction.registerAndWithdraw(o,r,s.operator_signature,n);case 8:return u=e.sent,e.abrupt("return",t.sendTransaction(u));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function gN(e,t,n,r){return vN.apply(this,arguments)}function vN(){return(vN=NI(LI.mark((function e(t,n,r,i){var a;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.populateTransaction.withdraw(r,n);case 2:return a=e.sent,e.abrupt("return",t.sendTransaction(a));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wN(e,t,n,r,i,a){return _N.apply(this,arguments)}function _N(){return(_N=NI(LI.mark((function e(t,n,r,i,a,o){var s,u,c;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,hN("asset","ERC20",i,{token_address:r.tokenAddress});case 2:return s=e.sent,u=wI.connect(o.ethConfiguration.coreContractAddress,t),c=xI.connect(o.ethConfiguration.registrationContractAddress,t),e.next=7,UC(n,c);case 7:if(e.sent){e.next=12;break}return e.abrupt("return",mN(t,s.asset_type,n,c,a));case 12:return e.abrupt("return",gN(t,s.asset_type,n,u));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function EN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function TN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?EN(Object(n),!0).forEach((function(t){pI(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EN(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function AN(e,t,n,r,i){return RN.apply(this,arguments)}function RN(){return(RN=NI(LI.mark((function e(t,n,r,i,a){var o;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.populateTransaction.withdrawAndMint(r,n,i);case 2:return o=e.sent,e.abrupt("return",t.sendTransaction(o));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function SN(e,t,n,r,i,a){return kN.apply(this,arguments)}function kN(){return(kN=NI(LI.mark((function e(t,n,r,i,a,o){var s,u,c;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return s=e.sent,e.next=5,qC(s,r,o);case 5:return u=e.sent,e.next=8,a.populateTransaction.regsiterAndWithdrawAndMint(s,r,u.operator_signature,n,i);case 8:return c=e.sent,e.abrupt("return",t.sendTransaction(c));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ON(e){var t=e.data.id,n=e.data.blueprint||"";return am(Db("{".concat(t,"}:{").concat(n,"}")))}function IN(e,t,n,r,i,a){return xN.apply(this,arguments)}function xN(){return(xN=NI(LI.mark((function e(t,n,r,i,a,o){var s,u,c,f;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,hN("mintable-asset","ERC721",i,TN({id:r.data.id,token_address:r.data.tokenAddress},r.data.blueprint&&{blueprint:r.data.blueprint}));case 2:return s=e.sent,u=ON(r),c=wI.connect(o.ethConfiguration.coreContractAddress,t),f=xI.connect(o.ethConfiguration.registrationContractAddress,t),e.next=8,UC(n,f);case 8:if(e.sent){e.next=13;break}return e.abrupt("return",SN(t,s.asset_type,n,u,f,a));case 13:return e.abrupt("return",AN(t,s.asset_type,n,u,c));case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function CN(e,t,n,r,i,a){return MN.apply(this,arguments)}function MN(){return(MN=NI(LI.mark((function e(t,n,r,i,a,o){var s,u,c;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return s=e.sent,e.next=5,qC(s,r,o);case 5:return u=e.sent,e.next=8,a.populateTransaction.registerAndWithdrawNft(s,r,u.operator_signature,n,i);case 8:return c=e.sent,e.abrupt("return",t.sendTransaction(c));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function NN(e,t,n,r,i){return PN.apply(this,arguments)}function PN(){return(PN=NI(LI.mark((function e(t,n,r,i,a){var o;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.populateTransaction.withdrawNft(r,n,i);case 2:return o=e.sent,e.abrupt("return",t.sendTransaction(o));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function BN(e,t,n,r,i,a){return DN.apply(this,arguments)}function DN(){return(DN=NI(LI.mark((function e(t,n,r,i,a,o){var s,u,c;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,hN("asset","ERC721",i,{token_id:r.tokenId,token_address:r.tokenAddress});case 2:return s=e.sent,u=wI.connect(o.ethConfiguration.coreContractAddress,t),c=xI.connect(o.ethConfiguration.registrationContractAddress,t),e.next=7,UC(n,c);case 7:if(e.sent){e.next=12;break}return e.abrupt("return",CN(t,s.asset_type,n,r.tokenId,c,a));case 12:return e.abrupt("return",NN(t,s.asset_type,n,r.tokenId,u));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function FN(e,t,n,r,i,a,o){return LN.apply(this,arguments)}function LN(){return(LN=NI(LI.mark((function e(t,n,r,i,a,o,s){var u,c;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=r.tokenAddress,c=r.tokenId,e.next=4,a.getMintableTokenDetailsByClientTokenId({tokenAddress:u,tokenId:c}).then((function(e){return IN(t,n,{type:"ERC721",data:{id:c,tokenAddress:u,blueprint:e.data.blueprint}},i,o,s)})).catch((function(e){var a;if(404===(null===(a=e.response)||void 0===a?void 0:a.status))return BN(t,n,r,i,o,s);throw e}));case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function UN(e,t,n,r,i){return jN.apply(this,arguments)}function jN(){return(jN=NI(LI.mark((function e(t,n,r,i,a){var o,s,u;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return o=e.sent,e.next=5,qC(o,r,a);case 5:return s=e.sent,e.next=8,i.populateTransaction.registerAndWithdraw(o,r,s.operator_signature,n);case 8:return u=e.sent,e.abrupt("return",t.sendTransaction(u));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qN(e,t,n,r){return zN.apply(this,arguments)}function zN(){return(zN=NI(LI.mark((function e(t,n,r,i){var a;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.populateTransaction.withdraw(r,n);case 2:return a=e.sent,e.abrupt("return",t.sendTransaction(a));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function HN(e,t,n,r,i){return VN.apply(this,arguments)}function VN(){return(VN=NI(LI.mark((function e(t,n,r,i,a){var o,s,u;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,hN("asset","ETH",r);case 2:return o=e.sent,s=wI.connect(a.ethConfiguration.coreContractAddress,t),u=xI.connect(a.ethConfiguration.registrationContractAddress,t),e.next=7,UC(n,u);case 7:if(e.sent){e.next=12;break}return e.abrupt("return",UN(t,o.asset_type,n,u,i));case 12:return e.abrupt("return",qN(t,o.asset_type,n,s));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function GN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function KN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?GN(Object(n),!0).forEach((function(t){pI(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GN(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function WN(e){return XN.apply(this,arguments)}function XN(){return(XN=NI(LI.mark((function e(t){var n,r,i,a,o,s,u,c,f,d,l,p,h,b,m,y,g;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.ethSigner,r=t.starkSigner,i=t.request,a=t.ordersApi,e.next=3,n.getAddress();case 3:return o=e.sent,s="ERC721"===i.sell.type?"1":i.sell.amount,u="ERC721"===i.buy.type?"1":i.buy.amount,c={user:o,amount_buy:u,token_buy:BM(i.buy),amount_sell:s,token_sell:BM(i.sell),fees:i.fees,expiration_timestamp:i.expiration_timestamp,split_fees:!0},e.next=9,a.getSignableOrder({getSignableOrderRequestV3:c});case 9:return f=e.sent,d=f.data,l=d.signable_message,p=d.payload_hash,e.next=13,zI(l,n);case 13:return h=e.sent,e.next=16,r.signMessage(p);case 16:return b=e.sent,m=f.data,y={createOrderRequest:{amount_buy:m.amount_buy,amount_sell:m.amount_sell,asset_id_buy:m.asset_id_buy,asset_id_sell:m.asset_id_sell,expiration_timestamp:m.expiration_timestamp,include_fees:!0,fees:i.fees,nonce:m.nonce,stark_key:m.stark_key,stark_signature:b,vault_id_buy:m.vault_id_buy,vault_id_sell:m.vault_id_sell},xImxEthAddress:o,xImxEthSignature:h},e.next=21,a.createOrderV3(y);case 21:return g=e.sent,e.abrupt("return",KN({},g.data));case 23:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $N(e){return JN.apply(this,arguments)}function JN(){return(JN=NI(LI.mark((function e(t){var n,r,i,a,o,s,u,c,f,d,l,p;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.ethSigner,r=t.starkSigner,i=t.request,a=t.ordersApi,e.next=3,a.getSignableCancelOrderV3({getSignableCancelOrderRequest:{order_id:i.order_id}});case 3:return o=e.sent,s=o.data,u=s.signable_message,c=s.payload_hash,e.next=7,zI(u,n);case 7:return f=e.sent,e.next=10,r.signMessage(c);case 10:return d=e.sent,e.next=13,n.getAddress();case 13:return l=e.sent,e.next=16,a.cancelOrderV3({id:i.order_id.toString(),cancelOrderRequest:{order_id:i.order_id,stark_signature:d},xImxEthAddress:l,xImxEthSignature:f});case 16:return p=e.sent,e.abrupt("return",{order_id:p.data.order_id,status:p.data.status});case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function YN(e){return QN.apply(this,arguments)}function QN(){return(QN=NI(LI.mark((function e(t){var n,r,i,a,o,s,u,c,f,d,l,p;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.ethSigner,r=t.starkSigner,i=t.request,a=t.tradesApi,e.next=3,n.getAddress();case 3:return o=e.sent,e.next=6,a.getSignableTrade({getSignableTradeRequest:{user:o,order_id:i.order_id,fees:i.fees}});case 6:return s=e.sent,u=s.data,c=u.signable_message,f=u.payload_hash,e.next=10,zI(c,n);case 10:return d=e.sent,e.next=13,r.signMessage(f);case 13:return l=e.sent,e.next=16,a.createTradeV3({createTradeRequest:{amount_buy:s.data.amount_buy,amount_sell:s.data.amount_sell,asset_id_buy:s.data.asset_id_buy,asset_id_sell:s.data.asset_id_sell,expiration_timestamp:s.data.expiration_timestamp,fee_info:s.data.fee_info,fees:i.fees,include_fees:!0,nonce:s.data.nonce,order_id:i.order_id,stark_key:s.data.stark_key,vault_id_buy:s.data.vault_id_buy,vault_id_sell:s.data.vault_id_sell,stark_signature:l},xImxEthAddress:o,xImxEthSignature:d});case 16:return p=e.sent,e.abrupt("return",p.data);case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ZN(e){return eP.apply(this,arguments)}function eP(){return(eP=NI(LI.mark((function e(t){var n,r,i,a,o,s,u,c,f,d,l,p,h,b,m;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.ethSigner,i=t.starkSigner,a=t.request,o=t.exchangesApi,e.next=3,r.getAddress();case 3:return s=e.sent,u=a.amount,e.next=7,o.getExchangeSignableTransfer({id:a.transactionID,getSignableTransferRequest:{sender:s,token:BM(a),amount:u,receiver:a.receiver}});case 7:return c=e.sent,f=c.data,d=f.signable_message,l=f.payload_hash,e.next=11,zI(d,r);case 11:return p=e.sent,e.next=14,i.signMessage(l);case 14:return h=e.sent,b={sender_stark_key:c.data.sender_stark_key,sender_vault_id:c.data.sender_vault_id,receiver_stark_key:c.data.receiver_stark_key,receiver_vault_id:c.data.receiver_vault_id,asset_id:c.data.asset_id,amount:c.data.amount,nonce:c.data.nonce,expiration_timestamp:c.data.expiration_timestamp,stark_signature:h},e.next=18,o.createExchangeTransfer({id:a.transactionID,createTransferRequest:b,xImxEthAddress:s,xImxEthSignature:p});case 18:return m=e.sent,e.abrupt("return",{sent_signature:null==m?void 0:m.data.sent_signature,status:null==m||null===(n=m.data.status)||void 0===n?void 0:n.toString(),time:null==m?void 0:m.data.time,transfer_id:null==m?void 0:m.data.transfer_id});case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function tP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function nP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tP(Object(n),!0).forEach((function(t){pI(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tP(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var rP=function(){function e(t){fI(this,e),this.config=t;var n=t.apiConfiguration;this.config=t,this.depositsApi=new Fx(n),this.encodingApi=new qx(n),this.mintsApi=new rC(n),this.ordersApi=new dC(n),this.tokensApi=new vC(n),this.tradesApi=new TC(n),this.transfersApi=new kC(n),this.usersApi=new CC(n),this.withdrawalsApi=new BC(n),this.projectsApi=new bC(n),this.collectionsApi=new Nx(n),this.metadataApi=new $x(n),this.metadataRefreshesApi=new Zx(n),this.exchangesApi=new Gx(n)}var t,n,r,i,a,o,s,u,c,f,d,l,p,h,b,m,y,g,v,w,_,E,T,A,R,S,k,O;return lI(e,[{key:"isChainValid",value:function(e){return e===this.config.ethConfiguration.chainID}},{key:"validateChain",value:(O=NI(LI.mark((function e(t){var n;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getChainId();case 2:if(n=e.sent,this.isChainValid(n)){e.next=5;break}throw new Error("The wallet used for this operation is not from the correct network.");case 5:case"end":return e.stop()}}),e,this)}))),function(e){return O.apply(this,arguments)})},{key:"registerOffchain",value:(k=NI(LI.mark((function e(t){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",FC(nP(nP({},t),{},{usersApi:this.usersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return k.apply(this,arguments)})},{key:"isRegisteredOnchain",value:(S=NI(LI.mark((function e(t){var n,r;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return n=xI.connect(this.config.ethConfiguration.registrationContractAddress,t.ethSigner),e.next=5,t.starkSigner.getAddress();case 5:return r=e.sent,e.abrupt("return",UC(r,n));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return S.apply(this,arguments)})},{key:"mint",value:(R=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",NM(t,n,this.mintsApi));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return R.apply(this,arguments)})},{key:"transfer",value:(A=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",LM(nP(nP({},t),{},{request:n,transfersApi:this.transfersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return A.apply(this,arguments)})},{key:"exchangeTransfer",value:(T=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",ZN(nP(nP({},t),{},{request:n,exchangesApi:this.exchangesApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return T.apply(this,arguments)})},{key:"batchNftTransfer",value:(E=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",jM(nP(nP({},t),{},{request:n,transfersApi:this.transfersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return E.apply(this,arguments)})},{key:"deposit",value:(_=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=n.type,e.next="ETH"===e.t0?3:"ERC20"===e.t0?4:"ERC721"===e.t0?5:6;break;case 3:return e.abrupt("return",this.depositEth(t,n));case 4:return e.abrupt("return",this.depositERC20(t,n));case 5:return e.abrupt("return",this.depositERC721(t,n));case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return _.apply(this,arguments)})},{key:"depositEth",value:(w=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",YM(t,n,this.depositsApi,this.usersApi,this.encodingApi,this.config));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return w.apply(this,arguments)})},{key:"depositERC20",value:(v=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",rN(t,n,this.depositsApi,this.usersApi,this.tokensApi,this.encodingApi,this.config));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"depositERC721",value:(g=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",sN(t,n,this.depositsApi,this.usersApi,this.encodingApi,this.config));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"prepareWithdrawal",value:(y=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",fN(nP(nP(nP({},t),n),{},{withdrawalsApi:this.withdrawalsApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"completeWithdrawal",value:function(e,t,n){switch(n.type){case"ETH":return this.completeEthWithdrawal(e,t);case"ERC20":return this.completeERC20Withdrawal(e,t,n);case"ERC721":return this.completeERC721Withdrawal(e,t,n)}}},{key:"completeEthWithdrawal",value:(m=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",HN(t,n,this.encodingApi,this.usersApi,this.config));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return m.apply(this,arguments)})},{key:"completeERC20Withdrawal",value:(b=NI(LI.mark((function e(t,n,r){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",wN(t,n,r,this.encodingApi,this.usersApi,this.config));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return b.apply(this,arguments)})},{key:"completeERC721Withdrawal",value:function(){var e=NI(LI.mark((function e(t,n,r){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",FN(t,n,r,this.encodingApi,this.mintsApi,this.usersApi,this.config));case 3:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"createOrder",value:(h=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",WN(nP(nP({},t),{},{request:n,ordersApi:this.ordersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"cancelOrder",value:(p=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",$N(nP(nP({},t),{},{request:n,ordersApi:this.ordersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"createTrade",value:(l=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",YN(nP(nP({},t),{},{request:n,tradesApi:this.tradesApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"createProject",value:(d=NI(LI.mark((function e(t,n){var r;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,VI(t);case 2:return r=e.sent,e.abrupt("return",this.projectsApi.createProject({iMXSignature:r.signature,iMXTimestamp:r.timestamp,createProjectRequest:n}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"getProject",value:(f=NI(LI.mark((function e(t,n){var r;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,VI(t);case 2:return r=e.sent,e.abrupt("return",this.projectsApi.getProject({id:n,iMXSignature:r.signature,iMXTimestamp:r.timestamp}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})},{key:"getProjects",value:(c=NI(LI.mark((function e(t,n,r,i,a){var o;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,VI(t);case 2:return o=e.sent,e.abrupt("return",this.projectsApi.getProjects({iMXSignature:o.signature,iMXTimestamp:o.timestamp,pageSize:n,cursor:r,orderBy:i,direction:a}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r,i){return c.apply(this,arguments)})},{key:"createCollection",value:(u=NI(LI.mark((function e(t,n){var r;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,VI(t);case 2:return r=e.sent,e.abrupt("return",this.collectionsApi.createCollection({iMXSignature:r.signature,iMXTimestamp:r.timestamp,createCollectionRequest:n}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"updateCollection",value:(s=NI(LI.mark((function e(t,n,r){var i;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,VI(t);case 2:return i=e.sent,e.abrupt("return",this.collectionsApi.updateCollection({iMXSignature:i.signature,iMXTimestamp:i.timestamp,address:n,updateCollectionRequest:r}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return s.apply(this,arguments)})},{key:"addMetadataSchemaToCollection",value:(o=NI(LI.mark((function e(t,n,r){var i;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,VI(t);case 2:return i=e.sent,e.abrupt("return",this.metadataApi.addMetadataSchemaToCollection({iMXSignature:i.signature,iMXTimestamp:i.timestamp,addMetadataSchemaToCollectionRequest:r,address:n}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return o.apply(this,arguments)})},{key:"updateMetadataSchemaByName",value:(a=NI(LI.mark((function e(t,n,r,i){var a;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,VI(t);case 2:return a=e.sent,e.abrupt("return",this.metadataApi.updateMetadataSchemaByName({iMXSignature:a.signature,iMXTimestamp:a.timestamp,address:n,name:r,metadataSchemaRequest:i}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return a.apply(this,arguments)})},{key:"listMetadataRefreshes",value:(i=NI(LI.mark((function e(t,n,r,i){var a,o;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,VI(t);case 2:return a=e.sent,e.next=5,t.getAddress();case 5:return o=e.sent,e.abrupt("return",this.metadataRefreshesApi.getAListOfMetadataRefreshes({xImxEthSignature:a.signature,xImxEthTimestamp:a.timestamp,xImxEthAddress:o,collectionAddress:n,pageSize:r,cursor:i}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return i.apply(this,arguments)})},{key:"getMetadataRefreshErrors",value:(r=NI(LI.mark((function e(t,n,r,i){var a,o;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,VI(t);case 2:return a=e.sent,e.next=5,t.getAddress();case 5:return o=e.sent,e.abrupt("return",this.metadataRefreshesApi.getMetadataRefreshErrors({xImxEthSignature:a.signature,xImxEthTimestamp:a.timestamp,xImxEthAddress:o,refreshId:n,pageSize:r,cursor:i}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,n,i){return r.apply(this,arguments)})},{key:"getMetadataRefreshResults",value:(n=NI(LI.mark((function e(t,n){var r,i;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,VI(t);case 2:return r=e.sent,e.next=5,t.getAddress();case 5:return i=e.sent,e.abrupt("return",this.metadataRefreshesApi.getMetadataRefreshResults({xImxEthSignature:r.signature,xImxEthTimestamp:r.timestamp,xImxEthAddress:i,refreshId:n}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"createMetadataRefresh",value:(t=NI(LI.mark((function e(t,n){var r,i;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,VI(t);case 2:return r=e.sent,e.next=5,t.getAddress();case 5:return i=e.sent,e.abrupt("return",this.metadataRefreshesApi.requestAMetadataRefresh({xImxEthSignature:r.signature,xImxEthTimestamp:r.timestamp,xImxEthAddress:i,createMetadataRefreshRequest:n}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})}]),e}();var iP=function(e){AI(n,cx(Error));var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=_I(e);if(t){var i=_I(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return kI(this,n)}}(n);function n(e){var r,i=e.code,a=e.details,o=e.message;return fI(this,n),(r=t.call(this,o)).code=i,r.details=a,r}return lI(n)}();function aP(e){if(cI.isAxiosError(e)&&e.response){var t,n,r,i=e.response.data;return i.code&&i.message?new iP({code:i.code,details:i.details,message:i.message}):new iP({code:null!==(t=null!==(n=e.code)&&void 0!==n?n:null===(r=e.response)||void 0===r?void 0:r.status.toString())&&void 0!==t?t:"unknown_error_code",message:String(e)})}return new iP({code:"unknown_error_code",message:String(e)})}var oP=function(){function e(t){fI(this,e),this.depositsApi=new Fx(t.apiConfiguration),this.mintsApi=new rC(t.apiConfiguration),this.ordersApi=new dC(t.apiConfiguration),this.tokensApi=new vC(t.apiConfiguration),this.tradesApi=new TC(t.apiConfiguration),this.transfersApi=new kC(t.apiConfiguration),this.exchangeApi=new Gx(t.apiConfiguration),this.usersApi=new CC(t.apiConfiguration),this.withdrawalsApi=new BC(t.apiConfiguration),this.balanceApi=new Ix(t.apiConfiguration),this.assetApi=new Rx(t.apiConfiguration),this.collectionApi=new Nx(t.apiConfiguration),this.metadataApi=new $x(t.apiConfiguration),this.metadataRefreshesApi=new Zx(t.apiConfiguration),this.nftCheckoutPrimaryApi=new sC(t.apiConfiguration),this.projectsApi=new bC(t.apiConfiguration),this.workflows=new rP(t)}var t,n,r;return lI(e,[{key:"deposit",value:function(e,t){return this.workflows.deposit(e,t).catch((function(e){throw aP(e)}))}},{key:"getDeposit",value:function(e){return this.depositsApi.getDeposit(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"listDeposits",value:function(e){return this.depositsApi.listDeposits(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"registerOffchain",value:function(e){return this.workflows.registerOffchain(e).catch((function(e){throw aP(e)}))}},{key:"isRegisteredOnchain",value:function(e){return this.workflows.isRegisteredOnchain(e).catch((function(e){throw aP(e)}))}},{key:"getUser",value:function(e){return this.usersApi.getUsers({user:e}).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"getAsset",value:function(e){return this.assetApi.getAsset(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"listAssets",value:function(e){return this.assetApi.listAssets(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"createCollection",value:function(e,t){return this.workflows.createCollection(e,t).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"getCollection",value:function(e){return this.collectionApi.getCollection(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"listCollectionFilters",value:function(e){return this.collectionApi.listCollectionFilters(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"listCollections",value:function(e){return this.collectionApi.listCollections(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"updateCollection",value:function(e,t,n){return this.workflows.updateCollection(e,t,n).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"addMetadataSchemaToCollection",value:function(e,t,n){return this.workflows.addMetadataSchemaToCollection(e,t,n).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"getMetadataSchema",value:function(e){return this.metadataApi.getMetadataSchema(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"updateMetadataSchemaByName",value:function(e,t,n,r){return this.workflows.updateMetadataSchemaByName(e,t,n,r).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"listMetadataRefreshes",value:function(e,t,n,r){return this.workflows.listMetadataRefreshes(e,t,n,r).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"getMetadataRefreshErrors",value:function(e,t,n,r){return this.workflows.getMetadataRefreshErrors(e,t,n,r).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"getMetadataRefreshResults",value:function(e,t){return this.workflows.getMetadataRefreshResults(e,t).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"createMetadataRefresh",value:function(e,t){return this.workflows.createMetadataRefresh(e,t).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"createProject",value:(r=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.workflows.createProject(t,n).then((function(e){return e.data})).catch((function(e){throw aP(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"getProject",value:(n=NI(LI.mark((function e(t,n){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.workflows.getProject(t,n).then((function(e){return e.data})).catch((function(e){throw aP(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"getProjects",value:(t=NI(LI.mark((function e(t,n,r,i,a){return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.workflows.getProjects(t,n,r,i,a).then((function(e){return e.data})).catch((function(e){throw aP(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,n,r,i,a){return t.apply(this,arguments)})},{key:"getBalance",value:function(e){return this.balanceApi.getBalance(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"listBalances",value:function(e){return this.balanceApi.listBalances(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"getMint",value:function(e){return this.mintsApi.getMint(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"listMints",value:function(e){return this.mintsApi.listMints(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"mint",value:function(e,t){return this.workflows.mint(e,t).catch((function(e){throw aP(e)}))}},{key:"listWithdrawals",value:function(e){return this.withdrawalsApi.listWithdrawals(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"getWithdrawal",value:function(e){return this.withdrawalsApi.getWithdrawal(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"prepareWithdrawal",value:function(e,t){return this.workflows.prepareWithdrawal(e,t).catch((function(e){throw aP(e)}))}},{key:"completeWithdrawal",value:function(e,t,n){return this.workflows.completeWithdrawal(e,t,n).catch((function(e){throw aP(e)}))}},{key:"getOrder",value:function(e){return this.ordersApi.getOrderV3(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"listOrders",value:function(e){return this.ordersApi.listOrdersV3(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"createOrder",value:function(e,t){return this.workflows.createOrder(e,t).catch((function(e){throw aP(e)}))}},{key:"cancelOrder",value:function(e,t){return this.workflows.cancelOrder(e,t).catch((function(e){throw aP(e)}))}},{key:"getTrade",value:function(e){return this.tradesApi.getTrade(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"listTrades",value:function(e){return this.tradesApi.listTradesV3(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"createTrade",value:function(e,t){return this.workflows.createTrade(e,t).catch((function(e){throw aP(e)}))}},{key:"getToken",value:function(e){return this.tokensApi.getToken(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"listTokens",value:function(e){return this.tokensApi.listTokens(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"getTransfer",value:function(e){return this.transfersApi.getTransfer(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"listTransfers",value:function(e){return this.transfersApi.listTransfers(e).then((function(e){return e.data})).catch((function(e){throw aP(e)}))}},{key:"transfer",value:function(e,t){return this.workflows.transfer(e,t).catch((function(e){throw aP(e)}))}},{key:"batchNftTransfer",value:function(e,t){return this.workflows.batchNftTransfer(e,t).catch((function(e){throw aP(e)}))}},{key:"createExchange",value:function(e){return this.exchangeApi.createExchange(e).catch((function(e){throw aP(e)}))}},{key:"getExchange",value:function(e){return this.exchangeApi.getExchange(e).catch((function(e){throw aP(e)}))}},{key:"getExchanges",value:function(e){return this.exchangeApi.getExchanges(e).catch((function(e){throw aP(e)}))}},{key:"exchangeTransfer",value:function(e,t){return this.workflows.exchangeTransfer(e,t).catch((function(e){throw aP(e)}))}},{key:"createNftPrimary",value:function(e){return this.nftCheckoutPrimaryApi.createNftPrimary(e).catch((function(e){throw aP(e)}))}},{key:"getCurrenciesNFTCheckoutPrimary",value:function(e){return this.nftCheckoutPrimaryApi.getCurrenciesNFTCheckoutPrimary(e).catch((function(e){throw aP(e)}))}},{key:"getNftPrimaryTransaction",value:function(e){return this.nftCheckoutPrimaryApi.getNftPrimaryTransaction(e).catch((function(e){throw aP(e)}))}},{key:"getNftPrimaryTransactions",value:function(e){return this.nftCheckoutPrimaryApi.getNftPrimaryTransactions(e).catch((function(e){throw aP(e)}))}}]),e}();function sP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function uP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sP(Object(n),!0).forEach((function(t){pI(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sP(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var cP={"x-sdk-version":"imx-core-sdk-ts-".concat("2.0.2")},fP=function(e){var t=e.coreContractAddress,n=e.registrationContractAddress,r=e.chainID,i=e.basePath,a=e.headers,o=e.sdkVersion;if(!i.trim())throw Error("basePath can not be empty");return o&&(cP["x-sdk-version"]=o),a=uP(uP({},a||{}),cP),{apiConfiguration:new DC({basePath:i,baseOptions:{headers:a}}),ethConfiguration:{coreContractAddress:t,registrationContractAddress:n,chainID:r}}},dP={get PRODUCTION(){return fP({basePath:"https://api.x.immutable.com",chainID:1,coreContractAddress:"0x5FDCCA53617f4d2b9134B29090C87D01058e27e9",registrationContractAddress:"0x72a06bf2a1CE5e39cBA06c0CAb824960B587d64c"})},get SANDBOX(){return fP({basePath:"https://api.sandbox.x.immutable.com",chainID:5,coreContractAddress:"0x7917eDb51ecD6CdB3F9854c3cc593F33de10c623",registrationContractAddress:"0x1C97Ada273C9A52253f463042f29117090Cd7D83"})},createConfig:fP},lP=new Fn("08000000 00000010 ffffffff ffffffff b781126d cae7b232 1e66a241 adc64d2f",16);new um.ec(new um.curves.PresetCurve({type:"short",prime:null,p:"08000000 00000011 00000000 00000000 00000000 00000000 00000000 00000001",a:"00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000001",b:"06f21413 efbe40de 150e596d 72f7a8c5 609ad26c 15c915c1 f4cdfcb9 9cee9e89",n:lP.toString("hex"),hash:gc.sha256,gRed:!1,g:["1ef15c18599971b7beced415a40f0c7deacfd9b0d1819e03d723d8bc943cfca","5668060aa49730b7be4801df46ec62de53ecd11abe43a32873000c36e8dc1f"]}));var pP=function(){var e=new Fn("1 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000",16);return e.sub(e.mod(lP))};function hP(e,t){return new Fn(gc.sha256().update(xb(nm(e)+Qb(Fb(t),2))).digest("hex"),16)}function bP(e){for(var t=pP(),n=hP(e.toString("hex",64),0),r=0;n.gte(t);r++)n=hP(n.toString("hex"),r);return n.umod(lP).toString("hex")}function mP(e){for(var t=pP(),n=hP(e.toString("hex",64),0),r=1;n.gte(t);r++)n=hP(n.toString("hex"),r);return n.umod(lP).toString("hex")}function yP(e){var t=pP();return hP(e.toString("hex",64),0).gte(t)}function gP(e){return vP.apply(this,arguments)}function vP(){return(vP=NI(LI.mark((function e(t){var n,r;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=new oP(dP.PRODUCTION),e.next=4,n.getUser(t);case 4:if(!((r=e.sent).accounts.length>0)){e.next=7;break}return e.abrupt("return",{starkPublicKey:r.accounts[0],accountNotFound:!1});case 7:e.next=14;break;case 9:if(e.prev=9,e.t0=e.catch(0),!(e.t0 instanceof iP&&"account_not_found"==e.t0.code)){e.next=13;break}return e.abrupt("return",{starkPublicKey:"",accountNotFound:!0});case 13:throw e.t0;case 14:case"end":return e.stop()}}),e,null,[[0,9]])})))).apply(this,arguments)}function wP(e,t){var n=Ak.hdkey.fromMasterSeed(Buffer.from(e.slice(2),"hex")).derivePath(t).getWallet().getPrivateKey();return new Fn(n)}function _P(e,t,n){return EP.apply(this,arguments)}function EP(){return(EP=NI(LI.mark((function e(t,n,r){var i,a,o,s,u,c,f,d;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=wP(t,n),a=mP(i),yP(i)){e.next=4;break}return e.abrupt("return",a);case 4:return e.next=6,gP(r);case 6:if(void 0!==(o=e.sent)){e.next=9;break}throw new Error("Error fetching stark public key from IMX");case 9:if(!o.accountNotFound){e.next=11;break}return e.abrupt("return",a);case 11:return s=new Fn(nm(o.starkPublicKey),16),e.next=14,sx(a).getAddress();case 14:if(u=e.sent,!s.eq(new Fn(nm(u),16))){e.next=17;break}return e.abrupt("return",a);case 17:return c=bP(i),e.next=20,sx(c).getAddress();case 20:if(u=e.sent,!s.eq(new Fn(nm(u),16))){e.next=23;break}return e.abrupt("return",c);case 23:return f=ax(t,n),d=ix(f),e.next=27,sx(d).getAddress();case 27:if(u=e.sent,!s.eq(new Fn(nm(u),16))){e.next=30;break}return e.abrupt("return",d);case 30:throw new Error("Can not deterministically generate stark private key - please contact support");case 31:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function TP(e){return AP.apply(this,arguments)}function AP(){return(AP=NI(LI.mark((function e(t){var n,r,i,a,o;return LI.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return n=e.sent.toLowerCase(),e.next=5,t.signMessage("Only sign this request if you’ve initiated an action with Immutable X.");case 5:return r=e.sent,i=hr(r).s,a=nx("starkex","immutablex",n,"1"),e.next=10,_P(i,a,n);case 10:return o=e.sent,e.abrupt("return",o.padStart(64,"0"));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}nM.errors.INSUFFICIENT_FUNDS,nM.errors.NONCE_EXPIRED,nM.errors.REPLACEMENT_UNDERPRICED;const RP=({basePath:e,chainID:t,coreContractAddress:n,registrationContractAddress:r})=>dP.createConfig({basePath:e,chainID:t,coreContractAddress:n,registrationContractAddress:r,sdkVersion:"ts-immutable-sdk-0.13.1-alpha"}),SP=()=>RP({basePath:"https://api.sandbox.x.immutable.com",chainID:5,coreContractAddress:"0x7917eDb51ecD6CdB3F9854c3cc593F33de10c623",registrationContractAddress:"0x1C97Ada273C9A52253f463042f29117090Cd7D83"});class kP{immutableXConfig;baseConfig;constructor({baseConfig:e,overrides:n}){if(this.baseConfig=e,n)this.immutableXConfig=n.immutableXConfig;else switch(e.environment){case t.SANDBOX:this.immutableXConfig=SP();break;case t.PRODUCTION:this.immutableXConfig=RP({basePath:"https://api.x.immutable.com",chainID:1,coreContractAddress:"0x5FDCCA53617f4d2b9134B29090C87D01058e27e9",registrationContractAddress:"0x72a06bf2a1CE5e39cBA06c0CAb824960B587d64c"});break;default:this.immutableXConfig=SP()}}}class OP{immutableX;depositsApi;mintsApi;ordersApi;tokensApi;tradesApi;transfersApi;exchangeApi;nftCheckoutPrimaryApi;usersApi;withdrawalsApi;balanceApi;assetApi;collectionApi;metadataApi;metadataRefreshesApi;projectsApi;constructor(e){const t=new kP(e);this.immutableX=new oP(t.immutableXConfig),this.depositsApi=this.immutableX.depositsApi,this.mintsApi=this.immutableX.mintsApi,this.ordersApi=this.immutableX.ordersApi,this.tokensApi=this.immutableX.tokensApi,this.tradesApi=this.immutableX.tradesApi,this.transfersApi=this.immutableX.transfersApi,this.exchangeApi=this.immutableX.exchangeApi,this.usersApi=this.immutableX.usersApi,this.withdrawalsApi=this.immutableX.withdrawalsApi,this.balanceApi=this.immutableX.balanceApi,this.assetApi=this.immutableX.assetApi,this.collectionApi=this.immutableX.collectionApi,this.metadataApi=this.immutableX.metadataApi,this.metadataRefreshesApi=this.immutableX.metadataRefreshesApi,this.nftCheckoutPrimaryApi=this.immutableX.nftCheckoutPrimaryApi,this.projectsApi=this.immutableX.projectsApi}getDeposit(e){return this.immutableX.getDeposit(e)}listDeposits(e){return this.immutableX.listDeposits(e)}getUser(e){return this.immutableX.getUser(e)}getAsset(e){return this.immutableX.getAsset(e)}listAssets(e){return this.immutableX.listAssets(e)}createCollection(e,t){return this.immutableX.createCollection(e,t)}getCollection(e){return this.immutableX.getCollection(e)}listCollectionFilters(e){return this.immutableX.listCollectionFilters(e)}listCollections(e){return this.collectionApi.listCollections(e).then((e=>e.data))}updateCollection(e,t,n){return this.immutableX.updateCollection(e,t,n)}addMetadataSchemaToCollection(e,t,n){return this.immutableX.addMetadataSchemaToCollection(e,t,n)}getMetadataSchema(e){return this.immutableX.getMetadataSchema(e)}updateMetadataSchemaByName(e,t,n,r){return this.immutableX.updateMetadataSchemaByName(e,t,n,r)}listMetadataRefreshes(e,t,n,r){return this.immutableX.listMetadataRefreshes(e,t,n,r)}getMetadataRefreshErrors(e,t,n,r){return this.immutableX.getMetadataRefreshErrors(e,t,n,r)}getMetadataRefreshResults(e,t){return this.immutableX.getMetadataRefreshResults(e,t)}createMetadataRefresh(e,t){return this.immutableX.createMetadataRefresh(e,t)}async createProject(e,t){return this.immutableX.createProject(e,t)}async getProject(e,t){return this.immutableX.getProject(e,t)}async getProjects(e,t,n,r,i){return this.immutableX.getProjects(e,t,n,r,i)}getBalance(e){return this.immutableX.getBalance(e)}listBalances(e){return this.immutableX.listBalances(e)}getMint(e){return this.immutableX.getMint(e)}listMints(e){return this.immutableX.listMints(e)}mint(e,t){return this.immutableX.mint(e,t)}listWithdrawals(e){return this.immutableX.listWithdrawals(e)}getWithdrawal(e){return this.immutableX.getWithdrawal(e)}getOrder(e){return this.immutableX.getOrder(e)}listOrders(e){return this.immutableX.listOrders(e)}getTrade(e){return this.immutableX.getTrade(e)}listTrades(e){return this.immutableX.listTrades(e)}getToken(e){return this.immutableX.getToken(e)}listTokens(e){return this.immutableX.listTokens(e)}getTransfer(e){return this.immutableX.getTransfer(e)}listTransfers(e){return this.immutableX.listTransfers(e)}createExchange(e){return this.immutableX.createExchange(e).then((e=>e.data))}getExchange(e){return this.immutableX.getExchange(e).then((e=>e.data))}getExchanges(e){return this.immutableX.getExchanges(e).then((e=>e.data))}exchangeTransfer(e,t){return this.immutableX.exchangeTransfer(e,t)}createNftPrimary(e){return this.immutableX.createNftPrimary(e).then((e=>e.data))}getCurrenciesNFTCheckoutPrimary(e){return this.immutableX.getCurrenciesNFTCheckoutPrimary(e).then((e=>e.data))}getNftPrimaryTransaction(e){return this.immutableX.getNftPrimaryTransaction(e).then((e=>e.data))}getNftPrimaryTransactions(e){return this.immutableX.getNftPrimaryTransactions(e).then((e=>e.data))}}var IP=Object.freeze({__proto__:null,ImmutableXClient:OP,imxClientCreateStarkSigner:sx,imxClientGenerateLegacyStarkPrivateKey:TP});var xP={exports:{}};!function(e,t){e.exports=function(){var e=e||function(e,t){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==xt&&xt.crypto&&(n=xt.crypto),!n)try{n=mm}catch(e){}var r=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),a={},o=a.lib={},s=o.Base={extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=o.WordArray=s.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||f).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var a=0;a<i;a++){var o=n[a>>>2]>>>24-a%4*8&255;t[r+a>>>2]|=o<<24-(r+a)%4*8}else for(var s=0;s<i;s+=4)t[r+s>>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(r());return new u.init(t,e)}}),c=a.enc={},f=c.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var a=t[i>>>2]>>>24-i%4*8&255;r.push((a>>>4).toString(16)),r.push((15&a).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new u.init(n,t/2)}},d=c.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var a=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(a))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new u.init(n,t)}},l=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},p=o.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,i=r.words,a=r.sigBytes,o=this.blockSize,s=a/(4*o),c=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*o,f=e.min(4*c,a);if(c){for(var d=0;d<c;d+=o)this._doProcessBlock(i,d);n=i.splice(0,c),r.sigBytes-=f}return new u.init(n,f)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});o.Hasher=p.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new h.HMAC.init(e,n).finalize(t)}}});var h=a.algo={};return a}(Math);return e}()}(xP);var CP=xP.exports,MP=Ct(CP),NP={exports:{}};!function(e,t){e.exports=function(e){return function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.algo,s=[],u=[];!function(){function e(e){for(var n=t.sqrt(e),r=2;r<=n;r++)if(!(e%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(s[i]=n(t.pow(r,.5))),u[i]=n(t.pow(r,1/3)),i++),r++}();var c=[],f=o.SHA256=a.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],f=n[5],d=n[6],l=n[7],p=0;p<64;p++){if(p<16)c[p]=0|e[t+p];else{var h=c[p-15],b=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,m=c[p-2],y=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;c[p]=b+c[p-7]+y+c[p-16]}var g=r&i^r&a^i&a,v=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),w=l+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&f^~s&d)+u[p]+c[p];l=d,d=f,f=s,s=o+w|0,o=a,a=i,i=r,r=w+(v+g)|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+a|0,n[3]=n[3]+o|0,n[4]=n[4]+s|0,n[5]=n[5]+f|0,n[6]=n[6]+d|0,n[7]=n[7]+l|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=t.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});n.SHA256=a._createHelper(f),n.HmacSHA256=a._createHmacHelper(f)}(Math),e.SHA256}(CP)}(NP);var PP=Ct(NP.exports),BP={exports:{}};!function(e,t){e.exports=function(e){return function(){var t=e,n=t.lib.WordArray;function r(e,t,r){for(var i=[],a=0,o=0;o<t;o++)if(o%4){var s=r[e.charCodeAt(o-1)]<<o%4*2|r[e.charCodeAt(o)]>>>6-o%4*2;i[a>>>2]|=s<<24-a%4*8,a++}return n.create(i,a)}t.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var i=[],a=0;a<n;a+=3)for(var o=(t[a>>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.75*s<n;s++)i.push(r.charAt(o>>>6*(3-s)&63));var u=r.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(e){var t=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a<n.length;a++)i[n.charCodeAt(a)]=a}var o=n.charAt(64);if(o){var s=e.indexOf(o);-1!==s&&(t=s)}return r(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64}(CP)}(BP);var DP=Ct(BP.exports),FP={exports:{}};!function(e,t){e.exports=function(e){return e.enc.Utf8}(CP)}(FP);var LP=Ct(FP.exports);function UP(e){this.message=e}UP.prototype=new Error,UP.prototype.name="InvalidCharacterError";var jP="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new UP("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,i=0,a=0,o="";r=t.charAt(a++);~r&&(n=i%4?64*n+r:r,i++%4)?o+=String.fromCharCode(255&n>>(-2*i&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return o};function qP(e){this.message=e}function zP(e,t){if("string"!=typeof e)throw new qP("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(jP(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return jP(t)}}(e.split(".")[n]))}catch(e){throw new qP("Invalid token specified: "+e.message)}}qP.prototype=new Error,qP.prototype.name="InvalidTokenError";var HP,VP,GP,KP={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},WP=(e=>(e[e.NONE=0]="NONE",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG",e))(WP||{});(GP=WP||(WP={})).reset=function(){HP=3,VP=KP},GP.setLevel=function(e){if(!(0<=e&&e<=4))throw new Error("Invalid log level");HP=e},GP.setLogger=function(e){VP=e};var XP=class{constructor(e){this._name=e}debug(...e){HP>=4&&VP.debug(XP._format(this._name,this._method),...e)}info(...e){HP>=3&&VP.info(XP._format(this._name,this._method),...e)}warn(...e){HP>=2&&VP.warn(XP._format(this._name,this._method),...e)}error(...e){HP>=1&&VP.error(XP._format(this._name,this._method),...e)}throw(e){throw this.error(e),e}create(e){const t=Object.create(this);return t._method=e,t.debug("begin"),t}static createStatic(e,t){const n=new XP(`${e}.${t}`);return n.debug("begin"),n}static _format(e,t){const n=`[${e}]`;return t?`${n} ${t}:`:n}static debug(e,...t){HP>=4&&VP.debug(XP._format(e),...t)}static info(e,...t){HP>=3&&VP.info(XP._format(e),...t)}static warn(e,...t){HP>=2&&VP.warn(XP._format(e),...t)}static error(e,...t){HP>=1&&VP.error(XP._format(e),...t)}};WP.reset();var $P=class{static _randomWord(){return MP.lib.WordArray.random(1).words[0]}static generateUUIDv4(){const e="10000000-1000-4000-8000-100000000000".replace(/[018]/g,(e=>(+e^$P._randomWord()&15>>+e/4).toString(16)));return e.replace(/-/g,"")}static generateCodeVerifier(){return $P.generateUUIDv4()+$P.generateUUIDv4()+$P.generateUUIDv4()}static generateCodeChallenge(e){try{const t=PP(e);return DP.stringify(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(e){throw XP.error("CryptoUtils.generateCodeChallenge",e),e}}static generateBasicAuth(e,t){const n=LP.parse([e,t].join(":"));return DP.stringify(n)}},JP=class{constructor(e){this._name=e,this._logger=new XP(`Event('${this._name}')`),this._callbacks=[]}addHandler(e){return this._callbacks.push(e),()=>this.removeHandler(e)}removeHandler(e){const t=this._callbacks.lastIndexOf(e);t>=0&&this._callbacks.splice(t,1)}raise(...e){this._logger.debug("raise:",...e);for(const t of this._callbacks)t(...e)}},YP=class{static decode(e){try{return zP(e)}catch(e){throw XP.error("JwtUtils.decode",e),e}}},QP=class{static center({...e}){var t;return null==e.width&&(e.width=null!=(t=[800,720,600,480].find((e=>e<=window.outerWidth/1.618)))?t:360),null!=e.left||(e.left=Math.max(0,Math.round(window.screenX+(window.outerWidth-e.width)/2))),null!=e.height&&(null!=e.top||(e.top=Math.max(0,Math.round(window.screenY+(window.outerHeight-e.height)/2)))),e}static serialize(e){return Object.entries(e).filter((([,e])=>null!=e)).map((([e,t])=>`${e}=${"boolean"!=typeof t?t:t?"yes":"no"}`)).join(",")}},ZP=class extends JP{constructor(){super(...arguments),this._logger=new XP(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const e=this._expiration-ZP.getEpochTime();this._logger.debug("timer completes in",e),this._expiration<=ZP.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(e){const t=this._logger.create("init");e=Math.max(Math.floor(e),1);const n=ZP.getEpochTime()+e;if(this.expiration===n&&this._timerHandle)return void t.debug("skipping since already initialized for expiration at",this.expiration);this.cancel(),t.debug("using duration",e),this._expiration=n;const r=Math.min(e,5);this._timerHandle=setInterval(this._callback,1e3*r)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},eB=class{static readParams(e,t="query"){if(!e)throw new TypeError("Invalid URL");const n=new URL(e,"http://127.0.0.1")["fragment"===t?"hash":"search"];return new URLSearchParams(n.slice(1))}},tB=class extends Error{constructor(e,t){var n,r,i;if(super(e.error_description||e.error||""),this.form=t,this.name="ErrorResponse",!e.error)throw XP.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=e.error,this.error_description=null!=(n=e.error_description)?n:null,this.error_uri=null!=(r=e.error_uri)?r:null,this.state=e.userState,this.session_state=null!=(i=e.session_state)?i:null}},nB=class extends Error{constructor(e){super(e),this.name="ErrorTimeout"}},rB=class{constructor(e){this._logger=new XP("AccessTokenEvents"),this._expiringTimer=new ZP("Access token expiring"),this._expiredTimer=new ZP("Access token expired"),this._expiringNotificationTimeInSeconds=e.expiringNotificationTimeInSeconds}load(e){const t=this._logger.create("load");if(e.access_token&&void 0!==e.expires_in){const n=e.expires_in;if(t.debug("access token present, remaining duration:",n),n>0){let e=n-this._expiringNotificationTimeInSeconds;e<=0&&(e=1),t.debug("registering expiring timer, raising in",e,"seconds"),this._expiringTimer.init(e)}else t.debug("canceling existing expiring timer because we're past expiration."),this._expiringTimer.cancel();const r=n+1;t.debug("registering expired timer, raising in",r,"seconds"),this._expiredTimer.init(r)}else this._expiringTimer.cancel(),this._expiredTimer.cancel()}unload(){this._logger.debug("unload: canceling existing access token timers"),this._expiringTimer.cancel(),this._expiredTimer.cancel()}addAccessTokenExpiring(e){return this._expiringTimer.addHandler(e)}removeAccessTokenExpiring(e){this._expiringTimer.removeHandler(e)}addAccessTokenExpired(e){return this._expiredTimer.addHandler(e)}removeAccessTokenExpired(e){this._expiredTimer.removeHandler(e)}},iB=class{constructor(){this._logger=new XP("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(e){return this._logger.create(`getItem('${e}')`),this._data[e]}setItem(e,t){this._logger.create(`setItem('${e}')`),this._data[e]=t}removeItem(e){this._logger.create(`removeItem('${e}')`),delete this._data[e]}get length(){return Object.getOwnPropertyNames(this._data).length}key(e){return Object.getOwnPropertyNames(this._data)[e]}},aB=class{constructor(e=[],t=null,n={}){this._jwtHandler=t,this._extraHeaders=n,this._logger=new XP("JsonService"),this._contentTypes=[],this._contentTypes.push(...e,"application/json"),t&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(e,t={}){const{timeoutInSeconds:n,...r}=t;if(!n)return await fetch(e,r);const i=new AbortController,a=setTimeout((()=>i.abort()),1e3*n);try{return await fetch(e,{...t,signal:i.signal})}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)throw new nB("Network timed out");throw e}finally{clearTimeout(a)}}async getJson(e,{token:t,credentials:n}={}){const r=this._logger.create("getJson"),i={Accept:this._contentTypes.join(", ")};let a;t&&(r.debug("token passed, setting Authorization header"),i.Authorization="Bearer "+t),this.appendExtraHeaders(i);try{r.debug("url:",e),a=await this.fetchWithTimeout(e,{method:"GET",headers:i,credentials:n})}catch(e){throw r.error("Network Error"),e}r.debug("HTTP response received, status",a.status);const o=a.headers.get("Content-Type");if(o&&!this._contentTypes.find((e=>o.startsWith(e)))&&r.throw(new Error(`Invalid response Content-Type: ${null!=o?o:"undefined"}, from URL: ${e}`)),a.ok&&this._jwtHandler&&(null==o?void 0:o.startsWith("application/jwt")))return await this._jwtHandler(await a.text());let s;try{s=await a.json()}catch(e){if(r.error("Error parsing JSON response",e),a.ok)throw e;throw new Error(`${a.statusText} (${a.status})`)}if(!a.ok){if(r.error("Error from server:",s),s.error)throw new tB(s);throw new Error(`${a.statusText} (${a.status}): ${JSON.stringify(s)}`)}return s}async postForm(e,{body:t,basicAuth:n,timeoutInSeconds:r,initCredentials:i}){const a=this._logger.create("postForm"),o={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded"};let s;void 0!==n&&(o.Authorization="Basic "+n),this.appendExtraHeaders(o);try{a.debug("url:",e),s=await this.fetchWithTimeout(e,{method:"POST",headers:o,body:t,timeoutInSeconds:r,credentials:i})}catch(e){throw a.error("Network error"),e}a.debug("HTTP response received, status",s.status);const u=s.headers.get("Content-Type");if(u&&!this._contentTypes.find((e=>u.startsWith(e))))throw new Error(`Invalid response Content-Type: ${null!=u?u:"undefined"}, from URL: ${e}`);const c=await s.text();let f={};if(c)try{f=JSON.parse(c)}catch(e){if(a.error("Error parsing JSON response",e),s.ok)throw e;throw new Error(`${s.statusText} (${s.status})`)}if(!s.ok){if(a.error("Error from server:",f),f.error)throw new tB(f,t);throw new Error(`${s.statusText} (${s.status}): ${JSON.stringify(f)}`)}return f}appendExtraHeaders(e){const t=this._logger.create("appendExtraHeaders"),n=Object.keys(this._extraHeaders),r=["authorization","accept","content-type"];0!==n.length&&n.forEach((n=>{if(r.includes(n.toLocaleLowerCase()))return void t.warn("Protected header could not be overridden",n,r);const i="function"==typeof this._extraHeaders[n]?this._extraHeaders[n]():this._extraHeaders[n];i&&""!==i&&(e[n]=i)}))}},oB=class{constructor({prefix:e="oidc.",store:t=localStorage}={}){this._logger=new XP("WebStorageStateStore"),this._store=t,this._prefix=e}async set(e,t){this._logger.create(`set('${e}')`),e=this._prefix+e,await this._store.setItem(e,t)}async get(e){this._logger.create(`get('${e}')`),e=this._prefix+e;return await this._store.getItem(e)}async remove(e){this._logger.create(`remove('${e}')`),e=this._prefix+e;const t=await this._store.getItem(e);return await this._store.removeItem(e),t}async getAllKeys(){this._logger.create("getAllKeys");const e=await this._store.length,t=[];for(let n=0;n<e;n++){const e=await this._store.key(n);e&&0===e.indexOf(this._prefix)&&t.push(e.substr(this._prefix.length))}return t}},sB=class{constructor({authority:e,metadataUrl:t,metadata:n,signingKeys:r,metadataSeed:i,client_id:a,client_secret:o,response_type:s="code",scope:u="openid",redirect_uri:c,post_logout_redirect_uri:f,client_authentication:d="client_secret_post",prompt:l,display:p,max_age:h,ui_locales:b,acr_values:m,resource:y,response_mode:g="query",filterProtocolClaims:v=!0,loadUserInfo:w=!1,staleStateAgeInSeconds:_=900,clockSkewInSeconds:E=300,userInfoJwtIssuer:T="OP",mergeClaims:A=!1,disablePKCE:R=!1,stateStore:S,refreshTokenCredentials:k,revokeTokenAdditionalContentTypes:O,fetchRequestCredentials:I,refreshTokenAllowedScope:x,extraQueryParams:C={},extraTokenParams:M={},extraHeaders:N={}}){if(this.authority=e,t?this.metadataUrl=t:(this.metadataUrl=e,e&&(this.metadataUrl.endsWith("/")||(this.metadataUrl+="/"),this.metadataUrl+=".well-known/openid-configuration")),this.metadata=n,this.metadataSeed=i,this.signingKeys=r,this.client_id=a,this.client_secret=o,this.response_type=s,this.scope=u,this.redirect_uri=c,this.post_logout_redirect_uri=f,this.client_authentication=d,this.prompt=l,this.display=p,this.max_age=h,this.ui_locales=b,this.acr_values=m,this.resource=y,this.response_mode=g,this.filterProtocolClaims=null==v||v,this.loadUserInfo=!!w,this.staleStateAgeInSeconds=_,this.clockSkewInSeconds=E,this.userInfoJwtIssuer=T,this.mergeClaims=!!A,this.disablePKCE=!!R,this.revokeTokenAdditionalContentTypes=O,I&&k&&console.warn("Both fetchRequestCredentials and refreshTokenCredentials is set. Only fetchRequestCredentials will be used."),this.fetchRequestCredentials=I||(k||"same-origin"),S)this.stateStore=S;else{const e="undefined"!=typeof window?window.localStorage:new iB;this.stateStore=new oB({store:e})}this.refreshTokenAllowedScope=x,this.extraQueryParams=C,this.extraTokenParams=M,this.extraHeaders=N}},uB=class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new XP("TokenClient"),this._jsonService=new aB(this._settings.revokeTokenAdditionalContentTypes,null,this._settings.extraHeaders)}async exchangeCode({grant_type:e="authorization_code",redirect_uri:t=this._settings.redirect_uri,client_id:n=this._settings.client_id,client_secret:r=this._settings.client_secret,...i}){const a=this._logger.create("exchangeCode");n||a.throw(new Error("A client_id is required")),t||a.throw(new Error("A redirect_uri is required")),i.code||a.throw(new Error("A code is required"));const o=new URLSearchParams({grant_type:e,redirect_uri:t});for(const[e,t]of Object.entries(i))null!=t&&o.set(e,t);let s;switch(this._settings.client_authentication){case"client_secret_basic":if(!r)throw a.throw(new Error("A client_secret is required")),null;s=$P.generateBasicAuth(n,r);break;case"client_secret_post":o.append("client_id",n),r&&o.append("client_secret",r)}const u=await this._metadataService.getTokenEndpoint(!1);a.debug("got token endpoint");const c=await this._jsonService.postForm(u,{body:o,basicAuth:s,initCredentials:this._settings.fetchRequestCredentials});return a.debug("got response"),c}async exchangeCredentials({grant_type:e="password",client_id:t=this._settings.client_id,client_secret:n=this._settings.client_secret,scope:r=this._settings.scope,...i}){const a=this._logger.create("exchangeCredentials");t||a.throw(new Error("A client_id is required"));const o=new URLSearchParams({grant_type:e,scope:r});for(const[e,t]of Object.entries(i))null!=t&&o.set(e,t);let s;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw a.throw(new Error("A client_secret is required")),null;s=$P.generateBasicAuth(t,n);break;case"client_secret_post":o.append("client_id",t),n&&o.append("client_secret",n)}const u=await this._metadataService.getTokenEndpoint(!1);a.debug("got token endpoint");const c=await this._jsonService.postForm(u,{body:o,basicAuth:s,initCredentials:this._settings.fetchRequestCredentials});return a.debug("got response"),c}async exchangeRefreshToken({grant_type:e="refresh_token",client_id:t=this._settings.client_id,client_secret:n=this._settings.client_secret,timeoutInSeconds:r,...i}){const a=this._logger.create("exchangeRefreshToken");t||a.throw(new Error("A client_id is required")),i.refresh_token||a.throw(new Error("A refresh_token is required"));const o=new URLSearchParams({grant_type:e});for(const[e,t]of Object.entries(i))null!=t&&o.set(e,t);let s;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw a.throw(new Error("A client_secret is required")),null;s=$P.generateBasicAuth(t,n);break;case"client_secret_post":o.append("client_id",t),n&&o.append("client_secret",n)}const u=await this._metadataService.getTokenEndpoint(!1);a.debug("got token endpoint");const c=await this._jsonService.postForm(u,{body:o,basicAuth:s,timeoutInSeconds:r,initCredentials:this._settings.fetchRequestCredentials});return a.debug("got response"),c}async revoke(e){var t;const n=this._logger.create("revoke");e.token||n.throw(new Error("A token is required"));const r=await this._metadataService.getRevocationEndpoint(!1);n.debug(`got revocation endpoint, revoking ${null!=(t=e.token_type_hint)?t:"default token type"}`);const i=new URLSearchParams;for(const[t,n]of Object.entries(e))null!=n&&i.set(t,n);i.set("client_id",this._settings.client_id),this._settings.client_secret&&i.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(r,{body:i}),n.debug("got response")}},cB=class{constructor(e){this.id=e.id||$P.generateUUIDv4(),this.data=e.data,e.created&&e.created>0?this.created=e.created:this.created=ZP.getEpochTime(),this.request_type=e.request_type}toStorageString(){return new XP("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type})}static fromStorageString(e){return XP.createStatic("State","fromStorageString"),new cB(JSON.parse(e))}static async clearStaleState(e,t){const n=XP.createStatic("State","clearStaleState"),r=ZP.getEpochTime()-t,i=await e.getAllKeys();n.debug("got keys",i);for(let t=0;t<i.length;t++){const a=i[t],o=await e.get(a);let s=!1;if(o)try{const e=cB.fromStorageString(o);n.debug("got item from key:",a,e.created),e.created<=r&&(s=!0)}catch(e){n.error("Error parsing state for key:",a,e),s=!0}else n.debug("no item in storage for key:",a),s=!0;s&&(n.debug("removed item for key:",a),e.remove(a))}}},fB=class extends cB{constructor(e){super(e),!0===e.code_verifier?this.code_verifier=$P.generateCodeVerifier():e.code_verifier&&(this.code_verifier=e.code_verifier),this.code_verifier&&(this.code_challenge=$P.generateCodeChallenge(this.code_verifier)),this.authority=e.authority,this.client_id=e.client_id,this.redirect_uri=e.redirect_uri,this.scope=e.scope,this.client_secret=e.client_secret,this.extraTokenParams=e.extraTokenParams,this.response_mode=e.response_mode,this.skipUserInfo=e.skipUserInfo}toStorageString(){return new XP("SigninState").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,code_verifier:this.code_verifier,authority:this.authority,client_id:this.client_id,redirect_uri:this.redirect_uri,scope:this.scope,client_secret:this.client_secret,extraTokenParams:this.extraTokenParams,response_mode:this.response_mode,skipUserInfo:this.skipUserInfo})}static fromStorageString(e){XP.createStatic("SigninState","fromStorageString");const t=JSON.parse(e);return new fB(t)}},dB=class{constructor(e){this.access_token="",this.token_type="",this.profile={},this.state=e.get("state"),this.session_state=e.get("session_state"),this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri"),this.code=e.get("code")}get expires_in(){if(void 0!==this.expires_at)return this.expires_at-ZP.getEpochTime()}set expires_in(e){"string"==typeof e&&(e=Number(e)),void 0!==e&&e>=0&&(this.expires_at=Math.floor(e)+ZP.getEpochTime())}get isOpenId(){var e;return(null==(e=this.scope)?void 0:e.split(" ").includes("openid"))||!!this.id_token}},lB=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],pB=["sub","iss","aud","exp","iat"],hB=class{constructor(e){var t;this.id_token=e.id_token,this.session_state=null!=(t=e.session_state)?t:null,this.access_token=e.access_token,this.refresh_token=e.refresh_token,this.token_type=e.token_type,this.scope=e.scope,this.profile=e.profile,this.expires_at=e.expires_at,this.state=e.userState}get expires_in(){if(void 0!==this.expires_at)return this.expires_at-ZP.getEpochTime()}set expires_in(e){void 0!==e&&(this.expires_at=Math.floor(e)+ZP.getEpochTime())}get expired(){const e=this.expires_in;if(void 0!==e)return e<=0}get scopes(){var e,t;return null!=(t=null==(e=this.scope)?void 0:e.split(" "))?t:[]}toStorageString(){return new XP("User").create("toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})}static fromStorageString(e){return XP.createStatic("User","fromStorageString"),new hB(JSON.parse(e))}},bB="oidc-client",mB=class{constructor(){this._abort=new JP("Window navigation aborted"),this._disposeHandlers=new Set,this._window=null}async navigate(e){const t=this._logger.create("navigate");if(!this._window)throw new Error("Attempted to navigate on a disposed window");t.debug("setting URL in window"),this._window.location.replace(e.url);const{url:n,keepOpen:r}=await new Promise(((n,r)=>{const i=i=>{var a;const o=i.data,s=null!=(a=e.scriptOrigin)?a:window.location.origin;if(i.origin===s&&(null==o?void 0:o.source)===bB){try{const n=eB.readParams(o.url,e.response_mode).get("state");if(n||t.warn("no state found in response url"),i.source!==this._window&&n!==e.state)return}catch(e){this._dispose(),r(new Error("Invalid response from window"))}n(o)}};window.addEventListener("message",i,!1),this._disposeHandlers.add((()=>window.removeEventListener("message",i,!1))),this._disposeHandlers.add(this._abort.addHandler((e=>{this._dispose(),r(e)})))}));return t.debug("got response from window"),this._dispose(),r||this.close(),{url:n}}_dispose(){this._logger.create("_dispose");for(const e of this._disposeHandlers)e();this._disposeHandlers.clear()}static _notifyParent(e,t,n=!1,r=window.location.origin){e.postMessage({source:bB,url:t,keepOpen:n},r)}},yB={location:!1,toolbar:!1,height:640},gB="_blank",vB=60,wB=2,_B=10,EB=class extends sB{constructor(e){const{popup_redirect_uri:t=e.redirect_uri,popup_post_logout_redirect_uri:n=e.post_logout_redirect_uri,popupWindowFeatures:r=yB,popupWindowTarget:i=gB,redirectMethod:a="assign",redirectTarget:o="self",iframeNotifyParentOrigin:s=e.iframeNotifyParentOrigin,iframeScriptOrigin:u=e.iframeScriptOrigin,silent_redirect_uri:c=e.redirect_uri,silentRequestTimeoutInSeconds:f=_B,automaticSilentRenew:d=!0,validateSubOnSilentRenew:l=!0,includeIdTokenInSilentRenew:p=!1,monitorSession:h=!1,monitorAnonymousSession:b=!1,checkSessionIntervalInSeconds:m=wB,query_status_response_type:y="code",stopCheckSessionOnError:g=!0,revokeTokenTypes:v=["access_token","refresh_token"],revokeTokensOnSignout:w=!1,includeIdTokenInSilentSignout:_=!1,accessTokenExpiringNotificationTimeInSeconds:E=vB,userStore:T}=e;if(super(e),this.popup_redirect_uri=t,this.popup_post_logout_redirect_uri=n,this.popupWindowFeatures=r,this.popupWindowTarget=i,this.redirectMethod=a,this.redirectTarget=o,this.iframeNotifyParentOrigin=s,this.iframeScriptOrigin=u,this.silent_redirect_uri=c,this.silentRequestTimeoutInSeconds=f,this.automaticSilentRenew=d,this.validateSubOnSilentRenew=l,this.includeIdTokenInSilentRenew=p,this.monitorSession=h,this.monitorAnonymousSession=b,this.checkSessionIntervalInSeconds=m,this.stopCheckSessionOnError=g,this.query_status_response_type=y,this.revokeTokenTypes=v,this.revokeTokensOnSignout=w,this.includeIdTokenInSilentSignout=_,this.accessTokenExpiringNotificationTimeInSeconds=E,T)this.userStore=T;else{const e="undefined"!=typeof window?window.sessionStorage:new iB;this.userStore=new oB({store:e})}}},TB=class extends mB{constructor({silentRequestTimeoutInSeconds:e=_B}){super(),this._logger=new XP("IFrameWindow"),this._timeoutInSeconds=e,this._frame=TB.createHiddenIframe(),this._window=this._frame.contentWindow}static createHiddenIframe(){const e=window.document.createElement("iframe");return e.style.visibility="hidden",e.style.position="fixed",e.style.left="-1000px",e.style.top="0",e.width="0",e.height="0",e.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),window.document.body.appendChild(e),e}async navigate(e){this._logger.debug("navigate: Using timeout of:",this._timeoutInSeconds);const t=setTimeout((()=>this._abort.raise(new nB("IFrame timed out without a response"))),1e3*this._timeoutInSeconds);return this._disposeHandlers.add((()=>clearTimeout(t))),await super.navigate(e)}close(){var e;this._frame&&(this._frame.parentNode&&(this._frame.addEventListener("load",(e=>{var t;const n=e.target;null==(t=n.parentNode)||t.removeChild(n),this._abort.raise(new Error("IFrame removed from DOM"))}),!0),null==(e=this._frame.contentWindow)||e.location.replace("about:blank")),this._frame=null),this._window=null}static notifyParent(e,t){return super._notifyParent(window.parent,e,!1,t)}},AB=class extends mB{constructor({popupWindowTarget:e=gB,popupWindowFeatures:t={}}){super(),this._logger=new XP("PopupWindow");const n=QP.center({...yB,...t});this._window=window.open(void 0,e,QP.serialize(n))}async navigate(e){var t;null==(t=this._window)||t.focus();const n=setInterval((()=>{this._window&&!this._window.closed||this._abort.raise(new Error("Popup closed by user"))}),500);return this._disposeHandlers.add((()=>clearInterval(n))),await super.navigate(e)}close(){this._window&&(this._window.closed||(this._window.close(),this._abort.raise(new Error("Popup closed")))),this._window=null}static notifyOpener(e,t){if(!window.opener)throw new Error("No window.opener. Can't complete notification.");return super._notifyParent(window.opener,e,t)}},RB=class extends rB{constructor(e){super({expiringNotificationTimeInSeconds:e.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new XP("UserManagerEvents"),this._userLoaded=new JP("User loaded"),this._userUnloaded=new JP("User unloaded"),this._silentRenewError=new JP("Silent renew error"),this._userSignedIn=new JP("User signed in"),this._userSignedOut=new JP("User signed out"),this._userSessionChanged=new JP("User session changed")}load(e,t=!0){super.load(e),t&&this._userLoaded.raise(e)}unload(){super.unload(),this._userUnloaded.raise()}addUserLoaded(e){return this._userLoaded.addHandler(e)}removeUserLoaded(e){return this._userLoaded.removeHandler(e)}addUserUnloaded(e){return this._userUnloaded.addHandler(e)}removeUserUnloaded(e){return this._userUnloaded.removeHandler(e)}addSilentRenewError(e){return this._silentRenewError.addHandler(e)}removeSilentRenewError(e){return this._silentRenewError.removeHandler(e)}_raiseSilentRenewError(e){this._silentRenewError.raise(e)}addUserSignedIn(e){return this._userSignedIn.addHandler(e)}removeUserSignedIn(e){this._userSignedIn.removeHandler(e)}_raiseUserSignedIn(){this._userSignedIn.raise()}addUserSignedOut(e){return this._userSignedOut.addHandler(e)}removeUserSignedOut(e){this._userSignedOut.removeHandler(e)}_raiseUserSignedOut(){this._userSignedOut.raise()}addUserSessionChanged(e){return this._userSessionChanged.addHandler(e)}removeUserSessionChanged(e){this._userSessionChanged.removeHandler(e)}_raiseUserSessionChanged(){this._userSessionChanged.raise()}},SB=(e=>(e.MissingApiKey="MISSING_API_KEY",e.ModalNotReady="MODAL_NOT_READY",e.MalformedResponse="MALFORMED_RESPONSE",e.InvalidArgument="INVALID_ARGUMENT",e.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",e.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",e))(SB||{}),kB=(e=>(e.SyncWeb3Method="SYNC_WEB3_METHOD",e.DuplicateIframe="DUPLICATE_IFRAME",e.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",e.DeprecationNotice="DEPRECATION_NOTICE",e))(kB||{}),OB=(e=>(e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",e[e.MagicLinkExpired=-10001]="MagicLinkExpired",e[e.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",e[e.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",e[e.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",e[e.UpdateEmailFailed=-10004]="UpdateEmailFailed",e[e.UserRequestEditEmail=-10005]="UserRequestEditEmail",e[e.InactiveRecipient=-10010]="InactiveRecipient",e[e.AccessDeniedToUser=-10011]="AccessDeniedToUser",e))(OB||{}),IB=(e=>(e.LoginWithSms="magic_auth_login_with_sms",e.LoginWithEmailOTP="magic_auth_login_with_email_otp",e.LoginWithMagicLink="magic_auth_login_with_magic_link",e.LoginWithCredential="magic_auth_login_with_credential",e.GetIdToken="magic_auth_get_id_token",e.GenerateIdToken="magic_auth_generate_id_token",e.GetMetadata="magic_auth_get_metadata",e.IsLoggedIn="magic_auth_is_logged_in",e.Logout="magic_auth_logout",e.UpdateEmail="magic_auth_update_email",e.UserSettings="magic_auth_settings",e.UserSettingsTestMode="magic_auth_settings_testing_mode",e.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",e.LoginWithEmailOTPTestMode="magic_auth_login_with_email_otp_testing_mode",e.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",e.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",e.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",e.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",e.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",e.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",e.LogoutTestMode="magic_auth_logout_testing_mode",e.UpdateEmailTestMode="magic_auth_update_email_testing_mode",e.IntermediaryEvent="magic_intermediary_event",e.RequestAccounts="eth_requestAccounts",e.GetInfo="mc_get_wallet_info",e.ShowUI="mc_wallet",e.NFTPurchase="magic_nft_purchase",e.RequestUserInfoWithUI="mc_request_user_info",e.Disconnect="mc_disconnect",e.UpdatePhoneNumber="magic_auth_update_phone_number",e.UpdatePhoneNumberTestMode="magic_auth_update_phone_number_testing_mode",e.RecoverAccount="magic_auth_recover_account",e.RecoverAccountTestMode="magic_auth_recover_account_testing_mode",e))(IB||{}),xB=(e=>(e.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",e.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",e.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",e.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",e.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",e))(xB||{}),CB=(e=>(e.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",e))(CB||{}),MB=(e=>(e.Harmony="HARMONY",e))(MB||{}),NB=Object.create,PB=Object.defineProperty,BB=Object.defineProperties,DB=Object.getOwnPropertyDescriptor,FB=Object.getOwnPropertyDescriptors,LB=Object.getOwnPropertyNames,UB=Object.getOwnPropertySymbols,jB=Object.getPrototypeOf,qB=Object.prototype.hasOwnProperty,zB=Object.prototype.propertyIsEnumerable,HB=(e,t,n)=>t in e?PB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,VB=(e,t)=>{for(var n in t||(t={}))qB.call(t,n)&&HB(e,n,t[n]);if(UB)for(var n of UB(t))zB.call(t,n)&&HB(e,n,t[n]);return e},GB=(e,t,n)=>new Promise(((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())})),KB=((e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports))(((e,t)=>{var n=Object.prototype.hasOwnProperty,r="~";function i(){}function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new a(n,i||e,o),u=r?r+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function u(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),u.prototype.eventNames=function(){var e,t,i=[];if(0===this._eventsCount)return i;for(t in e=this._events)n.call(e,t)&&i.push(r?t.slice(1):t);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},u.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=new Array(a);i<a;i++)o[i]=n[i].fn;return o},u.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},u.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var u,c,f=this._events[s],d=arguments.length;if(f.fn){switch(f.once&&this.removeListener(e,f.fn,void 0,!0),d){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,t),!0;case 3:return f.fn.call(f.context,t,n),!0;case 4:return f.fn.call(f.context,t,n,i),!0;case 5:return f.fn.call(f.context,t,n,i,a),!0;case 6:return f.fn.call(f.context,t,n,i,a,o),!0}for(c=1,u=new Array(d-1);c<d;c++)u[c-1]=arguments[c];f.fn.apply(f.context,u)}else{var l,p=f.length;for(c=0;c<p;c++)switch(f[c].once&&this.removeListener(e,f[c].fn,void 0,!0),d){case 1:f[c].fn.call(f[c].context);break;case 2:f[c].fn.call(f[c].context,t);break;case 3:f[c].fn.call(f[c].context,t,n);break;case 4:f[c].fn.call(f[c].context,t,n,i);break;default:if(!u)for(l=1,u=new Array(d-1);l<d;l++)u[l-1]=arguments[l];f[c].fn.apply(f[c].context,u)}}return!0},u.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},u.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},u.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var u=0,c=[],f=o.length;u<f;u++)(o[u].fn!==t||i&&!o[u].once||n&&o[u].context!==n)&&c.push(o[u]);c.length?this._events[a]=1===c.length?c[0]:c:s(this,a)}return this},u.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=r,u.EventEmitter=u,typeof t<"u"&&(t.exports=u)}));var WB={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH:16},XB="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{},$B=XB,JB=function(e){let t={exports:{}};return e(t,t.exports),t.exports}((function(e,t){let{MAX_SAFE_COMPONENT_LENGTH:n}=WB,r=(t=e.exports={}).re=[],i=t.src=[],a=t.t={},o=0,s=(e,t,n)=>{let s=o++;$B(s,t),a[e]=s,i[s]=t,r[s]=new RegExp(t,n?"g":void 0)};s("NUMERICIDENTIFIER","0|[1-9]\\d*"),s("NUMERICIDENTIFIERLOOSE","[0-9]+"),s("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),s("MAINVERSION",`(${i[a.NUMERICIDENTIFIER]})\\.(${i[a.NUMERICIDENTIFIER]})\\.(${i[a.NUMERICIDENTIFIER]})`),s("MAINVERSIONLOOSE",`(${i[a.NUMERICIDENTIFIERLOOSE]})\\.(${i[a.NUMERICIDENTIFIERLOOSE]})\\.(${i[a.NUMERICIDENTIFIERLOOSE]})`),s("PRERELEASEIDENTIFIER",`(?:${i[a.NUMERICIDENTIFIER]}|${i[a.NONNUMERICIDENTIFIER]})`),s("PRERELEASEIDENTIFIERLOOSE",`(?:${i[a.NUMERICIDENTIFIERLOOSE]}|${i[a.NONNUMERICIDENTIFIER]})`),s("PRERELEASE",`(?:-(${i[a.PRERELEASEIDENTIFIER]}(?:\\.${i[a.PRERELEASEIDENTIFIER]})*))`),s("PRERELEASELOOSE",`(?:-?(${i[a.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${i[a.PRERELEASEIDENTIFIERLOOSE]})*))`),s("BUILDIDENTIFIER","[0-9A-Za-z-]+"),s("BUILD",`(?:\\+(${i[a.BUILDIDENTIFIER]}(?:\\.${i[a.BUILDIDENTIFIER]})*))`),s("FULLPLAIN",`v?${i[a.MAINVERSION]}${i[a.PRERELEASE]}?${i[a.BUILD]}?`),s("FULL",`^${i[a.FULLPLAIN]}$`),s("LOOSEPLAIN",`[v=\\s]*${i[a.MAINVERSIONLOOSE]}${i[a.PRERELEASELOOSE]}?${i[a.BUILD]}?`),s("LOOSE",`^${i[a.LOOSEPLAIN]}$`),s("GTLT","((?:<|>)?=?)"),s("XRANGEIDENTIFIERLOOSE",`${i[a.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),s("XRANGEIDENTIFIER",`${i[a.NUMERICIDENTIFIER]}|x|X|\\*`),s("XRANGEPLAIN",`[v=\\s]*(${i[a.XRANGEIDENTIFIER]})(?:\\.(${i[a.XRANGEIDENTIFIER]})(?:\\.(${i[a.XRANGEIDENTIFIER]})(?:${i[a.PRERELEASE]})?${i[a.BUILD]}?)?)?`),s("XRANGEPLAINLOOSE",`[v=\\s]*(${i[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[a.XRANGEIDENTIFIERLOOSE]})(?:${i[a.PRERELEASELOOSE]})?${i[a.BUILD]}?)?)?`),s("XRANGE",`^${i[a.GTLT]}\\s*${i[a.XRANGEPLAIN]}$`),s("XRANGELOOSE",`^${i[a.GTLT]}\\s*${i[a.XRANGEPLAINLOOSE]}$`),s("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),s("COERCERTL",i[a.COERCE],!0),s("LONETILDE","(?:~>?)"),s("TILDETRIM",`(\\s*)${i[a.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",s("TILDE",`^${i[a.LONETILDE]}${i[a.XRANGEPLAIN]}$`),s("TILDELOOSE",`^${i[a.LONETILDE]}${i[a.XRANGEPLAINLOOSE]}$`),s("LONECARET","(?:\\^)"),s("CARETTRIM",`(\\s*)${i[a.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",s("CARET",`^${i[a.LONECARET]}${i[a.XRANGEPLAIN]}$`),s("CARETLOOSE",`^${i[a.LONECARET]}${i[a.XRANGEPLAINLOOSE]}$`),s("COMPARATORLOOSE",`^${i[a.GTLT]}\\s*(${i[a.LOOSEPLAIN]})$|^$`),s("COMPARATOR",`^${i[a.GTLT]}\\s*(${i[a.FULLPLAIN]})$|^$`),s("COMPARATORTRIM",`(\\s*)${i[a.GTLT]}\\s*(${i[a.LOOSEPLAIN]}|${i[a.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",s("HYPHENRANGE",`^\\s*(${i[a.XRANGEPLAIN]})\\s+-\\s+(${i[a.XRANGEPLAIN]})\\s*$`),s("HYPHENRANGELOOSE",`^\\s*(${i[a.XRANGEPLAINLOOSE]})\\s+-\\s+(${i[a.XRANGEPLAINLOOSE]})\\s*$`),s("STAR","(<|>)?=?\\s*\\*"),s("GTE0","^\\s*>=\\s*0.0.0\\s*$"),s("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")})),YB=/^[0-9]+$/,QB=(e,t)=>{let n=YB.test(e),r=YB.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1},ZB={compareIdentifiers:QB,rcompareIdentifiers:(e,t)=>QB(t,e)},{MAX_LENGTH:eD,MAX_SAFE_INTEGER:tD}=WB,{re:nD,t:rD}=JB,{compareIdentifiers:iD}=ZB,aD=class{constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof aD){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid Version: ${e}`);if(e.length>eD)throw new TypeError(`version is longer than ${eD} characters`);$B("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let n=e.trim().match(t.loose?nD[rD.LOOSE]:nD[rD.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>tD||this.major<0)throw new TypeError("Invalid major version");if(this.minor>tD||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>tD||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<tD)return t}return e})):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if($B("SemVer.compare",this.version,this.options,e),!(e instanceof aD)){if("string"==typeof e&&e===this.version)return 0;e=new aD(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof aD||(e=new aD(e,this.options)),iD(this.major,e.major)||iD(this.minor,e.minor)||iD(this.patch,e.patch)}comparePre(e){if(e instanceof aD||(e=new aD(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let n=this.prerelease[t],r=e.prerelease[t];if($B("prerelease compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return iD(n,r)}while(++t)}compareBuild(e){e instanceof aD||(e=new aD(e,this.options));let t=0;do{let n=this.build[t],r=e.build[t];if($B("prerelease compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return iD(n,r)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{let e=this.prerelease.length;for(;--e>=0;)"number"==typeof this.prerelease[e]&&(this.prerelease[e]++,e=-2);-1===e&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}},oD=(e,t,n)=>new aD(e,n).compare(new aD(t,n)),sD=(e,t,n)=>0===oD(e,t,n),uD=(e,t,n)=>0!==oD(e,t,n),cD=(e,t,n)=>oD(e,t,n)>0,fD=(e,t,n)=>oD(e,t,n)>=0,dD=(e,t,n)=>oD(e,t,n)<0,lD=(e,t,n)=>oD(e,t,n)<=0,pD=(e,t,n,r)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return sD(e,n,r);case"!=":return uD(e,n,r);case">":return cD(e,n,r);case">=":return fD(e,n,r);case"<":return dD(e,n,r);case"<=":return lD(e,n,r);default:throw new TypeError(`Invalid operator: ${t}`)}},hD=Symbol("SemVer ANY"),bD=class{static get ANY(){return hD}constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof bD){if(e.loose===!!t.loose)return e;e=e.value}$B("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===hD?this.value="":this.value=this.operator+this.semver.version,$B("comp",this)}parse(e){let t=this.options.loose?mD[yD.COMPARATORLOOSE]:mD[yD.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new aD(n[2],this.options.loose):this.semver=hD}toString(){return this.value}test(e){if($B("Comparator.test",e,this.options.loose),this.semver===hD||e===hD)return!0;if("string"==typeof e)try{e=new aD(e,this.options)}catch(e){return!1}return pD(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof bD))throw new TypeError("a Comparator is required");if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||new gD(e.value,t).test(this.value);if(""===e.operator)return""===e.value||new gD(this.value,t).test(e.semver);let n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),r=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),o=pD(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),s=pD(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||r||i&&a||o||s}},{re:mD,t:yD}=JB,gD=class{constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof gD)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new gD(e.raw,t);if(e instanceof bD)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){let{loose:t}=this.options;e=e.trim();let n=t?vD[wD.HYPHENRANGELOOSE]:vD[wD.HYPHENRANGE];e=e.replace(n,BD(this.options.includePrerelease)),$B("hyphen replace",e),e=e.replace(vD[wD.COMPARATORTRIM],_D),$B("comparator trim",e,vD[wD.COMPARATORTRIM]),e=(e=(e=e.replace(vD[wD.TILDETRIM],ED)).replace(vD[wD.CARETTRIM],TD)).split(/\s+/).join(" ");let r=t?vD[wD.COMPARATORLOOSE]:vD[wD.COMPARATOR];return e.split(" ").map((e=>RD(e,this.options))).join(" ").split(/\s+/).map((e=>PD(e,this.options))).filter(this.options.loose?e=>!!e.match(r):()=>!0).map((e=>new bD(e,this.options)))}intersects(e,t){if(!(e instanceof gD))throw new TypeError("a Range is required");return this.set.some((n=>AD(n,t)&&e.set.some((e=>AD(e,t)&&n.every((n=>e.every((e=>n.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new aD(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(DD(this.set[t],e,this.options))return!0;return!1}},{re:vD,t:wD,comparatorTrimReplace:_D,tildeTrimReplace:ED,caretTrimReplace:TD}=JB,AD=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every((e=>i.intersects(e,t))),i=r.pop();return n},RD=(e,t)=>($B("comp",e,t),e=ID(e,t),$B("caret",e),e=kD(e,t),$B("tildes",e),e=CD(e,t),$B("xrange",e),e=ND(e,t),$B("stars",e),e),SD=e=>!e||"x"===e.toLowerCase()||"*"===e,kD=(e,t)=>e.trim().split(/\s+/).map((e=>OD(e,t))).join(" "),OD=(e,t)=>{let n=t.loose?vD[wD.TILDELOOSE]:vD[wD.TILDE];return e.replace(n,((t,n,r,i,a)=>{let o;return $B("tilde",e,t,n,r,i,a),SD(n)?o="":SD(r)?o=`>=${n}.0.0 <${+n+1}.0.0-0`:SD(i)?o=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?($B("replaceTilde pr",a),o=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):o=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,$B("tilde return",o),o}))},ID=(e,t)=>e.trim().split(/\s+/).map((e=>xD(e,t))).join(" "),xD=(e,t)=>{$B("caret",e,t);let n=t.loose?vD[wD.CARETLOOSE]:vD[wD.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,((t,n,i,a,o)=>{let s;return $B("caret",e,t,n,i,a,o),SD(n)?s="":SD(i)?s=`>=${n}.0.0${r} <${+n+1}.0.0-0`:SD(a)?s="0"===n?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:o?($B("replaceCaret pr",o),s="0"===n?"0"===i?`>=${n}.${i}.${a}-${o} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${o} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${o} <${+n+1}.0.0-0`):($B("no pr"),s="0"===n?"0"===i?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),$B("caret return",s),s}))},CD=(e,t)=>($B("replaceXRanges",e,t),e.split(/\s+/).map((e=>MD(e,t))).join(" ")),MD=(e,t)=>{e=e.trim();let n=t.loose?vD[wD.XRANGELOOSE]:vD[wD.XRANGE];return e.replace(n,((n,r,i,a,o,s)=>{$B("xRange",e,n,r,i,a,o,s);let u=SD(i),c=u||SD(a),f=c||SD(o),d=f;return"="===r&&d&&(r=""),s=t.includePrerelease?"-0":"",u?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(c&&(a=0),o=0,">"===r?(r=">=",c?(i=+i+1,a=0,o=0):(a=+a+1,o=0)):"<="===r&&(r="<",c?i=+i+1:a=+a+1),"<"===r&&(s="-0"),n=`${r+i}.${a}.${o}${s}`):c?n=`>=${i}.0.0${s} <${+i+1}.0.0-0`:f&&(n=`>=${i}.${a}.0${s} <${i}.${+a+1}.0-0`),$B("xRange return",n),n}))},ND=(e,t)=>($B("replaceStars",e,t),e.trim().replace(vD[wD.STAR],"")),PD=(e,t)=>($B("replaceGTE0",e,t),e.trim().replace(vD[t.includePrerelease?wD.GTE0PRE:wD.GTE0],"")),BD=e=>(t,n,r,i,a,o,s,u,c,f,d,l,p)=>`${n=SD(r)?"":SD(i)?`>=${r}.0.0${e?"-0":""}`:SD(a)?`>=${r}.${i}.0${e?"-0":""}`:o?`>=${n}`:`>=${n}${e?"-0":""}`} ${u=SD(c)?"":SD(f)?`<${+c+1}.0.0-0`:SD(d)?`<${c}.${+f+1}.0-0`:l?`<=${c}.${f}.${d}-${l}`:e?`<${c}.${f}.${+d+1}-0`:`<=${u}`}`.trim(),DD=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if($B(e[n].semver),e[n].semver!==bD.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0},FD=(e,t,n)=>{try{t=new gD(t,n)}catch(e){return!1}return t.test(e)},{MAX_LENGTH:LD}=WB,{re:UD,t:jD}=JB,qD=(e,t)=>{if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof aD)return e;if("string"!=typeof e||e.length>LD||!(t.loose?UD[jD.LOOSE]:UD[jD.FULL]).test(e))return null;try{return new aD(e,t)}catch(e){return null}},{re:zD,t:HD}=JB,VD=(e,t)=>{if(e instanceof aD)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){let t;for(;(t=zD[HD.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&t.index+t[0].length===n.index+n[0].length||(n=t),zD[HD.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;zD[HD.COERCERTL].lastIndex=-1}else n=e.match(zD[HD.COERCE]);return null===n?null:qD(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)};function GD(e){return String.fromCharCode(parseInt(e.slice(1),16))}function KD(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}function WD(e){return function(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,GD))}(JSON.stringify(e))}function XD(e){return JSON.parse(function(e){return decodeURIComponent(Array.from(atob(e),KD).join(""))}(e))}function $D(e){return void 0===e}function JD(e){return function(e){return null===e}(e)||$D(e)}function YD(e){if(!e)return!0;for(let t in e)if(Object.hasOwnProperty.call(e,t))return!1;return!0}var QD={};var ZD={"magic-sdk":"magic-sdk","@magic-sdk/react-native":"magic-sdk-rn","@magic-sdk/react-native-bare":"magic-sdk-rn-bare","@magic-sdk/react-native-expo":"magic-sdk-rn-expo"},eF=class extends Error{constructor(e,t){super(`Magic SDK Error: [${e}] ${t}`),this.code=e,this.rawMessage=t,this.__proto__=Error,Object.setPrototypeOf(this,eF.prototype)}},tF=class extends Error{constructor(e){super(),this.__proto__=Error;let t=Number(null==e?void 0:e.code);this.rawMessage=(null==e?void 0:e.message)||"Internal error",this.code=function(e){return!JD(e)&&"number"==typeof e&&Object.values(OB).includes(e)}(t)?t:OB.InternalError,this.message=`Magic RPC Error: [${this.code}] ${this.rawMessage}`,this.data=(null==e?void 0:e.data)||void 0,Object.setPrototypeOf(this,tF.prototype)}},nF=class{constructor(e,t){this.code=e,this.rawMessage=t,this.message=`Magic SDK Warning: [${e}] ${t}`}log(){console.warn(this.message)}},rF=class extends Error{constructor(e,t,n,r){super(`Magic Extension Error (${e.name}): [${t}] ${n}`),this.code=t,this.rawMessage=n,this.data=r,this.__proto__=Error,Object.setPrototypeOf(this,rF.prototype)}},iF=class{constructor(e,t,n){this.code=t,this.rawMessage=n,this.message=`Magic Extension Warning (${e.name}): [${t}] ${n}`}log(){console.warn(this.message)}};function aF(){return new eF(SB.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.")}function oF(){return new eF(SB.MalformedResponse,"Response from the Magic iframe is malformed.")}function sF(e){return new eF(SB.ExtensionNotInitialized,`Extensions must be initialized with a Magic SDK instance before \`Extension.${e}\` can be accessed. Do not invoke \`Extension.${e}\` inside an extension constructor.`)}function uF(e){let t=`Some extensions are incompatible with \`${QD.sdkName}@${QD.version}\`:`;return e.filter((e=>void 0!==e.compat&&null!==e.compat)).forEach((e=>{let n=e.compat[QD.sdkName];"string"==typeof n?t+=`\n - Extension \`${e.name}\` supports version(s) \`${n}\``:n||(t+=`\n - Extension \`${e.name}\` does not support ${QD.platform} environments.`)})),new eF(SB.IncompatibleExtensions,t)}function cF(e){return new eF(SB.InvalidArgument,`Invalid ${(e=>{let t=e+1,n=t%10,r=t%100;return 1===n&&11!==r?`${t}st`:2===n&&12!==r?`${t}nd`:3===n&&13!==r?`${t}rd`:`${t}th`})(e.argument)} argument given to \`${e.procedure}\`.\n Expected: \`${e.expected}\`\n Received: \`${e.received}\``)}function fF(){return new nF(kB.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 \`${QD.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`)}var dF=function*(){let e=0;for(;;)e<Number.MAX_SAFE_INTEGER?yield++e:e=0}();function lF(){return dF.next().value}var pF=Symbol("Payload pre-processed by Magic SDK");function hF(e){return Object.defineProperty(e,pF,{value:!0,enumerable:!1}),e}function bF(e){var t,n,r;return function(e){return!!e[pF]}(e)||(e.jsonrpc=null!=(t=e.jsonrpc)?t:"2.0",e.id=lF(),e.method=null!=(n=e.method)?n:"noop",e.params=null!=(r=e.params)?r:[],hF(e)),e}function mF(e,t=[]){return hF({params:t,method:e,jsonrpc:"2.0",id:lF()})}var yF=class{constructor(e){e instanceof yF?(this._jsonrpc=e.payload.jsonrpc,this._id=e.payload.id,this._result=e.payload.result,this._error=e.payload.error):function(e){return!JD(e)&&!($D(e.jsonrpc)||$D(e.id)||$D(e.result)&&$D(e.error))}(e)?(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=e.result,this._error=e.error):(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=void 0,this._error=void 0)}applyError(e){return this._error=e,this}applyResult(e){return this._result=e,this}get hasError(){return void 0!==this._error&&null!==this._error}get hasResult(){return void 0!==this._result}get payload(){return{jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}},gF=((e,t,n)=>(n=null!=e?NB(jB(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of LB(t))!qB.call(e,i)&&i!==n&&PB(e,i,{get:()=>t[i],enumerable:!(r=DB(t,i))||r.enumerable});return e})(!t&&e&&e.__esModule?n:PB(n,"default",{value:e,enumerable:!0}),e)))(KB()),vF=class extends gF.default{};function wF(){let e=new vF;return{emitter:e,createChainingEmitterMethod:(t,n)=>(...r)=>(e[t].apply(e,r),n),createBoundEmitterMethod:t=>(...n)=>e[t].apply(e,n)}}var _F=Symbol("isPromiEvent");function EF(e){return!!e[_F]}function TF(e){let t=AF(e),{createBoundEmitterMethod:n,createChainingEmitterMethod:r}=wF(),i=Symbol("Promise.then"),a=Symbol("Promise.catch"),o=Symbol("Promise.finally"),s=(e,t)=>(...n)=>{let r=t[e].apply(t,n);return u(r)},u=e=>Object.assign(e,{[_F]:!0,[i]:e[i]||e.then,[a]:e[a]||e.catch,[o]:e[o]||e.finally,then:s(i,e),catch:s(a,e),finally:s(o,e),on:r("on",e),once:r("once",e),addListener:r("addListener",e),off:r("off",e),removeListener:r("removeListener",e),removeAllListeners:r("removeAllListeners",e),emit:n("emit"),eventNames:n("eventNames"),listeners:n("listeners"),listenerCount:n("listenerCount")}),c=u(t.then((e=>(c.emit("done",e),c.emit("settled"),e)),(e=>{throw c.emit("error",e),c.emit("settled"),e})));return c}function AF(e){return new Promise(((t,n)=>{let r=e(t,n);Promise.resolve(r).catch(n)}))}var RF,SF=class{constructor(e){this.sdk=e}get overlay(){return this.sdk.overlay}request(e){let t=this.overlay.post(CB.MAGIC_HANDLE_REQUEST,bF(e)),n=TF(((e,n)=>{t.then((t=>{if(r(),t.hasError)n(new tF(t.payload.error));else{if(!t.hasResult)throw oF();e(t.payload.result)}})).catch((e=>{r(),n(e)}))})),r=this.overlay.on(xB.MAGIC_HANDLE_EVENT,(t=>{var r;let{response:i}=t.data;if(i.id===e.id&&(null==(r=i.result)?void 0:r.event)){let{event:e,params:t=[]}=i.result;n.emit(e,...t)}}));return n}createIntermediaryEvent(e,t){return n=>{let r=mF(IB.IntermediaryEvent,[{payloadId:t,eventType:e,args:n}]);this.request(r)}}},kF=class extends SF{loginWithMagicLink(e){let{email:t,showUI:n=!0,redirectURI:r}=e,i=mF(this.sdk.testMode?IB.LoginWithMagicLinkTestMode:IB.LoginWithMagicLink,[{email:t,showUI:n,redirectURI:r}]);return this.request(i)}loginWithSMS(e){let{phoneNumber:t}=e,n=mF(this.sdk.testMode?IB.LoginWithSmsTestMode:IB.LoginWithSms,[{phoneNumber:t,showUI:!0}]);return this.request(n)}loginWithEmailOTP(e){let{email:t,showUI:n}=e,r=mF(this.sdk.testMode?IB.LoginWithEmailOTPTestMode:IB.LoginWithEmailOTP,[{email:t,showUI:n}]);if(!n){let e=this.request(r);return e&&e.on("otp-input-sent",(e=>{this.createIntermediaryEvent("verify-email-otp",r.id)(e)})),e}return this.request(r)}loginWithCredential(e){let t=null!=e?e:"";if(!e&&"web"===QD.platform){t=window.location.search;let e=window.location.origin+window.location.pathname;window.history.replaceState(null,"",e)}let n=mF(this.sdk.testMode?IB.LoginWithCredentialTestMode:IB.LoginWithCredential,[t]);return this.request(n)}},OF={};function IF(e){return(...t)=>GB(this,null,(function*(){return RF||(RF=yield QD.configureStorage()),yield RF.ready(),RF[e](...t)}))}((e,t)=>{for(var n in t)PB(e,n,{get:t[n],enumerable:!0})})(OF,{clear:()=>NF,getItem:()=>xF,iterate:()=>FF,key:()=>BF,keys:()=>DF,length:()=>PF,removeItem:()=>MF,setItem:()=>CF});var xF=IF("getItem"),CF=IF("setItem"),MF=IF("removeItem"),NF=IF("clear"),PF=IF("length"),BF=IF("key"),DF=IF("keys"),FF=IF("iterate");function LF(){let e=window.crypto.getRandomValues(new Uint8Array(16));e[6]=15&e[6]|64,e[8]=191&e[8]|128;let t="";return t+=e[0].toString(16),t+=e[1].toString(16),t+=e[2].toString(16),t+=e[3].toString(16),t+="-",t+=e[4].toString(16),t+=e[5].toString(16),t+="-",t+=e[6].toString(16),t+=e[7].toString(16),t+="-",t+=e[8].toString(16),t+=e[9].toString(16),t+="-",t+=e[10].toString(16),t+=e[11].toString(16),t+=e[12].toString(16),t+=e[13].toString(16),t+=e[14].toString(16),t+=e[15].toString(16),t}var UF="STORE_KEY_PRIVATE_KEY",jF="STORE_KEY_PUBLIC_JWK",qF="ECDSA",zF="P-256",HF={name:qF,namedCurve:zF},VF={name:qF,namedCurve:zF};function GF(){MF(jF),MF(UF)}function KF(){return GB(this,null,(function*(){let e=yield function(){return GB(this,null,(function*(){if(function(){let e="undefined"!=typeof window&&!!window.crypto,t=e&&!!window.crypto.subtle;return e&&t}())return(yield xF(jF))||(yield function(){return GB(this,null,(function*(){let e=null,{subtle:t}=window.crypto,n=yield t.generateKey(HF,!0,["sign"]),r=yield t.exportKey("jwk",n.privateKey);e=yield t.exportKey("jwk",n.publicKey);let i=yield t.importKey("jwk",r,VF,!1,["sign"]);yield CF(UF,i),yield CF(jF,e)}))}()),xF(jF);console.info("webcrypto is not supported")}))}();if(!e)return void console.info("unable to create public key or webcrypto is unsupported");let{subtle:t}=window.crypto,n=yield xF(UF);if(!n||!t)return void console.info("unable to find private key or webcrypto unsupported");let r={iat:Math.floor((new Date).getTime()/1e3),jti:LF()},i={typ:"dpop+jwt",alg:"ES256",jwk:e},a=WF(JSON.stringify(i)),o=WF(JSON.stringify(r)),s=function(e){return(new TextEncoder).encode(e)}(`${a}.${o}`),u={name:qF,hash:{name:"SHA-256"}},c=function(e){let t="";return e.forEach((e=>{t+=String.fromCharCode(e)})),XF(t)}(new Uint8Array(yield t.sign(u,n,s)));return`${a}.${o}.${c}`}))}function WF(e){return XF(function(e){return encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(parseInt(t,16))))}(e))}function XF(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}var $F=class extends SF{getIdToken(e){let t=mF(this.sdk.testMode?IB.GetIdTokenTestMode:IB.GetIdToken,[e]);return this.request(t)}generateIdToken(e){let t=mF(this.sdk.testMode?IB.GenerateIdTokenTestMode:IB.GenerateIdToken,[e]);return this.request(t)}getMetadata(){let e=mF(this.sdk.testMode?IB.GetMetadataTestMode:IB.GetMetadata);return this.request(e)}updateEmail(e){let{email:t,showUI:n=!0}=e,r=mF(this.sdk.testMode?IB.UpdateEmailTestMode:IB.UpdateEmail,[{email:t,showUI:n}]);return this.request(r)}isLoggedIn(){let e=mF(this.sdk.testMode?IB.IsLoggedInTestMode:IB.IsLoggedIn);return this.request(e)}logout(){GF();let e=mF(this.sdk.testMode?IB.LogoutTestMode:IB.Logout);return this.request(e)}showSettings(){let e=mF(this.sdk.testMode?IB.UserSettingsTestMode:IB.UserSettings);return this.request(e)}updatePhoneNumber(){let e=mF(this.sdk.testMode?IB.UpdatePhoneNumberTestMode:IB.UpdatePhoneNumber);return this.request(e)}recoverAccount(e){let t=mF(this.sdk.testMode?IB.RecoverAccountTestMode:IB.RecoverAccount,[e]);return this.request(t)}},JF=class extends SF{connectWithUI(){let e=mF(IB.RequestAccounts);return this.request(e)}showUI(){let e=mF(IB.ShowUI);return this.request(e)}getInfo(){let e=mF(IB.GetInfo);return this.request(e)}requestUserInfoWithUI(e){let t=mF(IB.RequestUserInfoWithUI,e?[e]:[]);return this.request(t)}disconnect(){GF();let e=mF(IB.Disconnect);return this.request(e)}},{createBoundEmitterMethod:YF,createChainingEmitterMethod:QF}=wF(),ZF=class extends SF{constructor(){super(...arguments),this.isMagic=!0,this.on=QF("on",this),this.once=QF("once",this),this.addListener=QF("addListener",this),this.off=QF("off",this),this.removeListener=QF("removeListener",this),this.removeAllListeners=QF("removeAllListeners",this),this.emit=YF("emit"),this.eventNames=YF("eventNames"),this.listeners=YF("listeners"),this.listenerCount=YF("listenerCount")}sendAsync(e,t){if(!t)throw cF({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:null===t?"null":typeof t});if(Array.isArray(e))this.overlay.post(CB.MAGIC_HANDLE_REQUEST,e.map((e=>{let t=bF(e);return this.prefixPayloadMethodForTestMode(t),t}))).then((e=>{t(null,e.map((e=>((e,t)=>BB(e,FB(t)))(VB({},e.payload),{error:e.hasError?new tF(e.payload.error):null}))))}));else{let n=bF(e);this.prefixPayloadMethodForTestMode(n),this.overlay.post(CB.MAGIC_HANDLE_REQUEST,n).then((e=>{t(e.hasError?new tF(e.payload.error):null,e.payload)}))}}send(e,t){if("string"==typeof e){let n=mF(e,Array.isArray(t)?t:[]);return this.request(n)}if(Array.isArray(e)||t)return void this.sendAsync(e,t);let n=new nF(kB.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.");return n.log(),new yF(e).applyError({code:-32603,message:n.rawMessage}).payload}enable(){let e=mF("eth_accounts");return this.request(e)}request(e){return this.prefixPayloadMethodForTestMode(e),super.request(e)}prefixPayloadMethodForTestMode(e){this.sdk.testMode&&(e.method=`testMode/eth/${e.method}`)}};function eL(e,t){return t?new URL(e,t):new URL(e)}var tL=["request","overlay","sdk"];function nL(e){let t=Object.getPrototypeOf(e),n=[t];for(;t!==SF.prototype;)t=Object.getPrototypeOf(t),n.push(t);return n}var rL=class extends SF{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:TF,isPromiEvent:EF,encodeJSON:WD,decodeJSON:XD,createJsonRpcRequestPayload:mF,standardizeJsonRpcRequestPayload:bF,storage:OF};let e=[this,...nL(this)];tL.forEach((t=>{let n=e.map((e=>Object.getOwnPropertyDescriptor(e,t))),r=n.findIndex((e=>!!e)),i=r>0,a=n[r];a&&(this.__sdk_access_field_descriptors__.set(t,{descriptor:a,isPrototypeField:i}),Object.defineProperty(this,t,{configurable:!0,get:()=>{throw sF(t)}}))}))}init(e){this.__is_initialized__||(tL.forEach((e=>{if(this.__sdk_access_field_descriptors__.has(e)){let{descriptor:t,isPrototypeField:n}=this.__sdk_access_field_descriptors__.get(e);n?delete this[e]:Object.defineProperty(this,e,t)}})),this.sdk=e,this.__is_initialized__=!0)}createDeprecationWarning(e){let{method:t,removalVersion:n,useInstead:r}=e;return new iF(this,"DEPRECATION_NOTICE",`\`${t}\` will be removed from this Extension in version \`${n}\`.${r?` Use \`${r}\` instead.`:""}`)}createWarning(e,t){return new iF(this,e,t)}createError(e,t,n){return new rF(this,e,t,n)}},iL=class extends rL{};iL.Internal=class extends rL{},iL.Anonymous="anonymous extension";var aL=class extends SF{purchase(e){let t=mF(IB.NFTPurchase,[e]);return this.request(t)}};function oL(e){return!e.compat||null==e.compat[QD.sdkName]||("string"==typeof e.compat[QD.sdkName]?FD(VD(QD.version),e.compat[QD.sdkName]):!!e.compat[QD.sdkName])}function sL(e){var t;let n=null!=(t=null==e?void 0:e.extensions)?t:[],r={},i=[];if(Array.isArray(n)?n.forEach((e=>{oL(e)?(e.init(this),(e.name||e.name!==iL.Anonymous)&&(this[e.name]=e),e instanceof iL.Internal&&(YD(e.config)||(r[e.name]=e.config))):i.push(e)})):Object.keys(n).forEach((e=>{if(oL(n[e])){n[e].init(this);let t=n[e];this[e]=t,t instanceof iL.Internal&&(YD(t.config)||(r[n[e].name]=t.config))}else i.push(n[e])})),i.length)throw uF(i);return r}var uL=class{constructor(e,t){var n;if(this.apiKey=e,!e)throw aF();"react-native"===QD.platform&&(null==t?void 0:t.endpoint)&&fF().log();let{defaultEndpoint:r,version:i}=QD;this.testMode=!(null==t||!t.testMode),this.endpoint=eL(null!=(n=null==t?void 0:t.endpoint)?n:r).origin,this.auth=new kF(this),this.user=new $F(this),this.wallet=new JF(this),this.nft=new aL(this),this.rpcProvider=new ZF(this);let a=sL.call(this,t);this.parameters=WD(VB({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:null==t?void 0:t.network,host:eL(this.endpoint).host,sdk:ZD[QD.sdkName],version:i,ext:YD(a)?void 0:a,locale:(null==t?void 0:t.locale)||"en_US"},QD.bundleId?{bundleId:QD.bundleId}:{}))}get overlay(){if(!uL.__overlays__.has(this.parameters)){let e=new QD.ViewController(this.endpoint,this.parameters);e.init(),uL.__overlays__.set(this.parameters,e)}return uL.__overlays__.get(this.parameters)}preload(){return GB(this,null,(function*(){yield this.overlay.ready}))}},cL=uL;function fL(e,t){var n;let r=null==(n=t.data.response)?void 0:n.id,i=function(e,t){return t&&Array.isArray(e)?e.find((e=>e.id===t)):e}(e,r);if(r&&i){return{id:r,response:new yF(i).applyResult(t.data.response.result).applyError(t.data.response.error)}}return{}}cL.__overlays__=new Map;var dL=class{constructor(e,t){this.endpoint=e,this.parameters=t,this.messageHandlers=new Set,this.ready=this.waitForReady(),this.listen()}post(e,t){return GB(this,null,(function*(){return AF((n=>GB(this,null,(function*(){yield this.ready;let r=[],i=Array.isArray(t)?t.map((e=>e.id)):[],a=yield function(e,t){return GB(this,null,(function*(){let n,r=yield xF("rt");if("web"===QD.platform)try{n=yield KF()}catch(e){console.error("webcrypto error",e)}return n?r?{msgType:e,payload:t,jwt:n,rt:r}:{msgType:e,payload:t,jwt:n}:{msgType:e,payload:t}}))}(`${e}-${this.parameters}`,t);yield this._post(a);let o=this.on(xB.MAGIC_HANDLE_RESPONSE,(e=>a=>{let{id:o,response:s}=fL(t,a);(function(e){GB(this,null,(function*(){!e.data.rt||(yield CF("rt",e.data.rt))}))})(a),o&&s&&Array.isArray(t)&&i.includes(o)?(r.push(s),r.length===t.length&&(e(),n(r))):o&&s&&!Array.isArray(t)&&o===t.id&&(e(),n(s))})((()=>o())))}))))}))}on(e,t){let n=t.bind(window),r=t=>{t.data.msgType===`${e}-${this.parameters}`&&n(t)};return this.messageHandlers.add(r),()=>this.messageHandlers.delete(r)}waitForReady(){return new Promise((e=>{this.on(xB.MAGIC_OVERLAY_READY,(()=>e()))}))}listen(){this.on(xB.MAGIC_HIDE_OVERLAY,(()=>{this.hideOverlay()})),this.on(xB.MAGIC_SHOW_OVERLAY,(()=>{this.showOverlay()}))}},lL=Object.create,pL=Object.defineProperty,hL=Object.getOwnPropertyDescriptor,bL=Object.getOwnPropertyNames,mL=Object.getPrototypeOf,yL=Object.prototype.hasOwnProperty,gL=(e=>"undefined"!=typeof require?require:"undefined"!=typeof Proxy?new Proxy(e,{get:(e,t)=>("undefined"!=typeof require?require:e)[t]}):e)((function(e){if("undefined"!=typeof require)return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')})),vL=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),wL=(e,t,n)=>(n=null!=e?lL(mL(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of bL(t))!yL.call(e,i)&&i!==n&&pL(e,i,{get:()=>t[i],enumerable:!(r=hL(t,i))||r.enumerable});return e})(!t&&e&&e.__esModule?n:pL(n,"default",{value:e,enumerable:!0}),e)),_L=(e,t,n)=>new Promise(((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())})),EL=vL(((e,t)=>{!function(n){if("object"==typeof e&&typeof t<"u")t.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{(typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this).localforage=n()}}((function(){return function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var u="function"==typeof gL&&gL;if(!s&&u)return u(o,!0);if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var f=n[o]={exports:{}};t[o][0].call(f.exports,(function(e){return i(t[o][1][e]||e)}),f,f.exports,e,t,n,r)}return n[o].exports}for(var a="function"==typeof gL&&gL,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){(function(e){var n,r=e.MutationObserver||e.WebKitMutationObserver;if(r){var i=0,a=new r(f),o=e.document.createTextNode("");a.observe(o,{characterData:!0}),n=function(){o.data=i=++i%2}}else if(!e.setImmediate&&typeof e.MessageChannel<"u"){var s=new e.MessageChannel;s.port1.onmessage=f,n=function(){s.port2.postMessage(0)}}else n="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){f(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(f,0)};var u,c=[];function f(){u=!0;for(var e,t,n=c.length;n;){for(t=c,c=[],e=-1;++e<n;)t[e]();n=c.length}u=!1}t.exports=function(e){1===c.push(e)&&!u&&n()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(e,t,n){var r=e(1);function i(){}var a={},o=["REJECTED"],s=["FULFILLED"],u=["PENDING"];function c(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,e!==i&&p(this,e)}function f(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function d(e,t,n){r((function(){var r;try{r=t(n)}catch(t){return a.reject(e,t)}r===e?a.reject(e,new TypeError("Cannot resolve promise with itself")):a.resolve(e,r)}))}function l(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function p(e,t){var n=!1;function r(t){n||(n=!0,a.reject(e,t))}function i(t){n||(n=!0,a.resolve(e,t))}var o=h((function(){t(i,r)}));"error"===o.status&&r(o.value)}function h(e,t){var n={};try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}t.exports=c,c.prototype.catch=function(e){return this.then(null,e)},c.prototype.then=function(e,t){if("function"!=typeof e&&this.state===s||"function"!=typeof t&&this.state===o)return this;var n=new this.constructor(i);this.state!==u?d(n,this.state===s?e:t,this.outcome):this.queue.push(new f(n,e,t));return n},f.prototype.callFulfilled=function(e){a.resolve(this.promise,e)},f.prototype.otherCallFulfilled=function(e){d(this.promise,this.onFulfilled,e)},f.prototype.callRejected=function(e){a.reject(this.promise,e)},f.prototype.otherCallRejected=function(e){d(this.promise,this.onRejected,e)},a.resolve=function(e,t){var n=h(l,t);if("error"===n.status)return a.reject(e,n.value);var r=n.value;if(r)p(e,r);else{e.state=s,e.outcome=t;for(var i=-1,o=e.queue.length;++i<o;)e.queue[i].callFulfilled(t)}return e},a.reject=function(e,t){e.state=o,e.outcome=t;for(var n=-1,r=e.queue.length;++n<r;)e.queue[n].callRejected(t);return e},c.resolve=function(e){return e instanceof this?e:a.resolve(new this(i),e)},c.reject=function(e){var t=new this(i);return a.reject(t,e)},c.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var o=new Array(n),s=0,u=-1,c=new this(i);++u<n;)f(e[u],u);return c;function f(e,i){t.resolve(e).then((function(e){o[i]=e,++s===n&&!r&&(r=!0,a.resolve(c,o))}),(function(e){r||(r=!0,a.reject(c,e))}))}},c.race=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var o=-1,s=new this(i);++o<n;)u(e[o]);return s;function u(e){t.resolve(e).then((function(e){r||(r=!0,a.resolve(s,e))}),(function(e){r||(r=!0,a.reject(s,e))}))}}},{1:1}],3:[function(e,t,n){(function(t){"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(e,t,n){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i=function(){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}}();function a(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(i){if("TypeError"!==i.name)throw i;for(var n=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),r=0;r<e.length;r+=1)n.append(e[r]);return n.getBlob(t.type)}}typeof Promise>"u"&&e(3);var o=Promise;function s(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))}function u(e,t,n){"function"==typeof t&&e.then(t),"function"==typeof n&&e.catch(n)}function c(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function f(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var d="local-forage-detect-blob-support",l=void 0,p={},h=Object.prototype.toString,b="readonly",m="readwrite";function y(e){return"boolean"==typeof l?o.resolve(l):function(e){return new o((function(t){var n=e.transaction(d,m),r=a([""]);n.objectStore(d).put(r,"key"),n.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},n.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);t(n||!e||parseInt(e[1],10)>=43)}})).catch((function(){return!1}))}(e).then((function(e){return l=e}))}function g(e){var t=p[e.name],n={};n.promise=new o((function(e,t){n.resolve=e,n.reject=t})),t.deferredOperations.push(n),t.dbReady?t.dbReady=t.dbReady.then((function(){return n.promise})):t.dbReady=n.promise}function v(e){var t=p[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function w(e,t){var n=p[e.name].deferredOperations.pop();if(n)return n.reject(t),n.promise}function _(e,t){return new o((function(n,r){if(p[e.name]=p[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!t)return n(e.db);g(e),e.db.close()}var a=[e.name];t&&a.push(e.version);var o=i.open.apply(i,a);t&&(o.onupgradeneeded=function(t){var n=o.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore(d)}catch(n){if("ConstraintError"!==n.name)throw n;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),o.onerror=function(e){e.preventDefault(),r(o.error)},o.onsuccess=function(){var t=o.result;t.onversionchange=function(e){e.target.close()},n(t),v(e)}}))}function E(e){return _(e,!1)}function T(e){return _(e,!0)}function A(e,t){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),r=e.version<e.db.version,i=e.version>e.db.version;if(r&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),i||n){if(n){var a=e.db.version+1;a>e.version&&(e.version=a)}return!0}return!1}function R(e){var t=function(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),i=0;i<t;i++)r[i]=e.charCodeAt(i);return n}(atob(e.data));return a([t],{type:e.type})}function S(e){return e&&e.__local_forage_encoded_blob}function k(e){var t=this,n=t._initReady().then((function(){var e=p[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return u(n,e,e),n}function O(e,t,n,r){void 0===r&&(r=1);try{var i=e.db.transaction(e.storeName,t);n(null,i)}catch(i){if(r>0&&(!e.db||"InvalidStateError"===i.name||"NotFoundError"===i.name))return o.resolve().then((function(){if(!e.db||"NotFoundError"===i.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),T(e)})).then((function(){return function(e){g(e);for(var t=p[e.name],n=t.forages,r=0;r<n.length;r++){var i=n[r];i._dbInfo.db&&(i._dbInfo.db.close(),i._dbInfo.db=null)}return e.db=null,E(e).then((function(t){return e.db=t,A(e)?T(e):t})).then((function(r){e.db=t.db=r;for(var i=0;i<n.length;i++)n[i]._dbInfo.db=r})).catch((function(t){throw w(e,t),t}))}(e).then((function(){O(e,t,n,r-1)}))})).catch(n);n(i)}}var I={_driver:"asyncStorage",_initStorage:function(e){var t=this,n={db:null};if(e)for(var r in e)n[r]=e[r];var i=p[n.name];i||(i={forages:[],db:null,dbReady:null,deferredOperations:[]},p[n.name]=i),i.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=k);var a=[];function s(){return o.resolve()}for(var u=0;u<i.forages.length;u++){var c=i.forages[u];c!==t&&a.push(c._initReady().catch(s))}var f=i.forages.slice(0);return o.all(a).then((function(){return n.db=i.db,E(n)})).then((function(e){return n.db=e,A(n,t._defaultConfig.version)?T(n):e})).then((function(e){n.db=i.db=e,t._dbInfo=n;for(var r=0;r<f.length;r++){var a=f[r];a!==t&&(a._dbInfo.db=n.db,a._dbInfo.version=n.version)}}))},_support:function(){try{if(!i||!i.open)return!1;var e=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}(),iterate:function(e,t){var n=this,r=new o((function(t,r){n.ready().then((function(){O(n._dbInfo,b,(function(i,a){if(i)return r(i);try{var o=a.objectStore(n._dbInfo.storeName).openCursor(),s=1;o.onsuccess=function(){var n=o.result;if(n){var r=n.value;S(r)&&(r=R(r));var i=e(r,n.key,s++);void 0!==i?t(i):n.continue()}else t()},o.onerror=function(){r(o.error)}}catch(e){r(e)}}))})).catch(r)}));return s(r,t),r},getItem:function(e,t){var n=this;e=c(e);var r=new o((function(t,r){n.ready().then((function(){O(n._dbInfo,b,(function(i,a){if(i)return r(i);try{var o=a.objectStore(n._dbInfo.storeName).get(e);o.onsuccess=function(){var e=o.result;void 0===e&&(e=null),S(e)&&(e=R(e)),t(e)},o.onerror=function(){r(o.error)}}catch(e){r(e)}}))})).catch(r)}));return s(r,t),r},setItem:function(e,t,n){var r=this;e=c(e);var i=new o((function(n,i){var a;r.ready().then((function(){return a=r._dbInfo,"[object Blob]"===h.call(t)?y(a.db).then((function(e){return e?t:function(e){return new o((function(t,n){var r=new FileReader;r.onerror=n,r.onloadend=function(n){var r=btoa(n.target.result||"");t({__local_forage_encoded_blob:!0,data:r,type:e.type})},r.readAsBinaryString(e)}))}(t)})):t})).then((function(t){O(r._dbInfo,m,(function(a,o){if(a)return i(a);try{var s=o.objectStore(r._dbInfo.storeName);null===t&&(t=void 0);var u=s.put(t,e);o.oncomplete=function(){void 0===t&&(t=null),n(t)},o.onabort=o.onerror=function(){var e=u.error?u.error:u.transaction.error;i(e)}}catch(e){i(e)}}))})).catch(i)}));return s(i,n),i},removeItem:function(e,t){var n=this;e=c(e);var r=new o((function(t,r){n.ready().then((function(){O(n._dbInfo,m,(function(i,a){if(i)return r(i);try{var o=a.objectStore(n._dbInfo.storeName).delete(e);a.oncomplete=function(){t()},a.onerror=function(){r(o.error)},a.onabort=function(){var e=o.error?o.error:o.transaction.error;r(e)}}catch(e){r(e)}}))})).catch(r)}));return s(r,t),r},clear:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){O(t._dbInfo,m,(function(r,i){if(r)return n(r);try{var a=i.objectStore(t._dbInfo.storeName).clear();i.oncomplete=function(){e()},i.onabort=i.onerror=function(){var e=a.error?a.error:a.transaction.error;n(e)}}catch(e){n(e)}}))})).catch(n)}));return s(n,e),n},length:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){O(t._dbInfo,b,(function(r,i){if(r)return n(r);try{var a=i.objectStore(t._dbInfo.storeName).count();a.onsuccess=function(){e(a.result)},a.onerror=function(){n(a.error)}}catch(e){n(e)}}))})).catch(n)}));return s(n,e),n},key:function(e,t){var n=this,r=new o((function(t,r){e<0?t(null):n.ready().then((function(){O(n._dbInfo,b,(function(i,a){if(i)return r(i);try{var o=a.objectStore(n._dbInfo.storeName),s=!1,u=o.openKeyCursor();u.onsuccess=function(){var n=u.result;n?0===e||s?t(n.key):(s=!0,n.advance(e)):t(null)},u.onerror=function(){r(u.error)}}catch(e){r(e)}}))})).catch(r)}));return s(r,t),r},keys:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){O(t._dbInfo,b,(function(r,i){if(r)return n(r);try{var a=i.objectStore(t._dbInfo.storeName).openKeyCursor(),o=[];a.onsuccess=function(){var t=a.result;t?(o.push(t.key),t.continue()):e(o)},a.onerror=function(){n(a.error)}}catch(e){n(e)}}))})).catch(n)}));return s(n,e),n},dropInstance:function(e,t){t=f.apply(this,arguments);var n,r=this.config();if((e="function"!=typeof e&&e||{}).name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName),e.name){var a=e.name===r.name&&this._dbInfo.db?o.resolve(this._dbInfo.db):E(e).then((function(t){var n=p[e.name],r=n.forages;n.db=t;for(var i=0;i<r.length;i++)r[i]._dbInfo.db=t;return t}));n=e.storeName?a.then((function(t){if(t.objectStoreNames.contains(e.storeName)){var n=t.version+1;g(e);var r=p[e.name],a=r.forages;t.close();for(var s=0;s<a.length;s++){var u=a[s];u._dbInfo.db=null,u._dbInfo.version=n}var c=new o((function(t,r){var a=i.open(e.name,n);a.onerror=function(e){a.result.close(),r(e)},a.onupgradeneeded=function(){a.result.deleteObjectStore(e.storeName)},a.onsuccess=function(){var e=a.result;e.close(),t(e)}}));return c.then((function(e){r.db=e;for(var t=0;t<a.length;t++){var n=a[t];n._dbInfo.db=e,v(n._dbInfo)}})).catch((function(t){throw(w(e,t)||o.resolve()).catch((function(){})),t}))}})):a.then((function(t){g(e);var n=p[e.name],r=n.forages;t.close();for(var a=0;a<r.length;a++){r[a]._dbInfo.db=null}var s=new o((function(t,n){var r=i.deleteDatabase(e.name);r.onerror=function(){var e=r.result;e&&e.close(),n(r.error)},r.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},r.onsuccess=function(){var e=r.result;e&&e.close(),t(e)}}));return s.then((function(e){n.db=e;for(var t=0;t<r.length;t++){v(r[t]._dbInfo)}})).catch((function(t){throw(w(e,t)||o.resolve()).catch((function(){})),t}))}))}else n=o.reject("Invalid arguments");return s(n,t),n}};var x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",C=/^~~local_forage_type~([^~]+)~/,M="__lfsc__:",N="arbf",P="blob",B="si08",D="ui08",F="uic8",L="si16",U="si32",j="ur16",q="ui32",z="fl32",H="fl64",V=Object.prototype.toString;function G(e){var t,n,r,i,a,o=.75*e.length,s=e.length,u=0;"="===e[e.length-1]&&(o--,"="===e[e.length-2]&&o--);var c=new ArrayBuffer(o),f=new Uint8Array(c);for(t=0;t<s;t+=4)n=x.indexOf(e[t]),r=x.indexOf(e[t+1]),i=x.indexOf(e[t+2]),a=x.indexOf(e[t+3]),f[u++]=n<<2|r>>4,f[u++]=(15&r)<<4|i>>2,f[u++]=(3&i)<<6|63&a;return c}function K(e){var t,n=new Uint8Array(e),r="";for(t=0;t<n.length;t+=3)r+=x[n[t]>>2],r+=x[(3&n[t])<<4|n[t+1]>>4],r+=x[(15&n[t+1])<<2|n[t+2]>>6],r+=x[63&n[t+2]];return n.length%3==2?r=r.substring(0,r.length-1)+"=":n.length%3==1&&(r=r.substring(0,r.length-2)+"=="),r}var W={serialize:function(e,t){var n="";if(e&&(n=V.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===V.call(e.buffer))){var r,i=M;e instanceof ArrayBuffer?(r=e,i+=N):(r=e.buffer,"[object Int8Array]"===n?i+=B:"[object Uint8Array]"===n?i+=D:"[object Uint8ClampedArray]"===n?i+=F:"[object Int16Array]"===n?i+=L:"[object Uint16Array]"===n?i+=j:"[object Int32Array]"===n?i+=U:"[object Uint32Array]"===n?i+=q:"[object Float32Array]"===n?i+=z:"[object Float64Array]"===n?i+=H:t(new Error("Failed to get type for BinaryArray"))),t(i+K(r))}else if("[object Blob]"===n){var a=new FileReader;a.onload=function(){var n="~~local_forage_type~"+e.type+"~"+K(this.result);t(M+P+n)},a.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error("Couldn't convert value into a JSON string: ",e),t(null,n)}},deserialize:function(e){if(e.substring(0,9)!==M)return JSON.parse(e);var t,n=e.substring(13),r=e.substring(9,13);if(r===P&&C.test(n)){var i=n.match(C);t=i[1],n=n.substring(i[0].length)}var o=G(n);switch(r){case N:return o;case P:return a([o],{type:t});case B:return new Int8Array(o);case D:return new Uint8Array(o);case F:return new Uint8ClampedArray(o);case L:return new Int16Array(o);case j:return new Uint16Array(o);case U:return new Int32Array(o);case q:return new Uint32Array(o);case z:return new Float32Array(o);case H:return new Float64Array(o);default:throw new Error("Unkown type: "+r)}},stringToBuffer:G,bufferToString:K};function X(e,t,n,r){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,r)}function $(e,t,n,r,i,a){e.executeSql(n,r,i,(function(e,o){o.code===o.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,s){s.rows.length?a(e,o):X(e,t,(function(){e.executeSql(n,r,i,a)}),a)}),a):a(e,o)}),a)}function J(e,t,n,r){var i=this;e=c(e);var a=new o((function(a,o){i.ready().then((function(){void 0===t&&(t=null);var s=t,u=i._dbInfo;u.serializer.serialize(t,(function(t,c){c?o(c):u.db.transaction((function(n){$(n,u,"INSERT OR REPLACE INTO "+u.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){a(s)}),(function(e,t){o(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(r>0)return void a(J.apply(i,[e,s,n,r-1]));o(t)}}))}))})).catch(o)}));return s(a,n),a}var Y={_driver:"webSQLStorage",_initStorage:function(e){var t=this,n={db:null};if(e)for(var r in e)n[r]="string"!=typeof e[r]?e[r].toString():e[r];var i=new o((function(e,r){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(e){return r(e)}n.db.transaction((function(i){X(i,n,(function(){t._dbInfo=n,e()}),(function(e,t){r(t)}))}),r)}));return n.serializer=W,i},_support:"function"==typeof openDatabase,iterate:function(e,t){var n=this,r=new o((function(t,r){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){$(n,i,"SELECT * FROM "+i.storeName,[],(function(n,r){for(var a=r.rows,o=a.length,s=0;s<o;s++){var u=a.item(s),c=u.value;if(c&&(c=i.serializer.deserialize(c)),void 0!==(c=e(c,u.key,s+1)))return void t(c)}t()}),(function(e,t){r(t)}))}))})).catch(r)}));return s(r,t),r},getItem:function(e,t){var n=this;e=c(e);var r=new o((function(t,r){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){$(n,i,"SELECT * FROM "+i.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,n){var r=n.rows.length?n.rows.item(0).value:null;r&&(r=i.serializer.deserialize(r)),t(r)}),(function(e,t){r(t)}))}))})).catch(r)}));return s(r,t),r},setItem:function(e,t,n){return J.apply(this,[e,t,n,1])},removeItem:function(e,t){var n=this;e=c(e);var r=new o((function(t,r){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){$(n,i,"DELETE FROM "+i.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){r(t)}))}))})).catch(r)}));return s(r,t),r},clear:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){var r=t._dbInfo;r.db.transaction((function(t){$(t,r,"DELETE FROM "+r.storeName,[],(function(){e()}),(function(e,t){n(t)}))}))})).catch(n)}));return s(n,e),n},length:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){var r=t._dbInfo;r.db.transaction((function(t){$(t,r,"SELECT COUNT(key) as c FROM "+r.storeName,[],(function(t,n){var r=n.rows.item(0).c;e(r)}),(function(e,t){n(t)}))}))})).catch(n)}));return s(n,e),n},key:function(e,t){var n=this,r=new o((function(t,r){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){$(n,i,"SELECT key FROM "+i.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,n){var r=n.rows.length?n.rows.item(0).key:null;t(r)}),(function(e,t){r(t)}))}))})).catch(r)}));return s(r,t),r},keys:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){var r=t._dbInfo;r.db.transaction((function(t){$(t,r,"SELECT key FROM "+r.storeName,[],(function(t,n){for(var r=[],i=0;i<n.rows.length;i++)r.push(n.rows.item(i).key);e(r)}),(function(e,t){n(t)}))}))})).catch(n)}));return s(n,e),n},dropInstance:function(e,t){t=f.apply(this,arguments);var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var r,i=this;return r=e.name?new o((function(t){var r;r=e.name===n.name?i._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?t({db:r,storeNames:[e.storeName]}):t(function(e){return new o((function(t,n){e.transaction((function(r){r.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(n,r){for(var i=[],a=0;a<r.rows.length;a++)i.push(r.rows.item(a).name);t({db:e,storeNames:i})}),(function(e,t){n(t)}))}),(function(e){n(e)}))}))}(r))})).then((function(e){return new o((function(t,n){e.db.transaction((function(r){function i(e){return new o((function(t,n){r.executeSql("DROP TABLE IF EXISTS "+e,[],(function(){t()}),(function(e,t){n(t)}))}))}for(var a=[],s=0,u=e.storeNames.length;s<u;s++)a.push(i(e.storeNames[s]));o.all(a).then((function(){t()})).catch((function(e){n(e)}))}),(function(e){n(e)}))}))})):o.reject("Invalid arguments"),s(r,t),r}};function Q(e,t){var n=e.name+"/";return e.storeName!==t.storeName&&(n+=e.storeName+"/"),n}function Z(){return!function(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch{return!0}}()||localStorage.length>0}var ee={_driver:"localStorageWrapper",_initStorage:function(e){var t={};if(e)for(var n in e)t[n]=e[n];return t.keyPrefix=Q(e,this._defaultConfig),Z()?(this._dbInfo=t,t.serializer=W,o.resolve()):o.reject()},_support:function(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}(),iterate:function(e,t){var n=this,r=n.ready().then((function(){for(var t=n._dbInfo,r=t.keyPrefix,i=r.length,a=localStorage.length,o=1,s=0;s<a;s++){var u=localStorage.key(s);if(0===u.indexOf(r)){var c=localStorage.getItem(u);if(c&&(c=t.serializer.deserialize(c)),void 0!==(c=e(c,u.substring(i),o++)))return c}}}));return s(r,t),r},getItem:function(e,t){var n=this;e=c(e);var r=n.ready().then((function(){var t=n._dbInfo,r=localStorage.getItem(t.keyPrefix+e);return r&&(r=t.serializer.deserialize(r)),r}));return s(r,t),r},setItem:function(e,t,n){var r=this;e=c(e);var i=r.ready().then((function(){void 0===t&&(t=null);var n=t;return new o((function(i,a){var o=r._dbInfo;o.serializer.serialize(t,(function(t,r){if(r)a(r);else try{localStorage.setItem(o.keyPrefix+e,t),i(n)}catch(e){("QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&a(e),a(e)}}))}))}));return s(i,n),i},removeItem:function(e,t){var n=this;e=c(e);var r=n.ready().then((function(){var t=n._dbInfo;localStorage.removeItem(t.keyPrefix+e)}));return s(r,t),r},clear:function(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var r=localStorage.key(n);0===r.indexOf(e)&&localStorage.removeItem(r)}}));return s(n,e),n},length:function(e){var t=this.keys().then((function(e){return e.length}));return s(t,e),t},key:function(e,t){var n=this,r=n.ready().then((function(){var t,r=n._dbInfo;try{t=localStorage.key(e)}catch{t=null}return t&&(t=t.substring(r.keyPrefix.length)),t}));return s(r,t),r},keys:function(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo,n=localStorage.length,r=[],i=0;i<n;i++){var a=localStorage.key(i);0===a.indexOf(e.keyPrefix)&&r.push(a.substring(e.keyPrefix.length))}return r}));return s(n,e),n},dropInstance:function(e,t){if(t=f.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var n=this.config();e.name=e.name||n.name,e.storeName=e.storeName||n.storeName}var r,i=this;return r=e.name?new o((function(t){e.storeName?t(Q(e,i._defaultConfig)):t(e.name+"/")})).then((function(e){for(var t=localStorage.length-1;t>=0;t--){var n=localStorage.key(t);0===n.indexOf(e)&&localStorage.removeItem(n)}})):o.reject("Invalid arguments"),s(r,t),r}},te=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},ne=function(e,t){for(var n=e.length,r=0;r<n;){if(te(e[r],t))return!0;r++}return!1},re=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},ie={},ae={},oe={INDEXEDDB:I,WEBSQL:Y,LOCALSTORAGE:ee},se=[oe.INDEXEDDB._driver,oe.WEBSQL._driver,oe.LOCALSTORAGE._driver],ue=["dropInstance"],ce=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ue),fe={description:"",driver:se.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function de(e,t){e[t]=function(){var n=arguments;return e.ready().then((function(){return e[t].apply(e,n)}))}}function le(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var n in t)t.hasOwnProperty(n)&&(re(t[n])?arguments[0][n]=t[n].slice():arguments[0][n]=t[n])}return arguments[0]}var pe=function(){function e(t){for(var n in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),oe)if(oe.hasOwnProperty(n)){var r=oe[n],i=r._driver;this[n]=i,ie[i]||this.defineDriver(r)}this._defaultConfig=le({},fe),this._config=le({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return e.prototype.config=function(e){if("object"===(typeof e>"u"?"undefined":r(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e)||!e.driver||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,n){var r=new o((function(t,n){try{var r=e._driver,i=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void n(i);for(var a=ce.concat("_initStorage"),u=0,c=a.length;u<c;u++){var f=a[u];if((!ne(ue,f)||e[f])&&"function"!=typeof e[f])return void n(i)}!function(){for(var t=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),n=o.reject(t);return s(n,arguments[arguments.length-1]),n}},n=0,r=ue.length;n<r;n++){var i=ue[n];e[i]||(e[i]=t(i))}}();var d=function(n){ie[r]&&console.info("Redefining LocalForage driver: "+r),ie[r]=e,ae[r]=n,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(d,n):d(!!e._support):d(!0)}catch(e){n(e)}}));return u(r,t,n),r},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,n){var r=ie[e]?o.resolve(ie[e]):o.reject(new Error("Driver not found."));return u(r,t,n),r},e.prototype.getSerializer=function(e){var t=o.resolve(W);return u(t,e),t},e.prototype.ready=function(e){var t=this,n=t._driverSet.then((function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready}));return u(n,e,e),n},e.prototype.setDriver=function(e,t,n){var r=this;re(e)||(e=[e]);var i=this._getSupportedDrivers(e);function a(){r._config.driver=r.driver()}function s(e){return r._extend(e),a(),r._ready=r._initStorage(r._config),r._ready}var c=null!==this._driverSet?this._driverSet.catch((function(){return o.resolve()})):o.resolve();return this._driverSet=c.then((function(){var e=i[0];return r._dbInfo=null,r._ready=null,r.getDriver(e).then((function(e){r._driver=e._driver,a(),r._wrapLibraryMethodsWithReady(),r._initDriver=function(e){return function(){var t=0;return function n(){for(;t<e.length;){var i=e[t];return t++,r._dbInfo=null,r._ready=null,r.getDriver(i).then(s).catch(n)}a();var u=new Error("No available storage method found.");return r._driverSet=o.reject(u),r._driverSet}()}}(i)}))})).catch((function(){a();var e=new Error("No available storage method found.");return r._driverSet=o.reject(e),r._driverSet})),u(this._driverSet,t,n),this._driverSet},e.prototype.supports=function(e){return!!ae[e]},e.prototype._extend=function(e){le(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];this.supports(i)&&t.push(i)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=ce.length;e<t;e++)de(this,ce[e])},e.prototype.createInstance=function(t){return new e(t)},e}(),he=new pe;t.exports=he},{3:3}]},{},[4])(4)}))})),TL=vL(((e,t)=>{!function(n,r){"object"==typeof e&&typeof t<"u"?r(e):"function"==typeof define&&define.amd?define("localforage-driver-memory",["exports"],r):r(n.LocalforageDriverMemory={})}(typeof self<"u"?self:e,(function(e){var t=/^~~local_forage_type~([^~]+)~/,n=Object.prototype.toString;function r(e){var t=.75*e.length,n=e.length;"="===e[e.length-1]&&(t--,"="===e[e.length-2]&&t--);for(var r=new ArrayBuffer(t),i=new Uint8Array(r),a=0,o=0;a<n;a+=4){var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[a]),u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[a+1]),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[a+2]),f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[a+3]);i[o++]=s<<2|u>>4,i[o++]=(15&u)<<4|c>>2,i[o++]=(3&c)<<6|63&f}return r}function i(e){for(var t=new Uint8Array(e),n="",r=0;r<t.length;r+=3)n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[t[r]>>2],n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&t[r])<<4|t[r+1]>>4],n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&t[r+1])<<2|t[r+2]>>6],n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[63&t[r+2]];return t.length%3==2?n=n.substring(0,n.length-1)+"=":t.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}function a(e){var t,n;if(null===e||"object"!=typeof e||"isActiveClone"in e)return e;var r=e instanceof Date?new Date(e):e.constructor();try{for(var i=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(Object.keys(e)),o=i.next();!o.done;o=i.next()){var s=o.value;Object.prototype.hasOwnProperty.call(e,s)&&(e.isActiveClone=null,r[s]=a(e[s]),delete e.isActiveClone)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}function o(e,t){return(e.name||t.name)+"/"+(e.storeName||t.storeName)+"/"}function s(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))}function u(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}function c(e,t){var n,r=this;if(t=u.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var i=this.config();e.name=e.name||i.name,e.storeName=e.storeName||i.storeName}return n=e.name?new Promise((function(t){e.storeName?t(o(e,r._defaultConfig)):t(e.name+"/")})):Promise.reject("Invalid arguments"),{promise:n,callback:t}}function f(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}var d={bufferToString:i,deserialize:function(e){if("__lfsc__:"!==e.substring(0,9))return JSON.parse(e);var n,i=e.substring(13),a=e.substring(9,13);if("blob"===a&&t.test(i)){var o=i.match(t);n=o[1],i=i.substring(o[0].length)}var s=r(i);switch(a){case"arbf":return s;case"blob":return function(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(i){if("TypeError"!==i.name)throw i;for(var n=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),r=0;r<e.length;r+=1)n.append(e[r]);return n.getBlob(t.type)}}([s],{type:n});case"si08":return new Int8Array(s);case"ui08":return new Uint8Array(s);case"uic8":return new Uint8ClampedArray(s);case"si16":return new Int16Array(s);case"ur16":return new Uint16Array(s);case"si32":return new Int32Array(s);case"ui32":return new Uint32Array(s);case"fl32":return new Float32Array(s);case"fl64":return new Float64Array(s);default:throw new Error("Unkown type: "+a)}},serialize:function(e,t){var r="";if(e&&(r=n.call(e)),e&&("[object ArrayBuffer]"===r||e.buffer&&"[object ArrayBuffer]"===n.call(e.buffer))){var a=void 0,o="__lfsc__:";e instanceof ArrayBuffer?(a=e,o+="arbf"):(a=e.buffer,"[object Int8Array]"===r?o+="si08":"[object Uint8Array]"===r?o+="ui08":"[object Uint8ClampedArray]"===r?o+="uic8":"[object Int16Array]"===r?o+="si16":"[object Uint16Array]"===r?o+="ur16":"[object Int32Array]"===r?o+="si32":"[object Uint32Array]"===r?o+="ui32":"[object Float32Array]"===r?o+="fl32":"[object Float64Array]"===r?o+="fl64":t(new Error("Failed to get type for BinaryArray"))),t(o+i(a))}else if("[object Blob]"===r){var s=new FileReader;s.onload=function(){var n="~~local_forage_type~"+e.type+"~"+i(this.result);t("__lfsc__:blob"+n)},s.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error("Couldn't convert value into a JSON string: ",e),t(null,n)}},stringToBuffer:r},l={},p=function(){function e(e){this.kp=e,this.data={}}return e.resolve=function(t){return l[t]||(l[t]=new e(t)),l[t]},e.prototype.clear=function(){this.data={}},e.prototype.drop=function(){this.clear(),delete l[this.kp]},e.prototype.get=function(e){return this.data[e]},e.prototype.key=function(e){return this.keys()[e]},e.prototype.keys=function(){return Object.keys(this.data)},e.prototype.rm=function(e){delete this.data[e]},e.prototype.set=function(e,t){this.data[e]=t},e}();e._support=!0,e._driver="localforage-driver-memory",e._initStorage=function(e){var t=e?a(e):{},n=o(t,this._defaultConfig),r=p.resolve(n);return this._dbInfo=t,this._dbInfo.serializer=d,this._dbInfo.keyPrefix=n,this._dbInfo.mStore=r,Promise.resolve()},e.clear=function(e){var t=this,n=this.ready().then((function(){t._dbInfo.mStore.clear()}));return s(n,e),n},e.dropInstance=function(e,t){var n=c.apply(this,arguments),r=n.promise,i=n.callback,a=r.then((function(e){p.resolve(e).drop()}));return s(a,i),r},e.getItem=function(e,t){var n=this;e=f(e);var r=this.ready().then((function(){var t=n._dbInfo.mStore.get(e);return null==t?null:n._dbInfo.serializer.deserialize(t)}));return s(r,t),r},e.iterate=function(e,t){var n=this,r=this.ready().then((function(){for(var t=n._dbInfo.mStore,r=t.keys(),i=0;i<r.length;i++){var a=t.get(r[i]);if(a&&(a=n._dbInfo.serializer.deserialize(a)),void 0!==(a=e(a,r[i],i+1)))return a}}));return s(r,t),r},e.key=function(e,t){var n=this,r=this.ready().then((function(){var t;try{void 0===(t=n._dbInfo.mStore.key(e))&&(t=null)}catch{t=null}return t}));return s(r,t),r},e.keys=function(e){var t=this,n=this.ready().then((function(){return t._dbInfo.mStore.keys()}));return s(n,e),n},e.length=function(e){var t=this.keys().then((function(e){return e.length}));return s(t,e),t},e.removeItem=function(e,t){var n=this;e=f(e);var r=this.ready().then((function(){n._dbInfo.mStore.rm(e)}));return s(r,t),r},e.setItem=function(e,t,n){var r=this;e=f(e);var i=this.ready().then((function(){void 0===t&&(t=null);var n=t;return new Promise((function(i,a){r._dbInfo.serializer.serialize(t,(function(t,o){if(o)a(o);else try{r._dbInfo.mStore.set(e,t),i(n)}catch(e){a(e)}}))}))}));return s(i,n),i},Object.defineProperty(e,"__esModule",{value:!0})}))})),AL=wL(EL()),RL=wL(TL()),SL={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};var kL=function(e,t){return Object.assign(QD,t),e}(cL,{platform:"web",sdkName:"magic-sdk",version:"13.6.2",defaultEndpoint:"https://auth.magic.link/",ViewController:class extends dL{constructor(){super(...arguments),this.activeElement=null}init(){this.test="hello",this.iframe=new Promise((e=>{let t=()=>{if(function(e){let t=[].slice.call(document.querySelectorAll(".magic-iframe"));return Boolean(t.find((t=>t.src.includes(e))))}(encodeURIComponent(this.parameters)))new nF(kB.DuplicateIframe,"Duplicate iframes found.").log();else{let t=document.createElement("iframe");t.classList.add("magic-iframe"),t.dataset.magicIframeLabel=eL(this.endpoint).host,t.title="Secure Modal",t.src=eL(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,function(e){for(let[t,n]of Object.entries(SL))e.style[t]=n}(t),document.body.appendChild(t),e(t)}};["loaded","interactive","complete"].includes(document.readyState)?t():window.addEventListener("load",t,!1)})),window.addEventListener("message",(e=>{var t;if(e.origin===this.endpoint&&e.data&&e.data.msgType&&this.messageHandlers.size){e.data.response=null!=(t=e.data.response)?t:{};for(let t of this.messageHandlers.values())t(e)}}))}showOverlay(){return _L(this,null,(function*(){let e=yield this.iframe;e.style.display="block",this.activeElement=document.activeElement,e.focus()}))}hideOverlay(){return _L(this,null,(function*(){var e;(yield this.iframe).style.display="none",null!=(e=this.activeElement)&&e.focus&&this.activeElement.focus(),this.activeElement=null}))}_post(e){return _L(this,null,(function*(){let t=yield this.iframe;if(!t||!t.contentWindow)throw new eF(SB.ModalNotReady,"Modal is not ready.");t.contentWindow.postMessage(e,this.endpoint)}))}},configureStorage:()=>_L(void 0,null,(function*(){let e=AL.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield e.defineDriver(RL),yield e.setDriver([AL.default.INDEXEDDB,AL.default.LOCALSTORAGE,RL._driver]),e}))}),OL=(e=>(e.LoginWithOIDC="magic_auth_login_with_oidc",e))(OL||{}),IL=class extends iL.Internal{constructor(){super(...arguments),this.name="openid",this.config={}}loginWithOIDC(e){let t=this.utils.createJsonRpcRequestPayload("magic_auth_login_with_oidc",[e]);return this.request(t)}};function xL(e,t){return function(){return e.apply(t,arguments)}}const{toString:CL}=Object.prototype,{getPrototypeOf:ML}=Object,NL=(e=>t=>{const n=CL.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),PL=e=>(e=e.toLowerCase(),t=>NL(t)===e),BL=e=>t=>typeof t===e,{isArray:DL}=Array,FL=BL("undefined");const LL=PL("ArrayBuffer");const UL=BL("string"),jL=BL("function"),qL=BL("number"),zL=e=>null!==e&&"object"==typeof e,HL=e=>{if("object"!==NL(e))return!1;const t=ML(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},VL=PL("Date"),GL=PL("File"),KL=PL("Blob"),WL=PL("FileList"),XL=PL("URLSearchParams");function $L(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),DL(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function JL(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const YL="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,QL=e=>!FL(e)&&e!==YL;const ZL=(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&ML(Uint8Array)),eU=PL("HTMLFormElement"),tU=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),nU=PL("RegExp"),rU=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};$L(n,((n,i)=>{!1!==t(n,i,e)&&(r[i]=n)})),Object.defineProperties(e,r)},iU="abcdefghijklmnopqrstuvwxyz",aU="0123456789",oU={DIGIT:aU,ALPHA:iU,ALPHA_DIGIT:iU+iU.toUpperCase()+aU};const sU=PL("AsyncFunction");var uU={isArray:DL,isArrayBuffer:LL,isBuffer:function(e){return null!==e&&!FL(e)&&null!==e.constructor&&!FL(e.constructor)&&jL(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||jL(e.append)&&("formdata"===(t=NL(e))||"object"===t&&jL(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&LL(e.buffer),t},isString:UL,isNumber:qL,isBoolean:e=>!0===e||!1===e,isObject:zL,isPlainObject:HL,isUndefined:FL,isDate:VL,isFile:GL,isBlob:KL,isRegExp:nU,isFunction:jL,isStream:e=>zL(e)&&jL(e.pipe),isURLSearchParams:XL,isTypedArray:ZL,isFileList:WL,forEach:$L,merge:function e(){const{caseless:t}=QL(this)&&this||{},n={},r=(r,i)=>{const a=t&&JL(n,i)||i;HL(n[a])&&HL(r)?n[a]=e(n[a],r):HL(r)?n[a]=e({},r):DL(r)?n[a]=r.slice():n[a]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&$L(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>($L(t,((t,r)=>{n&&jL(t)?e[r]=xL(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,a,o;const s={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],r&&!r(o,e,t)||s[o]||(t[o]=e[o],s[o]=!0);e=!1!==n&&ML(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:NL,kindOfTest:PL,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(DL(e))return e;let t=e.length;if(!qL(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:eU,hasOwnProperty:tU,hasOwnProp:tU,reduceDescriptors:rU,freezeMethods:e=>{rU(e,((t,n)=>{if(jL(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];jL(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return DL(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:JL,global:YL,isContextDefined:QL,ALPHABET:oU,generateString:(e=16,t=oU.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&jL(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(zL(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const i=DL(e)?[]:{};return $L(e,((e,t)=>{const a=n(e,r+1);!FL(a)&&(i[t]=a)})),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:sU,isThenable:e=>e&&(zL(e)||jL(e))&&jL(e.then)&&jL(e.catch)};function cU(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}uU.inherits(cU,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:uU.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const fU=cU.prototype,dU={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{dU[e]={value:e}})),Object.defineProperties(cU,dU),Object.defineProperty(fU,"isAxiosError",{value:!0}),cU.from=(e,t,n,r,i,a)=>{const o=Object.create(fU);return uU.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),cU.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};function lU(e){return uU.isPlainObject(e)||uU.isArray(e)}function pU(e){return uU.endsWith(e,"[]")?e.slice(0,-2):e}function hU(e,t,n){return e?e.concat(t).map((function(e,t){return e=pU(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const bU=uU.toFlatObject(uU,{},null,(function(e){return/^is[A-Z]/.test(e)}));function mU(e,t,n){if(!uU.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=uU.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!uU.isUndefined(t[e])}))).metaTokens,i=n.visitor||c,a=n.dots,o=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&uU.isSpecCompliantForm(t);if(!uU.isFunction(i))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(uU.isDate(e))return e.toISOString();if(!s&&uU.isBlob(e))throw new cU("Blob is not supported. Use a Buffer instead.");return uU.isArrayBuffer(e)||uU.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,i){let s=e;if(e&&!i&&"object"==typeof e)if(uU.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(uU.isArray(e)&&function(e){return uU.isArray(e)&&!e.some(lU)}(e)||(uU.isFileList(e)||uU.endsWith(n,"[]"))&&(s=uU.toArray(e)))return n=pU(n),s.forEach((function(e,r){!uU.isUndefined(e)&&null!==e&&t.append(!0===o?hU([n],r,a):null===o?n:n+"[]",u(e))})),!1;return!!lU(e)||(t.append(hU(i,n,a),u(e)),!1)}const f=[],d=Object.assign(bU,{defaultVisitor:c,convertValue:u,isVisitable:lU});if(!uU.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!uU.isUndefined(n)){if(-1!==f.indexOf(n))throw Error("Circular reference detected in "+r.join("."));f.push(n),uU.forEach(n,(function(n,a){!0===(!(uU.isUndefined(n)||null===n)&&i.call(t,n,uU.isString(a)?a.trim():a,r,d))&&e(n,r?r.concat(a):[a])})),f.pop()}}(e),t}function yU(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function gU(e,t){this._pairs=[],e&&mU(e,this,t)}const vU=gU.prototype;function wU(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function _U(e,t,n){if(!t)return e;const r=n&&n.encode||wU,i=n&&n.serialize;let a;if(a=i?i(t,n):uU.isURLSearchParams(t)?t.toString():new gU(t,n).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}vU.append=function(e,t){this._pairs.push([e,t])},vU.toString=function(e){const t=e?function(t){return e.call(this,t,yU)}:yU;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var EU=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){uU.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},TU={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var AU={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:gU,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&("undefined"!=typeof window&&"undefined"!=typeof document)})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};function RU(e){function t(e,n,r,i){let a=e[i++];const o=Number.isFinite(+a),s=i>=e.length;if(a=!a&&uU.isArray(r)?r.length:a,s)return uU.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!o;r[a]&&uU.isObject(r[a])||(r[a]=[]);return t(e,n,r[a],i)&&uU.isArray(r[a])&&(r[a]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}(r[a])),!o}if(uU.isFormData(e)&&uU.isFunction(e.entries)){const n={};return uU.forEachEntry(e,((e,r)=>{t(function(e){return uU.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const SU={"Content-Type":void 0};const kU={transitional:TU,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=uU.isObject(e);i&&uU.isHTMLForm(e)&&(e=new FormData(e));if(uU.isFormData(e))return r&&r?JSON.stringify(RU(e)):e;if(uU.isArrayBuffer(e)||uU.isBuffer(e)||uU.isStream(e)||uU.isFile(e)||uU.isBlob(e))return e;if(uU.isArrayBufferView(e))return e.buffer;if(uU.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return mU(e,new AU.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return AU.isNode&&uU.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=uU.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return mU(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(uU.isString(e))try{return(t||JSON.parse)(e),uU.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||kU.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&uU.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw cU.from(e,cU.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:AU.classes.FormData,Blob:AU.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};uU.forEach(["delete","get","head"],(function(e){kU.headers[e]={}})),uU.forEach(["post","put","patch"],(function(e){kU.headers[e]=uU.merge(SU)}));var OU=kU;const IU=uU.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const xU=Symbol("internals");function CU(e){return e&&String(e).trim().toLowerCase()}function MU(e){return!1===e||null==e?e:uU.isArray(e)?e.map(MU):String(e)}function NU(e,t,n,r,i){return uU.isFunction(r)?r.call(this,t,n):(i&&(t=n),uU.isString(t)?uU.isString(r)?-1!==t.indexOf(r):uU.isRegExp(r)?r.test(t):void 0:void 0)}class PU{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=CU(t);if(!i)throw new Error("header name must be a non-empty string");const a=uU.findKey(r,i);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=MU(e))}const a=(e,t)=>uU.forEach(e,((e,n)=>i(e,n,t)));return uU.isPlainObject(e)||e instanceof this.constructor?a(e,t):uU.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?a((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&IU[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&i(t,e,n),this}get(e,t){if(e=CU(e)){const n=uU.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(uU.isFunction(t))return t.call(this,e,n);if(uU.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=CU(e)){const n=uU.findKey(this,e);return!(!n||void 0===this[n]||t&&!NU(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=CU(e)){const i=uU.findKey(n,e);!i||t&&!NU(0,n[i],i,t)||(delete n[i],r=!0)}}return uU.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!NU(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return uU.forEach(this,((r,i)=>{const a=uU.findKey(n,i);if(a)return t[a]=MU(r),void delete t[i];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(i):String(i).trim();o!==i&&delete t[i],t[o]=MU(r),n[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return uU.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&uU.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[xU]=this[xU]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=CU(e);t[r]||(!function(e,t){const n=uU.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})}))}(n,e),t[r]=!0)}return uU.isArray(e)?e.forEach(r):r(e),this}}PU.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),uU.freezeMethods(PU.prototype),uU.freezeMethods(PU);var BU=PU;function DU(e,t){const n=this||OU,r=t||n,i=BU.from(r.headers);let a=r.data;return uU.forEach(e,(function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)})),i.normalize(),a}function FU(e){return!(!e||!e.__CANCEL__)}function LU(e,t,n){cU.call(this,null==e?"canceled":e,cU.ERR_CANCELED,t,n),this.name="CanceledError"}uU.inherits(LU,cU,{__CANCEL__:!0});var UU=AU.isStandardBrowserEnv?{write:function(e,t,n,r,i,a){const o=[];o.push(e+"="+encodeURIComponent(t)),uU.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),uU.isString(r)&&o.push("path="+r),uU.isString(i)&&o.push("domain="+i),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function jU(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var qU=AU.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=uU.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function zU(e,t){let n=0;const r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,a=0,o=0;return t=void 0!==t?t:1e3,function(s){const u=Date.now(),c=r[o];i||(i=u),n[a]=s,r[a]=u;let f=o,d=0;for(;f!==a;)d+=n[f++],f%=e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),u-i<t)return;const l=c&&u-c;return l?Math.round(1e3*d/l):void 0}}(50,250);return i=>{const a=i.loaded,o=i.lengthComputable?i.total:void 0,s=a-n,u=r(s);n=a;const c={loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:u||void 0,estimated:u&&o&&a<=o?(o-a)/u:void 0,event:i};c[t?"download":"upload"]=!0,e(c)}}var HU="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const i=BU.from(e.headers).normalize(),a=e.responseType;let o;function s(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}uU.isFormData(r)&&(AU.isStandardBrowserEnv||AU.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let u=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+n))}const c=jU(e.baseURL,e.url);function f(){if(!u)return;const r=BU.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new cU("Request failed with status code "+n.status,[cU.ERR_BAD_REQUEST,cU.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),s()}),(function(e){n(e),s()}),{data:a&&"text"!==a&&"json"!==a?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:r,config:e,request:u}),u=null}if(u.open(e.method.toUpperCase(),_U(c,e.params,e.paramsSerializer),!0),u.timeout=e.timeout,"onloadend"in u?u.onloadend=f:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(f)},u.onabort=function(){u&&(n(new cU("Request aborted",cU.ECONNABORTED,e,u)),u=null)},u.onerror=function(){n(new cU("Network Error",cU.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||TU;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new cU(t,r.clarifyTimeoutError?cU.ETIMEDOUT:cU.ECONNABORTED,e,u)),u=null},AU.isStandardBrowserEnv){const t=(e.withCredentials||qU(c))&&e.xsrfCookieName&&UU.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===r&&i.setContentType(null),"setRequestHeader"in u&&uU.forEach(i.toJSON(),(function(e,t){u.setRequestHeader(t,e)})),uU.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),a&&"json"!==a&&(u.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&u.addEventListener("progress",zU(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",zU(e.onUploadProgress)),(e.cancelToken||e.signal)&&(o=t=>{u&&(n(!t||t.type?new LU(null,e,u):t),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o)));const d=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(c);d&&-1===AU.protocols.indexOf(d)?n(new cU("Unsupported protocol "+d+":",cU.ERR_BAD_REQUEST,e)):u.send(r||null)}))};const VU={http:null,xhr:HU};uU.forEach(VU,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var GU=e=>{e=uU.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let i=0;i<t&&(n=e[i],!(r=uU.isString(n)?VU[n.toLowerCase()]:n));i++);if(!r){if(!1===r)throw new cU(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(uU.hasOwnProp(VU,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`)}if(!uU.isFunction(r))throw new TypeError("adapter is not a function");return r};function KU(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new LU(null,e)}function WU(e){KU(e),e.headers=BU.from(e.headers),e.data=DU.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return GU(e.adapter||OU.adapter)(e).then((function(t){return KU(e),t.data=DU.call(e,e.transformResponse,t),t.headers=BU.from(t.headers),t}),(function(t){return FU(t)||(KU(e),t&&t.response&&(t.response.data=DU.call(e,e.transformResponse,t.response),t.response.headers=BU.from(t.response.headers))),Promise.reject(t)}))}const XU=e=>e instanceof BU?e.toJSON():e;function $U(e,t){t=t||{};const n={};function r(e,t,n){return uU.isPlainObject(e)&&uU.isPlainObject(t)?uU.merge.call({caseless:n},e,t):uU.isPlainObject(t)?uU.merge({},t):uU.isArray(t)?t.slice():t}function i(e,t,n){return uU.isUndefined(t)?uU.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function a(e,t){if(!uU.isUndefined(t))return r(void 0,t)}function o(e,t){return uU.isUndefined(t)?uU.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,i,a){return a in t?r(n,i):a in e?r(void 0,n):void 0}const u={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(e,t)=>i(XU(e),XU(t),!0)};return uU.forEach(Object.keys(Object.assign({},e,t)),(function(r){const a=u[r]||i,o=a(e[r],t[r],r);uU.isUndefined(o)&&a!==s||(n[r]=o)})),n}const JU="1.4.0",YU={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{YU[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const QU={};YU.transitional=function(e,t,n){function r(e,t){return"[Axios v1.4.0] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,a)=>{if(!1===e)throw new cU(r(i," has been removed"+(t?" in "+t:"")),cU.ERR_DEPRECATED);return t&&!QU[i]&&(QU[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,a)}};var ZU={assertOptions:function(e,t,n){if("object"!=typeof e)throw new cU("options must be an object",cU.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const a=r[i],o=t[a];if(o){const t=e[a],n=void 0===t||o(t,a,e);if(!0!==n)throw new cU("option "+a+" must be "+n,cU.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new cU("Unknown option "+a,cU.ERR_BAD_OPTION)}},validators:YU};const ej=ZU.validators;class tj{constructor(e){this.defaults=e,this.interceptors={request:new EU,response:new EU}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=$U(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;let a;void 0!==n&&ZU.assertOptions(n,{silentJSONParsing:ej.transitional(ej.boolean),forcedJSONParsing:ej.transitional(ej.boolean),clarifyTimeoutError:ej.transitional(ej.boolean)},!1),null!=r&&(uU.isFunction(r)?t.paramsSerializer={serialize:r}:ZU.assertOptions(r,{encode:ej.function,serialize:ej.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase(),a=i&&uU.merge(i.common,i[t.method]),a&&uU.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=BU.concat(a,i);const o=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));const u=[];let c;this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)}));let f,d=0;if(!s){const e=[WU.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,u),f=e.length,c=Promise.resolve(t);d<f;)c=c.then(e[d++],e[d++]);return c}f=o.length;let l=t;for(d=0;d<f;){const e=o[d++],t=o[d++];try{l=e(l)}catch(e){t.call(this,e);break}}try{c=WU.call(this,l)}catch(e){return Promise.reject(e)}for(d=0,f=u.length;d<f;)c=c.then(u[d++],u[d++]);return c}getUri(e){return _U(jU((e=$U(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}uU.forEach(["delete","get","head","options"],(function(e){tj.prototype[e]=function(t,n){return this.request($U(n||{},{method:e,url:t,data:(n||{}).data}))}})),uU.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,i){return this.request($U(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}tj.prototype[e]=t(),tj.prototype[e+"Form"]=t(!0)}));var nj=tj;class rj{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,i){n.reason||(n.reason=new LU(e,r,i),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;const t=new rj((function(t){e=t}));return{token:t,cancel:e}}}var ij=rj;const aj={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(aj).forEach((([e,t])=>{aj[t]=e}));var oj=aj;const sj=function e(t){const n=new nj(t),r=xL(nj.prototype.request,n);return uU.extend(r,nj.prototype,n,{allOwnKeys:!0}),uU.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e($U(t,n))},r}(OU);sj.Axios=nj,sj.CanceledError=LU,sj.CancelToken=ij,sj.isCancel=FU,sj.VERSION=JU,sj.toFormData=mU,sj.AxiosError=cU,sj.Cancel=sj.CanceledError,sj.all=function(e){return Promise.all(e)},sj.spread=function(e){return function(t){return e.apply(null,t)}},sj.isAxiosError=function(e){return uU.isObject(e)&&!0===e.isAxiosError},sj.mergeConfig=$U,sj.AxiosHeaders=BU,sj.formToJSON=e=>RU(uU.isHTMLForm(e)?new FormData(e):e),sj.HttpStatusCode=oj,sj.default=sj;var uj=sj;const cj="https://guardian.sandbox.imtbl.com".replace(/\/+$/,"");class fj{basePath;axios;configuration;constructor(e,t=cj,n=uj){this.basePath=t,this.axios=n,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}}class dj extends Error{field;constructor(e,t){super(t),this.field=e,this.name="RequiredError"}}const lj="https://example.com",pj=function(e,t,n){if(null==n)throw new dj(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},hj=async function(e,t){if(t&&t.accessToken){const n="function"==typeof t.accessToken?await t.accessToken():await t.accessToken;e.Authorization="Bearer "+n}};function bj(e,t,n=""){null!=t&&("object"==typeof t?Array.isArray(t)?t.forEach((t=>bj(e,t,n))):Object.keys(t).forEach((r=>bj(e,t[r],`${n}${""!==n?".":""}${r}`))):e.has(n)?e.append(n,t):e.set(n,t))}const mj=function(e,...t){const n=new URLSearchParams(e.search);bj(n,t),e.search=n.toString()},yj=function(e,t,n){const r="string"!=typeof e;return(r&&n&&n.isJsonMime?n.isJsonMime(t.headers["Content-Type"]):r)?JSON.stringify(void 0!==e?e:{}):e||""},gj=function(e){return e.pathname+e.search+e.hash},vj=function(e,t,n,r){return(i=t,a=n)=>{const o={...e.options,url:(r?.basePath||a)+e.url};return i.request(o)}},wj=function(e){const t=function(e){return{approvePendingTransaction:async(t,n,r={})=>{pj("approvePendingTransaction","payloadHash",t),pj("approvePendingTransaction","transactionApprovalRequest",n);const i="/guardian/v1/transactions/{payloadHash}/approve".replace("{payloadHash}",encodeURIComponent(String(t))),a=new URL(i,lj);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...r},u={};await hj(u,e),u["Content-Type"]="application/json",mj(a,{});let c=o&&o.headers?o.headers:{};return s.headers={...u,...c,...r.headers},s.data=yj(n,s,e),{url:gj(a),options:s}},evaluateTransaction:async(t,n,r={})=>{pj("evaluateTransaction","id",t),pj("evaluateTransaction","transactionEvaluationRequest",n);const i="/guardian/v1/transactions/{id}/evaluate".replace("{id}",encodeURIComponent(String(t))),a=new URL(i,lj);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...r},u={};await hj(u,e),u["Content-Type"]="application/json",mj(a,{});let c=o&&o.headers?o.headers:{};return s.headers={...u,...c,...r.headers},s.data=yj(n,s,e),{url:gj(a),options:s}},getTransactionByID:async(t,n,r,i={})=>{pj("getTransactionByID","transactionID",t),pj("getTransactionByID","chainType",n);const a="/guardian/v1/transactions/{transactionID}".replace("{transactionID}",encodeURIComponent(String(t))),o=new URL(a,lj);let s;e&&(s=e.baseOptions);const u={method:"GET",...s,...i},c={},f={};await hj(c,e),void 0!==n&&(f.chainType=n),void 0!==r&&(f.chainID=r),mj(o,f);let d=s&&s.headers?s.headers:{};return u.headers={...c,...d,...i.headers},{url:gj(o),options:u}}}}(e);return{async approvePendingTransaction(n,r,i){const a=await t.approvePendingTransaction(n,r,i);return vj(a,uj,cj,e)},async evaluateTransaction(n,r,i){const a=await t.evaluateTransaction(n,r,i);return vj(a,uj,cj,e)},async getTransactionByID(n,r,i,a){const o=await t.getTransactionByID(n,r,i,a);return vj(o,uj,cj,e)}}};class _j extends fj{approvePendingTransaction(e,t){return wj(this.configuration).approvePendingTransaction(e.payloadHash,e.transactionApprovalRequest,t).then((e=>e(this.axios,this.basePath)))}evaluateTransaction(e,t){return wj(this.configuration).evaluateTransaction(e.id,e.transactionEvaluationRequest,t).then((e=>e(this.axios,this.basePath)))}getTransactionByID(e,t){return wj(this.configuration).getTransactionByID(e.transactionID,e.chainType,e.chainID,t).then((e=>e(this.axios,this.basePath)))}}class Ej{apiKey;username;password;accessToken;basePath;baseOptions;formDataCtor;constructor(e={}){this.apiKey=e.apiKey,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.baseOptions=e.baseOptions,this.formDataCtor=e.formDataCtor}isJsonMime(e){const t=new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$","i");return null!==e&&(t.test(e)||"application/json-patch+json"===e.toLowerCase())}}const Tj="starkex",Aj="evm";function Rj(e){const t=-1!==new Fn(e,16).cmp(new Fn(27))?new Fn(e,16).sub(new Fn(27)).toNumber():new Fn(e,16).toNumber();return e.trim()?t:void 0}async function Sj(e,t){const n=function(e,t=64){const n=nm(e);return{r:new Fn(n.substring(0,t),"hex"),s:new Fn(n.substring(t,2*t),"hex"),recoveryParam:Rj(n.substring(2*t,2*t+2))}}(await t.signMessage(e));return im(em((r=n).r.toString(16),64)+em(r.s.toString(16),64)+em(r.recoveryParam?.toString(16)||"",2));var r}function kj(e){switch(e.type){case"ERC721":return{type:"ERC721",data:{token_id:e.tokenId,token_address:e.tokenAddress}};case"ERC20":return{type:"ERC20",data:{token_address:e.tokenAddress}};default:return{type:"ETH",data:{decimals:18}}}}const Oj={erc1271:Object.freeze({__proto__:null,abi:[{type:"function",name:"isValidSignature",constant:!0,inputs:[{type:"bytes32"},{type:"bytes"}],outputs:[{type:"bytes4"}],payable:!1,stateMutability:"view"}],returns:{isValidSignatureBytes32:"0x1626ba7e"}}),factory:Object.freeze({__proto__:null,abi:[{type:"function",name:"deploy",constant:!1,inputs:[{type:"address"},{type:"bytes32"}],outputs:[],payable:!0,stateMutability:"payable"}]}),mainModule:Object.freeze({__proto__:null,abi:[{type:"function",name:"nonce",constant:!0,inputs:[],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"readNonce",constant:!0,inputs:[{type:"uint256"}],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"updateImplementation",constant:!1,inputs:[{type:"address"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"selfExecute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"execute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"},{type:"uint256"},{type:"bytes"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"createContract",inputs:[{type:"bytes"}],payable:!0,stateMutability:"payable"}]}),mainModuleUpgradable:Object.freeze({__proto__:null,abi:[{type:"function",name:"updateImageHash",constant:!0,inputs:[{type:"bytes32"}],outputs:[],payable:!1,stateMutability:"view"},{type:"function",name:"imageHash",constant:!0,inputs:[],outputs:[{type:"bytes32"}],payable:!1,stateMutability:"view"}]}),sequenceUtils:Object.freeze({__proto__:null,abi:[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_mainModule",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"bytes32",name:"_imageHash",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"_threshold",type:"uint256"},{indexed:!1,internalType:"bytes",name:"_signers",type:"bytes"}],name:"RequiredConfig",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"address",name:"_signer",type:"address"}],name:"RequiredSigner",type:"event"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callBalanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callBlockNumber",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_i",type:"uint256"}],name:"callBlockhash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"callChainId",outputs:[{internalType:"uint256",name:"id",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCode",outputs:[{internalType:"bytes",name:"code",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeHash",outputs:[{internalType:"bytes32",name:"codeHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeSize",outputs:[{internalType:"uint256",name:"size",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callCoinbase",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callDifficulty",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLeft",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLimit",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callOrigin",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callTimestamp",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"knownImageHashes",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"lastImageHashUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastSignerUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastWalletUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"bool",name:"delegateCall",type:"bool"},{internalType:"bool",name:"revertOnError",type:"bool"},{internalType:"uint256",name:"gasLimit",type:"uint256"},{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],internalType:"struct IModuleCalls.Transaction[]",name:"_txs",type:"tuple[]"}],name:"multiCall",outputs:[{internalType:"bool[]",name:"_successes",type:"bool[]"},{internalType:"bytes[]",name:"_results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_threshold",type:"uint256"},{components:[{internalType:"uint256",name:"weight",type:"uint256"},{internalType:"address",name:"signer",type:"address"}],internalType:"struct RequireUtils.Member[]",name:"_members",type:"tuple[]"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishConfig",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"uint256",name:"_sizeMembers",type:"uint256"},{internalType:"bytes",name:"_signature",type:"bytes"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishInitialSigners",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_nonce",type:"uint256"}],name:"requireMinNonce",outputs:[],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_expiration",type:"uint256"}],name:"requireNonExpired",outputs:[],stateMutability:"view",type:"function"}]}),requireFreshSigner:Object.freeze({__proto__:null,abi:[{inputs:[{internalType:"address",name:"",type:"address"}],name:"requireFreshSigner",outputs:[],stateMutability:"nonpayable",type:"function"}]})};function Ij(){return Ij=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ij.apply(this,arguments)}var xj;!function(e){e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.DISABLED=5]="DISABLED"}(xj||(xj={}));function Cj(e,t){return function(...n){const r=Array.prototype.slice.call(n);return new Promise((async(n,i)=>{try{r.push(((e,t)=>e?i(e):n(t))),await e.apply(t,r)}catch(e){i(e)}}))}}new class{constructor(e){this.config=e,this.logLevel=void 0,this.configure(e)}configure(e){switch(this.config=Ij({},this.config,e),this.config.logLevel){case"DEBUG":this.logLevel=xj.DEBUG;break;case"INFO":default:this.logLevel=xj.INFO;break;case"WARN":this.logLevel=xj.WARN;break;case"ERROR":this.logLevel=xj.ERROR;break;case"DISABLED":this.logLevel=xj.DISABLED}void 0===this.config.silence&&(this.config.silence=!1)}debug(e,...t){!0!==this.config.silence&&this.logLevel===xj.DEBUG&&console.log(e,...t)}info(e,...t){!0!==this.config.silence&&this.logLevel<=xj.INFO&&console.log(e,...t)}warn(e,...t){!0!==this.config.silence&&this.logLevel<=xj.WARN&&(console.warn(e,...t),this.config.onwarn&&this.config.onwarn(e,t))}error(e,...t){!0!==this.config.silence&&this.logLevel<=xj.ERROR&&(console.error(e,...t),this.config.onerror&&this.config.onerror(e,t))}}({logLevel:"INFO",silence:!0});const Mj=(e=0,t=Number.MAX_SAFE_INTEGER)=>(e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e);function Nj(){return Nj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nj.apply(this,arguments)}const Pj=(e,t=!1)=>(((e,t=!1,n=!1)=>{if(!e)throw new Error("invalid network config: empty config");const r=[];if(Array.isArray(e)?r.push(...e):r.push(e),0===r.length){if(t)throw new Error("invalid network config: empty config");return!1}const i=r.map((e=>e.chainId)).sort(),a=i.filter(((e,t)=>i.indexOf(e)!==t));if(a.length>0){if(t)throw new Error(`invalid network config: duplicate chainIds ${a}`);return!1}r.forEach((e=>e.name=e.name.toLowerCase()));const o=r.map((e=>e.name)).sort(),s=o.filter(((e,t)=>o.indexOf(e)!==t));if(s.length>0){if(t)throw new Error(`invalid network config: duplicate network names ${s}`);return!1}let u=!1,c=!1;for(let e=0;e<r.length;e++){const i=r[e];if(!(i.rpcUrl&&""!==i.rpcUrl||i.provider)){if(t)throw new Error(`invalid network config for chainId ${i.chainId}: rpcUrl or provider must be provided`);return!1}if(!n&&!i.relayer){if(t)throw new Error(`invalid network config for chainId ${i.chainId}: relayer must be provided`);return!1}if(i.isDefaultChain){if(u){if(t)throw new Error(`invalid network config for chainId ${i.chainId}: DefaultChain is already set by another config`);return!1}u=!0}if(i.isAuthChain){if(c&&t)throw new Error(`invalid network config for chainId ${i.chainId}: AuthChain is already set by another config`);c=!0}}if(!u){if(t)throw new Error("invalid network config: DefaultChain must be set");return!1}if(!c){if(t)throw new Error("invalid network config: AuthChain must be set");return!1}})(e,!0,t),e),Bj=e=>Pj(Dj(e)),Dj=e=>{if(!e)return[];const t=e.sort(((e,t)=>e.chainId===t.chainId?0:e.chainId<t.chainId?-1:1)),n=t.findIndex((e=>e.isDefaultChain));n>0&&t.splice(0,0,t.splice(n,1)[0]);const r=t.findIndex((e=>e.isAuthChain&&!0!==e.isDefaultChain));return r>0&&t.splice(1,0,t.splice(r,1)[0]),t},Fj=(e,t)=>"string"==typeof e?(t=t||{},e.replace(/\$\{\s*([$#@\-\d\w]+)\s*\}/gim,(function(e,n){let r=t[n];return r="function"==typeof r?r():null==r?"":"object"==typeof r||"symbol"==typeof r?r.toString():r.valueOf(),r}))):"";let Lj;!function(e){e[e.MAINNET=1]="MAINNET",e[e.ROPSTEN=3]="ROPSTEN",e[e.RINKEBY=4]="RINKEBY",e[e.GOERLI=5]="GOERLI",e[e.KOVAN=42]="KOVAN",e[e.POLYGON=137]="POLYGON",e[e.POLYGON_MUMBAI=80001]="POLYGON_MUMBAI",e[e.POLYGON_ZKEVM=1101]="POLYGON_ZKEVM",e[e.BSC=56]="BSC",e[e.BSC_TESTNET=97]="BSC_TESTNET",e[e.OPTIMISM=10]="OPTIMISM",e[e.OPTIMISM_TESTNET=69]="OPTIMISM_TESTNET",e[e.ARBITRUM=42161]="ARBITRUM",e[e.ARBITRUM_GOERLI=421613]="ARBITRUM_GOERLI",e[e.ARBITRUM_NOVA=42170]="ARBITRUM_NOVA",e[e.AVALANCHE=43114]="AVALANCHE",e[e.AVALANCHE_TESTNET=43113]="AVALANCHE_TESTNET",e[e.FANTOM=250]="FANTOM",e[e.FANTOM_TESTNET=4002]="FANTOM_TESTNET",e[e.GNOSIS=100]="GNOSIS",e[e.AURORA=1313161554]="AURORA",e[e.AURORA_TESTNET=1313161556]="AURORA_TESTNET",e[e.BASE_GOERLI=84531]="BASE_GOERLI"}(Lj||(Lj={}));const Uj=e=>Fj("https://${network}-indexer.sequence.app",{network:e}),jj=e=>Fj("https://${network}-relayer.sequence.app",{network:e}),qj=e=>Fj("https://nodes.sequence.app/${network}",{network:e}),zj={[Lj.MAINNET]:{chainId:Lj.MAINNET,name:"mainnet",title:"Ethereum",blockExplorer:{name:"Etherscan",rootUrl:"https://etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},[Lj.ROPSTEN]:{chainId:Lj.ROPSTEN,name:"ropsten",title:"Ropsten",testnet:!0,blockExplorer:{name:"Etherscan (Ropsten)",rootUrl:"https://ropsten.etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},[Lj.RINKEBY]:{chainId:Lj.RINKEBY,name:"rinkeby",title:"Rinkeby",testnet:!0,blockExplorer:{name:"Etherscan (Rinkeby)",rootUrl:"https://rinkeby.etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",disabled:!0},[Lj.GOERLI]:{chainId:Lj.GOERLI,name:"goerli",title:"Goerli",testnet:!0,blockExplorer:{name:"Etherscan (Goerli)",rootUrl:"https://goerli.etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},[Lj.KOVAN]:{chainId:Lj.KOVAN,name:"kovan",title:"Kovan",testnet:!0,blockExplorer:{name:"Etherscan (Kovan)",rootUrl:"https://kovan.etherscan.io/"}},[Lj.POLYGON]:{chainId:Lj.POLYGON,name:"polygon",title:"Polygon",blockExplorer:{name:"Polygonscan",rootUrl:"https://polygonscan.com/"}},[Lj.POLYGON_MUMBAI]:{chainId:Lj.POLYGON_MUMBAI,name:"mumbai",title:"Polygon Mumbai",testnet:!0,blockExplorer:{name:"Polygonscan (Mumbai)",rootUrl:"https://mumbai.polygonscan.com/"}},[Lj.POLYGON_ZKEVM]:{chainId:Lj.POLYGON_ZKEVM,name:"polygon-zkevm",title:"Polygon zkEVM",blockExplorer:{name:"Polygonscan (zkEVM)",rootUrl:"https://zkevm.polygonscan.com/"}},[Lj.BSC]:{chainId:Lj.BSC,name:"bsc",title:"BNB Smart Chain",blockExplorer:{name:"BSCScan",rootUrl:"https://bscscan.com/"}},[Lj.BSC_TESTNET]:{chainId:Lj.BSC_TESTNET,name:"bsc-testnet",title:"BNB Smart Chain Testnet",testnet:!0,blockExplorer:{name:"BSCScan (Testnet)",rootUrl:"https://testnet.bscscan.com/"}},[Lj.OPTIMISM]:{chainId:Lj.OPTIMISM,name:"optimism",title:"Optimism",blockExplorer:{name:"Etherscan (Optimism)",rootUrl:"https://optimistic.etherscan.io/"}},[Lj.OPTIMISM_TESTNET]:{chainId:Lj.OPTIMISM_TESTNET,name:"optimism-testnet",title:"Optimistic Kovan",testnet:!0,blockExplorer:{name:"Etherscan (Optimism Testnet)",rootUrl:"https://kovan-optimistic.etherscan.io/"}},[Lj.ARBITRUM]:{chainId:Lj.ARBITRUM,name:"arbitrum",title:"Arbitrum One",blockExplorer:{name:"Arbiscan",rootUrl:"https://arbiscan.io/"}},[Lj.ARBITRUM_GOERLI]:{chainId:Lj.ARBITRUM_GOERLI,name:"arbitrum-goerli",title:"Arbitrum Goerli",testnet:!0,blockExplorer:{name:"Arbiscan (Testnet)",rootUrl:"https://testnet.arbiscan.io/"}},[Lj.ARBITRUM_NOVA]:{chainId:Lj.ARBITRUM_NOVA,name:"arbitrum-nova",title:"Arbitrum Nova",blockExplorer:{name:"Nova Explorer",rootUrl:"https://nova-explorer.arbitrum.io/"}},[Lj.AVALANCHE]:{chainId:Lj.AVALANCHE,name:"avalanche",title:"Avalanche",blockExplorer:{name:"Snowtrace",rootUrl:"https://snowtrace.io/"}},[Lj.AVALANCHE_TESTNET]:{chainId:Lj.AVALANCHE_TESTNET,name:"avalanche-testnet",title:"Avalanche Testnet",testnet:!0,blockExplorer:{name:"Snowtrace (Testnet)",rootUrl:"https://testnet.snowtrace.io/"}},[Lj.FANTOM]:{chainId:Lj.FANTOM,name:"fantom",title:"Fantom",blockExplorer:{name:"FTMScan",rootUrl:"https://ftmscan.com/"}},[Lj.FANTOM_TESTNET]:{chainId:Lj.FANTOM_TESTNET,name:"fantom-testnet",title:"Fantom Testnet",testnet:!0,blockExplorer:{name:"FTMScan (Testnet)",rootUrl:"https://testnet.ftmscan.com/"}},[Lj.GNOSIS]:{chainId:Lj.GNOSIS,name:"gnosis",title:"Gnosis Chain",blockExplorer:{name:"Gnosis Chain Explorer",rootUrl:"https://blockscout.com/xdai/mainnet/"}},[Lj.AURORA]:{chainId:Lj.AURORA,name:"aurora",title:"Aurora",blockExplorer:{name:"Aurora Explorer",rootUrl:"https://aurorascan.dev/"}},[Lj.AURORA_TESTNET]:{chainId:Lj.AURORA_TESTNET,name:"aurora-testnet",title:"Aurora Testnet",blockExplorer:{name:"Aurora Explorer (Testnet)",rootUrl:"https://testnet.aurorascan.dev/"}},[Lj.BASE_GOERLI]:{chainId:Lj.BASE_GOERLI,name:"base-goerli",title:"Base Goerli",blockExplorer:{name:"Base Goerli Explorer",rootUrl:"https://goerli.basescan.org/"}}};Bj([Nj({},zj[Lj.MAINNET],{rpcUrl:qj("mainnet"),relayer:{url:jj("mainnet")},indexerUrl:Uj("mainnet")}),Nj({},zj[Lj.POLYGON],{rpcUrl:qj("polygon"),relayer:{url:jj("polygon")},indexerUrl:Uj("polygon"),isDefaultChain:!0,isAuthChain:!0}),Nj({},zj[Lj.BSC],{rpcUrl:qj("bsc"),indexerUrl:Uj("bsc"),relayer:{url:jj("bsc")}}),Nj({},zj[Lj.AVALANCHE],{rpcUrl:qj("avalanche"),indexerUrl:Uj("avalanche"),relayer:{url:jj("avalanche")}}),Nj({},zj[Lj.ARBITRUM],{rpcUrl:qj("arbitrum"),indexerUrl:Uj("arbitrum"),relayer:{url:jj("arbitrum")}}),Nj({},zj[Lj.ARBITRUM_NOVA],{rpcUrl:qj("arbitrum-nova"),indexerUrl:Uj("arbitrum-nova"),relayer:{url:jj("arbitrum-nova")}}),Nj({},zj[Lj.OPTIMISM],{rpcUrl:qj("optimism"),indexerUrl:Uj("optimism"),relayer:{url:jj("optimism")}}),Nj({},zj[Lj.POLYGON_ZKEVM],{rpcUrl:qj("polygon-zkevm"),indexerUrl:Uj("polygon-zkevm"),relayer:{url:jj("polygon-zkevm")}}),Nj({},zj[Lj.GNOSIS],{rpcUrl:qj("gnosis"),indexerUrl:Uj("gnosis"),relayer:{url:jj("gnosis")}})]),Bj([Nj({},zj[Lj.RINKEBY],{rpcUrl:qj("rinkeby"),relayer:{url:jj("rinkeby")},indexerUrl:Uj("rinkeby")}),Nj({},zj[Lj.GOERLI],{rpcUrl:qj("goerli"),relayer:{url:jj("goerli")},indexerUrl:Uj("goerli")}),Nj({},zj[Lj.POLYGON_MUMBAI],{rpcUrl:qj("mumbai"),relayer:{url:jj("mumbai")},indexerUrl:Uj("mumbai"),isDefaultChain:!0,isAuthChain:!0}),Nj({},zj[Lj.BSC_TESTNET],{rpcUrl:qj("bsc-testnet"),relayer:{url:jj("bsc-testnet")},indexerUrl:Uj("bsc-testnet")}),Nj({},zj[Lj.ARBITRUM_GOERLI],{rpcUrl:qj("arbitrum-goerli"),relayer:{url:jj("arbitrum-goerli")},indexerUrl:Uj("arbitrum-goerli")}),Nj({},zj[Lj.BASE_GOERLI],{rpcUrl:qj("base-goerli"),relayer:{url:jj("base-goerli")},indexerUrl:Uj("base-goerli")})]);const Hj="2.0";function Vj(){return Vj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vj.apply(this,arguments)}let Gj;function Kj(e,t){return e.reduce((function(e,n,r){return t(n,r)?e[0].push(n):e[1].push(n),e}),[[],[]])}!function(e){e.ethCall="eth_call",e.ethGetBalance="eth_getBalance",e.ethGetCode="eth_getCode"}(Gj||(Gj={}));const Wj={batchSize:50,timeWindow:50,contract:"0xd130B43062D875a4B7aF3f8fc036Bc6e9D3E1B3E",verbose:!1};let Xj=class e{constructor(t){var n=this;if(this.batchableJsonRpcMethods=[Gj.ethCall,Gj.ethGetCode,Gj.ethGetBalance],this.multicallInterface=new os(Oj.sequenceUtils.abi),this.options=void 0,this.timeout=void 0,this.queue=[],this.scheduleExecution=()=>{this.queue.length>0&&(this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(this.run,this.options.timeWindow))},this.handle=(e,t,n)=>this.batchableJsonRpcMethods.find((e=>e===t.method))?(this.queue.push({request:t,callback:n,next:e}),this.options.verbose&&console.log("Scheduling call",t.method),void this.scheduleExecution()):(this.options.verbose&&console.log("Forwarded call",t.method),e(t,n)),this.run=async function(){n.options.verbose&&console.log("Processing multicall");const e=Math.min(n.options.batchSize,n.queue.length);if(0===e)return;if(1===e)return n.forward(n.queue[0]),n.queue=[],void(n.options.verbose&&console.log("Skip multicall, single item"));n.options.verbose&&console.log("Resolving",e);var t=n.queue.slice(0,e);n.queue=e===n.queue.length?[]:n.queue.slice(e),n.options.verbose&&console.log("Updated queue",n.queue.length),0!==n.queue.length&&n.scheduleExecution();const r=t[0].next;let i;var[t,a]=Kj(t,(e=>{try{if(e.next!==r)return!1;switch(e.request.method){case Gj.ethCall:if(e.request.params[0].from||e.request.params[0].gasPrice||e.request.params[0].value)return!1;case Gj.ethGetBalance:case Gj.ethGetCode:const t=function(e){if(void 0===e)return"latest";switch(e){case"earliest":case"latest":case"pending":return e}return Tr.from(e)}(e.request.params[1]);if(void 0===i&&(i=t),!function(e,t){return e===t||(Tr.isBigNumber(e)?!!Tr.isBigNumber(t)&&e.eq(t):!Tr.isBigNumber(t)&&e===t)}(t,i))return!1}return!0}catch(e){return!1}}));if(0!==a.length&&(n.options.verbose&&console.log("Forwarding incompatible calls",a.length),n.forward(a),0===t.length))return;let o=t.map((e=>{try{switch(e.request.method){case Gj.ethCall:return{delegateCall:!1,revertOnError:!1,target:e.request.params[0].to,data:e.request.params[0].data,gasLimit:e.request.params[0].gas?e.request.params[0].gas:0,value:0};case Gj.ethGetCode:return{delegateCall:!1,revertOnError:!1,target:n.options.contract,gasLimit:0,value:0,data:n.multicallInterface.encodeFunctionData(n.multicallInterface.getFunction("callCode"),[e.request.params[0]])};case Gj.ethGetBalance:return{delegateCall:!1,revertOnError:!1,target:n.options.contract,gasLimit:0,value:0,data:n.multicallInterface.encodeFunctionData(n.multicallInterface.getFunction("callBalanceOf"),[e.request.params[0]])};default:return null}}catch(e){return null}}));var[t,a]=Kj(t,((e,t)=>void 0!==o[t]));if(o=o.filter((e=>e)),0!==a.length&&(n.options.verbose&&console.log("Forwarding calls on error",a.length),n.forward(a),0===t.length))return;let s;try{s=n.multicallInterface.encodeFunctionData(n.multicallInterface.getFunction("multiCall"),[o])}catch(e){return void n.forward(t)}const u=Mj(),c=await async function(e,t){try{return await e}catch(e){return t instanceof Function?t(e):t}}(Cj(r)({id:u,jsonrpc:Hj,method:Gj.ethCall,params:[{to:n.options.contract,value:0,data:s},Tr.isBigNumber(i)?i.toNumber():i]}),(e=>({jsonrpc:Hj,id:u,result:void 0,error:e})));if(c.error)return n.forward(t);let f;try{f=n.multicallInterface.decodeFunctionResult(n.multicallInterface.getFunction("multiCall"),c.result)}catch(e){return void n.forward(t)}n.options.verbose&&console.log("Got response for",t.length),t.forEach(((e,t)=>{if(f[0][t])switch(e.request.method){case Gj.ethCall:e.callback(void 0,{jsonrpc:e.request.jsonrpc,id:e.request.id,result:f[1][t]});break;case Gj.ethGetCode:e.callback(void 0,{jsonrpc:e.request.jsonrpc,id:e.request.id,result:Za.decode(["bytes"],f[1][t])[0]});break;case Gj.ethGetBalance:e.callback(void 0,{jsonrpc:e.request.jsonrpc,id:e.request.id,result:Za.decode(["uint256"],f[1][t])[0]})}else n.forward(e)}))},this.options=t?Vj({},e.DefaultOptions,t):e.DefaultOptions,this.options.batchSize<=0)throw new Error(`Invalid batch size of ${this.options.batchSize}`)}forward(e){Array.isArray(e)?e.forEach((e=>e.next(e.request,e.callback))):e.next(e.request,e.callback)}static isMulticall(t){return t&&void 0!==t.handle&&void 0!==t.conf&&e.isMulticallOptions(t.options)}static isMulticallOptions(e){return void 0!==e&&void 0!==e.batchSize&&void 0!==e.timeWindow&&void 0!==e.contract}};Xj.DefaultOptions=Vj({},Wj);const $j=["getNetwork","getBlockNumber","getGasPrice","getTransactionCount","getStorageAt","sendTransaction","estimateGas","getBlock","getTransaction","getTransactionReceipt","getLogs","emit","litenerCount","addListener","removeListener","waitForTransaction","detectNetwork","getBlockWithTransactions"];var Jj=Object.freeze({__proto__:null,ProxyMethods:$j,MulticallProvider:class extends gp{constructor(e,t){var n;super(e.getNetwork()),n=this,this.provider=e,this.multicall=void 0,this.listenerCount=this.provider.listenerCount,this.getResolver=async function(e){const t=n.provider;if(t.getResolver){const r=await t.getResolver(await e);return r?new bp(n,r.address,r.name):null}return t.getResolver(await e)},this.next=async function(e,t){try{switch(e.method){case Gj.ethCall:n.callback(e,t,await n.provider.call(e.params[0],e.params[1]));break;case Gj.ethGetCode:n.callback(e,t,await n.provider.getCode(e.params[0],e.params[1]));break;case Gj.ethGetBalance:n.callback(e,t,await n.provider.getBalance(e.params[0],e.params[1]))}}catch(r){n.callback(e,t,void 0,r)}},this.multicall=Xj.isMulticall(t)?t:new Xj(t),$j.forEach((t=>{void 0!==e[t]&&(this[t]=(...n)=>e[t](...n))}))}callback(e,t,n,r){t(r,{jsonrpc:Hj,id:e.id,result:n,error:r})}async call(e,t){return this.rpcCall(Gj.ethCall,e,t)}async getCode(e,t){return this.rpcCall(Gj.ethGetCode,e,t)}async getBalance(e,t){return this.rpcCall(Gj.ethGetBalance,e,t)}async rpcCall(e,...t){const n=Mj();return(await Cj(this.multicall.handle)(this.next,{jsonrpc:Hj,id:n,method:e,params:t})).result}},MulticallExternalProvider:class{constructor(e,t){if(this.provider=e,this.multicall=void 0,this.multicall=Xj.isMulticall(t)?t:new Xj(t),e.send){const t=async function(t,n){e.send(t,n)};this.send=(e,n)=>{this.multicall.handle(t,e,n)}}if(e.sendAsync){const t=async function(t,n){e.sendAsync(t,n)};this.sendAsync=(e,n)=>{this.multicall.handle(t,e,n)}}}get isMetaMask(){return this.provider.isMetaMask}get isStatus(){return this.provider.isStatus}},multicallMiddleware:e=>t=>{const n=Xj.isMulticall(e)?e:new Xj(e);return(e,r)=>n.handle(t,e,r)}}),Yj=Object.freeze({__proto__:null,Multicall:Xj,providers:Jj});let Qj,Zj;try{Qj=localStorage}catch(e){const t=new Map;Qj={getItem:e=>{var n;return null!=(n=t.get(e))?n:null},setItem:(e,n)=>t.set(e,n),removeItem:e=>t.delete(e)}}function eq(e){return void 0!==e.address&&!function(e){return tq(e)||nq(e)||rq(e)}(e)}function tq(e){const t=e;return void 0!==t.signature&&void 0===t.address}function nq(e){const t=e;return void 0!==t.r&&void 0!==t.s&&void 0!==t.v&&void 0!==t.t}function rq(e){const t=e;return void 0!==t.address&&void 0!==t.signature}!function(e){e[e.EOA=0]="EOA",e[e.Address=1]="Address",e[e.Full=2]="Full"}(Zj||(Zj={}));const iq=e=>{if("string"==typeof e)return iq((e=>{if("string"!=typeof e)return e;const t=e.replace("0x",""),n=Tr.from(`0x${t.slice(0,4)}`).toNumber(),r=[];for(let e=4;e<t.length;){const n=Tr.from(t.slice(e,e+2)).toNumber();e+=2;const i=Tr.from(`0x${t.slice(e,e+2)}`).toNumber();switch(e+=2,n){case Zj.Address:const n=Ki(t.slice(e,e+40));e+=40,r.push({weight:i,address:n});break;case Zj.EOA:const a=tr(`0x${t.slice(e,e+132)}`);e+=132;const o=hr(a.slice(0,65)),s=o.r,u=o.s,c=o.v,f=Tr.from(a[a.length-1]).toNumber();r.push({weight:i,signature:a,r:s,s:u,v:c,t:f});break;case Zj.Full:const d=Ki(t.slice(e,e+40));e+=40;const l=Tr.from(`0x${t.slice(e,e+4)}`).mul(2).toNumber();e+=4;const p=tr(`0x${t.slice(e,e+l)}`);e+=l,r.push({weight:i,address:d,signature:p});break;default:throw Error("Signature type not supported")}}return{threshold:n,signers:r}})(e));const t=e.signers.map((e=>{if(eq(e))return Hh(["uint8","uint8","address"],[Zj.Address,e.weight,e.address]);if(nq(e))return Hh(["uint8","uint8","bytes32","bytes32","uint8","uint8"],[Zj.EOA,e.weight,e.r,e.s,e.v,e.t]);if(rq(e)){const t=tr(e.signature).length;return Hh(["uint8","uint8","address","uint16","bytes"],[Zj.Full,e.weight,e.address,t,e.signature])}if(tq(e))return Hh(["uint8","uint8","bytes"],[Zj.EOA,e.weight,e.signature]);throw Error("Unkwnown signature part type")}));return Hh(["uint16",...Array(t.length).fill("bytes")],[e.threshold,...t])};var aq;!function(e){e.AUTHENTICATION_ERROR="AUTHENTICATION_ERROR",e.INVALID_CONFIGURATION="INVALID_CONFIGURATION",e.WALLET_CONNECTION_ERROR="WALLET_CONNECTION_ERROR",e.NOT_LOGGED_IN_ERROR="NOT_LOGGED_IN_ERROR",e.SILENT_LOGIN_ERROR="SILENT_LOGIN_ERROR",e.REFRESH_TOKEN_ERROR="REFRESH_TOKEN_ERROR",e.USER_REGISTRATION_ERROR="USER_REGISTRATION_ERROR",e.LOGOUT_ERROR="LOGOUT_ERROR",e.TRANSFER_ERROR="TRANSFER_ERROR",e.CREATE_ORDER_ERROR="CREATE_ORDER_ERROR",e.CANCEL_ORDER_ERROR="CANCEL_ORDER_ERROR",e.EXCHANGE_TRANSFER_ERROR="EXCHANGE_TRANSFER_ERROR",e.CREATE_TRADE_ERROR="CREATE_TRADE_ERROR",e.OPERATION_NOT_SUPPORTED_ERROR="OPERATION_NOT_SUPPORTED_ERROR"}(aq||(aq={}));class oq extends Error{type;constructor(e,t){super(e),this.type=t}}const sq=async(e,t)=>{try{return await e()}catch(e){const n=`${t}: ${e.message}`||"UnknownError";throw new oq(n,t)}},uq="passport_credentials",cq="pkce_state",fq="pkce_verifier";class dq{saveCredentials(e){if(!this.areValid(e))throw Error("Invalid credentials.");localStorage.setItem(uq,JSON.stringify(e))}getCredentials(){const e=localStorage.getItem(uq);return e?JSON.parse(e):null}areValid(e){if(e){const t=this.isTokenValid(e.access_token),n=this.isTokenValid(e.id_token);return t&&n}return!1}isTokenValid(e){try{const t=zP(e).exp??0;return t>Date.now()/1e3+3600}catch(e){return!1}}clearCredentials(){localStorage.removeItem(uq)}savePKCEData(e){localStorage.setItem(cq,e.state),localStorage.setItem(fq,e.verifier)}getPKCEData(){const e=localStorage.getItem(cq),t=localStorage.getItem(fq);return e&&t?{state:e,verifier:t}:null}}const lq={headers:{"Content-Type":"application/x-www-form-urlencoded"}};function pq(e){return new Promise((t=>{setTimeout(t,e)}))}class hq{userManager;config;deviceCredentialsManager;logoutMode;constructor(e){this.config=e,this.userManager=new class{constructor(e){this._logger=new XP("UserManager"),this.settings=new EB(e),this._client=new class{constructor(e){this._logger=new XP("OidcClient"),this.settings=new sB(e),this.metadataService=new class{constructor(e){this._settings=e,this._logger=new XP("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new aB(["application/jwk-set+json"],null,this._settings.extraHeaders),this._settings.signingKeys&&(this._logger.debug("using signingKeys from settings"),this._signingKeys=this._settings.signingKeys),this._settings.metadata&&(this._logger.debug("using metadata from settings"),this._metadata=this._settings.metadata),this._settings.fetchRequestCredentials&&(this._logger.debug("using fetchRequestCredentials from settings"),this._fetchRequestCredentials=this._settings.fetchRequestCredentials)}resetSigningKeys(){this._signingKeys=null}async getMetadata(){const e=this._logger.create("getMetadata");if(this._metadata)return e.debug("using cached values"),this._metadata;if(!this._metadataUrl)throw e.throw(new Error("No authority or metadataUrl configured on settings")),null;e.debug("getting metadata from",this._metadataUrl);const t=await this._jsonService.getJson(this._metadataUrl,{credentials:this._fetchRequestCredentials});return e.debug("merging remote JSON with seed metadata"),this._metadata=Object.assign({},this._settings.metadataSeed,t),this._metadata}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(e=!0){return this._getMetadataProperty("token_endpoint",e)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(e=!0){return this._getMetadataProperty("revocation_endpoint",e)}getKeysEndpoint(e=!0){return this._getMetadataProperty("jwks_uri",e)}async _getMetadataProperty(e,t=!1){const n=this._logger.create(`_getMetadataProperty('${e}')`),r=await this.getMetadata();if(n.debug("resolved"),void 0===r[e]){if(!0===t)return void n.warn("Metadata does not contain optional property");n.throw(new Error("Metadata does not contain property "+e))}return r[e]}async getSigningKeys(){const e=this._logger.create("getSigningKeys");if(this._signingKeys)return e.debug("returning signingKeys from cache"),this._signingKeys;const t=await this.getKeysEndpoint(!1);e.debug("got jwks_uri",t);const n=await this._jsonService.getJson(t);if(e.debug("got key set",n),!Array.isArray(n.keys))throw e.throw(new Error("Missing keys on keyset")),null;return this._signingKeys=n.keys,this._signingKeys}}(this.settings),this._claimsService=new class{constructor(e){this._settings=e,this._logger=new XP("ClaimsService")}filterProtocolClaims(e){const t={...e};if(this._settings.filterProtocolClaims){let e;e=Array.isArray(this._settings.filterProtocolClaims)?this._settings.filterProtocolClaims:lB;for(const n of e)pB.includes(n)||delete t[n]}return t}mergeClaims(e,t){const n={...e};for(const[e,r]of Object.entries(t))for(const t of Array.isArray(r)?r:[r]){const r=n[e];r?Array.isArray(r)?r.includes(t)||r.push(t):n[e]!==t&&("object"==typeof t&&this._settings.mergeClaims?n[e]=this.mergeClaims(r,t):n[e]=[r,t]):n[e]=t}return n}}(this.settings),this._validator=new class{constructor(e,t,n){this._settings=e,this._metadataService=t,this._claimsService=n,this._logger=new XP("ResponseValidator"),this._userInfoService=new class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new XP("UserInfoService"),this._getClaimsFromJwt=async e=>{const t=this._logger.create("_getClaimsFromJwt");try{const n=YP.decode(e);return t.debug("JWT decoding successful"),n}catch(e){throw t.error("Error parsing JWT response"),e}},this._jsonService=new aB(void 0,this._getClaimsFromJwt,this._settings.extraHeaders)}async getClaims(e){const t=this._logger.create("getClaims");e||this._logger.throw(new Error("No token passed"));const n=await this._metadataService.getUserInfoEndpoint();t.debug("got userinfo url",n);const r=await this._jsonService.getJson(n,{token:e,credentials:this._settings.fetchRequestCredentials});return t.debug("got claims",r),r}}(this._settings,this._metadataService),this._tokenClient=new uB(this._settings,this._metadataService)}async validateSigninResponse(e,t){const n=this._logger.create("validateSigninResponse");this._processSigninState(e,t),n.debug("state processed"),await this._processCode(e,t),n.debug("code processed"),e.isOpenId&&this._validateIdTokenAttributes(e),n.debug("tokens validated"),await this._processClaims(e,null==t?void 0:t.skipUserInfo,e.isOpenId),n.debug("claims processed")}async validateCredentialsResponse(e,t){const n=this._logger.create("validateCredentialsResponse");e.isOpenId&&this._validateIdTokenAttributes(e),n.debug("tokens validated"),await this._processClaims(e,t,e.isOpenId),n.debug("claims processed")}async validateRefreshResponse(e,t){const n=this._logger.create("validateRefreshResponse");e.userState=t.data,null!=e.session_state||(e.session_state=t.session_state),null!=e.scope||(e.scope=t.scope),e.isOpenId&&e.id_token&&(this._validateIdTokenAttributes(e,t.id_token),n.debug("ID Token validated")),e.id_token||(e.id_token=t.id_token,e.profile=t.profile);const r=e.isOpenId&&!!e.id_token;await this._processClaims(e,!1,r),n.debug("claims processed")}validateSignoutResponse(e,t){const n=this._logger.create("validateSignoutResponse");if(t.id!==e.state&&n.throw(new Error("State does not match")),n.debug("state validated"),e.userState=t.data,e.error)throw n.warn("Response was error",e.error),new tB(e)}_processSigninState(e,t){const n=this._logger.create("_processSigninState");if(t.id!==e.state&&n.throw(new Error("State does not match")),t.client_id||n.throw(new Error("No client_id on state")),t.authority||n.throw(new Error("No authority on state")),this._settings.authority!==t.authority&&n.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==t.client_id&&n.throw(new Error("client_id mismatch on settings vs. signin state")),n.debug("state validated"),e.userState=t.data,null!=e.scope||(e.scope=t.scope),e.error)throw n.warn("Response was error",e.error),new tB(e);t.code_verifier&&!e.code&&n.throw(new Error("Expected code in response"))}async _processClaims(e,t=!1,n=!0){const r=this._logger.create("_processClaims");if(e.profile=this._claimsService.filterProtocolClaims(e.profile),t||!this._settings.loadUserInfo||!e.access_token)return void r.debug("not loading user info");r.debug("loading user info");const i=await this._userInfoService.getClaims(e.access_token);r.debug("user info claims received from user info endpoint"),n&&i.sub!==e.profile.sub&&r.throw(new Error("subject from UserInfo response does not match subject in ID Token")),e.profile=this._claimsService.mergeClaims(e.profile,this._claimsService.filterProtocolClaims(i)),r.debug("user info claims received, updated profile:",e.profile)}async _processCode(e,t){const n=this._logger.create("_processCode");if(e.code){n.debug("Validating code");const r=await this._tokenClient.exchangeCode({client_id:t.client_id,client_secret:t.client_secret,code:e.code,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier,...t.extraTokenParams});Object.assign(e,r)}else n.debug("No code to process")}_validateIdTokenAttributes(e,t){var n;const r=this._logger.create("_validateIdTokenAttributes");r.debug("decoding ID Token JWT");const i=YP.decode(null!=(n=e.id_token)?n:"");if(i.sub||r.throw(new Error("ID Token is missing a subject claim")),t){const e=YP.decode(t);i.sub!==e.sub&&r.throw(new Error("sub in id_token does not match current sub")),i.auth_time&&i.auth_time!==e.auth_time&&r.throw(new Error("auth_time in id_token does not match original auth_time")),i.azp&&i.azp!==e.azp&&r.throw(new Error("azp in id_token does not match original azp")),!i.azp&&e.azp&&r.throw(new Error("azp not in id_token, but present in original id_token"))}e.profile=i}}(this.settings,this.metadataService,this._claimsService),this._tokenClient=new uB(this.settings,this.metadataService)}async createSigninRequest({state:e,request:t,request_uri:n,request_type:r,id_token_hint:i,login_hint:a,skipUserInfo:o,nonce:s,response_type:u=this.settings.response_type,scope:c=this.settings.scope,redirect_uri:f=this.settings.redirect_uri,prompt:d=this.settings.prompt,display:l=this.settings.display,max_age:p=this.settings.max_age,ui_locales:h=this.settings.ui_locales,acr_values:b=this.settings.acr_values,resource:m=this.settings.resource,response_mode:y=this.settings.response_mode,extraQueryParams:g=this.settings.extraQueryParams,extraTokenParams:v=this.settings.extraTokenParams}){const w=this._logger.create("createSigninRequest");if("code"!==u)throw new Error("Only the Authorization Code flow (with PKCE) is supported");const _=await this.metadataService.getAuthorizationEndpoint();w.debug("Received authorization endpoint",_);const E=new class{constructor({url:e,authority:t,client_id:n,redirect_uri:r,response_type:i,scope:a,state_data:o,response_mode:s,request_type:u,client_secret:c,nonce:f,resource:d,skipUserInfo:l,extraQueryParams:p,extraTokenParams:h,disablePKCE:b,...m}){if(this._logger=new XP("SigninRequest"),!e)throw this._logger.error("ctor: No url passed"),new Error("url");if(!n)throw this._logger.error("ctor: No client_id passed"),new Error("client_id");if(!r)throw this._logger.error("ctor: No redirect_uri passed"),new Error("redirect_uri");if(!i)throw this._logger.error("ctor: No response_type passed"),new Error("response_type");if(!a)throw this._logger.error("ctor: No scope passed"),new Error("scope");if(!t)throw this._logger.error("ctor: No authority passed"),new Error("authority");this.state=new fB({data:o,request_type:u,code_verifier:!b,client_id:n,authority:t,redirect_uri:r,response_mode:s,client_secret:c,scope:a,extraTokenParams:h,skipUserInfo:l});const y=new URL(e);y.searchParams.append("client_id",n),y.searchParams.append("redirect_uri",r),y.searchParams.append("response_type",i),y.searchParams.append("scope",a),f&&y.searchParams.append("nonce",f),y.searchParams.append("state",this.state.id),this.state.code_challenge&&(y.searchParams.append("code_challenge",this.state.code_challenge),y.searchParams.append("code_challenge_method","S256")),d&&(Array.isArray(d)?d:[d]).forEach((e=>y.searchParams.append("resource",e)));for(const[e,t]of Object.entries({response_mode:s,...m,...p}))null!=t&&y.searchParams.append(e,t.toString());this.url=y.href}}({url:_,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:f,response_type:u,scope:c,state_data:e,prompt:d,display:l,max_age:p,ui_locales:h,id_token_hint:i,login_hint:a,acr_values:b,resource:m,request:t,request_uri:n,extraQueryParams:g,extraTokenParams:v,request_type:r,response_mode:y,client_secret:this.settings.client_secret,skipUserInfo:o,nonce:s,disablePKCE:this.settings.disablePKCE});await this.clearStaleState();const T=E.state;return await this.settings.stateStore.set(T.id,T.toStorageString()),E}async readSigninResponseState(e,t=!1){const n=this._logger.create("readSigninResponseState"),r=new dB(eB.readParams(e,this.settings.response_mode));if(!r.state)throw n.throw(new Error("No state in response")),null;const i=await this.settings.stateStore[t?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:fB.fromStorageString(i),response:r}}async processSigninResponse(e){const t=this._logger.create("processSigninResponse"),{state:n,response:r}=await this.readSigninResponseState(e,!0);return t.debug("received state from storage; validating response"),await this._validator.validateSigninResponse(r,n),r}async processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:n=!1,extraTokenParams:r={}}){const i=await this._tokenClient.exchangeCredentials({username:e,password:t,...r}),a=new dB(new URLSearchParams);return Object.assign(a,i),await this._validator.validateCredentialsResponse(a,n),a}async useRefreshToken({state:e,timeoutInSeconds:t}){var n;const r=this._logger.create("useRefreshToken");let i;if(void 0===this.settings.refreshTokenAllowedScope)i=e.scope;else{const t=this.settings.refreshTokenAllowedScope.split(" ");i=((null==(n=e.scope)?void 0:n.split(" "))||[]).filter((e=>t.includes(e))).join(" ")}const a=await this._tokenClient.exchangeRefreshToken({refresh_token:e.refresh_token,scope:i,timeoutInSeconds:t}),o=new dB(new URLSearchParams);return Object.assign(o,a),r.debug("validating response",o),await this._validator.validateRefreshResponse(o,{...e,scope:i}),o}async createSignoutRequest({state:e,id_token_hint:t,request_type:n,post_logout_redirect_uri:r=this.settings.post_logout_redirect_uri,extraQueryParams:i=this.settings.extraQueryParams}={}){const a=this._logger.create("createSignoutRequest"),o=await this.metadataService.getEndSessionEndpoint();if(!o)throw a.throw(new Error("No end session endpoint")),null;a.debug("Received end session endpoint",o);const s=new class{constructor({url:e,state_data:t,id_token_hint:n,post_logout_redirect_uri:r,extraQueryParams:i,request_type:a}){if(this._logger=new XP("SignoutRequest"),!e)throw this._logger.error("ctor: No url passed"),new Error("url");const o=new URL(e);n&&o.searchParams.append("id_token_hint",n),r&&(o.searchParams.append("post_logout_redirect_uri",r),t&&(this.state=new cB({data:t,request_type:a}),o.searchParams.append("state",this.state.id)));for(const[e,t]of Object.entries({...i}))null!=t&&o.searchParams.append(e,t.toString());this.url=o.href}}({url:o,id_token_hint:t,post_logout_redirect_uri:r,state_data:e,extraQueryParams:i,request_type:n});await this.clearStaleState();const u=s.state;return u&&(a.debug("Signout request has state to persist"),await this.settings.stateStore.set(u.id,u.toStorageString())),s}async readSignoutResponseState(e,t=!1){const n=this._logger.create("readSignoutResponseState"),r=new class{constructor(e){this.state=e.get("state"),this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri")}}(eB.readParams(e,this.settings.response_mode));if(!r.state){if(n.debug("No state in response"),r.error)throw n.warn("Response was error:",r.error),new tB(r);return{state:void 0,response:r}}const i=await this.settings.stateStore[t?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:cB.fromStorageString(i),response:r}}async processSignoutResponse(e){const t=this._logger.create("processSignoutResponse"),{state:n,response:r}=await this.readSignoutResponseState(e,!0);return n?(t.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(r,n)):t.debug("No state from storage; skipping response validation"),r}clearStaleState(){return this._logger.create("clearStaleState"),cB.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}async revokeToken(e,t){return this._logger.create("revokeToken"),await this._tokenClient.revoke({token:e,token_type_hint:t})}}(e),this._redirectNavigator=new class{constructor(e){this._settings=e,this._logger=new XP("RedirectNavigator")}async prepare({redirectMethod:e=this._settings.redirectMethod,redirectTarget:t=this._settings.redirectTarget}){var n;this._logger.create("prepare");let r=window.self;"top"===t&&(r=null!=(n=window.top)?n:window.self);const i=r.location[e].bind(r.location);let a;return{navigate:async e=>{this._logger.create("navigate");const t=new Promise(((e,t)=>{a=t}));return i(e.url),await t},close:()=>{this._logger.create("close"),null==a||a(new Error("Redirect aborted")),r.stop()}}}}(this.settings),this._popupNavigator=new class{constructor(e){this._settings=e,this._logger=new XP("PopupNavigator")}async prepare({popupWindowFeatures:e=this._settings.popupWindowFeatures,popupWindowTarget:t=this._settings.popupWindowTarget}){return new AB({popupWindowFeatures:e,popupWindowTarget:t})}async callback(e,t=!1){this._logger.create("callback"),AB.notifyOpener(e,t)}}(this.settings),this._iframeNavigator=new class{constructor(e){this._settings=e,this._logger=new XP("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:e=this._settings.silentRequestTimeoutInSeconds}){return new TB({silentRequestTimeoutInSeconds:e})}async callback(e){this._logger.create("callback"),TB.notifyParent(e,this._settings.iframeNotifyParentOrigin)}}(this.settings),this._events=new RB(this.settings),this._silentRenewService=new class{constructor(e){this._userManager=e,this._logger=new XP("SilentRenewService"),this._isStarted=!1,this._retryTimer=new ZP("Retry Silent Renew"),this._tokenExpiring=async()=>{const e=this._logger.create("_tokenExpiring");try{await this._userManager.signinSilent(),e.debug("silent token renewal successful")}catch(t){if(t instanceof nB)return e.warn("ErrorTimeout from signinSilent:",t,"retry in 5s"),void this._retryTimer.init(5);e.error("Error from signinSilent:",t),this._userManager.events._raiseSilentRenewError(t)}}}async start(){const e=this._logger.create("start");if(!this._isStarted){this._isStarted=!0,this._userManager.events.addAccessTokenExpiring(this._tokenExpiring),this._retryTimer.addHandler(this._tokenExpiring);try{await this._userManager.getUser()}catch(t){e.error("getUser error",t)}}}stop(){this._isStarted&&(this._retryTimer.cancel(),this._retryTimer.removeHandler(this._tokenExpiring),this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring),this._isStarted=!1)}}(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new class{constructor(e){this._userManager=e,this._logger=new XP("SessionMonitor"),this._start=async e=>{const t=e.session_state;if(!t)return;const n=this._logger.create("_start");if(e.profile?(this._sub=e.profile.sub,this._sid=e.profile.sid,n.debug("session_state",t,", sub",this._sub)):(this._sub=void 0,this._sid=void 0,n.debug("session_state",t,", anonymous user")),this._checkSessionIFrame)this._checkSessionIFrame.start(t);else try{const e=await this._userManager.metadataService.getCheckSessionIframe();if(e){n.debug("initializing check session iframe");const r=this._userManager.settings.client_id,i=this._userManager.settings.checkSessionIntervalInSeconds,a=this._userManager.settings.stopCheckSessionOnError,o=new class{constructor(e,t,n,r,i){this._callback=e,this._client_id=t,this._intervalInSeconds=r,this._stopOnError=i,this._logger=new XP("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=e=>{e.origin===this._frame_origin&&e.source===this._frame.contentWindow&&("error"===e.data?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):"changed"===e.data?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(e.data+" message from check session op iframe"))};const a=new URL(n);this._frame_origin=a.origin,this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="fixed",this._frame.style.left="-1000px",this._frame.style.top="0",this._frame.width="0",this._frame.height="0",this._frame.src=a.href}load(){return new Promise((e=>{this._frame.onload=()=>{e()},window.document.body.appendChild(this._frame),window.addEventListener("message",this._message,!1)}))}start(e){if(this._session_state===e)return;this._logger.create("start"),this.stop(),this._session_state=e;const t=()=>{this._frame.contentWindow&&this._session_state&&this._frame.contentWindow.postMessage(this._client_id+" "+this._session_state,this._frame_origin)};t(),this._timer=setInterval(t,1e3*this._intervalInSeconds)}stop(){this._logger.create("stop"),this._session_state=null,this._timer&&(clearInterval(this._timer),this._timer=null)}}(this._callback,r,e,i,a);await o.load(),this._checkSessionIFrame=o,o.start(t)}else n.warn("no check session iframe found in the metadata")}catch(e){n.error("Error from getCheckSessionIframe:",e instanceof Error?e.message:e)}},this._stop=()=>{const e=this._logger.create("_stop");if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&this._checkSessionIFrame.stop(),this._userManager.settings.monitorAnonymousSession){const t=setInterval((async()=>{clearInterval(t);try{const e=await this._userManager.querySessionStatus();if(e){const t={session_state:e.session_state,profile:e.sub&&e.sid?{sub:e.sub,sid:e.sid}:null};this._start(t)}}catch(t){e.error("error from querySessionStatus",t instanceof Error?t.message:t)}}),1e3)}},this._callback=async()=>{const e=this._logger.create("_callback");try{const t=await this._userManager.querySessionStatus();let n=!0;t&&this._checkSessionIFrame?t.sub===this._sub?(n=!1,this._checkSessionIFrame.start(t.session_state),t.sid===this._sid?e.debug("same sub still logged in at OP, restarting check session iframe; session_state",t.session_state):(e.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state",t.session_state),this._userManager.events._raiseUserSessionChanged())):e.debug("different subject signed into OP",t.sub):e.debug("subject no longer signed into OP"),n?this._sub?this._userManager.events._raiseUserSignedOut():this._userManager.events._raiseUserSignedIn():e.debug("no change in session detected, no event to raise")}catch(t){this._sub&&(e.debug("Error calling queryCurrentSigninSession; raising signed out event",t),this._userManager.events._raiseUserSignedOut())}},e||this._logger.throw(new Error("No user manager passed")),this._userManager.events.addUserLoaded(this._start),this._userManager.events.addUserUnloaded(this._stop),this._init().catch((e=>{this._logger.error(e)}))}async _init(){this._logger.create("_init");const e=await this._userManager.getUser();if(e)this._start(e);else if(this._userManager.settings.monitorAnonymousSession){const e=await this._userManager.querySessionStatus();if(e){const t={session_state:e.session_state,profile:e.sub&&e.sid?{sub:e.sub,sid:e.sid}:null};this._start(t)}}}}(this))}get events(){return this._events}get metadataService(){return this._client.metadataService}async getUser(){const e=this._logger.create("getUser"),t=await this._loadUser();return t?(e.info("user loaded"),this._events.load(t,!1),t):(e.info("user not found in storage"),null)}async removeUser(){const e=this._logger.create("removeUser");await this.storeUser(null),e.info("user removed from storage"),this._events.unload()}async signinRedirect(e={}){this._logger.create("signinRedirect");const{redirectMethod:t,...n}=e,r=await this._redirectNavigator.prepare({redirectMethod:t});await this._signinStart({request_type:"si:r",...n},r)}async signinRedirectCallback(e=window.location.href){const t=this._logger.create("signinRedirectCallback"),n=await this._signinEnd(e);return n.profile&&n.profile.sub?t.info("success, signed in subject",n.profile.sub):t.info("no subject"),n}async signinResourceOwnerCredentials({username:e,password:t,skipUserInfo:n=!1}){const r=this._logger.create("signinResourceOwnerCredential"),i=await this._client.processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:n,extraTokenParams:this.settings.extraTokenParams});r.debug("got signin response");const a=await this._buildUser(i);return a.profile&&a.profile.sub?r.info("success, signed in subject",a.profile.sub):r.info("no subject"),a}async signinPopup(e={}){const t=this._logger.create("signinPopup"),{popupWindowFeatures:n,popupWindowTarget:r,...i}=e,a=this.settings.popup_redirect_uri;a||t.throw(new Error("No popup_redirect_uri configured"));const o=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r}),s=await this._signin({request_type:"si:p",redirect_uri:a,display:"popup",...i},o);return s&&(s.profile&&s.profile.sub?t.info("success, signed in subject",s.profile.sub):t.info("no subject")),s}async signinPopupCallback(e=window.location.href,t=!1){const n=this._logger.create("signinPopupCallback");await this._popupNavigator.callback(e,t),n.info("success")}async signinSilent(e={}){var t;const n=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:r,...i}=e;let a=await this._loadUser();if(null==a?void 0:a.refresh_token){n.debug("using refresh token");const e=new class{constructor(e){this.refresh_token=e.refresh_token,this.id_token=e.id_token,this.session_state=e.session_state,this.scope=e.scope,this.profile=e.profile,this.data=e.state}}(a);return await this._useRefreshToken(e)}const o=this.settings.silent_redirect_uri;let s;o||n.throw(new Error("No silent_redirect_uri configured")),a&&this.settings.validateSubOnSilentRenew&&(n.debug("subject prior to silent renew:",a.profile.sub),s=a.profile.sub);const u=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});return a=await this._signin({request_type:"si:s",redirect_uri:o,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?null==a?void 0:a.id_token:void 0,...i},u,s),a&&((null==(t=a.profile)?void 0:t.sub)?n.info("success, signed in subject",a.profile.sub):n.info("no subject")),a}async _useRefreshToken(e){const t=await this._client.useRefreshToken({state:e,timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds}),n=new hB({...e,...t});return await this.storeUser(n),this._events.load(n),n}async signinSilentCallback(e=window.location.href){const t=this._logger.create("signinSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async signinCallback(e=window.location.href){const{state:t}=await this._client.readSigninResponseState(e);switch(t.request_type){case"si:r":return await this.signinRedirectCallback(e);case"si:p":return await this.signinPopupCallback(e);case"si:s":return await this.signinSilentCallback(e);default:throw new Error("invalid response_type in state")}}async signoutCallback(e=window.location.href,t=!1){const{state:n}=await this._client.readSignoutResponseState(e);if(n)switch(n.request_type){case"so:r":await this.signoutRedirectCallback(e);break;case"so:p":await this.signoutPopupCallback(e,t);break;case"so:s":await this.signoutSilentCallback(e);break;default:throw new Error("invalid response_type in state")}}async querySessionStatus(e={}){const t=this._logger.create("querySessionStatus"),{silentRequestTimeoutInSeconds:n,...r}=e,i=this.settings.silent_redirect_uri;i||t.throw(new Error("No silent_redirect_uri configured"));const a=await this._loadUser(),o=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:n}),s=await this._signinStart({request_type:"si:s",redirect_uri:i,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?null==a?void 0:a.id_token:void 0,response_type:this.settings.query_status_response_type,scope:"openid",skipUserInfo:!0,...r},o);try{const e=await this._client.processSigninResponse(s.url);return t.debug("got signin response"),e.session_state&&e.profile.sub?(t.info("success for subject",e.profile.sub),{session_state:e.session_state,sub:e.profile.sub,sid:e.profile.sid}):(t.info("success, user not authenticated"),null)}catch(e){if(this.settings.monitorAnonymousSession&&e instanceof tB)switch(e.error){case"login_required":case"consent_required":case"interaction_required":case"account_selection_required":return t.info("success for anonymous user"),{session_state:e.session_state}}throw e}}async _signin(e,t,n){const r=await this._signinStart(e,t);return await this._signinEnd(r.url,n)}async _signinStart(e,t){const n=this._logger.create("_signinStart");try{const r=await this._client.createSigninRequest(e);return n.debug("got signin request"),await t.navigate({url:r.url,state:r.state.id,response_mode:r.state.response_mode,scriptOrigin:this.settings.iframeScriptOrigin})}catch(e){throw n.debug("error after preparing navigator, closing navigator window"),t.close(),e}}async _signinEnd(e,t){const n=this._logger.create("_signinEnd"),r=await this._client.processSigninResponse(e);return n.debug("got signin response"),await this._buildUser(r,t)}async _buildUser(e,t){const n=this._logger.create("_buildUser"),r=new hB(e);if(t){if(t!==r.profile.sub)throw n.debug("current user does not match user returned from signin. sub from signin:",r.profile.sub),new tB({...e,error:"login_required"});n.debug("current user matches user returned from signin")}return await this.storeUser(r),n.debug("user stored"),this._events.load(r),r}async signoutRedirect(e={}){const t=this._logger.create("signoutRedirect"),{redirectMethod:n,...r}=e,i=await this._redirectNavigator.prepare({redirectMethod:n});await this._signoutStart({request_type:"so:r",post_logout_redirect_uri:this.settings.post_logout_redirect_uri,...r},i),t.info("success")}async signoutRedirectCallback(e=window.location.href){const t=this._logger.create("signoutRedirectCallback"),n=await this._signoutEnd(e);return t.info("success"),n}async signoutPopup(e={}){const t=this._logger.create("signoutPopup"),{popupWindowFeatures:n,popupWindowTarget:r,...i}=e,a=this.settings.popup_post_logout_redirect_uri,o=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r});await this._signout({request_type:"so:p",post_logout_redirect_uri:a,state:null==a?void 0:{},...i},o),t.info("success")}async signoutPopupCallback(e=window.location.href,t=!1){const n=this._logger.create("signoutPopupCallback");await this._popupNavigator.callback(e,t),n.info("success")}async _signout(e,t){const n=await this._signoutStart(e,t);return await this._signoutEnd(n.url)}async _signoutStart(e={},t){var n;const r=this._logger.create("_signoutStart");try{const i=await this._loadUser();r.debug("loaded current user from storage"),this.settings.revokeTokensOnSignout&&await this._revokeInternal(i);const a=e.id_token_hint||i&&i.id_token;a&&(r.debug("setting id_token_hint in signout request"),e.id_token_hint=a),await this.removeUser(),r.debug("user removed, creating signout request");const o=await this._client.createSignoutRequest(e);return r.debug("got signout request"),await t.navigate({url:o.url,state:null==(n=o.state)?void 0:n.id})}catch(e){throw r.debug("error after preparing navigator, closing navigator window"),t.close(),e}}async _signoutEnd(e){const t=this._logger.create("_signoutEnd"),n=await this._client.processSignoutResponse(e);return t.debug("got signout response"),n}async signoutSilent(e={}){var t;const n=this._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:r,...i}=e,a=this.settings.includeIdTokenInSilentSignout?null==(t=await this._loadUser())?void 0:t.id_token:void 0,o=this.settings.popup_post_logout_redirect_uri,s=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});await this._signout({request_type:"so:s",post_logout_redirect_uri:o,id_token_hint:a,...i},s),n.info("success")}async signoutSilentCallback(e=window.location.href){const t=this._logger.create("signoutSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async revokeTokens(e){const t=await this._loadUser();await this._revokeInternal(t,e)}async _revokeInternal(e,t=this.settings.revokeTokenTypes){const n=this._logger.create("_revokeInternal");if(!e)return;const r=t.filter((t=>"string"==typeof e[t]));if(r.length){for(const t of r)await this._client.revokeToken(e[t],t),n.info(`${t} revoked successfully`),"access_token"!==t&&(e[t]=null);await this.storeUser(e),n.debug("user stored"),this._events.load(e)}else n.debug("no need to revoke due to no token(s)")}startSilentRenew(){this._logger.create("startSilentRenew"),this._silentRenewService.start()}stopSilentRenew(){this._silentRenewService.stop()}get _userStoreKey(){return`user:${this.settings.authority}:${this.settings.client_id}`}async _loadUser(){const e=this._logger.create("_loadUser"),t=await this.settings.userStore.get(this._userStoreKey);return t?(e.debug("user storageString loaded"),hB.fromStorageString(t)):(e.debug("no user storageString"),null)}async storeUser(e){const t=this._logger.create("storeUser");if(e){t.debug("storing user");const n=e.toStorageString();await this.settings.userStore.set(this._userStoreKey,n)}else this._logger.debug("removing user"),await this.settings.userStore.remove(this._userStoreKey)}async clearStaleState(){await this._client.clearStaleState()}}((({oidcConfiguration:e,authenticationDomain:t})=>{const n={authority:t,redirect_uri:e.redirectUri,popup_redirect_uri:e.redirectUri,client_id:e.clientId,metadata:{authorization_endpoint:`${t}/authorize`,token_endpoint:`${t}/oauth/token`,userinfo_endpoint:`${t}/userinfo`,end_session_endpoint:`${t}/v2/logout?returnTo=${encodeURIComponent(e.logoutRedirectUri)}&client_id=${e.clientId}`},mergeClaims:!0,loadUserInfo:!0,scope:e.scope};return e.audience&&(n.extraQueryParams={audience:e.audience}),n})(e)),this.deviceCredentialsManager=new dq,this.logoutMode=e.oidcConfiguration.logoutMode||"redirect"}static mapOidcUserToDomainModel=e=>{const t=e.profile?.passport,n={expired:e.expired,idToken:e.id_token,accessToken:e.access_token,refreshToken:e.refresh_token,profile:{sub:e.profile.sub,email:e.profile.email,nickname:e.profile.nickname}};return t?.imx_eth_address&&(n.imx={ethAddress:t?.imx_eth_address,starkAddress:t?.imx_stark_address,userAdminAddress:t?.imx_user_admin_address}),t?.zkevm_eth_address&&(n.zkEvm={ethAddress:t?.zkevm_eth_address,userAdminAddress:t?.zkevm_user_admin_address}),n};static mapDeviceTokenResponseToDomainUserModel=e=>{const t=zP(e.id_token),n={idToken:e.id_token,accessToken:e.access_token,refreshToken:e.refresh_token,profile:{sub:t.sub,email:t.email,nickname:t.nickname}};return t?.passport?.imx_eth_address&&(n.imx={ethAddress:t?.passport?.imx_eth_address,starkAddress:t?.passport?.imx_stark_address,userAdminAddress:t?.passport?.imx_user_admin_address}),n};async login(){return sq((async()=>{const e=await this.userManager.signinPopup({popupWindowFeatures:{width:410,height:450}});return hq.mapOidcUserToDomainModel(e)}),aq.AUTHENTICATION_ERROR)}async loginCallback(){return sq((async()=>this.userManager.signinPopupCallback()),aq.AUTHENTICATION_ERROR)}async loginWithDeviceFlow(){return sq((async()=>{const e=await Fe.post(`${this.config.authenticationDomain}/oauth/device/code`,{client_id:this.config.oidcConfiguration.clientId,scope:this.config.oidcConfiguration.scope,audience:this.config.oidcConfiguration.audience},lq);return{code:e.data.user_code,deviceCode:e.data.device_code,url:e.data.verification_uri_complete,interval:e.data.interval}}),aq.AUTHENTICATION_ERROR)}async connectImxDeviceFlow(e,t,n){return sq((async()=>{const r=Date.now();for(;;){if(null!=n&&Date.now()-r>n)throw new Error("Timed out");await pq(1e3*t);try{const t=await this.getDeviceFlowToken(e),n=hq.mapDeviceTokenResponseToDomainUserModel(t);return n.imx?.ethAddress&&n.imx?.starkAddress&&n.imx?.userAdminAddress&&this.deviceCredentialsManager.saveCredentials(t),n}catch(e){if(!Fe.isAxiosError(e))throw e;{const t=e.response?.data;switch(t.error){case"authorization_pending":case"slow_down":break;case"expired_token":throw new Error("Token expired, please log in again");case"access_denied":throw new Error("User denied access");default:throw new Error("Error getting token")}}}}throw new Error("Failed to get credentials")}),aq.AUTHENTICATION_ERROR)}async getDeviceFlowToken(e){return(await Fe.post(`${this.config.authenticationDomain}/oauth/token`,{client_id:this.config.oidcConfiguration.clientId,grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:e},lq)).data}static base64URLEncode(e){return e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}static sha256(e){return(void 0)("sha256").update(e).digest()}getPKCEAuthorizationUrl(){const e=hq.base64URLEncode((void 0)(32)),t=hq.base64URLEncode(hq.sha256(e)),n=hq.base64URLEncode((void 0)(32));return this.deviceCredentialsManager.savePKCEData({state:n,verifier:e}),`${this.config.authenticationDomain}/authorize?response_type=code&code_challenge=${t}&code_challenge_method=S256&client_id=${this.config.oidcConfiguration.clientId}&redirect_uri=${this.config.oidcConfiguration.redirectUri}&scope=${this.config.oidcConfiguration.scope}&state=${n}&audience=${this.config.oidcConfiguration.audience}`}async connectImxPKCEFlow(e,t){return sq((async()=>{const n=this.deviceCredentialsManager.getPKCEData();if(!n)throw new Error("No code verifier or state for PKCE");if(t!==n.state)throw new Error("Provided state does not match stored state");const r=await this.getPKCEToken(e,n.verifier),i=hq.mapDeviceTokenResponseToDomainUserModel(r);return i.imx?.ethAddress&&i.imx?.starkAddress&&i.imx?.userAdminAddress&&this.deviceCredentialsManager.saveCredentials(r),i}),aq.AUTHENTICATION_ERROR)}async getPKCEToken(e,t){return(await Fe.post(`${this.config.authenticationDomain}/oauth/token`,{client_id:this.config.oidcConfiguration.clientId,grant_type:"authorization_code",code_verifier:t,code:e,redirect_uri:this.config.oidcConfiguration.redirectUri},lq)).data}async connectImxWithCredentials(e){return sq((async()=>{if(this.deviceCredentialsManager.areValid(e))return hq.mapDeviceTokenResponseToDomainUserModel(e);const t=e?.refresh_token??null;if(t){const e=await this.refreshToken(t);return hq.mapDeviceTokenResponseToDomainUserModel(e)}return null}),aq.AUTHENTICATION_ERROR)}async refreshToken(e){return(await Fe.post(`${this.config.authenticationDomain}/oauth/token`,{client_id:this.config.oidcConfiguration.clientId,grant_type:"refresh_token",refresh_token:e},lq)).data}async logout(){return sq((async()=>"silent"===this.logoutMode?this.userManager.signoutSilent():this.userManager.signoutRedirect()),aq.LOGOUT_ERROR)}async logoutSilentCallback(e){return this.userManager.signoutSilentCallback(e)}async logoutDeviceFlow(){return sq((async()=>{this.deviceCredentialsManager.clearCredentials()}),aq.LOGOUT_ERROR)}async loginSilent(){return sq((async()=>{if(!await this.getUser())return null;const e=await this.userManager.signinSilent();return e?hq.mapOidcUserToDomainModel(e):null}),aq.SILENT_LOGIN_ERROR)}async getUser(){return sq((async()=>{const e=await this.userManager.getUser();if(e)return hq.mapOidcUserToDomainModel(e);const t=this.deviceCredentialsManager.getCredentials();return t?hq.mapDeviceTokenResponseToDomainUserModel(t):null}),aq.NOT_LOGGED_IN_ERROR)}async getUserDeviceFlow(){return sq((async()=>{const e=this.deviceCredentialsManager.getCredentials();return e?hq.mapDeviceTokenResponseToDomainUserModel(e):null}),aq.NOT_LOGGED_IN_ERROR)}checkStoredDeviceFlowCredentials(){return this.deviceCredentialsManager.getCredentials()}}class bq{config;magicClient;constructor(e){this.config=e}async login(e,t){return sq((async()=>(this.magicClient=new kL(this.config.magicPublishableApiKey,{extensions:[new IL],network:t}),await this.magicClient.openid.loginWithOIDC({jwt:e,providerId:this.config.magicProviderId}),this.magicClient.rpcProvider)),aq.WALLET_CONNECTION_ERROR)}async logout(){this.magicClient?.user&&await this.magicClient.user.logout()}}const mq=1e3,yq=3,gq=async(e,t)=>{const{retries:n=yq,interval:r=mq,finalErr:i=Error("Retry failed"),finallyFn:a=(()=>{})}=t||{};try{return await e()}catch(t){return n<=0?Promise.reject(i):(await(o=r,new Promise((e=>{setTimeout((()=>e()),o)}))),gq(e,{retries:n-1,finalErr:i,finallyFn:a}))}finally{n<=0&&a()}var o};var vq,wq;!function(e){e[e.USER_REJECTED_REQUEST=4001]="USER_REJECTED_REQUEST",e[e.UNAUTHORIZED=4100]="UNAUTHORIZED",e[e.UNSUPPORTED_METHOD=4200]="UNSUPPORTED_METHOD",e[e.DISCONNECTED=4900]="DISCONNECTED"}(vq||(vq={})),function(e){e[e.RPC_SERVER_ERROR=-32e3]="RPC_SERVER_ERROR",e[e.INVALID_REQUEST=-32600]="INVALID_REQUEST",e[e.METHOD_NOT_FOUND=-32601]="METHOD_NOT_FOUND",e[e.INVALID_PARAMS=-32602]="INVALID_PARAMS",e[e.INTERNAL_ERROR=-32603]="INTERNAL_ERROR",e[e.PARSE_ERROR=-32700]="PARSE_ERROR",e[e.TRANSACTION_REJECTED=-32003]="TRANSACTION_REJECTED"}(wq||(wq={}));class _q extends Error{message;code;constructor(e,t){super(t),this.message=t,this.code=e}}const Eq="Transaction requires confirmation but this functionality is not supported in this environment. Please contact Immutable support if you need to enable this feature.",Tq=e=>Tr.from(e).toString();class Aq{transactionAPI;confirmationScreen;imxEtherAddress;crossSdkBridgeEnabled;constructor({accessToken:e,confirmationScreen:t,imxEtherAddress:n,config:r}){this.confirmationScreen=t,this.transactionAPI=new _j(new Ej({accessToken:e,basePath:r.imxPublicApiDomain})),this.imxEtherAddress=n,this.crossSdkBridgeEnabled=r.crossSdkBridgeEnabled}withConfirmationScreen(e){return t=>this.withConfirmationScreenTask(e)(t)()}withConfirmationScreenTask(e){return t=>async()=>{this.confirmationScreen.loading(e);try{return await t()}catch(e){throw this.confirmationScreen.closeWindow(),e}}}withDefaultConfirmationScreenTask(e){return this.withConfirmationScreenTask()(e)}async validate({payloadHash:e}){if(!(await gq((async()=>this.transactionAPI.getTransactionByID({transactionID:e,chainType:"starkex"})),{finallyFn:()=>{this.confirmationScreen.closeWindow()}})).data.id)throw new Error("Transaction doesn't exists");const t=await this.transactionAPI.evaluateTransaction({id:e,transactionEvaluationRequest:{chainType:"starkex"}}),{confirmationRequired:n}=t.data;if(n){if(this.crossSdkBridgeEnabled)throw new Error(Eq);if(!(await this.confirmationScreen.requestConfirmation(e,this.imxEtherAddress,Tj)).confirmed)throw new Error("Transaction rejected by user")}else this.confirmationScreen.closeWindow()}async evaluateEVMTransaction({chainId:e,nonce:t,user:n,metaTransactions:r}){const i={Authorization:`Bearer ${n.accessToken}`},a=(e=>{try{return e.map((e=>({delegateCall:!0===e.delegateCall,revertOnError:!0===e.revertOnError,gasLimit:e.gasLimit?Tq(e.gasLimit):"0",target:e.to??ca,value:e.value?Tq(e.value):"0",data:e.data?e.data.toString():"0x"})))}catch(e){const t=e instanceof Error?e.message:String(e);throw new _q(wq.INVALID_PARAMS,`Transaction failed to parsing: ${t}`)}})(r);try{return(await this.transactionAPI.evaluateTransaction({id:"evm",transactionEvaluationRequest:{chainType:"evm",chainId:e,transactionData:{nonce:t,userAddress:n.zkEvm.ethAddress,metaTransactions:a}}},{headers:i})).data}catch(e){const t=e instanceof Error?e.message:String(e);throw new _q(wq.INTERNAL_ERROR,`Transaction failed to validate with error: ${t}`)}}async validateEVMTransaction({chainId:e,nonce:t,user:n,metaTransactions:r}){const i=await this.evaluateEVMTransaction({chainId:e,nonce:t,user:n,metaTransactions:r}),{confirmationRequired:a,transactionId:o}=i;if(a&&this.crossSdkBridgeEnabled)throw new _q(wq.TRANSACTION_REJECTED,Eq);if(a&&o){if(!(await this.confirmationScreen.requestConfirmation(o,this.imxEtherAddress,Aj,e)).confirmed)throw new _q(wq.TRANSACTION_REJECTED,"Transaction rejected by user")}else this.confirmationScreen.closeWindow()}}var Rq,Sq;!function(e){e.LOGGED_OUT="loggedOut"}(Rq||(Rq={})),function(e){e.PRODUCTION="mainnet",e.SANDBOX="goerli"}(Sq||(Sq={}));const kq="ERC721";const Oq="ERC721";class Iq{user;starkSigner;immutableXClient;confirmationScreen;guardianClient;constructor({user:e,starkSigner:t,immutableXClient:n,confirmationScreen:r,config:i,passportEventEmitter:a}){this.user=e,this.starkSigner=t,this.immutableXClient=n,this.confirmationScreen=r,this.guardianClient=new Aq({accessToken:e.accessToken,confirmationScreen:r,imxEtherAddress:e.imx.ethAddress,config:i}),a.on(Rq.LOGGED_OUT,this.handleLogout)}handleLogout=()=>{this.user=void 0,this.starkSigner=void 0};checkIsLoggedIn(){if(void 0===this.user||void 0===this.starkSigner)throw new oq("User has been logged out",aq.NOT_LOGGED_IN_ERROR)}async transfer(e){return this.checkIsLoggedIn(),async function({request:e,transfersApi:t,starkSigner:n,user:r,guardianClient:i}){return sq(i.withDefaultConfirmationScreenTask((async()=>{const a=e.type===Oq?"1":e.amount,o={sender:r.imx.ethAddress,token:kj(e),amount:a,receiver:e.receiver},s={Authorization:`Bearer ${r.accessToken}`},u=await t.getSignableTransferV1({getSignableTransferRequest:o},{headers:s});await i.validate({payloadHash:u.data.payload_hash});const c=u.data,{payload_hash:f}=c,d=await n.signMessage(f),l=await n.getAddress(),p={createTransferRequest:{sender_stark_key:c.sender_stark_key||l,sender_vault_id:c.sender_vault_id,receiver_stark_key:c.receiver_stark_key,receiver_vault_id:c.receiver_vault_id,asset_id:c.asset_id,amount:c.amount,nonce:c.nonce,expiration_timestamp:c.expiration_timestamp,stark_signature:d}},{data:h}=await t.createTransferV1(p,{headers:s});return{sent_signature:h.sent_signature,status:h.status?.toString(),time:h.time,transfer_id:h.transfer_id}})),aq.TRANSFER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,transfersApi:this.immutableXClient.transfersApi,guardianClient:this.guardianClient})}registerOffchain(){throw new oq("Operation not supported",aq.OPERATION_NOT_SUPPORTED_ERROR)}isRegisteredOnchain(){throw new oq("Operation not supported",aq.OPERATION_NOT_SUPPORTED_ERROR)}createOrder(e){return this.checkIsLoggedIn(),async function({starkSigner:e,user:t,request:n,ordersApi:r,guardianClient:i}){return sq(i.withDefaultConfirmationScreenTask((async()=>{const{ethAddress:a}=t.imx,o=n.sell.type===kq?"1":n.sell.amount,s=n.buy.type===kq?"1":n.buy.amount,u={Authorization:`Bearer ${t.accessToken}`},c={user:a,amount_buy:s,token_buy:kj(n.buy),amount_sell:o,token_sell:kj(n.sell),fees:n.fees,split_fees:!0,expiration_timestamp:n.expiration_timestamp},f=await r.getSignableOrder({getSignableOrderRequestV3:c},{headers:u});await i.validate({payloadHash:f.data.payload_hash});const{payload_hash:d}=f.data,l=await e.signMessage(d),p=f.data,h={createOrderRequest:{include_fees:!0,fees:n.fees,stark_signature:l,amount_buy:p.amount_buy,amount_sell:p.amount_sell,asset_id_buy:p.asset_id_buy,asset_id_sell:p.asset_id_sell,expiration_timestamp:p.expiration_timestamp,nonce:p.nonce,stark_key:p.stark_key,vault_id_buy:p.vault_id_buy,vault_id_sell:p.vault_id_sell}};return{...(await r.createOrderV3(h,{headers:u})).data}})),aq.CREATE_ORDER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,ordersApi:this.immutableXClient.ordersApi,guardianClient:this.guardianClient})}cancelOrder(e){return this.checkIsLoggedIn(),async function({user:e,starkSigner:t,request:n,ordersApi:r,guardianClient:i}){return sq(i.withDefaultConfirmationScreenTask((async()=>{const a={order_id:n.order_id},o={Authorization:`Bearer ${e.accessToken}`},s=await r.getSignableCancelOrderV3({getSignableCancelOrderRequest:a},{headers:o});await i.validate({payloadHash:s.data.payload_hash});const{payload_hash:u}=s.data,c=await t.signMessage(u),f=await r.cancelOrderV3({id:n.order_id.toString(),cancelOrderRequest:{order_id:n.order_id,stark_signature:c}},{headers:o});return{order_id:f.data.order_id,status:f.data.status}})),aq.CANCEL_ORDER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,ordersApi:this.immutableXClient.ordersApi,guardianClient:this.guardianClient})}createTrade(e){return this.checkIsLoggedIn(),async function({request:e,tradesApi:t,user:n,starkSigner:r,guardianClient:i}){return sq(i.withDefaultConfirmationScreenTask((async()=>{const{ethAddress:a}=n.imx,o={expiration_timestamp:e.expiration_timestamp,fees:e.fees,order_id:e.order_id,user:a},s={Authorization:`Bearer ${n.accessToken}`},u=await t.getSignableTrade({getSignableTradeRequest:o},{headers:s});await i.validate({payloadHash:u.data.payload_hash});const{payload_hash:c}=u.data,f=await r.signMessage(c),{data:d}=u,l={createTradeRequest:{include_fees:!0,fees:e?.fees,stark_signature:f,order_id:e?.order_id,fee_info:d.fee_info,amount_buy:d.amount_buy,amount_sell:d.amount_sell,asset_id_buy:d.asset_id_buy,asset_id_sell:d.asset_id_sell,expiration_timestamp:d.expiration_timestamp,nonce:d.nonce,stark_key:d.stark_key,vault_id_buy:d.vault_id_buy,vault_id_sell:d.vault_id_sell}},{data:p}=await t.createTradeV3(l,{headers:s});return p})),aq.CREATE_TRADE_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,tradesApi:this.immutableXClient.tradesApi,guardianClient:this.guardianClient})}batchNftTransfer(e){return this.checkIsLoggedIn(),async function({user:e,starkSigner:t,request:n,transfersApi:r,guardianClient:i}){return sq(i.withConfirmationScreenTask({width:480,height:784})((async()=>{const{ethAddress:a}=e.imx,o={sender_ether_key:a,signable_requests:n.map((e=>({amount:"1",token:kj({type:Oq,tokenId:e.tokenId,tokenAddress:e.tokenAddress}),receiver:e.receiver})))},s={Authorization:`Bearer ${e.accessToken}`},u=await r.getSignableTransfer({getSignableTransferRequestV2:o},{headers:s});await i.validate({payloadHash:u.data.signable_responses[0]?.payload_hash});const c=await Promise.all(u.data.signable_responses.map((async e=>{const n=await t.signMessage(e.payload_hash);return{sender_vault_id:e.sender_vault_id,receiver_stark_key:e.receiver_stark_key,receiver_vault_id:e.receiver_vault_id,asset_id:e.asset_id,amount:e.amount,nonce:e.nonce,expiration_timestamp:e.expiration_timestamp,stark_signature:n}}))),f={sender_stark_key:u.data.sender_stark_key,requests:c},d=await r.createTransfer({createTransferRequestV2:f},{headers:s});return{transfer_ids:d?.data.transfer_ids}})),aq.TRANSFER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,transfersApi:this.immutableXClient.transfersApi,guardianClient:this.guardianClient})}exchangeTransfer(e){return this.checkIsLoggedIn(),async function({user:e,starkSigner:t,request:n,exchangesApi:r}){return sq((async()=>{const{ethAddress:i}=e.imx,a=n.amount,o=await r.getExchangeSignableTransfer({id:n.transactionID,getSignableTransferRequest:{sender:i,token:kj(n),amount:a,receiver:n.receiver}}),s=await t.getAddress(),{payload_hash:u}=o.data,c=await t.signMessage(u),f={sender_stark_key:o.data.sender_stark_key||s,sender_vault_id:o.data.sender_vault_id,receiver_stark_key:o.data.receiver_stark_key,receiver_vault_id:o.data.receiver_vault_id,asset_id:o.data.asset_id,amount:o.data.amount,nonce:o.data.nonce,expiration_timestamp:o.data.expiration_timestamp,stark_signature:c},d={Authorization:`Bearer ${e.accessToken}`},l=await r.createExchangeTransfer({id:n.transactionID,createTransferRequest:f},{headers:d});return{sent_signature:l?.data.sent_signature,status:l?.data.status?.toString(),time:l?.data.time,transfer_id:l?.data.transfer_id}}),aq.EXCHANGE_TRANSFER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,exchangesApi:this.immutableXClient.exchangeApi})}deposit(e){throw new oq("Operation not supported",aq.OPERATION_NOT_SUPPORTED_ERROR)}prepareWithdrawal(e){throw new oq("Operation not supported",aq.OPERATION_NOT_SUPPORTED_ERROR)}completeWithdrawal(e,t){throw new oq("Operation not supported",aq.OPERATION_NOT_SUPPORTED_ERROR)}getAddress(){return this.checkIsLoggedIn(),Promise.resolve(this.user.imx.ethAddress)}}class xq{authManager;config;confirmationScreen;immutableXClient;magicAdapter;passportEventEmitter;constructor({authManager:e,config:t,confirmationScreen:n,immutableXClient:r,magicAdapter:i,passportEventEmitter:a}){this.authManager=e,this.config=t,this.confirmationScreen=n,this.immutableXClient=r,this.magicAdapter=i,this.passportEventEmitter=a}async getProvider(){const e=await this.authManager.login();return this.createProviderInstance(e)}async getProviderSilent(){const e=await this.authManager.loginSilent();return e?this.createProviderInstance(e):null}async getProviderWithDeviceFlow(e,t,n){const r=await this.authManager.connectImxDeviceFlow(e,t,n);return this.createProviderInstance(r)}async getProviderWithPKCEFlow(e,t){const n=await this.authManager.connectImxPKCEFlow(e,t);return this.createProviderInstance(n)}async getProviderWithCredentials(e){const t=await this.authManager.connectImxWithCredentials(e);return t?this.createProviderInstance(t):null}async createProviderInstance(e){if(!e.idToken)throw new oq("Failed to initialise",aq.WALLET_CONNECTION_ERROR);const t=await this.magicAdapter.login(e.idToken,this.config.network),n=new Nh(t).getSigner(),r=await(async e=>sq((async()=>sx(await TP(e))),aq.WALLET_CONNECTION_ERROR))(n);if(!e.imx?.ethAddress){const t=await this.registerStarkEx(n,r,e.accessToken);return new Iq({user:t,starkSigner:r,immutableXClient:this.immutableXClient,confirmationScreen:this.confirmationScreen,config:this.config,passportEventEmitter:this.passportEventEmitter})}return new Iq({user:e,starkSigner:r,immutableXClient:this.immutableXClient,confirmationScreen:this.confirmationScreen,config:this.config,passportEventEmitter:this.passportEventEmitter})}async registerStarkEx(e,t,n){return sq((async()=>{await async function({ethSigner:e,starkSigner:t,usersApi:n},r){return sq((async()=>{const i=await e.getAddress(),a=await t.getAddress(),o=await n.getSignableRegistrationOffchain({getSignableRegistrationRequest:{ether_key:i,stark_key:a}}),{signable_message:s,payload_hash:u}=o.data,c=await Sj(s,e),f=await t.signMessage(u);return(await n.registerPassportUser({authorization:`Bearer ${r}`,registerPassportUserRequest:{eth_signature:c,ether_key:i,stark_signature:f,stark_key:a}})).statusText}),aq.USER_REGISTRATION_ERROR)}({ethSigner:e,starkSigner:t,usersApi:this.immutableXClient.usersApi},n);return await gq((async()=>{const e=await this.authManager.loginSilent();return!!e?.imx?e:Promise.reject(new Error("user wallet addresses not exist"))}))}),aq.REFRESH_TOKEN_ERROR)}}const Cq=(e,t,n)=>{const r=t.map((t=>!e[t]&&t)).filter((e=>e)).join(", ");if(""!==r){throw new oq(n?`${n} - ${r} cannot be null`:`${r} cannot be null`,aq.INVALID_CONFIGURATION)}};class Mq{network;authenticationDomain;passportDomain;imxPublicApiDomain;magicPublishableApiKey;magicProviderId;oidcConfiguration;baseConfig;zkEvmRpcUrl;relayerUrl;multiRollupConfig;crossSdkBridgeEnabled;constructor({baseConfig:e,overrides:n,crossSdkBridgeEnabled:r,...i}){if(Cq(i,["clientId","logoutRedirectUri","redirectUri"]),this.oidcConfiguration=i,this.baseConfig=e,this.crossSdkBridgeEnabled=r||!1,n)Cq(n,["network","authenticationDomain","passportDomain","magicPublishableApiKey","magicProviderId","zkEvmRpcUrl","relayerUrl","imxPublicApiDomain","indexerMrBasePath","orderBookMrBasePath","passportMrBasePath"],"overrides"),this.network=n.network,this.authenticationDomain=n.authenticationDomain,this.passportDomain=n.passportDomain,this.imxPublicApiDomain=n.imxPublicApiDomain,this.magicPublishableApiKey=n.magicPublishableApiKey,this.magicProviderId=n.magicProviderId,this.zkEvmRpcUrl=n.zkEvmRpcUrl,this.relayerUrl=n.relayerUrl,this.multiRollupConfig={indexer:wt({basePath:n.indexerMrBasePath}),orderBook:wt({basePath:n.orderBookMrBasePath}),passport:wt({basePath:n.passportMrBasePath})};else switch(e.environment){case t.PRODUCTION:this.network=Sq.PRODUCTION,this.authenticationDomain="https://auth.immutable.com",this.magicPublishableApiKey="pk_live_10F423798A540ED7",this.magicProviderId="fSMzaRQ4O7p4fttl7pCyGVtJS_G70P8SNsLXtPPGHo0=",this.passportDomain="https://passport.immutable.com",this.imxPublicApiDomain="https://api.immutable.com",this.zkEvmRpcUrl="",this.relayerUrl="https://api.immutable.com/relayer-mr",this.multiRollupConfig=_t();break;case t.SANDBOX:default:this.network=Sq.SANDBOX,this.authenticationDomain="https://auth.immutable.com",this.magicPublishableApiKey="pk_live_10F423798A540ED7",this.magicProviderId="fSMzaRQ4O7p4fttl7pCyGVtJS_G70P8SNsLXtPPGHo0=",this.passportDomain="https://passport.sandbox.immutable.com",this.imxPublicApiDomain="https://api.sandbox.immutable.com",this.zkEvmRpcUrl="https://rpc.testnet.immutable.com",this.relayerUrl="https://api.sandbox.immutable.com/relayer-mr",this.multiRollupConfig=Et()}}}var Nq;!function(e){e.CONFIRMATION_WINDOW_READY="confirmation_window_ready",e.TRANSACTION_CONFIRMED="transaction_confirmed",e.TRANSACTION_ERROR="transaction_error"}(Nq||(Nq={}));class Pq{config;confirmationWindow;constructor(e){this.config=e}requestConfirmation(e,t,n,r){return new Promise(((i,a)=>{const o=({data:e,origin:t})=>{if(t===this.config.passportDomain&&"imx_passport_confirmation"===e.eventType)switch(e.messageType){case Nq.CONFIRMATION_WINDOW_READY:break;case Nq.TRANSACTION_CONFIRMED:i({confirmed:!0});break;case Nq.TRANSACTION_ERROR:a(new Error("Transaction error"));break;default:a(new Error("Unsupported message type"))}};if(window.addEventListener("message",o),!this.confirmationWindow)return void i({confirmed:!1});let s="";s=n===Tj?`${this.config.passportDomain}/transaction-confirmation/transaction.html?transactionId=${e}&imxEtherAddress=${t}&chainType=starkex`:`${this.config.passportDomain}/transaction-confirmation/zkevm?transactionId=${e}&imxEtherAddress=${t}&chainType=evm&chainId=${r}`,this.confirmationWindow.location.href=s;const u=setInterval((()=>{this.confirmationWindow?.closed&&(clearInterval(u),window.removeEventListener("message",o),i({confirmed:!1}))}),1e3)}))}loading(e){this.config.crossSdkBridgeEnabled||(this.confirmationWindow=(({url:e,title:t,width:n,height:r})=>{const i=Math.max(0,Math.round(window.screenX+(window.outerWidth-n)/2)),a=Math.max(0,Math.round(window.screenY+(window.outerHeight-r)/2)),o=window.open(e,t,`\n scrollbars=yes,\n width=${n}, \n height=${r}, \n top=${a}, \n left=${i}\n `);if(!o)throw new Error("Failed to open confirmation screen");return o.focus(),o})({url:`${this.config.passportDomain}/transaction-confirmation/loading.html`,title:"Confirm this transaction",width:e?.width||480,height:e?.height||380}))}closeWindow(){this.confirmationWindow?.close()}}var Bq,Dq;!function(e){e.PENDING="PENDING",e.SUBMITTED="SUBMITTED",e.SUCCESSFUL="SUCCESSFUL",e.REVERTED="REVERTED",e.FAILED="FAILED"}(Bq||(Bq={})),function(e){e.ACCOUNTS_CHANGED="accountsChanged"}(Dq||(Dq={}));class Fq{emitter=new Qw;emit(e,...t){this.emitter.emit(e,...t)}on(e,t){this.emitter.on(e,t)}removeListener(e,t){this.emitter.removeListener(e,t)}}const Lq=async(e,t,n,r,i)=>{const a=e.map((e=>({delegateCall:!0===e.delegateCall,revertOnError:!0===e.revertOnError,gasLimit:e.gasLimit??da,target:e.to??ca,value:e.value??da,data:e.data??[]})));const o=function(e,t){return xi(Za.encode(["uint256","tuple(\n bool delegateCall,\n bool revertOnError,\n uint256 gasLimit,\n address target,\n uint256 value,\n bytes data\n)[]"],[e,t]))}(t,a),s=tr(xi(Hh(["string","uint256","address","bytes32"],["",n,r,o]))),u=await i.signMessage(s),c=iq({threshold:1,signers:[{weight:1,signature:`${u}02`}]}),f=new os(Oj.mainModule.abi);return f.encodeFunctionData(f.getFunction("execute"),[a,t,c])},Uq=e=>`eip155:${e}`;class jq{config;jsonRpcProvider;user;constructor({config:e,jsonRpcProvider:t,user:n}){this.config=e,this.jsonRpcProvider=t,this.user=n}async postToRelayer(e){const t={id:1,jsonrpc:"2.0",...e},n=await fetch(`${this.config.relayerUrl}/v1/transactions`,{method:"POST",headers:{Authorization:`Bearer ${this.user.accessToken}`,"Content-Type":"application/json"},body:JSON.stringify(t)}),r=await n.json();if(r.error)throw r.error;return r}async ethSendTransaction(e,t){const{chainId:n}=await this.jsonRpcProvider.ready,r={method:"eth_sendTransaction",params:[{to:e,data:t,chainId:Uq(n)}]},{result:i}=await this.postToRelayer(r);return i}async imGetTransactionByHash(e){const t={method:"im_getTransactionByHash",params:[e]},{result:n}=await this.postToRelayer(t);return n}async imGetFeeOptions(e,t){const{chainId:n}=await this.jsonRpcProvider.ready,r={method:"im_getFeeOptions",params:[{userAddress:e,data:t,chainId:Uq(n)}]},{result:i}=await this.postToRelayer(r);return i}}const qq=async({authManager:e,config:t,magicAdapter:n,multiRollupApiClients:r})=>{const i=await e.getUser()||await e.login();if(!i.idToken)throw new Error("User is missing idToken");const a=await n.login(i.idToken,t.network);if(!i.zkEvm){const t=await async function({authManager:e,magicProvider:t,multiRollupApiClients:n,accessToken:r}){const i=new Nh(t).getSigner(),a=await i.getAddress(),o=await Sj("Only sign this message from Immutable Passport",i),s={Authorization:`Bearer ${r}`};try{await n.passportApi.createCounterfactualAddress({createCounterfactualAddressRequest:{ethereumAddress:a,ethereumSignature:o}},{headers:s})}catch(e){throw new _q(wq.INTERNAL_ERROR,`Failed to create counterfactual address: ${e}`)}const u=await e.loginSilent();if(!u?.zkEvm)throw new _q(wq.INTERNAL_ERROR,"Failed to refresh user details");return u}({authManager:e,magicProvider:a,multiRollupApiClients:r,accessToken:i.accessToken});return{user:t,magicProvider:a}}return{user:i,magicProvider:a}},zq=({params:e,magicProvider:t,jsonRpcProvider:n,relayerClient:r,guardianClient:i,user:a})=>i.withConfirmationScreen({width:480,height:520})((async()=>{const o=e[0];if(!o.to)throw new _q(wq.INVALID_PARAMS,'eth_sendTransaction requires a "to" field');const{chainId:s}=await n.ready,u=Tr.from(s),c=new Nh(t).getSigner(),f=await(async(e,t)=>{const n=await e.send("eth_getCode",[t,"latest"]);if(n&&"0x"!==n)return new Hf(t,Oj.mainModule.abi,e).nonce();return 0})(n,a.zkEvm.ethAddress),d={to:o.to,data:o.data,nonce:f,value:o.value,revertOnError:!0},l=await Lq([d],f,u,a.zkEvm.ethAddress,c),p=(await r.imGetFeeOptions(a.zkEvm.ethAddress,l)).find((e=>"IMX"===e.tokenSymbol));if(!p)throw new Error("Failed to retrieve fees for IMX token");const h={nonce:f,to:p.recipientAddress,value:p.tokenPrice,revertOnError:!0};await i.validateEVMTransaction({chainId:Uq(s),nonce:Tq(f),user:a,metaTransactions:[d,h]});const b=await Lq([d,h],f,u,a.zkEvm.ethAddress,c),m=await r.ethSendTransaction(a.zkEvm.ethAddress,b),y=await gq((async()=>{const e=await r.imGetTransactionByHash(m);if(e.status===Bq.PENDING)throw new Error;return e}),{retries:30,interval:1e3,finalErr:new _q(wq.RPC_SERVER_ERROR,"transaction hash not generated in time")});if(![Bq.SUBMITTED,Bq.SUCCESSFUL].includes(y.status))throw new _q(wq.RPC_SERVER_ERROR,`Transaction failed to submit with status ${y.status}`);return y.hash}));class Hq{authManager;config;confirmationScreen;magicAdapter;multiRollupApiClients;jsonRpcProvider;eventEmitter;guardianClient;relayerClient;magicProvider;user;isPassport=!0;constructor({authManager:e,magicAdapter:t,config:n,confirmationScreen:r,multiRollupApiClients:i,passportEventEmitter:a}){this.authManager=e,this.magicAdapter=t,this.config=n,this.confirmationScreen=r,this.jsonRpcProvider=new Cp(this.config.zkEvmRpcUrl),this.multiRollupApiClients=i,this.eventEmitter=new Fq,a.on(Rq.LOGGED_OUT,this.handleLogout)}handleLogout=()=>{const e=this.isLoggedIn();this.magicProvider=void 0,this.user=void 0,this.relayerClient=void 0,this.guardianClient=void 0,e&&this.eventEmitter.emit(Dq.ACCOUNTS_CHANGED,[])};isLoggedIn(){return void 0!==this.magicProvider&&void 0!==this.user&&void 0!==this.relayerClient&&void 0!==this.guardianClient}async performRequest(e){switch(e.method){case"eth_requestAccounts":{if(this.isLoggedIn())return[this.user.zkEvm.ethAddress];const{magicProvider:e,user:t}=await qq({authManager:this.authManager,config:this.config,magicAdapter:this.magicAdapter,multiRollupApiClients:this.multiRollupApiClients});return this.user=t,this.magicProvider=e,this.relayerClient=new jq({config:this.config,jsonRpcProvider:this.jsonRpcProvider,user:this.user}),this.guardianClient=new Aq({accessToken:this.user.accessToken,confirmationScreen:this.confirmationScreen,imxEtherAddress:this.user.zkEvm.ethAddress,config:this.config}),this.eventEmitter.emit(Dq.ACCOUNTS_CHANGED,[this.user.zkEvm.ethAddress]),[this.user.zkEvm.ethAddress]}case"eth_sendTransaction":if(!this.isLoggedIn())throw new _q(vq.UNAUTHORIZED,"Unauthorised - call eth_requestAccounts first");return zq({params:e.params||[],magicProvider:this.magicProvider,guardianClient:this.guardianClient,jsonRpcProvider:this.jsonRpcProvider,relayerClient:this.relayerClient,user:this.user});case"eth_accounts":return this.isLoggedIn()?[this.user.zkEvm.ethAddress]:[];case"eth_gasPrice":case"eth_getBalance":case"eth_getCode":case"eth_getStorageAt":case"eth_estimateGas":case"eth_call":case"eth_blockNumber":case"eth_chainId":case"eth_getBlockByHash":case"eth_getBlockByNumber":case"eth_getTransactionByHash":case"eth_getTransactionReceipt":case"eth_getTransactionCount":return this.jsonRpcProvider.send(e.method,e.params||[]);default:throw new _q(vq.UNSUPPORTED_METHOD,"Method not supported")}}async performJsonRpcRequest(e){const{id:t,jsonrpc:n}=e;try{return{id:t,jsonrpc:n,result:await this.performRequest(e)}}catch(e){let r;return r=e instanceof _q?e:e instanceof Error?new _q(wq.INTERNAL_ERROR,e.message):new _q(wq.INTERNAL_ERROR,"Internal error"),{id:t,jsonrpc:n,error:r}}}async request(e){try{return this.performRequest(e)}catch(e){if(e instanceof _q)throw e;if(e instanceof Error)throw new _q(wq.INTERNAL_ERROR,e.message);throw new _q(wq.INTERNAL_ERROR,"Internal error")}}sendAsync(e,t){if(!t)throw new Error("No callback provided");Array.isArray(e)?Promise.all(e.map(this.performJsonRpcRequest)).then((e=>{t(null,e)})).catch((e=>{t(e,[])})):this.performJsonRpcRequest(e).then((e=>{t(null,e)})).catch((e=>{t(e,null)}))}async send(e,t,n){if("string"==typeof e)return"function"==typeof t?this.sendAsync({method:e,params:[]},t):n?this.sendAsync({method:e,params:Array.isArray(t)?t:[]},n):this.request({method:e,params:Array.isArray(t)?t:[]});if("function"==typeof t)return this.sendAsync(e,t);if(!Array.isArray(e)&&"object"==typeof e)return this.performJsonRpcRequest(e);throw new _q(wq.INVALID_REQUEST,"Invalid request")}on(e,t){this.eventEmitter.on(e,t)}removeListener(e,t){this.eventEmitter.removeListener(e,t)}}var Vq=Object.freeze({__proto__:null,JsonRpcError:_q,get Networks(){return Sq},Passport:class{authManager;config;confirmationScreen;immutableXClient;magicAdapter;multiRollupApiClients;passportImxProviderFactory;passportEventEmitter;constructor(e){this.config=new Mq(e),this.authManager=new hq(this.config),this.magicAdapter=new bq(this.config),this.confirmationScreen=new Pq(this.config),this.immutableXClient=e.overrides?.immutableXClient||new OP({baseConfig:e.baseConfig}),this.multiRollupApiClients=new gt(this.config.multiRollupConfig),this.passportEventEmitter=new Fq,this.passportImxProviderFactory=new xq({authManager:this.authManager,config:this.config,confirmationScreen:this.confirmationScreen,immutableXClient:this.immutableXClient,magicAdapter:this.magicAdapter,passportEventEmitter:this.passportEventEmitter})}async connectImxSilent(){return this.passportImxProviderFactory.getProviderSilent()}async connectImx(){return this.passportImxProviderFactory.getProvider()}async loginWithDeviceFlow(){return this.authManager.loginWithDeviceFlow()}async connectImxDeviceFlow(e,t,n){return this.passportImxProviderFactory.getProviderWithDeviceFlow(e,t,n)}getPKCEAuthorizationUrl(){return this.authManager.getPKCEAuthorizationUrl()}async connectImxPKCEFlow(e,t){return this.passportImxProviderFactory.getProviderWithPKCEFlow(e,t)}checkStoredDeviceFlowCredentials(){return this.authManager.checkStoredDeviceFlowCredentials()}async connectImxWithCredentials(e){return this.passportImxProviderFactory.getProviderWithCredentials(e)}connectEvm(){if(this.config.network===Sq.PRODUCTION)throw new Error("EVM is not supported on production network");return new Hq({passportEventEmitter:this.passportEventEmitter,authManager:this.authManager,magicAdapter:this.magicAdapter,config:this.config,confirmationScreen:this.confirmationScreen,multiRollupApiClients:this.multiRollupApiClients})}async loginCallback(){return this.authManager.loginCallback()}async logout(){await this.authManager.logout(),await this.magicAdapter.logout(),this.passportEventEmitter.emit(Rq.LOGGED_OUT)}async logoutSilentCallback(e){return this.authManager.logoutSilentCallback(e)}async logoutDeviceFlow(){return this.authManager.logoutDeviceFlow()}async getUserInfo(){const e=await this.authManager.getUser();return e?.profile}async getUserInfoDeviceFlow(){const e=await this.authManager.getUserDeviceFlow();return e?.profile}async getIdToken(){const e=await this.authManager.getUser();return e?.idToken}async getAccessToken(){const e=await this.authManager.getUser();return e?.accessToken}},PassportError:oq,get ProviderErrorCode(){return vq},get ProviderEvent(){return Dq},get RpcErrorCode(){return wq}}),Gq=Ct("object"==typeof self?self.FormData:window.FormData),Kq={},Wq={},Xq=Mt(Yj),$q=Mt(ab),Jq={},Yq=Mt(ss),Qq=Mt(Yi),Zq=Mt(io),ez=Mt($f),tz=Mt(mr),nz=Mt(Qo),rz=Mt(Rd),iz=Mt(ul),az=Mt(Ci),oz=Mt(Xn),sz=Mt(td),uz=Mt(Kh),cz=Mt(Cd),fz=Mt(Zr),dz=Mt(ji),lz=Mt(cf),pz=Mt(Ka),hz=Mt(kf),bz=Mt(eb),mz=Mt(hl),yz=Mt(Ml);!function(e){var t=xt&&xt.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=xt&&xt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=xt&&xt.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.formatBytes32String=e.Utf8ErrorFuncs=e.toUtf8String=e.toUtf8CodePoints=e.toUtf8Bytes=e._toEscapedUtf8String=e.nameprep=e.hexDataSlice=e.hexDataLength=e.hexZeroPad=e.hexValue=e.hexStripZeros=e.hexConcat=e.isHexString=e.hexlify=e.base64=e.base58=e.TransactionDescription=e.LogDescription=e.Interface=e.SigningKey=e.HDNode=e.defaultPath=e.isBytesLike=e.isBytes=e.zeroPad=e.stripZeros=e.concat=e.arrayify=e.shallowCopy=e.resolveProperties=e.getStatic=e.defineReadOnly=e.deepCopy=e.checkProperties=e.poll=e.fetchJson=e._fetchData=e.RLP=e.Logger=e.checkResultErrors=e.FormatTypes=e.ParamType=e.FunctionFragment=e.EventFragment=e.ErrorFragment=e.ConstructorFragment=e.Fragment=e.defaultAbiCoder=e.AbiCoder=void 0,e.Indexed=e.Utf8ErrorReason=e.UnicodeNormalizationForm=e.SupportedAlgorithm=e.mnemonicToSeed=e.isValidMnemonic=e.entropyToMnemonic=e.mnemonicToEntropy=e.getAccountPath=e.verifyTypedData=e.verifyMessage=e.recoverPublicKey=e.computePublicKey=e.recoverAddress=e.computeAddress=e.getJsonWalletAddress=e.TransactionTypes=e.serializeTransaction=e.parseTransaction=e.accessListify=e.joinSignature=e.splitSignature=e.soliditySha256=e.solidityKeccak256=e.solidityPack=e.shuffled=e.randomBytes=e.sha512=e.sha256=e.ripemd160=e.keccak256=e.computeHmac=e.commify=e.parseUnits=e.formatUnits=e.parseEther=e.formatEther=e.isAddress=e.getCreate2Address=e.getContractAddress=e.getIcapAddress=e.getAddress=e._TypedDataEncoder=e.id=e.isValidName=e.namehash=e.hashMessage=e.dnsEncode=e.parseBytes32String=void 0;var i=Yq;Object.defineProperty(e,"AbiCoder",{enumerable:!0,get:function(){return i.AbiCoder}}),Object.defineProperty(e,"checkResultErrors",{enumerable:!0,get:function(){return i.checkResultErrors}}),Object.defineProperty(e,"ConstructorFragment",{enumerable:!0,get:function(){return i.ConstructorFragment}}),Object.defineProperty(e,"defaultAbiCoder",{enumerable:!0,get:function(){return i.defaultAbiCoder}}),Object.defineProperty(e,"ErrorFragment",{enumerable:!0,get:function(){return i.ErrorFragment}}),Object.defineProperty(e,"EventFragment",{enumerable:!0,get:function(){return i.EventFragment}}),Object.defineProperty(e,"FormatTypes",{enumerable:!0,get:function(){return i.FormatTypes}}),Object.defineProperty(e,"Fragment",{enumerable:!0,get:function(){return i.Fragment}}),Object.defineProperty(e,"FunctionFragment",{enumerable:!0,get:function(){return i.FunctionFragment}}),Object.defineProperty(e,"Indexed",{enumerable:!0,get:function(){return i.Indexed}}),Object.defineProperty(e,"Interface",{enumerable:!0,get:function(){return i.Interface}}),Object.defineProperty(e,"LogDescription",{enumerable:!0,get:function(){return i.LogDescription}}),Object.defineProperty(e,"ParamType",{enumerable:!0,get:function(){return i.ParamType}}),Object.defineProperty(e,"TransactionDescription",{enumerable:!0,get:function(){return i.TransactionDescription}});var a=Qq;Object.defineProperty(e,"getAddress",{enumerable:!0,get:function(){return a.getAddress}}),Object.defineProperty(e,"getCreate2Address",{enumerable:!0,get:function(){return a.getCreate2Address}}),Object.defineProperty(e,"getContractAddress",{enumerable:!0,get:function(){return a.getContractAddress}}),Object.defineProperty(e,"getIcapAddress",{enumerable:!0,get:function(){return a.getIcapAddress}}),Object.defineProperty(e,"isAddress",{enumerable:!0,get:function(){return a.isAddress}});var o=r(Zq);e.base64=o;var s=ez;Object.defineProperty(e,"base58",{enumerable:!0,get:function(){return s.Base58}});var u=tz;Object.defineProperty(e,"arrayify",{enumerable:!0,get:function(){return u.arrayify}}),Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return u.concat}}),Object.defineProperty(e,"hexConcat",{enumerable:!0,get:function(){return u.hexConcat}}),Object.defineProperty(e,"hexDataSlice",{enumerable:!0,get:function(){return u.hexDataSlice}}),Object.defineProperty(e,"hexDataLength",{enumerable:!0,get:function(){return u.hexDataLength}}),Object.defineProperty(e,"hexlify",{enumerable:!0,get:function(){return u.hexlify}}),Object.defineProperty(e,"hexStripZeros",{enumerable:!0,get:function(){return u.hexStripZeros}}),Object.defineProperty(e,"hexValue",{enumerable:!0,get:function(){return u.hexValue}}),Object.defineProperty(e,"hexZeroPad",{enumerable:!0,get:function(){return u.hexZeroPad}}),Object.defineProperty(e,"isBytes",{enumerable:!0,get:function(){return u.isBytes}}),Object.defineProperty(e,"isBytesLike",{enumerable:!0,get:function(){return u.isBytesLike}}),Object.defineProperty(e,"isHexString",{enumerable:!0,get:function(){return u.isHexString}}),Object.defineProperty(e,"joinSignature",{enumerable:!0,get:function(){return u.joinSignature}}),Object.defineProperty(e,"zeroPad",{enumerable:!0,get:function(){return u.zeroPad}}),Object.defineProperty(e,"splitSignature",{enumerable:!0,get:function(){return u.splitSignature}}),Object.defineProperty(e,"stripZeros",{enumerable:!0,get:function(){return u.stripZeros}});var c=nz;Object.defineProperty(e,"_TypedDataEncoder",{enumerable:!0,get:function(){return c._TypedDataEncoder}}),Object.defineProperty(e,"dnsEncode",{enumerable:!0,get:function(){return c.dnsEncode}}),Object.defineProperty(e,"hashMessage",{enumerable:!0,get:function(){return c.hashMessage}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return c.id}}),Object.defineProperty(e,"isValidName",{enumerable:!0,get:function(){return c.isValidName}}),Object.defineProperty(e,"namehash",{enumerable:!0,get:function(){return c.namehash}});var f=rz;Object.defineProperty(e,"defaultPath",{enumerable:!0,get:function(){return f.defaultPath}}),Object.defineProperty(e,"entropyToMnemonic",{enumerable:!0,get:function(){return f.entropyToMnemonic}}),Object.defineProperty(e,"getAccountPath",{enumerable:!0,get:function(){return f.getAccountPath}}),Object.defineProperty(e,"HDNode",{enumerable:!0,get:function(){return f.HDNode}}),Object.defineProperty(e,"isValidMnemonic",{enumerable:!0,get:function(){return f.isValidMnemonic}}),Object.defineProperty(e,"mnemonicToEntropy",{enumerable:!0,get:function(){return f.mnemonicToEntropy}}),Object.defineProperty(e,"mnemonicToSeed",{enumerable:!0,get:function(){return f.mnemonicToSeed}});var d=iz;Object.defineProperty(e,"getJsonWalletAddress",{enumerable:!0,get:function(){return d.getJsonWalletAddress}});var l=az;Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return l.keccak256}});var p=oz;Object.defineProperty(e,"Logger",{enumerable:!0,get:function(){return p.Logger}});var h=sz;Object.defineProperty(e,"computeHmac",{enumerable:!0,get:function(){return h.computeHmac}}),Object.defineProperty(e,"ripemd160",{enumerable:!0,get:function(){return h.ripemd160}}),Object.defineProperty(e,"sha256",{enumerable:!0,get:function(){return h.sha256}}),Object.defineProperty(e,"sha512",{enumerable:!0,get:function(){return h.sha512}});var b=uz;Object.defineProperty(e,"solidityKeccak256",{enumerable:!0,get:function(){return b.keccak256}}),Object.defineProperty(e,"solidityPack",{enumerable:!0,get:function(){return b.pack}}),Object.defineProperty(e,"soliditySha256",{enumerable:!0,get:function(){return b.sha256}});var m=cz;Object.defineProperty(e,"randomBytes",{enumerable:!0,get:function(){return m.randomBytes}}),Object.defineProperty(e,"shuffled",{enumerable:!0,get:function(){return m.shuffled}});var y=fz;Object.defineProperty(e,"checkProperties",{enumerable:!0,get:function(){return y.checkProperties}}),Object.defineProperty(e,"deepCopy",{enumerable:!0,get:function(){return y.deepCopy}}),Object.defineProperty(e,"defineReadOnly",{enumerable:!0,get:function(){return y.defineReadOnly}}),Object.defineProperty(e,"getStatic",{enumerable:!0,get:function(){return y.getStatic}}),Object.defineProperty(e,"resolveProperties",{enumerable:!0,get:function(){return y.resolveProperties}}),Object.defineProperty(e,"shallowCopy",{enumerable:!0,get:function(){return y.shallowCopy}});var g=r(dz);e.RLP=g;var v=lz;Object.defineProperty(e,"computePublicKey",{enumerable:!0,get:function(){return v.computePublicKey}}),Object.defineProperty(e,"recoverPublicKey",{enumerable:!0,get:function(){return v.recoverPublicKey}}),Object.defineProperty(e,"SigningKey",{enumerable:!0,get:function(){return v.SigningKey}});var w=pz;Object.defineProperty(e,"formatBytes32String",{enumerable:!0,get:function(){return w.formatBytes32String}}),Object.defineProperty(e,"nameprep",{enumerable:!0,get:function(){return w.nameprep}}),Object.defineProperty(e,"parseBytes32String",{enumerable:!0,get:function(){return w.parseBytes32String}}),Object.defineProperty(e,"_toEscapedUtf8String",{enumerable:!0,get:function(){return w._toEscapedUtf8String}}),Object.defineProperty(e,"toUtf8Bytes",{enumerable:!0,get:function(){return w.toUtf8Bytes}}),Object.defineProperty(e,"toUtf8CodePoints",{enumerable:!0,get:function(){return w.toUtf8CodePoints}}),Object.defineProperty(e,"toUtf8String",{enumerable:!0,get:function(){return w.toUtf8String}}),Object.defineProperty(e,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return w.Utf8ErrorFuncs}});var _=hz;Object.defineProperty(e,"accessListify",{enumerable:!0,get:function(){return _.accessListify}}),Object.defineProperty(e,"computeAddress",{enumerable:!0,get:function(){return _.computeAddress}}),Object.defineProperty(e,"parseTransaction",{enumerable:!0,get:function(){return _.parse}}),Object.defineProperty(e,"recoverAddress",{enumerable:!0,get:function(){return _.recoverAddress}}),Object.defineProperty(e,"serializeTransaction",{enumerable:!0,get:function(){return _.serialize}}),Object.defineProperty(e,"TransactionTypes",{enumerable:!0,get:function(){return _.TransactionTypes}});var E=bz;Object.defineProperty(e,"commify",{enumerable:!0,get:function(){return E.commify}}),Object.defineProperty(e,"formatEther",{enumerable:!0,get:function(){return E.formatEther}}),Object.defineProperty(e,"parseEther",{enumerable:!0,get:function(){return E.parseEther}}),Object.defineProperty(e,"formatUnits",{enumerable:!0,get:function(){return E.formatUnits}}),Object.defineProperty(e,"parseUnits",{enumerable:!0,get:function(){return E.parseUnits}});var T=mz;Object.defineProperty(e,"verifyMessage",{enumerable:!0,get:function(){return T.verifyMessage}}),Object.defineProperty(e,"verifyTypedData",{enumerable:!0,get:function(){return T.verifyTypedData}});var A=yz;Object.defineProperty(e,"_fetchData",{enumerable:!0,get:function(){return A._fetchData}}),Object.defineProperty(e,"fetchJson",{enumerable:!0,get:function(){return A.fetchJson}}),Object.defineProperty(e,"poll",{enumerable:!0,get:function(){return A.poll}});var R=sz;Object.defineProperty(e,"SupportedAlgorithm",{enumerable:!0,get:function(){return R.SupportedAlgorithm}});var S=pz;Object.defineProperty(e,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return S.UnicodeNormalizationForm}}),Object.defineProperty(e,"Utf8ErrorReason",{enumerable:!0,get:function(){return S.Utf8ErrorReason}})}(Jq);var gz={};Object.defineProperty(gz,"__esModule",{value:!0}),gz.DomainRegistryABI=void 0;gz.DomainRegistryABI=[{inputs:[{internalType:"string",name:"domain",type:"string"}],name:"DomainAlreadyRegistered",type:"error"},{inputs:[{internalType:"bytes4",name:"tag",type:"bytes4"},{internalType:"uint256",name:"maxIndex",type:"uint256"},{internalType:"uint256",name:"suppliedIndex",type:"uint256"}],name:"DomainIndexOutOfRange",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"domain",type:"string"},{indexed:!1,internalType:"bytes4",name:"tag",type:"bytes4"},{indexed:!1,internalType:"uint256",name:"index",type:"uint256"}],name:"DomainRegistered",type:"event"},{inputs:[{internalType:"bytes4",name:"tag",type:"bytes4"},{internalType:"uint256",name:"index",type:"uint256"}],name:"getDomain",outputs:[{internalType:"string",name:"domain",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"tag",type:"bytes4"}],name:"getDomains",outputs:[{internalType:"string[]",name:"domains",type:"string[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"tag",type:"bytes4"}],name:"getNumberOfDomains",outputs:[{internalType:"uint256",name:"totalDomains",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"string",name:"domain",type:"string"}],name:"setDomain",outputs:[{internalType:"bytes4",name:"tag",type:"bytes4"}],stateMutability:"nonpayable",type:"function"}];var vz={};Object.defineProperty(vz,"__esModule",{value:!0}),vz.SeaportABIv14=void 0;vz.SeaportABIv14=[{inputs:[{internalType:"address",name:"conduitController",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"BadContractSignature",type:"error"},{inputs:[],name:"BadFraction",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"BadReturnValueFromERC20OnTransfer",type:"error"},{inputs:[{internalType:"uint8",name:"v",type:"uint8"}],name:"BadSignatureV",type:"error"},{inputs:[],name:"CannotCancelOrder",type:"error"},{inputs:[],name:"ConsiderationCriteriaResolverOutOfRange",type:"error"},{inputs:[],name:"ConsiderationLengthNotEqualToTotalOriginal",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"considerationIndex",type:"uint256"},{internalType:"uint256",name:"shortfallAmount",type:"uint256"}],name:"ConsiderationNotMet",type:"error"},{inputs:[],name:"CriteriaNotEnabledForItem",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"identifiers",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],name:"ERC1155BatchTransferGenericFailure",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"EtherTransferGenericFailure",type:"error"},{inputs:[],name:"InexactFraction",type:"error"},{inputs:[],name:"InsufficientEtherSupplied",type:"error"},{inputs:[],name:"Invalid1155BatchTransferEncoding",type:"error"},{inputs:[],name:"InvalidBasicOrderParameterEncoding",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"InvalidCallToConduit",type:"error"},{inputs:[{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"address",name:"conduit",type:"address"}],name:"InvalidConduit",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"InvalidContractOrder",type:"error"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"InvalidERC721TransferAmount",type:"error"},{inputs:[],name:"InvalidFulfillmentComponentData",type:"error"},{inputs:[{internalType:"uint256",name:"value",type:"uint256"}],name:"InvalidMsgValue",type:"error"},{inputs:[],name:"InvalidNativeOfferItem",type:"error"},{inputs:[],name:"InvalidProof",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"InvalidRestrictedOrder",type:"error"},{inputs:[],name:"InvalidSignature",type:"error"},{inputs:[],name:"InvalidSigner",type:"error"},{inputs:[{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"}],name:"InvalidTime",type:"error"},{inputs:[{internalType:"uint256",name:"fulfillmentIndex",type:"uint256"}],name:"MismatchedFulfillmentOfferAndConsiderationComponents",type:"error"},{inputs:[{internalType:"enum Side",name:"side",type:"uint8"}],name:"MissingFulfillmentComponentOnAggregation",type:"error"},{inputs:[],name:"MissingItemAmount",type:"error"},{inputs:[],name:"MissingOriginalConsiderationItems",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"NoContract",type:"error"},{inputs:[],name:"NoReentrantCalls",type:"error"},{inputs:[],name:"NoSpecifiedOrdersAvailable",type:"error"},{inputs:[],name:"OfferAndConsiderationRequiredOnFulfillment",type:"error"},{inputs:[],name:"OfferCriteriaResolverOutOfRange",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderAlreadyFilled",type:"error"},{inputs:[{internalType:"enum Side",name:"side",type:"uint8"}],name:"OrderCriteriaResolverOutOfRange",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderIsCancelled",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderPartiallyFilled",type:"error"},{inputs:[],name:"PartialFillsNotEnabledForOrder",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"TokenTransferGenericFailure",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"considerationIndex",type:"uint256"}],name:"UnresolvedConsiderationCriteria",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"offerIndex",type:"uint256"}],name:"UnresolvedOfferCriteria",type:"error"},{inputs:[],name:"UnusedItemParameters",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"newCounter",type:"uint256"},{indexed:!0,internalType:"address",name:"offerer",type:"address"}],name:"CounterIncremented",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"}],name:"OrderCancelled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"},{indexed:!1,internalType:"address",name:"recipient",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],indexed:!1,internalType:"struct SpentItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],indexed:!1,internalType:"struct ReceivedItem[]",name:"consideration",type:"tuple[]"}],name:"OrderFulfilled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],indexed:!1,internalType:"struct OrderParameters",name:"orderParameters",type:"tuple"}],name:"OrderValidated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32[]",name:"orderHashes",type:"bytes32[]"}],name:"OrdersMatched",type:"event"},{inputs:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"counter",type:"uint256"}],internalType:"struct OrderComponents[]",name:"orders",type:"tuple[]"}],name:"cancel",outputs:[{internalType:"bool",name:"cancelled",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"uint120",name:"numerator",type:"uint120"},{internalType:"uint120",name:"denominator",type:"uint120"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes",name:"extraData",type:"bytes"}],internalType:"struct AdvancedOrder",name:"advancedOrder",type:"tuple"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"enum Side",name:"side",type:"uint8"},{internalType:"uint256",name:"index",type:"uint256"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"bytes32[]",name:"criteriaProof",type:"bytes32[]"}],internalType:"struct CriteriaResolver[]",name:"criteriaResolvers",type:"tuple[]"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"address",name:"recipient",type:"address"}],name:"fulfillAdvancedOrder",outputs:[{internalType:"bool",name:"fulfilled",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"uint120",name:"numerator",type:"uint120"},{internalType:"uint120",name:"denominator",type:"uint120"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes",name:"extraData",type:"bytes"}],internalType:"struct AdvancedOrder[]",name:"advancedOrders",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"enum Side",name:"side",type:"uint8"},{internalType:"uint256",name:"index",type:"uint256"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"bytes32[]",name:"criteriaProof",type:"bytes32[]"}],internalType:"struct CriteriaResolver[]",name:"criteriaResolvers",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"offerFulfillments",type:"tuple[][]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"considerationFulfillments",type:"tuple[][]"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"maximumFulfilled",type:"uint256"}],name:"fulfillAvailableAdvancedOrders",outputs:[{internalType:"bool[]",name:"availableOrders",type:"bool[]"},{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"executions",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order[]",name:"orders",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"offerFulfillments",type:"tuple[][]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"considerationFulfillments",type:"tuple[][]"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"uint256",name:"maximumFulfilled",type:"uint256"}],name:"fulfillAvailableOrders",outputs:[{internalType:"bool[]",name:"availableOrders",type:"bool[]"},{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"executions",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"considerationToken",type:"address"},{internalType:"uint256",name:"considerationIdentifier",type:"uint256"},{internalType:"uint256",name:"considerationAmount",type:"uint256"},{internalType:"address payable",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{internalType:"address",name:"offerToken",type:"address"},{internalType:"uint256",name:"offerIdentifier",type:"uint256"},{internalType:"uint256",name:"offerAmount",type:"uint256"},{internalType:"enum BasicOrderType",name:"basicOrderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"offererConduitKey",type:"bytes32"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalAdditionalRecipients",type:"uint256"},{components:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct AdditionalRecipient[]",name:"additionalRecipients",type:"tuple[]"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct BasicOrderParameters",name:"parameters",type:"tuple"}],name:"fulfillBasicOrder",outputs:[{internalType:"bool",name:"fulfilled",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order",name:"order",type:"tuple"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"}],name:"fulfillOrder",outputs:[{internalType:"bool",name:"fulfilled",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"contractOfferer",type:"address"}],name:"getContractOffererNonce",outputs:[{internalType:"uint256",name:"nonce",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"offerer",type:"address"}],name:"getCounter",outputs:[{internalType:"uint256",name:"counter",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"counter",type:"uint256"}],internalType:"struct OrderComponents",name:"order",type:"tuple"}],name:"getOrderHash",outputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"getOrderStatus",outputs:[{internalType:"bool",name:"isValidated",type:"bool"},{internalType:"bool",name:"isCancelled",type:"bool"},{internalType:"uint256",name:"totalFilled",type:"uint256"},{internalType:"uint256",name:"totalSize",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"incrementCounter",outputs:[{internalType:"uint256",name:"newCounter",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"information",outputs:[{internalType:"string",name:"version",type:"string"},{internalType:"bytes32",name:"domainSeparator",type:"bytes32"},{internalType:"address",name:"conduitController",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"uint120",name:"numerator",type:"uint120"},{internalType:"uint120",name:"denominator",type:"uint120"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes",name:"extraData",type:"bytes"}],internalType:"struct AdvancedOrder[]",name:"orders",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"enum Side",name:"side",type:"uint8"},{internalType:"uint256",name:"index",type:"uint256"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"bytes32[]",name:"criteriaProof",type:"bytes32[]"}],internalType:"struct CriteriaResolver[]",name:"criteriaResolvers",type:"tuple[]"},{components:[{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"offerComponents",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"considerationComponents",type:"tuple[]"}],internalType:"struct Fulfillment[]",name:"fulfillments",type:"tuple[]"},{internalType:"address",name:"recipient",type:"address"}],name:"matchAdvancedOrders",outputs:[{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"executions",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order[]",name:"orders",type:"tuple[]"},{components:[{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"offerComponents",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"considerationComponents",type:"tuple[]"}],internalType:"struct Fulfillment[]",name:"fulfillments",type:"tuple[]"}],name:"matchOrders",outputs:[{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"executions",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"contractName",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order[]",name:"orders",type:"tuple[]"}],name:"validate",outputs:[{internalType:"bool",name:"validated",type:"bool"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}];var wz={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DOMAIN_REGISTRY_ADDRESS=e.CROSS_CHAIN_SEAPORT_V1_5_ADDRESS=e.CROSS_CHAIN_SEAPORT_V1_4_ADDRESS=e.KNOWN_CONDUIT_KEYS_TO_CONDUIT=e.NO_CONDUIT=e.ONE_HUNDRED_PERCENT_BP=e.MAX_INT=e.BasicOrderRouteType=e.Side=e.ItemType=e.OrderType=e.EIP_712_BULK_ORDER_TYPE=e.EIP_712_ORDER_TYPE=e.OPENSEA_CONDUIT_ADDRESS=e.OPENSEA_CONDUIT_KEY=e.SEAPORT_CONTRACT_VERSION_V1_5=e.SEAPORT_CONTRACT_VERSION_V1_4=e.SEAPORT_CONTRACT_NAME=void 0;const t=$q;var n,r,i,a;e.SEAPORT_CONTRACT_NAME="Seaport",e.SEAPORT_CONTRACT_VERSION_V1_4="1.4",e.SEAPORT_CONTRACT_VERSION_V1_5="1.5",e.OPENSEA_CONDUIT_KEY="0x0000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f0000",e.OPENSEA_CONDUIT_ADDRESS="0x1e0049783f008a0085193e00003d00cd54003c71",e.EIP_712_ORDER_TYPE={OrderComponents:[{name:"offerer",type:"address"},{name:"zone",type:"address"},{name:"offer",type:"OfferItem[]"},{name:"consideration",type:"ConsiderationItem[]"},{name:"orderType",type:"uint8"},{name:"startTime",type:"uint256"},{name:"endTime",type:"uint256"},{name:"zoneHash",type:"bytes32"},{name:"salt",type:"uint256"},{name:"conduitKey",type:"bytes32"},{name:"counter",type:"uint256"}],OfferItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"}],ConsiderationItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"},{name:"recipient",type:"address"}]},e.EIP_712_BULK_ORDER_TYPE={BulkOrder:[{name:"tree",type:"OrderComponents[2][2][2][2][2][2][2]"}],OrderComponents:[{name:"offerer",type:"address"},{name:"zone",type:"address"},{name:"offer",type:"OfferItem[]"},{name:"consideration",type:"ConsiderationItem[]"},{name:"orderType",type:"uint8"},{name:"startTime",type:"uint256"},{name:"endTime",type:"uint256"},{name:"zoneHash",type:"bytes32"},{name:"salt",type:"uint256"},{name:"conduitKey",type:"bytes32"},{name:"counter",type:"uint256"}],OfferItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"}],ConsiderationItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"},{name:"recipient",type:"address"}]},function(e){e[e.FULL_OPEN=0]="FULL_OPEN",e[e.PARTIAL_OPEN=1]="PARTIAL_OPEN",e[e.FULL_RESTRICTED=2]="FULL_RESTRICTED",e[e.PARTIAL_RESTRICTED=3]="PARTIAL_RESTRICTED"}(n||(e.OrderType=n={})),function(e){e[e.NATIVE=0]="NATIVE",e[e.ERC20=1]="ERC20",e[e.ERC721=2]="ERC721",e[e.ERC1155=3]="ERC1155",e[e.ERC721_WITH_CRITERIA=4]="ERC721_WITH_CRITERIA",e[e.ERC1155_WITH_CRITERIA=5]="ERC1155_WITH_CRITERIA"}(r||(e.ItemType=r={})),function(e){e[e.OFFER=0]="OFFER",e[e.CONSIDERATION=1]="CONSIDERATION"}(i||(e.Side=i={})),function(e){e[e.ETH_TO_ERC721=0]="ETH_TO_ERC721",e[e.ETH_TO_ERC1155=1]="ETH_TO_ERC1155",e[e.ERC20_TO_ERC721=2]="ERC20_TO_ERC721",e[e.ERC20_TO_ERC1155=3]="ERC20_TO_ERC1155",e[e.ERC721_TO_ERC20=4]="ERC721_TO_ERC20",e[e.ERC1155_TO_ERC20=5]="ERC1155_TO_ERC20"}(a||(e.BasicOrderRouteType=a={})),e.MAX_INT=t.BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),e.ONE_HUNDRED_PERCENT_BP=1e4,e.NO_CONDUIT="0x0000000000000000000000000000000000000000000000000000000000000000",e.KNOWN_CONDUIT_KEYS_TO_CONDUIT={[e.OPENSEA_CONDUIT_KEY]:e.OPENSEA_CONDUIT_ADDRESS},e.CROSS_CHAIN_SEAPORT_V1_4_ADDRESS="0x00000000000001ad428e4906aE43D8F9852d0dD6",e.CROSS_CHAIN_SEAPORT_V1_5_ADDRESS="0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC",e.DOMAIN_REGISTRY_ADDRESS="0x000000000DaD0DE04D2B2D4a5A74581EBA94124A"}(wz);var _z={},Ez={};Object.defineProperty(Ez,"__esModule",{value:!0}),Ez.ERC20ABI=void 0;Ez.ERC20ABI=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"PERMIT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}];var Tz={};Object.defineProperty(Tz,"__esModule",{value:!0}),Tz.ERC721ABI=void 0;Tz.ERC721ABI=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"pure",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}];var Az,Rz={},Sz={};function kz(){if(Az)return Sz;Az=1,Object.defineProperty(Sz,"__esModule",{value:!0}),Sz.getItemToCriteriaMap=Sz.generateCriteriaResolvers=void 0;const e=wz,t=xz();Sz.generateCriteriaResolvers=({orders:n,offerCriterias:r=[[]],considerationCriterias:i=[[]]})=>{const a=n.flatMap(((n,r)=>n.parameters.offer.map(((t,n)=>({orderIndex:r,item:t,index:n,side:e.Side.OFFER}))).filter((({item:e})=>(0,t.isCriteriaItem)(e.itemType))))),o=n.flatMap(((n,r)=>n.parameters.consideration.map(((t,n)=>({orderIndex:r,item:t,index:n,side:e.Side.CONSIDERATION}))).filter((({item:e})=>(0,t.isCriteriaItem)(e.itemType))))),s=(e,t)=>e.map((({orderIndex:e,item:n,index:r,side:i})=>{const a=n.identifierOrCriteria||"0",o=t[e][r];return{orderIndex:e,index:r,side:i,identifier:o.identifier,criteriaProof:"0"===a?[]:o.proof}}));return[...s(a,r),...s(o,i)]};return Sz.getItemToCriteriaMap=(e,n)=>{const r=[...n];return e.reduce(((e,n)=>((0,t.isCriteriaItem)(n.itemType)&&e.set(n,r.shift()),e)),new Map)},Sz}var Oz,Iz={};function xz(){return Oz||(Oz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMaximumSizeForOrder=e.getSummedTokenAndIdentifierAmounts=e.getPresentItemAmount=e.isCriteriaItem=e.isErc1155Item=e.isErc721Item=e.isErc20Item=e.isNativeCurrencyItem=e.isCurrencyItem=void 0;const t=$q,n=wz,r=kz(),i=Iz;e.isCurrencyItem=({itemType:e})=>[n.ItemType.NATIVE,n.ItemType.ERC20].includes(e);e.isNativeCurrencyItem=({itemType:e})=>e===n.ItemType.NATIVE;e.isErc20Item=e=>e===n.ItemType.ERC20;e.isErc721Item=e=>[n.ItemType.ERC721,n.ItemType.ERC721_WITH_CRITERIA].includes(e);e.isErc1155Item=e=>[n.ItemType.ERC1155,n.ItemType.ERC1155_WITH_CRITERIA].includes(e);e.isCriteriaItem=e=>[n.ItemType.ERC721_WITH_CRITERIA,n.ItemType.ERC1155_WITH_CRITERIA].includes(e);e.getPresentItemAmount=({startAmount:e,endAmount:n,timeBasedItemParams:r})=>{const i=t.BigNumber.from(e),a=t.BigNumber.from(n);if(!r)return i.gt(a)?i:a;const{isConsiderationItem:o,currentBlockTimestamp:s,ascendingAmountTimestampBuffer:u,startTime:c,endTime:f}=r,d=t.BigNumber.from(f).sub(c),l=a.gt(e),p=t.BigNumber.from(l?s+u:s);if(p.lt(c))return i;const h=(p.gt(f)?t.BigNumber.from(f):p).sub(c),b=d.sub(h);return i.mul(b).add(a.mul(h)).add(o?d.sub(1):0).div(d)};e.getSummedTokenAndIdentifierAmounts=({items:n,criterias:i,timeBasedItemParams:a})=>{const o=(0,r.getItemToCriteriaMap)(n,i),s=n.reduce(((n,r)=>{var i,s,u,c;const f=null!==(s=null===(i=o.get(r))||void 0===i?void 0:i.identifier)&&void 0!==s?s:r.identifierOrCriteria;return Object.assign(Object.assign({},n),{[r.token]:Object.assign(Object.assign({},n[r.token]),{[f]:(null!==(c=null===(u=n[r.token])||void 0===u?void 0:u[f])&&void 0!==c?c:t.BigNumber.from(0)).add((0,e.getPresentItemAmount)({startAmount:r.startAmount,endAmount:r.endAmount,timeBasedItemParams:a}))})})}),{});return s};e.getMaximumSizeForOrder=({parameters:{offer:e,consideration:t}})=>{const n=[...e,...t].flatMap((({startAmount:e,endAmount:t})=>[e,t]));return(0,i.findGcd)(n)}}(Rz)),Rz}!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.findGcd=e.gcd=void 0;const t=$q;e.gcd=(n,r)=>{const i=t.BigNumber.from(n),a=t.BigNumber.from(r);return i.eq(0)?a:(0,e.gcd)(a.mod(n),i)};e.findGcd=n=>{let r=t.BigNumber.from(n[0]);for(let t=1;t<n.length;t++)if(r=(0,e.gcd)(n[t],r),r.eq(1))return r;return r}}(Iz);var Cz={};!function(e){var t=xt&&xt.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.getTagFromDomain=e.getTransactionMethods=e.executeAllActions=void 0;const n=Jq;e.executeAllActions=e=>t(void 0,void 0,void 0,(function*(){for(let t=0;t<e.length-1;t++){const n=e[t];if("approval"===n.type){const e=yield n.transactionMethods.transact();yield e.wait()}}const t=e[e.length-1];switch(t.type){case"create":return t.createOrder();case"createBulk":return t.createBulkOrders();default:return t.transactionMethods.transact()}}));e.getTransactionMethods=(n,r,i,a)=>{const o=i[i.length-1];let s;(e=>{const t=["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","type","accessList","customData","ccipReadEnabled","value","blockTag","CallOverrides"];return void 0===e||Object.keys(e).every((e=>t.includes(e)))})(o)&&(s=o,i.pop());const u=o=>t(void 0,void 0,void 0,(function*(){const t=Object.assign(Object.assign({},s),o),u=yield n.populateTransaction[r](...i,t);if(a){const t=(0,e.getTagFromDomain)(a);u.data=u.data+t}return u}));return{callStatic:e=>{const t=Object.assign(Object.assign({},s),e);return n.callStatic[r](...i,t)},estimateGas:e=>{const t=Object.assign(Object.assign({},s),e);return n.estimateGas[r](...i,t)},transact:e=>t(void 0,void 0,void 0,(function*(){const t=Object.assign(Object.assign({},s),e),r=yield u(t);return n.signer.sendTransaction(r)})),buildTransaction:u}};e.getTagFromDomain=e=>(0,n.keccak256)((0,n.toUtf8Bytes)(e)).slice(2,10)}(Cz);var Mz=xt&&xt.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(_z,"__esModule",{value:!0}),_z.getApprovalActions=_z.approvedItemAmount=void 0;const Nz=$q,Pz=Ez,Bz=Tz,Dz=wz,Fz=xz(),Lz=Cz;_z.approvedItemAmount=(e,t,n,r)=>Mz(void 0,void 0,void 0,(function*(){if((0,Fz.isErc721Item)(t.itemType)||(0,Fz.isErc1155Item)(t.itemType)){return new Nz.Contract(t.token,Bz.ERC721ABI,r).isApprovedForAll(e,n).then((e=>e?Dz.MAX_INT:Nz.BigNumber.from(0)))}if(t.itemType===Dz.ItemType.ERC20){return new Nz.Contract(t.token,Pz.ERC20ABI,r).allowance(e,n)}return Dz.MAX_INT})),_z.getApprovalActions=function(e,t,n){return e.filter(((t,n)=>n===e.length-1||e[n+1].token!==t.token)).map((({token:e,operator:r,itemType:i,identifierOrCriteria:a,requiredApprovedAmount:o})=>{const s=(0,Fz.isErc1155Item)(i);if((0,Fz.isErc721Item)(i)||s){const o=new Nz.Contract(e,Bz.ERC721ABI,n);return{type:"approval",token:e,identifierOrCriteria:a,itemType:i,operator:r,transactionMethods:(0,Lz.getTransactionMethods)(o.connect(n),t&&!s?"approve":"setApprovalForAll",[r,!(t&&!s)||a])}}{const s=new Nz.Contract(e,Pz.ERC20ABI,n);return{type:"approval",token:e,identifierOrCriteria:a,itemType:i,transactionMethods:(0,Lz.getTransactionMethods)(s.connect(n),"approve",[r,t?o:Dz.MAX_INT]),operator:r}}}))};var Uz={},jz={},qz={};Object.defineProperty(qz,"__esModule",{value:!0}),qz.ERC1155ABI=void 0;qz.ERC1155ABI=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"amounts",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"owners",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"balances",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"uri",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}];var zz=xt&&xt.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(jz,"__esModule",{value:!0}),jz.balanceOf=void 0;const Hz=$q,Vz=qz,Gz=Ez,Kz=Tz,Wz=wz,Xz=xz();jz.balanceOf=(e,t,n,r)=>zz(void 0,void 0,void 0,(function*(){if((0,Xz.isErc721Item)(t.itemType)){const i=new Hz.Contract(t.token,Kz.ERC721ABI,n);return t.itemType===Wz.ItemType.ERC721_WITH_CRITERIA?r?i.ownerOf(r.identifier).then((t=>Hz.BigNumber.from(Number(t.toLowerCase()===e.toLowerCase())))):i.balanceOf(e):i.ownerOf(t.identifierOrCriteria).then((t=>Hz.BigNumber.from(Number(t.toLowerCase()===e.toLowerCase()))))}if((0,Xz.isErc1155Item)(t.itemType)){const i=new Hz.Contract(t.token,Vz.ERC1155ABI,n);if(t.itemType===Wz.ItemType.ERC1155_WITH_CRITERIA){if(!r){const e=Hz.BigNumber.from(t.startAmount),n=Hz.BigNumber.from(t.endAmount);return e.gt(n)?e:n}return i.balanceOf(e,r.identifier)}return i.balanceOf(e,t.identifierOrCriteria)}if((0,Xz.isErc20Item)(t.itemType)){return new Hz.Contract(t.token,Gz.ERC20ABI,n).balanceOf(e)}return n.getBalance(e)})),function(e){var t=xt&&xt.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.validateStandardFulfillBalancesAndApprovals=e.validateBasicFulfillBalancesAndApprovals=e.validateOfferBalancesAndApprovals=e.getInsufficientBalanceAndApprovalAmounts=e.getBalancesAndApprovals=void 0;const n=$q,r=wz,i=_z,a=jz,o=kz(),s=xz(),u=(e,t,n)=>{const r=e.find((({token:e,identifierOrCriteria:r})=>t.toLowerCase()===e.toLowerCase()&&r.toLowerCase()===n.toLowerCase()));if(!r)throw new Error("Balances and approvals didn't contain all tokens and identifiers");return r};e.getBalancesAndApprovals=({owner:e,items:u,criterias:c,operator:f,multicallProvider:d})=>t(void 0,void 0,void 0,(function*(){const l=(0,o.getItemToCriteriaMap)(u,c);return Promise.all(u.map((o=>t(void 0,void 0,void 0,(function*(){var t,u;let c=Promise.resolve(n.BigNumber.from(0));return c=(0,s.isErc721Item)(o.itemType)||(0,s.isErc1155Item)(o.itemType)||(0,s.isErc20Item)(o.itemType)?(0,i.approvedItemAmount)(e,o,f,d):Promise.resolve(r.MAX_INT),{token:o.token,identifierOrCriteria:null!==(u=null===(t=l.get(o))||void 0===t?void 0:t.identifier)&&void 0!==u?u:o.identifierOrCriteria,balance:yield(0,a.balanceOf)(e,o,d,l.get(o)),approvedAmount:yield c,itemType:o.itemType}})))))}));e.getInsufficientBalanceAndApprovalAmounts=({balancesAndApprovals:e,tokenAndIdentifierAmounts:t,operator:n})=>{const r=[...Object.entries(t).map((([e,t])=>Object.entries(t).map((([t,n])=>[e,t,n]))))].flat(),i=t=>r.filter((([n,r,i])=>u(e,n,r)[t].lt(i))).map((([n,r,i])=>{const a=u(e,n,r);return{token:n,identifierOrCriteria:r,requiredAmount:i,amountHave:a[t],itemType:a.itemType}})),[a,o]=[i("balance"),i("approvedAmount").map((e=>({token:e.token,identifierOrCriteria:e.identifierOrCriteria,approvedAmount:e.amountHave,requiredApprovedAmount:e.requiredAmount,itemType:e.itemType,operator:n})))];return{insufficientBalances:a,insufficientApprovals:o}};e.validateOfferBalancesAndApprovals=({offer:t,criterias:n,balancesAndApprovals:r,timeBasedItemParams:i,throwOnInsufficientBalances:a=!0,throwOnInsufficientApprovals:o,operator:u})=>{const{insufficientBalances:c,insufficientApprovals:f}=(0,e.getInsufficientBalanceAndApprovalAmounts)({balancesAndApprovals:r,tokenAndIdentifierAmounts:(0,s.getSummedTokenAndIdentifierAmounts)({items:t,criterias:n,timeBasedItemParams:i?Object.assign(Object.assign({},i),{isConsiderationItem:!1}):void 0}),operator:u});if(a&&c.length>0)throw new Error("The offerer does not have the amount needed to create or fulfill.");if(o&&f.length>0)throw new Error("The offerer does not have the sufficient approvals.");return f};e.validateBasicFulfillBalancesAndApprovals=({offer:t,consideration:n,offererBalancesAndApprovals:r,fulfillerBalancesAndApprovals:i,timeBasedItemParams:a,offererOperator:o,fulfillerOperator:u})=>{(0,e.validateOfferBalancesAndApprovals)({offer:t,criterias:[],balancesAndApprovals:r,timeBasedItemParams:a,throwOnInsufficientApprovals:!0,operator:o});const c=n.filter((e=>e.itemType!==t[0].itemType)),{insufficientBalances:f,insufficientApprovals:d}=(0,e.getInsufficientBalanceAndApprovalAmounts)({balancesAndApprovals:i,tokenAndIdentifierAmounts:(0,s.getSummedTokenAndIdentifierAmounts)({items:c,criterias:[],timeBasedItemParams:Object.assign(Object.assign({},a),{isConsiderationItem:!0})}),operator:u});if(f.length>0)throw new Error("The fulfiller does not have the balances needed to fulfill.");return d};e.validateStandardFulfillBalancesAndApprovals=({offer:t,consideration:n,offerCriteria:r,considerationCriteria:i,offererBalancesAndApprovals:a,fulfillerBalancesAndApprovals:o,timeBasedItemParams:u,offererOperator:f,fulfillerOperator:d})=>{(0,e.validateOfferBalancesAndApprovals)({offer:t,criterias:r,balancesAndApprovals:a,timeBasedItemParams:u,throwOnInsufficientApprovals:!0,operator:f});const l=c({items:t,criterias:r,balancesAndApprovals:o,timeBasedItemParams:u}),{insufficientBalances:p,insufficientApprovals:h}=(0,e.getInsufficientBalanceAndApprovalAmounts)({balancesAndApprovals:l,tokenAndIdentifierAmounts:(0,s.getSummedTokenAndIdentifierAmounts)({items:n,criterias:i,timeBasedItemParams:Object.assign(Object.assign({},u),{isConsiderationItem:!0})}),operator:d});if(p.length>0)throw new Error("The fulfiller does not have the balances needed to fulfill.");return h};const c=({items:e,criterias:t,timeBasedItemParams:n,balancesAndApprovals:r})=>{const i=(0,s.getSummedTokenAndIdentifierAmounts)({items:e,criterias:t,timeBasedItemParams:Object.assign(Object.assign({},n),{isConsiderationItem:!1})}),a=r.map((e=>Object.assign({},e)));return Object.entries(i).forEach((([e,t])=>Object.entries(t).forEach((([t,n])=>{const r=u(a,e,t),i=a.indexOf(r);a[i].balance=a[i].balance.add(n)})))),a}}(Uz);var $z,Jz={},Yz={},Qz={},Zz={},eH={exports:{}},tH={exports:{}};function nH(){return $z||($z=1,function(e,t){e.exports=function(){var e=e||function(e,t){var n=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),r={},i=r.lib={},a=i.Base={extend:function(e){var t=n(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},o=i.WordArray=a.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var a=0;a<i;a++){var o=n[a>>>2]>>>24-a%4*8&255;t[r+a>>>2]|=o<<24-(r+a)%4*8}else for(a=0;a<i;a+=4)t[r+a>>>2]=n[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n,r=[],i=function(t){var n=987654321,r=4294967295;return function(){var i=((n=36969*(65535&n)+(n>>16)&r)<<16)+(t=18e3*(65535&t)+(t>>16)&r)&r;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}},a=0;a<t;a+=4){var s=i(4294967296*(n||e.random()));n=987654071*s(),r.push(4294967296*s()|0)}return new o.init(r,t)}}),s=r.enc={},u=s.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var a=t[i>>>2]>>>24-i%4*8&255;r.push((a>>>4).toString(16)),r.push((15&a).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new o.init(n,t/2)}},c=s.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var a=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(a))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new o.init(n,t)}},f=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},d=i.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,i=n.sigBytes,a=this.blockSize,s=i/(4*a),u=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,c=e.min(4*u,i);if(u){for(var f=0;f<u;f+=a)this._doProcessBlock(r,f);var d=r.splice(0,u);n.sigBytes-=c}return new o.init(d,c)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});i.Hasher=d.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new l.HMAC.init(e,n).finalize(t)}}});var l=r.algo={};return r}(Math);return e}()}(tH)),tH.exports}!function(e,t){e.exports=function(e){return function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.algo,s=[],u=[];!function(){function e(e){for(var n=t.sqrt(e),r=2;r<=n;r++)if(!(e%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(s[i]=n(t.pow(r,.5))),u[i]=n(t.pow(r,1/3)),i++),r++}();var c=[],f=o.SHA256=a.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],f=n[5],d=n[6],l=n[7],p=0;p<64;p++){if(p<16)c[p]=0|e[t+p];else{var h=c[p-15],b=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,m=c[p-2],y=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;c[p]=b+c[p-7]+y+c[p-16]}var g=r&i^r&a^i&a,v=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),w=l+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&f^~s&d)+u[p]+c[p];l=d,d=f,f=s,s=o+w|0,o=a,a=i,i=r,r=w+(v+g)|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+a|0,n[3]=n[3]+o|0,n[4]=n[4]+s|0,n[5]=n[5]+f|0,n[6]=n[6]+d|0,n[7]=n[7]+l|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=t.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});n.SHA256=a._createHelper(f),n.HmacSHA256=a._createHmacHelper(f)}(Math),e.SHA256}(nH())}(eH);var rH=eH.exports,iH={exports:{}};!function(e,t){e.exports=function(){function e(e,t){var n=t?"└":"├";return n+=e?"─ ":"──┐"}function t(e,t){var n=[];for(var r in e)e.hasOwnProperty(r)&&(t&&"function"==typeof e[r]||n.push(r));return n}function n(r,i,a,o,s,u,c){var f,d,l="",p=0,h=o.slice(0);if(h.push([i,a])&&o.length>0&&(o.forEach((function(e,t){t>0&&(l+=(e[1]?" ":"│")+" "),d||e[0]!==i||(d=!0)})),l+=e(r,a)+r,s&&("object"!=typeof i||i instanceof Date)&&(l+=": "+i),d&&(l+=" (circular ref.)"),c(l)),!d&&"object"==typeof i){var b=t(i,u);b.forEach((function(e){f=++p===b.length,n(e,i[e],f,h,s,u,c)}))}}var r={asLines:function(e,t,r,i){n(".",e,!1,[],t,"function"!=typeof r&&r,i||r)},asTree:function(e,t,r){var i="";return n(".",e,!1,[],t,r,(function(e){i+=e+"\n"})),i}};return r}()}(iH);var aH,oH=iH.exports,sH={},uH={exports:{}},cH={exports:{}};function fH(){return aH||(aH=1,function(e,t){e.exports=function(e){return function(t){var n=e,r=n.lib,i=r.Base,a=r.WordArray,o=n.x64={};o.Word=i.extend({init:function(e,t){this.high=e,this.low=t}}),o.WordArray=i.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:8*e.length},toX32:function(){for(var e=this.words,t=e.length,n=[],r=0;r<t;r++){var i=e[r];n.push(i.high),n.push(i.low)}return a.create(n,this.sigBytes)},clone:function(){for(var e=i.clone.call(this),t=e.words=this.words.slice(0),n=t.length,r=0;r<n;r++)t[r]=t[r].clone();return e}})}(),e}(nH())}(cH)),cH.exports}var dH,lH={exports:{}};function pH(){return dH||(dH=1,function(e,t){e.exports=function(e){return function(){if("function"==typeof ArrayBuffer){var t=e.lib.WordArray,n=t.init,r=t.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var t=e.byteLength,r=[],i=0;i<t;i++)r[i>>>2]|=e[i]<<24-i%4*8;n.call(this,r,t)}else n.apply(this,arguments)};r.prototype=t}}(),e.lib.WordArray}(nH())}(lH)),lH.exports}var hH,bH={exports:{}};function mH(){return hH||(hH=1,function(e,t){e.exports=function(e){return function(){var t=e,n=t.lib.WordArray,r=t.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}r.Utf16=r.Utf16BE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i+=2){var a=t[i>>>2]>>>16-i%4*8&65535;r.push(String.fromCharCode(a))}return r.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i<t;i++)r[i>>>1]|=e.charCodeAt(i)<<16-i%2*16;return n.create(r,2*t)}},r.Utf16LE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],a=0;a<n;a+=2){var o=i(t[a>>>2]>>>16-a%4*8&65535);r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,r=[],a=0;a<t;a++)r[a>>>1]|=i(e.charCodeAt(a)<<16-a%2*16);return n.create(r,2*t)}}}(),e.enc.Utf16}(nH())}(bH)),bH.exports}var yH,gH={exports:{}};function vH(){return yH||(yH=1,function(e,t){e.exports=function(e){return function(){var t=e,n=t.lib.WordArray;function r(e,t,r){for(var i=[],a=0,o=0;o<t;o++)if(o%4){var s=r[e.charCodeAt(o-1)]<<o%4*2,u=r[e.charCodeAt(o)]>>>6-o%4*2;i[a>>>2]|=(s|u)<<24-a%4*8,a++}return n.create(i,a)}t.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var i=[],a=0;a<n;a+=3)for(var o=(t[a>>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.75*s<n;s++)i.push(r.charAt(o>>>6*(3-s)&63));var u=r.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(e){var t=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a<n.length;a++)i[n.charCodeAt(a)]=a}var o=n.charAt(64);if(o){var s=e.indexOf(o);-1!==s&&(t=s)}return r(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64}(nH())}(gH)),gH.exports}var wH,_H={exports:{}};function EH(){return wH||(wH=1,function(e,t){e.exports=function(e){return function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*t.abs(t.sin(e+1))|0}();var u=o.MD5=a.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var a=this._hash.words,o=e[t+0],u=e[t+1],p=e[t+2],h=e[t+3],b=e[t+4],m=e[t+5],y=e[t+6],g=e[t+7],v=e[t+8],w=e[t+9],_=e[t+10],E=e[t+11],T=e[t+12],A=e[t+13],R=e[t+14],S=e[t+15],k=a[0],O=a[1],I=a[2],x=a[3];k=c(k,O,I,x,o,7,s[0]),x=c(x,k,O,I,u,12,s[1]),I=c(I,x,k,O,p,17,s[2]),O=c(O,I,x,k,h,22,s[3]),k=c(k,O,I,x,b,7,s[4]),x=c(x,k,O,I,m,12,s[5]),I=c(I,x,k,O,y,17,s[6]),O=c(O,I,x,k,g,22,s[7]),k=c(k,O,I,x,v,7,s[8]),x=c(x,k,O,I,w,12,s[9]),I=c(I,x,k,O,_,17,s[10]),O=c(O,I,x,k,E,22,s[11]),k=c(k,O,I,x,T,7,s[12]),x=c(x,k,O,I,A,12,s[13]),I=c(I,x,k,O,R,17,s[14]),k=f(k,O=c(O,I,x,k,S,22,s[15]),I,x,u,5,s[16]),x=f(x,k,O,I,y,9,s[17]),I=f(I,x,k,O,E,14,s[18]),O=f(O,I,x,k,o,20,s[19]),k=f(k,O,I,x,m,5,s[20]),x=f(x,k,O,I,_,9,s[21]),I=f(I,x,k,O,S,14,s[22]),O=f(O,I,x,k,b,20,s[23]),k=f(k,O,I,x,w,5,s[24]),x=f(x,k,O,I,R,9,s[25]),I=f(I,x,k,O,h,14,s[26]),O=f(O,I,x,k,v,20,s[27]),k=f(k,O,I,x,A,5,s[28]),x=f(x,k,O,I,p,9,s[29]),I=f(I,x,k,O,g,14,s[30]),k=d(k,O=f(O,I,x,k,T,20,s[31]),I,x,m,4,s[32]),x=d(x,k,O,I,v,11,s[33]),I=d(I,x,k,O,E,16,s[34]),O=d(O,I,x,k,R,23,s[35]),k=d(k,O,I,x,u,4,s[36]),x=d(x,k,O,I,b,11,s[37]),I=d(I,x,k,O,g,16,s[38]),O=d(O,I,x,k,_,23,s[39]),k=d(k,O,I,x,A,4,s[40]),x=d(x,k,O,I,o,11,s[41]),I=d(I,x,k,O,h,16,s[42]),O=d(O,I,x,k,y,23,s[43]),k=d(k,O,I,x,w,4,s[44]),x=d(x,k,O,I,T,11,s[45]),I=d(I,x,k,O,S,16,s[46]),k=l(k,O=d(O,I,x,k,p,23,s[47]),I,x,o,6,s[48]),x=l(x,k,O,I,g,10,s[49]),I=l(I,x,k,O,R,15,s[50]),O=l(O,I,x,k,m,21,s[51]),k=l(k,O,I,x,T,6,s[52]),x=l(x,k,O,I,h,10,s[53]),I=l(I,x,k,O,_,15,s[54]),O=l(O,I,x,k,u,21,s[55]),k=l(k,O,I,x,v,6,s[56]),x=l(x,k,O,I,S,10,s[57]),I=l(I,x,k,O,y,15,s[58]),O=l(O,I,x,k,A,21,s[59]),k=l(k,O,I,x,b,6,s[60]),x=l(x,k,O,I,E,10,s[61]),I=l(I,x,k,O,p,15,s[62]),O=l(O,I,x,k,w,21,s[63]),a[0]=a[0]+k|0,a[1]=a[1]+O|0,a[2]=a[2]+I|0,a[3]=a[3]+x|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;n[i>>>5]|=128<<24-i%32;var a=t.floor(r/4294967296),o=r;n[15+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),n[14+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),e.sigBytes=4*(n.length+1),this._process();for(var s=this._hash,u=s.words,c=0;c<4;c++){var f=u[c];u[c]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return s},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});function c(e,t,n,r,i,a,o){var s=e+(t&n|~t&r)+i+o;return(s<<a|s>>>32-a)+t}function f(e,t,n,r,i,a,o){var s=e+(t&r|n&~r)+i+o;return(s<<a|s>>>32-a)+t}function d(e,t,n,r,i,a,o){var s=e+(t^n^r)+i+o;return(s<<a|s>>>32-a)+t}function l(e,t,n,r,i,a,o){var s=e+(n^(t|~r))+i+o;return(s<<a|s>>>32-a)+t}n.MD5=a._createHelper(u),n.HmacMD5=a._createHmacHelper(u)}(Math),e.MD5}(nH())}(_H)),_H.exports}var TH,AH={exports:{}};function RH(){return TH||(TH=1,function(e,t){e.exports=function(e){return function(){var t=e,n=t.lib,r=n.WordArray,i=n.Hasher,a=t.algo,o=[],s=a.SHA1=i.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],s=n[3],u=n[4],c=0;c<80;c++){if(c<16)o[c]=0|e[t+c];else{var f=o[c-3]^o[c-8]^o[c-14]^o[c-16];o[c]=f<<1|f>>>31}var d=(r<<5|r>>>27)+u+o[c];d+=c<20?1518500249+(i&a|~i&s):c<40?1859775393+(i^a^s):c<60?(i&a|i&s|a&s)-1894007588:(i^a^s)-899497514,u=s,s=a,a=i<<30|i>>>2,i=r,r=d}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+a|0,n[3]=n[3]+s|0,n[4]=n[4]+u|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=i._createHelper(s),t.HmacSHA1=i._createHmacHelper(s)}(),e.SHA1}(nH())}(AH)),AH.exports}var SH,kH={exports:{}};var OH,IH={exports:{}};function xH(){return OH||(OH=1,function(e,t){e.exports=function(e){return function(){var t=e,n=t.lib.Hasher,r=t.x64,i=r.Word,a=r.WordArray,o=t.algo;function s(){return i.create.apply(i,arguments)}var u=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],c=[];!function(){for(var e=0;e<80;e++)c[e]=s()}();var f=o.SHA512=n.extend({_doReset:function(){this._hash=new a.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],f=n[5],d=n[6],l=n[7],p=r.high,h=r.low,b=i.high,m=i.low,y=a.high,g=a.low,v=o.high,w=o.low,_=s.high,E=s.low,T=f.high,A=f.low,R=d.high,S=d.low,k=l.high,O=l.low,I=p,x=h,C=b,M=m,N=y,P=g,B=v,D=w,F=_,L=E,U=T,j=A,q=R,z=S,H=k,V=O,G=0;G<80;G++){var K=c[G];if(G<16)var W=K.high=0|e[t+2*G],X=K.low=0|e[t+2*G+1];else{var $=c[G-15],J=$.high,Y=$.low,Q=(J>>>1|Y<<31)^(J>>>8|Y<<24)^J>>>7,Z=(Y>>>1|J<<31)^(Y>>>8|J<<24)^(Y>>>7|J<<25),ee=c[G-2],te=ee.high,ne=ee.low,re=(te>>>19|ne<<13)^(te<<3|ne>>>29)^te>>>6,ie=(ne>>>19|te<<13)^(ne<<3|te>>>29)^(ne>>>6|te<<26),ae=c[G-7],oe=ae.high,se=ae.low,ue=c[G-16],ce=ue.high,fe=ue.low;W=(W=(W=Q+oe+((X=Z+se)>>>0<Z>>>0?1:0))+re+((X+=ie)>>>0<ie>>>0?1:0))+ce+((X+=fe)>>>0<fe>>>0?1:0),K.high=W,K.low=X}var de,le=F&U^~F&q,pe=L&j^~L&z,he=I&C^I&N^C&N,be=x&M^x&P^M&P,me=(I>>>28|x<<4)^(I<<30|x>>>2)^(I<<25|x>>>7),ye=(x>>>28|I<<4)^(x<<30|I>>>2)^(x<<25|I>>>7),ge=(F>>>14|L<<18)^(F>>>18|L<<14)^(F<<23|L>>>9),ve=(L>>>14|F<<18)^(L>>>18|F<<14)^(L<<23|F>>>9),we=u[G],_e=we.high,Ee=we.low,Te=H+ge+((de=V+ve)>>>0<V>>>0?1:0),Ae=ye+be;H=q,V=z,q=U,z=j,U=F,j=L,F=B+(Te=(Te=(Te=Te+le+((de+=pe)>>>0<pe>>>0?1:0))+_e+((de+=Ee)>>>0<Ee>>>0?1:0))+W+((de+=X)>>>0<X>>>0?1:0))+((L=D+de|0)>>>0<D>>>0?1:0)|0,B=N,D=P,N=C,P=M,C=I,M=x,I=Te+(me+he+(Ae>>>0<ye>>>0?1:0))+((x=de+Ae|0)>>>0<de>>>0?1:0)|0}h=r.low=h+x,r.high=p+I+(h>>>0<x>>>0?1:0),m=i.low=m+M,i.high=b+C+(m>>>0<M>>>0?1:0),g=a.low=g+P,a.high=y+N+(g>>>0<P>>>0?1:0),w=o.low=w+D,o.high=v+B+(w>>>0<D>>>0?1:0),E=s.low=E+L,s.high=_+F+(E>>>0<L>>>0?1:0),A=f.low=A+j,f.high=T+U+(A>>>0<j>>>0?1:0),S=d.low=S+z,d.high=R+q+(S>>>0<z>>>0?1:0),O=l.low=O+V,l.high=k+H+(O>>>0<V>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(r+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});t.SHA512=n._createHelper(f),t.HmacSHA512=n._createHmacHelper(f)}(),e.SHA512}(nH(),fH())}(IH)),IH.exports}var CH,MH={exports:{}};var NH,PH={exports:{}};function BH(){return NH||(NH=1,function(e,t){e.exports=function(e){return function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.x64.Word,s=n.algo,u=[],c=[],f=[];!function(){for(var e=1,t=0,n=0;n<24;n++){u[e+5*t]=(n+1)*(n+2)/2%64;var r=(2*e+3*t)%5;e=t%5,t=r}for(e=0;e<5;e++)for(t=0;t<5;t++)c[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,a=0;a<24;a++){for(var s=0,d=0,l=0;l<7;l++){if(1&i){var p=(1<<l)-1;p<32?d^=1<<p:s^=1<<p-32}128&i?i=i<<1^113:i<<=1}f[a]=o.create(s,d)}}();var d=[];!function(){for(var e=0;e<25;e++)d[e]=o.create()}();var l=s.SHA3=a.extend({cfg:a.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new o.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var n=this._state,r=this.blockSize/2,i=0;i<r;i++){var a=e[t+2*i],o=e[t+2*i+1];a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),(O=n[i]).high^=o,O.low^=a}for(var s=0;s<24;s++){for(var l=0;l<5;l++){for(var p=0,h=0,b=0;b<5;b++)p^=(O=n[l+5*b]).high,h^=O.low;var m=d[l];m.high=p,m.low=h}for(l=0;l<5;l++){var y=d[(l+4)%5],g=d[(l+1)%5],v=g.high,w=g.low;for(p=y.high^(v<<1|w>>>31),h=y.low^(w<<1|v>>>31),b=0;b<5;b++)(O=n[l+5*b]).high^=p,O.low^=h}for(var _=1;_<25;_++){var E=(O=n[_]).high,T=O.low,A=u[_];A<32?(p=E<<A|T>>>32-A,h=T<<A|E>>>32-A):(p=T<<A-32|E>>>64-A,h=E<<A-32|T>>>64-A);var R=d[c[_]];R.high=p,R.low=h}var S=d[0],k=n[0];for(S.high=k.high,S.low=k.low,l=0;l<5;l++)for(b=0;b<5;b++){var O=n[_=l+5*b],I=d[_],x=d[(l+1)%5+5*b],C=d[(l+2)%5+5*b];O.high=I.high^~x.high&C.high,O.low=I.low^~x.low&C.low}O=n[0];var M=f[s];O.high^=M.high,O.low^=M.low}},_doFinalize:function(){var e=this._data,n=e.words;this._nDataBytes;var r=8*e.sigBytes,a=32*this.blockSize;n[r>>>5]|=1<<24-r%32,n[(t.ceil((r+1)/a)*a>>>5)-1]|=128,e.sigBytes=4*n.length,this._process();for(var o=this._state,s=this.cfg.outputLength/8,u=s/8,c=[],f=0;f<u;f++){var d=o[f],l=d.high,p=d.low;l=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),c.push(p),c.push(l)}return new i.init(c,s)},clone:function(){for(var e=a.clone.call(this),t=e._state=this._state.slice(0),n=0;n<25;n++)t[n]=t[n].clone();return e}});n.SHA3=a._createHelper(l),n.HmacSHA3=a._createHmacHelper(l)}(Math),e.SHA3}(nH(),fH())}(PH)),PH.exports}var DH,FH={exports:{}};var LH,UH={exports:{}};function jH(){return LH||(LH=1,function(e,t){e.exports=function(e){!function(){var t=e,n=t.lib.Base,r=t.enc.Utf8;t.algo.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=r.parse(t));var n=e.blockSize,i=4*n;t.sigBytes>i&&(t=e.finalize(t)),t.clamp();for(var a=this._oKey=t.clone(),o=this._iKey=t.clone(),s=a.words,u=o.words,c=0;c<n;c++)s[c]^=1549556828,u[c]^=909522486;a.sigBytes=o.sigBytes=i,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})}()}(nH())}(UH)),UH.exports}var qH,zH={exports:{}};var HH,VH={exports:{}};function GH(){return HH||(HH=1,function(e,t){e.exports=function(e){return function(){var t=e,n=t.lib,r=n.Base,i=n.WordArray,a=t.algo,o=a.MD5,s=a.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,r=n.hasher.create(),a=i.create(),o=a.words,s=n.keySize,u=n.iterations;o.length<s;){c&&r.update(c);var c=r.update(e).finalize(t);r.reset();for(var f=1;f<u;f++)c=r.finalize(c),r.reset();a.concat(c)}return a.sigBytes=4*s,a}});t.EvpKDF=function(e,t,n){return s.create(n).compute(e,t)}}(),e.EvpKDF}(nH(),RH(),jH())}(VH)),VH.exports}var KH,WH={exports:{}};function XH(){return KH||(KH=1,function(e,t){e.exports=function(e){e.lib.Cipher||function(t){var n=e,r=n.lib,i=r.Base,a=r.WordArray,o=r.BufferedBlockAlgorithm,s=n.enc;s.Utf8;var u=s.Base64,c=n.algo.EvpKDF,f=r.Cipher=o.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?v:y}return function(t){return{encrypt:function(n,r,i){return e(r).encrypt(t,n,r,i)},decrypt:function(n,r,i){return e(r).decrypt(t,n,r,i)}}}}()});r.StreamCipher=f.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var d=n.mode={},l=r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),p=d.CBC=function(){var e=l.extend();function n(e,n,r){var i=this._iv;if(i){var a=i;this._iv=t}else a=this._prevBlock;for(var o=0;o<r;o++)e[n+o]^=a[o]}return e.Encryptor=e.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize;n.call(this,e,t,i),r.encryptBlock(e,t),this._prevBlock=e.slice(t,t+i)}}),e.Decryptor=e.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,a=e.slice(t,t+i);r.decryptBlock(e,t),n.call(this,e,t,i),this._prevBlock=a}}),e}(),h=(n.pad={}).Pkcs7={pad:function(e,t){for(var n=4*t,r=n-e.sigBytes%n,i=r<<24|r<<16|r<<8|r,o=[],s=0;s<r;s+=4)o.push(i);var u=a.create(o,r);e.concat(u)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}};r.BlockCipher=f.extend({cfg:f.cfg.extend({mode:p,padding:h}),reset:function(){f.reset.call(this);var e=this.cfg,t=e.iv,n=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var r=n.createEncryptor;else r=n.createDecryptor,this._minBufferSize=1;this._mode&&this._mode.__creator==r?this._mode.init(this,t&&t.words):(this._mode=r.call(n,this,t&&t.words),this._mode.__creator=r)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4});var b=r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),m=(n.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;if(n)var r=a.create([1398893684,1701076831]).concat(n).concat(t);else r=t;return r.toString(u)},parse:function(e){var t=u.parse(e),n=t.words;if(1398893684==n[0]&&1701076831==n[1]){var r=a.create(n.slice(2,4));n.splice(0,4),t.sigBytes-=16}return b.create({ciphertext:t,salt:r})}},y=r.SerializableCipher=i.extend({cfg:i.extend({format:m}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r),a=i.finalize(t),o=i.cfg;return b.create({ciphertext:a,key:n,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),g=(n.kdf={}).OpenSSL={execute:function(e,t,n,r){r||(r=a.random(8));var i=c.create({keySize:t+n}).compute(e,r),o=a.create(i.words.slice(t),4*n);return i.sigBytes=4*t,b.create({key:i,iv:o,salt:r})}},v=r.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:g}),encrypt:function(e,t,n,r){var i=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize);r.iv=i.iv;var a=y.encrypt.call(this,e,t,i.key,r);return a.mixIn(i),a},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var i=r.kdf.execute(n,e.keySize,e.ivSize,t.salt);return r.iv=i.iv,y.decrypt.call(this,e,t,i.key,r)}})}()}(nH(),GH())}(WH)),WH.exports}var $H,JH={exports:{}};function YH(){return $H||($H=1,function(e,t){e.exports=function(e){return e.mode.CFB=function(){var t=e.lib.BlockCipherMode.extend();function n(e,t,n,r){var i=this._iv;if(i){var a=i.slice(0);this._iv=void 0}else a=this._prevBlock;r.encryptBlock(a,0);for(var o=0;o<n;o++)e[t+o]^=a[o]}return t.Encryptor=t.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize;n.call(this,e,t,i,r),this._prevBlock=e.slice(t,t+i)}}),t.Decryptor=t.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,a=e.slice(t,t+i);n.call(this,e,t,i,r),this._prevBlock=a}}),t}(),e.mode.CFB}(nH(),XH())}(JH)),JH.exports}var QH,ZH={exports:{}};function eV(){return QH||(QH=1,function(e,t){e.exports=function(e){return e.mode.CTR=(t=e.lib.BlockCipherMode.extend(),n=t.Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,i=this._iv,a=this._counter;i&&(a=this._counter=i.slice(0),this._iv=void 0);var o=a.slice(0);n.encryptBlock(o,0),a[r-1]=a[r-1]+1|0;for(var s=0;s<r;s++)e[t+s]^=o[s]}}),t.Decryptor=n,t),e.mode.CTR;var t,n}(nH(),XH())}(ZH)),ZH.exports}var tV,nV={exports:{}};function rV(){return tV||(tV=1,function(e,t){e.exports=function(e){
|
|
32
32
|
/** @preserve
|
|
33
33
|
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
|
34
34
|
* derived from CryptoJS.mode.CTR
|
|
@@ -81,5 +81,5 @@ return function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.algo,s=i.create(
|
|
|
81
81
|
*
|
|
82
82
|
* This source code is licensed under the MIT license found in the
|
|
83
83
|
* LICENSE file in the root directory of this source tree.
|
|
84
|
-
*/"production"===process.env.NODE_ENV?j2.exports=function(){if(K2)return q2;K2=1;var e=W2,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function o(e,n,o){var s,u={},c=null,f=null;for(s in void 0!==o&&(c=""+o),void 0!==n.key&&(c=""+n.key),void 0!==n.ref&&(f=n.ref),n)r.call(n,s)&&!a.hasOwnProperty(s)&&(u[s]=n[s]);if(e&&e.defaultProps)for(s in n=e.defaultProps)void 0===u[s]&&(u[s]=n[s]);return{$$typeof:t,type:e,key:c,ref:f,props:u,_owner:i.current}}return q2.Fragment=n,q2.jsx=o,q2.jsxs=o,q2}():j2.exports=(X2||(X2=1,"production"!==process.env.NODE_ENV&&function(){var e=W2,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),l=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),h=Symbol.iterator,b="@@iterator",m=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function y(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];!function(e,t,n){var r=m.ReactDebugCurrentFrame.getStackAddendum();""!==r&&(t+="%s",n=n.concat([r]));var i=n.map((function(e){return String(e)}));i.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,i)}("error",e,n)}var g,v=!1,w=!1,_=!1,E=!1,T=!1;function A(e){return e.displayName||"Context"}function R(e){if(null==e)return null;if("number"==typeof e.tag&&y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case r:return"Fragment";case n:return"Portal";case a:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case f:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case s:return A(e)+".Consumer";case o:return A(e._context)+".Provider";case u:return function(e,t,n){var r=e.displayName;if(r)return r;var i=t.displayName||t.name||"";return""!==i?n+"("+i+")":n}(e,e.render,"ForwardRef");case d:var t=e.displayName||null;return null!==t?t:R(e.type)||"Memo";case l:var p=e,h=p._payload,b=p._init;try{return R(b(h))}catch(e){return null}}return null}g=Symbol.for("react.module.reference");var S,k,O,I,x,C,M,N=Object.assign,P=0;function B(){}B.__reactDisabledLog=!0;var D,F=m.ReactCurrentDispatcher;function L(e,t,n){if(void 0===D)try{throw Error()}catch(e){var r=e.stack.trim().match(/\n( *(at )?)/);D=r&&r[1]||""}return"\n"+D+e}var U,j=!1,q="function"==typeof WeakMap?WeakMap:Map;function z(e,t){if(!e||j)return"";var n,r=U.get(e);if(void 0!==r)return r;j=!0;var i,a=Error.prepareStackTrace;Error.prepareStackTrace=void 0,i=F.current,F.current=null,function(){if(0===P){S=console.log,k=console.info,O=console.warn,I=console.error,x=console.group,C=console.groupCollapsed,M=console.groupEnd;var e={configurable:!0,enumerable:!0,value:B,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}P++}();try{if(t){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(o,[])}catch(e){n=e}Reflect.construct(e,[],o)}else{try{o.call()}catch(e){n=e}e.call(o.prototype)}}else{try{throw Error()}catch(e){n=e}e()}}catch(t){if(t&&n&&"string"==typeof t.stack){for(var s=t.stack.split("\n"),u=n.stack.split("\n"),c=s.length-1,f=u.length-1;c>=1&&f>=0&&s[c]!==u[f];)f--;for(;c>=1&&f>=0;c--,f--)if(s[c]!==u[f]){if(1!==c||1!==f)do{if(c--,--f<0||s[c]!==u[f]){var d="\n"+s[c].replace(" at new "," at ");return e.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",e.displayName)),"function"==typeof e&&U.set(e,d),d}}while(c>=1&&f>=0);break}}}finally{j=!1,F.current=i,function(){if(0==--P){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:N({},e,{value:S}),info:N({},e,{value:k}),warn:N({},e,{value:O}),error:N({},e,{value:I}),group:N({},e,{value:x}),groupCollapsed:N({},e,{value:C}),groupEnd:N({},e,{value:M})})}P<0&&y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=a}var l=e?e.displayName||e.name:"",p=l?L(l):"";return"function"==typeof e&&U.set(e,p),p}function H(e,t,n){if(null==e)return"";if("function"==typeof e)return z(e,function(e){var t=e.prototype;return!(!t||!t.isReactComponent)}(e));if("string"==typeof e)return L(e);switch(e){case c:return L("Suspense");case f:return L("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case u:return function(e,t,n){return z(e,!1)}(e.render);case d:return H(e.type,t,n);case l:var r=e,i=r._payload,a=r._init;try{return H(a(i),t,n)}catch(e){}}return""}U=new q;var V=Object.prototype.hasOwnProperty,G={},K=m.ReactDebugCurrentFrame;function W(e){if(e){var t=e._owner,n=H(e.type,e._source,t?t.type:null);K.setExtraStackFrame(n)}else K.setExtraStackFrame(null)}var X=Array.isArray;function $(e){return X(e)}function J(e){return""+e}function Y(e){if(function(e){try{return J(e),!1}catch(e){return!0}}(e))return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),J(e)}var Q,Z,ee,te=m.ReactCurrentOwner,ne={key:!0,ref:!0,__self:!0,__source:!0};ee={};var re=function(e,n,r,i,a,o,s){var u={$$typeof:t,type:e,key:n,ref:r,props:s,_owner:o,_store:{}};return Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(u,"_self",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.defineProperty(u,"_source",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u};function ie(e,t,n,r,i){var a,o={},s=null,u=null;for(a in void 0!==n&&(Y(n),s=""+n),function(e){if(V.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(t)&&(Y(t.key),s=""+t.key),function(e){if(V.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(t)&&(u=t.ref,function(e,t){if("string"==typeof e.ref&&te.current&&t&&te.current.stateNode!==t){var n=R(te.current.type);ee[n]||(y('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',R(te.current.type),e.ref),ee[n]=!0)}}(t,i)),t)V.call(t,a)&&!ne.hasOwnProperty(a)&&(o[a]=t[a]);if(e&&e.defaultProps){var c=e.defaultProps;for(a in c)void 0===o[a]&&(o[a]=c[a])}if(s||u){var f="function"==typeof e?e.displayName||e.name||"Unknown":e;s&&function(e,t){var n=function(){Q||(Q=!0,y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(o,f),u&&function(e,t){var n=function(){Z||(Z=!0,y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}(o,f)}return re(e,s,u,i,r,te.current,o)}var ae,oe=m.ReactCurrentOwner,se=m.ReactDebugCurrentFrame;function ue(e){if(e){var t=e._owner,n=H(e.type,e._source,t?t.type:null);se.setExtraStackFrame(n)}else se.setExtraStackFrame(null)}function ce(e){return"object"==typeof e&&null!==e&&e.$$typeof===t}function fe(){if(oe.current){var e=R(oe.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}ae=!1;var de={};function le(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=fe();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!de[n]){de[n]=!0;var r="";e&&e._owner&&e._owner!==oe.current&&(r=" It was passed a child from "+R(e._owner.type)+"."),ue(e),y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,r),ue(null)}}}function pe(e,t){if("object"==typeof e)if($(e))for(var n=0;n<e.length;n++){var r=e[n];ce(r)&&le(r,t)}else if(ce(e))e._store&&(e._store.validated=!0);else if(e){var i=function(e){if(null===e||"object"!=typeof e)return null;var t=h&&e[h]||e[b];return"function"==typeof t?t:null}(e);if("function"==typeof i&&i!==e.entries)for(var a,o=i.call(e);!(a=o.next()).done;)ce(a.value)&&le(a.value,t)}}function he(e){var t,n=e.type;if(null!=n&&"string"!=typeof n){if("function"==typeof n)t=n.propTypes;else{if("object"!=typeof n||n.$$typeof!==u&&n.$$typeof!==d)return;t=n.propTypes}if(t){var r=R(n);!function(e,t,n,r,i){var a=Function.call.bind(V);for(var o in e)if(a(e,o)){var s=void 0;try{if("function"!=typeof e[o]){var u=Error((r||"React class")+": "+n+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}s=e[o](t,o,r,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){s=e}!s||s instanceof Error||(W(i),y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",r||"React class",n,o,typeof s),W(null)),s instanceof Error&&!(s.message in G)&&(G[s.message]=!0,W(i),y("Failed %s type: %s",n,s.message),W(null))}}(t,e.props,"prop",r,e)}else void 0===n.PropTypes||ae||(ae=!0,y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",R(n)||"Unknown"));"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function be(e,n,h,b,m,A){var S=function(e){return"string"==typeof e||"function"==typeof e||!!(e===r||e===a||T||e===i||e===c||e===f||E||e===p||v||w||_)||"object"==typeof e&&null!==e&&(e.$$typeof===l||e.$$typeof===d||e.$$typeof===o||e.$$typeof===s||e.$$typeof===u||e.$$typeof===g||void 0!==e.getModuleId)}(e);if(!S){var k="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(k+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var O,I=function(e){return void 0!==e?"\n\nCheck your code at "+e.fileName.replace(/^.*[\\\/]/,"")+":"+e.lineNumber+".":""}(m);k+=I||fe(),null===e?O="null":$(e)?O="array":void 0!==e&&e.$$typeof===t?(O="<"+(R(e.type)||"Unknown")+" />",k=" Did you accidentally export a JSX literal instead of a component?"):O=typeof e,y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",O,k)}var x=ie(e,n,h,m,A);if(null==x)return x;if(S){var C=n.children;if(void 0!==C)if(b)if($(C)){for(var M=0;M<C.length;M++)pe(C[M],e);Object.freeze&&Object.freeze(C)}else y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else pe(C,e)}return e===r?function(e){for(var t=Object.keys(e.props),n=0;n<t.length;n++){var r=t[n];if("children"!==r&&"key"!==r){ue(e),y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r),ue(null);break}}null!==e.ref&&(ue(e),y("Invalid attribute `ref` supplied to `React.Fragment`."),ue(null))}(x):he(x),x}var me=function(e,t,n){return be(e,t,n,!1)},ye=function(e,t,n){return be(e,t,n,!0)};$2.Fragment=r,$2.jsx=me,$2.jsxs=ye}()),$2);var J2=j2.exports;function Y2(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}const Q2=()=>"0.13.0-alpha.1";var Z2,e8;Y2({},"IMTBLWidgetEvents",(()=>Z2)),(e8=Z2||(Z2={})).IMTBL_CONNECT_WIDGET_EVENT="imtbl-connect-widget",e8.IMTBL_WALLET_WIDGET_EVENT="imtbl-wallet-widget",e8.IMTBL_SWAP_WIDGET_EVENT="imtbl-swap-widget",e8.IMTBL_BRIDGE_WIDGET_EVENT="imtbl-bridge-widget";var t8,n8;Y2({},"ConnectEventType",(()=>t8)),(n8=t8||(t8={})).CLOSE_WIDGET="close-widget",n8.SUCCESS="success",n8.FAILURE="failure";var r8,i8;Y2({},"WalletEventType",(()=>r8)),(i8=r8||(r8={})).CLOSE_WIDGET="close-widget",i8.NETWORK_SWITCH="network-switch",i8.DISCONNECT_WALLET="disconnect-wallet";var a8,o8;Y2({},"SwapEventType",(()=>a8)),(o8=a8||(a8={})).CLOSE_WIDGET="close-widget",o8.SUCCESS="success",o8.FAILURE="failure",o8.REJECTED="rejected";var s8,u8;Y2({},"BridgeEventType",(()=>s8)),(u8=s8||(s8={})).CLOSE_WIDGET="close-widget",u8.SUCCESS="success",u8.FAILURE="failure";var c8,f8;Y2({},"OrchestrationEventType",(()=>c8)),(f8=c8||(c8={})).REQUEST_CONNECT="request-connect",f8.REQUEST_WALLET="request-wallet",f8.REQUEST_SWAP="request-swap",f8.REQUEST_BRIDGE="request-bridge",f8.REQUEST_ONRAMP="request-onramp";var d8,l8,p8,h8,b8={};Y2(b8,"WidgetTheme",(()=>d8)),Y2(b8,"CheckoutWidgetTagNames",(()=>p8)),(l8=d8||(d8={})).LIGHT="light",l8.DARK="dark",l8.CUSTOM="custom",(h8=p8||(p8={})).CONNECT="imtbl-connect",h8.WALLET="imtbl-wallet",h8.SWAP="imtbl-swap",h8.BRIDGE="imtbl-bridge";function m8(e,t){if(!t)return void console.error("no provider parsed");if(void 0===window)return void console.error("missing window object: please run Checkout client side");let n=0;let r;const i=()=>{try{const n=document.getElementsByTagName(e);n[0].setProvider(t),window.clearInterval(r)}catch(e){n++,n>=10&&(window.clearInterval(r),console.error("failed to set the provider"))}};r=window.setInterval(i,10),i()}function y8(e,t){if(!t)return void console.error("no passport provided");if(void 0===window)return void console.error("missing window object: please run Checkout client side");let n=0;let r;const i=()=>{try{const n=document.getElementsByTagName(e);n[0].addPassportOption(t),window.clearInterval(r)}catch(e){n++,n>=10&&(window.clearInterval(r),console.error("failed to set the provider"))}};r=window.setInterval(i,10),i()}function g8(e){const{walletProvider:t,fromContractAddress:n,amount:r,provider:i,passport:a}=e;W2.useEffect((()=>{i&&m8(p8.BRIDGE,i),a&&y8(p8.BRIDGE,a)}),[i,a]);const o=window.ImtblCheckoutWidgetConfig;return J2.jsx("imtbl-bridge",{widgetConfig:o,walletProvider:t,fromContractAddress:n??"",amount:r??""})}Y2({},"BridgeReact",(()=>g8));function v8({passport:e}){const t=window.ImtblCheckoutWidgetConfig;return W2.useEffect((()=>{e&&y8(p8.CONNECT,e)}),[e]),J2.jsx("imtbl-connect",{widgetConfig:t})}Y2({},"ConnectReact",(()=>v8));function w8(e){const{walletProvider:t,fromContractAddress:n,amount:r,toContractAddress:i,provider:a,passport:o}=e;W2.useEffect((()=>{a&&m8(p8.SWAP,a),o&&y8(p8.SWAP,o)}),[a,o]);const s=window.ImtblCheckoutWidgetConfig;return J2.jsx("imtbl-swap",{widgetConfig:s,walletProvider:t,fromContractAddress:n??"",toContractAddress:i??"",amount:r??""})}Y2({},"SwapReact",(()=>w8));function _8(e){const{walletProvider:t,provider:n,passport:r}=e;W2.useEffect((()=>{n&&m8(p8.WALLET,n),r&&y8(p8.WALLET,r)}),[n,r]);const i=window.ImtblCheckoutWidgetConfig;return J2.jsx("imtbl-wallet",{widgetConfig:i,walletProvider:t})}Y2({},"WalletReact",(()=>_8));var E8=Object.freeze({__proto__:null,get BridgeEventType(){return s8},BridgeReact:g8,get CheckoutWidgetTagNames(){return p8},CheckoutWidgets:function(e){if(void 0===window)return void console.error("missing window object: please run Checkout client side");if(void 0===document)return void console.error("missing document object: please run Checkout client side");const t=document.createElement("script"),n=function(e){const t=Q2();if(void 0===e)return t;if(void 0===e.major||void 0===e.minor||void 0===e.patch||void 0===e.prerelease)return t;if(e.major<0)return t;if(e.minor<0)return t;if(e.patch<0)return t;if("alpha"!==e.prerelease)return t;if(0===e.major&&0===e.minor&&0===e.patch)return t;let n=t;return!Number.isNaN(e.major)&&e.major>=0&&(n=e.major.toString()),Number.isNaN(e.minor)||(n+=`.${e.minor.toString()}`),Number.isNaN(e.patch)||(n+=`.${e.patch.toString()}`),n+=`-${e.prerelease}`,void 0!==e.build&&e.build>0&&(n+=`.${e.build}`),n}(e?.version);let r=`https://cdn.jsdelivr.net/npm/@imtbl/sdk@${n}/dist/browser/checkout.js`;t.setAttribute("src",r),document.head.appendChild(t),window.ImtblCheckoutWidgetConfig=JSON.stringify(e)},get ConnectEventType(){return t8},ConnectReact:v8,get IMTBLWidgetEvents(){return Z2},get OrchestrationEventType(){return c8},get SwapEventType(){return a8},SwapReact:w8,UpdateConfig:function(e){void 0!==window?window.ImtblCheckoutWidgetConfig=JSON.stringify(e):console.error("missing document object: please run Checkout client side")},get WalletEventType(){return r8},WalletReact:_8,get WidgetTheme(){return d8}});const T8=[{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}],A8="0x60806040523480156200001157600080fd5b50604051620017ec380380620017ec8339818101604052810190620000379190620001f6565b8160039081620000489190620004c6565b5080600490816200005a9190620004c6565b505050620005ad565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b620000cc8262000081565b810181811067ffffffffffffffff82111715620000ee57620000ed62000092565b5b80604052505050565b60006200010362000063565b9050620001118282620000c1565b919050565b600067ffffffffffffffff82111562000134576200013362000092565b5b6200013f8262000081565b9050602081019050919050565b60005b838110156200016c5780820151818401526020810190506200014f565b60008484015250505050565b60006200018f620001898462000116565b620000f7565b905082815260208101848484011115620001ae57620001ad6200007c565b5b620001bb8482856200014c565b509392505050565b600082601f830112620001db57620001da62000077565b5b8151620001ed84826020860162000178565b91505092915050565b6000806040838503121562000210576200020f6200006d565b5b600083015167ffffffffffffffff81111562000231576200023062000072565b5b6200023f85828601620001c3565b925050602083015167ffffffffffffffff81111562000263576200026262000072565b5b6200027185828601620001c3565b9150509250929050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620002ce57607f821691505b602082108103620002e457620002e362000286565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026200034e7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826200030f565b6200035a86836200030f565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620003a7620003a16200039b8462000372565b6200037c565b62000372565b9050919050565b6000819050919050565b620003c38362000386565b620003db620003d282620003ae565b8484546200031c565b825550505050565b600090565b620003f2620003e3565b620003ff818484620003b8565b505050565b5b8181101562000427576200041b600082620003e8565b60018101905062000405565b5050565b601f82111562000476576200044081620002ea565b6200044b84620002ff565b810160208510156200045b578190505b620004736200046a85620002ff565b83018262000404565b50505b505050565b600082821c905092915050565b60006200049b600019846008026200047b565b1980831691505092915050565b6000620004b6838362000488565b9150826002028217905092915050565b620004d1826200027b565b67ffffffffffffffff811115620004ed57620004ec62000092565b5b620004f98254620002b5565b620005068282856200042b565b600060209050601f8311600181146200053e576000841562000529578287015190505b620005358582620004a8565b865550620005a5565b601f1984166200054e86620002ea565b60005b82811015620005785784890151825560018201915060208501945060208101905062000551565b8683101562000598578489015162000594601f89168262000488565b8355505b6001600288020188555050505b505050505050565b61122f80620005bd6000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461016857806370a082311461019857806395d89b41146101c8578063a457c2d7146101e6578063a9059cbb14610216578063dd62ed3e14610246576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100fc57806323b872dd1461011a578063313ce5671461014a575b600080fd5b6100b6610276565b6040516100c39190610b0c565b60405180910390f35b6100e660048036038101906100e19190610bc7565b610308565b6040516100f39190610c22565b60405180910390f35b61010461032b565b6040516101119190610c4c565b60405180910390f35b610134600480360381019061012f9190610c67565b610335565b6040516101419190610c22565b60405180910390f35b610152610364565b60405161015f9190610cd6565b60405180910390f35b610182600480360381019061017d9190610bc7565b61036d565b60405161018f9190610c22565b60405180910390f35b6101b260048036038101906101ad9190610cf1565b6103a4565b6040516101bf9190610c4c565b60405180910390f35b6101d06103ec565b6040516101dd9190610b0c565b60405180910390f35b61020060048036038101906101fb9190610bc7565b61047e565b60405161020d9190610c22565b60405180910390f35b610230600480360381019061022b9190610bc7565b6104f5565b60405161023d9190610c22565b60405180910390f35b610260600480360381019061025b9190610d1e565b610518565b60405161026d9190610c4c565b60405180910390f35b60606003805461028590610d8d565b80601f01602080910402602001604051908101604052809291908181526020018280546102b190610d8d565b80156102fe5780601f106102d3576101008083540402835291602001916102fe565b820191906000526020600020905b8154815290600101906020018083116102e157829003601f168201915b5050505050905090565b60008061031361059f565b90506103208185856105a7565b600191505092915050565b6000600254905090565b60008061034061059f565b905061034d858285610770565b6103588585856107fc565b60019150509392505050565b60006012905090565b60008061037861059f565b905061039981858561038a8589610518565b6103949190610ded565b6105a7565b600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6060600480546103fb90610d8d565b80601f016020809104026020016040519081016040528092919081815260200182805461042790610d8d565b80156104745780601f1061044957610100808354040283529160200191610474565b820191906000526020600020905b81548152906001019060200180831161045757829003601f168201915b5050505050905090565b60008061048961059f565b905060006104978286610518565b9050838110156104dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d390610e93565b60405180910390fd5b6104e982868684036105a7565b60019250505092915050565b60008061050061059f565b905061050d8185856107fc565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610616576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060d90610f25565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610685576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067c90610fb7565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516107639190610c4c565b60405180910390a3505050565b600061077c8484610518565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146107f657818110156107e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107df90611023565b60405180910390fd5b6107f584848484036105a7565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361086b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610862906110b5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036108da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d190611147565b60405180910390fd5b6108e5838383610a72565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561096b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610962906111d9565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a599190610c4c565b60405180910390a3610a6c848484610a77565b50505050565b505050565b505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610ab6578082015181840152602081019050610a9b565b60008484015250505050565b6000601f19601f8301169050919050565b6000610ade82610a7c565b610ae88185610a87565b9350610af8818560208601610a98565b610b0181610ac2565b840191505092915050565b60006020820190508181036000830152610b268184610ad3565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610b5e82610b33565b9050919050565b610b6e81610b53565b8114610b7957600080fd5b50565b600081359050610b8b81610b65565b92915050565b6000819050919050565b610ba481610b91565b8114610baf57600080fd5b50565b600081359050610bc181610b9b565b92915050565b60008060408385031215610bde57610bdd610b2e565b5b6000610bec85828601610b7c565b9250506020610bfd85828601610bb2565b9150509250929050565b60008115159050919050565b610c1c81610c07565b82525050565b6000602082019050610c376000830184610c13565b92915050565b610c4681610b91565b82525050565b6000602082019050610c616000830184610c3d565b92915050565b600080600060608486031215610c8057610c7f610b2e565b5b6000610c8e86828701610b7c565b9350506020610c9f86828701610b7c565b9250506040610cb086828701610bb2565b9150509250925092565b600060ff82169050919050565b610cd081610cba565b82525050565b6000602082019050610ceb6000830184610cc7565b92915050565b600060208284031215610d0757610d06610b2e565b5b6000610d1584828501610b7c565b91505092915050565b60008060408385031215610d3557610d34610b2e565b5b6000610d4385828601610b7c565b9250506020610d5485828601610b7c565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680610da557607f821691505b602082108103610db857610db7610d5e565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610df882610b91565b9150610e0383610b91565b9250828201905080821115610e1b57610e1a610dbe565b5b92915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000610e7d602583610a87565b9150610e8882610e21565b604082019050919050565b60006020820190508181036000830152610eac81610e70565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000610f0f602483610a87565b9150610f1a82610eb3565b604082019050919050565b60006020820190508181036000830152610f3e81610f02565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000610fa1602283610a87565b9150610fac82610f45565b604082019050919050565b60006020820190508181036000830152610fd081610f94565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b600061100d601d83610a87565b915061101882610fd7565b602082019050919050565b6000602082019050818103600083015261103c81611000565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061109f602583610a87565b91506110aa82611043565b604082019050919050565b600060208201905081810360008301526110ce81611092565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000611131602383610a87565b915061113c826110d5565b604082019050919050565b6000602082019050818103600083015261116081611124565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b60006111c3602683610a87565b91506111ce82611167565b604082019050919050565b600060208201905081810360008301526111f2816111b6565b905091905056fea26469706673582212204188b273199f085e1921ec1a1fa55abdee2e425960bda675a51fac85acd9972064736f6c63430008110033";class R8 extends Vf{constructor(...e){e.length>1?super(...e):super(T8,A8,e[0])}deploy(e,t,n){return super.deploy(e,t,n||{})}getDeployTransaction(e,t,n){return super.getDeployTransaction(e,t,n||{})}attach(e){return super.attach(e)}connect(e){return super.connect(e)}static bytecode=A8;static abi=T8;static createInterface(){return new os(T8)}static connect(e,t){return new Hf(e,T8,t)}}const S8=[{inputs:[{internalType:"address",name:"owner_",type:"address"},{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"},{internalType:"string",name:"baseURI_",type:"string"},{internalType:"string",name:"contractURI_",type:"string"},{internalType:"address",name:"royaltyAllowlist_",type:"address"},{internalType:"address",name:"royaltyReceiver_",type:"address"},{internalType:"uint96",name:"feeNumerator_",type:"uint96"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{internalType:"address",name:"target",type:"address"}],name:"ApproveTargetNotInAllowlist",type:"error"},{inputs:[{internalType:"address",name:"approver",type:"address"}],name:"ApproverNotInAllowlist",type:"error"},{inputs:[{internalType:"address",name:"caller",type:"address"}],name:"CallerNotInAllowlist",type:"error"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"IImmutableERC721IDAboveThreshold",type:"error"},{inputs:[],name:"IImmutableERC721MismatchedTransferLengths",type:"error"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"IImmutableERC721NotOwnerOrOperator",type:"error"},{inputs:[],name:"IImmutableERC721SendingToZerothAddress",type:"error"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"IImmutableERC721TokenAlreadyBurned",type:"error"},{inputs:[],name:"RoyaltyEnforcementDoesNotImplementRequiredInterface",type:"error"},{inputs:[{internalType:"address",name:"from",type:"address"}],name:"TransferFromNotInAllowlist",type:"error"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"TransferToNotInAllowlist",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"oldRegistry",type:"address"},{indexed:!1,internalType:"address",name:"newRegistry",type:"address"}],name:"RoyaltyAllowlistRegistryUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"MINTER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"baseURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"}],internalType:"struct ERC721Hybrid.IDMint[]",name:"mints",type:"tuple[]"}],name:"batchMintByIDToMultiple",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"quantity",type:"uint256"}],internalType:"struct ERC721Hybrid.Mint[]",name:"mints",type:"tuple[]"}],name:"batchMintByQuantity",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"}],internalType:"struct ERC721Hybrid.IDMint[]",name:"mints",type:"tuple[]"}],name:"batchSafeMintByIDToMultiple",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"quantity",type:"uint256"}],internalType:"struct ERC721Hybrid.Mint[]",name:"mints",type:"tuple[]"}],name:"batchSafeMintByQuantity",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"bulkMintThreshold",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"tokenIDs",type:"uint256[]"}],name:"burnBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"contractURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"exists",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"getAdmins",outputs:[{internalType:"address[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"uint256",name:"index",type:"uint256"}],name:"getRoleMember",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleMemberCount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"grantMinterRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"mintByID",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"quantity",type:"uint256"}],name:"mintByQuantity",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"revokeMinterRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"royaltyAllowlist",outputs:[{internalType:"contract IRoyaltyAllowlist",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"salePrice",type:"uint256"}],name:"royaltyInfo",outputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeMintByID",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"quantity",type:"uint256"}],name:"safeMintByQuantity",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"from",type:"address"},{internalType:"address[]",name:"tos",type:"address[]"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"}],internalType:"struct ERC721Hybrid.TransferRequest",name:"tr",type:"tuple"}],name:"safeTransferFromBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"baseURI_",type:"string"}],name:"setBaseURI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"_contractURI",type:"string"}],name:"setContractURI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"uint96",name:"feeNumerator",type:"uint96"}],name:"setDefaultRoyaltyReceiver",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"receiver",type:"address"},{internalType:"uint96",name:"feeNumerator",type:"uint96"}],name:"setNFTRoyaltyReceiver",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"},{internalType:"address",name:"receiver",type:"address"},{internalType:"uint96",name:"feeNumerator",type:"uint96"}],name:"setNFTRoyaltyReceiverBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_royaltyAllowlist",type:"address"}],name:"setRoyaltyAllowlistRegistry",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}],k8="0x608060405260006013553480156200001657600080fd5b5060405162005189380380620051898339810160408190526200003991620007c0565b8787878787878787868681818181600662000055838262000953565b50600762000064828262000953565b50506801000000000000000060095550600d62000082838262000953565b50600e62000091828262000953565b50620000a69350600092508b915050620000f1565b620000b2828262000134565b620000bd8362000239565b6016620000cb868262000953565b506015620000da858262000953565b505050505050505050505050505050505062000b67565b6200010882826200034060201b6200120f1760201c565b60008281526001602090815260409091206200012f91839062001293620003e1821b17901c565b505050565b6127106001600160601b0382161115620001a85760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084015b60405180910390fd5b6001600160a01b038216620002005760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c69642072656365697665720000000000000060448201526064016200019f565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600355565b6000620002468162000401565b6040516301ffc9a760e01b81526305a3b80960e01b60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa15801562000292573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002b8919062000a1f565b620002d657604051631353be1160e11b815260040160405180910390fd5b600254604080516001600160a01b03928316815291841660208301527ff499b54d61d3fcb40299e3299af3ffe9ef1ee6e47194240f3cc5b6e09f7f6796910160405180910390a150600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620003dd576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556200039c3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b6000620003f8836001600160a01b03841662000410565b90505b92915050565b6200040d813362000462565b50565b60008181526001830160205260408120546200045957508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620003fb565b506000620003fb565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620003dd57620004a181620004f260201b620012a81760201c565b620004b7836020620012ba62000505821b17811c565b604051602001620004ca92919062000a43565b60408051601f198184030181529082905262461bcd60e51b82526200019f9160040162000abc565b6060620003fb6001600160a01b03831660145b606060006200051683600262000b07565b6200052390600262000b21565b6001600160401b038111156200053d576200053d620006db565b6040519080825280601f01601f19166020018201604052801562000568576020820181803683370190505b509050600360fc1b8160008151811062000586576200058662000b37565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110620005b857620005b862000b37565b60200101906001600160f81b031916908160001a9053506000620005de84600262000b07565b620005eb90600162000b21565b90505b60018111156200066d576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811062000623576200062362000b37565b1a60f81b8282815181106200063c576200063c62000b37565b60200101906001600160f81b031916908160001a90535060049490941c93620006658162000b4d565b9050620005ee565b508315620003f85760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016200019f565b80516001600160a01b0381168114620006d657600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200070e578181015183820152602001620006f4565b50506000910152565b600082601f8301126200072957600080fd5b81516001600160401b0380821115620007465762000746620006db565b604051601f8301601f19908116603f01168101908282118183101715620007715762000771620006db565b816040528381528660208588010111156200078b57600080fd5b6200079e846020830160208901620006f1565b9695505050505050565b80516001600160601b0381168114620006d657600080fd5b600080600080600080600080610100898b031215620007de57600080fd5b620007e989620006be565b60208a01519098506001600160401b03808211156200080757600080fd5b620008158c838d0162000717565b985060408b01519150808211156200082c57600080fd5b6200083a8c838d0162000717565b975060608b01519150808211156200085157600080fd5b6200085f8c838d0162000717565b965060808b01519150808211156200087657600080fd5b50620008858b828c0162000717565b9450506200089660a08a01620006be565b9250620008a660c08a01620006be565b9150620008b660e08a01620007a8565b90509295985092959890939650565b600181811c90821680620008da57607f821691505b602082108103620008fb57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200012f57600081815260208120601f850160051c810160208610156200092a5750805b601f850160051c820191505b818110156200094b5782815560010162000936565b505050505050565b81516001600160401b038111156200096f576200096f620006db565b6200098781620009808454620008c5565b8462000901565b602080601f831160018114620009bf5760008415620009a65750858301515b600019600386901b1c1916600185901b1785556200094b565b600085815260208120601f198616915b82811015620009f057888601518255948401946001909101908401620009cf565b508582101562000a0f5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60006020828403121562000a3257600080fd5b81518015158114620003f857600080fd5b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835162000a7d816017850160208801620006f1565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835162000ab0816028840160208801620006f1565b01602801949350505050565b602081526000825180602084015262000add816040850160208701620006f1565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417620003fb57620003fb62000af1565b80820180821115620003fb57620003fb62000af1565b634e487b7160e01b600052603260045260246000fd5b60008162000b5f5762000b5f62000af1565b506000190190565b6146128062000b776000396000f3fe608060405234801561001057600080fd5b50600436106102ba5760003560e01c80636588962a11610182578063a7012816116100e9578063e4623c1b116100a2578063eea987681161007c578063eea9876814610648578063f5e0d8911461065b578063fa52ceec1461066e578063ff6250831461068157600080fd5b8063e4623c1b1461061a578063e8a3d4851461062d578063e985e9c51461063557600080fd5b8063a7012816146105a6578063b88d4fde146105b9578063c87b56dd146105cc578063ca15c873146105df578063d5391393146105f2578063d547741f1461060757600080fd5b80639010d07c1161013b5780639010d07c1461054a57806391d148541461055d578063938e3d7b1461057057806395d89b4114610583578063a217fddf1461058b578063a22cb4651461059357600080fd5b80636588962a146104e357806369e2f0fb146104f65780636b3a0632146105095780636c0360eb1461051c57806370a0823114610524578063885e7a081461053757600080fd5b806331ae450b116102265780634f558e79116101df5780634f558e791461047157806355f804b314610484578063567e4075146104975780635b32f935146104aa578063608a0b9d146104bd5780636352211e146104d057600080fd5b806331ae450b146103fd57806336568abe146104125780633dd1eb611461042557806342842e0e1461043857806342966c681461044b578063439aed341461045e57600080fd5b806318160ddd1161027857806318160ddd146103625780631f8ebbd11461037857806323b872dd14610382578063248a9ca3146103955780632a55205a146103b85780632f2ff15d146103ea57600080fd5b80628ad946146102bf57806301ffc9a7146102d45780630656b536146102fc57806306fdde031461030f578063081812fc14610324578063095ea7b31461034f575b600080fd5b6102d26102cd3660046137c8565b610694565b005b6102e76102e2366004613818565b61076a565b60405190151581526020015b60405180910390f35b6102d261030a3660046138dd565b61077b565b61031761079c565b6040516102f391906139ee565b610337610332366004613a01565b6107ab565b6040516001600160a01b0390911681526020016102f3565b6102d261035d366004613a1a565b6107cb565b61036a610926565b6040519081526020016102f3565b600160401b61036a565b6102d2610390366004613a44565b61093d565b61036a6103a3366004613a01565b60009081526020819052604090206001015490565b6103cb6103c6366004613a80565b61095f565b604080516001600160a01b0390931683526020830191909152016102f3565b6102d26103f8366004613aa2565b610a0d565b610405610a32565b6040516102f39190613ace565b6102d2610420366004613aa2565b610ae0565b6102d2610433366004613b1b565b610b5a565b6102d2610446366004613a44565b610b7d565b6102d2610459366004613a01565b610b98565b6102d261046c366004613b4d565b610bcf565b6102e761047f366004613a01565b610bf8565b6102d2610492366004613be0565b610c03565b6102d26104a5366004613a1a565b610c1a565b6102d26104b8366004613a1a565b610c3c565b6102d26104cb3660046138dd565b610c5e565b6103376104de366004613a01565b610c7f565b6102d26104f1366004613b1b565b610c9f565b6102d2610504366004613b1b565b610da0565b600254610337906001600160a01b031681565b610317610dc3565b61036a610532366004613b1b565b610e51565b6102d2610545366004613c28565b610e6f565b610337610558366004613a80565b610e84565b6102e761056b366004613aa2565b610ea3565b6102d261057e366004613be0565b610ecc565b610317610ee3565b61036a600081565b6102d26105a1366004613c60565b610eed565b6102d26105b4366004613cdb565b61103e565b6102d26105c7366004613d3f565b61109e565b6103176105da366004613a01565b6110c7565b61036a6105ed366004613a01565b6110d2565b61036a6a4d494e5445525f524f4c4560a81b81565b6102d2610615366004613aa2565b6110e9565b6102d2610628366004613dba565b61110e565b61031761114c565b6102e7610643366004613dfb565b611159565b6102d2610656366004613a1a565b611189565b6102d2610669366004613e25565b6111ab565b6102d261067c366004613e25565b6111cc565b6102d261068f366004613a1a565b6111ed565b6106a16020820182613f71565b90506106b06040830183613f71565b9050146106d05760405163359a1bc360e01b815260040160405180910390fd5b60005b6106e06040830183613f71565b9050811015610766576107546106f96020840184613b1b565b6107066020850185613f71565b8481811061071657610716613fba565b905060200201602081019061072b9190613b1b565b6107386040860186613f71565b8581811061074857610748613fba565b90506020020135610b7d565b8061075e81613fe6565b9150506106d3565b5050565b600061077582611455565b92915050565b6a4d494e5445525f524f4c4560a81b61079381611460565b6107668261146a565b60606107a66114b9565b905090565b6000600160401b8210156107c2576107758261154b565b61077582611572565b81333b1580159061084557506002546040516305a3b80960e01b81523360048201526001600160a01b03909116906305a3b80990602401602060405180830381865afa15801561081f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108439190613fff565b155b1561086a5760405163f6fa4cbd60e01b81523360048201526024015b60405180910390fd5b6001600160a01b0381163b158015906108ee57506002546040516305a3b80960e01b81526001600160a01b038381166004830152909116906305a3b80990602401602060405180830381865afa1580156108c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ec9190613fff565b155b15610917576040516341b8d58160e11b81526001600160a01b0382166004820152602401610861565b61092183836115fd565b505050565b600060135461093361161d565b6107a6919061401c565b600160401b81101561095457610921838383611639565b610921838383611669565b60008281526004602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916109d45750604080518082019091526003546001600160a01b0381168252600160a01b90046001600160601b031660208201525b6020810151600090612710906109f3906001600160601b03168761402f565b6109fd9190614046565b91519350909150505b9250929050565b600082815260208190526040902060010154610a2881611460565b610921838361168e565b60606000610a3f816110d2565b90506000816001600160401b03811115610a5b57610a5b613835565b604051908082528060200260200182016040528015610a84578160200160208202803683370190505b50905060005b82811015610ad957610a9d600082610e84565b828281518110610aaf57610aaf613fba565b6001600160a01b039092166020928302919091019091015280610ad181613fe6565b915050610a8a565b5092915050565b6001600160a01b0381163314610b505760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610861565b61076682826116b0565b6000610b6581611460565b6107666a4d494e5445525f524f4c4560a81b83610a0d565b6109218383836040518060200160405280600081525061109e565b610ba3335b826116d2565b610bc357604051630247e3a960e01b815260048101829052602401610861565b610bcc816116fb565b50565b6a4d494e5445525f524f4c4560a81b610be781611460565b610bf284848461174e565b50505050565b600061077582611819565b6000610c0e81611460565b601661092183826140e8565b6a4d494e5445525f524f4c4560a81b610c3281611460565b6109218383611876565b6a4d494e5445525f524f4c4560a81b610c5481611460565b6109218383611880565b6a4d494e5445525f524f4c4560a81b610c7681611460565b61076682611907565b6000600160401b821015610c965761077582611956565b610775826119b6565b6000610caa81611460565b6040516301ffc9a760e01b81526305a3b80960e01b60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa158015610cf5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d199190613fff565b610d3657604051631353be1160e11b815260040160405180910390fd5b600254604080516001600160a01b03928316815291841660208301527ff499b54d61d3fcb40299e3299af3ffe9ef1ee6e47194240f3cc5b6e09f7f6796910160405180910390a150600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000610dab81611460565b6107666a4d494e5445525f524f4c4560a81b836110e9565b60168054610dd090614068565b80601f0160208091040260200160405190810160405280929190818152602001828054610dfc90614068565b8015610e495780601f10610e1e57610100808354040283529160200191610e49565b820191906000526020600020905b815481529060010190602001808311610e2c57829003601f168201915b505050505081565b6000610e5c826119ca565b610e6583611a95565b610775919061401c565b6000610e7a81611460565b6109218383611b1b565b6000828152600160205260408120610e9c9083611bd5565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610ed781611460565b601561092183826140e8565b60606107a6611be1565b81333b15801590610f6757506002546040516305a3b80960e01b81523360048201526001600160a01b03909116906305a3b80990602401602060405180830381865afa158015610f41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f659190613fff565b155b15610f875760405163f6fa4cbd60e01b8152336004820152602401610861565b6001600160a01b0381163b1580159061100b57506002546040516305a3b80960e01b81526001600160a01b038381166004830152909116906305a3b80990602401602060405180830381865afa158015610fe5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110099190613fff565b155b15611034576040516341b8d58160e11b81526001600160a01b0382166004820152602401610861565b6109218383611bf0565b6a4d494e5445525f524f4c4560a81b61105681611460565b60005b848110156110965761108486868381811061107657611076613fba565b90506020020135858561174e565b8061108e81613fe6565b915050611059565b505050505050565b600160401b8210156110bb576110b684848484611bfa565b610bf2565b610bf284848484611c2d565b606061077582611c52565b600081815260016020526040812061077590611cb8565b60008281526020819052604090206001015461110481611460565b61092183836116b0565b60005b818110156109215761113a83838381811061112e5761112e613fba565b90506020020135610b98565b8061114481613fe6565b915050611111565b60158054610dd090614068565b6001600160a01b03808316600090815260126020908152604080832093851683529290529081205460ff16610e9c565b6a4d494e5445525f524f4c4560a81b6111a181611460565b6109218383611cc2565b6a4d494e5445525f524f4c4560a81b6111c381611460565b61076682611ccc565b6a4d494e5445525f524f4c4560a81b6111e481611460565b61076682611d1b565b6a4d494e5445525f524f4c4560a81b61120581611460565b6109218383611d6a565b6112198282610ea3565b610766576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561124f3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610e9c836001600160a01b038416611dd8565b60606107756001600160a01b03831660145b606060006112c983600261402f565b6112d490600261401c565b6001600160401b038111156112eb576112eb613835565b6040519080825280601f01601f191660200182016040528015611315576020820181803683370190505b509050600360fc1b8160008151811061133057611330613fba565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061135f5761135f613fba565b60200101906001600160f81b031916908160001a905350600061138384600261402f565b61138e90600161401c565b90505b6001811115611406576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106113c2576113c2613fba565b1a60f81b8282815181106113d8576113d8613fba565b60200101906001600160f81b031916908160001a90535060049490941c936113ff816141a7565b9050611391565b508315610e9c5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610861565b600061077582611e27565b610bcc8133611e67565b60005b815181101561076657600082828151811061148a5761148a613fba565b602002602001015190506114a681600001518260200151611876565b50806114b181613fe6565b91505061146d565b6060600d80546114c890614068565b80601f01602080910402602001604051908101604052809291908181526020018280546114f490614068565b80156115415780601f1061151657610100808354040283529160200191611541565b820191906000526020600020905b81548152906001019060200180831161152457829003601f168201915b5050505050905090565b600061155682611ec0565b506000908152601160205260409020546001600160a01b031690565b600061157d82611819565b6115e15760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a20617070726f76656420717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610861565b506000908152600a60205260409020546001600160a01b031690565b600160401b811015611613576107668282611f10565b6107668282612020565b6000611627612128565b61162f612192565b6107a691906141be565b61164233610b9d565b61165e5760405162461bcd60e51b8152600401610861906141d1565b6109218383836121a6565b61167233610b9d565b61165e5760405162461bcd60e51b81526004016108619061421e565b611698828261120f565b60008281526001602052604090206109219082611293565b6116ba82826123ad565b60008281526001602052604090206109219082612412565b6000600160401b8210156116f1576116ea8383612427565b9050610775565b610e9c8383612486565b600160401b811015611745576117108161254b565b600881901c60009081526014602052604081208054600160ff85161b179055601380549161173d836141a7565b919050555050565b610bcc816125ce565b6127106001600160601b03821611156117795760405162461bcd60e51b815260040161086190614272565b6001600160a01b0382166117cf5760405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152606401610861565b6040805180820182526001600160a01b0393841681526001600160601b0392831660208083019182526000968752600490529190942093519051909116600160a01b029116179055565b6000600160401b82101561186d576000828152600f60205260409020546001600160a01b0316158015906107755750600882901c600090815260146020526040902054600160ff84161b1615151592915050565b61077582612610565b6107668282612645565b600160401b81106118a75760405163b73c99f560e01b815260048101829052602401610861565b600881901c600090815260146020526040902054600160ff83161b16156118e4576040516305dcda1160e51b815260048101829052602401610861565b6118ee828261265f565b601380549060006118fe83613fe6565b91905055505050565b60005b815181101561076657600082828151811061192757611927613fba565b6020026020010151905061194381600001518260200151611cc2565b508061194e81613fe6565b91505061190a565b6000818152600f60205260408120546001600160a01b0316806107755760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610861565b6000806119c2836127ba565b509392505050565b60006001600160a01b038216611a385760405162461bcd60e51b815260206004820152602d60248201527f4552433732315073693a2062616c616e636520717565727920666f722074686560448201526c207a65726f206164647265737360981b6064820152608401610861565b6000600160401b5b600954811015610ad957611a5381611819565b15611a8557611a6181610c7f565b6001600160a01b0316846001600160a01b031603611a8557611a8282613fe6565b91505b611a8e81613fe6565b9050611a40565b60006001600160a01b038216611aff5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610861565b506001600160a01b031660009081526010602052604090205490565b6127106001600160601b0382161115611b465760405162461bcd60e51b815260040161086190614272565b6001600160a01b038216611b9c5760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610861565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600355565b6000610e9c8383612851565b6060600e80546114c890614068565b610766828261287b565b611c05335b836116d2565b611c215760405162461bcd60e51b8152600401610861906141d1565b610bf284848484612886565b611c3633611bff565b611c215760405162461bcd60e51b81526004016108619061421e565b6060611c5d82611ec0565b6000611c676128aa565b90506000815111611c875760405180602001604052806000815250610e9c565b80611c91846128b9565b604051602001611ca29291906142bc565b6040516020818303038152906040529392505050565b6000610775825490565b610766828261294b565b60005b8151811015610766576000828281518110611cec57611cec613fba565b60200260200101519050611d0881600001518260200151612ac4565b5080611d1381613fe6565b915050611ccf565b60005b8151811015610766576000828281518110611d3b57611d3b613fba565b60200260200101519050611d5781600001518260200151612b05565b5080611d6281613fe6565b915050611d1e565b600160401b8110611d915760405163b73c99f560e01b815260048101829052602401610861565b600881901c600090815260146020526040902054600160ff83161b1615611dce576040516305dcda1160e51b815260048101829052602401610861565b6118ee8282612b46565b6000818152600183016020526040812054611e1f57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610775565b506000610775565b60006001600160e01b031982166380ac58cd60e01b1480611e5857506001600160e01b03198216635b5e139f60e01b145b80610775575061077582612b60565b611e718282610ea3565b61076657611e7e816112a8565b611e898360206112ba565b604051602001611e9a9291906142eb565b60408051601f198184030181529082905262461bcd60e51b8252610861916004016139ee565b611ec981611819565b610bcc5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610861565b6000611f1b82611956565b9050806001600160a01b0316836001600160a01b031603611f885760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610861565b336001600160a01b0382161480611fa45750611fa48133611159565b6120165760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610861565b6109218383612ba0565b600061202b82610c7f565b9050806001600160a01b0316836001600160a01b03160361209a5760405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a20617070726f76616c20746f2063757272656e74206f6044820152633bb732b960e11b6064820152608401610861565b336001600160a01b03821614806120b657506120b68133611159565b6120165760405162461bcd60e51b815260206004820152603b60248201527f4552433732315073693a20617070726f76652063616c6c6572206973206e6f7460448201527f206f776e6572206e6f7220617070726f76656420666f7220616c6c00000000006064820152608401610861565b6009546000906701000000000000009082906121489060081c600161401c565b9050815b8181101561218c576000818152600c602052604090205461216c81612bc0565b612176908661401c565b945050808061218490613fe6565b91505061214c565b50505090565b6000600160401b6009546107a691906141be565b828233321480159061222157506002546040516305a3b80960e01b81523360048201526001600160a01b03909116906305a3b80990602401602060405180830381865afa1580156121fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061221f9190613fff565b155b156122415760405163937db65f60e01b8152336004820152602401610861565b6001600160a01b0382163b158015906122c557506002546040516305a3b80960e01b81526001600160a01b038481166004830152909116906305a3b80990602401602060405180830381865afa15801561229f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122c39190613fff565b155b156122ee5760405163f934453160e01b81526001600160a01b0383166004820152602401610861565b6001600160a01b0381163b1580159061237257506002546040516305a3b80960e01b81526001600160a01b038381166004830152909116906305a3b80990602401602060405180830381865afa15801561234c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123709190613fff565b155b1561239b57604051632a67242160e11b81526001600160a01b0382166004820152602401610861565b6123a6858585612bdf565b5050505050565b6123b78282610ea3565b15610766576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610e9c836001600160a01b038416612c01565b60008061243383611956565b9050806001600160a01b0316846001600160a01b0316148061245a575061245a8185611159565b8061247e5750836001600160a01b0316612473846107ab565b6001600160a01b0316145b949350505050565b600061249182611819565b6124f55760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a206f70657261746f7220717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610861565b600061250083610c7f565b9050806001600160a01b0316846001600160a01b0316148061253b5750836001600160a01b0316612530846107ab565b6001600160a01b0316145b8061247e575061247e8185611159565b600061255682611956565b905061256182611956565b600083815260116020908152604080832080546001600160a01b03199081169091556001600160a01b038516808552601084528285208054600019019055878552600f909352818420805490911690555192935084926000805160206144bd833981519152908390a45050565b60006125d982610c7f565b90506125e6600c83612cf4565b60405182906000906001600160a01b038416906000805160206144bd833981519152908390a45050565b600881901c6000908152600c6020526040812054600160ff1b60ff84161c161561263c57506000919050565b61077582612d20565b610766828260405180602001604052806000815250612d3f565b6001600160a01b0382166126b55760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610861565b6126be81611819565b1561270b5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610861565b61271481611819565b156127615760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610861565b6001600160a01b038216600081815260106020908152604080832080546001019055848352600f90915280822080546001600160a01b0319168417905551839291906000805160206144bd833981519152908290a45050565b6000806127c683611819565b6128275760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a206f776e657220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610861565b61283083612d80565b6000818152600860205260409020546001600160a01b031694909350915050565b600082600001828154811061286857612868613fba565b9060005260206000200154905092915050565b610766338383612d8d565b600160401b82101561289e576110b684848484612e5b565b610bf284848484612e8e565b6060601680546114c890614068565b606060006128c683612ea7565b60010190506000816001600160401b038111156128e5576128e5613835565b6040519080825280601f01601f19166020018201604052801561290f576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461291957509392505050565b600061295660095490565b9050600082116129b65760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a207175616e74697479206d7573742062652067726561604482015264074657220360dc1b6064820152608401610861565b6001600160a01b038316612a185760405162461bcd60e51b815260206004820152602360248201527f4552433732315073693a206d696e7420746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610861565b8160096000828254612a2a919061401c565b9091555050600081815260086020526040902080546001600160a01b0319166001600160a01b038516179055612a61600582612cf4565b600080612a6e848461401c565b90506001600160a01b0385169150828260006000805160206144bd833981519152600080a4600183015b818114612abe57808360006000805160206144bd833981519152600080a4600101612a98565b506123a6565b60005b815181101561092157612af383838381518110612ae657612ae6613fba565b6020026020010151611d6a565b80612afd81613fe6565b915050612ac7565b60005b815181101561092157612b3483838381518110612b2757612b27613fba565b6020026020010151611880565b80612b3e81613fe6565b915050612b08565b610766828260405180602001604052806000815250612f7f565b60006001600160e01b031982166380ac58cd60e01b1480612b9157506001600160e01b03198216635b5e139f60e01b145b80610775575061077582612f8a565b600160401b811015612bb6576107668282612faf565b610766828261301d565b60005b8115612bda57600019820190911690600101612bc3565b919050565b600160401b811015612bf657610921838383613052565b6109218383836131a4565b60008181526001830160205260408120548015612cea576000612c256001836141be565b8554909150600090612c39906001906141be565b9050818114612c9e576000866000018281548110612c5957612c59613fba565b9060005260206000200154905080876000018481548110612c7c57612c7c613fba565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612caf57612caf614360565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610775565b6000915050610775565b600881901c600090815260209290925260409091208054600160ff1b60ff9093169290921c9091179055565b6000612d2b60095490565b82108015610775575050600160401b111590565b6000612d4a60095490565b9050612d56848461294b565b612d6460008583868661337c565b610bf25760405162461bcd60e51b815260040161086190614376565b60006107756005836134b3565b816001600160a01b0316836001600160a01b031603612dee5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610861565b6001600160a01b03838116600081815260126020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612e668484846121a6565b612e72848484846135ab565b610bf25760405162461bcd60e51b8152600401610861906143cb565b612e998484846121a6565b612d6484848460018561337c565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612ee65772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612f12576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612f3057662386f26fc10000830492506010015b6305f5e1008310612f48576305f5e100830492506008015b6127108310612f5c57612710830492506004015b60648310612f6e576064830492506002015b600a83106107755760010192915050565b6109218383836136a4565b60006001600160e01b0319821663152a902d60e11b14806107755750610775826136d7565b600081815260116020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612fe482611956565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600a6020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612fe482610c7f565b826001600160a01b031661306582611956565b6001600160a01b03161461308b5760405162461bcd60e51b81526004016108619061441d565b6001600160a01b0382166130ed5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610861565b826001600160a01b031661310082611956565b6001600160a01b0316146131265760405162461bcd60e51b81526004016108619061441d565b600081815260116020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260108552838620805460001901905590871680865283862080546001019055868652600f90945282852080549092168417909155905184936000805160206144bd83398151915291a4505050565b6000806131b0836127ba565b91509150846001600160a01b0316826001600160a01b03161461322a5760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a207472616e73666572206f6620746f6b656e2074686160448201526b3a1034b9903737ba1037bbb760a11b6064820152608401610861565b6001600160a01b0384166132905760405162461bcd60e51b815260206004820152602760248201527f4552433732315073693a207472616e7366657220746f20746865207a65726f206044820152666164647265737360c81b6064820152608401610861565b61329b600084612ba0565b60006132a884600161401c565b600881901c600090815260056020526040902054909150600160ff1b60ff83161c161580156132d8575060095481105b1561330f57600081815260086020526040902080546001600160a01b0319166001600160a01b03881617905561330f600582612cf4565b600084815260086020526040902080546001600160a01b0319166001600160a01b03871617905581841461334857613348600585612cf4565b83856001600160a01b0316876001600160a01b03166000805160206144bd83398151915260405160405180910390a4611096565b60006001600160a01b0385163b156134a657506001835b61339d848661401c565b8110156134a057604051630a85bd0160e11b81526001600160a01b0387169063150b7a02906133d69033908b9086908990600401614462565b6020604051808303816000875af1925050508015613411575060408051601f3d908101601f1916820190925261340e9181019061449f565b60015b61346e573d80801561343f576040519150601f19603f3d011682016040523d82523d6000602084013e613444565b606091505b5080516000036134665760405162461bcd60e51b815260040161086190614376565b805181602001fd5b82801561348b57506001600160e01b03198116630a85bd0160e11b145b9250508061349881613fe6565b915050613393565b506134aa565b5060015b95945050505050565b600881901c60008181526020849052604081205490919060ff808516919082181c80156134f5576134e3816136e2565b60ff168203600884901b1793506135a2565b600083116135625760405162461bcd60e51b815260206004820152603460248201527f4269744d6170733a205468652073657420626974206265666f7265207468652060448201527334b73232bc103237b2b9b713ba1032bc34b9ba1760611b6064820152608401610861565b50600019909101600081815260208690526040902054909190801561359d5761358a816136e2565b60ff0360ff16600884901b1793506135a2565b6134f5565b50505092915050565b60006001600160a01b0384163b1561369957604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906135ef903390899088908890600401614462565b6020604051808303816000875af192505050801561362a575060408051601f3d908101601f191682019092526136279181019061449f565b60015b61367f573d808015613658576040519150601f19603f3d011682016040523d82523d6000602084013e61365d565b606091505b5080516000036134665760405162461bcd60e51b8152600401610861906143cb565b6001600160e01b031916630a85bd0160e11b14905061247e565b506001949350505050565b6136ae838361374c565b6136bb60008484846135ab565b6109215760405162461bcd60e51b8152600401610861906143cb565b600061077582613756565b600060405180610120016040528061010081526020016144dd610100913960f87e818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff61372b8561377b565b02901c8151811061373e5761373e613fba565b016020015160f81c92915050565b610766828261265f565b60006001600160e01b03198216635a05180f60e01b1480610775575061077582613793565b600080821161378957600080fd5b5060008190031690565b60006001600160e01b03198216637965db0b60e01b148061077557506301ffc9a760e01b6001600160e01b0319831614610775565b6000602082840312156137da57600080fd5b81356001600160401b038111156137f057600080fd5b820160608185031215610e9c57600080fd5b6001600160e01b031981168114610bcc57600080fd5b60006020828403121561382a57600080fd5b8135610e9c81613802565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b038111828210171561386d5761386d613835565b60405290565b604051601f8201601f191681016001600160401b038111828210171561389b5761389b613835565b604052919050565b60006001600160401b038211156138bc576138bc613835565b5060051b60200190565b80356001600160a01b0381168114612bda57600080fd5b600060208083850312156138f057600080fd5b82356001600160401b0381111561390657600080fd5b8301601f8101851361391757600080fd5b803561392a613925826138a3565b613873565b81815260069190911b8201830190838101908783111561394957600080fd5b928401925b8284101561399357604084890312156139675760008081fd5b61396f61384b565b613978856138c6565b8152848601358682015282526040909301929084019061394e565b979650505050505050565b60005b838110156139b95781810151838201526020016139a1565b50506000910152565b600081518084526139da81602086016020860161399e565b601f01601f19169290920160200192915050565b602081526000610e9c60208301846139c2565b600060208284031215613a1357600080fd5b5035919050565b60008060408385031215613a2d57600080fd5b613a36836138c6565b946020939093013593505050565b600080600060608486031215613a5957600080fd5b613a62846138c6565b9250613a70602085016138c6565b9150604084013590509250925092565b60008060408385031215613a9357600080fd5b50508035926020909101359150565b60008060408385031215613ab557600080fd5b82359150613ac5602084016138c6565b90509250929050565b6020808252825182820181905260009190848201906040850190845b81811015613b0f5783516001600160a01b031683529284019291840191600101613aea565b50909695505050505050565b600060208284031215613b2d57600080fd5b610e9c826138c6565b80356001600160601b0381168114612bda57600080fd5b600080600060608486031215613b6257600080fd5b83359250613b72602085016138c6565b9150613b8060408501613b36565b90509250925092565b60006001600160401b03831115613ba257613ba2613835565b613bb5601f8401601f1916602001613873565b9050828152838383011115613bc957600080fd5b828260208301376000602084830101529392505050565b600060208284031215613bf257600080fd5b81356001600160401b03811115613c0857600080fd5b8201601f81018413613c1957600080fd5b61247e84823560208401613b89565b60008060408385031215613c3b57600080fd5b613c44836138c6565b9150613ac560208401613b36565b8015158114610bcc57600080fd5b60008060408385031215613c7357600080fd5b613c7c836138c6565b91506020830135613c8c81613c52565b809150509250929050565b60008083601f840112613ca957600080fd5b5081356001600160401b03811115613cc057600080fd5b6020830191508360208260051b8501011115610a0657600080fd5b60008060008060608587031215613cf157600080fd5b84356001600160401b03811115613d0757600080fd5b613d1387828801613c97565b9095509350613d269050602086016138c6565b9150613d3460408601613b36565b905092959194509250565b60008060008060808587031215613d5557600080fd5b613d5e856138c6565b9350613d6c602086016138c6565b92506040850135915060608501356001600160401b03811115613d8e57600080fd5b8501601f81018713613d9f57600080fd5b613dae87823560208401613b89565b91505092959194509250565b60008060208385031215613dcd57600080fd5b82356001600160401b03811115613de357600080fd5b613def85828601613c97565b90969095509350505050565b60008060408385031215613e0e57600080fd5b613e17836138c6565b9150613ac5602084016138c6565b60006020808385031215613e3857600080fd5b82356001600160401b0380821115613e4f57600080fd5b818501915085601f830112613e6357600080fd5b8135613e71613925826138a3565b81815260059190911b83018401908481019088831115613e9057600080fd5b8585015b83811015613f6457803585811115613eac5760008081fd5b86016040818c03601f1901811315613ec45760008081fd5b613ecc61384b565b613ed78a84016138c6565b81528183013588811115613eeb5760008081fd5b8084019350508c603f840112613f015760008081fd5b89830135613f11613925826138a3565b81815260059190911b84018301908b8101908f831115613f315760008081fd5b948401945b82861015613f4f5785358252948c0194908c0190613f36565b838d0152505085525050918601918601613e94565b5098975050505050505050565b6000808335601e19843603018112613f8857600080fd5b8301803591506001600160401b03821115613fa257600080fd5b6020019150600581901b3603821315610a0657600080fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201613ff857613ff8613fd0565b5060010190565b60006020828403121561401157600080fd5b8151610e9c81613c52565b8082018082111561077557610775613fd0565b808202811582820484141761077557610775613fd0565b60008261406357634e487b7160e01b600052601260045260246000fd5b500490565b600181811c9082168061407c57607f821691505b60208210810361409c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561092157600081815260208120601f850160051c810160208610156140c95750805b601f850160051c820191505b81811015611096578281556001016140d5565b81516001600160401b0381111561410157614101613835565b6141158161410f8454614068565b846140a2565b602080601f83116001811461414a57600084156141325750858301515b600019600386901b1c1916600185901b178555611096565b600085815260208120601f198616915b828110156141795788860151825594840194600190910190840161415a565b50858210156141975787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000816141b6576141b6613fd0565b506000190190565b8181038181111561077557610775613fd0565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b60208082526034908201527f4552433732315073693a207472616e736665722063616c6c6572206973206e6f6040820152731d081bdddb995c881b9bdc88185c1c1c9bdd995960621b606082015260800190565b6020808252602a908201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646040820152692073616c65507269636560b01b606082015260800190565b600083516142ce81846020880161399e565b8351908301906142e281836020880161399e565b01949350505050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161432381601785016020880161399e565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161435481602884016020880161399e565b01602801949350505050565b634e487b7160e01b600052603160045260246000fd5b60208082526035908201527f4552433732315073693a207472616e7366657220746f206e6f6e20455243373260408201527418a932b1b2b4bb32b91034b6b83632b6b2b73a32b960591b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090614495908301846139c2565b9695505050505050565b6000602082840312156144b157600080fd5b8151610e9c8161380256feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8a2646970667358221220216dd955505e933a17e6f45acb29b390eaf7241d0e86fad51fe9b9e3417836e264736f6c63430008110033";class O8 extends Vf{constructor(...e){e.length>1?super(...e):super(S8,k8,e[0])}deploy(e,t,n,r,i,a,o,s,u){return super.deploy(e,t,n,r,i,a,o,s,u||{})}getDeployTransaction(e,t,n,r,i,a,o,s,u){return super.getDeployTransaction(e,t,n,r,i,a,o,s,u||{})}attach(e){return super.attach(e)}connect(e){return super.connect(e)}static bytecode=k8;static abi=S8;static createInterface(){return new os(S8)}static connect(e,t){return new Hf(e,S8,t)}}const I8=[{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"},{internalType:"string",name:"baseURI_",type:"string"},{internalType:"string",name:"contractURI_",type:"string"},{internalType:"address",name:"_royaltyAllowlist",type:"address"},{internalType:"address",name:"_receiver",type:"address"},{internalType:"uint96",name:"_feeNumerator",type:"uint96"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{internalType:"address",name:"target",type:"address"}],name:"ApproveTargetNotInAllowlist",type:"error"},{inputs:[{internalType:"address",name:"approver",type:"address"}],name:"ApproverNotInAllowlist",type:"error"},{inputs:[{internalType:"address",name:"caller",type:"address"}],name:"CallerNotInAllowlist",type:"error"},{inputs:[{internalType:"address",name:"from",type:"address"}],name:"TransferFromNotInAllowlist",type:"error"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"TransferToNotInAllowlist",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"oldRegistry",type:"address"},{indexed:!1,internalType:"address",name:"newRegistry",type:"address"}],name:"RoyaltytAllowlistRegistryUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"MINTER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"_burnedTokens",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"_totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"baseURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"tokenIDs",type:"uint256[]"}],name:"burnBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"contractURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"getAdmins",outputs:[{internalType:"address[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"uint256",name:"index",type:"uint256"}],name:"getRoleMember",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleMemberCount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"grantMinterRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenID",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"revokeMinterRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"royaltyAllowlist",outputs:[{internalType:"contract IRoyaltyAllowlist",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"salePrice",type:"uint256"}],name:"royaltyInfo",outputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenID",type:"uint256"}],name:"safeMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"}],internalType:"struct ImmutableERC721Base.IDMint[]",name:"mintRequests",type:"tuple[]"}],name:"safeMintBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"from",type:"address"},{internalType:"address[]",name:"tos",type:"address[]"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"}],internalType:"struct ImmutableERC721Base.TransferRequest",name:"tr",type:"tuple"}],name:"safeTransferFromBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"baseURI_",type:"string"}],name:"setBaseURI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"_contractURI",type:"string"}],name:"setContractURI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"uint96",name:"feeNumerator",type:"uint96"}],name:"setDefaultRoyaltyReceiver",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"receiver",type:"address"},{internalType:"uint96",name:"feeNumerator",type:"uint96"}],name:"setNFTRoyaltyReceiver",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"},{internalType:"address",name:"receiver",type:"address"},{internalType:"uint96",name:"feeNumerator",type:"uint96"}],name:"setNFTRoyaltyReceiverBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_royaltyAllowlist",type:"address"}],name:"setRoyaltyAllowlistRegistry",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}],x8="0x60806040526000600d553480156200001657600080fd5b5060405162003f9238038062003f92833981016040819052620000399162000811565b8787878787868685856003620000508382620009a4565b5060046200005f8282620009a4565b505050620000748282620000fc60201b60201c565b6200008160008862000201565b600c6200008f8582620009a4565b50600b6200009e8482620009a4565b5050505050505050620000b88282620000fc60201b60201c565b620000c560008962000201565b620000d08362000244565b600c620000de8682620009a4565b50600b620000ed8582620009a4565b50505050505050505062000bb8565b6127106001600160601b0382161115620001705760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084015b60405180910390fd5b6001600160a01b038216620001c85760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c696420726563656976657200000000000000604482015260640162000167565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600955565b6200021882826200039160201b620013ca1760201c565b60008281526001602090815260409091206200023f9183906200144e62000432821b17901c565b505050565b6000620002518162000452565b6040516301ffc9a760e01b81526305a3b80960e01b60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa1580156200029d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002c3919062000a70565b620003275760405162461bcd60e51b815260206004820152602d60248201527f636f6e747261637420646f6573206e6f7420696d706c656d656e742049526f7960448201526c185b1d1e505b1b1bdddb1a5cdd609a1b606482015260840162000167565b600254604080516001600160a01b03928316815291841660208301527f4a1d010d926ae0d4294a4afe61ae81bb378335fbf671e099a7138b5afeefdf84910160405180910390a150600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166200042e576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620003ed3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600062000449836001600160a01b03841662000461565b90505b92915050565b6200045e8133620004b3565b50565b6000818152600183016020526040812054620004aa575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556200044c565b5060006200044c565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166200042e57620004f2816200054360201b620014631760201c565b620005088360206200147562000556821b17811c565b6040516020016200051b92919062000a94565b60408051601f198184030181529082905262461bcd60e51b8252620001679160040162000b0d565b60606200044c6001600160a01b03831660145b606060006200056783600262000b58565b6200057490600262000b72565b6001600160401b038111156200058e576200058e6200072c565b6040519080825280601f01601f191660200182016040528015620005b9576020820181803683370190505b509050600360fc1b81600081518110620005d757620005d762000b88565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811062000609576200060962000b88565b60200101906001600160f81b031916908160001a90535060006200062f84600262000b58565b6200063c90600162000b72565b90505b6001811115620006be576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811062000674576200067462000b88565b1a60f81b8282815181106200068d576200068d62000b88565b60200101906001600160f81b031916908160001a90535060049490941c93620006b68162000b9e565b90506200063f565b508315620004495760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640162000167565b80516001600160a01b03811681146200072757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200075f57818101518382015260200162000745565b50506000910152565b600082601f8301126200077a57600080fd5b81516001600160401b03808211156200079757620007976200072c565b604051601f8301601f19908116603f01168101908282118183101715620007c257620007c26200072c565b81604052838152866020858801011115620007dc57600080fd5b620007ef84602083016020890162000742565b9695505050505050565b80516001600160601b03811681146200072757600080fd5b600080600080600080600080610100898b0312156200082f57600080fd5b6200083a896200070f565b60208a01519098506001600160401b03808211156200085857600080fd5b620008668c838d0162000768565b985060408b01519150808211156200087d57600080fd5b6200088b8c838d0162000768565b975060608b0151915080821115620008a257600080fd5b620008b08c838d0162000768565b965060808b0151915080821115620008c757600080fd5b50620008d68b828c0162000768565b945050620008e760a08a016200070f565b9250620008f760c08a016200070f565b91506200090760e08a01620007f9565b90509295985092959890939650565b600181811c908216806200092b57607f821691505b6020821081036200094c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200023f57600081815260208120601f850160051c810160208610156200097b5750805b601f850160051c820191505b818110156200099c5782815560010162000987565b505050505050565b81516001600160401b03811115620009c057620009c06200072c565b620009d881620009d1845462000916565b8462000952565b602080601f83116001811462000a105760008415620009f75750858301515b600019600386901b1c1916600185901b1785556200099c565b600085815260208120601f198616915b8281101562000a415788860151825594840194600190910190840162000a20565b508582101562000a605787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60006020828403121562000a8357600080fd5b815180151581146200044957600080fd5b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835162000ace81601785016020880162000742565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835162000b0181602884016020880162000742565b01602801949350505050565b602081526000825180602084015262000b2e81604085016020870162000742565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176200044c576200044c62000b42565b808201808211156200044c576200044c62000b42565b634e487b7160e01b600052603260045260246000fd5b60008162000bb05762000bb062000b42565b506000190190565b6133ca8062000bc86000396000f3fe608060405234801561001057600080fd5b50600436106102735760003560e01c806369e2f0fb11610151578063a22cb465116100c3578063ca15c87311610087578063ca15c87314610590578063d5391393146105a3578063d547741f146105b8578063e4623c1b146105cb578063e8a3d485146105de578063e985e9c5146105e657600080fd5b8063a22cb46514610521578063a701281614610534578063b88d4fde14610547578063c720ee3e1461055a578063c87b56dd1461057d57600080fd5b80639010d07c116101155780639010d07c146104c557806391d14854146104d8578063938e3d7b146104eb57806395d89b41146104fe578063a144819414610506578063a217fddf1461051957600080fd5b806369e2f0fb146104715780636b3a0632146104845780636c0360eb1461049757806370a082311461049f578063885e7a08146104b257600080fd5b806331ae450b116101ea57806342842e0e116101ae57806342842e0e146103ff57806342966c6814610412578063439aed341461042557806355f804b3146104385780636352211e1461044b5780636588962a1461045e57600080fd5b806331ae450b146103a857806336568abe146103bd5780633dd1eb61146103d05780633eaaf86b146103e357806340c10f19146103ec57600080fd5b806318160ddd1161023c57806318160ddd14610308578063234af0461461031a57806323b872dd1461032d578063248a9ca3146103405780632a55205a146103635780632f2ff15d1461039557600080fd5b80628ad9461461027857806301ffc9a71461028d57806306fdde03146102b5578063081812fc146102ca578063095ea7b3146102f5575b600080fd5b61028b610286366004612800565b610622565b005b6102a061029b366004612850565b610752565b60405190151581526020015b60405180910390f35b6102bd610763565b6040516102ac91906128bd565b6102dd6102d83660046128d0565b6107f5565b6040516001600160a01b0390911681526020016102ac565b61028b610303366004612905565b61081c565b600d545b6040519081526020016102ac565b61028b6103283660046129c0565b610984565b61028b61033b366004612b11565b6109dc565b61030c61034e3660046128d0565b60009081526020819052604090206001015490565b610376610371366004612b4d565b610a0e565b604080516001600160a01b0390931683526020830191909152016102ac565b61028b6103a3366004612b6f565b610abc565b6103b0610ae1565b6040516102ac9190612b9b565b61028b6103cb366004612b6f565b610b8f565b61028b6103de366004612be8565b610c09565b61030c600d5481565b61028b6103fa366004612905565b610c2c565b61028b61040d366004612b11565b610c68565b61028b6104203660046128d0565b610c83565b61028b610433366004612c1a565b610cbb565b61028b610446366004612cad565b610ce4565b6102dd6104593660046128d0565b610cfb565b61028b61046c366004612be8565b610d5b565b61028b61047f366004612be8565b610ea1565b6002546102dd906001600160a01b031681565b6102bd610ec4565b61030c6104ad366004612be8565b610f52565b61028b6104c0366004612cf5565b610fd8565b6102dd6104d3366004612b4d565b610fed565b6102a06104e6366004612b6f565b61100c565b61028b6104f9366004612cad565b611035565b6102bd61104c565b61028b610514366004612905565b61105b565b61030c600081565b61028b61052f366004612d2d565b61108d565b61028b610542366004612da8565b6111f0565b61028b610555366004612e0c565b611250565b6102a06105683660046128d0565b600e6020526000908152604090205460ff1681565b6102bd61058b3660046128d0565b611282565b61030c61059e3660046128d0565b6112e8565b61030c6a4d494e5445525f524f4c4560a81b81565b61028b6105c6366004612b6f565b6112ff565b61028b6105d9366004612e87565b611324565b6102bd6113bd565b6102a06105f4366004612ec8565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205460ff1690565b61062f6020820182612ef2565b905061063e6040830183612ef2565b9050146106b85760405162461bcd60e51b815260206004820152603760248201527f6e756d626572206f6620746f6b656e20696473206e6f74207468652073616d6560448201527f206173206e756d626572206f662072656365697665727300000000000000000060648201526084015b60405180910390fd5b60005b6106c86040830183612ef2565b905081101561074e5761073c6106e16020840184612be8565b6106ee6020850185612ef2565b848181106106fe576106fe612f3b565b90506020020160208101906107139190612be8565b6107206040860186612ef2565b8581811061073057610730612f3b565b90506020020135610c68565b8061074681612f67565b9150506106bb565b5050565b600061075d82611610565b92915050565b60606003805461077290612f80565b80601f016020809104026020016040519081016040528092919081815260200182805461079e90612f80565b80156107eb5780601f106107c0576101008083540402835291602001916107eb565b820191906000526020600020905b8154815290600101906020018083116107ce57829003601f168201915b5050505050905090565b60006108008261161b565b506000908152600760205260409020546001600160a01b031690565b60025482906001600160a01b03161561097557333b158015906108a857506002546040516305a3b80960e01b81523360048201526001600160a01b03909116906305a3b80990602401602060405180830381865afa158015610882573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a69190612fba565b155b156108c85760405163f6fa4cbd60e01b81523360048201526024016106af565b6001600160a01b0381163b1580159061094c57506002546040516305a3b80960e01b81526001600160a01b038381166004830152909116906305a3b80990602401602060405180830381865afa158015610926573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094a9190612fba565b155b15610975576040516341b8d58160e11b81526001600160a01b03821660048201526024016106af565b61097f838361167d565b505050565b6a4d494e5445525f524f4c4560a81b61099c8161178d565b60005b825181101561097f576109ca8382815181106109bd576109bd612f3b565b6020026020010151611797565b806109d481612f67565b91505061099f565b6109e7335b82611847565b610a035760405162461bcd60e51b81526004016106af90612fd7565b61097f8383836118c6565b6000828152600a602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610a835750604080518082019091526009546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610aa2906001600160601b031687613024565b610aac919061303b565b91519350909150505b9250929050565b600082815260208190526040902060010154610ad78161178d565b61097f8383611ae0565b60606000610aee816112e8565b90506000816001600160401b03811115610b0a57610b0a61292f565b604051908082528060200260200182016040528015610b33578160200160208202803683370190505b50905060005b82811015610b8857610b4c600082610fed565b828281518110610b5e57610b5e612f3b565b6001600160a01b039092166020928302919091019091015280610b8081612f67565b915050610b39565b5092915050565b6001600160a01b0381163314610bff5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016106af565b61074e8282611b02565b6000610c148161178d565b61074e6a4d494e5445525f524f4c4560a81b83610abc565b6a4d494e5445525f524f4c4560a81b610c448161178d565b610c4e8383611b24565b600d8054906000610c5e83612f67565b9190505550505050565b61097f83838360405180602001604052806000815250611250565b610c8c81611b8d565b6000818152600e60205260408120805460ff19166001179055600d805491610cb38361305d565b919050555050565b6a4d494e5445525f524f4c4560a81b610cd38161178d565b610cde848484611bbb565b50505050565b6000610cef8161178d565b600c61097f83826130ba565b6000818152600560205260408120546001600160a01b03168061075d5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016106af565b6000610d668161178d565b6040516301ffc9a760e01b81526305a3b80960e01b60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa158015610db1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd59190612fba565b610e375760405162461bcd60e51b815260206004820152602d60248201527f636f6e747261637420646f6573206e6f7420696d706c656d656e742049526f7960448201526c185b1d1e505b1b1bdddb1a5cdd609a1b60648201526084016106af565b600254604080516001600160a01b03928316815291841660208301527f4a1d010d926ae0d4294a4afe61ae81bb378335fbf671e099a7138b5afeefdf84910160405180910390a150600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000610eac8161178d565b61074e6a4d494e5445525f524f4c4560a81b836112ff565b600c8054610ed190612f80565b80601f0160208091040260200160405190810160405280929190818152602001828054610efd90612f80565b8015610f4a5780601f10610f1f57610100808354040283529160200191610f4a565b820191906000526020600020905b815481529060010190602001808311610f2d57829003601f168201915b505050505081565b60006001600160a01b038216610fbc5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016106af565b506001600160a01b031660009081526006602052604090205490565b6000610fe38161178d565b61097f8383611c86565b60008281526001602052604081206110059083611d40565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60006110408161178d565b600b61097f83826130ba565b60606004805461077290612f80565b6a4d494e5445525f524f4c4560a81b6110738161178d565b610c4e838360405180602001604052806000815250611d4c565b60025482906001600160a01b0316156111e657333b1580159061111957506002546040516305a3b80960e01b81523360048201526001600160a01b03909116906305a3b80990602401602060405180830381865afa1580156110f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111179190612fba565b155b156111395760405163f6fa4cbd60e01b81523360048201526024016106af565b6001600160a01b0381163b158015906111bd57506002546040516305a3b80960e01b81526001600160a01b038381166004830152909116906305a3b80990602401602060405180830381865afa158015611197573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111bb9190612fba565b155b156111e6576040516341b8d58160e11b81526001600160a01b03821660048201526024016106af565b61097f8383611d7f565b6a4d494e5445525f524f4c4560a81b6112088161178d565b60005b848110156112485761123686868381811061122857611228612f3b565b905060200201358585611bbb565b8061124081612f67565b91505061120b565b505050505050565b61125a3383611847565b6112765760405162461bcd60e51b81526004016106af90612fd7565b610cde84848484611d8a565b606061128d8261161b565b6000611297611dbd565b905060008151116112b75760405180602001604052806000815250611005565b806112c184611dcc565b6040516020016112d2929190613179565b6040516020818303038152906040529392505050565b600081815260016020526040812061075d90611e5e565b60008281526020819052604090206001015461131a8161178d565b61097f8383611b02565b60005b818110156113a75761135083838381811061134457611344612f3b565b90506020020135611b8d565b6001600e600085858581811061136857611368612f3b565b90506020020135815260200190815260200160002060006101000a81548160ff021916908315150217905550808061139f90612f67565b915050611327565b50600d546113b69082906131a8565b600d555050565b600b8054610ed190612f80565b6113d4828261100c565b61074e576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561140a3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000611005836001600160a01b038416611e68565b606061075d6001600160a01b03831660145b60606000611484836002613024565b61148f9060026131bb565b6001600160401b038111156114a6576114a661292f565b6040519080825280601f01601f1916602001820160405280156114d0576020820181803683370190505b509050600360fc1b816000815181106114eb576114eb612f3b565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061151a5761151a612f3b565b60200101906001600160f81b031916908160001a905350600061153e846002613024565b6115499060016131bb565b90505b60018111156115c1576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061157d5761157d612f3b565b1a60f81b82828151811061159357611593612f3b565b60200101906001600160f81b031916908160001a90535060049490941c936115ba8161305d565b905061154c565b5083156110055760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016106af565b600061075d82611eb7565b6000818152600560205260409020546001600160a01b031661167a5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016106af565b50565b600061168882610cfb565b9050806001600160a01b0316836001600160a01b0316036116f55760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016106af565b336001600160a01b0382161480611711575061171181336105f4565b6117835760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c00000060648201526084016106af565b61097f8383611edc565b61167a8133611f4a565b80516001600160a01b03166117e05760405162461bcd60e51b815260206004820152600f60248201526e41646472657373206973207a65726f60881b60448201526064016106af565b60005b81602001515181101561182d5761181b82600001518360200151838151811061180e5761180e612f3b565b6020026020010151611b24565b8061182581612f67565b9150506117e3565b50806020015151600d5461184191906131bb565b600d5550565b60008061185383610cfb565b9050806001600160a01b0316846001600160a01b0316148061189a57506001600160a01b0380821660009081526008602090815260408083209388168352929052205460ff165b806118be5750836001600160a01b03166118b3846107f5565b6001600160a01b0316145b949350505050565b600254839083906001600160a01b031615611ace5733321480159061195457506002546040516305a3b80960e01b81523360048201526001600160a01b03909116906305a3b80990602401602060405180830381865afa15801561192e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119529190612fba565b155b156119745760405163937db65f60e01b81523360048201526024016106af565b6001600160a01b0382163b158015906119f857506002546040516305a3b80960e01b81526001600160a01b038481166004830152909116906305a3b80990602401602060405180830381865afa1580156119d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119f69190612fba565b155b15611a215760405163f934453160e01b81526001600160a01b03831660048201526024016106af565b6001600160a01b0381163b15801590611aa557506002546040516305a3b80960e01b81526001600160a01b038381166004830152909116906305a3b80990602401602060405180830381865afa158015611a7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aa39190612fba565b155b15611ace57604051632a67242160e11b81526001600160a01b03821660048201526024016106af565b611ad9858585611fa3565b5050505050565b611aea82826113ca565b600082815260016020526040902061097f908261144e565b611b0c8282612107565b600082815260016020526040902061097f908261216c565b6000818152600e602052604090205460ff1615611b835760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206275726e65640000000060448201526064016106af565b61074e8282612181565b611b96336109e1565b611bb25760405162461bcd60e51b81526004016106af90612fd7565b61167a8161230c565b6127106001600160601b0382161115611be65760405162461bcd60e51b81526004016106af906131ce565b6001600160a01b038216611c3c5760405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d6574657273000000000060448201526064016106af565b6040805180820182526001600160a01b0393841681526001600160601b0392831660208083019182526000968752600a90529190942093519051909116600160a01b029116179055565b6127106001600160601b0382161115611cb15760405162461bcd60e51b81526004016106af906131ce565b6001600160a01b038216611d075760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c69642072656365697665720000000000000060448201526064016106af565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600955565b600061100583836123a1565b611d568383611b24565b611d6360008484846123cb565b61097f5760405162461bcd60e51b81526004016106af90613218565b61074e3383836124cc565b611d958484846118c6565b611da1848484846123cb565b610cde5760405162461bcd60e51b81526004016106af90613218565b6060600c805461077290612f80565b60606000611dd98361259a565b60010190506000816001600160401b03811115611df857611df861292f565b6040519080825280601f01601f191660200182016040528015611e22576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084611e2c57509392505050565b600061075d825490565b6000818152600183016020526040812054611eaf5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561075d565b50600061075d565b60006001600160e01b0319821663152a902d60e11b148061075d575061075d82612672565b600081815260076020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611f1182610cfb565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b611f54828261100c565b61074e57611f6181611463565b611f6c836020611475565b604051602001611f7d92919061326a565b60408051601f198184030181529082905262461bcd60e51b82526106af916004016128bd565b826001600160a01b0316611fb682610cfb565b6001600160a01b031614611fdc5760405162461bcd60e51b81526004016106af906132df565b6001600160a01b03821661203e5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016106af565b826001600160a01b031661205182610cfb565b6001600160a01b0316146120775760405162461bcd60e51b81526004016106af906132df565b600081815260076020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260068552838620805460001901905590871680865283862080546001019055868652600590945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b612111828261100c565b1561074e576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000611005836001600160a01b0384166126b2565b6001600160a01b0382166121d75760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016106af565b6000818152600560205260409020546001600160a01b03161561223c5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016106af565b6000818152600560205260409020546001600160a01b0316156122a15760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016106af565b6001600160a01b038216600081815260066020908152604080832080546001019055848352600590915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600061231782610cfb565b905061232282610cfb565b600083815260076020908152604080832080546001600160a01b03199081169091556001600160a01b0385168085526006845282852080546000190190558785526005909352818420805490911690555192935084927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60008260000182815481106123b8576123b8612f3b565b9060005260206000200154905092915050565b60006001600160a01b0384163b156124c157604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061240f903390899088908890600401613324565b6020604051808303816000875af192505050801561244a575060408051601f3d908101601f1916820190925261244791810190613361565b60015b6124a7573d808015612478576040519150601f19603f3d011682016040523d82523d6000602084013e61247d565b606091505b50805160000361249f5760405162461bcd60e51b81526004016106af90613218565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506118be565b506001949350505050565b816001600160a01b0316836001600160a01b03160361252d5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016106af565b6001600160a01b03838116600081815260086020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106125d95772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612605576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061262357662386f26fc10000830492506010015b6305f5e100831061263b576305f5e100830492506008015b612710831061264f57612710830492506004015b60648310612661576064830492506002015b600a831061075d5760010192915050565b60006001600160e01b031982166380ac58cd60e01b14806126a357506001600160e01b03198216635b5e139f60e01b145b8061075d575061075d826127a5565b6000818152600183016020526040812054801561279b5760006126d66001836131a8565b85549091506000906126ea906001906131a8565b905081811461274f57600086600001828154811061270a5761270a612f3b565b906000526020600020015490508087600001848154811061272d5761272d612f3b565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806127605761276061337e565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061075d565b600091505061075d565b600061075d8260006001600160e01b03198216635a05180f60e01b148061075d575061075d8260006001600160e01b03198216637965db0b60e01b148061075d57506301ffc9a760e01b6001600160e01b031983161461075d565b60006020828403121561281257600080fd5b81356001600160401b0381111561282857600080fd5b82016060818503121561100557600080fd5b6001600160e01b03198116811461167a57600080fd5b60006020828403121561286257600080fd5b81356110058161283a565b60005b83811015612888578181015183820152602001612870565b50506000910152565b600081518084526128a981602086016020860161286d565b601f01601f19169290920160200192915050565b6020815260006110056020830184612891565b6000602082840312156128e257600080fd5b5035919050565b80356001600160a01b038116811461290057600080fd5b919050565b6000806040838503121561291857600080fd5b612921836128e9565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156129675761296761292f565b60405290565b604051601f8201601f191681016001600160401b03811182821017156129955761299561292f565b604052919050565b60006001600160401b038211156129b6576129b661292f565b5060051b60200190565b600060208083850312156129d357600080fd5b82356001600160401b03808211156129ea57600080fd5b818501915085601f8301126129fe57600080fd5b8135612a11612a0c8261299d565b61296d565b81815260059190911b83018401908481019088831115612a3057600080fd5b8585015b83811015612b0457803585811115612a4c5760008081fd5b86016040818c03601f1901811315612a645760008081fd5b612a6c612945565b612a778a84016128e9565b81528183013588811115612a8b5760008081fd5b8084019350508c603f840112612aa15760008081fd5b89830135612ab1612a0c8261299d565b81815260059190911b84018301908b8101908f831115612ad15760008081fd5b948401945b82861015612aef5785358252948c0194908c0190612ad6565b838d0152505085525050918601918601612a34565b5098975050505050505050565b600080600060608486031215612b2657600080fd5b612b2f846128e9565b9250612b3d602085016128e9565b9150604084013590509250925092565b60008060408385031215612b6057600080fd5b50508035926020909101359150565b60008060408385031215612b8257600080fd5b82359150612b92602084016128e9565b90509250929050565b6020808252825182820181905260009190848201906040850190845b81811015612bdc5783516001600160a01b031683529284019291840191600101612bb7565b50909695505050505050565b600060208284031215612bfa57600080fd5b611005826128e9565b80356001600160601b038116811461290057600080fd5b600080600060608486031215612c2f57600080fd5b83359250612c3f602085016128e9565b9150612c4d60408501612c03565b90509250925092565b60006001600160401b03831115612c6f57612c6f61292f565b612c82601f8401601f191660200161296d565b9050828152838383011115612c9657600080fd5b828260208301376000602084830101529392505050565b600060208284031215612cbf57600080fd5b81356001600160401b03811115612cd557600080fd5b8201601f81018413612ce657600080fd5b6118be84823560208401612c56565b60008060408385031215612d0857600080fd5b612d11836128e9565b9150612b9260208401612c03565b801515811461167a57600080fd5b60008060408385031215612d4057600080fd5b612d49836128e9565b91506020830135612d5981612d1f565b809150509250929050565b60008083601f840112612d7657600080fd5b5081356001600160401b03811115612d8d57600080fd5b6020830191508360208260051b8501011115610ab557600080fd5b60008060008060608587031215612dbe57600080fd5b84356001600160401b03811115612dd457600080fd5b612de087828801612d64565b9095509350612df39050602086016128e9565b9150612e0160408601612c03565b905092959194509250565b60008060008060808587031215612e2257600080fd5b612e2b856128e9565b9350612e39602086016128e9565b92506040850135915060608501356001600160401b03811115612e5b57600080fd5b8501601f81018713612e6c57600080fd5b612e7b87823560208401612c56565b91505092959194509250565b60008060208385031215612e9a57600080fd5b82356001600160401b03811115612eb057600080fd5b612ebc85828601612d64565b90969095509350505050565b60008060408385031215612edb57600080fd5b612ee4836128e9565b9150612b92602084016128e9565b6000808335601e19843603018112612f0957600080fd5b8301803591506001600160401b03821115612f2357600080fd5b6020019150600581901b3603821315610ab557600080fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201612f7957612f79612f51565b5060010190565b600181811c90821680612f9457607f821691505b602082108103612fb457634e487b7160e01b600052602260045260246000fd5b50919050565b600060208284031215612fcc57600080fd5b815161100581612d1f565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b808202811582820484141761075d5761075d612f51565b60008261305857634e487b7160e01b600052601260045260246000fd5b500490565b60008161306c5761306c612f51565b506000190190565b601f82111561097f57600081815260208120601f850160051c8101602086101561309b5750805b601f850160051c820191505b81811015611248578281556001016130a7565b81516001600160401b038111156130d3576130d361292f565b6130e7816130e18454612f80565b84613074565b602080601f83116001811461311c57600084156131045750858301515b600019600386901b1c1916600185901b178555611248565b600085815260208120601f198616915b8281101561314b5788860151825594840194600190910190840161312c565b50858210156131695787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000835161318b81846020880161286d565b83519083019061319f81836020880161286d565b01949350505050565b8181038181111561075d5761075d612f51565b8082018082111561075d5761075d612f51565b6020808252602a908201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646040820152692073616c65507269636560b01b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516132a281601785016020880161286d565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516132d381602884016020880161286d565b01602801949350505050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061335790830184612891565b9695505050505050565b60006020828403121561337357600080fd5b81516110058161283a565b634e487b7160e01b600052603160045260246000fdfea264697066735822122006573083b437fa58c9681635170d4942384661ed89edd9510c0e1a1d6b4237d564736f6c63430008110033";class C8 extends Vf{constructor(...e){e.length>1?super(...e):super(I8,x8,e[0])}deploy(e,t,n,r,i,a,o,s,u){return super.deploy(e,t,n,r,i,a,o,s,u||{})}getDeployTransaction(e,t,n,r,i,a,o,s,u){return super.getDeployTransaction(e,t,n,r,i,a,o,s,u||{})}attach(e){return super.attach(e)}connect(e){return super.connect(e)}static bytecode=x8;static abi=I8;static createInterface(){return new os(I8)}static connect(e,t){return new Hf(e,I8,t)}}var M8=Object.freeze({__proto__:null,ERC20:class{contract;constructor(e){const t=new R8;this.contract=t.attach(e)}async totalSupply(e,t={}){return this.contract.connect(e).totalSupply(t)}async balanceOf(e,t,n={}){return this.contract.connect(e).balanceOf(t,n)}async allowance(e,t,n,r={}){return this.contract.connect(e).allowance(t,n,r)}async populateTransfer(e,t,n){return this.contract.populateTransaction.transfer(e,t,n)}async populateApprove(e,t,n={}){return this.contract.populateTransaction.approve(e,t,n)}async populateTransferFrom(e,t,n,r={}){return this.contract.populateTransaction.transferFrom(e,t,n,r)}}});var N8=Object.freeze({__proto__:null,ERC721HybridPermissionedMintable:class{contract;constructor(e){const t=new O8;this.contract=t.attach(e)}async DEFAULT_ADMIN_ROLE(e,t={}){return await this.contract.connect(e).DEFAULT_ADMIN_ROLE(t)}async MINTER_ROLE(e,t={}){return await this.contract.connect(e).MINTER_ROLE(t)}async balanceOf(e,t,n={}){return await this.contract.connect(e).balanceOf(t,n)}async baseURI(e,t={}){return await this.contract.connect(e).baseURI(t)}async contractURI(e,t={}){return await this.contract.connect(e).contractURI(t)}async getAdmins(e,t={}){return await this.contract.connect(e).getAdmins(t)}async getApproved(e,t,n={}){return await this.contract.connect(e).getApproved(t,n)}async getRoleAdmin(e,t,n={}){return await this.contract.connect(e).getRoleAdmin(t,n)}async getRoleMember(e,t,n,r={}){return await this.contract.connect(e).getRoleMember(t,n,r)}async getRoleMemberCount(e,t,n={}){return await this.contract.connect(e).getRoleMemberCount(t,n)}async hasRole(e,t,n,r={}){return await this.contract.connect(e).hasRole(t,n,r)}async isApprovedForAll(e,t,n,r={}){return await this.contract.connect(e).isApprovedForAll(t,n,r)}async name(e,t={}){return await this.contract.connect(e).name(t)}async ownerOf(e,t,n={}){return await this.contract.connect(e).ownerOf(t,n)}async royaltyAllowlist(e,t={}){return await this.contract.connect(e).royaltyAllowlist(t)}async royaltyInfo(e,t,n,r={}){return await this.contract.connect(e).royaltyInfo(t,n,r)}async symbol(e,t={}){return await this.contract.connect(e).symbol(t)}async tokenURI(e,t,n={}){return await this.contract.connect(e).tokenURI(t,n)}async totalSupply(e,t={}){return await this.contract.connect(e).totalSupply(t)}async populateApprove(e,t,n={}){return await this.contract.populateTransaction.approve(e,t,n)}async populateBurn(e,t={}){return await this.contract.populateTransaction.burn(e,t)}async populateBurnBatch(e,t={}){return await this.contract.populateTransaction.burnBatch(e,t)}async populateGrantMinterRole(e,t={}){return await this.contract.populateTransaction.grantMinterRole(e,t)}async populateGrantRole(e,t,n={}){return await this.contract.populateTransaction.grantRole(e,t,n)}async populateMintByID(e,t,n={}){return await this.contract.populateTransaction.mintByID(e,t,n)}async populateSafeMintByID(e,t,n={}){return await this.contract.populateTransaction.safeMintByID(e,t,n)}async populateMintByQuantity(e,t,n={}){return await this.contract.populateTransaction.mintByQuantity(e,t,n)}async populateSafeMintByQuantity(e,t,n={}){return await this.contract.populateTransaction.safeMintByQuantity(e,t,n)}async populateBatchMintByQuantity(e,t={}){return await this.contract.populateTransaction.batchMintByQuantity(e,t)}async populateBatchSafeMintByQuantity(e,t={}){return await this.contract.populateTransaction.batchSafeMintByQuantity(e,t)}async populateBatchMintByIDToMultiple(e,t={}){return await this.contract.populateTransaction.batchMintByIDToMultiple(e,t)}async populateBatchSafeMintByIDToMultiple(e,t={}){return await this.contract.populateTransaction.batchSafeMintByIDToMultiple(e,t)}async populateRenounceRole(e,t,n={}){return await this.contract.populateTransaction.renounceRole(e,t,n)}async populateRevokeMinterRole(e,t={}){return await this.contract.populateTransaction.revokeMinterRole(e,t)}async populateRevokeRole(e,t,n={}){return await this.contract.populateTransaction.revokeRole(e,t,n)}async populateSafeTransferFromBatch(e,t={}){return await this.contract.populateTransaction.safeTransferFromBatch(e,t)}async"populateSafeTransferFrom(address,address,uint256)"(e,t,n,r={}){return await this.contract.populateTransaction["safeTransferFrom(address,address,uint256)"](e,t,n,r)}async"populateSafeTransferFrom(address,address,uint256,bytes)"(e,t,n,r,i={}){return await this.contract.populateTransaction["safeTransferFrom(address,address,uint256,bytes)"](e,t,n,r,i)}async populateSetApprovalForAll(e,t,n={}){return await this.contract.populateTransaction.setApprovalForAll(e,t,n)}async populateSetBaseURI(e,t={}){return await this.contract.populateTransaction.setBaseURI(e,t)}async populateSetContractURI(e,t={}){return await this.contract.populateTransaction.setContractURI(e,t)}async populateSetDefaultRoyaltyReceiver(e,t,n={}){return await this.contract.populateTransaction.setDefaultRoyaltyReceiver(e,t,n)}async populateSetNFTRoyaltyReceiver(e,t,n,r={}){return await this.contract.populateTransaction.setNFTRoyaltyReceiver(e,t,n,r)}async populateSetNFTRoyaltyReceiverBatch(e,t,n,r={}){return await this.contract.populateTransaction.setNFTRoyaltyReceiverBatch(e,t,n,r)}async populateSetRoyaltyAllowlistRegistry(e,t={}){return await this.contract.populateTransaction.setRoyaltyAllowlistRegistry(e,t)}}});var P8=Object.freeze({__proto__:null,ERC721PermissionedMintable:class{contract;constructor(e){const t=new C8;this.contract=t.attach(e)}async DEFAULT_ADMIN_ROLE(e,t={}){return await this.contract.connect(e).DEFAULT_ADMIN_ROLE(t)}async MINTER_ROLE(e,t={}){return await this.contract.connect(e).MINTER_ROLE(t)}async balanceOf(e,t,n={}){return await this.contract.connect(e).balanceOf(t,n)}async baseURI(e,t={}){return await this.contract.connect(e).baseURI(t)}async contractURI(e,t={}){return await this.contract.connect(e).contractURI(t)}async getAdmins(e,t={}){return await this.contract.connect(e).getAdmins(t)}async getApproved(e,t,n={}){return await this.contract.connect(e).getApproved(t,n)}async getRoleAdmin(e,t,n={}){return await this.contract.connect(e).getRoleAdmin(t,n)}async getRoleMember(e,t,n,r={}){return await this.contract.connect(e).getRoleMember(t,n,r)}async getRoleMemberCount(e,t,n={}){return await this.contract.connect(e).getRoleMemberCount(t,n)}async hasRole(e,t,n,r={}){return await this.contract.connect(e).hasRole(t,n,r)}async isApprovedForAll(e,t,n,r={}){return await this.contract.connect(e).isApprovedForAll(t,n,r)}async name(e,t={}){return await this.contract.connect(e).name(t)}async ownerOf(e,t,n={}){return await this.contract.connect(e).ownerOf(t,n)}async royaltyAllowlist(e,t={}){return await this.contract.connect(e).royaltyAllowlist(t)}async royaltyInfo(e,t,n,r={}){return await this.contract.connect(e).royaltyInfo(t,n,r)}async symbol(e,t={}){return await this.contract.connect(e).symbol(t)}async tokenURI(e,t,n={}){return await this.contract.connect(e).tokenURI(t,n)}async totalSupply(e,t={}){return await this.contract.connect(e).totalSupply(t)}async populateApprove(e,t,n={}){return await this.contract.populateTransaction.approve(e,t,n)}async populateBurn(e,t={}){return await this.contract.populateTransaction.burn(e,t)}async populateBurnBatch(e,t={}){return await this.contract.populateTransaction.burnBatch(e,t)}async populateGrantMinterRole(e,t={}){return await this.contract.populateTransaction.grantMinterRole(e,t)}async populateGrantRole(e,t,n={}){return await this.contract.populateTransaction.grantRole(e,t,n)}async populateMint(e,t,n={}){return await this.contract.populateTransaction.mint(e,t,n)}async populateSafeMintBatch(e,t={}){return await this.contract.populateTransaction.safeMintBatch(e,t)}async populateRenounceRole(e,t,n={}){return await this.contract.populateTransaction.renounceRole(e,t,n)}async populateRevokeMinterRole(e,t={}){return await this.contract.populateTransaction.revokeMinterRole(e,t)}async populateRevokeRole(e,t,n={}){return await this.contract.populateTransaction.revokeRole(e,t,n)}async populateSafeTransferFromBatch(e,t={}){return await this.contract.populateTransaction.safeTransferFromBatch(e,t)}async"populateSafeTransferFrom(address,address,uint256)"(e,t,n,r={}){return await this.contract.populateTransaction["safeTransferFrom(address,address,uint256)"](e,t,n,r)}async"populateSafeTransferFrom(address,address,uint256,bytes)"(e,t,n,r,i={}){return await this.contract.populateTransaction["safeTransferFrom(address,address,uint256,bytes)"](e,t,n,r,i)}async populateSetApprovalForAll(e,t,n={}){return await this.contract.populateTransaction.setApprovalForAll(e,t,n)}async populateSetBaseURI(e,t={}){return await this.contract.populateTransaction.setBaseURI(e,t)}async populateSetContractURI(e,t={}){return await this.contract.populateTransaction.setContractURI(e,t)}async populateSetDefaultRoyaltyReceiver(e,t,n={}){return await this.contract.populateTransaction.setDefaultRoyaltyReceiver(e,t,n)}async populateSetNFTRoyaltyReceiver(e,t,n,r={}){return await this.contract.populateTransaction.setNFTRoyaltyReceiver(e,t,n,r)}async populateSetNFTRoyaltyReceiverBatch(e,t,n,r={}){return await this.contract.populateTransaction.setNFTRoyaltyReceiverBatch(e,t,n,r)}async populateSetRoyaltyAllowlistRegistry(e,t={}){return await this.contract.populateTransaction.setRoyaltyAllowlistRegistry(e,t)}}});e.blockchainData=It,e.checkoutSdk=U2,e.checkoutWidgets=E8,e.config=r,e.erc20=M8,e.erc721HybridPermissionedMintable=N8,e.erc721PermissionedMintable=P8,e.immutablexClient=IP,e.orderbook=NK,e.passport=Vq,e.provider=hW}));
|
|
84
|
+
*/"production"===process.env.NODE_ENV?j2.exports=function(){if(K2)return q2;K2=1;var e=W2,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function o(e,n,o){var s,u={},c=null,f=null;for(s in void 0!==o&&(c=""+o),void 0!==n.key&&(c=""+n.key),void 0!==n.ref&&(f=n.ref),n)r.call(n,s)&&!a.hasOwnProperty(s)&&(u[s]=n[s]);if(e&&e.defaultProps)for(s in n=e.defaultProps)void 0===u[s]&&(u[s]=n[s]);return{$$typeof:t,type:e,key:c,ref:f,props:u,_owner:i.current}}return q2.Fragment=n,q2.jsx=o,q2.jsxs=o,q2}():j2.exports=(X2||(X2=1,"production"!==process.env.NODE_ENV&&function(){var e=W2,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),l=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),h=Symbol.iterator,b="@@iterator",m=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function y(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];!function(e,t,n){var r=m.ReactDebugCurrentFrame.getStackAddendum();""!==r&&(t+="%s",n=n.concat([r]));var i=n.map((function(e){return String(e)}));i.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,i)}("error",e,n)}var g,v=!1,w=!1,_=!1,E=!1,T=!1;function A(e){return e.displayName||"Context"}function R(e){if(null==e)return null;if("number"==typeof e.tag&&y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case r:return"Fragment";case n:return"Portal";case a:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case f:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case s:return A(e)+".Consumer";case o:return A(e._context)+".Provider";case u:return function(e,t,n){var r=e.displayName;if(r)return r;var i=t.displayName||t.name||"";return""!==i?n+"("+i+")":n}(e,e.render,"ForwardRef");case d:var t=e.displayName||null;return null!==t?t:R(e.type)||"Memo";case l:var p=e,h=p._payload,b=p._init;try{return R(b(h))}catch(e){return null}}return null}g=Symbol.for("react.module.reference");var S,k,O,I,x,C,M,N=Object.assign,P=0;function B(){}B.__reactDisabledLog=!0;var D,F=m.ReactCurrentDispatcher;function L(e,t,n){if(void 0===D)try{throw Error()}catch(e){var r=e.stack.trim().match(/\n( *(at )?)/);D=r&&r[1]||""}return"\n"+D+e}var U,j=!1,q="function"==typeof WeakMap?WeakMap:Map;function z(e,t){if(!e||j)return"";var n,r=U.get(e);if(void 0!==r)return r;j=!0;var i,a=Error.prepareStackTrace;Error.prepareStackTrace=void 0,i=F.current,F.current=null,function(){if(0===P){S=console.log,k=console.info,O=console.warn,I=console.error,x=console.group,C=console.groupCollapsed,M=console.groupEnd;var e={configurable:!0,enumerable:!0,value:B,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}P++}();try{if(t){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(o,[])}catch(e){n=e}Reflect.construct(e,[],o)}else{try{o.call()}catch(e){n=e}e.call(o.prototype)}}else{try{throw Error()}catch(e){n=e}e()}}catch(t){if(t&&n&&"string"==typeof t.stack){for(var s=t.stack.split("\n"),u=n.stack.split("\n"),c=s.length-1,f=u.length-1;c>=1&&f>=0&&s[c]!==u[f];)f--;for(;c>=1&&f>=0;c--,f--)if(s[c]!==u[f]){if(1!==c||1!==f)do{if(c--,--f<0||s[c]!==u[f]){var d="\n"+s[c].replace(" at new "," at ");return e.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",e.displayName)),"function"==typeof e&&U.set(e,d),d}}while(c>=1&&f>=0);break}}}finally{j=!1,F.current=i,function(){if(0==--P){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:N({},e,{value:S}),info:N({},e,{value:k}),warn:N({},e,{value:O}),error:N({},e,{value:I}),group:N({},e,{value:x}),groupCollapsed:N({},e,{value:C}),groupEnd:N({},e,{value:M})})}P<0&&y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=a}var l=e?e.displayName||e.name:"",p=l?L(l):"";return"function"==typeof e&&U.set(e,p),p}function H(e,t,n){if(null==e)return"";if("function"==typeof e)return z(e,function(e){var t=e.prototype;return!(!t||!t.isReactComponent)}(e));if("string"==typeof e)return L(e);switch(e){case c:return L("Suspense");case f:return L("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case u:return function(e,t,n){return z(e,!1)}(e.render);case d:return H(e.type,t,n);case l:var r=e,i=r._payload,a=r._init;try{return H(a(i),t,n)}catch(e){}}return""}U=new q;var V=Object.prototype.hasOwnProperty,G={},K=m.ReactDebugCurrentFrame;function W(e){if(e){var t=e._owner,n=H(e.type,e._source,t?t.type:null);K.setExtraStackFrame(n)}else K.setExtraStackFrame(null)}var X=Array.isArray;function $(e){return X(e)}function J(e){return""+e}function Y(e){if(function(e){try{return J(e),!1}catch(e){return!0}}(e))return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),J(e)}var Q,Z,ee,te=m.ReactCurrentOwner,ne={key:!0,ref:!0,__self:!0,__source:!0};ee={};var re=function(e,n,r,i,a,o,s){var u={$$typeof:t,type:e,key:n,ref:r,props:s,_owner:o,_store:{}};return Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(u,"_self",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.defineProperty(u,"_source",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u};function ie(e,t,n,r,i){var a,o={},s=null,u=null;for(a in void 0!==n&&(Y(n),s=""+n),function(e){if(V.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(t)&&(Y(t.key),s=""+t.key),function(e){if(V.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(t)&&(u=t.ref,function(e,t){if("string"==typeof e.ref&&te.current&&t&&te.current.stateNode!==t){var n=R(te.current.type);ee[n]||(y('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',R(te.current.type),e.ref),ee[n]=!0)}}(t,i)),t)V.call(t,a)&&!ne.hasOwnProperty(a)&&(o[a]=t[a]);if(e&&e.defaultProps){var c=e.defaultProps;for(a in c)void 0===o[a]&&(o[a]=c[a])}if(s||u){var f="function"==typeof e?e.displayName||e.name||"Unknown":e;s&&function(e,t){var n=function(){Q||(Q=!0,y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(o,f),u&&function(e,t){var n=function(){Z||(Z=!0,y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}(o,f)}return re(e,s,u,i,r,te.current,o)}var ae,oe=m.ReactCurrentOwner,se=m.ReactDebugCurrentFrame;function ue(e){if(e){var t=e._owner,n=H(e.type,e._source,t?t.type:null);se.setExtraStackFrame(n)}else se.setExtraStackFrame(null)}function ce(e){return"object"==typeof e&&null!==e&&e.$$typeof===t}function fe(){if(oe.current){var e=R(oe.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}ae=!1;var de={};function le(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=fe();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!de[n]){de[n]=!0;var r="";e&&e._owner&&e._owner!==oe.current&&(r=" It was passed a child from "+R(e._owner.type)+"."),ue(e),y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,r),ue(null)}}}function pe(e,t){if("object"==typeof e)if($(e))for(var n=0;n<e.length;n++){var r=e[n];ce(r)&&le(r,t)}else if(ce(e))e._store&&(e._store.validated=!0);else if(e){var i=function(e){if(null===e||"object"!=typeof e)return null;var t=h&&e[h]||e[b];return"function"==typeof t?t:null}(e);if("function"==typeof i&&i!==e.entries)for(var a,o=i.call(e);!(a=o.next()).done;)ce(a.value)&&le(a.value,t)}}function he(e){var t,n=e.type;if(null!=n&&"string"!=typeof n){if("function"==typeof n)t=n.propTypes;else{if("object"!=typeof n||n.$$typeof!==u&&n.$$typeof!==d)return;t=n.propTypes}if(t){var r=R(n);!function(e,t,n,r,i){var a=Function.call.bind(V);for(var o in e)if(a(e,o)){var s=void 0;try{if("function"!=typeof e[o]){var u=Error((r||"React class")+": "+n+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}s=e[o](t,o,r,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){s=e}!s||s instanceof Error||(W(i),y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",r||"React class",n,o,typeof s),W(null)),s instanceof Error&&!(s.message in G)&&(G[s.message]=!0,W(i),y("Failed %s type: %s",n,s.message),W(null))}}(t,e.props,"prop",r,e)}else void 0===n.PropTypes||ae||(ae=!0,y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",R(n)||"Unknown"));"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function be(e,n,h,b,m,A){var S=function(e){return"string"==typeof e||"function"==typeof e||!!(e===r||e===a||T||e===i||e===c||e===f||E||e===p||v||w||_)||"object"==typeof e&&null!==e&&(e.$$typeof===l||e.$$typeof===d||e.$$typeof===o||e.$$typeof===s||e.$$typeof===u||e.$$typeof===g||void 0!==e.getModuleId)}(e);if(!S){var k="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(k+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var O,I=function(e){return void 0!==e?"\n\nCheck your code at "+e.fileName.replace(/^.*[\\\/]/,"")+":"+e.lineNumber+".":""}(m);k+=I||fe(),null===e?O="null":$(e)?O="array":void 0!==e&&e.$$typeof===t?(O="<"+(R(e.type)||"Unknown")+" />",k=" Did you accidentally export a JSX literal instead of a component?"):O=typeof e,y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",O,k)}var x=ie(e,n,h,m,A);if(null==x)return x;if(S){var C=n.children;if(void 0!==C)if(b)if($(C)){for(var M=0;M<C.length;M++)pe(C[M],e);Object.freeze&&Object.freeze(C)}else y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else pe(C,e)}return e===r?function(e){for(var t=Object.keys(e.props),n=0;n<t.length;n++){var r=t[n];if("children"!==r&&"key"!==r){ue(e),y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r),ue(null);break}}null!==e.ref&&(ue(e),y("Invalid attribute `ref` supplied to `React.Fragment`."),ue(null))}(x):he(x),x}var me=function(e,t,n){return be(e,t,n,!1)},ye=function(e,t,n){return be(e,t,n,!0)};$2.Fragment=r,$2.jsx=me,$2.jsxs=ye}()),$2);var J2=j2.exports;function Y2(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}const Q2=()=>"0.13.1-alpha";var Z2,e8;Y2({},"IMTBLWidgetEvents",(()=>Z2)),(e8=Z2||(Z2={})).IMTBL_CONNECT_WIDGET_EVENT="imtbl-connect-widget",e8.IMTBL_WALLET_WIDGET_EVENT="imtbl-wallet-widget",e8.IMTBL_SWAP_WIDGET_EVENT="imtbl-swap-widget",e8.IMTBL_BRIDGE_WIDGET_EVENT="imtbl-bridge-widget";var t8,n8;Y2({},"ConnectEventType",(()=>t8)),(n8=t8||(t8={})).CLOSE_WIDGET="close-widget",n8.SUCCESS="success",n8.FAILURE="failure";var r8,i8;Y2({},"WalletEventType",(()=>r8)),(i8=r8||(r8={})).CLOSE_WIDGET="close-widget",i8.NETWORK_SWITCH="network-switch",i8.DISCONNECT_WALLET="disconnect-wallet";var a8,o8;Y2({},"SwapEventType",(()=>a8)),(o8=a8||(a8={})).CLOSE_WIDGET="close-widget",o8.SUCCESS="success",o8.FAILURE="failure",o8.REJECTED="rejected";var s8,u8;Y2({},"BridgeEventType",(()=>s8)),(u8=s8||(s8={})).CLOSE_WIDGET="close-widget",u8.SUCCESS="success",u8.FAILURE="failure";var c8,f8;Y2({},"OrchestrationEventType",(()=>c8)),(f8=c8||(c8={})).REQUEST_CONNECT="request-connect",f8.REQUEST_WALLET="request-wallet",f8.REQUEST_SWAP="request-swap",f8.REQUEST_BRIDGE="request-bridge",f8.REQUEST_ONRAMP="request-onramp";var d8,l8,p8,h8,b8={};Y2(b8,"WidgetTheme",(()=>d8)),Y2(b8,"CheckoutWidgetTagNames",(()=>p8)),(l8=d8||(d8={})).LIGHT="light",l8.DARK="dark",l8.CUSTOM="custom",(h8=p8||(p8={})).CONNECT="imtbl-connect",h8.WALLET="imtbl-wallet",h8.SWAP="imtbl-swap",h8.BRIDGE="imtbl-bridge";function m8(e,t){if(!t)return void console.error("no provider parsed");if(void 0===window)return void console.error("missing window object: please run Checkout client side");let n=0;let r;const i=()=>{try{const n=document.getElementsByTagName(e);n[0].setProvider(t),window.clearInterval(r)}catch(e){n++,n>=10&&(window.clearInterval(r),console.error("failed to set the provider"))}};r=window.setInterval(i,10),i()}function y8(e,t){if(!t)return void console.error("no passport provided");if(void 0===window)return void console.error("missing window object: please run Checkout client side");let n=0;let r;const i=()=>{try{const n=document.getElementsByTagName(e);n[0].addPassportOption(t),window.clearInterval(r)}catch(e){n++,n>=10&&(window.clearInterval(r),console.error("failed to set the provider"))}};r=window.setInterval(i,10),i()}function g8(e){const{walletProvider:t,fromContractAddress:n,amount:r,provider:i,passport:a}=e;W2.useEffect((()=>{i&&m8(p8.BRIDGE,i),a&&y8(p8.BRIDGE,a)}),[i,a]);const o=window.ImtblCheckoutWidgetConfig;return J2.jsx("imtbl-bridge",{widgetConfig:o,walletProvider:t,fromContractAddress:n??"",amount:r??""})}Y2({},"BridgeReact",(()=>g8));function v8({passport:e}){const t=window.ImtblCheckoutWidgetConfig;return W2.useEffect((()=>{e&&y8(p8.CONNECT,e)}),[e]),J2.jsx("imtbl-connect",{widgetConfig:t})}Y2({},"ConnectReact",(()=>v8));function w8(e){const{walletProvider:t,fromContractAddress:n,amount:r,toContractAddress:i,provider:a,passport:o}=e;W2.useEffect((()=>{a&&m8(p8.SWAP,a),o&&y8(p8.SWAP,o)}),[a,o]);const s=window.ImtblCheckoutWidgetConfig;return J2.jsx("imtbl-swap",{widgetConfig:s,walletProvider:t,fromContractAddress:n??"",toContractAddress:i??"",amount:r??""})}Y2({},"SwapReact",(()=>w8));function _8(e){const{walletProvider:t,provider:n,passport:r}=e;W2.useEffect((()=>{n&&m8(p8.WALLET,n),r&&y8(p8.WALLET,r)}),[n,r]);const i=window.ImtblCheckoutWidgetConfig;return J2.jsx("imtbl-wallet",{widgetConfig:i,walletProvider:t})}Y2({},"WalletReact",(()=>_8));var E8=Object.freeze({__proto__:null,get BridgeEventType(){return s8},BridgeReact:g8,get CheckoutWidgetTagNames(){return p8},CheckoutWidgets:function(e){if(void 0===window)return void console.error("missing window object: please run Checkout client side");if(void 0===document)return void console.error("missing document object: please run Checkout client side");const t=document.createElement("script"),n=function(e){const t=Q2();if(void 0===e)return t;if(void 0===e.major||void 0===e.minor||void 0===e.patch||void 0===e.prerelease)return t;if(e.major<0)return t;if(e.minor<0)return t;if(e.patch<0)return t;if("alpha"!==e.prerelease)return t;if(0===e.major&&0===e.minor&&0===e.patch)return t;let n=t;return!Number.isNaN(e.major)&&e.major>=0&&(n=e.major.toString()),Number.isNaN(e.minor)||(n+=`.${e.minor.toString()}`),Number.isNaN(e.patch)||(n+=`.${e.patch.toString()}`),n+=`-${e.prerelease}`,void 0!==e.build&&e.build>0&&(n+=`.${e.build}`),n}(e?.version);let r=`https://cdn.jsdelivr.net/npm/@imtbl/sdk@${n}/dist/browser/checkout.js`;t.setAttribute("src",r),document.head.appendChild(t),window.ImtblCheckoutWidgetConfig=JSON.stringify(e)},get ConnectEventType(){return t8},ConnectReact:v8,get IMTBLWidgetEvents(){return Z2},get OrchestrationEventType(){return c8},get SwapEventType(){return a8},SwapReact:w8,UpdateConfig:function(e){void 0!==window?window.ImtblCheckoutWidgetConfig=JSON.stringify(e):console.error("missing document object: please run Checkout client side")},get WalletEventType(){return r8},WalletReact:_8,get WidgetTheme(){return d8}});const T8=[{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}],A8="0x60806040523480156200001157600080fd5b50604051620017ec380380620017ec8339818101604052810190620000379190620001f6565b8160039081620000489190620004c6565b5080600490816200005a9190620004c6565b505050620005ad565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b620000cc8262000081565b810181811067ffffffffffffffff82111715620000ee57620000ed62000092565b5b80604052505050565b60006200010362000063565b9050620001118282620000c1565b919050565b600067ffffffffffffffff82111562000134576200013362000092565b5b6200013f8262000081565b9050602081019050919050565b60005b838110156200016c5780820151818401526020810190506200014f565b60008484015250505050565b60006200018f620001898462000116565b620000f7565b905082815260208101848484011115620001ae57620001ad6200007c565b5b620001bb8482856200014c565b509392505050565b600082601f830112620001db57620001da62000077565b5b8151620001ed84826020860162000178565b91505092915050565b6000806040838503121562000210576200020f6200006d565b5b600083015167ffffffffffffffff81111562000231576200023062000072565b5b6200023f85828601620001c3565b925050602083015167ffffffffffffffff81111562000263576200026262000072565b5b6200027185828601620001c3565b9150509250929050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620002ce57607f821691505b602082108103620002e457620002e362000286565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026200034e7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826200030f565b6200035a86836200030f565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620003a7620003a16200039b8462000372565b6200037c565b62000372565b9050919050565b6000819050919050565b620003c38362000386565b620003db620003d282620003ae565b8484546200031c565b825550505050565b600090565b620003f2620003e3565b620003ff818484620003b8565b505050565b5b8181101562000427576200041b600082620003e8565b60018101905062000405565b5050565b601f82111562000476576200044081620002ea565b6200044b84620002ff565b810160208510156200045b578190505b620004736200046a85620002ff565b83018262000404565b50505b505050565b600082821c905092915050565b60006200049b600019846008026200047b565b1980831691505092915050565b6000620004b6838362000488565b9150826002028217905092915050565b620004d1826200027b565b67ffffffffffffffff811115620004ed57620004ec62000092565b5b620004f98254620002b5565b620005068282856200042b565b600060209050601f8311600181146200053e576000841562000529578287015190505b620005358582620004a8565b865550620005a5565b601f1984166200054e86620002ea565b60005b82811015620005785784890151825560018201915060208501945060208101905062000551565b8683101562000598578489015162000594601f89168262000488565b8355505b6001600288020188555050505b505050505050565b61122f80620005bd6000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461016857806370a082311461019857806395d89b41146101c8578063a457c2d7146101e6578063a9059cbb14610216578063dd62ed3e14610246576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100fc57806323b872dd1461011a578063313ce5671461014a575b600080fd5b6100b6610276565b6040516100c39190610b0c565b60405180910390f35b6100e660048036038101906100e19190610bc7565b610308565b6040516100f39190610c22565b60405180910390f35b61010461032b565b6040516101119190610c4c565b60405180910390f35b610134600480360381019061012f9190610c67565b610335565b6040516101419190610c22565b60405180910390f35b610152610364565b60405161015f9190610cd6565b60405180910390f35b610182600480360381019061017d9190610bc7565b61036d565b60405161018f9190610c22565b60405180910390f35b6101b260048036038101906101ad9190610cf1565b6103a4565b6040516101bf9190610c4c565b60405180910390f35b6101d06103ec565b6040516101dd9190610b0c565b60405180910390f35b61020060048036038101906101fb9190610bc7565b61047e565b60405161020d9190610c22565b60405180910390f35b610230600480360381019061022b9190610bc7565b6104f5565b60405161023d9190610c22565b60405180910390f35b610260600480360381019061025b9190610d1e565b610518565b60405161026d9190610c4c565b60405180910390f35b60606003805461028590610d8d565b80601f01602080910402602001604051908101604052809291908181526020018280546102b190610d8d565b80156102fe5780601f106102d3576101008083540402835291602001916102fe565b820191906000526020600020905b8154815290600101906020018083116102e157829003601f168201915b5050505050905090565b60008061031361059f565b90506103208185856105a7565b600191505092915050565b6000600254905090565b60008061034061059f565b905061034d858285610770565b6103588585856107fc565b60019150509392505050565b60006012905090565b60008061037861059f565b905061039981858561038a8589610518565b6103949190610ded565b6105a7565b600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6060600480546103fb90610d8d565b80601f016020809104026020016040519081016040528092919081815260200182805461042790610d8d565b80156104745780601f1061044957610100808354040283529160200191610474565b820191906000526020600020905b81548152906001019060200180831161045757829003601f168201915b5050505050905090565b60008061048961059f565b905060006104978286610518565b9050838110156104dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d390610e93565b60405180910390fd5b6104e982868684036105a7565b60019250505092915050565b60008061050061059f565b905061050d8185856107fc565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610616576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060d90610f25565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610685576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067c90610fb7565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516107639190610c4c565b60405180910390a3505050565b600061077c8484610518565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146107f657818110156107e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107df90611023565b60405180910390fd5b6107f584848484036105a7565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361086b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610862906110b5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036108da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d190611147565b60405180910390fd5b6108e5838383610a72565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561096b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610962906111d9565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a599190610c4c565b60405180910390a3610a6c848484610a77565b50505050565b505050565b505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610ab6578082015181840152602081019050610a9b565b60008484015250505050565b6000601f19601f8301169050919050565b6000610ade82610a7c565b610ae88185610a87565b9350610af8818560208601610a98565b610b0181610ac2565b840191505092915050565b60006020820190508181036000830152610b268184610ad3565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610b5e82610b33565b9050919050565b610b6e81610b53565b8114610b7957600080fd5b50565b600081359050610b8b81610b65565b92915050565b6000819050919050565b610ba481610b91565b8114610baf57600080fd5b50565b600081359050610bc181610b9b565b92915050565b60008060408385031215610bde57610bdd610b2e565b5b6000610bec85828601610b7c565b9250506020610bfd85828601610bb2565b9150509250929050565b60008115159050919050565b610c1c81610c07565b82525050565b6000602082019050610c376000830184610c13565b92915050565b610c4681610b91565b82525050565b6000602082019050610c616000830184610c3d565b92915050565b600080600060608486031215610c8057610c7f610b2e565b5b6000610c8e86828701610b7c565b9350506020610c9f86828701610b7c565b9250506040610cb086828701610bb2565b9150509250925092565b600060ff82169050919050565b610cd081610cba565b82525050565b6000602082019050610ceb6000830184610cc7565b92915050565b600060208284031215610d0757610d06610b2e565b5b6000610d1584828501610b7c565b91505092915050565b60008060408385031215610d3557610d34610b2e565b5b6000610d4385828601610b7c565b9250506020610d5485828601610b7c565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680610da557607f821691505b602082108103610db857610db7610d5e565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610df882610b91565b9150610e0383610b91565b9250828201905080821115610e1b57610e1a610dbe565b5b92915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000610e7d602583610a87565b9150610e8882610e21565b604082019050919050565b60006020820190508181036000830152610eac81610e70565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000610f0f602483610a87565b9150610f1a82610eb3565b604082019050919050565b60006020820190508181036000830152610f3e81610f02565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000610fa1602283610a87565b9150610fac82610f45565b604082019050919050565b60006020820190508181036000830152610fd081610f94565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b600061100d601d83610a87565b915061101882610fd7565b602082019050919050565b6000602082019050818103600083015261103c81611000565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061109f602583610a87565b91506110aa82611043565b604082019050919050565b600060208201905081810360008301526110ce81611092565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000611131602383610a87565b915061113c826110d5565b604082019050919050565b6000602082019050818103600083015261116081611124565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b60006111c3602683610a87565b91506111ce82611167565b604082019050919050565b600060208201905081810360008301526111f2816111b6565b905091905056fea26469706673582212204188b273199f085e1921ec1a1fa55abdee2e425960bda675a51fac85acd9972064736f6c63430008110033";class R8 extends Vf{constructor(...e){e.length>1?super(...e):super(T8,A8,e[0])}deploy(e,t,n){return super.deploy(e,t,n||{})}getDeployTransaction(e,t,n){return super.getDeployTransaction(e,t,n||{})}attach(e){return super.attach(e)}connect(e){return super.connect(e)}static bytecode=A8;static abi=T8;static createInterface(){return new os(T8)}static connect(e,t){return new Hf(e,T8,t)}}const S8=[{inputs:[{internalType:"address",name:"owner_",type:"address"},{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"},{internalType:"string",name:"baseURI_",type:"string"},{internalType:"string",name:"contractURI_",type:"string"},{internalType:"address",name:"royaltyAllowlist_",type:"address"},{internalType:"address",name:"royaltyReceiver_",type:"address"},{internalType:"uint96",name:"feeNumerator_",type:"uint96"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{internalType:"address",name:"target",type:"address"}],name:"ApproveTargetNotInAllowlist",type:"error"},{inputs:[{internalType:"address",name:"approver",type:"address"}],name:"ApproverNotInAllowlist",type:"error"},{inputs:[{internalType:"address",name:"caller",type:"address"}],name:"CallerNotInAllowlist",type:"error"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"IImmutableERC721IDAboveThreshold",type:"error"},{inputs:[],name:"IImmutableERC721MismatchedTransferLengths",type:"error"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"IImmutableERC721NotOwnerOrOperator",type:"error"},{inputs:[],name:"IImmutableERC721SendingToZerothAddress",type:"error"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"IImmutableERC721TokenAlreadyBurned",type:"error"},{inputs:[],name:"RoyaltyEnforcementDoesNotImplementRequiredInterface",type:"error"},{inputs:[{internalType:"address",name:"from",type:"address"}],name:"TransferFromNotInAllowlist",type:"error"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"TransferToNotInAllowlist",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"oldRegistry",type:"address"},{indexed:!1,internalType:"address",name:"newRegistry",type:"address"}],name:"RoyaltyAllowlistRegistryUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"MINTER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"baseURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"}],internalType:"struct ERC721Hybrid.IDMint[]",name:"mints",type:"tuple[]"}],name:"batchMintByIDToMultiple",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"quantity",type:"uint256"}],internalType:"struct ERC721Hybrid.Mint[]",name:"mints",type:"tuple[]"}],name:"batchMintByQuantity",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"}],internalType:"struct ERC721Hybrid.IDMint[]",name:"mints",type:"tuple[]"}],name:"batchSafeMintByIDToMultiple",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"quantity",type:"uint256"}],internalType:"struct ERC721Hybrid.Mint[]",name:"mints",type:"tuple[]"}],name:"batchSafeMintByQuantity",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"bulkMintThreshold",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"tokenIDs",type:"uint256[]"}],name:"burnBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"contractURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"exists",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"getAdmins",outputs:[{internalType:"address[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"uint256",name:"index",type:"uint256"}],name:"getRoleMember",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleMemberCount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"grantMinterRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"mintByID",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"quantity",type:"uint256"}],name:"mintByQuantity",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"revokeMinterRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"royaltyAllowlist",outputs:[{internalType:"contract IRoyaltyAllowlist",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"salePrice",type:"uint256"}],name:"royaltyInfo",outputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeMintByID",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"quantity",type:"uint256"}],name:"safeMintByQuantity",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"from",type:"address"},{internalType:"address[]",name:"tos",type:"address[]"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"}],internalType:"struct ERC721Hybrid.TransferRequest",name:"tr",type:"tuple"}],name:"safeTransferFromBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"baseURI_",type:"string"}],name:"setBaseURI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"_contractURI",type:"string"}],name:"setContractURI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"uint96",name:"feeNumerator",type:"uint96"}],name:"setDefaultRoyaltyReceiver",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"receiver",type:"address"},{internalType:"uint96",name:"feeNumerator",type:"uint96"}],name:"setNFTRoyaltyReceiver",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"},{internalType:"address",name:"receiver",type:"address"},{internalType:"uint96",name:"feeNumerator",type:"uint96"}],name:"setNFTRoyaltyReceiverBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_royaltyAllowlist",type:"address"}],name:"setRoyaltyAllowlistRegistry",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}],k8="0x608060405260006013553480156200001657600080fd5b5060405162005189380380620051898339810160408190526200003991620007c0565b8787878787878787868681818181600662000055838262000953565b50600762000064828262000953565b50506801000000000000000060095550600d62000082838262000953565b50600e62000091828262000953565b50620000a69350600092508b915050620000f1565b620000b2828262000134565b620000bd8362000239565b6016620000cb868262000953565b506015620000da858262000953565b505050505050505050505050505050505062000b67565b6200010882826200034060201b6200120f1760201c565b60008281526001602090815260409091206200012f91839062001293620003e1821b17901c565b505050565b6127106001600160601b0382161115620001a85760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084015b60405180910390fd5b6001600160a01b038216620002005760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c69642072656365697665720000000000000060448201526064016200019f565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600355565b6000620002468162000401565b6040516301ffc9a760e01b81526305a3b80960e01b60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa15801562000292573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002b8919062000a1f565b620002d657604051631353be1160e11b815260040160405180910390fd5b600254604080516001600160a01b03928316815291841660208301527ff499b54d61d3fcb40299e3299af3ffe9ef1ee6e47194240f3cc5b6e09f7f6796910160405180910390a150600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620003dd576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556200039c3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b6000620003f8836001600160a01b03841662000410565b90505b92915050565b6200040d813362000462565b50565b60008181526001830160205260408120546200045957508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620003fb565b506000620003fb565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620003dd57620004a181620004f260201b620012a81760201c565b620004b7836020620012ba62000505821b17811c565b604051602001620004ca92919062000a43565b60408051601f198184030181529082905262461bcd60e51b82526200019f9160040162000abc565b6060620003fb6001600160a01b03831660145b606060006200051683600262000b07565b6200052390600262000b21565b6001600160401b038111156200053d576200053d620006db565b6040519080825280601f01601f19166020018201604052801562000568576020820181803683370190505b509050600360fc1b8160008151811062000586576200058662000b37565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110620005b857620005b862000b37565b60200101906001600160f81b031916908160001a9053506000620005de84600262000b07565b620005eb90600162000b21565b90505b60018111156200066d576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811062000623576200062362000b37565b1a60f81b8282815181106200063c576200063c62000b37565b60200101906001600160f81b031916908160001a90535060049490941c93620006658162000b4d565b9050620005ee565b508315620003f85760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016200019f565b80516001600160a01b0381168114620006d657600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200070e578181015183820152602001620006f4565b50506000910152565b600082601f8301126200072957600080fd5b81516001600160401b0380821115620007465762000746620006db565b604051601f8301601f19908116603f01168101908282118183101715620007715762000771620006db565b816040528381528660208588010111156200078b57600080fd5b6200079e846020830160208901620006f1565b9695505050505050565b80516001600160601b0381168114620006d657600080fd5b600080600080600080600080610100898b031215620007de57600080fd5b620007e989620006be565b60208a01519098506001600160401b03808211156200080757600080fd5b620008158c838d0162000717565b985060408b01519150808211156200082c57600080fd5b6200083a8c838d0162000717565b975060608b01519150808211156200085157600080fd5b6200085f8c838d0162000717565b965060808b01519150808211156200087657600080fd5b50620008858b828c0162000717565b9450506200089660a08a01620006be565b9250620008a660c08a01620006be565b9150620008b660e08a01620007a8565b90509295985092959890939650565b600181811c90821680620008da57607f821691505b602082108103620008fb57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200012f57600081815260208120601f850160051c810160208610156200092a5750805b601f850160051c820191505b818110156200094b5782815560010162000936565b505050505050565b81516001600160401b038111156200096f576200096f620006db565b6200098781620009808454620008c5565b8462000901565b602080601f831160018114620009bf5760008415620009a65750858301515b600019600386901b1c1916600185901b1785556200094b565b600085815260208120601f198616915b82811015620009f057888601518255948401946001909101908401620009cf565b508582101562000a0f5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60006020828403121562000a3257600080fd5b81518015158114620003f857600080fd5b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835162000a7d816017850160208801620006f1565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835162000ab0816028840160208801620006f1565b01602801949350505050565b602081526000825180602084015262000add816040850160208701620006f1565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417620003fb57620003fb62000af1565b80820180821115620003fb57620003fb62000af1565b634e487b7160e01b600052603260045260246000fd5b60008162000b5f5762000b5f62000af1565b506000190190565b6146128062000b776000396000f3fe608060405234801561001057600080fd5b50600436106102ba5760003560e01c80636588962a11610182578063a7012816116100e9578063e4623c1b116100a2578063eea987681161007c578063eea9876814610648578063f5e0d8911461065b578063fa52ceec1461066e578063ff6250831461068157600080fd5b8063e4623c1b1461061a578063e8a3d4851461062d578063e985e9c51461063557600080fd5b8063a7012816146105a6578063b88d4fde146105b9578063c87b56dd146105cc578063ca15c873146105df578063d5391393146105f2578063d547741f1461060757600080fd5b80639010d07c1161013b5780639010d07c1461054a57806391d148541461055d578063938e3d7b1461057057806395d89b4114610583578063a217fddf1461058b578063a22cb4651461059357600080fd5b80636588962a146104e357806369e2f0fb146104f65780636b3a0632146105095780636c0360eb1461051c57806370a0823114610524578063885e7a081461053757600080fd5b806331ae450b116102265780634f558e79116101df5780634f558e791461047157806355f804b314610484578063567e4075146104975780635b32f935146104aa578063608a0b9d146104bd5780636352211e146104d057600080fd5b806331ae450b146103fd57806336568abe146104125780633dd1eb611461042557806342842e0e1461043857806342966c681461044b578063439aed341461045e57600080fd5b806318160ddd1161027857806318160ddd146103625780631f8ebbd11461037857806323b872dd14610382578063248a9ca3146103955780632a55205a146103b85780632f2ff15d146103ea57600080fd5b80628ad946146102bf57806301ffc9a7146102d45780630656b536146102fc57806306fdde031461030f578063081812fc14610324578063095ea7b31461034f575b600080fd5b6102d26102cd3660046137c8565b610694565b005b6102e76102e2366004613818565b61076a565b60405190151581526020015b60405180910390f35b6102d261030a3660046138dd565b61077b565b61031761079c565b6040516102f391906139ee565b610337610332366004613a01565b6107ab565b6040516001600160a01b0390911681526020016102f3565b6102d261035d366004613a1a565b6107cb565b61036a610926565b6040519081526020016102f3565b600160401b61036a565b6102d2610390366004613a44565b61093d565b61036a6103a3366004613a01565b60009081526020819052604090206001015490565b6103cb6103c6366004613a80565b61095f565b604080516001600160a01b0390931683526020830191909152016102f3565b6102d26103f8366004613aa2565b610a0d565b610405610a32565b6040516102f39190613ace565b6102d2610420366004613aa2565b610ae0565b6102d2610433366004613b1b565b610b5a565b6102d2610446366004613a44565b610b7d565b6102d2610459366004613a01565b610b98565b6102d261046c366004613b4d565b610bcf565b6102e761047f366004613a01565b610bf8565b6102d2610492366004613be0565b610c03565b6102d26104a5366004613a1a565b610c1a565b6102d26104b8366004613a1a565b610c3c565b6102d26104cb3660046138dd565b610c5e565b6103376104de366004613a01565b610c7f565b6102d26104f1366004613b1b565b610c9f565b6102d2610504366004613b1b565b610da0565b600254610337906001600160a01b031681565b610317610dc3565b61036a610532366004613b1b565b610e51565b6102d2610545366004613c28565b610e6f565b610337610558366004613a80565b610e84565b6102e761056b366004613aa2565b610ea3565b6102d261057e366004613be0565b610ecc565b610317610ee3565b61036a600081565b6102d26105a1366004613c60565b610eed565b6102d26105b4366004613cdb565b61103e565b6102d26105c7366004613d3f565b61109e565b6103176105da366004613a01565b6110c7565b61036a6105ed366004613a01565b6110d2565b61036a6a4d494e5445525f524f4c4560a81b81565b6102d2610615366004613aa2565b6110e9565b6102d2610628366004613dba565b61110e565b61031761114c565b6102e7610643366004613dfb565b611159565b6102d2610656366004613a1a565b611189565b6102d2610669366004613e25565b6111ab565b6102d261067c366004613e25565b6111cc565b6102d261068f366004613a1a565b6111ed565b6106a16020820182613f71565b90506106b06040830183613f71565b9050146106d05760405163359a1bc360e01b815260040160405180910390fd5b60005b6106e06040830183613f71565b9050811015610766576107546106f96020840184613b1b565b6107066020850185613f71565b8481811061071657610716613fba565b905060200201602081019061072b9190613b1b565b6107386040860186613f71565b8581811061074857610748613fba565b90506020020135610b7d565b8061075e81613fe6565b9150506106d3565b5050565b600061077582611455565b92915050565b6a4d494e5445525f524f4c4560a81b61079381611460565b6107668261146a565b60606107a66114b9565b905090565b6000600160401b8210156107c2576107758261154b565b61077582611572565b81333b1580159061084557506002546040516305a3b80960e01b81523360048201526001600160a01b03909116906305a3b80990602401602060405180830381865afa15801561081f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108439190613fff565b155b1561086a5760405163f6fa4cbd60e01b81523360048201526024015b60405180910390fd5b6001600160a01b0381163b158015906108ee57506002546040516305a3b80960e01b81526001600160a01b038381166004830152909116906305a3b80990602401602060405180830381865afa1580156108c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ec9190613fff565b155b15610917576040516341b8d58160e11b81526001600160a01b0382166004820152602401610861565b61092183836115fd565b505050565b600060135461093361161d565b6107a6919061401c565b600160401b81101561095457610921838383611639565b610921838383611669565b60008281526004602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916109d45750604080518082019091526003546001600160a01b0381168252600160a01b90046001600160601b031660208201525b6020810151600090612710906109f3906001600160601b03168761402f565b6109fd9190614046565b91519350909150505b9250929050565b600082815260208190526040902060010154610a2881611460565b610921838361168e565b60606000610a3f816110d2565b90506000816001600160401b03811115610a5b57610a5b613835565b604051908082528060200260200182016040528015610a84578160200160208202803683370190505b50905060005b82811015610ad957610a9d600082610e84565b828281518110610aaf57610aaf613fba565b6001600160a01b039092166020928302919091019091015280610ad181613fe6565b915050610a8a565b5092915050565b6001600160a01b0381163314610b505760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610861565b61076682826116b0565b6000610b6581611460565b6107666a4d494e5445525f524f4c4560a81b83610a0d565b6109218383836040518060200160405280600081525061109e565b610ba3335b826116d2565b610bc357604051630247e3a960e01b815260048101829052602401610861565b610bcc816116fb565b50565b6a4d494e5445525f524f4c4560a81b610be781611460565b610bf284848461174e565b50505050565b600061077582611819565b6000610c0e81611460565b601661092183826140e8565b6a4d494e5445525f524f4c4560a81b610c3281611460565b6109218383611876565b6a4d494e5445525f524f4c4560a81b610c5481611460565b6109218383611880565b6a4d494e5445525f524f4c4560a81b610c7681611460565b61076682611907565b6000600160401b821015610c965761077582611956565b610775826119b6565b6000610caa81611460565b6040516301ffc9a760e01b81526305a3b80960e01b60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa158015610cf5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d199190613fff565b610d3657604051631353be1160e11b815260040160405180910390fd5b600254604080516001600160a01b03928316815291841660208301527ff499b54d61d3fcb40299e3299af3ffe9ef1ee6e47194240f3cc5b6e09f7f6796910160405180910390a150600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000610dab81611460565b6107666a4d494e5445525f524f4c4560a81b836110e9565b60168054610dd090614068565b80601f0160208091040260200160405190810160405280929190818152602001828054610dfc90614068565b8015610e495780601f10610e1e57610100808354040283529160200191610e49565b820191906000526020600020905b815481529060010190602001808311610e2c57829003601f168201915b505050505081565b6000610e5c826119ca565b610e6583611a95565b610775919061401c565b6000610e7a81611460565b6109218383611b1b565b6000828152600160205260408120610e9c9083611bd5565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610ed781611460565b601561092183826140e8565b60606107a6611be1565b81333b15801590610f6757506002546040516305a3b80960e01b81523360048201526001600160a01b03909116906305a3b80990602401602060405180830381865afa158015610f41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f659190613fff565b155b15610f875760405163f6fa4cbd60e01b8152336004820152602401610861565b6001600160a01b0381163b1580159061100b57506002546040516305a3b80960e01b81526001600160a01b038381166004830152909116906305a3b80990602401602060405180830381865afa158015610fe5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110099190613fff565b155b15611034576040516341b8d58160e11b81526001600160a01b0382166004820152602401610861565b6109218383611bf0565b6a4d494e5445525f524f4c4560a81b61105681611460565b60005b848110156110965761108486868381811061107657611076613fba565b90506020020135858561174e565b8061108e81613fe6565b915050611059565b505050505050565b600160401b8210156110bb576110b684848484611bfa565b610bf2565b610bf284848484611c2d565b606061077582611c52565b600081815260016020526040812061077590611cb8565b60008281526020819052604090206001015461110481611460565b61092183836116b0565b60005b818110156109215761113a83838381811061112e5761112e613fba565b90506020020135610b98565b8061114481613fe6565b915050611111565b60158054610dd090614068565b6001600160a01b03808316600090815260126020908152604080832093851683529290529081205460ff16610e9c565b6a4d494e5445525f524f4c4560a81b6111a181611460565b6109218383611cc2565b6a4d494e5445525f524f4c4560a81b6111c381611460565b61076682611ccc565b6a4d494e5445525f524f4c4560a81b6111e481611460565b61076682611d1b565b6a4d494e5445525f524f4c4560a81b61120581611460565b6109218383611d6a565b6112198282610ea3565b610766576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561124f3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610e9c836001600160a01b038416611dd8565b60606107756001600160a01b03831660145b606060006112c983600261402f565b6112d490600261401c565b6001600160401b038111156112eb576112eb613835565b6040519080825280601f01601f191660200182016040528015611315576020820181803683370190505b509050600360fc1b8160008151811061133057611330613fba565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061135f5761135f613fba565b60200101906001600160f81b031916908160001a905350600061138384600261402f565b61138e90600161401c565b90505b6001811115611406576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106113c2576113c2613fba565b1a60f81b8282815181106113d8576113d8613fba565b60200101906001600160f81b031916908160001a90535060049490941c936113ff816141a7565b9050611391565b508315610e9c5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610861565b600061077582611e27565b610bcc8133611e67565b60005b815181101561076657600082828151811061148a5761148a613fba565b602002602001015190506114a681600001518260200151611876565b50806114b181613fe6565b91505061146d565b6060600d80546114c890614068565b80601f01602080910402602001604051908101604052809291908181526020018280546114f490614068565b80156115415780601f1061151657610100808354040283529160200191611541565b820191906000526020600020905b81548152906001019060200180831161152457829003601f168201915b5050505050905090565b600061155682611ec0565b506000908152601160205260409020546001600160a01b031690565b600061157d82611819565b6115e15760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a20617070726f76656420717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610861565b506000908152600a60205260409020546001600160a01b031690565b600160401b811015611613576107668282611f10565b6107668282612020565b6000611627612128565b61162f612192565b6107a691906141be565b61164233610b9d565b61165e5760405162461bcd60e51b8152600401610861906141d1565b6109218383836121a6565b61167233610b9d565b61165e5760405162461bcd60e51b81526004016108619061421e565b611698828261120f565b60008281526001602052604090206109219082611293565b6116ba82826123ad565b60008281526001602052604090206109219082612412565b6000600160401b8210156116f1576116ea8383612427565b9050610775565b610e9c8383612486565b600160401b811015611745576117108161254b565b600881901c60009081526014602052604081208054600160ff85161b179055601380549161173d836141a7565b919050555050565b610bcc816125ce565b6127106001600160601b03821611156117795760405162461bcd60e51b815260040161086190614272565b6001600160a01b0382166117cf5760405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152606401610861565b6040805180820182526001600160a01b0393841681526001600160601b0392831660208083019182526000968752600490529190942093519051909116600160a01b029116179055565b6000600160401b82101561186d576000828152600f60205260409020546001600160a01b0316158015906107755750600882901c600090815260146020526040902054600160ff84161b1615151592915050565b61077582612610565b6107668282612645565b600160401b81106118a75760405163b73c99f560e01b815260048101829052602401610861565b600881901c600090815260146020526040902054600160ff83161b16156118e4576040516305dcda1160e51b815260048101829052602401610861565b6118ee828261265f565b601380549060006118fe83613fe6565b91905055505050565b60005b815181101561076657600082828151811061192757611927613fba565b6020026020010151905061194381600001518260200151611cc2565b508061194e81613fe6565b91505061190a565b6000818152600f60205260408120546001600160a01b0316806107755760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610861565b6000806119c2836127ba565b509392505050565b60006001600160a01b038216611a385760405162461bcd60e51b815260206004820152602d60248201527f4552433732315073693a2062616c616e636520717565727920666f722074686560448201526c207a65726f206164647265737360981b6064820152608401610861565b6000600160401b5b600954811015610ad957611a5381611819565b15611a8557611a6181610c7f565b6001600160a01b0316846001600160a01b031603611a8557611a8282613fe6565b91505b611a8e81613fe6565b9050611a40565b60006001600160a01b038216611aff5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610861565b506001600160a01b031660009081526010602052604090205490565b6127106001600160601b0382161115611b465760405162461bcd60e51b815260040161086190614272565b6001600160a01b038216611b9c5760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610861565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600355565b6000610e9c8383612851565b6060600e80546114c890614068565b610766828261287b565b611c05335b836116d2565b611c215760405162461bcd60e51b8152600401610861906141d1565b610bf284848484612886565b611c3633611bff565b611c215760405162461bcd60e51b81526004016108619061421e565b6060611c5d82611ec0565b6000611c676128aa565b90506000815111611c875760405180602001604052806000815250610e9c565b80611c91846128b9565b604051602001611ca29291906142bc565b6040516020818303038152906040529392505050565b6000610775825490565b610766828261294b565b60005b8151811015610766576000828281518110611cec57611cec613fba565b60200260200101519050611d0881600001518260200151612ac4565b5080611d1381613fe6565b915050611ccf565b60005b8151811015610766576000828281518110611d3b57611d3b613fba565b60200260200101519050611d5781600001518260200151612b05565b5080611d6281613fe6565b915050611d1e565b600160401b8110611d915760405163b73c99f560e01b815260048101829052602401610861565b600881901c600090815260146020526040902054600160ff83161b1615611dce576040516305dcda1160e51b815260048101829052602401610861565b6118ee8282612b46565b6000818152600183016020526040812054611e1f57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610775565b506000610775565b60006001600160e01b031982166380ac58cd60e01b1480611e5857506001600160e01b03198216635b5e139f60e01b145b80610775575061077582612b60565b611e718282610ea3565b61076657611e7e816112a8565b611e898360206112ba565b604051602001611e9a9291906142eb565b60408051601f198184030181529082905262461bcd60e51b8252610861916004016139ee565b611ec981611819565b610bcc5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610861565b6000611f1b82611956565b9050806001600160a01b0316836001600160a01b031603611f885760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610861565b336001600160a01b0382161480611fa45750611fa48133611159565b6120165760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610861565b6109218383612ba0565b600061202b82610c7f565b9050806001600160a01b0316836001600160a01b03160361209a5760405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a20617070726f76616c20746f2063757272656e74206f6044820152633bb732b960e11b6064820152608401610861565b336001600160a01b03821614806120b657506120b68133611159565b6120165760405162461bcd60e51b815260206004820152603b60248201527f4552433732315073693a20617070726f76652063616c6c6572206973206e6f7460448201527f206f776e6572206e6f7220617070726f76656420666f7220616c6c00000000006064820152608401610861565b6009546000906701000000000000009082906121489060081c600161401c565b9050815b8181101561218c576000818152600c602052604090205461216c81612bc0565b612176908661401c565b945050808061218490613fe6565b91505061214c565b50505090565b6000600160401b6009546107a691906141be565b828233321480159061222157506002546040516305a3b80960e01b81523360048201526001600160a01b03909116906305a3b80990602401602060405180830381865afa1580156121fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061221f9190613fff565b155b156122415760405163937db65f60e01b8152336004820152602401610861565b6001600160a01b0382163b158015906122c557506002546040516305a3b80960e01b81526001600160a01b038481166004830152909116906305a3b80990602401602060405180830381865afa15801561229f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122c39190613fff565b155b156122ee5760405163f934453160e01b81526001600160a01b0383166004820152602401610861565b6001600160a01b0381163b1580159061237257506002546040516305a3b80960e01b81526001600160a01b038381166004830152909116906305a3b80990602401602060405180830381865afa15801561234c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123709190613fff565b155b1561239b57604051632a67242160e11b81526001600160a01b0382166004820152602401610861565b6123a6858585612bdf565b5050505050565b6123b78282610ea3565b15610766576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610e9c836001600160a01b038416612c01565b60008061243383611956565b9050806001600160a01b0316846001600160a01b0316148061245a575061245a8185611159565b8061247e5750836001600160a01b0316612473846107ab565b6001600160a01b0316145b949350505050565b600061249182611819565b6124f55760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a206f70657261746f7220717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610861565b600061250083610c7f565b9050806001600160a01b0316846001600160a01b0316148061253b5750836001600160a01b0316612530846107ab565b6001600160a01b0316145b8061247e575061247e8185611159565b600061255682611956565b905061256182611956565b600083815260116020908152604080832080546001600160a01b03199081169091556001600160a01b038516808552601084528285208054600019019055878552600f909352818420805490911690555192935084926000805160206144bd833981519152908390a45050565b60006125d982610c7f565b90506125e6600c83612cf4565b60405182906000906001600160a01b038416906000805160206144bd833981519152908390a45050565b600881901c6000908152600c6020526040812054600160ff1b60ff84161c161561263c57506000919050565b61077582612d20565b610766828260405180602001604052806000815250612d3f565b6001600160a01b0382166126b55760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610861565b6126be81611819565b1561270b5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610861565b61271481611819565b156127615760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610861565b6001600160a01b038216600081815260106020908152604080832080546001019055848352600f90915280822080546001600160a01b0319168417905551839291906000805160206144bd833981519152908290a45050565b6000806127c683611819565b6128275760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a206f776e657220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610861565b61283083612d80565b6000818152600860205260409020546001600160a01b031694909350915050565b600082600001828154811061286857612868613fba565b9060005260206000200154905092915050565b610766338383612d8d565b600160401b82101561289e576110b684848484612e5b565b610bf284848484612e8e565b6060601680546114c890614068565b606060006128c683612ea7565b60010190506000816001600160401b038111156128e5576128e5613835565b6040519080825280601f01601f19166020018201604052801561290f576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461291957509392505050565b600061295660095490565b9050600082116129b65760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a207175616e74697479206d7573742062652067726561604482015264074657220360dc1b6064820152608401610861565b6001600160a01b038316612a185760405162461bcd60e51b815260206004820152602360248201527f4552433732315073693a206d696e7420746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610861565b8160096000828254612a2a919061401c565b9091555050600081815260086020526040902080546001600160a01b0319166001600160a01b038516179055612a61600582612cf4565b600080612a6e848461401c565b90506001600160a01b0385169150828260006000805160206144bd833981519152600080a4600183015b818114612abe57808360006000805160206144bd833981519152600080a4600101612a98565b506123a6565b60005b815181101561092157612af383838381518110612ae657612ae6613fba565b6020026020010151611d6a565b80612afd81613fe6565b915050612ac7565b60005b815181101561092157612b3483838381518110612b2757612b27613fba565b6020026020010151611880565b80612b3e81613fe6565b915050612b08565b610766828260405180602001604052806000815250612f7f565b60006001600160e01b031982166380ac58cd60e01b1480612b9157506001600160e01b03198216635b5e139f60e01b145b80610775575061077582612f8a565b600160401b811015612bb6576107668282612faf565b610766828261301d565b60005b8115612bda57600019820190911690600101612bc3565b919050565b600160401b811015612bf657610921838383613052565b6109218383836131a4565b60008181526001830160205260408120548015612cea576000612c256001836141be565b8554909150600090612c39906001906141be565b9050818114612c9e576000866000018281548110612c5957612c59613fba565b9060005260206000200154905080876000018481548110612c7c57612c7c613fba565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612caf57612caf614360565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610775565b6000915050610775565b600881901c600090815260209290925260409091208054600160ff1b60ff9093169290921c9091179055565b6000612d2b60095490565b82108015610775575050600160401b111590565b6000612d4a60095490565b9050612d56848461294b565b612d6460008583868661337c565b610bf25760405162461bcd60e51b815260040161086190614376565b60006107756005836134b3565b816001600160a01b0316836001600160a01b031603612dee5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610861565b6001600160a01b03838116600081815260126020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612e668484846121a6565b612e72848484846135ab565b610bf25760405162461bcd60e51b8152600401610861906143cb565b612e998484846121a6565b612d6484848460018561337c565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612ee65772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612f12576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612f3057662386f26fc10000830492506010015b6305f5e1008310612f48576305f5e100830492506008015b6127108310612f5c57612710830492506004015b60648310612f6e576064830492506002015b600a83106107755760010192915050565b6109218383836136a4565b60006001600160e01b0319821663152a902d60e11b14806107755750610775826136d7565b600081815260116020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612fe482611956565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600a6020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612fe482610c7f565b826001600160a01b031661306582611956565b6001600160a01b03161461308b5760405162461bcd60e51b81526004016108619061441d565b6001600160a01b0382166130ed5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610861565b826001600160a01b031661310082611956565b6001600160a01b0316146131265760405162461bcd60e51b81526004016108619061441d565b600081815260116020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260108552838620805460001901905590871680865283862080546001019055868652600f90945282852080549092168417909155905184936000805160206144bd83398151915291a4505050565b6000806131b0836127ba565b91509150846001600160a01b0316826001600160a01b03161461322a5760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a207472616e73666572206f6620746f6b656e2074686160448201526b3a1034b9903737ba1037bbb760a11b6064820152608401610861565b6001600160a01b0384166132905760405162461bcd60e51b815260206004820152602760248201527f4552433732315073693a207472616e7366657220746f20746865207a65726f206044820152666164647265737360c81b6064820152608401610861565b61329b600084612ba0565b60006132a884600161401c565b600881901c600090815260056020526040902054909150600160ff1b60ff83161c161580156132d8575060095481105b1561330f57600081815260086020526040902080546001600160a01b0319166001600160a01b03881617905561330f600582612cf4565b600084815260086020526040902080546001600160a01b0319166001600160a01b03871617905581841461334857613348600585612cf4565b83856001600160a01b0316876001600160a01b03166000805160206144bd83398151915260405160405180910390a4611096565b60006001600160a01b0385163b156134a657506001835b61339d848661401c565b8110156134a057604051630a85bd0160e11b81526001600160a01b0387169063150b7a02906133d69033908b9086908990600401614462565b6020604051808303816000875af1925050508015613411575060408051601f3d908101601f1916820190925261340e9181019061449f565b60015b61346e573d80801561343f576040519150601f19603f3d011682016040523d82523d6000602084013e613444565b606091505b5080516000036134665760405162461bcd60e51b815260040161086190614376565b805181602001fd5b82801561348b57506001600160e01b03198116630a85bd0160e11b145b9250508061349881613fe6565b915050613393565b506134aa565b5060015b95945050505050565b600881901c60008181526020849052604081205490919060ff808516919082181c80156134f5576134e3816136e2565b60ff168203600884901b1793506135a2565b600083116135625760405162461bcd60e51b815260206004820152603460248201527f4269744d6170733a205468652073657420626974206265666f7265207468652060448201527334b73232bc103237b2b9b713ba1032bc34b9ba1760611b6064820152608401610861565b50600019909101600081815260208690526040902054909190801561359d5761358a816136e2565b60ff0360ff16600884901b1793506135a2565b6134f5565b50505092915050565b60006001600160a01b0384163b1561369957604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906135ef903390899088908890600401614462565b6020604051808303816000875af192505050801561362a575060408051601f3d908101601f191682019092526136279181019061449f565b60015b61367f573d808015613658576040519150601f19603f3d011682016040523d82523d6000602084013e61365d565b606091505b5080516000036134665760405162461bcd60e51b8152600401610861906143cb565b6001600160e01b031916630a85bd0160e11b14905061247e565b506001949350505050565b6136ae838361374c565b6136bb60008484846135ab565b6109215760405162461bcd60e51b8152600401610861906143cb565b600061077582613756565b600060405180610120016040528061010081526020016144dd610100913960f87e818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff61372b8561377b565b02901c8151811061373e5761373e613fba565b016020015160f81c92915050565b610766828261265f565b60006001600160e01b03198216635a05180f60e01b1480610775575061077582613793565b600080821161378957600080fd5b5060008190031690565b60006001600160e01b03198216637965db0b60e01b148061077557506301ffc9a760e01b6001600160e01b0319831614610775565b6000602082840312156137da57600080fd5b81356001600160401b038111156137f057600080fd5b820160608185031215610e9c57600080fd5b6001600160e01b031981168114610bcc57600080fd5b60006020828403121561382a57600080fd5b8135610e9c81613802565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b038111828210171561386d5761386d613835565b60405290565b604051601f8201601f191681016001600160401b038111828210171561389b5761389b613835565b604052919050565b60006001600160401b038211156138bc576138bc613835565b5060051b60200190565b80356001600160a01b0381168114612bda57600080fd5b600060208083850312156138f057600080fd5b82356001600160401b0381111561390657600080fd5b8301601f8101851361391757600080fd5b803561392a613925826138a3565b613873565b81815260069190911b8201830190838101908783111561394957600080fd5b928401925b8284101561399357604084890312156139675760008081fd5b61396f61384b565b613978856138c6565b8152848601358682015282526040909301929084019061394e565b979650505050505050565b60005b838110156139b95781810151838201526020016139a1565b50506000910152565b600081518084526139da81602086016020860161399e565b601f01601f19169290920160200192915050565b602081526000610e9c60208301846139c2565b600060208284031215613a1357600080fd5b5035919050565b60008060408385031215613a2d57600080fd5b613a36836138c6565b946020939093013593505050565b600080600060608486031215613a5957600080fd5b613a62846138c6565b9250613a70602085016138c6565b9150604084013590509250925092565b60008060408385031215613a9357600080fd5b50508035926020909101359150565b60008060408385031215613ab557600080fd5b82359150613ac5602084016138c6565b90509250929050565b6020808252825182820181905260009190848201906040850190845b81811015613b0f5783516001600160a01b031683529284019291840191600101613aea565b50909695505050505050565b600060208284031215613b2d57600080fd5b610e9c826138c6565b80356001600160601b0381168114612bda57600080fd5b600080600060608486031215613b6257600080fd5b83359250613b72602085016138c6565b9150613b8060408501613b36565b90509250925092565b60006001600160401b03831115613ba257613ba2613835565b613bb5601f8401601f1916602001613873565b9050828152838383011115613bc957600080fd5b828260208301376000602084830101529392505050565b600060208284031215613bf257600080fd5b81356001600160401b03811115613c0857600080fd5b8201601f81018413613c1957600080fd5b61247e84823560208401613b89565b60008060408385031215613c3b57600080fd5b613c44836138c6565b9150613ac560208401613b36565b8015158114610bcc57600080fd5b60008060408385031215613c7357600080fd5b613c7c836138c6565b91506020830135613c8c81613c52565b809150509250929050565b60008083601f840112613ca957600080fd5b5081356001600160401b03811115613cc057600080fd5b6020830191508360208260051b8501011115610a0657600080fd5b60008060008060608587031215613cf157600080fd5b84356001600160401b03811115613d0757600080fd5b613d1387828801613c97565b9095509350613d269050602086016138c6565b9150613d3460408601613b36565b905092959194509250565b60008060008060808587031215613d5557600080fd5b613d5e856138c6565b9350613d6c602086016138c6565b92506040850135915060608501356001600160401b03811115613d8e57600080fd5b8501601f81018713613d9f57600080fd5b613dae87823560208401613b89565b91505092959194509250565b60008060208385031215613dcd57600080fd5b82356001600160401b03811115613de357600080fd5b613def85828601613c97565b90969095509350505050565b60008060408385031215613e0e57600080fd5b613e17836138c6565b9150613ac5602084016138c6565b60006020808385031215613e3857600080fd5b82356001600160401b0380821115613e4f57600080fd5b818501915085601f830112613e6357600080fd5b8135613e71613925826138a3565b81815260059190911b83018401908481019088831115613e9057600080fd5b8585015b83811015613f6457803585811115613eac5760008081fd5b86016040818c03601f1901811315613ec45760008081fd5b613ecc61384b565b613ed78a84016138c6565b81528183013588811115613eeb5760008081fd5b8084019350508c603f840112613f015760008081fd5b89830135613f11613925826138a3565b81815260059190911b84018301908b8101908f831115613f315760008081fd5b948401945b82861015613f4f5785358252948c0194908c0190613f36565b838d0152505085525050918601918601613e94565b5098975050505050505050565b6000808335601e19843603018112613f8857600080fd5b8301803591506001600160401b03821115613fa257600080fd5b6020019150600581901b3603821315610a0657600080fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201613ff857613ff8613fd0565b5060010190565b60006020828403121561401157600080fd5b8151610e9c81613c52565b8082018082111561077557610775613fd0565b808202811582820484141761077557610775613fd0565b60008261406357634e487b7160e01b600052601260045260246000fd5b500490565b600181811c9082168061407c57607f821691505b60208210810361409c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561092157600081815260208120601f850160051c810160208610156140c95750805b601f850160051c820191505b81811015611096578281556001016140d5565b81516001600160401b0381111561410157614101613835565b6141158161410f8454614068565b846140a2565b602080601f83116001811461414a57600084156141325750858301515b600019600386901b1c1916600185901b178555611096565b600085815260208120601f198616915b828110156141795788860151825594840194600190910190840161415a565b50858210156141975787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000816141b6576141b6613fd0565b506000190190565b8181038181111561077557610775613fd0565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b60208082526034908201527f4552433732315073693a207472616e736665722063616c6c6572206973206e6f6040820152731d081bdddb995c881b9bdc88185c1c1c9bdd995960621b606082015260800190565b6020808252602a908201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646040820152692073616c65507269636560b01b606082015260800190565b600083516142ce81846020880161399e565b8351908301906142e281836020880161399e565b01949350505050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161432381601785016020880161399e565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161435481602884016020880161399e565b01602801949350505050565b634e487b7160e01b600052603160045260246000fd5b60208082526035908201527f4552433732315073693a207472616e7366657220746f206e6f6e20455243373260408201527418a932b1b2b4bb32b91034b6b83632b6b2b73a32b960591b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090614495908301846139c2565b9695505050505050565b6000602082840312156144b157600080fd5b8151610e9c8161380256feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8a2646970667358221220216dd955505e933a17e6f45acb29b390eaf7241d0e86fad51fe9b9e3417836e264736f6c63430008110033";class O8 extends Vf{constructor(...e){e.length>1?super(...e):super(S8,k8,e[0])}deploy(e,t,n,r,i,a,o,s,u){return super.deploy(e,t,n,r,i,a,o,s,u||{})}getDeployTransaction(e,t,n,r,i,a,o,s,u){return super.getDeployTransaction(e,t,n,r,i,a,o,s,u||{})}attach(e){return super.attach(e)}connect(e){return super.connect(e)}static bytecode=k8;static abi=S8;static createInterface(){return new os(S8)}static connect(e,t){return new Hf(e,S8,t)}}const I8=[{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"},{internalType:"string",name:"baseURI_",type:"string"},{internalType:"string",name:"contractURI_",type:"string"},{internalType:"address",name:"_royaltyAllowlist",type:"address"},{internalType:"address",name:"_receiver",type:"address"},{internalType:"uint96",name:"_feeNumerator",type:"uint96"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{internalType:"address",name:"target",type:"address"}],name:"ApproveTargetNotInAllowlist",type:"error"},{inputs:[{internalType:"address",name:"approver",type:"address"}],name:"ApproverNotInAllowlist",type:"error"},{inputs:[{internalType:"address",name:"caller",type:"address"}],name:"CallerNotInAllowlist",type:"error"},{inputs:[{internalType:"address",name:"from",type:"address"}],name:"TransferFromNotInAllowlist",type:"error"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"TransferToNotInAllowlist",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"oldRegistry",type:"address"},{indexed:!1,internalType:"address",name:"newRegistry",type:"address"}],name:"RoyaltytAllowlistRegistryUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"MINTER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"_burnedTokens",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"_totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"baseURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"tokenIDs",type:"uint256[]"}],name:"burnBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"contractURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"getAdmins",outputs:[{internalType:"address[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"uint256",name:"index",type:"uint256"}],name:"getRoleMember",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleMemberCount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"grantMinterRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenID",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"revokeMinterRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"royaltyAllowlist",outputs:[{internalType:"contract IRoyaltyAllowlist",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"salePrice",type:"uint256"}],name:"royaltyInfo",outputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenID",type:"uint256"}],name:"safeMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"}],internalType:"struct ImmutableERC721Base.IDMint[]",name:"mintRequests",type:"tuple[]"}],name:"safeMintBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"from",type:"address"},{internalType:"address[]",name:"tos",type:"address[]"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"}],internalType:"struct ImmutableERC721Base.TransferRequest",name:"tr",type:"tuple"}],name:"safeTransferFromBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"baseURI_",type:"string"}],name:"setBaseURI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"_contractURI",type:"string"}],name:"setContractURI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"uint96",name:"feeNumerator",type:"uint96"}],name:"setDefaultRoyaltyReceiver",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"receiver",type:"address"},{internalType:"uint96",name:"feeNumerator",type:"uint96"}],name:"setNFTRoyaltyReceiver",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"},{internalType:"address",name:"receiver",type:"address"},{internalType:"uint96",name:"feeNumerator",type:"uint96"}],name:"setNFTRoyaltyReceiverBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_royaltyAllowlist",type:"address"}],name:"setRoyaltyAllowlistRegistry",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}],x8="0x60806040526000600d553480156200001657600080fd5b5060405162003f9238038062003f92833981016040819052620000399162000811565b8787878787868685856003620000508382620009a4565b5060046200005f8282620009a4565b505050620000748282620000fc60201b60201c565b6200008160008862000201565b600c6200008f8582620009a4565b50600b6200009e8482620009a4565b5050505050505050620000b88282620000fc60201b60201c565b620000c560008962000201565b620000d08362000244565b600c620000de8682620009a4565b50600b620000ed8582620009a4565b50505050505050505062000bb8565b6127106001600160601b0382161115620001705760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084015b60405180910390fd5b6001600160a01b038216620001c85760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c696420726563656976657200000000000000604482015260640162000167565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600955565b6200021882826200039160201b620013ca1760201c565b60008281526001602090815260409091206200023f9183906200144e62000432821b17901c565b505050565b6000620002518162000452565b6040516301ffc9a760e01b81526305a3b80960e01b60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa1580156200029d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002c3919062000a70565b620003275760405162461bcd60e51b815260206004820152602d60248201527f636f6e747261637420646f6573206e6f7420696d706c656d656e742049526f7960448201526c185b1d1e505b1b1bdddb1a5cdd609a1b606482015260840162000167565b600254604080516001600160a01b03928316815291841660208301527f4a1d010d926ae0d4294a4afe61ae81bb378335fbf671e099a7138b5afeefdf84910160405180910390a150600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166200042e576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620003ed3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600062000449836001600160a01b03841662000461565b90505b92915050565b6200045e8133620004b3565b50565b6000818152600183016020526040812054620004aa575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556200044c565b5060006200044c565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166200042e57620004f2816200054360201b620014631760201c565b620005088360206200147562000556821b17811c565b6040516020016200051b92919062000a94565b60408051601f198184030181529082905262461bcd60e51b8252620001679160040162000b0d565b60606200044c6001600160a01b03831660145b606060006200056783600262000b58565b6200057490600262000b72565b6001600160401b038111156200058e576200058e6200072c565b6040519080825280601f01601f191660200182016040528015620005b9576020820181803683370190505b509050600360fc1b81600081518110620005d757620005d762000b88565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811062000609576200060962000b88565b60200101906001600160f81b031916908160001a90535060006200062f84600262000b58565b6200063c90600162000b72565b90505b6001811115620006be576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811062000674576200067462000b88565b1a60f81b8282815181106200068d576200068d62000b88565b60200101906001600160f81b031916908160001a90535060049490941c93620006b68162000b9e565b90506200063f565b508315620004495760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640162000167565b80516001600160a01b03811681146200072757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200075f57818101518382015260200162000745565b50506000910152565b600082601f8301126200077a57600080fd5b81516001600160401b03808211156200079757620007976200072c565b604051601f8301601f19908116603f01168101908282118183101715620007c257620007c26200072c565b81604052838152866020858801011115620007dc57600080fd5b620007ef84602083016020890162000742565b9695505050505050565b80516001600160601b03811681146200072757600080fd5b600080600080600080600080610100898b0312156200082f57600080fd5b6200083a896200070f565b60208a01519098506001600160401b03808211156200085857600080fd5b620008668c838d0162000768565b985060408b01519150808211156200087d57600080fd5b6200088b8c838d0162000768565b975060608b0151915080821115620008a257600080fd5b620008b08c838d0162000768565b965060808b0151915080821115620008c757600080fd5b50620008d68b828c0162000768565b945050620008e760a08a016200070f565b9250620008f760c08a016200070f565b91506200090760e08a01620007f9565b90509295985092959890939650565b600181811c908216806200092b57607f821691505b6020821081036200094c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200023f57600081815260208120601f850160051c810160208610156200097b5750805b601f850160051c820191505b818110156200099c5782815560010162000987565b505050505050565b81516001600160401b03811115620009c057620009c06200072c565b620009d881620009d1845462000916565b8462000952565b602080601f83116001811462000a105760008415620009f75750858301515b600019600386901b1c1916600185901b1785556200099c565b600085815260208120601f198616915b8281101562000a415788860151825594840194600190910190840162000a20565b508582101562000a605787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60006020828403121562000a8357600080fd5b815180151581146200044957600080fd5b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835162000ace81601785016020880162000742565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835162000b0181602884016020880162000742565b01602801949350505050565b602081526000825180602084015262000b2e81604085016020870162000742565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176200044c576200044c62000b42565b808201808211156200044c576200044c62000b42565b634e487b7160e01b600052603260045260246000fd5b60008162000bb05762000bb062000b42565b506000190190565b6133ca8062000bc86000396000f3fe608060405234801561001057600080fd5b50600436106102735760003560e01c806369e2f0fb11610151578063a22cb465116100c3578063ca15c87311610087578063ca15c87314610590578063d5391393146105a3578063d547741f146105b8578063e4623c1b146105cb578063e8a3d485146105de578063e985e9c5146105e657600080fd5b8063a22cb46514610521578063a701281614610534578063b88d4fde14610547578063c720ee3e1461055a578063c87b56dd1461057d57600080fd5b80639010d07c116101155780639010d07c146104c557806391d14854146104d8578063938e3d7b146104eb57806395d89b41146104fe578063a144819414610506578063a217fddf1461051957600080fd5b806369e2f0fb146104715780636b3a0632146104845780636c0360eb1461049757806370a082311461049f578063885e7a08146104b257600080fd5b806331ae450b116101ea57806342842e0e116101ae57806342842e0e146103ff57806342966c6814610412578063439aed341461042557806355f804b3146104385780636352211e1461044b5780636588962a1461045e57600080fd5b806331ae450b146103a857806336568abe146103bd5780633dd1eb61146103d05780633eaaf86b146103e357806340c10f19146103ec57600080fd5b806318160ddd1161023c57806318160ddd14610308578063234af0461461031a57806323b872dd1461032d578063248a9ca3146103405780632a55205a146103635780632f2ff15d1461039557600080fd5b80628ad9461461027857806301ffc9a71461028d57806306fdde03146102b5578063081812fc146102ca578063095ea7b3146102f5575b600080fd5b61028b610286366004612800565b610622565b005b6102a061029b366004612850565b610752565b60405190151581526020015b60405180910390f35b6102bd610763565b6040516102ac91906128bd565b6102dd6102d83660046128d0565b6107f5565b6040516001600160a01b0390911681526020016102ac565b61028b610303366004612905565b61081c565b600d545b6040519081526020016102ac565b61028b6103283660046129c0565b610984565b61028b61033b366004612b11565b6109dc565b61030c61034e3660046128d0565b60009081526020819052604090206001015490565b610376610371366004612b4d565b610a0e565b604080516001600160a01b0390931683526020830191909152016102ac565b61028b6103a3366004612b6f565b610abc565b6103b0610ae1565b6040516102ac9190612b9b565b61028b6103cb366004612b6f565b610b8f565b61028b6103de366004612be8565b610c09565b61030c600d5481565b61028b6103fa366004612905565b610c2c565b61028b61040d366004612b11565b610c68565b61028b6104203660046128d0565b610c83565b61028b610433366004612c1a565b610cbb565b61028b610446366004612cad565b610ce4565b6102dd6104593660046128d0565b610cfb565b61028b61046c366004612be8565b610d5b565b61028b61047f366004612be8565b610ea1565b6002546102dd906001600160a01b031681565b6102bd610ec4565b61030c6104ad366004612be8565b610f52565b61028b6104c0366004612cf5565b610fd8565b6102dd6104d3366004612b4d565b610fed565b6102a06104e6366004612b6f565b61100c565b61028b6104f9366004612cad565b611035565b6102bd61104c565b61028b610514366004612905565b61105b565b61030c600081565b61028b61052f366004612d2d565b61108d565b61028b610542366004612da8565b6111f0565b61028b610555366004612e0c565b611250565b6102a06105683660046128d0565b600e6020526000908152604090205460ff1681565b6102bd61058b3660046128d0565b611282565b61030c61059e3660046128d0565b6112e8565b61030c6a4d494e5445525f524f4c4560a81b81565b61028b6105c6366004612b6f565b6112ff565b61028b6105d9366004612e87565b611324565b6102bd6113bd565b6102a06105f4366004612ec8565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205460ff1690565b61062f6020820182612ef2565b905061063e6040830183612ef2565b9050146106b85760405162461bcd60e51b815260206004820152603760248201527f6e756d626572206f6620746f6b656e20696473206e6f74207468652073616d6560448201527f206173206e756d626572206f662072656365697665727300000000000000000060648201526084015b60405180910390fd5b60005b6106c86040830183612ef2565b905081101561074e5761073c6106e16020840184612be8565b6106ee6020850185612ef2565b848181106106fe576106fe612f3b565b90506020020160208101906107139190612be8565b6107206040860186612ef2565b8581811061073057610730612f3b565b90506020020135610c68565b8061074681612f67565b9150506106bb565b5050565b600061075d82611610565b92915050565b60606003805461077290612f80565b80601f016020809104026020016040519081016040528092919081815260200182805461079e90612f80565b80156107eb5780601f106107c0576101008083540402835291602001916107eb565b820191906000526020600020905b8154815290600101906020018083116107ce57829003601f168201915b5050505050905090565b60006108008261161b565b506000908152600760205260409020546001600160a01b031690565b60025482906001600160a01b03161561097557333b158015906108a857506002546040516305a3b80960e01b81523360048201526001600160a01b03909116906305a3b80990602401602060405180830381865afa158015610882573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a69190612fba565b155b156108c85760405163f6fa4cbd60e01b81523360048201526024016106af565b6001600160a01b0381163b1580159061094c57506002546040516305a3b80960e01b81526001600160a01b038381166004830152909116906305a3b80990602401602060405180830381865afa158015610926573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094a9190612fba565b155b15610975576040516341b8d58160e11b81526001600160a01b03821660048201526024016106af565b61097f838361167d565b505050565b6a4d494e5445525f524f4c4560a81b61099c8161178d565b60005b825181101561097f576109ca8382815181106109bd576109bd612f3b565b6020026020010151611797565b806109d481612f67565b91505061099f565b6109e7335b82611847565b610a035760405162461bcd60e51b81526004016106af90612fd7565b61097f8383836118c6565b6000828152600a602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610a835750604080518082019091526009546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610aa2906001600160601b031687613024565b610aac919061303b565b91519350909150505b9250929050565b600082815260208190526040902060010154610ad78161178d565b61097f8383611ae0565b60606000610aee816112e8565b90506000816001600160401b03811115610b0a57610b0a61292f565b604051908082528060200260200182016040528015610b33578160200160208202803683370190505b50905060005b82811015610b8857610b4c600082610fed565b828281518110610b5e57610b5e612f3b565b6001600160a01b039092166020928302919091019091015280610b8081612f67565b915050610b39565b5092915050565b6001600160a01b0381163314610bff5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016106af565b61074e8282611b02565b6000610c148161178d565b61074e6a4d494e5445525f524f4c4560a81b83610abc565b6a4d494e5445525f524f4c4560a81b610c448161178d565b610c4e8383611b24565b600d8054906000610c5e83612f67565b9190505550505050565b61097f83838360405180602001604052806000815250611250565b610c8c81611b8d565b6000818152600e60205260408120805460ff19166001179055600d805491610cb38361305d565b919050555050565b6a4d494e5445525f524f4c4560a81b610cd38161178d565b610cde848484611bbb565b50505050565b6000610cef8161178d565b600c61097f83826130ba565b6000818152600560205260408120546001600160a01b03168061075d5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016106af565b6000610d668161178d565b6040516301ffc9a760e01b81526305a3b80960e01b60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa158015610db1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd59190612fba565b610e375760405162461bcd60e51b815260206004820152602d60248201527f636f6e747261637420646f6573206e6f7420696d706c656d656e742049526f7960448201526c185b1d1e505b1b1bdddb1a5cdd609a1b60648201526084016106af565b600254604080516001600160a01b03928316815291841660208301527f4a1d010d926ae0d4294a4afe61ae81bb378335fbf671e099a7138b5afeefdf84910160405180910390a150600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000610eac8161178d565b61074e6a4d494e5445525f524f4c4560a81b836112ff565b600c8054610ed190612f80565b80601f0160208091040260200160405190810160405280929190818152602001828054610efd90612f80565b8015610f4a5780601f10610f1f57610100808354040283529160200191610f4a565b820191906000526020600020905b815481529060010190602001808311610f2d57829003601f168201915b505050505081565b60006001600160a01b038216610fbc5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016106af565b506001600160a01b031660009081526006602052604090205490565b6000610fe38161178d565b61097f8383611c86565b60008281526001602052604081206110059083611d40565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60006110408161178d565b600b61097f83826130ba565b60606004805461077290612f80565b6a4d494e5445525f524f4c4560a81b6110738161178d565b610c4e838360405180602001604052806000815250611d4c565b60025482906001600160a01b0316156111e657333b1580159061111957506002546040516305a3b80960e01b81523360048201526001600160a01b03909116906305a3b80990602401602060405180830381865afa1580156110f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111179190612fba565b155b156111395760405163f6fa4cbd60e01b81523360048201526024016106af565b6001600160a01b0381163b158015906111bd57506002546040516305a3b80960e01b81526001600160a01b038381166004830152909116906305a3b80990602401602060405180830381865afa158015611197573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111bb9190612fba565b155b156111e6576040516341b8d58160e11b81526001600160a01b03821660048201526024016106af565b61097f8383611d7f565b6a4d494e5445525f524f4c4560a81b6112088161178d565b60005b848110156112485761123686868381811061122857611228612f3b565b905060200201358585611bbb565b8061124081612f67565b91505061120b565b505050505050565b61125a3383611847565b6112765760405162461bcd60e51b81526004016106af90612fd7565b610cde84848484611d8a565b606061128d8261161b565b6000611297611dbd565b905060008151116112b75760405180602001604052806000815250611005565b806112c184611dcc565b6040516020016112d2929190613179565b6040516020818303038152906040529392505050565b600081815260016020526040812061075d90611e5e565b60008281526020819052604090206001015461131a8161178d565b61097f8383611b02565b60005b818110156113a75761135083838381811061134457611344612f3b565b90506020020135611b8d565b6001600e600085858581811061136857611368612f3b565b90506020020135815260200190815260200160002060006101000a81548160ff021916908315150217905550808061139f90612f67565b915050611327565b50600d546113b69082906131a8565b600d555050565b600b8054610ed190612f80565b6113d4828261100c565b61074e576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561140a3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000611005836001600160a01b038416611e68565b606061075d6001600160a01b03831660145b60606000611484836002613024565b61148f9060026131bb565b6001600160401b038111156114a6576114a661292f565b6040519080825280601f01601f1916602001820160405280156114d0576020820181803683370190505b509050600360fc1b816000815181106114eb576114eb612f3b565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061151a5761151a612f3b565b60200101906001600160f81b031916908160001a905350600061153e846002613024565b6115499060016131bb565b90505b60018111156115c1576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061157d5761157d612f3b565b1a60f81b82828151811061159357611593612f3b565b60200101906001600160f81b031916908160001a90535060049490941c936115ba8161305d565b905061154c565b5083156110055760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016106af565b600061075d82611eb7565b6000818152600560205260409020546001600160a01b031661167a5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016106af565b50565b600061168882610cfb565b9050806001600160a01b0316836001600160a01b0316036116f55760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016106af565b336001600160a01b0382161480611711575061171181336105f4565b6117835760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c00000060648201526084016106af565b61097f8383611edc565b61167a8133611f4a565b80516001600160a01b03166117e05760405162461bcd60e51b815260206004820152600f60248201526e41646472657373206973207a65726f60881b60448201526064016106af565b60005b81602001515181101561182d5761181b82600001518360200151838151811061180e5761180e612f3b565b6020026020010151611b24565b8061182581612f67565b9150506117e3565b50806020015151600d5461184191906131bb565b600d5550565b60008061185383610cfb565b9050806001600160a01b0316846001600160a01b0316148061189a57506001600160a01b0380821660009081526008602090815260408083209388168352929052205460ff165b806118be5750836001600160a01b03166118b3846107f5565b6001600160a01b0316145b949350505050565b600254839083906001600160a01b031615611ace5733321480159061195457506002546040516305a3b80960e01b81523360048201526001600160a01b03909116906305a3b80990602401602060405180830381865afa15801561192e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119529190612fba565b155b156119745760405163937db65f60e01b81523360048201526024016106af565b6001600160a01b0382163b158015906119f857506002546040516305a3b80960e01b81526001600160a01b038481166004830152909116906305a3b80990602401602060405180830381865afa1580156119d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119f69190612fba565b155b15611a215760405163f934453160e01b81526001600160a01b03831660048201526024016106af565b6001600160a01b0381163b15801590611aa557506002546040516305a3b80960e01b81526001600160a01b038381166004830152909116906305a3b80990602401602060405180830381865afa158015611a7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aa39190612fba565b155b15611ace57604051632a67242160e11b81526001600160a01b03821660048201526024016106af565b611ad9858585611fa3565b5050505050565b611aea82826113ca565b600082815260016020526040902061097f908261144e565b611b0c8282612107565b600082815260016020526040902061097f908261216c565b6000818152600e602052604090205460ff1615611b835760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206275726e65640000000060448201526064016106af565b61074e8282612181565b611b96336109e1565b611bb25760405162461bcd60e51b81526004016106af90612fd7565b61167a8161230c565b6127106001600160601b0382161115611be65760405162461bcd60e51b81526004016106af906131ce565b6001600160a01b038216611c3c5760405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d6574657273000000000060448201526064016106af565b6040805180820182526001600160a01b0393841681526001600160601b0392831660208083019182526000968752600a90529190942093519051909116600160a01b029116179055565b6127106001600160601b0382161115611cb15760405162461bcd60e51b81526004016106af906131ce565b6001600160a01b038216611d075760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c69642072656365697665720000000000000060448201526064016106af565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600955565b600061100583836123a1565b611d568383611b24565b611d6360008484846123cb565b61097f5760405162461bcd60e51b81526004016106af90613218565b61074e3383836124cc565b611d958484846118c6565b611da1848484846123cb565b610cde5760405162461bcd60e51b81526004016106af90613218565b6060600c805461077290612f80565b60606000611dd98361259a565b60010190506000816001600160401b03811115611df857611df861292f565b6040519080825280601f01601f191660200182016040528015611e22576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084611e2c57509392505050565b600061075d825490565b6000818152600183016020526040812054611eaf5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561075d565b50600061075d565b60006001600160e01b0319821663152a902d60e11b148061075d575061075d82612672565b600081815260076020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611f1182610cfb565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b611f54828261100c565b61074e57611f6181611463565b611f6c836020611475565b604051602001611f7d92919061326a565b60408051601f198184030181529082905262461bcd60e51b82526106af916004016128bd565b826001600160a01b0316611fb682610cfb565b6001600160a01b031614611fdc5760405162461bcd60e51b81526004016106af906132df565b6001600160a01b03821661203e5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016106af565b826001600160a01b031661205182610cfb565b6001600160a01b0316146120775760405162461bcd60e51b81526004016106af906132df565b600081815260076020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260068552838620805460001901905590871680865283862080546001019055868652600590945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b612111828261100c565b1561074e576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000611005836001600160a01b0384166126b2565b6001600160a01b0382166121d75760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016106af565b6000818152600560205260409020546001600160a01b03161561223c5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016106af565b6000818152600560205260409020546001600160a01b0316156122a15760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016106af565b6001600160a01b038216600081815260066020908152604080832080546001019055848352600590915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600061231782610cfb565b905061232282610cfb565b600083815260076020908152604080832080546001600160a01b03199081169091556001600160a01b0385168085526006845282852080546000190190558785526005909352818420805490911690555192935084927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60008260000182815481106123b8576123b8612f3b565b9060005260206000200154905092915050565b60006001600160a01b0384163b156124c157604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061240f903390899088908890600401613324565b6020604051808303816000875af192505050801561244a575060408051601f3d908101601f1916820190925261244791810190613361565b60015b6124a7573d808015612478576040519150601f19603f3d011682016040523d82523d6000602084013e61247d565b606091505b50805160000361249f5760405162461bcd60e51b81526004016106af90613218565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506118be565b506001949350505050565b816001600160a01b0316836001600160a01b03160361252d5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016106af565b6001600160a01b03838116600081815260086020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106125d95772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612605576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061262357662386f26fc10000830492506010015b6305f5e100831061263b576305f5e100830492506008015b612710831061264f57612710830492506004015b60648310612661576064830492506002015b600a831061075d5760010192915050565b60006001600160e01b031982166380ac58cd60e01b14806126a357506001600160e01b03198216635b5e139f60e01b145b8061075d575061075d826127a5565b6000818152600183016020526040812054801561279b5760006126d66001836131a8565b85549091506000906126ea906001906131a8565b905081811461274f57600086600001828154811061270a5761270a612f3b565b906000526020600020015490508087600001848154811061272d5761272d612f3b565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806127605761276061337e565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061075d565b600091505061075d565b600061075d8260006001600160e01b03198216635a05180f60e01b148061075d575061075d8260006001600160e01b03198216637965db0b60e01b148061075d57506301ffc9a760e01b6001600160e01b031983161461075d565b60006020828403121561281257600080fd5b81356001600160401b0381111561282857600080fd5b82016060818503121561100557600080fd5b6001600160e01b03198116811461167a57600080fd5b60006020828403121561286257600080fd5b81356110058161283a565b60005b83811015612888578181015183820152602001612870565b50506000910152565b600081518084526128a981602086016020860161286d565b601f01601f19169290920160200192915050565b6020815260006110056020830184612891565b6000602082840312156128e257600080fd5b5035919050565b80356001600160a01b038116811461290057600080fd5b919050565b6000806040838503121561291857600080fd5b612921836128e9565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156129675761296761292f565b60405290565b604051601f8201601f191681016001600160401b03811182821017156129955761299561292f565b604052919050565b60006001600160401b038211156129b6576129b661292f565b5060051b60200190565b600060208083850312156129d357600080fd5b82356001600160401b03808211156129ea57600080fd5b818501915085601f8301126129fe57600080fd5b8135612a11612a0c8261299d565b61296d565b81815260059190911b83018401908481019088831115612a3057600080fd5b8585015b83811015612b0457803585811115612a4c5760008081fd5b86016040818c03601f1901811315612a645760008081fd5b612a6c612945565b612a778a84016128e9565b81528183013588811115612a8b5760008081fd5b8084019350508c603f840112612aa15760008081fd5b89830135612ab1612a0c8261299d565b81815260059190911b84018301908b8101908f831115612ad15760008081fd5b948401945b82861015612aef5785358252948c0194908c0190612ad6565b838d0152505085525050918601918601612a34565b5098975050505050505050565b600080600060608486031215612b2657600080fd5b612b2f846128e9565b9250612b3d602085016128e9565b9150604084013590509250925092565b60008060408385031215612b6057600080fd5b50508035926020909101359150565b60008060408385031215612b8257600080fd5b82359150612b92602084016128e9565b90509250929050565b6020808252825182820181905260009190848201906040850190845b81811015612bdc5783516001600160a01b031683529284019291840191600101612bb7565b50909695505050505050565b600060208284031215612bfa57600080fd5b611005826128e9565b80356001600160601b038116811461290057600080fd5b600080600060608486031215612c2f57600080fd5b83359250612c3f602085016128e9565b9150612c4d60408501612c03565b90509250925092565b60006001600160401b03831115612c6f57612c6f61292f565b612c82601f8401601f191660200161296d565b9050828152838383011115612c9657600080fd5b828260208301376000602084830101529392505050565b600060208284031215612cbf57600080fd5b81356001600160401b03811115612cd557600080fd5b8201601f81018413612ce657600080fd5b6118be84823560208401612c56565b60008060408385031215612d0857600080fd5b612d11836128e9565b9150612b9260208401612c03565b801515811461167a57600080fd5b60008060408385031215612d4057600080fd5b612d49836128e9565b91506020830135612d5981612d1f565b809150509250929050565b60008083601f840112612d7657600080fd5b5081356001600160401b03811115612d8d57600080fd5b6020830191508360208260051b8501011115610ab557600080fd5b60008060008060608587031215612dbe57600080fd5b84356001600160401b03811115612dd457600080fd5b612de087828801612d64565b9095509350612df39050602086016128e9565b9150612e0160408601612c03565b905092959194509250565b60008060008060808587031215612e2257600080fd5b612e2b856128e9565b9350612e39602086016128e9565b92506040850135915060608501356001600160401b03811115612e5b57600080fd5b8501601f81018713612e6c57600080fd5b612e7b87823560208401612c56565b91505092959194509250565b60008060208385031215612e9a57600080fd5b82356001600160401b03811115612eb057600080fd5b612ebc85828601612d64565b90969095509350505050565b60008060408385031215612edb57600080fd5b612ee4836128e9565b9150612b92602084016128e9565b6000808335601e19843603018112612f0957600080fd5b8301803591506001600160401b03821115612f2357600080fd5b6020019150600581901b3603821315610ab557600080fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201612f7957612f79612f51565b5060010190565b600181811c90821680612f9457607f821691505b602082108103612fb457634e487b7160e01b600052602260045260246000fd5b50919050565b600060208284031215612fcc57600080fd5b815161100581612d1f565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b808202811582820484141761075d5761075d612f51565b60008261305857634e487b7160e01b600052601260045260246000fd5b500490565b60008161306c5761306c612f51565b506000190190565b601f82111561097f57600081815260208120601f850160051c8101602086101561309b5750805b601f850160051c820191505b81811015611248578281556001016130a7565b81516001600160401b038111156130d3576130d361292f565b6130e7816130e18454612f80565b84613074565b602080601f83116001811461311c57600084156131045750858301515b600019600386901b1c1916600185901b178555611248565b600085815260208120601f198616915b8281101561314b5788860151825594840194600190910190840161312c565b50858210156131695787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000835161318b81846020880161286d565b83519083019061319f81836020880161286d565b01949350505050565b8181038181111561075d5761075d612f51565b8082018082111561075d5761075d612f51565b6020808252602a908201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646040820152692073616c65507269636560b01b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516132a281601785016020880161286d565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516132d381602884016020880161286d565b01602801949350505050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061335790830184612891565b9695505050505050565b60006020828403121561337357600080fd5b81516110058161283a565b634e487b7160e01b600052603160045260246000fdfea264697066735822122006573083b437fa58c9681635170d4942384661ed89edd9510c0e1a1d6b4237d564736f6c63430008110033";class C8 extends Vf{constructor(...e){e.length>1?super(...e):super(I8,x8,e[0])}deploy(e,t,n,r,i,a,o,s,u){return super.deploy(e,t,n,r,i,a,o,s,u||{})}getDeployTransaction(e,t,n,r,i,a,o,s,u){return super.getDeployTransaction(e,t,n,r,i,a,o,s,u||{})}attach(e){return super.attach(e)}connect(e){return super.connect(e)}static bytecode=x8;static abi=I8;static createInterface(){return new os(I8)}static connect(e,t){return new Hf(e,I8,t)}}var M8=Object.freeze({__proto__:null,ERC20:class{contract;constructor(e){const t=new R8;this.contract=t.attach(e)}async totalSupply(e,t={}){return this.contract.connect(e).totalSupply(t)}async balanceOf(e,t,n={}){return this.contract.connect(e).balanceOf(t,n)}async allowance(e,t,n,r={}){return this.contract.connect(e).allowance(t,n,r)}async populateTransfer(e,t,n){return this.contract.populateTransaction.transfer(e,t,n)}async populateApprove(e,t,n={}){return this.contract.populateTransaction.approve(e,t,n)}async populateTransferFrom(e,t,n,r={}){return this.contract.populateTransaction.transferFrom(e,t,n,r)}}});var N8=Object.freeze({__proto__:null,ERC721HybridPermissionedMintable:class{contract;constructor(e){const t=new O8;this.contract=t.attach(e)}async DEFAULT_ADMIN_ROLE(e,t={}){return await this.contract.connect(e).DEFAULT_ADMIN_ROLE(t)}async MINTER_ROLE(e,t={}){return await this.contract.connect(e).MINTER_ROLE(t)}async balanceOf(e,t,n={}){return await this.contract.connect(e).balanceOf(t,n)}async baseURI(e,t={}){return await this.contract.connect(e).baseURI(t)}async contractURI(e,t={}){return await this.contract.connect(e).contractURI(t)}async getAdmins(e,t={}){return await this.contract.connect(e).getAdmins(t)}async getApproved(e,t,n={}){return await this.contract.connect(e).getApproved(t,n)}async getRoleAdmin(e,t,n={}){return await this.contract.connect(e).getRoleAdmin(t,n)}async getRoleMember(e,t,n,r={}){return await this.contract.connect(e).getRoleMember(t,n,r)}async getRoleMemberCount(e,t,n={}){return await this.contract.connect(e).getRoleMemberCount(t,n)}async hasRole(e,t,n,r={}){return await this.contract.connect(e).hasRole(t,n,r)}async isApprovedForAll(e,t,n,r={}){return await this.contract.connect(e).isApprovedForAll(t,n,r)}async name(e,t={}){return await this.contract.connect(e).name(t)}async ownerOf(e,t,n={}){return await this.contract.connect(e).ownerOf(t,n)}async royaltyAllowlist(e,t={}){return await this.contract.connect(e).royaltyAllowlist(t)}async royaltyInfo(e,t,n,r={}){return await this.contract.connect(e).royaltyInfo(t,n,r)}async symbol(e,t={}){return await this.contract.connect(e).symbol(t)}async tokenURI(e,t,n={}){return await this.contract.connect(e).tokenURI(t,n)}async totalSupply(e,t={}){return await this.contract.connect(e).totalSupply(t)}async populateApprove(e,t,n={}){return await this.contract.populateTransaction.approve(e,t,n)}async populateBurn(e,t={}){return await this.contract.populateTransaction.burn(e,t)}async populateBurnBatch(e,t={}){return await this.contract.populateTransaction.burnBatch(e,t)}async populateGrantMinterRole(e,t={}){return await this.contract.populateTransaction.grantMinterRole(e,t)}async populateGrantRole(e,t,n={}){return await this.contract.populateTransaction.grantRole(e,t,n)}async populateMintByID(e,t,n={}){return await this.contract.populateTransaction.mintByID(e,t,n)}async populateSafeMintByID(e,t,n={}){return await this.contract.populateTransaction.safeMintByID(e,t,n)}async populateMintByQuantity(e,t,n={}){return await this.contract.populateTransaction.mintByQuantity(e,t,n)}async populateSafeMintByQuantity(e,t,n={}){return await this.contract.populateTransaction.safeMintByQuantity(e,t,n)}async populateBatchMintByQuantity(e,t={}){return await this.contract.populateTransaction.batchMintByQuantity(e,t)}async populateBatchSafeMintByQuantity(e,t={}){return await this.contract.populateTransaction.batchSafeMintByQuantity(e,t)}async populateBatchMintByIDToMultiple(e,t={}){return await this.contract.populateTransaction.batchMintByIDToMultiple(e,t)}async populateBatchSafeMintByIDToMultiple(e,t={}){return await this.contract.populateTransaction.batchSafeMintByIDToMultiple(e,t)}async populateRenounceRole(e,t,n={}){return await this.contract.populateTransaction.renounceRole(e,t,n)}async populateRevokeMinterRole(e,t={}){return await this.contract.populateTransaction.revokeMinterRole(e,t)}async populateRevokeRole(e,t,n={}){return await this.contract.populateTransaction.revokeRole(e,t,n)}async populateSafeTransferFromBatch(e,t={}){return await this.contract.populateTransaction.safeTransferFromBatch(e,t)}async"populateSafeTransferFrom(address,address,uint256)"(e,t,n,r={}){return await this.contract.populateTransaction["safeTransferFrom(address,address,uint256)"](e,t,n,r)}async"populateSafeTransferFrom(address,address,uint256,bytes)"(e,t,n,r,i={}){return await this.contract.populateTransaction["safeTransferFrom(address,address,uint256,bytes)"](e,t,n,r,i)}async populateSetApprovalForAll(e,t,n={}){return await this.contract.populateTransaction.setApprovalForAll(e,t,n)}async populateSetBaseURI(e,t={}){return await this.contract.populateTransaction.setBaseURI(e,t)}async populateSetContractURI(e,t={}){return await this.contract.populateTransaction.setContractURI(e,t)}async populateSetDefaultRoyaltyReceiver(e,t,n={}){return await this.contract.populateTransaction.setDefaultRoyaltyReceiver(e,t,n)}async populateSetNFTRoyaltyReceiver(e,t,n,r={}){return await this.contract.populateTransaction.setNFTRoyaltyReceiver(e,t,n,r)}async populateSetNFTRoyaltyReceiverBatch(e,t,n,r={}){return await this.contract.populateTransaction.setNFTRoyaltyReceiverBatch(e,t,n,r)}async populateSetRoyaltyAllowlistRegistry(e,t={}){return await this.contract.populateTransaction.setRoyaltyAllowlistRegistry(e,t)}}});var P8=Object.freeze({__proto__:null,ERC721PermissionedMintable:class{contract;constructor(e){const t=new C8;this.contract=t.attach(e)}async DEFAULT_ADMIN_ROLE(e,t={}){return await this.contract.connect(e).DEFAULT_ADMIN_ROLE(t)}async MINTER_ROLE(e,t={}){return await this.contract.connect(e).MINTER_ROLE(t)}async balanceOf(e,t,n={}){return await this.contract.connect(e).balanceOf(t,n)}async baseURI(e,t={}){return await this.contract.connect(e).baseURI(t)}async contractURI(e,t={}){return await this.contract.connect(e).contractURI(t)}async getAdmins(e,t={}){return await this.contract.connect(e).getAdmins(t)}async getApproved(e,t,n={}){return await this.contract.connect(e).getApproved(t,n)}async getRoleAdmin(e,t,n={}){return await this.contract.connect(e).getRoleAdmin(t,n)}async getRoleMember(e,t,n,r={}){return await this.contract.connect(e).getRoleMember(t,n,r)}async getRoleMemberCount(e,t,n={}){return await this.contract.connect(e).getRoleMemberCount(t,n)}async hasRole(e,t,n,r={}){return await this.contract.connect(e).hasRole(t,n,r)}async isApprovedForAll(e,t,n,r={}){return await this.contract.connect(e).isApprovedForAll(t,n,r)}async name(e,t={}){return await this.contract.connect(e).name(t)}async ownerOf(e,t,n={}){return await this.contract.connect(e).ownerOf(t,n)}async royaltyAllowlist(e,t={}){return await this.contract.connect(e).royaltyAllowlist(t)}async royaltyInfo(e,t,n,r={}){return await this.contract.connect(e).royaltyInfo(t,n,r)}async symbol(e,t={}){return await this.contract.connect(e).symbol(t)}async tokenURI(e,t,n={}){return await this.contract.connect(e).tokenURI(t,n)}async totalSupply(e,t={}){return await this.contract.connect(e).totalSupply(t)}async populateApprove(e,t,n={}){return await this.contract.populateTransaction.approve(e,t,n)}async populateBurn(e,t={}){return await this.contract.populateTransaction.burn(e,t)}async populateBurnBatch(e,t={}){return await this.contract.populateTransaction.burnBatch(e,t)}async populateGrantMinterRole(e,t={}){return await this.contract.populateTransaction.grantMinterRole(e,t)}async populateGrantRole(e,t,n={}){return await this.contract.populateTransaction.grantRole(e,t,n)}async populateMint(e,t,n={}){return await this.contract.populateTransaction.mint(e,t,n)}async populateSafeMintBatch(e,t={}){return await this.contract.populateTransaction.safeMintBatch(e,t)}async populateRenounceRole(e,t,n={}){return await this.contract.populateTransaction.renounceRole(e,t,n)}async populateRevokeMinterRole(e,t={}){return await this.contract.populateTransaction.revokeMinterRole(e,t)}async populateRevokeRole(e,t,n={}){return await this.contract.populateTransaction.revokeRole(e,t,n)}async populateSafeTransferFromBatch(e,t={}){return await this.contract.populateTransaction.safeTransferFromBatch(e,t)}async"populateSafeTransferFrom(address,address,uint256)"(e,t,n,r={}){return await this.contract.populateTransaction["safeTransferFrom(address,address,uint256)"](e,t,n,r)}async"populateSafeTransferFrom(address,address,uint256,bytes)"(e,t,n,r,i={}){return await this.contract.populateTransaction["safeTransferFrom(address,address,uint256,bytes)"](e,t,n,r,i)}async populateSetApprovalForAll(e,t,n={}){return await this.contract.populateTransaction.setApprovalForAll(e,t,n)}async populateSetBaseURI(e,t={}){return await this.contract.populateTransaction.setBaseURI(e,t)}async populateSetContractURI(e,t={}){return await this.contract.populateTransaction.setContractURI(e,t)}async populateSetDefaultRoyaltyReceiver(e,t,n={}){return await this.contract.populateTransaction.setDefaultRoyaltyReceiver(e,t,n)}async populateSetNFTRoyaltyReceiver(e,t,n,r={}){return await this.contract.populateTransaction.setNFTRoyaltyReceiver(e,t,n,r)}async populateSetNFTRoyaltyReceiverBatch(e,t,n,r={}){return await this.contract.populateTransaction.setNFTRoyaltyReceiverBatch(e,t,n,r)}async populateSetRoyaltyAllowlistRegistry(e,t={}){return await this.contract.populateTransaction.setRoyaltyAllowlistRegistry(e,t)}}});e.blockchainData=It,e.checkoutSdk=U2,e.checkoutWidgets=E8,e.config=r,e.erc20=M8,e.erc721HybridPermissionedMintable=N8,e.erc721PermissionedMintable=P8,e.immutablexClient=IP,e.orderbook=NK,e.passport=Vq,e.provider=hW}));
|
|
85
85
|
//# sourceMappingURL=index.browser.js.map
|