@rechargeapps/storefront-client 0.16.0 → 0.16.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,5 +1,5 @@
1
1
  /**
2
- * recharge-client-0.16.0.min.js
2
+ * recharge-client-0.16.1.min.js
3
3
  * Copyright (c) Recharge
4
4
  */
5
5
 
@@ -21,8 +21,8 @@
21
21
  `)+" "+t[1]:t[0]+e+" "+r.join(", ")+" "+t[1]}function Yt(r){return Array.isArray(r)}function Vr(r){return typeof r=="boolean"}function Qe(r){return r===null}function ki(r){return r==null}function Kt(r){return typeof r=="number"}function er(r){return typeof r=="string"}function Vi(r){return typeof r=="symbol"}function K(r){return r===void 0}function rr(r){return Ae(r)&&Zt(r)==="[object RegExp]"}function Ae(r){return typeof r=="object"&&r!==null}function qr(r){return Ae(r)&&Zt(r)==="[object Date]"}function tr(r){return Ae(r)&&(Zt(r)==="[object Error]"||r instanceof Error)}function nr(r){return typeof r=="function"}function qi(r){return r===null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||typeof r=="symbol"||typeof r>"u"}function Gi(r){return y.isBuffer(r)}function Zt(r){return Object.prototype.toString.call(r)}function Jt(r){return r<10?"0"+r.toString(10):r.toString(10)}var Wf=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function zf(){var r=new Date,e=[Jt(r.getHours()),Jt(r.getMinutes()),Jt(r.getSeconds())].join(":");return[r.getDate(),Wf[r.getMonth()],e].join(" ")}function Hi(){console.log("%s - %s",zf(),Lr.apply(null,arguments))}function Qt(r,e){if(!e||!Ae(e))return r;for(var t=Object.keys(e),n=t.length;n--;)r[t[n]]=e[t[n]];return r}function Wi(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var Xf={inherits:Li,_extend:Qt,log:Hi,isBuffer:Gi,isPrimitive:qi,isFunction:nr,isError:tr,isDate:qr,isObject:Ae,isRegExp:rr,isUndefined:K,isSymbol:Vi,isString:er,isNumber:Kt,isNullOrUndefined:ki,isNull:Qe,isBoolean:Vr,isArray:Yt,inspect:Y,deprecate:Ht,format:Lr,debuglog:ji},Yf=Object.freeze({__proto__:null,format:Lr,deprecate:Ht,debuglog:ji,inspect:Y,isArray:Yt,isBoolean:Vr,isNull:Qe,isNullOrUndefined:ki,isNumber:Kt,isString:er,isSymbol:Vi,isUndefined:K,isRegExp:rr,isObject:Ae,isDate:qr,isError:tr,isFunction:nr,isPrimitive:qi,isBuffer:Gi,log:Hi,inherits:Li,_extend:Qt,default:Xf}),Kf=Ke(Yf),Zf=Kf.inspect,en=typeof Map=="function"&&Map.prototype,rn=Object.getOwnPropertyDescriptor&&en?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Gr=en&&rn&&typeof rn.get=="function"?rn.get:null,Jf=en&&Map.prototype.forEach,tn=typeof Set=="function"&&Set.prototype,nn=Object.getOwnPropertyDescriptor&&tn?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Hr=tn&&nn&&typeof nn.get=="function"?nn.get:null,Qf=tn&&Set.prototype.forEach,ec=typeof WeakMap=="function"&&WeakMap.prototype,ir=ec?WeakMap.prototype.has:null,rc=typeof WeakSet=="function"&&WeakSet.prototype,ar=rc?WeakSet.prototype.has:null,tc=typeof WeakRef=="function"&&WeakRef.prototype,zi=tc?WeakRef.prototype.deref:null,nc=Boolean.prototype.valueOf,ic=Object.prototype.toString,ac=Function.prototype.toString,oc=String.prototype.match,an=String.prototype.slice,pe=String.prototype.replace,uc=String.prototype.toUpperCase,Xi=String.prototype.toLowerCase,Yi=RegExp.prototype.test,Ki=Array.prototype.concat,Z=Array.prototype.join,sc=Array.prototype.slice,Zi=Math.floor,on=typeof BigInt=="function"?BigInt.prototype.valueOf:null,un=Object.getOwnPropertySymbols,sn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Le=typeof Symbol=="function"&&typeof Symbol.iterator=="object",k=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Le?"object":"symbol")?Symbol.toStringTag:null,Ji=Object.prototype.propertyIsEnumerable,Qi=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function ea(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||Yi.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-Zi(-r):Zi(r);if(n!==r){var i=String(n),a=an.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 fn=Zf,ra=fn.custom,ta=aa(ra)?ra:null,fc=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 ua(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var f=String(e);return s?ea(e,f):f}if(typeof e=="bigint"){var c=String(e)+"n";return s?ea(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 cn(e)?"[Array]":"[Object]";var u=Tc(a,n);if(typeof i>"u")i=[];else if(oa(i,e)>=0)return"[Circular]";function p(ee,ge,se){if(ge&&(i=sc.call(i),i.push(ge)),se){var Ir={depth:a.depth};return he(a,"quoteStyle")&&(Ir.quoteStyle=a.quoteStyle),r(ee,Ir,n+1,i)}return r(ee,a,n+1,i)}if(typeof e=="function"&&!ia(e)){var d=_c(e),_=Wr(e,p);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(_.length>0?" { "+Z.call(_,", ")+" }":"")}if(aa(e)){var E=Le?pe.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):sn.call(e);return typeof e=="object"&&!Le?or(E):E}if(Ac(e)){for(var $="<"+Xi.call(String(e.nodeName)),b=e.attributes||[],S=0;S<b.length;S++)$+=" "+b[S].name+"="+na(cc(b[S].value),"double",a);return $+=">",e.childNodes&&e.childNodes.length&&($+="..."),$+="</"+Xi.call(String(e.nodeName))+">",$}if(cn(e)){if(e.length===0)return"[]";var h=Wr(e,p);return u&&!Sc(h)?"["+pn(h,u)+"]":"[ "+Z.call(h,", ")+" ]"}if(pc(e)){var O=Wr(e,p);return!("cause"in Error.prototype)&&"cause"in e&&!Ji.call(e,"cause")?"{ ["+String(e)+"] "+Z.call(Ki.call("[cause]: "+p(e.cause),O),", ")+" }":O.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Z.call(O,", ")+" }"}if(typeof e=="object"&&o){if(ta&&typeof e[ta]=="function"&&fn)return fn(e,{depth:l-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(mc(e)){var x=[];return Jf.call(e,function(ee,ge){x.push(p(ge,e,!0)+" => "+p(ee,e))}),sa("Map",Gr.call(e),x,u)}if($c(e)){var R=[];return Qf.call(e,function(ee){R.push(p(ee,e))}),sa("Set",Hr.call(e),R,u)}if(bc(e))return ln("WeakMap");if(Ec(e))return ln("WeakSet");if(wc(e))return ln("WeakRef");if(yc(e))return or(p(Number(e)));if(vc(e))return or(p(on.call(e)));if(dc(e))return or(nc.call(e));if(hc(e))return or(p(String(e)));if(!lc(e)&&!ia(e)){var m=Wr(e,p),v=Qi?Qi(e)===Object.prototype:e instanceof Object||e.constructor===Object,g=e instanceof Object?"":"null prototype",w=!v&&k&&Object(e)===e&&k in e?an.call(ye(e),8,-1):g?"Object":"",A=v||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",L=A+(w||g?"["+Z.call(Ki.call([],w||[],g||[]),": ")+"] ":"");return m.length===0?L+"{}":u?L+"{"+pn(m,u)+"}":L+"{ "+Z.call(m,", ")+" }"}return String(e)};function na(r,e,t){var n=(t.quoteStyle||e)==="double"?'"':"'";return n+r+n}function cc(r){return pe.call(String(r),/"/g,"&quot;")}function cn(r){return ye(r)==="[object Array]"&&(!k||!(typeof r=="object"&&k in r))}function lc(r){return ye(r)==="[object Date]"&&(!k||!(typeof r=="object"&&k in r))}function ia(r){return ye(r)==="[object RegExp]"&&(!k||!(typeof r=="object"&&k in r))}function pc(r){return ye(r)==="[object Error]"&&(!k||!(typeof r=="object"&&k in r))}function hc(r){return ye(r)==="[object String]"&&(!k||!(typeof r=="object"&&k in r))}function yc(r){return ye(r)==="[object Number]"&&(!k||!(typeof r=="object"&&k in r))}function dc(r){return ye(r)==="[object Boolean]"&&(!k||!(typeof r=="object"&&k in r))}function aa(r){if(Le)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!sn)return!1;try{return sn.call(r),!0}catch{}return!1}function vc(r){if(!r||typeof r!="object"||!on)return!1;try{return on.call(r),!0}catch{}return!1}var gc=Object.prototype.hasOwnProperty||function(r){return r in this};function he(r,e){return gc.call(r,e)}function ye(r){return ic.call(r)}function _c(r){if(r.name)return r.name;var e=oc.call(ac.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}function oa(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 mc(r){if(!Gr||!r||typeof r!="object")return!1;try{Gr.call(r);try{Hr.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function bc(r){if(!ir||!r||typeof r!="object")return!1;try{ir.call(r,ir);try{ar.call(r,ar)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function wc(r){if(!zi||!r||typeof r!="object")return!1;try{return zi.call(r),!0}catch{}return!1}function $c(r){if(!Hr||!r||typeof r!="object")return!1;try{Hr.call(r);try{Gr.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function Ec(r){if(!ar||!r||typeof r!="object")return!1;try{ar.call(r,ar);try{ir.call(r,ir)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function Ac(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function ua(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return ua(an.call(r,0,e.maxStringLength),e)+n}var i=pe.call(pe.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Oc);return na(i,"single",e)}function Oc(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":"")+uc.call(e.toString(16))}function or(r){return"Object("+r+")"}function ln(r){return r+" { ? }"}function sa(r,e,t,n){var i=n?pn(t,n):Z.call(t,", ");return r+" ("+e+") {"+i+"}"}function Sc(r){for(var e=0;e<r.length;e++)if(oa(r[e],`
22
22
  `)>=0)return!1;return!0}function Tc(r,e){var t;if(r.indent===" ")t=" ";else if(typeof r.indent=="number"&&r.indent>0)t=Z.call(Array(r.indent+1)," ");else return null;return{base:t,prev:Z.call(Array(e+1),t)}}function pn(r,e){if(r.length===0)return"";var t=`
23
23
  `+e.prev+e.base;return t+Z.call(r,","+t)+`
24
- `+e.prev}function Wr(r,e){var t=cn(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 un=="function"?un(r):[],o;if(Le){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||Le&&o["$"+f]instanceof Symbol||(Yi.call(/[^\w$]/,f)?n.push(e(f,r)+": "+e(r[f],r)):n.push(f+": "+e(r[f],r)));if(typeof un=="function")for(var c=0;c<a.length;c++)Ji.call(r,a[c])&&n.push("["+e(a[c])+"]: "+e(r[a[c]],r));return n}var hn=Lt,je=Ms,Ic=fc,xc=hn("%TypeError%"),zr=hn("%WeakMap%",!0),Xr=hn("%Map%",!0),Pc=je("WeakMap.prototype.get",!0),Fc=je("WeakMap.prototype.set",!0),Rc=je("WeakMap.prototype.has",!0),Mc=je("Map.prototype.get",!0),Dc=je("Map.prototype.set",!0),Nc=je("Map.prototype.has",!0),yn=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},Bc=function(r,e){var t=yn(r,e);return t&&t.value},Uc=function(r,e,t){var n=yn(r,e);n?n.value=t:r.next={key:e,next:r.next,value:t}},Cc=function(r,e){return!!yn(r,e)},Lc=function(){var e,t,n,i={assert:function(a){if(!i.has(a))throw new xc("Side channel does not contain "+Ic(a))},get:function(a){if(zr&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Pc(e,a)}else if(Xr){if(t)return Mc(t,a)}else if(n)return Bc(n,a)},has:function(a){if(zr&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Rc(e,a)}else if(Xr){if(t)return Nc(t,a)}else if(n)return Cc(n,a);return!1},set:function(a,o){zr&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new zr),Fc(e,a,o)):Xr?(t||(t=new Xr),Dc(t,a,o)):(n||(n={key:{},next:null}),Uc(n,a,o))}};return i},jc=String.prototype.replace,kc=/%20/g,dn={RFC1738:"RFC1738",RFC3986:"RFC3986"},vn={default:dn.RFC3986,formatters:{RFC1738:function(r){return jc.call(r,kc,"+")},RFC3986:function(r){return String(r)}},RFC1738:dn.RFC1738,RFC3986:dn.RFC3986},Vc=vn,gn=Object.prototype.hasOwnProperty,Oe=Array.isArray,J=function(){for(var r=[],e=0;e<256;++e)r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return r}(),qc=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(Oe(n)){for(var i=[],a=0;a<n.length;++a)typeof n[a]<"u"&&i.push(n[a]);t.obj[t.prop]=i}}},fa=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},Gc=function r(e,t,n){if(!t)return e;if(typeof t!="object"){if(Oe(e))e.push(t);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!gn.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 Oe(e)&&!Oe(t)&&(i=fa(e,n)),Oe(e)&&Oe(t)?(t.forEach(function(a,o){if(gn.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 gn.call(a,o)?a[o]=r(a[o],s,n):a[o]=s,a},i)},Hc=function(e,t){return Object.keys(t).reduce(function(n,i){return n[i]=t[i],n},e)},Wc=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}},zc=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===Vc.RFC1738&&(c===40||c===41)){s+=o.charAt(f);continue}if(c<128){s=s+J[c];continue}if(c<2048){s=s+(J[192|c>>6]+J[128|c&63]);continue}if(c<55296||c>=57344){s=s+(J[224|c>>12]+J[128|c>>6&63]+J[128|c&63]);continue}f+=1,c=65536+((c&1023)<<10|o.charCodeAt(f)&1023),s+=J[240|c>>18]+J[128|c>>12&63]+J[128|c>>6&63]+J[128|c&63]}return s},Xc=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 qc(t),e},Yc=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Kc=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Zc=function(e,t){return[].concat(e,t)},Jc=function(e,t){if(Oe(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(t(e[i]));return n}return t(e)},ca={arrayToObject:fa,assign:Hc,combine:Zc,compact:Xc,decode:Wc,encode:zc,isBuffer:Kc,isRegExp:Yc,maybeMap:Jc,merge:Gc},la=Lc,_n=ca,ur=vn,Qc=Object.prototype.hasOwnProperty,pa={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},ie=Array.isArray,el=String.prototype.split,rl=Array.prototype.push,ha=function(r,e){rl.apply(r,ie(e)?e:[e])},tl=Date.prototype.toISOString,ya=ur.default,U={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:_n.encode,encodeValuesOnly:!1,format:ya,formatter:ur.formatters[ya],indices:!1,serializeDate:function(e){return tl.call(e)},skipNulls:!1,strictNullHandling:!1},nl=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},mn={},il=function r(e,t,n,i,a,o,s,f,c,l,u,p,d,_,E,$){for(var b=e,S=$,h=0,O=!1;(S=S.get(mn))!==void 0&&!O;){var x=S.get(e);if(h+=1,typeof x<"u"){if(x===h)throw new RangeError("Cyclic object value");O=!0}typeof S.get(mn)>"u"&&(h=0)}if(typeof f=="function"?b=f(t,b):b instanceof Date?b=u(b):n==="comma"&&ie(b)&&(b=_n.maybeMap(b,function(ai){return ai instanceof Date?u(ai):ai})),b===null){if(a)return s&&!_?s(t,U.encoder,E,"key",p):t;b=""}if(nl(b)||_n.isBuffer(b)){if(s){var R=_?t:s(t,U.encoder,E,"key",p);if(n==="comma"&&_){for(var m=el.call(String(b),","),v="",g=0;g<m.length;++g)v+=(g===0?"":",")+d(s(m[g],U.encoder,E,"value",p));return[d(R)+(i&&ie(b)&&m.length===1?"[]":"")+"="+v]}return[d(R)+"="+d(s(b,U.encoder,E,"value",p))]}return[d(t)+"="+d(String(b))]}var w=[];if(typeof b>"u")return w;var A;if(n==="comma"&&ie(b))A=[{value:b.length>0?b.join(",")||null:void 0}];else if(ie(f))A=f;else{var L=Object.keys(b);A=c?L.sort(c):L}for(var ee=i&&ie(b)&&b.length===1?t+"[]":t,ge=0;ge<A.length;++ge){var se=A[ge],Ir=typeof se=="object"&&typeof se.value<"u"?se.value:b[se];if(!(o&&Ir===null)){var P2=ie(b)?typeof n=="function"?n(ee,se):ee:ee+(l?"."+se:"["+se+"]");$.set(e,h);var es=la();es.set(mn,$),ha(w,r(Ir,P2,n,i,a,o,s,f,c,l,u,p,d,_,E,es))}}return w},al=function(e){if(!e)return U;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||U.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=ur.default;if(typeof e.format<"u"){if(!Qc.call(ur.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=ur.formatters[n],a=U.filter;return(typeof e.filter=="function"||ie(e.filter))&&(a=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:U.addQueryPrefix,allowDots:typeof e.allowDots>"u"?U.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:U.charsetSentinel,delimiter:typeof e.delimiter>"u"?U.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:U.encode,encoder:typeof e.encoder=="function"?e.encoder:U.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:U.encodeValuesOnly,filter:a,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:U.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:U.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:U.strictNullHandling}},ol=function(r,e){var t=r,n=al(e),i,a;typeof n.filter=="function"?(a=n.filter,t=a("",t)):ie(n.filter)&&(a=n.filter,i=a);var o=[];if(typeof t!="object"||t===null)return"";var s;e&&e.arrayFormat in pa?s=e.arrayFormat:e&&"indices"in e?s=e.indices?"indices":"repeat":s="indices";var f=pa[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=la(),u=0;u<i.length;++u){var p=i[u];n.skipNulls&&t[p]===null||ha(o,il(t[p],p,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 d=o.join(n.delimiter),_=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?_+="utf8=%26%2310003%3B&":_+="utf8=%E2%9C%93&"),d.length>0?_+d:""},ke=ca,bn=Object.prototype.hasOwnProperty,ul=Array.isArray,B={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:ke.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},sl=function(r){return r.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},da=function(r,e){return r&&typeof r=="string"&&e.comma&&r.indexOf(",")>-1?r.split(","):r},fl="utf8=%26%2310003%3B",cl="utf8=%E2%9C%93",ll=function(e,t){var n={},i=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=t.parameterLimit===1/0?void 0:t.parameterLimit,o=i.split(t.delimiter,a),s=-1,f,c=t.charset;if(t.charsetSentinel)for(f=0;f<o.length;++f)o[f].indexOf("utf8=")===0&&(o[f]===cl?c="utf-8":o[f]===fl&&(c="iso-8859-1"),s=f,f=o.length);for(f=0;f<o.length;++f)if(f!==s){var l=o[f],u=l.indexOf("]="),p=u===-1?l.indexOf("="):u+1,d,_;p===-1?(d=t.decoder(l,B.decoder,c,"key"),_=t.strictNullHandling?null:""):(d=t.decoder(l.slice(0,p),B.decoder,c,"key"),_=ke.maybeMap(da(l.slice(p+1),t),function(E){return t.decoder(E,B.decoder,c,"value")})),_&&t.interpretNumericEntities&&c==="iso-8859-1"&&(_=sl(_)),l.indexOf("[]=")>-1&&(_=ul(_)?[_]:_),bn.call(n,d)?n[d]=ke.combine(n[d],_):n[d]=_}return n},pl=function(r,e,t,n){for(var i=n?e:da(e,t),a=r.length-1;a>=0;--a){var o,s=r[a];if(s==="[]"&&t.parseArrays)o=[].concat(i);else{o=t.plainObjects?Object.create(null):{};var f=s.charAt(0)==="["&&s.charAt(s.length-1)==="]"?s.slice(1,-1):s,c=parseInt(f,10);!t.parseArrays&&f===""?o={0:i}:!isNaN(c)&&s!==f&&String(c)===f&&c>=0&&t.parseArrays&&c<=t.arrayLimit?(o=[],o[c]=i):f!=="__proto__"&&(o[f]=i)}i=o}return i},hl=function(e,t,n,i){if(!!e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,f=n.depth>0&&o.exec(a),c=f?a.slice(0,f.index):a,l=[];if(c){if(!n.plainObjects&&bn.call(Object.prototype,c)&&!n.allowPrototypes)return;l.push(c)}for(var u=0;n.depth>0&&(f=s.exec(a))!==null&&u<n.depth;){if(u+=1,!n.plainObjects&&bn.call(Object.prototype,f[1].slice(1,-1))&&!n.allowPrototypes)return;l.push(f[1])}return f&&l.push("["+a.slice(f.index)+"]"),pl(l,t,n,i)}},yl=function(e){if(!e)return B;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");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 t=typeof e.charset>"u"?B.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?B.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:B.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:B.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:B.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:B.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:B.comma,decoder:typeof e.decoder=="function"?e.decoder:B.decoder,delimiter:typeof e.delimiter=="string"||ke.isRegExp(e.delimiter)?e.delimiter:B.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:B.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:B.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:B.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:B.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:B.strictNullHandling}},dl=function(r,e){var t=yl(e);if(r===""||r===null||typeof r>"u")return t.plainObjects?Object.create(null):{};for(var n=typeof r=="string"?ll(r,t):r,i=t.plainObjects?Object.create(null):{},a=Object.keys(n),o=0;o<a.length;++o){var s=a[o],f=hl(s,n[s],t,typeof r=="string");i=ke.merge(i,f,t)}return t.allowSparse===!0?i:ke.compact(i)},vl=ol,gl=dl,_l=vn,ml={formats:_l,parse:gl,stringify:vl};let va={storeIdentifier:"",environment:"prod"};function bl(r){va=r}function sr(){return va}const wl=r=>r==="stage"?"https://api.stage.rechargeapps.com":"https://api.rechargeapps.com",$l=r=>r==="stage"?"https://admin.stage.rechargeapps.com":"https://admin.rechargeapps.com",El=r=>r==="stage"?"https://static.stage.rechargecdn.com":"https://static.rechargecdn.com",Al="/tools/recurring";var Ol=Object.defineProperty,ga=Object.getOwnPropertySymbols,Sl=Object.prototype.hasOwnProperty,Tl=Object.prototype.propertyIsEnumerable,_a=(r,e,t)=>e in r?Ol(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,wn=(r,e)=>{for(var t in e||(e={}))Sl.call(e,t)&&_a(r,t,e[t]);if(ga)for(var t of ga(e))Tl.call(e,t)&&_a(r,t,e[t]);return r};function Il(r){return ml.stringify(r,{encode:!1,indices:!1,arrayFormat:"comma"})}async function Yr(r,e,t={}){const n=sr();return de(r,`${El(n.environment)}/store/${n.storeIdentifier}${e}`,t)}async function T(r,e,{id:t,query:n,data:i,headers:a}={},o){const{environment:s,storeIdentifier:f}=sr(),c=o.apiToken,l=wl(s),u=wn({"X-Recharge-Access-Token":c,"X-Recharge-Version":"2021-11"},a||{}),p=wn({shop_url:f},n);return de(r,`${l}${e}`,{id:t,query:p,data:i,headers:u})}async function $n(r,e,t={}){return de(r,`${Al}${e}`,t)}async function de(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 p=[u,Il(n)].join("&").replace(/^&/,"");o=`${o}${p?`?${p}`:""}`}let s;i&&r!=="get"&&(s=JSON.stringify(i));const f=wn({Accept:"application/json","Content-Type":"application/json","X-Recharge-App":"storefront-client"},a||{}),c=await fetch(o,{method:r,headers:f,body:s,mode:"cors"});let l;try{l=await c.json()}catch{}if(!c.ok)throw l&&l.error?new Error(`${c.status}: ${l.error}`):new Error("A connection error occurred while making the request");return l}function xl(r,e){return T("get","/addresses",{query:e},r)}async function Pl(r,e){const{address:t}=await T("get","/addresses",{id:e},r);return t}async function Fl(r,e){const{address:t}=await T("post","/addresses",{data:e},r);return t}async function Rl(r,e,t){const{address:n}=await T("put","/addresses",{id:e,data:t},r);return n}function Ml(r,e){return T("delete","/addresses",{id:e},r)}async function Dl(r,e){const{address:t}=await T("post","/addresses/merge",{data:e},r);return t}async function Nl(r,e,t){const{charge:n}=await T("post",`/addresses/${e}/charges/skip`,{data:t},r);return n}var Bl=Object.freeze({__proto__:null,listAddresses:xl,getAddress:Pl,createAddress:Fl,updateAddress:Rl,deleteAddress:Ml,mergeAddresses:Dl,skipFutureCharge:Nl});async function Ul(){const{storefrontAccessToken:r}=sr(),e={};r&&(e["X-Recharge-Storefront-Access-Token"]=r);const t=await $n("get","/access",{headers:e});return{apiToken:t.api_token,customerId:t.customer_id}}async function Cl(r,e){const{environment:t,storeIdentifier:n}=sr(),i=$l(t),a=await de("post",`${i}/shopify_storefront_access`,{data:{customer_token:r,storefront_token:e,shop_url:n},headers:{"X-Recharge-App":"storefront-client"}});return a.api_token?{apiToken:a.api_token,customerId:a.customer_id}:null}var Ll=Object.freeze({__proto__:null,loginShopifyAppProxy:Ul,loginShopifyApi:Cl}),ma={},En={},ae={},jl=typeof re=="object"&&re&&re.Object===Object&&re,ba=jl,kl=ba,Vl=typeof self=="object"&&self&&self.Object===Object&&self,ql=kl||Vl||Function("return this")(),Q=ql,Gl=Q,Hl=Gl.Symbol,Ve=Hl,wa=Ve,$a=Object.prototype,Wl=$a.hasOwnProperty,zl=$a.toString,fr=wa?wa.toStringTag:void 0;function Xl(r){var e=Wl.call(r,fr),t=r[fr];try{r[fr]=void 0;var n=!0}catch{}var i=zl.call(r);return n&&(e?r[fr]=t:delete r[fr]),i}var Yl=Xl,Kl=Object.prototype,Zl=Kl.toString;function Jl(r){return Zl.call(r)}var Ql=Jl,Ea=Ve,ep=Yl,rp=Ql,tp="[object Null]",np="[object Undefined]",Aa=Ea?Ea.toStringTag:void 0;function ip(r){return r==null?r===void 0?np:tp:Aa&&Aa in Object(r)?ep(r):rp(r)}var oe=ip;function ap(r){return r!=null&&typeof r=="object"}var H=ap,op=oe,up=H,sp="[object Number]";function fp(r){return typeof r=="number"||up(r)&&op(r)==sp}var Kr=fp,M={},Oa={exports:{}};function cp(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var ve=cp,lp=oe,pp=ve,hp="[object AsyncFunction]",yp="[object Function]",dp="[object GeneratorFunction]",vp="[object Proxy]";function gp(r){if(!pp(r))return!1;var e=lp(r);return e==yp||e==dp||e==hp||e==vp}var An=gp,_p=Q,mp=_p["__core-js_shared__"],bp=mp,On=bp,Sa=function(){var r=/[^.]+$/.exec(On&&On.keys&&On.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function wp(r){return!!Sa&&Sa in r}var $p=wp,Ep=Function.prototype,Ap=Ep.toString;function Op(r){if(r!=null){try{return Ap.call(r)}catch{}try{return r+""}catch{}}return""}var Ta=Op,Sp=An,Tp=$p,Ip=ve,xp=Ta,Pp=/[\\^$.*+?()[\]{}|]/g,Fp=/^\[object .+?Constructor\]$/,Rp=Function.prototype,Mp=Object.prototype,Dp=Rp.toString,Np=Mp.hasOwnProperty,Bp=RegExp("^"+Dp.call(Np).replace(Pp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Up(r){if(!Ip(r)||Tp(r))return!1;var e=Sp(r)?Bp:Fp;return e.test(xp(r))}var Cp=Up;function Lp(r,e){return r?.[e]}var jp=Lp,kp=Cp,Vp=jp;function qp(r,e){var t=Vp(r,e);return kp(t)?t:void 0}var Se=qp,Gp=Se,Hp=function(){try{var r=Gp(Object,"defineProperty");return r({},"",{}),r}catch{}}(),Ia=Hp,xa=Ia;function Wp(r,e,t){e=="__proto__"&&xa?xa(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}var Pa=Wp;function zp(r,e){return r===e||r!==r&&e!==e}var Zr=zp,Xp=Pa,Yp=Zr,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 Fa=Jp,Qp=Fa,eh=Pa;function rh(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?eh(t,s,f):Qp(t,s,f)}return t}var qe=rh;function th(r){return r}var Jr=th;function nh(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 ih=nh,ah=ih,Ra=Math.max;function oh(r,e,t){return e=Ra(e===void 0?r.length-1:e,0),function(){for(var n=arguments,i=-1,a=Ra(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),ah(r,this,s)}}var Ma=oh;function uh(r){return function(){return r}}var sh=uh,fh=sh,Da=Ia,ch=Jr,lh=Da?function(r,e){return Da(r,"toString",{configurable:!0,enumerable:!1,value:fh(e),writable:!0})}:ch,ph=lh,hh=800,yh=16,dh=Date.now;function vh(r){var e=0,t=0;return function(){var n=dh(),i=yh-(n-t);if(t=n,i>0){if(++e>=hh)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}var gh=vh,_h=ph,mh=gh,bh=mh(_h),Na=bh,wh=Jr,$h=Ma,Eh=Na;function Ah(r,e){return Eh($h(r,e,wh),r+"")}var Oh=Ah,Sh=9007199254740991;function Th(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Sh}var Sn=Th,Ih=An,xh=Sn;function Ph(r){return r!=null&&xh(r.length)&&!Ih(r)}var cr=Ph,Fh=9007199254740991,Rh=/^(?:0|[1-9]\d*)$/;function Mh(r,e){var t=typeof r;return e=e??Fh,!!e&&(t=="number"||t!="symbol"&&Rh.test(r))&&r>-1&&r%1==0&&r<e}var Tn=Mh,Dh=Zr,Nh=cr,Bh=Tn,Uh=ve;function Ch(r,e,t){if(!Uh(t))return!1;var n=typeof e;return(n=="number"?Nh(t)&&Bh(e,t.length):n=="string"&&e in t)?Dh(t[e],r):!1}var Ba=Ch,Lh=Oh,jh=Ba;function kh(r){return Lh(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&&jh(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 Vh=kh;function qh(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var Ua=qh,Gh=oe,Hh=H,Wh="[object Arguments]";function zh(r){return Hh(r)&&Gh(r)==Wh}var Xh=zh,Ca=Xh,Yh=H,La=Object.prototype,Kh=La.hasOwnProperty,Zh=La.propertyIsEnumerable,Jh=Ca(function(){return arguments}())?Ca:function(r){return Yh(r)&&Kh.call(r,"callee")&&!Zh.call(r,"callee")},In=Jh,Qh=Array.isArray,C=Qh,lr={exports:{}};function ey(){return!1}var ry=ey;(function(r,e){var t=Q,n=ry,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})(lr,lr.exports);var ty=oe,ny=Sn,iy=H,ay="[object Arguments]",oy="[object Array]",uy="[object Boolean]",sy="[object Date]",fy="[object Error]",cy="[object Function]",ly="[object Map]",py="[object Number]",hy="[object Object]",yy="[object RegExp]",dy="[object Set]",vy="[object String]",gy="[object WeakMap]",_y="[object ArrayBuffer]",my="[object DataView]",by="[object Float32Array]",wy="[object Float64Array]",$y="[object Int8Array]",Ey="[object Int16Array]",Ay="[object Int32Array]",Oy="[object Uint8Array]",Sy="[object Uint8ClampedArray]",Ty="[object Uint16Array]",Iy="[object Uint32Array]",F={};F[by]=F[wy]=F[$y]=F[Ey]=F[Ay]=F[Oy]=F[Sy]=F[Ty]=F[Iy]=!0,F[ay]=F[oy]=F[_y]=F[uy]=F[my]=F[sy]=F[fy]=F[cy]=F[ly]=F[py]=F[hy]=F[yy]=F[dy]=F[vy]=F[gy]=!1;function xy(r){return iy(r)&&ny(r.length)&&!!F[ty(r)]}var Py=xy;function Fy(r){return function(e){return r(e)}}var xn=Fy,pr={exports:{}};(function(r,e){var t=ba,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})(pr,pr.exports);var Ry=Py,My=xn,ja=pr.exports,ka=ja&&ja.isTypedArray,Dy=ka?My(ka):Ry,Va=Dy,Ny=Ua,By=In,Uy=C,Cy=lr.exports,Ly=Tn,jy=Va,ky=Object.prototype,Vy=ky.hasOwnProperty;function qy(r,e){var t=Uy(r),n=!t&&By(r),i=!t&&!n&&Cy(r),a=!t&&!n&&!i&&jy(r),o=t||n||i||a,s=o?Ny(r.length,String):[],f=s.length;for(var c in r)(e||Vy.call(r,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Ly(c,f)))&&s.push(c);return s}var qa=qy,Gy=Object.prototype;function Hy(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Gy;return r===t}var Pn=Hy;function Wy(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}var zy=Wy,Xy=ve,Yy=Pn,Ky=zy,Zy=Object.prototype,Jy=Zy.hasOwnProperty;function Qy(r){if(!Xy(r))return Ky(r);var e=Yy(r),t=[];for(var n in r)n=="constructor"&&(e||!Jy.call(r,n))||t.push(n);return t}var ed=Qy,rd=qa,td=ed,nd=cr;function id(r){return nd(r)?rd(r,!0):td(r)}var Qr=id,ad=qe,od=Vh,ud=Qr,sd=od(function(r,e){ad(e,ud(e),r)}),fd=sd;(function(r){r.exports=fd})(Oa);var et={},Te={};function cd(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 ld=cd;function pd(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 hd=pd,yd=hd,dd=yd(),vd=dd;function gd(r,e){return function(t){return r(e(t))}}var Ga=gd,_d=Ga,md=_d(Object.keys,Object),bd=md,wd=Pn,$d=bd,Ed=Object.prototype,Ad=Ed.hasOwnProperty;function Od(r){if(!wd(r))return $d(r);var e=[];for(var t in Object(r))Ad.call(r,t)&&t!="constructor"&&e.push(t);return e}var Sd=Od,Td=qa,Id=Sd,xd=cr;function Pd(r){return xd(r)?Td(r):Id(r)}var Ge=Pd,Fd=vd,Rd=Ge;function Md(r,e){return r&&Fd(r,e,Rd)}var Dd=Md,Nd=cr;function Bd(r,e){return function(t,n){if(t==null)return t;if(!Nd(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 Ud=Bd,Cd=Dd,Ld=Ud,jd=Ld(Cd),Fn=jd,kd=Fn;function Vd(r,e){var t=!0;return kd(r,function(n,i,a){return t=!!e(n,i,a),t}),t}var qd=Vd;function Gd(){this.__data__=[],this.size=0}var Hd=Gd,Wd=Zr;function zd(r,e){for(var t=r.length;t--;)if(Wd(r[t][0],e))return t;return-1}var rt=zd,Xd=rt,Yd=Array.prototype,Kd=Yd.splice;function Zd(r){var e=this.__data__,t=Xd(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():Kd.call(e,t,1),--this.size,!0}var Jd=Zd,Qd=rt;function ev(r){var e=this.__data__,t=Qd(e,r);return t<0?void 0:e[t][1]}var rv=ev,tv=rt;function nv(r){return tv(this.__data__,r)>-1}var iv=nv,av=rt;function ov(r,e){var t=this.__data__,n=av(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var uv=ov,sv=Hd,fv=Jd,cv=rv,lv=iv,pv=uv;function He(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])}}He.prototype.clear=sv,He.prototype.delete=fv,He.prototype.get=cv,He.prototype.has=lv,He.prototype.set=pv;var tt=He,hv=tt;function yv(){this.__data__=new hv,this.size=0}var dv=yv;function vv(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}var gv=vv;function _v(r){return this.__data__.get(r)}var mv=_v;function bv(r){return this.__data__.has(r)}var wv=bv,$v=Se,Ev=Q,Av=$v(Ev,"Map"),Rn=Av,Ov=Se,Sv=Ov(Object,"create"),nt=Sv,Ha=nt;function Tv(){this.__data__=Ha?Ha(null):{},this.size=0}var Iv=Tv;function xv(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var Pv=xv,Fv=nt,Rv="__lodash_hash_undefined__",Mv=Object.prototype,Dv=Mv.hasOwnProperty;function Nv(r){var e=this.__data__;if(Fv){var t=e[r];return t===Rv?void 0:t}return Dv.call(e,r)?e[r]:void 0}var Bv=Nv,Uv=nt,Cv=Object.prototype,Lv=Cv.hasOwnProperty;function jv(r){var e=this.__data__;return Uv?e[r]!==void 0:Lv.call(e,r)}var kv=jv,Vv=nt,qv="__lodash_hash_undefined__";function Gv(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Vv&&e===void 0?qv:e,this}var Hv=Gv,Wv=Iv,zv=Pv,Xv=Bv,Yv=kv,Kv=Hv;function We(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])}}We.prototype.clear=Wv,We.prototype.delete=zv,We.prototype.get=Xv,We.prototype.has=Yv,We.prototype.set=Kv;var Zv=We,Wa=Zv,Jv=tt,Qv=Rn;function eg(){this.size=0,this.__data__={hash:new Wa,map:new(Qv||Jv),string:new Wa}}var rg=eg;function tg(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}var ng=tg,ig=ng;function ag(r,e){var t=r.__data__;return ig(e)?t[typeof e=="string"?"string":"hash"]:t.map}var it=ag,og=it;function ug(r){var e=og(this,r).delete(r);return this.size-=e?1:0,e}var sg=ug,fg=it;function cg(r){return fg(this,r).get(r)}var lg=cg,pg=it;function hg(r){return pg(this,r).has(r)}var yg=hg,dg=it;function vg(r,e){var t=dg(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}var gg=vg,_g=rg,mg=sg,bg=lg,wg=yg,$g=gg;function ze(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])}}ze.prototype.clear=_g,ze.prototype.delete=mg,ze.prototype.get=bg,ze.prototype.has=wg,ze.prototype.set=$g;var Mn=ze,Eg=tt,Ag=Rn,Og=Mn,Sg=200;function Tg(r,e){var t=this.__data__;if(t instanceof Eg){var n=t.__data__;if(!Ag||n.length<Sg-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new Og(n)}return t.set(r,e),this.size=t.size,this}var Ig=Tg,xg=tt,Pg=dv,Fg=gv,Rg=mv,Mg=wv,Dg=Ig;function Xe(r){var e=this.__data__=new xg(r);this.size=e.size}Xe.prototype.clear=Pg,Xe.prototype.delete=Fg,Xe.prototype.get=Rg,Xe.prototype.has=Mg,Xe.prototype.set=Dg;var Dn=Xe,Ng="__lodash_hash_undefined__";function Bg(r){return this.__data__.set(r,Ng),this}var Ug=Bg;function Cg(r){return this.__data__.has(r)}var Lg=Cg,jg=Mn,kg=Ug,Vg=Lg;function at(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new jg;++e<t;)this.add(r[e])}at.prototype.add=at.prototype.push=kg,at.prototype.has=Vg;var qg=at;function Gg(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 Hg=Gg;function Wg(r,e){return r.has(e)}var zg=Wg,Xg=qg,Yg=Hg,Kg=zg,Zg=1,Jg=2;function Qg(r,e,t,n,i,a){var o=t&Zg,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,p=!0,d=t&Jg?new Xg:void 0;for(a.set(r,e),a.set(e,r);++u<s;){var _=r[u],E=e[u];if(n)var $=o?n(E,_,u,e,r,a):n(_,E,u,r,e,a);if($!==void 0){if($)continue;p=!1;break}if(d){if(!Yg(e,function(b,S){if(!Kg(d,S)&&(_===b||i(_,b,t,n,a)))return d.push(S)})){p=!1;break}}else if(!(_===E||i(_,E,t,n,a))){p=!1;break}}return a.delete(r),a.delete(e),p}var za=Qg,e_=Q,r_=e_.Uint8Array,Xa=r_;function t_(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}var n_=t_;function i_(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}var a_=i_,Ya=Ve,Ka=Xa,o_=Zr,u_=za,s_=n_,f_=a_,c_=1,l_=2,p_="[object Boolean]",h_="[object Date]",y_="[object Error]",d_="[object Map]",v_="[object Number]",g_="[object RegExp]",__="[object Set]",m_="[object String]",b_="[object Symbol]",w_="[object ArrayBuffer]",$_="[object DataView]",Za=Ya?Ya.prototype:void 0,Nn=Za?Za.valueOf:void 0;function E_(r,e,t,n,i,a,o){switch(t){case $_:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case w_:return!(r.byteLength!=e.byteLength||!a(new Ka(r),new Ka(e)));case p_:case h_:case v_:return o_(+r,+e);case y_:return r.name==e.name&&r.message==e.message;case g_:case m_:return r==e+"";case d_:var s=s_;case __:var f=n&c_;if(s||(s=f_),r.size!=e.size&&!f)return!1;var c=o.get(r);if(c)return c==e;n|=l_,o.set(r,e);var l=u_(s(r),s(e),n,i,a,o);return o.delete(r),l;case b_:if(Nn)return Nn.call(r)==Nn.call(e)}return!1}var A_=E_;function O_(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}var Bn=O_,S_=Bn,T_=C;function I_(r,e,t){var n=e(r);return T_(r)?n:S_(n,t(r))}var Ja=I_;function x_(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 P_=x_;function F_(){return[]}var Qa=F_,R_=P_,M_=Qa,D_=Object.prototype,N_=D_.propertyIsEnumerable,eo=Object.getOwnPropertySymbols,B_=eo?function(r){return r==null?[]:(r=Object(r),R_(eo(r),function(e){return N_.call(r,e)}))}:M_,Un=B_,U_=Ja,C_=Un,L_=Ge;function j_(r){return U_(r,L_,C_)}var ro=j_,to=ro,k_=1,V_=Object.prototype,q_=V_.hasOwnProperty;function G_(r,e,t,n,i,a){var o=t&k_,s=to(r),f=s.length,c=to(e),l=c.length;if(f!=l&&!o)return!1;for(var u=f;u--;){var p=s[u];if(!(o?p in e:q_.call(e,p)))return!1}var d=a.get(r),_=a.get(e);if(d&&_)return d==e&&_==r;var E=!0;a.set(r,e),a.set(e,r);for(var $=o;++u<f;){p=s[u];var b=r[p],S=e[p];if(n)var h=o?n(S,b,p,e,r,a):n(b,S,p,r,e,a);if(!(h===void 0?b===S||i(b,S,t,n,a):h)){E=!1;break}$||($=p=="constructor")}if(E&&!$){var O=r.constructor,x=e.constructor;O!=x&&"constructor"in r&&"constructor"in e&&!(typeof O=="function"&&O instanceof O&&typeof x=="function"&&x instanceof x)&&(E=!1)}return a.delete(r),a.delete(e),E}var H_=G_,W_=Se,z_=Q,X_=W_(z_,"DataView"),Y_=X_,K_=Se,Z_=Q,J_=K_(Z_,"Promise"),Q_=J_,em=Se,rm=Q,tm=em(rm,"Set"),nm=tm,im=Se,am=Q,om=im(am,"WeakMap"),um=om,Cn=Y_,Ln=Rn,jn=Q_,kn=nm,Vn=um,no=oe,Ye=Ta,io="[object Map]",sm="[object Object]",ao="[object Promise]",oo="[object Set]",uo="[object WeakMap]",so="[object DataView]",fm=Ye(Cn),cm=Ye(Ln),lm=Ye(jn),pm=Ye(kn),hm=Ye(Vn),Ie=no;(Cn&&Ie(new Cn(new ArrayBuffer(1)))!=so||Ln&&Ie(new Ln)!=io||jn&&Ie(jn.resolve())!=ao||kn&&Ie(new kn)!=oo||Vn&&Ie(new Vn)!=uo)&&(Ie=function(r){var e=no(r),t=e==sm?r.constructor:void 0,n=t?Ye(t):"";if(n)switch(n){case fm:return so;case cm:return io;case lm:return ao;case pm:return oo;case hm:return uo}return e});var ot=Ie,qn=Dn,ym=za,dm=A_,vm=H_,fo=ot,co=C,lo=lr.exports,gm=Va,_m=1,po="[object Arguments]",ho="[object Array]",ut="[object Object]",mm=Object.prototype,yo=mm.hasOwnProperty;function bm(r,e,t,n,i,a){var o=co(r),s=co(e),f=o?ho:fo(r),c=s?ho:fo(e);f=f==po?ut:f,c=c==po?ut:c;var l=f==ut,u=c==ut,p=f==c;if(p&&lo(r)){if(!lo(e))return!1;o=!0,l=!1}if(p&&!l)return a||(a=new qn),o||gm(r)?ym(r,e,t,n,i,a):dm(r,e,f,t,n,i,a);if(!(t&_m)){var d=l&&yo.call(r,"__wrapped__"),_=u&&yo.call(e,"__wrapped__");if(d||_){var E=d?r.value():r,$=_?e.value():e;return a||(a=new qn),i(E,$,t,n,a)}}return p?(a||(a=new qn),vm(r,e,t,n,i,a)):!1}var wm=bm,$m=wm,vo=H;function go(r,e,t,n,i){return r===e?!0:r==null||e==null||!vo(r)&&!vo(e)?r!==r&&e!==e:$m(r,e,t,n,go,i)}var _o=go,Em=Dn,Am=_o,Om=1,Sm=2;function Tm(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 Em;if(n)var p=n(c,l,f,r,e,u);if(!(p===void 0?Am(l,c,Om|Sm,n,u):p))return!1}}return!0}var Im=Tm,xm=ve;function Pm(r){return r===r&&!xm(r)}var mo=Pm,Fm=mo,Rm=Ge;function Mm(r){for(var e=Rm(r),t=e.length;t--;){var n=e[t],i=r[n];e[t]=[n,i,Fm(i)]}return e}var Dm=Mm;function Nm(r,e){return function(t){return t==null?!1:t[r]===e&&(e!==void 0||r in Object(t))}}var bo=Nm,Bm=Im,Um=Dm,Cm=bo;function Lm(r){var e=Um(r);return e.length==1&&e[0][2]?Cm(e[0][0],e[0][1]):function(t){return t===r||Bm(t,r,e)}}var jm=Lm,km=oe,Vm=H,qm="[object Symbol]";function Gm(r){return typeof r=="symbol"||Vm(r)&&km(r)==qm}var st=Gm,Hm=C,Wm=st,zm=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xm=/^\w*$/;function Ym(r,e){if(Hm(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||Wm(r)?!0:Xm.test(r)||!zm.test(r)||e!=null&&r in Object(e)}var Gn=Ym,wo=Mn,Km="Expected a function";function Hn(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(Km);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(Hn.Cache||wo),t}Hn.Cache=wo;var Zm=Hn,Jm=Zm,Qm=500;function e0(r){var e=Jm(r,function(n){return t.size===Qm&&t.clear(),n}),t=e.cache;return e}var r0=e0,t0=r0,n0=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i0=/\\(\\)?/g,a0=t0(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(n0,function(t,n,i,a){e.push(i?a.replace(i0,"$1"):n||t)}),e}),o0=a0;function u0(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 ft=u0,$o=Ve,s0=ft,f0=C,c0=st,l0=1/0,Eo=$o?$o.prototype:void 0,Ao=Eo?Eo.toString:void 0;function Oo(r){if(typeof r=="string")return r;if(f0(r))return s0(r,Oo)+"";if(c0(r))return Ao?Ao.call(r):"";var e=r+"";return e=="0"&&1/r==-l0?"-0":e}var p0=Oo,h0=p0;function y0(r){return r==null?"":h0(r)}var d0=y0,v0=C,g0=Gn,_0=o0,m0=d0;function b0(r,e){return v0(r)?r:g0(r,e)?[r]:_0(m0(r))}var ct=b0,w0=st,$0=1/0;function E0(r){if(typeof r=="string"||w0(r))return r;var e=r+"";return e=="0"&&1/r==-$0?"-0":e}var hr=E0,A0=ct,O0=hr;function S0(r,e){e=A0(e,r);for(var t=0,n=e.length;r!=null&&t<n;)r=r[O0(e[t++])];return t&&t==n?r:void 0}var Wn=S0,T0=Wn;function I0(r,e,t){var n=r==null?void 0:T0(r,e);return n===void 0?t:n}var x0=I0;function P0(r,e){return r!=null&&e in Object(r)}var F0=P0,R0=ct,M0=In,D0=C,N0=Tn,B0=Sn,U0=hr;function C0(r,e,t){e=R0(e,r);for(var n=-1,i=e.length,a=!1;++n<i;){var o=U0(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&&B0(i)&&N0(o,i)&&(D0(r)||M0(r)))}var L0=C0,j0=F0,k0=L0;function V0(r,e){return r!=null&&k0(r,e,j0)}var q0=V0,G0=_o,H0=x0,W0=q0,z0=Gn,X0=mo,Y0=bo,K0=hr,Z0=1,J0=2;function Q0(r,e){return z0(r)&&X0(e)?Y0(K0(r),e):function(t){var n=H0(t,r);return n===void 0&&n===e?W0(t,r):G0(e,n,Z0|J0)}}var eb=Q0;function rb(r){return function(e){return e?.[r]}}var tb=rb,nb=Wn;function ib(r){return function(e){return nb(e,r)}}var ab=ib,ob=tb,ub=ab,sb=Gn,fb=hr;function cb(r){return sb(r)?ob(fb(r)):ub(r)}var lb=cb,pb=jm,hb=eb,yb=Jr,db=C,vb=lb;function gb(r){return typeof r=="function"?r:r==null?yb:typeof r=="object"?db(r)?hb(r[0],r[1]):pb(r):vb(r)}var So=gb,_b=ld,mb=qd,bb=So,wb=C,$b=Ba;function Eb(r,e,t){var n=wb(r)?_b:mb;return t&&$b(r,e,t)&&(e=void 0),n(r,bb(e))}var zn=Eb;Object.defineProperty(Te,"__esModule",{value:!0}),Te.calculatePadding=Tb,Te.slicePadding=Ib;var Ab=zn,Ob=Sb(Ab);function Sb(r){return r&&r.__esModule?r:{default:r}}function Tb(r){switch(r%4){case 0:return 0;case 1:return 3;case 2:return 2;case 3:return 1;default:return null}}function Ib(r,e){var t=r.slice(e),n=(0,Ob.default)(t.buffer(),function(i){return i===0});if(n!==!0)throw new Error("XDR Read Error: invalid padding")}Object.defineProperty(et,"__esModule",{value:!0}),et.Cursor=void 0;var xb=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}}(),Pb=Te;function Fb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var Xn=function(){function r(e){Fb(this,r),e instanceof y||(e=typeof e=="number"?y.alloc(e):y.from(e)),this._setBuffer(e),this.rewind()}return xb(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 y?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=y.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,Pb.calculatePadding)(t.length),i=y.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){Xn.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){Xn.prototype[e]=function(n){return this.buffer()[e](n,this.tell()),this.seek("+",r[0]),this}})}),et.Cursor=Xn,Object.defineProperty(M,"__esModule",{value:!0}),M.default=Cb;var Rb=Oa.exports,To=xo(Rb),Mb=An,Db=xo(Mb),Io=et;function xo(r){return r&&r.__esModule?r:{default:r}}var Nb=Math.pow(2,16),Bb={toXDR:function(e){var t=new Io.Cursor(Nb);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=y.from(e,"hex");break;case"base64":n=y.from(e,"base64");break;default:throw new Error("Invalid format "+t+', must be "raw", "hex", "base64"')}var i=new Io.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}}},Ub={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 Cb(r){(0,To.default)(r,Bb),(0,Db.default)(r)&&(0,To.default)(r.prototype,Ub)}Object.defineProperty(ae,"__esModule",{value:!0}),ae.Int=void 0;var Lb=Kr,Po=Fo(Lb),jb=M,kb=Fo(jb);function Fo(r){return r&&r.__esModule?r:{default:r}}var yr=ae.Int={read:function(e){return e.readInt32BE()},write:function(e,t){if(!(0,Po.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,Po.default)(e)||Math.floor(e)!==e?!1:e>=yr.MIN_VALUE&&e<=yr.MAX_VALUE}};yr.MAX_VALUE=Math.pow(2,31)-1,yr.MIN_VALUE=-Math.pow(2,31),(0,kb.default)(yr);var lt={};function Vb(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 Yn={exports:{}};(function(r){/**
24
+ `+e.prev}function Wr(r,e){var t=cn(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 un=="function"?un(r):[],o;if(Le){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||Le&&o["$"+f]instanceof Symbol||(Yi.call(/[^\w$]/,f)?n.push(e(f,r)+": "+e(r[f],r)):n.push(f+": "+e(r[f],r)));if(typeof un=="function")for(var c=0;c<a.length;c++)Ji.call(r,a[c])&&n.push("["+e(a[c])+"]: "+e(r[a[c]],r));return n}var hn=Lt,je=Ms,Ic=fc,xc=hn("%TypeError%"),zr=hn("%WeakMap%",!0),Xr=hn("%Map%",!0),Pc=je("WeakMap.prototype.get",!0),Fc=je("WeakMap.prototype.set",!0),Rc=je("WeakMap.prototype.has",!0),Mc=je("Map.prototype.get",!0),Dc=je("Map.prototype.set",!0),Nc=je("Map.prototype.has",!0),yn=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},Bc=function(r,e){var t=yn(r,e);return t&&t.value},Uc=function(r,e,t){var n=yn(r,e);n?n.value=t:r.next={key:e,next:r.next,value:t}},Cc=function(r,e){return!!yn(r,e)},Lc=function(){var e,t,n,i={assert:function(a){if(!i.has(a))throw new xc("Side channel does not contain "+Ic(a))},get:function(a){if(zr&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Pc(e,a)}else if(Xr){if(t)return Mc(t,a)}else if(n)return Bc(n,a)},has:function(a){if(zr&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Rc(e,a)}else if(Xr){if(t)return Nc(t,a)}else if(n)return Cc(n,a);return!1},set:function(a,o){zr&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new zr),Fc(e,a,o)):Xr?(t||(t=new Xr),Dc(t,a,o)):(n||(n={key:{},next:null}),Uc(n,a,o))}};return i},jc=String.prototype.replace,kc=/%20/g,dn={RFC1738:"RFC1738",RFC3986:"RFC3986"},vn={default:dn.RFC3986,formatters:{RFC1738:function(r){return jc.call(r,kc,"+")},RFC3986:function(r){return String(r)}},RFC1738:dn.RFC1738,RFC3986:dn.RFC3986},Vc=vn,gn=Object.prototype.hasOwnProperty,Oe=Array.isArray,J=function(){for(var r=[],e=0;e<256;++e)r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return r}(),qc=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(Oe(n)){for(var i=[],a=0;a<n.length;++a)typeof n[a]<"u"&&i.push(n[a]);t.obj[t.prop]=i}}},fa=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},Gc=function r(e,t,n){if(!t)return e;if(typeof t!="object"){if(Oe(e))e.push(t);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!gn.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 Oe(e)&&!Oe(t)&&(i=fa(e,n)),Oe(e)&&Oe(t)?(t.forEach(function(a,o){if(gn.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 gn.call(a,o)?a[o]=r(a[o],s,n):a[o]=s,a},i)},Hc=function(e,t){return Object.keys(t).reduce(function(n,i){return n[i]=t[i],n},e)},Wc=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}},zc=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===Vc.RFC1738&&(c===40||c===41)){s+=o.charAt(f);continue}if(c<128){s=s+J[c];continue}if(c<2048){s=s+(J[192|c>>6]+J[128|c&63]);continue}if(c<55296||c>=57344){s=s+(J[224|c>>12]+J[128|c>>6&63]+J[128|c&63]);continue}f+=1,c=65536+((c&1023)<<10|o.charCodeAt(f)&1023),s+=J[240|c>>18]+J[128|c>>12&63]+J[128|c>>6&63]+J[128|c&63]}return s},Xc=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 qc(t),e},Yc=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Kc=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Zc=function(e,t){return[].concat(e,t)},Jc=function(e,t){if(Oe(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(t(e[i]));return n}return t(e)},ca={arrayToObject:fa,assign:Hc,combine:Zc,compact:Xc,decode:Wc,encode:zc,isBuffer:Kc,isRegExp:Yc,maybeMap:Jc,merge:Gc},la=Lc,_n=ca,ur=vn,Qc=Object.prototype.hasOwnProperty,pa={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},ie=Array.isArray,el=String.prototype.split,rl=Array.prototype.push,ha=function(r,e){rl.apply(r,ie(e)?e:[e])},tl=Date.prototype.toISOString,ya=ur.default,U={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:_n.encode,encodeValuesOnly:!1,format:ya,formatter:ur.formatters[ya],indices:!1,serializeDate:function(e){return tl.call(e)},skipNulls:!1,strictNullHandling:!1},nl=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},mn={},il=function r(e,t,n,i,a,o,s,f,c,l,u,p,d,_,E,$){for(var b=e,S=$,h=0,O=!1;(S=S.get(mn))!==void 0&&!O;){var x=S.get(e);if(h+=1,typeof x<"u"){if(x===h)throw new RangeError("Cyclic object value");O=!0}typeof S.get(mn)>"u"&&(h=0)}if(typeof f=="function"?b=f(t,b):b instanceof Date?b=u(b):n==="comma"&&ie(b)&&(b=_n.maybeMap(b,function(ai){return ai instanceof Date?u(ai):ai})),b===null){if(a)return s&&!_?s(t,U.encoder,E,"key",p):t;b=""}if(nl(b)||_n.isBuffer(b)){if(s){var R=_?t:s(t,U.encoder,E,"key",p);if(n==="comma"&&_){for(var m=el.call(String(b),","),v="",g=0;g<m.length;++g)v+=(g===0?"":",")+d(s(m[g],U.encoder,E,"value",p));return[d(R)+(i&&ie(b)&&m.length===1?"[]":"")+"="+v]}return[d(R)+"="+d(s(b,U.encoder,E,"value",p))]}return[d(t)+"="+d(String(b))]}var w=[];if(typeof b>"u")return w;var A;if(n==="comma"&&ie(b))A=[{value:b.length>0?b.join(",")||null:void 0}];else if(ie(f))A=f;else{var L=Object.keys(b);A=c?L.sort(c):L}for(var ee=i&&ie(b)&&b.length===1?t+"[]":t,ge=0;ge<A.length;++ge){var se=A[ge],Ir=typeof se=="object"&&typeof se.value<"u"?se.value:b[se];if(!(o&&Ir===null)){var F2=ie(b)?typeof n=="function"?n(ee,se):ee:ee+(l?"."+se:"["+se+"]");$.set(e,h);var es=la();es.set(mn,$),ha(w,r(Ir,F2,n,i,a,o,s,f,c,l,u,p,d,_,E,es))}}return w},al=function(e){if(!e)return U;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||U.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=ur.default;if(typeof e.format<"u"){if(!Qc.call(ur.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=ur.formatters[n],a=U.filter;return(typeof e.filter=="function"||ie(e.filter))&&(a=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:U.addQueryPrefix,allowDots:typeof e.allowDots>"u"?U.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:U.charsetSentinel,delimiter:typeof e.delimiter>"u"?U.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:U.encode,encoder:typeof e.encoder=="function"?e.encoder:U.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:U.encodeValuesOnly,filter:a,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:U.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:U.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:U.strictNullHandling}},ol=function(r,e){var t=r,n=al(e),i,a;typeof n.filter=="function"?(a=n.filter,t=a("",t)):ie(n.filter)&&(a=n.filter,i=a);var o=[];if(typeof t!="object"||t===null)return"";var s;e&&e.arrayFormat in pa?s=e.arrayFormat:e&&"indices"in e?s=e.indices?"indices":"repeat":s="indices";var f=pa[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=la(),u=0;u<i.length;++u){var p=i[u];n.skipNulls&&t[p]===null||ha(o,il(t[p],p,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 d=o.join(n.delimiter),_=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?_+="utf8=%26%2310003%3B&":_+="utf8=%E2%9C%93&"),d.length>0?_+d:""},ke=ca,bn=Object.prototype.hasOwnProperty,ul=Array.isArray,B={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:ke.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},sl=function(r){return r.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},da=function(r,e){return r&&typeof r=="string"&&e.comma&&r.indexOf(",")>-1?r.split(","):r},fl="utf8=%26%2310003%3B",cl="utf8=%E2%9C%93",ll=function(e,t){var n={},i=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=t.parameterLimit===1/0?void 0:t.parameterLimit,o=i.split(t.delimiter,a),s=-1,f,c=t.charset;if(t.charsetSentinel)for(f=0;f<o.length;++f)o[f].indexOf("utf8=")===0&&(o[f]===cl?c="utf-8":o[f]===fl&&(c="iso-8859-1"),s=f,f=o.length);for(f=0;f<o.length;++f)if(f!==s){var l=o[f],u=l.indexOf("]="),p=u===-1?l.indexOf("="):u+1,d,_;p===-1?(d=t.decoder(l,B.decoder,c,"key"),_=t.strictNullHandling?null:""):(d=t.decoder(l.slice(0,p),B.decoder,c,"key"),_=ke.maybeMap(da(l.slice(p+1),t),function(E){return t.decoder(E,B.decoder,c,"value")})),_&&t.interpretNumericEntities&&c==="iso-8859-1"&&(_=sl(_)),l.indexOf("[]=")>-1&&(_=ul(_)?[_]:_),bn.call(n,d)?n[d]=ke.combine(n[d],_):n[d]=_}return n},pl=function(r,e,t,n){for(var i=n?e:da(e,t),a=r.length-1;a>=0;--a){var o,s=r[a];if(s==="[]"&&t.parseArrays)o=[].concat(i);else{o=t.plainObjects?Object.create(null):{};var f=s.charAt(0)==="["&&s.charAt(s.length-1)==="]"?s.slice(1,-1):s,c=parseInt(f,10);!t.parseArrays&&f===""?o={0:i}:!isNaN(c)&&s!==f&&String(c)===f&&c>=0&&t.parseArrays&&c<=t.arrayLimit?(o=[],o[c]=i):f!=="__proto__"&&(o[f]=i)}i=o}return i},hl=function(e,t,n,i){if(!!e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,f=n.depth>0&&o.exec(a),c=f?a.slice(0,f.index):a,l=[];if(c){if(!n.plainObjects&&bn.call(Object.prototype,c)&&!n.allowPrototypes)return;l.push(c)}for(var u=0;n.depth>0&&(f=s.exec(a))!==null&&u<n.depth;){if(u+=1,!n.plainObjects&&bn.call(Object.prototype,f[1].slice(1,-1))&&!n.allowPrototypes)return;l.push(f[1])}return f&&l.push("["+a.slice(f.index)+"]"),pl(l,t,n,i)}},yl=function(e){if(!e)return B;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");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 t=typeof e.charset>"u"?B.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?B.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:B.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:B.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:B.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:B.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:B.comma,decoder:typeof e.decoder=="function"?e.decoder:B.decoder,delimiter:typeof e.delimiter=="string"||ke.isRegExp(e.delimiter)?e.delimiter:B.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:B.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:B.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:B.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:B.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:B.strictNullHandling}},dl=function(r,e){var t=yl(e);if(r===""||r===null||typeof r>"u")return t.plainObjects?Object.create(null):{};for(var n=typeof r=="string"?ll(r,t):r,i=t.plainObjects?Object.create(null):{},a=Object.keys(n),o=0;o<a.length;++o){var s=a[o],f=hl(s,n[s],t,typeof r=="string");i=ke.merge(i,f,t)}return t.allowSparse===!0?i:ke.compact(i)},vl=ol,gl=dl,_l=vn,ml={formats:_l,parse:gl,stringify:vl};let va={storeIdentifier:"",environment:"prod"};function bl(r){va=r}function sr(){return va}const wl=r=>r==="stage"?"https://api.stage.rechargeapps.com":"https://api.rechargeapps.com",$l=r=>r==="stage"?"https://admin.stage.rechargeapps.com":"https://admin.rechargeapps.com",El=r=>r==="stage"?"https://static.stage.rechargecdn.com":"https://static.rechargecdn.com",Al="/tools/recurring";var Ol=Object.defineProperty,ga=Object.getOwnPropertySymbols,Sl=Object.prototype.hasOwnProperty,Tl=Object.prototype.propertyIsEnumerable,_a=(r,e,t)=>e in r?Ol(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,wn=(r,e)=>{for(var t in e||(e={}))Sl.call(e,t)&&_a(r,t,e[t]);if(ga)for(var t of ga(e))Tl.call(e,t)&&_a(r,t,e[t]);return r};function Il(r){return ml.stringify(r,{encode:!1,indices:!1,arrayFormat:"comma"})}async function Yr(r,e,t={}){const n=sr();return de(r,`${El(n.environment)}/store/${n.storeIdentifier}${e}`,t)}async function T(r,e,{id:t,query:n,data:i,headers:a}={},o){const{environment:s,storeIdentifier:f}=sr(),c=o.apiToken,l=wl(s),u=wn({"X-Recharge-Access-Token":c,"X-Recharge-Version":"2021-11"},a||{}),p=wn({shop_url:f},n);return de(r,`${l}${e}`,{id:t,query:p,data:i,headers:u})}async function $n(r,e,t={}){return de(r,`${Al}${e}`,t)}async function de(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 p=[u,Il(n)].join("&").replace(/^&/,"");o=`${o}${p?`?${p}`:""}`}let s;i&&r!=="get"&&(s=JSON.stringify(i));const f=wn({Accept:"application/json","Content-Type":"application/json","X-Recharge-App":"storefront-client"},a||{}),c=await fetch(o,{method:r,headers:f,body:s,mode:"cors"});let l;try{l=await c.json()}catch{}if(!c.ok)throw l&&l.error?new Error(`${c.status}: ${l.error}`):new Error("A connection error occurred while making the request");return l}function xl(r,e){return T("get","/addresses",{query:e},r)}async function Pl(r,e){const{address:t}=await T("get","/addresses",{id:e},r);return t}async function Fl(r,e){const{address:t}=await T("post","/addresses",{data:e},r);return t}async function Rl(r,e,t){const{address:n}=await T("put","/addresses",{id:e,data:t},r);return n}function Ml(r,e){return T("delete","/addresses",{id:e},r)}async function Dl(r,e){const{address:t}=await T("post","/addresses/merge",{data:e},r);return t}async function Nl(r,e,t){const{charge:n}=await T("post",`/addresses/${e}/charges/skip`,{data:t},r);return n}var Bl=Object.freeze({__proto__:null,listAddresses:xl,getAddress:Pl,createAddress:Fl,updateAddress:Rl,deleteAddress:Ml,mergeAddresses:Dl,skipFutureCharge:Nl});async function Ul(){const{storefrontAccessToken:r}=sr(),e={};r&&(e["X-Recharge-Storefront-Access-Token"]=r);const t=await $n("get","/access",{headers:e});return{apiToken:t.api_token,customerId:t.customer_id}}async function Cl(r,e){const{environment:t,storeIdentifier:n}=sr(),i=$l(t),a=await de("post",`${i}/shopify_storefront_access`,{data:{customer_token:r,storefront_token:e,shop_url:n},headers:{"X-Recharge-App":"storefront-client"}});return a.api_token?{apiToken:a.api_token,customerId:a.customer_id}:null}var Ll=Object.freeze({__proto__:null,loginShopifyAppProxy:Ul,loginShopifyApi:Cl}),ma={},En={},ae={},jl=typeof re=="object"&&re&&re.Object===Object&&re,ba=jl,kl=ba,Vl=typeof self=="object"&&self&&self.Object===Object&&self,ql=kl||Vl||Function("return this")(),Q=ql,Gl=Q,Hl=Gl.Symbol,Ve=Hl,wa=Ve,$a=Object.prototype,Wl=$a.hasOwnProperty,zl=$a.toString,fr=wa?wa.toStringTag:void 0;function Xl(r){var e=Wl.call(r,fr),t=r[fr];try{r[fr]=void 0;var n=!0}catch{}var i=zl.call(r);return n&&(e?r[fr]=t:delete r[fr]),i}var Yl=Xl,Kl=Object.prototype,Zl=Kl.toString;function Jl(r){return Zl.call(r)}var Ql=Jl,Ea=Ve,ep=Yl,rp=Ql,tp="[object Null]",np="[object Undefined]",Aa=Ea?Ea.toStringTag:void 0;function ip(r){return r==null?r===void 0?np:tp:Aa&&Aa in Object(r)?ep(r):rp(r)}var oe=ip;function ap(r){return r!=null&&typeof r=="object"}var H=ap,op=oe,up=H,sp="[object Number]";function fp(r){return typeof r=="number"||up(r)&&op(r)==sp}var Kr=fp,M={},Oa={exports:{}};function cp(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var ve=cp,lp=oe,pp=ve,hp="[object AsyncFunction]",yp="[object Function]",dp="[object GeneratorFunction]",vp="[object Proxy]";function gp(r){if(!pp(r))return!1;var e=lp(r);return e==yp||e==dp||e==hp||e==vp}var An=gp,_p=Q,mp=_p["__core-js_shared__"],bp=mp,On=bp,Sa=function(){var r=/[^.]+$/.exec(On&&On.keys&&On.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function wp(r){return!!Sa&&Sa in r}var $p=wp,Ep=Function.prototype,Ap=Ep.toString;function Op(r){if(r!=null){try{return Ap.call(r)}catch{}try{return r+""}catch{}}return""}var Ta=Op,Sp=An,Tp=$p,Ip=ve,xp=Ta,Pp=/[\\^$.*+?()[\]{}|]/g,Fp=/^\[object .+?Constructor\]$/,Rp=Function.prototype,Mp=Object.prototype,Dp=Rp.toString,Np=Mp.hasOwnProperty,Bp=RegExp("^"+Dp.call(Np).replace(Pp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Up(r){if(!Ip(r)||Tp(r))return!1;var e=Sp(r)?Bp:Fp;return e.test(xp(r))}var Cp=Up;function Lp(r,e){return r?.[e]}var jp=Lp,kp=Cp,Vp=jp;function qp(r,e){var t=Vp(r,e);return kp(t)?t:void 0}var Se=qp,Gp=Se,Hp=function(){try{var r=Gp(Object,"defineProperty");return r({},"",{}),r}catch{}}(),Ia=Hp,xa=Ia;function Wp(r,e,t){e=="__proto__"&&xa?xa(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}var Pa=Wp;function zp(r,e){return r===e||r!==r&&e!==e}var Zr=zp,Xp=Pa,Yp=Zr,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 Fa=Jp,Qp=Fa,eh=Pa;function rh(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?eh(t,s,f):Qp(t,s,f)}return t}var qe=rh;function th(r){return r}var Jr=th;function nh(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 ih=nh,ah=ih,Ra=Math.max;function oh(r,e,t){return e=Ra(e===void 0?r.length-1:e,0),function(){for(var n=arguments,i=-1,a=Ra(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),ah(r,this,s)}}var Ma=oh;function uh(r){return function(){return r}}var sh=uh,fh=sh,Da=Ia,ch=Jr,lh=Da?function(r,e){return Da(r,"toString",{configurable:!0,enumerable:!1,value:fh(e),writable:!0})}:ch,ph=lh,hh=800,yh=16,dh=Date.now;function vh(r){var e=0,t=0;return function(){var n=dh(),i=yh-(n-t);if(t=n,i>0){if(++e>=hh)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}var gh=vh,_h=ph,mh=gh,bh=mh(_h),Na=bh,wh=Jr,$h=Ma,Eh=Na;function Ah(r,e){return Eh($h(r,e,wh),r+"")}var Oh=Ah,Sh=9007199254740991;function Th(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Sh}var Sn=Th,Ih=An,xh=Sn;function Ph(r){return r!=null&&xh(r.length)&&!Ih(r)}var cr=Ph,Fh=9007199254740991,Rh=/^(?:0|[1-9]\d*)$/;function Mh(r,e){var t=typeof r;return e=e??Fh,!!e&&(t=="number"||t!="symbol"&&Rh.test(r))&&r>-1&&r%1==0&&r<e}var Tn=Mh,Dh=Zr,Nh=cr,Bh=Tn,Uh=ve;function Ch(r,e,t){if(!Uh(t))return!1;var n=typeof e;return(n=="number"?Nh(t)&&Bh(e,t.length):n=="string"&&e in t)?Dh(t[e],r):!1}var Ba=Ch,Lh=Oh,jh=Ba;function kh(r){return Lh(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&&jh(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 Vh=kh;function qh(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var Ua=qh,Gh=oe,Hh=H,Wh="[object Arguments]";function zh(r){return Hh(r)&&Gh(r)==Wh}var Xh=zh,Ca=Xh,Yh=H,La=Object.prototype,Kh=La.hasOwnProperty,Zh=La.propertyIsEnumerable,Jh=Ca(function(){return arguments}())?Ca:function(r){return Yh(r)&&Kh.call(r,"callee")&&!Zh.call(r,"callee")},In=Jh,Qh=Array.isArray,C=Qh,lr={exports:{}};function ey(){return!1}var ry=ey;(function(r,e){var t=Q,n=ry,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})(lr,lr.exports);var ty=oe,ny=Sn,iy=H,ay="[object Arguments]",oy="[object Array]",uy="[object Boolean]",sy="[object Date]",fy="[object Error]",cy="[object Function]",ly="[object Map]",py="[object Number]",hy="[object Object]",yy="[object RegExp]",dy="[object Set]",vy="[object String]",gy="[object WeakMap]",_y="[object ArrayBuffer]",my="[object DataView]",by="[object Float32Array]",wy="[object Float64Array]",$y="[object Int8Array]",Ey="[object Int16Array]",Ay="[object Int32Array]",Oy="[object Uint8Array]",Sy="[object Uint8ClampedArray]",Ty="[object Uint16Array]",Iy="[object Uint32Array]",F={};F[by]=F[wy]=F[$y]=F[Ey]=F[Ay]=F[Oy]=F[Sy]=F[Ty]=F[Iy]=!0,F[ay]=F[oy]=F[_y]=F[uy]=F[my]=F[sy]=F[fy]=F[cy]=F[ly]=F[py]=F[hy]=F[yy]=F[dy]=F[vy]=F[gy]=!1;function xy(r){return iy(r)&&ny(r.length)&&!!F[ty(r)]}var Py=xy;function Fy(r){return function(e){return r(e)}}var xn=Fy,pr={exports:{}};(function(r,e){var t=ba,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})(pr,pr.exports);var Ry=Py,My=xn,ja=pr.exports,ka=ja&&ja.isTypedArray,Dy=ka?My(ka):Ry,Va=Dy,Ny=Ua,By=In,Uy=C,Cy=lr.exports,Ly=Tn,jy=Va,ky=Object.prototype,Vy=ky.hasOwnProperty;function qy(r,e){var t=Uy(r),n=!t&&By(r),i=!t&&!n&&Cy(r),a=!t&&!n&&!i&&jy(r),o=t||n||i||a,s=o?Ny(r.length,String):[],f=s.length;for(var c in r)(e||Vy.call(r,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Ly(c,f)))&&s.push(c);return s}var qa=qy,Gy=Object.prototype;function Hy(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Gy;return r===t}var Pn=Hy;function Wy(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}var zy=Wy,Xy=ve,Yy=Pn,Ky=zy,Zy=Object.prototype,Jy=Zy.hasOwnProperty;function Qy(r){if(!Xy(r))return Ky(r);var e=Yy(r),t=[];for(var n in r)n=="constructor"&&(e||!Jy.call(r,n))||t.push(n);return t}var ed=Qy,rd=qa,td=ed,nd=cr;function id(r){return nd(r)?rd(r,!0):td(r)}var Qr=id,ad=qe,od=Vh,ud=Qr,sd=od(function(r,e){ad(e,ud(e),r)}),fd=sd;(function(r){r.exports=fd})(Oa);var et={},Te={};function cd(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 ld=cd;function pd(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 hd=pd,yd=hd,dd=yd(),vd=dd;function gd(r,e){return function(t){return r(e(t))}}var Ga=gd,_d=Ga,md=_d(Object.keys,Object),bd=md,wd=Pn,$d=bd,Ed=Object.prototype,Ad=Ed.hasOwnProperty;function Od(r){if(!wd(r))return $d(r);var e=[];for(var t in Object(r))Ad.call(r,t)&&t!="constructor"&&e.push(t);return e}var Sd=Od,Td=qa,Id=Sd,xd=cr;function Pd(r){return xd(r)?Td(r):Id(r)}var Ge=Pd,Fd=vd,Rd=Ge;function Md(r,e){return r&&Fd(r,e,Rd)}var Dd=Md,Nd=cr;function Bd(r,e){return function(t,n){if(t==null)return t;if(!Nd(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 Ud=Bd,Cd=Dd,Ld=Ud,jd=Ld(Cd),Fn=jd,kd=Fn;function Vd(r,e){var t=!0;return kd(r,function(n,i,a){return t=!!e(n,i,a),t}),t}var qd=Vd;function Gd(){this.__data__=[],this.size=0}var Hd=Gd,Wd=Zr;function zd(r,e){for(var t=r.length;t--;)if(Wd(r[t][0],e))return t;return-1}var rt=zd,Xd=rt,Yd=Array.prototype,Kd=Yd.splice;function Zd(r){var e=this.__data__,t=Xd(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():Kd.call(e,t,1),--this.size,!0}var Jd=Zd,Qd=rt;function ev(r){var e=this.__data__,t=Qd(e,r);return t<0?void 0:e[t][1]}var rv=ev,tv=rt;function nv(r){return tv(this.__data__,r)>-1}var iv=nv,av=rt;function ov(r,e){var t=this.__data__,n=av(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var uv=ov,sv=Hd,fv=Jd,cv=rv,lv=iv,pv=uv;function He(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])}}He.prototype.clear=sv,He.prototype.delete=fv,He.prototype.get=cv,He.prototype.has=lv,He.prototype.set=pv;var tt=He,hv=tt;function yv(){this.__data__=new hv,this.size=0}var dv=yv;function vv(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}var gv=vv;function _v(r){return this.__data__.get(r)}var mv=_v;function bv(r){return this.__data__.has(r)}var wv=bv,$v=Se,Ev=Q,Av=$v(Ev,"Map"),Rn=Av,Ov=Se,Sv=Ov(Object,"create"),nt=Sv,Ha=nt;function Tv(){this.__data__=Ha?Ha(null):{},this.size=0}var Iv=Tv;function xv(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var Pv=xv,Fv=nt,Rv="__lodash_hash_undefined__",Mv=Object.prototype,Dv=Mv.hasOwnProperty;function Nv(r){var e=this.__data__;if(Fv){var t=e[r];return t===Rv?void 0:t}return Dv.call(e,r)?e[r]:void 0}var Bv=Nv,Uv=nt,Cv=Object.prototype,Lv=Cv.hasOwnProperty;function jv(r){var e=this.__data__;return Uv?e[r]!==void 0:Lv.call(e,r)}var kv=jv,Vv=nt,qv="__lodash_hash_undefined__";function Gv(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Vv&&e===void 0?qv:e,this}var Hv=Gv,Wv=Iv,zv=Pv,Xv=Bv,Yv=kv,Kv=Hv;function We(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])}}We.prototype.clear=Wv,We.prototype.delete=zv,We.prototype.get=Xv,We.prototype.has=Yv,We.prototype.set=Kv;var Zv=We,Wa=Zv,Jv=tt,Qv=Rn;function eg(){this.size=0,this.__data__={hash:new Wa,map:new(Qv||Jv),string:new Wa}}var rg=eg;function tg(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}var ng=tg,ig=ng;function ag(r,e){var t=r.__data__;return ig(e)?t[typeof e=="string"?"string":"hash"]:t.map}var it=ag,og=it;function ug(r){var e=og(this,r).delete(r);return this.size-=e?1:0,e}var sg=ug,fg=it;function cg(r){return fg(this,r).get(r)}var lg=cg,pg=it;function hg(r){return pg(this,r).has(r)}var yg=hg,dg=it;function vg(r,e){var t=dg(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}var gg=vg,_g=rg,mg=sg,bg=lg,wg=yg,$g=gg;function ze(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])}}ze.prototype.clear=_g,ze.prototype.delete=mg,ze.prototype.get=bg,ze.prototype.has=wg,ze.prototype.set=$g;var Mn=ze,Eg=tt,Ag=Rn,Og=Mn,Sg=200;function Tg(r,e){var t=this.__data__;if(t instanceof Eg){var n=t.__data__;if(!Ag||n.length<Sg-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new Og(n)}return t.set(r,e),this.size=t.size,this}var Ig=Tg,xg=tt,Pg=dv,Fg=gv,Rg=mv,Mg=wv,Dg=Ig;function Xe(r){var e=this.__data__=new xg(r);this.size=e.size}Xe.prototype.clear=Pg,Xe.prototype.delete=Fg,Xe.prototype.get=Rg,Xe.prototype.has=Mg,Xe.prototype.set=Dg;var Dn=Xe,Ng="__lodash_hash_undefined__";function Bg(r){return this.__data__.set(r,Ng),this}var Ug=Bg;function Cg(r){return this.__data__.has(r)}var Lg=Cg,jg=Mn,kg=Ug,Vg=Lg;function at(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new jg;++e<t;)this.add(r[e])}at.prototype.add=at.prototype.push=kg,at.prototype.has=Vg;var qg=at;function Gg(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 Hg=Gg;function Wg(r,e){return r.has(e)}var zg=Wg,Xg=qg,Yg=Hg,Kg=zg,Zg=1,Jg=2;function Qg(r,e,t,n,i,a){var o=t&Zg,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,p=!0,d=t&Jg?new Xg:void 0;for(a.set(r,e),a.set(e,r);++u<s;){var _=r[u],E=e[u];if(n)var $=o?n(E,_,u,e,r,a):n(_,E,u,r,e,a);if($!==void 0){if($)continue;p=!1;break}if(d){if(!Yg(e,function(b,S){if(!Kg(d,S)&&(_===b||i(_,b,t,n,a)))return d.push(S)})){p=!1;break}}else if(!(_===E||i(_,E,t,n,a))){p=!1;break}}return a.delete(r),a.delete(e),p}var za=Qg,e_=Q,r_=e_.Uint8Array,Xa=r_;function t_(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}var n_=t_;function i_(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}var a_=i_,Ya=Ve,Ka=Xa,o_=Zr,u_=za,s_=n_,f_=a_,c_=1,l_=2,p_="[object Boolean]",h_="[object Date]",y_="[object Error]",d_="[object Map]",v_="[object Number]",g_="[object RegExp]",__="[object Set]",m_="[object String]",b_="[object Symbol]",w_="[object ArrayBuffer]",$_="[object DataView]",Za=Ya?Ya.prototype:void 0,Nn=Za?Za.valueOf:void 0;function E_(r,e,t,n,i,a,o){switch(t){case $_:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case w_:return!(r.byteLength!=e.byteLength||!a(new Ka(r),new Ka(e)));case p_:case h_:case v_:return o_(+r,+e);case y_:return r.name==e.name&&r.message==e.message;case g_:case m_:return r==e+"";case d_:var s=s_;case __:var f=n&c_;if(s||(s=f_),r.size!=e.size&&!f)return!1;var c=o.get(r);if(c)return c==e;n|=l_,o.set(r,e);var l=u_(s(r),s(e),n,i,a,o);return o.delete(r),l;case b_:if(Nn)return Nn.call(r)==Nn.call(e)}return!1}var A_=E_;function O_(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}var Bn=O_,S_=Bn,T_=C;function I_(r,e,t){var n=e(r);return T_(r)?n:S_(n,t(r))}var Ja=I_;function x_(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 P_=x_;function F_(){return[]}var Qa=F_,R_=P_,M_=Qa,D_=Object.prototype,N_=D_.propertyIsEnumerable,eo=Object.getOwnPropertySymbols,B_=eo?function(r){return r==null?[]:(r=Object(r),R_(eo(r),function(e){return N_.call(r,e)}))}:M_,Un=B_,U_=Ja,C_=Un,L_=Ge;function j_(r){return U_(r,L_,C_)}var ro=j_,to=ro,k_=1,V_=Object.prototype,q_=V_.hasOwnProperty;function G_(r,e,t,n,i,a){var o=t&k_,s=to(r),f=s.length,c=to(e),l=c.length;if(f!=l&&!o)return!1;for(var u=f;u--;){var p=s[u];if(!(o?p in e:q_.call(e,p)))return!1}var d=a.get(r),_=a.get(e);if(d&&_)return d==e&&_==r;var E=!0;a.set(r,e),a.set(e,r);for(var $=o;++u<f;){p=s[u];var b=r[p],S=e[p];if(n)var h=o?n(S,b,p,e,r,a):n(b,S,p,r,e,a);if(!(h===void 0?b===S||i(b,S,t,n,a):h)){E=!1;break}$||($=p=="constructor")}if(E&&!$){var O=r.constructor,x=e.constructor;O!=x&&"constructor"in r&&"constructor"in e&&!(typeof O=="function"&&O instanceof O&&typeof x=="function"&&x instanceof x)&&(E=!1)}return a.delete(r),a.delete(e),E}var H_=G_,W_=Se,z_=Q,X_=W_(z_,"DataView"),Y_=X_,K_=Se,Z_=Q,J_=K_(Z_,"Promise"),Q_=J_,em=Se,rm=Q,tm=em(rm,"Set"),nm=tm,im=Se,am=Q,om=im(am,"WeakMap"),um=om,Cn=Y_,Ln=Rn,jn=Q_,kn=nm,Vn=um,no=oe,Ye=Ta,io="[object Map]",sm="[object Object]",ao="[object Promise]",oo="[object Set]",uo="[object WeakMap]",so="[object DataView]",fm=Ye(Cn),cm=Ye(Ln),lm=Ye(jn),pm=Ye(kn),hm=Ye(Vn),Ie=no;(Cn&&Ie(new Cn(new ArrayBuffer(1)))!=so||Ln&&Ie(new Ln)!=io||jn&&Ie(jn.resolve())!=ao||kn&&Ie(new kn)!=oo||Vn&&Ie(new Vn)!=uo)&&(Ie=function(r){var e=no(r),t=e==sm?r.constructor:void 0,n=t?Ye(t):"";if(n)switch(n){case fm:return so;case cm:return io;case lm:return ao;case pm:return oo;case hm:return uo}return e});var ot=Ie,qn=Dn,ym=za,dm=A_,vm=H_,fo=ot,co=C,lo=lr.exports,gm=Va,_m=1,po="[object Arguments]",ho="[object Array]",ut="[object Object]",mm=Object.prototype,yo=mm.hasOwnProperty;function bm(r,e,t,n,i,a){var o=co(r),s=co(e),f=o?ho:fo(r),c=s?ho:fo(e);f=f==po?ut:f,c=c==po?ut:c;var l=f==ut,u=c==ut,p=f==c;if(p&&lo(r)){if(!lo(e))return!1;o=!0,l=!1}if(p&&!l)return a||(a=new qn),o||gm(r)?ym(r,e,t,n,i,a):dm(r,e,f,t,n,i,a);if(!(t&_m)){var d=l&&yo.call(r,"__wrapped__"),_=u&&yo.call(e,"__wrapped__");if(d||_){var E=d?r.value():r,$=_?e.value():e;return a||(a=new qn),i(E,$,t,n,a)}}return p?(a||(a=new qn),vm(r,e,t,n,i,a)):!1}var wm=bm,$m=wm,vo=H;function go(r,e,t,n,i){return r===e?!0:r==null||e==null||!vo(r)&&!vo(e)?r!==r&&e!==e:$m(r,e,t,n,go,i)}var _o=go,Em=Dn,Am=_o,Om=1,Sm=2;function Tm(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 Em;if(n)var p=n(c,l,f,r,e,u);if(!(p===void 0?Am(l,c,Om|Sm,n,u):p))return!1}}return!0}var Im=Tm,xm=ve;function Pm(r){return r===r&&!xm(r)}var mo=Pm,Fm=mo,Rm=Ge;function Mm(r){for(var e=Rm(r),t=e.length;t--;){var n=e[t],i=r[n];e[t]=[n,i,Fm(i)]}return e}var Dm=Mm;function Nm(r,e){return function(t){return t==null?!1:t[r]===e&&(e!==void 0||r in Object(t))}}var bo=Nm,Bm=Im,Um=Dm,Cm=bo;function Lm(r){var e=Um(r);return e.length==1&&e[0][2]?Cm(e[0][0],e[0][1]):function(t){return t===r||Bm(t,r,e)}}var jm=Lm,km=oe,Vm=H,qm="[object Symbol]";function Gm(r){return typeof r=="symbol"||Vm(r)&&km(r)==qm}var st=Gm,Hm=C,Wm=st,zm=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xm=/^\w*$/;function Ym(r,e){if(Hm(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||Wm(r)?!0:Xm.test(r)||!zm.test(r)||e!=null&&r in Object(e)}var Gn=Ym,wo=Mn,Km="Expected a function";function Hn(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(Km);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(Hn.Cache||wo),t}Hn.Cache=wo;var Zm=Hn,Jm=Zm,Qm=500;function e0(r){var e=Jm(r,function(n){return t.size===Qm&&t.clear(),n}),t=e.cache;return e}var r0=e0,t0=r0,n0=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i0=/\\(\\)?/g,a0=t0(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(n0,function(t,n,i,a){e.push(i?a.replace(i0,"$1"):n||t)}),e}),o0=a0;function u0(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 ft=u0,$o=Ve,s0=ft,f0=C,c0=st,l0=1/0,Eo=$o?$o.prototype:void 0,Ao=Eo?Eo.toString:void 0;function Oo(r){if(typeof r=="string")return r;if(f0(r))return s0(r,Oo)+"";if(c0(r))return Ao?Ao.call(r):"";var e=r+"";return e=="0"&&1/r==-l0?"-0":e}var p0=Oo,h0=p0;function y0(r){return r==null?"":h0(r)}var d0=y0,v0=C,g0=Gn,_0=o0,m0=d0;function b0(r,e){return v0(r)?r:g0(r,e)?[r]:_0(m0(r))}var ct=b0,w0=st,$0=1/0;function E0(r){if(typeof r=="string"||w0(r))return r;var e=r+"";return e=="0"&&1/r==-$0?"-0":e}var hr=E0,A0=ct,O0=hr;function S0(r,e){e=A0(e,r);for(var t=0,n=e.length;r!=null&&t<n;)r=r[O0(e[t++])];return t&&t==n?r:void 0}var Wn=S0,T0=Wn;function I0(r,e,t){var n=r==null?void 0:T0(r,e);return n===void 0?t:n}var x0=I0;function P0(r,e){return r!=null&&e in Object(r)}var F0=P0,R0=ct,M0=In,D0=C,N0=Tn,B0=Sn,U0=hr;function C0(r,e,t){e=R0(e,r);for(var n=-1,i=e.length,a=!1;++n<i;){var o=U0(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&&B0(i)&&N0(o,i)&&(D0(r)||M0(r)))}var L0=C0,j0=F0,k0=L0;function V0(r,e){return r!=null&&k0(r,e,j0)}var q0=V0,G0=_o,H0=x0,W0=q0,z0=Gn,X0=mo,Y0=bo,K0=hr,Z0=1,J0=2;function Q0(r,e){return z0(r)&&X0(e)?Y0(K0(r),e):function(t){var n=H0(t,r);return n===void 0&&n===e?W0(t,r):G0(e,n,Z0|J0)}}var eb=Q0;function rb(r){return function(e){return e?.[r]}}var tb=rb,nb=Wn;function ib(r){return function(e){return nb(e,r)}}var ab=ib,ob=tb,ub=ab,sb=Gn,fb=hr;function cb(r){return sb(r)?ob(fb(r)):ub(r)}var lb=cb,pb=jm,hb=eb,yb=Jr,db=C,vb=lb;function gb(r){return typeof r=="function"?r:r==null?yb:typeof r=="object"?db(r)?hb(r[0],r[1]):pb(r):vb(r)}var So=gb,_b=ld,mb=qd,bb=So,wb=C,$b=Ba;function Eb(r,e,t){var n=wb(r)?_b:mb;return t&&$b(r,e,t)&&(e=void 0),n(r,bb(e))}var zn=Eb;Object.defineProperty(Te,"__esModule",{value:!0}),Te.calculatePadding=Tb,Te.slicePadding=Ib;var Ab=zn,Ob=Sb(Ab);function Sb(r){return r&&r.__esModule?r:{default:r}}function Tb(r){switch(r%4){case 0:return 0;case 1:return 3;case 2:return 2;case 3:return 1;default:return null}}function Ib(r,e){var t=r.slice(e),n=(0,Ob.default)(t.buffer(),function(i){return i===0});if(n!==!0)throw new Error("XDR Read Error: invalid padding")}Object.defineProperty(et,"__esModule",{value:!0}),et.Cursor=void 0;var xb=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}}(),Pb=Te;function Fb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var Xn=function(){function r(e){Fb(this,r),e instanceof y||(e=typeof e=="number"?y.alloc(e):y.from(e)),this._setBuffer(e),this.rewind()}return xb(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 y?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=y.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,Pb.calculatePadding)(t.length),i=y.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){Xn.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){Xn.prototype[e]=function(n){return this.buffer()[e](n,this.tell()),this.seek("+",r[0]),this}})}),et.Cursor=Xn,Object.defineProperty(M,"__esModule",{value:!0}),M.default=Cb;var Rb=Oa.exports,To=xo(Rb),Mb=An,Db=xo(Mb),Io=et;function xo(r){return r&&r.__esModule?r:{default:r}}var Nb=Math.pow(2,16),Bb={toXDR:function(e){var t=new Io.Cursor(Nb);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=y.from(e,"hex");break;case"base64":n=y.from(e,"base64");break;default:throw new Error("Invalid format "+t+', must be "raw", "hex", "base64"')}var i=new Io.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}}},Ub={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 Cb(r){(0,To.default)(r,Bb),(0,Db.default)(r)&&(0,To.default)(r.prototype,Ub)}Object.defineProperty(ae,"__esModule",{value:!0}),ae.Int=void 0;var Lb=Kr,Po=Fo(Lb),jb=M,kb=Fo(jb);function Fo(r){return r&&r.__esModule?r:{default:r}}var yr=ae.Int={read:function(e){return e.readInt32BE()},write:function(e,t){if(!(0,Po.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,Po.default)(e)||Math.floor(e)!==e?!1:e>=yr.MIN_VALUE&&e<=yr.MAX_VALUE}};yr.MAX_VALUE=Math.pow(2,31)-1,yr.MIN_VALUE=-Math.pow(2,31),(0,kb.default)(yr);var lt={};function Vb(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 Yn={exports:{}};(function(r){/**
25
25
  * @license Long.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
26
26
  * Released under the Apache License, Version 2.0
27
27
  * see: https://github.com/dcodeIO/Long.js for details
28
- */(function(e,t){typeof Vb=="function"&&!0&&r&&r.exports?r.exports=t():(e.dcodeIO=e.dcodeIO||{}).Long=t()})(re,function(){function e(l,u,p){this.low=l|0,this.high=u|0,this.unsigned=!!p}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,p){var d,_;return p?(u=u>>>0,0<=u&&u<256&&(_=n[u],_)?_:(d=new e(u,(u|0)<0?-1:0,!0),0<=u&&u<256&&(n[u]=d),d)):(u=u|0,-128<=u&&u<128&&(_=t[u],_)?_:(d=new e(u,u<0?-1:0,!1),-128<=u&&u<128&&(t[u]=d),d))},e.fromNumber=function(u,p){return p=!!p,isNaN(u)||!isFinite(u)?e.ZERO:!p&&u<=-f?e.MIN_VALUE:!p&&u+1>=f?e.MAX_VALUE:p&&u>=s?e.MAX_UNSIGNED_VALUE:u<0?e.fromNumber(-u,p).negate():new e(u%o|0,u/o|0,p)},e.fromBits=function(u,p,d){return new e(u,p,d)},e.fromString=function(u,p,d){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 p=="number"&&(d=p,p=!1),d=d||10,d<2||36<d)throw Error("radix out of range: "+d);var _;if((_=u.indexOf("-"))>0)throw Error('number format error: interior "-" character: '+u);if(_===0)return e.fromString(u.substring(1),p,d).negate();for(var E=e.fromNumber(Math.pow(d,8)),$=e.ZERO,b=0;b<u.length;b+=8){var S=Math.min(8,u.length-b),h=parseInt(u.substring(b,b+S),d);if(S<8){var O=e.fromNumber(Math.pow(d,S));$=$.multiply(O).add(e.fromNumber(h))}else $=$.multiply(E),$=$.add(e.fromNumber(h))}return $.unsigned=p,$},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=1<<16,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 p;if(this.isNegative())if(this.equals(e.MIN_VALUE)){var d=e.fromNumber(u),_=this.divide(d);return p=_.multiply(d).subtract(this),_.toString(u)+p.toInt().toString(u)}else return"-"+this.negate().toString(u);var E=e.fromNumber(Math.pow(u,6),this.unsigned);p=this;for(var $="";;){var b=p.divide(E),S=p.subtract(b.multiply(E)).toInt()>>>0,h=S.toString(u);if(p=b,p.isZero())return h+$;for(;h.length<6;)h="0"+h;$=""+h+$}},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,p=31;p>0&&(u&1<<p)==0;p--);return this.high!=0?p+33:p+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 p=this.isNegative(),d=u.isNegative();return p&&!d?-1:!p&&d?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 p=this.high>>>16,d=this.high&65535,_=this.low>>>16,E=this.low&65535,$=u.high>>>16,b=u.high&65535,S=u.low>>>16,h=u.low&65535,O=0,x=0,R=0,m=0;return m+=E+h,R+=m>>>16,m&=65535,R+=_+S,x+=R>>>16,R&=65535,x+=d+b,O+=x>>>16,x&=65535,O+=p+$,O&=65535,e.fromBits(R<<16|m,O<<16|x,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 p=this.high>>>16,d=this.high&65535,_=this.low>>>16,E=this.low&65535,$=u.high>>>16,b=u.high&65535,S=u.low>>>16,h=u.low&65535,O=0,x=0,R=0,m=0;return m+=E*h,R+=m>>>16,m&=65535,R+=_*h,x+=R>>>16,R&=65535,R+=E*S,x+=R>>>16,R&=65535,x+=d*h,O+=x>>>16,x&=65535,x+=_*S,O+=x>>>16,x&=65535,x+=E*b,O+=x>>>16,x&=65535,O+=p*h+d*S+_*b+E*$,O&=65535,e.fromBits(R<<16|m,O<<16|x,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 p,d,_;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 p=E.divide(u).shiftLeft(1),p.equals(e.ZERO)?u.isNegative()?e.ONE:e.NEG_ONE:(d=this.subtract(u.multiply(p)),_=p.add(d.divide(u)),_)}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(_=e.ZERO,d=this;d.greaterThanOrEqual(u);){p=Math.max(1,Math.floor(d.toNumber()/u.toNumber()));for(var $=Math.ceil(Math.log(p)/Math.LN2),b=$<=48?1:Math.pow(2,$-48),S=e.fromNumber(p),h=S.multiply(u);h.isNegative()||h.greaterThan(d);)p-=b,S=e.fromNumber(p,this.unsigned),h=S.multiply(u);S.isZero()&&(S=e.ONE),_=_.add(S),d=d.subtract(h)}return _},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 p=this.high;if(u<32){var d=this.low;return e.fromBits(d>>>u|p<<32-u,p>>>u,this.unsigned)}else return u===32?e.fromBits(p,0,this.unsigned):e.fromBits(p>>>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})})(Yn),Object.defineProperty(lt,"__esModule",{value:!0}),lt.Hyper=void 0;var qb=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}}(),Ro=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)}},Gb=Yn.exports,dr=Mo(Gb),Hb=M,Wb=Mo(Hb);function Mo(r){return r&&r.__esModule?r:{default:r}}function zb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Xb(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 Yb(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 vr=lt.Hyper=function(r){Yb(e,r),qb(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=Ro(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=Ro(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 zb(this,e),Xb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!1))}return e}(dr.default);(0,Wb.default)(vr),vr.MAX_VALUE=new vr(dr.default.MAX_VALUE.low,dr.default.MAX_VALUE.high),vr.MIN_VALUE=new vr(dr.default.MIN_VALUE.low,dr.default.MIN_VALUE.high);var xe={};Object.defineProperty(xe,"__esModule",{value:!0}),xe.UnsignedInt=void 0;var Kb=Kr,Do=No(Kb),Zb=M,Jb=No(Zb);function No(r){return r&&r.__esModule?r:{default:r}}var gr=xe.UnsignedInt={read:function(e){return e.readUInt32BE()},write:function(e,t){if(!(0,Do.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,Do.default)(e)||Math.floor(e)!==e?!1:e>=gr.MIN_VALUE&&e<=gr.MAX_VALUE}};gr.MAX_VALUE=Math.pow(2,32)-1,gr.MIN_VALUE=0,(0,Jb.default)(gr);var pt={};Object.defineProperty(pt,"__esModule",{value:!0}),pt.UnsignedHyper=void 0;var Qb=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}}(),Bo=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)}},ew=Yn.exports,_r=Uo(ew),rw=M,tw=Uo(rw);function Uo(r){return r&&r.__esModule?r:{default:r}}function nw(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function iw(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 aw(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=pt.UnsignedHyper=function(r){aw(e,r),Qb(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=Bo(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=Bo(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 nw(this,e),iw(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!0))}return e}(_r.default);(0,tw.default)(mr),mr.MAX_VALUE=new mr(_r.default.MAX_UNSIGNED_VALUE.low,_r.default.MAX_UNSIGNED_VALUE.high),mr.MIN_VALUE=new mr(_r.default.MIN_VALUE.low,_r.default.MIN_VALUE.high);var ht={};Object.defineProperty(ht,"__esModule",{value:!0}),ht.Float=void 0;var ow=Kr,Co=Lo(ow),uw=M,sw=Lo(uw);function Lo(r){return r&&r.__esModule?r:{default:r}}var fw=ht.Float={read:function(e){return e.readFloatBE()},write:function(e,t){if(!(0,Co.default)(e))throw new Error("XDR Write Error: not a number");t.writeFloatBE(e)},isValid:function(e){return(0,Co.default)(e)}};(0,sw.default)(fw);var yt={};Object.defineProperty(yt,"__esModule",{value:!0}),yt.Double=void 0;var cw=Kr,jo=ko(cw),lw=M,pw=ko(lw);function ko(r){return r&&r.__esModule?r:{default:r}}var hw=yt.Double={read:function(e){return e.readDoubleBE()},write:function(e,t){if(!(0,jo.default)(e))throw new Error("XDR Write Error: not a number");t.writeDoubleBE(e)},isValid:function(e){return(0,jo.default)(e)}};(0,pw.default)(hw);var dt={};Object.defineProperty(dt,"__esModule",{value:!0}),dt.Quadruple=void 0;var yw=M,dw=vw(yw);function vw(r){return r&&r.__esModule?r:{default:r}}var gw=dt.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,dw.default)(gw);var br={},_w=oe,mw=H,bw="[object Boolean]";function ww(r){return r===!0||r===!1||mw(r)&&_w(r)==bw}var $w=ww;Object.defineProperty(br,"__esModule",{value:!0}),br.Bool=void 0;var Ew=$w,Aw=qo(Ew),Vo=ae,Ow=M,Sw=qo(Ow);function qo(r){return r&&r.__esModule?r:{default:r}}var Tw=br.Bool={read:function(e){var t=Vo.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 Vo.Int.write(n,t)},isValid:function(e){return(0,Aw.default)(e)}};(0,Sw.default)(Tw);var vt={},Iw=oe,xw=C,Pw=H,Fw="[object String]";function Rw(r){return typeof r=="string"||!xw(r)&&Pw(r)&&Iw(r)==Fw}var Go=Rw;Object.defineProperty(vt,"__esModule",{value:!0}),vt.String=void 0;var Mw=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}}(),Dw=Go,Ho=Kn(Dw),Nw=C,Bw=Kn(Nw),Wo=ae,Uw=xe,zo=Te,Cw=M,Lw=Kn(Cw);function Kn(r){return r&&r.__esModule?r:{default:r}}function jw(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var kw=vt.String=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Uw.UnsignedInt.MAX_VALUE;jw(this,r),this._maxLength=e}return Mw(r,[{key:"read",value:function(t){var n=Wo.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,zo.calculatePadding)(n),a=t.slice(n);return(0,zo.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,Ho.default)(t)?i=y.from(t,"utf8"):i=y.from(t),Wo.Int.write(i.length,n),n.writeBufferPadded(i)}},{key:"isValid",value:function(t){var n=void 0;if((0,Ho.default)(t))n=y.from(t,"utf8");else if((0,Bw.default)(t)||y.isBuffer(t))n=y.from(t);else return!1;return n.length<=this._maxLength}}]),r}();(0,Lw.default)(kw.prototype);var gt={};Object.defineProperty(gt,"__esModule",{value:!0}),gt.Opaque=void 0;var Vw=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}}(),Xo=Te,qw=M,Gw=Hw(qw);function Hw(r){return r&&r.__esModule?r:{default:r}}function Ww(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var zw=gt.Opaque=function(){function r(e){Ww(this,r),this._length=e,this._padding=(0,Xo.calculatePadding)(e)}return Vw(r,[{key:"read",value:function(t){var n=t.slice(this._length);return(0,Xo.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 y.isBuffer(t)&&t.length===this._length}}]),r}();(0,Gw.default)(zw.prototype);var _t={};Object.defineProperty(_t,"__esModule",{value:!0}),_t.VarOpaque=void 0;var Xw=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}}(),Yo=ae,Yw=xe,Ko=Te,Kw=M,Zw=Jw(Kw);function Jw(r){return r&&r.__esModule?r:{default:r}}function Qw(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var e1=_t.VarOpaque=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Yw.UnsignedInt.MAX_VALUE;Qw(this,r),this._maxLength=e}return Xw(r,[{key:"read",value:function(t){var n=Yo.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,Ko.calculatePadding)(n),a=t.slice(n);return(0,Ko.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));Yo.Int.write(t.length,n),n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return y.isBuffer(t)&&t.length<=this._maxLength}}]),r}();(0,Zw.default)(e1.prototype);var mt={},Pe={exports:{}};function r1(r,e){for(var t=-1,n=r==null?0:r.length;++t<n&&e(r[t],t,r)!==!1;);return r}var Zo=r1,t1=Jr;function n1(r){return typeof r=="function"?r:t1}var Jo=n1,i1=Zo,a1=Fn,o1=Jo,u1=C;function s1(r,e){var t=u1(r)?i1:a1;return t(r,o1(e))}var f1=s1;(function(r){r.exports=f1})(Pe);var c1=/\s/;function l1(r){for(var e=r.length;e--&&c1.test(r.charAt(e)););return e}var p1=l1,h1=p1,y1=/^\s+/;function d1(r){return r&&r.slice(0,h1(r)+1).replace(y1,"")}var v1=d1,g1=v1,Qo=ve,_1=st,eu=0/0,m1=/^[-+]0x[0-9a-f]+$/i,b1=/^0b[01]+$/i,w1=/^0o[0-7]+$/i,$1=parseInt;function E1(r){if(typeof r=="number")return r;if(_1(r))return eu;if(Qo(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=Qo(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=g1(r);var t=b1.test(r);return t||w1.test(r)?$1(r.slice(2),t?2:8):m1.test(r)?eu:+r}var A1=E1,O1=A1,ru=1/0,S1=17976931348623157e292;function T1(r){if(!r)return r===0?r:0;if(r=O1(r),r===ru||r===-ru){var e=r<0?-1:1;return e*S1}return r===r?r:0}var I1=T1,x1=I1;function P1(r){var e=x1(r),t=e%1;return e===e?t?e-t:e:0}var F1=P1,R1=Ua,M1=Jo,D1=F1,N1=9007199254740991,Zn=4294967295,B1=Math.min;function U1(r,e){if(r=D1(r),r<1||r>N1)return[];var t=Zn,n=B1(r,Zn);e=M1(e),r-=Zn;for(var i=R1(n,e);++t<r;)e(t);return i}var tu=U1;Object.defineProperty(mt,"__esModule",{value:!0}),mt.Array=void 0;var C1=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}}(),L1=zn,j1=wr(L1),k1=Pe.exports,V1=wr(k1),q1=tu,G1=wr(q1),H1=C,nu=wr(H1),W1=M,z1=wr(W1);function wr(r){return r&&r.__esModule?r:{default:r}}function X1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var Y1=mt.Array=function(){function r(e,t){X1(this,r),this._childType=e,this._length=t}return C1(r,[{key:"read",value:function(t){var n=this;return(0,G1.default)(this._length,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,nu.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,V1.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,nu.default)(t)||t.length!==this._length?!1:(0,j1.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,z1.default)(Y1.prototype);var bt={};Object.defineProperty(bt,"__esModule",{value:!0}),bt.VarArray=void 0;var K1=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}}(),Z1=zn,J1=$r(Z1),Q1=Pe.exports,e$=$r(Q1),r$=tu,t$=$r(r$),n$=C,iu=$r(n$),i$=xe,au=ae,a$=M,o$=$r(a$);function $r(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 s$=bt.VarArray=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i$.UnsignedInt.MAX_VALUE;u$(this,r),this._childType=e,this._maxLength=t}return K1(r,[{key:"read",value:function(t){var n=this,i=au.Int.read(t);if(i>this._maxLength)throw new Error("XDR Read Error: Saw "+i+" length VarArray,"+("max allowed is "+this._maxLength));return(0,t$.default)(i,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,iu.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));au.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,iu.default)(t)||t.length>this._maxLength?!1:(0,J1.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,o$.default)(s$.prototype);var wt={};function f$(r){return r===null}var c$=f$;function l$(r){return r===void 0}var Er=l$;Object.defineProperty(wt,"__esModule",{value:!0}),wt.Option=void 0;var p$=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}}(),h$=c$,ou=Jn(h$),y$=Er,uu=Jn(y$),su=br,d$=M,v$=Jn(d$);function Jn(r){return r&&r.__esModule?r:{default:r}}function g$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var _$=wt.Option=function(){function r(e){g$(this,r),this._childType=e}return p$(r,[{key:"read",value:function(t){if(su.Bool.read(t))return this._childType.read(t)}},{key:"write",value:function(t,n){var i=!((0,ou.default)(t)||(0,uu.default)(t));su.Bool.write(i,n),i&&this._childType.write(t,n)}},{key:"isValid",value:function(t){return(0,ou.default)(t)||(0,uu.default)(t)?!0:this._childType.isValid(t)}}]),r}();(0,v$.default)(_$.prototype);var Ar={};Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.Void=void 0;var m$=Er,fu=cu(m$),b$=M,w$=cu(b$);function cu(r){return r&&r.__esModule?r:{default:r}}var $$=Ar.Void={read:function(){},write:function(e){if(!(0,fu.default)(e))throw new Error("XDR Write Error: trying to write value to a void slot")},isValid:function(e){return(0,fu.default)(e)}};(0,w$.default)($$);var $t={},E$=ft;function A$(r,e){return E$(e,function(t){return r[t]})}var O$=A$,S$=O$,T$=Ge;function I$(r){return r==null?[]:S$(r,T$(r))}var x$=I$;Object.defineProperty($t,"__esModule",{value:!0}),$t.Enum=void 0;var P$=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}}(),F$=Pe.exports,R$=Qn(F$),M$=x$,D$=Qn(M$),lu=ae,N$=M,B$=Qn(N$);function Qn(r){return r&&r.__esModule?r:{default:r}}function U$(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 C$(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 pu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var L$=$t.Enum=function(){function r(e,t){pu(this,r),this.name=e,this.value=t}return P$(r,null,[{key:"read",value:function(t){var n=lu.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);lu.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,D$.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){C$(s,o);function s(){return pu(this,s),U$(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,R$.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,B$.default)(L$);var Et={},j$=Fn,k$=cr;function V$(r,e){var t=-1,n=k$(r)?Array(r.length):[];return j$(r,function(i,a,o){n[++t]=e(i,a,o)}),n}var q$=V$,G$=ft,H$=So,W$=q$,z$=C;function X$(r,e){var t=z$(r)?G$:W$;return t(r,H$(e))}var Y$=X$;function K$(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 Z$=K$,Or={};Object.defineProperty(Or,"__esModule",{value:!0});var J$=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 Q$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}Or.Reference=function(){function r(){Q$(this,r)}return J$(r,[{key:"resolve",value:function(){throw new Error("implement resolve in child class")}}]),r}(),Object.defineProperty(Et,"__esModule",{value:!0}),Et.Struct=void 0;var At=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")}}(),eE=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}}(),rE=Pe.exports,hu=Sr(rE),tE=Y$,nE=Sr(tE),iE=Er,aE=Sr(iE),oE=Z$,uE=Sr(oE),sE=Or,fE=M,cE=Sr(fE);function Sr(r){return r&&r.__esModule?r:{default:r}}function lE(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 pE(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 yu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var hE=Et.Struct=function(){function r(e){yu(this,r),this._attributes=e||{}}return eE(r,null,[{key:"read",value:function(t){var n=(0,nE.default)(this._fields,function(i){var a=At(i,2),o=a[0],s=a[1],f=s.read(t);return[o,f]});return new this((0,uE.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,hu.default)(this._fields,function(i){var a=At(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){pE(s,o);function s(){return yu(this,s),lE(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=At(o,2),f=s[0],c=s[1];return c instanceof sE.Reference&&(c=c.resolve(t)),[f,c]}),(0,hu.default)(a._fields,function(o){var s=At(o,1),f=s[0];a.prototype[f]=yE(f)}),a}}]),r}();(0,cE.default)(hE);function yE(r){return function(t){return(0,aE.default)(t)||(this._attributes[r]=t),this._attributes[r]}}var Ot={};Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.Union=void 0;var dE=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")}}(),vE=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}}(),gE=Pe.exports,St=It(gE),_E=Er,du=It(_E),mE=Go,vu=It(mE),Tt=Ar,ei=Or,bE=M,wE=It(bE);function It(r){return r&&r.__esModule?r:{default:r}}function $E(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 EE(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 gu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var AE=Ot.Union=function(){function r(e,t){gu(this,r),this.set(e,t)}return vE(r,[{key:"set",value:function(t,n){(0,vu.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!==Tt.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===Tt.Void?Tt.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,du.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){EE(f,s);function f(){return gu(this,f),$E(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(r);a.unionName=n,t.results[n]=a,i.switchOn instanceof ei.Reference?a._switchOn=i.switchOn.resolve(t):a._switchOn=i.switchOn,a._switches=new Map,a._arms={},(0,St.default)(i.arms,function(s,f){s instanceof ei.Reference&&(s=s.resolve(t)),a._arms[f]=s});var o=i.defaultArm;return o instanceof ei.Reference&&(o=o.resolve(t)),a._defaultArm=o,(0,St.default)(i.switches,function(s){var f=dE(s,2),c=f[0],l=f[1];(0,vu.default)(c)&&(c=a._switchOn.fromName(c)),a._switches.set(c,l)}),(0,du.default)(a._switchOn.values)||(0,St.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,St.default)(a._arms,function(s,f){s!==Tt.Void&&(a.prototype[f]=function(){return this.get(f)})}),a}}]),r}();(0,wE.default)(AE),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=ae;Object.keys(e).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return e[h]}})});var t=lt;Object.keys(t).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return t[h]}})});var n=xe;Object.keys(n).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return n[h]}})});var i=pt;Object.keys(i).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return i[h]}})});var a=ht;Object.keys(a).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return a[h]}})});var o=yt;Object.keys(o).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return o[h]}})});var s=dt;Object.keys(s).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return s[h]}})});var f=br;Object.keys(f).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return f[h]}})});var c=vt;Object.keys(c).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return c[h]}})});var l=gt;Object.keys(l).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return l[h]}})});var u=_t;Object.keys(u).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return u[h]}})});var p=mt;Object.keys(p).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return p[h]}})});var d=bt;Object.keys(d).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return d[h]}})});var _=wt;Object.keys(_).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return _[h]}})});var E=Ar;Object.keys(E).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return E[h]}})});var $=$t;Object.keys($).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return $[h]}})});var b=Et;Object.keys(b).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return b[h]}})});var S=Ot;Object.keys(S).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return S[h]}})})}(En);var _u={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=function(){function m(v,g){for(var w=0;w<g.length;w++){var A=g[w];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(v,A.key,A)}}return function(v,g,w){return g&&m(v.prototype,g),w&&m(v,w),v}}(),t=Or;Object.keys(t).forEach(function(m){m==="default"||m==="__esModule"||Object.defineProperty(r,m,{enumerable:!0,get:function(){return t[m]}})}),r.config=_;var n=Er,i=l(n),a=Pe.exports,o=l(a),s=En,f=c(s);function c(m){if(m&&m.__esModule)return m;var v={};if(m!=null)for(var g in m)Object.prototype.hasOwnProperty.call(m,g)&&(v[g]=m[g]);return v.default=m,v}function l(m){return m&&m.__esModule?m:{default:m}}function u(m,v){if(!(m instanceof v))throw new TypeError("Cannot call a class as a function")}function p(m,v){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:m}function d(m,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);m.prototype=Object.create(v&&v.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(m,v):m.__proto__=v)}function _(m){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(m){var g=new R(v);m(g),g.resolve()}return v}var E=function(m){d(v,m);function v(g){u(this,v);var w=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return w.name=g,w}return e(v,[{key:"resolve",value:function(w){var A=w.definitions[this.name];return A.resolve(w)}}]),v}(t.Reference),$=function(m){d(v,m);function v(g,w){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;u(this,v);var L=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return L.childReference=g,L.length=w,L.variable=A,L}return e(v,[{key:"resolve",value:function(w){var A=this.childReference,L=this.length;return A instanceof t.Reference&&(A=A.resolve(w)),L instanceof t.Reference&&(L=L.resolve(w)),this.variable?new f.VarArray(A,L):new f.Array(A,L)}}]),v}(t.Reference),b=function(m){d(v,m);function v(g){u(this,v);var w=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return w.childReference=g,w.name=g.name,w}return e(v,[{key:"resolve",value:function(w){var A=this.childReference;return A instanceof t.Reference&&(A=A.resolve(w)),new f.Option(A)}}]),v}(t.Reference),S=function(m){d(v,m);function v(g,w){u(this,v);var A=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return A.sizedType=g,A.length=w,A}return e(v,[{key:"resolve",value:function(w){var A=this.length;return A instanceof t.Reference&&(A=A.resolve(w)),new this.sizedType(A)}}]),v}(t.Reference),h=function(){function m(v,g,w){u(this,m),this.constructor=v,this.name=g,this.config=w}return e(m,[{key:"resolve",value:function(g){return this.name in g.results?g.results[this.name]:this.constructor(g,this.name,this.config)}}]),m}();function O(m,v,g){return g instanceof t.Reference&&(g=g.resolve(m)),m.results[v]=g,g}function x(m,v,g){return m.results[v]=g,g}var R=function(){function m(v){u(this,m),this._destination=v,this._definitions={}}return e(m,[{key:"enum",value:function(g,w){var A=new h(f.Enum.create,g,w);this.define(g,A)}},{key:"struct",value:function(g,w){var A=new h(f.Struct.create,g,w);this.define(g,A)}},{key:"union",value:function(g,w){var A=new h(f.Union.create,g,w);this.define(g,A)}},{key:"typedef",value:function(g,w){var A=new h(O,g,w);this.define(g,A)}},{key:"const",value:function(g,w){var A=new h(x,g,w);this.define(g,A)}},{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(g){return new S(f.String,g)}},{key:"opaque",value:function(g){return new S(f.Opaque,g)}},{key:"varOpaque",value:function(g){return new S(f.VarOpaque,g)}},{key:"array",value:function(g,w){return new $(g,w)}},{key:"varArray",value:function(g,w){return new $(g,w,!0)}},{key:"option",value:function(g){return new b(g)}},{key:"define",value:function(g,w){if((0,i.default)(this._destination[g]))this._definitions[g]=w;else throw new Error("XDRTypes Error:"+g+" is already defined")}},{key:"lookup",value:function(g){return new E(g)}},{key:"resolve",value:function(){var g=this;(0,o.default)(this._definitions,function(w){w.resolve({definitions:g._definitions,results:g._destination})})}}]),m}()})(_u),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=En;Object.keys(e).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[n]}})});var t=_u;Object.keys(t).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return t[n]}})})}(ma);const ue=ma.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")}})});function OE(r){let e={variantId:ue.Uint64.fromString(r.variantId.toString()),version:r.version||Math.floor(Date.now()/1e3),items:r.items.map(n=>new ue.BundleItem({collectionId:ue.Uint64.fromString(n.collectionId.toString()),productId:ue.Uint64.fromString(n.productId.toString()),variantId:ue.Uint64.fromString(n.variantId.toString()),sku:n.sku||"",quantity:n.quantity,ext:new ue.BundleItemExt(0)})),ext:new ue.BundleExt(0)};const t=new ue.Bundle(e);return ue.BundleEnvelope.envelopeTypeBundle(t).toXDR("base64")}let SE=(r=21)=>crypto.getRandomValues(new Uint8Array(r)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"");var TE=qe,IE=Ge;function xE(r,e){return r&&TE(e,IE(e),r)}var PE=xE,FE=qe,RE=Qr;function ME(r,e){return r&&FE(e,RE(e),r)}var DE=ME,ri={exports:{}};(function(r,e){var t=Q,n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,o=a?t.Buffer:void 0,s=o?o.allocUnsafe:void 0;function f(c,l){if(l)return c.slice();var u=c.length,p=s?s(u):new c.constructor(u);return c.copy(p),p}r.exports=f})(ri,ri.exports);function NE(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}var BE=NE,UE=qe,CE=Un;function LE(r,e){return UE(r,CE(r),e)}var jE=LE,kE=Ga,VE=kE(Object.getPrototypeOf,Object),ti=VE,qE=Bn,GE=ti,HE=Un,WE=Qa,zE=Object.getOwnPropertySymbols,XE=zE?function(r){for(var e=[];r;)qE(e,HE(r)),r=GE(r);return e}:WE,mu=XE,YE=qe,KE=mu;function ZE(r,e){return YE(r,KE(r),e)}var JE=ZE,QE=Ja,eA=mu,rA=Qr;function tA(r){return QE(r,rA,eA)}var bu=tA,nA=Object.prototype,iA=nA.hasOwnProperty;function aA(r){var e=r.length,t=new r.constructor(e);return e&&typeof r[0]=="string"&&iA.call(r,"index")&&(t.index=r.index,t.input=r.input),t}var oA=aA,wu=Xa;function uA(r){var e=new r.constructor(r.byteLength);return new wu(e).set(new wu(r)),e}var ni=uA,sA=ni;function fA(r,e){var t=e?sA(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.byteLength)}var cA=fA,lA=/\w*$/;function pA(r){var e=new r.constructor(r.source,lA.exec(r));return e.lastIndex=r.lastIndex,e}var hA=pA,$u=Ve,Eu=$u?$u.prototype:void 0,Au=Eu?Eu.valueOf:void 0;function yA(r){return Au?Object(Au.call(r)):{}}var dA=yA,vA=ni;function gA(r,e){var t=e?vA(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}var _A=gA,mA=ni,bA=cA,wA=hA,$A=dA,EA=_A,AA="[object Boolean]",OA="[object Date]",SA="[object Map]",TA="[object Number]",IA="[object RegExp]",xA="[object Set]",PA="[object String]",FA="[object Symbol]",RA="[object ArrayBuffer]",MA="[object DataView]",DA="[object Float32Array]",NA="[object Float64Array]",BA="[object Int8Array]",UA="[object Int16Array]",CA="[object Int32Array]",LA="[object Uint8Array]",jA="[object Uint8ClampedArray]",kA="[object Uint16Array]",VA="[object Uint32Array]";function qA(r,e,t){var n=r.constructor;switch(e){case RA:return mA(r);case AA:case OA:return new n(+r);case MA:return bA(r,t);case DA:case NA:case BA:case UA:case CA:case LA:case jA:case kA:case VA:return EA(r,t);case SA:return new n;case TA:case PA:return new n(r);case IA:return wA(r);case xA:return new n;case FA:return $A(r)}}var GA=qA,HA=ve,Ou=Object.create,WA=function(){function r(){}return function(e){if(!HA(e))return{};if(Ou)return Ou(e);r.prototype=e;var t=new r;return r.prototype=void 0,t}}(),zA=WA,XA=zA,YA=ti,KA=Pn;function ZA(r){return typeof r.constructor=="function"&&!KA(r)?XA(YA(r)):{}}var JA=ZA,QA=ot,eO=H,rO="[object Map]";function tO(r){return eO(r)&&QA(r)==rO}var nO=tO,iO=nO,aO=xn,Su=pr.exports,Tu=Su&&Su.isMap,oO=Tu?aO(Tu):iO,uO=oO,sO=ot,fO=H,cO="[object Set]";function lO(r){return fO(r)&&sO(r)==cO}var pO=lO,hO=pO,yO=xn,Iu=pr.exports,xu=Iu&&Iu.isSet,dO=xu?yO(xu):hO,vO=dO,gO=Dn,_O=Zo,mO=Fa,bO=PE,wO=DE,$O=ri.exports,EO=BE,AO=jE,OO=JE,SO=ro,TO=bu,IO=ot,xO=oA,PO=GA,FO=JA,RO=C,MO=lr.exports,DO=uO,NO=ve,BO=vO,UO=Ge,CO=Qr,LO=1,jO=2,kO=4,Pu="[object Arguments]",VO="[object Array]",qO="[object Boolean]",GO="[object Date]",HO="[object Error]",Fu="[object Function]",WO="[object GeneratorFunction]",zO="[object Map]",XO="[object Number]",Ru="[object Object]",YO="[object RegExp]",KO="[object Set]",ZO="[object String]",JO="[object Symbol]",QO="[object WeakMap]",eS="[object ArrayBuffer]",rS="[object DataView]",tS="[object Float32Array]",nS="[object Float64Array]",iS="[object Int8Array]",aS="[object Int16Array]",oS="[object Int32Array]",uS="[object Uint8Array]",sS="[object Uint8ClampedArray]",fS="[object Uint16Array]",cS="[object Uint32Array]",P={};P[Pu]=P[VO]=P[eS]=P[rS]=P[qO]=P[GO]=P[tS]=P[nS]=P[iS]=P[aS]=P[oS]=P[zO]=P[XO]=P[Ru]=P[YO]=P[KO]=P[ZO]=P[JO]=P[uS]=P[sS]=P[fS]=P[cS]=!0,P[HO]=P[Fu]=P[QO]=!1;function xt(r,e,t,n,i,a){var o,s=e&LO,f=e&jO,c=e&kO;if(t&&(o=i?t(r,n,i,a):t(r)),o!==void 0)return o;if(!NO(r))return r;var l=RO(r);if(l){if(o=xO(r),!s)return EO(r,o)}else{var u=IO(r),p=u==Fu||u==WO;if(MO(r))return $O(r,s);if(u==Ru||u==Pu||p&&!i){if(o=f||p?{}:FO(r),!s)return f?OO(r,wO(o,r)):AO(r,bO(o,r))}else{if(!P[u])return i?r:{};o=PO(r,u,s)}}a||(a=new gO);var d=a.get(r);if(d)return d;a.set(r,o),BO(r)?r.forEach(function($){o.add(xt($,e,t,$,r,a))}):DO(r)&&r.forEach(function($,b){o.set(b,xt($,e,t,b,r,a))});var _=c?f?TO:SO:f?CO:UO,E=l?void 0:_(r);return _O(E||r,function($,b){E&&(b=$,$=r[b]),mO(o,b,xt($,e,t,b,r,a))}),o}var lS=xt;function pS(r){var e=r==null?0:r.length;return e?r[e-1]:void 0}var hS=pS;function yS(r,e,t){var n=-1,i=r.length;e<0&&(e=-e>i?0:i+e),t=t>i?i:t,t<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var a=Array(i);++n<i;)a[n]=r[n+e];return a}var dS=yS,vS=Wn,gS=dS;function _S(r,e){return e.length<2?r:vS(r,gS(e,0,-1))}var mS=_S,bS=ct,wS=hS,$S=mS,ES=hr;function AS(r,e){return e=bS(e,r),r=$S(r,e),r==null||delete r[ES(wS(e))]}var OS=AS,SS=oe,TS=ti,IS=H,xS="[object Object]",PS=Function.prototype,FS=Object.prototype,Mu=PS.toString,RS=FS.hasOwnProperty,MS=Mu.call(Object);function DS(r){if(!IS(r)||SS(r)!=xS)return!1;var e=TS(r);if(e===null)return!0;var t=RS.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Mu.call(t)==MS}var NS=DS,BS=NS;function US(r){return BS(r)?void 0:r}var CS=US,Du=Ve,LS=In,jS=C,Nu=Du?Du.isConcatSpreadable:void 0;function kS(r){return jS(r)||LS(r)||!!(Nu&&r&&r[Nu])}var VS=kS,qS=Bn,GS=VS;function Bu(r,e,t,n,i){var a=-1,o=r.length;for(t||(t=GS),i||(i=[]);++a<o;){var s=r[a];e>0&&t(s)?e>1?Bu(s,e-1,t,n,i):qS(i,s):n||(i[i.length]=s)}return i}var HS=Bu,WS=HS;function zS(r){var e=r==null?0:r.length;return e?WS(r,1):[]}var XS=zS,YS=XS,KS=Ma,ZS=Na;function JS(r){return ZS(KS(r,void 0,YS),r+"")}var QS=JS,eT=ft,rT=lS,tT=OS,nT=ct,iT=qe,aT=CS,oT=QS,uT=bu,sT=1,fT=2,cT=4,lT=oT(function(r,e){var t={};if(r==null)return t;var n=!1;e=eT(e,function(a){return a=nT(a,r),n||(n=a.length>1),a}),iT(r,uT(r),t),n&&(t=rT(t,sT|fT|cT,aT));for(var i=e.length;i--;)tT(t,e[i]);return t}),pT=lT,hT=Object.defineProperty,yT=Object.defineProperties,dT=Object.getOwnPropertyDescriptors,Uu=Object.getOwnPropertySymbols,vT=Object.prototype.hasOwnProperty,gT=Object.prototype.propertyIsEnumerable,Cu=(r,e,t)=>e in r?hT(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,_T=(r,e)=>{for(var t in e||(e={}))vT.call(e,t)&&Cu(r,t,e[t]);if(Uu)for(var t of Uu(e))gT.call(e,t)&&Cu(r,t,e[t]);return r},mT=(r,e)=>yT(r,dT(e));function bT(r){try{return JSON.parse(r)}catch{return r}}function wT(r){return Object.entries(r).reduce((e,[t,n])=>mT(_T({},e),{[t]:bT(n)}),{})}var $T=Object.defineProperty,ET=Object.defineProperties,AT=Object.getOwnPropertyDescriptors,Lu=Object.getOwnPropertySymbols,OT=Object.prototype.hasOwnProperty,ST=Object.prototype.propertyIsEnumerable,ju=(r,e,t)=>e in r?$T(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ku=(r,e)=>{for(var t in e||(e={}))OT.call(e,t)&&ju(r,t,e[t]);if(Lu)for(var t of Lu(e))ST.call(e,t)&&ju(r,t,e[t]);return r},Vu=(r,e)=>ET(r,AT(e));function qu(r){var e;const t=wT(r),n=t.auto_inject===void 0?!0:t.auto_inject,i=(e=t.display_on)!=null?e:[],a=t.first_option==="autodeliver";return Vu(ku({},pT(t,["display_on","first_option"])),{auto_inject:n,valid_pages:i,is_subscription_first:a,autoInject:n,validPages:i,isSubscriptionFirst:a})}function Gu(r){var e;const t=((e=r.subscription_options)==null?void 0:e.storefront_purchase_options)==="subscription_only";return Vu(ku({},r),{is_subscription_only:t,isSubscriptionOnly:t})}function TT(r){return r.map(e=>{const t={};return Object.entries(e).forEach(([n,i])=>{t[n]=Gu(i)}),t})}const Pt="2020-12",IT={store_currency:{currency_code:"USD",currency_symbol:"$",decimal_separator:".",thousands_separator:",",currency_symbol_location:"left"}},Tr=new Map;function Ft(r,e){return Tr.has(r)||Tr.set(r,e()),Tr.get(r)}async function ii(r){const{product:e}=await Ft(`product.${r}`,()=>Yr("get",`/product/${Pt}/${r}.json`));return Gu(e)}async function Hu(){return await Ft("storeSettings",()=>Yr("get",`/${Pt}/store_settings.json`).catch(()=>IT))}async function Wu(){const{widget_settings:r}=await Ft("widgetSettings",()=>Yr("get",`/${Pt}/widget_settings.json`));return qu(r)}async function zu(){const{products:r,widget_settings:e,store_settings:t,meta:n}=await Ft("productsAndSettings",()=>Yr("get",`/product/${Pt}/products.json`));return n?.status==="error"?Promise.reject(n.message):{products:TT(r),widget_settings:qu(e),store_settings:t??{}}}async function xT(){const{products:r}=await zu();return r}async function PT(r){const[e,t,n]=await Promise.all([ii(r),Hu(),Wu()]);return{product:e,store_settings:t,widget_settings:n,storeSettings:t,widgetSettings:n}}async function Xu(r){const{bundle_product:e}=await ii(r);return e}async function Yu(){return Array.from(Tr.keys()).forEach(r=>Tr.delete(r))}var FT=Object.freeze({__proto__:null,getCDNProduct:ii,getCDNStoreSettings:Hu,getCDNWidgetSettings:Wu,getCDNProductsAndSettings:zu,getCDNProducts:xT,getCDNProductAndSettings:PT,getCDNBundleSettings:Xu,resetCDNCache:Yu});const Ku="/bundling-storefront-manager";function RT(){return Math.ceil(Date.now()/1e3)}async function MT(){try{const{timestamp:r}=await $n("get",`${Ku}/t`,{headers:{"X-Recharge-App":"storefront-client"}});return r}catch(r){return console.error(`Fetch failed: ${r}. Using client-side date.`),RT()}}async function DT(r){const e=sr();if(!await Zu(r))throw new Error("Bundle is invalid.");const t=await MT(),n=OE({variantId:r.externalVariantId,version:t,items:r.selections.map(i=>({collectionId:i.collectionId,productId:i.externalProductId,variantId:i.externalVariantId,quantity:i.quantity,sku:""}))});try{const i=await $n("post",`${Ku}/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}`)}}function NT(r,e){const t=Ju(r);if(t!==!0)throw new Error(`Dynamic Bundle is invalid. ${t}`);const n=`${SE(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 Zu(r){try{const e=await Xu(r.externalProductId);return!!r&&!!e}catch{return console.error("Error fetching bundle settings"),!1}}const BT={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 Ju(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=BT[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}var UT=Object.freeze({__proto__:null,getBundleId:DT,getDynamicBundleItems:NT,validateBundle:Zu,validateDynamicBundle:Ju});async function CT(r,e){const{charge:t}=await T("get","/charges",{id:e},r);return t}function LT(r,e){return T("get","/charges",{query:e},r)}async function jT(r,e,t){const{charge:n}=await T("post",`/charges/${e}/apply_discount`,{data:t},r);return n}async function kT(r,e){const{charge:t}=await T("post",`/charges/${e}/remove_discount`,{},r);return t}async function VT(r,e){const{charge:t}=await T("post",`/charges/${e}/skip`,{},r);return t}async function qT(r,e){const{charge:t}=await T("post",`/charges/${e}/unskip`,{},r);return t}async function GT(r,e){const{charge:t}=await T("post",`/charges/${e}/process`,{},r);return t}var HT=Object.freeze({__proto__:null,getCharge:CT,listCharges:LT,applyDiscount:jT,removeDiscount:kT,skipCharge:VT,unskipCharge:qT,processCharge:GT});async function WT(r,e){const{membership:t}=await T("get","/memberships",{id:e},r);return t}function zT(r,e){return T("get","/memberships",{query:e},r)}async function XT(r,e,t){const{membership:n}=await T("post",`/memberships/${e}/cancel`,{data:t},r);return n}async function YT(r,e,t){const{membership:n}=await T("post",`/memberships/${e}/activate`,{data:t},r);return n}var KT=Object.freeze({__proto__:null,getMembership:WT,listMemberships:zT,cancelMembership:XT,activateMembership:YT});async function ZT(r,e){const{onetime:t}=await T("get","/onetimes",{id:e},r);return t}function JT(r,e){return T("get","/onetimes",{query:e},r)}async function QT(r,e){const{onetime:t}=await T("post","/onetimes",{data:e},r);return t}async function e2(r,e,t){const{onetime:n}=await T("put","/onetimes",{id:e,data:t},r);return n}function r2(r,e){return T("delete","/onetime",{id:e},r)}var t2=Object.freeze({__proto__:null,getOnetime:ZT,listOnetimes:JT,createOnetime:QT,updateOnetime:e2,deleteOnetime:r2});async function n2(r,e){const{order:t}=await T("get","/orders",{id:e},r);return t}function i2(r,e){return T("get","/orders",{query:e},r)}var a2=Object.freeze({__proto__:null,getOrder:n2,listOrders:i2});async function o2(r,e){const{payment_method:t}=await T("get","/payment_methods",{id:e},r);return t}async function u2(r,e,t){const{payment_method:n}=await T("put","/payment_methods",{id:e,data:t},r);return n}function s2(r,e){return T("get","/payment_methods",{query:e},r)}var f2=Object.freeze({__proto__:null,getPaymentMethod:o2,updatePaymentMethod:u2,listPaymentMethods:s2});async function c2(r,e){const{plan:t}=await T("get","/plans",{id:e},r);return t}function l2(r,e){return T("get","/plans",{query:e},r)}var p2=Object.freeze({__proto__:null,getPlan:c2,listPlans:l2});async function h2(r,e){const{subscription:t}=await T("get","/subscriptions",{id:e},r);return t}function y2(r,e){return T("get","/subscriptions",{query:e},r)}async function d2(r,e){const{subscription:t}=await T("post","/subscriptions",{data:e},r);return t}async function v2(r,e,t,n){const{subscription:i}=await T("put","/subscriptions",{id:e,data:t,query:n},r);return i}async function g2(r,e,t){const{subscription:n}=await T("post",`/subscriptions/${e}/set_next_charge_date`,{data:{date:t}},r);return n}async function _2(r,e,t){const{subscription:n}=await T("post",`/subscriptions/${e}/change_address`,{data:{address_id:t}},r);return n}async function m2(r,e,t){const{subscription:n}=await T("post",`/subscriptions/${e}/cancel`,{data:t},r);return n}async function b2(r,e){const{subscription:t}=await T("post",`/subscriptions/${e}/activate`,{},r);return t}async function w2(r,e,t){const{charge:n}=await T("post",`/subscriptions/${e}/charges/skip`,{data:{date:t,subscription_id:`${e}`}},r);return n}var $2=Object.freeze({__proto__:null,getSubscription:h2,listSubscriptions:y2,createSubscription:d2,updateSubscription:v2,updateSubscriptionChargeDate:g2,updateSubscriptionAddress:_2,cancelSubscription:m2,activateSubscription:b2,skipSubscriptionCharge:w2});async function E2(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await T("get","/customers",{id:t,query:{include:e?.include}},r);return n}async function A2(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await T("put","/customers",{id:t,data:e},r);return n}async function O2(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{deliveries:n}=await T("get",`/customers/${t}/delivery_schedule`,{query:e},r);return n}var S2=Object.freeze({__proto__:null,getCustomer:E2,updateCustomer:A2,getDeliverySchedule:O2});const T2={get(r,e){return de("get",r,e)},post(r,e){return de("post",r,e)},put(r,e){return de("put",r,e)},delete(r,e){return de("delete",r,e)}};function I2(r){var e,t;if(r)return r;if((e=window?.Shopify)!=null&&e.shop)return window.Shopify.shop;let n=window?.domain;if(!n){const i=(t=location?.href.match(/(?:http[s]*:\/\/)*(.*?)\.(?=admin\.rechargeapps\.com)/i))==null?void 0:t[1].replace(/-sp$/,"");i&&(n=`${i}.myshopify.com`)}if(n)return n;throw new Error("No storeIdentifier was passed into init.")}function x2(r={}){const e=r;bl({storeIdentifier:I2(r.storeIdentifier),storefrontAccessToken:r.storefrontAccessToken,environment:e.environment?e.environment:"prod"}),Yu()}const Qu={init:x2,api:T2,address:Bl,auth:Ll,bundle:UT,charge:HT,cdn:FT,customer:S2,membership:KT,onetime:t2,order:a2,paymentMethod:f2,plan:p2,subscription:$2};try{Qu.init()}catch{}return Qu});
28
+ */(function(e,t){typeof Vb=="function"&&!0&&r&&r.exports?r.exports=t():(e.dcodeIO=e.dcodeIO||{}).Long=t()})(re,function(){function e(l,u,p){this.low=l|0,this.high=u|0,this.unsigned=!!p}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,p){var d,_;return p?(u=u>>>0,0<=u&&u<256&&(_=n[u],_)?_:(d=new e(u,(u|0)<0?-1:0,!0),0<=u&&u<256&&(n[u]=d),d)):(u=u|0,-128<=u&&u<128&&(_=t[u],_)?_:(d=new e(u,u<0?-1:0,!1),-128<=u&&u<128&&(t[u]=d),d))},e.fromNumber=function(u,p){return p=!!p,isNaN(u)||!isFinite(u)?e.ZERO:!p&&u<=-f?e.MIN_VALUE:!p&&u+1>=f?e.MAX_VALUE:p&&u>=s?e.MAX_UNSIGNED_VALUE:u<0?e.fromNumber(-u,p).negate():new e(u%o|0,u/o|0,p)},e.fromBits=function(u,p,d){return new e(u,p,d)},e.fromString=function(u,p,d){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 p=="number"&&(d=p,p=!1),d=d||10,d<2||36<d)throw Error("radix out of range: "+d);var _;if((_=u.indexOf("-"))>0)throw Error('number format error: interior "-" character: '+u);if(_===0)return e.fromString(u.substring(1),p,d).negate();for(var E=e.fromNumber(Math.pow(d,8)),$=e.ZERO,b=0;b<u.length;b+=8){var S=Math.min(8,u.length-b),h=parseInt(u.substring(b,b+S),d);if(S<8){var O=e.fromNumber(Math.pow(d,S));$=$.multiply(O).add(e.fromNumber(h))}else $=$.multiply(E),$=$.add(e.fromNumber(h))}return $.unsigned=p,$},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=1<<16,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 p;if(this.isNegative())if(this.equals(e.MIN_VALUE)){var d=e.fromNumber(u),_=this.divide(d);return p=_.multiply(d).subtract(this),_.toString(u)+p.toInt().toString(u)}else return"-"+this.negate().toString(u);var E=e.fromNumber(Math.pow(u,6),this.unsigned);p=this;for(var $="";;){var b=p.divide(E),S=p.subtract(b.multiply(E)).toInt()>>>0,h=S.toString(u);if(p=b,p.isZero())return h+$;for(;h.length<6;)h="0"+h;$=""+h+$}},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,p=31;p>0&&(u&1<<p)==0;p--);return this.high!=0?p+33:p+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 p=this.isNegative(),d=u.isNegative();return p&&!d?-1:!p&&d?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 p=this.high>>>16,d=this.high&65535,_=this.low>>>16,E=this.low&65535,$=u.high>>>16,b=u.high&65535,S=u.low>>>16,h=u.low&65535,O=0,x=0,R=0,m=0;return m+=E+h,R+=m>>>16,m&=65535,R+=_+S,x+=R>>>16,R&=65535,x+=d+b,O+=x>>>16,x&=65535,O+=p+$,O&=65535,e.fromBits(R<<16|m,O<<16|x,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 p=this.high>>>16,d=this.high&65535,_=this.low>>>16,E=this.low&65535,$=u.high>>>16,b=u.high&65535,S=u.low>>>16,h=u.low&65535,O=0,x=0,R=0,m=0;return m+=E*h,R+=m>>>16,m&=65535,R+=_*h,x+=R>>>16,R&=65535,R+=E*S,x+=R>>>16,R&=65535,x+=d*h,O+=x>>>16,x&=65535,x+=_*S,O+=x>>>16,x&=65535,x+=E*b,O+=x>>>16,x&=65535,O+=p*h+d*S+_*b+E*$,O&=65535,e.fromBits(R<<16|m,O<<16|x,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 p,d,_;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 p=E.divide(u).shiftLeft(1),p.equals(e.ZERO)?u.isNegative()?e.ONE:e.NEG_ONE:(d=this.subtract(u.multiply(p)),_=p.add(d.divide(u)),_)}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(_=e.ZERO,d=this;d.greaterThanOrEqual(u);){p=Math.max(1,Math.floor(d.toNumber()/u.toNumber()));for(var $=Math.ceil(Math.log(p)/Math.LN2),b=$<=48?1:Math.pow(2,$-48),S=e.fromNumber(p),h=S.multiply(u);h.isNegative()||h.greaterThan(d);)p-=b,S=e.fromNumber(p,this.unsigned),h=S.multiply(u);S.isZero()&&(S=e.ONE),_=_.add(S),d=d.subtract(h)}return _},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 p=this.high;if(u<32){var d=this.low;return e.fromBits(d>>>u|p<<32-u,p>>>u,this.unsigned)}else return u===32?e.fromBits(p,0,this.unsigned):e.fromBits(p>>>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})})(Yn),Object.defineProperty(lt,"__esModule",{value:!0}),lt.Hyper=void 0;var qb=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}}(),Ro=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)}},Gb=Yn.exports,dr=Mo(Gb),Hb=M,Wb=Mo(Hb);function Mo(r){return r&&r.__esModule?r:{default:r}}function zb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Xb(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 Yb(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 vr=lt.Hyper=function(r){Yb(e,r),qb(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=Ro(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=Ro(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 zb(this,e),Xb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!1))}return e}(dr.default);(0,Wb.default)(vr),vr.MAX_VALUE=new vr(dr.default.MAX_VALUE.low,dr.default.MAX_VALUE.high),vr.MIN_VALUE=new vr(dr.default.MIN_VALUE.low,dr.default.MIN_VALUE.high);var xe={};Object.defineProperty(xe,"__esModule",{value:!0}),xe.UnsignedInt=void 0;var Kb=Kr,Do=No(Kb),Zb=M,Jb=No(Zb);function No(r){return r&&r.__esModule?r:{default:r}}var gr=xe.UnsignedInt={read:function(e){return e.readUInt32BE()},write:function(e,t){if(!(0,Do.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,Do.default)(e)||Math.floor(e)!==e?!1:e>=gr.MIN_VALUE&&e<=gr.MAX_VALUE}};gr.MAX_VALUE=Math.pow(2,32)-1,gr.MIN_VALUE=0,(0,Jb.default)(gr);var pt={};Object.defineProperty(pt,"__esModule",{value:!0}),pt.UnsignedHyper=void 0;var Qb=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}}(),Bo=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)}},ew=Yn.exports,_r=Uo(ew),rw=M,tw=Uo(rw);function Uo(r){return r&&r.__esModule?r:{default:r}}function nw(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function iw(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 aw(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=pt.UnsignedHyper=function(r){aw(e,r),Qb(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=Bo(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=Bo(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 nw(this,e),iw(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!0))}return e}(_r.default);(0,tw.default)(mr),mr.MAX_VALUE=new mr(_r.default.MAX_UNSIGNED_VALUE.low,_r.default.MAX_UNSIGNED_VALUE.high),mr.MIN_VALUE=new mr(_r.default.MIN_VALUE.low,_r.default.MIN_VALUE.high);var ht={};Object.defineProperty(ht,"__esModule",{value:!0}),ht.Float=void 0;var ow=Kr,Co=Lo(ow),uw=M,sw=Lo(uw);function Lo(r){return r&&r.__esModule?r:{default:r}}var fw=ht.Float={read:function(e){return e.readFloatBE()},write:function(e,t){if(!(0,Co.default)(e))throw new Error("XDR Write Error: not a number");t.writeFloatBE(e)},isValid:function(e){return(0,Co.default)(e)}};(0,sw.default)(fw);var yt={};Object.defineProperty(yt,"__esModule",{value:!0}),yt.Double=void 0;var cw=Kr,jo=ko(cw),lw=M,pw=ko(lw);function ko(r){return r&&r.__esModule?r:{default:r}}var hw=yt.Double={read:function(e){return e.readDoubleBE()},write:function(e,t){if(!(0,jo.default)(e))throw new Error("XDR Write Error: not a number");t.writeDoubleBE(e)},isValid:function(e){return(0,jo.default)(e)}};(0,pw.default)(hw);var dt={};Object.defineProperty(dt,"__esModule",{value:!0}),dt.Quadruple=void 0;var yw=M,dw=vw(yw);function vw(r){return r&&r.__esModule?r:{default:r}}var gw=dt.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,dw.default)(gw);var br={},_w=oe,mw=H,bw="[object Boolean]";function ww(r){return r===!0||r===!1||mw(r)&&_w(r)==bw}var $w=ww;Object.defineProperty(br,"__esModule",{value:!0}),br.Bool=void 0;var Ew=$w,Aw=qo(Ew),Vo=ae,Ow=M,Sw=qo(Ow);function qo(r){return r&&r.__esModule?r:{default:r}}var Tw=br.Bool={read:function(e){var t=Vo.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 Vo.Int.write(n,t)},isValid:function(e){return(0,Aw.default)(e)}};(0,Sw.default)(Tw);var vt={},Iw=oe,xw=C,Pw=H,Fw="[object String]";function Rw(r){return typeof r=="string"||!xw(r)&&Pw(r)&&Iw(r)==Fw}var Go=Rw;Object.defineProperty(vt,"__esModule",{value:!0}),vt.String=void 0;var Mw=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}}(),Dw=Go,Ho=Kn(Dw),Nw=C,Bw=Kn(Nw),Wo=ae,Uw=xe,zo=Te,Cw=M,Lw=Kn(Cw);function Kn(r){return r&&r.__esModule?r:{default:r}}function jw(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var kw=vt.String=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Uw.UnsignedInt.MAX_VALUE;jw(this,r),this._maxLength=e}return Mw(r,[{key:"read",value:function(t){var n=Wo.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,zo.calculatePadding)(n),a=t.slice(n);return(0,zo.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,Ho.default)(t)?i=y.from(t,"utf8"):i=y.from(t),Wo.Int.write(i.length,n),n.writeBufferPadded(i)}},{key:"isValid",value:function(t){var n=void 0;if((0,Ho.default)(t))n=y.from(t,"utf8");else if((0,Bw.default)(t)||y.isBuffer(t))n=y.from(t);else return!1;return n.length<=this._maxLength}}]),r}();(0,Lw.default)(kw.prototype);var gt={};Object.defineProperty(gt,"__esModule",{value:!0}),gt.Opaque=void 0;var Vw=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}}(),Xo=Te,qw=M,Gw=Hw(qw);function Hw(r){return r&&r.__esModule?r:{default:r}}function Ww(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var zw=gt.Opaque=function(){function r(e){Ww(this,r),this._length=e,this._padding=(0,Xo.calculatePadding)(e)}return Vw(r,[{key:"read",value:function(t){var n=t.slice(this._length);return(0,Xo.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 y.isBuffer(t)&&t.length===this._length}}]),r}();(0,Gw.default)(zw.prototype);var _t={};Object.defineProperty(_t,"__esModule",{value:!0}),_t.VarOpaque=void 0;var Xw=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}}(),Yo=ae,Yw=xe,Ko=Te,Kw=M,Zw=Jw(Kw);function Jw(r){return r&&r.__esModule?r:{default:r}}function Qw(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var e1=_t.VarOpaque=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Yw.UnsignedInt.MAX_VALUE;Qw(this,r),this._maxLength=e}return Xw(r,[{key:"read",value:function(t){var n=Yo.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,Ko.calculatePadding)(n),a=t.slice(n);return(0,Ko.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));Yo.Int.write(t.length,n),n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return y.isBuffer(t)&&t.length<=this._maxLength}}]),r}();(0,Zw.default)(e1.prototype);var mt={},Pe={exports:{}};function r1(r,e){for(var t=-1,n=r==null?0:r.length;++t<n&&e(r[t],t,r)!==!1;);return r}var Zo=r1,t1=Jr;function n1(r){return typeof r=="function"?r:t1}var Jo=n1,i1=Zo,a1=Fn,o1=Jo,u1=C;function s1(r,e){var t=u1(r)?i1:a1;return t(r,o1(e))}var f1=s1;(function(r){r.exports=f1})(Pe);var c1=/\s/;function l1(r){for(var e=r.length;e--&&c1.test(r.charAt(e)););return e}var p1=l1,h1=p1,y1=/^\s+/;function d1(r){return r&&r.slice(0,h1(r)+1).replace(y1,"")}var v1=d1,g1=v1,Qo=ve,_1=st,eu=0/0,m1=/^[-+]0x[0-9a-f]+$/i,b1=/^0b[01]+$/i,w1=/^0o[0-7]+$/i,$1=parseInt;function E1(r){if(typeof r=="number")return r;if(_1(r))return eu;if(Qo(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=Qo(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=g1(r);var t=b1.test(r);return t||w1.test(r)?$1(r.slice(2),t?2:8):m1.test(r)?eu:+r}var A1=E1,O1=A1,ru=1/0,S1=17976931348623157e292;function T1(r){if(!r)return r===0?r:0;if(r=O1(r),r===ru||r===-ru){var e=r<0?-1:1;return e*S1}return r===r?r:0}var I1=T1,x1=I1;function P1(r){var e=x1(r),t=e%1;return e===e?t?e-t:e:0}var F1=P1,R1=Ua,M1=Jo,D1=F1,N1=9007199254740991,Zn=4294967295,B1=Math.min;function U1(r,e){if(r=D1(r),r<1||r>N1)return[];var t=Zn,n=B1(r,Zn);e=M1(e),r-=Zn;for(var i=R1(n,e);++t<r;)e(t);return i}var tu=U1;Object.defineProperty(mt,"__esModule",{value:!0}),mt.Array=void 0;var C1=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}}(),L1=zn,j1=wr(L1),k1=Pe.exports,V1=wr(k1),q1=tu,G1=wr(q1),H1=C,nu=wr(H1),W1=M,z1=wr(W1);function wr(r){return r&&r.__esModule?r:{default:r}}function X1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var Y1=mt.Array=function(){function r(e,t){X1(this,r),this._childType=e,this._length=t}return C1(r,[{key:"read",value:function(t){var n=this;return(0,G1.default)(this._length,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,nu.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,V1.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,nu.default)(t)||t.length!==this._length?!1:(0,j1.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,z1.default)(Y1.prototype);var bt={};Object.defineProperty(bt,"__esModule",{value:!0}),bt.VarArray=void 0;var K1=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}}(),Z1=zn,J1=$r(Z1),Q1=Pe.exports,e$=$r(Q1),r$=tu,t$=$r(r$),n$=C,iu=$r(n$),i$=xe,au=ae,a$=M,o$=$r(a$);function $r(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 s$=bt.VarArray=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i$.UnsignedInt.MAX_VALUE;u$(this,r),this._childType=e,this._maxLength=t}return K1(r,[{key:"read",value:function(t){var n=this,i=au.Int.read(t);if(i>this._maxLength)throw new Error("XDR Read Error: Saw "+i+" length VarArray,"+("max allowed is "+this._maxLength));return(0,t$.default)(i,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,iu.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));au.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,iu.default)(t)||t.length>this._maxLength?!1:(0,J1.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,o$.default)(s$.prototype);var wt={};function f$(r){return r===null}var c$=f$;function l$(r){return r===void 0}var Er=l$;Object.defineProperty(wt,"__esModule",{value:!0}),wt.Option=void 0;var p$=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}}(),h$=c$,ou=Jn(h$),y$=Er,uu=Jn(y$),su=br,d$=M,v$=Jn(d$);function Jn(r){return r&&r.__esModule?r:{default:r}}function g$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var _$=wt.Option=function(){function r(e){g$(this,r),this._childType=e}return p$(r,[{key:"read",value:function(t){if(su.Bool.read(t))return this._childType.read(t)}},{key:"write",value:function(t,n){var i=!((0,ou.default)(t)||(0,uu.default)(t));su.Bool.write(i,n),i&&this._childType.write(t,n)}},{key:"isValid",value:function(t){return(0,ou.default)(t)||(0,uu.default)(t)?!0:this._childType.isValid(t)}}]),r}();(0,v$.default)(_$.prototype);var Ar={};Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.Void=void 0;var m$=Er,fu=cu(m$),b$=M,w$=cu(b$);function cu(r){return r&&r.__esModule?r:{default:r}}var $$=Ar.Void={read:function(){},write:function(e){if(!(0,fu.default)(e))throw new Error("XDR Write Error: trying to write value to a void slot")},isValid:function(e){return(0,fu.default)(e)}};(0,w$.default)($$);var $t={},E$=ft;function A$(r,e){return E$(e,function(t){return r[t]})}var O$=A$,S$=O$,T$=Ge;function I$(r){return r==null?[]:S$(r,T$(r))}var x$=I$;Object.defineProperty($t,"__esModule",{value:!0}),$t.Enum=void 0;var P$=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}}(),F$=Pe.exports,R$=Qn(F$),M$=x$,D$=Qn(M$),lu=ae,N$=M,B$=Qn(N$);function Qn(r){return r&&r.__esModule?r:{default:r}}function U$(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 C$(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 pu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var L$=$t.Enum=function(){function r(e,t){pu(this,r),this.name=e,this.value=t}return P$(r,null,[{key:"read",value:function(t){var n=lu.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);lu.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,D$.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){C$(s,o);function s(){return pu(this,s),U$(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,R$.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,B$.default)(L$);var Et={},j$=Fn,k$=cr;function V$(r,e){var t=-1,n=k$(r)?Array(r.length):[];return j$(r,function(i,a,o){n[++t]=e(i,a,o)}),n}var q$=V$,G$=ft,H$=So,W$=q$,z$=C;function X$(r,e){var t=z$(r)?G$:W$;return t(r,H$(e))}var Y$=X$;function K$(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 Z$=K$,Or={};Object.defineProperty(Or,"__esModule",{value:!0});var J$=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 Q$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}Or.Reference=function(){function r(){Q$(this,r)}return J$(r,[{key:"resolve",value:function(){throw new Error("implement resolve in child class")}}]),r}(),Object.defineProperty(Et,"__esModule",{value:!0}),Et.Struct=void 0;var At=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")}}(),eE=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}}(),rE=Pe.exports,hu=Sr(rE),tE=Y$,nE=Sr(tE),iE=Er,aE=Sr(iE),oE=Z$,uE=Sr(oE),sE=Or,fE=M,cE=Sr(fE);function Sr(r){return r&&r.__esModule?r:{default:r}}function lE(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 pE(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 yu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var hE=Et.Struct=function(){function r(e){yu(this,r),this._attributes=e||{}}return eE(r,null,[{key:"read",value:function(t){var n=(0,nE.default)(this._fields,function(i){var a=At(i,2),o=a[0],s=a[1],f=s.read(t);return[o,f]});return new this((0,uE.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,hu.default)(this._fields,function(i){var a=At(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){pE(s,o);function s(){return yu(this,s),lE(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=At(o,2),f=s[0],c=s[1];return c instanceof sE.Reference&&(c=c.resolve(t)),[f,c]}),(0,hu.default)(a._fields,function(o){var s=At(o,1),f=s[0];a.prototype[f]=yE(f)}),a}}]),r}();(0,cE.default)(hE);function yE(r){return function(t){return(0,aE.default)(t)||(this._attributes[r]=t),this._attributes[r]}}var Ot={};Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.Union=void 0;var dE=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")}}(),vE=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}}(),gE=Pe.exports,St=It(gE),_E=Er,du=It(_E),mE=Go,vu=It(mE),Tt=Ar,ei=Or,bE=M,wE=It(bE);function It(r){return r&&r.__esModule?r:{default:r}}function $E(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 EE(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 gu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var AE=Ot.Union=function(){function r(e,t){gu(this,r),this.set(e,t)}return vE(r,[{key:"set",value:function(t,n){(0,vu.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!==Tt.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===Tt.Void?Tt.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,du.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){EE(f,s);function f(){return gu(this,f),$E(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(r);a.unionName=n,t.results[n]=a,i.switchOn instanceof ei.Reference?a._switchOn=i.switchOn.resolve(t):a._switchOn=i.switchOn,a._switches=new Map,a._arms={},(0,St.default)(i.arms,function(s,f){s instanceof ei.Reference&&(s=s.resolve(t)),a._arms[f]=s});var o=i.defaultArm;return o instanceof ei.Reference&&(o=o.resolve(t)),a._defaultArm=o,(0,St.default)(i.switches,function(s){var f=dE(s,2),c=f[0],l=f[1];(0,vu.default)(c)&&(c=a._switchOn.fromName(c)),a._switches.set(c,l)}),(0,du.default)(a._switchOn.values)||(0,St.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,St.default)(a._arms,function(s,f){s!==Tt.Void&&(a.prototype[f]=function(){return this.get(f)})}),a}}]),r}();(0,wE.default)(AE),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=ae;Object.keys(e).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return e[h]}})});var t=lt;Object.keys(t).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return t[h]}})});var n=xe;Object.keys(n).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return n[h]}})});var i=pt;Object.keys(i).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return i[h]}})});var a=ht;Object.keys(a).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return a[h]}})});var o=yt;Object.keys(o).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return o[h]}})});var s=dt;Object.keys(s).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return s[h]}})});var f=br;Object.keys(f).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return f[h]}})});var c=vt;Object.keys(c).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return c[h]}})});var l=gt;Object.keys(l).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return l[h]}})});var u=_t;Object.keys(u).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return u[h]}})});var p=mt;Object.keys(p).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return p[h]}})});var d=bt;Object.keys(d).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return d[h]}})});var _=wt;Object.keys(_).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return _[h]}})});var E=Ar;Object.keys(E).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return E[h]}})});var $=$t;Object.keys($).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return $[h]}})});var b=Et;Object.keys(b).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return b[h]}})});var S=Ot;Object.keys(S).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return S[h]}})})}(En);var _u={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=function(){function m(v,g){for(var w=0;w<g.length;w++){var A=g[w];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(v,A.key,A)}}return function(v,g,w){return g&&m(v.prototype,g),w&&m(v,w),v}}(),t=Or;Object.keys(t).forEach(function(m){m==="default"||m==="__esModule"||Object.defineProperty(r,m,{enumerable:!0,get:function(){return t[m]}})}),r.config=_;var n=Er,i=l(n),a=Pe.exports,o=l(a),s=En,f=c(s);function c(m){if(m&&m.__esModule)return m;var v={};if(m!=null)for(var g in m)Object.prototype.hasOwnProperty.call(m,g)&&(v[g]=m[g]);return v.default=m,v}function l(m){return m&&m.__esModule?m:{default:m}}function u(m,v){if(!(m instanceof v))throw new TypeError("Cannot call a class as a function")}function p(m,v){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:m}function d(m,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);m.prototype=Object.create(v&&v.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(m,v):m.__proto__=v)}function _(m){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(m){var g=new R(v);m(g),g.resolve()}return v}var E=function(m){d(v,m);function v(g){u(this,v);var w=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return w.name=g,w}return e(v,[{key:"resolve",value:function(w){var A=w.definitions[this.name];return A.resolve(w)}}]),v}(t.Reference),$=function(m){d(v,m);function v(g,w){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;u(this,v);var L=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return L.childReference=g,L.length=w,L.variable=A,L}return e(v,[{key:"resolve",value:function(w){var A=this.childReference,L=this.length;return A instanceof t.Reference&&(A=A.resolve(w)),L instanceof t.Reference&&(L=L.resolve(w)),this.variable?new f.VarArray(A,L):new f.Array(A,L)}}]),v}(t.Reference),b=function(m){d(v,m);function v(g){u(this,v);var w=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return w.childReference=g,w.name=g.name,w}return e(v,[{key:"resolve",value:function(w){var A=this.childReference;return A instanceof t.Reference&&(A=A.resolve(w)),new f.Option(A)}}]),v}(t.Reference),S=function(m){d(v,m);function v(g,w){u(this,v);var A=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return A.sizedType=g,A.length=w,A}return e(v,[{key:"resolve",value:function(w){var A=this.length;return A instanceof t.Reference&&(A=A.resolve(w)),new this.sizedType(A)}}]),v}(t.Reference),h=function(){function m(v,g,w){u(this,m),this.constructor=v,this.name=g,this.config=w}return e(m,[{key:"resolve",value:function(g){return this.name in g.results?g.results[this.name]:this.constructor(g,this.name,this.config)}}]),m}();function O(m,v,g){return g instanceof t.Reference&&(g=g.resolve(m)),m.results[v]=g,g}function x(m,v,g){return m.results[v]=g,g}var R=function(){function m(v){u(this,m),this._destination=v,this._definitions={}}return e(m,[{key:"enum",value:function(g,w){var A=new h(f.Enum.create,g,w);this.define(g,A)}},{key:"struct",value:function(g,w){var A=new h(f.Struct.create,g,w);this.define(g,A)}},{key:"union",value:function(g,w){var A=new h(f.Union.create,g,w);this.define(g,A)}},{key:"typedef",value:function(g,w){var A=new h(O,g,w);this.define(g,A)}},{key:"const",value:function(g,w){var A=new h(x,g,w);this.define(g,A)}},{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(g){return new S(f.String,g)}},{key:"opaque",value:function(g){return new S(f.Opaque,g)}},{key:"varOpaque",value:function(g){return new S(f.VarOpaque,g)}},{key:"array",value:function(g,w){return new $(g,w)}},{key:"varArray",value:function(g,w){return new $(g,w,!0)}},{key:"option",value:function(g){return new b(g)}},{key:"define",value:function(g,w){if((0,i.default)(this._destination[g]))this._definitions[g]=w;else throw new Error("XDRTypes Error:"+g+" is already defined")}},{key:"lookup",value:function(g){return new E(g)}},{key:"resolve",value:function(){var g=this;(0,o.default)(this._definitions,function(w){w.resolve({definitions:g._definitions,results:g._destination})})}}]),m}()})(_u),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=En;Object.keys(e).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[n]}})});var t=_u;Object.keys(t).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return t[n]}})})}(ma);const OE=ma.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")}})}),ue=OE;function SE(r){let e={variantId:ue.Uint64.fromString(r.variantId.toString()),version:r.version||Math.floor(Date.now()/1e3),items:r.items.map(n=>new ue.BundleItem({collectionId:ue.Uint64.fromString(n.collectionId.toString()),productId:ue.Uint64.fromString(n.productId.toString()),variantId:ue.Uint64.fromString(n.variantId.toString()),sku:n.sku||"",quantity:n.quantity,ext:new ue.BundleItemExt(0)})),ext:new ue.BundleExt(0)};const t=new ue.Bundle(e);return ue.BundleEnvelope.envelopeTypeBundle(t).toXDR("base64")}let TE=(r=21)=>crypto.getRandomValues(new Uint8Array(r)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"");var IE=qe,xE=Ge;function PE(r,e){return r&&IE(e,xE(e),r)}var FE=PE,RE=qe,ME=Qr;function DE(r,e){return r&&RE(e,ME(e),r)}var NE=DE,ri={exports:{}};(function(r,e){var t=Q,n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,o=a?t.Buffer:void 0,s=o?o.allocUnsafe:void 0;function f(c,l){if(l)return c.slice();var u=c.length,p=s?s(u):new c.constructor(u);return c.copy(p),p}r.exports=f})(ri,ri.exports);function BE(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}var UE=BE,CE=qe,LE=Un;function jE(r,e){return CE(r,LE(r),e)}var kE=jE,VE=Ga,qE=VE(Object.getPrototypeOf,Object),ti=qE,GE=Bn,HE=ti,WE=Un,zE=Qa,XE=Object.getOwnPropertySymbols,YE=XE?function(r){for(var e=[];r;)GE(e,WE(r)),r=HE(r);return e}:zE,mu=YE,KE=qe,ZE=mu;function JE(r,e){return KE(r,ZE(r),e)}var QE=JE,eA=Ja,rA=mu,tA=Qr;function nA(r){return eA(r,tA,rA)}var bu=nA,iA=Object.prototype,aA=iA.hasOwnProperty;function oA(r){var e=r.length,t=new r.constructor(e);return e&&typeof r[0]=="string"&&aA.call(r,"index")&&(t.index=r.index,t.input=r.input),t}var uA=oA,wu=Xa;function sA(r){var e=new r.constructor(r.byteLength);return new wu(e).set(new wu(r)),e}var ni=sA,fA=ni;function cA(r,e){var t=e?fA(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.byteLength)}var lA=cA,pA=/\w*$/;function hA(r){var e=new r.constructor(r.source,pA.exec(r));return e.lastIndex=r.lastIndex,e}var yA=hA,$u=Ve,Eu=$u?$u.prototype:void 0,Au=Eu?Eu.valueOf:void 0;function dA(r){return Au?Object(Au.call(r)):{}}var vA=dA,gA=ni;function _A(r,e){var t=e?gA(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}var mA=_A,bA=ni,wA=lA,$A=yA,EA=vA,AA=mA,OA="[object Boolean]",SA="[object Date]",TA="[object Map]",IA="[object Number]",xA="[object RegExp]",PA="[object Set]",FA="[object String]",RA="[object Symbol]",MA="[object ArrayBuffer]",DA="[object DataView]",NA="[object Float32Array]",BA="[object Float64Array]",UA="[object Int8Array]",CA="[object Int16Array]",LA="[object Int32Array]",jA="[object Uint8Array]",kA="[object Uint8ClampedArray]",VA="[object Uint16Array]",qA="[object Uint32Array]";function GA(r,e,t){var n=r.constructor;switch(e){case MA:return bA(r);case OA:case SA:return new n(+r);case DA:return wA(r,t);case NA:case BA:case UA:case CA:case LA:case jA:case kA:case VA:case qA:return AA(r,t);case TA:return new n;case IA:case FA:return new n(r);case xA:return $A(r);case PA:return new n;case RA:return EA(r)}}var HA=GA,WA=ve,Ou=Object.create,zA=function(){function r(){}return function(e){if(!WA(e))return{};if(Ou)return Ou(e);r.prototype=e;var t=new r;return r.prototype=void 0,t}}(),XA=zA,YA=XA,KA=ti,ZA=Pn;function JA(r){return typeof r.constructor=="function"&&!ZA(r)?YA(KA(r)):{}}var QA=JA,eO=ot,rO=H,tO="[object Map]";function nO(r){return rO(r)&&eO(r)==tO}var iO=nO,aO=iO,oO=xn,Su=pr.exports,Tu=Su&&Su.isMap,uO=Tu?oO(Tu):aO,sO=uO,fO=ot,cO=H,lO="[object Set]";function pO(r){return cO(r)&&fO(r)==lO}var hO=pO,yO=hO,dO=xn,Iu=pr.exports,xu=Iu&&Iu.isSet,vO=xu?dO(xu):yO,gO=vO,_O=Dn,mO=Zo,bO=Fa,wO=FE,$O=NE,EO=ri.exports,AO=UE,OO=kE,SO=QE,TO=ro,IO=bu,xO=ot,PO=uA,FO=HA,RO=QA,MO=C,DO=lr.exports,NO=sO,BO=ve,UO=gO,CO=Ge,LO=Qr,jO=1,kO=2,VO=4,Pu="[object Arguments]",qO="[object Array]",GO="[object Boolean]",HO="[object Date]",WO="[object Error]",Fu="[object Function]",zO="[object GeneratorFunction]",XO="[object Map]",YO="[object Number]",Ru="[object Object]",KO="[object RegExp]",ZO="[object Set]",JO="[object String]",QO="[object Symbol]",eS="[object WeakMap]",rS="[object ArrayBuffer]",tS="[object DataView]",nS="[object Float32Array]",iS="[object Float64Array]",aS="[object Int8Array]",oS="[object Int16Array]",uS="[object Int32Array]",sS="[object Uint8Array]",fS="[object Uint8ClampedArray]",cS="[object Uint16Array]",lS="[object Uint32Array]",P={};P[Pu]=P[qO]=P[rS]=P[tS]=P[GO]=P[HO]=P[nS]=P[iS]=P[aS]=P[oS]=P[uS]=P[XO]=P[YO]=P[Ru]=P[KO]=P[ZO]=P[JO]=P[QO]=P[sS]=P[fS]=P[cS]=P[lS]=!0,P[WO]=P[Fu]=P[eS]=!1;function xt(r,e,t,n,i,a){var o,s=e&jO,f=e&kO,c=e&VO;if(t&&(o=i?t(r,n,i,a):t(r)),o!==void 0)return o;if(!BO(r))return r;var l=MO(r);if(l){if(o=PO(r),!s)return AO(r,o)}else{var u=xO(r),p=u==Fu||u==zO;if(DO(r))return EO(r,s);if(u==Ru||u==Pu||p&&!i){if(o=f||p?{}:RO(r),!s)return f?SO(r,$O(o,r)):OO(r,wO(o,r))}else{if(!P[u])return i?r:{};o=FO(r,u,s)}}a||(a=new _O);var d=a.get(r);if(d)return d;a.set(r,o),UO(r)?r.forEach(function($){o.add(xt($,e,t,$,r,a))}):NO(r)&&r.forEach(function($,b){o.set(b,xt($,e,t,b,r,a))});var _=c?f?IO:TO:f?LO:CO,E=l?void 0:_(r);return mO(E||r,function($,b){E&&(b=$,$=r[b]),bO(o,b,xt($,e,t,b,r,a))}),o}var pS=xt;function hS(r){var e=r==null?0:r.length;return e?r[e-1]:void 0}var yS=hS;function dS(r,e,t){var n=-1,i=r.length;e<0&&(e=-e>i?0:i+e),t=t>i?i:t,t<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var a=Array(i);++n<i;)a[n]=r[n+e];return a}var vS=dS,gS=Wn,_S=vS;function mS(r,e){return e.length<2?r:gS(r,_S(e,0,-1))}var bS=mS,wS=ct,$S=yS,ES=bS,AS=hr;function OS(r,e){return e=wS(e,r),r=ES(r,e),r==null||delete r[AS($S(e))]}var SS=OS,TS=oe,IS=ti,xS=H,PS="[object Object]",FS=Function.prototype,RS=Object.prototype,Mu=FS.toString,MS=RS.hasOwnProperty,DS=Mu.call(Object);function NS(r){if(!xS(r)||TS(r)!=PS)return!1;var e=IS(r);if(e===null)return!0;var t=MS.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Mu.call(t)==DS}var BS=NS,US=BS;function CS(r){return US(r)?void 0:r}var LS=CS,Du=Ve,jS=In,kS=C,Nu=Du?Du.isConcatSpreadable:void 0;function VS(r){return kS(r)||jS(r)||!!(Nu&&r&&r[Nu])}var qS=VS,GS=Bn,HS=qS;function Bu(r,e,t,n,i){var a=-1,o=r.length;for(t||(t=HS),i||(i=[]);++a<o;){var s=r[a];e>0&&t(s)?e>1?Bu(s,e-1,t,n,i):GS(i,s):n||(i[i.length]=s)}return i}var WS=Bu,zS=WS;function XS(r){var e=r==null?0:r.length;return e?zS(r,1):[]}var YS=XS,KS=YS,ZS=Ma,JS=Na;function QS(r){return JS(ZS(r,void 0,KS),r+"")}var eT=QS,rT=ft,tT=pS,nT=SS,iT=ct,aT=qe,oT=LS,uT=eT,sT=bu,fT=1,cT=2,lT=4,pT=uT(function(r,e){var t={};if(r==null)return t;var n=!1;e=rT(e,function(a){return a=iT(a,r),n||(n=a.length>1),a}),aT(r,sT(r),t),n&&(t=tT(t,fT|cT|lT,oT));for(var i=e.length;i--;)nT(t,e[i]);return t}),hT=pT,yT=Object.defineProperty,dT=Object.defineProperties,vT=Object.getOwnPropertyDescriptors,Uu=Object.getOwnPropertySymbols,gT=Object.prototype.hasOwnProperty,_T=Object.prototype.propertyIsEnumerable,Cu=(r,e,t)=>e in r?yT(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,mT=(r,e)=>{for(var t in e||(e={}))gT.call(e,t)&&Cu(r,t,e[t]);if(Uu)for(var t of Uu(e))_T.call(e,t)&&Cu(r,t,e[t]);return r},bT=(r,e)=>dT(r,vT(e));function wT(r){try{return JSON.parse(r)}catch{return r}}function $T(r){return Object.entries(r).reduce((e,[t,n])=>bT(mT({},e),{[t]:wT(n)}),{})}var ET=Object.defineProperty,AT=Object.defineProperties,OT=Object.getOwnPropertyDescriptors,Lu=Object.getOwnPropertySymbols,ST=Object.prototype.hasOwnProperty,TT=Object.prototype.propertyIsEnumerable,ju=(r,e,t)=>e in r?ET(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ku=(r,e)=>{for(var t in e||(e={}))ST.call(e,t)&&ju(r,t,e[t]);if(Lu)for(var t of Lu(e))TT.call(e,t)&&ju(r,t,e[t]);return r},Vu=(r,e)=>AT(r,OT(e));function qu(r){var e;const t=$T(r),n=t.auto_inject===void 0?!0:t.auto_inject,i=(e=t.display_on)!=null?e:[],a=t.first_option==="autodeliver";return Vu(ku({},hT(t,["display_on","first_option"])),{auto_inject:n,valid_pages:i,is_subscription_first:a,autoInject:n,validPages:i,isSubscriptionFirst:a})}function Gu(r){var e;const t=((e=r.subscription_options)==null?void 0:e.storefront_purchase_options)==="subscription_only";return Vu(ku({},r),{is_subscription_only:t,isSubscriptionOnly:t})}function IT(r){return r.map(e=>{const t={};return Object.entries(e).forEach(([n,i])=>{t[n]=Gu(i)}),t})}const Pt="2020-12",xT={store_currency:{currency_code:"USD",currency_symbol:"$",decimal_separator:".",thousands_separator:",",currency_symbol_location:"left"}},Tr=new Map;function Ft(r,e){return Tr.has(r)||Tr.set(r,e()),Tr.get(r)}async function ii(r){const{product:e}=await Ft(`product.${r}`,()=>Yr("get",`/product/${Pt}/${r}.json`));return Gu(e)}async function Hu(){return await Ft("storeSettings",()=>Yr("get",`/${Pt}/store_settings.json`).catch(()=>xT))}async function Wu(){const{widget_settings:r}=await Ft("widgetSettings",()=>Yr("get",`/${Pt}/widget_settings.json`));return qu(r)}async function zu(){const{products:r,widget_settings:e,store_settings:t,meta:n}=await Ft("productsAndSettings",()=>Yr("get",`/product/${Pt}/products.json`));return n?.status==="error"?Promise.reject(n.message):{products:IT(r),widget_settings:qu(e),store_settings:t??{}}}async function PT(){const{products:r}=await zu();return r}async function FT(r){const[e,t,n]=await Promise.all([ii(r),Hu(),Wu()]);return{product:e,store_settings:t,widget_settings:n,storeSettings:t,widgetSettings:n}}async function Xu(r){const{bundle_product:e}=await ii(r);return e}async function Yu(){return Array.from(Tr.keys()).forEach(r=>Tr.delete(r))}var RT=Object.freeze({__proto__:null,getCDNProduct:ii,getCDNStoreSettings:Hu,getCDNWidgetSettings:Wu,getCDNProductsAndSettings:zu,getCDNProducts:PT,getCDNProductAndSettings:FT,getCDNBundleSettings:Xu,resetCDNCache:Yu});const Ku="/bundling-storefront-manager";function MT(){return Math.ceil(Date.now()/1e3)}async function DT(){try{const{timestamp:r}=await $n("get",`${Ku}/t`,{headers:{"X-Recharge-App":"storefront-client"}});return r}catch(r){return console.error(`Fetch failed: ${r}. Using client-side date.`),MT()}}async function NT(r){const e=sr();if(!await Zu(r))throw new Error("Bundle is invalid.");const t=await DT(),n=SE({variantId:r.externalVariantId,version:t,items:r.selections.map(i=>({collectionId:i.collectionId,productId:i.externalProductId,variantId:i.externalVariantId,quantity:i.quantity,sku:""}))});try{const i=await $n("post",`${Ku}/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}`)}}function BT(r,e){const t=Ju(r);if(t!==!0)throw new Error(`Dynamic Bundle is invalid. ${t}`);const n=`${TE(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 Zu(r){try{const e=await Xu(r.externalProductId);return!!r&&!!e}catch{return console.error("Error fetching bundle settings"),!1}}const UT={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 Ju(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=UT[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}var CT=Object.freeze({__proto__:null,getBundleId:NT,getDynamicBundleItems:BT,validateBundle:Zu,validateDynamicBundle:Ju});async function LT(r,e){const{charge:t}=await T("get","/charges",{id:e},r);return t}function jT(r,e){return T("get","/charges",{query:e},r)}async function kT(r,e,t){const{charge:n}=await T("post",`/charges/${e}/apply_discount`,{data:t},r);return n}async function VT(r,e){const{charge:t}=await T("post",`/charges/${e}/remove_discount`,{},r);return t}async function qT(r,e){const{charge:t}=await T("post",`/charges/${e}/skip`,{},r);return t}async function GT(r,e){const{charge:t}=await T("post",`/charges/${e}/unskip`,{},r);return t}async function HT(r,e){const{charge:t}=await T("post",`/charges/${e}/process`,{},r);return t}var WT=Object.freeze({__proto__:null,getCharge:LT,listCharges:jT,applyDiscount:kT,removeDiscount:VT,skipCharge:qT,unskipCharge:GT,processCharge:HT});async function zT(r,e){const{membership:t}=await T("get","/memberships",{id:e},r);return t}function XT(r,e){return T("get","/memberships",{query:e},r)}async function YT(r,e,t){const{membership:n}=await T("post",`/memberships/${e}/cancel`,{data:t},r);return n}async function KT(r,e,t){const{membership:n}=await T("post",`/memberships/${e}/activate`,{data:t},r);return n}var ZT=Object.freeze({__proto__:null,getMembership:zT,listMemberships:XT,cancelMembership:YT,activateMembership:KT});async function JT(r,e){const{onetime:t}=await T("get","/onetimes",{id:e},r);return t}function QT(r,e){return T("get","/onetimes",{query:e},r)}async function e2(r,e){const{onetime:t}=await T("post","/onetimes",{data:e},r);return t}async function r2(r,e,t){const{onetime:n}=await T("put","/onetimes",{id:e,data:t},r);return n}function t2(r,e){return T("delete","/onetime",{id:e},r)}var n2=Object.freeze({__proto__:null,getOnetime:JT,listOnetimes:QT,createOnetime:e2,updateOnetime:r2,deleteOnetime:t2});async function i2(r,e){const{order:t}=await T("get","/orders",{id:e},r);return t}function a2(r,e){return T("get","/orders",{query:e},r)}var o2=Object.freeze({__proto__:null,getOrder:i2,listOrders:a2});async function u2(r,e){const{payment_method:t}=await T("get","/payment_methods",{id:e},r);return t}async function s2(r,e,t){const{payment_method:n}=await T("put","/payment_methods",{id:e,data:t},r);return n}function f2(r,e){return T("get","/payment_methods",{query:e},r)}var c2=Object.freeze({__proto__:null,getPaymentMethod:u2,updatePaymentMethod:s2,listPaymentMethods:f2});async function l2(r,e){const{plan:t}=await T("get","/plans",{id:e},r);return t}function p2(r,e){return T("get","/plans",{query:e},r)}var h2=Object.freeze({__proto__:null,getPlan:l2,listPlans:p2});async function y2(r,e){const{subscription:t}=await T("get","/subscriptions",{id:e},r);return t}function d2(r,e){return T("get","/subscriptions",{query:e},r)}async function v2(r,e){const{subscription:t}=await T("post","/subscriptions",{data:e},r);return t}async function g2(r,e,t,n){const{subscription:i}=await T("put","/subscriptions",{id:e,data:t,query:n},r);return i}async function _2(r,e,t){const{subscription:n}=await T("post",`/subscriptions/${e}/set_next_charge_date`,{data:{date:t}},r);return n}async function m2(r,e,t){const{subscription:n}=await T("post",`/subscriptions/${e}/change_address`,{data:{address_id:t}},r);return n}async function b2(r,e,t){const{subscription:n}=await T("post",`/subscriptions/${e}/cancel`,{data:t},r);return n}async function w2(r,e){const{subscription:t}=await T("post",`/subscriptions/${e}/activate`,{},r);return t}async function $2(r,e,t){const{charge:n}=await T("post",`/subscriptions/${e}/charges/skip`,{data:{date:t,subscription_id:`${e}`}},r);return n}var E2=Object.freeze({__proto__:null,getSubscription:y2,listSubscriptions:d2,createSubscription:v2,updateSubscription:g2,updateSubscriptionChargeDate:_2,updateSubscriptionAddress:m2,cancelSubscription:b2,activateSubscription:w2,skipSubscriptionCharge:$2});async function A2(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await T("get","/customers",{id:t,query:{include:e?.include}},r);return n}async function O2(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await T("put","/customers",{id:t,data:e},r);return n}async function S2(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{deliveries:n}=await T("get",`/customers/${t}/delivery_schedule`,{query:e},r);return n}var T2=Object.freeze({__proto__:null,getCustomer:A2,updateCustomer:O2,getDeliverySchedule:S2});const I2={get(r,e){return de("get",r,e)},post(r,e){return de("post",r,e)},put(r,e){return de("put",r,e)},delete(r,e){return de("delete",r,e)}};function x2(r){var e,t;if(r)return r;if((e=window?.Shopify)!=null&&e.shop)return window.Shopify.shop;let n=window?.domain;if(!n){const i=(t=location?.href.match(/(?:http[s]*:\/\/)*(.*?)\.(?=admin\.rechargeapps\.com)/i))==null?void 0:t[1].replace(/-sp$/,"");i&&(n=`${i}.myshopify.com`)}if(n)return n;throw new Error("No storeIdentifier was passed into init.")}function P2(r={}){const e=r;bl({storeIdentifier:x2(r.storeIdentifier),storefrontAccessToken:r.storefrontAccessToken,environment:e.environment?e.environment:"prod"}),Yu()}const Qu={init:P2,api:I2,address:Bl,auth:Ll,bundle:CT,charge:WT,cdn:RT,customer:T2,membership:ZT,onetime:n2,order:o2,paymentMethod:c2,plan:h2,subscription:E2};try{Qu.init()}catch{}return Qu});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rechargeapps/storefront-client",
3
3
  "description": "Storefront client for Recharge",
4
- "version": "0.16.0",
4
+ "version": "0.16.1",
5
5
  "license": "ISC",
6
6
  "main": "dist/cjs/index.js",
7
7
  "module": "dist/esm/index.js",
@@ -29,7 +29,7 @@
29
29
  "format": "prettier --check '{src,cypress}/**/*.{js,ts}'"
30
30
  },
31
31
  "dependencies": {
32
- "@rechargeapps/bundling-data": "^2.1.3",
32
+ "@rechargeapps/bundling-data": "^2.2.0",
33
33
  "isomorphic-fetch": "3.0.0",
34
34
  "lodash": "4.17.21",
35
35
  "nanoid": "3.3.4",