ckpay-sdk
Version:
CkPay SDK for Internet Computer payment processing - a decentralized payment solution with multi-token support, modal integration, and subscription management.
2 lines • 653 kB
JavaScript
/*! For license information please see cdkPay.js.LICENSE.txt */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.cdkPay=t():e.cdkPay=t()}(self,()=>(()=>{var __webpack_modules__={20:(e,t,n)=>{"use strict";var r=n(540),i=Symbol.for("react.element"),o=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function A(e,t,n){var r,A={},l=null,u=null;for(r in void 0!==n&&(l=""+n),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(u=t.ref),t)o.call(t,r)&&!s.hasOwnProperty(r)&&(A[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===A[r]&&(A[r]=t[r]);return{$$typeof:i,type:e,key:l,ref:u,props:A,_owner:a.current}}t.jsx=A,t.jsxs=A},57:(e,t,n)=>{"use strict";n.r(t),n.d(t,{encodePath:()=>u,request:()=>l});var r=n(664),i=n(336),o=n(857),a=n(151),s=n(957),A=n(358);const l=async e=>{const{canisterId:t,agent:n,paths:r}=e,i=[...new Set(r)],s=i.map(e=>u(e,t)),A=new Map,l=i.map((e,r)=>(async()=>{var l;try{const o=await n.readState(t,{paths:[s[r]]}),l=(await a.us.create({certificate:o.certificate,rootKey:n.rootKey,canisterId:t})).lookup(u(i[r],t));if(l)switch(e){case"time":A.set(e,f(l));break;case"controllers":A.set(e,p(l));break;case"module_hash":A.set(e,c(l));break;case"candid":A.set(e,(new TextDecoder).decode(l));break;default:if("string"!=typeof e&&"key"in e&&"path"in e)switch(e.decodeStrategy){case"raw":A.set(e.key,l);break;case"leb128":A.set(e.key,g(l));break;case"cbor":A.set(e.key,h(l));break;case"hex":A.set(e.key,c(l));break;case"utf-8":A.set(e.key,d(l))}}else console.warn(`Expected to find result for path ${e}, but instead found nothing.`),"string"==typeof e?A.set(e,null):A.set(e.key,null)}catch(t){if(null===(l=null==t?void 0:t.message)||void 0===l?void 0:l.includes("Invalid certificate"))throw new o.Y(t.message);"string"!=typeof e&&"key"in e&&"path"in e?A.set(e.key,null):A.set(e,null),console.group(),console.warn(`Expected to find result for path ${e}, but instead found nothing.`),console.warn(t),console.groupEnd()}})());return await Promise.all(l),A},u=(e,t)=>{const n=new TextEncoder,r=e=>new DataView(n.encode(e).buffer).buffer,i=new DataView(t.toUint8Array().buffer).buffer;switch(e){case"time":return[r("time")];case"controllers":return[r("canister"),i,r("controllers")];case"module_hash":return[r("canister"),i,r("module_hash")];case"subnet":return[r("subnet")];case"candid":return[r("canister"),i,r("metadata"),r("candid:service")];default:if("key"in e&&"path"in e){if("string"==typeof e.path||e.path instanceof ArrayBuffer){const t=e.path,n="string"==typeof t?r(t):t;return[r("canister"),i,r("metadata"),n]}return e.path}}throw new Error(`An unexpeected error was encountered while encoding your path for canister status. Please ensure that your path, ${e} was formatted correctly.`)},c=e=>(0,s.nj)(e),g=e=>(0,r.Ui)(new r.Ki(e)),h=e=>A.D4(e),d=e=>(new TextDecoder).decode(e),f=e=>{const t=g(e);return new Date(Number(t/BigInt(1e6)))},p=e=>{const[t,...n]=h(e);return n.map(e=>i.p.fromUint8Array(new Uint8Array(e)))}},80:(e,t,n)=>{"use strict";const r=n(729),i=r.MT,o=r.SIMPLE,a=r.SYMS;class s{constructor(e){if("number"!=typeof e)throw new Error("Invalid Simple type: "+typeof e);if(e<0||e>255||(0|e)!==e)throw new Error("value must be a small positive integer: "+e);this.value=e}toString(){return"simple("+this.value+")"}inspect(){return"simple("+this.value+")"}encodeCBOR(e){return e._pushInt(this.value,i.SIMPLE_FLOAT)}static isSimple(e){return e instanceof s}static decode(e,t){switch(null==t&&(t=!0),e){case o.FALSE:return!1;case o.TRUE:return!0;case o.NULL:return t?null:a.NULL;case o.UNDEFINED:return t?void 0:a.UNDEFINED;case-1:if(!t)throw new Error("Invalid BREAK");return a.BREAK;default:return new s(e)}}}e.exports=s},141:(e,t,n)=>{"use strict";n.d(t,{Gb:()=>u,tW:()=>s});var r=n(664),i=n(516),o=n(312),a=n(957);function s(e){return o.sha256.create().update(new Uint8Array(e)).arrayBuffer()}function A(e){if(e instanceof i.Tagged)return A(e.value);if("string"==typeof e)return l(e);if("number"==typeof e)return s((0,r.kk)(e));if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return s(e);if(Array.isArray(e)){const t=e.map(A);return s((0,a.xW)(...t))}if(e&&"object"==typeof e&&e._isPrincipal)return s(e.toUint8Array());if("object"==typeof e&&null!==e&&"function"==typeof e.toHash)return A(e.toHash());if("bigint"==typeof e)return s((0,r.kk)(e));throw Object.assign(new Error(`Attempt to hash a value of unsupported type: ${e}`),{value:e})}const l=e=>s((new TextEncoder).encode(e));function u(e){const t=Object.entries(e).filter(([,e])=>void 0!==e).map(([e,t])=>[l(e),A(t)]).sort(([e],[t])=>(0,a.UD)(e,t));return s((0,a.xW)(...t.map(e=>(0,a.xW)(...e))))}},151:(e,t,n)=>{"use strict";n.d(t,{us:()=>c});var r=n(358),i=n(857),o=n(141),a=n(957),s=n(336),A=n(554);class l extends i.Y{constructor(e){super(`Invalid certificate: ${e}`)}}function u(e,t){if(e.byteLength!==t.byteLength)return!1;const n=new Uint8Array(e),r=new Uint8Array(t);for(let e=0;e<n.length;e++)if(n[e]!==r[e])return!1;return!0}class c{constructor(e,t,n,i){this._rootKey=t,this._canisterId=n,this._blsVerify=i,this.cert=r.D4(new Uint8Array(e))}static async create(e){let t=e.blsVerify;t||(t=A.r);const n=new c(e.certificate,e.rootKey,e.canisterId,t);return await n.verify(),n}lookup(e){return p(e,this.cert.tree)}async verify(){const e=await d(this.cert.tree),t=await this._checkDelegationAndGetKey(this.cert.delegation),n=this.cert.signature,r=function(e){const t=g.byteLength+h;if(e.byteLength!==t)throw new TypeError(`BLS DER-encoded public key must be ${t} bytes long`);const n=e.slice(0,g.byteLength);if(!u(n,g))throw new TypeError(`BLS DER-encoded public key is invalid. Expect the following prefix: ${g}, but get ${n}`);return e.slice(g.byteLength)}(t),i=(0,a.xW)(f("ic-state-root"),e);let o=!1;try{o=await this._blsVerify(new Uint8Array(r),new Uint8Array(n),new Uint8Array(i))}catch(e){o=!1}if(!o)throw new l("Signature verification failed")}async _checkDelegationAndGetKey(e){if(!e)return this._rootKey;const t=await c.create({certificate:e.certificate,rootKey:this._rootKey,canisterId:this._canisterId}),n=t.lookup(["subnet",e.subnet_id,"canister_ranges"]);if(!n)throw new l(`Could not find canister ranges for subnet 0x${(0,a.nj)(e.subnet_id)}`);if(!r.D4(n).map(e=>[s.p.fromUint8Array(e[0]),s.p.fromUint8Array(e[1])]).some(e=>e[0].ltEq(this._canisterId)&&e[1].gtEq(this._canisterId)))throw new l(`Canister ${this._canisterId} not in range of delegations for subnet 0x${(0,a.nj)(e.subnet_id)}`);const i=t.lookup(["subnet",e.subnet_id,"public_key"]);if(!i)throw new Error(`Could not find subnet key for subnet 0x${(0,a.nj)(e.subnet_id)}`);return i}}const g=(0,a.aD)("308182301d060d2b0601040182dc7c0503010201060c2b0601040182dc7c05030201036100"),h=96;async function d(e){switch(e[0]){case 0:return(0,o.tW)(f("ic-hashtree-empty"));case 4:return e[1];case 3:return(0,o.tW)((0,a.xW)(f("ic-hashtree-leaf"),e[1]));case 2:return(0,o.tW)((0,a.xW)(f("ic-hashtree-labeled"),e[1],await d(e[2])));case 1:return(0,o.tW)((0,a.xW)(f("ic-hashtree-fork"),await d(e[1]),await d(e[2])));default:throw new Error("unreachable")}}function f(e){const t=new Uint8Array([e.length]),n=(new TextEncoder).encode(e);return(0,a.xW)(t,n)}function p(e,t){if(0===e.length)return 3===t[0]?new Uint8Array(t[1]).buffer:void 0;const n=function(e,t){if(0!==t.length)for(const n of t)if(2===n[0]&&u(e,n[1]))return n[2]}("string"==typeof e[0]?(new TextEncoder).encode(e[0]):e[0],m(t));return n?p(e.slice(1),n):void 0}function m(e){switch(e[0]){case 0:return[];case 1:return m(e[1]).concat(m(e[2]));default:return[e]}}},205:(e,t,n)=>{"use strict";const{Buffer:r}=n(279),i=n(594).BigNumber,o=n(729),a=o.SHIFT32,s=o.SHIFT16;function A(e){return e<16?"0"+e.toString(16):e.toString(16)}t.parseHalf=function(e){var t,n,r;return r=128&e[0]?-1:1,t=(124&e[0])>>2,n=(3&e[0])<<8|e[1],t?31===t?r*(n?NaN:1/0):r*Math.pow(2,t-25)*(1024+n):5.960464477539063e-8*r*n},t.arrayBufferToBignumber=function(e){const t=e.byteLength;let n="";for(let r=0;r<t;r++)n+=A(e[r]);return new i(n,16)},t.buildMap=e=>{const t=new Map,n=Object.keys(e),r=n.length;for(let i=0;i<r;i++)t.set(n[i],e[n[i]]);return t},t.buildInt32=(e,t)=>e*s+t,t.buildInt64=(e,n,r,o)=>{const s=t.buildInt32(e,n),A=t.buildInt32(r,o);return s>2097151?new i(s).times(a).plus(A):s*a+A},t.writeHalf=function(e,t){const n=r.allocUnsafe(4);n.writeFloatBE(t,0);const i=n.readUInt32BE(0);if(8191&i)return!1;var o=i>>16&32768;const a=i>>23&255,s=8388607&i;if(a>=113&&a<=142)o+=(a-112<<10)+(s>>13);else{if(!(a>=103&&a<113))return!1;if(s&(1<<126-a)-1)return!1;o+=s+8388608>>126-a}return e.writeUInt16BE(o,0),!0},t.keySorter=function(e,t){var n=e[0].byteLength,r=t[0].byteLength;return n>r?1:r>n?-1:e[0].compare(t[0])},t.isNegativeZero=e=>0===e&&1/e<0,t.nextPowerOf2=e=>{let t=0;if(e&&!(e&e-1))return e;for(;0!==e;)e>>=1,t+=1;return 1<<t}},251:(e,t)=>{t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,A=(1<<s)-1,l=A>>1,u=-7,c=n?i-1:0,g=n?-1:1,h=e[t+c];for(c+=g,o=h&(1<<-u)-1,h>>=-u,u+=s;u>0;o=256*o+e[t+c],c+=g,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=r;u>0;a=256*a+e[t+c],c+=g,u-=8);if(0===o)o=1-l;else{if(o===A)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),o-=l}return(h?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,A,l=8*o-i-1,u=(1<<l)-1,c=u>>1,g=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,d=r?1:-1,f=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(A=Math.pow(2,-a))<1&&(a--,A*=2),(t+=a+c>=1?g/A:g*Math.pow(2,1-c))*A>=2&&(a++,A/=2),a+c>=u?(s=0,a=u):a+c>=1?(s=(t*A-1)*Math.pow(2,i),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;e[n+h]=255&s,h+=d,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;e[n+h]=255&a,h+=d,a/=256,l-=8);e[n+h-d]|=128*f}},279:(e,t,n)=>{"use strict";var r=n(526),i=n(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=A,t.SlowBuffer=function(e){return+e!=e&&(e=0),A.alloc(+e)},t.INSPECT_MAX_BYTES=50;var a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,A.prototype),t}function A(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return c(e)}return l(e,t,n)}function l(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!A.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|f(e,t),r=s(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(O(e,Uint8Array)){var t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return g(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(O(e,ArrayBuffer)||e&&O(e.buffer,ArrayBuffer))return h(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(O(e,SharedArrayBuffer)||e&&O(e.buffer,SharedArrayBuffer)))return h(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return A.from(r,t,n);var i=function(e){if(A.isBuffer(e)){var t=0|d(e.length),n=s(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||H(e.length)?s(0):g(e):"Buffer"===e.type&&Array.isArray(e.data)?g(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return A.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return u(e),s(e<0?0:0|d(e))}function g(e){for(var t=e.length<0?0:0|d(e.length),n=s(t),r=0;r<t;r+=1)n[r]=255&e[r];return n}function h(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,A.prototype),r}function d(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function f(e,t){if(A.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||O(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return L(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return P(e).length;default:if(i)return r?-1:L(e).length;t=(""+t).toLowerCase(),i=!0}}function p(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 x(this,t,n);case"utf8":case"utf-8":return b(this,t,n);case"ascii":return _(this,t,n);case"latin1":case"binary":return k(this,t,n);case"base64":return v(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(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),H(n=+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=A.from(t,r)),A.isBuffer(t))return 0===t.length?-1:E(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):E(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function E(e,t,n,r,i){var o,a=1,s=e.length,A=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;a=2,s/=2,A/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var u=-1;for(o=n;o<s;o++)if(l(e,o)===l(t,-1===u?0:o-u)){if(-1===u&&(u=o),o-u+1===A)return u*a}else-1!==u&&(o-=o-u),u=-1}else for(n+A>s&&(n=s-A),o=n;o>=0;o--){for(var c=!0,g=0;g<A;g++)if(l(e,o+g)!==l(t,g)){c=!1;break}if(c)return o}return-1}function B(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(H(s))return a;e[n+a]=s}return a}function I(e,t,n,r){return G(L(t,e.length-n),e,n,r)}function C(e,t,n,r){return G(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function Q(e,t,n,r){return G(P(t),e,n,r)}function w(e,t,n,r){return G(function(e,t){for(var n,r,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)r=(n=e.charCodeAt(a))>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function v(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function b(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,a,s,A,l=e[i],u=null,c=l>239?4:l>223?3:l>191?2:1;if(i+c<=n)switch(c){case 1:l<128&&(u=l);break;case 2:128==(192&(o=e[i+1]))&&(A=(31&l)<<6|63&o)>127&&(u=A);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(A=(15&l)<<12|(63&o)<<6|63&a)>2047&&(A<55296||A>57343)&&(u=A);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(A=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&A<1114112&&(u=A)}null===u?(u=65533,c=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),i+=c}return function(e){var t=e.length;if(t<=S)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=S));return n}(r)}t.kMaxLength=a,A.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),A.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(A.prototype,"parent",{enumerable:!0,get:function(){if(A.isBuffer(this))return this.buffer}}),Object.defineProperty(A.prototype,"offset",{enumerable:!0,get:function(){if(A.isBuffer(this))return this.byteOffset}}),A.poolSize=8192,A.from=function(e,t,n){return l(e,t,n)},Object.setPrototypeOf(A.prototype,Uint8Array.prototype),Object.setPrototypeOf(A,Uint8Array),A.alloc=function(e,t,n){return function(e,t,n){return u(e),e<=0?s(e):void 0!==t?"string"==typeof n?s(e).fill(t,n):s(e).fill(t):s(e)}(e,t,n)},A.allocUnsafe=function(e){return c(e)},A.allocUnsafeSlow=function(e){return c(e)},A.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==A.prototype},A.compare=function(e,t){if(O(e,Uint8Array)&&(e=A.from(e,e.offset,e.byteLength)),O(t,Uint8Array)&&(t=A.from(t,t.offset,t.byteLength)),!A.isBuffer(e)||!A.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},A.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}},A.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return A.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=A.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(O(o,Uint8Array))i+o.length>r.length?A.from(o).copy(r,i):Uint8Array.prototype.set.call(r,o,i);else{if(!A.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i)}i+=o.length}return r},A.byteLength=f,A.prototype._isBuffer=!0,A.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)m(this,t,t+1);return this},A.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)m(this,t,t+3),m(this,t+1,t+2);return this},A.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)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},A.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?b(this,0,e):p.apply(this,arguments)},A.prototype.toLocaleString=A.prototype.toString,A.prototype.equals=function(e){if(!A.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===A.compare(this,e)},A.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},o&&(A.prototype[o]=A.prototype.inspect),A.prototype.compare=function(e,t,n,r,i){if(O(e,Uint8Array)&&(e=A.from(e,e.offset,e.byteLength)),!A.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);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 o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(r,i),u=e.slice(t,n),c=0;c<s;++c)if(l[c]!==u[c]){o=l[c],a=u[c];break}return o<a?-1:a<o?1:0},A.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},A.prototype.indexOf=function(e,t,n){return y(this,e,t,n,!0)},A.prototype.lastIndexOf=function(e,t,n){return y(this,e,t,n,!1)},A.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 o=!1;;)switch(r){case"hex":return B(this,e,t,n);case"utf8":case"utf-8":return I(this,e,t,n);case"ascii":case"latin1":case"binary":return C(this,e,t,n);case"base64":return Q(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},A.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var S=4096;function _(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 k(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 x(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=q[e[o]];return i}function N(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length-1;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function D(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 T(e,t,n,r,i,o){if(!A.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function R(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function F(e,t,n,r,o){return t=+t,n>>>=0,o||R(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function M(e,t,n,r,o){return t=+t,n>>>=0,o||R(e,0,n,8),i.write(e,t,n,r,52,8),n+8}A.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);var r=this.subarray(e,t);return Object.setPrototypeOf(r,A.prototype),r},A.prototype.readUintLE=A.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||D(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},A.prototype.readUintBE=A.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||D(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},A.prototype.readUint8=A.prototype.readUInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),this[e]},A.prototype.readUint16LE=A.prototype.readUInt16LE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]|this[e+1]<<8},A.prototype.readUint16BE=A.prototype.readUInt16BE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]<<8|this[e+1]},A.prototype.readUint32LE=A.prototype.readUInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},A.prototype.readUint32BE=A.prototype.readUInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},A.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||D(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},A.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||D(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},A.prototype.readInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},A.prototype.readInt16LE=function(e,t){e>>>=0,t||D(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},A.prototype.readInt16BE=function(e,t){e>>>=0,t||D(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},A.prototype.readInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},A.prototype.readInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},A.prototype.readFloatLE=function(e,t){return e>>>=0,t||D(e,4,this.length),i.read(this,e,!0,23,4)},A.prototype.readFloatBE=function(e,t){return e>>>=0,t||D(e,4,this.length),i.read(this,e,!1,23,4)},A.prototype.readDoubleLE=function(e,t){return e>>>=0,t||D(e,8,this.length),i.read(this,e,!0,52,8)},A.prototype.readDoubleBE=function(e,t){return e>>>=0,t||D(e,8,this.length),i.read(this,e,!1,52,8)},A.prototype.writeUintLE=A.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||T(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},A.prototype.writeUintBE=A.prototype.writeUIntBE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||T(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},A.prototype.writeUint8=A.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||T(this,e,t,1,255,0),this[t]=255&e,t+1},A.prototype.writeUint16LE=A.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||T(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},A.prototype.writeUint16BE=A.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||T(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},A.prototype.writeUint32LE=A.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||T(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},A.prototype.writeUint32BE=A.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||T(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},A.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);T(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<n&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+n},A.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);T(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+n},A.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||T(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},A.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||T(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},A.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||T(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},A.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||T(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},A.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||T(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},A.prototype.writeFloatLE=function(e,t,n){return F(this,e,t,!0,n)},A.prototype.writeFloatBE=function(e,t,n){return F(this,e,t,!1,n)},A.prototype.writeDoubleLE=function(e,t,n){return M(this,e,t,!0,n)},A.prototype.writeDoubleBE=function(e,t,n){return M(this,e,t,!1,n)},A.prototype.copy=function(e,t,n,r){if(!A.isBuffer(e))throw new TypeError("argument should be a Buffer");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("Index out of range");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=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},A.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),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!A.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){var i=e.charCodeAt(0);("utf8"===r&&i<128||"latin1"===r)&&(e=i)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var a=A.isBuffer(e)?e:A.from(e,r),s=a.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-t;++o)this[o+t]=a[o%s]}return this};var U=/[^+/0-9A-Za-z-_]/g;function L(e,t){var n;t=t||1/0;for(var r=e.length,i=null,o=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.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;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function P(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(U,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(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 O(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function H(e){return e!=e}var q=function(){for(var e="0123456789abcdef",t=new Array(256),n=0;n<16;++n)for(var r=16*n,i=0;i<16;++i)t[r+i]=e[n]+e[i];return t}()},281:()=>{},283:function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(771));const i=r(n(770));t.value=i},287:(e,t)=>{"use strict";var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),A=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),h=Symbol.iterator,d={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f=Object.assign,p={};function m(e,t,n){this.props=e,this.context=t,this.refs=p,this.updater=n||d}function y(){}function E(e,t,n){this.props=e,this.context=t,this.refs=p,this.updater=n||d}m.prototype.isReactComponent={},m.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},m.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=m.prototype;var B=E.prototype=new y;B.constructor=E,f(B,m.prototype),B.isPureReactComponent=!0;var I=Array.isArray,C=Object.prototype.hasOwnProperty,Q={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function v(e,t,r){var i,o={},a=null,s=null;if(null!=t)for(i in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(a=""+t.key),t)C.call(t,i)&&!w.hasOwnProperty(i)&&(o[i]=t[i]);var A=arguments.length-2;if(1===A)o.children=r;else if(1<A){for(var l=Array(A),u=0;u<A;u++)l[u]=arguments[u+2];o.children=l}if(e&&e.defaultProps)for(i in A=e.defaultProps)void 0===o[i]&&(o[i]=A[i]);return{$$typeof:n,type:e,key:a,ref:s,props:o,_owner:Q.current}}function b(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var S=/\/+/g;function _(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function k(e,t,i,o,a){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var A=!1;if(null===e)A=!0;else switch(s){case"string":case"number":A=!0;break;case"object":switch(e.$$typeof){case n:case r:A=!0}}if(A)return a=a(A=e),e=""===o?"."+_(A,0):o,I(a)?(i="",null!=e&&(i=e.replace(S,"$&/")+"/"),k(a,t,i,"",function(e){return e})):null!=a&&(b(a)&&(a=function(e,t){return{$$typeof:n,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(a,i+(!a.key||A&&A.key===a.key?"":(""+a.key).replace(S,"$&/")+"/")+e)),t.push(a)),1;if(A=0,o=""===o?".":o+":",I(e))for(var l=0;l<e.length;l++){var u=o+_(s=e[l],l);A+=k(s,t,i,u,a)}else if(u=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=h&&e[h]||e["@@iterator"])?e:null}(e),"function"==typeof u)for(e=u.call(e),l=0;!(s=e.next()).done;)A+=k(s=s.value,t,i,u=o+_(s,l++),a);else if("object"===s)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return A}function x(e,t,n){if(null==e)return e;var r=[],i=0;return k(e,r,"","",function(e){return t.call(n,e,i++)}),r}function N(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var D={current:null},T={transition:null},R={ReactCurrentDispatcher:D,ReactCurrentBatchConfig:T,ReactCurrentOwner:Q};function F(){throw Error("act(...) is not supported in production builds of React.")}t.Children={map:x,forEach:function(e,t,n){x(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return x(e,function(){t++}),t},toArray:function(e){return x(e,function(e){return e})||[]},only:function(e){if(!b(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=m,t.Fragment=i,t.Profiler=a,t.PureComponent=E,t.StrictMode=o,t.Suspense=u,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=R,t.act=F,t.cloneElement=function(e,t,r){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i=f({},e.props),o=e.key,a=e.ref,s=e._owner;if(null!=t){if(void 0!==t.ref&&(a=t.ref,s=Q.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var A=e.type.defaultProps;for(l in t)C.call(t,l)&&!w.hasOwnProperty(l)&&(i[l]=void 0===t[l]&&void 0!==A?A[l]:t[l])}var l=arguments.length-2;if(1===l)i.children=r;else if(1<l){A=Array(l);for(var u=0;u<l;u++)A[u]=arguments[u+2];i.children=A}return{$$typeof:n,type:e.type,key:o,ref:a,props:i,_owner:s}},t.createContext=function(e){return(e={$$typeof:A,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:s,_context:e},e.Consumer=e},t.createElement=v,t.createFactory=function(e){var t=v.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:l,render:e}},t.isValidElement=b,t.lazy=function(e){return{$$typeof:g,_payload:{_status:-1,_result:e},_init:N}},t.memo=function(e,t){return{$$typeof:c,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=T.transition;T.transition={};try{e()}finally{T.transition=t}},t.unstable_act=F,t.useCallback=function(e,t){return D.current.useCallback(e,t)},t.useContext=function(e){return D.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return D.current.useDeferredValue(e)},t.useEffect=function(e,t){return D.current.useEffect(e,t)},t.useId=function(){return D.current.useId()},t.useImperativeHandle=function(e,t,n){return D.current.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return D.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return D.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return D.current.useMemo(e,t)},t.useReducer=function(e,t,n){return D.current.useReducer(e,t,n)},t.useRef=function(e){return D.current.useRef(e)},t.useState=function(e){return D.current.useState(e)},t.useSyncExternalStore=function(e,t,n){return D.current.useSyncExternalStore(e,t,n)},t.useTransition=function(){return D.current.useTransition()},t.version="18.3.1"},312:(module,exports,__webpack_require__)=>{var process=__webpack_require__(606),__WEBPACK_AMD_DEFINE_RESULT__;(function(){"use strict";var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!root.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS?root=__webpack_require__.g:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&module.exports,AMD=__webpack_require__.amdO,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];!root.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!ARRAY_BUFFER||!root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e,t){return function(n){return new Sha256(t,!0).update(n)[e]()}},createMethod=function(e){var t=createOutputMethod("hex",e);NODE_JS&&(t=nodeWrap(t,e)),t.create=function(){return new Sha256(e)},t.update=function(e){return t.create().update(e)};for(var n=0;n<OUTPUT_TYPES.length;++n){var r=OUTPUT_TYPES[n];t[r]=createOutputMethod(r,e)}return t},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(e){if("string"==typeof e)return crypto.createHash(algorithm).update(e,"utf8").digest("hex");if(null==e)throw new Error(ERROR);return e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),Array.isArray(e)||ArrayBuffer.isView(e)||e.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(e)).digest("hex"):method(e)};return nodeMethod},createHmacOutputMethod=function(e,t){return function(n,r){return new HmacSha256(n,t,!0).update(r)[e]()}},createHmacMethod=function(e){var t=createHmacOutputMethod("hex",e);t.create=function(t){return new HmacSha256(t,e)},t.update=function(e,n){return t.create(e).update(n)};for(var n=0;n<OUTPUT_TYPES.length;++n){var r=OUTPUT_TYPES[n];t[r]=createHmacOutputMethod(r,e)}return t};function Sha256(e,t){t?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=e}function HmacSha256(e,t,n){var r,i=typeof e;if("string"===i){var o,a=[],s=e.length,A=0;for(r=0;r<s;++r)(o=e.charCodeAt(r))<128?a[A++]=o:o<2048?(a[A++]=192|o>>6,a[A++]=128|63&o):o<55296||o>=57344?(a[A++]=224|o>>12,a[A++]=128|o>>6&63,a[A++]=128|63&o):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++r)),a[A++]=240|o>>18,a[A++]=128|o>>12&63,a[A++]=128|o>>6&63,a[A++]=128|63&o);e=a}else{if("object"!==i)throw new Error(ERROR);if(null===e)throw new Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||ARRAY_BUFFER&&ArrayBuffer.isView(e)))throw new Error(ERROR)}e.length>64&&(e=new Sha256(t,!0).update(e).array());var l=[],u=[];for(r=0;r<64;++r){var c=e[r]||0;l[r]=92^c,u[r]=54^c}Sha256.call(this,t,n),this.update(u),this.oKeyPad=l,this.inner=!0,this.sharedMemory=n}Sha256.prototype.update=function(e){if(!this.finalized){var t,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(ERROR);if(null===e)throw new Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||ARRAY_BUFFER&&ArrayBuffer.isView(e)))throw new Error(ERROR);t=!0}for(var r,i,o=0,a=e.length,s=this.blocks;o<a;){if(this.hashed&&(this.hashed=!1,s[0]=this.block,s[16]=s[1]=s[2]=s[3]=s[4]=s[5]=s[6]=s[7]=s[8]=s[9]=s[10]=s[11]=s[12]=s[13]=s[14]=s[15]=0),t)for(i=this.start;o<a&&i<64;++o)s[i>>2]|=e[o]<<SHIFT[3&i++];else for(i=this.start;o<a&&i<64;++o)(r=e.charCodeAt(o))<128?s[i>>2]|=r<<SHIFT[3&i++]:r<2048?(s[i>>2]|=(192|r>>6)<<SHIFT[3&i++],s[i>>2]|=(128|63&r)<<SHIFT[3&i++]):r<55296||r>=57344?(s[i>>2]|=(224|r>>12)<<SHIFT[3&i++],s[i>>2]|=(128|r>>6&63)<<SHIFT[3&i++],s[i>>2]|=(128|63&r)<<SHIFT[3&i++]):(r=65536+((1023&r)<<10|1023&e.charCodeAt(++o)),s[i>>2]|=(240|r>>18)<<SHIFT[3&i++],s[i>>2]|=(128|r>>12&63)<<SHIFT[3&i++],s[i>>2]|=(128|r>>6&63)<<SHIFT[3&i++],s[i>>2]|=(128|63&r)<<SHIFT[3&i++]);this.lastByteIndex=i,this.bytes+=i-this.start,i>=64?(this.block=s[16],this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>2]|=EXTRA[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var e,t,n,r,i,o,a,s,A,l=this.h0,u=this.h1,c=this.h2,g=this.h3,h=this.h4,d=this.h5,f=this.h6,p=this.h7,m=this.blocks;for(e=16;e<64;++e)t=((i=m[e-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,n=((i=m[e-2])>>>17|i<<15)^(i>>>19|i<<13)^i>>>10,m[e]=m[e-16]+t+m[e-7]+n|0;for(A=u&c,e=0;e<64;e+=4)this.first?(this.is224?(o=300032,p=(i=m[0]-1413257819)-150054599|0,g=i+24177077|0):(o=704751109,p=(i=m[0]-210244248)-1521486534|0,g=i+143694565|0),this.first=!1):(t=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),r=(o=l&u)^l&c^A,p=g+(i=p+(n=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&d^~h&f)+K[e]+m[e])|0,g=i+(t+r)|0),t=(g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10),r=(a=g&l)^g&u^o,f=c+(i=f+(n=(p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&h^~p&d)+K[e+1]+m[e+1])|0,t=((c=i+(t+r)|0)>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),r=(s=c&g)^c&l^a,d=u+(i=d+(n=(f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(f&p^~f&h)+K[e+2]+m[e+2])|0,t=((u=i+(t+r)|0)>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),r=(A=u&c)^u&g^s,h=l+(i=h+(n=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(d&f^~d&p)+K[e+3]+m[e+3])|0,l=i+(t+r)|0;this.h0=this.h0+l|0,this.h1=this.h1+u|0,this.h2=this.h2+c|0,this.h3=this.h3+g|0,this.h4=this.h4+h|0,this.h5=this.h5+d|0,this.h6=this.h6+f|0,this.h7=this.h7+p|0},Sha256.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4,o=this.h5,a=this.h6,s=this.h7,A=HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[15&o]+HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[15&a];return this.is224||(A+=HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[15&s]),A},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4,o=this.h5,a=this.h6,s=this.h7,A=[e>>24&255,e>>16&255,e>>8&255,255&e,t>>24&255,t>>16&255,t>>8&255,255&t,n>>24&255,n>>16&255,n>>8&255,255&n,r>>24&255,r>>16&255,r>>8&255,255&r,i>>24&255,i>>16&255,i>>8&255,255&i,o>>24&255,o>>16&255,o>>8&255,255&o,a>>24&255,a>>16&255,a>>8&255,255&a];return this.is224||A.push(s>>24&255,s>>16&255,s>>8&255,255&s),A},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))})()},316:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AuthClient:()=>Z,ERROR_USER_INTERRUPT:()=>X,IdbKeyVal:()=>Y,IdbStorage:()=>z,IdleManager:()=>b,KEY_STORAGE_DELEGATION:()=>j,KEY_STORAGE_KEY:()=>J,LocalStorage:()=>K});var r=n(977),i=n(947);function o(e){var t;return new Uint8Array((null!==(t=e.match(/.{1,2}/g))&&void 0!==t?t:[]).map(e=>parseInt(e,16))).buffer}function a(e){return new Uint8Array(e).reduce((e,t)=>e+t.toString(16).padStart(2,"0"),"")}const s=e=>{if(e<=127)return 1;if(e<=255)return 2;if(e<=65535)return 3;if(e<=16777215)return 4;throw new Error("Length too long (> 4 bytes)")},A=(e,t,n)=>{if(n<=127)return e[t]=n,1;if(n<=255)return e[t]=129,e[t+1]=n,2;if(n<=65535)return e[t]=130,e[t+1]=n>>8,e[t+2]=n,3;if(n<=16777215)return e[t]=131,e[t+1]=n>>16,e[t+2]=n>>8,e[t+3]=n,4;throw new Error("Length too long (> 4 bytes)")},l=(e,t)=>{if(e[t]<128)return 1;if(128===e[t])throw new Error("Invalid length 0");if(129===e[t])return 2;if(130===e[t])return 3;if(131===e[t])return 4;throw new Error("Length too long (> 4 bytes)")},u=(Uint8Array.from([48,12,6,10,43,6,1,4,1,131,184,67,1,1]),Uint8Array.from([48,5,6,3,43,101,112]));Uint8Array.from([48,16,6,7,42,134,72,206,61,2,1,6,5,43,129,4,0,10]);class c{constructor(e){this.rawKey=e,this.derKey=c.derEncode(e)}static from(e){return this.fromDer(e.toDer())}static fromRaw(e){return new c(e)}static fromDer(e){return new c(this.derDecode(e))}static derEncode(e){return function(e,t){const n=2+s(e.byteLength+1),r=t.byteLength+n+e.byteLength;let i=0;const o=new Uint8Array(1+s(r)+r);return o[i++]=48,i+=A(o,i,r),o.set(t,i),i+=t.byteLength,o[i++]=3,i+=A(o,i,e.byteLength+1),o[i++]=0,o.set(new Uint8Array(e),i),o}(e,u).buffer}static derDecode(e){const t=((e,t)=>{let n=0;const r=(e,t)=>{if(i[n++]!==e)throw new Error("Expected: "+t)},i=new Uint8Array(e);if(r(48,"sequence"),n+=l(i,n),!((e,t)=>{if(e.byteLength!==t.byteLength)return!1;const n=new Uint8Array(e),r=new Uint8Array(t);for(let e=0;e<n.length;e++)if(n[e]!==r[e])return!1;return!0})(i.slice(n,n+t.byteLength),t))throw new Error("Not t