@whop/checkout 0.0.33 → 0.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +90 -0
- package/dist/static/checkout/chunk-IG6RUVWW.mjs +1 -0
- package/dist/static/checkout/index.cjs +1 -1
- package/dist/static/checkout/index.js +1 -1
- package/dist/static/checkout/index.mjs +1 -1
- package/dist/static/checkout/loader.cjs +1 -1
- package/dist/static/checkout/loader.js +1 -1
- package/dist/static/checkout/loader.mjs +1 -1
- package/dist/static/checkout/util.cjs +1 -1
- package/dist/static/checkout/util.d.mts +34 -2
- package/dist/static/checkout/util.d.ts +34 -2
- package/dist/static/checkout/util.js +1 -1
- package/dist/static/checkout/util.mjs +1 -1
- package/package.json +1 -1
- package/dist/static/checkout/chunk-NLBVSA5C.mjs +0 -1
package/README.md
CHANGED
|
@@ -28,6 +28,24 @@ This will now mount an iframe inside of the element with the plan id you provide
|
|
|
28
28
|
|
|
29
29
|
You can configure the redirect url in your [whop's settings](https://whop.com/dashboard/whops/) or in your [company's settings](https://whop.com/dashboard/settings/checkout/) on the dashboard. If both are specified, the redirect url specified in the whop's settings will take precedence.
|
|
30
30
|
|
|
31
|
+
## Available methods
|
|
32
|
+
|
|
33
|
+
### **`submit`**
|
|
34
|
+
|
|
35
|
+
To submit checkout programmatically, you can use the `submit` method on the checkout element.
|
|
36
|
+
First, attach an `id` to the checkout container:
|
|
37
|
+
|
|
38
|
+
```md
|
|
39
|
+
<div id="whop-embedded-checkout" data-whop-checkout-plan-id="plan_XXXXXXXXX"></div>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Then, you can submit the checkout by calling `wco.submit` with the id:
|
|
43
|
+
|
|
44
|
+
```js
|
|
45
|
+
wco.submit("whop-embedded-checkout");
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
|
|
31
49
|
## Available attributes
|
|
32
50
|
|
|
33
51
|
### **`data-whop-checkout-plan-id`**
|
|
@@ -46,6 +64,44 @@ Possible values are `light`, `dark` or `system`.
|
|
|
46
64
|
<div data-whop-checkout-theme="light" data-whop-checkout-plan-id="plan_XXXXXXXXX"></div>
|
|
47
65
|
```
|
|
48
66
|
|
|
67
|
+
### **`data-whop-checkout-theme-accent-color`**
|
|
68
|
+
|
|
69
|
+
**Optional** - The accent color to apply to the checkout embed
|
|
70
|
+
|
|
71
|
+
Possible values are
|
|
72
|
+
- `tomato`
|
|
73
|
+
- `red`
|
|
74
|
+
- `ruby`
|
|
75
|
+
- `crimson`
|
|
76
|
+
- `pink`
|
|
77
|
+
- `plum`
|
|
78
|
+
- `purple`
|
|
79
|
+
- `violet`
|
|
80
|
+
- `iris`
|
|
81
|
+
- `cyan`
|
|
82
|
+
- `teal`
|
|
83
|
+
- `jade`
|
|
84
|
+
- `green`
|
|
85
|
+
- `grass`
|
|
86
|
+
- `brown`
|
|
87
|
+
- `blue`
|
|
88
|
+
- `orange`
|
|
89
|
+
- `indigo`
|
|
90
|
+
- `sky`
|
|
91
|
+
- `mint`
|
|
92
|
+
- `yellow`
|
|
93
|
+
- `amber`
|
|
94
|
+
- `lime`
|
|
95
|
+
- `lemon`
|
|
96
|
+
- `magenta`
|
|
97
|
+
- `gold`
|
|
98
|
+
- `bronze`
|
|
99
|
+
- `gray`
|
|
100
|
+
|
|
101
|
+
```md
|
|
102
|
+
<div data-whop-checkout-theme-accent-color="green" data-whop-checkout-plan-id="plan_XXXXXXXXX"></div>
|
|
103
|
+
```
|
|
104
|
+
|
|
49
105
|
### **`data-whop-checkout-session`**
|
|
50
106
|
|
|
51
107
|
**Optional** - The session id to use for the checkout.
|
|
@@ -66,6 +122,21 @@ Defaults to `false`
|
|
|
66
122
|
<div data-whop-checkout-hide-price="true" data-whop-checkout-plan-id="plan_XXXXXXXXX"></div>
|
|
67
123
|
```
|
|
68
124
|
|
|
125
|
+
### **`data-whop-checkout-hide-submit-button`**
|
|
126
|
+
|
|
127
|
+
**Optional** - Set to `true` to hide the submit button in the embedded checkout form.
|
|
128
|
+
|
|
129
|
+
Defaults to `false`
|
|
130
|
+
|
|
131
|
+
<Note>
|
|
132
|
+
When using this Option, you will need to [programmatically submit](#submit)
|
|
133
|
+
the checkout form.
|
|
134
|
+
</Note>
|
|
135
|
+
|
|
136
|
+
```md
|
|
137
|
+
<div data-whop-checkout-hide-submit-button="true" data-whop-checkout-plan-id="plan_XXXXXXXXX"></div>
|
|
138
|
+
```
|
|
139
|
+
|
|
69
140
|
### **`data-whop-checkout-skip-redirect`**
|
|
70
141
|
|
|
71
142
|
**Optional** - Set to `true` to skip the final redirect and keep the top frame loaded.
|
|
@@ -88,6 +159,25 @@ Defaults to `false`
|
|
|
88
159
|
<div data-whop-checkout-on-complete="onCheckoutComplete" data-whop-checkout-plan-id="plan_XXXXXXXXX"></div>
|
|
89
160
|
```
|
|
90
161
|
|
|
162
|
+
### **`data-whop-checkout-on-state-change`**
|
|
163
|
+
|
|
164
|
+
**Optional** - The callback to call when state of the checkout changes
|
|
165
|
+
|
|
166
|
+
This can be used when programmatically controlling the submit of the checkout embed.
|
|
167
|
+
|
|
168
|
+
```html
|
|
169
|
+
<script>
|
|
170
|
+
window.onCheckoutStateChange = (state) => {
|
|
171
|
+
console.log(state);
|
|
172
|
+
};
|
|
173
|
+
</script>
|
|
174
|
+
|
|
175
|
+
<div
|
|
176
|
+
data-whop-checkout-on-state-change="onCheckoutStateChange"
|
|
177
|
+
data-whop-checkout-plan-id="plan_XXXXXXXXX"
|
|
178
|
+
></div>
|
|
179
|
+
```
|
|
180
|
+
|
|
91
181
|
### **`data-whop-checkout-skip-utm`**
|
|
92
182
|
|
|
93
183
|
By default any utm params from the main page will be forwarded to the checkout embed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var a=true;var o=false;var i,l;try{for(r=r.call(e);!(a=(i=r.next()).done);a=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){o=true;l=e}finally{try{if(!a&&r["return"]!=null)r["return"]()}finally{if(o)throw l}}return n}function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,a){return t(e)||r(e,a)||i(e,a)||n()}function o(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function i(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}var l=["resize","center","complete","state"];function u(e){return o(e.data)=="object"&&e.data!==null&&"event"in e.data&&l.includes(e.data.event)}function s(e,t){function r(r){r.source===e.contentWindow&&u(r)&&t(r.data)}return window.addEventListener("message",r),function(){window.removeEventListener("message",r)}}function c(e,t){var r;var n=new URL(e.src).origin;(r=e.contentWindow)===null||r===void 0?void 0:r.postMessage({__scope:"whop-embedded-checkout",event:"submit"},n)}function f(e,t,r,n,o,i,l,u,s,c,f){var d=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(d.searchParams.set("h",window.location.origin),t&&d.searchParams.set("theme",t),r&&d.searchParams.set("session",r),o&&d.searchParams.set("hide_price","true"),i&&d.searchParams.set("skip_redirect","true"),f&&d.searchParams.set("hide_submit_button","true"),l){var y=true,m=false,v=undefined,h=true,w=false,p=undefined;try{for(var b=Object.entries(l).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),g;!(h=(g=b.next()).done);h=true){var S=a(g.value,2),P=S[0],x=S[1];if(P.startsWith("utm_"))if(Array.isArray(x))try{for(var j=x[Symbol.iterator](),A;!(y=(A=j.next()).done);y=true){var _=A.value;d.searchParams.append(P,_)}}catch(e){m=true;v=e}finally{try{if(!y&&j.return!=null){j.return()}}finally{if(m){throw v}}}else d.searchParams.set(P,x)}}catch(e){w=true;p=e}finally{try{if(!h&&b.return!=null){b.return()}}finally{if(w){throw p}}}}if(u){var k=true,O=false,E=undefined,L=true,W=false,C=undefined;try{for(var I=Object.entries(u)[Symbol.iterator](),R;!(L=(R=I.next()).done);L=true){var U=a(R.value,2),M=U[0],q=U[1];if(q)try{for(var z=Object.entries(q)[Symbol.iterator](),T;!(k=(T=z.next()).done);k=true){var $=a(T.value,2),B=$[0],D=$[1];d.searchParams.set("style.".concat(M,".").concat(B),D.toString())}}catch(e){O=true;E=e}finally{try{if(!k&&z.return!=null){z.return()}}finally{if(O){throw E}}}}}catch(e){W=true;C=e}finally{try{if(!L&&I.return!=null){I.return()}}finally{if(W){throw C}}}}var F=true,G=false,H=undefined;if((s===null||s===void 0?void 0:s.email)&&d.searchParams.set("email",s.email),c)try{for(var J=Object.entries(c)[Symbol.iterator](),K;!(F=(K=J.next()).done);F=true){var N=a(K.value,2),Q=N[0],V=N[1];V&&d.searchParams.set("theme.".concat(Q),V)}}catch(e){G=true;H=e}finally{try{if(!F&&J.return!=null){J.return()}}finally{if(G){throw H}}}return d.toString()}var d=["allow-forms","allow-modals","allow-orientation-lock","allow-pointer-lock","allow-popups","allow-presentation","allow-same-origin","allow-scripts","allow-top-navigation","allow-top-navigation-by-user-activation","allow-downloads"],y="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";export{u as a,s as b,c as c,f as d,d as e,y as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(t){if(Array.isArray(t))return e(t)}function n(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function a(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function o(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var a=true;var o=false;var i,l;try{for(r=r.call(e);!(a=(i=r.next()).done);a=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){o=true;l=e}finally{try{if(!a&&r["return"]!=null)r["return"]()}finally{if(o)throw l}}return n}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e,r){return t(e)||o(e,r)||
|
|
1
|
+
"use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(t){if(Array.isArray(t))return e(t)}function n(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function a(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function o(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var a=true;var o=false;var i,l;try{for(r=r.call(e);!(a=(i=r.next()).done);a=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){o=true;l=e}finally{try{if(!a&&r["return"]!=null)r["return"]()}finally{if(o)throw l}}return n}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e,r){return t(e)||o(e,r)||f(e,r)||i()}function c(e){return t(e)||a(e)||f(e)||i()}function s(e){return r(e)||a(e)||f(e)||l()}function d(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function f(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}var h=["resize","center","complete","state"];function v(e){return d(e.data)=="object"&&e.data!==null&&"event"in e.data&&h.includes(e.data.event)}function w(e,t){function r(r){r.source===e.contentWindow&&v(r)&&t(r.data)}return window.addEventListener("message",r),function(){window.removeEventListener("message",r)}}function y(e,t){var r;var n=new URL(e.src).origin;(r=e.contentWindow)===null||r===void 0?void 0:r.postMessage({__scope:"whop-embedded-checkout",event:"submit"},n)}function m(e,t,r,n,a,o,i,l,c,s,d){var f=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(f.searchParams.set("h",window.location.origin),t&&f.searchParams.set("theme",t),r&&f.searchParams.set("session",r),a&&f.searchParams.set("hide_price","true"),o&&f.searchParams.set("skip_redirect","true"),d&&f.searchParams.set("hide_submit_button","true"),i){var h=true,v=false,w=undefined,y=true,m=false,p=undefined;try{for(var b=Object.entries(i).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),k;!(y=(k=b.next()).done);y=true){var S=u(k.value,2),C=S[0],g=S[1];if(C.startsWith("utm_"))if(Array.isArray(g))try{for(var A=g[Symbol.iterator](),P;!(h=(P=A.next()).done);h=true){var x=P.value;f.searchParams.append(C,x)}}catch(e){v=true;w=e}finally{try{if(!h&&A.return!=null){A.return()}}finally{if(v){throw w}}}else f.searchParams.set(C,g)}}catch(e){m=true;p=e}finally{try{if(!y&&b.return!=null){b.return()}}finally{if(m){throw p}}}}if(l){var I=true,O=false,j=undefined,E=true,_=false,L=undefined;try{for(var M=Object.entries(l)[Symbol.iterator](),T;!(E=(T=M.next()).done);E=true){var U=u(T.value,2),R=U[0],W=U[1];if(W)try{for(var H=Object.entries(W)[Symbol.iterator](),q;!(I=(q=H.next()).done);I=true){var z=u(q.value,2),F=z[0],N=z[1];f.searchParams.set("style.".concat(R,".").concat(F),N.toString())}}catch(e){O=true;j=e}finally{try{if(!I&&H.return!=null){H.return()}}finally{if(O){throw j}}}}}catch(e){_=true;L=e}finally{try{if(!E&&M.return!=null){M.return()}}finally{if(_){throw L}}}}var B=true,V=false,$=undefined;if((c===null||c===void 0?void 0:c.email)&&f.searchParams.set("email",c.email),s)try{for(var D=Object.entries(s)[Symbol.iterator](),G;!(B=(G=D.next()).done);B=true){var J=u(G.value,2),K=J[0],Q=J[1];Q&&f.searchParams.set("theme.".concat(K),Q)}}catch(e){V=true;$=e}finally{try{if(!B&&D.return!=null){D.return()}}finally{if(V){throw $}}}return f.toString()}var p=["allow-forms","allow-modals","allow-orientation-lock","allow-pointer-lock","allow-popups","allow-presentation","allow-same-origin","allow-scripts","allow-top-navigation","allow-top-navigation-by-user-activation","allow-downloads"],b="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";function k(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}if(!e)return;var a=window[e];a===null||a===void 0?void 0:a.apply(void 0,s(r))}function S(e,t){var r;e.addEventListener("checkout:submit",function(t){y(e,t.detail)}),(r=window.wco)===null||r===void 0?void 0:r.frames.set(e,w(e,function(r){switch(r.event){case"resize":{e.style.height="".concat(r.height,"px");break}case"center":{e.scrollIntoView({block:"center",inline:"center"});break}case"complete":{k(t.dataset.whopCheckoutOnComplete,r.plan_id,r.receipt_id);break}case"state":{k(t.dataset.whopCheckoutOnStateChange,r.state);break}}}))}function C(){var e=new URLSearchParams(window.location.search);return Array.from(e.keys()).reduce(function(t,r){if(!r.startsWith("utm_"))return t;var n=e.getAll(r);switch(n.length){case 0:return t;case 1:{t[r]=n[0];break}default:t[r]=n}return t},{})}var g="data-whop-checkout-style-";function A(e){var t={};var r=true,n=false,a=undefined;try{for(var o=e.attributes[Symbol.iterator](),i;!(r=(i=o.next()).done);r=true){var l=i.value;if(l.name.startsWith(g)){var u=l.name.slice(g.length),s=l.value,d=c(u.split("-")),f=d[0],h=d.slice(1);if(f&&h.length>0){var v=h.reduce(function(e,t,r){if(r===0)return t;var n=c(t),a=n[0],o=n.slice(1);return"".concat(e).concat(a.toUpperCase()).concat(o.join(""))},"");var w;(w=t[f])!==null&&w!==void 0?w:t[f]={},t[f][v]=s}}}}catch(e){n=true;a=e}finally{try{if(!r&&o.return!=null){o.return()}}finally{if(n){throw a}}}return t}function P(e){var t={};return e.dataset.whopCheckoutThemeAccentColor&&(t.accentColor=e.dataset.whopCheckoutThemeAccentColor),t}function x(e){var t={};return e.dataset.whopCheckoutPrefillEmail&&(t.email=e.dataset.whopCheckoutPrefillEmail),t}function I(e){var t;var r;if(e.dataset.whopCheckoutMounted)return;var n=e.dataset.whopCheckoutPlanId;if(!n)return;var a=m(n,e.dataset.whopCheckoutTheme,e.dataset.whopCheckoutSession,e.dataset.whopCheckoutOrigin,e.dataset.whopCheckoutHidePrice==="true",e.dataset.whopCheckoutSkipRedirect==="true"||!!e.dataset.whopCheckoutOnComplete,e.dataset.whopCheckoutSkipUtm==="true"?void 0:C(),A(e),x(e),P(e),e.dataset.whopCheckoutHideSubmitButton==="true"),o=document.createElement("iframe");o.src=a,o.style.width="100%",o.style.height="480px",o.style.border="none",o.style.overflow="hidden",(t=o.sandbox).add.apply(t,s(p)),o.allow=b,e.dataset.whopCheckoutMounted="true",e.appendChild(o);var i=e.id;i&&((r=window.wco)===null||r===void 0?void 0:r.identifiedFrames.set(i,o),o.dataset.whopCheckoutIdentifier=i),S(o,e)}if((typeof window==="undefined"?"undefined":d(window))<"u"&&window.wco&&!window.wco.listening){var O=new MutationObserver(function(e){var t=true,r=false,a=undefined;try{for(var o=e[Symbol.iterator](),i;!(t=(i=o.next()).done);t=true){var l=i.value;var c,s,d;var f=true,h=false,v=undefined;try{for(var w=l.addedNodes[Symbol.iterator](),y;!(f=(y=w.next()).done);f=true){var m=y.value;n(m,HTMLElement)&&m.dataset.whopCheckoutPlanId&&I(m)}}catch(e){h=true;v=e}finally{try{if(!f&&w.return!=null){w.return()}}finally{if(h){throw v}}}var p=Array.from(l.removedNodes);var b;var k=true,S=false,C=undefined;try{for(var g=((b=(c=window.wco)===null||c===void 0?void 0:c.frames)!==null&&b!==void 0?b:[])[Symbol.iterator](),A;!(k=(A=g.next()).done);k=true){var P=u(A.value,2),x=P[0],O=P[1];p.includes(x)&&(x.dataset.whopCheckoutIdentifier&&((s=window.wco)===null||s===void 0?void 0:s.identifiedFrames.delete(x.dataset.whopCheckoutIdentifier)),O(),(d=window.wco)===null||d===void 0?void 0:d.frames.delete(x))}}catch(e){S=true;C=e}finally{try{if(!k&&g.return!=null){g.return()}}finally{if(S){throw C}}}}}catch(e){r=true;a=e}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(r){throw a}}}});var j=true,E=false,_=undefined;try{for(var L=document.querySelectorAll("[data-whop-checkout-plan-id]")[Symbol.iterator](),M;!(j=(M=L.next()).done);j=true){var T=M.value;n(T,HTMLElement)&&I(T)}}catch(e){E=true;_=e}finally{try{if(!j&&L.return!=null){L.return()}}finally{if(E){throw _}}}O.observe(document.body,{childList:!0,subtree:!0}),window.wco.listening=!0}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(t){if(Array.isArray(t))return e(t)}function n(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function a(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function o(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var a=true;var o=false;var i,l;try{for(r=r.call(e);!(a=(i=r.next()).done);a=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){o=true;l=e}finally{try{if(!a&&r["return"]!=null)r["return"]()}finally{if(o)throw l}}return n}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e,r){return t(e)||o(e,r)||
|
|
1
|
+
"use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(t){if(Array.isArray(t))return e(t)}function n(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function a(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function o(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var a=true;var o=false;var i,l;try{for(r=r.call(e);!(a=(i=r.next()).done);a=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){o=true;l=e}finally{try{if(!a&&r["return"]!=null)r["return"]()}finally{if(o)throw l}}return n}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e,r){return t(e)||o(e,r)||f(e,r)||i()}function c(e){return t(e)||a(e)||f(e)||i()}function s(e){return r(e)||a(e)||f(e)||l()}function d(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function f(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}(function(){var e=function e(e){return d(e.data)=="object"&&e.data!==null&&"event"in e.data&&y.includes(e.data.event)};var t=function t(t,r){function n(n){n.source===t.contentWindow&&e(n)&&r(n.data)}return window.addEventListener("message",n),function(){window.removeEventListener("message",n)}};var r=function e(e,t){var r;var n=new URL(e.src).origin;(r=e.contentWindow)===null||r===void 0?void 0:r.postMessage({__scope:"whop-embedded-checkout",event:"submit"},n)};var a=function e(e,t,r,n,a,o,i,l,c,s,d){var f=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(f.searchParams.set("h",window.location.origin),t&&f.searchParams.set("theme",t),r&&f.searchParams.set("session",r),a&&f.searchParams.set("hide_price","true"),o&&f.searchParams.set("skip_redirect","true"),d&&f.searchParams.set("hide_submit_button","true"),i){var h=true,v=false,w=undefined,y=true,m=false,p=undefined;try{for(var b=Object.entries(i).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),k;!(y=(k=b.next()).done);y=true){var S=u(k.value,2),C=S[0],g=S[1];if(C.startsWith("utm_"))if(Array.isArray(g))try{for(var A=g[Symbol.iterator](),P;!(h=(P=A.next()).done);h=true){var x=P.value;f.searchParams.append(C,x)}}catch(e){v=true;w=e}finally{try{if(!h&&A.return!=null){A.return()}}finally{if(v){throw w}}}else f.searchParams.set(C,g)}}catch(e){m=true;p=e}finally{try{if(!y&&b.return!=null){b.return()}}finally{if(m){throw p}}}}if(l){var I=true,O=false,j=undefined,E=true,_=false,L=undefined;try{for(var M=Object.entries(l)[Symbol.iterator](),T;!(E=(T=M.next()).done);E=true){var U=u(T.value,2),R=U[0],W=U[1];if(W)try{for(var H=Object.entries(W)[Symbol.iterator](),q;!(I=(q=H.next()).done);I=true){var z=u(q.value,2),F=z[0],N=z[1];f.searchParams.set("style.".concat(R,".").concat(F),N.toString())}}catch(e){O=true;j=e}finally{try{if(!I&&H.return!=null){H.return()}}finally{if(O){throw j}}}}}catch(e){_=true;L=e}finally{try{if(!E&&M.return!=null){M.return()}}finally{if(_){throw L}}}}var B=true,V=false,$=undefined;if((c===null||c===void 0?void 0:c.email)&&f.searchParams.set("email",c.email),s)try{for(var D=Object.entries(s)[Symbol.iterator](),G;!(B=(G=D.next()).done);B=true){var J=u(G.value,2),K=J[0],Q=J[1];Q&&f.searchParams.set("theme.".concat(K),Q)}}catch(e){V=true;$=e}finally{try{if(!B&&D.return!=null){D.return()}}finally{if(V){throw $}}}return f.toString()};var o=function e(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}if(!e)return;var a=window[e];a===null||a===void 0?void 0:a.apply(void 0,s(r))};var i=function e(e,n){var a;e.addEventListener("checkout:submit",function(t){r(e,t.detail)}),(a=window.wco)===null||a===void 0?void 0:a.frames.set(e,t(e,function(t){switch(t.event){case"resize":{e.style.height="".concat(t.height,"px");break}case"center":{e.scrollIntoView({block:"center",inline:"center"});break}case"complete":{o(n.dataset.whopCheckoutOnComplete,t.plan_id,t.receipt_id);break}case"state":{o(n.dataset.whopCheckoutOnStateChange,t.state);break}}}))};var l=function e(){var e=new URLSearchParams(window.location.search);return Array.from(e.keys()).reduce(function(t,r){if(!r.startsWith("utm_"))return t;var n=e.getAll(r);switch(n.length){case 0:return t;case 1:{t[r]=n[0];break}default:t[r]=n}return t},{})};var f=function e(e){var t={};var r=true,n=false,a=undefined;try{for(var o=e.attributes[Symbol.iterator](),i;!(r=(i=o.next()).done);r=true){var l=i.value;if(l.name.startsWith(b)){var u=l.name.slice(b.length),s=l.value,d=c(u.split("-")),f=d[0],h=d.slice(1);if(f&&h.length>0){var v=h.reduce(function(e,t,r){if(r===0)return t;var n=c(t),a=n[0],o=n.slice(1);return"".concat(e).concat(a.toUpperCase()).concat(o.join(""))},"");var w;(w=t[f])!==null&&w!==void 0?w:t[f]={},t[f][v]=s}}}}catch(e){n=true;a=e}finally{try{if(!r&&o.return!=null){o.return()}}finally{if(n){throw a}}}return t};var h=function e(e){var t={};return e.dataset.whopCheckoutThemeAccentColor&&(t.accentColor=e.dataset.whopCheckoutThemeAccentColor),t};var v=function e(e){var t={};return e.dataset.whopCheckoutPrefillEmail&&(t.email=e.dataset.whopCheckoutPrefillEmail),t};var w=function e(e){var t;var r;if(e.dataset.whopCheckoutMounted)return;var n=e.dataset.whopCheckoutPlanId;if(!n)return;var o=a(n,e.dataset.whopCheckoutTheme,e.dataset.whopCheckoutSession,e.dataset.whopCheckoutOrigin,e.dataset.whopCheckoutHidePrice==="true",e.dataset.whopCheckoutSkipRedirect==="true"||!!e.dataset.whopCheckoutOnComplete,e.dataset.whopCheckoutSkipUtm==="true"?void 0:l(),f(e),v(e),h(e),e.dataset.whopCheckoutHideSubmitButton==="true"),u=document.createElement("iframe");u.src=o,u.style.width="100%",u.style.height="480px",u.style.border="none",u.style.overflow="hidden",(t=u.sandbox).add.apply(t,s(m)),u.allow=p,e.dataset.whopCheckoutMounted="true",e.appendChild(u);var c=e.id;c&&((r=window.wco)===null||r===void 0?void 0:r.identifiedFrames.set(c,u),u.dataset.whopCheckoutIdentifier=c),i(u,e)};var y=["resize","center","complete","state"];var m=["allow-forms","allow-modals","allow-orientation-lock","allow-pointer-lock","allow-popups","allow-presentation","allow-same-origin","allow-scripts","allow-top-navigation","allow-top-navigation-by-user-activation","allow-downloads"],p="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";var b="data-whop-checkout-style-";if((typeof window==="undefined"?"undefined":d(window))<"u"&&window.wco&&!window.wco.listening){var k=new MutationObserver(function(e){var t=true,r=false,a=undefined;try{for(var o=e[Symbol.iterator](),i;!(t=(i=o.next()).done);t=true){var l=i.value;var c,s,d;var f=true,h=false,v=undefined;try{for(var y=l.addedNodes[Symbol.iterator](),m;!(f=(m=y.next()).done);f=true){var p=m.value;n(p,HTMLElement)&&p.dataset.whopCheckoutPlanId&&w(p)}}catch(e){h=true;v=e}finally{try{if(!f&&y.return!=null){y.return()}}finally{if(h){throw v}}}var b=Array.from(l.removedNodes);var k;var S=true,C=false,g=undefined;try{for(var A=((k=(c=window.wco)===null||c===void 0?void 0:c.frames)!==null&&k!==void 0?k:[])[Symbol.iterator](),P;!(S=(P=A.next()).done);S=true){var x=u(P.value,2),I=x[0],O=x[1];b.includes(I)&&(I.dataset.whopCheckoutIdentifier&&((s=window.wco)===null||s===void 0?void 0:s.identifiedFrames.delete(I.dataset.whopCheckoutIdentifier)),O(),(d=window.wco)===null||d===void 0?void 0:d.frames.delete(I))}}catch(e){C=true;g=e}finally{try{if(!S&&A.return!=null){A.return()}}finally{if(C){throw g}}}}}catch(e){r=true;a=e}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(r){throw a}}}});var S=true,C=false,g=undefined;try{for(var A=document.querySelectorAll("[data-whop-checkout-plan-id]")[Symbol.iterator](),P;!(S=(P=A.next()).done);S=true){var x=P.value;n(x,HTMLElement)&&w(x)}}catch(e){C=true;g=e}finally{try{if(!S&&A.return!=null){A.return()}}finally{if(C){throw g}}}k.observe(document.body,{childList:!0,subtree:!0}),window.wco.listening=!0}})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(t){if(Array.isArray(t))return e(t)}function n(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function a(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var o=true;var a=false;var i,
|
|
1
|
+
function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(t){if(Array.isArray(t))return e(t)}function n(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function a(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var o=true;var a=false;var i,u;try{for(r=r.call(e);!(o=(i=r.next()).done);o=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){a=true;u=e}finally{try{if(!o&&r["return"]!=null)r["return"]()}finally{if(a)throw u}}return n}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e,r){return t(e)||a(e,r)||s(e,r)||i()}function c(e){return t(e)||o(e)||s(e)||i()}function d(e){return r(e)||o(e)||s(e)||u()}function f(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function s(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}import{b as h,c as v,d as w,e as y,f as m}from"./chunk-IG6RUVWW.mjs";function p(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}if(!e)return;var o=window[e];o===null||o===void 0?void 0:o.apply(void 0,d(r))}function b(e,t){var r;e.addEventListener("checkout:submit",function(t){v(e,t.detail)}),(r=window.wco)===null||r===void 0?void 0:r.frames.set(e,h(e,function(r){switch(r.event){case"resize":{e.style.height="".concat(r.height,"px");break}case"center":{e.scrollIntoView({block:"center",inline:"center"});break}case"complete":{p(t.dataset.whopCheckoutOnComplete,r.plan_id,r.receipt_id);break}case"state":{p(t.dataset.whopCheckoutOnStateChange,r.state);break}}}))}function k(){var e=new URLSearchParams(window.location.search);return Array.from(e.keys()).reduce(function(t,r){if(!r.startsWith("utm_"))return t;var n=e.getAll(r);switch(n.length){case 0:return t;case 1:{t[r]=n[0];break}default:t[r]=n}return t},{})}var C="data-whop-checkout-style-";function S(e){var t={};var r=true,n=false,o=undefined;try{for(var a=e.attributes[Symbol.iterator](),i;!(r=(i=a.next()).done);r=true){var u=i.value;if(u.name.startsWith(C)){var l=u.name.slice(C.length),d=u.value,f=c(l.split("-")),s=f[0],h=f.slice(1);if(s&&h.length>0){var v=h.reduce(function(e,t,r){if(r===0)return t;var n=c(t),o=n[0],a=n.slice(1);return"".concat(e).concat(o.toUpperCase()).concat(a.join(""))},"");var w;(w=t[s])!==null&&w!==void 0?w:t[s]={},t[s][v]=d}}}}catch(e){n=true;o=e}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(n){throw o}}}return t}function g(e){var t={};return e.dataset.whopCheckoutThemeAccentColor&&(t.accentColor=e.dataset.whopCheckoutThemeAccentColor),t}function A(e){var t={};return e.dataset.whopCheckoutPrefillEmail&&(t.email=e.dataset.whopCheckoutPrefillEmail),t}function I(e){var t;var r;if(e.dataset.whopCheckoutMounted)return;var n=e.dataset.whopCheckoutPlanId;if(!n)return;var o=w(n,e.dataset.whopCheckoutTheme,e.dataset.whopCheckoutSession,e.dataset.whopCheckoutOrigin,e.dataset.whopCheckoutHidePrice==="true",e.dataset.whopCheckoutSkipRedirect==="true"||!!e.dataset.whopCheckoutOnComplete,e.dataset.whopCheckoutSkipUtm==="true"?void 0:k(),S(e),A(e),g(e),e.dataset.whopCheckoutHideSubmitButton==="true"),a=document.createElement("iframe");a.src=o,a.style.width="100%",a.style.height="480px",a.style.border="none",a.style.overflow="hidden",(t=a.sandbox).add.apply(t,d(y)),a.allow=m,e.dataset.whopCheckoutMounted="true",e.appendChild(a);var i=e.id;i&&((r=window.wco)===null||r===void 0?void 0:r.identifiedFrames.set(i,a),a.dataset.whopCheckoutIdentifier=i),b(a,e)}if((typeof window==="undefined"?"undefined":f(window))<"u"&&window.wco&&!window.wco.listening){var x=new MutationObserver(function(e){var t=true,r=false,o=undefined;try{for(var a=e[Symbol.iterator](),i;!(t=(i=a.next()).done);t=true){var u=i.value;var c,d,f;var s=true,h=false,v=undefined;try{for(var w=u.addedNodes[Symbol.iterator](),y;!(s=(y=w.next()).done);s=true){var m=y.value;n(m,HTMLElement)&&m.dataset.whopCheckoutPlanId&&I(m)}}catch(e){h=true;v=e}finally{try{if(!s&&w.return!=null){w.return()}}finally{if(h){throw v}}}var p=Array.from(u.removedNodes);var b;var k=true,C=false,S=undefined;try{for(var g=((b=(c=window.wco)===null||c===void 0?void 0:c.frames)!==null&&b!==void 0?b:[])[Symbol.iterator](),A;!(k=(A=g.next()).done);k=true){var x=l(A.value,2),E=x[0],O=x[1];p.includes(E)&&(E.dataset.whopCheckoutIdentifier&&((d=window.wco)===null||d===void 0?void 0:d.identifiedFrames.delete(E.dataset.whopCheckoutIdentifier)),O(),(f=window.wco)===null||f===void 0?void 0:f.frames.delete(E))}}catch(e){C=true;S=e}finally{try{if(!k&&g.return!=null){g.return()}}finally{if(C){throw S}}}}}catch(e){r=true;o=e}finally{try{if(!t&&a.return!=null){a.return()}}finally{if(r){throw o}}}});var E=true,O=false,T=undefined;try{for(var j=document.querySelectorAll("[data-whop-checkout-plan-id]")[Symbol.iterator](),M;!(E=(M=j.next()).done);E=true){var P=M.value;n(P,HTMLElement)&&I(P)}}catch(e){O=true;T=e}finally{try{if(!E&&j.return!=null){j.return()}}finally{if(O){throw T}}}x.observe(document.body,{childList:!0,subtree:!0}),window.wco.listening=!0}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}var n=document.currentScript,
|
|
1
|
+
"use strict";function e(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}var n=document.currentScript,i=n===null||n===void 0?void 0:n.src;var o;(typeof window==="undefined"?"undefined":e(window))<"u"&&i&&((o=window.wco)!==null&&o!==void 0?o:window.wco=function(){var e=document.createElement("script");return e.src=i.replace(/loader\.js$/,"index.js"),e.async=!0,e.defer=!0,document.head.appendChild(e),{injected:!0,listening:!1,frames:new Map,identifiedFrames:new Map,submit:function(e,n){var i;var o=(i=window.wco)===null||i===void 0?void 0:i.identifiedFrames.get(e);if(!o)throw new Error("Failed to submit Whop embedded checkout. No frame with identifier ".concat(e," found."));o.dispatchEvent(new CustomEvent("checkout:submit",{detail:n,cancelable:!0,bubbles:!1,composed:!0}))}}}());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}(function(){var n=document.currentScript,
|
|
1
|
+
"use strict";function e(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}(function(){var n=document.currentScript,i=n===null||n===void 0?void 0:n.src;var o;(typeof window==="undefined"?"undefined":e(window))<"u"&&i&&((o=window.wco)!==null&&o!==void 0?o:window.wco=function(){var e=document.createElement("script");return e.src=i.replace(/loader\.js$/,"index.js"),e.async=!0,e.defer=!0,document.head.appendChild(e),{injected:!0,listening:!1,frames:new Map,identifiedFrames:new Map,submit:function(e,n){var i;var o=(i=window.wco)===null||i===void 0?void 0:i.identifiedFrames.get(e);if(!o)throw new Error("Failed to submit Whop embedded checkout. No frame with identifier ".concat(e," found."));o.dispatchEvent(new CustomEvent("checkout:submit",{detail:n,cancelable:!0,bubbles:!1,composed:!0}))}}}())})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}var n=document.currentScript,o=n===null||n===void 0?void 0:n.src;var
|
|
1
|
+
function e(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}var n=document.currentScript,o=n===null||n===void 0?void 0:n.src;var i;(typeof window==="undefined"?"undefined":e(window))<"u"&&o&&((i=window.wco)!==null&&i!==void 0?i:window.wco=function(){var e=document.createElement("script");return e.src=o.replace(/loader\.js$/,"index.js"),e.async=!0,e.defer=!0,document.head.appendChild(e),{injected:!0,listening:!1,frames:new Map,identifiedFrames:new Map,submit:function(e,n){var o;var i=(o=window.wco)===null||o===void 0?void 0:o.identifiedFrames.get(e);if(!i)throw new Error("Failed to submit Whop embedded checkout. No frame with identifier ".concat(e," found."));i.dispatchEvent(new CustomEvent("checkout:submit",{detail:n,cancelable:!0,bubbles:!1,composed:!0}))}}}());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var a=true;var o=false;var i,u;try{for(r=r.call(e);!(a=(i=r.next()).done);a=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){o=true;u=e}finally{try{if(!a&&r["return"]!=null)r["return"]()}finally{if(o)throw u}}return n}function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,a){return t(e)||r(e,a)||i(e,a)||n()}function o(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function i(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}var u=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var f=function(e,t){for(var r in t)u(e,r,{get:t[r],enumerable:!0})},d=function(e,t,r,n){var a=true,i=false,f=undefined;if(t&&(typeof t==="undefined"?"undefined":o(t))=="object"||typeof t=="function")try{var d=function(){var a=
|
|
1
|
+
"use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var a=true;var o=false;var i,u;try{for(r=r.call(e);!(a=(i=r.next()).done);a=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){o=true;u=e}finally{try{if(!a&&r["return"]!=null)r["return"]()}finally{if(o)throw u}}return n}function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,a){return t(e)||r(e,a)||i(e,a)||n()}function o(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function i(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}var u=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var f=function(e,t){for(var r in t)u(e,r,{get:t[r],enumerable:!0})},d=function(e,t,r,n){var a=true,i=false,f=undefined;if(t&&(typeof t==="undefined"?"undefined":o(t))=="object"||typeof t=="function")try{var d=function(){var a=y.value;!s.call(e,a)&&a!==r&&u(e,a,{get:function(){return t[a]},enumerable:!(n=l(t,a))||n.enumerable})};for(var m=c(t)[Symbol.iterator](),y;!(a=(y=m.next()).done);a=true)d()}catch(e){i=true;f=e}finally{try{if(!a&&m.return!=null){m.return()}}finally{if(i){throw f}}}return e};var m=function(e){return d(u({},"__esModule",{value:!0}),e)};var y={};f(y,{EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING:function(){return _},EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST:function(){return E},getEmbeddedCheckoutIframeUrl:function(){return w},isWhopCheckoutMessage:function(){return v},onWhopCheckoutMessage:function(){return p},submitCheckoutFrame:function(){return b}});module.exports=m(y);var h=["resize","center","complete","state"];function v(e){return o(e.data)=="object"&&e.data!==null&&"event"in e.data&&h.includes(e.data.event)}function p(e,t){function r(r){r.source===e.contentWindow&&v(r)&&t(r.data)}return window.addEventListener("message",r),function(){window.removeEventListener("message",r)}}function b(e,t){var r;var n=new URL(e.src).origin;(r=e.contentWindow)===null||r===void 0?void 0:r.postMessage({__scope:"whop-embedded-checkout",event:"submit"},n)}function w(e,t,r,n,o,i,u,l,c,s,f){var d=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(d.searchParams.set("h",window.location.origin),t&&d.searchParams.set("theme",t),r&&d.searchParams.set("session",r),o&&d.searchParams.set("hide_price","true"),i&&d.searchParams.set("skip_redirect","true"),f&&d.searchParams.set("hide_submit_button","true"),u){var m=true,y=false,h=undefined,v=true,p=false,b=undefined;try{for(var w=Object.entries(u).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),E;!(v=(E=w.next()).done);v=true){var _=a(E.value,2),g=_[0],C=_[1];if(g.startsWith("utm_"))if(Array.isArray(C))try{for(var O=C[Symbol.iterator](),S;!(m=(S=O.next()).done);m=true){var D=S.value;d.searchParams.append(g,D)}}catch(e){y=true;h=e}finally{try{if(!m&&O.return!=null){O.return()}}finally{if(y){throw h}}}else d.searchParams.set(g,C)}}catch(e){p=true;b=e}finally{try{if(!v&&w.return!=null){w.return()}}finally{if(p){throw b}}}}if(l){var M=true,A=false,k=undefined,I=true,P=false,j=undefined;try{for(var L=Object.entries(l)[Symbol.iterator](),T;!(I=(T=L.next()).done);I=true){var R=a(T.value,2),U=R[0],W=R[1];if(W)try{for(var x=Object.entries(W)[Symbol.iterator](),B;!(M=(B=x.next()).done);M=true){var F=a(B.value,2),N=F[0],H=F[1];d.searchParams.set("style.".concat(U,".").concat(N),H.toString())}}catch(e){A=true;k=e}finally{try{if(!M&&x.return!=null){x.return()}}finally{if(A){throw k}}}}}catch(e){P=true;j=e}finally{try{if(!I&&L.return!=null){L.return()}}finally{if(P){throw j}}}}var K=true,G=false,X=undefined;if((c===null||c===void 0?void 0:c.email)&&d.searchParams.set("email",c.email),s)try{for(var q=Object.entries(s)[Symbol.iterator](),z;!(K=(z=q.next()).done);K=true){var $=a(z.value,2),J=$[0],Q=$[1];Q&&d.searchParams.set("theme.".concat(J),Q)}}catch(e){G=true;X=e}finally{try{if(!K&&q.return!=null){q.return()}}finally{if(G){throw X}}}return d.toString()}var E=["allow-forms","allow-modals","allow-orientation-lock","allow-pointer-lock","allow-popups","allow-presentation","allow-same-origin","allow-scripts","allow-top-navigation","allow-top-navigation-by-user-activation","allow-downloads"],_="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";0&&(module.exports={EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING:EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING,EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST:EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST,getEmbeddedCheckoutIframeUrl:getEmbeddedCheckoutIframeUrl,isWhopCheckoutMessage:isWhopCheckoutMessage,onWhopCheckoutMessage:onWhopCheckoutMessage,submitCheckoutFrame:submitCheckoutFrame});
|
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
interface Window {
|
|
3
|
+
wco?: {
|
|
4
|
+
injected: true;
|
|
5
|
+
listening: boolean;
|
|
6
|
+
frames: Map<HTMLIFrameElement, () => void>;
|
|
7
|
+
identifiedFrames: Map<string, HTMLIFrameElement>;
|
|
8
|
+
submit: (
|
|
9
|
+
identifier: string,
|
|
10
|
+
data?: {
|
|
11
|
+
email?: string;
|
|
12
|
+
},
|
|
13
|
+
) => void;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface HTMLElementEventMap {
|
|
18
|
+
"checkout:submit": CustomEvent<WhopCheckoutSubmitDetails>;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type WhopCheckoutSubmitDetails = Record<never, never>;
|
|
23
|
+
|
|
24
|
+
type WhopCheckoutState = "loading" | "ready" | "disabled";
|
|
1
25
|
type WhopCheckoutMessage = {
|
|
2
26
|
event: "resize";
|
|
3
27
|
height: number;
|
|
@@ -7,9 +31,14 @@ type WhopCheckoutMessage = {
|
|
|
7
31
|
event: "complete";
|
|
8
32
|
receipt_id?: string;
|
|
9
33
|
plan_id: string;
|
|
34
|
+
} | {
|
|
35
|
+
event: "state";
|
|
36
|
+
state: WhopCheckoutState;
|
|
10
37
|
};
|
|
11
38
|
declare function isWhopCheckoutMessage(event: MessageEvent<unknown>): event is MessageEvent<WhopCheckoutMessage>;
|
|
12
39
|
declare function onWhopCheckoutMessage(iframe: HTMLIFrameElement, callback: (message: WhopCheckoutMessage) => void): () => void;
|
|
40
|
+
declare function submitCheckoutFrame(frame: HTMLIFrameElement, _data?: WhopCheckoutSubmitDetails): void;
|
|
41
|
+
|
|
13
42
|
interface WhopEmbeddedCheckoutStyleOptions {
|
|
14
43
|
container?: {
|
|
15
44
|
paddingTop?: number | string;
|
|
@@ -20,8 +49,11 @@ interface WhopEmbeddedCheckoutStyleOptions {
|
|
|
20
49
|
interface WhopEmbeddedCheckoutPrefillOptions {
|
|
21
50
|
email?: string;
|
|
22
51
|
}
|
|
23
|
-
|
|
52
|
+
interface WhopEmbeddedCheckoutThemeOptions {
|
|
53
|
+
accentColor?: string;
|
|
54
|
+
}
|
|
55
|
+
declare function getEmbeddedCheckoutIframeUrl(planId: string, theme?: "light" | "dark" | "system", sessionId?: string, origin?: string, hidePrice?: boolean, skipRedirect?: boolean, utm?: Record<string, string | string[]>, styles?: WhopEmbeddedCheckoutStyleOptions, prefill?: WhopEmbeddedCheckoutPrefillOptions, themeOptions?: WhopEmbeddedCheckoutThemeOptions, hideSubmitButton?: boolean): string;
|
|
24
56
|
declare const EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST: string[];
|
|
25
57
|
declare const EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING = "document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";
|
|
26
58
|
|
|
27
|
-
export { EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING, EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST, type WhopCheckoutMessage, type WhopEmbeddedCheckoutPrefillOptions, type WhopEmbeddedCheckoutStyleOptions, getEmbeddedCheckoutIframeUrl, isWhopCheckoutMessage, onWhopCheckoutMessage };
|
|
59
|
+
export { EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING, EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST, type WhopCheckoutMessage, type WhopCheckoutState, type WhopCheckoutSubmitDetails, type WhopEmbeddedCheckoutPrefillOptions, type WhopEmbeddedCheckoutStyleOptions, type WhopEmbeddedCheckoutThemeOptions, getEmbeddedCheckoutIframeUrl, isWhopCheckoutMessage, onWhopCheckoutMessage, submitCheckoutFrame };
|
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
interface Window {
|
|
3
|
+
wco?: {
|
|
4
|
+
injected: true;
|
|
5
|
+
listening: boolean;
|
|
6
|
+
frames: Map<HTMLIFrameElement, () => void>;
|
|
7
|
+
identifiedFrames: Map<string, HTMLIFrameElement>;
|
|
8
|
+
submit: (
|
|
9
|
+
identifier: string,
|
|
10
|
+
data?: {
|
|
11
|
+
email?: string;
|
|
12
|
+
},
|
|
13
|
+
) => void;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface HTMLElementEventMap {
|
|
18
|
+
"checkout:submit": CustomEvent<WhopCheckoutSubmitDetails>;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type WhopCheckoutSubmitDetails = Record<never, never>;
|
|
23
|
+
|
|
24
|
+
type WhopCheckoutState = "loading" | "ready" | "disabled";
|
|
1
25
|
type WhopCheckoutMessage = {
|
|
2
26
|
event: "resize";
|
|
3
27
|
height: number;
|
|
@@ -7,9 +31,14 @@ type WhopCheckoutMessage = {
|
|
|
7
31
|
event: "complete";
|
|
8
32
|
receipt_id?: string;
|
|
9
33
|
plan_id: string;
|
|
34
|
+
} | {
|
|
35
|
+
event: "state";
|
|
36
|
+
state: WhopCheckoutState;
|
|
10
37
|
};
|
|
11
38
|
declare function isWhopCheckoutMessage(event: MessageEvent<unknown>): event is MessageEvent<WhopCheckoutMessage>;
|
|
12
39
|
declare function onWhopCheckoutMessage(iframe: HTMLIFrameElement, callback: (message: WhopCheckoutMessage) => void): () => void;
|
|
40
|
+
declare function submitCheckoutFrame(frame: HTMLIFrameElement, _data?: WhopCheckoutSubmitDetails): void;
|
|
41
|
+
|
|
13
42
|
interface WhopEmbeddedCheckoutStyleOptions {
|
|
14
43
|
container?: {
|
|
15
44
|
paddingTop?: number | string;
|
|
@@ -20,8 +49,11 @@ interface WhopEmbeddedCheckoutStyleOptions {
|
|
|
20
49
|
interface WhopEmbeddedCheckoutPrefillOptions {
|
|
21
50
|
email?: string;
|
|
22
51
|
}
|
|
23
|
-
|
|
52
|
+
interface WhopEmbeddedCheckoutThemeOptions {
|
|
53
|
+
accentColor?: string;
|
|
54
|
+
}
|
|
55
|
+
declare function getEmbeddedCheckoutIframeUrl(planId: string, theme?: "light" | "dark" | "system", sessionId?: string, origin?: string, hidePrice?: boolean, skipRedirect?: boolean, utm?: Record<string, string | string[]>, styles?: WhopEmbeddedCheckoutStyleOptions, prefill?: WhopEmbeddedCheckoutPrefillOptions, themeOptions?: WhopEmbeddedCheckoutThemeOptions, hideSubmitButton?: boolean): string;
|
|
24
56
|
declare const EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST: string[];
|
|
25
57
|
declare const EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING = "document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";
|
|
26
58
|
|
|
27
|
-
export { EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING, EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST, type WhopCheckoutMessage, type WhopEmbeddedCheckoutPrefillOptions, type WhopEmbeddedCheckoutStyleOptions, getEmbeddedCheckoutIframeUrl, isWhopCheckoutMessage, onWhopCheckoutMessage };
|
|
59
|
+
export { EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING, EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST, type WhopCheckoutMessage, type WhopCheckoutState, type WhopCheckoutSubmitDetails, type WhopEmbeddedCheckoutPrefillOptions, type WhopEmbeddedCheckoutStyleOptions, type WhopEmbeddedCheckoutThemeOptions, getEmbeddedCheckoutIframeUrl, isWhopCheckoutMessage, onWhopCheckoutMessage, submitCheckoutFrame };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var a=true;var o=false;var i,l;try{for(r=r.call(e);!(a=(i=r.next()).done);a=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){o=true;l=e}finally{try{if(!a&&r["return"]!=null)r["return"]()}finally{if(o)throw l}}return n}function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,a){return t(e)||r(e,a)||i(e,a)||n()}function o(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function i(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}(function(){var e=function e(e){return o(e.data)=="object"&&e.data!==null&&"event"in e.data&&(e.data.event
|
|
1
|
+
"use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var a=true;var o=false;var i,l;try{for(r=r.call(e);!(a=(i=r.next()).done);a=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){o=true;l=e}finally{try{if(!a&&r["return"]!=null)r["return"]()}finally{if(o)throw l}}return n}function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,a){return t(e)||r(e,a)||i(e,a)||n()}function o(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function i(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}(function(){var e=function e(e){return o(e.data)=="object"&&e.data!==null&&"event"in e.data&&i.includes(e.data.event)};var t=function t(t,r){function n(n){n.source===t.contentWindow&&e(n)&&r(n.data)}return window.addEventListener("message",n),function(){window.removeEventListener("message",n)}};var r=function e(e,t){var r;var n=new URL(e.src).origin;(r=e.contentWindow)===null||r===void 0?void 0:r.postMessage({__scope:"whop-embedded-checkout",event:"submit"},n)};var n=function e(e,t,r,n,o,i,l,u,s,c,f){var d=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(d.searchParams.set("h",window.location.origin),t&&d.searchParams.set("theme",t),r&&d.searchParams.set("session",r),o&&d.searchParams.set("hide_price","true"),i&&d.searchParams.set("skip_redirect","true"),f&&d.searchParams.set("hide_submit_button","true"),l){var y=true,m=false,v=undefined,h=true,w=false,p=undefined;try{for(var b=Object.entries(l).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),g;!(h=(g=b.next()).done);h=true){var S=a(g.value,2),P=S[0],j=S[1];if(P.startsWith("utm_"))if(Array.isArray(j))try{for(var x=j[Symbol.iterator](),A;!(y=(A=x.next()).done);y=true){var _=A.value;d.searchParams.append(P,_)}}catch(e){m=true;v=e}finally{try{if(!y&&x.return!=null){x.return()}}finally{if(m){throw v}}}else d.searchParams.set(P,j)}}catch(e){w=true;p=e}finally{try{if(!h&&b.return!=null){b.return()}}finally{if(w){throw p}}}}if(u){var k=true,O=false,L=undefined,E=true,I=false,R=undefined;try{for(var U=Object.entries(u)[Symbol.iterator](),W;!(E=(W=U.next()).done);E=true){var C=a(W.value,2),M=C[0],q=C[1];if(q)try{for(var z=Object.entries(q)[Symbol.iterator](),T;!(k=(T=z.next()).done);k=true){var $=a(T.value,2),B=$[0],D=$[1];d.searchParams.set("style.".concat(M,".").concat(B),D.toString())}}catch(e){O=true;L=e}finally{try{if(!k&&z.return!=null){z.return()}}finally{if(O){throw L}}}}}catch(e){I=true;R=e}finally{try{if(!E&&U.return!=null){U.return()}}finally{if(I){throw R}}}}var F=true,G=false,H=undefined;if((s===null||s===void 0?void 0:s.email)&&d.searchParams.set("email",s.email),c)try{for(var J=Object.entries(c)[Symbol.iterator](),K;!(F=(K=J.next()).done);F=true){var N=a(K.value,2),Q=N[0],V=N[1];V&&d.searchParams.set("theme.".concat(Q),V)}}catch(e){G=true;H=e}finally{try{if(!F&&J.return!=null){J.return()}}finally{if(G){throw H}}}return d.toString()};var i=["resize","center","complete","state"];var l=["allow-forms","allow-modals","allow-orientation-lock","allow-pointer-lock","allow-popups","allow-presentation","allow-same-origin","allow-scripts","allow-top-navigation","allow-top-navigation-by-user-activation","allow-downloads"],u="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;"})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,b as s,c as
|
|
1
|
+
import{a as e,b as s,c as a,d as E,e as o,f as t}from"./chunk-IG6RUVWW.mjs";export{t as EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING,o as EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST,E as getEmbeddedCheckoutIframeUrl,e as isWhopCheckoutMessage,s as onWhopCheckoutMessage,a as submitCheckoutFrame};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var a=true;var o=false;var i,l;try{for(r=r.call(e);!(a=(i=r.next()).done);a=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){o=true;l=e}finally{try{if(!a&&r["return"]!=null)r["return"]()}finally{if(o)throw l}}return n}function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,a){return t(e)||r(e,a)||i(e,a)||n()}function o(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function i(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}function l(e){return o(e.data)=="object"&&e.data!==null&&"event"in e.data&&(e.data.event==="resize"||e.data.event==="center"||e.data.event==="complete")}function u(e,t){function r(r){r.source===e.contentWindow&&l(r)&&t(r.data)}return window.addEventListener("message",r),function(){window.removeEventListener("message",r)}}function s(e,t,r,n,o,i,l,u,s){var c=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(c.searchParams.set("h",window.location.origin),t&&c.searchParams.set("theme",t),r&&c.searchParams.set("session",r),o&&c.searchParams.set("hide_price","true"),i&&c.searchParams.set("skip_redirect","true"),l){var f=true,d=false,y=undefined,m=true,v=false,h=undefined;try{for(var p=Object.entries(l).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),w;!(m=(w=p.next()).done);m=true){var b=a(w.value,2),g=b[0],S=b[1];if(g.startsWith("utm_"))if(Array.isArray(S))try{for(var P=S[Symbol.iterator](),x;!(f=(x=P.next()).done);f=true){var A=x.value;c.searchParams.append(g,A)}}catch(e){d=true;y=e}finally{try{if(!f&&P.return!=null){P.return()}}finally{if(d){throw y}}}else c.searchParams.set(g,S)}}catch(e){v=true;h=e}finally{try{if(!m&&p.return!=null){p.return()}}finally{if(v){throw h}}}}if(u){var j=true,k=false,O=undefined,E=true,I=false,L=undefined;try{for(var _=Object.entries(u)[Symbol.iterator](),C;!(E=(C=_.next()).done);E=true){var R=a(C.value,2),U=R[0],W=R[1];if(W)try{for(var q=Object.entries(W)[Symbol.iterator](),z;!(j=(z=q.next()).done);j=true){var M=a(z.value,2),T=M[0],$=M[1];c.searchParams.set("style.".concat(U,".").concat(T),$.toString())}}catch(e){k=true;O=e}finally{try{if(!j&&q.return!=null){q.return()}}finally{if(k){throw O}}}}}catch(e){I=true;L=e}finally{try{if(!E&&_.return!=null){_.return()}}finally{if(I){throw L}}}}return(s===null||s===void 0?void 0:s.email)&&c.searchParams.set("email",s.email),c.toString()}var c=["allow-forms","allow-modals","allow-orientation-lock","allow-pointer-lock","allow-popups","allow-presentation","allow-same-origin","allow-scripts","allow-top-navigation","allow-top-navigation-by-user-activation","allow-downloads"],f="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";export{l as a,u as b,s as c,c as d,f as e};
|