@rechargeapps/storefront-client 1.68.0 → 1.68.1

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,26 +1,26 @@
1
- // recharge-client-1.68.0.min.js | MIT License | © Recharge Inc.
2
- (function(U,be){typeof exports=="object"&&typeof module<"u"?module.exports=be():typeof define=="function"&&define.amd?define(be):(U=typeof globalThis<"u"?globalThis:U||self,U.recharge=be())})(this,function(){"use strict";var U=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function be(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function nf(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),t}var q=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof q<"u"&&q,H={searchParams:"URLSearchParams"in q,iterable:"Symbol"in q&&"iterator"in Symbol,blob:"FileReader"in q&&"Blob"in q&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in q,arrayBuffer:"ArrayBuffer"in q};function af(r){return r&&DataView.prototype.isPrototypeOf(r)}if(H.arrayBuffer)var of=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],sf=ArrayBuffer.isView||function(r){return r&&of.indexOf(Object.prototype.toString.call(r))>-1};function pr(r){if(typeof r!="string"&&(r=String(r)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(r)||r==="")throw new TypeError('Invalid character in header field name: "'+r+'"');return r.toLowerCase()}function an(r){return typeof r!="string"&&(r=String(r)),r}function on(r){var e={next:function(){var t=r.shift();return{done:t===void 0,value:t}}};return H.iterable&&(e[Symbol.iterator]=function(){return e}),e}function C(r){this.map={},r instanceof C?r.forEach(function(e,t){this.append(t,e)},this):Array.isArray(r)?r.forEach(function(e){this.append(e[0],e[1])},this):r&&Object.getOwnPropertyNames(r).forEach(function(e){this.append(e,r[e])},this)}C.prototype.append=function(r,e){r=pr(r),e=an(e);var t=this.map[r];this.map[r]=t?t+", "+e:e},C.prototype.delete=function(r){delete this.map[pr(r)]},C.prototype.get=function(r){return r=pr(r),this.has(r)?this.map[r]:null},C.prototype.has=function(r){return this.map.hasOwnProperty(pr(r))},C.prototype.set=function(r,e){this.map[pr(r)]=an(e)},C.prototype.forEach=function(r,e){for(var t in this.map)this.map.hasOwnProperty(t)&&r.call(e,this.map[t],t,this)},C.prototype.keys=function(){var r=[];return this.forEach(function(e,t){r.push(t)}),on(r)},C.prototype.values=function(){var r=[];return this.forEach(function(e){r.push(e)}),on(r)},C.prototype.entries=function(){var r=[];return this.forEach(function(e,t){r.push([t,e])}),on(r)},H.iterable&&(C.prototype[Symbol.iterator]=C.prototype.entries);function sn(r){if(r.bodyUsed)return Promise.reject(new TypeError("Already read"));r.bodyUsed=!0}function ji(r){return new Promise(function(e,t){r.onload=function(){e(r.result)},r.onerror=function(){t(r.error)}})}function uf(r){var e=new FileReader,t=ji(e);return e.readAsArrayBuffer(r),t}function ff(r){var e=new FileReader,t=ji(e);return e.readAsText(r),t}function cf(r){for(var e=new Uint8Array(r),t=new Array(e.length),n=0;n<e.length;n++)t[n]=String.fromCharCode(e[n]);return t.join("")}function Vi(r){if(r.slice)return r.slice(0);var e=new Uint8Array(r.byteLength);return e.set(new Uint8Array(r)),e.buffer}function Gi(){return this.bodyUsed=!1,this._initBody=function(r){this.bodyUsed=this.bodyUsed,this._bodyInit=r,r?typeof r=="string"?this._bodyText=r:H.blob&&Blob.prototype.isPrototypeOf(r)?this._bodyBlob=r:H.formData&&FormData.prototype.isPrototypeOf(r)?this._bodyFormData=r:H.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)?this._bodyText=r.toString():H.arrayBuffer&&H.blob&&af(r)?(this._bodyArrayBuffer=Vi(r.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):H.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(r)||sf(r))?this._bodyArrayBuffer=Vi(r):this._bodyText=r=Object.prototype.toString.call(r):this._bodyText="",this.headers.get("content-type")||(typeof r=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):H.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},H.blob&&(this.blob=function(){var r=sn(this);if(r)return r;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 r=sn(this);return r||(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(uf)}),this.text=function(){var r=sn(this);if(r)return r;if(this._bodyBlob)return ff(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(cf(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},H.formData&&(this.formData=function(){return this.text().then(pf)}),this.json=function(){return this.text().then(JSON.parse)},this}var lf=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function df(r){var e=r.toUpperCase();return lf.indexOf(e)>-1?e:r}function $e(r,e){if(!(this instanceof $e))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e=e||{};var t=e.body;if(r instanceof $e){if(r.bodyUsed)throw new TypeError("Already read");this.url=r.url,this.credentials=r.credentials,e.headers||(this.headers=new C(r.headers)),this.method=r.method,this.mode=r.mode,this.signal=r.signal,!t&&r._bodyInit!=null&&(t=r._bodyInit,r.bodyUsed=!0)}else this.url=String(r);if(this.credentials=e.credentials||this.credentials||"same-origin",(e.headers||!this.headers)&&(this.headers=new C(e.headers)),this.method=df(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.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")&&(e.cache==="no-store"||e.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var i=/\?/;this.url+=(i.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}$e.prototype.clone=function(){return new $e(this,{body:this._bodyInit})};function pf(r){var e=new FormData;return r.trim().split("&").forEach(function(t){if(t){var n=t.split("="),i=n.shift().replace(/\+/g," "),a=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(a))}}),e}function hf(r){var e=new C,t=r.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 i=n.split(":"),a=i.shift().trim();if(a){var o=i.join(":").trim();e.append(a,o)}}),e}Gi.call($e.prototype);function K(r,e){if(!(this instanceof K))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e||(e={}),this.type="default",this.status=e.status===void 0?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText===void 0?"":""+e.statusText,this.headers=new C(e.headers),this.url=e.url||"",this._initBody(r)}Gi.call(K.prototype),K.prototype.clone=function(){return new K(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new C(this.headers),url:this.url})},K.error=function(){var r=new K(null,{status:0,statusText:""});return r.type="error",r};var yf=[301,302,303,307,308];K.redirect=function(r,e){if(yf.indexOf(e)===-1)throw new RangeError("Invalid status code");return new K(null,{status:e,headers:{location:r}})};var Ee=q.DOMException;try{new Ee}catch{Ee=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},Ee.prototype=Object.create(Error.prototype),Ee.prototype.constructor=Ee}function Hi(r,e){return new Promise(function(t,n){var i=new $e(r,e);if(i.signal&&i.signal.aborted)return n(new Ee("Aborted","AbortError"));var a=new XMLHttpRequest;function o(){a.abort()}a.onload=function(){var f={status:a.status,statusText:a.statusText,headers:hf(a.getAllResponseHeaders()||"")};f.url="responseURL"in a?a.responseURL:f.headers.get("X-Request-URL");var c="response"in a?a.response:a.responseText;setTimeout(function(){t(new K(c,f))},0)},a.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},a.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},a.onabort=function(){setTimeout(function(){n(new Ee("Aborted","AbortError"))},0)};function s(f){try{return f===""&&q.location.href?q.location.href:f}catch{return f}}a.open(i.method,s(i.url),!0),i.credentials==="include"?a.withCredentials=!0:i.credentials==="omit"&&(a.withCredentials=!1),"responseType"in a&&(H.blob?a.responseType="blob":H.arrayBuffer&&i.headers.get("Content-Type")&&i.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(a.responseType="arraybuffer")),e&&typeof e.headers=="object"&&!(e.headers instanceof C)?Object.getOwnPropertyNames(e.headers).forEach(function(f){a.setRequestHeader(f,an(e.headers[f]))}):i.headers.forEach(function(f,c){a.setRequestHeader(c,f)}),i.signal&&(i.signal.addEventListener("abort",o),a.onreadystatechange=function(){a.readyState===4&&i.signal.removeEventListener("abort",o)}),a.send(typeof i._bodyInit>"u"?null:i._bodyInit)})}Hi.polyfill=!0,q.fetch||(q.fetch=Hi,q.Headers=C,q.Request=$e,q.Response=K),self.fetch.bind(self);let gf="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Wi=(r=21)=>{let e="",t=r;for(;t--;)e+=gf[Math.random()*64|0];return e};var _f=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},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 i=42;e[t]=i;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==i||o.enumerable!==!0)return!1}return!0},zi=typeof Symbol<"u"&&Symbol,vf=_f,mf=function(){return typeof zi!="function"||typeof Symbol!="function"||typeof zi("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:vf()},Xi={foo:{}},wf=Object,bf=function(){return{__proto__:Xi}.foo===Xi.foo&&!({__proto__:null}instanceof wf)},$f="Function.prototype.bind called on incompatible ",un=Array.prototype.slice,Ef=Object.prototype.toString,Sf="[object Function]",Af=function(e){var t=this;if(typeof t!="function"||Ef.call(t)!==Sf)throw new TypeError($f+t);for(var n=un.call(arguments,1),i,a=function(){if(this instanceof i){var l=t.apply(this,n.concat(un.call(arguments)));return Object(l)===l?l:this}else return t.apply(e,n.concat(un.call(arguments)))},o=Math.max(0,t.length-n.length),s=[],f=0;f<o;f++)s.push("$"+f);if(i=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this,arguments); }")(a),t.prototype){var c=function(){};c.prototype=t.prototype,i.prototype=new c,c.prototype=null}return i},Of=Af,fn=Function.prototype.bind||Of,If=fn,xf=If.call(Function.call,Object.prototype.hasOwnProperty),P,Le=SyntaxError,Yi=Function,je=TypeError,cn=function(r){try{return Yi('"use strict"; return ('+r+").constructor;")()}catch{}},Se=Object.getOwnPropertyDescriptor;if(Se)try{Se({},"")}catch{Se=null}var ln=function(){throw new je},Pf=Se?function(){try{return arguments.callee,ln}catch{try{return Se(arguments,"callee").get}catch{return ln}}}():ln,Ve=mf(),Tf=bf(),N=Object.getPrototypeOf||(Tf?function(r){return r.__proto__}:null),Ge={},Rf=typeof Uint8Array>"u"||!N?P:N(Uint8Array),Ae={"%AggregateError%":typeof AggregateError>"u"?P:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?P:ArrayBuffer,"%ArrayIteratorPrototype%":Ve&&N?N([][Symbol.iterator]()):P,"%AsyncFromSyncIteratorPrototype%":P,"%AsyncFunction%":Ge,"%AsyncGenerator%":Ge,"%AsyncGeneratorFunction%":Ge,"%AsyncIteratorPrototype%":Ge,"%Atomics%":typeof Atomics>"u"?P:Atomics,"%BigInt%":typeof BigInt>"u"?P:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?P:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?P:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?P:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?P:Float32Array,"%Float64Array%":typeof Float64Array>"u"?P:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?P:FinalizationRegistry,"%Function%":Yi,"%GeneratorFunction%":Ge,"%Int8Array%":typeof Int8Array>"u"?P:Int8Array,"%Int16Array%":typeof Int16Array>"u"?P:Int16Array,"%Int32Array%":typeof Int32Array>"u"?P:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ve&&N?N(N([][Symbol.iterator]())):P,"%JSON%":typeof JSON=="object"?JSON:P,"%Map%":typeof Map>"u"?P:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ve||!N?P:N(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?P:Promise,"%Proxy%":typeof Proxy>"u"?P:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?P:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?P:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ve||!N?P:N(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?P:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ve&&N?N(""[Symbol.iterator]()):P,"%Symbol%":Ve?Symbol:P,"%SyntaxError%":Le,"%ThrowTypeError%":Pf,"%TypedArray%":Rf,"%TypeError%":je,"%Uint8Array%":typeof Uint8Array>"u"?P:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?P:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?P:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?P:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?P:WeakMap,"%WeakRef%":typeof WeakRef>"u"?P:WeakRef,"%WeakSet%":typeof WeakSet>"u"?P:WeakSet};if(N)try{null.error}catch(r){var Ff=N(N(r));Ae["%Error.prototype%"]=Ff}var Mf=function r(e){var t;if(e==="%AsyncFunction%")t=cn("async function () {}");else if(e==="%GeneratorFunction%")t=cn("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=cn("async function* () {}");else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=r("%AsyncGenerator%");i&&N&&(t=N(i.prototype))}return Ae[e]=t,t},Ki={"%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"]},hr=fn,Xr=xf,Df=hr.call(Function.call,Array.prototype.concat),Cf=hr.call(Function.apply,Array.prototype.splice),Zi=hr.call(Function.call,String.prototype.replace),Yr=hr.call(Function.call,String.prototype.slice),Nf=hr.call(Function.call,RegExp.prototype.exec),Bf=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Uf=/\\(\\)?/g,qf=function(e){var t=Yr(e,0,1),n=Yr(e,-1);if(t==="%"&&n!=="%")throw new Le("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new Le("invalid intrinsic syntax, expected opening `%`");var i=[];return Zi(e,Bf,function(a,o,s,f){i[i.length]=s?Zi(f,Uf,"$1"):o||a}),i},kf=function(e,t){var n=e,i;if(Xr(Ki,n)&&(i=Ki[n],n="%"+i[0]+"%"),Xr(Ae,n)){var a=Ae[n];if(a===Ge&&(a=Mf(n)),typeof a>"u"&&!t)throw new je("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:a}}throw new Le("intrinsic "+e+" does not exist!")},dn=function(e,t){if(typeof e!="string"||e.length===0)throw new je("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new je('"allowMissing" argument must be a boolean');if(Nf(/^%?[^%]*%?$/,e)===null)throw new Le("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=qf(e),i=n.length>0?n[0]:"",a=kf("%"+i+"%",t),o=a.name,s=a.value,f=!1,c=a.alias;c&&(i=c[0],Cf(n,Df([0,1],c)));for(var l=1,u=!0;l<n.length;l+=1){var d=n[l],y=Yr(d,0,1),b=Yr(d,-1);if((y==='"'||y==="'"||y==="`"||b==='"'||b==="'"||b==="`")&&y!==b)throw new Le("property names with quotes must have matching quotes");if((d==="constructor"||!u)&&(f=!0),i+="."+d,o="%"+i+"%",Xr(Ae,o))s=Ae[o];else if(s!=null){if(!(d in s)){if(!t)throw new je("base intrinsic for "+e+" exists, but the property is not available.");return}if(Se&&l+1>=n.length){var S=Se(s,d);u=!!S,u&&"get"in S&&!("originalValue"in S.get)?s=S.get:s=s[d]}else u=Xr(s,d),s=s[d];u&&!f&&(Ae[o]=s)}}return s},Ji={exports:{}};(function(r){var e=fn,t=dn,n=t("%Function.prototype.apply%"),i=t("%Function.prototype.call%"),a=t("%Reflect.apply%",!0)||e.call(i,n),o=t("%Object.getOwnPropertyDescriptor%",!0),s=t("%Object.defineProperty%",!0),f=t("%Math.max%");if(s)try{s({},"a",{value:1})}catch{s=null}r.exports=function(u){var d=a(e,i,arguments);if(o&&s){var y=o(d,"length");y.configurable&&s(d,"length",{value:1+f(0,u.length-(arguments.length-1))})}return d};var c=function(){return a(e,n,arguments)};s?s(r.exports,"apply",{value:c}):r.exports.apply=c})(Ji);var Lf=Ji.exports,Qi=dn,ea=Lf,jf=ea(Qi("String.prototype.indexOf")),Vf=function(e,t){var n=Qi(e,!!t);return typeof n=="function"&&jf(e,".prototype.")>-1?ea(n):n},He=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},Z=[],z=[],Gf=typeof Uint8Array<"u"?Uint8Array:Array,pn=!1;function ra(){pn=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,t=r.length;e<t;++e)Z[e]=r[e],z[r.charCodeAt(e)]=e;z["-".charCodeAt(0)]=62,z["_".charCodeAt(0)]=63}function Hf(r){pn||ra();var e,t,n,i,a,o,s=r.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=r[s-2]==="="?2:r[s-1]==="="?1:0,o=new Gf(s*3/4-a),n=a>0?s-4:s;var f=0;for(e=0,t=0;e<n;e+=4,t+=3)i=z[r.charCodeAt(e)]<<18|z[r.charCodeAt(e+1)]<<12|z[r.charCodeAt(e+2)]<<6|z[r.charCodeAt(e+3)],o[f++]=i>>16&255,o[f++]=i>>8&255,o[f++]=i&255;return a===2?(i=z[r.charCodeAt(e)]<<2|z[r.charCodeAt(e+1)]>>4,o[f++]=i&255):a===1&&(i=z[r.charCodeAt(e)]<<10|z[r.charCodeAt(e+1)]<<4|z[r.charCodeAt(e+2)]>>2,o[f++]=i>>8&255,o[f++]=i&255),o}function Wf(r){return Z[r>>18&63]+Z[r>>12&63]+Z[r>>6&63]+Z[r&63]}function zf(r,e,t){for(var n,i=[],a=e;a<t;a+=3)n=(r[a]<<16)+(r[a+1]<<8)+r[a+2],i.push(Wf(n));return i.join("")}function ta(r){pn||ra();for(var e,t=r.length,n=t%3,i="",a=[],o=16383,s=0,f=t-n;s<f;s+=o)a.push(zf(r,s,s+o>f?f:s+o));return n===1?(e=r[t-1],i+=Z[e>>2],i+=Z[e<<4&63],i+="=="):n===2&&(e=(r[t-2]<<8)+r[t-1],i+=Z[e>>10],i+=Z[e>>4&63],i+=Z[e<<2&63],i+="="),a.push(i),a.join("")}function Kr(r,e,t,n,i){var a,o,s=i*8-n-1,f=(1<<s)-1,c=f>>1,l=-7,u=t?i-1:0,d=t?-1:1,y=r[e+u];for(u+=d,a=y&(1<<-l)-1,y>>=-l,l+=s;l>0;a=a*256+r[e+u],u+=d,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=o*256+r[e+u],u+=d,l-=8);if(a===0)a=1-c;else{if(a===f)return o?NaN:(y?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-c}return(y?-1:1)*o*Math.pow(2,a-n)}function na(r,e,t,n,i,a){var o,s,f,c=a*8-i-1,l=(1<<c)-1,u=l>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:a-1,b=n?1:-1,S=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-o))<1&&(o--,f*=2),o+u>=1?e+=d/f:e+=d*Math.pow(2,1-u),e*f>=2&&(o++,f/=2),o+u>=l?(s=0,o=l):o+u>=1?(s=(e*f-1)*Math.pow(2,i),o=o+u):(s=e*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;r[t+y]=s&255,y+=b,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;r[t+y]=o&255,y+=b,o/=256,c-=8);r[t+y-b]|=S*128}var Xf={}.toString,ia=Array.isArray||function(r){return Xf.call(r)=="[object Array]"};/*!
1
+ // recharge-client-1.68.1.min.js | MIT License | © Recharge Inc.
2
+ (function(D,we){typeof exports=="object"&&typeof module<"u"?module.exports=we():typeof define=="function"&&define.amd?define(we):(D=typeof globalThis<"u"?globalThis:D||self,D.recharge=we())})(this,function(){"use strict";var D=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function we(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Xf(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),t}var k=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof k<"u"&&k,G={searchParams:"URLSearchParams"in k,iterable:"Symbol"in k&&"iterator"in Symbol,blob:"FileReader"in k&&"Blob"in k&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in k,arrayBuffer:"ArrayBuffer"in k};function Yf(r){return r&&DataView.prototype.isPrototypeOf(r)}if(G.arrayBuffer)var Kf=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Zf=ArrayBuffer.isView||function(r){return r&&Kf.indexOf(Object.prototype.toString.call(r))>-1};function pr(r){if(typeof r!="string"&&(r=String(r)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(r)||r==="")throw new TypeError('Invalid character in header field name: "'+r+'"');return r.toLowerCase()}function gn(r){return typeof r!="string"&&(r=String(r)),r}function _n(r){var e={next:function(){var t=r.shift();return{done:t===void 0,value:t}}};return G.iterable&&(e[Symbol.iterator]=function(){return e}),e}function C(r){this.map={},r instanceof C?r.forEach(function(e,t){this.append(t,e)},this):Array.isArray(r)?r.forEach(function(e){this.append(e[0],e[1])},this):r&&Object.getOwnPropertyNames(r).forEach(function(e){this.append(e,r[e])},this)}C.prototype.append=function(r,e){r=pr(r),e=gn(e);var t=this.map[r];this.map[r]=t?t+", "+e:e},C.prototype.delete=function(r){delete this.map[pr(r)]},C.prototype.get=function(r){return r=pr(r),this.has(r)?this.map[r]:null},C.prototype.has=function(r){return this.map.hasOwnProperty(pr(r))},C.prototype.set=function(r,e){this.map[pr(r)]=gn(e)},C.prototype.forEach=function(r,e){for(var t in this.map)this.map.hasOwnProperty(t)&&r.call(e,this.map[t],t,this)},C.prototype.keys=function(){var r=[];return this.forEach(function(e,t){r.push(t)}),_n(r)},C.prototype.values=function(){var r=[];return this.forEach(function(e){r.push(e)}),_n(r)},C.prototype.entries=function(){var r=[];return this.forEach(function(e,t){r.push([t,e])}),_n(r)},G.iterable&&(C.prototype[Symbol.iterator]=C.prototype.entries);function vn(r){if(r.bodyUsed)return Promise.reject(new TypeError("Already read"));r.bodyUsed=!0}function la(r){return new Promise(function(e,t){r.onload=function(){e(r.result)},r.onerror=function(){t(r.error)}})}function Jf(r){var e=new FileReader,t=la(e);return e.readAsArrayBuffer(r),t}function Qf(r){var e=new FileReader,t=la(e);return e.readAsText(r),t}function ec(r){for(var e=new Uint8Array(r),t=new Array(e.length),n=0;n<e.length;n++)t[n]=String.fromCharCode(e[n]);return t.join("")}function da(r){if(r.slice)return r.slice(0);var e=new Uint8Array(r.byteLength);return e.set(new Uint8Array(r)),e.buffer}function pa(){return this.bodyUsed=!1,this._initBody=function(r){this.bodyUsed=this.bodyUsed,this._bodyInit=r,r?typeof r=="string"?this._bodyText=r:G.blob&&Blob.prototype.isPrototypeOf(r)?this._bodyBlob=r:G.formData&&FormData.prototype.isPrototypeOf(r)?this._bodyFormData=r:G.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)?this._bodyText=r.toString():G.arrayBuffer&&G.blob&&Yf(r)?(this._bodyArrayBuffer=da(r.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):G.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(r)||Zf(r))?this._bodyArrayBuffer=da(r):this._bodyText=r=Object.prototype.toString.call(r):this._bodyText="",this.headers.get("content-type")||(typeof r=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):G.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},G.blob&&(this.blob=function(){var r=vn(this);if(r)return r;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 r=vn(this);return r||(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(Jf)}),this.text=function(){var r=vn(this);if(r)return r;if(this._bodyBlob)return Qf(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(ec(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},G.formData&&(this.formData=function(){return this.text().then(nc)}),this.json=function(){return this.text().then(JSON.parse)},this}var rc=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function tc(r){var e=r.toUpperCase();return rc.indexOf(e)>-1?e:r}function be(r,e){if(!(this instanceof be))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e=e||{};var t=e.body;if(r instanceof be){if(r.bodyUsed)throw new TypeError("Already read");this.url=r.url,this.credentials=r.credentials,e.headers||(this.headers=new C(r.headers)),this.method=r.method,this.mode=r.mode,this.signal=r.signal,!t&&r._bodyInit!=null&&(t=r._bodyInit,r.bodyUsed=!0)}else this.url=String(r);if(this.credentials=e.credentials||this.credentials||"same-origin",(e.headers||!this.headers)&&(this.headers=new C(e.headers)),this.method=tc(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.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")&&(e.cache==="no-store"||e.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var i=/\?/;this.url+=(i.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}be.prototype.clone=function(){return new be(this,{body:this._bodyInit})};function nc(r){var e=new FormData;return r.trim().split("&").forEach(function(t){if(t){var n=t.split("="),i=n.shift().replace(/\+/g," "),a=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(a))}}),e}function ic(r){var e=new C,t=r.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 i=n.split(":"),a=i.shift().trim();if(a){var o=i.join(":").trim();e.append(a,o)}}),e}pa.call(be.prototype);function K(r,e){if(!(this instanceof K))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e||(e={}),this.type="default",this.status=e.status===void 0?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText===void 0?"":""+e.statusText,this.headers=new C(e.headers),this.url=e.url||"",this._initBody(r)}pa.call(K.prototype),K.prototype.clone=function(){return new K(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new C(this.headers),url:this.url})},K.error=function(){var r=new K(null,{status:0,statusText:""});return r.type="error",r};var ac=[301,302,303,307,308];K.redirect=function(r,e){if(ac.indexOf(e)===-1)throw new RangeError("Invalid status code");return new K(null,{status:e,headers:{location:r}})};var $e=k.DOMException;try{new $e}catch{$e=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},$e.prototype=Object.create(Error.prototype),$e.prototype.constructor=$e}function ha(r,e){return new Promise(function(t,n){var i=new be(r,e);if(i.signal&&i.signal.aborted)return n(new $e("Aborted","AbortError"));var a=new XMLHttpRequest;function o(){a.abort()}a.onload=function(){var f={status:a.status,statusText:a.statusText,headers:ic(a.getAllResponseHeaders()||"")};f.url="responseURL"in a?a.responseURL:f.headers.get("X-Request-URL");var d="response"in a?a.response:a.responseText;setTimeout(function(){t(new K(d,f))},0)},a.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},a.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},a.onabort=function(){setTimeout(function(){n(new $e("Aborted","AbortError"))},0)};function s(f){try{return f===""&&k.location.href?k.location.href:f}catch{return f}}a.open(i.method,s(i.url),!0),i.credentials==="include"?a.withCredentials=!0:i.credentials==="omit"&&(a.withCredentials=!1),"responseType"in a&&(G.blob?a.responseType="blob":G.arrayBuffer&&i.headers.get("Content-Type")&&i.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(a.responseType="arraybuffer")),e&&typeof e.headers=="object"&&!(e.headers instanceof C)?Object.getOwnPropertyNames(e.headers).forEach(function(f){a.setRequestHeader(f,gn(e.headers[f]))}):i.headers.forEach(function(f,d){a.setRequestHeader(d,f)}),i.signal&&(i.signal.addEventListener("abort",o),a.onreadystatechange=function(){a.readyState===4&&i.signal.removeEventListener("abort",o)}),a.send(typeof i._bodyInit>"u"?null:i._bodyInit)})}ha.polyfill=!0,k.fetch||(k.fetch=ha,k.Headers=C,k.Request=be,k.Response=K),self.fetch.bind(self);let oc="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",ya=(r=21)=>{let e="",t=r|0;for(;t--;)e+=oc[Math.random()*64|0];return e};var Le=TypeError,je=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},Z=[],z=[],uc=typeof Uint8Array<"u"?Uint8Array:Array,mn=!1;function ga(){mn=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,t=r.length;e<t;++e)Z[e]=r[e],z[r.charCodeAt(e)]=e;z["-".charCodeAt(0)]=62,z["_".charCodeAt(0)]=63}function sc(r){mn||ga();var e,t,n,i,a,o,s=r.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=r[s-2]==="="?2:r[s-1]==="="?1:0,o=new uc(s*3/4-a),n=a>0?s-4:s;var f=0;for(e=0,t=0;e<n;e+=4,t+=3)i=z[r.charCodeAt(e)]<<18|z[r.charCodeAt(e+1)]<<12|z[r.charCodeAt(e+2)]<<6|z[r.charCodeAt(e+3)],o[f++]=i>>16&255,o[f++]=i>>8&255,o[f++]=i&255;return a===2?(i=z[r.charCodeAt(e)]<<2|z[r.charCodeAt(e+1)]>>4,o[f++]=i&255):a===1&&(i=z[r.charCodeAt(e)]<<10|z[r.charCodeAt(e+1)]<<4|z[r.charCodeAt(e+2)]>>2,o[f++]=i>>8&255,o[f++]=i&255),o}function fc(r){return Z[r>>18&63]+Z[r>>12&63]+Z[r>>6&63]+Z[r&63]}function cc(r,e,t){for(var n,i=[],a=e;a<t;a+=3)n=(r[a]<<16)+(r[a+1]<<8)+r[a+2],i.push(fc(n));return i.join("")}function _a(r){mn||ga();for(var e,t=r.length,n=t%3,i="",a=[],o=16383,s=0,f=t-n;s<f;s+=o)a.push(cc(r,s,s+o>f?f:s+o));return n===1?(e=r[t-1],i+=Z[e>>2],i+=Z[e<<4&63],i+="=="):n===2&&(e=(r[t-2]<<8)+r[t-1],i+=Z[e>>10],i+=Z[e>>4&63],i+=Z[e<<2&63],i+="="),a.push(i),a.join("")}function Jr(r,e,t,n,i){var a,o,s=i*8-n-1,f=(1<<s)-1,d=f>>1,c=-7,u=t?i-1:0,l=t?-1:1,y=r[e+u];for(u+=l,a=y&(1<<-c)-1,y>>=-c,c+=s;c>0;a=a*256+r[e+u],u+=l,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=o*256+r[e+u],u+=l,c-=8);if(a===0)a=1-d;else{if(a===f)return o?NaN:(y?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-d}return(y?-1:1)*o*Math.pow(2,a-n)}function va(r,e,t,n,i,a){var o,s,f,d=a*8-i-1,c=(1<<d)-1,u=c>>1,l=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:a-1,m=n?1:-1,E=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-o))<1&&(o--,f*=2),o+u>=1?e+=l/f:e+=l*Math.pow(2,1-u),e*f>=2&&(o++,f/=2),o+u>=c?(s=0,o=c):o+u>=1?(s=(e*f-1)*Math.pow(2,i),o=o+u):(s=e*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;r[t+y]=s&255,y+=m,s/=256,i-=8);for(o=o<<i|s,d+=i;d>0;r[t+y]=o&255,y+=m,o/=256,d-=8);r[t+y-m]|=E*128}var lc={}.toString,ma=Array.isArray||function(r){return lc.call(r)=="[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 Yf=50;h.TYPED_ARRAY_SUPPORT=He.TYPED_ARRAY_SUPPORT!==void 0?He.TYPED_ARRAY_SUPPORT:!0,Zr();function Zr(){return h.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function ae(r,e){if(Zr()<e)throw new RangeError("Invalid typed array length");return h.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e),r.__proto__=h.prototype):(r===null&&(r=new h(e)),r.length=e),r}function h(r,e,t){if(!h.TYPED_ARRAY_SUPPORT&&!(this instanceof h))return new h(r,e,t);if(typeof r=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return hn(this,r)}return aa(this,r,e,t)}h.poolSize=8192,h._augment=function(r){return r.__proto__=h.prototype,r};function aa(r,e,t,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?Jf(r,e,t,n):typeof e=="string"?Zf(r,e,t):Qf(r,e)}h.from=function(r,e,t){return aa(null,r,e,t)},h.TYPED_ARRAY_SUPPORT&&(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&h[Symbol.species]);function oa(r){if(typeof r!="number")throw new TypeError('"size" argument must be a number');if(r<0)throw new RangeError('"size" argument must not be negative')}function Kf(r,e,t,n){return oa(e),e<=0?ae(r,e):t!==void 0?typeof n=="string"?ae(r,e).fill(t,n):ae(r,e).fill(t):ae(r,e)}h.alloc=function(r,e,t){return Kf(null,r,e,t)};function hn(r,e){if(oa(e),r=ae(r,e<0?0:gn(e)|0),!h.TYPED_ARRAY_SUPPORT)for(var t=0;t<e;++t)r[t]=0;return r}h.allocUnsafe=function(r){return hn(null,r)},h.allocUnsafeSlow=function(r){return hn(null,r)};function Zf(r,e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!h.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var n=sa(e,t)|0;r=ae(r,n);var i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function yn(r,e){var t=e.length<0?0:gn(e.length)|0;r=ae(r,t);for(var n=0;n<t;n+=1)r[n]=e[n]&255;return r}function Jf(r,e,t,n){if(e.byteLength,t<0||e.byteLength<t)throw new RangeError("'offset' is out of bounds");if(e.byteLength<t+(n||0))throw new RangeError("'length' is out of bounds");return t===void 0&&n===void 0?e=new Uint8Array(e):n===void 0?e=new Uint8Array(e,t):e=new Uint8Array(e,t,n),h.TYPED_ARRAY_SUPPORT?(r=e,r.__proto__=h.prototype):r=yn(r,e),r}function Qf(r,e){if(J(e)){var t=gn(e.length)|0;return r=ae(r,t),r.length===0||e.copy(r,0,0,t),r}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||vc(e.length)?ae(r,0):yn(r,e);if(e.type==="Buffer"&&ia(e.data))return yn(r,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function gn(r){if(r>=Zr())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Zr().toString(16)+" bytes");return r|0}h.isBuffer=mc;function J(r){return!!(r!=null&&r._isBuffer)}h.compare=function(e,t){if(!J(e)||!J(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,i=t.length,a=0,o=Math.min(n,i);a<o;++a)if(e[a]!==t[a]){n=e[a],i=t[a];break}return n<i?-1:i<n?1:0},h.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},h.concat=function(e,t){if(!ia(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return h.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var i=h.allocUnsafe(t),a=0;for(n=0;n<e.length;++n){var o=e[n];if(!J(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,a),a+=o.length}return i};function sa(r,e){if(J(r))return r.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;typeof r!="string"&&(r=""+r);var t=r.length;if(t===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return et(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return ga(r).length;default:if(n)return et(r).length;e=(""+e).toLowerCase(),n=!0}}h.byteLength=sa;function ec(r,e,t){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return cc(this,e,t);case"utf8":case"utf-8":return la(this,e,t);case"ascii":return uc(this,e,t);case"latin1":case"binary":return fc(this,e,t);case"base64":return oc(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return lc(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}h.prototype._isBuffer=!0;function Oe(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}h.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)Oe(this,t,t+1);return this},h.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)Oe(this,t,t+3),Oe(this,t+1,t+2);return this},h.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)Oe(this,t,t+7),Oe(this,t+1,t+6),Oe(this,t+2,t+5),Oe(this,t+3,t+4);return this},h.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?la(this,0,e):ec.apply(this,arguments)},h.prototype.equals=function(e){if(!J(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:h.compare(this,e)===0},h.prototype.inspect=function(){var e="",t=Yf;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},h.prototype.compare=function(e,t,n,i,a){if(!J(e))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),t<0||n>e.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&t>=n)return 0;if(i>=a)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,a>>>=0,this===e)return 0;for(var o=a-i,s=n-t,f=Math.min(o,s),c=this.slice(i,a),l=e.slice(t,n),u=0;u<f;++u)if(c[u]!==l[u]){o=c[u],s=l[u];break}return o<s?-1:s<o?1:0};function ua(r,e,t,n,i){if(r.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=i?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(i)return-1;t=r.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof e=="string"&&(e=h.from(e,n)),J(e))return e.length===0?-1:fa(r,e,t,n,i);if(typeof e=="number")return e=e&255,h.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):fa(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}function fa(r,e,t,n,i){var a=1,o=r.length,s=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||e.length<2)return-1;a=2,o/=2,s/=2,t/=2}function f(y,b){return a===1?y[b]:y.readUInt16BE(b*a)}var c;if(i){var l=-1;for(c=t;c<o;c++)if(f(r,c)===f(e,l===-1?0:c-l)){if(l===-1&&(l=c),c-l+1===s)return l*a}else l!==-1&&(c-=c-l),l=-1}else for(t+s>o&&(t=o-s),c=t;c>=0;c--){for(var u=!0,d=0;d<s;d++)if(f(r,c+d)!==f(e,d)){u=!1;break}if(u)return c}return-1}h.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},h.prototype.indexOf=function(e,t,n){return ua(this,e,t,n,!0)},h.prototype.lastIndexOf=function(e,t,n){return ua(this,e,t,n,!1)};function rc(r,e,t,n){t=Number(t)||0;var i=r.length-t;n?(n=Number(n),n>i&&(n=i)):n=i;var a=e.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(e.substr(o*2,2),16);if(isNaN(s))return o;r[t+o]=s}return o}function tc(r,e,t,n){return rt(et(e,r.length-t),r,t,n)}function ca(r,e,t,n){return rt(gc(e),r,t,n)}function nc(r,e,t,n){return ca(r,e,t,n)}function ic(r,e,t,n){return rt(ga(e),r,t,n)}function ac(r,e,t,n){return rt(_c(e,r.length-t),r,t,n)}h.prototype.write=function(e,t,n,i){if(t===void 0)i="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")i=t,n=this.length,t=0;else if(isFinite(t))t=t|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-t;if((n===void 0||n>a)&&(n=a),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return rc(this,e,t,n);case"utf8":case"utf-8":return tc(this,e,t,n);case"ascii":return ca(this,e,t,n);case"latin1":case"binary":return nc(this,e,t,n);case"base64":return ic(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ac(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function oc(r,e,t){return e===0&&t===r.length?ta(r):ta(r.slice(e,t))}function la(r,e,t){t=Math.min(r.length,t);for(var n=[],i=e;i<t;){var a=r[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=t){var f,c,l,u;switch(s){case 1:a<128&&(o=a);break;case 2:f=r[i+1],(f&192)===128&&(u=(a&31)<<6|f&63,u>127&&(o=u));break;case 3:f=r[i+1],c=r[i+2],(f&192)===128&&(c&192)===128&&(u=(a&15)<<12|(f&63)<<6|c&63,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:f=r[i+1],c=r[i+2],l=r[i+3],(f&192)===128&&(c&192)===128&&(l&192)===128&&(u=(a&15)<<18|(f&63)<<12|(c&63)<<6|l&63,u>65535&&u<1114112&&(o=u))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=s}return sc(n)}var da=4096;function sc(r){var e=r.length;if(e<=da)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=da));return t}function uc(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]&127);return n}function fc(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]);return n}function cc(r,e,t){var n=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>n)&&(t=n);for(var i="",a=e;a<t;++a)i+=yc(r[a]);return i}function lc(r,e,t){for(var n=r.slice(e,t),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+n[a+1]*256);return i}h.prototype.slice=function(e,t){var n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);var i;if(h.TYPED_ARRAY_SUPPORT)i=this.subarray(e,t),i.__proto__=h.prototype;else{var a=t-e;i=new h(a,void 0);for(var o=0;o<a;++o)i[o]=this[o+e]}return i};function B(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}h.prototype.readUIntLE=function(e,t,n){e=e|0,t=t|0,n||B(e,t,this.length);for(var i=this[e],a=1,o=0;++o<t&&(a*=256);)i+=this[e+o]*a;return i},h.prototype.readUIntBE=function(e,t,n){e=e|0,t=t|0,n||B(e,t,this.length);for(var i=this[e+--t],a=1;t>0&&(a*=256);)i+=this[e+--t]*a;return i},h.prototype.readUInt8=function(e,t){return t||B(e,1,this.length),this[e]},h.prototype.readUInt16LE=function(e,t){return t||B(e,2,this.length),this[e]|this[e+1]<<8},h.prototype.readUInt16BE=function(e,t){return t||B(e,2,this.length),this[e]<<8|this[e+1]},h.prototype.readUInt32LE=function(e,t){return t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},h.prototype.readUInt32BE=function(e,t){return t||B(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},h.prototype.readIntLE=function(e,t,n){e=e|0,t=t|0,n||B(e,t,this.length);for(var i=this[e],a=1,o=0;++o<t&&(a*=256);)i+=this[e+o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*t)),i},h.prototype.readIntBE=function(e,t,n){e=e|0,t=t|0,n||B(e,t,this.length);for(var i=t,a=1,o=this[e+--i];i>0&&(a*=256);)o+=this[e+--i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*t)),o},h.prototype.readInt8=function(e,t){return t||B(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},h.prototype.readInt16LE=function(e,t){t||B(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},h.prototype.readInt16BE=function(e,t){t||B(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},h.prototype.readInt32LE=function(e,t){return t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},h.prototype.readInt32BE=function(e,t){return t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},h.prototype.readFloatLE=function(e,t){return t||B(e,4,this.length),Kr(this,e,!0,23,4)},h.prototype.readFloatBE=function(e,t){return t||B(e,4,this.length),Kr(this,e,!1,23,4)},h.prototype.readDoubleLE=function(e,t){return t||B(e,8,this.length),Kr(this,e,!0,52,8)},h.prototype.readDoubleBE=function(e,t){return t||B(e,8,this.length),Kr(this,e,!1,52,8)};function W(r,e,t,n,i,a){if(!J(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<a)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError("Index out of range")}h.prototype.writeUIntLE=function(e,t,n,i){if(e=+e,t=t|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;W(this,e,t,n,a,0)}var o=1,s=0;for(this[t]=e&255;++s<n&&(o*=256);)this[t+s]=e/o&255;return t+n},h.prototype.writeUIntBE=function(e,t,n,i){if(e=+e,t=t|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;W(this,e,t,n,a,0)}var o=n-1,s=1;for(this[t+o]=e&255;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+n},h.prototype.writeUInt8=function(e,t,n){return e=+e,t=t|0,n||W(this,e,t,1,255,0),h.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=e&255,t+1};function Jr(r,e,t,n){e<0&&(e=65535+e+1);for(var i=0,a=Math.min(r.length-t,2);i<a;++i)r[t+i]=(e&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}h.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=t|0,n||W(this,e,t,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):Jr(this,e,t,!0),t+2},h.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=t|0,n||W(this,e,t,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):Jr(this,e,t,!1),t+2};function Qr(r,e,t,n){e<0&&(e=4294967295+e+1);for(var i=0,a=Math.min(r.length-t,4);i<a;++i)r[t+i]=e>>>(n?i:3-i)*8&255}h.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=t|0,n||W(this,e,t,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255):Qr(this,e,t,!0),t+4},h.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=t|0,n||W(this,e,t,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):Qr(this,e,t,!1),t+4},h.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t=t|0,!i){var a=Math.pow(2,8*n-1);W(this,e,t,n,a-1,-a)}var o=0,s=1,f=0;for(this[t]=e&255;++o<n&&(s*=256);)e<0&&f===0&&this[t+o-1]!==0&&(f=1),this[t+o]=(e/s>>0)-f&255;return t+n},h.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t=t|0,!i){var a=Math.pow(2,8*n-1);W(this,e,t,n,a-1,-a)}var o=n-1,s=1,f=0;for(this[t+o]=e&255;--o>=0&&(s*=256);)e<0&&f===0&&this[t+o+1]!==0&&(f=1),this[t+o]=(e/s>>0)-f&255;return t+n},h.prototype.writeInt8=function(e,t,n){return e=+e,t=t|0,n||W(this,e,t,1,127,-128),h.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=e&255,t+1},h.prototype.writeInt16LE=function(e,t,n){return e=+e,t=t|0,n||W(this,e,t,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):Jr(this,e,t,!0),t+2},h.prototype.writeInt16BE=function(e,t,n){return e=+e,t=t|0,n||W(this,e,t,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):Jr(this,e,t,!1),t+2},h.prototype.writeInt32LE=function(e,t,n){return e=+e,t=t|0,n||W(this,e,t,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Qr(this,e,t,!0),t+4},h.prototype.writeInt32BE=function(e,t,n){return e=+e,t=t|0,n||W(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),h.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):Qr(this,e,t,!1),t+4};function pa(r,e,t,n,i,a){if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function ha(r,e,t,n,i){return i||pa(r,e,t,4),na(r,e,t,n,23,4),t+4}h.prototype.writeFloatLE=function(e,t,n){return ha(this,e,t,!0,n)},h.prototype.writeFloatBE=function(e,t,n){return ha(this,e,t,!1,n)};function ya(r,e,t,n,i){return i||pa(r,e,t,8),na(r,e,t,n,52,8),t+8}h.prototype.writeDoubleLE=function(e,t,n){return ya(this,e,t,!0,n)},h.prototype.writeDoubleBE=function(e,t,n){return ya(this,e,t,!1,n)},h.prototype.copy=function(e,t,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n||e.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(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);var a=i-n,o;if(this===e&&n<t&&t<i)for(o=a-1;o>=0;--o)e[o+t]=this[o+n];else if(a<1e3||!h.TYPED_ARRAY_SUPPORT)for(o=0;o<a;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},h.prototype.fill=function(e,t,n,i){if(typeof e=="string"){if(typeof t=="string"?(i=t,t=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),e.length===1){var a=e.charCodeAt(0);a<256&&(e=a)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!h.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof e=="number"&&(e=e&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,e||(e=0);var o;if(typeof e=="number")for(o=t;o<n;++o)this[o]=e;else{var s=J(e)?e:et(new h(e,i).toString()),f=s.length;for(o=0;o<n-t;++o)this[o+t]=s[o%f]}return this};var dc=/[^+\/0-9A-Za-z-_]/g;function pc(r){if(r=hc(r).replace(dc,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function hc(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function yc(r){return r<16?"0"+r.toString(16):r.toString(16)}function et(r,e){e=e||1/0;for(var t,n=r.length,i=null,a=[],o=0;o<n;++o){if(t=r.charCodeAt(o),t>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&a.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&a.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,t<128){if((e-=1)<0)break;a.push(t)}else if(t<2048){if((e-=2)<0)break;a.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;a.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;a.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return a}function gc(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function _c(r,e){for(var t,n,i,a=[],o=0;o<r.length&&!((e-=2)<0);++o)t=r.charCodeAt(o),n=t>>8,i=t%256,a.push(i),a.push(n);return a}function ga(r){return Hf(pc(r))}function rt(r,e,t,n){for(var i=0;i<n&&!(i+t>=e.length||i>=r.length);++i)e[i+t]=r[i];return i}function vc(r){return r!==r}function mc(r){return r!=null&&(!!r._isBuffer||_a(r)||wc(r))}function _a(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function wc(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&_a(r.slice(0,0))}function va(){throw new Error("setTimeout has not been defined")}function ma(){throw new Error("clearTimeout has not been defined")}var le=va,de=ma;typeof He.setTimeout=="function"&&(le=setTimeout),typeof He.clearTimeout=="function"&&(de=clearTimeout);function wa(r){if(le===setTimeout)return setTimeout(r,0);if((le===va||!le)&&setTimeout)return le=setTimeout,setTimeout(r,0);try{return le(r,0)}catch{try{return le.call(null,r,0)}catch{return le.call(this,r,0)}}}function bc(r){if(de===clearTimeout)return clearTimeout(r);if((de===ma||!de)&&clearTimeout)return de=clearTimeout,clearTimeout(r);try{return de(r)}catch{try{return de.call(null,r)}catch{return de.call(this,r)}}}var oe=[],We=!1,Ie,tt=-1;function $c(){!We||!Ie||(We=!1,Ie.length?oe=Ie.concat(oe):tt=-1,oe.length&&ba())}function ba(){if(!We){var r=wa($c);We=!0;for(var e=oe.length;e;){for(Ie=oe,oe=[];++tt<e;)Ie&&Ie[tt].run();tt=-1,e=oe.length}Ie=null,We=!1,bc(r)}}function Ec(r){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];oe.push(new $a(r,e)),oe.length===1&&!We&&wa(ba)}function $a(r,e){this.fun=r,this.array=e}$a.prototype.run=function(){this.fun.apply(null,this.array)};var Sc="browser",Ac="browser",Oc=!0,Ic={},xc=[],Pc="",Tc={},Rc={},Fc={};function xe(){}var Mc=xe,Dc=xe,Cc=xe,Nc=xe,Bc=xe,Uc=xe,qc=xe;function kc(r){throw new Error("process.binding is not supported")}function Lc(){return"/"}function jc(r){throw new Error("process.chdir is not supported")}function Vc(){return 0}var ze=He.performance||{},Gc=ze.now||ze.mozNow||ze.msNow||ze.oNow||ze.webkitNow||function(){return new Date().getTime()};function Hc(r){var e=Gc.call(ze)*.001,t=Math.floor(e),n=Math.floor(e%1*1e9);return r&&(t=t-r[0],n=n-r[1],n<0&&(t--,n+=1e9)),[t,n]}var Wc=new Date;function zc(){var r=new Date,e=r-Wc;return e/1e3}var Xe={nextTick:Ec,title:Sc,browser:Oc,env:Ic,argv:xc,version:Pc,versions:Tc,on:Mc,addListener:Dc,once:Cc,off:Nc,removeListener:Bc,removeAllListeners:Uc,emit:qc,binding:kc,cwd:Lc,chdir:jc,umask:Vc,hrtime:Hc,platform:Ac,release:Rc,config:Fc,uptime:zc},_n;typeof Object.create=="function"?_n=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:_n=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e};var Ea=_n,Sa=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},i=0;i<t.length;i++)n[t[i]]=Object.getOwnPropertyDescriptor(e,t[i]);return n},Xc=/%[sdj%]/g;function nt(r){if(!gr(r)){for(var e=[],t=0;t<arguments.length;t++)e.push(Q(arguments[t]));return e.join(" ")}for(var t=1,n=arguments,i=n.length,a=String(r).replace(Xc,function(s){if(s==="%%")return"%";if(t>=i)return s;switch(s){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 s}}),o=n[t];t<i;o=n[++t])yr(o)||!Pe(o)?a+=" "+o:a+=" "+Q(o);return a}function vn(r,e){if(ee(He.process))return function(){return vn(r,e).apply(this,arguments)};if(Xe.noDeprecation===!0)return r;var t=!1;function n(){if(!t){if(Xe.throwDeprecation)throw new Error(e);Xe.traceDeprecation?console.trace(e):console.error(e),t=!0}return r.apply(this,arguments)}return n}var it={},mn;function Aa(r){if(ee(mn)&&(mn=Xe.env.NODE_DEBUG||""),r=r.toUpperCase(),!it[r])if(new RegExp("\\b"+r+"\\b","i").test(mn)){var e=0;it[r]=function(){var t=nt.apply(null,arguments);console.error("%s %d: %s",r,e,t)}}else it[r]=function(){};return it[r]}function Q(r,e){var t={seen:[],stylize:Kc};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),ot(e)?t.showHidden=e:e&&On(t,e),ee(t.showHidden)&&(t.showHidden=!1),ee(t.depth)&&(t.depth=2),ee(t.colors)&&(t.colors=!1),ee(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=Yc),at(t,r,t.depth)}Q.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]},Q.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function Yc(r,e){var t=Q.styles[e];return t?"\x1B["+Q.colors[t][0]+"m"+r+"\x1B["+Q.colors[t][1]+"m":r}function Kc(r,e){return r}function Zc(r){var e={};return r.forEach(function(t,n){e[t]=!0}),e}function at(r,e,t){if(r.customInspect&&e&&mr(e.inspect)&&e.inspect!==Q&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(t,r);return gr(n)||(n=at(r,n,t)),n}var i=Jc(r,e);if(i)return i;var a=Object.keys(e),o=Zc(a);if(r.showHidden&&(a=Object.getOwnPropertyNames(e)),vr(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return wn(e);if(a.length===0){if(mr(e)){var s=e.name?": "+e.name:"";return r.stylize("[Function"+s+"]","special")}if(_r(e))return r.stylize(RegExp.prototype.toString.call(e),"regexp");if(st(e))return r.stylize(Date.prototype.toString.call(e),"date");if(vr(e))return wn(e)}var f="",c=!1,l=["{","}"];if($n(e)&&(c=!0,l=["[","]"]),mr(e)){var u=e.name?": "+e.name:"";f=" [Function"+u+"]"}if(_r(e)&&(f=" "+RegExp.prototype.toString.call(e)),st(e)&&(f=" "+Date.prototype.toUTCString.call(e)),vr(e)&&(f=" "+wn(e)),a.length===0&&(!c||e.length==0))return l[0]+f+l[1];if(t<0)return _r(e)?r.stylize(RegExp.prototype.toString.call(e),"regexp"):r.stylize("[Object]","special");r.seen.push(e);var d;return c?d=Qc(r,e,t,o,a):d=a.map(function(y){return bn(r,e,t,o,y,c)}),r.seen.pop(),el(d,f,l)}function Jc(r,e){if(ee(e))return r.stylize("undefined","undefined");if(gr(e)){var t="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return r.stylize(t,"string")}if(En(e))return r.stylize(""+e,"number");if(ot(e))return r.stylize(""+e,"boolean");if(yr(e))return r.stylize("null","null")}function wn(r){return"["+Error.prototype.toString.call(r)+"]"}function Qc(r,e,t,n,i){for(var a=[],o=0,s=e.length;o<s;++o)Ra(e,String(o))?a.push(bn(r,e,t,n,String(o),!0)):a.push("");return i.forEach(function(f){f.match(/^\d+$/)||a.push(bn(r,e,t,n,f,!0))}),a}function bn(r,e,t,n,i,a){var o,s,f;if(f=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},f.get?f.set?s=r.stylize("[Getter/Setter]","special"):s=r.stylize("[Getter]","special"):f.set&&(s=r.stylize("[Setter]","special")),Ra(n,i)||(o="["+i+"]"),s||(r.seen.indexOf(f.value)<0?(yr(t)?s=at(r,f.value,null):s=at(r,f.value,t-1),s.indexOf(`
8
+ */var dc=50;h.TYPED_ARRAY_SUPPORT=je.TYPED_ARRAY_SUPPORT!==void 0?je.TYPED_ARRAY_SUPPORT:!0,Qr();function Qr(){return h.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function ue(r,e){if(Qr()<e)throw new RangeError("Invalid typed array length");return h.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e),r.__proto__=h.prototype):(r===null&&(r=new h(e)),r.length=e),r}function h(r,e,t){if(!h.TYPED_ARRAY_SUPPORT&&!(this instanceof h))return new h(r,e,t);if(typeof r=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return wn(this,r)}return wa(this,r,e,t)}h.poolSize=8192,h._augment=function(r){return r.__proto__=h.prototype,r};function wa(r,e,t,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?yc(r,e,t,n):typeof e=="string"?hc(r,e,t):gc(r,e)}h.from=function(r,e,t){return wa(null,r,e,t)},h.TYPED_ARRAY_SUPPORT&&(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&h[Symbol.species]);function ba(r){if(typeof r!="number")throw new TypeError('"size" argument must be a number');if(r<0)throw new RangeError('"size" argument must not be negative')}function pc(r,e,t,n){return ba(e),e<=0?ue(r,e):t!==void 0?typeof n=="string"?ue(r,e).fill(t,n):ue(r,e).fill(t):ue(r,e)}h.alloc=function(r,e,t){return pc(null,r,e,t)};function wn(r,e){if(ba(e),r=ue(r,e<0?0:$n(e)|0),!h.TYPED_ARRAY_SUPPORT)for(var t=0;t<e;++t)r[t]=0;return r}h.allocUnsafe=function(r){return wn(null,r)},h.allocUnsafeSlow=function(r){return wn(null,r)};function hc(r,e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!h.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var n=$a(e,t)|0;r=ue(r,n);var i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function bn(r,e){var t=e.length<0?0:$n(e.length)|0;r=ue(r,t);for(var n=0;n<t;n+=1)r[n]=e[n]&255;return r}function yc(r,e,t,n){if(e.byteLength,t<0||e.byteLength<t)throw new RangeError("'offset' is out of bounds");if(e.byteLength<t+(n||0))throw new RangeError("'length' is out of bounds");return t===void 0&&n===void 0?e=new Uint8Array(e):n===void 0?e=new Uint8Array(e,t):e=new Uint8Array(e,t,n),h.TYPED_ARRAY_SUPPORT?(r=e,r.__proto__=h.prototype):r=bn(r,e),r}function gc(r,e){if(J(e)){var t=$n(e.length)|0;return r=ue(r,t),r.length===0||e.copy(r,0,0,t),r}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||Cc(e.length)?ue(r,0):bn(r,e);if(e.type==="Buffer"&&ma(e.data))return bn(r,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function $n(r){if(r>=Qr())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Qr().toString(16)+" bytes");return r|0}h.isBuffer=Nc;function J(r){return!!(r!=null&&r._isBuffer)}h.compare=function(e,t){if(!J(e)||!J(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,i=t.length,a=0,o=Math.min(n,i);a<o;++a)if(e[a]!==t[a]){n=e[a],i=t[a];break}return n<i?-1:i<n?1:0},h.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},h.concat=function(e,t){if(!ma(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return h.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var i=h.allocUnsafe(t),a=0;for(n=0;n<e.length;++n){var o=e[n];if(!J(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,a),a+=o.length}return i};function $a(r,e){if(J(r))return r.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;typeof r!="string"&&(r=""+r);var t=r.length;if(t===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return tt(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Ra(r).length;default:if(n)return tt(r).length;e=(""+e).toLowerCase(),n=!0}}h.byteLength=$a;function _c(r,e,t){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return Ic(this,e,t);case"utf8":case"utf-8":return Oa(this,e,t);case"ascii":return Ac(this,e,t);case"latin1":case"binary":return Oc(this,e,t);case"base64":return Ec(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pc(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}h.prototype._isBuffer=!0;function Ee(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}h.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)Ee(this,t,t+1);return this},h.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)Ee(this,t,t+3),Ee(this,t+1,t+2);return this},h.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)Ee(this,t,t+7),Ee(this,t+1,t+6),Ee(this,t+2,t+5),Ee(this,t+3,t+4);return this},h.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?Oa(this,0,e):_c.apply(this,arguments)},h.prototype.equals=function(e){if(!J(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:h.compare(this,e)===0},h.prototype.inspect=function(){var e="",t=dc;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},h.prototype.compare=function(e,t,n,i,a){if(!J(e))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),t<0||n>e.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&t>=n)return 0;if(i>=a)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,a>>>=0,this===e)return 0;for(var o=a-i,s=n-t,f=Math.min(o,s),d=this.slice(i,a),c=e.slice(t,n),u=0;u<f;++u)if(d[u]!==c[u]){o=d[u],s=c[u];break}return o<s?-1:s<o?1:0};function Ea(r,e,t,n,i){if(r.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=i?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(i)return-1;t=r.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof e=="string"&&(e=h.from(e,n)),J(e))return e.length===0?-1:Sa(r,e,t,n,i);if(typeof e=="number")return e=e&255,h.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):Sa(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}function Sa(r,e,t,n,i){var a=1,o=r.length,s=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||e.length<2)return-1;a=2,o/=2,s/=2,t/=2}function f(y,m){return a===1?y[m]:y.readUInt16BE(m*a)}var d;if(i){var c=-1;for(d=t;d<o;d++)if(f(r,d)===f(e,c===-1?0:d-c)){if(c===-1&&(c=d),d-c+1===s)return c*a}else c!==-1&&(d-=d-c),c=-1}else for(t+s>o&&(t=o-s),d=t;d>=0;d--){for(var u=!0,l=0;l<s;l++)if(f(r,d+l)!==f(e,l)){u=!1;break}if(u)return d}return-1}h.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},h.prototype.indexOf=function(e,t,n){return Ea(this,e,t,n,!0)},h.prototype.lastIndexOf=function(e,t,n){return Ea(this,e,t,n,!1)};function vc(r,e,t,n){t=Number(t)||0;var i=r.length-t;n?(n=Number(n),n>i&&(n=i)):n=i;var a=e.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(e.substr(o*2,2),16);if(isNaN(s))return o;r[t+o]=s}return o}function mc(r,e,t,n){return nt(tt(e,r.length-t),r,t,n)}function Aa(r,e,t,n){return nt(Mc(e),r,t,n)}function wc(r,e,t,n){return Aa(r,e,t,n)}function bc(r,e,t,n){return nt(Ra(e),r,t,n)}function $c(r,e,t,n){return nt(Dc(e,r.length-t),r,t,n)}h.prototype.write=function(e,t,n,i){if(t===void 0)i="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")i=t,n=this.length,t=0;else if(isFinite(t))t=t|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-t;if((n===void 0||n>a)&&(n=a),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return vc(this,e,t,n);case"utf8":case"utf-8":return mc(this,e,t,n);case"ascii":return Aa(this,e,t,n);case"latin1":case"binary":return wc(this,e,t,n);case"base64":return bc(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $c(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ec(r,e,t){return e===0&&t===r.length?_a(r):_a(r.slice(e,t))}function Oa(r,e,t){t=Math.min(r.length,t);for(var n=[],i=e;i<t;){var a=r[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=t){var f,d,c,u;switch(s){case 1:a<128&&(o=a);break;case 2:f=r[i+1],(f&192)===128&&(u=(a&31)<<6|f&63,u>127&&(o=u));break;case 3:f=r[i+1],d=r[i+2],(f&192)===128&&(d&192)===128&&(u=(a&15)<<12|(f&63)<<6|d&63,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:f=r[i+1],d=r[i+2],c=r[i+3],(f&192)===128&&(d&192)===128&&(c&192)===128&&(u=(a&15)<<18|(f&63)<<12|(d&63)<<6|c&63,u>65535&&u<1114112&&(o=u))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=s}return Sc(n)}var Ia=4096;function Sc(r){var e=r.length;if(e<=Ia)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=Ia));return t}function Ac(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]&127);return n}function Oc(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]);return n}function Ic(r,e,t){var n=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>n)&&(t=n);for(var i="",a=e;a<t;++a)i+=Fc(r[a]);return i}function Pc(r,e,t){for(var n=r.slice(e,t),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+n[a+1]*256);return i}h.prototype.slice=function(e,t){var n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);var i;if(h.TYPED_ARRAY_SUPPORT)i=this.subarray(e,t),i.__proto__=h.prototype;else{var a=t-e;i=new h(a,void 0);for(var o=0;o<a;++o)i[o]=this[o+e]}return i};function q(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}h.prototype.readUIntLE=function(e,t,n){e=e|0,t=t|0,n||q(e,t,this.length);for(var i=this[e],a=1,o=0;++o<t&&(a*=256);)i+=this[e+o]*a;return i},h.prototype.readUIntBE=function(e,t,n){e=e|0,t=t|0,n||q(e,t,this.length);for(var i=this[e+--t],a=1;t>0&&(a*=256);)i+=this[e+--t]*a;return i},h.prototype.readUInt8=function(e,t){return t||q(e,1,this.length),this[e]},h.prototype.readUInt16LE=function(e,t){return t||q(e,2,this.length),this[e]|this[e+1]<<8},h.prototype.readUInt16BE=function(e,t){return t||q(e,2,this.length),this[e]<<8|this[e+1]},h.prototype.readUInt32LE=function(e,t){return t||q(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},h.prototype.readUInt32BE=function(e,t){return t||q(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},h.prototype.readIntLE=function(e,t,n){e=e|0,t=t|0,n||q(e,t,this.length);for(var i=this[e],a=1,o=0;++o<t&&(a*=256);)i+=this[e+o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*t)),i},h.prototype.readIntBE=function(e,t,n){e=e|0,t=t|0,n||q(e,t,this.length);for(var i=t,a=1,o=this[e+--i];i>0&&(a*=256);)o+=this[e+--i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*t)),o},h.prototype.readInt8=function(e,t){return t||q(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},h.prototype.readInt16LE=function(e,t){t||q(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},h.prototype.readInt16BE=function(e,t){t||q(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},h.prototype.readInt32LE=function(e,t){return t||q(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},h.prototype.readInt32BE=function(e,t){return t||q(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},h.prototype.readFloatLE=function(e,t){return t||q(e,4,this.length),Jr(this,e,!0,23,4)},h.prototype.readFloatBE=function(e,t){return t||q(e,4,this.length),Jr(this,e,!1,23,4)},h.prototype.readDoubleLE=function(e,t){return t||q(e,8,this.length),Jr(this,e,!0,52,8)},h.prototype.readDoubleBE=function(e,t){return t||q(e,8,this.length),Jr(this,e,!1,52,8)};function H(r,e,t,n,i,a){if(!J(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<a)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError("Index out of range")}h.prototype.writeUIntLE=function(e,t,n,i){if(e=+e,t=t|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;H(this,e,t,n,a,0)}var o=1,s=0;for(this[t]=e&255;++s<n&&(o*=256);)this[t+s]=e/o&255;return t+n},h.prototype.writeUIntBE=function(e,t,n,i){if(e=+e,t=t|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;H(this,e,t,n,a,0)}var o=n-1,s=1;for(this[t+o]=e&255;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+n},h.prototype.writeUInt8=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,1,255,0),h.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=e&255,t+1};function et(r,e,t,n){e<0&&(e=65535+e+1);for(var i=0,a=Math.min(r.length-t,2);i<a;++i)r[t+i]=(e&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}h.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):et(this,e,t,!0),t+2},h.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):et(this,e,t,!1),t+2};function rt(r,e,t,n){e<0&&(e=4294967295+e+1);for(var i=0,a=Math.min(r.length-t,4);i<a;++i)r[t+i]=e>>>(n?i:3-i)*8&255}h.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255):rt(this,e,t,!0),t+4},h.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):rt(this,e,t,!1),t+4},h.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t=t|0,!i){var a=Math.pow(2,8*n-1);H(this,e,t,n,a-1,-a)}var o=0,s=1,f=0;for(this[t]=e&255;++o<n&&(s*=256);)e<0&&f===0&&this[t+o-1]!==0&&(f=1),this[t+o]=(e/s>>0)-f&255;return t+n},h.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t=t|0,!i){var a=Math.pow(2,8*n-1);H(this,e,t,n,a-1,-a)}var o=n-1,s=1,f=0;for(this[t+o]=e&255;--o>=0&&(s*=256);)e<0&&f===0&&this[t+o+1]!==0&&(f=1),this[t+o]=(e/s>>0)-f&255;return t+n},h.prototype.writeInt8=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,1,127,-128),h.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=e&255,t+1},h.prototype.writeInt16LE=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):et(this,e,t,!0),t+2},h.prototype.writeInt16BE=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):et(this,e,t,!1),t+2},h.prototype.writeInt32LE=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):rt(this,e,t,!0),t+4},h.prototype.writeInt32BE=function(e,t,n){return e=+e,t=t|0,n||H(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),h.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):rt(this,e,t,!1),t+4};function Pa(r,e,t,n,i,a){if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function xa(r,e,t,n,i){return i||Pa(r,e,t,4),va(r,e,t,n,23,4),t+4}h.prototype.writeFloatLE=function(e,t,n){return xa(this,e,t,!0,n)},h.prototype.writeFloatBE=function(e,t,n){return xa(this,e,t,!1,n)};function Ta(r,e,t,n,i){return i||Pa(r,e,t,8),va(r,e,t,n,52,8),t+8}h.prototype.writeDoubleLE=function(e,t,n){return Ta(this,e,t,!0,n)},h.prototype.writeDoubleBE=function(e,t,n){return Ta(this,e,t,!1,n)},h.prototype.copy=function(e,t,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n||e.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(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);var a=i-n,o;if(this===e&&n<t&&t<i)for(o=a-1;o>=0;--o)e[o+t]=this[o+n];else if(a<1e3||!h.TYPED_ARRAY_SUPPORT)for(o=0;o<a;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},h.prototype.fill=function(e,t,n,i){if(typeof e=="string"){if(typeof t=="string"?(i=t,t=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),e.length===1){var a=e.charCodeAt(0);a<256&&(e=a)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!h.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof e=="number"&&(e=e&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,e||(e=0);var o;if(typeof e=="number")for(o=t;o<n;++o)this[o]=e;else{var s=J(e)?e:tt(new h(e,i).toString()),f=s.length;for(o=0;o<n-t;++o)this[o+t]=s[o%f]}return this};var xc=/[^+\/0-9A-Za-z-_]/g;function Tc(r){if(r=Rc(r).replace(xc,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function Rc(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function Fc(r){return r<16?"0"+r.toString(16):r.toString(16)}function tt(r,e){e=e||1/0;for(var t,n=r.length,i=null,a=[],o=0;o<n;++o){if(t=r.charCodeAt(o),t>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&a.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&a.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,t<128){if((e-=1)<0)break;a.push(t)}else if(t<2048){if((e-=2)<0)break;a.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;a.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;a.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return a}function Mc(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function Dc(r,e){for(var t,n,i,a=[],o=0;o<r.length&&!((e-=2)<0);++o)t=r.charCodeAt(o),n=t>>8,i=t%256,a.push(i),a.push(n);return a}function Ra(r){return sc(Tc(r))}function nt(r,e,t,n){for(var i=0;i<n&&!(i+t>=e.length||i>=r.length);++i)e[i+t]=r[i];return i}function Cc(r){return r!==r}function Nc(r){return r!=null&&(!!r._isBuffer||Fa(r)||Bc(r))}function Fa(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function Bc(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&Fa(r.slice(0,0))}function Ma(){throw new Error("setTimeout has not been defined")}function Da(){throw new Error("clearTimeout has not been defined")}var pe=Ma,he=Da;typeof je.setTimeout=="function"&&(pe=setTimeout),typeof je.clearTimeout=="function"&&(he=clearTimeout);function Ca(r){if(pe===setTimeout)return setTimeout(r,0);if((pe===Ma||!pe)&&setTimeout)return pe=setTimeout,setTimeout(r,0);try{return pe(r,0)}catch{try{return pe.call(null,r,0)}catch{return pe.call(this,r,0)}}}function qc(r){if(he===clearTimeout)return clearTimeout(r);if((he===Da||!he)&&clearTimeout)return he=clearTimeout,clearTimeout(r);try{return he(r)}catch{try{return he.call(null,r)}catch{return he.call(this,r)}}}var se=[],Ve=!1,Se,it=-1;function Uc(){!Ve||!Se||(Ve=!1,Se.length?se=Se.concat(se):it=-1,se.length&&Na())}function Na(){if(!Ve){var r=Ca(Uc);Ve=!0;for(var e=se.length;e;){for(Se=se,se=[];++it<e;)Se&&Se[it].run();it=-1,e=se.length}Se=null,Ve=!1,qc(r)}}function kc(r){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];se.push(new Ba(r,e)),se.length===1&&!Ve&&Ca(Na)}function Ba(r,e){this.fun=r,this.array=e}Ba.prototype.run=function(){this.fun.apply(null,this.array)};var Lc="browser",jc="browser",Vc=!0,Gc={},Hc=[],Wc="",zc={},Xc={},Yc={};function Ae(){}var Kc=Ae,Zc=Ae,Jc=Ae,Qc=Ae,el=Ae,rl=Ae,tl=Ae;function nl(r){throw new Error("process.binding is not supported")}function il(){return"/"}function al(r){throw new Error("process.chdir is not supported")}function ol(){return 0}var Ge=je.performance||{},ul=Ge.now||Ge.mozNow||Ge.msNow||Ge.oNow||Ge.webkitNow||function(){return new Date().getTime()};function sl(r){var e=ul.call(Ge)*.001,t=Math.floor(e),n=Math.floor(e%1*1e9);return r&&(t=t-r[0],n=n-r[1],n<0&&(t--,n+=1e9)),[t,n]}var fl=new Date;function cl(){var r=new Date,e=r-fl;return e/1e3}var He={nextTick:kc,title:Lc,browser:Vc,env:Gc,argv:Hc,version:Wc,versions:zc,on:Kc,addListener:Zc,once:Jc,off:Qc,removeListener:el,removeAllListeners:rl,emit:tl,binding:nl,cwd:il,chdir:al,umask:ol,hrtime:sl,platform:jc,release:Xc,config:Yc,uptime:cl},En;typeof Object.create=="function"?En=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:En=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e};var qa=En,Ua=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},i=0;i<t.length;i++)n[t[i]]=Object.getOwnPropertyDescriptor(e,t[i]);return n},ll=/%[sdj%]/g;function at(r){if(!yr(r)){for(var e=[],t=0;t<arguments.length;t++)e.push(Q(arguments[t]));return e.join(" ")}for(var t=1,n=arguments,i=n.length,a=String(r).replace(ll,function(s){if(s==="%%")return"%";if(t>=i)return s;switch(s){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 s}}),o=n[t];t<i;o=n[++t])hr(o)||!Oe(o)?a+=" "+o:a+=" "+Q(o);return a}function Sn(r,e){if(ee(je.process))return function(){return Sn(r,e).apply(this,arguments)};if(He.noDeprecation===!0)return r;var t=!1;function n(){if(!t){if(He.throwDeprecation)throw new Error(e);He.traceDeprecation?console.trace(e):console.error(e),t=!0}return r.apply(this,arguments)}return n}var ot={},An;function ka(r){if(ee(An)&&(An=He.env.NODE_DEBUG||""),r=r.toUpperCase(),!ot[r])if(new RegExp("\\b"+r+"\\b","i").test(An)){var e=0;ot[r]=function(){var t=at.apply(null,arguments);console.error("%s %d: %s",r,e,t)}}else ot[r]=function(){};return ot[r]}function Q(r,e){var t={seen:[],stylize:pl};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),st(e)?t.showHidden=e:e&&Fn(t,e),ee(t.showHidden)&&(t.showHidden=!1),ee(t.depth)&&(t.depth=2),ee(t.colors)&&(t.colors=!1),ee(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=dl),ut(t,r,t.depth)}Q.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]},Q.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function dl(r,e){var t=Q.styles[e];return t?"\x1B["+Q.colors[t][0]+"m"+r+"\x1B["+Q.colors[t][1]+"m":r}function pl(r,e){return r}function hl(r){var e={};return r.forEach(function(t,n){e[t]=!0}),e}function ut(r,e,t){if(r.customInspect&&e&&vr(e.inspect)&&e.inspect!==Q&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(t,r);return yr(n)||(n=ut(r,n,t)),n}var i=yl(r,e);if(i)return i;var a=Object.keys(e),o=hl(a);if(r.showHidden&&(a=Object.getOwnPropertyNames(e)),_r(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return On(e);if(a.length===0){if(vr(e)){var s=e.name?": "+e.name:"";return r.stylize("[Function"+s+"]","special")}if(gr(e))return r.stylize(RegExp.prototype.toString.call(e),"regexp");if(ft(e))return r.stylize(Date.prototype.toString.call(e),"date");if(_r(e))return On(e)}var f="",d=!1,c=["{","}"];if(Pn(e)&&(d=!0,c=["[","]"]),vr(e)){var u=e.name?": "+e.name:"";f=" [Function"+u+"]"}if(gr(e)&&(f=" "+RegExp.prototype.toString.call(e)),ft(e)&&(f=" "+Date.prototype.toUTCString.call(e)),_r(e)&&(f=" "+On(e)),a.length===0&&(!d||e.length==0))return c[0]+f+c[1];if(t<0)return gr(e)?r.stylize(RegExp.prototype.toString.call(e),"regexp"):r.stylize("[Object]","special");r.seen.push(e);var l;return d?l=gl(r,e,t,o,a):l=a.map(function(y){return In(r,e,t,o,y,d)}),r.seen.pop(),_l(l,f,c)}function yl(r,e){if(ee(e))return r.stylize("undefined","undefined");if(yr(e)){var t="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return r.stylize(t,"string")}if(xn(e))return r.stylize(""+e,"number");if(st(e))return r.stylize(""+e,"boolean");if(hr(e))return r.stylize("null","null")}function On(r){return"["+Error.prototype.toString.call(r)+"]"}function gl(r,e,t,n,i){for(var a=[],o=0,s=e.length;o<s;++o)Wa(e,String(o))?a.push(In(r,e,t,n,String(o),!0)):a.push("");return i.forEach(function(f){f.match(/^\d+$/)||a.push(In(r,e,t,n,f,!0))}),a}function In(r,e,t,n,i,a){var o,s,f;if(f=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},f.get?f.set?s=r.stylize("[Getter/Setter]","special"):s=r.stylize("[Getter]","special"):f.set&&(s=r.stylize("[Setter]","special")),Wa(n,i)||(o="["+i+"]"),s||(r.seen.indexOf(f.value)<0?(hr(t)?s=ut(r,f.value,null):s=ut(r,f.value,t-1),s.indexOf(`
9
9
  `)>-1&&(a?s=s.split(`
10
- `).map(function(c){return" "+c}).join(`
10
+ `).map(function(d){return" "+d}).join(`
11
11
  `).substr(2):s=`
12
12
  `+s.split(`
13
- `).map(function(c){return" "+c}).join(`
14
- `))):s=r.stylize("[Circular]","special")),ee(o)){if(a&&i.match(/^\d+$/))return s;o=JSON.stringify(""+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=r.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=r.stylize(o,"string"))}return o+": "+s}function el(r,e,t){var n=r.reduce(function(i,a){return a.indexOf(`
13
+ `).map(function(d){return" "+d}).join(`
14
+ `))):s=r.stylize("[Circular]","special")),ee(o)){if(a&&i.match(/^\d+$/))return s;o=JSON.stringify(""+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=r.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=r.stylize(o,"string"))}return o+": "+s}function _l(r,e,t){var n=r.reduce(function(i,a){return a.indexOf(`
15
15
  `)>=0,i+a.replace(/\u001b\[\d\d?m/g,"").length+1},0);return n>60?t[0]+(e===""?"":e+`
16
16
  `)+" "+r.join(`,
17
- `)+" "+t[1]:t[0]+e+" "+r.join(", ")+" "+t[1]}function $n(r){return Array.isArray(r)}function ot(r){return typeof r=="boolean"}function yr(r){return r===null}function Oa(r){return r==null}function En(r){return typeof r=="number"}function gr(r){return typeof r=="string"}function Ia(r){return typeof r=="symbol"}function ee(r){return r===void 0}function _r(r){return Pe(r)&&Sn(r)==="[object RegExp]"}function Pe(r){return typeof r=="object"&&r!==null}function st(r){return Pe(r)&&Sn(r)==="[object Date]"}function vr(r){return Pe(r)&&(Sn(r)==="[object Error]"||r instanceof Error)}function mr(r){return typeof r=="function"}function xa(r){return r===null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||typeof r=="symbol"||typeof r>"u"}function Pa(r){return h.isBuffer(r)}function Sn(r){return Object.prototype.toString.call(r)}function An(r){return r<10?"0"+r.toString(10):r.toString(10)}var rl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function tl(){var r=new Date,e=[An(r.getHours()),An(r.getMinutes()),An(r.getSeconds())].join(":");return[r.getDate(),rl[r.getMonth()],e].join(" ")}function Ta(){console.log("%s - %s",tl(),nt.apply(null,arguments))}function On(r,e){if(!e||!Pe(e))return r;for(var t=Object.keys(e),n=t.length;n--;)r[t[n]]=e[t[n]];return r}function Ra(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var Te=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function In(r){if(typeof r!="function")throw new TypeError('The "original" argument must be of type Function');if(Te&&r[Te]){var e=r[Te];if(typeof e!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,Te,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var t,n,i=new Promise(function(s,f){t=s,n=f}),a=[],o=0;o<arguments.length;o++)a.push(arguments[o]);a.push(function(s,f){s?n(s):t(f)});try{r.apply(this,a)}catch(s){n(s)}return i}return Object.setPrototypeOf(e,Object.getPrototypeOf(r)),Te&&Object.defineProperty(e,Te,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,Sa(r))}In.custom=Te;function nl(r,e){if(!r){var t=new Error("Promise was rejected with a falsy value");t.reason=r,r=t}return e(r)}function Fa(r){if(typeof r!="function")throw new TypeError('The "original" argument must be of type Function');function e(){for(var t=[],n=0;n<arguments.length;n++)t.push(arguments[n]);var i=t.pop();if(typeof i!="function")throw new TypeError("The last argument must be of type Function");var a=this,o=function(){return i.apply(a,arguments)};r.apply(this,t).then(function(s){Xe.nextTick(o.bind(null,null,s))},function(s){Xe.nextTick(nl.bind(null,s,o))})}return Object.setPrototypeOf(e,Object.getPrototypeOf(r)),Object.defineProperties(e,Sa(r)),e}var il={inherits:Ea,_extend:On,log:Ta,isBuffer:Pa,isPrimitive:xa,isFunction:mr,isError:vr,isDate:st,isObject:Pe,isRegExp:_r,isUndefined:ee,isSymbol:Ia,isString:gr,isNumber:En,isNullOrUndefined:Oa,isNull:yr,isBoolean:ot,isArray:$n,inspect:Q,deprecate:vn,format:nt,debuglog:Aa,promisify:In,callbackify:Fa},al=Object.freeze({__proto__:null,_extend:On,callbackify:Fa,debuglog:Aa,default:il,deprecate:vn,format:nt,inherits:Ea,inspect:Q,isArray:$n,isBoolean:ot,isBuffer:Pa,isDate:st,isError:vr,isFunction:mr,isNull:yr,isNullOrUndefined:Oa,isNumber:En,isObject:Pe,isPrimitive:xa,isRegExp:_r,isString:gr,isSymbol:Ia,isUndefined:ee,log:Ta,promisify:In}),ol=nf(al),sl=ol.inspect,xn=typeof Map=="function"&&Map.prototype,Pn=Object.getOwnPropertyDescriptor&&xn?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,ut=xn&&Pn&&typeof Pn.get=="function"?Pn.get:null,Ma=xn&&Map.prototype.forEach,Tn=typeof Set=="function"&&Set.prototype,Rn=Object.getOwnPropertyDescriptor&&Tn?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,ft=Tn&&Rn&&typeof Rn.get=="function"?Rn.get:null,Da=Tn&&Set.prototype.forEach,ul=typeof WeakMap=="function"&&WeakMap.prototype,wr=ul?WeakMap.prototype.has:null,fl=typeof WeakSet=="function"&&WeakSet.prototype,br=fl?WeakSet.prototype.has:null,cl=typeof WeakRef=="function"&&WeakRef.prototype,Ca=cl?WeakRef.prototype.deref:null,ll=Boolean.prototype.valueOf,dl=Object.prototype.toString,pl=Function.prototype.toString,hl=String.prototype.match,Fn=String.prototype.slice,pe=String.prototype.replace,yl=String.prototype.toUpperCase,Na=String.prototype.toLowerCase,Ba=RegExp.prototype.test,Ua=Array.prototype.concat,re=Array.prototype.join,gl=Array.prototype.slice,qa=Math.floor,Mn=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Dn=Object.getOwnPropertySymbols,Cn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ye=typeof Symbol=="function"&&typeof Symbol.iterator=="object",k=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ye||"symbol")?Symbol.toStringTag:null,ka=Object.prototype.propertyIsEnumerable,La=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function ja(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||Ba.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-qa(-r):qa(r);if(n!==r){var i=String(n),a=Fn.call(e,i.length+1);return pe.call(i,t,"$&_")+"."+pe.call(pe.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return pe.call(e,t,"$&_")}var Nn=sl,Va=Nn.custom,Ga=za(Va)?Va:null,_l=function r(e,t,n,i){var a=t||{};if(he(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(he(a,"maxStringLength")&&(typeof a.maxStringLength=="number"?a.maxStringLength<0&&a.maxStringLength!==1/0:a.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=he(a,"customInspect")?a.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(he(a,"indent")&&a.indent!==null&&a.indent!==" "&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(he(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var s=a.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Ya(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var f=String(e);return s?ja(e,f):f}if(typeof e=="bigint"){var c=String(e)+"n";return s?ja(e,c):c}var l=typeof a.depth>"u"?5:a.depth;if(typeof n>"u"&&(n=0),n>=l&&l>0&&typeof e=="object")return Bn(e)?"[Array]":"[Object]";var u=Cl(a,n);if(typeof i>"u")i=[];else if(Xa(i,e)>=0)return"[Circular]";function d(Y,me,dr){if(me&&(i=gl.call(i),i.push(me)),dr){var we={depth:a.depth};return he(a,"quoteStyle")&&(we.quoteStyle=a.quoteStyle),r(Y,we,n+1,i)}return r(Y,a,n+1,i)}if(typeof e=="function"&&!Wa(e)){var y=Ol(e),b=ct(e,d);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(b.length>0?" { "+re.call(b,", ")+" }":"")}if(za(e)){var S=Ye?pe.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Cn.call(e);return typeof e=="object"&&!Ye?$r(S):S}if(Fl(e)){for(var O="<"+Na.call(String(e.nodeName)),$=e.attributes||[],E=0;E<$.length;E++)O+=" "+$[E].name+"="+Ha(vl($[E].value),"double",a);return O+=">",e.childNodes&&e.childNodes.length&&(O+="..."),O+="</"+Na.call(String(e.nodeName))+">",O}if(Bn(e)){if(e.length===0)return"[]";var p=ct(e,d);return u&&!Dl(p)?"["+qn(p,u)+"]":"[ "+re.call(p,", ")+" ]"}if(wl(e)){var I=ct(e,d);return!("cause"in Error.prototype)&&"cause"in e&&!ka.call(e,"cause")?"{ ["+String(e)+"] "+re.call(Ua.call("[cause]: "+d(e.cause),I),", ")+" }":I.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+re.call(I,", ")+" }"}if(typeof e=="object"&&o){if(Ga&&typeof e[Ga]=="function"&&Nn)return Nn(e,{depth:l-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Il(e)){var T=[];return Ma&&Ma.call(e,function(Y,me){T.push(d(me,e,!0)+" => "+d(Y,e))}),Ka("Map",ut.call(e),T,u)}if(Tl(e)){var F=[];return Da&&Da.call(e,function(Y){F.push(d(Y,e))}),Ka("Set",ft.call(e),F,u)}if(xl(e))return Un("WeakMap");if(Rl(e))return Un("WeakSet");if(Pl(e))return Un("WeakRef");if($l(e))return $r(d(Number(e)));if(Sl(e))return $r(d(Mn.call(e)));if(El(e))return $r(ll.call(e));if(bl(e))return $r(d(String(e)));if(!ml(e)&&!Wa(e)){var m=ct(e,d),g=La?La(e)===Object.prototype:e instanceof Object||e.constructor===Object,_=e instanceof Object?"":"null prototype",A=!g&&k&&Object(e)===e&&k in e?Fn.call(ye(e),8,-1):_?"Object":"",x=g||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",M=x+(A||_?"["+re.call(Ua.call([],A||[],_||[]),": ")+"] ":"");return m.length===0?M+"{}":u?M+"{"+qn(m,u)+"}":M+"{ "+re.call(m,", ")+" }"}return String(e)};function Ha(r,e,t){var n=(t.quoteStyle||e)==="double"?'"':"'";return n+r+n}function vl(r){return pe.call(String(r),/"/g,"&quot;")}function Bn(r){return ye(r)==="[object Array]"&&(!k||!(typeof r=="object"&&k in r))}function ml(r){return ye(r)==="[object Date]"&&(!k||!(typeof r=="object"&&k in r))}function Wa(r){return ye(r)==="[object RegExp]"&&(!k||!(typeof r=="object"&&k in r))}function wl(r){return ye(r)==="[object Error]"&&(!k||!(typeof r=="object"&&k in r))}function bl(r){return ye(r)==="[object String]"&&(!k||!(typeof r=="object"&&k in r))}function $l(r){return ye(r)==="[object Number]"&&(!k||!(typeof r=="object"&&k in r))}function El(r){return ye(r)==="[object Boolean]"&&(!k||!(typeof r=="object"&&k in r))}function za(r){if(Ye)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!Cn)return!1;try{return Cn.call(r),!0}catch{}return!1}function Sl(r){if(!r||typeof r!="object"||!Mn)return!1;try{return Mn.call(r),!0}catch{}return!1}var Al=Object.prototype.hasOwnProperty||function(r){return r in this};function he(r,e){return Al.call(r,e)}function ye(r){return dl.call(r)}function Ol(r){if(r.name)return r.name;var e=hl.call(pl.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}function Xa(r,e){if(r.indexOf)return r.indexOf(e);for(var t=0,n=r.length;t<n;t++)if(r[t]===e)return t;return-1}function Il(r){if(!ut||!r||typeof r!="object")return!1;try{ut.call(r);try{ft.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function xl(r){if(!wr||!r||typeof r!="object")return!1;try{wr.call(r,wr);try{br.call(r,br)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function Pl(r){if(!Ca||!r||typeof r!="object")return!1;try{return Ca.call(r),!0}catch{}return!1}function Tl(r){if(!ft||!r||typeof r!="object")return!1;try{ft.call(r);try{ut.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function Rl(r){if(!br||!r||typeof r!="object")return!1;try{br.call(r,br);try{wr.call(r,wr)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function Fl(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function Ya(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return Ya(Fn.call(r,0,e.maxStringLength),e)+n}var i=pe.call(pe.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Ml);return Ha(i,"single",e)}function Ml(r){var e=r.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+yl.call(e.toString(16))}function $r(r){return"Object("+r+")"}function Un(r){return r+" { ? }"}function Ka(r,e,t,n){var i=n?qn(t,n):re.call(t,", ");return r+" ("+e+") {"+i+"}"}function Dl(r){for(var e=0;e<r.length;e++)if(Xa(r[e],`
18
- `)>=0)return!1;return!0}function Cl(r,e){var t;if(r.indent===" ")t=" ";else if(typeof r.indent=="number"&&r.indent>0)t=re.call(Array(r.indent+1)," ");else return null;return{base:t,prev:re.call(Array(e+1),t)}}function qn(r,e){if(r.length===0)return"";var t=`
17
+ `)+" "+t[1]:t[0]+e+" "+r.join(", ")+" "+t[1]}function Pn(r){return Array.isArray(r)}function st(r){return typeof r=="boolean"}function hr(r){return r===null}function La(r){return r==null}function xn(r){return typeof r=="number"}function yr(r){return typeof r=="string"}function ja(r){return typeof r=="symbol"}function ee(r){return r===void 0}function gr(r){return Oe(r)&&Tn(r)==="[object RegExp]"}function Oe(r){return typeof r=="object"&&r!==null}function ft(r){return Oe(r)&&Tn(r)==="[object Date]"}function _r(r){return Oe(r)&&(Tn(r)==="[object Error]"||r instanceof Error)}function vr(r){return typeof r=="function"}function Va(r){return r===null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||typeof r=="symbol"||typeof r>"u"}function Ga(r){return h.isBuffer(r)}function Tn(r){return Object.prototype.toString.call(r)}function Rn(r){return r<10?"0"+r.toString(10):r.toString(10)}var vl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ml(){var r=new Date,e=[Rn(r.getHours()),Rn(r.getMinutes()),Rn(r.getSeconds())].join(":");return[r.getDate(),vl[r.getMonth()],e].join(" ")}function Ha(){console.log("%s - %s",ml(),at.apply(null,arguments))}function Fn(r,e){if(!e||!Oe(e))return r;for(var t=Object.keys(e),n=t.length;n--;)r[t[n]]=e[t[n]];return r}function Wa(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var Ie=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function Mn(r){if(typeof r!="function")throw new TypeError('The "original" argument must be of type Function');if(Ie&&r[Ie]){var e=r[Ie];if(typeof e!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,Ie,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var t,n,i=new Promise(function(s,f){t=s,n=f}),a=[],o=0;o<arguments.length;o++)a.push(arguments[o]);a.push(function(s,f){s?n(s):t(f)});try{r.apply(this,a)}catch(s){n(s)}return i}return Object.setPrototypeOf(e,Object.getPrototypeOf(r)),Ie&&Object.defineProperty(e,Ie,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,Ua(r))}Mn.custom=Ie;function wl(r,e){if(!r){var t=new Error("Promise was rejected with a falsy value");t.reason=r,r=t}return e(r)}function za(r){if(typeof r!="function")throw new TypeError('The "original" argument must be of type Function');function e(){for(var t=[],n=0;n<arguments.length;n++)t.push(arguments[n]);var i=t.pop();if(typeof i!="function")throw new TypeError("The last argument must be of type Function");var a=this,o=function(){return i.apply(a,arguments)};r.apply(this,t).then(function(s){He.nextTick(o.bind(null,null,s))},function(s){He.nextTick(wl.bind(null,s,o))})}return Object.setPrototypeOf(e,Object.getPrototypeOf(r)),Object.defineProperties(e,Ua(r)),e}var bl={inherits:qa,_extend:Fn,log:Ha,isBuffer:Ga,isPrimitive:Va,isFunction:vr,isError:_r,isDate:ft,isObject:Oe,isRegExp:gr,isUndefined:ee,isSymbol:ja,isString:yr,isNumber:xn,isNullOrUndefined:La,isNull:hr,isBoolean:st,isArray:Pn,inspect:Q,deprecate:Sn,format:at,debuglog:ka,promisify:Mn,callbackify:za},$l=Object.freeze({__proto__:null,_extend:Fn,callbackify:za,debuglog:ka,default:bl,deprecate:Sn,format:at,inherits:qa,inspect:Q,isArray:Pn,isBoolean:st,isBuffer:Ga,isDate:ft,isError:_r,isFunction:vr,isNull:hr,isNullOrUndefined:La,isNumber:xn,isObject:Oe,isPrimitive:Va,isRegExp:gr,isString:yr,isSymbol:ja,isUndefined:ee,log:Ha,promisify:Mn}),El=Xf($l),Sl=El.inspect,Dn=typeof Map=="function"&&Map.prototype,Cn=Object.getOwnPropertyDescriptor&&Dn?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,ct=Dn&&Cn&&typeof Cn.get=="function"?Cn.get:null,Xa=Dn&&Map.prototype.forEach,Nn=typeof Set=="function"&&Set.prototype,Bn=Object.getOwnPropertyDescriptor&&Nn?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,lt=Nn&&Bn&&typeof Bn.get=="function"?Bn.get:null,Ya=Nn&&Set.prototype.forEach,Al=typeof WeakMap=="function"&&WeakMap.prototype,mr=Al?WeakMap.prototype.has:null,Ol=typeof WeakSet=="function"&&WeakSet.prototype,wr=Ol?WeakSet.prototype.has:null,Il=typeof WeakRef=="function"&&WeakRef.prototype,Ka=Il?WeakRef.prototype.deref:null,Pl=Boolean.prototype.valueOf,xl=Object.prototype.toString,Tl=Function.prototype.toString,Rl=String.prototype.match,qn=String.prototype.slice,ye=String.prototype.replace,Fl=String.prototype.toUpperCase,Za=String.prototype.toLowerCase,Ja=RegExp.prototype.test,Qa=Array.prototype.concat,re=Array.prototype.join,Ml=Array.prototype.slice,eo=Math.floor,Un=typeof BigInt=="function"?BigInt.prototype.valueOf:null,kn=Object.getOwnPropertySymbols,Ln=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,We=typeof Symbol=="function"&&typeof Symbol.iterator=="object",br=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===We||"symbol")?Symbol.toStringTag:null,ro=Object.prototype.propertyIsEnumerable,to=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function no(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||Ja.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-eo(-r):eo(r);if(n!==r){var i=String(n),a=qn.call(e,i.length+1);return ye.call(i,t,"$&_")+"."+ye.call(ye.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ye.call(e,t,"$&_")}var jn=Sl,io=jn.custom,ao=fo(io)?io:null,oo={__proto__:null,double:'"',single:"'"},Dl={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},dt=function r(e,t,n,i){var a=t||{};if(fe(a,"quoteStyle")&&!fe(oo,a.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(fe(a,"maxStringLength")&&(typeof a.maxStringLength=="number"?a.maxStringLength<0&&a.maxStringLength!==1/0:a.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=fe(a,"customInspect")?a.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(fe(a,"indent")&&a.indent!==null&&a.indent!==" "&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(fe(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var s=a.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return lo(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var f=String(e);return s?no(e,f):f}if(typeof e=="bigint"){var d=String(e)+"n";return s?no(e,d):d}var c=typeof a.depth>"u"?5:a.depth;if(typeof n>"u"&&(n=0),n>=c&&c>0&&typeof e=="object")return Vn(e)?"[Array]":"[Object]";var u=Jl(a,n);if(typeof i>"u")i=[];else if(co(i,e)>=0)return"[Circular]";function l(W,oe,Y){if(oe&&(i=Ml.call(i),i.push(oe)),Y){var ke={depth:a.depth};return fe(a,"quoteStyle")&&(ke.quoteStyle=a.quoteStyle),r(W,ke,n+1,i)}return r(W,a,n+1,i)}if(typeof e=="function"&&!so(e)){var y=Vl(e),m=pt(e,l);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(m.length>0?" { "+re.call(m,", ")+" }":"")}if(fo(e)){var E=We?ye.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Ln.call(e);return typeof e=="object"&&!We?$r(E):E}if(Yl(e)){for(var S="<"+Za.call(String(e.nodeName)),O=e.attributes||[],$=0;$<O.length;$++)S+=" "+O[$].name+"="+uo(Cl(O[$].value),"double",a);return S+=">",e.childNodes&&e.childNodes.length&&(S+="..."),S+="</"+Za.call(String(e.nodeName))+">",S}if(Vn(e)){if(e.length===0)return"[]";var p=pt(e,l);return u&&!Zl(p)?"["+Hn(p,u)+"]":"[ "+re.call(p,", ")+" ]"}if(Bl(e)){var I=pt(e,l);return!("cause"in Error.prototype)&&"cause"in e&&!ro.call(e,"cause")?"{ ["+String(e)+"] "+re.call(Qa.call("[cause]: "+l(e.cause),I),", ")+" }":I.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+re.call(I,", ")+" }"}if(typeof e=="object"&&o){if(ao&&typeof e[ao]=="function"&&jn)return jn(e,{depth:c-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Gl(e)){var T=[];return Xa&&Xa.call(e,function(W,oe){T.push(l(oe,e,!0)+" => "+l(W,e))}),po("Map",ct.call(e),T,u)}if(zl(e)){var R=[];return Ya&&Ya.call(e,function(W){R.push(l(W,e))}),po("Set",lt.call(e),R,u)}if(Hl(e))return Gn("WeakMap");if(Xl(e))return Gn("WeakSet");if(Wl(e))return Gn("WeakRef");if(Ul(e))return $r(l(Number(e)));if(Ll(e))return $r(l(Un.call(e)));if(kl(e))return $r(Pl.call(e));if(ql(e))return $r(l(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof D<"u"&&e===D)return"{ [object globalThis] }";if(!Nl(e)&&!so(e)){var b=pt(e,l),g=to?to(e)===Object.prototype:e instanceof Object||e.constructor===Object,_=e instanceof Object?"":"null prototype",A=!g&&br&&Object(e)===e&&br in e?qn.call(ge(e),8,-1):_?"Object":"",P=g||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",B=P+(A||_?"["+re.call(Qa.call([],A||[],_||[]),": ")+"] ":"");return b.length===0?B+"{}":u?B+"{"+Hn(b,u)+"}":B+"{ "+re.call(b,", ")+" }"}return String(e)};function uo(r,e,t){var n=t.quoteStyle||e,i=oo[n];return i+r+i}function Cl(r){return ye.call(String(r),/"/g,"&quot;")}function Pe(r){return!br||!(typeof r=="object"&&(br in r||typeof r[br]<"u"))}function Vn(r){return ge(r)==="[object Array]"&&Pe(r)}function Nl(r){return ge(r)==="[object Date]"&&Pe(r)}function so(r){return ge(r)==="[object RegExp]"&&Pe(r)}function Bl(r){return ge(r)==="[object Error]"&&Pe(r)}function ql(r){return ge(r)==="[object String]"&&Pe(r)}function Ul(r){return ge(r)==="[object Number]"&&Pe(r)}function kl(r){return ge(r)==="[object Boolean]"&&Pe(r)}function fo(r){if(We)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!Ln)return!1;try{return Ln.call(r),!0}catch{}return!1}function Ll(r){if(!r||typeof r!="object"||!Un)return!1;try{return Un.call(r),!0}catch{}return!1}var jl=Object.prototype.hasOwnProperty||function(r){return r in this};function fe(r,e){return jl.call(r,e)}function ge(r){return xl.call(r)}function Vl(r){if(r.name)return r.name;var e=Rl.call(Tl.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}function co(r,e){if(r.indexOf)return r.indexOf(e);for(var t=0,n=r.length;t<n;t++)if(r[t]===e)return t;return-1}function Gl(r){if(!ct||!r||typeof r!="object")return!1;try{ct.call(r);try{lt.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function Hl(r){if(!mr||!r||typeof r!="object")return!1;try{mr.call(r,mr);try{wr.call(r,wr)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function Wl(r){if(!Ka||!r||typeof r!="object")return!1;try{return Ka.call(r),!0}catch{}return!1}function zl(r){if(!lt||!r||typeof r!="object")return!1;try{lt.call(r);try{ct.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function Xl(r){if(!wr||!r||typeof r!="object")return!1;try{wr.call(r,wr);try{mr.call(r,mr)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function Yl(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function lo(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return lo(qn.call(r,0,e.maxStringLength),e)+n}var i=Dl[e.quoteStyle||"single"];i.lastIndex=0;var a=ye.call(ye.call(r,i,"\\$1"),/[\x00-\x1f]/g,Kl);return uo(a,"single",e)}function Kl(r){var e=r.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+Fl.call(e.toString(16))}function $r(r){return"Object("+r+")"}function Gn(r){return r+" { ? }"}function po(r,e,t,n){var i=n?Hn(t,n):re.call(t,", ");return r+" ("+e+") {"+i+"}"}function Zl(r){for(var e=0;e<r.length;e++)if(co(r[e],`
18
+ `)>=0)return!1;return!0}function Jl(r,e){var t;if(r.indent===" ")t=" ";else if(typeof r.indent=="number"&&r.indent>0)t=re.call(Array(r.indent+1)," ");else return null;return{base:t,prev:re.call(Array(e+1),t)}}function Hn(r,e){if(r.length===0)return"";var t=`
19
19
  `+e.prev+e.base;return t+re.call(r,","+t)+`
20
- `+e.prev}function ct(r,e){var t=Bn(r),n=[];if(t){n.length=r.length;for(var i=0;i<r.length;i++)n[i]=he(r,i)?e(r[i],r):""}var a=typeof Dn=="function"?Dn(r):[],o;if(Ye){o={};for(var s=0;s<a.length;s++)o["$"+a[s]]=a[s]}for(var f in r)he(r,f)&&(t&&String(Number(f))===f&&f<r.length||Ye&&o["$"+f]instanceof Symbol||(Ba.call(/[^\w$]/,f)?n.push(e(f,r)+": "+e(r[f],r)):n.push(f+": "+e(r[f],r))));if(typeof Dn=="function")for(var c=0;c<a.length;c++)ka.call(r,a[c])&&n.push("["+e(a[c])+"]: "+e(r[a[c]],r));return n}var kn=dn,Ke=Vf,Nl=_l,Bl=kn("%TypeError%"),lt=kn("%WeakMap%",!0),dt=kn("%Map%",!0),Ul=Ke("WeakMap.prototype.get",!0),ql=Ke("WeakMap.prototype.set",!0),kl=Ke("WeakMap.prototype.has",!0),Ll=Ke("Map.prototype.get",!0),jl=Ke("Map.prototype.set",!0),Vl=Ke("Map.prototype.has",!0),Ln=function(r,e){for(var t=r,n;(n=t.next)!==null;t=n)if(n.key===e)return t.next=n.next,n.next=r.next,r.next=n,n},Gl=function(r,e){var t=Ln(r,e);return t&&t.value},Hl=function(r,e,t){var n=Ln(r,e);n?n.value=t:r.next={key:e,next:r.next,value:t}},Wl=function(r,e){return!!Ln(r,e)},zl=function(){var e,t,n,i={assert:function(a){if(!i.has(a))throw new Bl("Side channel does not contain "+Nl(a))},get:function(a){if(lt&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Ul(e,a)}else if(dt){if(t)return Ll(t,a)}else if(n)return Gl(n,a)},has:function(a){if(lt&&a&&(typeof a=="object"||typeof a=="function")){if(e)return kl(e,a)}else if(dt){if(t)return Vl(t,a)}else if(n)return Wl(n,a);return!1},set:function(a,o){lt&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new lt),ql(e,a,o)):dt?(t||(t=new dt),jl(t,a,o)):(n||(n={key:{},next:null}),Hl(n,a,o))}};return i},Xl=String.prototype.replace,Yl=/%20/g,jn={RFC1738:"RFC1738",RFC3986:"RFC3986"},Za={default:jn.RFC3986,formatters:{RFC1738:function(r){return Xl.call(r,Yl,"+")},RFC3986:function(r){return String(r)}},RFC1738:jn.RFC1738,RFC3986:jn.RFC3986},Kl=Za,Vn=Object.prototype.hasOwnProperty,Re=Array.isArray,te=function(){for(var r=[],e=0;e<256;++e)r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return r}(),Zl=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(Re(n)){for(var i=[],a=0;a<n.length;++a)typeof n[a]<"u"&&i.push(n[a]);t.obj[t.prop]=i}}},Ja=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},i=0;i<e.length;++i)typeof e[i]<"u"&&(n[i]=e[i]);return n},Jl=function r(e,t,n){if(!t)return e;if(typeof t!="object"){if(Re(e))e.push(t);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!Vn.call(Object.prototype,t))&&(e[t]=!0);else return[e,t];return e}if(!e||typeof e!="object")return[e].concat(t);var i=e;return Re(e)&&!Re(t)&&(i=Ja(e,n)),Re(e)&&Re(t)?(t.forEach(function(a,o){if(Vn.call(e,o)){var s=e[o];s&&typeof s=="object"&&a&&typeof a=="object"?e[o]=r(s,a,n):e.push(a)}else e[o]=a}),e):Object.keys(t).reduce(function(a,o){var s=t[o];return Vn.call(a,o)?a[o]=r(a[o],s,n):a[o]=s,a},i)},Ql=function(e,t){return Object.keys(t).reduce(function(n,i){return n[i]=t[i],n},e)},ed=function(r,e,t){var n=r.replace(/\+/g," ");if(t==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},rd=function(e,t,n,i,a){if(e.length===0)return e;var o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),n==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(l){return"%26%23"+parseInt(l.slice(2),16)+"%3B"});for(var s="",f=0;f<o.length;++f){var c=o.charCodeAt(f);if(c===45||c===46||c===95||c===126||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||a===Kl.RFC1738&&(c===40||c===41)){s+=o.charAt(f);continue}if(c<128){s=s+te[c];continue}if(c<2048){s=s+(te[192|c>>6]+te[128|c&63]);continue}if(c<55296||c>=57344){s=s+(te[224|c>>12]+te[128|c>>6&63]+te[128|c&63]);continue}f+=1,c=65536+((c&1023)<<10|o.charCodeAt(f)&1023),s+=te[240|c>>18]+te[128|c>>12&63]+te[128|c>>6&63]+te[128|c&63]}return s},td=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],i=0;i<t.length;++i)for(var a=t[i],o=a.obj[a.prop],s=Object.keys(o),f=0;f<s.length;++f){var c=s[f],l=o[c];typeof l=="object"&&l!==null&&n.indexOf(l)===-1&&(t.push({obj:o,prop:c}),n.push(l))}return Zl(t),e},nd=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},id=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},ad=function(e,t){return[].concat(e,t)},od=function(e,t){if(Re(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(t(e[i]));return n}return t(e)},sd={arrayToObject:Ja,assign:Ql,combine:ad,compact:td,decode:ed,encode:rd,isBuffer:id,isRegExp:nd,maybeMap:od,merge:Jl},Qa=zl,pt=sd,Er=Za,ud=Object.prototype.hasOwnProperty,eo={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},se=Array.isArray,fd=Array.prototype.push,ro=function(r,e){fd.apply(r,se(e)?e:[e])},cd=Date.prototype.toISOString,to=Er.default,L={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:pt.encode,encodeValuesOnly:!1,format:to,formatter:Er.formatters[to],indices:!1,serializeDate:function(e){return cd.call(e)},skipNulls:!1,strictNullHandling:!1},ld=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},Gn={},dd=function r(e,t,n,i,a,o,s,f,c,l,u,d,y,b,S,O){for(var $=e,E=O,p=0,I=!1;(E=E.get(Gn))!==void 0&&!I;){var T=E.get(e);if(p+=1,typeof T<"u"){if(T===p)throw new RangeError("Cyclic object value");I=!0}typeof E.get(Gn)>"u"&&(p=0)}if(typeof f=="function"?$=f(t,$):$ instanceof Date?$=u($):n==="comma"&&se($)&&($=pt.maybeMap($,function(we){return we instanceof Date?u(we):we})),$===null){if(a)return s&&!b?s(t,L.encoder,S,"key",d):t;$=""}if(ld($)||pt.isBuffer($)){if(s){var F=b?t:s(t,L.encoder,S,"key",d);return[y(F)+"="+y(s($,L.encoder,S,"value",d))]}return[y(t)+"="+y(String($))]}var m=[];if(typeof $>"u")return m;var g;if(n==="comma"&&se($))b&&s&&($=pt.maybeMap($,s)),g=[{value:$.length>0?$.join(",")||null:void 0}];else if(se(f))g=f;else{var _=Object.keys($);g=c?_.sort(c):_}for(var A=i&&se($)&&$.length===1?t+"[]":t,x=0;x<g.length;++x){var M=g[x],Y=typeof M=="object"&&typeof M.value<"u"?M.value:$[M];if(!(o&&Y===null)){var me=se($)?typeof n=="function"?n(A,M):A:A+(l?"."+M:"["+M+"]");O.set(e,p);var dr=Qa();dr.set(Gn,O),ro(m,r(Y,me,n,i,a,o,n==="comma"&&b&&se($)?null:s,f,c,l,u,d,y,b,S,dr))}}return m},pd=function(e){if(!e)return L;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=e.charset||L.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=Er.default;if(typeof e.format<"u"){if(!ud.call(Er.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=Er.formatters[n],a=L.filter;return(typeof e.filter=="function"||se(e.filter))&&(a=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:L.addQueryPrefix,allowDots:typeof e.allowDots>"u"?L.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:L.charsetSentinel,delimiter:typeof e.delimiter>"u"?L.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:L.encode,encoder:typeof e.encoder=="function"?e.encoder:L.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:L.encodeValuesOnly,filter:a,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:L.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:L.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:L.strictNullHandling}},hd=function(r,e){var t=r,n=pd(e),i,a;typeof n.filter=="function"?(a=n.filter,t=a("",t)):se(n.filter)&&(a=n.filter,i=a);var o=[];if(typeof t!="object"||t===null)return"";var s;e&&e.arrayFormat in eo?s=e.arrayFormat:e&&"indices"in e?s=e.indices?"indices":"repeat":s="indices";var f=eo[s];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=f==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(t)),n.sort&&i.sort(n.sort);for(var l=Qa(),u=0;u<i.length;++u){var d=i[u];n.skipNulls&&t[d]===null||ro(o,dd(t[d],d,f,c,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,l))}var y=o.join(n.delimiter),b=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?b+="utf8=%26%2310003%3B&":b+="utf8=%E2%9C%93&"),y.length>0?b+y:""},yd=be(hd);let no={storeIdentifier:"",environment:"prod"};function gd(r){no=r}function V(){return no}const _d=(r,e="")=>{switch(r){case"prod":return"https://api.rechargeapps.com";case"stage":return"https://api.stage.rechargeapps.com";case"preprod":case"prestage":return`${e}/api`}},vd=(r,e="")=>{switch(r){case"prod":return"https://admin.rechargeapps.com";case"stage":return"https://admin.stage.rechargeapps.com";case"preprod":case"prestage":return e}},md=r=>{switch(r){case"prod":case"preprod":return"https://static.rechargecdn.com";case"stage":case"prestage":return"https://static.stage.rechargecdn.com"}},io="/tools/recurring";class Ze{constructor(e,t){this.name="RechargeRequestError",this.message=e,this.status=t}}function wd(r){return yd(r,{encode:!1,indices:!1,arrayFormat:"comma"})}function v(r,e){return{...r,internalFnCall:r.internalFnCall??e,internalRequestId:r.internalRequestId??Wi()}}async function ht(r,e,t={}){const n=V();return X(r,`${md(n.environment)}/store/${n.storeIdentifier}${e}`,t)}async function w(r,e,{id:t,query:n,data:i,headers:a}={},o){const{environment:s,environmentUri:f,storeIdentifier:c,loginRetryFn:l,__unstable_twoFactorRetryFn:u,appName:d,appVersion:y}=V();if(!c)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const b=o.apiToken;if(!b)throw new Error("No API token defined on session.");const S=_d(s,f),O={"X-Recharge-Access-Token":b,"X-Recharge-Version":"2021-11","X-Recharge-Sdk-Fn":o.internalFnCall,...d?{"X-Recharge-Sdk-App-Name":d}:{},...y?{"X-Recharge-Sdk-App-Version":y}:{},"X-Recharge-Sdk-Version":"1.68.0","X-Request-Id":o.internalRequestId,...o.tmp_fn_identifier?{"X-Recharge-Sdk-Fn-Identifier":o.tmp_fn_identifier}:{},...a||{}},$={shop_url:c,...n};try{return await X(r,`${S}${e}`,{id:t,query:$,data:i,headers:O})}catch(E){if(l&&E instanceof Ze&&E.status===401)return l().then(p=>{if(p)return X(r,`${S}${e}`,{id:t,query:$,data:i,headers:{...O,"X-Recharge-Access-Token":p.apiToken}});throw E});if(u&&E instanceof Ze&&E.status===423)return u().then(p=>{if(p)return X(r,`${S}${e}`,{id:t,query:$,data:i,headers:{...O,"X-Recharge-Access-Token":p.apiToken}});throw E});throw E}}async function Fe(r,e,t={}){return X(r,`${io}${e}`,t)}async function X(r,e,{id:t,query:n,data:i,headers:a}={}){let o=e.trim();if(t&&(o=[o,`${t}`.trim()].join("/")),n){let u;[o,u]=o.split("?");const d=[u,wd(n)].join("&").replace(/^&/,"");o=`${o}${d?`?${d}`:""}`}let s;i&&r!=="get"&&(s=JSON.stringify(i));const f={Accept:"application/json","Content-Type":"application/json","X-Recharge-App":"storefront-client",...a||{}},c=await fetch(o,{method:r,headers:f,body:s});let l;try{l=await c.json()}catch{}if(!c.ok)throw c.status===502||c.status===504?new Ze("A gateway error occurred while making the request",c.status):l&&l.error?new Ze(l.error,c.status):l&&l.errors?new Ze(JSON.stringify(l.errors),c.status):new Ze("A connection error occurred while making the request");return l}function bd(r,e){return w("get","/addresses",{query:e},v(r,"listAddresses"))}async function $d(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{address:n}=await w("get","/addresses",{id:e,query:{include:t?.include}},v(r,"getAddress"));return n}async function Ed(r,e){const{address:t}=await w("post","/addresses",{data:{customer_id:r.customerId?Number(r.customerId):void 0,...e}},v(r,"createAddress"));return t}async function Hn(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");const{address:i}=await w("put","/addresses",{id:e,data:t,query:n},v(r,"updateAddress"));return i}async function Sd(r,e,t,n){return Hn(v(r,"applyDiscountToAddress"),e,{discounts:[{code:t}]},n)}async function Ad(r,e,t){if(e===void 0||e==="")throw new Error("Id is required");return Hn(v(r,"removeDiscountsFromAddress"),e,{discounts:[]},t)}function Od(r,e){if(e===void 0||e==="")throw new Error("ID is required");return w("delete","/addresses",{id:e},v(r,"deleteAddress"))}async function Id(r,e){const{address:t}=await w("post","/addresses/merge",{data:e},v(r,"mergeAddresses"));return t}async function xd(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{charge:n}=await w("post",`/addresses/${e}/charges/skip`,{data:t},v(r,"skipFutureCharge"));return n}var Pd=Object.freeze({__proto__:null,applyDiscountToAddress:Sd,createAddress:Ed,deleteAddress:Od,getAddress:$d,listAddresses:bd,mergeAddresses:Id,removeDiscountsFromAddress:Ad,skipFutureCharge:xd,updateAddress:Hn});async function Td(){const{storefrontAccessToken:r}=V(),e={};r&&(e["X-Recharge-Storefront-Access-Token"]=r);const t=await Fe("get","/access",{headers:e});return{apiToken:t.api_token,customerId:t.customer_id,message:t.message}}async function Rd(r,e){return ao(r,e)}async function ao(r,e){if(!r)throw new Error("Shopify storefront token is required");const{storeIdentifier:t}=V();if(!t)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const{api_token:n,customer_id:i,message:a}=await Sr("post","/shopify_storefront_access",{data:{customer_token:e,storefront_token:r,shop_url:t}});return n?{apiToken:n,customerId:i,message:a}:null}async function Fd(r){const{storeIdentifier:e}=V();if(!e)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const{api_token:t,customer_id:n,message:i}=await Sr("post","/shopify_customer_account_api_access",{data:{customer_token:r,shop_url:e}});return t?{apiToken:t,customerId:n,message:i}:null}async function Md(r,e={}){if(!r)throw new Error("Email is required.");const{storeIdentifier:t}=V();if(!t)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const n=await Sr("post","/attempt_login",{data:{email:r,shop:t,...e}});if(n.errors)throw new Error(n.errors);return n.session_token}async function Dd(r,e={}){if(!r)throw new Error("Email is required.");const{storefrontAccessToken:t}=V(),n={};t&&(n["X-Recharge-Storefront-Access-Token"]=t);const i=await Fe("post","/attempt_login",{data:{email:r,...e},headers:n});if(i.errors)throw new Error(i.errors);return i.session_token}async function Cd(r,e,t){if(!r)throw new Error("Email is required.");if(!e)throw new Error("Session token is required.");if(!t)throw new Error("Code is required.");const{storeIdentifier:n}=V();if(!n)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const i=await Sr("post","/validate_login",{data:{code:t,email:r,session_token:e,shop:n}});if(i.errors)throw new Error(i.errors);return{apiToken:i.api_token,customerId:i.customer_id}}async function Nd(r,e,t){if(!r)throw new Error("Email is required.");if(!e)throw new Error("Session token is required.");if(!t)throw new Error("Code is required.");const{storefrontAccessToken:n}=V(),i={};n&&(i["X-Recharge-Storefront-Access-Token"]=n);const a=await Fe("post","/validate_login",{data:{code:t,email:r,session_token:e},headers:i});if(a.errors)throw new Error(a.errors);return{apiToken:a.api_token,customerId:a.customer_id}}function Bd(){const{customerHash:r}=V(),{pathname:e,search:t}=window.location,n=new URLSearchParams(t).get("token"),i=e.split("/").filter(Boolean),a=i.findIndex(s=>s==="portal"),o=a!==-1?i[a+1]:r;if(!n||!o)throw new Error("Not in context of Recharge Customer Portal or URL did not contain correct params");return{customerHash:o,token:n}}async function Ud(){const{customerHash:r,token:e}=Bd(),{storeIdentifier:t}=V(),n=await Sr("post",`/customers/${r}/access`,{data:{token:e,shop:t}});return{apiToken:n.api_token,customerId:n.customer_id}}async function Sr(r,e,{id:t,query:n,data:i,headers:a}={}){const{environment:o,environmentUri:s,storefrontAccessToken:f,appName:c,appVersion:l}=V(),u=vd(o,s),d={...f?{"X-Recharge-Storefront-Access-Token":f}:{},...c?{"X-Recharge-Sdk-App-Name":c}:{},...l?{"X-Recharge-Sdk-App-Version":l}:{},"X-Recharge-Sdk-Version":"1.68.0",...a||{}};return X(r,`${u}${e}`,{id:t,query:n,data:i,headers:d})}var qd=Object.freeze({__proto__:null,loginCustomerPortal:Ud,loginShopifyApi:Rd,loginShopifyAppProxy:Td,loginWithShopifyCustomerAccount:Fd,loginWithShopifyStorefront:ao,sendPasswordlessCode:Md,sendPasswordlessCodeAppProxy:Dd,validatePasswordlessCode:Cd,validatePasswordlessCodeAppProxy:Nd}),oo={},Wn={},ue={},kd=typeof U=="object"&&U&&U.Object===Object&&U,so=kd,Ld=so,jd=typeof self=="object"&&self&&self.Object===Object&&self,Vd=Ld||jd||Function("return this")(),fe=Vd,Gd=fe,Hd=Gd.Symbol,yt=Hd,uo=yt,fo=Object.prototype,Wd=fo.hasOwnProperty,zd=fo.toString,Ar=uo?uo.toStringTag:void 0;function Xd(r){var e=Wd.call(r,Ar),t=r[Ar];try{r[Ar]=void 0;var n=!0}catch{}var i=zd.call(r);return n&&(e?r[Ar]=t:delete r[Ar]),i}var Yd=Xd,Kd=Object.prototype,Zd=Kd.toString;function Jd(r){return Zd.call(r)}var Qd=Jd,co=yt,ep=Yd,rp=Qd,tp="[object Null]",np="[object Undefined]",lo=co?co.toStringTag:void 0;function ip(r){return r==null?r===void 0?np:tp:lo&&lo in Object(r)?ep(r):rp(r)}var ge=ip;function ap(r){return r!=null&&typeof r=="object"}var _e=ap,op=ge,sp=_e,up="[object Number]";function fp(r){return typeof r=="number"||sp(r)&&op(r)==up}var gt=fp,D={};function cp(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var Je=cp,lp=ge,dp=Je,pp="[object AsyncFunction]",hp="[object Function]",yp="[object GeneratorFunction]",gp="[object Proxy]";function _p(r){if(!dp(r))return!1;var e=lp(r);return e==hp||e==yp||e==pp||e==gp}var zn=_p,vp=fe,mp=vp["__core-js_shared__"],wp=mp,Xn=wp,po=function(){var r=/[^.]+$/.exec(Xn&&Xn.keys&&Xn.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function bp(r){return!!po&&po in r}var $p=bp,Ep=Function.prototype,Sp=Ep.toString;function Ap(r){if(r!=null){try{return Sp.call(r)}catch{}try{return r+""}catch{}}return""}var ho=Ap,Op=zn,Ip=$p,xp=Je,Pp=ho,Tp=/[\\^$.*+?()[\]{}|]/g,Rp=/^\[object .+?Constructor\]$/,Fp=Function.prototype,Mp=Object.prototype,Dp=Fp.toString,Cp=Mp.hasOwnProperty,Np=RegExp("^"+Dp.call(Cp).replace(Tp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Bp(r){if(!xp(r)||Ip(r))return!1;var e=Op(r)?Np:Rp;return e.test(Pp(r))}var Up=Bp;function qp(r,e){return r?.[e]}var kp=qp,Lp=Up,jp=kp;function Vp(r,e){var t=jp(r,e);return Lp(t)?t:void 0}var Me=Vp,Gp=Me,Hp=function(){try{var r=Gp(Object,"defineProperty");return r({},"",{}),r}catch{}}(),yo=Hp,go=yo;function Wp(r,e,t){e=="__proto__"&&go?go(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}var _o=Wp;function zp(r,e){return r===e||r!==r&&e!==e}var _t=zp,Xp=_o,Yp=_t,Kp=Object.prototype,Zp=Kp.hasOwnProperty;function Jp(r,e,t){var n=r[e];(!(Zp.call(r,e)&&Yp(n,t))||t===void 0&&!(e in r))&&Xp(r,e,t)}var Qp=Jp,eh=Qp,rh=_o;function th(r,e,t,n){var i=!t;t||(t={});for(var a=-1,o=e.length;++a<o;){var s=e[a],f=n?n(t[s],r[s],s,t,r):void 0;f===void 0&&(f=r[s]),i?rh(t,s,f):eh(t,s,f)}return t}var nh=th;function ih(r){return r}var vt=ih;function ah(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}var oh=ah,sh=oh,vo=Math.max;function uh(r,e,t){return e=vo(e===void 0?r.length-1:e,0),function(){for(var n=arguments,i=-1,a=vo(n.length-e,0),o=Array(a);++i<a;)o[i]=n[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=n[i];return s[e]=t(o),sh(r,this,s)}}var fh=uh;function ch(r){return function(){return r}}var lh=ch,dh=lh,mo=yo,ph=vt,hh=mo?function(r,e){return mo(r,"toString",{configurable:!0,enumerable:!1,value:dh(e),writable:!0})}:ph,yh=hh,gh=800,_h=16,vh=Date.now;function mh(r){var e=0,t=0;return function(){var n=vh(),i=_h-(n-t);if(t=n,i>0){if(++e>=gh)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}var wh=mh,bh=yh,$h=wh,Eh=$h(bh),Sh=Eh,Ah=vt,Oh=fh,Ih=Sh;function xh(r,e){return Ih(Oh(r,e,Ah),r+"")}var Ph=xh,Th=9007199254740991;function Rh(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Th}var Yn=Rh,Fh=zn,Mh=Yn;function Dh(r){return r!=null&&Mh(r.length)&&!Fh(r)}var Or=Dh,Ch=9007199254740991,Nh=/^(?:0|[1-9]\d*)$/;function Bh(r,e){var t=typeof r;return e=e??Ch,!!e&&(t=="number"||t!="symbol"&&Nh.test(r))&&r>-1&&r%1==0&&r<e}var Kn=Bh,Uh=_t,qh=Or,kh=Kn,Lh=Je;function jh(r,e,t){if(!Lh(t))return!1;var n=typeof e;return(n=="number"?qh(t)&&kh(e,t.length):n=="string"&&e in t)?Uh(t[e],r):!1}var wo=jh,Vh=Ph,Gh=wo;function Hh(r){return Vh(function(e,t){var n=-1,i=t.length,a=i>1?t[i-1]:void 0,o=i>2?t[2]:void 0;for(a=r.length>3&&typeof a=="function"?(i--,a):void 0,o&&Gh(t[0],t[1],o)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var s=t[n];s&&r(e,s,n,a)}return e})}var Wh=Hh;function zh(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var bo=zh,Xh=ge,Yh=_e,Kh="[object Arguments]";function Zh(r){return Yh(r)&&Xh(r)==Kh}var Jh=Zh,$o=Jh,Qh=_e,Eo=Object.prototype,ey=Eo.hasOwnProperty,ry=Eo.propertyIsEnumerable,ty=$o(function(){return arguments}())?$o:function(r){return Qh(r)&&ey.call(r,"callee")&&!ry.call(r,"callee")},So=ty,ny=Array.isArray,G=ny,mt={exports:{}};function iy(){return!1}var ay=iy;mt.exports,function(r,e){var t=fe,n=ay,i=e&&!e.nodeType&&e,a=i&&!0&&r&&!r.nodeType&&r,o=a&&a.exports===i,s=o?t.Buffer:void 0,f=s?s.isBuffer:void 0,c=f||n;r.exports=c}(mt,mt.exports);var Ao=mt.exports,oy=ge,sy=Yn,uy=_e,fy="[object Arguments]",cy="[object Array]",ly="[object Boolean]",dy="[object Date]",py="[object Error]",hy="[object Function]",yy="[object Map]",gy="[object Number]",_y="[object Object]",vy="[object RegExp]",my="[object Set]",wy="[object String]",by="[object WeakMap]",$y="[object ArrayBuffer]",Ey="[object DataView]",Sy="[object Float32Array]",Ay="[object Float64Array]",Oy="[object Int8Array]",Iy="[object Int16Array]",xy="[object Int32Array]",Py="[object Uint8Array]",Ty="[object Uint8ClampedArray]",Ry="[object Uint16Array]",Fy="[object Uint32Array]",R={};R[Sy]=R[Ay]=R[Oy]=R[Iy]=R[xy]=R[Py]=R[Ty]=R[Ry]=R[Fy]=!0,R[fy]=R[cy]=R[$y]=R[ly]=R[Ey]=R[dy]=R[py]=R[hy]=R[yy]=R[gy]=R[_y]=R[vy]=R[my]=R[wy]=R[by]=!1;function My(r){return uy(r)&&sy(r.length)&&!!R[oy(r)]}var Dy=My;function Cy(r){return function(e){return r(e)}}var Ny=Cy,wt={exports:{}};wt.exports,function(r,e){var t=so,n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,o=a&&t.process,s=function(){try{var f=i&&i.require&&i.require("util").types;return f||o&&o.binding&&o.binding("util")}catch{}}();r.exports=s}(wt,wt.exports);var By=wt.exports,Uy=Dy,qy=Ny,Oo=By,Io=Oo&&Oo.isTypedArray,ky=Io?qy(Io):Uy,xo=ky,Ly=bo,jy=So,Vy=G,Gy=Ao,Hy=Kn,Wy=xo,zy=Object.prototype,Xy=zy.hasOwnProperty;function Yy(r,e){var t=Vy(r),n=!t&&jy(r),i=!t&&!n&&Gy(r),a=!t&&!n&&!i&&Wy(r),o=t||n||i||a,s=o?Ly(r.length,String):[],f=s.length;for(var c in r)(e||Xy.call(r,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Hy(c,f)))&&s.push(c);return s}var Po=Yy,Ky=Object.prototype;function Zy(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Ky;return r===t}var To=Zy;function Jy(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}var Qy=Jy,eg=Je,rg=To,tg=Qy,ng=Object.prototype,ig=ng.hasOwnProperty;function ag(r){if(!eg(r))return tg(r);var e=rg(r),t=[];for(var n in r)n=="constructor"&&(e||!ig.call(r,n))||t.push(n);return t}var og=ag,sg=Po,ug=og,fg=Or;function cg(r){return fg(r)?sg(r,!0):ug(r)}var lg=cg,dg=nh,pg=Wh,hg=lg,yg=pg(function(r,e){dg(e,hg(e),r)}),gg=yg,_g=gg,bt={},De={};function vg(r,e){for(var t=-1,n=r==null?0:r.length;++t<n;)if(!e(r[t],t,r))return!1;return!0}var mg=vg;function wg(r){return function(e,t,n){for(var i=-1,a=Object(e),o=n(e),s=o.length;s--;){var f=o[r?s:++i];if(t(a[f],f,a)===!1)break}return e}}var bg=wg,$g=bg,Eg=$g(),Sg=Eg;function Ag(r,e){return function(t){return r(e(t))}}var Og=Ag,Ig=Og,xg=Ig(Object.keys,Object),Pg=xg,Tg=To,Rg=Pg,Fg=Object.prototype,Mg=Fg.hasOwnProperty;function Dg(r){if(!Tg(r))return Rg(r);var e=[];for(var t in Object(r))Mg.call(r,t)&&t!="constructor"&&e.push(t);return e}var Cg=Dg,Ng=Po,Bg=Cg,Ug=Or;function qg(r){return Ug(r)?Ng(r):Bg(r)}var $t=qg,kg=Sg,Lg=$t;function jg(r,e){return r&&kg(r,e,Lg)}var Vg=jg,Gg=Or;function Hg(r,e){return function(t,n){if(t==null)return t;if(!Gg(t))return r(t,n);for(var i=t.length,a=e?i:-1,o=Object(t);(e?a--:++a<i)&&n(o[a],a,o)!==!1;);return t}}var Wg=Hg,zg=Vg,Xg=Wg,Yg=Xg(zg),Zn=Yg,Kg=Zn;function Zg(r,e){var t=!0;return Kg(r,function(n,i,a){return t=!!e(n,i,a),t}),t}var Jg=Zg;function Qg(){this.__data__=[],this.size=0}var e_=Qg,r_=_t;function t_(r,e){for(var t=r.length;t--;)if(r_(r[t][0],e))return t;return-1}var Et=t_,n_=Et,i_=Array.prototype,a_=i_.splice;function o_(r){var e=this.__data__,t=n_(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():a_.call(e,t,1),--this.size,!0}var s_=o_,u_=Et;function f_(r){var e=this.__data__,t=u_(e,r);return t<0?void 0:e[t][1]}var c_=f_,l_=Et;function d_(r){return l_(this.__data__,r)>-1}var p_=d_,h_=Et;function y_(r,e){var t=this.__data__,n=h_(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var g_=y_,__=e_,v_=s_,m_=c_,w_=p_,b_=g_;function Qe(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}Qe.prototype.clear=__,Qe.prototype.delete=v_,Qe.prototype.get=m_,Qe.prototype.has=w_,Qe.prototype.set=b_;var St=Qe,$_=St;function E_(){this.__data__=new $_,this.size=0}var S_=E_;function A_(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}var O_=A_;function I_(r){return this.__data__.get(r)}var x_=I_;function P_(r){return this.__data__.has(r)}var T_=P_,R_=Me,F_=fe,M_=R_(F_,"Map"),Jn=M_,D_=Me,C_=D_(Object,"create"),At=C_,Ro=At;function N_(){this.__data__=Ro?Ro(null):{},this.size=0}var B_=N_;function U_(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var q_=U_,k_=At,L_="__lodash_hash_undefined__",j_=Object.prototype,V_=j_.hasOwnProperty;function G_(r){var e=this.__data__;if(k_){var t=e[r];return t===L_?void 0:t}return V_.call(e,r)?e[r]:void 0}var H_=G_,W_=At,z_=Object.prototype,X_=z_.hasOwnProperty;function Y_(r){var e=this.__data__;return W_?e[r]!==void 0:X_.call(e,r)}var K_=Y_,Z_=At,J_="__lodash_hash_undefined__";function Q_(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Z_&&e===void 0?J_:e,this}var ev=Q_,rv=B_,tv=q_,nv=H_,iv=K_,av=ev;function er(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}er.prototype.clear=rv,er.prototype.delete=tv,er.prototype.get=nv,er.prototype.has=iv,er.prototype.set=av;var ov=er,Fo=ov,sv=St,uv=Jn;function fv(){this.size=0,this.__data__={hash:new Fo,map:new(uv||sv),string:new Fo}}var cv=fv;function lv(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}var dv=lv,pv=dv;function hv(r,e){var t=r.__data__;return pv(e)?t[typeof e=="string"?"string":"hash"]:t.map}var Ot=hv,yv=Ot;function gv(r){var e=yv(this,r).delete(r);return this.size-=e?1:0,e}var _v=gv,vv=Ot;function mv(r){return vv(this,r).get(r)}var wv=mv,bv=Ot;function $v(r){return bv(this,r).has(r)}var Ev=$v,Sv=Ot;function Av(r,e){var t=Sv(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}var Ov=Av,Iv=cv,xv=_v,Pv=wv,Tv=Ev,Rv=Ov;function rr(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}rr.prototype.clear=Iv,rr.prototype.delete=xv,rr.prototype.get=Pv,rr.prototype.has=Tv,rr.prototype.set=Rv;var Qn=rr,Fv=St,Mv=Jn,Dv=Qn,Cv=200;function Nv(r,e){var t=this.__data__;if(t instanceof Fv){var n=t.__data__;if(!Mv||n.length<Cv-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new Dv(n)}return t.set(r,e),this.size=t.size,this}var Bv=Nv,Uv=St,qv=S_,kv=O_,Lv=x_,jv=T_,Vv=Bv;function tr(r){var e=this.__data__=new Uv(r);this.size=e.size}tr.prototype.clear=qv,tr.prototype.delete=kv,tr.prototype.get=Lv,tr.prototype.has=jv,tr.prototype.set=Vv;var Mo=tr,Gv="__lodash_hash_undefined__";function Hv(r){return this.__data__.set(r,Gv),this}var Wv=Hv;function zv(r){return this.__data__.has(r)}var Xv=zv,Yv=Qn,Kv=Wv,Zv=Xv;function It(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new Yv;++e<t;)this.add(r[e])}It.prototype.add=It.prototype.push=Kv,It.prototype.has=Zv;var Jv=It;function Qv(r,e){for(var t=-1,n=r==null?0:r.length;++t<n;)if(e(r[t],t,r))return!0;return!1}var em=Qv;function rm(r,e){return r.has(e)}var tm=rm,nm=Jv,im=em,am=tm,om=1,sm=2;function um(r,e,t,n,i,a){var o=t&om,s=r.length,f=e.length;if(s!=f&&!(o&&f>s))return!1;var c=a.get(r),l=a.get(e);if(c&&l)return c==e&&l==r;var u=-1,d=!0,y=t&sm?new nm:void 0;for(a.set(r,e),a.set(e,r);++u<s;){var b=r[u],S=e[u];if(n)var O=o?n(S,b,u,e,r,a):n(b,S,u,r,e,a);if(O!==void 0){if(O)continue;d=!1;break}if(y){if(!im(e,function($,E){if(!am(y,E)&&(b===$||i(b,$,t,n,a)))return y.push(E)})){d=!1;break}}else if(!(b===S||i(b,S,t,n,a))){d=!1;break}}return a.delete(r),a.delete(e),d}var Do=um,fm=fe,cm=fm.Uint8Array,lm=cm;function dm(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}var pm=dm;function hm(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}var ym=hm,Co=yt,No=lm,gm=_t,_m=Do,vm=pm,mm=ym,wm=1,bm=2,$m="[object Boolean]",Em="[object Date]",Sm="[object Error]",Am="[object Map]",Om="[object Number]",Im="[object RegExp]",xm="[object Set]",Pm="[object String]",Tm="[object Symbol]",Rm="[object ArrayBuffer]",Fm="[object DataView]",Bo=Co?Co.prototype:void 0,ei=Bo?Bo.valueOf:void 0;function Mm(r,e,t,n,i,a,o){switch(t){case Fm:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case Rm:return!(r.byteLength!=e.byteLength||!a(new No(r),new No(e)));case $m:case Em:case Om:return gm(+r,+e);case Sm:return r.name==e.name&&r.message==e.message;case Im:case Pm:return r==e+"";case Am:var s=vm;case xm:var f=n&wm;if(s||(s=mm),r.size!=e.size&&!f)return!1;var c=o.get(r);if(c)return c==e;n|=bm,o.set(r,e);var l=_m(s(r),s(e),n,i,a,o);return o.delete(r),l;case Tm:if(ei)return ei.call(r)==ei.call(e)}return!1}var Dm=Mm;function Cm(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}var Nm=Cm,Bm=Nm,Um=G;function qm(r,e,t){var n=e(r);return Um(r)?n:Bm(n,t(r))}var km=qm;function Lm(r,e){for(var t=-1,n=r==null?0:r.length,i=0,a=[];++t<n;){var o=r[t];e(o,t,r)&&(a[i++]=o)}return a}var jm=Lm;function Vm(){return[]}var Gm=Vm,Hm=jm,Wm=Gm,zm=Object.prototype,Xm=zm.propertyIsEnumerable,Uo=Object.getOwnPropertySymbols,Ym=Uo?function(r){return r==null?[]:(r=Object(r),Hm(Uo(r),function(e){return Xm.call(r,e)}))}:Wm,Km=Ym,Zm=km,Jm=Km,Qm=$t;function ew(r){return Zm(r,Qm,Jm)}var rw=ew,qo=rw,tw=1,nw=Object.prototype,iw=nw.hasOwnProperty;function aw(r,e,t,n,i,a){var o=t&tw,s=qo(r),f=s.length,c=qo(e),l=c.length;if(f!=l&&!o)return!1;for(var u=f;u--;){var d=s[u];if(!(o?d in e:iw.call(e,d)))return!1}var y=a.get(r),b=a.get(e);if(y&&b)return y==e&&b==r;var S=!0;a.set(r,e),a.set(e,r);for(var O=o;++u<f;){d=s[u];var $=r[d],E=e[d];if(n)var p=o?n(E,$,d,e,r,a):n($,E,d,r,e,a);if(!(p===void 0?$===E||i($,E,t,n,a):p)){S=!1;break}O||(O=d=="constructor")}if(S&&!O){var I=r.constructor,T=e.constructor;I!=T&&"constructor"in r&&"constructor"in e&&!(typeof I=="function"&&I instanceof I&&typeof T=="function"&&T instanceof T)&&(S=!1)}return a.delete(r),a.delete(e),S}var ow=aw,sw=Me,uw=fe,fw=sw(uw,"DataView"),cw=fw,lw=Me,dw=fe,pw=lw(dw,"Promise"),hw=pw,yw=Me,gw=fe,_w=yw(gw,"Set"),vw=_w,mw=Me,ww=fe,bw=mw(ww,"WeakMap"),$w=bw,ri=cw,ti=Jn,ni=hw,ii=vw,ai=$w,ko=ge,nr=ho,Lo="[object Map]",Ew="[object Object]",jo="[object Promise]",Vo="[object Set]",Go="[object WeakMap]",Ho="[object DataView]",Sw=nr(ri),Aw=nr(ti),Ow=nr(ni),Iw=nr(ii),xw=nr(ai),Ce=ko;(ri&&Ce(new ri(new ArrayBuffer(1)))!=Ho||ti&&Ce(new ti)!=Lo||ni&&Ce(ni.resolve())!=jo||ii&&Ce(new ii)!=Vo||ai&&Ce(new ai)!=Go)&&(Ce=function(r){var e=ko(r),t=e==Ew?r.constructor:void 0,n=t?nr(t):"";if(n)switch(n){case Sw:return Ho;case Aw:return Lo;case Ow:return jo;case Iw:return Vo;case xw:return Go}return e});var Pw=Ce,oi=Mo,Tw=Do,Rw=Dm,Fw=ow,Wo=Pw,zo=G,Xo=Ao,Mw=xo,Dw=1,Yo="[object Arguments]",Ko="[object Array]",xt="[object Object]",Cw=Object.prototype,Zo=Cw.hasOwnProperty;function Nw(r,e,t,n,i,a){var o=zo(r),s=zo(e),f=o?Ko:Wo(r),c=s?Ko:Wo(e);f=f==Yo?xt:f,c=c==Yo?xt:c;var l=f==xt,u=c==xt,d=f==c;if(d&&Xo(r)){if(!Xo(e))return!1;o=!0,l=!1}if(d&&!l)return a||(a=new oi),o||Mw(r)?Tw(r,e,t,n,i,a):Rw(r,e,f,t,n,i,a);if(!(t&Dw)){var y=l&&Zo.call(r,"__wrapped__"),b=u&&Zo.call(e,"__wrapped__");if(y||b){var S=y?r.value():r,O=b?e.value():e;return a||(a=new oi),i(S,O,t,n,a)}}return d?(a||(a=new oi),Fw(r,e,t,n,i,a)):!1}var Bw=Nw,Uw=Bw,Jo=_e;function Qo(r,e,t,n,i){return r===e?!0:r==null||e==null||!Jo(r)&&!Jo(e)?r!==r&&e!==e:Uw(r,e,t,n,Qo,i)}var es=Qo,qw=Mo,kw=es,Lw=1,jw=2;function Vw(r,e,t,n){var i=t.length,a=i,o=!n;if(r==null)return!a;for(r=Object(r);i--;){var s=t[i];if(o&&s[2]?s[1]!==r[s[0]]:!(s[0]in r))return!1}for(;++i<a;){s=t[i];var f=s[0],c=r[f],l=s[1];if(o&&s[2]){if(c===void 0&&!(f in r))return!1}else{var u=new qw;if(n)var d=n(c,l,f,r,e,u);if(!(d===void 0?kw(l,c,Lw|jw,n,u):d))return!1}}return!0}var Gw=Vw,Hw=Je;function Ww(r){return r===r&&!Hw(r)}var rs=Ww,zw=rs,Xw=$t;function Yw(r){for(var e=Xw(r),t=e.length;t--;){var n=e[t],i=r[n];e[t]=[n,i,zw(i)]}return e}var Kw=Yw;function Zw(r,e){return function(t){return t==null?!1:t[r]===e&&(e!==void 0||r in Object(t))}}var ts=Zw,Jw=Gw,Qw=Kw,e0=ts;function r0(r){var e=Qw(r);return e.length==1&&e[0][2]?e0(e[0][0],e[0][1]):function(t){return t===r||Jw(t,r,e)}}var t0=r0,n0=ge,i0=_e,a0="[object Symbol]";function o0(r){return typeof r=="symbol"||i0(r)&&n0(r)==a0}var Pt=o0,s0=G,u0=Pt,f0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,c0=/^\w*$/;function l0(r,e){if(s0(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||u0(r)?!0:c0.test(r)||!f0.test(r)||e!=null&&r in Object(e)}var si=l0,ns=Qn,d0="Expected a function";function ui(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(d0);var t=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=t.cache;if(a.has(i))return a.get(i);var o=r.apply(this,n);return t.cache=a.set(i,o)||a,o};return t.cache=new(ui.Cache||ns),t}ui.Cache=ns;var p0=ui,h0=p0,y0=500;function g0(r){var e=h0(r,function(n){return t.size===y0&&t.clear(),n}),t=e.cache;return e}var _0=g0,v0=_0,m0=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,w0=/\\(\\)?/g,b0=v0(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(m0,function(t,n,i,a){e.push(i?a.replace(w0,"$1"):n||t)}),e}),$0=b0;function E0(r,e){for(var t=-1,n=r==null?0:r.length,i=Array(n);++t<n;)i[t]=e(r[t],t,r);return i}var fi=E0,is=yt,S0=fi,A0=G,O0=Pt,I0=1/0,as=is?is.prototype:void 0,os=as?as.toString:void 0;function ss(r){if(typeof r=="string")return r;if(A0(r))return S0(r,ss)+"";if(O0(r))return os?os.call(r):"";var e=r+"";return e=="0"&&1/r==-I0?"-0":e}var x0=ss,P0=x0;function T0(r){return r==null?"":P0(r)}var R0=T0,F0=G,M0=si,D0=$0,C0=R0;function N0(r,e){return F0(r)?r:M0(r,e)?[r]:D0(C0(r))}var us=N0,B0=Pt,U0=1/0;function q0(r){if(typeof r=="string"||B0(r))return r;var e=r+"";return e=="0"&&1/r==-U0?"-0":e}var Tt=q0,k0=us,L0=Tt;function j0(r,e){e=k0(e,r);for(var t=0,n=e.length;r!=null&&t<n;)r=r[L0(e[t++])];return t&&t==n?r:void 0}var fs=j0,V0=fs;function G0(r,e,t){var n=r==null?void 0:V0(r,e);return n===void 0?t:n}var H0=G0;function W0(r,e){return r!=null&&e in Object(r)}var z0=W0,X0=us,Y0=So,K0=G,Z0=Kn,J0=Yn,Q0=Tt;function eb(r,e,t){e=X0(e,r);for(var n=-1,i=e.length,a=!1;++n<i;){var o=Q0(e[n]);if(!(a=r!=null&&t(r,o)))break;r=r[o]}return a||++n!=i?a:(i=r==null?0:r.length,!!i&&J0(i)&&Z0(o,i)&&(K0(r)||Y0(r)))}var rb=eb,tb=z0,nb=rb;function ib(r,e){return r!=null&&nb(r,e,tb)}var ab=ib,ob=es,sb=H0,ub=ab,fb=si,cb=rs,lb=ts,db=Tt,pb=1,hb=2;function yb(r,e){return fb(r)&&cb(e)?lb(db(r),e):function(t){var n=sb(t,r);return n===void 0&&n===e?ub(t,r):ob(e,n,pb|hb)}}var gb=yb;function _b(r){return function(e){return e?.[r]}}var vb=_b,mb=fs;function wb(r){return function(e){return mb(e,r)}}var bb=wb,$b=vb,Eb=bb,Sb=si,Ab=Tt;function Ob(r){return Sb(r)?$b(Ab(r)):Eb(r)}var Ib=Ob,xb=t0,Pb=gb,Tb=vt,Rb=G,Fb=Ib;function Mb(r){return typeof r=="function"?r:r==null?Tb:typeof r=="object"?Rb(r)?Pb(r[0],r[1]):xb(r):Fb(r)}var cs=Mb,Db=mg,Cb=Jg,Nb=cs,Bb=G,Ub=wo;function qb(r,e,t){var n=Bb(r)?Db:Cb;return t&&Ub(r,e,t)&&(e=void 0),n(r,Nb(e))}var ci=qb;Object.defineProperty(De,"__esModule",{value:!0}),De.calculatePadding=Vb,De.slicePadding=Gb;var kb=ci,Lb=jb(kb);function jb(r){return r&&r.__esModule?r:{default:r}}function Vb(r){switch(r%4){case 0:return 0;case 1:return 3;case 2:return 2;case 3:return 1;default:return null}}function Gb(r,e){var t=r.slice(e),n=(0,Lb.default)(t.buffer(),function(i){return i===0});if(n!==!0)throw new Error("XDR Read Error: invalid padding")}Object.defineProperty(bt,"__esModule",{value:!0}),bt.Cursor=void 0;var Hb=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Wb=De;function zb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var li=function(){function r(e){zb(this,r),e instanceof h||(e=typeof e=="number"?h.alloc(e):h.from(e)),this._setBuffer(e),this.rewind()}return Hb(r,[{key:"_setBuffer",value:function(t){this._buffer=t,this.length=t.length}},{key:"buffer",value:function(){return this._buffer}},{key:"tap",value:function(t){return t(this),this}},{key:"clone",value:function(t){var n=new this.constructor(this.buffer());return n.seek(arguments.length===0?this.tell():t),n}},{key:"tell",value:function(){return this._index}},{key:"seek",value:function(t,n){return arguments.length===1&&(n=t,t="="),t==="+"?this._index+=n:t==="-"?this._index-=n:this._index=n,this}},{key:"rewind",value:function(){return this.seek(0)}},{key:"eof",value:function(){return this.tell()===this.buffer().length}},{key:"write",value:function(t,n,i){return this.seek("+",this.buffer().write(t,this.tell(),n,i))}},{key:"fill",value:function(t,n){return arguments.length===1&&(n=this.buffer().length-this.tell()),this.buffer().fill(t,this.tell(),this.tell()+n),this.seek("+",n),this}},{key:"slice",value:function(t){arguments.length===0&&(t=this.length-this.tell());var n=new this.constructor(this.buffer().slice(this.tell(),this.tell()+t));return this.seek("+",t),n}},{key:"copyFrom",value:function(t){var n=t instanceof h?t:t.buffer();return n.copy(this.buffer(),this.tell(),0,n.length),this.seek("+",n.length),this}},{key:"concat",value:function(t){t.forEach(function(i,a){i instanceof r&&(t[a]=i.buffer())}),t.unshift(this.buffer());var n=h.concat(t);return this._setBuffer(n),this}},{key:"toString",value:function(t,n){arguments.length===0?(t="utf8",n=this.buffer().length-this.tell()):arguments.length===1&&(n=this.buffer().length-this.tell());var i=this.buffer().toString(t,this.tell(),this.tell()+n);return this.seek("+",n),i}},{key:"writeBufferPadded",value:function(t){var n=(0,Wb.calculatePadding)(t.length),i=h.alloc(n);return this.copyFrom(new r(t)).copyFrom(new r(i))}}]),r}();[[1,["readInt8","readUInt8"]],[2,["readInt16BE","readInt16LE","readUInt16BE","readUInt16LE"]],[4,["readInt32BE","readInt32LE","readUInt32BE","readUInt32LE","readFloatBE","readFloatLE"]],[8,["readDoubleBE","readDoubleLE"]]].forEach(function(r){r[1].forEach(function(e){li.prototype[e]=function(){var n=this.buffer()[e](this.tell());return this.seek("+",r[0]),n}})}),[[1,["writeInt8","writeUInt8"]],[2,["writeInt16BE","writeInt16LE","writeUInt16BE","writeUInt16LE"]],[4,["writeInt32BE","writeInt32LE","writeUInt32BE","writeUInt32LE","writeFloatBE","writeFloatLE"]],[8,["writeDoubleBE","writeDoubleLE"]]].forEach(function(r){r[1].forEach(function(e){li.prototype[e]=function(n){return this.buffer()[e](n,this.tell()),this.seek("+",r[0]),this}})}),bt.Cursor=li,Object.defineProperty(D,"__esModule",{value:!0}),D.default=e1;var Xb=_g,ls=ps(Xb),Yb=zn,Kb=ps(Yb),ds=bt;function ps(r){return r&&r.__esModule?r:{default:r}}var Zb=Math.pow(2,16),Jb={toXDR:function(e){var t=new ds.Cursor(Zb);this.write(e,t);var n=t.tell();return t.rewind(),t.slice(n).buffer()},fromXDR:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw",n=void 0;switch(t){case"raw":n=e;break;case"hex":n=h.from(e,"hex");break;case"base64":n=h.from(e,"base64");break;default:throw new Error("Invalid format "+t+', must be "raw", "hex", "base64"')}var i=new ds.Cursor(n),a=this.read(i);return a},validateXDR:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";try{return this.fromXDR(e,t),!0}catch{return!1}}},Qb={toXDR:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"raw",t=this.constructor.toXDR(this);switch(e){case"raw":return t;case"hex":return t.toString("hex");case"base64":return t.toString("base64");default:throw new Error("Invalid format "+e+', must be "raw", "hex", "base64"')}}};function e1(r){(0,ls.default)(r,Jb),(0,Kb.default)(r)&&(0,ls.default)(r.prototype,Qb)}Object.defineProperty(ue,"__esModule",{value:!0}),ue.Int=void 0;var r1=gt,hs=ys(r1),t1=D,n1=ys(t1);function ys(r){return r&&r.__esModule?r:{default:r}}var Ir=ue.Int={read:function(e){return e.readInt32BE()},write:function(e,t){if(!(0,hs.default)(e))throw new Error("XDR Write Error: not a number");if(Math.floor(e)!==e)throw new Error("XDR Write Error: not an integer");t.writeInt32BE(e)},isValid:function(e){return!(0,hs.default)(e)||Math.floor(e)!==e?!1:e>=Ir.MIN_VALUE&&e<=Ir.MAX_VALUE}};Ir.MAX_VALUE=Math.pow(2,31)-1,Ir.MIN_VALUE=-Math.pow(2,31),(0,n1.default)(Ir);var Rt={};function i1(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var gs={exports:{}};(function(r){/**
20
+ `+e.prev}function pt(r,e){var t=Vn(r),n=[];if(t){n.length=r.length;for(var i=0;i<r.length;i++)n[i]=fe(r,i)?e(r[i],r):""}var a=typeof kn=="function"?kn(r):[],o;if(We){o={};for(var s=0;s<a.length;s++)o["$"+a[s]]=a[s]}for(var f in r)fe(r,f)&&(t&&String(Number(f))===f&&f<r.length||We&&o["$"+f]instanceof Symbol||(Ja.call(/[^\w$]/,f)?n.push(e(f,r)+": "+e(r[f],r)):n.push(f+": "+e(r[f],r))));if(typeof kn=="function")for(var d=0;d<a.length;d++)ro.call(r,a[d])&&n.push("["+e(a[d])+"]: "+e(r[a[d]],r));return n}var Ql=dt,ed=Le,ht=function(r,e,t){for(var n=r,i;(i=n.next)!=null;n=i)if(i.key===e)return n.next=i.next,t||(i.next=r.next,r.next=i),i},rd=function(r,e){if(r){var t=ht(r,e);return t&&t.value}},td=function(r,e,t){var n=ht(r,e);n?n.value=t:r.next={key:e,next:r.next,value:t}},nd=function(r,e){return r?!!ht(r,e):!1},id=function(r,e){if(r)return ht(r,e,!0)},ad=function(){var e,t={assert:function(n){if(!t.has(n))throw new ed("Side channel does not contain "+Ql(n))},delete:function(n){var i=e&&e.next,a=id(e,n);return a&&i&&i===a&&(e=void 0),!!a},get:function(n){return rd(e,n)},has:function(n){return nd(e,n)},set:function(n,i){e||(e={next:void 0}),td(e,n,i)}};return t},ho=Object,od=Error,ud=EvalError,sd=RangeError,fd=ReferenceError,cd=SyntaxError,ld=URIError,dd=Math.abs,pd=Math.floor,hd=Math.max,yd=Math.min,gd=Math.pow,_d=Math.round,vd=Number.isNaN||function(e){return e!==e},md=vd,wd=function(e){return md(e)||e===0?e:e<0?-1:1},bd=Object.getOwnPropertyDescriptor,yt=bd;if(yt)try{yt([],"length")}catch{yt=null}var yo=yt,gt=Object.defineProperty||!1;if(gt)try{gt({},"a",{value:1})}catch{gt=!1}var $d=gt,Wn,go;function Ed(){return go||(go=1,Wn=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},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 i=42;e[t]=i;for(var a in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,t);if(s.value!==i||s.enumerable!==!0)return!1}return!0}),Wn}var zn,_o;function Sd(){if(_o)return zn;_o=1;var r=typeof Symbol<"u"&&Symbol,e=Ed();return zn=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},zn}var Xn,vo;function mo(){return vo||(vo=1,Xn=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Xn}var Yn,wo;function bo(){if(wo)return Yn;wo=1;var r=ho;return Yn=r.getPrototypeOf||null,Yn}var Kn,$o;function Ad(){if($o)return Kn;$o=1;var r="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,t=Math.max,n="[object Function]",i=function(f,d){for(var c=[],u=0;u<f.length;u+=1)c[u]=f[u];for(var l=0;l<d.length;l+=1)c[l+f.length]=d[l];return c},a=function(f,d){for(var c=[],u=d||0,l=0;u<f.length;u+=1,l+=1)c[l]=f[u];return c},o=function(s,f){for(var d="",c=0;c<s.length;c+=1)d+=s[c],c+1<s.length&&(d+=f);return d};return Kn=function(f){var d=this;if(typeof d!="function"||e.apply(d)!==n)throw new TypeError(r+d);for(var c=a(arguments,1),u,l=function(){if(this instanceof u){var O=d.apply(this,i(c,arguments));return Object(O)===O?O:this}return d.apply(f,i(c,arguments))},y=t(0,d.length-c.length),m=[],E=0;E<y;E++)m[E]="$"+E;if(u=Function("binder","return function ("+o(m,",")+"){ return binder.apply(this,arguments); }")(l),d.prototype){var S=function(){};S.prototype=d.prototype,u.prototype=new S,S.prototype=null}return u},Kn}var Zn,Eo;function _t(){if(Eo)return Zn;Eo=1;var r=Ad();return Zn=Function.prototype.bind||r,Zn}var Jn=Function.prototype.call,Qn,So;function Ao(){return So||(So=1,Qn=Function.prototype.apply),Qn}var Od=typeof Reflect<"u"&&Reflect&&Reflect.apply,Id=_t(),Pd=Ao(),xd=Jn,Td=Od,Rd=Td||Id.call(xd,Pd),Fd=_t(),Md=Le,Dd=Jn,Cd=Rd,Oo=function(e){if(e.length<1||typeof e[0]!="function")throw new Md("a function is required");return Cd(Fd,Dd,e)},ei,Io;function Nd(){if(Io)return ei;Io=1;var r=Oo,e=yo,t;try{t=[].__proto__===Array.prototype}catch(o){if(!o||typeof o!="object"||!("code"in o)||o.code!=="ERR_PROTO_ACCESS")throw o}var n=!!t&&e&&e(Object.prototype,"__proto__"),i=Object,a=i.getPrototypeOf;return ei=n&&typeof n.get=="function"?r([n.get]):typeof a=="function"?function(s){return a(s==null?s:i(s))}:!1,ei}var ri,Po;function Bd(){if(Po)return ri;Po=1;var r=mo(),e=bo(),t=Nd();return ri=r?function(i){return r(i)}:e?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return e(i)}:t?function(i){return t(i)}:null,ri}var ti,xo;function qd(){if(xo)return ti;xo=1;var r=Function.prototype.call,e=Object.prototype.hasOwnProperty,t=_t();return ti=t.call(r,e),ti}var x,Ud=ho,kd=od,Ld=ud,jd=sd,Vd=fd,ze=cd,Xe=Le,Gd=ld,Hd=dd,Wd=pd,zd=hd,Xd=yd,Yd=gd,Kd=_d,Zd=wd,To=Function,ni=function(r){try{return To('"use strict"; return ('+r+").constructor;")()}catch{}},Er=yo,Jd=$d,ii=function(){throw new Xe},Qd=Er?function(){try{return arguments.callee,ii}catch{try{return Er(arguments,"callee").get}catch{return ii}}}():ii,Ye=Sd()(),U=Bd(),ep=bo(),rp=mo(),Ro=Ao(),Sr=Jn,Ke={},tp=typeof Uint8Array>"u"||!U?x:U(Uint8Array),xe={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?x:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?x:ArrayBuffer,"%ArrayIteratorPrototype%":Ye&&U?U([][Symbol.iterator]()):x,"%AsyncFromSyncIteratorPrototype%":x,"%AsyncFunction%":Ke,"%AsyncGenerator%":Ke,"%AsyncGeneratorFunction%":Ke,"%AsyncIteratorPrototype%":Ke,"%Atomics%":typeof Atomics>"u"?x:Atomics,"%BigInt%":typeof BigInt>"u"?x:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?x:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?x:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?x:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":kd,"%eval%":eval,"%EvalError%":Ld,"%Float16Array%":typeof Float16Array>"u"?x:Float16Array,"%Float32Array%":typeof Float32Array>"u"?x:Float32Array,"%Float64Array%":typeof Float64Array>"u"?x:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?x:FinalizationRegistry,"%Function%":To,"%GeneratorFunction%":Ke,"%Int8Array%":typeof Int8Array>"u"?x:Int8Array,"%Int16Array%":typeof Int16Array>"u"?x:Int16Array,"%Int32Array%":typeof Int32Array>"u"?x:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ye&&U?U(U([][Symbol.iterator]())):x,"%JSON%":typeof JSON=="object"?JSON:x,"%Map%":typeof Map>"u"?x:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ye||!U?x:U(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Ud,"%Object.getOwnPropertyDescriptor%":Er,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?x:Promise,"%Proxy%":typeof Proxy>"u"?x:Proxy,"%RangeError%":jd,"%ReferenceError%":Vd,"%Reflect%":typeof Reflect>"u"?x:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?x:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ye||!U?x:U(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?x:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ye&&U?U(""[Symbol.iterator]()):x,"%Symbol%":Ye?Symbol:x,"%SyntaxError%":ze,"%ThrowTypeError%":Qd,"%TypedArray%":tp,"%TypeError%":Xe,"%Uint8Array%":typeof Uint8Array>"u"?x:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?x:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?x:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?x:Uint32Array,"%URIError%":Gd,"%WeakMap%":typeof WeakMap>"u"?x:WeakMap,"%WeakRef%":typeof WeakRef>"u"?x:WeakRef,"%WeakSet%":typeof WeakSet>"u"?x:WeakSet,"%Function.prototype.call%":Sr,"%Function.prototype.apply%":Ro,"%Object.defineProperty%":Jd,"%Object.getPrototypeOf%":ep,"%Math.abs%":Hd,"%Math.floor%":Wd,"%Math.max%":zd,"%Math.min%":Xd,"%Math.pow%":Yd,"%Math.round%":Kd,"%Math.sign%":Zd,"%Reflect.getPrototypeOf%":rp};if(U)try{null.error}catch(r){var np=U(U(r));xe["%Error.prototype%"]=np}var ip=function r(e){var t;if(e==="%AsyncFunction%")t=ni("async function () {}");else if(e==="%GeneratorFunction%")t=ni("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=ni("async function* () {}");else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=r("%AsyncGenerator%");i&&U&&(t=U(i.prototype))}return xe[e]=t,t},Fo={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Ar=_t(),vt=qd(),ap=Ar.call(Sr,Array.prototype.concat),op=Ar.call(Ro,Array.prototype.splice),Mo=Ar.call(Sr,String.prototype.replace),mt=Ar.call(Sr,String.prototype.slice),up=Ar.call(Sr,RegExp.prototype.exec),sp=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,fp=/\\(\\)?/g,cp=function(e){var t=mt(e,0,1),n=mt(e,-1);if(t==="%"&&n!=="%")throw new ze("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new ze("invalid intrinsic syntax, expected opening `%`");var i=[];return Mo(e,sp,function(a,o,s,f){i[i.length]=s?Mo(f,fp,"$1"):o||a}),i},lp=function(e,t){var n=e,i;if(vt(Fo,n)&&(i=Fo[n],n="%"+i[0]+"%"),vt(xe,n)){var a=xe[n];if(a===Ke&&(a=ip(n)),typeof a>"u"&&!t)throw new Xe("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:a}}throw new ze("intrinsic "+e+" does not exist!")},ai=function(e,t){if(typeof e!="string"||e.length===0)throw new Xe("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Xe('"allowMissing" argument must be a boolean');if(up(/^%?[^%]*%?$/,e)===null)throw new ze("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=cp(e),i=n.length>0?n[0]:"",a=lp("%"+i+"%",t),o=a.name,s=a.value,f=!1,d=a.alias;d&&(i=d[0],op(n,ap([0,1],d)));for(var c=1,u=!0;c<n.length;c+=1){var l=n[c],y=mt(l,0,1),m=mt(l,-1);if((y==='"'||y==="'"||y==="`"||m==='"'||m==="'"||m==="`")&&y!==m)throw new ze("property names with quotes must have matching quotes");if((l==="constructor"||!u)&&(f=!0),i+="."+l,o="%"+i+"%",vt(xe,o))s=xe[o];else if(s!=null){if(!(l in s)){if(!t)throw new Xe("base intrinsic for "+e+" exists, but the property is not available.");return}if(Er&&c+1>=n.length){var E=Er(s,l);u=!!E,u&&"get"in E&&!("originalValue"in E.get)?s=E.get:s=s[l]}else u=vt(s,l),s=s[l];u&&!f&&(xe[o]=s)}}return s},Do=ai,Co=Oo,dp=Co([Do("%String.prototype.indexOf%")]),No=function(e,t){var n=Do(e,!!t);return typeof n=="function"&&dp(e,".prototype.")>-1?Co([n]):n},pp=ai,Or=No,hp=dt,yp=Le,Bo=pp("%Map%",!0),gp=Or("Map.prototype.get",!0),_p=Or("Map.prototype.set",!0),vp=Or("Map.prototype.has",!0),mp=Or("Map.prototype.delete",!0),wp=Or("Map.prototype.size",!0),qo=!!Bo&&function(){var e,t={assert:function(n){if(!t.has(n))throw new yp("Side channel does not contain "+hp(n))},delete:function(n){if(e){var i=mp(e,n);return wp(e)===0&&(e=void 0),i}return!1},get:function(n){if(e)return gp(e,n)},has:function(n){return e?vp(e,n):!1},set:function(n,i){e||(e=new Bo),_p(e,n,i)}};return t},bp=ai,wt=No,$p=dt,bt=qo,Ep=Le,Ze=bp("%WeakMap%",!0),Sp=wt("WeakMap.prototype.get",!0),Ap=wt("WeakMap.prototype.set",!0),Op=wt("WeakMap.prototype.has",!0),Ip=wt("WeakMap.prototype.delete",!0),Pp=Ze?function(){var e,t,n={assert:function(i){if(!n.has(i))throw new Ep("Side channel does not contain "+$p(i))},delete:function(i){if(Ze&&i&&(typeof i=="object"||typeof i=="function")){if(e)return Ip(e,i)}else if(bt&&t)return t.delete(i);return!1},get:function(i){return Ze&&i&&(typeof i=="object"||typeof i=="function")&&e?Sp(e,i):t&&t.get(i)},has:function(i){return Ze&&i&&(typeof i=="object"||typeof i=="function")&&e?Op(e,i):!!t&&t.has(i)},set:function(i,a){Ze&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new Ze),Ap(e,i,a)):bt&&(t||(t=bt()),t.set(i,a))}};return n}:bt,xp=Le,Tp=dt,Rp=ad,Fp=qo,Mp=Pp,Dp=Mp||Fp||Rp,Uo=function(){var e,t={assert:function(n){if(!t.has(n))throw new xp("Side channel does not contain "+Tp(n))},delete:function(n){return!!e&&e.delete(n)},get:function(n){return e&&e.get(n)},has:function(n){return!!e&&e.has(n)},set:function(n,i){e||(e=Dp()),e.set(n,i)}};return t},Cp=String.prototype.replace,Np=/%20/g,oi={RFC1738:"RFC1738",RFC3986:"RFC3986"},ko={default:oi.RFC3986,formatters:{RFC1738:function(r){return Cp.call(r,Np,"+")},RFC3986:function(r){return String(r)}},RFC1738:oi.RFC1738,RFC3986:oi.RFC3986},Bp=ko,qp=Uo,ui=Object.prototype.hasOwnProperty,Te=Array.isArray,$t=qp(),Lo=function(e,t){return $t.set(e,t),e},Et=function(e){return $t.has(e)},si=function(e){return $t.get(e)},jo=function(e,t){$t.set(e,t)},te=function(){for(var r=[],e=0;e<256;++e)r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return r}(),Up=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(Te(n)){for(var i=[],a=0;a<n.length;++a)typeof n[a]<"u"&&i.push(n[a]);t.obj[t.prop]=i}}},fi=function(e,t){for(var n=t&&t.plainObjects?{__proto__:null}:{},i=0;i<e.length;++i)typeof e[i]<"u"&&(n[i]=e[i]);return n},kp=function r(e,t,n){if(!t)return e;if(typeof t!="object"&&typeof t!="function"){if(Te(e))e.push(t);else if(e&&typeof e=="object")if(Et(e)){var i=si(e)+1;e[i]=t,jo(e,i)}else(n&&(n.plainObjects||n.allowPrototypes)||!ui.call(Object.prototype,t))&&(e[t]=!0);else return[e,t];return e}if(!e||typeof e!="object"){if(Et(t)){for(var a=Object.keys(t),o=n&&n.plainObjects?{__proto__:null,0:e}:{0:e},s=0;s<a.length;s++){var f=parseInt(a[s],10);o[f+1]=t[a[s]]}return Lo(o,si(t)+1)}return[e].concat(t)}var d=e;return Te(e)&&!Te(t)&&(d=fi(e,n)),Te(e)&&Te(t)?(t.forEach(function(c,u){if(ui.call(e,u)){var l=e[u];l&&typeof l=="object"&&c&&typeof c=="object"?e[u]=r(l,c,n):e.push(c)}else e[u]=c}),e):Object.keys(t).reduce(function(c,u){var l=t[u];return ui.call(c,u)?c[u]=r(c[u],l,n):c[u]=l,c},d)},Lp=function(e,t){return Object.keys(t).reduce(function(n,i){return n[i]=t[i],n},e)},jp=function(r,e,t){var n=r.replace(/\+/g," ");if(t==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},ci=1024,Vp=function(e,t,n,i,a){if(e.length===0)return e;var o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),n==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(y){return"%26%23"+parseInt(y.slice(2),16)+"%3B"});for(var s="",f=0;f<o.length;f+=ci){for(var d=o.length>=ci?o.slice(f,f+ci):o,c=[],u=0;u<d.length;++u){var l=d.charCodeAt(u);if(l===45||l===46||l===95||l===126||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||a===Bp.RFC1738&&(l===40||l===41)){c[c.length]=d.charAt(u);continue}if(l<128){c[c.length]=te[l];continue}if(l<2048){c[c.length]=te[192|l>>6]+te[128|l&63];continue}if(l<55296||l>=57344){c[c.length]=te[224|l>>12]+te[128|l>>6&63]+te[128|l&63];continue}u+=1,l=65536+((l&1023)<<10|d.charCodeAt(u)&1023),c[c.length]=te[240|l>>18]+te[128|l>>12&63]+te[128|l>>6&63]+te[128|l&63]}s+=c.join("")}return s},Gp=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],i=0;i<t.length;++i)for(var a=t[i],o=a.obj[a.prop],s=Object.keys(o),f=0;f<s.length;++f){var d=s[f],c=o[d];typeof c=="object"&&c!==null&&n.indexOf(c)===-1&&(t.push({obj:o,prop:d}),n.push(c))}return Up(t),e},Hp=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Wp=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},zp=function(e,t,n,i){if(Et(e)){var a=si(e)+1;return e[a]=t,jo(e,a),e}var o=[].concat(e,t);return o.length>n?Lo(fi(o,{plainObjects:i}),o.length-1):o},Xp=function(e,t){if(Te(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(t(e[i]));return n}return t(e)},Yp={arrayToObject:fi,assign:Lp,combine:zp,compact:Gp,decode:jp,encode:Vp,isBuffer:Wp,isOverflow:Et,isRegExp:Hp,maybeMap:Xp,merge:kp},Vo=Uo,St=Yp,Ir=ko,Kp=Object.prototype.hasOwnProperty,Go={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},ne=Array.isArray,Zp=Array.prototype.push,Ho=function(r,e){Zp.apply(r,ne(e)?e:[e])},Jp=Date.prototype.toISOString,Wo=Ir.default,N={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:St.encode,encodeValuesOnly:!1,filter:void 0,format:Wo,formatter:Ir.formatters[Wo],indices:!1,serializeDate:function(e){return Jp.call(e)},skipNulls:!1,strictNullHandling:!1},Qp=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},li={},eh=function r(e,t,n,i,a,o,s,f,d,c,u,l,y,m,E,S,O,$){for(var p=e,I=$,T=0,R=!1;(I=I.get(li))!==void 0&&!R;){var b=I.get(e);if(T+=1,typeof b<"u"){if(b===T)throw new RangeError("Cyclic object value");R=!0}typeof I.get(li)>"u"&&(T=0)}if(typeof c=="function"?p=c(t,p):p instanceof Date?p=y(p):n==="comma"&&ne(p)&&(p=St.maybeMap(p,function(ca){return ca instanceof Date?y(ca):ca})),p===null){if(o)return d&&!S?d(t,N.encoder,O,"key",m):t;p=""}if(Qp(p)||St.isBuffer(p)){if(d){var g=S?t:d(t,N.encoder,O,"key",m);return[E(g)+"="+E(d(p,N.encoder,O,"value",m))]}return[E(t)+"="+E(String(p))]}var _=[];if(typeof p>"u")return _;var A;if(n==="comma"&&ne(p))S&&d&&(p=St.maybeMap(p,d)),A=[{value:p.length>0?p.join(",")||null:void 0}];else if(ne(c))A=c;else{var P=Object.keys(p);A=u?P.sort(u):P}var B=f?String(t).replace(/\./g,"%2E"):String(t),W=i&&ne(p)&&p.length===1?B+"[]":B;if(a&&ne(p)&&p.length===0)return W+"[]";for(var oe=0;oe<A.length;++oe){var Y=A[oe],ke=typeof Y=="object"&&Y&&typeof Y.value<"u"?Y.value:p[Y];if(!(s&&ke===null)){var fa=l&&f?String(Y).replace(/\./g,"%2E"):String(Y),cT=ne(p)?typeof n=="function"?n(W,fa):W:W+(l?"."+fa:"["+fa+"]");$.set(e,T);var zf=Vo();zf.set(li,$),Ho(_,r(ke,cT,n,i,a,o,s,f,n==="comma"&&S&&ne(p)?null:d,c,u,l,y,m,E,S,O,zf))}}return _},rh=function(e){if(!e)return N;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.encodeDotInKeys<"u"&&typeof e.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=e.charset||N.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=Ir.default;if(typeof e.format<"u"){if(!Kp.call(Ir.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=Ir.formatters[n],a=N.filter;(typeof e.filter=="function"||ne(e.filter))&&(a=e.filter);var o;if(e.arrayFormat in Go?o=e.arrayFormat:"indices"in e?o=e.indices?"indices":"repeat":o=N.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var s=typeof e.allowDots>"u"?e.encodeDotInKeys===!0?!0:N.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:N.addQueryPrefix,allowDots:s,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:N.allowEmptyArrays,arrayFormat:o,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:N.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?N.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:N.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:N.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:N.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:N.encodeValuesOnly,filter:a,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:N.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:N.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:N.strictNullHandling}},th=function(r,e){var t=r,n=rh(e),i,a;typeof n.filter=="function"?(a=n.filter,t=a("",t)):ne(n.filter)&&(a=n.filter,i=a);var o=[];if(typeof t!="object"||t===null)return"";var s=Go[n.arrayFormat],f=s==="comma"&&n.commaRoundTrip;i||(i=Object.keys(t)),n.sort&&i.sort(n.sort);for(var d=Vo(),c=0;c<i.length;++c){var u=i[c],l=t[u];n.skipNulls&&l===null||Ho(o,eh(l,u,s,f,n.allowEmptyArrays,n.strictNullHandling,n.skipNulls,n.encodeDotInKeys,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,d))}var y=o.join(n.delimiter),m=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?m+="utf8=%26%2310003%3B&":m+="utf8=%E2%9C%93&"),y.length>0?m+y:""},nh=we(th);let zo={storeIdentifier:"",environment:"prod"};function ih(r){zo=r}function j(){return zo}const ah=(r,e="")=>{switch(r){case"prod":return"https://api.rechargeapps.com";case"stage":return"https://api.stage.rechargeapps.com";case"preprod":case"prestage":return`${e}/api`}},oh=(r,e="")=>{switch(r){case"prod":return"https://admin.rechargeapps.com";case"stage":return"https://admin.stage.rechargeapps.com";case"preprod":case"prestage":return e}},uh=r=>{switch(r){case"prod":case"preprod":return"https://static.rechargecdn.com";case"stage":case"prestage":return"https://static.stage.rechargecdn.com"}},Xo="/tools/recurring";class Je{constructor(e,t){this.name="RechargeRequestError",this.message=e,this.status=t}}function sh(r){return nh(r,{encode:!1,indices:!1,arrayFormat:"comma"})}function v(r,e){return{...r,internalFnCall:r.internalFnCall??e,internalRequestId:r.internalRequestId??ya()}}async function At(r,e,t={}){const n=j();return X(r,`${uh(n.environment)}/store/${n.storeIdentifier}${e}`,t)}async function w(r,e,{id:t,query:n,data:i,headers:a}={},o){const{environment:s,environmentUri:f,storeIdentifier:d,loginRetryFn:c,__unstable_twoFactorRetryFn:u,appName:l,appVersion:y}=j();if(!d)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const m=o.apiToken;if(!m)throw new Error("No API token defined on session.");const E=ah(s,f),S={"X-Recharge-Access-Token":m,"X-Recharge-Version":"2021-11","X-Recharge-Sdk-Fn":o.internalFnCall,...l?{"X-Recharge-Sdk-App-Name":l}:{},...y?{"X-Recharge-Sdk-App-Version":y}:{},"X-Recharge-Sdk-Version":"1.68.1","X-Request-Id":o.internalRequestId,...o.tmp_fn_identifier?{"X-Recharge-Sdk-Fn-Identifier":o.tmp_fn_identifier}:{},...a||{}},O={shop_url:d,...n};try{return await X(r,`${E}${e}`,{id:t,query:O,data:i,headers:S})}catch($){if(c&&$ instanceof Je&&$.status===401)return c().then(p=>{if(p)return X(r,`${E}${e}`,{id:t,query:O,data:i,headers:{...S,"X-Recharge-Access-Token":p.apiToken}});throw $});if(u&&$ instanceof Je&&$.status===423)return u().then(p=>{if(p)return X(r,`${E}${e}`,{id:t,query:O,data:i,headers:{...S,"X-Recharge-Access-Token":p.apiToken}});throw $});throw $}}async function Re(r,e,t={}){return X(r,`${Xo}${e}`,t)}async function X(r,e,{id:t,query:n,data:i,headers:a}={}){let o=e.trim();if(t&&(o=[o,`${t}`.trim()].join("/")),n){let u;[o,u]=o.split("?");const l=[u,sh(n)].join("&").replace(/^&/,"");o=`${o}${l?`?${l}`:""}`}let s;i&&r!=="get"&&(s=JSON.stringify(i));const f={Accept:"application/json","Content-Type":"application/json","X-Recharge-App":"storefront-client",...a||{}},d=await fetch(o,{method:r,headers:f,body:s});let c;try{c=await d.json()}catch{}if(!d.ok)throw d.status===502||d.status===504?new Je("A gateway error occurred while making the request",d.status):c&&c.error?new Je(c.error,d.status):c&&c.errors?new Je(JSON.stringify(c.errors),d.status):new Je("A connection error occurred while making the request");return c}function fh(r,e){return w("get","/addresses",{query:e},v(r,"listAddresses"))}async function ch(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{address:n}=await w("get","/addresses",{id:e,query:{include:t?.include}},v(r,"getAddress"));return n}async function lh(r,e){const{address:t}=await w("post","/addresses",{data:{customer_id:r.customerId?Number(r.customerId):void 0,...e}},v(r,"createAddress"));return t}async function di(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");const{address:i}=await w("put","/addresses",{id:e,data:t,query:n},v(r,"updateAddress"));return i}async function dh(r,e,t,n){return di(v(r,"applyDiscountToAddress"),e,{discounts:[{code:t}]},n)}async function ph(r,e,t){if(e===void 0||e==="")throw new Error("Id is required");return di(v(r,"removeDiscountsFromAddress"),e,{discounts:[]},t)}function hh(r,e){if(e===void 0||e==="")throw new Error("ID is required");return w("delete","/addresses",{id:e},v(r,"deleteAddress"))}async function yh(r,e){const{address:t}=await w("post","/addresses/merge",{data:e},v(r,"mergeAddresses"));return t}async function gh(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{charge:n}=await w("post",`/addresses/${e}/charges/skip`,{data:t},v(r,"skipFutureCharge"));return n}var _h=Object.freeze({__proto__:null,applyDiscountToAddress:dh,createAddress:lh,deleteAddress:hh,getAddress:ch,listAddresses:fh,mergeAddresses:yh,removeDiscountsFromAddress:ph,skipFutureCharge:gh,updateAddress:di});async function vh(){const{storefrontAccessToken:r}=j(),e={};r&&(e["X-Recharge-Storefront-Access-Token"]=r);const t=await Re("get","/access",{headers:e});return{apiToken:t.api_token,customerId:t.customer_id,message:t.message}}async function mh(r,e){return Yo(r,e)}async function Yo(r,e){if(!r)throw new Error("Shopify storefront token is required");const{storeIdentifier:t}=j();if(!t)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const{api_token:n,customer_id:i,message:a}=await Pr("post","/shopify_storefront_access",{data:{customer_token:e,storefront_token:r,shop_url:t}});return n?{apiToken:n,customerId:i,message:a}:null}async function wh(r){const{storeIdentifier:e}=j();if(!e)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const{api_token:t,customer_id:n,message:i}=await Pr("post","/shopify_customer_account_api_access",{data:{customer_token:r,shop_url:e}});return t?{apiToken:t,customerId:n,message:i}:null}async function bh(r,e={}){if(!r)throw new Error("Email is required.");const{storeIdentifier:t}=j();if(!t)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const n=await Pr("post","/attempt_login",{data:{email:r,shop:t,...e}});if(n.errors)throw new Error(n.errors);return n.session_token}async function $h(r,e={}){if(!r)throw new Error("Email is required.");const{storefrontAccessToken:t}=j(),n={};t&&(n["X-Recharge-Storefront-Access-Token"]=t);const i=await Re("post","/attempt_login",{data:{email:r,...e},headers:n});if(i.errors)throw new Error(i.errors);return i.session_token}async function Eh(r,e,t){if(!r)throw new Error("Email is required.");if(!e)throw new Error("Session token is required.");if(!t)throw new Error("Code is required.");const{storeIdentifier:n}=j();if(!n)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const i=await Pr("post","/validate_login",{data:{code:t,email:r,session_token:e,shop:n}});if(i.errors)throw new Error(i.errors);return{apiToken:i.api_token,customerId:i.customer_id}}async function Sh(r,e,t){if(!r)throw new Error("Email is required.");if(!e)throw new Error("Session token is required.");if(!t)throw new Error("Code is required.");const{storefrontAccessToken:n}=j(),i={};n&&(i["X-Recharge-Storefront-Access-Token"]=n);const a=await Re("post","/validate_login",{data:{code:t,email:r,session_token:e},headers:i});if(a.errors)throw new Error(a.errors);return{apiToken:a.api_token,customerId:a.customer_id}}function Ah(){const{customerHash:r}=j(),{pathname:e,search:t}=window.location,n=new URLSearchParams(t).get("token"),i=e.split("/").filter(Boolean),a=i.findIndex(s=>s==="portal"),o=a!==-1?i[a+1]:r;if(!n||!o)throw new Error("Not in context of Recharge Customer Portal or URL did not contain correct params");return{customerHash:o,token:n}}async function Oh(){const{customerHash:r,token:e}=Ah(),{storeIdentifier:t}=j(),n=await Pr("post",`/customers/${r}/access`,{data:{token:e,shop:t}});return{apiToken:n.api_token,customerId:n.customer_id}}async function Pr(r,e,{id:t,query:n,data:i,headers:a}={}){const{environment:o,environmentUri:s,storefrontAccessToken:f,appName:d,appVersion:c}=j(),u=oh(o,s),l={...f?{"X-Recharge-Storefront-Access-Token":f}:{},...d?{"X-Recharge-Sdk-App-Name":d}:{},...c?{"X-Recharge-Sdk-App-Version":c}:{},"X-Recharge-Sdk-Version":"1.68.1",...a||{}};return X(r,`${u}${e}`,{id:t,query:n,data:i,headers:l})}var Ih=Object.freeze({__proto__:null,loginCustomerPortal:Oh,loginShopifyApi:mh,loginShopifyAppProxy:vh,loginWithShopifyCustomerAccount:wh,loginWithShopifyStorefront:Yo,sendPasswordlessCode:bh,sendPasswordlessCodeAppProxy:$h,validatePasswordlessCode:Eh,validatePasswordlessCodeAppProxy:Sh}),Ko={},pi={},ce={},Ph=typeof D=="object"&&D&&D.Object===Object&&D,Zo=Ph,xh=Zo,Th=typeof self=="object"&&self&&self.Object===Object&&self,Rh=xh||Th||Function("return this")(),le=Rh,Fh=le,Mh=Fh.Symbol,Ot=Mh,Jo=Ot,Qo=Object.prototype,Dh=Qo.hasOwnProperty,Ch=Qo.toString,xr=Jo?Jo.toStringTag:void 0;function Nh(r){var e=Dh.call(r,xr),t=r[xr];try{r[xr]=void 0;var n=!0}catch{}var i=Ch.call(r);return n&&(e?r[xr]=t:delete r[xr]),i}var Bh=Nh,qh=Object.prototype,Uh=qh.toString;function kh(r){return Uh.call(r)}var Lh=kh,eu=Ot,jh=Bh,Vh=Lh,Gh="[object Null]",Hh="[object Undefined]",ru=eu?eu.toStringTag:void 0;function Wh(r){return r==null?r===void 0?Hh:Gh:ru&&ru in Object(r)?jh(r):Vh(r)}var _e=Wh;function zh(r){return r!=null&&typeof r=="object"}var ve=zh,Xh=_e,Yh=ve,Kh="[object Number]";function Zh(r){return typeof r=="number"||Yh(r)&&Xh(r)==Kh}var It=Zh,M={};function Jh(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var Qe=Jh,Qh=_e,ey=Qe,ry="[object AsyncFunction]",ty="[object Function]",ny="[object GeneratorFunction]",iy="[object Proxy]";function ay(r){if(!ey(r))return!1;var e=Qh(r);return e==ty||e==ny||e==ry||e==iy}var hi=ay,oy=le,uy=oy["__core-js_shared__"],sy=uy,yi=sy,tu=function(){var r=/[^.]+$/.exec(yi&&yi.keys&&yi.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function fy(r){return!!tu&&tu in r}var cy=fy,ly=Function.prototype,dy=ly.toString;function py(r){if(r!=null){try{return dy.call(r)}catch{}try{return r+""}catch{}}return""}var nu=py,hy=hi,yy=cy,gy=Qe,_y=nu,vy=/[\\^$.*+?()[\]{}|]/g,my=/^\[object .+?Constructor\]$/,wy=Function.prototype,by=Object.prototype,$y=wy.toString,Ey=by.hasOwnProperty,Sy=RegExp("^"+$y.call(Ey).replace(vy,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ay(r){if(!gy(r)||yy(r))return!1;var e=hy(r)?Sy:my;return e.test(_y(r))}var Oy=Ay;function Iy(r,e){return r?.[e]}var Py=Iy,xy=Oy,Ty=Py;function Ry(r,e){var t=Ty(r,e);return xy(t)?t:void 0}var Fe=Ry,Fy=Fe,My=function(){try{var r=Fy(Object,"defineProperty");return r({},"",{}),r}catch{}}(),iu=My,au=iu;function Dy(r,e,t){e=="__proto__"&&au?au(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}var ou=Dy;function Cy(r,e){return r===e||r!==r&&e!==e}var Pt=Cy,Ny=ou,By=Pt,qy=Object.prototype,Uy=qy.hasOwnProperty;function ky(r,e,t){var n=r[e];(!(Uy.call(r,e)&&By(n,t))||t===void 0&&!(e in r))&&Ny(r,e,t)}var Ly=ky,jy=Ly,Vy=ou;function Gy(r,e,t,n){var i=!t;t||(t={});for(var a=-1,o=e.length;++a<o;){var s=e[a],f=n?n(t[s],r[s],s,t,r):void 0;f===void 0&&(f=r[s]),i?Vy(t,s,f):jy(t,s,f)}return t}var Hy=Gy;function Wy(r){return r}var xt=Wy;function zy(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}var Xy=zy,Yy=Xy,uu=Math.max;function Ky(r,e,t){return e=uu(e===void 0?r.length-1:e,0),function(){for(var n=arguments,i=-1,a=uu(n.length-e,0),o=Array(a);++i<a;)o[i]=n[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=n[i];return s[e]=t(o),Yy(r,this,s)}}var Zy=Ky;function Jy(r){return function(){return r}}var Qy=Jy,eg=Qy,su=iu,rg=xt,tg=su?function(r,e){return su(r,"toString",{configurable:!0,enumerable:!1,value:eg(e),writable:!0})}:rg,ng=tg,ig=800,ag=16,og=Date.now;function ug(r){var e=0,t=0;return function(){var n=og(),i=ag-(n-t);if(t=n,i>0){if(++e>=ig)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}var sg=ug,fg=ng,cg=sg,lg=cg(fg),dg=lg,pg=xt,hg=Zy,yg=dg;function gg(r,e){return yg(hg(r,e,pg),r+"")}var _g=gg,vg=9007199254740991;function mg(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=vg}var gi=mg,wg=hi,bg=gi;function $g(r){return r!=null&&bg(r.length)&&!wg(r)}var Tr=$g,Eg=9007199254740991,Sg=/^(?:0|[1-9]\d*)$/;function Ag(r,e){var t=typeof r;return e=e??Eg,!!e&&(t=="number"||t!="symbol"&&Sg.test(r))&&r>-1&&r%1==0&&r<e}var _i=Ag,Og=Pt,Ig=Tr,Pg=_i,xg=Qe;function Tg(r,e,t){if(!xg(t))return!1;var n=typeof e;return(n=="number"?Ig(t)&&Pg(e,t.length):n=="string"&&e in t)?Og(t[e],r):!1}var fu=Tg,Rg=_g,Fg=fu;function Mg(r){return Rg(function(e,t){var n=-1,i=t.length,a=i>1?t[i-1]:void 0,o=i>2?t[2]:void 0;for(a=r.length>3&&typeof a=="function"?(i--,a):void 0,o&&Fg(t[0],t[1],o)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var s=t[n];s&&r(e,s,n,a)}return e})}var Dg=Mg;function Cg(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var cu=Cg,Ng=_e,Bg=ve,qg="[object Arguments]";function Ug(r){return Bg(r)&&Ng(r)==qg}var kg=Ug,lu=kg,Lg=ve,du=Object.prototype,jg=du.hasOwnProperty,Vg=du.propertyIsEnumerable,Gg=lu(function(){return arguments}())?lu:function(r){return Lg(r)&&jg.call(r,"callee")&&!Vg.call(r,"callee")},pu=Gg,Hg=Array.isArray,V=Hg,Tt={exports:{}};function Wg(){return!1}var zg=Wg;Tt.exports,function(r,e){var t=le,n=zg,i=e&&!e.nodeType&&e,a=i&&!0&&r&&!r.nodeType&&r,o=a&&a.exports===i,s=o?t.Buffer:void 0,f=s?s.isBuffer:void 0,d=f||n;r.exports=d}(Tt,Tt.exports);var hu=Tt.exports,Xg=_e,Yg=gi,Kg=ve,Zg="[object Arguments]",Jg="[object Array]",Qg="[object Boolean]",e_="[object Date]",r_="[object Error]",t_="[object Function]",n_="[object Map]",i_="[object Number]",a_="[object Object]",o_="[object RegExp]",u_="[object Set]",s_="[object String]",f_="[object WeakMap]",c_="[object ArrayBuffer]",l_="[object DataView]",d_="[object Float32Array]",p_="[object Float64Array]",h_="[object Int8Array]",y_="[object Int16Array]",g_="[object Int32Array]",__="[object Uint8Array]",v_="[object Uint8ClampedArray]",m_="[object Uint16Array]",w_="[object Uint32Array]",F={};F[d_]=F[p_]=F[h_]=F[y_]=F[g_]=F[__]=F[v_]=F[m_]=F[w_]=!0,F[Zg]=F[Jg]=F[c_]=F[Qg]=F[l_]=F[e_]=F[r_]=F[t_]=F[n_]=F[i_]=F[a_]=F[o_]=F[u_]=F[s_]=F[f_]=!1;function b_(r){return Kg(r)&&Yg(r.length)&&!!F[Xg(r)]}var $_=b_;function E_(r){return function(e){return r(e)}}var S_=E_,Rt={exports:{}};Rt.exports,function(r,e){var t=Zo,n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,o=a&&t.process,s=function(){try{var f=i&&i.require&&i.require("util").types;return f||o&&o.binding&&o.binding("util")}catch{}}();r.exports=s}(Rt,Rt.exports);var A_=Rt.exports,O_=$_,I_=S_,yu=A_,gu=yu&&yu.isTypedArray,P_=gu?I_(gu):O_,_u=P_,x_=cu,T_=pu,R_=V,F_=hu,M_=_i,D_=_u,C_=Object.prototype,N_=C_.hasOwnProperty;function B_(r,e){var t=R_(r),n=!t&&T_(r),i=!t&&!n&&F_(r),a=!t&&!n&&!i&&D_(r),o=t||n||i||a,s=o?x_(r.length,String):[],f=s.length;for(var d in r)(e||N_.call(r,d))&&!(o&&(d=="length"||i&&(d=="offset"||d=="parent")||a&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||M_(d,f)))&&s.push(d);return s}var vu=B_,q_=Object.prototype;function U_(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||q_;return r===t}var mu=U_;function k_(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}var L_=k_,j_=Qe,V_=mu,G_=L_,H_=Object.prototype,W_=H_.hasOwnProperty;function z_(r){if(!j_(r))return G_(r);var e=V_(r),t=[];for(var n in r)n=="constructor"&&(e||!W_.call(r,n))||t.push(n);return t}var X_=z_,Y_=vu,K_=X_,Z_=Tr;function J_(r){return Z_(r)?Y_(r,!0):K_(r)}var Q_=J_,ev=Hy,rv=Dg,tv=Q_,nv=rv(function(r,e){ev(e,tv(e),r)}),iv=nv,av=iv,Ft={},Me={};function ov(r,e){for(var t=-1,n=r==null?0:r.length;++t<n;)if(!e(r[t],t,r))return!1;return!0}var uv=ov;function sv(r){return function(e,t,n){for(var i=-1,a=Object(e),o=n(e),s=o.length;s--;){var f=o[r?s:++i];if(t(a[f],f,a)===!1)break}return e}}var fv=sv,cv=fv,lv=cv(),dv=lv;function pv(r,e){return function(t){return r(e(t))}}var hv=pv,yv=hv,gv=yv(Object.keys,Object),_v=gv,vv=mu,mv=_v,wv=Object.prototype,bv=wv.hasOwnProperty;function $v(r){if(!vv(r))return mv(r);var e=[];for(var t in Object(r))bv.call(r,t)&&t!="constructor"&&e.push(t);return e}var Ev=$v,Sv=vu,Av=Ev,Ov=Tr;function Iv(r){return Ov(r)?Sv(r):Av(r)}var Mt=Iv,Pv=dv,xv=Mt;function Tv(r,e){return r&&Pv(r,e,xv)}var Rv=Tv,Fv=Tr;function Mv(r,e){return function(t,n){if(t==null)return t;if(!Fv(t))return r(t,n);for(var i=t.length,a=e?i:-1,o=Object(t);(e?a--:++a<i)&&n(o[a],a,o)!==!1;);return t}}var Dv=Mv,Cv=Rv,Nv=Dv,Bv=Nv(Cv),vi=Bv,qv=vi;function Uv(r,e){var t=!0;return qv(r,function(n,i,a){return t=!!e(n,i,a),t}),t}var kv=Uv;function Lv(){this.__data__=[],this.size=0}var jv=Lv,Vv=Pt;function Gv(r,e){for(var t=r.length;t--;)if(Vv(r[t][0],e))return t;return-1}var Dt=Gv,Hv=Dt,Wv=Array.prototype,zv=Wv.splice;function Xv(r){var e=this.__data__,t=Hv(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():zv.call(e,t,1),--this.size,!0}var Yv=Xv,Kv=Dt;function Zv(r){var e=this.__data__,t=Kv(e,r);return t<0?void 0:e[t][1]}var Jv=Zv,Qv=Dt;function em(r){return Qv(this.__data__,r)>-1}var rm=em,tm=Dt;function nm(r,e){var t=this.__data__,n=tm(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var im=nm,am=jv,om=Yv,um=Jv,sm=rm,fm=im;function er(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}er.prototype.clear=am,er.prototype.delete=om,er.prototype.get=um,er.prototype.has=sm,er.prototype.set=fm;var Ct=er,cm=Ct;function lm(){this.__data__=new cm,this.size=0}var dm=lm;function pm(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}var hm=pm;function ym(r){return this.__data__.get(r)}var gm=ym;function _m(r){return this.__data__.has(r)}var vm=_m,mm=Fe,wm=le,bm=mm(wm,"Map"),mi=bm,$m=Fe,Em=$m(Object,"create"),Nt=Em,wu=Nt;function Sm(){this.__data__=wu?wu(null):{},this.size=0}var Am=Sm;function Om(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var Im=Om,Pm=Nt,xm="__lodash_hash_undefined__",Tm=Object.prototype,Rm=Tm.hasOwnProperty;function Fm(r){var e=this.__data__;if(Pm){var t=e[r];return t===xm?void 0:t}return Rm.call(e,r)?e[r]:void 0}var Mm=Fm,Dm=Nt,Cm=Object.prototype,Nm=Cm.hasOwnProperty;function Bm(r){var e=this.__data__;return Dm?e[r]!==void 0:Nm.call(e,r)}var qm=Bm,Um=Nt,km="__lodash_hash_undefined__";function Lm(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Um&&e===void 0?km:e,this}var jm=Lm,Vm=Am,Gm=Im,Hm=Mm,Wm=qm,zm=jm;function rr(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}rr.prototype.clear=Vm,rr.prototype.delete=Gm,rr.prototype.get=Hm,rr.prototype.has=Wm,rr.prototype.set=zm;var Xm=rr,bu=Xm,Ym=Ct,Km=mi;function Zm(){this.size=0,this.__data__={hash:new bu,map:new(Km||Ym),string:new bu}}var Jm=Zm;function Qm(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}var ew=Qm,rw=ew;function tw(r,e){var t=r.__data__;return rw(e)?t[typeof e=="string"?"string":"hash"]:t.map}var Bt=tw,nw=Bt;function iw(r){var e=nw(this,r).delete(r);return this.size-=e?1:0,e}var aw=iw,ow=Bt;function uw(r){return ow(this,r).get(r)}var sw=uw,fw=Bt;function cw(r){return fw(this,r).has(r)}var lw=cw,dw=Bt;function pw(r,e){var t=dw(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}var hw=pw,yw=Jm,gw=aw,_w=sw,vw=lw,mw=hw;function tr(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}tr.prototype.clear=yw,tr.prototype.delete=gw,tr.prototype.get=_w,tr.prototype.has=vw,tr.prototype.set=mw;var wi=tr,ww=Ct,bw=mi,$w=wi,Ew=200;function Sw(r,e){var t=this.__data__;if(t instanceof ww){var n=t.__data__;if(!bw||n.length<Ew-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new $w(n)}return t.set(r,e),this.size=t.size,this}var Aw=Sw,Ow=Ct,Iw=dm,Pw=hm,xw=gm,Tw=vm,Rw=Aw;function nr(r){var e=this.__data__=new Ow(r);this.size=e.size}nr.prototype.clear=Iw,nr.prototype.delete=Pw,nr.prototype.get=xw,nr.prototype.has=Tw,nr.prototype.set=Rw;var $u=nr,Fw="__lodash_hash_undefined__";function Mw(r){return this.__data__.set(r,Fw),this}var Dw=Mw;function Cw(r){return this.__data__.has(r)}var Nw=Cw,Bw=wi,qw=Dw,Uw=Nw;function qt(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new Bw;++e<t;)this.add(r[e])}qt.prototype.add=qt.prototype.push=qw,qt.prototype.has=Uw;var kw=qt;function Lw(r,e){for(var t=-1,n=r==null?0:r.length;++t<n;)if(e(r[t],t,r))return!0;return!1}var jw=Lw;function Vw(r,e){return r.has(e)}var Gw=Vw,Hw=kw,Ww=jw,zw=Gw,Xw=1,Yw=2;function Kw(r,e,t,n,i,a){var o=t&Xw,s=r.length,f=e.length;if(s!=f&&!(o&&f>s))return!1;var d=a.get(r),c=a.get(e);if(d&&c)return d==e&&c==r;var u=-1,l=!0,y=t&Yw?new Hw:void 0;for(a.set(r,e),a.set(e,r);++u<s;){var m=r[u],E=e[u];if(n)var S=o?n(E,m,u,e,r,a):n(m,E,u,r,e,a);if(S!==void 0){if(S)continue;l=!1;break}if(y){if(!Ww(e,function(O,$){if(!zw(y,$)&&(m===O||i(m,O,t,n,a)))return y.push($)})){l=!1;break}}else if(!(m===E||i(m,E,t,n,a))){l=!1;break}}return a.delete(r),a.delete(e),l}var Eu=Kw,Zw=le,Jw=Zw.Uint8Array,Qw=Jw;function e0(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}var r0=e0;function t0(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}var n0=t0,Su=Ot,Au=Qw,i0=Pt,a0=Eu,o0=r0,u0=n0,s0=1,f0=2,c0="[object Boolean]",l0="[object Date]",d0="[object Error]",p0="[object Map]",h0="[object Number]",y0="[object RegExp]",g0="[object Set]",_0="[object String]",v0="[object Symbol]",m0="[object ArrayBuffer]",w0="[object DataView]",Ou=Su?Su.prototype:void 0,bi=Ou?Ou.valueOf:void 0;function b0(r,e,t,n,i,a,o){switch(t){case w0:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case m0:return!(r.byteLength!=e.byteLength||!a(new Au(r),new Au(e)));case c0:case l0:case h0:return i0(+r,+e);case d0:return r.name==e.name&&r.message==e.message;case y0:case _0:return r==e+"";case p0:var s=o0;case g0:var f=n&s0;if(s||(s=u0),r.size!=e.size&&!f)return!1;var d=o.get(r);if(d)return d==e;n|=f0,o.set(r,e);var c=a0(s(r),s(e),n,i,a,o);return o.delete(r),c;case v0:if(bi)return bi.call(r)==bi.call(e)}return!1}var $0=b0;function E0(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}var S0=E0,A0=S0,O0=V;function I0(r,e,t){var n=e(r);return O0(r)?n:A0(n,t(r))}var P0=I0;function x0(r,e){for(var t=-1,n=r==null?0:r.length,i=0,a=[];++t<n;){var o=r[t];e(o,t,r)&&(a[i++]=o)}return a}var T0=x0;function R0(){return[]}var F0=R0,M0=T0,D0=F0,C0=Object.prototype,N0=C0.propertyIsEnumerable,Iu=Object.getOwnPropertySymbols,B0=Iu?function(r){return r==null?[]:(r=Object(r),M0(Iu(r),function(e){return N0.call(r,e)}))}:D0,q0=B0,U0=P0,k0=q0,L0=Mt;function j0(r){return U0(r,L0,k0)}var V0=j0,Pu=V0,G0=1,H0=Object.prototype,W0=H0.hasOwnProperty;function z0(r,e,t,n,i,a){var o=t&G0,s=Pu(r),f=s.length,d=Pu(e),c=d.length;if(f!=c&&!o)return!1;for(var u=f;u--;){var l=s[u];if(!(o?l in e:W0.call(e,l)))return!1}var y=a.get(r),m=a.get(e);if(y&&m)return y==e&&m==r;var E=!0;a.set(r,e),a.set(e,r);for(var S=o;++u<f;){l=s[u];var O=r[l],$=e[l];if(n)var p=o?n($,O,l,e,r,a):n(O,$,l,r,e,a);if(!(p===void 0?O===$||i(O,$,t,n,a):p)){E=!1;break}S||(S=l=="constructor")}if(E&&!S){var I=r.constructor,T=e.constructor;I!=T&&"constructor"in r&&"constructor"in e&&!(typeof I=="function"&&I instanceof I&&typeof T=="function"&&T instanceof T)&&(E=!1)}return a.delete(r),a.delete(e),E}var X0=z0,Y0=Fe,K0=le,Z0=Y0(K0,"DataView"),J0=Z0,Q0=Fe,eb=le,rb=Q0(eb,"Promise"),tb=rb,nb=Fe,ib=le,ab=nb(ib,"Set"),ob=ab,ub=Fe,sb=le,fb=ub(sb,"WeakMap"),cb=fb,$i=J0,Ei=mi,Si=tb,Ai=ob,Oi=cb,xu=_e,ir=nu,Tu="[object Map]",lb="[object Object]",Ru="[object Promise]",Fu="[object Set]",Mu="[object WeakMap]",Du="[object DataView]",db=ir($i),pb=ir(Ei),hb=ir(Si),yb=ir(Ai),gb=ir(Oi),De=xu;($i&&De(new $i(new ArrayBuffer(1)))!=Du||Ei&&De(new Ei)!=Tu||Si&&De(Si.resolve())!=Ru||Ai&&De(new Ai)!=Fu||Oi&&De(new Oi)!=Mu)&&(De=function(r){var e=xu(r),t=e==lb?r.constructor:void 0,n=t?ir(t):"";if(n)switch(n){case db:return Du;case pb:return Tu;case hb:return Ru;case yb:return Fu;case gb:return Mu}return e});var _b=De,Ii=$u,vb=Eu,mb=$0,wb=X0,Cu=_b,Nu=V,Bu=hu,bb=_u,$b=1,qu="[object Arguments]",Uu="[object Array]",Ut="[object Object]",Eb=Object.prototype,ku=Eb.hasOwnProperty;function Sb(r,e,t,n,i,a){var o=Nu(r),s=Nu(e),f=o?Uu:Cu(r),d=s?Uu:Cu(e);f=f==qu?Ut:f,d=d==qu?Ut:d;var c=f==Ut,u=d==Ut,l=f==d;if(l&&Bu(r)){if(!Bu(e))return!1;o=!0,c=!1}if(l&&!c)return a||(a=new Ii),o||bb(r)?vb(r,e,t,n,i,a):mb(r,e,f,t,n,i,a);if(!(t&$b)){var y=c&&ku.call(r,"__wrapped__"),m=u&&ku.call(e,"__wrapped__");if(y||m){var E=y?r.value():r,S=m?e.value():e;return a||(a=new Ii),i(E,S,t,n,a)}}return l?(a||(a=new Ii),wb(r,e,t,n,i,a)):!1}var Ab=Sb,Ob=Ab,Lu=ve;function ju(r,e,t,n,i){return r===e?!0:r==null||e==null||!Lu(r)&&!Lu(e)?r!==r&&e!==e:Ob(r,e,t,n,ju,i)}var Vu=ju,Ib=$u,Pb=Vu,xb=1,Tb=2;function Rb(r,e,t,n){var i=t.length,a=i,o=!n;if(r==null)return!a;for(r=Object(r);i--;){var s=t[i];if(o&&s[2]?s[1]!==r[s[0]]:!(s[0]in r))return!1}for(;++i<a;){s=t[i];var f=s[0],d=r[f],c=s[1];if(o&&s[2]){if(d===void 0&&!(f in r))return!1}else{var u=new Ib;if(n)var l=n(d,c,f,r,e,u);if(!(l===void 0?Pb(c,d,xb|Tb,n,u):l))return!1}}return!0}var Fb=Rb,Mb=Qe;function Db(r){return r===r&&!Mb(r)}var Gu=Db,Cb=Gu,Nb=Mt;function Bb(r){for(var e=Nb(r),t=e.length;t--;){var n=e[t],i=r[n];e[t]=[n,i,Cb(i)]}return e}var qb=Bb;function Ub(r,e){return function(t){return t==null?!1:t[r]===e&&(e!==void 0||r in Object(t))}}var Hu=Ub,kb=Fb,Lb=qb,jb=Hu;function Vb(r){var e=Lb(r);return e.length==1&&e[0][2]?jb(e[0][0],e[0][1]):function(t){return t===r||kb(t,r,e)}}var Gb=Vb,Hb=_e,Wb=ve,zb="[object Symbol]";function Xb(r){return typeof r=="symbol"||Wb(r)&&Hb(r)==zb}var kt=Xb,Yb=V,Kb=kt,Zb=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Jb=/^\w*$/;function Qb(r,e){if(Yb(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||Kb(r)?!0:Jb.test(r)||!Zb.test(r)||e!=null&&r in Object(e)}var Pi=Qb,Wu=wi,e1="Expected a function";function xi(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(e1);var t=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=t.cache;if(a.has(i))return a.get(i);var o=r.apply(this,n);return t.cache=a.set(i,o)||a,o};return t.cache=new(xi.Cache||Wu),t}xi.Cache=Wu;var r1=xi,t1=r1,n1=500;function i1(r){var e=t1(r,function(n){return t.size===n1&&t.clear(),n}),t=e.cache;return e}var a1=i1,o1=a1,u1=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,s1=/\\(\\)?/g,f1=o1(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(u1,function(t,n,i,a){e.push(i?a.replace(s1,"$1"):n||t)}),e}),c1=f1;function l1(r,e){for(var t=-1,n=r==null?0:r.length,i=Array(n);++t<n;)i[t]=e(r[t],t,r);return i}var Ti=l1,zu=Ot,d1=Ti,p1=V,h1=kt,y1=1/0,Xu=zu?zu.prototype:void 0,Yu=Xu?Xu.toString:void 0;function Ku(r){if(typeof r=="string")return r;if(p1(r))return d1(r,Ku)+"";if(h1(r))return Yu?Yu.call(r):"";var e=r+"";return e=="0"&&1/r==-y1?"-0":e}var g1=Ku,_1=g1;function v1(r){return r==null?"":_1(r)}var m1=v1,w1=V,b1=Pi,$1=c1,E1=m1;function S1(r,e){return w1(r)?r:b1(r,e)?[r]:$1(E1(r))}var Zu=S1,A1=kt,O1=1/0;function I1(r){if(typeof r=="string"||A1(r))return r;var e=r+"";return e=="0"&&1/r==-O1?"-0":e}var Lt=I1,P1=Zu,x1=Lt;function T1(r,e){e=P1(e,r);for(var t=0,n=e.length;r!=null&&t<n;)r=r[x1(e[t++])];return t&&t==n?r:void 0}var Ju=T1,R1=Ju;function F1(r,e,t){var n=r==null?void 0:R1(r,e);return n===void 0?t:n}var M1=F1;function D1(r,e){return r!=null&&e in Object(r)}var C1=D1,N1=Zu,B1=pu,q1=V,U1=_i,k1=gi,L1=Lt;function j1(r,e,t){e=N1(e,r);for(var n=-1,i=e.length,a=!1;++n<i;){var o=L1(e[n]);if(!(a=r!=null&&t(r,o)))break;r=r[o]}return a||++n!=i?a:(i=r==null?0:r.length,!!i&&k1(i)&&U1(o,i)&&(q1(r)||B1(r)))}var V1=j1,G1=C1,H1=V1;function W1(r,e){return r!=null&&H1(r,e,G1)}var z1=W1,X1=Vu,Y1=M1,K1=z1,Z1=Pi,J1=Gu,Q1=Hu,e$=Lt,r$=1,t$=2;function n$(r,e){return Z1(r)&&J1(e)?Q1(e$(r),e):function(t){var n=Y1(t,r);return n===void 0&&n===e?K1(t,r):X1(e,n,r$|t$)}}var i$=n$;function a$(r){return function(e){return e?.[r]}}var o$=a$,u$=Ju;function s$(r){return function(e){return u$(e,r)}}var f$=s$,c$=o$,l$=f$,d$=Pi,p$=Lt;function h$(r){return d$(r)?c$(p$(r)):l$(r)}var y$=h$,g$=Gb,_$=i$,v$=xt,m$=V,w$=y$;function b$(r){return typeof r=="function"?r:r==null?v$:typeof r=="object"?m$(r)?_$(r[0],r[1]):g$(r):w$(r)}var Qu=b$,$$=uv,E$=kv,S$=Qu,A$=V,O$=fu;function I$(r,e,t){var n=A$(r)?$$:E$;return t&&O$(r,e,t)&&(e=void 0),n(r,S$(e))}var Ri=I$;Object.defineProperty(Me,"__esModule",{value:!0}),Me.calculatePadding=R$,Me.slicePadding=F$;var P$=Ri,x$=T$(P$);function T$(r){return r&&r.__esModule?r:{default:r}}function R$(r){switch(r%4){case 0:return 0;case 1:return 3;case 2:return 2;case 3:return 1;default:return null}}function F$(r,e){var t=r.slice(e),n=(0,x$.default)(t.buffer(),function(i){return i===0});if(n!==!0)throw new Error("XDR Read Error: invalid padding")}Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.Cursor=void 0;var M$=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),D$=Me;function C$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var Fi=function(){function r(e){C$(this,r),e instanceof h||(e=typeof e=="number"?h.alloc(e):h.from(e)),this._setBuffer(e),this.rewind()}return M$(r,[{key:"_setBuffer",value:function(t){this._buffer=t,this.length=t.length}},{key:"buffer",value:function(){return this._buffer}},{key:"tap",value:function(t){return t(this),this}},{key:"clone",value:function(t){var n=new this.constructor(this.buffer());return n.seek(arguments.length===0?this.tell():t),n}},{key:"tell",value:function(){return this._index}},{key:"seek",value:function(t,n){return arguments.length===1&&(n=t,t="="),t==="+"?this._index+=n:t==="-"?this._index-=n:this._index=n,this}},{key:"rewind",value:function(){return this.seek(0)}},{key:"eof",value:function(){return this.tell()===this.buffer().length}},{key:"write",value:function(t,n,i){return this.seek("+",this.buffer().write(t,this.tell(),n,i))}},{key:"fill",value:function(t,n){return arguments.length===1&&(n=this.buffer().length-this.tell()),this.buffer().fill(t,this.tell(),this.tell()+n),this.seek("+",n),this}},{key:"slice",value:function(t){arguments.length===0&&(t=this.length-this.tell());var n=new this.constructor(this.buffer().slice(this.tell(),this.tell()+t));return this.seek("+",t),n}},{key:"copyFrom",value:function(t){var n=t instanceof h?t:t.buffer();return n.copy(this.buffer(),this.tell(),0,n.length),this.seek("+",n.length),this}},{key:"concat",value:function(t){t.forEach(function(i,a){i instanceof r&&(t[a]=i.buffer())}),t.unshift(this.buffer());var n=h.concat(t);return this._setBuffer(n),this}},{key:"toString",value:function(t,n){arguments.length===0?(t="utf8",n=this.buffer().length-this.tell()):arguments.length===1&&(n=this.buffer().length-this.tell());var i=this.buffer().toString(t,this.tell(),this.tell()+n);return this.seek("+",n),i}},{key:"writeBufferPadded",value:function(t){var n=(0,D$.calculatePadding)(t.length),i=h.alloc(n);return this.copyFrom(new r(t)).copyFrom(new r(i))}}]),r}();[[1,["readInt8","readUInt8"]],[2,["readInt16BE","readInt16LE","readUInt16BE","readUInt16LE"]],[4,["readInt32BE","readInt32LE","readUInt32BE","readUInt32LE","readFloatBE","readFloatLE"]],[8,["readDoubleBE","readDoubleLE"]]].forEach(function(r){r[1].forEach(function(e){Fi.prototype[e]=function(){var n=this.buffer()[e](this.tell());return this.seek("+",r[0]),n}})}),[[1,["writeInt8","writeUInt8"]],[2,["writeInt16BE","writeInt16LE","writeUInt16BE","writeUInt16LE"]],[4,["writeInt32BE","writeInt32LE","writeUInt32BE","writeUInt32LE","writeFloatBE","writeFloatLE"]],[8,["writeDoubleBE","writeDoubleLE"]]].forEach(function(r){r[1].forEach(function(e){Fi.prototype[e]=function(n){return this.buffer()[e](n,this.tell()),this.seek("+",r[0]),this}})}),Ft.Cursor=Fi,Object.defineProperty(M,"__esModule",{value:!0}),M.default=j$;var N$=av,es=ts(N$),B$=hi,q$=ts(B$),rs=Ft;function ts(r){return r&&r.__esModule?r:{default:r}}var U$=Math.pow(2,16),k$={toXDR:function(e){var t=new rs.Cursor(U$);this.write(e,t);var n=t.tell();return t.rewind(),t.slice(n).buffer()},fromXDR:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw",n=void 0;switch(t){case"raw":n=e;break;case"hex":n=h.from(e,"hex");break;case"base64":n=h.from(e,"base64");break;default:throw new Error("Invalid format "+t+', must be "raw", "hex", "base64"')}var i=new rs.Cursor(n),a=this.read(i);return a},validateXDR:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";try{return this.fromXDR(e,t),!0}catch{return!1}}},L$={toXDR:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"raw",t=this.constructor.toXDR(this);switch(e){case"raw":return t;case"hex":return t.toString("hex");case"base64":return t.toString("base64");default:throw new Error("Invalid format "+e+', must be "raw", "hex", "base64"')}}};function j$(r){(0,es.default)(r,k$),(0,q$.default)(r)&&(0,es.default)(r.prototype,L$)}Object.defineProperty(ce,"__esModule",{value:!0}),ce.Int=void 0;var V$=It,ns=is(V$),G$=M,H$=is(G$);function is(r){return r&&r.__esModule?r:{default:r}}var Rr=ce.Int={read:function(e){return e.readInt32BE()},write:function(e,t){if(!(0,ns.default)(e))throw new Error("XDR Write Error: not a number");if(Math.floor(e)!==e)throw new Error("XDR Write Error: not an integer");t.writeInt32BE(e)},isValid:function(e){return!(0,ns.default)(e)||Math.floor(e)!==e?!1:e>=Rr.MIN_VALUE&&e<=Rr.MAX_VALUE}};Rr.MAX_VALUE=Math.pow(2,31)-1,Rr.MIN_VALUE=-Math.pow(2,31),(0,H$.default)(Rr);var jt={};function W$(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var as={exports:{}};(function(r){/**
21
21
  * @license Long.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
22
22
  * Released under the Apache License, Version 2.0
23
23
  * see: https://github.com/dcodeIO/Long.js for details
24
- */(function(e,t){typeof i1=="function"&&r&&r.exports?r.exports=t():(e.dcodeIO=e.dcodeIO||{}).Long=t()})(U,function(){function e(l,u,d){this.low=l|0,this.high=u|0,this.unsigned=!!d}e.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=function(u){return(u&&u.__isLong__)===!0};var t={},n={};e.fromInt=function(u,d){var y,b;return d?(u=u>>>0,0<=u&&u<256&&(b=n[u],b)?b:(y=new e(u,(u|0)<0?-1:0,!0),0<=u&&u<256&&(n[u]=y),y)):(u=u|0,-128<=u&&u<128&&(b=t[u],b)?b:(y=new e(u,u<0?-1:0,!1),-128<=u&&u<128&&(t[u]=y),y))},e.fromNumber=function(u,d){return d=!!d,isNaN(u)||!isFinite(u)?e.ZERO:!d&&u<=-f?e.MIN_VALUE:!d&&u+1>=f?e.MAX_VALUE:d&&u>=s?e.MAX_UNSIGNED_VALUE:u<0?e.fromNumber(-u,d).negate():new e(u%o|0,u/o|0,d)},e.fromBits=function(u,d,y){return new e(u,d,y)},e.fromString=function(u,d,y){if(u.length===0)throw Error("number format error: empty string");if(u==="NaN"||u==="Infinity"||u==="+Infinity"||u==="-Infinity")return e.ZERO;if(typeof d=="number"&&(y=d,d=!1),y=y||10,y<2||36<y)throw Error("radix out of range: "+y);var b;if((b=u.indexOf("-"))>0)throw Error('number format error: interior "-" character: '+u);if(b===0)return e.fromString(u.substring(1),d,y).negate();for(var S=e.fromNumber(Math.pow(y,8)),O=e.ZERO,$=0;$<u.length;$+=8){var E=Math.min(8,u.length-$),p=parseInt(u.substring($,$+E),y);if(E<8){var I=e.fromNumber(Math.pow(y,E));O=O.multiply(I).add(e.fromNumber(p))}else O=O.multiply(S),O=O.add(e.fromNumber(p))}return O.unsigned=d,O},e.fromValue=function(u){return u instanceof e?u:typeof u=="number"?e.fromNumber(u):typeof u=="string"?e.fromString(u):new e(u.low,u.high,u.unsigned)};var i=65536,a=1<<24,o=i*i,s=o*o,f=s/2,c=e.fromInt(a);return e.ZERO=e.fromInt(0),e.UZERO=e.fromInt(0,!0),e.ONE=e.fromInt(1),e.UONE=e.fromInt(1,!0),e.NEG_ONE=e.fromInt(-1),e.MAX_VALUE=e.fromBits(-1,2147483647,!1),e.MAX_UNSIGNED_VALUE=e.fromBits(-1,-1,!0),e.MIN_VALUE=e.fromBits(0,-2147483648,!1),e.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},e.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*o+(this.low>>>0):this.high*o+(this.low>>>0)},e.prototype.toString=function(u){if(u=u||10,u<2||36<u)throw RangeError("radix out of range: "+u);if(this.isZero())return"0";var d;if(this.isNegative())if(this.equals(e.MIN_VALUE)){var y=e.fromNumber(u),b=this.divide(y);return d=b.multiply(y).subtract(this),b.toString(u)+d.toInt().toString(u)}else return"-"+this.negate().toString(u);var S=e.fromNumber(Math.pow(u,6),this.unsigned);d=this;for(var O="";;){var $=d.divide(S),E=d.subtract($.multiply(S)).toInt()>>>0,p=E.toString(u);if(d=$,d.isZero())return p+O;for(;p.length<6;)p="0"+p;O=""+p+O}},e.prototype.getHighBits=function(){return this.high},e.prototype.getHighBitsUnsigned=function(){return this.high>>>0},e.prototype.getLowBits=function(){return this.low},e.prototype.getLowBitsUnsigned=function(){return this.low>>>0},e.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.equals(e.MIN_VALUE)?64:this.negate().getNumBitsAbs();for(var u=this.high!=0?this.high:this.low,d=31;d>0&&!(u&1<<d);d--);return this.high!=0?d+33:d+1},e.prototype.isZero=function(){return this.high===0&&this.low===0},e.prototype.isNegative=function(){return!this.unsigned&&this.high<0},e.prototype.isPositive=function(){return this.unsigned||this.high>=0},e.prototype.isOdd=function(){return(this.low&1)===1},e.prototype.isEven=function(){return(this.low&1)===0},e.prototype.equals=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.unsigned!==u.unsigned&&this.high>>>31===1&&u.high>>>31===1?!1:this.high===u.high&&this.low===u.low},e.eq=e.prototype.equals,e.prototype.notEquals=function(u){return!this.equals(u)},e.neq=e.prototype.notEquals,e.prototype.lessThan=function(u){return this.compare(u)<0},e.prototype.lt=e.prototype.lessThan,e.prototype.lessThanOrEqual=function(u){return this.compare(u)<=0},e.prototype.lte=e.prototype.lessThanOrEqual,e.prototype.greaterThan=function(u){return this.compare(u)>0},e.prototype.gt=e.prototype.greaterThan,e.prototype.greaterThanOrEqual=function(u){return this.compare(u)>=0},e.prototype.gte=e.prototype.greaterThanOrEqual,e.prototype.compare=function(u){if(e.isLong(u)||(u=e.fromValue(u)),this.equals(u))return 0;var d=this.isNegative(),y=u.isNegative();return d&&!y?-1:!d&&y?1:this.unsigned?u.high>>>0>this.high>>>0||u.high===this.high&&u.low>>>0>this.low>>>0?-1:1:this.subtract(u).isNegative()?-1:1},e.prototype.negate=function(){return!this.unsigned&&this.equals(e.MIN_VALUE)?e.MIN_VALUE:this.not().add(e.ONE)},e.prototype.neg=e.prototype.negate,e.prototype.add=function(u){e.isLong(u)||(u=e.fromValue(u));var d=this.high>>>16,y=this.high&65535,b=this.low>>>16,S=this.low&65535,O=u.high>>>16,$=u.high&65535,E=u.low>>>16,p=u.low&65535,I=0,T=0,F=0,m=0;return m+=S+p,F+=m>>>16,m&=65535,F+=b+E,T+=F>>>16,F&=65535,T+=y+$,I+=T>>>16,T&=65535,I+=d+O,I&=65535,e.fromBits(F<<16|m,I<<16|T,this.unsigned)},e.prototype.subtract=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.add(u.negate())},e.prototype.sub=e.prototype.subtract,e.prototype.multiply=function(u){if(this.isZero()||(e.isLong(u)||(u=e.fromValue(u)),u.isZero()))return e.ZERO;if(this.equals(e.MIN_VALUE))return u.isOdd()?e.MIN_VALUE:e.ZERO;if(u.equals(e.MIN_VALUE))return this.isOdd()?e.MIN_VALUE:e.ZERO;if(this.isNegative())return u.isNegative()?this.negate().multiply(u.negate()):this.negate().multiply(u).negate();if(u.isNegative())return this.multiply(u.negate()).negate();if(this.lessThan(c)&&u.lessThan(c))return e.fromNumber(this.toNumber()*u.toNumber(),this.unsigned);var d=this.high>>>16,y=this.high&65535,b=this.low>>>16,S=this.low&65535,O=u.high>>>16,$=u.high&65535,E=u.low>>>16,p=u.low&65535,I=0,T=0,F=0,m=0;return m+=S*p,F+=m>>>16,m&=65535,F+=b*p,T+=F>>>16,F&=65535,F+=S*E,T+=F>>>16,F&=65535,T+=y*p,I+=T>>>16,T&=65535,T+=b*E,I+=T>>>16,T&=65535,T+=S*$,I+=T>>>16,T&=65535,I+=d*p+y*E+b*$+S*O,I&=65535,e.fromBits(F<<16|m,I<<16|T,this.unsigned)},e.prototype.mul=e.prototype.multiply,e.prototype.divide=function(u){if(e.isLong(u)||(u=e.fromValue(u)),u.isZero())throw new Error("division by zero");if(this.isZero())return this.unsigned?e.UZERO:e.ZERO;var d,y,b;if(this.equals(e.MIN_VALUE)){if(u.equals(e.ONE)||u.equals(e.NEG_ONE))return e.MIN_VALUE;if(u.equals(e.MIN_VALUE))return e.ONE;var S=this.shiftRight(1);return d=S.divide(u).shiftLeft(1),d.equals(e.ZERO)?u.isNegative()?e.ONE:e.NEG_ONE:(y=this.subtract(u.multiply(d)),b=d.add(y.divide(u)),b)}else if(u.equals(e.MIN_VALUE))return this.unsigned?e.UZERO:e.ZERO;if(this.isNegative())return u.isNegative()?this.negate().divide(u.negate()):this.negate().divide(u).negate();if(u.isNegative())return this.divide(u.negate()).negate();for(b=e.ZERO,y=this;y.greaterThanOrEqual(u);){d=Math.max(1,Math.floor(y.toNumber()/u.toNumber()));for(var O=Math.ceil(Math.log(d)/Math.LN2),$=O<=48?1:Math.pow(2,O-48),E=e.fromNumber(d),p=E.multiply(u);p.isNegative()||p.greaterThan(y);)d-=$,E=e.fromNumber(d,this.unsigned),p=E.multiply(u);E.isZero()&&(E=e.ONE),b=b.add(E),y=y.subtract(p)}return b},e.prototype.div=e.prototype.divide,e.prototype.modulo=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.subtract(this.divide(u).multiply(u))},e.prototype.mod=e.prototype.modulo,e.prototype.not=function(){return e.fromBits(~this.low,~this.high,this.unsigned)},e.prototype.and=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low&u.low,this.high&u.high,this.unsigned)},e.prototype.or=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low|u.low,this.high|u.high,this.unsigned)},e.prototype.xor=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low^u.low,this.high^u.high,this.unsigned)},e.prototype.shiftLeft=function(u){return e.isLong(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?e.fromBits(this.low<<u,this.high<<u|this.low>>>32-u,this.unsigned):e.fromBits(0,this.low<<u-32,this.unsigned)},e.prototype.shl=e.prototype.shiftLeft,e.prototype.shiftRight=function(u){return e.isLong(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?e.fromBits(this.low>>>u|this.high<<32-u,this.high>>u,this.unsigned):e.fromBits(this.high>>u-32,this.high>=0?0:-1,this.unsigned)},e.prototype.shr=e.prototype.shiftRight,e.prototype.shiftRightUnsigned=function(u){if(e.isLong(u)&&(u=u.toInt()),u&=63,u===0)return this;var d=this.high;if(u<32){var y=this.low;return e.fromBits(y>>>u|d<<32-u,d>>>u,this.unsigned)}else return u===32?e.fromBits(d,0,this.unsigned):e.fromBits(d>>>u-32,0,this.unsigned)},e.prototype.shru=e.prototype.shiftRightUnsigned,e.prototype.toSigned=function(){return this.unsigned?new e(this.low,this.high,!1):this},e.prototype.toUnsigned=function(){return this.unsigned?this:new e(this.low,this.high,!0)},e})})(gs);var _s=gs.exports;Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.Hyper=void 0;var a1=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),vs=function r(e,t,n){e===null&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,t);if(i===void 0){var a=Object.getPrototypeOf(e);return a===null?void 0:r(a,t,n)}else{if("value"in i)return i.value;var o=i.get;return o===void 0?void 0:o.call(n)}},o1=_s,xr=ms(o1),s1=D,u1=ms(s1);function ms(r){return r&&r.__esModule?r:{default:r}}function f1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function c1(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function l1(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var Pr=Rt.Hyper=function(r){l1(e,r),a1(e,null,[{key:"read",value:function(n){var i=n.readInt32BE(),a=n.readInt32BE();return this.fromBits(a,i)}},{key:"write",value:function(n,i){if(!(n instanceof this))throw new Error("XDR Write Error: "+n+" is not a Hyper");i.writeInt32BE(n.high),i.writeInt32BE(n.low)}},{key:"fromString",value:function(n){if(!/^-?\d+$/.test(n))throw new Error("Invalid hyper string: "+n);var i=vs(e.__proto__||Object.getPrototypeOf(e),"fromString",this).call(this,n,!1);return new this(i.low,i.high)}},{key:"fromBits",value:function(n,i){var a=vs(e.__proto__||Object.getPrototypeOf(e),"fromBits",this).call(this,n,i,!1);return new this(a.low,a.high)}},{key:"isValid",value:function(n){return n instanceof this}}]);function e(t,n){return f1(this,e),c1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!1))}return e}(xr.default);(0,u1.default)(Pr),Pr.MAX_VALUE=new Pr(xr.default.MAX_VALUE.low,xr.default.MAX_VALUE.high),Pr.MIN_VALUE=new Pr(xr.default.MIN_VALUE.low,xr.default.MIN_VALUE.high);var Ne={};Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.UnsignedInt=void 0;var d1=gt,ws=bs(d1),p1=D,h1=bs(p1);function bs(r){return r&&r.__esModule?r:{default:r}}var Tr=Ne.UnsignedInt={read:function(e){return e.readUInt32BE()},write:function(e,t){if(!(0,ws.default)(e))throw new Error("XDR Write Error: not a number");if(Math.floor(e)!==e)throw new Error("XDR Write Error: not an integer");if(e<0)throw new Error("XDR Write Error: negative number "+e);t.writeUInt32BE(e)},isValid:function(e){return!(0,ws.default)(e)||Math.floor(e)!==e?!1:e>=Tr.MIN_VALUE&&e<=Tr.MAX_VALUE}};Tr.MAX_VALUE=Math.pow(2,32)-1,Tr.MIN_VALUE=0,(0,h1.default)(Tr);var Ft={};Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.UnsignedHyper=void 0;var y1=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),$s=function r(e,t,n){e===null&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,t);if(i===void 0){var a=Object.getPrototypeOf(e);return a===null?void 0:r(a,t,n)}else{if("value"in i)return i.value;var o=i.get;return o===void 0?void 0:o.call(n)}},g1=_s,Rr=Es(g1),_1=D,v1=Es(_1);function Es(r){return r&&r.__esModule?r:{default:r}}function m1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function w1(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function b1(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var Fr=Ft.UnsignedHyper=function(r){b1(e,r),y1(e,null,[{key:"read",value:function(n){var i=n.readInt32BE(),a=n.readInt32BE();return this.fromBits(a,i)}},{key:"write",value:function(n,i){if(!(n instanceof this))throw new Error("XDR Write Error: "+n+" is not an UnsignedHyper");i.writeInt32BE(n.high),i.writeInt32BE(n.low)}},{key:"fromString",value:function(n){if(!/^\d+$/.test(n))throw new Error("Invalid hyper string: "+n);var i=$s(e.__proto__||Object.getPrototypeOf(e),"fromString",this).call(this,n,!0);return new this(i.low,i.high)}},{key:"fromBits",value:function(n,i){var a=$s(e.__proto__||Object.getPrototypeOf(e),"fromBits",this).call(this,n,i,!0);return new this(a.low,a.high)}},{key:"isValid",value:function(n){return n instanceof this}}]);function e(t,n){return m1(this,e),w1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!0))}return e}(Rr.default);(0,v1.default)(Fr),Fr.MAX_VALUE=new Fr(Rr.default.MAX_UNSIGNED_VALUE.low,Rr.default.MAX_UNSIGNED_VALUE.high),Fr.MIN_VALUE=new Fr(Rr.default.MIN_VALUE.low,Rr.default.MIN_VALUE.high);var Mt={};Object.defineProperty(Mt,"__esModule",{value:!0}),Mt.Float=void 0;var $1=gt,Ss=As($1),E1=D,S1=As(E1);function As(r){return r&&r.__esModule?r:{default:r}}var A1=Mt.Float={read:function(e){return e.readFloatBE()},write:function(e,t){if(!(0,Ss.default)(e))throw new Error("XDR Write Error: not a number");t.writeFloatBE(e)},isValid:function(e){return(0,Ss.default)(e)}};(0,S1.default)(A1);var Dt={};Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.Double=void 0;var O1=gt,Os=Is(O1),I1=D,x1=Is(I1);function Is(r){return r&&r.__esModule?r:{default:r}}var P1=Dt.Double={read:function(e){return e.readDoubleBE()},write:function(e,t){if(!(0,Os.default)(e))throw new Error("XDR Write Error: not a number");t.writeDoubleBE(e)},isValid:function(e){return(0,Os.default)(e)}};(0,x1.default)(P1);var Ct={};Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.Quadruple=void 0;var T1=D,R1=F1(T1);function F1(r){return r&&r.__esModule?r:{default:r}}var M1=Ct.Quadruple={read:function(){throw new Error("XDR Read Error: quadruple not supported")},write:function(){throw new Error("XDR Write Error: quadruple not supported")},isValid:function(){return!1}};(0,R1.default)(M1);var Mr={},D1=ge,C1=_e,N1="[object Boolean]";function B1(r){return r===!0||r===!1||C1(r)&&D1(r)==N1}var U1=B1;Object.defineProperty(Mr,"__esModule",{value:!0}),Mr.Bool=void 0;var q1=U1,k1=Ps(q1),xs=ue,L1=D,j1=Ps(L1);function Ps(r){return r&&r.__esModule?r:{default:r}}var V1=Mr.Bool={read:function(e){var t=xs.Int.read(e);switch(t){case 0:return!1;case 1:return!0;default:throw new Error("XDR Read Error: Got "+t+" when trying to read a bool")}},write:function(e,t){var n=e?1:0;return xs.Int.write(n,t)},isValid:function(e){return(0,k1.default)(e)}};(0,j1.default)(V1);var Nt={},G1=ge,H1=G,W1=_e,z1="[object String]";function X1(r){return typeof r=="string"||!H1(r)&&W1(r)&&G1(r)==z1}var Ts=X1;Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.String=void 0;var Y1=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),K1=Ts,Rs=di(K1),Z1=G,J1=di(Z1),Fs=ue,Q1=Ne,Ms=De,e$=D,r$=di(e$);function di(r){return r&&r.__esModule?r:{default:r}}function t$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var n$=Nt.String=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Q1.UnsignedInt.MAX_VALUE;t$(this,r),this._maxLength=e}return Y1(r,[{key:"read",value:function(t){var n=Fs.Int.read(t);if(n>this._maxLength)throw new Error("XDR Read Error: Saw "+n+" length String,"+("max allowed is "+this._maxLength));var i=(0,Ms.calculatePadding)(n),a=t.slice(n);return(0,Ms.slicePadding)(t,i),a.buffer()}},{key:"readString",value:function(t){return this.read(t).toString("utf8")}},{key:"write",value:function(t,n){if(t.length>this._maxLength)throw new Error("XDR Write Error: Got "+t.length+" bytes,"+("max allows is "+this._maxLength));var i=void 0;(0,Rs.default)(t)?i=h.from(t,"utf8"):i=h.from(t),Fs.Int.write(i.length,n),n.writeBufferPadded(i)}},{key:"isValid",value:function(t){var n=void 0;if((0,Rs.default)(t))n=h.from(t,"utf8");else if((0,J1.default)(t)||h.isBuffer(t))n=h.from(t);else return!1;return n.length<=this._maxLength}}]),r}();(0,r$.default)(n$.prototype);var Bt={};Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Opaque=void 0;var i$=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Ds=De,a$=D,o$=s$(a$);function s$(r){return r&&r.__esModule?r:{default:r}}function u$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var f$=Bt.Opaque=function(){function r(e){u$(this,r),this._length=e,this._padding=(0,Ds.calculatePadding)(e)}return i$(r,[{key:"read",value:function(t){var n=t.slice(this._length);return(0,Ds.slicePadding)(t,this._padding),n.buffer()}},{key:"write",value:function(t,n){if(t.length!==this._length)throw new Error("XDR Write Error: Got "+t.length+" bytes, expected "+this._length);n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return h.isBuffer(t)&&t.length===this._length}}]),r}();(0,o$.default)(f$.prototype);var Ut={};Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.VarOpaque=void 0;var c$=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Cs=ue,l$=Ne,Ns=De,d$=D,p$=h$(d$);function h$(r){return r&&r.__esModule?r:{default:r}}function y$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var g$=Ut.VarOpaque=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:l$.UnsignedInt.MAX_VALUE;y$(this,r),this._maxLength=e}return c$(r,[{key:"read",value:function(t){var n=Cs.Int.read(t);if(n>this._maxLength)throw new Error("XDR Read Error: Saw "+n+" length VarOpaque,"+("max allowed is "+this._maxLength));var i=(0,Ns.calculatePadding)(n),a=t.slice(n);return(0,Ns.slicePadding)(t,i),a.buffer()}},{key:"write",value:function(t,n){if(t.length>this._maxLength)throw new Error("XDR Write Error: Got "+t.length+" bytes,"+("max allows is "+this._maxLength));Cs.Int.write(t.length,n),n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return h.isBuffer(t)&&t.length<=this._maxLength}}]),r}();(0,p$.default)(g$.prototype);var qt={};function _$(r,e){for(var t=-1,n=r==null?0:r.length;++t<n&&e(r[t],t,r)!==!1;);return r}var v$=_$,m$=vt;function w$(r){return typeof r=="function"?r:m$}var Bs=w$,b$=v$,$$=Zn,E$=Bs,S$=G;function A$(r,e){var t=S$(r)?b$:$$;return t(r,E$(e))}var O$=A$,ir=O$,I$=/\s/;function x$(r){for(var e=r.length;e--&&I$.test(r.charAt(e)););return e}var P$=x$,T$=P$,R$=/^\s+/;function F$(r){return r&&r.slice(0,T$(r)+1).replace(R$,"")}var M$=F$,D$=M$,Us=Je,C$=Pt,qs=0/0,N$=/^[-+]0x[0-9a-f]+$/i,B$=/^0b[01]+$/i,U$=/^0o[0-7]+$/i,q$=parseInt;function k$(r){if(typeof r=="number")return r;if(C$(r))return qs;if(Us(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=Us(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=D$(r);var t=B$.test(r);return t||U$.test(r)?q$(r.slice(2),t?2:8):N$.test(r)?qs:+r}var L$=k$,j$=L$,ks=1/0,V$=17976931348623157e292;function G$(r){if(!r)return r===0?r:0;if(r=j$(r),r===ks||r===-ks){var e=r<0?-1:1;return e*V$}return r===r?r:0}var H$=G$,W$=H$;function z$(r){var e=W$(r),t=e%1;return e===e?t?e-t:e:0}var X$=z$,Y$=bo,K$=Bs,Z$=X$,J$=9007199254740991,pi=4294967295,Q$=Math.min;function eE(r,e){if(r=Z$(r),r<1||r>J$)return[];var t=pi,n=Q$(r,pi);e=K$(e),r-=pi;for(var i=Y$(n,e);++t<r;)e(t);return i}var Ls=eE;Object.defineProperty(qt,"__esModule",{value:!0}),qt.Array=void 0;var rE=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),tE=ci,nE=Dr(tE),iE=ir,aE=Dr(iE),oE=Ls,sE=Dr(oE),uE=G,js=Dr(uE),fE=D,cE=Dr(fE);function Dr(r){return r&&r.__esModule?r:{default:r}}function lE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var dE=qt.Array=function(){function r(e,t){lE(this,r),this._childType=e,this._length=t}return rE(r,[{key:"read",value:function(t){var n=this;return(0,sE.default)(this._length,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,js.default)(t))throw new Error("XDR Write Error: value is not array");if(t.length!==this._length)throw new Error("XDR Write Error: Got array of size "+t.length+","+("expected "+this._length));(0,aE.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,js.default)(t)||t.length!==this._length?!1:(0,nE.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,cE.default)(dE.prototype);var kt={};Object.defineProperty(kt,"__esModule",{value:!0}),kt.VarArray=void 0;var pE=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),hE=ci,yE=Cr(hE),gE=ir,_E=Cr(gE),vE=Ls,mE=Cr(vE),wE=G,Vs=Cr(wE),bE=Ne,Gs=ue,$E=D,EE=Cr($E);function Cr(r){return r&&r.__esModule?r:{default:r}}function SE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var AE=kt.VarArray=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:bE.UnsignedInt.MAX_VALUE;SE(this,r),this._childType=e,this._maxLength=t}return pE(r,[{key:"read",value:function(t){var n=this,i=Gs.Int.read(t);if(i>this._maxLength)throw new Error("XDR Read Error: Saw "+i+" length VarArray,"+("max allowed is "+this._maxLength));return(0,mE.default)(i,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,Vs.default)(t))throw new Error("XDR Write Error: value is not array");if(t.length>this._maxLength)throw new Error("XDR Write Error: Got array of size "+t.length+","+("max allowed is "+this._maxLength));Gs.Int.write(t.length,n),(0,_E.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,Vs.default)(t)||t.length>this._maxLength?!1:(0,yE.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,EE.default)(AE.prototype);var Lt={};function OE(r){return r===null}var IE=OE;function xE(r){return r===void 0}var Nr=xE;Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.Option=void 0;var PE=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),TE=IE,Hs=hi(TE),RE=Nr,Ws=hi(RE),zs=Mr,FE=D,ME=hi(FE);function hi(r){return r&&r.__esModule?r:{default:r}}function DE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var CE=Lt.Option=function(){function r(e){DE(this,r),this._childType=e}return PE(r,[{key:"read",value:function(t){if(zs.Bool.read(t))return this._childType.read(t)}},{key:"write",value:function(t,n){var i=!((0,Hs.default)(t)||(0,Ws.default)(t));zs.Bool.write(i,n),i&&this._childType.write(t,n)}},{key:"isValid",value:function(t){return(0,Hs.default)(t)||(0,Ws.default)(t)?!0:this._childType.isValid(t)}}]),r}();(0,ME.default)(CE.prototype);var Br={};Object.defineProperty(Br,"__esModule",{value:!0}),Br.Void=void 0;var NE=Nr,Xs=Ys(NE),BE=D,UE=Ys(BE);function Ys(r){return r&&r.__esModule?r:{default:r}}var qE=Br.Void={read:function(){},write:function(e){if(!(0,Xs.default)(e))throw new Error("XDR Write Error: trying to write value to a void slot")},isValid:function(e){return(0,Xs.default)(e)}};(0,UE.default)(qE);var jt={},kE=fi;function LE(r,e){return kE(e,function(t){return r[t]})}var jE=LE,VE=jE,GE=$t;function HE(r){return r==null?[]:VE(r,GE(r))}var WE=HE;Object.defineProperty(jt,"__esModule",{value:!0}),jt.Enum=void 0;var zE=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),XE=ir,YE=yi(XE),KE=WE,ZE=yi(KE),Ks=ue,JE=D,QE=yi(JE);function yi(r){return r&&r.__esModule?r:{default:r}}function eS(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function rS(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}function Zs(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var tS=jt.Enum=function(){function r(e,t){Zs(this,r),this.name=e,this.value=t}return zE(r,null,[{key:"read",value:function(t){var n=Ks.Int.read(t);if(!this._byValue.has(n))throw new Error("XDR Read Error: Unknown "+this.enumName+" member for value "+n);return this._byValue.get(n)}},{key:"write",value:function(t,n){if(!(t instanceof this))throw new Error("XDR Write Error: Unknown "+t+" is not a "+this.enumName);Ks.Int.write(t.value,n)}},{key:"isValid",value:function(t){return t instanceof this}},{key:"members",value:function(){return this._members}},{key:"values",value:function(){return(0,ZE.default)(this._members)}},{key:"fromName",value:function(t){var n=this._members[t];if(!n)throw new Error(t+" is not a member of "+this.enumName);return n}},{key:"fromValue",value:function(t){var n=this._byValue.get(t);if(!n)throw new Error(t+" is not a value of any member of "+this.enumName);return n}},{key:"create",value:function(t,n,i){var a=function(o){rS(s,o);function s(){return Zs(this,s),eS(this,(s.__proto__||Object.getPrototypeOf(s)).apply(this,arguments))}return s}(r);return a.enumName=n,t.results[n]=a,a._members={},a._byValue=new Map,(0,YE.default)(i,function(o,s){var f=new a(s,o);a._members[s]=f,a._byValue.set(o,f),a[s]=function(){return f}}),a}}]),r}();(0,QE.default)(tS);var Vt={},nS=Zn,iS=Or;function aS(r,e){var t=-1,n=iS(r)?Array(r.length):[];return nS(r,function(i,a,o){n[++t]=e(i,a,o)}),n}var oS=aS,sS=fi,uS=cs,fS=oS,cS=G;function lS(r,e){var t=cS(r)?sS:fS;return t(r,uS(e))}var dS=lS;function pS(r){for(var e=-1,t=r==null?0:r.length,n={};++e<t;){var i=r[e];n[i[0]]=i[1]}return n}var hS=pS,Ur={};Object.defineProperty(Ur,"__esModule",{value:!0});var yS=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();function gS(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}Ur.Reference=function(){function r(){gS(this,r)}return yS(r,[{key:"resolve",value:function(){throw new Error("implement resolve in child class")}}]),r}(),Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.Struct=void 0;var Gt=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var s=e[Symbol.iterator](),f;!(i=(f=s.next()).done)&&(n.push(f.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&s.return&&s.return()}finally{if(a)throw o}}return n}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return r(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_S=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),vS=ir,Js=qr(vS),mS=dS,wS=qr(mS),bS=Nr,$S=qr(bS),ES=hS,SS=qr(ES),AS=Ur,OS=D,IS=qr(OS);function qr(r){return r&&r.__esModule?r:{default:r}}function xS(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function PS(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}function Qs(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var TS=Vt.Struct=function(){function r(e){Qs(this,r),this._attributes=e||{}}return _S(r,null,[{key:"read",value:function(t){var n=(0,wS.default)(this._fields,function(i){var a=Gt(i,2),o=a[0],s=a[1],f=s.read(t);return[o,f]});return new this((0,SS.default)(n))}},{key:"write",value:function(t,n){if(!(t instanceof this))throw new Error("XDR Write Error: "+t+" is not a "+this.structName);(0,Js.default)(this._fields,function(i){var a=Gt(i,2),o=a[0],s=a[1],f=t._attributes[o];s.write(f,n)})}},{key:"isValid",value:function(t){return t instanceof this}},{key:"create",value:function(t,n,i){var a=function(o){PS(s,o);function s(){return Qs(this,s),xS(this,(s.__proto__||Object.getPrototypeOf(s)).apply(this,arguments))}return s}(r);return a.structName=n,t.results[n]=a,a._fields=i.map(function(o){var s=Gt(o,2),f=s[0],c=s[1];return c instanceof AS.Reference&&(c=c.resolve(t)),[f,c]}),(0,Js.default)(a._fields,function(o){var s=Gt(o,1),f=s[0];a.prototype[f]=RS(f)}),a}}]),r}();(0,IS.default)(TS);function RS(r){return function(t){return(0,$S.default)(t)||(this._attributes[r]=t),this._attributes[r]}}var Ht={};Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.Union=void 0;var FS=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var s=e[Symbol.iterator](),f;!(i=(f=s.next()).done)&&(n.push(f.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&s.return&&s.return()}finally{if(a)throw o}}return n}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return r(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),MS=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),DS=ir,Wt=Xt(DS),CS=Nr,eu=Xt(CS),NS=Ts,ru=Xt(NS),zt=Br,gi=Ur,BS=D,US=Xt(BS);function Xt(r){return r&&r.__esModule?r:{default:r}}function qS(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function kS(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}function tu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var LS=Ht.Union=function(){function r(e,t){tu(this,r),this.set(e,t)}return MS(r,[{key:"set",value:function(t,n){(0,ru.default)(t)&&(t=this.constructor._switchOn.fromName(t)),this._switch=t,this._arm=this.constructor.armForSwitch(this._switch),this._armType=this.constructor.armTypeForArm(this._arm),this._value=n}},{key:"get",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this._arm;if(this._arm!==zt.Void&&this._arm!==t)throw new Error(t+" not set");return this._value}},{key:"switch",value:function(){return this._switch}},{key:"arm",value:function(){return this._arm}},{key:"armType",value:function(){return this._armType}},{key:"value",value:function(){return this._value}}],[{key:"armForSwitch",value:function(t){if(this._switches.has(t))return this._switches.get(t);if(this._defaultArm)return this._defaultArm;throw new Error("Bad union switch: "+t)}},{key:"armTypeForArm",value:function(t){return t===zt.Void?zt.Void:this._arms[t]}},{key:"read",value:function(t){var n=this._switchOn.read(t),i=this.armForSwitch(n),a=this.armTypeForArm(i),o=void 0;return(0,eu.default)(a)?o=i.read(t):o=a.read(t),new this(n,o)}},{key:"write",value:function(t,n){if(!(t instanceof this))throw new Error("XDR Write Error: "+t+" is not a "+this.unionName);this._switchOn.write(t.switch(),n),t.armType().write(t.value(),n)}},{key:"isValid",value:function(t){return t instanceof this}},{key:"create",value:function(t,n,i){var a=function(s){kS(f,s);function f(){return tu(this,f),qS(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(r);a.unionName=n,t.results[n]=a,i.switchOn instanceof gi.Reference?a._switchOn=i.switchOn.resolve(t):a._switchOn=i.switchOn,a._switches=new Map,a._arms={},(0,Wt.default)(i.arms,function(s,f){s instanceof gi.Reference&&(s=s.resolve(t)),a._arms[f]=s});var o=i.defaultArm;return o instanceof gi.Reference&&(o=o.resolve(t)),a._defaultArm=o,(0,Wt.default)(i.switches,function(s){var f=FS(s,2),c=f[0],l=f[1];(0,ru.default)(c)&&(c=a._switchOn.fromName(c)),a._switches.set(c,l)}),(0,eu.default)(a._switchOn.values)||(0,Wt.default)(a._switchOn.values(),function(s){a[s.name]=function(f){return new a(s,f)},a.prototype[s.name]=function(c){return this.set(s,c)}}),(0,Wt.default)(a._arms,function(s,f){s!==zt.Void&&(a.prototype[f]=function(){return this.get(f)})}),a}}]),r}();(0,US.default)(LS),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=ue;Object.keys(e).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return e[p]}})});var t=Rt;Object.keys(t).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return t[p]}})});var n=Ne;Object.keys(n).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return n[p]}})});var i=Ft;Object.keys(i).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return i[p]}})});var a=Mt;Object.keys(a).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return a[p]}})});var o=Dt;Object.keys(o).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return o[p]}})});var s=Ct;Object.keys(s).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return s[p]}})});var f=Mr;Object.keys(f).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return f[p]}})});var c=Nt;Object.keys(c).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return c[p]}})});var l=Bt;Object.keys(l).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return l[p]}})});var u=Ut;Object.keys(u).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return u[p]}})});var d=qt;Object.keys(d).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return d[p]}})});var y=kt;Object.keys(y).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return y[p]}})});var b=Lt;Object.keys(b).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return b[p]}})});var S=Br;Object.keys(S).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return S[p]}})});var O=jt;Object.keys(O).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return O[p]}})});var $=Vt;Object.keys($).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return $[p]}})});var E=Ht;Object.keys(E).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return E[p]}})})}(Wn);var nu={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=function(){function m(g,_){for(var A=0;A<_.length;A++){var x=_[A];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(g,x.key,x)}}return function(g,_,A){return _&&m(g.prototype,_),A&&m(g,A),g}}(),t=Ur;Object.keys(t).forEach(function(m){m==="default"||m==="__esModule"||Object.defineProperty(r,m,{enumerable:!0,get:function(){return t[m]}})}),r.config=b;var n=Nr,i=l(n),a=ir,o=l(a),s=Wn,f=c(s);function c(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var _ in m)Object.prototype.hasOwnProperty.call(m,_)&&(g[_]=m[_]);return g.default=m,g}function l(m){return m&&m.__esModule?m:{default:m}}function u(m,g){if(!(m instanceof g))throw new TypeError("Cannot call a class as a function")}function d(m,g){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:m}function y(m,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);m.prototype=Object.create(g&&g.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(m,g):m.__proto__=g)}function b(m){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(m){var _=new F(g);m(_),_.resolve()}return g}var S=function(m){y(g,m);function g(_){u(this,g);var A=d(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return A.name=_,A}return e(g,[{key:"resolve",value:function(A){var x=A.definitions[this.name];return x.resolve(A)}}]),g}(t.Reference),O=function(m){y(g,m);function g(_,A){var x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;u(this,g);var M=d(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return M.childReference=_,M.length=A,M.variable=x,M}return e(g,[{key:"resolve",value:function(A){var x=this.childReference,M=this.length;return x instanceof t.Reference&&(x=x.resolve(A)),M instanceof t.Reference&&(M=M.resolve(A)),this.variable?new f.VarArray(x,M):new f.Array(x,M)}}]),g}(t.Reference),$=function(m){y(g,m);function g(_){u(this,g);var A=d(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return A.childReference=_,A.name=_.name,A}return e(g,[{key:"resolve",value:function(A){var x=this.childReference;return x instanceof t.Reference&&(x=x.resolve(A)),new f.Option(x)}}]),g}(t.Reference),E=function(m){y(g,m);function g(_,A){u(this,g);var x=d(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return x.sizedType=_,x.length=A,x}return e(g,[{key:"resolve",value:function(A){var x=this.length;return x instanceof t.Reference&&(x=x.resolve(A)),new this.sizedType(x)}}]),g}(t.Reference),p=function(){function m(g,_,A){u(this,m),this.constructor=g,this.name=_,this.config=A}return e(m,[{key:"resolve",value:function(_){return this.name in _.results?_.results[this.name]:this.constructor(_,this.name,this.config)}}]),m}();function I(m,g,_){return _ instanceof t.Reference&&(_=_.resolve(m)),m.results[g]=_,_}function T(m,g,_){return m.results[g]=_,_}var F=function(){function m(g){u(this,m),this._destination=g,this._definitions={}}return e(m,[{key:"enum",value:function(_,A){var x=new p(f.Enum.create,_,A);this.define(_,x)}},{key:"struct",value:function(_,A){var x=new p(f.Struct.create,_,A);this.define(_,x)}},{key:"union",value:function(_,A){var x=new p(f.Union.create,_,A);this.define(_,x)}},{key:"typedef",value:function(_,A){var x=new p(I,_,A);this.define(_,x)}},{key:"const",value:function(_,A){var x=new p(T,_,A);this.define(_,x)}},{key:"void",value:function(){return f.Void}},{key:"bool",value:function(){return f.Bool}},{key:"int",value:function(){return f.Int}},{key:"hyper",value:function(){return f.Hyper}},{key:"uint",value:function(){return f.UnsignedInt}},{key:"uhyper",value:function(){return f.UnsignedHyper}},{key:"float",value:function(){return f.Float}},{key:"double",value:function(){return f.Double}},{key:"quadruple",value:function(){return f.Quadruple}},{key:"string",value:function(_){return new E(f.String,_)}},{key:"opaque",value:function(_){return new E(f.Opaque,_)}},{key:"varOpaque",value:function(_){return new E(f.VarOpaque,_)}},{key:"array",value:function(_,A){return new O(_,A)}},{key:"varArray",value:function(_,A){return new O(_,A,!0)}},{key:"option",value:function(_){return new $(_)}},{key:"define",value:function(_,A){if((0,i.default)(this._destination[_]))this._definitions[_]=A;else throw new Error("XDRTypes Error:"+_+" is already defined")}},{key:"lookup",value:function(_){return new S(_)}},{key:"resolve",value:function(){var _=this;(0,o.default)(this._definitions,function(A){A.resolve({definitions:_._definitions,results:_._destination})})}}]),m}()})(nu),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Wn;Object.keys(e).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[n]}})});var t=nu;Object.keys(t).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return t[n]}})})}(oo);var _i=(r,e,t)=>{if(!e.has(r))throw TypeError("Cannot "+t)},j=(r,e,t)=>(_i(r,e,"read from private field"),t?t.call(r):e.get(r)),Be=(r,e,t)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,t)},vi=(r,e,t,n)=>(_i(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),ve=(r,e,t)=>(_i(r,e,"access private method"),t),ne,ie,kr,mi,iu,wi,au,Yt,bi,ar,Lr;function jS(r){const e={variantId:ce.Uint64.fromString(r.variantId.toString()),version:r.version||Math.floor(Date.now()/1e3),items:r.items.map(n=>new ce.BundleItem({collectionId:ce.Uint64.fromString(n.collectionId.toString()),productId:ce.Uint64.fromString(n.productId.toString()),variantId:ce.Uint64.fromString(n.variantId.toString()),sku:n.sku||"",quantity:n.quantity,ext:new ce.BundleItemExt(0)})),ext:new ce.BundleExt(0)},t=new ce.Bundle(e);return ce.BundleEnvelope.envelopeTypeBundle(t).toXDR("base64")}const ce=oo.config(r=>{r.enum("EnvelopeType",{envelopeTypeBundle:0}),r.typedef("Uint32",r.uint()),r.typedef("Uint64",r.uhyper()),r.union("BundleItemExt",{switchOn:r.int(),switchName:"v",switches:[[0,r.void()]],arms:{}}),r.struct("BundleItem",[["collectionId",r.lookup("Uint64")],["productId",r.lookup("Uint64")],["variantId",r.lookup("Uint64")],["sku",r.string()],["quantity",r.lookup("Uint32")],["ext",r.lookup("BundleItemExt")]]),r.union("BundleExt",{switchOn:r.int(),switchName:"v",switches:[[0,r.void()]],arms:{}}),r.struct("Bundle",[["variantId",r.lookup("Uint64")],["items",r.varArray(r.lookup("BundleItem"),500)],["version",r.lookup("Uint32")],["ext",r.lookup("BundleExt")]]),r.union("BundleEnvelope",{switchOn:r.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeBundle","v1"]],arms:{v1:r.lookup("Bundle")}})});class VS{constructor(e,t){Be(this,mi),Be(this,wi),Be(this,Yt),Be(this,ar),Be(this,ne,void 0),Be(this,ie,void 0),Be(this,kr,void 0),vi(this,ne,ve(this,mi,iu).call(this,t)),vi(this,kr,ve(this,wi,au).call(this,t)),vi(this,ie,e)}isInitialDataValid(){if(!j(this,kr))throw"Bundle data does not exist for the given product.";if(!j(this,ne))throw"Bundle settings do not exist for the given product.";if(!Array.isArray(j(this,ie))||!j(this,ie).length)throw"No bundle selection items provided.";return!0}isValidVariant(e){if(!j(this,ne)?.variantsSettings[e])throw`The ${e} bundle variant is invalid.`;return!0}isSelectionInVariantRange(e){const t=j(this,ie).reduce((i,a)=>i+a.quantity,0),n=j(this,ne)?.variantsSettings[e].ranges||[];if(!ve(this,Yt,bi).call(this,n,t))throw"The total number of products does not fall within the required variant range.";return!0}areItemsInMaxPerItemBound(){const e=j(this,ne)?.bundleSettings.maxPerItem||0,t=j(this,ie).filter(({quantity:n})=>n>e);if(e&&t.length)throw`The selected products (${ve(this,ar,Lr).call(this,t.map(({externalProductId:n})=>n)).join(", ")}) exceed the maximum limit of ${e} items per product.`;return!0}areSelectedCollectionsValid(e){const t=j(this,ne)?.variantsSettings[e],n=j(this,ie).filter(({collectionId:i})=>!t?.optionSources[i]);if(n.length)throw`The collections (${ve(this,ar,Lr).call(this,n.map(({collectionId:i})=>i)).join(", ")}) are no longer valid for the bundle variant (${e}).`;return!0}areItemsQuantitiesValidForTheCollection(e){const t=j(this,ie).reduce((a,o)=>(a[o.collectionId]=o.quantity+(a[o.collectionId]||0),a),{}),n=j(this,ne)?.variantsSettings[e],i=Object.values(n?.optionSources||{}).filter(a=>{const o=t[a.collectionId]||0;return!ve(this,Yt,bi).call(this,[a],o)});if(!n||i.length)throw`The selection exceeds the limits for the collections (${ve(this,ar,Lr).call(this,i.map(({collectionId:a})=>a)).join(", ")}).`;return!0}areSelectedProductsValid(e){const t=j(this,ne)?.variantsSettings[e]?.optionSources||{},n=Object.values(t).reduce((a,o)=>{const s=j(this,kr)?.collections[o.collectionId];return s&&(a[o.collectionId]=s),a},{});if(!Object.values(n).length)throw`No collections found for the bundle variant (${e}).`;const i=j(this,ie).filter(({externalProductId:a,collectionId:o})=>!n[o]?.products[a]);if(i.length)throw`The products (${ve(this,ar,Lr).call(this,i.map(({externalProductId:a})=>a)).join(", ")}) are no longer valid for the bundle product.`;return!0}isBundleSelectionValid(e){return this.isInitialDataValid(),this.isValidVariant(e),this.isSelectionInVariantRange(e),this.areItemsInMaxPerItemBound(),this.areSelectedCollectionsValid(e),this.areItemsQuantitiesValidForTheCollection(e),this.areSelectedProductsValid(e),!0}}ne=new WeakMap,ie=new WeakMap,kr=new WeakMap,mi=new WeakSet,iu=function(r){try{const e=r.bundle_settings;return{bundleSettings:{maxPerItem:e.max_quantity_per_variant,isCustomizable:e.is_customizable},variantsSettings:e.variants.reduce((t,n)=>{if(!n.enabled)return t;let i=[{min:n.items_count,max:n.items_count}];return n.items_count||(i=n.ranges.map(({quantity_max:a,quantity_min:o})=>({min:o,max:a}))),t[n.external_variant_id]={externalVariantId:n.external_variant_id,optionSources:n.option_sources.reduce((a,o)=>(a[o.option_source_id]={min:o.quantity_min,max:o.quantity_max,collectionId:o.option_source_id},a),{}),ranges:i},t},{})}}catch{return null}},wi=new WeakSet,au=function(r){try{const e=Object.values(r.collections).reduce((t,n)=>(t[n.id]={...n,products:n.products.reduce((i,a)=>(i[a.id]=a,i),{})},t),{});return{...r,collections:e}}catch{return null}},Yt=new WeakSet,bi=function(r,e){return!!r.filter(({min:t,max:n})=>{const i=t??e,a=n??e;return i<=e&&e<=a}).length},ar=new WeakSet,Lr=function(r){return Array.from(new Set(r))};const GS="/bundling-storefront-manager";function ou(r){return jS({variantId:r.externalVariantId,version:0,items:r.selections.map(e=>({collectionId:e.collectionId,productId:e.externalProductId,variantId:e.externalVariantId,quantity:e.quantity,sku:""}))})}async function HS(r){const e=V(),t=await $i(r);if(t!==!0)throw new Error(t);const n=ou(r);try{const i=await Fe("post",`${GS}/api/v1/bundles`,{data:{bundle:n},headers:{Origin:`https://${e.storeIdentifier}`}});if(!i.id||i.code!==200)throw new Error(`1: failed generating rb_id: ${JSON.stringify(i)}`);return i.id}catch(i){throw new Error(`2: failed generating rb_id ${i}`)}}async function WS(r,e){const t=await $i(e);if(t!==!0)throw new Error(t);const n=ou(e);try{const i=await w("post","/bundle_selections/bundle_id",{data:{bundle:n}},v(r,"getBundleSelectionId"));if(!i.id||i.code!==200)throw new Error(`1: failed generating rb_id: ${JSON.stringify(i)}`);return i.id}catch(i){throw new Error(`2: failed generating rb_id ${i}`)}}function zS(r,e){const t=su(r);if(t!==!0)throw new Error(`Dynamic Bundle is invalid. ${t}`);const n=`${Wi(9)}:${r.externalProductId}`;return r.selections.map(i=>{const a={id:i.externalVariantId,quantity:i.quantity,properties:{_rc_bundle:n,_rc_bundle_variant:r.externalVariantId,_rc_bundle_parent:e,_rc_bundle_collection_id:i.collectionId}};return i.sellingPlan?a.selling_plan=i.sellingPlan:i.shippingIntervalFrequency&&(a.properties.shipping_interval_frequency=i.shippingIntervalFrequency,a.properties.shipping_interval_unit_type=i.shippingIntervalUnitType,a.id=`${i.discountedVariantId}`),a})}async function $i(r){try{return r?r.selections.length===0?"No selections defined":!0:"Bundle is not defined"}catch(e){return`Error fetching bundle settings: ${e}`}}async function XS(r){try{const e=await Fe("get",`/bundle-data/${r.externalProductId}`);return{valid:new VS(r.selections,e).isBundleSelectionValid(r.externalVariantId)}}catch(e){return{valid:!1,error:String(e)}}}const YS={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 su(r){if(!r)return"No bundle defined.";if(r.selections.length===0)return"No selections defined.";const{shippingIntervalFrequency:e,shippingIntervalUnitType:t}=r.selections.find(n=>n.shippingIntervalFrequency||n.shippingIntervalUnitType)||{};if(e||t){if(!e||!t)return"Shipping intervals do not match on selections.";{const n=YS[t];for(let i=0;i<r.selections.length;i++){const{shippingIntervalFrequency:a,shippingIntervalUnitType:o}=r.selections[i];if(a&&a!==e||o&&!n.includes(o))return"Shipping intervals do not match on selections."}}}return!0}async function KS(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{bundle_selection:t}=await w("get","/bundle_selections",{id:e},v(r,"getBundleSelection"));return t}function ZS(r,e){return w("get","/bundle_selections",{query:e},v(r,"listBundleSelections"))}async function JS(r,e){const{bundle_selection:t}=await w("post","/bundle_selections",{data:e},v(r,"createBundleSelection"));return t}async function QS(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{bundle_selection:n}=await w("put","/bundle_selections",{id:e,data:t},v(r,"updateBundleSelection"));return n}function eA(r,e){if(e===void 0||e==="")throw new Error("ID is required");return w("delete","/bundle_selections",{id:e},v(r,"deleteBundleSelection"))}async function rA(r,e,t,n){if(e===void 0||e==="")throw new Error("Purchase item ID is required");const{subscription:i}=await w("put","/bundles",{id:e,data:t,query:n},v(r,"updateBundle"));return i}var tA=Object.freeze({__proto__:null,createBundleSelection:JS,deleteBundleSelection:eA,getBundleId:HS,getBundleSelection:KS,getBundleSelectionId:WS,getDynamicBundleItems:zS,listBundleSelections:ZS,updateBundle:rA,updateBundleSelection:QS,validateBundle:$i,validateBundleSelection:XS,validateDynamicBundle:su});const nA=r=>{const e=r.layout_settings.addons,t=r.layout_settings.crossSells,n=r.customization_window,i=r.default_bundle_variant_id,a=r.layout_settings.defaultFrequency,o=r.layout_settings.addToCartCallback;return{default_variant_id:i?String(i):null,is_customizable:r.is_customizable,price_rule:String(r.price_rule).toUpperCase(),customization_window:n?{active_days:n,disabled_message:r.customization_window_disabled_message||""}:null,addons:e.collectionId?{collection_id:e.collectionId,collection_handle:e.collectionHandle}:null,cross_sells:t.collectionId?{collection_id:e.collectionId,collection_handle:e.collectionHandle}:null,default_selling_plan_id:a||null,collapsible_collections:r.layout_settings.collapsibleSections,max_quantity_per_variant:r.max_quantity_per_variant,show_product_variants:r.layout_settings.showVariants,product_details_modal_enabled:r.layout_settings.learnMoreModal,addToCartBehavior:{type:o.type==="none"?"cart_page":o.type,value:o.value}}},iA=r=>r.tiered_discounts.length===0?null:{tiered_discounts:r.tiered_discounts.map(e=>({eligible_charge_types:e.eligible_charge_types,eligible_line_item_types:e.eligible_line_item_types,external_bundle_product_id:{ecommerce:e.external_bundle_product_id.ecommerce},lookup_key:e.lookup_key,name:e.name,status:e.status,tiers:e.tiers.map(({tier:t})=>({tier:{lookup_key:t.lookup_key,discount_type:t.discount_type,discount_value:t.discount_value,condition_quantity_gte:t.condition_quantity_gte}}))}))},Kt=r=>({id:r.id,name:r.name,options:r.options.map(e=>({name:e.name,value:e.value})),recurring_deliveries:r.recurring_deliveries,price_adjustments:r.price_adjustments.map(({value:e,value_type:t})=>({value:e,value_type:t}))}),uu=r=>({name:r.name,options:r.options.map(e=>({name:e.name,values:e.values})),selling_plans:r.selling_plans.map(Kt)}),fu=r=>({id:String(r.id),title:r.title,price:r.price,compare_at_price:r.compare_at_price,options:r.options,available_for_sale:r.available}),Ei=r=>r==null||typeof r=="string"?r:"src"in r?r.src:null,cu=r=>({id:String(r.id),title:r.title,description:r.description,available_for_sale:r.available,featured_image:Ei(r.featured_image),images:r.images,requires_selling_plan:r.requires_selling_plan,selling_plan_groups:r.selling_plan_groups.map(uu)}),lu=r=>{const e=oA(r.selling_plan_groups);return{...cu(r),handle:r.handle,tags:r.tags,price_range:{min:r.price_min,max:r.price_max},compare_at_price_range:{min:r.compare_at_price_min,max:r.compare_at_price_max},options:r.options,variants:r.variants.map(t=>({...fu(t),selling_plan_allocations:t.selling_plan_allocations.map(n=>({price:n.price,compare_at_price:n.compare_at_price,selling_plan:Kt(e[`${n.selling_plan_group_id}-${n.selling_plan_id}`])})),option1:t.option1,option2:t.option2,option3:t.option3,sku:t.sku||"",requires_shipping:t.requires_shipping,taxable:t.taxable,featured_image:Ei(t.featured_image),public_title:t.public_title,requires_selling_plan:t.requires_selling_plan}))}},aA=({items_count:r,ranges:e})=>e.length>0?e.map(({quantity_max:t,quantity_min:n})=>({min:n,max:t})):[{min:r,max:r}],oA=r=>r.reduce((e,t)=>(t.selling_plans.forEach(n=>{const i=`${t.id}-${n.id}`;e[i]=n}),e),{});function Si(r){const e=nA(r.bundle_settings),t=r.variants.reduce((n,i)=>(n[i.id]=i,n),{});return{id:String(r.id),title:r.title,handle:r.handle,options:r.options.map(n=>({name:n.name,position:n.position,values:n.values})),default_variant_id:e.default_variant_id,default_selling_plan_id:e.default_selling_plan_id?Number(e.default_selling_plan_id):null,available_for_sale:r.available,requires_selling_plan:r.requires_selling_plan,bundle_settings:{is_customizable:e.is_customizable,price_rule:e.price_rule,customization_window:e.customization_window,max_quantity_per_variant:e.max_quantity_per_variant,collapsible_collections:e.collapsible_collections,show_product_variants:e.show_product_variants,product_details_modal_enabled:e.product_details_modal_enabled,show_variants_as_individual_products:r.bundle_settings.settings.display_variants_as_separate_products_in_list,post_add_to_cart_behavior:e.addToCartBehavior},variants:r.bundle_settings.variants.filter(({enabled:n})=>n).map((n,i)=>{const a=t[String(n.external_variant_id)];return{id:String(n.external_variant_id),title:a.title,price:a.price,compare_at_price:a.compare_at_price,image:a.image||"",available_for_sale:a.available,options:a.options,requires_selling_plan:a.requires_selling_plan,selling_plan_allocations:a.selling_plan_allocations.map(o=>({price:o.price,compare_at_price:o.compare_at_price,selling_plan:Kt(o.selling_plan)})),ranges:aA(n),collections:n.option_sources.map(o=>({id:o.option_source_id,source_platform:"shopify",min:o.quantity_min||0,max:o.quantity_max,position:o.position})),default_selections:n.selection_defaults.map(o=>({quantity:o.quantity,product:{id:String(o.product.id),handle:o.handle,title:o.product.title,description:o.product.description,images:o.product.images},variant:{id:o.external_variant_id,title:o.variant.title,featured_image:Ei(o.variant.featured_image),sku:o.sku||""}})),position:i}}),selling_plan_groups:r.selling_plan_groups.map(uu),collections:Object.values(r.collections).reduce((n,i)=>(Array.isArray(i.products)&&(n[String(i.id)]={id:String(i.id),title:i.title,handle:i.handle,products:i.products.map(lu)}),n),{}),addons:r.addons.products.length?{collection_id:e.addons?.collection_id||"",collection_handle:e.addons?.collection_handle||"",products:r.addons.products.map(n=>({...cu(n),price_range:{min:n.price,max:n.price},compare_at_price_range:{min:n.compare_at_price||0,max:n.compare_at_price},variants:n.variants.map(i=>({...fu(i),image:i.image,selling_plan_allocations:i.selling_plan_allocations.map(a=>({price:a.price,compare_at_price:a.compare_at_price,selling_plan:Kt(a.selling_plan)}))}))}))}:null,cross_sells:r.cross_sells.products.length?{collection_id:e.cross_sells?.collection_id||"",collection_handle:e.cross_sells?.collection_handle||"",products:r.cross_sells.products.map(lu)}:null,incentives:iA(r.incentives)}}async function sA(r,e){return e?.source==="shopify_storefront"?fA():uA(r,e?.country_code)}async function uA(r,e){const{appName:t,appVersion:n}=V(),i={"X-Recharge-Sdk-Fn":"loadFromOnlineStore","X-Recharge-Sdk-Version":"1.68.0",...t?{"X-Recharge-Sdk-App-Name":t}:{},...n?{"X-Recharge-Sdk-App-Version":n}:{}};if(!e){const o=await Fe("get",`/bundle-data/${r}`,{headers:i});return Si(o)}const a=new FormData;a.append("form_type","localization"),a.append("_method","put"),a.append("return_to",`${io}/bundle-data/${r}`),a.append("country_code",e);try{const o=await X("post","/localization",{headers:{"Content-Type":"multipart/form-data",...i},data:a});return Si(o)}catch{const o=await Fe("get",`/bundle-data/${r}`,{headers:i});return Si(o)}}async function fA(r,e){if(!V().storeIdentifier)throw new Error("Store identifier is required for Shopify Storefront API requests");return{}}var cA=Object.freeze({__proto__:null,loadBundleData:sA}),lA=200,Ai="__lodash_hash_undefined__",dA=1/0,du=9007199254740991,pA="[object Arguments]",hA="[object Function]",yA="[object GeneratorFunction]",gA="[object Symbol]",_A=/[\\^$.*+?()[\]{}|]/g,vA=/^\[object .+?Constructor\]$/,mA=/^(?:0|[1-9]\d*)$/,wA=typeof U=="object"&&U&&U.Object===Object&&U,bA=typeof self=="object"&&self&&self.Object===Object&&self,Oi=wA||bA||Function("return this")();function $A(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}function EA(r,e){var t=r?r.length:0;return!!t&&OA(r,e,0)>-1}function SA(r,e,t){for(var n=-1,i=r?r.length:0;++n<i;)if(t(e,r[n]))return!0;return!1}function pu(r,e){for(var t=-1,n=r?r.length:0,i=Array(n);++t<n;)i[t]=e(r[t],t,r);return i}function Ii(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}function AA(r,e,t,n){for(var i=r.length,a=t+(n?1:-1);n?a--:++a<i;)if(e(r[a],a,r))return a;return-1}function OA(r,e,t){if(e!==e)return AA(r,IA,t);for(var n=t-1,i=r.length;++n<i;)if(r[n]===e)return n;return-1}function IA(r){return r!==r}function xA(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}function PA(r){return function(e){return r(e)}}function TA(r,e){return r.has(e)}function RA(r,e){return r?.[e]}function FA(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch{}return e}function hu(r,e){return function(t){return r(e(t))}}var MA=Array.prototype,DA=Function.prototype,Zt=Object.prototype,xi=Oi["__core-js_shared__"],yu=function(){var r=/[^.]+$/.exec(xi&&xi.keys&&xi.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),gu=DA.toString,or=Zt.hasOwnProperty,Pi=Zt.toString,CA=RegExp("^"+gu.call(or).replace(_A,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_u=Oi.Symbol,NA=hu(Object.getPrototypeOf,Object),BA=Zt.propertyIsEnumerable,UA=MA.splice,vu=_u?_u.isConcatSpreadable:void 0,Ti=Object.getOwnPropertySymbols,mu=Math.max,qA=bu(Oi,"Map"),jr=bu(Object,"create");function Ue(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}function kA(){this.__data__=jr?jr(null):{}}function LA(r){return this.has(r)&&delete this.__data__[r]}function jA(r){var e=this.__data__;if(jr){var t=e[r];return t===Ai?void 0:t}return or.call(e,r)?e[r]:void 0}function VA(r){var e=this.__data__;return jr?e[r]!==void 0:or.call(e,r)}function GA(r,e){var t=this.__data__;return t[r]=jr&&e===void 0?Ai:e,this}Ue.prototype.clear=kA,Ue.prototype.delete=LA,Ue.prototype.get=jA,Ue.prototype.has=VA,Ue.prototype.set=GA;function sr(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}function HA(){this.__data__=[]}function WA(r){var e=this.__data__,t=Qt(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():UA.call(e,t,1),!0}function zA(r){var e=this.__data__,t=Qt(e,r);return t<0?void 0:e[t][1]}function XA(r){return Qt(this.__data__,r)>-1}function YA(r,e){var t=this.__data__,n=Qt(t,r);return n<0?t.push([r,e]):t[n][1]=e,this}sr.prototype.clear=HA,sr.prototype.delete=WA,sr.prototype.get=zA,sr.prototype.has=XA,sr.prototype.set=YA;function ur(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}function KA(){this.__data__={hash:new Ue,map:new(qA||sr),string:new Ue}}function ZA(r){return en(this,r).delete(r)}function JA(r){return en(this,r).get(r)}function QA(r){return en(this,r).has(r)}function eO(r,e){return en(this,r).set(r,e),this}ur.prototype.clear=KA,ur.prototype.delete=ZA,ur.prototype.get=JA,ur.prototype.has=QA,ur.prototype.set=eO;function Jt(r){var e=-1,t=r?r.length:0;for(this.__data__=new ur;++e<t;)this.add(r[e])}function rO(r){return this.__data__.set(r,Ai),this}function tO(r){return this.__data__.has(r)}Jt.prototype.add=Jt.prototype.push=rO,Jt.prototype.has=tO;function nO(r,e){var t=Ri(r)||$u(r)?xA(r.length,String):[],n=t.length,i=!!n;for(var a in r)(e||or.call(r,a))&&!(i&&(a=="length"||yO(a,n)))&&t.push(a);return t}function Qt(r,e){for(var t=r.length;t--;)if($O(r[t][0],e))return t;return-1}function iO(r,e,t,n){var i=-1,a=EA,o=!0,s=r.length,f=[],c=e.length;if(!s)return f;t&&(e=pu(e,PA(t))),n?(a=SA,o=!1):e.length>=lA&&(a=TA,o=!1,e=new Jt(e));e:for(;++i<s;){var l=r[i],u=t?t(l):l;if(l=n||l!==0?l:0,o&&u===u){for(var d=c;d--;)if(e[d]===u)continue e;f.push(l)}else a(e,u,n)||f.push(l)}return f}function wu(r,e,t,n,i){var a=-1,o=r.length;for(t||(t=hO),i||(i=[]);++a<o;){var s=r[a];e>0&&t(s)?e>1?wu(s,e-1,t,n,i):Ii(i,s):n||(i[i.length]=s)}return i}function aO(r,e,t){var n=e(r);return Ri(r)?n:Ii(n,t(r))}function oO(r){if(!Fi(r)||_O(r))return!1;var e=Su(r)||FA(r)?CA:vA;return e.test(bO(r))}function sO(r){if(!Fi(r))return mO(r);var e=vO(r),t=[];for(var n in r)n=="constructor"&&(e||!or.call(r,n))||t.push(n);return t}function uO(r,e){return r=Object(r),fO(r,e,function(t,n){return n in r})}function fO(r,e,t){for(var n=-1,i=e.length,a={};++n<i;){var o=e[n],s=r[o];t(s,o)&&(a[o]=s)}return a}function cO(r,e){return e=mu(e===void 0?r.length-1:e,0),function(){for(var t=arguments,n=-1,i=mu(t.length-e,0),a=Array(i);++n<i;)a[n]=t[e+n];n=-1;for(var o=Array(e+1);++n<e;)o[n]=t[n];return o[e]=a,$A(r,this,o)}}function lO(r){return aO(r,OO,pO)}function en(r,e){var t=r.__data__;return gO(e)?t[typeof e=="string"?"string":"hash"]:t.map}function bu(r,e){var t=RA(r,e);return oO(t)?t:void 0}var dO=Ti?hu(Ti,Object):Ou,pO=Ti?function(r){for(var e=[];r;)Ii(e,dO(r)),r=NA(r);return e}:Ou;function hO(r){return Ri(r)||$u(r)||!!(vu&&r&&r[vu])}function yO(r,e){return e=e??du,!!e&&(typeof r=="number"||mA.test(r))&&r>-1&&r%1==0&&r<e}function gO(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}function _O(r){return!!yu&&yu in r}function vO(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Zt;return r===t}function mO(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}function wO(r){if(typeof r=="string"||AO(r))return r;var e=r+"";return e=="0"&&1/r==-dA?"-0":e}function bO(r){if(r!=null){try{return gu.call(r)}catch{}try{return r+""}catch{}}return""}function $O(r,e){return r===e||r!==r&&e!==e}function $u(r){return EO(r)&&or.call(r,"callee")&&(!BA.call(r,"callee")||Pi.call(r)==pA)}var Ri=Array.isArray;function Eu(r){return r!=null&&SO(r.length)&&!Su(r)}function EO(r){return Au(r)&&Eu(r)}function Su(r){var e=Fi(r)?Pi.call(r):"";return e==hA||e==yA}function SO(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=du}function Fi(r){var e=typeof r;return!!r&&(e=="object"||e=="function")}function Au(r){return!!r&&typeof r=="object"}function AO(r){return typeof r=="symbol"||Au(r)&&Pi.call(r)==gA}function OO(r){return Eu(r)?nO(r,!0):sO(r)}var IO=cO(function(r,e){return r==null?{}:(e=pu(wu(e,1),wO),uO(r,iO(lO(r),e)))});function Ou(){return[]}var xO=IO,Mi=be(xO);function PO(r){try{return JSON.parse(r)}catch{return r}}function TO(r){return Object.entries(r).reduce((e,[t,n])=>({...e,[t]:PO(n)}),{})}const Iu=r=>typeof r=="string"?r!=="0"&&r!=="false":!!r;function xu(r){const e=TO(r),t=e.auto_inject===void 0?!0:e.auto_inject,n=e.display_on??[],i=e.first_option==="autodeliver";return{...Mi(e,["display_on","first_option"]),auto_inject:t,valid_pages:n,is_subscription_first:i,autoInject:t,validPages:n,isSubscriptionFirst:i}}function Pu(r){const e=r.subscription_options?.storefront_purchase_options==="subscription_only";return{...r,is_subscription_only:e,isSubscriptionOnly:e}}function RO(r){return r.map(e=>{const t={};return Object.entries(e).forEach(([n,i])=>{t[n]=Pu(i)}),t})}const Di="2020-12",FO={store_currency:{currency_code:"USD",currency_symbol:"$",decimal_separator:".",thousands_separator:",",currency_symbol_location:"left"}},Vr=new Map;function rn(r,e){return Vr.has(r)||Vr.set(r,e()),Vr.get(r)}async function Ci(r,e){if(r===void 0||r==="")throw new Error("ID is required");const t=e?.version??"2020-12",{product:n}=await rn(`product.${r}.${t}`,()=>ht("get",`/product/${t}/${r}.json`));return t==="2020-12"?Pu(n):n}async function Tu(){return await rn("storeSettings",()=>ht("get",`/${Di}/store_settings.json`).catch(()=>FO))}async function Ru(){const{widget_settings:r}=await rn("widgetSettings",()=>ht("get",`/${Di}/widget_settings.json`));return xu(r)}async function Fu(){const{products:r,widget_settings:e,store_settings:t,meta:n}=await rn("productsAndSettings",()=>ht("get",`/product/${Di}/products.json`));return n?.status==="error"?Promise.reject(n.message):{products:RO(r),widget_settings:xu(e),store_settings:t??{}}}async function MO(){const{products:r}=await Fu();return r}async function DO(r){const[e,t,n]=await Promise.all([Ci(r),Tu(),Ru()]);return{product:e,store_settings:t,widget_settings:n,storeSettings:t,widgetSettings:n}}async function CO(r){const{bundle_product:e}=await Ci(r);return e}async function Mu(){return Array.from(Vr.keys()).forEach(r=>Vr.delete(r))}var NO=Object.freeze({__proto__:null,getCDNBundleSettings:CO,getCDNProduct:Ci,getCDNProductAndSettings:DO,getCDNProducts:MO,getCDNProductsAndSettings:Fu,getCDNStoreSettings:Tu,getCDNWidgetSettings:Ru,resetCDNCache:Mu});async function BO(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{charge:n}=await w("get","/charges",{id:e,query:{include:t?.include}},v(r,"getCharge"));return n}function UO(r,e){return w("get","/charges",{query:e},v(r,"listCharges"))}async function qO(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{charge:n}=await w("post",`/charges/${e}/apply_discount`,{data:{discount_code:t}},v(r,"applyDiscountToCharge"));return n}async function kO(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{charge:t}=await w("post",`/charges/${e}/remove_discount`,{},v(r,"removeDiscountsFromCharge"));return t}async function LO(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");if(t===void 0||t.length===0)throw new Error("Purchase item IDs are required");const{charge:i}=await w("post",`/charges/${e}/skip`,{query:n,data:{purchase_item_ids:t.map(a=>Number(a))}},v(r,"skipCharge"));return i}async function jO(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");if(t===void 0||t.length===0)throw new Error("Purchase item IDs are required");const{charge:i}=await w("post",`/charges/${e}/unskip`,{query:n,data:{purchase_item_ids:t.map(a=>Number(a))}},v(r,"unskipCharge"));return i}async function VO(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{charge:t}=await w("post",`/charges/${e}/process`,{},v(r,"processCharge"));return t}async function GO(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{charge:n}=await w("post",`/charges/${e}/change_next_charge_date`,{data:{next_charge_date:t}},v(r,"rescheduleCharge"));return n}var HO=Object.freeze({__proto__:null,applyDiscountToCharge:qO,getCharge:BO,listCharges:UO,processCharge:VO,removeDiscountsFromCharge:kO,rescheduleCharge:GO,skipCharge:LO,unskipCharge:jO});async function Du(r,e){if(!["2020-12","2022-06"].includes(e.format_version))throw new Error("Missing or unsupported format_version.");return w("get","/product_search",{query:e,headers:{"X-Recharge-Version":"2021-01"}},v(r,"productSearch"))}var WO=Object.freeze({__proto__:null,productSearch:Du});async function Cu(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{collection:t}=await w("get","/collections",{id:e},v(r,"getCollection"));return t}function zO(r,e){return w("get","/collections",{query:e},v(r,"listCollections"))}async function XO(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");if(!["2020-12","2022-06"].includes(t.format_version))throw new Error("Missing or unsupported format_version.");const n=v(r,"listCollectionProducts"),[{sort_order:i,manual_sort_order:a},{products:o}]=await Promise.all([Cu(n,e),Du(n,{...t,collection_ids:[e],limit:250})]);if(i==="manual")return{products:a.reduce((s,f)=>{const c=o.find(l=>l.external_product_id===f);return c&&s.push(c),s},[])};{const s=YO(i);return{products:o.slice().sort(s)}}}function Nu(r,e){const t=r.external_created_at,n=e.external_created_at;return t<n?-1:n>t?1:0}function Bu(r,e){const t=r.external_product_id,n=e.external_product_id;return t<n?-1:n>t?1:0}function Uu(r,e){const t=r.title.toLowerCase(),n=e.title.toLowerCase();return t<n?-1:n>t?1:0}function YO(r){switch(r){case"created_at-asc":return Nu;case"created_at-desc":return(e,t)=>Nu(t,e);case"id-asc":return Bu;case"id-desc":return(e,t)=>Bu(t,e);case"title-asc":return Uu;case"title-desc":return(e,t)=>Uu(t,e)}}var KO=Object.freeze({__proto__:null,getCollection:Cu,listCollectionProducts:XO,listCollections:zO});async function ZO(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await w("get","/customers",{id:t,query:{include:e?.include}},v(r,"getCustomer"));return n}async function qu(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await w("put","/customers",{id:t,data:e},v(r,"updateCustomer"));return n}async function JO(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{deliveries:n}=await w("get",`/customers/${t}/delivery_schedule`,{query:e},v(r,"getDeliverySchedule"));return n}async function tn(r,e){return w("get","/portal_access",{query:e},v(r,"getCustomerPortalAccess"))}async function QO(r,e,t){if(e===void 0||e==="")throw new Error("Subscription ID is required");const{base_url:n,customer_hash:i,temp_token:a}=await tn(v(r,"getActiveChurnLandingPageURL"));return`${n.replace("portal","pages")}${i}/subscriptions/${e}/cancel?token=${a}&subscription=${e}&redirect_to=${t}`}async function eI(r){const{base_url:e,customer_hash:t,temp_token:n}=await tn(v(r,"getFailedPaymentMethodRecoveryLandingPageURL"));return`${e.replace("portal","pages")}account/payment-methods?token=${n}&hash=${t}`}async function rI(r,e,t){if(e===void 0||e==="")throw new Error("Gift ID is required");const{base_url:n,customer_hash:i,temp_token:a}=await tn(v(r,"getGiftRedemptionLandingPageURL"));return`${n.replace("portal","pages")}${i}/gifts/${e}?token=${a}&redirect_to=${t}`}const tI={SHOPIFY_UPDATE_PAYMENT_INFO:{type:"email",template_type:"shopify_update_payment_information"},SHOPIFY_MIGRATE_PAYMENT_INFO:{type:"email",template_type:"shopify_migrate_payment_information"}};async function nI(r,e,t){const n=r.customerId;if(!n)throw new Error("Not logged in.");const i=tI[e];if(!i)throw new Error("Notification not supported.");return w("post",`/customers/${n}/notifications`,{data:{...i,template_vars:t}},v(r,"sendCustomerNotification"))}async function iI(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{credit_summary:n}=await w("get",`/customers/${t}/credit_summary`,{query:{include:e?.include}},v(r,"getCreditSummary"));return n}var aI=Object.freeze({__proto__:null,getActiveChurnLandingPageURL:QO,getCreditSummary:iI,getCustomer:ZO,getCustomerPortalAccess:tn,getDeliverySchedule:JO,getFailedPaymentMethodRecoveryLandingPageURL:eI,getGiftRedemptionLandingPageURL:rI,sendCustomerNotification:nI,updateCustomer:qu});async function oI(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{credit_summary:n}=await w("get",`/customers/${t}/credit_summary`,{query:{include:e?.include,presentment_currency_code:e?.presentment_currency_code}},v(r,"getCreditSummary"));return n}function sI(r,{recurring:e}){if(!r.customerId)throw new Error("Not logged in.");const t={};return e!==void 0&&(t.apply_credit_to_next_recurring_charge=e),qu(v(r,"setApplyCreditsToNextCharge"),t)}async function uI(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");return await w("get","/credit_accounts",{query:{customer_id:t,...e}},v(r,"listCreditAccounts"))}var fI=Object.freeze({__proto__:null,getCreditSummary:oI,listCreditAccounts:uI,setApplyCreditsToNextCharge:sI});async function cI(r,e,t){return await w("post","/customer_surveys/cancellation_prevention",{data:{customer_id:e,subscription_id:t}},v(r,"getCustomerSurveyReasons"))}async function lI(r,e,t,n){return await w("post",`/customer_surveys/${t}/customer_response`,{data:{customer_id:e,response_id:n}},v(r,"getCustomerSurveyOffers"))}async function dI(r,e){return await w("post","/offers/claim",{data:e},v(r,"claimOfferCustomerSurvey")),{}}var pI=Object.freeze({__proto__:null,claimOfferCustomerSurvey:dI,getCustomerSurveyOffers:lI,getCustomerSurveyReasons:cI});function hI(r,e){if(!r.customerId)throw new Error("Not logged in.");return w("get","/gift_purchases",{query:e},v(r,"listGiftPurchases"))}async function yI(r,e){if(!r.customerId)throw new Error("Not logged in.");if(e===void 0||e==="")throw new Error("ID is required");const{gift_purchase:t}=await w("get","/gift_purchases",{id:e},v(r,"getGiftPurchase"));return t}var gI=Object.freeze({__proto__:null,getGiftPurchase:yI,listGiftPurchases:hI});async function _I(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{membership:t}=await w("get","/memberships",{id:e},v(r,"getMembership"));return t}function vI(r,e){return w("get","/memberships",{query:e},v(r,"listMemberships"))}async function mI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{membership:n}=await w("post",`/memberships/${e}/cancel`,{data:t},v(r,"cancelMembership"));return n}async function wI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{membership:n}=await w("post",`/memberships/${e}/activate`,{data:t},v(r,"activateMembership"));return n}async function bI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{membership:n}=await w("post",`/memberships/${e}/change`,{data:t},v(r,"changeMembership"));return n}var $I=Object.freeze({__proto__:null,activateMembership:wI,cancelMembership:mI,changeMembership:bI,getMembership:_I,listMemberships:vI});async function EI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{membership_program:n}=await w("get","/membership_programs",{id:e,query:{include:t?.include}},v(r,"getMembershipProgram"));return n}function SI(r,e){return w("get","/membership_programs",{query:e},v(r,"listMembershipPrograms"))}var AI=Object.freeze({__proto__:null,getMembershipProgram:EI,listMembershipPrograms:SI});async function OI(r,e){const{metafield:t}=await w("post","/metafields",{data:{metafield:e}},v(r,"createMetafield"));return t}async function II(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{metafield:n}=await w("put","/metafields",{id:e,data:{metafield:t}},v(r,"updateMetafield"));return n}function xI(r,e){if(e===void 0||e==="")throw new Error("ID is required");return w("delete","/metafields",{id:e},v(r,"deleteMetafield"))}var PI=Object.freeze({__proto__:null,createMetafield:OI,deleteMetafield:xI,updateMetafield:II});async function TI(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{onetime:t}=await w("get","/onetimes",{id:e},v(r,"getOnetime"));return t}function RI(r,e){return w("get","/onetimes",{query:e},v(r,"listOnetimes"))}async function FI(r,e){const{onetime:t}=await w("post","/onetimes",{data:e},v(r,"createOnetime"));return t}async function MI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{onetime:n}=await w("put","/onetimes",{id:e,data:t},v(r,"updateOnetime"));return n}function DI(r,e){if(e===void 0||e==="")throw new Error("ID is required");return w("delete","/onetimes",{id:e},v(r,"deleteOnetime"))}var CI=Object.freeze({__proto__:null,createOnetime:FI,deleteOnetime:DI,getOnetime:TI,listOnetimes:RI,updateOnetime:MI});async function NI(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{order:t}=await w("get","/orders",{id:e},v(r,"getOrder"));return t}function BI(r,e){return w("get","/orders",{query:e},v(r,"listOrders"))}async function UI(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{order:t}=await w("post",`/orders/${e}/delay`,{},v(r,"delayOrder"));return t}var qI=Object.freeze({__proto__:null,delayOrder:UI,getOrder:NI,listOrders:BI});async function kI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{payment_method:n}=await w("get","/payment_methods",{id:e,query:{include:t?.include}},v(r,"getPaymentMethod"));return n}async function LI(r,e){const{payment_method:t}=await w("post","/payment_methods",{data:{...e,customer_id:r.customerId}},v(r,"createPaymentMethod"));return t}async function jI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{payment_method:n}=await w("put","/payment_methods",{id:e,data:t},v(r,"updatePaymentMethod"));return n}function VI(r,e){return w("get","/payment_methods",{query:e},v(r,"listPaymentMethods"))}var GI=Object.freeze({__proto__:null,createPaymentMethod:LI,getPaymentMethod:kI,listPaymentMethods:VI,updatePaymentMethod:jI});async function HI(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{plan:t}=await w("get","/plans",{id:e},v(r,"getPlan"));return t}function WI(r,e){return w("get","/plans",{query:e},v(r,"listPlans"))}var zI=Object.freeze({__proto__:null,getPlan:HI,listPlans:WI});async function XI(r,e){return await w("get","/shop/shipping_countries",{query:e,headers:{"X-Recharge-Version":"2021-01"}},v(r,"getShippingCountries"))}async function YI(r){return await w("get","/shop/settings",{headers:{"X-Recharge-Version":"2021-01"}},v(r,"getStoreSettings"))}var KI=Object.freeze({__proto__:null,getShippingCountries:XI,getStoreSettings:YI}),ZI="Expected a function",ku="__lodash_placeholder__",qe=1,nn=2,JI=4,fr=8,Gr=16,ke=32,Hr=64,Lu=128,QI=256,ju=512,Vu=1/0,ex=9007199254740991,rx=17976931348623157e292,Gu=0/0,tx=[["ary",Lu],["bind",qe],["bindKey",nn],["curry",fr],["curryRight",Gr],["flip",ju],["partial",ke],["partialRight",Hr],["rearg",QI]],nx="[object Function]",ix="[object GeneratorFunction]",ax="[object Symbol]",ox=/[\\^$.*+?()[\]{}|]/g,sx=/^\s+|\s+$/g,ux=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,fx=/\{\n\/\* \[wrapped with (.+)\] \*/,cx=/,? & /,lx=/^[-+]0x[0-9a-f]+$/i,dx=/^0b[01]+$/i,px=/^\[object .+?Constructor\]$/,hx=/^0o[0-7]+$/i,yx=/^(?:0|[1-9]\d*)$/,gx=parseInt,_x=typeof U=="object"&&U&&U.Object===Object&&U,vx=typeof self=="object"&&self&&self.Object===Object&&self,Wr=_x||vx||Function("return this")();function Ni(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}function mx(r,e){for(var t=-1,n=r?r.length:0;++t<n&&e(r[t],t,r)!==!1;);return r}function wx(r,e){var t=r?r.length:0;return!!t&&$x(r,e,0)>-1}function bx(r,e,t,n){for(var i=r.length,a=t+(n?1:-1);n?a--:++a<i;)if(e(r[a],a,r))return a;return-1}function $x(r,e,t){if(e!==e)return bx(r,Ex,t);for(var n=t-1,i=r.length;++n<i;)if(r[n]===e)return n;return-1}function Ex(r){return r!==r}function Sx(r,e){for(var t=r.length,n=0;t--;)r[t]===e&&n++;return n}function Ax(r,e){return r?.[e]}function Ox(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch{}return e}function Bi(r,e){for(var t=-1,n=r.length,i=0,a=[];++t<n;){var o=r[t];(o===e||o===ku)&&(r[t]=ku,a[i++]=t)}return a}var Ix=Function.prototype,Hu=Object.prototype,Ui=Wr["__core-js_shared__"],Wu=function(){var r=/[^.]+$/.exec(Ui&&Ui.keys&&Ui.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),zu=Ix.toString,xx=Hu.hasOwnProperty,Xu=Hu.toString,Px=RegExp("^"+zu.call(xx).replace(ox,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Tx=Object.create,cr=Math.max,Rx=Math.min,Yu=function(){var r=Zu(Object,"defineProperty"),e=Zu.name;return e&&e.length>2?r:void 0}();function Fx(r){return lr(r)?Tx(r):{}}function Mx(r){if(!lr(r)||Hx(r))return!1;var e=Yx(r)||Ox(r)?Px:px;return e.test(zx(r))}function Dx(r,e){return e=cr(e===void 0?r.length-1:e,0),function(){for(var t=arguments,n=-1,i=cr(t.length-e,0),a=Array(i);++n<i;)a[n]=t[e+n];n=-1;for(var o=Array(e+1);++n<e;)o[n]=t[n];return o[e]=a,Ni(r,this,o)}}function Cx(r,e,t,n){for(var i=-1,a=r.length,o=t.length,s=-1,f=e.length,c=cr(a-o,0),l=Array(f+c),u=!n;++s<f;)l[s]=e[s];for(;++i<o;)(u||i<a)&&(l[t[i]]=r[i]);for(;c--;)l[s++]=r[i++];return l}function Nx(r,e,t,n){for(var i=-1,a=r.length,o=-1,s=t.length,f=-1,c=e.length,l=cr(a-s,0),u=Array(l+c),d=!n;++i<l;)u[i]=r[i];for(var y=i;++f<c;)u[y+f]=e[f];for(;++o<s;)(d||i<a)&&(u[y+t[o]]=r[i++]);return u}function Bx(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}function Ux(r,e,t){var n=e&qe,i=zr(r);function a(){var o=this&&this!==Wr&&this instanceof a?i:r;return o.apply(n?t:this,arguments)}return a}function zr(r){return function(){var e=arguments;switch(e.length){case 0:return new r;case 1:return new r(e[0]);case 2:return new r(e[0],e[1]);case 3:return new r(e[0],e[1],e[2]);case 4:return new r(e[0],e[1],e[2],e[3]);case 5:return new r(e[0],e[1],e[2],e[3],e[4]);case 6:return new r(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new r(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var t=Fx(r.prototype),n=r.apply(t,e);return lr(n)?n:t}}function qx(r,e,t){var n=zr(r);function i(){for(var a=arguments.length,o=Array(a),s=a,f=ki(i);s--;)o[s]=arguments[s];var c=a<3&&o[0]!==f&&o[a-1]!==f?[]:Bi(o,f);if(a-=c.length,a<t)return Ku(r,e,qi,i.placeholder,void 0,o,c,void 0,void 0,t-a);var l=this&&this!==Wr&&this instanceof i?n:r;return Ni(l,this,o)}return i}function qi(r,e,t,n,i,a,o,s,f,c){var l=e&Lu,u=e&qe,d=e&nn,y=e&(fr|Gr),b=e&ju,S=d?void 0:zr(r);function O(){for(var $=arguments.length,E=Array($),p=$;p--;)E[p]=arguments[p];if(y)var I=ki(O),T=Sx(E,I);if(n&&(E=Cx(E,n,i,y)),a&&(E=Nx(E,a,o,y)),$-=T,y&&$<c){var F=Bi(E,I);return Ku(r,e,qi,O.placeholder,t,E,F,s,f,c-$)}var m=u?t:this,g=d?m[r]:r;return $=E.length,s?E=Wx(E,s):b&&$>1&&E.reverse(),l&&f<$&&(E.length=f),this&&this!==Wr&&this instanceof O&&(g=S||zr(g)),g.apply(m,E)}return O}function kx(r,e,t,n){var i=e&qe,a=zr(r);function o(){for(var s=-1,f=arguments.length,c=-1,l=n.length,u=Array(l+f),d=this&&this!==Wr&&this instanceof o?a:r;++c<l;)u[c]=n[c];for(;f--;)u[c++]=arguments[++s];return Ni(d,i?t:this,u)}return o}function Ku(r,e,t,n,i,a,o,s,f,c){var l=e&fr,u=l?o:void 0,d=l?void 0:o,y=l?a:void 0,b=l?void 0:a;e|=l?ke:Hr,e&=~(l?Hr:ke),e&JI||(e&=~(qe|nn));var S=t(r,e,i,y,u,b,d,s,f,c);return S.placeholder=n,Ju(S,r,e)}function Lx(r,e,t,n,i,a,o,s){var f=e&nn;if(!f&&typeof r!="function")throw new TypeError(ZI);var c=n?n.length:0;if(c||(e&=~(ke|Hr),n=i=void 0),o=o===void 0?o:cr(Qu(o),0),s=s===void 0?s:Qu(s),c-=i?i.length:0,e&Hr){var l=n,u=i;n=i=void 0}var d=[r,e,t,n,i,l,u,a,o,s];if(r=d[0],e=d[1],t=d[2],n=d[3],i=d[4],s=d[9]=d[9]==null?f?0:r.length:cr(d[9]-c,0),!s&&e&(fr|Gr)&&(e&=~(fr|Gr)),!e||e==qe)var y=Ux(r,e,t);else e==fr||e==Gr?y=qx(r,e,s):(e==ke||e==(qe|ke))&&!i.length?y=kx(r,e,t,n):y=qi.apply(void 0,d);return Ju(y,r,e)}function ki(r){var e=r;return e.placeholder}function Zu(r,e){var t=Ax(r,e);return Mx(t)?t:void 0}function jx(r){var e=r.match(fx);return e?e[1].split(cx):[]}function Vx(r,e){var t=e.length,n=t-1;return e[n]=(t>1?"& ":"")+e[n],e=e.join(t>2?", ":" "),r.replace(ux,`{
24
+ */(function(e,t){typeof W$=="function"&&r&&r.exports?r.exports=t():(e.dcodeIO=e.dcodeIO||{}).Long=t()})(D,function(){function e(c,u,l){this.low=c|0,this.high=u|0,this.unsigned=!!l}e.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=function(u){return(u&&u.__isLong__)===!0};var t={},n={};e.fromInt=function(u,l){var y,m;return l?(u=u>>>0,0<=u&&u<256&&(m=n[u],m)?m:(y=new e(u,(u|0)<0?-1:0,!0),0<=u&&u<256&&(n[u]=y),y)):(u=u|0,-128<=u&&u<128&&(m=t[u],m)?m:(y=new e(u,u<0?-1:0,!1),-128<=u&&u<128&&(t[u]=y),y))},e.fromNumber=function(u,l){return l=!!l,isNaN(u)||!isFinite(u)?e.ZERO:!l&&u<=-f?e.MIN_VALUE:!l&&u+1>=f?e.MAX_VALUE:l&&u>=s?e.MAX_UNSIGNED_VALUE:u<0?e.fromNumber(-u,l).negate():new e(u%o|0,u/o|0,l)},e.fromBits=function(u,l,y){return new e(u,l,y)},e.fromString=function(u,l,y){if(u.length===0)throw Error("number format error: empty string");if(u==="NaN"||u==="Infinity"||u==="+Infinity"||u==="-Infinity")return e.ZERO;if(typeof l=="number"&&(y=l,l=!1),y=y||10,y<2||36<y)throw Error("radix out of range: "+y);var m;if((m=u.indexOf("-"))>0)throw Error('number format error: interior "-" character: '+u);if(m===0)return e.fromString(u.substring(1),l,y).negate();for(var E=e.fromNumber(Math.pow(y,8)),S=e.ZERO,O=0;O<u.length;O+=8){var $=Math.min(8,u.length-O),p=parseInt(u.substring(O,O+$),y);if($<8){var I=e.fromNumber(Math.pow(y,$));S=S.multiply(I).add(e.fromNumber(p))}else S=S.multiply(E),S=S.add(e.fromNumber(p))}return S.unsigned=l,S},e.fromValue=function(u){return u instanceof e?u:typeof u=="number"?e.fromNumber(u):typeof u=="string"?e.fromString(u):new e(u.low,u.high,u.unsigned)};var i=65536,a=1<<24,o=i*i,s=o*o,f=s/2,d=e.fromInt(a);return e.ZERO=e.fromInt(0),e.UZERO=e.fromInt(0,!0),e.ONE=e.fromInt(1),e.UONE=e.fromInt(1,!0),e.NEG_ONE=e.fromInt(-1),e.MAX_VALUE=e.fromBits(-1,2147483647,!1),e.MAX_UNSIGNED_VALUE=e.fromBits(-1,-1,!0),e.MIN_VALUE=e.fromBits(0,-2147483648,!1),e.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},e.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*o+(this.low>>>0):this.high*o+(this.low>>>0)},e.prototype.toString=function(u){if(u=u||10,u<2||36<u)throw RangeError("radix out of range: "+u);if(this.isZero())return"0";var l;if(this.isNegative())if(this.equals(e.MIN_VALUE)){var y=e.fromNumber(u),m=this.divide(y);return l=m.multiply(y).subtract(this),m.toString(u)+l.toInt().toString(u)}else return"-"+this.negate().toString(u);var E=e.fromNumber(Math.pow(u,6),this.unsigned);l=this;for(var S="";;){var O=l.divide(E),$=l.subtract(O.multiply(E)).toInt()>>>0,p=$.toString(u);if(l=O,l.isZero())return p+S;for(;p.length<6;)p="0"+p;S=""+p+S}},e.prototype.getHighBits=function(){return this.high},e.prototype.getHighBitsUnsigned=function(){return this.high>>>0},e.prototype.getLowBits=function(){return this.low},e.prototype.getLowBitsUnsigned=function(){return this.low>>>0},e.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.equals(e.MIN_VALUE)?64:this.negate().getNumBitsAbs();for(var u=this.high!=0?this.high:this.low,l=31;l>0&&!(u&1<<l);l--);return this.high!=0?l+33:l+1},e.prototype.isZero=function(){return this.high===0&&this.low===0},e.prototype.isNegative=function(){return!this.unsigned&&this.high<0},e.prototype.isPositive=function(){return this.unsigned||this.high>=0},e.prototype.isOdd=function(){return(this.low&1)===1},e.prototype.isEven=function(){return(this.low&1)===0},e.prototype.equals=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.unsigned!==u.unsigned&&this.high>>>31===1&&u.high>>>31===1?!1:this.high===u.high&&this.low===u.low},e.eq=e.prototype.equals,e.prototype.notEquals=function(u){return!this.equals(u)},e.neq=e.prototype.notEquals,e.prototype.lessThan=function(u){return this.compare(u)<0},e.prototype.lt=e.prototype.lessThan,e.prototype.lessThanOrEqual=function(u){return this.compare(u)<=0},e.prototype.lte=e.prototype.lessThanOrEqual,e.prototype.greaterThan=function(u){return this.compare(u)>0},e.prototype.gt=e.prototype.greaterThan,e.prototype.greaterThanOrEqual=function(u){return this.compare(u)>=0},e.prototype.gte=e.prototype.greaterThanOrEqual,e.prototype.compare=function(u){if(e.isLong(u)||(u=e.fromValue(u)),this.equals(u))return 0;var l=this.isNegative(),y=u.isNegative();return l&&!y?-1:!l&&y?1:this.unsigned?u.high>>>0>this.high>>>0||u.high===this.high&&u.low>>>0>this.low>>>0?-1:1:this.subtract(u).isNegative()?-1:1},e.prototype.negate=function(){return!this.unsigned&&this.equals(e.MIN_VALUE)?e.MIN_VALUE:this.not().add(e.ONE)},e.prototype.neg=e.prototype.negate,e.prototype.add=function(u){e.isLong(u)||(u=e.fromValue(u));var l=this.high>>>16,y=this.high&65535,m=this.low>>>16,E=this.low&65535,S=u.high>>>16,O=u.high&65535,$=u.low>>>16,p=u.low&65535,I=0,T=0,R=0,b=0;return b+=E+p,R+=b>>>16,b&=65535,R+=m+$,T+=R>>>16,R&=65535,T+=y+O,I+=T>>>16,T&=65535,I+=l+S,I&=65535,e.fromBits(R<<16|b,I<<16|T,this.unsigned)},e.prototype.subtract=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.add(u.negate())},e.prototype.sub=e.prototype.subtract,e.prototype.multiply=function(u){if(this.isZero()||(e.isLong(u)||(u=e.fromValue(u)),u.isZero()))return e.ZERO;if(this.equals(e.MIN_VALUE))return u.isOdd()?e.MIN_VALUE:e.ZERO;if(u.equals(e.MIN_VALUE))return this.isOdd()?e.MIN_VALUE:e.ZERO;if(this.isNegative())return u.isNegative()?this.negate().multiply(u.negate()):this.negate().multiply(u).negate();if(u.isNegative())return this.multiply(u.negate()).negate();if(this.lessThan(d)&&u.lessThan(d))return e.fromNumber(this.toNumber()*u.toNumber(),this.unsigned);var l=this.high>>>16,y=this.high&65535,m=this.low>>>16,E=this.low&65535,S=u.high>>>16,O=u.high&65535,$=u.low>>>16,p=u.low&65535,I=0,T=0,R=0,b=0;return b+=E*p,R+=b>>>16,b&=65535,R+=m*p,T+=R>>>16,R&=65535,R+=E*$,T+=R>>>16,R&=65535,T+=y*p,I+=T>>>16,T&=65535,T+=m*$,I+=T>>>16,T&=65535,T+=E*O,I+=T>>>16,T&=65535,I+=l*p+y*$+m*O+E*S,I&=65535,e.fromBits(R<<16|b,I<<16|T,this.unsigned)},e.prototype.mul=e.prototype.multiply,e.prototype.divide=function(u){if(e.isLong(u)||(u=e.fromValue(u)),u.isZero())throw new Error("division by zero");if(this.isZero())return this.unsigned?e.UZERO:e.ZERO;var l,y,m;if(this.equals(e.MIN_VALUE)){if(u.equals(e.ONE)||u.equals(e.NEG_ONE))return e.MIN_VALUE;if(u.equals(e.MIN_VALUE))return e.ONE;var E=this.shiftRight(1);return l=E.divide(u).shiftLeft(1),l.equals(e.ZERO)?u.isNegative()?e.ONE:e.NEG_ONE:(y=this.subtract(u.multiply(l)),m=l.add(y.divide(u)),m)}else if(u.equals(e.MIN_VALUE))return this.unsigned?e.UZERO:e.ZERO;if(this.isNegative())return u.isNegative()?this.negate().divide(u.negate()):this.negate().divide(u).negate();if(u.isNegative())return this.divide(u.negate()).negate();for(m=e.ZERO,y=this;y.greaterThanOrEqual(u);){l=Math.max(1,Math.floor(y.toNumber()/u.toNumber()));for(var S=Math.ceil(Math.log(l)/Math.LN2),O=S<=48?1:Math.pow(2,S-48),$=e.fromNumber(l),p=$.multiply(u);p.isNegative()||p.greaterThan(y);)l-=O,$=e.fromNumber(l,this.unsigned),p=$.multiply(u);$.isZero()&&($=e.ONE),m=m.add($),y=y.subtract(p)}return m},e.prototype.div=e.prototype.divide,e.prototype.modulo=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.subtract(this.divide(u).multiply(u))},e.prototype.mod=e.prototype.modulo,e.prototype.not=function(){return e.fromBits(~this.low,~this.high,this.unsigned)},e.prototype.and=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low&u.low,this.high&u.high,this.unsigned)},e.prototype.or=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low|u.low,this.high|u.high,this.unsigned)},e.prototype.xor=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low^u.low,this.high^u.high,this.unsigned)},e.prototype.shiftLeft=function(u){return e.isLong(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?e.fromBits(this.low<<u,this.high<<u|this.low>>>32-u,this.unsigned):e.fromBits(0,this.low<<u-32,this.unsigned)},e.prototype.shl=e.prototype.shiftLeft,e.prototype.shiftRight=function(u){return e.isLong(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?e.fromBits(this.low>>>u|this.high<<32-u,this.high>>u,this.unsigned):e.fromBits(this.high>>u-32,this.high>=0?0:-1,this.unsigned)},e.prototype.shr=e.prototype.shiftRight,e.prototype.shiftRightUnsigned=function(u){if(e.isLong(u)&&(u=u.toInt()),u&=63,u===0)return this;var l=this.high;if(u<32){var y=this.low;return e.fromBits(y>>>u|l<<32-u,l>>>u,this.unsigned)}else return u===32?e.fromBits(l,0,this.unsigned):e.fromBits(l>>>u-32,0,this.unsigned)},e.prototype.shru=e.prototype.shiftRightUnsigned,e.prototype.toSigned=function(){return this.unsigned?new e(this.low,this.high,!1):this},e.prototype.toUnsigned=function(){return this.unsigned?this:new e(this.low,this.high,!0)},e})})(as);var os=as.exports;Object.defineProperty(jt,"__esModule",{value:!0}),jt.Hyper=void 0;var z$=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),us=function r(e,t,n){e===null&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,t);if(i===void 0){var a=Object.getPrototypeOf(e);return a===null?void 0:r(a,t,n)}else{if("value"in i)return i.value;var o=i.get;return o===void 0?void 0:o.call(n)}},X$=os,Fr=ss(X$),Y$=M,K$=ss(Y$);function ss(r){return r&&r.__esModule?r:{default:r}}function Z$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function J$(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function Q$(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var Mr=jt.Hyper=function(r){Q$(e,r),z$(e,null,[{key:"read",value:function(n){var i=n.readInt32BE(),a=n.readInt32BE();return this.fromBits(a,i)}},{key:"write",value:function(n,i){if(!(n instanceof this))throw new Error("XDR Write Error: "+n+" is not a Hyper");i.writeInt32BE(n.high),i.writeInt32BE(n.low)}},{key:"fromString",value:function(n){if(!/^-?\d+$/.test(n))throw new Error("Invalid hyper string: "+n);var i=us(e.__proto__||Object.getPrototypeOf(e),"fromString",this).call(this,n,!1);return new this(i.low,i.high)}},{key:"fromBits",value:function(n,i){var a=us(e.__proto__||Object.getPrototypeOf(e),"fromBits",this).call(this,n,i,!1);return new this(a.low,a.high)}},{key:"isValid",value:function(n){return n instanceof this}}]);function e(t,n){return Z$(this,e),J$(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!1))}return e}(Fr.default);(0,K$.default)(Mr),Mr.MAX_VALUE=new Mr(Fr.default.MAX_VALUE.low,Fr.default.MAX_VALUE.high),Mr.MIN_VALUE=new Mr(Fr.default.MIN_VALUE.low,Fr.default.MIN_VALUE.high);var Ce={};Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.UnsignedInt=void 0;var eE=It,fs=cs(eE),rE=M,tE=cs(rE);function cs(r){return r&&r.__esModule?r:{default:r}}var Dr=Ce.UnsignedInt={read:function(e){return e.readUInt32BE()},write:function(e,t){if(!(0,fs.default)(e))throw new Error("XDR Write Error: not a number");if(Math.floor(e)!==e)throw new Error("XDR Write Error: not an integer");if(e<0)throw new Error("XDR Write Error: negative number "+e);t.writeUInt32BE(e)},isValid:function(e){return!(0,fs.default)(e)||Math.floor(e)!==e?!1:e>=Dr.MIN_VALUE&&e<=Dr.MAX_VALUE}};Dr.MAX_VALUE=Math.pow(2,32)-1,Dr.MIN_VALUE=0,(0,tE.default)(Dr);var Vt={};Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.UnsignedHyper=void 0;var nE=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),ls=function r(e,t,n){e===null&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,t);if(i===void 0){var a=Object.getPrototypeOf(e);return a===null?void 0:r(a,t,n)}else{if("value"in i)return i.value;var o=i.get;return o===void 0?void 0:o.call(n)}},iE=os,Cr=ds(iE),aE=M,oE=ds(aE);function ds(r){return r&&r.__esModule?r:{default:r}}function uE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function sE(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function fE(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var Nr=Vt.UnsignedHyper=function(r){fE(e,r),nE(e,null,[{key:"read",value:function(n){var i=n.readInt32BE(),a=n.readInt32BE();return this.fromBits(a,i)}},{key:"write",value:function(n,i){if(!(n instanceof this))throw new Error("XDR Write Error: "+n+" is not an UnsignedHyper");i.writeInt32BE(n.high),i.writeInt32BE(n.low)}},{key:"fromString",value:function(n){if(!/^\d+$/.test(n))throw new Error("Invalid hyper string: "+n);var i=ls(e.__proto__||Object.getPrototypeOf(e),"fromString",this).call(this,n,!0);return new this(i.low,i.high)}},{key:"fromBits",value:function(n,i){var a=ls(e.__proto__||Object.getPrototypeOf(e),"fromBits",this).call(this,n,i,!0);return new this(a.low,a.high)}},{key:"isValid",value:function(n){return n instanceof this}}]);function e(t,n){return uE(this,e),sE(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!0))}return e}(Cr.default);(0,oE.default)(Nr),Nr.MAX_VALUE=new Nr(Cr.default.MAX_UNSIGNED_VALUE.low,Cr.default.MAX_UNSIGNED_VALUE.high),Nr.MIN_VALUE=new Nr(Cr.default.MIN_VALUE.low,Cr.default.MIN_VALUE.high);var Gt={};Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.Float=void 0;var cE=It,ps=hs(cE),lE=M,dE=hs(lE);function hs(r){return r&&r.__esModule?r:{default:r}}var pE=Gt.Float={read:function(e){return e.readFloatBE()},write:function(e,t){if(!(0,ps.default)(e))throw new Error("XDR Write Error: not a number");t.writeFloatBE(e)},isValid:function(e){return(0,ps.default)(e)}};(0,dE.default)(pE);var Ht={};Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.Double=void 0;var hE=It,ys=gs(hE),yE=M,gE=gs(yE);function gs(r){return r&&r.__esModule?r:{default:r}}var _E=Ht.Double={read:function(e){return e.readDoubleBE()},write:function(e,t){if(!(0,ys.default)(e))throw new Error("XDR Write Error: not a number");t.writeDoubleBE(e)},isValid:function(e){return(0,ys.default)(e)}};(0,gE.default)(_E);var Wt={};Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.Quadruple=void 0;var vE=M,mE=wE(vE);function wE(r){return r&&r.__esModule?r:{default:r}}var bE=Wt.Quadruple={read:function(){throw new Error("XDR Read Error: quadruple not supported")},write:function(){throw new Error("XDR Write Error: quadruple not supported")},isValid:function(){return!1}};(0,mE.default)(bE);var Br={},$E=_e,EE=ve,SE="[object Boolean]";function AE(r){return r===!0||r===!1||EE(r)&&$E(r)==SE}var OE=AE;Object.defineProperty(Br,"__esModule",{value:!0}),Br.Bool=void 0;var IE=OE,PE=vs(IE),_s=ce,xE=M,TE=vs(xE);function vs(r){return r&&r.__esModule?r:{default:r}}var RE=Br.Bool={read:function(e){var t=_s.Int.read(e);switch(t){case 0:return!1;case 1:return!0;default:throw new Error("XDR Read Error: Got "+t+" when trying to read a bool")}},write:function(e,t){var n=e?1:0;return _s.Int.write(n,t)},isValid:function(e){return(0,PE.default)(e)}};(0,TE.default)(RE);var zt={},FE=_e,ME=V,DE=ve,CE="[object String]";function NE(r){return typeof r=="string"||!ME(r)&&DE(r)&&FE(r)==CE}var ms=NE;Object.defineProperty(zt,"__esModule",{value:!0}),zt.String=void 0;var BE=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),qE=ms,ws=Mi(qE),UE=V,kE=Mi(UE),bs=ce,LE=Ce,$s=Me,jE=M,VE=Mi(jE);function Mi(r){return r&&r.__esModule?r:{default:r}}function GE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var HE=zt.String=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:LE.UnsignedInt.MAX_VALUE;GE(this,r),this._maxLength=e}return BE(r,[{key:"read",value:function(t){var n=bs.Int.read(t);if(n>this._maxLength)throw new Error("XDR Read Error: Saw "+n+" length String,"+("max allowed is "+this._maxLength));var i=(0,$s.calculatePadding)(n),a=t.slice(n);return(0,$s.slicePadding)(t,i),a.buffer()}},{key:"readString",value:function(t){return this.read(t).toString("utf8")}},{key:"write",value:function(t,n){if(t.length>this._maxLength)throw new Error("XDR Write Error: Got "+t.length+" bytes,"+("max allows is "+this._maxLength));var i=void 0;(0,ws.default)(t)?i=h.from(t,"utf8"):i=h.from(t),bs.Int.write(i.length,n),n.writeBufferPadded(i)}},{key:"isValid",value:function(t){var n=void 0;if((0,ws.default)(t))n=h.from(t,"utf8");else if((0,kE.default)(t)||h.isBuffer(t))n=h.from(t);else return!1;return n.length<=this._maxLength}}]),r}();(0,VE.default)(HE.prototype);var Xt={};Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.Opaque=void 0;var WE=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Es=Me,zE=M,XE=YE(zE);function YE(r){return r&&r.__esModule?r:{default:r}}function KE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var ZE=Xt.Opaque=function(){function r(e){KE(this,r),this._length=e,this._padding=(0,Es.calculatePadding)(e)}return WE(r,[{key:"read",value:function(t){var n=t.slice(this._length);return(0,Es.slicePadding)(t,this._padding),n.buffer()}},{key:"write",value:function(t,n){if(t.length!==this._length)throw new Error("XDR Write Error: Got "+t.length+" bytes, expected "+this._length);n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return h.isBuffer(t)&&t.length===this._length}}]),r}();(0,XE.default)(ZE.prototype);var Yt={};Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.VarOpaque=void 0;var JE=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Ss=ce,QE=Ce,As=Me,eS=M,rS=tS(eS);function tS(r){return r&&r.__esModule?r:{default:r}}function nS(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var iS=Yt.VarOpaque=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:QE.UnsignedInt.MAX_VALUE;nS(this,r),this._maxLength=e}return JE(r,[{key:"read",value:function(t){var n=Ss.Int.read(t);if(n>this._maxLength)throw new Error("XDR Read Error: Saw "+n+" length VarOpaque,"+("max allowed is "+this._maxLength));var i=(0,As.calculatePadding)(n),a=t.slice(n);return(0,As.slicePadding)(t,i),a.buffer()}},{key:"write",value:function(t,n){if(t.length>this._maxLength)throw new Error("XDR Write Error: Got "+t.length+" bytes,"+("max allows is "+this._maxLength));Ss.Int.write(t.length,n),n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return h.isBuffer(t)&&t.length<=this._maxLength}}]),r}();(0,rS.default)(iS.prototype);var Kt={};function aS(r,e){for(var t=-1,n=r==null?0:r.length;++t<n&&e(r[t],t,r)!==!1;);return r}var oS=aS,uS=xt;function sS(r){return typeof r=="function"?r:uS}var Os=sS,fS=oS,cS=vi,lS=Os,dS=V;function pS(r,e){var t=dS(r)?fS:cS;return t(r,lS(e))}var hS=pS,ar=hS,yS=/\s/;function gS(r){for(var e=r.length;e--&&yS.test(r.charAt(e)););return e}var _S=gS,vS=_S,mS=/^\s+/;function wS(r){return r&&r.slice(0,vS(r)+1).replace(mS,"")}var bS=wS,$S=bS,Is=Qe,ES=kt,Ps=0/0,SS=/^[-+]0x[0-9a-f]+$/i,AS=/^0b[01]+$/i,OS=/^0o[0-7]+$/i,IS=parseInt;function PS(r){if(typeof r=="number")return r;if(ES(r))return Ps;if(Is(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=Is(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=$S(r);var t=AS.test(r);return t||OS.test(r)?IS(r.slice(2),t?2:8):SS.test(r)?Ps:+r}var xS=PS,TS=xS,xs=1/0,RS=17976931348623157e292;function FS(r){if(!r)return r===0?r:0;if(r=TS(r),r===xs||r===-xs){var e=r<0?-1:1;return e*RS}return r===r?r:0}var MS=FS,DS=MS;function CS(r){var e=DS(r),t=e%1;return e===e?t?e-t:e:0}var NS=CS,BS=cu,qS=Os,US=NS,kS=9007199254740991,Di=4294967295,LS=Math.min;function jS(r,e){if(r=US(r),r<1||r>kS)return[];var t=Di,n=LS(r,Di);e=qS(e),r-=Di;for(var i=BS(n,e);++t<r;)e(t);return i}var Ts=jS;Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.Array=void 0;var VS=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),GS=Ri,HS=qr(GS),WS=ar,zS=qr(WS),XS=Ts,YS=qr(XS),KS=V,Rs=qr(KS),ZS=M,JS=qr(ZS);function qr(r){return r&&r.__esModule?r:{default:r}}function QS(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var eA=Kt.Array=function(){function r(e,t){QS(this,r),this._childType=e,this._length=t}return VS(r,[{key:"read",value:function(t){var n=this;return(0,YS.default)(this._length,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,Rs.default)(t))throw new Error("XDR Write Error: value is not array");if(t.length!==this._length)throw new Error("XDR Write Error: Got array of size "+t.length+","+("expected "+this._length));(0,zS.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,Rs.default)(t)||t.length!==this._length?!1:(0,HS.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,JS.default)(eA.prototype);var Zt={};Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.VarArray=void 0;var rA=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),tA=Ri,nA=Ur(tA),iA=ar,aA=Ur(iA),oA=Ts,uA=Ur(oA),sA=V,Fs=Ur(sA),fA=Ce,Ms=ce,cA=M,lA=Ur(cA);function Ur(r){return r&&r.__esModule?r:{default:r}}function dA(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var pA=Zt.VarArray=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:fA.UnsignedInt.MAX_VALUE;dA(this,r),this._childType=e,this._maxLength=t}return rA(r,[{key:"read",value:function(t){var n=this,i=Ms.Int.read(t);if(i>this._maxLength)throw new Error("XDR Read Error: Saw "+i+" length VarArray,"+("max allowed is "+this._maxLength));return(0,uA.default)(i,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,Fs.default)(t))throw new Error("XDR Write Error: value is not array");if(t.length>this._maxLength)throw new Error("XDR Write Error: Got array of size "+t.length+","+("max allowed is "+this._maxLength));Ms.Int.write(t.length,n),(0,aA.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,Fs.default)(t)||t.length>this._maxLength?!1:(0,nA.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,lA.default)(pA.prototype);var Jt={};function hA(r){return r===null}var yA=hA;function gA(r){return r===void 0}var kr=gA;Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.Option=void 0;var _A=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),vA=yA,Ds=Ci(vA),mA=kr,Cs=Ci(mA),Ns=Br,wA=M,bA=Ci(wA);function Ci(r){return r&&r.__esModule?r:{default:r}}function $A(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var EA=Jt.Option=function(){function r(e){$A(this,r),this._childType=e}return _A(r,[{key:"read",value:function(t){if(Ns.Bool.read(t))return this._childType.read(t)}},{key:"write",value:function(t,n){var i=!((0,Ds.default)(t)||(0,Cs.default)(t));Ns.Bool.write(i,n),i&&this._childType.write(t,n)}},{key:"isValid",value:function(t){return(0,Ds.default)(t)||(0,Cs.default)(t)?!0:this._childType.isValid(t)}}]),r}();(0,bA.default)(EA.prototype);var Lr={};Object.defineProperty(Lr,"__esModule",{value:!0}),Lr.Void=void 0;var SA=kr,Bs=qs(SA),AA=M,OA=qs(AA);function qs(r){return r&&r.__esModule?r:{default:r}}var IA=Lr.Void={read:function(){},write:function(e){if(!(0,Bs.default)(e))throw new Error("XDR Write Error: trying to write value to a void slot")},isValid:function(e){return(0,Bs.default)(e)}};(0,OA.default)(IA);var Qt={},PA=Ti;function xA(r,e){return PA(e,function(t){return r[t]})}var TA=xA,RA=TA,FA=Mt;function MA(r){return r==null?[]:RA(r,FA(r))}var DA=MA;Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.Enum=void 0;var CA=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),NA=ar,BA=Ni(NA),qA=DA,UA=Ni(qA),Us=ce,kA=M,LA=Ni(kA);function Ni(r){return r&&r.__esModule?r:{default:r}}function jA(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function VA(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}function ks(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var GA=Qt.Enum=function(){function r(e,t){ks(this,r),this.name=e,this.value=t}return CA(r,null,[{key:"read",value:function(t){var n=Us.Int.read(t);if(!this._byValue.has(n))throw new Error("XDR Read Error: Unknown "+this.enumName+" member for value "+n);return this._byValue.get(n)}},{key:"write",value:function(t,n){if(!(t instanceof this))throw new Error("XDR Write Error: Unknown "+t+" is not a "+this.enumName);Us.Int.write(t.value,n)}},{key:"isValid",value:function(t){return t instanceof this}},{key:"members",value:function(){return this._members}},{key:"values",value:function(){return(0,UA.default)(this._members)}},{key:"fromName",value:function(t){var n=this._members[t];if(!n)throw new Error(t+" is not a member of "+this.enumName);return n}},{key:"fromValue",value:function(t){var n=this._byValue.get(t);if(!n)throw new Error(t+" is not a value of any member of "+this.enumName);return n}},{key:"create",value:function(t,n,i){var a=function(o){VA(s,o);function s(){return ks(this,s),jA(this,(s.__proto__||Object.getPrototypeOf(s)).apply(this,arguments))}return s}(r);return a.enumName=n,t.results[n]=a,a._members={},a._byValue=new Map,(0,BA.default)(i,function(o,s){var f=new a(s,o);a._members[s]=f,a._byValue.set(o,f),a[s]=function(){return f}}),a}}]),r}();(0,LA.default)(GA);var en={},HA=vi,WA=Tr;function zA(r,e){var t=-1,n=WA(r)?Array(r.length):[];return HA(r,function(i,a,o){n[++t]=e(i,a,o)}),n}var XA=zA,YA=Ti,KA=Qu,ZA=XA,JA=V;function QA(r,e){var t=JA(r)?YA:ZA;return t(r,KA(e))}var eO=QA;function rO(r){for(var e=-1,t=r==null?0:r.length,n={};++e<t;){var i=r[e];n[i[0]]=i[1]}return n}var tO=rO,jr={};Object.defineProperty(jr,"__esModule",{value:!0});var nO=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();function iO(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}jr.Reference=function(){function r(){iO(this,r)}return nO(r,[{key:"resolve",value:function(){throw new Error("implement resolve in child class")}}]),r}(),Object.defineProperty(en,"__esModule",{value:!0}),en.Struct=void 0;var rn=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var s=e[Symbol.iterator](),f;!(i=(f=s.next()).done)&&(n.push(f.value),!(t&&n.length===t));i=!0);}catch(d){a=!0,o=d}finally{try{!i&&s.return&&s.return()}finally{if(a)throw o}}return n}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return r(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),aO=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),oO=ar,Ls=Vr(oO),uO=eO,sO=Vr(uO),fO=kr,cO=Vr(fO),lO=tO,dO=Vr(lO),pO=jr,hO=M,yO=Vr(hO);function Vr(r){return r&&r.__esModule?r:{default:r}}function gO(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function _O(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}function js(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var vO=en.Struct=function(){function r(e){js(this,r),this._attributes=e||{}}return aO(r,null,[{key:"read",value:function(t){var n=(0,sO.default)(this._fields,function(i){var a=rn(i,2),o=a[0],s=a[1],f=s.read(t);return[o,f]});return new this((0,dO.default)(n))}},{key:"write",value:function(t,n){if(!(t instanceof this))throw new Error("XDR Write Error: "+t+" is not a "+this.structName);(0,Ls.default)(this._fields,function(i){var a=rn(i,2),o=a[0],s=a[1],f=t._attributes[o];s.write(f,n)})}},{key:"isValid",value:function(t){return t instanceof this}},{key:"create",value:function(t,n,i){var a=function(o){_O(s,o);function s(){return js(this,s),gO(this,(s.__proto__||Object.getPrototypeOf(s)).apply(this,arguments))}return s}(r);return a.structName=n,t.results[n]=a,a._fields=i.map(function(o){var s=rn(o,2),f=s[0],d=s[1];return d instanceof pO.Reference&&(d=d.resolve(t)),[f,d]}),(0,Ls.default)(a._fields,function(o){var s=rn(o,1),f=s[0];a.prototype[f]=mO(f)}),a}}]),r}();(0,yO.default)(vO);function mO(r){return function(t){return(0,cO.default)(t)||(this._attributes[r]=t),this._attributes[r]}}var tn={};Object.defineProperty(tn,"__esModule",{value:!0}),tn.Union=void 0;var wO=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var s=e[Symbol.iterator](),f;!(i=(f=s.next()).done)&&(n.push(f.value),!(t&&n.length===t));i=!0);}catch(d){a=!0,o=d}finally{try{!i&&s.return&&s.return()}finally{if(a)throw o}}return n}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return r(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),bO=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),$O=ar,nn=on($O),EO=kr,Vs=on(EO),SO=ms,Gs=on(SO),an=Lr,Bi=jr,AO=M,OO=on(AO);function on(r){return r&&r.__esModule?r:{default:r}}function IO(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function PO(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}function Hs(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var xO=tn.Union=function(){function r(e,t){Hs(this,r),this.set(e,t)}return bO(r,[{key:"set",value:function(t,n){(0,Gs.default)(t)&&(t=this.constructor._switchOn.fromName(t)),this._switch=t,this._arm=this.constructor.armForSwitch(this._switch),this._armType=this.constructor.armTypeForArm(this._arm),this._value=n}},{key:"get",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this._arm;if(this._arm!==an.Void&&this._arm!==t)throw new Error(t+" not set");return this._value}},{key:"switch",value:function(){return this._switch}},{key:"arm",value:function(){return this._arm}},{key:"armType",value:function(){return this._armType}},{key:"value",value:function(){return this._value}}],[{key:"armForSwitch",value:function(t){if(this._switches.has(t))return this._switches.get(t);if(this._defaultArm)return this._defaultArm;throw new Error("Bad union switch: "+t)}},{key:"armTypeForArm",value:function(t){return t===an.Void?an.Void:this._arms[t]}},{key:"read",value:function(t){var n=this._switchOn.read(t),i=this.armForSwitch(n),a=this.armTypeForArm(i),o=void 0;return(0,Vs.default)(a)?o=i.read(t):o=a.read(t),new this(n,o)}},{key:"write",value:function(t,n){if(!(t instanceof this))throw new Error("XDR Write Error: "+t+" is not a "+this.unionName);this._switchOn.write(t.switch(),n),t.armType().write(t.value(),n)}},{key:"isValid",value:function(t){return t instanceof this}},{key:"create",value:function(t,n,i){var a=function(s){PO(f,s);function f(){return Hs(this,f),IO(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(r);a.unionName=n,t.results[n]=a,i.switchOn instanceof Bi.Reference?a._switchOn=i.switchOn.resolve(t):a._switchOn=i.switchOn,a._switches=new Map,a._arms={},(0,nn.default)(i.arms,function(s,f){s instanceof Bi.Reference&&(s=s.resolve(t)),a._arms[f]=s});var o=i.defaultArm;return o instanceof Bi.Reference&&(o=o.resolve(t)),a._defaultArm=o,(0,nn.default)(i.switches,function(s){var f=wO(s,2),d=f[0],c=f[1];(0,Gs.default)(d)&&(d=a._switchOn.fromName(d)),a._switches.set(d,c)}),(0,Vs.default)(a._switchOn.values)||(0,nn.default)(a._switchOn.values(),function(s){a[s.name]=function(f){return new a(s,f)},a.prototype[s.name]=function(d){return this.set(s,d)}}),(0,nn.default)(a._arms,function(s,f){s!==an.Void&&(a.prototype[f]=function(){return this.get(f)})}),a}}]),r}();(0,OO.default)(xO),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=ce;Object.keys(e).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return e[p]}})});var t=jt;Object.keys(t).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return t[p]}})});var n=Ce;Object.keys(n).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return n[p]}})});var i=Vt;Object.keys(i).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return i[p]}})});var a=Gt;Object.keys(a).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return a[p]}})});var o=Ht;Object.keys(o).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return o[p]}})});var s=Wt;Object.keys(s).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return s[p]}})});var f=Br;Object.keys(f).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return f[p]}})});var d=zt;Object.keys(d).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return d[p]}})});var c=Xt;Object.keys(c).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return c[p]}})});var u=Yt;Object.keys(u).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return u[p]}})});var l=Kt;Object.keys(l).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return l[p]}})});var y=Zt;Object.keys(y).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return y[p]}})});var m=Jt;Object.keys(m).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return m[p]}})});var E=Lr;Object.keys(E).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return E[p]}})});var S=Qt;Object.keys(S).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return S[p]}})});var O=en;Object.keys(O).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return O[p]}})});var $=tn;Object.keys($).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return $[p]}})})}(pi);var Ws={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=function(){function b(g,_){for(var A=0;A<_.length;A++){var P=_[A];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(g,P.key,P)}}return function(g,_,A){return _&&b(g.prototype,_),A&&b(g,A),g}}(),t=jr;Object.keys(t).forEach(function(b){b==="default"||b==="__esModule"||Object.defineProperty(r,b,{enumerable:!0,get:function(){return t[b]}})}),r.config=m;var n=kr,i=c(n),a=ar,o=c(a),s=pi,f=d(s);function d(b){if(b&&b.__esModule)return b;var g={};if(b!=null)for(var _ in b)Object.prototype.hasOwnProperty.call(b,_)&&(g[_]=b[_]);return g.default=b,g}function c(b){return b&&b.__esModule?b:{default:b}}function u(b,g){if(!(b instanceof g))throw new TypeError("Cannot call a class as a function")}function l(b,g){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:b}function y(b,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);b.prototype=Object.create(g&&g.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(b,g):b.__proto__=g)}function m(b){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(b){var _=new R(g);b(_),_.resolve()}return g}var E=function(b){y(g,b);function g(_){u(this,g);var A=l(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return A.name=_,A}return e(g,[{key:"resolve",value:function(A){var P=A.definitions[this.name];return P.resolve(A)}}]),g}(t.Reference),S=function(b){y(g,b);function g(_,A){var P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;u(this,g);var B=l(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return B.childReference=_,B.length=A,B.variable=P,B}return e(g,[{key:"resolve",value:function(A){var P=this.childReference,B=this.length;return P instanceof t.Reference&&(P=P.resolve(A)),B instanceof t.Reference&&(B=B.resolve(A)),this.variable?new f.VarArray(P,B):new f.Array(P,B)}}]),g}(t.Reference),O=function(b){y(g,b);function g(_){u(this,g);var A=l(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return A.childReference=_,A.name=_.name,A}return e(g,[{key:"resolve",value:function(A){var P=this.childReference;return P instanceof t.Reference&&(P=P.resolve(A)),new f.Option(P)}}]),g}(t.Reference),$=function(b){y(g,b);function g(_,A){u(this,g);var P=l(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return P.sizedType=_,P.length=A,P}return e(g,[{key:"resolve",value:function(A){var P=this.length;return P instanceof t.Reference&&(P=P.resolve(A)),new this.sizedType(P)}}]),g}(t.Reference),p=function(){function b(g,_,A){u(this,b),this.constructor=g,this.name=_,this.config=A}return e(b,[{key:"resolve",value:function(_){return this.name in _.results?_.results[this.name]:this.constructor(_,this.name,this.config)}}]),b}();function I(b,g,_){return _ instanceof t.Reference&&(_=_.resolve(b)),b.results[g]=_,_}function T(b,g,_){return b.results[g]=_,_}var R=function(){function b(g){u(this,b),this._destination=g,this._definitions={}}return e(b,[{key:"enum",value:function(_,A){var P=new p(f.Enum.create,_,A);this.define(_,P)}},{key:"struct",value:function(_,A){var P=new p(f.Struct.create,_,A);this.define(_,P)}},{key:"union",value:function(_,A){var P=new p(f.Union.create,_,A);this.define(_,P)}},{key:"typedef",value:function(_,A){var P=new p(I,_,A);this.define(_,P)}},{key:"const",value:function(_,A){var P=new p(T,_,A);this.define(_,P)}},{key:"void",value:function(){return f.Void}},{key:"bool",value:function(){return f.Bool}},{key:"int",value:function(){return f.Int}},{key:"hyper",value:function(){return f.Hyper}},{key:"uint",value:function(){return f.UnsignedInt}},{key:"uhyper",value:function(){return f.UnsignedHyper}},{key:"float",value:function(){return f.Float}},{key:"double",value:function(){return f.Double}},{key:"quadruple",value:function(){return f.Quadruple}},{key:"string",value:function(_){return new $(f.String,_)}},{key:"opaque",value:function(_){return new $(f.Opaque,_)}},{key:"varOpaque",value:function(_){return new $(f.VarOpaque,_)}},{key:"array",value:function(_,A){return new S(_,A)}},{key:"varArray",value:function(_,A){return new S(_,A,!0)}},{key:"option",value:function(_){return new O(_)}},{key:"define",value:function(_,A){if((0,i.default)(this._destination[_]))this._definitions[_]=A;else throw new Error("XDRTypes Error:"+_+" is already defined")}},{key:"lookup",value:function(_){return new E(_)}},{key:"resolve",value:function(){var _=this;(0,o.default)(this._definitions,function(A){A.resolve({definitions:_._definitions,results:_._destination})})}}]),b}()})(Ws),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=pi;Object.keys(e).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[n]}})});var t=Ws;Object.keys(t).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return t[n]}})})}(Ko);var qi=(r,e,t)=>{if(!e.has(r))throw TypeError("Cannot "+t)},L=(r,e,t)=>(qi(r,e,"read from private field"),t?t.call(r):e.get(r)),Ne=(r,e,t)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,t)},Ui=(r,e,t,n)=>(qi(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),me=(r,e,t)=>(qi(r,e,"access private method"),t),ie,ae,Gr,ki,zs,Li,Xs,un,ji,or,Hr;function TO(r){const e={variantId:de.Uint64.fromString(r.variantId.toString()),version:r.version||Math.floor(Date.now()/1e3),items:r.items.map(n=>new de.BundleItem({collectionId:de.Uint64.fromString(n.collectionId.toString()),productId:de.Uint64.fromString(n.productId.toString()),variantId:de.Uint64.fromString(n.variantId.toString()),sku:n.sku||"",quantity:n.quantity,ext:new de.BundleItemExt(0)})),ext:new de.BundleExt(0)},t=new de.Bundle(e);return de.BundleEnvelope.envelopeTypeBundle(t).toXDR("base64")}const de=Ko.config(r=>{r.enum("EnvelopeType",{envelopeTypeBundle:0}),r.typedef("Uint32",r.uint()),r.typedef("Uint64",r.uhyper()),r.union("BundleItemExt",{switchOn:r.int(),switchName:"v",switches:[[0,r.void()]],arms:{}}),r.struct("BundleItem",[["collectionId",r.lookup("Uint64")],["productId",r.lookup("Uint64")],["variantId",r.lookup("Uint64")],["sku",r.string()],["quantity",r.lookup("Uint32")],["ext",r.lookup("BundleItemExt")]]),r.union("BundleExt",{switchOn:r.int(),switchName:"v",switches:[[0,r.void()]],arms:{}}),r.struct("Bundle",[["variantId",r.lookup("Uint64")],["items",r.varArray(r.lookup("BundleItem"),500)],["version",r.lookup("Uint32")],["ext",r.lookup("BundleExt")]]),r.union("BundleEnvelope",{switchOn:r.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeBundle","v1"]],arms:{v1:r.lookup("Bundle")}})});class RO{constructor(e,t){Ne(this,ki),Ne(this,Li),Ne(this,un),Ne(this,or),Ne(this,ie,void 0),Ne(this,ae,void 0),Ne(this,Gr,void 0),Ui(this,ie,me(this,ki,zs).call(this,t)),Ui(this,Gr,me(this,Li,Xs).call(this,t)),Ui(this,ae,e)}isInitialDataValid(){if(!L(this,Gr))throw"Bundle data does not exist for the given product.";if(!L(this,ie))throw"Bundle settings do not exist for the given product.";if(!Array.isArray(L(this,ae))||!L(this,ae).length)throw"No bundle selection items provided.";return!0}isValidVariant(e){if(!L(this,ie)?.variantsSettings[e])throw`The ${e} bundle variant is invalid.`;return!0}isSelectionInVariantRange(e){const t=L(this,ae).reduce((i,a)=>i+a.quantity,0),n=L(this,ie)?.variantsSettings[e].ranges||[];if(!me(this,un,ji).call(this,n,t))throw"The total number of products does not fall within the required variant range.";return!0}areItemsInMaxPerItemBound(){const e=L(this,ie)?.bundleSettings.maxPerItem||0,t=L(this,ae).filter(({quantity:n})=>n>e);if(e&&t.length)throw`The selected products (${me(this,or,Hr).call(this,t.map(({externalProductId:n})=>n)).join(", ")}) exceed the maximum limit of ${e} items per product.`;return!0}areSelectedCollectionsValid(e){const t=L(this,ie)?.variantsSettings[e],n=L(this,ae).filter(({collectionId:i})=>!t?.optionSources[i]);if(n.length)throw`The collections (${me(this,or,Hr).call(this,n.map(({collectionId:i})=>i)).join(", ")}) are no longer valid for the bundle variant (${e}).`;return!0}areItemsQuantitiesValidForTheCollection(e){const t=L(this,ae).reduce((a,o)=>(a[o.collectionId]=o.quantity+(a[o.collectionId]||0),a),{}),n=L(this,ie)?.variantsSettings[e],i=Object.values(n?.optionSources||{}).filter(a=>{const o=t[a.collectionId]||0;return!me(this,un,ji).call(this,[a],o)});if(!n||i.length)throw`The selection exceeds the limits for the collections (${me(this,or,Hr).call(this,i.map(({collectionId:a})=>a)).join(", ")}).`;return!0}areSelectedProductsValid(e){const t=L(this,ie)?.variantsSettings[e]?.optionSources||{},n=Object.values(t).reduce((a,o)=>{const s=L(this,Gr)?.collections[o.collectionId];return s&&(a[o.collectionId]=s),a},{});if(!Object.values(n).length)throw`No collections found for the bundle variant (${e}).`;const i=L(this,ae).filter(({externalProductId:a,collectionId:o})=>!n[o]?.products[a]);if(i.length)throw`The products (${me(this,or,Hr).call(this,i.map(({externalProductId:a})=>a)).join(", ")}) are no longer valid for the bundle product.`;return!0}isBundleSelectionValid(e){return this.isInitialDataValid(),this.isValidVariant(e),this.isSelectionInVariantRange(e),this.areItemsInMaxPerItemBound(),this.areSelectedCollectionsValid(e),this.areItemsQuantitiesValidForTheCollection(e),this.areSelectedProductsValid(e),!0}}ie=new WeakMap,ae=new WeakMap,Gr=new WeakMap,ki=new WeakSet,zs=function(r){try{const e=r.bundle_settings;return{bundleSettings:{maxPerItem:e.max_quantity_per_variant,isCustomizable:e.is_customizable},variantsSettings:e.variants.reduce((t,n)=>{if(!n.enabled)return t;let i=[{min:n.items_count,max:n.items_count}];return n.items_count||(i=n.ranges.map(({quantity_max:a,quantity_min:o})=>({min:o,max:a}))),t[n.external_variant_id]={externalVariantId:n.external_variant_id,optionSources:n.option_sources.reduce((a,o)=>(a[o.option_source_id]={min:o.quantity_min,max:o.quantity_max,collectionId:o.option_source_id},a),{}),ranges:i},t},{})}}catch{return null}},Li=new WeakSet,Xs=function(r){try{const e=Object.values(r.collections).reduce((t,n)=>(t[n.id]={...n,products:n.products.reduce((i,a)=>(i[a.id]=a,i),{})},t),{});return{...r,collections:e}}catch{return null}},un=new WeakSet,ji=function(r,e){return!!r.filter(({min:t,max:n})=>{const i=t??e,a=n??e;return i<=e&&e<=a}).length},or=new WeakSet,Hr=function(r){return Array.from(new Set(r))};const FO="/bundling-storefront-manager";function Ys(r){return TO({variantId:r.externalVariantId,version:0,items:r.selections.map(e=>({collectionId:e.collectionId,productId:e.externalProductId,variantId:e.externalVariantId,quantity:e.quantity,sku:""}))})}async function MO(r){const e=j(),t=await Vi(r);if(t!==!0)throw new Error(t);const n=Ys(r);try{const i=await Re("post",`${FO}/api/v1/bundles`,{data:{bundle:n},headers:{Origin:`https://${e.storeIdentifier}`}});if(!i.id||i.code!==200)throw new Error(`1: failed generating rb_id: ${JSON.stringify(i)}`);return i.id}catch(i){throw new Error(`2: failed generating rb_id ${i}`)}}async function DO(r,e){const t=await Vi(e);if(t!==!0)throw new Error(t);const n=Ys(e);try{const i=await w("post","/bundle_selections/bundle_id",{data:{bundle:n}},v(r,"getBundleSelectionId"));if(!i.id||i.code!==200)throw new Error(`1: failed generating rb_id: ${JSON.stringify(i)}`);return i.id}catch(i){throw new Error(`2: failed generating rb_id ${i}`)}}function CO(r,e){const t=Ks(r);if(t!==!0)throw new Error(`Dynamic Bundle is invalid. ${t}`);const n=`${ya(9)}:${r.externalProductId}`;return r.selections.map(i=>{const a={id:i.externalVariantId,quantity:i.quantity,properties:{_rc_bundle:n,_rc_bundle_variant:r.externalVariantId,_rc_bundle_parent:e,_rc_bundle_collection_id:i.collectionId}};return i.sellingPlan?a.selling_plan=i.sellingPlan:i.shippingIntervalFrequency&&(a.properties.shipping_interval_frequency=i.shippingIntervalFrequency,a.properties.shipping_interval_unit_type=i.shippingIntervalUnitType,a.id=`${i.discountedVariantId}`),a})}async function Vi(r){try{return r?r.selections.length===0?"No selections defined":!0:"Bundle is not defined"}catch(e){return`Error fetching bundle settings: ${e}`}}async function NO(r){try{const e=await Re("get",`/bundle-data/${r.externalProductId}`);return{valid:new RO(r.selections,e).isBundleSelectionValid(r.externalVariantId)}}catch(e){return{valid:!1,error:String(e)}}}const BO={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 Ks(r){if(!r)return"No bundle defined.";if(r.selections.length===0)return"No selections defined.";const{shippingIntervalFrequency:e,shippingIntervalUnitType:t}=r.selections.find(n=>n.shippingIntervalFrequency||n.shippingIntervalUnitType)||{};if(e||t){if(!e||!t)return"Shipping intervals do not match on selections.";{const n=BO[t];for(let i=0;i<r.selections.length;i++){const{shippingIntervalFrequency:a,shippingIntervalUnitType:o}=r.selections[i];if(a&&a!==e||o&&!n.includes(o))return"Shipping intervals do not match on selections."}}}return!0}async function qO(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{bundle_selection:t}=await w("get","/bundle_selections",{id:e},v(r,"getBundleSelection"));return t}function UO(r,e){return w("get","/bundle_selections",{query:e},v(r,"listBundleSelections"))}async function kO(r,e){const{bundle_selection:t}=await w("post","/bundle_selections",{data:e},v(r,"createBundleSelection"));return t}async function LO(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{bundle_selection:n}=await w("put","/bundle_selections",{id:e,data:t},v(r,"updateBundleSelection"));return n}function jO(r,e){if(e===void 0||e==="")throw new Error("ID is required");return w("delete","/bundle_selections",{id:e},v(r,"deleteBundleSelection"))}async function VO(r,e,t,n){if(e===void 0||e==="")throw new Error("Purchase item ID is required");const{subscription:i}=await w("put","/bundles",{id:e,data:t,query:n},v(r,"updateBundle"));return i}var GO=Object.freeze({__proto__:null,createBundleSelection:kO,deleteBundleSelection:jO,getBundleId:MO,getBundleSelection:qO,getBundleSelectionId:DO,getDynamicBundleItems:CO,listBundleSelections:UO,updateBundle:VO,updateBundleSelection:LO,validateBundle:Vi,validateBundleSelection:NO,validateDynamicBundle:Ks});const HO=r=>{const e=r.layout_settings.addons,t=r.layout_settings.crossSells,n=r.customization_window,i=r.default_bundle_variant_id,a=r.layout_settings.defaultFrequency,o=r.layout_settings.addToCartCallback;return{default_variant_id:i?String(i):null,is_customizable:r.is_customizable,price_rule:String(r.price_rule).toUpperCase(),customization_window:n?{active_days:n,disabled_message:r.customization_window_disabled_message||""}:null,addons:e.collectionId?{collection_id:e.collectionId,collection_handle:e.collectionHandle}:null,cross_sells:t.collectionId?{collection_id:e.collectionId,collection_handle:e.collectionHandle}:null,default_selling_plan_id:a||null,collapsible_collections:r.layout_settings.collapsibleSections,max_quantity_per_variant:r.max_quantity_per_variant,show_product_variants:r.layout_settings.showVariants,product_details_modal_enabled:r.layout_settings.learnMoreModal,addToCartBehavior:{type:o.type==="none"?"cart_page":o.type,value:o.value}}},WO=r=>r.tiered_discounts.length===0?null:{tiered_discounts:r.tiered_discounts.map(e=>({eligible_charge_types:e.eligible_charge_types,eligible_line_item_types:e.eligible_line_item_types,external_bundle_product_id:{ecommerce:e.external_bundle_product_id.ecommerce},lookup_key:e.lookup_key,name:e.name,status:e.status,tiers:e.tiers.map(({tier:t})=>({tier:{lookup_key:t.lookup_key,discount_type:t.discount_type,discount_value:t.discount_value,condition_quantity_gte:t.condition_quantity_gte}}))}))},sn=r=>({id:r.id,name:r.name,options:r.options.map(e=>({name:e.name,value:e.value})),recurring_deliveries:r.recurring_deliveries,price_adjustments:r.price_adjustments.map(({value:e,value_type:t})=>({value:e,value_type:t}))}),Zs=r=>({name:r.name,options:r.options.map(e=>({name:e.name,values:e.values})),selling_plans:r.selling_plans.map(sn)}),Js=r=>({id:String(r.id),title:r.title,price:r.price,compare_at_price:r.compare_at_price,options:r.options,available_for_sale:r.available}),Gi=r=>r==null||typeof r=="string"?r:"src"in r?r.src:null,Qs=r=>({id:String(r.id),title:r.title,description:r.description,available_for_sale:r.available,featured_image:Gi(r.featured_image),images:r.images,requires_selling_plan:r.requires_selling_plan,selling_plan_groups:r.selling_plan_groups.map(Zs)}),ef=r=>{const e=XO(r.selling_plan_groups);return{...Qs(r),handle:r.handle,tags:r.tags,price_range:{min:r.price_min,max:r.price_max},compare_at_price_range:{min:r.compare_at_price_min,max:r.compare_at_price_max},options:r.options,variants:r.variants.map(t=>({...Js(t),selling_plan_allocations:t.selling_plan_allocations.map(n=>({price:n.price,compare_at_price:n.compare_at_price,selling_plan:sn(e[`${n.selling_plan_group_id}-${n.selling_plan_id}`])})),option1:t.option1,option2:t.option2,option3:t.option3,sku:t.sku||"",requires_shipping:t.requires_shipping,taxable:t.taxable,featured_image:Gi(t.featured_image),public_title:t.public_title,requires_selling_plan:t.requires_selling_plan}))}},zO=({items_count:r,ranges:e})=>e.length>0?e.map(({quantity_max:t,quantity_min:n})=>({min:n,max:t})):[{min:r,max:r}],XO=r=>r.reduce((e,t)=>(t.selling_plans.forEach(n=>{const i=`${t.id}-${n.id}`;e[i]=n}),e),{});function Hi(r){const e=HO(r.bundle_settings),t=r.variants.reduce((n,i)=>(n[i.id]=i,n),{});return{id:String(r.id),title:r.title,handle:r.handle,options:r.options.map(n=>({name:n.name,position:n.position,values:n.values})),default_variant_id:e.default_variant_id,default_selling_plan_id:e.default_selling_plan_id?Number(e.default_selling_plan_id):null,available_for_sale:r.available,requires_selling_plan:r.requires_selling_plan,bundle_settings:{is_customizable:e.is_customizable,price_rule:e.price_rule,customization_window:e.customization_window,max_quantity_per_variant:e.max_quantity_per_variant,collapsible_collections:e.collapsible_collections,show_product_variants:e.show_product_variants,product_details_modal_enabled:e.product_details_modal_enabled,show_variants_as_individual_products:r.bundle_settings.settings.display_variants_as_separate_products_in_list,post_add_to_cart_behavior:e.addToCartBehavior},variants:r.bundle_settings.variants.filter(({enabled:n})=>n).map((n,i)=>{const a=t[String(n.external_variant_id)];return{id:String(n.external_variant_id),title:a.title,price:a.price,compare_at_price:a.compare_at_price,image:a.image||"",available_for_sale:a.available,options:a.options,requires_selling_plan:a.requires_selling_plan,selling_plan_allocations:a.selling_plan_allocations.map(o=>({price:o.price,compare_at_price:o.compare_at_price,selling_plan:sn(o.selling_plan)})),ranges:zO(n),collections:n.option_sources.map(o=>({id:o.option_source_id,source_platform:"shopify",min:o.quantity_min||0,max:o.quantity_max,position:o.position})),default_selections:n.selection_defaults.map(o=>({quantity:o.quantity,product:{id:String(o.product.id),handle:o.handle,title:o.product.title,description:o.product.description,images:o.product.images},variant:{id:o.external_variant_id,title:o.variant.title,featured_image:Gi(o.variant.featured_image),sku:o.sku||""}})),position:i}}),selling_plan_groups:r.selling_plan_groups.map(Zs),collections:Object.values(r.collections).reduce((n,i)=>(Array.isArray(i.products)&&(n[String(i.id)]={id:String(i.id),title:i.title,handle:i.handle,products:i.products.map(ef)}),n),{}),addons:r.addons.products.length?{collection_id:e.addons?.collection_id||"",collection_handle:e.addons?.collection_handle||"",products:r.addons.products.map(n=>({...Qs(n),price_range:{min:n.price,max:n.price},compare_at_price_range:{min:n.compare_at_price||0,max:n.compare_at_price},variants:n.variants.map(i=>({...Js(i),image:i.image,selling_plan_allocations:i.selling_plan_allocations.map(a=>({price:a.price,compare_at_price:a.compare_at_price,selling_plan:sn(a.selling_plan)}))}))}))}:null,cross_sells:r.cross_sells.products.length?{collection_id:e.cross_sells?.collection_id||"",collection_handle:e.cross_sells?.collection_handle||"",products:r.cross_sells.products.map(ef)}:null,incentives:WO(r.incentives)}}async function YO(r,e){return e?.source==="shopify_storefront"?ZO():KO(r,e?.country_code)}async function KO(r,e){const{appName:t,appVersion:n}=j(),i={"X-Recharge-Sdk-Fn":"loadFromOnlineStore","X-Recharge-Sdk-Version":"1.68.1",...t?{"X-Recharge-Sdk-App-Name":t}:{},...n?{"X-Recharge-Sdk-App-Version":n}:{}};if(!e){const o=await Re("get",`/bundle-data/${r}`,{headers:i});return Hi(o)}const a=new FormData;a.append("form_type","localization"),a.append("_method","put"),a.append("return_to",`${Xo}/bundle-data/${r}`),a.append("country_code",e);try{const o=await X("post","/localization",{headers:{"Content-Type":"multipart/form-data",...i},data:a});return Hi(o)}catch{const o=await Re("get",`/bundle-data/${r}`,{headers:i});return Hi(o)}}async function ZO(r,e){if(!j().storeIdentifier)throw new Error("Store identifier is required for Shopify Storefront API requests");return{}}var JO=Object.freeze({__proto__:null,loadBundleData:YO}),QO=200,Wi="__lodash_hash_undefined__",eI=1/0,rf=9007199254740991,rI="[object Arguments]",tI="[object Function]",nI="[object GeneratorFunction]",iI="[object Symbol]",aI=/[\\^$.*+?()[\]{}|]/g,oI=/^\[object .+?Constructor\]$/,uI=/^(?:0|[1-9]\d*)$/,sI=typeof D=="object"&&D&&D.Object===Object&&D,fI=typeof self=="object"&&self&&self.Object===Object&&self,zi=sI||fI||Function("return this")();function cI(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}function lI(r,e){var t=r?r.length:0;return!!t&&hI(r,e,0)>-1}function dI(r,e,t){for(var n=-1,i=r?r.length:0;++n<i;)if(t(e,r[n]))return!0;return!1}function tf(r,e){for(var t=-1,n=r?r.length:0,i=Array(n);++t<n;)i[t]=e(r[t],t,r);return i}function Xi(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}function pI(r,e,t,n){for(var i=r.length,a=t+(n?1:-1);n?a--:++a<i;)if(e(r[a],a,r))return a;return-1}function hI(r,e,t){if(e!==e)return pI(r,yI,t);for(var n=t-1,i=r.length;++n<i;)if(r[n]===e)return n;return-1}function yI(r){return r!==r}function gI(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}function _I(r){return function(e){return r(e)}}function vI(r,e){return r.has(e)}function mI(r,e){return r?.[e]}function wI(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch{}return e}function nf(r,e){return function(t){return r(e(t))}}var bI=Array.prototype,$I=Function.prototype,fn=Object.prototype,Yi=zi["__core-js_shared__"],af=function(){var r=/[^.]+$/.exec(Yi&&Yi.keys&&Yi.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),of=$I.toString,ur=fn.hasOwnProperty,Ki=fn.toString,EI=RegExp("^"+of.call(ur).replace(aI,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),uf=zi.Symbol,SI=nf(Object.getPrototypeOf,Object),AI=fn.propertyIsEnumerable,OI=bI.splice,sf=uf?uf.isConcatSpreadable:void 0,Zi=Object.getOwnPropertySymbols,ff=Math.max,II=lf(zi,"Map"),Wr=lf(Object,"create");function Be(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}function PI(){this.__data__=Wr?Wr(null):{}}function xI(r){return this.has(r)&&delete this.__data__[r]}function TI(r){var e=this.__data__;if(Wr){var t=e[r];return t===Wi?void 0:t}return ur.call(e,r)?e[r]:void 0}function RI(r){var e=this.__data__;return Wr?e[r]!==void 0:ur.call(e,r)}function FI(r,e){var t=this.__data__;return t[r]=Wr&&e===void 0?Wi:e,this}Be.prototype.clear=PI,Be.prototype.delete=xI,Be.prototype.get=TI,Be.prototype.has=RI,Be.prototype.set=FI;function sr(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}function MI(){this.__data__=[]}function DI(r){var e=this.__data__,t=ln(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():OI.call(e,t,1),!0}function CI(r){var e=this.__data__,t=ln(e,r);return t<0?void 0:e[t][1]}function NI(r){return ln(this.__data__,r)>-1}function BI(r,e){var t=this.__data__,n=ln(t,r);return n<0?t.push([r,e]):t[n][1]=e,this}sr.prototype.clear=MI,sr.prototype.delete=DI,sr.prototype.get=CI,sr.prototype.has=NI,sr.prototype.set=BI;function fr(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}function qI(){this.__data__={hash:new Be,map:new(II||sr),string:new Be}}function UI(r){return dn(this,r).delete(r)}function kI(r){return dn(this,r).get(r)}function LI(r){return dn(this,r).has(r)}function jI(r,e){return dn(this,r).set(r,e),this}fr.prototype.clear=qI,fr.prototype.delete=UI,fr.prototype.get=kI,fr.prototype.has=LI,fr.prototype.set=jI;function cn(r){var e=-1,t=r?r.length:0;for(this.__data__=new fr;++e<t;)this.add(r[e])}function VI(r){return this.__data__.set(r,Wi),this}function GI(r){return this.__data__.has(r)}cn.prototype.add=cn.prototype.push=VI,cn.prototype.has=GI;function HI(r,e){var t=Ji(r)||df(r)?gI(r.length,String):[],n=t.length,i=!!n;for(var a in r)(e||ur.call(r,a))&&!(i&&(a=="length"||nP(a,n)))&&t.push(a);return t}function ln(r,e){for(var t=r.length;t--;)if(cP(r[t][0],e))return t;return-1}function WI(r,e,t,n){var i=-1,a=lI,o=!0,s=r.length,f=[],d=e.length;if(!s)return f;t&&(e=tf(e,_I(t))),n?(a=dI,o=!1):e.length>=QO&&(a=vI,o=!1,e=new cn(e));e:for(;++i<s;){var c=r[i],u=t?t(c):c;if(c=n||c!==0?c:0,o&&u===u){for(var l=d;l--;)if(e[l]===u)continue e;f.push(c)}else a(e,u,n)||f.push(c)}return f}function cf(r,e,t,n,i){var a=-1,o=r.length;for(t||(t=tP),i||(i=[]);++a<o;){var s=r[a];e>0&&t(s)?e>1?cf(s,e-1,t,n,i):Xi(i,s):n||(i[i.length]=s)}return i}function zI(r,e,t){var n=e(r);return Ji(r)?n:Xi(n,t(r))}function XI(r){if(!Qi(r)||aP(r))return!1;var e=hf(r)||wI(r)?EI:oI;return e.test(fP(r))}function YI(r){if(!Qi(r))return uP(r);var e=oP(r),t=[];for(var n in r)n=="constructor"&&(e||!ur.call(r,n))||t.push(n);return t}function KI(r,e){return r=Object(r),ZI(r,e,function(t,n){return n in r})}function ZI(r,e,t){for(var n=-1,i=e.length,a={};++n<i;){var o=e[n],s=r[o];t(s,o)&&(a[o]=s)}return a}function JI(r,e){return e=ff(e===void 0?r.length-1:e,0),function(){for(var t=arguments,n=-1,i=ff(t.length-e,0),a=Array(i);++n<i;)a[n]=t[e+n];n=-1;for(var o=Array(e+1);++n<e;)o[n]=t[n];return o[e]=a,cI(r,this,o)}}function QI(r){return zI(r,hP,rP)}function dn(r,e){var t=r.__data__;return iP(e)?t[typeof e=="string"?"string":"hash"]:t.map}function lf(r,e){var t=mI(r,e);return XI(t)?t:void 0}var eP=Zi?nf(Zi,Object):gf,rP=Zi?function(r){for(var e=[];r;)Xi(e,eP(r)),r=SI(r);return e}:gf;function tP(r){return Ji(r)||df(r)||!!(sf&&r&&r[sf])}function nP(r,e){return e=e??rf,!!e&&(typeof r=="number"||uI.test(r))&&r>-1&&r%1==0&&r<e}function iP(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}function aP(r){return!!af&&af in r}function oP(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||fn;return r===t}function uP(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}function sP(r){if(typeof r=="string"||pP(r))return r;var e=r+"";return e=="0"&&1/r==-eI?"-0":e}function fP(r){if(r!=null){try{return of.call(r)}catch{}try{return r+""}catch{}}return""}function cP(r,e){return r===e||r!==r&&e!==e}function df(r){return lP(r)&&ur.call(r,"callee")&&(!AI.call(r,"callee")||Ki.call(r)==rI)}var Ji=Array.isArray;function pf(r){return r!=null&&dP(r.length)&&!hf(r)}function lP(r){return yf(r)&&pf(r)}function hf(r){var e=Qi(r)?Ki.call(r):"";return e==tI||e==nI}function dP(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=rf}function Qi(r){var e=typeof r;return!!r&&(e=="object"||e=="function")}function yf(r){return!!r&&typeof r=="object"}function pP(r){return typeof r=="symbol"||yf(r)&&Ki.call(r)==iI}function hP(r){return pf(r)?HI(r,!0):YI(r)}var yP=JI(function(r,e){return r==null?{}:(e=tf(cf(e,1),sP),KI(r,WI(QI(r),e)))});function gf(){return[]}var gP=yP,ea=we(gP);function _P(r){try{return JSON.parse(r)}catch{return r}}function vP(r){return Object.entries(r).reduce((e,[t,n])=>({...e,[t]:_P(n)}),{})}const _f=r=>typeof r=="string"?r!=="0"&&r!=="false":!!r;function vf(r){const e=vP(r),t=e.auto_inject===void 0?!0:e.auto_inject,n=e.display_on??[],i=e.first_option==="autodeliver";return{...ea(e,["display_on","first_option"]),auto_inject:t,valid_pages:n,is_subscription_first:i,autoInject:t,validPages:n,isSubscriptionFirst:i}}function mf(r){const e=r.subscription_options?.storefront_purchase_options==="subscription_only";return{...r,is_subscription_only:e,isSubscriptionOnly:e}}function mP(r){return r.map(e=>{const t={};return Object.entries(e).forEach(([n,i])=>{t[n]=mf(i)}),t})}const ra="2020-12",wP={store_currency:{currency_code:"USD",currency_symbol:"$",decimal_separator:".",thousands_separator:",",currency_symbol_location:"left"}},zr=new Map;function pn(r,e){return zr.has(r)||zr.set(r,e()),zr.get(r)}async function ta(r,e){if(r===void 0||r==="")throw new Error("ID is required");const t=e?.version??"2020-12",{product:n}=await pn(`product.${r}.${t}`,()=>At("get",`/product/${t}/${r}.json`));return t==="2020-12"?mf(n):n}async function wf(){return await pn("storeSettings",()=>At("get",`/${ra}/store_settings.json`).catch(()=>wP))}async function bf(){const{widget_settings:r}=await pn("widgetSettings",()=>At("get",`/${ra}/widget_settings.json`));return vf(r)}async function $f(){const{products:r,widget_settings:e,store_settings:t,meta:n}=await pn("productsAndSettings",()=>At("get",`/product/${ra}/products.json`));return n?.status==="error"?Promise.reject(n.message):{products:mP(r),widget_settings:vf(e),store_settings:t??{}}}async function bP(){const{products:r}=await $f();return r}async function $P(r){const[e,t,n]=await Promise.all([ta(r),wf(),bf()]);return{product:e,store_settings:t,widget_settings:n,storeSettings:t,widgetSettings:n}}async function EP(r){const{bundle_product:e}=await ta(r);return e}async function Ef(){return Array.from(zr.keys()).forEach(r=>zr.delete(r))}var SP=Object.freeze({__proto__:null,getCDNBundleSettings:EP,getCDNProduct:ta,getCDNProductAndSettings:$P,getCDNProducts:bP,getCDNProductsAndSettings:$f,getCDNStoreSettings:wf,getCDNWidgetSettings:bf,resetCDNCache:Ef});async function AP(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{charge:n}=await w("get","/charges",{id:e,query:{include:t?.include}},v(r,"getCharge"));return n}function OP(r,e){return w("get","/charges",{query:e},v(r,"listCharges"))}async function IP(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{charge:n}=await w("post",`/charges/${e}/apply_discount`,{data:{discount_code:t}},v(r,"applyDiscountToCharge"));return n}async function PP(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{charge:t}=await w("post",`/charges/${e}/remove_discount`,{},v(r,"removeDiscountsFromCharge"));return t}async function xP(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");if(t===void 0||t.length===0)throw new Error("Purchase item IDs are required");const{charge:i}=await w("post",`/charges/${e}/skip`,{query:n,data:{purchase_item_ids:t.map(a=>Number(a))}},v(r,"skipCharge"));return i}async function TP(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");if(t===void 0||t.length===0)throw new Error("Purchase item IDs are required");const{charge:i}=await w("post",`/charges/${e}/unskip`,{query:n,data:{purchase_item_ids:t.map(a=>Number(a))}},v(r,"unskipCharge"));return i}async function RP(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{charge:t}=await w("post",`/charges/${e}/process`,{},v(r,"processCharge"));return t}async function FP(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{charge:n}=await w("post",`/charges/${e}/change_next_charge_date`,{data:{next_charge_date:t}},v(r,"rescheduleCharge"));return n}var MP=Object.freeze({__proto__:null,applyDiscountToCharge:IP,getCharge:AP,listCharges:OP,processCharge:RP,removeDiscountsFromCharge:PP,rescheduleCharge:FP,skipCharge:xP,unskipCharge:TP});async function Sf(r,e){if(!["2020-12","2022-06"].includes(e.format_version))throw new Error("Missing or unsupported format_version.");return w("get","/product_search",{query:e,headers:{"X-Recharge-Version":"2021-01"}},v(r,"productSearch"))}var DP=Object.freeze({__proto__:null,productSearch:Sf});async function Af(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{collection:t}=await w("get","/collections",{id:e},v(r,"getCollection"));return t}function CP(r,e){return w("get","/collections",{query:e},v(r,"listCollections"))}async function NP(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");if(!["2020-12","2022-06"].includes(t.format_version))throw new Error("Missing or unsupported format_version.");const n=v(r,"listCollectionProducts"),[{sort_order:i,manual_sort_order:a},{products:o}]=await Promise.all([Af(n,e),Sf(n,{...t,collection_ids:[e],limit:250})]);if(i==="manual")return{products:a.reduce((s,f)=>{const d=o.find(c=>c.external_product_id===f);return d&&s.push(d),s},[])};{const s=BP(i);return{products:o.slice().sort(s)}}}function Of(r,e){const t=r.external_created_at,n=e.external_created_at;return t<n?-1:n>t?1:0}function If(r,e){const t=r.external_product_id,n=e.external_product_id;return t<n?-1:n>t?1:0}function Pf(r,e){const t=r.title.toLowerCase(),n=e.title.toLowerCase();return t<n?-1:n>t?1:0}function BP(r){switch(r){case"created_at-asc":return Of;case"created_at-desc":return(e,t)=>Of(t,e);case"id-asc":return If;case"id-desc":return(e,t)=>If(t,e);case"title-asc":return Pf;case"title-desc":return(e,t)=>Pf(t,e)}}var qP=Object.freeze({__proto__:null,getCollection:Af,listCollectionProducts:NP,listCollections:CP});async function UP(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await w("get","/customers",{id:t,query:{include:e?.include}},v(r,"getCustomer"));return n}async function xf(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await w("put","/customers",{id:t,data:e},v(r,"updateCustomer"));return n}async function kP(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{deliveries:n}=await w("get",`/customers/${t}/delivery_schedule`,{query:e},v(r,"getDeliverySchedule"));return n}async function hn(r,e){return w("get","/portal_access",{query:e},v(r,"getCustomerPortalAccess"))}async function LP(r,e,t){if(e===void 0||e==="")throw new Error("Subscription ID is required");const{base_url:n,customer_hash:i,temp_token:a}=await hn(v(r,"getActiveChurnLandingPageURL"));return`${n.replace("portal","pages")}${i}/subscriptions/${e}/cancel?token=${a}&subscription=${e}&redirect_to=${t}`}async function jP(r){const{base_url:e,customer_hash:t,temp_token:n}=await hn(v(r,"getFailedPaymentMethodRecoveryLandingPageURL"));return`${e.replace("portal","pages")}account/payment-methods?token=${n}&hash=${t}`}async function VP(r,e,t){if(e===void 0||e==="")throw new Error("Gift ID is required");const{base_url:n,customer_hash:i,temp_token:a}=await hn(v(r,"getGiftRedemptionLandingPageURL"));return`${n.replace("portal","pages")}${i}/gifts/${e}?token=${a}&redirect_to=${t}`}const GP={SHOPIFY_UPDATE_PAYMENT_INFO:{type:"email",template_type:"shopify_update_payment_information"},SHOPIFY_MIGRATE_PAYMENT_INFO:{type:"email",template_type:"shopify_migrate_payment_information"}};async function HP(r,e,t){const n=r.customerId;if(!n)throw new Error("Not logged in.");const i=GP[e];if(!i)throw new Error("Notification not supported.");return w("post",`/customers/${n}/notifications`,{data:{...i,template_vars:t}},v(r,"sendCustomerNotification"))}async function WP(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{credit_summary:n}=await w("get",`/customers/${t}/credit_summary`,{query:{include:e?.include}},v(r,"getCreditSummary"));return n}var zP=Object.freeze({__proto__:null,getActiveChurnLandingPageURL:LP,getCreditSummary:WP,getCustomer:UP,getCustomerPortalAccess:hn,getDeliverySchedule:kP,getFailedPaymentMethodRecoveryLandingPageURL:jP,getGiftRedemptionLandingPageURL:VP,sendCustomerNotification:HP,updateCustomer:xf});async function XP(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{credit_summary:n}=await w("get",`/customers/${t}/credit_summary`,{query:{include:e?.include,presentment_currency_code:e?.presentment_currency_code}},v(r,"getCreditSummary"));return n}function YP(r,{recurring:e}){if(!r.customerId)throw new Error("Not logged in.");const t={};return e!==void 0&&(t.apply_credit_to_next_recurring_charge=e),xf(v(r,"setApplyCreditsToNextCharge"),t)}async function KP(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");return await w("get","/credit_accounts",{query:{customer_id:t,...e}},v(r,"listCreditAccounts"))}var ZP=Object.freeze({__proto__:null,getCreditSummary:XP,listCreditAccounts:KP,setApplyCreditsToNextCharge:YP});async function JP(r,e,t){return await w("post","/customer_surveys/cancellation_prevention",{data:{customer_id:e,subscription_id:t}},v(r,"getCustomerSurveyReasons"))}async function QP(r,e,t,n){return await w("post",`/customer_surveys/${t}/customer_response`,{data:{customer_id:e,response_id:n}},v(r,"getCustomerSurveyOffers"))}async function ex(r,e){return await w("post","/offers/claim",{data:e},v(r,"claimOfferCustomerSurvey")),{}}var rx=Object.freeze({__proto__:null,claimOfferCustomerSurvey:ex,getCustomerSurveyOffers:QP,getCustomerSurveyReasons:JP});function tx(r,e){if(!r.customerId)throw new Error("Not logged in.");return w("get","/gift_purchases",{query:e},v(r,"listGiftPurchases"))}async function nx(r,e){if(!r.customerId)throw new Error("Not logged in.");if(e===void 0||e==="")throw new Error("ID is required");const{gift_purchase:t}=await w("get","/gift_purchases",{id:e},v(r,"getGiftPurchase"));return t}var ix=Object.freeze({__proto__:null,getGiftPurchase:nx,listGiftPurchases:tx});async function ax(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{membership:t}=await w("get","/memberships",{id:e},v(r,"getMembership"));return t}function ox(r,e){return w("get","/memberships",{query:e},v(r,"listMemberships"))}async function ux(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{membership:n}=await w("post",`/memberships/${e}/cancel`,{data:t},v(r,"cancelMembership"));return n}async function sx(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{membership:n}=await w("post",`/memberships/${e}/activate`,{data:t},v(r,"activateMembership"));return n}async function fx(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{membership:n}=await w("post",`/memberships/${e}/change`,{data:t},v(r,"changeMembership"));return n}var cx=Object.freeze({__proto__:null,activateMembership:sx,cancelMembership:ux,changeMembership:fx,getMembership:ax,listMemberships:ox});async function lx(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{membership_program:n}=await w("get","/membership_programs",{id:e,query:{include:t?.include}},v(r,"getMembershipProgram"));return n}function dx(r,e){return w("get","/membership_programs",{query:e},v(r,"listMembershipPrograms"))}var px=Object.freeze({__proto__:null,getMembershipProgram:lx,listMembershipPrograms:dx});async function hx(r,e){const{metafield:t}=await w("post","/metafields",{data:{metafield:e}},v(r,"createMetafield"));return t}async function yx(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{metafield:n}=await w("put","/metafields",{id:e,data:{metafield:t}},v(r,"updateMetafield"));return n}function gx(r,e){if(e===void 0||e==="")throw new Error("ID is required");return w("delete","/metafields",{id:e},v(r,"deleteMetafield"))}var _x=Object.freeze({__proto__:null,createMetafield:hx,deleteMetafield:gx,updateMetafield:yx});async function vx(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{onetime:t}=await w("get","/onetimes",{id:e},v(r,"getOnetime"));return t}function mx(r,e){return w("get","/onetimes",{query:e},v(r,"listOnetimes"))}async function wx(r,e){const{onetime:t}=await w("post","/onetimes",{data:e},v(r,"createOnetime"));return t}async function bx(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{onetime:n}=await w("put","/onetimes",{id:e,data:t},v(r,"updateOnetime"));return n}function $x(r,e){if(e===void 0||e==="")throw new Error("ID is required");return w("delete","/onetimes",{id:e},v(r,"deleteOnetime"))}var Ex=Object.freeze({__proto__:null,createOnetime:wx,deleteOnetime:$x,getOnetime:vx,listOnetimes:mx,updateOnetime:bx});async function Sx(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{order:t}=await w("get","/orders",{id:e},v(r,"getOrder"));return t}function Ax(r,e){return w("get","/orders",{query:e},v(r,"listOrders"))}async function Ox(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{order:t}=await w("post",`/orders/${e}/delay`,{},v(r,"delayOrder"));return t}var Ix=Object.freeze({__proto__:null,delayOrder:Ox,getOrder:Sx,listOrders:Ax});async function Px(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{payment_method:n}=await w("get","/payment_methods",{id:e,query:{include:t?.include}},v(r,"getPaymentMethod"));return n}async function xx(r,e){const{payment_method:t}=await w("post","/payment_methods",{data:{...e,customer_id:r.customerId}},v(r,"createPaymentMethod"));return t}async function Tx(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{payment_method:n}=await w("put","/payment_methods",{id:e,data:t},v(r,"updatePaymentMethod"));return n}function Rx(r,e){return w("get","/payment_methods",{query:e},v(r,"listPaymentMethods"))}var Fx=Object.freeze({__proto__:null,createPaymentMethod:xx,getPaymentMethod:Px,listPaymentMethods:Rx,updatePaymentMethod:Tx});async function Mx(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{plan:t}=await w("get","/plans",{id:e},v(r,"getPlan"));return t}function Dx(r,e){return w("get","/plans",{query:e},v(r,"listPlans"))}var Cx=Object.freeze({__proto__:null,getPlan:Mx,listPlans:Dx});async function Nx(r,e){return await w("get","/shop/shipping_countries",{query:e,headers:{"X-Recharge-Version":"2021-01"}},v(r,"getShippingCountries"))}async function Bx(r){return await w("get","/shop/settings",{headers:{"X-Recharge-Version":"2021-01"}},v(r,"getStoreSettings"))}var qx=Object.freeze({__proto__:null,getShippingCountries:Nx,getStoreSettings:Bx}),Ux="Expected a function",Tf="__lodash_placeholder__",qe=1,yn=2,kx=4,cr=8,Xr=16,Ue=32,Yr=64,Rf=128,Lx=256,Ff=512,Mf=1/0,jx=9007199254740991,Vx=17976931348623157e292,Df=0/0,Gx=[["ary",Rf],["bind",qe],["bindKey",yn],["curry",cr],["curryRight",Xr],["flip",Ff],["partial",Ue],["partialRight",Yr],["rearg",Lx]],Hx="[object Function]",Wx="[object GeneratorFunction]",zx="[object Symbol]",Xx=/[\\^$.*+?()[\]{}|]/g,Yx=/^\s+|\s+$/g,Kx=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Zx=/\{\n\/\* \[wrapped with (.+)\] \*/,Jx=/,? & /,Qx=/^[-+]0x[0-9a-f]+$/i,e2=/^0b[01]+$/i,r2=/^\[object .+?Constructor\]$/,t2=/^0o[0-7]+$/i,n2=/^(?:0|[1-9]\d*)$/,i2=parseInt,a2=typeof D=="object"&&D&&D.Object===Object&&D,o2=typeof self=="object"&&self&&self.Object===Object&&self,Kr=a2||o2||Function("return this")();function na(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}function u2(r,e){for(var t=-1,n=r?r.length:0;++t<n&&e(r[t],t,r)!==!1;);return r}function s2(r,e){var t=r?r.length:0;return!!t&&c2(r,e,0)>-1}function f2(r,e,t,n){for(var i=r.length,a=t+(n?1:-1);n?a--:++a<i;)if(e(r[a],a,r))return a;return-1}function c2(r,e,t){if(e!==e)return f2(r,l2,t);for(var n=t-1,i=r.length;++n<i;)if(r[n]===e)return n;return-1}function l2(r){return r!==r}function d2(r,e){for(var t=r.length,n=0;t--;)r[t]===e&&n++;return n}function p2(r,e){return r?.[e]}function h2(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch{}return e}function ia(r,e){for(var t=-1,n=r.length,i=0,a=[];++t<n;){var o=r[t];(o===e||o===Tf)&&(r[t]=Tf,a[i++]=t)}return a}var y2=Function.prototype,Cf=Object.prototype,aa=Kr["__core-js_shared__"],Nf=function(){var r=/[^.]+$/.exec(aa&&aa.keys&&aa.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),Bf=y2.toString,g2=Cf.hasOwnProperty,qf=Cf.toString,_2=RegExp("^"+Bf.call(g2).replace(Xx,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),v2=Object.create,lr=Math.max,m2=Math.min,Uf=function(){var r=Lf(Object,"defineProperty"),e=Lf.name;return e&&e.length>2?r:void 0}();function w2(r){return dr(r)?v2(r):{}}function b2(r){if(!dr(r)||M2(r))return!1;var e=B2(r)||h2(r)?_2:r2;return e.test(C2(r))}function $2(r,e){return e=lr(e===void 0?r.length-1:e,0),function(){for(var t=arguments,n=-1,i=lr(t.length-e,0),a=Array(i);++n<i;)a[n]=t[e+n];n=-1;for(var o=Array(e+1);++n<e;)o[n]=t[n];return o[e]=a,na(r,this,o)}}function E2(r,e,t,n){for(var i=-1,a=r.length,o=t.length,s=-1,f=e.length,d=lr(a-o,0),c=Array(f+d),u=!n;++s<f;)c[s]=e[s];for(;++i<o;)(u||i<a)&&(c[t[i]]=r[i]);for(;d--;)c[s++]=r[i++];return c}function S2(r,e,t,n){for(var i=-1,a=r.length,o=-1,s=t.length,f=-1,d=e.length,c=lr(a-s,0),u=Array(c+d),l=!n;++i<c;)u[i]=r[i];for(var y=i;++f<d;)u[y+f]=e[f];for(;++o<s;)(l||i<a)&&(u[y+t[o]]=r[i++]);return u}function A2(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}function O2(r,e,t){var n=e&qe,i=Zr(r);function a(){var o=this&&this!==Kr&&this instanceof a?i:r;return o.apply(n?t:this,arguments)}return a}function Zr(r){return function(){var e=arguments;switch(e.length){case 0:return new r;case 1:return new r(e[0]);case 2:return new r(e[0],e[1]);case 3:return new r(e[0],e[1],e[2]);case 4:return new r(e[0],e[1],e[2],e[3]);case 5:return new r(e[0],e[1],e[2],e[3],e[4]);case 6:return new r(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new r(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var t=w2(r.prototype),n=r.apply(t,e);return dr(n)?n:t}}function I2(r,e,t){var n=Zr(r);function i(){for(var a=arguments.length,o=Array(a),s=a,f=ua(i);s--;)o[s]=arguments[s];var d=a<3&&o[0]!==f&&o[a-1]!==f?[]:ia(o,f);if(a-=d.length,a<t)return kf(r,e,oa,i.placeholder,void 0,o,d,void 0,void 0,t-a);var c=this&&this!==Kr&&this instanceof i?n:r;return na(c,this,o)}return i}function oa(r,e,t,n,i,a,o,s,f,d){var c=e&Rf,u=e&qe,l=e&yn,y=e&(cr|Xr),m=e&Ff,E=l?void 0:Zr(r);function S(){for(var O=arguments.length,$=Array(O),p=O;p--;)$[p]=arguments[p];if(y)var I=ua(S),T=d2($,I);if(n&&($=E2($,n,i,y)),a&&($=S2($,a,o,y)),O-=T,y&&O<d){var R=ia($,I);return kf(r,e,oa,S.placeholder,t,$,R,s,f,d-O)}var b=u?t:this,g=l?b[r]:r;return O=$.length,s?$=D2($,s):m&&O>1&&$.reverse(),c&&f<O&&($.length=f),this&&this!==Kr&&this instanceof S&&(g=E||Zr(g)),g.apply(b,$)}return S}function P2(r,e,t,n){var i=e&qe,a=Zr(r);function o(){for(var s=-1,f=arguments.length,d=-1,c=n.length,u=Array(c+f),l=this&&this!==Kr&&this instanceof o?a:r;++d<c;)u[d]=n[d];for(;f--;)u[d++]=arguments[++s];return na(l,i?t:this,u)}return o}function kf(r,e,t,n,i,a,o,s,f,d){var c=e&cr,u=c?o:void 0,l=c?void 0:o,y=c?a:void 0,m=c?void 0:a;e|=c?Ue:Yr,e&=~(c?Yr:Ue),e&kx||(e&=~(qe|yn));var E=t(r,e,i,y,u,m,l,s,f,d);return E.placeholder=n,jf(E,r,e)}function x2(r,e,t,n,i,a,o,s){var f=e&yn;if(!f&&typeof r!="function")throw new TypeError(Ux);var d=n?n.length:0;if(d||(e&=~(Ue|Yr),n=i=void 0),o=o===void 0?o:lr(Vf(o),0),s=s===void 0?s:Vf(s),d-=i?i.length:0,e&Yr){var c=n,u=i;n=i=void 0}var l=[r,e,t,n,i,c,u,a,o,s];if(r=l[0],e=l[1],t=l[2],n=l[3],i=l[4],s=l[9]=l[9]==null?f?0:r.length:lr(l[9]-d,0),!s&&e&(cr|Xr)&&(e&=~(cr|Xr)),!e||e==qe)var y=O2(r,e,t);else e==cr||e==Xr?y=I2(r,e,s):(e==Ue||e==(qe|Ue))&&!i.length?y=P2(r,e,t,n):y=oa.apply(void 0,l);return jf(y,r,e)}function ua(r){var e=r;return e.placeholder}function Lf(r,e){var t=p2(r,e);return b2(t)?t:void 0}function T2(r){var e=r.match(Zx);return e?e[1].split(Jx):[]}function R2(r,e){var t=e.length,n=t-1;return e[n]=(t>1?"& ":"")+e[n],e=e.join(t>2?", ":" "),r.replace(Kx,`{
25
25
  /* [wrapped with `+e+`] */
26
- `)}function Gx(r,e){return e=e??ex,!!e&&(typeof r=="number"||yx.test(r))&&r>-1&&r%1==0&&r<e}function Hx(r){return!!Wu&&Wu in r}function Wx(r,e){for(var t=r.length,n=Rx(e.length,t),i=Bx(r);n--;){var a=e[n];r[n]=Gx(a,t)?i[a]:void 0}return r}var Ju=Yu?function(r,e,t){var n=e+"";return Yu(r,"toString",{configurable:!0,enumerable:!1,value:e2(Vx(n,Xx(jx(n),t)))})}:r2;function zx(r){if(r!=null){try{return zu.call(r)}catch{}try{return r+""}catch{}}return""}function Xx(r,e){return mx(tx,function(t){var n="_."+t[0];e&t[1]&&!wx(r,n)&&r.push(n)}),r.sort()}var Li=Dx(function(r,e){var t=Bi(e,ki(Li));return Lx(r,ke,void 0,e,t)});function Yx(r){var e=lr(r)?Xu.call(r):"";return e==nx||e==ix}function lr(r){var e=typeof r;return!!r&&(e=="object"||e=="function")}function Kx(r){return!!r&&typeof r=="object"}function Zx(r){return typeof r=="symbol"||Kx(r)&&Xu.call(r)==ax}function Jx(r){if(!r)return r===0?r:0;if(r=Qx(r),r===Vu||r===-Vu){var e=r<0?-1:1;return e*rx}return r===r?r:0}function Qu(r){var e=Jx(r),t=e%1;return e===e?t?e-t:e:0}function Qx(r){if(typeof r=="number")return r;if(Zx(r))return Gu;if(lr(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=lr(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=r.replace(sx,"");var t=dx.test(r);return t||hx.test(r)?gx(r.slice(2),t?2:8):lx.test(r)?Gu:+r}function e2(r){return function(){return r}}function r2(r){return r}Li.placeholder={};var t2=Li,ef=be(t2);function n2(r,e){return{...Mi(e,["address_id","external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","status"]),customer_id:parseInt(r,10),shopify_variant_id:e.external_variant_id.ecommerce?parseInt(e.external_variant_id.ecommerce,10):void 0,...e.charge_interval_frequency?{charge_interval_frequency:`${e.charge_interval_frequency}`}:{},...e.order_interval_frequency?{order_interval_frequency:`${e.order_interval_frequency}`}:{},status:e.status?e.status.toUpperCase():void 0}}function i2(r,e){return{...Mi(e,["external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","use_external_variant_defaults"]),shopify_variant_id:e.external_variant_id?.ecommerce?parseInt(e.external_variant_id.ecommerce,10):void 0,...e.charge_interval_frequency?{charge_interval_frequency:`${e.charge_interval_frequency}`}:void 0,...e.order_interval_frequency?{order_interval_frequency:`${e.order_interval_frequency}`}:void 0,force_update:r}}function rf(r){const{id:e,address_id:t,customer_id:n,analytics_data:i,cancellation_reason:a,cancellation_reason_comments:o,cancelled_at:s,charge_interval_frequency:f,created_at:c,expire_after_specific_number_of_charges:l,shopify_product_id:u,shopify_variant_id:d,has_queued_charges:y,is_prepaid:b,is_skippable:S,is_swappable:O,max_retries_reached:$,next_charge_scheduled_at:E,order_day_of_month:p,order_day_of_week:I,order_interval_frequency:T,order_interval_unit:F,presentment_currency:m,price:g,product_title:_,properties:A,quantity:x,sku:M,sku_override:Y,status:me,updated_at:dr,variant_title:we}=r;return{id:e,address_id:t,customer_id:n,analytics_data:i,cancellation_reason:a,cancellation_reason_comments:o,cancelled_at:s,charge_interval_frequency:parseInt(f,10),created_at:c,expire_after_specific_number_of_charges:l,external_product_id:{ecommerce:`${u}`},external_variant_id:{ecommerce:`${d}`},has_queued_charges:Iu(y),is_prepaid:b,is_skippable:S,is_swappable:O,max_retries_reached:Iu($),next_charge_scheduled_at:E,order_day_of_month:p,order_day_of_week:I,order_interval_frequency:parseInt(T,10),order_interval_unit:F,presentment_currency:m,price:`${g}`,product_title:_??"",properties:A,quantity:x,sku:M,sku_override:Y,status:me.toLowerCase(),updated_at:dr,variant_title:we}}async function a2(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{subscription:n}=await w("get","/subscriptions",{id:e,query:{include:t?.include}},v(r,"getSubscription"));return n}function o2(r,e){return w("get","/subscriptions",{query:e},v(r,"listSubscriptions"))}async function s2(r,e,t){const{subscription:n}=await w("post","/subscriptions",{data:e,query:t},v(r,"createSubscription"));return n}async function u2(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");const{subscription:i}=await w("put","/subscriptions",{id:e,data:t,query:n},v(r,"updateSubscription"));return i}async function f2(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");const{subscription:i}=await w("post",`/subscriptions/${e}/set_next_charge_date`,{data:{date:t},query:n},v(r,"updateSubscriptionChargeDate"));return i}async function c2(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{subscription:n}=await w("post",`/subscriptions/${e}/change_address`,{data:{address_id:t}},v(r,"updateSubscriptionAddress"));return n}async function l2(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");const{subscription:i}=await w("post",`/subscriptions/${e}/cancel`,{data:t,query:n},v(r,"cancelSubscription"));return i}async function d2(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{subscription:n}=await w("post",`/subscriptions/${e}/activate`,{query:t},v(r,"activateSubscription"));return n}async function p2(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{charge:n}=await w("post",`/subscriptions/${e}/charges/skip`,{data:{date:t,subscription_id:`${e}`}},v(r,"skipSubscriptionCharge"));return n}async function h2(r,e,t){if(e===void 0||e.length===0)throw new Error("Subscription IDs are required");const{onetimes:n}=await w("post","/purchase_items/skip_gift",{data:{purchase_item_ids:e.map(Number),recipient_address:t}},v(r,"skipGiftSubscriptionCharge"));return n}async function y2(r,e,t){const n=e.length;if(n<1||n>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:i}=r;if(!i)throw new Error("No customerId in session.");const a=e[0].address_id;if(!e.every(l=>l.address_id===a))throw new Error("All subscriptions must have the same address_id.");const o=ef(n2,i),s=e.map(o);let f;t?.allow_onetimes!==void 0&&(f={allow_onetimes:t.allow_onetimes});const{subscriptions:c}=await w("post",`/addresses/${a}/subscriptions-bulk`,{data:{subscriptions:s,commit_update:!!t?.commit},headers:{"X-Recharge-Version":"2021-01"},query:f},v(r,"createSubscriptions"));return c.map(rf)}async function g2(r,e,t,n){if(e===void 0||e==="")throw new Error("Address ID is required");const i=t.length;if(i<1||i>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:a}=r;if(!a)throw new Error("No customerId in session.");const o=ef(i2,!!n?.force_update),s=t.map(o);let f;n?.allow_onetimes!==void 0&&(f={allow_onetimes:n.allow_onetimes});const{subscriptions:c}=await w("put",`/addresses/${e}/subscriptions-bulk`,{data:{subscriptions:s,commit_update:!!n?.commit},headers:{"X-Recharge-Version":"2021-01"},query:f},v(r,"updateSubscriptions"));return c.map(rf)}async function _2(r,e,t,n){if(e===void 0||e==="")throw new Error("Address ID is required");const i=t.length;if(i<1||i>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:a}=r;if(!a)throw new Error("No customerId in session.");let o;n?.allow_onetimes!==void 0&&(o={allow_onetimes:n.allow_onetimes}),await w("delete",`/addresses/${e}/subscriptions-bulk`,{data:{subscriptions:t,send_email:!!n?.send_email,commit_update:!!n?.commit},headers:{"X-Recharge-Version":"2021-01"},query:o},v(r,"deleteSubscriptions"))}var v2=Object.freeze({__proto__:null,activateSubscription:d2,cancelSubscription:l2,createSubscription:s2,createSubscriptions:y2,deleteSubscriptions:_2,getSubscription:a2,listSubscriptions:o2,skipGiftSubscriptionCharge:h2,skipSubscriptionCharge:p2,updateSubscription:u2,updateSubscriptionAddress:c2,updateSubscriptionChargeDate:f2,updateSubscriptions:g2});const m2={get(r,e){return X("get",r,e)},post(r,e){return X("post",r,e)},put(r,e){return X("put",r,e)},delete(r,e){return X("delete",r,e)}};function w2(r){if(r)return r;if(window?.Shopify?.shop)return window.Shopify.shop;let e=window?.domain;if(!e){const t=location?.href.match(/(?:http[s]*:\/\/)*(.*?)\.(?=admin\.rechargeapps\.com)/i)?.[1].replace(/-sp$/,"");t&&(e=`${t}.myshopify.com`)}if(e)return e;throw new Error("No storeIdentifier was passed into init.")}function b2(r={}){const e=r,{storefrontAccessToken:t}=r;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.");gd({storeIdentifier:w2(r.storeIdentifier),loginRetryFn:r.loginRetryFn,__unstable_twoFactorRetryFn:r.__unstable_twoFactorRetryFn,storefrontAccessToken:t,appName:r.appName,appVersion:r.appVersion,environment:e.environment?e.environment:"prod",environmentUri:e.environmentUri,customerHash:e.customerHash}),Mu()}const tf={init:b2,api:m2,address:Pd,auth:qd,bundle:tA,bundleData:cA,charge:HO,cdn:NO,collection:KO,credit:fI,customer:aI,customerSurveys:pI,gift:gI,membership:$I,membershipProgram:AI,metafield:PI,onetime:CI,order:qI,paymentMethod:GI,plan:zI,product:WO,store:KI,subscription:v2};try{tf.init()}catch{}return tf});
26
+ `)}function F2(r,e){return e=e??jx,!!e&&(typeof r=="number"||n2.test(r))&&r>-1&&r%1==0&&r<e}function M2(r){return!!Nf&&Nf in r}function D2(r,e){for(var t=r.length,n=m2(e.length,t),i=A2(r);n--;){var a=e[n];r[n]=F2(a,t)?i[a]:void 0}return r}var jf=Uf?function(r,e,t){var n=e+"";return Uf(r,"toString",{configurable:!0,enumerable:!1,value:j2(R2(n,N2(T2(n),t)))})}:V2;function C2(r){if(r!=null){try{return Bf.call(r)}catch{}try{return r+""}catch{}}return""}function N2(r,e){return u2(Gx,function(t){var n="_."+t[0];e&t[1]&&!s2(r,n)&&r.push(n)}),r.sort()}var sa=$2(function(r,e){var t=ia(e,ua(sa));return x2(r,Ue,void 0,e,t)});function B2(r){var e=dr(r)?qf.call(r):"";return e==Hx||e==Wx}function dr(r){var e=typeof r;return!!r&&(e=="object"||e=="function")}function q2(r){return!!r&&typeof r=="object"}function U2(r){return typeof r=="symbol"||q2(r)&&qf.call(r)==zx}function k2(r){if(!r)return r===0?r:0;if(r=L2(r),r===Mf||r===-Mf){var e=r<0?-1:1;return e*Vx}return r===r?r:0}function Vf(r){var e=k2(r),t=e%1;return e===e?t?e-t:e:0}function L2(r){if(typeof r=="number")return r;if(U2(r))return Df;if(dr(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=dr(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=r.replace(Yx,"");var t=e2.test(r);return t||t2.test(r)?i2(r.slice(2),t?2:8):Qx.test(r)?Df:+r}function j2(r){return function(){return r}}function V2(r){return r}sa.placeholder={};var G2=sa,Gf=we(G2);function H2(r,e){return{...ea(e,["address_id","external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","status"]),customer_id:parseInt(r,10),shopify_variant_id:e.external_variant_id.ecommerce?parseInt(e.external_variant_id.ecommerce,10):void 0,...e.charge_interval_frequency?{charge_interval_frequency:`${e.charge_interval_frequency}`}:{},...e.order_interval_frequency?{order_interval_frequency:`${e.order_interval_frequency}`}:{},status:e.status?e.status.toUpperCase():void 0}}function W2(r,e){return{...ea(e,["external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","use_external_variant_defaults"]),shopify_variant_id:e.external_variant_id?.ecommerce?parseInt(e.external_variant_id.ecommerce,10):void 0,...e.charge_interval_frequency?{charge_interval_frequency:`${e.charge_interval_frequency}`}:void 0,...e.order_interval_frequency?{order_interval_frequency:`${e.order_interval_frequency}`}:void 0,force_update:r}}function Hf(r){const{id:e,address_id:t,customer_id:n,analytics_data:i,cancellation_reason:a,cancellation_reason_comments:o,cancelled_at:s,charge_interval_frequency:f,created_at:d,expire_after_specific_number_of_charges:c,shopify_product_id:u,shopify_variant_id:l,has_queued_charges:y,is_prepaid:m,is_skippable:E,is_swappable:S,max_retries_reached:O,next_charge_scheduled_at:$,order_day_of_month:p,order_day_of_week:I,order_interval_frequency:T,order_interval_unit:R,presentment_currency:b,price:g,product_title:_,properties:A,quantity:P,sku:B,sku_override:W,status:oe,updated_at:Y,variant_title:ke}=r;return{id:e,address_id:t,customer_id:n,analytics_data:i,cancellation_reason:a,cancellation_reason_comments:o,cancelled_at:s,charge_interval_frequency:parseInt(f,10),created_at:d,expire_after_specific_number_of_charges:c,external_product_id:{ecommerce:`${u}`},external_variant_id:{ecommerce:`${l}`},has_queued_charges:_f(y),is_prepaid:m,is_skippable:E,is_swappable:S,max_retries_reached:_f(O),next_charge_scheduled_at:$,order_day_of_month:p,order_day_of_week:I,order_interval_frequency:parseInt(T,10),order_interval_unit:R,presentment_currency:b,price:`${g}`,product_title:_??"",properties:A,quantity:P,sku:B,sku_override:W,status:oe.toLowerCase(),updated_at:Y,variant_title:ke}}async function z2(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{subscription:n}=await w("get","/subscriptions",{id:e,query:{include:t?.include}},v(r,"getSubscription"));return n}function X2(r,e){return w("get","/subscriptions",{query:e},v(r,"listSubscriptions"))}async function Y2(r,e,t){const{subscription:n}=await w("post","/subscriptions",{data:e,query:t},v(r,"createSubscription"));return n}async function K2(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");const{subscription:i}=await w("put","/subscriptions",{id:e,data:t,query:n},v(r,"updateSubscription"));return i}async function Z2(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");const{subscription:i}=await w("post",`/subscriptions/${e}/set_next_charge_date`,{data:{date:t},query:n},v(r,"updateSubscriptionChargeDate"));return i}async function J2(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{subscription:n}=await w("post",`/subscriptions/${e}/change_address`,{data:{address_id:t}},v(r,"updateSubscriptionAddress"));return n}async function Q2(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");const{subscription:i}=await w("post",`/subscriptions/${e}/cancel`,{data:t,query:n},v(r,"cancelSubscription"));return i}async function eT(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{subscription:n}=await w("post",`/subscriptions/${e}/activate`,{query:t},v(r,"activateSubscription"));return n}async function rT(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{charge:n}=await w("post",`/subscriptions/${e}/charges/skip`,{data:{date:t,subscription_id:`${e}`}},v(r,"skipSubscriptionCharge"));return n}async function tT(r,e,t){if(e===void 0||e.length===0)throw new Error("Subscription IDs are required");const{onetimes:n}=await w("post","/purchase_items/skip_gift",{data:{purchase_item_ids:e.map(Number),recipient_address:t}},v(r,"skipGiftSubscriptionCharge"));return n}async function nT(r,e,t){const n=e.length;if(n<1||n>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:i}=r;if(!i)throw new Error("No customerId in session.");const a=e[0].address_id;if(!e.every(c=>c.address_id===a))throw new Error("All subscriptions must have the same address_id.");const o=Gf(H2,i),s=e.map(o);let f;t?.allow_onetimes!==void 0&&(f={allow_onetimes:t.allow_onetimes});const{subscriptions:d}=await w("post",`/addresses/${a}/subscriptions-bulk`,{data:{subscriptions:s,commit_update:!!t?.commit},headers:{"X-Recharge-Version":"2021-01"},query:f},v(r,"createSubscriptions"));return d.map(Hf)}async function iT(r,e,t,n){if(e===void 0||e==="")throw new Error("Address ID is required");const i=t.length;if(i<1||i>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:a}=r;if(!a)throw new Error("No customerId in session.");const o=Gf(W2,!!n?.force_update),s=t.map(o);let f;n?.allow_onetimes!==void 0&&(f={allow_onetimes:n.allow_onetimes});const{subscriptions:d}=await w("put",`/addresses/${e}/subscriptions-bulk`,{data:{subscriptions:s,commit_update:!!n?.commit},headers:{"X-Recharge-Version":"2021-01"},query:f},v(r,"updateSubscriptions"));return d.map(Hf)}async function aT(r,e,t,n){if(e===void 0||e==="")throw new Error("Address ID is required");const i=t.length;if(i<1||i>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:a}=r;if(!a)throw new Error("No customerId in session.");let o;n?.allow_onetimes!==void 0&&(o={allow_onetimes:n.allow_onetimes}),await w("delete",`/addresses/${e}/subscriptions-bulk`,{data:{subscriptions:t,send_email:!!n?.send_email,commit_update:!!n?.commit},headers:{"X-Recharge-Version":"2021-01"},query:o},v(r,"deleteSubscriptions"))}var oT=Object.freeze({__proto__:null,activateSubscription:eT,cancelSubscription:Q2,createSubscription:Y2,createSubscriptions:nT,deleteSubscriptions:aT,getSubscription:z2,listSubscriptions:X2,skipGiftSubscriptionCharge:tT,skipSubscriptionCharge:rT,updateSubscription:K2,updateSubscriptionAddress:J2,updateSubscriptionChargeDate:Z2,updateSubscriptions:iT});const uT={get(r,e){return X("get",r,e)},post(r,e){return X("post",r,e)},put(r,e){return X("put",r,e)},delete(r,e){return X("delete",r,e)}};function sT(r){if(r)return r;if(window?.Shopify?.shop)return window.Shopify.shop;let e=window?.domain;if(!e){const t=location?.href.match(/(?:http[s]*:\/\/)*(.*?)\.(?=admin\.rechargeapps\.com)/i)?.[1].replace(/-sp$/,"");t&&(e=`${t}.myshopify.com`)}if(e)return e;throw new Error("No storeIdentifier was passed into init.")}function fT(r={}){const e=r,{storefrontAccessToken:t}=r;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.");ih({storeIdentifier:sT(r.storeIdentifier),loginRetryFn:r.loginRetryFn,__unstable_twoFactorRetryFn:r.__unstable_twoFactorRetryFn,storefrontAccessToken:t,appName:r.appName,appVersion:r.appVersion,environment:e.environment?e.environment:"prod",environmentUri:e.environmentUri,customerHash:e.customerHash}),Ef()}const Wf={init:fT,api:uT,address:_h,auth:Ih,bundle:GO,bundleData:JO,charge:MP,cdn:SP,collection:qP,credit:ZP,customer:zP,customerSurveys:rx,gift:ix,membership:cx,membershipProgram:px,metafield:_x,onetime:Ex,order:Ix,paymentMethod:Fx,plan:Cx,product:DP,store:qx,subscription:oT};try{Wf.init()}catch{}return Wf});