@revenuecat/purchases-js
Version:
Web subscriptions made easy. Powered by RevenueCat
1 lines • 383 kB
JavaScript
(function(F,H){typeof exports=="object"&&typeof module<"u"?H(exports):typeof define=="function"&&define.amd?define(["exports"],H):(F=typeof globalThis<"u"?globalThis:F||self,H(F.Purchases={}))})(this,function(F){"use strict";var bg=Object.create;var Sn=Object.defineProperty;var hg=Object.getOwnPropertyDescriptor;var Ui=(F,H)=>(H=Symbol[F])?H:Symbol.for("Symbol."+F),At=F=>{throw TypeError(F)};var Bi=(F,H,Z)=>H in F?Sn(F,H,{enumerable:!0,configurable:!0,writable:!0,value:Z}):F[H]=Z;var zi=(F,H)=>Sn(F,"name",{value:H,configurable:!0});var Vi=F=>[,,,bg((F==null?void 0:F[Ui("metadata")])??null)],Hi=["class","method","getter","setter","accessor","field","value","get","set"],Dt=F=>F!==void 0&&typeof F!="function"?At("Function expected"):F,vg=(F,H,Z,Ne,me)=>({kind:Hi[F],name:H,metadata:Ne,addInitializer:he=>Z._?At("Already initialized"):me.push(Dt(he||null))}),qn=(F,H)=>Bi(H,Ui("metadata"),F[3]),Wi=(F,H,Z,Ne)=>{for(var me=0,he=F[H>>1],We=he&&he.length;me<We;me++)H&1?he[me].call(Z):Ne=he[me].call(Z,Ne);return Ne},Yi=(F,H,Z,Ne,me,he)=>{var We,qe,Ct,Ar,st,se=H&7,lt=!!(H&8),Ye=!!(H&16),ct=se>3?F.length+1:se?lt?1:2:0,Mt=Hi[se+5],jt=se>3&&(F[ct-1]=[]),va=F[ct]||(F[ct]=[]),ze=se&&(!Ye&&!lt&&(me=me.prototype),se<5&&(se>3||!Ye)&&hg(se<4?me:{get[Z](){return Ri(this,he)},set[Z](le){return Li(this,he,le)}},Z));se?Ye&&se<4&&zi(he,(se>2?"set ":se>1?"get ":"")+Z):zi(me,Z);for(var ut=Ne.length-1;ut>=0;ut--)Ar=vg(se,Z,Ct={},F[3],va),se&&(Ar.static=lt,Ar.private=Ye,st=Ar.access={has:Ye?le=>kg(me,le):le=>Z in le},se^3&&(st.get=Ye?le=>(se^1?Ri:wg)(le,me,se^4?he:ze.get):le=>le[Z]),se>2&&(st.set=Ye?(le,gr)=>Li(le,me,gr,se^4?he:ze.set):(le,gr)=>le[Z]=gr)),qe=(0,Ne[ut])(se?se<4?Ye?he:ze[Mt]:se>4?void 0:{get:ze.get,set:ze.set}:me,Ar),Ct._=1,se^4||qe===void 0?Dt(qe)&&(se>4?jt.unshift(qe):se?Ye?he=qe:ze[Mt]=qe:me=qe):typeof qe!="object"||qe===null?At("Object expected"):(Dt(We=qe.get)&&(ze.get=We),Dt(We=qe.set)&&(ze.set=We),Dt(We=qe.init)&&jt.unshift(We));return se||qn(F,me),ze&&Sn(me,Z,ze),Ye?se^4?he:ze:me},I=(F,H,Z)=>Bi(F,typeof H!="symbol"?H+"":H,Z),Tn=(F,H,Z)=>H.has(F)||At("Cannot "+Z),kg=(F,H)=>Object(H)!==H?At('Cannot use the "in" operator on this value'):F.has(H),Ri=(F,H,Z)=>(Tn(F,H,"read from private field"),Z?Z.call(F):H.get(F));var Li=(F,H,Z,Ne)=>(Tn(F,H,"write to private field"),Ne?Ne.call(F,Z):H.set(F,Z),Z),wg=(F,H,Z)=>(Tn(F,H,"access private method"),Z);var Ni,Pn;const H="5";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(H);let Z=!1,Ne=!1;function me(){Z=!0}me();const he=1,We=2,qe=4,Ct=8,Ar=16,st=1,se=2,lt=4,Ye=8,ct=16,Mt=1,jt=2,va=4,ze=1,ut=2,le=Symbol(),gr="http://www.w3.org/2000/svg";function Gi(e){return e.endsWith("capture")&&e!=="gotpointercapture"&&e!=="lostpointercapture"}const Xi=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Ji(e){return Xi.includes(e)}const Zi={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject"};function Qi(e){return e=e.toLowerCase(),Zi[e]??e}const Ki=["touchstart","touchmove"];function $i(e){return Ki.includes(e)}const In=!1;var Ot=Array.isArray,es=Array.prototype.indexOf,ka=Array.from,rs=Object.defineProperty,mr=Object.getOwnPropertyDescriptor,Fn=Object.getOwnPropertyDescriptors,ts=Object.prototype,as=Array.prototype,wa=Object.getPrototypeOf;function Xr(e){return typeof e=="function"}const ce=()=>{};function ns(e){return e()}function Pa(e){for(var r=0;r<e.length;r++)e[r]()}const rr=2,Dn=4,dt=8,Nt=16,tr=32,_t=64,zt=128,Cr=256,Rt=512,Ae=1024,vr=2048,pt=4096,ir=8192,Jr=16384,An=32768,kr=65536,os=1<<17,is=1<<19,Cn=1<<20,Mr=Symbol("$state"),Mn=Symbol("legacy props"),ss=Symbol("");function jn(e){return e===this.v}function On(e,r){return e!=e?r==r:e!==r||e!==null&&typeof e=="object"||typeof e=="function"}function xa(e){return!On(e,this.v)}function ls(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function cs(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function us(e){throw new Error("https://svelte.dev/e/effect_orphan")}function ds(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function _s(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function ps(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function gs(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function ms(){throw new Error("https://svelte.dev/e/state_unsafe_local_read")}function fs(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Re(e,r){var t={f:0,v:e,reactions:null,equals:jn,rv:0,wv:0};return t}function Ea(e){return Nn(Re(e))}function Lt(e,r=!1){var a;const t=Re(e);return r||(t.equals=xa),Z&&re!==null&&re.l!==null&&((a=re.l).s??(a.s=[])).push(t),t}function pe(e,r=!1){return Nn(Lt(e,r))}function Nn(e){return ie!==null&&(ie.f&rr)!==0&&(sr===null?Es([e]):sr.push(e)),e}function Ge(e,r){return j(e,lr(()=>g(e))),r}function j(e,r){return ie!==null&&Wt()&&(ie.f&(rr|Nt))!==0&&(sr===null||!sr.includes(e))&&fs(),Sa(e,r)}function Sa(e,r){return e.equals(r)||(e.v,e.v=r,e.wv=ao(),zn(e,vr),Wt()&&Y!==null&&(Y.f&Ae)!==0&&(Y.f&tr)===0&&(Se!==null&&Se.includes(e)?(ar(Y,vr),Yt(Y)):Pr===null?Ss([e]):Pr.push(e))),r}function zn(e,r){var t=e.reactions;if(t!==null)for(var a=Wt(),n=t.length,o=0;o<n;o++){var i=t[o],s=i.f;(s&vr)===0&&(!a&&i===Y||(ar(i,r),(s&(Ae|Cr))!==0&&((s&rr)!==0?zn(i,pt):Yt(i))))}}let qa=!1;function Xe(e,r=null,t){if(typeof e!="object"||e===null||Mr in e)return e;const a=wa(e);if(a!==ts&&a!==as)return e;var n=new Map,o=Ot(e),i=Re(0);o&&n.set("length",Re(e.length));var s;return new Proxy(e,{defineProperty(l,c,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&ps();var _=n.get(c);return _===void 0?(_=Re(u.value),n.set(c,_)):j(_,Xe(u.value,s)),!0},deleteProperty(l,c){var u=n.get(c);if(u===void 0)c in l&&n.set(c,Re(le));else{if(o&&typeof c=="string"){var _=n.get("length"),d=Number(c);Number.isInteger(d)&&d<_.v&&j(_,d)}j(u,le),Rn(i)}return!0},get(l,c,u){var m;if(c===Mr)return e;var _=n.get(c),d=c in l;if(_===void 0&&(!d||(m=mr(l,c))!=null&&m.writable)&&(_=Re(Xe(d?l[c]:le,s)),n.set(c,_)),_!==void 0){var p=g(_);return p===le?void 0:p}return Reflect.get(l,c,u)},getOwnPropertyDescriptor(l,c){var u=Reflect.getOwnPropertyDescriptor(l,c);if(u&&"value"in u){var _=n.get(c);_&&(u.value=g(_))}else if(u===void 0){var d=n.get(c),p=d==null?void 0:d.v;if(d!==void 0&&p!==le)return{enumerable:!0,configurable:!0,value:p,writable:!0}}return u},has(l,c){var p;if(c===Mr)return!0;var u=n.get(c),_=u!==void 0&&u.v!==le||Reflect.has(l,c);if(u!==void 0||Y!==null&&(!_||(p=mr(l,c))!=null&&p.writable)){u===void 0&&(u=Re(_?Xe(l[c],s):le),n.set(c,u));var d=g(u);if(d===le)return!1}return _},set(l,c,u,_){var v;var d=n.get(c),p=c in l;if(o&&c==="length")for(var m=u;m<d.v;m+=1){var f=n.get(m+"");f!==void 0?j(f,le):m in l&&(f=Re(le),n.set(m+"",f))}d===void 0?(!p||(v=mr(l,c))!=null&&v.writable)&&(d=Re(void 0),j(d,Xe(u,s)),n.set(c,d)):(p=d.v!==le,j(d,Xe(u,s)));var h=Reflect.getOwnPropertyDescriptor(l,c);if(h!=null&&h.set&&h.set.call(_,u),!p){if(o&&typeof c=="string"){var b=n.get("length"),y=Number(c);Number.isInteger(y)&&y>=b.v&&j(b,y+1)}Rn(i)}return!0},ownKeys(l){g(i);var c=Reflect.ownKeys(l).filter(d=>{var p=n.get(d);return p===void 0||p.v!==le});for(var[u,_]of n)_.v!==le&&!(u in l)&&c.push(u);return c},setPrototypeOf(){gs()}})}function Rn(e,r=1){j(e,e.v+r)}var Ln,Un,Bn;function ys(){if(Ln===void 0){Ln=window;var e=Element.prototype,r=Node.prototype;Un=mr(r,"firstChild").get,Bn=mr(r,"nextSibling").get,e.__click=void 0,e.__className="",e.__attributes=null,e.__styles=null,e.__e=void 0,Text.prototype.__t=void 0}}function gt(e=""){return document.createTextNode(e)}function jr(e){return Un.call(e)}function Ut(e){return Bn.call(e)}function E(e,r){return jr(e)}function G(e,r){{var t=jr(e);return t instanceof Comment&&t.data===""?Ut(t):t}}function N(e,r=1,t=!1){let a=e;for(;r--;)a=Ut(a);return a}function bs(e){e.textContent=""}function C(e){var r=rr|vr;Y===null?r|=Cr:Y.f|=Cn;var t=ie!==null&&(ie.f&rr)!==0?ie:null;const a={children:null,ctx:re,deps:null,equals:jn,f:r,fn:e,reactions:null,rv:0,v:null,wv:0,parent:t??Y};return t!==null&&(t.children??(t.children=[])).push(a),a}function Te(e){const r=C(e);return r.equals=xa,r}function Vn(e){var r=e.children;if(r!==null){e.children=null;for(var t=0;t<r.length;t+=1){var a=r[t];(a.f&rr)!==0?Ta(a):Ze(a)}}}function hs(e){for(var r=e.parent;r!==null;){if((r.f&rr)===0)return r;r=r.parent}return null}function Hn(e){var r,t=Y;Ce(hs(e));try{Vn(e),r=no(e)}finally{Ce(t)}return r}function Wn(e){var r=Hn(e),t=(zr||(e.f&Cr)!==0)&&e.deps!==null?pt:Ae;ar(e,t),e.equals(r)||(e.v=r,e.wv=ao())}function Ta(e){Vn(e),ht(e,0),ar(e,Jr),e.v=e.children=e.deps=e.ctx=e.reactions=null}function Yn(e){Y===null&&ie===null&&us(),ie!==null&&(ie.f&Cr)!==0&&cs(),Oa&&ls()}function vs(e,r){var t=r.last;t===null?r.last=r.first=e:(t.next=e,e.prev=t,r.last=e)}function Zr(e,r,t,a=!0){var n=(e&_t)!==0,o=Y,i={ctx:re,deps:null,deriveds:null,nodes_start:null,nodes_end:null,f:e|vr,first:null,fn:r,last:null,next:null,parent:n?null:o,prev:null,teardown:null,transitions:null,wv:0};if(t){var s=Kr;try{$n(!0),vt(i),i.f|=An}catch(u){throw Ze(i),u}finally{$n(s)}}else r!==null&&Yt(i);var l=t&&i.deps===null&&i.first===null&&i.nodes_start===null&&i.teardown===null&&(i.f&Cn)===0;if(!l&&!n&&a&&(o!==null&&vs(i,o),ie!==null&&(ie.f&rr)!==0)){var c=ie;(c.children??(c.children=[])).push(i)}return i}function Ia(e){const r=Zr(dt,null,!1);return ar(r,Ae),r.teardown=e,r}function Fa(e){Yn();var r=Y!==null&&(Y.f&tr)!==0&&re!==null&&!re.m;if(r){var t=re;(t.e??(t.e=[])).push({fn:e,effect:Y,reaction:ie})}else{var a=Da(e);return a}}function ks(e){return Yn(),Bt(e)}function ws(e){const r=Zr(_t,e,!0);return(t={})=>new Promise(a=>{t.outro?Nr(r,()=>{Ze(r),a(void 0)}):(Ze(r),a(void 0))})}function Da(e){return Zr(Dn,e,!1)}function Ie(e,r){var t=re,a={effect:null,ran:!1};t.l.r1.push(a),a.effect=Bt(()=>{e(),!a.ran&&(a.ran=!0,j(t.l.r2,!0),lr(r))})}function Or(){var e=re;Bt(()=>{if(g(e.l.r2)){for(var r of e.l.r1){var t=r.effect;(t.f&Ae)!==0&&ar(t,pt),$r(t)&&vt(t),r.ran=!1}e.l.r2.v=!1}})}function Bt(e){return Zr(dt,e,!0)}function D(e){return wr(e)}function wr(e,r=0){return Zr(dt|Nt|r,e,!0)}function Je(e,r=!0){return Zr(dt|tr,e,!0,r)}function Gn(e){var r=e.teardown;if(r!==null){const t=Oa,a=ie;eo(!0),Qe(null);try{r.call(null)}finally{eo(t),Qe(a)}}}function Xn(e){var r=e.deriveds;if(r!==null){e.deriveds=null;for(var t=0;t<r.length;t+=1)Ta(r[t])}}function Jn(e,r=!1){var t=e.first;for(e.first=e.last=null;t!==null;){var a=t.next;Ze(t,r),t=a}}function Ps(e){for(var r=e.first;r!==null;){var t=r.next;(r.f&tr)===0&&Ze(r),r=t}}function Ze(e,r=!0){var t=!1;if((r||(e.f&is)!==0)&&e.nodes_start!==null){for(var a=e.nodes_start,n=e.nodes_end;a!==null;){var o=a===n?null:Ut(a);a.remove(),a=o}t=!0}Jn(e,r&&!t),Xn(e),ht(e,0),ar(e,Jr);var i=e.transitions;if(i!==null)for(const l of i)l.stop();Gn(e);var s=e.parent;s!==null&&s.first!==null&&Zn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=null}function Zn(e){var r=e.parent,t=e.prev,a=e.next;t!==null&&(t.next=a),a!==null&&(a.prev=t),r!==null&&(r.first===e&&(r.first=a),r.last===e&&(r.last=t))}function Nr(e,r){var t=[];Aa(e,t,!0),Qn(t,()=>{Ze(e),r&&r()})}function Qn(e,r){var t=e.length;if(t>0){var a=()=>--t||r();for(var n of e)n.out(a)}else r()}function Aa(e,r,t){if((e.f&ir)===0){if(e.f^=ir,e.transitions!==null)for(const i of e.transitions)(i.is_global||t)&&r.push(i);for(var a=e.first;a!==null;){var n=a.next,o=(a.f&kr)!==0||(a.f&tr)!==0;Aa(a,r,o?t:!1),a=n}}}function mt(e){Kn(e,!0)}function Kn(e,r){if((e.f&ir)!==0){$r(e)&&vt(e),e.f^=ir;for(var t=e.first;t!==null;){var a=t.next,n=(t.f&kr)!==0||(t.f&tr)!==0;Kn(t,n?r:!1),t=a}if(e.transitions!==null)for(const o of e.transitions)(o.is_global||r)&&o.in()}}let Ca=!1,Ma=[];function xs(){Ca=!1;const e=Ma.slice();Ma=[],Pa(e)}function Qr(e){Ca||(Ca=!0,queueMicrotask(xs)),Ma.push(e)}function ja(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}let ft=!1,Vt=!1,Ht=null,Kr=!1,Oa=!1;function $n(e){Kr=e}function eo(e){Oa=e}let Na=[],yt=0,Pg=[],ie=null;function Qe(e){ie=e}let Y=null;function Ce(e){Y=e}let sr=null;function Es(e){sr=e}let Se=null,Le=0,Pr=null;function Ss(e){Pr=e}let ro=1,za=0,zr=!1,re=null;function to(e){re=e}function ao(){return++ro}function Wt(){return!Z||re!==null&&re.l===null}function $r(e){var c;var r=e.f;if((r&vr)!==0)return!0;if((r&pt)!==0){var t=e.deps,a=(r&Cr)!==0;if(t!==null){var n,o,i=(r&Rt)!==0,s=a&&Y!==null&&!zr,l=t.length;if(i||s){for(n=0;n<l;n++)o=t[n],(i||!((c=o==null?void 0:o.reactions)!=null&&c.includes(e)))&&(o.reactions??(o.reactions=[])).push(e);i&&(e.f^=Rt)}for(n=0;n<l;n++)if(o=t[n],$r(o)&&Wn(o),o.wv>e.wv)return!0}(!a||Y!==null&&!zr)&&ar(e,Ae)}return!1}function qs(e,r){for(var t=r;t!==null;){if((t.f&zt)!==0)try{t.fn(e);return}catch{t.f^=zt}t=t.parent}throw ft=!1,e}function Ts(e){return(e.f&Jr)===0&&(e.parent===null||(e.parent.f&zt)===0)}function Ra(){ft=!1}function bt(e,r,t,a){if(ft){if(t===null&&(ft=!1),Ts(r))throw e;return}t!==null&&(ft=!0);{qs(e,r);return}}function no(e){var d;var r=Se,t=Le,a=Pr,n=ie,o=zr,i=sr,s=re,l=e.f;Se=null,Le=0,Pr=null,ie=(l&(tr|_t))===0?e:null,zr=!Kr&&(l&Cr)!==0,sr=null,re=e.ctx,za++;try{var c=(0,e.fn)(),u=e.deps;if(Se!==null){var _;if(ht(e,Le),u!==null&&Le>0)for(u.length=Le+Se.length,_=0;_<Se.length;_++)u[Le+_]=Se[_];else e.deps=u=Se;if(!zr)for(_=Le;_<u.length;_++)((d=u[_]).reactions??(d.reactions=[])).push(e)}else u!==null&&Le<u.length&&(ht(e,Le),u.length=Le);return c}finally{Se=r,Le=t,Pr=a,ie=n,zr=o,sr=i,re=s}}function Is(e,r){let t=r.reactions;if(t!==null){var a=es.call(t,e);if(a!==-1){var n=t.length-1;n===0?t=r.reactions=null:(t[a]=t[n],t.pop())}}t===null&&(r.f&rr)!==0&&(Se===null||!Se.includes(r))&&(ar(r,pt),(r.f&(Cr|Rt))===0&&(r.f^=Rt),ht(r,0))}function ht(e,r){var t=e.deps;if(t!==null)for(var a=r;a<t.length;a++)Is(e,t[a])}function vt(e){var r=e.f;if((r&Jr)===0){ar(e,Ae);var t=Y,a=re;Y=e;try{(r&Nt)!==0?Ps(e):Jn(e),Xn(e),Gn(e);var n=no(e);e.teardown=typeof n=="function"?n:null,e.wv=ro;var o=e.deps,i;In&&Ne&&e.f&vr}catch(s){bt(s,e,t,a||e.ctx)}finally{Y=t}}}function Fs(){if(yt>1e3){yt=0;try{ds()}catch(e){if(Ht!==null)bt(e,Ht,null);else throw e}}yt++}function Ds(e){var r=e.length;if(r!==0){Fs();var t=Kr;Kr=!0;try{for(var a=0;a<r;a++){var n=e[a];(n.f&Ae)===0&&(n.f^=Ae);var o=[];oo(n,o),As(o)}}finally{Kr=t}}}function As(e){var r=e.length;if(r!==0)for(var t=0;t<r;t++){var a=e[t];if((a.f&(Jr|ir))===0)try{$r(a)&&(vt(a),a.deps===null&&a.first===null&&a.nodes_start===null&&(a.teardown===null?Zn(a):a.fn=null))}catch(n){bt(n,a,null,a.ctx)}}}function Cs(){if(Vt=!1,yt>1001)return;const e=Na;Na=[],Ds(e),Vt||(yt=0,Ht=null)}function Yt(e){Vt||(Vt=!0,queueMicrotask(Cs)),Ht=e;for(var r=e;r.parent!==null;){r=r.parent;var t=r.f;if((t&(_t|tr))!==0){if((t&Ae)===0)return;r.f^=Ae}}Na.push(r)}function oo(e,r){var t=e.first,a=[];e:for(;t!==null;){var n=t.f,o=(n&tr)!==0,i=o&&(n&Ae)!==0,s=t.next;if(!i&&(n&ir)===0)if((n&dt)!==0){if(o)t.f^=Ae;else try{$r(t)&&vt(t)}catch(_){bt(_,t,null,t.ctx)}var l=t.first;if(l!==null){t=l;continue}}else(n&Dn)!==0&&a.push(t);if(s===null){let _=t.parent;for(;_!==null;){if(e===_)break e;var c=_.next;if(c!==null){t=c;continue e}_=_.parent}}t=s}for(var u=0;u<a.length;u++)l=a[u],r.push(l),oo(l,r)}function g(e){var u;var r=e.f,t=(r&rr)!==0;if(t&&(r&Jr)!==0){var a=Hn(e);return Ta(e),a}if(ie!==null){sr!==null&&sr.includes(e)&&ms();var n=ie.deps;e.rv<za&&(e.rv=za,Se===null&&n!==null&&n[Le]===e?Le++:Se===null?Se=[e]:Se.push(e),Pr!==null&&Y!==null&&(Y.f&Ae)!==0&&(Y.f&tr)===0&&Pr.includes(e)&&(ar(Y,vr),Yt(Y)))}else if(t&&e.deps===null)for(var o=e,i=o.parent,s=o;i!==null;)if((i.f&rr)!==0){var l=i;s=l,i=l.parent}else{var c=i;(u=c.deriveds)!=null&&u.includes(s)||(c.deriveds??(c.deriveds=[])).push(s);break}return t&&(o=e,$r(o)&&Wn(o)),e.v}function lr(e){const r=ie;try{return ie=null,e()}finally{ie=r}}const Ms=-7169;function ar(e,r){e.f=e.f&Ms|r}function Ue(e){return so().get(e)}function io(e,r){return so().set(e,r),r}function so(e){return re===null&&ja(),re.c??(re.c=new Map(js(re)||void 0))}function js(e){let r=e.p;for(;r!==null;){const t=r.c;if(t!==null)return t;r=r.p}return null}function U(e,r=!1,t){re={p:re,c:null,e:null,m:!1,s:e,x:null,l:null},Z&&!r&&(re.l={s:null,u:null,r1:[],r2:Re(!1)})}function B(e){const r=re;if(r!==null){e!==void 0&&(r.x=e);const i=r.e;if(i!==null){var t=Y,a=ie;r.e=null;try{for(var n=0;n<i.length;n++){var o=i[n];Ce(o.effect),Qe(o.reaction),Da(o.fn)}}finally{Ce(t),Qe(a)}}re=r.p,r.m=!0}return e||{}}function nr(e){if(!(typeof e!="object"||!e||e instanceof EventTarget)){if(Mr in e)La(e);else if(!Array.isArray(e))for(let r in e){const t=e[r];typeof t=="object"&&t&&Mr in t&&La(t)}}}function La(e,r=new Set){if(typeof e=="object"&&e!==null&&!(e instanceof EventTarget)&&!r.has(e)){r.add(e),e instanceof Date&&e.getTime();for(let a in e)try{La(e[a],r)}catch{}const t=wa(e);if(t!==Object.prototype&&t!==Array.prototype&&t!==Map.prototype&&t!==Set.prototype&&t!==Date.prototype){const a=Fn(t);for(let n in a){const o=a[n].get;if(o)try{o.call(e)}catch{}}}}}function Os(e,r){if(r){const t=document.body;e.autofocus=!0,Qr(()=>{document.activeElement===t&&e.focus()})}}let lo=!1;function Ns(){lo||(lo=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var r;if(!e.defaultPrevented)for(const t of e.target.elements)(r=t.__on_r)==null||r.call(t)})},{capture:!0}))}function co(e){var r=ie,t=Y;Qe(null),Ce(null);try{return e()}finally{Qe(r),Ce(t)}}function zs(e,r,t,a=t){e.addEventListener(r,()=>co(t));const n=e.__on_r;n?e.__on_r=()=>{n(),a(!0)}:e.__on_r=()=>a(!0),Ns()}const uo=new Set,Ua=new Set;function _o(e,r,t,a){function n(o){if(a.capture||kt.call(r,o),!o.cancelBubble)return co(()=>t.call(this,o))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Qr(()=>{r.addEventListener(e,n,a)}):r.addEventListener(e,n,a),n}function Rr(e,r,t,a,n){var o={capture:a,passive:n},i=_o(e,r,t,o);(r===document.body||r===window||r===document)&&Ia(()=>{r.removeEventListener(e,i,o)})}function Ba(e){for(var r=0;r<e.length;r++)uo.add(e[r]);for(var t of Ua)t(e)}function kt(e){var y;var r=this,t=r.ownerDocument,a=e.type,n=((y=e.composedPath)==null?void 0:y.call(e))||[],o=n[0]||e.target,i=0,s=e.__root;if(s){var l=n.indexOf(s);if(l!==-1&&(r===document||r===window)){e.__root=r;return}var c=n.indexOf(r);if(c===-1)return;l<=c&&(i=l)}if(o=n[i]||e.target,o!==r){rs(e,"currentTarget",{configurable:!0,get(){return o||t}});var u=ie,_=Y;Qe(null),Ce(null);try{for(var d,p=[];o!==null;){var m=o.assignedSlot||o.parentNode||o.host||null;try{var f=o["__"+a];if(f!==void 0&&!o.disabled)if(Ot(f)){var[h,...b]=f;h.apply(o,[e,...b])}else f.call(o,e)}catch(v){d?p.push(v):d=v}if(e.cancelBubble||m===r||m===null)break;o=m}if(d){for(let v of p)queueMicrotask(()=>{throw v});throw d}}finally{e.__root=r,delete e.currentTarget,Qe(u),Ce(_)}}}function Va(e){var r=document.createElement("template");return r.innerHTML=e,r.content}function Lr(e,r){var t=Y;t.nodes_start===null&&(t.nodes_start=e,t.nodes_end=r)}function q(e,r){var t=(r&ze)!==0,a=(r&ut)!==0,n,o=!e.startsWith("<!>");return()=>{n===void 0&&(n=Va(o?e:"<!>"+e),t||(n=jr(n)));var i=a?document.importNode(n,!0):n.cloneNode(!0);if(t){var s=jr(i),l=i.lastChild;Lr(s,l)}else Lr(i,i);return i}}function Rs(e,r,t="svg"){var a=!e.startsWith("<!>"),n=`<${t}>${a?e:"<!>"+e}</${t}>`,o;return()=>{if(!o){var i=Va(n),s=jr(i);o=jr(s)}var l=o.cloneNode(!0);return Lr(l,l),l}}function Me(e=""){{var r=gt(e+"");return Lr(r,r),r}}function ne(){var e=document.createDocumentFragment(),r=document.createComment(""),t=gt();return e.append(r,t),Lr(r,t),e}function k(e,r){e!==null&&e.before(r)}let Gt=!0;function po(e){Gt=e}function oe(e,r){var t=r==null?"":typeof r=="object"?r+"":r;t!==(e.__t??(e.__t=e.nodeValue))&&(e.__t=t,e.nodeValue=t==null?"":t+"")}function go(e,r){return Ls(e,r)}const et=new Map;function Ls(e,{target:r,anchor:t,props:a={},events:n,context:o,intro:i=!0}){ys();var s=new Set,l=_=>{for(var d=0;d<_.length;d++){var p=_[d];if(!s.has(p)){s.add(p);var m=$i(p);r.addEventListener(p,kt,{passive:m});var f=et.get(p);f===void 0?(document.addEventListener(p,kt,{passive:m}),et.set(p,1)):et.set(p,f+1)}}};l(ka(uo)),Ua.add(l);var c=void 0,u=ws(()=>{var _=t??r.appendChild(gt());return Je(()=>{if(o){U({});var d=re;d.c=o}n&&(a.$$events=n),Gt=i,c=e(_,a)||{},Gt=!0,o&&B()}),()=>{var m;for(var d of s){r.removeEventListener(d,kt);var p=et.get(d);--p===0?(document.removeEventListener(d,kt),et.delete(d)):et.set(d,p)}Ua.delete(l),_!==t&&((m=_.parentNode)==null||m.removeChild(_))}});return Ha.set(c,u),c}let Ha=new WeakMap;function Wa(e,r){const t=Ha.get(e);return t?(Ha.delete(e),t(r)):Promise.resolve()}function R(e,r,t=!1){var a=e,n=null,o=null,i=le,s=t?kr:0,l=!1;const c=(_,d=!0)=>{l=!0,u(d,_)},u=(_,d)=>{i!==(i=_)&&(i?(n?mt(n):d&&(n=Je(()=>d(a))),o&&Nr(o,()=>{o=null})):(o?mt(o):d&&(o=Je(()=>d(a))),n&&Nr(n,()=>{n=null})))};wr(()=>{l=!1,r(c),l||u(null,null)},s)}function Xt(e,r){return r}function Us(e,r,t,a){for(var n=[],o=r.length,i=0;i<o;i++)Aa(r[i].e,n,!0);var s=o>0&&n.length===0&&t!==null;if(s){var l=t.parentNode;bs(l),l.append(t),a.clear(),xr(e,r[0].prev,r[o-1].next)}Qn(n,()=>{for(var c=0;c<o;c++){var u=r[c];s||(a.delete(u.k),xr(e,u.prev,u.next)),Ze(u.e,!s)}})}function Jt(e,r,t,a,n,o=null){var i=e,s={flags:r,items:new Map,first:null},l=(r&qe)!==0;if(l){var c=e;i=c.appendChild(gt())}var u=null,_=!1;wr(()=>{var d=t(),p=Ot(d)?d:d==null?[]:ka(d),m=p.length;if(!(_&&m===0)){_=m===0;{var f=ie;Bs(p,s,i,n,r,(f.f&ir)!==0,a)}o!==null&&(m===0?u?mt(u):u=Je(()=>o(i)):u!==null&&Nr(u,()=>{u=null})),t()}})}function Bs(e,r,t,a,n,o,i,s){var J,ge,O,M;var l=(n&Ct)!==0,c=(n&(he|We))!==0,u=e.length,_=r.items,d=r.first,p=d,m,f=null,h,b=[],y=[],v,x,P,T;if(l)for(T=0;T<u;T+=1)v=e[T],x=i(v,T),P=_.get(x),P!==void 0&&((J=P.a)==null||J.measure(),(h??(h=new Set)).add(P));for(T=0;T<u;T+=1){if(v=e[T],x=i(v,T),P=_.get(x),P===void 0){var K=p?p.e.nodes_start:t;f=Hs(K,r,f,f===null?r.first:f.next,v,x,T,a,n),_.set(x,f),b=[],y=[],p=f.next;continue}if(c&&Vs(P,v,T,n),(P.e.f&ir)!==0&&(mt(P.e),l&&((ge=P.a)==null||ge.unfix(),(h??(h=new Set)).delete(P))),P!==p){if(m!==void 0&&m.has(P)){if(b.length<y.length){var A=y[0],S;f=A.prev;var z=b[0],Q=b[b.length-1];for(S=0;S<b.length;S+=1)mo(b[S],A,t);for(S=0;S<y.length;S+=1)m.delete(y[S]);xr(r,z.prev,Q.next),xr(r,f,z),xr(r,Q,A),p=A,f=Q,T-=1,b=[],y=[]}else m.delete(P),mo(P,p,t),xr(r,P.prev,P.next),xr(r,P,f===null?r.first:f.next),xr(r,f,P),f=P;continue}for(b=[],y=[];p!==null&&p.k!==x;)(o||(p.e.f&ir)===0)&&(m??(m=new Set)).add(p),y.push(p),p=p.next;if(p===null)continue;P=p}b.push(P),f=P,p=P.next}if(p!==null||m!==void 0){for(var ae=m===void 0?[]:ka(m);p!==null;)(o||(p.e.f&ir)===0)&&ae.push(p),p=p.next;var ue=ae.length;if(ue>0){var W=(n&qe)!==0&&u===0?t:null;if(l){for(T=0;T<ue;T+=1)(O=ae[T].a)==null||O.measure();for(T=0;T<ue;T+=1)(M=ae[T].a)==null||M.fix()}Us(r,ae,W,_)}}l&&Qr(()=>{var $;if(h!==void 0)for(P of h)($=P.a)==null||$.apply()}),Y.first=r.first&&r.first.e,Y.last=f&&f.e}function Vs(e,r,t,a){(a&he)!==0&&Sa(e.v,r),(a&We)!==0?Sa(e.i,t):e.i=t}function Hs(e,r,t,a,n,o,i,s,l,c){var u=(l&he)!==0,_=(l&Ar)===0,d=u?_?Lt(n):Re(n):n,p=(l&We)===0?i:Re(i),m={i:p,v:d,k:o,a:null,e:null,prev:t,next:a};try{return m.e=Je(()=>s(e,d,p),qa),m.e.prev=t&&t.e,m.e.next=a&&a.e,t===null?r.first=m:(t.next=m,t.e.next=m.e),a!==null&&(a.prev=m,a.e.prev=m.e),m}finally{}}function mo(e,r,t){for(var a=e.next?e.next.e.nodes_start:t,n=r?r.e.nodes_start:t,o=e.e.nodes_start;o!==a;){var i=Ut(o);n.before(o),o=i}}function xr(e,r,t){r===null?e.first=t:(r.next=t,r.e.next=t&&t.e),t!==null&&(t.prev=r,t.e.prev=r&&r.e)}function Ur(e,r,t,a,n){var o=e,i="",s;wr(()=>{i!==(i=r()??"")&&(s!==void 0&&(Ze(s),s=void 0),i!==""&&(s=Je(()=>{var l=i+"",c=Va(l);Lr(jr(c),c.lastChild),o.before(c)})))})}function ye(e,r,...t){var a=e,n=ce,o;wr(()=>{n!==(n=r())&&(o&&(Ze(o),o=null),o=Je(()=>n(a,...t)))},kr)}function Ws(e,r,t){var a=e,n,o;wr(()=>{n!==(n=r())&&(o&&(Nr(o),o=null),n&&(o=Je(()=>t(a,n))))},kr)}function Zt(e,r,t,a,n,o){var i,s,l=null,c=e,u;wr(()=>{const _=r()||null;var d=_==="svg"?gr:null;_!==i&&(u&&(_===null?Nr(u,()=>{u=null,s=null}):_===s?mt(u):(Ze(u),po(!1))),_&&_!==s&&(u=Je(()=>{if(l=d?document.createElementNS(d,_):document.createElement(_),Lr(l,l),a){var p=l.appendChild(gt());a(l,p)}Y.nodes_end=l,c.before(l)})),i=_,i&&(s=i),po(!0))},kr)}function V(e,r){Qr(()=>{var t=e.getRootNode(),a=t.host?t:t.head??t.ownerDocument.head;if(!a.querySelector("#"+r.hash)){const n=document.createElement("style");n.id=r.hash,n.textContent=r.code,a.appendChild(n)}})}function fo(e){var r,t,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(r=0;r<n;r++)e[r]&&(t=fo(e[r]))&&(a&&(a+=" "),a+=t)}else for(t in e)e[t]&&(a&&(a+=" "),a+=t);return a}function Ys(){for(var e,r,t=0,a="",n=arguments.length;t<n;t++)(e=arguments[t])&&(r=fo(e))&&(a&&(a+=" "),a+=r);return a}function yo(e){return typeof e=="object"?Ys(e):e??""}function Gs(e,r){r?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function te(e,r,t,a){var n=e.__attributes??(e.__attributes={});n[r]!==(n[r]=t)&&(r==="style"&&"__styles"in e&&(e.__styles={}),r==="loading"&&(e[ss]=t),t==null?e.removeAttribute(r):typeof t!="string"&&ho(e).includes(r)?e[r]=t:e.setAttribute(r,t))}function Qt(e,r,t,a,n=!1,o=!1,i=!1){var s=r||{},l=e.tagName==="OPTION";for(var c in r)c in t||(t[c]=null);t.class&&(t.class=yo(t.class)),a!==void 0&&(t.class=t.class?t.class+" "+a:a);var u=ho(e),_=e.__attributes??(e.__attributes={});for(const b in t){let y=t[b];if(l&&b==="value"&&y==null){e.value=e.__value="",s[b]=y;continue}var d=s[b];if(y!==d){s[b]=y;var p=b[0]+b[1];if(p!=="$$"){if(p==="on"){const v={},x="$$"+b;let P=b.slice(2);var m=Ji(P);if(Gi(P)&&(P=P.slice(0,-7),v.capture=!0),!m&&d){if(y!=null)continue;e.removeEventListener(P,s[x],v),s[x]=null}if(y!=null)if(m)e[`__${P}`]=y,Ba([P]);else{let T=function(K){s[b].call(this,K)};s[x]=_o(P,e,T,v)}else m&&(e[`__${P}`]=void 0)}else if(b==="style"&&y!=null)e.style.cssText=y+"";else if(b==="autofocus")Os(e,!!y);else if(b==="__value"||b==="value"&&y!=null)e.value=e[b]=e.__value=y;else if(b==="selected"&&l)Gs(e,y);else{var f=b;n||(f=Qi(f));var h=f==="defaultValue"||f==="defaultChecked";if(y==null&&!o&&!h)if(_[b]=null,f==="value"||f==="checked"){let v=e;if(f==="value"){let x=v.defaultValue;v.removeAttribute(f),v.defaultValue=x}else{let x=v.defaultChecked;v.removeAttribute(f),v.defaultChecked=x}}else e.removeAttribute(b);else h||u.includes(f)&&(o||typeof y!="string")?e[f]=y:typeof y!="function"&&te(e,f,y)}b==="style"&&"__styles"in e&&(e.__styles={})}}}return s}var bo=new Map;function ho(e){var r=bo.get(e.nodeName);if(r)return r;bo.set(e.nodeName,r=[]);for(var t,a=e,n=Element.prototype;n!==a;){t=Fn(a);for(var o in t)t[o].set&&r.push(o);a=wa(a)}return r}function Xs(e,r,t){var a=e.__className,n=vo(r);(a!==n||qa)&&(n===""?e.removeAttribute("class"):e.setAttribute("class",n),e.__className=n)}function Kt(e,r,t){var a=e.__className,n=vo(r);(a!==n||qa)&&(r==null?e.removeAttribute("class"):e.className=n,e.__className=n)}function vo(e,r){return(e??"")+""}function Br(e,r,t){if(t){if(e.classList.contains(r))return;e.classList.add(r)}else{if(!e.classList.contains(r))return;e.classList.remove(r)}}const Js=()=>performance.now(),fr={tick:e=>requestAnimationFrame(e),now:()=>Js(),tasks:new Set};function ko(){const e=fr.now();fr.tasks.forEach(r=>{r.c(e)||(fr.tasks.delete(r),r.f())}),fr.tasks.size!==0&&fr.tick(ko)}function Zs(e){let r;return fr.tasks.size===0&&fr.tick(ko),{promise:new Promise(t=>{fr.tasks.add(r={c:e,f:t})}),abort(){fr.tasks.delete(r)}}}function $t(e,r){e.dispatchEvent(new CustomEvent(r))}function Qs(e){if(e==="float")return"cssFloat";if(e==="offset")return"cssOffset";if(e.startsWith("--"))return e;const r=e.split("-");return r.length===1?r[0]:r[0]+r.slice(1).map(t=>t[0].toUpperCase()+t.slice(1)).join("")}function wo(e){const r={},t=e.split(";");for(const a of t){const[n,o]=a.split(":");if(!n||o===void 0)break;const i=Qs(n.trim());r[i]=o.trim()}return r}const Ks=e=>e;function Po(e,r,t,a){var n=(e&Mt)!==0,o=(e&jt)!==0,i=n&&o,s=(e&va)!==0,l=i?"both":n?"in":"out",c,u=r.inert,_,d;function p(){var y=ie,v=Y;Qe(null),Ce(null);try{return c??(c=t()(r,(a==null?void 0:a())??{},{direction:l}))}finally{Qe(y),Ce(v)}}var m={is_global:s,in(){var y;if(r.inert=u,!n){d==null||d.abort(),(y=d==null?void 0:d.reset)==null||y.call(d);return}o||_==null||_.abort(),$t(r,"introstart"),_=Ya(r,p(),d,1,()=>{$t(r,"introend"),_==null||_.abort(),_=c=void 0})},out(y){if(!o){y==null||y(),c=void 0;return}r.inert=!0,$t(r,"outrostart"),d=Ya(r,p(),_,0,()=>{$t(r,"outroend"),y==null||y()})},stop:()=>{_==null||_.abort(),d==null||d.abort()}},f=Y;if((f.transitions??(f.transitions=[])).push(m),n&&Gt){var h=s;if(!h){for(var b=f.parent;b&&(b.f&kr)!==0;)for(;(b=b.parent)&&(b.f&Nt)===0;);h=!b||(b.f&An)!==0}h&&Da(()=>{lr(()=>m.in())})}}function Ya(e,r,t,a,n){var o=a===1;if(Xr(r)){var i,s=!1;return Qr(()=>{if(!s){var h=r({direction:o?"in":"out"});i=Ya(e,h,t,a,n)}}),{abort:()=>{s=!0,i==null||i.abort()},deactivate:()=>i.deactivate(),reset:()=>i.reset(),t:()=>i.t()}}if(t==null||t.deactivate(),!(r!=null&&r.duration))return n(),{abort:ce,deactivate:ce,reset:ce,t:()=>a};const{delay:l=0,css:c,tick:u,easing:_=Ks}=r;var d=[];if(o&&t===void 0&&(u&&u(0,1),c)){var p=wo(c(0,1));d.push(p,p)}var m=()=>1-a,f=e.animate(d,{duration:l});return f.onfinish=()=>{var h=(t==null?void 0:t.t())??1-a;t==null||t.abort();var b=a-h,y=r.duration*Math.abs(b),v=[];if(y>0){if(c)for(var x=Math.ceil(y/16.666666666666668),P=0;P<=x;P+=1){var T=h+b*_(P/x),K=c(T,1-T);v.push(wo(K))}m=()=>{var A=f.currentTime;return h+b*_(A/y)},u&&Zs(()=>{if(f.playState!=="running")return!1;var A=m();return u(A,1-A),!0})}f=e.animate(v,{duration:y,fill:"forwards"}),f.onfinish=()=>{m=()=>a,u==null||u(a,1-a),n()}},{abort:()=>{f&&(f.cancel(),f.effect=null,f.onfinish=ce)},deactivate:()=>{n=ce},reset:()=>{a===0&&(u==null||u(1,0))},t:()=>m()}}function $s(e,r,t=r){var a=Wt();zs(e,"input",n=>{var o=n?e.defaultValue:e.value;if(o=Ga(e)?Xa(o):o,t(o),a&&o!==(o=r())){var i=e.selectionStart,s=e.selectionEnd;e.value=o??"",s!==null&&(e.selectionStart=i,e.selectionEnd=Math.min(s,e.value.length))}}),lr(r)==null&&e.value&&t(Ga(e)?Xa(e.value):e.value),Bt(()=>{var n=r();Ga(e)&&n===Xa(e.value)||e.type==="date"&&!n&&!e.value||n!==e.value&&(e.value=n??"")})}function Ga(e){var r=e.type;return r==="number"||r==="range"}function Xa(e){return e===""?null:+e}function xo(e,r,t){var a=mr(e,r);a&&a.set&&(e[r]=t,Ia(()=>{e[r]=null}))}function Eo(e){return function(...r){var t=r[0];return t.preventDefault(),e==null?void 0:e.apply(this,r)}}function de(e=!1){const r=re,t=r.l.u;if(!t)return;let a=()=>nr(r.s);if(e){let n=0,o={};const i=C(()=>{let s=!1;const l=r.s;for(const c in l)l[c]!==o[c]&&(o[c]=l[c],s=!0);return s&&n++,n});a=()=>g(i)}t.b.length&&ks(()=>{So(r,a),Pa(t.b)}),Fa(()=>{const n=lr(()=>t.m.map(ns));return()=>{for(const o of n)typeof o=="function"&&o()}}),t.a.length&&Fa(()=>{So(r,a),Pa(t.a)})}function So(e,r){if(e.l.s)for(const t of e.l.s)g(t);r()}function Ja(e,r){var o;var t=(o=e.$$events)==null?void 0:o[r.type],a=Ot(t)?t.slice():t==null?[]:[t];for(var n of a)n.call(this,r)}function cr(e){re===null&&ja(),Z&&re.l!==null?rl(re).m.push(e):Fa(()=>{const r=lr(e);if(typeof r=="function")return r})}function el(e){re===null&&ja(),cr(()=>()=>lr(e))}function rl(e){var r=e.l;return r.u??(r.u={a:[],b:[],m:[]})}function tl(e,r,t){if(e==null)return r(void 0),ce;const a=lr(()=>e.subscribe(r,t));return a.unsubscribe?()=>a.unsubscribe():a}let ea=!1;function Ke(e,r,t){const a=t[r]??(t[r]={store:null,source:Lt(void 0),unsubscribe:ce});if(a.store!==e)if(a.unsubscribe(),a.store=e??null,e==null)a.source.v=void 0,a.unsubscribe=ce;else{var n=!0;a.unsubscribe=tl(e,o=>{n?a.source.v=o:j(a.source,o)}),n=!1}return g(a.source)}function $e(){const e={};return Ia(()=>{for(var r in e)e[r].unsubscribe()}),e}function al(e){var r=ea;try{return ea=!1,[e(),ea]}finally{ea=r}}const nl={get(e,r){if(!e.exclude.includes(r))return e.props[r]},set(e,r){return!1},getOwnPropertyDescriptor(e,r){if(!e.exclude.includes(r)&&r in e.props)return{enumerable:!0,configurable:!0,value:e.props[r]}},has(e,r){return e.exclude.includes(r)?!1:r in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(r=>!e.exclude.includes(r))}};function Er(e,r,t){return new Proxy({props:e,exclude:r},nl)}const ol={get(e,r){let t=e.props.length;for(;t--;){let a=e.props[t];if(Xr(a)&&(a=a()),typeof a=="object"&&a!==null&&r in a)return a[r]}},set(e,r,t){let a=e.props.length;for(;a--;){let n=e.props[a];Xr(n)&&(n=n());const o=mr(n,r);if(o&&o.set)return o.set(t),!0}return!1},getOwnPropertyDescriptor(e,r){let t=e.props.length;for(;t--;){let a=e.props[t];if(Xr(a)&&(a=a()),typeof a=="object"&&a!==null&&r in a){const n=mr(a,r);return n&&!n.configurable&&(n.configurable=!0),n}}},has(e,r){if(r===Mr||r===Mn)return!1;for(let t of e.props)if(Xr(t)&&(t=t()),t!=null&&r in t)return!0;return!1},ownKeys(e){const r=[];for(let t of e.props){Xr(t)&&(t=t());for(const a in t)r.includes(a)||r.push(a)}return r}};function yr(...e){return new Proxy({props:e},ol)}function qo(e){for(var r=Y,t=Y;r!==null&&(r.f&(tr|_t))===0;)r=r.parent;try{return Ce(r),e()}finally{Ce(t)}}function w(e,r,t,a){var K;var n=(t&st)!==0,o=!Z||(t&se)!==0,i=(t&Ye)!==0,s=(t&ct)!==0,l=!1,c;i?[c,l]=al(()=>e[r]):c=e[r];var u=Mr in e||Mn in e,_=((K=mr(e,r))==null?void 0:K.set)??(u&&i&&r in e?A=>e[r]=A:void 0),d=a,p=!0,m=!1,f=()=>(m=!0,p&&(p=!1,s?d=lr(a):d=a),d);c===void 0&&a!==void 0&&(_&&o&&_s(),c=f(),_&&_(c));var h;if(o)h=()=>{var A=e[r];return A===void 0?f():(p=!0,m=!1,A)};else{var b=qo(()=>(n?C:Te)(()=>e[r]));b.f|=os,h=()=>{var A=g(b);return A!==void 0&&(d=void 0),A===void 0?d:A}}if((t<)===0)return h;if(_){var y=e.$$legacy;return function(A,S){return arguments.length>0?((!o||!S||y||l)&&_(S?h():A),A):h()}}var v=!1,x=!1,P=Lt(c),T=qo(()=>C(()=>{var A=h(),S=g(P);return v?(v=!1,x=!0,S):(x=!1,P.v=A)}));return n||(T.equals=xa),function(A,S){if(arguments.length>0){const z=S?g(T):o&&i?Xe(A):A;return T.equals(z)||(v=!0,j(P,z),m&&d!==void 0&&(d=z),lr(()=>g(T))),A}return g(T)}}function To(e,r){var t=Y,a=ie,n=re;Ce(e),Qe(e),to(e.ctx);try{r()}finally{Ce(t),Qe(a),to(n)}}function il(e,r,t){var a=e,n;wr(()=>{var o=Y,i=!1;o.fn=s=>{var l=r.onerror;let c=r.failed;if(!l&&!c||i)throw s;var u=()=>{Nr(n),To(o,()=>{i=!1,n=Je(()=>t(a)),Ra()})};l==null||l(s,u),n&&Ze(n),c&&Qr(()=>{To(o,()=>{i=!0;try{n=Je(()=>{c(a,()=>s,()=>u)})}catch(_){bt(_,o,null,o.ctx)}Ra(),i=!1})})},n=Je(()=>t(a)),Ra()},kr|zt)}var we=(e=>(e[e.UnknownError=0]="UnknownError",e[e.UserCancelledError=1]="UserCancelledError",e[e.StoreProblemError=2]="StoreProblemError",e[e.PurchaseNotAllowedError=3]="PurchaseNotAllowedError",e[e.PurchaseInvalidError=4]="PurchaseInvalidError",e[e.ProductNotAvailableForPurchaseError=5]="ProductNotAvailableForPurchaseError",e[e.ProductAlreadyPurchasedError=6]="ProductAlreadyPurchasedError",e[e.ReceiptAlreadyInUseError=7]="ReceiptAlreadyInUseError",e[e.InvalidReceiptError=8]="InvalidReceiptError",e[e.MissingReceiptFileError=9]="MissingReceiptFileError",e[e.NetworkError=10]="NetworkError",e[e.InvalidCredentialsError=11]="InvalidCredentialsError",e[e.UnexpectedBackendResponseError=12]="UnexpectedBackendResponseError",e[e.InvalidAppUserIdError=14]="InvalidAppUserIdError",e[e.OperationAlreadyInProgressError=15]="OperationAlreadyInProgressError",e[e.UnknownBackendError=16]="UnknownBackendError",e[e.InvalidAppleSubscriptionKeyError=17]="InvalidAppleSubscriptionKeyError",e[e.IneligibleError=18]="IneligibleError",e[e.InsufficientPermissionsError=19]="InsufficientPermissionsError",e[e.PaymentPendingError=20]="PaymentPendingError",e[e.InvalidSubscriberAttributesError=21]="InvalidSubscriberAttributesError",e[e.LogOutWithAnonymousUserError=22]="LogOutWithAnonymousUserError",e[e.ConfigurationError=23]="ConfigurationError",e[e.UnsupportedError=24]="UnsupportedError",e[e.EmptySubscriberAttributesError=25]="EmptySubscriberAttributesError",e[e.CustomerInfoError=28]="CustomerInfoError",e[e.SignatureVerificationError=36]="SignatureVerificationError",e[e.InvalidEmailError=38]="InvalidEmailError",e))(we||{});class wt{static getPublicMessage(r){switch(r){case 0:return"Unknown error.";case 1:return"Purchase was cancelled.";case 2:return"There was a problem with the store.";case 3:return"The device or user is not allowed to make the purchase.";case 4:return"One or more of the arguments provided are invalid.";case 5:return"The product is not available for purchase.";case 6:return"This product is already active for the user.";case 7:return"There is already another active subscriber using the same receipt.";case 8:return"The receipt is not valid.";case 9:return"The receipt is missing.";case 10:return"Error performing request. Please check your network connection and try again.";case 11:return"There was a credentials issue. Check the underlying error for more details.";case 12:return"Received unexpected response from the backend.";case 14:return"The app user id is not valid.";case 15:return"The operation is already in progress.";case 16:return"There was an unknown backend error.";case 17:return"Apple Subscription Key is invalid or not present. In order to provide subscription offers, you must first generate a subscription key. Please see https://docs.revenuecat.com/docs/ios-subscription-offers for more info.";case 18:return"The User is ineligible for that action.";case 19:return"App does not have sufficient permissions to make purchases.";case 20:return"The payment is pending.";case 21:return"One or more of the attributes sent could not be saved.";case 22:return"Called logOut but the current user is anonymous.";case 23:return"There is an issue with your configuration. Check the underlying error for more details.";case 24:return"There was a problem with the operation. Looks like we doesn't support that yet. Check the underlying error for more details.";case 25:return"A request for subscriber attributes returned none.";case 28:return"There was a problem related to the customer info.";case 36:return"Request failed signature verification. Please see https://rev.cat/trusted-entitlements for more info.";case 38:return"Email is not valid. Please provide a valid email address."}}static getErrorCodeForBackendErrorCode(r){switch(r){case 7101:case 7773:case 7898:case 7899:case 7900:case 7901:return 2;case 7102:return 7;case 7103:return 8;case 7107:case 7224:case 7225:return 11;case 7105:case 7106:case 7814:case 7877:case 7878:return 4;case 7772:return 6;case 7220:return 14;case 7229:return 2;case 7230:case 7e3:return 23;case 7231:return 2;case 7232:return 18;case 7263:case 7264:return 21;case 7104:case 7234:case 7226:case 7110:case 7887:return 12;case 7662:return 24;case 7012:case 7834:case 7879:return 38;case 7896:case 7897:case 7886:return 0}}static convertCodeToBackendErrorCode(r){return r in rt?r:null}static convertPurchaseFlowErrorCodeToErrorCode(r){switch(r){case fe.ErrorSettingUpPurchase:return 2;case fe.ErrorChargingPayment:return 20;case fe.NetworkError:return 10;case fe.MissingEmailError:return 4;case fe.UnknownError:return 0;case fe.AlreadyPurchasedError:return 6}}}var rt=(e=>(e[e.BackendInvalidPlatform=7e3]="BackendInvalidPlatform",e[e.BackendInvalidEmail=7012]="BackendInvalidEmail",e[e.BackendStoreProblem=7101]="BackendStoreProblem",e[e.BackendCannotTransferPurchase=7102]="BackendCannotTransferPurchase",e[e.BackendInvalidReceiptToken=7103]="BackendInvalidReceiptToken",e[e.BackendInvalidAppStoreSharedSecret=7104]="BackendInvalidAppStoreSharedSecret",e[e.BackendInvalidPaymentModeOrIntroPriceNotProvided=7105]="BackendInvalidPaymentModeOrIntroPriceNotProvided",e[e.BackendProductIdForGoogleReceiptNotProvided=7106]="BackendProductIdForGoogleReceiptNotProvided",e[e.BackendInvalidPlayStoreCredentials=7107]="BackendInvalidPlayStoreCredentials",e[e.BackendInternalServerError=7110]="BackendInternalServerError",e[e.BackendEmptyAppUserId=7220]="BackendEmptyAppUserId",e[e.BackendInvalidAuthToken=7224]="BackendInvalidAuthToken",e[e.BackendInvalidAPIKey=7225]="BackendInvalidAPIKey",e[e.BackendBadRequest=7226]="BackendBadRequest",e[e.BackendPlayStoreQuotaExceeded=7229]="BackendPlayStoreQuotaExceeded",e[e.BackendPlayStoreInvalidPackageName=7230]="BackendPlayStoreInvalidPackageName",e[e.BackendPlayStoreGenericError=7231]="BackendPlayStoreGenericError",e[e.BackendUserIneligibleForPromoOffer=7232]="BackendUserIneligibleForPromoOffer",e[e.BackendInvalidAppleSubscriptionKey=7234]="BackendInvalidAppleSubscriptionKey",e[e.BackendInvalidSubscriberAttributes=7263]="BackendInvalidSubscriberAttributes",e[e.BackendInvalidSubscriberAttributesBody=7264]="BackendInvalidSubscriberAttributesBody",e[e.BackendProductIDsMalformed=7662]="BackendProductIDsMalformed",e[e.BackendAlreadySubscribedError=7772]="BackendAlreadySubscribedError",e[e.BackendPaymentGatewayGenericError=7773]="BackendPaymentGatewayGenericError",e[e.BackendOfferNotFound=7814]="BackendOfferNotFound",e[e.BackendNoMXRecordsFound=7834]="BackendNoMXRecordsFound",e[e.BackendInvalidOperationSession=7877]="BackendInvalidOperationSession",e[e.BackendPurchaseCannotBeCompleted=7878]="BackendPurchaseCannotBeCompleted",e[e.BackendEmailIsRequired=7879]="BackendEmailIsRequired",e[e.BackendTaxCollectionNotEnabled=7886]="BackendTaxCollectionNotEnabled",e[e.BackendTaxCalculationRequiresPostalCode=7887]="BackendTaxCalculationRequiresPostalCode",e[e.BackendTaxLocationCannotBeDetermined=7896]="BackendTaxLocationCannotBeDetermined",e[e.BackendInvalidTaxLocation=7897]="BackendInvalidTaxLocation",e[e.BackendGatewaySetupErrorStripeTaxNotActive=7898]="BackendGatewaySetupErrorStripeTaxNotActive",e[e.BackendGatewaySetupErrorInvalidTaxOriginAddress=7899]="BackendGatewaySetupErrorInvalidTaxOriginAddress",e[e.BackendGatewaySetupErrorMissingRequiredPermission=7900]="BackendGatewaySetupErrorMissingRequiredPermission",e[e.BackendGatewaySetupErrorSandboxModeOnly=7901]="BackendGatewaySetupErrorSandboxModeOnly",e))(rt||{});class be extends Error{constructor(t,a,n,o){super(a);I(this,"toString",()=>`PurchasesError(code: ${we[this.errorCode]}, message: ${this.message})`);this.errorCode=t,this.underlyingErrorMessage=n,this.extra=o}static getForBackendError(t,a){const n=wt.getErrorCodeForBackendErrorCode(t);return new be(n,wt.getPublicMessage(n),a,{backendErrorCode:t})}static getForPurchasesFlowError(t){return new be(wt.convertPurchaseFlowErrorCodeToErrorCode(t.errorCode),t.message,t.underlyingErrorMessage)}}class Io extends Error{constructor(){super("Purchases must be configured before calling getInstance")}}var Pt=(e=>(e.Started="started",e.InProgress="in_progress",e.Succeeded="succeeded",e.Failed="failed",e))(Pt||{}),tt=(e=>(e[e.SetupIntentCreationFailed=1]="SetupIntentCreationFailed",e[e.PaymentMethodCreationFailed=2]="PaymentMethodCreationFailed",e[e.PaymentChargeFailed=3]="PaymentChargeFailed",e[e.SetupIntentCompletionFailed=4]="SetupIntentCompletionFailed",e[e.AlreadyPurchased=5]="AlreadyPurchased",e))(tt||{}),je=(e=>(e[e.Silent=0]="Silent",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Info=3]="Info",e[e.Debug=4]="Debug",e[e.Verbose=5]="Verbose",e))(je||{});class X{static setLogLevel(r){this.logLevel=r}static log(r,t=this.logLevel){const a=`[Purchases] ${r}`;if(!(this.logLevel<t||t===je.Silent))switch(t){case je.Error:console.error(a);break;case je.Warn:console.warn(a);break;case je.Info:console.info(a);break;case je.Debug:console.debug(a);break;case je.Verbose:console.debug(a);break}}static errorLog(r){this.log(r,je.Error)}static warnLog(r){this.log(r,je.Warn)}static infoLog(r){this.log(r,je.Info)}static debugLog(r){this.log(r,je.Debug)}static verboseLog(r){this.log(r,je.Verbose)}}I(X,"logLevel",je.Silent);function sl(e){var r;return e.operation.redemption_info?{redeemUrl:((r=e.operation.redemption_info)==null?void 0:r.redeem_url)??null}:null}var fe=(e=>(e[e.ErrorSettingUpPurchase=0]="ErrorSettingUpPurchase",e[e.ErrorChargingPayment=1]="ErrorChargingPayment",e[e.UnknownError=2]="UnknownError",e[e.NetworkError=3]="NetworkError",e[e.MissingEmailError=4]="MissingEmailError",e[e.AlreadyPurchasedError=5]="AlreadyPurchasedError",e))(fe||{});class _e extends Error{constructor(r,t,a,n,o){super(t),this.errorCode=r,this.underlyingErrorMessage=a,this.purchasesErrorCode=n,this.extra=o}isRecoverable(){switch(this.errorCode){case 3:case 4:return!0;case 0:case 1:case 5:case 2:return!1}}getErrorCode(){var r;return((r=this.extra)==null?void 0:r.backendErrorCode)??this.purchasesErrorCode??this.errorCode}static fromPurchasesError(r,t){let a;return r.errorCode===we.ProductAlreadyPurchasedError?a=5:r.errorCode===we.InvalidEmailError?a=4:r.errorCode===we.NetworkError?a=3:a=t,new _e(a,r.message,r.underlyingErrorMessage,r.errorCode,r.extra)}}var ra=(e=>(e.Pending="pending",e.InvalidLocation="invalid_location",e.Disabled="disabled",e))(ra||{});class ll{constructor(r,t,a=10){I(this,"operationSessionId",null);I(this,"backend");I(this,"eventsTracker");I(this,"maxNumberAttempts");I(this,"waitMSBetweenAttempts",1e3);this.backend=r,this.eventsTracker=t,this.maxNumberAttempts=a}async checkoutStart(r,t,a,n,o,i){try{const s=this.eventsTracker.getTraceId(),l=await this.backend.postCheckoutStart(r,t,n,a,s,o,i);return this.operationSessionId=l.operation_session_id,l}catch(s){if(s instanceof be)throw _e.fromPurchasesError(s,0);{const l="Unknown error starting purchase: "+String(s);throw X.errorLog(l),new _e(2,l)}}}async checkoutCalculateTax(r,t){var n;const a=this.operationSessionId;if(!a)throw new _e(0,"No purchase started");try{return{error:void 0,data:await this.backend.postCheckoutCalculateTax(a,r,t)}}catch(o){if(o instanceof be){const i=(n=o.extra)==null?void 0:n.backendErrorCode;let s;if(i===rt.BackendTaxLocationCannotBeDetermined)s="pending";else if(i===rt.BackendInvalidTaxLocation)s="invalid_location";else if(i===rt.BackendTaxCollectionNotEnabled||!this.backend.getIsSandbox()&&i&&i!==rt.BackendGatewaySetupErrorSandboxModeOnly)s="disabled";else throw _e.fromPurchasesError(o,0);return{error:s}}else{const i="Unknown error calculating tax: "+String(o);throw X.errorLog(i),new _e(2,i)}}}async checkoutComplete(r){const t=this.operationSessionId;if(!t)throw new _e(0,"No purchase started");try{return await this.backend.postCheckoutComplete(t,r)}catch(a){if(a instanceof be)throw _e.fromPurchasesError(a,0);{const n="Unknown error starting purchase: "+String(a);throw X.errorLog(n),new _e(2,n)}}}async pollCurrentPurchaseForCompletion(){const r=this.operationSessionId;if(!r)throw new _e(0,"No purchase in progress");return new Promise((t,a)=>{const n=(o=1)=>{if(o>this.maxNumberAttempts){this.clearPurchaseInProgress(),a(new _e(2,"Max attempts reached trying to get successful purchase status"));return}this.backend.getCheckoutStatus(r).then(i=>{switch(i.operation.status){case Pt.Started:case Pt.InProgress:setTimeout(()=>n(o+1),this.waitMSBetweenAttempts);break;case Pt.Succeeded:this.clearPurchaseInProgress(),t({redemptionInfo:sl(i),operationSessionId:r});return;case Pt.Failed:this.clearPurchaseInProgress(),this.handlePaymentError(i.operation.error,a)}}).catch(i=>{const s=_e.fromPurchasesError(i,3);a(s)})};n()})}clearPurchaseInProgress(){this.operationSessionId=null}handlePaymentError(r,t){if(r==null){t(new _e(2,"Got an error status but error field is empty."));return}switch(r.code){case tt.SetupIntentCreationFailed:t(new _e(0,"Setup intent creation failed"));return;case tt.PaymentMethodCreationFailed:t(new _e(0,"Payment method creation failed"));return;case tt.PaymentChargeFailed:t(new _e(1,"Payment charge failed"));return;case tt.SetupIntentCompletionFailed:t(new _e(0,"Setup intent completion failed"));return;case tt.AlreadyPurchased:t(new _e(5,"Purchased was already completed"));return;default:t(new _e(2,"Unknown error code received"));return}}}const or="rcb-ui-translator",Sr="en",cl={"periods.week":"{{amount}} week","periods.month":"{{amount}} month","periods.year":"{{amount}} year","periods.day":"{{amount}} day","periods.weekShort":"{{amount}}wk","periods.monthShort":"{{amount}}mo","periods.yearShort":"{{amount}}yr","periods.dayShort":"{{amount}}d","periods.lifetime":"lifetime","periods.weekPlural":"{{amount}} weeks","periods.monthPlural":"{{amount}} months","periods.yearPlural":"{{amount}} years","periods.dayPlural":"{{amount}} days","periods.weekFrequency":"weekly","periods.monthFrequency":"monthly","periods.yearFrequency":"yearly","periods.dayFrequency":"daily","periods.perWeekFrequency":"per week","periods.perMonthFrequency":"per month","periods.perYearFrequency":"per year","periods.perDayFrequency":"per day","periods.unknownFrequency":"unknown","periods.weekFrequencyPlural":"every {{amount}} weeks","periods.monthFrequencyPlural":"every {{amount}} months","periods.yearFrequencyPlural":"every {{amount}} years","periods.dayFrequencyPlural":"every {{amount}} days","product_info.subscribe_to":"Subscribe to","product_info.product_title":"{{productTitle}}","product_info.product_description":"{{productDescription}}","product_info.product_price":"{{productPrice}}","product_info.free_trial_duration":"Free for {{trialDuration}}","product_info.price_after_free_trial":"After trial ends, on {{renewalDate}}","product_info.total_due_today":"Total due today","product_info.renewal_frequency":"Renews {{frequency}}","product_info.continues_until_cancelled":"Continues until cancelled","product_info.cancel_anytime":"Cancel anytime","email_entry_page.email_step_title":"What's your email?","email_entry_page.email_input_label":"Email","email_entry_page.email_input_placeholder":"john@appleseed.com","email_entry_page.button_continue":"Continue","payment_entry_page.payment_step_title":"Secure checkout by RevenueCat","payment_entry_page.terms_info":"By providing your card information you allow {{ap