@revenuecat/purchases-js 0.8.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Purchases.es.d.ts +65 -6
- package/dist/Purchases.es.js +1676 -1414
- package/dist/Purchases.umd.js +13 -5
- package/dist/style.css +1 -1
- package/package.json +3 -2
package/dist/Purchases.umd.js
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
(function(E,m){typeof exports=="object"&&typeof module<"u"?m(exports):typeof define=="function"&&define.amd?define(["exports"],m):(E=typeof globalThis<"u"?globalThis:E||self,m(E.Purchases={}))})(this,function(E){"use strict";var Ps=Object.create;var dt=Object.defineProperty;var Cs=Object.getOwnPropertyDescriptor;var un=(E,m)=>(m=Symbol[E])?m:Symbol.for("Symbol."+E),Le=E=>{throw TypeError(E)};var fn=(E,m,N)=>m in E?dt(E,m,{enumerable:!0,configurable:!0,writable:!0,value:N}):E[m]=N;var ln=(E,m)=>dt(E,"name",{value:m,configurable:!0});var dn=E=>[,,,Ps((E==null?void 0:E[un("metadata")])??null)],gn=["class","method","getter","setter","accessor","field","value","get","set"],Se=E=>E!==void 0&&typeof E!="function"?Le("Function expected"):E,Ms=(E,m,N,oe,H)=>({kind:gn[E],name:m,metadata:oe,addInitializer:j=>N._?Le("Already initialized"):H.push(Se(j||null))}),gt=(E,m)=>fn(m,un("metadata"),E[3]),mn=(E,m,N,oe)=>{for(var H=0,j=E[m>>1],ie=j&&j.length;H<ie;H++)m&1?j[H].call(N):oe=j[H].call(N,oe);return oe},pn=(E,m,N,oe,H,j)=>{var ie,B,fe,ee,pe,F=m&7,we=!!(m&8),x=!!(m&16),he=F>3?E.length+1:F?we?1:2:0,q=gn[F+5],J=F>3&&(E[he-1]=[]),te=E[he]||(E[he]=[]),V=F&&(!x&&!we&&(H=H.prototype),F<5&&(F>3||!x)&&Cs(F<4?H:{get[N](){return cn(this,j)},set[N](T){return an(this,j,T)}},N));F?x&&F<4&&ln(j,(F>2?"set ":F>1?"get ":"")+N):ln(H,N);for(var P=oe.length-1;P>=0;P--)ee=Ms(F,N,fe={},E[3],te),F&&(ee.static=we,ee.private=x,pe=ee.access={has:x?T=>Ts(H,T):T=>N in T},F^3&&(pe.get=x?T=>(F^1?cn:Rs)(T,H,F^4?j:V.get):T=>T[N]),F>2&&(pe.set=x?(T,ye)=>an(T,H,ye,F^4?j:V.set):(T,ye)=>T[N]=ye)),B=(0,oe[P])(F?F<4?x?j:V[q]:F>4?void 0:{get:V.get,set:V.set}:H,ee),fe._=1,F^4||B===void 0?Se(B)&&(F>4?J.unshift(B):F?x?j=B:V[q]=B:H=B):typeof B!="object"||B===null?Le("Object expected"):(Se(ie=B.get)&&(V.get=ie),Se(ie=B.set)&&(V.set=ie),Se(ie=B.init)&&J.unshift(ie));return F||gt(E,H),V&&dt(H,N,V),x?F^4?j:V:H},M=(E,m,N)=>fn(E,typeof m!="symbol"?m+"":m,N),mt=(E,m,N)=>m.has(E)||Le("Cannot "+N),Ts=(E,m)=>Object(m)!==m?Le('Cannot use the "in" operator on this value'):E.has(m),cn=(E,m,N)=>(mt(E,m,"read from private field"),N?N.call(E):m.get(E));var an=(E,m,N,oe)=>(mt(E,m,"write to private field"),oe?oe.call(E,N):m.set(E,N),N),Rs=(E,m,N)=>(mt(E,m,"access private method"),N);var sn,ut;function m(){}function N(t,e){for(const r in e)t[r]=e[r];return t}function oe(t){return t()}function H(){return Object.create(null)}function j(t){t.forEach(oe)}function ie(t){return typeof t=="function"}function B(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let fe;function ee(t,e){return t===e?!0:(fe||(fe=document.createElement("a")),fe.href=e,t===fe.href)}function pe(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function F(t,e){const r=pe(t.srcset),n=pe(e||"");return n.length===r.length&&n.every(([i,o],s)=>o===r[s][1]&&(ee(r[s][0],i)||ee(i,r[s][0])))}function we(t){return Object.keys(t).length===0}function x(t,e,r,n){if(t){const i=he(t,e,r,n);return t[0](i)}}function he(t,e,r,n){return t[1]&&n?N(r.ctx.slice(),t[1](n(e))):r.ctx}function q(t,e,r,n){if(t[2]&&n){const i=t[2](n(r));if(e.dirty===void 0)return i;if(typeof i=="object"){const o=[],s=Math.max(e.dirty.length,i.length);for(let l=0;l<s;l+=1)o[l]=e.dirty[l]|i[l];return o}return e.dirty|i}return e.dirty}function J(t,e,r,n,i,o){if(i){const s=he(e,r,n,o);t.p(s,i)}}function te(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 V(t){return t??""}function P(t,e){t.appendChild(e)}function T(t,e,r){const n=ye(t);if(!n.getElementById(e)){const i=y("style");i.id=e,i.textContent=r,hn(n,i)}}function ye(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function hn(t,e){return P(t.head||t,e),e.sheet}function _(t,e,r){t.insertBefore(e,r||null)}function h(t){t.parentNode&&t.parentNode.removeChild(t)}function y(t){return document.createElement(t)}function Y(t){return document.createTextNode(t)}function O(){return Y(" ")}function ce(){return Y("")}function ke(t,e,r,n){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r,n)}function pt(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 _n=["width","height"];function An(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&&_n.indexOf(n)===-1?t[n]=e[n]:A(t,n,e[n])}function bn(t,e){Object.keys(e).forEach(r=>{En(t,r,e[r])})}function En(t,e,r){const n=e.toLowerCase();n in t?t[n]=typeof t[n]=="boolean"&&r===""?!0:r:e in t?t[e]=typeof t[e]=="boolean"&&r===""?!0:r:A(t,e,r)}function In(t){return/-/.test(t)?bn:An}function wn(t){return Array.from(t.childNodes)}function de(t,e){e=""+e,t.data!==e&&(t.data=e)}function ht(t,e){t.value=e??""}function yn(t,e,{bubbles:r=!1,cancelable:n=!1}={}){return new CustomEvent(t,{detail:e,bubbles:r,cancelable:n})}let ve;function $e(t){ve=t}function Be(){if(!ve)throw new Error("Function called outside component initialization");return ve}function kn(t){Be().$$.before_update.push(t)}function Fe(t){Be().$$.on_mount.push(t)}function vn(){const t=Be();return(e,r,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const o=yn(e,r,{cancelable:n});return i.slice().forEach(s=>{s.call(t,o)}),!o.defaultPrevented}return!0}}function $n(t,e){return Be().$$.context.set(t,e),e}function Bn(t){return Be().$$.context.get(t)}function _t(t,e){const r=t.$$.callbacks[e.type];r&&r.slice().forEach(n=>n.call(this,e))}const _e=[],xe=[];let Ae=[];const ze=[],Dn=Promise.resolve();let Xe=!1;function Pn(){Xe||(Xe=!0,Dn.then(At))}function Ze(t){Ae.push(t)}function Cn(t){ze.push(t)}const et=new Set;let be=0;function At(){if(be!==0)return;const t=ve;do{try{for(;be<_e.length;){const e=_e[be];be++,$e(e),Mn(e.$$)}}catch(e){throw _e.length=0,be=0,e}for($e(null),_e.length=0,be=0;xe.length;)xe.pop()();for(let e=0;e<Ae.length;e+=1){const r=Ae[e];et.has(r)||(et.add(r),r())}Ae.length=0}while(_e.length);for(;ze.length;)ze.pop()();Xe=!1,et.clear(),$e(t)}function Mn(t){if(t.fragment!==null){t.update(),j(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(Ze)}}function Tn(t){const e=[],r=[];Ae.forEach(n=>t.indexOf(n)===-1?e.push(n):r.push(n)),r.forEach(n=>n()),Ae=e}const Ge=new Set;let ge;function W(){ge={r:0,c:[],p:ge}}function z(){ge.r||j(ge.c),ge=ge.p}function f(t,e){t&&t.i&&(Ge.delete(t),t.i(e))}function g(t,e,r,n){if(t&&t.o){if(Ge.has(t))return;Ge.add(t),ge.c.push(()=>{Ge.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 k(t){t&&t.c()}function I(t,e,r){const{fragment:n,after_update:i}=t.$$;n&&n.m(e,r),Ze(()=>{const o=t.$$.on_mount.map(oe).filter(ie);t.$$.on_destroy?t.$$.on_destroy.push(...o):j(o),t.$$.on_mount=[]}),i.forEach(Ze)}function w(t,e){const r=t.$$;r.fragment!==null&&(Tn(r.after_update),j(r.on_destroy),r.fragment&&r.fragment.d(e),r.on_destroy=r.fragment=null,r.ctx=[])}function Qn(t,e){t.$$.dirty[0]===-1&&(_e.push(t),Pn(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function S(t,e,r,n,i,o,s=null,l=[-1]){const c=ve;$e(t);const a=t.$$={fragment:null,ctx:[],props:o,update:m,not_equal:i,bound:H(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:H(),dirty:l,skip_bound:!1,root:e.target||c.$$.root};s&&s(a.root);let u=!1;if(a.ctx=r?r(t,e.props||{},(d,b,...$)=>{const D=$.length?$[0]:b;return a.ctx&&i(a.ctx[d],a.ctx[d]=D)&&(!a.skip_bound&&a.bound[d]&&a.bound[d](D),u&&Qn(t,d)),b}):[],a.update(),u=!0,j(a.before_update),a.fragment=n?n(a.ctx):!1,e.target){if(e.hydrate){const d=wn(e.target);a.fragment&&a.fragment.l(d),d.forEach(h)}else a.fragment&&a.fragment.c();e.intro&&f(t.$$.fragment),I(t,e.target,e.anchor),At()}$e(c)}class L{constructor(){M(this,"$$");M(this,"$$set")}$destroy(){w(this,1),this.$destroy=m}$on(e,r){if(!ie(r))return m;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&&!we(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Nn="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Nn);function Un(t){T(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 tt(t){let e,r;const n=t[2].default,i=x(n,t,t[1],null);return{c(){e=y(t[0]),i&&i.c(),In(t[0])(e,{class:V("rcb-modal-section")+" svelte-1bzqb13"})},m(o,s){_(o,e,s),i&&i.m(e,null),r=!0},p(o,s){i&&i.p&&(!r||s&2)&&J(i,n,o,o[1],r?q(n,o[1],s,null):te(o[1]),null)},i(o){r||(f(i,o),r=!0)},o(o){g(i,o),r=!1},d(o){o&&h(e),i&&i.d(o)}}}function On(t){let e=t[0],r,n,i=t[0]&&tt(t);return{c(){i&&i.c(),r=ce()},m(o,s){i&&i.m(o,s),_(o,r,s),n=!0},p(o,[s]){o[0]?e?B(e,o[0])?(i.d(1),i=tt(o),e=o[0],i.c(),i.m(r.parentNode,r)):i.p(o,s):(i=tt(o),e=o[0],i.c(),i.m(r.parentNode,r)):e&&(i.d(1),i=null,e=o[0])},i(o){n||(f(i,o),n=!0)},o(o){g(i,o),n=!1},d(o){o&&h(r),i&&i.d(o)}}}function Sn(t,e,r){let{$$slots:n={},$$scope:i}=e,{as:o="section"}=e;return t.$$set=s=>{"as"in s&&r(0,o=s.as),"$$scope"in s&&r(1,i=s.$$scope)},[o,i,n]}class Ee extends L{constructor(e){super(),S(this,e,Sn,On,B,{as:0},Un)}}var se=(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))(se||{});class K{static setLogLevel(e){this.logLevel=e}static log(e,r=this.logLevel){const n=`[Purchases] ${e}`;if(!(this.logLevel<r||r===se.Silent))switch(r){case se.Error:console.error(n);break;case se.Warn:console.warn(n);break;case se.Info:console.info(n);break;case se.Debug:console.debug(n);break;case se.Verbose:console.debug(n);break}}static errorLog(e){this.log(e,se.Error)}static warnLog(e){this.log(e,se.Warn)}static infoLog(e){this.log(e,se.Info)}static debugLog(e){this.log(e,se.Debug)}static verboseLog(e){this.log(e,se.Verbose)}}M(K,"logLevel",se.Silent);var ae=(t=>(t.Year="year",t.Month="month",t.Week="week",t.Day="day",t))(ae||{});function nt(t){const e=t.match(/^PT?([0-9]+)([MDYW])$/);if(!e||e.length<3)return K.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 K.errorLog(`Invalid ISO 8601 unit duration format: ${t}`),null}}const Ln=(t,e,r)=>{const n=t/1e6;return new Intl.NumberFormat(r,{style:"currency",currency:e}).format(n)},Fn=t=>{const e=t.number;if(e===1)switch(t.unit){case ae.Year:return"yearly";case ae.Month:return"monthly";case ae.Week:return"weekly";case ae.Day:return"daily"}else return`every ${e} ${t.unit}s`},xn=t=>{const e=t.number;if(e===1)switch(t.unit){case ae.Year:return"1 year";case ae.Month:return"1 month";case ae.Week:return"1 week";case ae.Day:return"1 day"}else return`${e} ${t.unit}s`},bt=t=>{const e=nt(t);return e?Fn(e):"unknown"},Gn=t=>{const e=nt(t);return e?xn(e):"unknown"};function Yn(t){T(t,"svelte-gf0gr5",".rcb-pricing-info.svelte-gf0gr5{display:flex;flex-direction:column;margin-top:102px;font-weight:500}.rcb-product-price.svelte-gf0gr5{font-size:24px;margin:12px 0px}.rcb-product-price-after-trial.svelte-gf0gr5{margin-bottom:12px}.rcb-product-details.svelte-gf0gr5{opacity:0.6;list-style-type:disc;list-style-position:inside;margin:0px;padding:0px}@media screen and (max-width: 960px){.rcb-pricing-info.svelte-gf0gr5{margin-top:48px}}")}function Hn(t){let e=Gn(t[1].periodDuration)+"",r,n;return{c(){r=Y(e),n=Y(" free trial")},m(i,o){_(i,r,o),_(i,n,o)},p:m,d(i){i&&(h(r),h(n))}}}function Kn(t){let e=t[2].formattedPrice+"",r;return{c(){r=Y(e)},m(n,i){_(n,r,i)},p:m,d(n){n&&h(r)}}}function jn(t){let e;return{c(){e=y("span"),e.textContent=`${t[1]&&t[2]&&`${t[2].formattedPrice} after end of trial`}`,A(e,"class","rcb-product-price-after-trial svelte-gf0gr5")},m(r,n){_(r,e,n)},p:m,d(r){r&&h(e)}}}function Et(t){let e,r,n=bt(t[0].normalPeriodDuration)+"",i;return{c(){e=y("li"),r=Y("Renews "),i=Y(n)},m(o,s){_(o,e,s),P(e,r),P(e,i)},p(o,s){s&1&&n!==(n=bt(o[0].normalPeriodDuration)+"")&&de(i,n)},d(o){o&&h(e)}}}function qn(t){var U,Ne;let e,r,n=t[0].displayName+"",i,o,s,l,c,a,u,d,b,$,D,R=((U=t[1])==null?void 0:U.periodDuration)&&Hn(t),p=!((Ne=t[1])!=null&&Ne.periodDuration)&&t[2]&&Kn(t),v=t[1]&&t[2]&&jn(t),G=t[0].normalPeriodDuration&&Et(t);return{c(){e=y("div"),r=y("span"),i=Y(n),o=O(),s=y("span"),R&&R.c(),l=O(),p&&p.c(),c=O(),v&&v.c(),a=O(),u=y("ul"),G&&G.c(),d=O(),b=y("li"),b.textContent="Continues until canceled",$=O(),D=y("li"),D.textContent="Cancel anytime",A(s,"class","rcb-product-price svelte-gf0gr5"),A(u,"class","rcb-product-details svelte-gf0gr5"),A(e,"class","rcb-pricing-info svelte-gf0gr5")},m(Q,ue){_(Q,e,ue),P(e,r),P(r,i),P(e,o),P(e,s),R&&R.m(s,null),P(s,l),p&&p.m(s,null),P(e,c),v&&v.m(e,null),P(e,a),P(e,u),G&&G.m(u,null),P(u,d),P(u,b),P(u,$),P(u,D)},p(Q,ue){var We,Ue;ue&1&&n!==(n=Q[0].displayName+"")&&de(i,n),(We=Q[1])!=null&&We.periodDuration&&R.p(Q,ue),!((Ue=Q[1])!=null&&Ue.periodDuration)&&Q[2]&&p.p(Q,ue),Q[1]&&Q[2]&&v.p(Q,ue),Q[0].normalPeriodDuration?G?G.p(Q,ue):(G=Et(Q),G.c(),G.m(u,d)):G&&(G.d(1),G=null)},d(Q){Q&&h(e),R&&R.d(),p&&p.d(),v&&v.d(),G&&G.d()}}}function Jn(t){let e,r;return e=new Ee({props:{$$slots:{default:[qn]},$$scope:{ctx:t}}}),{c(){k(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const o={};i&33&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){w(e,n)}}}function Vn(t,e,r){var c;let{productDetails:n}=e,{purchaseOption:i}=e;const o=i,s=o==null?void 0:o.trial,l=(c=o==null?void 0:o.base)==null?void 0:c.price;return t.$$set=a=>{"productDetails"in a&&r(0,n=a.productDetails),"purchaseOption"in a&&r(3,i=a.purchaseOption)},[n,s,l,i]}class It extends L{constructor(e){super(),S(this,e,Vn,Jn,B,{productDetails:0,purchaseOption:3},Yn)}}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+rJryqvxGhxxGNLjkVcwMCCN6ZeLkNevDCcRYYKJJfZptyCQwdiijl0CDxdlLPryw2lymY9WzTs17ijVq69mzbM28Bd8x7u23bu46F7i16uXEvw5zi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B4QIThRGgGAxwIYIIBQ2LMlkJBCDFEsGOPEgA5aCK0tKmQChRkGEMgPIiDDhoRYjTR56CPGwiooXN6oENQikhYsWP65MJXglx4sVMoZsJdikRosWOMYSRPJih9q3cOPKnWuRSxa7eO9O3cJFCxe+frdMDQgAIfkEBQUAAQAsBQADACAAEAAACKYAAwgcSLAgwQcODCpcyNDAAYYQAzhpaIDhFYY+NOBY6HAhkyETFRLZ0CGKQgMVDV4RAoQKQxMdUpx8aJAJECYQnWzYcMQgSoNVgAy5CHGGhhI+aRIkMgRnxCohNvQoiLDgEyFDskQUuINDiK1Hfpgc+ETKQi0nVGxNkkSrwCw/hiBxu7XuFidAhARpgqWu3yxIhgApEtLvVipIgARBYthvlKaNFQYEADs=";function zn(t){let e,r;return{c(){e=y("img"),ee(e.src,r=Wn)||A(e,"src",r),A(e,"alt","spinner")},m(n,i){_(n,e,i)},p:m,i:m,o:m,d(n){n&&h(e)}}}class Xn extends L{constructor(e){super(),S(this,e,null,zn,B,{})}}function Zn(t){T(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 er(t){let e,r,n;return r=new Xn({}),{c(){e=y("div"),k(r.$$.fragment),A(e,"class","rcb-modal-loader svelte-1mxx341")},m(i,o){_(i,e,o),I(r,e,null),n=!0},p:m,i(i){n||(f(r.$$.fragment,i),n=!0)},o(i){g(r.$$.fragment,i),n=!1},d(i){i&&h(e),w(r)}}}class rt extends L{constructor(e){super(),S(this,e,null,er,B,{},Zn)}}var ne=(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[t.InvalidEmailError=38]="InvalidEmailError",t))(ne||{});class De{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. Please check your network connection and try again.";case 11:return"There was a credentials issue. Check the underlying error for more details.";case 12:return"Received unexpected response from the backend.";case 14:return"The app user id is not valid.";case 15:return"The operation is already in progress.";case 16:return"There was an unknown backend error.";case 17:return"Apple Subscription Key is invalid or not present. In order to provide subscription offers, you must first generate a subscription key. Please see https://docs.revenuecat.com/docs/ios-subscription-offers for more info.";case 18:return"The User is ineligible for that action.";case 19:return"App does not have sufficient permissions to make purchases.";case 20:return"The payment is pending.";case 21:return"One or more of the attributes sent could not be saved.";case 22:return"Called logOut but the current user is anonymous.";case 23:return"There is an issue with your configuration. Check the underlying error for more details.";case 24:return"There was a problem with the operation. Looks like we doesn't support that yet. Check the underlying error for more details.";case 25:return"A request for subscriber attributes returned none.";case 28:return"There was a problem related to the customer info.";case 36:return"Request failed signature verification. Please see https://rev.cat/trusted-entitlements for more info.";case 38:return"Email is not valid. Please provide a valid email address."}}static getErrorCodeForBackendErrorCode(e){switch(e){case 7101:case 7773:return 2;case 7102:return 7;case 7103:return 8;case 7107:case 7224:case 7225:return 11;case 7105:case 7106:case 7814:return 4;case 7772:return 6;case 7220:return 14;case 7229:return 2;case 7230:case 7e3:return 23;case 7231:return 2;case 7232:return 18;case 7263:case 7264:return 21;case 7104:case 7234:case 7226:case 7110:return 12;case 7662:return 24;case 7012:case 7834:return 38}}static convertCodeToBackendErrorCode(e){return e in wt?e:null}static convertPurchaseFlowErrorCodeToErrorCode(e){switch(e){case re.ErrorSettingUpPurchase:return 2;case re.ErrorChargingPayment:return 20;case re.NetworkError:return 10;case re.MissingEmailError:return 4;case re.StripeError:return 2;case re.UnknownError:return 0;case re.AlreadySubscribedError:return 6}}}var wt=(t=>(t[t.BackendInvalidPlatform=7e3]="BackendInvalidPlatform",t[t.BackendInvalidEmail=7012]="BackendInvalidEmail",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[t.BackendAlreadySubscribedError=7772]="BackendAlreadySubscribedError",t[t.BackendPaymentGatewayGenericError=7773]="BackendPaymentGatewayGenericError",t[t.BackendOfferNotFound=7814]="BackendOfferNotFound",t[t.BackendNoMXRecordsFound=7834]="BackendNoMXRecordsFound",t))(wt||{});class X extends Error{constructor(r,n,i,o){super(n);M(this,"toString",()=>`PurchasesError(code: ${ne[this.errorCode]}, message: ${this.message})`);this.errorCode=r,this.underlyingErrorMessage=i,this.extra=o}static getForBackendError(r,n){const i=De.getErrorCodeForBackendErrorCode(r);return new X(i,De.getPublicMessage(i),n,{backendErrorCode:r})}static getForPurchasesFlowError(r){return new X(De.convertPurchaseFlowErrorCodeToErrorCode(r.errorCode),r.message,r.underlyingErrorMessage)}}class yt extends Error{constructor(){super("Purchases must be configured before calling getInstance")}}var Pe=(t=>(t.Started="started",t.InProgress="in_progress",t.Succeeded="succeeded",t.Failed="failed",t))(Pe||{}),Ye=(t=>(t[t.SetupIntentCreationFailed=1]="SetupIntentCreationFailed",t[t.PaymentMethodCreationFailed=2]="PaymentMethodCreationFailed",t[t.PaymentChargeFailed=3]="PaymentChargeFailed",t))(Ye||{}),re=(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[t.AlreadySubscribedError=6]="AlreadySubscribedError",t))(re||{});class Z extends Error{constructor(e,r,n,i,o){super(r),this.errorCode=e,this.underlyingErrorMessage=n,this.purchasesErrorCode=i,this.extra=o}isRecoverable(){switch(this.errorCode){case 3:case 5:return!0;case 0:case 1:case 6:case 4:case 2:return!1}}getPublicErrorMessage(){var r;const e=((r=this.extra)==null?void 0:r.backendErrorCode)??this.purchasesErrorCode??this.errorCode;switch(this.errorCode){case 2:return`An unknown error occurred. Error code: ${e}.`;case 0:return`Purchase not started due to an error. Error code: ${e}.`;case 1:return"Payment failed.";case 3:return"Network error. Please check your internet connection.";case 4:return this.message;case 5:return"Email is required to complete the purchase.";case 6:return"You are already subscribed to this product."}}static fromPurchasesError(e,r){let n;return e.errorCode===ne.ProductAlreadyPurchasedError?n=6:e.errorCode===ne.InvalidEmailError?n=5:e.errorCode===ne.NetworkError?n=3:n=r,new Z(n,e.message,e.underlyingErrorMessage,e.errorCode,e.extra)}}class tr{constructor(e,r=10){M(this,"operationSessionId",null);M(this,"backend");M(this,"maxNumberAttempts");M(this,"waitMSBetweenAttempts",1e3);this.backend=e,this.maxNumberAttempts=r}async startPurchase(e,r,n,i,o){try{const s=await this.backend.postSubscribe(e,r,i,o,n);return this.operationSessionId=s.operation_session_id,s}catch(s){if(s instanceof X)throw Z.fromPurchasesError(s,0);{const l="Unknown error starting purchase: "+String(s);throw K.errorLog(l),new Z(2,l)}}}async pollCurrentPurchaseForCompletion(){const e=this.operationSessionId;if(!e)throw new Z(0,"No purchase in progress");return new Promise((r,n)=>{const i=(o=1)=>{if(o>this.maxNumberAttempts){this.clearPurchaseInProgress(),n(new Z(2,"Max attempts reached trying to get successful purchase status"));return}this.backend.getCheckoutStatus(e).then(s=>{switch(s.operation.status){case Pe.Started:case Pe.InProgress:setTimeout(()=>i(o+1),this.waitMSBetweenAttempts);break;case Pe.Succeeded:this.clearPurchaseInProgress(),r();return;case Pe.Failed:this.clearPurchaseInProgress(),this.handlePaymentError(s.operation.error,n)}}).catch(s=>{const l=Z.fromPurchasesError(s,3);n(l)})};i()})}clearPurchaseInProgress(){this.operationSessionId=null}handlePaymentError(e,r){if(e==null){r(new Z(2,"Got an error status but error field is empty."));return}switch(e.code){case Ye.SetupIntentCreationFailed:r(new Z(0,"Setup intent creation failed"));return;case Ye.PaymentMethodCreationFailed:r(new Z(0,"Payment method creation failed"));return;case Ye.PaymentChargeFailed:r(new Z(1,"Payment charge failed"));return}}}const nr="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 rr(t){T(t,"svelte-1609h93","img.svelte-1609h93{width:124px;height:124px;margin:0 auto}")}function ir(t){let e,r;return{c(){e=y("img"),ee(e.src,r=nr)||A(e,"src",r),A(e,"alt","icon"),A(e,"class","rcb-ui-asset-icon svelte-1609h93")},m(n,i){_(n,e,i)},p:m,i:m,o:m,d(n){n&&h(e)}}}class or extends L{constructor(e){super(),S(this,e,null,ir,B,{},rr)}}function sr(t){T(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 lr(t){let e,r,n,i,o;const s=t[4].default,l=x(s,t,t[3],null);return{c(){e=y("button"),l&&l.c(),A(e,"class",r=V(`intent-${t[0]}`)+" svelte-1rmxk7q"),e.disabled=t[1],A(e,"data-testid",t[2])},m(c,a){_(c,e,a),l&&l.m(e,null),n=!0,i||(o=ke(e,"click",t[5]),i=!0)},p(c,[a]){l&&l.p&&(!n||a&8)&&J(l,s,c,c[3],n?q(s,c[3],a,null):te(c[3]),null),(!n||a&1&&r!==(r=V(`intent-${c[0]}`)+" svelte-1rmxk7q"))&&A(e,"class",r),(!n||a&2)&&(e.disabled=c[1]),(!n||a&4)&&A(e,"data-testid",c[2])},i(c){n||(f(l,c),n=!0)},o(c){g(l,c),n=!1},d(c){c&&h(e),l&&l.d(c),i=!1,o()}}}function cr(t,e,r){let{$$slots:n={},$$scope:i}=e,{intent:o="primary"}=e,{disabled:s=!1}=e,{testId:l=void 0}=e;function c(a){_t.call(this,t,a)}return t.$$set=a=>{"intent"in a&&r(0,o=a.intent),"disabled"in a&&r(1,s=a.disabled),"testId"in a&&r(2,l=a.testId),"$$scope"in a&&r(3,i=a.$$scope)},[o,s,l,i,n,c]}class Ce extends L{constructor(e){super(),S(this,e,cr,lr,B,{intent:0,disabled:1,testId:2},sr)}}function ar(t){T(t,"svelte-1f9z0o8","footer.svelte-1f9z0o8{display:flex;flex-direction:column}")}function ur(t){let e,r;const n=t[1].default,i=x(n,t,t[0],null);return{c(){e=y("footer"),i&&i.c(),A(e,"class","rcb-modal-footer svelte-1f9z0o8")},m(o,s){_(o,e,s),i&&i.m(e,null),r=!0},p(o,[s]){i&&i.p&&(!r||s&1)&&J(i,n,o,o[0],r?q(n,o[0],s,null):te(o[0]),null)},i(o){r||(f(i,o),r=!0)},o(o){g(i,o),r=!1},d(o){o&&h(e),i&&i.d(o)}}}function fr(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(0,i=o.$$scope)},[i,n]}class it extends L{constructor(e){super(),S(this,e,fr,ur,B,{},ar)}}function dr(t){T(t,"svelte-6o8e90",'.column.svelte-6o8e90{display:flex;flex-direction:column;justify-content:flex-start;gap:var(--gap, "8px");flex-grow:1}')}function gr(t){let e,r,n;const i=t[2].default,o=x(i,t,t[1],null);return{c(){e=y("div"),o&&o.c(),A(e,"class","column svelte-6o8e90"),A(e,"style",r=`--gap:${t[0]};`)},m(s,l){_(s,e,l),o&&o.m(e,null),n=!0},p(s,[l]){o&&o.p&&(!n||l&2)&&J(o,i,s,s[1],n?q(i,s[1],l,null):te(s[1]),null),(!n||l&1&&r!==(r=`--gap:${s[0]};`))&&A(e,"style",r)},i(s){n||(f(o,s),n=!0)},o(s){g(o,s),n=!1},d(s){s&&h(e),o&&o.d(s)}}}function mr(t,e,r){let{$$slots:n={},$$scope:i}=e,{gutter:o="8px"}=e;return t.$$set=s=>{"gutter"in s&&r(0,o=s.gutter),"$$scope"in s&&r(1,i=s.$$scope)},[o,i,n]}class Me extends L{constructor(e){super(),S(this,e,mr,gr,B,{gutter:0},dr)}}const pr="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 hr(t){T(t,"svelte-14xreta",".close-button.svelte-14xreta{border:none;cursor:pointer;background-color:transparent;padding:0px}")}function _r(t){let e,r,n,i,o;return{c(){e=y("button"),r=y("img"),ee(r.src,n=pr)||A(r,"src",n),A(r,"alt","close"),A(e,"class","close-button svelte-14xreta"),e.disabled=t[0]},m(s,l){_(s,e,l),P(e,r),i||(o=ke(e,"click",t[1]),i=!0)},p(s,[l]){l&1&&(e.disabled=s[0])},i:m,o:m,d(s){s&&h(e),i=!1,o()}}}function Ar(t,e,r){let{disabled:n=!1}=e;function i(o){_t.call(this,t,o)}return t.$$set=o=>{"disabled"in o&&r(0,n=o.disabled)},[n,i]}class br extends L{constructor(e){super(),S(this,e,Ar,_r,B,{disabled:0},hr)}}function Er(t){T(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 Ir(t){let e;return{c(){e=y("div"),A(e,"class","rcb-app-icon loading svelte-44qpq9")},m(r,n){_(r,e,n)},p:m,d(r){r&&h(e)}}}function wr(t){let e,r,n,i,o,s;return{c(){e=y("picture"),r=y("source"),i=O(),o=y("img"),A(r,"type","image/webp"),F(r,n=t[1])||A(r,"srcset",n),A(o,"class","rcb-app-icon svelte-44qpq9"),ee(o.src,s=t[0])||A(o,"src",s),A(o,"alt","App icon"),A(e,"class","rcb-app-icon-picture-container svelte-44qpq9")},m(l,c){_(l,e,c),P(e,r),P(e,i),P(e,o)},p(l,c){c&2&&n!==(n=l[1])&&A(r,"srcset",n),c&1&&!ee(o.src,s=l[0])&&A(o,"src",s)},d(l){l&&h(e)}}}function yr(t){let e;function r(o,s){return o[0]!==null?wr:Ir}let n=r(t),i=n(t);return{c(){i.c(),e=ce()},m(o,s){i.m(o,s),_(o,e,s)},p(o,[s]){n===(n=r(o))&&i?i.p(o,s):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},i:m,o:m,d(o){o&&h(e),i.d(o)}}}function kr(t,e,r){let{src:n=null}=e,{srcWebp:i=null}=e;return t.$$set=o=>{"src"in o&&r(0,n=o.src),"srcWebp"in o&&r(1,i=o.srcWebp)},[n,i]}class kt extends L{constructor(e){super(),S(this,e,kr,yr,B,{src:0,srcWebp:1},Er)}}const He=t=>`https://da08ctfrofx1b.cloudfront.net/${t}`;function vr(t){T(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 $r(t){let e,r;return e=new kt({}),{c(){k(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p:m,i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){w(e,n)}}}function Br(t){let e,r,n=t[0].seller_company_name+"",i,o,s=t[0].app_icon_webp!==null&&t[0].app_icon!==null&&vt(t);return{c(){s&&s.c(),e=O(),r=y("span"),i=Y(n),A(r,"class","app-title svelte-10uf5fq")},m(l,c){s&&s.m(l,c),_(l,e,c),_(l,r,c),P(r,i),o=!0},p(l,c){l[0].app_icon_webp!==null&&l[0].app_icon!==null?s?(s.p(l,c),c&1&&f(s,1)):(s=vt(l),s.c(),f(s,1),s.m(e.parentNode,e)):s&&(W(),g(s,1,1,()=>{s=null}),z()),(!o||c&1)&&n!==(n=l[0].seller_company_name+"")&&de(i,n)},i(l){o||(f(s),o=!0)},o(l){g(s),o=!1},d(l){l&&(h(e),h(r)),s&&s.d(l)}}}function vt(t){let e,r;return e=new kt({props:{src:He(t[0].app_icon),srcWebp:He(t[0].app_icon_webp)}}),{c(){k(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&1&&(o.src=He(n[0].app_icon)),i&1&&(o.srcWebp=He(n[0].app_icon_webp)),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){w(e,n)}}}function Dr(t){let e,r,n,i;const o=[Br,$r],s=[];function l(c,a){return c[0]!==null?0:1}return r=l(t),n=s[r]=o[r](t),{c(){e=y("div"),n.c(),A(e,"class","rcb-header-layout__business-info svelte-10uf5fq")},m(c,a){_(c,e,a),s[r].m(e,null),i=!0},p(c,[a]){let u=r;r=l(c),r===u?s[r].p(c,a):(W(),g(s[u],1,1,()=>{s[u]=null}),z(),n=s[r],n?n.p(c,a):(n=s[r]=o[r](c),n.c()),f(n,1),n.m(e,null))},i(c){i||(f(n),i=!0)},o(c){g(n),i=!1},d(c){c&&h(e),s[r].d()}}}function Pr(t,e,r){let{brandingInfo:n=null}=e;return t.$$set=i=>{"brandingInfo"in i&&r(0,n=i.brandingInfo)},[n]}class $t extends L{constructor(e){super(),S(this,e,Pr,Dr,B,{brandingInfo:0},vr)}}function Cr(t){T(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 Mr(t){let e,r,n,i,o;return r=new $t({props:{brandingInfo:t[0]}}),i=new br({}),i.$on("click",function(){ie(t[1])&&t[1].apply(this,arguments)}),{c(){e=y("div"),k(r.$$.fragment),n=O(),k(i.$$.fragment),A(e,"class","rcb-post-purchase-header-layout svelte-17puakv")},m(s,l){_(s,e,l),I(r,e,null),P(e,n),I(i,e,null),o=!0},p(s,l){t=s;const c={};l&1&&(c.brandingInfo=t[0]),r.$set(c)},i(s){o||(f(r.$$.fragment,s),f(i.$$.fragment,s),o=!0)},o(s){g(r.$$.fragment,s),g(i.$$.fragment,s),o=!1},d(s){s&&h(e),w(r),w(i)}}}function Tr(t){let e,r;return e=new Ee({props:{as:"header",$$slots:{default:[Mr]},$$scope:{ctx:t}}}),{c(){k(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const o={};i&7&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){w(e,n)}}}function Rr(t,e,r){let{brandingInfo:n=null}=e,{onClose:i}=e;return t.$$set=o=>{"brandingInfo"in o&&r(0,n=o.brandingInfo),"onClose"in o&&r(1,i=o.onClose)},[n,i]}class Qr extends L{constructor(e){super(),S(this,e,Rr,Tr,B,{brandingInfo:0,onClose:1},Cr)}}function Nr(t){T(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 Ur=t=>({}),Bt=t=>({});function Or(t){let e,r,n,i,o;const s=t[4].default,l=x(s,t,t[5],null);return{c(){e=y("span"),r=Y(t[2]),n=O(),i=y("span"),l&&l.c(),A(e,"class","title svelte-10pcqja"),A(i,"class","subtitle svelte-10pcqja")},m(c,a){_(c,e,a),P(e,r),_(c,n,a),_(c,i,a),l&&l.m(i,null),o=!0},p(c,a){(!o||a&4)&&de(r,c[2]),l&&l.p&&(!o||a&32)&&J(l,s,c,c[5],o?q(s,c[5],a,null):te(c[5]),null)},i(c){o||(f(l,c),o=!0)},o(c){g(l,c),o=!1},d(c){c&&(h(e),h(n),h(i)),l&&l.d(c)}}}function Sr(t){let e,r,n;const i=t[4].icon,o=x(i,t,t[5],Bt);return r=new Me({props:{gutter:"16px",$$slots:{default:[Or]},$$scope:{ctx:t}}}),{c(){o&&o.c(),e=O(),k(r.$$.fragment)},m(s,l){o&&o.m(s,l),_(s,e,l),I(r,s,l),n=!0},p(s,l){o&&o.p&&(!n||l&32)&&J(o,i,s,s[5],n?q(i,s[5],l,Ur):te(s[5]),Bt);const c={};l&36&&(c.$$scope={dirty:l,ctx:s}),r.$set(c)},i(s){n||(f(o,s),f(r.$$.fragment,s),n=!0)},o(s){g(o,s),g(r.$$.fragment,s),n=!1},d(s){s&&h(e),o&&o.d(s),w(r,s)}}}function Lr(t){let e,r,n;return r=new Me({props:{gutter:"16px",$$slots:{default:[Sr]},$$scope:{ctx:t}}}),{c(){e=y("div"),k(r.$$.fragment),A(e,"class","rcb-modal-message svelte-10pcqja"),A(e,"data-type",t[3])},m(i,o){_(i,e,o),I(r,e,null),n=!0},p(i,o){const s={};o&36&&(s.$$scope={dirty:o,ctx:i}),r.$set(s),(!n||o&8)&&A(e,"data-type",i[3])},i(i){n||(f(r.$$.fragment,i),n=!0)},o(i){g(r.$$.fragment,i),n=!1},d(i){i&&h(e),w(r)}}}function Fr(t){let e;return{c(){e=Y("Go back to app")},m(r,n){_(r,e,n)},d(r){r&&h(e)}}}function xr(t){let e,r;return e=new Ce({props:{$$slots:{default:[Fr]},$$scope:{ctx:t}}}),e.$on("click",function(){ie(t[1])&&t[1].apply(this,arguments)}),{c(){k(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){t=n;const o={};i&32&&(o.$$scope={dirty:i,ctx:t}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){w(e,n)}}}function Gr(t){let e,r,n,i,o,s;return e=new Qr({props:{brandingInfo:t[0],onClose:t[1]}}),n=new Ee({props:{$$slots:{default:[Lr]},$$scope:{ctx:t}}}),o=new it({props:{$$slots:{default:[xr]},$$scope:{ctx:t}}}),{c(){k(e.$$.fragment),r=O(),k(n.$$.fragment),i=O(),k(o.$$.fragment)},m(l,c){I(e,l,c),_(l,r,c),I(n,l,c),_(l,i,c),I(o,l,c),s=!0},p(l,c){const a={};c&1&&(a.brandingInfo=l[0]),c&2&&(a.onClose=l[1]),e.$set(a);const u={};c&44&&(u.$$scope={dirty:c,ctx:l}),n.$set(u);const d={};c&34&&(d.$$scope={dirty:c,ctx:l}),o.$set(d)},i(l){s||(f(e.$$.fragment,l),f(n.$$.fragment,l),f(o.$$.fragment,l),s=!0)},o(l){g(e.$$.fragment,l),g(n.$$.fragment,l),g(o.$$.fragment,l),s=!1},d(l){l&&(h(r),h(i)),w(e,l),w(n,l),w(o,l)}}}function Yr(t){let e,r;return e=new Me({props:{gutter:"32px",$$slots:{default:[Gr]},$$scope:{ctx:t}}}),{c(){k(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const o={};i&47&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){w(e,n)}}}function Hr(t,e,r){let{$$slots:n={},$$scope:i}=e,{brandingInfo:o=null}=e,{onContinue:s}=e,{title:l}=e,{type:c}=e;return t.$$set=a=>{"brandingInfo"in a&&r(0,o=a.brandingInfo),"onContinue"in a&&r(1,s=a.onContinue),"title"in a&&r(2,l=a.title),"type"in a&&r(3,c=a.type),"$$scope"in a&&r(5,i=a.$$scope)},[o,s,l,c,n,i]}class Dt extends L{constructor(e){super(),S(this,e,Hr,Yr,B,{brandingInfo:0,onContinue:1,title:2,type:3},Nr)}}function Pt(t){let e,r,n,i,o,s;return{c(){e=y("br"),r=Y("If this error persists, please contact "),n=y("a"),i=Y(t[2]),s=Y("."),A(n,"href",o="mailto:"+t[2])},m(l,c){_(l,e,c),_(l,r,c),_(l,n,c),P(n,i),_(l,s,c)},p(l,c){c&4&&de(i,l[2]),c&4&&o!==(o="mailto:"+l[2])&&A(n,"href",o)},d(l){l&&(h(e),h(r),h(n),h(s))}}}function Kr(t){let e=t[1].getPublicErrorMessage()+"",r,n,i,o=t[2]&&Pt(t);return{c(){r=Y(e),n=O(),o&&o.c(),i=ce()},m(s,l){_(s,r,l),_(s,n,l),o&&o.m(s,l),_(s,i,l)},p(s,l){l&2&&e!==(e=s[1].getPublicErrorMessage()+"")&&de(r,e),s[2]?o?o.p(s,l):(o=Pt(s),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null)},d(s){s&&(h(r),h(n),h(i)),o&&o.d(s)}}}function jr(t){let e,r;return e=new or({props:{slot:"icon"}}),{c(){k(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p:m,i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){w(e,n)}}}function qr(t){let e,r;return e=new Dt({props:{title:t[4](),brandingInfo:t[0],onContinue:t[3],type:"error",$$slots:{icon:[jr],default:[Kr]},$$scope:{ctx:t}}}),{c(){k(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const o={};i&1&&(o.brandingInfo=n[0]),i&8&&(o.onContinue=n[3]),i&38&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){w(e,n)}}}function Jr(t,e,r){let{brandingInfo:n=null}=e,{lastError:i}=e,{supportEmail:o=null}=e,{onContinue:s}=e;Fe(()=>{K.errorLog(`Displayed error: ${re[i.errorCode]}. Message: ${i.message??"None"}. Underlying error: ${i.underlyingErrorMessage??"None"}`)});function l(){switch(i.errorCode){case re.AlreadySubscribedError:return"Already subscribed";default:return"Something went wrong"}}return t.$$set=c=>{"brandingInfo"in c&&r(0,n=c.brandingInfo),"lastError"in c&&r(1,i=c.lastError),"supportEmail"in c&&r(2,o=c.supportEmail),"onContinue"in c&&r(3,s=c.onContinue)},[n,i,o,s,l]}class Vr extends L{constructor(e){super(),S(this,e,Jr,qr,B,{brandingInfo:0,lastError:1,supportEmail:2,onContinue:3})}}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 zr(t){T(t,"svelte-1609h93","img.svelte-1609h93{width:124px;height:124px;margin:0 auto}")}function Xr(t){let e,r;return{c(){e=y("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){_(n,e,i)},p:m,i:m,o:m,d(n){n&&h(e)}}}class Zr extends L{constructor(e){super(),S(this,e,null,Xr,B,{},zr)}}function ei(t){let e;return{c(){e=Y("Your plan is now active.")},m(r,n){_(r,e,n)},d(r){r&&h(e)}}}function ti(t){let e,r;return e=new Zr({props:{slot:"icon"}}),{c(){k(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p:m,i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){w(e,n)}}}function ni(t){let e,r;return e=new Dt({props:{type:"success",title:"Purchase successful",brandingInfo:t[0],onContinue:t[1],$$slots:{icon:[ti],default:[ei]},$$scope:{ctx:t}}}),{c(){k(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const o={};i&1&&(o.brandingInfo=n[0]),i&2&&(o.onContinue=n[1]),i&4&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){w(e,n)}}}function ri(t,e,r){let{brandingInfo:n=null}=e,{onContinue:i}=e;return t.$$set=o=>{"brandingInfo"in o&&r(0,n=o.brandingInfo),"onContinue"in o&&r(1,i=o.onContinue)},[n,i]}class ii extends L{constructor(e){super(),S(this,e,ri,ni,B,{brandingInfo:0,onContinue:1})}}function oi(t,e,r,n,i={}){const o=r.create(e,i);return o.mount(t),o.on("change",s=>n("change",s)),o.on("ready",s=>n("ready",s)),o.on("focus",s=>n("focus",s)),o.on("blur",s=>n("blur",s)),o.on("escape",s=>n("escape",s)),o.on("click",s=>n("click",s)),o.on("loaderror",s=>n("loaderror",s)),o.on("loaderstart",s=>n("loaderstart",s)),o.on("networkschange",s=>n("networkschange",s)),o}const si=typeof window>"u";function li(t){if(!si)return t.registerAppInfo({name:"svelte-stripe-js",url:"https://svelte-stripe-js.vercel.app"})}function ci(t){let e;return{c(){e=y("div")},m(r,n){_(r,e,n),t[6](e)},p:m,i:m,o:m,d(r){r&&h(e),t[6](null)}}}function ai(t,e,r){let n,i;const o=vn(),{elements:s}=Bn("stripe");let{options:l=void 0}=e;Fe(()=>(n=oi(i,"payment",s,o,l),()=>n.destroy()));function c(){n.blur()}function a(){n.clear()}function u(){n.destroy()}function d(){n.focus()}function b($){xe[$?"unshift":"push"](()=>{i=$,r(0,i)})}return t.$$set=$=>{"options"in $&&r(1,l=$.options)},[i,l,c,a,u,d,b]}class ui extends L{constructor(e){super(),S(this,e,ai,ci,B,{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 Ct(t){let e;const r=t[15].default,n=x(r,t,t[14],null);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&16384)&&J(n,r,i,i[14],e?q(r,i[14],o,null):te(i[14]),null)},i(i){e||(f(n,i),e=!0)},o(i){g(n,i),e=!1},d(i){n&&n.d(i)}}}function fi(t){let e,r,n=t[1]&&t[0]&&Ct(t);return{c(){n&&n.c(),e=ce()},m(i,o){n&&n.m(i,o),_(i,e,o),r=!0},p(i,[o]){i[1]&&i[0]?n?(n.p(i,o),o&3&&f(n,1)):(n=Ct(i),n.c(),f(n,1),n.m(e.parentNode,e)):n&&(W(),g(n,1,1,()=>{n=null}),z())},i(i){r||(f(n),r=!0)},o(i){g(n),r=!1},d(i){i&&h(e),n&&n.d(i)}}}function di(t,e,r){let n,{$$slots:i={},$$scope:o}=e,{stripe:s}=e,{mode:l=void 0}=e,{theme:c="stripe"}=e,{variables:a={}}=e,{rules:u={}}=e,{labels:d="above"}=e,{loader:b="auto"}=e,{fonts:$=[]}=e,{locale:D="auto"}=e,{currency:R=void 0}=e,{amount:p=void 0}=e,{clientSecret:v=void 0}=e,{elements:G=null}=e;return t.$$set=U=>{"stripe"in U&&r(1,s=U.stripe),"mode"in U&&r(2,l=U.mode),"theme"in U&&r(3,c=U.theme),"variables"in U&&r(4,a=U.variables),"rules"in U&&r(5,u=U.rules),"labels"in U&&r(6,d=U.labels),"loader"in U&&r(7,b=U.loader),"fonts"in U&&r(8,$=U.fonts),"locale"in U&&r(9,D=U.locale),"currency"in U&&r(10,R=U.currency),"amount"in U&&r(11,p=U.amount),"clientSecret"in U&&r(12,v=U.clientSecret),"elements"in U&&r(0,G=U.elements),"$$scope"in U&&r(14,o=U.$$scope)},t.$$.update=()=>{t.$$.dirty&120&&r(13,n={theme:c,variables:a,rules:u,labels:d}),t.$$.dirty&16263&&s&&!G&&(r(0,G=s.elements({mode:l,currency:R,amount:p,appearance:n,clientSecret:v,fonts:$,loader:b,locale:D})),li(s),$n("stripe",{stripe:s,elements:G})),t.$$.dirty&8705&&G&&G.update({appearance:n,locale:D})},[G,s,l,c,a,u,d,b,$,D,R,p,v,n,o,i]}class gi extends L{constructor(e){super(),S(this,e,di,fi,B,{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 Mt="https://js.stripe.com/v3",mi=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,Tt="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",pi=function(){for(var e=document.querySelectorAll('script[src^="'.concat(Mt,'"]')),r=0;r<e.length;r++){var n=e[r];if(mi.test(n.src))return n}return null},Rt=function(e){var r="",n=document.createElement("script");n.src="".concat(Mt).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},hi=function(e,r){!e||!e._registerWrapper||e._registerWrapper({name:"stripe-js",version:"2.4.0",startTime:r})},Te=null,Ke=null,je=null,_i=function(e){return function(){e(new Error("Failed to load Stripe.js"))}},Ai=function(e,r){return function(){window.Stripe?e(window.Stripe):r(new Error("Stripe.js not available"))}},bi=function(e){return Te!==null?Te:(Te=new Promise(function(r,n){if(typeof window>"u"||typeof document>"u"){r(null);return}if(window.Stripe&&e&&console.warn(Tt),window.Stripe){r(window.Stripe);return}try{var i=pi();if(i&&e)console.warn(Tt);else if(!i)i=Rt(e);else if(i&&je!==null&&Ke!==null){var o;i.removeEventListener("load",je),i.removeEventListener("error",Ke),(o=i.parentNode)===null||o===void 0||o.removeChild(i),i=Rt(e)}je=Ai(r,n),Ke=_i(n),i.addEventListener("load",je),i.addEventListener("error",Ke)}catch(s){n(s);return}}),Te.catch(function(r){return Te=null,Promise.reject(r)}))},Ei=function(e,r,n){if(e===null)return null;var i=e.apply(void 0,r);return hi(i,n),i},Re,Qt=!1,Nt=function(){return Re||(Re=bi(null).catch(function(e){return Re=null,Promise.reject(e)}),Re)};Promise.resolve().then(function(){return Nt()}).catch(function(t){Qt||console.warn(t)});var Ii=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];Qt=!0;var i=Date.now();return Nt().then(function(o){return Ei(o,r,i)})};function wi(t){T(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 yi(t){let e,r;const n=t[0].default,i=x(n,t,t[1],null);return{c(){e=y("div"),i&&i.c(),A(e,"class","rcb-header-layout svelte-1xe711j")},m(o,s){_(o,e,s),i&&i.m(e,null),r=!0},p(o,s){i&&i.p&&(!r||s&2)&&J(i,n,o,o[1],r?q(n,o[1],s,null):te(o[1]),null)},i(o){r||(f(i,o),r=!0)},o(o){g(i,o),r=!1},d(o){o&&h(e),i&&i.d(o)}}}function ki(t){let e,r;return e=new Ee({props:{as:"header",$$slots:{default:[yi]},$$scope:{ctx:t}}}),{c(){k(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const o={};i&2&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){w(e,n)}}}function vi(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(1,i=o.$$scope)},[n,i]}class ot extends L{constructor(e){super(),S(this,e,vi,ki,B,{},wi)}}const $i="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 Bi(t){let e,r;return{c(){e=y("img"),ee(e.src,r=$i)||A(e,"src",r),A(e,"alt","icon"),A(e,"class","rcb-ui-asset-icon")},m(n,i){_(n,e,i)},p:m,i:m,o:m,d(n){n&&h(e)}}}class Di extends L{constructor(e){super(),S(this,e,null,Bi,B,{})}}const Qe={error:"#f2545b",warning:"#f4e971",focus:"#000080","grey-text-dark":"#000000","grey-text-light":"#767676","grey-ui-dark":"#dfdfdf",white:"#ffffff"};function Pi(t){T(t,"svelte-rjmul6",`.processing.svelte-rjmul6{width:12px;aspect-ratio:1;border-radius:50%;animation:svelte-rjmul6-l5 1.5s infinite linear}@keyframes svelte-rjmul6-l5{0%{box-shadow:20px 0 #fff2,
|
|
1
|
+
(function(E,p){typeof exports=="object"&&typeof module<"u"?p(exports):typeof define=="function"&&define.amd?define(["exports"],p):(E=typeof globalThis<"u"?globalThis:E||self,p(E.Purchases={}))})(this,function(E){"use strict";var Ws=Object.create;var dt=Object.defineProperty;var zs=Object.getOwnPropertyDescriptor;var hn=(E,p)=>(p=Symbol[E])?p:Symbol.for("Symbol."+E),Fe=E=>{throw TypeError(E)};var _n=(E,p,T)=>p in E?dt(E,p,{enumerable:!0,configurable:!0,writable:!0,value:T}):E[p]=T;var gn=(E,p)=>dt(E,"name",{value:p,configurable:!0});var An=E=>[,,,Ws((E==null?void 0:E[hn("metadata")])??null)],bn=["class","method","getter","setter","accessor","field","value","get","set"],Le=E=>E!==void 0&&typeof E!="function"?Fe("Function expected"):E,Xs=(E,p,T,ie,Y)=>({kind:bn[E],name:p,metadata:ie,addInitializer:H=>T._?Fe("Already initialized"):Y.push(Le(H||null))}),gt=(E,p)=>_n(p,hn("metadata"),E[3]),En=(E,p,T,ie)=>{for(var Y=0,H=E[p>>1],re=H&&H.length;Y<re;Y++)p&1?H[Y].call(T):ie=H[Y].call(T,ie);return ie},In=(E,p,T,ie,Y,H)=>{var re,B,fe,Z,he,S=p&7,ve=!!(p&8),ce=!!(p&16),de=S>3?E.length+1:S?ve?1:2:0,J=bn[S+5],$e=S>3&&(E[de-1]=[]),ee=E[de]||(E[de]=[]),L=S&&(!ce&&!ve&&(Y=Y.prototype),S<5&&(S>3||!ce)&&zs(S<4?Y:{get[T](){return mn(this,H)},set[T](K){return pn(this,H,K)}},T));S?ce&&S<4&&gn(H,(S>2?"set ":S>1?"get ":"")+T):gn(Y,T);for(var q=ie.length-1;q>=0;q--)Z=Xs(S,T,fe={},E[3],ee),S&&(Z.static=ve,Z.private=ce,he=Z.access={has:ce?K=>Zs(Y,K):K=>T in K},S^3&&(he.get=ce?K=>(S^1?mn:el)(K,Y,S^4?H:L.get):K=>K[T]),S>2&&(he.set=ce?(K,C)=>pn(K,Y,C,S^4?H:L.set):(K,C)=>K[T]=C)),B=(0,ie[q])(S?S<4?ce?H:L[J]:S>4?void 0:{get:L.get,set:L.set}:Y,Z),fe._=1,S^4||B===void 0?Le(B)&&(S>4?$e.unshift(B):S?ce?H=B:L[J]=B:Y=B):typeof B!="object"||B===null?Fe("Object expected"):(Le(re=B.get)&&(L.get=re),Le(re=B.set)&&(L.set=re),Le(re=B.init)&&$e.unshift(re));return S||gt(E,Y),L&&dt(Y,T,L),ce?S^4?H:L:Y},D=(E,p,T)=>_n(E,typeof p!="symbol"?p+"":p,T),mt=(E,p,T)=>p.has(E)||Fe("Cannot "+T),Zs=(E,p)=>Object(p)!==p?Fe('Cannot use the "in" operator on this value'):E.has(p),mn=(E,p,T)=>(mt(E,p,"read from private field"),T?T.call(E):p.get(E));var pn=(E,p,T,ie)=>(mt(E,p,"write to private field"),ie?ie.call(E,T):p.set(E,T),T),el=(E,p,T)=>(mt(E,p,"access private method"),T);var un,ft;function p(){}function T(t,e){for(const r in e)t[r]=e[r];return t}function ie(t){return t()}function Y(){return Object.create(null)}function H(t){t.forEach(ie)}function re(t){return typeof t=="function"}function B(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let fe;function Z(t,e){return t===e?!0:(fe||(fe=document.createElement("a")),fe.href=e,t===fe.href)}function he(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function S(t,e){const r=he(t.srcset),n=he(e||"");return n.length===r.length&&n.every(([i,o],s)=>o===r[s][1]&&(Z(r[s][0],i)||Z(i,r[s][0])))}function ve(t){return Object.keys(t).length===0}function ce(t,...e){if(t==null){for(const n of e)n(void 0);return p}const r=t.subscribe(...e);return r.unsubscribe?()=>r.unsubscribe():r}function de(t,e,r){t.$$.on_destroy.push(ce(e,r))}function J(t,e,r,n){if(t){const i=$e(t,e,r,n);return t[0](i)}}function $e(t,e,r,n){return t[1]&&n?T(r.ctx.slice(),t[1](n(e))):r.ctx}function ee(t,e,r,n){if(t[2]&&n){const i=t[2](n(r));if(e.dirty===void 0)return i;if(typeof i=="object"){const o=[],s=Math.max(e.dirty.length,i.length);for(let l=0;l<s;l+=1)o[l]=e.dirty[l]|i[l];return o}return e.dirty|i}return e.dirty}function L(t,e,r,n,i,o){if(i){const s=$e(e,r,n,o);t.p(s,i)}}function q(t){if(t.ctx.length>32){const e=[],r=t.ctx.length/32;for(let n=0;n<r;n++)e[n]=-1;return e}return-1}function K(t){return t??""}function C(t,e){t.appendChild(e)}function x(t,e,r){const n=wn(t);if(!n.getElementById(e)){const i=w("style");i.id=e,i.textContent=r,yn(n,i)}}function wn(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function yn(t,e){return C(t.head||t,e),e.sheet}function _(t,e,r){t.insertBefore(e,r||null)}function h(t){t.parentNode&&t.parentNode.removeChild(t)}function w(t){return document.createElement(t)}function G(t){return document.createTextNode(t)}function O(){return G(" ")}function ae(){return G("")}function Be(t,e,r,n){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r,n)}function pt(t){return function(e){return e.preventDefault(),t.call(this,e)}}function b(t,e,r){r==null?t.removeAttribute(e):t.getAttribute(e)!==r&&t.setAttribute(e,r)}const kn=["width","height"];function vn(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&&kn.indexOf(n)===-1?t[n]=e[n]:b(t,n,e[n])}function $n(t,e){Object.keys(e).forEach(r=>{Bn(t,r,e[r])})}function Bn(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:b(t,e,r)}function Pn(t){return/-/.test(t)?$n:vn}function Dn(t){return Array.from(t.childNodes)}function ge(t,e){e=""+e,t.data!==e&&(t.data=e)}function ht(t,e){t.value=e??""}function Cn(t,e,{bubbles:r=!1,cancelable:n=!1}={}){return new CustomEvent(t,{detail:e,bubbles:r,cancelable:n})}let Pe;function De(t){Pe=t}function Ce(){if(!Pe)throw new Error("Function called outside component initialization");return Pe}function Mn(t){Ce().$$.before_update.push(t)}function Ge(t){Ce().$$.on_mount.push(t)}function Tn(){const t=Ce();return(e,r,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const o=Cn(e,r,{cancelable:n});return i.slice().forEach(s=>{s.call(t,o)}),!o.defaultPrevented}return!0}}function On(t,e){return Ce().$$.context.set(t,e),e}function Rn(t){return Ce().$$.context.get(t)}function _t(t,e){const r=t.$$.callbacks[e.type];r&&r.slice().forEach(n=>n.call(this,e))}const _e=[],Ye=[];let Ae=[];const ze=[],Qn=Promise.resolve();let Xe=!1;function Un(){Xe||(Xe=!0,Qn.then(At))}function Ze(t){Ae.push(t)}function Nn(t){ze.push(t)}const et=new Set;let be=0;function At(){if(be!==0)return;const t=Pe;do{try{for(;be<_e.length;){const e=_e[be];be++,De(e),Sn(e.$$)}}catch(e){throw _e.length=0,be=0,e}for(De(null),_e.length=0,be=0;Ye.length;)Ye.pop()();for(let e=0;e<Ae.length;e+=1){const r=Ae[e];et.has(r)||(et.add(r),r())}Ae.length=0}while(_e.length);for(;ze.length;)ze.pop()();Xe=!1,et.clear(),De(t)}function Sn(t){if(t.fragment!==null){t.update(),H(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(Ze)}}function Ln(t){const e=[],r=[];Ae.forEach(n=>t.indexOf(n)===-1?e.push(n):r.push(n)),r.forEach(n=>n()),Ae=e}const He=new Set;let me;function V(){me={r:0,c:[],p:me}}function W(){me.r||H(me.c),me=me.p}function d(t,e){t&&t.i&&(He.delete(t),t.i(e))}function g(t,e,r,n){if(t&&t.o){if(He.has(t))return;He.add(t),me.c.push(()=>{He.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 v(t){t&&t.c()}function y(t,e,r){const{fragment:n,after_update:i}=t.$$;n&&n.m(e,r),Ze(()=>{const o=t.$$.on_mount.map(ie).filter(re);t.$$.on_destroy?t.$$.on_destroy.push(...o):H(o),t.$$.on_mount=[]}),i.forEach(Ze)}function k(t,e){const r=t.$$;r.fragment!==null&&(Ln(r.after_update),H(r.on_destroy),r.fragment&&r.fragment.d(e),r.on_destroy=r.fragment=null,r.ctx=[])}function Gn(t,e){t.$$.dirty[0]===-1&&(_e.push(t),Un(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function Q(t,e,r,n,i,o,s=null,l=[-1]){const c=Pe;De(t);const a=t.$$={fragment:null,ctx:[],props:o,update:p,not_equal:i,bound:Y(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:Y(),dirty:l,skip_bound:!1,root:e.target||c.$$.root};s&&s(a.root);let u=!1;if(a.ctx=r?r(t,e.props||{},(f,A,...I)=>{const P=I.length?I[0]:A;return a.ctx&&i(a.ctx[f],a.ctx[f]=P)&&(!a.skip_bound&&a.bound[f]&&a.bound[f](P),u&&Gn(t,f)),A}):[],a.update(),u=!0,H(a.before_update),a.fragment=n?n(a.ctx):!1,e.target){if(e.hydrate){const f=Dn(e.target);a.fragment&&a.fragment.l(f),f.forEach(h)}else a.fragment&&a.fragment.c();e.intro&&d(t.$$.fragment),y(t,e.target,e.anchor),At()}De(c)}class U{constructor(){D(this,"$$");D(this,"$$set")}$destroy(){k(this,1),this.$destroy=p}$on(e,r){if(!re(r))return p;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&&!ve(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Yn="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Yn);function Hn(t){x(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 tt(t){let e,r;const n=t[2].default,i=J(n,t,t[1],null);return{c(){e=w(t[0]),i&&i.c(),Pn(t[0])(e,{class:K("rcb-modal-section")+" svelte-1bzqb13"})},m(o,s){_(o,e,s),i&&i.m(e,null),r=!0},p(o,s){i&&i.p&&(!r||s&2)&&L(i,n,o,o[1],r?ee(n,o[1],s,null):q(o[1]),null)},i(o){r||(d(i,o),r=!0)},o(o){g(i,o),r=!1},d(o){o&&h(e),i&&i.d(o)}}}function xn(t){let e=t[0],r,n,i=t[0]&&tt(t);return{c(){i&&i.c(),r=ae()},m(o,s){i&&i.m(o,s),_(o,r,s),n=!0},p(o,[s]){o[0]?e?B(e,o[0])?(i.d(1),i=tt(o),e=o[0],i.c(),i.m(r.parentNode,r)):i.p(o,s):(i=tt(o),e=o[0],i.c(),i.m(r.parentNode,r)):e&&(i.d(1),i=null,e=o[0])},i(o){n||(d(i,o),n=!0)},o(o){g(i,o),n=!1},d(o){o&&h(r),i&&i.d(o)}}}function Kn(t,e,r){let{$$slots:n={},$$scope:i}=e,{as:o="section"}=e;return t.$$set=s=>{"as"in s&&r(0,o=s.as),"$$scope"in s&&r(1,i=s.$$scope)},[o,i,n]}class Ee extends U{constructor(e){super(),Q(this,e,Kn,xn,B,{as:0},Hn)}}var oe=(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))(oe||{});class F{static setLogLevel(e){this.logLevel=e}static log(e,r=this.logLevel){const n=`[Purchases] ${e}`;if(!(this.logLevel<r||r===oe.Silent))switch(r){case oe.Error:console.error(n);break;case oe.Warn:console.warn(n);break;case oe.Info:console.info(n);break;case oe.Debug:console.debug(n);break;case oe.Verbose:console.debug(n);break}}static errorLog(e){this.log(e,oe.Error)}static warnLog(e){this.log(e,oe.Warn)}static infoLog(e){this.log(e,oe.Info)}static debugLog(e){this.log(e,oe.Debug)}static verboseLog(e){this.log(e,oe.Verbose)}}D(F,"logLevel",oe.Silent);var ue=(t=>(t.Year="year",t.Month="month",t.Week="week",t.Day="day",t))(ue||{});function nt(t){const e=t.match(/^PT?([0-9]+)([MDYW])$/);if(!e||e.length<3)return F.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 F.errorLog(`Invalid ISO 8601 unit duration format: ${t}`),null}}const qn=(t,e,r)=>{const n=t/1e6;return new Intl.NumberFormat(r,{style:"currency",currency:e}).format(n)},jn=t=>{const e=t.number;if(e===1)switch(t.unit){case ue.Year:return"yearly";case ue.Month:return"monthly";case ue.Week:return"weekly";case ue.Day:return"daily"}else return`every ${e} ${t.unit}s`},Jn=t=>{const e=t.number;if(e===1)switch(t.unit){case ue.Year:return"1 year";case ue.Month:return"1 month";case ue.Week:return"1 week";case ue.Day:return"1 day"}else return`${e} ${t.unit}s`},bt=t=>{const e=nt(t);return e?jn(e):"unknown"},Vn=t=>{const e=nt(t);return e?Jn(e):"unknown"};function Wn(t){return t!=null}var Et=(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))(Et||{}),Ie=(t=>(t.Subscription="subscription",t.Consumable="consumable",t.NonConsumable="non_consumable",t))(Ie||{});const It=t=>({amount:t.amount_micros/1e4,amountMicros:t.amount_micros,currency:t.currency,formattedPrice:qn(t.amount_micros,t.currency)}),wt=t=>{const e=t.period_duration;return{periodDuration:e,period:e?nt(e):null,cycleCount:t.cycle_count,price:t.price?It(t.price):null}},zn=t=>t.base==null?(F.debugLog("Missing base phase for subscription option. Ignoring."),null):{id:t.id,priceId:t.price_id,base:wt(t.base),trial:t.trial?wt(t.trial):null},Xn=t=>t.base_price==null?(F.debugLog("Missing base price for non-subscription option. Ignoring."),null):{id:t.id,priceId:t.price_id,basePrice:It(t.base_price)},Zn=(t,e)=>{const r=t.product_type;return r==="subscription"?tr(t,e,r):er(t,e,r)},er=(t,e,r)=>{const n={};if(Object.entries(t.purchase_options).forEach(([s,l])=>{const c=Xn(l);c!=null&&(n[s]=c)}),Object.keys(n).length===0)return F.debugLog(`Product ${t.identifier} has no purchase options. Ignoring.`),null;const i=t.default_purchase_option_id,o=i&&i in t.purchase_options?n[i]:null;return o==null?(F.debugLog(`Product ${t.identifier} has no default purchase option. Ignoring.`),null):{identifier:t.identifier,displayName:t.title,title:t.title,description:t.description,productType:r,currentPrice:o.basePrice,normalPeriodDuration:null,presentedOfferingIdentifier:e.offeringIdentifier,presentedOfferingContext:e,defaultPurchaseOption:o,defaultSubscriptionOption:null,subscriptionOptions:{},defaultNonSubscriptionOption:o}},tr=(t,e,r)=>{const n={};if(Object.entries(t.purchase_options).forEach(([l,c])=>{const a=zn(c);a!=null&&(n[l]=a)}),Object.keys(n).length===0)return F.debugLog(`Product ${t.identifier} has no subscription options. Ignoring.`),null;const i=t.default_purchase_option_id,o=i&&i in n?n[i]:null;if(o==null)return F.debugLog(`Product ${t.identifier} has no default subscription option. Ignoring.`),null;const s=o.base.price;return s==null?(F.debugLog(`Product ${t.identifier} default option has no base price. Ignoring.`),null):{identifier:t.identifier,displayName:t.title,title:t.title,description:t.description,productType:r,currentPrice:s,normalPeriodDuration:o.base.periodDuration,presentedOfferingIdentifier:e.offeringIdentifier,presentedOfferingContext:e,defaultPurchaseOption:o,defaultSubscriptionOption:o,subscriptionOptions:n,defaultNonSubscriptionOption:null}},nr=(t,e,r)=>{const n=r[e.platform_product_identifier];if(n===void 0)return null;const i=Zn(n,t);return i===null?null:{identifier:e.identifier,rcBillingProduct:i,packageType:ir(e.identifier)}},rr=(t,e,r,n)=>{const i={offeringIdentifier:e.identifier,targetingContext:t&&n?{ruleId:n.rule_id,revision:n.revision}:null,placementIdentifier:null},o=e.packages.map(l=>nr(i,l,r)).filter(Wn),s={};for(const l of o)l!=null&&(s[l.identifier]=l);return o.length==0?null:{identifier:e.identifier,serverDescription:e.description,metadata:e.metadata,packagesById:s,availablePackages:o,lifetime:s.$rc_lifetime??null,annual:s.$rc_annual??null,sixMonth:s.$rc_six_month??null,threeMonth:s.$rc_three_month??null,twoMonth:s.$rc_two_month??null,monthly:s.$rc_monthly??null,weekly:s.$rc_weekly??null}};function ir(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 or(t){x(t,"svelte-gf0gr5",".rcb-pricing-info.svelte-gf0gr5{display:flex;flex-direction:column;margin-top:102px;font-weight:500}.rcb-product-price.svelte-gf0gr5{font-size:24px;margin:12px 0px}.rcb-product-price-after-trial.svelte-gf0gr5{margin-bottom:12px}.rcb-product-details.svelte-gf0gr5{opacity:0.6;list-style-type:disc;list-style-position:inside;margin:0px;padding:0px}@media screen and (max-width: 960px){.rcb-pricing-info.svelte-gf0gr5{margin-top:48px}}")}function sr(t){var P,N;let e,r,n,i,o,s,l,c,a,u=((P=t[2])==null?void 0:P.periodDuration)&&lr(t),f=!((N=t[2])!=null&&N.periodDuration)&&t[3]&&cr(t),A=t[2]&&t[3]&&ar(t),I=t[0].normalPeriodDuration&&yt(t);return{c(){e=w("span"),u&&u.c(),r=O(),f&&f.c(),n=O(),A&&A.c(),i=O(),o=w("ul"),I&&I.c(),s=O(),l=w("li"),l.textContent="Continues until canceled",c=O(),a=w("li"),a.textContent="Cancel anytime",b(e,"class","rcb-product-price svelte-gf0gr5"),b(o,"class","rcb-product-details svelte-gf0gr5")},m(m,$){_(m,e,$),u&&u.m(e,null),C(e,r),f&&f.m(e,null),_(m,n,$),A&&A.m(m,$),_(m,i,$),_(m,o,$),I&&I.m(o,null),C(o,s),C(o,l),C(o,c),C(o,a)},p(m,$){var le,R;(le=m[2])!=null&&le.periodDuration&&u.p(m,$),!((R=m[2])!=null&&R.periodDuration)&&m[3]&&f.p(m,$),m[2]&&m[3]&&A.p(m,$),m[0].normalPeriodDuration?I?I.p(m,$):(I=yt(m),I.c(),I.m(o,s)):I&&(I.d(1),I=null)},d(m){m&&(h(e),h(n),h(i),h(o)),u&&u.d(),f&&f.d(),A&&A.d(m),I&&I.d()}}}function lr(t){let e=Vn(t[2].periodDuration)+"",r,n;return{c(){r=G(e),n=G(" free trial")},m(i,o){_(i,r,o),_(i,n,o)},p,d(i){i&&(h(r),h(n))}}}function cr(t){let e=t[3].formattedPrice+"",r;return{c(){r=G(e)},m(n,i){_(n,r,i)},p,d(n){n&&h(r)}}}function ar(t){let e;return{c(){e=w("span"),e.textContent=`${t[2]&&t[3]&&`${t[3].formattedPrice} after end of trial`}`,b(e,"class","rcb-product-price-after-trial svelte-gf0gr5")},m(r,n){_(r,e,n)},p,d(r){r&&h(e)}}}function yt(t){let e,r,n=bt(t[0].normalPeriodDuration)+"",i;return{c(){e=w("li"),r=G("Renews "),i=G(n)},m(o,s){_(o,e,s),C(e,r),C(e,i)},p(o,s){s&1&&n!==(n=bt(o[0].normalPeriodDuration)+"")&&ge(i,n)},d(o){o&&h(e)}}}function ur(t){let e;return{c(){var r;e=w("span"),e.textContent=`${(r=t[4])==null?void 0:r.formattedPrice}`,b(e,"class","rcb-product-price svelte-gf0gr5")},m(r,n){_(r,e,n)},p,d(r){r&&h(e)}}}function fr(t){let e,r,n=t[0].title+"",i,o,s,l=t[1]&&sr(t),c=!t[1]&&ur(t);return{c(){e=w("div"),r=w("span"),i=G(n),o=O(),l&&l.c(),s=O(),c&&c.c(),b(e,"class","rcb-pricing-info svelte-gf0gr5")},m(a,u){_(a,e,u),C(e,r),C(r,i),C(e,o),l&&l.m(e,null),C(e,s),c&&c.m(e,null)},p(a,u){u&1&&n!==(n=a[0].title+"")&&ge(i,n),a[1]&&l.p(a,u),a[1]||c.p(a,u)},d(a){a&&h(e),l&&l.d(),c&&c.d()}}}function dr(t){let e,r;return e=new Ee({props:{$$slots:{default:[fr]},$$scope:{ctx:t}}}),{c(){v(e.$$.fragment)},m(n,i){y(e,n,i),r=!0},p(n,[i]){const o={};i&257&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){k(e,n)}}}function gr(t,e,r){var f;let{productDetails:n}=e,{purchaseOption:i}=e;const o=n.productType===Ie.Subscription,s=i,l=i,c=s==null?void 0:s.trial,a=(f=s==null?void 0:s.base)==null?void 0:f.price,u=l==null?void 0:l.basePrice;return t.$$set=A=>{"productDetails"in A&&r(0,n=A.productDetails),"purchaseOption"in A&&r(5,i=A.purchaseOption)},[n,o,c,a,u,i]}class kt extends U{constructor(e){super(),Q(this,e,gr,dr,B,{productDetails:0,purchaseOption:5},or)}}const mr="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+P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EgA5aCK0tKmQChRkGEMgPIiDDhoRYjTR56CPGwiooXN6oENQikhYsWP65MJXglx4sVMoZsJdikRosWOMYSRPJih9q3cOPKnWuRSxa7eO9O3cJFCxe+frdMDQgAIfkEBQUAAQAsBQADACAAEAAACKYAAwgcSLAgwQcODCpcyNDAAYYQAzhpaIDhFYY+NOBY6HAhkyETFRLZ0CGKQgMVDV4RAoQKQxMdUpx8aJAJECYQnWzYcMQgSoNVgAy5CHGGhhI+aRIkMgRnxCohNvQoiLDgEyFDskQUuINDiK1Hfpgc+ETKQi0nVGxNkkSrwCw/hiBxu7XuFidAhARpgqWu3yxIhgApEtLvVipIgARBYthvlKaNFQYEADs=";function pr(t){let e,r;return{c(){e=w("img"),Z(e.src,r=mr)||b(e,"src",r),b(e,"alt","spinner")},m(n,i){_(n,e,i)},p,i:p,o:p,d(n){n&&h(e)}}}class hr extends U{constructor(e){super(),Q(this,e,null,pr,B,{})}}function _r(t){x(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 Ar(t){let e,r,n;return r=new hr({}),{c(){e=w("div"),v(r.$$.fragment),b(e,"class","rcb-modal-loader svelte-1mxx341")},m(i,o){_(i,e,o),y(r,e,null),n=!0},p,i(i){n||(d(r.$$.fragment,i),n=!0)},o(i){g(r.$$.fragment,i),n=!1},d(i){i&&h(e),k(r)}}}class rt extends U{constructor(e){super(),Q(this,e,null,Ar,B,{},_r)}}var te=(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[t.InvalidEmailError=38]="InvalidEmailError",t))(te||{});class Me{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. Please check your network connection and try again.";case 11:return"There was a credentials issue. Check the underlying error for more details.";case 12:return"Received unexpected response from the backend.";case 14:return"The app user id is not valid.";case 15:return"The operation is already in progress.";case 16:return"There was an unknown backend error.";case 17:return"Apple Subscription Key is invalid or not present. In order to provide subscription offers, you must first generate a subscription key. Please see https://docs.revenuecat.com/docs/ios-subscription-offers for more info.";case 18:return"The User is ineligible for that action.";case 19:return"App does not have sufficient permissions to make purchases.";case 20:return"The payment is pending.";case 21:return"One or more of the attributes sent could not be saved.";case 22:return"Called logOut but the current user is anonymous.";case 23:return"There is an issue with your configuration. Check the underlying error for more details.";case 24:return"There was a problem with the operation. Looks like we doesn't support that yet. Check the underlying error for more details.";case 25:return"A request for subscriber attributes returned none.";case 28:return"There was a problem related to the customer info.";case 36:return"Request failed signature verification. Please see https://rev.cat/trusted-entitlements for more info.";case 38:return"Email is not valid. Please provide a valid email address."}}static getErrorCodeForBackendErrorCode(e){switch(e){case 7101:case 7773:return 2;case 7102:return 7;case 7103:return 8;case 7107:case 7224:case 7225:return 11;case 7105:case 7106:case 7814:return 4;case 7772:return 6;case 7220:return 14;case 7229:return 2;case 7230:case 7e3:return 23;case 7231:return 2;case 7232:return 18;case 7263:case 7264:return 21;case 7104:case 7234:case 7226:case 7110:return 12;case 7662:return 24;case 7012:case 7834:return 38}}static convertCodeToBackendErrorCode(e){return e in vt?e:null}static convertPurchaseFlowErrorCodeToErrorCode(e){switch(e){case ne.ErrorSettingUpPurchase:return 2;case ne.ErrorChargingPayment:return 20;case ne.NetworkError:return 10;case ne.MissingEmailError:return 4;case ne.StripeError:return 2;case ne.UnknownError:return 0;case ne.AlreadyPurchasedError:return 6}}}var vt=(t=>(t[t.BackendInvalidPlatform=7e3]="BackendInvalidPlatform",t[t.BackendInvalidEmail=7012]="BackendInvalidEmail",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[t.BackendAlreadySubscribedError=7772]="BackendAlreadySubscribedError",t[t.BackendPaymentGatewayGenericError=7773]="BackendPaymentGatewayGenericError",t[t.BackendOfferNotFound=7814]="BackendOfferNotFound",t[t.BackendNoMXRecordsFound=7834]="BackendNoMXRecordsFound",t))(vt||{});class z extends Error{constructor(r,n,i,o){super(n);D(this,"toString",()=>`PurchasesError(code: ${te[this.errorCode]}, message: ${this.message})`);this.errorCode=r,this.underlyingErrorMessage=i,this.extra=o}static getForBackendError(r,n){const i=Me.getErrorCodeForBackendErrorCode(r);return new z(i,Me.getPublicMessage(i),n,{backendErrorCode:r})}static getForPurchasesFlowError(r){return new z(Me.convertPurchaseFlowErrorCodeToErrorCode(r.errorCode),r.message,r.underlyingErrorMessage)}}class $t extends Error{constructor(){super("Purchases must be configured before calling getInstance")}}var Te=(t=>(t.Started="started",t.InProgress="in_progress",t.Succeeded="succeeded",t.Failed="failed",t))(Te||{}),xe=(t=>(t[t.SetupIntentCreationFailed=1]="SetupIntentCreationFailed",t[t.PaymentMethodCreationFailed=2]="PaymentMethodCreationFailed",t[t.PaymentChargeFailed=3]="PaymentChargeFailed",t))(xe||{}),ne=(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[t.AlreadyPurchasedError=6]="AlreadyPurchasedError",t))(ne||{});class X extends Error{constructor(e,r,n,i,o){super(r),this.errorCode=e,this.underlyingErrorMessage=n,this.purchasesErrorCode=i,this.extra=o}isRecoverable(){switch(this.errorCode){case 3:case 5:return!0;case 0:case 1:case 6:case 4:case 2:return!1}}getPublicErrorMessage(e){var n;const r=((n=this.extra)==null?void 0:n.backendErrorCode)??this.purchasesErrorCode??this.errorCode;switch(this.errorCode){case 2:return`An unknown error occurred. Error code: ${r}.`;case 0:return`Purchase not started due to an error. Error code: ${r}.`;case 1:return"Payment failed.";case 3:return"Network error. Please check your internet connection.";case 4:return this.message;case 5:return"Email is required to complete the purchase.";case 6:return(e==null?void 0:e.productType)===Ie.Subscription?"You are already subscribed to this product.":"You have already purchased this product."}}static fromPurchasesError(e,r){let n;return e.errorCode===te.ProductAlreadyPurchasedError?n=6:e.errorCode===te.InvalidEmailError?n=5:e.errorCode===te.NetworkError?n=3:n=r,new X(n,e.message,e.underlyingErrorMessage,e.errorCode,e.extra)}}class br{constructor(e,r=10){D(this,"operationSessionId",null);D(this,"backend");D(this,"maxNumberAttempts");D(this,"waitMSBetweenAttempts",1e3);this.backend=e,this.maxNumberAttempts=r}async startPurchase(e,r,n,i,o){try{const s=await this.backend.postPurchase(e,r,i,o,n);return this.operationSessionId=s.operation_session_id,s}catch(s){if(s instanceof z)throw X.fromPurchasesError(s,0);{const l="Unknown error starting purchase: "+String(s);throw F.errorLog(l),new X(2,l)}}}async pollCurrentPurchaseForCompletion(){const e=this.operationSessionId;if(!e)throw new X(0,"No purchase in progress");return new Promise((r,n)=>{const i=(o=1)=>{if(o>this.maxNumberAttempts){this.clearPurchaseInProgress(),n(new X(2,"Max attempts reached trying to get successful purchase status"));return}this.backend.getCheckoutStatus(e).then(s=>{switch(s.operation.status){case Te.Started:case Te.InProgress:setTimeout(()=>i(o+1),this.waitMSBetweenAttempts);break;case Te.Succeeded:this.clearPurchaseInProgress(),r();return;case Te.Failed:this.clearPurchaseInProgress(),this.handlePaymentError(s.operation.error,n)}}).catch(s=>{const l=X.fromPurchasesError(s,3);n(l)})};i()})}clearPurchaseInProgress(){this.operationSessionId=null}handlePaymentError(e,r){if(e==null){r(new X(2,"Got an error status but error field is empty."));return}switch(e.code){case xe.SetupIntentCreationFailed:r(new X(0,"Setup intent creation failed"));return;case xe.PaymentMethodCreationFailed:r(new X(0,"Payment method creation failed"));return;case xe.PaymentChargeFailed:r(new X(1,"Payment charge failed"));return}}}const Er="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 Ir(t){x(t,"svelte-1609h93","img.svelte-1609h93{width:124px;height:124px;margin:0 auto}")}function wr(t){let e,r;return{c(){e=w("img"),Z(e.src,r=Er)||b(e,"src",r),b(e,"alt","icon"),b(e,"class","rcb-ui-asset-icon svelte-1609h93")},m(n,i){_(n,e,i)},p,i:p,o:p,d(n){n&&h(e)}}}class yr extends U{constructor(e){super(),Q(this,e,null,wr,B,{},Ir)}}const we=[];function kr(t,e=p){let r;const n=new Set;function i(l){if(B(t,l)&&(t=l,r)){const c=!we.length;for(const a of n)a[1](),we.push(a,t);if(c){for(let a=0;a<we.length;a+=2)we[a][0](we[a+1]);we.length=0}}}function o(l){i(l(t))}function s(l,c=p){const a=[l,c];return n.add(a),n.size===1&&(r=e(i,o)||p),l(t),()=>{n.delete(a),n.size===0&&r&&(r(),r=null)}}return{set:i,update:o,subscribe:s}}const Bt={color_buttons_primary:"",color_accent:"",color_error:"",color_product_info_bg:"",color_form_bg:"",color_page_bg:"",font:"",shapes:"default",show_product_description:!1},Oe=kr(Bt),ye={error:"#f2545b",warning:"#f4e971",focus:"#000080","grey-text-dark":"#000000","grey-text-light":"#767676","grey-ui-dark":"#dfdfdf",white:"#ffffff"},vr=({property:t,variableName:e,fallbackVariableName:r})=>`--${e}: ${t||`var(${r})`}`,$r={color_error:"error",color_accent:"focus"},Br=t=>{if(!t)return Pt(ye);Oe.set(t);const e=Object.entries($r).reduce((r,[n,i])=>(t[n]&&(r[i]=t[n]),r),ye);return Pt(e)},Pt=t=>Object.entries(t).map(([e,r])=>`--rc-color-${e}: ${r}`).join("; "),Dt=(t,e)=>{const r=t?e.replace(/fill="#[0-9A-Fa-f]{6}"/,`fill="${t}"`):e;return`data:image/svg+xml,${encodeURIComponent(r)}`};function Pr(t){x(t,"svelte-1p1gyzs","button.svelte-1p1gyzs{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-1p1gyzs{background-color:var(--btn-color);color:var(--rc-color-white);font-size:16px}button.svelte-1p1gyzs:disabled{color:var(--rc-color-grey-text-light)}button.intent-primary.svelte-1p1gyzs:disabled{color:var(--rc-color-grey-text-light)}")}function Dr(t){let e,r,n,i,o;const s=t[5].default,l=J(s,t,t[4],null);return{c(){e=w("button"),l&&l.c(),b(e,"class",r=K(`intent-${t[0]}`)+" svelte-1p1gyzs"),e.disabled=t[1],b(e,"data-testid",t[2]),b(e,"style",t[3])},m(c,a){_(c,e,a),l&&l.m(e,null),n=!0,i||(o=Be(e,"click",t[6]),i=!0)},p(c,[a]){l&&l.p&&(!n||a&16)&&L(l,s,c,c[4],n?ee(s,c[4],a,null):q(c[4]),null),(!n||a&1&&r!==(r=K(`intent-${c[0]}`)+" svelte-1p1gyzs"))&&b(e,"class",r),(!n||a&2)&&(e.disabled=c[1]),(!n||a&4)&&b(e,"data-testid",c[2])},i(c){n||(d(l,c),n=!0)},o(c){g(l,c),n=!1},d(c){c&&h(e),l&&l.d(c),i=!1,o()}}}function Cr(t,e,r){let n;de(t,Oe,f=>r(7,n=f));let{$$slots:i={},$$scope:o}=e,{intent:s="primary"}=e,{disabled:l=!1}=e,{testId:c=void 0}=e;const a=vr({property:s==="primary"?n.color_buttons_primary:"",variableName:"btn-color",fallbackVariableName:"--rc-color-grey-text-dark"});function u(f){_t.call(this,t,f)}return t.$$set=f=>{"intent"in f&&r(0,s=f.intent),"disabled"in f&&r(1,l=f.disabled),"testId"in f&&r(2,c=f.testId),"$$scope"in f&&r(4,o=f.$$scope)},[s,l,c,a,o,i,u]}class Re extends U{constructor(e){super(),Q(this,e,Cr,Dr,B,{intent:0,disabled:1,testId:2},Pr)}}function Mr(t){x(t,"svelte-1f9z0o8","footer.svelte-1f9z0o8{display:flex;flex-direction:column}")}function Tr(t){let e,r;const n=t[1].default,i=J(n,t,t[0],null);return{c(){e=w("footer"),i&&i.c(),b(e,"class","rcb-modal-footer svelte-1f9z0o8")},m(o,s){_(o,e,s),i&&i.m(e,null),r=!0},p(o,[s]){i&&i.p&&(!r||s&1)&&L(i,n,o,o[0],r?ee(n,o[0],s,null):q(o[0]),null)},i(o){r||(d(i,o),r=!0)},o(o){g(i,o),r=!1},d(o){o&&h(e),i&&i.d(o)}}}function Or(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(0,i=o.$$scope)},[i,n]}class it extends U{constructor(e){super(),Q(this,e,Or,Tr,B,{},Mr)}}function Rr(t){x(t,"svelte-6o8e90",'.column.svelte-6o8e90{display:flex;flex-direction:column;justify-content:flex-start;gap:var(--gap, "8px");flex-grow:1}')}function Qr(t){let e,r,n;const i=t[2].default,o=J(i,t,t[1],null);return{c(){e=w("div"),o&&o.c(),b(e,"class","column svelte-6o8e90"),b(e,"style",r=`--gap:${t[0]};`)},m(s,l){_(s,e,l),o&&o.m(e,null),n=!0},p(s,[l]){o&&o.p&&(!n||l&2)&&L(o,i,s,s[1],n?ee(i,s[1],l,null):q(s[1]),null),(!n||l&1&&r!==(r=`--gap:${s[0]};`))&&b(e,"style",r)},i(s){n||(d(o,s),n=!0)},o(s){g(o,s),n=!1},d(s){s&&h(e),o&&o.d(s)}}}function Ur(t,e,r){let{$$slots:n={},$$scope:i}=e,{gutter:o="8px"}=e;return t.$$set=s=>{"gutter"in s&&r(0,o=s.gutter),"$$scope"in s&&r(1,i=s.$$scope)},[o,i,n]}class Qe extends U{constructor(e){super(),Q(this,e,Ur,Qr,B,{gutter:0},Rr)}}const Nr="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 Sr(t){x(t,"svelte-14xreta",".close-button.svelte-14xreta{border:none;cursor:pointer;background-color:transparent;padding:0px}")}function Lr(t){let e,r,n,i,o;return{c(){e=w("button"),r=w("img"),Z(r.src,n=Nr)||b(r,"src",n),b(r,"alt","close"),b(e,"class","close-button svelte-14xreta"),e.disabled=t[0]},m(s,l){_(s,e,l),C(e,r),i||(o=Be(e,"click",t[1]),i=!0)},p(s,[l]){l&1&&(e.disabled=s[0])},i:p,o:p,d(s){s&&h(e),i=!1,o()}}}function Fr(t,e,r){let{disabled:n=!1}=e;function i(o){_t.call(this,t,o)}return t.$$set=o=>{"disabled"in o&&r(0,n=o.disabled)},[n,i]}class Gr extends U{constructor(e){super(),Q(this,e,Fr,Lr,B,{disabled:0},Sr)}}function Yr(t){x(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 Hr(t){let e;return{c(){e=w("div"),b(e,"class","rcb-app-icon loading svelte-44qpq9")},m(r,n){_(r,e,n)},p,d(r){r&&h(e)}}}function xr(t){let e,r,n,i,o,s;return{c(){e=w("picture"),r=w("source"),i=O(),o=w("img"),b(r,"type","image/webp"),S(r,n=t[1])||b(r,"srcset",n),b(o,"class","rcb-app-icon svelte-44qpq9"),Z(o.src,s=t[0])||b(o,"src",s),b(o,"alt","App icon"),b(e,"class","rcb-app-icon-picture-container svelte-44qpq9")},m(l,c){_(l,e,c),C(e,r),C(e,i),C(e,o)},p(l,c){c&2&&n!==(n=l[1])&&b(r,"srcset",n),c&1&&!Z(o.src,s=l[0])&&b(o,"src",s)},d(l){l&&h(e)}}}function Kr(t){let e;function r(o,s){return o[0]!==null?xr:Hr}let n=r(t),i=n(t);return{c(){i.c(),e=ae()},m(o,s){i.m(o,s),_(o,e,s)},p(o,[s]){n===(n=r(o))&&i?i.p(o,s):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},i:p,o:p,d(o){o&&h(e),i.d(o)}}}function qr(t,e,r){let{src:n=null}=e,{srcWebp:i=null}=e;return t.$$set=o=>{"src"in o&&r(0,n=o.src),"srcWebp"in o&&r(1,i=o.srcWebp)},[n,i]}class Ct extends U{constructor(e){super(),Q(this,e,qr,Kr,B,{src:0,srcWebp:1},Yr)}}const Ke=t=>`https://da08ctfrofx1b.cloudfront.net/${t}`;function jr(t){x(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 Jr(t){let e,r;return e=new Ct({}),{c(){v(e.$$.fragment)},m(n,i){y(e,n,i),r=!0},p,i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){k(e,n)}}}function Vr(t){let e,r,n=t[0].seller_company_name+"",i,o,s=t[0].app_icon_webp!==null&&t[0].app_icon!==null&&Mt(t);return{c(){s&&s.c(),e=O(),r=w("span"),i=G(n),b(r,"class","app-title svelte-10uf5fq")},m(l,c){s&&s.m(l,c),_(l,e,c),_(l,r,c),C(r,i),o=!0},p(l,c){l[0].app_icon_webp!==null&&l[0].app_icon!==null?s?(s.p(l,c),c&1&&d(s,1)):(s=Mt(l),s.c(),d(s,1),s.m(e.parentNode,e)):s&&(V(),g(s,1,1,()=>{s=null}),W()),(!o||c&1)&&n!==(n=l[0].seller_company_name+"")&&ge(i,n)},i(l){o||(d(s),o=!0)},o(l){g(s),o=!1},d(l){l&&(h(e),h(r)),s&&s.d(l)}}}function Mt(t){let e,r;return e=new Ct({props:{src:Ke(t[0].app_icon),srcWebp:Ke(t[0].app_icon_webp)}}),{c(){v(e.$$.fragment)},m(n,i){y(e,n,i),r=!0},p(n,i){const o={};i&1&&(o.src=Ke(n[0].app_icon)),i&1&&(o.srcWebp=Ke(n[0].app_icon_webp)),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){k(e,n)}}}function Wr(t){let e,r,n,i;const o=[Vr,Jr],s=[];function l(c,a){return c[0]!==null?0:1}return r=l(t),n=s[r]=o[r](t),{c(){e=w("div"),n.c(),b(e,"class","rcb-header-layout__business-info svelte-10uf5fq")},m(c,a){_(c,e,a),s[r].m(e,null),i=!0},p(c,[a]){let u=r;r=l(c),r===u?s[r].p(c,a):(V(),g(s[u],1,1,()=>{s[u]=null}),W(),n=s[r],n?n.p(c,a):(n=s[r]=o[r](c),n.c()),d(n,1),n.m(e,null))},i(c){i||(d(n),i=!0)},o(c){g(n),i=!1},d(c){c&&h(e),s[r].d()}}}function zr(t,e,r){let{brandingInfo:n=null}=e;return t.$$set=i=>{"brandingInfo"in i&&r(0,n=i.brandingInfo)},[n]}class Tt extends U{constructor(e){super(),Q(this,e,zr,Wr,B,{brandingInfo:0},jr)}}function Xr(t){x(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 Zr(t){let e,r,n,i,o;return r=new Tt({props:{brandingInfo:t[0]}}),i=new Gr({}),i.$on("click",function(){re(t[1])&&t[1].apply(this,arguments)}),{c(){e=w("div"),v(r.$$.fragment),n=O(),v(i.$$.fragment),b(e,"class","rcb-post-purchase-header-layout svelte-17puakv")},m(s,l){_(s,e,l),y(r,e,null),C(e,n),y(i,e,null),o=!0},p(s,l){t=s;const c={};l&1&&(c.brandingInfo=t[0]),r.$set(c)},i(s){o||(d(r.$$.fragment,s),d(i.$$.fragment,s),o=!0)},o(s){g(r.$$.fragment,s),g(i.$$.fragment,s),o=!1},d(s){s&&h(e),k(r),k(i)}}}function ei(t){let e,r;return e=new Ee({props:{as:"header",$$slots:{default:[Zr]},$$scope:{ctx:t}}}),{c(){v(e.$$.fragment)},m(n,i){y(e,n,i),r=!0},p(n,[i]){const o={};i&7&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){k(e,n)}}}function ti(t,e,r){let{brandingInfo:n=null}=e,{onClose:i}=e;return t.$$set=o=>{"brandingInfo"in o&&r(0,n=o.brandingInfo),"onClose"in o&&r(1,i=o.onClose)},[n,i]}class ni extends U{constructor(e){super(),Q(this,e,ti,ei,B,{brandingInfo:0,onClose:1},Xr)}}function ri(t){x(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 ii=t=>({}),Ot=t=>({});function oi(t){let e,r,n,i,o;const s=t[4].default,l=J(s,t,t[5],null);return{c(){e=w("span"),r=G(t[2]),n=O(),i=w("span"),l&&l.c(),b(e,"class","title svelte-10pcqja"),b(i,"class","subtitle svelte-10pcqja")},m(c,a){_(c,e,a),C(e,r),_(c,n,a),_(c,i,a),l&&l.m(i,null),o=!0},p(c,a){(!o||a&4)&&ge(r,c[2]),l&&l.p&&(!o||a&32)&&L(l,s,c,c[5],o?ee(s,c[5],a,null):q(c[5]),null)},i(c){o||(d(l,c),o=!0)},o(c){g(l,c),o=!1},d(c){c&&(h(e),h(n),h(i)),l&&l.d(c)}}}function si(t){let e,r,n;const i=t[4].icon,o=J(i,t,t[5],Ot);return r=new Qe({props:{gutter:"16px",$$slots:{default:[oi]},$$scope:{ctx:t}}}),{c(){o&&o.c(),e=O(),v(r.$$.fragment)},m(s,l){o&&o.m(s,l),_(s,e,l),y(r,s,l),n=!0},p(s,l){o&&o.p&&(!n||l&32)&&L(o,i,s,s[5],n?ee(i,s[5],l,ii):q(s[5]),Ot);const c={};l&36&&(c.$$scope={dirty:l,ctx:s}),r.$set(c)},i(s){n||(d(o,s),d(r.$$.fragment,s),n=!0)},o(s){g(o,s),g(r.$$.fragment,s),n=!1},d(s){s&&h(e),o&&o.d(s),k(r,s)}}}function li(t){let e,r,n;return r=new Qe({props:{gutter:"16px",$$slots:{default:[si]},$$scope:{ctx:t}}}),{c(){e=w("div"),v(r.$$.fragment),b(e,"class","rcb-modal-message svelte-10pcqja"),b(e,"data-type",t[3])},m(i,o){_(i,e,o),y(r,e,null),n=!0},p(i,o){const s={};o&36&&(s.$$scope={dirty:o,ctx:i}),r.$set(s),(!n||o&8)&&b(e,"data-type",i[3])},i(i){n||(d(r.$$.fragment,i),n=!0)},o(i){g(r.$$.fragment,i),n=!1},d(i){i&&h(e),k(r)}}}function ci(t){let e;return{c(){e=G("Go back to app")},m(r,n){_(r,e,n)},d(r){r&&h(e)}}}function ai(t){let e,r;return e=new Re({props:{$$slots:{default:[ci]},$$scope:{ctx:t}}}),e.$on("click",function(){re(t[1])&&t[1].apply(this,arguments)}),{c(){v(e.$$.fragment)},m(n,i){y(e,n,i),r=!0},p(n,i){t=n;const o={};i&32&&(o.$$scope={dirty:i,ctx:t}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){k(e,n)}}}function ui(t){let e,r,n,i,o,s;return e=new ni({props:{brandingInfo:t[0],onClose:t[1]}}),n=new Ee({props:{$$slots:{default:[li]},$$scope:{ctx:t}}}),o=new it({props:{$$slots:{default:[ai]},$$scope:{ctx:t}}}),{c(){v(e.$$.fragment),r=O(),v(n.$$.fragment),i=O(),v(o.$$.fragment)},m(l,c){y(e,l,c),_(l,r,c),y(n,l,c),_(l,i,c),y(o,l,c),s=!0},p(l,c){const a={};c&1&&(a.brandingInfo=l[0]),c&2&&(a.onClose=l[1]),e.$set(a);const u={};c&44&&(u.$$scope={dirty:c,ctx:l}),n.$set(u);const f={};c&34&&(f.$$scope={dirty:c,ctx:l}),o.$set(f)},i(l){s||(d(e.$$.fragment,l),d(n.$$.fragment,l),d(o.$$.fragment,l),s=!0)},o(l){g(e.$$.fragment,l),g(n.$$.fragment,l),g(o.$$.fragment,l),s=!1},d(l){l&&(h(r),h(i)),k(e,l),k(n,l),k(o,l)}}}function fi(t){let e,r;return e=new Qe({props:{gutter:"32px",$$slots:{default:[ui]},$$scope:{ctx:t}}}),{c(){v(e.$$.fragment)},m(n,i){y(e,n,i),r=!0},p(n,[i]){const o={};i&47&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){k(e,n)}}}function di(t,e,r){let{$$slots:n={},$$scope:i}=e,{brandingInfo:o=null}=e,{onContinue:s}=e,{title:l}=e,{type:c}=e;return t.$$set=a=>{"brandingInfo"in a&&r(0,o=a.brandingInfo),"onContinue"in a&&r(1,s=a.onContinue),"title"in a&&r(2,l=a.title),"type"in a&&r(3,c=a.type),"$$scope"in a&&r(5,i=a.$$scope)},[o,s,l,c,n,i]}class Rt extends U{constructor(e){super(),Q(this,e,di,fi,B,{brandingInfo:0,onContinue:1,title:2,type:3},ri)}}function Qt(t){let e,r,n,i,o,s;return{c(){e=w("br"),r=G("If this error persists, please contact "),n=w("a"),i=G(t[2]),s=G("."),b(n,"href",o="mailto:"+t[2])},m(l,c){_(l,e,c),_(l,r,c),_(l,n,c),C(n,i),_(l,s,c)},p(l,c){c&4&&ge(i,l[2]),c&4&&o!==(o="mailto:"+l[2])&&b(n,"href",o)},d(l){l&&(h(e),h(r),h(n),h(s))}}}function gi(t){let e=t[1].getPublicErrorMessage(t[3])+"",r,n,i,o=t[2]&&Qt(t);return{c(){r=G(e),n=O(),o&&o.c(),i=ae()},m(s,l){_(s,r,l),_(s,n,l),o&&o.m(s,l),_(s,i,l)},p(s,l){l&10&&e!==(e=s[1].getPublicErrorMessage(s[3])+"")&&ge(r,e),s[2]?o?o.p(s,l):(o=Qt(s),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null)},d(s){s&&(h(r),h(n),h(i)),o&&o.d(s)}}}function mi(t){let e,r;return e=new yr({props:{slot:"icon"}}),{c(){v(e.$$.fragment)},m(n,i){y(e,n,i),r=!0},p,i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){k(e,n)}}}function pi(t){let e,r;return e=new Rt({props:{title:t[5](),brandingInfo:t[0],onContinue:t[4],type:"error",$$slots:{icon:[mi],default:[gi]},$$scope:{ctx:t}}}),{c(){v(e.$$.fragment)},m(n,i){y(e,n,i),r=!0},p(n,[i]){const o={};i&1&&(o.brandingInfo=n[0]),i&16&&(o.onContinue=n[4]),i&78&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){k(e,n)}}}function hi(t,e,r){let{brandingInfo:n=null}=e,{lastError:i}=e,{supportEmail:o=null}=e,{productDetails:s=null}=e,{onContinue:l}=e;Ge(()=>{F.errorLog(`Displayed error: ${ne[i.errorCode]}. Message: ${i.message??"None"}. Underlying error: ${i.underlyingErrorMessage??"None"}`)});function c(){switch(i.errorCode){case ne.AlreadyPurchasedError:return(s==null?void 0:s.productType)===Ie.Subscription?"Already subscribed":"Already purchased";default:return"Something went wrong"}}return t.$$set=a=>{"brandingInfo"in a&&r(0,n=a.brandingInfo),"lastError"in a&&r(1,i=a.lastError),"supportEmail"in a&&r(2,o=a.supportEmail),"productDetails"in a&&r(3,s=a.productDetails),"onContinue"in a&&r(4,l=a.onContinue)},[n,i,o,s,l,c]}class _i extends U{constructor(e){super(),Q(this,e,hi,pi,B,{brandingInfo:0,lastError:1,supportEmail:2,productDetails:3,onContinue:4})}}const Ai=`<svg width="124" height="124" viewBox="0 0 124 124" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<circle cx="62" cy="62" r="62" fill="#576CDB"/>
|
|
3
|
+
<rect x="44.1116" y="56" width="27.5" height="11" transform="rotate(45 44.1116 56)" fill="white"/>
|
|
4
|
+
<rect x="79.1133" y="44.334" width="11" height="44" transform="rotate(45 79.1133 44.334)" fill="white"/>
|
|
5
|
+
</svg>
|
|
6
|
+
`;function bi(t){x(t,"svelte-1609h93","img.svelte-1609h93{width:124px;height:124px;margin:0 auto}")}function Ei(t){let e,r;return{c(){e=w("img"),Z(e.src,r=t[0])||b(e,"src",r),b(e,"alt","icon"),b(e,"class","rcb-ui-asset-icon svelte-1609h93")},m(n,i){_(n,e,i)},p,i:p,o:p,d(n){n&&h(e)}}}function Ii(t,e,r){let n;de(t,Oe,s=>r(1,n=s));const i=n.color_accent;return[Dt(i,Ai)]}class wi extends U{constructor(e){super(),Q(this,e,Ii,Ei,B,{},bi)}}function yi(t){let e;return{c(){e=G("Your plan is now active.")},m(r,n){_(r,e,n)},d(r){r&&h(e)}}}function ki(t){let e,r=t[2]&&yi();return{c(){r&&r.c(),e=ae()},m(n,i){r&&r.m(n,i),_(n,e,i)},p,d(n){n&&h(e),r&&r.d(n)}}}function vi(t){let e,r;return e=new wi({props:{slot:"icon"}}),{c(){v(e.$$.fragment)},m(n,i){y(e,n,i),r=!0},p,i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){k(e,n)}}}function $i(t){let e,r;return e=new Rt({props:{type:"success",title:"Purchase successful",brandingInfo:t[0],onContinue:t[1],$$slots:{icon:[vi],default:[ki]},$$scope:{ctx:t}}}),{c(){v(e.$$.fragment)},m(n,i){y(e,n,i),r=!0},p(n,[i]){const o={};i&1&&(o.brandingInfo=n[0]),i&2&&(o.onContinue=n[1]),i&16&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){k(e,n)}}}function Bi(t,e,r){let{productDetails:n=null}=e,{brandingInfo:i=null}=e,{onContinue:o}=e;const s=(n==null?void 0:n.productType)===Ie.Subscription;return t.$$set=l=>{"productDetails"in l&&r(3,n=l.productDetails),"brandingInfo"in l&&r(0,i=l.brandingInfo),"onContinue"in l&&r(1,o=l.onContinue)},[i,o,s,n]}class Pi extends U{constructor(e){super(),Q(this,e,Bi,$i,B,{productDetails:3,brandingInfo:0,onContinue:1})}}function Di(t,e,r,n,i={}){const o=r.create(e,i);return o.mount(t),o.on("change",s=>n("change",s)),o.on("ready",s=>n("ready",s)),o.on("focus",s=>n("focus",s)),o.on("blur",s=>n("blur",s)),o.on("escape",s=>n("escape",s)),o.on("click",s=>n("click",s)),o.on("loaderror",s=>n("loaderror",s)),o.on("loaderstart",s=>n("loaderstart",s)),o.on("networkschange",s=>n("networkschange",s)),o}const Ci=typeof window>"u";function Mi(t){if(!Ci)return t.registerAppInfo({name:"svelte-stripe-js",url:"https://svelte-stripe-js.vercel.app"})}function Ti(t){let e;return{c(){e=w("div")},m(r,n){_(r,e,n),t[6](e)},p,i:p,o:p,d(r){r&&h(e),t[6](null)}}}function Oi(t,e,r){let n,i;const o=Tn(),{elements:s}=Rn("stripe");let{options:l=void 0}=e;Ge(()=>(n=Di(i,"payment",s,o,l),()=>n.destroy()));function c(){n.blur()}function a(){n.clear()}function u(){n.destroy()}function f(){n.focus()}function A(I){Ye[I?"unshift":"push"](()=>{i=I,r(0,i)})}return t.$$set=I=>{"options"in I&&r(1,l=I.options)},[i,l,c,a,u,f,A]}class Ri extends U{constructor(e){super(),Q(this,e,Oi,Ti,B,{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=J(r,t,t[14],null);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&16384)&&L(n,r,i,i[14],e?ee(r,i[14],o,null):q(i[14]),null)},i(i){e||(d(n,i),e=!0)},o(i){g(n,i),e=!1},d(i){n&&n.d(i)}}}function Qi(t){let e,r,n=t[1]&&t[0]&&Ut(t);return{c(){n&&n.c(),e=ae()},m(i,o){n&&n.m(i,o),_(i,e,o),r=!0},p(i,[o]){i[1]&&i[0]?n?(n.p(i,o),o&3&&d(n,1)):(n=Ut(i),n.c(),d(n,1),n.m(e.parentNode,e)):n&&(V(),g(n,1,1,()=>{n=null}),W())},i(i){r||(d(n),r=!0)},o(i){g(n),r=!1},d(i){i&&h(e),n&&n.d(i)}}}function Ui(t,e,r){let n,{$$slots:i={},$$scope:o}=e,{stripe:s}=e,{mode:l=void 0}=e,{theme:c="stripe"}=e,{variables:a={}}=e,{rules:u={}}=e,{labels:f="above"}=e,{loader:A="auto"}=e,{fonts:I=[]}=e,{locale:P="auto"}=e,{currency:N=void 0}=e,{amount:m=void 0}=e,{clientSecret:$=void 0}=e,{elements:le=null}=e;return t.$$set=R=>{"stripe"in R&&r(1,s=R.stripe),"mode"in R&&r(2,l=R.mode),"theme"in R&&r(3,c=R.theme),"variables"in R&&r(4,a=R.variables),"rules"in R&&r(5,u=R.rules),"labels"in R&&r(6,f=R.labels),"loader"in R&&r(7,A=R.loader),"fonts"in R&&r(8,I=R.fonts),"locale"in R&&r(9,P=R.locale),"currency"in R&&r(10,N=R.currency),"amount"in R&&r(11,m=R.amount),"clientSecret"in R&&r(12,$=R.clientSecret),"elements"in R&&r(0,le=R.elements),"$$scope"in R&&r(14,o=R.$$scope)},t.$$.update=()=>{t.$$.dirty&120&&r(13,n={theme:c,variables:a,rules:u,labels:f}),t.$$.dirty&16263&&s&&!le&&(r(0,le=s.elements({mode:l,currency:N,amount:m,appearance:n,clientSecret:$,fonts:I,loader:A,locale:P})),Mi(s),On("stripe",{stripe:s,elements:le})),t.$$.dirty&8705&&le&&le.update({appearance:n,locale:P})},[le,s,l,c,a,u,f,A,I,P,N,m,$,n,o,i]}class Ni extends U{constructor(e){super(),Q(this,e,Ui,Qi,B,{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 Nt="https://js.stripe.com/v3",Si=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,St="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",Li=function(){for(var e=document.querySelectorAll('script[src^="'.concat(Nt,'"]')),r=0;r<e.length;r++){var n=e[r];if(Si.test(n.src))return n}return null},Lt=function(e){var r="",n=document.createElement("script");n.src="".concat(Nt).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},Fi=function(e,r){!e||!e._registerWrapper||e._registerWrapper({name:"stripe-js",version:"2.4.0",startTime:r})},Ue=null,qe=null,je=null,Gi=function(e){return function(){e(new Error("Failed to load Stripe.js"))}},Yi=function(e,r){return function(){window.Stripe?e(window.Stripe):r(new Error("Stripe.js not available"))}},Hi=function(e){return Ue!==null?Ue:(Ue=new Promise(function(r,n){if(typeof window>"u"||typeof document>"u"){r(null);return}if(window.Stripe&&e&&console.warn(St),window.Stripe){r(window.Stripe);return}try{var i=Li();if(i&&e)console.warn(St);else if(!i)i=Lt(e);else if(i&&je!==null&&qe!==null){var o;i.removeEventListener("load",je),i.removeEventListener("error",qe),(o=i.parentNode)===null||o===void 0||o.removeChild(i),i=Lt(e)}je=Yi(r,n),qe=Gi(n),i.addEventListener("load",je),i.addEventListener("error",qe)}catch(s){n(s);return}}),Ue.catch(function(r){return Ue=null,Promise.reject(r)}))},xi=function(e,r,n){if(e===null)return null;var i=e.apply(void 0,r);return Fi(i,n),i},Ne,Ft=!1,Gt=function(){return Ne||(Ne=Hi(null).catch(function(e){return Ne=null,Promise.reject(e)}),Ne)};Promise.resolve().then(function(){return Gt()}).catch(function(t){Ft||console.warn(t)});var Ki=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];Ft=!0;var i=Date.now();return Gt().then(function(o){return xi(o,r,i)})};function qi(t){x(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 ji(t){let e,r;const n=t[0].default,i=J(n,t,t[1],null);return{c(){e=w("div"),i&&i.c(),b(e,"class","rcb-header-layout svelte-1xe711j")},m(o,s){_(o,e,s),i&&i.m(e,null),r=!0},p(o,s){i&&i.p&&(!r||s&2)&&L(i,n,o,o[1],r?ee(n,o[1],s,null):q(o[1]),null)},i(o){r||(d(i,o),r=!0)},o(o){g(i,o),r=!1},d(o){o&&h(e),i&&i.d(o)}}}function Ji(t){let e,r;return e=new Ee({props:{as:"header",$$slots:{default:[ji]},$$scope:{ctx:t}}}),{c(){v(e.$$.fragment)},m(n,i){y(e,n,i),r=!0},p(n,[i]){const o={};i&2&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){k(e,n)}}}function Vi(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(1,i=o.$$scope)},[n,i]}class ot extends U{constructor(e){super(),Q(this,e,Vi,Ji,B,{},qi)}}const Wi=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
7
|
+
<path d="M18 8H17V6C17 3.24 14.76 1 12 1C9.24 1 7 3.24 7 6V8H6C4.9 8 4 8.9 4 10V20C4 21.1 4.9 22 6 22H18C19.1 22 20 21.1 20 20V10C20 8.9 19.1 8 18 8ZM12 17C10.9 17 10 16.1 10 15C10 13.9 10.9 13 12 13C13.1 13 14 13.9 14 15C14 16.1 13.1 17 12 17ZM15.1 8H8.9V6C8.9 4.29 10.29 2.9 12 2.9C13.71 2.9 15.1 4.29 15.1 6V8Z" fill="#11D483"/>
|
|
8
|
+
</svg>
|
|
9
|
+
`;function zi(t){let e,r;return{c(){e=w("img"),Z(e.src,r=t[0])||b(e,"src",r),b(e,"alt","icon"),b(e,"class","rcb-ui-asset-icon")},m(n,i){_(n,e,i)},p,i:p,o:p,d(n){n&&h(e)}}}function Xi(t,e,r){let n;de(t,Oe,s=>r(1,n=s));const i=n.color_accent;return[Dt(i,Wi)]}class Zi extends U{constructor(e){super(),Q(this,e,Xi,zi,B,{})}}function eo(t){x(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
10
|
-20px 0 #fff2;background:#fff2}25%{box-shadow:20px 0 #fff2,
|
|
3
11
|
-20px 0 #ffff;background:#fff2}50%{box-shadow:20px 0 #fff2,
|
|
4
12
|
-20px 0 #fff2;background:#ffff}75%{box-shadow:20px 0 #ffff,
|
|
5
13
|
-20px 0 #fff2;background:#fff2}100%{box-shadow:20px 0 #fff2,
|
|
6
|
-
-20px 0 #fff2;background:#fff2}}`)}function Ci(t){let e;return{c(){e=y("div"),A(e,"class","processing svelte-rjmul6")},m(r,n){_(r,e,n)},p:m,i:m,o:m,d(r){r&&h(e)}}}class Ut extends L{constructor(e){super(),S(this,e,null,Ci,B,{},Pi)}}function Mi(t){T(t,"svelte-1wxt892",".rcb-stripe-elements-container.svelte-1wxt892{width:100%;margin-top:32px;margin-bottom:24px}")}function Ti(t){let e,r;return e=new rt({}),{c(){k(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p:m,i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){w(e,n)}}}function Ri(t){let e,r,n,i,o,s;function l(a){t[11](a)}let c={stripe:t[5],clientSecret:t[6],loader:"always",theme:"stripe",variables:{borderRadius:"12px",fontSizeBase:"16px",fontSizeSm:"16px",spacingGridRow:"16px",colorText:Qe["grey-text-dark"],focusBoxShadow:"none",colorDanger:Qe.error},rules:{".Input":{boxShadow:"none",border:`2px solid ${Qe["grey-ui-dark"]}`},".Input:focus":{border:`2px solid ${Qe.focus}`,outline:"none"},".Label":{marginBottom:"8px",fontWeight:"500",lineHeight:"22px"},".Input--invalid":{boxShadow:"none"}},$$slots:{default:[Yi]},$$scope:{ctx:t}};return t[4]!==void 0&&(c.elements=t[4]),r=new gi({props:c}),xe.push(()=>Rn(r,"elements",l)),{c(){e=y("form"),k(r.$$.fragment)},m(a,u){_(a,e,u),I(r,e,null),i=!0,o||(s=ke(e,"submit",pt(t[7])),o=!0)},p(a,u){const d={};u&32&&(d.stripe=a[5]),u&8207&&(d.$$scope={dirty:u,ctx:a}),!n&&u&16&&(n=!0,d.elements=a[4],Cn(()=>n=!1)),r.$set(d)},i(a){i||(f(r.$$.fragment,a),i=!0)},o(a){g(r.$$.fragment,a),i=!1},d(a){a&&h(e),w(r),o=!1,s()}}}function Qi(t){let e,r,n,i;return n=new Di({}),{c(){e=y("div"),e.textContent="Secure Checkout",r=O(),k(n.$$.fragment)},m(o,s){_(o,e,s),_(o,r,s),I(n,o,s),i=!0},p:m,i(o){i||(f(n.$$.fragment,o),i=!0)},o(o){g(n.$$.fragment,o),i=!1},d(o){o&&(h(e),h(r)),w(n,o)}}}function Ni(t){let e,r,n;return r=new ui({}),{c(){e=y("div"),k(r.$$.fragment),A(e,"class","rcb-stripe-elements-container svelte-1wxt892")},m(i,o){_(i,e,o),I(r,e,null),n=!0},p:m,i(i){n||(f(r.$$.fragment,i),n=!0)},o(i){g(r.$$.fragment,i),n=!1},d(i){i&&h(e),w(r)}}}function Ui(t){let e;return{c(){e=Y("Pay")},m(r,n){_(r,e,n)},i:m,o:m,d(r){r&&h(e)}}}function Oi(t){let e;return{c(){e=Y("Start Trial")},m(r,n){_(r,e,n)},i:m,o:m,d(r){r&&h(e)}}}function Si(t){let e,r;return e=new Ut({}),{c(){k(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){w(e,n)}}}function Li(t){let e,r,n,i;const o=[Si,Oi,Ui],s=[];function l(c,a){var u,d;return c[0]?0:(d=(u=c[2].subscriptionOptions)==null?void 0:u[c[3].id])!=null&&d.trial?1:2}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=ce()},m(c,a){s[e].m(c,a),_(c,n,a),i=!0},p(c,a){let u=e;e=l(c),e!==u&&(W(),g(s[u],1,1,()=>{s[u]=null}),z(),r=s[e],r||(r=s[e]=o[e](c),r.c()),f(r,1),r.m(n.parentNode,n))},i(c){i||(f(r),i=!0)},o(c){g(r),i=!1},d(c){c&&h(n),s[e].d(c)}}}function Fi(t){let e;return{c(){e=Y("Close")},m(r,n){_(r,e,n)},d(r){r&&h(e)}}}function xi(t){let e,r,n,i;return e=new Ce({props:{disabled:t[0],testId:"PayButton",$$slots:{default:[Li]},$$scope:{ctx:t}}}),n=new Ce({props:{disabled:t[0],intent:"secondary",$$slots:{default:[Fi]},$$scope:{ctx:t}}}),n.$on("click",function(){ie(t[1])&&t[1].apply(this,arguments)}),{c(){k(e.$$.fragment),r=O(),k(n.$$.fragment)},m(o,s){I(e,o,s),_(o,r,s),I(n,o,s),i=!0},p(o,s){t=o;const l={};s&1&&(l.disabled=t[0]),s&8205&&(l.$$scope={dirty:s,ctx:t}),e.$set(l);const c={};s&1&&(c.disabled=t[0]),s&8192&&(c.$$scope={dirty:s,ctx:t}),n.$set(c)},i(o){i||(f(e.$$.fragment,o),f(n.$$.fragment,o),i=!0)},o(o){g(e.$$.fragment,o),g(n.$$.fragment,o),i=!1},d(o){o&&h(r),w(e,o),w(n,o)}}}function Gi(t){let e,r;return e=new Me({props:{$$slots:{default:[xi]},$$scope:{ctx:t}}}),{c(){k(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&8207&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){w(e,n)}}}function Yi(t){let e,r,n,i,o,s;return e=new ot({props:{$$slots:{default:[Qi]},$$scope:{ctx:t}}}),n=new Ee({props:{$$slots:{default:[Ni]},$$scope:{ctx:t}}}),o=new it({props:{$$slots:{default:[Gi]},$$scope:{ctx:t}}}),{c(){k(e.$$.fragment),r=O(),k(n.$$.fragment),i=O(),k(o.$$.fragment)},m(l,c){I(e,l,c),_(l,r,c),I(n,l,c),_(l,i,c),I(o,l,c),s=!0},p(l,c){const a={};c&8192&&(a.$$scope={dirty:c,ctx:l}),e.$set(a);const u={};c&8192&&(u.$$scope={dirty:c,ctx:l}),n.$set(u);const d={};c&8207&&(d.$$scope={dirty:c,ctx:l}),o.$set(d)},i(l){s||(f(e.$$.fragment,l),f(n.$$.fragment,l),f(o.$$.fragment,l),s=!0)},o(l){g(e.$$.fragment,l),g(n.$$.fragment,l),g(o.$$.fragment,l),s=!1},d(l){l&&(h(r),h(i)),w(e,l),w(n,l),w(o,l)}}}function Hi(t){let e,r,n,i;const o=[Ri,Ti],s=[];function l(c,a){return c[5]&&c[6]?0:1}return r=l(t),n=s[r]=o[r](t),{c(){e=y("div"),n.c()},m(c,a){_(c,e,a),s[r].m(e,null),i=!0},p(c,[a]){let u=r;r=l(c),r===u?s[r].p(c,a):(W(),g(s[u],1,1,()=>{s[u]=null}),z(),n=s[r],n?n.p(c,a):(n=s[r]=o[r](c),n.c()),f(n,1),n.m(e,null))},i(c){i||(f(n),i=!0)},o(c){g(n),i=!1},d(c){c&&h(e),s[r].d()}}}function Ki(t,e,r){let{onClose:n}=e,{onContinue:i}=e,{onError:o}=e,{paymentInfoCollectionMetadata:s}=e,{processing:l=!1}=e,{productDetails:c}=e,{purchaseOptionToUse:a}=e;const u=s.data.client_secret;let d=null,b,$;Fe(async()=>{const p=s.data.publishable_api_key,v=s.data.stripe_account_id;if(!p||!v)throw new Error("Stripe publishable key or account ID not found");r(5,d=await Ii(p,{stripeAccount:v}))});const D=async()=>{if(l||!d||!$)return;r(0,l=!0);const p=await d.confirmSetup({elements:$,redirect:"if_required"});p.error?(r(0,l=!1),o(new Z(re.StripeError,p.error.message))):i()};function R(p){b=p,r(4,b)}return t.$$set=p=>{"onClose"in p&&r(1,n=p.onClose),"onContinue"in p&&r(8,i=p.onContinue),"onError"in p&&r(9,o=p.onError),"paymentInfoCollectionMetadata"in p&&r(10,s=p.paymentInfoCollectionMetadata),"processing"in p&&r(0,l=p.processing),"productDetails"in p&&r(2,c=p.productDetails),"purchaseOptionToUse"in p&&r(3,a=p.purchaseOptionToUse)},t.$$.update=()=>{t.$$.dirty&16&&b&&b._elements.length>0&&($=b)},[l,n,c,a,b,d,u,D,i,o,s,R]}class ji extends L{constructor(e){super(),S(this,e,Ki,Hi,B,{onClose:1,onContinue:8,onError:9,paymentInfoCollectionMetadata:10,processing:0,productDetails:2,purchaseOptionToUse:3},Mi)}}function qi(t){return t.trim()===""?"You need to provide your email address to continue.":t.match(/^[^@]+@[^@]+\.[^@]+$/)?null:"Email is not valid. Please provide a valid email address."}function Ji(t){if(t&&!t.match(/^[A-Z]{3}$/)){const e=`Currency code ${t} is not valid. Please provide a valid ISO 4217 currency code.`;throw K.errorLog(e),new X(ne.ConfigurationError,e)}}function Vi(t){T(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 Wi(t){let e;return{c(){e=Y("Billing email address")},m(r,n){_(r,e,n)},d(r){r&&h(e)}}}function Ot(t){let e,r;return{c(){e=y("div"),r=Y(t[2]),A(e,"class","form-error svelte-favd20")},m(n,i){_(n,e,i),P(e,r)},p(n,i){i&4&&de(r,n[2])},d(n){n&&h(e)}}}function zi(t){let e,r,n,i,o,s,l,c,a,u=t[2]&&Ot(t);return{c(){e=y("div"),r=y("div"),r.innerHTML='<label for="email">Email</label>',n=O(),i=y("div"),o=y("input"),l=O(),u&&u.c(),A(r,"class","form-label svelte-favd20"),A(o,"name","email"),A(o,"placeholder","john@appleseed.com"),A(o,"autocapitalize","off"),A(o,"class","svelte-favd20"),A(i,"class",s="form-input "+t[4]+" svelte-favd20"),A(e,"class","form-container svelte-favd20")},m(d,b){_(d,e,b),P(e,r),P(e,n),P(e,i),P(i,o),ht(o,t[3]),P(e,l),u&&u.m(e,null),c||(a=ke(o,"input",t[8]),c=!0)},p(d,b){b&8&&o.value!==d[3]&&ht(o,d[3]),b&16&&s!==(s="form-input "+d[4]+" svelte-favd20")&&A(i,"class",s),d[2]?u?u.p(d,b):(u=Ot(d),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},d(d){d&&h(e),u&&u.d(),c=!1,a()}}}function Xi(t){let e;return{c(){e=Y("Continue")},m(r,n){_(r,e,n)},i:m,o:m,d(r){r&&h(e)}}}function Zi(t){let e,r;return e=new Ut({}),{c(){k(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){w(e,n)}}}function eo(t){let e,r,n,i;const o=[Zi,Xi],s=[];function l(c,a){return c[1]?0:1}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=ce()},m(c,a){s[e].m(c,a),_(c,n,a),i=!0},p(c,a){let u=e;e=l(c),e!==u&&(W(),g(s[u],1,1,()=>{s[u]=null}),z(),r=s[e],r||(r=s[e]=o[e](c),r.c()),f(r,1),r.m(n.parentNode,n))},i(c){i||(f(r),i=!0)},o(c){g(r),i=!1},d(c){c&&h(n),s[e].d(c)}}}function to(t){let e;return{c(){e=Y("Close")},m(r,n){_(r,e,n)},d(r){r&&h(e)}}}function no(t){let e,r,n,i;return e=new Ce({props:{disabled:t[1],$$slots:{default:[eo]},$$scope:{ctx:t}}}),n=new Ce({props:{intent:"secondary",disabled:t[1],$$slots:{default:[to]},$$scope:{ctx:t}}}),n.$on("click",function(){ie(t[0])&&t[0].apply(this,arguments)}),{c(){k(e.$$.fragment),r=O(),k(n.$$.fragment)},m(o,s){I(e,o,s),_(o,r,s),I(n,o,s),i=!0},p(o,s){t=o;const l={};s&2&&(l.disabled=t[1]),s&514&&(l.$$scope={dirty:s,ctx:t}),e.$set(l);const c={};s&2&&(c.disabled=t[1]),s&512&&(c.$$scope={dirty:s,ctx:t}),n.$set(c)},i(o){i||(f(e.$$.fragment,o),f(n.$$.fragment,o),i=!0)},o(o){g(e.$$.fragment,o),g(n.$$.fragment,o),i=!1},d(o){o&&h(r),w(e,o),w(n,o)}}}function ro(t){let e,r;return e=new Me({props:{$$slots:{default:[no]},$$scope:{ctx:t}}}),{c(){k(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&515&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){w(e,n)}}}function io(t){let e,r,n,i,o,s,l,c,a;return r=new ot({props:{$$slots:{default:[Wi]},$$scope:{ctx:t}}}),i=new Ee({props:{$$slots:{default:[zi]},$$scope:{ctx:t}}}),s=new it({props:{$$slots:{default:[ro]},$$scope:{ctx:t}}}),{c(){e=y("form"),k(r.$$.fragment),n=O(),k(i.$$.fragment),o=O(),k(s.$$.fragment),A(e,"class","svelte-favd20")},m(u,d){_(u,e,d),I(r,e,null),P(e,n),I(i,e,null),P(e,o),I(s,e,null),l=!0,c||(a=ke(e,"submit",pt(t[5])),c=!0)},p(u,[d]){const b={};d&512&&(b.$$scope={dirty:d,ctx:u}),r.$set(b);const $={};d&540&&($.$$scope={dirty:d,ctx:u}),i.$set($);const D={};d&515&&(D.$$scope={dirty:d,ctx:u}),s.$set(D)},i(u){l||(f(r.$$.fragment,u),f(i.$$.fragment,u),f(s.$$.fragment,u),l=!0)},o(u){g(r.$$.fragment,u),g(i.$$.fragment,u),g(s.$$.fragment,u),l=!1},d(u){u&&h(e),w(r),w(i),w(s),c=!1,a()}}}function oo(t,e,r){let n,i,o,{onContinue:s}=e,{onClose:l}=e,{processing:c}=e,{lastError:a}=e;const u=async()=>{const b=qi(n);b?r(2,i=b):s({email:n})};kn(async()=>{r(2,i=(a==null?void 0:a.message)??"")});function d(){n=this.value,r(3,n)}return t.$$set=b=>{"onContinue"in b&&r(6,s=b.onContinue),"onClose"in b&&r(0,l=b.onClose),"processing"in b&&r(1,c=b.processing),"lastError"in b&&r(7,a=b.lastError)},t.$$.update=()=>{t.$$.dirty&4&&r(4,o=i?"error":"")},r(3,n=""),r(2,i=""),[l,c,i,n,o,u,s,a,d]}class so extends L{constructor(e){super(),S(this,e,oo,io,B,{onContinue:6,onClose:0,processing:1,lastError:7},Vi)}}function lo(t){T(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 co(t){let e,r;const n=t[1].default,i=x(n,t,t[0],null);return{c(){e=y("div"),i&&i.c(),A(e,"class","rcb-modal-backdrop svelte-17tslso")},m(o,s){_(o,e,s),i&&i.m(e,null),r=!0},p(o,[s]){i&&i.p&&(!r||s&1)&&J(i,n,o,o[0],r?q(n,o[0],s,null):te(o[0]),null)},i(o){r||(f(i,o),r=!0)},o(o){g(i,o),r=!1},d(o){o&&h(e),i&&i.d(o)}}}function ao(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(0,i=o.$$scope)},[i,n]}class uo extends L{constructor(e){super(),S(this,e,ao,co,B,{},lo)}}function fo(t){T(t,"svelte-z3twhy",".rcb-modal-container.svelte-z3twhy{width:100%}.rcb-modal-main.svelte-z3twhy{box-sizing:border-box;border-radius:16px;background-color:var(--rc-color-white);color:var(--rc-color-grey-text-dark);min-height:460px;padding:40px;flex-direction:column;display:flex}.rcb-modal-dark.svelte-z3twhy{background-color:var(--rc-color-grey-text-dark);color:var(--rc-color-white);min-height:0px}@media screen and (max-width: 960px){.rcb-modal-container.svelte-z3twhy{width:calc(100% - 32px);min-width:300px;max-width:640px;margin:auto}.rcb-modal-main.svelte-z3twhy,.rcb-modal-dark.svelte-z3twhy{min-width:300px;max-width:640px;padding:32px}}")}function go(t){let e,r,n,i;const o=t[2].default,s=x(o,t,t[1],null);return{c(){e=y("div"),r=y("main"),s&&s.c(),A(r,"class",n=V(`rcb-modal-main ${t[0]?"rcb-modal-dark":""}`)+" svelte-z3twhy"),A(e,"class","rcb-modal-container svelte-z3twhy")},m(l,c){_(l,e,c),P(e,r),s&&s.m(r,null),i=!0},p(l,[c]){s&&s.p&&(!i||c&2)&&J(s,o,l,l[1],i?q(o,l[1],c,null):te(l[1]),null),(!i||c&1&&n!==(n=V(`rcb-modal-main ${l[0]?"rcb-modal-dark":""}`)+" svelte-z3twhy"))&&A(r,"class",n)},i(l){i||(f(s,l),i=!0)},o(l){g(s,l),i=!1},d(l){l&&h(e),s&&s.d(l)}}}function mo(t,e,r){let{$$slots:n={},$$scope:i}=e,{dark:o=!1}=e;return t.$$set=s=>{"dark"in s&&r(0,o=s.dark),"$$scope"in s&&r(1,i=s.$$scope)},[o,i,n]}class po extends L{constructor(e){super(),S(this,e,mo,go,B,{dark:0},fo)}}function ho(t){let e;const r=t[1].default,n=x(r,t,t[2],null);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&4)&&J(n,r,i,i[2],e?q(r,i[2],o,null):te(i[2]),null)},i(i){e||(f(n,i),e=!0)},o(i){g(n,i),e=!1},d(i){n&&n.d(i)}}}function _o(t){let e,r;return e=new uo({props:{$$slots:{default:[Ao]},$$scope:{ctx:t}}}),{c(){k(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&4&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){w(e,n)}}}function Ao(t){let e;const r=t[1].default,n=x(r,t,t[2],null);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&4)&&J(n,r,i,i[2],e?q(r,i[2],o,null):te(i[2]),null)},i(i){e||(f(n,i),e=!0)},o(i){g(n,i),e=!1},d(i){n&&n.d(i)}}}function bo(t){let e,r,n,i;const o=[_o,ho],s=[];function l(c,a){return c[0]?0:1}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=ce()},m(c,a){s[e].m(c,a),_(c,n,a),i=!0},p(c,[a]){let u=e;e=l(c),e===u?s[e].p(c,a):(W(),g(s[u],1,1,()=>{s[u]=null}),z(),r=s[e],r?r.p(c,a):(r=s[e]=o[e](c),r.c()),f(r,1),r.m(n.parentNode,n))},i(c){i||(f(r),i=!0)},o(c){g(r),i=!1},d(c){c&&h(n),s[e].d(c)}}}function Eo(t,e,r){let{$$slots:n={},$$scope:i}=e,{condition:o=!1}=e;return t.$$set=s=>{"condition"in s&&r(0,o=s.condition),"$$scope"in s&&r(2,i=s.$$scope)},[o,n,i]}class Io extends L{constructor(e){super(),S(this,e,Eo,bo,B,{condition:0})}}const wo=t=>({}),St=t=>({});function yo(t){let e,r;const n=t[1].header,i=x(n,t,t[2],St),o=t[1].default,s=x(o,t,t[2],null);return{c(){i&&i.c(),e=O(),s&&s.c()},m(l,c){i&&i.m(l,c),_(l,e,c),s&&s.m(l,c),r=!0},p(l,c){i&&i.p&&(!r||c&4)&&J(i,n,l,l[2],r?q(n,l[2],c,wo):te(l[2]),St),s&&s.p&&(!r||c&4)&&J(s,o,l,l[2],r?q(o,l[2],c,null):te(l[2]),null)},i(l){r||(f(i,l),f(s,l),r=!0)},o(l){g(i,l),g(s,l),r=!1},d(l){l&&h(e),i&&i.d(l),s&&s.d(l)}}}function ko(t){let e,r;return e=new po({props:{dark:t[0],$$slots:{default:[yo]},$$scope:{ctx:t}}}),{c(){k(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const o={};i&1&&(o.dark=n[0]),i&4&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){w(e,n)}}}function vo(t,e,r){let{$$slots:n={},$$scope:i}=e,{dark:o=!1}=e;return t.$$set=s=>{"dark"in s&&r(0,o=s.dark),"$$scope"in s&&r(2,i=s.$$scope)},[o,n,i]}class Lt extends L{constructor(e){super(),S(this,e,vo,ko,B,{dark:0})}}const $o="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20opacity='0.5'%20clip-path='url(%23clip0_344_3390)'%3e%3cpath%20d='M7%2018C5.9%2018%205.01%2018.9%205.01%2020C5.01%2021.1%205.9%2022%207%2022C8.1%2022%209%2021.1%209%2020C9%2018.9%208.1%2018%207%2018ZM1%202V4H3L6.6%2011.59L5.25%2014.04C5.09%2014.32%205%2014.65%205%2015C5%2016.1%205.9%2017%207%2017H19V15H7.42C7.28%2015%207.17%2014.89%207.17%2014.75L7.2%2014.63L8.1%2013H15.55C16.3%2013%2016.96%2012.59%2017.3%2011.97L20.88%205.48C20.96%205.34%2021%205.17%2021%205C21%204.45%2020.55%204%2020%204H5.21L4.27%202H1ZM17%2018C15.9%2018%2015.01%2018.9%2015.01%2020C15.01%2021.1%2015.9%2022%2017%2022C18.1%2022%2019%2021.1%2019%2020C19%2018.9%2018.1%2018%2017%2018Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_344_3390'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";function Bo(t){let e,r;return{c(){e=y("img"),ee(e.src,r=$o)||A(e,"src",r),A(e,"alt","icon"),A(e,"class","rcb-ui-asset-icon")},m(n,i){_(n,e,i)},p:m,i:m,o:m,d(n){n&&h(e)}}}class Do extends L{constructor(e){super(),S(this,e,null,Bo,B,{})}}function Po(t){T(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 Co(t){let e;return{c(){e=y("div"),e.textContent="Sandbox",A(e,"class","svelte-1rhrjxe")},m(r,n){_(r,e,n)},p:m,i:m,o:m,d(r){r&&h(e)}}}class Mo extends L{constructor(e){super(),S(this,e,null,Co,B,{},Po)}}function To(t){T(t,"svelte-17btec4",`.rcb-ui-container.svelte-17btec4{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-17btec4{width:100vw;width:100 dvw;margin-right:auto;display:flex;justify-content:center;align-items:flex-start;position:relative;padding:0px 80px;box-sizing:border-box}.rcb-ui-aside.svelte-17btec4{margin-right:16px;flex:320px 1 0;max-width:480px}.rcb-ui-main.svelte-17btec4{flex:480px 1 0;max-width:640px}@media screen and (max-width: 960px){.rcb-ui-layout.svelte-17btec4{flex-direction:column;align-items:center;justify-content:center;height:100%;min-width:100%}.rcb-ui-aside.svelte-17btec4{margin-right:0;margin-bottom:16px;min-width:100%;display:flex;flex-direction:column;align-items:center;flex:none;max-width:none}.rcb-ui-main.svelte-17btec4{flex:none;max-width:none;min-width:100%}}@media screen and (max-width: 960px) and (max-height: 960px){.rcb-ui-layout.svelte-17btec4{overflow-y:scroll;justify-content:flex-start;padding:16px 0px}}`)}function Ft(t){let e,r,n;return r=new Lt({props:{dark:!0,$$slots:{header:[Oo],default:[Ro]},$$scope:{ctx:t}}}),{c(){e=y("div"),k(r.$$.fragment),A(e,"class","rcb-ui-aside svelte-17btec4")},m(i,o){_(i,e,o),I(r,e,null),n=!0},p(i,o){const s={};o&33554446&&(s.$$scope={dirty:o,ctx:i}),r.$set(s)},i(i){n||(f(r.$$.fragment,i),n=!0)},o(i){g(r.$$.fragment,i),n=!1},d(i){i&&h(e),w(r)}}}function xt(t){let e,r;return e=new It({props:{productDetails:t[3],purchaseOption:t[8]}}),{c(){k(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&8&&(o.productDetails=n[3]),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){w(e,n)}}}function Ro(t){let e,r,n=t[3]&&t[8]&&xt(t);return{c(){n&&n.c(),e=ce()},m(i,o){n&&n.m(i,o),_(i,e,o),r=!0},p(i,o){i[3]&&i[8]?n?(n.p(i,o),o&8&&f(n,1)):(n=xt(i),n.c(),f(n,1),n.m(e.parentNode,e)):n&&(W(),g(n,1,1,()=>{n=null}),z())},i(i){r||(f(n),r=!0)},o(i){g(n),r=!1},d(i){i&&h(e),n&&n.d(i)}}}function Qo(t){let e,r;return e=new Do({}),{c(){k(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){w(e,n)}}}function No(t){let e,r;return e=new Mo({}),{c(){k(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){w(e,n)}}}function Uo(t){let e,r,n,i,o,s,l;e=new $t({props:{brandingInfo:t[1]}});const c=[No,Qo],a=[];function u(d,b){return b&4&&(n=null),n==null&&(n=!!d[2].isSandbox()),n?0:1}return i=u(t,-1),o=a[i]=c[i](t),{c(){k(e.$$.fragment),r=O(),o.c(),s=ce()},m(d,b){I(e,d,b),_(d,r,b),a[i].m(d,b),_(d,s,b),l=!0},p(d,b){const $={};b&2&&($.brandingInfo=d[1]),e.$set($);let D=i;i=u(d,b),i!==D&&(W(),g(a[D],1,1,()=>{a[D]=null}),z(),o=a[i],o||(o=a[i]=c[i](d),o.c()),f(o,1),o.m(s.parentNode,s))},i(d){l||(f(e.$$.fragment,d),f(o),l=!0)},o(d){g(e.$$.fragment,d),g(o),l=!1},d(d){d&&(h(r),h(s)),w(e,d),a[i].d(d)}}}function Oo(t){let e,r;return e=new ot({props:{slot:"header",$$slots:{default:[Uo]},$$scope:{ctx:t}}}),{c(){k(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&33554438&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){w(e,n)}}}function Gt(t){let e,r;return e=new It({props:{productDetails:t[3],purchaseOption:t[8]}}),{c(){k(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&8&&(o.productDetails=n[3]),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){w(e,n)}}}function Yt(t){let e,r;return e=new rt({}),{c(){k(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){w(e,n)}}}function Ht(t){let e,r;return e=new so({props:{onContinue:t[11],onClose:t[10],processing:t[6]==="processing-auth-info",lastError:t[5]}}),{c(){k(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&64&&(o.processing=n[6]==="processing-auth-info"),i&32&&(o.lastError=n[5]),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){w(e,n)}}}function Kt(t){let e,r;return e=new ji({props:{paymentInfoCollectionMetadata:t[4],onContinue:t[11],onClose:t[10],onError:t[12],processing:t[6]==="polling-purchase-status",productDetails:t[3],purchaseOptionToUse:t[8]}}),{c(){k(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&16&&(o.paymentInfoCollectionMetadata=n[4]),i&64&&(o.processing=n[6]==="polling-purchase-status"),i&8&&(o.productDetails=n[3]),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){w(e,n)}}}function jt(t){let e,r;return e=new rt({}),{c(){k(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){w(e,n)}}}function qt(t){var n;let e,r;return e=new Vr({props:{brandingInfo:t[1],lastError:t[5]??new Z(re.UnknownError,"Unknown error without state set."),supportEmail:(n=t[1])==null?void 0:n.seller_company_support_email,onContinue:t[13]}}),{c(){k(e.$$.fragment)},m(i,o){I(e,i,o),r=!0},p(i,o){var l;const s={};o&2&&(s.brandingInfo=i[1]),o&32&&(s.lastError=i[5]??new Z(re.UnknownError,"Unknown error without state set.")),o&2&&(s.supportEmail=(l=i[1])==null?void 0:l.seller_company_support_email),e.$set(s)},i(i){r||(f(e.$$.fragment,i),r=!0)},o(i){g(e.$$.fragment,i),r=!1},d(i){w(e,i)}}}function Jt(t){let e,r;return e=new ii({props:{brandingInfo:t[1],onContinue:t[11]}}),{c(){k(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&2&&(o.brandingInfo=n[1]),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){w(e,n)}}}function So(t){let e,r,n,i,o,s,l,c,a=t[6]==="present-offer"&&t[3]&&t[8]&&Gt(t),u=t[6]==="present-offer"&&!t[3]&&Yt(),d=(t[6]==="needs-auth-info"||t[6]==="processing-auth-info")&&Ht(t),b=t[4]&&(t[6]==="needs-payment-info"||t[6]==="polling-purchase-status")&&t[3]&&t[8]&&Kt(t),$=t[6]==="loading"&&jt(),D=t[6]==="error"&&qt(t),R=t[6]==="success"&&Jt(t);return{c(){a&&a.c(),e=O(),u&&u.c(),r=O(),d&&d.c(),n=O(),b&&b.c(),i=O(),$&&$.c(),o=O(),D&&D.c(),s=O(),R&&R.c(),l=ce()},m(p,v){a&&a.m(p,v),_(p,e,v),u&&u.m(p,v),_(p,r,v),d&&d.m(p,v),_(p,n,v),b&&b.m(p,v),_(p,i,v),$&&$.m(p,v),_(p,o,v),D&&D.m(p,v),_(p,s,v),R&&R.m(p,v),_(p,l,v),c=!0},p(p,v){p[6]==="present-offer"&&p[3]&&p[8]?a?(a.p(p,v),v&72&&f(a,1)):(a=Gt(p),a.c(),f(a,1),a.m(e.parentNode,e)):a&&(W(),g(a,1,1,()=>{a=null}),z()),p[6]==="present-offer"&&!p[3]?u?v&72&&f(u,1):(u=Yt(),u.c(),f(u,1),u.m(r.parentNode,r)):u&&(W(),g(u,1,1,()=>{u=null}),z()),p[6]==="needs-auth-info"||p[6]==="processing-auth-info"?d?(d.p(p,v),v&64&&f(d,1)):(d=Ht(p),d.c(),f(d,1),d.m(n.parentNode,n)):d&&(W(),g(d,1,1,()=>{d=null}),z()),p[4]&&(p[6]==="needs-payment-info"||p[6]==="polling-purchase-status")&&p[3]&&p[8]?b?(b.p(p,v),v&88&&f(b,1)):(b=Kt(p),b.c(),f(b,1),b.m(i.parentNode,i)):b&&(W(),g(b,1,1,()=>{b=null}),z()),p[6]==="loading"?$?v&64&&f($,1):($=jt(),$.c(),f($,1),$.m(o.parentNode,o)):$&&(W(),g($,1,1,()=>{$=null}),z()),p[6]==="error"?D?(D.p(p,v),v&64&&f(D,1)):(D=qt(p),D.c(),f(D,1),D.m(s.parentNode,s)):D&&(W(),g(D,1,1,()=>{D=null}),z()),p[6]==="success"?R?(R.p(p,v),v&64&&f(R,1)):(R=Jt(p),R.c(),f(R,1),R.m(l.parentNode,l)):R&&(W(),g(R,1,1,()=>{R=null}),z())},i(p){c||(f(a),f(u),f(d),f(b),f($),f(D),f(R),c=!0)},o(p){g(a),g(u),g(d),g(b),g($),g(D),g(R),c=!1},d(p){p&&(h(e),h(r),h(n),h(i),h(o),h(s),h(l)),a&&a.d(p),u&&u.d(p),d&&d.d(p),b&&b.d(p),$&&$.d(p),D&&D.d(p),R&&R.d(p)}}}function Lo(t){let e,r=t[9].includes(t[6]),n,i,o,s,l=r&&Ft(t);return o=new Lt({props:{$$slots:{default:[So]},$$scope:{ctx:t}}}),{c(){e=y("div"),l&&l.c(),n=O(),i=y("div"),k(o.$$.fragment),A(i,"class","rcb-ui-main svelte-17btec4"),A(e,"class","rcb-ui-layout svelte-17btec4"),A(e,"style",t[7])},m(c,a){_(c,e,a),l&&l.m(e,null),P(e,n),P(e,i),I(o,i,null),s=!0},p(c,a){a&64&&(r=c[9].includes(c[6])),r?l?(l.p(c,a),a&64&&f(l,1)):(l=Ft(c),l.c(),f(l,1),l.m(e,n)):l&&(W(),g(l,1,1,()=>{l=null}),z());const u={};a&33554554&&(u.$$scope={dirty:a,ctx:c}),o.$set(u)},i(c){s||(f(l),f(o.$$.fragment,c),s=!0)},o(c){g(l),g(o.$$.fragment,c),s=!1},d(c){c&&h(e),l&&l.d(),w(o)}}}function Fo(t){let e,r,n;return r=new Io({props:{condition:t[0],$$slots:{default:[Lo]},$$scope:{ctx:t}}}),{c(){e=y("div"),k(r.$$.fragment),A(e,"class","rcb-ui-container svelte-17btec4")},m(i,o){_(i,e,o),I(r,e,null),n=!0},p(i,[o]){const s={};o&1&&(s.condition=i[0]),o&33554558&&(s.$$scope={dirty:o,ctx:i}),r.$set(s)},i(i){n||(f(r.$$.fragment,i),n=!0)},o(i){g(r.$$.fragment,i),n=!1},d(i){i&&h(e),w(r)}}}function xo(t,e,r){let{asModal:n=!0}=e,{customerEmail:i}=e,{appUserId:o}=e,{rcPackage:s}=e,{purchaseOption:l}=e,{brandingInfo:c}=e,{onFinished:a}=e,{onError:u}=e,{onClose:d}=e,{purchases:b}=e,{purchaseOperationHelper:$}=e;const D=Object.entries(Qe).map(([C,ft])=>`--rc-color-${C}: ${ft}`).join("; ");let R=null,p=null,v=null;const G=s.rcBillingProduct.identifier??null,U=s.rcBillingProduct.defaultPurchaseOption,Ne=l||U;let Q="present-offer";const ue=["present-offer","needs-auth-info","processing-auth-info","needs-payment-info","polling-purchase-status","loading"];Fe(async()=>{if(r(3,R=s.rcBillingProduct),Q==="present-offer"){i?Ue():r(6,Q="needs-auth-info");return}});const We=()=>{d()},Ue=()=>{if(G===null){Oe(new Z(re.ErrorSettingUpPurchase,"Product ID was not set before purchase."));return}else Q==="present-offer"&&r(6,Q="loading");if(!i){Oe(new Z(re.MissingEmailError));return}$.startPurchase(o,G,Ne,i,s.rcBillingProduct.presentedOfferingContext).then(C=>{if(C.next_action==="collect_payment_info"){r(5,v=null),r(6,Q="needs-payment-info"),r(4,p=C);return}if(C.next_action==="completed"){r(5,v=null),r(6,Q="success");return}}).catch(C=>{Oe(C)})},Bs=C=>{if(Q==="needs-auth-info"){C&&(r(14,i=C.email),r(6,Q="processing-auth-info")),Ue();return}if(Q==="needs-payment-info"){r(6,Q="polling-purchase-status"),$.pollCurrentPurchaseForCompletion().then(()=>{r(6,Q="success")}).catch(ft=>{Oe(ft)});return}if(Q==="success"||Q==="error"){a();return}r(6,Q="success")},Oe=C=>{if(Q==="processing-auth-info"&&C.isRecoverable()){r(5,v=C),r(6,Q="needs-auth-info");return}r(5,v=C),r(6,Q="error")},Ds=()=>{u(v??new Z(re.UnknownError,"Unknown error without state set."))};return t.$$set=C=>{"asModal"in C&&r(0,n=C.asModal),"customerEmail"in C&&r(14,i=C.customerEmail),"appUserId"in C&&r(15,o=C.appUserId),"rcPackage"in C&&r(16,s=C.rcPackage),"purchaseOption"in C&&r(17,l=C.purchaseOption),"brandingInfo"in C&&r(1,c=C.brandingInfo),"onFinished"in C&&r(18,a=C.onFinished),"onError"in C&&r(19,u=C.onError),"onClose"in C&&r(20,d=C.onClose),"purchases"in C&&r(2,b=C.purchases),"purchaseOperationHelper"in C&&r(21,$=C.purchaseOperationHelper)},[n,c,b,R,p,v,Q,D,Ne,ue,We,Bs,Oe,Ds,i,o,s,l,a,u,d,$]}class Go extends L{constructor(e){super(),S(this,e,xo,Fo,B,{asModal:0,customerEmail:14,appUserId:15,rcPackage:16,purchaseOption:17,brandingInfo:1,onFinished:18,onError:19,onClose:20,purchases:2,purchaseOperationHelper:21},To)}}function Yo(t){return t.expires_date==null?!0:new Date(t.expires_date)>new Date}function Ho(t,e,r,n){const i=e.product_identifier;if(i in r)return Ko(t,e,r[i]);if(i in n)return jo(t,e,n[i]);throw new X(ne.CustomerInfoError,"Could not find entitlement product in subscriptions or non-subscriptions.")}function Ko(t,e,r){return{identifier:t,isActive:Yo(e),willRenew:Vo(e,r),store:(r==null?void 0:r.store)??"unknown",latestPurchaseDate:new Date(e.purchase_date),originalPurchaseDate:new Date(e.purchase_date),expirationDate:qe(e.expires_date),productIdentifier:e.product_identifier,unsubscribeDetectedAt:qe(r==null?void 0:r.unsubscribe_detected_at),billingIssueDetectedAt:qe(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 jo(t,e,r){return{identifier:t,isActive:!0,willRenew:!1,store:r.store,latestPurchaseDate:new Date(e.purchase_date),originalPurchaseDate:new Date(r.original_purchase_date),expirationDate:null,productIdentifier:e.product_identifier,unsubscribeDetectedAt:null,billingIssueDetectedAt:null,isSandbox:r.is_sandbox,periodType:"normal"}}function qo(t,e,r){const n={},i={};for(const o in t){const s=Ho(o,t[o],e,r);n[o]=s,s.isActive&&(i[o]=s)}return{all:n,active:i}}function qe(t){return t==null?null:new Date(t)}function Jo(t){const e=zo(t),r=t.subscriber,n=Zo(r.non_subscriptions);return{entitlements:qo(r.entitlements,r.subscriptions,n),allExpirationDatesByProduct:e,allPurchaseDatesByProduct:Wo(t,n),activeSubscriptions:Xo(e),managementURL:r.management_url,requestDate:new Date(t.request_date),firstSeenDate:new Date(r.first_seen),originalPurchaseDate:qe(r.original_purchase_date),originalAppUserId:t.subscriber.original_app_user_id}}function Vo(t,e){if(e==null)return!1;const r=e.store=="promotional",n=t.expires_date==null,i=e.unsubscribe_detected_at!=null,o=e.billing_issues_detected_at!=null;return!(r||n||i||o)}function Wo(t,e){const r={};for(const n in t.subscriber.subscriptions){const i=t.subscriber.subscriptions[n];r[n]=new Date(i.purchase_date)}for(const n in e){const i=e[n].purchase_date;i==null?r[n]=null:r[n]=new Date(i)}return r}function zo(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 Xo(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 Zo(t){const e={};for(const r in t){if(t[r].length===0)continue;const n=t[r].length;e[r]=t[r][n-1]}return e}const es="0.8.0",ts="https://api.revenuecat.com";var Je;(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"})(Je||(Je={}));function st(t){return t?t.startsWith("rcb_sb_"):!1}async function Ie(t,e){const{apiKey:r,body:n,headers:i,httpConfig:o}=e,l=`${(o==null?void 0:o.proxyURL)??ts}${t.urlPath()}`;try{const c=await fetch(l,{method:t.method,headers:os(r,i,o==null?void 0:o.additionalHeaders),body:rs(n)});return await ns(c,t),await c.json()}catch(c){throw c instanceof TypeError?new X(ne.NetworkError,De.getPublicMessage(ne.NetworkError),c.message):c}}async function ns(t,e){const r=t.status;if(r>=Je.INTERNAL_SERVER_ERROR)lt(e,r,await t.text());else if(r>=Je.BAD_REQUEST){const n=await t.json(),i=n?JSON.stringify(n):null,o=n==null?void 0:n.code,s=n==null?void 0:n.message;if(o!=null){const l=De.convertCodeToBackendErrorCode(o);if(l==null)lt(e,r,i,o);else throw X.getForBackendError(l,s)}else lt(e,r,i)}}function lt(t,e,r,n){throw new X(ne.UnknownBackendError,"Unknown backend error.",`Request: ${t.name}. Status code: ${e}. Body: ${r}.`,{backendErrorCode:n})}function rs(t){return t==null?null:JSON.stringify(t)}const Vt="Authorization",Wt="Content-Type",zt="Accept",Xt="X-Platform",Zt="X-Version",en="X-Is-Sandbox",is=new Set([Vt,Wt,zt,Xt,Zt,en]);function os(t,e,r){let n={[Vt]:`Bearer ${t}`,[Wt]:"application/json",[zt]:"application/json",[Xt]:"web",[Zt]:es,[en]:`${st(t)}`};return e&&(n={...n,...e}),r&&(n={...r,...n}),n}const tn="/v1/subscribers",Ve="/rcbilling/v1";class ss{constructor(e){M(this,"appUserId");M(this,"method","GET");M(this,"name","getOfferings");this.appUserId=e}urlPath(){const e=encodeURIComponent(this.appUserId);return`${tn}/${e}/offerings`}}class ls{constructor(){M(this,"method","POST");M(this,"name","subscribe")}urlPath(){return`${Ve}/subscribe`}}class cs{constructor(e,r,n){M(this,"method","GET");M(this,"name","getProducts");M(this,"appUserId");M(this,"productIds");M(this,"currency");this.appUserId=e,this.productIds=r,this.currency=n}urlPath(){const e=encodeURIComponent(this.appUserId),r=this.productIds.map(encodeURIComponent).join("&id="),n=this.currency?`¤cy=${this.currency}`:"";return`${Ve}/subscribers/${e}/products?id=${r}${n}`}}class as{constructor(e){M(this,"method","GET");M(this,"name","getCustomerInfo");M(this,"appUserId");this.appUserId=e}urlPath(){const e=encodeURIComponent(this.appUserId);return`${tn}/${e}`}}class us{constructor(){M(this,"method","GET");M(this,"name","getBrandingInfo")}urlPath(){return`${Ve}/branding`}}class fs{constructor(e){M(this,"method","GET");M(this,"name","getCheckoutStatus");M(this,"operationSessionId");this.operationSessionId=e}urlPath(){return`${Ve}/checkout/${this.operationSessionId}`}}const ct={};class ds{constructor(e,r=ct){M(this,"API_KEY");M(this,"httpConfig");this.API_KEY=e,this.httpConfig=r}async getOfferings(e){return await Ie(new ss(e),{apiKey:this.API_KEY,httpConfig:this.httpConfig})}async getCustomerInfo(e){return await Ie(new as(e),{apiKey:this.API_KEY,httpConfig:this.httpConfig})}async getProducts(e,r,n){return await Ie(new cs(e,r,n),{apiKey:this.API_KEY,httpConfig:this.httpConfig})}async getBrandingInfo(){return await Ie(new us,{apiKey:this.API_KEY,httpConfig:this.httpConfig})}async postSubscribe(e,r,n,i,o){const s={app_user_id:e,product_id:r,email:n,price_id:o.priceId,presented_offering_identifier:i.offeringIdentifier};return o.id!=="base_option"&&(s.offer_id=o.id),i.targetingContext&&(s.applied_targeting_rule={rule_id:i.targetingContext.ruleId,revision:i.targetingContext.revision}),i.placementIdentifier&&(s.presented_placement_identifier=i.placementIdentifier),await Ie(new ls,{apiKey:this.API_KEY,body:s,httpConfig:this.httpConfig})}async getCheckoutStatus(e){return await Ie(new fs(e),{apiKey:this.API_KEY,httpConfig:this.httpConfig})}}function gs(t){if(!/^rcb_[a-zA-Z0-9_.-]+$/.test(t))throw new X(ne.InvalidCredentialsError,"Invalid API key. Use your RevenueCat Billing API key.")}function ms(t){if(new Set(["no_user","null","none","nil","(null)","NaN","\\x00","","unidentified","undefined","unknown"]).has(t)||t.includes("/"))throw new X(ne.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.')}function ps(t){if(t!=null&&t.endsWith("/"))throw new X(ne.ConfigurationError,"Invalid proxy URL. The proxy URL should not end with a trailing slash.")}function hs(t){if(t){for(const e in t)if(is.has(e))throw new X(ne.ConfigurationError,"Invalid additional headers. Some headers are reserved for internal use.")}}function _s(t,e){async function r(...n){return await this.preload(),await t.call(this,...n)}return r}function As(t){return t!=null}var nn=(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))(nn||{});const bs=t=>({amount:t.amount_micros/1e4,amountMicros:t.amount_micros,currency:t.currency,formattedPrice:Ln(t.amount_micros,t.currency)}),rn=t=>{const e=t.period_duration;return{periodDuration:e,period:e?nt(e):null,cycleCount:t.cycle_count,price:t.price?bs(t.price):null}},Es=t=>t.base==null?(K.debugLog("Missing base phase for subscription option. Ignoring."),null):{id:t.id,priceId:t.price_id,base:rn(t.base),trial:t.trial?rn(t.trial):null},Is=(t,e)=>{const r={};if(Object.entries(t.subscription_options).forEach(([s,l])=>{const c=Es(l);c!=null&&(r[s]=c)}),Object.keys(r).length===0)return K.debugLog(`Product ${t.identifier} has no subscription options. Ignoring.`),null;const n=t.default_subscription_option_id,i=n&&n in r?r[n]:null;if(i==null)return K.debugLog(`Product ${t.identifier} has no default subscription option. Ignoring.`),null;const o=i.base.price;return o==null?(K.debugLog(`Product ${t.identifier} default option has no base price. Ignoring.`),null):{identifier:t.identifier,displayName:t.title,title:t.title,description:t.description,currentPrice:o,normalPeriodDuration:i.base.periodDuration,presentedOfferingIdentifier:e.offeringIdentifier,presentedOfferingContext:e,defaultPurchaseOption:i,defaultSubscriptionOption:i,subscriptionOptions:r}},ws=(t,e,r)=>{const n=r[e.platform_product_identifier];if(n===void 0)return null;const i=Is(n,t);return i===null?null:{identifier:e.identifier,rcBillingProduct:i,packageType:ks(e.identifier)}},ys=(t,e,r,n)=>{const i={offeringIdentifier:e.identifier,targetingContext:t&&n?{ruleId:n.rule_id,revision:n.revision}:null,placementIdentifier:null},o=e.packages.map(l=>ws(i,l,r)).filter(As),s={};for(const l of o)l!=null&&(s[l.identifier]=l);return o.length==0?null:{identifier:e.identifier,serverDescription:e.description,metadata:e.metadata,packagesById:s,availablePackages:o,lifetime:s.$rc_lifetime??null,annual:s.$rc_annual??null,sixMonth:s.$rc_six_month??null,threeMonth:s.$rc_three_month??null,twoMonth:s.$rc_two_month??null,monthly:s.$rc_monthly??null,weekly:s.$rc_weekly??null}};function ks(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"}}const on=(t,e)=>({...t,rcBillingProduct:{...t.rcBillingProduct,presentedOfferingContext:{...t.rcBillingProduct.presentedOfferingContext,placementIdentifier:e}}}),me=(t,e)=>t==null?null:on(t,e),vs=(t,e,r)=>{const n=t.offering_ids_by_placement??null;if(n==null)return null;const i=t.fallback_offering_id??null;let o;if(r in n){const l=n[r]??null;if(l==null)return null;o=e[l],o==null&&(o=e[i])}else o=e[i];if(o==null)return null;const s=Object.fromEntries(Object.entries(o.packagesById).map(([l,c])=>[l,on(c,r)]));return{...o,packagesById:s,availablePackages:Object.values(s),weekly:me(o.weekly,r),monthly:me(o.monthly,r),twoMonth:me(o.twoMonth,r),threeMonth:me(o.threeMonth,r),sixMonth:me(o.sixMonth,r),annual:me(o.annual,r),lifetime:me(o.lifetime,r)}};function $s(t,e){const r={};e.product_details.forEach(o=>{r[o.identifier]=o});const n={};t.offerings.forEach(o=>{const s=o.identifier===t.current_offering_id,l=ys(s,o,r,t.targeting);l!=null&&(n[o.identifier]=l)});const i=t.current_offering_id?n[t.current_offering_id]??null:null;return Object.keys(n).length==0&&K.debugLog("Empty offerings. Please make sure you've configured offerings correctly in the RevenueCat dashboard and that the products are properly configured."),{all:n,current:i}}sn=[_s];const le=class le{constructor(e,r,n=ct){mn(ut,5,this);M(this,"_API_KEY");M(this,"_appUserId");M(this,"_brandingInfo",null);M(this,"_loadingResourcesPromise",null);M(this,"backend");M(this,"purchaseOperationHelper");this._API_KEY=e,this._appUserId=r,st(e)&&K.debugLog("Initializing Purchases SDK with sandbox API Key"),this.backend=new ds(this._API_KEY,n),this.purchaseOperationHelper=new tr(this.backend)}static setLogLevel(e){K.setLogLevel(e)}static getSharedInstance(){if(le.isConfigured())return le.instance;throw new yt}static isConfigured(){return le.instance!==void 0}static configure(e,r,n=ct){return le.instance!==void 0&&K.warnLog("Purchases is already initialized. You normally should only configure Purchases once. Creating and returning new instance."),gs(e),ms(r),ps(n.proxyURL),hs(n.additionalHeaders),le.instance=new le(e,r,n),le.getSharedInstance()}async preload(){if(this.hasLoadedResources()){K.verboseLog("Purchases resources are loaded. Skipping.");return}if(this._loadingResourcesPromise!==null){K.verboseLog("Purchases resources are loading. Waiting."),await this._loadingResourcesPromise;return}return this._loadingResourcesPromise=this.backend.getBrandingInfo().then(e=>{this._brandingInfo=e}).catch(e=>{let r=`${e}`;e instanceof X&&(r=`${e.message}. ${e.underlyingErrorMessage?`Underlying error: ${e.underlyingErrorMessage}`:""}`),K.errorLog(`Error fetching branding info: ${r}`)}).finally(()=>{this._loadingResourcesPromise=null}),this._loadingResourcesPromise}hasLoadedResources(){return this._brandingInfo!==null}async getOfferings(e){Ji(e==null?void 0:e.currency);const r=this._appUserId,n=await this.backend.getOfferings(r);return await this.getAllOfferings(n,r,e)}async getCurrentOfferingForPlacement(e,r){const n=this._appUserId,i=await this.backend.getOfferings(n),o=await this.getAllOfferings(i,n,r),s=i.placements??null;return s==null?null:vs(s,o.all,e)}async getAllOfferings(e,r,n){const i=e.offerings.flatMap(s=>s.packages).map(s=>s.platform_product_identifier),o=await this.backend.getProducts(r,i,n==null?void 0:n.currency);return this.logMissingProductIds(i,o.product_details),$s(e,o)}async isEntitledTo(e){const r=await this.getCustomerInfo();return e in r.entitlements.active}purchasePackage(e,r,n){return this.purchase({rcPackage:e,customerEmail:r,htmlTarget:n})}purchase(e){const{rcPackage:r,purchaseOption:n,htmlTarget:i,customerEmail:o}=e;let s=i??document.getElementById("rcb-ui-root");if(s===null){const u=document.createElement("div");u.className="rcb-ui-root",document.body.appendChild(u),s=u}if(s===null)throw new Error("Could not generate a mount point for the billing widget");const l=s,c=!i,a=this._appUserId;return K.debugLog(`Presenting purchase form for package ${r.identifier}`),new Promise((u,d)=>{new Go({target:l,props:{appUserId:a,rcPackage:r,purchaseOption:n,customerEmail:o,onFinished:async()=>{K.debugLog("Purchase finished"),l.innerHTML="",u({customerInfo:await this._getCustomerInfoForUserId(a)})},onClose:()=>{l.innerHTML="",K.debugLog("Purchase cancelled by user"),d(new X(ne.UserCancelledError))},onError:b=>{l.innerHTML="",d(X.getForPurchasesFlowError(b))},purchases:this,brandingInfo:this._brandingInfo,purchaseOperationHelper:this.purchaseOperationHelper,asModal:c}})})}async getCustomerInfo(){return await this._getCustomerInfoForUserId(this._appUserId)}getAppUserId(){return this._appUserId}async changeUser(e){return this._appUserId=e,await this.getCustomerInfo()}logMissingProductIds(e,r){const n={};r.forEach(o=>n[o.identifier]=o);const i=[];e.forEach(o=>{n[o]===void 0&&i.push(o)}),i.length>0&&K.debugLog(`Could not find product data for product ids:
|
|
8
|
-
${i.join()}.
|
|
9
|
-
Please check that your product configuration is correct.`)}isSandbox(){return st(this._API_KEY)}close(){
|
|
14
|
+
-20px 0 #fff2;background:#fff2}}`)}function to(t){let e;return{c(){e=w("div"),b(e,"class","processing svelte-rjmul6")},m(r,n){_(r,e,n)},p,i:p,o:p,d(r){r&&h(e)}}}class Yt extends U{constructor(e){super(),Q(this,e,null,to,B,{},eo)}}function no(t){x(t,"svelte-1wxt892",".rcb-stripe-elements-container.svelte-1wxt892{width:100%;margin-top:32px;margin-bottom:24px}")}function ro(t){let e,r;return e=new rt({}),{c(){v(e.$$.fragment)},m(n,i){y(e,n,i),r=!0},p,i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){k(e,n)}}}function io(t){let e,r,n,i,o,s;function l(a){t[11](a)}let c={stripe:t[5],clientSecret:t[6],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:[po]},$$scope:{ctx:t}};return t[4]!==void 0&&(c.elements=t[4]),r=new Ni({props:c}),Ye.push(()=>Fn(r,"elements",l)),{c(){e=w("form"),v(r.$$.fragment)},m(a,u){_(a,e,u),y(r,e,null),i=!0,o||(s=Be(e,"submit",pt(t[7])),o=!0)},p(a,u){const f={};u&32&&(f.stripe=a[5]),u&8207&&(f.$$scope={dirty:u,ctx:a}),!n&&u&16&&(n=!0,f.elements=a[4],Nn(()=>n=!1)),r.$set(f)},i(a){i||(d(r.$$.fragment,a),i=!0)},o(a){g(r.$$.fragment,a),i=!1},d(a){a&&h(e),k(r),o=!1,s()}}}function oo(t){let e,r,n,i;return n=new Zi({}),{c(){e=w("div"),e.textContent="Secure Checkout",r=O(),v(n.$$.fragment)},m(o,s){_(o,e,s),_(o,r,s),y(n,o,s),i=!0},p,i(o){i||(d(n.$$.fragment,o),i=!0)},o(o){g(n.$$.fragment,o),i=!1},d(o){o&&(h(e),h(r)),k(n,o)}}}function so(t){let e,r,n;return r=new Ri({}),{c(){e=w("div"),v(r.$$.fragment),b(e,"class","rcb-stripe-elements-container svelte-1wxt892")},m(i,o){_(i,e,o),y(r,e,null),n=!0},p,i(i){n||(d(r.$$.fragment,i),n=!0)},o(i){g(r.$$.fragment,i),n=!1},d(i){i&&h(e),k(r)}}}function lo(t){let e;return{c(){e=G("Pay")},m(r,n){_(r,e,n)},i:p,o:p,d(r){r&&h(e)}}}function co(t){let e;return{c(){e=G("Start Trial")},m(r,n){_(r,e,n)},i:p,o:p,d(r){r&&h(e)}}}function ao(t){let e,r;return e=new Yt({}),{c(){v(e.$$.fragment)},m(n,i){y(e,n,i),r=!0},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){k(e,n)}}}function uo(t){let e,r,n,i;const o=[ao,co,lo],s=[];function l(c,a){var u,f;return c[0]?0:(f=(u=c[2].subscriptionOptions)==null?void 0:u[c[3].id])!=null&&f.trial?1:2}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=ae()},m(c,a){s[e].m(c,a),_(c,n,a),i=!0},p(c,a){let u=e;e=l(c),e!==u&&(V(),g(s[u],1,1,()=>{s[u]=null}),W(),r=s[e],r||(r=s[e]=o[e](c),r.c()),d(r,1),r.m(n.parentNode,n))},i(c){i||(d(r),i=!0)},o(c){g(r),i=!1},d(c){c&&h(n),s[e].d(c)}}}function fo(t){let e;return{c(){e=G("Close")},m(r,n){_(r,e,n)},d(r){r&&h(e)}}}function go(t){let e,r,n,i;return e=new Re({props:{disabled:t[0],testId:"PayButton",$$slots:{default:[uo]},$$scope:{ctx:t}}}),n=new Re({props:{disabled:t[0],intent:"secondary",$$slots:{default:[fo]},$$scope:{ctx:t}}}),n.$on("click",function(){re(t[1])&&t[1].apply(this,arguments)}),{c(){v(e.$$.fragment),r=O(),v(n.$$.fragment)},m(o,s){y(e,o,s),_(o,r,s),y(n,o,s),i=!0},p(o,s){t=o;const l={};s&1&&(l.disabled=t[0]),s&8205&&(l.$$scope={dirty:s,ctx:t}),e.$set(l);const c={};s&1&&(c.disabled=t[0]),s&8192&&(c.$$scope={dirty:s,ctx:t}),n.$set(c)},i(o){i||(d(e.$$.fragment,o),d(n.$$.fragment,o),i=!0)},o(o){g(e.$$.fragment,o),g(n.$$.fragment,o),i=!1},d(o){o&&h(r),k(e,o),k(n,o)}}}function mo(t){let e,r;return e=new Qe({props:{$$slots:{default:[go]},$$scope:{ctx:t}}}),{c(){v(e.$$.fragment)},m(n,i){y(e,n,i),r=!0},p(n,i){const o={};i&8207&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){k(e,n)}}}function po(t){let e,r,n,i,o,s;return e=new ot({props:{$$slots:{default:[oo]},$$scope:{ctx:t}}}),n=new Ee({props:{$$slots:{default:[so]},$$scope:{ctx:t}}}),o=new it({props:{$$slots:{default:[mo]},$$scope:{ctx:t}}}),{c(){v(e.$$.fragment),r=O(),v(n.$$.fragment),i=O(),v(o.$$.fragment)},m(l,c){y(e,l,c),_(l,r,c),y(n,l,c),_(l,i,c),y(o,l,c),s=!0},p(l,c){const a={};c&8192&&(a.$$scope={dirty:c,ctx:l}),e.$set(a);const u={};c&8192&&(u.$$scope={dirty:c,ctx:l}),n.$set(u);const f={};c&8207&&(f.$$scope={dirty:c,ctx:l}),o.$set(f)},i(l){s||(d(e.$$.fragment,l),d(n.$$.fragment,l),d(o.$$.fragment,l),s=!0)},o(l){g(e.$$.fragment,l),g(n.$$.fragment,l),g(o.$$.fragment,l),s=!1},d(l){l&&(h(r),h(i)),k(e,l),k(n,l),k(o,l)}}}function ho(t){let e,r,n,i;const o=[io,ro],s=[];function l(c,a){return c[5]&&c[6]?0:1}return r=l(t),n=s[r]=o[r](t),{c(){e=w("div"),n.c()},m(c,a){_(c,e,a),s[r].m(e,null),i=!0},p(c,[a]){let u=r;r=l(c),r===u?s[r].p(c,a):(V(),g(s[u],1,1,()=>{s[u]=null}),W(),n=s[r],n?n.p(c,a):(n=s[r]=o[r](c),n.c()),d(n,1),n.m(e,null))},i(c){i||(d(n),i=!0)},o(c){g(n),i=!1},d(c){c&&h(e),s[r].d()}}}function _o(t,e,r){let{onClose:n}=e,{onContinue:i}=e,{onError:o}=e,{paymentInfoCollectionMetadata:s}=e,{processing:l=!1}=e,{productDetails:c}=e,{purchaseOptionToUse:a}=e;const u=s.data.client_secret;let f=null,A,I;Ge(async()=>{const m=s.data.publishable_api_key,$=s.data.stripe_account_id;if(!m||!$)throw new Error("Stripe publishable key or account ID not found");r(5,f=await Ki(m,{stripeAccount:$}))});const P=async()=>{if(l||!f||!I)return;r(0,l=!0);const m=await f.confirmSetup({elements:I,redirect:"if_required"});m.error?(r(0,l=!1),o(new X(ne.StripeError,m.error.message))):i()};function N(m){A=m,r(4,A)}return t.$$set=m=>{"onClose"in m&&r(1,n=m.onClose),"onContinue"in m&&r(8,i=m.onContinue),"onError"in m&&r(9,o=m.onError),"paymentInfoCollectionMetadata"in m&&r(10,s=m.paymentInfoCollectionMetadata),"processing"in m&&r(0,l=m.processing),"productDetails"in m&&r(2,c=m.productDetails),"purchaseOptionToUse"in m&&r(3,a=m.purchaseOptionToUse)},t.$$.update=()=>{t.$$.dirty&16&&A&&A._elements.length>0&&(I=A)},[l,n,c,a,A,f,u,P,i,o,s,N]}class Ao extends U{constructor(e){super(),Q(this,e,_o,ho,B,{onClose:1,onContinue:8,onError:9,paymentInfoCollectionMetadata:10,processing:0,productDetails:2,purchaseOptionToUse:3},no)}}function bo(t){return t.trim()===""?"You need to provide your email address to continue.":t.match(/^[^@]+@[^@]+\.[^@]+$/)?null:"Email is not valid. Please provide a valid email address."}function Eo(t){if(t&&!t.match(/^[A-Z]{3}$/)){const e=`Currency code ${t} is not valid. Please provide a valid ISO 4217 currency code.`;throw F.errorLog(e),new z(te.ConfigurationError,e)}}function Io(t){x(t,"svelte-1w7qs76","form.svelte-1w7qs76.svelte-1w7qs76{display:flex;flex-direction:column;min-height:100%;flex-grow:1}.form-container.svelte-1w7qs76.svelte-1w7qs76{display:flex;flex-direction:column;width:100%;margin-top:32px;margin-bottom:16px}.form-label.svelte-1w7qs76.svelte-1w7qs76{margin-top:8px;margin-bottom:8px;display:block;font-weight:500;line-height:22px}.form-input.error.svelte-1w7qs76 input.svelte-1w7qs76{border-color:var(--rc-color-error)}.form-error.svelte-1w7qs76.svelte-1w7qs76{margin-top:4px;font-size:16px;line-height:20px;min-height:40px;color:var(--rc-color-error)}input.svelte-1w7qs76.svelte-1w7qs76{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-1w7qs76.svelte-1w7qs76:focus{outline:none;border:2px solid var(--rc-color-focus)}")}function wo(t){let e;return{c(){e=G("Billing email address")},m(r,n){_(r,e,n)},d(r){r&&h(e)}}}function Ht(t){let e,r;return{c(){e=w("div"),r=G(t[2]),b(e,"class","form-error svelte-1w7qs76")},m(n,i){_(n,e,i),C(e,r)},p(n,i){i&4&&ge(r,n[2])},d(n){n&&h(e)}}}function yo(t){let e,r,n,i,o,s,l,c,a,u=t[2]&&Ht(t);return{c(){e=w("div"),r=w("div"),r.innerHTML='<label for="email">Email</label>',n=O(),i=w("div"),o=w("input"),l=O(),u&&u.c(),b(r,"class","form-label svelte-1w7qs76"),b(o,"name","email"),b(o,"placeholder","john@appleseed.com"),b(o,"autocapitalize","off"),b(o,"class","svelte-1w7qs76"),b(i,"class",s="form-input "+t[4]+" svelte-1w7qs76"),b(e,"class","form-container svelte-1w7qs76")},m(f,A){_(f,e,A),C(e,r),C(e,n),C(e,i),C(i,o),ht(o,t[3]),C(e,l),u&&u.m(e,null),c||(a=Be(o,"input",t[8]),c=!0)},p(f,A){A&8&&o.value!==f[3]&&ht(o,f[3]),A&16&&s!==(s="form-input "+f[4]+" svelte-1w7qs76")&&b(i,"class",s),f[2]?u?u.p(f,A):(u=Ht(f),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},d(f){f&&h(e),u&&u.d(),c=!1,a()}}}function ko(t){let e;return{c(){e=G("Continue")},m(r,n){_(r,e,n)},i:p,o:p,d(r){r&&h(e)}}}function vo(t){let e,r;return e=new Yt({}),{c(){v(e.$$.fragment)},m(n,i){y(e,n,i),r=!0},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){k(e,n)}}}function $o(t){let e,r,n,i;const o=[vo,ko],s=[];function l(c,a){return c[1]?0:1}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=ae()},m(c,a){s[e].m(c,a),_(c,n,a),i=!0},p(c,a){let u=e;e=l(c),e!==u&&(V(),g(s[u],1,1,()=>{s[u]=null}),W(),r=s[e],r||(r=s[e]=o[e](c),r.c()),d(r,1),r.m(n.parentNode,n))},i(c){i||(d(r),i=!0)},o(c){g(r),i=!1},d(c){c&&h(n),s[e].d(c)}}}function Bo(t){let e;return{c(){e=G("Close")},m(r,n){_(r,e,n)},d(r){r&&h(e)}}}function Po(t){let e,r,n,i;return e=new Re({props:{disabled:t[1],$$slots:{default:[$o]},$$scope:{ctx:t}}}),n=new Re({props:{intent:"secondary",disabled:t[1],$$slots:{default:[Bo]},$$scope:{ctx:t}}}),n.$on("click",function(){re(t[0])&&t[0].apply(this,arguments)}),{c(){v(e.$$.fragment),r=O(),v(n.$$.fragment)},m(o,s){y(e,o,s),_(o,r,s),y(n,o,s),i=!0},p(o,s){t=o;const l={};s&2&&(l.disabled=t[1]),s&514&&(l.$$scope={dirty:s,ctx:t}),e.$set(l);const c={};s&2&&(c.disabled=t[1]),s&512&&(c.$$scope={dirty:s,ctx:t}),n.$set(c)},i(o){i||(d(e.$$.fragment,o),d(n.$$.fragment,o),i=!0)},o(o){g(e.$$.fragment,o),g(n.$$.fragment,o),i=!1},d(o){o&&h(r),k(e,o),k(n,o)}}}function Do(t){let e,r;return e=new Qe({props:{$$slots:{default:[Po]},$$scope:{ctx:t}}}),{c(){v(e.$$.fragment)},m(n,i){y(e,n,i),r=!0},p(n,i){const o={};i&515&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){k(e,n)}}}function Co(t){let e,r,n,i,o,s,l,c,a;return r=new ot({props:{$$slots:{default:[wo]},$$scope:{ctx:t}}}),i=new Ee({props:{$$slots:{default:[yo]},$$scope:{ctx:t}}}),s=new it({props:{$$slots:{default:[Do]},$$scope:{ctx:t}}}),{c(){e=w("form"),v(r.$$.fragment),n=O(),v(i.$$.fragment),o=O(),v(s.$$.fragment),b(e,"class","svelte-1w7qs76")},m(u,f){_(u,e,f),y(r,e,null),C(e,n),y(i,e,null),C(e,o),y(s,e,null),l=!0,c||(a=Be(e,"submit",pt(t[5])),c=!0)},p(u,[f]){const A={};f&512&&(A.$$scope={dirty:f,ctx:u}),r.$set(A);const I={};f&540&&(I.$$scope={dirty:f,ctx:u}),i.$set(I);const P={};f&515&&(P.$$scope={dirty:f,ctx:u}),s.$set(P)},i(u){l||(d(r.$$.fragment,u),d(i.$$.fragment,u),d(s.$$.fragment,u),l=!0)},o(u){g(r.$$.fragment,u),g(i.$$.fragment,u),g(s.$$.fragment,u),l=!1},d(u){u&&h(e),k(r),k(i),k(s),c=!1,a()}}}function Mo(t,e,r){let n,i,o,{onContinue:s}=e,{onClose:l}=e,{processing:c}=e,{lastError:a}=e;const u=async()=>{const A=bo(n);A?r(2,i=A):s({email:n})};Mn(async()=>{r(2,i=(a==null?void 0:a.message)??"")});function f(){n=this.value,r(3,n)}return t.$$set=A=>{"onContinue"in A&&r(6,s=A.onContinue),"onClose"in A&&r(0,l=A.onClose),"processing"in A&&r(1,c=A.processing),"lastError"in A&&r(7,a=A.lastError)},t.$$.update=()=>{t.$$.dirty&4&&r(4,o=i?"error":"")},r(3,n=""),r(2,i=""),[l,c,i,n,o,u,s,a,f]}class To extends U{constructor(e){super(),Q(this,e,Mo,Co,B,{onContinue:6,onClose:0,processing:1,lastError:7},Io)}}function Oo(t){x(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 Ro(t){let e,r;const n=t[1].default,i=J(n,t,t[0],null);return{c(){e=w("div"),i&&i.c(),b(e,"class","rcb-modal-backdrop svelte-17tslso")},m(o,s){_(o,e,s),i&&i.m(e,null),r=!0},p(o,[s]){i&&i.p&&(!r||s&1)&&L(i,n,o,o[0],r?ee(n,o[0],s,null):q(o[0]),null)},i(o){r||(d(i,o),r=!0)},o(o){g(i,o),r=!1},d(o){o&&h(e),i&&i.d(o)}}}function Qo(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(0,i=o.$$scope)},[i,n]}class Uo extends U{constructor(e){super(),Q(this,e,Qo,Ro,B,{},Oo)}}function No(t){x(t,"svelte-z3twhy",".rcb-modal-container.svelte-z3twhy{width:100%}.rcb-modal-main.svelte-z3twhy{box-sizing:border-box;border-radius:16px;background-color:var(--rc-color-white);color:var(--rc-color-grey-text-dark);min-height:460px;padding:40px;flex-direction:column;display:flex}.rcb-modal-dark.svelte-z3twhy{background-color:var(--rc-color-grey-text-dark);color:var(--rc-color-white);min-height:0px}@media screen and (max-width: 960px){.rcb-modal-container.svelte-z3twhy{width:calc(100% - 32px);min-width:300px;max-width:640px;margin:auto}.rcb-modal-main.svelte-z3twhy,.rcb-modal-dark.svelte-z3twhy{min-width:300px;max-width:640px;padding:32px}}")}function So(t){let e,r,n,i;const o=t[2].default,s=J(o,t,t[1],null);return{c(){e=w("div"),r=w("main"),s&&s.c(),b(r,"class",n=K(`rcb-modal-main ${t[0]?"rcb-modal-dark":""}`)+" svelte-z3twhy"),b(e,"class","rcb-modal-container svelte-z3twhy")},m(l,c){_(l,e,c),C(e,r),s&&s.m(r,null),i=!0},p(l,[c]){s&&s.p&&(!i||c&2)&&L(s,o,l,l[1],i?ee(o,l[1],c,null):q(l[1]),null),(!i||c&1&&n!==(n=K(`rcb-modal-main ${l[0]?"rcb-modal-dark":""}`)+" svelte-z3twhy"))&&b(r,"class",n)},i(l){i||(d(s,l),i=!0)},o(l){g(s,l),i=!1},d(l){l&&h(e),s&&s.d(l)}}}function Lo(t,e,r){let{$$slots:n={},$$scope:i}=e,{dark:o=!1}=e;return t.$$set=s=>{"dark"in s&&r(0,o=s.dark),"$$scope"in s&&r(1,i=s.$$scope)},[o,i,n]}class Fo extends U{constructor(e){super(),Q(this,e,Lo,So,B,{dark:0},No)}}function Go(t){let e;const r=t[1].default,n=J(r,t,t[2],null);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&4)&&L(n,r,i,i[2],e?ee(r,i[2],o,null):q(i[2]),null)},i(i){e||(d(n,i),e=!0)},o(i){g(n,i),e=!1},d(i){n&&n.d(i)}}}function Yo(t){let e,r;return e=new Uo({props:{$$slots:{default:[Ho]},$$scope:{ctx:t}}}),{c(){v(e.$$.fragment)},m(n,i){y(e,n,i),r=!0},p(n,i){const o={};i&4&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){k(e,n)}}}function Ho(t){let e;const r=t[1].default,n=J(r,t,t[2],null);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&4)&&L(n,r,i,i[2],e?ee(r,i[2],o,null):q(i[2]),null)},i(i){e||(d(n,i),e=!0)},o(i){g(n,i),e=!1},d(i){n&&n.d(i)}}}function xo(t){let e,r,n,i;const o=[Yo,Go],s=[];function l(c,a){return c[0]?0:1}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=ae()},m(c,a){s[e].m(c,a),_(c,n,a),i=!0},p(c,[a]){let u=e;e=l(c),e===u?s[e].p(c,a):(V(),g(s[u],1,1,()=>{s[u]=null}),W(),r=s[e],r?r.p(c,a):(r=s[e]=o[e](c),r.c()),d(r,1),r.m(n.parentNode,n))},i(c){i||(d(r),i=!0)},o(c){g(r),i=!1},d(c){c&&h(n),s[e].d(c)}}}function Ko(t,e,r){let{$$slots:n={},$$scope:i}=e,{condition:o=!1}=e;return t.$$set=s=>{"condition"in s&&r(0,o=s.condition),"$$scope"in s&&r(2,i=s.$$scope)},[o,n,i]}class qo extends U{constructor(e){super(),Q(this,e,Ko,xo,B,{condition:0})}}const jo=t=>({}),xt=t=>({});function Jo(t){let e,r;const n=t[1].header,i=J(n,t,t[2],xt),o=t[1].default,s=J(o,t,t[2],null);return{c(){i&&i.c(),e=O(),s&&s.c()},m(l,c){i&&i.m(l,c),_(l,e,c),s&&s.m(l,c),r=!0},p(l,c){i&&i.p&&(!r||c&4)&&L(i,n,l,l[2],r?ee(n,l[2],c,jo):q(l[2]),xt),s&&s.p&&(!r||c&4)&&L(s,o,l,l[2],r?ee(o,l[2],c,null):q(l[2]),null)},i(l){r||(d(i,l),d(s,l),r=!0)},o(l){g(i,l),g(s,l),r=!1},d(l){l&&h(e),i&&i.d(l),s&&s.d(l)}}}function Vo(t){let e,r;return e=new Fo({props:{dark:t[0],$$slots:{default:[Jo]},$$scope:{ctx:t}}}),{c(){v(e.$$.fragment)},m(n,i){y(e,n,i),r=!0},p(n,[i]){const o={};i&1&&(o.dark=n[0]),i&4&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){k(e,n)}}}function Wo(t,e,r){let{$$slots:n={},$$scope:i}=e,{dark:o=!1}=e;return t.$$set=s=>{"dark"in s&&r(0,o=s.dark),"$$scope"in s&&r(2,i=s.$$scope)},[o,n,i]}class Kt extends U{constructor(e){super(),Q(this,e,Wo,Vo,B,{dark:0})}}const zo="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 Xo(t){let e,r;return{c(){e=w("img"),Z(e.src,r=zo)||b(e,"src",r),b(e,"alt","icon"),b(e,"class","rcb-ui-asset-icon")},m(n,i){_(n,e,i)},p,i:p,o:p,d(n){n&&h(e)}}}class Zo extends U{constructor(e){super(),Q(this,e,null,Xo,B,{})}}function es(t){x(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 ts(t){let e;return{c(){e=w("div"),e.textContent="Sandbox",b(e,"class","svelte-1rhrjxe")},m(r,n){_(r,e,n)},p,i:p,o:p,d(r){r&&h(e)}}}class ns extends U{constructor(e){super(),Q(this,e,null,ts,B,{},es)}}function rs(t){x(t,"svelte-17btec4",`.rcb-ui-container.svelte-17btec4{color-scheme:none;font-size:16px;line-height:1.5em;font-weight:400;font-family:-apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu,
|
|
15
|
+
Cantarell, "Open Sans", "Helvetica Neue", sans-serif}.rcb-ui-layout.svelte-17btec4{width:100vw;width:100 dvw;margin-right:auto;display:flex;justify-content:center;align-items:flex-start;position:relative;padding:0px 80px;box-sizing:border-box}.rcb-ui-aside.svelte-17btec4{margin-right:16px;flex:320px 1 0;max-width:480px}.rcb-ui-main.svelte-17btec4{flex:480px 1 0;max-width:640px}@media screen and (max-width: 960px){.rcb-ui-layout.svelte-17btec4{flex-direction:column;align-items:center;justify-content:center;height:100%;min-width:100%}.rcb-ui-aside.svelte-17btec4{margin-right:0;margin-bottom:16px;min-width:100%;display:flex;flex-direction:column;align-items:center;flex:none;max-width:none}.rcb-ui-main.svelte-17btec4{flex:none;max-width:none;min-width:100%}}@media screen and (max-width: 960px) and (max-height: 960px){.rcb-ui-layout.svelte-17btec4{overflow-y:scroll;justify-content:flex-start;padding:16px 0px}}`)}function qt(t){let e,r,n;return r=new Kt({props:{dark:!0,$$slots:{header:[cs],default:[is]},$$scope:{ctx:t}}}),{c(){e=w("div"),v(r.$$.fragment),b(e,"class","rcb-ui-aside svelte-17btec4")},m(i,o){_(i,e,o),y(r,e,null),n=!0},p(i,o){const s={};o&33554454&&(s.$$scope={dirty:o,ctx:i}),r.$set(s)},i(i){n||(d(r.$$.fragment,i),n=!0)},o(i){g(r.$$.fragment,i),n=!1},d(i){i&&h(e),k(r)}}}function jt(t){let e,r;return e=new kt({props:{productDetails:t[4],purchaseOption:t[8]}}),{c(){v(e.$$.fragment)},m(n,i){y(e,n,i),r=!0},p(n,i){const o={};i&16&&(o.productDetails=n[4]),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){k(e,n)}}}function is(t){let e,r,n=t[4]&&t[8]&&jt(t);return{c(){n&&n.c(),e=ae()},m(i,o){n&&n.m(i,o),_(i,e,o),r=!0},p(i,o){i[4]&&i[8]?n?(n.p(i,o),o&16&&d(n,1)):(n=jt(i),n.c(),d(n,1),n.m(e.parentNode,e)):n&&(V(),g(n,1,1,()=>{n=null}),W())},i(i){r||(d(n),r=!0)},o(i){g(n),r=!1},d(i){i&&h(e),n&&n.d(i)}}}function os(t){let e,r;return e=new Zo({}),{c(){v(e.$$.fragment)},m(n,i){y(e,n,i),r=!0},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){k(e,n)}}}function ss(t){let e,r;return e=new ns({}),{c(){v(e.$$.fragment)},m(n,i){y(e,n,i),r=!0},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){k(e,n)}}}function ls(t){let e,r,n,i,o,s,l;e=new Tt({props:{brandingInfo:t[1]}});const c=[ss,os],a=[];function u(f,A){return A&4&&(n=null),n==null&&(n=!!f[2].isSandbox()),n?0:1}return i=u(t,-1),o=a[i]=c[i](t),{c(){v(e.$$.fragment),r=O(),o.c(),s=ae()},m(f,A){y(e,f,A),_(f,r,A),a[i].m(f,A),_(f,s,A),l=!0},p(f,A){const I={};A&2&&(I.brandingInfo=f[1]),e.$set(I);let P=i;i=u(f,A),i!==P&&(V(),g(a[P],1,1,()=>{a[P]=null}),W(),o=a[i],o||(o=a[i]=c[i](f),o.c()),d(o,1),o.m(s.parentNode,s))},i(f){l||(d(e.$$.fragment,f),d(o),l=!0)},o(f){g(e.$$.fragment,f),g(o),l=!1},d(f){f&&(h(r),h(s)),k(e,f),a[i].d(f)}}}function cs(t){let e,r;return e=new ot({props:{slot:"header",$$slots:{default:[ls]},$$scope:{ctx:t}}}),{c(){v(e.$$.fragment)},m(n,i){y(e,n,i),r=!0},p(n,i){const o={};i&33554438&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){k(e,n)}}}function Jt(t){let e,r;return e=new kt({props:{productDetails:t[4],purchaseOption:t[8]}}),{c(){v(e.$$.fragment)},m(n,i){y(e,n,i),r=!0},p(n,i){const o={};i&16&&(o.productDetails=n[4]),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){k(e,n)}}}function Vt(t){let e,r;return e=new rt({}),{c(){v(e.$$.fragment)},m(n,i){y(e,n,i),r=!0},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){k(e,n)}}}function Wt(t){let e,r;return e=new To({props:{onContinue:t[11],onClose:t[10],processing:t[7]==="processing-auth-info",lastError:t[6]}}),{c(){v(e.$$.fragment)},m(n,i){y(e,n,i),r=!0},p(n,i){const o={};i&128&&(o.processing=n[7]==="processing-auth-info"),i&64&&(o.lastError=n[6]),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){k(e,n)}}}function zt(t){let e,r;return e=new Ao({props:{paymentInfoCollectionMetadata:t[5],onContinue:t[11],onClose:t[10],onError:t[12],processing:t[7]==="polling-purchase-status",productDetails:t[4],purchaseOptionToUse:t[8]}}),{c(){v(e.$$.fragment)},m(n,i){y(e,n,i),r=!0},p(n,i){const o={};i&32&&(o.paymentInfoCollectionMetadata=n[5]),i&128&&(o.processing=n[7]==="polling-purchase-status"),i&16&&(o.productDetails=n[4]),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){k(e,n)}}}function Xt(t){let e,r;return e=new rt({}),{c(){v(e.$$.fragment)},m(n,i){y(e,n,i),r=!0},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){k(e,n)}}}function Zt(t){var n;let e,r;return e=new _i({props:{brandingInfo:t[1],lastError:t[6]??new X(ne.UnknownError,"Unknown error without state set."),supportEmail:(n=t[1])==null?void 0:n.seller_company_support_email,productDetails:t[4],onContinue:t[13]}}),{c(){v(e.$$.fragment)},m(i,o){y(e,i,o),r=!0},p(i,o){var l;const s={};o&2&&(s.brandingInfo=i[1]),o&64&&(s.lastError=i[6]??new X(ne.UnknownError,"Unknown error without state set.")),o&2&&(s.supportEmail=(l=i[1])==null?void 0:l.seller_company_support_email),o&16&&(s.productDetails=i[4]),e.$set(s)},i(i){r||(d(e.$$.fragment,i),r=!0)},o(i){g(e.$$.fragment,i),r=!1},d(i){k(e,i)}}}function en(t){let e,r;return e=new Pi({props:{productDetails:t[4],brandingInfo:t[1],onContinue:t[11]}}),{c(){v(e.$$.fragment)},m(n,i){y(e,n,i),r=!0},p(n,i){const o={};i&16&&(o.productDetails=n[4]),i&2&&(o.brandingInfo=n[1]),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){g(e.$$.fragment,n),r=!1},d(n){k(e,n)}}}function as(t){let e,r,n,i,o,s,l,c,a=t[7]==="present-offer"&&t[4]&&t[8]&&Jt(t),u=t[7]==="present-offer"&&!t[4]&&Vt(),f=(t[7]==="needs-auth-info"||t[7]==="processing-auth-info")&&Wt(t),A=t[5]&&(t[7]==="needs-payment-info"||t[7]==="polling-purchase-status")&&t[4]&&t[8]&&zt(t),I=t[7]==="loading"&&Xt(),P=t[7]==="error"&&Zt(t),N=t[7]==="success"&&en(t);return{c(){a&&a.c(),e=O(),u&&u.c(),r=O(),f&&f.c(),n=O(),A&&A.c(),i=O(),I&&I.c(),o=O(),P&&P.c(),s=O(),N&&N.c(),l=ae()},m(m,$){a&&a.m(m,$),_(m,e,$),u&&u.m(m,$),_(m,r,$),f&&f.m(m,$),_(m,n,$),A&&A.m(m,$),_(m,i,$),I&&I.m(m,$),_(m,o,$),P&&P.m(m,$),_(m,s,$),N&&N.m(m,$),_(m,l,$),c=!0},p(m,$){m[7]==="present-offer"&&m[4]&&m[8]?a?(a.p(m,$),$&144&&d(a,1)):(a=Jt(m),a.c(),d(a,1),a.m(e.parentNode,e)):a&&(V(),g(a,1,1,()=>{a=null}),W()),m[7]==="present-offer"&&!m[4]?u?$&144&&d(u,1):(u=Vt(),u.c(),d(u,1),u.m(r.parentNode,r)):u&&(V(),g(u,1,1,()=>{u=null}),W()),m[7]==="needs-auth-info"||m[7]==="processing-auth-info"?f?(f.p(m,$),$&128&&d(f,1)):(f=Wt(m),f.c(),d(f,1),f.m(n.parentNode,n)):f&&(V(),g(f,1,1,()=>{f=null}),W()),m[5]&&(m[7]==="needs-payment-info"||m[7]==="polling-purchase-status")&&m[4]&&m[8]?A?(A.p(m,$),$&176&&d(A,1)):(A=zt(m),A.c(),d(A,1),A.m(i.parentNode,i)):A&&(V(),g(A,1,1,()=>{A=null}),W()),m[7]==="loading"?I?$&128&&d(I,1):(I=Xt(),I.c(),d(I,1),I.m(o.parentNode,o)):I&&(V(),g(I,1,1,()=>{I=null}),W()),m[7]==="error"?P?(P.p(m,$),$&128&&d(P,1)):(P=Zt(m),P.c(),d(P,1),P.m(s.parentNode,s)):P&&(V(),g(P,1,1,()=>{P=null}),W()),m[7]==="success"?N?(N.p(m,$),$&128&&d(N,1)):(N=en(m),N.c(),d(N,1),N.m(l.parentNode,l)):N&&(V(),g(N,1,1,()=>{N=null}),W())},i(m){c||(d(a),d(u),d(f),d(A),d(I),d(P),d(N),c=!0)},o(m){g(a),g(u),g(f),g(A),g(I),g(P),g(N),c=!1},d(m){m&&(h(e),h(r),h(n),h(i),h(o),h(s),h(l)),a&&a.d(m),u&&u.d(m),f&&f.d(m),A&&A.d(m),I&&I.d(m),P&&P.d(m),N&&N.d(m)}}}function us(t){let e,r=t[9].includes(t[7]),n,i,o,s,l=r&&qt(t);return o=new Kt({props:{$$slots:{default:[as]},$$scope:{ctx:t}}}),{c(){e=w("div"),l&&l.c(),n=O(),i=w("div"),v(o.$$.fragment),b(i,"class","rcb-ui-main svelte-17btec4"),b(e,"class","rcb-ui-layout svelte-17btec4"),b(e,"style",t[3])},m(c,a){_(c,e,a),l&&l.m(e,null),C(e,n),C(e,i),y(o,i,null),s=!0},p(c,a){a&128&&(r=c[9].includes(c[7])),r?l?(l.p(c,a),a&128&&d(l,1)):(l=qt(c),l.c(),d(l,1),l.m(e,n)):l&&(V(),g(l,1,1,()=>{l=null}),W());const u={};a&33554674&&(u.$$scope={dirty:a,ctx:c}),o.$set(u),(!s||a&8)&&b(e,"style",c[3])},i(c){s||(d(l),d(o.$$.fragment,c),s=!0)},o(c){g(l),g(o.$$.fragment,c),s=!1},d(c){c&&h(e),l&&l.d(),k(o)}}}function fs(t){let e,r,n;return r=new qo({props:{condition:t[0],$$slots:{default:[us]},$$scope:{ctx:t}}}),{c(){e=w("div"),v(r.$$.fragment),b(e,"class","rcb-ui-container svelte-17btec4")},m(i,o){_(i,e,o),y(r,e,null),n=!0},p(i,[o]){const s={};o&1&&(s.condition=i[0]),o&33554686&&(s.$$scope={dirty:o,ctx:i}),r.$set(s)},i(i){n||(d(r.$$.fragment,i),n=!0)},o(i){g(r.$$.fragment,i),n=!1},d(i){i&&h(e),k(r)}}}function ds(t,e,r){let{asModal:n=!0}=e,{customerEmail:i}=e,{appUserId:o}=e,{rcPackage:s}=e,{purchaseOption:l}=e,{brandingInfo:c}=e,{onFinished:a}=e,{onError:u}=e,{onClose:f}=e,{purchases:A}=e,{purchaseOperationHelper:I}=e,P="",N=null,m=null,$=null;const le=s.rcBillingProduct.identifier??null,R=s.rcBillingProduct.defaultPurchaseOption,fn=l||R;let j="present-offer";const Ks=["present-offer","needs-auth-info","processing-auth-info","needs-payment-info","polling-purchase-status","loading"];Ge(async()=>{if(r(4,N=s.rcBillingProduct),r(3,P=Br(c==null?void 0:c.appearance)),j==="present-offer"){i?dn():r(7,j="needs-auth-info");return}});const qs=()=>{f()},dn=()=>{if(le===null){Se(new X(ne.ErrorSettingUpPurchase,"Product ID was not set before purchase."));return}else j==="present-offer"&&r(7,j="loading");if(!i){Se(new X(ne.MissingEmailError));return}I.startPurchase(o,le,fn,i,s.rcBillingProduct.presentedOfferingContext).then(M=>{if(M.next_action==="collect_payment_info"){r(6,$=null),r(7,j="needs-payment-info"),r(5,m=M);return}if(M.next_action==="completed"){r(6,$=null),r(7,j="success");return}}).catch(M=>{Se(M)})},js=M=>{if(j==="needs-auth-info"){M&&(r(14,i=M.email),r(7,j="processing-auth-info")),dn();return}if(j==="needs-payment-info"){r(7,j="polling-purchase-status"),I.pollCurrentPurchaseForCompletion().then(()=>{r(7,j="success")}).catch(Vs=>{Se(Vs)});return}if(j==="success"||j==="error"){a();return}r(7,j="success")},Se=M=>{if(j==="processing-auth-info"&&M.isRecoverable()){r(6,$=M),r(7,j="needs-auth-info");return}r(6,$=M),r(7,j="error")},Js=()=>{u($??new X(ne.UnknownError,"Unknown error without state set."))};return t.$$set=M=>{"asModal"in M&&r(0,n=M.asModal),"customerEmail"in M&&r(14,i=M.customerEmail),"appUserId"in M&&r(15,o=M.appUserId),"rcPackage"in M&&r(16,s=M.rcPackage),"purchaseOption"in M&&r(17,l=M.purchaseOption),"brandingInfo"in M&&r(1,c=M.brandingInfo),"onFinished"in M&&r(18,a=M.onFinished),"onError"in M&&r(19,u=M.onError),"onClose"in M&&r(20,f=M.onClose),"purchases"in M&&r(2,A=M.purchases),"purchaseOperationHelper"in M&&r(21,I=M.purchaseOperationHelper)},[n,c,A,P,N,m,$,j,fn,Ks,qs,js,Se,Js,i,o,s,l,a,u,f,I]}class gs extends U{constructor(e){super(),Q(this,e,ds,fs,B,{asModal:0,customerEmail:14,appUserId:15,rcPackage:16,purchaseOption:17,brandingInfo:1,onFinished:18,onError:19,onClose:20,purchases:2,purchaseOperationHelper:21},rs)}}function ms(t){return t.expires_date==null?!0:new Date(t.expires_date)>new Date}function ps(t,e,r,n){const i=e.product_identifier;if(i in r)return hs(t,e,r[i]);if(i in n)return _s(t,e,n[i]);throw new z(te.CustomerInfoError,"Could not find entitlement product in subscriptions or non-subscriptions.")}function hs(t,e,r){return{identifier:t,isActive:ms(e),willRenew:Es(e,r),store:(r==null?void 0:r.store)??"unknown",latestPurchaseDate:new Date(e.purchase_date),originalPurchaseDate:new Date(e.purchase_date),expirationDate:Je(e.expires_date),productIdentifier:e.product_identifier,unsubscribeDetectedAt:Je(r==null?void 0:r.unsubscribe_detected_at),billingIssueDetectedAt:Je(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,r){return{identifier:t,isActive:!0,willRenew:!1,store:r.store,latestPurchaseDate:new Date(e.purchase_date),originalPurchaseDate:new Date(r.original_purchase_date),expirationDate:null,productIdentifier:e.product_identifier,unsubscribeDetectedAt:null,billingIssueDetectedAt:null,isSandbox:r.is_sandbox,periodType:"normal"}}function As(t,e,r){const n={},i={};for(const o in t){const s=ps(o,t[o],e,r);n[o]=s,s.isActive&&(i[o]=s)}return{all:n,active:i}}function Je(t){return t==null?null:new Date(t)}function bs(t){const e=ws(t),r=t.subscriber,n=ks(r.non_subscriptions);return{entitlements:As(r.entitlements,r.subscriptions,n),allExpirationDatesByProduct:e,allPurchaseDatesByProduct:Is(t,n),activeSubscriptions:ys(e),managementURL:r.management_url,requestDate:new Date(t.request_date),firstSeenDate:new Date(r.first_seen),originalPurchaseDate:Je(r.original_purchase_date),originalAppUserId:t.subscriber.original_app_user_id}}function Es(t,e){if(e==null)return!1;const r=e.store=="promotional",n=t.expires_date==null,i=e.unsubscribe_detected_at!=null,o=e.billing_issues_detected_at!=null;return!(r||n||i||o)}function Is(t,e){const r={};for(const n in t.subscriber.subscriptions){const i=t.subscriber.subscriptions[n];r[n]=new Date(i.purchase_date)}for(const n in e){const i=e[n].purchase_date;i==null?r[n]=null:r[n]=new Date(i)}return r}function ws(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 ys(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 ks(t){const e={};for(const r in t){if(t[r].length===0)continue;const n=t[r].length;e[r]=t[r][n-1]}return e}const vs="0.10.0",$s="https://api.revenuecat.com";var Ve;(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"})(Ve||(Ve={}));function st(t){return t?t.startsWith("rcb_sb_"):!1}async function ke(t,e){const{apiKey:r,body:n,headers:i,httpConfig:o}=e,l=`${(o==null?void 0:o.proxyURL)??$s}${t.urlPath()}`;try{const c=await fetch(l,{method:t.method,headers:Cs(r,i,o==null?void 0:o.additionalHeaders),body:Ps(n)});return await Bs(c,t),await c.json()}catch(c){throw c instanceof TypeError?new z(te.NetworkError,Me.getPublicMessage(te.NetworkError),c.message):c}}async function Bs(t,e){const r=t.status;if(r>=Ve.INTERNAL_SERVER_ERROR)lt(e,r,await t.text());else if(r>=Ve.BAD_REQUEST){const n=await t.json(),i=n?JSON.stringify(n):null,o=n==null?void 0:n.code,s=n==null?void 0:n.message;if(o!=null){const l=Me.convertCodeToBackendErrorCode(o);if(l==null)lt(e,r,i,o);else throw z.getForBackendError(l,s)}else lt(e,r,i)}}function lt(t,e,r,n){throw new z(te.UnknownBackendError,"Unknown backend error.",`Request: ${t.name}. Status code: ${e}. Body: ${r}.`,{backendErrorCode:n})}function Ps(t){return t==null?null:JSON.stringify(t)}const tn="Authorization",nn="Content-Type",rn="Accept",on="X-Platform",sn="X-Version",ln="X-Is-Sandbox",Ds=new Set([tn,nn,rn,on,sn,ln]);function Cs(t,e,r){let n={[tn]:`Bearer ${t}`,[nn]:"application/json",[rn]:"application/json",[on]:"web",[sn]:vs,[ln]:`${st(t)}`};return e&&(n={...n,...e}),r&&(n={...r,...n}),n}const cn="/v1/subscribers",We="/rcbilling/v1";class Ms{constructor(e){D(this,"appUserId");D(this,"method","GET");D(this,"name","getOfferings");this.appUserId=e}urlPath(){const e=encodeURIComponent(this.appUserId);return`${cn}/${e}/offerings`}}class Ts{constructor(){D(this,"method","POST");D(this,"name","purchase")}urlPath(){return`${We}/purchase`}}class Os{constructor(e,r,n){D(this,"method","GET");D(this,"name","getProducts");D(this,"appUserId");D(this,"productIds");D(this,"currency");this.appUserId=e,this.productIds=r,this.currency=n}urlPath(){const e=encodeURIComponent(this.appUserId),r=this.productIds.map(encodeURIComponent).join("&id="),n=this.currency?`¤cy=${this.currency}`:"";return`${We}/subscribers/${e}/products?id=${r}${n}`}}class Rs{constructor(e){D(this,"method","GET");D(this,"name","getCustomerInfo");D(this,"appUserId");this.appUserId=e}urlPath(){const e=encodeURIComponent(this.appUserId);return`${cn}/${e}`}}class Qs{constructor(){D(this,"method","GET");D(this,"name","getBrandingInfo")}urlPath(){return`${We}/branding`}}class Us{constructor(e){D(this,"method","GET");D(this,"name","getCheckoutStatus");D(this,"operationSessionId");this.operationSessionId=e}urlPath(){return`${We}/checkout/${this.operationSessionId}`}}const ct={};class Ns{constructor(e,r=ct){D(this,"API_KEY");D(this,"httpConfig");this.API_KEY=e,this.httpConfig=r}async getOfferings(e){return await ke(new Ms(e),{apiKey:this.API_KEY,httpConfig:this.httpConfig})}async getCustomerInfo(e){return await ke(new Rs(e),{apiKey:this.API_KEY,httpConfig:this.httpConfig})}async getProducts(e,r,n){return await ke(new Os(e,r,n),{apiKey:this.API_KEY,httpConfig:this.httpConfig})}async getBrandingInfo(){return await ke(new Qs,{apiKey:this.API_KEY,httpConfig:this.httpConfig})}async postPurchase(e,r,n,i,o){const s={app_user_id:e,product_id:r,email:n,price_id:o.priceId,presented_offering_identifier:i.offeringIdentifier};return o.id!=="base_option"&&(s.offer_id=o.id),i.targetingContext&&(s.applied_targeting_rule={rule_id:i.targetingContext.ruleId,revision:i.targetingContext.revision}),i.placementIdentifier&&(s.presented_placement_identifier=i.placementIdentifier),await ke(new Ts,{apiKey:this.API_KEY,body:s,httpConfig:this.httpConfig})}async getCheckoutStatus(e){return await ke(new Us(e),{apiKey:this.API_KEY,httpConfig:this.httpConfig})}}function Ss(t){if(!/^rcb_[a-zA-Z0-9_.-]+$/.test(t))throw new z(te.InvalidCredentialsError,"Invalid API key. Use your RevenueCat Billing API key.")}function Ls(t){if(new Set(["no_user","null","none","nil","(null)","NaN","\\x00","","unidentified","undefined","unknown"]).has(t)||t.includes("/"))throw new z(te.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.')}function Fs(t){if(t!=null&&t.endsWith("/"))throw new z(te.ConfigurationError,"Invalid proxy URL. The proxy URL should not end with a trailing slash.")}function Gs(t){if(t){for(const e in t)if(Ds.has(e))throw new z(te.ConfigurationError,"Invalid additional headers. Some headers are reserved for internal use.")}}var at=(t=>(t.Current="current",t))(at||{});function Ys(t,e){async function r(...n){return await this.preload(),await t.call(this,...n)}return r}const an=(t,e)=>({...t,rcBillingProduct:{...t.rcBillingProduct,presentedOfferingContext:{...t.rcBillingProduct.presentedOfferingContext,placementIdentifier:e}}}),pe=(t,e)=>t==null?null:an(t,e),Hs=(t,e,r)=>{const n=t.offering_ids_by_placement??null;if(n==null)return null;const i=t.fallback_offering_id??null;let o;if(r in n){const l=n[r]??null;if(l==null)return null;o=e[l],o==null&&(o=e[i])}else o=e[i];if(o==null)return null;const s=Object.fromEntries(Object.entries(o.packagesById).map(([l,c])=>[l,an(c,r)]));return{...o,packagesById:s,availablePackages:Object.values(s),weekly:pe(o.weekly,r),monthly:pe(o.monthly,r),twoMonth:pe(o.twoMonth,r),threeMonth:pe(o.threeMonth,r),sixMonth:pe(o.sixMonth,r),annual:pe(o.annual,r),lifetime:pe(o.lifetime,r)}};function xs(t,e){const r={};e.product_details.forEach(o=>{r[o.identifier]=o});const n={};t.offerings.forEach(o=>{const s=o.identifier===t.current_offering_id,l=rr(s,o,r,t.targeting);l!=null&&(n[o.identifier]=l)});const i=t.current_offering_id?n[t.current_offering_id]??null:null;return Object.keys(n).length==0&&F.debugLog("Empty offerings. Please make sure you've configured offerings correctly in the RevenueCat dashboard and that the products are properly configured."),{all:n,current:i}}un=[Ys];const se=class se{constructor(e,r,n=ct){En(ft,5,this);D(this,"_API_KEY");D(this,"_appUserId");D(this,"_brandingInfo",null);D(this,"_loadingResourcesPromise",null);D(this,"backend");D(this,"purchaseOperationHelper");this._API_KEY=e,this._appUserId=r,st(e)&&F.debugLog("Initializing Purchases SDK with sandbox API Key"),this.backend=new Ns(this._API_KEY,n),this.purchaseOperationHelper=new br(this.backend)}static setLogLevel(e){F.setLogLevel(e)}static getSharedInstance(){if(se.isConfigured())return se.instance;throw new $t}static isConfigured(){return se.instance!==void 0}static configure(e,r,n=ct){return se.instance!==void 0&&F.warnLog("Purchases is already initialized. You normally should only configure Purchases once. Creating and returning new instance."),Ss(e),Ls(r),Fs(n.proxyURL),Gs(n.additionalHeaders),se.instance=new se(e,r,n),se.getSharedInstance()}async preload(){if(this.hasLoadedResources()){F.verboseLog("Purchases resources are loaded. Skipping.");return}if(this._loadingResourcesPromise!==null){F.verboseLog("Purchases resources are loading. Waiting."),await this._loadingResourcesPromise;return}return this._loadingResourcesPromise=this.backend.getBrandingInfo().then(e=>{this._brandingInfo=e}).catch(e=>{let r=`${e}`;e instanceof z&&(r=`${e.message}. ${e.underlyingErrorMessage?`Underlying error: ${e.underlyingErrorMessage}`:""}`),F.errorLog(`Error fetching branding info: ${r}`)}).finally(()=>{this._loadingResourcesPromise=null}),this._loadingResourcesPromise}hasLoadedResources(){return this._brandingInfo!==null}async getOfferings(e){Eo(e==null?void 0:e.currency);const r=this._appUserId,n=await this.backend.getOfferings(r),i=(e==null?void 0:e.offeringIdentifier)===at.Current?n.current_offering_id:e==null?void 0:e.offeringIdentifier;return i&&(n.offerings=n.offerings.filter(o=>o.identifier===i)),await this.getAllOfferings(n,r,e)}async getCurrentOfferingForPlacement(e,r){const n=this._appUserId,i=await this.backend.getOfferings(n),o=await this.getAllOfferings(i,n,r),s=i.placements??null;return s==null?null:Hs(s,o.all,e)}async getAllOfferings(e,r,n){const i=e.offerings.flatMap(s=>s.packages).map(s=>s.platform_product_identifier),o=await this.backend.getProducts(r,i,n==null?void 0:n.currency);return this.logMissingProductIds(i,o.product_details),xs(e,o)}async isEntitledTo(e){const r=await this.getCustomerInfo();return e in r.entitlements.active}purchasePackage(e,r,n){return this.purchase({rcPackage:e,customerEmail:r,htmlTarget:n})}purchase(e){const{rcPackage:r,purchaseOption:n,htmlTarget:i,customerEmail:o}=e;let s=i??document.getElementById("rcb-ui-root");if(s===null){const u=document.createElement("div");u.className="rcb-ui-root",document.body.appendChild(u),s=u}if(s===null)throw new Error("Could not generate a mount point for the billing widget");const l=s,c=!i,a=this._appUserId;return F.debugLog(`Presenting purchase form for package ${r.identifier}`),new Promise((u,f)=>{new gs({target:l,props:{appUserId:a,rcPackage:r,purchaseOption:n,customerEmail:o,onFinished:async()=>{F.debugLog("Purchase finished"),l.innerHTML="",u({customerInfo:await this._getCustomerInfoForUserId(a)})},onClose:()=>{l.innerHTML="",F.debugLog("Purchase cancelled by user"),f(new z(te.UserCancelledError))},onError:A=>{l.innerHTML="",f(z.getForPurchasesFlowError(A))},purchases:this,brandingInfo:this._brandingInfo,purchaseOperationHelper:this.purchaseOperationHelper,asModal:c}})})}async getCustomerInfo(){return await this._getCustomerInfoForUserId(this._appUserId)}getAppUserId(){return this._appUserId}async changeUser(e){return this._appUserId=e,await this.getCustomerInfo()}logMissingProductIds(e,r){const n={};r.forEach(o=>n[o.identifier]=o);const i=[];e.forEach(o=>{n[o]===void 0&&i.push(o)}),i.length>0&&F.debugLog(`Could not find product data for product ids:
|
|
16
|
+
${i.join()}.
|
|
17
|
+
Please check that your product configuration is correct.`)}clearAppearanceStore(){Oe.set(Bt)}isSandbox(){return st(this._API_KEY)}close(){se.instance===this?(se.instance=void 0,this.clearAppearanceStore()):F.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 bs(r)}};ft=An(null),In(ft,1,"purchase",un,se),gt(ft,se),D(se,"instance");let ut=se;E.ErrorCode=te,E.LogLevel=oe,E.OfferingKeyword=at,E.PackageType=Et,E.ProductType=Ie,E.Purchases=ut,E.PurchasesError=z,E.UninitializedPurchasesError=$t,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|