@revenuecat/purchases-js 0.5.0 → 0.6.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.
@@ -1,9 +1,9 @@
1
- (function(H,ee){typeof exports=="object"&&typeof module<"u"?ee(exports):typeof define=="function"&&define.amd?define(["exports"],ee):(H=typeof globalThis<"u"?globalThis:H||self,ee(H.Purchases={}))})(this,function(H){"use strict";var as=Object.defineProperty;var us=(H,ee,x)=>ee in H?as(H,ee,{enumerable:!0,configurable:!0,writable:!0,value:x}):H[ee]=x;var M=(H,ee,x)=>(us(H,typeof ee!="symbol"?ee+"":ee,x),x);function ee(t){return t!=null}var x=(t=>(t[t.Silent=0]="Silent",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug",t[t.Verbose=5]="Verbose",t))(x||{});class G{static setLogLevel(e){this.logLevel=e}static log(e,r=this.logLevel){const n=`[Purchases] ${e}`;if(!(this.logLevel<r||r===x.Silent))switch(r){case x.Error:console.error(n);break;case x.Warn:console.warn(n);break;case x.Info:console.info(n);break;case x.Debug:console.debug(n);break;case x.Verbose:console.debug(n);break}}static errorLog(e){this.log(e,x.Error)}static warnLog(e){this.log(e,x.Warn)}static infoLog(e){this.log(e,x.Info)}static debugLog(e){this.log(e,x.Debug)}static verboseLog(e){this.log(e,x.Verbose)}}M(G,"logLevel",x.Silent);var ie=(t=>(t.Year="year",t.Month="month",t.Week="week",t.Day="day",t))(ie||{});function xe(t){const e=t.match(/^PT?([0-9]+)([MDYW])$/);if(!e||e.length<3)return G.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 G.errorLog(`Invalid ISO 8601 unit duration format: ${t}`),null}}const Ye=(t,e)=>{const r=t/100;return new Intl.NumberFormat("en-US",{style:"currency",currency:e}).format(r)},Xt=t=>{const e=t.number;if(e===1)switch(t.unit){case ie.Year:return"yearly";case ie.Month:return"monthly";case ie.Week:return"weekly";case ie.Day:return"daily"}else return`every ${e} ${t.unit}s`},Zt=t=>{const e=t.number;if(e===1)switch(t.unit){case ie.Year:return"1 year";case ie.Month:return"1 month";case ie.Week:return"1 week";case ie.Day:return"1 day"}else return`${e} ${t.unit}s`},nt=t=>{const e=xe(t);return e?Xt(e):"unknown"},en=t=>{const e=xe(t);return e?Zt(e):"unknown"};var rt=(t=>(t.Unknown="unknown",t.Custom="custom",t.Lifetime="$rc_lifetime",t.Annual="$rc_annual",t.SixMonth="$rc_six_month",t.ThreeMonth="$rc_three_month",t.TwoMonth="$rc_two_month",t.Monthly="$rc_monthly",t.Weekly="$rc_weekly",t))(rt||{});const tn=t=>({amount:t.amount,currency:t.currency,formattedPrice:Ye(t.amount,t.currency)}),it=t=>{const e=t.period_duration;return{periodDuration:e,period:e?xe(e):null,cycleCount:t.cycle_count,price:t.price?tn(t.price):null}},nn=t=>t.base==null?(G.debugLog("Missing base phase for subscription option. Ignoring."),null):{id:t.id,base:it(t.base),trial:t.trial?it(t.trial):null},rn=(t,e)=>{const r={};if(Object.entries(t.subscription_options).forEach(([s,l])=>{const c=nn(l);c!=null&&(r[s]=c)}),Object.keys(r).length===0)return G.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 G.debugLog(`Product ${t.identifier} has no default subscription option. Ignoring.`),null;const o=i.base.price;return o==null?(G.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,defaultSubscriptionOption:i,subscriptionOptions:r}},on=(t,e,r)=>{const n=r[e.platform_product_identifier];if(n===void 0)return null;const i=rn(n,t);return i===null?null:{identifier:e.identifier,rcBillingProduct:i,packageType:ln(e.identifier)}},sn=(t,e,r,n)=>{const i={offeringIdentifier:e.identifier,targetingContext:t&&n?{ruleId:n.rule_id,revision:n.revision}:null},o=e.packages.map(l=>on(i,l,r)).filter(ee),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 ln(t){switch(t){case"$rc_lifetime":return"$rc_lifetime";case"$rc_annual":return"$rc_annual";case"$rc_six_month":return"$rc_six_month";case"$rc_three_month":return"$rc_three_month";case"$rc_two_month":return"$rc_two_month";case"$rc_monthly":return"$rc_monthly";case"$rc_weekly":return"$rc_weekly";default:return t.startsWith("$rc_")?"unknown":"custom"}}function y(){}function cn(t,e){for(const r in e)t[r]=e[r];return t}function ot(t){return t()}function st(){return Object.create(null)}function ge(t){t.forEach(ot)}function se(t){return typeof t=="function"}function Q(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Be;function ne(t,e){return t===e?!0:(Be||(Be=document.createElement("a")),Be.href=e,t===Be.href)}function lt(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function an(t,e){const r=lt(t.srcset),n=lt(e||"");return n.length===r.length&&n.every(([i,o],s)=>o===r[s][1]&&(ne(r[s][0],i)||ne(i,r[s][0])))}function un(t){return Object.keys(t).length===0}function V(t,e,r,n){if(t){const i=ct(t,e,r,n);return t[0](i)}}function ct(t,e,r,n){return t[1]&&n?cn(r.ctx.slice(),t[1](n(e))):r.ctx}function W(t,e,r,n){if(t[2]&&n){const i=t[2](n(r));if(e.dirty===void 0)return i;if(typeof i=="object"){const 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 z(t,e,r,n,i,o){if(i){const s=ct(e,r,n,o);t.p(s,i)}}function X(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 me(t){return t??""}function P(t,e){t.appendChild(e)}function F(t,e,r){const n=fn(t);if(!n.getElementById(e)){const i=k("style");i.id=e,i.textContent=r,dn(n,i)}}function fn(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function dn(t,e){return P(t.head||t,e),e.sheet}function p(t,e,r){t.insertBefore(e,r||null)}function m(t){t.parentNode&&t.parentNode.removeChild(t)}function k(t){return document.createElement(t)}function O(t){return document.createTextNode(t)}function T(){return O(" ")}function re(){return O("")}function pe(t,e,r,n){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r,n)}function at(t){return function(e){return e.preventDefault(),t.call(this,e)}}function h(t,e,r){r==null?t.removeAttribute(e):t.getAttribute(e)!==r&&t.setAttribute(e,r)}const gn=["width","height"];function mn(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&&gn.indexOf(n)===-1?t[n]=e[n]:h(t,n,e[n])}function pn(t,e){Object.keys(e).forEach(r=>{hn(t,r,e[r])})}function hn(t,e,r){const n=e.toLowerCase();n in t?t[n]=typeof t[n]=="boolean"&&r===""?!0:r:e in t?t[e]=typeof t[e]=="boolean"&&r===""?!0:r:h(t,e,r)}function _n(t){return/-/.test(t)?pn:mn}function An(t){return Array.from(t.childNodes)}function le(t,e){e=""+e,t.data!==e&&(t.data=e)}function ut(t,e){t.value=e??""}function En(t,e,{bubbles:r=!1,cancelable:n=!1}={}){return new CustomEvent(t,{detail:e,bubbles:r,cancelable:n})}let he;function _e(t){he=t}function Ae(){if(!he)throw new Error("Function called outside component initialization");return he}function bn(t){Ae().$$.before_update.push(t)}function De(t){Ae().$$.on_mount.push(t)}function In(){const t=Ae();return(e,r,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const o=En(e,r,{cancelable:n});return i.slice().forEach(s=>{s.call(t,o)}),!o.defaultPrevented}return!0}}function wn(t,e){return Ae().$$.context.set(t,e),e}function kn(t){return Ae().$$.context.get(t)}function ft(t,e){const r=t.$$.callbacks[e.type];r&&r.slice().forEach(n=>n.call(this,e))}const ce=[],Pe=[];let ae=[];const Ge=[],yn=Promise.resolve();let He=!1;function vn(){He||(He=!0,yn.then(dt))}function Ke(t){ae.push(t)}function $n(t){Ge.push(t)}const qe=new Set;let ue=0;function dt(){if(ue!==0)return;const t=he;do{try{for(;ue<ce.length;){const e=ce[ue];ue++,_e(e),Bn(e.$$)}}catch(e){throw ce.length=0,ue=0,e}for(_e(null),ce.length=0,ue=0;Pe.length;)Pe.pop()();for(let e=0;e<ae.length;e+=1){const r=ae[e];qe.has(r)||(qe.add(r),r())}ae.length=0}while(ce.length);for(;Ge.length;)Ge.pop()();He=!1,qe.clear(),_e(t)}function Bn(t){if(t.fragment!==null){t.update(),ge(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(Ke)}}function Dn(t){const e=[],r=[];ae.forEach(n=>t.indexOf(n)===-1?e.push(n):r.push(n)),r.forEach(n=>n()),ae=e}const Ce=new Set;let oe;function K(){oe={r:0,c:[],p:oe}}function q(){oe.r||ge(oe.c),oe=oe.p}function f(t,e){t&&t.i&&(Ce.delete(t),t.i(e))}function d(t,e,r,n){if(t&&t.o){if(Ce.has(t))return;Ce.add(t),oe.c.push(()=>{Ce.delete(t),n&&(r&&t.d(1),n())}),t.o(e)}else n&&n()}function Pn(t,e,r){const n=t.$$.props[e];n!==void 0&&(t.$$.bound[n]=r,r(t.$$.ctx[n]))}function w(t){t&&t.c()}function b(t,e,r){const{fragment:n,after_update:i}=t.$$;n&&n.m(e,r),Ke(()=>{const o=t.$$.on_mount.map(ot).filter(se);t.$$.on_destroy?t.$$.on_destroy.push(...o):ge(o),t.$$.on_mount=[]}),i.forEach(Ke)}function I(t,e){const r=t.$$;r.fragment!==null&&(Dn(r.after_update),ge(r.on_destroy),r.fragment&&r.fragment.d(e),r.on_destroy=r.fragment=null,r.ctx=[])}function Cn(t,e){t.$$.dirty[0]===-1&&(ce.push(t),vn(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function N(t,e,r,n,i,o,s=null,l=[-1]){const c=he;_e(t);const a=t.$$={fragment:null,ctx:[],props:o,update:y,not_equal:i,bound:st(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:st(),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||{},(g,_,...v)=>{const E=v.length?v[0]:_;return a.ctx&&i(a.ctx[g],a.ctx[g]=E)&&(!a.skip_bound&&a.bound[g]&&a.bound[g](E),u&&Cn(t,g)),_}):[],a.update(),u=!0,ge(a.before_update),a.fragment=n?n(a.ctx):!1,e.target){if(e.hydrate){const g=An(e.target);a.fragment&&a.fragment.l(g),g.forEach(m)}else a.fragment&&a.fragment.c();e.intro&&f(t.$$.fragment),b(t,e.target,e.anchor),dt()}_e(c)}class R{constructor(){M(this,"$$");M(this,"$$set")}$destroy(){I(this,1),this.$destroy=y}$on(e,r){if(!se(r))return y;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(r),()=>{const i=n.indexOf(r);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!un(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Mn="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Mn);function Tn(t){F(t,"svelte-1bzqb13",".rcb-modal-section.svelte-1bzqb13{padding:8px 0px;display:flex}section.rcb-modal-section.svelte-1bzqb13{flex-grow:1}.rcb-modal-section.svelte-1bzqb13:last-of-type{padding:0}")}function je(t){let e,r;const n=t[2].default,i=V(n,t,t[1],null);return{c(){e=k(t[0]),i&&i.c(),_n(t[0])(e,{class:me("rcb-modal-section")+" svelte-1bzqb13"})},m(o,s){p(o,e,s),i&&i.m(e,null),r=!0},p(o,s){i&&i.p&&(!r||s&2)&&z(i,n,o,o[1],r?W(n,o[1],s,null):X(o[1]),null)},i(o){r||(f(i,o),r=!0)},o(o){d(i,o),r=!1},d(o){o&&m(e),i&&i.d(o)}}}function Qn(t){let e=t[0],r,n,i=t[0]&&je(t);return{c(){i&&i.c(),r=re()},m(o,s){i&&i.m(o,s),p(o,r,s),n=!0},p(o,[s]){o[0]?e?Q(e,o[0])?(i.d(1),i=je(o),e=o[0],i.c(),i.m(r.parentNode,r)):i.p(o,s):(i=je(o),e=o[0],i.c(),i.m(r.parentNode,r)):e&&(i.d(1),i=null,e=o[0])},i(o){n||(f(i,o),n=!0)},o(o){d(i,o),n=!1},d(o){o&&m(r),i&&i.d(o)}}}function Nn(t,e,r){let{$$slots:n={},$$scope:i}=e,{as:o="section"}=e;return t.$$set=s=>{"as"in s&&r(0,o=s.as),"$$scope"in s&&r(1,i=s.$$scope)},[o,i,n]}class fe extends R{constructor(e){super(),N(this,e,Nn,Qn,Q,{as:0},Tn)}}function Rn(t){F(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 Un(t){let e=en(t[1].periodDuration)+"",r,n;return{c(){r=O(e),n=O(" free trial")},m(i,o){p(i,r,o),p(i,n,o)},p:y,d(i){i&&(m(r),m(n))}}}function Sn(t){let e=(t[2].currency||"")+"",r,n,i=Ye(t[2].amount,t[2].currency)+"",o;return{c(){r=O(e),n=T(),o=O(i)},m(s,l){p(s,r,l),p(s,n,l),p(s,o,l)},p:y,d(s){s&&(m(r),m(n),m(o))}}}function On(t){let e;return{c(){e=k("span"),e.textContent=`${t[1]&&t[2]&&`${t[2].currency} ${Ye(t[2].amount,t[2].currency)} after end of trial`}`,h(e,"class","rcb-product-price-after-trial svelte-gf0gr5")},m(r,n){p(r,e,n)},p:y,d(r){r&&m(e)}}}function gt(t){let e,r,n=nt(t[0].normalPeriodDuration)+"",i;return{c(){e=k("li"),r=O("Renews "),i=O(n)},m(o,s){p(o,e,s),P(e,r),P(e,i)},p(o,s){s&1&&n!==(n=nt(o[0].normalPeriodDuration)+"")&&le(i,n)},d(o){o&&m(e)}}}function Ln(t){var C,Oe;let e,r,n=t[0].displayName+"",i,o,s,l,c,a,u,g,_,v,E,B=((C=t[1])==null?void 0:C.periodDuration)&&Un(t),A=!((Oe=t[1])!=null&&Oe.periodDuration)&&t[2]&&Sn(t),$=t[1]&&t[2]&&On(t),U=t[0].normalPeriodDuration&&gt(t);return{c(){e=k("div"),r=k("span"),i=O(n),o=T(),s=k("span"),B&&B.c(),l=T(),A&&A.c(),c=T(),$&&$.c(),a=T(),u=k("ul"),U&&U.c(),g=T(),_=k("li"),_.textContent="Continues until canceled",v=T(),E=k("li"),E.textContent="Cancel anytime",h(s,"class","rcb-product-price svelte-gf0gr5"),h(u,"class","rcb-product-details svelte-gf0gr5"),h(e,"class","rcb-pricing-info svelte-gf0gr5")},m(Y,S){p(Y,e,S),P(e,r),P(r,i),P(e,o),P(e,s),B&&B.m(s,null),P(s,l),A&&A.m(s,null),P(e,c),$&&$.m(e,null),P(e,a),P(e,u),U&&U.m(u,null),P(u,g),P(u,_),P(u,v),P(u,E)},p(Y,S){var Le,Fe;S&1&&n!==(n=Y[0].displayName+"")&&le(i,n),(Le=Y[1])!=null&&Le.periodDuration&&B.p(Y,S),!((Fe=Y[1])!=null&&Fe.periodDuration)&&Y[2]&&A.p(Y,S),Y[1]&&Y[2]&&$.p(Y,S),Y[0].normalPeriodDuration?U?U.p(Y,S):(U=gt(Y),U.c(),U.m(u,g)):U&&(U.d(1),U=null)},d(Y){Y&&m(e),B&&B.d(),A&&A.d(),$&&$.d(),U&&U.d()}}}function Fn(t){let e,r;return e=new fe({props:{$$slots:{default:[Ln]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,[i]){const o={};i&33&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function xn(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 mt extends R{constructor(e){super(),N(this,e,xn,Fn,Q,{productDetails:0,purchaseOption:3},Rn)}}const Yn="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+PDUy3unzl67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tKmQChRkGEMgPIiDDhoRYjTR56CPGwiooXN6oENQikhYsWP65MJXglx4sVMoZsJdikRosWOMYSRPJih9q3cOPKnWuRSxa7eO9O3cJFCxe+frdMDQgAIfkEBQUAAQAsBQADACAAEAAACKYAAwgcSLAgwQcODCpcyNDAAYYQAzhpaIDhFYY+NOBY6HAhkyETFRLZ0CGKQgMVDV4RAoQKQxMdUpx8aJAJECYQnWzYcMQgSoNVgAy5CHGGhhI+aRIkMgRnxCohNvQoiLDgEyFDskQUuINDiK1Hfpgc+ETKQi0nVGxNkkSrwCw/hiBxu7XuFidAhARpgqWu3yxIhgApEtLvVipIgARBYthvlKaNFQYEADs=";function Gn(t){let e,r;return{c(){e=k("img"),ne(e.src,r=Yn)||h(e,"src",r),h(e,"alt","spinner")},m(n,i){p(n,e,i)},p:y,i:y,o:y,d(n){n&&m(e)}}}class Hn extends R{constructor(e){super(),N(this,e,null,Gn,Q,{})}}function Kn(t){F(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 qn(t){let e,r,n;return r=new Hn({}),{c(){e=k("div"),w(r.$$.fragment),h(e,"class","rcb-modal-loader svelte-1mxx341")},m(i,o){p(i,e,o),b(r,e,null),n=!0},p:y,i(i){n||(f(r.$$.fragment,i),n=!0)},o(i){d(r.$$.fragment,i),n=!1},d(i){i&&m(e),I(r)}}}class Je extends R{constructor(e){super(),N(this,e,null,qn,Q,{},Kn)}}var Z=(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))(Z||{});class Ee{static getPublicMessage(e){switch(e){case 0:return"Unknown error.";case 1:return"Purchase was cancelled.";case 2:return"There was a problem with the store.";case 3:return"The device or user is not allowed to make the purchase.";case 4:return"One or more of the arguments provided are invalid.";case 5:return"The product is not available for purchase.";case 6:return"This product is already active for the user.";case 7:return"There is already another active subscriber using the same receipt.";case 8:return"The receipt is not valid.";case 9:return"The receipt is missing.";case 10:return"Error performing request.";case 11:return"There was a credentials issue. Check the underlying error for more details.";case 12:return"Received unexpected response from the backend.";case 14:return"The app user id is not valid.";case 15:return"The operation is already in progress.";case 16:return"There was an unknown backend error.";case 17:return"Apple Subscription Key is invalid or not present. In order to provide subscription offers, you must first generate a subscription key. Please see https://docs.revenuecat.com/docs/ios-subscription-offers for more info.";case 18:return"The User is ineligible for that action.";case 19:return"App does not have sufficient permissions to make purchases.";case 20:return"The payment is pending.";case 21:return"One or more of the attributes sent could not be saved.";case 22:return"Called logOut but the current user is anonymous.";case 23:return"There is an issue with your configuration. Check the underlying error for more details.";case 24:return"There was a problem with the operation. Looks like we doesn't support that yet. Check the underlying error for more details.";case 25:return"A request for subscriber attributes returned none.";case 28:return"There was a problem related to the customer info.";case 36:return"Request failed signature verification. Please see https://rev.cat/trusted-entitlements for more info.";case 38:return"Email is not valid. Please provide a valid email address."}}static getErrorCodeForBackendErrorCode(e){switch(e){case 7101:return 2;case 7102:return 7;case 7103:return 8;case 7107:case 7224:case 7225:return 11;case 7105:case 7106: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 pt?e:null}static convertPurchaseFlowErrorCodeToErrorCode(e){switch(e){case L.ErrorSettingUpPurchase:return 2;case L.ErrorChargingPayment:return 20;case L.NetworkError:return 10;case L.MissingEmailError:return 4;case L.StripeError:return 2;case L.UnknownError:return 0;case L.AlreadySubscribedError:return 6}}}var pt=(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.BackendOfferNotFound=7814]="BackendOfferNotFound",t[t.BackendNoMXRecordsFound=7834]="BackendNoMXRecordsFound",t))(pt||{});class J extends Error{constructor(r,n,i){super(n);M(this,"toString",()=>`PurchasesError(code: ${Z[this.errorCode]}, message: ${this.message})`);this.errorCode=r,this.underlyingErrorMessage=i}static getForBackendError(r,n){const i=Ee.getErrorCodeForBackendErrorCode(r);return new J(i,Ee.getPublicMessage(i),n)}static getForPurchasesFlowError(r){return new J(Ee.convertPurchaseFlowErrorCodeToErrorCode(r.errorCode),r.message,r.underlyingErrorMessage)}}class ht extends Error{constructor(){super("Purchases must be configured before calling getInstance")}}var be=(t=>(t.Started="started",t.InProgress="in_progress",t.Succeeded="succeeded",t.Failed="failed",t))(be||{}),Me=(t=>(t[t.SetupIntentCreationFailed=1]="SetupIntentCreationFailed",t[t.PaymentMethodCreationFailed=2]="PaymentMethodCreationFailed",t[t.PaymentChargeFailed=3]="PaymentChargeFailed",t))(Me||{}),L=(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))(L||{});class j extends Error{constructor(e,r,n){super(r),this.errorCode=e,this.underlyingErrorMessage=n}static fromPurchasesError(e,r){let n;return e.errorCode===Z.ProductAlreadyPurchasedError?n=6:e.errorCode===Z.InvalidEmailError?n=5:n=r,new j(n,e.message,e.underlyingErrorMessage)}}class jn{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==null?void 0:n.id);return this.operationSessionId=s.operation_session_id,s}catch(s){if(s instanceof J)throw j.fromPurchasesError(s,0);{const l="Unknown error starting purchase: "+String(s);throw G.errorLog(l),new j(2,l)}}}async pollCurrentPurchaseForCompletion(){const e=this.operationSessionId;if(!e)throw new j(0,"No purchase in progress");return new Promise((r,n)=>{const i=(o=1)=>{if(o>this.maxNumberAttempts){this.clearPurchaseInProgress(),n(new j(2,"Max attempts reached trying to get successful purchase status"));return}this.backend.getCheckoutStatus(e).then(s=>{switch(s.operation.status){case be.Started:case be.InProgress:setTimeout(()=>i(o+1),this.waitMSBetweenAttempts);break;case be.Succeeded:this.clearPurchaseInProgress(),r();return;case be.Failed:this.clearPurchaseInProgress(),this.handlePaymentError(s.operation.error,n)}}).catch(s=>{const l=j.fromPurchasesError(s,3);n(l)})};i()})}clearPurchaseInProgress(){this.operationSessionId=null}handlePaymentError(e,r){if(e==null){r(new j(2,"Got an error status but error field is empty."));return}switch(e.code){case Me.SetupIntentCreationFailed:r(new j(0,"Setup intent creation failed"));return;case Me.PaymentMethodCreationFailed:r(new j(0,"Payment method creation failed"));return;case Me.PaymentChargeFailed:r(new j(1,"Payment charge failed"));return}}}const Jn="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 Vn(t){F(t,"svelte-1609h93","img.svelte-1609h93{width:124px;height:124px;margin:0 auto}")}function Wn(t){let e,r;return{c(){e=k("img"),ne(e.src,r=Jn)||h(e,"src",r),h(e,"alt","icon"),h(e,"class","rcb-ui-asset-icon svelte-1609h93")},m(n,i){p(n,e,i)},p:y,i:y,o:y,d(n){n&&m(e)}}}class zn extends R{constructor(e){super(),N(this,e,null,Wn,Q,{},Vn)}}function Xn(t){F(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 Zn(t){let e,r,n,i,o;const s=t[3].default,l=V(s,t,t[2],null);return{c(){e=k("button"),l&&l.c(),h(e,"class",r=me(`intent-${t[0]}`)+" svelte-1rmxk7q"),e.disabled=t[1]},m(c,a){p(c,e,a),l&&l.m(e,null),n=!0,i||(o=pe(e,"click",t[4]),i=!0)},p(c,[a]){l&&l.p&&(!n||a&4)&&z(l,s,c,c[2],n?W(s,c[2],a,null):X(c[2]),null),(!n||a&1&&r!==(r=me(`intent-${c[0]}`)+" svelte-1rmxk7q"))&&h(e,"class",r),(!n||a&2)&&(e.disabled=c[1])},i(c){n||(f(l,c),n=!0)},o(c){d(l,c),n=!1},d(c){c&&m(e),l&&l.d(c),i=!1,o()}}}function er(t,e,r){let{$$slots:n={},$$scope:i}=e,{intent:o="primary"}=e,{disabled:s=!1}=e;function l(c){ft.call(this,t,c)}return t.$$set=c=>{"intent"in c&&r(0,o=c.intent),"disabled"in c&&r(1,s=c.disabled),"$$scope"in c&&r(2,i=c.$$scope)},[o,s,i,n,l]}class Ie extends R{constructor(e){super(),N(this,e,er,Zn,Q,{intent:0,disabled:1},Xn)}}function tr(t){F(t,"svelte-1f9z0o8","footer.svelte-1f9z0o8{display:flex;flex-direction:column}")}function nr(t){let e,r;const n=t[1].default,i=V(n,t,t[0],null);return{c(){e=k("footer"),i&&i.c(),h(e,"class","rcb-modal-footer svelte-1f9z0o8")},m(o,s){p(o,e,s),i&&i.m(e,null),r=!0},p(o,[s]){i&&i.p&&(!r||s&1)&&z(i,n,o,o[0],r?W(n,o[0],s,null):X(o[0]),null)},i(o){r||(f(i,o),r=!0)},o(o){d(i,o),r=!1},d(o){o&&m(e),i&&i.d(o)}}}function rr(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(0,i=o.$$scope)},[i,n]}class Ve extends R{constructor(e){super(),N(this,e,rr,nr,Q,{},tr)}}function ir(t){F(t,"svelte-6o8e90",'.column.svelte-6o8e90{display:flex;flex-direction:column;justify-content:flex-start;gap:var(--gap, "8px");flex-grow:1}')}function or(t){let e,r,n;const i=t[2].default,o=V(i,t,t[1],null);return{c(){e=k("div"),o&&o.c(),h(e,"class","column svelte-6o8e90"),h(e,"style",r=`--gap:${t[0]};`)},m(s,l){p(s,e,l),o&&o.m(e,null),n=!0},p(s,[l]){o&&o.p&&(!n||l&2)&&z(o,i,s,s[1],n?W(i,s[1],l,null):X(s[1]),null),(!n||l&1&&r!==(r=`--gap:${s[0]};`))&&h(e,"style",r)},i(s){n||(f(o,s),n=!0)},o(s){d(o,s),n=!1},d(s){s&&m(e),o&&o.d(s)}}}function sr(t,e,r){let{$$slots:n={},$$scope:i}=e,{gutter:o="8px"}=e;return t.$$set=s=>{"gutter"in s&&r(0,o=s.gutter),"$$scope"in s&&r(1,i=s.$$scope)},[o,i,n]}class we extends R{constructor(e){super(),N(this,e,sr,or,Q,{gutter:0},ir)}}const lr="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 cr(t){F(t,"svelte-14xreta",".close-button.svelte-14xreta{border:none;cursor:pointer;background-color:transparent;padding:0px}")}function ar(t){let e,r,n,i,o;return{c(){e=k("button"),r=k("img"),ne(r.src,n=lr)||h(r,"src",n),h(r,"alt","close"),h(e,"class","close-button svelte-14xreta"),e.disabled=t[0]},m(s,l){p(s,e,l),P(e,r),i||(o=pe(e,"click",t[1]),i=!0)},p(s,[l]){l&1&&(e.disabled=s[0])},i:y,o:y,d(s){s&&m(e),i=!1,o()}}}function ur(t,e,r){let{disabled:n=!1}=e;function i(o){ft.call(this,t,o)}return t.$$set=o=>{"disabled"in o&&r(0,n=o.disabled)},[n,i]}class fr extends R{constructor(e){super(),N(this,e,ur,ar,Q,{disabled:0},cr)}}function dr(t){F(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 gr(t){let e;return{c(){e=k("div"),h(e,"class","rcb-app-icon loading svelte-44qpq9")},m(r,n){p(r,e,n)},p:y,d(r){r&&m(e)}}}function mr(t){let e,r,n,i,o,s;return{c(){e=k("picture"),r=k("source"),i=T(),o=k("img"),h(r,"type","image/webp"),an(r,n=t[1])||h(r,"srcset",n),h(o,"class","rcb-app-icon svelte-44qpq9"),ne(o.src,s=t[0])||h(o,"src",s),h(o,"alt","App icon"),h(e,"class","rcb-app-icon-picture-container svelte-44qpq9")},m(l,c){p(l,e,c),P(e,r),P(e,i),P(e,o)},p(l,c){c&2&&n!==(n=l[1])&&h(r,"srcset",n),c&1&&!ne(o.src,s=l[0])&&h(o,"src",s)},d(l){l&&m(e)}}}function pr(t){let e;function r(o,s){return o[0]!==null?mr:gr}let n=r(t),i=n(t);return{c(){i.c(),e=re()},m(o,s){i.m(o,s),p(o,e,s)},p(o,[s]){n===(n=r(o))&&i?i.p(o,s):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},i:y,o:y,d(o){o&&m(e),i.d(o)}}}function hr(t,e,r){let{src:n=null}=e,{srcWebp:i=null}=e;return t.$$set=o=>{"src"in o&&r(0,n=o.src),"srcWebp"in o&&r(1,i=o.srcWebp)},[n,i]}class _t extends R{constructor(e){super(),N(this,e,hr,pr,Q,{src:0,srcWebp:1},dr)}}const Te=t=>`https://da08ctfrofx1b.cloudfront.net/${t}`;function _r(t){F(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 Ar(t){let e,r;return e=new _t({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p:y,i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Er(t){let e,r,n=t[0].seller_company_name+"",i,o,s=t[0].app_icon_webp!==null&&t[0].app_icon!==null&&At(t);return{c(){s&&s.c(),e=T(),r=k("span"),i=O(n),h(r,"class","app-title svelte-10uf5fq")},m(l,c){s&&s.m(l,c),p(l,e,c),p(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=At(l),s.c(),f(s,1),s.m(e.parentNode,e)):s&&(K(),d(s,1,1,()=>{s=null}),q()),(!o||c&1)&&n!==(n=l[0].seller_company_name+"")&&le(i,n)},i(l){o||(f(s),o=!0)},o(l){d(s),o=!1},d(l){l&&(m(e),m(r)),s&&s.d(l)}}}function At(t){let e,r;return e=new _t({props:{src:Te(t[0].app_icon),srcWebp:Te(t[0].app_icon_webp)}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&1&&(o.src=Te(n[0].app_icon)),i&1&&(o.srcWebp=Te(n[0].app_icon_webp)),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function br(t){let e,r,n,i;const o=[Er,Ar],s=[];function l(c,a){return c[0]!==null?0:1}return r=l(t),n=s[r]=o[r](t),{c(){e=k("div"),n.c(),h(e,"class","rcb-header-layout__business-info svelte-10uf5fq")},m(c,a){p(c,e,a),s[r].m(e,null),i=!0},p(c,[a]){let u=r;r=l(c),r===u?s[r].p(c,a):(K(),d(s[u],1,1,()=>{s[u]=null}),q(),n=s[r],n?n.p(c,a):(n=s[r]=o[r](c),n.c()),f(n,1),n.m(e,null))},i(c){i||(f(n),i=!0)},o(c){d(n),i=!1},d(c){c&&m(e),s[r].d()}}}function Ir(t,e,r){let{brandingInfo:n=null}=e;return t.$$set=i=>{"brandingInfo"in i&&r(0,n=i.brandingInfo)},[n]}class Et extends R{constructor(e){super(),N(this,e,Ir,br,Q,{brandingInfo:0},_r)}}function wr(t){F(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 kr(t){let e,r,n,i,o;return r=new Et({props:{brandingInfo:t[0]}}),i=new fr({}),i.$on("click",function(){se(t[1])&&t[1].apply(this,arguments)}),{c(){e=k("div"),w(r.$$.fragment),n=T(),w(i.$$.fragment),h(e,"class","rcb-post-purchase-header-layout svelte-17puakv")},m(s,l){p(s,e,l),b(r,e,null),P(e,n),b(i,e,null),o=!0},p(s,l){t=s;const c={};l&1&&(c.brandingInfo=t[0]),r.$set(c)},i(s){o||(f(r.$$.fragment,s),f(i.$$.fragment,s),o=!0)},o(s){d(r.$$.fragment,s),d(i.$$.fragment,s),o=!1},d(s){s&&m(e),I(r),I(i)}}}function yr(t){let e,r;return e=new fe({props:{as:"header",$$slots:{default:[kr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,[i]){const o={};i&7&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function vr(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 $r extends R{constructor(e){super(),N(this,e,vr,yr,Q,{brandingInfo:0,onClose:1},wr)}}function Br(t){F(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 Dr=t=>({}),bt=t=>({});function Pr(t){let e,r,n,i,o;const s=t[4].default,l=V(s,t,t[5],null);return{c(){e=k("span"),r=O(t[2]),n=T(),i=k("span"),l&&l.c(),h(e,"class","title svelte-10pcqja"),h(i,"class","subtitle svelte-10pcqja")},m(c,a){p(c,e,a),P(e,r),p(c,n,a),p(c,i,a),l&&l.m(i,null),o=!0},p(c,a){(!o||a&4)&&le(r,c[2]),l&&l.p&&(!o||a&32)&&z(l,s,c,c[5],o?W(s,c[5],a,null):X(c[5]),null)},i(c){o||(f(l,c),o=!0)},o(c){d(l,c),o=!1},d(c){c&&(m(e),m(n),m(i)),l&&l.d(c)}}}function Cr(t){let e,r,n;const i=t[4].icon,o=V(i,t,t[5],bt);return r=new we({props:{gutter:"16px",$$slots:{default:[Pr]},$$scope:{ctx:t}}}),{c(){o&&o.c(),e=T(),w(r.$$.fragment)},m(s,l){o&&o.m(s,l),p(s,e,l),b(r,s,l),n=!0},p(s,l){o&&o.p&&(!n||l&32)&&z(o,i,s,s[5],n?W(i,s[5],l,Dr):X(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){d(o,s),d(r.$$.fragment,s),n=!1},d(s){s&&m(e),o&&o.d(s),I(r,s)}}}function Mr(t){let e,r,n;return r=new we({props:{gutter:"16px",$$slots:{default:[Cr]},$$scope:{ctx:t}}}),{c(){e=k("div"),w(r.$$.fragment),h(e,"class","rcb-modal-message svelte-10pcqja"),h(e,"data-type",t[3])},m(i,o){p(i,e,o),b(r,e,null),n=!0},p(i,o){const s={};o&36&&(s.$$scope={dirty:o,ctx:i}),r.$set(s),(!n||o&8)&&h(e,"data-type",i[3])},i(i){n||(f(r.$$.fragment,i),n=!0)},o(i){d(r.$$.fragment,i),n=!1},d(i){i&&m(e),I(r)}}}function Tr(t){let e;return{c(){e=O("Go back to app")},m(r,n){p(r,e,n)},d(r){r&&m(e)}}}function Qr(t){let e,r;return e=new Ie({props:{$$slots:{default:[Tr]},$$scope:{ctx:t}}}),e.$on("click",function(){se(t[1])&&t[1].apply(this,arguments)}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){t=n;const o={};i&32&&(o.$$scope={dirty:i,ctx:t}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Nr(t){let e,r,n,i,o,s;return e=new $r({props:{brandingInfo:t[0],onClose:t[1]}}),n=new fe({props:{$$slots:{default:[Mr]},$$scope:{ctx:t}}}),o=new Ve({props:{$$slots:{default:[Qr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment),r=T(),w(n.$$.fragment),i=T(),w(o.$$.fragment)},m(l,c){b(e,l,c),p(l,r,c),b(n,l,c),p(l,i,c),b(o,l,c),s=!0},p(l,c){const a={};c&1&&(a.brandingInfo=l[0]),c&2&&(a.onClose=l[1]),e.$set(a);const u={};c&44&&(u.$$scope={dirty:c,ctx:l}),n.$set(u);const g={};c&34&&(g.$$scope={dirty:c,ctx:l}),o.$set(g)},i(l){s||(f(e.$$.fragment,l),f(n.$$.fragment,l),f(o.$$.fragment,l),s=!0)},o(l){d(e.$$.fragment,l),d(n.$$.fragment,l),d(o.$$.fragment,l),s=!1},d(l){l&&(m(r),m(i)),I(e,l),I(n,l),I(o,l)}}}function Rr(t){let e,r;return e=new we({props:{gutter:"32px",$$slots:{default:[Nr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,[i]){const o={};i&47&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Ur(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 It extends R{constructor(e){super(),N(this,e,Ur,Rr,Q,{brandingInfo:0,onContinue:1,title:2,type:3},Br)}}function wt(t){let e,r,n,i,o;return{c(){e=O("If this error persists, please contact "),r=k("a"),n=O(t[1]),o=O("."),h(r,"href",i="mailto:"+t[1])},m(s,l){p(s,e,l),p(s,r,l),P(r,n),p(s,o,l)},p(s,l){l&2&&le(n,s[1]),l&2&&i!==(i="mailto:"+s[1])&&h(r,"href",i)},d(s){s&&(m(e),m(r),m(o))}}}function Sr(t){let e=t[3]()+"",r,n,i,o=t[1]&&wt(t);return{c(){r=O(e),n=T(),o&&o.c(),i=re()},m(s,l){p(s,r,l),p(s,n,l),o&&o.m(s,l),p(s,i,l)},p(s,l){s[1]?o?o.p(s,l):(o=wt(s),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null)},d(s){s&&(m(r),m(n),m(i)),o&&o.d(s)}}}function Or(t){let e,r;return e=new zn({props:{slot:"icon"}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p:y,i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Lr(t){let e,r;return e=new It({props:{title:t[4](),brandingInfo:t[0],onContinue:t[2],type:"error",$$slots:{icon:[Or],default:[Sr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,[i]){const o={};i&1&&(o.brandingInfo=n[0]),i&4&&(o.onContinue=n[2]),i&66&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Fr(t,e,r){let{brandingInfo:n=null}=e,{lastError:i}=e,{supportEmail:o=null}=e,{onContinue:s}=e;De(()=>{G.errorLog(`Displayed error: ${L[i.errorCode]}. Message: ${i.message??"None"}. Underlying error: ${i.underlyingErrorMessage??"None"}`)});function l(){switch(i.errorCode){case L.UnknownError:return"An unknown error occurred.";case L.ErrorSettingUpPurchase:return"Purchase not started due to an error.";case L.ErrorChargingPayment:return"Payment failed.";case L.NetworkError:return"Network error. Please check your internet connection.";case L.StripeError:return i.message;case L.MissingEmailError:return"Email is required to complete the purchase.";case L.AlreadySubscribedError:return"You are already subscribed to this product."}return i.message}function c(){switch(i.errorCode){case L.AlreadySubscribedError:return"Already subscribed";default:return"Something went wrong"}}return t.$$set=a=>{"brandingInfo"in a&&r(0,n=a.brandingInfo),"lastError"in a&&r(5,i=a.lastError),"supportEmail"in a&&r(1,o=a.supportEmail),"onContinue"in a&&r(2,s=a.onContinue)},[n,o,s,l,c,i]}class xr extends R{constructor(e){super(),N(this,e,Fr,Lr,Q,{brandingInfo:0,lastError:5,supportEmail:1,onContinue:2})}}const Yr="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 Gr(t){F(t,"svelte-1609h93","img.svelte-1609h93{width:124px;height:124px;margin:0 auto}")}function Hr(t){let e,r;return{c(){e=k("img"),ne(e.src,r=Yr)||h(e,"src",r),h(e,"alt","icon"),h(e,"class","rcb-ui-asset-icon svelte-1609h93")},m(n,i){p(n,e,i)},p:y,i:y,o:y,d(n){n&&m(e)}}}class Kr extends R{constructor(e){super(),N(this,e,null,Hr,Q,{},Gr)}}function qr(t){let e;return{c(){e=O("Your plan is now active.")},m(r,n){p(r,e,n)},d(r){r&&m(e)}}}function jr(t){let e,r;return e=new Kr({props:{slot:"icon"}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p:y,i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Jr(t){let e,r;return e=new It({props:{type:"success",title:"Purchase successful",brandingInfo:t[0],onContinue:t[1],$$slots:{icon:[jr],default:[qr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,[i]){const o={};i&1&&(o.brandingInfo=n[0]),i&2&&(o.onContinue=n[1]),i&4&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Vr(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 Wr extends R{constructor(e){super(),N(this,e,Vr,Jr,Q,{brandingInfo:0,onContinue:1})}}function zr(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 Xr=typeof window>"u";function Zr(t){if(!Xr)return t.registerAppInfo({name:"svelte-stripe-js",url:"https://svelte-stripe-js.vercel.app"})}function ei(t){let e;return{c(){e=k("div")},m(r,n){p(r,e,n),t[6](e)},p:y,i:y,o:y,d(r){r&&m(e),t[6](null)}}}function ti(t,e,r){let n,i;const o=In(),{elements:s}=kn("stripe");let{options:l=void 0}=e;De(()=>(n=zr(i,"payment",s,o,l),()=>n.destroy()));function c(){n.blur()}function a(){n.clear()}function u(){n.destroy()}function g(){n.focus()}function _(v){Pe[v?"unshift":"push"](()=>{i=v,r(0,i)})}return t.$$set=v=>{"options"in v&&r(1,l=v.options)},[i,l,c,a,u,g,_]}class ni extends R{constructor(e){super(),N(this,e,ti,ei,Q,{options:1,blur:2,clear:3,destroy:4,focus:5})}get blur(){return this.$$.ctx[2]}get clear(){return this.$$.ctx[3]}get destroy(){return this.$$.ctx[4]}get focus(){return this.$$.ctx[5]}}function kt(t){let e;const r=t[15].default,n=V(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)&&z(n,r,i,i[14],e?W(r,i[14],o,null):X(i[14]),null)},i(i){e||(f(n,i),e=!0)},o(i){d(n,i),e=!1},d(i){n&&n.d(i)}}}function ri(t){let e,r,n=t[1]&&t[0]&&kt(t);return{c(){n&&n.c(),e=re()},m(i,o){n&&n.m(i,o),p(i,e,o),r=!0},p(i,[o]){i[1]&&i[0]?n?(n.p(i,o),o&3&&f(n,1)):(n=kt(i),n.c(),f(n,1),n.m(e.parentNode,e)):n&&(K(),d(n,1,1,()=>{n=null}),q())},i(i){r||(f(n),r=!0)},o(i){d(n),r=!1},d(i){i&&m(e),n&&n.d(i)}}}function ii(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:g="above"}=e,{loader:_="auto"}=e,{fonts:v=[]}=e,{locale:E="auto"}=e,{currency:B=void 0}=e,{amount:A=void 0}=e,{clientSecret:$=void 0}=e,{elements:U=null}=e;return t.$$set=C=>{"stripe"in C&&r(1,s=C.stripe),"mode"in C&&r(2,l=C.mode),"theme"in C&&r(3,c=C.theme),"variables"in C&&r(4,a=C.variables),"rules"in C&&r(5,u=C.rules),"labels"in C&&r(6,g=C.labels),"loader"in C&&r(7,_=C.loader),"fonts"in C&&r(8,v=C.fonts),"locale"in C&&r(9,E=C.locale),"currency"in C&&r(10,B=C.currency),"amount"in C&&r(11,A=C.amount),"clientSecret"in C&&r(12,$=C.clientSecret),"elements"in C&&r(0,U=C.elements),"$$scope"in C&&r(14,o=C.$$scope)},t.$$.update=()=>{t.$$.dirty&120&&r(13,n={theme:c,variables:a,rules:u,labels:g}),t.$$.dirty&16263&&s&&!U&&(r(0,U=s.elements({mode:l,currency:B,amount:A,appearance:n,clientSecret:$,fonts:v,loader:_,locale:E})),Zr(s),wn("stripe",{stripe:s,elements:U})),t.$$.dirty&8705&&U&&U.update({appearance:n,locale:E})},[U,s,l,c,a,u,g,_,v,E,B,A,$,n,o,i]}class oi extends R{constructor(e){super(),N(this,e,ii,ri,Q,{stripe:1,mode:2,theme:3,variables:4,rules:5,labels:6,loader:7,fonts:8,locale:9,currency:10,amount:11,clientSecret:12,elements:0})}}var yt="https://js.stripe.com/v3",si=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,vt="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(yt,'"]')),r=0;r<e.length;r++){var n=e[r];if(si.test(n.src))return n}return null},$t=function(e){var r=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(yt).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},ci=function(e,r){!e||!e._registerWrapper||e._registerWrapper({name:"stripe-js",version:"2.4.0",startTime:r})},ke=null,Qe=null,Ne=null,ai=function(e){return function(){e(new Error("Failed to load Stripe.js"))}},ui=function(e,r){return function(){window.Stripe?e(window.Stripe):r(new Error("Stripe.js not available"))}},fi=function(e){return ke!==null?ke:(ke=new Promise(function(r,n){if(typeof window>"u"||typeof document>"u"){r(null);return}if(window.Stripe&&e&&console.warn(vt),window.Stripe){r(window.Stripe);return}try{var i=li();if(i&&e)console.warn(vt);else if(!i)i=$t(e);else if(i&&Ne!==null&&Qe!==null){var o;i.removeEventListener("load",Ne),i.removeEventListener("error",Qe),(o=i.parentNode)===null||o===void 0||o.removeChild(i),i=$t(e)}Ne=ui(r,n),Qe=ai(n),i.addEventListener("load",Ne),i.addEventListener("error",Qe)}catch(s){n(s);return}}),ke.catch(function(r){return ke=null,Promise.reject(r)}))},di=function(e,r,n){if(e===null)return null;var i=e.apply(void 0,r);return ci(i,n),i},ye,Bt=!1,Dt=function(){return ye||(ye=fi(null).catch(function(e){return ye=null,Promise.reject(e)}),ye)};Promise.resolve().then(function(){return Dt()}).catch(function(t){Bt||console.warn(t)});var gi=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];Bt=!0;var i=Date.now();return Dt().then(function(o){return di(o,r,i)})};function mi(t){F(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 pi(t){let e,r;const n=t[0].default,i=V(n,t,t[1],null);return{c(){e=k("div"),i&&i.c(),h(e,"class","rcb-header-layout svelte-1xe711j")},m(o,s){p(o,e,s),i&&i.m(e,null),r=!0},p(o,s){i&&i.p&&(!r||s&2)&&z(i,n,o,o[1],r?W(n,o[1],s,null):X(o[1]),null)},i(o){r||(f(i,o),r=!0)},o(o){d(i,o),r=!1},d(o){o&&m(e),i&&i.d(o)}}}function hi(t){let e,r;return e=new fe({props:{as:"header",$$slots:{default:[pi]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,[i]){const o={};i&2&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function _i(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(1,i=o.$$scope)},[n,i]}class We extends R{constructor(e){super(),N(this,e,_i,hi,Q,{},mi)}}const Ai="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M18%208H17V6C17%203.24%2014.76%201%2012%201C9.24%201%207%203.24%207%206V8H6C4.9%208%204%208.9%204%2010V20C4%2021.1%204.9%2022%206%2022H18C19.1%2022%2020%2021.1%2020%2020V10C20%208.9%2019.1%208%2018%208ZM12%2017C10.9%2017%2010%2016.1%2010%2015C10%2013.9%2010.9%2013%2012%2013C13.1%2013%2014%2013.9%2014%2015C14%2016.1%2013.1%2017%2012%2017ZM15.1%208H8.9V6C8.9%204.29%2010.29%202.9%2012%202.9C13.71%202.9%2015.1%204.29%2015.1%206V8Z'%20fill='%2311D483'/%3e%3c/svg%3e";function Ei(t){let e,r;return{c(){e=k("img"),ne(e.src,r=Ai)||h(e,"src",r),h(e,"alt","icon"),h(e,"class","rcb-ui-asset-icon")},m(n,i){p(n,e,i)},p:y,i:y,o:y,d(n){n&&m(e)}}}class bi extends R{constructor(e){super(),N(this,e,null,Ei,Q,{})}}const ve={error:"#f2545b",warning:"#f4e971",focus:"#000080","grey-text-dark":"#000000","grey-text-light":"#767676","grey-ui-dark":"#dfdfdf",white:"#ffffff"};function Ii(t){F(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(H,ee){typeof exports=="object"&&typeof module<"u"?ee(exports):typeof define=="function"&&define.amd?define(["exports"],ee):(H=typeof globalThis<"u"?globalThis:H||self,ee(H.Purchases={}))})(this,function(H){"use strict";var as=Object.defineProperty;var us=(H,ee,x)=>ee in H?as(H,ee,{enumerable:!0,configurable:!0,writable:!0,value:x}):H[ee]=x;var P=(H,ee,x)=>(us(H,typeof ee!="symbol"?ee+"":ee,x),x);function ee(t){return t!=null}var x=(t=>(t[t.Silent=0]="Silent",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug",t[t.Verbose=5]="Verbose",t))(x||{});class Y{static setLogLevel(e){this.logLevel=e}static log(e,r=this.logLevel){const n=`[Purchases] ${e}`;if(!(this.logLevel<r||r===x.Silent))switch(r){case x.Error:console.error(n);break;case x.Warn:console.warn(n);break;case x.Info:console.info(n);break;case x.Debug:console.debug(n);break;case x.Verbose:console.debug(n);break}}static errorLog(e){this.log(e,x.Error)}static warnLog(e){this.log(e,x.Warn)}static infoLog(e){this.log(e,x.Info)}static debugLog(e){this.log(e,x.Debug)}static verboseLog(e){this.log(e,x.Verbose)}}P(Y,"logLevel",x.Silent);var ie=(t=>(t.Year="year",t.Month="month",t.Week="week",t.Day="day",t))(ie||{});function xe(t){const e=t.match(/^PT?([0-9]+)([MDYW])$/);if(!e||e.length<3)return Y.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 Y.errorLog(`Invalid ISO 8601 unit duration format: ${t}`),null}}const Vt=(t,e,r)=>{const n=t/100;return new Intl.NumberFormat(r,{style:"currency",currency:e}).format(n)},Wt=t=>{const e=t.number;if(e===1)switch(t.unit){case ie.Year:return"yearly";case ie.Month:return"monthly";case ie.Week:return"weekly";case ie.Day:return"daily"}else return`every ${e} ${t.unit}s`},zt=t=>{const e=t.number;if(e===1)switch(t.unit){case ie.Year:return"1 year";case ie.Month:return"1 month";case ie.Week:return"1 week";case ie.Day:return"1 day"}else return`${e} ${t.unit}s`},tt=t=>{const e=xe(t);return e?Wt(e):"unknown"},Xt=t=>{const e=xe(t);return e?zt(e):"unknown"};var nt=(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))(nt||{});const Zt=t=>({amount:t.amount,currency:t.currency,formattedPrice:Vt(t.amount,t.currency)}),rt=t=>{const e=t.period_duration;return{periodDuration:e,period:e?xe(e):null,cycleCount:t.cycle_count,price:t.price?Zt(t.price):null}},en=t=>t.base==null?(Y.debugLog("Missing base phase for subscription option. Ignoring."),null):{id:t.id,priceId:t.price_id,base:rt(t.base),trial:t.trial?rt(t.trial):null},tn=(t,e)=>{const r={};if(Object.entries(t.subscription_options).forEach(([s,l])=>{const c=en(l);c!=null&&(r[s]=c)}),Object.keys(r).length===0)return Y.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 Y.debugLog(`Product ${t.identifier} has no default subscription option. Ignoring.`),null;const o=i.base.price;return o==null?(Y.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}},nn=(t,e,r)=>{const n=r[e.platform_product_identifier];if(n===void 0)return null;const i=tn(n,t);return i===null?null:{identifier:e.identifier,rcBillingProduct:i,packageType:on(e.identifier)}},rn=(t,e,r,n)=>{const i={offeringIdentifier:e.identifier,targetingContext:t&&n?{ruleId:n.rule_id,revision:n.revision}:null},o=e.packages.map(l=>nn(i,l,r)).filter(ee),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 on(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 k(){}function sn(t,e){for(const r in e)t[r]=e[r];return t}function it(t){return t()}function ot(){return Object.create(null)}function ge(t){t.forEach(it)}function se(t){return typeof t=="function"}function Q(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Be;function ne(t,e){return t===e?!0:(Be||(Be=document.createElement("a")),Be.href=e,t===Be.href)}function st(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function ln(t,e){const r=st(t.srcset),n=st(e||"");return n.length===r.length&&n.every(([i,o],s)=>o===r[s][1]&&(ne(r[s][0],i)||ne(i,r[s][0])))}function cn(t){return Object.keys(t).length===0}function W(t,e,r,n){if(t){const i=lt(t,e,r,n);return t[0](i)}}function lt(t,e,r,n){return t[1]&&n?sn(r.ctx.slice(),t[1](n(e))):r.ctx}function z(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 X(t,e,r,n,i,o){if(i){const s=lt(e,r,n,o);t.p(s,i)}}function Z(t){if(t.ctx.length>32){const e=[],r=t.ctx.length/32;for(let n=0;n<r;n++)e[n]=-1;return e}return-1}function me(t){return t??""}function C(t,e){t.appendChild(e)}function F(t,e,r){const n=an(t);if(!n.getElementById(e)){const i=w("style");i.id=e,i.textContent=r,un(n,i)}}function an(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function un(t,e){return C(t.head||t,e),e.sheet}function h(t,e,r){t.insertBefore(e,r||null)}function p(t){t.parentNode&&t.parentNode.removeChild(t)}function w(t){return document.createElement(t)}function S(t){return document.createTextNode(t)}function M(){return S(" ")}function re(){return S("")}function pe(t,e,r,n){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r,n)}function ct(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 fn=["width","height"];function dn(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&&fn.indexOf(n)===-1?t[n]=e[n]:A(t,n,e[n])}function gn(t,e){Object.keys(e).forEach(r=>{mn(t,r,e[r])})}function mn(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 pn(t){return/-/.test(t)?gn:dn}function hn(t){return Array.from(t.childNodes)}function le(t,e){e=""+e,t.data!==e&&(t.data=e)}function at(t,e){t.value=e??""}function _n(t,e,{bubbles:r=!1,cancelable:n=!1}={}){return new CustomEvent(t,{detail:e,bubbles:r,cancelable:n})}let he;function _e(t){he=t}function Ae(){if(!he)throw new Error("Function called outside component initialization");return he}function An(t){Ae().$$.before_update.push(t)}function De(t){Ae().$$.on_mount.push(t)}function En(){const t=Ae();return(e,r,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const o=_n(e,r,{cancelable:n});return i.slice().forEach(s=>{s.call(t,o)}),!o.defaultPrevented}return!0}}function bn(t,e){return Ae().$$.context.set(t,e),e}function In(t){return Ae().$$.context.get(t)}function ut(t,e){const r=t.$$.callbacks[e.type];r&&r.slice().forEach(n=>n.call(this,e))}const ce=[],Pe=[];let ae=[];const Ye=[],wn=Promise.resolve();let Ge=!1;function kn(){Ge||(Ge=!0,wn.then(ft))}function He(t){ae.push(t)}function yn(t){Ye.push(t)}const Ke=new Set;let ue=0;function ft(){if(ue!==0)return;const t=he;do{try{for(;ue<ce.length;){const e=ce[ue];ue++,_e(e),vn(e.$$)}}catch(e){throw ce.length=0,ue=0,e}for(_e(null),ce.length=0,ue=0;Pe.length;)Pe.pop()();for(let e=0;e<ae.length;e+=1){const r=ae[e];Ke.has(r)||(Ke.add(r),r())}ae.length=0}while(ce.length);for(;Ye.length;)Ye.pop()();Ge=!1,Ke.clear(),_e(t)}function vn(t){if(t.fragment!==null){t.update(),ge(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(He)}}function $n(t){const e=[],r=[];ae.forEach(n=>t.indexOf(n)===-1?e.push(n):r.push(n)),r.forEach(n=>n()),ae=e}const Ce=new Set;let oe;function K(){oe={r:0,c:[],p:oe}}function j(){oe.r||ge(oe.c),oe=oe.p}function f(t,e){t&&t.i&&(Ce.delete(t),t.i(e))}function d(t,e,r,n){if(t&&t.o){if(Ce.has(t))return;Ce.add(t),oe.c.push(()=>{Ce.delete(t),n&&(r&&t.d(1),n())}),t.o(e)}else n&&n()}function Bn(t,e,r){const n=t.$$.props[e];n!==void 0&&(t.$$.bound[n]=r,r(t.$$.ctx[n]))}function I(t){t&&t.c()}function E(t,e,r){const{fragment:n,after_update:i}=t.$$;n&&n.m(e,r),He(()=>{const o=t.$$.on_mount.map(it).filter(se);t.$$.on_destroy?t.$$.on_destroy.push(...o):ge(o),t.$$.on_mount=[]}),i.forEach(He)}function b(t,e){const r=t.$$;r.fragment!==null&&($n(r.after_update),ge(r.on_destroy),r.fragment&&r.fragment.d(e),r.on_destroy=r.fragment=null,r.ctx=[])}function Dn(t,e){t.$$.dirty[0]===-1&&(ce.push(t),kn(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function N(t,e,r,n,i,o,s=null,l=[-1]){const c=he;_e(t);const a=t.$$={fragment:null,ctx:[],props:o,update:k,not_equal:i,bound:ot(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:ot(),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||{},(g,_,...y)=>{const $=y.length?y[0]:_;return a.ctx&&i(a.ctx[g],a.ctx[g]=$)&&(!a.skip_bound&&a.bound[g]&&a.bound[g]($),u&&Dn(t,g)),_}):[],a.update(),u=!0,ge(a.before_update),a.fragment=n?n(a.ctx):!1,e.target){if(e.hydrate){const g=hn(e.target);a.fragment&&a.fragment.l(g),g.forEach(p)}else a.fragment&&a.fragment.c();e.intro&&f(t.$$.fragment),E(t,e.target,e.anchor),ft()}_e(c)}class R{constructor(){P(this,"$$");P(this,"$$set")}$destroy(){b(this,1),this.$destroy=k}$on(e,r){if(!se(r))return k;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&&!cn(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Pn="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Pn);function Cn(t){F(t,"svelte-1bzqb13",".rcb-modal-section.svelte-1bzqb13{padding:8px 0px;display:flex}section.rcb-modal-section.svelte-1bzqb13{flex-grow:1}.rcb-modal-section.svelte-1bzqb13:last-of-type{padding:0}")}function je(t){let e,r;const n=t[2].default,i=W(n,t,t[1],null);return{c(){e=w(t[0]),i&&i.c(),pn(t[0])(e,{class:me("rcb-modal-section")+" svelte-1bzqb13"})},m(o,s){h(o,e,s),i&&i.m(e,null),r=!0},p(o,s){i&&i.p&&(!r||s&2)&&X(i,n,o,o[1],r?z(n,o[1],s,null):Z(o[1]),null)},i(o){r||(f(i,o),r=!0)},o(o){d(i,o),r=!1},d(o){o&&p(e),i&&i.d(o)}}}function Tn(t){let e=t[0],r,n,i=t[0]&&je(t);return{c(){i&&i.c(),r=re()},m(o,s){i&&i.m(o,s),h(o,r,s),n=!0},p(o,[s]){o[0]?e?Q(e,o[0])?(i.d(1),i=je(o),e=o[0],i.c(),i.m(r.parentNode,r)):i.p(o,s):(i=je(o),e=o[0],i.c(),i.m(r.parentNode,r)):e&&(i.d(1),i=null,e=o[0])},i(o){n||(f(i,o),n=!0)},o(o){d(i,o),n=!1},d(o){o&&p(r),i&&i.d(o)}}}function Mn(t,e,r){let{$$slots:n={},$$scope:i}=e,{as:o="section"}=e;return t.$$set=s=>{"as"in s&&r(0,o=s.as),"$$scope"in s&&r(1,i=s.$$scope)},[o,i,n]}class fe extends R{constructor(e){super(),N(this,e,Mn,Tn,Q,{as:0},Cn)}}function Qn(t){F(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 Nn(t){let e=Xt(t[1].periodDuration)+"",r,n;return{c(){r=S(e),n=S(" free trial")},m(i,o){h(i,r,o),h(i,n,o)},p:k,d(i){i&&(p(r),p(n))}}}function Rn(t){let e=t[2].formattedPrice+"",r;return{c(){r=S(e)},m(n,i){h(n,r,i)},p:k,d(n){n&&p(r)}}}function Un(t){let e;return{c(){e=w("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){h(r,e,n)},p:k,d(r){r&&p(e)}}}function dt(t){let e,r,n=tt(t[0].normalPeriodDuration)+"",i;return{c(){e=w("li"),r=S("Renews "),i=S(n)},m(o,s){h(o,e,s),C(e,r),C(e,i)},p(o,s){s&1&&n!==(n=tt(o[0].normalPeriodDuration)+"")&&le(i,n)},d(o){o&&p(e)}}}function On(t){var T,Se;let e,r,n=t[0].displayName+"",i,o,s,l,c,a,u,g,_,y,$,D=((T=t[1])==null?void 0:T.periodDuration)&&Nn(t),m=!((Se=t[1])!=null&&Se.periodDuration)&&t[2]&&Rn(t),v=t[1]&&t[2]&&Un(t),U=t[0].normalPeriodDuration&&dt(t);return{c(){e=w("div"),r=w("span"),i=S(n),o=M(),s=w("span"),D&&D.c(),l=M(),m&&m.c(),c=M(),v&&v.c(),a=M(),u=w("ul"),U&&U.c(),g=M(),_=w("li"),_.textContent="Continues until canceled",y=M(),$=w("li"),$.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(G,O){h(G,e,O),C(e,r),C(r,i),C(e,o),C(e,s),D&&D.m(s,null),C(s,l),m&&m.m(s,null),C(e,c),v&&v.m(e,null),C(e,a),C(e,u),U&&U.m(u,null),C(u,g),C(u,_),C(u,y),C(u,$)},p(G,O){var Le,Fe;O&1&&n!==(n=G[0].displayName+"")&&le(i,n),(Le=G[1])!=null&&Le.periodDuration&&D.p(G,O),!((Fe=G[1])!=null&&Fe.periodDuration)&&G[2]&&m.p(G,O),G[1]&&G[2]&&v.p(G,O),G[0].normalPeriodDuration?U?U.p(G,O):(U=dt(G),U.c(),U.m(u,g)):U&&(U.d(1),U=null)},d(G){G&&p(e),D&&D.d(),m&&m.d(),v&&v.d(),U&&U.d()}}}function Sn(t){let e,r;return e=new fe({props:{$$slots:{default:[On]},$$scope:{ctx:t}}}),{c(){I(e.$$.fragment)},m(n,i){E(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){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Ln(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 gt extends R{constructor(e){super(),N(this,e,Ln,Sn,Q,{productDetails:0,purchaseOption:3},Qn)}}const Fn="data:image/gif;base64,R0lGODlhMgAyAPcBAAAAAAD/AAMDAwcHBxERERUVFSoqKi0tLTAwMDg4OD09PURERElJSUtLS1BQUFJSUlVVVVdXV1paWl9fX2NjY2ZmZmlpaWxsbG1tbXNzc3t7e39/f4GBgYKCgoSEhIaGhoeHh4iIiIuLi5KSkpSUlJaWlp2dnaGhoaOjo6SkpKWlpaenp6ioqKqqqqurq6ysrLCwsLGxsbS0tLa2tri4uLm5ub29vb6+vsDAwMHBwcLCwsXFxcjIyMnJyc3Nzc7OztPT09TU1NXV1dfX19nZ2dra2tvb29zc3N7e3uDg4OHh4eLi4uPj4+fn5+np6ezs7O7u7vDw8PHx8fLy8vPz8/X19fb29vj4+Pn5+fz8/P39/f7+/v///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH/C05FVFNDQVBFMi4wAwEAAAAh+QQFBAABACwAAAAAMgAyAIcAAAAA/wADAwMHBwcREREVFRUqKiotLS0wMDA4ODg9PT1ERERJSUlLS0tQUFBSUlJVVVVXV1daWlpfX19jY2NmZmZpaWlsbGxtbW1zc3N7e3t/f3+BgYGCgoKEhISGhoaHh4eIiIiLi4uSkpKUlJSWlpadnZ2hoaGjo6OkpKSlpaWnp6eoqKiqqqqrq6usrKywsLCxsbG0tLS2tra4uLi5ubm9vb2+vr7AwMDBwcHCwsLFxcXIyMjJycnNzc3Ozs7T09PU1NTV1dXX19fZ2dna2trb29vc3Nze3t7g4ODh4eHi4uLj4+Pn5+fp6ens7Ozu7u7w8PDx8fHy8vLz8/P19fX29vb4+Pj5+fn8/Pz9/f3+/v7///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8I/wCzcBFIcKDBgggPKkzIcCEXLlq4bIEokeLEiBcrYrTIcaNHjRobinQ4sqRCkBlTdtR44MBKlR9TmjQJQMBMkgZfdpwSMSYAACgpRtHpcSYSFUIa1mz448UQnAWDfmzSooUVmD9XVnnBwglMlDdvvMjhcOlCHit23CSqcUrVJiizpnTC4sXQmB1vZvmxwgYWhWYLznjRA+rJryqvxGhxxGNLjkVcwMCCN6ZeLkNevDCcRYYKJJfZptyCQwdiijl0CDxdlLPryw2lymY9WzTs17ijVq69mzbM28Bd8x7u23bu46F7i16uXEvw5ziJM5duGbl1k9OLN5cKvfvh7OC3b0jxTv6h+PDUy3unzl67RPXXc56fnz4+/PbofcOHnr9/5f3x4UeffvYVqJuACP5m4IIJ+gfWgusN6KCCAN7WoITVVXjchBxqERAAIfkEBQQAAQAsDQADACAAEAAACKcAAwgcSDDAAwcFEypcSNDAAYYQA2DZstCAAYZOKCqM8uNJxYcKa3DYsVBKECBYFFpU+MTDhiIMkQxBohJkwRYaUkDEEiQIlYQrCyLZ0MFJRCdAkgC1OZBEBxgRJRIBAqXgwYI8NoCwEjWAkyFDoorQ4KOrQCRLoqbQuZCKR7NdqzD5MaQKXIhZmAwBIqTJ3YVYogQZ8oMJ178Kk/A1YhfxQiRHjBYMCAAh+QQFBQABACwNAAMAIAAQAAAInQADCBxIMECGDAUTKlxI8EEEhhADcGEI4QFDJQy5ZJmo0OFCFBFkLNzCRQvHghEgKHQi4cEPhhuzdHyYUMQDDxC5kNSSsGLCIA4x5oxZ0GNBDBFKRAxgkmTBgwVpRJhAZWkAohErPKhhVaLJpR8+YFnohEjXrlB2qHgB5SxELD5etHgBxC1DJC9eqOAxxe5CHSxc0HDilyEOGWYLBgQAIfkEBQQAAQAsGAADABcAFwAACJYAS5AIQLCgwYMINXBAyLDhhg0NtxRpWFBDh4YiDpygGOAhwyUIDOTgqJAh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qkxQUTat3Djyp1b0UbDjXdhBqUxcWTfhHQDCx5MuCIXLVy2vOWShTEXsVsOJz6stbHlx1ojI1b8tvHbgAAAIfkEBQQAAQAsAwADABcAFwAACJQAAwgcSLCgwRIkDCpcqIHDwoFHHm7Y8DCACgMJFWroUBGHgQNMFE6sGGDCAQsaHVY8csAAD4MjSX4w8MDgRpIBoCQwsKIgQpwBUBxIULEHkYcUUC580tDEE6AGbXSYKKMKVIJSUnDQIGIHl6sQS0w8AZagjxAsyqpdy7at24pJfgwBMkQukCRQjQQBIgTIXiFGoAYEACH5BAUFAAEALAMAAwAXABcAAAiVAAMIHEiwoMEMGQwqXPggwsKBTLQshPDgYYAaD1owdPjQB4QIThRGgGAxwIYIIBQ2LMlkJBCDFEsGOPEgA5aCK0tKmQChRkGEMgPIiDDhoRYjTR56CPGwiooXN6oENQikhYsWP65MJXglx4sVMoZsJdikRosWOMYSRPJih9q3cOPKnWuRSxa7eO9O3cJFCxe+frdMDQgAIfkEBQUAAQAsBQADACAAEAAACKYAAwgcSLAgwQcODCpcyNDAAYYQAzhpaIDhFYY+NOBY6HAhkyETFRLZ0CGKQgMVDV4RAoQKQxMdUpx8aJAJECYQnWzYcMQgSoNVgAy5CHGGhhI+aRIkMgRnxCohNvQoiLDgEyFDskQUuINDiK1Hfpgc+ETKQi0nVGxNkkSrwCw/hiBxu7XuFidAhARpgqWu3yxIhgApEtLvVipIgARBYthvlKaNFQYEADs=";function xn(t){let e,r;return{c(){e=w("img"),ne(e.src,r=Fn)||A(e,"src",r),A(e,"alt","spinner")},m(n,i){h(n,e,i)},p:k,i:k,o:k,d(n){n&&p(e)}}}class Yn extends R{constructor(e){super(),N(this,e,null,xn,Q,{})}}function Gn(t){F(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 Hn(t){let e,r,n;return r=new Yn({}),{c(){e=w("div"),I(r.$$.fragment),A(e,"class","rcb-modal-loader svelte-1mxx341")},m(i,o){h(i,e,o),E(r,e,null),n=!0},p:k,i(i){n||(f(r.$$.fragment,i),n=!0)},o(i){d(r.$$.fragment,i),n=!1},d(i){i&&p(e),b(r)}}}class qe extends R{constructor(e){super(),N(this,e,null,Hn,Q,{},Gn)}}var V=(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))(V||{});class Ee{static getPublicMessage(e){switch(e){case 0:return"Unknown error.";case 1:return"Purchase was cancelled.";case 2:return"There was a problem with the store.";case 3:return"The device or user is not allowed to make the purchase.";case 4:return"One or more of the arguments provided are invalid.";case 5:return"The product is not available for purchase.";case 6:return"This product is already active for the user.";case 7:return"There is already another active subscriber using the same receipt.";case 8:return"The receipt is not valid.";case 9:return"The receipt is missing.";case 10:return"Error performing request.";case 11:return"There was a credentials issue. Check the underlying error for more details.";case 12:return"Received unexpected response from the backend.";case 14:return"The app user id is not valid.";case 15:return"The operation is already in progress.";case 16:return"There was an unknown backend error.";case 17:return"Apple Subscription Key is invalid or not present. In order to provide subscription offers, you must first generate a subscription key. Please see https://docs.revenuecat.com/docs/ios-subscription-offers for more info.";case 18:return"The User is ineligible for that action.";case 19:return"App does not have sufficient permissions to make purchases.";case 20:return"The payment is pending.";case 21:return"One or more of the attributes sent could not be saved.";case 22:return"Called logOut but the current user is anonymous.";case 23:return"There is an issue with your configuration. Check the underlying error for more details.";case 24:return"There was a problem with the operation. Looks like we doesn't support that yet. Check the underlying error for more details.";case 25:return"A request for subscriber attributes returned none.";case 28:return"There was a problem related to the customer info.";case 36:return"Request failed signature verification. Please see https://rev.cat/trusted-entitlements for more info.";case 38:return"Email is not valid. Please provide a valid email address."}}static getErrorCodeForBackendErrorCode(e){switch(e){case 7101:return 2;case 7102:return 7;case 7103:return 8;case 7107:case 7224:case 7225:return 11;case 7105:case 7106: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 mt?e:null}static convertPurchaseFlowErrorCodeToErrorCode(e){switch(e){case L.ErrorSettingUpPurchase:return 2;case L.ErrorChargingPayment:return 20;case L.NetworkError:return 10;case L.MissingEmailError:return 4;case L.StripeError:return 2;case L.UnknownError:return 0;case L.AlreadySubscribedError:return 6}}}var mt=(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.BackendOfferNotFound=7814]="BackendOfferNotFound",t[t.BackendNoMXRecordsFound=7834]="BackendNoMXRecordsFound",t))(mt||{});class J extends Error{constructor(r,n,i){super(n);P(this,"toString",()=>`PurchasesError(code: ${V[this.errorCode]}, message: ${this.message})`);this.errorCode=r,this.underlyingErrorMessage=i}static getForBackendError(r,n){const i=Ee.getErrorCodeForBackendErrorCode(r);return new J(i,Ee.getPublicMessage(i),n)}static getForPurchasesFlowError(r){return new J(Ee.convertPurchaseFlowErrorCodeToErrorCode(r.errorCode),r.message,r.underlyingErrorMessage)}}class pt extends Error{constructor(){super("Purchases must be configured before calling getInstance")}}var be=(t=>(t.Started="started",t.InProgress="in_progress",t.Succeeded="succeeded",t.Failed="failed",t))(be||{}),Te=(t=>(t[t.SetupIntentCreationFailed=1]="SetupIntentCreationFailed",t[t.PaymentMethodCreationFailed=2]="PaymentMethodCreationFailed",t[t.PaymentChargeFailed=3]="PaymentChargeFailed",t))(Te||{}),L=(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))(L||{});class q extends Error{constructor(e,r,n){super(r),this.errorCode=e,this.underlyingErrorMessage=n}static fromPurchasesError(e,r){let n;return e.errorCode===V.ProductAlreadyPurchasedError?n=6:e.errorCode===V.InvalidEmailError?n=5:n=r,new q(n,e.message,e.underlyingErrorMessage)}}class Kn{constructor(e,r=10){P(this,"operationSessionId",null);P(this,"backend");P(this,"maxNumberAttempts");P(this,"waitMSBetweenAttempts",1e3);this.backend=e,this.maxNumberAttempts=r}async startPurchase(e,r,n,i,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 J)throw q.fromPurchasesError(s,0);{const l="Unknown error starting purchase: "+String(s);throw Y.errorLog(l),new q(2,l)}}}async pollCurrentPurchaseForCompletion(){const e=this.operationSessionId;if(!e)throw new q(0,"No purchase in progress");return new Promise((r,n)=>{const i=(o=1)=>{if(o>this.maxNumberAttempts){this.clearPurchaseInProgress(),n(new q(2,"Max attempts reached trying to get successful purchase status"));return}this.backend.getCheckoutStatus(e).then(s=>{switch(s.operation.status){case be.Started:case be.InProgress:setTimeout(()=>i(o+1),this.waitMSBetweenAttempts);break;case be.Succeeded:this.clearPurchaseInProgress(),r();return;case be.Failed:this.clearPurchaseInProgress(),this.handlePaymentError(s.operation.error,n)}}).catch(s=>{const l=q.fromPurchasesError(s,3);n(l)})};i()})}clearPurchaseInProgress(){this.operationSessionId=null}handlePaymentError(e,r){if(e==null){r(new q(2,"Got an error status but error field is empty."));return}switch(e.code){case Te.SetupIntentCreationFailed:r(new q(0,"Setup intent creation failed"));return;case Te.PaymentMethodCreationFailed:r(new q(0,"Payment method creation failed"));return;case Te.PaymentChargeFailed:r(new q(1,"Payment charge failed"));return}}}const jn="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 qn(t){F(t,"svelte-1609h93","img.svelte-1609h93{width:124px;height:124px;margin:0 auto}")}function Jn(t){let e,r;return{c(){e=w("img"),ne(e.src,r=jn)||A(e,"src",r),A(e,"alt","icon"),A(e,"class","rcb-ui-asset-icon svelte-1609h93")},m(n,i){h(n,e,i)},p:k,i:k,o:k,d(n){n&&p(e)}}}class Vn extends R{constructor(e){super(),N(this,e,null,Jn,Q,{},qn)}}function Wn(t){F(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 zn(t){let e,r,n,i,o;const s=t[4].default,l=W(s,t,t[3],null);return{c(){e=w("button"),l&&l.c(),A(e,"class",r=me(`intent-${t[0]}`)+" svelte-1rmxk7q"),e.disabled=t[1],A(e,"data-testid",t[2])},m(c,a){h(c,e,a),l&&l.m(e,null),n=!0,i||(o=pe(e,"click",t[5]),i=!0)},p(c,[a]){l&&l.p&&(!n||a&8)&&X(l,s,c,c[3],n?z(s,c[3],a,null):Z(c[3]),null),(!n||a&1&&r!==(r=me(`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){d(l,c),n=!1},d(c){c&&p(e),l&&l.d(c),i=!1,o()}}}function Xn(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){ut.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 Ie extends R{constructor(e){super(),N(this,e,Xn,zn,Q,{intent:0,disabled:1,testId:2},Wn)}}function Zn(t){F(t,"svelte-1f9z0o8","footer.svelte-1f9z0o8{display:flex;flex-direction:column}")}function er(t){let e,r;const n=t[1].default,i=W(n,t,t[0],null);return{c(){e=w("footer"),i&&i.c(),A(e,"class","rcb-modal-footer svelte-1f9z0o8")},m(o,s){h(o,e,s),i&&i.m(e,null),r=!0},p(o,[s]){i&&i.p&&(!r||s&1)&&X(i,n,o,o[0],r?z(n,o[0],s,null):Z(o[0]),null)},i(o){r||(f(i,o),r=!0)},o(o){d(i,o),r=!1},d(o){o&&p(e),i&&i.d(o)}}}function tr(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(0,i=o.$$scope)},[i,n]}class Je extends R{constructor(e){super(),N(this,e,tr,er,Q,{},Zn)}}function nr(t){F(t,"svelte-6o8e90",'.column.svelte-6o8e90{display:flex;flex-direction:column;justify-content:flex-start;gap:var(--gap, "8px");flex-grow:1}')}function rr(t){let e,r,n;const i=t[2].default,o=W(i,t,t[1],null);return{c(){e=w("div"),o&&o.c(),A(e,"class","column svelte-6o8e90"),A(e,"style",r=`--gap:${t[0]};`)},m(s,l){h(s,e,l),o&&o.m(e,null),n=!0},p(s,[l]){o&&o.p&&(!n||l&2)&&X(o,i,s,s[1],n?z(i,s[1],l,null):Z(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){d(o,s),n=!1},d(s){s&&p(e),o&&o.d(s)}}}function ir(t,e,r){let{$$slots:n={},$$scope:i}=e,{gutter:o="8px"}=e;return t.$$set=s=>{"gutter"in s&&r(0,o=s.gutter),"$$scope"in s&&r(1,i=s.$$scope)},[o,i,n]}class we extends R{constructor(e){super(),N(this,e,ir,rr,Q,{gutter:0},nr)}}const or="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){F(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"),ne(r.src,n=or)||A(r,"src",n),A(r,"alt","close"),A(e,"class","close-button svelte-14xreta"),e.disabled=t[0]},m(s,l){h(s,e,l),C(e,r),i||(o=pe(e,"click",t[1]),i=!0)},p(s,[l]){l&1&&(e.disabled=s[0])},i:k,o:k,d(s){s&&p(e),i=!1,o()}}}function cr(t,e,r){let{disabled:n=!1}=e;function i(o){ut.call(this,t,o)}return t.$$set=o=>{"disabled"in o&&r(0,n=o.disabled)},[n,i]}class ar extends R{constructor(e){super(),N(this,e,cr,lr,Q,{disabled:0},sr)}}function ur(t){F(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 fr(t){let e;return{c(){e=w("div"),A(e,"class","rcb-app-icon loading svelte-44qpq9")},m(r,n){h(r,e,n)},p:k,d(r){r&&p(e)}}}function dr(t){let e,r,n,i,o,s;return{c(){e=w("picture"),r=w("source"),i=M(),o=w("img"),A(r,"type","image/webp"),ln(r,n=t[1])||A(r,"srcset",n),A(o,"class","rcb-app-icon svelte-44qpq9"),ne(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){h(l,e,c),C(e,r),C(e,i),C(e,o)},p(l,c){c&2&&n!==(n=l[1])&&A(r,"srcset",n),c&1&&!ne(o.src,s=l[0])&&A(o,"src",s)},d(l){l&&p(e)}}}function gr(t){let e;function r(o,s){return o[0]!==null?dr:fr}let n=r(t),i=n(t);return{c(){i.c(),e=re()},m(o,s){i.m(o,s),h(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:k,o:k,d(o){o&&p(e),i.d(o)}}}function mr(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 ht extends R{constructor(e){super(),N(this,e,mr,gr,Q,{src:0,srcWebp:1},ur)}}const Me=t=>`https://da08ctfrofx1b.cloudfront.net/${t}`;function pr(t){F(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 hr(t){let e,r;return e=new ht({}),{c(){I(e.$$.fragment)},m(n,i){E(e,n,i),r=!0},p:k,i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function _r(t){let e,r,n=t[0].seller_company_name+"",i,o,s=t[0].app_icon_webp!==null&&t[0].app_icon!==null&&_t(t);return{c(){s&&s.c(),e=M(),r=w("span"),i=S(n),A(r,"class","app-title svelte-10uf5fq")},m(l,c){s&&s.m(l,c),h(l,e,c),h(l,r,c),C(r,i),o=!0},p(l,c){l[0].app_icon_webp!==null&&l[0].app_icon!==null?s?(s.p(l,c),c&1&&f(s,1)):(s=_t(l),s.c(),f(s,1),s.m(e.parentNode,e)):s&&(K(),d(s,1,1,()=>{s=null}),j()),(!o||c&1)&&n!==(n=l[0].seller_company_name+"")&&le(i,n)},i(l){o||(f(s),o=!0)},o(l){d(s),o=!1},d(l){l&&(p(e),p(r)),s&&s.d(l)}}}function _t(t){let e,r;return e=new ht({props:{src:Me(t[0].app_icon),srcWebp:Me(t[0].app_icon_webp)}}),{c(){I(e.$$.fragment)},m(n,i){E(e,n,i),r=!0},p(n,i){const o={};i&1&&(o.src=Me(n[0].app_icon)),i&1&&(o.srcWebp=Me(n[0].app_icon_webp)),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Ar(t){let e,r,n,i;const o=[_r,hr],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(),A(e,"class","rcb-header-layout__business-info svelte-10uf5fq")},m(c,a){h(c,e,a),s[r].m(e,null),i=!0},p(c,[a]){let u=r;r=l(c),r===u?s[r].p(c,a):(K(),d(s[u],1,1,()=>{s[u]=null}),j(),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){d(n),i=!1},d(c){c&&p(e),s[r].d()}}}function Er(t,e,r){let{brandingInfo:n=null}=e;return t.$$set=i=>{"brandingInfo"in i&&r(0,n=i.brandingInfo)},[n]}class At extends R{constructor(e){super(),N(this,e,Er,Ar,Q,{brandingInfo:0},pr)}}function br(t){F(t,"svelte-17puakv",".rcb-post-purchase-header-layout.svelte-17puakv{display:flex;justify-content:space-between;align-items:center;width:100%;margin-top:-4px}")}function Ir(t){let e,r,n,i,o;return r=new At({props:{brandingInfo:t[0]}}),i=new ar({}),i.$on("click",function(){se(t[1])&&t[1].apply(this,arguments)}),{c(){e=w("div"),I(r.$$.fragment),n=M(),I(i.$$.fragment),A(e,"class","rcb-post-purchase-header-layout svelte-17puakv")},m(s,l){h(s,e,l),E(r,e,null),C(e,n),E(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){d(r.$$.fragment,s),d(i.$$.fragment,s),o=!1},d(s){s&&p(e),b(r),b(i)}}}function wr(t){let e,r;return e=new fe({props:{as:"header",$$slots:{default:[Ir]},$$scope:{ctx:t}}}),{c(){I(e.$$.fragment)},m(n,i){E(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){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function kr(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 yr extends R{constructor(e){super(),N(this,e,kr,wr,Q,{brandingInfo:0,onClose:1},br)}}function vr(t){F(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 $r=t=>({}),Et=t=>({});function Br(t){let e,r,n,i,o;const s=t[4].default,l=W(s,t,t[5],null);return{c(){e=w("span"),r=S(t[2]),n=M(),i=w("span"),l&&l.c(),A(e,"class","title svelte-10pcqja"),A(i,"class","subtitle svelte-10pcqja")},m(c,a){h(c,e,a),C(e,r),h(c,n,a),h(c,i,a),l&&l.m(i,null),o=!0},p(c,a){(!o||a&4)&&le(r,c[2]),l&&l.p&&(!o||a&32)&&X(l,s,c,c[5],o?z(s,c[5],a,null):Z(c[5]),null)},i(c){o||(f(l,c),o=!0)},o(c){d(l,c),o=!1},d(c){c&&(p(e),p(n),p(i)),l&&l.d(c)}}}function Dr(t){let e,r,n;const i=t[4].icon,o=W(i,t,t[5],Et);return r=new we({props:{gutter:"16px",$$slots:{default:[Br]},$$scope:{ctx:t}}}),{c(){o&&o.c(),e=M(),I(r.$$.fragment)},m(s,l){o&&o.m(s,l),h(s,e,l),E(r,s,l),n=!0},p(s,l){o&&o.p&&(!n||l&32)&&X(o,i,s,s[5],n?z(i,s[5],l,$r):Z(s[5]),Et);const c={};l&36&&(c.$$scope={dirty:l,ctx:s}),r.$set(c)},i(s){n||(f(o,s),f(r.$$.fragment,s),n=!0)},o(s){d(o,s),d(r.$$.fragment,s),n=!1},d(s){s&&p(e),o&&o.d(s),b(r,s)}}}function Pr(t){let e,r,n;return r=new we({props:{gutter:"16px",$$slots:{default:[Dr]},$$scope:{ctx:t}}}),{c(){e=w("div"),I(r.$$.fragment),A(e,"class","rcb-modal-message svelte-10pcqja"),A(e,"data-type",t[3])},m(i,o){h(i,e,o),E(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){d(r.$$.fragment,i),n=!1},d(i){i&&p(e),b(r)}}}function Cr(t){let e;return{c(){e=S("Go back to app")},m(r,n){h(r,e,n)},d(r){r&&p(e)}}}function Tr(t){let e,r;return e=new Ie({props:{$$slots:{default:[Cr]},$$scope:{ctx:t}}}),e.$on("click",function(){se(t[1])&&t[1].apply(this,arguments)}),{c(){I(e.$$.fragment)},m(n,i){E(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){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Mr(t){let e,r,n,i,o,s;return e=new yr({props:{brandingInfo:t[0],onClose:t[1]}}),n=new fe({props:{$$slots:{default:[Pr]},$$scope:{ctx:t}}}),o=new Je({props:{$$slots:{default:[Tr]},$$scope:{ctx:t}}}),{c(){I(e.$$.fragment),r=M(),I(n.$$.fragment),i=M(),I(o.$$.fragment)},m(l,c){E(e,l,c),h(l,r,c),E(n,l,c),h(l,i,c),E(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 g={};c&34&&(g.$$scope={dirty:c,ctx:l}),o.$set(g)},i(l){s||(f(e.$$.fragment,l),f(n.$$.fragment,l),f(o.$$.fragment,l),s=!0)},o(l){d(e.$$.fragment,l),d(n.$$.fragment,l),d(o.$$.fragment,l),s=!1},d(l){l&&(p(r),p(i)),b(e,l),b(n,l),b(o,l)}}}function Qr(t){let e,r;return e=new we({props:{gutter:"32px",$$slots:{default:[Mr]},$$scope:{ctx:t}}}),{c(){I(e.$$.fragment)},m(n,i){E(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){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Nr(t,e,r){let{$$slots:n={},$$scope:i}=e,{brandingInfo:o=null}=e,{onContinue:s}=e,{title:l}=e,{type:c}=e;return t.$$set=a=>{"brandingInfo"in a&&r(0,o=a.brandingInfo),"onContinue"in a&&r(1,s=a.onContinue),"title"in a&&r(2,l=a.title),"type"in a&&r(3,c=a.type),"$$scope"in a&&r(5,i=a.$$scope)},[o,s,l,c,n,i]}class bt extends R{constructor(e){super(),N(this,e,Nr,Qr,Q,{brandingInfo:0,onContinue:1,title:2,type:3},vr)}}function It(t){let e,r,n,i,o;return{c(){e=S("If this error persists, please contact "),r=w("a"),n=S(t[1]),o=S("."),A(r,"href",i="mailto:"+t[1])},m(s,l){h(s,e,l),h(s,r,l),C(r,n),h(s,o,l)},p(s,l){l&2&&le(n,s[1]),l&2&&i!==(i="mailto:"+s[1])&&A(r,"href",i)},d(s){s&&(p(e),p(r),p(o))}}}function Rr(t){let e=t[3]()+"",r,n,i,o=t[1]&&It(t);return{c(){r=S(e),n=M(),o&&o.c(),i=re()},m(s,l){h(s,r,l),h(s,n,l),o&&o.m(s,l),h(s,i,l)},p(s,l){s[1]?o?o.p(s,l):(o=It(s),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null)},d(s){s&&(p(r),p(n),p(i)),o&&o.d(s)}}}function Ur(t){let e,r;return e=new Vn({props:{slot:"icon"}}),{c(){I(e.$$.fragment)},m(n,i){E(e,n,i),r=!0},p:k,i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Or(t){let e,r;return e=new bt({props:{title:t[4](),brandingInfo:t[0],onContinue:t[2],type:"error",$$slots:{icon:[Ur],default:[Rr]},$$scope:{ctx:t}}}),{c(){I(e.$$.fragment)},m(n,i){E(e,n,i),r=!0},p(n,[i]){const o={};i&1&&(o.brandingInfo=n[0]),i&4&&(o.onContinue=n[2]),i&66&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Sr(t,e,r){let{brandingInfo:n=null}=e,{lastError:i}=e,{supportEmail:o=null}=e,{onContinue:s}=e;De(()=>{Y.errorLog(`Displayed error: ${L[i.errorCode]}. Message: ${i.message??"None"}. Underlying error: ${i.underlyingErrorMessage??"None"}`)});function l(){switch(i.errorCode){case L.UnknownError:return"An unknown error occurred.";case L.ErrorSettingUpPurchase:return"Purchase not started due to an error.";case L.ErrorChargingPayment:return"Payment failed.";case L.NetworkError:return"Network error. Please check your internet connection.";case L.StripeError:return i.message;case L.MissingEmailError:return"Email is required to complete the purchase.";case L.AlreadySubscribedError:return"You are already subscribed to this product."}return i.message}function c(){switch(i.errorCode){case L.AlreadySubscribedError:return"Already subscribed";default:return"Something went wrong"}}return t.$$set=a=>{"brandingInfo"in a&&r(0,n=a.brandingInfo),"lastError"in a&&r(5,i=a.lastError),"supportEmail"in a&&r(1,o=a.supportEmail),"onContinue"in a&&r(2,s=a.onContinue)},[n,o,s,l,c,i]}class Lr extends R{constructor(e){super(),N(this,e,Sr,Or,Q,{brandingInfo:0,lastError:5,supportEmail:1,onContinue:2})}}const Fr="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 xr(t){F(t,"svelte-1609h93","img.svelte-1609h93{width:124px;height:124px;margin:0 auto}")}function Yr(t){let e,r;return{c(){e=w("img"),ne(e.src,r=Fr)||A(e,"src",r),A(e,"alt","icon"),A(e,"class","rcb-ui-asset-icon svelte-1609h93")},m(n,i){h(n,e,i)},p:k,i:k,o:k,d(n){n&&p(e)}}}class Gr extends R{constructor(e){super(),N(this,e,null,Yr,Q,{},xr)}}function Hr(t){let e;return{c(){e=S("Your plan is now active.")},m(r,n){h(r,e,n)},d(r){r&&p(e)}}}function Kr(t){let e,r;return e=new Gr({props:{slot:"icon"}}),{c(){I(e.$$.fragment)},m(n,i){E(e,n,i),r=!0},p:k,i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function jr(t){let e,r;return e=new bt({props:{type:"success",title:"Purchase successful",brandingInfo:t[0],onContinue:t[1],$$slots:{icon:[Kr],default:[Hr]},$$scope:{ctx:t}}}),{c(){I(e.$$.fragment)},m(n,i){E(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){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function qr(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 Jr extends R{constructor(e){super(),N(this,e,qr,jr,Q,{brandingInfo:0,onContinue:1})}}function Vr(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 Wr=typeof window>"u";function zr(t){if(!Wr)return t.registerAppInfo({name:"svelte-stripe-js",url:"https://svelte-stripe-js.vercel.app"})}function Xr(t){let e;return{c(){e=w("div")},m(r,n){h(r,e,n),t[6](e)},p:k,i:k,o:k,d(r){r&&p(e),t[6](null)}}}function Zr(t,e,r){let n,i;const o=En(),{elements:s}=In("stripe");let{options:l=void 0}=e;De(()=>(n=Vr(i,"payment",s,o,l),()=>n.destroy()));function c(){n.blur()}function a(){n.clear()}function u(){n.destroy()}function g(){n.focus()}function _(y){Pe[y?"unshift":"push"](()=>{i=y,r(0,i)})}return t.$$set=y=>{"options"in y&&r(1,l=y.options)},[i,l,c,a,u,g,_]}class ei extends R{constructor(e){super(),N(this,e,Zr,Xr,Q,{options:1,blur:2,clear:3,destroy:4,focus:5})}get blur(){return this.$$.ctx[2]}get clear(){return this.$$.ctx[3]}get destroy(){return this.$$.ctx[4]}get focus(){return this.$$.ctx[5]}}function wt(t){let e;const r=t[15].default,n=W(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)&&X(n,r,i,i[14],e?z(r,i[14],o,null):Z(i[14]),null)},i(i){e||(f(n,i),e=!0)},o(i){d(n,i),e=!1},d(i){n&&n.d(i)}}}function ti(t){let e,r,n=t[1]&&t[0]&&wt(t);return{c(){n&&n.c(),e=re()},m(i,o){n&&n.m(i,o),h(i,e,o),r=!0},p(i,[o]){i[1]&&i[0]?n?(n.p(i,o),o&3&&f(n,1)):(n=wt(i),n.c(),f(n,1),n.m(e.parentNode,e)):n&&(K(),d(n,1,1,()=>{n=null}),j())},i(i){r||(f(n),r=!0)},o(i){d(n),r=!1},d(i){i&&p(e),n&&n.d(i)}}}function ni(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:g="above"}=e,{loader:_="auto"}=e,{fonts:y=[]}=e,{locale:$="auto"}=e,{currency:D=void 0}=e,{amount:m=void 0}=e,{clientSecret:v=void 0}=e,{elements:U=null}=e;return t.$$set=T=>{"stripe"in T&&r(1,s=T.stripe),"mode"in T&&r(2,l=T.mode),"theme"in T&&r(3,c=T.theme),"variables"in T&&r(4,a=T.variables),"rules"in T&&r(5,u=T.rules),"labels"in T&&r(6,g=T.labels),"loader"in T&&r(7,_=T.loader),"fonts"in T&&r(8,y=T.fonts),"locale"in T&&r(9,$=T.locale),"currency"in T&&r(10,D=T.currency),"amount"in T&&r(11,m=T.amount),"clientSecret"in T&&r(12,v=T.clientSecret),"elements"in T&&r(0,U=T.elements),"$$scope"in T&&r(14,o=T.$$scope)},t.$$.update=()=>{t.$$.dirty&120&&r(13,n={theme:c,variables:a,rules:u,labels:g}),t.$$.dirty&16263&&s&&!U&&(r(0,U=s.elements({mode:l,currency:D,amount:m,appearance:n,clientSecret:v,fonts:y,loader:_,locale:$})),zr(s),bn("stripe",{stripe:s,elements:U})),t.$$.dirty&8705&&U&&U.update({appearance:n,locale:$})},[U,s,l,c,a,u,g,_,y,$,D,m,v,n,o,i]}class ri extends R{constructor(e){super(),N(this,e,ni,ti,Q,{stripe:1,mode:2,theme:3,variables:4,rules:5,labels:6,loader:7,fonts:8,locale:9,currency:10,amount:11,clientSecret:12,elements:0})}}var kt="https://js.stripe.com/v3",ii=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,yt="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",oi=function(){for(var e=document.querySelectorAll('script[src^="'.concat(kt,'"]')),r=0;r<e.length;r++){var n=e[r];if(ii.test(n.src))return n}return null},vt=function(e){var r=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(kt).concat(r);var i=document.head||document.body;if(!i)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return i.appendChild(n),n},si=function(e,r){!e||!e._registerWrapper||e._registerWrapper({name:"stripe-js",version:"2.4.0",startTime:r})},ke=null,Qe=null,Ne=null,li=function(e){return function(){e(new Error("Failed to load Stripe.js"))}},ci=function(e,r){return function(){window.Stripe?e(window.Stripe):r(new Error("Stripe.js not available"))}},ai=function(e){return ke!==null?ke:(ke=new Promise(function(r,n){if(typeof window>"u"||typeof document>"u"){r(null);return}if(window.Stripe&&e&&console.warn(yt),window.Stripe){r(window.Stripe);return}try{var i=oi();if(i&&e)console.warn(yt);else if(!i)i=vt(e);else if(i&&Ne!==null&&Qe!==null){var o;i.removeEventListener("load",Ne),i.removeEventListener("error",Qe),(o=i.parentNode)===null||o===void 0||o.removeChild(i),i=vt(e)}Ne=ci(r,n),Qe=li(n),i.addEventListener("load",Ne),i.addEventListener("error",Qe)}catch(s){n(s);return}}),ke.catch(function(r){return ke=null,Promise.reject(r)}))},ui=function(e,r,n){if(e===null)return null;var i=e.apply(void 0,r);return si(i,n),i},ye,$t=!1,Bt=function(){return ye||(ye=ai(null).catch(function(e){return ye=null,Promise.reject(e)}),ye)};Promise.resolve().then(function(){return Bt()}).catch(function(t){$t||console.warn(t)});var fi=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];$t=!0;var i=Date.now();return Bt().then(function(o){return ui(o,r,i)})};function di(t){F(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 gi(t){let e,r;const n=t[0].default,i=W(n,t,t[1],null);return{c(){e=w("div"),i&&i.c(),A(e,"class","rcb-header-layout svelte-1xe711j")},m(o,s){h(o,e,s),i&&i.m(e,null),r=!0},p(o,s){i&&i.p&&(!r||s&2)&&X(i,n,o,o[1],r?z(n,o[1],s,null):Z(o[1]),null)},i(o){r||(f(i,o),r=!0)},o(o){d(i,o),r=!1},d(o){o&&p(e),i&&i.d(o)}}}function mi(t){let e,r;return e=new fe({props:{as:"header",$$slots:{default:[gi]},$$scope:{ctx:t}}}),{c(){I(e.$$.fragment)},m(n,i){E(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){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function pi(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(1,i=o.$$scope)},[n,i]}class Ve extends R{constructor(e){super(),N(this,e,pi,mi,Q,{},di)}}const hi="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 _i(t){let e,r;return{c(){e=w("img"),ne(e.src,r=hi)||A(e,"src",r),A(e,"alt","icon"),A(e,"class","rcb-ui-asset-icon")},m(n,i){h(n,e,i)},p:k,i:k,o:k,d(n){n&&p(e)}}}class Ai extends R{constructor(e){super(),N(this,e,null,_i,Q,{})}}const ve={error:"#f2545b",warning:"#f4e971",focus:"#000080","grey-text-dark":"#000000","grey-text-light":"#767676","grey-ui-dark":"#dfdfdf",white:"#ffffff"};function Ei(t){F(t,"svelte-rjmul6",`.processing.svelte-rjmul6{width:12px;aspect-ratio:1;border-radius:50%;animation:svelte-rjmul6-l5 1.5s infinite linear}@keyframes svelte-rjmul6-l5{0%{box-shadow:20px 0 #fff2,
2
2
  -20px 0 #fff2;background:#fff2}25%{box-shadow:20px 0 #fff2,
3
3
  -20px 0 #ffff;background:#fff2}50%{box-shadow:20px 0 #fff2,
4
4
  -20px 0 #fff2;background:#ffff}75%{box-shadow:20px 0 #ffff,
5
5
  -20px 0 #fff2;background:#fff2}100%{box-shadow:20px 0 #fff2,
6
- -20px 0 #fff2;background:#fff2}}`)}function wi(t){let e;return{c(){e=k("div"),h(e,"class","processing svelte-rjmul6")},m(r,n){p(r,e,n)},p:y,i:y,o:y,d(r){r&&m(e)}}}class Pt extends R{constructor(e){super(),N(this,e,null,wi,Q,{},Ii)}}function ki(t){F(t,"svelte-1wxt892",".rcb-stripe-elements-container.svelte-1wxt892{width:100%;margin-top:32px;margin-bottom:24px}")}function yi(t){let e,r;return e=new Je({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p:y,i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function vi(t){let e,r,n,i,o,s;function l(a){t[9](a)}let c={stripe:t[3],clientSecret:t[4],loader:"always",theme:"stripe",variables:{borderRadius:"12px",fontSizeBase:"16px",fontSizeSm:"16px",spacingGridRow:"16px",colorText:ve["grey-text-dark"],focusBoxShadow:"none",colorDanger:ve.error},rules:{".Input":{boxShadow:"none",border:`2px solid ${ve["grey-ui-dark"]}`},".Input:focus":{border:`2px solid ${ve.focus}`,outline:"none"},".Label":{marginBottom:"8px",fontWeight:"500",lineHeight:"22px"},".Input--invalid":{boxShadow:"none"}},$$slots:{default:[Ni]},$$scope:{ctx:t}};return t[2]!==void 0&&(c.elements=t[2]),r=new oi({props:c}),Pe.push(()=>Pn(r,"elements",l)),{c(){e=k("form"),w(r.$$.fragment)},m(a,u){p(a,e,u),b(r,e,null),i=!0,o||(s=pe(e,"submit",at(t[5])),o=!0)},p(a,u){const g={};u&8&&(g.stripe=a[3]),u&2051&&(g.$$scope={dirty:u,ctx:a}),!n&&u&4&&(n=!0,g.elements=a[2],$n(()=>n=!1)),r.$set(g)},i(a){i||(f(r.$$.fragment,a),i=!0)},o(a){d(r.$$.fragment,a),i=!1},d(a){a&&m(e),I(r),o=!1,s()}}}function $i(t){let e,r,n,i;return n=new bi({}),{c(){e=k("div"),e.textContent="Secure Checkout",r=T(),w(n.$$.fragment)},m(o,s){p(o,e,s),p(o,r,s),b(n,o,s),i=!0},p:y,i(o){i||(f(n.$$.fragment,o),i=!0)},o(o){d(n.$$.fragment,o),i=!1},d(o){o&&(m(e),m(r)),I(n,o)}}}function Bi(t){let e,r,n;return r=new ni({}),{c(){e=k("div"),w(r.$$.fragment),h(e,"class","rcb-stripe-elements-container svelte-1wxt892")},m(i,o){p(i,e,o),b(r,e,null),n=!0},p:y,i(i){n||(f(r.$$.fragment,i),n=!0)},o(i){d(r.$$.fragment,i),n=!1},d(i){i&&m(e),I(r)}}}function Di(t){let e;return{c(){e=O("Pay")},m(r,n){p(r,e,n)},i:y,o:y,d(r){r&&m(e)}}}function Pi(t){let e,r;return e=new Pt({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Ci(t){let e,r,n,i;const o=[Pi,Di],s=[];function l(c,a){return c[0]?0:1}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=re()},m(c,a){s[e].m(c,a),p(c,n,a),i=!0},p(c,a){let u=e;e=l(c),e!==u&&(K(),d(s[u],1,1,()=>{s[u]=null}),q(),r=s[e],r||(r=s[e]=o[e](c),r.c()),f(r,1),r.m(n.parentNode,n))},i(c){i||(f(r),i=!0)},o(c){d(r),i=!1},d(c){c&&m(n),s[e].d(c)}}}function Mi(t){let e;return{c(){e=O("Close")},m(r,n){p(r,e,n)},d(r){r&&m(e)}}}function Ti(t){let e,r,n,i;return e=new Ie({props:{disabled:t[0],$$slots:{default:[Ci]},$$scope:{ctx:t}}}),n=new Ie({props:{disabled:t[0],intent:"secondary",$$slots:{default:[Mi]},$$scope:{ctx:t}}}),n.$on("click",function(){se(t[1])&&t[1].apply(this,arguments)}),{c(){w(e.$$.fragment),r=T(),w(n.$$.fragment)},m(o,s){b(e,o,s),p(o,r,s),b(n,o,s),i=!0},p(o,s){t=o;const l={};s&1&&(l.disabled=t[0]),s&2049&&(l.$$scope={dirty:s,ctx:t}),e.$set(l);const c={};s&1&&(c.disabled=t[0]),s&2048&&(c.$$scope={dirty:s,ctx:t}),n.$set(c)},i(o){i||(f(e.$$.fragment,o),f(n.$$.fragment,o),i=!0)},o(o){d(e.$$.fragment,o),d(n.$$.fragment,o),i=!1},d(o){o&&m(r),I(e,o),I(n,o)}}}function Qi(t){let e,r;return e=new we({props:{$$slots:{default:[Ti]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&2051&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Ni(t){let e,r,n,i,o,s;return e=new We({props:{$$slots:{default:[$i]},$$scope:{ctx:t}}}),n=new fe({props:{$$slots:{default:[Bi]},$$scope:{ctx:t}}}),o=new Ve({props:{$$slots:{default:[Qi]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment),r=T(),w(n.$$.fragment),i=T(),w(o.$$.fragment)},m(l,c){b(e,l,c),p(l,r,c),b(n,l,c),p(l,i,c),b(o,l,c),s=!0},p(l,c){const a={};c&2048&&(a.$$scope={dirty:c,ctx:l}),e.$set(a);const u={};c&2048&&(u.$$scope={dirty:c,ctx:l}),n.$set(u);const g={};c&2051&&(g.$$scope={dirty:c,ctx:l}),o.$set(g)},i(l){s||(f(e.$$.fragment,l),f(n.$$.fragment,l),f(o.$$.fragment,l),s=!0)},o(l){d(e.$$.fragment,l),d(n.$$.fragment,l),d(o.$$.fragment,l),s=!1},d(l){l&&(m(r),m(i)),I(e,l),I(n,l),I(o,l)}}}function Ri(t){let e,r,n,i;const o=[vi,yi],s=[];function l(c,a){return c[3]&&c[4]?0:1}return r=l(t),n=s[r]=o[r](t),{c(){e=k("div"),n.c()},m(c,a){p(c,e,a),s[r].m(e,null),i=!0},p(c,[a]){let u=r;r=l(c),r===u?s[r].p(c,a):(K(),d(s[u],1,1,()=>{s[u]=null}),q(),n=s[r],n?n.p(c,a):(n=s[r]=o[r](c),n.c()),f(n,1),n.m(e,null))},i(c){i||(f(n),i=!0)},o(c){d(n),i=!1},d(c){c&&m(e),s[r].d()}}}function Ui(t,e,r){let{onClose:n}=e,{onContinue:i}=e,{onError:o}=e,{paymentInfoCollectionMetadata:s}=e,{processing:l=!1}=e;const c=s.data.client_secret;let a=null,u,g;De(async()=>{const E=s.data.publishable_api_key,B=s.data.stripe_account_id;if(!E||!B)throw new Error("Stripe publishable key or account ID not found");r(3,a=await gi(E,{stripeAccount:B}))});const _=async()=>{if(l||!a||!g)return;r(0,l=!0);const E=await a.confirmSetup({elements:g,redirect:"if_required"});E.error?(r(0,l=!1),o(new j(L.StripeError,E.error.message))):i()};function v(E){u=E,r(2,u)}return t.$$set=E=>{"onClose"in E&&r(1,n=E.onClose),"onContinue"in E&&r(6,i=E.onContinue),"onError"in E&&r(7,o=E.onError),"paymentInfoCollectionMetadata"in E&&r(8,s=E.paymentInfoCollectionMetadata),"processing"in E&&r(0,l=E.processing)},t.$$.update=()=>{t.$$.dirty&4&&u&&u._elements.length>0&&(g=u)},[l,n,u,a,c,_,i,o,s,v]}class Si extends R{constructor(e){super(),N(this,e,Ui,Ri,Q,{onClose:1,onContinue:6,onError:7,paymentInfoCollectionMetadata:8,processing:0},ki)}}function Oi(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 Li(t){F(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 Fi(t){let e;return{c(){e=O("Billing email address")},m(r,n){p(r,e,n)},d(r){r&&m(e)}}}function Ct(t){let e,r;return{c(){e=k("div"),r=O(t[2]),h(e,"class","form-error svelte-favd20")},m(n,i){p(n,e,i),P(e,r)},p(n,i){i&4&&le(r,n[2])},d(n){n&&m(e)}}}function xi(t){let e,r,n,i,o,s,l,c,a,u=t[2]&&Ct(t);return{c(){e=k("div"),r=k("div"),r.innerHTML='<label for="email">Email</label>',n=T(),i=k("div"),o=k("input"),l=T(),u&&u.c(),h(r,"class","form-label svelte-favd20"),h(o,"name","email"),h(o,"placeholder","john@appleseed.com"),h(o,"autocapitalize","off"),h(o,"class","svelte-favd20"),h(i,"class",s="form-input "+t[4]+" svelte-favd20"),h(e,"class","form-container svelte-favd20")},m(g,_){p(g,e,_),P(e,r),P(e,n),P(e,i),P(i,o),ut(o,t[3]),P(e,l),u&&u.m(e,null),c||(a=pe(o,"input",t[8]),c=!0)},p(g,_){_&8&&o.value!==g[3]&&ut(o,g[3]),_&16&&s!==(s="form-input "+g[4]+" svelte-favd20")&&h(i,"class",s),g[2]?u?u.p(g,_):(u=Ct(g),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},d(g){g&&m(e),u&&u.d(),c=!1,a()}}}function Yi(t){let e;return{c(){e=O("Continue")},m(r,n){p(r,e,n)},i:y,o:y,d(r){r&&m(e)}}}function Gi(t){let e,r;return e=new Pt({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Hi(t){let e,r,n,i;const o=[Gi,Yi],s=[];function l(c,a){return c[1]?0:1}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=re()},m(c,a){s[e].m(c,a),p(c,n,a),i=!0},p(c,a){let u=e;e=l(c),e!==u&&(K(),d(s[u],1,1,()=>{s[u]=null}),q(),r=s[e],r||(r=s[e]=o[e](c),r.c()),f(r,1),r.m(n.parentNode,n))},i(c){i||(f(r),i=!0)},o(c){d(r),i=!1},d(c){c&&m(n),s[e].d(c)}}}function Ki(t){let e;return{c(){e=O("Close")},m(r,n){p(r,e,n)},d(r){r&&m(e)}}}function qi(t){let e,r,n,i;return e=new Ie({props:{disabled:t[1],$$slots:{default:[Hi]},$$scope:{ctx:t}}}),n=new Ie({props:{intent:"secondary",disabled:t[1],$$slots:{default:[Ki]},$$scope:{ctx:t}}}),n.$on("click",function(){se(t[0])&&t[0].apply(this,arguments)}),{c(){w(e.$$.fragment),r=T(),w(n.$$.fragment)},m(o,s){b(e,o,s),p(o,r,s),b(n,o,s),i=!0},p(o,s){t=o;const l={};s&2&&(l.disabled=t[1]),s&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){d(e.$$.fragment,o),d(n.$$.fragment,o),i=!1},d(o){o&&m(r),I(e,o),I(n,o)}}}function ji(t){let e,r;return e=new we({props:{$$slots:{default:[qi]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(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){d(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Ji(t){let e,r,n,i,o,s,l,c,a;return r=new We({props:{$$slots:{default:[Fi]},$$scope:{ctx:t}}}),i=new fe({props:{$$slots:{default:[xi]},$$scope:{ctx:t}}}),s=new Ve({props:{$$slots:{default:[ji]},$$scope:{ctx:t}}}),{c(){e=k("form"),w(r.$$.fragment),n=T(),w(i.$$.fragment),o=T(),w(s.$$.fragment),h(e,"class","svelte-favd20")},m(u,g){p(u,e,g),b(r,e,null),P(e,n),b(i,e,null),P(e,o),b(s,e,null),l=!0,c||(a=pe(e,"submit",at(t[5])),c=!0)},p(u,[g]){const _={};g&512&&(_.$$scope={dirty:g,ctx:u}),r.$set(_);const v={};g&540&&(v.$$scope={dirty:g,ctx:u}),i.$set(v);const E={};g&515&&(E.$$scope={dirty:g,ctx:u}),s.$set(E)},i(u){l||(f(r.$$.fragment,u),f(i.$$.fragment,u),f(s.$$.fragment,u),l=!0)},o(u){d(r.$$.fragment,u),d(i.$$.fragment,u),d(s.$$.fragment,u),l=!1},d(u){u&&m(e),I(r),I(i),I(s),c=!1,a()}}}function Vi(t,e,r){let n,i,o,{onContinue:s}=e,{onClose:l}=e,{processing:c}=e,{lastError:a}=e;const u=async()=>{const _=Oi(n);_?r(2,i=_):s({email:n})};bn(async()=>{r(2,i=(a==null?void 0:a.message)??"")});function g(){n=this.value,r(3,n)}return t.$$set=_=>{"onContinue"in _&&r(6,s=_.onContinue),"onClose"in _&&r(0,l=_.onClose),"processing"in _&&r(1,c=_.processing),"lastError"in _&&r(7,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,g]}class Wi extends R{constructor(e){super(),N(this,e,Vi,Ji,Q,{onContinue:6,onClose:0,processing:1,lastError:7},Li)}}function zi(t){F(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 Xi(t){let e,r;const n=t[1].default,i=V(n,t,t[0],null);return{c(){e=k("div"),i&&i.c(),h(e,"class","rcb-modal-backdrop svelte-17tslso")},m(o,s){p(o,e,s),i&&i.m(e,null),r=!0},p(o,[s]){i&&i.p&&(!r||s&1)&&z(i,n,o,o[0],r?W(n,o[0],s,null):X(o[0]),null)},i(o){r||(f(i,o),r=!0)},o(o){d(i,o),r=!1},d(o){o&&m(e),i&&i.d(o)}}}function Zi(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(0,i=o.$$scope)},[i,n]}class eo extends R{constructor(e){super(),N(this,e,Zi,Xi,Q,{},zi)}}function to(t){F(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 no(t){let e,r,n,i;const o=t[2].default,s=V(o,t,t[1],null);return{c(){e=k("div"),r=k("main"),s&&s.c(),h(r,"class",n=me(`rcb-modal-main ${t[0]?"rcb-modal-dark":""}`)+" svelte-z3twhy"),h(e,"class","rcb-modal-container svelte-z3twhy")},m(l,c){p(l,e,c),P(e,r),s&&s.m(r,null),i=!0},p(l,[c]){s&&s.p&&(!i||c&2)&&z(s,o,l,l[1],i?W(o,l[1],c,null):X(l[1]),null),(!i||c&1&&n!==(n=me(`rcb-modal-main ${l[0]?"rcb-modal-dark":""}`)+" svelte-z3twhy"))&&h(r,"class",n)},i(l){i||(f(s,l),i=!0)},o(l){d(s,l),i=!1},d(l){l&&m(e),s&&s.d(l)}}}function ro(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 io extends R{constructor(e){super(),N(this,e,ro,no,Q,{dark:0},to)}}function oo(t){let e;const r=t[1].default,n=V(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)&&z(n,r,i,i[2],e?W(r,i[2],o,null):X(i[2]),null)},i(i){e||(f(n,i),e=!0)},o(i){d(n,i),e=!1},d(i){n&&n.d(i)}}}function so(t){let e,r;return e=new eo({props:{$$slots:{default:[lo]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&4&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function lo(t){let e;const r=t[1].default,n=V(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)&&z(n,r,i,i[2],e?W(r,i[2],o,null):X(i[2]),null)},i(i){e||(f(n,i),e=!0)},o(i){d(n,i),e=!1},d(i){n&&n.d(i)}}}function co(t){let e,r,n,i;const o=[so,oo],s=[];function l(c,a){return c[0]?0:1}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=re()},m(c,a){s[e].m(c,a),p(c,n,a),i=!0},p(c,[a]){let u=e;e=l(c),e===u?s[e].p(c,a):(K(),d(s[u],1,1,()=>{s[u]=null}),q(),r=s[e],r?r.p(c,a):(r=s[e]=o[e](c),r.c()),f(r,1),r.m(n.parentNode,n))},i(c){i||(f(r),i=!0)},o(c){d(r),i=!1},d(c){c&&m(n),s[e].d(c)}}}function ao(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 uo extends R{constructor(e){super(),N(this,e,ao,co,Q,{condition:0})}}const fo=t=>({}),Mt=t=>({});function go(t){let e,r;const n=t[1].header,i=V(n,t,t[2],Mt),o=t[1].default,s=V(o,t,t[2],null);return{c(){i&&i.c(),e=T(),s&&s.c()},m(l,c){i&&i.m(l,c),p(l,e,c),s&&s.m(l,c),r=!0},p(l,c){i&&i.p&&(!r||c&4)&&z(i,n,l,l[2],r?W(n,l[2],c,fo):X(l[2]),Mt),s&&s.p&&(!r||c&4)&&z(s,o,l,l[2],r?W(o,l[2],c,null):X(l[2]),null)},i(l){r||(f(i,l),f(s,l),r=!0)},o(l){d(i,l),d(s,l),r=!1},d(l){l&&m(e),i&&i.d(l),s&&s.d(l)}}}function mo(t){let e,r;return e=new io({props:{dark:t[0],$$slots:{default:[go]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,[i]){const o={};i&1&&(o.dark=n[0]),i&4&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function po(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 Tt extends R{constructor(e){super(),N(this,e,po,mo,Q,{dark:0})}}const ho="0.5.0",_o="https://api.revenuecat.com";var Re;(function(t){t[t.CONTINUE=100]="CONTINUE",t[t.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",t[t.PROCESSING=102]="PROCESSING",t[t.EARLY_HINTS=103]="EARLY_HINTS",t[t.OK=200]="OK",t[t.CREATED=201]="CREATED",t[t.ACCEPTED=202]="ACCEPTED",t[t.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",t[t.NO_CONTENT=204]="NO_CONTENT",t[t.RESET_CONTENT=205]="RESET_CONTENT",t[t.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",t[t.MULTI_STATUS=207]="MULTI_STATUS",t[t.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",t[t.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",t[t.MOVED_TEMPORARILY=302]="MOVED_TEMPORARILY",t[t.SEE_OTHER=303]="SEE_OTHER",t[t.NOT_MODIFIED=304]="NOT_MODIFIED",t[t.USE_PROXY=305]="USE_PROXY",t[t.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",t[t.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",t[t.BAD_REQUEST=400]="BAD_REQUEST",t[t.UNAUTHORIZED=401]="UNAUTHORIZED",t[t.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",t[t.FORBIDDEN=403]="FORBIDDEN",t[t.NOT_FOUND=404]="NOT_FOUND",t[t.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",t[t.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",t[t.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",t[t.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",t[t.CONFLICT=409]="CONFLICT",t[t.GONE=410]="GONE",t[t.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",t[t.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",t[t.REQUEST_TOO_LONG=413]="REQUEST_TOO_LONG",t[t.REQUEST_URI_TOO_LONG=414]="REQUEST_URI_TOO_LONG",t[t.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",t[t.REQUESTED_RANGE_NOT_SATISFIABLE=416]="REQUESTED_RANGE_NOT_SATISFIABLE",t[t.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",t[t.IM_A_TEAPOT=418]="IM_A_TEAPOT",t[t.INSUFFICIENT_SPACE_ON_RESOURCE=419]="INSUFFICIENT_SPACE_ON_RESOURCE",t[t.METHOD_FAILURE=420]="METHOD_FAILURE",t[t.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",t[t.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",t[t.LOCKED=423]="LOCKED",t[t.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",t[t.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",t[t.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",t[t.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",t[t.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",t[t.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",t[t.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",t[t.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",t[t.BAD_GATEWAY=502]="BAD_GATEWAY",t[t.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",t[t.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",t[t.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",t[t.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",t[t.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"})(Re||(Re={}));function ze(t){return t?t.startsWith("rcb_sb_"):!1}async function de(t,e){const{apiKey:r,body:n,headers:i,httpConfig:o}=e,l=`${(o==null?void 0:o.proxyURL)??_o}${t.urlPath()}`;try{const c=await fetch(l,{method:t.method,headers:Io(r,i,o==null?void 0:o.additionalHeaders),body:Eo(n)});return await Ao(c,t),await c.json()}catch(c){throw c instanceof TypeError?new J(Z.NetworkError,Ee.getPublicMessage(Z.NetworkError),c.message):c}}async function Ao(t,e){const r=t.status;if(r>=Re.INTERNAL_SERVER_ERROR)Xe(e,r,await t.text());else if(r>=Re.BAD_REQUEST){const n=await t.json(),i=n?JSON.stringify(n):null,o=n==null?void 0:n.code,s=n==null?void 0:n.message;if(o!=null){const l=Ee.convertCodeToBackendErrorCode(o);if(l==null)Xe(e,r,i);else throw J.getForBackendError(l,s)}else Xe(e,r,i)}}function Xe(t,e,r){throw new J(Z.UnknownBackendError,`Unknown backend error. Request: ${t.name}. Status code: ${e}. Body: ${r}.`)}function Eo(t){return t==null?null:JSON.stringify(t)}const Qt="Authorization",Nt="Content-Type",Rt="Accept",Ut="X-Platform",St="X-Version",Ot="X-Is-Sandbox",bo=new Set([Qt,Nt,Rt,Ut,St,Ot]);function Io(t,e,r){let n={[Qt]:`Bearer ${t}`,[Nt]:"application/json",[Rt]:"application/json",[Ut]:"web",[St]:ho,[Ot]:`${ze(t)}`};return e&&(n={...n,...e}),r&&(n={...r,...n}),n}const Lt="/v1/subscribers",Ue="/rcbilling/v1";class wo{constructor(e){M(this,"appUserId");M(this,"method","GET");M(this,"name","getOfferings");this.appUserId=e}urlPath(){const e=encodeURIComponent(this.appUserId);return`${Lt}/${e}/offerings`}}class ko{constructor(){M(this,"method","POST");M(this,"name","subscribe")}urlPath(){return`${Ue}/subscribe`}}class yo{constructor(e,r){M(this,"method","GET");M(this,"name","getProducts");M(this,"appUserId");M(this,"productIds");this.appUserId=e,this.productIds=r}urlPath(){const e=encodeURIComponent(this.appUserId),r=this.productIds.map(encodeURIComponent).join("&id=");return`${Ue}/subscribers/${e}/products?id=${r}`}}class vo{constructor(e){M(this,"method","GET");M(this,"name","getCustomerInfo");M(this,"appUserId");this.appUserId=e}urlPath(){const e=encodeURIComponent(this.appUserId);return`${Lt}/${e}`}}class $o{constructor(){M(this,"method","GET");M(this,"name","getBrandingInfo")}urlPath(){return`${Ue}/branding`}}class Bo{constructor(e){M(this,"method","GET");M(this,"name","getCheckoutStatus");M(this,"operationSessionId");this.operationSessionId=e}urlPath(){return`${Ue}/checkout/${this.operationSessionId}`}}const Ze={};class Do{constructor(e,r=Ze){M(this,"API_KEY");M(this,"httpConfig");this.API_KEY=e,this.httpConfig=r}async getOfferings(e){return await de(new wo(e),{apiKey:this.API_KEY,httpConfig:this.httpConfig})}async getCustomerInfo(e){return await de(new vo(e),{apiKey:this.API_KEY,httpConfig:this.httpConfig})}async getProducts(e,r){return await de(new yo(e,r),{apiKey:this.API_KEY,httpConfig:this.httpConfig})}async getBrandingInfo(){return await de(new $o,{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,presented_offering_identifier:i.offeringIdentifier};return o&&o!=="base_option"&&(s.offer_id=o),i.targetingContext&&(s.applied_targeting_rule={rule_id:i.targetingContext.ruleId,revision:i.targetingContext.revision}),await de(new ko,{apiKey:this.API_KEY,body:s,httpConfig:this.httpConfig})}async getCheckoutStatus(e){return await de(new Bo(e),{apiKey:this.API_KEY,httpConfig:this.httpConfig})}}const Po="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 Co(t){let e,r;return{c(){e=k("img"),ne(e.src,r=Po)||h(e,"src",r),h(e,"alt","icon"),h(e,"class","rcb-ui-asset-icon")},m(n,i){p(n,e,i)},p:y,i:y,o:y,d(n){n&&m(e)}}}class Mo extends R{constructor(e){super(),N(this,e,null,Co,Q,{})}}function To(t){F(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 Qo(t){let e;return{c(){e=k("div"),e.textContent="Sandbox",h(e,"class","svelte-1rhrjxe")},m(r,n){p(r,e,n)},p:y,i:y,o:y,d(r){r&&m(e)}}}class No extends R{constructor(e){super(),N(this,e,null,Qo,Q,{},To)}}function Ro(t){F(t,"svelte-1qect5g",`.rcb-ui-container.svelte-1qect5g{color-scheme:none;font-size:16px;line-height:1.5em;font-weight:400;font-family:-apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu,
7
- Cantarell, "Open Sans", "Helvetica Neue", sans-serif}.rcb-ui-layout.svelte-1qect5g{width:100vw;width:100 dvw;margin-right:auto;display:flex;justify-content:center;align-items:flex-start;position:relative;padding:0px 80px;box-sizing:border-box}.rcb-ui-aside.svelte-1qect5g{margin-right:16px;flex:320px 1 0;max-width:480px}.rcb-ui-main.svelte-1qect5g{flex:480px 1 0;max-width:640px}@media screen and (max-width: 960px){.rcb-ui-layout.svelte-1qect5g{flex-direction:column;align-items:center;justify-content:center;height:100%;min-width:100%}.rcb-ui-aside.svelte-1qect5g{margin-right:0;margin-bottom:16px;min-width:100%;display:flex;flex-direction:column;align-items:center;flex:none;max-width:none}.rcb-ui-main.svelte-1qect5g{flex:none;max-width:none;min-width:100%}}@media screen and (max-width: 960px) and (max-height: 960px){.rcb-ui-layout.svelte-1qect5g{overflow-y:scroll;justify-content:flex-start;padding:16px 0px}}`)}function Ft(t){let e,r,n;return r=new Tt({props:{dark:!0,$$slots:{header:[Fo],default:[Uo]},$$scope:{ctx:t}}}),{c(){e=k("div"),w(r.$$.fragment),h(e,"class","rcb-ui-aside svelte-1qect5g")},m(i,o){p(i,e,o),b(r,e,null),n=!0},p(i,o){const s={};o&67108878&&(s.$$scope={dirty:o,ctx:i}),r.$set(s)},i(i){n||(f(r.$$.fragment,i),n=!0)},o(i){d(r.$$.fragment,i),n=!1},d(i){i&&m(e),I(r)}}}function xt(t){let e,r;return e=new mt({props:{productDetails:t[2],purchaseOption:t[8]}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&4&&(o.productDetails=n[2]),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Uo(t){let e,r,n=t[2]&&t[8]&&xt(t);return{c(){n&&n.c(),e=re()},m(i,o){n&&n.m(i,o),p(i,e,o),r=!0},p(i,o){i[2]&&i[8]?n?(n.p(i,o),o&4&&f(n,1)):(n=xt(i),n.c(),f(n,1),n.m(e.parentNode,e)):n&&(K(),d(n,1,1,()=>{n=null}),q())},i(i){r||(f(n),r=!0)},o(i){d(n),r=!1},d(i){i&&m(e),n&&n.d(i)}}}function So(t){let e,r;return e=new Mo({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Oo(t){let e,r;return e=new No({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Lo(t){let e,r,n,i,o,s,l;e=new Et({props:{brandingInfo:t[3]}});const c=[Oo,So],a=[];function u(g,_){return _&2&&(n=null),n==null&&(n=!!g[1].isSandbox()),n?0:1}return i=u(t,-1),o=a[i]=c[i](t),{c(){w(e.$$.fragment),r=T(),o.c(),s=re()},m(g,_){b(e,g,_),p(g,r,_),a[i].m(g,_),p(g,s,_),l=!0},p(g,_){const v={};_&8&&(v.brandingInfo=g[3]),e.$set(v);let E=i;i=u(g,_),i!==E&&(K(),d(a[E],1,1,()=>{a[E]=null}),q(),o=a[i],o||(o=a[i]=c[i](g),o.c()),f(o,1),o.m(s.parentNode,s))},i(g){l||(f(e.$$.fragment,g),f(o),l=!0)},o(g){d(e.$$.fragment,g),d(o),l=!1},d(g){g&&(m(r),m(s)),I(e,g),a[i].d(g)}}}function Fo(t){let e,r;return e=new We({props:{slot:"header",$$slots:{default:[Lo]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&67108874&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Yt(t){let e,r;return e=new mt({props:{productDetails:t[2],purchaseOption:t[8]}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&4&&(o.productDetails=n[2]),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Gt(t){let e,r;return e=new Je({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Ht(t){let e,r;return e=new Wi({props:{onContinue:t[11],onClose:t[10],processing:t[6]==="processing-auth-info",lastError:t[5]}}),{c(){w(e.$$.fragment)},m(n,i){b(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){d(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Kt(t){let e,r;return e=new Si({props:{paymentInfoCollectionMetadata:t[4],onContinue:t[11],onClose:t[10],onError:t[12],processing:t[6]==="polling-purchase-status"}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&16&&(o.paymentInfoCollectionMetadata=n[4]),i&64&&(o.processing=n[6]==="polling-purchase-status"),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function qt(t){let e,r;return e=new Je({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function jt(t){var n;let e,r;return e=new xr({props:{brandingInfo:t[3],lastError:t[5]??new j(L.UnknownError,"Unknown error without state set."),supportEmail:(n=t[3])==null?void 0:n.seller_company_support_email,onContinue:t[13]}}),{c(){w(e.$$.fragment)},m(i,o){b(e,i,o),r=!0},p(i,o){var l;const s={};o&8&&(s.brandingInfo=i[3]),o&32&&(s.lastError=i[5]??new j(L.UnknownError,"Unknown error without state set.")),o&8&&(s.supportEmail=(l=i[3])==null?void 0:l.seller_company_support_email),e.$set(s)},i(i){r||(f(e.$$.fragment,i),r=!0)},o(i){d(e.$$.fragment,i),r=!1},d(i){I(e,i)}}}function Jt(t){let e,r;return e=new Wr({props:{brandingInfo:t[3],onContinue:t[11]}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&8&&(o.brandingInfo=n[3]),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function xo(t){let e,r,n,i,o,s,l,c,a=t[6]==="present-offer"&&t[2]&&t[8]&&Yt(t),u=t[6]==="present-offer"&&!t[2]&&Gt(),g=(t[6]==="needs-auth-info"||t[6]==="processing-auth-info")&&Ht(t),_=t[4]&&(t[6]==="needs-payment-info"||t[6]==="polling-purchase-status")&&Kt(t),v=t[6]==="loading"&&qt(),E=t[6]==="error"&&jt(t),B=t[6]==="success"&&Jt(t);return{c(){a&&a.c(),e=T(),u&&u.c(),r=T(),g&&g.c(),n=T(),_&&_.c(),i=T(),v&&v.c(),o=T(),E&&E.c(),s=T(),B&&B.c(),l=re()},m(A,$){a&&a.m(A,$),p(A,e,$),u&&u.m(A,$),p(A,r,$),g&&g.m(A,$),p(A,n,$),_&&_.m(A,$),p(A,i,$),v&&v.m(A,$),p(A,o,$),E&&E.m(A,$),p(A,s,$),B&&B.m(A,$),p(A,l,$),c=!0},p(A,$){A[6]==="present-offer"&&A[2]&&A[8]?a?(a.p(A,$),$&68&&f(a,1)):(a=Yt(A),a.c(),f(a,1),a.m(e.parentNode,e)):a&&(K(),d(a,1,1,()=>{a=null}),q()),A[6]==="present-offer"&&!A[2]?u?$&68&&f(u,1):(u=Gt(),u.c(),f(u,1),u.m(r.parentNode,r)):u&&(K(),d(u,1,1,()=>{u=null}),q()),A[6]==="needs-auth-info"||A[6]==="processing-auth-info"?g?(g.p(A,$),$&64&&f(g,1)):(g=Ht(A),g.c(),f(g,1),g.m(n.parentNode,n)):g&&(K(),d(g,1,1,()=>{g=null}),q()),A[4]&&(A[6]==="needs-payment-info"||A[6]==="polling-purchase-status")?_?(_.p(A,$),$&80&&f(_,1)):(_=Kt(A),_.c(),f(_,1),_.m(i.parentNode,i)):_&&(K(),d(_,1,1,()=>{_=null}),q()),A[6]==="loading"?v?$&64&&f(v,1):(v=qt(),v.c(),f(v,1),v.m(o.parentNode,o)):v&&(K(),d(v,1,1,()=>{v=null}),q()),A[6]==="error"?E?(E.p(A,$),$&64&&f(E,1)):(E=jt(A),E.c(),f(E,1),E.m(s.parentNode,s)):E&&(K(),d(E,1,1,()=>{E=null}),q()),A[6]==="success"?B?(B.p(A,$),$&64&&f(B,1)):(B=Jt(A),B.c(),f(B,1),B.m(l.parentNode,l)):B&&(K(),d(B,1,1,()=>{B=null}),q())},i(A){c||(f(a),f(u),f(g),f(_),f(v),f(E),f(B),c=!0)},o(A){d(a),d(u),d(g),d(_),d(v),d(E),d(B),c=!1},d(A){A&&(m(e),m(r),m(n),m(i),m(o),m(s),m(l)),a&&a.d(A),u&&u.d(A),g&&g.d(A),_&&_.d(A),v&&v.d(A),E&&E.d(A),B&&B.d(A)}}}function Yo(t){let e,r=t[9].includes(t[6]),n,i,o,s,l=r&&Ft(t);return o=new Tt({props:{$$slots:{default:[xo]},$$scope:{ctx:t}}}),{c(){e=k("div"),l&&l.c(),n=T(),i=k("div"),w(o.$$.fragment),h(i,"class","rcb-ui-main svelte-1qect5g"),h(e,"class","rcb-ui-layout svelte-1qect5g"),h(e,"style",t[7])},m(c,a){p(c,e,a),l&&l.m(e,null),P(e,n),P(e,i),b(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&&(K(),d(l,1,1,()=>{l=null}),q());const u={};a&67108988&&(u.$$scope={dirty:a,ctx:c}),o.$set(u)},i(c){s||(f(l),f(o.$$.fragment,c),s=!0)},o(c){d(l),d(o.$$.fragment,c),s=!1},d(c){c&&m(e),l&&l.d(),I(o)}}}function Go(t){let e,r,n;return r=new uo({props:{condition:t[0],$$slots:{default:[Yo]},$$scope:{ctx:t}}}),{c(){e=k("div"),w(r.$$.fragment),h(e,"class","rcb-ui-container svelte-1qect5g")},m(i,o){p(i,e,o),b(r,e,null),n=!0},p(i,[o]){const s={};o&1&&(s.condition=i[0]),o&67108990&&(s.$$scope={dirty:o,ctx:i}),r.$set(s)},i(i){n||(f(r.$$.fragment,i),n=!0)},o(i){d(r.$$.fragment,i),n=!1},d(i){i&&m(e),I(r)}}}function Ho(t,e,r){var Wt,zt;let{asModal:n=!0}=e,{customerEmail:i}=e,{appUserId:o}=e,{rcPackage:s}=e,{purchaseOption:l}=e,{onFinished:c}=e,{onError:a}=e,{onClose:u}=e,{purchases:g}=e,{backend:_}=e,{purchaseOperationHelper:v}=e;const E=Object.entries(ve).map(([D,tt])=>`--rc-color-${D}: ${tt}`).join("; ");let B=null,A=null,$=null,U=null;const C=((Wt=s==null?void 0:s.rcBillingProduct)==null?void 0:Wt.identifier)??null,Oe=(zt=s==null?void 0:s.rcBillingProduct)==null?void 0:zt.defaultSubscriptionOption,Y=l||Oe;let S="present-offer";const Le=["present-offer","needs-auth-info","processing-auth-info","needs-payment-info","polling-purchase-status","loading"];De(async()=>{if(r(2,B=s.rcBillingProduct),r(3,A=await _.getBrandingInfo()),S==="present-offer"){i?Vt():r(6,S="needs-auth-info");return}});const Fe=()=>{u()},Vt=()=>{if(C===null){$e(new j(L.ErrorSettingUpPurchase,"Product ID was not set before purchase."));return}else S==="present-offer"&&r(6,S="loading");if(!i){$e(new j(L.MissingEmailError));return}v.startPurchase(o,C,Y,i,s.rcBillingProduct.presentedOfferingContext).then(D=>{if(D.next_action==="collect_payment_info"){r(5,U=null),r(6,S="needs-payment-info"),r(4,$=D);return}if(D.next_action==="completed"){r(5,U=null),r(6,S="success");return}}).catch(D=>{$e(D)})},ls=D=>{if(S==="needs-auth-info"){D&&(r(14,i=D.email),r(6,S="processing-auth-info")),Vt();return}if(S==="needs-payment-info"){r(6,S="polling-purchase-status"),v.pollCurrentPurchaseForCompletion().then(()=>{r(6,S="success")}).catch(tt=>{$e(tt)});return}if(S==="success"||S==="error"){c();return}r(6,S="success")},$e=D=>{if(S==="processing-auth-info"){r(5,U=D),r(6,S="needs-auth-info");return}r(5,U=D),r(6,S="error")},cs=()=>{a(U??new j(L.UnknownError,"Unknown error without state set."))};return t.$$set=D=>{"asModal"in D&&r(0,n=D.asModal),"customerEmail"in D&&r(14,i=D.customerEmail),"appUserId"in D&&r(15,o=D.appUserId),"rcPackage"in D&&r(16,s=D.rcPackage),"purchaseOption"in D&&r(17,l=D.purchaseOption),"onFinished"in D&&r(18,c=D.onFinished),"onError"in D&&r(19,a=D.onError),"onClose"in D&&r(20,u=D.onClose),"purchases"in D&&r(1,g=D.purchases),"backend"in D&&r(21,_=D.backend),"purchaseOperationHelper"in D&&r(22,v=D.purchaseOperationHelper)},[n,g,B,A,$,U,S,E,Y,Le,Fe,ls,$e,cs,i,o,s,l,c,a,u,_,v]}class Ko extends R{constructor(e){super(),N(this,e,Ho,Go,Q,{asModal:0,customerEmail:14,appUserId:15,rcPackage:16,purchaseOption:17,onFinished:18,onError:19,onClose:20,purchases:1,backend:21,purchaseOperationHelper:22},Ro)}}function qo(t){return t.expires_date==null?!0:new Date(t.expires_date)>new Date}function jo(t,e,r,n){const i=e.product_identifier;if(i in r)return Jo(t,e,r[i]);if(i in n)return Vo(t,e,n[i]);throw new J(Z.CustomerInfoError,"Could not find entitlement product in subscriptions or non-subscriptions.")}function Jo(t,e,r){return{identifier:t,isActive:qo(e),willRenew:Xo(e,r),store:(r==null?void 0:r.store)??"unknown",latestPurchaseDate:new Date(e.purchase_date),originalPurchaseDate:new Date(e.purchase_date),expirationDate:Se(e.expires_date),productIdentifier:e.product_identifier,unsubscribeDetectedAt:Se(r==null?void 0:r.unsubscribe_detected_at),billingIssueDetectedAt:Se(r==null?void 0:r.billing_issues_detected_at),isSandbox:(r==null?void 0:r.is_sandbox)??!1,periodType:(r==null?void 0:r.period_type)??"normal"}}function Vo(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 Wo(t,e,r){const n={},i={};for(const o in t){const s=jo(o,t[o],e,r);n[o]=s,s.isActive&&(i[o]=s)}return{all:n,active:i}}function Se(t){return t==null?null:new Date(t)}function zo(t){const e=es(t),r=t.subscriber,n=ns(r.non_subscriptions);return{entitlements:Wo(r.entitlements,r.subscriptions,n),allExpirationDatesByProduct:e,allPurchaseDatesByProduct:Zo(t,n),activeSubscriptions:ts(e),managementURL:r.management_url,requestDate:new Date(t.request_date),firstSeenDate:new Date(r.first_seen),originalPurchaseDate:Se(r.original_purchase_date),originalAppUserId:t.subscriber.original_app_user_id}}function Xo(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 Zo(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 es(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 ts(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 ns(t){const e={};for(const r in t){if(t[r].length===0)continue;const n=t[r].length;e[r]=t[r][n-1]}return e}function rs(t){if(!/^rcb_[a-zA-Z0-9_.-]+$/.test(t))throw new J(Z.InvalidCredentialsError,"Invalid API key. Use your RevenueCat Billing API key.")}function is(t){if(new Set(["no_user","null","none","nil","(null)","NaN","\\x00","","unidentified","undefined","unknown"]).has(t)||t.includes("/"))throw new J(Z.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 os(t){if(t!=null&&t.endsWith("/"))throw new J(Z.ConfigurationError,"Invalid proxy URL. The proxy URL should not end with a trailing slash.")}function ss(t){if(t){for(const e in t)if(bo.has(e))throw new J(Z.ConfigurationError,"Invalid additional headers. Some headers are reserved for internal use.")}}const te=class te{constructor(e,r,n=Ze){M(this,"_API_KEY");M(this,"_appUserId");M(this,"backend");M(this,"purchaseOperationHelper");M(this,"toOfferings",(e,r)=>{const n={};r.product_details.forEach(s=>{n[s.identifier]=s});const i={};e.offerings.forEach(s=>{const l=s.identifier===e.current_offering_id,c=sn(l,s,n,e.targeting);c!=null&&(i[s.identifier]=c)});const o=e.current_offering_id?i[e.current_offering_id]??null:null;return Object.keys(i).length==0&&G.debugLog("Empty offerings. Please make sure you've configured offerings correctly in the RevenueCat dashboard and that the products are properly configured."),{all:i,current:o}});this._API_KEY=e,this._appUserId=r,ze(e)&&G.debugLog("Initializing Purchases SDK with sandbox API Key"),this.backend=new Do(this._API_KEY,n),this.purchaseOperationHelper=new jn(this.backend)}static setLogLevel(e){G.setLogLevel(e)}static getSharedInstance(){if(te.isConfigured())return te.instance;throw new ht}static isConfigured(){return te.instance!==void 0}static configure(e,r,n=Ze){return te.instance!==void 0&&G.warnLog("Purchases is already initialized. You normally should only configure Purchases once. Creating and returning new instance."),rs(e),is(r),os(n.proxyURL),ss(n.additionalHeaders),te.instance=new te(e,r,n),te.getSharedInstance()}async getOfferings(){const e=this._appUserId,r=await this.backend.getOfferings(e),n=r.offerings.flatMap(o=>o.packages).map(o=>o.platform_product_identifier),i=await this.backend.getProducts(e,n);return this.logMissingProductIds(n,i.product_details),this.toOfferings(r,i)}async isEntitledTo(e){const r=await this.getCustomerInfo();return e in r.entitlements.active}purchasePackage(e,r,n){return this.purchase({rcPackage:e,customerEmail:r,htmlTarget:n})}purchase(e){const{rcPackage:r,purchaseOption:n,htmlTarget:i,customerEmail:o}=e;let s=i??document.getElementById("rcb-ui-root");if(s===null){const u=document.createElement("div");u.className="rcb-ui-root",document.body.appendChild(u),s=u}if(s===null)throw new Error("Could not generate a mount point for the billing widget");const l=s,c=!i,a=this._appUserId;return G.debugLog(`Presenting purchase form for package ${r.identifier}`),new Promise((u,g)=>{new Ko({target:l,props:{appUserId:a,rcPackage:r,purchaseOption:n,customerEmail:o,onFinished:async()=>{G.debugLog("Purchase finished"),l.innerHTML="",u({customerInfo:await this._getCustomerInfoForUserId(a)})},onClose:()=>{l.innerHTML="",G.debugLog("Purchase cancelled by user"),g(new J(Z.UserCancelledError))},onError:_=>{l.innerHTML="",g(J.getForPurchasesFlowError(_))},purchases:this,backend:this.backend,purchaseOperationHelper:this.purchaseOperationHelper,asModal:c}})})}async getCustomerInfo(){return await this._getCustomerInfoForUserId(this._appUserId)}getAppUserId(){return this._appUserId}async changeUser(e){return this._appUserId=e,await this.getCustomerInfo()}logMissingProductIds(e,r){const n={};r.forEach(o=>n[o.identifier]=o);const i=[];e.forEach(o=>{n[o]===void 0&&i.push(o)}),i.length>0&&G.debugLog(`Could not find product data for product ids:
6
+ -20px 0 #fff2;background:#fff2}}`)}function bi(t){let e;return{c(){e=w("div"),A(e,"class","processing svelte-rjmul6")},m(r,n){h(r,e,n)},p:k,i:k,o:k,d(r){r&&p(e)}}}class Dt extends R{constructor(e){super(),N(this,e,null,bi,Q,{},Ei)}}function Ii(t){F(t,"svelte-1wxt892",".rcb-stripe-elements-container.svelte-1wxt892{width:100%;margin-top:32px;margin-bottom:24px}")}function wi(t){let e,r;return e=new qe({}),{c(){I(e.$$.fragment)},m(n,i){E(e,n,i),r=!0},p:k,i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function ki(t){let e,r,n,i,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:ve["grey-text-dark"],focusBoxShadow:"none",colorDanger:ve.error},rules:{".Input":{boxShadow:"none",border:`2px solid ${ve["grey-ui-dark"]}`},".Input:focus":{border:`2px solid ${ve.focus}`,outline:"none"},".Label":{marginBottom:"8px",fontWeight:"500",lineHeight:"22px"},".Input--invalid":{boxShadow:"none"}},$$slots:{default:[Qi]},$$scope:{ctx:t}};return t[4]!==void 0&&(c.elements=t[4]),r=new ri({props:c}),Pe.push(()=>Bn(r,"elements",l)),{c(){e=w("form"),I(r.$$.fragment)},m(a,u){h(a,e,u),E(r,e,null),i=!0,o||(s=pe(e,"submit",ct(t[7])),o=!0)},p(a,u){const g={};u&32&&(g.stripe=a[5]),u&8207&&(g.$$scope={dirty:u,ctx:a}),!n&&u&16&&(n=!0,g.elements=a[4],yn(()=>n=!1)),r.$set(g)},i(a){i||(f(r.$$.fragment,a),i=!0)},o(a){d(r.$$.fragment,a),i=!1},d(a){a&&p(e),b(r),o=!1,s()}}}function yi(t){let e,r,n,i;return n=new Ai({}),{c(){e=w("div"),e.textContent="Secure Checkout",r=M(),I(n.$$.fragment)},m(o,s){h(o,e,s),h(o,r,s),E(n,o,s),i=!0},p:k,i(o){i||(f(n.$$.fragment,o),i=!0)},o(o){d(n.$$.fragment,o),i=!1},d(o){o&&(p(e),p(r)),b(n,o)}}}function vi(t){let e,r,n;return r=new ei({}),{c(){e=w("div"),I(r.$$.fragment),A(e,"class","rcb-stripe-elements-container svelte-1wxt892")},m(i,o){h(i,e,o),E(r,e,null),n=!0},p:k,i(i){n||(f(r.$$.fragment,i),n=!0)},o(i){d(r.$$.fragment,i),n=!1},d(i){i&&p(e),b(r)}}}function $i(t){let e;return{c(){e=S("Pay")},m(r,n){h(r,e,n)},i:k,o:k,d(r){r&&p(e)}}}function Bi(t){let e;return{c(){e=S("Start Trial")},m(r,n){h(r,e,n)},i:k,o:k,d(r){r&&p(e)}}}function Di(t){let e,r;return e=new Dt({}),{c(){I(e.$$.fragment)},m(n,i){E(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Pi(t){let e,r,n,i;const o=[Di,Bi,$i],s=[];function l(c,a){var u,g;return c[0]?0:(g=(u=c[2].subscriptionOptions)==null?void 0:u[c[3].id])!=null&&g.trial?1:2}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=re()},m(c,a){s[e].m(c,a),h(c,n,a),i=!0},p(c,a){let u=e;e=l(c),e!==u&&(K(),d(s[u],1,1,()=>{s[u]=null}),j(),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){d(r),i=!1},d(c){c&&p(n),s[e].d(c)}}}function Ci(t){let e;return{c(){e=S("Close")},m(r,n){h(r,e,n)},d(r){r&&p(e)}}}function Ti(t){let e,r,n,i;return e=new Ie({props:{disabled:t[0],testId:"PayButton",$$slots:{default:[Pi]},$$scope:{ctx:t}}}),n=new Ie({props:{disabled:t[0],intent:"secondary",$$slots:{default:[Ci]},$$scope:{ctx:t}}}),n.$on("click",function(){se(t[1])&&t[1].apply(this,arguments)}),{c(){I(e.$$.fragment),r=M(),I(n.$$.fragment)},m(o,s){E(e,o,s),h(o,r,s),E(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){d(e.$$.fragment,o),d(n.$$.fragment,o),i=!1},d(o){o&&p(r),b(e,o),b(n,o)}}}function Mi(t){let e,r;return e=new we({props:{$$slots:{default:[Ti]},$$scope:{ctx:t}}}),{c(){I(e.$$.fragment)},m(n,i){E(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){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Qi(t){let e,r,n,i,o,s;return e=new Ve({props:{$$slots:{default:[yi]},$$scope:{ctx:t}}}),n=new fe({props:{$$slots:{default:[vi]},$$scope:{ctx:t}}}),o=new Je({props:{$$slots:{default:[Mi]},$$scope:{ctx:t}}}),{c(){I(e.$$.fragment),r=M(),I(n.$$.fragment),i=M(),I(o.$$.fragment)},m(l,c){E(e,l,c),h(l,r,c),E(n,l,c),h(l,i,c),E(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 g={};c&8207&&(g.$$scope={dirty:c,ctx:l}),o.$set(g)},i(l){s||(f(e.$$.fragment,l),f(n.$$.fragment,l),f(o.$$.fragment,l),s=!0)},o(l){d(e.$$.fragment,l),d(n.$$.fragment,l),d(o.$$.fragment,l),s=!1},d(l){l&&(p(r),p(i)),b(e,l),b(n,l),b(o,l)}}}function Ni(t){let e,r,n,i;const o=[ki,wi],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){h(c,e,a),s[r].m(e,null),i=!0},p(c,[a]){let u=r;r=l(c),r===u?s[r].p(c,a):(K(),d(s[u],1,1,()=>{s[u]=null}),j(),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){d(n),i=!1},d(c){c&&p(e),s[r].d()}}}function Ri(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 g=null,_,y;De(async()=>{const m=s.data.publishable_api_key,v=s.data.stripe_account_id;if(!m||!v)throw new Error("Stripe publishable key or account ID not found");r(5,g=await fi(m,{stripeAccount:v}))});const $=async()=>{if(l||!g||!y)return;r(0,l=!0);const m=await g.confirmSetup({elements:y,redirect:"if_required"});m.error?(r(0,l=!1),o(new q(L.StripeError,m.error.message))):i()};function D(m){_=m,r(4,_)}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&&_&&_._elements.length>0&&(y=_)},[l,n,c,a,_,g,u,$,i,o,s,D]}class Ui extends R{constructor(e){super(),N(this,e,Ri,Ni,Q,{onClose:1,onContinue:8,onError:9,paymentInfoCollectionMetadata:10,processing:0,productDetails:2,purchaseOptionToUse:3},Ii)}}function Oi(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 Si(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 Y.errorLog(e),new J(V.ConfigurationError,e)}}function Li(t){F(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 Fi(t){let e;return{c(){e=S("Billing email address")},m(r,n){h(r,e,n)},d(r){r&&p(e)}}}function Pt(t){let e,r;return{c(){e=w("div"),r=S(t[2]),A(e,"class","form-error svelte-favd20")},m(n,i){h(n,e,i),C(e,r)},p(n,i){i&4&&le(r,n[2])},d(n){n&&p(e)}}}function xi(t){let e,r,n,i,o,s,l,c,a,u=t[2]&&Pt(t);return{c(){e=w("div"),r=w("div"),r.innerHTML='<label for="email">Email</label>',n=M(),i=w("div"),o=w("input"),l=M(),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(g,_){h(g,e,_),C(e,r),C(e,n),C(e,i),C(i,o),at(o,t[3]),C(e,l),u&&u.m(e,null),c||(a=pe(o,"input",t[8]),c=!0)},p(g,_){_&8&&o.value!==g[3]&&at(o,g[3]),_&16&&s!==(s="form-input "+g[4]+" svelte-favd20")&&A(i,"class",s),g[2]?u?u.p(g,_):(u=Pt(g),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},d(g){g&&p(e),u&&u.d(),c=!1,a()}}}function Yi(t){let e;return{c(){e=S("Continue")},m(r,n){h(r,e,n)},i:k,o:k,d(r){r&&p(e)}}}function Gi(t){let e,r;return e=new Dt({}),{c(){I(e.$$.fragment)},m(n,i){E(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Hi(t){let e,r,n,i;const o=[Gi,Yi],s=[];function l(c,a){return c[1]?0:1}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=re()},m(c,a){s[e].m(c,a),h(c,n,a),i=!0},p(c,a){let u=e;e=l(c),e!==u&&(K(),d(s[u],1,1,()=>{s[u]=null}),j(),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){d(r),i=!1},d(c){c&&p(n),s[e].d(c)}}}function Ki(t){let e;return{c(){e=S("Close")},m(r,n){h(r,e,n)},d(r){r&&p(e)}}}function ji(t){let e,r,n,i;return e=new Ie({props:{disabled:t[1],$$slots:{default:[Hi]},$$scope:{ctx:t}}}),n=new Ie({props:{intent:"secondary",disabled:t[1],$$slots:{default:[Ki]},$$scope:{ctx:t}}}),n.$on("click",function(){se(t[0])&&t[0].apply(this,arguments)}),{c(){I(e.$$.fragment),r=M(),I(n.$$.fragment)},m(o,s){E(e,o,s),h(o,r,s),E(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){d(e.$$.fragment,o),d(n.$$.fragment,o),i=!1},d(o){o&&p(r),b(e,o),b(n,o)}}}function qi(t){let e,r;return e=new we({props:{$$slots:{default:[ji]},$$scope:{ctx:t}}}),{c(){I(e.$$.fragment)},m(n,i){E(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){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Ji(t){let e,r,n,i,o,s,l,c,a;return r=new Ve({props:{$$slots:{default:[Fi]},$$scope:{ctx:t}}}),i=new fe({props:{$$slots:{default:[xi]},$$scope:{ctx:t}}}),s=new Je({props:{$$slots:{default:[qi]},$$scope:{ctx:t}}}),{c(){e=w("form"),I(r.$$.fragment),n=M(),I(i.$$.fragment),o=M(),I(s.$$.fragment),A(e,"class","svelte-favd20")},m(u,g){h(u,e,g),E(r,e,null),C(e,n),E(i,e,null),C(e,o),E(s,e,null),l=!0,c||(a=pe(e,"submit",ct(t[5])),c=!0)},p(u,[g]){const _={};g&512&&(_.$$scope={dirty:g,ctx:u}),r.$set(_);const y={};g&540&&(y.$$scope={dirty:g,ctx:u}),i.$set(y);const $={};g&515&&($.$$scope={dirty:g,ctx:u}),s.$set($)},i(u){l||(f(r.$$.fragment,u),f(i.$$.fragment,u),f(s.$$.fragment,u),l=!0)},o(u){d(r.$$.fragment,u),d(i.$$.fragment,u),d(s.$$.fragment,u),l=!1},d(u){u&&p(e),b(r),b(i),b(s),c=!1,a()}}}function Vi(t,e,r){let n,i,o,{onContinue:s}=e,{onClose:l}=e,{processing:c}=e,{lastError:a}=e;const u=async()=>{const _=Oi(n);_?r(2,i=_):s({email:n})};An(async()=>{r(2,i=(a==null?void 0:a.message)??"")});function g(){n=this.value,r(3,n)}return t.$$set=_=>{"onContinue"in _&&r(6,s=_.onContinue),"onClose"in _&&r(0,l=_.onClose),"processing"in _&&r(1,c=_.processing),"lastError"in _&&r(7,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,g]}class Wi extends R{constructor(e){super(),N(this,e,Vi,Ji,Q,{onContinue:6,onClose:0,processing:1,lastError:7},Li)}}function zi(t){F(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 Xi(t){let e,r;const n=t[1].default,i=W(n,t,t[0],null);return{c(){e=w("div"),i&&i.c(),A(e,"class","rcb-modal-backdrop svelte-17tslso")},m(o,s){h(o,e,s),i&&i.m(e,null),r=!0},p(o,[s]){i&&i.p&&(!r||s&1)&&X(i,n,o,o[0],r?z(n,o[0],s,null):Z(o[0]),null)},i(o){r||(f(i,o),r=!0)},o(o){d(i,o),r=!1},d(o){o&&p(e),i&&i.d(o)}}}function Zi(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(0,i=o.$$scope)},[i,n]}class eo extends R{constructor(e){super(),N(this,e,Zi,Xi,Q,{},zi)}}function to(t){F(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 no(t){let e,r,n,i;const o=t[2].default,s=W(o,t,t[1],null);return{c(){e=w("div"),r=w("main"),s&&s.c(),A(r,"class",n=me(`rcb-modal-main ${t[0]?"rcb-modal-dark":""}`)+" svelte-z3twhy"),A(e,"class","rcb-modal-container svelte-z3twhy")},m(l,c){h(l,e,c),C(e,r),s&&s.m(r,null),i=!0},p(l,[c]){s&&s.p&&(!i||c&2)&&X(s,o,l,l[1],i?z(o,l[1],c,null):Z(l[1]),null),(!i||c&1&&n!==(n=me(`rcb-modal-main ${l[0]?"rcb-modal-dark":""}`)+" svelte-z3twhy"))&&A(r,"class",n)},i(l){i||(f(s,l),i=!0)},o(l){d(s,l),i=!1},d(l){l&&p(e),s&&s.d(l)}}}function ro(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 io extends R{constructor(e){super(),N(this,e,ro,no,Q,{dark:0},to)}}function oo(t){let e;const r=t[1].default,n=W(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)&&X(n,r,i,i[2],e?z(r,i[2],o,null):Z(i[2]),null)},i(i){e||(f(n,i),e=!0)},o(i){d(n,i),e=!1},d(i){n&&n.d(i)}}}function so(t){let e,r;return e=new eo({props:{$$slots:{default:[lo]},$$scope:{ctx:t}}}),{c(){I(e.$$.fragment)},m(n,i){E(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){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function lo(t){let e;const r=t[1].default,n=W(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)&&X(n,r,i,i[2],e?z(r,i[2],o,null):Z(i[2]),null)},i(i){e||(f(n,i),e=!0)},o(i){d(n,i),e=!1},d(i){n&&n.d(i)}}}function co(t){let e,r,n,i;const o=[so,oo],s=[];function l(c,a){return c[0]?0:1}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=re()},m(c,a){s[e].m(c,a),h(c,n,a),i=!0},p(c,[a]){let u=e;e=l(c),e===u?s[e].p(c,a):(K(),d(s[u],1,1,()=>{s[u]=null}),j(),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){d(r),i=!1},d(c){c&&p(n),s[e].d(c)}}}function ao(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 uo extends R{constructor(e){super(),N(this,e,ao,co,Q,{condition:0})}}const fo=t=>({}),Ct=t=>({});function go(t){let e,r;const n=t[1].header,i=W(n,t,t[2],Ct),o=t[1].default,s=W(o,t,t[2],null);return{c(){i&&i.c(),e=M(),s&&s.c()},m(l,c){i&&i.m(l,c),h(l,e,c),s&&s.m(l,c),r=!0},p(l,c){i&&i.p&&(!r||c&4)&&X(i,n,l,l[2],r?z(n,l[2],c,fo):Z(l[2]),Ct),s&&s.p&&(!r||c&4)&&X(s,o,l,l[2],r?z(o,l[2],c,null):Z(l[2]),null)},i(l){r||(f(i,l),f(s,l),r=!0)},o(l){d(i,l),d(s,l),r=!1},d(l){l&&p(e),i&&i.d(l),s&&s.d(l)}}}function mo(t){let e,r;return e=new io({props:{dark:t[0],$$slots:{default:[go]},$$scope:{ctx:t}}}),{c(){I(e.$$.fragment)},m(n,i){E(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){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function po(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 Tt extends R{constructor(e){super(),N(this,e,po,mo,Q,{dark:0})}}const ho="0.6.0",_o="https://api.revenuecat.com";var Re;(function(t){t[t.CONTINUE=100]="CONTINUE",t[t.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",t[t.PROCESSING=102]="PROCESSING",t[t.EARLY_HINTS=103]="EARLY_HINTS",t[t.OK=200]="OK",t[t.CREATED=201]="CREATED",t[t.ACCEPTED=202]="ACCEPTED",t[t.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",t[t.NO_CONTENT=204]="NO_CONTENT",t[t.RESET_CONTENT=205]="RESET_CONTENT",t[t.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",t[t.MULTI_STATUS=207]="MULTI_STATUS",t[t.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",t[t.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",t[t.MOVED_TEMPORARILY=302]="MOVED_TEMPORARILY",t[t.SEE_OTHER=303]="SEE_OTHER",t[t.NOT_MODIFIED=304]="NOT_MODIFIED",t[t.USE_PROXY=305]="USE_PROXY",t[t.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",t[t.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",t[t.BAD_REQUEST=400]="BAD_REQUEST",t[t.UNAUTHORIZED=401]="UNAUTHORIZED",t[t.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",t[t.FORBIDDEN=403]="FORBIDDEN",t[t.NOT_FOUND=404]="NOT_FOUND",t[t.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",t[t.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",t[t.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",t[t.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",t[t.CONFLICT=409]="CONFLICT",t[t.GONE=410]="GONE",t[t.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",t[t.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",t[t.REQUEST_TOO_LONG=413]="REQUEST_TOO_LONG",t[t.REQUEST_URI_TOO_LONG=414]="REQUEST_URI_TOO_LONG",t[t.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",t[t.REQUESTED_RANGE_NOT_SATISFIABLE=416]="REQUESTED_RANGE_NOT_SATISFIABLE",t[t.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",t[t.IM_A_TEAPOT=418]="IM_A_TEAPOT",t[t.INSUFFICIENT_SPACE_ON_RESOURCE=419]="INSUFFICIENT_SPACE_ON_RESOURCE",t[t.METHOD_FAILURE=420]="METHOD_FAILURE",t[t.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",t[t.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",t[t.LOCKED=423]="LOCKED",t[t.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",t[t.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",t[t.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",t[t.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",t[t.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",t[t.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",t[t.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",t[t.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",t[t.BAD_GATEWAY=502]="BAD_GATEWAY",t[t.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",t[t.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",t[t.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",t[t.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",t[t.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"})(Re||(Re={}));function We(t){return t?t.startsWith("rcb_sb_"):!1}async function de(t,e){const{apiKey:r,body:n,headers:i,httpConfig:o}=e,l=`${(o==null?void 0:o.proxyURL)??_o}${t.urlPath()}`;try{const c=await fetch(l,{method:t.method,headers:Io(r,i,o==null?void 0:o.additionalHeaders),body:Eo(n)});return await Ao(c,t),await c.json()}catch(c){throw c instanceof TypeError?new J(V.NetworkError,Ee.getPublicMessage(V.NetworkError),c.message):c}}async function Ao(t,e){const r=t.status;if(r>=Re.INTERNAL_SERVER_ERROR)ze(e,r,await t.text());else if(r>=Re.BAD_REQUEST){const n=await t.json(),i=n?JSON.stringify(n):null,o=n==null?void 0:n.code,s=n==null?void 0:n.message;if(o!=null){const l=Ee.convertCodeToBackendErrorCode(o);if(l==null)ze(e,r,i);else throw J.getForBackendError(l,s)}else ze(e,r,i)}}function ze(t,e,r){throw new J(V.UnknownBackendError,`Unknown backend error. Request: ${t.name}. Status code: ${e}. Body: ${r}.`)}function Eo(t){return t==null?null:JSON.stringify(t)}const Mt="Authorization",Qt="Content-Type",Nt="Accept",Rt="X-Platform",Ut="X-Version",Ot="X-Is-Sandbox",bo=new Set([Mt,Qt,Nt,Rt,Ut,Ot]);function Io(t,e,r){let n={[Mt]:`Bearer ${t}`,[Qt]:"application/json",[Nt]:"application/json",[Rt]:"web",[Ut]:ho,[Ot]:`${We(t)}`};return e&&(n={...n,...e}),r&&(n={...r,...n}),n}const St="/v1/subscribers",Ue="/rcbilling/v1";class wo{constructor(e){P(this,"appUserId");P(this,"method","GET");P(this,"name","getOfferings");this.appUserId=e}urlPath(){const e=encodeURIComponent(this.appUserId);return`${St}/${e}/offerings`}}class ko{constructor(){P(this,"method","POST");P(this,"name","subscribe")}urlPath(){return`${Ue}/subscribe`}}class yo{constructor(e,r,n){P(this,"method","GET");P(this,"name","getProducts");P(this,"appUserId");P(this,"productIds");P(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?`&currency=${this.currency}`:"";return`${Ue}/subscribers/${e}/products?id=${r}${n}`}}class vo{constructor(e){P(this,"method","GET");P(this,"name","getCustomerInfo");P(this,"appUserId");this.appUserId=e}urlPath(){const e=encodeURIComponent(this.appUserId);return`${St}/${e}`}}class $o{constructor(){P(this,"method","GET");P(this,"name","getBrandingInfo")}urlPath(){return`${Ue}/branding`}}class Bo{constructor(e){P(this,"method","GET");P(this,"name","getCheckoutStatus");P(this,"operationSessionId");this.operationSessionId=e}urlPath(){return`${Ue}/checkout/${this.operationSessionId}`}}const Xe={};class Do{constructor(e,r=Xe){P(this,"API_KEY");P(this,"httpConfig");this.API_KEY=e,this.httpConfig=r}async getOfferings(e){return await de(new wo(e),{apiKey:this.API_KEY,httpConfig:this.httpConfig})}async getCustomerInfo(e){return await de(new vo(e),{apiKey:this.API_KEY,httpConfig:this.httpConfig})}async getProducts(e,r,n){return await de(new yo(e,r,n),{apiKey:this.API_KEY,httpConfig:this.httpConfig})}async getBrandingInfo(){return await de(new $o,{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}),await de(new ko,{apiKey:this.API_KEY,body:s,httpConfig:this.httpConfig})}async getCheckoutStatus(e){return await de(new Bo(e),{apiKey:this.API_KEY,httpConfig:this.httpConfig})}}const Po="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 Co(t){let e,r;return{c(){e=w("img"),ne(e.src,r=Po)||A(e,"src",r),A(e,"alt","icon"),A(e,"class","rcb-ui-asset-icon")},m(n,i){h(n,e,i)},p:k,i:k,o:k,d(n){n&&p(e)}}}class To extends R{constructor(e){super(),N(this,e,null,Co,Q,{})}}function Mo(t){F(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 Qo(t){let e;return{c(){e=w("div"),e.textContent="Sandbox",A(e,"class","svelte-1rhrjxe")},m(r,n){h(r,e,n)},p:k,i:k,o:k,d(r){r&&p(e)}}}class No extends R{constructor(e){super(),N(this,e,null,Qo,Q,{},Mo)}}function Ro(t){F(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 Lt(t){let e,r,n;return r=new Tt({props:{dark:!0,$$slots:{header:[Fo],default:[Uo]},$$scope:{ctx:t}}}),{c(){e=w("div"),I(r.$$.fragment),A(e,"class","rcb-ui-aside svelte-17btec4")},m(i,o){h(i,e,o),E(r,e,null),n=!0},p(i,o){const s={};o&67108878&&(s.$$scope={dirty:o,ctx:i}),r.$set(s)},i(i){n||(f(r.$$.fragment,i),n=!0)},o(i){d(r.$$.fragment,i),n=!1},d(i){i&&p(e),b(r)}}}function Ft(t){let e,r;return e=new gt({props:{productDetails:t[2],purchaseOption:t[8]}}),{c(){I(e.$$.fragment)},m(n,i){E(e,n,i),r=!0},p(n,i){const o={};i&4&&(o.productDetails=n[2]),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Uo(t){let e,r,n=t[2]&&t[8]&&Ft(t);return{c(){n&&n.c(),e=re()},m(i,o){n&&n.m(i,o),h(i,e,o),r=!0},p(i,o){i[2]&&i[8]?n?(n.p(i,o),o&4&&f(n,1)):(n=Ft(i),n.c(),f(n,1),n.m(e.parentNode,e)):n&&(K(),d(n,1,1,()=>{n=null}),j())},i(i){r||(f(n),r=!0)},o(i){d(n),r=!1},d(i){i&&p(e),n&&n.d(i)}}}function Oo(t){let e,r;return e=new To({}),{c(){I(e.$$.fragment)},m(n,i){E(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function So(t){let e,r;return e=new No({}),{c(){I(e.$$.fragment)},m(n,i){E(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Lo(t){let e,r,n,i,o,s,l;e=new At({props:{brandingInfo:t[3]}});const c=[So,Oo],a=[];function u(g,_){return _&2&&(n=null),n==null&&(n=!!g[1].isSandbox()),n?0:1}return i=u(t,-1),o=a[i]=c[i](t),{c(){I(e.$$.fragment),r=M(),o.c(),s=re()},m(g,_){E(e,g,_),h(g,r,_),a[i].m(g,_),h(g,s,_),l=!0},p(g,_){const y={};_&8&&(y.brandingInfo=g[3]),e.$set(y);let $=i;i=u(g,_),i!==$&&(K(),d(a[$],1,1,()=>{a[$]=null}),j(),o=a[i],o||(o=a[i]=c[i](g),o.c()),f(o,1),o.m(s.parentNode,s))},i(g){l||(f(e.$$.fragment,g),f(o),l=!0)},o(g){d(e.$$.fragment,g),d(o),l=!1},d(g){g&&(p(r),p(s)),b(e,g),a[i].d(g)}}}function Fo(t){let e,r;return e=new Ve({props:{slot:"header",$$slots:{default:[Lo]},$$scope:{ctx:t}}}),{c(){I(e.$$.fragment)},m(n,i){E(e,n,i),r=!0},p(n,i){const o={};i&67108874&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function xt(t){let e,r;return e=new gt({props:{productDetails:t[2],purchaseOption:t[8]}}),{c(){I(e.$$.fragment)},m(n,i){E(e,n,i),r=!0},p(n,i){const o={};i&4&&(o.productDetails=n[2]),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Yt(t){let e,r;return e=new qe({}),{c(){I(e.$$.fragment)},m(n,i){E(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Gt(t){let e,r;return e=new Wi({props:{onContinue:t[11],onClose:t[10],processing:t[6]==="processing-auth-info",lastError:t[5]}}),{c(){I(e.$$.fragment)},m(n,i){E(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){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Ht(t){let e,r;return e=new Ui({props:{paymentInfoCollectionMetadata:t[4],onContinue:t[11],onClose:t[10],onError:t[12],processing:t[6]==="polling-purchase-status",productDetails:t[2],purchaseOptionToUse:t[8]}}),{c(){I(e.$$.fragment)},m(n,i){E(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&4&&(o.productDetails=n[2]),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Kt(t){let e,r;return e=new qe({}),{c(){I(e.$$.fragment)},m(n,i){E(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function jt(t){var n;let e,r;return e=new Lr({props:{brandingInfo:t[3],lastError:t[5]??new q(L.UnknownError,"Unknown error without state set."),supportEmail:(n=t[3])==null?void 0:n.seller_company_support_email,onContinue:t[13]}}),{c(){I(e.$$.fragment)},m(i,o){E(e,i,o),r=!0},p(i,o){var l;const s={};o&8&&(s.brandingInfo=i[3]),o&32&&(s.lastError=i[5]??new q(L.UnknownError,"Unknown error without state set.")),o&8&&(s.supportEmail=(l=i[3])==null?void 0:l.seller_company_support_email),e.$set(s)},i(i){r||(f(e.$$.fragment,i),r=!0)},o(i){d(e.$$.fragment,i),r=!1},d(i){b(e,i)}}}function qt(t){let e,r;return e=new Jr({props:{brandingInfo:t[3],onContinue:t[11]}}),{c(){I(e.$$.fragment)},m(n,i){E(e,n,i),r=!0},p(n,i){const o={};i&8&&(o.brandingInfo=n[3]),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function xo(t){let e,r,n,i,o,s,l,c,a=t[6]==="present-offer"&&t[2]&&t[8]&&xt(t),u=t[6]==="present-offer"&&!t[2]&&Yt(),g=(t[6]==="needs-auth-info"||t[6]==="processing-auth-info")&&Gt(t),_=t[4]&&(t[6]==="needs-payment-info"||t[6]==="polling-purchase-status")&&t[2]&&t[8]&&Ht(t),y=t[6]==="loading"&&Kt(),$=t[6]==="error"&&jt(t),D=t[6]==="success"&&qt(t);return{c(){a&&a.c(),e=M(),u&&u.c(),r=M(),g&&g.c(),n=M(),_&&_.c(),i=M(),y&&y.c(),o=M(),$&&$.c(),s=M(),D&&D.c(),l=re()},m(m,v){a&&a.m(m,v),h(m,e,v),u&&u.m(m,v),h(m,r,v),g&&g.m(m,v),h(m,n,v),_&&_.m(m,v),h(m,i,v),y&&y.m(m,v),h(m,o,v),$&&$.m(m,v),h(m,s,v),D&&D.m(m,v),h(m,l,v),c=!0},p(m,v){m[6]==="present-offer"&&m[2]&&m[8]?a?(a.p(m,v),v&68&&f(a,1)):(a=xt(m),a.c(),f(a,1),a.m(e.parentNode,e)):a&&(K(),d(a,1,1,()=>{a=null}),j()),m[6]==="present-offer"&&!m[2]?u?v&68&&f(u,1):(u=Yt(),u.c(),f(u,1),u.m(r.parentNode,r)):u&&(K(),d(u,1,1,()=>{u=null}),j()),m[6]==="needs-auth-info"||m[6]==="processing-auth-info"?g?(g.p(m,v),v&64&&f(g,1)):(g=Gt(m),g.c(),f(g,1),g.m(n.parentNode,n)):g&&(K(),d(g,1,1,()=>{g=null}),j()),m[4]&&(m[6]==="needs-payment-info"||m[6]==="polling-purchase-status")&&m[2]&&m[8]?_?(_.p(m,v),v&84&&f(_,1)):(_=Ht(m),_.c(),f(_,1),_.m(i.parentNode,i)):_&&(K(),d(_,1,1,()=>{_=null}),j()),m[6]==="loading"?y?v&64&&f(y,1):(y=Kt(),y.c(),f(y,1),y.m(o.parentNode,o)):y&&(K(),d(y,1,1,()=>{y=null}),j()),m[6]==="error"?$?($.p(m,v),v&64&&f($,1)):($=jt(m),$.c(),f($,1),$.m(s.parentNode,s)):$&&(K(),d($,1,1,()=>{$=null}),j()),m[6]==="success"?D?(D.p(m,v),v&64&&f(D,1)):(D=qt(m),D.c(),f(D,1),D.m(l.parentNode,l)):D&&(K(),d(D,1,1,()=>{D=null}),j())},i(m){c||(f(a),f(u),f(g),f(_),f(y),f($),f(D),c=!0)},o(m){d(a),d(u),d(g),d(_),d(y),d($),d(D),c=!1},d(m){m&&(p(e),p(r),p(n),p(i),p(o),p(s),p(l)),a&&a.d(m),u&&u.d(m),g&&g.d(m),_&&_.d(m),y&&y.d(m),$&&$.d(m),D&&D.d(m)}}}function Yo(t){let e,r=t[9].includes(t[6]),n,i,o,s,l=r&&Lt(t);return o=new Tt({props:{$$slots:{default:[xo]},$$scope:{ctx:t}}}),{c(){e=w("div"),l&&l.c(),n=M(),i=w("div"),I(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){h(c,e,a),l&&l.m(e,null),C(e,n),C(e,i),E(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=Lt(c),l.c(),f(l,1),l.m(e,n)):l&&(K(),d(l,1,1,()=>{l=null}),j());const u={};a&67108988&&(u.$$scope={dirty:a,ctx:c}),o.$set(u)},i(c){s||(f(l),f(o.$$.fragment,c),s=!0)},o(c){d(l),d(o.$$.fragment,c),s=!1},d(c){c&&p(e),l&&l.d(),b(o)}}}function Go(t){let e,r,n;return r=new uo({props:{condition:t[0],$$slots:{default:[Yo]},$$scope:{ctx:t}}}),{c(){e=w("div"),I(r.$$.fragment),A(e,"class","rcb-ui-container svelte-17btec4")},m(i,o){h(i,e,o),E(r,e,null),n=!0},p(i,[o]){const s={};o&1&&(s.condition=i[0]),o&67108990&&(s.$$scope={dirty:o,ctx:i}),r.$set(s)},i(i){n||(f(r.$$.fragment,i),n=!0)},o(i){d(r.$$.fragment,i),n=!1},d(i){i&&p(e),b(r)}}}function Ho(t,e,r){let{asModal:n=!0}=e,{customerEmail:i}=e,{appUserId:o}=e,{rcPackage:s}=e,{purchaseOption:l}=e,{onFinished:c}=e,{onError:a}=e,{onClose:u}=e,{purchases:g}=e,{backend:_}=e,{purchaseOperationHelper:y}=e;const $=Object.entries(ve).map(([B,et])=>`--rc-color-${B}: ${et}`).join("; ");let D=null,m=null,v=null,U=null;const T=s.rcBillingProduct.identifier??null,Se=s.rcBillingProduct.defaultPurchaseOption,G=l||Se;let O="present-offer";const Le=["present-offer","needs-auth-info","processing-auth-info","needs-payment-info","polling-purchase-status","loading"];De(async()=>{if(r(2,D=s.rcBillingProduct),r(3,m=await _.getBrandingInfo()),O==="present-offer"){i?Jt():r(6,O="needs-auth-info");return}});const Fe=()=>{u()},Jt=()=>{if(T===null){$e(new q(L.ErrorSettingUpPurchase,"Product ID was not set before purchase."));return}else O==="present-offer"&&r(6,O="loading");if(!i){$e(new q(L.MissingEmailError));return}y.startPurchase(o,T,G,i,s.rcBillingProduct.presentedOfferingContext).then(B=>{if(B.next_action==="collect_payment_info"){r(5,U=null),r(6,O="needs-payment-info"),r(4,v=B);return}if(B.next_action==="completed"){r(5,U=null),r(6,O="success");return}}).catch(B=>{$e(B)})},ls=B=>{if(O==="needs-auth-info"){B&&(r(14,i=B.email),r(6,O="processing-auth-info")),Jt();return}if(O==="needs-payment-info"){r(6,O="polling-purchase-status"),y.pollCurrentPurchaseForCompletion().then(()=>{r(6,O="success")}).catch(et=>{$e(et)});return}if(O==="success"||O==="error"){c();return}r(6,O="success")},$e=B=>{if(O==="processing-auth-info"){r(5,U=B),r(6,O="needs-auth-info");return}r(5,U=B),r(6,O="error")},cs=()=>{a(U??new q(L.UnknownError,"Unknown error without state set."))};return t.$$set=B=>{"asModal"in B&&r(0,n=B.asModal),"customerEmail"in B&&r(14,i=B.customerEmail),"appUserId"in B&&r(15,o=B.appUserId),"rcPackage"in B&&r(16,s=B.rcPackage),"purchaseOption"in B&&r(17,l=B.purchaseOption),"onFinished"in B&&r(18,c=B.onFinished),"onError"in B&&r(19,a=B.onError),"onClose"in B&&r(20,u=B.onClose),"purchases"in B&&r(1,g=B.purchases),"backend"in B&&r(21,_=B.backend),"purchaseOperationHelper"in B&&r(22,y=B.purchaseOperationHelper)},[n,g,D,m,v,U,O,$,G,Le,Fe,ls,$e,cs,i,o,s,l,c,a,u,_,y]}class Ko extends R{constructor(e){super(),N(this,e,Ho,Go,Q,{asModal:0,customerEmail:14,appUserId:15,rcPackage:16,purchaseOption:17,onFinished:18,onError:19,onClose:20,purchases:1,backend:21,purchaseOperationHelper:22},Ro)}}function jo(t){return t.expires_date==null?!0:new Date(t.expires_date)>new Date}function qo(t,e,r,n){const i=e.product_identifier;if(i in r)return Jo(t,e,r[i]);if(i in n)return Vo(t,e,n[i]);throw new J(V.CustomerInfoError,"Could not find entitlement product in subscriptions or non-subscriptions.")}function Jo(t,e,r){return{identifier:t,isActive:jo(e),willRenew:Xo(e,r),store:(r==null?void 0:r.store)??"unknown",latestPurchaseDate:new Date(e.purchase_date),originalPurchaseDate:new Date(e.purchase_date),expirationDate:Oe(e.expires_date),productIdentifier:e.product_identifier,unsubscribeDetectedAt:Oe(r==null?void 0:r.unsubscribe_detected_at),billingIssueDetectedAt:Oe(r==null?void 0:r.billing_issues_detected_at),isSandbox:(r==null?void 0:r.is_sandbox)??!1,periodType:(r==null?void 0:r.period_type)??"normal"}}function Vo(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 Wo(t,e,r){const n={},i={};for(const o in t){const s=qo(o,t[o],e,r);n[o]=s,s.isActive&&(i[o]=s)}return{all:n,active:i}}function Oe(t){return t==null?null:new Date(t)}function zo(t){const e=es(t),r=t.subscriber,n=ns(r.non_subscriptions);return{entitlements:Wo(r.entitlements,r.subscriptions,n),allExpirationDatesByProduct:e,allPurchaseDatesByProduct:Zo(t,n),activeSubscriptions:ts(e),managementURL:r.management_url,requestDate:new Date(t.request_date),firstSeenDate:new Date(r.first_seen),originalPurchaseDate:Oe(r.original_purchase_date),originalAppUserId:t.subscriber.original_app_user_id}}function Xo(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 Zo(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 es(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 ts(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 ns(t){const e={};for(const r in t){if(t[r].length===0)continue;const n=t[r].length;e[r]=t[r][n-1]}return e}function rs(t){if(!/^rcb_[a-zA-Z0-9_.-]+$/.test(t))throw new J(V.InvalidCredentialsError,"Invalid API key. Use your RevenueCat Billing API key.")}function is(t){if(new Set(["no_user","null","none","nil","(null)","NaN","\\x00","","unidentified","undefined","unknown"]).has(t)||t.includes("/"))throw new J(V.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 os(t){if(t!=null&&t.endsWith("/"))throw new J(V.ConfigurationError,"Invalid proxy URL. The proxy URL should not end with a trailing slash.")}function ss(t){if(t){for(const e in t)if(bo.has(e))throw new J(V.ConfigurationError,"Invalid additional headers. Some headers are reserved for internal use.")}}const te=class te{constructor(e,r,n=Xe){P(this,"_API_KEY");P(this,"_appUserId");P(this,"backend");P(this,"purchaseOperationHelper");P(this,"toOfferings",(e,r)=>{const n={};r.product_details.forEach(s=>{n[s.identifier]=s});const i={};e.offerings.forEach(s=>{const l=s.identifier===e.current_offering_id,c=rn(l,s,n,e.targeting);c!=null&&(i[s.identifier]=c)});const o=e.current_offering_id?i[e.current_offering_id]??null:null;return Object.keys(i).length==0&&Y.debugLog("Empty offerings. Please make sure you've configured offerings correctly in the RevenueCat dashboard and that the products are properly configured."),{all:i,current:o}});this._API_KEY=e,this._appUserId=r,We(e)&&Y.debugLog("Initializing Purchases SDK with sandbox API Key"),this.backend=new Do(this._API_KEY,n),this.purchaseOperationHelper=new Kn(this.backend)}static setLogLevel(e){Y.setLogLevel(e)}static getSharedInstance(){if(te.isConfigured())return te.instance;throw new pt}static isConfigured(){return te.instance!==void 0}static configure(e,r,n=Xe){return te.instance!==void 0&&Y.warnLog("Purchases is already initialized. You normally should only configure Purchases once. Creating and returning new instance."),rs(e),is(r),os(n.proxyURL),ss(n.additionalHeaders),te.instance=new te(e,r,n),te.getSharedInstance()}async getOfferings(e){Si(e==null?void 0:e.currency);const r=this._appUserId,n=await this.backend.getOfferings(r),i=n.offerings.flatMap(s=>s.packages).map(s=>s.platform_product_identifier),o=await this.backend.getProducts(r,i,e==null?void 0:e.currency);return this.logMissingProductIds(i,o.product_details),this.toOfferings(n,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 Y.debugLog(`Presenting purchase form for package ${r.identifier}`),new Promise((u,g)=>{new Ko({target:l,props:{appUserId:a,rcPackage:r,purchaseOption:n,customerEmail:o,onFinished:async()=>{Y.debugLog("Purchase finished"),l.innerHTML="",u({customerInfo:await this._getCustomerInfoForUserId(a)})},onClose:()=>{l.innerHTML="",Y.debugLog("Purchase cancelled by user"),g(new J(V.UserCancelledError))},onError:_=>{l.innerHTML="",g(J.getForPurchasesFlowError(_))},purchases:this,backend:this.backend,purchaseOperationHelper:this.purchaseOperationHelper,asModal:c}})})}async getCustomerInfo(){return await this._getCustomerInfoForUserId(this._appUserId)}getAppUserId(){return this._appUserId}async changeUser(e){return this._appUserId=e,await this.getCustomerInfo()}logMissingProductIds(e,r){const n={};r.forEach(o=>n[o.identifier]=o);const i=[];e.forEach(o=>{n[o]===void 0&&i.push(o)}),i.length>0&&Y.debugLog(`Could not find product data for product ids:
8
8
  ${i.join()}.
9
- Please check that your product configuration is correct.`)}isSandbox(){return ze(this._API_KEY)}close(){te.instance===this?te.instance=void 0:G.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 zo(r)}};M(te,"instance");let et=te;H.ErrorCode=Z,H.LogLevel=x,H.PackageType=rt,H.Purchases=et,H.PurchasesError=J,H.UninitializedPurchasesError=ht,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})});
9
+ Please check that your product configuration is correct.`)}isSandbox(){return We(this._API_KEY)}close(){te.instance===this?te.instance=void 0:Y.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 zo(r)}};P(te,"instance");let Ze=te;H.ErrorCode=V,H.LogLevel=x,H.PackageType=nt,H.Purchases=Ze,H.PurchasesError=J,H.UninitializedPurchasesError=pt,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})});