@whop/checkout 0.0.33 → 0.0.34
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 +38 -0
- package/dist/static/checkout/chunk-E7SFKHWN.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/util.cjs +1 -1
- package/dist/static/checkout/util.d.mts +5 -2
- package/dist/static/checkout/util.d.ts +5 -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
|
@@ -46,6 +46,44 @@ Possible values are `light`, `dark` or `system`.
|
|
|
46
46
|
<div data-whop-checkout-theme="light" data-whop-checkout-plan-id="plan_XXXXXXXXX"></div>
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
+
### **`data-whop-checkout-theme-accent-color`**
|
|
50
|
+
|
|
51
|
+
**Optional** - The accent color to apply to the checkout embed
|
|
52
|
+
|
|
53
|
+
Possible values are
|
|
54
|
+
- `tomato`
|
|
55
|
+
- `red`
|
|
56
|
+
- `ruby`
|
|
57
|
+
- `crimson`
|
|
58
|
+
- `pink`
|
|
59
|
+
- `plum`
|
|
60
|
+
- `purple`
|
|
61
|
+
- `violet`
|
|
62
|
+
- `iris`
|
|
63
|
+
- `cyan`
|
|
64
|
+
- `teal`
|
|
65
|
+
- `jade`
|
|
66
|
+
- `green`
|
|
67
|
+
- `grass`
|
|
68
|
+
- `brown`
|
|
69
|
+
- `blue`
|
|
70
|
+
- `orange`
|
|
71
|
+
- `indigo`
|
|
72
|
+
- `sky`
|
|
73
|
+
- `mint`
|
|
74
|
+
- `yellow`
|
|
75
|
+
- `amber`
|
|
76
|
+
- `lime`
|
|
77
|
+
- `lemon`
|
|
78
|
+
- `magenta`
|
|
79
|
+
- `gold`
|
|
80
|
+
- `bronze`
|
|
81
|
+
- `gray`
|
|
82
|
+
|
|
83
|
+
```md
|
|
84
|
+
<div data-whop-checkout-theme-accent-color="green" data-whop-checkout-plan-id="plan_XXXXXXXXX"></div>
|
|
85
|
+
```
|
|
86
|
+
|
|
49
87
|
### **`data-whop-checkout-session`**
|
|
50
88
|
|
|
51
89
|
**Optional** - The session id to use for the checkout.
|
|
@@ -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)}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,c){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),o&&f.searchParams.set("hide_price","true"),i&&f.searchParams.set("skip_redirect","true"),l){var d=true,y=false,m=undefined,v=true,h=false,p=undefined;try{for(var w=Object.entries(l).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),b;!(v=(b=w.next()).done);v=true){var g=a(b.value,2),S=g[0],P=g[1];if(S.startsWith("utm_"))if(Array.isArray(P))try{for(var x=P[Symbol.iterator](),j;!(d=(j=x.next()).done);d=true){var A=j.value;f.searchParams.append(S,A)}}catch(e){y=true;m=e}finally{try{if(!d&&x.return!=null){x.return()}}finally{if(y){throw m}}}else f.searchParams.set(S,P)}}catch(e){h=true;p=e}finally{try{if(!v&&w.return!=null){w.return()}}finally{if(h){throw p}}}}if(u){var k=true,O=false,E=undefined,C=true,I=false,L=undefined;try{for(var _=Object.entries(u)[Symbol.iterator](),R;!(C=(R=_.next()).done);C=true){var U=a(R.value,2),W=U[0],q=U[1];if(q)try{for(var z=Object.entries(q)[Symbol.iterator](),M;!(k=(M=z.next()).done);k=true){var T=a(M.value,2),$=T[0],B=T[1];f.searchParams.set("style.".concat(W,".").concat($),B.toString())}}catch(e){O=true;E=e}finally{try{if(!k&&z.return!=null){z.return()}}finally{if(O){throw E}}}}}catch(e){I=true;L=e}finally{try{if(!C&&_.return!=null){_.return()}}finally{if(I){throw L}}}}var D=true,F=false,G=undefined;if((s===null||s===void 0?void 0:s.email)&&f.searchParams.set("email",s.email),c)try{for(var H=Object.entries(c)[Symbol.iterator](),J;!(D=(J=H.next()).done);D=true){var K=a(J.value,2),N=K[0],Q=K[1];Q&&f.searchParams.set("theme.".concat(N),Q)}}catch(e){F=true;G=e}finally{try{if(!D&&H.return!=null){H.return()}}finally{if(F){throw G}}}return f.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};
|
|
@@ -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)||d(e,r)||i()}function c(e){return t(e)||a(e)||d(e)||i()}function s(e){return r(e)||a(e)||d(e)||l()}function f(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function d(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 h(e){return f(e.data)=="object"&&e.data!==null&&"event"in e.data&&(e.data.event==="resize"||e.data.event==="center"||e.data.event==="complete")}function y(e,t){function r(r){r.source===e.contentWindow&&h(r)&&t(r.data)}return window.addEventListener("message",r),function(){window.removeEventListener("message",r)}}function v(e,t,r,n,a,o,i,l,c){var
|
|
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)||d(e,r)||i()}function c(e){return t(e)||a(e)||d(e)||i()}function s(e){return r(e)||a(e)||d(e)||l()}function f(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function d(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 h(e){return f(e.data)=="object"&&e.data!==null&&"event"in e.data&&(e.data.event==="resize"||e.data.event==="center"||e.data.event==="complete")}function y(e,t){function r(r){r.source===e.contentWindow&&h(r)&&t(r.data)}return window.addEventListener("message",r),function(){window.removeEventListener("message",r)}}function v(e,t,r,n,a,o,i,l,c,s){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"),i){var d=true,h=false,y=undefined,v=true,w=false,m=undefined;try{for(var p=Object.entries(i).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),b;!(v=(b=p.next()).done);v=true){var k=u(b.value,2),S=k[0],C=k[1];if(S.startsWith("utm_"))if(Array.isArray(C))try{for(var g=C[Symbol.iterator](),A;!(d=(A=g.next()).done);d=true){var x=A.value;f.searchParams.append(S,x)}}catch(e){h=true;y=e}finally{try{if(!d&&g.return!=null){g.return()}}finally{if(h){throw y}}}else f.searchParams.set(S,C)}}catch(e){w=true;m=e}finally{try{if(!v&&p.return!=null){p.return()}}finally{if(w){throw m}}}}if(l){var P=true,j=false,I=undefined,O=true,E=false,L=undefined;try{for(var T=Object.entries(l)[Symbol.iterator](),M;!(O=(M=T.next()).done);O=true){var _=u(M.value,2),U=_[0],R=_[1];if(R)try{for(var W=Object.entries(R)[Symbol.iterator](),H;!(P=(H=W.next()).done);P=true){var q=u(H.value,2),z=q[0],N=q[1];f.searchParams.set("style.".concat(U,".").concat(z),N.toString())}}catch(e){j=true;I=e}finally{try{if(!P&&W.return!=null){W.return()}}finally{if(j){throw I}}}}}catch(e){E=true;L=e}finally{try{if(!O&&T.return!=null){T.return()}}finally{if(E){throw L}}}}var V=true,$=false,B=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](),F;!(V=(F=D.next()).done);V=true){var G=u(F.value,2),J=G[0],K=G[1];K&&f.searchParams.set("theme.".concat(J),K)}}catch(e){$=true;B=e}finally{try{if(!V&&D.return!=null){D.return()}}finally{if($){throw B}}}return f.toString()}var w=["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"],m="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";function p(e,t){var r;(r=window.wco)===null||r===void 0?void 0:r.frames.set(e,y(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":{var n=t.dataset.whopCheckoutOnComplete;if(n){var a=window[n];a===null||a===void 0?void 0:a(r.plan_id,r.receipt_id)}break}}}))}function b(){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 k="data-whop-checkout-style-";function S(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(k)){var u=l.name.slice(k.length),s=l.value,f=c(u.split("-")),d=f[0],h=f.slice(1);if(d&&h.length>0){var y=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 v;(v=t[d])!==null&&v!==void 0?v:t[d]={},t[d][y]=s}}}}catch(e){n=true;a=e}finally{try{if(!r&&o.return!=null){o.return()}}finally{if(n){throw a}}}return t}function C(e){var t={};return e.dataset.whopCheckoutThemeAccentColor&&(t.accentColor=e.dataset.whopCheckoutThemeAccentColor),t}function g(e){var t={};return e.dataset.whopCheckoutPrefillEmail&&(t.email=e.dataset.whopCheckoutPrefillEmail),t}function A(e){var t;if(e.dataset.whopCheckoutMounted)return;var r=e.dataset.whopCheckoutPlanId;if(!r)return;var n=v(r,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:b(),S(e),g(e),C(e)),a=document.createElement("iframe");a.src=n,a.style.width="100%",a.style.height="480px",a.style.border="none",a.style.overflow="hidden",(t=a.sandbox).add.apply(t,s(w)),a.allow=m,e.dataset.whopCheckoutMounted="true",e.appendChild(a),p(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,a=undefined;try{for(var o=e[Symbol.iterator](),i;!(t=(i=o.next()).done);t=true){var l=i.value;var c,s;var f=true,d=false,h=undefined;try{for(var y=l.addedNodes[Symbol.iterator](),v;!(f=(v=y.next()).done);f=true){var w=v.value;n(w,HTMLElement)&&w.dataset.whopCheckoutPlanId&&A(w)}}catch(e){d=true;h=e}finally{try{if(!f&&y.return!=null){y.return()}}finally{if(d){throw h}}}var m=Array.from(l.removedNodes);var p;var b=true,k=false,S=undefined;try{for(var C=((p=(c=window.wco)===null||c===void 0?void 0:c.frames)!==null&&p!==void 0?p:[])[Symbol.iterator](),g;!(b=(g=C.next()).done);b=true){var x=u(g.value,2),P=x[0],j=x[1];m.includes(P)&&(j(),(s=window.wco)===null||s===void 0?void 0:s.frames.delete(P))}}catch(e){k=true;S=e}finally{try{if(!b&&C.return!=null){C.return()}}finally{if(k){throw S}}}}}catch(e){r=true;a=e}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(r){throw a}}}});var P=true,j=false,I=undefined;try{for(var O=document.querySelectorAll("[data-whop-checkout-plan-id]")[Symbol.iterator](),E;!(P=(E=O.next()).done);P=true){var L=E.value;n(L,HTMLElement)&&A(L)}}catch(e){j=true;I=e}finally{try{if(!P&&O.return!=null){O.return()}}finally{if(j){throw I}}}x.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)||d(e,r)||i()}function c(e){return t(e)||a(e)||d(e)||i()}function s(e){return r(e)||a(e)||d(e)||l()}function f(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function d(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 f(e.data)=="object"&&e.data!==null&&"event"in e.data&&(e.data.event==="resize"||e.data.event==="center"||e.data.event==="complete")};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,r,n,a,o,i,l,c){var
|
|
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)||d(e,r)||i()}function c(e){return t(e)||a(e)||d(e)||i()}function s(e){return r(e)||a(e)||d(e)||l()}function f(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function d(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 f(e.data)=="object"&&e.data!==null&&"event"in e.data&&(e.data.event==="resize"||e.data.event==="center"||e.data.event==="complete")};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,r,n,a,o,i,l,c,s){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"),i){var d=true,h=false,v=undefined,y=true,w=false,m=undefined;try{for(var p=Object.entries(i).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),b;!(y=(b=p.next()).done);y=true){var k=u(b.value,2),S=k[0],C=k[1];if(S.startsWith("utm_"))if(Array.isArray(C))try{for(var g=C[Symbol.iterator](),A;!(d=(A=g.next()).done);d=true){var x=A.value;f.searchParams.append(S,x)}}catch(e){h=true;v=e}finally{try{if(!d&&g.return!=null){g.return()}}finally{if(h){throw v}}}else f.searchParams.set(S,C)}}catch(e){w=true;m=e}finally{try{if(!y&&p.return!=null){p.return()}}finally{if(w){throw m}}}}if(l){var P=true,j=false,I=undefined,O=true,E=false,L=undefined;try{for(var T=Object.entries(l)[Symbol.iterator](),M;!(O=(M=T.next()).done);O=true){var _=u(M.value,2),U=_[0],R=_[1];if(R)try{for(var W=Object.entries(R)[Symbol.iterator](),H;!(P=(H=W.next()).done);P=true){var q=u(H.value,2),z=q[0],N=q[1];f.searchParams.set("style.".concat(U,".").concat(z),N.toString())}}catch(e){j=true;I=e}finally{try{if(!P&&W.return!=null){W.return()}}finally{if(j){throw I}}}}}catch(e){E=true;L=e}finally{try{if(!O&&T.return!=null){T.return()}}finally{if(E){throw L}}}}var V=true,$=false,B=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](),F;!(V=(F=D.next()).done);V=true){var G=u(F.value,2),J=G[0],K=G[1];K&&f.searchParams.set("theme.".concat(J),K)}}catch(e){$=true;B=e}finally{try{if(!V&&D.return!=null){D.return()}}finally{if($){throw B}}}return f.toString()};var a=function e(e,r){var n;(n=window.wco)===null||n===void 0?void 0:n.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":{var n=r.dataset.whopCheckoutOnComplete;if(n){var a=window[n];a===null||a===void 0?void 0:a(t.plan_id,t.receipt_id)}break}}}))};var o=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 i=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(w)){var u=l.name.slice(w.length),s=l.value,f=c(u.split("-")),d=f[0],h=f.slice(1);if(d&&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 y;(y=t[d])!==null&&y!==void 0?y:t[d]={},t[d][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 l=function e(e){var t={};return e.dataset.whopCheckoutThemeAccentColor&&(t.accentColor=e.dataset.whopCheckoutThemeAccentColor),t};var d=function e(e){var t={};return e.dataset.whopCheckoutPrefillEmail&&(t.email=e.dataset.whopCheckoutPrefillEmail),t};var h=function e(e){var t;if(e.dataset.whopCheckoutMounted)return;var n=e.dataset.whopCheckoutPlanId;if(!n)return;var u=r(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:o(),i(e),d(e),l(e)),c=document.createElement("iframe");c.src=u,c.style.width="100%",c.style.height="480px",c.style.border="none",c.style.overflow="hidden",(t=c.sandbox).add.apply(t,s(v)),c.allow=y,e.dataset.whopCheckoutMounted="true",e.appendChild(c),a(c,e)};var v=["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;";var w="data-whop-checkout-style-";if((typeof window==="undefined"?"undefined":f(window))<"u"&&window.wco&&!window.wco.listening){var m=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;var f=true,d=false,v=undefined;try{for(var y=l.addedNodes[Symbol.iterator](),w;!(f=(w=y.next()).done);f=true){var m=w.value;n(m,HTMLElement)&&m.dataset.whopCheckoutPlanId&&h(m)}}catch(e){d=true;v=e}finally{try{if(!f&&y.return!=null){y.return()}}finally{if(d){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 x=u(A.value,2),P=x[0],j=x[1];p.includes(P)&&(j(),(s=window.wco)===null||s===void 0?void 0:s.frames.delete(P))}}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 p=true,b=false,k=undefined;try{for(var S=document.querySelectorAll("[data-whop-checkout-plan-id]")[Symbol.iterator](),C;!(p=(C=S.next()).done);p=true){var g=C.value;n(g,HTMLElement)&&h(g)}}catch(e){b=true;k=e}finally{try{if(!p&&S.return!=null){S.return()}}finally{if(b){throw k}}}m.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 f(e){return r(e)||o(e)||s(e)||u()}function d(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 y,d as v,e as w}from"./chunk-E7SFKHWN.mjs";function m(e,t){var r;(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":{var n=t.dataset.whopCheckoutOnComplete;if(n){var o=window[n];o===null||o===void 0?void 0:o(r.plan_id,r.receipt_id)}break}}}))}function p(){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 b="data-whop-checkout-style-";function k(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(b)){var l=u.name.slice(b.length),f=u.value,d=c(l.split("-")),s=d[0],h=d.slice(1);if(s&&h.length>0){var y=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 v;(v=t[s])!==null&&v!==void 0?v:t[s]={},t[s][y]=f}}}}catch(e){n=true;o=e}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(n){throw o}}}return t}function C(e){var t={};return e.dataset.whopCheckoutThemeAccentColor&&(t.accentColor=e.dataset.whopCheckoutThemeAccentColor),t}function S(e){var t={};return e.dataset.whopCheckoutPrefillEmail&&(t.email=e.dataset.whopCheckoutPrefillEmail),t}function g(e){var t;if(e.dataset.whopCheckoutMounted)return;var r=e.dataset.whopCheckoutPlanId;if(!r)return;var n=y(r,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:p(),k(e),S(e),C(e)),o=document.createElement("iframe");o.src=n,o.style.width="100%",o.style.height="480px",o.style.border="none",o.style.overflow="hidden",(t=o.sandbox).add.apply(t,f(v)),o.allow=w,e.dataset.whopCheckoutMounted="true",e.appendChild(o),m(o,e)}if((typeof window==="undefined"?"undefined":d(window))<"u"&&window.wco&&!window.wco.listening){var A=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,f;var d=true,s=false,h=undefined;try{for(var y=u.addedNodes[Symbol.iterator](),v;!(d=(v=y.next()).done);d=true){var w=v.value;n(w,HTMLElement)&&w.dataset.whopCheckoutPlanId&&g(w)}}catch(e){s=true;h=e}finally{try{if(!d&&y.return!=null){y.return()}}finally{if(s){throw h}}}var m=Array.from(u.removedNodes);var p;var b=true,k=false,C=undefined;try{for(var S=((p=(c=window.wco)===null||c===void 0?void 0:c.frames)!==null&&p!==void 0?p:[])[Symbol.iterator](),A;!(b=(A=S.next()).done);b=true){var I=l(A.value,2),x=I[0],E=I[1];m.includes(x)&&(E(),(f=window.wco)===null||f===void 0?void 0:f.frames.delete(x))}}catch(e){k=true;C=e}finally{try{if(!b&&S.return!=null){S.return()}}finally{if(k){throw C}}}}}catch(e){r=true;o=e}finally{try{if(!t&&a.return!=null){a.return()}}finally{if(r){throw o}}}});var I=true,x=false,E=undefined;try{for(var T=document.querySelectorAll("[data-whop-checkout-plan-id]")[Symbol.iterator](),j;!(I=(j=T.next()).done);I=true){var M=j.value;n(M,HTMLElement)&&g(M)}}catch(e){x=true;E=e}finally{try{if(!I&&T.return!=null){T.return()}}finally{if(x){throw E}}}A.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(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=m.value;!s.call(e,a)&&a!==r&&u(e,a,{get:function(){return t[a]},enumerable:!(n=l(t,a))||n.enumerable})};for(var y=c(t)[Symbol.iterator](),m;!(a=(m=y.next()).done);a=true)d()}catch(e){i=true;f=e}finally{try{if(!a&&y.return!=null){y.return()}}finally{if(i){throw f}}}return e};var y=function(e){return d(u({},"__esModule",{value:!0}),e)};var m={};f(m,{EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING:function(){return
|
|
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=m.value;!s.call(e,a)&&a!==r&&u(e,a,{get:function(){return t[a]},enumerable:!(n=l(t,a))||n.enumerable})};for(var y=c(t)[Symbol.iterator](),m;!(a=(m=y.next()).done);a=true)d()}catch(e){i=true;f=e}finally{try{if(!a&&y.return!=null){y.return()}}finally{if(i){throw f}}}return e};var y=function(e){return d(u({},"__esModule",{value:!0}),e)};var m={};f(m,{EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING:function(){return b},EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST:function(){return w},getEmbeddedCheckoutIframeUrl:function(){return p},isWhopCheckoutMessage:function(){return h},onWhopCheckoutMessage:function(){return v}});module.exports=y(m);function h(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 v(e,t){function r(r){r.source===e.contentWindow&&h(r)&&t(r.data)}return window.addEventListener("message",r),function(){window.removeEventListener("message",r)}}function p(e,t,r,n,o,i,u,l,c,s){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),o&&f.searchParams.set("hide_price","true"),i&&f.searchParams.set("skip_redirect","true"),u){var d=true,y=false,m=undefined,h=true,v=false,p=undefined;try{for(var w=Object.entries(u).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),b;!(h=(b=w.next()).done);h=true){var E=a(b.value,2),_=E[0],g=E[1];if(_.startsWith("utm_"))if(Array.isArray(g))try{for(var O=g[Symbol.iterator](),S;!(d=(S=O.next()).done);d=true){var C=S.value;f.searchParams.append(_,C)}}catch(e){y=true;m=e}finally{try{if(!d&&O.return!=null){O.return()}}finally{if(y){throw m}}}else f.searchParams.set(_,g)}}catch(e){v=true;p=e}finally{try{if(!h&&w.return!=null){w.return()}}finally{if(v){throw p}}}}if(l){var D=true,A=false,M=undefined,I=true,k=false,P=undefined;try{for(var j=Object.entries(l)[Symbol.iterator](),T;!(I=(T=j.next()).done);I=true){var L=a(T.value,2),x=L[0],R=L[1];if(R)try{for(var U=Object.entries(R)[Symbol.iterator](),W;!(D=(W=U.next()).done);D=true){var B=a(W.value,2),N=B[0],F=B[1];f.searchParams.set("style.".concat(x,".").concat(N),F.toString())}}catch(e){A=true;M=e}finally{try{if(!D&&U.return!=null){U.return()}}finally{if(A){throw M}}}}}catch(e){k=true;P=e}finally{try{if(!I&&j.return!=null){j.return()}}finally{if(k){throw P}}}}var H=true,K=false,G=undefined;if((c===null||c===void 0?void 0:c.email)&&f.searchParams.set("email",c.email),s)try{for(var X=Object.entries(s)[Symbol.iterator](),q;!(H=(q=X.next()).done);H=true){var z=a(q.value,2),$=z[0],J=z[1];J&&f.searchParams.set("theme.".concat($),J)}}catch(e){K=true;G=e}finally{try{if(!H&&X.return!=null){X.return()}}finally{if(K){throw G}}}return f.toString()}var w=["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;";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});
|
|
@@ -20,8 +20,11 @@ interface WhopEmbeddedCheckoutStyleOptions {
|
|
|
20
20
|
interface WhopEmbeddedCheckoutPrefillOptions {
|
|
21
21
|
email?: string;
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
interface WhopEmbeddedCheckoutThemeOptions {
|
|
24
|
+
accentColor?: string;
|
|
25
|
+
}
|
|
26
|
+
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): string;
|
|
24
27
|
declare const EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST: string[];
|
|
25
28
|
declare const EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING = "document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";
|
|
26
29
|
|
|
27
|
-
export { EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING, EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST, type WhopCheckoutMessage, type WhopEmbeddedCheckoutPrefillOptions, type WhopEmbeddedCheckoutStyleOptions, getEmbeddedCheckoutIframeUrl, isWhopCheckoutMessage, onWhopCheckoutMessage };
|
|
30
|
+
export { EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING, EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST, type WhopCheckoutMessage, type WhopEmbeddedCheckoutPrefillOptions, type WhopEmbeddedCheckoutStyleOptions, type WhopEmbeddedCheckoutThemeOptions, getEmbeddedCheckoutIframeUrl, isWhopCheckoutMessage, onWhopCheckoutMessage };
|
|
@@ -20,8 +20,11 @@ interface WhopEmbeddedCheckoutStyleOptions {
|
|
|
20
20
|
interface WhopEmbeddedCheckoutPrefillOptions {
|
|
21
21
|
email?: string;
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
interface WhopEmbeddedCheckoutThemeOptions {
|
|
24
|
+
accentColor?: string;
|
|
25
|
+
}
|
|
26
|
+
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): string;
|
|
24
27
|
declare const EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST: string[];
|
|
25
28
|
declare const EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING = "document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";
|
|
26
29
|
|
|
27
|
-
export { EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING, EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST, type WhopCheckoutMessage, type WhopEmbeddedCheckoutPrefillOptions, type WhopEmbeddedCheckoutStyleOptions, getEmbeddedCheckoutIframeUrl, isWhopCheckoutMessage, onWhopCheckoutMessage };
|
|
30
|
+
export { EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING, EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST, type WhopCheckoutMessage, type WhopEmbeddedCheckoutPrefillOptions, type WhopEmbeddedCheckoutStyleOptions, type WhopEmbeddedCheckoutThemeOptions, getEmbeddedCheckoutIframeUrl, isWhopCheckoutMessage, onWhopCheckoutMessage };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e,
|
|
1
|
+
"use strict";function e(e,r){if(r==null||r>e.length)r=e.length;for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(e){if(Array.isArray(e))return e}function t(e,r){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var n=[];var a=true;var o=false;var i,l;try{for(t=t.call(e);!(a=(i=t.next()).done);a=true){n.push(i.value);if(r&&n.length===r)break}}catch(e){o=true;l=e}finally{try{if(!a&&t["return"]!=null)t["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 r(e)||t(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(r,t){if(!r)return;if(typeof r==="string")return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor)n=r.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(r,t)}(function(){var e=function e(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")};var r=function r(r,t){function n(n){n.source===r.contentWindow&&e(n)&&t(n.data)}return window.addEventListener("message",n),function(){window.removeEventListener("message",n)}};var t=function e(e,r,t,n,o,i,l,u,s,c){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),r&&f.searchParams.set("theme",r),t&&f.searchParams.set("session",t),o&&f.searchParams.set("hide_price","true"),i&&f.searchParams.set("skip_redirect","true"),l){var y=true,d=false,m=undefined,v=true,h=false,w=undefined;try{for(var p=Object.entries(l).sort(function(e,r){return e[0].localeCompare(r[0])})[Symbol.iterator](),b;!(v=(b=p.next()).done);v=true){var g=a(b.value,2),S=g[0],P=g[1];if(S.startsWith("utm_"))if(Array.isArray(P))try{for(var j=P[Symbol.iterator](),x;!(y=(x=j.next()).done);y=true){var A=x.value;f.searchParams.append(S,A)}}catch(e){d=true;m=e}finally{try{if(!y&&j.return!=null){j.return()}}finally{if(d){throw m}}}else f.searchParams.set(S,P)}}catch(e){h=true;w=e}finally{try{if(!v&&p.return!=null){p.return()}}finally{if(h){throw w}}}}if(u){var O=true,k=false,E=undefined,I=true,L=false,_=undefined;try{for(var C=Object.entries(u)[Symbol.iterator](),R;!(I=(R=C.next()).done);I=true){var U=a(R.value,2),W=U[0],q=U[1];if(q)try{for(var z=Object.entries(q)[Symbol.iterator](),M;!(O=(M=z.next()).done);O=true){var T=a(M.value,2),$=T[0],B=T[1];f.searchParams.set("style.".concat(W,".").concat($),B.toString())}}catch(e){k=true;E=e}finally{try{if(!O&&z.return!=null){z.return()}}finally{if(k){throw E}}}}}catch(e){L=true;_=e}finally{try{if(!I&&C.return!=null){C.return()}}finally{if(L){throw _}}}}var D=true,F=false,G=undefined;if((s===null||s===void 0?void 0:s.email)&&f.searchParams.set("email",s.email),c)try{for(var H=Object.entries(c)[Symbol.iterator](),J;!(D=(J=H.next()).done);D=true){var K=a(J.value,2),N=K[0],Q=K[1];Q&&f.searchParams.set("theme.".concat(N),Q)}}catch(e){F=true;G=e}finally{try{if(!D&&H.return!=null){H.return()}}finally{if(F){throw G}}}return f.toString()};var n=["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"],i="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;"})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,b as
|
|
1
|
+
import{a as e,b as E,c as s,d as a,e as o}from"./chunk-E7SFKHWN.mjs";export{o as EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING,a as EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST,s as getEmbeddedCheckoutIframeUrl,e as isWhopCheckoutMessage,E as onWhopCheckoutMessage};
|
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};
|