@revenuecat/purchases-js 0.1.2 → 0.2.0
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.
- package/dist/Purchases.es.d.ts +4 -0
- package/dist/Purchases.es.js +721 -709
- package/dist/Purchases.umd.js +4 -4
- package/package.json +16 -1
package/dist/Purchases.umd.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
(function(L,V){typeof exports=="object"&&typeof module<"u"?V(exports):typeof define=="function"&&define.amd?define(["exports"],V):(L=typeof globalThis<"u"?globalThis:L||self,V(L.Purchases={}))})(this,function(L){"use strict";var So=Object.defineProperty;var Oo=(L,V,re)=>V in L?So(L,V,{enumerable:!0,configurable:!0,writable:!0,value:re}):L[V]=re;var Q=(L,V,re)=>(Oo(L,typeof V!="symbol"?V+"":V,re),re);function V(t){return t!=null}var re=(t=>(t.Unknown="unknown",t.Custom="custom",t.Lifetime="$rc_lifetime",t.Annual="$rc_annual",t.SixMonth="$rc_six_month",t.ThreeMonth="$rc_three_month",t.TwoMonth="$rc_two_month",t.Monthly="$rc_monthly",t.Weekly="$rc_weekly",t))(re||{});const Ft=(t,e)=>({identifier:t.identifier,displayName:t.title,currentPrice:t.current_price,normalPeriodDuration:t.normal_period_duration,presentedOfferingIdentifier:e}),Gt=(t,e,r)=>{const n=r[e.platform_product_identifier];return n===void 0?null:{identifier:e.identifier,rcBillingProduct:Ft(n,t),packageType:Yt(e.identifier)}},et=(t,e)=>{const r=t.packages.map(i=>Gt(t.identifier,i,e)).filter(V),n={};for(const i of r)i!=null&&(n[i.identifier]=i);return r.length==0?null:{identifier:t.identifier,serverDescription:t.description,metadata:t.metadata,packagesById:n,availablePackages:r,lifetime:n.$rc_lifetime??null,annual:n.$rc_annual??null,sixMonth:n.$rc_six_month??null,threeMonth:n.$rc_three_month??null,twoMonth:n.$rc_two_month??null,monthly:n.$rc_monthly??null,weekly:n.$rc_weekly??null}};function Yt(t){switch(t){case"$rc_lifetime":return"$rc_lifetime";case"$rc_annual":return"$rc_annual";case"$rc_six_month":return"$rc_six_month";case"$rc_three_month":return"$rc_three_month";case"$rc_two_month":return"$rc_two_month";case"$rc_monthly":return"$rc_monthly";case"$rc_weekly":return"$rc_weekly";default:return t.startsWith("$rc_")?"unknown":"custom"}}function v(){}function Ht(t,e){for(const r in e)t[r]=e[r];return t}function tt(t){return t()}function nt(){return Object.create(null)}function pe(t){t.forEach(tt)}function le(t){return typeof t=="function"}function P(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let De;function te(t,e){return t===e?!0:(De||(De=document.createElement("a")),De.href=e,t===De.href)}function rt(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function Kt(t,e){const r=rt(t.srcset),n=rt(e||"");return n.length===r.length&&n.every(([i,o],s)=>o===r[s][1]&&(te(r[s][0],i)||te(i,r[s][0])))}function qt(t){return Object.keys(t).length===0}function G(t,e,r,n){if(t){const i=it(t,e,r,n);return t[0](i)}}function it(t,e,r,n){return t[1]&&n?Ht(r.ctx.slice(),t[1](n(e))):r.ctx}function Y(t,e,r,n){if(t[2]&&n){const i=t[2](n(r));if(e.dirty===void 0)return i;if(typeof i=="object"){const o=[],s=Math.max(e.dirty.length,i.length);for(let l=0;l<s;l+=1)o[l]=e.dirty[l]|i[l];return o}return e.dirty|i}return e.dirty}function H(t,e,r,n,i,o){if(i){const s=it(e,r,n,o);t.p(s,i)}}function K(t){if(t.ctx.length>32){const e=[],r=t.ctx.length/32;for(let n=0;n<r;n++)e[n]=-1;return e}return-1}function _e(t){return t??""}function D(t,e){t.appendChild(e)}function S(t,e,r){const n=jt(t);if(!n.getElementById(e)){const i=k("style");i.id=e,i.textContent=r,Jt(n,i)}}function jt(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function Jt(t,e){return D(t.head||t,e),e.sheet}function p(t,e,r){t.insertBefore(e,r||null)}function g(t){t.parentNode&&t.parentNode.removeChild(t)}function k(t){return document.createElement(t)}function R(t){return document.createTextNode(t)}function T(){return R(" ")}function ne(){return R("")}function Ae(t,e,r,n){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r,n)}function ot(t){return function(e){return e.preventDefault(),t.call(this,e)}}function _(t,e,r){r==null?t.removeAttribute(e):t.getAttribute(e)!==r&&t.setAttribute(e,r)}const Vt=["width","height"];function Wt(t,e){const r=Object.getOwnPropertyDescriptors(t.__proto__);for(const n in e)e[n]==null?t.removeAttribute(n):n==="style"?t.style.cssText=e[n]:n==="__value"?t.value=t[n]=e[n]:r[n]&&r[n].set&&Vt.indexOf(n)===-1?t[n]=e[n]:_(t,n,e[n])}function zt(t,e){Object.keys(e).forEach(r=>{Xt(t,r,e[r])})}function Xt(t,e,r){const n=e.toLowerCase();n in t?t[n]=typeof t[n]=="boolean"&&r===""?!0:r:e in t?t[e]=typeof t[e]=="boolean"&&r===""?!0:r:_(t,e,r)}function Zt(t){return/-/.test(t)?zt:Wt}function en(t){return Array.from(t.childNodes)}function ie(t,e){e=""+e,t.data!==e&&(t.data=e)}function st(t,e){t.value=e??""}function tn(t,e,{bubbles:r=!1,cancelable:n=!1}={}){return new CustomEvent(t,{detail:e,bubbles:r,cancelable:n})}let he;function Ee(t){he=t}function Ce(){if(!he)throw new Error("Function called outside component initialization");return he}function Me(t){Ce().$$.on_mount.push(t)}function nn(){const t=Ce();return(e,r,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const o=tn(e,r,{cancelable:n});return i.slice().forEach(s=>{s.call(t,o)}),!o.defaultPrevented}return!0}}function rn(t,e){return Ce().$$.context.set(t,e),e}function on(t){return Ce().$$.context.get(t)}function lt(t,e){const r=t.$$.callbacks[e.type];r&&r.slice().forEach(n=>n.call(this,e))}const ce=[],Qe=[];let ae=[];const Ge=[],sn=Promise.resolve();let Ye=!1;function ln(){Ye||(Ye=!0,sn.then(ct))}function He(t){ae.push(t)}function cn(t){Ge.push(t)}const Ke=new Set;let ue=0;function ct(){if(ue!==0)return;const t=he;do{try{for(;ue<ce.length;){const e=ce[ue];ue++,Ee(e),an(e.$$)}}catch(e){throw ce.length=0,ue=0,e}for(Ee(null),ce.length=0,ue=0;Qe.length;)Qe.pop()();for(let e=0;e<ae.length;e+=1){const r=ae[e];Ke.has(r)||(Ke.add(r),r())}ae.length=0}while(ce.length);for(;Ge.length;)Ge.pop()();Ye=!1,Ke.clear(),Ee(t)}function an(t){if(t.fragment!==null){t.update(),pe(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(He)}}function un(t){const e=[],r=[];ae.forEach(n=>t.indexOf(n)===-1?e.push(n):r.push(n)),r.forEach(n=>n()),ae=e}const Pe=new Set;let se;function x(){se={r:0,c:[],p:se}}function F(){se.r||pe(se.c),se=se.p}function u(t,e){t&&t.i&&(Pe.delete(t),t.i(e))}function d(t,e,r,n){if(t&&t.o){if(Pe.has(t))return;Pe.add(t),se.c.push(()=>{Pe.delete(t),n&&(r&&t.d(1),n())}),t.o(e)}else n&&n()}function fn(t,e,r){const n=t.$$.props[e];n!==void 0&&(t.$$.bound[n]=r,r(t.$$.ctx[n]))}function w(t){t&&t.c()}function I(t,e,r){const{fragment:n,after_update:i}=t.$$;n&&n.m(e,r),He(()=>{const o=t.$$.on_mount.map(tt).filter(le);t.$$.on_destroy?t.$$.on_destroy.push(...o):pe(o),t.$$.on_mount=[]}),i.forEach(He)}function b(t,e){const r=t.$$;r.fragment!==null&&(un(r.after_update),pe(r.on_destroy),r.fragment&&r.fragment.d(e),r.on_destroy=r.fragment=null,r.ctx=[])}function dn(t,e){t.$$.dirty[0]===-1&&(ce.push(t),ln(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function U(t,e,r,n,i,o,s=null,l=[-1]){const c=he;Ee(t);const a=t.$$={fragment:null,ctx:[],props:o,update:v,not_equal:i,bound:nt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:nt(),dirty:l,skip_bound:!1,root:e.target||c.$$.root};s&&s(a.root);let f=!1;if(a.ctx=r?r(t,e.props||{},(m,E,...y)=>{const A=y.length?y[0]:E;return a.ctx&&i(a.ctx[m],a.ctx[m]=A)&&(!a.skip_bound&&a.bound[m]&&a.bound[m](A),f&&dn(t,m)),E}):[],a.update(),f=!0,pe(a.before_update),a.fragment=n?n(a.ctx):!1,e.target){if(e.hydrate){const m=en(e.target);a.fragment&&a.fragment.l(m),m.forEach(g)}else a.fragment&&a.fragment.c();e.intro&&u(t.$$.fragment),I(t,e.target,e.anchor),ct()}Ee(c)}class N{constructor(){Q(this,"$$");Q(this,"$$set")}$destroy(){b(this,1),this.$destroy=v}$on(e,r){if(!le(r))return v;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(r),()=>{const i=n.indexOf(r);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!qt(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const mn="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(mn);function gn(t){S(t,"svelte-1bzqb13",".rcb-modal-section.svelte-1bzqb13{padding:8px 0px;display:flex}section.rcb-modal-section.svelte-1bzqb13{flex-grow:1}.rcb-modal-section.svelte-1bzqb13:last-of-type{padding:0}")}function qe(t){let e,r;const n=t[2].default,i=G(n,t,t[1],null);return{c(){e=k(t[0]),i&&i.c(),Zt(t[0])(e,{class:_e("rcb-modal-section")+" svelte-1bzqb13"})},m(o,s){p(o,e,s),i&&i.m(e,null),r=!0},p(o,s){i&&i.p&&(!r||s&2)&&H(i,n,o,o[1],r?Y(n,o[1],s,null):K(o[1]),null)},i(o){r||(u(i,o),r=!0)},o(o){d(i,o),r=!1},d(o){o&&g(e),i&&i.d(o)}}}function pn(t){let e=t[0],r,n,i=t[0]&&qe(t);return{c(){i&&i.c(),r=ne()},m(o,s){i&&i.m(o,s),p(o,r,s),n=!0},p(o,[s]){o[0]?e?P(e,o[0])?(i.d(1),i=qe(o),e=o[0],i.c(),i.m(r.parentNode,r)):i.p(o,s):(i=qe(o),e=o[0],i.c(),i.m(r.parentNode,r)):e&&(i.d(1),i=null,e=o[0])},i(o){n||(u(i,o),n=!0)},o(o){d(i,o),n=!1},d(o){o&&g(r),i&&i.d(o)}}}function _n(t,e,r){let{$$slots:n={},$$scope:i}=e,{as:o="section"}=e;return t.$$set=s=>{"as"in s&&r(0,o=s.as),"$$scope"in s&&r(1,i=s.$$scope)},[o,i,n]}class fe extends N{constructor(e){super(),U(this,e,_n,pn,P,{as:0},gn)}}var q=(t=>(t[t.Silent=0]="Silent",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug",t[t.Verbose=5]="Verbose",t))(q||{});class W{static setLogLevel(e){this.logLevel=e}static log(e,r=this.logLevel){const n=`[Purchases] ${e}`;if(!(this.logLevel<r||r===q.Silent))switch(r){case q.Error:console.error(n);break;case q.Warn:console.warn(n);break;case q.Info:console.info(n);break;case q.Debug:console.debug(n);break;case q.Verbose:console.debug(n);break}}static errorLog(e){this.log(e,q.Error)}static warnLog(e){this.log(e,q.Warn)}static infoLog(e){this.log(e,q.Info)}static debugLog(e){this.log(e,q.Debug)}static verboseLog(e){this.log(e,q.Verbose)}}Q(W,"logLevel",q.Silent);var Ie=(t=>(t.Year="year",t.Month="month",t.Week="week",t.Day="day",t))(Ie||{});function An(t){const e=t.match(/^PT?([0-9]+)([MDYW])$/);if(!e||e.length<3)return W.errorLog(`Invalid ISO 8601 duration format: ${t}`),null;const r=parseInt(e[1]);switch(e[2]){case"Y":return{number:r,unit:"year"};case"M":return{number:r,unit:"month"};case"W":return{number:r,unit:"week"};case"D":return{number:r,unit:"day"};default:return W.errorLog(`Invalid ISO 8601 unit duration format: ${t}`),null}}const at=(t,e)=>{const r=t/100;return new Intl.NumberFormat("en-US",{style:"currency",currency:e}).format(r)},ut=t=>{const e=An(t);if(!e)return"unknown";const r=e.number;if(r===1)switch(e.unit){case Ie.Year:return"yearly";case Ie.Month:return"monthly";case Ie.Week:return"weekly";case Ie.Day:return"daily"}else return`every ${r} ${e.unit}s`};function hn(t){S(t,"svelte-i5dq8q",".rcb-pricing-info.svelte-i5dq8q{display:flex;flex-direction:column;margin-top:102px;font-weight:500}.rcb-product-price.svelte-i5dq8q{font-size:24px;margin:12px 0px}.rcb-product-details.svelte-i5dq8q{opacity:0.6;list-style-type:disc;list-style-position:inside;margin:0px;padding:0px}@media screen and (max-width: 960px){.rcb-pricing-info.svelte-i5dq8q{margin-top:48px}}")}function En(t){let e,r,n=t[0].displayName+"",i,o,s,l=t[0].currentPrice.currency+"",c,a=" ",f,m=at(t[0].currentPrice.amount,t[0].currentPrice.currency)+"",E,y,A,M,h,B=ut(t[0].normalPeriodDuration)+"",J,$,Be,Fe,ge;return{c(){e=k("div"),r=k("span"),i=R(n),o=T(),s=k("span"),c=R(l),f=R(a),E=R(m),y=T(),A=k("ul"),M=k("li"),h=R("Billed "),J=R(B),$=T(),Be=k("li"),Be.textContent="Continues until canceled",Fe=T(),ge=k("li"),ge.textContent="Cancel anytime",_(s,"class","rcb-product-price svelte-i5dq8q"),_(A,"class","rcb-product-details svelte-i5dq8q"),_(e,"class","rcb-pricing-info svelte-i5dq8q")},m(ee,X){p(ee,e,X),D(e,r),D(r,i),D(e,o),D(e,s),D(s,c),D(s,f),D(s,E),D(e,y),D(e,A),D(A,M),D(M,h),D(M,J),D(A,$),D(A,Be),D(A,Fe),D(A,ge)},p(ee,X){X&1&&n!==(n=ee[0].displayName+"")&&ie(i,n),X&1&&l!==(l=ee[0].currentPrice.currency+"")&&ie(c,l),X&1&&m!==(m=at(ee[0].currentPrice.amount,ee[0].currentPrice.currency)+"")&&ie(E,m),X&1&&B!==(B=ut(ee[0].normalPeriodDuration)+"")&&ie(J,B)},d(ee){ee&&g(e)}}}function In(t){let e,r;return e=new fe({props:{$$slots:{default:[En]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const o={};i&3&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function bn(t,e,r){let{productDetails:n}=e;return t.$$set=i=>{"productDetails"in i&&r(0,n=i.productDetails)},[n]}class ft extends N{constructor(e){super(),U(this,e,bn,In,P,{productDetails:0},hn)}}const wn="data:image/gif;base64,R0lGODlhMgAyAPcBAAAAAAD/AAMDAwcHBxERERUVFSoqKi0tLTAwMDg4OD09PURERElJSUtLS1BQUFJSUlVVVVdXV1paWl9fX2NjY2ZmZmlpaWxsbG1tbXNzc3t7e39/f4GBgYKCgoSEhIaGhoeHh4iIiIuLi5KSkpSUlJaWlp2dnaGhoaOjo6SkpKWlpaenp6ioqKqqqqurq6ysrLCwsLGxsbS0tLa2tri4uLm5ub29vb6+vsDAwMHBwcLCwsXFxcjIyMnJyc3Nzc7OztPT09TU1NXV1dfX19nZ2dra2tvb29zc3N7e3uDg4OHh4eLi4uPj4+fn5+np6ezs7O7u7vDw8PHx8fLy8vPz8/X19fb29vj4+Pn5+fz8/P39/f7+/v///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH/C05FVFNDQVBFMi4wAwEAAAAh+QQFBAABACwAAAAAMgAyAIcAAAAA/wADAwMHBwcREREVFRUqKiotLS0wMDA4ODg9PT1ERERJSUlLS0tQUFBSUlJVVVVXV1daWlpfX19jY2NmZmZpaWlsbGxtbW1zc3N7e3t/f3+BgYGCgoKEhISGhoaHh4eIiIiLi4uSkpKUlJSWlpadnZ2hoaGjo6OkpKSlpaWnp6eoqKiqqqqrq6usrKywsLCxsbG0tLS2tra4uLi5ubm9vb2+vr7AwMDBwcHCwsLFxcXIyMjJycnNzc3Ozs7T09PU1NTV1dXX19fZ2dna2trb29vc3Nze3t7g4ODh4eHi4uLj4+Pn5+fp6ens7Ozu7u7w8PDx8fHy8vLz8/P19fX29vb4+Pj5+fn8/Pz9/f3+/v7///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8I/wCzcBFIcKDBgggPKkzIcCEXLlq4bIEokeLEiBcrYrTIcaNHjRobinQ4sqRCkBlTdtR44MBKlR9TmjQJQMBMkgZfdpwSMSYAACgpRtHpcSYSFUIa1mz448UQnAWDfmzSooUVmD9XVnnBwglMlDdvvMjhcOlCHit23CSqcUrVJiizpnTC4sXQmB1vZvmxwgYWhWYLznjRA+rJryqvxGhxxGNLjkVcwMCCN6ZeLkNevDCcRYYKJJfZptyCQwdiijl0CDxdlLPryw2lymY9WzTs17ijVq69mzbM28Bd8x7u23bu46F7i16uXEvw5ziJM5duGbl1k9OLN5cKvfvh7OC3b0jxTv6h+PDUy3unzl67RPXXc56fnz4+/PbofcOHnr9/5f3x4UeffvYVqJuACP5m4IIJ+gfWgusN6KCCAN7WoITVVXjchBxqERAAIfkEBQQAAQAsDQADACAAEAAACKcAAwgcSDDAAwcFEypcSNDAAYYQA2DZstCAAYZOKCqM8uNJxYcKa3DYsVBKECBYFFpU+MTDhiIMkQxBohJkwRYaUkDEEiQIlYQrCyLZ0MFJRCdAkgC1OZBEBxgRJRIBAqXgwYI8NoCwEjWAkyFDoorQ4KOrQCRLoqbQuZCKR7NdqzD5MaQKXIhZmAwBIqTJ3YVYogQZ8oMJ178Kk/A1YhfxQiRHjBYMCAAh+QQFBQABACwNAAMAIAAQAAAInQADCBx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){let e,r;return{c(){e=k("img"),te(e.src,r=wn)||_(e,"src",r),_(e,"alt","spinner")},m(n,i){p(n,e,i)},p:v,i:v,o:v,d(n){n&&g(e)}}}class $n extends N{constructor(e){super(),U(this,e,null,kn,P,{})}}function vn(t){S(t,"svelte-1mxx341",".rcb-modal-loader.svelte-1mxx341{width:100%;flex-grow:1;min-height:100%;display:flex;justify-content:center;align-items:center}")}function yn(t){let e,r,n;return r=new $n({}),{c(){e=k("div"),w(r.$$.fragment),_(e,"class","rcb-modal-loader svelte-1mxx341")},m(i,o){p(i,e,o),I(r,e,null),n=!0},p:v,i(i){n||(u(r.$$.fragment,i),n=!0)},o(i){d(r.$$.fragment,i),n=!1},d(i){i&&g(e),b(r)}}}class je extends N{constructor(e){super(),U(this,e,null,yn,P,{},vn)}}var be=(t=>(t.Started="started",t.InProgress="in_progress",t.Succeeded="succeeded",t.Failed="failed",t))(be||{}),Te=(t=>(t[t.SetupIntentCreationFailed=1]="SetupIntentCreationFailed",t[t.PaymentMethodCreationFailed=2]="PaymentMethodCreationFailed",t[t.PaymentChargeFailed=3]="PaymentChargeFailed",t))(Te||{}),O=(t=>(t[t.ErrorSettingUpPurchase=0]="ErrorSettingUpPurchase",t[t.ErrorChargingPayment=1]="ErrorChargingPayment",t[t.UnknownError=2]="UnknownError",t[t.NetworkError=3]="NetworkError",t[t.StripeError=4]="StripeError",t[t.MissingEmailError=5]="MissingEmailError",t))(O||{});class j extends Error{constructor(e,r,n){super(r),this.errorCode=e,this.underlyingErrorMessage=n}}class Bn{constructor(e,r=10){Q(this,"operationSessionId",null);Q(this,"backend");Q(this,"maxNumberAttempts");Q(this,"waitMSBetweenAttempts",1e3);this.backend=e,this.maxNumberAttempts=r}async startPurchase(e,r,n,i){const o=await this.backend.postSubscribe(e,r,n,i);return this.operationSessionId=o.operation_session_id,o}async pollCurrentPurchaseForCompletion(){const e=this.operationSessionId;if(!e)throw new j(0,"No purchase in progress");return new Promise((r,n)=>{const i=(o=1)=>{if(o>this.maxNumberAttempts){this.clearPurchaseInProgress(),n(new j(2,"Max attempts reached trying to get successful purchase status"));return}this.backend.getCheckoutStatus(e).then(s=>{switch(s.operation.status){case be.Started:case be.InProgress:setTimeout(()=>i(o+1),this.waitMSBetweenAttempts);break;case be.Succeeded:this.clearPurchaseInProgress(),r();return;case be.Failed:this.clearPurchaseInProgress(),this.handlePaymentError(s.operation.error,n)}}).catch(s=>{n(new j(3,s.message))})};i()})}clearPurchaseInProgress(){this.operationSessionId=null}handlePaymentError(e,r){if(e==null){r(new j(2,"Got an error status but error field is empty."));return}switch(e.code){case Te.SetupIntentCreationFailed:r(new j(0,"Setup intent creation failed"));return;case Te.PaymentMethodCreationFailed:r(new j(0,"Payment method creation failed"));return;case Te.PaymentChargeFailed:r(new j(1,"Payment charge failed"));return}}}const Dn="data:image/svg+xml,%3csvg%20width='124'%20height='124'%20viewBox='0%200%20124%20124'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='62'%20cy='62'%20r='62'%20fill='%23767676'/%3e%3cpath%20d='M87.6668%2041.504L82.4968%2036.334L62.0002%2056.8307L41.5035%2036.334L36.3335%2041.504L56.8302%2062.0006L36.3335%2082.4973L41.5035%2087.6673L62.0002%2067.1706L82.4968%2087.6673L87.6668%2082.4973L67.1702%2062.0006L87.6668%2041.504Z'%20fill='white'/%3e%3c/svg%3e";function Cn(t){S(t,"svelte-1609h93","img.svelte-1609h93{width:124px;height:124px;margin:0 auto}")}function Mn(t){let e,r;return{c(){e=k("img"),te(e.src,r=Dn)||_(e,"src",r),_(e,"alt","icon"),_(e,"class","rcb-ui-asset-icon svelte-1609h93")},m(n,i){p(n,e,i)},p:v,i:v,o:v,d(n){n&&g(e)}}}class Qn extends N{constructor(e){super(),U(this,e,null,Mn,P,{},Cn)}}function Pn(t){S(t,"svelte-1rmxk7q","button.svelte-1rmxk7q{border:none;border-radius:56px;font-size:16px;cursor:pointer;height:56px;color:var(--rc-color-grey-text-dark);background-color:var(--rc-color-grey-ui-dark);display:flex;align-items:center;justify-content:center}button.intent-primary.svelte-1rmxk7q{background-color:var(--rc-color-grey-text-dark);color:var(--rc-color-white);font-size:16px}button.svelte-1rmxk7q:disabled{color:var(--rc-color-grey-text-light)}button.intent-primary.svelte-1rmxk7q:disabled{color:var(--rc-color-grey-text-light)}")}function Tn(t){let e,r,n,i,o;const s=t[3].default,l=G(s,t,t[2],null);return{c(){e=k("button"),l&&l.c(),_(e,"class",r=_e(`intent-${t[0]}`)+" svelte-1rmxk7q"),e.disabled=t[1]},m(c,a){p(c,e,a),l&&l.m(e,null),n=!0,i||(o=Ae(e,"click",t[4]),i=!0)},p(c,[a]){l&&l.p&&(!n||a&4)&&H(l,s,c,c[2],n?Y(s,c[2],a,null):K(c[2]),null),(!n||a&1&&r!==(r=_e(`intent-${c[0]}`)+" svelte-1rmxk7q"))&&_(e,"class",r),(!n||a&2)&&(e.disabled=c[1])},i(c){n||(u(l,c),n=!0)},o(c){d(l,c),n=!1},d(c){c&&g(e),l&&l.d(c),i=!1,o()}}}function Un(t,e,r){let{$$slots:n={},$$scope:i}=e,{intent:o="primary"}=e,{disabled:s=!1}=e;function l(c){lt.call(this,t,c)}return t.$$set=c=>{"intent"in c&&r(0,o=c.intent),"disabled"in c&&r(1,s=c.disabled),"$$scope"in c&&r(2,i=c.$$scope)},[o,s,i,n,l]}class we extends N{constructor(e){super(),U(this,e,Un,Tn,P,{intent:0,disabled:1},Pn)}}function Nn(t){S(t,"svelte-1f9z0o8","footer.svelte-1f9z0o8{display:flex;flex-direction:column}")}function Rn(t){let e,r;const n=t[1].default,i=G(n,t,t[0],null);return{c(){e=k("footer"),i&&i.c(),_(e,"class","rcb-modal-footer svelte-1f9z0o8")},m(o,s){p(o,e,s),i&&i.m(e,null),r=!0},p(o,[s]){i&&i.p&&(!r||s&1)&&H(i,n,o,o[0],r?Y(n,o[0],s,null):K(o[0]),null)},i(o){r||(u(i,o),r=!0)},o(o){d(i,o),r=!1},d(o){o&&g(e),i&&i.d(o)}}}function Sn(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(0,i=o.$$scope)},[i,n]}class Je extends N{constructor(e){super(),U(this,e,Sn,Rn,P,{},Nn)}}function On(t){S(t,"svelte-6o8e90",'.column.svelte-6o8e90{display:flex;flex-direction:column;justify-content:flex-start;gap:var(--gap, "8px");flex-grow:1}')}function Ln(t){let e,r,n;const i=t[2].default,o=G(i,t,t[1],null);return{c(){e=k("div"),o&&o.c(),_(e,"class","column svelte-6o8e90"),_(e,"style",r=`--gap:${t[0]};`)},m(s,l){p(s,e,l),o&&o.m(e,null),n=!0},p(s,[l]){o&&o.p&&(!n||l&2)&&H(o,i,s,s[1],n?Y(i,s[1],l,null):K(s[1]),null),(!n||l&1&&r!==(r=`--gap:${s[0]};`))&&_(e,"style",r)},i(s){n||(u(o,s),n=!0)},o(s){d(o,s),n=!1},d(s){s&&g(e),o&&o.d(s)}}}function xn(t,e,r){let{$$slots:n={},$$scope:i}=e,{gutter:o="8px"}=e;return t.$$set=s=>{"gutter"in s&&r(0,o=s.gutter),"$$scope"in s&&r(1,i=s.$$scope)},[o,i,n]}class ke extends N{constructor(e){super(),U(this,e,xn,Ln,P,{gutter:0},On)}}const Fn="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='mdi_close'%3e%3cpath%20id='Vector'%20d='M19%206.41L17.59%205L12%2010.59L6.41%205L5%206.41L10.59%2012L5%2017.59L6.41%2019L12%2013.41L17.59%2019L19%2017.59L13.41%2012L19%206.41Z'%20fill='%23767676'/%3e%3c/g%3e%3c/svg%3e";function Gn(t){S(t,"svelte-14xreta",".close-button.svelte-14xreta{border:none;cursor:pointer;background-color:transparent;padding:0px}")}function Yn(t){let e,r,n,i,o;return{c(){e=k("button"),r=k("img"),te(r.src,n=Fn)||_(r,"src",n),_(r,"alt","close"),_(e,"class","close-button svelte-14xreta"),e.disabled=t[0]},m(s,l){p(s,e,l),D(e,r),i||(o=Ae(e,"click",t[1]),i=!0)},p(s,[l]){l&1&&(e.disabled=s[0])},i:v,o:v,d(s){s&&g(e),i=!1,o()}}}function Hn(t,e,r){let{disabled:n=!1}=e;function i(o){lt.call(this,t,o)}return t.$$set=o=>{"disabled"in o&&r(0,n=o.disabled)},[n,i]}class Kn extends N{constructor(e){super(),U(this,e,Hn,Yn,P,{disabled:0},Gn)}}function qn(t){S(t,"svelte-44qpq9",".rcb-app-icon.svelte-44qpq9{width:40px;height:40px;border-radius:12px;box-shadow:0px 1px 10px 0px rgba(0, 0, 0, 0.1);margin-right:16px}.rcb-app-icon-picture-container.svelte-44qpq9{height:40px}.rcb-app-icon.loading.svelte-44qpq9{background-color:gray}")}function jn(t){let e;return{c(){e=k("div"),_(e,"class","rcb-app-icon loading svelte-44qpq9")},m(r,n){p(r,e,n)},p:v,d(r){r&&g(e)}}}function Jn(t){let e,r,n,i,o,s;return{c(){e=k("picture"),r=k("source"),i=T(),o=k("img"),_(r,"type","image/webp"),Kt(r,n=t[1])||_(r,"srcset",n),_(o,"class","rcb-app-icon svelte-44qpq9"),te(o.src,s=t[0])||_(o,"src",s),_(o,"alt","App icon"),_(e,"class","rcb-app-icon-picture-container svelte-44qpq9")},m(l,c){p(l,e,c),D(e,r),D(e,i),D(e,o)},p(l,c){c&2&&n!==(n=l[1])&&_(r,"srcset",n),c&1&&!te(o.src,s=l[0])&&_(o,"src",s)},d(l){l&&g(e)}}}function Vn(t){let e;function r(o,s){return o[0]!==null?Jn:jn}let n=r(t),i=n(t);return{c(){i.c(),e=ne()},m(o,s){i.m(o,s),p(o,e,s)},p(o,[s]){n===(n=r(o))&&i?i.p(o,s):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},i:v,o:v,d(o){o&&g(e),i.d(o)}}}function Wn(t,e,r){let{src:n=null}=e,{srcWebp:i=null}=e;return t.$$set=o=>{"src"in o&&r(0,n=o.src),"srcWebp"in o&&r(1,i=o.srcWebp)},[n,i]}class dt extends N{constructor(e){super(),U(this,e,Wn,Vn,P,{src:0,srcWebp:1},qn)}}const Ue=t=>`https://da08ctfrofx1b.cloudfront.net/${t}`;function zn(t){S(t,"svelte-10uf5fq",".app-title.svelte-10uf5fq{font-weight:500;margin:8px 0;font-size:16px}.rcb-header-layout__business-info.svelte-10uf5fq{display:flex;align-items:center}")}function Xn(t){let e,r;return e=new dt({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p:v,i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Zn(t){let e,r,n=t[0].seller_company_name+"",i,o,s=t[0].app_icon_webp!==null&&t[0].app_icon!==null&&mt(t);return{c(){s&&s.c(),e=T(),r=k("span"),i=R(n),_(r,"class","app-title svelte-10uf5fq")},m(l,c){s&&s.m(l,c),p(l,e,c),p(l,r,c),D(r,i),o=!0},p(l,c){l[0].app_icon_webp!==null&&l[0].app_icon!==null?s?(s.p(l,c),c&1&&u(s,1)):(s=mt(l),s.c(),u(s,1),s.m(e.parentNode,e)):s&&(x(),d(s,1,1,()=>{s=null}),F()),(!o||c&1)&&n!==(n=l[0].seller_company_name+"")&&ie(i,n)},i(l){o||(u(s),o=!0)},o(l){d(s),o=!1},d(l){l&&(g(e),g(r)),s&&s.d(l)}}}function mt(t){let e,r;return e=new dt({props:{src:Ue(t[0].app_icon),srcWebp:Ue(t[0].app_icon_webp)}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&1&&(o.src=Ue(n[0].app_icon)),i&1&&(o.srcWebp=Ue(n[0].app_icon_webp)),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function er(t){let e,r,n,i;const o=[Zn,Xn],s=[];function l(c,a){return c[0]!==null?0:1}return r=l(t),n=s[r]=o[r](t),{c(){e=k("div"),n.c(),_(e,"class","rcb-header-layout__business-info svelte-10uf5fq")},m(c,a){p(c,e,a),s[r].m(e,null),i=!0},p(c,[a]){let f=r;r=l(c),r===f?s[r].p(c,a):(x(),d(s[f],1,1,()=>{s[f]=null}),F(),n=s[r],n?n.p(c,a):(n=s[r]=o[r](c),n.c()),u(n,1),n.m(e,null))},i(c){i||(u(n),i=!0)},o(c){d(n),i=!1},d(c){c&&g(e),s[r].d()}}}function tr(t,e,r){let{brandingInfo:n=null}=e;return t.$$set=i=>{"brandingInfo"in i&&r(0,n=i.brandingInfo)},[n]}class gt extends N{constructor(e){super(),U(this,e,tr,er,P,{brandingInfo:0},zn)}}function nr(t){S(t,"svelte-17puakv",".rcb-post-purchase-header-layout.svelte-17puakv{display:flex;justify-content:space-between;align-items:center;width:100%;margin-top:-4px}")}function rr(t){let e,r,n,i,o;return r=new gt({props:{brandingInfo:t[0]}}),i=new Kn({}),i.$on("click",function(){le(t[1])&&t[1].apply(this,arguments)}),{c(){e=k("div"),w(r.$$.fragment),n=T(),w(i.$$.fragment),_(e,"class","rcb-post-purchase-header-layout svelte-17puakv")},m(s,l){p(s,e,l),I(r,e,null),D(e,n),I(i,e,null),o=!0},p(s,l){t=s;const c={};l&1&&(c.brandingInfo=t[0]),r.$set(c)},i(s){o||(u(r.$$.fragment,s),u(i.$$.fragment,s),o=!0)},o(s){d(r.$$.fragment,s),d(i.$$.fragment,s),o=!1},d(s){s&&g(e),b(r),b(i)}}}function ir(t){let e,r;return e=new fe({props:{as:"header",$$slots:{default:[rr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const o={};i&7&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function or(t,e,r){let{brandingInfo:n=null}=e,{onClose:i}=e;return t.$$set=o=>{"brandingInfo"in o&&r(0,n=o.brandingInfo),"onClose"in o&&r(1,i=o.onClose)},[n,i]}class sr extends N{constructor(e){super(),U(this,e,or,ir,P,{brandingInfo:0,onClose:1},nr)}}function lr(t){S(t,"svelte-10pcqja",".rcb-modal-message.svelte-10pcqja{width:100%;min-height:160px;display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center}.title.svelte-10pcqja{font-size:24px;line-height:1.25em}.subtitle.svelte-10pcqja{font-size:16px;line-height:1.25em;overflow-wrap:anywhere}")}const cr=t=>({}),pt=t=>({});function ar(t){let e,r,n,i,o;const s=t[4].default,l=G(s,t,t[5],null);return{c(){e=k("span"),r=R(t[2]),n=T(),i=k("span"),l&&l.c(),_(e,"class","title svelte-10pcqja"),_(i,"class","subtitle svelte-10pcqja")},m(c,a){p(c,e,a),D(e,r),p(c,n,a),p(c,i,a),l&&l.m(i,null),o=!0},p(c,a){(!o||a&4)&&ie(r,c[2]),l&&l.p&&(!o||a&32)&&H(l,s,c,c[5],o?Y(s,c[5],a,null):K(c[5]),null)},i(c){o||(u(l,c),o=!0)},o(c){d(l,c),o=!1},d(c){c&&(g(e),g(n),g(i)),l&&l.d(c)}}}function ur(t){let e,r,n;const i=t[4].icon,o=G(i,t,t[5],pt);return r=new ke({props:{gutter:"16px",$$slots:{default:[ar]},$$scope:{ctx:t}}}),{c(){o&&o.c(),e=T(),w(r.$$.fragment)},m(s,l){o&&o.m(s,l),p(s,e,l),I(r,s,l),n=!0},p(s,l){o&&o.p&&(!n||l&32)&&H(o,i,s,s[5],n?Y(i,s[5],l,cr):K(s[5]),pt);const c={};l&36&&(c.$$scope={dirty:l,ctx:s}),r.$set(c)},i(s){n||(u(o,s),u(r.$$.fragment,s),n=!0)},o(s){d(o,s),d(r.$$.fragment,s),n=!1},d(s){s&&g(e),o&&o.d(s),b(r,s)}}}function fr(t){let e,r,n;return r=new ke({props:{gutter:"16px",$$slots:{default:[ur]},$$scope:{ctx:t}}}),{c(){e=k("div"),w(r.$$.fragment),_(e,"class","rcb-modal-message svelte-10pcqja"),_(e,"data-type",t[3])},m(i,o){p(i,e,o),I(r,e,null),n=!0},p(i,o){const s={};o&36&&(s.$$scope={dirty:o,ctx:i}),r.$set(s),(!n||o&8)&&_(e,"data-type",i[3])},i(i){n||(u(r.$$.fragment,i),n=!0)},o(i){d(r.$$.fragment,i),n=!1},d(i){i&&g(e),b(r)}}}function dr(t){let e;return{c(){e=R("Go back to app")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function mr(t){let e,r;return e=new we({props:{$$slots:{default:[dr]},$$scope:{ctx:t}}}),e.$on("click",function(){le(t[1])&&t[1].apply(this,arguments)}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){t=n;const o={};i&32&&(o.$$scope={dirty:i,ctx:t}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function gr(t){let e,r,n,i,o,s;return e=new sr({props:{brandingInfo:t[0],onClose:t[1]}}),n=new fe({props:{$$slots:{default:[fr]},$$scope:{ctx:t}}}),o=new Je({props:{$$slots:{default:[mr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment),r=T(),w(n.$$.fragment),i=T(),w(o.$$.fragment)},m(l,c){I(e,l,c),p(l,r,c),I(n,l,c),p(l,i,c),I(o,l,c),s=!0},p(l,c){const a={};c&1&&(a.brandingInfo=l[0]),c&2&&(a.onClose=l[1]),e.$set(a);const f={};c&44&&(f.$$scope={dirty:c,ctx:l}),n.$set(f);const m={};c&34&&(m.$$scope={dirty:c,ctx:l}),o.$set(m)},i(l){s||(u(e.$$.fragment,l),u(n.$$.fragment,l),u(o.$$.fragment,l),s=!0)},o(l){d(e.$$.fragment,l),d(n.$$.fragment,l),d(o.$$.fragment,l),s=!1},d(l){l&&(g(r),g(i)),b(e,l),b(n,l),b(o,l)}}}function pr(t){let e,r;return e=new ke({props:{gutter:"32px",$$slots:{default:[gr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const o={};i&47&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function _r(t,e,r){let{$$slots:n={},$$scope:i}=e,{brandingInfo:o=null}=e,{onContinue:s}=e,{title:l}=e,{type:c}=e;return t.$$set=a=>{"brandingInfo"in a&&r(0,o=a.brandingInfo),"onContinue"in a&&r(1,s=a.onContinue),"title"in a&&r(2,l=a.title),"type"in a&&r(3,c=a.type),"$$scope"in a&&r(5,i=a.$$scope)},[o,s,l,c,n,i]}class _t extends N{constructor(e){super(),U(this,e,_r,pr,P,{brandingInfo:0,onContinue:1,title:2,type:3},lr)}}function At(t){let e,r,n,i,o;return{c(){e=R("If this error persists, please contact "),r=k("a"),n=R(t[1]),o=R("."),_(r,"href",i="mailto:"+t[1])},m(s,l){p(s,e,l),p(s,r,l),D(r,n),p(s,o,l)},p(s,l){l&2&&ie(n,s[1]),l&2&&i!==(i="mailto:"+s[1])&&_(r,"href",i)},d(s){s&&(g(e),g(r),g(o))}}}function Ar(t){let e=t[3]()+"",r,n,i,o=t[1]&&At(t);return{c(){r=R(e),n=T(),o&&o.c(),i=ne()},m(s,l){p(s,r,l),p(s,n,l),o&&o.m(s,l),p(s,i,l)},p(s,l){s[1]?o?o.p(s,l):(o=At(s),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null)},d(s){s&&(g(r),g(n),g(i)),o&&o.d(s)}}}function hr(t){let e,r;return e=new Qn({props:{slot:"icon"}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p:v,i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Er(t){let e,r;return e=new _t({props:{title:"Something went wrong",brandingInfo:t[0],onContinue:t[2],type:"error",$$slots:{icon:[hr],default:[Ar]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const o={};i&1&&(o.brandingInfo=n[0]),i&4&&(o.onContinue=n[2]),i&34&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Ir(t,e,r){let{brandingInfo:n=null}=e,{lastError:i}=e,{supportEmail:o=null}=e,{onContinue:s}=e;Me(()=>{W.errorLog(`Displayed error: ${O[i.errorCode]}. Message: ${i.message??"None"}. Underlying error: ${i.underlyingErrorMessage??"None"}`)});function l(){switch(i.errorCode){case O.UnknownError:return"An unknown error occurred.";case O.ErrorSettingUpPurchase:return"Purchase not started due to an error.";case O.ErrorChargingPayment:return"Payment failed.";case O.NetworkError:return"Network error. Please check your internet connection.";case O.StripeError:return i.message;case O.MissingEmailError:return"Email is required to complete the purchase."}return i.message}return t.$$set=c=>{"brandingInfo"in c&&r(0,n=c.brandingInfo),"lastError"in c&&r(4,i=c.lastError),"supportEmail"in c&&r(1,o=c.supportEmail),"onContinue"in c&&r(2,s=c.onContinue)},[n,o,s,l,i]}class br extends N{constructor(e){super(),U(this,e,Ir,Er,P,{brandingInfo:0,lastError:4,supportEmail:1,onContinue:2})}}const wr="data:image/svg+xml,%3csvg%20width='124'%20height='124'%20viewBox='0%200%20124%20124'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='62'%20cy='62'%20r='62'%20fill='%23576CDB'/%3e%3crect%20x='44.1116'%20y='56'%20width='27.5'%20height='11'%20transform='rotate(45%2044.1116%2056)'%20fill='white'/%3e%3crect%20x='79.1133'%20y='44.334'%20width='11'%20height='44'%20transform='rotate(45%2079.1133%2044.334)'%20fill='white'/%3e%3c/svg%3e";function kr(t){S(t,"svelte-1609h93","img.svelte-1609h93{width:124px;height:124px;margin:0 auto}")}function $r(t){let e,r;return{c(){e=k("img"),te(e.src,r=wr)||_(e,"src",r),_(e,"alt","icon"),_(e,"class","rcb-ui-asset-icon svelte-1609h93")},m(n,i){p(n,e,i)},p:v,i:v,o:v,d(n){n&&g(e)}}}class vr extends N{constructor(e){super(),U(this,e,null,$r,P,{},kr)}}function yr(t){let e;return{c(){e=R("Your plan is now active.")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function Br(t){let e,r;return e=new vr({props:{slot:"icon"}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p:v,i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Dr(t){let e,r;return e=new _t({props:{type:"success",title:"Purchase successful",brandingInfo:t[0],onContinue:t[1],$$slots:{icon:[Br],default:[yr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const o={};i&1&&(o.brandingInfo=n[0]),i&2&&(o.onContinue=n[1]),i&4&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Cr(t,e,r){let{brandingInfo:n=null}=e,{onContinue:i}=e;return t.$$set=o=>{"brandingInfo"in o&&r(0,n=o.brandingInfo),"onContinue"in o&&r(1,i=o.onContinue)},[n,i]}class Mr extends N{constructor(e){super(),U(this,e,Cr,Dr,P,{brandingInfo:0,onContinue:1})}}function Qr(t,e,r,n,i={}){const o=r.create(e,i);return o.mount(t),o.on("change",s=>n("change",s)),o.on("ready",s=>n("ready",s)),o.on("focus",s=>n("focus",s)),o.on("blur",s=>n("blur",s)),o.on("escape",s=>n("escape",s)),o.on("click",s=>n("click",s)),o.on("loaderror",s=>n("loaderror",s)),o.on("loaderstart",s=>n("loaderstart",s)),o.on("networkschange",s=>n("networkschange",s)),o}const Pr=typeof window>"u";function Tr(t){if(!Pr)return t.registerAppInfo({name:"svelte-stripe-js",url:"https://svelte-stripe-js.vercel.app"})}function Ur(t){let e;return{c(){e=k("div")},m(r,n){p(r,e,n),t[6](e)},p:v,i:v,o:v,d(r){r&&g(e),t[6](null)}}}function Nr(t,e,r){let n,i;const o=nn(),{elements:s}=on("stripe");let{options:l=void 0}=e;Me(()=>(n=Qr(i,"payment",s,o,l),()=>n.destroy()));function c(){n.blur()}function a(){n.clear()}function f(){n.destroy()}function m(){n.focus()}function E(y){Qe[y?"unshift":"push"](()=>{i=y,r(0,i)})}return t.$$set=y=>{"options"in y&&r(1,l=y.options)},[i,l,c,a,f,m,E]}class Rr extends N{constructor(e){super(),U(this,e,Nr,Ur,P,{options:1,blur:2,clear:3,destroy:4,focus:5})}get blur(){return this.$$.ctx[2]}get clear(){return this.$$.ctx[3]}get destroy(){return this.$$.ctx[4]}get focus(){return this.$$.ctx[5]}}function ht(t){let e;const r=t[15].default,n=G(r,t,t[14],null);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&16384)&&H(n,r,i,i[14],e?Y(r,i[14],o,null):K(i[14]),null)},i(i){e||(u(n,i),e=!0)},o(i){d(n,i),e=!1},d(i){n&&n.d(i)}}}function Sr(t){let e,r,n=t[1]&&t[0]&&ht(t);return{c(){n&&n.c(),e=ne()},m(i,o){n&&n.m(i,o),p(i,e,o),r=!0},p(i,[o]){i[1]&&i[0]?n?(n.p(i,o),o&3&&u(n,1)):(n=ht(i),n.c(),u(n,1),n.m(e.parentNode,e)):n&&(x(),d(n,1,1,()=>{n=null}),F())},i(i){r||(u(n),r=!0)},o(i){d(n),r=!1},d(i){i&&g(e),n&&n.d(i)}}}function Or(t,e,r){let n,{$$slots:i={},$$scope:o}=e,{stripe:s}=e,{mode:l=void 0}=e,{theme:c="stripe"}=e,{variables:a={}}=e,{rules:f={}}=e,{labels:m="above"}=e,{loader:E="auto"}=e,{fonts:y=[]}=e,{locale:A="auto"}=e,{currency:M=void 0}=e,{amount:h=void 0}=e,{clientSecret:B=void 0}=e,{elements:J=null}=e;return t.$$set=$=>{"stripe"in $&&r(1,s=$.stripe),"mode"in $&&r(2,l=$.mode),"theme"in $&&r(3,c=$.theme),"variables"in $&&r(4,a=$.variables),"rules"in $&&r(5,f=$.rules),"labels"in $&&r(6,m=$.labels),"loader"in $&&r(7,E=$.loader),"fonts"in $&&r(8,y=$.fonts),"locale"in $&&r(9,A=$.locale),"currency"in $&&r(10,M=$.currency),"amount"in $&&r(11,h=$.amount),"clientSecret"in $&&r(12,B=$.clientSecret),"elements"in $&&r(0,J=$.elements),"$$scope"in $&&r(14,o=$.$$scope)},t.$$.update=()=>{t.$$.dirty&120&&r(13,n={theme:c,variables:a,rules:f,labels:m}),t.$$.dirty&16263&&s&&!J&&(r(0,J=s.elements({mode:l,currency:M,amount:h,appearance:n,clientSecret:B,fonts:y,loader:E,locale:A})),Tr(s),rn("stripe",{stripe:s,elements:J})),t.$$.dirty&8705&&J&&J.update({appearance:n,locale:A})},[J,s,l,c,a,f,m,E,y,A,M,h,B,n,o,i]}class Lr extends N{constructor(e){super(),U(this,e,Or,Sr,P,{stripe:1,mode:2,theme:3,variables:4,rules:5,labels:6,loader:7,fonts:8,locale:9,currency:10,amount:11,clientSecret:12,elements:0})}}var Et="https://js.stripe.com/v3",xr=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,It="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",Fr=function(){for(var e=document.querySelectorAll('script[src^="'.concat(Et,'"]')),r=0;r<e.length;r++){var n=e[r];if(xr.test(n.src))return n}return null},bt=function(e){var r=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(Et).concat(r);var i=document.head||document.body;if(!i)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return i.appendChild(n),n},Gr=function(e,r){!e||!e._registerWrapper||e._registerWrapper({name:"stripe-js",version:"2.3.0",startTime:r})},$e=null,Ne=null,Re=null,Yr=function(e){return function(){e(new Error("Failed to load Stripe.js"))}},Hr=function(e,r){return function(){window.Stripe?e(window.Stripe):r(new Error("Stripe.js not available"))}},Kr=function(e){return $e!==null?$e:($e=new Promise(function(r,n){if(typeof window>"u"||typeof document>"u"){r(null);return}if(window.Stripe&&e&&console.warn(It),window.Stripe){r(window.Stripe);return}try{var i=Fr();if(i&&e)console.warn(It);else if(!i)i=bt(e);else if(i&&Re!==null&&Ne!==null){var o;i.removeEventListener("load",Re),i.removeEventListener("error",Ne),(o=i.parentNode)===null||o===void 0||o.removeChild(i),i=bt(e)}Re=Hr(r,n),Ne=Yr(n),i.addEventListener("load",Re),i.addEventListener("error",Ne)}catch(s){n(s);return}}),$e.catch(function(r){return $e=null,Promise.reject(r)}))},qr=function(e,r,n){if(e===null)return null;var i=e.apply(void 0,r);return Gr(i,n),i},ve,wt=!1,kt=function(){return ve||(ve=Kr(null).catch(function(e){return ve=null,Promise.reject(e)}),ve)};Promise.resolve().then(function(){return kt()}).catch(function(t){wt||console.warn(t)});var jr=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];wt=!0;var i=Date.now();return kt().then(function(o){return qr(o,r,i)})};function Jr(t){S(t,"svelte-1xe711j",".rcb-header-layout.svelte-1xe711j{display:flex;justify-content:space-between;align-items:center;width:100%;font-size:24px;margin:0;font-weight:500}")}function Vr(t){let e,r;const n=t[0].default,i=G(n,t,t[1],null);return{c(){e=k("div"),i&&i.c(),_(e,"class","rcb-header-layout svelte-1xe711j")},m(o,s){p(o,e,s),i&&i.m(e,null),r=!0},p(o,s){i&&i.p&&(!r||s&2)&&H(i,n,o,o[1],r?Y(n,o[1],s,null):K(o[1]),null)},i(o){r||(u(i,o),r=!0)},o(o){d(i,o),r=!1},d(o){o&&g(e),i&&i.d(o)}}}function Wr(t){let e,r;return e=new fe({props:{as:"header",$$slots:{default:[Vr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const o={};i&2&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function zr(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(1,i=o.$$scope)},[n,i]}class Ve extends N{constructor(e){super(),U(this,e,zr,Wr,P,{},Jr)}}const Xr="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M18%208H17V6C17%203.24%2014.76%201%2012%201C9.24%201%207%203.24%207%206V8H6C4.9%208%204%208.9%204%2010V20C4%2021.1%204.9%2022%206%2022H18C19.1%2022%2020%2021.1%2020%2020V10C20%208.9%2019.1%208%2018%208ZM12%2017C10.9%2017%2010%2016.1%2010%2015C10%2013.9%2010.9%2013%2012%2013C13.1%2013%2014%2013.9%2014%2015C14%2016.1%2013.1%2017%2012%2017ZM15.1%208H8.9V6C8.9%204.29%2010.29%202.9%2012%202.9C13.71%202.9%2015.1%204.29%2015.1%206V8Z'%20fill='%2311D483'/%3e%3c/svg%3e";function Zr(t){let e,r;return{c(){e=k("img"),te(e.src,r=Xr)||_(e,"src",r),_(e,"alt","icon"),_(e,"class","rcb-ui-asset-icon")},m(n,i){p(n,e,i)},p:v,i:v,o:v,d(n){n&&g(e)}}}class ei extends N{constructor(e){super(),U(this,e,null,Zr,P,{})}}const ye={error:"#f2545b",warning:"#f4e971",focus:"#000080","grey-text-dark":"#000000","grey-text-light":"#767676","grey-ui-dark":"#dfdfdf",white:"#ffffff"};function ti(t){S(t,"svelte-rjmul6",`.processing.svelte-rjmul6{width:12px;aspect-ratio:1;border-radius:50%;animation:svelte-rjmul6-l5 1.5s infinite linear}@keyframes svelte-rjmul6-l5{0%{box-shadow:20px 0 #fff2,
|
|
1
|
+
(function(x,V){typeof exports=="object"&&typeof module<"u"?V(exports):typeof define=="function"&&define.amd?define(["exports"],V):(x=typeof globalThis<"u"?globalThis:x||self,V(x.Purchases={}))})(this,function(x){"use strict";var Oo=Object.defineProperty;var Lo=(x,V,L)=>V in x?Oo(x,V,{enumerable:!0,configurable:!0,writable:!0,value:L}):x[V]=L;var P=(x,V,L)=>(Lo(x,typeof V!="symbol"?V+"":V,L),L);function V(t){return t!=null}var L=(t=>(t[t.Silent=0]="Silent",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug",t[t.Verbose=5]="Verbose",t))(L||{});class W{static setLogLevel(e){this.logLevel=e}static log(e,r=this.logLevel){const n=`[Purchases] ${e}`;if(!(this.logLevel<r||r===L.Silent))switch(r){case L.Error:console.error(n);break;case L.Warn:console.warn(n);break;case L.Info:console.info(n);break;case L.Debug:console.debug(n);break;case L.Verbose:console.debug(n);break}}static errorLog(e){this.log(e,L.Error)}static warnLog(e){this.log(e,L.Warn)}static infoLog(e){this.log(e,L.Info)}static debugLog(e){this.log(e,L.Debug)}static verboseLog(e){this.log(e,L.Verbose)}}P(W,"logLevel",L.Silent);var ge=(t=>(t.Year="year",t.Month="month",t.Week="week",t.Day="day",t))(ge||{});function Ft(t){const e=t.match(/^PT?([0-9]+)([MDYW])$/);if(!e||e.length<3)return W.errorLog(`Invalid ISO 8601 duration format: ${t}`),null;const r=parseInt(e[1]);switch(e[2]){case"Y":return{number:r,unit:"year"};case"M":return{number:r,unit:"month"};case"W":return{number:r,unit:"week"};case"D":return{number:r,unit:"day"};default:return W.errorLog(`Invalid ISO 8601 unit duration format: ${t}`),null}}const Fe=(t,e)=>{const r=t/100;return new Intl.NumberFormat("en-US",{style:"currency",currency:e}).format(r)},et=t=>{const e=Ft(t);if(!e)return"unknown";const r=e.number;if(r===1)switch(e.unit){case ge.Year:return"yearly";case ge.Month:return"monthly";case ge.Week:return"weekly";case ge.Day:return"daily"}else return`every ${r} ${e.unit}s`};var tt=(t=>(t.Unknown="unknown",t.Custom="custom",t.Lifetime="$rc_lifetime",t.Annual="$rc_annual",t.SixMonth="$rc_six_month",t.ThreeMonth="$rc_three_month",t.TwoMonth="$rc_two_month",t.Monthly="$rc_monthly",t.Weekly="$rc_weekly",t))(tt||{});const Gt=t=>({amount:t.amount,currency:t.currency,formattedPrice:Fe(t.amount,t.currency)}),Yt=(t,e)=>({identifier:t.identifier,displayName:t.title,currentPrice:Gt(t.current_price),normalPeriodDuration:t.normal_period_duration,presentedOfferingIdentifier:e}),Ht=(t,e,r)=>{const n=r[e.platform_product_identifier];return n===void 0?null:{identifier:e.identifier,rcBillingProduct:Yt(n,t),packageType:Kt(e.identifier)}},nt=(t,e)=>{const r=t.packages.map(i=>Ht(t.identifier,i,e)).filter(V),n={};for(const i of r)i!=null&&(n[i.identifier]=i);return r.length==0?null:{identifier:t.identifier,serverDescription:t.description,metadata:t.metadata,packagesById:n,availablePackages:r,lifetime:n.$rc_lifetime??null,annual:n.$rc_annual??null,sixMonth:n.$rc_six_month??null,threeMonth:n.$rc_three_month??null,twoMonth:n.$rc_two_month??null,monthly:n.$rc_monthly??null,weekly:n.$rc_weekly??null}};function Kt(t){switch(t){case"$rc_lifetime":return"$rc_lifetime";case"$rc_annual":return"$rc_annual";case"$rc_six_month":return"$rc_six_month";case"$rc_three_month":return"$rc_three_month";case"$rc_two_month":return"$rc_two_month";case"$rc_monthly":return"$rc_monthly";case"$rc_weekly":return"$rc_weekly";default:return t.startsWith("$rc_")?"unknown":"custom"}}function v(){}function qt(t,e){for(const r in e)t[r]=e[r];return t}function rt(t){return t()}function it(){return Object.create(null)}function pe(t){t.forEach(rt)}function se(t){return typeof t=="function"}function Q(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let De;function te(t,e){return t===e?!0:(De||(De=document.createElement("a")),De.href=e,t===De.href)}function ot(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function jt(t,e){const r=ot(t.srcset),n=ot(e||"");return n.length===r.length&&n.every(([i,o],s)=>o===r[s][1]&&(te(r[s][0],i)||te(i,r[s][0])))}function Jt(t){return Object.keys(t).length===0}function Y(t,e,r,n){if(t){const i=st(t,e,r,n);return t[0](i)}}function st(t,e,r,n){return t[1]&&n?qt(r.ctx.slice(),t[1](n(e))):r.ctx}function H(t,e,r,n){if(t[2]&&n){const i=t[2](n(r));if(e.dirty===void 0)return i;if(typeof i=="object"){const o=[],s=Math.max(e.dirty.length,i.length);for(let l=0;l<s;l+=1)o[l]=e.dirty[l]|i[l];return o}return e.dirty|i}return e.dirty}function K(t,e,r,n,i,o){if(i){const s=st(e,r,n,o);t.p(s,i)}}function q(t){if(t.ctx.length>32){const e=[],r=t.ctx.length/32;for(let n=0;n<r;n++)e[n]=-1;return e}return-1}function _e(t){return t??""}function D(t,e){t.appendChild(e)}function S(t,e,r){const n=Vt(t);if(!n.getElementById(e)){const i=k("style");i.id=e,i.textContent=r,Wt(n,i)}}function Vt(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function Wt(t,e){return D(t.head||t,e),e.sheet}function p(t,e,r){t.insertBefore(e,r||null)}function g(t){t.parentNode&&t.parentNode.removeChild(t)}function k(t){return document.createElement(t)}function R(t){return document.createTextNode(t)}function T(){return R(" ")}function ne(){return R("")}function Ae(t,e,r,n){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r,n)}function lt(t){return function(e){return e.preventDefault(),t.call(this,e)}}function _(t,e,r){r==null?t.removeAttribute(e):t.getAttribute(e)!==r&&t.setAttribute(e,r)}const zt=["width","height"];function Xt(t,e){const r=Object.getOwnPropertyDescriptors(t.__proto__);for(const n in e)e[n]==null?t.removeAttribute(n):n==="style"?t.style.cssText=e[n]:n==="__value"?t.value=t[n]=e[n]:r[n]&&r[n].set&&zt.indexOf(n)===-1?t[n]=e[n]:_(t,n,e[n])}function Zt(t,e){Object.keys(e).forEach(r=>{en(t,r,e[r])})}function en(t,e,r){const n=e.toLowerCase();n in t?t[n]=typeof t[n]=="boolean"&&r===""?!0:r:e in t?t[e]=typeof t[e]=="boolean"&&r===""?!0:r:_(t,e,r)}function tn(t){return/-/.test(t)?Zt:Xt}function nn(t){return Array.from(t.childNodes)}function ie(t,e){e=""+e,t.data!==e&&(t.data=e)}function ct(t,e){t.value=e??""}function rn(t,e,{bubbles:r=!1,cancelable:n=!1}={}){return new CustomEvent(t,{detail:e,bubbles:r,cancelable:n})}let he;function Ee(t){he=t}function Ce(){if(!he)throw new Error("Function called outside component initialization");return he}function Me(t){Ce().$$.on_mount.push(t)}function on(){const t=Ce();return(e,r,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const o=rn(e,r,{cancelable:n});return i.slice().forEach(s=>{s.call(t,o)}),!o.defaultPrevented}return!0}}function sn(t,e){return Ce().$$.context.set(t,e),e}function ln(t){return Ce().$$.context.get(t)}function at(t,e){const r=t.$$.callbacks[e.type];r&&r.slice().forEach(n=>n.call(this,e))}const le=[],Pe=[];let ce=[];const Ge=[],cn=Promise.resolve();let Ye=!1;function an(){Ye||(Ye=!0,cn.then(ut))}function He(t){ce.push(t)}function un(t){Ge.push(t)}const Ke=new Set;let ae=0;function ut(){if(ae!==0)return;const t=he;do{try{for(;ae<le.length;){const e=le[ae];ae++,Ee(e),fn(e.$$)}}catch(e){throw le.length=0,ae=0,e}for(Ee(null),le.length=0,ae=0;Pe.length;)Pe.pop()();for(let e=0;e<ce.length;e+=1){const r=ce[e];Ke.has(r)||(Ke.add(r),r())}ce.length=0}while(le.length);for(;Ge.length;)Ge.pop()();Ye=!1,Ke.clear(),Ee(t)}function fn(t){if(t.fragment!==null){t.update(),pe(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(He)}}function dn(t){const e=[],r=[];ce.forEach(n=>t.indexOf(n)===-1?e.push(n):r.push(n)),r.forEach(n=>n()),ce=e}const Qe=new Set;let oe;function F(){oe={r:0,c:[],p:oe}}function G(){oe.r||pe(oe.c),oe=oe.p}function u(t,e){t&&t.i&&(Qe.delete(t),t.i(e))}function d(t,e,r,n){if(t&&t.o){if(Qe.has(t))return;Qe.add(t),oe.c.push(()=>{Qe.delete(t),n&&(r&&t.d(1),n())}),t.o(e)}else n&&n()}function mn(t,e,r){const n=t.$$.props[e];n!==void 0&&(t.$$.bound[n]=r,r(t.$$.ctx[n]))}function w(t){t&&t.c()}function I(t,e,r){const{fragment:n,after_update:i}=t.$$;n&&n.m(e,r),He(()=>{const o=t.$$.on_mount.map(rt).filter(se);t.$$.on_destroy?t.$$.on_destroy.push(...o):pe(o),t.$$.on_mount=[]}),i.forEach(He)}function b(t,e){const r=t.$$;r.fragment!==null&&(dn(r.after_update),pe(r.on_destroy),r.fragment&&r.fragment.d(e),r.on_destroy=r.fragment=null,r.ctx=[])}function gn(t,e){t.$$.dirty[0]===-1&&(le.push(t),an(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function N(t,e,r,n,i,o,s=null,l=[-1]){const c=he;Ee(t);const a=t.$$={fragment:null,ctx:[],props:o,update:v,not_equal:i,bound:it(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:it(),dirty:l,skip_bound:!1,root:e.target||c.$$.root};s&&s(a.root);let f=!1;if(a.ctx=r?r(t,e.props||{},(m,E,...y)=>{const A=y.length?y[0]:E;return a.ctx&&i(a.ctx[m],a.ctx[m]=A)&&(!a.skip_bound&&a.bound[m]&&a.bound[m](A),f&&gn(t,m)),E}):[],a.update(),f=!0,pe(a.before_update),a.fragment=n?n(a.ctx):!1,e.target){if(e.hydrate){const m=nn(e.target);a.fragment&&a.fragment.l(m),m.forEach(g)}else a.fragment&&a.fragment.c();e.intro&&u(t.$$.fragment),I(t,e.target,e.anchor),ut()}Ee(c)}class U{constructor(){P(this,"$$");P(this,"$$set")}$destroy(){b(this,1),this.$destroy=v}$on(e,r){if(!se(r))return v;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(r),()=>{const i=n.indexOf(r);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!Jt(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const pn="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(pn);function _n(t){S(t,"svelte-1bzqb13",".rcb-modal-section.svelte-1bzqb13{padding:8px 0px;display:flex}section.rcb-modal-section.svelte-1bzqb13{flex-grow:1}.rcb-modal-section.svelte-1bzqb13:last-of-type{padding:0}")}function qe(t){let e,r;const n=t[2].default,i=Y(n,t,t[1],null);return{c(){e=k(t[0]),i&&i.c(),tn(t[0])(e,{class:_e("rcb-modal-section")+" svelte-1bzqb13"})},m(o,s){p(o,e,s),i&&i.m(e,null),r=!0},p(o,s){i&&i.p&&(!r||s&2)&&K(i,n,o,o[1],r?H(n,o[1],s,null):q(o[1]),null)},i(o){r||(u(i,o),r=!0)},o(o){d(i,o),r=!1},d(o){o&&g(e),i&&i.d(o)}}}function An(t){let e=t[0],r,n,i=t[0]&&qe(t);return{c(){i&&i.c(),r=ne()},m(o,s){i&&i.m(o,s),p(o,r,s),n=!0},p(o,[s]){o[0]?e?Q(e,o[0])?(i.d(1),i=qe(o),e=o[0],i.c(),i.m(r.parentNode,r)):i.p(o,s):(i=qe(o),e=o[0],i.c(),i.m(r.parentNode,r)):e&&(i.d(1),i=null,e=o[0])},i(o){n||(u(i,o),n=!0)},o(o){d(i,o),n=!1},d(o){o&&g(r),i&&i.d(o)}}}function hn(t,e,r){let{$$slots:n={},$$scope:i}=e,{as:o="section"}=e;return t.$$set=s=>{"as"in s&&r(0,o=s.as),"$$scope"in s&&r(1,i=s.$$scope)},[o,i,n]}class ue extends U{constructor(e){super(),N(this,e,hn,An,Q,{as:0},_n)}}function En(t){S(t,"svelte-i5dq8q",".rcb-pricing-info.svelte-i5dq8q{display:flex;flex-direction:column;margin-top:102px;font-weight:500}.rcb-product-price.svelte-i5dq8q{font-size:24px;margin:12px 0px}.rcb-product-details.svelte-i5dq8q{opacity:0.6;list-style-type:disc;list-style-position:inside;margin:0px;padding:0px}@media screen and (max-width: 960px){.rcb-pricing-info.svelte-i5dq8q{margin-top:48px}}")}function In(t){let e,r,n=t[0].displayName+"",i,o,s,l=t[0].currentPrice.currency+"",c,a=" ",f,m=Fe(t[0].currentPrice.amount,t[0].currentPrice.currency)+"",E,y,A,M,h,B=et(t[0].normalPeriodDuration)+"",J,$,Be,xe,me;return{c(){e=k("div"),r=k("span"),i=R(n),o=T(),s=k("span"),c=R(l),f=R(a),E=R(m),y=T(),A=k("ul"),M=k("li"),h=R("Billed "),J=R(B),$=T(),Be=k("li"),Be.textContent="Continues until canceled",xe=T(),me=k("li"),me.textContent="Cancel anytime",_(s,"class","rcb-product-price svelte-i5dq8q"),_(A,"class","rcb-product-details svelte-i5dq8q"),_(e,"class","rcb-pricing-info svelte-i5dq8q")},m(ee,Z){p(ee,e,Z),D(e,r),D(r,i),D(e,o),D(e,s),D(s,c),D(s,f),D(s,E),D(e,y),D(e,A),D(A,M),D(M,h),D(M,J),D(A,$),D(A,Be),D(A,xe),D(A,me)},p(ee,Z){Z&1&&n!==(n=ee[0].displayName+"")&&ie(i,n),Z&1&&l!==(l=ee[0].currentPrice.currency+"")&&ie(c,l),Z&1&&m!==(m=Fe(ee[0].currentPrice.amount,ee[0].currentPrice.currency)+"")&&ie(E,m),Z&1&&B!==(B=et(ee[0].normalPeriodDuration)+"")&&ie(J,B)},d(ee){ee&&g(e)}}}function bn(t){let e,r;return e=new ue({props:{$$slots:{default:[In]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const o={};i&3&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function wn(t,e,r){let{productDetails:n}=e;return t.$$set=i=>{"productDetails"in i&&r(0,n=i.productDetails)},[n]}class ft extends U{constructor(e){super(),N(this,e,wn,bn,Q,{productDetails:0},En)}}const kn="data:image/gif;base64,R0lGODlhMgAyAPcBAAAAAAD/AAMDAwcHBxERERUVFSoqKi0tLTAwMDg4OD09PURERElJSUtLS1BQUFJSUlVVVVdXV1paWl9fX2NjY2ZmZmlpaWxsbG1tbXNzc3t7e39/f4GBgYKCgoSEhIaGhoeHh4iIiIuLi5KSkpSUlJaWlp2dnaGhoaOjo6SkpKWlpaenp6ioqKqqqqurq6ysrLCwsLGxsbS0tLa2tri4uLm5ub29vb6+vsDAwMHBwcLCwsXFxcjIyMnJyc3Nzc7OztPT09TU1NXV1dfX19nZ2dra2tvb29zc3N7e3uDg4OHh4eLi4uPj4+fn5+np6ezs7O7u7vDw8PHx8fLy8vPz8/X19fb29vj4+Pn5+fz8/P39/f7+/v///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH/C05FVFNDQVBFMi4wAwEAAAAh+QQFBAABACwAAAAAMgAyAIcAAAAA/wADAwMHBwcREREVFRUqKiotLS0wMDA4ODg9PT1ERERJSUlLS0tQUFBSUlJVVVVXV1daWlpfX19jY2NmZmZpaWlsbGxtbW1zc3N7e3t/f3+BgYGCgoKEhISGhoaHh4eIiIiLi4uSkpKUlJSWlpadnZ2hoaGjo6OkpKSlpaWnp6eoqKiqqqqrq6usrKywsLCxsbG0tLS2tra4uLi5ubm9vb2+vr7AwMDBwcHCwsLFxcXIyMjJycnNzc3Ozs7T09PU1NTV1dXX19fZ2dna2trb29vc3Nze3t7g4ODh4eHi4uLj4+Pn5+fp6ens7Ozu7u7w8PDx8fHy8vLz8/P19fX29vb4+Pj5+fn8/Pz9/f3+/v7///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8I/wCzcBFIcKDBgggPKkzIcCEXLlq4bIEokeLEiBcrYrTIcaNHjRobinQ4sqRCkBlTdtR44MBKlR9TmjQJQMBMkgZfdpwSMSYAACgpRtHpcSYSFUIa1mz448UQnAWDfmzSooUVmD9XVnnBwglMlDdvvMjhcOlCHit23CSqcUrVJiizpnTC4sXQmB1vZvmxwgYWhWYLznjRA+rJryqvxGhxxGNLjkVcwMCCN6ZeLkNevDCcRYYKJJfZptyCQwdiijl0CDxdlLPryw2lymY9WzTs17ijVq69mzbM28Bd8x7u23bu46F7i16uXEvw5ziJM5duGbl1k9OLN5cKvfvh7OC3b0jxTv6h+PDUy3unzl67RPXXc56fnz4+/PbofcOHnr9/5f3x4UeffvYVqJuACP5m4IIJ+gfWgusN6KCCAN7WoITVVXjchBxqERAAIfkEBQQAAQAsDQADACAAEAAACKcAAwgcSDDAAwcFEypcSNDAAYYQA2DZstCAAYZOKCqM8uNJxYcKa3DYsVBKECBYFFpU+MTDhiIMkQxBohJkwRYaUkDEEiQIlYQrCyLZ0MFJRCdAkgC1OZBEBxgRJRIBAqXgwYI8NoCwEjWAkyFDoorQ4KOrQCRLoqbQuZCKR7NdqzD5MaQKXIhZmAwBIqTJ3YVYogQZ8oMJ178Kk/A1YhfxQiRHjBYMCAAh+QQFBQABACwNAAMAIAAQAAAInQADCBxIMECGDAUTKlxI8EEEhhADcGEI4QFDJQy5ZJmo0OFCFBFkLNzCRQvHghEgKHQi4cEPhhuzdHyYUMQDDxC5kNSSsGLCIA4x5oxZ0GNBDBFKRAxgkmTBgwVpRJhAZWkAohErPKhhVaLJpR8+YFnohEjXrlB2qHgB5SxELD5etHgBxC1DJC9eqOAxxe5CHSxc0HDilyEOGWYLBgQAIfkEBQQAAQAsGAADABcAFwAACJYAS5AIQLCgwYMINXBAyLDhhg0NtxRpWFBDh4YiDpygGOAhwyUI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AQIED2IHYqkxQUTat3Djyp1b0UbDjXdhBqUxcWTfhHQDCx5MuCIXLVy2vOWShTEXsVsOJz6stbHlx1ojI1b8tvHbgAAAIfkEBQQAAQAsAwADABcAFwAACJQAAwgcSLCgwRIkDCpcqIHDwoFHHm7Y8DCACgMJFWroUBGHgQNMFE6sGGDCAQsaHVY8csAAD4MjSX4w8MDgRpIBoCQwsKIgQpwBUBxIULEHkYcUUC580tDEE6AGbXSYKKMKVIJSUnDQIGIHl6sQS0w8AZagjxAsyqpdy7at24pJfgwBMkQukCRQjQQBIgTIXiFGoAYEACH5BAUFAAEALAMAAwAXABcAAAiVAAMIHEiwoMEMGQwqXPggwsKBTLQshPDgYYAaD1owdPjQB4QIThRGgGAxwIYIIBQ2LMlkJBCDFEsGOPEgA5aCK0tKmQChRkGEMgPIiDDhoRYjTR56CPGwiooXN6oENQikhYsWP65MJXglx4sVMoZsJdikRosWOMYSRPJih9q3cOPKnWuRSxa7eO9O3cJFCxe+frdMDQgAIfkEBQUAAQAsBQADACAAEAAACKYAAwgcSLAgwQcODCpcyNDAAYYQAzhpaIDhFYY+NOBY6HAhkyETFRLZ0CGKQgMVDV4RAoQKQxMdUpx8aJAJECYQnWzYcMQgSoNVgAy5CHGGhhI+aRIkMgRnxCohNvQoiLDgEyFDskQUuINDiK1Hfpgc+ETKQi0nVGxNkkSrwCw/hiBxu7XuFidAhARpgqWu3yxIhgApEtLvVipIgARBYthvlKaNFQYEADs=";function $n(t){let e,r;return{c(){e=k("img"),te(e.src,r=kn)||_(e,"src",r),_(e,"alt","spinner")},m(n,i){p(n,e,i)},p:v,i:v,o:v,d(n){n&&g(e)}}}class vn extends U{constructor(e){super(),N(this,e,null,$n,Q,{})}}function yn(t){S(t,"svelte-1mxx341",".rcb-modal-loader.svelte-1mxx341{width:100%;flex-grow:1;min-height:100%;display:flex;justify-content:center;align-items:center}")}function Bn(t){let e,r,n;return r=new vn({}),{c(){e=k("div"),w(r.$$.fragment),_(e,"class","rcb-modal-loader svelte-1mxx341")},m(i,o){p(i,e,o),I(r,e,null),n=!0},p:v,i(i){n||(u(r.$$.fragment,i),n=!0)},o(i){d(r.$$.fragment,i),n=!1},d(i){i&&g(e),b(r)}}}class je extends U{constructor(e){super(),N(this,e,null,Bn,Q,{},yn)}}var Ie=(t=>(t.Started="started",t.InProgress="in_progress",t.Succeeded="succeeded",t.Failed="failed",t))(Ie||{}),Te=(t=>(t[t.SetupIntentCreationFailed=1]="SetupIntentCreationFailed",t[t.PaymentMethodCreationFailed=2]="PaymentMethodCreationFailed",t[t.PaymentChargeFailed=3]="PaymentChargeFailed",t))(Te||{}),O=(t=>(t[t.ErrorSettingUpPurchase=0]="ErrorSettingUpPurchase",t[t.ErrorChargingPayment=1]="ErrorChargingPayment",t[t.UnknownError=2]="UnknownError",t[t.NetworkError=3]="NetworkError",t[t.StripeError=4]="StripeError",t[t.MissingEmailError=5]="MissingEmailError",t))(O||{});class j extends Error{constructor(e,r,n){super(r),this.errorCode=e,this.underlyingErrorMessage=n}}class Dn{constructor(e,r=10){P(this,"operationSessionId",null);P(this,"backend");P(this,"maxNumberAttempts");P(this,"waitMSBetweenAttempts",1e3);this.backend=e,this.maxNumberAttempts=r}async startPurchase(e,r,n,i){const o=await this.backend.postSubscribe(e,r,n,i);return this.operationSessionId=o.operation_session_id,o}async pollCurrentPurchaseForCompletion(){const e=this.operationSessionId;if(!e)throw new j(0,"No purchase in progress");return new Promise((r,n)=>{const i=(o=1)=>{if(o>this.maxNumberAttempts){this.clearPurchaseInProgress(),n(new j(2,"Max attempts reached trying to get successful purchase status"));return}this.backend.getCheckoutStatus(e).then(s=>{switch(s.operation.status){case Ie.Started:case Ie.InProgress:setTimeout(()=>i(o+1),this.waitMSBetweenAttempts);break;case Ie.Succeeded:this.clearPurchaseInProgress(),r();return;case Ie.Failed:this.clearPurchaseInProgress(),this.handlePaymentError(s.operation.error,n)}}).catch(s=>{n(new j(3,s.message))})};i()})}clearPurchaseInProgress(){this.operationSessionId=null}handlePaymentError(e,r){if(e==null){r(new j(2,"Got an error status but error field is empty."));return}switch(e.code){case Te.SetupIntentCreationFailed:r(new j(0,"Setup intent creation failed"));return;case Te.PaymentMethodCreationFailed:r(new j(0,"Payment method creation failed"));return;case Te.PaymentChargeFailed:r(new j(1,"Payment charge failed"));return}}}const Cn="data:image/svg+xml,%3csvg%20width='124'%20height='124'%20viewBox='0%200%20124%20124'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='62'%20cy='62'%20r='62'%20fill='%23767676'/%3e%3cpath%20d='M87.6668%2041.504L82.4968%2036.334L62.0002%2056.8307L41.5035%2036.334L36.3335%2041.504L56.8302%2062.0006L36.3335%2082.4973L41.5035%2087.6673L62.0002%2067.1706L82.4968%2087.6673L87.6668%2082.4973L67.1702%2062.0006L87.6668%2041.504Z'%20fill='white'/%3e%3c/svg%3e";function Mn(t){S(t,"svelte-1609h93","img.svelte-1609h93{width:124px;height:124px;margin:0 auto}")}function Pn(t){let e,r;return{c(){e=k("img"),te(e.src,r=Cn)||_(e,"src",r),_(e,"alt","icon"),_(e,"class","rcb-ui-asset-icon svelte-1609h93")},m(n,i){p(n,e,i)},p:v,i:v,o:v,d(n){n&&g(e)}}}class Qn extends U{constructor(e){super(),N(this,e,null,Pn,Q,{},Mn)}}function Tn(t){S(t,"svelte-1rmxk7q","button.svelte-1rmxk7q{border:none;border-radius:56px;font-size:16px;cursor:pointer;height:56px;color:var(--rc-color-grey-text-dark);background-color:var(--rc-color-grey-ui-dark);display:flex;align-items:center;justify-content:center}button.intent-primary.svelte-1rmxk7q{background-color:var(--rc-color-grey-text-dark);color:var(--rc-color-white);font-size:16px}button.svelte-1rmxk7q:disabled{color:var(--rc-color-grey-text-light)}button.intent-primary.svelte-1rmxk7q:disabled{color:var(--rc-color-grey-text-light)}")}function Nn(t){let e,r,n,i,o;const s=t[3].default,l=Y(s,t,t[2],null);return{c(){e=k("button"),l&&l.c(),_(e,"class",r=_e(`intent-${t[0]}`)+" svelte-1rmxk7q"),e.disabled=t[1]},m(c,a){p(c,e,a),l&&l.m(e,null),n=!0,i||(o=Ae(e,"click",t[4]),i=!0)},p(c,[a]){l&&l.p&&(!n||a&4)&&K(l,s,c,c[2],n?H(s,c[2],a,null):q(c[2]),null),(!n||a&1&&r!==(r=_e(`intent-${c[0]}`)+" svelte-1rmxk7q"))&&_(e,"class",r),(!n||a&2)&&(e.disabled=c[1])},i(c){n||(u(l,c),n=!0)},o(c){d(l,c),n=!1},d(c){c&&g(e),l&&l.d(c),i=!1,o()}}}function Un(t,e,r){let{$$slots:n={},$$scope:i}=e,{intent:o="primary"}=e,{disabled:s=!1}=e;function l(c){at.call(this,t,c)}return t.$$set=c=>{"intent"in c&&r(0,o=c.intent),"disabled"in c&&r(1,s=c.disabled),"$$scope"in c&&r(2,i=c.$$scope)},[o,s,i,n,l]}class be extends U{constructor(e){super(),N(this,e,Un,Nn,Q,{intent:0,disabled:1},Tn)}}function Rn(t){S(t,"svelte-1f9z0o8","footer.svelte-1f9z0o8{display:flex;flex-direction:column}")}function Sn(t){let e,r;const n=t[1].default,i=Y(n,t,t[0],null);return{c(){e=k("footer"),i&&i.c(),_(e,"class","rcb-modal-footer svelte-1f9z0o8")},m(o,s){p(o,e,s),i&&i.m(e,null),r=!0},p(o,[s]){i&&i.p&&(!r||s&1)&&K(i,n,o,o[0],r?H(n,o[0],s,null):q(o[0]),null)},i(o){r||(u(i,o),r=!0)},o(o){d(i,o),r=!1},d(o){o&&g(e),i&&i.d(o)}}}function On(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(0,i=o.$$scope)},[i,n]}class Je extends U{constructor(e){super(),N(this,e,On,Sn,Q,{},Rn)}}function Ln(t){S(t,"svelte-6o8e90",'.column.svelte-6o8e90{display:flex;flex-direction:column;justify-content:flex-start;gap:var(--gap, "8px");flex-grow:1}')}function xn(t){let e,r,n;const i=t[2].default,o=Y(i,t,t[1],null);return{c(){e=k("div"),o&&o.c(),_(e,"class","column svelte-6o8e90"),_(e,"style",r=`--gap:${t[0]};`)},m(s,l){p(s,e,l),o&&o.m(e,null),n=!0},p(s,[l]){o&&o.p&&(!n||l&2)&&K(o,i,s,s[1],n?H(i,s[1],l,null):q(s[1]),null),(!n||l&1&&r!==(r=`--gap:${s[0]};`))&&_(e,"style",r)},i(s){n||(u(o,s),n=!0)},o(s){d(o,s),n=!1},d(s){s&&g(e),o&&o.d(s)}}}function Fn(t,e,r){let{$$slots:n={},$$scope:i}=e,{gutter:o="8px"}=e;return t.$$set=s=>{"gutter"in s&&r(0,o=s.gutter),"$$scope"in s&&r(1,i=s.$$scope)},[o,i,n]}class we extends U{constructor(e){super(),N(this,e,Fn,xn,Q,{gutter:0},Ln)}}const Gn="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='mdi_close'%3e%3cpath%20id='Vector'%20d='M19%206.41L17.59%205L12%2010.59L6.41%205L5%206.41L10.59%2012L5%2017.59L6.41%2019L12%2013.41L17.59%2019L19%2017.59L13.41%2012L19%206.41Z'%20fill='%23767676'/%3e%3c/g%3e%3c/svg%3e";function Yn(t){S(t,"svelte-14xreta",".close-button.svelte-14xreta{border:none;cursor:pointer;background-color:transparent;padding:0px}")}function Hn(t){let e,r,n,i,o;return{c(){e=k("button"),r=k("img"),te(r.src,n=Gn)||_(r,"src",n),_(r,"alt","close"),_(e,"class","close-button svelte-14xreta"),e.disabled=t[0]},m(s,l){p(s,e,l),D(e,r),i||(o=Ae(e,"click",t[1]),i=!0)},p(s,[l]){l&1&&(e.disabled=s[0])},i:v,o:v,d(s){s&&g(e),i=!1,o()}}}function Kn(t,e,r){let{disabled:n=!1}=e;function i(o){at.call(this,t,o)}return t.$$set=o=>{"disabled"in o&&r(0,n=o.disabled)},[n,i]}class qn extends U{constructor(e){super(),N(this,e,Kn,Hn,Q,{disabled:0},Yn)}}function jn(t){S(t,"svelte-44qpq9",".rcb-app-icon.svelte-44qpq9{width:40px;height:40px;border-radius:12px;box-shadow:0px 1px 10px 0px rgba(0, 0, 0, 0.1);margin-right:16px}.rcb-app-icon-picture-container.svelte-44qpq9{height:40px}.rcb-app-icon.loading.svelte-44qpq9{background-color:gray}")}function Jn(t){let e;return{c(){e=k("div"),_(e,"class","rcb-app-icon loading svelte-44qpq9")},m(r,n){p(r,e,n)},p:v,d(r){r&&g(e)}}}function Vn(t){let e,r,n,i,o,s;return{c(){e=k("picture"),r=k("source"),i=T(),o=k("img"),_(r,"type","image/webp"),jt(r,n=t[1])||_(r,"srcset",n),_(o,"class","rcb-app-icon svelte-44qpq9"),te(o.src,s=t[0])||_(o,"src",s),_(o,"alt","App icon"),_(e,"class","rcb-app-icon-picture-container svelte-44qpq9")},m(l,c){p(l,e,c),D(e,r),D(e,i),D(e,o)},p(l,c){c&2&&n!==(n=l[1])&&_(r,"srcset",n),c&1&&!te(o.src,s=l[0])&&_(o,"src",s)},d(l){l&&g(e)}}}function Wn(t){let e;function r(o,s){return o[0]!==null?Vn:Jn}let n=r(t),i=n(t);return{c(){i.c(),e=ne()},m(o,s){i.m(o,s),p(o,e,s)},p(o,[s]){n===(n=r(o))&&i?i.p(o,s):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},i:v,o:v,d(o){o&&g(e),i.d(o)}}}function zn(t,e,r){let{src:n=null}=e,{srcWebp:i=null}=e;return t.$$set=o=>{"src"in o&&r(0,n=o.src),"srcWebp"in o&&r(1,i=o.srcWebp)},[n,i]}class dt extends U{constructor(e){super(),N(this,e,zn,Wn,Q,{src:0,srcWebp:1},jn)}}const Ne=t=>`https://da08ctfrofx1b.cloudfront.net/${t}`;function Xn(t){S(t,"svelte-10uf5fq",".app-title.svelte-10uf5fq{font-weight:500;margin:8px 0;font-size:16px}.rcb-header-layout__business-info.svelte-10uf5fq{display:flex;align-items:center}")}function Zn(t){let e,r;return e=new dt({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p:v,i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function er(t){let e,r,n=t[0].seller_company_name+"",i,o,s=t[0].app_icon_webp!==null&&t[0].app_icon!==null&&mt(t);return{c(){s&&s.c(),e=T(),r=k("span"),i=R(n),_(r,"class","app-title svelte-10uf5fq")},m(l,c){s&&s.m(l,c),p(l,e,c),p(l,r,c),D(r,i),o=!0},p(l,c){l[0].app_icon_webp!==null&&l[0].app_icon!==null?s?(s.p(l,c),c&1&&u(s,1)):(s=mt(l),s.c(),u(s,1),s.m(e.parentNode,e)):s&&(F(),d(s,1,1,()=>{s=null}),G()),(!o||c&1)&&n!==(n=l[0].seller_company_name+"")&&ie(i,n)},i(l){o||(u(s),o=!0)},o(l){d(s),o=!1},d(l){l&&(g(e),g(r)),s&&s.d(l)}}}function mt(t){let e,r;return e=new dt({props:{src:Ne(t[0].app_icon),srcWebp:Ne(t[0].app_icon_webp)}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&1&&(o.src=Ne(n[0].app_icon)),i&1&&(o.srcWebp=Ne(n[0].app_icon_webp)),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function tr(t){let e,r,n,i;const o=[er,Zn],s=[];function l(c,a){return c[0]!==null?0:1}return r=l(t),n=s[r]=o[r](t),{c(){e=k("div"),n.c(),_(e,"class","rcb-header-layout__business-info svelte-10uf5fq")},m(c,a){p(c,e,a),s[r].m(e,null),i=!0},p(c,[a]){let f=r;r=l(c),r===f?s[r].p(c,a):(F(),d(s[f],1,1,()=>{s[f]=null}),G(),n=s[r],n?n.p(c,a):(n=s[r]=o[r](c),n.c()),u(n,1),n.m(e,null))},i(c){i||(u(n),i=!0)},o(c){d(n),i=!1},d(c){c&&g(e),s[r].d()}}}function nr(t,e,r){let{brandingInfo:n=null}=e;return t.$$set=i=>{"brandingInfo"in i&&r(0,n=i.brandingInfo)},[n]}class gt extends U{constructor(e){super(),N(this,e,nr,tr,Q,{brandingInfo:0},Xn)}}function rr(t){S(t,"svelte-17puakv",".rcb-post-purchase-header-layout.svelte-17puakv{display:flex;justify-content:space-between;align-items:center;width:100%;margin-top:-4px}")}function ir(t){let e,r,n,i,o;return r=new gt({props:{brandingInfo:t[0]}}),i=new qn({}),i.$on("click",function(){se(t[1])&&t[1].apply(this,arguments)}),{c(){e=k("div"),w(r.$$.fragment),n=T(),w(i.$$.fragment),_(e,"class","rcb-post-purchase-header-layout svelte-17puakv")},m(s,l){p(s,e,l),I(r,e,null),D(e,n),I(i,e,null),o=!0},p(s,l){t=s;const c={};l&1&&(c.brandingInfo=t[0]),r.$set(c)},i(s){o||(u(r.$$.fragment,s),u(i.$$.fragment,s),o=!0)},o(s){d(r.$$.fragment,s),d(i.$$.fragment,s),o=!1},d(s){s&&g(e),b(r),b(i)}}}function or(t){let e,r;return e=new ue({props:{as:"header",$$slots:{default:[ir]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const o={};i&7&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function sr(t,e,r){let{brandingInfo:n=null}=e,{onClose:i}=e;return t.$$set=o=>{"brandingInfo"in o&&r(0,n=o.brandingInfo),"onClose"in o&&r(1,i=o.onClose)},[n,i]}class lr extends U{constructor(e){super(),N(this,e,sr,or,Q,{brandingInfo:0,onClose:1},rr)}}function cr(t){S(t,"svelte-10pcqja",".rcb-modal-message.svelte-10pcqja{width:100%;min-height:160px;display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center}.title.svelte-10pcqja{font-size:24px;line-height:1.25em}.subtitle.svelte-10pcqja{font-size:16px;line-height:1.25em;overflow-wrap:anywhere}")}const ar=t=>({}),pt=t=>({});function ur(t){let e,r,n,i,o;const s=t[4].default,l=Y(s,t,t[5],null);return{c(){e=k("span"),r=R(t[2]),n=T(),i=k("span"),l&&l.c(),_(e,"class","title svelte-10pcqja"),_(i,"class","subtitle svelte-10pcqja")},m(c,a){p(c,e,a),D(e,r),p(c,n,a),p(c,i,a),l&&l.m(i,null),o=!0},p(c,a){(!o||a&4)&&ie(r,c[2]),l&&l.p&&(!o||a&32)&&K(l,s,c,c[5],o?H(s,c[5],a,null):q(c[5]),null)},i(c){o||(u(l,c),o=!0)},o(c){d(l,c),o=!1},d(c){c&&(g(e),g(n),g(i)),l&&l.d(c)}}}function fr(t){let e,r,n;const i=t[4].icon,o=Y(i,t,t[5],pt);return r=new we({props:{gutter:"16px",$$slots:{default:[ur]},$$scope:{ctx:t}}}),{c(){o&&o.c(),e=T(),w(r.$$.fragment)},m(s,l){o&&o.m(s,l),p(s,e,l),I(r,s,l),n=!0},p(s,l){o&&o.p&&(!n||l&32)&&K(o,i,s,s[5],n?H(i,s[5],l,ar):q(s[5]),pt);const c={};l&36&&(c.$$scope={dirty:l,ctx:s}),r.$set(c)},i(s){n||(u(o,s),u(r.$$.fragment,s),n=!0)},o(s){d(o,s),d(r.$$.fragment,s),n=!1},d(s){s&&g(e),o&&o.d(s),b(r,s)}}}function dr(t){let e,r,n;return r=new we({props:{gutter:"16px",$$slots:{default:[fr]},$$scope:{ctx:t}}}),{c(){e=k("div"),w(r.$$.fragment),_(e,"class","rcb-modal-message svelte-10pcqja"),_(e,"data-type",t[3])},m(i,o){p(i,e,o),I(r,e,null),n=!0},p(i,o){const s={};o&36&&(s.$$scope={dirty:o,ctx:i}),r.$set(s),(!n||o&8)&&_(e,"data-type",i[3])},i(i){n||(u(r.$$.fragment,i),n=!0)},o(i){d(r.$$.fragment,i),n=!1},d(i){i&&g(e),b(r)}}}function mr(t){let e;return{c(){e=R("Go back to app")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function gr(t){let e,r;return e=new be({props:{$$slots:{default:[mr]},$$scope:{ctx:t}}}),e.$on("click",function(){se(t[1])&&t[1].apply(this,arguments)}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){t=n;const o={};i&32&&(o.$$scope={dirty:i,ctx:t}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function pr(t){let e,r,n,i,o,s;return e=new lr({props:{brandingInfo:t[0],onClose:t[1]}}),n=new ue({props:{$$slots:{default:[dr]},$$scope:{ctx:t}}}),o=new Je({props:{$$slots:{default:[gr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment),r=T(),w(n.$$.fragment),i=T(),w(o.$$.fragment)},m(l,c){I(e,l,c),p(l,r,c),I(n,l,c),p(l,i,c),I(o,l,c),s=!0},p(l,c){const a={};c&1&&(a.brandingInfo=l[0]),c&2&&(a.onClose=l[1]),e.$set(a);const f={};c&44&&(f.$$scope={dirty:c,ctx:l}),n.$set(f);const m={};c&34&&(m.$$scope={dirty:c,ctx:l}),o.$set(m)},i(l){s||(u(e.$$.fragment,l),u(n.$$.fragment,l),u(o.$$.fragment,l),s=!0)},o(l){d(e.$$.fragment,l),d(n.$$.fragment,l),d(o.$$.fragment,l),s=!1},d(l){l&&(g(r),g(i)),b(e,l),b(n,l),b(o,l)}}}function _r(t){let e,r;return e=new we({props:{gutter:"32px",$$slots:{default:[pr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const o={};i&47&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Ar(t,e,r){let{$$slots:n={},$$scope:i}=e,{brandingInfo:o=null}=e,{onContinue:s}=e,{title:l}=e,{type:c}=e;return t.$$set=a=>{"brandingInfo"in a&&r(0,o=a.brandingInfo),"onContinue"in a&&r(1,s=a.onContinue),"title"in a&&r(2,l=a.title),"type"in a&&r(3,c=a.type),"$$scope"in a&&r(5,i=a.$$scope)},[o,s,l,c,n,i]}class _t extends U{constructor(e){super(),N(this,e,Ar,_r,Q,{brandingInfo:0,onContinue:1,title:2,type:3},cr)}}function At(t){let e,r,n,i,o;return{c(){e=R("If this error persists, please contact "),r=k("a"),n=R(t[1]),o=R("."),_(r,"href",i="mailto:"+t[1])},m(s,l){p(s,e,l),p(s,r,l),D(r,n),p(s,o,l)},p(s,l){l&2&&ie(n,s[1]),l&2&&i!==(i="mailto:"+s[1])&&_(r,"href",i)},d(s){s&&(g(e),g(r),g(o))}}}function hr(t){let e=t[3]()+"",r,n,i,o=t[1]&&At(t);return{c(){r=R(e),n=T(),o&&o.c(),i=ne()},m(s,l){p(s,r,l),p(s,n,l),o&&o.m(s,l),p(s,i,l)},p(s,l){s[1]?o?o.p(s,l):(o=At(s),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null)},d(s){s&&(g(r),g(n),g(i)),o&&o.d(s)}}}function Er(t){let e,r;return e=new Qn({props:{slot:"icon"}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p:v,i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Ir(t){let e,r;return e=new _t({props:{title:"Something went wrong",brandingInfo:t[0],onContinue:t[2],type:"error",$$slots:{icon:[Er],default:[hr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const o={};i&1&&(o.brandingInfo=n[0]),i&4&&(o.onContinue=n[2]),i&34&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function br(t,e,r){let{brandingInfo:n=null}=e,{lastError:i}=e,{supportEmail:o=null}=e,{onContinue:s}=e;Me(()=>{W.errorLog(`Displayed error: ${O[i.errorCode]}. Message: ${i.message??"None"}. Underlying error: ${i.underlyingErrorMessage??"None"}`)});function l(){switch(i.errorCode){case O.UnknownError:return"An unknown error occurred.";case O.ErrorSettingUpPurchase:return"Purchase not started due to an error.";case O.ErrorChargingPayment:return"Payment failed.";case O.NetworkError:return"Network error. Please check your internet connection.";case O.StripeError:return i.message;case O.MissingEmailError:return"Email is required to complete the purchase."}return i.message}return t.$$set=c=>{"brandingInfo"in c&&r(0,n=c.brandingInfo),"lastError"in c&&r(4,i=c.lastError),"supportEmail"in c&&r(1,o=c.supportEmail),"onContinue"in c&&r(2,s=c.onContinue)},[n,o,s,l,i]}class wr extends U{constructor(e){super(),N(this,e,br,Ir,Q,{brandingInfo:0,lastError:4,supportEmail:1,onContinue:2})}}const kr="data:image/svg+xml,%3csvg%20width='124'%20height='124'%20viewBox='0%200%20124%20124'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='62'%20cy='62'%20r='62'%20fill='%23576CDB'/%3e%3crect%20x='44.1116'%20y='56'%20width='27.5'%20height='11'%20transform='rotate(45%2044.1116%2056)'%20fill='white'/%3e%3crect%20x='79.1133'%20y='44.334'%20width='11'%20height='44'%20transform='rotate(45%2079.1133%2044.334)'%20fill='white'/%3e%3c/svg%3e";function $r(t){S(t,"svelte-1609h93","img.svelte-1609h93{width:124px;height:124px;margin:0 auto}")}function vr(t){let e,r;return{c(){e=k("img"),te(e.src,r=kr)||_(e,"src",r),_(e,"alt","icon"),_(e,"class","rcb-ui-asset-icon svelte-1609h93")},m(n,i){p(n,e,i)},p:v,i:v,o:v,d(n){n&&g(e)}}}class yr extends U{constructor(e){super(),N(this,e,null,vr,Q,{},$r)}}function Br(t){let e;return{c(){e=R("Your plan is now active.")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function Dr(t){let e,r;return e=new yr({props:{slot:"icon"}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p:v,i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Cr(t){let e,r;return e=new _t({props:{type:"success",title:"Purchase successful",brandingInfo:t[0],onContinue:t[1],$$slots:{icon:[Dr],default:[Br]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const o={};i&1&&(o.brandingInfo=n[0]),i&2&&(o.onContinue=n[1]),i&4&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Mr(t,e,r){let{brandingInfo:n=null}=e,{onContinue:i}=e;return t.$$set=o=>{"brandingInfo"in o&&r(0,n=o.brandingInfo),"onContinue"in o&&r(1,i=o.onContinue)},[n,i]}class Pr extends U{constructor(e){super(),N(this,e,Mr,Cr,Q,{brandingInfo:0,onContinue:1})}}function Qr(t,e,r,n,i={}){const o=r.create(e,i);return o.mount(t),o.on("change",s=>n("change",s)),o.on("ready",s=>n("ready",s)),o.on("focus",s=>n("focus",s)),o.on("blur",s=>n("blur",s)),o.on("escape",s=>n("escape",s)),o.on("click",s=>n("click",s)),o.on("loaderror",s=>n("loaderror",s)),o.on("loaderstart",s=>n("loaderstart",s)),o.on("networkschange",s=>n("networkschange",s)),o}const Tr=typeof window>"u";function Nr(t){if(!Tr)return t.registerAppInfo({name:"svelte-stripe-js",url:"https://svelte-stripe-js.vercel.app"})}function Ur(t){let e;return{c(){e=k("div")},m(r,n){p(r,e,n),t[6](e)},p:v,i:v,o:v,d(r){r&&g(e),t[6](null)}}}function Rr(t,e,r){let n,i;const o=on(),{elements:s}=ln("stripe");let{options:l=void 0}=e;Me(()=>(n=Qr(i,"payment",s,o,l),()=>n.destroy()));function c(){n.blur()}function a(){n.clear()}function f(){n.destroy()}function m(){n.focus()}function E(y){Pe[y?"unshift":"push"](()=>{i=y,r(0,i)})}return t.$$set=y=>{"options"in y&&r(1,l=y.options)},[i,l,c,a,f,m,E]}class Sr extends U{constructor(e){super(),N(this,e,Rr,Ur,Q,{options:1,blur:2,clear:3,destroy:4,focus:5})}get blur(){return this.$$.ctx[2]}get clear(){return this.$$.ctx[3]}get destroy(){return this.$$.ctx[4]}get focus(){return this.$$.ctx[5]}}function ht(t){let e;const r=t[15].default,n=Y(r,t,t[14],null);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&16384)&&K(n,r,i,i[14],e?H(r,i[14],o,null):q(i[14]),null)},i(i){e||(u(n,i),e=!0)},o(i){d(n,i),e=!1},d(i){n&&n.d(i)}}}function Or(t){let e,r,n=t[1]&&t[0]&&ht(t);return{c(){n&&n.c(),e=ne()},m(i,o){n&&n.m(i,o),p(i,e,o),r=!0},p(i,[o]){i[1]&&i[0]?n?(n.p(i,o),o&3&&u(n,1)):(n=ht(i),n.c(),u(n,1),n.m(e.parentNode,e)):n&&(F(),d(n,1,1,()=>{n=null}),G())},i(i){r||(u(n),r=!0)},o(i){d(n),r=!1},d(i){i&&g(e),n&&n.d(i)}}}function Lr(t,e,r){let n,{$$slots:i={},$$scope:o}=e,{stripe:s}=e,{mode:l=void 0}=e,{theme:c="stripe"}=e,{variables:a={}}=e,{rules:f={}}=e,{labels:m="above"}=e,{loader:E="auto"}=e,{fonts:y=[]}=e,{locale:A="auto"}=e,{currency:M=void 0}=e,{amount:h=void 0}=e,{clientSecret:B=void 0}=e,{elements:J=null}=e;return t.$$set=$=>{"stripe"in $&&r(1,s=$.stripe),"mode"in $&&r(2,l=$.mode),"theme"in $&&r(3,c=$.theme),"variables"in $&&r(4,a=$.variables),"rules"in $&&r(5,f=$.rules),"labels"in $&&r(6,m=$.labels),"loader"in $&&r(7,E=$.loader),"fonts"in $&&r(8,y=$.fonts),"locale"in $&&r(9,A=$.locale),"currency"in $&&r(10,M=$.currency),"amount"in $&&r(11,h=$.amount),"clientSecret"in $&&r(12,B=$.clientSecret),"elements"in $&&r(0,J=$.elements),"$$scope"in $&&r(14,o=$.$$scope)},t.$$.update=()=>{t.$$.dirty&120&&r(13,n={theme:c,variables:a,rules:f,labels:m}),t.$$.dirty&16263&&s&&!J&&(r(0,J=s.elements({mode:l,currency:M,amount:h,appearance:n,clientSecret:B,fonts:y,loader:E,locale:A})),Nr(s),sn("stripe",{stripe:s,elements:J})),t.$$.dirty&8705&&J&&J.update({appearance:n,locale:A})},[J,s,l,c,a,f,m,E,y,A,M,h,B,n,o,i]}class xr extends U{constructor(e){super(),N(this,e,Lr,Or,Q,{stripe:1,mode:2,theme:3,variables:4,rules:5,labels:6,loader:7,fonts:8,locale:9,currency:10,amount:11,clientSecret:12,elements:0})}}var Et="https://js.stripe.com/v3",Fr=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,It="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",Gr=function(){for(var e=document.querySelectorAll('script[src^="'.concat(Et,'"]')),r=0;r<e.length;r++){var n=e[r];if(Fr.test(n.src))return n}return null},bt=function(e){var r=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(Et).concat(r);var i=document.head||document.body;if(!i)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return i.appendChild(n),n},Yr=function(e,r){!e||!e._registerWrapper||e._registerWrapper({name:"stripe-js",version:"2.4.0",startTime:r})},ke=null,Ue=null,Re=null,Hr=function(e){return function(){e(new Error("Failed to load Stripe.js"))}},Kr=function(e,r){return function(){window.Stripe?e(window.Stripe):r(new Error("Stripe.js not available"))}},qr=function(e){return ke!==null?ke:(ke=new Promise(function(r,n){if(typeof window>"u"||typeof document>"u"){r(null);return}if(window.Stripe&&e&&console.warn(It),window.Stripe){r(window.Stripe);return}try{var i=Gr();if(i&&e)console.warn(It);else if(!i)i=bt(e);else if(i&&Re!==null&&Ue!==null){var o;i.removeEventListener("load",Re),i.removeEventListener("error",Ue),(o=i.parentNode)===null||o===void 0||o.removeChild(i),i=bt(e)}Re=Kr(r,n),Ue=Hr(n),i.addEventListener("load",Re),i.addEventListener("error",Ue)}catch(s){n(s);return}}),ke.catch(function(r){return ke=null,Promise.reject(r)}))},jr=function(e,r,n){if(e===null)return null;var i=e.apply(void 0,r);return Yr(i,n),i},$e,wt=!1,kt=function(){return $e||($e=qr(null).catch(function(e){return $e=null,Promise.reject(e)}),$e)};Promise.resolve().then(function(){return kt()}).catch(function(t){wt||console.warn(t)});var Jr=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];wt=!0;var i=Date.now();return kt().then(function(o){return jr(o,r,i)})};function Vr(t){S(t,"svelte-1xe711j",".rcb-header-layout.svelte-1xe711j{display:flex;justify-content:space-between;align-items:center;width:100%;font-size:24px;margin:0;font-weight:500}")}function Wr(t){let e,r;const n=t[0].default,i=Y(n,t,t[1],null);return{c(){e=k("div"),i&&i.c(),_(e,"class","rcb-header-layout svelte-1xe711j")},m(o,s){p(o,e,s),i&&i.m(e,null),r=!0},p(o,s){i&&i.p&&(!r||s&2)&&K(i,n,o,o[1],r?H(n,o[1],s,null):q(o[1]),null)},i(o){r||(u(i,o),r=!0)},o(o){d(i,o),r=!1},d(o){o&&g(e),i&&i.d(o)}}}function zr(t){let e,r;return e=new ue({props:{as:"header",$$slots:{default:[Wr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const o={};i&2&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Xr(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(1,i=o.$$scope)},[n,i]}class Ve extends U{constructor(e){super(),N(this,e,Xr,zr,Q,{},Vr)}}const Zr="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M18%208H17V6C17%203.24%2014.76%201%2012%201C9.24%201%207%203.24%207%206V8H6C4.9%208%204%208.9%204%2010V20C4%2021.1%204.9%2022%206%2022H18C19.1%2022%2020%2021.1%2020%2020V10C20%208.9%2019.1%208%2018%208ZM12%2017C10.9%2017%2010%2016.1%2010%2015C10%2013.9%2010.9%2013%2012%2013C13.1%2013%2014%2013.9%2014%2015C14%2016.1%2013.1%2017%2012%2017ZM15.1%208H8.9V6C8.9%204.29%2010.29%202.9%2012%202.9C13.71%202.9%2015.1%204.29%2015.1%206V8Z'%20fill='%2311D483'/%3e%3c/svg%3e";function ei(t){let e,r;return{c(){e=k("img"),te(e.src,r=Zr)||_(e,"src",r),_(e,"alt","icon"),_(e,"class","rcb-ui-asset-icon")},m(n,i){p(n,e,i)},p:v,i:v,o:v,d(n){n&&g(e)}}}class ti extends U{constructor(e){super(),N(this,e,null,ei,Q,{})}}const ve={error:"#f2545b",warning:"#f4e971",focus:"#000080","grey-text-dark":"#000000","grey-text-light":"#767676","grey-ui-dark":"#dfdfdf",white:"#ffffff"};function ni(t){S(t,"svelte-rjmul6",`.processing.svelte-rjmul6{width:12px;aspect-ratio:1;border-radius:50%;animation:svelte-rjmul6-l5 1.5s infinite linear}@keyframes svelte-rjmul6-l5{0%{box-shadow:20px 0 #fff2,
|
|
2
2
|
-20px 0 #fff2;background:#fff2}25%{box-shadow:20px 0 #fff2,
|
|
3
3
|
-20px 0 #ffff;background:#fff2}50%{box-shadow:20px 0 #fff2,
|
|
4
4
|
-20px 0 #fff2;background:#ffff}75%{box-shadow:20px 0 #ffff,
|
|
5
5
|
-20px 0 #fff2;background:#fff2}100%{box-shadow:20px 0 #fff2,
|
|
6
|
-
-20px 0 #fff2;background:#fff2}}`)}function ni(t){let e;return{c(){e=k("div"),_(e,"class","processing svelte-rjmul6")},m(r,n){p(r,e,n)},p:v,i:v,o:v,d(r){r&&g(e)}}}class $t extends N{constructor(e){super(),U(this,e,null,ni,P,{},ti)}}function ri(t){S(t,"svelte-1wxt892",".rcb-stripe-elements-container.svelte-1wxt892{width:100%;margin-top:32px;margin-bottom:24px}")}function ii(t){let e,r;return e=new je({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p:v,i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function oi(t){let e,r,n,i,o,s;function l(a){t[9](a)}let c={stripe:t[3],clientSecret:t[4],loader:"always",theme:"stripe",variables:{borderRadius:"12px",fontSizeBase:"16px",fontSizeSm:"16px",spacingGridRow:"16px",colorText:ye["grey-text-dark"],focusBoxShadow:"none",colorDanger:ye.error},rules:{".Input":{boxShadow:"none",border:`2px solid ${ye["grey-ui-dark"]}`},".Input:focus":{border:`2px solid ${ye.focus}`,outline:"none"},".Label":{marginBottom:"8px",fontWeight:"500",lineHeight:"22px"},".Input--invalid":{boxShadow:"none"}},$$slots:{default:[gi]},$$scope:{ctx:t}};return t[2]!==void 0&&(c.elements=t[2]),r=new Lr({props:c}),Qe.push(()=>fn(r,"elements",l)),{c(){e=k("form"),w(r.$$.fragment)},m(a,f){p(a,e,f),I(r,e,null),i=!0,o||(s=Ae(e,"submit",ot(t[5])),o=!0)},p(a,f){const m={};f&8&&(m.stripe=a[3]),f&2051&&(m.$$scope={dirty:f,ctx:a}),!n&&f&4&&(n=!0,m.elements=a[2],cn(()=>n=!1)),r.$set(m)},i(a){i||(u(r.$$.fragment,a),i=!0)},o(a){d(r.$$.fragment,a),i=!1},d(a){a&&g(e),b(r),o=!1,s()}}}function si(t){let e,r,n,i;return n=new ei({}),{c(){e=k("div"),e.textContent="Secure Checkout",r=T(),w(n.$$.fragment)},m(o,s){p(o,e,s),p(o,r,s),I(n,o,s),i=!0},p:v,i(o){i||(u(n.$$.fragment,o),i=!0)},o(o){d(n.$$.fragment,o),i=!1},d(o){o&&(g(e),g(r)),b(n,o)}}}function li(t){let e,r,n;return r=new Rr({}),{c(){e=k("div"),w(r.$$.fragment),_(e,"class","rcb-stripe-elements-container svelte-1wxt892")},m(i,o){p(i,e,o),I(r,e,null),n=!0},p:v,i(i){n||(u(r.$$.fragment,i),n=!0)},o(i){d(r.$$.fragment,i),n=!1},d(i){i&&g(e),b(r)}}}function ci(t){let e;return{c(){e=R("Pay")},m(r,n){p(r,e,n)},i:v,o:v,d(r){r&&g(e)}}}function ai(t){let e,r;return e=new $t({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function ui(t){let e,r,n,i;const o=[ai,ci],s=[];function l(c,a){return c[0]?0:1}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=ne()},m(c,a){s[e].m(c,a),p(c,n,a),i=!0},p(c,a){let f=e;e=l(c),e!==f&&(x(),d(s[f],1,1,()=>{s[f]=null}),F(),r=s[e],r||(r=s[e]=o[e](c),r.c()),u(r,1),r.m(n.parentNode,n))},i(c){i||(u(r),i=!0)},o(c){d(r),i=!1},d(c){c&&g(n),s[e].d(c)}}}function fi(t){let e;return{c(){e=R("Close")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function di(t){let e,r,n,i;return e=new we({props:{disabled:t[0],$$slots:{default:[ui]},$$scope:{ctx:t}}}),n=new we({props:{disabled:t[0],intent:"secondary",$$slots:{default:[fi]},$$scope:{ctx:t}}}),n.$on("click",function(){le(t[1])&&t[1].apply(this,arguments)}),{c(){w(e.$$.fragment),r=T(),w(n.$$.fragment)},m(o,s){I(e,o,s),p(o,r,s),I(n,o,s),i=!0},p(o,s){t=o;const l={};s&1&&(l.disabled=t[0]),s&2049&&(l.$$scope={dirty:s,ctx:t}),e.$set(l);const c={};s&1&&(c.disabled=t[0]),s&2048&&(c.$$scope={dirty:s,ctx:t}),n.$set(c)},i(o){i||(u(e.$$.fragment,o),u(n.$$.fragment,o),i=!0)},o(o){d(e.$$.fragment,o),d(n.$$.fragment,o),i=!1},d(o){o&&g(r),b(e,o),b(n,o)}}}function mi(t){let e,r;return e=new ke({props:{$$slots:{default:[di]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&2051&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function gi(t){let e,r,n,i,o,s;return e=new Ve({props:{$$slots:{default:[si]},$$scope:{ctx:t}}}),n=new fe({props:{$$slots:{default:[li]},$$scope:{ctx:t}}}),o=new Je({props:{$$slots:{default:[mi]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment),r=T(),w(n.$$.fragment),i=T(),w(o.$$.fragment)},m(l,c){I(e,l,c),p(l,r,c),I(n,l,c),p(l,i,c),I(o,l,c),s=!0},p(l,c){const a={};c&2048&&(a.$$scope={dirty:c,ctx:l}),e.$set(a);const f={};c&2048&&(f.$$scope={dirty:c,ctx:l}),n.$set(f);const m={};c&2051&&(m.$$scope={dirty:c,ctx:l}),o.$set(m)},i(l){s||(u(e.$$.fragment,l),u(n.$$.fragment,l),u(o.$$.fragment,l),s=!0)},o(l){d(e.$$.fragment,l),d(n.$$.fragment,l),d(o.$$.fragment,l),s=!1},d(l){l&&(g(r),g(i)),b(e,l),b(n,l),b(o,l)}}}function pi(t){let e,r,n,i;const o=[oi,ii],s=[];function l(c,a){return c[3]&&c[4]?0:1}return r=l(t),n=s[r]=o[r](t),{c(){e=k("div"),n.c()},m(c,a){p(c,e,a),s[r].m(e,null),i=!0},p(c,[a]){let f=r;r=l(c),r===f?s[r].p(c,a):(x(),d(s[f],1,1,()=>{s[f]=null}),F(),n=s[r],n?n.p(c,a):(n=s[r]=o[r](c),n.c()),u(n,1),n.m(e,null))},i(c){i||(u(n),i=!0)},o(c){d(n),i=!1},d(c){c&&g(e),s[r].d()}}}function _i(t,e,r){let{onClose:n}=e,{onContinue:i}=e,{onError:o}=e,{paymentInfoCollectionMetadata:s}=e,{processing:l=!1}=e;const c=s.data.client_secret;let a=null,f,m;Me(async()=>{const A=s.data.publishable_api_key,M=s.data.stripe_account_id;if(!A||!M)throw new Error("Stripe publishable key or account ID not found");r(3,a=await jr(A,{stripeAccount:M}))});const E=async()=>{if(l||!a||!m)return;r(0,l=!0);const A=await a.confirmSetup({elements:m,redirect:"if_required"});A.error?(r(0,l=!1),o(new j(O.StripeError,A.error.message))):i()};function y(A){f=A,r(2,f)}return t.$$set=A=>{"onClose"in A&&r(1,n=A.onClose),"onContinue"in A&&r(6,i=A.onContinue),"onError"in A&&r(7,o=A.onError),"paymentInfoCollectionMetadata"in A&&r(8,s=A.paymentInfoCollectionMetadata),"processing"in A&&r(0,l=A.processing)},t.$$.update=()=>{t.$$.dirty&4&&f&&f._elements.length>0&&(m=f)},[l,n,f,a,c,E,i,o,s,y]}class Ai extends N{constructor(e){super(),U(this,e,_i,pi,P,{onClose:1,onContinue:6,onError:7,paymentInfoCollectionMetadata:8,processing:0},ri)}}function hi(t){S(t,"svelte-favd20","form.svelte-favd20.svelte-favd20{display:flex;flex-direction:column;min-height:100%;flex-grow:1}.form-container.svelte-favd20.svelte-favd20{display:flex;flex-direction:column;width:100%;margin-top:32px;margin-bottom:16px}.form-label.svelte-favd20.svelte-favd20{margin-top:8px;margin-bottom:8px;display:block;font-weight:500;line-height:22px}.form-input.error.svelte-favd20 input.svelte-favd20{border-color:var(--rc-color-error)}.form-error.svelte-favd20.svelte-favd20{margin-top:4px;font-size:16px;line-height:20px;min-height:40px;color:var(--rc-color-error)}input.svelte-favd20.svelte-favd20{width:100%;box-sizing:border-box;padding:8px;border:2px solid var(--rc-color-grey-ui-dark);border-radius:12px;font-size:16px;height:48px;padding:6px 14px}input.svelte-favd20.svelte-favd20:focus{outline:none;border:2px solid var(--rc-color-focus)}")}function Ei(t){let e;return{c(){e=R("Billing email address")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function vt(t){let e,r;return{c(){e=k("div"),r=R(t[2]),_(e,"class","form-error svelte-favd20")},m(n,i){p(n,e,i),D(e,r)},p(n,i){i&4&&ie(r,n[2])},d(n){n&&g(e)}}}function Ii(t){let e,r,n,i,o,s,l,c,a,f=t[2]&&vt(t);return{c(){e=k("div"),r=k("div"),r.innerHTML='<label for="email">Email</label>',n=T(),i=k("div"),o=k("input"),l=T(),f&&f.c(),_(r,"class","form-label svelte-favd20"),_(o,"name","email"),_(o,"placeholder","john@appleseed.com"),_(o,"autocapitalize","off"),_(o,"class","svelte-favd20"),_(i,"class",s="form-input "+t[4]+" svelte-favd20"),_(e,"class","form-container svelte-favd20")},m(m,E){p(m,e,E),D(e,r),D(e,n),D(e,i),D(i,o),st(o,t[3]),D(e,l),f&&f.m(e,null),c||(a=Ae(o,"input",t[7]),c=!0)},p(m,E){E&8&&o.value!==m[3]&&st(o,m[3]),E&16&&s!==(s="form-input "+m[4]+" svelte-favd20")&&_(i,"class",s),m[2]?f?f.p(m,E):(f=vt(m),f.c(),f.m(e,null)):f&&(f.d(1),f=null)},d(m){m&&g(e),f&&f.d(),c=!1,a()}}}function bi(t){let e;return{c(){e=R("Continue")},m(r,n){p(r,e,n)},i:v,o:v,d(r){r&&g(e)}}}function wi(t){let e,r;return e=new $t({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function ki(t){let e,r,n,i;const o=[wi,bi],s=[];function l(c,a){return c[1]?0:1}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=ne()},m(c,a){s[e].m(c,a),p(c,n,a),i=!0},p(c,a){let f=e;e=l(c),e!==f&&(x(),d(s[f],1,1,()=>{s[f]=null}),F(),r=s[e],r||(r=s[e]=o[e](c),r.c()),u(r,1),r.m(n.parentNode,n))},i(c){i||(u(r),i=!0)},o(c){d(r),i=!1},d(c){c&&g(n),s[e].d(c)}}}function $i(t){let e;return{c(){e=R("Close")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function vi(t){let e,r,n,i;return e=new we({props:{disabled:t[1],$$slots:{default:[ki]},$$scope:{ctx:t}}}),n=new we({props:{intent:"secondary",disabled:t[1],$$slots:{default:[$i]},$$scope:{ctx:t}}}),n.$on("click",function(){le(t[0])&&t[0].apply(this,arguments)}),{c(){w(e.$$.fragment),r=T(),w(n.$$.fragment)},m(o,s){I(e,o,s),p(o,r,s),I(n,o,s),i=!0},p(o,s){t=o;const l={};s&2&&(l.disabled=t[1]),s&258&&(l.$$scope={dirty:s,ctx:t}),e.$set(l);const c={};s&2&&(c.disabled=t[1]),s&256&&(c.$$scope={dirty:s,ctx:t}),n.$set(c)},i(o){i||(u(e.$$.fragment,o),u(n.$$.fragment,o),i=!0)},o(o){d(e.$$.fragment,o),d(n.$$.fragment,o),i=!1},d(o){o&&g(r),b(e,o),b(n,o)}}}function yi(t){let e,r;return e=new ke({props:{$$slots:{default:[vi]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&259&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Bi(t){let e,r,n,i,o,s,l,c,a;return r=new Ve({props:{$$slots:{default:[Ei]},$$scope:{ctx:t}}}),i=new fe({props:{$$slots:{default:[Ii]},$$scope:{ctx:t}}}),s=new Je({props:{$$slots:{default:[yi]},$$scope:{ctx:t}}}),{c(){e=k("form"),w(r.$$.fragment),n=T(),w(i.$$.fragment),o=T(),w(s.$$.fragment),_(e,"class","svelte-favd20")},m(f,m){p(f,e,m),I(r,e,null),D(e,n),I(i,e,null),D(e,o),I(s,e,null),l=!0,c||(a=Ae(e,"submit",ot(t[5])),c=!0)},p(f,[m]){const E={};m&256&&(E.$$scope={dirty:m,ctx:f}),r.$set(E);const y={};m&284&&(y.$$scope={dirty:m,ctx:f}),i.$set(y);const A={};m&259&&(A.$$scope={dirty:m,ctx:f}),s.$set(A)},i(f){l||(u(r.$$.fragment,f),u(i.$$.fragment,f),u(s.$$.fragment,f),l=!0)},o(f){d(r.$$.fragment,f),d(i.$$.fragment,f),d(s.$$.fragment,f),l=!1},d(f){f&&g(e),b(r),b(i),b(s),c=!1,a()}}}function Di(t,e,r){let n,i,o,{onContinue:s}=e,{onClose:l}=e,{processing:c}=e;const a=async()=>{n.trim()===""?r(2,i="You need to provide your email address to continue."):s({email:n})};function f(){n=this.value,r(3,n)}return t.$$set=m=>{"onContinue"in m&&r(6,s=m.onContinue),"onClose"in m&&r(0,l=m.onClose),"processing"in m&&r(1,c=m.processing)},t.$$.update=()=>{t.$$.dirty&4&&r(4,o=i?"error":"")},r(3,n=""),r(2,i=""),[l,c,i,n,o,a,s,f]}class Ci extends N{constructor(e){super(),U(this,e,Di,Bi,P,{onContinue:6,onClose:0,processing:1},hi)}}function Mi(t){S(t,"svelte-17tslso",".rcb-modal-backdrop.svelte-17tslso{position:fixed;top:0;left:0;right:0;min-width:100%;width:100vw;width:100dvw;min-height:100%;height:100vh;height:100dvh;background-color:rgba(40, 40, 40, 0.75);display:flex;flex-direction:column;justify-content:space-around;z-index:1000001}")}function Qi(t){let e,r;const n=t[1].default,i=G(n,t,t[0],null);return{c(){e=k("div"),i&&i.c(),_(e,"class","rcb-modal-backdrop svelte-17tslso")},m(o,s){p(o,e,s),i&&i.m(e,null),r=!0},p(o,[s]){i&&i.p&&(!r||s&1)&&H(i,n,o,o[0],r?Y(n,o[0],s,null):K(o[0]),null)},i(o){r||(u(i,o),r=!0)},o(o){d(i,o),r=!1},d(o){o&&g(e),i&&i.d(o)}}}function Pi(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(0,i=o.$$scope)},[i,n]}class Ti extends N{constructor(e){super(),U(this,e,Pi,Qi,P,{},Mi)}}function Ui(t){S(t,"svelte-ioxu5d",".rcb-modal-container.svelte-ioxu5d{width:100%}.rcb-modal-main.svelte-ioxu5d{box-sizing:border-box;border-radius:8px;background-color:var(--rc-color-white);color:var(--rc-color-grey-text-dark);min-height:460px;padding:40px;flex-direction:column;display:flex}.rcb-modal-dark.svelte-ioxu5d{background-color:var(--rc-color-grey-text-dark);color:var(--rc-color-white);min-height:0px}@media screen and (max-width: 960px){.rcb-modal-container.svelte-ioxu5d{width:calc(100% - 32px);min-width:300px;max-width:640px;margin:auto}.rcb-modal-main.svelte-ioxu5d,.rcb-modal-dark.svelte-ioxu5d{min-width:300px;max-width:640px;padding:32px}}")}function Ni(t){let e,r,n,i;const o=t[2].default,s=G(o,t,t[1],null);return{c(){e=k("div"),r=k("main"),s&&s.c(),_(r,"class",n=_e(`rcb-modal-main ${t[0]?"rcb-modal-dark":""}`)+" svelte-ioxu5d"),_(e,"class","rcb-modal-container svelte-ioxu5d")},m(l,c){p(l,e,c),D(e,r),s&&s.m(r,null),i=!0},p(l,[c]){s&&s.p&&(!i||c&2)&&H(s,o,l,l[1],i?Y(o,l[1],c,null):K(l[1]),null),(!i||c&1&&n!==(n=_e(`rcb-modal-main ${l[0]?"rcb-modal-dark":""}`)+" svelte-ioxu5d"))&&_(r,"class",n)},i(l){i||(u(s,l),i=!0)},o(l){d(s,l),i=!1},d(l){l&&g(e),s&&s.d(l)}}}function Ri(t,e,r){let{$$slots:n={},$$scope:i}=e,{dark:o=!1}=e;return t.$$set=s=>{"dark"in s&&r(0,o=s.dark),"$$scope"in s&&r(1,i=s.$$scope)},[o,i,n]}class Si extends N{constructor(e){super(),U(this,e,Ri,Ni,P,{dark:0},Ui)}}function Oi(t){let e;const r=t[1].default,n=G(r,t,t[2],null);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&4)&&H(n,r,i,i[2],e?Y(r,i[2],o,null):K(i[2]),null)},i(i){e||(u(n,i),e=!0)},o(i){d(n,i),e=!1},d(i){n&&n.d(i)}}}function Li(t){let e,r;return e=new Ti({props:{$$slots:{default:[xi]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&4&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function xi(t){let e;const r=t[1].default,n=G(r,t,t[2],null);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&4)&&H(n,r,i,i[2],e?Y(r,i[2],o,null):K(i[2]),null)},i(i){e||(u(n,i),e=!0)},o(i){d(n,i),e=!1},d(i){n&&n.d(i)}}}function Fi(t){let e,r,n,i;const o=[Li,Oi],s=[];function l(c,a){return c[0]?0:1}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=ne()},m(c,a){s[e].m(c,a),p(c,n,a),i=!0},p(c,[a]){let f=e;e=l(c),e===f?s[e].p(c,a):(x(),d(s[f],1,1,()=>{s[f]=null}),F(),r=s[e],r?r.p(c,a):(r=s[e]=o[e](c),r.c()),u(r,1),r.m(n.parentNode,n))},i(c){i||(u(r),i=!0)},o(c){d(r),i=!1},d(c){c&&g(n),s[e].d(c)}}}function Gi(t,e,r){let{$$slots:n={},$$scope:i}=e,{condition:o=!1}=e;return t.$$set=s=>{"condition"in s&&r(0,o=s.condition),"$$scope"in s&&r(2,i=s.$$scope)},[o,n,i]}class Yi extends N{constructor(e){super(),U(this,e,Gi,Fi,P,{condition:0})}}const Hi=t=>({}),yt=t=>({});function Ki(t){let e,r;const n=t[1].header,i=G(n,t,t[2],yt),o=t[1].default,s=G(o,t,t[2],null);return{c(){i&&i.c(),e=T(),s&&s.c()},m(l,c){i&&i.m(l,c),p(l,e,c),s&&s.m(l,c),r=!0},p(l,c){i&&i.p&&(!r||c&4)&&H(i,n,l,l[2],r?Y(n,l[2],c,Hi):K(l[2]),yt),s&&s.p&&(!r||c&4)&&H(s,o,l,l[2],r?Y(o,l[2],c,null):K(l[2]),null)},i(l){r||(u(i,l),u(s,l),r=!0)},o(l){d(i,l),d(s,l),r=!1},d(l){l&&g(e),i&&i.d(l),s&&s.d(l)}}}function qi(t){let e,r;return e=new Si({props:{dark:t[0],$$slots:{default:[Ki]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const o={};i&1&&(o.dark=n[0]),i&4&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function ji(t,e,r){let{$$slots:n={},$$scope:i}=e,{dark:o=!1}=e;return t.$$set=s=>{"dark"in s&&r(0,o=s.dark),"$$scope"in s&&r(2,i=s.$$scope)},[o,n,i]}class Bt extends N{constructor(e){super(),U(this,e,ji,qi,P,{dark:0})}}var oe=(t=>(t[t.UnknownError=0]="UnknownError",t[t.UserCancelledError=1]="UserCancelledError",t[t.StoreProblemError=2]="StoreProblemError",t[t.PurchaseNotAllowedError=3]="PurchaseNotAllowedError",t[t.PurchaseInvalidError=4]="PurchaseInvalidError",t[t.ProductNotAvailableForPurchaseError=5]="ProductNotAvailableForPurchaseError",t[t.ProductAlreadyPurchasedError=6]="ProductAlreadyPurchasedError",t[t.ReceiptAlreadyInUseError=7]="ReceiptAlreadyInUseError",t[t.InvalidReceiptError=8]="InvalidReceiptError",t[t.MissingReceiptFileError=9]="MissingReceiptFileError",t[t.NetworkError=10]="NetworkError",t[t.InvalidCredentialsError=11]="InvalidCredentialsError",t[t.UnexpectedBackendResponseError=12]="UnexpectedBackendResponseError",t[t.InvalidAppUserIdError=14]="InvalidAppUserIdError",t[t.OperationAlreadyInProgressError=15]="OperationAlreadyInProgressError",t[t.UnknownBackendError=16]="UnknownBackendError",t[t.InvalidAppleSubscriptionKeyError=17]="InvalidAppleSubscriptionKeyError",t[t.IneligibleError=18]="IneligibleError",t[t.InsufficientPermissionsError=19]="InsufficientPermissionsError",t[t.PaymentPendingError=20]="PaymentPendingError",t[t.InvalidSubscriberAttributesError=21]="InvalidSubscriberAttributesError",t[t.LogOutWithAnonymousUserError=22]="LogOutWithAnonymousUserError",t[t.ConfigurationError=23]="ConfigurationError",t[t.UnsupportedError=24]="UnsupportedError",t[t.EmptySubscriberAttributesError=25]="EmptySubscriberAttributesError",t[t.CustomerInfoError=28]="CustomerInfoError",t[t.SignatureVerificationError=36]="SignatureVerificationError",t))(oe||{});class Se{static getPublicMessage(e){switch(e){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.";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."}}static getErrorCodeForBackendErrorCode(e){switch(e){case 7101:return 2;case 7102:return 7;case 7103:return 8;case 7107:case 7224:case 7225:return 11;case 7105:case 7106:return 4;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:return 12;case 7662:return 24}}static convertCodeToBackendErrorCode(e){return e in Dt?e:null}static convertPurchaseFlowErrorCodeToErrorCode(e){switch(e){case O.ErrorSettingUpPurchase:return 2;case O.ErrorChargingPayment:return 20;case O.NetworkError:return 10;case O.MissingEmailError:return 4;case O.StripeError:return 2;case O.UnknownError:return 0}}}var Dt=(t=>(t[t.BackendInvalidPlatform=7e3]="BackendInvalidPlatform",t[t.BackendStoreProblem=7101]="BackendStoreProblem",t[t.BackendCannotTransferPurchase=7102]="BackendCannotTransferPurchase",t[t.BackendInvalidReceiptToken=7103]="BackendInvalidReceiptToken",t[t.BackendInvalidAppStoreSharedSecret=7104]="BackendInvalidAppStoreSharedSecret",t[t.BackendInvalidPaymentModeOrIntroPriceNotProvided=7105]="BackendInvalidPaymentModeOrIntroPriceNotProvided",t[t.BackendProductIdForGoogleReceiptNotProvided=7106]="BackendProductIdForGoogleReceiptNotProvided",t[t.BackendInvalidPlayStoreCredentials=7107]="BackendInvalidPlayStoreCredentials",t[t.BackendInternalServerError=7110]="BackendInternalServerError",t[t.BackendEmptyAppUserId=7220]="BackendEmptyAppUserId",t[t.BackendInvalidAuthToken=7224]="BackendInvalidAuthToken",t[t.BackendInvalidAPIKey=7225]="BackendInvalidAPIKey",t[t.BackendBadRequest=7226]="BackendBadRequest",t[t.BackendPlayStoreQuotaExceeded=7229]="BackendPlayStoreQuotaExceeded",t[t.BackendPlayStoreInvalidPackageName=7230]="BackendPlayStoreInvalidPackageName",t[t.BackendPlayStoreGenericError=7231]="BackendPlayStoreGenericError",t[t.BackendUserIneligibleForPromoOffer=7232]="BackendUserIneligibleForPromoOffer",t[t.BackendInvalidAppleSubscriptionKey=7234]="BackendInvalidAppleSubscriptionKey",t[t.BackendInvalidSubscriberAttributes=7263]="BackendInvalidSubscriberAttributes",t[t.BackendInvalidSubscriberAttributesBody=7264]="BackendInvalidSubscriberAttributesBody",t[t.BackendProductIDsMalformed=7662]="BackendProductIDsMalformed",t))(Dt||{});class Z extends Error{constructor(r,n,i){super(n);Q(this,"toString",()=>`PurchasesError(code: ${oe[this.errorCode]}, message: ${this.message})`);this.errorCode=r,this.underlyingErrorMessage=i}static getForBackendError(r,n){const i=Se.getErrorCodeForBackendErrorCode(r);return new Z(i,Se.getPublicMessage(i),n)}static getForPurchasesFlowError(r){return new Z(Se.convertPurchaseFlowErrorCodeToErrorCode(r.errorCode),r.message,r.underlyingErrorMessage)}}class Ct extends Error{constructor(){super("Purchases must be configured before calling getInstance")}}const Ji="0.1.2",de="https://api.revenuecat.com";var Oe;(function(t){t[t.CONTINUE=100]="CONTINUE",t[t.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",t[t.PROCESSING=102]="PROCESSING",t[t.EARLY_HINTS=103]="EARLY_HINTS",t[t.OK=200]="OK",t[t.CREATED=201]="CREATED",t[t.ACCEPTED=202]="ACCEPTED",t[t.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",t[t.NO_CONTENT=204]="NO_CONTENT",t[t.RESET_CONTENT=205]="RESET_CONTENT",t[t.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",t[t.MULTI_STATUS=207]="MULTI_STATUS",t[t.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",t[t.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",t[t.MOVED_TEMPORARILY=302]="MOVED_TEMPORARILY",t[t.SEE_OTHER=303]="SEE_OTHER",t[t.NOT_MODIFIED=304]="NOT_MODIFIED",t[t.USE_PROXY=305]="USE_PROXY",t[t.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",t[t.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",t[t.BAD_REQUEST=400]="BAD_REQUEST",t[t.UNAUTHORIZED=401]="UNAUTHORIZED",t[t.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",t[t.FORBIDDEN=403]="FORBIDDEN",t[t.NOT_FOUND=404]="NOT_FOUND",t[t.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",t[t.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",t[t.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",t[t.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",t[t.CONFLICT=409]="CONFLICT",t[t.GONE=410]="GONE",t[t.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",t[t.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",t[t.REQUEST_TOO_LONG=413]="REQUEST_TOO_LONG",t[t.REQUEST_URI_TOO_LONG=414]="REQUEST_URI_TOO_LONG",t[t.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",t[t.REQUESTED_RANGE_NOT_SATISFIABLE=416]="REQUESTED_RANGE_NOT_SATISFIABLE",t[t.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",t[t.IM_A_TEAPOT=418]="IM_A_TEAPOT",t[t.INSUFFICIENT_SPACE_ON_RESOURCE=419]="INSUFFICIENT_SPACE_ON_RESOURCE",t[t.METHOD_FAILURE=420]="METHOD_FAILURE",t[t.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",t[t.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",t[t.LOCKED=423]="LOCKED",t[t.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",t[t.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",t[t.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",t[t.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",t[t.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",t[t.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",t[t.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",t[t.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",t[t.BAD_GATEWAY=502]="BAD_GATEWAY",t[t.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",t[t.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",t[t.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",t[t.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",t[t.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"})(Oe||(Oe={}));function We(t){return t?t.startsWith("rcb_sb_"):!1}async function me(t,e,r,n){const i=await fetch(t.url(),{method:t.method,headers:zi(e,n),body:Wi(r)});return await Vi(i,t),await i.json()}async function Vi(t,e){const r=t.status;if(r>=Oe.INTERNAL_SERVER_ERROR)ze(e,r,await t.text());else if(r>=Oe.BAD_REQUEST){const n=await t.json(),i=n?JSON.stringify(n):null,o=n==null?void 0:n.code,s=n==null?void 0:n.message;if(o!=null){const l=Se.convertCodeToBackendErrorCode(o);if(l==null)ze(e,r,i);else throw Z.getForBackendError(l,s)}else ze(e,r,i)}}function ze(t,e,r){throw new Z(oe.UnknownBackendError,`Unknown backend error. Request: ${t.name}. Status code: ${e}. Body: ${r}.`)}function Wi(t){return t==null?null:JSON.stringify(t)}function zi(t,e){let r={Authorization:`Bearer ${t}`,"Content-Type":"application/json",Accept:"application/json","X-Platform":"web","X-Version":Ji,"X-Is-Sandbox":`${We(t)}`};return e!=null&&(r={...r,...e}),r}const Mt="/v1/subscribers",Le="/rcbilling/v1";class Xi{constructor(e){Q(this,"appUserId");Q(this,"method","GET");Q(this,"name","getOfferings");this.appUserId=e}url(){const e=encodeURIComponent(this.appUserId);return`${de}${Mt}/${e}/offerings`}}class Zi{constructor(){Q(this,"method","POST");Q(this,"name","subscribe")}url(){return`${de}${Le}/subscribe`}}class eo{constructor(e,r){Q(this,"method","GET");Q(this,"name","getProducts");Q(this,"appUserId");Q(this,"productIds");this.appUserId=e,this.productIds=r}url(){const e=encodeURIComponent(this.appUserId),r=this.productIds.map(encodeURIComponent).join("&id=");return`${de}${Le}/subscribers/${e}/products?id=${r}`}}class to{constructor(e){Q(this,"method","GET");Q(this,"name","getCustomerInfo");Q(this,"appUserId");this.appUserId=e}url(){const e=encodeURIComponent(this.appUserId);return`${de}${Mt}/${e}`}}class no{constructor(){Q(this,"method","GET");Q(this,"name","getBrandingInfo")}url(){return`${de}${Le}/branding`}}class ro{constructor(e){Q(this,"method","GET");Q(this,"name","getCheckoutStatus");Q(this,"operationSessionId");this.operationSessionId=e}url(){return`${de}${Le}/checkout/${this.operationSessionId}`}}class io{constructor(e){Q(this,"API_KEY");this.API_KEY=e}async getOfferings(e){return await me(new Xi(e),this.API_KEY)}async getCustomerInfo(e){return await me(new to(e),this.API_KEY)}async getProducts(e,r){return await me(new eo(e,r),this.API_KEY)}async getBrandingInfo(){return await me(new no,this.API_KEY)}async postSubscribe(e,r,n,i){return await me(new Zi,this.API_KEY,{app_user_id:e,product_id:r,email:n,presented_offering_identifier:i})}async getCheckoutStatus(e){return await me(new ro(e),this.API_KEY)}}const oo="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20opacity='0.5'%20clip-path='url(%23clip0_344_3390)'%3e%3cpath%20d='M7%2018C5.9%2018%205.01%2018.9%205.01%2020C5.01%2021.1%205.9%2022%207%2022C8.1%2022%209%2021.1%209%2020C9%2018.9%208.1%2018%207%2018ZM1%202V4H3L6.6%2011.59L5.25%2014.04C5.09%2014.32%205%2014.65%205%2015C5%2016.1%205.9%2017%207%2017H19V15H7.42C7.28%2015%207.17%2014.89%207.17%2014.75L7.2%2014.63L8.1%2013H15.55C16.3%2013%2016.96%2012.59%2017.3%2011.97L20.88%205.48C20.96%205.34%2021%205.17%2021%205C21%204.45%2020.55%204%2020%204H5.21L4.27%202H1ZM17%2018C15.9%2018%2015.01%2018.9%2015.01%2020C15.01%2021.1%2015.9%2022%2017%2022C18.1%2022%2019%2021.1%2019%2020C19%2018.9%2018.1%2018%2017%2018Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_344_3390'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";function so(t){let e,r;return{c(){e=k("img"),te(e.src,r=oo)||_(e,"src",r),_(e,"alt","icon"),_(e,"class","rcb-ui-asset-icon")},m(n,i){p(n,e,i)},p:v,i:v,o:v,d(n){n&&g(e)}}}class lo extends N{constructor(e){super(),U(this,e,null,so,P,{})}}function co(t){S(t,"svelte-1rhrjxe","div.svelte-1rhrjxe{background-color:var(--rc-color-warning);color:var(--rc-color-grey-text-dark);font-size:10px;font-weight:bold;text-transform:uppercase;padding:4px 10px;line-height:10px;border-radius:9px;margin:0px;margin-left:16px}")}function ao(t){let e;return{c(){e=k("div"),e.textContent="Sandbox",_(e,"class","svelte-1rhrjxe")},m(r,n){p(r,e,n)},p:v,i:v,o:v,d(r){r&&g(e)}}}class uo extends N{constructor(e){super(),U(this,e,null,ao,P,{},co)}}function fo(t){S(t,"svelte-13pdaik",`.rcb-ui-container.svelte-13pdaik{color-scheme:none;font-size:16px;line-height:1.5em;font-weight:400;font-family:-apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu,
|
|
7
|
-
Cantarell, "Open Sans", "Helvetica Neue", sans-serif}.rcb-ui-layout.svelte-13pdaik{width:100vw;width:100dvw;margin-right:auto;display:flex;justify-content:center;align-items:flex-start;position:relative;padding:0px 80px;box-sizing:border-box}.rcb-ui-aside.svelte-13pdaik{margin-right:16px;flex:320px 1 0;max-width:480px}.rcb-ui-main.svelte-13pdaik{flex:480px 1 0;max-width:640px}@media screen and (max-width: 960px){.rcb-ui-layout.svelte-13pdaik{flex-direction:column;align-items:center;justify-content:center;height:100%;min-width:100%}.rcb-ui-aside.svelte-13pdaik{margin-right:0;margin-bottom:16px;min-width:100%;display:flex;flex-direction:column;align-items:center;flex:none;max-width:none}.rcb-ui-main.svelte-13pdaik{flex:none;max-width:none;min-width:100%}}@media screen and (max-width: 960px) and (max-height: 960px){.rcb-ui-layout.svelte-13pdaik{overflow-y:scroll;justify-content:flex-start;padding:16px 0px}}`)}function Qt(t){let e,r,n;return r=new Bt({props:{dark:!0,$$slots:{header:[Ao],default:[mo]},$$scope:{ctx:t}}}),{c(){e=k("div"),w(r.$$.fragment),_(e,"class","rcb-ui-aside svelte-13pdaik")},m(i,o){p(i,e,o),I(r,e,null),n=!0},p(i,o){const s={};o&8388622&&(s.$$scope={dirty:o,ctx:i}),r.$set(s)},i(i){n||(u(r.$$.fragment,i),n=!0)},o(i){d(r.$$.fragment,i),n=!1},d(i){i&&g(e),b(r)}}}function Pt(t){let e,r;return e=new ft({props:{productDetails:t[2]}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&4&&(o.productDetails=n[2]),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function mo(t){let e,r,n=t[2]&&Pt(t);return{c(){n&&n.c(),e=ne()},m(i,o){n&&n.m(i,o),p(i,e,o),r=!0},p(i,o){i[2]?n?(n.p(i,o),o&4&&u(n,1)):(n=Pt(i),n.c(),u(n,1),n.m(e.parentNode,e)):n&&(x(),d(n,1,1,()=>{n=null}),F())},i(i){r||(u(n),r=!0)},o(i){d(n),r=!1},d(i){i&&g(e),n&&n.d(i)}}}function go(t){let e,r;return e=new lo({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function po(t){let e,r;return e=new uo({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function _o(t){let e,r,n,i,o,s,l;e=new gt({props:{brandingInfo:t[3]}});const c=[po,go],a=[];function f(m,E){return E&2&&(n=null),n==null&&(n=!!m[1].isSandbox()),n?0:1}return i=f(t,-1),o=a[i]=c[i](t),{c(){w(e.$$.fragment),r=T(),o.c(),s=ne()},m(m,E){I(e,m,E),p(m,r,E),a[i].m(m,E),p(m,s,E),l=!0},p(m,E){const y={};E&8&&(y.brandingInfo=m[3]),e.$set(y);let A=i;i=f(m,E),i!==A&&(x(),d(a[A],1,1,()=>{a[A]=null}),F(),o=a[i],o||(o=a[i]=c[i](m),o.c()),u(o,1),o.m(s.parentNode,s))},i(m){l||(u(e.$$.fragment,m),u(o),l=!0)},o(m){d(e.$$.fragment,m),d(o),l=!1},d(m){m&&(g(r),g(s)),b(e,m),a[i].d(m)}}}function Ao(t){let e,r;return e=new Ve({props:{slot:"header",$$slots:{default:[_o]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&8388618&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Tt(t){let e,r;return e=new ft({props:{productDetails:t[2]}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&4&&(o.productDetails=n[2]),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Ut(t){let e,r;return e=new je({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Nt(t){let e,r;return e=new Ci({props:{onContinue:t[10],onClose:t[9],processing:t[6]==="processing-auth-info"}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&64&&(o.processing=n[6]==="processing-auth-info"),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Rt(t){let e,r;return e=new Ai({props:{paymentInfoCollectionMetadata:t[4],onContinue:t[10],onClose:t[9],onError:t[11],processing:t[6]==="polling-purchase-status"}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&16&&(o.paymentInfoCollectionMetadata=n[4]),i&64&&(o.processing=n[6]==="polling-purchase-status"),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function St(t){let e,r;return e=new je({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Ot(t){var n;let e,r;return e=new br({props:{brandingInfo:t[3],lastError:t[5]??new j(O.UnknownError,"Unknown error without state set."),supportEmail:(n=t[3])==null?void 0:n.seller_company_support_email,onContinue:t[12]}}),{c(){w(e.$$.fragment)},m(i,o){I(e,i,o),r=!0},p(i,o){var l;const s={};o&8&&(s.brandingInfo=i[3]),o&32&&(s.lastError=i[5]??new j(O.UnknownError,"Unknown error without state set.")),o&8&&(s.supportEmail=(l=i[3])==null?void 0:l.seller_company_support_email),e.$set(s)},i(i){r||(u(e.$$.fragment,i),r=!0)},o(i){d(e.$$.fragment,i),r=!1},d(i){b(e,i)}}}function Lt(t){let e,r;return e=new Mr({props:{brandingInfo:t[3],onContinue:t[10]}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&8&&(o.brandingInfo=n[3]),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function ho(t){let e,r,n,i,o,s,l,c,a=t[6]==="present-offer"&&t[2]&&Tt(t),f=t[6]==="present-offer"&&!t[2]&&Ut(),m=(t[6]==="needs-auth-info"||t[6]==="processing-auth-info")&&Nt(t),E=t[4]&&(t[6]==="needs-payment-info"||t[6]==="polling-purchase-status")&&Rt(t),y=t[6]==="loading"&&St(),A=t[6]==="error"&&Ot(t),M=t[6]==="success"&&Lt(t);return{c(){a&&a.c(),e=T(),f&&f.c(),r=T(),m&&m.c(),n=T(),E&&E.c(),i=T(),y&&y.c(),o=T(),A&&A.c(),s=T(),M&&M.c(),l=ne()},m(h,B){a&&a.m(h,B),p(h,e,B),f&&f.m(h,B),p(h,r,B),m&&m.m(h,B),p(h,n,B),E&&E.m(h,B),p(h,i,B),y&&y.m(h,B),p(h,o,B),A&&A.m(h,B),p(h,s,B),M&&M.m(h,B),p(h,l,B),c=!0},p(h,B){h[6]==="present-offer"&&h[2]?a?(a.p(h,B),B&68&&u(a,1)):(a=Tt(h),a.c(),u(a,1),a.m(e.parentNode,e)):a&&(x(),d(a,1,1,()=>{a=null}),F()),h[6]==="present-offer"&&!h[2]?f?B&68&&u(f,1):(f=Ut(),f.c(),u(f,1),f.m(r.parentNode,r)):f&&(x(),d(f,1,1,()=>{f=null}),F()),h[6]==="needs-auth-info"||h[6]==="processing-auth-info"?m?(m.p(h,B),B&64&&u(m,1)):(m=Nt(h),m.c(),u(m,1),m.m(n.parentNode,n)):m&&(x(),d(m,1,1,()=>{m=null}),F()),h[4]&&(h[6]==="needs-payment-info"||h[6]==="polling-purchase-status")?E?(E.p(h,B),B&80&&u(E,1)):(E=Rt(h),E.c(),u(E,1),E.m(i.parentNode,i)):E&&(x(),d(E,1,1,()=>{E=null}),F()),h[6]==="loading"?y?B&64&&u(y,1):(y=St(),y.c(),u(y,1),y.m(o.parentNode,o)):y&&(x(),d(y,1,1,()=>{y=null}),F()),h[6]==="error"?A?(A.p(h,B),B&64&&u(A,1)):(A=Ot(h),A.c(),u(A,1),A.m(s.parentNode,s)):A&&(x(),d(A,1,1,()=>{A=null}),F()),h[6]==="success"?M?(M.p(h,B),B&64&&u(M,1)):(M=Lt(h),M.c(),u(M,1),M.m(l.parentNode,l)):M&&(x(),d(M,1,1,()=>{M=null}),F())},i(h){c||(u(a),u(f),u(m),u(E),u(y),u(A),u(M),c=!0)},o(h){d(a),d(f),d(m),d(E),d(y),d(A),d(M),c=!1},d(h){h&&(g(e),g(r),g(n),g(i),g(o),g(s),g(l)),a&&a.d(h),f&&f.d(h),m&&m.d(h),E&&E.d(h),y&&y.d(h),A&&A.d(h),M&&M.d(h)}}}function Eo(t){let e,r=t[8].includes(t[6]),n,i,o,s,l=r&&Qt(t);return o=new Bt({props:{$$slots:{default:[ho]},$$scope:{ctx:t}}}),{c(){e=k("div"),l&&l.c(),n=T(),i=k("div"),w(o.$$.fragment),_(i,"class","rcb-ui-main svelte-13pdaik"),_(e,"class","rcb-ui-layout svelte-13pdaik"),_(e,"style",t[7])},m(c,a){p(c,e,a),l&&l.m(e,null),D(e,n),D(e,i),I(o,i,null),s=!0},p(c,a){a&64&&(r=c[8].includes(c[6])),r?l?(l.p(c,a),a&64&&u(l,1)):(l=Qt(c),l.c(),u(l,1),l.m(e,n)):l&&(x(),d(l,1,1,()=>{l=null}),F());const f={};a&8388732&&(f.$$scope={dirty:a,ctx:c}),o.$set(f)},i(c){s||(u(l),u(o.$$.fragment,c),s=!0)},o(c){d(l),d(o.$$.fragment,c),s=!1},d(c){c&&g(e),l&&l.d(),b(o)}}}function Io(t){let e,r,n;return r=new Yi({props:{condition:t[0],$$slots:{default:[Eo]},$$scope:{ctx:t}}}),{c(){e=k("div"),w(r.$$.fragment),_(e,"class","rcb-ui-container svelte-13pdaik")},m(i,o){p(i,e,o),I(r,e,null),n=!0},p(i,[o]){const s={};o&1&&(s.condition=i[0]),o&8388734&&(s.$$scope={dirty:o,ctx:i}),r.$set(s)},i(i){n||(u(r.$$.fragment,i),n=!0)},o(i){d(r.$$.fragment,i),n=!1},d(i){i&&g(e),b(r)}}}function bo(t,e,r){var xt;let{asModal:n=!0}=e,{customerEmail:i}=e,{appUserId:o}=e,{rcPackage:s}=e,{onFinished:l}=e,{onError:c}=e,{onClose:a}=e,{purchases:f}=e,{backend:m}=e,{purchaseOperationHelper:E}=e;const y=Object.entries(ye).map(([C,Ze])=>`--rc-color-${C}: ${Ze}`).join("; ");let A=null,M=null,h=null,B=null;const J=((xt=s.rcBillingProduct)==null?void 0:xt.identifier)??null;let $="present-offer";const Be=["present-offer","needs-auth-info","processing-auth-info","needs-payment-info","polling-purchase-status","loading"];Me(async()=>{if(r(2,A=s.rcBillingProduct),r(3,M=await m.getBrandingInfo()),$==="present-offer"){i?ge():r(6,$="needs-auth-info");return}});const Fe=()=>{a()},ge=()=>{if(J===null){X(new j(O.ErrorSettingUpPurchase,"Product ID was not set before purchase."));return}else $==="present-offer"&&r(6,$="loading");if(!i){X(new j(O.MissingEmailError));return}E.startPurchase(o,J,i,s.rcBillingProduct.presentedOfferingIdentifier).then(C=>{if(C.next_action==="collect_payment_info"){r(6,$="needs-payment-info"),r(4,h=C);return}if(C.next_action==="completed"){r(6,$="success");return}}).catch(C=>{X(new j(O.ErrorSettingUpPurchase,C.message,C.underlyingErrorMessage))})},ee=C=>{if($==="needs-auth-info"){C&&(r(13,i=C.email),r(6,$="processing-auth-info")),ge();return}if($==="needs-payment-info"){r(6,$="polling-purchase-status"),E.pollCurrentPurchaseForCompletion().then(()=>{r(6,$="success")}).catch(Ze=>{X(Ze)});return}if($==="success"||$==="error"){l();return}r(6,$="success")},X=C=>{r(5,B=C),r(6,$="error")},Ro=()=>{c(B??new j(O.UnknownError,"Unknown error without state set."))};return t.$$set=C=>{"asModal"in C&&r(0,n=C.asModal),"customerEmail"in C&&r(13,i=C.customerEmail),"appUserId"in C&&r(14,o=C.appUserId),"rcPackage"in C&&r(15,s=C.rcPackage),"onFinished"in C&&r(16,l=C.onFinished),"onError"in C&&r(17,c=C.onError),"onClose"in C&&r(18,a=C.onClose),"purchases"in C&&r(1,f=C.purchases),"backend"in C&&r(19,m=C.backend),"purchaseOperationHelper"in C&&r(20,E=C.purchaseOperationHelper)},[n,f,A,M,h,B,$,y,Be,Fe,ee,X,Ro,i,o,s,l,c,a,m,E]}class wo extends N{constructor(e){super(),U(this,e,bo,Io,P,{asModal:0,customerEmail:13,appUserId:14,rcPackage:15,onFinished:16,onError:17,onClose:18,purchases:1,backend:19,purchaseOperationHelper:20},fo)}}function ko(t){return t.expires_date==null?!0:new Date(t.expires_date)>new Date}function $o(t,e,r,n){const i=e.product_identifier;if(i in r)return vo(t,e,r[i]);if(i in n)return yo(t,e,n[i]);throw new Z(oe.CustomerInfoError,"Could not find entitlement product in subscriptions or non-subscriptions.")}function vo(t,e,r){return{identifier:t,isActive:ko(e),willRenew:Co(e,r),store:(r==null?void 0:r.store)??"unknown",latestPurchaseDate:new Date(e.purchase_date),originalPurchaseDate:new Date(e.purchase_date),expirationDate:xe(e.expires_date),productIdentifier:e.product_identifier,unsubscribeDetectedAt:xe(r==null?void 0:r.unsubscribe_detected_at),billingIssueDetectedAt:xe(r==null?void 0:r.billing_issues_detected_at),isSandbox:(r==null?void 0:r.is_sandbox)??!1,periodType:(r==null?void 0:r.period_type)??"normal"}}function yo(t,e,r){return{identifier:t,isActive:!0,willRenew:!1,store:r.store,latestPurchaseDate:new Date(e.purchase_date),originalPurchaseDate:new Date(r.original_purchase_date),expirationDate:null,productIdentifier:e.product_identifier,unsubscribeDetectedAt:null,billingIssueDetectedAt:null,isSandbox:r.is_sandbox,periodType:"normal"}}function Bo(t,e,r){const n={},i={};for(const o in t){const s=$o(o,t[o],e,r);n[o]=s,s.isActive&&(i[o]=s)}return{all:n,active:i}}function xe(t){return t==null?null:new Date(t)}function Do(t){const e=Qo(t),r=t.subscriber,n=To(r.non_subscriptions);return{entitlements:Bo(r.entitlements,r.subscriptions,n),allExpirationDatesByProduct:e,allPurchaseDatesByProduct:Mo(t,n),activeSubscriptions:Po(e),managementURL:r.management_url,requestDate:new Date(t.request_date),firstSeenDate:new Date(r.first_seen),originalPurchaseDate:xe(r.original_purchase_date),originalAppUserId:t.subscriber.original_app_user_id}}function Co(t,e){if(e==null)return!1;const r=e.store=="promotional",n=t.expires_date==null,i=e.unsubscribe_detected_at!=null,o=e.billing_issues_detected_at!=null;return!(r||n||i||o)}function Mo(t,e){const r={};for(const n in t.subscriber.subscriptions){const i=t.subscriber.subscriptions[n];r[n]=new Date(i.purchase_date)}for(const n in e){const i=e[n].purchase_date;i==null?r[n]=null:r[n]=new Date(i)}return r}function Qo(t){const e={};for(const r in t.subscriber.subscriptions){const n=t.subscriber.subscriptions[r];n.expires_date==null?e[r]=null:e[r]=new Date(n.expires_date)}return e}function Po(t){const e=new Set,r=new Date;for(const n in t){const i=t[n];(i==null||i>r)&&e.add(n)}return e}function To(t){const e={};for(const r in t){if(t[r].length===0)continue;const n=t[r].length;e[r]=t[r][n-1]}return e}function Uo(t){if(!t.startsWith("rcb_"))throw new Z(oe.InvalidCredentialsError,"Invalid API key. Use your RevenueCat Billing API key.")}function No(t){if(new Set(["no_user","null","none","nil","(null)","NaN","\\x00","","unidentified","undefined","unknown"]).has(t)||t.includes("/"))throw new Z(oe.InvalidAppUserIdError,'Provided user id: "'+t+'" is not valid. See https://www.revenuecat.com/docs/customers/user-ids#tips-for-setting-app-user-ids for more information.')}const z=class z{constructor(e,r){Q(this,"_API_KEY");Q(this,"_appUserId");Q(this,"backend");Q(this,"purchaseOperationHelper");Q(this,"toOfferings",(e,r)=>{const n=e.offerings.find(l=>l.identifier===e.current_offering_id)??null,i={};r.product_details.forEach(l=>{i[l.identifier]=l});const o=n==null?null:et(n,i),s={};return e.offerings.forEach(l=>{const c=et(l,i);c!=null&&(s[l.identifier]=c)}),Object.keys(s).length==0&&W.debugLog("Empty offerings. Please make sure you've configured offerings correctly in the RevenueCat dashboard and that the products are properly configured."),{all:s,current:o}});this._API_KEY=e,this._appUserId=r,We(e)&&W.debugLog("Initializing Purchases SDK with sandbox API Key"),this.backend=new io(this._API_KEY),this.purchaseOperationHelper=new Bn(this.backend)}static setLogLevel(e){W.setLogLevel(e)}static getSharedInstance(){if(z.isConfigured())return z.instance;throw new Ct}static isConfigured(){return z.instance!==void 0}static configure(e,r){return z.instance!==void 0?(W.warnLog("Purchases is already initialized. Ignoring and returning existing instance."),z.getSharedInstance()):(Uo(e),No(r),z.instance=new z(e,r),z.getSharedInstance())}async getOfferings(){const e=this._appUserId,r=await this.backend.getOfferings(e),n=r.offerings.flatMap(o=>o.packages).map(o=>o.platform_product_identifier),i=await this.backend.getProducts(e,n);return this.logMissingProductIds(n,i.product_details),this.toOfferings(r,i)}async isEntitledTo(e){const r=await this.getCustomerInfo();return e in r.entitlements.active}purchasePackage(e,r,n){let i=n??document.getElementById("rcb-ui-root");if(i===null){const c=document.createElement("div");c.className="rcb-ui-root",document.body.appendChild(c),i=c}if(i===null)throw new Error("Could not generate a mount point for the billing widget");const o=i,s=!n,l=this._appUserId;return W.debugLog(`Presenting purchase form for package ${e.identifier}`),new Promise((c,a)=>{new wo({target:o,props:{appUserId:l,rcPackage:e,customerEmail:r,onFinished:async()=>{W.debugLog("Purchase finished"),o.innerHTML="",c({customerInfo:await this._getCustomerInfoForUserId(l)})},onClose:()=>{o.innerHTML="",W.debugLog("Purchase cancelled by user"),a(new Z(oe.UserCancelledError))},onError:f=>{o.innerHTML="",a(Z.getForPurchasesFlowError(f))},purchases:this,backend:this.backend,purchaseOperationHelper:this.purchaseOperationHelper,asModal:s}})})}async getCustomerInfo(){return await this._getCustomerInfoForUserId(this._appUserId)}getAppUserId(){return this._appUserId}async changeUser(e){return this._appUserId=e,await this.getCustomerInfo()}logMissingProductIds(e,r){const n={};r.forEach(o=>n[o.identifier]=o);const i=[];e.forEach(o=>{n[o]===void 0&&i.push(o)}),i.length>0&&W.debugLog(`Could not find product data for product ids:
|
|
6
|
+
-20px 0 #fff2;background:#fff2}}`)}function ri(t){let e;return{c(){e=k("div"),_(e,"class","processing svelte-rjmul6")},m(r,n){p(r,e,n)},p:v,i:v,o:v,d(r){r&&g(e)}}}class $t extends U{constructor(e){super(),N(this,e,null,ri,Q,{},ni)}}function ii(t){S(t,"svelte-1wxt892",".rcb-stripe-elements-container.svelte-1wxt892{width:100%;margin-top:32px;margin-bottom:24px}")}function oi(t){let e,r;return e=new je({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p:v,i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function si(t){let e,r,n,i,o,s;function l(a){t[9](a)}let c={stripe:t[3],clientSecret:t[4],loader:"always",theme:"stripe",variables:{borderRadius:"12px",fontSizeBase:"16px",fontSizeSm:"16px",spacingGridRow:"16px",colorText:ve["grey-text-dark"],focusBoxShadow:"none",colorDanger:ve.error},rules:{".Input":{boxShadow:"none",border:`2px solid ${ve["grey-ui-dark"]}`},".Input:focus":{border:`2px solid ${ve.focus}`,outline:"none"},".Label":{marginBottom:"8px",fontWeight:"500",lineHeight:"22px"},".Input--invalid":{boxShadow:"none"}},$$slots:{default:[pi]},$$scope:{ctx:t}};return t[2]!==void 0&&(c.elements=t[2]),r=new xr({props:c}),Pe.push(()=>mn(r,"elements",l)),{c(){e=k("form"),w(r.$$.fragment)},m(a,f){p(a,e,f),I(r,e,null),i=!0,o||(s=Ae(e,"submit",lt(t[5])),o=!0)},p(a,f){const m={};f&8&&(m.stripe=a[3]),f&2051&&(m.$$scope={dirty:f,ctx:a}),!n&&f&4&&(n=!0,m.elements=a[2],un(()=>n=!1)),r.$set(m)},i(a){i||(u(r.$$.fragment,a),i=!0)},o(a){d(r.$$.fragment,a),i=!1},d(a){a&&g(e),b(r),o=!1,s()}}}function li(t){let e,r,n,i;return n=new ti({}),{c(){e=k("div"),e.textContent="Secure Checkout",r=T(),w(n.$$.fragment)},m(o,s){p(o,e,s),p(o,r,s),I(n,o,s),i=!0},p:v,i(o){i||(u(n.$$.fragment,o),i=!0)},o(o){d(n.$$.fragment,o),i=!1},d(o){o&&(g(e),g(r)),b(n,o)}}}function ci(t){let e,r,n;return r=new Sr({}),{c(){e=k("div"),w(r.$$.fragment),_(e,"class","rcb-stripe-elements-container svelte-1wxt892")},m(i,o){p(i,e,o),I(r,e,null),n=!0},p:v,i(i){n||(u(r.$$.fragment,i),n=!0)},o(i){d(r.$$.fragment,i),n=!1},d(i){i&&g(e),b(r)}}}function ai(t){let e;return{c(){e=R("Pay")},m(r,n){p(r,e,n)},i:v,o:v,d(r){r&&g(e)}}}function ui(t){let e,r;return e=new $t({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function fi(t){let e,r,n,i;const o=[ui,ai],s=[];function l(c,a){return c[0]?0:1}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=ne()},m(c,a){s[e].m(c,a),p(c,n,a),i=!0},p(c,a){let f=e;e=l(c),e!==f&&(F(),d(s[f],1,1,()=>{s[f]=null}),G(),r=s[e],r||(r=s[e]=o[e](c),r.c()),u(r,1),r.m(n.parentNode,n))},i(c){i||(u(r),i=!0)},o(c){d(r),i=!1},d(c){c&&g(n),s[e].d(c)}}}function di(t){let e;return{c(){e=R("Close")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function mi(t){let e,r,n,i;return e=new be({props:{disabled:t[0],$$slots:{default:[fi]},$$scope:{ctx:t}}}),n=new be({props:{disabled:t[0],intent:"secondary",$$slots:{default:[di]},$$scope:{ctx:t}}}),n.$on("click",function(){se(t[1])&&t[1].apply(this,arguments)}),{c(){w(e.$$.fragment),r=T(),w(n.$$.fragment)},m(o,s){I(e,o,s),p(o,r,s),I(n,o,s),i=!0},p(o,s){t=o;const l={};s&1&&(l.disabled=t[0]),s&2049&&(l.$$scope={dirty:s,ctx:t}),e.$set(l);const c={};s&1&&(c.disabled=t[0]),s&2048&&(c.$$scope={dirty:s,ctx:t}),n.$set(c)},i(o){i||(u(e.$$.fragment,o),u(n.$$.fragment,o),i=!0)},o(o){d(e.$$.fragment,o),d(n.$$.fragment,o),i=!1},d(o){o&&g(r),b(e,o),b(n,o)}}}function gi(t){let e,r;return e=new we({props:{$$slots:{default:[mi]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&2051&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function pi(t){let e,r,n,i,o,s;return e=new Ve({props:{$$slots:{default:[li]},$$scope:{ctx:t}}}),n=new ue({props:{$$slots:{default:[ci]},$$scope:{ctx:t}}}),o=new Je({props:{$$slots:{default:[gi]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment),r=T(),w(n.$$.fragment),i=T(),w(o.$$.fragment)},m(l,c){I(e,l,c),p(l,r,c),I(n,l,c),p(l,i,c),I(o,l,c),s=!0},p(l,c){const a={};c&2048&&(a.$$scope={dirty:c,ctx:l}),e.$set(a);const f={};c&2048&&(f.$$scope={dirty:c,ctx:l}),n.$set(f);const m={};c&2051&&(m.$$scope={dirty:c,ctx:l}),o.$set(m)},i(l){s||(u(e.$$.fragment,l),u(n.$$.fragment,l),u(o.$$.fragment,l),s=!0)},o(l){d(e.$$.fragment,l),d(n.$$.fragment,l),d(o.$$.fragment,l),s=!1},d(l){l&&(g(r),g(i)),b(e,l),b(n,l),b(o,l)}}}function _i(t){let e,r,n,i;const o=[si,oi],s=[];function l(c,a){return c[3]&&c[4]?0:1}return r=l(t),n=s[r]=o[r](t),{c(){e=k("div"),n.c()},m(c,a){p(c,e,a),s[r].m(e,null),i=!0},p(c,[a]){let f=r;r=l(c),r===f?s[r].p(c,a):(F(),d(s[f],1,1,()=>{s[f]=null}),G(),n=s[r],n?n.p(c,a):(n=s[r]=o[r](c),n.c()),u(n,1),n.m(e,null))},i(c){i||(u(n),i=!0)},o(c){d(n),i=!1},d(c){c&&g(e),s[r].d()}}}function Ai(t,e,r){let{onClose:n}=e,{onContinue:i}=e,{onError:o}=e,{paymentInfoCollectionMetadata:s}=e,{processing:l=!1}=e;const c=s.data.client_secret;let a=null,f,m;Me(async()=>{const A=s.data.publishable_api_key,M=s.data.stripe_account_id;if(!A||!M)throw new Error("Stripe publishable key or account ID not found");r(3,a=await Jr(A,{stripeAccount:M}))});const E=async()=>{if(l||!a||!m)return;r(0,l=!0);const A=await a.confirmSetup({elements:m,redirect:"if_required"});A.error?(r(0,l=!1),o(new j(O.StripeError,A.error.message))):i()};function y(A){f=A,r(2,f)}return t.$$set=A=>{"onClose"in A&&r(1,n=A.onClose),"onContinue"in A&&r(6,i=A.onContinue),"onError"in A&&r(7,o=A.onError),"paymentInfoCollectionMetadata"in A&&r(8,s=A.paymentInfoCollectionMetadata),"processing"in A&&r(0,l=A.processing)},t.$$.update=()=>{t.$$.dirty&4&&f&&f._elements.length>0&&(m=f)},[l,n,f,a,c,E,i,o,s,y]}class hi extends U{constructor(e){super(),N(this,e,Ai,_i,Q,{onClose:1,onContinue:6,onError:7,paymentInfoCollectionMetadata:8,processing:0},ii)}}function Ei(t){S(t,"svelte-favd20","form.svelte-favd20.svelte-favd20{display:flex;flex-direction:column;min-height:100%;flex-grow:1}.form-container.svelte-favd20.svelte-favd20{display:flex;flex-direction:column;width:100%;margin-top:32px;margin-bottom:16px}.form-label.svelte-favd20.svelte-favd20{margin-top:8px;margin-bottom:8px;display:block;font-weight:500;line-height:22px}.form-input.error.svelte-favd20 input.svelte-favd20{border-color:var(--rc-color-error)}.form-error.svelte-favd20.svelte-favd20{margin-top:4px;font-size:16px;line-height:20px;min-height:40px;color:var(--rc-color-error)}input.svelte-favd20.svelte-favd20{width:100%;box-sizing:border-box;padding:8px;border:2px solid var(--rc-color-grey-ui-dark);border-radius:12px;font-size:16px;height:48px;padding:6px 14px}input.svelte-favd20.svelte-favd20:focus{outline:none;border:2px solid var(--rc-color-focus)}")}function Ii(t){let e;return{c(){e=R("Billing email address")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function vt(t){let e,r;return{c(){e=k("div"),r=R(t[2]),_(e,"class","form-error svelte-favd20")},m(n,i){p(n,e,i),D(e,r)},p(n,i){i&4&&ie(r,n[2])},d(n){n&&g(e)}}}function bi(t){let e,r,n,i,o,s,l,c,a,f=t[2]&&vt(t);return{c(){e=k("div"),r=k("div"),r.innerHTML='<label for="email">Email</label>',n=T(),i=k("div"),o=k("input"),l=T(),f&&f.c(),_(r,"class","form-label svelte-favd20"),_(o,"name","email"),_(o,"placeholder","john@appleseed.com"),_(o,"autocapitalize","off"),_(o,"class","svelte-favd20"),_(i,"class",s="form-input "+t[4]+" svelte-favd20"),_(e,"class","form-container svelte-favd20")},m(m,E){p(m,e,E),D(e,r),D(e,n),D(e,i),D(i,o),ct(o,t[3]),D(e,l),f&&f.m(e,null),c||(a=Ae(o,"input",t[7]),c=!0)},p(m,E){E&8&&o.value!==m[3]&&ct(o,m[3]),E&16&&s!==(s="form-input "+m[4]+" svelte-favd20")&&_(i,"class",s),m[2]?f?f.p(m,E):(f=vt(m),f.c(),f.m(e,null)):f&&(f.d(1),f=null)},d(m){m&&g(e),f&&f.d(),c=!1,a()}}}function wi(t){let e;return{c(){e=R("Continue")},m(r,n){p(r,e,n)},i:v,o:v,d(r){r&&g(e)}}}function ki(t){let e,r;return e=new $t({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function $i(t){let e,r,n,i;const o=[ki,wi],s=[];function l(c,a){return c[1]?0:1}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=ne()},m(c,a){s[e].m(c,a),p(c,n,a),i=!0},p(c,a){let f=e;e=l(c),e!==f&&(F(),d(s[f],1,1,()=>{s[f]=null}),G(),r=s[e],r||(r=s[e]=o[e](c),r.c()),u(r,1),r.m(n.parentNode,n))},i(c){i||(u(r),i=!0)},o(c){d(r),i=!1},d(c){c&&g(n),s[e].d(c)}}}function vi(t){let e;return{c(){e=R("Close")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function yi(t){let e,r,n,i;return e=new be({props:{disabled:t[1],$$slots:{default:[$i]},$$scope:{ctx:t}}}),n=new be({props:{intent:"secondary",disabled:t[1],$$slots:{default:[vi]},$$scope:{ctx:t}}}),n.$on("click",function(){se(t[0])&&t[0].apply(this,arguments)}),{c(){w(e.$$.fragment),r=T(),w(n.$$.fragment)},m(o,s){I(e,o,s),p(o,r,s),I(n,o,s),i=!0},p(o,s){t=o;const l={};s&2&&(l.disabled=t[1]),s&258&&(l.$$scope={dirty:s,ctx:t}),e.$set(l);const c={};s&2&&(c.disabled=t[1]),s&256&&(c.$$scope={dirty:s,ctx:t}),n.$set(c)},i(o){i||(u(e.$$.fragment,o),u(n.$$.fragment,o),i=!0)},o(o){d(e.$$.fragment,o),d(n.$$.fragment,o),i=!1},d(o){o&&g(r),b(e,o),b(n,o)}}}function Bi(t){let e,r;return e=new we({props:{$$slots:{default:[yi]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&259&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Di(t){let e,r,n,i,o,s,l,c,a;return r=new Ve({props:{$$slots:{default:[Ii]},$$scope:{ctx:t}}}),i=new ue({props:{$$slots:{default:[bi]},$$scope:{ctx:t}}}),s=new Je({props:{$$slots:{default:[Bi]},$$scope:{ctx:t}}}),{c(){e=k("form"),w(r.$$.fragment),n=T(),w(i.$$.fragment),o=T(),w(s.$$.fragment),_(e,"class","svelte-favd20")},m(f,m){p(f,e,m),I(r,e,null),D(e,n),I(i,e,null),D(e,o),I(s,e,null),l=!0,c||(a=Ae(e,"submit",lt(t[5])),c=!0)},p(f,[m]){const E={};m&256&&(E.$$scope={dirty:m,ctx:f}),r.$set(E);const y={};m&284&&(y.$$scope={dirty:m,ctx:f}),i.$set(y);const A={};m&259&&(A.$$scope={dirty:m,ctx:f}),s.$set(A)},i(f){l||(u(r.$$.fragment,f),u(i.$$.fragment,f),u(s.$$.fragment,f),l=!0)},o(f){d(r.$$.fragment,f),d(i.$$.fragment,f),d(s.$$.fragment,f),l=!1},d(f){f&&g(e),b(r),b(i),b(s),c=!1,a()}}}function Ci(t,e,r){let n,i,o,{onContinue:s}=e,{onClose:l}=e,{processing:c}=e;const a=async()=>{n.trim()===""?r(2,i="You need to provide your email address to continue."):s({email:n})};function f(){n=this.value,r(3,n)}return t.$$set=m=>{"onContinue"in m&&r(6,s=m.onContinue),"onClose"in m&&r(0,l=m.onClose),"processing"in m&&r(1,c=m.processing)},t.$$.update=()=>{t.$$.dirty&4&&r(4,o=i?"error":"")},r(3,n=""),r(2,i=""),[l,c,i,n,o,a,s,f]}class Mi extends U{constructor(e){super(),N(this,e,Ci,Di,Q,{onContinue:6,onClose:0,processing:1},Ei)}}function Pi(t){S(t,"svelte-17tslso",".rcb-modal-backdrop.svelte-17tslso{position:fixed;top:0;left:0;right:0;min-width:100%;width:100vw;width:100dvw;min-height:100%;height:100vh;height:100dvh;background-color:rgba(40, 40, 40, 0.75);display:flex;flex-direction:column;justify-content:space-around;z-index:1000001}")}function Qi(t){let e,r;const n=t[1].default,i=Y(n,t,t[0],null);return{c(){e=k("div"),i&&i.c(),_(e,"class","rcb-modal-backdrop svelte-17tslso")},m(o,s){p(o,e,s),i&&i.m(e,null),r=!0},p(o,[s]){i&&i.p&&(!r||s&1)&&K(i,n,o,o[0],r?H(n,o[0],s,null):q(o[0]),null)},i(o){r||(u(i,o),r=!0)},o(o){d(i,o),r=!1},d(o){o&&g(e),i&&i.d(o)}}}function Ti(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(0,i=o.$$scope)},[i,n]}class Ni extends U{constructor(e){super(),N(this,e,Ti,Qi,Q,{},Pi)}}function Ui(t){S(t,"svelte-ioxu5d",".rcb-modal-container.svelte-ioxu5d{width:100%}.rcb-modal-main.svelte-ioxu5d{box-sizing:border-box;border-radius:8px;background-color:var(--rc-color-white);color:var(--rc-color-grey-text-dark);min-height:460px;padding:40px;flex-direction:column;display:flex}.rcb-modal-dark.svelte-ioxu5d{background-color:var(--rc-color-grey-text-dark);color:var(--rc-color-white);min-height:0px}@media screen and (max-width: 960px){.rcb-modal-container.svelte-ioxu5d{width:calc(100% - 32px);min-width:300px;max-width:640px;margin:auto}.rcb-modal-main.svelte-ioxu5d,.rcb-modal-dark.svelte-ioxu5d{min-width:300px;max-width:640px;padding:32px}}")}function Ri(t){let e,r,n,i;const o=t[2].default,s=Y(o,t,t[1],null);return{c(){e=k("div"),r=k("main"),s&&s.c(),_(r,"class",n=_e(`rcb-modal-main ${t[0]?"rcb-modal-dark":""}`)+" svelte-ioxu5d"),_(e,"class","rcb-modal-container svelte-ioxu5d")},m(l,c){p(l,e,c),D(e,r),s&&s.m(r,null),i=!0},p(l,[c]){s&&s.p&&(!i||c&2)&&K(s,o,l,l[1],i?H(o,l[1],c,null):q(l[1]),null),(!i||c&1&&n!==(n=_e(`rcb-modal-main ${l[0]?"rcb-modal-dark":""}`)+" svelte-ioxu5d"))&&_(r,"class",n)},i(l){i||(u(s,l),i=!0)},o(l){d(s,l),i=!1},d(l){l&&g(e),s&&s.d(l)}}}function Si(t,e,r){let{$$slots:n={},$$scope:i}=e,{dark:o=!1}=e;return t.$$set=s=>{"dark"in s&&r(0,o=s.dark),"$$scope"in s&&r(1,i=s.$$scope)},[o,i,n]}class Oi extends U{constructor(e){super(),N(this,e,Si,Ri,Q,{dark:0},Ui)}}function Li(t){let e;const r=t[1].default,n=Y(r,t,t[2],null);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&4)&&K(n,r,i,i[2],e?H(r,i[2],o,null):q(i[2]),null)},i(i){e||(u(n,i),e=!0)},o(i){d(n,i),e=!1},d(i){n&&n.d(i)}}}function xi(t){let e,r;return e=new Ni({props:{$$slots:{default:[Fi]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&4&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Fi(t){let e;const r=t[1].default,n=Y(r,t,t[2],null);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&4)&&K(n,r,i,i[2],e?H(r,i[2],o,null):q(i[2]),null)},i(i){e||(u(n,i),e=!0)},o(i){d(n,i),e=!1},d(i){n&&n.d(i)}}}function Gi(t){let e,r,n,i;const o=[xi,Li],s=[];function l(c,a){return c[0]?0:1}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=ne()},m(c,a){s[e].m(c,a),p(c,n,a),i=!0},p(c,[a]){let f=e;e=l(c),e===f?s[e].p(c,a):(F(),d(s[f],1,1,()=>{s[f]=null}),G(),r=s[e],r?r.p(c,a):(r=s[e]=o[e](c),r.c()),u(r,1),r.m(n.parentNode,n))},i(c){i||(u(r),i=!0)},o(c){d(r),i=!1},d(c){c&&g(n),s[e].d(c)}}}function Yi(t,e,r){let{$$slots:n={},$$scope:i}=e,{condition:o=!1}=e;return t.$$set=s=>{"condition"in s&&r(0,o=s.condition),"$$scope"in s&&r(2,i=s.$$scope)},[o,n,i]}class Hi extends U{constructor(e){super(),N(this,e,Yi,Gi,Q,{condition:0})}}const Ki=t=>({}),yt=t=>({});function qi(t){let e,r;const n=t[1].header,i=Y(n,t,t[2],yt),o=t[1].default,s=Y(o,t,t[2],null);return{c(){i&&i.c(),e=T(),s&&s.c()},m(l,c){i&&i.m(l,c),p(l,e,c),s&&s.m(l,c),r=!0},p(l,c){i&&i.p&&(!r||c&4)&&K(i,n,l,l[2],r?H(n,l[2],c,Ki):q(l[2]),yt),s&&s.p&&(!r||c&4)&&K(s,o,l,l[2],r?H(o,l[2],c,null):q(l[2]),null)},i(l){r||(u(i,l),u(s,l),r=!0)},o(l){d(i,l),d(s,l),r=!1},d(l){l&&g(e),i&&i.d(l),s&&s.d(l)}}}function ji(t){let e,r;return e=new Oi({props:{dark:t[0],$$slots:{default:[qi]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const o={};i&1&&(o.dark=n[0]),i&4&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Ji(t,e,r){let{$$slots:n={},$$scope:i}=e,{dark:o=!1}=e;return t.$$set=s=>{"dark"in s&&r(0,o=s.dark),"$$scope"in s&&r(2,i=s.$$scope)},[o,n,i]}class Bt extends U{constructor(e){super(),N(this,e,Ji,ji,Q,{dark:0})}}var re=(t=>(t[t.UnknownError=0]="UnknownError",t[t.UserCancelledError=1]="UserCancelledError",t[t.StoreProblemError=2]="StoreProblemError",t[t.PurchaseNotAllowedError=3]="PurchaseNotAllowedError",t[t.PurchaseInvalidError=4]="PurchaseInvalidError",t[t.ProductNotAvailableForPurchaseError=5]="ProductNotAvailableForPurchaseError",t[t.ProductAlreadyPurchasedError=6]="ProductAlreadyPurchasedError",t[t.ReceiptAlreadyInUseError=7]="ReceiptAlreadyInUseError",t[t.InvalidReceiptError=8]="InvalidReceiptError",t[t.MissingReceiptFileError=9]="MissingReceiptFileError",t[t.NetworkError=10]="NetworkError",t[t.InvalidCredentialsError=11]="InvalidCredentialsError",t[t.UnexpectedBackendResponseError=12]="UnexpectedBackendResponseError",t[t.InvalidAppUserIdError=14]="InvalidAppUserIdError",t[t.OperationAlreadyInProgressError=15]="OperationAlreadyInProgressError",t[t.UnknownBackendError=16]="UnknownBackendError",t[t.InvalidAppleSubscriptionKeyError=17]="InvalidAppleSubscriptionKeyError",t[t.IneligibleError=18]="IneligibleError",t[t.InsufficientPermissionsError=19]="InsufficientPermissionsError",t[t.PaymentPendingError=20]="PaymentPendingError",t[t.InvalidSubscriberAttributesError=21]="InvalidSubscriberAttributesError",t[t.LogOutWithAnonymousUserError=22]="LogOutWithAnonymousUserError",t[t.ConfigurationError=23]="ConfigurationError",t[t.UnsupportedError=24]="UnsupportedError",t[t.EmptySubscriberAttributesError=25]="EmptySubscriberAttributesError",t[t.CustomerInfoError=28]="CustomerInfoError",t[t.SignatureVerificationError=36]="SignatureVerificationError",t))(re||{});class ye{static getPublicMessage(e){switch(e){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.";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."}}static getErrorCodeForBackendErrorCode(e){switch(e){case 7101:return 2;case 7102:return 7;case 7103:return 8;case 7107:case 7224:case 7225:return 11;case 7105:case 7106:return 4;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:return 12;case 7662:return 24}}static convertCodeToBackendErrorCode(e){return e in Dt?e:null}static convertPurchaseFlowErrorCodeToErrorCode(e){switch(e){case O.ErrorSettingUpPurchase:return 2;case O.ErrorChargingPayment:return 20;case O.NetworkError:return 10;case O.MissingEmailError:return 4;case O.StripeError:return 2;case O.UnknownError:return 0}}}var Dt=(t=>(t[t.BackendInvalidPlatform=7e3]="BackendInvalidPlatform",t[t.BackendStoreProblem=7101]="BackendStoreProblem",t[t.BackendCannotTransferPurchase=7102]="BackendCannotTransferPurchase",t[t.BackendInvalidReceiptToken=7103]="BackendInvalidReceiptToken",t[t.BackendInvalidAppStoreSharedSecret=7104]="BackendInvalidAppStoreSharedSecret",t[t.BackendInvalidPaymentModeOrIntroPriceNotProvided=7105]="BackendInvalidPaymentModeOrIntroPriceNotProvided",t[t.BackendProductIdForGoogleReceiptNotProvided=7106]="BackendProductIdForGoogleReceiptNotProvided",t[t.BackendInvalidPlayStoreCredentials=7107]="BackendInvalidPlayStoreCredentials",t[t.BackendInternalServerError=7110]="BackendInternalServerError",t[t.BackendEmptyAppUserId=7220]="BackendEmptyAppUserId",t[t.BackendInvalidAuthToken=7224]="BackendInvalidAuthToken",t[t.BackendInvalidAPIKey=7225]="BackendInvalidAPIKey",t[t.BackendBadRequest=7226]="BackendBadRequest",t[t.BackendPlayStoreQuotaExceeded=7229]="BackendPlayStoreQuotaExceeded",t[t.BackendPlayStoreInvalidPackageName=7230]="BackendPlayStoreInvalidPackageName",t[t.BackendPlayStoreGenericError=7231]="BackendPlayStoreGenericError",t[t.BackendUserIneligibleForPromoOffer=7232]="BackendUserIneligibleForPromoOffer",t[t.BackendInvalidAppleSubscriptionKey=7234]="BackendInvalidAppleSubscriptionKey",t[t.BackendInvalidSubscriberAttributes=7263]="BackendInvalidSubscriberAttributes",t[t.BackendInvalidSubscriberAttributesBody=7264]="BackendInvalidSubscriberAttributesBody",t[t.BackendProductIDsMalformed=7662]="BackendProductIDsMalformed",t))(Dt||{});class X extends Error{constructor(r,n,i){super(n);P(this,"toString",()=>`PurchasesError(code: ${re[this.errorCode]}, message: ${this.message})`);this.errorCode=r,this.underlyingErrorMessage=i}static getForBackendError(r,n){const i=ye.getErrorCodeForBackendErrorCode(r);return new X(i,ye.getPublicMessage(i),n)}static getForPurchasesFlowError(r){return new X(ye.convertPurchaseFlowErrorCodeToErrorCode(r.errorCode),r.message,r.underlyingErrorMessage)}}class Ct extends Error{constructor(){super("Purchases must be configured before calling getInstance")}}const Vi="0.2.0",fe="https://api.revenuecat.com";var Se;(function(t){t[t.CONTINUE=100]="CONTINUE",t[t.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",t[t.PROCESSING=102]="PROCESSING",t[t.EARLY_HINTS=103]="EARLY_HINTS",t[t.OK=200]="OK",t[t.CREATED=201]="CREATED",t[t.ACCEPTED=202]="ACCEPTED",t[t.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",t[t.NO_CONTENT=204]="NO_CONTENT",t[t.RESET_CONTENT=205]="RESET_CONTENT",t[t.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",t[t.MULTI_STATUS=207]="MULTI_STATUS",t[t.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",t[t.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",t[t.MOVED_TEMPORARILY=302]="MOVED_TEMPORARILY",t[t.SEE_OTHER=303]="SEE_OTHER",t[t.NOT_MODIFIED=304]="NOT_MODIFIED",t[t.USE_PROXY=305]="USE_PROXY",t[t.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",t[t.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",t[t.BAD_REQUEST=400]="BAD_REQUEST",t[t.UNAUTHORIZED=401]="UNAUTHORIZED",t[t.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",t[t.FORBIDDEN=403]="FORBIDDEN",t[t.NOT_FOUND=404]="NOT_FOUND",t[t.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",t[t.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",t[t.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",t[t.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",t[t.CONFLICT=409]="CONFLICT",t[t.GONE=410]="GONE",t[t.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",t[t.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",t[t.REQUEST_TOO_LONG=413]="REQUEST_TOO_LONG",t[t.REQUEST_URI_TOO_LONG=414]="REQUEST_URI_TOO_LONG",t[t.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",t[t.REQUESTED_RANGE_NOT_SATISFIABLE=416]="REQUESTED_RANGE_NOT_SATISFIABLE",t[t.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",t[t.IM_A_TEAPOT=418]="IM_A_TEAPOT",t[t.INSUFFICIENT_SPACE_ON_RESOURCE=419]="INSUFFICIENT_SPACE_ON_RESOURCE",t[t.METHOD_FAILURE=420]="METHOD_FAILURE",t[t.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",t[t.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",t[t.LOCKED=423]="LOCKED",t[t.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",t[t.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",t[t.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",t[t.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",t[t.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",t[t.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",t[t.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",t[t.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",t[t.BAD_GATEWAY=502]="BAD_GATEWAY",t[t.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",t[t.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",t[t.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",t[t.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",t[t.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"})(Se||(Se={}));function We(t){return t?t.startsWith("rcb_sb_"):!1}async function de(t,e,r,n){try{const i=await fetch(t.url(),{method:t.method,headers:Xi(e,n),body:zi(r)});return await Wi(i,t),await i.json()}catch(i){throw i instanceof TypeError?new X(re.NetworkError,ye.getPublicMessage(re.NetworkError),i.message):i}}async function Wi(t,e){const r=t.status;if(r>=Se.INTERNAL_SERVER_ERROR)ze(e,r,await t.text());else if(r>=Se.BAD_REQUEST){const n=await t.json(),i=n?JSON.stringify(n):null,o=n==null?void 0:n.code,s=n==null?void 0:n.message;if(o!=null){const l=ye.convertCodeToBackendErrorCode(o);if(l==null)ze(e,r,i);else throw X.getForBackendError(l,s)}else ze(e,r,i)}}function ze(t,e,r){throw new X(re.UnknownBackendError,`Unknown backend error. Request: ${t.name}. Status code: ${e}. Body: ${r}.`)}function zi(t){return t==null?null:JSON.stringify(t)}function Xi(t,e){let r={Authorization:`Bearer ${t}`,"Content-Type":"application/json",Accept:"application/json","X-Platform":"web","X-Version":Vi,"X-Is-Sandbox":`${We(t)}`};return e!=null&&(r={...r,...e}),r}const Mt="/v1/subscribers",Oe="/rcbilling/v1";class Zi{constructor(e){P(this,"appUserId");P(this,"method","GET");P(this,"name","getOfferings");this.appUserId=e}url(){const e=encodeURIComponent(this.appUserId);return`${fe}${Mt}/${e}/offerings`}}class eo{constructor(){P(this,"method","POST");P(this,"name","subscribe")}url(){return`${fe}${Oe}/subscribe`}}class to{constructor(e,r){P(this,"method","GET");P(this,"name","getProducts");P(this,"appUserId");P(this,"productIds");this.appUserId=e,this.productIds=r}url(){const e=encodeURIComponent(this.appUserId),r=this.productIds.map(encodeURIComponent).join("&id=");return`${fe}${Oe}/subscribers/${e}/products?id=${r}`}}class no{constructor(e){P(this,"method","GET");P(this,"name","getCustomerInfo");P(this,"appUserId");this.appUserId=e}url(){const e=encodeURIComponent(this.appUserId);return`${fe}${Mt}/${e}`}}class ro{constructor(){P(this,"method","GET");P(this,"name","getBrandingInfo")}url(){return`${fe}${Oe}/branding`}}class io{constructor(e){P(this,"method","GET");P(this,"name","getCheckoutStatus");P(this,"operationSessionId");this.operationSessionId=e}url(){return`${fe}${Oe}/checkout/${this.operationSessionId}`}}class oo{constructor(e){P(this,"API_KEY");this.API_KEY=e}async getOfferings(e){return await de(new Zi(e),this.API_KEY)}async getCustomerInfo(e){return await de(new no(e),this.API_KEY)}async getProducts(e,r){return await de(new to(e,r),this.API_KEY)}async getBrandingInfo(){return await de(new ro,this.API_KEY)}async postSubscribe(e,r,n,i){return await de(new eo,this.API_KEY,{app_user_id:e,product_id:r,email:n,presented_offering_identifier:i})}async getCheckoutStatus(e){return await de(new io(e),this.API_KEY)}}const so="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20opacity='0.5'%20clip-path='url(%23clip0_344_3390)'%3e%3cpath%20d='M7%2018C5.9%2018%205.01%2018.9%205.01%2020C5.01%2021.1%205.9%2022%207%2022C8.1%2022%209%2021.1%209%2020C9%2018.9%208.1%2018%207%2018ZM1%202V4H3L6.6%2011.59L5.25%2014.04C5.09%2014.32%205%2014.65%205%2015C5%2016.1%205.9%2017%207%2017H19V15H7.42C7.28%2015%207.17%2014.89%207.17%2014.75L7.2%2014.63L8.1%2013H15.55C16.3%2013%2016.96%2012.59%2017.3%2011.97L20.88%205.48C20.96%205.34%2021%205.17%2021%205C21%204.45%2020.55%204%2020%204H5.21L4.27%202H1ZM17%2018C15.9%2018%2015.01%2018.9%2015.01%2020C15.01%2021.1%2015.9%2022%2017%2022C18.1%2022%2019%2021.1%2019%2020C19%2018.9%2018.1%2018%2017%2018Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_344_3390'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";function lo(t){let e,r;return{c(){e=k("img"),te(e.src,r=so)||_(e,"src",r),_(e,"alt","icon"),_(e,"class","rcb-ui-asset-icon")},m(n,i){p(n,e,i)},p:v,i:v,o:v,d(n){n&&g(e)}}}class co extends U{constructor(e){super(),N(this,e,null,lo,Q,{})}}function ao(t){S(t,"svelte-1rhrjxe","div.svelte-1rhrjxe{background-color:var(--rc-color-warning);color:var(--rc-color-grey-text-dark);font-size:10px;font-weight:bold;text-transform:uppercase;padding:4px 10px;line-height:10px;border-radius:9px;margin:0px;margin-left:16px}")}function uo(t){let e;return{c(){e=k("div"),e.textContent="Sandbox",_(e,"class","svelte-1rhrjxe")},m(r,n){p(r,e,n)},p:v,i:v,o:v,d(r){r&&g(e)}}}class fo extends U{constructor(e){super(),N(this,e,null,uo,Q,{},ao)}}function mo(t){S(t,"svelte-13pdaik",`.rcb-ui-container.svelte-13pdaik{color-scheme:none;font-size:16px;line-height:1.5em;font-weight:400;font-family:-apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu,
|
|
7
|
+
Cantarell, "Open Sans", "Helvetica Neue", sans-serif}.rcb-ui-layout.svelte-13pdaik{width:100vw;width:100dvw;margin-right:auto;display:flex;justify-content:center;align-items:flex-start;position:relative;padding:0px 80px;box-sizing:border-box}.rcb-ui-aside.svelte-13pdaik{margin-right:16px;flex:320px 1 0;max-width:480px}.rcb-ui-main.svelte-13pdaik{flex:480px 1 0;max-width:640px}@media screen and (max-width: 960px){.rcb-ui-layout.svelte-13pdaik{flex-direction:column;align-items:center;justify-content:center;height:100%;min-width:100%}.rcb-ui-aside.svelte-13pdaik{margin-right:0;margin-bottom:16px;min-width:100%;display:flex;flex-direction:column;align-items:center;flex:none;max-width:none}.rcb-ui-main.svelte-13pdaik{flex:none;max-width:none;min-width:100%}}@media screen and (max-width: 960px) and (max-height: 960px){.rcb-ui-layout.svelte-13pdaik{overflow-y:scroll;justify-content:flex-start;padding:16px 0px}}`)}function Pt(t){let e,r,n;return r=new Bt({props:{dark:!0,$$slots:{header:[ho],default:[go]},$$scope:{ctx:t}}}),{c(){e=k("div"),w(r.$$.fragment),_(e,"class","rcb-ui-aside svelte-13pdaik")},m(i,o){p(i,e,o),I(r,e,null),n=!0},p(i,o){const s={};o&8388622&&(s.$$scope={dirty:o,ctx:i}),r.$set(s)},i(i){n||(u(r.$$.fragment,i),n=!0)},o(i){d(r.$$.fragment,i),n=!1},d(i){i&&g(e),b(r)}}}function Qt(t){let e,r;return e=new ft({props:{productDetails:t[2]}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&4&&(o.productDetails=n[2]),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function go(t){let e,r,n=t[2]&&Qt(t);return{c(){n&&n.c(),e=ne()},m(i,o){n&&n.m(i,o),p(i,e,o),r=!0},p(i,o){i[2]?n?(n.p(i,o),o&4&&u(n,1)):(n=Qt(i),n.c(),u(n,1),n.m(e.parentNode,e)):n&&(F(),d(n,1,1,()=>{n=null}),G())},i(i){r||(u(n),r=!0)},o(i){d(n),r=!1},d(i){i&&g(e),n&&n.d(i)}}}function po(t){let e,r;return e=new co({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function _o(t){let e,r;return e=new fo({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Ao(t){let e,r,n,i,o,s,l;e=new gt({props:{brandingInfo:t[3]}});const c=[_o,po],a=[];function f(m,E){return E&2&&(n=null),n==null&&(n=!!m[1].isSandbox()),n?0:1}return i=f(t,-1),o=a[i]=c[i](t),{c(){w(e.$$.fragment),r=T(),o.c(),s=ne()},m(m,E){I(e,m,E),p(m,r,E),a[i].m(m,E),p(m,s,E),l=!0},p(m,E){const y={};E&8&&(y.brandingInfo=m[3]),e.$set(y);let A=i;i=f(m,E),i!==A&&(F(),d(a[A],1,1,()=>{a[A]=null}),G(),o=a[i],o||(o=a[i]=c[i](m),o.c()),u(o,1),o.m(s.parentNode,s))},i(m){l||(u(e.$$.fragment,m),u(o),l=!0)},o(m){d(e.$$.fragment,m),d(o),l=!1},d(m){m&&(g(r),g(s)),b(e,m),a[i].d(m)}}}function ho(t){let e,r;return e=new Ve({props:{slot:"header",$$slots:{default:[Ao]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&8388618&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Tt(t){let e,r;return e=new ft({props:{productDetails:t[2]}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&4&&(o.productDetails=n[2]),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Nt(t){let e,r;return e=new je({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Ut(t){let e,r;return e=new Mi({props:{onContinue:t[10],onClose:t[9],processing:t[6]==="processing-auth-info"}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&64&&(o.processing=n[6]==="processing-auth-info"),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Rt(t){let e,r;return e=new hi({props:{paymentInfoCollectionMetadata:t[4],onContinue:t[10],onClose:t[9],onError:t[11],processing:t[6]==="polling-purchase-status"}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&16&&(o.paymentInfoCollectionMetadata=n[4]),i&64&&(o.processing=n[6]==="polling-purchase-status"),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function St(t){let e,r;return e=new je({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Ot(t){var n;let e,r;return e=new wr({props:{brandingInfo:t[3],lastError:t[5]??new j(O.UnknownError,"Unknown error without state set."),supportEmail:(n=t[3])==null?void 0:n.seller_company_support_email,onContinue:t[12]}}),{c(){w(e.$$.fragment)},m(i,o){I(e,i,o),r=!0},p(i,o){var l;const s={};o&8&&(s.brandingInfo=i[3]),o&32&&(s.lastError=i[5]??new j(O.UnknownError,"Unknown error without state set.")),o&8&&(s.supportEmail=(l=i[3])==null?void 0:l.seller_company_support_email),e.$set(s)},i(i){r||(u(e.$$.fragment,i),r=!0)},o(i){d(e.$$.fragment,i),r=!1},d(i){b(e,i)}}}function Lt(t){let e,r;return e=new Pr({props:{brandingInfo:t[3],onContinue:t[10]}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&8&&(o.brandingInfo=n[3]),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Eo(t){let e,r,n,i,o,s,l,c,a=t[6]==="present-offer"&&t[2]&&Tt(t),f=t[6]==="present-offer"&&!t[2]&&Nt(),m=(t[6]==="needs-auth-info"||t[6]==="processing-auth-info")&&Ut(t),E=t[4]&&(t[6]==="needs-payment-info"||t[6]==="polling-purchase-status")&&Rt(t),y=t[6]==="loading"&&St(),A=t[6]==="error"&&Ot(t),M=t[6]==="success"&&Lt(t);return{c(){a&&a.c(),e=T(),f&&f.c(),r=T(),m&&m.c(),n=T(),E&&E.c(),i=T(),y&&y.c(),o=T(),A&&A.c(),s=T(),M&&M.c(),l=ne()},m(h,B){a&&a.m(h,B),p(h,e,B),f&&f.m(h,B),p(h,r,B),m&&m.m(h,B),p(h,n,B),E&&E.m(h,B),p(h,i,B),y&&y.m(h,B),p(h,o,B),A&&A.m(h,B),p(h,s,B),M&&M.m(h,B),p(h,l,B),c=!0},p(h,B){h[6]==="present-offer"&&h[2]?a?(a.p(h,B),B&68&&u(a,1)):(a=Tt(h),a.c(),u(a,1),a.m(e.parentNode,e)):a&&(F(),d(a,1,1,()=>{a=null}),G()),h[6]==="present-offer"&&!h[2]?f?B&68&&u(f,1):(f=Nt(),f.c(),u(f,1),f.m(r.parentNode,r)):f&&(F(),d(f,1,1,()=>{f=null}),G()),h[6]==="needs-auth-info"||h[6]==="processing-auth-info"?m?(m.p(h,B),B&64&&u(m,1)):(m=Ut(h),m.c(),u(m,1),m.m(n.parentNode,n)):m&&(F(),d(m,1,1,()=>{m=null}),G()),h[4]&&(h[6]==="needs-payment-info"||h[6]==="polling-purchase-status")?E?(E.p(h,B),B&80&&u(E,1)):(E=Rt(h),E.c(),u(E,1),E.m(i.parentNode,i)):E&&(F(),d(E,1,1,()=>{E=null}),G()),h[6]==="loading"?y?B&64&&u(y,1):(y=St(),y.c(),u(y,1),y.m(o.parentNode,o)):y&&(F(),d(y,1,1,()=>{y=null}),G()),h[6]==="error"?A?(A.p(h,B),B&64&&u(A,1)):(A=Ot(h),A.c(),u(A,1),A.m(s.parentNode,s)):A&&(F(),d(A,1,1,()=>{A=null}),G()),h[6]==="success"?M?(M.p(h,B),B&64&&u(M,1)):(M=Lt(h),M.c(),u(M,1),M.m(l.parentNode,l)):M&&(F(),d(M,1,1,()=>{M=null}),G())},i(h){c||(u(a),u(f),u(m),u(E),u(y),u(A),u(M),c=!0)},o(h){d(a),d(f),d(m),d(E),d(y),d(A),d(M),c=!1},d(h){h&&(g(e),g(r),g(n),g(i),g(o),g(s),g(l)),a&&a.d(h),f&&f.d(h),m&&m.d(h),E&&E.d(h),y&&y.d(h),A&&A.d(h),M&&M.d(h)}}}function Io(t){let e,r=t[8].includes(t[6]),n,i,o,s,l=r&&Pt(t);return o=new Bt({props:{$$slots:{default:[Eo]},$$scope:{ctx:t}}}),{c(){e=k("div"),l&&l.c(),n=T(),i=k("div"),w(o.$$.fragment),_(i,"class","rcb-ui-main svelte-13pdaik"),_(e,"class","rcb-ui-layout svelte-13pdaik"),_(e,"style",t[7])},m(c,a){p(c,e,a),l&&l.m(e,null),D(e,n),D(e,i),I(o,i,null),s=!0},p(c,a){a&64&&(r=c[8].includes(c[6])),r?l?(l.p(c,a),a&64&&u(l,1)):(l=Pt(c),l.c(),u(l,1),l.m(e,n)):l&&(F(),d(l,1,1,()=>{l=null}),G());const f={};a&8388732&&(f.$$scope={dirty:a,ctx:c}),o.$set(f)},i(c){s||(u(l),u(o.$$.fragment,c),s=!0)},o(c){d(l),d(o.$$.fragment,c),s=!1},d(c){c&&g(e),l&&l.d(),b(o)}}}function bo(t){let e,r,n;return r=new Hi({props:{condition:t[0],$$slots:{default:[Io]},$$scope:{ctx:t}}}),{c(){e=k("div"),w(r.$$.fragment),_(e,"class","rcb-ui-container svelte-13pdaik")},m(i,o){p(i,e,o),I(r,e,null),n=!0},p(i,[o]){const s={};o&1&&(s.condition=i[0]),o&8388734&&(s.$$scope={dirty:o,ctx:i}),r.$set(s)},i(i){n||(u(r.$$.fragment,i),n=!0)},o(i){d(r.$$.fragment,i),n=!1},d(i){i&&g(e),b(r)}}}function wo(t,e,r){var xt;let{asModal:n=!0}=e,{customerEmail:i}=e,{appUserId:o}=e,{rcPackage:s}=e,{onFinished:l}=e,{onError:c}=e,{onClose:a}=e,{purchases:f}=e,{backend:m}=e,{purchaseOperationHelper:E}=e;const y=Object.entries(ve).map(([C,Ze])=>`--rc-color-${C}: ${Ze}`).join("; ");let A=null,M=null,h=null,B=null;const J=((xt=s.rcBillingProduct)==null?void 0:xt.identifier)??null;let $="present-offer";const Be=["present-offer","needs-auth-info","processing-auth-info","needs-payment-info","polling-purchase-status","loading"];Me(async()=>{if(r(2,A=s.rcBillingProduct),r(3,M=await m.getBrandingInfo()),$==="present-offer"){i?me():r(6,$="needs-auth-info");return}});const xe=()=>{a()},me=()=>{if(J===null){Z(new j(O.ErrorSettingUpPurchase,"Product ID was not set before purchase."));return}else $==="present-offer"&&r(6,$="loading");if(!i){Z(new j(O.MissingEmailError));return}E.startPurchase(o,J,i,s.rcBillingProduct.presentedOfferingIdentifier).then(C=>{if(C.next_action==="collect_payment_info"){r(6,$="needs-payment-info"),r(4,h=C);return}if(C.next_action==="completed"){r(6,$="success");return}}).catch(C=>{Z(new j(O.ErrorSettingUpPurchase,C.message,C.underlyingErrorMessage))})},ee=C=>{if($==="needs-auth-info"){C&&(r(13,i=C.email),r(6,$="processing-auth-info")),me();return}if($==="needs-payment-info"){r(6,$="polling-purchase-status"),E.pollCurrentPurchaseForCompletion().then(()=>{r(6,$="success")}).catch(Ze=>{Z(Ze)});return}if($==="success"||$==="error"){l();return}r(6,$="success")},Z=C=>{r(5,B=C),r(6,$="error")},So=()=>{c(B??new j(O.UnknownError,"Unknown error without state set."))};return t.$$set=C=>{"asModal"in C&&r(0,n=C.asModal),"customerEmail"in C&&r(13,i=C.customerEmail),"appUserId"in C&&r(14,o=C.appUserId),"rcPackage"in C&&r(15,s=C.rcPackage),"onFinished"in C&&r(16,l=C.onFinished),"onError"in C&&r(17,c=C.onError),"onClose"in C&&r(18,a=C.onClose),"purchases"in C&&r(1,f=C.purchases),"backend"in C&&r(19,m=C.backend),"purchaseOperationHelper"in C&&r(20,E=C.purchaseOperationHelper)},[n,f,A,M,h,B,$,y,Be,xe,ee,Z,So,i,o,s,l,c,a,m,E]}class ko extends U{constructor(e){super(),N(this,e,wo,bo,Q,{asModal:0,customerEmail:13,appUserId:14,rcPackage:15,onFinished:16,onError:17,onClose:18,purchases:1,backend:19,purchaseOperationHelper:20},mo)}}function $o(t){return t.expires_date==null?!0:new Date(t.expires_date)>new Date}function vo(t,e,r,n){const i=e.product_identifier;if(i in r)return yo(t,e,r[i]);if(i in n)return Bo(t,e,n[i]);throw new X(re.CustomerInfoError,"Could not find entitlement product in subscriptions or non-subscriptions.")}function yo(t,e,r){return{identifier:t,isActive:$o(e),willRenew:Mo(e,r),store:(r==null?void 0:r.store)??"unknown",latestPurchaseDate:new Date(e.purchase_date),originalPurchaseDate:new Date(e.purchase_date),expirationDate:Le(e.expires_date),productIdentifier:e.product_identifier,unsubscribeDetectedAt:Le(r==null?void 0:r.unsubscribe_detected_at),billingIssueDetectedAt:Le(r==null?void 0:r.billing_issues_detected_at),isSandbox:(r==null?void 0:r.is_sandbox)??!1,periodType:(r==null?void 0:r.period_type)??"normal"}}function Bo(t,e,r){return{identifier:t,isActive:!0,willRenew:!1,store:r.store,latestPurchaseDate:new Date(e.purchase_date),originalPurchaseDate:new Date(r.original_purchase_date),expirationDate:null,productIdentifier:e.product_identifier,unsubscribeDetectedAt:null,billingIssueDetectedAt:null,isSandbox:r.is_sandbox,periodType:"normal"}}function Do(t,e,r){const n={},i={};for(const o in t){const s=vo(o,t[o],e,r);n[o]=s,s.isActive&&(i[o]=s)}return{all:n,active:i}}function Le(t){return t==null?null:new Date(t)}function Co(t){const e=Qo(t),r=t.subscriber,n=No(r.non_subscriptions);return{entitlements:Do(r.entitlements,r.subscriptions,n),allExpirationDatesByProduct:e,allPurchaseDatesByProduct:Po(t,n),activeSubscriptions:To(e),managementURL:r.management_url,requestDate:new Date(t.request_date),firstSeenDate:new Date(r.first_seen),originalPurchaseDate:Le(r.original_purchase_date),originalAppUserId:t.subscriber.original_app_user_id}}function Mo(t,e){if(e==null)return!1;const r=e.store=="promotional",n=t.expires_date==null,i=e.unsubscribe_detected_at!=null,o=e.billing_issues_detected_at!=null;return!(r||n||i||o)}function Po(t,e){const r={};for(const n in t.subscriber.subscriptions){const i=t.subscriber.subscriptions[n];r[n]=new Date(i.purchase_date)}for(const n in e){const i=e[n].purchase_date;i==null?r[n]=null:r[n]=new Date(i)}return r}function Qo(t){const e={};for(const r in t.subscriber.subscriptions){const n=t.subscriber.subscriptions[r];n.expires_date==null?e[r]=null:e[r]=new Date(n.expires_date)}return e}function To(t){const e=new Set,r=new Date;for(const n in t){const i=t[n];(i==null||i>r)&&e.add(n)}return e}function No(t){const e={};for(const r in t){if(t[r].length===0)continue;const n=t[r].length;e[r]=t[r][n-1]}return e}function Uo(t){if(!t.startsWith("rcb_"))throw new X(re.InvalidCredentialsError,"Invalid API key. Use your RevenueCat Billing API key.")}function Ro(t){if(new Set(["no_user","null","none","nil","(null)","NaN","\\x00","","unidentified","undefined","unknown"]).has(t)||t.includes("/"))throw new X(re.InvalidAppUserIdError,'Provided user id: "'+t+'" is not valid. See https://www.revenuecat.com/docs/customers/user-ids#tips-for-setting-app-user-ids for more information.')}const z=class z{constructor(e,r){P(this,"_API_KEY");P(this,"_appUserId");P(this,"backend");P(this,"purchaseOperationHelper");P(this,"toOfferings",(e,r)=>{const n=e.offerings.find(l=>l.identifier===e.current_offering_id)??null,i={};r.product_details.forEach(l=>{i[l.identifier]=l});const o=n==null?null:nt(n,i),s={};return e.offerings.forEach(l=>{const c=nt(l,i);c!=null&&(s[l.identifier]=c)}),Object.keys(s).length==0&&W.debugLog("Empty offerings. Please make sure you've configured offerings correctly in the RevenueCat dashboard and that the products are properly configured."),{all:s,current:o}});this._API_KEY=e,this._appUserId=r,We(e)&&W.debugLog("Initializing Purchases SDK with sandbox API Key"),this.backend=new oo(this._API_KEY),this.purchaseOperationHelper=new Dn(this.backend)}static setLogLevel(e){W.setLogLevel(e)}static getSharedInstance(){if(z.isConfigured())return z.instance;throw new Ct}static isConfigured(){return z.instance!==void 0}static configure(e,r){return z.instance!==void 0?(W.warnLog("Purchases is already initialized. Ignoring and returning existing instance."),z.getSharedInstance()):(Uo(e),Ro(r),z.instance=new z(e,r),z.getSharedInstance())}async getOfferings(){const e=this._appUserId,r=await this.backend.getOfferings(e),n=r.offerings.flatMap(o=>o.packages).map(o=>o.platform_product_identifier),i=await this.backend.getProducts(e,n);return this.logMissingProductIds(n,i.product_details),this.toOfferings(r,i)}async isEntitledTo(e){const r=await this.getCustomerInfo();return e in r.entitlements.active}purchasePackage(e,r,n){let i=n??document.getElementById("rcb-ui-root");if(i===null){const c=document.createElement("div");c.className="rcb-ui-root",document.body.appendChild(c),i=c}if(i===null)throw new Error("Could not generate a mount point for the billing widget");const o=i,s=!n,l=this._appUserId;return W.debugLog(`Presenting purchase form for package ${e.identifier}`),new Promise((c,a)=>{new ko({target:o,props:{appUserId:l,rcPackage:e,customerEmail:r,onFinished:async()=>{W.debugLog("Purchase finished"),o.innerHTML="",c({customerInfo:await this._getCustomerInfoForUserId(l)})},onClose:()=>{o.innerHTML="",W.debugLog("Purchase cancelled by user"),a(new X(re.UserCancelledError))},onError:f=>{o.innerHTML="",a(X.getForPurchasesFlowError(f))},purchases:this,backend:this.backend,purchaseOperationHelper:this.purchaseOperationHelper,asModal:s}})})}async getCustomerInfo(){return await this._getCustomerInfoForUserId(this._appUserId)}getAppUserId(){return this._appUserId}async changeUser(e){return this._appUserId=e,await this.getCustomerInfo()}logMissingProductIds(e,r){const n={};r.forEach(o=>n[o.identifier]=o);const i=[];e.forEach(o=>{n[o]===void 0&&i.push(o)}),i.length>0&&W.debugLog(`Could not find product data for product ids:
|
|
8
8
|
${i.join()}.
|
|
9
|
-
Please check that your product configuration is correct.`)}isSandbox(){return We(this._API_KEY)}close(){z.instance===this?z.instance=void 0:W.warnLog("Trying to close a Purchases instance that is not the current instance. Ignoring.")}async _getCustomerInfoForUserId(e){const r=await this.backend.getCustomerInfo(e);return
|
|
9
|
+
Please check that your product configuration is correct.`)}isSandbox(){return We(this._API_KEY)}close(){z.instance===this?z.instance=void 0:W.warnLog("Trying to close a Purchases instance that is not the current instance. Ignoring.")}async _getCustomerInfoForUserId(e){const r=await this.backend.getCustomerInfo(e);return Co(r)}};P(z,"instance");let Xe=z;x.ErrorCode=re,x.LogLevel=L,x.PackageType=tt,x.Purchases=Xe,x.PurchasesError=X,x.UninitializedPurchasesError=Ct,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@revenuecat/purchases-js",
|
|
3
|
+
"description": "Web subscriptions made easy. Powered by RevenueCat",
|
|
3
4
|
"private": false,
|
|
4
|
-
"version": "0.
|
|
5
|
+
"version": "0.2.0",
|
|
5
6
|
"type": "module",
|
|
6
7
|
"files": [
|
|
7
8
|
"dist"
|
|
@@ -19,7 +20,21 @@
|
|
|
19
20
|
"require": "./dist/style.css"
|
|
20
21
|
}
|
|
21
22
|
},
|
|
23
|
+
"author": "RevenueCat, Inc.",
|
|
22
24
|
"license": "MIT",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/RevenueCat/purchases-js.git"
|
|
28
|
+
},
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/RevenueCat/purchases-js/issues"
|
|
31
|
+
},
|
|
32
|
+
"keywords": [
|
|
33
|
+
"revenuecat",
|
|
34
|
+
"purchases",
|
|
35
|
+
"subscriptions",
|
|
36
|
+
"iap"
|
|
37
|
+
],
|
|
23
38
|
"scripts": {
|
|
24
39
|
"watch": "vite build --watch",
|
|
25
40
|
"build": "tsc && vite build",
|