diff --git a/assets/built/portal.min.js b/assets/built/portal.min.js new file mode 100644 index 0000000..fc7677f --- /dev/null +++ b/assets/built/portal.min.js @@ -0,0 +1,3 @@ +/*! For license information please see portal.min.js.LICENSE.txt */ +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=48)}([function(e,t,n){"use strict";e.exports=n(41)},function(e,t,n){"use strict";e.exports=n(34)},function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return i})),n.d(t,"e",(function(){return a})),n.d(t,"c",(function(){return l})),n.d(t,"d",(function(){return c}));var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},r(e,t)};function o(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function l(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(l){o={error:l}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function c(){for(var e=[],t=0;t0&&o.find((function(e){return"Monthly"===e.name})):"yearly"===r?o&&o.length>0&&o.find((function(e){return"Yearly"===e.name})):!!r&&(o&&o.length>0&&o.find((function(e){return e.id===r})))}function j(e){var t=e.site,n=void 0===t?{}:t,r=e.priceId,o=W({site:n});if("free"===r)return!o||0===o.length||o.find((function(e){return"free"===e.type}));if(o&&o.length>0&&"monthly"===r){var i=o.find((function(e){return"Monthly"===e.name})),a=o.find((function(e){return"month"===e.interval}));return i||a}if(o&&o.length>0&&"yearly"===r){var l=o.find((function(e){return"Yearly"===e.name})),c=o.find((function(e){return"year"===e.interval}));return l||c}return o&&o.length>0&&r?o.find((function(e){return e.id===r})):null}function O(e){return"string"===typeof e&&e?e.charAt(0).toUpperCase()+e.slice(1):""}function k(e){var t=e.site,n=void 0===t?{}:t,r=e.pageQuery;return 0===Y({site:n,pageQuery:void 0===r?"":r}).length||n&&"invite"===n.members_signup_access}function _(e){var t=E({site:e.site});return(null===t||void 0===t?void 0:t.length)>1}function S(e){return!!(e.site||{}).portal_products}function P(e){var t,n,r=e.site;if(!r)return null;if(r.tiers&&(r.products=r.tiers),null!==(t=r.products)&&void 0!==t&&null!==(n=t[0])&&void 0!==n&&n.visibility){r.portal_products=r.products.filter((function(e){return"none"!==e.visibility&&"paid"===e.type})).map((function(e){return e.id}));var o,i,a=r.products.find((function(e){return"free"===e.type}));if(a)if(r.portal_plans=null===(o=r.portal_plans)||void 0===o?void 0:o.filter((function(e){return"free"!==e})),"public"===(null===a||void 0===a?void 0:a.visibility))null===(i=r.portal_plans)||void 0===i||i.push("free")}return r}function E(e){var t=e.site||{},n=t.portal_products,o=t.products,i=void 0===o?[]:o,a=t.portal_plans,l=void 0===a?[]:a;return l.includes("monthly")||l.includes("yearly")?i.filter((function(e){return!!e})).filter((function(e){return!(!e.monthlyPrice||!e.yearlyPrice)})).filter((function(e){return!!(Object.keys(e.monthlyPrice).length>0&&Object.keys(e.yearlyPrice).length>0)})).filter((function(e){return!(n&&i.length>1)||n.includes(e.id)})).sort((function(e,t){var n,r;return(null===e||void 0===e||null===(n=e.monthlyPrice)||void 0===n?void 0:n.amount)-(null===t||void 0===t||null===(r=t.monthlyPrice)||void 0===r?void 0:r.amount)})).map((function(e){return e.monthlyPrice=Object(r.a)(Object(r.a)({},e.monthlyPrice),{},{currency_symbol:Z(e.monthlyPrice.currency)}),e.yearlyPrice=Object(r.a)(Object(r.a)({},e.yearlyPrice),{},{currency_symbol:Z(e.yearlyPrice.currency)}),e})):[]}function C(e){var t=(e.site||{}).products;return(void 0===t?[]:t).find((function(e){return"free"===e.type}))}function N(e){var t=e.site||{},n=t.products,o=void 0===n?[]:n,i=t.portal_plans,a=void 0===i?[]:i;return a.includes("monthly")||a.includes("yearly")?o.filter((function(e){return!!e})).filter((function(e){return!(!e.monthlyPrice||!e.yearlyPrice)})).filter((function(e){return!!(Object.keys(e.monthlyPrice).length>0&&Object.keys(e.yearlyPrice).length>0)})).sort((function(e,t){var n,r;return(null===e||void 0===e||null===(n=e.monthlyPrice)||void 0===n?void 0:n.amount)-(null===t||void 0===t||null===(r=t.monthlyPrice)||void 0===r?void 0:r.amount)})).map((function(e){return e.monthlyPrice=Object(r.a)(Object(r.a)({},e.monthlyPrice),{},{currency_symbol:Z(e.monthlyPrice.currency)}),e.yearlyPrice=Object(r.a)(Object(r.a)({},e.yearlyPrice),{},{currency_symbol:Z(e.yearlyPrice.currency)}),e})):[]}function T(e){var t=e.prices;return!!S({site:e.site})&&(!(null===t||void 0===t||!t.length)&&t.some((function(e){var t;return null===e||void 0===e||null===(t=e.benefits)||void 0===t?void 0:t.length})))}function I(e){var t=e.site,n=e.pageQuery,r=E({site:t});return"free"===n&&U({site:t})?[]:(U({site:t})&&r.unshift({id:"free"}),r)}function L(e){var t=C({site:e.site});return(null===t||void 0===t?void 0:t.benefits)||[]}function M(e){return $({site:e.site})?"Free membership":"Free"}function z(e){var t=C({site:e.site});return null===t||void 0===t?void 0:t.description}function F(e){var t,n=C({site:e.site});return!!(null!==n&&void 0!==n&&n.description||null!==n&&void 0!==n&&null!==(t=n.benefits)&&void 0!==t&&t.length)}function D(e){var t=e.product;e.site;if(null!==t&&void 0!==t&&t.monthlyPrice&&null!==t&&void 0!==t&&t.yearlyPrice){var n=(null===t||void 0===t?void 0:t.benefits)||[];return{monthly:n,yearly:n}}}function R(e){var t=e.site,n=e.productId;return N({site:t}).find((function(e){return e.id===n}))}function A(e){var t=e.site,n=void 0===t?null:t,r=e.products,o=void 0===r?null:r;return n||o?(o||E({site:n})).reduce((function(e,t){return t.monthlyPrice&&t.yearlyPrice&&(e.push(t.monthlyPrice),e.push(t.yearlyPrice)),e}),[]):[]}function U(e){var t=e.site||{},n=t.allow_self_signup,r=t.portal_plans;return n&&r.includes("free")}function B(e){return(e.site||{}).newsletters}function H(e){var t=(e.site||{}).newsletters;return(null===t||void 0===t?void 0:t.length)>1}function $(e){var t=e.site;return 1===I({site:t}).length&&U({site:t})}function q(e){var t=e.site,n=e.priceId;return"free"===n?C({site:t}):N({site:t}).find((function(e){var t,r;return(null===e||void 0===e||null===(t=e.monthlyPrice)||void 0===t?void 0:t.id)===n||(null===e||void 0===e||null===(r=e.yearlyPrice)||void 0===r?void 0:r.id)===n}))}function W(e){var t=e.site,n=e.products,o=void 0===n?null:n,i=t||{},a=i.portal_plans,l=void 0===a?[]:a;return i.is_stripe_configured?A({site:t,products:o}).filter((function(e){return!(!e||!e.id)})).map((function(e){return Object(r.a)(Object(r.a)({},e),{},{price_id:e.id,price:e.amount/100,name:e.nickname,currency_symbol:Z(e.currency)})})).filter((function(e){return 0!==e.amount&&"recurring"===e.type})).filter((function(e){return"month"===e.interval?l.includes("monthly"):"year"===e.interval&&l.includes("yearly")})).sort((function(e,t){return e.amount-t.amount})).sort((function(e,t){return e.currency&&t.currency?e.currency.localeCompare(t.currency,void 0,{ignorePunctuation:!0}):0})):[]}function Q(e){var t=W({site:e.site}),n={currency:"usd",currency_symbol:"$"};return(null===t||void 0===t?void 0:t.length)>0&&(n.currency=t[0].currency,n.currency_symbol=t[0].currency_symbol),n}function Y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.site,n=void 0===t?{}:t,o=e.pageQuery,i=void 0===o?"":o,a=n||{},l=a.allow_self_signup,c=a.portal_plans,s=[];if(l&&c.includes("free")){var u=Q({site:n});s.push(Object(r.a)({id:"free",type:"free",price:0,amount:0,name:M({site:n})},u))}var p="free"===i&&U({site:n});if(!p){var d=W({site:n});d.forEach((function(e){s.push(e)}))}return s}var V=function(e){var t=e.member;return t?t.email:""},K=function(e){var t=e.site;return t&&t.firstpromoter_id},J=function(e){var t=e.member;return t?t.name:""},X=function(e){return(e.site||{}).members_support_address||""},G=function(e){var t=e.site;try{return new URL(t.url).origin.replace(/^http(s?):\/\//,"").replace(/\/$/,"")}catch(n){return t.url.replace(/^http(s?):\/\//,"").replace(/\/$/,"")}},Z=function(e){return Intl.NumberFormat("en",{currency:e,style:"currency"}).format(0).replace(/[\d\s.]/g,"")},ee=function(e){return isNaN(e)?0:e/100},te=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Z(e.currency),n=ee(e.amount);return"".concat(t).concat(n,"/").concat(e.interval)},ne=function(e){return void 0===e||null===e?"":e.toLocaleString()},re=function(e){var t=e.type,n=e.status,r=e.autoHide,o=e.duration,i=void 0===o?2600:o,a=e.closeable,l=e.state,c=e.message,s=e.meta,u=void 0===s?{}:s,p=0;return l&&l.popupNotification&&(p=(l.popupNotification.count||0)+1),{type:t,status:n,autoHide:r,closeable:a,duration:i,meta:u,message:c,count:p}};function oe(e,t){return(null===e||void 0===e?void 0:e.toLowerCase())===(null===t||void 0===t?void 0:t.toLowerCase())}function ie(e){var t=e.site,n=e.pageQuery,r=/^(?:(\S+?))?\/monthly$/,i=/^(?:(\S+?))?\/yearly$/;if(r.test(n||"")){var a,l=n.match(r),c=R({site:t,productId:Object(o.a)(l,2)[1]});return null===c||void 0===c||null===(a=c.monthlyPrice)||void 0===a?void 0:a.id}if(i.test(n||"")){var s,u=n.match(i),p=R({site:t,productId:Object(o.a)(u,2)[1]});return null===p||void 0===p||null===(s=p.yearlyPrice)||void 0===s?void 0:s.id}return null}var ae=function(e){var t=e.offer;return"fixed"===t.type?"".concat(Z(t.currency)).concat(t.amount/100):"percent"===t.type?"".concat(t.amount,"%"):""},le=function(e){var t,n=e.offer,r=e.price,o=e.useFormatted,i=void 0!==o&&o,a=r.amount;return t="fixed"===n.type&&oe(n.currency,r.currency)?(t=(a-n.amount)/100)>0?t:0:"percent"===n.type?(a-a*n.amount/100)/100:a/100,i?Intl.NumberFormat("en",{currency:null===r||void 0===r?void 0:r.currency,style:"currency"}).format(t):t},ce=function(e){var t=e.offer;return"active"===(null===t||void 0===t?void 0:t.status)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(12);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t"}try{l.currentTarget=Object(i.c)(a.currentTarget)?Object(o.b)(a.currentTarget):Object.prototype.toString.call(a.currentTarget)}catch(s){l.currentTarget=""}for(var c in"undefined"!==typeof CustomEvent&&Object(i.g)(e,CustomEvent)&&(l.detail=a.detail),a)Object.prototype.hasOwnProperty.call(a,c)&&(l[c]=a[c]);return l}return e}function f(e,t){void 0===t&&(t=40);var n=Object.keys(d(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return Object(a.d)(n[0],t);for(var r=n.length;r>0;r--){var o=n.slice(0,r).join(", ");if(!(o.length>t))return r===n.length?o:Object(a.d)(o,t)}return""}function h(e){var t,n;if(Object(i.h)(e)){var o=e,a={};try{for(var l=Object(r.e)(Object.keys(o)),c=l.next();!c.done;c=l.next()){var s=c.value;"undefined"!==typeof o[s]&&(a[s]=h(o[s]))}}catch(u){t={error:u}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return a}return Array.isArray(e)?e.map(h):e}},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}));function r(){return true}function o(){return"undefined"!==typeof __SENTRY_BROWSER_BUNDLE__&&!!__SENTRY_BROWSER_BUNDLE__}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"d",(function(){return o})),n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return l}));var r=n(8);function o(e,t){return void 0===t&&(t=0),"string"!==typeof e||0===t||e.length<=t?e:e.substr(0,t)+"..."}function i(e,t){var n=e,r=n.length;if(r<=150)return n;t>r&&(t=r);var o=Math.max(t-60,0);o<5&&(o=0);var i=Math.min(o+140,r);return i>r-5&&(i=r),i===r&&(o=Math.max(i-140,0)),n=n.slice(o,i),o>0&&(n="'{snip} "+n),ie.length)&&(t=e.length);for(var n=0,r=new Array(t);n=1&&n<100?n:0}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return l}));var r=n(2);function o(){for(var e=[],t=0;t ".length,c=void 0;n&&o++<5&&!("html"===(c=a(n,t))||o>1&&i+r.length*l+c.length>=80);)r.push(c),i+=c.length,n=n.parentNode;return r.reverse().join(" > ")}catch(s){return""}}function a(e,t){var n,r,i,a,l,c=e,s=[];if(!c||!c.tagName)return"";s.push(c.tagName.toLowerCase());var u=t&&t.length?t.filter((function(e){return c.getAttribute(e)})).map((function(e){return[e,c.getAttribute(e)]})):null;if(u&&u.length)u.forEach((function(e){s.push("["+e[0]+'="'+e[1]+'"]')}));else if(c.id&&s.push("#"+c.id),(n=c.className)&&Object(o.k)(n))for(r=n.split(/\s+/),l=0;l