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