@whop/checkout 0.0.40 → 0.0.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +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){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function n(e,t,r,n,o,a,i){try{var u=e[a](i);var s=u.value}catch(e){r(e);return}if(u.done){t(s)}else{Promise.resolve(s).then(n,o)}}function o(e){return function(){var t=this,r=arguments;return new Promise(function(o,a){var i=e.apply(t,r);function u(e){n(i,o,a,u,s,"next",e)}function s(e){n(i,o,a,u,s,"throw",e)}u(undefined)})}}function a(e,t,r){t=c(t);return m(e,_()?Reflect.construct(t,r||[],c(e).constructor):t.apply(e,r))}function i(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function u(e,t,r){if(_()){u=Reflect.construct}else{u=function e(e,t,r){var n=[null];n.push.apply(n,t);var o=Function.bind.apply(e,n);var a=new o;if(r)b(a,r.prototype);return a}}return u.apply(null,arguments)}function s(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function c(e){c=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return c(e)}function l(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)b(e,t)}function f(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function d(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 v(){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 p(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}n.forEach(function(t){s(e,t,r[t])})}return e}function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(t){n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}r.push.apply(r,n)}return r}function h(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{y(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function m(e,t){if(t&&(g(t)==="object"||typeof t==="function")){return t}return r(e)}function b(e,t){b=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return b(e,t)}function w(e,r){return t(e)||d(e,r)||P(e,r)||v()}function g(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function P(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 O(e){var t=typeof Map==="function"?new Map:undefined;O=function e(e){if(e===null||!f(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return u(e,arguments,c(this).constructor)}r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:false,writable:true,configurable:true}});return b(r,e)};return O(e)}function _(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_=function(){return!!e})()}function j(e,t){var r,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=u(0),i["throw"]=u(1),i["return"]=u(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function u(e){return function(t){return s([e,t])}}function s(u){if(r)throw new TypeError("Generator is already executing.");while(i&&(i=0,u[0]&&(a=0)),a)try{if(r=1,n&&(o=u[0]&2?n["return"]:u[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;if(n=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:a.label++;return{value:u[1],done:false};case 5:a.label++;n=u[1];u=[0];continue;case 7:u=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){a=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(u[0]===6&&a.label<o[1]){a.label=o[1];o=u;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(u);break}if(o[2])a.ops.pop();a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e];n=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}var S=Object.defineProperty;var E=function(e,t,r){return t in e?S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r};var k=function(e,t,r){return E(e,(typeof t==="undefined"?"undefined":g(t))!="symbol"?t+"":t,r)};var x=/*#__PURE__*/function(e){"use strict";l(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);k(e,"type","WhopCheckoutError");return e}return t}(O(Error));var R=/*#__PURE__*/function(e){"use strict";l(t,e);function t(e){i(this,t);var r;r=a(this,t,[e!==null&&e!==void 0?e:"Timeout waiting for embed response"]);k(r,"name","WhopCheckoutRpcTimeoutError");return r}return t}(x);var A=/*#__PURE__*/function(e){"use strict";l(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);k(e,"name","WhopCheckoutSetEmailError");return e}return t}(x);var C=/*#__PURE__*/function(e){"use strict";l(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);k(e,"name","WhopCheckoutSetAddressError");return e}return t}(x);var T=/*#__PURE__*/function(e){"use strict";l(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);k(e,"name","WhopCheckoutGetAddressError");return e}return t}(x);var U=["resize","center","complete","state","get-email-result","set-email-result","set-address-result","get-address-result","address-validation-error"];function W(e){return g(e.data)=="object"&&e.data!==null&&"event"in e.data&&U.includes(e.data.event)}function L(e,t){return W(e)&&e.data.event===t}var M=[];function D(e){return M[e]||(M[e]=(e+256).toString(16).slice(1))}function I(){var e=new Uint8Array(16);if((typeof crypto==="undefined"?"undefined":g(crypto))<"u"&&typeof crypto.getRandomValues=="function")crypto.getRandomValues(e);else for(var t=0;t<16;t++)e[t]=Math.random()*256|0;return e[6]=e[6]&15|64,e[8]=e[8]&63|128,D(e[0])+D(e[1])+D(e[2])+D(e[3])+"-"+D(e[4])+D(e[5])+"-"+D(e[6])+D(e[7])+"-"+D(e[8])+D(e[9])+"-"+D(e[10])+D(e[11])+D(e[12])+D(e[13])+D(e[14])+D(e[15])}function B(e,t,r,n){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:2e3;var a;var i=new URL(e.src).origin,u=I();return(a=e.contentWindow)===null||a===void 0?void 0:a.postMessage(h(p({},t),{__scope:"whop-embedded-checkout",event_id:u}),i),new Promise(function(t,a){var i=setTimeout(function(){a(new R),window.removeEventListener("message",s)},o),s=function(o){if(o.source===e.contentWindow&&L(o,r)&&o.data.event===r&&o.data.event_id===u){clearTimeout(i),window.removeEventListener("message",s);try{t(n(o.data))}catch(e){a(e)}}};window.addEventListener("message",s)})}function F(e,t){function r(r){r.source===e.contentWindow&&W(r)&&t(r.data)}return window.addEventListener("message",r),function(){window.removeEventListener("message",r)}}function G(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return o(function(){return j(this,function(n){return[2,B(e,{event:"set-email",email:t},"set-email-result",function(e){if(!e.ok)throw new A(e.error)},r)]})})()}function V(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return o(function(){return j(this,function(r){return[2,B(e,{event:"get-email"},"get-email-result",function(e){return e.email},t)]})})()}function q(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return o(function(){return j(this,function(n){return[2,B(e,{event:"set-address",address:t},"set-address-result",function(e){if(!e.ok)throw new C(e.error)},r)]})})()}function z(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return o(function(){return j(this,function(r){return[2,B(e,{event:"get-address"},"get-address-result",function(e){if(!e.ok)throw new T(e.error);return{address:e.address,isComplete:e.is_complete}},t)]})})()}function $(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 H(e,t,r,n,o,a,i,u,s,c,l,f,d,v,p,y){var h,m,b,g,P,O,_;var j=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(j.searchParams.set("h",window.location.origin),t&&j.searchParams.set("theme",t),r&&j.searchParams.set("session",r),o&&j.searchParams.set("hide_price","true"),a&&j.searchParams.set("skip_redirect","true"),l&&j.searchParams.set("hide_submit_button","true"),f&&j.searchParams.set("hide_tos","true"),d&&j.searchParams.set("email.hidden","1"),v&&j.searchParams.set("email.disabled","1"),p&&j.searchParams.set("address.hidden","1"),y&&j.searchParams.set("a",y),i){var S=true,E=false,k=undefined,x=true,R=false,A=undefined;try{for(var C=Object.entries(i).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),T;!(x=(T=C.next()).done);x=true){var U=w(T.value,2),W=U[0],L=U[1];if(W.startsWith("utm_"))if(Array.isArray(L))try{for(var M=L[Symbol.iterator](),D;!(S=(D=M.next()).done);S=true){var I=D.value;j.searchParams.append(W,I)}}catch(e){E=true;k=e}finally{try{if(!S&&M.return!=null){M.return()}}finally{if(E){throw k}}}else j.searchParams.set(W,L)}}catch(e){R=true;A=e}finally{try{if(!x&&C.return!=null){C.return()}}finally{if(R){throw A}}}}if(u){var B=true,F=false,G=undefined,V=true,q=false,z=undefined;try{for(var $=Object.entries(u)[Symbol.iterator](),H;!(V=(H=$.next()).done);V=true){var J=w(H.value,2),K=J[0],N=J[1];if(N)try{for(var Q=Object.entries(N)[Symbol.iterator](),X;!(B=(X=Q.next()).done);B=true){var Y=w(X.value,2),Z=Y[0],ee=Y[1];j.searchParams.set("style.".concat(K,".").concat(Z),ee.toString())}}catch(e){F=true;G=e}finally{try{if(!B&&Q.return!=null){Q.return()}}finally{if(F){throw G}}}}}catch(e){q=true;z=e}finally{try{if(!V&&$.return!=null){$.return()}}finally{if(q){throw z}}}}var et=true,er=false,en=undefined;if((s===null||s===void 0?void 0:s.email)&&j.searchParams.set("email",s.email),(s===null||s===void 0?void 0:(h=s.address)===null||h===void 0?void 0:h.name)&&j.searchParams.set("name",s.address.name),(s===null||s===void 0?void 0:(m=s.address)===null||m===void 0?void 0:m.line1)&&j.searchParams.set("address.line1",s.address.line1),(s===null||s===void 0?void 0:(b=s.address)===null||b===void 0?void 0:b.line2)&&j.searchParams.set("address.line2",s.address.line2),(s===null||s===void 0?void 0:(g=s.address)===null||g===void 0?void 0:g.city)&&j.searchParams.set("address.city",s.address.city),(s===null||s===void 0?void 0:(P=s.address)===null||P===void 0?void 0:P.country)&&j.searchParams.set("address.country",s.address.country),(s===null||s===void 0?void 0:(O=s.address)===null||O===void 0?void 0:O.state)&&j.searchParams.set("address.state",s.address.state),(s===null||s===void 0?void 0:(_=s.address)===null||_===void 0?void 0:_.postalCode)&&j.searchParams.set("address.postal_code",s.address.postalCode),c)try{for(var eo=Object.entries(c)[Symbol.iterator](),ea;!(et=(ea=eo.next()).done);et=true){var ei=w(ea.value,2),eu=ei[0],es=ei[1];es&&j.searchParams.set("theme.".concat(eu),es)}}catch(e){er=true;en=e}finally{try{if(!et&&eo.return!=null){eo.return()}}finally{if(er){throw en}}}return j.toString()}var J=["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"],K="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";export{W as a,F as b,G as c,V as d,q as e,z as f,$ as g,H as h,J as i,K as j};
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){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function n(e,t,r,n,o,a,i){try{var u=e[a](i);var s=u.value}catch(e){r(e);return}if(u.done){t(s)}else{Promise.resolve(s).then(n,o)}}function o(e){return function(){var t=this,r=arguments;return new Promise(function(o,a){var i=e.apply(t,r);function u(e){n(i,o,a,u,s,"next",e)}function s(e){n(i,o,a,u,s,"throw",e)}u(undefined)})}}function a(e,t,r){t=c(t);return m(e,_()?Reflect.construct(t,r||[],c(e).constructor):t.apply(e,r))}function i(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function u(e,t,r){if(_()){u=Reflect.construct}else{u=function e(e,t,r){var n=[null];n.push.apply(n,t);var o=Function.bind.apply(e,n);var a=new o;if(r)b(a,r.prototype);return a}}return u.apply(null,arguments)}function s(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function c(e){c=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return c(e)}function l(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)b(e,t)}function f(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function d(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 v(){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 p(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}n.forEach(function(t){s(e,t,r[t])})}return e}function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(t){n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}r.push.apply(r,n)}return r}function h(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{y(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function m(e,t){if(t&&(g(t)==="object"||typeof t==="function")){return t}return r(e)}function b(e,t){b=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return b(e,t)}function w(e,r){return t(e)||d(e,r)||P(e,r)||v()}function g(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function P(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 O(e){var t=typeof Map==="function"?new Map:undefined;O=function e(e){if(e===null||!f(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return u(e,arguments,c(this).constructor)}r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:false,writable:true,configurable:true}});return b(r,e)};return O(e)}function _(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_=function(){return!!e})()}function j(e,t){var r,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=u(0),i["throw"]=u(1),i["return"]=u(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function u(e){return function(t){return s([e,t])}}function s(u){if(r)throw new TypeError("Generator is already executing.");while(i&&(i=0,u[0]&&(a=0)),a)try{if(r=1,n&&(o=u[0]&2?n["return"]:u[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;if(n=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:a.label++;return{value:u[1],done:false};case 5:a.label++;n=u[1];u=[0];continue;case 7:u=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){a=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(u[0]===6&&a.label<o[1]){a.label=o[1];o=u;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(u);break}if(o[2])a.ops.pop();a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e];n=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}var S=Object.defineProperty;var E=function(e,t,r){return t in e?S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r};var k=function(e,t,r){return E(e,(typeof t==="undefined"?"undefined":g(t))!="symbol"?t+"":t,r)};var x=/*#__PURE__*/function(e){"use strict";l(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);k(e,"type","WhopCheckoutError");return e}return t}(O(Error));var R=/*#__PURE__*/function(e){"use strict";l(t,e);function t(e){i(this,t);var r;r=a(this,t,[e!==null&&e!==void 0?e:"Timeout waiting for embed response"]);k(r,"name","WhopCheckoutRpcTimeoutError");return r}return t}(x);var A=/*#__PURE__*/function(e){"use strict";l(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);k(e,"name","WhopCheckoutSetEmailError");return e}return t}(x);var C=/*#__PURE__*/function(e){"use strict";l(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);k(e,"name","WhopCheckoutSetAddressError");return e}return t}(x);var T=/*#__PURE__*/function(e){"use strict";l(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);k(e,"name","WhopCheckoutGetAddressError");return e}return t}(x);var U=["resize","center","complete","state","get-email-result","set-email-result","set-address-result","get-address-result","address-validation-error"];function W(e){return g(e.data)=="object"&&e.data!==null&&"event"in e.data&&U.includes(e.data.event)}function L(e,t){return W(e)&&e.data.event===t}var M=[];function D(e){return M[e]||(M[e]=(e+256).toString(16).slice(1))}function I(){var e=new Uint8Array(16);if((typeof crypto==="undefined"?"undefined":g(crypto))<"u"&&typeof crypto.getRandomValues=="function")crypto.getRandomValues(e);else for(var t=0;t<16;t++)e[t]=Math.random()*256|0;return e[6]=e[6]&15|64,e[8]=e[8]&63|128,D(e[0])+D(e[1])+D(e[2])+D(e[3])+"-"+D(e[4])+D(e[5])+"-"+D(e[6])+D(e[7])+"-"+D(e[8])+D(e[9])+"-"+D(e[10])+D(e[11])+D(e[12])+D(e[13])+D(e[14])+D(e[15])}function B(e,t,r,n){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:2e3;var a;var i=new URL(e.src).origin,u=I();return(a=e.contentWindow)===null||a===void 0?void 0:a.postMessage(h(p({},t),{__scope:"whop-embedded-checkout",event_id:u}),i),new Promise(function(t,a){var i=setTimeout(function(){a(new R),window.removeEventListener("message",s)},o),s=function(o){if(o.source===e.contentWindow&&L(o,r)&&o.data.event===r&&o.data.event_id===u){clearTimeout(i),window.removeEventListener("message",s);try{t(n(o.data))}catch(e){a(e)}}};window.addEventListener("message",s)})}function F(e,t){function r(r){r.source===e.contentWindow&&W(r)&&t(r.data)}return window.addEventListener("message",r),function(){window.removeEventListener("message",r)}}function G(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return o(function(){return j(this,function(n){return[2,B(e,{event:"set-email",email:t},"set-email-result",function(e){if(!e.ok)throw new A(e.error)},r)]})})()}function V(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return o(function(){return j(this,function(r){return[2,B(e,{event:"get-email"},"get-email-result",function(e){return e.email},t)]})})()}function q(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return o(function(){return j(this,function(n){return[2,B(e,{event:"set-address",address:t},"set-address-result",function(e){if(!e.ok)throw new C(e.error)},r)]})})()}function z(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return o(function(){return j(this,function(r){return[2,B(e,{event:"get-address"},"get-address-result",function(e){if(!e.ok)throw new T(e.error);return{address:e.address,isComplete:e.is_complete}},t)]})})()}function $(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 H(e,t,r,n,o,a,i,u,s,c,l,f,d,v,p,y){var h,m,b,g,P,O,_;var j=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(j.searchParams.set("h",window.location.origin),t&&j.searchParams.set("theme",t),r&&j.searchParams.set("session",r),o&&j.searchParams.set("hide_price","true"),a&&j.searchParams.set("skip_redirect","true"),l&&j.searchParams.set("hide_submit_button","true"),f&&j.searchParams.set("hide_tos","true"),d&&j.searchParams.set("email.hidden","1"),v&&j.searchParams.set("email.disabled","1"),p&&j.searchParams.set("address.hidden","1"),y&&j.searchParams.set("a",y),i){var S=true,E=false,k=undefined,x=true,R=false,A=undefined;try{for(var C=Object.entries(i).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),T;!(x=(T=C.next()).done);x=true){var U=w(T.value,2),W=U[0],L=U[1];if(W.startsWith("utm_"))if(Array.isArray(L))try{for(var M=L[Symbol.iterator](),D;!(S=(D=M.next()).done);S=true){var I=D.value;j.searchParams.append(W,I)}}catch(e){E=true;k=e}finally{try{if(!S&&M.return!=null){M.return()}}finally{if(E){throw k}}}else j.searchParams.set(W,L)}}catch(e){R=true;A=e}finally{try{if(!x&&C.return!=null){C.return()}}finally{if(R){throw A}}}}if(u){var B=true,F=false,G=undefined,V=true,q=false,z=undefined;try{for(var $=Object.entries(u)[Symbol.iterator](),H;!(V=(H=$.next()).done);V=true){var J=w(H.value,2),K=J[0],N=J[1];if(N)try{for(var Q=Object.entries(N)[Symbol.iterator](),X;!(B=(X=Q.next()).done);B=true){var Y=w(X.value,2),Z=Y[0],ee=Y[1];j.searchParams.set("style.".concat(K,".").concat(Z),ee.toString())}}catch(e){F=true;G=e}finally{try{if(!B&&Q.return!=null){Q.return()}}finally{if(F){throw G}}}}}catch(e){q=true;z=e}finally{try{if(!V&&$.return!=null){$.return()}}finally{if(q){throw z}}}}var et=true,er=false,en=undefined;if((s===null||s===void 0?void 0:s.email)&&j.searchParams.set("email",s.email),(s===null||s===void 0?void 0:(h=s.address)===null||h===void 0?void 0:h.name)&&j.searchParams.set("name",s.address.name),(s===null||s===void 0?void 0:(m=s.address)===null||m===void 0?void 0:m.line1)&&j.searchParams.set("address.line1",s.address.line1),(s===null||s===void 0?void 0:(b=s.address)===null||b===void 0?void 0:b.line2)&&j.searchParams.set("address.line2",s.address.line2),(s===null||s===void 0?void 0:(g=s.address)===null||g===void 0?void 0:g.city)&&j.searchParams.set("address.city",s.address.city),(s===null||s===void 0?void 0:(P=s.address)===null||P===void 0?void 0:P.country)&&j.searchParams.set("address.country",s.address.country),(s===null||s===void 0?void 0:(O=s.address)===null||O===void 0?void 0:O.state)&&j.searchParams.set("address.state",s.address.state),(s===null||s===void 0?void 0:(_=s.address)===null||_===void 0?void 0:_.postalCode)&&j.searchParams.set("address.postal_code",s.address.postalCode),c)try{for(var eo=Object.entries(c)[Symbol.iterator](),ea;!(et=(ea=eo.next()).done);et=true){var ei=w(ea.value,2),eu=ei[0],es=ei[1];es&&j.searchParams.set("theme.".concat(eu),typeof es=="boolean"?"1":es)}}catch(e){er=true;en=e}finally{try{if(!et&&eo.return!=null){eo.return()}}finally{if(er){throw en}}}return j.toString()}var J=["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"],K="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";export{W as a,F as b,G as c,V as d,q as e,z as f,$ as g,H as h,J as i,K as j};
@@ -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){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function o(e,t,r,n,o,a,i){try{var u=e[a](i);var s=u.value}catch(e){r(e);return}if(u.done){t(s)}else{Promise.resolve(s).then(n,o)}}function a(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var i=e.apply(t,r);function u(e){o(i,n,a,u,s,"next",e)}function s(e){o(i,n,a,u,s,"throw",e)}u(undefined)})}}function i(e,t,r){t=d(t);return g(e,j()?Reflect.construct(t,r||[],d(e).constructor):t.apply(e,r))}function u(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function s(e,t,r){if(j()){s=Reflect.construct}else{s=function e(e,t,r){var n=[null];n.push.apply(n,t);var o=Function.bind.apply(e,n);var a=new o;if(r)P(a,r.prototype);return a}}return s.apply(null,arguments)}function l(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function d(e){d=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return d(e)}function c(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)P(e,t)}function f(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function h(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function v(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function p(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 w(){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 y(){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 m(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}n.forEach(function(t){l(e,t,r[t])})}return e}function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(t){n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}r.push.apply(r,n)}return r}function k(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{b(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function g(e,t){if(t&&(S(t)==="object"||typeof t==="function")){return t}return n(e)}function P(e,t){P=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return P(e,t)}function C(e,r){return t(e)||p(e,r)||A(e,r)||w()}function O(e){return t(e)||v(e)||A(e)||w()}function _(e){return r(e)||v(e)||A(e)||y()}function S(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function A(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 E(e){var t=typeof Map==="function"?new Map:undefined;E=function e(e){if(e===null||!h(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return s(e,arguments,d(this).constructor)}r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:false,writable:true,configurable:true}});return P(r,e)};return E(e)}function j(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(j=function(){return!!e})()}function x(e,t){var r,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=u(0),i["throw"]=u(1),i["return"]=u(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function u(e){return function(t){return s([e,t])}}function s(u){if(r)throw new TypeError("Generator is already executing.");while(i&&(i=0,u[0]&&(a=0)),a)try{if(r=1,n&&(o=u[0]&2?n["return"]:u[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;if(n=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:a.label++;return{value:u[1],done:false};case 5:a.label++;n=u[1];u=[0];continue;case 7:u=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){a=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(u[0]===6&&a.label<o[1]){a.label=o[1];o=u;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(u);break}if(o[2])a.ops.pop();a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e];n=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}var R=Object.defineProperty;var L=function(e,t,r){return t in e?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r};var T=function(e,t,r){return L(e,(typeof t==="undefined"?"undefined":S(t))!="symbol"?t+"":t,r)};var I=/*#__PURE__*/function(e){c(t,e);function t(){u(this,t);var e;e=i(this,t,arguments);T(e,"type","WhopCheckoutError");return e}return t}(E(Error));var U=/*#__PURE__*/function(e){c(t,e);function t(e){u(this,t);var r;r=i(this,t,[e!==null&&e!==void 0?e:"Timeout waiting for embed response"]);T(r,"name","WhopCheckoutRpcTimeoutError");return r}return t}(I);var W=/*#__PURE__*/function(e){c(t,e);function t(){u(this,t);var e;e=i(this,t,arguments);T(e,"name","WhopCheckoutSetEmailError");return e}return t}(I);var M=/*#__PURE__*/function(e){c(t,e);function t(){u(this,t);var e;e=i(this,t,arguments);T(e,"name","WhopCheckoutSetAddressError");return e}return t}(I);var H=/*#__PURE__*/function(e){c(t,e);function t(){u(this,t);var e;e=i(this,t,arguments);T(e,"name","WhopCheckoutGetAddressError");return e}return t}(I);var D=["resize","center","complete","state","get-email-result","set-email-result","set-address-result","get-address-result","address-validation-error"];function F(e){return S(e.data)=="object"&&e.data!==null&&"event"in e.data&&D.includes(e.data.event)}function N(e,t){return F(e)&&e.data.event===t}var V=[];function B(e){return V[e]||(V[e]=(e+256).toString(16).slice(1))}function q(){var e=new Uint8Array(16);if((typeof crypto==="undefined"?"undefined":S(crypto))<"u"&&typeof crypto.getRandomValues=="function")crypto.getRandomValues(e);else for(var t=0;t<16;t++)e[t]=Math.random()*256|0;return e[6]=e[6]&15|64,e[8]=e[8]&63|128,B(e[0])+B(e[1])+B(e[2])+B(e[3])+"-"+B(e[4])+B(e[5])+"-"+B(e[6])+B(e[7])+"-"+B(e[8])+B(e[9])+"-"+B(e[10])+B(e[11])+B(e[12])+B(e[13])+B(e[14])+B(e[15])}function z(e,t,r,n){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:2e3;var a;var i=new URL(e.src).origin,u=q();return(a=e.contentWindow)===null||a===void 0?void 0:a.postMessage(k(m({},t),{__scope:"whop-embedded-checkout",event_id:u}),i),new Promise(function(t,a){var i=setTimeout(function(){a(new U),window.removeEventListener("message",s)},o),s=function(o){if(o.source===e.contentWindow&&N(o,r)&&o.data.event===r&&o.data.event_id===u){clearTimeout(i),window.removeEventListener("message",s);try{t(n(o.data))}catch(e){a(e)}}};window.addEventListener("message",s)})}function G(e,t){function r(r){r.source===e.contentWindow&&F(r)&&t(r.data)}return window.addEventListener("message",r),function(){window.removeEventListener("message",r)}}function $(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return a(function(){return x(this,function(n){return[2,z(e,{event:"set-email",email:t},"set-email-result",function(e){if(!e.ok)throw new W(e.error)},r)]})})()}function J(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return a(function(){return x(this,function(r){return[2,z(e,{event:"get-email"},"get-email-result",function(e){return e.email},t)]})})()}function K(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return a(function(){return x(this,function(n){return[2,z(e,{event:"set-address",address:t},"set-address-result",function(e){if(!e.ok)throw new M(e.error)},r)]})})()}function Q(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return a(function(){return x(this,function(r){return[2,z(e,{event:"get-address"},"get-address-result",function(e){if(!e.ok)throw new H(e.error);return{address:e.address,isComplete:e.is_complete}},t)]})})()}function X(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 Y(e,t,r,n,o,a,i,u,s,l,d,c,f,h,v,p){var w,y,m,b,k,g,P;var O=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(O.searchParams.set("h",window.location.origin),t&&O.searchParams.set("theme",t),r&&O.searchParams.set("session",r),o&&O.searchParams.set("hide_price","true"),a&&O.searchParams.set("skip_redirect","true"),d&&O.searchParams.set("hide_submit_button","true"),c&&O.searchParams.set("hide_tos","true"),f&&O.searchParams.set("email.hidden","1"),h&&O.searchParams.set("email.disabled","1"),v&&O.searchParams.set("address.hidden","1"),p&&O.searchParams.set("a",p),i){var _=true,S=false,A=undefined,E=true,j=false,x=undefined;try{for(var R=Object.entries(i).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),L;!(E=(L=R.next()).done);E=true){var T=C(L.value,2),I=T[0],U=T[1];if(I.startsWith("utm_"))if(Array.isArray(U))try{for(var W=U[Symbol.iterator](),M;!(_=(M=W.next()).done);_=true){var H=M.value;O.searchParams.append(I,H)}}catch(e){S=true;A=e}finally{try{if(!_&&W.return!=null){W.return()}}finally{if(S){throw A}}}else O.searchParams.set(I,U)}}catch(e){j=true;x=e}finally{try{if(!E&&R.return!=null){R.return()}}finally{if(j){throw x}}}}if(u){var D=true,F=false,N=undefined,V=true,B=false,q=undefined;try{for(var z=Object.entries(u)[Symbol.iterator](),G;!(V=(G=z.next()).done);V=true){var $=C(G.value,2),J=$[0],K=$[1];if(K)try{for(var Q=Object.entries(K)[Symbol.iterator](),X;!(D=(X=Q.next()).done);D=true){var Y=C(X.value,2),Z=Y[0],ee=Y[1];O.searchParams.set("style.".concat(J,".").concat(Z),ee.toString())}}catch(e){F=true;N=e}finally{try{if(!D&&Q.return!=null){Q.return()}}finally{if(F){throw N}}}}}catch(e){B=true;q=e}finally{try{if(!V&&z.return!=null){z.return()}}finally{if(B){throw q}}}}var et=true,er=false,en=undefined;if((s===null||s===void 0?void 0:s.email)&&O.searchParams.set("email",s.email),(s===null||s===void 0?void 0:(w=s.address)===null||w===void 0?void 0:w.name)&&O.searchParams.set("name",s.address.name),(s===null||s===void 0?void 0:(y=s.address)===null||y===void 0?void 0:y.line1)&&O.searchParams.set("address.line1",s.address.line1),(s===null||s===void 0?void 0:(m=s.address)===null||m===void 0?void 0:m.line2)&&O.searchParams.set("address.line2",s.address.line2),(s===null||s===void 0?void 0:(b=s.address)===null||b===void 0?void 0:b.city)&&O.searchParams.set("address.city",s.address.city),(s===null||s===void 0?void 0:(k=s.address)===null||k===void 0?void 0:k.country)&&O.searchParams.set("address.country",s.address.country),(s===null||s===void 0?void 0:(g=s.address)===null||g===void 0?void 0:g.state)&&O.searchParams.set("address.state",s.address.state),(s===null||s===void 0?void 0:(P=s.address)===null||P===void 0?void 0:P.postalCode)&&O.searchParams.set("address.postal_code",s.address.postalCode),l)try{for(var eo=Object.entries(l)[Symbol.iterator](),ea;!(et=(ea=eo.next()).done);et=true){var ei=C(ea.value,2),eu=ei[0],es=ei[1];es&&O.searchParams.set("theme.".concat(eu),es)}}catch(e){er=true;en=e}finally{try{if(!et&&eo.return!=null){eo.return()}}finally{if(er){throw en}}}return O.toString()}var Z=["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"],ee="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";function et(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,_(r))}function er(e,t){var r;e.addEventListener("checkout:submit",function(t){X(e,t.detail)}),(r=window.wco)===null||r===void 0?void 0:r.frames.set(e,G(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":{et(t.dataset.whopCheckoutOnComplete,r.plan_id,r.receipt_id);break}case"state":{et(t.dataset.whopCheckoutOnStateChange,r.state);break}case"address-validation-error":{et(t.dataset.whopCheckoutOnAddressValidationError,{error_message:r.error_message,error_code:r.error_code});break}}}))}function en(){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 eo="data-whop-checkout-style-";function ea(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(eo)){var s=u.name.slice(eo.length),l=u.value,d=O(s.split("-")),c=d[0],f=d.slice(1);if(c&&f.length>0){var h=f.reduce(function(e,t,r){if(r===0)return t;var n=O(t),o=n[0],a=n.slice(1);return"".concat(e).concat(o.toUpperCase()).concat(a.join(""))},"");var v;(v=t[c])!==null&&v!==void 0?v:t[c]={},t[c][h]=l}}}}catch(e){n=true;o=e}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(n){throw o}}}return t}function ei(e){var t={};return e.dataset.whopCheckoutThemeAccentColor&&(t.accentColor=e.dataset.whopCheckoutThemeAccentColor),t}function eu(e){var t={};var r,n,o,a,i,u,s;return e.dataset.whopCheckoutPrefillEmail&&(t.email=e.dataset.whopCheckoutPrefillEmail),e.dataset.whopCheckoutPrefillName&&((r=t.address)!==null&&r!==void 0?r:t.address={},t.address.name=e.dataset.whopCheckoutPrefillName),e.dataset.whopCheckoutPrefillAddressLine1&&((n=t.address)!==null&&n!==void 0?n:t.address={},t.address.line1=e.dataset.whopCheckoutPrefillAddressLine1),e.dataset.whopCheckoutPrefillAddressLine2&&((o=t.address)!==null&&o!==void 0?o:t.address={},t.address.line2=e.dataset.whopCheckoutPrefillAddressLine2),e.dataset.whopCheckoutPrefillAddressCity&&((a=t.address)!==null&&a!==void 0?a:t.address={},t.address.city=e.dataset.whopCheckoutPrefillAddressCity),e.dataset.whopCheckoutPrefillAddressCountry&&((i=t.address)!==null&&i!==void 0?i:t.address={},t.address.country=e.dataset.whopCheckoutPrefillAddressCountry),e.dataset.whopCheckoutPrefillAddressState&&((u=t.address)!==null&&u!==void 0?u:t.address={},t.address.state=e.dataset.whopCheckoutPrefillAddressState),e.dataset.whopCheckoutPrefillAddressPostalCode&&((s=t.address)!==null&&s!==void 0?s:t.address={},t.address.postalCode=e.dataset.whopCheckoutPrefillAddressPostalCode),t}function es(e){var t;var r;if(e.dataset.whopCheckoutMounted)return;var n=e.dataset.whopCheckoutPlanId;if(!n)return;var o=Y(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:en(),ea(e),eu(e),ei(e),e.dataset.whopCheckoutHideSubmitButton==="true",e.dataset.whopCheckoutHideTos==="true",e.dataset.whopCheckoutHideEmail==="true",e.dataset.whopCheckoutDisableEmail==="true",e.dataset.whopCheckoutHideAddress==="true",e.dataset.whopCheckoutAffiliateCode),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,_(Z)),a.allow=ee,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),er(a,e)}if((typeof window==="undefined"?"undefined":S(window))<"u"&&window.wco&&!window.wco.listening){var el=function e(e){var t;var r=(t=window.wco)===null||t===void 0?void 0:t.identifiedFrames.get(e);if(!r)throw new Error("No embed with identifier ".concat(e," found."));return r};ey=el,window.wco.getEmail=function(e,t){return J(el(e),t)},window.wco.setEmail=function(e,t,r){return $(el(e),t,r)},window.wco.getAddress=function(e,t){return Q(el(e),t)},window.wco.setAddress=function(e,t,r){return K(el(e),t,r)};var ed=new MutationObserver(function(e){var t=true,r=false,n=undefined;try{for(var o=e[Symbol.iterator](),a;!(t=(a=o.next()).done);t=true){var i=a.value;var u,s,l;var d=true,c=false,h=undefined;try{for(var v=i.addedNodes[Symbol.iterator](),p;!(d=(p=v.next()).done);d=true){var w=p.value;f(w,HTMLElement)&&w.dataset.whopCheckoutPlanId&&es(w)}}catch(e){c=true;h=e}finally{try{if(!d&&v.return!=null){v.return()}}finally{if(c){throw h}}}var y=Array.from(i.removedNodes);var m;var b=true,k=false,g=undefined;try{for(var P=((m=(u=window.wco)===null||u===void 0?void 0:u.frames)!==null&&m!==void 0?m:[])[Symbol.iterator](),O;!(b=(O=P.next()).done);b=true){var _=C(O.value,2),S=_[0],A=_[1];y.includes(S)&&(S.dataset.whopCheckoutIdentifier&&((s=window.wco)===null||s===void 0?void 0:s.identifiedFrames.delete(S.dataset.whopCheckoutIdentifier)),A(),(l=window.wco)===null||l===void 0?void 0:l.frames.delete(S))}}catch(e){k=true;g=e}finally{try{if(!b&&P.return!=null){P.return()}}finally{if(k){throw g}}}}}catch(e){r=true;n=e}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(r){throw n}}}});var ec=true,ef=false,eh=undefined;try{for(var ev=document.querySelectorAll("[data-whop-checkout-plan-id]")[Symbol.iterator](),ep;!(ec=(ep=ev.next()).done);ec=true){var ew=ep.value;f(ew,HTMLElement)&&es(ew)}}catch(e){ef=true;eh=e}finally{try{if(!ec&&ev.return!=null){ev.return()}}finally{if(ef){throw eh}}}ed.observe(document.body,{childList:!0,subtree:!0}),window.wco.listening=!0}var ey;
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){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function o(e,t,r,n,o,a,i){try{var u=e[a](i);var s=u.value}catch(e){r(e);return}if(u.done){t(s)}else{Promise.resolve(s).then(n,o)}}function a(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var i=e.apply(t,r);function u(e){o(i,n,a,u,s,"next",e)}function s(e){o(i,n,a,u,s,"throw",e)}u(undefined)})}}function i(e,t,r){t=d(t);return k(e,j()?Reflect.construct(t,r||[],d(e).constructor):t.apply(e,r))}function u(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function s(e,t,r){if(j()){s=Reflect.construct}else{s=function e(e,t,r){var n=[null];n.push.apply(n,t);var o=Function.bind.apply(e,n);var a=new o;if(r)C(a,r.prototype);return a}}return s.apply(null,arguments)}function l(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function d(e){d=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return d(e)}function c(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)C(e,t)}function f(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function h(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function v(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function p(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 w(){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 y(){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 m(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}n.forEach(function(t){l(e,t,r[t])})}return e}function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(t){n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}r.push.apply(r,n)}return r}function g(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{b(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function k(e,t){if(t&&(S(t)==="object"||typeof t==="function")){return t}return n(e)}function C(e,t){C=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return C(e,t)}function P(e,r){return t(e)||p(e,r)||A(e,r)||w()}function O(e){return t(e)||v(e)||A(e)||w()}function _(e){return r(e)||v(e)||A(e)||y()}function S(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function A(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 E(e){var t=typeof Map==="function"?new Map:undefined;E=function e(e){if(e===null||!h(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return s(e,arguments,d(this).constructor)}r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:false,writable:true,configurable:true}});return C(r,e)};return E(e)}function j(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(j=function(){return!!e})()}function x(e,t){var r,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=u(0),i["throw"]=u(1),i["return"]=u(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function u(e){return function(t){return s([e,t])}}function s(u){if(r)throw new TypeError("Generator is already executing.");while(i&&(i=0,u[0]&&(a=0)),a)try{if(r=1,n&&(o=u[0]&2?n["return"]:u[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;if(n=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:a.label++;return{value:u[1],done:false};case 5:a.label++;n=u[1];u=[0];continue;case 7:u=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){a=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(u[0]===6&&a.label<o[1]){a.label=o[1];o=u;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(u);break}if(o[2])a.ops.pop();a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e];n=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}var R=Object.defineProperty;var T=function(e,t,r){return t in e?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r};var L=function(e,t,r){return T(e,(typeof t==="undefined"?"undefined":S(t))!="symbol"?t+"":t,r)};var I=/*#__PURE__*/function(e){c(t,e);function t(){u(this,t);var e;e=i(this,t,arguments);L(e,"type","WhopCheckoutError");return e}return t}(E(Error));var U=/*#__PURE__*/function(e){c(t,e);function t(e){u(this,t);var r;r=i(this,t,[e!==null&&e!==void 0?e:"Timeout waiting for embed response"]);L(r,"name","WhopCheckoutRpcTimeoutError");return r}return t}(I);var W=/*#__PURE__*/function(e){c(t,e);function t(){u(this,t);var e;e=i(this,t,arguments);L(e,"name","WhopCheckoutSetEmailError");return e}return t}(I);var M=/*#__PURE__*/function(e){c(t,e);function t(){u(this,t);var e;e=i(this,t,arguments);L(e,"name","WhopCheckoutSetAddressError");return e}return t}(I);var H=/*#__PURE__*/function(e){c(t,e);function t(){u(this,t);var e;e=i(this,t,arguments);L(e,"name","WhopCheckoutGetAddressError");return e}return t}(I);var D=["resize","center","complete","state","get-email-result","set-email-result","set-address-result","get-address-result","address-validation-error"];function F(e){return S(e.data)=="object"&&e.data!==null&&"event"in e.data&&D.includes(e.data.event)}function N(e,t){return F(e)&&e.data.event===t}var V=[];function B(e){return V[e]||(V[e]=(e+256).toString(16).slice(1))}function q(){var e=new Uint8Array(16);if((typeof crypto==="undefined"?"undefined":S(crypto))<"u"&&typeof crypto.getRandomValues=="function")crypto.getRandomValues(e);else for(var t=0;t<16;t++)e[t]=Math.random()*256|0;return e[6]=e[6]&15|64,e[8]=e[8]&63|128,B(e[0])+B(e[1])+B(e[2])+B(e[3])+"-"+B(e[4])+B(e[5])+"-"+B(e[6])+B(e[7])+"-"+B(e[8])+B(e[9])+"-"+B(e[10])+B(e[11])+B(e[12])+B(e[13])+B(e[14])+B(e[15])}function z(e,t,r,n){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:2e3;var a;var i=new URL(e.src).origin,u=q();return(a=e.contentWindow)===null||a===void 0?void 0:a.postMessage(g(m({},t),{__scope:"whop-embedded-checkout",event_id:u}),i),new Promise(function(t,a){var i=setTimeout(function(){a(new U),window.removeEventListener("message",s)},o),s=function(o){if(o.source===e.contentWindow&&N(o,r)&&o.data.event===r&&o.data.event_id===u){clearTimeout(i),window.removeEventListener("message",s);try{t(n(o.data))}catch(e){a(e)}}};window.addEventListener("message",s)})}function G(e,t){function r(r){r.source===e.contentWindow&&F(r)&&t(r.data)}return window.addEventListener("message",r),function(){window.removeEventListener("message",r)}}function $(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return a(function(){return x(this,function(n){return[2,z(e,{event:"set-email",email:t},"set-email-result",function(e){if(!e.ok)throw new W(e.error)},r)]})})()}function J(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return a(function(){return x(this,function(r){return[2,z(e,{event:"get-email"},"get-email-result",function(e){return e.email},t)]})})()}function K(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return a(function(){return x(this,function(n){return[2,z(e,{event:"set-address",address:t},"set-address-result",function(e){if(!e.ok)throw new M(e.error)},r)]})})()}function Q(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return a(function(){return x(this,function(r){return[2,z(e,{event:"get-address"},"get-address-result",function(e){if(!e.ok)throw new H(e.error);return{address:e.address,isComplete:e.is_complete}},t)]})})()}function X(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 Y(e,t,r,n,o,a,i,u,s,l,d,c,f,h,v,p){var w,y,m,b,g,k,C;var O=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(O.searchParams.set("h",window.location.origin),t&&O.searchParams.set("theme",t),r&&O.searchParams.set("session",r),o&&O.searchParams.set("hide_price","true"),a&&O.searchParams.set("skip_redirect","true"),d&&O.searchParams.set("hide_submit_button","true"),c&&O.searchParams.set("hide_tos","true"),f&&O.searchParams.set("email.hidden","1"),h&&O.searchParams.set("email.disabled","1"),v&&O.searchParams.set("address.hidden","1"),p&&O.searchParams.set("a",p),i){var _=true,S=false,A=undefined,E=true,j=false,x=undefined;try{for(var R=Object.entries(i).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),T;!(E=(T=R.next()).done);E=true){var L=P(T.value,2),I=L[0],U=L[1];if(I.startsWith("utm_"))if(Array.isArray(U))try{for(var W=U[Symbol.iterator](),M;!(_=(M=W.next()).done);_=true){var H=M.value;O.searchParams.append(I,H)}}catch(e){S=true;A=e}finally{try{if(!_&&W.return!=null){W.return()}}finally{if(S){throw A}}}else O.searchParams.set(I,U)}}catch(e){j=true;x=e}finally{try{if(!E&&R.return!=null){R.return()}}finally{if(j){throw x}}}}if(u){var D=true,F=false,N=undefined,V=true,B=false,q=undefined;try{for(var z=Object.entries(u)[Symbol.iterator](),G;!(V=(G=z.next()).done);V=true){var $=P(G.value,2),J=$[0],K=$[1];if(K)try{for(var Q=Object.entries(K)[Symbol.iterator](),X;!(D=(X=Q.next()).done);D=true){var Y=P(X.value,2),Z=Y[0],ee=Y[1];O.searchParams.set("style.".concat(J,".").concat(Z),ee.toString())}}catch(e){F=true;N=e}finally{try{if(!D&&Q.return!=null){Q.return()}}finally{if(F){throw N}}}}}catch(e){B=true;q=e}finally{try{if(!V&&z.return!=null){z.return()}}finally{if(B){throw q}}}}var et=true,er=false,en=undefined;if((s===null||s===void 0?void 0:s.email)&&O.searchParams.set("email",s.email),(s===null||s===void 0?void 0:(w=s.address)===null||w===void 0?void 0:w.name)&&O.searchParams.set("name",s.address.name),(s===null||s===void 0?void 0:(y=s.address)===null||y===void 0?void 0:y.line1)&&O.searchParams.set("address.line1",s.address.line1),(s===null||s===void 0?void 0:(m=s.address)===null||m===void 0?void 0:m.line2)&&O.searchParams.set("address.line2",s.address.line2),(s===null||s===void 0?void 0:(b=s.address)===null||b===void 0?void 0:b.city)&&O.searchParams.set("address.city",s.address.city),(s===null||s===void 0?void 0:(g=s.address)===null||g===void 0?void 0:g.country)&&O.searchParams.set("address.country",s.address.country),(s===null||s===void 0?void 0:(k=s.address)===null||k===void 0?void 0:k.state)&&O.searchParams.set("address.state",s.address.state),(s===null||s===void 0?void 0:(C=s.address)===null||C===void 0?void 0:C.postalCode)&&O.searchParams.set("address.postal_code",s.address.postalCode),l)try{for(var eo=Object.entries(l)[Symbol.iterator](),ea;!(et=(ea=eo.next()).done);et=true){var ei=P(ea.value,2),eu=ei[0],es=ei[1];es&&O.searchParams.set("theme.".concat(eu),typeof es=="boolean"?"1":es)}}catch(e){er=true;en=e}finally{try{if(!et&&eo.return!=null){eo.return()}}finally{if(er){throw en}}}return O.toString()}var Z=["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"],ee="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";function et(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,_(r))}function er(e,t){var r;e.addEventListener("checkout:submit",function(t){X(e,t.detail)}),(r=window.wco)===null||r===void 0?void 0:r.frames.set(e,G(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":{et(t.dataset.whopCheckoutOnComplete,r.plan_id,r.receipt_id);break}case"state":{et(t.dataset.whopCheckoutOnStateChange,r.state);break}case"address-validation-error":{et(t.dataset.whopCheckoutOnAddressValidationError,{error_message:r.error_message,error_code:r.error_code});break}}}))}function en(){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 eo="data-whop-checkout-style-";function ea(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(eo)){var s=u.name.slice(eo.length),l=u.value,d=O(s.split("-")),c=d[0],f=d.slice(1);if(c&&f.length>0){var h=f.reduce(function(e,t,r){if(r===0)return t;var n=O(t),o=n[0],a=n.slice(1);return"".concat(e).concat(o.toUpperCase()).concat(a.join(""))},"");var v;(v=t[c])!==null&&v!==void 0?v:t[c]={},t[c][h]=l}}}}catch(e){n=true;o=e}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(n){throw o}}}return t}function ei(e){var t={};return e.dataset.whopCheckoutThemeAccentColor&&(t.accentColor=e.dataset.whopCheckoutThemeAccentColor),e.dataset.whopCheckoutThemeHighContrast&&(t.highContrast=e.dataset.whopCheckoutThemeHighContrast==="true"),t}function eu(e){var t={};var r,n,o,a,i,u,s;return e.dataset.whopCheckoutPrefillEmail&&(t.email=e.dataset.whopCheckoutPrefillEmail),e.dataset.whopCheckoutPrefillName&&((r=t.address)!==null&&r!==void 0?r:t.address={},t.address.name=e.dataset.whopCheckoutPrefillName),e.dataset.whopCheckoutPrefillAddressLine1&&((n=t.address)!==null&&n!==void 0?n:t.address={},t.address.line1=e.dataset.whopCheckoutPrefillAddressLine1),e.dataset.whopCheckoutPrefillAddressLine2&&((o=t.address)!==null&&o!==void 0?o:t.address={},t.address.line2=e.dataset.whopCheckoutPrefillAddressLine2),e.dataset.whopCheckoutPrefillAddressCity&&((a=t.address)!==null&&a!==void 0?a:t.address={},t.address.city=e.dataset.whopCheckoutPrefillAddressCity),e.dataset.whopCheckoutPrefillAddressCountry&&((i=t.address)!==null&&i!==void 0?i:t.address={},t.address.country=e.dataset.whopCheckoutPrefillAddressCountry),e.dataset.whopCheckoutPrefillAddressState&&((u=t.address)!==null&&u!==void 0?u:t.address={},t.address.state=e.dataset.whopCheckoutPrefillAddressState),e.dataset.whopCheckoutPrefillAddressPostalCode&&((s=t.address)!==null&&s!==void 0?s:t.address={},t.address.postalCode=e.dataset.whopCheckoutPrefillAddressPostalCode),t}function es(e){var t;var r;if(e.dataset.whopCheckoutMounted)return;var n=e.dataset.whopCheckoutPlanId;if(!n)return;var o=Y(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:en(),ea(e),eu(e),ei(e),e.dataset.whopCheckoutHideSubmitButton==="true",e.dataset.whopCheckoutHideTos==="true",e.dataset.whopCheckoutHideEmail==="true",e.dataset.whopCheckoutDisableEmail==="true",e.dataset.whopCheckoutHideAddress==="true",e.dataset.whopCheckoutAffiliateCode),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,_(Z)),a.allow=ee,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),er(a,e)}if((typeof window==="undefined"?"undefined":S(window))<"u"&&window.wco&&!window.wco.listening){var el=function e(e){var t;var r=(t=window.wco)===null||t===void 0?void 0:t.identifiedFrames.get(e);if(!r)throw new Error("No embed with identifier ".concat(e," found."));return r};ey=el,window.wco.getEmail=function(e,t){return J(el(e),t)},window.wco.setEmail=function(e,t,r){return $(el(e),t,r)},window.wco.getAddress=function(e,t){return Q(el(e),t)},window.wco.setAddress=function(e,t,r){return K(el(e),t,r)};var ed=new MutationObserver(function(e){var t=true,r=false,n=undefined;try{for(var o=e[Symbol.iterator](),a;!(t=(a=o.next()).done);t=true){var i=a.value;var u,s,l;var d=true,c=false,h=undefined;try{for(var v=i.addedNodes[Symbol.iterator](),p;!(d=(p=v.next()).done);d=true){var w=p.value;f(w,HTMLElement)&&w.dataset.whopCheckoutPlanId&&es(w)}}catch(e){c=true;h=e}finally{try{if(!d&&v.return!=null){v.return()}}finally{if(c){throw h}}}var y=Array.from(i.removedNodes);var m;var b=true,g=false,k=undefined;try{for(var C=((m=(u=window.wco)===null||u===void 0?void 0:u.frames)!==null&&m!==void 0?m:[])[Symbol.iterator](),O;!(b=(O=C.next()).done);b=true){var _=P(O.value,2),S=_[0],A=_[1];y.includes(S)&&(S.dataset.whopCheckoutIdentifier&&((s=window.wco)===null||s===void 0?void 0:s.identifiedFrames.delete(S.dataset.whopCheckoutIdentifier)),A(),(l=window.wco)===null||l===void 0?void 0:l.frames.delete(S))}}catch(e){g=true;k=e}finally{try{if(!b&&C.return!=null){C.return()}}finally{if(g){throw k}}}}}catch(e){r=true;n=e}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(r){throw n}}}});var ec=true,ef=false,eh=undefined;try{for(var ev=document.querySelectorAll("[data-whop-checkout-plan-id]")[Symbol.iterator](),ep;!(ec=(ep=ev.next()).done);ec=true){var ew=ep.value;f(ew,HTMLElement)&&es(ew)}}catch(e){ef=true;eh=e}finally{try{if(!ec&&ev.return!=null){ev.return()}}finally{if(ef){throw eh}}}ed.observe(document.body,{childList:!0,subtree:!0}),window.wco.listening=!0}var ey;
@@ -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){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function o(e,t,r,n,o,a,i){try{var u=e[a](i);var s=u.value}catch(e){r(e);return}if(u.done){t(s)}else{Promise.resolve(s).then(n,o)}}function a(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var i=e.apply(t,r);function u(e){o(i,n,a,u,s,"next",e)}function s(e){o(i,n,a,u,s,"throw",e)}u(undefined)})}}function i(e,t,r){t=d(t);return g(e,j()?Reflect.construct(t,r||[],d(e).constructor):t.apply(e,r))}function u(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function s(e,t,r){if(j()){s=Reflect.construct}else{s=function e(e,t,r){var n=[null];n.push.apply(n,t);var o=Function.bind.apply(e,n);var a=new o;if(r)P(a,r.prototype);return a}}return s.apply(null,arguments)}function l(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function d(e){d=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return d(e)}function c(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)P(e,t)}function f(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function h(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function v(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function p(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 w(){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 y(){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 m(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}n.forEach(function(t){l(e,t,r[t])})}return e}function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(t){n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}r.push.apply(r,n)}return r}function k(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{b(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function g(e,t){if(t&&(S(t)==="object"||typeof t==="function")){return t}return n(e)}function P(e,t){P=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return P(e,t)}function C(e,r){return t(e)||p(e,r)||A(e,r)||w()}function O(e){return t(e)||v(e)||A(e)||w()}function _(e){return r(e)||v(e)||A(e)||y()}function S(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function A(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 E(e){var t=typeof Map==="function"?new Map:undefined;E=function e(e){if(e===null||!h(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return s(e,arguments,d(this).constructor)}r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:false,writable:true,configurable:true}});return P(r,e)};return E(e)}function j(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(j=function(){return!!e})()}function x(e,t){var r,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=u(0),i["throw"]=u(1),i["return"]=u(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function u(e){return function(t){return s([e,t])}}function s(u){if(r)throw new TypeError("Generator is already executing.");while(i&&(i=0,u[0]&&(a=0)),a)try{if(r=1,n&&(o=u[0]&2?n["return"]:u[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;if(n=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:a.label++;return{value:u[1],done:false};case 5:a.label++;n=u[1];u=[0];continue;case 7:u=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){a=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(u[0]===6&&a.label<o[1]){a.label=o[1];o=u;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(u);break}if(o[2])a.ops.pop();a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e];n=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}(function(){var e=function e(e){return S(e.data)=="object"&&e.data!==null&&"event"in e.data&&F.includes(e.data.event)};var t=function t(t,r){return e(t)&&t.data.event===r};var r=function e(e){return N[e]||(N[e]=(e+256).toString(16).slice(1))};var n=function e(){var e=new Uint8Array(16);if((typeof crypto==="undefined"?"undefined":S(crypto))<"u"&&typeof crypto.getRandomValues=="function")crypto.getRandomValues(e);else for(var t=0;t<16;t++)e[t]=Math.random()*256|0;return e[6]=e[6]&15|64,e[8]=e[8]&63|128,r(e[0])+r(e[1])+r(e[2])+r(e[3])+"-"+r(e[4])+r(e[5])+"-"+r(e[6])+r(e[7])+"-"+r(e[8])+r(e[9])+"-"+r(e[10])+r(e[11])+r(e[12])+r(e[13])+r(e[14])+r(e[15])};var o=function e(e,r,o,a){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:2e3;var u;var s=new URL(e.src).origin,l=n();return(u=e.contentWindow)===null||u===void 0?void 0:u.postMessage(k(m({},r),{__scope:"whop-embedded-checkout",event_id:l}),s),new Promise(function(r,n){var u=setTimeout(function(){n(new W),window.removeEventListener("message",s)},i),s=function(i){if(i.source===e.contentWindow&&t(i,o)&&i.data.event===o&&i.data.event_id===l){clearTimeout(u),window.removeEventListener("message",s);try{r(a(i.data))}catch(e){n(e)}}};window.addEventListener("message",s)})};var s=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 l=function e(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return a(function(){return x(this,function(n){return[2,o(e,{event:"set-email",email:t},"set-email-result",function(e){if(!e.ok)throw new M(e.error)},r)]})})()};var d=function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return a(function(){return x(this,function(r){return[2,o(e,{event:"get-email"},"get-email-result",function(e){return e.email},t)]})})()};var h=function e(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return a(function(){return x(this,function(n){return[2,o(e,{event:"set-address",address:t},"set-address-result",function(e){if(!e.ok)throw new H(e.error)},r)]})})()};var v=function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return a(function(){return x(this,function(r){return[2,o(e,{event:"get-address"},"get-address-result",function(e){if(!e.ok)throw new D(e.error);return{address:e.address,isComplete:e.is_complete}},t)]})})()};var p=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 w=function e(e,t,r,n,o,a,i,u,s,l,d,c,f,h,v,p){var w,y,m,b,k,g,P;var O=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(O.searchParams.set("h",window.location.origin),t&&O.searchParams.set("theme",t),r&&O.searchParams.set("session",r),o&&O.searchParams.set("hide_price","true"),a&&O.searchParams.set("skip_redirect","true"),d&&O.searchParams.set("hide_submit_button","true"),c&&O.searchParams.set("hide_tos","true"),f&&O.searchParams.set("email.hidden","1"),h&&O.searchParams.set("email.disabled","1"),v&&O.searchParams.set("address.hidden","1"),p&&O.searchParams.set("a",p),i){var _=true,S=false,A=undefined,E=true,j=false,x=undefined;try{for(var R=Object.entries(i).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),L;!(E=(L=R.next()).done);E=true){var T=C(L.value,2),I=T[0],U=T[1];if(I.startsWith("utm_"))if(Array.isArray(U))try{for(var W=U[Symbol.iterator](),M;!(_=(M=W.next()).done);_=true){var H=M.value;O.searchParams.append(I,H)}}catch(e){S=true;A=e}finally{try{if(!_&&W.return!=null){W.return()}}finally{if(S){throw A}}}else O.searchParams.set(I,U)}}catch(e){j=true;x=e}finally{try{if(!E&&R.return!=null){R.return()}}finally{if(j){throw x}}}}if(u){var D=true,F=false,N=undefined,V=true,B=false,q=undefined;try{for(var z=Object.entries(u)[Symbol.iterator](),G;!(V=(G=z.next()).done);V=true){var $=C(G.value,2),J=$[0],K=$[1];if(K)try{for(var Q=Object.entries(K)[Symbol.iterator](),X;!(D=(X=Q.next()).done);D=true){var Y=C(X.value,2),Z=Y[0],ee=Y[1];O.searchParams.set("style.".concat(J,".").concat(Z),ee.toString())}}catch(e){F=true;N=e}finally{try{if(!D&&Q.return!=null){Q.return()}}finally{if(F){throw N}}}}}catch(e){B=true;q=e}finally{try{if(!V&&z.return!=null){z.return()}}finally{if(B){throw q}}}}var et=true,er=false,en=undefined;if((s===null||s===void 0?void 0:s.email)&&O.searchParams.set("email",s.email),(s===null||s===void 0?void 0:(w=s.address)===null||w===void 0?void 0:w.name)&&O.searchParams.set("name",s.address.name),(s===null||s===void 0?void 0:(y=s.address)===null||y===void 0?void 0:y.line1)&&O.searchParams.set("address.line1",s.address.line1),(s===null||s===void 0?void 0:(m=s.address)===null||m===void 0?void 0:m.line2)&&O.searchParams.set("address.line2",s.address.line2),(s===null||s===void 0?void 0:(b=s.address)===null||b===void 0?void 0:b.city)&&O.searchParams.set("address.city",s.address.city),(s===null||s===void 0?void 0:(k=s.address)===null||k===void 0?void 0:k.country)&&O.searchParams.set("address.country",s.address.country),(s===null||s===void 0?void 0:(g=s.address)===null||g===void 0?void 0:g.state)&&O.searchParams.set("address.state",s.address.state),(s===null||s===void 0?void 0:(P=s.address)===null||P===void 0?void 0:P.postalCode)&&O.searchParams.set("address.postal_code",s.address.postalCode),l)try{for(var eo=Object.entries(l)[Symbol.iterator](),ea;!(et=(ea=eo.next()).done);et=true){var ei=C(ea.value,2),eu=ei[0],es=ei[1];es&&O.searchParams.set("theme.".concat(eu),es)}}catch(e){er=true;en=e}finally{try{if(!et&&eo.return!=null){eo.return()}}finally{if(er){throw en}}}return O.toString()};var y=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 o=window[e];o===null||o===void 0?void 0:o.apply(void 0,_(r))};var b=function e(e,t){var r;e.addEventListener("checkout:submit",function(t){p(e,t.detail)}),(r=window.wco)===null||r===void 0?void 0:r.frames.set(e,s(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":{y(t.dataset.whopCheckoutOnComplete,r.plan_id,r.receipt_id);break}case"state":{y(t.dataset.whopCheckoutOnStateChange,r.state);break}case"address-validation-error":{y(t.dataset.whopCheckoutOnAddressValidationError,{error_message:r.error_message,error_code:r.error_code});break}}}))};var g=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 P=function e(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(q)){var s=u.name.slice(q.length),l=u.value,d=O(s.split("-")),c=d[0],f=d.slice(1);if(c&&f.length>0){var h=f.reduce(function(e,t,r){if(r===0)return t;var n=O(t),o=n[0],a=n.slice(1);return"".concat(e).concat(o.toUpperCase()).concat(a.join(""))},"");var v;(v=t[c])!==null&&v!==void 0?v:t[c]={},t[c][h]=l}}}}catch(e){n=true;o=e}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(n){throw o}}}return t};var A=function e(e){var t={};return e.dataset.whopCheckoutThemeAccentColor&&(t.accentColor=e.dataset.whopCheckoutThemeAccentColor),t};var j=function e(e){var t={};var r,n,o,a,i,u,s;return e.dataset.whopCheckoutPrefillEmail&&(t.email=e.dataset.whopCheckoutPrefillEmail),e.dataset.whopCheckoutPrefillName&&((r=t.address)!==null&&r!==void 0?r:t.address={},t.address.name=e.dataset.whopCheckoutPrefillName),e.dataset.whopCheckoutPrefillAddressLine1&&((n=t.address)!==null&&n!==void 0?n:t.address={},t.address.line1=e.dataset.whopCheckoutPrefillAddressLine1),e.dataset.whopCheckoutPrefillAddressLine2&&((o=t.address)!==null&&o!==void 0?o:t.address={},t.address.line2=e.dataset.whopCheckoutPrefillAddressLine2),e.dataset.whopCheckoutPrefillAddressCity&&((a=t.address)!==null&&a!==void 0?a:t.address={},t.address.city=e.dataset.whopCheckoutPrefillAddressCity),e.dataset.whopCheckoutPrefillAddressCountry&&((i=t.address)!==null&&i!==void 0?i:t.address={},t.address.country=e.dataset.whopCheckoutPrefillAddressCountry),e.dataset.whopCheckoutPrefillAddressState&&((u=t.address)!==null&&u!==void 0?u:t.address={},t.address.state=e.dataset.whopCheckoutPrefillAddressState),e.dataset.whopCheckoutPrefillAddressPostalCode&&((s=t.address)!==null&&s!==void 0?s:t.address={},t.address.postalCode=e.dataset.whopCheckoutPrefillAddressPostalCode),t};var R=function e(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:g(),P(e),j(e),A(e),e.dataset.whopCheckoutHideSubmitButton==="true",e.dataset.whopCheckoutHideTos==="true",e.dataset.whopCheckoutHideEmail==="true",e.dataset.whopCheckoutDisableEmail==="true",e.dataset.whopCheckoutHideAddress==="true",e.dataset.whopCheckoutAffiliateCode),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,_(V)),a.allow=B,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)};var L=Object.defineProperty;var T=function(e,t,r){return t in e?L(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r};var I=function(e,t,r){return T(e,(typeof t==="undefined"?"undefined":S(t))!="symbol"?t+"":t,r)};var U=/*#__PURE__*/function(e){c(t,e);function t(){u(this,t);var e;e=i(this,t,arguments);I(e,"type","WhopCheckoutError");return e}return t}(E(Error));var W=/*#__PURE__*/function(e){c(t,e);function t(e){u(this,t);var r;r=i(this,t,[e!==null&&e!==void 0?e:"Timeout waiting for embed response"]);I(r,"name","WhopCheckoutRpcTimeoutError");return r}return t}(U);var M=/*#__PURE__*/function(e){c(t,e);function t(){u(this,t);var e;e=i(this,t,arguments);I(e,"name","WhopCheckoutSetEmailError");return e}return t}(U);var H=/*#__PURE__*/function(e){c(t,e);function t(){u(this,t);var e;e=i(this,t,arguments);I(e,"name","WhopCheckoutSetAddressError");return e}return t}(U);var D=/*#__PURE__*/function(e){c(t,e);function t(){u(this,t);var e;e=i(this,t,arguments);I(e,"name","WhopCheckoutGetAddressError");return e}return t}(U);var F=["resize","center","complete","state","get-email-result","set-email-result","set-address-result","get-address-result","address-validation-error"];var N=[];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"],B="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";var q="data-whop-checkout-style-";if((typeof window==="undefined"?"undefined":S(window))<"u"&&window.wco&&!window.wco.listening){var z=function e(e){var t;var r=(t=window.wco)===null||t===void 0?void 0:t.identifiedFrames.get(e);if(!r)throw new Error("No embed with identifier ".concat(e," found."));return r};Z=z,window.wco.getEmail=function(e,t){return d(z(e),t)},window.wco.setEmail=function(e,t,r){return l(z(e),t,r)},window.wco.getAddress=function(e,t){return v(z(e),t)},window.wco.setAddress=function(e,t,r){return h(z(e),t,r)};var G=new MutationObserver(function(e){var t=true,r=false,n=undefined;try{for(var o=e[Symbol.iterator](),a;!(t=(a=o.next()).done);t=true){var i=a.value;var u,s,l;var d=true,c=false,h=undefined;try{for(var v=i.addedNodes[Symbol.iterator](),p;!(d=(p=v.next()).done);d=true){var w=p.value;f(w,HTMLElement)&&w.dataset.whopCheckoutPlanId&&R(w)}}catch(e){c=true;h=e}finally{try{if(!d&&v.return!=null){v.return()}}finally{if(c){throw h}}}var y=Array.from(i.removedNodes);var m;var b=true,k=false,g=undefined;try{for(var P=((m=(u=window.wco)===null||u===void 0?void 0:u.frames)!==null&&m!==void 0?m:[])[Symbol.iterator](),O;!(b=(O=P.next()).done);b=true){var _=C(O.value,2),S=_[0],A=_[1];y.includes(S)&&(S.dataset.whopCheckoutIdentifier&&((s=window.wco)===null||s===void 0?void 0:s.identifiedFrames.delete(S.dataset.whopCheckoutIdentifier)),A(),(l=window.wco)===null||l===void 0?void 0:l.frames.delete(S))}}catch(e){k=true;g=e}finally{try{if(!b&&P.return!=null){P.return()}}finally{if(k){throw g}}}}}catch(e){r=true;n=e}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(r){throw n}}}});var $=true,J=false,K=undefined;try{for(var Q=document.querySelectorAll("[data-whop-checkout-plan-id]")[Symbol.iterator](),X;!($=(X=Q.next()).done);$=true){var Y=X.value;f(Y,HTMLElement)&&R(Y)}}catch(e){J=true;K=e}finally{try{if(!$&&Q.return!=null){Q.return()}}finally{if(J){throw K}}}G.observe(document.body,{childList:!0,subtree:!0}),window.wco.listening=!0}var Z})();
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){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function o(e,t,r,n,o,a,i){try{var u=e[a](i);var s=u.value}catch(e){r(e);return}if(u.done){t(s)}else{Promise.resolve(s).then(n,o)}}function a(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var i=e.apply(t,r);function u(e){o(i,n,a,u,s,"next",e)}function s(e){o(i,n,a,u,s,"throw",e)}u(undefined)})}}function i(e,t,r){t=d(t);return k(e,j()?Reflect.construct(t,r||[],d(e).constructor):t.apply(e,r))}function u(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function s(e,t,r){if(j()){s=Reflect.construct}else{s=function e(e,t,r){var n=[null];n.push.apply(n,t);var o=Function.bind.apply(e,n);var a=new o;if(r)C(a,r.prototype);return a}}return s.apply(null,arguments)}function l(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function d(e){d=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return d(e)}function c(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)C(e,t)}function f(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function h(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function v(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function p(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 w(){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 y(){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 m(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}n.forEach(function(t){l(e,t,r[t])})}return e}function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(t){n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}r.push.apply(r,n)}return r}function g(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{b(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function k(e,t){if(t&&(S(t)==="object"||typeof t==="function")){return t}return n(e)}function C(e,t){C=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return C(e,t)}function P(e,r){return t(e)||p(e,r)||A(e,r)||w()}function O(e){return t(e)||v(e)||A(e)||w()}function _(e){return r(e)||v(e)||A(e)||y()}function S(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function A(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 E(e){var t=typeof Map==="function"?new Map:undefined;E=function e(e){if(e===null||!h(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return s(e,arguments,d(this).constructor)}r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:false,writable:true,configurable:true}});return C(r,e)};return E(e)}function j(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(j=function(){return!!e})()}function x(e,t){var r,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=u(0),i["throw"]=u(1),i["return"]=u(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function u(e){return function(t){return s([e,t])}}function s(u){if(r)throw new TypeError("Generator is already executing.");while(i&&(i=0,u[0]&&(a=0)),a)try{if(r=1,n&&(o=u[0]&2?n["return"]:u[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;if(n=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:a.label++;return{value:u[1],done:false};case 5:a.label++;n=u[1];u=[0];continue;case 7:u=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){a=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(u[0]===6&&a.label<o[1]){a.label=o[1];o=u;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(u);break}if(o[2])a.ops.pop();a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e];n=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}(function(){var e=function e(e){return S(e.data)=="object"&&e.data!==null&&"event"in e.data&&F.includes(e.data.event)};var t=function t(t,r){return e(t)&&t.data.event===r};var r=function e(e){return N[e]||(N[e]=(e+256).toString(16).slice(1))};var n=function e(){var e=new Uint8Array(16);if((typeof crypto==="undefined"?"undefined":S(crypto))<"u"&&typeof crypto.getRandomValues=="function")crypto.getRandomValues(e);else for(var t=0;t<16;t++)e[t]=Math.random()*256|0;return e[6]=e[6]&15|64,e[8]=e[8]&63|128,r(e[0])+r(e[1])+r(e[2])+r(e[3])+"-"+r(e[4])+r(e[5])+"-"+r(e[6])+r(e[7])+"-"+r(e[8])+r(e[9])+"-"+r(e[10])+r(e[11])+r(e[12])+r(e[13])+r(e[14])+r(e[15])};var o=function e(e,r,o,a){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:2e3;var u;var s=new URL(e.src).origin,l=n();return(u=e.contentWindow)===null||u===void 0?void 0:u.postMessage(g(m({},r),{__scope:"whop-embedded-checkout",event_id:l}),s),new Promise(function(r,n){var u=setTimeout(function(){n(new W),window.removeEventListener("message",s)},i),s=function(i){if(i.source===e.contentWindow&&t(i,o)&&i.data.event===o&&i.data.event_id===l){clearTimeout(u),window.removeEventListener("message",s);try{r(a(i.data))}catch(e){n(e)}}};window.addEventListener("message",s)})};var s=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 l=function e(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return a(function(){return x(this,function(n){return[2,o(e,{event:"set-email",email:t},"set-email-result",function(e){if(!e.ok)throw new M(e.error)},r)]})})()};var d=function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return a(function(){return x(this,function(r){return[2,o(e,{event:"get-email"},"get-email-result",function(e){return e.email},t)]})})()};var h=function e(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return a(function(){return x(this,function(n){return[2,o(e,{event:"set-address",address:t},"set-address-result",function(e){if(!e.ok)throw new H(e.error)},r)]})})()};var v=function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return a(function(){return x(this,function(r){return[2,o(e,{event:"get-address"},"get-address-result",function(e){if(!e.ok)throw new D(e.error);return{address:e.address,isComplete:e.is_complete}},t)]})})()};var p=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 w=function e(e,t,r,n,o,a,i,u,s,l,d,c,f,h,v,p){var w,y,m,b,g,k,C;var O=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(O.searchParams.set("h",window.location.origin),t&&O.searchParams.set("theme",t),r&&O.searchParams.set("session",r),o&&O.searchParams.set("hide_price","true"),a&&O.searchParams.set("skip_redirect","true"),d&&O.searchParams.set("hide_submit_button","true"),c&&O.searchParams.set("hide_tos","true"),f&&O.searchParams.set("email.hidden","1"),h&&O.searchParams.set("email.disabled","1"),v&&O.searchParams.set("address.hidden","1"),p&&O.searchParams.set("a",p),i){var _=true,S=false,A=undefined,E=true,j=false,x=undefined;try{for(var R=Object.entries(i).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),T;!(E=(T=R.next()).done);E=true){var L=P(T.value,2),I=L[0],U=L[1];if(I.startsWith("utm_"))if(Array.isArray(U))try{for(var W=U[Symbol.iterator](),M;!(_=(M=W.next()).done);_=true){var H=M.value;O.searchParams.append(I,H)}}catch(e){S=true;A=e}finally{try{if(!_&&W.return!=null){W.return()}}finally{if(S){throw A}}}else O.searchParams.set(I,U)}}catch(e){j=true;x=e}finally{try{if(!E&&R.return!=null){R.return()}}finally{if(j){throw x}}}}if(u){var D=true,F=false,N=undefined,V=true,B=false,q=undefined;try{for(var z=Object.entries(u)[Symbol.iterator](),G;!(V=(G=z.next()).done);V=true){var $=P(G.value,2),J=$[0],K=$[1];if(K)try{for(var Q=Object.entries(K)[Symbol.iterator](),X;!(D=(X=Q.next()).done);D=true){var Y=P(X.value,2),Z=Y[0],ee=Y[1];O.searchParams.set("style.".concat(J,".").concat(Z),ee.toString())}}catch(e){F=true;N=e}finally{try{if(!D&&Q.return!=null){Q.return()}}finally{if(F){throw N}}}}}catch(e){B=true;q=e}finally{try{if(!V&&z.return!=null){z.return()}}finally{if(B){throw q}}}}var et=true,er=false,en=undefined;if((s===null||s===void 0?void 0:s.email)&&O.searchParams.set("email",s.email),(s===null||s===void 0?void 0:(w=s.address)===null||w===void 0?void 0:w.name)&&O.searchParams.set("name",s.address.name),(s===null||s===void 0?void 0:(y=s.address)===null||y===void 0?void 0:y.line1)&&O.searchParams.set("address.line1",s.address.line1),(s===null||s===void 0?void 0:(m=s.address)===null||m===void 0?void 0:m.line2)&&O.searchParams.set("address.line2",s.address.line2),(s===null||s===void 0?void 0:(b=s.address)===null||b===void 0?void 0:b.city)&&O.searchParams.set("address.city",s.address.city),(s===null||s===void 0?void 0:(g=s.address)===null||g===void 0?void 0:g.country)&&O.searchParams.set("address.country",s.address.country),(s===null||s===void 0?void 0:(k=s.address)===null||k===void 0?void 0:k.state)&&O.searchParams.set("address.state",s.address.state),(s===null||s===void 0?void 0:(C=s.address)===null||C===void 0?void 0:C.postalCode)&&O.searchParams.set("address.postal_code",s.address.postalCode),l)try{for(var eo=Object.entries(l)[Symbol.iterator](),ea;!(et=(ea=eo.next()).done);et=true){var ei=P(ea.value,2),eu=ei[0],es=ei[1];es&&O.searchParams.set("theme.".concat(eu),typeof es=="boolean"?"1":es)}}catch(e){er=true;en=e}finally{try{if(!et&&eo.return!=null){eo.return()}}finally{if(er){throw en}}}return O.toString()};var y=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 o=window[e];o===null||o===void 0?void 0:o.apply(void 0,_(r))};var b=function e(e,t){var r;e.addEventListener("checkout:submit",function(t){p(e,t.detail)}),(r=window.wco)===null||r===void 0?void 0:r.frames.set(e,s(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":{y(t.dataset.whopCheckoutOnComplete,r.plan_id,r.receipt_id);break}case"state":{y(t.dataset.whopCheckoutOnStateChange,r.state);break}case"address-validation-error":{y(t.dataset.whopCheckoutOnAddressValidationError,{error_message:r.error_message,error_code:r.error_code});break}}}))};var k=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 C=function e(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(q)){var s=u.name.slice(q.length),l=u.value,d=O(s.split("-")),c=d[0],f=d.slice(1);if(c&&f.length>0){var h=f.reduce(function(e,t,r){if(r===0)return t;var n=O(t),o=n[0],a=n.slice(1);return"".concat(e).concat(o.toUpperCase()).concat(a.join(""))},"");var v;(v=t[c])!==null&&v!==void 0?v:t[c]={},t[c][h]=l}}}}catch(e){n=true;o=e}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(n){throw o}}}return t};var A=function e(e){var t={};return e.dataset.whopCheckoutThemeAccentColor&&(t.accentColor=e.dataset.whopCheckoutThemeAccentColor),e.dataset.whopCheckoutThemeHighContrast&&(t.highContrast=e.dataset.whopCheckoutThemeHighContrast==="true"),t};var j=function e(e){var t={};var r,n,o,a,i,u,s;return e.dataset.whopCheckoutPrefillEmail&&(t.email=e.dataset.whopCheckoutPrefillEmail),e.dataset.whopCheckoutPrefillName&&((r=t.address)!==null&&r!==void 0?r:t.address={},t.address.name=e.dataset.whopCheckoutPrefillName),e.dataset.whopCheckoutPrefillAddressLine1&&((n=t.address)!==null&&n!==void 0?n:t.address={},t.address.line1=e.dataset.whopCheckoutPrefillAddressLine1),e.dataset.whopCheckoutPrefillAddressLine2&&((o=t.address)!==null&&o!==void 0?o:t.address={},t.address.line2=e.dataset.whopCheckoutPrefillAddressLine2),e.dataset.whopCheckoutPrefillAddressCity&&((a=t.address)!==null&&a!==void 0?a:t.address={},t.address.city=e.dataset.whopCheckoutPrefillAddressCity),e.dataset.whopCheckoutPrefillAddressCountry&&((i=t.address)!==null&&i!==void 0?i:t.address={},t.address.country=e.dataset.whopCheckoutPrefillAddressCountry),e.dataset.whopCheckoutPrefillAddressState&&((u=t.address)!==null&&u!==void 0?u:t.address={},t.address.state=e.dataset.whopCheckoutPrefillAddressState),e.dataset.whopCheckoutPrefillAddressPostalCode&&((s=t.address)!==null&&s!==void 0?s:t.address={},t.address.postalCode=e.dataset.whopCheckoutPrefillAddressPostalCode),t};var R=function e(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(),C(e),j(e),A(e),e.dataset.whopCheckoutHideSubmitButton==="true",e.dataset.whopCheckoutHideTos==="true",e.dataset.whopCheckoutHideEmail==="true",e.dataset.whopCheckoutDisableEmail==="true",e.dataset.whopCheckoutHideAddress==="true",e.dataset.whopCheckoutAffiliateCode),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,_(V)),a.allow=B,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)};var T=Object.defineProperty;var L=function(e,t,r){return t in e?T(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r};var I=function(e,t,r){return L(e,(typeof t==="undefined"?"undefined":S(t))!="symbol"?t+"":t,r)};var U=/*#__PURE__*/function(e){c(t,e);function t(){u(this,t);var e;e=i(this,t,arguments);I(e,"type","WhopCheckoutError");return e}return t}(E(Error));var W=/*#__PURE__*/function(e){c(t,e);function t(e){u(this,t);var r;r=i(this,t,[e!==null&&e!==void 0?e:"Timeout waiting for embed response"]);I(r,"name","WhopCheckoutRpcTimeoutError");return r}return t}(U);var M=/*#__PURE__*/function(e){c(t,e);function t(){u(this,t);var e;e=i(this,t,arguments);I(e,"name","WhopCheckoutSetEmailError");return e}return t}(U);var H=/*#__PURE__*/function(e){c(t,e);function t(){u(this,t);var e;e=i(this,t,arguments);I(e,"name","WhopCheckoutSetAddressError");return e}return t}(U);var D=/*#__PURE__*/function(e){c(t,e);function t(){u(this,t);var e;e=i(this,t,arguments);I(e,"name","WhopCheckoutGetAddressError");return e}return t}(U);var F=["resize","center","complete","state","get-email-result","set-email-result","set-address-result","get-address-result","address-validation-error"];var N=[];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"],B="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";var q="data-whop-checkout-style-";if((typeof window==="undefined"?"undefined":S(window))<"u"&&window.wco&&!window.wco.listening){var z=function e(e){var t;var r=(t=window.wco)===null||t===void 0?void 0:t.identifiedFrames.get(e);if(!r)throw new Error("No embed with identifier ".concat(e," found."));return r};Z=z,window.wco.getEmail=function(e,t){return d(z(e),t)},window.wco.setEmail=function(e,t,r){return l(z(e),t,r)},window.wco.getAddress=function(e,t){return v(z(e),t)},window.wco.setAddress=function(e,t,r){return h(z(e),t,r)};var G=new MutationObserver(function(e){var t=true,r=false,n=undefined;try{for(var o=e[Symbol.iterator](),a;!(t=(a=o.next()).done);t=true){var i=a.value;var u,s,l;var d=true,c=false,h=undefined;try{for(var v=i.addedNodes[Symbol.iterator](),p;!(d=(p=v.next()).done);d=true){var w=p.value;f(w,HTMLElement)&&w.dataset.whopCheckoutPlanId&&R(w)}}catch(e){c=true;h=e}finally{try{if(!d&&v.return!=null){v.return()}}finally{if(c){throw h}}}var y=Array.from(i.removedNodes);var m;var b=true,g=false,k=undefined;try{for(var C=((m=(u=window.wco)===null||u===void 0?void 0:u.frames)!==null&&m!==void 0?m:[])[Symbol.iterator](),O;!(b=(O=C.next()).done);b=true){var _=P(O.value,2),S=_[0],A=_[1];y.includes(S)&&(S.dataset.whopCheckoutIdentifier&&((s=window.wco)===null||s===void 0?void 0:s.identifiedFrames.delete(S.dataset.whopCheckoutIdentifier)),A(),(l=window.wco)===null||l===void 0?void 0:l.frames.delete(S))}}catch(e){g=true;k=e}finally{try{if(!b&&C.return!=null){C.return()}}finally{if(g){throw k}}}}}catch(e){r=true;n=e}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(r){throw n}}}});var $=true,J=false,K=undefined;try{for(var Q=document.querySelectorAll("[data-whop-checkout-plan-id]")[Symbol.iterator](),X;!($=(X=Q.next()).done);$=true){var Y=X.value;f(Y,HTMLElement)&&R(Y)}}catch(e){J=true;K=e}finally{try{if(!$&&Q.return!=null){Q.return()}}finally{if(J){throw K}}}G.observe(document.body,{childList:!0,subtree:!0}),window.wco.listening=!0}var Z})();
@@ -1 +1 @@
1
- function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function t(e){if(Array.isArray(e))return e}function r(t){if(Array.isArray(t))return e(t)}function a(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 n(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var a=[];var o=true;var n=false;var i,d;try{for(r=r.call(e);!(o=(i=r.next()).done);o=true){a.push(i.value);if(t&&a.length===t)break}}catch(e){n=true;d=e}finally{try{if(!o&&r["return"]!=null)r["return"]()}finally{if(n)throw d}}return a}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 d(){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)||n(e,r)||f(e,r)||i()}function s(e){return t(e)||o(e)||f(e)||i()}function u(e){return r(e)||o(e)||f(e)||d()}function c(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 a=Object.prototype.toString.call(t).slice(8,-1);if(a==="Object"&&t.constructor)a=t.constructor.name;if(a==="Map"||a==="Set")return Array.from(a);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return e(t,r)}import{b as h,c as w,d as v,e as p,f as y,g as m,h as C,i as k,j as b}from"./chunk-D7BU562Q.mjs";function A(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),a=1;a<t;a++){r[a-1]=arguments[a]}if(!e)return;var o=window[e];o===null||o===void 0?void 0:o.apply(void 0,u(r))}function S(e,t){var r;e.addEventListener("checkout:submit",function(t){m(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":{A(t.dataset.whopCheckoutOnComplete,r.plan_id,r.receipt_id);break}case"state":{A(t.dataset.whopCheckoutOnStateChange,r.state);break}case"address-validation-error":{A(t.dataset.whopCheckoutOnAddressValidationError,{error_message:r.error_message,error_code:r.error_code});break}}}))}function g(){var e=new URLSearchParams(window.location.search);return Array.from(e.keys()).reduce(function(t,r){if(!r.startsWith("utm_"))return t;var a=e.getAll(r);switch(a.length){case 0:return t;case 1:{t[r]=a[0];break}default:t[r]=a}return t},{})}var P="data-whop-checkout-style-";function E(e){var t={};var r=true,a=false,o=undefined;try{for(var n=e.attributes[Symbol.iterator](),i;!(r=(i=n.next()).done);r=true){var d=i.value;if(d.name.startsWith(P)){var l=d.name.slice(P.length),u=d.value,c=s(l.split("-")),f=c[0],h=c.slice(1);if(f&&h.length>0){var w=h.reduce(function(e,t,r){if(r===0)return t;var a=s(t),o=a[0],n=a.slice(1);return"".concat(e).concat(o.toUpperCase()).concat(n.join(""))},"");var v;(v=t[f])!==null&&v!==void 0?v:t[f]={},t[f][w]=u}}}}catch(e){a=true;o=e}finally{try{if(!r&&n.return!=null){n.return()}}finally{if(a){throw o}}}return t}function I(e){var t={};return e.dataset.whopCheckoutThemeAccentColor&&(t.accentColor=e.dataset.whopCheckoutThemeAccentColor),t}function x(e){var t={};var r,a,o,n,i,d,l;return e.dataset.whopCheckoutPrefillEmail&&(t.email=e.dataset.whopCheckoutPrefillEmail),e.dataset.whopCheckoutPrefillName&&((r=t.address)!==null&&r!==void 0?r:t.address={},t.address.name=e.dataset.whopCheckoutPrefillName),e.dataset.whopCheckoutPrefillAddressLine1&&((a=t.address)!==null&&a!==void 0?a:t.address={},t.address.line1=e.dataset.whopCheckoutPrefillAddressLine1),e.dataset.whopCheckoutPrefillAddressLine2&&((o=t.address)!==null&&o!==void 0?o:t.address={},t.address.line2=e.dataset.whopCheckoutPrefillAddressLine2),e.dataset.whopCheckoutPrefillAddressCity&&((n=t.address)!==null&&n!==void 0?n:t.address={},t.address.city=e.dataset.whopCheckoutPrefillAddressCity),e.dataset.whopCheckoutPrefillAddressCountry&&((i=t.address)!==null&&i!==void 0?i:t.address={},t.address.country=e.dataset.whopCheckoutPrefillAddressCountry),e.dataset.whopCheckoutPrefillAddressState&&((d=t.address)!==null&&d!==void 0?d:t.address={},t.address.state=e.dataset.whopCheckoutPrefillAddressState),e.dataset.whopCheckoutPrefillAddressPostalCode&&((l=t.address)!==null&&l!==void 0?l:t.address={},t.address.postalCode=e.dataset.whopCheckoutPrefillAddressPostalCode),t}function L(e){var t;var r;if(e.dataset.whopCheckoutMounted)return;var a=e.dataset.whopCheckoutPlanId;if(!a)return;var o=C(a,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:g(),E(e),x(e),I(e),e.dataset.whopCheckoutHideSubmitButton==="true",e.dataset.whopCheckoutHideTos==="true",e.dataset.whopCheckoutHideEmail==="true",e.dataset.whopCheckoutDisableEmail==="true",e.dataset.whopCheckoutHideAddress==="true",e.dataset.whopCheckoutAffiliateCode),n=document.createElement("iframe");n.src=o,n.style.width="100%",n.style.height="480px",n.style.border="none",n.style.overflow="hidden",(t=n.sandbox).add.apply(t,u(k)),n.allow=b,e.dataset.whopCheckoutMounted="true",e.appendChild(n);var i=e.id;i&&((r=window.wco)===null||r===void 0?void 0:r.identifiedFrames.set(i,n),n.dataset.whopCheckoutIdentifier=i),S(n,e)}if((typeof window==="undefined"?"undefined":c(window))<"u"&&window.wco&&!window.wco.listening){var O=function e(e){var t;var r=(t=window.wco)===null||t===void 0?void 0:t.identifiedFrames.get(e);if(!r)throw new Error("No embed with identifier ".concat(e," found."));return r};F=O,window.wco.getEmail=function(e,t){return v(O(e),t)},window.wco.setEmail=function(e,t,r){return w(O(e),t,r)},window.wco.getAddress=function(e,t){return y(O(e),t)},window.wco.setAddress=function(e,t,r){return p(O(e),t,r)};var T=new MutationObserver(function(e){var t=true,r=false,o=undefined;try{for(var n=e[Symbol.iterator](),i;!(t=(i=n.next()).done);t=true){var d=i.value;var s,u,c;var f=true,h=false,w=undefined;try{for(var v=d.addedNodes[Symbol.iterator](),p;!(f=(p=v.next()).done);f=true){var y=p.value;a(y,HTMLElement)&&y.dataset.whopCheckoutPlanId&&L(y)}}catch(e){h=true;w=e}finally{try{if(!f&&v.return!=null){v.return()}}finally{if(h){throw w}}}var m=Array.from(d.removedNodes);var C;var k=true,b=false,A=undefined;try{for(var S=((C=(s=window.wco)===null||s===void 0?void 0:s.frames)!==null&&C!==void 0?C:[])[Symbol.iterator](),g;!(k=(g=S.next()).done);k=true){var P=l(g.value,2),E=P[0],I=P[1];m.includes(E)&&(E.dataset.whopCheckoutIdentifier&&((u=window.wco)===null||u===void 0?void 0:u.identifiedFrames.delete(E.dataset.whopCheckoutIdentifier)),I(),(c=window.wco)===null||c===void 0?void 0:c.frames.delete(E))}}catch(e){b=true;A=e}finally{try{if(!k&&S.return!=null){S.return()}}finally{if(b){throw A}}}}}catch(e){r=true;o=e}finally{try{if(!t&&n.return!=null){n.return()}}finally{if(r){throw o}}}});var j=true,H=false,_=undefined;try{for(var M=document.querySelectorAll("[data-whop-checkout-plan-id]")[Symbol.iterator](),N;!(j=(N=M.next()).done);j=true){var U=N.value;a(U,HTMLElement)&&L(U)}}catch(e){H=true;_=e}finally{try{if(!j&&M.return!=null){M.return()}}finally{if(H){throw _}}}T.observe(document.body,{childList:!0,subtree:!0}),window.wco.listening=!0}var F;
1
+ function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function t(e){if(Array.isArray(e))return e}function r(t){if(Array.isArray(t))return e(t)}function a(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 n(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var a=[];var o=true;var n=false;var i,d;try{for(r=r.call(e);!(o=(i=r.next()).done);o=true){a.push(i.value);if(t&&a.length===t)break}}catch(e){n=true;d=e}finally{try{if(!o&&r["return"]!=null)r["return"]()}finally{if(n)throw d}}return a}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 d(){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 s(e,r){return t(e)||n(e,r)||h(e,r)||i()}function l(e){return t(e)||o(e)||h(e)||i()}function u(e){return r(e)||o(e)||h(e)||d()}function c(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function h(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);if(a==="Object"&&t.constructor)a=t.constructor.name;if(a==="Map"||a==="Set")return Array.from(a);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return e(t,r)}import{b as f,c as w,d as v,e as p,f as y,g as m,h as C,i as k,j as b}from"./chunk-DA7YNHTQ.mjs";function A(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),a=1;a<t;a++){r[a-1]=arguments[a]}if(!e)return;var o=window[e];o===null||o===void 0?void 0:o.apply(void 0,u(r))}function g(e,t){var r;e.addEventListener("checkout:submit",function(t){m(e,t.detail)}),(r=window.wco)===null||r===void 0?void 0:r.frames.set(e,f(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":{A(t.dataset.whopCheckoutOnComplete,r.plan_id,r.receipt_id);break}case"state":{A(t.dataset.whopCheckoutOnStateChange,r.state);break}case"address-validation-error":{A(t.dataset.whopCheckoutOnAddressValidationError,{error_message:r.error_message,error_code:r.error_code});break}}}))}function S(){var e=new URLSearchParams(window.location.search);return Array.from(e.keys()).reduce(function(t,r){if(!r.startsWith("utm_"))return t;var a=e.getAll(r);switch(a.length){case 0:return t;case 1:{t[r]=a[0];break}default:t[r]=a}return t},{})}var P="data-whop-checkout-style-";function E(e){var t={};var r=true,a=false,o=undefined;try{for(var n=e.attributes[Symbol.iterator](),i;!(r=(i=n.next()).done);r=true){var d=i.value;if(d.name.startsWith(P)){var s=d.name.slice(P.length),u=d.value,c=l(s.split("-")),h=c[0],f=c.slice(1);if(h&&f.length>0){var w=f.reduce(function(e,t,r){if(r===0)return t;var a=l(t),o=a[0],n=a.slice(1);return"".concat(e).concat(o.toUpperCase()).concat(n.join(""))},"");var v;(v=t[h])!==null&&v!==void 0?v:t[h]={},t[h][w]=u}}}}catch(e){a=true;o=e}finally{try{if(!r&&n.return!=null){n.return()}}finally{if(a){throw o}}}return t}function I(e){var t={};return e.dataset.whopCheckoutThemeAccentColor&&(t.accentColor=e.dataset.whopCheckoutThemeAccentColor),e.dataset.whopCheckoutThemeHighContrast&&(t.highContrast=e.dataset.whopCheckoutThemeHighContrast==="true"),t}function T(e){var t={};var r,a,o,n,i,d,s;return e.dataset.whopCheckoutPrefillEmail&&(t.email=e.dataset.whopCheckoutPrefillEmail),e.dataset.whopCheckoutPrefillName&&((r=t.address)!==null&&r!==void 0?r:t.address={},t.address.name=e.dataset.whopCheckoutPrefillName),e.dataset.whopCheckoutPrefillAddressLine1&&((a=t.address)!==null&&a!==void 0?a:t.address={},t.address.line1=e.dataset.whopCheckoutPrefillAddressLine1),e.dataset.whopCheckoutPrefillAddressLine2&&((o=t.address)!==null&&o!==void 0?o:t.address={},t.address.line2=e.dataset.whopCheckoutPrefillAddressLine2),e.dataset.whopCheckoutPrefillAddressCity&&((n=t.address)!==null&&n!==void 0?n:t.address={},t.address.city=e.dataset.whopCheckoutPrefillAddressCity),e.dataset.whopCheckoutPrefillAddressCountry&&((i=t.address)!==null&&i!==void 0?i:t.address={},t.address.country=e.dataset.whopCheckoutPrefillAddressCountry),e.dataset.whopCheckoutPrefillAddressState&&((d=t.address)!==null&&d!==void 0?d:t.address={},t.address.state=e.dataset.whopCheckoutPrefillAddressState),e.dataset.whopCheckoutPrefillAddressPostalCode&&((s=t.address)!==null&&s!==void 0?s:t.address={},t.address.postalCode=e.dataset.whopCheckoutPrefillAddressPostalCode),t}function H(e){var t;var r;if(e.dataset.whopCheckoutMounted)return;var a=e.dataset.whopCheckoutPlanId;if(!a)return;var o=C(a,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:S(),E(e),T(e),I(e),e.dataset.whopCheckoutHideSubmitButton==="true",e.dataset.whopCheckoutHideTos==="true",e.dataset.whopCheckoutHideEmail==="true",e.dataset.whopCheckoutDisableEmail==="true",e.dataset.whopCheckoutHideAddress==="true",e.dataset.whopCheckoutAffiliateCode),n=document.createElement("iframe");n.src=o,n.style.width="100%",n.style.height="480px",n.style.border="none",n.style.overflow="hidden",(t=n.sandbox).add.apply(t,u(k)),n.allow=b,e.dataset.whopCheckoutMounted="true",e.appendChild(n);var i=e.id;i&&((r=window.wco)===null||r===void 0?void 0:r.identifiedFrames.set(i,n),n.dataset.whopCheckoutIdentifier=i),g(n,e)}if((typeof window==="undefined"?"undefined":c(window))<"u"&&window.wco&&!window.wco.listening){var x=function e(e){var t;var r=(t=window.wco)===null||t===void 0?void 0:t.identifiedFrames.get(e);if(!r)throw new Error("No embed with identifier ".concat(e," found."));return r};F=x,window.wco.getEmail=function(e,t){return v(x(e),t)},window.wco.setEmail=function(e,t,r){return w(x(e),t,r)},window.wco.getAddress=function(e,t){return y(x(e),t)},window.wco.setAddress=function(e,t,r){return p(x(e),t,r)};var L=new MutationObserver(function(e){var t=true,r=false,o=undefined;try{for(var n=e[Symbol.iterator](),i;!(t=(i=n.next()).done);t=true){var d=i.value;var l,u,c;var h=true,f=false,w=undefined;try{for(var v=d.addedNodes[Symbol.iterator](),p;!(h=(p=v.next()).done);h=true){var y=p.value;a(y,HTMLElement)&&y.dataset.whopCheckoutPlanId&&H(y)}}catch(e){f=true;w=e}finally{try{if(!h&&v.return!=null){v.return()}}finally{if(f){throw w}}}var m=Array.from(d.removedNodes);var C;var k=true,b=false,A=undefined;try{for(var g=((C=(l=window.wco)===null||l===void 0?void 0:l.frames)!==null&&C!==void 0?C:[])[Symbol.iterator](),S;!(k=(S=g.next()).done);k=true){var P=s(S.value,2),E=P[0],I=P[1];m.includes(E)&&(E.dataset.whopCheckoutIdentifier&&((u=window.wco)===null||u===void 0?void 0:u.identifiedFrames.delete(E.dataset.whopCheckoutIdentifier)),I(),(c=window.wco)===null||c===void 0?void 0:c.frames.delete(E))}}catch(e){b=true;A=e}finally{try{if(!k&&g.return!=null){g.return()}}finally{if(b){throw A}}}}}catch(e){r=true;o=e}finally{try{if(!t&&n.return!=null){n.return()}}finally{if(r){throw o}}}});var O=true,j=false,_=undefined;try{for(var M=document.querySelectorAll("[data-whop-checkout-plan-id]")[Symbol.iterator](),N;!(O=(N=M.next()).done);O=true){var U=N.value;a(U,HTMLElement)&&H(U)}}catch(e){j=true;_=e}finally{try{if(!O&&M.return!=null){M.return()}}finally{if(j){throw _}}}L.observe(document.body,{childList:!0,subtree:!0}),window.wco.listening=!0}var F;
@@ -1 +1 @@
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(r){if(Array.isArray(r))return e(r)}function n(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function o(e,r,t,n,o,a,i){try{var u=e[a](i);var c=u.value}catch(e){t(e);return}if(u.done){r(c)}else{Promise.resolve(c).then(n,o)}}function a(e){return function(){var r=this,t=arguments;return new Promise(function(n,a){var i=e.apply(r,t);function u(e){o(i,n,a,u,c,"next",e)}function c(e){o(i,n,a,u,c,"throw",e)}u(undefined)})}}function i(e,r,t){r=s(r);return P(e,A()?Reflect.construct(r,t||[],s(e).constructor):r.apply(e,t))}function u(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function c(e,r,t){if(A()){c=Reflect.construct}else{c=function e(e,r,t){var n=[null];n.push.apply(n,r);var o=Function.bind.apply(e,n);var a=new o;if(t)E(a,t.prototype);return a}}return c.apply(null,arguments)}function l(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function s(e){s=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return s(e)}function f(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:true,configurable:true}});if(r)E(e,r)}function d(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function v(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function p(e,r){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var n=[];var o=true;var a=false;var i,u;try{for(t=t.call(e);!(o=(i=t.next()).done);o=true){n.push(i.value);if(r&&n.length===r)break}}catch(e){a=true;u=e}finally{try{if(!o&&t["return"]!=null)t["return"]()}finally{if(a)throw u}}return n}function m(){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 h(){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 y(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};var n=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}n.forEach(function(r){l(e,r,t[r])})}return e}function b(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(r){n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})}t.push.apply(t,n)}return t}function w(e,r){r=r!=null?r:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(r))}else{b(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function g(e,r){if(e==null)return{};var t=O(e,r);var n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++){n=a[o];if(r.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;t[n]=e[n]}}return t}function O(e,r){if(e==null)return{};var t={};var n=Object.keys(e);var o,a;for(a=0;a<n.length;a++){o=n[a];if(r.indexOf(o)>=0)continue;t[o]=e[o]}return t}function P(e,r){if(r&&(j(r)==="object"||typeof r==="function")){return r}return n(e)}function E(e,r){E=Object.setPrototypeOf||function e(e,r){e.__proto__=r;return e};return E(e,r)}function _(e,t){return r(e)||p(e,t)||C(e,t)||m()}function k(e){return t(e)||v(e)||C(e)||h()}function j(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function C(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 S(e){var r=typeof Map==="function"?new Map:undefined;S=function e(e){if(e===null||!d(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof r!=="undefined"){if(r.has(e))return r.get(e);r.set(e,t)}function t(){return c(e,arguments,s(this).constructor)}t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}});return E(t,e)};return S(e)}function A(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(A=function(){return!!e})()}function x(e,r){var t,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=u(0),i["throw"]=u(1),i["return"]=u(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function u(e){return function(r){return c([e,r])}}function c(u){if(t)throw new TypeError("Generator is already executing.");while(i&&(i=0,u[0]&&(a=0)),a)try{if(t=1,n&&(o=u[0]&2?n["return"]:u[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;if(n=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:a.label++;return{value:u[1],done:false};case 5:a.label++;n=u[1];u=[0];continue;case 7:u=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){a=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(u[0]===6&&a.label<o[1]){a.label=o[1];o=u;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(u);break}if(o[2])a.ops.pop();a.trys.pop();continue}u=r.call(e,a)}catch(e){u=[6,e];n=0}finally{t=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}var R=Object.create;var W=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var T=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty;var L=function(e,r,t){return r in e?W(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t};var V=function(e,r){for(var t in r)W(e,t,{get:r[t],enumerable:!0})},D=function(e,r,t,n){var o=true,a=false,i=undefined;if(r&&(typeof r==="undefined"?"undefined":j(r))=="object"||typeof r=="function")try{var u=function(){var o=l.value;!M.call(e,o)&&o!==t&&W(e,o,{get:function(){return r[o]},enumerable:!(n=I(r,o))||n.enumerable})};for(var c=U(r)[Symbol.iterator](),l;!(o=(l=c.next()).done);o=true)u()}catch(e){a=true;i=e}finally{try{if(!o&&c.return!=null){c.return()}}finally{if(a){throw i}}}return e};var q=function(e,r,t){return t=e!=null?R(T(e)):{},D(r||!e||!e.__esModule?W(t,"default",{value:e,enumerable:!0}):t,e)},N=function(e){return D(W({},"__esModule",{value:!0}),e)};var z=function(e,r,t){return L(e,(typeof r==="undefined"?"undefined":j(r))!="symbol"?r+"":r,t)};var B={};V(B,{WhopCheckoutEmbed:function(){return ek},accentColorValues:function(){return em},isAccentColor:function(){return eh},useCheckoutEmbedControls:function(){return eC}});module.exports=N(B);var F=q(require("react"));var G=/*#__PURE__*/function(e){f(r,e);function r(){u(this,r);var e;e=i(this,r,arguments);z(e,"type","WhopCheckoutError");return e}return r}(S(Error));var $=/*#__PURE__*/function(e){f(r,e);function r(e){u(this,r);var t;t=i(this,r,[e!==null&&e!==void 0?e:"Timeout waiting for embed response"]);z(t,"name","WhopCheckoutRpcTimeoutError");return t}return r}(G);var H=/*#__PURE__*/function(e){f(r,e);function r(){u(this,r);var e;e=i(this,r,arguments);z(e,"name","WhopCheckoutSetEmailError");return e}return r}(G);var J=/*#__PURE__*/function(e){f(r,e);function r(){u(this,r);var e;e=i(this,r,arguments);z(e,"name","WhopCheckoutSetAddressError");return e}return r}(G);var K=/*#__PURE__*/function(e){f(r,e);function r(){u(this,r);var e;e=i(this,r,arguments);z(e,"name","WhopCheckoutGetAddressError");return e}return r}(G);var Q=["resize","center","complete","state","get-email-result","set-email-result","set-address-result","get-address-result","address-validation-error"];function X(e){return j(e.data)=="object"&&e.data!==null&&"event"in e.data&&Q.includes(e.data.event)}function Y(e,r){return X(e)&&e.data.event===r}var Z=[];function ee(e){return Z[e]||(Z[e]=(e+256).toString(16).slice(1))}function er(){var e=new Uint8Array(16);if((typeof crypto==="undefined"?"undefined":j(crypto))<"u"&&typeof crypto.getRandomValues=="function")crypto.getRandomValues(e);else for(var r=0;r<16;r++)e[r]=Math.random()*256|0;return e[6]=e[6]&15|64,e[8]=e[8]&63|128,ee(e[0])+ee(e[1])+ee(e[2])+ee(e[3])+"-"+ee(e[4])+ee(e[5])+"-"+ee(e[6])+ee(e[7])+"-"+ee(e[8])+ee(e[9])+"-"+ee(e[10])+ee(e[11])+ee(e[12])+ee(e[13])+ee(e[14])+ee(e[15])}function et(e,r,t,n){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:2e3;var a;var i=new URL(e.src).origin,u=er();return(a=e.contentWindow)===null||a===void 0?void 0:a.postMessage(w(y({},r),{__scope:"whop-embedded-checkout",event_id:u}),i),new Promise(function(r,a){var i=setTimeout(function(){a(new $),window.removeEventListener("message",c)},o),c=function(o){if(o.source===e.contentWindow&&Y(o,t)&&o.data.event===t&&o.data.event_id===u){clearTimeout(i),window.removeEventListener("message",c);try{r(n(o.data))}catch(e){a(e)}}};window.addEventListener("message",c)})}function en(e,r){function t(t){t.source===e.contentWindow&&X(t)&&r(t.data)}return window.addEventListener("message",t),function(){window.removeEventListener("message",t)}}function eo(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return a(function(){return x(this,function(n){return[2,et(e,{event:"set-email",email:r},"set-email-result",function(e){if(!e.ok)throw new H(e.error)},t)]})})()}function ea(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return a(function(){return x(this,function(t){return[2,et(e,{event:"get-email"},"get-email-result",function(e){return e.email},r)]})})()}function ei(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return a(function(){return x(this,function(n){return[2,et(e,{event:"set-address",address:r},"set-address-result",function(e){if(!e.ok)throw new J(e.error)},t)]})})()}function eu(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return a(function(){return x(this,function(t){return[2,et(e,{event:"get-address"},"get-address-result",function(e){if(!e.ok)throw new K(e.error);return{address:e.address,isComplete:e.is_complete}},r)]})})()}function ec(e,r){var t;var n=new URL(e.src).origin;(t=e.contentWindow)===null||t===void 0?void 0:t.postMessage({__scope:"whop-embedded-checkout",event:"submit"},n)}function el(e,r,t,n,o,a,i,u,c,l,s,f,d,v,p,m){var h,y,b,w,g,O,P;var E=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(E.searchParams.set("h",window.location.origin),r&&E.searchParams.set("theme",r),t&&E.searchParams.set("session",t),o&&E.searchParams.set("hide_price","true"),a&&E.searchParams.set("skip_redirect","true"),s&&E.searchParams.set("hide_submit_button","true"),f&&E.searchParams.set("hide_tos","true"),d&&E.searchParams.set("email.hidden","1"),v&&E.searchParams.set("email.disabled","1"),p&&E.searchParams.set("address.hidden","1"),m&&E.searchParams.set("a",m),i){var k=true,j=false,C=undefined,S=true,A=false,x=undefined;try{for(var R=Object.entries(i).sort(function(e,r){return e[0].localeCompare(r[0])})[Symbol.iterator](),W;!(S=(W=R.next()).done);S=true){var I=_(W.value,2),U=I[0],T=I[1];if(U.startsWith("utm_"))if(Array.isArray(T))try{for(var M=T[Symbol.iterator](),L;!(k=(L=M.next()).done);k=true){var V=L.value;E.searchParams.append(U,V)}}catch(e){j=true;C=e}finally{try{if(!k&&M.return!=null){M.return()}}finally{if(j){throw C}}}else E.searchParams.set(U,T)}}catch(e){A=true;x=e}finally{try{if(!S&&R.return!=null){R.return()}}finally{if(A){throw x}}}}if(u){var D=true,q=false,N=undefined,z=true,B=false,F=undefined;try{for(var G=Object.entries(u)[Symbol.iterator](),$;!(z=($=G.next()).done);z=true){var H=_($.value,2),J=H[0],K=H[1];if(K)try{for(var Q=Object.entries(K)[Symbol.iterator](),X;!(D=(X=Q.next()).done);D=true){var Y=_(X.value,2),Z=Y[0],ee=Y[1];E.searchParams.set("style.".concat(J,".").concat(Z),ee.toString())}}catch(e){q=true;N=e}finally{try{if(!D&&Q.return!=null){Q.return()}}finally{if(q){throw N}}}}}catch(e){B=true;F=e}finally{try{if(!z&&G.return!=null){G.return()}}finally{if(B){throw F}}}}var er=true,et=false,en=undefined;if((c===null||c===void 0?void 0:c.email)&&E.searchParams.set("email",c.email),(c===null||c===void 0?void 0:(h=c.address)===null||h===void 0?void 0:h.name)&&E.searchParams.set("name",c.address.name),(c===null||c===void 0?void 0:(y=c.address)===null||y===void 0?void 0:y.line1)&&E.searchParams.set("address.line1",c.address.line1),(c===null||c===void 0?void 0:(b=c.address)===null||b===void 0?void 0:b.line2)&&E.searchParams.set("address.line2",c.address.line2),(c===null||c===void 0?void 0:(w=c.address)===null||w===void 0?void 0:w.city)&&E.searchParams.set("address.city",c.address.city),(c===null||c===void 0?void 0:(g=c.address)===null||g===void 0?void 0:g.country)&&E.searchParams.set("address.country",c.address.country),(c===null||c===void 0?void 0:(O=c.address)===null||O===void 0?void 0:O.state)&&E.searchParams.set("address.state",c.address.state),(c===null||c===void 0?void 0:(P=c.address)===null||P===void 0?void 0:P.postalCode)&&E.searchParams.set("address.postal_code",c.address.postalCode),l)try{for(var eo=Object.entries(l)[Symbol.iterator](),ea;!(er=(ea=eo.next()).done);er=true){var ei=_(ea.value,2),eu=ei[0],ec=ei[1];ec&&E.searchParams.set("theme.".concat(eu),ec)}}catch(e){et=true;en=e}finally{try{if(!er&&eo.return!=null){eo.return()}}finally{if(et){throw en}}}return E.toString()}var es=["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"],ef="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";var ed=require("react");function ev(){return function(){}}function ep(){return(0,ed.useSyncExternalStore)(ev,function(){return!0},function(){return!1})}var em=["tomato","red","ruby","crimson","pink","plum","purple","violet","iris","cyan","teal","jade","green","grass","brown","blue","orange","indigo","sky","mint","yellow","amber","lime","lemon","magenta","gold","bronze","gray"];function eh(e){return e?em.includes(e):!1}var ey=require("react"),eb=Symbol("none");function ew(e){var r=(0,ey.useRef)(eb);return r.current===eb&&(r.current=e()),r}var eg=require("react");function eO(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++){r[t]=arguments[t]}var n=ew(function(){return el.apply(void 0,k(r))}),o=n.current;return eP.apply(void 0,[o].concat(k(r))),o}function eP(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++){t[n-1]=arguments[n]}var o=_(t,16),a=o[0],i=o[1],u=o[2],c=o[3],l=o[4],s=o[5],f=o[6],d=o[7],v=o[8],p=o[9],m=o[10],h=o[11],y=o[12],b=o[13],w=o[14],g=o[15];var O=(0,eg.useMemo)(function(){return el(a,i,u,void 0,l,s,f,d,v,p,m,h,y,b,w,g)},[a,i,u,l,s,f,d,v,p,m,h,y,b,w,g]);(0,eg.useEffect)(function(){e!==O&&process.env.NODE_ENV==="development"&&console.warn("[WhopCheckoutEmbed] iframeUrl changed from ".concat(e," to ").concat(O,". Updating props on the checkout embed is not supported. Please rerender the component."))},[e,O])}var eE=es.join(" ");var e_=(0,F.forwardRef)(function(e,r){var t=e.planId,n=e.theme,o=e.sessionId,a=e.hidePrice,i=a===void 0?!1:a,u=e.skipRedirect,c=u===void 0?!1:u,l=e.onComplete,s=e.onStateChange,f=e.onAddressValidationError,d=e.utm,v=e.styles,p=e.prefill,m=e.themeOptions,h=e.hideSubmitButton,y=h===void 0?!1:h,b=e.hideTermsAndConditions,w=b===void 0?!1:b,g=e.hideEmail,O=g===void 0?!1:g,P=e.disableEmail,E=P===void 0?!1:P,k=e.hideAddressForm,j=k===void 0?!1:k,C=e.affiliateCode;var S=(0,F.useMemo)(function(){return{accentColor:eh(m===null||m===void 0?void 0:m.accentColor)?m.accentColor:void 0}},[m===null||m===void 0?void 0:m.accentColor]),A=eO(t,n,o,void 0,i,c||!!l,d,v,p,S,y,w,O,E,j,C),x=(0,F.useRef)(null),R=_((0,F.useState)(480),2),W=R[0],I=R[1];if((0,F.useEffect)(function(){var e=x.current;if(e)return en(e,function(r){switch(r.event){case"resize":{I(r.height);break}case"center":{e.scrollIntoView({block:"center",inline:"center"});break}case"complete":{l&&l(r.plan_id,r.receipt_id);break}case"state":{s&&s(r.state);break}case"address-validation-error":{f&&f({error_message:r.error_message,error_code:r.error_code});break}}})},[l,s,f]),r){var U={submit:function(e){x.current&&ec(x.current,e)},getEmail:function(e){if(!x.current)throw new Error("Whop embedded checkout frame not found");return ea(x.current,e)},setEmail:function(e,r){if(!x.current)throw new Error("Whop embedded checkout frame not found");return eo(x.current,e,r)},setAddress:function(e,r){if(!x.current)throw new Error("Whop embedded checkout frame not found");return ei(x.current,e,r)},getAddress:function(e){if(!x.current)throw new Error("Whop embedded checkout frame not found");return eu(x.current,e)}};typeof r=="function"?r(U):r.current=U}return F.default.createElement("iframe",{ref:x,allow:ef,sandbox:eE,title:"Whop Embedded Checkout",src:A!==null&&A!==void 0?A:void 0,style:{border:"none",height:"".concat(W,"px"),width:"100%",overflow:"hidden"}})});e_.displayName="WhopCheckoutEmbedInner";var ek=(0,F.forwardRef)(function(e,r){var t=e.fallback,n=g(e,["fallback"]);return ep()?F.default.createElement(e_,w(y({},n),{ref:r})):t!==null&&t!==void 0?t:null});ek.displayName="WhopCheckoutEmbed";var ej=require("react");function eC(){return(0,ej.useRef)(null)}0&&(module.exports={WhopCheckoutEmbed:WhopCheckoutEmbed,accentColorValues:accentColorValues,isAccentColor:isAccentColor,useCheckoutEmbedControls:useCheckoutEmbedControls});
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(r){if(Array.isArray(r))return e(r)}function n(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function o(e,r,t,n,o,i,a){try{var u=e[i](a);var c=u.value}catch(e){t(e);return}if(u.done){r(c)}else{Promise.resolve(c).then(n,o)}}function i(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var a=e.apply(r,t);function u(e){o(a,n,i,u,c,"next",e)}function c(e){o(a,n,i,u,c,"throw",e)}u(undefined)})}}function a(e,r,t){r=s(r);return P(e,A()?Reflect.construct(r,t||[],s(e).constructor):r.apply(e,t))}function u(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function c(e,r,t){if(A()){c=Reflect.construct}else{c=function e(e,r,t){var n=[null];n.push.apply(n,r);var o=Function.bind.apply(e,n);var i=new o;if(t)E(i,t.prototype);return i}}return c.apply(null,arguments)}function l(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function s(e){s=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return s(e)}function f(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:true,configurable:true}});if(r)E(e,r)}function d(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function v(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function p(e,r){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var n=[];var o=true;var i=false;var a,u;try{for(t=t.call(e);!(o=(a=t.next()).done);o=true){n.push(a.value);if(r&&n.length===r)break}}catch(e){i=true;u=e}finally{try{if(!o&&t["return"]!=null)t["return"]()}finally{if(i)throw u}}return n}function h(){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 m(){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 y(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};var n=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}n.forEach(function(r){l(e,r,t[r])})}return e}function b(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(r){n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})}t.push.apply(t,n)}return t}function w(e,r){r=r!=null?r:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(r))}else{b(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function g(e,r){if(e==null)return{};var t=O(e,r);var n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++){n=i[o];if(r.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;t[n]=e[n]}}return t}function O(e,r){if(e==null)return{};var t={};var n=Object.keys(e);var o,i;for(i=0;i<n.length;i++){o=n[i];if(r.indexOf(o)>=0)continue;t[o]=e[o]}return t}function P(e,r){if(r&&(j(r)==="object"||typeof r==="function")){return r}return n(e)}function E(e,r){E=Object.setPrototypeOf||function e(e,r){e.__proto__=r;return e};return E(e,r)}function _(e,t){return r(e)||p(e,t)||C(e,t)||h()}function k(e){return t(e)||v(e)||C(e)||m()}function j(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function C(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 S(e){var r=typeof Map==="function"?new Map:undefined;S=function e(e){if(e===null||!d(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof r!=="undefined"){if(r.has(e))return r.get(e);r.set(e,t)}function t(){return c(e,arguments,s(this).constructor)}t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}});return E(t,e)};return S(e)}function A(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(A=function(){return!!e})()}function x(e,r){var t,n,o,i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=u(0),a["throw"]=u(1),a["return"]=u(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(e){return function(r){return c([e,r])}}function c(u){if(t)throw new TypeError("Generator is already executing.");while(a&&(a=0,u[0]&&(i=0)),i)try{if(t=1,n&&(o=u[0]&2?n["return"]:u[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;if(n=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:i.label++;return{value:u[1],done:false};case 5:i.label++;n=u[1];u=[0];continue;case 7:u=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){i=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(u[0]===6&&i.label<o[1]){i.label=o[1];o=u;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(u);break}if(o[2])i.ops.pop();i.trys.pop();continue}u=r.call(e,i)}catch(e){u=[6,e];n=0}finally{t=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}var R=Object.create;var W=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var T=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty;var L=function(e,r,t){return r in e?W(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t};var V=function(e,r){for(var t in r)W(e,t,{get:r[t],enumerable:!0})},D=function(e,r,t,n){var o=true,i=false,a=undefined;if(r&&(typeof r==="undefined"?"undefined":j(r))=="object"||typeof r=="function")try{var u=function(){var o=l.value;!M.call(e,o)&&o!==t&&W(e,o,{get:function(){return r[o]},enumerable:!(n=I(r,o))||n.enumerable})};for(var c=U(r)[Symbol.iterator](),l;!(o=(l=c.next()).done);o=true)u()}catch(e){i=true;a=e}finally{try{if(!o&&c.return!=null){c.return()}}finally{if(i){throw a}}}return e};var q=function(e,r,t){return t=e!=null?R(T(e)):{},D(r||!e||!e.__esModule?W(t,"default",{value:e,enumerable:!0}):t,e)},N=function(e){return D(W({},"__esModule",{value:!0}),e)};var z=function(e,r,t){return L(e,(typeof r==="undefined"?"undefined":j(r))!="symbol"?r+"":r,t)};var B={};V(B,{WhopCheckoutEmbed:function(){return ek},accentColorValues:function(){return eh},isAccentColor:function(){return em},useCheckoutEmbedControls:function(){return eC}});module.exports=N(B);var F=q(require("react"));var G=/*#__PURE__*/function(e){f(r,e);function r(){u(this,r);var e;e=a(this,r,arguments);z(e,"type","WhopCheckoutError");return e}return r}(S(Error));var $=/*#__PURE__*/function(e){f(r,e);function r(e){u(this,r);var t;t=a(this,r,[e!==null&&e!==void 0?e:"Timeout waiting for embed response"]);z(t,"name","WhopCheckoutRpcTimeoutError");return t}return r}(G);var H=/*#__PURE__*/function(e){f(r,e);function r(){u(this,r);var e;e=a(this,r,arguments);z(e,"name","WhopCheckoutSetEmailError");return e}return r}(G);var J=/*#__PURE__*/function(e){f(r,e);function r(){u(this,r);var e;e=a(this,r,arguments);z(e,"name","WhopCheckoutSetAddressError");return e}return r}(G);var K=/*#__PURE__*/function(e){f(r,e);function r(){u(this,r);var e;e=a(this,r,arguments);z(e,"name","WhopCheckoutGetAddressError");return e}return r}(G);var Q=["resize","center","complete","state","get-email-result","set-email-result","set-address-result","get-address-result","address-validation-error"];function X(e){return j(e.data)=="object"&&e.data!==null&&"event"in e.data&&Q.includes(e.data.event)}function Y(e,r){return X(e)&&e.data.event===r}var Z=[];function ee(e){return Z[e]||(Z[e]=(e+256).toString(16).slice(1))}function er(){var e=new Uint8Array(16);if((typeof crypto==="undefined"?"undefined":j(crypto))<"u"&&typeof crypto.getRandomValues=="function")crypto.getRandomValues(e);else for(var r=0;r<16;r++)e[r]=Math.random()*256|0;return e[6]=e[6]&15|64,e[8]=e[8]&63|128,ee(e[0])+ee(e[1])+ee(e[2])+ee(e[3])+"-"+ee(e[4])+ee(e[5])+"-"+ee(e[6])+ee(e[7])+"-"+ee(e[8])+ee(e[9])+"-"+ee(e[10])+ee(e[11])+ee(e[12])+ee(e[13])+ee(e[14])+ee(e[15])}function et(e,r,t,n){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:2e3;var i;var a=new URL(e.src).origin,u=er();return(i=e.contentWindow)===null||i===void 0?void 0:i.postMessage(w(y({},r),{__scope:"whop-embedded-checkout",event_id:u}),a),new Promise(function(r,i){var a=setTimeout(function(){i(new $),window.removeEventListener("message",c)},o),c=function(o){if(o.source===e.contentWindow&&Y(o,t)&&o.data.event===t&&o.data.event_id===u){clearTimeout(a),window.removeEventListener("message",c);try{r(n(o.data))}catch(e){i(e)}}};window.addEventListener("message",c)})}function en(e,r){function t(t){t.source===e.contentWindow&&X(t)&&r(t.data)}return window.addEventListener("message",t),function(){window.removeEventListener("message",t)}}function eo(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return i(function(){return x(this,function(n){return[2,et(e,{event:"set-email",email:r},"set-email-result",function(e){if(!e.ok)throw new H(e.error)},t)]})})()}function ei(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return i(function(){return x(this,function(t){return[2,et(e,{event:"get-email"},"get-email-result",function(e){return e.email},r)]})})()}function ea(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return i(function(){return x(this,function(n){return[2,et(e,{event:"set-address",address:r},"set-address-result",function(e){if(!e.ok)throw new J(e.error)},t)]})})()}function eu(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return i(function(){return x(this,function(t){return[2,et(e,{event:"get-address"},"get-address-result",function(e){if(!e.ok)throw new K(e.error);return{address:e.address,isComplete:e.is_complete}},r)]})})()}function ec(e,r){var t;var n=new URL(e.src).origin;(t=e.contentWindow)===null||t===void 0?void 0:t.postMessage({__scope:"whop-embedded-checkout",event:"submit"},n)}function el(e,r,t,n,o,i,a,u,c,l,s,f,d,v,p,h){var m,y,b,w,g,O,P;var E=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(E.searchParams.set("h",window.location.origin),r&&E.searchParams.set("theme",r),t&&E.searchParams.set("session",t),o&&E.searchParams.set("hide_price","true"),i&&E.searchParams.set("skip_redirect","true"),s&&E.searchParams.set("hide_submit_button","true"),f&&E.searchParams.set("hide_tos","true"),d&&E.searchParams.set("email.hidden","1"),v&&E.searchParams.set("email.disabled","1"),p&&E.searchParams.set("address.hidden","1"),h&&E.searchParams.set("a",h),a){var k=true,j=false,C=undefined,S=true,A=false,x=undefined;try{for(var R=Object.entries(a).sort(function(e,r){return e[0].localeCompare(r[0])})[Symbol.iterator](),W;!(S=(W=R.next()).done);S=true){var I=_(W.value,2),U=I[0],T=I[1];if(U.startsWith("utm_"))if(Array.isArray(T))try{for(var M=T[Symbol.iterator](),L;!(k=(L=M.next()).done);k=true){var V=L.value;E.searchParams.append(U,V)}}catch(e){j=true;C=e}finally{try{if(!k&&M.return!=null){M.return()}}finally{if(j){throw C}}}else E.searchParams.set(U,T)}}catch(e){A=true;x=e}finally{try{if(!S&&R.return!=null){R.return()}}finally{if(A){throw x}}}}if(u){var D=true,q=false,N=undefined,z=true,B=false,F=undefined;try{for(var G=Object.entries(u)[Symbol.iterator](),$;!(z=($=G.next()).done);z=true){var H=_($.value,2),J=H[0],K=H[1];if(K)try{for(var Q=Object.entries(K)[Symbol.iterator](),X;!(D=(X=Q.next()).done);D=true){var Y=_(X.value,2),Z=Y[0],ee=Y[1];E.searchParams.set("style.".concat(J,".").concat(Z),ee.toString())}}catch(e){q=true;N=e}finally{try{if(!D&&Q.return!=null){Q.return()}}finally{if(q){throw N}}}}}catch(e){B=true;F=e}finally{try{if(!z&&G.return!=null){G.return()}}finally{if(B){throw F}}}}var er=true,et=false,en=undefined;if((c===null||c===void 0?void 0:c.email)&&E.searchParams.set("email",c.email),(c===null||c===void 0?void 0:(m=c.address)===null||m===void 0?void 0:m.name)&&E.searchParams.set("name",c.address.name),(c===null||c===void 0?void 0:(y=c.address)===null||y===void 0?void 0:y.line1)&&E.searchParams.set("address.line1",c.address.line1),(c===null||c===void 0?void 0:(b=c.address)===null||b===void 0?void 0:b.line2)&&E.searchParams.set("address.line2",c.address.line2),(c===null||c===void 0?void 0:(w=c.address)===null||w===void 0?void 0:w.city)&&E.searchParams.set("address.city",c.address.city),(c===null||c===void 0?void 0:(g=c.address)===null||g===void 0?void 0:g.country)&&E.searchParams.set("address.country",c.address.country),(c===null||c===void 0?void 0:(O=c.address)===null||O===void 0?void 0:O.state)&&E.searchParams.set("address.state",c.address.state),(c===null||c===void 0?void 0:(P=c.address)===null||P===void 0?void 0:P.postalCode)&&E.searchParams.set("address.postal_code",c.address.postalCode),l)try{for(var eo=Object.entries(l)[Symbol.iterator](),ei;!(er=(ei=eo.next()).done);er=true){var ea=_(ei.value,2),eu=ea[0],ec=ea[1];ec&&E.searchParams.set("theme.".concat(eu),typeof ec=="boolean"?"1":ec)}}catch(e){et=true;en=e}finally{try{if(!er&&eo.return!=null){eo.return()}}finally{if(et){throw en}}}return E.toString()}var es=["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"],ef="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";var ed=require("react");function ev(){return function(){}}function ep(){return(0,ed.useSyncExternalStore)(ev,function(){return!0},function(){return!1})}var eh=["tomato","red","ruby","crimson","pink","plum","purple","violet","iris","cyan","teal","jade","green","grass","brown","blue","orange","indigo","sky","mint","yellow","amber","lime","lemon","magenta","gold","bronze","gray"];function em(e){return e?eh.includes(e):!1}var ey=require("react"),eb=Symbol("none");function ew(e){var r=(0,ey.useRef)(eb);return r.current===eb&&(r.current=e()),r}var eg=require("react");function eO(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++){r[t]=arguments[t]}var n=ew(function(){return el.apply(void 0,k(r))}),o=n.current;return eP.apply(void 0,[o].concat(k(r))),o}function eP(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++){t[n-1]=arguments[n]}var o=_(t,16),i=o[0],a=o[1],u=o[2],c=o[3],l=o[4],s=o[5],f=o[6],d=o[7],v=o[8],p=o[9],h=o[10],m=o[11],y=o[12],b=o[13],w=o[14],g=o[15];var O=(0,eg.useMemo)(function(){return el(i,a,u,void 0,l,s,f,d,v,p,h,m,y,b,w,g)},[i,a,u,l,s,f,d,v,p,h,m,y,b,w,g]);(0,eg.useEffect)(function(){e!==O&&process.env.NODE_ENV==="development"&&console.warn("[WhopCheckoutEmbed] iframeUrl changed from ".concat(e," to ").concat(O,". Updating props on the checkout embed is not supported. Please rerender the component."))},[e,O])}var eE=es.join(" ");var e_=(0,F.forwardRef)(function(e,r){var t=e.planId,n=e.theme,o=e.sessionId,i=e.hidePrice,a=i===void 0?!1:i,u=e.skipRedirect,c=u===void 0?!1:u,l=e.onComplete,s=e.onStateChange,f=e.onAddressValidationError,d=e.utm,v=e.styles,p=e.prefill,h=e.themeOptions,m=e.hideSubmitButton,y=m===void 0?!1:m,b=e.hideTermsAndConditions,w=b===void 0?!1:b,g=e.hideEmail,O=g===void 0?!1:g,P=e.disableEmail,E=P===void 0?!1:P,k=e.hideAddressForm,j=k===void 0?!1:k,C=e.affiliateCode;var S=(0,F.useMemo)(function(){var e;return{accentColor:em(h===null||h===void 0?void 0:h.accentColor)?h.accentColor:void 0,highContrast:(e=h===null||h===void 0?void 0:h.highContrast)!==null&&e!==void 0?e:!1}},[h===null||h===void 0?void 0:h.accentColor,h===null||h===void 0?void 0:h.highContrast]),A=eO(t,n,o,void 0,a,c||!!l,d,v,p,S,y,w,O,E,j,C),x=(0,F.useRef)(null),R=_((0,F.useState)(480),2),W=R[0],I=R[1];if((0,F.useEffect)(function(){var e=x.current;if(e)return en(e,function(r){switch(r.event){case"resize":{I(r.height);break}case"center":{e.scrollIntoView({block:"center",inline:"center"});break}case"complete":{l&&l(r.plan_id,r.receipt_id);break}case"state":{s&&s(r.state);break}case"address-validation-error":{f&&f({error_message:r.error_message,error_code:r.error_code});break}}})},[l,s,f]),r){var U={submit:function(e){x.current&&ec(x.current,e)},getEmail:function(e){if(!x.current)throw new Error("Whop embedded checkout frame not found");return ei(x.current,e)},setEmail:function(e,r){if(!x.current)throw new Error("Whop embedded checkout frame not found");return eo(x.current,e,r)},setAddress:function(e,r){if(!x.current)throw new Error("Whop embedded checkout frame not found");return ea(x.current,e,r)},getAddress:function(e){if(!x.current)throw new Error("Whop embedded checkout frame not found");return eu(x.current,e)}};typeof r=="function"?r(U):r.current=U}return F.default.createElement("iframe",{ref:x,allow:ef,sandbox:eE,title:"Whop Embedded Checkout",src:A!==null&&A!==void 0?A:void 0,style:{border:"none",height:"".concat(W,"px"),width:"100%",overflow:"hidden"}})});e_.displayName="WhopCheckoutEmbedInner";var ek=(0,F.forwardRef)(function(e,r){var t=e.fallback,n=g(e,["fallback"]);return ep()?F.default.createElement(e_,w(y({},n),{ref:r})):t!==null&&t!==void 0?t:null});ek.displayName="WhopCheckoutEmbed";var ej=require("react");function eC(){return(0,ej.useRef)(null)}0&&(module.exports={WhopCheckoutEmbed:WhopCheckoutEmbed,accentColorValues:accentColorValues,isAccentColor:isAccentColor,useCheckoutEmbedControls:useCheckoutEmbedControls});
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { MutableRefObject, ReactNode } from 'react';
3
- import { W as WhopCheckoutSubmitDetails, a as WhopCheckoutAddress, b as WhopCheckoutState, c as WhopEmbeddedCheckoutStyleOptions, d as WhopEmbeddedCheckoutPrefillOptions } from '../util-B5tOGbpF.mjs';
3
+ import { W as WhopCheckoutSubmitDetails, a as WhopCheckoutAddress, b as WhopCheckoutState, c as WhopEmbeddedCheckoutStyleOptions, d as WhopEmbeddedCheckoutPrefillOptions } from '../util-CWsI1rJe.mjs';
4
4
 
5
5
  declare const accentColorValues: readonly ["tomato", "red", "ruby", "crimson", "pink", "plum", "purple", "violet", "iris", "cyan", "teal", "jade", "green", "grass", "brown", "blue", "orange", "indigo", "sky", "mint", "yellow", "amber", "lime", "lemon", "magenta", "gold", "bronze", "gray"];
6
6
  type AccentColor = (typeof accentColorValues)[number];
@@ -24,6 +24,12 @@ interface WhopCheckoutEmbedThemeOptions {
24
24
  * defaults to `blue`
25
25
  */
26
26
  accentColor?: AccentColor;
27
+ /**
28
+ * **Optional** - Set to true to enable high contrast mode. Only recommended when accent color is set to `gray`
29
+ *
30
+ * @default false
31
+ */
32
+ highContrast?: boolean;
27
33
  }
28
34
 
29
35
  interface WhopCheckoutEmbedProps {
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { MutableRefObject, ReactNode } from 'react';
3
- import { W as WhopCheckoutSubmitDetails, a as WhopCheckoutAddress, b as WhopCheckoutState, c as WhopEmbeddedCheckoutStyleOptions, d as WhopEmbeddedCheckoutPrefillOptions } from '../util-B5tOGbpF.js';
3
+ import { W as WhopCheckoutSubmitDetails, a as WhopCheckoutAddress, b as WhopCheckoutState, c as WhopEmbeddedCheckoutStyleOptions, d as WhopEmbeddedCheckoutPrefillOptions } from '../util-CWsI1rJe.js';
4
4
 
5
5
  declare const accentColorValues: readonly ["tomato", "red", "ruby", "crimson", "pink", "plum", "purple", "violet", "iris", "cyan", "teal", "jade", "green", "grass", "brown", "blue", "orange", "indigo", "sky", "mint", "yellow", "amber", "lime", "lemon", "magenta", "gold", "bronze", "gray"];
6
6
  type AccentColor = (typeof accentColorValues)[number];
@@ -24,6 +24,12 @@ interface WhopCheckoutEmbedThemeOptions {
24
24
  * defaults to `blue`
25
25
  */
26
26
  accentColor?: AccentColor;
27
+ /**
28
+ * **Optional** - Set to true to enable high contrast mode. Only recommended when accent color is set to `gray`
29
+ *
30
+ * @default false
31
+ */
32
+ highContrast?: boolean;
27
33
  }
28
34
 
29
35
  interface WhopCheckoutEmbedProps {
@@ -1 +1 @@
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(r){if(Array.isArray(r))return e(r)}function n(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function o(e,r,t,n,o,a,i){try{var u=e[a](i);var c=u.value}catch(e){t(e);return}if(u.done){r(c)}else{Promise.resolve(c).then(n,o)}}function a(e){return function(){var r=this,t=arguments;return new Promise(function(n,a){var i=e.apply(r,t);function u(e){o(i,n,a,u,c,"next",e)}function c(e){o(i,n,a,u,c,"throw",e)}u(undefined)})}}function i(e,r,t){r=s(r);return P(e,C()?Reflect.construct(r,t||[],s(e).constructor):r.apply(e,t))}function u(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function c(e,r,t){if(C()){c=Reflect.construct}else{c=function e(e,r,t){var n=[null];n.push.apply(n,r);var o=Function.bind.apply(e,n);var a=new o;if(t)_(a,t.prototype);return a}}return c.apply(null,arguments)}function l(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function s(e){s=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return s(e)}function f(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:true,configurable:true}});if(r)_(e,r)}function d(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function v(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function p(e,r){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var n=[];var o=true;var a=false;var i,u;try{for(t=t.call(e);!(o=(i=t.next()).done);o=true){n.push(i.value);if(r&&n.length===r)break}}catch(e){a=true;u=e}finally{try{if(!o&&t["return"]!=null)t["return"]()}finally{if(a)throw u}}return n}function y(){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 h(){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 m(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};var n=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}n.forEach(function(r){l(e,r,t[r])})}return e}function b(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(r){n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})}t.push.apply(t,n)}return t}function w(e,r){r=r!=null?r:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(r))}else{b(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function g(e,r){if(e==null)return{};var t=O(e,r);var n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++){n=a[o];if(r.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;t[n]=e[n]}}return t}function O(e,r){if(e==null)return{};var t={};var n=Object.keys(e);var o,a;for(a=0;a<n.length;a++){o=n[a];if(r.indexOf(o)>=0)continue;t[o]=e[o]}return t}function P(e,r){if(r&&(k(r)==="object"||typeof r==="function")){return r}return n(e)}function _(e,r){_=Object.setPrototypeOf||function e(e,r){e.__proto__=r;return e};return _(e,r)}function E(e,t){return r(e)||p(e,t)||S(e,t)||y()}function j(e){return t(e)||v(e)||S(e)||h()}function k(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function S(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 x(e){var r=typeof Map==="function"?new Map:undefined;x=function e(e){if(e===null||!d(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof r!=="undefined"){if(r.has(e))return r.get(e);r.set(e,t)}function t(){return c(e,arguments,s(this).constructor)}t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}});return _(t,e)};return x(e)}function C(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(C=function(){return!!e})()}function R(e,r){var t,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=u(0),i["throw"]=u(1),i["return"]=u(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function u(e){return function(r){return c([e,r])}}function c(u){if(t)throw new TypeError("Generator is already executing.");while(i&&(i=0,u[0]&&(a=0)),a)try{if(t=1,n&&(o=u[0]&2?n["return"]:u[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;if(n=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:a.label++;return{value:u[1],done:false};case 5:a.label++;n=u[1];u=[0];continue;case 7:u=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){a=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(u[0]===6&&a.label<o[1]){a.label=o[1];o=u;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(u);break}if(o[2])a.ops.pop();a.trys.pop();continue}u=r.call(e,a)}catch(e){u=[6,e];n=0}finally{t=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}(function(){var e=function e(e){return k(e.data)=="object"&&e.data!==null&&"event"in e.data&&J.includes(e.data.event)};var r=function r(r,t){return e(r)&&r.data.event===t};var t=function e(e){return K[e]||(K[e]=(e+256).toString(16).slice(1))};var n=function e(){var e=new Uint8Array(16);if((typeof crypto==="undefined"?"undefined":k(crypto))<"u"&&typeof crypto.getRandomValues=="function")crypto.getRandomValues(e);else for(var r=0;r<16;r++)e[r]=Math.random()*256|0;return e[6]=e[6]&15|64,e[8]=e[8]&63|128,t(e[0])+t(e[1])+t(e[2])+t(e[3])+"-"+t(e[4])+t(e[5])+"-"+t(e[6])+t(e[7])+"-"+t(e[8])+t(e[9])+"-"+t(e[10])+t(e[11])+t(e[12])+t(e[13])+t(e[14])+t(e[15])};var o=function e(e,t,o,a){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:2e3;var u;var c=new URL(e.src).origin,l=n();return(u=e.contentWindow)===null||u===void 0?void 0:u.postMessage(w(m({},t),{__scope:"whop-embedded-checkout",event_id:l}),c),new Promise(function(t,n){var u=setTimeout(function(){n(new F),window.removeEventListener("message",c)},i),c=function(i){if(i.source===e.contentWindow&&r(i,o)&&i.data.event===o&&i.data.event_id===l){clearTimeout(u),window.removeEventListener("message",c);try{t(a(i.data))}catch(e){n(e)}}};window.addEventListener("message",c)})};var c=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 l=function e(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return a(function(){return R(this,function(n){return[2,o(e,{event:"set-email",email:r},"set-email-result",function(e){if(!e.ok)throw new G(e.error)},t)]})})()};var s=function e(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return a(function(){return R(this,function(t){return[2,o(e,{event:"get-email"},"get-email-result",function(e){return e.email},r)]})})()};var d=function e(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return a(function(){return R(this,function(n){return[2,o(e,{event:"set-address",address:r},"set-address-result",function(e){if(!e.ok)throw new $(e.error)},t)]})})()};var v=function e(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return a(function(){return R(this,function(t){return[2,o(e,{event:"get-address"},"get-address-result",function(e){if(!e.ok)throw new H(e.error);return{address:e.address,isComplete:e.is_complete}},r)]})})()};var p=function e(e,r){var t;var n=new URL(e.src).origin;(t=e.contentWindow)===null||t===void 0?void 0:t.postMessage({__scope:"whop-embedded-checkout",event:"submit"},n)};var y=function e(e,r,t,n,o,a,i,u,c,l,s,f,d,v,p,y){var h,m,b,w,g,O,P;var _=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(_.searchParams.set("h",window.location.origin),r&&_.searchParams.set("theme",r),t&&_.searchParams.set("session",t),o&&_.searchParams.set("hide_price","true"),a&&_.searchParams.set("skip_redirect","true"),s&&_.searchParams.set("hide_submit_button","true"),f&&_.searchParams.set("hide_tos","true"),d&&_.searchParams.set("email.hidden","1"),v&&_.searchParams.set("email.disabled","1"),p&&_.searchParams.set("address.hidden","1"),y&&_.searchParams.set("a",y),i){var j=true,k=false,S=undefined,x=true,C=false,R=undefined;try{for(var A=Object.entries(i).sort(function(e,r){return e[0].localeCompare(r[0])})[Symbol.iterator](),W;!(x=(W=A.next()).done);x=true){var I=E(W.value,2),U=I[0],q=I[1];if(U.startsWith("utm_"))if(Array.isArray(q))try{for(var T=q[Symbol.iterator](),M;!(j=(M=T.next()).done);j=true){var D=M.value;_.searchParams.append(U,D)}}catch(e){k=true;S=e}finally{try{if(!j&&T.return!=null){T.return()}}finally{if(k){throw S}}}else _.searchParams.set(U,q)}}catch(e){C=true;R=e}finally{try{if(!x&&A.return!=null){A.return()}}finally{if(C){throw R}}}}if(u){var L=true,N=false,V=undefined,z=true,B=false,F=undefined;try{for(var G=Object.entries(u)[Symbol.iterator](),$;!(z=($=G.next()).done);z=true){var H=E($.value,2),J=H[0],K=H[1];if(K)try{for(var Q=Object.entries(K)[Symbol.iterator](),X;!(L=(X=Q.next()).done);L=true){var Y=E(X.value,2),Z=Y[0],ee=Y[1];_.searchParams.set("style.".concat(J,".").concat(Z),ee.toString())}}catch(e){N=true;V=e}finally{try{if(!L&&Q.return!=null){Q.return()}}finally{if(N){throw V}}}}}catch(e){B=true;F=e}finally{try{if(!z&&G.return!=null){G.return()}}finally{if(B){throw F}}}}var er=true,et=false,en=undefined;if((c===null||c===void 0?void 0:c.email)&&_.searchParams.set("email",c.email),(c===null||c===void 0?void 0:(h=c.address)===null||h===void 0?void 0:h.name)&&_.searchParams.set("name",c.address.name),(c===null||c===void 0?void 0:(m=c.address)===null||m===void 0?void 0:m.line1)&&_.searchParams.set("address.line1",c.address.line1),(c===null||c===void 0?void 0:(b=c.address)===null||b===void 0?void 0:b.line2)&&_.searchParams.set("address.line2",c.address.line2),(c===null||c===void 0?void 0:(w=c.address)===null||w===void 0?void 0:w.city)&&_.searchParams.set("address.city",c.address.city),(c===null||c===void 0?void 0:(g=c.address)===null||g===void 0?void 0:g.country)&&_.searchParams.set("address.country",c.address.country),(c===null||c===void 0?void 0:(O=c.address)===null||O===void 0?void 0:O.state)&&_.searchParams.set("address.state",c.address.state),(c===null||c===void 0?void 0:(P=c.address)===null||P===void 0?void 0:P.postalCode)&&_.searchParams.set("address.postal_code",c.address.postalCode),l)try{for(var eo=Object.entries(l)[Symbol.iterator](),ea;!(er=(ea=eo.next()).done);er=true){var ei=E(ea.value,2),eu=ei[0],ec=ei[1];ec&&_.searchParams.set("theme.".concat(eu),ec)}}catch(e){et=true;en=e}finally{try{if(!er&&eo.return!=null){eo.return()}}finally{if(et){throw en}}}return _.toString()};var h=function e(){return function(){}};var b=function e(){return(0,Y.useSyncExternalStore)(h,function(){return!0},function(){return!1})};var O=function e(e){return e?Z.includes(e):!1};var P=function e(e){var r=(0,ee.useRef)(er);return r.current===er&&(r.current=e()),r};var _=function e(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++){r[t]=arguments[t]}var n=P(function(){return y.apply(void 0,j(r))}),o=n.current;return S.apply(void 0,[o].concat(j(r))),o};var S=function e(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++){t[n-1]=arguments[n]}var o=E(t,16),a=o[0],i=o[1],u=o[2],c=o[3],l=o[4],s=o[5],f=o[6],d=o[7],v=o[8],p=o[9],h=o[10],m=o[11],b=o[12],w=o[13],g=o[14],O=o[15];var P=(0,et.useMemo)(function(){return y(a,i,u,void 0,l,s,f,d,v,p,h,m,b,w,g,O)},[a,i,u,l,s,f,d,v,p,h,m,b,w,g,O]);(0,et.useEffect)(function(){e!==P&&process.env.NODE_ENV==="development"&&console.warn("[WhopCheckoutEmbed] iframeUrl changed from ".concat(e," to ").concat(P,". Updating props on the checkout embed is not supported. Please rerender the component."))},[e,P])};var C=function e(){return(0,ei.useRef)(null)};var A=Object.create;var W=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var M=function(e,r,t){return r in e?W(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t};var D=function(e){return(typeof require==="undefined"?"undefined":k(require))<"u"?require:(typeof Proxy==="undefined"?"undefined":k(Proxy))<"u"?new Proxy(e,{get:function(e,r){return((typeof require==="undefined"?"undefined":k(require))<"u"?require:e)[r]}}):e}(function(e){if((typeof require==="undefined"?"undefined":k(require))<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var L=function(e,r,t,n){var o=true,a=false,i=undefined;if(r&&(typeof r==="undefined"?"undefined":k(r))=="object"||typeof r=="function")try{var u=function(){var o=l.value;!T.call(e,o)&&o!==t&&W(e,o,{get:function(){return r[o]},enumerable:!(n=I(r,o))||n.enumerable})};for(var c=U(r)[Symbol.iterator](),l;!(o=(l=c.next()).done);o=true)u()}catch(e){a=true;i=e}finally{try{if(!o&&c.return!=null){c.return()}}finally{if(a){throw i}}}return e};var N=function(e,r,t){return t=e!=null?A(q(e)):{},L(r||!e||!e.__esModule?W(t,"default",{value:e,enumerable:!0}):t,e)};var V=function(e,r,t){return M(e,(typeof r==="undefined"?"undefined":k(r))!="symbol"?r+"":r,t)};var z=N(D("react"));var B=/*#__PURE__*/function(e){f(r,e);function r(){u(this,r);var e;e=i(this,r,arguments);V(e,"type","WhopCheckoutError");return e}return r}(x(Error));var F=/*#__PURE__*/function(e){f(r,e);function r(e){u(this,r);var t;t=i(this,r,[e!==null&&e!==void 0?e:"Timeout waiting for embed response"]);V(t,"name","WhopCheckoutRpcTimeoutError");return t}return r}(B);var G=/*#__PURE__*/function(e){f(r,e);function r(){u(this,r);var e;e=i(this,r,arguments);V(e,"name","WhopCheckoutSetEmailError");return e}return r}(B);var $=/*#__PURE__*/function(e){f(r,e);function r(){u(this,r);var e;e=i(this,r,arguments);V(e,"name","WhopCheckoutSetAddressError");return e}return r}(B);var H=/*#__PURE__*/function(e){f(r,e);function r(){u(this,r);var e;e=i(this,r,arguments);V(e,"name","WhopCheckoutGetAddressError");return e}return r}(B);var J=["resize","center","complete","state","get-email-result","set-email-result","set-address-result","get-address-result","address-validation-error"];var K=[];var Q=["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"],X="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";var Y=D("react");var Z=["tomato","red","ruby","crimson","pink","plum","purple","violet","iris","cyan","teal","jade","green","grass","brown","blue","orange","indigo","sky","mint","yellow","amber","lime","lemon","magenta","gold","bronze","gray"];var ee=D("react"),er=Symbol("none");var et=D("react");var en=Q.join(" ");var eo=(0,z.forwardRef)(function(e,r){var t=e.planId,n=e.theme,o=e.sessionId,a=e.hidePrice,i=a===void 0?!1:a,u=e.skipRedirect,f=u===void 0?!1:u,y=e.onComplete,h=e.onStateChange,m=e.onAddressValidationError,b=e.utm,w=e.styles,g=e.prefill,P=e.themeOptions,j=e.hideSubmitButton,k=j===void 0?!1:j,S=e.hideTermsAndConditions,x=S===void 0?!1:S,C=e.hideEmail,R=C===void 0?!1:C,A=e.disableEmail,W=A===void 0?!1:A,I=e.hideAddressForm,U=I===void 0?!1:I,q=e.affiliateCode;var T=(0,z.useMemo)(function(){return{accentColor:O(P===null||P===void 0?void 0:P.accentColor)?P.accentColor:void 0}},[P===null||P===void 0?void 0:P.accentColor]),M=_(t,n,o,void 0,i,f||!!y,b,w,g,T,k,x,R,W,U,q),D=(0,z.useRef)(null),L=E((0,z.useState)(480),2),N=L[0],V=L[1];if((0,z.useEffect)(function(){var e=D.current;if(e)return c(e,function(r){switch(r.event){case"resize":{V(r.height);break}case"center":{e.scrollIntoView({block:"center",inline:"center"});break}case"complete":{y&&y(r.plan_id,r.receipt_id);break}case"state":{h&&h(r.state);break}case"address-validation-error":{m&&m({error_message:r.error_message,error_code:r.error_code});break}}})},[y,h,m]),r){var B={submit:function(e){D.current&&p(D.current,e)},getEmail:function(e){if(!D.current)throw new Error("Whop embedded checkout frame not found");return s(D.current,e)},setEmail:function(e,r){if(!D.current)throw new Error("Whop embedded checkout frame not found");return l(D.current,e,r)},setAddress:function(e,r){if(!D.current)throw new Error("Whop embedded checkout frame not found");return d(D.current,e,r)},getAddress:function(e){if(!D.current)throw new Error("Whop embedded checkout frame not found");return v(D.current,e)}};typeof r=="function"?r(B):r.current=B}return z.default.createElement("iframe",{ref:D,allow:X,sandbox:en,title:"Whop Embedded Checkout",src:M!==null&&M!==void 0?M:void 0,style:{border:"none",height:"".concat(N,"px"),width:"100%",overflow:"hidden"}})});eo.displayName="WhopCheckoutEmbedInner";var ea=(0,z.forwardRef)(function(e,r){var t=e.fallback,n=g(e,["fallback"]);return b()?z.default.createElement(eo,w(m({},n),{ref:r})):t!==null&&t!==void 0?t:null});ea.displayName="WhopCheckoutEmbed";var ei=D("react")})();
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(r){if(Array.isArray(r))return e(r)}function n(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function o(e,r,t,n,o,a,i){try{var u=e[a](i);var c=u.value}catch(e){t(e);return}if(u.done){r(c)}else{Promise.resolve(c).then(n,o)}}function a(e){return function(){var r=this,t=arguments;return new Promise(function(n,a){var i=e.apply(r,t);function u(e){o(i,n,a,u,c,"next",e)}function c(e){o(i,n,a,u,c,"throw",e)}u(undefined)})}}function i(e,r,t){r=s(r);return P(e,x()?Reflect.construct(r,t||[],s(e).constructor):r.apply(e,t))}function u(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function c(e,r,t){if(x()){c=Reflect.construct}else{c=function e(e,r,t){var n=[null];n.push.apply(n,r);var o=Function.bind.apply(e,n);var a=new o;if(t)_(a,t.prototype);return a}}return c.apply(null,arguments)}function l(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function s(e){s=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return s(e)}function f(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:true,configurable:true}});if(r)_(e,r)}function d(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function v(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function p(e,r){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var n=[];var o=true;var a=false;var i,u;try{for(t=t.call(e);!(o=(i=t.next()).done);o=true){n.push(i.value);if(r&&n.length===r)break}}catch(e){a=true;u=e}finally{try{if(!o&&t["return"]!=null)t["return"]()}finally{if(a)throw u}}return n}function h(){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 y(){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 m(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};var n=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}n.forEach(function(r){l(e,r,t[r])})}return e}function b(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(r){n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})}t.push.apply(t,n)}return t}function w(e,r){r=r!=null?r:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(r))}else{b(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function g(e,r){if(e==null)return{};var t=O(e,r);var n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++){n=a[o];if(r.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;t[n]=e[n]}}return t}function O(e,r){if(e==null)return{};var t={};var n=Object.keys(e);var o,a;for(a=0;a<n.length;a++){o=n[a];if(r.indexOf(o)>=0)continue;t[o]=e[o]}return t}function P(e,r){if(r&&(k(r)==="object"||typeof r==="function")){return r}return n(e)}function _(e,r){_=Object.setPrototypeOf||function e(e,r){e.__proto__=r;return e};return _(e,r)}function E(e,t){return r(e)||p(e,t)||S(e,t)||h()}function j(e){return t(e)||v(e)||S(e)||y()}function k(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function S(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 C(e){var r=typeof Map==="function"?new Map:undefined;C=function e(e){if(e===null||!d(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof r!=="undefined"){if(r.has(e))return r.get(e);r.set(e,t)}function t(){return c(e,arguments,s(this).constructor)}t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}});return _(t,e)};return C(e)}function x(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(x=function(){return!!e})()}function R(e,r){var t,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=u(0),i["throw"]=u(1),i["return"]=u(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function u(e){return function(r){return c([e,r])}}function c(u){if(t)throw new TypeError("Generator is already executing.");while(i&&(i=0,u[0]&&(a=0)),a)try{if(t=1,n&&(o=u[0]&2?n["return"]:u[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;if(n=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:a.label++;return{value:u[1],done:false};case 5:a.label++;n=u[1];u=[0];continue;case 7:u=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){a=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(u[0]===6&&a.label<o[1]){a.label=o[1];o=u;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(u);break}if(o[2])a.ops.pop();a.trys.pop();continue}u=r.call(e,a)}catch(e){u=[6,e];n=0}finally{t=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}(function(){var e=function e(e){return k(e.data)=="object"&&e.data!==null&&"event"in e.data&&J.includes(e.data.event)};var r=function r(r,t){return e(r)&&r.data.event===t};var t=function e(e){return K[e]||(K[e]=(e+256).toString(16).slice(1))};var n=function e(){var e=new Uint8Array(16);if((typeof crypto==="undefined"?"undefined":k(crypto))<"u"&&typeof crypto.getRandomValues=="function")crypto.getRandomValues(e);else for(var r=0;r<16;r++)e[r]=Math.random()*256|0;return e[6]=e[6]&15|64,e[8]=e[8]&63|128,t(e[0])+t(e[1])+t(e[2])+t(e[3])+"-"+t(e[4])+t(e[5])+"-"+t(e[6])+t(e[7])+"-"+t(e[8])+t(e[9])+"-"+t(e[10])+t(e[11])+t(e[12])+t(e[13])+t(e[14])+t(e[15])};var o=function e(e,t,o,a){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:2e3;var u;var c=new URL(e.src).origin,l=n();return(u=e.contentWindow)===null||u===void 0?void 0:u.postMessage(w(m({},t),{__scope:"whop-embedded-checkout",event_id:l}),c),new Promise(function(t,n){var u=setTimeout(function(){n(new F),window.removeEventListener("message",c)},i),c=function(i){if(i.source===e.contentWindow&&r(i,o)&&i.data.event===o&&i.data.event_id===l){clearTimeout(u),window.removeEventListener("message",c);try{t(a(i.data))}catch(e){n(e)}}};window.addEventListener("message",c)})};var c=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 l=function e(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return a(function(){return R(this,function(n){return[2,o(e,{event:"set-email",email:r},"set-email-result",function(e){if(!e.ok)throw new G(e.error)},t)]})})()};var s=function e(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return a(function(){return R(this,function(t){return[2,o(e,{event:"get-email"},"get-email-result",function(e){return e.email},r)]})})()};var d=function e(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return a(function(){return R(this,function(n){return[2,o(e,{event:"set-address",address:r},"set-address-result",function(e){if(!e.ok)throw new $(e.error)},t)]})})()};var v=function e(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return a(function(){return R(this,function(t){return[2,o(e,{event:"get-address"},"get-address-result",function(e){if(!e.ok)throw new H(e.error);return{address:e.address,isComplete:e.is_complete}},r)]})})()};var p=function e(e,r){var t;var n=new URL(e.src).origin;(t=e.contentWindow)===null||t===void 0?void 0:t.postMessage({__scope:"whop-embedded-checkout",event:"submit"},n)};var h=function e(e,r,t,n,o,a,i,u,c,l,s,f,d,v,p,h){var y,m,b,w,g,O,P;var _=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(_.searchParams.set("h",window.location.origin),r&&_.searchParams.set("theme",r),t&&_.searchParams.set("session",t),o&&_.searchParams.set("hide_price","true"),a&&_.searchParams.set("skip_redirect","true"),s&&_.searchParams.set("hide_submit_button","true"),f&&_.searchParams.set("hide_tos","true"),d&&_.searchParams.set("email.hidden","1"),v&&_.searchParams.set("email.disabled","1"),p&&_.searchParams.set("address.hidden","1"),h&&_.searchParams.set("a",h),i){var j=true,k=false,S=undefined,C=true,x=false,R=undefined;try{for(var A=Object.entries(i).sort(function(e,r){return e[0].localeCompare(r[0])})[Symbol.iterator](),W;!(C=(W=A.next()).done);C=true){var I=E(W.value,2),U=I[0],q=I[1];if(U.startsWith("utm_"))if(Array.isArray(q))try{for(var T=q[Symbol.iterator](),M;!(j=(M=T.next()).done);j=true){var D=M.value;_.searchParams.append(U,D)}}catch(e){k=true;S=e}finally{try{if(!j&&T.return!=null){T.return()}}finally{if(k){throw S}}}else _.searchParams.set(U,q)}}catch(e){x=true;R=e}finally{try{if(!C&&A.return!=null){A.return()}}finally{if(x){throw R}}}}if(u){var L=true,N=false,V=undefined,z=true,B=false,F=undefined;try{for(var G=Object.entries(u)[Symbol.iterator](),$;!(z=($=G.next()).done);z=true){var H=E($.value,2),J=H[0],K=H[1];if(K)try{for(var Q=Object.entries(K)[Symbol.iterator](),X;!(L=(X=Q.next()).done);L=true){var Y=E(X.value,2),Z=Y[0],ee=Y[1];_.searchParams.set("style.".concat(J,".").concat(Z),ee.toString())}}catch(e){N=true;V=e}finally{try{if(!L&&Q.return!=null){Q.return()}}finally{if(N){throw V}}}}}catch(e){B=true;F=e}finally{try{if(!z&&G.return!=null){G.return()}}finally{if(B){throw F}}}}var er=true,et=false,en=undefined;if((c===null||c===void 0?void 0:c.email)&&_.searchParams.set("email",c.email),(c===null||c===void 0?void 0:(y=c.address)===null||y===void 0?void 0:y.name)&&_.searchParams.set("name",c.address.name),(c===null||c===void 0?void 0:(m=c.address)===null||m===void 0?void 0:m.line1)&&_.searchParams.set("address.line1",c.address.line1),(c===null||c===void 0?void 0:(b=c.address)===null||b===void 0?void 0:b.line2)&&_.searchParams.set("address.line2",c.address.line2),(c===null||c===void 0?void 0:(w=c.address)===null||w===void 0?void 0:w.city)&&_.searchParams.set("address.city",c.address.city),(c===null||c===void 0?void 0:(g=c.address)===null||g===void 0?void 0:g.country)&&_.searchParams.set("address.country",c.address.country),(c===null||c===void 0?void 0:(O=c.address)===null||O===void 0?void 0:O.state)&&_.searchParams.set("address.state",c.address.state),(c===null||c===void 0?void 0:(P=c.address)===null||P===void 0?void 0:P.postalCode)&&_.searchParams.set("address.postal_code",c.address.postalCode),l)try{for(var eo=Object.entries(l)[Symbol.iterator](),ea;!(er=(ea=eo.next()).done);er=true){var ei=E(ea.value,2),eu=ei[0],ec=ei[1];ec&&_.searchParams.set("theme.".concat(eu),typeof ec=="boolean"?"1":ec)}}catch(e){et=true;en=e}finally{try{if(!er&&eo.return!=null){eo.return()}}finally{if(et){throw en}}}return _.toString()};var y=function e(){return function(){}};var b=function e(){return(0,Y.useSyncExternalStore)(y,function(){return!0},function(){return!1})};var O=function e(e){return e?Z.includes(e):!1};var P=function e(e){var r=(0,ee.useRef)(er);return r.current===er&&(r.current=e()),r};var _=function e(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++){r[t]=arguments[t]}var n=P(function(){return h.apply(void 0,j(r))}),o=n.current;return S.apply(void 0,[o].concat(j(r))),o};var S=function e(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++){t[n-1]=arguments[n]}var o=E(t,16),a=o[0],i=o[1],u=o[2],c=o[3],l=o[4],s=o[5],f=o[6],d=o[7],v=o[8],p=o[9],y=o[10],m=o[11],b=o[12],w=o[13],g=o[14],O=o[15];var P=(0,et.useMemo)(function(){return h(a,i,u,void 0,l,s,f,d,v,p,y,m,b,w,g,O)},[a,i,u,l,s,f,d,v,p,y,m,b,w,g,O]);(0,et.useEffect)(function(){e!==P&&process.env.NODE_ENV==="development"&&console.warn("[WhopCheckoutEmbed] iframeUrl changed from ".concat(e," to ").concat(P,". Updating props on the checkout embed is not supported. Please rerender the component."))},[e,P])};var x=function e(){return(0,ei.useRef)(null)};var A=Object.create;var W=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var M=function(e,r,t){return r in e?W(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t};var D=function(e){return(typeof require==="undefined"?"undefined":k(require))<"u"?require:(typeof Proxy==="undefined"?"undefined":k(Proxy))<"u"?new Proxy(e,{get:function(e,r){return((typeof require==="undefined"?"undefined":k(require))<"u"?require:e)[r]}}):e}(function(e){if((typeof require==="undefined"?"undefined":k(require))<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var L=function(e,r,t,n){var o=true,a=false,i=undefined;if(r&&(typeof r==="undefined"?"undefined":k(r))=="object"||typeof r=="function")try{var u=function(){var o=l.value;!T.call(e,o)&&o!==t&&W(e,o,{get:function(){return r[o]},enumerable:!(n=I(r,o))||n.enumerable})};for(var c=U(r)[Symbol.iterator](),l;!(o=(l=c.next()).done);o=true)u()}catch(e){a=true;i=e}finally{try{if(!o&&c.return!=null){c.return()}}finally{if(a){throw i}}}return e};var N=function(e,r,t){return t=e!=null?A(q(e)):{},L(r||!e||!e.__esModule?W(t,"default",{value:e,enumerable:!0}):t,e)};var V=function(e,r,t){return M(e,(typeof r==="undefined"?"undefined":k(r))!="symbol"?r+"":r,t)};var z=N(D("react"));var B=/*#__PURE__*/function(e){f(r,e);function r(){u(this,r);var e;e=i(this,r,arguments);V(e,"type","WhopCheckoutError");return e}return r}(C(Error));var F=/*#__PURE__*/function(e){f(r,e);function r(e){u(this,r);var t;t=i(this,r,[e!==null&&e!==void 0?e:"Timeout waiting for embed response"]);V(t,"name","WhopCheckoutRpcTimeoutError");return t}return r}(B);var G=/*#__PURE__*/function(e){f(r,e);function r(){u(this,r);var e;e=i(this,r,arguments);V(e,"name","WhopCheckoutSetEmailError");return e}return r}(B);var $=/*#__PURE__*/function(e){f(r,e);function r(){u(this,r);var e;e=i(this,r,arguments);V(e,"name","WhopCheckoutSetAddressError");return e}return r}(B);var H=/*#__PURE__*/function(e){f(r,e);function r(){u(this,r);var e;e=i(this,r,arguments);V(e,"name","WhopCheckoutGetAddressError");return e}return r}(B);var J=["resize","center","complete","state","get-email-result","set-email-result","set-address-result","get-address-result","address-validation-error"];var K=[];var Q=["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"],X="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;";var Y=D("react");var Z=["tomato","red","ruby","crimson","pink","plum","purple","violet","iris","cyan","teal","jade","green","grass","brown","blue","orange","indigo","sky","mint","yellow","amber","lime","lemon","magenta","gold","bronze","gray"];var ee=D("react"),er=Symbol("none");var et=D("react");var en=Q.join(" ");var eo=(0,z.forwardRef)(function(e,r){var t=e.planId,n=e.theme,o=e.sessionId,a=e.hidePrice,i=a===void 0?!1:a,u=e.skipRedirect,f=u===void 0?!1:u,h=e.onComplete,y=e.onStateChange,m=e.onAddressValidationError,b=e.utm,w=e.styles,g=e.prefill,P=e.themeOptions,j=e.hideSubmitButton,k=j===void 0?!1:j,S=e.hideTermsAndConditions,C=S===void 0?!1:S,x=e.hideEmail,R=x===void 0?!1:x,A=e.disableEmail,W=A===void 0?!1:A,I=e.hideAddressForm,U=I===void 0?!1:I,q=e.affiliateCode;var T=(0,z.useMemo)(function(){var e;return{accentColor:O(P===null||P===void 0?void 0:P.accentColor)?P.accentColor:void 0,highContrast:(e=P===null||P===void 0?void 0:P.highContrast)!==null&&e!==void 0?e:!1}},[P===null||P===void 0?void 0:P.accentColor,P===null||P===void 0?void 0:P.highContrast]),M=_(t,n,o,void 0,i,f||!!h,b,w,g,T,k,C,R,W,U,q),D=(0,z.useRef)(null),L=E((0,z.useState)(480),2),N=L[0],V=L[1];if((0,z.useEffect)(function(){var e=D.current;if(e)return c(e,function(r){switch(r.event){case"resize":{V(r.height);break}case"center":{e.scrollIntoView({block:"center",inline:"center"});break}case"complete":{h&&h(r.plan_id,r.receipt_id);break}case"state":{y&&y(r.state);break}case"address-validation-error":{m&&m({error_message:r.error_message,error_code:r.error_code});break}}})},[h,y,m]),r){var B={submit:function(e){D.current&&p(D.current,e)},getEmail:function(e){if(!D.current)throw new Error("Whop embedded checkout frame not found");return s(D.current,e)},setEmail:function(e,r){if(!D.current)throw new Error("Whop embedded checkout frame not found");return l(D.current,e,r)},setAddress:function(e,r){if(!D.current)throw new Error("Whop embedded checkout frame not found");return d(D.current,e,r)},getAddress:function(e){if(!D.current)throw new Error("Whop embedded checkout frame not found");return v(D.current,e)}};typeof r=="function"?r(B):r.current=B}return z.default.createElement("iframe",{ref:D,allow:X,sandbox:en,title:"Whop Embedded Checkout",src:M!==null&&M!==void 0?M:void 0,style:{border:"none",height:"".concat(N,"px"),width:"100%",overflow:"hidden"}})});eo.displayName="WhopCheckoutEmbedInner";var ea=(0,z.forwardRef)(function(e,r){var t=e.fallback,n=g(e,["fallback"]);return b()?z.default.createElement(eo,w(m({},n),{ref:r})):t!==null&&t!==void 0?t:null});ea.displayName="WhopCheckoutEmbed";var ei=D("react")})();
@@ -1 +1 @@
1
- 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(r){if(Array.isArray(r))return e(r)}function n(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function i(e,r){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var n=[];var o=true;var i=false;var a,c;try{for(t=t.call(e);!(o=(a=t.next()).done);o=true){n.push(a.value);if(r&&n.length===r)break}}catch(e){i=true;c=e}finally{try{if(!o&&t["return"]!=null)t["return"]()}finally{if(i)throw c}}return n}function a(){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 c(){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){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};var o=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){o=o.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}o.forEach(function(r){n(e,r,t[r])})}return e}function l(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(r){n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})}t.push.apply(t,n)}return t}function f(e,r){r=r!=null?r:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(r))}else{l(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e,r){if(e==null)return{};var t=d(e,r);var n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++){n=i[o];if(r.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;t[n]=e[n]}}return t}function d(e,r){if(e==null)return{};var t={};var n=Object.keys(e);var o,i;for(i=0;i<n.length;i++){o=n[i];if(r.indexOf(o)>=0)continue;t[o]=e[o]}return t}function m(e,t){return r(e)||i(e,t)||b(e,t)||a()}function p(e){return t(e)||o(e)||b(e)||c()}function b(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)}import{b as y,c as v,d as h,e as g,f as w,g as O,h as j,i as k,j as E}from"../chunk-D7BU562Q.mjs";import S,{forwardRef as C,useEffect as A,useMemo as P,useRef as I,useState as W}from"react";import{useSyncExternalStore as x}from"react";function D(){return function(){}}function _(){return x(D,function(){return!0},function(){return!1})}var R=["tomato","red","ruby","crimson","pink","plum","purple","violet","iris","cyan","teal","jade","green","grass","brown","blue","orange","indigo","sky","mint","yellow","amber","lime","lemon","magenta","gold","bronze","gray"];function U(e){return e?R.includes(e):!1}import{useRef as N}from"react";var V=Symbol("none");function M(e){var r=N(V);return r.current===V&&(r.current=e()),r}import{useEffect as T,useMemo as z}from"react";function B(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++){r[t]=arguments[t]}var n=M(function(){return j.apply(void 0,p(r))}),o=n.current;return F.apply(void 0,[o].concat(p(r))),o}function F(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++){t[n-1]=arguments[n]}var o=m(t,16),i=o[0],a=o[1],c=o[2],u=o[3],l=o[4],f=o[5],s=o[6],d=o[7],p=o[8],b=o[9],y=o[10],v=o[11],h=o[12],g=o[13],w=o[14],O=o[15];var k=z(function(){return j(i,a,c,void 0,l,f,s,d,p,b,y,v,h,g,w,O)},[i,a,c,l,f,s,d,p,b,y,v,h,g,w,O]);T(function(){e!==k&&process.env.NODE_ENV==="development"&&console.warn("[WhopCheckoutEmbed] iframeUrl changed from ".concat(e," to ").concat(k,". Updating props on the checkout embed is not supported. Please rerender the component."))},[e,k])}var Q=k.join(" ");var $=C(function(e,r){var t=e.planId,n=e.theme,o=e.sessionId,i=e.hidePrice,a=i===void 0?!1:i,c=e.skipRedirect,u=c===void 0?!1:c,l=e.onComplete,f=e.onStateChange,s=e.onAddressValidationError,d=e.utm,p=e.styles,b=e.prefill,j=e.themeOptions,k=e.hideSubmitButton,C=k===void 0?!1:k,x=e.hideTermsAndConditions,D=x===void 0?!1:x,_=e.hideEmail,R=_===void 0?!1:_,N=e.disableEmail,V=N===void 0?!1:N,M=e.hideAddressForm,T=M===void 0?!1:M,z=e.affiliateCode;var F=P(function(){return{accentColor:U(j===null||j===void 0?void 0:j.accentColor)?j.accentColor:void 0}},[j===null||j===void 0?void 0:j.accentColor]),$=B(t,n,o,void 0,a,u||!!l,d,p,b,F,C,D,R,V,T,z),q=I(null),G=m(W(480),2),H=G[0],J=G[1];if(A(function(){var e=q.current;if(e)return y(e,function(r){switch(r.event){case"resize":{J(r.height);break}case"center":{e.scrollIntoView({block:"center",inline:"center"});break}case"complete":{l&&l(r.plan_id,r.receipt_id);break}case"state":{f&&f(r.state);break}case"address-validation-error":{s&&s({error_message:r.error_message,error_code:r.error_code});break}}})},[l,f,s]),r){var K={submit:function(e){q.current&&O(q.current,e)},getEmail:function(e){if(!q.current)throw new Error("Whop embedded checkout frame not found");return h(q.current,e)},setEmail:function(e,r){if(!q.current)throw new Error("Whop embedded checkout frame not found");return v(q.current,e,r)},setAddress:function(e,r){if(!q.current)throw new Error("Whop embedded checkout frame not found");return g(q.current,e,r)},getAddress:function(e){if(!q.current)throw new Error("Whop embedded checkout frame not found");return w(q.current,e)}};typeof r=="function"?r(K):r.current=K}return S.createElement("iframe",{ref:q,allow:E,sandbox:Q,title:"Whop Embedded Checkout",src:$!==null&&$!==void 0?$:void 0,style:{border:"none",height:"".concat(H,"px"),width:"100%",overflow:"hidden"}})});$.displayName="WhopCheckoutEmbedInner";var q=C(function(e,r){var t=e.fallback,n=s(e,["fallback"]);return _()?S.createElement($,f(u({},n),{ref:r})):t!==null&&t!==void 0?t:null});q.displayName="WhopCheckoutEmbed";import{useRef as G}from"react";function H(){return G(null)}export{q as WhopCheckoutEmbed,R as accentColorValues,U as isAccentColor,H as useCheckoutEmbedControls};
1
+ 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(r){if(Array.isArray(r))return e(r)}function n(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function i(e,r){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var n=[];var o=true;var i=false;var a,u;try{for(t=t.call(e);!(o=(a=t.next()).done);o=true){n.push(a.value);if(r&&n.length===r)break}}catch(e){i=true;u=e}finally{try{if(!o&&t["return"]!=null)t["return"]()}finally{if(i)throw u}}return n}function a(){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 c(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};var o=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){o=o.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}o.forEach(function(r){n(e,r,t[r])})}return e}function l(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(r){n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})}t.push.apply(t,n)}return t}function f(e,r){r=r!=null?r:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(r))}else{l(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e,r){if(e==null)return{};var t=d(e,r);var n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++){n=i[o];if(r.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;t[n]=e[n]}}return t}function d(e,r){if(e==null)return{};var t={};var n=Object.keys(e);var o,i;for(i=0;i<n.length;i++){o=n[i];if(r.indexOf(o)>=0)continue;t[o]=e[o]}return t}function m(e,t){return r(e)||i(e,t)||b(e,t)||a()}function p(e){return t(e)||o(e)||b(e)||u()}function b(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)}import{b as v,c as h,d as y,e as g,f as w,g as O,h as j,i as k,j as E}from"../chunk-DA7YNHTQ.mjs";import C,{forwardRef as S,useEffect as A,useMemo as P,useRef as I,useState as W}from"react";import{useSyncExternalStore as x}from"react";function D(){return function(){}}function _(){return x(D,function(){return!0},function(){return!1})}var N=["tomato","red","ruby","crimson","pink","plum","purple","violet","iris","cyan","teal","jade","green","grass","brown","blue","orange","indigo","sky","mint","yellow","amber","lime","lemon","magenta","gold","bronze","gray"];function R(e){return e?N.includes(e):!1}import{useRef as T}from"react";var U=Symbol("none");function V(e){var r=T(U);return r.current===U&&(r.current=e()),r}import{useEffect as M,useMemo as z}from"react";function B(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++){r[t]=arguments[t]}var n=V(function(){return j.apply(void 0,p(r))}),o=n.current;return F.apply(void 0,[o].concat(p(r))),o}function F(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++){t[n-1]=arguments[n]}var o=m(t,16),i=o[0],a=o[1],u=o[2],c=o[3],l=o[4],f=o[5],s=o[6],d=o[7],p=o[8],b=o[9],v=o[10],h=o[11],y=o[12],g=o[13],w=o[14],O=o[15];var k=z(function(){return j(i,a,u,void 0,l,f,s,d,p,b,v,h,y,g,w,O)},[i,a,u,l,f,s,d,p,b,v,h,y,g,w,O]);M(function(){e!==k&&process.env.NODE_ENV==="development"&&console.warn("[WhopCheckoutEmbed] iframeUrl changed from ".concat(e," to ").concat(k,". Updating props on the checkout embed is not supported. Please rerender the component."))},[e,k])}var H=k.join(" ");var Q=S(function(e,r){var t=e.planId,n=e.theme,o=e.sessionId,i=e.hidePrice,a=i===void 0?!1:i,u=e.skipRedirect,c=u===void 0?!1:u,l=e.onComplete,f=e.onStateChange,s=e.onAddressValidationError,d=e.utm,p=e.styles,b=e.prefill,j=e.themeOptions,k=e.hideSubmitButton,S=k===void 0?!1:k,x=e.hideTermsAndConditions,D=x===void 0?!1:x,_=e.hideEmail,N=_===void 0?!1:_,T=e.disableEmail,U=T===void 0?!1:T,V=e.hideAddressForm,M=V===void 0?!1:V,z=e.affiliateCode;var F=P(function(){var e;return{accentColor:R(j===null||j===void 0?void 0:j.accentColor)?j.accentColor:void 0,highContrast:(e=j===null||j===void 0?void 0:j.highContrast)!==null&&e!==void 0?e:!1}},[j===null||j===void 0?void 0:j.accentColor,j===null||j===void 0?void 0:j.highContrast]),Q=B(t,n,o,void 0,a,c||!!l,d,p,b,F,S,D,N,U,M,z),Y=I(null),$=m(W(480),2),q=$[0],G=$[1];if(A(function(){var e=Y.current;if(e)return v(e,function(r){switch(r.event){case"resize":{G(r.height);break}case"center":{e.scrollIntoView({block:"center",inline:"center"});break}case"complete":{l&&l(r.plan_id,r.receipt_id);break}case"state":{f&&f(r.state);break}case"address-validation-error":{s&&s({error_message:r.error_message,error_code:r.error_code});break}}})},[l,f,s]),r){var J={submit:function(e){Y.current&&O(Y.current,e)},getEmail:function(e){if(!Y.current)throw new Error("Whop embedded checkout frame not found");return y(Y.current,e)},setEmail:function(e,r){if(!Y.current)throw new Error("Whop embedded checkout frame not found");return h(Y.current,e,r)},setAddress:function(e,r){if(!Y.current)throw new Error("Whop embedded checkout frame not found");return g(Y.current,e,r)},getAddress:function(e){if(!Y.current)throw new Error("Whop embedded checkout frame not found");return w(Y.current,e)}};typeof r=="function"?r(J):r.current=J}return C.createElement("iframe",{ref:Y,allow:E,sandbox:H,title:"Whop Embedded Checkout",src:Q!==null&&Q!==void 0?Q:void 0,style:{border:"none",height:"".concat(q,"px"),width:"100%",overflow:"hidden"}})});Q.displayName="WhopCheckoutEmbedInner";var Y=S(function(e,r){var t=e.fallback,n=s(e,["fallback"]);return _()?C.createElement(Q,f(c({},n),{ref:r})):t!==null&&t!==void 0?t:null});Y.displayName="WhopCheckoutEmbed";import{useRef as $}from"react";function q(){return $(null)}export{Y as WhopCheckoutEmbed,N as accentColorValues,R as isAccentColor,q as useCheckoutEmbedControls};
@@ -122,6 +122,7 @@ interface WhopEmbeddedCheckoutPrefillOptions {
122
122
  }
123
123
  interface WhopEmbeddedCheckoutThemeOptions {
124
124
  accentColor?: string;
125
+ highContrast?: boolean;
125
126
  }
126
127
  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, hideTermsAndConditions?: boolean, hideEmail?: boolean, disableEmail?: boolean, hideAddressForm?: boolean, affiliateCode?: string): string;
127
128
  declare const EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST: string[];
@@ -122,6 +122,7 @@ interface WhopEmbeddedCheckoutPrefillOptions {
122
122
  }
123
123
  interface WhopEmbeddedCheckoutThemeOptions {
124
124
  accentColor?: string;
125
+ highContrast?: boolean;
125
126
  }
126
127
  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, hideTermsAndConditions?: boolean, hideEmail?: boolean, disableEmail?: boolean, hideAddressForm?: boolean, affiliateCode?: string): string;
127
128
  declare const EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST: string[];
@@ -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){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function n(e,t,r,n,o,a,i){try{var u=e[a](i);var s=u.value}catch(e){r(e);return}if(u.done){t(s)}else{Promise.resolve(s).then(n,o)}}function o(e){return function(){var t=this,r=arguments;return new Promise(function(o,a){var i=e.apply(t,r);function u(e){n(i,o,a,u,s,"next",e)}function s(e){n(i,o,a,u,s,"throw",e)}u(undefined)})}}function a(e,t,r){t=c(t);return m(e,O()?Reflect.construct(t,r||[],c(e).constructor):t.apply(e,r))}function i(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function u(e,t,r){if(O()){u=Reflect.construct}else{u=function e(e,t,r){var n=[null];n.push.apply(n,t);var o=Function.bind.apply(e,n);var a=new o;if(r)b(a,r.prototype);return a}}return u.apply(null,arguments)}function s(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function c(e){c=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return c(e)}function l(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)b(e,t)}function f(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function d(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 v(){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 p(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}n.forEach(function(t){s(e,t,r[t])})}return e}function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(t){n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}r.push.apply(r,n)}return r}function y(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{h(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function m(e,t){if(t&&(g(t)==="object"||typeof t==="function")){return t}return r(e)}function b(e,t){b=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return b(e,t)}function w(e,r){return t(e)||d(e,r)||_(e,r)||v()}function g(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function _(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 E(e){var t=typeof Map==="function"?new Map:undefined;E=function e(e){if(e===null||!f(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return u(e,arguments,c(this).constructor)}r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:false,writable:true,configurable:true}});return b(r,e)};return E(e)}function O(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(O=function(){return!!e})()}function P(e,t){var r,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=u(0),i["throw"]=u(1),i["return"]=u(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function u(e){return function(t){return s([e,t])}}function s(u){if(r)throw new TypeError("Generator is already executing.");while(i&&(i=0,u[0]&&(a=0)),a)try{if(r=1,n&&(o=u[0]&2?n["return"]:u[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;if(n=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:a.label++;return{value:u[1],done:false};case 5:a.label++;n=u[1];u=[0];continue;case 7:u=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){a=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(u[0]===6&&a.label<o[1]){a.label=o[1];o=u;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(u);break}if(o[2])a.ops.pop();a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e];n=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}var j=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var A=function(e,t,r){return t in e?j(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r};var D=function(e,t){for(var r in t)j(e,r,{get:t[r],enumerable:!0})},M=function(e,t,r,n){var o=true,a=false,i=undefined;if(t&&(typeof t==="undefined"?"undefined":g(t))=="object"||typeof t=="function")try{var u=function(){var o=c.value;!k.call(e,o)&&o!==r&&j(e,o,{get:function(){return t[o]},enumerable:!(n=S(t,o))||n.enumerable})};for(var s=C(t)[Symbol.iterator](),c;!(o=(c=s.next()).done);o=true)u()}catch(e){a=true;i=e}finally{try{if(!o&&s.return!=null){s.return()}}finally{if(a){throw i}}}return e};var R=function(e){return M(j({},"__esModule",{value:!0}),e)};var T=function(e,t,r){return A(e,(typeof t==="undefined"?"undefined":g(t))!="symbol"?t+"":t,r)};var I={};D(I,{EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING:function(){return et},EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST:function(){return ee},getAddress:function(){return Q},getEmail:function(){return $},getEmbeddedCheckoutIframeUrl:function(){return Z},isWhopCheckoutMessage:function(){return N},onWhopCheckoutMessage:function(){return q},setAddress:function(){return J},setEmail:function(){return z},submitCheckoutFrame:function(){return Y}});module.exports=R(I);var U=/*#__PURE__*/function(e){l(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);T(e,"type","WhopCheckoutError");return e}return t}(E(Error));var W=/*#__PURE__*/function(e){l(t,e);function t(e){i(this,t);var r;r=a(this,t,[e!==null&&e!==void 0?e:"Timeout waiting for embed response"]);T(r,"name","WhopCheckoutRpcTimeoutError");return r}return t}(U);var x=/*#__PURE__*/function(e){l(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);T(e,"name","WhopCheckoutSetEmailError");return e}return t}(U);var L=/*#__PURE__*/function(e){l(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);T(e,"name","WhopCheckoutSetAddressError");return e}return t}(U);var B=/*#__PURE__*/function(e){l(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);T(e,"name","WhopCheckoutGetAddressError");return e}return t}(U);var F=["resize","center","complete","state","get-email-result","set-email-result","set-address-result","get-address-result","address-validation-error"];function N(e){return g(e.data)=="object"&&e.data!==null&&"event"in e.data&&F.includes(e.data.event)}function H(e,t){return N(e)&&e.data.event===t}var K=[];function G(e){return K[e]||(K[e]=(e+256).toString(16).slice(1))}function X(){var e=new Uint8Array(16);if((typeof crypto==="undefined"?"undefined":g(crypto))<"u"&&typeof crypto.getRandomValues=="function")crypto.getRandomValues(e);else for(var t=0;t<16;t++)e[t]=Math.random()*256|0;return e[6]=e[6]&15|64,e[8]=e[8]&63|128,G(e[0])+G(e[1])+G(e[2])+G(e[3])+"-"+G(e[4])+G(e[5])+"-"+G(e[6])+G(e[7])+"-"+G(e[8])+G(e[9])+"-"+G(e[10])+G(e[11])+G(e[12])+G(e[13])+G(e[14])+G(e[15])}function V(e,t,r,n){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:2e3;var a;var i=new URL(e.src).origin,u=X();return(a=e.contentWindow)===null||a===void 0?void 0:a.postMessage(y(p({},t),{__scope:"whop-embedded-checkout",event_id:u}),i),new Promise(function(t,a){var i=setTimeout(function(){a(new W),window.removeEventListener("message",s)},o),s=function(o){if(o.source===e.contentWindow&&H(o,r)&&o.data.event===r&&o.data.event_id===u){clearTimeout(i),window.removeEventListener("message",s);try{t(n(o.data))}catch(e){a(e)}}};window.addEventListener("message",s)})}function q(e,t){function r(r){r.source===e.contentWindow&&N(r)&&t(r.data)}return window.addEventListener("message",r),function(){window.removeEventListener("message",r)}}function z(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return o(function(){return P(this,function(n){return[2,V(e,{event:"set-email",email:t},"set-email-result",function(e){if(!e.ok)throw new x(e.error)},r)]})})()}function $(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return o(function(){return P(this,function(r){return[2,V(e,{event:"get-email"},"get-email-result",function(e){return e.email},t)]})})()}function J(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return o(function(){return P(this,function(n){return[2,V(e,{event:"set-address",address:t},"set-address-result",function(e){if(!e.ok)throw new L(e.error)},r)]})})()}function Q(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return o(function(){return P(this,function(r){return[2,V(e,{event:"get-address"},"get-address-result",function(e){if(!e.ok)throw new B(e.error);return{address:e.address,isComplete:e.is_complete}},t)]})})()}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 Z(e,t,r,n,o,a,i,u,s,c,l,f,d,v,p,h){var y,m,b,g,_,E,O;var P=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(P.searchParams.set("h",window.location.origin),t&&P.searchParams.set("theme",t),r&&P.searchParams.set("session",r),o&&P.searchParams.set("hide_price","true"),a&&P.searchParams.set("skip_redirect","true"),l&&P.searchParams.set("hide_submit_button","true"),f&&P.searchParams.set("hide_tos","true"),d&&P.searchParams.set("email.hidden","1"),v&&P.searchParams.set("email.disabled","1"),p&&P.searchParams.set("address.hidden","1"),h&&P.searchParams.set("a",h),i){var j=true,S=false,C=undefined,k=true,A=false,D=undefined;try{for(var M=Object.entries(i).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),R;!(k=(R=M.next()).done);k=true){var T=w(R.value,2),I=T[0],U=T[1];if(I.startsWith("utm_"))if(Array.isArray(U))try{for(var W=U[Symbol.iterator](),x;!(j=(x=W.next()).done);j=true){var L=x.value;P.searchParams.append(I,L)}}catch(e){S=true;C=e}finally{try{if(!j&&W.return!=null){W.return()}}finally{if(S){throw C}}}else P.searchParams.set(I,U)}}catch(e){A=true;D=e}finally{try{if(!k&&M.return!=null){M.return()}}finally{if(A){throw D}}}}if(u){var B=true,F=false,N=undefined,H=true,K=false,G=undefined;try{for(var X=Object.entries(u)[Symbol.iterator](),V;!(H=(V=X.next()).done);H=true){var q=w(V.value,2),z=q[0],$=q[1];if($)try{for(var J=Object.entries($)[Symbol.iterator](),Q;!(B=(Q=J.next()).done);B=true){var Y=w(Q.value,2),Z=Y[0],ee=Y[1];P.searchParams.set("style.".concat(z,".").concat(Z),ee.toString())}}catch(e){F=true;N=e}finally{try{if(!B&&J.return!=null){J.return()}}finally{if(F){throw N}}}}}catch(e){K=true;G=e}finally{try{if(!H&&X.return!=null){X.return()}}finally{if(K){throw G}}}}var et=true,er=false,en=undefined;if((s===null||s===void 0?void 0:s.email)&&P.searchParams.set("email",s.email),(s===null||s===void 0?void 0:(y=s.address)===null||y===void 0?void 0:y.name)&&P.searchParams.set("name",s.address.name),(s===null||s===void 0?void 0:(m=s.address)===null||m===void 0?void 0:m.line1)&&P.searchParams.set("address.line1",s.address.line1),(s===null||s===void 0?void 0:(b=s.address)===null||b===void 0?void 0:b.line2)&&P.searchParams.set("address.line2",s.address.line2),(s===null||s===void 0?void 0:(g=s.address)===null||g===void 0?void 0:g.city)&&P.searchParams.set("address.city",s.address.city),(s===null||s===void 0?void 0:(_=s.address)===null||_===void 0?void 0:_.country)&&P.searchParams.set("address.country",s.address.country),(s===null||s===void 0?void 0:(E=s.address)===null||E===void 0?void 0:E.state)&&P.searchParams.set("address.state",s.address.state),(s===null||s===void 0?void 0:(O=s.address)===null||O===void 0?void 0:O.postalCode)&&P.searchParams.set("address.postal_code",s.address.postalCode),c)try{for(var eo=Object.entries(c)[Symbol.iterator](),ea;!(et=(ea=eo.next()).done);et=true){var ei=w(ea.value,2),eu=ei[0],es=ei[1];es&&P.searchParams.set("theme.".concat(eu),es)}}catch(e){er=true;en=e}finally{try{if(!et&&eo.return!=null){eo.return()}}finally{if(er){throw en}}}return P.toString()}var ee=["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"],et="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,getAddress:getAddress,getEmail:getEmail,getEmbeddedCheckoutIframeUrl:getEmbeddedCheckoutIframeUrl,isWhopCheckoutMessage:isWhopCheckoutMessage,onWhopCheckoutMessage:onWhopCheckoutMessage,setAddress:setAddress,setEmail:setEmail,submitCheckoutFrame:submitCheckoutFrame});
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){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function n(e,t,r,n,o,a,i){try{var u=e[a](i);var s=u.value}catch(e){r(e);return}if(u.done){t(s)}else{Promise.resolve(s).then(n,o)}}function o(e){return function(){var t=this,r=arguments;return new Promise(function(o,a){var i=e.apply(t,r);function u(e){n(i,o,a,u,s,"next",e)}function s(e){n(i,o,a,u,s,"throw",e)}u(undefined)})}}function a(e,t,r){t=c(t);return m(e,O()?Reflect.construct(t,r||[],c(e).constructor):t.apply(e,r))}function i(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function u(e,t,r){if(O()){u=Reflect.construct}else{u=function e(e,t,r){var n=[null];n.push.apply(n,t);var o=Function.bind.apply(e,n);var a=new o;if(r)b(a,r.prototype);return a}}return u.apply(null,arguments)}function s(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function c(e){c=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return c(e)}function l(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)b(e,t)}function f(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function d(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 v(){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 p(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}n.forEach(function(t){s(e,t,r[t])})}return e}function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(t){n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}r.push.apply(r,n)}return r}function y(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{h(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function m(e,t){if(t&&(g(t)==="object"||typeof t==="function")){return t}return r(e)}function b(e,t){b=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return b(e,t)}function w(e,r){return t(e)||d(e,r)||_(e,r)||v()}function g(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function _(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 E(e){var t=typeof Map==="function"?new Map:undefined;E=function e(e){if(e===null||!f(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return u(e,arguments,c(this).constructor)}r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:false,writable:true,configurable:true}});return b(r,e)};return E(e)}function O(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(O=function(){return!!e})()}function P(e,t){var r,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=u(0),i["throw"]=u(1),i["return"]=u(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function u(e){return function(t){return s([e,t])}}function s(u){if(r)throw new TypeError("Generator is already executing.");while(i&&(i=0,u[0]&&(a=0)),a)try{if(r=1,n&&(o=u[0]&2?n["return"]:u[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;if(n=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:a.label++;return{value:u[1],done:false};case 5:a.label++;n=u[1];u=[0];continue;case 7:u=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){a=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(u[0]===6&&a.label<o[1]){a.label=o[1];o=u;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(u);break}if(o[2])a.ops.pop();a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e];n=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}var j=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var A=function(e,t,r){return t in e?j(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r};var D=function(e,t){for(var r in t)j(e,r,{get:t[r],enumerable:!0})},M=function(e,t,r,n){var o=true,a=false,i=undefined;if(t&&(typeof t==="undefined"?"undefined":g(t))=="object"||typeof t=="function")try{var u=function(){var o=c.value;!k.call(e,o)&&o!==r&&j(e,o,{get:function(){return t[o]},enumerable:!(n=S(t,o))||n.enumerable})};for(var s=C(t)[Symbol.iterator](),c;!(o=(c=s.next()).done);o=true)u()}catch(e){a=true;i=e}finally{try{if(!o&&s.return!=null){s.return()}}finally{if(a){throw i}}}return e};var R=function(e){return M(j({},"__esModule",{value:!0}),e)};var T=function(e,t,r){return A(e,(typeof t==="undefined"?"undefined":g(t))!="symbol"?t+"":t,r)};var I={};D(I,{EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING:function(){return et},EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST:function(){return ee},getAddress:function(){return Q},getEmail:function(){return $},getEmbeddedCheckoutIframeUrl:function(){return Z},isWhopCheckoutMessage:function(){return N},onWhopCheckoutMessage:function(){return q},setAddress:function(){return J},setEmail:function(){return z},submitCheckoutFrame:function(){return Y}});module.exports=R(I);var U=/*#__PURE__*/function(e){l(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);T(e,"type","WhopCheckoutError");return e}return t}(E(Error));var W=/*#__PURE__*/function(e){l(t,e);function t(e){i(this,t);var r;r=a(this,t,[e!==null&&e!==void 0?e:"Timeout waiting for embed response"]);T(r,"name","WhopCheckoutRpcTimeoutError");return r}return t}(U);var x=/*#__PURE__*/function(e){l(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);T(e,"name","WhopCheckoutSetEmailError");return e}return t}(U);var L=/*#__PURE__*/function(e){l(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);T(e,"name","WhopCheckoutSetAddressError");return e}return t}(U);var B=/*#__PURE__*/function(e){l(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);T(e,"name","WhopCheckoutGetAddressError");return e}return t}(U);var F=["resize","center","complete","state","get-email-result","set-email-result","set-address-result","get-address-result","address-validation-error"];function N(e){return g(e.data)=="object"&&e.data!==null&&"event"in e.data&&F.includes(e.data.event)}function H(e,t){return N(e)&&e.data.event===t}var K=[];function G(e){return K[e]||(K[e]=(e+256).toString(16).slice(1))}function X(){var e=new Uint8Array(16);if((typeof crypto==="undefined"?"undefined":g(crypto))<"u"&&typeof crypto.getRandomValues=="function")crypto.getRandomValues(e);else for(var t=0;t<16;t++)e[t]=Math.random()*256|0;return e[6]=e[6]&15|64,e[8]=e[8]&63|128,G(e[0])+G(e[1])+G(e[2])+G(e[3])+"-"+G(e[4])+G(e[5])+"-"+G(e[6])+G(e[7])+"-"+G(e[8])+G(e[9])+"-"+G(e[10])+G(e[11])+G(e[12])+G(e[13])+G(e[14])+G(e[15])}function V(e,t,r,n){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:2e3;var a;var i=new URL(e.src).origin,u=X();return(a=e.contentWindow)===null||a===void 0?void 0:a.postMessage(y(p({},t),{__scope:"whop-embedded-checkout",event_id:u}),i),new Promise(function(t,a){var i=setTimeout(function(){a(new W),window.removeEventListener("message",s)},o),s=function(o){if(o.source===e.contentWindow&&H(o,r)&&o.data.event===r&&o.data.event_id===u){clearTimeout(i),window.removeEventListener("message",s);try{t(n(o.data))}catch(e){a(e)}}};window.addEventListener("message",s)})}function q(e,t){function r(r){r.source===e.contentWindow&&N(r)&&t(r.data)}return window.addEventListener("message",r),function(){window.removeEventListener("message",r)}}function z(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return o(function(){return P(this,function(n){return[2,V(e,{event:"set-email",email:t},"set-email-result",function(e){if(!e.ok)throw new x(e.error)},r)]})})()}function $(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return o(function(){return P(this,function(r){return[2,V(e,{event:"get-email"},"get-email-result",function(e){return e.email},t)]})})()}function J(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return o(function(){return P(this,function(n){return[2,V(e,{event:"set-address",address:t},"set-address-result",function(e){if(!e.ok)throw new L(e.error)},r)]})})()}function Q(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return o(function(){return P(this,function(r){return[2,V(e,{event:"get-address"},"get-address-result",function(e){if(!e.ok)throw new B(e.error);return{address:e.address,isComplete:e.is_complete}},t)]})})()}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 Z(e,t,r,n,o,a,i,u,s,c,l,f,d,v,p,h){var y,m,b,g,_,E,O;var P=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(P.searchParams.set("h",window.location.origin),t&&P.searchParams.set("theme",t),r&&P.searchParams.set("session",r),o&&P.searchParams.set("hide_price","true"),a&&P.searchParams.set("skip_redirect","true"),l&&P.searchParams.set("hide_submit_button","true"),f&&P.searchParams.set("hide_tos","true"),d&&P.searchParams.set("email.hidden","1"),v&&P.searchParams.set("email.disabled","1"),p&&P.searchParams.set("address.hidden","1"),h&&P.searchParams.set("a",h),i){var j=true,S=false,C=undefined,k=true,A=false,D=undefined;try{for(var M=Object.entries(i).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),R;!(k=(R=M.next()).done);k=true){var T=w(R.value,2),I=T[0],U=T[1];if(I.startsWith("utm_"))if(Array.isArray(U))try{for(var W=U[Symbol.iterator](),x;!(j=(x=W.next()).done);j=true){var L=x.value;P.searchParams.append(I,L)}}catch(e){S=true;C=e}finally{try{if(!j&&W.return!=null){W.return()}}finally{if(S){throw C}}}else P.searchParams.set(I,U)}}catch(e){A=true;D=e}finally{try{if(!k&&M.return!=null){M.return()}}finally{if(A){throw D}}}}if(u){var B=true,F=false,N=undefined,H=true,K=false,G=undefined;try{for(var X=Object.entries(u)[Symbol.iterator](),V;!(H=(V=X.next()).done);H=true){var q=w(V.value,2),z=q[0],$=q[1];if($)try{for(var J=Object.entries($)[Symbol.iterator](),Q;!(B=(Q=J.next()).done);B=true){var Y=w(Q.value,2),Z=Y[0],ee=Y[1];P.searchParams.set("style.".concat(z,".").concat(Z),ee.toString())}}catch(e){F=true;N=e}finally{try{if(!B&&J.return!=null){J.return()}}finally{if(F){throw N}}}}}catch(e){K=true;G=e}finally{try{if(!H&&X.return!=null){X.return()}}finally{if(K){throw G}}}}var et=true,er=false,en=undefined;if((s===null||s===void 0?void 0:s.email)&&P.searchParams.set("email",s.email),(s===null||s===void 0?void 0:(y=s.address)===null||y===void 0?void 0:y.name)&&P.searchParams.set("name",s.address.name),(s===null||s===void 0?void 0:(m=s.address)===null||m===void 0?void 0:m.line1)&&P.searchParams.set("address.line1",s.address.line1),(s===null||s===void 0?void 0:(b=s.address)===null||b===void 0?void 0:b.line2)&&P.searchParams.set("address.line2",s.address.line2),(s===null||s===void 0?void 0:(g=s.address)===null||g===void 0?void 0:g.city)&&P.searchParams.set("address.city",s.address.city),(s===null||s===void 0?void 0:(_=s.address)===null||_===void 0?void 0:_.country)&&P.searchParams.set("address.country",s.address.country),(s===null||s===void 0?void 0:(E=s.address)===null||E===void 0?void 0:E.state)&&P.searchParams.set("address.state",s.address.state),(s===null||s===void 0?void 0:(O=s.address)===null||O===void 0?void 0:O.postalCode)&&P.searchParams.set("address.postal_code",s.address.postalCode),c)try{for(var eo=Object.entries(c)[Symbol.iterator](),ea;!(et=(ea=eo.next()).done);et=true){var ei=w(ea.value,2),eu=ei[0],es=ei[1];es&&P.searchParams.set("theme.".concat(eu),typeof es=="boolean"?"1":es)}}catch(e){er=true;en=e}finally{try{if(!et&&eo.return!=null){eo.return()}}finally{if(er){throw en}}}return P.toString()}var ee=["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"],et="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,getAddress:getAddress,getEmail:getEmail,getEmbeddedCheckoutIframeUrl:getEmbeddedCheckoutIframeUrl,isWhopCheckoutMessage:isWhopCheckoutMessage,onWhopCheckoutMessage:onWhopCheckoutMessage,setAddress:setAddress,setEmail:setEmail,submitCheckoutFrame:submitCheckoutFrame});
@@ -1 +1 @@
1
- export { m as EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING, E as EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST, e as WhopCheckoutMessage, b as WhopCheckoutState, W as WhopCheckoutSubmitDetails, d as WhopEmbeddedCheckoutPrefillOptions, c as WhopEmbeddedCheckoutStyleOptions, k as WhopEmbeddedCheckoutThemeOptions, h as getAddress, g as getEmail, l as getEmbeddedCheckoutIframeUrl, i as isWhopCheckoutMessage, o as onWhopCheckoutMessage, f as setAddress, s as setEmail, j as submitCheckoutFrame } from './util-B5tOGbpF.mjs';
1
+ export { m as EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING, E as EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST, e as WhopCheckoutMessage, b as WhopCheckoutState, W as WhopCheckoutSubmitDetails, d as WhopEmbeddedCheckoutPrefillOptions, c as WhopEmbeddedCheckoutStyleOptions, k as WhopEmbeddedCheckoutThemeOptions, h as getAddress, g as getEmail, l as getEmbeddedCheckoutIframeUrl, i as isWhopCheckoutMessage, o as onWhopCheckoutMessage, f as setAddress, s as setEmail, j as submitCheckoutFrame } from './util-CWsI1rJe.mjs';
@@ -1 +1 @@
1
- export { m as EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING, E as EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST, e as WhopCheckoutMessage, b as WhopCheckoutState, W as WhopCheckoutSubmitDetails, d as WhopEmbeddedCheckoutPrefillOptions, c as WhopEmbeddedCheckoutStyleOptions, k as WhopEmbeddedCheckoutThemeOptions, h as getAddress, g as getEmail, l as getEmbeddedCheckoutIframeUrl, i as isWhopCheckoutMessage, o as onWhopCheckoutMessage, f as setAddress, s as setEmail, j as submitCheckoutFrame } from './util-B5tOGbpF.js';
1
+ export { m as EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING, E as EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST, e as WhopCheckoutMessage, b as WhopCheckoutState, W as WhopCheckoutSubmitDetails, d as WhopEmbeddedCheckoutPrefillOptions, c as WhopEmbeddedCheckoutStyleOptions, k as WhopEmbeddedCheckoutThemeOptions, h as getAddress, g as getEmail, l as getEmbeddedCheckoutIframeUrl, i as isWhopCheckoutMessage, o as onWhopCheckoutMessage, f as setAddress, s as setEmail, j as submitCheckoutFrame } from './util-CWsI1rJe.js';
@@ -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){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function n(e,t,r,n,o,a,i){try{var u=e[a](i);var s=u.value}catch(e){r(e);return}if(u.done){t(s)}else{Promise.resolve(s).then(n,o)}}function o(e){return function(){var t=this,r=arguments;return new Promise(function(o,a){var i=e.apply(t,r);function u(e){n(i,o,a,u,s,"next",e)}function s(e){n(i,o,a,u,s,"throw",e)}u(undefined)})}}function a(e,t,r){t=c(t);return m(e,_()?Reflect.construct(t,r||[],c(e).constructor):t.apply(e,r))}function i(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function u(e,t,r){if(_()){u=Reflect.construct}else{u=function e(e,t,r){var n=[null];n.push.apply(n,t);var o=Function.bind.apply(e,n);var a=new o;if(r)b(a,r.prototype);return a}}return u.apply(null,arguments)}function s(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function c(e){c=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return c(e)}function l(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)b(e,t)}function f(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function d(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 v(){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 p(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}n.forEach(function(t){s(e,t,r[t])})}return e}function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(t){n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}r.push.apply(r,n)}return r}function h(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{y(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function m(e,t){if(t&&(g(t)==="object"||typeof t==="function")){return t}return r(e)}function b(e,t){b=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return b(e,t)}function w(e,r){return t(e)||d(e,r)||P(e,r)||v()}function g(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function P(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 O(e){var t=typeof Map==="function"?new Map:undefined;O=function e(e){if(e===null||!f(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return u(e,arguments,c(this).constructor)}r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:false,writable:true,configurable:true}});return b(r,e)};return O(e)}function _(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_=function(){return!!e})()}function j(e,t){var r,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=u(0),i["throw"]=u(1),i["return"]=u(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function u(e){return function(t){return s([e,t])}}function s(u){if(r)throw new TypeError("Generator is already executing.");while(i&&(i=0,u[0]&&(a=0)),a)try{if(r=1,n&&(o=u[0]&2?n["return"]:u[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;if(n=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:a.label++;return{value:u[1],done:false};case 5:a.label++;n=u[1];u=[0];continue;case 7:u=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){a=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(u[0]===6&&a.label<o[1]){a.label=o[1];o=u;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(u);break}if(o[2])a.ops.pop();a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e];n=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}(function(){var e=function e(e){return g(e.data)=="object"&&e.data!==null&&"event"in e.data&&A.includes(e.data.event)};var t=function t(t,r){return e(t)&&t.data.event===r};var r=function e(e){return C[e]||(C[e]=(e+256).toString(16).slice(1))};var n=function e(){var e=new Uint8Array(16);if((typeof crypto==="undefined"?"undefined":g(crypto))<"u"&&typeof crypto.getRandomValues=="function")crypto.getRandomValues(e);else for(var t=0;t<16;t++)e[t]=Math.random()*256|0;return e[6]=e[6]&15|64,e[8]=e[8]&63|128,r(e[0])+r(e[1])+r(e[2])+r(e[3])+"-"+r(e[4])+r(e[5])+"-"+r(e[6])+r(e[7])+"-"+r(e[8])+r(e[9])+"-"+r(e[10])+r(e[11])+r(e[12])+r(e[13])+r(e[14])+r(e[15])};var u=function e(e,r,o,a){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:2e3;var u;var s=new URL(e.src).origin,c=n();return(u=e.contentWindow)===null||u===void 0?void 0:u.postMessage(h(p({},r),{__scope:"whop-embedded-checkout",event_id:c}),s),new Promise(function(r,n){var u=setTimeout(function(){n(new E),window.removeEventListener("message",s)},i),s=function(i){if(i.source===e.contentWindow&&t(i,o)&&i.data.event===o&&i.data.event_id===c){clearTimeout(u),window.removeEventListener("message",s);try{r(a(i.data))}catch(e){n(e)}}};window.addEventListener("message",s)})};var s=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 c=function e(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return o(function(){return j(this,function(n){return[2,u(e,{event:"set-email",email:t},"set-email-result",function(e){if(!e.ok)throw new k(e.error)},r)]})})()};var f=function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return o(function(){return j(this,function(r){return[2,u(e,{event:"get-email"},"get-email-result",function(e){return e.email},t)]})})()};var d=function e(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return o(function(){return j(this,function(n){return[2,u(e,{event:"set-address",address:t},"set-address-result",function(e){if(!e.ok)throw new R(e.error)},r)]})})()};var v=function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return o(function(){return j(this,function(r){return[2,u(e,{event:"get-address"},"get-address-result",function(e){if(!e.ok)throw new x(e.error);return{address:e.address,isComplete:e.is_complete}},t)]})})()};var y=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 m=function e(e,t,r,n,o,a,i,u,s,c,l,f,d,v,p,y){var h,m,b,g,P,O,_;var j=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(j.searchParams.set("h",window.location.origin),t&&j.searchParams.set("theme",t),r&&j.searchParams.set("session",r),o&&j.searchParams.set("hide_price","true"),a&&j.searchParams.set("skip_redirect","true"),l&&j.searchParams.set("hide_submit_button","true"),f&&j.searchParams.set("hide_tos","true"),d&&j.searchParams.set("email.hidden","1"),v&&j.searchParams.set("email.disabled","1"),p&&j.searchParams.set("address.hidden","1"),y&&j.searchParams.set("a",y),i){var S=true,E=false,k=undefined,R=true,x=false,A=undefined;try{for(var C=Object.entries(i).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),U;!(R=(U=C.next()).done);R=true){var W=w(U.value,2),T=W[0],L=W[1];if(T.startsWith("utm_"))if(Array.isArray(L))try{for(var M=L[Symbol.iterator](),D;!(S=(D=M.next()).done);S=true){var I=D.value;j.searchParams.append(T,I)}}catch(e){E=true;k=e}finally{try{if(!S&&M.return!=null){M.return()}}finally{if(E){throw k}}}else j.searchParams.set(T,L)}}catch(e){x=true;A=e}finally{try{if(!R&&C.return!=null){C.return()}}finally{if(x){throw A}}}}if(u){var B=true,F=false,G=undefined,V=true,q=false,z=undefined;try{for(var $=Object.entries(u)[Symbol.iterator](),H;!(V=(H=$.next()).done);V=true){var J=w(H.value,2),K=J[0],N=J[1];if(N)try{for(var Q=Object.entries(N)[Symbol.iterator](),X;!(B=(X=Q.next()).done);B=true){var Y=w(X.value,2),Z=Y[0],ee=Y[1];j.searchParams.set("style.".concat(K,".").concat(Z),ee.toString())}}catch(e){F=true;G=e}finally{try{if(!B&&Q.return!=null){Q.return()}}finally{if(F){throw G}}}}}catch(e){q=true;z=e}finally{try{if(!V&&$.return!=null){$.return()}}finally{if(q){throw z}}}}var et=true,er=false,en=undefined;if((s===null||s===void 0?void 0:s.email)&&j.searchParams.set("email",s.email),(s===null||s===void 0?void 0:(h=s.address)===null||h===void 0?void 0:h.name)&&j.searchParams.set("name",s.address.name),(s===null||s===void 0?void 0:(m=s.address)===null||m===void 0?void 0:m.line1)&&j.searchParams.set("address.line1",s.address.line1),(s===null||s===void 0?void 0:(b=s.address)===null||b===void 0?void 0:b.line2)&&j.searchParams.set("address.line2",s.address.line2),(s===null||s===void 0?void 0:(g=s.address)===null||g===void 0?void 0:g.city)&&j.searchParams.set("address.city",s.address.city),(s===null||s===void 0?void 0:(P=s.address)===null||P===void 0?void 0:P.country)&&j.searchParams.set("address.country",s.address.country),(s===null||s===void 0?void 0:(O=s.address)===null||O===void 0?void 0:O.state)&&j.searchParams.set("address.state",s.address.state),(s===null||s===void 0?void 0:(_=s.address)===null||_===void 0?void 0:_.postalCode)&&j.searchParams.set("address.postal_code",s.address.postalCode),c)try{for(var eo=Object.entries(c)[Symbol.iterator](),ea;!(et=(ea=eo.next()).done);et=true){var ei=w(ea.value,2),eu=ei[0],es=ei[1];es&&j.searchParams.set("theme.".concat(eu),es)}}catch(e){er=true;en=e}finally{try{if(!et&&eo.return!=null){eo.return()}}finally{if(er){throw en}}}return j.toString()};var b=Object.defineProperty;var P=function(e,t,r){return t in e?b(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r};var _=function(e,t,r){return P(e,(typeof t==="undefined"?"undefined":g(t))!="symbol"?t+"":t,r)};var S=/*#__PURE__*/function(e){l(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);_(e,"type","WhopCheckoutError");return e}return t}(O(Error));var E=/*#__PURE__*/function(e){l(t,e);function t(e){i(this,t);var r;r=a(this,t,[e!==null&&e!==void 0?e:"Timeout waiting for embed response"]);_(r,"name","WhopCheckoutRpcTimeoutError");return r}return t}(S);var k=/*#__PURE__*/function(e){l(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);_(e,"name","WhopCheckoutSetEmailError");return e}return t}(S);var R=/*#__PURE__*/function(e){l(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);_(e,"name","WhopCheckoutSetAddressError");return e}return t}(S);var x=/*#__PURE__*/function(e){l(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);_(e,"name","WhopCheckoutGetAddressError");return e}return t}(S);var A=["resize","center","complete","state","get-email-result","set-email-result","set-address-result","get-address-result","address-validation-error"];var C=[];var U=["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"],W="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;"})();
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){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function n(e,t,r,n,o,a,i){try{var u=e[a](i);var s=u.value}catch(e){r(e);return}if(u.done){t(s)}else{Promise.resolve(s).then(n,o)}}function o(e){return function(){var t=this,r=arguments;return new Promise(function(o,a){var i=e.apply(t,r);function u(e){n(i,o,a,u,s,"next",e)}function s(e){n(i,o,a,u,s,"throw",e)}u(undefined)})}}function a(e,t,r){t=c(t);return m(e,_()?Reflect.construct(t,r||[],c(e).constructor):t.apply(e,r))}function i(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function u(e,t,r){if(_()){u=Reflect.construct}else{u=function e(e,t,r){var n=[null];n.push.apply(n,t);var o=Function.bind.apply(e,n);var a=new o;if(r)b(a,r.prototype);return a}}return u.apply(null,arguments)}function s(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function c(e){c=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return c(e)}function l(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)b(e,t)}function f(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function d(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 v(){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 p(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}n.forEach(function(t){s(e,t,r[t])})}return e}function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(t){n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}r.push.apply(r,n)}return r}function h(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{y(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function m(e,t){if(t&&(g(t)==="object"||typeof t==="function")){return t}return r(e)}function b(e,t){b=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return b(e,t)}function w(e,r){return t(e)||d(e,r)||P(e,r)||v()}function g(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function P(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 O(e){var t=typeof Map==="function"?new Map:undefined;O=function e(e){if(e===null||!f(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return u(e,arguments,c(this).constructor)}r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:false,writable:true,configurable:true}});return b(r,e)};return O(e)}function _(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_=function(){return!!e})()}function j(e,t){var r,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=u(0),i["throw"]=u(1),i["return"]=u(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function u(e){return function(t){return s([e,t])}}function s(u){if(r)throw new TypeError("Generator is already executing.");while(i&&(i=0,u[0]&&(a=0)),a)try{if(r=1,n&&(o=u[0]&2?n["return"]:u[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;if(n=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:a.label++;return{value:u[1],done:false};case 5:a.label++;n=u[1];u=[0];continue;case 7:u=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){a=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(u[0]===6&&a.label<o[1]){a.label=o[1];o=u;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(u);break}if(o[2])a.ops.pop();a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e];n=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}(function(){var e=function e(e){return g(e.data)=="object"&&e.data!==null&&"event"in e.data&&A.includes(e.data.event)};var t=function t(t,r){return e(t)&&t.data.event===r};var r=function e(e){return C[e]||(C[e]=(e+256).toString(16).slice(1))};var n=function e(){var e=new Uint8Array(16);if((typeof crypto==="undefined"?"undefined":g(crypto))<"u"&&typeof crypto.getRandomValues=="function")crypto.getRandomValues(e);else for(var t=0;t<16;t++)e[t]=Math.random()*256|0;return e[6]=e[6]&15|64,e[8]=e[8]&63|128,r(e[0])+r(e[1])+r(e[2])+r(e[3])+"-"+r(e[4])+r(e[5])+"-"+r(e[6])+r(e[7])+"-"+r(e[8])+r(e[9])+"-"+r(e[10])+r(e[11])+r(e[12])+r(e[13])+r(e[14])+r(e[15])};var u=function e(e,r,o,a){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:2e3;var u;var s=new URL(e.src).origin,c=n();return(u=e.contentWindow)===null||u===void 0?void 0:u.postMessage(h(p({},r),{__scope:"whop-embedded-checkout",event_id:c}),s),new Promise(function(r,n){var u=setTimeout(function(){n(new E),window.removeEventListener("message",s)},i),s=function(i){if(i.source===e.contentWindow&&t(i,o)&&i.data.event===o&&i.data.event_id===c){clearTimeout(u),window.removeEventListener("message",s);try{r(a(i.data))}catch(e){n(e)}}};window.addEventListener("message",s)})};var s=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 c=function e(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return o(function(){return j(this,function(n){return[2,u(e,{event:"set-email",email:t},"set-email-result",function(e){if(!e.ok)throw new k(e.error)},r)]})})()};var f=function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return o(function(){return j(this,function(r){return[2,u(e,{event:"get-email"},"get-email-result",function(e){return e.email},t)]})})()};var d=function e(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2e3;return o(function(){return j(this,function(n){return[2,u(e,{event:"set-address",address:t},"set-address-result",function(e){if(!e.ok)throw new R(e.error)},r)]})})()};var v=function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2e3;return o(function(){return j(this,function(r){return[2,u(e,{event:"get-address"},"get-address-result",function(e){if(!e.ok)throw new x(e.error);return{address:e.address,isComplete:e.is_complete}},t)]})})()};var y=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 m=function e(e,t,r,n,o,a,i,u,s,c,l,f,d,v,p,y){var h,m,b,g,P,O,_;var j=new URL("/embedded/checkout/".concat(e,"/"),n!==null&&n!==void 0?n:"https://whop.com/");if(j.searchParams.set("h",window.location.origin),t&&j.searchParams.set("theme",t),r&&j.searchParams.set("session",r),o&&j.searchParams.set("hide_price","true"),a&&j.searchParams.set("skip_redirect","true"),l&&j.searchParams.set("hide_submit_button","true"),f&&j.searchParams.set("hide_tos","true"),d&&j.searchParams.set("email.hidden","1"),v&&j.searchParams.set("email.disabled","1"),p&&j.searchParams.set("address.hidden","1"),y&&j.searchParams.set("a",y),i){var S=true,E=false,k=undefined,R=true,x=false,A=undefined;try{for(var C=Object.entries(i).sort(function(e,t){return e[0].localeCompare(t[0])})[Symbol.iterator](),U;!(R=(U=C.next()).done);R=true){var W=w(U.value,2),T=W[0],L=W[1];if(T.startsWith("utm_"))if(Array.isArray(L))try{for(var M=L[Symbol.iterator](),D;!(S=(D=M.next()).done);S=true){var I=D.value;j.searchParams.append(T,I)}}catch(e){E=true;k=e}finally{try{if(!S&&M.return!=null){M.return()}}finally{if(E){throw k}}}else j.searchParams.set(T,L)}}catch(e){x=true;A=e}finally{try{if(!R&&C.return!=null){C.return()}}finally{if(x){throw A}}}}if(u){var B=true,F=false,G=undefined,V=true,q=false,z=undefined;try{for(var $=Object.entries(u)[Symbol.iterator](),H;!(V=(H=$.next()).done);V=true){var J=w(H.value,2),K=J[0],N=J[1];if(N)try{for(var Q=Object.entries(N)[Symbol.iterator](),X;!(B=(X=Q.next()).done);B=true){var Y=w(X.value,2),Z=Y[0],ee=Y[1];j.searchParams.set("style.".concat(K,".").concat(Z),ee.toString())}}catch(e){F=true;G=e}finally{try{if(!B&&Q.return!=null){Q.return()}}finally{if(F){throw G}}}}}catch(e){q=true;z=e}finally{try{if(!V&&$.return!=null){$.return()}}finally{if(q){throw z}}}}var et=true,er=false,en=undefined;if((s===null||s===void 0?void 0:s.email)&&j.searchParams.set("email",s.email),(s===null||s===void 0?void 0:(h=s.address)===null||h===void 0?void 0:h.name)&&j.searchParams.set("name",s.address.name),(s===null||s===void 0?void 0:(m=s.address)===null||m===void 0?void 0:m.line1)&&j.searchParams.set("address.line1",s.address.line1),(s===null||s===void 0?void 0:(b=s.address)===null||b===void 0?void 0:b.line2)&&j.searchParams.set("address.line2",s.address.line2),(s===null||s===void 0?void 0:(g=s.address)===null||g===void 0?void 0:g.city)&&j.searchParams.set("address.city",s.address.city),(s===null||s===void 0?void 0:(P=s.address)===null||P===void 0?void 0:P.country)&&j.searchParams.set("address.country",s.address.country),(s===null||s===void 0?void 0:(O=s.address)===null||O===void 0?void 0:O.state)&&j.searchParams.set("address.state",s.address.state),(s===null||s===void 0?void 0:(_=s.address)===null||_===void 0?void 0:_.postalCode)&&j.searchParams.set("address.postal_code",s.address.postalCode),c)try{for(var eo=Object.entries(c)[Symbol.iterator](),ea;!(et=(ea=eo.next()).done);et=true){var ei=w(ea.value,2),eu=ei[0],es=ei[1];es&&j.searchParams.set("theme.".concat(eu),typeof es=="boolean"?"1":es)}}catch(e){er=true;en=e}finally{try{if(!et&&eo.return!=null){eo.return()}}finally{if(er){throw en}}}return j.toString()};var b=Object.defineProperty;var P=function(e,t,r){return t in e?b(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r};var _=function(e,t,r){return P(e,(typeof t==="undefined"?"undefined":g(t))!="symbol"?t+"":t,r)};var S=/*#__PURE__*/function(e){l(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);_(e,"type","WhopCheckoutError");return e}return t}(O(Error));var E=/*#__PURE__*/function(e){l(t,e);function t(e){i(this,t);var r;r=a(this,t,[e!==null&&e!==void 0?e:"Timeout waiting for embed response"]);_(r,"name","WhopCheckoutRpcTimeoutError");return r}return t}(S);var k=/*#__PURE__*/function(e){l(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);_(e,"name","WhopCheckoutSetEmailError");return e}return t}(S);var R=/*#__PURE__*/function(e){l(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);_(e,"name","WhopCheckoutSetAddressError");return e}return t}(S);var x=/*#__PURE__*/function(e){l(t,e);function t(){i(this,t);var e;e=a(this,t,arguments);_(e,"name","WhopCheckoutGetAddressError");return e}return t}(S);var A=["resize","center","complete","state","get-email-result","set-email-result","set-address-result","get-address-result","address-validation-error"];var C=[];var U=["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"],W="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;"})();
@@ -1 +1 @@
1
- import{a as s,b as e,c as a,d as E,e as t,f as o,g as m,h as d,i as h,j as r}from"./chunk-D7BU562Q.mjs";export{r as EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING,h as EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST,o as getAddress,E as getEmail,d as getEmbeddedCheckoutIframeUrl,s as isWhopCheckoutMessage,e as onWhopCheckoutMessage,t as setAddress,a as setEmail,m as submitCheckoutFrame};
1
+ import{a as s,b as e,c as a,d as E,e as t,f as o,g as m,h as d,i as h,j as r}from"./chunk-DA7YNHTQ.mjs";export{r as EMBEDDED_CHECKOUT_IFRAME_ALLOW_STRING,h as EMBEDDED_CHECKOUT_IFRAME_SANDBOX_LIST,o as getAddress,E as getEmail,d as getEmbeddedCheckoutIframeUrl,s as isWhopCheckoutMessage,e as onWhopCheckoutMessage,t as setAddress,a as setEmail,m as submitCheckoutFrame};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@whop/checkout",
3
3
  "description": "Embed Whop checkout on any website",
4
- "version": "0.0.40",
4
+ "version": "0.0.41",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/whopio/whop-sdk-ts",