@revenuecat/purchases-js 0.2.2 → 0.3.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 +181 -69
- package/dist/Purchases.es.js +1543 -1364
- package/dist/Purchases.umd.js +4 -4
- package/dist/style.css +1 -1
- package/package.json +2 -2
package/dist/Purchases.umd.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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+MTDhiIMkQxBohJkwRYaUkDEEiQIlYQrCyLZ0MFJRCdAkgC1OZBEBxgRJRIBAqXgwYI8NoCwEjWAkyFDoorQ4KOrQCRLoqbQuZCKR7NdqzD5MaQKXIhZmA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i0nVGxNkkSrwCw/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,
|
|
1
|
+
(function(Y,X){typeof exports=="object"&&typeof module<"u"?X(exports):typeof define=="function"&&define.amd?define(["exports"],X):(Y=typeof globalThis<"u"?globalThis:Y||self,X(Y.Purchases={}))})(this,function(Y){"use strict";var zo=Object.defineProperty;var Xo=(Y,X,x)=>X in Y?zo(Y,X,{enumerable:!0,configurable:!0,writable:!0,value:x}):Y[X]=x;var Q=(Y,X,x)=>(Xo(Y,typeof X!="symbol"?X+"":X,x),x);function X(t){return t!=null}var x=(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))(x||{});class H{static setLogLevel(e){this.logLevel=e}static log(e,r=this.logLevel){const n=`[Purchases] ${e}`;if(!(this.logLevel<r||r===x.Silent))switch(r){case x.Error:console.error(n);break;case x.Warn:console.warn(n);break;case x.Info:console.info(n);break;case x.Debug:console.debug(n);break;case x.Verbose:console.debug(n);break}}static errorLog(e){this.log(e,x.Error)}static warnLog(e){this.log(e,x.Warn)}static infoLog(e){this.log(e,x.Info)}static debugLog(e){this.log(e,x.Debug)}static verboseLog(e){this.log(e,x.Verbose)}}Q(H,"logLevel",x.Silent);var ie=(t=>(t.Year="year",t.Month="month",t.Week="week",t.Day="day",t))(ie||{});function tt(t){const e=t.match(/^PT?([0-9]+)([MDYW])$/);if(!e||e.length<3)return H.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 H.errorLog(`Invalid ISO 8601 unit duration format: ${t}`),null}}const Ge=(t,e)=>{const r=t/100;return new Intl.NumberFormat("en-US",{style:"currency",currency:e}).format(r)},jt=t=>{const e=t.number;if(e===1)switch(t.unit){case ie.Year:return"yearly";case ie.Month:return"monthly";case ie.Week:return"weekly";case ie.Day:return"daily"}else return`every ${e} ${t.unit}s`},Jt=t=>{const e=t.number;if(e===1)switch(t.unit){case ie.Year:return"1 year";case ie.Month:return"1 month";case ie.Week:return"1 week";case ie.Day:return"1 day"}else return`${e} ${t.unit}s`},nt=t=>{const e=tt(t);return e?jt(e):"unknown"},Vt=t=>{const e=tt(t);return e?Jt(e):"unknown"};var rt=(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))(rt||{});const Wt=t=>({amount:t.amount,currency:t.currency,formattedPrice:Ge(t.amount,t.currency)}),it=t=>({periodDuration:t.period_duration,cycleCount:t.cycle_count,price:t.price?Wt(t.price):null}),zt=t=>t.base==null?(H.debugLog("Missing base phase for subscription option. Ignoring."),null):{id:t.id,base:it(t.base),trial:t.trial?it(t.trial):null},Xt=(t,e)=>{const r={};if(Object.entries(t.subscription_options).forEach(([s,l])=>{const c=zt(l);c!=null&&(r[s]=c)}),Object.keys(r).length===0)return H.debugLog(`Product ${t.identifier} has no subscription options. Ignoring.`),null;const n=t.default_subscription_option_id,i=n&&n in r?r[n]:null;if(i==null)return H.debugLog(`Product ${t.identifier} has no default subscription option. Ignoring.`),null;const o=i.base.price;return o==null?(H.debugLog(`Product ${t.identifier} default option has no base price. Ignoring.`),null):{identifier:t.identifier,displayName:t.title,title:t.title,description:t.description,currentPrice:o,normalPeriodDuration:i.base.periodDuration,presentedOfferingIdentifier:e,defaultSubscriptionOption:i,subscriptionOptions:r}},Zt=(t,e,r)=>{const n=r[e.platform_product_identifier];if(n===void 0)return null;const i=Xt(n,t);return i===null?null:{identifier:e.identifier,rcBillingProduct:i,packageType:en(e.identifier)}},ot=(t,e)=>{const r=t.packages.map(i=>Zt(t.identifier,i,e)).filter(X),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 en(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 $(){}function tn(t,e){for(const r in e)t[r]=e[r];return t}function st(t){return t()}function lt(){return Object.create(null)}function ge(t){t.forEach(st)}function se(t){return typeof t=="function"}function T(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Be;function te(t,e){return t===e?!0:(Be||(Be=document.createElement("a")),Be.href=e,t===Be.href)}function ct(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function nn(t,e){const r=ct(t.srcset),n=ct(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 rn(t){return Object.keys(t).length===0}function j(t,e,r,n){if(t){const i=at(t,e,r,n);return t[0](i)}}function at(t,e,r,n){return t[1]&&n?tn(r.ctx.slice(),t[1](n(e))):r.ctx}function J(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 V(t,e,r,n,i,o){if(i){const s=at(e,r,n,o);t.p(s,i)}}function W(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 pe(t){return t??""}function C(t,e){t.appendChild(e)}function L(t,e,r){const n=on(t);if(!n.getElementById(e)){const i=k("style");i.id=e,i.textContent=r,sn(n,i)}}function on(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function sn(t,e){return C(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 S(t){return document.createTextNode(t)}function P(){return S(" ")}function ne(){return S("")}function _e(t,e,r,n){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r,n)}function ut(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 ln=["width","height"];function cn(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&&ln.indexOf(n)===-1?t[n]=e[n]:_(t,n,e[n])}function an(t,e){Object.keys(e).forEach(r=>{un(t,r,e[r])})}function un(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 fn(t){return/-/.test(t)?an:cn}function dn(t){return Array.from(t.childNodes)}function le(t,e){e=""+e,t.data!==e&&(t.data=e)}function ft(t,e){t.value=e??""}function mn(t,e,{bubbles:r=!1,cancelable:n=!1}={}){return new CustomEvent(t,{detail:e,bubbles:r,cancelable:n})}let Ae;function he(t){Ae=t}function De(){if(!Ae)throw new Error("Function called outside component initialization");return Ae}function Ce(t){De().$$.on_mount.push(t)}function gn(){const t=De();return(e,r,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const o=mn(e,r,{cancelable:n});return i.slice().forEach(s=>{s.call(t,o)}),!o.defaultPrevented}return!0}}function pn(t,e){return De().$$.context.set(t,e),e}function _n(t){return De().$$.context.get(t)}function dt(t,e){const r=t.$$.callbacks[e.type];r&&r.slice().forEach(n=>n.call(this,e))}const ce=[],Me=[];let ae=[];const Ye=[],An=Promise.resolve();let He=!1;function hn(){He||(He=!0,An.then(mt))}function Ke(t){ae.push(t)}function En(t){Ye.push(t)}const qe=new Set;let ue=0;function mt(){if(ue!==0)return;const t=Ae;do{try{for(;ue<ce.length;){const e=ce[ue];ue++,he(e),bn(e.$$)}}catch(e){throw ce.length=0,ue=0,e}for(he(null),ce.length=0,ue=0;Me.length;)Me.pop()();for(let e=0;e<ae.length;e+=1){const r=ae[e];qe.has(r)||(qe.add(r),r())}ae.length=0}while(ce.length);for(;Ye.length;)Ye.pop()();He=!1,qe.clear(),he(t)}function bn(t){if(t.fragment!==null){t.update(),ge(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(Ke)}}function In(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 oe;function K(){oe={r:0,c:[],p:oe}}function q(){oe.r||ge(oe.c),oe=oe.p}function f(t,e){t&&t.i&&(Pe.delete(t),t.i(e))}function m(t,e,r,n){if(t&&t.o){if(Pe.has(t))return;Pe.add(t),oe.c.push(()=>{Pe.delete(t),n&&(r&&t.d(1),n())}),t.o(e)}else n&&n()}function wn(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 b(t,e,r){const{fragment:n,after_update:i}=t.$$;n&&n.m(e,r),Ke(()=>{const o=t.$$.on_mount.map(st).filter(se);t.$$.on_destroy?t.$$.on_destroy.push(...o):ge(o),t.$$.on_mount=[]}),i.forEach(Ke)}function I(t,e){const r=t.$$;r.fragment!==null&&(In(r.after_update),ge(r.on_destroy),r.fragment&&r.fragment.d(e),r.on_destroy=r.fragment=null,r.ctx=[])}function kn(t,e){t.$$.dirty[0]===-1&&(ce.push(t),hn(),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=Ae;he(t);const a=t.$$={fragment:null,ctx:[],props:o,update:$,not_equal:i,bound:lt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:lt(),dirty:l,skip_bound:!1,root:e.target||c.$$.root};s&&s(a.root);let u=!1;if(a.ctx=r?r(t,e.props||{},(d,h,...v)=>{const E=v.length?v[0]:h;return a.ctx&&i(a.ctx[d],a.ctx[d]=E)&&(!a.skip_bound&&a.bound[d]&&a.bound[d](E),u&&kn(t,d)),h}):[],a.update(),u=!0,ge(a.before_update),a.fragment=n?n(a.ctx):!1,e.target){if(e.hydrate){const d=dn(e.target);a.fragment&&a.fragment.l(d),d.forEach(g)}else a.fragment&&a.fragment.c();e.intro&&f(t.$$.fragment),b(t,e.target,e.anchor),mt()}he(c)}class U{constructor(){Q(this,"$$");Q(this,"$$set")}$destroy(){I(this,1),this.$destroy=$}$on(e,r){if(!se(r))return $;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&&!rn(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const $n="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add($n);function vn(t){L(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 je(t){let e,r;const n=t[2].default,i=j(n,t,t[1],null);return{c(){e=k(t[0]),i&&i.c(),fn(t[0])(e,{class:pe("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)&&V(i,n,o,o[1],r?J(n,o[1],s,null):W(o[1]),null)},i(o){r||(f(i,o),r=!0)},o(o){m(i,o),r=!1},d(o){o&&g(e),i&&i.d(o)}}}function yn(t){let e=t[0],r,n,i=t[0]&&je(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?T(e,o[0])?(i.d(1),i=je(o),e=o[0],i.c(),i.m(r.parentNode,r)):i.p(o,s):(i=je(o),e=o[0],i.c(),i.m(r.parentNode,r)):e&&(i.d(1),i=null,e=o[0])},i(o){n||(f(i,o),n=!0)},o(o){m(i,o),n=!1},d(o){o&&g(r),i&&i.d(o)}}}function Bn(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 U{constructor(e){super(),N(this,e,Bn,yn,T,{as:0},vn)}}function Dn(t){L(t,"svelte-gf0gr5",".rcb-pricing-info.svelte-gf0gr5{display:flex;flex-direction:column;margin-top:102px;font-weight:500}.rcb-product-price.svelte-gf0gr5{font-size:24px;margin:12px 0px}.rcb-product-price-after-trial.svelte-gf0gr5{margin-bottom:12px}.rcb-product-details.svelte-gf0gr5{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-gf0gr5{margin-top:48px}}")}function Cn(t){let e=Vt(t[1].periodDuration)+"",r,n;return{c(){r=S(e),n=S(" free trial")},m(i,o){p(i,r,o),p(i,n,o)},p:$,d(i){i&&(g(r),g(n))}}}function Mn(t){let e=(t[2].currency||"")+"",r,n,i=Ge(t[2].amount,t[2].currency)+"",o;return{c(){r=S(e),n=P(),o=S(i)},m(s,l){p(s,r,l),p(s,n,l),p(s,o,l)},p:$,d(s){s&&(g(r),g(n),g(o))}}}function Pn(t){let e;return{c(){e=k("span"),e.textContent=`${t[1]&&t[2]&&`${t[2].currency} ${Ge(t[2].amount,t[2].currency)} after end of trial`}`,_(e,"class","rcb-product-price-after-trial svelte-gf0gr5")},m(r,n){p(r,e,n)},p:$,d(r){r&&g(e)}}}function gt(t){let e,r,n=nt(t[0].normalPeriodDuration)+"",i;return{c(){e=k("li"),r=S("Renews "),i=S(n)},m(o,s){p(o,e,s),C(e,r),C(e,i)},p(o,s){s&1&&n!==(n=nt(o[0].normalPeriodDuration)+"")&&le(i,n)},d(o){o&&g(e)}}}function Qn(t){var M,Le;let e,r,n=t[0].displayName+"",i,o,s,l,c,a,u,d,h,v,E,B=((M=t[1])==null?void 0:M.periodDuration)&&Cn(t),A=!((Le=t[1])!=null&&Le.periodDuration)&&t[2]&&Mn(t),y=t[1]&&t[2]&&Pn(t),R=t[0].normalPeriodDuration&>(t);return{c(){e=k("div"),r=k("span"),i=S(n),o=P(),s=k("span"),B&&B.c(),l=P(),A&&A.c(),c=P(),y&&y.c(),a=P(),u=k("ul"),R&&R.c(),d=P(),h=k("li"),h.textContent="Continues until canceled",v=P(),E=k("li"),E.textContent="Cancel anytime",_(s,"class","rcb-product-price svelte-gf0gr5"),_(u,"class","rcb-product-details svelte-gf0gr5"),_(e,"class","rcb-pricing-info svelte-gf0gr5")},m(G,O){p(G,e,O),C(e,r),C(r,i),C(e,o),C(e,s),B&&B.m(s,null),C(s,l),A&&A.m(s,null),C(e,c),y&&y.m(e,null),C(e,a),C(e,u),R&&R.m(u,null),C(u,d),C(u,h),C(u,v),C(u,E)},p(G,O){var Fe,xe;O&1&&n!==(n=G[0].displayName+"")&&le(i,n),(Fe=G[1])!=null&&Fe.periodDuration&&B.p(G,O),!((xe=G[1])!=null&&xe.periodDuration)&&G[2]&&A.p(G,O),G[1]&&G[2]&&y.p(G,O),G[0].normalPeriodDuration?R?R.p(G,O):(R=gt(G),R.c(),R.m(u,d)):R&&(R.d(1),R=null)},d(G){G&&g(e),B&&B.d(),A&&A.d(),y&&y.d(),R&&R.d()}}}function Tn(t){let e,r;return e=new fe({props:{$$slots:{default:[Qn]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,[i]){const o={};i&33&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Nn(t,e,r){var c;let{productDetails:n}=e,{purchaseOption:i}=e;const o=i,s=o==null?void 0:o.trial,l=(c=o==null?void 0:o.base)==null?void 0:c.price;return t.$$set=a=>{"productDetails"in a&&r(0,n=a.productDetails),"purchaseOption"in a&&r(3,i=a.purchaseOption)},[n,s,l,i]}class pt extends U{constructor(e){super(),N(this,e,Nn,Tn,T,{productDetails:0,purchaseOption:3},Dn)}}const Un="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+MTDhiIMkQxBohJkwRYaUkDEEiQIlYQrCyLZ0MFJRCdAkgC1OZBEBxgRJRIBAqXgwYI8NoCwEjWAkyFDoorQ4KOrQCRLoqbQuZCKR7NdqzD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Hfpgc+ETKQi0nVGxNkkSrwCw/hiBxu7XuFidAhARpgqWu3yxIhgApEtLvVipIgARBYthvlKaNFQYEADs=";function Rn(t){let e,r;return{c(){e=k("img"),te(e.src,r=Un)||_(e,"src",r),_(e,"alt","spinner")},m(n,i){p(n,e,i)},p:$,i:$,o:$,d(n){n&&g(e)}}}class On extends U{constructor(e){super(),N(this,e,null,Rn,T,{})}}function Sn(t){L(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 Ln(t){let e,r,n;return r=new On({}),{c(){e=k("div"),w(r.$$.fragment),_(e,"class","rcb-modal-loader svelte-1mxx341")},m(i,o){p(i,e,o),b(r,e,null),n=!0},p:$,i(i){n||(f(r.$$.fragment,i),n=!0)},o(i){m(r.$$.fragment,i),n=!1},d(i){i&&g(e),I(r)}}}class Je extends U{constructor(e){super(),N(this,e,null,Ln,T,{},Sn)}}var Ee=(t=>(t.Started="started",t.InProgress="in_progress",t.Succeeded="succeeded",t.Failed="failed",t))(Ee||{}),Qe=(t=>(t[t.SetupIntentCreationFailed=1]="SetupIntentCreationFailed",t[t.PaymentMethodCreationFailed=2]="PaymentMethodCreationFailed",t[t.PaymentChargeFailed=3]="PaymentChargeFailed",t))(Qe||{}),F=(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))(F||{});class z extends Error{constructor(e,r,n){super(r),this.errorCode=e,this.underlyingErrorMessage=n}}class Fn{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,o){const s=await this.backend.postSubscribe(e,r,i,o,n==null?void 0:n.id);return this.operationSessionId=s.operation_session_id,s}async pollCurrentPurchaseForCompletion(){const e=this.operationSessionId;if(!e)throw new z(0,"No purchase in progress");return new Promise((r,n)=>{const i=(o=1)=>{if(o>this.maxNumberAttempts){this.clearPurchaseInProgress(),n(new z(2,"Max attempts reached trying to get successful purchase status"));return}this.backend.getCheckoutStatus(e).then(s=>{switch(s.operation.status){case Ee.Started:case Ee.InProgress:setTimeout(()=>i(o+1),this.waitMSBetweenAttempts);break;case Ee.Succeeded:this.clearPurchaseInProgress(),r();return;case Ee.Failed:this.clearPurchaseInProgress(),this.handlePaymentError(s.operation.error,n)}}).catch(s=>{n(new z(3,s.message))})};i()})}clearPurchaseInProgress(){this.operationSessionId=null}handlePaymentError(e,r){if(e==null){r(new z(2,"Got an error status but error field is empty."));return}switch(e.code){case Qe.SetupIntentCreationFailed:r(new z(0,"Setup intent creation failed"));return;case Qe.PaymentMethodCreationFailed:r(new z(0,"Payment method creation failed"));return;case Qe.PaymentChargeFailed:r(new z(1,"Payment charge failed"));return}}}const xn="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 Gn(t){L(t,"svelte-1609h93","img.svelte-1609h93{width:124px;height:124px;margin:0 auto}")}function Yn(t){let e,r;return{c(){e=k("img"),te(e.src,r=xn)||_(e,"src",r),_(e,"alt","icon"),_(e,"class","rcb-ui-asset-icon svelte-1609h93")},m(n,i){p(n,e,i)},p:$,i:$,o:$,d(n){n&&g(e)}}}class Hn extends U{constructor(e){super(),N(this,e,null,Yn,T,{},Gn)}}function Kn(t){L(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 qn(t){let e,r,n,i,o;const s=t[3].default,l=j(s,t,t[2],null);return{c(){e=k("button"),l&&l.c(),_(e,"class",r=pe(`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=_e(e,"click",t[4]),i=!0)},p(c,[a]){l&&l.p&&(!n||a&4)&&V(l,s,c,c[2],n?J(s,c[2],a,null):W(c[2]),null),(!n||a&1&&r!==(r=pe(`intent-${c[0]}`)+" svelte-1rmxk7q"))&&_(e,"class",r),(!n||a&2)&&(e.disabled=c[1])},i(c){n||(f(l,c),n=!0)},o(c){m(l,c),n=!1},d(c){c&&g(e),l&&l.d(c),i=!1,o()}}}function jn(t,e,r){let{$$slots:n={},$$scope:i}=e,{intent:o="primary"}=e,{disabled:s=!1}=e;function l(c){dt.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,jn,qn,T,{intent:0,disabled:1},Kn)}}function Jn(t){L(t,"svelte-1f9z0o8","footer.svelte-1f9z0o8{display:flex;flex-direction:column}")}function Vn(t){let e,r;const n=t[1].default,i=j(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)&&V(i,n,o,o[0],r?J(n,o[0],s,null):W(o[0]),null)},i(o){r||(f(i,o),r=!0)},o(o){m(i,o),r=!1},d(o){o&&g(e),i&&i.d(o)}}}function Wn(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(0,i=o.$$scope)},[i,n]}class Ve extends U{constructor(e){super(),N(this,e,Wn,Vn,T,{},Jn)}}function zn(t){L(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=j(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)&&V(o,i,s,s[1],n?J(i,s[1],l,null):W(s[1]),null),(!n||l&1&&r!==(r=`--gap:${s[0]};`))&&_(e,"style",r)},i(s){n||(f(o,s),n=!0)},o(s){m(o,s),n=!1},d(s){s&&g(e),o&&o.d(s)}}}function Zn(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 Ie extends U{constructor(e){super(),N(this,e,Zn,Xn,T,{gutter:0},zn)}}const er="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 tr(t){L(t,"svelte-14xreta",".close-button.svelte-14xreta{border:none;cursor:pointer;background-color:transparent;padding:0px}")}function nr(t){let e,r,n,i,o;return{c(){e=k("button"),r=k("img"),te(r.src,n=er)||_(r,"src",n),_(r,"alt","close"),_(e,"class","close-button svelte-14xreta"),e.disabled=t[0]},m(s,l){p(s,e,l),C(e,r),i||(o=_e(e,"click",t[1]),i=!0)},p(s,[l]){l&1&&(e.disabled=s[0])},i:$,o:$,d(s){s&&g(e),i=!1,o()}}}function rr(t,e,r){let{disabled:n=!1}=e;function i(o){dt.call(this,t,o)}return t.$$set=o=>{"disabled"in o&&r(0,n=o.disabled)},[n,i]}class ir extends U{constructor(e){super(),N(this,e,rr,nr,T,{disabled:0},tr)}}function or(t){L(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 sr(t){let e;return{c(){e=k("div"),_(e,"class","rcb-app-icon loading svelte-44qpq9")},m(r,n){p(r,e,n)},p:$,d(r){r&&g(e)}}}function lr(t){let e,r,n,i,o,s;return{c(){e=k("picture"),r=k("source"),i=P(),o=k("img"),_(r,"type","image/webp"),nn(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),C(e,r),C(e,i),C(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 cr(t){let e;function r(o,s){return o[0]!==null?lr:sr}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:$,o:$,d(o){o&&g(e),i.d(o)}}}function ar(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 _t extends U{constructor(e){super(),N(this,e,ar,cr,T,{src:0,srcWebp:1},or)}}const Te=t=>`https://da08ctfrofx1b.cloudfront.net/${t}`;function ur(t){L(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 fr(t){let e,r;return e=new _t({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p:$,i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function dr(t){let e,r,n=t[0].seller_company_name+"",i,o,s=t[0].app_icon_webp!==null&&t[0].app_icon!==null&&At(t);return{c(){s&&s.c(),e=P(),r=k("span"),i=S(n),_(r,"class","app-title svelte-10uf5fq")},m(l,c){s&&s.m(l,c),p(l,e,c),p(l,r,c),C(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&&f(s,1)):(s=At(l),s.c(),f(s,1),s.m(e.parentNode,e)):s&&(K(),m(s,1,1,()=>{s=null}),q()),(!o||c&1)&&n!==(n=l[0].seller_company_name+"")&&le(i,n)},i(l){o||(f(s),o=!0)},o(l){m(s),o=!1},d(l){l&&(g(e),g(r)),s&&s.d(l)}}}function At(t){let e,r;return e=new _t({props:{src:Te(t[0].app_icon),srcWebp:Te(t[0].app_icon_webp)}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&1&&(o.src=Te(n[0].app_icon)),i&1&&(o.srcWebp=Te(n[0].app_icon_webp)),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function mr(t){let e,r,n,i;const o=[dr,fr],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 u=r;r=l(c),r===u?s[r].p(c,a):(K(),m(s[u],1,1,()=>{s[u]=null}),q(),n=s[r],n?n.p(c,a):(n=s[r]=o[r](c),n.c()),f(n,1),n.m(e,null))},i(c){i||(f(n),i=!0)},o(c){m(n),i=!1},d(c){c&&g(e),s[r].d()}}}function gr(t,e,r){let{brandingInfo:n=null}=e;return t.$$set=i=>{"brandingInfo"in i&&r(0,n=i.brandingInfo)},[n]}class ht extends U{constructor(e){super(),N(this,e,gr,mr,T,{brandingInfo:0},ur)}}function pr(t){L(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 _r(t){let e,r,n,i,o;return r=new ht({props:{brandingInfo:t[0]}}),i=new ir({}),i.$on("click",function(){se(t[1])&&t[1].apply(this,arguments)}),{c(){e=k("div"),w(r.$$.fragment),n=P(),w(i.$$.fragment),_(e,"class","rcb-post-purchase-header-layout svelte-17puakv")},m(s,l){p(s,e,l),b(r,e,null),C(e,n),b(i,e,null),o=!0},p(s,l){t=s;const c={};l&1&&(c.brandingInfo=t[0]),r.$set(c)},i(s){o||(f(r.$$.fragment,s),f(i.$$.fragment,s),o=!0)},o(s){m(r.$$.fragment,s),m(i.$$.fragment,s),o=!1},d(s){s&&g(e),I(r),I(i)}}}function Ar(t){let e,r;return e=new fe({props:{as:"header",$$slots:{default:[_r]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,[i]){const o={};i&7&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function hr(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 Er extends U{constructor(e){super(),N(this,e,hr,Ar,T,{brandingInfo:0,onClose:1},pr)}}function br(t){L(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 Ir=t=>({}),Et=t=>({});function wr(t){let e,r,n,i,o;const s=t[4].default,l=j(s,t,t[5],null);return{c(){e=k("span"),r=S(t[2]),n=P(),i=k("span"),l&&l.c(),_(e,"class","title svelte-10pcqja"),_(i,"class","subtitle svelte-10pcqja")},m(c,a){p(c,e,a),C(e,r),p(c,n,a),p(c,i,a),l&&l.m(i,null),o=!0},p(c,a){(!o||a&4)&&le(r,c[2]),l&&l.p&&(!o||a&32)&&V(l,s,c,c[5],o?J(s,c[5],a,null):W(c[5]),null)},i(c){o||(f(l,c),o=!0)},o(c){m(l,c),o=!1},d(c){c&&(g(e),g(n),g(i)),l&&l.d(c)}}}function kr(t){let e,r,n;const i=t[4].icon,o=j(i,t,t[5],Et);return r=new Ie({props:{gutter:"16px",$$slots:{default:[wr]},$$scope:{ctx:t}}}),{c(){o&&o.c(),e=P(),w(r.$$.fragment)},m(s,l){o&&o.m(s,l),p(s,e,l),b(r,s,l),n=!0},p(s,l){o&&o.p&&(!n||l&32)&&V(o,i,s,s[5],n?J(i,s[5],l,Ir):W(s[5]),Et);const c={};l&36&&(c.$$scope={dirty:l,ctx:s}),r.$set(c)},i(s){n||(f(o,s),f(r.$$.fragment,s),n=!0)},o(s){m(o,s),m(r.$$.fragment,s),n=!1},d(s){s&&g(e),o&&o.d(s),I(r,s)}}}function $r(t){let e,r,n;return r=new Ie({props:{gutter:"16px",$$slots:{default:[kr]},$$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),b(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||(f(r.$$.fragment,i),n=!0)},o(i){m(r.$$.fragment,i),n=!1},d(i){i&&g(e),I(r)}}}function vr(t){let e;return{c(){e=S("Go back to app")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function yr(t){let e,r;return e=new be({props:{$$slots:{default:[vr]},$$scope:{ctx:t}}}),e.$on("click",function(){se(t[1])&&t[1].apply(this,arguments)}),{c(){w(e.$$.fragment)},m(n,i){b(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||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Br(t){let e,r,n,i,o,s;return e=new Er({props:{brandingInfo:t[0],onClose:t[1]}}),n=new fe({props:{$$slots:{default:[$r]},$$scope:{ctx:t}}}),o=new Ve({props:{$$slots:{default:[yr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment),r=P(),w(n.$$.fragment),i=P(),w(o.$$.fragment)},m(l,c){b(e,l,c),p(l,r,c),b(n,l,c),p(l,i,c),b(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 u={};c&44&&(u.$$scope={dirty:c,ctx:l}),n.$set(u);const d={};c&34&&(d.$$scope={dirty:c,ctx:l}),o.$set(d)},i(l){s||(f(e.$$.fragment,l),f(n.$$.fragment,l),f(o.$$.fragment,l),s=!0)},o(l){m(e.$$.fragment,l),m(n.$$.fragment,l),m(o.$$.fragment,l),s=!1},d(l){l&&(g(r),g(i)),I(e,l),I(n,l),I(o,l)}}}function Dr(t){let e,r;return e=new Ie({props:{gutter:"32px",$$slots:{default:[Br]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,[i]){const o={};i&47&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Cr(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 bt extends U{constructor(e){super(),N(this,e,Cr,Dr,T,{brandingInfo:0,onContinue:1,title:2,type:3},br)}}function It(t){let e,r,n,i,o;return{c(){e=S("If this error persists, please contact "),r=k("a"),n=S(t[1]),o=S("."),_(r,"href",i="mailto:"+t[1])},m(s,l){p(s,e,l),p(s,r,l),C(r,n),p(s,o,l)},p(s,l){l&2&&le(n,s[1]),l&2&&i!==(i="mailto:"+s[1])&&_(r,"href",i)},d(s){s&&(g(e),g(r),g(o))}}}function Mr(t){let e=t[3]()+"",r,n,i,o=t[1]&&It(t);return{c(){r=S(e),n=P(),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=It(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 Pr(t){let e,r;return e=new Hn({props:{slot:"icon"}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p:$,i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Qr(t){let e,r;return e=new bt({props:{title:"Something went wrong",brandingInfo:t[0],onContinue:t[2],type:"error",$$slots:{icon:[Pr],default:[Mr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(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||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Tr(t,e,r){let{brandingInfo:n=null}=e,{lastError:i}=e,{supportEmail:o=null}=e,{onContinue:s}=e;Ce(()=>{H.errorLog(`Displayed error: ${F[i.errorCode]}. Message: ${i.message??"None"}. Underlying error: ${i.underlyingErrorMessage??"None"}`)});function l(){switch(i.errorCode){case F.UnknownError:return"An unknown error occurred.";case F.ErrorSettingUpPurchase:return"Purchase not started due to an error.";case F.ErrorChargingPayment:return"Payment failed.";case F.NetworkError:return"Network error. Please check your internet connection.";case F.StripeError:return i.message;case F.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 Nr extends U{constructor(e){super(),N(this,e,Tr,Qr,T,{brandingInfo:0,lastError:4,supportEmail:1,onContinue:2})}}const Ur="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 Rr(t){L(t,"svelte-1609h93","img.svelte-1609h93{width:124px;height:124px;margin:0 auto}")}function Or(t){let e,r;return{c(){e=k("img"),te(e.src,r=Ur)||_(e,"src",r),_(e,"alt","icon"),_(e,"class","rcb-ui-asset-icon svelte-1609h93")},m(n,i){p(n,e,i)},p:$,i:$,o:$,d(n){n&&g(e)}}}class Sr extends U{constructor(e){super(),N(this,e,null,Or,T,{},Rr)}}function Lr(t){let e;return{c(){e=S("Your plan is now active.")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function Fr(t){let e,r;return e=new Sr({props:{slot:"icon"}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p:$,i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function xr(t){let e,r;return e=new bt({props:{type:"success",title:"Purchase successful",brandingInfo:t[0],onContinue:t[1],$$slots:{icon:[Fr],default:[Lr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(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||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Gr(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 Yr extends U{constructor(e){super(),N(this,e,Gr,xr,T,{brandingInfo:0,onContinue:1})}}function Hr(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 Kr=typeof window>"u";function qr(t){if(!Kr)return t.registerAppInfo({name:"svelte-stripe-js",url:"https://svelte-stripe-js.vercel.app"})}function jr(t){let e;return{c(){e=k("div")},m(r,n){p(r,e,n),t[6](e)},p:$,i:$,o:$,d(r){r&&g(e),t[6](null)}}}function Jr(t,e,r){let n,i;const o=gn(),{elements:s}=_n("stripe");let{options:l=void 0}=e;Ce(()=>(n=Hr(i,"payment",s,o,l),()=>n.destroy()));function c(){n.blur()}function a(){n.clear()}function u(){n.destroy()}function d(){n.focus()}function h(v){Me[v?"unshift":"push"](()=>{i=v,r(0,i)})}return t.$$set=v=>{"options"in v&&r(1,l=v.options)},[i,l,c,a,u,d,h]}class Vr extends U{constructor(e){super(),N(this,e,Jr,jr,T,{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 wt(t){let e;const r=t[15].default,n=j(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)&&V(n,r,i,i[14],e?J(r,i[14],o,null):W(i[14]),null)},i(i){e||(f(n,i),e=!0)},o(i){m(n,i),e=!1},d(i){n&&n.d(i)}}}function Wr(t){let e,r,n=t[1]&&t[0]&&wt(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&&f(n,1)):(n=wt(i),n.c(),f(n,1),n.m(e.parentNode,e)):n&&(K(),m(n,1,1,()=>{n=null}),q())},i(i){r||(f(n),r=!0)},o(i){m(n),r=!1},d(i){i&&g(e),n&&n.d(i)}}}function zr(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:u={}}=e,{labels:d="above"}=e,{loader:h="auto"}=e,{fonts:v=[]}=e,{locale:E="auto"}=e,{currency:B=void 0}=e,{amount:A=void 0}=e,{clientSecret:y=void 0}=e,{elements:R=null}=e;return t.$$set=M=>{"stripe"in M&&r(1,s=M.stripe),"mode"in M&&r(2,l=M.mode),"theme"in M&&r(3,c=M.theme),"variables"in M&&r(4,a=M.variables),"rules"in M&&r(5,u=M.rules),"labels"in M&&r(6,d=M.labels),"loader"in M&&r(7,h=M.loader),"fonts"in M&&r(8,v=M.fonts),"locale"in M&&r(9,E=M.locale),"currency"in M&&r(10,B=M.currency),"amount"in M&&r(11,A=M.amount),"clientSecret"in M&&r(12,y=M.clientSecret),"elements"in M&&r(0,R=M.elements),"$$scope"in M&&r(14,o=M.$$scope)},t.$$.update=()=>{t.$$.dirty&120&&r(13,n={theme:c,variables:a,rules:u,labels:d}),t.$$.dirty&16263&&s&&!R&&(r(0,R=s.elements({mode:l,currency:B,amount:A,appearance:n,clientSecret:y,fonts:v,loader:h,locale:E})),qr(s),pn("stripe",{stripe:s,elements:R})),t.$$.dirty&8705&&R&&R.update({appearance:n,locale:E})},[R,s,l,c,a,u,d,h,v,E,B,A,y,n,o,i]}class Xr extends U{constructor(e){super(),N(this,e,zr,Wr,T,{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 kt="https://js.stripe.com/v3",Zr=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,$t="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",ei=function(){for(var e=document.querySelectorAll('script[src^="'.concat(kt,'"]')),r=0;r<e.length;r++){var n=e[r];if(Zr.test(n.src))return n}return null},vt=function(e){var r=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(kt).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},ti=function(e,r){!e||!e._registerWrapper||e._registerWrapper({name:"stripe-js",version:"2.4.0",startTime:r})},we=null,Ne=null,Ue=null,ni=function(e){return function(){e(new Error("Failed to load Stripe.js"))}},ri=function(e,r){return function(){window.Stripe?e(window.Stripe):r(new Error("Stripe.js not available"))}},ii=function(e){return we!==null?we:(we=new Promise(function(r,n){if(typeof window>"u"||typeof document>"u"){r(null);return}if(window.Stripe&&e&&console.warn($t),window.Stripe){r(window.Stripe);return}try{var i=ei();if(i&&e)console.warn($t);else if(!i)i=vt(e);else if(i&&Ue!==null&&Ne!==null){var o;i.removeEventListener("load",Ue),i.removeEventListener("error",Ne),(o=i.parentNode)===null||o===void 0||o.removeChild(i),i=vt(e)}Ue=ri(r,n),Ne=ni(n),i.addEventListener("load",Ue),i.addEventListener("error",Ne)}catch(s){n(s);return}}),we.catch(function(r){return we=null,Promise.reject(r)}))},oi=function(e,r,n){if(e===null)return null;var i=e.apply(void 0,r);return ti(i,n),i},ke,yt=!1,Bt=function(){return ke||(ke=ii(null).catch(function(e){return ke=null,Promise.reject(e)}),ke)};Promise.resolve().then(function(){return Bt()}).catch(function(t){yt||console.warn(t)});var si=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];yt=!0;var i=Date.now();return Bt().then(function(o){return oi(o,r,i)})};function li(t){L(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 ci(t){let e,r;const n=t[0].default,i=j(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)&&V(i,n,o,o[1],r?J(n,o[1],s,null):W(o[1]),null)},i(o){r||(f(i,o),r=!0)},o(o){m(i,o),r=!1},d(o){o&&g(e),i&&i.d(o)}}}function ai(t){let e,r;return e=new fe({props:{as:"header",$$slots:{default:[ci]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,[i]){const o={};i&2&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function ui(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(1,i=o.$$scope)},[n,i]}class We extends U{constructor(e){super(),N(this,e,ui,ai,T,{},li)}}const fi="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 di(t){let e,r;return{c(){e=k("img"),te(e.src,r=fi)||_(e,"src",r),_(e,"alt","icon"),_(e,"class","rcb-ui-asset-icon")},m(n,i){p(n,e,i)},p:$,i:$,o:$,d(n){n&&g(e)}}}class mi extends U{constructor(e){super(),N(this,e,null,di,T,{})}}const $e={error:"#f2545b",warning:"#f4e971",focus:"#000080","grey-text-dark":"#000000","grey-text-light":"#767676","grey-ui-dark":"#dfdfdf",white:"#ffffff"};function gi(t){L(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 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.2",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(!/^rcb_[a-zA-Z0-9_.-]+$/.test(t))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:
|
|
6
|
+
-20px 0 #fff2;background:#fff2}}`)}function pi(t){let e;return{c(){e=k("div"),_(e,"class","processing svelte-rjmul6")},m(r,n){p(r,e,n)},p:$,i:$,o:$,d(r){r&&g(e)}}}class Dt extends U{constructor(e){super(),N(this,e,null,pi,T,{},gi)}}function _i(t){L(t,"svelte-1wxt892",".rcb-stripe-elements-container.svelte-1wxt892{width:100%;margin-top:32px;margin-bottom:24px}")}function Ai(t){let e,r;return e=new Je({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p:$,i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function hi(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:$e["grey-text-dark"],focusBoxShadow:"none",colorDanger:$e.error},rules:{".Input":{boxShadow:"none",border:`2px solid ${$e["grey-ui-dark"]}`},".Input:focus":{border:`2px solid ${$e.focus}`,outline:"none"},".Label":{marginBottom:"8px",fontWeight:"500",lineHeight:"22px"},".Input--invalid":{boxShadow:"none"}},$$slots:{default:[Bi]},$$scope:{ctx:t}};return t[2]!==void 0&&(c.elements=t[2]),r=new Xr({props:c}),Me.push(()=>wn(r,"elements",l)),{c(){e=k("form"),w(r.$$.fragment)},m(a,u){p(a,e,u),b(r,e,null),i=!0,o||(s=_e(e,"submit",ut(t[5])),o=!0)},p(a,u){const d={};u&8&&(d.stripe=a[3]),u&2051&&(d.$$scope={dirty:u,ctx:a}),!n&&u&4&&(n=!0,d.elements=a[2],En(()=>n=!1)),r.$set(d)},i(a){i||(f(r.$$.fragment,a),i=!0)},o(a){m(r.$$.fragment,a),i=!1},d(a){a&&g(e),I(r),o=!1,s()}}}function Ei(t){let e,r,n,i;return n=new mi({}),{c(){e=k("div"),e.textContent="Secure Checkout",r=P(),w(n.$$.fragment)},m(o,s){p(o,e,s),p(o,r,s),b(n,o,s),i=!0},p:$,i(o){i||(f(n.$$.fragment,o),i=!0)},o(o){m(n.$$.fragment,o),i=!1},d(o){o&&(g(e),g(r)),I(n,o)}}}function bi(t){let e,r,n;return r=new Vr({}),{c(){e=k("div"),w(r.$$.fragment),_(e,"class","rcb-stripe-elements-container svelte-1wxt892")},m(i,o){p(i,e,o),b(r,e,null),n=!0},p:$,i(i){n||(f(r.$$.fragment,i),n=!0)},o(i){m(r.$$.fragment,i),n=!1},d(i){i&&g(e),I(r)}}}function Ii(t){let e;return{c(){e=S("Pay")},m(r,n){p(r,e,n)},i:$,o:$,d(r){r&&g(e)}}}function wi(t){let e,r;return e=new Dt({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function ki(t){let e,r,n,i;const o=[wi,Ii],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 u=e;e=l(c),e!==u&&(K(),m(s[u],1,1,()=>{s[u]=null}),q(),r=s[e],r||(r=s[e]=o[e](c),r.c()),f(r,1),r.m(n.parentNode,n))},i(c){i||(f(r),i=!0)},o(c){m(r),i=!1},d(c){c&&g(n),s[e].d(c)}}}function $i(t){let e;return{c(){e=S("Close")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function vi(t){let e,r,n,i;return e=new be({props:{disabled:t[0],$$slots:{default:[ki]},$$scope:{ctx:t}}}),n=new be({props:{disabled:t[0],intent:"secondary",$$slots:{default:[$i]},$$scope:{ctx:t}}}),n.$on("click",function(){se(t[1])&&t[1].apply(this,arguments)}),{c(){w(e.$$.fragment),r=P(),w(n.$$.fragment)},m(o,s){b(e,o,s),p(o,r,s),b(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||(f(e.$$.fragment,o),f(n.$$.fragment,o),i=!0)},o(o){m(e.$$.fragment,o),m(n.$$.fragment,o),i=!1},d(o){o&&g(r),I(e,o),I(n,o)}}}function yi(t){let e,r;return e=new Ie({props:{$$slots:{default:[vi]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&2051&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Bi(t){let e,r,n,i,o,s;return e=new We({props:{$$slots:{default:[Ei]},$$scope:{ctx:t}}}),n=new fe({props:{$$slots:{default:[bi]},$$scope:{ctx:t}}}),o=new Ve({props:{$$slots:{default:[yi]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment),r=P(),w(n.$$.fragment),i=P(),w(o.$$.fragment)},m(l,c){b(e,l,c),p(l,r,c),b(n,l,c),p(l,i,c),b(o,l,c),s=!0},p(l,c){const a={};c&2048&&(a.$$scope={dirty:c,ctx:l}),e.$set(a);const u={};c&2048&&(u.$$scope={dirty:c,ctx:l}),n.$set(u);const d={};c&2051&&(d.$$scope={dirty:c,ctx:l}),o.$set(d)},i(l){s||(f(e.$$.fragment,l),f(n.$$.fragment,l),f(o.$$.fragment,l),s=!0)},o(l){m(e.$$.fragment,l),m(n.$$.fragment,l),m(o.$$.fragment,l),s=!1},d(l){l&&(g(r),g(i)),I(e,l),I(n,l),I(o,l)}}}function Di(t){let e,r,n,i;const o=[hi,Ai],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 u=r;r=l(c),r===u?s[r].p(c,a):(K(),m(s[u],1,1,()=>{s[u]=null}),q(),n=s[r],n?n.p(c,a):(n=s[r]=o[r](c),n.c()),f(n,1),n.m(e,null))},i(c){i||(f(n),i=!0)},o(c){m(n),i=!1},d(c){c&&g(e),s[r].d()}}}function Ci(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,u,d;Ce(async()=>{const E=s.data.publishable_api_key,B=s.data.stripe_account_id;if(!E||!B)throw new Error("Stripe publishable key or account ID not found");r(3,a=await si(E,{stripeAccount:B}))});const h=async()=>{if(l||!a||!d)return;r(0,l=!0);const E=await a.confirmSetup({elements:d,redirect:"if_required"});E.error?(r(0,l=!1),o(new z(F.StripeError,E.error.message))):i()};function v(E){u=E,r(2,u)}return t.$$set=E=>{"onClose"in E&&r(1,n=E.onClose),"onContinue"in E&&r(6,i=E.onContinue),"onError"in E&&r(7,o=E.onError),"paymentInfoCollectionMetadata"in E&&r(8,s=E.paymentInfoCollectionMetadata),"processing"in E&&r(0,l=E.processing)},t.$$.update=()=>{t.$$.dirty&4&&u&&u._elements.length>0&&(d=u)},[l,n,u,a,c,h,i,o,s,v]}class Mi extends U{constructor(e){super(),N(this,e,Ci,Di,T,{onClose:1,onContinue:6,onError:7,paymentInfoCollectionMetadata:8,processing:0},_i)}}function Pi(t){L(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 Qi(t){let e;return{c(){e=S("Billing email address")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function Ct(t){let e,r;return{c(){e=k("div"),r=S(t[2]),_(e,"class","form-error svelte-favd20")},m(n,i){p(n,e,i),C(e,r)},p(n,i){i&4&&le(r,n[2])},d(n){n&&g(e)}}}function Ti(t){let e,r,n,i,o,s,l,c,a,u=t[2]&&Ct(t);return{c(){e=k("div"),r=k("div"),r.innerHTML='<label for="email">Email</label>',n=P(),i=k("div"),o=k("input"),l=P(),u&&u.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(d,h){p(d,e,h),C(e,r),C(e,n),C(e,i),C(i,o),ft(o,t[3]),C(e,l),u&&u.m(e,null),c||(a=_e(o,"input",t[7]),c=!0)},p(d,h){h&8&&o.value!==d[3]&&ft(o,d[3]),h&16&&s!==(s="form-input "+d[4]+" svelte-favd20")&&_(i,"class",s),d[2]?u?u.p(d,h):(u=Ct(d),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},d(d){d&&g(e),u&&u.d(),c=!1,a()}}}function Ni(t){let e;return{c(){e=S("Continue")},m(r,n){p(r,e,n)},i:$,o:$,d(r){r&&g(e)}}}function Ui(t){let e,r;return e=new Dt({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Ri(t){let e,r,n,i;const o=[Ui,Ni],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 u=e;e=l(c),e!==u&&(K(),m(s[u],1,1,()=>{s[u]=null}),q(),r=s[e],r||(r=s[e]=o[e](c),r.c()),f(r,1),r.m(n.parentNode,n))},i(c){i||(f(r),i=!0)},o(c){m(r),i=!1},d(c){c&&g(n),s[e].d(c)}}}function Oi(t){let e;return{c(){e=S("Close")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function Si(t){let e,r,n,i;return e=new be({props:{disabled:t[1],$$slots:{default:[Ri]},$$scope:{ctx:t}}}),n=new be({props:{intent:"secondary",disabled:t[1],$$slots:{default:[Oi]},$$scope:{ctx:t}}}),n.$on("click",function(){se(t[0])&&t[0].apply(this,arguments)}),{c(){w(e.$$.fragment),r=P(),w(n.$$.fragment)},m(o,s){b(e,o,s),p(o,r,s),b(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||(f(e.$$.fragment,o),f(n.$$.fragment,o),i=!0)},o(o){m(e.$$.fragment,o),m(n.$$.fragment,o),i=!1},d(o){o&&g(r),I(e,o),I(n,o)}}}function Li(t){let e,r;return e=new Ie({props:{$$slots:{default:[Si]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&259&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Fi(t){let e,r,n,i,o,s,l,c,a;return r=new We({props:{$$slots:{default:[Qi]},$$scope:{ctx:t}}}),i=new fe({props:{$$slots:{default:[Ti]},$$scope:{ctx:t}}}),s=new Ve({props:{$$slots:{default:[Li]},$$scope:{ctx:t}}}),{c(){e=k("form"),w(r.$$.fragment),n=P(),w(i.$$.fragment),o=P(),w(s.$$.fragment),_(e,"class","svelte-favd20")},m(u,d){p(u,e,d),b(r,e,null),C(e,n),b(i,e,null),C(e,o),b(s,e,null),l=!0,c||(a=_e(e,"submit",ut(t[5])),c=!0)},p(u,[d]){const h={};d&256&&(h.$$scope={dirty:d,ctx:u}),r.$set(h);const v={};d&284&&(v.$$scope={dirty:d,ctx:u}),i.$set(v);const E={};d&259&&(E.$$scope={dirty:d,ctx:u}),s.$set(E)},i(u){l||(f(r.$$.fragment,u),f(i.$$.fragment,u),f(s.$$.fragment,u),l=!0)},o(u){m(r.$$.fragment,u),m(i.$$.fragment,u),m(s.$$.fragment,u),l=!1},d(u){u&&g(e),I(r),I(i),I(s),c=!1,a()}}}function xi(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 u(){n=this.value,r(3,n)}return t.$$set=d=>{"onContinue"in d&&r(6,s=d.onContinue),"onClose"in d&&r(0,l=d.onClose),"processing"in d&&r(1,c=d.processing)},t.$$.update=()=>{t.$$.dirty&4&&r(4,o=i?"error":"")},r(3,n=""),r(2,i=""),[l,c,i,n,o,a,s,u]}class Gi extends U{constructor(e){super(),N(this,e,xi,Fi,T,{onContinue:6,onClose:0,processing:1},Pi)}}function Yi(t){L(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 Hi(t){let e,r;const n=t[1].default,i=j(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)&&V(i,n,o,o[0],r?J(n,o[0],s,null):W(o[0]),null)},i(o){r||(f(i,o),r=!0)},o(o){m(i,o),r=!1},d(o){o&&g(e),i&&i.d(o)}}}function Ki(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(0,i=o.$$scope)},[i,n]}class qi extends U{constructor(e){super(),N(this,e,Ki,Hi,T,{},Yi)}}function ji(t){L(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 Ji(t){let e,r,n,i;const o=t[2].default,s=j(o,t,t[1],null);return{c(){e=k("div"),r=k("main"),s&&s.c(),_(r,"class",n=pe(`rcb-modal-main ${t[0]?"rcb-modal-dark":""}`)+" svelte-ioxu5d"),_(e,"class","rcb-modal-container svelte-ioxu5d")},m(l,c){p(l,e,c),C(e,r),s&&s.m(r,null),i=!0},p(l,[c]){s&&s.p&&(!i||c&2)&&V(s,o,l,l[1],i?J(o,l[1],c,null):W(l[1]),null),(!i||c&1&&n!==(n=pe(`rcb-modal-main ${l[0]?"rcb-modal-dark":""}`)+" svelte-ioxu5d"))&&_(r,"class",n)},i(l){i||(f(s,l),i=!0)},o(l){m(s,l),i=!1},d(l){l&&g(e),s&&s.d(l)}}}function Vi(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 Wi extends U{constructor(e){super(),N(this,e,Vi,Ji,T,{dark:0},ji)}}function zi(t){let e;const r=t[1].default,n=j(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)&&V(n,r,i,i[2],e?J(r,i[2],o,null):W(i[2]),null)},i(i){e||(f(n,i),e=!0)},o(i){m(n,i),e=!1},d(i){n&&n.d(i)}}}function Xi(t){let e,r;return e=new qi({props:{$$slots:{default:[Zi]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&4&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Zi(t){let e;const r=t[1].default,n=j(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)&&V(n,r,i,i[2],e?J(r,i[2],o,null):W(i[2]),null)},i(i){e||(f(n,i),e=!0)},o(i){m(n,i),e=!1},d(i){n&&n.d(i)}}}function eo(t){let e,r,n,i;const o=[Xi,zi],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 u=e;e=l(c),e===u?s[e].p(c,a):(K(),m(s[u],1,1,()=>{s[u]=null}),q(),r=s[e],r?r.p(c,a):(r=s[e]=o[e](c),r.c()),f(r,1),r.m(n.parentNode,n))},i(c){i||(f(r),i=!0)},o(c){m(r),i=!1},d(c){c&&g(n),s[e].d(c)}}}function to(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 no extends U{constructor(e){super(),N(this,e,to,eo,T,{condition:0})}}const ro=t=>({}),Mt=t=>({});function io(t){let e,r;const n=t[1].header,i=j(n,t,t[2],Mt),o=t[1].default,s=j(o,t,t[2],null);return{c(){i&&i.c(),e=P(),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)&&V(i,n,l,l[2],r?J(n,l[2],c,ro):W(l[2]),Mt),s&&s.p&&(!r||c&4)&&V(s,o,l,l[2],r?J(o,l[2],c,null):W(l[2]),null)},i(l){r||(f(i,l),f(s,l),r=!0)},o(l){m(i,l),m(s,l),r=!1},d(l){l&&g(e),i&&i.d(l),s&&s.d(l)}}}function oo(t){let e,r;return e=new Wi({props:{dark:t[0],$$slots:{default:[io]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(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||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function so(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 Pt extends U{constructor(e){super(),N(this,e,so,oo,T,{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 ve{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 Qt?e:null}static convertPurchaseFlowErrorCodeToErrorCode(e){switch(e){case F.ErrorSettingUpPurchase:return 2;case F.ErrorChargingPayment:return 20;case F.NetworkError:return 10;case F.MissingEmailError:return 4;case F.StripeError:return 2;case F.UnknownError:return 0}}}var Qt=(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))(Qt||{});class Z extends Error{constructor(r,n,i){super(n);Q(this,"toString",()=>`PurchasesError(code: ${re[this.errorCode]}, message: ${this.message})`);this.errorCode=r,this.underlyingErrorMessage=i}static getForBackendError(r,n){const i=ve.getErrorCodeForBackendErrorCode(r);return new Z(i,ve.getPublicMessage(i),n)}static getForPurchasesFlowError(r){return new Z(ve.convertPurchaseFlowErrorCodeToErrorCode(r.errorCode),r.message,r.underlyingErrorMessage)}}class Tt extends Error{constructor(){super("Purchases must be configured before calling getInstance")}}const lo="0.3.0",de="https://api.revenuecat.com";var Re;(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"})(Re||(Re={}));function ze(t){return t?t.startsWith("rcb_sb_"):!1}async function me(t,e,r,n){try{const i=await fetch(t.url(),{method:t.method,headers:uo(e,n),body:ao(r)});return await co(i,t),await i.json()}catch(i){throw i instanceof TypeError?new Z(re.NetworkError,ve.getPublicMessage(re.NetworkError),i.message):i}}async function co(t,e){const r=t.status;if(r>=Re.INTERNAL_SERVER_ERROR)Xe(e,r,await t.text());else if(r>=Re.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=ve.convertCodeToBackendErrorCode(o);if(l==null)Xe(e,r,i);else throw Z.getForBackendError(l,s)}else Xe(e,r,i)}}function Xe(t,e,r){throw new Z(re.UnknownBackendError,`Unknown backend error. Request: ${t.name}. Status code: ${e}. Body: ${r}.`)}function ao(t){return t==null?null:JSON.stringify(t)}function uo(t,e){let r={Authorization:`Bearer ${t}`,"Content-Type":"application/json",Accept:"application/json","X-Platform":"web","X-Version":lo,"X-Is-Sandbox":`${ze(t)}`};return e!=null&&(r={...r,...e}),r}const Nt="/v1/subscribers",Oe="/rcbilling/v1";class fo{constructor(e){Q(this,"appUserId");Q(this,"method","GET");Q(this,"name","getOfferings");this.appUserId=e}url(){const e=encodeURIComponent(this.appUserId);return`${de}${Nt}/${e}/offerings`}}class mo{constructor(){Q(this,"method","POST");Q(this,"name","subscribe")}url(){return`${de}${Oe}/subscribe`}}class go{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}${Oe}/subscribers/${e}/products?id=${r}`}}class po{constructor(e){Q(this,"method","GET");Q(this,"name","getCustomerInfo");Q(this,"appUserId");this.appUserId=e}url(){const e=encodeURIComponent(this.appUserId);return`${de}${Nt}/${e}`}}class _o{constructor(){Q(this,"method","GET");Q(this,"name","getBrandingInfo")}url(){return`${de}${Oe}/branding`}}class Ao{constructor(e){Q(this,"method","GET");Q(this,"name","getCheckoutStatus");Q(this,"operationSessionId");this.operationSessionId=e}url(){return`${de}${Oe}/checkout/${this.operationSessionId}`}}class ho{constructor(e){Q(this,"API_KEY");this.API_KEY=e}async getOfferings(e){return await me(new fo(e),this.API_KEY)}async getCustomerInfo(e){return await me(new po(e),this.API_KEY)}async getProducts(e,r){return await me(new go(e,r),this.API_KEY)}async getBrandingInfo(){return await me(new _o,this.API_KEY)}async postSubscribe(e,r,n,i,o){const s={app_user_id:e,product_id:r,email:n,presented_offering_identifier:i};return o&&o!=="base_option"&&(s.offer_id=o),await me(new mo,this.API_KEY,s)}async getCheckoutStatus(e){return await me(new Ao(e),this.API_KEY)}}const Eo="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 bo(t){let e,r;return{c(){e=k("img"),te(e.src,r=Eo)||_(e,"src",r),_(e,"alt","icon"),_(e,"class","rcb-ui-asset-icon")},m(n,i){p(n,e,i)},p:$,i:$,o:$,d(n){n&&g(e)}}}class Io extends U{constructor(e){super(),N(this,e,null,bo,T,{})}}function wo(t){L(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 ko(t){let e;return{c(){e=k("div"),e.textContent="Sandbox",_(e,"class","svelte-1rhrjxe")},m(r,n){p(r,e,n)},p:$,i:$,o:$,d(r){r&&g(e)}}}class $o extends U{constructor(e){super(),N(this,e,null,ko,T,{},wo)}}function vo(t){L(t,"svelte-1qect5g",`.rcb-ui-container.svelte-1qect5g{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-1qect5g{width:100vw;width:100 dvw;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-1qect5g{margin-right:16px;flex:320px 1 0;max-width:480px}.rcb-ui-main.svelte-1qect5g{flex:480px 1 0;max-width:640px}@media screen and (max-width: 960px){.rcb-ui-layout.svelte-1qect5g{flex-direction:column;align-items:center;justify-content:center;height:100%;min-width:100%}.rcb-ui-aside.svelte-1qect5g{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-1qect5g{flex:none;max-width:none;min-width:100%}}@media screen and (max-width: 960px) and (max-height: 960px){.rcb-ui-layout.svelte-1qect5g{overflow-y:scroll;justify-content:flex-start;padding:16px 0px}}`)}function Ut(t){let e,r,n;return r=new Pt({props:{dark:!0,$$slots:{header:[Mo],default:[yo]},$$scope:{ctx:t}}}),{c(){e=k("div"),w(r.$$.fragment),_(e,"class","rcb-ui-aside svelte-1qect5g")},m(i,o){p(i,e,o),b(r,e,null),n=!0},p(i,o){const s={};o&67108894&&(s.$$scope={dirty:o,ctx:i}),r.$set(s)},i(i){n||(f(r.$$.fragment,i),n=!0)},o(i){m(r.$$.fragment,i),n=!1},d(i){i&&g(e),I(r)}}}function Rt(t){let e,r;return e=new pt({props:{productDetails:t[3],purchaseOption:t[1]}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&8&&(o.productDetails=n[3]),i&2&&(o.purchaseOption=n[1]),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function yo(t){let e,r,n=t[3]&&t[1]&&Rt(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[3]&&i[1]?n?(n.p(i,o),o&10&&f(n,1)):(n=Rt(i),n.c(),f(n,1),n.m(e.parentNode,e)):n&&(K(),m(n,1,1,()=>{n=null}),q())},i(i){r||(f(n),r=!0)},o(i){m(n),r=!1},d(i){i&&g(e),n&&n.d(i)}}}function Bo(t){let e,r;return e=new Io({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Do(t){let e,r;return e=new $o({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Co(t){let e,r,n,i,o,s,l;e=new ht({props:{brandingInfo:t[4]}});const c=[Do,Bo],a=[];function u(d,h){return h&4&&(n=null),n==null&&(n=!!d[2].isSandbox()),n?0:1}return i=u(t,-1),o=a[i]=c[i](t),{c(){w(e.$$.fragment),r=P(),o.c(),s=ne()},m(d,h){b(e,d,h),p(d,r,h),a[i].m(d,h),p(d,s,h),l=!0},p(d,h){const v={};h&16&&(v.brandingInfo=d[4]),e.$set(v);let E=i;i=u(d,h),i!==E&&(K(),m(a[E],1,1,()=>{a[E]=null}),q(),o=a[i],o||(o=a[i]=c[i](d),o.c()),f(o,1),o.m(s.parentNode,s))},i(d){l||(f(e.$$.fragment,d),f(o),l=!0)},o(d){m(e.$$.fragment,d),m(o),l=!1},d(d){d&&(g(r),g(s)),I(e,d),a[i].d(d)}}}function Mo(t){let e,r;return e=new We({props:{slot:"header",$$slots:{default:[Co]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&67108884&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Ot(t){let e,r;return e=new pt({props:{productDetails:t[3],purchaseOption:t[1]}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&8&&(o.productDetails=n[3]),i&2&&(o.purchaseOption=n[1]),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function St(t){let e,r;return e=new Je({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Lt(t){let e,r;return e=new Gi({props:{onContinue:t[11],onClose:t[10],processing:t[7]==="processing-auth-info"}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&128&&(o.processing=n[7]==="processing-auth-info"),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Ft(t){let e,r;return e=new Mi({props:{paymentInfoCollectionMetadata:t[5],onContinue:t[11],onClose:t[10],onError:t[12],processing:t[7]==="polling-purchase-status"}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&32&&(o.paymentInfoCollectionMetadata=n[5]),i&128&&(o.processing=n[7]==="polling-purchase-status"),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function xt(t){let e,r;return e=new Je({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Gt(t){var n;let e,r;return e=new Nr({props:{brandingInfo:t[4],lastError:t[6]??new z(F.UnknownError,"Unknown error without state set."),supportEmail:(n=t[4])==null?void 0:n.seller_company_support_email,onContinue:t[13]}}),{c(){w(e.$$.fragment)},m(i,o){b(e,i,o),r=!0},p(i,o){var l;const s={};o&16&&(s.brandingInfo=i[4]),o&64&&(s.lastError=i[6]??new z(F.UnknownError,"Unknown error without state set.")),o&16&&(s.supportEmail=(l=i[4])==null?void 0:l.seller_company_support_email),e.$set(s)},i(i){r||(f(e.$$.fragment,i),r=!0)},o(i){m(e.$$.fragment,i),r=!1},d(i){I(e,i)}}}function Yt(t){let e,r;return e=new Yr({props:{brandingInfo:t[4],onContinue:t[11]}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&16&&(o.brandingInfo=n[4]),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Po(t){let e,r,n,i,o,s,l,c,a=t[7]==="present-offer"&&t[3]&&t[1]&&Ot(t),u=t[7]==="present-offer"&&!t[3]&&St(),d=(t[7]==="needs-auth-info"||t[7]==="processing-auth-info")&&Lt(t),h=t[5]&&(t[7]==="needs-payment-info"||t[7]==="polling-purchase-status")&&Ft(t),v=t[7]==="loading"&&xt(),E=t[7]==="error"&&Gt(t),B=t[7]==="success"&&Yt(t);return{c(){a&&a.c(),e=P(),u&&u.c(),r=P(),d&&d.c(),n=P(),h&&h.c(),i=P(),v&&v.c(),o=P(),E&&E.c(),s=P(),B&&B.c(),l=ne()},m(A,y){a&&a.m(A,y),p(A,e,y),u&&u.m(A,y),p(A,r,y),d&&d.m(A,y),p(A,n,y),h&&h.m(A,y),p(A,i,y),v&&v.m(A,y),p(A,o,y),E&&E.m(A,y),p(A,s,y),B&&B.m(A,y),p(A,l,y),c=!0},p(A,y){A[7]==="present-offer"&&A[3]&&A[1]?a?(a.p(A,y),y&138&&f(a,1)):(a=Ot(A),a.c(),f(a,1),a.m(e.parentNode,e)):a&&(K(),m(a,1,1,()=>{a=null}),q()),A[7]==="present-offer"&&!A[3]?u?y&136&&f(u,1):(u=St(),u.c(),f(u,1),u.m(r.parentNode,r)):u&&(K(),m(u,1,1,()=>{u=null}),q()),A[7]==="needs-auth-info"||A[7]==="processing-auth-info"?d?(d.p(A,y),y&128&&f(d,1)):(d=Lt(A),d.c(),f(d,1),d.m(n.parentNode,n)):d&&(K(),m(d,1,1,()=>{d=null}),q()),A[5]&&(A[7]==="needs-payment-info"||A[7]==="polling-purchase-status")?h?(h.p(A,y),y&160&&f(h,1)):(h=Ft(A),h.c(),f(h,1),h.m(i.parentNode,i)):h&&(K(),m(h,1,1,()=>{h=null}),q()),A[7]==="loading"?v?y&128&&f(v,1):(v=xt(),v.c(),f(v,1),v.m(o.parentNode,o)):v&&(K(),m(v,1,1,()=>{v=null}),q()),A[7]==="error"?E?(E.p(A,y),y&128&&f(E,1)):(E=Gt(A),E.c(),f(E,1),E.m(s.parentNode,s)):E&&(K(),m(E,1,1,()=>{E=null}),q()),A[7]==="success"?B?(B.p(A,y),y&128&&f(B,1)):(B=Yt(A),B.c(),f(B,1),B.m(l.parentNode,l)):B&&(K(),m(B,1,1,()=>{B=null}),q())},i(A){c||(f(a),f(u),f(d),f(h),f(v),f(E),f(B),c=!0)},o(A){m(a),m(u),m(d),m(h),m(v),m(E),m(B),c=!1},d(A){A&&(g(e),g(r),g(n),g(i),g(o),g(s),g(l)),a&&a.d(A),u&&u.d(A),d&&d.d(A),h&&h.d(A),v&&v.d(A),E&&E.d(A),B&&B.d(A)}}}function Qo(t){let e,r=t[9].includes(t[7]),n,i,o,s,l=r&&Ut(t);return o=new Pt({props:{$$slots:{default:[Po]},$$scope:{ctx:t}}}),{c(){e=k("div"),l&&l.c(),n=P(),i=k("div"),w(o.$$.fragment),_(i,"class","rcb-ui-main svelte-1qect5g"),_(e,"class","rcb-ui-layout svelte-1qect5g"),_(e,"style",t[8])},m(c,a){p(c,e,a),l&&l.m(e,null),C(e,n),C(e,i),b(o,i,null),s=!0},p(c,a){a&128&&(r=c[9].includes(c[7])),r?l?(l.p(c,a),a&128&&f(l,1)):(l=Ut(c),l.c(),f(l,1),l.m(e,n)):l&&(K(),m(l,1,1,()=>{l=null}),q());const u={};a&67109114&&(u.$$scope={dirty:a,ctx:c}),o.$set(u)},i(c){s||(f(l),f(o.$$.fragment,c),s=!0)},o(c){m(l),m(o.$$.fragment,c),s=!1},d(c){c&&g(e),l&&l.d(),I(o)}}}function To(t){let e,r,n;return r=new no({props:{condition:t[0],$$slots:{default:[Qo]},$$scope:{ctx:t}}}),{c(){e=k("div"),w(r.$$.fragment),_(e,"class","rcb-ui-container svelte-1qect5g")},m(i,o){p(i,e,o),b(r,e,null),n=!0},p(i,[o]){const s={};o&1&&(s.condition=i[0]),o&67109118&&(s.$$scope={dirty:o,ctx:i}),r.$set(s)},i(i){n||(f(r.$$.fragment,i),n=!0)},o(i){m(r.$$.fragment,i),n=!1},d(i){i&&g(e),I(r)}}}function No(t,e,r){var Kt,qt;let{asModal:n=!0}=e,{customerEmail:i}=e,{appUserId:o}=e,{rcPackage:s}=e,{purchaseOption:l}=e,{onFinished:c}=e,{onError:a}=e,{onClose:u}=e,{purchases:d}=e,{backend:h}=e,{purchaseOperationHelper:v}=e;const E=Object.entries($e).map(([D,et])=>`--rc-color-${D}: ${et}`).join("; ");let B=null,A=null,y=null,R=null;const M=((Kt=s==null?void 0:s.rcBillingProduct)==null?void 0:Kt.identifier)??null,Le=(qt=s==null?void 0:s.rcBillingProduct)==null?void 0:qt.defaultSubscriptionOption,G=l||Le;let O="present-offer";const Fe=["present-offer","needs-auth-info","processing-auth-info","needs-payment-info","polling-purchase-status","loading"];Ce(async()=>{if(r(3,B=s.rcBillingProduct),r(4,A=await h.getBrandingInfo()),O==="present-offer"){i?Ht():r(7,O="needs-auth-info");return}});const xe=()=>{u()},Ht=()=>{if(M===null){ye(new z(F.ErrorSettingUpPurchase,"Product ID was not set before purchase."));return}else O==="present-offer"&&r(7,O="loading");if(!i){ye(new z(F.MissingEmailError));return}v.startPurchase(o,M,G,i,s.rcBillingProduct.presentedOfferingIdentifier).then(D=>{if(D.next_action==="collect_payment_info"){r(7,O="needs-payment-info"),r(5,y=D);return}if(D.next_action==="completed"){r(7,O="success");return}}).catch(D=>{ye(new z(F.ErrorSettingUpPurchase,D.message,D.underlyingErrorMessage))})},Vo=D=>{if(O==="needs-auth-info"){D&&(r(14,i=D.email),r(7,O="processing-auth-info")),Ht();return}if(O==="needs-payment-info"){r(7,O="polling-purchase-status"),v.pollCurrentPurchaseForCompletion().then(()=>{r(7,O="success")}).catch(et=>{ye(et)});return}if(O==="success"||O==="error"){c();return}r(7,O="success")},ye=D=>{r(6,R=D),r(7,O="error")},Wo=()=>{a(R??new z(F.UnknownError,"Unknown error without state set."))};return t.$$set=D=>{"asModal"in D&&r(0,n=D.asModal),"customerEmail"in D&&r(14,i=D.customerEmail),"appUserId"in D&&r(15,o=D.appUserId),"rcPackage"in D&&r(16,s=D.rcPackage),"purchaseOption"in D&&r(1,l=D.purchaseOption),"onFinished"in D&&r(17,c=D.onFinished),"onError"in D&&r(18,a=D.onError),"onClose"in D&&r(19,u=D.onClose),"purchases"in D&&r(2,d=D.purchases),"backend"in D&&r(20,h=D.backend),"purchaseOperationHelper"in D&&r(21,v=D.purchaseOperationHelper)},[n,l,d,B,A,y,R,O,E,Fe,xe,Vo,ye,Wo,i,o,s,c,a,u,h,v]}class Uo extends U{constructor(e){super(),N(this,e,No,To,T,{asModal:0,customerEmail:14,appUserId:15,rcPackage:16,purchaseOption:1,onFinished:17,onError:18,onClose:19,purchases:2,backend:20,purchaseOperationHelper:21},vo)}}function Ro(t){return t.expires_date==null?!0:new Date(t.expires_date)>new Date}function Oo(t,e,r,n){const i=e.product_identifier;if(i in r)return So(t,e,r[i]);if(i in n)return Lo(t,e,n[i]);throw new Z(re.CustomerInfoError,"Could not find entitlement product in subscriptions or non-subscriptions.")}function So(t,e,r){return{identifier:t,isActive:Ro(e),willRenew:Go(e,r),store:(r==null?void 0:r.store)??"unknown",latestPurchaseDate:new Date(e.purchase_date),originalPurchaseDate:new Date(e.purchase_date),expirationDate:Se(e.expires_date),productIdentifier:e.product_identifier,unsubscribeDetectedAt:Se(r==null?void 0:r.unsubscribe_detected_at),billingIssueDetectedAt:Se(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 Lo(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 Fo(t,e,r){const n={},i={};for(const o in t){const s=Oo(o,t[o],e,r);n[o]=s,s.isActive&&(i[o]=s)}return{all:n,active:i}}function Se(t){return t==null?null:new Date(t)}function xo(t){const e=Ho(t),r=t.subscriber,n=qo(r.non_subscriptions);return{entitlements:Fo(r.entitlements,r.subscriptions,n),allExpirationDatesByProduct:e,allPurchaseDatesByProduct:Yo(t,n),activeSubscriptions:Ko(e),managementURL:r.management_url,requestDate:new Date(t.request_date),firstSeenDate:new Date(r.first_seen),originalPurchaseDate:Se(r.original_purchase_date),originalAppUserId:t.subscriber.original_app_user_id}}function Go(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 Yo(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 Ho(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 Ko(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 qo(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 jo(t){if(!/^rcb_[a-zA-Z0-9_.-]+$/.test(t))throw new Z(re.InvalidCredentialsError,"Invalid API key. Use your RevenueCat Billing API key.")}function Jo(t){if(new Set(["no_user","null","none","nil","(null)","NaN","\\x00","","unidentified","undefined","unknown"]).has(t)||t.includes("/"))throw new Z(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 ee=class ee{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:ot(n,i),s={};return e.offerings.forEach(l=>{const c=ot(l,i);c!=null&&(s[l.identifier]=c)}),Object.keys(s).length==0&&H.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,ze(e)&&H.debugLog("Initializing Purchases SDK with sandbox API Key"),this.backend=new ho(this._API_KEY),this.purchaseOperationHelper=new Fn(this.backend)}static setLogLevel(e){H.setLogLevel(e)}static getSharedInstance(){if(ee.isConfigured())return ee.instance;throw new Tt}static isConfigured(){return ee.instance!==void 0}static configure(e,r){return ee.instance!==void 0&&H.warnLog("Purchases is already initialized. You normally should only configure Purchases once. Creating and returning new instance."),jo(e),Jo(r),ee.instance=new ee(e,r),ee.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){return this.purchase({rcPackage:e,customerEmail:r,htmlTarget:n})}purchase(e){const{rcPackage:r,purchaseOption:n,htmlTarget:i,customerEmail:o}=e;let s=i??document.getElementById("rcb-ui-root");if(s===null){const u=document.createElement("div");u.className="rcb-ui-root",document.body.appendChild(u),s=u}if(s===null)throw new Error("Could not generate a mount point for the billing widget");const l=s,c=!i,a=this._appUserId;return H.debugLog(`Presenting purchase form for package ${r.identifier}`),new Promise((u,d)=>{new Uo({target:l,props:{appUserId:a,rcPackage:r,purchaseOption:n,customerEmail:o,onFinished:async()=>{H.debugLog("Purchase finished"),l.innerHTML="",u({customerInfo:await this._getCustomerInfoForUserId(a)})},onClose:()=>{l.innerHTML="",H.debugLog("Purchase cancelled by user"),d(new Z(re.UserCancelledError))},onError:h=>{l.innerHTML="",d(Z.getForPurchasesFlowError(h))},purchases:this,backend:this.backend,purchaseOperationHelper:this.purchaseOperationHelper,asModal:c}})})}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&&H.debugLog(`Could not find product data for product ids:
|
|
8
8
|
${i.join()}.
|
|
9
|
-
Please check that your product configuration is correct.`)}isSandbox(){return
|
|
9
|
+
Please check that your product configuration is correct.`)}isSandbox(){return ze(this._API_KEY)}close(){ee.instance===this?ee.instance=void 0:H.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 xo(r)}};Q(ee,"instance");let Ze=ee;Y.ErrorCode=re,Y.LogLevel=x,Y.PackageType=rt,Y.Purchases=Ze,Y.PurchasesError=Z,Y.UninitializedPurchasesError=Tt,Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"})});
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.rcb-modal-section.svelte-1bzqb13{padding:8px 0;display:flex}section.rcb-modal-section.svelte-1bzqb13{flex-grow:1}.rcb-modal-section.svelte-1bzqb13:last-of-type{padding:0}.rcb-pricing-info.svelte-
|
|
1
|
+
.rcb-modal-section.svelte-1bzqb13{padding:8px 0;display:flex}section.rcb-modal-section.svelte-1bzqb13{flex-grow:1}.rcb-modal-section.svelte-1bzqb13:last-of-type{padding:0}.rcb-pricing-info.svelte-gf0gr5{display:flex;flex-direction:column;margin-top:102px;font-weight:500}.rcb-product-price.svelte-gf0gr5{font-size:24px;margin:12px 0}.rcb-product-price-after-trial.svelte-gf0gr5{margin-bottom:12px}.rcb-product-details.svelte-gf0gr5{opacity:.6;list-style-type:disc;list-style-position:inside;margin:0;padding:0}@media screen and (max-width: 960px){.rcb-pricing-info.svelte-gf0gr5{margin-top:48px}}.rcb-modal-loader.svelte-1mxx341{width:100%;flex-grow:1;min-height:100%;display:flex;justify-content:center;align-items:center}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)}footer.svelte-1f9z0o8{display:flex;flex-direction:column}.column.svelte-6o8e90{display:flex;flex-direction:column;justify-content:flex-start;gap:var(--gap, "8px");flex-grow:1}.close-button.svelte-14xreta{border:none;cursor:pointer;background-color:transparent;padding:0}.rcb-app-icon.svelte-44qpq9{width:40px;height:40px;border-radius:12px;box-shadow:0 1px 10px #0000001a;margin-right:16px}.rcb-app-icon-picture-container.svelte-44qpq9{height:40px}.rcb-app-icon.loading.svelte-44qpq9{background-color:gray}.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}.rcb-post-purchase-header-layout.svelte-17puakv{display:flex;justify-content:space-between;align-items:center;width:100%;margin-top:-4px}.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}img.svelte-1609h93{width:124px;height:124px;margin:0 auto}.rcb-header-layout.svelte-1xe711j{display:flex;justify-content:space-between;align-items:center;width:100%;font-size:24px;margin:0;font-weight:500}.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,-20px 0 #fff2;background:#fff2}25%{box-shadow:20px 0 #fff2,-20px 0 #fff;background:#fff2}50%{box-shadow:20px 0 #fff2,-20px 0 #fff2;background:#fff}75%{box-shadow:20px 0 #fff,-20px 0 #fff2;background:#fff2}to{box-shadow:20px 0 #fff2,-20px 0 #fff2;background:#fff2}}.rcb-stripe-elements-container.svelte-1wxt892{width:100%;margin-top:32px;margin-bottom:24px}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;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)}.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:#282828bf;display:flex;flex-direction:column;justify-content:space-around;z-index:1000001}.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}}div.svelte-1rhrjxe{background-color:var(--rc-color-warning);color:var(--rc-color-grey-text-dark);font-size:10px;font-weight:700;text-transform:uppercase;padding:4px 10px;line-height:10px;border-radius:9px;margin:0 0 0 16px}.rcb-ui-container.svelte-1qect5g{color-scheme:none;font-size:16px;line-height:1.5em;font-weight:400;font-family:-apple-system,"system-ui",Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif}.rcb-ui-layout.svelte-1qect5g{width:100vw;width:100 dvw;margin-right:auto;display:flex;justify-content:center;align-items:flex-start;position:relative;padding:0 80px;box-sizing:border-box}.rcb-ui-aside.svelte-1qect5g{margin-right:16px;flex:320px 1 0;max-width:480px}.rcb-ui-main.svelte-1qect5g{flex:480px 1 0;max-width:640px}@media screen and (max-width: 960px){.rcb-ui-layout.svelte-1qect5g{flex-direction:column;align-items:center;justify-content:center;height:100%;min-width:100%}.rcb-ui-aside.svelte-1qect5g{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-1qect5g{flex:none;max-width:none;min-width:100%}}@media screen and (max-width: 960px) and (max-height: 960px){.rcb-ui-layout.svelte-1qect5g{overflow-y:scroll;justify-content:flex-start;padding:16px 0}}
|