@rechargeapps/storefront-client 1.3.1 → 1.3.2
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.
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
// recharge-client-1.3.
|
|
2
|
-
(function($e,vr){typeof exports=="object"&&typeof module<"u"?module.exports=vr():typeof define=="function"&&define.amd?define(vr):($e=typeof globalThis<"u"?globalThis:$e||self,$e.recharge=vr())})(this,function(){"use strict";var $e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vr(e){var r=e.default;if(typeof r=="function"){var t=function(){return r.apply(this,arguments)};t.prototype=r.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}),t}var Z=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Z<"u"&&Z,ne={searchParams:"URLSearchParams"in Z,iterable:"Symbol"in Z&&"iterator"in Symbol,blob:"FileReader"in Z&&"Blob"in Z&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in Z,arrayBuffer:"ArrayBuffer"in Z};function
|
|
3
|
-
`)===0?n.substr(1,n.length):n}).forEach(function(n){var a=n.split(":"),s=a.shift().trim();if(s){var c=a.join(":").trim();r.append(s,c)}}),r}ri.call(Le.prototype);function de(e,r){if(!(this instanceof de))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');r||(r={}),this.type="default",this.status=r.status===void 0?200:r.status,this.ok=this.status>=200&&this.status<300,this.statusText=r.statusText===void 0?"":""+r.statusText,this.headers=new W(r.headers),this.url=r.url||"",this._initBody(e)}ri.call(de.prototype),de.prototype.clone=function(){return new de(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new W(this.headers),url:this.url})},de.error=function(){var e=new de(null,{status:0,statusText:""});return e.type="error",e};var Gs=[301,302,303,307,308];de.redirect=function(e,r){if(Gs.indexOf(r)===-1)throw new RangeError("Invalid status code");return new de(null,{status:r,headers:{location:e}})};var je=Z.DOMException;try{new je}catch{je=function(r,t){this.message=r,this.name=t;var n=Error(r);this.stack=n.stack},je.prototype=Object.create(Error.prototype),je.prototype.constructor=je}function ti(e,r){return new Promise(function(t,n){var a=new Le(e,r);if(a.signal&&a.signal.aborted)return n(new je("Aborted","AbortError"));var s=new XMLHttpRequest;function c(){s.abort()}s.onload=function(){var h={status:s.status,statusText:s.statusText,headers:ks(s.getAllResponseHeaders()||"")};h.url="responseURL"in s?s.responseURL:h.headers.get("X-Request-URL");var v="response"in s?s.response:s.responseText;setTimeout(function(){t(new de(v,h))},0)},s.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},s.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},s.onabort=function(){setTimeout(function(){n(new je("Aborted","AbortError"))},0)};function p(h){try{return h===""&&Z.location.href?Z.location.href:h}catch{return h}}s.open(a.method,p(a.url),!0),a.credentials==="include"?s.withCredentials=!0:a.credentials==="omit"&&(s.withCredentials=!1),"responseType"in s&&(ne.blob?s.responseType="blob":ne.arrayBuffer&&a.headers.get("Content-Type")&&a.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(s.responseType="arraybuffer")),r&&typeof r.headers=="object"&&!(r.headers instanceof W)?Object.getOwnPropertyNames(r.headers).forEach(function(h){s.setRequestHeader(h,Bt(r.headers[h]))}):a.headers.forEach(function(h,v){s.setRequestHeader(v,h)}),a.signal&&(a.signal.addEventListener("abort",c),s.onreadystatechange=function(){s.readyState===4&&a.signal.removeEventListener("abort",c)}),s.send(typeof a._bodyInit>"u"?null:a._bodyInit)})}ti.polyfill=!0,Z.fetch||(Z.fetch=ti,Z.Headers=W,Z.Request=Le,Z.Response=de),self.fetch.bind(self);var Ws=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var a=42;r[t]=a;for(t in r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var s=Object.getOwnPropertySymbols(r);if(s.length!==1||s[0]!==t||!Object.prototype.propertyIsEnumerable.call(r,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var c=Object.getOwnPropertyDescriptor(r,t);if(c.value!==a||c.enumerable!==!0)return!1}return!0},ni=typeof Symbol<"u"&&Symbol,qs=Ws,zs=function(){return typeof ni!="function"||typeof Symbol!="function"||typeof ni("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:qs()},ii={foo:{}},Vs=Object,Hs=function(){return{__proto__:ii}.foo===ii.foo&&!({__proto__:null}instanceof Vs)},Ys="Function.prototype.bind called on incompatible ",Ft=Array.prototype.slice,Ks=Object.prototype.toString,Xs="[object Function]",Js=function(r){var t=this;if(typeof t!="function"||Ks.call(t)!==Xs)throw new TypeError(Ys+t);for(var n=Ft.call(arguments,1),a,s=function(){if(this instanceof a){var _=t.apply(this,n.concat(Ft.call(arguments)));return Object(_)===_?_:this}else return t.apply(r,n.concat(Ft.call(arguments)))},c=Math.max(0,t.length-n.length),p=[],h=0;h<c;h++)p.push("$"+h);if(a=Function("binder","return function ("+p.join(",")+"){ return binder.apply(this,arguments); }")(s),t.prototype){var v=function(){};v.prototype=t.prototype,a.prototype=new v,v.prototype=null}return a},Qs=Js,Ct=Function.prototype.bind||Qs,Zs=Ct,eu=Zs.call(Function.call,Object.prototype.hasOwnProperty),U,Qe=SyntaxError,oi=Function,Ze=TypeError,Ut=function(e){try{return oi('"use strict"; return ('+e+").constructor;")()}catch{}},ke=Object.getOwnPropertyDescriptor;if(ke)try{ke({},"")}catch{ke=null}var Dt=function(){throw new Ze},ru=ke?function(){try{return arguments.callee,Dt}catch{try{return ke(arguments,"callee").get}catch{return Dt}}}():Dt,er=zs(),tu=Hs(),Y=Object.getPrototypeOf||(tu?function(e){return e.__proto__}:null),rr={},nu=typeof Uint8Array>"u"||!Y?U:Y(Uint8Array),Ge={"%AggregateError%":typeof AggregateError>"u"?U:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?U:ArrayBuffer,"%ArrayIteratorPrototype%":er&&Y?Y([][Symbol.iterator]()):U,"%AsyncFromSyncIteratorPrototype%":U,"%AsyncFunction%":rr,"%AsyncGenerator%":rr,"%AsyncGeneratorFunction%":rr,"%AsyncIteratorPrototype%":rr,"%Atomics%":typeof Atomics>"u"?U:Atomics,"%BigInt%":typeof BigInt>"u"?U:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?U:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?U:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?U:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?U:Float32Array,"%Float64Array%":typeof Float64Array>"u"?U:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?U:FinalizationRegistry,"%Function%":oi,"%GeneratorFunction%":rr,"%Int8Array%":typeof Int8Array>"u"?U:Int8Array,"%Int16Array%":typeof Int16Array>"u"?U:Int16Array,"%Int32Array%":typeof Int32Array>"u"?U:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":er&&Y?Y(Y([][Symbol.iterator]())):U,"%JSON%":typeof JSON=="object"?JSON:U,"%Map%":typeof Map>"u"?U:Map,"%MapIteratorPrototype%":typeof Map>"u"||!er||!Y?U:Y(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?U:Promise,"%Proxy%":typeof Proxy>"u"?U:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?U:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?U:Set,"%SetIteratorPrototype%":typeof Set>"u"||!er||!Y?U:Y(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?U:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":er&&Y?Y(""[Symbol.iterator]()):U,"%Symbol%":er?Symbol:U,"%SyntaxError%":Qe,"%ThrowTypeError%":ru,"%TypedArray%":nu,"%TypeError%":Ze,"%Uint8Array%":typeof Uint8Array>"u"?U:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?U:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?U:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?U:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?U:WeakMap,"%WeakRef%":typeof WeakRef>"u"?U:WeakRef,"%WeakSet%":typeof WeakSet>"u"?U:WeakSet};if(Y)try{null.error}catch(e){var iu=Y(Y(e));Ge["%Error.prototype%"]=iu}var ou=function e(r){var t;if(r==="%AsyncFunction%")t=Ut("async function () {}");else if(r==="%GeneratorFunction%")t=Ut("function* () {}");else if(r==="%AsyncGeneratorFunction%")t=Ut("async function* () {}");else if(r==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(r==="%AsyncIteratorPrototype%"){var a=e("%AsyncGenerator%");a&&Y&&(t=Y(a.prototype))}return Ge[r]=t,t},ai={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},_r=Ct,kr=eu,au=_r.call(Function.call,Array.prototype.concat),su=_r.call(Function.apply,Array.prototype.splice),si=_r.call(Function.call,String.prototype.replace),Gr=_r.call(Function.call,String.prototype.slice),uu=_r.call(Function.call,RegExp.prototype.exec),cu=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,fu=/\\(\\)?/g,lu=function(r){var t=Gr(r,0,1),n=Gr(r,-1);if(t==="%"&&n!=="%")throw new Qe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new Qe("invalid intrinsic syntax, expected opening `%`");var a=[];return si(r,cu,function(s,c,p,h){a[a.length]=p?si(h,fu,"$1"):c||s}),a},pu=function(r,t){var n=r,a;if(kr(ai,n)&&(a=ai[n],n="%"+a[0]+"%"),kr(Ge,n)){var s=Ge[n];if(s===rr&&(s=ou(n)),typeof s>"u"&&!t)throw new Ze("intrinsic "+r+" exists, but is not available. Please file an issue!");return{alias:a,name:n,value:s}}throw new Qe("intrinsic "+r+" does not exist!")},Nt=function(r,t){if(typeof r!="string"||r.length===0)throw new Ze("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Ze('"allowMissing" argument must be a boolean');if(uu(/^%?[^%]*%?$/,r)===null)throw new Qe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=lu(r),a=n.length>0?n[0]:"",s=pu("%"+a+"%",t),c=s.name,p=s.value,h=!1,v=s.alias;v&&(a=v[0],su(n,au([0,1],v)));for(var _=1,w=!0;_<n.length;_+=1){var b=n[_],d=Gr(b,0,1),E=Gr(b,-1);if((d==='"'||d==="'"||d==="`"||E==='"'||E==="'"||E==="`")&&d!==E)throw new Qe("property names with quotes must have matching quotes");if((b==="constructor"||!w)&&(h=!0),a+="."+b,c="%"+a+"%",kr(Ge,c))p=Ge[c];else if(p!=null){if(!(b in p)){if(!t)throw new Ze("base intrinsic for "+r+" exists, but the property is not available.");return}if(ke&&_+1>=n.length){var x=ke(p,b);w=!!x,w&&"get"in x&&!("originalValue"in x.get)?p=x.get:p=p[b]}else w=kr(p,b),p=p[b];w&&!h&&(Ge[c]=p)}}return p},ui={exports:{}};(function(e){var r=Ct,t=Nt,n=t("%Function.prototype.apply%"),a=t("%Function.prototype.call%"),s=t("%Reflect.apply%",!0)||r.call(a,n),c=t("%Object.getOwnPropertyDescriptor%",!0),p=t("%Object.defineProperty%",!0),h=t("%Math.max%");if(p)try{p({},"a",{value:1})}catch{p=null}e.exports=function(w){var b=s(r,a,arguments);if(c&&p){var d=c(b,"length");d.configurable&&p(b,"length",{value:1+h(0,w.length-(arguments.length-1))})}return b};var v=function(){return s(r,n,arguments)};p?p(e.exports,"apply",{value:v}):e.exports.apply=v})(ui);var ci=Nt,fi=ui.exports,hu=fi(ci("String.prototype.indexOf")),du=function(r,t){var n=ci(r,!!t);return typeof n=="function"&&hu(r,".prototype.")>-1?fi(n):n},tr=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},ye=[],fe=[],yu=typeof Uint8Array<"u"?Uint8Array:Array,Mt=!1;function li(){Mt=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,t=e.length;r<t;++r)ye[r]=e[r],fe[e.charCodeAt(r)]=r;fe["-".charCodeAt(0)]=62,fe["_".charCodeAt(0)]=63}function gu(e){Mt||li();var r,t,n,a,s,c,p=e.length;if(p%4>0)throw new Error("Invalid string. Length must be a multiple of 4");s=e[p-2]==="="?2:e[p-1]==="="?1:0,c=new yu(p*3/4-s),n=s>0?p-4:p;var h=0;for(r=0,t=0;r<n;r+=4,t+=3)a=fe[e.charCodeAt(r)]<<18|fe[e.charCodeAt(r+1)]<<12|fe[e.charCodeAt(r+2)]<<6|fe[e.charCodeAt(r+3)],c[h++]=a>>16&255,c[h++]=a>>8&255,c[h++]=a&255;return s===2?(a=fe[e.charCodeAt(r)]<<2|fe[e.charCodeAt(r+1)]>>4,c[h++]=a&255):s===1&&(a=fe[e.charCodeAt(r)]<<10|fe[e.charCodeAt(r+1)]<<4|fe[e.charCodeAt(r+2)]>>2,c[h++]=a>>8&255,c[h++]=a&255),c}function vu(e){return ye[e>>18&63]+ye[e>>12&63]+ye[e>>6&63]+ye[e&63]}function mu(e,r,t){for(var n,a=[],s=r;s<t;s+=3)n=(e[s]<<16)+(e[s+1]<<8)+e[s+2],a.push(vu(n));return a.join("")}function pi(e){Mt||li();for(var r,t=e.length,n=t%3,a="",s=[],c=16383,p=0,h=t-n;p<h;p+=c)s.push(mu(e,p,p+c>h?h:p+c));return n===1?(r=e[t-1],a+=ye[r>>2],a+=ye[r<<4&63],a+="=="):n===2&&(r=(e[t-2]<<8)+e[t-1],a+=ye[r>>10],a+=ye[r>>4&63],a+=ye[r<<2&63],a+="="),s.push(a),s.join("")}function Wr(e,r,t,n,a){var s,c,p=a*8-n-1,h=(1<<p)-1,v=h>>1,_=-7,w=t?a-1:0,b=t?-1:1,d=e[r+w];for(w+=b,s=d&(1<<-_)-1,d>>=-_,_+=p;_>0;s=s*256+e[r+w],w+=b,_-=8);for(c=s&(1<<-_)-1,s>>=-_,_+=n;_>0;c=c*256+e[r+w],w+=b,_-=8);if(s===0)s=1-v;else{if(s===h)return c?NaN:(d?-1:1)*(1/0);c=c+Math.pow(2,n),s=s-v}return(d?-1:1)*c*Math.pow(2,s-n)}function hi(e,r,t,n,a,s){var c,p,h,v=s*8-a-1,_=(1<<v)-1,w=_>>1,b=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:s-1,E=n?1:-1,x=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(p=isNaN(r)?1:0,c=_):(c=Math.floor(Math.log(r)/Math.LN2),r*(h=Math.pow(2,-c))<1&&(c--,h*=2),c+w>=1?r+=b/h:r+=b*Math.pow(2,1-w),r*h>=2&&(c++,h/=2),c+w>=_?(p=0,c=_):c+w>=1?(p=(r*h-1)*Math.pow(2,a),c=c+w):(p=r*Math.pow(2,w-1)*Math.pow(2,a),c=0));a>=8;e[t+d]=p&255,d+=E,p/=256,a-=8);for(c=c<<a|p,v+=a;v>0;e[t+d]=c&255,d+=E,c/=256,v-=8);e[t+d-E]|=x*128}var _u={}.toString,di=Array.isArray||function(e){return _u.call(e)=="[object Array]"};/*!
|
|
1
|
+
// recharge-client-1.3.2.min.js | MIT License | © Recharge Inc.
|
|
2
|
+
(function($e,vr){typeof exports=="object"&&typeof module<"u"?module.exports=vr():typeof define=="function"&&define.amd?define(vr):($e=typeof globalThis<"u"?globalThis:$e||self,$e.recharge=vr())})(this,function(){"use strict";var $e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vr(e){var r=e.default;if(typeof r=="function"){var t=function(){return r.apply(this,arguments)};t.prototype=r.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}),t}var Z=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Z<"u"&&Z,ne={searchParams:"URLSearchParams"in Z,iterable:"Symbol"in Z&&"iterator"in Symbol,blob:"FileReader"in Z&&"Blob"in Z&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in Z,arrayBuffer:"ArrayBuffer"in Z};function Cs(e){return e&&DataView.prototype.isPrototypeOf(e)}if(ne.arrayBuffer)var Us=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Ds=ArrayBuffer.isView||function(e){return e&&Us.indexOf(Object.prototype.toString.call(e))>-1};function mr(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function Bt(e){return typeof e!="string"&&(e=String(e)),e}function Pt(e){var r={next:function(){var t=e.shift();return{done:t===void 0,value:t}}};return ne.iterable&&(r[Symbol.iterator]=function(){return r}),r}function W(e){this.map={},e instanceof W?e.forEach(function(r,t){this.append(t,r)},this):Array.isArray(e)?e.forEach(function(r){this.append(r[0],r[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(r){this.append(r,e[r])},this)}W.prototype.append=function(e,r){e=mr(e),r=Bt(r);var t=this.map[e];this.map[e]=t?t+", "+r:r},W.prototype.delete=function(e){delete this.map[mr(e)]},W.prototype.get=function(e){return e=mr(e),this.has(e)?this.map[e]:null},W.prototype.has=function(e){return this.map.hasOwnProperty(mr(e))},W.prototype.set=function(e,r){this.map[mr(e)]=Bt(r)},W.prototype.forEach=function(e,r){for(var t in this.map)this.map.hasOwnProperty(t)&&e.call(r,this.map[t],t,this)},W.prototype.keys=function(){var e=[];return this.forEach(function(r,t){e.push(t)}),Pt(e)},W.prototype.values=function(){var e=[];return this.forEach(function(r){e.push(r)}),Pt(e)},W.prototype.entries=function(){var e=[];return this.forEach(function(r,t){e.push([t,r])}),Pt(e)},ne.iterable&&(W.prototype[Symbol.iterator]=W.prototype.entries);function Rt(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function Zn(e){return new Promise(function(r,t){e.onload=function(){r(e.result)},e.onerror=function(){t(e.error)}})}function Ns(e){var r=new FileReader,t=Zn(r);return r.readAsArrayBuffer(e),t}function Ms(e){var r=new FileReader,t=Zn(r);return r.readAsText(e),t}function Ls(e){for(var r=new Uint8Array(e),t=new Array(r.length),n=0;n<r.length;n++)t[n]=String.fromCharCode(r[n]);return t.join("")}function ei(e){if(e.slice)return e.slice(0);var r=new Uint8Array(e.byteLength);return r.set(new Uint8Array(e)),r.buffer}function ri(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:ne.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:ne.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:ne.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():ne.arrayBuffer&&ne.blob&&Cs(e)?(this._bodyArrayBuffer=ei(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):ne.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||Ds(e))?this._bodyArrayBuffer=ei(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):ne.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},ne.blob&&(this.blob=function(){var e=Rt(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=Rt(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(Ns)}),this.text=function(){var e=Rt(this);if(e)return e;if(this._bodyBlob)return Ms(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Ls(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},ne.formData&&(this.formData=function(){return this.text().then(Gs)}),this.json=function(){return this.text().then(JSON.parse)},this}var js=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function ks(e){var r=e.toUpperCase();return js.indexOf(r)>-1?r:e}function Le(e,r){if(!(this instanceof Le))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');r=r||{};var t=r.body;if(e instanceof Le){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,r.headers||(this.headers=new W(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!t&&e._bodyInit!=null&&(t=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=r.credentials||this.credentials||"same-origin",(r.headers||!this.headers)&&(this.headers=new W(r.headers)),this.method=ks(r.method||this.method||"GET"),this.mode=r.mode||this.mode||null,this.signal=r.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&t)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(t),(this.method==="GET"||this.method==="HEAD")&&(r.cache==="no-store"||r.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var a=/\?/;this.url+=(a.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}Le.prototype.clone=function(){return new Le(this,{body:this._bodyInit})};function Gs(e){var r=new FormData;return e.trim().split("&").forEach(function(t){if(t){var n=t.split("="),a=n.shift().replace(/\+/g," "),s=n.join("=").replace(/\+/g," ");r.append(decodeURIComponent(a),decodeURIComponent(s))}}),r}function Ws(e){var r=new W,t=e.replace(/\r?\n[\t ]+/g," ");return t.split("\r").map(function(n){return n.indexOf(`
|
|
3
|
+
`)===0?n.substr(1,n.length):n}).forEach(function(n){var a=n.split(":"),s=a.shift().trim();if(s){var c=a.join(":").trim();r.append(s,c)}}),r}ri.call(Le.prototype);function de(e,r){if(!(this instanceof de))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');r||(r={}),this.type="default",this.status=r.status===void 0?200:r.status,this.ok=this.status>=200&&this.status<300,this.statusText=r.statusText===void 0?"":""+r.statusText,this.headers=new W(r.headers),this.url=r.url||"",this._initBody(e)}ri.call(de.prototype),de.prototype.clone=function(){return new de(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new W(this.headers),url:this.url})},de.error=function(){var e=new de(null,{status:0,statusText:""});return e.type="error",e};var qs=[301,302,303,307,308];de.redirect=function(e,r){if(qs.indexOf(r)===-1)throw new RangeError("Invalid status code");return new de(null,{status:r,headers:{location:e}})};var je=Z.DOMException;try{new je}catch{je=function(r,t){this.message=r,this.name=t;var n=Error(r);this.stack=n.stack},je.prototype=Object.create(Error.prototype),je.prototype.constructor=je}function ti(e,r){return new Promise(function(t,n){var a=new Le(e,r);if(a.signal&&a.signal.aborted)return n(new je("Aborted","AbortError"));var s=new XMLHttpRequest;function c(){s.abort()}s.onload=function(){var h={status:s.status,statusText:s.statusText,headers:Ws(s.getAllResponseHeaders()||"")};h.url="responseURL"in s?s.responseURL:h.headers.get("X-Request-URL");var v="response"in s?s.response:s.responseText;setTimeout(function(){t(new de(v,h))},0)},s.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},s.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},s.onabort=function(){setTimeout(function(){n(new je("Aborted","AbortError"))},0)};function p(h){try{return h===""&&Z.location.href?Z.location.href:h}catch{return h}}s.open(a.method,p(a.url),!0),a.credentials==="include"?s.withCredentials=!0:a.credentials==="omit"&&(s.withCredentials=!1),"responseType"in s&&(ne.blob?s.responseType="blob":ne.arrayBuffer&&a.headers.get("Content-Type")&&a.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(s.responseType="arraybuffer")),r&&typeof r.headers=="object"&&!(r.headers instanceof W)?Object.getOwnPropertyNames(r.headers).forEach(function(h){s.setRequestHeader(h,Bt(r.headers[h]))}):a.headers.forEach(function(h,v){s.setRequestHeader(v,h)}),a.signal&&(a.signal.addEventListener("abort",c),s.onreadystatechange=function(){s.readyState===4&&a.signal.removeEventListener("abort",c)}),s.send(typeof a._bodyInit>"u"?null:a._bodyInit)})}ti.polyfill=!0,Z.fetch||(Z.fetch=ti,Z.Headers=W,Z.Request=Le,Z.Response=de),self.fetch.bind(self);var zs=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var a=42;r[t]=a;for(t in r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var s=Object.getOwnPropertySymbols(r);if(s.length!==1||s[0]!==t||!Object.prototype.propertyIsEnumerable.call(r,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var c=Object.getOwnPropertyDescriptor(r,t);if(c.value!==a||c.enumerable!==!0)return!1}return!0},ni=typeof Symbol<"u"&&Symbol,Vs=zs,Hs=function(){return typeof ni!="function"||typeof Symbol!="function"||typeof ni("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Vs()},ii={foo:{}},Ys=Object,Ks=function(){return{__proto__:ii}.foo===ii.foo&&!({__proto__:null}instanceof Ys)},Xs="Function.prototype.bind called on incompatible ",Ft=Array.prototype.slice,Js=Object.prototype.toString,Qs="[object Function]",Zs=function(r){var t=this;if(typeof t!="function"||Js.call(t)!==Qs)throw new TypeError(Xs+t);for(var n=Ft.call(arguments,1),a,s=function(){if(this instanceof a){var _=t.apply(this,n.concat(Ft.call(arguments)));return Object(_)===_?_:this}else return t.apply(r,n.concat(Ft.call(arguments)))},c=Math.max(0,t.length-n.length),p=[],h=0;h<c;h++)p.push("$"+h);if(a=Function("binder","return function ("+p.join(",")+"){ return binder.apply(this,arguments); }")(s),t.prototype){var v=function(){};v.prototype=t.prototype,a.prototype=new v,v.prototype=null}return a},eu=Zs,Ct=Function.prototype.bind||eu,ru=Ct,tu=ru.call(Function.call,Object.prototype.hasOwnProperty),U,Qe=SyntaxError,oi=Function,Ze=TypeError,Ut=function(e){try{return oi('"use strict"; return ('+e+").constructor;")()}catch{}},ke=Object.getOwnPropertyDescriptor;if(ke)try{ke({},"")}catch{ke=null}var Dt=function(){throw new Ze},nu=ke?function(){try{return arguments.callee,Dt}catch{try{return ke(arguments,"callee").get}catch{return Dt}}}():Dt,er=Hs(),iu=Ks(),Y=Object.getPrototypeOf||(iu?function(e){return e.__proto__}:null),rr={},ou=typeof Uint8Array>"u"||!Y?U:Y(Uint8Array),Ge={"%AggregateError%":typeof AggregateError>"u"?U:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?U:ArrayBuffer,"%ArrayIteratorPrototype%":er&&Y?Y([][Symbol.iterator]()):U,"%AsyncFromSyncIteratorPrototype%":U,"%AsyncFunction%":rr,"%AsyncGenerator%":rr,"%AsyncGeneratorFunction%":rr,"%AsyncIteratorPrototype%":rr,"%Atomics%":typeof Atomics>"u"?U:Atomics,"%BigInt%":typeof BigInt>"u"?U:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?U:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?U:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?U:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?U:Float32Array,"%Float64Array%":typeof Float64Array>"u"?U:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?U:FinalizationRegistry,"%Function%":oi,"%GeneratorFunction%":rr,"%Int8Array%":typeof Int8Array>"u"?U:Int8Array,"%Int16Array%":typeof Int16Array>"u"?U:Int16Array,"%Int32Array%":typeof Int32Array>"u"?U:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":er&&Y?Y(Y([][Symbol.iterator]())):U,"%JSON%":typeof JSON=="object"?JSON:U,"%Map%":typeof Map>"u"?U:Map,"%MapIteratorPrototype%":typeof Map>"u"||!er||!Y?U:Y(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?U:Promise,"%Proxy%":typeof Proxy>"u"?U:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?U:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?U:Set,"%SetIteratorPrototype%":typeof Set>"u"||!er||!Y?U:Y(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?U:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":er&&Y?Y(""[Symbol.iterator]()):U,"%Symbol%":er?Symbol:U,"%SyntaxError%":Qe,"%ThrowTypeError%":nu,"%TypedArray%":ou,"%TypeError%":Ze,"%Uint8Array%":typeof Uint8Array>"u"?U:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?U:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?U:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?U:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?U:WeakMap,"%WeakRef%":typeof WeakRef>"u"?U:WeakRef,"%WeakSet%":typeof WeakSet>"u"?U:WeakSet};if(Y)try{null.error}catch(e){var au=Y(Y(e));Ge["%Error.prototype%"]=au}var su=function e(r){var t;if(r==="%AsyncFunction%")t=Ut("async function () {}");else if(r==="%GeneratorFunction%")t=Ut("function* () {}");else if(r==="%AsyncGeneratorFunction%")t=Ut("async function* () {}");else if(r==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(r==="%AsyncIteratorPrototype%"){var a=e("%AsyncGenerator%");a&&Y&&(t=Y(a.prototype))}return Ge[r]=t,t},ai={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},_r=Ct,kr=tu,uu=_r.call(Function.call,Array.prototype.concat),cu=_r.call(Function.apply,Array.prototype.splice),si=_r.call(Function.call,String.prototype.replace),Gr=_r.call(Function.call,String.prototype.slice),fu=_r.call(Function.call,RegExp.prototype.exec),lu=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,pu=/\\(\\)?/g,hu=function(r){var t=Gr(r,0,1),n=Gr(r,-1);if(t==="%"&&n!=="%")throw new Qe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new Qe("invalid intrinsic syntax, expected opening `%`");var a=[];return si(r,lu,function(s,c,p,h){a[a.length]=p?si(h,pu,"$1"):c||s}),a},du=function(r,t){var n=r,a;if(kr(ai,n)&&(a=ai[n],n="%"+a[0]+"%"),kr(Ge,n)){var s=Ge[n];if(s===rr&&(s=su(n)),typeof s>"u"&&!t)throw new Ze("intrinsic "+r+" exists, but is not available. Please file an issue!");return{alias:a,name:n,value:s}}throw new Qe("intrinsic "+r+" does not exist!")},Nt=function(r,t){if(typeof r!="string"||r.length===0)throw new Ze("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Ze('"allowMissing" argument must be a boolean');if(fu(/^%?[^%]*%?$/,r)===null)throw new Qe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=hu(r),a=n.length>0?n[0]:"",s=du("%"+a+"%",t),c=s.name,p=s.value,h=!1,v=s.alias;v&&(a=v[0],cu(n,uu([0,1],v)));for(var _=1,w=!0;_<n.length;_+=1){var b=n[_],d=Gr(b,0,1),E=Gr(b,-1);if((d==='"'||d==="'"||d==="`"||E==='"'||E==="'"||E==="`")&&d!==E)throw new Qe("property names with quotes must have matching quotes");if((b==="constructor"||!w)&&(h=!0),a+="."+b,c="%"+a+"%",kr(Ge,c))p=Ge[c];else if(p!=null){if(!(b in p)){if(!t)throw new Ze("base intrinsic for "+r+" exists, but the property is not available.");return}if(ke&&_+1>=n.length){var x=ke(p,b);w=!!x,w&&"get"in x&&!("originalValue"in x.get)?p=x.get:p=p[b]}else w=kr(p,b),p=p[b];w&&!h&&(Ge[c]=p)}}return p},ui={exports:{}};(function(e){var r=Ct,t=Nt,n=t("%Function.prototype.apply%"),a=t("%Function.prototype.call%"),s=t("%Reflect.apply%",!0)||r.call(a,n),c=t("%Object.getOwnPropertyDescriptor%",!0),p=t("%Object.defineProperty%",!0),h=t("%Math.max%");if(p)try{p({},"a",{value:1})}catch{p=null}e.exports=function(w){var b=s(r,a,arguments);if(c&&p){var d=c(b,"length");d.configurable&&p(b,"length",{value:1+h(0,w.length-(arguments.length-1))})}return b};var v=function(){return s(r,n,arguments)};p?p(e.exports,"apply",{value:v}):e.exports.apply=v})(ui);var ci=Nt,fi=ui.exports,yu=fi(ci("String.prototype.indexOf")),gu=function(r,t){var n=ci(r,!!t);return typeof n=="function"&&yu(r,".prototype.")>-1?fi(n):n},tr=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},ye=[],fe=[],vu=typeof Uint8Array<"u"?Uint8Array:Array,Mt=!1;function li(){Mt=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,t=e.length;r<t;++r)ye[r]=e[r],fe[e.charCodeAt(r)]=r;fe["-".charCodeAt(0)]=62,fe["_".charCodeAt(0)]=63}function mu(e){Mt||li();var r,t,n,a,s,c,p=e.length;if(p%4>0)throw new Error("Invalid string. Length must be a multiple of 4");s=e[p-2]==="="?2:e[p-1]==="="?1:0,c=new vu(p*3/4-s),n=s>0?p-4:p;var h=0;for(r=0,t=0;r<n;r+=4,t+=3)a=fe[e.charCodeAt(r)]<<18|fe[e.charCodeAt(r+1)]<<12|fe[e.charCodeAt(r+2)]<<6|fe[e.charCodeAt(r+3)],c[h++]=a>>16&255,c[h++]=a>>8&255,c[h++]=a&255;return s===2?(a=fe[e.charCodeAt(r)]<<2|fe[e.charCodeAt(r+1)]>>4,c[h++]=a&255):s===1&&(a=fe[e.charCodeAt(r)]<<10|fe[e.charCodeAt(r+1)]<<4|fe[e.charCodeAt(r+2)]>>2,c[h++]=a>>8&255,c[h++]=a&255),c}function _u(e){return ye[e>>18&63]+ye[e>>12&63]+ye[e>>6&63]+ye[e&63]}function wu(e,r,t){for(var n,a=[],s=r;s<t;s+=3)n=(e[s]<<16)+(e[s+1]<<8)+e[s+2],a.push(_u(n));return a.join("")}function pi(e){Mt||li();for(var r,t=e.length,n=t%3,a="",s=[],c=16383,p=0,h=t-n;p<h;p+=c)s.push(wu(e,p,p+c>h?h:p+c));return n===1?(r=e[t-1],a+=ye[r>>2],a+=ye[r<<4&63],a+="=="):n===2&&(r=(e[t-2]<<8)+e[t-1],a+=ye[r>>10],a+=ye[r>>4&63],a+=ye[r<<2&63],a+="="),s.push(a),s.join("")}function Wr(e,r,t,n,a){var s,c,p=a*8-n-1,h=(1<<p)-1,v=h>>1,_=-7,w=t?a-1:0,b=t?-1:1,d=e[r+w];for(w+=b,s=d&(1<<-_)-1,d>>=-_,_+=p;_>0;s=s*256+e[r+w],w+=b,_-=8);for(c=s&(1<<-_)-1,s>>=-_,_+=n;_>0;c=c*256+e[r+w],w+=b,_-=8);if(s===0)s=1-v;else{if(s===h)return c?NaN:(d?-1:1)*(1/0);c=c+Math.pow(2,n),s=s-v}return(d?-1:1)*c*Math.pow(2,s-n)}function hi(e,r,t,n,a,s){var c,p,h,v=s*8-a-1,_=(1<<v)-1,w=_>>1,b=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:s-1,E=n?1:-1,x=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(p=isNaN(r)?1:0,c=_):(c=Math.floor(Math.log(r)/Math.LN2),r*(h=Math.pow(2,-c))<1&&(c--,h*=2),c+w>=1?r+=b/h:r+=b*Math.pow(2,1-w),r*h>=2&&(c++,h/=2),c+w>=_?(p=0,c=_):c+w>=1?(p=(r*h-1)*Math.pow(2,a),c=c+w):(p=r*Math.pow(2,w-1)*Math.pow(2,a),c=0));a>=8;e[t+d]=p&255,d+=E,p/=256,a-=8);for(c=c<<a|p,v+=a;v>0;e[t+d]=c&255,d+=E,c/=256,v-=8);e[t+d-E]|=x*128}var bu={}.toString,di=Array.isArray||function(e){return bu.call(e)=="[object Array]"};/*!
|
|
4
4
|
* The buffer module from node.js, for the browser.
|
|
5
5
|
*
|
|
6
6
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
7
7
|
* @license MIT
|
|
8
|
-
*/var wu=50;$.TYPED_ARRAY_SUPPORT=tr.TYPED_ARRAY_SUPPORT!==void 0?tr.TYPED_ARRAY_SUPPORT:!0,qr();function qr(){return $.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Ae(e,r){if(qr()<r)throw new RangeError("Invalid typed array length");return $.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(r),e.__proto__=$.prototype):(e===null&&(e=new $(r)),e.length=r),e}function $(e,r,t){if(!$.TYPED_ARRAY_SUPPORT&&!(this instanceof $))return new $(e,r,t);if(typeof e=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return Lt(this,e)}return yi(this,e,r,t)}$.poolSize=8192,$._augment=function(e){return e.__proto__=$.prototype,e};function yi(e,r,t,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Au(e,r,t,n):typeof r=="string"?$u(e,r,t):Eu(e,r)}$.from=function(e,r,t){return yi(null,e,r,t)},$.TYPED_ARRAY_SUPPORT&&($.prototype.__proto__=Uint8Array.prototype,$.__proto__=Uint8Array);function gi(e){if(typeof e!="number")throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function bu(e,r,t,n){return gi(r),r<=0?Ae(e,r):t!==void 0?typeof n=="string"?Ae(e,r).fill(t,n):Ae(e,r).fill(t):Ae(e,r)}$.alloc=function(e,r,t){return bu(null,e,r,t)};function Lt(e,r){if(gi(r),e=Ae(e,r<0?0:kt(r)|0),!$.TYPED_ARRAY_SUPPORT)for(var t=0;t<r;++t)e[t]=0;return e}$.allocUnsafe=function(e){return Lt(null,e)},$.allocUnsafeSlow=function(e){return Lt(null,e)};function $u(e,r,t){if((typeof t!="string"||t==="")&&(t="utf8"),!$.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var n=vi(r,t)|0;e=Ae(e,n);var a=e.write(r,t);return a!==n&&(e=e.slice(0,a)),e}function jt(e,r){var t=r.length<0?0:kt(r.length)|0;e=Ae(e,t);for(var n=0;n<t;n+=1)e[n]=r[n]&255;return e}function Au(e,r,t,n){if(r.byteLength,t<0||r.byteLength<t)throw new RangeError("'offset' is out of bounds");if(r.byteLength<t+(n||0))throw new RangeError("'length' is out of bounds");return t===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,t):r=new Uint8Array(r,t,n),$.TYPED_ARRAY_SUPPORT?(e=r,e.__proto__=$.prototype):e=jt(e,r),e}function Eu(e,r){if(ge(r)){var t=kt(r.length)|0;return e=Ae(e,t),e.length===0||r.copy(e,0,0,t),e}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Wu(r.length)?Ae(e,0):jt(e,r);if(r.type==="Buffer"&&di(r.data))return jt(e,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function kt(e){if(e>=qr())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+qr().toString(16)+" bytes");return e|0}$.isBuffer=qu;function ge(e){return!!(e!=null&&e._isBuffer)}$.compare=function(r,t){if(!ge(r)||!ge(t))throw new TypeError("Arguments must be Buffers");if(r===t)return 0;for(var n=r.length,a=t.length,s=0,c=Math.min(n,a);s<c;++s)if(r[s]!==t[s]){n=r[s],a=t[s];break}return n<a?-1:a<n?1:0},$.isEncoding=function(r){switch(String(r).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}},$.concat=function(r,t){if(!di(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return $.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<r.length;++n)t+=r[n].length;var a=$.allocUnsafe(t),s=0;for(n=0;n<r.length;++n){var c=r[n];if(!ge(c))throw new TypeError('"list" argument must be an Array of Buffers');c.copy(a,s),s+=c.length}return a};function vi(e,r){if(ge(e))return e.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;typeof e!="string"&&(e=""+e);var t=e.length;if(t===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return Hr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return xi(e).length;default:if(n)return Hr(e).length;r=(""+r).toLowerCase(),n=!0}}$.byteLength=vi;function Su(e,r,t){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return Uu(this,r,t);case"utf8":case"utf-8":return bi(this,r,t);case"ascii":return Fu(this,r,t);case"latin1":case"binary":return Cu(this,r,t);case"base64":return Pu(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Du(this,r,t);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}$.prototype._isBuffer=!0;function We(e,r,t){var n=e[r];e[r]=e[t],e[t]=n}$.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<r;t+=2)We(this,t,t+1);return this},$.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<r;t+=4)We(this,t,t+3),We(this,t+1,t+2);return this},$.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<r;t+=8)We(this,t,t+7),We(this,t+1,t+6),We(this,t+2,t+5),We(this,t+3,t+4);return this},$.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?bi(this,0,r):Su.apply(this,arguments)},$.prototype.equals=function(r){if(!ge(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:$.compare(this,r)===0},$.prototype.inspect=function(){var r="",t=wu;return this.length>0&&(r=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(r+=" ... ")),"<Buffer "+r+">"},$.prototype.compare=function(r,t,n,a,s){if(!ge(r))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),n===void 0&&(n=r?r.length:0),a===void 0&&(a=0),s===void 0&&(s=this.length),t<0||n>r.length||a<0||s>this.length)throw new RangeError("out of range index");if(a>=s&&t>=n)return 0;if(a>=s)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,a>>>=0,s>>>=0,this===r)return 0;for(var c=s-a,p=n-t,h=Math.min(c,p),v=this.slice(a,s),_=r.slice(t,n),w=0;w<h;++w)if(v[w]!==_[w]){c=v[w],p=_[w];break}return c<p?-1:p<c?1:0};function mi(e,r,t,n,a){if(e.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=a?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(a)return-1;t=e.length-1}else if(t<0)if(a)t=0;else return-1;if(typeof r=="string"&&(r=$.from(r,n)),ge(r))return r.length===0?-1:_i(e,r,t,n,a);if(typeof r=="number")return r=r&255,$.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?a?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):_i(e,[r],t,n,a);throw new TypeError("val must be string, number or Buffer")}function _i(e,r,t,n,a){var s=1,c=e.length,p=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||r.length<2)return-1;s=2,c/=2,p/=2,t/=2}function h(d,E){return s===1?d[E]:d.readUInt16BE(E*s)}var v;if(a){var _=-1;for(v=t;v<c;v++)if(h(e,v)===h(r,_===-1?0:v-_)){if(_===-1&&(_=v),v-_+1===p)return _*s}else _!==-1&&(v-=v-_),_=-1}else for(t+p>c&&(t=c-p),v=t;v>=0;v--){for(var w=!0,b=0;b<p;b++)if(h(e,v+b)!==h(r,b)){w=!1;break}if(w)return v}return-1}$.prototype.includes=function(r,t,n){return this.indexOf(r,t,n)!==-1},$.prototype.indexOf=function(r,t,n){return mi(this,r,t,n,!0)},$.prototype.lastIndexOf=function(r,t,n){return mi(this,r,t,n,!1)};function xu(e,r,t,n){t=Number(t)||0;var a=e.length-t;n?(n=Number(n),n>a&&(n=a)):n=a;var s=r.length;if(s%2!==0)throw new TypeError("Invalid hex string");n>s/2&&(n=s/2);for(var c=0;c<n;++c){var p=parseInt(r.substr(c*2,2),16);if(isNaN(p))return c;e[t+c]=p}return c}function Iu(e,r,t,n){return Yr(Hr(r,e.length-t),e,t,n)}function wi(e,r,t,n){return Yr(ku(r),e,t,n)}function Tu(e,r,t,n){return wi(e,r,t,n)}function Ou(e,r,t,n){return Yr(xi(r),e,t,n)}function Bu(e,r,t,n){return Yr(Gu(r,e.length-t),e,t,n)}$.prototype.write=function(r,t,n,a){if(t===void 0)a="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")a=t,n=this.length,t=0;else if(isFinite(t))t=t|0,isFinite(n)?(n=n|0,a===void 0&&(a="utf8")):(a=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s=this.length-t;if((n===void 0||n>s)&&(n=s),r.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var c=!1;;)switch(a){case"hex":return xu(this,r,t,n);case"utf8":case"utf-8":return Iu(this,r,t,n);case"ascii":return wi(this,r,t,n);case"latin1":case"binary":return Tu(this,r,t,n);case"base64":return Ou(this,r,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Bu(this,r,t,n);default:if(c)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),c=!0}},$.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Pu(e,r,t){return r===0&&t===e.length?pi(e):pi(e.slice(r,t))}function bi(e,r,t){t=Math.min(e.length,t);for(var n=[],a=r;a<t;){var s=e[a],c=null,p=s>239?4:s>223?3:s>191?2:1;if(a+p<=t){var h,v,_,w;switch(p){case 1:s<128&&(c=s);break;case 2:h=e[a+1],(h&192)===128&&(w=(s&31)<<6|h&63,w>127&&(c=w));break;case 3:h=e[a+1],v=e[a+2],(h&192)===128&&(v&192)===128&&(w=(s&15)<<12|(h&63)<<6|v&63,w>2047&&(w<55296||w>57343)&&(c=w));break;case 4:h=e[a+1],v=e[a+2],_=e[a+3],(h&192)===128&&(v&192)===128&&(_&192)===128&&(w=(s&15)<<18|(h&63)<<12|(v&63)<<6|_&63,w>65535&&w<1114112&&(c=w))}}c===null?(c=65533,p=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|c&1023),n.push(c),a+=p}return Ru(n)}var $i=4096;function Ru(e){var r=e.length;if(r<=$i)return String.fromCharCode.apply(String,e);for(var t="",n=0;n<r;)t+=String.fromCharCode.apply(String,e.slice(n,n+=$i));return t}function Fu(e,r,t){var n="";t=Math.min(e.length,t);for(var a=r;a<t;++a)n+=String.fromCharCode(e[a]&127);return n}function Cu(e,r,t){var n="";t=Math.min(e.length,t);for(var a=r;a<t;++a)n+=String.fromCharCode(e[a]);return n}function Uu(e,r,t){var n=e.length;(!r||r<0)&&(r=0),(!t||t<0||t>n)&&(t=n);for(var a="",s=r;s<t;++s)a+=ju(e[s]);return a}function Du(e,r,t){for(var n=e.slice(r,t),a="",s=0;s<n.length;s+=2)a+=String.fromCharCode(n[s]+n[s+1]*256);return a}$.prototype.slice=function(r,t){var n=this.length;r=~~r,t=t===void 0?n:~~t,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<r&&(t=r);var a;if($.TYPED_ARRAY_SUPPORT)a=this.subarray(r,t),a.__proto__=$.prototype;else{var s=t-r;a=new $(s,void 0);for(var c=0;c<s;++c)a[c]=this[c+r]}return a};function K(e,r,t){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+r>t)throw new RangeError("Trying to access beyond buffer length")}$.prototype.readUIntLE=function(r,t,n){r=r|0,t=t|0,n||K(r,t,this.length);for(var a=this[r],s=1,c=0;++c<t&&(s*=256);)a+=this[r+c]*s;return a},$.prototype.readUIntBE=function(r,t,n){r=r|0,t=t|0,n||K(r,t,this.length);for(var a=this[r+--t],s=1;t>0&&(s*=256);)a+=this[r+--t]*s;return a},$.prototype.readUInt8=function(r,t){return t||K(r,1,this.length),this[r]},$.prototype.readUInt16LE=function(r,t){return t||K(r,2,this.length),this[r]|this[r+1]<<8},$.prototype.readUInt16BE=function(r,t){return t||K(r,2,this.length),this[r]<<8|this[r+1]},$.prototype.readUInt32LE=function(r,t){return t||K(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216},$.prototype.readUInt32BE=function(r,t){return t||K(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])},$.prototype.readIntLE=function(r,t,n){r=r|0,t=t|0,n||K(r,t,this.length);for(var a=this[r],s=1,c=0;++c<t&&(s*=256);)a+=this[r+c]*s;return s*=128,a>=s&&(a-=Math.pow(2,8*t)),a},$.prototype.readIntBE=function(r,t,n){r=r|0,t=t|0,n||K(r,t,this.length);for(var a=t,s=1,c=this[r+--a];a>0&&(s*=256);)c+=this[r+--a]*s;return s*=128,c>=s&&(c-=Math.pow(2,8*t)),c},$.prototype.readInt8=function(r,t){return t||K(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]},$.prototype.readInt16LE=function(r,t){t||K(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n},$.prototype.readInt16BE=function(r,t){t||K(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n},$.prototype.readInt32LE=function(r,t){return t||K(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},$.prototype.readInt32BE=function(r,t){return t||K(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},$.prototype.readFloatLE=function(r,t){return t||K(r,4,this.length),Wr(this,r,!0,23,4)},$.prototype.readFloatBE=function(r,t){return t||K(r,4,this.length),Wr(this,r,!1,23,4)},$.prototype.readDoubleLE=function(r,t){return t||K(r,8,this.length),Wr(this,r,!0,52,8)},$.prototype.readDoubleBE=function(r,t){return t||K(r,8,this.length),Wr(this,r,!1,52,8)};function ie(e,r,t,n,a,s){if(!ge(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>a||r<s)throw new RangeError('"value" argument is out of bounds');if(t+n>e.length)throw new RangeError("Index out of range")}$.prototype.writeUIntLE=function(r,t,n,a){if(r=+r,t=t|0,n=n|0,!a){var s=Math.pow(2,8*n)-1;ie(this,r,t,n,s,0)}var c=1,p=0;for(this[t]=r&255;++p<n&&(c*=256);)this[t+p]=r/c&255;return t+n},$.prototype.writeUIntBE=function(r,t,n,a){if(r=+r,t=t|0,n=n|0,!a){var s=Math.pow(2,8*n)-1;ie(this,r,t,n,s,0)}var c=n-1,p=1;for(this[t+c]=r&255;--c>=0&&(p*=256);)this[t+c]=r/p&255;return t+n},$.prototype.writeUInt8=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,1,255,0),$.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[t]=r&255,t+1};function zr(e,r,t,n){r<0&&(r=65535+r+1);for(var a=0,s=Math.min(e.length-t,2);a<s;++a)e[t+a]=(r&255<<8*(n?a:1-a))>>>(n?a:1-a)*8}$.prototype.writeUInt16LE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,2,65535,0),$.TYPED_ARRAY_SUPPORT?(this[t]=r&255,this[t+1]=r>>>8):zr(this,r,t,!0),t+2},$.prototype.writeUInt16BE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,2,65535,0),$.TYPED_ARRAY_SUPPORT?(this[t]=r>>>8,this[t+1]=r&255):zr(this,r,t,!1),t+2};function Vr(e,r,t,n){r<0&&(r=4294967295+r+1);for(var a=0,s=Math.min(e.length-t,4);a<s;++a)e[t+a]=r>>>(n?a:3-a)*8&255}$.prototype.writeUInt32LE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,4,4294967295,0),$.TYPED_ARRAY_SUPPORT?(this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255):Vr(this,r,t,!0),t+4},$.prototype.writeUInt32BE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,4,4294967295,0),$.TYPED_ARRAY_SUPPORT?(this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255):Vr(this,r,t,!1),t+4},$.prototype.writeIntLE=function(r,t,n,a){if(r=+r,t=t|0,!a){var s=Math.pow(2,8*n-1);ie(this,r,t,n,s-1,-s)}var c=0,p=1,h=0;for(this[t]=r&255;++c<n&&(p*=256);)r<0&&h===0&&this[t+c-1]!==0&&(h=1),this[t+c]=(r/p>>0)-h&255;return t+n},$.prototype.writeIntBE=function(r,t,n,a){if(r=+r,t=t|0,!a){var s=Math.pow(2,8*n-1);ie(this,r,t,n,s-1,-s)}var c=n-1,p=1,h=0;for(this[t+c]=r&255;--c>=0&&(p*=256);)r<0&&h===0&&this[t+c+1]!==0&&(h=1),this[t+c]=(r/p>>0)-h&255;return t+n},$.prototype.writeInt8=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,1,127,-128),$.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[t]=r&255,t+1},$.prototype.writeInt16LE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,2,32767,-32768),$.TYPED_ARRAY_SUPPORT?(this[t]=r&255,this[t+1]=r>>>8):zr(this,r,t,!0),t+2},$.prototype.writeInt16BE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,2,32767,-32768),$.TYPED_ARRAY_SUPPORT?(this[t]=r>>>8,this[t+1]=r&255):zr(this,r,t,!1),t+2},$.prototype.writeInt32LE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,4,2147483647,-2147483648),$.TYPED_ARRAY_SUPPORT?(this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24):Vr(this,r,t,!0),t+4},$.prototype.writeInt32BE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),$.TYPED_ARRAY_SUPPORT?(this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255):Vr(this,r,t,!1),t+4};function Ai(e,r,t,n,a,s){if(t+n>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Ei(e,r,t,n,a){return a||Ai(e,r,t,4),hi(e,r,t,n,23,4),t+4}$.prototype.writeFloatLE=function(r,t,n){return Ei(this,r,t,!0,n)},$.prototype.writeFloatBE=function(r,t,n){return Ei(this,r,t,!1,n)};function Si(e,r,t,n,a){return a||Ai(e,r,t,8),hi(e,r,t,n,52,8),t+8}$.prototype.writeDoubleLE=function(r,t,n){return Si(this,r,t,!0,n)},$.prototype.writeDoubleBE=function(r,t,n){return Si(this,r,t,!1,n)},$.prototype.copy=function(r,t,n,a){if(n||(n=0),!a&&a!==0&&(a=this.length),t>=r.length&&(t=r.length),t||(t=0),a>0&&a<n&&(a=n),a===n||r.length===0||this.length===0)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(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),r.length-t<a-n&&(a=r.length-t+n);var s=a-n,c;if(this===r&&n<t&&t<a)for(c=s-1;c>=0;--c)r[c+t]=this[c+n];else if(s<1e3||!$.TYPED_ARRAY_SUPPORT)for(c=0;c<s;++c)r[c+t]=this[c+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+s),t);return s},$.prototype.fill=function(r,t,n,a){if(typeof r=="string"){if(typeof t=="string"?(a=t,t=0,n=this.length):typeof n=="string"&&(a=n,n=this.length),r.length===1){var s=r.charCodeAt(0);s<256&&(r=s)}if(a!==void 0&&typeof a!="string")throw new TypeError("encoding must be a string");if(typeof a=="string"&&!$.isEncoding(a))throw new TypeError("Unknown encoding: "+a)}else typeof r=="number"&&(r=r&255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var c;if(typeof r=="number")for(c=t;c<n;++c)this[c]=r;else{var p=ge(r)?r:Hr(new $(r,a).toString()),h=p.length;for(c=0;c<n-t;++c)this[c+t]=p[c%h]}return this};var Nu=/[^+\/0-9A-Za-z-_]/g;function Mu(e){if(e=Lu(e).replace(Nu,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Lu(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function ju(e){return e<16?"0"+e.toString(16):e.toString(16)}function Hr(e,r){r=r||1/0;for(var t,n=e.length,a=null,s=[],c=0;c<n;++c){if(t=e.charCodeAt(c),t>55295&&t<57344){if(!a){if(t>56319){(r-=3)>-1&&s.push(239,191,189);continue}else if(c+1===n){(r-=3)>-1&&s.push(239,191,189);continue}a=t;continue}if(t<56320){(r-=3)>-1&&s.push(239,191,189),a=t;continue}t=(a-55296<<10|t-56320)+65536}else a&&(r-=3)>-1&&s.push(239,191,189);if(a=null,t<128){if((r-=1)<0)break;s.push(t)}else if(t<2048){if((r-=2)<0)break;s.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;s.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;s.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}function ku(e){for(var r=[],t=0;t<e.length;++t)r.push(e.charCodeAt(t)&255);return r}function Gu(e,r){for(var t,n,a,s=[],c=0;c<e.length&&!((r-=2)<0);++c)t=e.charCodeAt(c),n=t>>8,a=t%256,s.push(a),s.push(n);return s}function xi(e){return gu(Mu(e))}function Yr(e,r,t,n){for(var a=0;a<n&&!(a+t>=r.length||a>=e.length);++a)r[a+t]=e[a];return a}function Wu(e){return e!==e}function qu(e){return e!=null&&(!!e._isBuffer||Ii(e)||zu(e))}function Ii(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function zu(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&Ii(e.slice(0,0))}function Ti(){throw new Error("setTimeout has not been defined")}function Oi(){throw new Error("clearTimeout has not been defined")}var Be=Ti,Pe=Oi;typeof tr.setTimeout=="function"&&(Be=setTimeout),typeof tr.clearTimeout=="function"&&(Pe=clearTimeout);function Bi(e){if(Be===setTimeout)return setTimeout(e,0);if((Be===Ti||!Be)&&setTimeout)return Be=setTimeout,setTimeout(e,0);try{return Be(e,0)}catch{try{return Be.call(null,e,0)}catch{return Be.call(this,e,0)}}}function Vu(e){if(Pe===clearTimeout)return clearTimeout(e);if((Pe===Oi||!Pe)&&clearTimeout)return Pe=clearTimeout,clearTimeout(e);try{return Pe(e)}catch{try{return Pe.call(null,e)}catch{return Pe.call(this,e)}}}var Ee=[],nr=!1,qe,Kr=-1;function Hu(){!nr||!qe||(nr=!1,qe.length?Ee=qe.concat(Ee):Kr=-1,Ee.length&&Pi())}function Pi(){if(!nr){var e=Bi(Hu);nr=!0;for(var r=Ee.length;r;){for(qe=Ee,Ee=[];++Kr<r;)qe&&qe[Kr].run();Kr=-1,r=Ee.length}qe=null,nr=!1,Vu(e)}}function Yu(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)r[t-1]=arguments[t];Ee.push(new Ri(e,r)),Ee.length===1&&!nr&&Bi(Pi)}function Ri(e,r){this.fun=e,this.array=r}Ri.prototype.run=function(){this.fun.apply(null,this.array)};var Ku="browser",Xu="browser",Ju=!0,Qu={},Zu=[],ec="",rc={},tc={},nc={};function ze(){}var ic=ze,oc=ze,ac=ze,sc=ze,uc=ze,cc=ze,fc=ze;function lc(e){throw new Error("process.binding is not supported")}function pc(){return"/"}function hc(e){throw new Error("process.chdir is not supported")}function dc(){return 0}var ir=tr.performance||{},yc=ir.now||ir.mozNow||ir.msNow||ir.oNow||ir.webkitNow||function(){return new Date().getTime()};function gc(e){var r=yc.call(ir)*.001,t=Math.floor(r),n=Math.floor(r%1*1e9);return e&&(t=t-e[0],n=n-e[1],n<0&&(t--,n+=1e9)),[t,n]}var vc=new Date;function mc(){var e=new Date,r=e-vc;return r/1e3}var Xr={nextTick:Yu,title:Ku,browser:Ju,env:Qu,argv:Zu,version:ec,versions:rc,on:ic,addListener:oc,once:ac,off:sc,removeListener:uc,removeAllListeners:cc,emit:fc,binding:lc,cwd:pc,chdir:hc,umask:dc,hrtime:gc,platform:Xu,release:tc,config:nc,uptime:mc},Gt;typeof Object.create=="function"?Gt=function(r,t){r.super_=t,r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}})}:Gt=function(r,t){r.super_=t;var n=function(){};n.prototype=t.prototype,r.prototype=new n,r.prototype.constructor=r};var Fi=Gt,_c=/%[sdj%]/g;function Jr(e){if(!br(e)){for(var r=[],t=0;t<arguments.length;t++)r.push(ve(arguments[t]));return r.join(" ")}for(var t=1,n=arguments,a=n.length,s=String(e).replace(_c,function(p){if(p==="%%")return"%";if(t>=a)return p;switch(p){case"%s":return String(n[t++]);case"%d":return Number(n[t++]);case"%j":try{return JSON.stringify(n[t++])}catch{return"[Circular]"}default:return p}}),c=n[t];t<a;c=n[++t])wr(c)||!Ve(c)?s+=" "+c:s+=" "+ve(c);return s}function Wt(e,r){if(me(tr.process))return function(){return Wt(e,r).apply(this,arguments)};if(Xr.noDeprecation===!0)return e;var t=!1;function n(){if(!t){if(Xr.throwDeprecation)throw new Error(r);Xr.traceDeprecation?console.trace(r):console.error(r),t=!0}return e.apply(this,arguments)}return n}var Qr={},qt;function Ci(e){if(me(qt)&&(qt=Xr.env.NODE_DEBUG||""),e=e.toUpperCase(),!Qr[e])if(new RegExp("\\b"+e+"\\b","i").test(qt)){var r=0;Qr[e]=function(){var t=Jr.apply(null,arguments);console.error("%s %d: %s",e,r,t)}}else Qr[e]=function(){};return Qr[e]}function ve(e,r){var t={seen:[],stylize:bc};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),et(r)?t.showHidden=r:r&&Jt(t,r),me(t.showHidden)&&(t.showHidden=!1),me(t.depth)&&(t.depth=2),me(t.colors)&&(t.colors=!1),me(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=wc),Zr(t,e,t.depth)}ve.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},ve.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function wc(e,r){var t=ve.styles[r];return t?"\x1B["+ve.colors[t][0]+"m"+e+"\x1B["+ve.colors[t][1]+"m":e}function bc(e,r){return e}function $c(e){var r={};return e.forEach(function(t,n){r[t]=!0}),r}function Zr(e,r,t){if(e.customInspect&&r&&Er(r.inspect)&&r.inspect!==ve&&!(r.constructor&&r.constructor.prototype===r)){var n=r.inspect(t,e);return br(n)||(n=Zr(e,n,t)),n}var a=Ac(e,r);if(a)return a;var s=Object.keys(r),c=$c(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),Ar(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return zt(r);if(s.length===0){if(Er(r)){var p=r.name?": "+r.name:"";return e.stylize("[Function"+p+"]","special")}if($r(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(rt(r))return e.stylize(Date.prototype.toString.call(r),"date");if(Ar(r))return zt(r)}var h="",v=!1,_=["{","}"];if(Ht(r)&&(v=!0,_=["[","]"]),Er(r)){var w=r.name?": "+r.name:"";h=" [Function"+w+"]"}if($r(r)&&(h=" "+RegExp.prototype.toString.call(r)),rt(r)&&(h=" "+Date.prototype.toUTCString.call(r)),Ar(r)&&(h=" "+zt(r)),s.length===0&&(!v||r.length==0))return _[0]+h+_[1];if(t<0)return $r(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special");e.seen.push(r);var b;return v?b=Ec(e,r,t,c,s):b=s.map(function(d){return Vt(e,r,t,c,d,v)}),e.seen.pop(),Sc(b,h,_)}function Ac(e,r){if(me(r))return e.stylize("undefined","undefined");if(br(r)){var t="'"+JSON.stringify(r).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(t,"string")}if(Yt(r))return e.stylize(""+r,"number");if(et(r))return e.stylize(""+r,"boolean");if(wr(r))return e.stylize("null","null")}function zt(e){return"["+Error.prototype.toString.call(e)+"]"}function Ec(e,r,t,n,a){for(var s=[],c=0,p=r.length;c<p;++c)ji(r,String(c))?s.push(Vt(e,r,t,n,String(c),!0)):s.push("");return a.forEach(function(h){h.match(/^\d+$/)||s.push(Vt(e,r,t,n,h,!0))}),s}function Vt(e,r,t,n,a,s){var c,p,h;if(h=Object.getOwnPropertyDescriptor(r,a)||{value:r[a]},h.get?h.set?p=e.stylize("[Getter/Setter]","special"):p=e.stylize("[Getter]","special"):h.set&&(p=e.stylize("[Setter]","special")),ji(n,a)||(c="["+a+"]"),p||(e.seen.indexOf(h.value)<0?(wr(t)?p=Zr(e,h.value,null):p=Zr(e,h.value,t-1),p.indexOf(`
|
|
8
|
+
*/var $u=50;$.TYPED_ARRAY_SUPPORT=tr.TYPED_ARRAY_SUPPORT!==void 0?tr.TYPED_ARRAY_SUPPORT:!0,qr();function qr(){return $.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Ae(e,r){if(qr()<r)throw new RangeError("Invalid typed array length");return $.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(r),e.__proto__=$.prototype):(e===null&&(e=new $(r)),e.length=r),e}function $(e,r,t){if(!$.TYPED_ARRAY_SUPPORT&&!(this instanceof $))return new $(e,r,t);if(typeof e=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return Lt(this,e)}return yi(this,e,r,t)}$.poolSize=8192,$._augment=function(e){return e.__proto__=$.prototype,e};function yi(e,r,t,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Su(e,r,t,n):typeof r=="string"?Eu(e,r,t):xu(e,r)}$.from=function(e,r,t){return yi(null,e,r,t)},$.TYPED_ARRAY_SUPPORT&&($.prototype.__proto__=Uint8Array.prototype,$.__proto__=Uint8Array);function gi(e){if(typeof e!="number")throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function Au(e,r,t,n){return gi(r),r<=0?Ae(e,r):t!==void 0?typeof n=="string"?Ae(e,r).fill(t,n):Ae(e,r).fill(t):Ae(e,r)}$.alloc=function(e,r,t){return Au(null,e,r,t)};function Lt(e,r){if(gi(r),e=Ae(e,r<0?0:kt(r)|0),!$.TYPED_ARRAY_SUPPORT)for(var t=0;t<r;++t)e[t]=0;return e}$.allocUnsafe=function(e){return Lt(null,e)},$.allocUnsafeSlow=function(e){return Lt(null,e)};function Eu(e,r,t){if((typeof t!="string"||t==="")&&(t="utf8"),!$.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var n=vi(r,t)|0;e=Ae(e,n);var a=e.write(r,t);return a!==n&&(e=e.slice(0,a)),e}function jt(e,r){var t=r.length<0?0:kt(r.length)|0;e=Ae(e,t);for(var n=0;n<t;n+=1)e[n]=r[n]&255;return e}function Su(e,r,t,n){if(r.byteLength,t<0||r.byteLength<t)throw new RangeError("'offset' is out of bounds");if(r.byteLength<t+(n||0))throw new RangeError("'length' is out of bounds");return t===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,t):r=new Uint8Array(r,t,n),$.TYPED_ARRAY_SUPPORT?(e=r,e.__proto__=$.prototype):e=jt(e,r),e}function xu(e,r){if(ge(r)){var t=kt(r.length)|0;return e=Ae(e,t),e.length===0||r.copy(e,0,0,t),e}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||zu(r.length)?Ae(e,0):jt(e,r);if(r.type==="Buffer"&&di(r.data))return jt(e,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function kt(e){if(e>=qr())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+qr().toString(16)+" bytes");return e|0}$.isBuffer=Vu;function ge(e){return!!(e!=null&&e._isBuffer)}$.compare=function(r,t){if(!ge(r)||!ge(t))throw new TypeError("Arguments must be Buffers");if(r===t)return 0;for(var n=r.length,a=t.length,s=0,c=Math.min(n,a);s<c;++s)if(r[s]!==t[s]){n=r[s],a=t[s];break}return n<a?-1:a<n?1:0},$.isEncoding=function(r){switch(String(r).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}},$.concat=function(r,t){if(!di(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return $.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<r.length;++n)t+=r[n].length;var a=$.allocUnsafe(t),s=0;for(n=0;n<r.length;++n){var c=r[n];if(!ge(c))throw new TypeError('"list" argument must be an Array of Buffers');c.copy(a,s),s+=c.length}return a};function vi(e,r){if(ge(e))return e.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;typeof e!="string"&&(e=""+e);var t=e.length;if(t===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return Hr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return xi(e).length;default:if(n)return Hr(e).length;r=(""+r).toLowerCase(),n=!0}}$.byteLength=vi;function Iu(e,r,t){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return Nu(this,r,t);case"utf8":case"utf-8":return bi(this,r,t);case"ascii":return Uu(this,r,t);case"latin1":case"binary":return Du(this,r,t);case"base64":return Fu(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Mu(this,r,t);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}$.prototype._isBuffer=!0;function We(e,r,t){var n=e[r];e[r]=e[t],e[t]=n}$.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<r;t+=2)We(this,t,t+1);return this},$.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<r;t+=4)We(this,t,t+3),We(this,t+1,t+2);return this},$.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<r;t+=8)We(this,t,t+7),We(this,t+1,t+6),We(this,t+2,t+5),We(this,t+3,t+4);return this},$.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?bi(this,0,r):Iu.apply(this,arguments)},$.prototype.equals=function(r){if(!ge(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:$.compare(this,r)===0},$.prototype.inspect=function(){var r="",t=$u;return this.length>0&&(r=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(r+=" ... ")),"<Buffer "+r+">"},$.prototype.compare=function(r,t,n,a,s){if(!ge(r))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),n===void 0&&(n=r?r.length:0),a===void 0&&(a=0),s===void 0&&(s=this.length),t<0||n>r.length||a<0||s>this.length)throw new RangeError("out of range index");if(a>=s&&t>=n)return 0;if(a>=s)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,a>>>=0,s>>>=0,this===r)return 0;for(var c=s-a,p=n-t,h=Math.min(c,p),v=this.slice(a,s),_=r.slice(t,n),w=0;w<h;++w)if(v[w]!==_[w]){c=v[w],p=_[w];break}return c<p?-1:p<c?1:0};function mi(e,r,t,n,a){if(e.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=a?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(a)return-1;t=e.length-1}else if(t<0)if(a)t=0;else return-1;if(typeof r=="string"&&(r=$.from(r,n)),ge(r))return r.length===0?-1:_i(e,r,t,n,a);if(typeof r=="number")return r=r&255,$.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?a?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):_i(e,[r],t,n,a);throw new TypeError("val must be string, number or Buffer")}function _i(e,r,t,n,a){var s=1,c=e.length,p=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||r.length<2)return-1;s=2,c/=2,p/=2,t/=2}function h(d,E){return s===1?d[E]:d.readUInt16BE(E*s)}var v;if(a){var _=-1;for(v=t;v<c;v++)if(h(e,v)===h(r,_===-1?0:v-_)){if(_===-1&&(_=v),v-_+1===p)return _*s}else _!==-1&&(v-=v-_),_=-1}else for(t+p>c&&(t=c-p),v=t;v>=0;v--){for(var w=!0,b=0;b<p;b++)if(h(e,v+b)!==h(r,b)){w=!1;break}if(w)return v}return-1}$.prototype.includes=function(r,t,n){return this.indexOf(r,t,n)!==-1},$.prototype.indexOf=function(r,t,n){return mi(this,r,t,n,!0)},$.prototype.lastIndexOf=function(r,t,n){return mi(this,r,t,n,!1)};function Tu(e,r,t,n){t=Number(t)||0;var a=e.length-t;n?(n=Number(n),n>a&&(n=a)):n=a;var s=r.length;if(s%2!==0)throw new TypeError("Invalid hex string");n>s/2&&(n=s/2);for(var c=0;c<n;++c){var p=parseInt(r.substr(c*2,2),16);if(isNaN(p))return c;e[t+c]=p}return c}function Ou(e,r,t,n){return Yr(Hr(r,e.length-t),e,t,n)}function wi(e,r,t,n){return Yr(Wu(r),e,t,n)}function Bu(e,r,t,n){return wi(e,r,t,n)}function Pu(e,r,t,n){return Yr(xi(r),e,t,n)}function Ru(e,r,t,n){return Yr(qu(r,e.length-t),e,t,n)}$.prototype.write=function(r,t,n,a){if(t===void 0)a="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")a=t,n=this.length,t=0;else if(isFinite(t))t=t|0,isFinite(n)?(n=n|0,a===void 0&&(a="utf8")):(a=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s=this.length-t;if((n===void 0||n>s)&&(n=s),r.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var c=!1;;)switch(a){case"hex":return Tu(this,r,t,n);case"utf8":case"utf-8":return Ou(this,r,t,n);case"ascii":return wi(this,r,t,n);case"latin1":case"binary":return Bu(this,r,t,n);case"base64":return Pu(this,r,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ru(this,r,t,n);default:if(c)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),c=!0}},$.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Fu(e,r,t){return r===0&&t===e.length?pi(e):pi(e.slice(r,t))}function bi(e,r,t){t=Math.min(e.length,t);for(var n=[],a=r;a<t;){var s=e[a],c=null,p=s>239?4:s>223?3:s>191?2:1;if(a+p<=t){var h,v,_,w;switch(p){case 1:s<128&&(c=s);break;case 2:h=e[a+1],(h&192)===128&&(w=(s&31)<<6|h&63,w>127&&(c=w));break;case 3:h=e[a+1],v=e[a+2],(h&192)===128&&(v&192)===128&&(w=(s&15)<<12|(h&63)<<6|v&63,w>2047&&(w<55296||w>57343)&&(c=w));break;case 4:h=e[a+1],v=e[a+2],_=e[a+3],(h&192)===128&&(v&192)===128&&(_&192)===128&&(w=(s&15)<<18|(h&63)<<12|(v&63)<<6|_&63,w>65535&&w<1114112&&(c=w))}}c===null?(c=65533,p=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|c&1023),n.push(c),a+=p}return Cu(n)}var $i=4096;function Cu(e){var r=e.length;if(r<=$i)return String.fromCharCode.apply(String,e);for(var t="",n=0;n<r;)t+=String.fromCharCode.apply(String,e.slice(n,n+=$i));return t}function Uu(e,r,t){var n="";t=Math.min(e.length,t);for(var a=r;a<t;++a)n+=String.fromCharCode(e[a]&127);return n}function Du(e,r,t){var n="";t=Math.min(e.length,t);for(var a=r;a<t;++a)n+=String.fromCharCode(e[a]);return n}function Nu(e,r,t){var n=e.length;(!r||r<0)&&(r=0),(!t||t<0||t>n)&&(t=n);for(var a="",s=r;s<t;++s)a+=Gu(e[s]);return a}function Mu(e,r,t){for(var n=e.slice(r,t),a="",s=0;s<n.length;s+=2)a+=String.fromCharCode(n[s]+n[s+1]*256);return a}$.prototype.slice=function(r,t){var n=this.length;r=~~r,t=t===void 0?n:~~t,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<r&&(t=r);var a;if($.TYPED_ARRAY_SUPPORT)a=this.subarray(r,t),a.__proto__=$.prototype;else{var s=t-r;a=new $(s,void 0);for(var c=0;c<s;++c)a[c]=this[c+r]}return a};function K(e,r,t){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+r>t)throw new RangeError("Trying to access beyond buffer length")}$.prototype.readUIntLE=function(r,t,n){r=r|0,t=t|0,n||K(r,t,this.length);for(var a=this[r],s=1,c=0;++c<t&&(s*=256);)a+=this[r+c]*s;return a},$.prototype.readUIntBE=function(r,t,n){r=r|0,t=t|0,n||K(r,t,this.length);for(var a=this[r+--t],s=1;t>0&&(s*=256);)a+=this[r+--t]*s;return a},$.prototype.readUInt8=function(r,t){return t||K(r,1,this.length),this[r]},$.prototype.readUInt16LE=function(r,t){return t||K(r,2,this.length),this[r]|this[r+1]<<8},$.prototype.readUInt16BE=function(r,t){return t||K(r,2,this.length),this[r]<<8|this[r+1]},$.prototype.readUInt32LE=function(r,t){return t||K(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216},$.prototype.readUInt32BE=function(r,t){return t||K(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])},$.prototype.readIntLE=function(r,t,n){r=r|0,t=t|0,n||K(r,t,this.length);for(var a=this[r],s=1,c=0;++c<t&&(s*=256);)a+=this[r+c]*s;return s*=128,a>=s&&(a-=Math.pow(2,8*t)),a},$.prototype.readIntBE=function(r,t,n){r=r|0,t=t|0,n||K(r,t,this.length);for(var a=t,s=1,c=this[r+--a];a>0&&(s*=256);)c+=this[r+--a]*s;return s*=128,c>=s&&(c-=Math.pow(2,8*t)),c},$.prototype.readInt8=function(r,t){return t||K(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]},$.prototype.readInt16LE=function(r,t){t||K(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n},$.prototype.readInt16BE=function(r,t){t||K(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n},$.prototype.readInt32LE=function(r,t){return t||K(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},$.prototype.readInt32BE=function(r,t){return t||K(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},$.prototype.readFloatLE=function(r,t){return t||K(r,4,this.length),Wr(this,r,!0,23,4)},$.prototype.readFloatBE=function(r,t){return t||K(r,4,this.length),Wr(this,r,!1,23,4)},$.prototype.readDoubleLE=function(r,t){return t||K(r,8,this.length),Wr(this,r,!0,52,8)},$.prototype.readDoubleBE=function(r,t){return t||K(r,8,this.length),Wr(this,r,!1,52,8)};function ie(e,r,t,n,a,s){if(!ge(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>a||r<s)throw new RangeError('"value" argument is out of bounds');if(t+n>e.length)throw new RangeError("Index out of range")}$.prototype.writeUIntLE=function(r,t,n,a){if(r=+r,t=t|0,n=n|0,!a){var s=Math.pow(2,8*n)-1;ie(this,r,t,n,s,0)}var c=1,p=0;for(this[t]=r&255;++p<n&&(c*=256);)this[t+p]=r/c&255;return t+n},$.prototype.writeUIntBE=function(r,t,n,a){if(r=+r,t=t|0,n=n|0,!a){var s=Math.pow(2,8*n)-1;ie(this,r,t,n,s,0)}var c=n-1,p=1;for(this[t+c]=r&255;--c>=0&&(p*=256);)this[t+c]=r/p&255;return t+n},$.prototype.writeUInt8=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,1,255,0),$.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[t]=r&255,t+1};function zr(e,r,t,n){r<0&&(r=65535+r+1);for(var a=0,s=Math.min(e.length-t,2);a<s;++a)e[t+a]=(r&255<<8*(n?a:1-a))>>>(n?a:1-a)*8}$.prototype.writeUInt16LE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,2,65535,0),$.TYPED_ARRAY_SUPPORT?(this[t]=r&255,this[t+1]=r>>>8):zr(this,r,t,!0),t+2},$.prototype.writeUInt16BE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,2,65535,0),$.TYPED_ARRAY_SUPPORT?(this[t]=r>>>8,this[t+1]=r&255):zr(this,r,t,!1),t+2};function Vr(e,r,t,n){r<0&&(r=4294967295+r+1);for(var a=0,s=Math.min(e.length-t,4);a<s;++a)e[t+a]=r>>>(n?a:3-a)*8&255}$.prototype.writeUInt32LE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,4,4294967295,0),$.TYPED_ARRAY_SUPPORT?(this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255):Vr(this,r,t,!0),t+4},$.prototype.writeUInt32BE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,4,4294967295,0),$.TYPED_ARRAY_SUPPORT?(this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255):Vr(this,r,t,!1),t+4},$.prototype.writeIntLE=function(r,t,n,a){if(r=+r,t=t|0,!a){var s=Math.pow(2,8*n-1);ie(this,r,t,n,s-1,-s)}var c=0,p=1,h=0;for(this[t]=r&255;++c<n&&(p*=256);)r<0&&h===0&&this[t+c-1]!==0&&(h=1),this[t+c]=(r/p>>0)-h&255;return t+n},$.prototype.writeIntBE=function(r,t,n,a){if(r=+r,t=t|0,!a){var s=Math.pow(2,8*n-1);ie(this,r,t,n,s-1,-s)}var c=n-1,p=1,h=0;for(this[t+c]=r&255;--c>=0&&(p*=256);)r<0&&h===0&&this[t+c+1]!==0&&(h=1),this[t+c]=(r/p>>0)-h&255;return t+n},$.prototype.writeInt8=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,1,127,-128),$.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[t]=r&255,t+1},$.prototype.writeInt16LE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,2,32767,-32768),$.TYPED_ARRAY_SUPPORT?(this[t]=r&255,this[t+1]=r>>>8):zr(this,r,t,!0),t+2},$.prototype.writeInt16BE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,2,32767,-32768),$.TYPED_ARRAY_SUPPORT?(this[t]=r>>>8,this[t+1]=r&255):zr(this,r,t,!1),t+2},$.prototype.writeInt32LE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,4,2147483647,-2147483648),$.TYPED_ARRAY_SUPPORT?(this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24):Vr(this,r,t,!0),t+4},$.prototype.writeInt32BE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),$.TYPED_ARRAY_SUPPORT?(this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255):Vr(this,r,t,!1),t+4};function Ai(e,r,t,n,a,s){if(t+n>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Ei(e,r,t,n,a){return a||Ai(e,r,t,4),hi(e,r,t,n,23,4),t+4}$.prototype.writeFloatLE=function(r,t,n){return Ei(this,r,t,!0,n)},$.prototype.writeFloatBE=function(r,t,n){return Ei(this,r,t,!1,n)};function Si(e,r,t,n,a){return a||Ai(e,r,t,8),hi(e,r,t,n,52,8),t+8}$.prototype.writeDoubleLE=function(r,t,n){return Si(this,r,t,!0,n)},$.prototype.writeDoubleBE=function(r,t,n){return Si(this,r,t,!1,n)},$.prototype.copy=function(r,t,n,a){if(n||(n=0),!a&&a!==0&&(a=this.length),t>=r.length&&(t=r.length),t||(t=0),a>0&&a<n&&(a=n),a===n||r.length===0||this.length===0)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(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),r.length-t<a-n&&(a=r.length-t+n);var s=a-n,c;if(this===r&&n<t&&t<a)for(c=s-1;c>=0;--c)r[c+t]=this[c+n];else if(s<1e3||!$.TYPED_ARRAY_SUPPORT)for(c=0;c<s;++c)r[c+t]=this[c+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+s),t);return s},$.prototype.fill=function(r,t,n,a){if(typeof r=="string"){if(typeof t=="string"?(a=t,t=0,n=this.length):typeof n=="string"&&(a=n,n=this.length),r.length===1){var s=r.charCodeAt(0);s<256&&(r=s)}if(a!==void 0&&typeof a!="string")throw new TypeError("encoding must be a string");if(typeof a=="string"&&!$.isEncoding(a))throw new TypeError("Unknown encoding: "+a)}else typeof r=="number"&&(r=r&255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var c;if(typeof r=="number")for(c=t;c<n;++c)this[c]=r;else{var p=ge(r)?r:Hr(new $(r,a).toString()),h=p.length;for(c=0;c<n-t;++c)this[c+t]=p[c%h]}return this};var Lu=/[^+\/0-9A-Za-z-_]/g;function ju(e){if(e=ku(e).replace(Lu,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function ku(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Gu(e){return e<16?"0"+e.toString(16):e.toString(16)}function Hr(e,r){r=r||1/0;for(var t,n=e.length,a=null,s=[],c=0;c<n;++c){if(t=e.charCodeAt(c),t>55295&&t<57344){if(!a){if(t>56319){(r-=3)>-1&&s.push(239,191,189);continue}else if(c+1===n){(r-=3)>-1&&s.push(239,191,189);continue}a=t;continue}if(t<56320){(r-=3)>-1&&s.push(239,191,189),a=t;continue}t=(a-55296<<10|t-56320)+65536}else a&&(r-=3)>-1&&s.push(239,191,189);if(a=null,t<128){if((r-=1)<0)break;s.push(t)}else if(t<2048){if((r-=2)<0)break;s.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;s.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;s.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}function Wu(e){for(var r=[],t=0;t<e.length;++t)r.push(e.charCodeAt(t)&255);return r}function qu(e,r){for(var t,n,a,s=[],c=0;c<e.length&&!((r-=2)<0);++c)t=e.charCodeAt(c),n=t>>8,a=t%256,s.push(a),s.push(n);return s}function xi(e){return mu(ju(e))}function Yr(e,r,t,n){for(var a=0;a<n&&!(a+t>=r.length||a>=e.length);++a)r[a+t]=e[a];return a}function zu(e){return e!==e}function Vu(e){return e!=null&&(!!e._isBuffer||Ii(e)||Hu(e))}function Ii(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function Hu(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&Ii(e.slice(0,0))}function Ti(){throw new Error("setTimeout has not been defined")}function Oi(){throw new Error("clearTimeout has not been defined")}var Be=Ti,Pe=Oi;typeof tr.setTimeout=="function"&&(Be=setTimeout),typeof tr.clearTimeout=="function"&&(Pe=clearTimeout);function Bi(e){if(Be===setTimeout)return setTimeout(e,0);if((Be===Ti||!Be)&&setTimeout)return Be=setTimeout,setTimeout(e,0);try{return Be(e,0)}catch{try{return Be.call(null,e,0)}catch{return Be.call(this,e,0)}}}function Yu(e){if(Pe===clearTimeout)return clearTimeout(e);if((Pe===Oi||!Pe)&&clearTimeout)return Pe=clearTimeout,clearTimeout(e);try{return Pe(e)}catch{try{return Pe.call(null,e)}catch{return Pe.call(this,e)}}}var Ee=[],nr=!1,qe,Kr=-1;function Ku(){!nr||!qe||(nr=!1,qe.length?Ee=qe.concat(Ee):Kr=-1,Ee.length&&Pi())}function Pi(){if(!nr){var e=Bi(Ku);nr=!0;for(var r=Ee.length;r;){for(qe=Ee,Ee=[];++Kr<r;)qe&&qe[Kr].run();Kr=-1,r=Ee.length}qe=null,nr=!1,Yu(e)}}function Xu(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)r[t-1]=arguments[t];Ee.push(new Ri(e,r)),Ee.length===1&&!nr&&Bi(Pi)}function Ri(e,r){this.fun=e,this.array=r}Ri.prototype.run=function(){this.fun.apply(null,this.array)};var Ju="browser",Qu="browser",Zu=!0,ec={},rc=[],tc="",nc={},ic={},oc={};function ze(){}var ac=ze,sc=ze,uc=ze,cc=ze,fc=ze,lc=ze,pc=ze;function hc(e){throw new Error("process.binding is not supported")}function dc(){return"/"}function yc(e){throw new Error("process.chdir is not supported")}function gc(){return 0}var ir=tr.performance||{},vc=ir.now||ir.mozNow||ir.msNow||ir.oNow||ir.webkitNow||function(){return new Date().getTime()};function mc(e){var r=vc.call(ir)*.001,t=Math.floor(r),n=Math.floor(r%1*1e9);return e&&(t=t-e[0],n=n-e[1],n<0&&(t--,n+=1e9)),[t,n]}var _c=new Date;function wc(){var e=new Date,r=e-_c;return r/1e3}var Xr={nextTick:Xu,title:Ju,browser:Zu,env:ec,argv:rc,version:tc,versions:nc,on:ac,addListener:sc,once:uc,off:cc,removeListener:fc,removeAllListeners:lc,emit:pc,binding:hc,cwd:dc,chdir:yc,umask:gc,hrtime:mc,platform:Qu,release:ic,config:oc,uptime:wc},Gt;typeof Object.create=="function"?Gt=function(r,t){r.super_=t,r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}})}:Gt=function(r,t){r.super_=t;var n=function(){};n.prototype=t.prototype,r.prototype=new n,r.prototype.constructor=r};var Fi=Gt,bc=/%[sdj%]/g;function Jr(e){if(!br(e)){for(var r=[],t=0;t<arguments.length;t++)r.push(ve(arguments[t]));return r.join(" ")}for(var t=1,n=arguments,a=n.length,s=String(e).replace(bc,function(p){if(p==="%%")return"%";if(t>=a)return p;switch(p){case"%s":return String(n[t++]);case"%d":return Number(n[t++]);case"%j":try{return JSON.stringify(n[t++])}catch{return"[Circular]"}default:return p}}),c=n[t];t<a;c=n[++t])wr(c)||!Ve(c)?s+=" "+c:s+=" "+ve(c);return s}function Wt(e,r){if(me(tr.process))return function(){return Wt(e,r).apply(this,arguments)};if(Xr.noDeprecation===!0)return e;var t=!1;function n(){if(!t){if(Xr.throwDeprecation)throw new Error(r);Xr.traceDeprecation?console.trace(r):console.error(r),t=!0}return e.apply(this,arguments)}return n}var Qr={},qt;function Ci(e){if(me(qt)&&(qt=Xr.env.NODE_DEBUG||""),e=e.toUpperCase(),!Qr[e])if(new RegExp("\\b"+e+"\\b","i").test(qt)){var r=0;Qr[e]=function(){var t=Jr.apply(null,arguments);console.error("%s %d: %s",e,r,t)}}else Qr[e]=function(){};return Qr[e]}function ve(e,r){var t={seen:[],stylize:Ac};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),et(r)?t.showHidden=r:r&&Jt(t,r),me(t.showHidden)&&(t.showHidden=!1),me(t.depth)&&(t.depth=2),me(t.colors)&&(t.colors=!1),me(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=$c),Zr(t,e,t.depth)}ve.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},ve.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function $c(e,r){var t=ve.styles[r];return t?"\x1B["+ve.colors[t][0]+"m"+e+"\x1B["+ve.colors[t][1]+"m":e}function Ac(e,r){return e}function Ec(e){var r={};return e.forEach(function(t,n){r[t]=!0}),r}function Zr(e,r,t){if(e.customInspect&&r&&Er(r.inspect)&&r.inspect!==ve&&!(r.constructor&&r.constructor.prototype===r)){var n=r.inspect(t,e);return br(n)||(n=Zr(e,n,t)),n}var a=Sc(e,r);if(a)return a;var s=Object.keys(r),c=Ec(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),Ar(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return zt(r);if(s.length===0){if(Er(r)){var p=r.name?": "+r.name:"";return e.stylize("[Function"+p+"]","special")}if($r(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(rt(r))return e.stylize(Date.prototype.toString.call(r),"date");if(Ar(r))return zt(r)}var h="",v=!1,_=["{","}"];if(Ht(r)&&(v=!0,_=["[","]"]),Er(r)){var w=r.name?": "+r.name:"";h=" [Function"+w+"]"}if($r(r)&&(h=" "+RegExp.prototype.toString.call(r)),rt(r)&&(h=" "+Date.prototype.toUTCString.call(r)),Ar(r)&&(h=" "+zt(r)),s.length===0&&(!v||r.length==0))return _[0]+h+_[1];if(t<0)return $r(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special");e.seen.push(r);var b;return v?b=xc(e,r,t,c,s):b=s.map(function(d){return Vt(e,r,t,c,d,v)}),e.seen.pop(),Ic(b,h,_)}function Sc(e,r){if(me(r))return e.stylize("undefined","undefined");if(br(r)){var t="'"+JSON.stringify(r).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(t,"string")}if(Yt(r))return e.stylize(""+r,"number");if(et(r))return e.stylize(""+r,"boolean");if(wr(r))return e.stylize("null","null")}function zt(e){return"["+Error.prototype.toString.call(e)+"]"}function xc(e,r,t,n,a){for(var s=[],c=0,p=r.length;c<p;++c)ji(r,String(c))?s.push(Vt(e,r,t,n,String(c),!0)):s.push("");return a.forEach(function(h){h.match(/^\d+$/)||s.push(Vt(e,r,t,n,h,!0))}),s}function Vt(e,r,t,n,a,s){var c,p,h;if(h=Object.getOwnPropertyDescriptor(r,a)||{value:r[a]},h.get?h.set?p=e.stylize("[Getter/Setter]","special"):p=e.stylize("[Getter]","special"):h.set&&(p=e.stylize("[Setter]","special")),ji(n,a)||(c="["+a+"]"),p||(e.seen.indexOf(h.value)<0?(wr(t)?p=Zr(e,h.value,null):p=Zr(e,h.value,t-1),p.indexOf(`
|
|
9
9
|
`)>-1&&(s?p=p.split(`
|
|
10
10
|
`).map(function(v){return" "+v}).join(`
|
|
11
11
|
`).substr(2):p=`
|
|
12
12
|
`+p.split(`
|
|
13
13
|
`).map(function(v){return" "+v}).join(`
|
|
14
|
-
`))):p=e.stylize("[Circular]","special")),me(c)){if(s&&a.match(/^\d+$/))return p;c=JSON.stringify(""+a),c.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(c=c.substr(1,c.length-2),c=e.stylize(c,"name")):(c=c.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),c=e.stylize(c,"string"))}return c+": "+p}function
|
|
14
|
+
`))):p=e.stylize("[Circular]","special")),me(c)){if(s&&a.match(/^\d+$/))return p;c=JSON.stringify(""+a),c.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(c=c.substr(1,c.length-2),c=e.stylize(c,"name")):(c=c.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),c=e.stylize(c,"string"))}return c+": "+p}function Ic(e,r,t){var n=e.reduce(function(a,s){return s.indexOf(`
|
|
15
15
|
`)>=0,a+s.replace(/\u001b\[\d\d?m/g,"").length+1},0);return n>60?t[0]+(r===""?"":r+`
|
|
16
16
|
`)+" "+e.join(`,
|
|
17
|
-
`)+" "+t[1]:t[0]+r+" "+e.join(", ")+" "+t[1]}function Ht(e){return Array.isArray(e)}function et(e){return typeof e=="boolean"}function wr(e){return e===null}function Ui(e){return e==null}function Yt(e){return typeof e=="number"}function br(e){return typeof e=="string"}function Di(e){return typeof e=="symbol"}function me(e){return e===void 0}function $r(e){return Ve(e)&&Kt(e)==="[object RegExp]"}function Ve(e){return typeof e=="object"&&e!==null}function rt(e){return Ve(e)&&Kt(e)==="[object Date]"}function Ar(e){return Ve(e)&&(Kt(e)==="[object Error]"||e instanceof Error)}function Er(e){return typeof e=="function"}function Ni(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e>"u"}function Mi(e){return $.isBuffer(e)}function Kt(e){return Object.prototype.toString.call(e)}function Xt(e){return e<10?"0"+e.toString(10):e.toString(10)}var xc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ic(){var e=new Date,r=[Xt(e.getHours()),Xt(e.getMinutes()),Xt(e.getSeconds())].join(":");return[e.getDate(),xc[e.getMonth()],r].join(" ")}function Li(){console.log("%s - %s",Ic(),Jr.apply(null,arguments))}function Jt(e,r){if(!r||!Ve(r))return e;for(var t=Object.keys(r),n=t.length;n--;)e[t[n]]=r[t[n]];return e}function ji(e,r){return Object.prototype.hasOwnProperty.call(e,r)}var Tc={inherits:Fi,_extend:Jt,log:Li,isBuffer:Mi,isPrimitive:Ni,isFunction:Er,isError:Ar,isDate:rt,isObject:Ve,isRegExp:$r,isUndefined:me,isSymbol:Di,isString:br,isNumber:Yt,isNullOrUndefined:Ui,isNull:wr,isBoolean:et,isArray:Ht,inspect:ve,deprecate:Wt,format:Jr,debuglog:Ci},Oc=Object.freeze({__proto__:null,format:Jr,deprecate:Wt,debuglog:Ci,inspect:ve,isArray:Ht,isBoolean:et,isNull:wr,isNullOrUndefined:Ui,isNumber:Yt,isString:br,isSymbol:Di,isUndefined:me,isRegExp:$r,isObject:Ve,isDate:rt,isError:Ar,isFunction:Er,isPrimitive:Ni,isBuffer:Mi,log:Li,inherits:Fi,_extend:Jt,default:Tc}),Bc=vr(Oc),Pc=Bc.inspect,Qt=typeof Map=="function"&&Map.prototype,Zt=Object.getOwnPropertyDescriptor&&Qt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,tt=Qt&&Zt&&typeof Zt.get=="function"?Zt.get:null,ki=Qt&&Map.prototype.forEach,en=typeof Set=="function"&&Set.prototype,rn=Object.getOwnPropertyDescriptor&&en?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,nt=en&&rn&&typeof rn.get=="function"?rn.get:null,Gi=en&&Set.prototype.forEach,Rc=typeof WeakMap=="function"&&WeakMap.prototype,Sr=Rc?WeakMap.prototype.has:null,Fc=typeof WeakSet=="function"&&WeakSet.prototype,xr=Fc?WeakSet.prototype.has:null,Cc=typeof WeakRef=="function"&&WeakRef.prototype,Wi=Cc?WeakRef.prototype.deref:null,Uc=Boolean.prototype.valueOf,Dc=Object.prototype.toString,Nc=Function.prototype.toString,Mc=String.prototype.match,tn=String.prototype.slice,Re=String.prototype.replace,Lc=String.prototype.toUpperCase,qi=String.prototype.toLowerCase,zi=RegExp.prototype.test,Vi=Array.prototype.concat,_e=Array.prototype.join,jc=Array.prototype.slice,Hi=Math.floor,nn=typeof BigInt=="function"?BigInt.prototype.valueOf:null,on=Object.getOwnPropertySymbols,an=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,or=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ee=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===or?"object":"symbol")?Symbol.toStringTag:null,Yi=Object.prototype.propertyIsEnumerable,Ki=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function Xi(e,r){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||zi.call(/e/,r))return r;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var n=e<0?-Hi(-e):Hi(e);if(n!==e){var a=String(n),s=tn.call(r,a.length+1);return Re.call(a,t,"$&_")+"."+Re.call(Re.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Re.call(r,t,"$&_")}var sn=Pc,Ji=sn.custom,Qi=ro(Ji)?Ji:null,kc=function e(r,t,n,a){var s=t||{};if(Fe(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Fe(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=Fe(s,"customInspect")?s.customInspect:!0;if(typeof c!="boolean"&&c!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Fe(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Fe(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var p=s.numericSeparator;if(typeof r>"u")return"undefined";if(r===null)return"null";if(typeof r=="boolean")return r?"true":"false";if(typeof r=="string")return no(r,s);if(typeof r=="number"){if(r===0)return 1/0/r>0?"0":"-0";var h=String(r);return p?Xi(r,h):h}if(typeof r=="bigint"){var v=String(r)+"n";return p?Xi(r,v):v}var _=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=_&&_>0&&typeof r=="object")return un(r)?"[Array]":"[Object]";var w=af(s,n);if(typeof a>"u")a=[];else if(to(a,r)>=0)return"[Circular]";function b(k,re,N){if(re&&(a=jc.call(a),a.push(re)),N){var ce={depth:s.depth};return Fe(s,"quoteStyle")&&(ce.quoteStyle=s.quoteStyle),e(k,ce,n+1,a)}return e(k,s,n+1,a)}if(typeof r=="function"&&!eo(r)){var d=Xc(r),E=it(r,b);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(E.length>0?" { "+_e.call(E,", ")+" }":"")}if(ro(r)){var x=or?Re.call(String(r),/^(Symbol\(.*\))_[^)]*$/,"$1"):an.call(r);return typeof r=="object"&&!or?Ir(x):x}if(tf(r)){for(var I="<"+qi.call(String(r.nodeName)),S=r.attributes||[],T=0;T<S.length;T++)I+=" "+S[T].name+"="+Zi(Gc(S[T].value),"double",s);return I+=">",r.childNodes&&r.childNodes.length&&(I+="..."),I+="</"+qi.call(String(r.nodeName))+">",I}if(un(r)){if(r.length===0)return"[]";var P=it(r,b);return w&&!of(P)?"["+fn(P,w)+"]":"[ "+_e.call(P,", ")+" ]"}if(qc(r)){var B=it(r,b);return!("cause"in Error.prototype)&&"cause"in r&&!Yi.call(r,"cause")?"{ ["+String(r)+"] "+_e.call(Vi.call("[cause]: "+b(r.cause),B),", ")+" }":B.length===0?"["+String(r)+"]":"{ ["+String(r)+"] "+_e.call(B,", ")+" }"}if(typeof r=="object"&&c){if(Qi&&typeof r[Qi]=="function"&&sn)return sn(r,{depth:_-n});if(c!=="symbol"&&typeof r.inspect=="function")return r.inspect()}if(Jc(r)){var D=[];return ki&&ki.call(r,function(k,re){D.push(b(re,r,!0)+" => "+b(k,r))}),io("Map",tt.call(r),D,w)}if(ef(r)){var j=[];return Gi&&Gi.call(r,function(k){j.push(b(k,r))}),io("Set",nt.call(r),j,w)}if(Qc(r))return cn("WeakMap");if(rf(r))return cn("WeakSet");if(Zc(r))return cn("WeakRef");if(Vc(r))return Ir(b(Number(r)));if(Yc(r))return Ir(b(nn.call(r)));if(Hc(r))return Ir(Uc.call(r));if(zc(r))return Ir(b(String(r)));if(!Wc(r)&&!eo(r)){var q=it(r,b),z=Ki?Ki(r)===Object.prototype:r instanceof Object||r.constructor===Object,X=r instanceof Object?"":"null prototype",V=!z&&ee&&Object(r)===r&&ee in r?tn.call(Ce(r),8,-1):X?"Object":"",ae=z||typeof r.constructor!="function"?"":r.constructor.name?r.constructor.name+" ":"",ue=ae+(V||X?"["+_e.call(Vi.call([],V||[],X||[]),": ")+"] ":"");return q.length===0?ue+"{}":w?ue+"{"+fn(q,w)+"}":ue+"{ "+_e.call(q,", ")+" }"}return String(r)};function Zi(e,r,t){var n=(t.quoteStyle||r)==="double"?'"':"'";return n+e+n}function Gc(e){return Re.call(String(e),/"/g,""")}function un(e){return Ce(e)==="[object Array]"&&(!ee||!(typeof e=="object"&&ee in e))}function Wc(e){return Ce(e)==="[object Date]"&&(!ee||!(typeof e=="object"&&ee in e))}function eo(e){return Ce(e)==="[object RegExp]"&&(!ee||!(typeof e=="object"&&ee in e))}function qc(e){return Ce(e)==="[object Error]"&&(!ee||!(typeof e=="object"&&ee in e))}function zc(e){return Ce(e)==="[object String]"&&(!ee||!(typeof e=="object"&&ee in e))}function Vc(e){return Ce(e)==="[object Number]"&&(!ee||!(typeof e=="object"&&ee in e))}function Hc(e){return Ce(e)==="[object Boolean]"&&(!ee||!(typeof e=="object"&&ee in e))}function ro(e){if(or)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!an)return!1;try{return an.call(e),!0}catch{}return!1}function Yc(e){if(!e||typeof e!="object"||!nn)return!1;try{return nn.call(e),!0}catch{}return!1}var Kc=Object.prototype.hasOwnProperty||function(e){return e in this};function Fe(e,r){return Kc.call(e,r)}function Ce(e){return Dc.call(e)}function Xc(e){if(e.name)return e.name;var r=Mc.call(Nc.call(e),/^function\s*([\w$]+)/);return r?r[1]:null}function to(e,r){if(e.indexOf)return e.indexOf(r);for(var t=0,n=e.length;t<n;t++)if(e[t]===r)return t;return-1}function Jc(e){if(!tt||!e||typeof e!="object")return!1;try{tt.call(e);try{nt.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function Qc(e){if(!Sr||!e||typeof e!="object")return!1;try{Sr.call(e,Sr);try{xr.call(e,xr)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function Zc(e){if(!Wi||!e||typeof e!="object")return!1;try{return Wi.call(e),!0}catch{}return!1}function ef(e){if(!nt||!e||typeof e!="object")return!1;try{nt.call(e);try{tt.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function rf(e){if(!xr||!e||typeof e!="object")return!1;try{xr.call(e,xr);try{Sr.call(e,Sr)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function tf(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function no(e,r){if(e.length>r.maxStringLength){var t=e.length-r.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return no(tn.call(e,0,r.maxStringLength),r)+n}var a=Re.call(Re.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,nf);return Zi(a,"single",r)}function nf(e){var r=e.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[r];return t?"\\"+t:"\\x"+(r<16?"0":"")+Lc.call(r.toString(16))}function Ir(e){return"Object("+e+")"}function cn(e){return e+" { ? }"}function io(e,r,t,n){var a=n?fn(t,n):_e.call(t,", ");return e+" ("+r+") {"+a+"}"}function of(e){for(var r=0;r<e.length;r++)if(to(e[r],`
|
|
18
|
-
`)>=0)return!1;return!0}function
|
|
17
|
+
`)+" "+t[1]:t[0]+r+" "+e.join(", ")+" "+t[1]}function Ht(e){return Array.isArray(e)}function et(e){return typeof e=="boolean"}function wr(e){return e===null}function Ui(e){return e==null}function Yt(e){return typeof e=="number"}function br(e){return typeof e=="string"}function Di(e){return typeof e=="symbol"}function me(e){return e===void 0}function $r(e){return Ve(e)&&Kt(e)==="[object RegExp]"}function Ve(e){return typeof e=="object"&&e!==null}function rt(e){return Ve(e)&&Kt(e)==="[object Date]"}function Ar(e){return Ve(e)&&(Kt(e)==="[object Error]"||e instanceof Error)}function Er(e){return typeof e=="function"}function Ni(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e>"u"}function Mi(e){return $.isBuffer(e)}function Kt(e){return Object.prototype.toString.call(e)}function Xt(e){return e<10?"0"+e.toString(10):e.toString(10)}var Tc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Oc(){var e=new Date,r=[Xt(e.getHours()),Xt(e.getMinutes()),Xt(e.getSeconds())].join(":");return[e.getDate(),Tc[e.getMonth()],r].join(" ")}function Li(){console.log("%s - %s",Oc(),Jr.apply(null,arguments))}function Jt(e,r){if(!r||!Ve(r))return e;for(var t=Object.keys(r),n=t.length;n--;)e[t[n]]=r[t[n]];return e}function ji(e,r){return Object.prototype.hasOwnProperty.call(e,r)}var Bc={inherits:Fi,_extend:Jt,log:Li,isBuffer:Mi,isPrimitive:Ni,isFunction:Er,isError:Ar,isDate:rt,isObject:Ve,isRegExp:$r,isUndefined:me,isSymbol:Di,isString:br,isNumber:Yt,isNullOrUndefined:Ui,isNull:wr,isBoolean:et,isArray:Ht,inspect:ve,deprecate:Wt,format:Jr,debuglog:Ci},Pc=Object.freeze({__proto__:null,format:Jr,deprecate:Wt,debuglog:Ci,inspect:ve,isArray:Ht,isBoolean:et,isNull:wr,isNullOrUndefined:Ui,isNumber:Yt,isString:br,isSymbol:Di,isUndefined:me,isRegExp:$r,isObject:Ve,isDate:rt,isError:Ar,isFunction:Er,isPrimitive:Ni,isBuffer:Mi,log:Li,inherits:Fi,_extend:Jt,default:Bc}),Rc=vr(Pc),Fc=Rc.inspect,Qt=typeof Map=="function"&&Map.prototype,Zt=Object.getOwnPropertyDescriptor&&Qt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,tt=Qt&&Zt&&typeof Zt.get=="function"?Zt.get:null,ki=Qt&&Map.prototype.forEach,en=typeof Set=="function"&&Set.prototype,rn=Object.getOwnPropertyDescriptor&&en?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,nt=en&&rn&&typeof rn.get=="function"?rn.get:null,Gi=en&&Set.prototype.forEach,Cc=typeof WeakMap=="function"&&WeakMap.prototype,Sr=Cc?WeakMap.prototype.has:null,Uc=typeof WeakSet=="function"&&WeakSet.prototype,xr=Uc?WeakSet.prototype.has:null,Dc=typeof WeakRef=="function"&&WeakRef.prototype,Wi=Dc?WeakRef.prototype.deref:null,Nc=Boolean.prototype.valueOf,Mc=Object.prototype.toString,Lc=Function.prototype.toString,jc=String.prototype.match,tn=String.prototype.slice,Re=String.prototype.replace,kc=String.prototype.toUpperCase,qi=String.prototype.toLowerCase,zi=RegExp.prototype.test,Vi=Array.prototype.concat,_e=Array.prototype.join,Gc=Array.prototype.slice,Hi=Math.floor,nn=typeof BigInt=="function"?BigInt.prototype.valueOf:null,on=Object.getOwnPropertySymbols,an=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,or=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ee=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===or?"object":"symbol")?Symbol.toStringTag:null,Yi=Object.prototype.propertyIsEnumerable,Ki=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function Xi(e,r){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||zi.call(/e/,r))return r;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var n=e<0?-Hi(-e):Hi(e);if(n!==e){var a=String(n),s=tn.call(r,a.length+1);return Re.call(a,t,"$&_")+"."+Re.call(Re.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Re.call(r,t,"$&_")}var sn=Fc,Ji=sn.custom,Qi=ro(Ji)?Ji:null,Wc=function e(r,t,n,a){var s=t||{};if(Fe(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Fe(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=Fe(s,"customInspect")?s.customInspect:!0;if(typeof c!="boolean"&&c!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Fe(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Fe(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var p=s.numericSeparator;if(typeof r>"u")return"undefined";if(r===null)return"null";if(typeof r=="boolean")return r?"true":"false";if(typeof r=="string")return no(r,s);if(typeof r=="number"){if(r===0)return 1/0/r>0?"0":"-0";var h=String(r);return p?Xi(r,h):h}if(typeof r=="bigint"){var v=String(r)+"n";return p?Xi(r,v):v}var _=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=_&&_>0&&typeof r=="object")return un(r)?"[Array]":"[Object]";var w=uf(s,n);if(typeof a>"u")a=[];else if(to(a,r)>=0)return"[Circular]";function b(k,re,N){if(re&&(a=Gc.call(a),a.push(re)),N){var ce={depth:s.depth};return Fe(s,"quoteStyle")&&(ce.quoteStyle=s.quoteStyle),e(k,ce,n+1,a)}return e(k,s,n+1,a)}if(typeof r=="function"&&!eo(r)){var d=Qc(r),E=it(r,b);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(E.length>0?" { "+_e.call(E,", ")+" }":"")}if(ro(r)){var x=or?Re.call(String(r),/^(Symbol\(.*\))_[^)]*$/,"$1"):an.call(r);return typeof r=="object"&&!or?Ir(x):x}if(of(r)){for(var I="<"+qi.call(String(r.nodeName)),S=r.attributes||[],T=0;T<S.length;T++)I+=" "+S[T].name+"="+Zi(qc(S[T].value),"double",s);return I+=">",r.childNodes&&r.childNodes.length&&(I+="..."),I+="</"+qi.call(String(r.nodeName))+">",I}if(un(r)){if(r.length===0)return"[]";var P=it(r,b);return w&&!sf(P)?"["+fn(P,w)+"]":"[ "+_e.call(P,", ")+" ]"}if(Vc(r)){var B=it(r,b);return!("cause"in Error.prototype)&&"cause"in r&&!Yi.call(r,"cause")?"{ ["+String(r)+"] "+_e.call(Vi.call("[cause]: "+b(r.cause),B),", ")+" }":B.length===0?"["+String(r)+"]":"{ ["+String(r)+"] "+_e.call(B,", ")+" }"}if(typeof r=="object"&&c){if(Qi&&typeof r[Qi]=="function"&&sn)return sn(r,{depth:_-n});if(c!=="symbol"&&typeof r.inspect=="function")return r.inspect()}if(Zc(r)){var D=[];return ki&&ki.call(r,function(k,re){D.push(b(re,r,!0)+" => "+b(k,r))}),io("Map",tt.call(r),D,w)}if(tf(r)){var j=[];return Gi&&Gi.call(r,function(k){j.push(b(k,r))}),io("Set",nt.call(r),j,w)}if(ef(r))return cn("WeakMap");if(nf(r))return cn("WeakSet");if(rf(r))return cn("WeakRef");if(Yc(r))return Ir(b(Number(r)));if(Xc(r))return Ir(b(nn.call(r)));if(Kc(r))return Ir(Nc.call(r));if(Hc(r))return Ir(b(String(r)));if(!zc(r)&&!eo(r)){var q=it(r,b),z=Ki?Ki(r)===Object.prototype:r instanceof Object||r.constructor===Object,X=r instanceof Object?"":"null prototype",V=!z&&ee&&Object(r)===r&&ee in r?tn.call(Ce(r),8,-1):X?"Object":"",ae=z||typeof r.constructor!="function"?"":r.constructor.name?r.constructor.name+" ":"",ue=ae+(V||X?"["+_e.call(Vi.call([],V||[],X||[]),": ")+"] ":"");return q.length===0?ue+"{}":w?ue+"{"+fn(q,w)+"}":ue+"{ "+_e.call(q,", ")+" }"}return String(r)};function Zi(e,r,t){var n=(t.quoteStyle||r)==="double"?'"':"'";return n+e+n}function qc(e){return Re.call(String(e),/"/g,""")}function un(e){return Ce(e)==="[object Array]"&&(!ee||!(typeof e=="object"&&ee in e))}function zc(e){return Ce(e)==="[object Date]"&&(!ee||!(typeof e=="object"&&ee in e))}function eo(e){return Ce(e)==="[object RegExp]"&&(!ee||!(typeof e=="object"&&ee in e))}function Vc(e){return Ce(e)==="[object Error]"&&(!ee||!(typeof e=="object"&&ee in e))}function Hc(e){return Ce(e)==="[object String]"&&(!ee||!(typeof e=="object"&&ee in e))}function Yc(e){return Ce(e)==="[object Number]"&&(!ee||!(typeof e=="object"&&ee in e))}function Kc(e){return Ce(e)==="[object Boolean]"&&(!ee||!(typeof e=="object"&&ee in e))}function ro(e){if(or)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!an)return!1;try{return an.call(e),!0}catch{}return!1}function Xc(e){if(!e||typeof e!="object"||!nn)return!1;try{return nn.call(e),!0}catch{}return!1}var Jc=Object.prototype.hasOwnProperty||function(e){return e in this};function Fe(e,r){return Jc.call(e,r)}function Ce(e){return Mc.call(e)}function Qc(e){if(e.name)return e.name;var r=jc.call(Lc.call(e),/^function\s*([\w$]+)/);return r?r[1]:null}function to(e,r){if(e.indexOf)return e.indexOf(r);for(var t=0,n=e.length;t<n;t++)if(e[t]===r)return t;return-1}function Zc(e){if(!tt||!e||typeof e!="object")return!1;try{tt.call(e);try{nt.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function ef(e){if(!Sr||!e||typeof e!="object")return!1;try{Sr.call(e,Sr);try{xr.call(e,xr)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function rf(e){if(!Wi||!e||typeof e!="object")return!1;try{return Wi.call(e),!0}catch{}return!1}function tf(e){if(!nt||!e||typeof e!="object")return!1;try{nt.call(e);try{tt.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function nf(e){if(!xr||!e||typeof e!="object")return!1;try{xr.call(e,xr);try{Sr.call(e,Sr)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function of(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function no(e,r){if(e.length>r.maxStringLength){var t=e.length-r.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return no(tn.call(e,0,r.maxStringLength),r)+n}var a=Re.call(Re.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,af);return Zi(a,"single",r)}function af(e){var r=e.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[r];return t?"\\"+t:"\\x"+(r<16?"0":"")+kc.call(r.toString(16))}function Ir(e){return"Object("+e+")"}function cn(e){return e+" { ? }"}function io(e,r,t,n){var a=n?fn(t,n):_e.call(t,", ");return e+" ("+r+") {"+a+"}"}function sf(e){for(var r=0;r<e.length;r++)if(to(e[r],`
|
|
18
|
+
`)>=0)return!1;return!0}function uf(e,r){var t;if(e.indent===" ")t=" ";else if(typeof e.indent=="number"&&e.indent>0)t=_e.call(Array(e.indent+1)," ");else return null;return{base:t,prev:_e.call(Array(r+1),t)}}function fn(e,r){if(e.length===0)return"";var t=`
|
|
19
19
|
`+r.prev+r.base;return t+_e.call(e,","+t)+`
|
|
20
|
-
`+r.prev}function it(e,r){var t=un(e),n=[];if(t){n.length=e.length;for(var a=0;a<e.length;a++)n[a]=Fe(e,a)?r(e[a],e):""}var s=typeof on=="function"?on(e):[],c;if(or){c={};for(var p=0;p<s.length;p++)c["$"+s[p]]=s[p]}for(var h in e)!Fe(e,h)||t&&String(Number(h))===h&&h<e.length||or&&c["$"+h]instanceof Symbol||(zi.call(/[^\w$]/,h)?n.push(r(h,e)+": "+r(e[h],e)):n.push(h+": "+r(e[h],e)));if(typeof on=="function")for(var v=0;v<s.length;v++)Yi.call(e,s[v])&&n.push("["+r(s[v])+"]: "+r(e[s[v]],e));return n}var ln=Nt,ar=du,sf=kc,uf=ln("%TypeError%"),ot=ln("%WeakMap%",!0),at=ln("%Map%",!0),cf=ar("WeakMap.prototype.get",!0),ff=ar("WeakMap.prototype.set",!0),lf=ar("WeakMap.prototype.has",!0),pf=ar("Map.prototype.get",!0),hf=ar("Map.prototype.set",!0),df=ar("Map.prototype.has",!0),pn=function(e,r){for(var t=e,n;(n=t.next)!==null;t=n)if(n.key===r)return t.next=n.next,n.next=e.next,e.next=n,n},yf=function(e,r){var t=pn(e,r);return t&&t.value},gf=function(e,r,t){var n=pn(e,r);n?n.value=t:e.next={key:r,next:e.next,value:t}},vf=function(e,r){return!!pn(e,r)},mf=function(){var r,t,n,a={assert:function(s){if(!a.has(s))throw new uf("Side channel does not contain "+sf(s))},get:function(s){if(ot&&s&&(typeof s=="object"||typeof s=="function")){if(r)return cf(r,s)}else if(at){if(t)return pf(t,s)}else if(n)return yf(n,s)},has:function(s){if(ot&&s&&(typeof s=="object"||typeof s=="function")){if(r)return lf(r,s)}else if(at){if(t)return df(t,s)}else if(n)return vf(n,s);return!1},set:function(s,c){ot&&s&&(typeof s=="object"||typeof s=="function")?(r||(r=new ot),ff(r,s,c)):at?(t||(t=new at),hf(t,s,c)):(n||(n={key:{},next:null}),gf(n,s,c))}};return a},_f=String.prototype.replace,wf=/%20/g,hn={RFC1738:"RFC1738",RFC3986:"RFC3986"},oo={default:hn.RFC3986,formatters:{RFC1738:function(e){return _f.call(e,wf,"+")},RFC3986:function(e){return String(e)}},RFC1738:hn.RFC1738,RFC3986:hn.RFC3986},bf=oo,dn=Object.prototype.hasOwnProperty,He=Array.isArray,we=function(){for(var e=[],r=0;r<256;++r)e.push("%"+((r<16?"0":"")+r.toString(16)).toUpperCase());return e}(),$f=function(r){for(;r.length>1;){var t=r.pop(),n=t.obj[t.prop];if(He(n)){for(var a=[],s=0;s<n.length;++s)typeof n[s]<"u"&&a.push(n[s]);t.obj[t.prop]=a}}},ao=function(r,t){for(var n=t&&t.plainObjects?Object.create(null):{},a=0;a<r.length;++a)typeof r[a]<"u"&&(n[a]=r[a]);return n},Af=function e(r,t,n){if(!t)return r;if(typeof t!="object"){if(He(r))r.push(t);else if(r&&typeof r=="object")(n&&(n.plainObjects||n.allowPrototypes)||!dn.call(Object.prototype,t))&&(r[t]=!0);else return[r,t];return r}if(!r||typeof r!="object")return[r].concat(t);var a=r;return He(r)&&!He(t)&&(a=ao(r,n)),He(r)&&He(t)?(t.forEach(function(s,c){if(dn.call(r,c)){var p=r[c];p&&typeof p=="object"&&s&&typeof s=="object"?r[c]=e(p,s,n):r.push(s)}else r[c]=s}),r):Object.keys(t).reduce(function(s,c){var p=t[c];return dn.call(s,c)?s[c]=e(s[c],p,n):s[c]=p,s},a)},Ef=function(r,t){return Object.keys(t).reduce(function(n,a){return n[a]=t[a],n},r)},Sf=function(e,r,t){var n=e.replace(/\+/g," ");if(t==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},xf=function(r,t,n,a,s){if(r.length===0)return r;var c=r;if(typeof r=="symbol"?c=Symbol.prototype.toString.call(r):typeof r!="string"&&(c=String(r)),n==="iso-8859-1")return escape(c).replace(/%u[0-9a-f]{4}/gi,function(_){return"%26%23"+parseInt(_.slice(2),16)+"%3B"});for(var p="",h=0;h<c.length;++h){var v=c.charCodeAt(h);if(v===45||v===46||v===95||v===126||v>=48&&v<=57||v>=65&&v<=90||v>=97&&v<=122||s===bf.RFC1738&&(v===40||v===41)){p+=c.charAt(h);continue}if(v<128){p=p+we[v];continue}if(v<2048){p=p+(we[192|v>>6]+we[128|v&63]);continue}if(v<55296||v>=57344){p=p+(we[224|v>>12]+we[128|v>>6&63]+we[128|v&63]);continue}h+=1,v=65536+((v&1023)<<10|c.charCodeAt(h)&1023),p+=we[240|v>>18]+we[128|v>>12&63]+we[128|v>>6&63]+we[128|v&63]}return p},If=function(r){for(var t=[{obj:{o:r},prop:"o"}],n=[],a=0;a<t.length;++a)for(var s=t[a],c=s.obj[s.prop],p=Object.keys(c),h=0;h<p.length;++h){var v=p[h],_=c[v];typeof _=="object"&&_!==null&&n.indexOf(_)===-1&&(t.push({obj:c,prop:v}),n.push(_))}return $f(t),r},Tf=function(r){return Object.prototype.toString.call(r)==="[object RegExp]"},Of=function(r){return!r||typeof r!="object"?!1:!!(r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer(r))},Bf=function(r,t){return[].concat(r,t)},Pf=function(r,t){if(He(r)){for(var n=[],a=0;a<r.length;a+=1)n.push(t(r[a]));return n}return t(r)},Rf={arrayToObject:ao,assign:Ef,combine:Bf,compact:If,decode:Sf,encode:xf,isBuffer:Of,isRegExp:Tf,maybeMap:Pf,merge:Af},so=mf,yn=Rf,Tr=oo,Ff=Object.prototype.hasOwnProperty,uo={brackets:function(r){return r+"[]"},comma:"comma",indices:function(r,t){return r+"["+t+"]"},repeat:function(r){return r}},Se=Array.isArray,Cf=String.prototype.split,Uf=Array.prototype.push,co=function(e,r){Uf.apply(e,Se(r)?r:[r])},Df=Date.prototype.toISOString,fo=Tr.default,J={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:yn.encode,encodeValuesOnly:!1,format:fo,formatter:Tr.formatters[fo],indices:!1,serializeDate:function(r){return Df.call(r)},skipNulls:!1,strictNullHandling:!1},Nf=function(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"||typeof r=="symbol"||typeof r=="bigint"},gn={},Mf=function e(r,t,n,a,s,c,p,h,v,_,w,b,d,E,x,I){for(var S=r,T=I,P=0,B=!1;(T=T.get(gn))!==void 0&&!B;){var D=T.get(r);if(P+=1,typeof D<"u"){if(D===P)throw new RangeError("Cyclic object value");B=!0}typeof T.get(gn)>"u"&&(P=0)}if(typeof h=="function"?S=h(t,S):S instanceof Date?S=w(S):n==="comma"&&Se(S)&&(S=yn.maybeMap(S,function(Ne){return Ne instanceof Date?w(Ne):Ne})),S===null){if(s)return p&&!E?p(t,J.encoder,x,"key",b):t;S=""}if(Nf(S)||yn.isBuffer(S)){if(p){var j=E?t:p(t,J.encoder,x,"key",b);if(n==="comma"&&E){for(var q=Cf.call(String(S),","),z="",X=0;X<q.length;++X)z+=(X===0?"":",")+d(p(q[X],J.encoder,x,"value",b));return[d(j)+(a&&Se(S)&&q.length===1?"[]":"")+"="+z]}return[d(j)+"="+d(p(S,J.encoder,x,"value",b))]}return[d(t)+"="+d(String(S))]}var V=[];if(typeof S>"u")return V;var ae;if(n==="comma"&&Se(S))ae=[{value:S.length>0?S.join(",")||null:void 0}];else if(Se(h))ae=h;else{var ue=Object.keys(S);ae=v?ue.sort(v):ue}for(var k=a&&Se(S)&&S.length===1?t+"[]":t,re=0;re<ae.length;++re){var N=ae[re],ce=typeof N=="object"&&typeof N.value<"u"?N.value:S[N];if(!(c&&ce===null)){var hr=Se(S)?typeof n=="function"?n(k,N):k:k+(_?"."+N:"["+N+"]");I.set(r,P);var se=so();se.set(gn,I),co(V,e(ce,hr,n,a,s,c,p,h,v,_,w,b,d,E,x,se))}}return V},Lf=function(r){if(!r)return J;if(r.encoder!==null&&typeof r.encoder<"u"&&typeof r.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=r.charset||J.charset;if(typeof r.charset<"u"&&r.charset!=="utf-8"&&r.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=Tr.default;if(typeof r.format<"u"){if(!Ff.call(Tr.formatters,r.format))throw new TypeError("Unknown format option provided.");n=r.format}var a=Tr.formatters[n],s=J.filter;return(typeof r.filter=="function"||Se(r.filter))&&(s=r.filter),{addQueryPrefix:typeof r.addQueryPrefix=="boolean"?r.addQueryPrefix:J.addQueryPrefix,allowDots:typeof r.allowDots>"u"?J.allowDots:!!r.allowDots,charset:t,charsetSentinel:typeof r.charsetSentinel=="boolean"?r.charsetSentinel:J.charsetSentinel,delimiter:typeof r.delimiter>"u"?J.delimiter:r.delimiter,encode:typeof r.encode=="boolean"?r.encode:J.encode,encoder:typeof r.encoder=="function"?r.encoder:J.encoder,encodeValuesOnly:typeof r.encodeValuesOnly=="boolean"?r.encodeValuesOnly:J.encodeValuesOnly,filter:s,format:n,formatter:a,serializeDate:typeof r.serializeDate=="function"?r.serializeDate:J.serializeDate,skipNulls:typeof r.skipNulls=="boolean"?r.skipNulls:J.skipNulls,sort:typeof r.sort=="function"?r.sort:null,strictNullHandling:typeof r.strictNullHandling=="boolean"?r.strictNullHandling:J.strictNullHandling}},jf=function(e,r){var t=e,n=Lf(r),a,s;typeof n.filter=="function"?(s=n.filter,t=s("",t)):Se(n.filter)&&(s=n.filter,a=s);var c=[];if(typeof t!="object"||t===null)return"";var p;r&&r.arrayFormat in uo?p=r.arrayFormat:r&&"indices"in r?p=r.indices?"indices":"repeat":p="indices";var h=uo[p];if(r&&"commaRoundTrip"in r&&typeof r.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var v=h==="comma"&&r&&r.commaRoundTrip;a||(a=Object.keys(t)),n.sort&&a.sort(n.sort);for(var _=so(),w=0;w<a.length;++w){var b=a[w];n.skipNulls&&t[b]===null||co(c,Mf(t[b],b,h,v,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,_))}var d=c.join(n.delimiter),E=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?E+="utf8=%26%2310003%3B&":E+="utf8=%E2%9C%93&"),d.length>0?E+d:""};let lo={storeIdentifier:"",environment:"prod"};function kf(e){lo=e}function xe(){return lo}const Gf=e=>e==="stage"?"https://api.stage.rechargeapps.com":"https://api.rechargeapps.com",vn=e=>e==="stage"?"https://admin.stage.rechargeapps.com":"https://admin.rechargeapps.com",Wf=e=>e==="stage"?"https://static.stage.rechargecdn.com":"https://static.rechargecdn.com",qf="/tools/recurring";class st{constructor(r,t){this.name="RechargeRequestError",this.message=r,this.status=t}}var zf=Object.defineProperty,Vf=Object.defineProperties,Hf=Object.getOwnPropertyDescriptors,po=Object.getOwnPropertySymbols,Yf=Object.prototype.hasOwnProperty,Kf=Object.prototype.propertyIsEnumerable,ho=(e,r,t)=>r in e?zf(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,ut=(e,r)=>{for(var t in r||(r={}))Yf.call(r,t)&&ho(e,t,r[t]);if(po)for(var t of po(r))Kf.call(r,t)&&ho(e,t,r[t]);return e},Xf=(e,r)=>Vf(e,Hf(r));function Jf(e){return jf(e,{encode:!1,indices:!1,arrayFormat:"comma"})}async function ct(e,r,t={}){const n=xe();return he(e,`${Wf(n.environment)}/store/${n.storeIdentifier}${r}`,t)}async function O(e,r,{id:t,query:n,data:a,headers:s}={},c){const{environment:p,storeIdentifier:h,loginRetryFn:v}=xe(),_=c.apiToken,w=Gf(p),b=ut({"X-Recharge-Access-Token":_,"X-Recharge-Version":"2021-11"},s||{}),d=ut({shop_url:h},n);try{return await he(e,`${w}${r}`,{id:t,query:d,data:a,headers:b})}catch(E){if(v&&E instanceof st&&E.status===401)return v().then(x=>{if(x)return he(e,`${w}${r}`,{id:t,query:d,data:a,headers:Xf(ut({},b),{"X-Recharge-Access-Token":x.apiToken})});throw E});throw E}}async function Or(e,r,t={}){return he(e,`${qf}${r}`,t)}async function he(e,r,{id:t,query:n,data:a,headers:s}={}){let c=r.trim();if(t&&(c=[c,`${t}`.trim()].join("/")),n){let w;[c,w]=c.split("?");const b=[w,Jf(n)].join("&").replace(/^&/,"");c=`${c}${b?`?${b}`:""}`}let p;a&&e!=="get"&&(p=JSON.stringify(a));const h=ut({Accept:"application/json","Content-Type":"application/json","X-Recharge-App":"storefront-client"},s||{}),v=await fetch(c,{method:e,headers:h,body:p});let _;try{_=await v.json()}catch{}if(!v.ok)throw _&&_.error?new st(_.error,v.status):_&&_.errors?new st(JSON.stringify(_.errors),v.status):new st("A connection error occurred while making the request");return _}function Qf(e,r){return O("get","/addresses",{query:r},e)}async function Zf(e,r,t){const{address:n}=await O("get","/addresses",{id:r,query:{include:t?.include}},e);return n}async function el(e,r){const{address:t}=await O("post","/addresses",{data:r},e);return t}async function mn(e,r,t){const{address:n}=await O("put","/addresses",{id:r,data:t},e);return n}async function rl(e,r,t){return mn(e,r,{discounts:[{code:t}]})}async function tl(e,r){return mn(e,r,{discounts:[]})}function nl(e,r){return O("delete","/addresses",{id:r},e)}async function il(e,r){const{address:t}=await O("post","/addresses/merge",{data:r},e);return t}async function ol(e,r,t){const{charge:n}=await O("post",`/addresses/${r}/charges/skip`,{data:t},e);return n}var al=Object.freeze({__proto__:null,listAddresses:Qf,getAddress:Zf,createAddress:el,updateAddress:mn,applyDiscountToAddress:rl,removeDiscountsFromAddress:tl,deleteAddress:nl,mergeAddresses:il,skipFutureCharge:ol}),sl=Object.defineProperty,yo=Object.getOwnPropertySymbols,ul=Object.prototype.hasOwnProperty,cl=Object.prototype.propertyIsEnumerable,go=(e,r,t)=>r in e?sl(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,vo=(e,r)=>{for(var t in r||(r={}))ul.call(r,t)&&go(e,t,r[t]);if(yo)for(var t of yo(r))cl.call(r,t)&&go(e,t,r[t]);return e};async function fl(){const{storefrontAccessToken:e}=xe(),r={};e&&(r["X-Recharge-Storefront-Access-Token"]=e);const t=await Or("get","/access",{headers:r});return{apiToken:t.api_token,customerId:t.customer_id}}async function ll(e,r){const{environment:t,storefrontAccessToken:n,storeIdentifier:a}=xe(),s=vn(t),c={};n&&(c["X-Recharge-Storefront-Access-Token"]=n);const p=await he("post",`${s}/shopify_storefront_access`,{data:{customer_token:r,storefront_token:e,shop_url:a},headers:c});return p.api_token?{apiToken:p.api_token,customerId:p.customer_id}:null}async function pl(e,r={}){const{environment:t,storefrontAccessToken:n,storeIdentifier:a}=xe(),s=vn(t),c={};n&&(c["X-Recharge-Storefront-Access-Token"]=n);const p=await he("post",`${s}/attempt_login`,{data:vo({email:e,shop:a},r),headers:c});if(p.errors)throw new Error(p.errors);return p.session_token}async function hl(e,r={}){const{storefrontAccessToken:t,storeIdentifier:n}=xe(),a={};t&&(a["X-Recharge-Storefront-Access-Token"]=t);const s=await Or("post","/attempt_login",{data:vo({email:e,shop:n},r),headers:a});if(s.errors)throw new Error(s.errors);return s.session_token}async function dl(e,r,t){const{environment:n,storefrontAccessToken:a,storeIdentifier:s}=xe(),c=vn(n),p={};a&&(p["X-Recharge-Storefront-Access-Token"]=a);const h=await he("post",`${c}/validate_login`,{data:{code:t,email:e,session_token:r,shop:s},headers:p});if(h.errors)throw new Error(h.errors);return{apiToken:h.api_token,customerId:h.customer_id}}async function yl(e,r,t){const{storefrontAccessToken:n,storeIdentifier:a}=xe(),s={};n&&(s["X-Recharge-Storefront-Access-Token"]=n);const c=await Or("post","/validate_login",{data:{code:t,email:e,session_token:r,shop:a},headers:s});if(c.errors)throw new Error(c.errors);return{apiToken:c.api_token,customerId:c.customer_id}}var gl=Object.freeze({__proto__:null,loginShopifyAppProxy:fl,loginShopifyApi:ll,sendPasswordlessCode:pl,sendPasswordlessCodeAppProxy:hl,validatePasswordlessCode:dl,validatePasswordlessCodeAppProxy:yl});let vl=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((r,t)=>(t&=63,t<36?r+=t.toString(36):t<62?r+=(t-26).toString(36).toUpperCase():t>62?r+="-":r+="_",r),"");function ml(e,r){for(var t=-1,n=e==null?0:e.length,a=Array(n);++t<n;)a[t]=r(e[t],t,e);return a}var mo=ml;function _l(){this.__data__=[],this.size=0}var wl=_l;function bl(e,r){return e===r||e!==e&&r!==r}var _o=bl,$l=_o;function Al(e,r){for(var t=e.length;t--;)if($l(e[t][0],r))return t;return-1}var ft=Al,El=ft,Sl=Array.prototype,xl=Sl.splice;function Il(e){var r=this.__data__,t=El(r,e);if(t<0)return!1;var n=r.length-1;return t==n?r.pop():xl.call(r,t,1),--this.size,!0}var Tl=Il,Ol=ft;function Bl(e){var r=this.__data__,t=Ol(r,e);return t<0?void 0:r[t][1]}var Pl=Bl,Rl=ft;function Fl(e){return Rl(this.__data__,e)>-1}var Cl=Fl,Ul=ft;function Dl(e,r){var t=this.__data__,n=Ul(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this}var Nl=Dl,Ml=wl,Ll=Tl,jl=Pl,kl=Cl,Gl=Nl;function sr(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}sr.prototype.clear=Ml,sr.prototype.delete=Ll,sr.prototype.get=jl,sr.prototype.has=kl,sr.prototype.set=Gl;var lt=sr,Wl=lt;function ql(){this.__data__=new Wl,this.size=0}var zl=ql;function Vl(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}var Hl=Vl;function Yl(e){return this.__data__.get(e)}var Kl=Yl;function Xl(e){return this.__data__.has(e)}var Jl=Xl,Ql=typeof $e=="object"&&$e&&$e.Object===Object&&$e,wo=Ql,Zl=wo,ep=typeof self=="object"&&self&&self.Object===Object&&self,rp=Zl||ep||Function("return this")(),oe=rp,tp=oe,np=tp.Symbol,Br=np,bo=Br,$o=Object.prototype,ip=$o.hasOwnProperty,op=$o.toString,Pr=bo?bo.toStringTag:void 0;function ap(e){var r=ip.call(e,Pr),t=e[Pr];try{e[Pr]=void 0;var n=!0}catch{}var a=op.call(e);return n&&(r?e[Pr]=t:delete e[Pr]),a}var sp=ap,up=Object.prototype,cp=up.toString;function fp(e){return cp.call(e)}var lp=fp,Ao=Br,pp=sp,hp=lp,dp="[object Null]",yp="[object Undefined]",Eo=Ao?Ao.toStringTag:void 0;function gp(e){return e==null?e===void 0?yp:dp:Eo&&Eo in Object(e)?pp(e):hp(e)}var ur=gp;function vp(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var Ye=vp,mp=ur,_p=Ye,wp="[object AsyncFunction]",bp="[object Function]",$p="[object GeneratorFunction]",Ap="[object Proxy]";function Ep(e){if(!_p(e))return!1;var r=mp(e);return r==bp||r==$p||r==wp||r==Ap}var So=Ep,Sp=oe,xp=Sp["__core-js_shared__"],Ip=xp,_n=Ip,xo=function(){var e=/[^.]+$/.exec(_n&&_n.keys&&_n.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Tp(e){return!!xo&&xo in e}var Op=Tp,Bp=Function.prototype,Pp=Bp.toString;function Rp(e){if(e!=null){try{return Pp.call(e)}catch{}try{return e+""}catch{}}return""}var Io=Rp,Fp=So,Cp=Op,Up=Ye,Dp=Io,Np=/[\\^$.*+?()[\]{}|]/g,Mp=/^\[object .+?Constructor\]$/,Lp=Function.prototype,jp=Object.prototype,kp=Lp.toString,Gp=jp.hasOwnProperty,Wp=RegExp("^"+kp.call(Gp).replace(Np,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function qp(e){if(!Up(e)||Cp(e))return!1;var r=Fp(e)?Wp:Mp;return r.test(Dp(e))}var zp=qp;function Vp(e,r){return e?.[r]}var Hp=Vp,Yp=zp,Kp=Hp;function Xp(e,r){var t=Kp(e,r);return Yp(t)?t:void 0}var Ke=Xp,Jp=Ke,Qp=oe,Zp=Jp(Qp,"Map"),wn=Zp,eh=Ke,rh=eh(Object,"create"),pt=rh,To=pt;function th(){this.__data__=To?To(null):{},this.size=0}var nh=th;function ih(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}var oh=ih,ah=pt,sh="__lodash_hash_undefined__",uh=Object.prototype,ch=uh.hasOwnProperty;function fh(e){var r=this.__data__;if(ah){var t=r[e];return t===sh?void 0:t}return ch.call(r,e)?r[e]:void 0}var lh=fh,ph=pt,hh=Object.prototype,dh=hh.hasOwnProperty;function yh(e){var r=this.__data__;return ph?r[e]!==void 0:dh.call(r,e)}var gh=yh,vh=pt,mh="__lodash_hash_undefined__";function _h(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=vh&&r===void 0?mh:r,this}var wh=_h,bh=nh,$h=oh,Ah=lh,Eh=gh,Sh=wh;function cr(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}cr.prototype.clear=bh,cr.prototype.delete=$h,cr.prototype.get=Ah,cr.prototype.has=Eh,cr.prototype.set=Sh;var xh=cr,Oo=xh,Ih=lt,Th=wn;function Oh(){this.size=0,this.__data__={hash:new Oo,map:new(Th||Ih),string:new Oo}}var Bh=Oh;function Ph(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}var Rh=Ph,Fh=Rh;function Ch(e,r){var t=e.__data__;return Fh(r)?t[typeof r=="string"?"string":"hash"]:t.map}var ht=Ch,Uh=ht;function Dh(e){var r=Uh(this,e).delete(e);return this.size-=r?1:0,r}var Nh=Dh,Mh=ht;function Lh(e){return Mh(this,e).get(e)}var jh=Lh,kh=ht;function Gh(e){return kh(this,e).has(e)}var Wh=Gh,qh=ht;function zh(e,r){var t=qh(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this}var Vh=zh,Hh=Bh,Yh=Nh,Kh=jh,Xh=Wh,Jh=Vh;function fr(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}fr.prototype.clear=Hh,fr.prototype.delete=Yh,fr.prototype.get=Kh,fr.prototype.has=Xh,fr.prototype.set=Jh;var Bo=fr,Qh=lt,Zh=wn,ed=Bo,rd=200;function td(e,r){var t=this.__data__;if(t instanceof Qh){var n=t.__data__;if(!Zh||n.length<rd-1)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new ed(n)}return t.set(e,r),this.size=t.size,this}var nd=td,id=lt,od=zl,ad=Hl,sd=Kl,ud=Jl,cd=nd;function lr(e){var r=this.__data__=new id(e);this.size=r.size}lr.prototype.clear=od,lr.prototype.delete=ad,lr.prototype.get=sd,lr.prototype.has=ud,lr.prototype.set=cd;var fd=lr;function ld(e,r){for(var t=-1,n=e==null?0:e.length;++t<n&&r(e[t],t,e)!==!1;);return e}var Po=ld,pd=Ke,hd=function(){try{var e=pd(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Ro=hd,Fo=Ro;function dd(e,r,t){r=="__proto__"&&Fo?Fo(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}var Co=dd,yd=Co,gd=_o,vd=Object.prototype,md=vd.hasOwnProperty;function _d(e,r,t){var n=e[r];(!(md.call(e,r)&&gd(n,t))||t===void 0&&!(r in e))&&yd(e,r,t)}var Uo=_d,wd=Uo,bd=Co;function $d(e,r,t,n){var a=!t;t||(t={});for(var s=-1,c=r.length;++s<c;){var p=r[s],h=n?n(t[p],e[p],p,t,e):void 0;h===void 0&&(h=e[p]),a?bd(t,p,h):wd(t,p,h)}return t}var Rr=$d;function Ad(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n}var Ed=Ad;function Sd(e){return e!=null&&typeof e=="object"}var Ue=Sd,xd=ur,Id=Ue,Td="[object Arguments]";function Od(e){return Id(e)&&xd(e)==Td}var Bd=Od,Do=Bd,Pd=Ue,No=Object.prototype,Rd=No.hasOwnProperty,Fd=No.propertyIsEnumerable,Cd=Do(function(){return arguments}())?Do:function(e){return Pd(e)&&Rd.call(e,"callee")&&!Fd.call(e,"callee")},Mo=Cd,Ud=Array.isArray,De=Ud,dt={exports:{}};function Dd(){return!1}var Nd=Dd;(function(e,r){var t=oe,n=Nd,a=r&&!r.nodeType&&r,s=a&&!0&&e&&!e.nodeType&&e,c=s&&s.exports===a,p=c?t.Buffer:void 0,h=p?p.isBuffer:void 0,v=h||n;e.exports=v})(dt,dt.exports);var Md=9007199254740991,Ld=/^(?:0|[1-9]\d*)$/;function jd(e,r){var t=typeof e;return r=r??Md,!!r&&(t=="number"||t!="symbol"&&Ld.test(e))&&e>-1&&e%1==0&&e<r}var Lo=jd,kd=9007199254740991;function Gd(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=kd}var jo=Gd,Wd=ur,qd=jo,zd=Ue,Vd="[object Arguments]",Hd="[object Array]",Yd="[object Boolean]",Kd="[object Date]",Xd="[object Error]",Jd="[object Function]",Qd="[object Map]",Zd="[object Number]",ey="[object Object]",ry="[object RegExp]",ty="[object Set]",ny="[object String]",iy="[object WeakMap]",oy="[object ArrayBuffer]",ay="[object DataView]",sy="[object Float32Array]",uy="[object Float64Array]",cy="[object Int8Array]",fy="[object Int16Array]",ly="[object Int32Array]",py="[object Uint8Array]",hy="[object Uint8ClampedArray]",dy="[object Uint16Array]",yy="[object Uint32Array]",L={};L[sy]=L[uy]=L[cy]=L[fy]=L[ly]=L[py]=L[hy]=L[dy]=L[yy]=!0,L[Vd]=L[Hd]=L[oy]=L[Yd]=L[ay]=L[Kd]=L[Xd]=L[Jd]=L[Qd]=L[Zd]=L[ey]=L[ry]=L[ty]=L[ny]=L[iy]=!1;function gy(e){return zd(e)&&qd(e.length)&&!!L[Wd(e)]}var vy=gy;function my(e){return function(r){return e(r)}}var bn=my,Fr={exports:{}};(function(e,r){var t=wo,n=r&&!r.nodeType&&r,a=n&&!0&&e&&!e.nodeType&&e,s=a&&a.exports===n,c=s&&t.process,p=function(){try{var h=a&&a.require&&a.require("util").types;return h||c&&c.binding&&c.binding("util")}catch{}}();e.exports=p})(Fr,Fr.exports);var _y=vy,wy=bn,ko=Fr.exports,Go=ko&&ko.isTypedArray,by=Go?wy(Go):_y,$y=by,Ay=Ed,Ey=Mo,Sy=De,xy=dt.exports,Iy=Lo,Ty=$y,Oy=Object.prototype,By=Oy.hasOwnProperty;function Py(e,r){var t=Sy(e),n=!t&&Ey(e),a=!t&&!n&&xy(e),s=!t&&!n&&!a&&Ty(e),c=t||n||a||s,p=c?Ay(e.length,String):[],h=p.length;for(var v in e)(r||By.call(e,v))&&!(c&&(v=="length"||a&&(v=="offset"||v=="parent")||s&&(v=="buffer"||v=="byteLength"||v=="byteOffset")||Iy(v,h)))&&p.push(v);return p}var Wo=Py,Ry=Object.prototype;function Fy(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||Ry;return e===t}var $n=Fy;function Cy(e,r){return function(t){return e(r(t))}}var qo=Cy,Uy=qo,Dy=Uy(Object.keys,Object),Ny=Dy,My=$n,Ly=Ny,jy=Object.prototype,ky=jy.hasOwnProperty;function Gy(e){if(!My(e))return Ly(e);var r=[];for(var t in Object(e))ky.call(e,t)&&t!="constructor"&&r.push(t);return r}var Wy=Gy,qy=So,zy=jo;function Vy(e){return e!=null&&zy(e.length)&&!qy(e)}var zo=Vy,Hy=Wo,Yy=Wy,Ky=zo;function Xy(e){return Ky(e)?Hy(e):Yy(e)}var An=Xy,Jy=Rr,Qy=An;function Zy(e,r){return e&&Jy(r,Qy(r),e)}var eg=Zy;function rg(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}var tg=rg,ng=Ye,ig=$n,og=tg,ag=Object.prototype,sg=ag.hasOwnProperty;function ug(e){if(!ng(e))return og(e);var r=ig(e),t=[];for(var n in e)n=="constructor"&&(r||!sg.call(e,n))||t.push(n);return t}var cg=ug,fg=Wo,lg=cg,pg=zo;function hg(e){return pg(e)?fg(e,!0):lg(e)}var En=hg,dg=Rr,yg=En;function gg(e,r){return e&&dg(r,yg(r),e)}var vg=gg,Sn={exports:{}};(function(e,r){var t=oe,n=r&&!r.nodeType&&r,a=n&&!0&&e&&!e.nodeType&&e,s=a&&a.exports===n,c=s?t.Buffer:void 0,p=c?c.allocUnsafe:void 0;function h(v,_){if(_)return v.slice();var w=v.length,b=p?p(w):new v.constructor(w);return v.copy(b),b}e.exports=h})(Sn,Sn.exports);function mg(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r}var xn=mg;function _g(e,r){for(var t=-1,n=e==null?0:e.length,a=0,s=[];++t<n;){var c=e[t];r(c,t,e)&&(s[a++]=c)}return s}var wg=_g;function bg(){return[]}var Vo=bg,$g=wg,Ag=Vo,Eg=Object.prototype,Sg=Eg.propertyIsEnumerable,Ho=Object.getOwnPropertySymbols,xg=Ho?function(e){return e==null?[]:(e=Object(e),$g(Ho(e),function(r){return Sg.call(e,r)}))}:Ag,In=xg,Ig=Rr,Tg=In;function Og(e,r){return Ig(e,Tg(e),r)}var Bg=Og;function Pg(e,r){for(var t=-1,n=r.length,a=e.length;++t<n;)e[a+t]=r[t];return e}var Tn=Pg,Rg=qo,Fg=Rg(Object.getPrototypeOf,Object),On=Fg,Cg=Tn,Ug=On,Dg=In,Ng=Vo,Mg=Object.getOwnPropertySymbols,Lg=Mg?function(e){for(var r=[];e;)Cg(r,Dg(e)),e=Ug(e);return r}:Ng,Yo=Lg,jg=Rr,kg=Yo;function Gg(e,r){return jg(e,kg(e),r)}var Wg=Gg,qg=Tn,zg=De;function Vg(e,r,t){var n=r(e);return zg(e)?n:qg(n,t(e))}var Ko=Vg,Hg=Ko,Yg=In,Kg=An;function Xg(e){return Hg(e,Kg,Yg)}var Jg=Xg,Qg=Ko,Zg=Yo,ev=En;function rv(e){return Qg(e,ev,Zg)}var Xo=rv,tv=Ke,nv=oe,iv=tv(nv,"DataView"),ov=iv,av=Ke,sv=oe,uv=av(sv,"Promise"),cv=uv,fv=Ke,lv=oe,pv=fv(lv,"Set"),hv=pv,dv=Ke,yv=oe,gv=dv(yv,"WeakMap"),Jo=gv,Bn=ov,Pn=wn,Rn=cv,Fn=hv,Cn=Jo,Qo=ur,pr=Io,Zo="[object Map]",vv="[object Object]",ea="[object Promise]",ra="[object Set]",ta="[object WeakMap]",na="[object DataView]",mv=pr(Bn),_v=pr(Pn),wv=pr(Rn),bv=pr(Fn),$v=pr(Cn),Xe=Qo;(Bn&&Xe(new Bn(new ArrayBuffer(1)))!=na||Pn&&Xe(new Pn)!=Zo||Rn&&Xe(Rn.resolve())!=ea||Fn&&Xe(new Fn)!=ra||Cn&&Xe(new Cn)!=ta)&&(Xe=function(e){var r=Qo(e),t=r==vv?e.constructor:void 0,n=t?pr(t):"";if(n)switch(n){case mv:return na;case _v:return Zo;case wv:return ea;case bv:return ra;case $v:return ta}return r});var Un=Xe,Av=Object.prototype,Ev=Av.hasOwnProperty;function Sv(e){var r=e.length,t=new e.constructor(r);return r&&typeof e[0]=="string"&&Ev.call(e,"index")&&(t.index=e.index,t.input=e.input),t}var xv=Sv,Iv=oe,Tv=Iv.Uint8Array,Ov=Tv,ia=Ov;function Bv(e){var r=new e.constructor(e.byteLength);return new ia(r).set(new ia(e)),r}var Dn=Bv,Pv=Dn;function Rv(e,r){var t=r?Pv(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}var Fv=Rv,Cv=/\w*$/;function Uv(e){var r=new e.constructor(e.source,Cv.exec(e));return r.lastIndex=e.lastIndex,r}var Dv=Uv,oa=Br,aa=oa?oa.prototype:void 0,sa=aa?aa.valueOf:void 0;function Nv(e){return sa?Object(sa.call(e)):{}}var Mv=Nv,Lv=Dn;function jv(e,r){var t=r?Lv(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}var kv=jv,Gv=Dn,Wv=Fv,qv=Dv,zv=Mv,Vv=kv,Hv="[object Boolean]",Yv="[object Date]",Kv="[object Map]",Xv="[object Number]",Jv="[object RegExp]",Qv="[object Set]",Zv="[object String]",e0="[object Symbol]",r0="[object ArrayBuffer]",t0="[object DataView]",n0="[object Float32Array]",i0="[object Float64Array]",o0="[object Int8Array]",a0="[object Int16Array]",s0="[object Int32Array]",u0="[object Uint8Array]",c0="[object Uint8ClampedArray]",f0="[object Uint16Array]",l0="[object Uint32Array]";function p0(e,r,t){var n=e.constructor;switch(r){case r0:return Gv(e);case Hv:case Yv:return new n(+e);case t0:return Wv(e,t);case n0:case i0:case o0:case a0:case s0:case u0:case c0:case f0:case l0:return Vv(e,t);case Kv:return new n;case Xv:case Zv:return new n(e);case Jv:return qv(e);case Qv:return new n;case e0:return zv(e)}}var h0=p0,d0=Ye,ua=Object.create,y0=function(){function e(){}return function(r){if(!d0(r))return{};if(ua)return ua(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}(),yt=y0,g0=yt,v0=On,m0=$n;function _0(e){return typeof e.constructor=="function"&&!m0(e)?g0(v0(e)):{}}var w0=_0,b0=Un,$0=Ue,A0="[object Map]";function E0(e){return $0(e)&&b0(e)==A0}var S0=E0,x0=S0,I0=bn,ca=Fr.exports,fa=ca&&ca.isMap,T0=fa?I0(fa):x0,O0=T0,B0=Un,P0=Ue,R0="[object Set]";function F0(e){return P0(e)&&B0(e)==R0}var C0=F0,U0=C0,D0=bn,la=Fr.exports,pa=la&&la.isSet,N0=pa?D0(pa):U0,M0=N0,L0=fd,j0=Po,k0=Uo,G0=eg,W0=vg,q0=Sn.exports,z0=xn,V0=Bg,H0=Wg,Y0=Jg,K0=Xo,X0=Un,J0=xv,Q0=h0,Z0=w0,em=De,rm=dt.exports,tm=O0,nm=Ye,im=M0,om=An,am=En,sm=1,um=2,cm=4,ha="[object Arguments]",fm="[object Array]",lm="[object Boolean]",pm="[object Date]",hm="[object Error]",da="[object Function]",dm="[object GeneratorFunction]",ym="[object Map]",gm="[object Number]",ya="[object Object]",vm="[object RegExp]",mm="[object Set]",_m="[object String]",wm="[object Symbol]",bm="[object WeakMap]",$m="[object ArrayBuffer]",Am="[object DataView]",Em="[object Float32Array]",Sm="[object Float64Array]",xm="[object Int8Array]",Im="[object Int16Array]",Tm="[object Int32Array]",Om="[object Uint8Array]",Bm="[object Uint8ClampedArray]",Pm="[object Uint16Array]",Rm="[object Uint32Array]",M={};M[ha]=M[fm]=M[$m]=M[Am]=M[lm]=M[pm]=M[Em]=M[Sm]=M[xm]=M[Im]=M[Tm]=M[ym]=M[gm]=M[ya]=M[vm]=M[mm]=M[_m]=M[wm]=M[Om]=M[Bm]=M[Pm]=M[Rm]=!0,M[hm]=M[da]=M[bm]=!1;function gt(e,r,t,n,a,s){var c,p=r&sm,h=r&um,v=r&cm;if(t&&(c=a?t(e,n,a,s):t(e)),c!==void 0)return c;if(!nm(e))return e;var _=em(e);if(_){if(c=J0(e),!p)return z0(e,c)}else{var w=X0(e),b=w==da||w==dm;if(rm(e))return q0(e,p);if(w==ya||w==ha||b&&!a){if(c=h||b?{}:Z0(e),!p)return h?H0(e,W0(c,e)):V0(e,G0(c,e))}else{if(!M[w])return a?e:{};c=Q0(e,w,p)}}s||(s=new L0);var d=s.get(e);if(d)return d;s.set(e,c),im(e)?e.forEach(function(I){c.add(gt(I,r,t,I,e,s))}):tm(e)&&e.forEach(function(I,S){c.set(S,gt(I,r,t,S,e,s))});var E=v?h?K0:Y0:h?am:om,x=_?void 0:E(e);return j0(x||e,function(I,S){x&&(S=I,I=e[S]),k0(c,S,gt(I,r,t,S,e,s))}),c}var Fm=gt,Cm=ur,Um=Ue,Dm="[object Symbol]";function Nm(e){return typeof e=="symbol"||Um(e)&&Cm(e)==Dm}var vt=Nm,Mm=De,Lm=vt,jm=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,km=/^\w*$/;function Gm(e,r){if(Mm(e))return!1;var t=typeof e;return t=="number"||t=="symbol"||t=="boolean"||e==null||Lm(e)?!0:km.test(e)||!jm.test(e)||r!=null&&e in Object(r)}var Wm=Gm,ga=Bo,qm="Expected a function";function Nn(e,r){if(typeof e!="function"||r!=null&&typeof r!="function")throw new TypeError(qm);var t=function(){var n=arguments,a=r?r.apply(this,n):n[0],s=t.cache;if(s.has(a))return s.get(a);var c=e.apply(this,n);return t.cache=s.set(a,c)||s,c};return t.cache=new(Nn.Cache||ga),t}Nn.Cache=ga;var zm=Nn,Vm=zm,Hm=500;function Ym(e){var r=Vm(e,function(n){return t.size===Hm&&t.clear(),n}),t=r.cache;return r}var Km=Ym,Xm=Km,Jm=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Qm=/\\(\\)?/g,Zm=Xm(function(e){var r=[];return e.charCodeAt(0)===46&&r.push(""),e.replace(Jm,function(t,n,a,s){r.push(a?s.replace(Qm,"$1"):n||t)}),r}),e_=Zm,va=Br,r_=mo,t_=De,n_=vt,i_=1/0,ma=va?va.prototype:void 0,_a=ma?ma.toString:void 0;function wa(e){if(typeof e=="string")return e;if(t_(e))return r_(e,wa)+"";if(n_(e))return _a?_a.call(e):"";var r=e+"";return r=="0"&&1/e==-i_?"-0":r}var o_=wa,a_=o_;function s_(e){return e==null?"":a_(e)}var u_=s_,c_=De,f_=Wm,l_=e_,p_=u_;function h_(e,r){return c_(e)?e:f_(e,r)?[e]:l_(p_(e))}var Mn=h_;function d_(e){var r=e==null?0:e.length;return r?e[r-1]:void 0}var y_=d_,g_=vt,v_=1/0;function m_(e){if(typeof e=="string"||g_(e))return e;var r=e+"";return r=="0"&&1/e==-v_?"-0":r}var ba=m_,__=Mn,w_=ba;function b_(e,r){r=__(r,e);for(var t=0,n=r.length;e!=null&&t<n;)e=e[w_(r[t++])];return t&&t==n?e:void 0}var $_=b_;function A_(e,r,t){var n=-1,a=e.length;r<0&&(r=-r>a?0:a+r),t=t>a?a:t,t<0&&(t+=a),a=r>t?0:t-r>>>0,r>>>=0;for(var s=Array(a);++n<a;)s[n]=e[n+r];return s}var E_=A_,S_=$_,x_=E_;function I_(e,r){return r.length<2?e:S_(e,x_(r,0,-1))}var T_=I_,O_=Mn,B_=y_,P_=T_,R_=ba;function F_(e,r){return r=O_(r,e),e=P_(e,r),e==null||delete e[R_(B_(r))]}var C_=F_,U_=ur,D_=On,N_=Ue,M_="[object Object]",L_=Function.prototype,j_=Object.prototype,$a=L_.toString,k_=j_.hasOwnProperty,G_=$a.call(Object);function W_(e){if(!N_(e)||U_(e)!=M_)return!1;var r=D_(e);if(r===null)return!0;var t=k_.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t instanceof t&&$a.call(t)==G_}var q_=W_,z_=q_;function V_(e){return z_(e)?void 0:e}var H_=V_,Aa=Br,Y_=Mo,K_=De,Ea=Aa?Aa.isConcatSpreadable:void 0;function X_(e){return K_(e)||Y_(e)||!!(Ea&&e&&e[Ea])}var J_=X_,Q_=Tn,Z_=J_;function Sa(e,r,t,n,a){var s=-1,c=e.length;for(t||(t=Z_),a||(a=[]);++s<c;){var p=e[s];r>0&&t(p)?r>1?Sa(p,r-1,t,n,a):Q_(a,p):n||(a[a.length]=p)}return a}var ew=Sa,rw=ew;function tw(e){var r=e==null?0:e.length;return r?rw(e,1):[]}var nw=tw;function iw(e,r,t){switch(t.length){case 0:return e.call(r);case 1:return e.call(r,t[0]);case 2:return e.call(r,t[0],t[1]);case 3:return e.call(r,t[0],t[1],t[2])}return e.apply(r,t)}var Ln=iw,ow=Ln,xa=Math.max;function aw(e,r,t){return r=xa(r===void 0?e.length-1:r,0),function(){for(var n=arguments,a=-1,s=xa(n.length-r,0),c=Array(s);++a<s;)c[a]=n[r+a];a=-1;for(var p=Array(r+1);++a<r;)p[a]=n[a];return p[r]=t(c),ow(e,this,p)}}var Ia=aw;function sw(e){return function(){return e}}var uw=sw;function cw(e){return e}var jn=cw,fw=uw,Ta=Ro,lw=jn,pw=Ta?function(e,r){return Ta(e,"toString",{configurable:!0,enumerable:!1,value:fw(r),writable:!0})}:lw,hw=pw,dw=800,yw=16,gw=Date.now;function vw(e){var r=0,t=0;return function(){var n=gw(),a=yw-(n-t);if(t=n,a>0){if(++r>=dw)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}var Oa=vw,mw=hw,_w=Oa,ww=_w(mw),kn=ww,bw=nw,$w=Ia,Aw=kn;function Ew(e){return Aw($w(e,void 0,bw),e+"")}var Sw=Ew,xw=mo,Iw=Fm,Tw=C_,Ow=Mn,Bw=Rr,Pw=H_,Rw=Sw,Fw=Xo,Cw=1,Uw=2,Dw=4,Nw=Rw(function(e,r){var t={};if(e==null)return t;var n=!1;r=xw(r,function(s){return s=Ow(s,e),n||(n=s.length>1),s}),Bw(e,Fw(e),t),n&&(t=Iw(t,Cw|Uw|Dw,Pw));for(var a=r.length;a--;)Tw(t,r[a]);return t}),Gn=Nw,Mw=Object.defineProperty,Lw=Object.defineProperties,jw=Object.getOwnPropertyDescriptors,Ba=Object.getOwnPropertySymbols,kw=Object.prototype.hasOwnProperty,Gw=Object.prototype.propertyIsEnumerable,Pa=(e,r,t)=>r in e?Mw(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Ww=(e,r)=>{for(var t in r||(r={}))kw.call(r,t)&&Pa(e,t,r[t]);if(Ba)for(var t of Ba(r))Gw.call(r,t)&&Pa(e,t,r[t]);return e},qw=(e,r)=>Lw(e,jw(r));function zw(e){try{return JSON.parse(e)}catch{return e}}function Vw(e){return Object.entries(e).reduce((r,[t,n])=>qw(Ww({},r),{[t]:zw(n)}),{})}const Ra=e=>typeof e=="string"?e!=="0"&&e!=="false":!!e;var Hw=Object.defineProperty,Yw=Object.defineProperties,Kw=Object.getOwnPropertyDescriptors,Fa=Object.getOwnPropertySymbols,Xw=Object.prototype.hasOwnProperty,Jw=Object.prototype.propertyIsEnumerable,Ca=(e,r,t)=>r in e?Hw(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Ua=(e,r)=>{for(var t in r||(r={}))Xw.call(r,t)&&Ca(e,t,r[t]);if(Fa)for(var t of Fa(r))Jw.call(r,t)&&Ca(e,t,r[t]);return e},Da=(e,r)=>Yw(e,Kw(r));function Na(e){var r;const t=Vw(e),n=t.auto_inject===void 0?!0:t.auto_inject,a=(r=t.display_on)!=null?r:[],s=t.first_option==="autodeliver";return Da(Ua({},Gn(t,["display_on","first_option"])),{auto_inject:n,valid_pages:a,is_subscription_first:s,autoInject:n,validPages:a,isSubscriptionFirst:s})}function Ma(e){var r;const t=((r=e.subscription_options)==null?void 0:r.storefront_purchase_options)==="subscription_only";return Da(Ua({},e),{is_subscription_only:t,isSubscriptionOnly:t})}function Qw(e){return e.map(r=>{const t={};return Object.entries(r).forEach(([n,a])=>{t[n]=Ma(a)}),t})}const mt="2020-12",Zw={store_currency:{currency_code:"USD",currency_symbol:"$",decimal_separator:".",thousands_separator:",",currency_symbol_location:"left"}},Cr=new Map;function _t(e,r){return Cr.has(e)||Cr.set(e,r()),Cr.get(e)}async function Wn(e){const{product:r}=await _t(`product.${e}`,()=>ct("get",`/product/${mt}/${e}.json`));return Ma(r)}async function La(){return await _t("storeSettings",()=>ct("get",`/${mt}/store_settings.json`).catch(()=>Zw))}async function ja(){const{widget_settings:e}=await _t("widgetSettings",()=>ct("get",`/${mt}/widget_settings.json`));return Na(e)}async function ka(){const{products:e,widget_settings:r,store_settings:t,meta:n}=await _t("productsAndSettings",()=>ct("get",`/product/${mt}/products.json`));return n?.status==="error"?Promise.reject(n.message):{products:Qw(e),widget_settings:Na(r),store_settings:t??{}}}async function e1(){const{products:e}=await ka();return e}async function r1(e){const[r,t,n]=await Promise.all([Wn(e),La(),ja()]);return{product:r,store_settings:t,widget_settings:n,storeSettings:t,widgetSettings:n}}async function Ga(e){const{bundle_product:r}=await Wn(e);return r}async function Wa(){return Array.from(Cr.keys()).forEach(e=>Cr.delete(e))}var t1=Object.freeze({__proto__:null,getCDNProduct:Wn,getCDNStoreSettings:La,getCDNWidgetSettings:ja,getCDNProductsAndSettings:ka,getCDNProducts:e1,getCDNProductAndSettings:r1,getCDNBundleSettings:Ga,resetCDNCache:Wa}),qa={exports:{}};/*! For license information please see xdr.js.LICENSE.txt */(function(e,r){(function(t,n){e.exports=n()})($e,()=>(()=>{var t={899:(s,c,p)=>{const h=p(221);s.exports=h},221:(s,c,p)=>{p.r(c),p.d(c,{Array:()=>yr,Bool:()=>H,Double:()=>St,Enum:()=>be,Float:()=>Ne,Hyper:()=>k,Int:()=>V,Opaque:()=>Nr,Option:()=>Lr,Quadruple:()=>G,Reference:()=>te,String:()=>Dr,Struct:()=>Me,Union:()=>Oe,UnsignedHyper:()=>se,UnsignedInt:()=>N,VarArray:()=>Mr,VarOpaque:()=>Te,Void:()=>Q,config:()=>g});class h extends TypeError{constructor(o){super(`XDR Write Error: ${o}`)}}class v extends TypeError{constructor(o){super(`XDR Read Error: ${o}`)}}class _ extends TypeError{constructor(o){super(`XDR Type Definition Error: ${o}`)}}class w extends _{constructor(){super("method not implemented, it should be overloaded in the descendant class.")}}var b=p(764).lW;class d{constructor(o){if(!b.isBuffer(o)){if(!(o instanceof Array))throw new v("source not specified");o=b.from(o)}this._buffer=o,this._length=o.length,this._index=0}_buffer;_length;_index;get eof(){return this._index===this._length}advance(o){const l=this._index;if(this._index+=o,this._length<this._index)throw new v("attempt to read outside the boundary of the buffer");const m=4-(o%4||4);if(m>0){for(let A=0;A<m;A++)if(this._buffer[this._index+A]!==0)throw new v("invalid padding");this._index+=m}return l}rewind(){this._index=0}read(o){const l=this.advance(o);return this._buffer.subarray(l,l+o)}readInt32BE(){return this._buffer.readInt32BE(this.advance(4))}readUInt32BE(){return this._buffer.readUInt32BE(this.advance(4))}readBigInt64BE(){return this._buffer.readBigInt64BE(this.advance(8))}readBigUInt64BE(){return this._buffer.readBigUInt64BE(this.advance(8))}readFloatBE(){return this._buffer.readFloatBE(this.advance(4))}readDoubleBE(){return this._buffer.readDoubleBE(this.advance(8))}ensureInputConsumed(){if(this._index!==this._length)throw new v("invalid XDR contract typecast - source buffer not entirely consumed")}}var E=p(764).lW;const x=8192;class I{constructor(o){typeof o=="number"?o=E.allocUnsafe(o):o instanceof E||(o=E.allocUnsafe(x)),this._buffer=o,this._length=o.length}_buffer;_length;_index=0;alloc(o){const l=this._index;return this._index+=o,this._length<this._index&&this.resize(this._index),l}resize(o){const l=Math.ceil(o/x)*x,m=E.allocUnsafe(l);this._buffer.copy(m,0,0,this._length),this._buffer=m,this._length=l}finalize(){return this._buffer.subarray(0,this._index)}toArray(){return[...this.finalize()]}write(o,l){if(typeof o=="string"){const A=this.alloc(l);this._buffer.write(o,A,"utf8")}else{o instanceof E||(o=E.from(o));const A=this.alloc(l);o.copy(this._buffer,A,0,l)}const m=4-(l%4||4);if(m>0){const A=this.alloc(m);this._buffer.fill(0,A,this._index)}}writeInt32BE(o){const l=this.alloc(4);this._buffer.writeInt32BE(o,l)}writeUInt32BE(o){const l=this.alloc(4);this._buffer.writeUInt32BE(o,l)}writeBigInt64BE(o){const l=this.alloc(8);this._buffer.writeBigInt64BE(o,l)}writeBigUInt64BE(o){const l=this.alloc(8);this._buffer.writeBigUInt64BE(o,l)}writeFloatBE(o){const l=this.alloc(4);this._buffer.writeFloatBE(o,l)}writeDoubleBE(o){const l=this.alloc(8);this._buffer.writeDoubleBE(o,l)}static bufferChunkSize=x}var S=p(764).lW;class T{toXDR(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"raw";if(!this.write)return this.constructor.toXDR(this,o);const l=new I;return this.write(this,l),j(l.finalize(),o)}fromXDR(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";if(!this.read)return this.constructor.fromXDR(o,l);const m=new d(q(o,l)),A=this.read(m);return m.ensureInputConsumed(),A}validateXDR(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";try{return this.fromXDR(o,l),!0}catch{return!1}}static toXDR(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";const m=new I;return this.write(o,m),j(m.finalize(),l)}static fromXDR(o){const l=new d(q(o,arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw")),m=this.read(l);return l.ensureInputConsumed(),m}static validateXDR(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";try{return this.fromXDR(o,l),!0}catch{return!1}}}class P extends T{static read(o){throw new w}static write(o,l){throw new w}static isValid(o){return!1}}class B extends T{isValid(o){return!1}}class D extends TypeError{constructor(o){super(`Invalid format ${o}, must be one of "raw", "hex", "base64"`)}}function j(y,o){switch(o){case"raw":return y;case"hex":return y.toString("hex");case"base64":return y.toString("base64");default:throw new D(o)}}function q(y,o){switch(o){case"raw":return y;case"hex":return S.from(y,"hex");case"base64":return S.from(y,"base64");default:throw new D(o)}}const z=2147483647,X=-2147483648;class V extends P{static read(o){return o.readInt32BE()}static write(o,l){if(typeof o!="number")throw new h("not a number");if((0|o)!==o)throw new h("invalid i32 value");l.writeInt32BE(o)}static isValid(o){return typeof o=="number"&&(0|o)===o&&o>=X&&o<=z}}V.MAX_VALUE=z,V.MIN_VALUE=2147483648;const ae=-9223372036854775808n,ue=9223372036854775807n;class k extends P{constructor(o,l){if(super(),typeof o=="bigint"){if(o<ae||o>ue)throw new TypeError("Invalid i64 value");this._value=o}else{if((0|o)!==o||(0|l)!==l)throw new TypeError("Invalid i64 value");this._value=BigInt(l>>>0)<<32n|BigInt(o>>>0)}}get low(){return Number(0xFFFFFFFFn&this._value)<<0}get high(){return Number(this._value>>32n)>>0}get unsigned(){return!1}toString(){return this._value.toString()}toJSON(){return{_value:this._value.toString()}}static read(o){return new k(o.readBigInt64BE())}static write(o,l){if(!(o instanceof this))throw new h(`${o} is not a Hyper`);l.writeBigInt64BE(o._value)}static fromString(o){if(!/^-?\d{0,19}$/.test(o))throw new TypeError(`Invalid i64 string value: ${o}`);return new k(BigInt(o))}static fromBits(o,l){return new this(o,l)}static isValid(o){return o instanceof this}}k.MAX_VALUE=new k(ue),k.MIN_VALUE=new k(ae);const re=4294967295;class N extends P{static read(o){return o.readUInt32BE()}static write(o,l){if(typeof o!="number"||!(o>=0&&o<=re)||o%1!=0)throw new h("invalid u32 value");l.writeUInt32BE(o)}static isValid(o){return typeof o=="number"&&o%1==0&&o>=0&&o<=re}}N.MAX_VALUE=re,N.MIN_VALUE=0;const ce=0n,hr=0xFFFFFFFFFFFFFFFFn;class se extends P{constructor(o,l){if(super(),typeof o=="bigint"){if(o<ce||o>hr)throw new TypeError("Invalid u64 value");this._value=o}else{if((0|o)!==o||(0|l)!==l)throw new TypeError("Invalid u64 value");this._value=BigInt(l>>>0)<<32n|BigInt(o>>>0)}}get low(){return Number(0xFFFFFFFFn&this._value)<<0}get high(){return Number(this._value>>32n)>>0}get unsigned(){return!0}toString(){return this._value.toString()}toJSON(){return{_value:this._value.toString()}}static read(o){return new se(o.readBigUInt64BE())}static write(o,l){if(!(o instanceof this))throw new h(`${o} is not an UnsignedHyper`);l.writeBigUInt64BE(o._value)}static fromString(o){if(!/^\d{0,20}$/.test(o))throw new TypeError(`Invalid u64 string value: ${o}`);return new se(BigInt(o))}static fromBits(o,l){return new this(o,l)}static isValid(o){return o instanceof this}}se.MAX_VALUE=new se(hr),se.MIN_VALUE=new se(ce);class Ne extends P{static read(o){return o.readFloatBE()}static write(o,l){if(typeof o!="number")throw new h("not a number");l.writeFloatBE(o)}static isValid(o){return typeof o=="number"}}class St extends P{static read(o){return o.readDoubleBE()}static write(o,l){if(typeof o!="number")throw new h("not a number");l.writeDoubleBE(o)}static isValid(o){return typeof o=="number"}}class G extends P{static read(){throw new _("quadruple not supported")}static write(){throw new _("quadruple not supported")}static isValid(){return!1}}class H extends P{static read(o){const l=V.read(o);switch(l){case 0:return!1;case 1:return!0;default:throw new v(`got ${l} when trying to read a bool`)}}static write(o,l){const m=o?1:0;V.write(m,l)}static isValid(o){return typeof o=="boolean"}}var dr=p(764).lW;class Dr extends B{constructor(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:N.MAX_VALUE;super(),this._maxLength=o}read(o){const l=N.read(o);if(l>this._maxLength)throw new v(`saw ${l} length String, max allowed is ${this._maxLength}`);return o.read(l)}readString(o){return this.read(o).toString("utf8")}write(o,l){const m=typeof o=="string"?dr.byteLength(o,"utf8"):o.length;if(m>this._maxLength)throw new h(`got ${o.length} bytes, max allowed is ${this._maxLength}`);N.write(m,l),l.write(o,m)}isValid(o){return typeof o=="string"?dr.byteLength(o,"utf8")<=this._maxLength:!!(o instanceof Array||dr.isBuffer(o))&&o.length<=this._maxLength}}var xt=p(764).lW;class Nr extends B{constructor(o){super(),this._length=o}read(o){return o.read(this._length)}write(o,l){const{length:m}=o;if(m!==this._length)throw new h(`got ${o.length} bytes, expected ${this._length}`);l.write(o,m)}isValid(o){return xt.isBuffer(o)&&o.length===this._length}}var It=p(764).lW;class Te extends B{constructor(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:N.MAX_VALUE;super(),this._maxLength=o}read(o){const l=N.read(o);if(l>this._maxLength)throw new v(`saw ${l} length VarOpaque, max allowed is ${this._maxLength}`);return o.read(l)}write(o,l){const{length:m}=o;if(o.length>this._maxLength)throw new h(`got ${o.length} bytes, max allowed is ${this._maxLength}`);N.write(m,l),l.write(o,m)}isValid(o){return It.isBuffer(o)&&o.length<=this._maxLength}}class yr extends B{constructor(o,l){super(),this._childType=o,this._length=l}read(o){const l=new p.g.Array(this._length);for(let m=0;m<this._length;m++)l[m]=this._childType.read(o);return l}write(o,l){if(!(o instanceof p.g.Array))throw new h("value is not array");if(o.length!==this._length)throw new h(`got array of size ${o.length}, expected ${this._length}`);for(const m of o)this._childType.write(m,l)}isValid(o){if(!(o instanceof p.g.Array)||o.length!==this._length)return!1;for(const l of o)if(!this._childType.isValid(l))return!1;return!0}}class Mr extends B{constructor(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:N.MAX_VALUE;super(),this._childType=o,this._maxLength=l}read(o){const l=N.read(o);if(l>this._maxLength)throw new v(`saw ${l} length VarArray, max allowed is ${this._maxLength}`);const m=new Array(l);for(let A=0;A<l;A++)m[A]=this._childType.read(o);return m}write(o,l){if(!(o instanceof Array))throw new h("value is not array");if(o.length>this._maxLength)throw new h(`got array of size ${o.length}, max allowed is ${this._maxLength}`);N.write(o.length,l);for(const m of o)this._childType.write(m,l)}isValid(o){if(!(o instanceof Array)||o.length>this._maxLength)return!1;for(const l of o)if(!this._childType.isValid(l))return!1;return!0}}class Lr extends P{constructor(o){super(),this._childType=o}read(o){if(H.read(o))return this._childType.read(o)}write(o,l){const m=o!=null;H.write(m,l),m&&this._childType.write(o,l)}isValid(o){return o==null||this._childType.isValid(o)}}class Q extends P{static read(){}static write(o){if(o!==void 0)throw new h("trying to write value to a void slot")}static isValid(o){return o===void 0}}class be extends P{constructor(o,l){super(),this.name=o,this.value=l}static read(o){const l=V.read(o),m=this._byValue[l];if(m===void 0)throw new v(`unknown ${this.enumName} member for value ${l}`);return m}static write(o,l){if(!(o instanceof this))throw new h(`unknown ${o} is not a ${this.enumName}`);V.write(o.value,l)}static isValid(o){return o instanceof this}static members(){return this._members}static values(){return Object.values(this._members)}static fromName(o){const l=this._members[o];if(!l)throw new TypeError(`${o} is not a member of ${this.enumName}`);return l}static fromValue(o){const l=this._byValue[o];if(l===void 0)throw new TypeError(`${o} is not a value of any member of ${this.enumName}`);return l}static create(o,l,m){const A=class extends be{};A.enumName=l,o.results[l]=A,A._members={},A._byValue={};for(const[F,R]of Object.entries(m)){const C=new A(F,R);A._members[F]=C,A._byValue[R]=C,A[F]=()=>C}return A}}class te extends P{resolve(){throw new _('"resolve" method should be implemented in the descendant class')}}class Me extends P{constructor(o){super(),this._attributes=o||{}}static read(o){const l={};for(const[m,A]of this._fields)l[m]=A.read(o);return new this(l)}static write(o,l){if(!(o instanceof this))throw new h(`${o} is not a ${this.structName}`);for(const[m,A]of this._fields){const F=o._attributes[m];A.write(F,l)}}static isValid(o){return o instanceof this}static create(o,l,m){const A=class extends Me{};A.structName=l,o.results[l]=A;const F=new Array(m.length);for(let R=0;R<m.length;R++){const C=m[R],jr=C[0];let Ot=C[1];Ot instanceof te&&(Ot=Ot.resolve(o)),F[R]=[jr,Ot],A.prototype[jr]=Tt(jr)}return A._fields=F,A}}function Tt(y){return function(o){return o!==void 0&&(this._attributes[y]=o),this._attributes[y]}}class Oe extends B{constructor(o,l){super(),this.set(o,l)}set(o,l){typeof o=="string"&&(o=this.constructor._switchOn.fromName(o)),this._switch=o;const m=this.constructor.armForSwitch(this._switch);this._arm=m,this._armType=m===Q?Q:this.constructor._arms[m],this._value=l}get(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this._arm;if(this._arm!==Q&&this._arm!==o)throw new TypeError(`${o} not set`);return this._value}switch(){return this._switch}arm(){return this._arm}armType(){return this._armType}value(){return this._value}static armForSwitch(o){const l=this._switches.get(o);if(l!==void 0)return l;if(this._defaultArm)return this._defaultArm;throw new TypeError(`Bad union switch: ${o}`)}static armTypeForArm(o){return o===Q?Q:this._arms[o]}static read(o){const l=this._switchOn.read(o),m=this.armForSwitch(l),A=m===Q?Q:this._arms[m];let F;return F=A!==void 0?A.read(o):m.read(o),new this(l,F)}static write(o,l){if(!(o instanceof this))throw new h(`${o} is not a ${this.unionName}`);this._switchOn.write(o.switch(),l),o.armType().write(o.value(),l)}static isValid(o){return o instanceof this}static create(o,l,m){const A=class extends Oe{};A.unionName=l,o.results[l]=A,m.switchOn instanceof te?A._switchOn=m.switchOn.resolve(o):A._switchOn=m.switchOn,A._switches=new Map,A._arms={};let F=m.defaultArm;F instanceof te&&(F=F.resolve(o)),A._defaultArm=F;for(const[R,C]of m.switches){const jr=typeof R=="string"?A._switchOn.fromName(R):R;A._switches.set(jr,C)}if(A._switchOn.values!==void 0)for(const R of A._switchOn.values())A[R.name]=function(C){return new A(R,C)},A.prototype[R.name]=function(C){return this.set(R,C)};if(m.arms)for(const[R,C]of Object.entries(m.arms))A._arms[R]=C instanceof te?C.resolve(o):C,C!==Q&&(A.prototype[R]=function(){return this.get(R)});return A}}class le extends te{constructor(o){super(),this.name=o}resolve(o){return o.definitions[this.name].resolve(o)}}class gr extends te{constructor(o,l){let m=arguments.length>2&&arguments[2]!==void 0&&arguments[2];super(),this.childReference=o,this.length=l,this.variable=m}resolve(o){let l=this.childReference,m=this.length;return l instanceof te&&(l=l.resolve(o)),m instanceof te&&(m=m.resolve(o)),this.variable?new Mr(l,m):new yr(l,m)}}class Qn extends te{constructor(o){super(),this.childReference=o,this.name=o.name}resolve(o){let l=this.childReference;return l instanceof te&&(l=l.resolve(o)),new Lr(l)}}class pe extends te{constructor(o,l){super(),this.sizedType=o,this.length=l}resolve(o){let l=this.length;return l instanceof te&&(l=l.resolve(o)),new this.sizedType(l)}}class Je{constructor(o,l,m){this.constructor=o,this.name=l,this.config=m}resolve(o){return this.name in o.results?o.results[this.name]:this.constructor(o,this.name,this.config)}}function i(y,o,l){return l instanceof te&&(l=l.resolve(y)),y.results[o]=l,l}function u(y,o,l){return y.results[o]=l,l}class f{constructor(o){this._destination=o,this._definitions={}}enum(o,l){const m=new Je(be.create,o,l);this.define(o,m)}struct(o,l){const m=new Je(Me.create,o,l);this.define(o,m)}union(o,l){const m=new Je(Oe.create,o,l);this.define(o,m)}typedef(o,l){const m=new Je(i,o,l);this.define(o,m)}const(o,l){const m=new Je(u,o,l);this.define(o,m)}void(){return Q}bool(){return H}int(){return V}hyper(){return k}uint(){return N}uhyper(){return se}float(){return Ne}double(){return St}quadruple(){return G}string(o){return new pe(Dr,o)}opaque(o){return new pe(Nr,o)}varOpaque(o){return new pe(Te,o)}array(o,l){return new gr(o,l)}varArray(o,l){return new gr(o,l,!0)}option(o){return new Qn(o)}define(o,l){if(this._destination[o]!==void 0)throw new _(`${o} is already defined`);this._definitions[o]=l}lookup(o){return new le(o)}resolve(){for(const o of Object.values(this._definitions))o.resolve({definitions:this._definitions,results:this._destination})}}function g(y){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(y){const l=new f(o);y(l),l.resolve()}return o}},742:(s,c)=>{c.byteLength=function(E){var x=b(E),I=x[0],S=x[1];return 3*(I+S)/4-S},c.toByteArray=function(E){var x,I,S=b(E),T=S[0],P=S[1],B=new v(function(q,z,X){return 3*(z+X)/4-X}(0,T,P)),D=0,j=P>0?T-4:T;for(I=0;I<j;I+=4)x=h[E.charCodeAt(I)]<<18|h[E.charCodeAt(I+1)]<<12|h[E.charCodeAt(I+2)]<<6|h[E.charCodeAt(I+3)],B[D++]=x>>16&255,B[D++]=x>>8&255,B[D++]=255&x;return P===2&&(x=h[E.charCodeAt(I)]<<2|h[E.charCodeAt(I+1)]>>4,B[D++]=255&x),P===1&&(x=h[E.charCodeAt(I)]<<10|h[E.charCodeAt(I+1)]<<4|h[E.charCodeAt(I+2)]>>2,B[D++]=x>>8&255,B[D++]=255&x),B},c.fromByteArray=function(E){for(var x,I=E.length,S=I%3,T=[],P=16383,B=0,D=I-S;B<D;B+=P)T.push(d(E,B,B+P>D?D:B+P));return S===1?(x=E[I-1],T.push(p[x>>2]+p[x<<4&63]+"==")):S===2&&(x=(E[I-2]<<8)+E[I-1],T.push(p[x>>10]+p[x>>4&63]+p[x<<2&63]+"=")),T.join("")};for(var p=[],h=[],v=typeof Uint8Array<"u"?Uint8Array:Array,_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",w=0;w<64;++w)p[w]=_[w],h[_.charCodeAt(w)]=w;function b(E){var x=E.length;if(x%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var I=E.indexOf("=");return I===-1&&(I=x),[I,I===x?0:4-I%4]}function d(E,x,I){for(var S,T,P=[],B=x;B<I;B+=3)S=(E[B]<<16&16711680)+(E[B+1]<<8&65280)+(255&E[B+2]),P.push(p[(T=S)>>18&63]+p[T>>12&63]+p[T>>6&63]+p[63&T]);return P.join("")}h["-".charCodeAt(0)]=62,h["_".charCodeAt(0)]=63},764:(s,c,p)=>{const h=p(742),v=p(645),_=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;c.lW=d,c.h2=50;const w=2147483647;function b(i){if(i>w)throw new RangeError('The value "'+i+'" is invalid for option "size"');const u=new Uint8Array(i);return Object.setPrototypeOf(u,d.prototype),u}function d(i,u,f){if(typeof i=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return I(i)}return E(i,u,f)}function E(i,u,f){if(typeof i=="string")return function(o,l){if(typeof l=="string"&&l!==""||(l="utf8"),!d.isEncoding(l))throw new TypeError("Unknown encoding: "+l);const m=0|B(o,l);let A=b(m);const F=A.write(o,l);return F!==m&&(A=A.slice(0,F)),A}(i,u);if(ArrayBuffer.isView(i))return function(o){if(le(o,Uint8Array)){const l=new Uint8Array(o);return T(l.buffer,l.byteOffset,l.byteLength)}return S(o)}(i);if(i==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);if(le(i,ArrayBuffer)||i&&le(i.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(le(i,SharedArrayBuffer)||i&&le(i.buffer,SharedArrayBuffer)))return T(i,u,f);if(typeof i=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const g=i.valueOf&&i.valueOf();if(g!=null&&g!==i)return d.from(g,u,f);const y=function(o){if(d.isBuffer(o)){const l=0|P(o.length),m=b(l);return m.length===0||o.copy(m,0,0,l),m}if(o.length!==void 0)return typeof o.length!="number"||gr(o.length)?b(0):S(o);if(o.type==="Buffer"&&Array.isArray(o.data))return S(o.data)}(i);if(y)return y;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof i[Symbol.toPrimitive]=="function")return d.from(i[Symbol.toPrimitive]("string"),u,f);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i)}function x(i){if(typeof i!="number")throw new TypeError('"size" argument must be of type number');if(i<0)throw new RangeError('The value "'+i+'" is invalid for option "size"')}function I(i){return x(i),b(i<0?0:0|P(i))}function S(i){const u=i.length<0?0:0|P(i.length),f=b(u);for(let g=0;g<u;g+=1)f[g]=255&i[g];return f}function T(i,u,f){if(u<0||i.byteLength<u)throw new RangeError('"offset" is outside of buffer bounds');if(i.byteLength<u+(f||0))throw new RangeError('"length" is outside of buffer bounds');let g;return g=u===void 0&&f===void 0?new Uint8Array(i):f===void 0?new Uint8Array(i,u):new Uint8Array(i,u,f),Object.setPrototypeOf(g,d.prototype),g}function P(i){if(i>=w)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+w.toString(16)+" bytes");return 0|i}function B(i,u){if(d.isBuffer(i))return i.length;if(ArrayBuffer.isView(i)||le(i,ArrayBuffer))return i.byteLength;if(typeof i!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof i);const f=i.length,g=arguments.length>2&&arguments[2]===!0;if(!g&&f===0)return 0;let y=!1;for(;;)switch(u){case"ascii":case"latin1":case"binary":return f;case"utf8":case"utf-8":return Me(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*f;case"hex":return f>>>1;case"base64":return Tt(i).length;default:if(y)return g?-1:Me(i).length;u=(""+u).toLowerCase(),y=!0}}function D(i,u,f){let g=!1;if((u===void 0||u<0)&&(u=0),u>this.length||((f===void 0||f>this.length)&&(f=this.length),f<=0)||(f>>>=0)<=(u>>>=0))return"";for(i||(i="utf8");;)switch(i){case"hex":return Ne(this,u,f);case"utf8":case"utf-8":return N(this,u,f);case"ascii":return hr(this,u,f);case"latin1":case"binary":return se(this,u,f);case"base64":return re(this,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return St(this,u,f);default:if(g)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),g=!0}}function j(i,u,f){const g=i[u];i[u]=i[f],i[f]=g}function q(i,u,f,g,y){if(i.length===0)return-1;if(typeof f=="string"?(g=f,f=0):f>2147483647?f=2147483647:f<-2147483648&&(f=-2147483648),gr(f=+f)&&(f=y?0:i.length-1),f<0&&(f=i.length+f),f>=i.length){if(y)return-1;f=i.length-1}else if(f<0){if(!y)return-1;f=0}if(typeof u=="string"&&(u=d.from(u,g)),d.isBuffer(u))return u.length===0?-1:z(i,u,f,g,y);if(typeof u=="number")return u&=255,typeof Uint8Array.prototype.indexOf=="function"?y?Uint8Array.prototype.indexOf.call(i,u,f):Uint8Array.prototype.lastIndexOf.call(i,u,f):z(i,[u],f,g,y);throw new TypeError("val must be string, number or Buffer")}function z(i,u,f,g,y){let o,l=1,m=i.length,A=u.length;if(g!==void 0&&((g=String(g).toLowerCase())==="ucs2"||g==="ucs-2"||g==="utf16le"||g==="utf-16le")){if(i.length<2||u.length<2)return-1;l=2,m/=2,A/=2,f/=2}function F(R,C){return l===1?R[C]:R.readUInt16BE(C*l)}if(y){let R=-1;for(o=f;o<m;o++)if(F(i,o)===F(u,R===-1?0:o-R)){if(R===-1&&(R=o),o-R+1===A)return R*l}else R!==-1&&(o-=o-R),R=-1}else for(f+A>m&&(f=m-A),o=f;o>=0;o--){let R=!0;for(let C=0;C<A;C++)if(F(i,o+C)!==F(u,C)){R=!1;break}if(R)return o}return-1}function X(i,u,f,g){f=Number(f)||0;const y=i.length-f;g?(g=Number(g))>y&&(g=y):g=y;const o=u.length;let l;for(g>o/2&&(g=o/2),l=0;l<g;++l){const m=parseInt(u.substr(2*l,2),16);if(gr(m))return l;i[f+l]=m}return l}function V(i,u,f,g){return Oe(Me(u,i.length-f),i,f,g)}function ae(i,u,f,g){return Oe(function(y){const o=[];for(let l=0;l<y.length;++l)o.push(255&y.charCodeAt(l));return o}(u),i,f,g)}function ue(i,u,f,g){return Oe(Tt(u),i,f,g)}function k(i,u,f,g){return Oe(function(y,o){let l,m,A;const F=[];for(let R=0;R<y.length&&!((o-=2)<0);++R)l=y.charCodeAt(R),m=l>>8,A=l%256,F.push(A),F.push(m);return F}(u,i.length-f),i,f,g)}function re(i,u,f){return u===0&&f===i.length?h.fromByteArray(i):h.fromByteArray(i.slice(u,f))}function N(i,u,f){f=Math.min(i.length,f);const g=[];let y=u;for(;y<f;){const o=i[y];let l=null,m=o>239?4:o>223?3:o>191?2:1;if(y+m<=f){let A,F,R,C;switch(m){case 1:o<128&&(l=o);break;case 2:A=i[y+1],(192&A)==128&&(C=(31&o)<<6|63&A,C>127&&(l=C));break;case 3:A=i[y+1],F=i[y+2],(192&A)==128&&(192&F)==128&&(C=(15&o)<<12|(63&A)<<6|63&F,C>2047&&(C<55296||C>57343)&&(l=C));break;case 4:A=i[y+1],F=i[y+2],R=i[y+3],(192&A)==128&&(192&F)==128&&(192&R)==128&&(C=(15&o)<<18|(63&A)<<12|(63&F)<<6|63&R,C>65535&&C<1114112&&(l=C))}}l===null?(l=65533,m=1):l>65535&&(l-=65536,g.push(l>>>10&1023|55296),l=56320|1023&l),g.push(l),y+=m}return function(o){const l=o.length;if(l<=ce)return String.fromCharCode.apply(String,o);let m="",A=0;for(;A<l;)m+=String.fromCharCode.apply(String,o.slice(A,A+=ce));return m}(g)}d.TYPED_ARRAY_SUPPORT=function(){try{const i=new Uint8Array(1),u={foo:function(){return 42}};return Object.setPrototypeOf(u,Uint8Array.prototype),Object.setPrototypeOf(i,u),i.foo()===42}catch{return!1}}(),d.TYPED_ARRAY_SUPPORT||typeof console>"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}}),d.poolSize=8192,d.from=function(i,u,f){return E(i,u,f)},Object.setPrototypeOf(d.prototype,Uint8Array.prototype),Object.setPrototypeOf(d,Uint8Array),d.alloc=function(i,u,f){return function(g,y,o){return x(g),g<=0?b(g):y!==void 0?typeof o=="string"?b(g).fill(y,o):b(g).fill(y):b(g)}(i,u,f)},d.allocUnsafe=function(i){return I(i)},d.allocUnsafeSlow=function(i){return I(i)},d.isBuffer=function(i){return i!=null&&i._isBuffer===!0&&i!==d.prototype},d.compare=function(i,u){if(le(i,Uint8Array)&&(i=d.from(i,i.offset,i.byteLength)),le(u,Uint8Array)&&(u=d.from(u,u.offset,u.byteLength)),!d.isBuffer(i)||!d.isBuffer(u))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(i===u)return 0;let f=i.length,g=u.length;for(let y=0,o=Math.min(f,g);y<o;++y)if(i[y]!==u[y]){f=i[y],g=u[y];break}return f<g?-1:g<f?1:0},d.isEncoding=function(i){switch(String(i).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}},d.concat=function(i,u){if(!Array.isArray(i))throw new TypeError('"list" argument must be an Array of Buffers');if(i.length===0)return d.alloc(0);let f;if(u===void 0)for(u=0,f=0;f<i.length;++f)u+=i[f].length;const g=d.allocUnsafe(u);let y=0;for(f=0;f<i.length;++f){let o=i[f];if(le(o,Uint8Array))y+o.length>g.length?(d.isBuffer(o)||(o=d.from(o)),o.copy(g,y)):Uint8Array.prototype.set.call(g,o,y);else{if(!d.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(g,y)}y+=o.length}return g},d.byteLength=B,d.prototype._isBuffer=!0,d.prototype.swap16=function(){const i=this.length;if(i%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let u=0;u<i;u+=2)j(this,u,u+1);return this},d.prototype.swap32=function(){const i=this.length;if(i%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let u=0;u<i;u+=4)j(this,u,u+3),j(this,u+1,u+2);return this},d.prototype.swap64=function(){const i=this.length;if(i%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let u=0;u<i;u+=8)j(this,u,u+7),j(this,u+1,u+6),j(this,u+2,u+5),j(this,u+3,u+4);return this},d.prototype.toString=function(){const i=this.length;return i===0?"":arguments.length===0?N(this,0,i):D.apply(this,arguments)},d.prototype.toLocaleString=d.prototype.toString,d.prototype.equals=function(i){if(!d.isBuffer(i))throw new TypeError("Argument must be a Buffer");return this===i||d.compare(this,i)===0},d.prototype.inspect=function(){let i="";const u=c.h2;return i=this.toString("hex",0,u).replace(/(.{2})/g,"$1 ").trim(),this.length>u&&(i+=" ... "),"<Buffer "+i+">"},_&&(d.prototype[_]=d.prototype.inspect),d.prototype.compare=function(i,u,f,g,y){if(le(i,Uint8Array)&&(i=d.from(i,i.offset,i.byteLength)),!d.isBuffer(i))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof i);if(u===void 0&&(u=0),f===void 0&&(f=i?i.length:0),g===void 0&&(g=0),y===void 0&&(y=this.length),u<0||f>i.length||g<0||y>this.length)throw new RangeError("out of range index");if(g>=y&&u>=f)return 0;if(g>=y)return-1;if(u>=f)return 1;if(this===i)return 0;let o=(y>>>=0)-(g>>>=0),l=(f>>>=0)-(u>>>=0);const m=Math.min(o,l),A=this.slice(g,y),F=i.slice(u,f);for(let R=0;R<m;++R)if(A[R]!==F[R]){o=A[R],l=F[R];break}return o<l?-1:l<o?1:0},d.prototype.includes=function(i,u,f){return this.indexOf(i,u,f)!==-1},d.prototype.indexOf=function(i,u,f){return q(this,i,u,f,!0)},d.prototype.lastIndexOf=function(i,u,f){return q(this,i,u,f,!1)},d.prototype.write=function(i,u,f,g){if(u===void 0)g="utf8",f=this.length,u=0;else if(f===void 0&&typeof u=="string")g=u,f=this.length,u=0;else{if(!isFinite(u))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");u>>>=0,isFinite(f)?(f>>>=0,g===void 0&&(g="utf8")):(g=f,f=void 0)}const y=this.length-u;if((f===void 0||f>y)&&(f=y),i.length>0&&(f<0||u<0)||u>this.length)throw new RangeError("Attempt to write outside buffer bounds");g||(g="utf8");let o=!1;for(;;)switch(g){case"hex":return X(this,i,u,f);case"utf8":case"utf-8":return V(this,i,u,f);case"ascii":case"latin1":case"binary":return ae(this,i,u,f);case"base64":return ue(this,i,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,i,u,f);default:if(o)throw new TypeError("Unknown encoding: "+g);g=(""+g).toLowerCase(),o=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const ce=4096;function hr(i,u,f){let g="";f=Math.min(i.length,f);for(let y=u;y<f;++y)g+=String.fromCharCode(127&i[y]);return g}function se(i,u,f){let g="";f=Math.min(i.length,f);for(let y=u;y<f;++y)g+=String.fromCharCode(i[y]);return g}function Ne(i,u,f){const g=i.length;(!u||u<0)&&(u=0),(!f||f<0||f>g)&&(f=g);let y="";for(let o=u;o<f;++o)y+=Qn[i[o]];return y}function St(i,u,f){const g=i.slice(u,f);let y="";for(let o=0;o<g.length-1;o+=2)y+=String.fromCharCode(g[o]+256*g[o+1]);return y}function G(i,u,f){if(i%1!=0||i<0)throw new RangeError("offset is not uint");if(i+u>f)throw new RangeError("Trying to access beyond buffer length")}function H(i,u,f,g,y,o){if(!d.isBuffer(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>y||u<o)throw new RangeError('"value" argument is out of bounds');if(f+g>i.length)throw new RangeError("Index out of range")}function dr(i,u,f,g,y){Lr(u,g,y,i,f,7);let o=Number(u&BigInt(4294967295));i[f++]=o,o>>=8,i[f++]=o,o>>=8,i[f++]=o,o>>=8,i[f++]=o;let l=Number(u>>BigInt(32)&BigInt(4294967295));return i[f++]=l,l>>=8,i[f++]=l,l>>=8,i[f++]=l,l>>=8,i[f++]=l,f}function Dr(i,u,f,g,y){Lr(u,g,y,i,f,7);let o=Number(u&BigInt(4294967295));i[f+7]=o,o>>=8,i[f+6]=o,o>>=8,i[f+5]=o,o>>=8,i[f+4]=o;let l=Number(u>>BigInt(32)&BigInt(4294967295));return i[f+3]=l,l>>=8,i[f+2]=l,l>>=8,i[f+1]=l,l>>=8,i[f]=l,f+8}function xt(i,u,f,g,y,o){if(f+g>i.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("Index out of range")}function Nr(i,u,f,g,y){return u=+u,f>>>=0,y||xt(i,0,f,4),v.write(i,u,f,g,23,4),f+4}function It(i,u,f,g,y){return u=+u,f>>>=0,y||xt(i,0,f,8),v.write(i,u,f,g,52,8),f+8}d.prototype.slice=function(i,u){const f=this.length;(i=~~i)<0?(i+=f)<0&&(i=0):i>f&&(i=f),(u=u===void 0?f:~~u)<0?(u+=f)<0&&(u=0):u>f&&(u=f),u<i&&(u=i);const g=this.subarray(i,u);return Object.setPrototypeOf(g,d.prototype),g},d.prototype.readUintLE=d.prototype.readUIntLE=function(i,u,f){i>>>=0,u>>>=0,f||G(i,u,this.length);let g=this[i],y=1,o=0;for(;++o<u&&(y*=256);)g+=this[i+o]*y;return g},d.prototype.readUintBE=d.prototype.readUIntBE=function(i,u,f){i>>>=0,u>>>=0,f||G(i,u,this.length);let g=this[i+--u],y=1;for(;u>0&&(y*=256);)g+=this[i+--u]*y;return g},d.prototype.readUint8=d.prototype.readUInt8=function(i,u){return i>>>=0,u||G(i,1,this.length),this[i]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(i,u){return i>>>=0,u||G(i,2,this.length),this[i]|this[i+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(i,u){return i>>>=0,u||G(i,2,this.length),this[i]<<8|this[i+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(i,u){return i>>>=0,u||G(i,4,this.length),(this[i]|this[i+1]<<8|this[i+2]<<16)+16777216*this[i+3]},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(i,u){return i>>>=0,u||G(i,4,this.length),16777216*this[i]+(this[i+1]<<16|this[i+2]<<8|this[i+3])},d.prototype.readBigUInt64LE=pe(function(i){Q(i>>>=0,"offset");const u=this[i],f=this[i+7];u!==void 0&&f!==void 0||be(i,this.length-8);const g=u+256*this[++i]+65536*this[++i]+this[++i]*2**24,y=this[++i]+256*this[++i]+65536*this[++i]+f*2**24;return BigInt(g)+(BigInt(y)<<BigInt(32))}),d.prototype.readBigUInt64BE=pe(function(i){Q(i>>>=0,"offset");const u=this[i],f=this[i+7];u!==void 0&&f!==void 0||be(i,this.length-8);const g=u*2**24+65536*this[++i]+256*this[++i]+this[++i],y=this[++i]*2**24+65536*this[++i]+256*this[++i]+f;return(BigInt(g)<<BigInt(32))+BigInt(y)}),d.prototype.readIntLE=function(i,u,f){i>>>=0,u>>>=0,f||G(i,u,this.length);let g=this[i],y=1,o=0;for(;++o<u&&(y*=256);)g+=this[i+o]*y;return y*=128,g>=y&&(g-=Math.pow(2,8*u)),g},d.prototype.readIntBE=function(i,u,f){i>>>=0,u>>>=0,f||G(i,u,this.length);let g=u,y=1,o=this[i+--g];for(;g>0&&(y*=256);)o+=this[i+--g]*y;return y*=128,o>=y&&(o-=Math.pow(2,8*u)),o},d.prototype.readInt8=function(i,u){return i>>>=0,u||G(i,1,this.length),128&this[i]?-1*(255-this[i]+1):this[i]},d.prototype.readInt16LE=function(i,u){i>>>=0,u||G(i,2,this.length);const f=this[i]|this[i+1]<<8;return 32768&f?4294901760|f:f},d.prototype.readInt16BE=function(i,u){i>>>=0,u||G(i,2,this.length);const f=this[i+1]|this[i]<<8;return 32768&f?4294901760|f:f},d.prototype.readInt32LE=function(i,u){return i>>>=0,u||G(i,4,this.length),this[i]|this[i+1]<<8|this[i+2]<<16|this[i+3]<<24},d.prototype.readInt32BE=function(i,u){return i>>>=0,u||G(i,4,this.length),this[i]<<24|this[i+1]<<16|this[i+2]<<8|this[i+3]},d.prototype.readBigInt64LE=pe(function(i){Q(i>>>=0,"offset");const u=this[i],f=this[i+7];u!==void 0&&f!==void 0||be(i,this.length-8);const g=this[i+4]+256*this[i+5]+65536*this[i+6]+(f<<24);return(BigInt(g)<<BigInt(32))+BigInt(u+256*this[++i]+65536*this[++i]+this[++i]*16777216)}),d.prototype.readBigInt64BE=pe(function(i){Q(i>>>=0,"offset");const u=this[i],f=this[i+7];u!==void 0&&f!==void 0||be(i,this.length-8);const g=(u<<24)+65536*this[++i]+256*this[++i]+this[++i];return(BigInt(g)<<BigInt(32))+BigInt(this[++i]*16777216+65536*this[++i]+256*this[++i]+f)}),d.prototype.readFloatLE=function(i,u){return i>>>=0,u||G(i,4,this.length),v.read(this,i,!0,23,4)},d.prototype.readFloatBE=function(i,u){return i>>>=0,u||G(i,4,this.length),v.read(this,i,!1,23,4)},d.prototype.readDoubleLE=function(i,u){return i>>>=0,u||G(i,8,this.length),v.read(this,i,!0,52,8)},d.prototype.readDoubleBE=function(i,u){return i>>>=0,u||G(i,8,this.length),v.read(this,i,!1,52,8)},d.prototype.writeUintLE=d.prototype.writeUIntLE=function(i,u,f,g){i=+i,u>>>=0,f>>>=0,!g&&H(this,i,u,f,Math.pow(2,8*f)-1,0);let y=1,o=0;for(this[u]=255&i;++o<f&&(y*=256);)this[u+o]=i/y&255;return u+f},d.prototype.writeUintBE=d.prototype.writeUIntBE=function(i,u,f,g){i=+i,u>>>=0,f>>>=0,!g&&H(this,i,u,f,Math.pow(2,8*f)-1,0);let y=f-1,o=1;for(this[u+y]=255&i;--y>=0&&(o*=256);)this[u+y]=i/o&255;return u+f},d.prototype.writeUint8=d.prototype.writeUInt8=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,1,255,0),this[u]=255&i,u+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,2,65535,0),this[u]=255&i,this[u+1]=i>>>8,u+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,2,65535,0),this[u]=i>>>8,this[u+1]=255&i,u+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,4,4294967295,0),this[u+3]=i>>>24,this[u+2]=i>>>16,this[u+1]=i>>>8,this[u]=255&i,u+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,4,4294967295,0),this[u]=i>>>24,this[u+1]=i>>>16,this[u+2]=i>>>8,this[u+3]=255&i,u+4},d.prototype.writeBigUInt64LE=pe(function(i,u=0){return dr(this,i,u,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeBigUInt64BE=pe(function(i,u=0){return Dr(this,i,u,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeIntLE=function(i,u,f,g){if(i=+i,u>>>=0,!g){const m=Math.pow(2,8*f-1);H(this,i,u,f,m-1,-m)}let y=0,o=1,l=0;for(this[u]=255&i;++y<f&&(o*=256);)i<0&&l===0&&this[u+y-1]!==0&&(l=1),this[u+y]=(i/o>>0)-l&255;return u+f},d.prototype.writeIntBE=function(i,u,f,g){if(i=+i,u>>>=0,!g){const m=Math.pow(2,8*f-1);H(this,i,u,f,m-1,-m)}let y=f-1,o=1,l=0;for(this[u+y]=255&i;--y>=0&&(o*=256);)i<0&&l===0&&this[u+y+1]!==0&&(l=1),this[u+y]=(i/o>>0)-l&255;return u+f},d.prototype.writeInt8=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,1,127,-128),i<0&&(i=255+i+1),this[u]=255&i,u+1},d.prototype.writeInt16LE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,2,32767,-32768),this[u]=255&i,this[u+1]=i>>>8,u+2},d.prototype.writeInt16BE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,2,32767,-32768),this[u]=i>>>8,this[u+1]=255&i,u+2},d.prototype.writeInt32LE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,4,2147483647,-2147483648),this[u]=255&i,this[u+1]=i>>>8,this[u+2]=i>>>16,this[u+3]=i>>>24,u+4},d.prototype.writeInt32BE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,4,2147483647,-2147483648),i<0&&(i=4294967295+i+1),this[u]=i>>>24,this[u+1]=i>>>16,this[u+2]=i>>>8,this[u+3]=255&i,u+4},d.prototype.writeBigInt64LE=pe(function(i,u=0){return dr(this,i,u,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeBigInt64BE=pe(function(i,u=0){return Dr(this,i,u,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeFloatLE=function(i,u,f){return Nr(this,i,u,!0,f)},d.prototype.writeFloatBE=function(i,u,f){return Nr(this,i,u,!1,f)},d.prototype.writeDoubleLE=function(i,u,f){return It(this,i,u,!0,f)},d.prototype.writeDoubleBE=function(i,u,f){return It(this,i,u,!1,f)},d.prototype.copy=function(i,u,f,g){if(!d.isBuffer(i))throw new TypeError("argument should be a Buffer");if(f||(f=0),g||g===0||(g=this.length),u>=i.length&&(u=i.length),u||(u=0),g>0&&g<f&&(g=f),g===f||i.length===0||this.length===0)return 0;if(u<0)throw new RangeError("targetStart out of bounds");if(f<0||f>=this.length)throw new RangeError("Index out of range");if(g<0)throw new RangeError("sourceEnd out of bounds");g>this.length&&(g=this.length),i.length-u<g-f&&(g=i.length-u+f);const y=g-f;return this===i&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(u,f,g):Uint8Array.prototype.set.call(i,this.subarray(f,g),u),y},d.prototype.fill=function(i,u,f,g){if(typeof i=="string"){if(typeof u=="string"?(g=u,u=0,f=this.length):typeof f=="string"&&(g=f,f=this.length),g!==void 0&&typeof g!="string")throw new TypeError("encoding must be a string");if(typeof g=="string"&&!d.isEncoding(g))throw new TypeError("Unknown encoding: "+g);if(i.length===1){const o=i.charCodeAt(0);(g==="utf8"&&o<128||g==="latin1")&&(i=o)}}else typeof i=="number"?i&=255:typeof i=="boolean"&&(i=Number(i));if(u<0||this.length<u||this.length<f)throw new RangeError("Out of range index");if(f<=u)return this;let y;if(u>>>=0,f=f===void 0?this.length:f>>>0,i||(i=0),typeof i=="number")for(y=u;y<f;++y)this[y]=i;else{const o=d.isBuffer(i)?i:d.from(i,g),l=o.length;if(l===0)throw new TypeError('The value "'+i+'" is invalid for argument "value"');for(y=0;y<f-u;++y)this[y+u]=o[y%l]}return this};const Te={};function yr(i,u,f){Te[i]=class extends f{constructor(){super(),Object.defineProperty(this,"message",{value:u.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${i}]`,this.stack,delete this.name}get code(){return i}set code(g){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:g,writable:!0})}toString(){return`${this.name} [${i}]: ${this.message}`}}}function Mr(i){let u="",f=i.length;const g=i[0]==="-"?1:0;for(;f>=g+4;f-=3)u=`_${i.slice(f-3,f)}${u}`;return`${i.slice(0,f)}${u}`}function Lr(i,u,f,g,y,o){if(i>f||i<u){const l=typeof u=="bigint"?"n":"";let m;throw m=o>3?u===0||u===BigInt(0)?`>= 0${l} and < 2${l} ** ${8*(o+1)}${l}`:`>= -(2${l} ** ${8*(o+1)-1}${l}) and < 2 ** ${8*(o+1)-1}${l}`:`>= ${u}${l} and <= ${f}${l}`,new Te.ERR_OUT_OF_RANGE("value",m,i)}(function(l,m,A){Q(m,"offset"),l[m]!==void 0&&l[m+A]!==void 0||be(m,l.length-(A+1))})(g,y,o)}function Q(i,u){if(typeof i!="number")throw new Te.ERR_INVALID_ARG_TYPE(u,"number",i)}function be(i,u,f){throw Math.floor(i)!==i?(Q(i,f),new Te.ERR_OUT_OF_RANGE(f||"offset","an integer",i)):u<0?new Te.ERR_BUFFER_OUT_OF_BOUNDS:new Te.ERR_OUT_OF_RANGE(f||"offset",`>= ${f?1:0} and <= ${u}`,i)}yr("ERR_BUFFER_OUT_OF_BOUNDS",function(i){return i?`${i} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),yr("ERR_INVALID_ARG_TYPE",function(i,u){return`The "${i}" argument must be of type number. Received type ${typeof u}`},TypeError),yr("ERR_OUT_OF_RANGE",function(i,u,f){let g=`The value of "${i}" is out of range.`,y=f;return Number.isInteger(f)&&Math.abs(f)>4294967296?y=Mr(String(f)):typeof f=="bigint"&&(y=String(f),(f>BigInt(2)**BigInt(32)||f<-(BigInt(2)**BigInt(32)))&&(y=Mr(y)),y+="n"),g+=` It must be ${u}. Received ${y}`,g},RangeError);const te=/[^+/0-9A-Za-z-_]/g;function Me(i,u){let f;u=u||1/0;const g=i.length;let y=null;const o=[];for(let l=0;l<g;++l){if(f=i.charCodeAt(l),f>55295&&f<57344){if(!y){if(f>56319){(u-=3)>-1&&o.push(239,191,189);continue}if(l+1===g){(u-=3)>-1&&o.push(239,191,189);continue}y=f;continue}if(f<56320){(u-=3)>-1&&o.push(239,191,189),y=f;continue}f=65536+(y-55296<<10|f-56320)}else y&&(u-=3)>-1&&o.push(239,191,189);if(y=null,f<128){if((u-=1)<0)break;o.push(f)}else if(f<2048){if((u-=2)<0)break;o.push(f>>6|192,63&f|128)}else if(f<65536){if((u-=3)<0)break;o.push(f>>12|224,f>>6&63|128,63&f|128)}else{if(!(f<1114112))throw new Error("Invalid code point");if((u-=4)<0)break;o.push(f>>18|240,f>>12&63|128,f>>6&63|128,63&f|128)}}return o}function Tt(i){return h.toByteArray(function(u){if((u=(u=u.split("=")[0]).trim().replace(te,"")).length<2)return"";for(;u.length%4!=0;)u+="=";return u}(i))}function Oe(i,u,f,g){let y;for(y=0;y<g&&!(y+f>=u.length||y>=i.length);++y)u[y+f]=i[y];return y}function le(i,u){return i instanceof u||i!=null&&i.constructor!=null&&i.constructor.name!=null&&i.constructor.name===u.name}function gr(i){return i!=i}const Qn=function(){const i="0123456789abcdef",u=new Array(256);for(let f=0;f<16;++f){const g=16*f;for(let y=0;y<16;++y)u[g+y]=i[f]+i[y]}return u}();function pe(i){return typeof BigInt>"u"?Je:i}function Je(){throw new Error("BigInt not supported")}},645:(s,c)=>{c.read=function(p,h,v,_,w){var b,d,E=8*w-_-1,x=(1<<E)-1,I=x>>1,S=-7,T=v?w-1:0,P=v?-1:1,B=p[h+T];for(T+=P,b=B&(1<<-S)-1,B>>=-S,S+=E;S>0;b=256*b+p[h+T],T+=P,S-=8);for(d=b&(1<<-S)-1,b>>=-S,S+=_;S>0;d=256*d+p[h+T],T+=P,S-=8);if(b===0)b=1-I;else{if(b===x)return d?NaN:1/0*(B?-1:1);d+=Math.pow(2,_),b-=I}return(B?-1:1)*d*Math.pow(2,b-_)},c.write=function(p,h,v,_,w,b){var d,E,x,I=8*b-w-1,S=(1<<I)-1,T=S>>1,P=w===23?Math.pow(2,-24)-Math.pow(2,-77):0,B=_?0:b-1,D=_?1:-1,j=h<0||h===0&&1/h<0?1:0;for(h=Math.abs(h),isNaN(h)||h===1/0?(E=isNaN(h)?1:0,d=S):(d=Math.floor(Math.log(h)/Math.LN2),h*(x=Math.pow(2,-d))<1&&(d--,x*=2),(h+=d+T>=1?P/x:P*Math.pow(2,1-T))*x>=2&&(d++,x/=2),d+T>=S?(E=0,d=S):d+T>=1?(E=(h*x-1)*Math.pow(2,w),d+=T):(E=h*Math.pow(2,T-1)*Math.pow(2,w),d=0));w>=8;p[v+B]=255&E,B+=D,E/=256,w-=8);for(d=d<<w|E,I+=w;I>0;p[v+B]=255&d,B+=D,d/=256,I-=8);p[v+B-D]|=128*j}}},n={};function a(s){var c=n[s];if(c!==void 0)return c.exports;var p=n[s]={exports:{}};return t[s](p,p.exports,a),p.exports}return a.d=(s,c)=>{for(var p in c)a.o(c,p)&&!a.o(s,p)&&Object.defineProperty(s,p,{enumerable:!0,get:c[p]})},a.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),a.o=(s,c)=>Object.prototype.hasOwnProperty.call(s,c),a.r=s=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},a(899)})())})(qa);function n1(e){const r={variantId:Ie.Uint64.fromString(e.variantId.toString()),version:e.version||Math.floor(Date.now()/1e3),items:e.items.map(n=>new Ie.BundleItem({collectionId:Ie.Uint64.fromString(n.collectionId.toString()),productId:Ie.Uint64.fromString(n.productId.toString()),variantId:Ie.Uint64.fromString(n.variantId.toString()),sku:n.sku||"",quantity:n.quantity,ext:new Ie.BundleItemExt(0)})),ext:new Ie.BundleExt(0)},t=new Ie.Bundle(r);return Ie.BundleEnvelope.envelopeTypeBundle(t).toXDR("base64")}const Ie=qa.exports.config(e=>{e.enum("EnvelopeType",{envelopeTypeBundle:0}),e.typedef("Uint32",e.uint()),e.typedef("Uint64",e.uhyper()),e.union("BundleItemExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("BundleItem",[["collectionId",e.lookup("Uint64")],["productId",e.lookup("Uint64")],["variantId",e.lookup("Uint64")],["sku",e.string()],["quantity",e.lookup("Uint32")],["ext",e.lookup("BundleItemExt")]]),e.union("BundleExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("Bundle",[["variantId",e.lookup("Uint64")],["items",e.varArray(e.lookup("BundleItem"),500)],["version",e.lookup("Uint32")],["ext",e.lookup("BundleExt")]]),e.union("BundleEnvelope",{switchOn:e.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeBundle","v1"]],arms:{v1:e.lookup("Bundle")}})}),za="/bundling-storefront-manager";function i1(){return Math.ceil(Date.now()/1e3)}async function o1(){try{const{timestamp:e}=await Or("get",`${za}/t`,{headers:{"X-Recharge-App":"storefront-client"}});return e}catch(e){return console.error(`Fetch failed: ${e}. Using client-side date.`),i1()}}async function a1(e){const r=xe(),t=await Va(e);if(t!==!0)throw new Error(t);const n=await o1(),a=n1({variantId:e.externalVariantId,version:n,items:e.selections.map(s=>({collectionId:s.collectionId,productId:s.externalProductId,variantId:s.externalVariantId,quantity:s.quantity,sku:""}))});try{const s=await Or("post",`${za}/api/v1/bundles`,{data:{bundle:a},headers:{Origin:`https://${r.storeIdentifier}`}});if(!s.id||s.code!==200)throw new Error(`1: failed generating rb_id: ${JSON.stringify(s)}`);return s.id}catch(s){throw new Error(`2: failed generating rb_id ${s}`)}}function s1(e,r){const t=Ha(e);if(t!==!0)throw new Error(`Dynamic Bundle is invalid. ${t}`);const n=`${vl(9)}:${e.externalProductId}`;return e.selections.map(a=>{const s={id:a.externalVariantId,quantity:a.quantity,properties:{_rc_bundle:n,_rc_bundle_variant:e.externalVariantId,_rc_bundle_parent:r,_rc_bundle_collection_id:a.collectionId}};return a.sellingPlan?s.selling_plan=a.sellingPlan:a.shippingIntervalFrequency&&(s.properties.shipping_interval_frequency=a.shippingIntervalFrequency,s.properties.shipping_interval_unit_type=a.shippingIntervalUnitType,s.id=`${a.discountedVariantId}`),s})}async function Va(e){try{return e?await Ga(e.externalProductId)?!0:"Bundle settings do not exist for the given product":"Bundle is not defined"}catch(r){return`Error fetching bundle settings: ${r}`}}const u1={day:["day","days","Days"],days:["day","days","Days"],Days:["day","days","Days"],week:["week","weeks","Weeks"],weeks:["week","weeks","Weeks"],Weeks:["week","weeks","Weeks"],month:["month","months","Months"],months:["month","months","Months"],Months:["month","months","Months"]};function Ha(e){if(!e)return"No bundle defined.";if(e.selections.length===0)return"No selections defined.";const{shippingIntervalFrequency:r,shippingIntervalUnitType:t}=e.selections.find(n=>n.shippingIntervalFrequency||n.shippingIntervalUnitType)||{};if(r||t){if(!r||!t)return"Shipping intervals do not match on selections.";{const n=u1[t];for(let a=0;a<e.selections.length;a++){const{shippingIntervalFrequency:s,shippingIntervalUnitType:c}=e.selections[a];if(s&&s!==r||c&&!n.includes(c))return"Shipping intervals do not match on selections."}}}return!0}async function c1(e,r){const{bundle_selection:t}=await O("get","/bundle_selections",{id:r},e);return t}function f1(e,r){return O("get","/bundle_selections",{query:r},e)}async function l1(e,r){const{bundle_selection:t}=await O("post","/bundle_selections",{data:r},e);return t}async function p1(e,r,t){const{bundle_selection:n}=await O("put","/bundle_selections",{id:r,data:t},e);return n}function h1(e,r){return O("delete","/bundle_selections",{id:r},e)}var d1=Object.freeze({__proto__:null,getBundleId:a1,getDynamicBundleItems:s1,validateBundle:Va,validateDynamicBundle:Ha,getBundleSelection:c1,listBundleSelections:f1,createBundleSelection:l1,updateBundleSelection:p1,deleteBundleSelection:h1});async function y1(e,r,t){const{charge:n}=await O("get","/charges",{id:r,query:{include:t?.include}},e);return n}function g1(e,r){return O("get","/charges",{query:r},e)}async function v1(e,r,t){const{charge:n}=await O("post",`/charges/${r}/apply_discount`,{data:{discount_code:t}},e);return n}async function m1(e,r){const{charge:t}=await O("post",`/charges/${r}/remove_discount`,{},e);return t}async function _1(e,r,t){const{charge:n}=await O("post",`/charges/${r}/skip`,{data:{purchase_item_ids:t.map(a=>Number(a))}},e);return n}async function w1(e,r,t){const{charge:n}=await O("post",`/charges/${r}/unskip`,{data:{purchase_item_ids:t.map(a=>Number(a))}},e);return n}async function b1(e,r){const{charge:t}=await O("post",`/charges/${r}/process`,{},e);return t}var $1=Object.freeze({__proto__:null,getCharge:y1,listCharges:g1,applyDiscountToCharge:v1,removeDiscountsFromCharge:m1,skipCharge:_1,unskipCharge:w1,processCharge:b1});async function A1(e,r){const{membership:t}=await O("get","/memberships",{id:r},e);return t}function E1(e,r){return O("get","/memberships",{query:r},e)}async function S1(e,r,t){const{membership:n}=await O("post",`/memberships/${r}/cancel`,{data:t},e);return n}async function x1(e,r,t){const{membership:n}=await O("post",`/memberships/${r}/activate`,{data:t},e);return n}async function I1(e,r,t){const{membership:n}=await O("post",`/memberships/${r}/change`,{data:t},e);return n}var T1=Object.freeze({__proto__:null,getMembership:A1,listMemberships:E1,cancelMembership:S1,activateMembership:x1,changeMembership:I1});async function O1(e,r,t){const{membership_program:n}=await O("get","/membership_programs",{id:r,query:{include:t?.include}},e);return n}function B1(e,r){return O("get","/membership_programs",{query:r},e)}var P1=Object.freeze({__proto__:null,getMembershipProgram:O1,listMembershipPrograms:B1});async function R1(e,r){const{metafield:t}=await O("post","/metafields",{data:{metafield:r}},e);return t}async function F1(e,r,t){const{metafield:n}=await O("put","/metafields",{id:r,data:{metafield:t}},e);return n}function C1(e,r){return O("delete","/metafields",{id:r},e)}var U1=Object.freeze({__proto__:null,createMetafield:R1,updateMetafield:F1,deleteMetafield:C1});async function D1(e,r){const{onetime:t}=await O("get","/onetimes",{id:r},e);return t}function N1(e,r){return O("get","/onetimes",{query:r},e)}async function M1(e,r){const{onetime:t}=await O("post","/onetimes",{data:r},e);return t}async function L1(e,r,t){const{onetime:n}=await O("put","/onetimes",{id:r,data:t},e);return n}function j1(e,r){return O("delete","/onetimes",{id:r},e)}var k1=Object.freeze({__proto__:null,getOnetime:D1,listOnetimes:N1,createOnetime:M1,updateOnetime:L1,deleteOnetime:j1});async function G1(e,r){const{order:t}=await O("get","/orders",{id:r},e);return t}function W1(e,r){return O("get","/orders",{query:r},e)}var q1=Object.freeze({__proto__:null,getOrder:G1,listOrders:W1});async function z1(e,r,t){const{payment_method:n}=await O("get","/payment_methods",{id:r,query:{include:t?.include}},e);return n}async function V1(e,r,t){const{payment_method:n}=await O("put","/payment_methods",{id:r,data:t},e);return n}function H1(e,r){return O("get","/payment_methods",{query:r},e)}var Y1=Object.freeze({__proto__:null,getPaymentMethod:z1,updatePaymentMethod:V1,listPaymentMethods:H1});async function K1(e,r){const{plan:t}=await O("get","/plans",{id:r},e);return t}function X1(e,r){return O("get","/plans",{query:r},e)}var J1=Object.freeze({__proto__:null,getPlan:K1,listPlans:X1}),Q1=jn,Z1=Ia,eb=kn;function rb(e,r){return eb(Z1(e,r,Q1),e+"")}var tb=rb,Ya=Jo,nb=Ya&&new Ya,Ka=nb,ib=jn,Xa=Ka,ob=Xa?function(e,r){return Xa.set(e,r),e}:ib,Ja=ob,ab=yt,sb=Ye;function ub(e){return function(){var r=arguments;switch(r.length){case 0:return new e;case 1:return new e(r[0]);case 2:return new e(r[0],r[1]);case 3:return new e(r[0],r[1],r[2]);case 4:return new e(r[0],r[1],r[2],r[3]);case 5:return new e(r[0],r[1],r[2],r[3],r[4]);case 6:return new e(r[0],r[1],r[2],r[3],r[4],r[5]);case 7:return new e(r[0],r[1],r[2],r[3],r[4],r[5],r[6])}var t=ab(e.prototype),n=e.apply(t,r);return sb(n)?n:t}}var wt=ub,cb=wt,fb=oe,lb=1;function pb(e,r,t){var n=r&lb,a=cb(e);function s(){var c=this&&this!==fb&&this instanceof s?a:e;return c.apply(n?t:this,arguments)}return s}var hb=pb,db=Math.max;function yb(e,r,t,n){for(var a=-1,s=e.length,c=t.length,p=-1,h=r.length,v=db(s-c,0),_=Array(h+v),w=!n;++p<h;)_[p]=r[p];for(;++a<c;)(w||a<s)&&(_[t[a]]=e[a]);for(;v--;)_[p++]=e[a++];return _}var Qa=yb,gb=Math.max;function vb(e,r,t,n){for(var a=-1,s=e.length,c=-1,p=t.length,h=-1,v=r.length,_=gb(s-p,0),w=Array(_+v),b=!n;++a<_;)w[a]=e[a];for(var d=a;++h<v;)w[d+h]=r[h];for(;++c<p;)(b||a<s)&&(w[d+t[c]]=e[a++]);return w}var Za=vb;function mb(e,r){for(var t=e.length,n=0;t--;)e[t]===r&&++n;return n}var _b=mb;function wb(){}var qn=wb,bb=yt,$b=qn,Ab=4294967295;function bt(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ab,this.__views__=[]}bt.prototype=bb($b.prototype),bt.prototype.constructor=bt;var zn=bt;function Eb(){}var Sb=Eb,es=Ka,xb=Sb,Ib=es?function(e){return es.get(e)}:xb,rs=Ib,Tb={},Ob=Tb,ts=Ob,Bb=Object.prototype,Pb=Bb.hasOwnProperty;function Rb(e){for(var r=e.name+"",t=ts[r],n=Pb.call(ts,r)?t.length:0;n--;){var a=t[n],s=a.func;if(s==null||s==e)return a.name}return r}var Fb=Rb,Cb=yt,Ub=qn;function $t(e,r){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!r,this.__index__=0,this.__values__=void 0}$t.prototype=Cb(Ub.prototype),$t.prototype.constructor=$t;var ns=$t,Db=zn,Nb=ns,Mb=xn;function Lb(e){if(e instanceof Db)return e.clone();var r=new Nb(e.__wrapped__,e.__chain__);return r.__actions__=Mb(e.__actions__),r.__index__=e.__index__,r.__values__=e.__values__,r}var jb=Lb,kb=zn,is=ns,Gb=qn,Wb=De,qb=Ue,zb=jb,Vb=Object.prototype,Hb=Vb.hasOwnProperty;function At(e){if(qb(e)&&!Wb(e)&&!(e instanceof kb)){if(e instanceof is)return e;if(Hb.call(e,"__wrapped__"))return zb(e)}return new is(e)}At.prototype=Gb.prototype,At.prototype.constructor=At;var Yb=At,Kb=zn,Xb=rs,Jb=Fb,Qb=Yb;function Zb(e){var r=Jb(e),t=Qb[r];if(typeof t!="function"||!(r in Kb.prototype))return!1;if(e===t)return!0;var n=Xb(t);return!!n&&e===n[0]}var e$=Zb,r$=Ja,t$=Oa,n$=t$(r$),os=n$,i$=/\{\n\/\* \[wrapped with (.+)\] \*/,o$=/,? & /;function a$(e){var r=e.match(i$);return r?r[1].split(o$):[]}var s$=a$,u$=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function c$(e,r){var t=r.length;if(!t)return e;var n=t-1;return r[n]=(t>1?"& ":"")+r[n],r=r.join(t>2?", ":" "),e.replace(u$,`{
|
|
20
|
+
`+r.prev}function it(e,r){var t=un(e),n=[];if(t){n.length=e.length;for(var a=0;a<e.length;a++)n[a]=Fe(e,a)?r(e[a],e):""}var s=typeof on=="function"?on(e):[],c;if(or){c={};for(var p=0;p<s.length;p++)c["$"+s[p]]=s[p]}for(var h in e)!Fe(e,h)||t&&String(Number(h))===h&&h<e.length||or&&c["$"+h]instanceof Symbol||(zi.call(/[^\w$]/,h)?n.push(r(h,e)+": "+r(e[h],e)):n.push(h+": "+r(e[h],e)));if(typeof on=="function")for(var v=0;v<s.length;v++)Yi.call(e,s[v])&&n.push("["+r(s[v])+"]: "+r(e[s[v]],e));return n}var ln=Nt,ar=gu,cf=Wc,ff=ln("%TypeError%"),ot=ln("%WeakMap%",!0),at=ln("%Map%",!0),lf=ar("WeakMap.prototype.get",!0),pf=ar("WeakMap.prototype.set",!0),hf=ar("WeakMap.prototype.has",!0),df=ar("Map.prototype.get",!0),yf=ar("Map.prototype.set",!0),gf=ar("Map.prototype.has",!0),pn=function(e,r){for(var t=e,n;(n=t.next)!==null;t=n)if(n.key===r)return t.next=n.next,n.next=e.next,e.next=n,n},vf=function(e,r){var t=pn(e,r);return t&&t.value},mf=function(e,r,t){var n=pn(e,r);n?n.value=t:e.next={key:r,next:e.next,value:t}},_f=function(e,r){return!!pn(e,r)},wf=function(){var r,t,n,a={assert:function(s){if(!a.has(s))throw new ff("Side channel does not contain "+cf(s))},get:function(s){if(ot&&s&&(typeof s=="object"||typeof s=="function")){if(r)return lf(r,s)}else if(at){if(t)return df(t,s)}else if(n)return vf(n,s)},has:function(s){if(ot&&s&&(typeof s=="object"||typeof s=="function")){if(r)return hf(r,s)}else if(at){if(t)return gf(t,s)}else if(n)return _f(n,s);return!1},set:function(s,c){ot&&s&&(typeof s=="object"||typeof s=="function")?(r||(r=new ot),pf(r,s,c)):at?(t||(t=new at),yf(t,s,c)):(n||(n={key:{},next:null}),mf(n,s,c))}};return a},bf=String.prototype.replace,$f=/%20/g,hn={RFC1738:"RFC1738",RFC3986:"RFC3986"},oo={default:hn.RFC3986,formatters:{RFC1738:function(e){return bf.call(e,$f,"+")},RFC3986:function(e){return String(e)}},RFC1738:hn.RFC1738,RFC3986:hn.RFC3986},Af=oo,dn=Object.prototype.hasOwnProperty,He=Array.isArray,we=function(){for(var e=[],r=0;r<256;++r)e.push("%"+((r<16?"0":"")+r.toString(16)).toUpperCase());return e}(),Ef=function(r){for(;r.length>1;){var t=r.pop(),n=t.obj[t.prop];if(He(n)){for(var a=[],s=0;s<n.length;++s)typeof n[s]<"u"&&a.push(n[s]);t.obj[t.prop]=a}}},ao=function(r,t){for(var n=t&&t.plainObjects?Object.create(null):{},a=0;a<r.length;++a)typeof r[a]<"u"&&(n[a]=r[a]);return n},Sf=function e(r,t,n){if(!t)return r;if(typeof t!="object"){if(He(r))r.push(t);else if(r&&typeof r=="object")(n&&(n.plainObjects||n.allowPrototypes)||!dn.call(Object.prototype,t))&&(r[t]=!0);else return[r,t];return r}if(!r||typeof r!="object")return[r].concat(t);var a=r;return He(r)&&!He(t)&&(a=ao(r,n)),He(r)&&He(t)?(t.forEach(function(s,c){if(dn.call(r,c)){var p=r[c];p&&typeof p=="object"&&s&&typeof s=="object"?r[c]=e(p,s,n):r.push(s)}else r[c]=s}),r):Object.keys(t).reduce(function(s,c){var p=t[c];return dn.call(s,c)?s[c]=e(s[c],p,n):s[c]=p,s},a)},xf=function(r,t){return Object.keys(t).reduce(function(n,a){return n[a]=t[a],n},r)},If=function(e,r,t){var n=e.replace(/\+/g," ");if(t==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},Tf=function(r,t,n,a,s){if(r.length===0)return r;var c=r;if(typeof r=="symbol"?c=Symbol.prototype.toString.call(r):typeof r!="string"&&(c=String(r)),n==="iso-8859-1")return escape(c).replace(/%u[0-9a-f]{4}/gi,function(_){return"%26%23"+parseInt(_.slice(2),16)+"%3B"});for(var p="",h=0;h<c.length;++h){var v=c.charCodeAt(h);if(v===45||v===46||v===95||v===126||v>=48&&v<=57||v>=65&&v<=90||v>=97&&v<=122||s===Af.RFC1738&&(v===40||v===41)){p+=c.charAt(h);continue}if(v<128){p=p+we[v];continue}if(v<2048){p=p+(we[192|v>>6]+we[128|v&63]);continue}if(v<55296||v>=57344){p=p+(we[224|v>>12]+we[128|v>>6&63]+we[128|v&63]);continue}h+=1,v=65536+((v&1023)<<10|c.charCodeAt(h)&1023),p+=we[240|v>>18]+we[128|v>>12&63]+we[128|v>>6&63]+we[128|v&63]}return p},Of=function(r){for(var t=[{obj:{o:r},prop:"o"}],n=[],a=0;a<t.length;++a)for(var s=t[a],c=s.obj[s.prop],p=Object.keys(c),h=0;h<p.length;++h){var v=p[h],_=c[v];typeof _=="object"&&_!==null&&n.indexOf(_)===-1&&(t.push({obj:c,prop:v}),n.push(_))}return Ef(t),r},Bf=function(r){return Object.prototype.toString.call(r)==="[object RegExp]"},Pf=function(r){return!r||typeof r!="object"?!1:!!(r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer(r))},Rf=function(r,t){return[].concat(r,t)},Ff=function(r,t){if(He(r)){for(var n=[],a=0;a<r.length;a+=1)n.push(t(r[a]));return n}return t(r)},Cf={arrayToObject:ao,assign:xf,combine:Rf,compact:Of,decode:If,encode:Tf,isBuffer:Pf,isRegExp:Bf,maybeMap:Ff,merge:Sf},so=wf,yn=Cf,Tr=oo,Uf=Object.prototype.hasOwnProperty,uo={brackets:function(r){return r+"[]"},comma:"comma",indices:function(r,t){return r+"["+t+"]"},repeat:function(r){return r}},Se=Array.isArray,Df=String.prototype.split,Nf=Array.prototype.push,co=function(e,r){Nf.apply(e,Se(r)?r:[r])},Mf=Date.prototype.toISOString,fo=Tr.default,J={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:yn.encode,encodeValuesOnly:!1,format:fo,formatter:Tr.formatters[fo],indices:!1,serializeDate:function(r){return Mf.call(r)},skipNulls:!1,strictNullHandling:!1},Lf=function(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"||typeof r=="symbol"||typeof r=="bigint"},gn={},jf=function e(r,t,n,a,s,c,p,h,v,_,w,b,d,E,x,I){for(var S=r,T=I,P=0,B=!1;(T=T.get(gn))!==void 0&&!B;){var D=T.get(r);if(P+=1,typeof D<"u"){if(D===P)throw new RangeError("Cyclic object value");B=!0}typeof T.get(gn)>"u"&&(P=0)}if(typeof h=="function"?S=h(t,S):S instanceof Date?S=w(S):n==="comma"&&Se(S)&&(S=yn.maybeMap(S,function(Ne){return Ne instanceof Date?w(Ne):Ne})),S===null){if(s)return p&&!E?p(t,J.encoder,x,"key",b):t;S=""}if(Lf(S)||yn.isBuffer(S)){if(p){var j=E?t:p(t,J.encoder,x,"key",b);if(n==="comma"&&E){for(var q=Df.call(String(S),","),z="",X=0;X<q.length;++X)z+=(X===0?"":",")+d(p(q[X],J.encoder,x,"value",b));return[d(j)+(a&&Se(S)&&q.length===1?"[]":"")+"="+z]}return[d(j)+"="+d(p(S,J.encoder,x,"value",b))]}return[d(t)+"="+d(String(S))]}var V=[];if(typeof S>"u")return V;var ae;if(n==="comma"&&Se(S))ae=[{value:S.length>0?S.join(",")||null:void 0}];else if(Se(h))ae=h;else{var ue=Object.keys(S);ae=v?ue.sort(v):ue}for(var k=a&&Se(S)&&S.length===1?t+"[]":t,re=0;re<ae.length;++re){var N=ae[re],ce=typeof N=="object"&&typeof N.value<"u"?N.value:S[N];if(!(c&&ce===null)){var hr=Se(S)?typeof n=="function"?n(k,N):k:k+(_?"."+N:"["+N+"]");I.set(r,P);var se=so();se.set(gn,I),co(V,e(ce,hr,n,a,s,c,p,h,v,_,w,b,d,E,x,se))}}return V},kf=function(r){if(!r)return J;if(r.encoder!==null&&typeof r.encoder<"u"&&typeof r.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=r.charset||J.charset;if(typeof r.charset<"u"&&r.charset!=="utf-8"&&r.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=Tr.default;if(typeof r.format<"u"){if(!Uf.call(Tr.formatters,r.format))throw new TypeError("Unknown format option provided.");n=r.format}var a=Tr.formatters[n],s=J.filter;return(typeof r.filter=="function"||Se(r.filter))&&(s=r.filter),{addQueryPrefix:typeof r.addQueryPrefix=="boolean"?r.addQueryPrefix:J.addQueryPrefix,allowDots:typeof r.allowDots>"u"?J.allowDots:!!r.allowDots,charset:t,charsetSentinel:typeof r.charsetSentinel=="boolean"?r.charsetSentinel:J.charsetSentinel,delimiter:typeof r.delimiter>"u"?J.delimiter:r.delimiter,encode:typeof r.encode=="boolean"?r.encode:J.encode,encoder:typeof r.encoder=="function"?r.encoder:J.encoder,encodeValuesOnly:typeof r.encodeValuesOnly=="boolean"?r.encodeValuesOnly:J.encodeValuesOnly,filter:s,format:n,formatter:a,serializeDate:typeof r.serializeDate=="function"?r.serializeDate:J.serializeDate,skipNulls:typeof r.skipNulls=="boolean"?r.skipNulls:J.skipNulls,sort:typeof r.sort=="function"?r.sort:null,strictNullHandling:typeof r.strictNullHandling=="boolean"?r.strictNullHandling:J.strictNullHandling}},Gf=function(e,r){var t=e,n=kf(r),a,s;typeof n.filter=="function"?(s=n.filter,t=s("",t)):Se(n.filter)&&(s=n.filter,a=s);var c=[];if(typeof t!="object"||t===null)return"";var p;r&&r.arrayFormat in uo?p=r.arrayFormat:r&&"indices"in r?p=r.indices?"indices":"repeat":p="indices";var h=uo[p];if(r&&"commaRoundTrip"in r&&typeof r.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var v=h==="comma"&&r&&r.commaRoundTrip;a||(a=Object.keys(t)),n.sort&&a.sort(n.sort);for(var _=so(),w=0;w<a.length;++w){var b=a[w];n.skipNulls&&t[b]===null||co(c,jf(t[b],b,h,v,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,_))}var d=c.join(n.delimiter),E=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?E+="utf8=%26%2310003%3B&":E+="utf8=%E2%9C%93&"),d.length>0?E+d:""};let lo={storeIdentifier:"",environment:"prod"};function Wf(e){lo=e}function xe(){return lo}const qf=e=>e==="stage"?"https://api.stage.rechargeapps.com":"https://api.rechargeapps.com",vn=e=>e==="stage"?"https://admin.stage.rechargeapps.com":"https://admin.rechargeapps.com",zf=e=>e==="stage"?"https://static.stage.rechargecdn.com":"https://static.rechargecdn.com",Vf="/tools/recurring";class st{constructor(r,t){this.name="RechargeRequestError",this.message=r,this.status=t}}var Hf=Object.defineProperty,Yf=Object.defineProperties,Kf=Object.getOwnPropertyDescriptors,po=Object.getOwnPropertySymbols,Xf=Object.prototype.hasOwnProperty,Jf=Object.prototype.propertyIsEnumerable,ho=(e,r,t)=>r in e?Hf(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,ut=(e,r)=>{for(var t in r||(r={}))Xf.call(r,t)&&ho(e,t,r[t]);if(po)for(var t of po(r))Jf.call(r,t)&&ho(e,t,r[t]);return e},Qf=(e,r)=>Yf(e,Kf(r));function Zf(e){return Gf(e,{encode:!1,indices:!1,arrayFormat:"comma"})}async function ct(e,r,t={}){const n=xe();return he(e,`${zf(n.environment)}/store/${n.storeIdentifier}${r}`,t)}async function O(e,r,{id:t,query:n,data:a,headers:s}={},c){const{environment:p,storeIdentifier:h,loginRetryFn:v}=xe(),_=c.apiToken,w=qf(p),b=ut({"X-Recharge-Access-Token":_,"X-Recharge-Version":"2021-11"},s||{}),d=ut({shop_url:h},n);try{return await he(e,`${w}${r}`,{id:t,query:d,data:a,headers:b})}catch(E){if(v&&E instanceof st&&E.status===401)return v().then(x=>{if(x)return he(e,`${w}${r}`,{id:t,query:d,data:a,headers:Qf(ut({},b),{"X-Recharge-Access-Token":x.apiToken})});throw E});throw E}}async function Or(e,r,t={}){return he(e,`${Vf}${r}`,t)}async function he(e,r,{id:t,query:n,data:a,headers:s}={}){let c=r.trim();if(t&&(c=[c,`${t}`.trim()].join("/")),n){let w;[c,w]=c.split("?");const b=[w,Zf(n)].join("&").replace(/^&/,"");c=`${c}${b?`?${b}`:""}`}let p;a&&e!=="get"&&(p=JSON.stringify(a));const h=ut({Accept:"application/json","Content-Type":"application/json","X-Recharge-App":"storefront-client"},s||{}),v=await fetch(c,{method:e,headers:h,body:p});let _;try{_=await v.json()}catch{}if(!v.ok)throw _&&_.error?new st(_.error,v.status):_&&_.errors?new st(JSON.stringify(_.errors),v.status):new st("A connection error occurred while making the request");return _}var el=Object.defineProperty,yo=Object.getOwnPropertySymbols,rl=Object.prototype.hasOwnProperty,tl=Object.prototype.propertyIsEnumerable,go=(e,r,t)=>r in e?el(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,nl=(e,r)=>{for(var t in r||(r={}))rl.call(r,t)&&go(e,t,r[t]);if(yo)for(var t of yo(r))tl.call(r,t)&&go(e,t,r[t]);return e};function il(e,r){return O("get","/addresses",{query:r},e)}async function ol(e,r,t){const{address:n}=await O("get","/addresses",{id:r,query:{include:t?.include}},e);return n}async function al(e,r){const{address:t}=await O("post","/addresses",{data:nl({customer_id:e.customerId?Number(e.customerId):void 0},r)},e);return t}async function mn(e,r,t){const{address:n}=await O("put","/addresses",{id:r,data:t},e);return n}async function sl(e,r,t){return mn(e,r,{discounts:[{code:t}]})}async function ul(e,r){return mn(e,r,{discounts:[]})}function cl(e,r){return O("delete","/addresses",{id:r},e)}async function fl(e,r){const{address:t}=await O("post","/addresses/merge",{data:r},e);return t}async function ll(e,r,t){const{charge:n}=await O("post",`/addresses/${r}/charges/skip`,{data:t},e);return n}var pl=Object.freeze({__proto__:null,listAddresses:il,getAddress:ol,createAddress:al,updateAddress:mn,applyDiscountToAddress:sl,removeDiscountsFromAddress:ul,deleteAddress:cl,mergeAddresses:fl,skipFutureCharge:ll}),hl=Object.defineProperty,vo=Object.getOwnPropertySymbols,dl=Object.prototype.hasOwnProperty,yl=Object.prototype.propertyIsEnumerable,mo=(e,r,t)=>r in e?hl(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,_o=(e,r)=>{for(var t in r||(r={}))dl.call(r,t)&&mo(e,t,r[t]);if(vo)for(var t of vo(r))yl.call(r,t)&&mo(e,t,r[t]);return e};async function gl(){const{storefrontAccessToken:e}=xe(),r={};e&&(r["X-Recharge-Storefront-Access-Token"]=e);const t=await Or("get","/access",{headers:r});return{apiToken:t.api_token,customerId:t.customer_id}}async function vl(e,r){const{environment:t,storefrontAccessToken:n,storeIdentifier:a}=xe(),s=vn(t),c={};n&&(c["X-Recharge-Storefront-Access-Token"]=n);const p=await he("post",`${s}/shopify_storefront_access`,{data:{customer_token:r,storefront_token:e,shop_url:a},headers:c});return p.api_token?{apiToken:p.api_token,customerId:p.customer_id}:null}async function ml(e,r={}){const{environment:t,storefrontAccessToken:n,storeIdentifier:a}=xe(),s=vn(t),c={};n&&(c["X-Recharge-Storefront-Access-Token"]=n);const p=await he("post",`${s}/attempt_login`,{data:_o({email:e,shop:a},r),headers:c});if(p.errors)throw new Error(p.errors);return p.session_token}async function _l(e,r={}){const{storefrontAccessToken:t,storeIdentifier:n}=xe(),a={};t&&(a["X-Recharge-Storefront-Access-Token"]=t);const s=await Or("post","/attempt_login",{data:_o({email:e,shop:n},r),headers:a});if(s.errors)throw new Error(s.errors);return s.session_token}async function wl(e,r,t){const{environment:n,storefrontAccessToken:a,storeIdentifier:s}=xe(),c=vn(n),p={};a&&(p["X-Recharge-Storefront-Access-Token"]=a);const h=await he("post",`${c}/validate_login`,{data:{code:t,email:e,session_token:r,shop:s},headers:p});if(h.errors)throw new Error(h.errors);return{apiToken:h.api_token,customerId:h.customer_id}}async function bl(e,r,t){const{storefrontAccessToken:n,storeIdentifier:a}=xe(),s={};n&&(s["X-Recharge-Storefront-Access-Token"]=n);const c=await Or("post","/validate_login",{data:{code:t,email:e,session_token:r,shop:a},headers:s});if(c.errors)throw new Error(c.errors);return{apiToken:c.api_token,customerId:c.customer_id}}var $l=Object.freeze({__proto__:null,loginShopifyAppProxy:gl,loginShopifyApi:vl,sendPasswordlessCode:ml,sendPasswordlessCodeAppProxy:_l,validatePasswordlessCode:wl,validatePasswordlessCodeAppProxy:bl});let Al=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((r,t)=>(t&=63,t<36?r+=t.toString(36):t<62?r+=(t-26).toString(36).toUpperCase():t>62?r+="-":r+="_",r),"");function El(e,r){for(var t=-1,n=e==null?0:e.length,a=Array(n);++t<n;)a[t]=r(e[t],t,e);return a}var wo=El;function Sl(){this.__data__=[],this.size=0}var xl=Sl;function Il(e,r){return e===r||e!==e&&r!==r}var bo=Il,Tl=bo;function Ol(e,r){for(var t=e.length;t--;)if(Tl(e[t][0],r))return t;return-1}var ft=Ol,Bl=ft,Pl=Array.prototype,Rl=Pl.splice;function Fl(e){var r=this.__data__,t=Bl(r,e);if(t<0)return!1;var n=r.length-1;return t==n?r.pop():Rl.call(r,t,1),--this.size,!0}var Cl=Fl,Ul=ft;function Dl(e){var r=this.__data__,t=Ul(r,e);return t<0?void 0:r[t][1]}var Nl=Dl,Ml=ft;function Ll(e){return Ml(this.__data__,e)>-1}var jl=Ll,kl=ft;function Gl(e,r){var t=this.__data__,n=kl(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this}var Wl=Gl,ql=xl,zl=Cl,Vl=Nl,Hl=jl,Yl=Wl;function sr(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}sr.prototype.clear=ql,sr.prototype.delete=zl,sr.prototype.get=Vl,sr.prototype.has=Hl,sr.prototype.set=Yl;var lt=sr,Kl=lt;function Xl(){this.__data__=new Kl,this.size=0}var Jl=Xl;function Ql(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}var Zl=Ql;function ep(e){return this.__data__.get(e)}var rp=ep;function tp(e){return this.__data__.has(e)}var np=tp,ip=typeof $e=="object"&&$e&&$e.Object===Object&&$e,$o=ip,op=$o,ap=typeof self=="object"&&self&&self.Object===Object&&self,sp=op||ap||Function("return this")(),oe=sp,up=oe,cp=up.Symbol,Br=cp,Ao=Br,Eo=Object.prototype,fp=Eo.hasOwnProperty,lp=Eo.toString,Pr=Ao?Ao.toStringTag:void 0;function pp(e){var r=fp.call(e,Pr),t=e[Pr];try{e[Pr]=void 0;var n=!0}catch{}var a=lp.call(e);return n&&(r?e[Pr]=t:delete e[Pr]),a}var hp=pp,dp=Object.prototype,yp=dp.toString;function gp(e){return yp.call(e)}var vp=gp,So=Br,mp=hp,_p=vp,wp="[object Null]",bp="[object Undefined]",xo=So?So.toStringTag:void 0;function $p(e){return e==null?e===void 0?bp:wp:xo&&xo in Object(e)?mp(e):_p(e)}var ur=$p;function Ap(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var Ye=Ap,Ep=ur,Sp=Ye,xp="[object AsyncFunction]",Ip="[object Function]",Tp="[object GeneratorFunction]",Op="[object Proxy]";function Bp(e){if(!Sp(e))return!1;var r=Ep(e);return r==Ip||r==Tp||r==xp||r==Op}var Io=Bp,Pp=oe,Rp=Pp["__core-js_shared__"],Fp=Rp,_n=Fp,To=function(){var e=/[^.]+$/.exec(_n&&_n.keys&&_n.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Cp(e){return!!To&&To in e}var Up=Cp,Dp=Function.prototype,Np=Dp.toString;function Mp(e){if(e!=null){try{return Np.call(e)}catch{}try{return e+""}catch{}}return""}var Oo=Mp,Lp=Io,jp=Up,kp=Ye,Gp=Oo,Wp=/[\\^$.*+?()[\]{}|]/g,qp=/^\[object .+?Constructor\]$/,zp=Function.prototype,Vp=Object.prototype,Hp=zp.toString,Yp=Vp.hasOwnProperty,Kp=RegExp("^"+Hp.call(Yp).replace(Wp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Xp(e){if(!kp(e)||jp(e))return!1;var r=Lp(e)?Kp:qp;return r.test(Gp(e))}var Jp=Xp;function Qp(e,r){return e?.[r]}var Zp=Qp,eh=Jp,rh=Zp;function th(e,r){var t=rh(e,r);return eh(t)?t:void 0}var Ke=th,nh=Ke,ih=oe,oh=nh(ih,"Map"),wn=oh,ah=Ke,sh=ah(Object,"create"),pt=sh,Bo=pt;function uh(){this.__data__=Bo?Bo(null):{},this.size=0}var ch=uh;function fh(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}var lh=fh,ph=pt,hh="__lodash_hash_undefined__",dh=Object.prototype,yh=dh.hasOwnProperty;function gh(e){var r=this.__data__;if(ph){var t=r[e];return t===hh?void 0:t}return yh.call(r,e)?r[e]:void 0}var vh=gh,mh=pt,_h=Object.prototype,wh=_h.hasOwnProperty;function bh(e){var r=this.__data__;return mh?r[e]!==void 0:wh.call(r,e)}var $h=bh,Ah=pt,Eh="__lodash_hash_undefined__";function Sh(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=Ah&&r===void 0?Eh:r,this}var xh=Sh,Ih=ch,Th=lh,Oh=vh,Bh=$h,Ph=xh;function cr(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}cr.prototype.clear=Ih,cr.prototype.delete=Th,cr.prototype.get=Oh,cr.prototype.has=Bh,cr.prototype.set=Ph;var Rh=cr,Po=Rh,Fh=lt,Ch=wn;function Uh(){this.size=0,this.__data__={hash:new Po,map:new(Ch||Fh),string:new Po}}var Dh=Uh;function Nh(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}var Mh=Nh,Lh=Mh;function jh(e,r){var t=e.__data__;return Lh(r)?t[typeof r=="string"?"string":"hash"]:t.map}var ht=jh,kh=ht;function Gh(e){var r=kh(this,e).delete(e);return this.size-=r?1:0,r}var Wh=Gh,qh=ht;function zh(e){return qh(this,e).get(e)}var Vh=zh,Hh=ht;function Yh(e){return Hh(this,e).has(e)}var Kh=Yh,Xh=ht;function Jh(e,r){var t=Xh(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this}var Qh=Jh,Zh=Dh,ed=Wh,rd=Vh,td=Kh,nd=Qh;function fr(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}fr.prototype.clear=Zh,fr.prototype.delete=ed,fr.prototype.get=rd,fr.prototype.has=td,fr.prototype.set=nd;var Ro=fr,id=lt,od=wn,ad=Ro,sd=200;function ud(e,r){var t=this.__data__;if(t instanceof id){var n=t.__data__;if(!od||n.length<sd-1)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new ad(n)}return t.set(e,r),this.size=t.size,this}var cd=ud,fd=lt,ld=Jl,pd=Zl,hd=rp,dd=np,yd=cd;function lr(e){var r=this.__data__=new fd(e);this.size=r.size}lr.prototype.clear=ld,lr.prototype.delete=pd,lr.prototype.get=hd,lr.prototype.has=dd,lr.prototype.set=yd;var gd=lr;function vd(e,r){for(var t=-1,n=e==null?0:e.length;++t<n&&r(e[t],t,e)!==!1;);return e}var Fo=vd,md=Ke,_d=function(){try{var e=md(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Co=_d,Uo=Co;function wd(e,r,t){r=="__proto__"&&Uo?Uo(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}var Do=wd,bd=Do,$d=bo,Ad=Object.prototype,Ed=Ad.hasOwnProperty;function Sd(e,r,t){var n=e[r];(!(Ed.call(e,r)&&$d(n,t))||t===void 0&&!(r in e))&&bd(e,r,t)}var No=Sd,xd=No,Id=Do;function Td(e,r,t,n){var a=!t;t||(t={});for(var s=-1,c=r.length;++s<c;){var p=r[s],h=n?n(t[p],e[p],p,t,e):void 0;h===void 0&&(h=e[p]),a?Id(t,p,h):xd(t,p,h)}return t}var Rr=Td;function Od(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n}var Bd=Od;function Pd(e){return e!=null&&typeof e=="object"}var Ue=Pd,Rd=ur,Fd=Ue,Cd="[object Arguments]";function Ud(e){return Fd(e)&&Rd(e)==Cd}var Dd=Ud,Mo=Dd,Nd=Ue,Lo=Object.prototype,Md=Lo.hasOwnProperty,Ld=Lo.propertyIsEnumerable,jd=Mo(function(){return arguments}())?Mo:function(e){return Nd(e)&&Md.call(e,"callee")&&!Ld.call(e,"callee")},jo=jd,kd=Array.isArray,De=kd,dt={exports:{}};function Gd(){return!1}var Wd=Gd;(function(e,r){var t=oe,n=Wd,a=r&&!r.nodeType&&r,s=a&&!0&&e&&!e.nodeType&&e,c=s&&s.exports===a,p=c?t.Buffer:void 0,h=p?p.isBuffer:void 0,v=h||n;e.exports=v})(dt,dt.exports);var qd=9007199254740991,zd=/^(?:0|[1-9]\d*)$/;function Vd(e,r){var t=typeof e;return r=r??qd,!!r&&(t=="number"||t!="symbol"&&zd.test(e))&&e>-1&&e%1==0&&e<r}var ko=Vd,Hd=9007199254740991;function Yd(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Hd}var Go=Yd,Kd=ur,Xd=Go,Jd=Ue,Qd="[object Arguments]",Zd="[object Array]",ey="[object Boolean]",ry="[object Date]",ty="[object Error]",ny="[object Function]",iy="[object Map]",oy="[object Number]",ay="[object Object]",sy="[object RegExp]",uy="[object Set]",cy="[object String]",fy="[object WeakMap]",ly="[object ArrayBuffer]",py="[object DataView]",hy="[object Float32Array]",dy="[object Float64Array]",yy="[object Int8Array]",gy="[object Int16Array]",vy="[object Int32Array]",my="[object Uint8Array]",_y="[object Uint8ClampedArray]",wy="[object Uint16Array]",by="[object Uint32Array]",L={};L[hy]=L[dy]=L[yy]=L[gy]=L[vy]=L[my]=L[_y]=L[wy]=L[by]=!0,L[Qd]=L[Zd]=L[ly]=L[ey]=L[py]=L[ry]=L[ty]=L[ny]=L[iy]=L[oy]=L[ay]=L[sy]=L[uy]=L[cy]=L[fy]=!1;function $y(e){return Jd(e)&&Xd(e.length)&&!!L[Kd(e)]}var Ay=$y;function Ey(e){return function(r){return e(r)}}var bn=Ey,Fr={exports:{}};(function(e,r){var t=$o,n=r&&!r.nodeType&&r,a=n&&!0&&e&&!e.nodeType&&e,s=a&&a.exports===n,c=s&&t.process,p=function(){try{var h=a&&a.require&&a.require("util").types;return h||c&&c.binding&&c.binding("util")}catch{}}();e.exports=p})(Fr,Fr.exports);var Sy=Ay,xy=bn,Wo=Fr.exports,qo=Wo&&Wo.isTypedArray,Iy=qo?xy(qo):Sy,Ty=Iy,Oy=Bd,By=jo,Py=De,Ry=dt.exports,Fy=ko,Cy=Ty,Uy=Object.prototype,Dy=Uy.hasOwnProperty;function Ny(e,r){var t=Py(e),n=!t&&By(e),a=!t&&!n&&Ry(e),s=!t&&!n&&!a&&Cy(e),c=t||n||a||s,p=c?Oy(e.length,String):[],h=p.length;for(var v in e)(r||Dy.call(e,v))&&!(c&&(v=="length"||a&&(v=="offset"||v=="parent")||s&&(v=="buffer"||v=="byteLength"||v=="byteOffset")||Fy(v,h)))&&p.push(v);return p}var zo=Ny,My=Object.prototype;function Ly(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||My;return e===t}var $n=Ly;function jy(e,r){return function(t){return e(r(t))}}var Vo=jy,ky=Vo,Gy=ky(Object.keys,Object),Wy=Gy,qy=$n,zy=Wy,Vy=Object.prototype,Hy=Vy.hasOwnProperty;function Yy(e){if(!qy(e))return zy(e);var r=[];for(var t in Object(e))Hy.call(e,t)&&t!="constructor"&&r.push(t);return r}var Ky=Yy,Xy=Io,Jy=Go;function Qy(e){return e!=null&&Jy(e.length)&&!Xy(e)}var Ho=Qy,Zy=zo,eg=Ky,rg=Ho;function tg(e){return rg(e)?Zy(e):eg(e)}var An=tg,ng=Rr,ig=An;function og(e,r){return e&&ng(r,ig(r),e)}var ag=og;function sg(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}var ug=sg,cg=Ye,fg=$n,lg=ug,pg=Object.prototype,hg=pg.hasOwnProperty;function dg(e){if(!cg(e))return lg(e);var r=fg(e),t=[];for(var n in e)n=="constructor"&&(r||!hg.call(e,n))||t.push(n);return t}var yg=dg,gg=zo,vg=yg,mg=Ho;function _g(e){return mg(e)?gg(e,!0):vg(e)}var En=_g,wg=Rr,bg=En;function $g(e,r){return e&&wg(r,bg(r),e)}var Ag=$g,Sn={exports:{}};(function(e,r){var t=oe,n=r&&!r.nodeType&&r,a=n&&!0&&e&&!e.nodeType&&e,s=a&&a.exports===n,c=s?t.Buffer:void 0,p=c?c.allocUnsafe:void 0;function h(v,_){if(_)return v.slice();var w=v.length,b=p?p(w):new v.constructor(w);return v.copy(b),b}e.exports=h})(Sn,Sn.exports);function Eg(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r}var xn=Eg;function Sg(e,r){for(var t=-1,n=e==null?0:e.length,a=0,s=[];++t<n;){var c=e[t];r(c,t,e)&&(s[a++]=c)}return s}var xg=Sg;function Ig(){return[]}var Yo=Ig,Tg=xg,Og=Yo,Bg=Object.prototype,Pg=Bg.propertyIsEnumerable,Ko=Object.getOwnPropertySymbols,Rg=Ko?function(e){return e==null?[]:(e=Object(e),Tg(Ko(e),function(r){return Pg.call(e,r)}))}:Og,In=Rg,Fg=Rr,Cg=In;function Ug(e,r){return Fg(e,Cg(e),r)}var Dg=Ug;function Ng(e,r){for(var t=-1,n=r.length,a=e.length;++t<n;)e[a+t]=r[t];return e}var Tn=Ng,Mg=Vo,Lg=Mg(Object.getPrototypeOf,Object),On=Lg,jg=Tn,kg=On,Gg=In,Wg=Yo,qg=Object.getOwnPropertySymbols,zg=qg?function(e){for(var r=[];e;)jg(r,Gg(e)),e=kg(e);return r}:Wg,Xo=zg,Vg=Rr,Hg=Xo;function Yg(e,r){return Vg(e,Hg(e),r)}var Kg=Yg,Xg=Tn,Jg=De;function Qg(e,r,t){var n=r(e);return Jg(e)?n:Xg(n,t(e))}var Jo=Qg,Zg=Jo,ev=In,rv=An;function tv(e){return Zg(e,rv,ev)}var nv=tv,iv=Jo,ov=Xo,av=En;function sv(e){return iv(e,av,ov)}var Qo=sv,uv=Ke,cv=oe,fv=uv(cv,"DataView"),lv=fv,pv=Ke,hv=oe,dv=pv(hv,"Promise"),yv=dv,gv=Ke,vv=oe,mv=gv(vv,"Set"),_v=mv,wv=Ke,bv=oe,$v=wv(bv,"WeakMap"),Zo=$v,Bn=lv,Pn=wn,Rn=yv,Fn=_v,Cn=Zo,ea=ur,pr=Oo,ra="[object Map]",Av="[object Object]",ta="[object Promise]",na="[object Set]",ia="[object WeakMap]",oa="[object DataView]",Ev=pr(Bn),Sv=pr(Pn),xv=pr(Rn),Iv=pr(Fn),Tv=pr(Cn),Xe=ea;(Bn&&Xe(new Bn(new ArrayBuffer(1)))!=oa||Pn&&Xe(new Pn)!=ra||Rn&&Xe(Rn.resolve())!=ta||Fn&&Xe(new Fn)!=na||Cn&&Xe(new Cn)!=ia)&&(Xe=function(e){var r=ea(e),t=r==Av?e.constructor:void 0,n=t?pr(t):"";if(n)switch(n){case Ev:return oa;case Sv:return ra;case xv:return ta;case Iv:return na;case Tv:return ia}return r});var Un=Xe,Ov=Object.prototype,Bv=Ov.hasOwnProperty;function Pv(e){var r=e.length,t=new e.constructor(r);return r&&typeof e[0]=="string"&&Bv.call(e,"index")&&(t.index=e.index,t.input=e.input),t}var Rv=Pv,Fv=oe,Cv=Fv.Uint8Array,Uv=Cv,aa=Uv;function Dv(e){var r=new e.constructor(e.byteLength);return new aa(r).set(new aa(e)),r}var Dn=Dv,Nv=Dn;function Mv(e,r){var t=r?Nv(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}var Lv=Mv,jv=/\w*$/;function kv(e){var r=new e.constructor(e.source,jv.exec(e));return r.lastIndex=e.lastIndex,r}var Gv=kv,sa=Br,ua=sa?sa.prototype:void 0,ca=ua?ua.valueOf:void 0;function Wv(e){return ca?Object(ca.call(e)):{}}var qv=Wv,zv=Dn;function Vv(e,r){var t=r?zv(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}var Hv=Vv,Yv=Dn,Kv=Lv,Xv=Gv,Jv=qv,Qv=Hv,Zv="[object Boolean]",e0="[object Date]",r0="[object Map]",t0="[object Number]",n0="[object RegExp]",i0="[object Set]",o0="[object String]",a0="[object Symbol]",s0="[object ArrayBuffer]",u0="[object DataView]",c0="[object Float32Array]",f0="[object Float64Array]",l0="[object Int8Array]",p0="[object Int16Array]",h0="[object Int32Array]",d0="[object Uint8Array]",y0="[object Uint8ClampedArray]",g0="[object Uint16Array]",v0="[object Uint32Array]";function m0(e,r,t){var n=e.constructor;switch(r){case s0:return Yv(e);case Zv:case e0:return new n(+e);case u0:return Kv(e,t);case c0:case f0:case l0:case p0:case h0:case d0:case y0:case g0:case v0:return Qv(e,t);case r0:return new n;case t0:case o0:return new n(e);case n0:return Xv(e);case i0:return new n;case a0:return Jv(e)}}var _0=m0,w0=Ye,fa=Object.create,b0=function(){function e(){}return function(r){if(!w0(r))return{};if(fa)return fa(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}(),yt=b0,$0=yt,A0=On,E0=$n;function S0(e){return typeof e.constructor=="function"&&!E0(e)?$0(A0(e)):{}}var x0=S0,I0=Un,T0=Ue,O0="[object Map]";function B0(e){return T0(e)&&I0(e)==O0}var P0=B0,R0=P0,F0=bn,la=Fr.exports,pa=la&&la.isMap,C0=pa?F0(pa):R0,U0=C0,D0=Un,N0=Ue,M0="[object Set]";function L0(e){return N0(e)&&D0(e)==M0}var j0=L0,k0=j0,G0=bn,ha=Fr.exports,da=ha&&ha.isSet,W0=da?G0(da):k0,q0=W0,z0=gd,V0=Fo,H0=No,Y0=ag,K0=Ag,X0=Sn.exports,J0=xn,Q0=Dg,Z0=Kg,em=nv,rm=Qo,tm=Un,nm=Rv,im=_0,om=x0,am=De,sm=dt.exports,um=U0,cm=Ye,fm=q0,lm=An,pm=En,hm=1,dm=2,ym=4,ya="[object Arguments]",gm="[object Array]",vm="[object Boolean]",mm="[object Date]",_m="[object Error]",ga="[object Function]",wm="[object GeneratorFunction]",bm="[object Map]",$m="[object Number]",va="[object Object]",Am="[object RegExp]",Em="[object Set]",Sm="[object String]",xm="[object Symbol]",Im="[object WeakMap]",Tm="[object ArrayBuffer]",Om="[object DataView]",Bm="[object Float32Array]",Pm="[object Float64Array]",Rm="[object Int8Array]",Fm="[object Int16Array]",Cm="[object Int32Array]",Um="[object Uint8Array]",Dm="[object Uint8ClampedArray]",Nm="[object Uint16Array]",Mm="[object Uint32Array]",M={};M[ya]=M[gm]=M[Tm]=M[Om]=M[vm]=M[mm]=M[Bm]=M[Pm]=M[Rm]=M[Fm]=M[Cm]=M[bm]=M[$m]=M[va]=M[Am]=M[Em]=M[Sm]=M[xm]=M[Um]=M[Dm]=M[Nm]=M[Mm]=!0,M[_m]=M[ga]=M[Im]=!1;function gt(e,r,t,n,a,s){var c,p=r&hm,h=r&dm,v=r&ym;if(t&&(c=a?t(e,n,a,s):t(e)),c!==void 0)return c;if(!cm(e))return e;var _=am(e);if(_){if(c=nm(e),!p)return J0(e,c)}else{var w=tm(e),b=w==ga||w==wm;if(sm(e))return X0(e,p);if(w==va||w==ya||b&&!a){if(c=h||b?{}:om(e),!p)return h?Z0(e,K0(c,e)):Q0(e,Y0(c,e))}else{if(!M[w])return a?e:{};c=im(e,w,p)}}s||(s=new z0);var d=s.get(e);if(d)return d;s.set(e,c),fm(e)?e.forEach(function(I){c.add(gt(I,r,t,I,e,s))}):um(e)&&e.forEach(function(I,S){c.set(S,gt(I,r,t,S,e,s))});var E=v?h?rm:em:h?pm:lm,x=_?void 0:E(e);return V0(x||e,function(I,S){x&&(S=I,I=e[S]),H0(c,S,gt(I,r,t,S,e,s))}),c}var Lm=gt,jm=ur,km=Ue,Gm="[object Symbol]";function Wm(e){return typeof e=="symbol"||km(e)&&jm(e)==Gm}var vt=Wm,qm=De,zm=vt,Vm=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Hm=/^\w*$/;function Ym(e,r){if(qm(e))return!1;var t=typeof e;return t=="number"||t=="symbol"||t=="boolean"||e==null||zm(e)?!0:Hm.test(e)||!Vm.test(e)||r!=null&&e in Object(r)}var Km=Ym,ma=Ro,Xm="Expected a function";function Nn(e,r){if(typeof e!="function"||r!=null&&typeof r!="function")throw new TypeError(Xm);var t=function(){var n=arguments,a=r?r.apply(this,n):n[0],s=t.cache;if(s.has(a))return s.get(a);var c=e.apply(this,n);return t.cache=s.set(a,c)||s,c};return t.cache=new(Nn.Cache||ma),t}Nn.Cache=ma;var Jm=Nn,Qm=Jm,Zm=500;function e_(e){var r=Qm(e,function(n){return t.size===Zm&&t.clear(),n}),t=r.cache;return r}var r_=e_,t_=r_,n_=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i_=/\\(\\)?/g,o_=t_(function(e){var r=[];return e.charCodeAt(0)===46&&r.push(""),e.replace(n_,function(t,n,a,s){r.push(a?s.replace(i_,"$1"):n||t)}),r}),a_=o_,_a=Br,s_=wo,u_=De,c_=vt,f_=1/0,wa=_a?_a.prototype:void 0,ba=wa?wa.toString:void 0;function $a(e){if(typeof e=="string")return e;if(u_(e))return s_(e,$a)+"";if(c_(e))return ba?ba.call(e):"";var r=e+"";return r=="0"&&1/e==-f_?"-0":r}var l_=$a,p_=l_;function h_(e){return e==null?"":p_(e)}var d_=h_,y_=De,g_=Km,v_=a_,m_=d_;function __(e,r){return y_(e)?e:g_(e,r)?[e]:v_(m_(e))}var Mn=__;function w_(e){var r=e==null?0:e.length;return r?e[r-1]:void 0}var b_=w_,$_=vt,A_=1/0;function E_(e){if(typeof e=="string"||$_(e))return e;var r=e+"";return r=="0"&&1/e==-A_?"-0":r}var Aa=E_,S_=Mn,x_=Aa;function I_(e,r){r=S_(r,e);for(var t=0,n=r.length;e!=null&&t<n;)e=e[x_(r[t++])];return t&&t==n?e:void 0}var T_=I_;function O_(e,r,t){var n=-1,a=e.length;r<0&&(r=-r>a?0:a+r),t=t>a?a:t,t<0&&(t+=a),a=r>t?0:t-r>>>0,r>>>=0;for(var s=Array(a);++n<a;)s[n]=e[n+r];return s}var B_=O_,P_=T_,R_=B_;function F_(e,r){return r.length<2?e:P_(e,R_(r,0,-1))}var C_=F_,U_=Mn,D_=b_,N_=C_,M_=Aa;function L_(e,r){return r=U_(r,e),e=N_(e,r),e==null||delete e[M_(D_(r))]}var j_=L_,k_=ur,G_=On,W_=Ue,q_="[object Object]",z_=Function.prototype,V_=Object.prototype,Ea=z_.toString,H_=V_.hasOwnProperty,Y_=Ea.call(Object);function K_(e){if(!W_(e)||k_(e)!=q_)return!1;var r=G_(e);if(r===null)return!0;var t=H_.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t instanceof t&&Ea.call(t)==Y_}var X_=K_,J_=X_;function Q_(e){return J_(e)?void 0:e}var Z_=Q_,Sa=Br,ew=jo,rw=De,xa=Sa?Sa.isConcatSpreadable:void 0;function tw(e){return rw(e)||ew(e)||!!(xa&&e&&e[xa])}var nw=tw,iw=Tn,ow=nw;function Ia(e,r,t,n,a){var s=-1,c=e.length;for(t||(t=ow),a||(a=[]);++s<c;){var p=e[s];r>0&&t(p)?r>1?Ia(p,r-1,t,n,a):iw(a,p):n||(a[a.length]=p)}return a}var aw=Ia,sw=aw;function uw(e){var r=e==null?0:e.length;return r?sw(e,1):[]}var cw=uw;function fw(e,r,t){switch(t.length){case 0:return e.call(r);case 1:return e.call(r,t[0]);case 2:return e.call(r,t[0],t[1]);case 3:return e.call(r,t[0],t[1],t[2])}return e.apply(r,t)}var Ln=fw,lw=Ln,Ta=Math.max;function pw(e,r,t){return r=Ta(r===void 0?e.length-1:r,0),function(){for(var n=arguments,a=-1,s=Ta(n.length-r,0),c=Array(s);++a<s;)c[a]=n[r+a];a=-1;for(var p=Array(r+1);++a<r;)p[a]=n[a];return p[r]=t(c),lw(e,this,p)}}var Oa=pw;function hw(e){return function(){return e}}var dw=hw;function yw(e){return e}var jn=yw,gw=dw,Ba=Co,vw=jn,mw=Ba?function(e,r){return Ba(e,"toString",{configurable:!0,enumerable:!1,value:gw(r),writable:!0})}:vw,_w=mw,ww=800,bw=16,$w=Date.now;function Aw(e){var r=0,t=0;return function(){var n=$w(),a=bw-(n-t);if(t=n,a>0){if(++r>=ww)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}var Pa=Aw,Ew=_w,Sw=Pa,xw=Sw(Ew),kn=xw,Iw=cw,Tw=Oa,Ow=kn;function Bw(e){return Ow(Tw(e,void 0,Iw),e+"")}var Pw=Bw,Rw=wo,Fw=Lm,Cw=j_,Uw=Mn,Dw=Rr,Nw=Z_,Mw=Pw,Lw=Qo,jw=1,kw=2,Gw=4,Ww=Mw(function(e,r){var t={};if(e==null)return t;var n=!1;r=Rw(r,function(s){return s=Uw(s,e),n||(n=s.length>1),s}),Dw(e,Lw(e),t),n&&(t=Fw(t,jw|kw|Gw,Nw));for(var a=r.length;a--;)Cw(t,r[a]);return t}),Gn=Ww,qw=Object.defineProperty,zw=Object.defineProperties,Vw=Object.getOwnPropertyDescriptors,Ra=Object.getOwnPropertySymbols,Hw=Object.prototype.hasOwnProperty,Yw=Object.prototype.propertyIsEnumerable,Fa=(e,r,t)=>r in e?qw(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Kw=(e,r)=>{for(var t in r||(r={}))Hw.call(r,t)&&Fa(e,t,r[t]);if(Ra)for(var t of Ra(r))Yw.call(r,t)&&Fa(e,t,r[t]);return e},Xw=(e,r)=>zw(e,Vw(r));function Jw(e){try{return JSON.parse(e)}catch{return e}}function Qw(e){return Object.entries(e).reduce((r,[t,n])=>Xw(Kw({},r),{[t]:Jw(n)}),{})}const Ca=e=>typeof e=="string"?e!=="0"&&e!=="false":!!e;var Zw=Object.defineProperty,e1=Object.defineProperties,r1=Object.getOwnPropertyDescriptors,Ua=Object.getOwnPropertySymbols,t1=Object.prototype.hasOwnProperty,n1=Object.prototype.propertyIsEnumerable,Da=(e,r,t)=>r in e?Zw(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Na=(e,r)=>{for(var t in r||(r={}))t1.call(r,t)&&Da(e,t,r[t]);if(Ua)for(var t of Ua(r))n1.call(r,t)&&Da(e,t,r[t]);return e},Ma=(e,r)=>e1(e,r1(r));function La(e){var r;const t=Qw(e),n=t.auto_inject===void 0?!0:t.auto_inject,a=(r=t.display_on)!=null?r:[],s=t.first_option==="autodeliver";return Ma(Na({},Gn(t,["display_on","first_option"])),{auto_inject:n,valid_pages:a,is_subscription_first:s,autoInject:n,validPages:a,isSubscriptionFirst:s})}function ja(e){var r;const t=((r=e.subscription_options)==null?void 0:r.storefront_purchase_options)==="subscription_only";return Ma(Na({},e),{is_subscription_only:t,isSubscriptionOnly:t})}function i1(e){return e.map(r=>{const t={};return Object.entries(r).forEach(([n,a])=>{t[n]=ja(a)}),t})}const mt="2020-12",o1={store_currency:{currency_code:"USD",currency_symbol:"$",decimal_separator:".",thousands_separator:",",currency_symbol_location:"left"}},Cr=new Map;function _t(e,r){return Cr.has(e)||Cr.set(e,r()),Cr.get(e)}async function Wn(e){const{product:r}=await _t(`product.${e}`,()=>ct("get",`/product/${mt}/${e}.json`));return ja(r)}async function ka(){return await _t("storeSettings",()=>ct("get",`/${mt}/store_settings.json`).catch(()=>o1))}async function Ga(){const{widget_settings:e}=await _t("widgetSettings",()=>ct("get",`/${mt}/widget_settings.json`));return La(e)}async function Wa(){const{products:e,widget_settings:r,store_settings:t,meta:n}=await _t("productsAndSettings",()=>ct("get",`/product/${mt}/products.json`));return n?.status==="error"?Promise.reject(n.message):{products:i1(e),widget_settings:La(r),store_settings:t??{}}}async function a1(){const{products:e}=await Wa();return e}async function s1(e){const[r,t,n]=await Promise.all([Wn(e),ka(),Ga()]);return{product:r,store_settings:t,widget_settings:n,storeSettings:t,widgetSettings:n}}async function qa(e){const{bundle_product:r}=await Wn(e);return r}async function za(){return Array.from(Cr.keys()).forEach(e=>Cr.delete(e))}var u1=Object.freeze({__proto__:null,getCDNProduct:Wn,getCDNStoreSettings:ka,getCDNWidgetSettings:Ga,getCDNProductsAndSettings:Wa,getCDNProducts:a1,getCDNProductAndSettings:s1,getCDNBundleSettings:qa,resetCDNCache:za}),Va={exports:{}};/*! For license information please see xdr.js.LICENSE.txt */(function(e,r){(function(t,n){e.exports=n()})($e,()=>(()=>{var t={899:(s,c,p)=>{const h=p(221);s.exports=h},221:(s,c,p)=>{p.r(c),p.d(c,{Array:()=>yr,Bool:()=>H,Double:()=>St,Enum:()=>be,Float:()=>Ne,Hyper:()=>k,Int:()=>V,Opaque:()=>Nr,Option:()=>Lr,Quadruple:()=>G,Reference:()=>te,String:()=>Dr,Struct:()=>Me,Union:()=>Oe,UnsignedHyper:()=>se,UnsignedInt:()=>N,VarArray:()=>Mr,VarOpaque:()=>Te,Void:()=>Q,config:()=>g});class h extends TypeError{constructor(o){super(`XDR Write Error: ${o}`)}}class v extends TypeError{constructor(o){super(`XDR Read Error: ${o}`)}}class _ extends TypeError{constructor(o){super(`XDR Type Definition Error: ${o}`)}}class w extends _{constructor(){super("method not implemented, it should be overloaded in the descendant class.")}}var b=p(764).lW;class d{constructor(o){if(!b.isBuffer(o)){if(!(o instanceof Array))throw new v("source not specified");o=b.from(o)}this._buffer=o,this._length=o.length,this._index=0}_buffer;_length;_index;get eof(){return this._index===this._length}advance(o){const l=this._index;if(this._index+=o,this._length<this._index)throw new v("attempt to read outside the boundary of the buffer");const m=4-(o%4||4);if(m>0){for(let A=0;A<m;A++)if(this._buffer[this._index+A]!==0)throw new v("invalid padding");this._index+=m}return l}rewind(){this._index=0}read(o){const l=this.advance(o);return this._buffer.subarray(l,l+o)}readInt32BE(){return this._buffer.readInt32BE(this.advance(4))}readUInt32BE(){return this._buffer.readUInt32BE(this.advance(4))}readBigInt64BE(){return this._buffer.readBigInt64BE(this.advance(8))}readBigUInt64BE(){return this._buffer.readBigUInt64BE(this.advance(8))}readFloatBE(){return this._buffer.readFloatBE(this.advance(4))}readDoubleBE(){return this._buffer.readDoubleBE(this.advance(8))}ensureInputConsumed(){if(this._index!==this._length)throw new v("invalid XDR contract typecast - source buffer not entirely consumed")}}var E=p(764).lW;const x=8192;class I{constructor(o){typeof o=="number"?o=E.allocUnsafe(o):o instanceof E||(o=E.allocUnsafe(x)),this._buffer=o,this._length=o.length}_buffer;_length;_index=0;alloc(o){const l=this._index;return this._index+=o,this._length<this._index&&this.resize(this._index),l}resize(o){const l=Math.ceil(o/x)*x,m=E.allocUnsafe(l);this._buffer.copy(m,0,0,this._length),this._buffer=m,this._length=l}finalize(){return this._buffer.subarray(0,this._index)}toArray(){return[...this.finalize()]}write(o,l){if(typeof o=="string"){const A=this.alloc(l);this._buffer.write(o,A,"utf8")}else{o instanceof E||(o=E.from(o));const A=this.alloc(l);o.copy(this._buffer,A,0,l)}const m=4-(l%4||4);if(m>0){const A=this.alloc(m);this._buffer.fill(0,A,this._index)}}writeInt32BE(o){const l=this.alloc(4);this._buffer.writeInt32BE(o,l)}writeUInt32BE(o){const l=this.alloc(4);this._buffer.writeUInt32BE(o,l)}writeBigInt64BE(o){const l=this.alloc(8);this._buffer.writeBigInt64BE(o,l)}writeBigUInt64BE(o){const l=this.alloc(8);this._buffer.writeBigUInt64BE(o,l)}writeFloatBE(o){const l=this.alloc(4);this._buffer.writeFloatBE(o,l)}writeDoubleBE(o){const l=this.alloc(8);this._buffer.writeDoubleBE(o,l)}static bufferChunkSize=x}var S=p(764).lW;class T{toXDR(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"raw";if(!this.write)return this.constructor.toXDR(this,o);const l=new I;return this.write(this,l),j(l.finalize(),o)}fromXDR(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";if(!this.read)return this.constructor.fromXDR(o,l);const m=new d(q(o,l)),A=this.read(m);return m.ensureInputConsumed(),A}validateXDR(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";try{return this.fromXDR(o,l),!0}catch{return!1}}static toXDR(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";const m=new I;return this.write(o,m),j(m.finalize(),l)}static fromXDR(o){const l=new d(q(o,arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw")),m=this.read(l);return l.ensureInputConsumed(),m}static validateXDR(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";try{return this.fromXDR(o,l),!0}catch{return!1}}}class P extends T{static read(o){throw new w}static write(o,l){throw new w}static isValid(o){return!1}}class B extends T{isValid(o){return!1}}class D extends TypeError{constructor(o){super(`Invalid format ${o}, must be one of "raw", "hex", "base64"`)}}function j(y,o){switch(o){case"raw":return y;case"hex":return y.toString("hex");case"base64":return y.toString("base64");default:throw new D(o)}}function q(y,o){switch(o){case"raw":return y;case"hex":return S.from(y,"hex");case"base64":return S.from(y,"base64");default:throw new D(o)}}const z=2147483647,X=-2147483648;class V extends P{static read(o){return o.readInt32BE()}static write(o,l){if(typeof o!="number")throw new h("not a number");if((0|o)!==o)throw new h("invalid i32 value");l.writeInt32BE(o)}static isValid(o){return typeof o=="number"&&(0|o)===o&&o>=X&&o<=z}}V.MAX_VALUE=z,V.MIN_VALUE=2147483648;const ae=-9223372036854775808n,ue=9223372036854775807n;class k extends P{constructor(o,l){if(super(),typeof o=="bigint"){if(o<ae||o>ue)throw new TypeError("Invalid i64 value");this._value=o}else{if((0|o)!==o||(0|l)!==l)throw new TypeError("Invalid i64 value");this._value=BigInt(l>>>0)<<32n|BigInt(o>>>0)}}get low(){return Number(0xFFFFFFFFn&this._value)<<0}get high(){return Number(this._value>>32n)>>0}get unsigned(){return!1}toString(){return this._value.toString()}toJSON(){return{_value:this._value.toString()}}static read(o){return new k(o.readBigInt64BE())}static write(o,l){if(!(o instanceof this))throw new h(`${o} is not a Hyper`);l.writeBigInt64BE(o._value)}static fromString(o){if(!/^-?\d{0,19}$/.test(o))throw new TypeError(`Invalid i64 string value: ${o}`);return new k(BigInt(o))}static fromBits(o,l){return new this(o,l)}static isValid(o){return o instanceof this}}k.MAX_VALUE=new k(ue),k.MIN_VALUE=new k(ae);const re=4294967295;class N extends P{static read(o){return o.readUInt32BE()}static write(o,l){if(typeof o!="number"||!(o>=0&&o<=re)||o%1!=0)throw new h("invalid u32 value");l.writeUInt32BE(o)}static isValid(o){return typeof o=="number"&&o%1==0&&o>=0&&o<=re}}N.MAX_VALUE=re,N.MIN_VALUE=0;const ce=0n,hr=0xFFFFFFFFFFFFFFFFn;class se extends P{constructor(o,l){if(super(),typeof o=="bigint"){if(o<ce||o>hr)throw new TypeError("Invalid u64 value");this._value=o}else{if((0|o)!==o||(0|l)!==l)throw new TypeError("Invalid u64 value");this._value=BigInt(l>>>0)<<32n|BigInt(o>>>0)}}get low(){return Number(0xFFFFFFFFn&this._value)<<0}get high(){return Number(this._value>>32n)>>0}get unsigned(){return!0}toString(){return this._value.toString()}toJSON(){return{_value:this._value.toString()}}static read(o){return new se(o.readBigUInt64BE())}static write(o,l){if(!(o instanceof this))throw new h(`${o} is not an UnsignedHyper`);l.writeBigUInt64BE(o._value)}static fromString(o){if(!/^\d{0,20}$/.test(o))throw new TypeError(`Invalid u64 string value: ${o}`);return new se(BigInt(o))}static fromBits(o,l){return new this(o,l)}static isValid(o){return o instanceof this}}se.MAX_VALUE=new se(hr),se.MIN_VALUE=new se(ce);class Ne extends P{static read(o){return o.readFloatBE()}static write(o,l){if(typeof o!="number")throw new h("not a number");l.writeFloatBE(o)}static isValid(o){return typeof o=="number"}}class St extends P{static read(o){return o.readDoubleBE()}static write(o,l){if(typeof o!="number")throw new h("not a number");l.writeDoubleBE(o)}static isValid(o){return typeof o=="number"}}class G extends P{static read(){throw new _("quadruple not supported")}static write(){throw new _("quadruple not supported")}static isValid(){return!1}}class H extends P{static read(o){const l=V.read(o);switch(l){case 0:return!1;case 1:return!0;default:throw new v(`got ${l} when trying to read a bool`)}}static write(o,l){const m=o?1:0;V.write(m,l)}static isValid(o){return typeof o=="boolean"}}var dr=p(764).lW;class Dr extends B{constructor(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:N.MAX_VALUE;super(),this._maxLength=o}read(o){const l=N.read(o);if(l>this._maxLength)throw new v(`saw ${l} length String, max allowed is ${this._maxLength}`);return o.read(l)}readString(o){return this.read(o).toString("utf8")}write(o,l){const m=typeof o=="string"?dr.byteLength(o,"utf8"):o.length;if(m>this._maxLength)throw new h(`got ${o.length} bytes, max allowed is ${this._maxLength}`);N.write(m,l),l.write(o,m)}isValid(o){return typeof o=="string"?dr.byteLength(o,"utf8")<=this._maxLength:!!(o instanceof Array||dr.isBuffer(o))&&o.length<=this._maxLength}}var xt=p(764).lW;class Nr extends B{constructor(o){super(),this._length=o}read(o){return o.read(this._length)}write(o,l){const{length:m}=o;if(m!==this._length)throw new h(`got ${o.length} bytes, expected ${this._length}`);l.write(o,m)}isValid(o){return xt.isBuffer(o)&&o.length===this._length}}var It=p(764).lW;class Te extends B{constructor(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:N.MAX_VALUE;super(),this._maxLength=o}read(o){const l=N.read(o);if(l>this._maxLength)throw new v(`saw ${l} length VarOpaque, max allowed is ${this._maxLength}`);return o.read(l)}write(o,l){const{length:m}=o;if(o.length>this._maxLength)throw new h(`got ${o.length} bytes, max allowed is ${this._maxLength}`);N.write(m,l),l.write(o,m)}isValid(o){return It.isBuffer(o)&&o.length<=this._maxLength}}class yr extends B{constructor(o,l){super(),this._childType=o,this._length=l}read(o){const l=new p.g.Array(this._length);for(let m=0;m<this._length;m++)l[m]=this._childType.read(o);return l}write(o,l){if(!(o instanceof p.g.Array))throw new h("value is not array");if(o.length!==this._length)throw new h(`got array of size ${o.length}, expected ${this._length}`);for(const m of o)this._childType.write(m,l)}isValid(o){if(!(o instanceof p.g.Array)||o.length!==this._length)return!1;for(const l of o)if(!this._childType.isValid(l))return!1;return!0}}class Mr extends B{constructor(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:N.MAX_VALUE;super(),this._childType=o,this._maxLength=l}read(o){const l=N.read(o);if(l>this._maxLength)throw new v(`saw ${l} length VarArray, max allowed is ${this._maxLength}`);const m=new Array(l);for(let A=0;A<l;A++)m[A]=this._childType.read(o);return m}write(o,l){if(!(o instanceof Array))throw new h("value is not array");if(o.length>this._maxLength)throw new h(`got array of size ${o.length}, max allowed is ${this._maxLength}`);N.write(o.length,l);for(const m of o)this._childType.write(m,l)}isValid(o){if(!(o instanceof Array)||o.length>this._maxLength)return!1;for(const l of o)if(!this._childType.isValid(l))return!1;return!0}}class Lr extends P{constructor(o){super(),this._childType=o}read(o){if(H.read(o))return this._childType.read(o)}write(o,l){const m=o!=null;H.write(m,l),m&&this._childType.write(o,l)}isValid(o){return o==null||this._childType.isValid(o)}}class Q extends P{static read(){}static write(o){if(o!==void 0)throw new h("trying to write value to a void slot")}static isValid(o){return o===void 0}}class be extends P{constructor(o,l){super(),this.name=o,this.value=l}static read(o){const l=V.read(o),m=this._byValue[l];if(m===void 0)throw new v(`unknown ${this.enumName} member for value ${l}`);return m}static write(o,l){if(!(o instanceof this))throw new h(`unknown ${o} is not a ${this.enumName}`);V.write(o.value,l)}static isValid(o){return o instanceof this}static members(){return this._members}static values(){return Object.values(this._members)}static fromName(o){const l=this._members[o];if(!l)throw new TypeError(`${o} is not a member of ${this.enumName}`);return l}static fromValue(o){const l=this._byValue[o];if(l===void 0)throw new TypeError(`${o} is not a value of any member of ${this.enumName}`);return l}static create(o,l,m){const A=class extends be{};A.enumName=l,o.results[l]=A,A._members={},A._byValue={};for(const[F,R]of Object.entries(m)){const C=new A(F,R);A._members[F]=C,A._byValue[R]=C,A[F]=()=>C}return A}}class te extends P{resolve(){throw new _('"resolve" method should be implemented in the descendant class')}}class Me extends P{constructor(o){super(),this._attributes=o||{}}static read(o){const l={};for(const[m,A]of this._fields)l[m]=A.read(o);return new this(l)}static write(o,l){if(!(o instanceof this))throw new h(`${o} is not a ${this.structName}`);for(const[m,A]of this._fields){const F=o._attributes[m];A.write(F,l)}}static isValid(o){return o instanceof this}static create(o,l,m){const A=class extends Me{};A.structName=l,o.results[l]=A;const F=new Array(m.length);for(let R=0;R<m.length;R++){const C=m[R],jr=C[0];let Ot=C[1];Ot instanceof te&&(Ot=Ot.resolve(o)),F[R]=[jr,Ot],A.prototype[jr]=Tt(jr)}return A._fields=F,A}}function Tt(y){return function(o){return o!==void 0&&(this._attributes[y]=o),this._attributes[y]}}class Oe extends B{constructor(o,l){super(),this.set(o,l)}set(o,l){typeof o=="string"&&(o=this.constructor._switchOn.fromName(o)),this._switch=o;const m=this.constructor.armForSwitch(this._switch);this._arm=m,this._armType=m===Q?Q:this.constructor._arms[m],this._value=l}get(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this._arm;if(this._arm!==Q&&this._arm!==o)throw new TypeError(`${o} not set`);return this._value}switch(){return this._switch}arm(){return this._arm}armType(){return this._armType}value(){return this._value}static armForSwitch(o){const l=this._switches.get(o);if(l!==void 0)return l;if(this._defaultArm)return this._defaultArm;throw new TypeError(`Bad union switch: ${o}`)}static armTypeForArm(o){return o===Q?Q:this._arms[o]}static read(o){const l=this._switchOn.read(o),m=this.armForSwitch(l),A=m===Q?Q:this._arms[m];let F;return F=A!==void 0?A.read(o):m.read(o),new this(l,F)}static write(o,l){if(!(o instanceof this))throw new h(`${o} is not a ${this.unionName}`);this._switchOn.write(o.switch(),l),o.armType().write(o.value(),l)}static isValid(o){return o instanceof this}static create(o,l,m){const A=class extends Oe{};A.unionName=l,o.results[l]=A,m.switchOn instanceof te?A._switchOn=m.switchOn.resolve(o):A._switchOn=m.switchOn,A._switches=new Map,A._arms={};let F=m.defaultArm;F instanceof te&&(F=F.resolve(o)),A._defaultArm=F;for(const[R,C]of m.switches){const jr=typeof R=="string"?A._switchOn.fromName(R):R;A._switches.set(jr,C)}if(A._switchOn.values!==void 0)for(const R of A._switchOn.values())A[R.name]=function(C){return new A(R,C)},A.prototype[R.name]=function(C){return this.set(R,C)};if(m.arms)for(const[R,C]of Object.entries(m.arms))A._arms[R]=C instanceof te?C.resolve(o):C,C!==Q&&(A.prototype[R]=function(){return this.get(R)});return A}}class le extends te{constructor(o){super(),this.name=o}resolve(o){return o.definitions[this.name].resolve(o)}}class gr extends te{constructor(o,l){let m=arguments.length>2&&arguments[2]!==void 0&&arguments[2];super(),this.childReference=o,this.length=l,this.variable=m}resolve(o){let l=this.childReference,m=this.length;return l instanceof te&&(l=l.resolve(o)),m instanceof te&&(m=m.resolve(o)),this.variable?new Mr(l,m):new yr(l,m)}}class Qn extends te{constructor(o){super(),this.childReference=o,this.name=o.name}resolve(o){let l=this.childReference;return l instanceof te&&(l=l.resolve(o)),new Lr(l)}}class pe extends te{constructor(o,l){super(),this.sizedType=o,this.length=l}resolve(o){let l=this.length;return l instanceof te&&(l=l.resolve(o)),new this.sizedType(l)}}class Je{constructor(o,l,m){this.constructor=o,this.name=l,this.config=m}resolve(o){return this.name in o.results?o.results[this.name]:this.constructor(o,this.name,this.config)}}function i(y,o,l){return l instanceof te&&(l=l.resolve(y)),y.results[o]=l,l}function u(y,o,l){return y.results[o]=l,l}class f{constructor(o){this._destination=o,this._definitions={}}enum(o,l){const m=new Je(be.create,o,l);this.define(o,m)}struct(o,l){const m=new Je(Me.create,o,l);this.define(o,m)}union(o,l){const m=new Je(Oe.create,o,l);this.define(o,m)}typedef(o,l){const m=new Je(i,o,l);this.define(o,m)}const(o,l){const m=new Je(u,o,l);this.define(o,m)}void(){return Q}bool(){return H}int(){return V}hyper(){return k}uint(){return N}uhyper(){return se}float(){return Ne}double(){return St}quadruple(){return G}string(o){return new pe(Dr,o)}opaque(o){return new pe(Nr,o)}varOpaque(o){return new pe(Te,o)}array(o,l){return new gr(o,l)}varArray(o,l){return new gr(o,l,!0)}option(o){return new Qn(o)}define(o,l){if(this._destination[o]!==void 0)throw new _(`${o} is already defined`);this._definitions[o]=l}lookup(o){return new le(o)}resolve(){for(const o of Object.values(this._definitions))o.resolve({definitions:this._definitions,results:this._destination})}}function g(y){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(y){const l=new f(o);y(l),l.resolve()}return o}},742:(s,c)=>{c.byteLength=function(E){var x=b(E),I=x[0],S=x[1];return 3*(I+S)/4-S},c.toByteArray=function(E){var x,I,S=b(E),T=S[0],P=S[1],B=new v(function(q,z,X){return 3*(z+X)/4-X}(0,T,P)),D=0,j=P>0?T-4:T;for(I=0;I<j;I+=4)x=h[E.charCodeAt(I)]<<18|h[E.charCodeAt(I+1)]<<12|h[E.charCodeAt(I+2)]<<6|h[E.charCodeAt(I+3)],B[D++]=x>>16&255,B[D++]=x>>8&255,B[D++]=255&x;return P===2&&(x=h[E.charCodeAt(I)]<<2|h[E.charCodeAt(I+1)]>>4,B[D++]=255&x),P===1&&(x=h[E.charCodeAt(I)]<<10|h[E.charCodeAt(I+1)]<<4|h[E.charCodeAt(I+2)]>>2,B[D++]=x>>8&255,B[D++]=255&x),B},c.fromByteArray=function(E){for(var x,I=E.length,S=I%3,T=[],P=16383,B=0,D=I-S;B<D;B+=P)T.push(d(E,B,B+P>D?D:B+P));return S===1?(x=E[I-1],T.push(p[x>>2]+p[x<<4&63]+"==")):S===2&&(x=(E[I-2]<<8)+E[I-1],T.push(p[x>>10]+p[x>>4&63]+p[x<<2&63]+"=")),T.join("")};for(var p=[],h=[],v=typeof Uint8Array<"u"?Uint8Array:Array,_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",w=0;w<64;++w)p[w]=_[w],h[_.charCodeAt(w)]=w;function b(E){var x=E.length;if(x%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var I=E.indexOf("=");return I===-1&&(I=x),[I,I===x?0:4-I%4]}function d(E,x,I){for(var S,T,P=[],B=x;B<I;B+=3)S=(E[B]<<16&16711680)+(E[B+1]<<8&65280)+(255&E[B+2]),P.push(p[(T=S)>>18&63]+p[T>>12&63]+p[T>>6&63]+p[63&T]);return P.join("")}h["-".charCodeAt(0)]=62,h["_".charCodeAt(0)]=63},764:(s,c,p)=>{const h=p(742),v=p(645),_=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;c.lW=d,c.h2=50;const w=2147483647;function b(i){if(i>w)throw new RangeError('The value "'+i+'" is invalid for option "size"');const u=new Uint8Array(i);return Object.setPrototypeOf(u,d.prototype),u}function d(i,u,f){if(typeof i=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return I(i)}return E(i,u,f)}function E(i,u,f){if(typeof i=="string")return function(o,l){if(typeof l=="string"&&l!==""||(l="utf8"),!d.isEncoding(l))throw new TypeError("Unknown encoding: "+l);const m=0|B(o,l);let A=b(m);const F=A.write(o,l);return F!==m&&(A=A.slice(0,F)),A}(i,u);if(ArrayBuffer.isView(i))return function(o){if(le(o,Uint8Array)){const l=new Uint8Array(o);return T(l.buffer,l.byteOffset,l.byteLength)}return S(o)}(i);if(i==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);if(le(i,ArrayBuffer)||i&&le(i.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(le(i,SharedArrayBuffer)||i&&le(i.buffer,SharedArrayBuffer)))return T(i,u,f);if(typeof i=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const g=i.valueOf&&i.valueOf();if(g!=null&&g!==i)return d.from(g,u,f);const y=function(o){if(d.isBuffer(o)){const l=0|P(o.length),m=b(l);return m.length===0||o.copy(m,0,0,l),m}if(o.length!==void 0)return typeof o.length!="number"||gr(o.length)?b(0):S(o);if(o.type==="Buffer"&&Array.isArray(o.data))return S(o.data)}(i);if(y)return y;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof i[Symbol.toPrimitive]=="function")return d.from(i[Symbol.toPrimitive]("string"),u,f);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i)}function x(i){if(typeof i!="number")throw new TypeError('"size" argument must be of type number');if(i<0)throw new RangeError('The value "'+i+'" is invalid for option "size"')}function I(i){return x(i),b(i<0?0:0|P(i))}function S(i){const u=i.length<0?0:0|P(i.length),f=b(u);for(let g=0;g<u;g+=1)f[g]=255&i[g];return f}function T(i,u,f){if(u<0||i.byteLength<u)throw new RangeError('"offset" is outside of buffer bounds');if(i.byteLength<u+(f||0))throw new RangeError('"length" is outside of buffer bounds');let g;return g=u===void 0&&f===void 0?new Uint8Array(i):f===void 0?new Uint8Array(i,u):new Uint8Array(i,u,f),Object.setPrototypeOf(g,d.prototype),g}function P(i){if(i>=w)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+w.toString(16)+" bytes");return 0|i}function B(i,u){if(d.isBuffer(i))return i.length;if(ArrayBuffer.isView(i)||le(i,ArrayBuffer))return i.byteLength;if(typeof i!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof i);const f=i.length,g=arguments.length>2&&arguments[2]===!0;if(!g&&f===0)return 0;let y=!1;for(;;)switch(u){case"ascii":case"latin1":case"binary":return f;case"utf8":case"utf-8":return Me(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*f;case"hex":return f>>>1;case"base64":return Tt(i).length;default:if(y)return g?-1:Me(i).length;u=(""+u).toLowerCase(),y=!0}}function D(i,u,f){let g=!1;if((u===void 0||u<0)&&(u=0),u>this.length||((f===void 0||f>this.length)&&(f=this.length),f<=0)||(f>>>=0)<=(u>>>=0))return"";for(i||(i="utf8");;)switch(i){case"hex":return Ne(this,u,f);case"utf8":case"utf-8":return N(this,u,f);case"ascii":return hr(this,u,f);case"latin1":case"binary":return se(this,u,f);case"base64":return re(this,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return St(this,u,f);default:if(g)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),g=!0}}function j(i,u,f){const g=i[u];i[u]=i[f],i[f]=g}function q(i,u,f,g,y){if(i.length===0)return-1;if(typeof f=="string"?(g=f,f=0):f>2147483647?f=2147483647:f<-2147483648&&(f=-2147483648),gr(f=+f)&&(f=y?0:i.length-1),f<0&&(f=i.length+f),f>=i.length){if(y)return-1;f=i.length-1}else if(f<0){if(!y)return-1;f=0}if(typeof u=="string"&&(u=d.from(u,g)),d.isBuffer(u))return u.length===0?-1:z(i,u,f,g,y);if(typeof u=="number")return u&=255,typeof Uint8Array.prototype.indexOf=="function"?y?Uint8Array.prototype.indexOf.call(i,u,f):Uint8Array.prototype.lastIndexOf.call(i,u,f):z(i,[u],f,g,y);throw new TypeError("val must be string, number or Buffer")}function z(i,u,f,g,y){let o,l=1,m=i.length,A=u.length;if(g!==void 0&&((g=String(g).toLowerCase())==="ucs2"||g==="ucs-2"||g==="utf16le"||g==="utf-16le")){if(i.length<2||u.length<2)return-1;l=2,m/=2,A/=2,f/=2}function F(R,C){return l===1?R[C]:R.readUInt16BE(C*l)}if(y){let R=-1;for(o=f;o<m;o++)if(F(i,o)===F(u,R===-1?0:o-R)){if(R===-1&&(R=o),o-R+1===A)return R*l}else R!==-1&&(o-=o-R),R=-1}else for(f+A>m&&(f=m-A),o=f;o>=0;o--){let R=!0;for(let C=0;C<A;C++)if(F(i,o+C)!==F(u,C)){R=!1;break}if(R)return o}return-1}function X(i,u,f,g){f=Number(f)||0;const y=i.length-f;g?(g=Number(g))>y&&(g=y):g=y;const o=u.length;let l;for(g>o/2&&(g=o/2),l=0;l<g;++l){const m=parseInt(u.substr(2*l,2),16);if(gr(m))return l;i[f+l]=m}return l}function V(i,u,f,g){return Oe(Me(u,i.length-f),i,f,g)}function ae(i,u,f,g){return Oe(function(y){const o=[];for(let l=0;l<y.length;++l)o.push(255&y.charCodeAt(l));return o}(u),i,f,g)}function ue(i,u,f,g){return Oe(Tt(u),i,f,g)}function k(i,u,f,g){return Oe(function(y,o){let l,m,A;const F=[];for(let R=0;R<y.length&&!((o-=2)<0);++R)l=y.charCodeAt(R),m=l>>8,A=l%256,F.push(A),F.push(m);return F}(u,i.length-f),i,f,g)}function re(i,u,f){return u===0&&f===i.length?h.fromByteArray(i):h.fromByteArray(i.slice(u,f))}function N(i,u,f){f=Math.min(i.length,f);const g=[];let y=u;for(;y<f;){const o=i[y];let l=null,m=o>239?4:o>223?3:o>191?2:1;if(y+m<=f){let A,F,R,C;switch(m){case 1:o<128&&(l=o);break;case 2:A=i[y+1],(192&A)==128&&(C=(31&o)<<6|63&A,C>127&&(l=C));break;case 3:A=i[y+1],F=i[y+2],(192&A)==128&&(192&F)==128&&(C=(15&o)<<12|(63&A)<<6|63&F,C>2047&&(C<55296||C>57343)&&(l=C));break;case 4:A=i[y+1],F=i[y+2],R=i[y+3],(192&A)==128&&(192&F)==128&&(192&R)==128&&(C=(15&o)<<18|(63&A)<<12|(63&F)<<6|63&R,C>65535&&C<1114112&&(l=C))}}l===null?(l=65533,m=1):l>65535&&(l-=65536,g.push(l>>>10&1023|55296),l=56320|1023&l),g.push(l),y+=m}return function(o){const l=o.length;if(l<=ce)return String.fromCharCode.apply(String,o);let m="",A=0;for(;A<l;)m+=String.fromCharCode.apply(String,o.slice(A,A+=ce));return m}(g)}d.TYPED_ARRAY_SUPPORT=function(){try{const i=new Uint8Array(1),u={foo:function(){return 42}};return Object.setPrototypeOf(u,Uint8Array.prototype),Object.setPrototypeOf(i,u),i.foo()===42}catch{return!1}}(),d.TYPED_ARRAY_SUPPORT||typeof console>"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}}),d.poolSize=8192,d.from=function(i,u,f){return E(i,u,f)},Object.setPrototypeOf(d.prototype,Uint8Array.prototype),Object.setPrototypeOf(d,Uint8Array),d.alloc=function(i,u,f){return function(g,y,o){return x(g),g<=0?b(g):y!==void 0?typeof o=="string"?b(g).fill(y,o):b(g).fill(y):b(g)}(i,u,f)},d.allocUnsafe=function(i){return I(i)},d.allocUnsafeSlow=function(i){return I(i)},d.isBuffer=function(i){return i!=null&&i._isBuffer===!0&&i!==d.prototype},d.compare=function(i,u){if(le(i,Uint8Array)&&(i=d.from(i,i.offset,i.byteLength)),le(u,Uint8Array)&&(u=d.from(u,u.offset,u.byteLength)),!d.isBuffer(i)||!d.isBuffer(u))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(i===u)return 0;let f=i.length,g=u.length;for(let y=0,o=Math.min(f,g);y<o;++y)if(i[y]!==u[y]){f=i[y],g=u[y];break}return f<g?-1:g<f?1:0},d.isEncoding=function(i){switch(String(i).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}},d.concat=function(i,u){if(!Array.isArray(i))throw new TypeError('"list" argument must be an Array of Buffers');if(i.length===0)return d.alloc(0);let f;if(u===void 0)for(u=0,f=0;f<i.length;++f)u+=i[f].length;const g=d.allocUnsafe(u);let y=0;for(f=0;f<i.length;++f){let o=i[f];if(le(o,Uint8Array))y+o.length>g.length?(d.isBuffer(o)||(o=d.from(o)),o.copy(g,y)):Uint8Array.prototype.set.call(g,o,y);else{if(!d.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(g,y)}y+=o.length}return g},d.byteLength=B,d.prototype._isBuffer=!0,d.prototype.swap16=function(){const i=this.length;if(i%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let u=0;u<i;u+=2)j(this,u,u+1);return this},d.prototype.swap32=function(){const i=this.length;if(i%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let u=0;u<i;u+=4)j(this,u,u+3),j(this,u+1,u+2);return this},d.prototype.swap64=function(){const i=this.length;if(i%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let u=0;u<i;u+=8)j(this,u,u+7),j(this,u+1,u+6),j(this,u+2,u+5),j(this,u+3,u+4);return this},d.prototype.toString=function(){const i=this.length;return i===0?"":arguments.length===0?N(this,0,i):D.apply(this,arguments)},d.prototype.toLocaleString=d.prototype.toString,d.prototype.equals=function(i){if(!d.isBuffer(i))throw new TypeError("Argument must be a Buffer");return this===i||d.compare(this,i)===0},d.prototype.inspect=function(){let i="";const u=c.h2;return i=this.toString("hex",0,u).replace(/(.{2})/g,"$1 ").trim(),this.length>u&&(i+=" ... "),"<Buffer "+i+">"},_&&(d.prototype[_]=d.prototype.inspect),d.prototype.compare=function(i,u,f,g,y){if(le(i,Uint8Array)&&(i=d.from(i,i.offset,i.byteLength)),!d.isBuffer(i))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof i);if(u===void 0&&(u=0),f===void 0&&(f=i?i.length:0),g===void 0&&(g=0),y===void 0&&(y=this.length),u<0||f>i.length||g<0||y>this.length)throw new RangeError("out of range index");if(g>=y&&u>=f)return 0;if(g>=y)return-1;if(u>=f)return 1;if(this===i)return 0;let o=(y>>>=0)-(g>>>=0),l=(f>>>=0)-(u>>>=0);const m=Math.min(o,l),A=this.slice(g,y),F=i.slice(u,f);for(let R=0;R<m;++R)if(A[R]!==F[R]){o=A[R],l=F[R];break}return o<l?-1:l<o?1:0},d.prototype.includes=function(i,u,f){return this.indexOf(i,u,f)!==-1},d.prototype.indexOf=function(i,u,f){return q(this,i,u,f,!0)},d.prototype.lastIndexOf=function(i,u,f){return q(this,i,u,f,!1)},d.prototype.write=function(i,u,f,g){if(u===void 0)g="utf8",f=this.length,u=0;else if(f===void 0&&typeof u=="string")g=u,f=this.length,u=0;else{if(!isFinite(u))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");u>>>=0,isFinite(f)?(f>>>=0,g===void 0&&(g="utf8")):(g=f,f=void 0)}const y=this.length-u;if((f===void 0||f>y)&&(f=y),i.length>0&&(f<0||u<0)||u>this.length)throw new RangeError("Attempt to write outside buffer bounds");g||(g="utf8");let o=!1;for(;;)switch(g){case"hex":return X(this,i,u,f);case"utf8":case"utf-8":return V(this,i,u,f);case"ascii":case"latin1":case"binary":return ae(this,i,u,f);case"base64":return ue(this,i,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,i,u,f);default:if(o)throw new TypeError("Unknown encoding: "+g);g=(""+g).toLowerCase(),o=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const ce=4096;function hr(i,u,f){let g="";f=Math.min(i.length,f);for(let y=u;y<f;++y)g+=String.fromCharCode(127&i[y]);return g}function se(i,u,f){let g="";f=Math.min(i.length,f);for(let y=u;y<f;++y)g+=String.fromCharCode(i[y]);return g}function Ne(i,u,f){const g=i.length;(!u||u<0)&&(u=0),(!f||f<0||f>g)&&(f=g);let y="";for(let o=u;o<f;++o)y+=Qn[i[o]];return y}function St(i,u,f){const g=i.slice(u,f);let y="";for(let o=0;o<g.length-1;o+=2)y+=String.fromCharCode(g[o]+256*g[o+1]);return y}function G(i,u,f){if(i%1!=0||i<0)throw new RangeError("offset is not uint");if(i+u>f)throw new RangeError("Trying to access beyond buffer length")}function H(i,u,f,g,y,o){if(!d.isBuffer(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>y||u<o)throw new RangeError('"value" argument is out of bounds');if(f+g>i.length)throw new RangeError("Index out of range")}function dr(i,u,f,g,y){Lr(u,g,y,i,f,7);let o=Number(u&BigInt(4294967295));i[f++]=o,o>>=8,i[f++]=o,o>>=8,i[f++]=o,o>>=8,i[f++]=o;let l=Number(u>>BigInt(32)&BigInt(4294967295));return i[f++]=l,l>>=8,i[f++]=l,l>>=8,i[f++]=l,l>>=8,i[f++]=l,f}function Dr(i,u,f,g,y){Lr(u,g,y,i,f,7);let o=Number(u&BigInt(4294967295));i[f+7]=o,o>>=8,i[f+6]=o,o>>=8,i[f+5]=o,o>>=8,i[f+4]=o;let l=Number(u>>BigInt(32)&BigInt(4294967295));return i[f+3]=l,l>>=8,i[f+2]=l,l>>=8,i[f+1]=l,l>>=8,i[f]=l,f+8}function xt(i,u,f,g,y,o){if(f+g>i.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("Index out of range")}function Nr(i,u,f,g,y){return u=+u,f>>>=0,y||xt(i,0,f,4),v.write(i,u,f,g,23,4),f+4}function It(i,u,f,g,y){return u=+u,f>>>=0,y||xt(i,0,f,8),v.write(i,u,f,g,52,8),f+8}d.prototype.slice=function(i,u){const f=this.length;(i=~~i)<0?(i+=f)<0&&(i=0):i>f&&(i=f),(u=u===void 0?f:~~u)<0?(u+=f)<0&&(u=0):u>f&&(u=f),u<i&&(u=i);const g=this.subarray(i,u);return Object.setPrototypeOf(g,d.prototype),g},d.prototype.readUintLE=d.prototype.readUIntLE=function(i,u,f){i>>>=0,u>>>=0,f||G(i,u,this.length);let g=this[i],y=1,o=0;for(;++o<u&&(y*=256);)g+=this[i+o]*y;return g},d.prototype.readUintBE=d.prototype.readUIntBE=function(i,u,f){i>>>=0,u>>>=0,f||G(i,u,this.length);let g=this[i+--u],y=1;for(;u>0&&(y*=256);)g+=this[i+--u]*y;return g},d.prototype.readUint8=d.prototype.readUInt8=function(i,u){return i>>>=0,u||G(i,1,this.length),this[i]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(i,u){return i>>>=0,u||G(i,2,this.length),this[i]|this[i+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(i,u){return i>>>=0,u||G(i,2,this.length),this[i]<<8|this[i+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(i,u){return i>>>=0,u||G(i,4,this.length),(this[i]|this[i+1]<<8|this[i+2]<<16)+16777216*this[i+3]},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(i,u){return i>>>=0,u||G(i,4,this.length),16777216*this[i]+(this[i+1]<<16|this[i+2]<<8|this[i+3])},d.prototype.readBigUInt64LE=pe(function(i){Q(i>>>=0,"offset");const u=this[i],f=this[i+7];u!==void 0&&f!==void 0||be(i,this.length-8);const g=u+256*this[++i]+65536*this[++i]+this[++i]*2**24,y=this[++i]+256*this[++i]+65536*this[++i]+f*2**24;return BigInt(g)+(BigInt(y)<<BigInt(32))}),d.prototype.readBigUInt64BE=pe(function(i){Q(i>>>=0,"offset");const u=this[i],f=this[i+7];u!==void 0&&f!==void 0||be(i,this.length-8);const g=u*2**24+65536*this[++i]+256*this[++i]+this[++i],y=this[++i]*2**24+65536*this[++i]+256*this[++i]+f;return(BigInt(g)<<BigInt(32))+BigInt(y)}),d.prototype.readIntLE=function(i,u,f){i>>>=0,u>>>=0,f||G(i,u,this.length);let g=this[i],y=1,o=0;for(;++o<u&&(y*=256);)g+=this[i+o]*y;return y*=128,g>=y&&(g-=Math.pow(2,8*u)),g},d.prototype.readIntBE=function(i,u,f){i>>>=0,u>>>=0,f||G(i,u,this.length);let g=u,y=1,o=this[i+--g];for(;g>0&&(y*=256);)o+=this[i+--g]*y;return y*=128,o>=y&&(o-=Math.pow(2,8*u)),o},d.prototype.readInt8=function(i,u){return i>>>=0,u||G(i,1,this.length),128&this[i]?-1*(255-this[i]+1):this[i]},d.prototype.readInt16LE=function(i,u){i>>>=0,u||G(i,2,this.length);const f=this[i]|this[i+1]<<8;return 32768&f?4294901760|f:f},d.prototype.readInt16BE=function(i,u){i>>>=0,u||G(i,2,this.length);const f=this[i+1]|this[i]<<8;return 32768&f?4294901760|f:f},d.prototype.readInt32LE=function(i,u){return i>>>=0,u||G(i,4,this.length),this[i]|this[i+1]<<8|this[i+2]<<16|this[i+3]<<24},d.prototype.readInt32BE=function(i,u){return i>>>=0,u||G(i,4,this.length),this[i]<<24|this[i+1]<<16|this[i+2]<<8|this[i+3]},d.prototype.readBigInt64LE=pe(function(i){Q(i>>>=0,"offset");const u=this[i],f=this[i+7];u!==void 0&&f!==void 0||be(i,this.length-8);const g=this[i+4]+256*this[i+5]+65536*this[i+6]+(f<<24);return(BigInt(g)<<BigInt(32))+BigInt(u+256*this[++i]+65536*this[++i]+this[++i]*16777216)}),d.prototype.readBigInt64BE=pe(function(i){Q(i>>>=0,"offset");const u=this[i],f=this[i+7];u!==void 0&&f!==void 0||be(i,this.length-8);const g=(u<<24)+65536*this[++i]+256*this[++i]+this[++i];return(BigInt(g)<<BigInt(32))+BigInt(this[++i]*16777216+65536*this[++i]+256*this[++i]+f)}),d.prototype.readFloatLE=function(i,u){return i>>>=0,u||G(i,4,this.length),v.read(this,i,!0,23,4)},d.prototype.readFloatBE=function(i,u){return i>>>=0,u||G(i,4,this.length),v.read(this,i,!1,23,4)},d.prototype.readDoubleLE=function(i,u){return i>>>=0,u||G(i,8,this.length),v.read(this,i,!0,52,8)},d.prototype.readDoubleBE=function(i,u){return i>>>=0,u||G(i,8,this.length),v.read(this,i,!1,52,8)},d.prototype.writeUintLE=d.prototype.writeUIntLE=function(i,u,f,g){i=+i,u>>>=0,f>>>=0,!g&&H(this,i,u,f,Math.pow(2,8*f)-1,0);let y=1,o=0;for(this[u]=255&i;++o<f&&(y*=256);)this[u+o]=i/y&255;return u+f},d.prototype.writeUintBE=d.prototype.writeUIntBE=function(i,u,f,g){i=+i,u>>>=0,f>>>=0,!g&&H(this,i,u,f,Math.pow(2,8*f)-1,0);let y=f-1,o=1;for(this[u+y]=255&i;--y>=0&&(o*=256);)this[u+y]=i/o&255;return u+f},d.prototype.writeUint8=d.prototype.writeUInt8=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,1,255,0),this[u]=255&i,u+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,2,65535,0),this[u]=255&i,this[u+1]=i>>>8,u+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,2,65535,0),this[u]=i>>>8,this[u+1]=255&i,u+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,4,4294967295,0),this[u+3]=i>>>24,this[u+2]=i>>>16,this[u+1]=i>>>8,this[u]=255&i,u+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,4,4294967295,0),this[u]=i>>>24,this[u+1]=i>>>16,this[u+2]=i>>>8,this[u+3]=255&i,u+4},d.prototype.writeBigUInt64LE=pe(function(i,u=0){return dr(this,i,u,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeBigUInt64BE=pe(function(i,u=0){return Dr(this,i,u,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeIntLE=function(i,u,f,g){if(i=+i,u>>>=0,!g){const m=Math.pow(2,8*f-1);H(this,i,u,f,m-1,-m)}let y=0,o=1,l=0;for(this[u]=255&i;++y<f&&(o*=256);)i<0&&l===0&&this[u+y-1]!==0&&(l=1),this[u+y]=(i/o>>0)-l&255;return u+f},d.prototype.writeIntBE=function(i,u,f,g){if(i=+i,u>>>=0,!g){const m=Math.pow(2,8*f-1);H(this,i,u,f,m-1,-m)}let y=f-1,o=1,l=0;for(this[u+y]=255&i;--y>=0&&(o*=256);)i<0&&l===0&&this[u+y+1]!==0&&(l=1),this[u+y]=(i/o>>0)-l&255;return u+f},d.prototype.writeInt8=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,1,127,-128),i<0&&(i=255+i+1),this[u]=255&i,u+1},d.prototype.writeInt16LE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,2,32767,-32768),this[u]=255&i,this[u+1]=i>>>8,u+2},d.prototype.writeInt16BE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,2,32767,-32768),this[u]=i>>>8,this[u+1]=255&i,u+2},d.prototype.writeInt32LE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,4,2147483647,-2147483648),this[u]=255&i,this[u+1]=i>>>8,this[u+2]=i>>>16,this[u+3]=i>>>24,u+4},d.prototype.writeInt32BE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,4,2147483647,-2147483648),i<0&&(i=4294967295+i+1),this[u]=i>>>24,this[u+1]=i>>>16,this[u+2]=i>>>8,this[u+3]=255&i,u+4},d.prototype.writeBigInt64LE=pe(function(i,u=0){return dr(this,i,u,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeBigInt64BE=pe(function(i,u=0){return Dr(this,i,u,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeFloatLE=function(i,u,f){return Nr(this,i,u,!0,f)},d.prototype.writeFloatBE=function(i,u,f){return Nr(this,i,u,!1,f)},d.prototype.writeDoubleLE=function(i,u,f){return It(this,i,u,!0,f)},d.prototype.writeDoubleBE=function(i,u,f){return It(this,i,u,!1,f)},d.prototype.copy=function(i,u,f,g){if(!d.isBuffer(i))throw new TypeError("argument should be a Buffer");if(f||(f=0),g||g===0||(g=this.length),u>=i.length&&(u=i.length),u||(u=0),g>0&&g<f&&(g=f),g===f||i.length===0||this.length===0)return 0;if(u<0)throw new RangeError("targetStart out of bounds");if(f<0||f>=this.length)throw new RangeError("Index out of range");if(g<0)throw new RangeError("sourceEnd out of bounds");g>this.length&&(g=this.length),i.length-u<g-f&&(g=i.length-u+f);const y=g-f;return this===i&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(u,f,g):Uint8Array.prototype.set.call(i,this.subarray(f,g),u),y},d.prototype.fill=function(i,u,f,g){if(typeof i=="string"){if(typeof u=="string"?(g=u,u=0,f=this.length):typeof f=="string"&&(g=f,f=this.length),g!==void 0&&typeof g!="string")throw new TypeError("encoding must be a string");if(typeof g=="string"&&!d.isEncoding(g))throw new TypeError("Unknown encoding: "+g);if(i.length===1){const o=i.charCodeAt(0);(g==="utf8"&&o<128||g==="latin1")&&(i=o)}}else typeof i=="number"?i&=255:typeof i=="boolean"&&(i=Number(i));if(u<0||this.length<u||this.length<f)throw new RangeError("Out of range index");if(f<=u)return this;let y;if(u>>>=0,f=f===void 0?this.length:f>>>0,i||(i=0),typeof i=="number")for(y=u;y<f;++y)this[y]=i;else{const o=d.isBuffer(i)?i:d.from(i,g),l=o.length;if(l===0)throw new TypeError('The value "'+i+'" is invalid for argument "value"');for(y=0;y<f-u;++y)this[y+u]=o[y%l]}return this};const Te={};function yr(i,u,f){Te[i]=class extends f{constructor(){super(),Object.defineProperty(this,"message",{value:u.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${i}]`,this.stack,delete this.name}get code(){return i}set code(g){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:g,writable:!0})}toString(){return`${this.name} [${i}]: ${this.message}`}}}function Mr(i){let u="",f=i.length;const g=i[0]==="-"?1:0;for(;f>=g+4;f-=3)u=`_${i.slice(f-3,f)}${u}`;return`${i.slice(0,f)}${u}`}function Lr(i,u,f,g,y,o){if(i>f||i<u){const l=typeof u=="bigint"?"n":"";let m;throw m=o>3?u===0||u===BigInt(0)?`>= 0${l} and < 2${l} ** ${8*(o+1)}${l}`:`>= -(2${l} ** ${8*(o+1)-1}${l}) and < 2 ** ${8*(o+1)-1}${l}`:`>= ${u}${l} and <= ${f}${l}`,new Te.ERR_OUT_OF_RANGE("value",m,i)}(function(l,m,A){Q(m,"offset"),l[m]!==void 0&&l[m+A]!==void 0||be(m,l.length-(A+1))})(g,y,o)}function Q(i,u){if(typeof i!="number")throw new Te.ERR_INVALID_ARG_TYPE(u,"number",i)}function be(i,u,f){throw Math.floor(i)!==i?(Q(i,f),new Te.ERR_OUT_OF_RANGE(f||"offset","an integer",i)):u<0?new Te.ERR_BUFFER_OUT_OF_BOUNDS:new Te.ERR_OUT_OF_RANGE(f||"offset",`>= ${f?1:0} and <= ${u}`,i)}yr("ERR_BUFFER_OUT_OF_BOUNDS",function(i){return i?`${i} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),yr("ERR_INVALID_ARG_TYPE",function(i,u){return`The "${i}" argument must be of type number. Received type ${typeof u}`},TypeError),yr("ERR_OUT_OF_RANGE",function(i,u,f){let g=`The value of "${i}" is out of range.`,y=f;return Number.isInteger(f)&&Math.abs(f)>4294967296?y=Mr(String(f)):typeof f=="bigint"&&(y=String(f),(f>BigInt(2)**BigInt(32)||f<-(BigInt(2)**BigInt(32)))&&(y=Mr(y)),y+="n"),g+=` It must be ${u}. Received ${y}`,g},RangeError);const te=/[^+/0-9A-Za-z-_]/g;function Me(i,u){let f;u=u||1/0;const g=i.length;let y=null;const o=[];for(let l=0;l<g;++l){if(f=i.charCodeAt(l),f>55295&&f<57344){if(!y){if(f>56319){(u-=3)>-1&&o.push(239,191,189);continue}if(l+1===g){(u-=3)>-1&&o.push(239,191,189);continue}y=f;continue}if(f<56320){(u-=3)>-1&&o.push(239,191,189),y=f;continue}f=65536+(y-55296<<10|f-56320)}else y&&(u-=3)>-1&&o.push(239,191,189);if(y=null,f<128){if((u-=1)<0)break;o.push(f)}else if(f<2048){if((u-=2)<0)break;o.push(f>>6|192,63&f|128)}else if(f<65536){if((u-=3)<0)break;o.push(f>>12|224,f>>6&63|128,63&f|128)}else{if(!(f<1114112))throw new Error("Invalid code point");if((u-=4)<0)break;o.push(f>>18|240,f>>12&63|128,f>>6&63|128,63&f|128)}}return o}function Tt(i){return h.toByteArray(function(u){if((u=(u=u.split("=")[0]).trim().replace(te,"")).length<2)return"";for(;u.length%4!=0;)u+="=";return u}(i))}function Oe(i,u,f,g){let y;for(y=0;y<g&&!(y+f>=u.length||y>=i.length);++y)u[y+f]=i[y];return y}function le(i,u){return i instanceof u||i!=null&&i.constructor!=null&&i.constructor.name!=null&&i.constructor.name===u.name}function gr(i){return i!=i}const Qn=function(){const i="0123456789abcdef",u=new Array(256);for(let f=0;f<16;++f){const g=16*f;for(let y=0;y<16;++y)u[g+y]=i[f]+i[y]}return u}();function pe(i){return typeof BigInt>"u"?Je:i}function Je(){throw new Error("BigInt not supported")}},645:(s,c)=>{c.read=function(p,h,v,_,w){var b,d,E=8*w-_-1,x=(1<<E)-1,I=x>>1,S=-7,T=v?w-1:0,P=v?-1:1,B=p[h+T];for(T+=P,b=B&(1<<-S)-1,B>>=-S,S+=E;S>0;b=256*b+p[h+T],T+=P,S-=8);for(d=b&(1<<-S)-1,b>>=-S,S+=_;S>0;d=256*d+p[h+T],T+=P,S-=8);if(b===0)b=1-I;else{if(b===x)return d?NaN:1/0*(B?-1:1);d+=Math.pow(2,_),b-=I}return(B?-1:1)*d*Math.pow(2,b-_)},c.write=function(p,h,v,_,w,b){var d,E,x,I=8*b-w-1,S=(1<<I)-1,T=S>>1,P=w===23?Math.pow(2,-24)-Math.pow(2,-77):0,B=_?0:b-1,D=_?1:-1,j=h<0||h===0&&1/h<0?1:0;for(h=Math.abs(h),isNaN(h)||h===1/0?(E=isNaN(h)?1:0,d=S):(d=Math.floor(Math.log(h)/Math.LN2),h*(x=Math.pow(2,-d))<1&&(d--,x*=2),(h+=d+T>=1?P/x:P*Math.pow(2,1-T))*x>=2&&(d++,x/=2),d+T>=S?(E=0,d=S):d+T>=1?(E=(h*x-1)*Math.pow(2,w),d+=T):(E=h*Math.pow(2,T-1)*Math.pow(2,w),d=0));w>=8;p[v+B]=255&E,B+=D,E/=256,w-=8);for(d=d<<w|E,I+=w;I>0;p[v+B]=255&d,B+=D,d/=256,I-=8);p[v+B-D]|=128*j}}},n={};function a(s){var c=n[s];if(c!==void 0)return c.exports;var p=n[s]={exports:{}};return t[s](p,p.exports,a),p.exports}return a.d=(s,c)=>{for(var p in c)a.o(c,p)&&!a.o(s,p)&&Object.defineProperty(s,p,{enumerable:!0,get:c[p]})},a.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),a.o=(s,c)=>Object.prototype.hasOwnProperty.call(s,c),a.r=s=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},a(899)})())})(Va);function c1(e){const r={variantId:Ie.Uint64.fromString(e.variantId.toString()),version:e.version||Math.floor(Date.now()/1e3),items:e.items.map(n=>new Ie.BundleItem({collectionId:Ie.Uint64.fromString(n.collectionId.toString()),productId:Ie.Uint64.fromString(n.productId.toString()),variantId:Ie.Uint64.fromString(n.variantId.toString()),sku:n.sku||"",quantity:n.quantity,ext:new Ie.BundleItemExt(0)})),ext:new Ie.BundleExt(0)},t=new Ie.Bundle(r);return Ie.BundleEnvelope.envelopeTypeBundle(t).toXDR("base64")}const Ie=Va.exports.config(e=>{e.enum("EnvelopeType",{envelopeTypeBundle:0}),e.typedef("Uint32",e.uint()),e.typedef("Uint64",e.uhyper()),e.union("BundleItemExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("BundleItem",[["collectionId",e.lookup("Uint64")],["productId",e.lookup("Uint64")],["variantId",e.lookup("Uint64")],["sku",e.string()],["quantity",e.lookup("Uint32")],["ext",e.lookup("BundleItemExt")]]),e.union("BundleExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("Bundle",[["variantId",e.lookup("Uint64")],["items",e.varArray(e.lookup("BundleItem"),500)],["version",e.lookup("Uint32")],["ext",e.lookup("BundleExt")]]),e.union("BundleEnvelope",{switchOn:e.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeBundle","v1"]],arms:{v1:e.lookup("Bundle")}})}),Ha="/bundling-storefront-manager";function f1(){return Math.ceil(Date.now()/1e3)}async function l1(){try{const{timestamp:e}=await Or("get",`${Ha}/t`,{headers:{"X-Recharge-App":"storefront-client"}});return e}catch(e){return console.error(`Fetch failed: ${e}. Using client-side date.`),f1()}}async function p1(e){const r=xe(),t=await Ya(e);if(t!==!0)throw new Error(t);const n=await l1(),a=c1({variantId:e.externalVariantId,version:n,items:e.selections.map(s=>({collectionId:s.collectionId,productId:s.externalProductId,variantId:s.externalVariantId,quantity:s.quantity,sku:""}))});try{const s=await Or("post",`${Ha}/api/v1/bundles`,{data:{bundle:a},headers:{Origin:`https://${r.storeIdentifier}`}});if(!s.id||s.code!==200)throw new Error(`1: failed generating rb_id: ${JSON.stringify(s)}`);return s.id}catch(s){throw new Error(`2: failed generating rb_id ${s}`)}}function h1(e,r){const t=Ka(e);if(t!==!0)throw new Error(`Dynamic Bundle is invalid. ${t}`);const n=`${Al(9)}:${e.externalProductId}`;return e.selections.map(a=>{const s={id:a.externalVariantId,quantity:a.quantity,properties:{_rc_bundle:n,_rc_bundle_variant:e.externalVariantId,_rc_bundle_parent:r,_rc_bundle_collection_id:a.collectionId}};return a.sellingPlan?s.selling_plan=a.sellingPlan:a.shippingIntervalFrequency&&(s.properties.shipping_interval_frequency=a.shippingIntervalFrequency,s.properties.shipping_interval_unit_type=a.shippingIntervalUnitType,s.id=`${a.discountedVariantId}`),s})}async function Ya(e){try{return e?await qa(e.externalProductId)?!0:"Bundle settings do not exist for the given product":"Bundle is not defined"}catch(r){return`Error fetching bundle settings: ${r}`}}const d1={day:["day","days","Days"],days:["day","days","Days"],Days:["day","days","Days"],week:["week","weeks","Weeks"],weeks:["week","weeks","Weeks"],Weeks:["week","weeks","Weeks"],month:["month","months","Months"],months:["month","months","Months"],Months:["month","months","Months"]};function Ka(e){if(!e)return"No bundle defined.";if(e.selections.length===0)return"No selections defined.";const{shippingIntervalFrequency:r,shippingIntervalUnitType:t}=e.selections.find(n=>n.shippingIntervalFrequency||n.shippingIntervalUnitType)||{};if(r||t){if(!r||!t)return"Shipping intervals do not match on selections.";{const n=d1[t];for(let a=0;a<e.selections.length;a++){const{shippingIntervalFrequency:s,shippingIntervalUnitType:c}=e.selections[a];if(s&&s!==r||c&&!n.includes(c))return"Shipping intervals do not match on selections."}}}return!0}async function y1(e,r){const{bundle_selection:t}=await O("get","/bundle_selections",{id:r},e);return t}function g1(e,r){return O("get","/bundle_selections",{query:r},e)}async function v1(e,r){const{bundle_selection:t}=await O("post","/bundle_selections",{data:r},e);return t}async function m1(e,r,t){const{bundle_selection:n}=await O("put","/bundle_selections",{id:r,data:t},e);return n}function _1(e,r){return O("delete","/bundle_selections",{id:r},e)}var w1=Object.freeze({__proto__:null,getBundleId:p1,getDynamicBundleItems:h1,validateBundle:Ya,validateDynamicBundle:Ka,getBundleSelection:y1,listBundleSelections:g1,createBundleSelection:v1,updateBundleSelection:m1,deleteBundleSelection:_1});async function b1(e,r,t){const{charge:n}=await O("get","/charges",{id:r,query:{include:t?.include}},e);return n}function $1(e,r){return O("get","/charges",{query:r},e)}async function A1(e,r,t){const{charge:n}=await O("post",`/charges/${r}/apply_discount`,{data:{discount_code:t}},e);return n}async function E1(e,r){const{charge:t}=await O("post",`/charges/${r}/remove_discount`,{},e);return t}async function S1(e,r,t){const{charge:n}=await O("post",`/charges/${r}/skip`,{data:{purchase_item_ids:t.map(a=>Number(a))}},e);return n}async function x1(e,r,t){const{charge:n}=await O("post",`/charges/${r}/unskip`,{data:{purchase_item_ids:t.map(a=>Number(a))}},e);return n}async function I1(e,r){const{charge:t}=await O("post",`/charges/${r}/process`,{},e);return t}var T1=Object.freeze({__proto__:null,getCharge:b1,listCharges:$1,applyDiscountToCharge:A1,removeDiscountsFromCharge:E1,skipCharge:S1,unskipCharge:x1,processCharge:I1});async function O1(e,r){const{membership:t}=await O("get","/memberships",{id:r},e);return t}function B1(e,r){return O("get","/memberships",{query:r},e)}async function P1(e,r,t){const{membership:n}=await O("post",`/memberships/${r}/cancel`,{data:t},e);return n}async function R1(e,r,t){const{membership:n}=await O("post",`/memberships/${r}/activate`,{data:t},e);return n}async function F1(e,r,t){const{membership:n}=await O("post",`/memberships/${r}/change`,{data:t},e);return n}var C1=Object.freeze({__proto__:null,getMembership:O1,listMemberships:B1,cancelMembership:P1,activateMembership:R1,changeMembership:F1});async function U1(e,r,t){const{membership_program:n}=await O("get","/membership_programs",{id:r,query:{include:t?.include}},e);return n}function D1(e,r){return O("get","/membership_programs",{query:r},e)}var N1=Object.freeze({__proto__:null,getMembershipProgram:U1,listMembershipPrograms:D1});async function M1(e,r){const{metafield:t}=await O("post","/metafields",{data:{metafield:r}},e);return t}async function L1(e,r,t){const{metafield:n}=await O("put","/metafields",{id:r,data:{metafield:t}},e);return n}function j1(e,r){return O("delete","/metafields",{id:r},e)}var k1=Object.freeze({__proto__:null,createMetafield:M1,updateMetafield:L1,deleteMetafield:j1});async function G1(e,r){const{onetime:t}=await O("get","/onetimes",{id:r},e);return t}function W1(e,r){return O("get","/onetimes",{query:r},e)}async function q1(e,r){const{onetime:t}=await O("post","/onetimes",{data:r},e);return t}async function z1(e,r,t){const{onetime:n}=await O("put","/onetimes",{id:r,data:t},e);return n}function V1(e,r){return O("delete","/onetimes",{id:r},e)}var H1=Object.freeze({__proto__:null,getOnetime:G1,listOnetimes:W1,createOnetime:q1,updateOnetime:z1,deleteOnetime:V1});async function Y1(e,r){const{order:t}=await O("get","/orders",{id:r},e);return t}function K1(e,r){return O("get","/orders",{query:r},e)}var X1=Object.freeze({__proto__:null,getOrder:Y1,listOrders:K1});async function J1(e,r,t){const{payment_method:n}=await O("get","/payment_methods",{id:r,query:{include:t?.include}},e);return n}async function Q1(e,r,t){const{payment_method:n}=await O("put","/payment_methods",{id:r,data:t},e);return n}function Z1(e,r){return O("get","/payment_methods",{query:r},e)}var eb=Object.freeze({__proto__:null,getPaymentMethod:J1,updatePaymentMethod:Q1,listPaymentMethods:Z1});async function rb(e,r){const{plan:t}=await O("get","/plans",{id:r},e);return t}function tb(e,r){return O("get","/plans",{query:r},e)}var nb=Object.freeze({__proto__:null,getPlan:rb,listPlans:tb}),ib=jn,ob=Oa,ab=kn;function sb(e,r){return ab(ob(e,r,ib),e+"")}var ub=sb,Xa=Zo,cb=Xa&&new Xa,Ja=cb,fb=jn,Qa=Ja,lb=Qa?function(e,r){return Qa.set(e,r),e}:fb,Za=lb,pb=yt,hb=Ye;function db(e){return function(){var r=arguments;switch(r.length){case 0:return new e;case 1:return new e(r[0]);case 2:return new e(r[0],r[1]);case 3:return new e(r[0],r[1],r[2]);case 4:return new e(r[0],r[1],r[2],r[3]);case 5:return new e(r[0],r[1],r[2],r[3],r[4]);case 6:return new e(r[0],r[1],r[2],r[3],r[4],r[5]);case 7:return new e(r[0],r[1],r[2],r[3],r[4],r[5],r[6])}var t=pb(e.prototype),n=e.apply(t,r);return hb(n)?n:t}}var wt=db,yb=wt,gb=oe,vb=1;function mb(e,r,t){var n=r&vb,a=yb(e);function s(){var c=this&&this!==gb&&this instanceof s?a:e;return c.apply(n?t:this,arguments)}return s}var _b=mb,wb=Math.max;function bb(e,r,t,n){for(var a=-1,s=e.length,c=t.length,p=-1,h=r.length,v=wb(s-c,0),_=Array(h+v),w=!n;++p<h;)_[p]=r[p];for(;++a<c;)(w||a<s)&&(_[t[a]]=e[a]);for(;v--;)_[p++]=e[a++];return _}var es=bb,$b=Math.max;function Ab(e,r,t,n){for(var a=-1,s=e.length,c=-1,p=t.length,h=-1,v=r.length,_=$b(s-p,0),w=Array(_+v),b=!n;++a<_;)w[a]=e[a];for(var d=a;++h<v;)w[d+h]=r[h];for(;++c<p;)(b||a<s)&&(w[d+t[c]]=e[a++]);return w}var rs=Ab;function Eb(e,r){for(var t=e.length,n=0;t--;)e[t]===r&&++n;return n}var Sb=Eb;function xb(){}var qn=xb,Ib=yt,Tb=qn,Ob=4294967295;function bt(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ob,this.__views__=[]}bt.prototype=Ib(Tb.prototype),bt.prototype.constructor=bt;var zn=bt;function Bb(){}var Pb=Bb,ts=Ja,Rb=Pb,Fb=ts?function(e){return ts.get(e)}:Rb,ns=Fb,Cb={},Ub=Cb,is=Ub,Db=Object.prototype,Nb=Db.hasOwnProperty;function Mb(e){for(var r=e.name+"",t=is[r],n=Nb.call(is,r)?t.length:0;n--;){var a=t[n],s=a.func;if(s==null||s==e)return a.name}return r}var Lb=Mb,jb=yt,kb=qn;function $t(e,r){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!r,this.__index__=0,this.__values__=void 0}$t.prototype=jb(kb.prototype),$t.prototype.constructor=$t;var os=$t,Gb=zn,Wb=os,qb=xn;function zb(e){if(e instanceof Gb)return e.clone();var r=new Wb(e.__wrapped__,e.__chain__);return r.__actions__=qb(e.__actions__),r.__index__=e.__index__,r.__values__=e.__values__,r}var Vb=zb,Hb=zn,as=os,Yb=qn,Kb=De,Xb=Ue,Jb=Vb,Qb=Object.prototype,Zb=Qb.hasOwnProperty;function At(e){if(Xb(e)&&!Kb(e)&&!(e instanceof Hb)){if(e instanceof as)return e;if(Zb.call(e,"__wrapped__"))return Jb(e)}return new as(e)}At.prototype=Yb.prototype,At.prototype.constructor=At;var e$=At,r$=zn,t$=ns,n$=Lb,i$=e$;function o$(e){var r=n$(e),t=i$[r];if(typeof t!="function"||!(r in r$.prototype))return!1;if(e===t)return!0;var n=t$(t);return!!n&&e===n[0]}var a$=o$,s$=Za,u$=Pa,c$=u$(s$),ss=c$,f$=/\{\n\/\* \[wrapped with (.+)\] \*/,l$=/,? & /;function p$(e){var r=e.match(f$);return r?r[1].split(l$):[]}var h$=p$,d$=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function y$(e,r){var t=r.length;if(!t)return e;var n=t-1;return r[n]=(t>1?"& ":"")+r[n],r=r.join(t>2?", ":" "),e.replace(d$,`{
|
|
21
21
|
/* [wrapped with `+r+`] */
|
|
22
|
-
`)}var f$=c$;function l$(e,r,t,n){for(var a=e.length,s=t+(n?1:-1);n?s--:++s<a;)if(r(e[s],s,e))return s;return-1}var p$=l$;function h$(e){return e!==e}var d$=h$;function y$(e,r,t){for(var n=t-1,a=e.length;++n<a;)if(e[n]===r)return n;return-1}var g$=y$,v$=p$,m$=d$,_$=g$;function w$(e,r,t){return r===r?_$(e,r,t):v$(e,m$,t)}var b$=w$,$$=b$;function A$(e,r){var t=e==null?0:e.length;return!!t&&$$(e,r,0)>-1}var E$=A$,S$=Po,x$=E$,I$=1,T$=2,O$=8,B$=16,P$=32,R$=64,F$=128,C$=256,U$=512,D$=[["ary",F$],["bind",I$],["bindKey",T$],["curry",O$],["curryRight",B$],["flip",U$],["partial",P$],["partialRight",R$],["rearg",C$]];function N$(e,r){return S$(D$,function(t){var n="_."+t[0];r&t[1]&&!x$(e,n)&&e.push(n)}),e.sort()}var M$=N$,L$=s$,j$=f$,k$=kn,G$=M$;function W$(e,r,t){var n=r+"";return k$(e,j$(n,G$(L$(n),t)))}var as=W$,q$=e$,z$=os,V$=as,H$=1,Y$=2,K$=4,X$=8,ss=32,us=64;function J$(e,r,t,n,a,s,c,p,h,v){var _=r&X$,w=_?c:void 0,b=_?void 0:c,d=_?s:void 0,E=_?void 0:s;r|=_?ss:us,r&=~(_?us:ss),r&K$||(r&=~(H$|Y$));var x=[e,r,a,d,w,E,b,p,h,v],I=t.apply(void 0,x);return q$(e)&&z$(I,x),I.placeholder=n,V$(I,e,r)}var cs=J$;function Q$(e){var r=e;return r.placeholder}var Vn=Q$,Z$=xn,eA=Lo,rA=Math.min;function tA(e,r){for(var t=e.length,n=rA(r.length,t),a=Z$(e);n--;){var s=r[n];e[n]=eA(s,t)?a[s]:void 0}return e}var nA=tA,fs="__lodash_placeholder__";function iA(e,r){for(var t=-1,n=e.length,a=0,s=[];++t<n;){var c=e[t];(c===r||c===fs)&&(e[t]=fs,s[a++]=t)}return s}var Et=iA,oA=Qa,aA=Za,sA=_b,ls=wt,uA=cs,cA=Vn,fA=nA,lA=Et,pA=oe,hA=1,dA=2,yA=8,gA=16,vA=128,mA=512;function ps(e,r,t,n,a,s,c,p,h,v){var _=r&vA,w=r&hA,b=r&dA,d=r&(yA|gA),E=r&mA,x=b?void 0:ls(e);function I(){for(var S=arguments.length,T=Array(S),P=S;P--;)T[P]=arguments[P];if(d)var B=cA(I),D=sA(T,B);if(n&&(T=oA(T,n,a,d)),s&&(T=aA(T,s,c,d)),S-=D,d&&S<v){var j=lA(T,B);return uA(e,r,ps,I.placeholder,t,T,j,p,h,v-S)}var q=w?t:this,z=b?q[e]:e;return S=T.length,p?T=fA(T,p):E&&S>1&&T.reverse(),_&&h<S&&(T.length=h),this&&this!==pA&&this instanceof I&&(z=x||ls(z)),z.apply(q,T)}return I}var hs=ps,_A=Ln,wA=wt,bA=hs,$A=cs,AA=Vn,EA=Et,SA=oe;function xA(e,r,t){var n=wA(e);function a(){for(var s=arguments.length,c=Array(s),p=s,h=AA(a);p--;)c[p]=arguments[p];var v=s<3&&c[0]!==h&&c[s-1]!==h?[]:EA(c,h);if(s-=v.length,s<t)return $A(e,r,bA,a.placeholder,void 0,c,v,void 0,void 0,t-s);var _=this&&this!==SA&&this instanceof a?n:e;return _A(_,this,c)}return a}var IA=xA,TA=Ln,OA=wt,BA=oe,PA=1;function RA(e,r,t,n){var a=r&PA,s=OA(e);function c(){for(var p=-1,h=arguments.length,v=-1,_=n.length,w=Array(_+h),b=this&&this!==BA&&this instanceof c?s:e;++v<_;)w[v]=n[v];for(;h--;)w[v++]=arguments[++p];return TA(b,a?t:this,w)}return c}var FA=RA,CA=Qa,UA=Za,ds=Et,ys="__lodash_placeholder__",Hn=1,DA=2,NA=4,gs=8,Ur=128,vs=256,MA=Math.min;function LA(e,r){var t=e[1],n=r[1],a=t|n,s=a<(Hn|DA|Ur),c=n==Ur&&t==gs||n==Ur&&t==vs&&e[7].length<=r[8]||n==(Ur|vs)&&r[7].length<=r[8]&&t==gs;if(!(s||c))return e;n&Hn&&(e[2]=r[2],a|=t&Hn?0:NA);var p=r[3];if(p){var h=e[3];e[3]=h?CA(h,p,r[4]):p,e[4]=h?ds(e[3],ys):r[4]}return p=r[5],p&&(h=e[5],e[5]=h?UA(h,p,r[6]):p,e[6]=h?ds(e[5],ys):r[6]),p=r[7],p&&(e[7]=p),n&Ur&&(e[8]=e[8]==null?r[8]:MA(e[8],r[8])),e[9]==null&&(e[9]=r[9]),e[0]=r[0],e[1]=a,e}var jA=LA,kA=/\s/;function GA(e){for(var r=e.length;r--&&kA.test(e.charAt(r)););return r}var WA=GA,qA=WA,zA=/^\s+/;function VA(e){return e&&e.slice(0,qA(e)+1).replace(zA,"")}var HA=VA,YA=HA,ms=Ye,KA=vt,_s=0/0,XA=/^[-+]0x[0-9a-f]+$/i,JA=/^0b[01]+$/i,QA=/^0o[0-7]+$/i,ZA=parseInt;function e2(e){if(typeof e=="number")return e;if(KA(e))return _s;if(ms(e)){var r=typeof e.valueOf=="function"?e.valueOf():e;e=ms(r)?r+"":r}if(typeof e!="string")return e===0?e:+e;e=YA(e);var t=JA.test(e);return t||QA.test(e)?ZA(e.slice(2),t?2:8):XA.test(e)?_s:+e}var r2=e2,t2=r2,ws=1/0,n2=17976931348623157e292;function i2(e){if(!e)return e===0?e:0;if(e=t2(e),e===ws||e===-ws){var r=e<0?-1:1;return r*n2}return e===e?e:0}var o2=i2,a2=o2;function s2(e){var r=a2(e),t=r%1;return r===r?t?r-t:r:0}var u2=s2,c2=Ja,f2=hb,l2=IA,p2=hs,h2=FA,d2=rs,y2=jA,g2=os,v2=as,bs=u2,m2="Expected a function",$s=1,_2=2,Yn=8,Kn=16,Xn=32,As=64,Es=Math.max;function w2(e,r,t,n,a,s,c,p){var h=r&_2;if(!h&&typeof e!="function")throw new TypeError(m2);var v=n?n.length:0;if(v||(r&=~(Xn|As),n=a=void 0),c=c===void 0?c:Es(bs(c),0),p=p===void 0?p:bs(p),v-=a?a.length:0,r&As){var _=n,w=a;n=a=void 0}var b=h?void 0:d2(e),d=[e,r,t,n,a,_,w,s,c,p];if(b&&y2(d,b),e=d[0],r=d[1],t=d[2],n=d[3],a=d[4],p=d[9]=d[9]===void 0?h?0:e.length:Es(d[9]-v,0),!p&&r&(Yn|Kn)&&(r&=~(Yn|Kn)),!r||r==$s)var E=f2(e,r,t);else r==Yn||r==Kn?E=l2(e,r,p):(r==Xn||r==($s|Xn))&&!a.length?E=h2(e,r,t,n):E=p2.apply(void 0,d);var x=b?c2:g2;return v2(x(E,d),e,r)}var b2=w2,$2=tb,A2=b2,E2=Vn,S2=Et,x2=32,Jn=$2(function(e,r){var t=S2(r,E2(Jn));return A2(e,x2,void 0,r,t)});Jn.placeholder={};var Ss=Jn,I2=Object.defineProperty,T2=Object.defineProperties,O2=Object.getOwnPropertyDescriptors,xs=Object.getOwnPropertySymbols,B2=Object.prototype.hasOwnProperty,P2=Object.prototype.propertyIsEnumerable,Is=(e,r,t)=>r in e?I2(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Ts=(e,r)=>{for(var t in r||(r={}))B2.call(r,t)&&Is(e,t,r[t]);if(xs)for(var t of xs(r))P2.call(r,t)&&Is(e,t,r[t]);return e},Os=(e,r)=>T2(e,O2(r));function R2(e,r){return Os(Ts({},Gn(r,["address_id","external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","status"])),{customer_id:parseInt(e,10),shopify_variant_id:r.external_variant_id.ecommerce?parseInt(r.external_variant_id.ecommerce,10):void 0,charge_interval_frequency:`${r.charge_interval_frequency}`,order_interval_frequency:`${r.order_interval_frequency}`,status:r.status?r.status.toUpperCase():void 0})}function F2(e,r){var t;return Os(Ts({},Gn(r,["external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","use_external_variant_defaults"])),{shopify_variant_id:(t=r.external_variant_id)!=null&&t.ecommerce?parseInt(r.external_variant_id.ecommerce,10):void 0,charge_interval_frequency:r.charge_interval_frequency?`${r.charge_interval_frequency}`:void 0,order_interval_frequency:r.order_interval_frequency?`${r.order_interval_frequency}`:void 0,force_update:e})}function Bs(e){const{id:r,address_id:t,customer_id:n,analytics_data:a,cancellation_reason:s,cancellation_reason_comments:c,cancelled_at:p,charge_interval_frequency:h,created_at:v,expire_after_specific_number_of_charges:_,shopify_product_id:w,shopify_variant_id:b,has_queued_charges:d,is_prepaid:E,is_skippable:x,is_swappable:I,max_retries_reached:S,next_charge_scheduled_at:T,order_day_of_month:P,order_day_of_week:B,order_interval_frequency:D,order_interval_unit:j,presentment_currency:q,price:z,product_title:X,properties:V,quantity:ae,sku:ue,sku_override:k,status:re,updated_at:N,variant_title:ce}=e;return{id:r,address_id:t,customer_id:n,analytics_data:a,cancellation_reason:s,cancellation_reason_comments:c,cancelled_at:p,charge_interval_frequency:parseInt(h,10),created_at:v,expire_after_specific_number_of_charges:_,external_product_id:{ecommerce:`${w}`},external_variant_id:{ecommerce:`${b}`},has_queued_charges:Ra(d),is_prepaid:E,is_skippable:x,is_swappable:I,max_retries_reached:Ra(S),next_charge_scheduled_at:T,order_day_of_month:P,order_day_of_week:B,order_interval_frequency:parseInt(D,10),order_interval_unit:j,presentment_currency:q,price:`${z}`,product_title:X??"",properties:V,quantity:ae,sku:ue,sku_override:k,status:re.toLowerCase(),updated_at:N,variant_title:ce}}async function C2(e,r,t){const{subscription:n}=await O("get","/subscriptions",{id:r,query:{include:t?.include}},e);return n}function U2(e,r){return O("get","/subscriptions",{query:r},e)}async function D2(e,r,t){const{subscription:n}=await O("post","/subscriptions",{data:r,query:t},e);return n}async function N2(e,r,t,n){const{subscription:a}=await O("put","/subscriptions",{id:r,data:t,query:n},e);return a}async function M2(e,r,t,n){const{subscription:a}=await O("post",`/subscriptions/${r}/set_next_charge_date`,{data:{date:t},query:n},e);return a}async function L2(e,r,t){const{subscription:n}=await O("post",`/subscriptions/${r}/change_address`,{data:{address_id:t}},e);return n}async function j2(e,r,t,n){const{subscription:a}=await O("post",`/subscriptions/${r}/cancel`,{data:t,query:n},e);return a}async function k2(e,r,t){const{subscription:n}=await O("post",`/subscriptions/${r}/activate`,{query:t},e);return n}async function G2(e,r,t){const{charge:n}=await O("post",`/subscriptions/${r}/charges/skip`,{data:{date:t,subscription_id:`${r}`}},e);return n}async function W2(e,r){const t=r.length;if(t<1||t>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:n}=e;if(!n)throw new Error("No customerId in session.");const a=r[0].address_id;if(!r.every(h=>h.address_id===a))throw new Error("All subscriptions must have the same address_id.");const s=Ss(R2,n),c=r.map(s),{subscriptions:p}=await O("post",`/addresses/${a}/subscriptions-bulk`,{data:{subscriptions:c},headers:{"X-Recharge-Version":"2021-01"}},e);return p.map(Bs)}async function q2(e,r,t,n){const a=t.length;if(a<1||a>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:s}=e;if(!s)throw new Error("No customerId in session.");const c=Ss(F2,!!(n!=null&&n.force_update)),p=t.map(c),{subscriptions:h}=await O("put",`/addresses/${r}/subscriptions-bulk`,{data:{subscriptions:p},headers:{"X-Recharge-Version":"2021-01"}},e);return h.map(Bs)}var z2=Object.freeze({__proto__:null,getSubscription:C2,listSubscriptions:U2,createSubscription:D2,updateSubscription:N2,updateSubscriptionChargeDate:M2,updateSubscriptionAddress:L2,cancelSubscription:j2,activateSubscription:k2,skipSubscriptionCharge:G2,createSubscriptions:W2,updateSubscriptions:q2});async function V2(e,r){const t=e.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await O("get","/customers",{id:t,query:{include:r?.include}},e);return n}async function H2(e,r){const t=e.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await O("put","/customers",{id:t,data:r},e);return n}async function Y2(e,r){const t=e.customerId;if(!t)throw new Error("Not logged in.");const{deliveries:n}=await O("get",`/customers/${t}/delivery_schedule`,{query:r},e);return n}async function K2(e){return await O("get","/portal_access",{},e)}var X2=Object.freeze({__proto__:null,getCustomer:V2,updateCustomer:H2,getDeliverySchedule:Y2,getCustomerPortalAccess:K2});const J2={get(e,r){return he("get",e,r)},post(e,r){return he("post",e,r)},put(e,r){return he("put",e,r)},delete(e,r){return he("delete",e,r)}};function Q2(e){var r,t;if(e)return e;if((r=window?.Shopify)!=null&&r.shop)return window.Shopify.shop;let n=window?.domain;if(!n){const a=(t=location?.href.match(/(?:http[s]*:\/\/)*(.*?)\.(?=admin\.rechargeapps\.com)/i))==null?void 0:t[1].replace(/-sp$/,"");a&&(n=`${a}.myshopify.com`)}if(n)return n;throw new Error("No storeIdentifier was passed into init.")}function Z2(e={}){const r=e,{storefrontAccessToken:t}=e;if(t&&!t.startsWith("strfnt"))throw new Error("Incorrect storefront access token used. See https://storefront.rechargepayments.com/client/docs/getting_started/package_setup/#initialization-- for more information.");kf({storeIdentifier:Q2(e.storeIdentifier),loginRetryFn:e.loginRetryFn,storefrontAccessToken:t,environment:r.environment?r.environment:"prod"}),Wa()}const Ps={init:Z2,api:J2,address:al,auth:gl,bundle:d1,charge:$1,cdn:t1,customer:X2,membership:T1,membershipProgram:P1,metafield:U1,onetime:k1,order:q1,paymentMethod:Y1,plan:J1,subscription:z2};try{Ps.init()}catch{}return Ps});
|
|
22
|
+
`)}var g$=y$;function v$(e,r,t,n){for(var a=e.length,s=t+(n?1:-1);n?s--:++s<a;)if(r(e[s],s,e))return s;return-1}var m$=v$;function _$(e){return e!==e}var w$=_$;function b$(e,r,t){for(var n=t-1,a=e.length;++n<a;)if(e[n]===r)return n;return-1}var $$=b$,A$=m$,E$=w$,S$=$$;function x$(e,r,t){return r===r?S$(e,r,t):A$(e,E$,t)}var I$=x$,T$=I$;function O$(e,r){var t=e==null?0:e.length;return!!t&&T$(e,r,0)>-1}var B$=O$,P$=Fo,R$=B$,F$=1,C$=2,U$=8,D$=16,N$=32,M$=64,L$=128,j$=256,k$=512,G$=[["ary",L$],["bind",F$],["bindKey",C$],["curry",U$],["curryRight",D$],["flip",k$],["partial",N$],["partialRight",M$],["rearg",j$]];function W$(e,r){return P$(G$,function(t){var n="_."+t[0];r&t[1]&&!R$(e,n)&&e.push(n)}),e.sort()}var q$=W$,z$=h$,V$=g$,H$=kn,Y$=q$;function K$(e,r,t){var n=r+"";return H$(e,V$(n,Y$(z$(n),t)))}var us=K$,X$=a$,J$=ss,Q$=us,Z$=1,eA=2,rA=4,tA=8,cs=32,fs=64;function nA(e,r,t,n,a,s,c,p,h,v){var _=r&tA,w=_?c:void 0,b=_?void 0:c,d=_?s:void 0,E=_?void 0:s;r|=_?cs:fs,r&=~(_?fs:cs),r&rA||(r&=~(Z$|eA));var x=[e,r,a,d,w,E,b,p,h,v],I=t.apply(void 0,x);return X$(e)&&J$(I,x),I.placeholder=n,Q$(I,e,r)}var ls=nA;function iA(e){var r=e;return r.placeholder}var Vn=iA,oA=xn,aA=ko,sA=Math.min;function uA(e,r){for(var t=e.length,n=sA(r.length,t),a=oA(e);n--;){var s=r[n];e[n]=aA(s,t)?a[s]:void 0}return e}var cA=uA,ps="__lodash_placeholder__";function fA(e,r){for(var t=-1,n=e.length,a=0,s=[];++t<n;){var c=e[t];(c===r||c===ps)&&(e[t]=ps,s[a++]=t)}return s}var Et=fA,lA=es,pA=rs,hA=Sb,hs=wt,dA=ls,yA=Vn,gA=cA,vA=Et,mA=oe,_A=1,wA=2,bA=8,$A=16,AA=128,EA=512;function ds(e,r,t,n,a,s,c,p,h,v){var _=r&AA,w=r&_A,b=r&wA,d=r&(bA|$A),E=r&EA,x=b?void 0:hs(e);function I(){for(var S=arguments.length,T=Array(S),P=S;P--;)T[P]=arguments[P];if(d)var B=yA(I),D=hA(T,B);if(n&&(T=lA(T,n,a,d)),s&&(T=pA(T,s,c,d)),S-=D,d&&S<v){var j=vA(T,B);return dA(e,r,ds,I.placeholder,t,T,j,p,h,v-S)}var q=w?t:this,z=b?q[e]:e;return S=T.length,p?T=gA(T,p):E&&S>1&&T.reverse(),_&&h<S&&(T.length=h),this&&this!==mA&&this instanceof I&&(z=x||hs(z)),z.apply(q,T)}return I}var ys=ds,SA=Ln,xA=wt,IA=ys,TA=ls,OA=Vn,BA=Et,PA=oe;function RA(e,r,t){var n=xA(e);function a(){for(var s=arguments.length,c=Array(s),p=s,h=OA(a);p--;)c[p]=arguments[p];var v=s<3&&c[0]!==h&&c[s-1]!==h?[]:BA(c,h);if(s-=v.length,s<t)return TA(e,r,IA,a.placeholder,void 0,c,v,void 0,void 0,t-s);var _=this&&this!==PA&&this instanceof a?n:e;return SA(_,this,c)}return a}var FA=RA,CA=Ln,UA=wt,DA=oe,NA=1;function MA(e,r,t,n){var a=r&NA,s=UA(e);function c(){for(var p=-1,h=arguments.length,v=-1,_=n.length,w=Array(_+h),b=this&&this!==DA&&this instanceof c?s:e;++v<_;)w[v]=n[v];for(;h--;)w[v++]=arguments[++p];return CA(b,a?t:this,w)}return c}var LA=MA,jA=es,kA=rs,gs=Et,vs="__lodash_placeholder__",Hn=1,GA=2,WA=4,ms=8,Ur=128,_s=256,qA=Math.min;function zA(e,r){var t=e[1],n=r[1],a=t|n,s=a<(Hn|GA|Ur),c=n==Ur&&t==ms||n==Ur&&t==_s&&e[7].length<=r[8]||n==(Ur|_s)&&r[7].length<=r[8]&&t==ms;if(!(s||c))return e;n&Hn&&(e[2]=r[2],a|=t&Hn?0:WA);var p=r[3];if(p){var h=e[3];e[3]=h?jA(h,p,r[4]):p,e[4]=h?gs(e[3],vs):r[4]}return p=r[5],p&&(h=e[5],e[5]=h?kA(h,p,r[6]):p,e[6]=h?gs(e[5],vs):r[6]),p=r[7],p&&(e[7]=p),n&Ur&&(e[8]=e[8]==null?r[8]:qA(e[8],r[8])),e[9]==null&&(e[9]=r[9]),e[0]=r[0],e[1]=a,e}var VA=zA,HA=/\s/;function YA(e){for(var r=e.length;r--&&HA.test(e.charAt(r)););return r}var KA=YA,XA=KA,JA=/^\s+/;function QA(e){return e&&e.slice(0,XA(e)+1).replace(JA,"")}var ZA=QA,e2=ZA,ws=Ye,r2=vt,bs=0/0,t2=/^[-+]0x[0-9a-f]+$/i,n2=/^0b[01]+$/i,i2=/^0o[0-7]+$/i,o2=parseInt;function a2(e){if(typeof e=="number")return e;if(r2(e))return bs;if(ws(e)){var r=typeof e.valueOf=="function"?e.valueOf():e;e=ws(r)?r+"":r}if(typeof e!="string")return e===0?e:+e;e=e2(e);var t=n2.test(e);return t||i2.test(e)?o2(e.slice(2),t?2:8):t2.test(e)?bs:+e}var s2=a2,u2=s2,$s=1/0,c2=17976931348623157e292;function f2(e){if(!e)return e===0?e:0;if(e=u2(e),e===$s||e===-$s){var r=e<0?-1:1;return r*c2}return e===e?e:0}var l2=f2,p2=l2;function h2(e){var r=p2(e),t=r%1;return r===r?t?r-t:r:0}var d2=h2,y2=Za,g2=_b,v2=FA,m2=ys,_2=LA,w2=ns,b2=VA,$2=ss,A2=us,As=d2,E2="Expected a function",Es=1,S2=2,Yn=8,Kn=16,Xn=32,Ss=64,xs=Math.max;function x2(e,r,t,n,a,s,c,p){var h=r&S2;if(!h&&typeof e!="function")throw new TypeError(E2);var v=n?n.length:0;if(v||(r&=~(Xn|Ss),n=a=void 0),c=c===void 0?c:xs(As(c),0),p=p===void 0?p:As(p),v-=a?a.length:0,r&Ss){var _=n,w=a;n=a=void 0}var b=h?void 0:w2(e),d=[e,r,t,n,a,_,w,s,c,p];if(b&&b2(d,b),e=d[0],r=d[1],t=d[2],n=d[3],a=d[4],p=d[9]=d[9]===void 0?h?0:e.length:xs(d[9]-v,0),!p&&r&(Yn|Kn)&&(r&=~(Yn|Kn)),!r||r==Es)var E=g2(e,r,t);else r==Yn||r==Kn?E=v2(e,r,p):(r==Xn||r==(Es|Xn))&&!a.length?E=_2(e,r,t,n):E=m2.apply(void 0,d);var x=b?y2:$2;return A2(x(E,d),e,r)}var I2=x2,T2=ub,O2=I2,B2=Vn,P2=Et,R2=32,Jn=T2(function(e,r){var t=P2(r,B2(Jn));return O2(e,R2,void 0,r,t)});Jn.placeholder={};var Is=Jn,F2=Object.defineProperty,C2=Object.defineProperties,U2=Object.getOwnPropertyDescriptors,Ts=Object.getOwnPropertySymbols,D2=Object.prototype.hasOwnProperty,N2=Object.prototype.propertyIsEnumerable,Os=(e,r,t)=>r in e?F2(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Bs=(e,r)=>{for(var t in r||(r={}))D2.call(r,t)&&Os(e,t,r[t]);if(Ts)for(var t of Ts(r))N2.call(r,t)&&Os(e,t,r[t]);return e},Ps=(e,r)=>C2(e,U2(r));function M2(e,r){return Ps(Bs({},Gn(r,["address_id","external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","status"])),{customer_id:parseInt(e,10),shopify_variant_id:r.external_variant_id.ecommerce?parseInt(r.external_variant_id.ecommerce,10):void 0,charge_interval_frequency:`${r.charge_interval_frequency}`,order_interval_frequency:`${r.order_interval_frequency}`,status:r.status?r.status.toUpperCase():void 0})}function L2(e,r){var t;return Ps(Bs({},Gn(r,["external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","use_external_variant_defaults"])),{shopify_variant_id:(t=r.external_variant_id)!=null&&t.ecommerce?parseInt(r.external_variant_id.ecommerce,10):void 0,charge_interval_frequency:r.charge_interval_frequency?`${r.charge_interval_frequency}`:void 0,order_interval_frequency:r.order_interval_frequency?`${r.order_interval_frequency}`:void 0,force_update:e})}function Rs(e){const{id:r,address_id:t,customer_id:n,analytics_data:a,cancellation_reason:s,cancellation_reason_comments:c,cancelled_at:p,charge_interval_frequency:h,created_at:v,expire_after_specific_number_of_charges:_,shopify_product_id:w,shopify_variant_id:b,has_queued_charges:d,is_prepaid:E,is_skippable:x,is_swappable:I,max_retries_reached:S,next_charge_scheduled_at:T,order_day_of_month:P,order_day_of_week:B,order_interval_frequency:D,order_interval_unit:j,presentment_currency:q,price:z,product_title:X,properties:V,quantity:ae,sku:ue,sku_override:k,status:re,updated_at:N,variant_title:ce}=e;return{id:r,address_id:t,customer_id:n,analytics_data:a,cancellation_reason:s,cancellation_reason_comments:c,cancelled_at:p,charge_interval_frequency:parseInt(h,10),created_at:v,expire_after_specific_number_of_charges:_,external_product_id:{ecommerce:`${w}`},external_variant_id:{ecommerce:`${b}`},has_queued_charges:Ca(d),is_prepaid:E,is_skippable:x,is_swappable:I,max_retries_reached:Ca(S),next_charge_scheduled_at:T,order_day_of_month:P,order_day_of_week:B,order_interval_frequency:parseInt(D,10),order_interval_unit:j,presentment_currency:q,price:`${z}`,product_title:X??"",properties:V,quantity:ae,sku:ue,sku_override:k,status:re.toLowerCase(),updated_at:N,variant_title:ce}}async function j2(e,r,t){const{subscription:n}=await O("get","/subscriptions",{id:r,query:{include:t?.include}},e);return n}function k2(e,r){return O("get","/subscriptions",{query:r},e)}async function G2(e,r,t){const{subscription:n}=await O("post","/subscriptions",{data:r,query:t},e);return n}async function W2(e,r,t,n){const{subscription:a}=await O("put","/subscriptions",{id:r,data:t,query:n},e);return a}async function q2(e,r,t,n){const{subscription:a}=await O("post",`/subscriptions/${r}/set_next_charge_date`,{data:{date:t},query:n},e);return a}async function z2(e,r,t){const{subscription:n}=await O("post",`/subscriptions/${r}/change_address`,{data:{address_id:t}},e);return n}async function V2(e,r,t,n){const{subscription:a}=await O("post",`/subscriptions/${r}/cancel`,{data:t,query:n},e);return a}async function H2(e,r,t){const{subscription:n}=await O("post",`/subscriptions/${r}/activate`,{query:t},e);return n}async function Y2(e,r,t){const{charge:n}=await O("post",`/subscriptions/${r}/charges/skip`,{data:{date:t,subscription_id:`${r}`}},e);return n}async function K2(e,r){const t=r.length;if(t<1||t>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:n}=e;if(!n)throw new Error("No customerId in session.");const a=r[0].address_id;if(!r.every(h=>h.address_id===a))throw new Error("All subscriptions must have the same address_id.");const s=Is(M2,n),c=r.map(s),{subscriptions:p}=await O("post",`/addresses/${a}/subscriptions-bulk`,{data:{subscriptions:c},headers:{"X-Recharge-Version":"2021-01"}},e);return p.map(Rs)}async function X2(e,r,t,n){const a=t.length;if(a<1||a>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:s}=e;if(!s)throw new Error("No customerId in session.");const c=Is(L2,!!(n!=null&&n.force_update)),p=t.map(c),{subscriptions:h}=await O("put",`/addresses/${r}/subscriptions-bulk`,{data:{subscriptions:p},headers:{"X-Recharge-Version":"2021-01"}},e);return h.map(Rs)}var J2=Object.freeze({__proto__:null,getSubscription:j2,listSubscriptions:k2,createSubscription:G2,updateSubscription:W2,updateSubscriptionChargeDate:q2,updateSubscriptionAddress:z2,cancelSubscription:V2,activateSubscription:H2,skipSubscriptionCharge:Y2,createSubscriptions:K2,updateSubscriptions:X2});async function Q2(e,r){const t=e.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await O("get","/customers",{id:t,query:{include:r?.include}},e);return n}async function Z2(e,r){const t=e.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await O("put","/customers",{id:t,data:r},e);return n}async function eE(e,r){const t=e.customerId;if(!t)throw new Error("Not logged in.");const{deliveries:n}=await O("get",`/customers/${t}/delivery_schedule`,{query:r},e);return n}async function rE(e){return await O("get","/portal_access",{},e)}var tE=Object.freeze({__proto__:null,getCustomer:Q2,updateCustomer:Z2,getDeliverySchedule:eE,getCustomerPortalAccess:rE});const nE={get(e,r){return he("get",e,r)},post(e,r){return he("post",e,r)},put(e,r){return he("put",e,r)},delete(e,r){return he("delete",e,r)}};function iE(e){var r,t;if(e)return e;if((r=window?.Shopify)!=null&&r.shop)return window.Shopify.shop;let n=window?.domain;if(!n){const a=(t=location?.href.match(/(?:http[s]*:\/\/)*(.*?)\.(?=admin\.rechargeapps\.com)/i))==null?void 0:t[1].replace(/-sp$/,"");a&&(n=`${a}.myshopify.com`)}if(n)return n;throw new Error("No storeIdentifier was passed into init.")}function oE(e={}){const r=e,{storefrontAccessToken:t}=e;if(t&&!t.startsWith("strfnt"))throw new Error("Incorrect storefront access token used. See https://storefront.rechargepayments.com/client/docs/getting_started/package_setup/#initialization-- for more information.");Wf({storeIdentifier:iE(e.storeIdentifier),loginRetryFn:e.loginRetryFn,storefrontAccessToken:t,environment:r.environment?r.environment:"prod"}),za()}const Fs={init:oE,api:nE,address:pl,auth:$l,bundle:w1,charge:T1,cdn:u1,customer:tE,membership:C1,membershipProgram:N1,metafield:k1,onetime:H1,order:X1,paymentMethod:eb,plan:nb,subscription:J2};try{Fs.init()}catch{}return Fs});
|