@saasquatch/mint-components 2.0.0-66 → 2.0.0-67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ShadowViewAddon-23b04c91.js → ShadowViewAddon-cd5c186c.js} +2 -4
- package/dist/cjs/{copy-text-view-51c8ee5d.js → copy-text-view-322436c2.js} +2 -8
- package/dist/cjs/{usePayoutStatus-fe32dd1a.js → data-16106637.js} +142 -0
- package/dist/cjs/{extractProps-fd93ba62.js → extractProps-e9c55ba8.js} +14 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mint-components.cjs.js +1 -1
- package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +10 -14
- package/dist/cjs/{sqm-big-stat_46.cjs.entry.js → sqm-big-stat_47.cjs.entry.js} +1308 -11
- package/dist/cjs/sqm-code-verification.cjs.entry.js +1 -1
- package/dist/cjs/sqm-context-router.cjs.entry.js +1 -1
- package/dist/cjs/sqm-email-verification.cjs.entry.js +1 -1
- package/dist/cjs/sqm-empty_4.cjs.entry.js +1 -1
- package/dist/cjs/sqm-invoice-table-data-cell_5.cjs.entry.js +1 -1
- package/dist/cjs/sqm-lead-checkbox-field.cjs.entry.js +1 -1
- package/dist/cjs/sqm-lead-input-field.cjs.entry.js +1 -1
- package/dist/cjs/sqm-logout-current-user.cjs.entry.js +1 -1
- package/dist/cjs/sqm-navigation-sidebar-item.cjs.entry.js +1 -1
- package/dist/cjs/sqm-pagination_3.cjs.entry.js +2 -2
- package/dist/cjs/sqm-password-field.cjs.entry.js +1 -1
- package/dist/cjs/sqm-popup-container.cjs.entry.js +1 -1
- package/dist/cjs/sqm-portal-google-login.cjs.entry.js +2 -2
- package/dist/cjs/sqm-portal-profile.cjs.entry.js +1 -1
- package/dist/cjs/sqm-portal-reset-password.cjs.entry.js +1 -1
- package/dist/cjs/sqm-portal-verify-email.cjs.entry.js +1 -1
- package/dist/cjs/sqm-qr-code.cjs.entry.js +1 -1
- package/dist/cjs/sqm-referral-table_11.cjs.entry.js +1 -1
- package/dist/cjs/sqm-rewards-table_9.cjs.entry.js +2 -3
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +12 -14
- package/dist/cjs/sqm-tabs.cjs.entry.js +1 -4
- package/dist/cjs/sqm-widget-verification-controller.cjs.entry.js +3 -2
- package/dist/cjs/sqm-widget-verification.cjs.entry.js +3 -4
- package/dist/cjs/{usePortalLogin-353f776a.js → usePortalLogin-1c022d8d.js} +1 -1
- package/dist/cjs/{utils-0d3ac0fb.js → utils-6847bc06.js} +0 -4
- package/dist/collection/components/sqm-big-stat/sqm-big-stat-view.js +0 -2
- package/dist/collection/components/sqm-portal-forgot-password/PortalForgotPassword.stories.js +1 -0
- package/dist/collection/components/sqm-referred-registration/sqm-referred-registration.js +2 -2
- package/dist/collection/components/sqm-rewards-table/cells/sqm-rewards-table-status-cell.js +2 -3
- package/dist/collection/components/sqm-share-link/sqm-share-link.js +0 -1
- package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +0 -1
- package/dist/collection/components/sqm-tabs/sqm-tabs-view.js +0 -3
- package/dist/collection/components/sqm-widget-verification/sqm-widget-verification-controller.js +8 -4
- package/dist/collection/components/tax-and-cash/TaxForm.stories.js +6 -10
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +0 -1
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form.js +1 -4
- package/dist/collection/components/views/copy-text-view.js +2 -8
- package/dist/collection/utils/utils.js +0 -1
- package/dist/esm/{ShadowViewAddon-c0bd62f7.js → ShadowViewAddon-11ffa85d.js} +2 -4
- package/dist/esm/{copy-text-view-83b09456.js → copy-text-view-fac47254.js} +2 -8
- package/dist/esm/{usePayoutStatus-42cc6a2c.js → data-acdb790f.js} +128 -1
- package/dist/esm/{extractProps-ae1afbb3.js → extractProps-54064fb0.js} +14 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/sqm-banking-info-form_10.entry.js +3 -7
- package/dist/esm/{sqm-big-stat_46.entry.js → sqm-big-stat_47.entry.js} +1306 -10
- package/dist/esm/sqm-code-verification.entry.js +1 -1
- package/dist/esm/sqm-context-router.entry.js +1 -1
- package/dist/esm/sqm-email-verification.entry.js +1 -1
- package/dist/esm/sqm-empty_4.entry.js +1 -1
- package/dist/esm/sqm-invoice-table-data-cell_5.entry.js +1 -1
- package/dist/esm/sqm-lead-checkbox-field.entry.js +1 -1
- package/dist/esm/sqm-lead-input-field.entry.js +1 -1
- package/dist/esm/sqm-logout-current-user.entry.js +1 -1
- package/dist/esm/sqm-navigation-sidebar-item.entry.js +1 -1
- package/dist/esm/sqm-pagination_3.entry.js +2 -2
- package/dist/esm/sqm-password-field.entry.js +1 -1
- package/dist/esm/sqm-popup-container.entry.js +1 -1
- package/dist/esm/sqm-portal-google-login.entry.js +2 -2
- package/dist/esm/sqm-portal-profile.entry.js +1 -1
- package/dist/esm/sqm-portal-reset-password.entry.js +1 -1
- package/dist/esm/sqm-portal-verify-email.entry.js +1 -1
- package/dist/esm/sqm-qr-code.entry.js +1 -1
- package/dist/esm/sqm-referral-table_11.entry.js +1 -1
- package/dist/esm/sqm-rewards-table_9.entry.js +2 -3
- package/dist/esm/sqm-stencilbook.entry.js +12 -14
- package/dist/esm/sqm-tabs.entry.js +1 -4
- package/dist/esm/sqm-widget-verification-controller.entry.js +3 -2
- package/dist/esm/sqm-widget-verification.entry.js +2 -3
- package/dist/esm/{usePortalLogin-95814943.js → usePortalLogin-f95bbc67.js} +1 -1
- package/dist/esm/{utils-84b4b092.js → utils-334c1e34.js} +0 -4
- package/dist/esm-es5/{ShadowViewAddon-c0bd62f7.js → ShadowViewAddon-11ffa85d.js} +1 -1
- package/dist/esm-es5/data-acdb790f.js +6 -0
- package/dist/esm-es5/extractProps-54064fb0.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
- package/dist/esm-es5/sqm-big-stat_47.entry.js +1 -0
- package/dist/esm-es5/sqm-code-verification.entry.js +1 -1
- package/dist/esm-es5/sqm-context-router.entry.js +1 -1
- package/dist/esm-es5/sqm-email-verification.entry.js +1 -1
- package/dist/esm-es5/sqm-empty_4.entry.js +1 -1
- package/dist/esm-es5/sqm-invoice-table-data-cell_5.entry.js +1 -1
- package/dist/esm-es5/sqm-lead-checkbox-field.entry.js +1 -1
- package/dist/esm-es5/sqm-lead-input-field.entry.js +1 -1
- package/dist/esm-es5/sqm-logout-current-user.entry.js +1 -1
- package/dist/esm-es5/sqm-navigation-sidebar-item.entry.js +1 -1
- package/dist/esm-es5/sqm-pagination_3.entry.js +1 -1
- package/dist/esm-es5/sqm-password-field.entry.js +1 -1
- package/dist/esm-es5/sqm-popup-container.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-google-login.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-profile.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-reset-password.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-verify-email.entry.js +1 -1
- package/dist/esm-es5/sqm-qr-code.entry.js +1 -1
- package/dist/esm-es5/sqm-referral-table_11.entry.js +1 -1
- package/dist/esm-es5/sqm-rewards-table_9.entry.js +1 -1
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/esm-es5/sqm-tabs.entry.js +1 -1
- package/dist/esm-es5/sqm-widget-verification.entry.js +1 -1
- package/dist/esm-es5/{usePortalLogin-95814943.js → usePortalLogin-f95bbc67.js} +1 -1
- package/dist/esm-es5/utils-334c1e34.js +1 -0
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/{p-6b247deb.entry.js → p-010957a1.entry.js} +6 -6
- package/dist/mint-components/p-0797a946.js +1 -0
- package/dist/mint-components/{p-0ea4d6a1.system.entry.js → p-0b9b1b36.system.entry.js} +1 -1
- package/dist/mint-components/{p-7bae9bb7.system.entry.js → p-14e813a7.system.entry.js} +1 -1
- package/dist/mint-components/{p-622b4066.entry.js → p-16ac4d4f.entry.js} +2 -2
- package/dist/mint-components/{p-35081b0c.system.entry.js → p-18720462.system.entry.js} +1 -1
- package/dist/mint-components/{p-c6fa4cc5.system.js → p-20c40fdf.system.js} +1 -1
- package/dist/mint-components/{p-eba70d67.system.entry.js → p-2700136f.system.entry.js} +1 -1
- package/dist/mint-components/{p-67aa0b2d.entry.js → p-30278955.entry.js} +1 -1
- package/dist/mint-components/{p-2ff72acc.entry.js → p-3b46fae5.entry.js} +2 -2
- package/dist/mint-components/{p-e711d0e9.js → p-44fc6029.js} +1 -1
- package/dist/mint-components/p-469a6450.system.js +6 -0
- package/dist/mint-components/p-4adf23e7.entry.js +273 -0
- package/dist/mint-components/{p-7b8cd420.system.entry.js → p-4ce51b1c.system.entry.js} +1 -1
- package/dist/mint-components/{p-cb845a3a.system.entry.js → p-56009bf0.system.entry.js} +1 -1
- package/dist/mint-components/{p-c86f64ad.system.entry.js → p-5b7a896e.system.entry.js} +1 -1
- package/dist/mint-components/{p-0caad0db.entry.js → p-5d059c95.entry.js} +1 -1
- package/dist/mint-components/{p-f370bddc.entry.js → p-60c14cec.entry.js} +1 -1
- package/dist/mint-components/p-6333265f.system.js +1 -0
- package/dist/mint-components/{p-6b0f79d1.system.entry.js → p-6445e926.system.entry.js} +1 -1
- package/dist/mint-components/{p-a9ad7fb2.system.entry.js → p-674d9089.system.entry.js} +1 -1
- package/dist/mint-components/{p-29f0c87d.entry.js → p-6a0ddee0.entry.js} +1 -1
- package/dist/mint-components/p-6c006998.entry.js +33 -0
- package/dist/mint-components/{p-b1eafaae.entry.js → p-6d9ce4e5.entry.js} +1 -1
- package/dist/mint-components/{p-b703c89f.system.entry.js → p-717b6730.system.entry.js} +1 -1
- package/dist/mint-components/{p-b55002dc.system.entry.js → p-72b914b9.system.entry.js} +1 -1
- package/dist/mint-components/{p-433e7458.entry.js → p-7e323f2c.entry.js} +1 -1
- package/dist/mint-components/{p-c531cc75.entry.js → p-85029918.entry.js} +1 -1
- package/dist/mint-components/{p-ab018deb.entry.js → p-8931d05e.entry.js} +2 -2
- package/dist/mint-components/{p-b487cb00.system.entry.js → p-8afb47c5.system.entry.js} +1 -1
- package/dist/mint-components/{p-cf22cf56.entry.js → p-8b5b2acc.entry.js} +1 -1
- package/dist/mint-components/p-967a9040.system.js +1 -1
- package/dist/mint-components/p-9ba07029.system.entry.js +1 -0
- package/dist/mint-components/{p-6dc742bc.js → p-9ec99ced.js} +1 -1
- package/dist/mint-components/{p-4250b06d.entry.js → p-a217cc8d.entry.js} +1 -1
- package/dist/mint-components/{p-4c9d80e4.entry.js → p-a32afaaa.entry.js} +1 -1
- package/dist/mint-components/{p-61157c6a.entry.js → p-a5c63310.entry.js} +1 -1
- package/dist/mint-components/{p-1c6ef258.system.entry.js → p-ac86903a.system.entry.js} +1 -1
- package/dist/mint-components/{p-76d4ef41.entry.js → p-aefaec37.entry.js} +1 -1
- package/dist/mint-components/{p-bfd77a07.entry.js → p-b00e8365.entry.js} +1 -1
- package/dist/mint-components/{p-66cf70f7.system.entry.js → p-b3510ca0.system.entry.js} +1 -1
- package/dist/mint-components/{p-bb452830.system.js → p-b377570a.system.js} +1 -1
- package/dist/mint-components/{p-06f13966.system.entry.js → p-bec87ac9.system.entry.js} +1 -1
- package/dist/mint-components/{p-f7c0877d.entry.js → p-c95a437e.entry.js} +1 -1
- package/dist/mint-components/p-d2bb770d.system.entry.js +1 -0
- package/dist/mint-components/{p-d4edce6c.system.entry.js → p-d3120982.system.entry.js} +1 -1
- package/dist/mint-components/{p-cf4e1709.entry.js → p-d9780ae9.entry.js} +1 -1
- package/dist/mint-components/{p-978d06ab.entry.js → p-e1422b78.entry.js} +1 -1
- package/dist/mint-components/p-e1e7d01c.js +157 -0
- package/dist/mint-components/{p-84d1041d.system.entry.js → p-e3b4e06a.system.entry.js} +1 -1
- package/dist/mint-components/p-e55aafe9.system.js +1 -0
- package/dist/mint-components/{p-7d735c9c.js → p-e658929b.js} +1 -1
- package/dist/mint-components/{p-b038b72a.system.entry.js → p-e9a596ad.system.entry.js} +1 -1
- package/dist/mint-components/{p-0d21194c.entry.js → p-ea0bc627.entry.js} +1 -1
- package/dist/mint-components/{p-dd30354a.system.entry.js → p-f3613921.system.entry.js} +1 -1
- package/dist/mint-components/{p-55eaba8e.system.entry.js → p-f3c2074b.system.entry.js} +1 -1
- package/dist/mint-components/{p-2623b232.system.entry.js → p-f401ef19.system.entry.js} +1 -1
- package/dist/mint-components/p-f66e02c7.system.entry.js +1 -0
- package/dist/mint-components/{p-c065057d.entry.js → p-f7e49c12.entry.js} +2 -2
- package/dist/types/components/sqm-rewards-table/cells/sqm-rewards-table-status-cell.d.ts +1 -1
- package/dist/types/components/sqm-widget-verification/sqm-widget-verification-controller.d.ts +3 -2
- package/dist/types/components/tax-and-cash/TaxForm.stories.d.ts +1 -0
- package/dist/types/components.d.ts +6 -4
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/package.json +1 -1
- package/dist/cjs/data-88adb95b.js +0 -146
- package/dist/cjs/parseStates-d1effc19.js +0 -16
- package/dist/cjs/sqm-tax-and-cash.cjs.entry.js +0 -1313
- package/dist/esm/data-807686c2.js +0 -130
- package/dist/esm/parseStates-ed75e224.js +0 -14
- package/dist/esm/sqm-tax-and-cash.entry.js +0 -1309
- package/dist/esm-es5/data-807686c2.js +0 -1
- package/dist/esm-es5/extractProps-ae1afbb3.js +0 -1
- package/dist/esm-es5/parseStates-ed75e224.js +0 -1
- package/dist/esm-es5/sqm-big-stat_46.entry.js +0 -1
- package/dist/esm-es5/sqm-tax-and-cash.entry.js +0 -1
- package/dist/esm-es5/usePayoutStatus-42cc6a2c.js +0 -6
- package/dist/esm-es5/utils-84b4b092.js +0 -1
- package/dist/mint-components/p-115dfc03.system.js +0 -1
- package/dist/mint-components/p-13f3a647.js +0 -1
- package/dist/mint-components/p-26468242.js +0 -1
- package/dist/mint-components/p-4306a11d.entry.js +0 -33
- package/dist/mint-components/p-43a9fb8e.system.entry.js +0 -1
- package/dist/mint-components/p-454a6d05.system.entry.js +0 -1
- package/dist/mint-components/p-4b9976cc.system.js +0 -1
- package/dist/mint-components/p-60f1cca2.system.js +0 -1
- package/dist/mint-components/p-75c569f7.entry.js +0 -1
- package/dist/mint-components/p-7837f69e.js +0 -46
- package/dist/mint-components/p-7b8232f8.system.js +0 -6
- package/dist/mint-components/p-8c3c4e92.js +0 -112
- package/dist/mint-components/p-a63a985a.system.entry.js +0 -1
- package/dist/mint-components/p-a8645c1b.system.js +0 -1
- package/dist/mint-components/p-c40ea48b.entry.js +0 -273
- package/dist/mint-components/p-ecc84140.system.entry.js +0 -1
- /package/dist/esm-es5/{copy-text-view-83b09456.js → copy-text-view-fac47254.js} +0 -0
- /package/dist/mint-components/{p-45c3ff6d.js → p-4a0a76a5.js} +0 -0
- /package/dist/mint-components/{p-c210374a.system.js → p-ce81839d.system.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var e,n=1,s=arguments.length;n<s;n++){e=arguments[n];for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o))t[o]=e[o]}return t};return __assign.apply(this,arguments)};import{h,r as registerInstance,c as Host}from"./index-b3a06de8.js";import{i as intl}from"./global-1099f20d.js";import{n as h$1}from"./dom-context-hooks.module-63370afd.js";import"./index.module-c9811a48.js";import{g as getProps}from"./utils-
|
|
1
|
+
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var e,n=1,s=arguments.length;n<s;n++){e=arguments[n];for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o))t[o]=e[o]}return t};return __assign.apply(this,arguments)};import{h,r as registerInstance,c as Host}from"./index-b3a06de8.js";import{i as intl}from"./global-1099f20d.js";import{n as h$1}from"./dom-context-hooks.module-63370afd.js";import"./index.module-c9811a48.js";import{g as getProps}from"./utils-334c1e34.js";import"./JSS-67b5cff8.js";import{P as PortalContainerView,a as PortalSectionView}from"./sqm-portal-container-view-176e92e3.js";function EmptyStateView(t){var e=t.emptyStateHeader,n=t.emptyStateImage,s=t.emptyStateText,o=t.supportText,i=t.missingFeature,a=i===void 0?"":i;return h("sqm-portal-container",{padding:"large",gap:"medium",part:"sqm-base"},h("img",{style:{height:"100px",margin:"auto"},src:n}),h("sqm-titled-section",{style:{maxHeight:"400px"},"label-margin":"xxx-small","text-align":"center"},h("sqm-text",{slot:"label"},h("p",{part:"header-text"},e)),h("sqm-text",{slot:"content"},h("p",{part:"description-text"},intl.formatMessage({id:"emptyStateText",defaultMessage:s},{supportText:h("a",{target:"_blank",href:"mailto:saasquatch-support@impact.com?subject=Next steps for "+a+" feature&body=Hi Support Team, %0D%0A\n %0D%0A \n I am interested to learn more about the "+a+" feature. Please let me know the next steps to access this feature, including any necessary plan upgrades.%0D%0A\n %0D%0A \n - Feature Interested In: "+a+"%0D%0A\n - Company Name: [Please fill out your company name here]%0D%0A\n %0D%0A\n Thank you"},o)})))))}var Empty=function(){function t(t){registerInstance(this,t);this.emptyStateImage="https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png"}t.prototype.render=function(){return h(Host,{slot:"empty"},h(EmptyStateView,{emptyStateImage:this.emptyStateImage,emptyStateHeader:this.emptyStateHeader,emptyStateText:this.emptyStateText,supportText:this.supportText}))};return t}();var PortalContainer=function(){function t(t){registerInstance(this,t);this.ignored=true;this.direction="column";this.gap="xxx-large";this.display="grid";this.maxWidth="100%";this.flexWrap="wrap";h$1(this)}t.prototype.disconnectedCallback=function(){};t.prototype.render=function(){return h(PortalContainerView,Object.assign({},getProps(this)),h("slot",null))};return t}();var Text=function(){function t(t){registerInstance(this,t);this.ignored=true;h$1(this)}t.prototype.disconnectedCallback=function(){};t.prototype.componentWillLoad=function(){};t.prototype.render=function(){var t="\n sqm-text {\n display: block;\n color: "+(this.textColor||"var(--sqm-text)")+";\n }\n\n sqm-text h1 {\n font-size: "+(this.fontSize?this.fontSize+"px":"var(--sl-font-size-xxx-large)")+";\n font-weight: var(--sl-font-weight-semibold);\n color: "+(this.textColor||"var(--sqm-text)")+";\n margin: 0;\n }\n\n sqm-text h2 {\n font-size: "+(this.fontSize?this.fontSize+"px":"var(--sl-font-size-xx-large)")+";\n font-weight: var(--sl-font-weight-semibold);\n color: "+(this.textColor||"var(--sqm-text)")+";\n margin: 0;\n }\n\n sqm-text h3 {\n font-size: "+(this.fontSize?this.fontSize+"px":"var(--sl-font-size-x-large)")+";\n font-weight: var(--sl-font-weight-semibold);\n color: "+(this.textColor||"var(--sqm-text)")+";\n margin: 0;\n }\n\n sqm-text h4 {\n font-size: "+(this.fontSize?this.fontSize+"px":"var(--sl-font-size-large)")+";\n font-weight: var(--sl-font-weight-bold);\n color: "+(this.textColor||"var(--sqm-text)")+";\n margin: 0;\n }\n\n sqm-text p {\n font-size: "+(this.fontSize?this.fontSize+"px":"var(--sl-font-size-medium)")+";\n font-weight: var(--sl-font-weight-normal);\n color: "+(this.textColor||"var(--sqm-text)")+";\n margin: 0;\n }\n\n sqm-text sub {\n font-size: "+(this.fontSize?this.fontSize+"px":"var(--sl-font-size-small)")+";\n font-weight: var(--sl-font-weight-normal);\n color: "+(this.textColor||"var(--sqm-text)")+";\n margin: 0;\n }\n ";return h("div",null,h("style",null,t),h("slot",null))};return t}();var TitledSection=function(){function t(t){registerInstance(this,t);this.textAlign="left";this.labelMargin="small";this.padding="none";h$1(this)}t.prototype.disconnectedCallback=function(){};t.prototype.render=function(){var t=h("slot",{name:"label"},this.label);var e=h("slot",{name:"content"});return h(PortalSectionView,Object.assign({},__assign(__assign({},getProps(this)),{label:t,content:e})))};return t}();export{Empty as sqm_empty,PortalContainer as sqm_portal_container,Text as sqm_text,TitledSection as sqm_titled_section};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance,h as h$1,c as Host}from"./index-b3a06de8.js";import{n as h}from"./dom-context-hooks.module-63370afd.js";import{l as luxonLocale}from"./utils-
|
|
1
|
+
import{r as registerInstance,h as h$1,c as Host}from"./index-b3a06de8.js";import{n as h}from"./dom-context-hooks.module-63370afd.js";import{l as luxonLocale}from"./utils-334c1e34.js";import{l as luxon}from"./luxon-bbf75a9d.js";var InvoiceTableDataCell=function(){function e(e){registerInstance(this,e);this.ignored=true;h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){return this.data};return e}();var RewardTableDateCell=function(){function e(e){registerInstance(this,e);this.ignored=true;this.locale="en";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e,t;var n=!this.date?"-":(t=(e=luxon.DateTime.fromMillis(this.date))===null||e===void 0?void 0:e.setLocale(luxonLocale(this.locale)))===null||t===void 0?void 0:t.toLocaleString(luxon.DateTime.DATE_MED);return n};return e}();var InvoiceTableDownloadCell=function(){function e(e){registerInstance(this,e);this.ignored=true;h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e="svg:hover, svg:hover * {\n cursor: pointer;\n }";return h$1(Host,null,h$1("style",null,e),!!this.downloadUrl&&h$1("a",{href:this.downloadUrl,target:"_blank"},h$1("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h$1("path",{d:"M0.625 12.4375C0.79076 12.4375 0.949732 12.5033 1.06694 12.6206C1.18415 12.7378 1.25 12.8967 1.25 13.0625V16.1875C1.25 16.519 1.3817 16.837 1.61612 17.0714C1.85054 17.3058 2.16848 17.4375 2.5 17.4375H17.5C17.8315 17.4375 18.1495 17.3058 18.3839 17.0714C18.6183 16.837 18.75 16.519 18.75 16.1875V13.0625C18.75 12.8967 18.8158 12.7378 18.9331 12.6206C19.0503 12.5033 19.2092 12.4375 19.375 12.4375C19.5408 12.4375 19.6997 12.5033 19.8169 12.6206C19.9342 12.7378 20 12.8967 20 13.0625V16.1875C20 16.8505 19.7366 17.4864 19.2678 17.9553C18.7989 18.4241 18.163 18.6875 17.5 18.6875H2.5C1.83696 18.6875 1.20107 18.4241 0.732233 17.9553C0.263392 17.4864 0 16.8505 0 16.1875V13.0625C0 12.8967 0.065848 12.7378 0.183058 12.6206C0.300269 12.5033 0.45924 12.4375 0.625 12.4375Z",fill:"var(--sqm-text-subdued)"}),h$1("path",{d:"M9.5575 14.88C9.61556 14.9382 9.68453 14.9844 9.76046 15.0159C9.83639 15.0474 9.91779 15.0636 10 15.0636C10.0822 15.0636 10.1636 15.0474 10.2395 15.0159C10.3155 14.9844 10.3844 14.9382 10.4425 14.88L14.1925 11.13C14.3099 11.0126 14.3758 10.8535 14.3758 10.6875C14.3758 10.5215 14.3099 10.3624 14.1925 10.245C14.0751 10.1276 13.916 10.0617 13.75 10.0617C13.584 10.0617 13.4249 10.1276 13.3075 10.245L10.625 12.9288V1.9375C10.625 1.77174 10.5592 1.61277 10.4419 1.49556C10.3247 1.37835 10.1658 1.3125 10 1.3125C9.83424 1.3125 9.67527 1.37835 9.55806 1.49556C9.44085 1.61277 9.375 1.77174 9.375 1.9375V12.9288L6.6925 10.245C6.57514 10.1276 6.41597 10.0617 6.25 10.0617C6.08403 10.0617 5.92486 10.1276 5.8075 10.245C5.69014 10.3624 5.62421 10.5215 5.62421 10.6875C5.62421 10.8535 5.69014 11.0126 5.8075 11.13L9.5575 14.88Z",fill:"var(--sqm-text-subdued)"}))))};return e}();var TableCell=function(){function e(e){registerInstance(this,e);this.colspan=1;this.padding="15px 10px"}e.prototype.render=function(){return h$1(Host,{style:{display:"contents"}},h$1("td",{colSpan:this.colspan,style:{padding:this.padding}},h$1("slot",null)))};return e}();var TableRow=function(){function e(e){registerInstance(this,e);this.border="var(--sqm-border-thickness, 1px) solid var(--sqm-border-color, #eaeaea)"}e.prototype.render=function(){return h$1(Host,{style:{display:"contents"}},h$1("tr",{style:{border:this.border}},h$1("slot",null)))};return e}();export{InvoiceTableDataCell as sqm_invoice_table_data_cell,RewardTableDateCell as sqm_invoice_table_date_cell,InvoiceTableDownloadCell as sqm_invoice_table_download_cell,TableCell as sqm_table_cell,TableRow as sqm_table_row};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var s,t=1,i=arguments.length;t<i;t++){s=arguments[t];for(var o in s)if(Object.prototype.hasOwnProperty.call(s,o))e[o]=s[o]}return e};return __assign.apply(this,arguments)};import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import"./global-1099f20d.js";import{i as d,n as h}from"./dom-context-hooks.module-63370afd.js";import{i as isDemo}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import{a as getMissingProps,g as getProps}from"./utils-
|
|
1
|
+
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var s,t=1,i=arguments.length;t<i;t++){s=arguments[t];for(var o in s)if(Object.prototype.hasOwnProperty.call(s,o))e[o]=s[o]}return e};return __assign.apply(this,arguments)};import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import"./global-1099f20d.js";import{i as d,n as h}from"./dom-context-hooks.module-63370afd.js";import{i as isDemo}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import{a as getMissingProps,g as getProps}from"./utils-334c1e34.js";import"./JSS-67b5cff8.js";import{L as LEAD_FORM_STATE_CONTEXT,R as RequiredPropsError}from"./useLeadFormState-c379e5d7.js";import{L as LeadCheckboxFieldView}from"./sqm-lead-checkbox-field-view-cbafee07.js";function useLeadCheckboxField(){var e=d(LEAD_FORM_STATE_CONTEXT);return{states:{leadFormState:e}}}var LeadCheckboxField=function(){function e(e){registerInstance(this,e);this.ignored=true;this.checkboxLabel="By signing up you agree to the {labelLink}";this.checkboxLabelLink="https://example.com";this.checkboxLabelLinkText="Terms and Conditions";this.errorMessage="Must be checked";this.checkboxOptional=false;h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=getMissingProps([{attribute:"checkbox-name",value:this.checkboxName}]);if(!isDemo()&&e){return h$1(RequiredPropsError,{missingProps:e,heading:"An error occured while loading this form",subheading:"A technical problem prevented this checkbox field from loading. Please contact us with the link to this page.",description:"Values for the following attributes are missing:"})}var s=__assign({},getProps(this));var t=(isDemo()?useLeadCheckboxFieldDemo(this):useLeadCheckboxField()).states;return h$1(LeadCheckboxFieldView,{states:t,content:s})};return e}();function useLeadCheckboxFieldDemo(e){return cjs({states:{leadFormState:{}}},e.demoData||{},{arrayMerge:function(e,s){return s}})}export{LeadCheckboxField as sqm_lead_checkbox_field};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var i,t=1,s=arguments.length;t<s;t++){i=arguments[t];for(var r in i)if(Object.prototype.hasOwnProperty.call(i,r))e[r]=i[r]}return e};return __assign.apply(this,arguments)};import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import"./global-1099f20d.js";import{i as d,n as h}from"./dom-context-hooks.module-63370afd.js";import{i as isDemo}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import{g as getProps,a as getMissingProps}from"./utils-
|
|
1
|
+
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var i,t=1,s=arguments.length;t<s;t++){i=arguments[t];for(var r in i)if(Object.prototype.hasOwnProperty.call(i,r))e[r]=i[r]}return e};return __assign.apply(this,arguments)};import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import"./global-1099f20d.js";import{i as d,n as h}from"./dom-context-hooks.module-63370afd.js";import{i as isDemo}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import{g as getProps,a as getMissingProps}from"./utils-334c1e34.js";import"./JSS-67b5cff8.js";import"./mixins-f750863a.js";import{L as LEAD_FORM_STATE_CONTEXT,R as RequiredPropsError}from"./useLeadFormState-c379e5d7.js";import{L as LeadInputFieldView}from"./sqm-lead-input-field-view-f3775c28.js";function useLeadInputField(){var e=d(LEAD_FORM_STATE_CONTEXT);return{states:{leadFormState:e}}}var LeadInputField=function(){function e(e){registerInstance(this,e);this.ignored=true;this.optionalLabel="(optional)";this.fieldType="text";this.requiredFieldErrorMessage="Please enter a {fieldLabel}";this.fieldOptional=false;h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=__assign({},getProps(this));var i=getMissingProps([{attribute:"field-name",value:this.fieldName}]);if(!isDemo()&&i){return h$1(RequiredPropsError,{missingProps:i,heading:"An error occured while loading this form",subheading:"A technical problem prevented this input field from loading. Please contact us with the link to this page.",description:"Values for the following attributes are missing:"})}var t=(isDemo()?useLeadInputFieldDemo(this):useLeadInputField()).states;return h$1(LeadInputFieldView,{states:t,content:e})};return e}();function useLeadInputFieldDemo(e){return cjs({states:{leadForState:{}},content:{fieldName:e.fieldName,fieldLabel:e.fieldLabel,fieldType:e.fieldType,requiredFieldErrorMessage:e.requiredFieldErrorMessage}},e.demoData||{},{arrayMerge:function(e,i){return i}})}export{LeadInputField as sqm_lead_input_field};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __makeTemplateObject=this&&this.__makeTemplateObject||function(e,t){if(Object.defineProperty){Object.defineProperty(e,"raw",{value:t})}else{e.raw=t}return e};var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]}return e};return __assign.apply(this,arguments)};import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import{n as h}from"./dom-context-hooks.module-63370afd.js";import{d as dist,J,w as wn,b as setUserIdentity,i as isDemo}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import{g as getProps}from"./utils-
|
|
1
|
+
var __makeTemplateObject=this&&this.__makeTemplateObject||function(e,t){if(Object.defineProperty){Object.defineProperty(e,"raw",{value:t})}else{e.raw=t}return e};var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]}return e};return __assign.apply(this,arguments)};import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import{n as h}from"./dom-context-hooks.module-63370afd.js";import{d as dist,J,w as wn,b as setUserIdentity,i as isDemo}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import{g as getProps}from"./utils-334c1e34.js";import"./JSS-67b5cff8.js";import{L as LogoutCurrentUserView}from"./sqm-logout-current-user-view-f21e54e3.js";var GET_USER_DETAILS=dist.gql(templateObject_1||(templateObject_1=__makeTemplateObject(["\n query getUserDetails {\n viewer {\n ... on User {\n id\n accountId\n email\n }\n }\n }\n"],["\n query getUserDetails {\n viewer {\n ... on User {\n id\n accountId\n email\n }\n }\n }\n"])));function useLogoutCurrentUser(e){var t,r;var n=J();var i=wn(GET_USER_DETAILS,{},!n),s=i.loading,o=i.data;var a=function(){setUserIdentity(undefined)};var u=(t=e.userIdentificationText)===null||t===void 0?void 0:t.replace("{email}",(r=o===null||o===void 0?void 0:o.viewer)===null||r===void 0?void 0:r.email);return __assign({loading:s,onSwitchClick:a,filledInEmailText:u},e)}var LogoutCurrentUser=function(){function e(e){registerInstance(this,e);this.userIdentificationText="{email}";this.switchUserText="not you?";this.emailErrorText="Error fetching email";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?useDemoLogoutCurrentUser(this):useLogoutCurrentUser(getProps(this));var t={userIdentificationText:this.userIdentificationText,switchUserText:this.switchUserText,emailErrorText:this.emailErrorText};return h$1(LogoutCurrentUserView,Object.assign({},e,t))};return e}();function useDemoLogoutCurrentUser(e){return cjs({onSwitchClick:function(){return setUserIdentity(undefined)},filledInEmailText:"john@example.com",switchUserText:e.switchUserText,emailErrorText:e.emailErrorText,loading:false},e.demoData||{},{arrayMerge:function(e,t){return t}})}export{LogoutCurrentUser as sqm_logout_current_user};var templateObject_1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import{n as h}from"./dom-context-hooks.module-63370afd.js";import{k as kn,i as isDemo}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import{g as getProps}from"./utils-
|
|
1
|
+
import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import{n as h}from"./dom-context-hooks.module-63370afd.js";import{k as kn,i as isDemo}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import{g as getProps}from"./utils-334c1e34.js";import"./JSS-67b5cff8.js";import"./mixins-f750863a.js";import{N as NavigationSidebarItemView}from"./sqm-navigation-sidebar-item-view-5a452423.js";function useNavigationSidebarItem(o){var e=kn();return{states:{active:e.pathname===o.path},data:{label:o.label,icon:o.icon,path:o.path},backgroundColor:o.backgroundColor,backgroundHoverColor:o.backgroundHoverColor,textColor:o.textColor,textHoverColor:o.textHoverColor,borderRadius:o.borderRadius,backgroundFocusedColor:o.backgroundFocusedColor,textFocusedColor:o.textFocusedColor,padding:o.padding}}var NavigationSidebarItem=function(){function o(o){registerInstance(this,o);this.padding="x-small";h(this)}o.prototype.disconnectedCallback=function(){};o.prototype.render=function(){var o=isDemo()?useSidebarItemDemo(getProps(this)):useNavigationSidebarItem(getProps(this));return h$1(NavigationSidebarItemView,Object.assign({},o))};return o}();function useSidebarItemDemo(o){return cjs({states:{active:false},data:{label:o.label||"Dashboard",icon:o.icon||"house"},backgroundColor:o.backgroundColor,backgroundHoverColor:o.backgroundHoverColor,textColor:o.textColor,textHoverColor:o.textHoverColor,borderRadius:o.borderRadius,backgroundFocusedColor:o.backgroundFocusedColor,textFocusedColor:o.textFocusedColor,padding:o.padding},o.demoData||{},{arrayMerge:function(o,e){return e}})}export{NavigationSidebarItem as sqm_navigation_sidebar_item};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __makeTemplateObject=this&&this.__makeTemplateObject||function(e,t){if(Object.defineProperty){Object.defineProperty(e,"raw",{value:t})}else{e.raw=t}return e};var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,a=1,n=arguments.length;a<n;a++){t=arguments[a];for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,a,n){function r(e){return e instanceof a?e:new a((function(t){t(e)}))}return new(a||(a=Promise))((function(a,o){function i(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n["throw"](e))}catch(e){o(e)}}function l(e){e.done?a(e.value):r(e.value).then(i,s)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,r,o,i;return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(t){return l([e,t])}}function l(i){if(n)throw new TypeError("Generator is already executing.");while(a)try{if(n=1,r&&(o=i[0]&2?r["return"]:i[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;if(r=0,o)i=[i[0]&2,o.value];switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:false};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){a=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(i[0]===6&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}if(o[2])a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};import{h,F as Fragment,r as registerInstance}from"./index-b3a06de8.js";import{i as intl}from"./global-1099f20d.js";import{n as h$1,k as useState}from"./dom-context-hooks.module-63370afd.js";import{F as Fn,i as isDemo,d as dist,H,J,B,w as wn,$ as $e}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import{g as getProps}from"./utils-84b4b092.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import{R as REFERRAL_CODES_PAGINATION_CONTEXT,a as REFERRAL_CODES_NAMESPACE,S as SET_CODE_COPIED,u as useReferralCodes}from"./useReferralCodes-c2e809cf.js";import"./mixins-f750863a.js";import{C as CopyTextView}from"./copy-text-view-83b09456.js";var style={Container:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"var(--sl-spacing-small)",width:"100%"},TextContainer:{display:"flex",gap:"var(--sl-spacing-xx-small)"}};var sheet=createStyleSheet(style);var styleString=sheet.toString();function PaginationView(e){var t=e.states,a=e.callbacks,n=e.text,r=e.buttonType;var o=a.onNext,i=a.onPrev;var s=t.currentPage,l=t.totalPages,u=t.loading;if(l===1)return h(Fragment,null);return h("span",{class:sheet.classes.Container,part:"sqm-base"},h("style",{type:"text/css"},styleString),!u&&h(Fragment,null,h("sl-button",{exportparts:"base: "+r+"button-base",onClick:i,part:"sqm-pagination-button",circle:true,disabled:s===1},h("sl-icon",{name:"chevron-left",label:"Previous Page"})),h("div",{class:sheet.classes.TextContainer},n.paginationText)),h("sl-button",{exportparts:"base: "+r+"button-base",onClick:o,part:"sqm-pagination-button",circle:true,disabled:s===l},h("sl-icon",{name:"chevron-right",label:"Previous Page"})))}function usePagination(e){var t;var a=Fn(REFERRAL_CODES_PAGINATION_CONTEXT);var n=a.states.currentPage+1;var r=(t=a.states)===null||t===void 0?void 0:t.pageCount;return{states:{currentPage:n,totalPages:r,loading:a.states.loading},callbacks:{onNext:function(){var e,t;return(e=a.callbacks)===null||e===void 0?void 0:e.setCurrentPage(((t=a.states)===null||t===void 0?void 0:t.currentPage)+1)},onPrev:function(){var e,t;return(e=a.callbacks)===null||e===void 0?void 0:e.setCurrentPage(((t=a.states)===null||t===void 0?void 0:t.currentPage)-1)}},text:{paginationText:intl.formatMessage({id:"paginationText",defaultMessage:e.paginationText},{currentPage:n,totalPages:r})}}}var Pagination=function(){function e(e){registerInstance(this,e);this.ignored=true;this.paginationText="{currentPage} of {totalPages}";this.buttonType="secondary";h$1(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?useDemoPagination(getProps(this)):usePagination(getProps(this));return h(PaginationView,Object.assign({},e))};return e}();function useDemoPagination(e){var t=useState(1),a=t[0],n=t[1];return cjs({states:{currentPage:a,totalPages:5,loading:false},buttonType:e.buttonType,callbacks:{onNext:function(){return n(a+1)},onPrev:function(){return n(a-1)}},text:{paginationText:intl.formatMessage({id:"paginationText",defaultMessage:e.paginationText||"{currentPage} of {totalPages}"},{currentPage:a,totalPages:5})}},e.demoData||{},{arrayMerge:function(e,t){return t}})}var MessageLinkQuery=dist.gql(templateObject_1||(templateObject_1=__makeTemplateObject(["\n query getReferralCode($programId: ID) {\n user: viewer {\n ... on User {\n referralCode(programId: $programId)\n }\n }\n }\n"],["\n query getReferralCode($programId: ID) {\n user: viewer {\n ... on User {\n referralCode(programId: $programId)\n }\n }\n }\n"])));var WIDGET_ENGAGEMENT_EVENT=dist.gql(templateObject_2||(templateObject_2=__makeTemplateObject(["\n mutation loadEvent($eventMeta: UserAnalyticsEvent!) {\n createUserAnalyticsEvent(eventMeta: $eventMeta)\n }\n"],["\n mutation loadEvent($eventMeta: UserAnalyticsEvent!) {\n createUserAnalyticsEvent(eventMeta: $eventMeta)\n }\n"])));function useReferralCode(e){var t,a;var n=e.programId,r=n===void 0?H():n;var o=J();var i=B();var s=Fn(REFERRAL_CODES_NAMESPACE);var l=wn(MessageLinkQuery,{programId:r},!(o===null||o===void 0?void 0:o.jwt)||(s===null||s===void 0?void 0:s.referralCode)!==undefined).data;var u=$e(WIDGET_ENGAGEMENT_EVENT)[0];var c=$e(SET_CODE_COPIED)[0];var d=(a=(s===null||s===void 0?void 0:s.referralCode)||((t=l===null||l===void 0?void 0:l.user)===null||t===void 0?void 0:t.referralCode))!==null&&a!==void 0?a:"...";var p=useState(false),f=p[0],g=p[1];function h(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!s)return[3,2];return[4,c({referralCode:s.referralCode})];case 1:t.sent();s.refresh();t.label=2;case 2:navigator.clipboard.writeText(d);g(true);setTimeout((function(){return g(false)}),e.tooltiplifespan);u({eventMeta:{programId:r,id:o===null||o===void 0?void 0:o.id,accountId:o===null||o===void 0?void 0:o.accountId,type:"USER_REFERRAL_PROGRAM_ENGAGEMENT_EVENT",meta:{engagementMedium:i,shareMedium:"DIRECT"}}});return[2]}}))}))}return __assign(__assign({},e),{onClick:h,open:f,copyString:d,isCopied:s===null||s===void 0?void 0:s.isCopied,showNotificationText:e.showNotificationText&&!!(s===null||s===void 0?void 0:s.singleUse)})}var ReferralCode=function(){function e(e){registerInstance(this,e);this.tooltiptext="Copied to Clipboard";this.showNotificationText=false;this.notificationText="You've copied this code before";this.tooltiplifespan=1e3;this.textAlign="left";this.copyButtonLabel="Copy Code";this.buttonStyle="icon";this.buttonType="primary";h$1(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=getProps(this);var t=isDemo()?useDemoReferralCode(e):useReferralCode(e);return h(CopyTextView,Object.assign({},t))};return e}();function useDemoReferralCode(e){var t=useState(false),a=t[0],n=t[1];var r="REFERRALCODE001";return cjs({copyString:r,tooltiptext:e.tooltiptext,textAlign:e.textAlign,copyButtonLabel:e.copyButtonLabel,buttonStyle:e.buttonStyle,notificationText:e.notificationText,showNotificationText:e.showNotificationText,isCopied:e.showNotificationText,borderColor:e.borderColor,backgroundColor:e.backgroundColor,textColor:e.textColor,borderRadius:e.borderRadius,buttonType:e.buttonType,isUsed:false,rewardStatus:"AVAILABLE",open:a,onClick:function(){navigator.clipboard.writeText(r);n(true);setTimeout((function(){return n(false)}),e.tooltiplifespan)}},e.demoData||{},{arrayMerge:function(e,t){return t}})}function ReferralCodesView(e){var t=e.slots,a=e.titleText,n=e.states,r=e.textColor,o=r===void 0?"var(--sqm-text-subdued)":r;var i={Wrapper:{width:"100%",display:"flex",alignItems:"flex-start",justifyContent:"center",flexDirection:"column",gap:"var(--sl-spacing-large)",color:o},HeaderContainer:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},ShareCodeContainer:{width:"100%",display:"flex",alignItems:"flex-start",justifyContent:"center",flexDirection:"column"},ShareButtonContainer:{width:"100%",display:"flex",alignItems:"flex-start",justifyContent:"center",flexDirection:"column"},TitleText:{fontSize:"var(--sl-font-size-large)",margin:"0"}};var s="\n :host {\n display: block;\n }\n :host([hidden]): {\n display: none;\n }\n ";var l=createStyleSheet(i);var u=l.toString();var c=function(e){if(e.noCodes){return t.empty}if(e.loading){return t.loading}return h("div",{class:l.classes.Wrapper},h("div",{class:l.classes.ShareCodeContainer},t.shareCodes),h("div",{class:l.classes.ShareButtonContainer},t.shareButtons))};return h("div",{class:l.classes.Wrapper,part:"sqm-base"},h("style",{type:"text/css"},s,u),h("div",{class:l.classes.HeaderContainer},h("h2",{class:l.classes.TitleText},a),!n.noCodes&&!n.loading&&t.pagination),c(n))}var ReferralCodes=function(){function e(e){registerInstance(this,e);this.titleText="Start sharing";this.emptyStateHeaderText="Your new codes and links aren’t ready yet";this.emptyStateDescriptionText="Please contact our program support team to let them know you’re out of codes.";this.emptyStateImageUrl="https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png";h$1(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=getProps(this);var t=isDemo()?useDemoReferralCodes(e):useReferralCodes(e);var a={shareButtons:h("slot",{name:"shareButtons"}),shareCodes:h("slot",{name:"shareCodes"}),pagination:h("slot",{name:"pagination"}),empty:h(EmptySlot,{headerText:this.emptyStateHeaderText,descriptionText:this.emptyStateDescriptionText,imageUrl:this.emptyStateImageUrl}),loading:h(LoadingSlot,null)};var n=__assign(__assign({slots:a},t),{loading:t.states.loading,noCodes:t.states.noCodes});return h(ReferralCodesView,Object.assign({},n))};return e}();function EmptySlot(e){var t=e.headerText,a=e.descriptionText,n=e.imageUrl;return h("slot",{name:"empty"},h("sqm-empty",{emptyStateHeader:t,emptyStateText:a,emptyStateImage:n}))}function LoadingSlot(){return h("slot",{name:"loading"},h(LoadingRow,null),h(LoadingRow,null),h(LoadingRow,null),h(LoadingRow,null))}function LoadingRow(){return h("sl-skeleton",{style:{width:"100%"}})}function useDemoReferralCodes(e){return cjs({titleText:e.titleText,textColor:e.textColor,states:{noCodes:false,loading:false}},e.demoData||{},{arrayMerge:function(e,t){return t}})}export{Pagination as sqm_pagination,ReferralCode as sqm_referral_code,ReferralCodes as sqm_referral_codes};var templateObject_1,templateObject_2;
|
|
1
|
+
var __makeTemplateObject=this&&this.__makeTemplateObject||function(e,t){if(Object.defineProperty){Object.defineProperty(e,"raw",{value:t})}else{e.raw=t}return e};var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,a=1,n=arguments.length;a<n;a++){t=arguments[a];for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,a,n){function r(e){return e instanceof a?e:new a((function(t){t(e)}))}return new(a||(a=Promise))((function(a,o){function i(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n["throw"](e))}catch(e){o(e)}}function l(e){e.done?a(e.value):r(e.value).then(i,s)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,r,o,i;return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(t){return l([e,t])}}function l(i){if(n)throw new TypeError("Generator is already executing.");while(a)try{if(n=1,r&&(o=i[0]&2?r["return"]:i[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;if(r=0,o)i=[i[0]&2,o.value];switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:false};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){a=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(i[0]===6&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}if(o[2])a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};import{h,F as Fragment,r as registerInstance}from"./index-b3a06de8.js";import{i as intl}from"./global-1099f20d.js";import{n as h$1,k as useState}from"./dom-context-hooks.module-63370afd.js";import{F as Fn,i as isDemo,d as dist,H,J,B,w as wn,$ as $e}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import{g as getProps}from"./utils-334c1e34.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import{R as REFERRAL_CODES_PAGINATION_CONTEXT,a as REFERRAL_CODES_NAMESPACE,S as SET_CODE_COPIED,u as useReferralCodes}from"./useReferralCodes-c2e809cf.js";import"./mixins-f750863a.js";import{C as CopyTextView}from"./copy-text-view-fac47254.js";var style={Container:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"var(--sl-spacing-small)",width:"100%"},TextContainer:{display:"flex",gap:"var(--sl-spacing-xx-small)"}};var sheet=createStyleSheet(style);var styleString=sheet.toString();function PaginationView(e){var t=e.states,a=e.callbacks,n=e.text,r=e.buttonType;var o=a.onNext,i=a.onPrev;var s=t.currentPage,l=t.totalPages,u=t.loading;if(l===1)return h(Fragment,null);return h("span",{class:sheet.classes.Container,part:"sqm-base"},h("style",{type:"text/css"},styleString),!u&&h(Fragment,null,h("sl-button",{exportparts:"base: "+r+"button-base",onClick:i,part:"sqm-pagination-button",circle:true,disabled:s===1},h("sl-icon",{name:"chevron-left",label:"Previous Page"})),h("div",{class:sheet.classes.TextContainer},n.paginationText)),h("sl-button",{exportparts:"base: "+r+"button-base",onClick:o,part:"sqm-pagination-button",circle:true,disabled:s===l},h("sl-icon",{name:"chevron-right",label:"Previous Page"})))}function usePagination(e){var t;var a=Fn(REFERRAL_CODES_PAGINATION_CONTEXT);var n=a.states.currentPage+1;var r=(t=a.states)===null||t===void 0?void 0:t.pageCount;return{states:{currentPage:n,totalPages:r,loading:a.states.loading},callbacks:{onNext:function(){var e,t;return(e=a.callbacks)===null||e===void 0?void 0:e.setCurrentPage(((t=a.states)===null||t===void 0?void 0:t.currentPage)+1)},onPrev:function(){var e,t;return(e=a.callbacks)===null||e===void 0?void 0:e.setCurrentPage(((t=a.states)===null||t===void 0?void 0:t.currentPage)-1)}},text:{paginationText:intl.formatMessage({id:"paginationText",defaultMessage:e.paginationText},{currentPage:n,totalPages:r})}}}var Pagination=function(){function e(e){registerInstance(this,e);this.ignored=true;this.paginationText="{currentPage} of {totalPages}";this.buttonType="secondary";h$1(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?useDemoPagination(getProps(this)):usePagination(getProps(this));return h(PaginationView,Object.assign({},e))};return e}();function useDemoPagination(e){var t=useState(1),a=t[0],n=t[1];return cjs({states:{currentPage:a,totalPages:5,loading:false},buttonType:e.buttonType,callbacks:{onNext:function(){return n(a+1)},onPrev:function(){return n(a-1)}},text:{paginationText:intl.formatMessage({id:"paginationText",defaultMessage:e.paginationText||"{currentPage} of {totalPages}"},{currentPage:a,totalPages:5})}},e.demoData||{},{arrayMerge:function(e,t){return t}})}var MessageLinkQuery=dist.gql(templateObject_1||(templateObject_1=__makeTemplateObject(["\n query getReferralCode($programId: ID) {\n user: viewer {\n ... on User {\n referralCode(programId: $programId)\n }\n }\n }\n"],["\n query getReferralCode($programId: ID) {\n user: viewer {\n ... on User {\n referralCode(programId: $programId)\n }\n }\n }\n"])));var WIDGET_ENGAGEMENT_EVENT=dist.gql(templateObject_2||(templateObject_2=__makeTemplateObject(["\n mutation loadEvent($eventMeta: UserAnalyticsEvent!) {\n createUserAnalyticsEvent(eventMeta: $eventMeta)\n }\n"],["\n mutation loadEvent($eventMeta: UserAnalyticsEvent!) {\n createUserAnalyticsEvent(eventMeta: $eventMeta)\n }\n"])));function useReferralCode(e){var t,a;var n=e.programId,r=n===void 0?H():n;var o=J();var i=B();var s=Fn(REFERRAL_CODES_NAMESPACE);var l=wn(MessageLinkQuery,{programId:r},!(o===null||o===void 0?void 0:o.jwt)||(s===null||s===void 0?void 0:s.referralCode)!==undefined).data;var u=$e(WIDGET_ENGAGEMENT_EVENT)[0];var c=$e(SET_CODE_COPIED)[0];var d=(a=(s===null||s===void 0?void 0:s.referralCode)||((t=l===null||l===void 0?void 0:l.user)===null||t===void 0?void 0:t.referralCode))!==null&&a!==void 0?a:"...";var p=useState(false),f=p[0],g=p[1];function h(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!s)return[3,2];return[4,c({referralCode:s.referralCode})];case 1:t.sent();s.refresh();t.label=2;case 2:navigator.clipboard.writeText(d);g(true);setTimeout((function(){return g(false)}),e.tooltiplifespan);u({eventMeta:{programId:r,id:o===null||o===void 0?void 0:o.id,accountId:o===null||o===void 0?void 0:o.accountId,type:"USER_REFERRAL_PROGRAM_ENGAGEMENT_EVENT",meta:{engagementMedium:i,shareMedium:"DIRECT"}}});return[2]}}))}))}return __assign(__assign({},e),{onClick:h,open:f,copyString:d,isCopied:s===null||s===void 0?void 0:s.isCopied,showNotificationText:e.showNotificationText&&!!(s===null||s===void 0?void 0:s.singleUse)})}var ReferralCode=function(){function e(e){registerInstance(this,e);this.tooltiptext="Copied to Clipboard";this.showNotificationText=false;this.notificationText="You've copied this code before";this.tooltiplifespan=1e3;this.textAlign="left";this.copyButtonLabel="Copy Code";this.buttonStyle="icon";this.buttonType="primary";h$1(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=getProps(this);var t=isDemo()?useDemoReferralCode(e):useReferralCode(e);return h(CopyTextView,Object.assign({},t))};return e}();function useDemoReferralCode(e){var t=useState(false),a=t[0],n=t[1];var r="REFERRALCODE001";return cjs({copyString:r,tooltiptext:e.tooltiptext,textAlign:e.textAlign,copyButtonLabel:e.copyButtonLabel,buttonStyle:e.buttonStyle,notificationText:e.notificationText,showNotificationText:e.showNotificationText,isCopied:e.showNotificationText,borderColor:e.borderColor,backgroundColor:e.backgroundColor,textColor:e.textColor,borderRadius:e.borderRadius,buttonType:e.buttonType,isUsed:false,rewardStatus:"AVAILABLE",open:a,onClick:function(){navigator.clipboard.writeText(r);n(true);setTimeout((function(){return n(false)}),e.tooltiplifespan)}},e.demoData||{},{arrayMerge:function(e,t){return t}})}function ReferralCodesView(e){var t=e.slots,a=e.titleText,n=e.states,r=e.textColor,o=r===void 0?"var(--sqm-text-subdued)":r;var i={Wrapper:{width:"100%",display:"flex",alignItems:"flex-start",justifyContent:"center",flexDirection:"column",gap:"var(--sl-spacing-large)",color:o},HeaderContainer:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},ShareCodeContainer:{width:"100%",display:"flex",alignItems:"flex-start",justifyContent:"center",flexDirection:"column"},ShareButtonContainer:{width:"100%",display:"flex",alignItems:"flex-start",justifyContent:"center",flexDirection:"column"},TitleText:{fontSize:"var(--sl-font-size-large)",margin:"0"}};var s="\n :host {\n display: block;\n }\n :host([hidden]): {\n display: none;\n }\n ";var l=createStyleSheet(i);var u=l.toString();var c=function(e){if(e.noCodes){return t.empty}if(e.loading){return t.loading}return h("div",{class:l.classes.Wrapper},h("div",{class:l.classes.ShareCodeContainer},t.shareCodes),h("div",{class:l.classes.ShareButtonContainer},t.shareButtons))};return h("div",{class:l.classes.Wrapper,part:"sqm-base"},h("style",{type:"text/css"},s,u),h("div",{class:l.classes.HeaderContainer},h("h2",{class:l.classes.TitleText},a),!n.noCodes&&!n.loading&&t.pagination),c(n))}var ReferralCodes=function(){function e(e){registerInstance(this,e);this.titleText="Start sharing";this.emptyStateHeaderText="Your new codes and links aren’t ready yet";this.emptyStateDescriptionText="Please contact our program support team to let them know you’re out of codes.";this.emptyStateImageUrl="https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png";h$1(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=getProps(this);var t=isDemo()?useDemoReferralCodes(e):useReferralCodes(e);var a={shareButtons:h("slot",{name:"shareButtons"}),shareCodes:h("slot",{name:"shareCodes"}),pagination:h("slot",{name:"pagination"}),empty:h(EmptySlot,{headerText:this.emptyStateHeaderText,descriptionText:this.emptyStateDescriptionText,imageUrl:this.emptyStateImageUrl}),loading:h(LoadingSlot,null)};var n=__assign(__assign({slots:a},t),{loading:t.states.loading,noCodes:t.states.noCodes});return h(ReferralCodesView,Object.assign({},n))};return e}();function EmptySlot(e){var t=e.headerText,a=e.descriptionText,n=e.imageUrl;return h("slot",{name:"empty"},h("sqm-empty",{emptyStateHeader:t,emptyStateText:a,emptyStateImage:n}))}function LoadingSlot(){return h("slot",{name:"loading"},h(LoadingRow,null),h(LoadingRow,null),h(LoadingRow,null),h(LoadingRow,null))}function LoadingRow(){return h("sl-skeleton",{style:{width:"100%"}})}function useDemoReferralCodes(e){return cjs({titleText:e.titleText,textColor:e.textColor,states:{noCodes:false,loading:false}},e.demoData||{},{arrayMerge:function(e,t){return t}})}export{Pagination as sqm_pagination,ReferralCode as sqm_referral_code,ReferralCodes as sqm_referral_codes};var templateObject_1,templateObject_2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var e,s=1,r=arguments.length;s<r;s++){e=arguments[s];for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i))t[i]=e[i]}return t};return __assign.apply(this,arguments)};import{h,r as registerInstance}from"./index-b3a06de8.js";import{i as d,k as useState,n as h$1}from"./dom-context-hooks.module-63370afd.js";import{i as isDemo}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import{g as getProps}from"./utils-84b4b092.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import{E as ErrorStyles}from"./mixins-f750863a.js";import{R as REGISTRATION_FORM_STATE_CONTEXT}from"./useRegistrationFormState-24d594ea.js";var constants={error:{length:"Length should be a valid positive number",password:"Password should be a valid string"},regex:{digits:"(\\d.*)",letters:"([a-zA-Z].*)",symbols:"([`~\\!@#\\$%\\^\\&\\*\\(\\)\\-_\\=\\+\\[\\{\\}\\]\\\\|;:\\'\",<.>\\/\\?€£¥₹§±].*)",spaces:"([\\s].*)"}};var regex=constants.regex;function _process(t,e){if(e&&e>1){var s=parseInt(e,10);return new RegExp(t+"{"+s+",}").test(this.password)===this.positive}return new RegExp(t).test(this.password)===this.positive}var lib={not:function t(e){this.positive=false;if(e){return _process.call(this,e)}return true},has:function t(e){this.positive=true;if(e){return _process.call(this,e)}return true},is:function t(){this.positive=true;return true},min:function t(e){return this.password.length>=e},max:function t(e){return this.password.length<=e},digits:function t(e){return _process.call(this,regex.digits,e)},letters:function t(e){return _process.call(this,regex.letters,e)},uppercase:function t(e){if(e&&e>1){var s=0;var r=0;while(r<e&&s<this.password.length){var i=this.password.charAt(s);if(i!==i.toLowerCase()){r++}s++}return r===e===this.positive}return this.password!==this.password.toLowerCase()===this.positive},lowercase:function t(e){if(e&&e>1){var s=0;var r=0;while(r<e&&s<this.password.length){var i=this.password.charAt(s);if(i!==i.toUpperCase()){r++}s++}return r===e===this.positive}return this.password!==this.password.toUpperCase()===this.positive},symbols:function t(e){return _process.call(this,regex.symbols,e)},spaces:function t(e){return _process.call(this,regex.spaces,e)},oneOf:function t(e){return e.indexOf(this.password)>=0===this.positive}};var error=constants.error;function _validateLength(t){var e=Number(t);if(isNaN(e)||!Number.isInteger(e)||e<1){throw new Error(error.length)}}function _isPasswordValidFor(t){return lib[t.method].apply(this,t.arguments)}function _register(t,e){this.properties.push({method:t,arguments:e});return this}var PasswordValidator=function(){function t(){this.properties=[]}t.prototype.validate=function(t,e){var s=this;this.list=Boolean(e&&e.list);this.password=String(t);this.positive=true;if(this.list){return this.properties.reduce((function(t,e){if(!_isPasswordValidFor.call(s,e)){return t.concat(e.method)}return t}),[])}return this.properties.every(_isPasswordValidFor.bind(this))};t.prototype.letters=function(t){t&&_validateLength(t);return _register.call(this,"letters",arguments)};t.prototype.digits=function(t){t&&_validateLength(t);return _register.call(this,"digits",arguments)};t.prototype.symbols=function(t){t&&_validateLength(t);return _register.call(this,"symbols",arguments)};t.prototype.min=function(t){_validateLength(t);return _register.call(this,"min",arguments)};t.prototype.max=function(t){_validateLength(t);return _register.call(this,"max",arguments)};t.prototype.lowercase=function(t){t&&_validateLength(t);return _register.call(this,"lowercase",arguments)};t.prototype.uppercase=function(t){t&&_validateLength(t);return _register.call(this,"uppercase",arguments)};t.prototype.spaces=function(t){t&&_validateLength(t);return _register.call(this,"spaces",arguments)};t.prototype.has=function(){return _register.call(this,"has",arguments)};t.prototype.not=function(){return _register.call(this,"not",arguments)};t.prototype.is=function(){return _register.call(this,"is",arguments)};t.prototype.oneOf=function(){return _register.call(this,"oneOf",arguments)};return t}();var src=PasswordValidator;var passwordSchema=(new src).is().min(8).has().uppercase().has().lowercase().has(/([\d`~\!@#\$%\^\&\*\(\)\-_\=\+\[\{\}\]\\\|;:'",<.>\/\?€£¥₹§±].*){1,}/);var validateNewPassword=function(t,e){var s=passwordSchema.validate(t,{list:true});var r=getErrorMessage(s,t,e);return r};var Valid=function(){return h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},h("path",{d:"M6 0C2.688 0 0 2.688 0 6C0 9.312 2.688 12 6 12C9.312 12 12 9.312 12 6C12 2.688 9.312 0 6 0ZM4.8 9L1.8 6L2.646 5.154L4.8 7.302L9.354 2.748L10.2 3.6L4.8 9Z",fill:"#259053"}))};var Invalid=function(){return h("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h("path",{d:"M6 0C2.688 0 0 2.688 0 6C0 9.312 2.688 12 6 12C9.312 12 12 9.312 12 6C12 2.688 9.312 0 6 0ZM6 10.8C3.354 10.8 1.2 8.646 1.2 6C1.2 3.354 3.354 1.2 6 1.2C8.646 1.2 10.8 3.354 10.8 6C10.8 8.646 8.646 10.8 6 10.8ZM8.754 3.348L4.8 7.302L3.246 5.754L2.4 6.6L4.8 9L9.6 4.2L8.754 3.348Z",fill:"#555555"}))};var baseItem={display:"flex",alignItems:"center",fontSize:"var(--sl-font-size-small)","& > :not(:last-child)":{"margin-right":"var(--sl-spacing-x-small)"}};var style={Base:{fontSize:"var(--sl-font-size-small)"},ValidationList:{"list-style-type":"none",paddingRight:"var(--sl-spacing-large)",margin:"var(--sl-spacing-small) 0 var(--sl-spacing-x-large)","& > :not(:last-child)":{"margin-bottom":"var(--sl-spacing-xx-small)"},"& *":{"line-height":"var(--sl-line-height-dense)"}},ValidationItemValid:__assign(__assign({},baseItem),{color:"var(--sl-color-success-600)"}),ValidationItemInvalid:__assign({},baseItem)};var sheet=createStyleSheet(style);var styleString=sheet.toString();var getErrorMessage=function(t,e,s){var r={min:s.minErrorText,uppercase:s.uppercaseErrorText,lowercase:s.lowercaseErrorText,has:s.hasErrorText};if(!t.length&&e)return h("div",{class:sheet.classes.ValidationItemValid,style:{paddingBottom:"var(--sl-spacing-x-large)"}},h("style",{type:"text/css"},styleString),h(Valid,null)," ",h("span",null,s.meetsRequirementsText));return h("div",{class:sheet.classes.Base},h("style",{type:"text/css"},styleString),s.doesNotMeetRequirementsText,h("ul",{class:sheet.classes.ValidationList},Object.keys(r).map((function(e){return t.includes(e)?h("li",{class:sheet.classes.ValidationItemInvalid},h(Invalid,null)," ",h("span",null,r[e])):h("li",{class:sheet.classes.ValidationItemValid},h(Valid,null)," ",h("span",null,r[e]))}))))};var style$1={InputContainer:{"& > :not(:last-child)":{"margin-bottom":"20px"}},ErrorStyle:ErrorStyles};var vanillaStyle="\n:host {\n margin: 0 auto;\n width: 100%;\n display: block;\n}\n:host([hidden]): {\n display: none;\n}\n";var sheet$1=createStyleSheet(style$1);var styleString$1=sheet$1.toString();function PortalResetPasswordView(t){var e,s,r,i,a,n,o,l,d,u;var c=t.states,p=t.callbacks;return h("div",{class:sheet$1.classes.InputContainer,part:"sqm-base"},h("style",{type:"text/css"},vanillaStyle,styleString$1),h("sl-input",Object.assign({exportparts:"label: input-label, base: input-base",type:"password",name:"/password",label:c.content.fieldLabel||"Password",required:true,disabled:((e=c.registrationFormState)===null||e===void 0?void 0:e.loading)||((s=c.registrationFormState)===null||s===void 0?void 0:s.disabled),validationError:function(t){var e=t.value;if(!e){return"Cannot be empty"}}},((i=(r=c.registrationFormState)===null||r===void 0?void 0:r.initialData)===null||i===void 0?void 0:i.password)?{value:(n=(a=c.registrationFormState)===null||a===void 0?void 0:a.initialData)===null||n===void 0?void 0:n.password}:{},((l=(o=c.registrationFormState)===null||o===void 0?void 0:o.validationErrors)===null||l===void 0?void 0:l.password)?{class:sheet$1.classes.ErrorStyle,helpText:((u=(d=c.registrationFormState)===null||d===void 0?void 0:d.validationErrors)===null||u===void 0?void 0:u.password)||"Cannot be empty"}:[],{onInput:function(t){return c.enableValidation&&p.onInput(t)}})),c.dynamicValidation)}function usePasswordField(t){var e=d(REGISTRATION_FORM_STATE_CONTEXT);var s=useState(""),r=s[0],i=s[1];function a(e){var s=validateNewPassword(e.target.value,t);i(s)}return{states:{enableValidation:!t.disableValidation,dynamicValidation:r,registrationFormState:e,content:{fieldLabel:t.fieldLabel}},callbacks:{onInput:a}}}var PortalPasswordField=function(){function t(t){registerInstance(this,t);this.ignored=true;this.fieldLabel="Password";this.disableValidation=false;this.meetsRequirementsText="Password has met all requirements";this.doesNotMeetRequirementsText="Password must meet the following requirements:";this.minErrorText="be a minimum of 8 characters";this.uppercaseErrorText="contain at least 1 uppercase character";this.lowercaseErrorText="contain at least 1 lowercase character";this.hasErrorText="contain at least 1 number or symbol";h$1(this)}t.prototype.disconnectedCallback=function(){};t.prototype.render=function(){var t=isDemo()?usePasswordFieldDemo(getProps(this)):usePasswordField(getProps(this)),e=t.states,s=t.callbacks;return h(PortalResetPasswordView,{states:e,callbacks:s})};return t}();function usePasswordFieldDemo(t){var e,s,r,i,a,n,o;var l=useState(""),d=l[0],u=l[1];var c=useState(""),h=c[0],p=c[1];if(t.demoData&&h!=((e=t===null||t===void 0?void 0:t.demoData)===null||e===void 0?void 0:e.initValue)){var v=validateNewPassword(((s=t===null||t===void 0?void 0:t.demoData)===null||s===void 0?void 0:s.initValue)||"",t);u(((r=t===null||t===void 0?void 0:t.demoData)===null||r===void 0?void 0:r.initValue)===""?"":v);p((i=t===null||t===void 0?void 0:t.demoData)===null||i===void 0?void 0:i.initValue)}function g(e){var s=validateNewPassword(e.target.value,t);u(s)}return cjs({states:{enableValidation:!t.disableValidation,dynamicValidation:d,registrationFormState:((n=(a=t===null||t===void 0?void 0:t.demoData)===null||a===void 0?void 0:a.states)===null||n===void 0?void 0:n.registrationFormState)||{},content:{fieldLabel:t.fieldLabel}},callbacks:{onInput:g}},((o=t===null||t===void 0?void 0:t.demoData)===null||o===void 0?void 0:o.states)||{},{arrayMerge:function(t,e){return e}})}export{PortalPasswordField as sqm_password_field};
|
|
1
|
+
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var e,s=1,r=arguments.length;s<r;s++){e=arguments[s];for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i))t[i]=e[i]}return t};return __assign.apply(this,arguments)};import{h,r as registerInstance}from"./index-b3a06de8.js";import{i as d,k as useState,n as h$1}from"./dom-context-hooks.module-63370afd.js";import{i as isDemo}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import{g as getProps}from"./utils-334c1e34.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import{E as ErrorStyles}from"./mixins-f750863a.js";import{R as REGISTRATION_FORM_STATE_CONTEXT}from"./useRegistrationFormState-24d594ea.js";var constants={error:{length:"Length should be a valid positive number",password:"Password should be a valid string"},regex:{digits:"(\\d.*)",letters:"([a-zA-Z].*)",symbols:"([`~\\!@#\\$%\\^\\&\\*\\(\\)\\-_\\=\\+\\[\\{\\}\\]\\\\|;:\\'\",<.>\\/\\?€£¥₹§±].*)",spaces:"([\\s].*)"}};var regex=constants.regex;function _process(t,e){if(e&&e>1){var s=parseInt(e,10);return new RegExp(t+"{"+s+",}").test(this.password)===this.positive}return new RegExp(t).test(this.password)===this.positive}var lib={not:function t(e){this.positive=false;if(e){return _process.call(this,e)}return true},has:function t(e){this.positive=true;if(e){return _process.call(this,e)}return true},is:function t(){this.positive=true;return true},min:function t(e){return this.password.length>=e},max:function t(e){return this.password.length<=e},digits:function t(e){return _process.call(this,regex.digits,e)},letters:function t(e){return _process.call(this,regex.letters,e)},uppercase:function t(e){if(e&&e>1){var s=0;var r=0;while(r<e&&s<this.password.length){var i=this.password.charAt(s);if(i!==i.toLowerCase()){r++}s++}return r===e===this.positive}return this.password!==this.password.toLowerCase()===this.positive},lowercase:function t(e){if(e&&e>1){var s=0;var r=0;while(r<e&&s<this.password.length){var i=this.password.charAt(s);if(i!==i.toUpperCase()){r++}s++}return r===e===this.positive}return this.password!==this.password.toUpperCase()===this.positive},symbols:function t(e){return _process.call(this,regex.symbols,e)},spaces:function t(e){return _process.call(this,regex.spaces,e)},oneOf:function t(e){return e.indexOf(this.password)>=0===this.positive}};var error=constants.error;function _validateLength(t){var e=Number(t);if(isNaN(e)||!Number.isInteger(e)||e<1){throw new Error(error.length)}}function _isPasswordValidFor(t){return lib[t.method].apply(this,t.arguments)}function _register(t,e){this.properties.push({method:t,arguments:e});return this}var PasswordValidator=function(){function t(){this.properties=[]}t.prototype.validate=function(t,e){var s=this;this.list=Boolean(e&&e.list);this.password=String(t);this.positive=true;if(this.list){return this.properties.reduce((function(t,e){if(!_isPasswordValidFor.call(s,e)){return t.concat(e.method)}return t}),[])}return this.properties.every(_isPasswordValidFor.bind(this))};t.prototype.letters=function(t){t&&_validateLength(t);return _register.call(this,"letters",arguments)};t.prototype.digits=function(t){t&&_validateLength(t);return _register.call(this,"digits",arguments)};t.prototype.symbols=function(t){t&&_validateLength(t);return _register.call(this,"symbols",arguments)};t.prototype.min=function(t){_validateLength(t);return _register.call(this,"min",arguments)};t.prototype.max=function(t){_validateLength(t);return _register.call(this,"max",arguments)};t.prototype.lowercase=function(t){t&&_validateLength(t);return _register.call(this,"lowercase",arguments)};t.prototype.uppercase=function(t){t&&_validateLength(t);return _register.call(this,"uppercase",arguments)};t.prototype.spaces=function(t){t&&_validateLength(t);return _register.call(this,"spaces",arguments)};t.prototype.has=function(){return _register.call(this,"has",arguments)};t.prototype.not=function(){return _register.call(this,"not",arguments)};t.prototype.is=function(){return _register.call(this,"is",arguments)};t.prototype.oneOf=function(){return _register.call(this,"oneOf",arguments)};return t}();var src=PasswordValidator;var passwordSchema=(new src).is().min(8).has().uppercase().has().lowercase().has(/([\d`~\!@#\$%\^\&\*\(\)\-_\=\+\[\{\}\]\\\|;:'",<.>\/\?€£¥₹§±].*){1,}/);var validateNewPassword=function(t,e){var s=passwordSchema.validate(t,{list:true});var r=getErrorMessage(s,t,e);return r};var Valid=function(){return h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},h("path",{d:"M6 0C2.688 0 0 2.688 0 6C0 9.312 2.688 12 6 12C9.312 12 12 9.312 12 6C12 2.688 9.312 0 6 0ZM4.8 9L1.8 6L2.646 5.154L4.8 7.302L9.354 2.748L10.2 3.6L4.8 9Z",fill:"#259053"}))};var Invalid=function(){return h("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h("path",{d:"M6 0C2.688 0 0 2.688 0 6C0 9.312 2.688 12 6 12C9.312 12 12 9.312 12 6C12 2.688 9.312 0 6 0ZM6 10.8C3.354 10.8 1.2 8.646 1.2 6C1.2 3.354 3.354 1.2 6 1.2C8.646 1.2 10.8 3.354 10.8 6C10.8 8.646 8.646 10.8 6 10.8ZM8.754 3.348L4.8 7.302L3.246 5.754L2.4 6.6L4.8 9L9.6 4.2L8.754 3.348Z",fill:"#555555"}))};var baseItem={display:"flex",alignItems:"center",fontSize:"var(--sl-font-size-small)","& > :not(:last-child)":{"margin-right":"var(--sl-spacing-x-small)"}};var style={Base:{fontSize:"var(--sl-font-size-small)"},ValidationList:{"list-style-type":"none",paddingRight:"var(--sl-spacing-large)",margin:"var(--sl-spacing-small) 0 var(--sl-spacing-x-large)","& > :not(:last-child)":{"margin-bottom":"var(--sl-spacing-xx-small)"},"& *":{"line-height":"var(--sl-line-height-dense)"}},ValidationItemValid:__assign(__assign({},baseItem),{color:"var(--sl-color-success-600)"}),ValidationItemInvalid:__assign({},baseItem)};var sheet=createStyleSheet(style);var styleString=sheet.toString();var getErrorMessage=function(t,e,s){var r={min:s.minErrorText,uppercase:s.uppercaseErrorText,lowercase:s.lowercaseErrorText,has:s.hasErrorText};if(!t.length&&e)return h("div",{class:sheet.classes.ValidationItemValid,style:{paddingBottom:"var(--sl-spacing-x-large)"}},h("style",{type:"text/css"},styleString),h(Valid,null)," ",h("span",null,s.meetsRequirementsText));return h("div",{class:sheet.classes.Base},h("style",{type:"text/css"},styleString),s.doesNotMeetRequirementsText,h("ul",{class:sheet.classes.ValidationList},Object.keys(r).map((function(e){return t.includes(e)?h("li",{class:sheet.classes.ValidationItemInvalid},h(Invalid,null)," ",h("span",null,r[e])):h("li",{class:sheet.classes.ValidationItemValid},h(Valid,null)," ",h("span",null,r[e]))}))))};var style$1={InputContainer:{"& > :not(:last-child)":{"margin-bottom":"20px"}},ErrorStyle:ErrorStyles};var vanillaStyle="\n:host {\n margin: 0 auto;\n width: 100%;\n display: block;\n}\n:host([hidden]): {\n display: none;\n}\n";var sheet$1=createStyleSheet(style$1);var styleString$1=sheet$1.toString();function PortalResetPasswordView(t){var e,s,r,i,a,n,o,l,d,u;var c=t.states,p=t.callbacks;return h("div",{class:sheet$1.classes.InputContainer,part:"sqm-base"},h("style",{type:"text/css"},vanillaStyle,styleString$1),h("sl-input",Object.assign({exportparts:"label: input-label, base: input-base",type:"password",name:"/password",label:c.content.fieldLabel||"Password",required:true,disabled:((e=c.registrationFormState)===null||e===void 0?void 0:e.loading)||((s=c.registrationFormState)===null||s===void 0?void 0:s.disabled),validationError:function(t){var e=t.value;if(!e){return"Cannot be empty"}}},((i=(r=c.registrationFormState)===null||r===void 0?void 0:r.initialData)===null||i===void 0?void 0:i.password)?{value:(n=(a=c.registrationFormState)===null||a===void 0?void 0:a.initialData)===null||n===void 0?void 0:n.password}:{},((l=(o=c.registrationFormState)===null||o===void 0?void 0:o.validationErrors)===null||l===void 0?void 0:l.password)?{class:sheet$1.classes.ErrorStyle,helpText:((u=(d=c.registrationFormState)===null||d===void 0?void 0:d.validationErrors)===null||u===void 0?void 0:u.password)||"Cannot be empty"}:[],{onInput:function(t){return c.enableValidation&&p.onInput(t)}})),c.dynamicValidation)}function usePasswordField(t){var e=d(REGISTRATION_FORM_STATE_CONTEXT);var s=useState(""),r=s[0],i=s[1];function a(e){var s=validateNewPassword(e.target.value,t);i(s)}return{states:{enableValidation:!t.disableValidation,dynamicValidation:r,registrationFormState:e,content:{fieldLabel:t.fieldLabel}},callbacks:{onInput:a}}}var PortalPasswordField=function(){function t(t){registerInstance(this,t);this.ignored=true;this.fieldLabel="Password";this.disableValidation=false;this.meetsRequirementsText="Password has met all requirements";this.doesNotMeetRequirementsText="Password must meet the following requirements:";this.minErrorText="be a minimum of 8 characters";this.uppercaseErrorText="contain at least 1 uppercase character";this.lowercaseErrorText="contain at least 1 lowercase character";this.hasErrorText="contain at least 1 number or symbol";h$1(this)}t.prototype.disconnectedCallback=function(){};t.prototype.render=function(){var t=isDemo()?usePasswordFieldDemo(getProps(this)):usePasswordField(getProps(this)),e=t.states,s=t.callbacks;return h(PortalResetPasswordView,{states:e,callbacks:s})};return t}();function usePasswordFieldDemo(t){var e,s,r,i,a,n,o;var l=useState(""),d=l[0],u=l[1];var c=useState(""),h=c[0],p=c[1];if(t.demoData&&h!=((e=t===null||t===void 0?void 0:t.demoData)===null||e===void 0?void 0:e.initValue)){var v=validateNewPassword(((s=t===null||t===void 0?void 0:t.demoData)===null||s===void 0?void 0:s.initValue)||"",t);u(((r=t===null||t===void 0?void 0:t.demoData)===null||r===void 0?void 0:r.initValue)===""?"":v);p((i=t===null||t===void 0?void 0:t.demoData)===null||i===void 0?void 0:i.initValue)}function g(e){var s=validateNewPassword(e.target.value,t);u(s)}return cjs({states:{enableValidation:!t.disableValidation,dynamicValidation:d,registrationFormState:((n=(a=t===null||t===void 0?void 0:t.demoData)===null||a===void 0?void 0:a.states)===null||n===void 0?void 0:n.registrationFormState)||{},content:{fieldLabel:t.fieldLabel}},callbacks:{onInput:g}},((o=t===null||t===void 0?void 0:t.demoData)===null||o===void 0?void 0:o.states)||{},{arrayMerge:function(t,e){return e}})}export{PortalPasswordField as sqm_password_field};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var o
|
|
1
|
+
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var e,o=1,s=arguments.length;o<s;o++){e=arguments[o];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[n]=e[n]}return t};return __assign.apply(this,arguments)};import{h,c as Host,r as registerInstance}from"./index-b3a06de8.js";import{n as h$1}from"./dom-context-hooks.module-63370afd.js";import{B}from"./index.module-c9811a48.js";import{g as getProps}from"./utils-334c1e34.js";var PopupContainerView=function(t){var e=t.states,o=t.callbacks;var s=e.styles;return h(Host,{class:"squatch-container"},h("div",{style:{padding:t.states.styles.padding},part:"sqm-base"},s.closeButton&&h("span",{part:"sqm-close-button",class:"close squatch-header-close","data-close-panel":"#squatch-panel",onClick:function(){return o.closePopup()}},s.closeButtonText),h("slot",null),s.poweredBy?h("a",{class:"sqh-attribution",href:"https://impact.com/advocate/",target:"_blank"},s.poweredByText):""))};function usePopupContainer(t){var e=B();function o(){var t;if(B()==="POPUP"){(t=window.frameElement["squatchJsApi"])===null||t===void 0?void 0:t.close()}}var s=t.popupPadding?t.popupPadding==="none"?"0":"var(--sl-spacing-"+t.popupPadding+")":"var(--sl-spacing-medium)";var n=t.embedPadding?t.embedPadding==="none"?"0":"var(--sl-spacing-"+t.embedPadding+")":"0";var a=B()==="POPUP"?s:n;return{states:{showCloseButton:t.closeButton&&e==="POPUP",styles:__assign(__assign({},t),{padding:a,closeButtonText:t.closeButtonText?t.closeButtonText:"X",poweredByText:t.poweredByText})},data:{},callbacks:{closePopup:o}}}var sqmPopupContainerCss=".squatch-header-close{position:absolute;right:20px;top:10px;cursor:pointer}.squatch-container{background-color:var(--widget-background-color);display:block}";var PopupContainer=function(){function t(t){registerInstance(this,t);this.poweredByText="Powered By";h$1(this)}t.prototype.disconnectedCallback=function(){};t.prototype.render=function(){var t=getProps(this);return h(PopupContainerView,Object.assign({},usePopupContainer(t)))};return t}();PopupContainer.style=sqmPopupContainerCss;export{PopupContainer as sqm_popup_container};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,o,r){function n(t){return t instanceof o?t:new o((function(e){e(t)}))}return new(o||(o=Promise))((function(o,s){function a(t){try{l(r.next(t))}catch(t){s(t)}}function i(t){try{l(r["throw"](t))}catch(t){s(t)}}function l(t){t.done?o(t.value):n(t.value).then(a,i)}l((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,n,s,a;return a={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function i(t){return function(e){return l([t,e])}}function l(a){if(r)throw new TypeError("Generator is already executing.");while(o)try{if(r=1,n&&(s=a[0]&2?n["return"]:a[0]?n["throw"]||((s=n["return"])&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;if(n=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:o.label++;return{value:a[1],done:false};case 5:o.label++;n=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){o.label=a[1];break}if(a[0]===6&&o.label<s[1]){o.label=s[1];s=a;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(a);break}if(s[2])o.ops.pop();o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t];n=0}finally{r=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import{n as h}from"./dom-context-hooks.module-63370afd.js";import{i as isDemo,j as jn}from"./index.module-c9811a48.js";import"./jsonpointer-388a7082.js";import{c as cjs}from"./cjs-bdfb4486.js";import"./utils-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,e,o,r){function n(t){return t instanceof o?t:new o((function(e){e(t)}))}return new(o||(o=Promise))((function(o,s){function a(t){try{l(r.next(t))}catch(t){s(t)}}function i(t){try{l(r["throw"](t))}catch(t){s(t)}}function l(t){t.done?o(t.value):n(t.value).then(a,i)}l((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,n,s,a;return a={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function i(t){return function(e){return l([t,e])}}function l(a){if(r)throw new TypeError("Generator is already executing.");while(o)try{if(r=1,n&&(s=a[0]&2?n["return"]:a[0]?n["throw"]||((s=n["return"])&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;if(n=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:o.label++;return{value:a[1],done:false};case 5:o.label++;n=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){o.label=a[1];break}if(a[0]===6&&o.label<s[1]){o.label=s[1];s=a;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(a);break}if(s[2])o.ops.pop();o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t];n=0}finally{r=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import{n as h}from"./dom-context-hooks.module-63370afd.js";import{i as isDemo,j as jn}from"./index.module-c9811a48.js";import"./jsonpointer-388a7082.js";import{c as cjs}from"./cjs-bdfb4486.js";import"./utils-334c1e34.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import"./mixins-f750863a.js";import"./sqm-text-span-view-4c17b8c9.js";import{P as PortalLoginView}from"./sqm-portal-login-view-7670cd86.js";import{u as usePortalLogin}from"./usePortalLogin-f95bbc67.js";var PortalGoogleLogin=function(){function t(t){registerInstance(this,t);this.ignored=true;this.nextPage="/";this.emailLabel="Email";this.passwordLabel="Password";this.submitLabel="Sign In";this.forgotPasswordPath="/forgotPassword";this.forgotPasswordLabel="Forgot Password?";this.registerLabel="Register";this.registerPath="/register";this.pageLabel="Sign in to your account";this.networkErrorMessage="An error occurred while logging you in. Please refresh the page and try again.";this.googleUserNotRegisteredError="Your Google account has not registered on our platform. Please complete the registration process with your Google account.";this.registerCTA="Don't have an account?";h(this)}t.prototype.disconnectedCallback=function(){};t.prototype.render=function(){var t=isDemo()?useLoginDemo(this):usePortalLogin(this),e=t.states,o=t.callbacks;var r={RegisterButton:{"&::part(label)":{padding:"0"}}};var n=createStyleSheet(r);var s=n.toString();var a={forgotPasswordButton:h$1("slot",{name:"forgotPassword"},h$1("a",{onClick:function(){return jn.push(e.forgotPasswordPath)}},this.forgotPasswordLabel)),googleButton:h$1("sqm-google-sign-in",{onInitComplete:o.googleSubmit}),secondaryButton:h$1("slot",{name:"secondaryButton"},h$1("style",null,s),h$1("span",null,this.registerCTA," ",h$1("sl-button",{size:"large",type:"text",disabled:e.loading,onClick:function(){return jn.push(e.registerPath)},className:n.classes.RegisterButton},this.registerLabel))),emailLabel:this.emailLabel,passwordLabel:this.passwordLabel,submitLabel:this.submitLabel,pageLabel:this.pageLabel};return h$1(PortalLoginView,{states:e,callbacks:o,content:a})};return t}();function useLoginDemo(t){var e=this;return cjs({states:{error:"",loading:false,forgotPasswordPath:"/forgotPassword",registerPath:"/register",showLoginForm:"manual"},callbacks:{googleSubmit:function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){console.log("google submit");return[2]}))}))},submit:function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){console.log("submit");return[2]}))}))}},content:{googleButton:null}},t.demoData||{},{arrayMerge:function(t,e){return e}})}export{PortalGoogleLogin as sqm_portal_google_login};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __makeTemplateObject=this&&this.__makeTemplateObject||function(e,t){if(Object.defineProperty){Object.defineProperty(e,"raw",{value:t})}else{e.raw=t}return e};var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return __assign.apply(this,arguments)};import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import"./global-1099f20d.js";import{k as useState,f as useEffect,n as h}from"./dom-context-hooks.module-63370afd.js";import{d as dist,J,w as wn,$ as $e,i as isDemo}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import{g as getProps}from"./utils-
|
|
1
|
+
var __makeTemplateObject=this&&this.__makeTemplateObject||function(e,t){if(Object.defineProperty){Object.defineProperty(e,"raw",{value:t})}else{e.raw=t}return e};var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return __assign.apply(this,arguments)};import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import"./global-1099f20d.js";import{k as useState,f as useEffect,n as h}from"./dom-context-hooks.module-63370afd.js";import{d as dist,J,w as wn,$ as $e,i as isDemo}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import{g as getProps}from"./utils-334c1e34.js";import"./JSS-67b5cff8.js";import"./sqm-text-span-view-4c17b8c9.js";import{P as PortalProfileView}from"./sqm-portal-profile-view-3ed13e4d.js";import{i as isEmpty}from"./utilities-72c07b09.js";var GET_USER=dist.gql(templateObject_1||(templateObject_1=__makeTemplateObject(["\n query {\n viewer {\n ... on User {\n id\n accountId\n firstName\n lastName\n email\n countryCode\n }\n }\n }\n"],["\n query {\n viewer {\n ... on User {\n id\n accountId\n firstName\n lastName\n email\n countryCode\n }\n }\n }\n"])));var UPSERT_USER=dist.gql(templateObject_2||(templateObject_2=__makeTemplateObject(["\n mutation (\n $id: String!\n $accountId: String!\n $firstName: String!\n $lastName: String!\n ) {\n upsertUser(\n userInput: {\n id: $id\n accountId: $accountId\n firstName: $firstName\n lastName: $lastName\n }\n ) {\n firstName\n lastName\n }\n }\n"],["\n mutation (\n $id: String!\n $accountId: String!\n $firstName: String!\n $lastName: String!\n ) {\n upsertUser(\n userInput: {\n id: $id\n accountId: $accountId\n firstName: $firstName\n lastName: $lastName\n }\n ) {\n firstName\n lastName\n }\n }\n"])));var defaultFormState={country:"",email:"",firstName:"",lastName:"",errors:{},error:""};function usePortalProfile(e){var t=J();var r=useState(false),i=r[0],n=r[1];var a=useState(undefined),s=a[0],o=a[1];var l=useState(defaultFormState),u=l[0],d=l[1];var m=wn(GET_USER,{},!(t===null||t===void 0?void 0:t.jwt));var f=$e(UPSERT_USER),c=f[0],v=f[1];useEffect((function(){if(v===null||v===void 0?void 0:v.loading)return;if(v===null||v===void 0?void 0:v.errors){d((function(e){var t,r,i;return __assign(__assign({},e),{error:(i=(r=(t=v===null||v===void 0?void 0:v.errors)===null||t===void 0?void 0:t.response)===null||r===void 0?void 0:r.errors)===null||i===void 0?void 0:i[0].message})}))}else{o((function(e){var t;return __assign(__assign({},e),(t=v===null||v===void 0?void 0:v.data)===null||t===void 0?void 0:t.upsertUser)}));if(v===null||v===void 0?void 0:v.data)n(true)}}),[v===null||v===void 0?void 0:v.loading]);useEffect((function(){var e,t;o((function(e){var t;return __assign(__assign({},e),(t=m===null||m===void 0?void 0:m.data)===null||t===void 0?void 0:t.viewer)}));d(__assign(__assign(__assign({},defaultFormState),(e=m.data)===null||e===void 0?void 0:e.viewer),(t=v.data)===null||t===void 0?void 0:t.upsertUser))}),[m===null||m===void 0?void 0:m.data]);useEffect((function(){var t,r;if((t=v===null||v===void 0?void 0:v.errors)===null||t===void 0?void 0:t.message){d(__assign(__assign({},(r=m.data)===null||r===void 0?void 0:r.viewer),{error:e.networkRequestMessage}))}}),[v===null||v===void 0?void 0:v.errors]);var g=function(){n(false);if(u.firstName&&u.lastName){c({id:t===null||t===void 0?void 0:t.id,accountId:t===null||t===void 0?void 0:t.accountId,firstName:u.firstName,lastName:u.lastName});d((function(e){return __assign(__assign({},e),{errors:{},error:""})}));return}var r={};if(!u.firstName){r["firstName"]={message:e.fieldEmptyText}}if(!u.lastName){r["lastName"]={message:e.fieldEmptyText}}if(!isEmpty(r)){d((function(t){return __assign(__assign({},t),{error:e.formErrorText})}))}d((function(e){return __assign(__assign({},e),{errors:r})}))};return{states:{success:i,loading:(m===null||m===void 0?void 0:m.loading)||v.loading,submitDisabled:false,showCountry:!e.hideCountry,formState:u,user:s,text:{firstnametext:e.firstnametext,lastnametext:e.lastnametext,countrytext:e.countrytext,emailtext:e.emailtext,editProfileHeader:e.editProfileHeader,editProfileSubHeader:e.editProfileSubHeader,submitChangeButtonText:e.submitChangeButtonText}},callbacks:{onSubmit:g,onChange:function(e){var t=e.target,r=t.name,i=t.value;d((function(e){var t;return __assign(__assign({},e),(t={},t[r]=i,t))}))}}}}var PortalProfile=function(){function e(e){registerInstance(this,e);this.ignored=true;this.firstnametext="First Name";this.lastnametext="Last Name";this.emailtext="Email";this.countrytext="Country";this.editProfileHeader="Edit your profile";this.editProfileSubHeader="Personal Information";this.submitChangeButtonText="Submit Changes";this.hideCountry=false;this.networkRequestMessage="An error occurred while loading this page. Please refresh the page.";this.fieldEmptyText="Field is required";this.formErrorText="Please correct the errors below to update your profile.";this.submissionSuccessText="Your profile has been successfully updated.";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?usePortalProfileDemo(getProps(this)):usePortalProfile(getProps(this));return h$1(PortalProfileView,Object.assign({},e))};return e}();function usePortalProfileDemo(e){return cjs({states:{success:false,loading:false,submitDisabled:false,showCountry:!e.hideCountry,user:{id:"01",accountId:"111100000",firstName:"Joe",lastName:"Smith",email:"jsmith@gmail.com",countryCode:"CA"},text:{firstnametext:e.firstnametext,lastnametext:e.lastnametext,emailtext:e.emailtext,countrytext:e.countrytext,editProfileHeader:e.editProfileHeader,editProfileSubHeader:e.editProfileSubHeader,submitChangeButtonText:e.submitChangeButtonText,submissionSuccessText:e.submissionSuccessText,fieldEmptyText:e.fieldEmptyText},formState:{country:"Canada",firstName:"Joe",lastName:"Smith",errors:null,error:""}},callbacks:{onSubmit:function(e){return console.log(e)},onChange:function(e){return console.log(e)}}},e.demoData||{},{arrayMerge:function(e,t){return t}})}export{PortalProfile as sqm_portal_profile};var templateObject_1,templateObject_2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,r,t,s){function o(e){return e instanceof t?e:new t((function(r){r(e)}))}return new(t||(t=Promise))((function(t,a){function n(e){try{d(s.next(e))}catch(e){a(e)}}function i(e){try{d(s["throw"](e))}catch(e){a(e)}}function d(e){e.done?t(e.value):o(e.value).then(n,i)}d((s=s.apply(e,r||[])).next())}))};var __generator=this&&this.__generator||function(e,r){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},s,o,a,n;return n={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function i(e){return function(r){return d([e,r])}}function d(n){if(s)throw new TypeError("Generator is already executing.");while(t)try{if(s=1,o&&(a=n[0]&2?o["return"]:n[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,n[1])).done)return a;if(o=0,a)n=[n[0]&2,a.value];switch(n[0]){case 0:case 1:a=n;break;case 4:t.label++;return{value:n[1],done:false};case 5:t.label++;o=n[1];n=[0];continue;case 7:n=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(n[0]===6||n[0]===2)){t=0;continue}if(n[0]===3&&(!a||n[1]>a[0]&&n[1]<a[3])){t.label=n[1];break}if(n[0]===6&&t.label<a[1]){t.label=a[1];a=n;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(n);break}if(a[2])t.ops.pop();t.trys.pop();continue}n=r.call(e,t)}catch(e){n=[6,e];o=0}finally{s=a=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import{k as useState,f as useEffect,n as h}from"./dom-context-hooks.module-63370afd.js";import{e as Je,T as Te,j as jn,i as isDemo}from"./index.module-c9811a48.js";import{j as jsonpointer}from"./jsonpointer-388a7082.js";import{c as cjs}from"./cjs-bdfb4486.js";import{s as sanitizeUrlPath}from"./utils-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,r,t,s){function o(e){return e instanceof t?e:new t((function(r){r(e)}))}return new(t||(t=Promise))((function(t,a){function n(e){try{d(s.next(e))}catch(e){a(e)}}function i(e){try{d(s["throw"](e))}catch(e){a(e)}}function d(e){e.done?t(e.value):o(e.value).then(n,i)}d((s=s.apply(e,r||[])).next())}))};var __generator=this&&this.__generator||function(e,r){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},s,o,a,n;return n={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function i(e){return function(r){return d([e,r])}}function d(n){if(s)throw new TypeError("Generator is already executing.");while(t)try{if(s=1,o&&(a=n[0]&2?o["return"]:n[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,n[1])).done)return a;if(o=0,a)n=[n[0]&2,a.value];switch(n[0]){case 0:case 1:a=n;break;case 4:t.label++;return{value:n[1],done:false};case 5:t.label++;o=n[1];n=[0];continue;case 7:n=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(n[0]===6||n[0]===2)){t=0;continue}if(n[0]===3&&(!a||n[1]>a[0]&&n[1]<a[3])){t.label=n[1];break}if(n[0]===6&&t.label<a[1]){t.label=a[1];a=n;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(n);break}if(a[2])t.ops.pop();t.trys.pop();continue}n=r.call(e,t)}catch(e){n=[6,e];o=0}finally{s=a=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import{k as useState,f as useEffect,n as h}from"./dom-context-hooks.module-63370afd.js";import{e as Je,T as Te,j as jn,i as isDemo}from"./index.module-c9811a48.js";import{j as jsonpointer}from"./jsonpointer-388a7082.js";import{c as cjs}from"./cjs-bdfb4486.js";import{s as sanitizeUrlPath}from"./utils-334c1e34.js";import"./JSS-67b5cff8.js";import"./mixins-f750863a.js";import"./sqm-text-span-view-4c17b8c9.js";import{P as PortalResetPasswordView}from"./sqm-portal-reset-password-view-abef7286.js";function usePortalResetPassword(e){var r=this;var t,s,o,a,n,i,d,c,u,l;var f=useState(false),w=f[0],h=f[1];var m=useState(""),p=m[0],x=m[1];var v=Je(),T=v[0],P=v[1];var b=Te(),g=b[0],E=b[1];var y=new URLSearchParams(jn.location.search);var R=y.get("oobCode");y.delete("oobCode");var _=y.get("nextPage");var j=function(){return __awaiter(r,void 0,void 0,(function(){var r;return __generator(this,(function(t){switch(t.label){case 0:return[4,T({oobCode:R})];case 1:r=t.sent();if(r instanceof Error){x(e.networkErrorMessage)}return[2]}}))}))};useEffect((function(){j()}),[]);var M=function(t){return __awaiter(r,void 0,void 0,(function(){var r,s,o;return __generator(this,(function(a){switch(a.label){case 0:x("");r=t.detail.formData;r===null||r===void 0?void 0:r.forEach((function(e,t){jsonpointer.set(r,t,e)}));s={oobCode:R,password:r.password};if(r.password!==r.confirmPassword){x(e.passwordMismatchText);return[2]}return[4,g(s)];case 1:o=a.sent();if(o instanceof Error){return[2,x(e.networkErrorMessage)]}if(o.resetManagedIdentityPassword){h(true);setTimeout((function(){k()}),5e3)}return[2]}}))}))};var k=function(){y.delete("nextPage");var r=sanitizeUrlPath(_||e.nextPage);jn.push(r.href)};var q=function(){jn.push({pathname:e.failedPage,search:y.toString()&&"?"+y.toString()})};return{states:{loading:E.loading,reset:w,confirmPassword:e.confirmPassword,error:((n=(a=(o=(s=(t=E.errors)===null||t===void 0?void 0:t.response)===null||s===void 0?void 0:s.errors)===null||o===void 0?void 0:o[0])===null||a===void 0?void 0:a.extensions)===null||n===void 0?void 0:n.message)||((u=(c=(d=(i=E.errors)===null||i===void 0?void 0:i.response)===null||d===void 0?void 0:d.errors)===null||c===void 0?void 0:c[0])===null||u===void 0?void 0:u.message)||p,oobCodeValidating:P.loading,oobCodeValid:(l=P.data)===null||l===void 0?void 0:l.verifyManagedIdentityPasswordResetCode.success,content:{passwordResetHeader:e.passwordResetHeader,resetPasswordHeader:e.resetPasswordHeader,continueButtonText:e.continueButtonText,resetPasswordButtonText:e.resetPasswordButtonText,confirmPasswordFieldLabel:e.confirmPasswordFieldLabel,passwordFieldLabel:e.passwordFieldLabel,meetsRequirementsText:e.meetsRequirementsText,doesNotMeetRequirementsText:e.doesNotMeetRequirementsText,minErrorText:e.minErrorText,uppercaseErrorText:e.uppercaseErrorText,lowercaseErrorText:e.lowercaseErrorText,hasErrorText:e.hasErrorText,passwordMismatchText:e.passwordMismatchText,codeInvalidText:e.codeInvalidText,resetSuccessText:e.resetSuccessText}},callbacks:{submit:M,failed:q,gotoNextPage:k}}}var PortalResetPassword=function(){function e(e){registerInstance(this,e);this.ignored=true;this.nextPage="/";this.failedPage="/";this.confirmPassword=false;this.resetPasswordHeader="Reset your password";this.passwordResetHeader="Password reset";this.resetPasswordButtonText="Reset Password";this.continueButtonText="Continue";this.confirmPasswordFieldLabel="Confirm Password";this.passwordFieldLabel="New Password";this.meetsRequirementsText="Password has met all requirements";this.doesNotMeetRequirementsText="Password must meet the following requirements:";this.minErrorText="be a minimum of 8 characters";this.uppercaseErrorText="contain at least 1 uppercase character";this.lowercaseErrorText="contain at least 1 lowercase character";this.hasErrorText="contain at least 1 number or symbol";this.passwordMismatchText="Passwords do not match.";this.codeInvalidText="The password reset code is invalid or has expired, please try again.";this.resetSuccessText="Your password has been reset and you are being redirected. If you are not redirected, please click Continue.";this.networkErrorMessage="An error occurred while resetting your password. Please refresh the page and try again.";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?usePortalResetPasswordDemo(this):usePortalResetPassword(this),r=e.states,t=e.callbacks;return h$1(PortalResetPasswordView,{states:r,callbacks:t})};return e}();function usePortalResetPasswordDemo(e){var r=this;return cjs({states:{error:"",loading:false,reset:false,confirmPassword:e.confirmPassword,oobCodeValidating:false,oobCodeValid:true,content:{passwordResetHeader:e.passwordResetHeader,resetPasswordHeader:e.resetPasswordHeader,continueButtonText:e.continueButtonText,resetPasswordButtonText:e.resetPasswordButtonText,confirmPasswordFieldLabel:e.confirmPasswordFieldLabel,passwordFieldLabel:e.passwordFieldLabel,meetsRequirementsText:e.meetsRequirementsText,doesNotMeetRequirementsText:e.doesNotMeetRequirementsText,minErrorText:e.minErrorText,uppercaseErrorText:e.uppercaseErrorText,lowercaseErrorText:e.lowercaseErrorText,hasErrorText:e.hasErrorText,passwordMismatchText:e.passwordMismatchText,codeInvalidText:e.codeInvalidText,resetSuccessText:e.resetSuccessText}},callbacks:{submit:function(e){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){console.log("submit");return[2]}))}))},failed:function(){},gotoNextPage:function(){}}},e.demoData||{},{arrayMerge:function(e,r){return r}})}export{PortalResetPassword as sqm_portal_reset_password};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,i,r){function n(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r["throw"](e))}catch(e){a(e)}}function l(e){e.done?i(e.value):n(e.value).then(o,s)}l((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,n,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return l([e,t])}}function l(o){if(r)throw new TypeError("Generator is already executing.");while(i)try{if(r=1,n&&(a=o[0]&2?n["return"]:o[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;if(n=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:i.label++;return{value:o[1],done:false};case 5:i.label++;n=o[1];o=[0];continue;case 7:o=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){i=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(o[0]===6&&i.label<a[1]){i.label=a[1];a=o;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(o);break}if(a[2])i.ops.pop();i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e];n=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import{k as useState,f as useEffect,n as h}from"./dom-context-hooks.module-63370afd.js";import{J,f as an,j as jn,b as setUserIdentity,i as isDemo}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import{s as sanitizeUrlPath,g as getProps}from"./utils-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,i,r){function n(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r["throw"](e))}catch(e){a(e)}}function l(e){e.done?i(e.value):n(e.value).then(o,s)}l((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,n,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return l([e,t])}}function l(o){if(r)throw new TypeError("Generator is already executing.");while(i)try{if(r=1,n&&(a=o[0]&2?n["return"]:o[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;if(n=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:i.label++;return{value:o[1],done:false};case 5:i.label++;n=o[1];o=[0];continue;case 7:o=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){i=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(o[0]===6&&i.label<a[1]){i.label=a[1];a=o;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(o);break}if(a[2])i.ops.pop();i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e];n=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import{k as useState,f as useEffect,n as h}from"./dom-context-hooks.module-63370afd.js";import{J,f as an,j as jn,b as setUserIdentity,i as isDemo}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import{s as sanitizeUrlPath,g as getProps}from"./utils-334c1e34.js";import"./JSS-67b5cff8.js";import"./mixins-f750863a.js";import"./sqm-text-span-view-4c17b8c9.js";import{P as PortalVerifyEmailView}from"./sqm-portal-verify-email-view-33805220.js";var globalPromise=null;function usePortalVerifyEmail(e){var t=this;var i=e.nextPage,r=e.failedPage,n=e.verifySuccessText,a=e.verifyEmailText,o=e.verifyInvalidText,s=e.networkErrorMessage,l=e.continueText;var u,c,f,d,v,m,y,h,g,p;var x=useState(false),b=x[0],P=x[1];var T=useState(false),w=T[0],E=T[1];var j=J();var S=an(),_=S[0],k=S[1],I=k.loading,V=k.data,C=k.errors;var D=new URLSearchParams(jn.location.search);var M=D.get("oobCode");var U=D.get("email");var q=D.get("nextPage");var z=V===undefined&&C===undefined&&!!M;var N=!!(((u=j===null||j===void 0?void 0:j.managedIdentity)===null||u===void 0?void 0:u.emailVerified)||((c=V===null||V===void 0?void 0:V.verifyManagedIdentityEmail)===null||c===void 0?void 0:c.success)||w);var $=((f=j===null||j===void 0?void 0:j.managedIdentity)===null||f===void 0?void 0:f.email)===U;var A=function(){return jn.push({pathname:r,search:D.toString()&&"?"+D.toString()})};var G=function(){D.delete("nextPage");var e=sanitizeUrlPath(q||i);jn.push(e.href)};var L=function(){setTimeout((function(){setUserIdentity(undefined);G()}),3e3)};var R=function(){setTimeout(G,3e3)};useEffect((function(){var e=function(){return __awaiter(t,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:if(!globalPromise)globalPromise=_({oobCode:M});return[4,globalPromise];case 1:e=t.sent();if(!(e instanceof Error)&&e.verifyManagedIdentityEmail.success){E(true)}P(true);return[2]}}))}))};e()}),[]);useEffect((function(){if(!b)return;if(N&&$)R();else L()}),[b,N]);return{states:{loading:I||!b,disableContinue:z,error:((y=(m=(v=(d=C===null||C===void 0?void 0:C.response)===null||d===void 0?void 0:d.errors)===null||v===void 0?void 0:v[0])===null||m===void 0?void 0:m.extensions)===null||y===void 0?void 0:y.message)||((p=(g=(h=C===null||C===void 0?void 0:C.response)===null||h===void 0?void 0:h.errors)===null||g===void 0?void 0:g[0])===null||p===void 0?void 0:p.message)||((C===null||C===void 0?void 0:C.message)||!$)&&s,success:b&&(N||$)},data:{oobCode:M},callbacks:{failed:A,gotoNextPage:G},content:{verifySuccessText:n,verifyEmailText:a,verifyInvalidText:o,continueText:l}}}var PortalVerifyEmail=function(){function e(e){registerInstance(this,e);this.ignored=true;this.nextPage="/";this.failedPage="/";this.verifyEmailText="Verify your email";this.verifySuccessText="Your email has been verified and you are being redirected. If you are not redirected, please click Continue.";this.verifyInvalidText="The email verification code is invalid or has expired, please try again.";this.continueText="Continue";this.networkErrorMessage="An error occurred while verifying your email. Please refresh the page and try again.";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?usePortalVerifyEmailDemo(getProps(this)):usePortalVerifyEmail(getProps(this)),t=e.states,i=e.data,r=e.callbacks,n=e.content;return h$1(PortalVerifyEmailView,{states:t,data:i,callbacks:r,content:n})};return e}();function usePortalVerifyEmailDemo(e){return cjs({states:{error:"",loading:false,success:true},data:{oobCode:"code"},callbacks:{failed:function(){console.log("failed")},gotoNextPage:function(){}},content:{verifySuccessText:e.verifySuccessText,verifyEmailText:e.verifyEmailText,verifyInvalidText:e.verifyInvalidText,continueText:e.continueText}},e.demoData||{},{arrayMerge:function(e,t){return t}})}export{PortalVerifyEmail as sqm_portal_verify_email};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __makeTemplateObject=this&&this.__makeTemplateObject||function(e,t){if(Object.defineProperty){Object.defineProperty(e,"raw",{value:t})}else{e.raw=t}return e};var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o))e[o]=t[o]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function i(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r["throw"](e))}catch(e){a(e)}}function c(e){e.done?n(e.value):o(e.value).then(i,s)}c((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,o,a,i;return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(t){return c([e,t])}}function c(i){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,o&&(a=i[0]&2?o["return"]:i[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,i[1])).done)return a;if(o=0,a)i=[i[0]&2,a.value];switch(i[0]){case 0:case 1:a=i;break;case 4:n.label++;return{value:i[1],done:false};case 5:n.label++;o=i[1];i=[0];continue;case 7:i=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(i[0]===6||i[0]===2)){n=0;continue}if(i[0]===3&&(!a||i[1]>a[0]&&i[1]<a[3])){n.label=i[1];break}if(i[0]===6&&n.label<a[1]){n.label=a[1];a=i;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(i);break}if(a[2])n.ops.pop();n.trys.pop();continue}i=t.call(e,n)}catch(e){i=[6,e];o=0}finally{r=a=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import{k as useState,f as useEffect,n as h}from"./dom-context-hooks.module-63370afd.js";import{d as dist,H,J,B,F as Fn,w as wn,$ as $e,i as isDemo}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import{g as getProps}from"./utils-
|
|
1
|
+
var __makeTemplateObject=this&&this.__makeTemplateObject||function(e,t){if(Object.defineProperty){Object.defineProperty(e,"raw",{value:t})}else{e.raw=t}return e};var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o))e[o]=t[o]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function i(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r["throw"](e))}catch(e){a(e)}}function c(e){e.done?n(e.value):o(e.value).then(i,s)}c((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,o,a,i;return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(t){return c([e,t])}}function c(i){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,o&&(a=i[0]&2?o["return"]:i[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,i[1])).done)return a;if(o=0,a)i=[i[0]&2,a.value];switch(i[0]){case 0:case 1:a=i;break;case 4:n.label++;return{value:i[1],done:false};case 5:n.label++;o=i[1];i=[0];continue;case 7:i=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(i[0]===6||i[0]===2)){n=0;continue}if(i[0]===3&&(!a||i[1]>a[0]&&i[1]<a[3])){n.label=i[1];break}if(i[0]===6&&n.label<a[1]){n.label=a[1];a=i;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(i);break}if(a[2])n.ops.pop();n.trys.pop();continue}i=t.call(e,n)}catch(e){i=[6,e];o=0}finally{r=a=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import{k as useState,f as useEffect,n as h}from"./dom-context-hooks.module-63370afd.js";import{d as dist,H,J,B,F as Fn,w as wn,$ as $e,i as isDemo}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import{g as getProps}from"./utils-334c1e34.js";import"./JSS-67b5cff8.js";import{a as REFERRAL_CODES_NAMESPACE}from"./useReferralCodes-c2e809cf.js";import"./ErrorView-bbf0a042.js";import{Q as QrCodeView}from"./sqm-qr-code-view-ea505213.js";var ShareLinkQuery=dist.gql(templateObject_1||(templateObject_1=__makeTemplateObject(["\n query shareLink($programId: ID, $engagementMedium: UserEngagementMedium!) {\n user: viewer {\n ... on User {\n shareLink(\n programId: $programId\n engagementMedium: $engagementMedium\n shareMedium: DIRECT\n )\n }\n }\n }\n"],["\n query shareLink($programId: ID, $engagementMedium: UserEngagementMedium!) {\n user: viewer {\n ... on User {\n shareLink(\n programId: $programId\n engagementMedium: $engagementMedium\n shareMedium: DIRECT\n )\n }\n }\n }\n"])));var WIDGET_ENGAGEMENT_EVENT=dist.gql(templateObject_2||(templateObject_2=__makeTemplateObject(["\n mutation loadEvent($eventMeta: UserAnalyticsEvent!) {\n createUserAnalyticsEvent(eventMeta: $eventMeta)\n }\n"],["\n mutation loadEvent($eventMeta: UserAnalyticsEvent!) {\n createUserAnalyticsEvent(eventMeta: $eventMeta)\n }\n"])));function useQRCode(e){var t=this;var n;var r=H();var o=J();var a=B();var i=Fn(REFERRAL_CODES_NAMESPACE);var s=useState(null),c=s[0],u=s[1];var d=useState(false),l=d[0],f=d[1];var m=useState(false),v=m[0],h=m[1];var g=wn(ShareLinkQuery,{programId:r,engagementMedium:a},!(o===null||o===void 0?void 0:o.jwt)||(i===null||i===void 0?void 0:i.shareLink)!==undefined),p=g.data,_=g.errors,b=g.loading;var w=$e(WIDGET_ENGAGEMENT_EVENT)[0];var E=(n=p===null||p===void 0?void 0:p.user)===null||n===void 0?void 0:n.shareLink;var C=E+"?qrCode";var y=b||v;useEffect((function(){if(!E)return;var e=function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(e){u(E+"?qrCode&qrCodeImageFormat=svg&qrCodeQuietZoneSize=0");return[2]}))}))};e()}),[E]);var T=function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(e){w({eventMeta:{programId:r,id:o===null||o===void 0?void 0:o.id,accountId:o===null||o===void 0?void 0:o.accountId,type:"USER_REFERRAL_PROGRAM_ENGAGEMENT_EVENT",meta:{engagementMedium:a,shareMedium:"DIRECT"}}});return[2]}))}))};var R=function(){return __awaiter(t,void 0,void 0,(function(){var e,t,n,r,o;return __generator(this,(function(a){switch(a.label){case 0:a.trys.push([0,3,,4]);return[4,fetch(C+"&qrCodeSize=800&qrCodeImageFormat=png")];case 1:e=a.sent();return[4,e.blob()];case 2:t=a.sent();n=URL.createObjectURL(t);if(t)T();r=document.createElement("a");r.href=n;r.download="qrCode.png";document.body.appendChild(r);r.click();document.body.removeChild(r);return[3,4];case 3:o=a.sent();console.error("Failed to fetch QR code:",o);f(true);return[3,4];case 4:return[2]}}))}))};var j=function(){return __awaiter(t,void 0,void 0,(function(){var e,t,n,r,o,a;return __generator(this,(function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,fetch(C+"&qrCodeSize=1000&qrCodeImageFormat=png&qrCodeErrorCorrectionLevel=H")];case 1:e=i.sent();return[4,e.blob()];case 2:t=i.sent();n=URL.createObjectURL(t);if(t)T();r=window.open("about:blank","_new");o=r.document.createElement("img");o.src=n;o.onload=function(){r.print();r.close()};r.document.body.appendChild(o);return[3,4];case 3:a=i.sent();console.error("Failed to fetch QR code: ",a);f(true);return[3,4];case 4:return[2]}}))}))};return __assign(__assign({},e),{loading:y,qrLink:c,error:l,createDownloadable:R,createPrintable:j})}var QrCode=function(){function e(e){registerInstance(this,e);this.titleText="Share your QR code";this.viewCodeText="View QR code";this.downloadCodeText="Download";this.printCodeText="Print";this.errorHeaderText="There was an error loading your QR code";this.errorDescriptionText="Please refresh this page and try again";this.hideTitle=false;this.alignment="center";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=getProps(this);var t=isDemo()?useDemoQRCode(e):useQRCode(e);return h$1(QrCodeView,Object.assign({},t))};return e}();function useDemoQRCode(e){var t=this;var n=useState(false),r=n[0],o=n[1];return cjs({dialogIsOpen:r,hideTitle:e.hideTitle,showDialog:function(){return o(true)},hideDialog:function(){return o(false)},titleText:e.titleText,viewCodeText:e.viewCodeText,downloadCodeText:e.downloadCodeText,printCodeText:e.printCodeText,alignment:e.alignment,qrLink:"https://media.istockphoto.com/id/1251071788/vector/qr-code-bar-code-black-icon-digital-technology.jpg?s=612x612&w=0&k=20&c=maw4OqMSEegAdSo8Drm9HO7i1ddddvP2YaL1UuWbRig=",fireViewQrEvent:function(){console.log("View QR Code clicked")},createDownloadable:function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(e){console.log("Download QR Code clicked");return[2]}))}))},createPrintable:function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(e){console.log("Print QR Code clicked");return[2]}))}))}},e.demoData||{},{arrayMerge:function(e,t){return t}})}export{QrCode as sqm_qr_code};var templateObject_1,templateObject_2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,r,a){function n(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function l(e){try{o(a.next(e))}catch(e){i(e)}}function s(e){try{o(a["throw"](e))}catch(e){i(e)}}function o(e){e.done?r(e.value):n(e.value).then(l,s)}o((a=a.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,l;return l={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function s(e){return function(t){return o([e,t])}}function o(l){if(a)throw new TypeError("Generator is already executing.");while(r)try{if(a=1,n&&(i=l[0]&2?n["return"]:l[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,l[1])).done)return i;if(n=0,i)l=[l[0]&2,i.value];switch(l[0]){case 0:case 1:i=l;break;case 4:r.label++;return{value:l[1],done:false};case 5:r.label++;n=l[1];l=[0];continue;case 7:l=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){r.label=l[1];break}if(l[0]===6&&r.label<i[1]){r.label=i[1];i=l;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(l);break}if(i[2])r.ops.pop();r.trys.pop();continue}l=t.call(e,r)}catch(e){l=[6,e];n=0}finally{a=i=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};var __spreadArrays=this&&this.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var a=Array(e),n=0,t=0;t<r;t++)for(var i=arguments[t],l=0,s=i.length;l<s;l++,n++)a[n]=i[l];return a};import{r as registerInstance,h as h$1,g as getElement,c as Host}from"./index-b3a06de8.js";import{i as intl}from"./global-1099f20d.js";import{n as h,j as useReducer,u as useMemo,f as useEffect}from"./dom-context-hooks.module-63370afd.js";import{i as isDemo}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import{l as luxonLocale}from"./utils-84b4b092.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import"./mixins-f750863a.js";import{G as GenericTableView}from"./GenericTableView-e43d310f.js";import{a as useRequestRerender,u as useRerenderListener}from"./re-render-7e22fb0d.js";import{u as useChildElements}from"./useChildElements-3d872cef.js";import{l as luxon}from"./luxon-bbf75a9d.js";import{g as getPaypalMeta}from"./mockRewardData-96a2d26d.js";import{u as useReferralTable,t as tryMethod}from"./useReferralTable-909ccb28.js";import{T as TextSpanView}from"./sqm-text-span-view-4c17b8c9.js";var mockReferralData=function(e){if(e===void 0){e=4}var t=__spreadArrays(Array(e)).map((function(){return getMockData()}));return{totalCount:6,count:e,referredByReferral:{dateConverted:null,dateReferralStarted:1643912659850,referrerUser:{firstName:"John",lastName:"Snow",rewards:[]}},data:t}};var statuses=[["AVAILABLE"],["PENDING"],["CANCELLED"],["EXPIRED"],["REDEEMED"]];var firstNames=["Rajesh","Pierre","Ji-Ho","Chinua","Charleston","Sally","Gael","Jill","Jane","Khadija"];var lastNames=["Smith","Parker","Kent","Chew","Stark","Banner","Jones","Odinson","Pym","Rogers"];var getMockData=function(){return{id:"5cae6b0fcc540e209db45b53",referredUser:{id:"5cae6b0ce4b0d81c67b78e82",accountId:"SPX1MZBIPTFL3E1H",firstName:firstNames[Math.floor(Math.random()*firstNames.length)],lastName:lastNames[Math.floor(Math.random()*lastNames.length)],email:"example.uexwltgh@mailosaur.io",programGoals:[]},shareLinkUsed:null,referralCodeUsed:"JIMBONEUTRON2",moderationStatus:"PENDING",dateConverted:Math.floor(Math.random()*10)>=5?luxon.DateTime.now().minus({days:6}).toMillis():null,dateFraudChecksCompleted:null,dateModerated:1558730033306,dateModified:1554934543447,dateReferralEnded:null,dateReferralPaid:null,dateReferralStarted:luxon.DateTime.now().minus({days:8}).toMillis(),dateUserModified:null,programId:"sam-partner-test-2",program:{id:"sam-partner-test-2",name:"Partner Program 2.0"},rewards:Math.floor(Math.random()*10)>=5?[{id:"5cae6b16cc540e209db45cfa",type:"CREDIT",value:1,unit:"POINT",name:"Partner Reward",dateGiven:1554934550726,dateExpires:null,dateCancelled:null,dateRedeemed:1637004373582,dateScheduledFor:null,fuelTankCode:null,fuelTankType:null,currency:null,prettyValue:"1 Point",statuses:statuses[Math.floor(Math.random()*statuses.length)],globalRewardKey:null,programRewardKey:"partnerReward",meta:__assign({},getPaypalMeta()),rewardRedemptionTransactions:{data:[{exchangedRewards:{data:[{prettyValue:"CAD10.00 Visa* Prepaid Card CAD",type:"INTEGRATION",fuelTankCode:null,globalRewardKey:"gc1"}]}}]}}]:[],childNodes:{data:[{data:{id:"5cae6b16cc540e209db45cb3",statuses:statuses[Math.floor(Math.random()*statuses.length)],type:"PCT_DISCOUNT",value:50},depth:1},{data:{id:"5cae6b16cc540e209db45cfa",statuses:statuses[Math.floor(Math.random()*statuses.length)],type:"CREDIT",value:1},depth:1}]}}};var ReferralTable=function(){function e(e){registerInstance(this,e);this.perPage=4;this.hideLabels=false;this.prevLabel="Prev";this.moreLabel="Next";this.showReferrer=false;this.hiddenColumns="0";this.smBreakpoint=599;this.mdBreakpoint=799;h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=h$1(EmptySlot,null);var t=h$1(LoadingSlot,null);var r=isDemo()?useReferralTableDemo(this,e,t):useReferralTable(this,e,t),a=r.states,n=r.data,i=r.callbacks,l=r.elements;useRequestRerender([this.showReferrer,this.perPage]);return h$1(GenericTableView,{states:a,data:n,callbacks:i,elements:l})};return e}();function EmptySlot(){return h$1("slot",{name:"empty"},h$1("sqm-empty",{"empty-state-image":"https://res.cloudinary.com/saasquatch/image/upload/v1644000223/squatch-assets/empty_referral2.png","empty-state-header":"View your referral details","empty-state-text":"Refer a friend to view the status of your referrals and rewards earned"}))}function LoadingSlot(){return h$1("slot",{name:"loading"},h$1(LoadingRow,null),h$1(LoadingRow,null),h$1(LoadingRow,null),h$1(LoadingRow,null))}function LoadingRow(){return h$1("sqm-table-row",null,h$1("sqm-table-cell",{colspan:5},h$1("sl-skeleton",null)))}function useReferralTableDemo(e,t,r){var a=useReducer((function(e,t){return __assign(__assign({},e),t)}),{columns:[],rows:[],loading:false,page:0}),n=a[0],i=a[1];var l=useRerenderListener();var s=useMemo((function(){var t;return((t=e.demoData)===null||t===void 0?void 0:t.mockData)||mockReferralData(e.perPage)}),[e.perPage]);var o=useChildElements();function d(t){return __awaiter(this,void 0,void 0,(function(){var r,a,n,l,o,d,u,c,f,h,p,v,m,E;var g=this;return __generator(this,(function(_){switch(_.label){case 0:n=s===null||s===void 0?void 0:s.referredByReferral;l=e.showReferrer&&!!((r=s===null||s===void 0?void 0:s.referredByReferral)===null||r===void 0?void 0:r.dateReferralStarted);if(l){a=s.data.slice(0,e.perPage-1)}else{a=s.data.slice(0,e.perPage)}o=t.filter((function(e){var t,r;return e.slot!=="loading"&&e.slot!=="empty"&&((t=e===null||e===void 0?void 0:e.firstElementChild)===null||t===void 0?void 0:t.getAttribute("slot"))!=="loading"&&((r=e===null||e===void 0?void 0:e.firstElementChild)===null||r===void 0?void 0:r.getAttribute("slot"))!=="empty"}));d=o===null||o===void 0?void 0:o.map((function(e,t){return __awaiter(g,void 0,void 0,(function(){var r,a,n;return __generator(this,(function(i){a=(r=e===null||e===void 0?void 0:e.firstElementChild)===null||r===void 0?void 0:r.getAttribute("slot");if(e.tagName==="RAISINS-PLOP-TARGET"&&a!=="loading"&&a!=="empty"){e.setAttribute("slot","column-"+t);e.style.position="absolute";n=e.firstElementChild.childNodes[1];n.innerHTML="+";n.style.lineHeight="20px";return[2,tryMethod(e,(function(){return e.renderLabel(t)}))]}return[2,tryMethod(e,(function(){return e.renderLabel()}))]}))}))}));if(!l)return[3,2];c=o===null||o===void 0?void 0:o.map((function(e){return __awaiter(g,void 0,void 0,(function(){return __generator(this,(function(t){return[2,tryMethod(e,(function t(){return e.renderCell(n,e)}))]}))}))}));return[4,Promise.all(c)];case 1:u=_.sent();_.label=2;case 2:f=a===null||a===void 0?void 0:a.map((function(e){return __awaiter(g,void 0,void 0,(function(){var t,r;var a=this;return __generator(this,(function(n){switch(n.label){case 0:t=o===null||o===void 0?void 0:o.map((function(t){return __awaiter(a,void 0,void 0,(function(){return __generator(this,(function(r){return[2,tryMethod(t,(function(){return t.renderCell(e,undefined)}))]}))}))}));return[4,Promise.all(t)];case 1:r=n.sent();return[2,r]}}))}))}));p=f;if(!p)return[3,4];v=[[u]];return[4,Promise.all(f)];case 3:p=__spreadArrays.apply(void 0,v.concat([_.sent()])).filter((function(e){return e}));_.label=4;case 4:h=p;i({rows:h});E=d;if(!E)return[3,6];return[4,Promise.all(d)];case 5:E=_.sent();_.label=6;case 6:m=E;i({columns:m,loading:false,page:0});return[2]}}))}))}useEffect((function(){i({loading:true});(s===null||s===void 0?void 0:s.data)&&d(o)}),[s===null||s===void 0?void 0:s.data,o,l]);var u=cjs({states:{hasPrev:false,hasNext:false,loading:false,show:"rows"},callbacks:{prevPage:function(){return console.log("Prev")},nextPage:function(){return console.log("Next")}},data:{textOverrides:{showLabels:!e.hideLabels,prevLabel:e.prevLabel,moreLabel:e.moreLabel},hiddenColumns:e.hiddenColumns,referralData:[],mdBreakpoint:799,smBreakpoint:599},elements:{columns:n.columns,rows:n.rows,emptyElement:t,loadingElement:r}},e.demoData||{},{arrayMerge:function(e,t){return t}});return u}var ReferralTableCell=function(){function e(e){registerInstance(this,e);this.ignored=true;h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){return h$1("div",{innerHTML:this.innerTemplate})};return e}();var ReferralTableGenericColumn=function(){function e(e){registerInstance(this,e);h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,h$1("sqm-referral-table-cell",{"inner-template":getElement(this).innerHTML})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,Promise.resolve(this.columnTitle)]}))}))};e.prototype.render=function(){useRequestRerender([this.columnTitle]);return h$1(Host,{style:{display:"none"}},h$1("slot",null))};return e}();var ReferralTableDateCell=function(){function e(e){registerInstance(this,e);this.ignored=true;this.locale="en";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e;var t=!this.date?"-":(e=luxon.DateTime.fromMillis(this.date))===null||e===void 0?void 0:e.setLocale(luxonLocale(this.locale)).toLocaleString(luxon.DateTime.DATE_MED);return t};return e}();var ReferralTableDateColumn=function(){function e(e){registerInstance(this,e);this.columnTitle="Date converted";this.dateShown="dateConverted";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return[2,h$1("sqm-referral-table-date-cell",{date:e[this.dateShown],locale:t===null||t===void 0?void 0:t.locale})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.columnTitle]}))}))};e.prototype.renderReferrerCell=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,h$1("sqm-referral-table-date-cell",{date:e[this.dateShown]})]}))}))};e.prototype.render=function(){useRequestRerender([this.dateShown,this.columnTitle]);return h$1(Host,{style:{display:"none"}})};return e}();var ReferralTableRewardsCell=function(){function e(e){registerInstance(this,e);this.statusText="{status, select, AVAILABLE {Available} CANCELLED {Cancelled} PENDING {Pending} PENDING_REVIEW {Pending} PAYOUT_APPROVED {Payout Approved} PAYOUT_FAILED {Payout Failed} PAYOUT_CANCELLED {Payout Cancelled} PENDING_TAX_REVIEW {Pending} PENDING_NEW_TAX_FORM {Pending} PENDING_TAX_SUBMISSION {Pending} PENDING_PARTNER_CREATION {Pending} DENIED {Denied} EXPIRED {Expired} REDEEMED {Redeemed} other {Not available} }";this.statusLongText="{status, select, AVAILABLE {Reward expiring on} CANCELLED {Reward cancelled on} PENDING {Available on} PENDING_REVIEW {Pending since} PAYOUT_APPROVED {Reward was scheduled for payment based on your settings, barring any account holds.} PAYOUT_FAILED {Payout failed due to a fulfillment issue and is currently being retried.} PAYOUT_CANCELLED {If you think this is a mistake, contact our Support team.} PENDING_TAX_REVIEW {Awaiting tax form review} PENDING_NEW_TAX_FORM {Invalid tax form. Submit a new form to receive your rewards.} PENDING_TAX_SUBMISSION {Submit your tax documents to receive your rewards} PENDING_PARTNER_CREATION {Complete your tax and cash payout setup to receive your rewards} DENIED {Denied on} EXPIRED {Reward expired on} other {Not available} }";this.locale="en"}e.prototype.render=function(){var e=this;var t;intl.locale=this.locale;var r={"@keyframes slideRight":{from:{opacity:0},to:{opacity:1}},DetailsContainer:{width:"100%",display:"flex","align-items":"center","justify-content":"space-between","margin-right":"var(--sl-spacing-small)","flex-wrap":"wrap"},Details:{"max-width":"500px","&::part(header)":{padding:"var(--sl-spacing-x-small)",cursor:""+(this.hideDetails?"default":"pointer")},"&::part(content)":{padding:"var(--sl-spacing-x-small) var(--sl-spacing-medium)"},"&::part(base)":{border:"var(--sqm-border-thickness) solid var(--sqm-border-color)",opacity:"1"},"&::part(summary-icon)":{display:""+(this.hideDetails?"none":"flex")},"&::part(summary-icon[open])":{transform:"rotate(-90deg)"}},BadgeContainer:{"& > :not(:last-child)":{"margin-right":"var(--sl-spacing-x-small)"}},BoldText:{"font-weight":"var(--sl-font-weight-semibold)"},RedeemBadge:{paddingLeft:"var(--sl-spacing-xxx-small)","&::part(base)":{textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-informative-color-icon)",color:"var(--sl-color-white)"}},DangerBadge:{paddingLeft:"var(--sl-spacing-xxx-small)","&::part(base)":{textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-danger-color-icon)",color:"var(--sl-color-white)"}},WarningBadge:{paddingLeft:"var(--sl-spacing-xxx-small)","&::part(base)":{textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-warning-color-icon)",color:"var(--sl-color-white)"}},SuccessBadge:{paddingLeft:"var(--sl-spacing-xxx-small)","&::part(base)":{textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-success-color-icon)",color:"var(--sl-color-white)"}}};var a=createStyleSheet(r);var n=a.toString();var i=function(e){switch(e){case"primary":return a.classes.RedeemBadge;case"danger":return a.classes.DangerBadge;case"success":return a.classes.SuccessBadge;case"warning":case"info":return a.classes.WarningBadge;default:return a.classes.WarningBadge}};var l=function(e,t){var r,a,n,i,l,s,o,d,u,c,f,h;var p=["REDEEMED","CANCELLED","EXPIRED","PENDING","AVAILABLE","PENDING_REVIEW","DENIED","PAYOUT_APPROVED","PAYOUT_CANCELLED","PAYOUT_FAILED","PENDING_TAX_REVIEW","PENDING_NEW_TAX_FORM","PENDING_TAX_SUBMISSION","PENDING_PARTNER_CREATION"];if(((a=(r=e.referral)===null||r===void 0?void 0:r.fraudData)===null||a===void 0?void 0:a.moderationStatus)!=="APPROVED"){if(((i=(n=e.referral)===null||n===void 0?void 0:n.fraudData)===null||i===void 0?void 0:i.moderationStatus)==="PENDING")return"PENDING_REVIEW";if(((s=(l=e.referral)===null||l===void 0?void 0:l.fraudData)===null||s===void 0?void 0:s.moderationStatus)==="DENIED")return"DENIED"}var v=(o=e.partnerFundsTransfer)===null||o===void 0?void 0:o.status;if(v==="NOT_YET_DUE"||v==="TRANSFERRED"){return"PAYOUT_APPROVED"}else if(v==="OVERDUE")return"PAYOUT_FAILED";else if(v==="REVERSED")return"PAYOUT_CANCELLED";if((d=e===null||e===void 0?void 0:e.pendingReasons)===null||d===void 0?void 0:d.includes("US_TAX")){if(!(t===null||t===void 0?void 0:t.taxHandlingEnabled))return"PENDING";if(!(t===null||t===void 0?void 0:t.connected))return"PENDING_PARTNER_CREATION";if((u=t===null||t===void 0?void 0:t.publisher)===null||u===void 0?void 0:u.requiredTaxDocumentType){if(!((c=t===null||t===void 0?void 0:t.publisher)===null||c===void 0?void 0:c.currentTaxDocument))return"PENDING_TAX_SUBMISSION";var m=t.publisher.currentTaxDocument.status;if(m==="INACTIVE"||m==="INVALID_W9_ELECTRONIC_DOCUMENT"||m==="INVALID_W9_ELECTRONIC_DOCUMENT_CHECK_INTERNAL")return"PENDING_NEW_TAX_FORM";if(m==="NOT_VERIFIED")return"PENDING_TAX_REVIEW"}if(!((f=t===null||t===void 0?void 0:t.publisher)===null||f===void 0?void 0:f.withdrawalSettings))return"PENDING_PARTNER_CREATION"}if((h=e===null||e===void 0?void 0:e.pendingReasons)===null||h===void 0?void 0:h.includes("MISSING_PAYOUT_CONFIGURATION")){return"PENDING_PARTNER_CREATION"}if(e.statuses.length===1)return e.statuses[0];return p.find((function(t){return e.statuses.includes(t)&&t}))};var s=function(e){switch(e){case"REDEEMED":case"PAYOUT_APPROVED":return"primary";case"DENIED":case"EXPIRED":case"CANCELLED":case"PAYOUT_FAILED":case"PAYOUT_CANCELLED":return"danger";case"PENDING":case"PENDING_REVIEW":case"PENDING_TAX_REVIEW":case"PENDING_NEW_TAX_FORM":case"PENDING_TAX_SUBMISSION":case"PENDING_PARTNER_CREATION":return"warning";case"AVAILABLE":return"success"}};var o=function(t){return luxon.DateTime.fromMillis(t).setLocale(luxonLocale(e.locale)).toRelative().replace("in","").trim()};return(t=this.rewards)===null||t===void 0?void 0:t.map((function(t){var r,d;var u=l(t,e.taxConnection);var c=s(u);var f=intl.formatMessage({id:"statusShortMessage",defaultMessage:e.statusText},{status:u});var h=intl.formatMessage({id:"statusLongMessage",defaultMessage:e.statusLongText},{status:u});return h$1("sl-details",{class:a.classes.Details,disabled:e.hideDetails},h$1("style",{type:"text/css"},n),h$1("div",{slot:"summary",class:a.classes.DetailsContainer},h$1(TextSpanView,{type:"p"},h$1("span",{part:"sqm-cell-value",class:a.classes.BoldText},t.prettyValue)),h$1("div",{class:a.classes.BadgeContainer},u==="PENDING"&&t.dateScheduledFor?h$1("sl-badge",{class:i(c),type:c,pill:true},intl.formatMessage({id:"pendingForText",defaultMessage:e.pendingForText},{status:f,date:o(t.dateScheduledFor)})):h$1("sl-badge",{class:i(c),type:c,pill:true},f),t.dateExpires&&u==="AVAILABLE"&&h$1("sl-badge",{class:i(c),type:"info",pill:true},e.expiringText," "+o(t.dateExpires)))),h$1("div",null,u==="PENDING_REVIEW"&&((r=t.referral)===null||r===void 0?void 0:r.dateModerated)&&h$1("div",null,h$1(TextSpanView,{type:"p"},h," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},luxon.DateTime.fromMillis(t.referral.dateModerated).setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED)))),u==="PAYOUT_APPROVED"&&h$1("div",null,h$1(TextSpanView,{type:"p"},h)),u==="PAYOUT_FAILED"&&h$1("div",null,h$1(TextSpanView,{type:"p"},h)),u==="PAYOUT_CANCELLED"&&h$1("div",null,h$1(TextSpanView,{type:"p"},h)),u==="PENDING_TAX_REVIEW"&&h$1("div",null,h$1(TextSpanView,{type:"p"},h)),u==="PENDING_NEW_TAX_FORM"&&h$1("div",null,h$1(TextSpanView,{type:"p"},h)),u==="PENDING_TAX_SUBMISSION"&&h$1("div",null,h$1(TextSpanView,{type:"p"},h)),u==="PENDING_PARTNER_CREATION"&&h$1("div",null,h$1(TextSpanView,{type:"p"},h)),u==="DENIED"&&((d=t.referral)===null||d===void 0?void 0:d.dateModerated)&&h$1("div",null,h$1(TextSpanView,{type:"p"},h," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},luxon.DateTime.fromMillis(t.referral.dateModerated).setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED)),".",e.deniedHelpText?" "+e.deniedHelpText:"")),t.dateGiven&&h$1("div",null,h$1(TextSpanView,{type:"p"},e.rewardReceivedText," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},luxon.DateTime.fromMillis(t.dateGiven).setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED)))),u==="EXPIRED"&&t.dateExpires&&h$1("div",null,h$1(TextSpanView,{type:"p"},h," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},luxon.DateTime.fromMillis(t.dateExpires).setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED)))),u==="CANCELLED"&&t.dateCancelled&&h$1("div",null,h$1(TextSpanView,{type:"p"},h," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},luxon.DateTime.fromMillis(t.dateCancelled).setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED)))),u==="PENDING"&&t.dateScheduledFor&&h$1("div",null,h$1(TextSpanView,{type:"p"},h," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},luxon.DateTime.fromMillis(t.dateScheduledFor).setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED))))," ",u==="AVAILABLE"&&t.dateExpires&&h$1("div",null,h$1(TextSpanView,{type:"p"},h," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},luxon.DateTime.fromMillis(t.dateExpires).setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED)))),t.fuelTankCode&&h$1("div",null,e.fuelTankText," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},t.fuelTankCode))))}))};return e}();var ReferralTableRewardsColumn=function(){function e(e){registerInstance(this,e);this.columnTitle="Rewards";this.statusText="{status, select, AVAILABLE {Available} CANCELLED {Cancelled} PENDING {Pending} PENDING_REVIEW {Pending} PAYOUT_APPROVED {Payout Approved} PAYOUT_FAILED {Payout Failed} PAYOUT_CANCELLED {Payout Cancelled} PENDING_TAX_REVIEW {Pending} PENDING_NEW_TAX_FORM {Pending} PENDING_TAX_SUBMISSION {Pending} PENDING_PARTNER_CREATION {Pending} DENIED {Denied} EXPIRED {Expired} REDEEMED {Redeemed} other {Not available} }";this.statusLongText="{status, select, AVAILABLE {Reward expiring on} CANCELLED {Reward cancelled on} PENDING {Available on} PENDING_REVIEW {Pending since} PAYOUT_APPROVED {Reward was scheduled for payment based on your settings, barring any account holds.} PAYOUT_FAILED {Payout failed due to a fulfillment issue and is currently being retried.} PAYOUT_CANCELLED {If you think this is a mistake, contact our Support team.} PENDING_TAX_REVIEW {Awaiting tax form review} PENDING_NEW_TAX_FORM {Invalid tax form. Submit a new form to receive your rewards.} PENDING_TAX_SUBMISSION {Submit your tax documents to receive your rewards} PENDING_PARTNER_CREATION {Complete your tax and cash payout setup to receive your rewards} DENIED {Denied on} EXPIRED {Reward expired on} other {Not available} }";this.fuelTankText="Your code is";this.rewardReceivedText="Reward received on";this.expiringText="Expiring in";this.pendingForText="{status} for {date}";this.deniedHelpText="Contact support if you think this is a mistake.";this.hideDetails=false;h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return[2,h$1("sqm-referral-table-rewards-cell",{rewards:e.rewards,taxConnection:t===null||t===void 0?void 0:t.taxConnection,statusText:this.statusText,statusLongText:this.statusLongText,fuelTankText:this.fuelTankText,rewardReceivedText:this.rewardReceivedText,expiringText:this.expiringText,pendingForText:this.pendingForText,hideDetails:this.hideDetails,deniedHelpText:this.deniedHelpText,locale:t===null||t===void 0?void 0:t.locale,exportparts:"sqm-cell-value"})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.columnTitle]}))}))};e.prototype.renderReferrerCell=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,h$1("sqm-referral-table-rewards-cell",{rewards:e.rewards,exportparts:"sqm-cell-value"})]}))}))};e.prototype.render=function(){useRequestRerender([this.columnTitle,this.statusText,this.statusLongText,this.fuelTankText,this.rewardReceivedText,this.expiringText,this.pendingForText,this.hideDetails]);return h$1(Host,{style:{display:"none"}})};return e}();var style={SubText:{fontSize:"var(--sl-font-size-small)",color:"var(--sqm-text-subdued)",margin:"0"},RedeemBadge:{"&::part(base)":{fontSize:"var(--sl-font-size-small)",padding:"4px 8px",textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-informative-color-icon)",color:"var(--sl-color-white)"}},DangerBadge:{"&::part(base)":{fontSize:"var(--sl-font-size-small)",padding:"4px 8px",textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-danger-color-icon)",color:"var(--sl-color-white)"}},WarningBadge:{"&::part(base)":{fontSize:"var(--sl-font-size-small)",padding:"4px 8px",textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-warning-color-icon)",color:"var(--sl-color-white)"}},SuccessBadge:{"&::part(base)":{fontSize:"var(--sl-font-size-small)",padding:"4px 8px",textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-success-color-icon)",color:"var(--sl-color-white)"}}};var sheet=createStyleSheet(style);var styleString=sheet.toString();var ReferralTableStatusCell=function(){function e(e){registerInstance(this,e)}e.prototype.render=function(){var e=this;var t=createStyleSheet(style);var r=t.toString();var a=function(t){if(t==="PENDING")return"warning";if(t==="DENIED")return"danger";if(e.converted)return"success";return"warning"};var n=function(e){switch(e){case"primary":return t.classes.RedeemBadge;case"danger":return t.classes.DangerBadge;case"success":return t.classes.SuccessBadge;case"warning":case"info":return t.classes.WarningBadge;default:return t.classes.WarningBadge}};return h$1("div",null,h$1("style",{type:"text/css"},r),h$1("sl-badge",{pill:true,type:a(this.fraudStatus),class:n(a(this.fraudStatus))},this.statusText),this.statusSubText?h$1("p",{class:t.classes.SubText},this.statusSubText):null)};return e}();var ReferralTableStatusColumn=function(){function e(e){registerInstance(this,e);this.columnTitle="Status";this.convertedStatusText="Converted";this.inProgressStatusText="In Progress";this.pendingReviewStatusText="Pending";this.deniedStatusText="Denied";this.pendingReviewStatusSubText="Awaiting review";this.deniedStatusSubText="Detected self-referral";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,a,n;return __generator(this,(function(i){n=(t=e===null||e===void 0?void 0:e.fraudData)===null||t===void 0?void 0:t.moderationStatus;if(n==="DENIED"){r=this.deniedStatusText;a=this.deniedStatusSubText}else if(n==="PENDING"){r=this.pendingReviewStatusText;a=this.pendingReviewStatusSubText}else{r=e.dateConverted?this.convertedStatusText:this.inProgressStatusText}return[2,h$1("sqm-referral-table-status-cell",{"status-text":r,"status-sub-text":a,"fraud-status":n,converted:e.dateConverted?true:false})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.columnTitle]}))}))};e.prototype.renderReferrerCell=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){t=e.dateConverted?this.convertedStatusText:this.inProgressStatusText;return[2,h$1("sqm-referral-table-status-cell",{"status-text":t,converted:e.dateConverted?true:false})]}))}))};e.prototype.render=function(){useRequestRerender([this.columnTitle,this.convertedStatusText,this.inProgressStatusText]);return h$1(Host,{style:{display:"none"}})};return e}();var ReferralTableUserCell=function(){function e(e){registerInstance(this,e)}e.prototype.render=function(){return this.name};return e}();var ReferralTableUserColumn=function(){function e(e){registerInstance(this,e);this.columnTitle="Customer";this.anonymousUser="Anonymous User";this.deletedUser="Deleted User";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i,l,s,o,d;return __generator(this,(function(u){if(!(e===null||e===void 0?void 0:e.referredUser)&&!(e===null||e===void 0?void 0:e.referrerUser)){d=this.deletedUser}else if(!((t=e===null||e===void 0?void 0:e.referredUser)===null||t===void 0?void 0:t.firstName)&&!((r=e===null||e===void 0?void 0:e.referredUser)===null||r===void 0?void 0:r.lastName)&&!((a=e===null||e===void 0?void 0:e.referrerUser)===null||a===void 0?void 0:a.firstName)&&!((n=e===null||e===void 0?void 0:e.referrerUser)===null||n===void 0?void 0:n.lastName)){d=this.anonymousUser}else if(e===null||e===void 0?void 0:e.referrerUser){d=((i=e===null||e===void 0?void 0:e.referrerUser)===null||i===void 0?void 0:i.firstName)+" "+((l=e===null||e===void 0?void 0:e.referrerUser)===null||l===void 0?void 0:l.lastName)}else{d=((s=e===null||e===void 0?void 0:e.referredUser)===null||s===void 0?void 0:s.firstName)+" "+((o=e===null||e===void 0?void 0:e.referredUser)===null||o===void 0?void 0:o.lastName)}return[2,h$1("sqm-referral-table-user-cell",{name:d})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.columnTitle]}))}))};e.prototype.renderReferrerCell=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i;return __generator(this,(function(l){if(!e){i=this.deletedUser}else if(!((t=e===null||e===void 0?void 0:e.referrerUser)===null||t===void 0?void 0:t.firstName)&&!((r=e.referrerUser)===null||r===void 0?void 0:r.lastName)){i=this.anonymousUser}else{i=((a=e===null||e===void 0?void 0:e.referrerUser)===null||a===void 0?void 0:a.firstName)+" "+((n=e===null||e===void 0?void 0:e.referrerUser)===null||n===void 0?void 0:n.lastName)}return[2,h$1("sqm-referral-table-user-cell",{name:i})]}))}))};e.prototype.render=function(){useRequestRerender([this.deletedUser,this.anonymousUser,this.columnTitle]);return h$1(Host,{style:{display:"none"}})};return e}();export{ReferralTable as sqm_referral_table,ReferralTableCell as sqm_referral_table_cell,ReferralTableGenericColumn as sqm_referral_table_column,ReferralTableDateCell as sqm_referral_table_date_cell,ReferralTableDateColumn as sqm_referral_table_date_column,ReferralTableRewardsCell as sqm_referral_table_rewards_cell,ReferralTableRewardsColumn as sqm_referral_table_rewards_column,ReferralTableStatusCell as sqm_referral_table_status_cell,ReferralTableStatusColumn as sqm_referral_table_status_column,ReferralTableUserCell as sqm_referral_table_user_cell,ReferralTableUserColumn as sqm_referral_table_user_column};
|
|
1
|
+
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,r,a){function n(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function l(e){try{o(a.next(e))}catch(e){i(e)}}function s(e){try{o(a["throw"](e))}catch(e){i(e)}}function o(e){e.done?r(e.value):n(e.value).then(l,s)}o((a=a.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,l;return l={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function s(e){return function(t){return o([e,t])}}function o(l){if(a)throw new TypeError("Generator is already executing.");while(r)try{if(a=1,n&&(i=l[0]&2?n["return"]:l[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,l[1])).done)return i;if(n=0,i)l=[l[0]&2,i.value];switch(l[0]){case 0:case 1:i=l;break;case 4:r.label++;return{value:l[1],done:false};case 5:r.label++;n=l[1];l=[0];continue;case 7:l=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){r.label=l[1];break}if(l[0]===6&&r.label<i[1]){r.label=i[1];i=l;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(l);break}if(i[2])r.ops.pop();r.trys.pop();continue}l=t.call(e,r)}catch(e){l=[6,e];n=0}finally{a=i=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};var __spreadArrays=this&&this.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var a=Array(e),n=0,t=0;t<r;t++)for(var i=arguments[t],l=0,s=i.length;l<s;l++,n++)a[n]=i[l];return a};import{r as registerInstance,h as h$1,g as getElement,c as Host}from"./index-b3a06de8.js";import{i as intl}from"./global-1099f20d.js";import{n as h,j as useReducer,u as useMemo,f as useEffect}from"./dom-context-hooks.module-63370afd.js";import{i as isDemo}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import{l as luxonLocale}from"./utils-334c1e34.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import"./mixins-f750863a.js";import{G as GenericTableView}from"./GenericTableView-e43d310f.js";import{a as useRequestRerender,u as useRerenderListener}from"./re-render-7e22fb0d.js";import{u as useChildElements}from"./useChildElements-3d872cef.js";import{l as luxon}from"./luxon-bbf75a9d.js";import{g as getPaypalMeta}from"./mockRewardData-96a2d26d.js";import{u as useReferralTable,t as tryMethod}from"./useReferralTable-909ccb28.js";import{T as TextSpanView}from"./sqm-text-span-view-4c17b8c9.js";var mockReferralData=function(e){if(e===void 0){e=4}var t=__spreadArrays(Array(e)).map((function(){return getMockData()}));return{totalCount:6,count:e,referredByReferral:{dateConverted:null,dateReferralStarted:1643912659850,referrerUser:{firstName:"John",lastName:"Snow",rewards:[]}},data:t}};var statuses=[["AVAILABLE"],["PENDING"],["CANCELLED"],["EXPIRED"],["REDEEMED"]];var firstNames=["Rajesh","Pierre","Ji-Ho","Chinua","Charleston","Sally","Gael","Jill","Jane","Khadija"];var lastNames=["Smith","Parker","Kent","Chew","Stark","Banner","Jones","Odinson","Pym","Rogers"];var getMockData=function(){return{id:"5cae6b0fcc540e209db45b53",referredUser:{id:"5cae6b0ce4b0d81c67b78e82",accountId:"SPX1MZBIPTFL3E1H",firstName:firstNames[Math.floor(Math.random()*firstNames.length)],lastName:lastNames[Math.floor(Math.random()*lastNames.length)],email:"example.uexwltgh@mailosaur.io",programGoals:[]},shareLinkUsed:null,referralCodeUsed:"JIMBONEUTRON2",moderationStatus:"PENDING",dateConverted:Math.floor(Math.random()*10)>=5?luxon.DateTime.now().minus({days:6}).toMillis():null,dateFraudChecksCompleted:null,dateModerated:1558730033306,dateModified:1554934543447,dateReferralEnded:null,dateReferralPaid:null,dateReferralStarted:luxon.DateTime.now().minus({days:8}).toMillis(),dateUserModified:null,programId:"sam-partner-test-2",program:{id:"sam-partner-test-2",name:"Partner Program 2.0"},rewards:Math.floor(Math.random()*10)>=5?[{id:"5cae6b16cc540e209db45cfa",type:"CREDIT",value:1,unit:"POINT",name:"Partner Reward",dateGiven:1554934550726,dateExpires:null,dateCancelled:null,dateRedeemed:1637004373582,dateScheduledFor:null,fuelTankCode:null,fuelTankType:null,currency:null,prettyValue:"1 Point",statuses:statuses[Math.floor(Math.random()*statuses.length)],globalRewardKey:null,programRewardKey:"partnerReward",meta:__assign({},getPaypalMeta()),rewardRedemptionTransactions:{data:[{exchangedRewards:{data:[{prettyValue:"CAD10.00 Visa* Prepaid Card CAD",type:"INTEGRATION",fuelTankCode:null,globalRewardKey:"gc1"}]}}]}}]:[],childNodes:{data:[{data:{id:"5cae6b16cc540e209db45cb3",statuses:statuses[Math.floor(Math.random()*statuses.length)],type:"PCT_DISCOUNT",value:50},depth:1},{data:{id:"5cae6b16cc540e209db45cfa",statuses:statuses[Math.floor(Math.random()*statuses.length)],type:"CREDIT",value:1},depth:1}]}}};var ReferralTable=function(){function e(e){registerInstance(this,e);this.perPage=4;this.hideLabels=false;this.prevLabel="Prev";this.moreLabel="Next";this.showReferrer=false;this.hiddenColumns="0";this.smBreakpoint=599;this.mdBreakpoint=799;h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=h$1(EmptySlot,null);var t=h$1(LoadingSlot,null);var r=isDemo()?useReferralTableDemo(this,e,t):useReferralTable(this,e,t),a=r.states,n=r.data,i=r.callbacks,l=r.elements;useRequestRerender([this.showReferrer,this.perPage]);return h$1(GenericTableView,{states:a,data:n,callbacks:i,elements:l})};return e}();function EmptySlot(){return h$1("slot",{name:"empty"},h$1("sqm-empty",{"empty-state-image":"https://res.cloudinary.com/saasquatch/image/upload/v1644000223/squatch-assets/empty_referral2.png","empty-state-header":"View your referral details","empty-state-text":"Refer a friend to view the status of your referrals and rewards earned"}))}function LoadingSlot(){return h$1("slot",{name:"loading"},h$1(LoadingRow,null),h$1(LoadingRow,null),h$1(LoadingRow,null),h$1(LoadingRow,null))}function LoadingRow(){return h$1("sqm-table-row",null,h$1("sqm-table-cell",{colspan:5},h$1("sl-skeleton",null)))}function useReferralTableDemo(e,t,r){var a=useReducer((function(e,t){return __assign(__assign({},e),t)}),{columns:[],rows:[],loading:false,page:0}),n=a[0],i=a[1];var l=useRerenderListener();var s=useMemo((function(){var t;return((t=e.demoData)===null||t===void 0?void 0:t.mockData)||mockReferralData(e.perPage)}),[e.perPage]);var o=useChildElements();function d(t){return __awaiter(this,void 0,void 0,(function(){var r,a,n,l,o,d,u,c,f,h,p,v,m,E;var g=this;return __generator(this,(function(_){switch(_.label){case 0:n=s===null||s===void 0?void 0:s.referredByReferral;l=e.showReferrer&&!!((r=s===null||s===void 0?void 0:s.referredByReferral)===null||r===void 0?void 0:r.dateReferralStarted);if(l){a=s.data.slice(0,e.perPage-1)}else{a=s.data.slice(0,e.perPage)}o=t.filter((function(e){var t,r;return e.slot!=="loading"&&e.slot!=="empty"&&((t=e===null||e===void 0?void 0:e.firstElementChild)===null||t===void 0?void 0:t.getAttribute("slot"))!=="loading"&&((r=e===null||e===void 0?void 0:e.firstElementChild)===null||r===void 0?void 0:r.getAttribute("slot"))!=="empty"}));d=o===null||o===void 0?void 0:o.map((function(e,t){return __awaiter(g,void 0,void 0,(function(){var r,a,n;return __generator(this,(function(i){a=(r=e===null||e===void 0?void 0:e.firstElementChild)===null||r===void 0?void 0:r.getAttribute("slot");if(e.tagName==="RAISINS-PLOP-TARGET"&&a!=="loading"&&a!=="empty"){e.setAttribute("slot","column-"+t);e.style.position="absolute";n=e.firstElementChild.childNodes[1];n.innerHTML="+";n.style.lineHeight="20px";return[2,tryMethod(e,(function(){return e.renderLabel(t)}))]}return[2,tryMethod(e,(function(){return e.renderLabel()}))]}))}))}));if(!l)return[3,2];c=o===null||o===void 0?void 0:o.map((function(e){return __awaiter(g,void 0,void 0,(function(){return __generator(this,(function(t){return[2,tryMethod(e,(function t(){return e.renderCell(n,e)}))]}))}))}));return[4,Promise.all(c)];case 1:u=_.sent();_.label=2;case 2:f=a===null||a===void 0?void 0:a.map((function(e){return __awaiter(g,void 0,void 0,(function(){var t,r;var a=this;return __generator(this,(function(n){switch(n.label){case 0:t=o===null||o===void 0?void 0:o.map((function(t){return __awaiter(a,void 0,void 0,(function(){return __generator(this,(function(r){return[2,tryMethod(t,(function(){return t.renderCell(e,undefined)}))]}))}))}));return[4,Promise.all(t)];case 1:r=n.sent();return[2,r]}}))}))}));p=f;if(!p)return[3,4];v=[[u]];return[4,Promise.all(f)];case 3:p=__spreadArrays.apply(void 0,v.concat([_.sent()])).filter((function(e){return e}));_.label=4;case 4:h=p;i({rows:h});E=d;if(!E)return[3,6];return[4,Promise.all(d)];case 5:E=_.sent();_.label=6;case 6:m=E;i({columns:m,loading:false,page:0});return[2]}}))}))}useEffect((function(){i({loading:true});(s===null||s===void 0?void 0:s.data)&&d(o)}),[s===null||s===void 0?void 0:s.data,o,l]);var u=cjs({states:{hasPrev:false,hasNext:false,loading:false,show:"rows"},callbacks:{prevPage:function(){return console.log("Prev")},nextPage:function(){return console.log("Next")}},data:{textOverrides:{showLabels:!e.hideLabels,prevLabel:e.prevLabel,moreLabel:e.moreLabel},hiddenColumns:e.hiddenColumns,referralData:[],mdBreakpoint:799,smBreakpoint:599},elements:{columns:n.columns,rows:n.rows,emptyElement:t,loadingElement:r}},e.demoData||{},{arrayMerge:function(e,t){return t}});return u}var ReferralTableCell=function(){function e(e){registerInstance(this,e);this.ignored=true;h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){return h$1("div",{innerHTML:this.innerTemplate})};return e}();var ReferralTableGenericColumn=function(){function e(e){registerInstance(this,e);h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,h$1("sqm-referral-table-cell",{"inner-template":getElement(this).innerHTML})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,Promise.resolve(this.columnTitle)]}))}))};e.prototype.render=function(){useRequestRerender([this.columnTitle]);return h$1(Host,{style:{display:"none"}},h$1("slot",null))};return e}();var ReferralTableDateCell=function(){function e(e){registerInstance(this,e);this.ignored=true;this.locale="en";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e;var t=!this.date?"-":(e=luxon.DateTime.fromMillis(this.date))===null||e===void 0?void 0:e.setLocale(luxonLocale(this.locale)).toLocaleString(luxon.DateTime.DATE_MED);return t};return e}();var ReferralTableDateColumn=function(){function e(e){registerInstance(this,e);this.columnTitle="Date converted";this.dateShown="dateConverted";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return[2,h$1("sqm-referral-table-date-cell",{date:e[this.dateShown],locale:t===null||t===void 0?void 0:t.locale})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.columnTitle]}))}))};e.prototype.renderReferrerCell=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,h$1("sqm-referral-table-date-cell",{date:e[this.dateShown]})]}))}))};e.prototype.render=function(){useRequestRerender([this.dateShown,this.columnTitle]);return h$1(Host,{style:{display:"none"}})};return e}();var ReferralTableRewardsCell=function(){function e(e){registerInstance(this,e);this.statusText="{status, select, AVAILABLE {Available} CANCELLED {Cancelled} PENDING {Pending} PENDING_REVIEW {Pending} PAYOUT_APPROVED {Payout Approved} PAYOUT_FAILED {Payout Failed} PAYOUT_CANCELLED {Payout Cancelled} PENDING_TAX_REVIEW {Pending} PENDING_NEW_TAX_FORM {Pending} PENDING_TAX_SUBMISSION {Pending} PENDING_PARTNER_CREATION {Pending} DENIED {Denied} EXPIRED {Expired} REDEEMED {Redeemed} other {Not available} }";this.statusLongText="{status, select, AVAILABLE {Reward expiring on} CANCELLED {Reward cancelled on} PENDING {Available on} PENDING_REVIEW {Pending since} PAYOUT_APPROVED {Reward was scheduled for payment based on your settings, barring any account holds.} PAYOUT_FAILED {Payout failed due to a fulfillment issue and is currently being retried.} PAYOUT_CANCELLED {If you think this is a mistake, contact our Support team.} PENDING_TAX_REVIEW {Awaiting tax form review} PENDING_NEW_TAX_FORM {Invalid tax form. Submit a new form to receive your rewards.} PENDING_TAX_SUBMISSION {Submit your tax documents to receive your rewards} PENDING_PARTNER_CREATION {Complete your tax and cash payout setup to receive your rewards} DENIED {Denied on} EXPIRED {Reward expired on} other {Not available} }";this.locale="en"}e.prototype.render=function(){var e=this;var t;intl.locale=this.locale;var r={"@keyframes slideRight":{from:{opacity:0},to:{opacity:1}},DetailsContainer:{width:"100%",display:"flex","align-items":"center","justify-content":"space-between","margin-right":"var(--sl-spacing-small)","flex-wrap":"wrap"},Details:{"max-width":"500px","&::part(header)":{padding:"var(--sl-spacing-x-small)",cursor:""+(this.hideDetails?"default":"pointer")},"&::part(content)":{padding:"var(--sl-spacing-x-small) var(--sl-spacing-medium)"},"&::part(base)":{border:"var(--sqm-border-thickness) solid var(--sqm-border-color)",opacity:"1"},"&::part(summary-icon)":{display:""+(this.hideDetails?"none":"flex")},"&::part(summary-icon[open])":{transform:"rotate(-90deg)"}},BadgeContainer:{"& > :not(:last-child)":{"margin-right":"var(--sl-spacing-x-small)"}},BoldText:{"font-weight":"var(--sl-font-weight-semibold)"},RedeemBadge:{paddingLeft:"var(--sl-spacing-xxx-small)","&::part(base)":{textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-informative-color-icon)",color:"var(--sl-color-white)"}},DangerBadge:{paddingLeft:"var(--sl-spacing-xxx-small)","&::part(base)":{textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-danger-color-icon)",color:"var(--sl-color-white)"}},WarningBadge:{paddingLeft:"var(--sl-spacing-xxx-small)","&::part(base)":{textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-warning-color-icon)",color:"var(--sl-color-white)"}},SuccessBadge:{paddingLeft:"var(--sl-spacing-xxx-small)","&::part(base)":{textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-success-color-icon)",color:"var(--sl-color-white)"}}};var a=createStyleSheet(r);var n=a.toString();var i=function(e){switch(e){case"primary":return a.classes.RedeemBadge;case"danger":return a.classes.DangerBadge;case"success":return a.classes.SuccessBadge;case"warning":case"info":return a.classes.WarningBadge;default:return a.classes.WarningBadge}};var l=function(e,t){var r,a,n,i,l,s,o,d,u,c,f,h;var p=["REDEEMED","CANCELLED","EXPIRED","PENDING","AVAILABLE","PENDING_REVIEW","DENIED","PAYOUT_APPROVED","PAYOUT_CANCELLED","PAYOUT_FAILED","PENDING_TAX_REVIEW","PENDING_NEW_TAX_FORM","PENDING_TAX_SUBMISSION","PENDING_PARTNER_CREATION"];if(((a=(r=e.referral)===null||r===void 0?void 0:r.fraudData)===null||a===void 0?void 0:a.moderationStatus)!=="APPROVED"){if(((i=(n=e.referral)===null||n===void 0?void 0:n.fraudData)===null||i===void 0?void 0:i.moderationStatus)==="PENDING")return"PENDING_REVIEW";if(((s=(l=e.referral)===null||l===void 0?void 0:l.fraudData)===null||s===void 0?void 0:s.moderationStatus)==="DENIED")return"DENIED"}var v=(o=e.partnerFundsTransfer)===null||o===void 0?void 0:o.status;if(v==="NOT_YET_DUE"||v==="TRANSFERRED"){return"PAYOUT_APPROVED"}else if(v==="OVERDUE")return"PAYOUT_FAILED";else if(v==="REVERSED")return"PAYOUT_CANCELLED";if((d=e===null||e===void 0?void 0:e.pendingReasons)===null||d===void 0?void 0:d.includes("US_TAX")){if(!(t===null||t===void 0?void 0:t.taxHandlingEnabled))return"PENDING";if(!(t===null||t===void 0?void 0:t.connected))return"PENDING_PARTNER_CREATION";if((u=t===null||t===void 0?void 0:t.publisher)===null||u===void 0?void 0:u.requiredTaxDocumentType){if(!((c=t===null||t===void 0?void 0:t.publisher)===null||c===void 0?void 0:c.currentTaxDocument))return"PENDING_TAX_SUBMISSION";var m=t.publisher.currentTaxDocument.status;if(m==="INACTIVE"||m==="INVALID_W9_ELECTRONIC_DOCUMENT"||m==="INVALID_W9_ELECTRONIC_DOCUMENT_CHECK_INTERNAL")return"PENDING_NEW_TAX_FORM";if(m==="NOT_VERIFIED")return"PENDING_TAX_REVIEW"}if(!((f=t===null||t===void 0?void 0:t.publisher)===null||f===void 0?void 0:f.withdrawalSettings))return"PENDING_PARTNER_CREATION"}if((h=e===null||e===void 0?void 0:e.pendingReasons)===null||h===void 0?void 0:h.includes("MISSING_PAYOUT_CONFIGURATION")){return"PENDING_PARTNER_CREATION"}if(e.statuses.length===1)return e.statuses[0];return p.find((function(t){return e.statuses.includes(t)&&t}))};var s=function(e){switch(e){case"REDEEMED":case"PAYOUT_APPROVED":return"primary";case"DENIED":case"EXPIRED":case"CANCELLED":case"PAYOUT_FAILED":case"PAYOUT_CANCELLED":return"danger";case"PENDING":case"PENDING_REVIEW":case"PENDING_TAX_REVIEW":case"PENDING_NEW_TAX_FORM":case"PENDING_TAX_SUBMISSION":case"PENDING_PARTNER_CREATION":return"warning";case"AVAILABLE":return"success"}};var o=function(t){return luxon.DateTime.fromMillis(t).setLocale(luxonLocale(e.locale)).toRelative().replace("in","").trim()};return(t=this.rewards)===null||t===void 0?void 0:t.map((function(t){var r,d;var u=l(t,e.taxConnection);var c=s(u);var f=intl.formatMessage({id:"statusShortMessage",defaultMessage:e.statusText},{status:u});var h=intl.formatMessage({id:"statusLongMessage",defaultMessage:e.statusLongText},{status:u});return h$1("sl-details",{class:a.classes.Details,disabled:e.hideDetails},h$1("style",{type:"text/css"},n),h$1("div",{slot:"summary",class:a.classes.DetailsContainer},h$1(TextSpanView,{type:"p"},h$1("span",{part:"sqm-cell-value",class:a.classes.BoldText},t.prettyValue)),h$1("div",{class:a.classes.BadgeContainer},u==="PENDING"&&t.dateScheduledFor?h$1("sl-badge",{class:i(c),type:c,pill:true},intl.formatMessage({id:"pendingForText",defaultMessage:e.pendingForText},{status:f,date:o(t.dateScheduledFor)})):h$1("sl-badge",{class:i(c),type:c,pill:true},f),t.dateExpires&&u==="AVAILABLE"&&h$1("sl-badge",{class:i(c),type:"info",pill:true},e.expiringText," "+o(t.dateExpires)))),h$1("div",null,u==="PENDING_REVIEW"&&((r=t.referral)===null||r===void 0?void 0:r.dateModerated)&&h$1("div",null,h$1(TextSpanView,{type:"p"},h," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},luxon.DateTime.fromMillis(t.referral.dateModerated).setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED)))),u==="PAYOUT_APPROVED"&&h$1("div",null,h$1(TextSpanView,{type:"p"},h)),u==="PAYOUT_FAILED"&&h$1("div",null,h$1(TextSpanView,{type:"p"},h)),u==="PAYOUT_CANCELLED"&&h$1("div",null,h$1(TextSpanView,{type:"p"},h)),u==="PENDING_TAX_REVIEW"&&h$1("div",null,h$1(TextSpanView,{type:"p"},h)),u==="PENDING_NEW_TAX_FORM"&&h$1("div",null,h$1(TextSpanView,{type:"p"},h)),u==="PENDING_TAX_SUBMISSION"&&h$1("div",null,h$1(TextSpanView,{type:"p"},h)),u==="PENDING_PARTNER_CREATION"&&h$1("div",null,h$1(TextSpanView,{type:"p"},h)),u==="DENIED"&&((d=t.referral)===null||d===void 0?void 0:d.dateModerated)&&h$1("div",null,h$1(TextSpanView,{type:"p"},h," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},luxon.DateTime.fromMillis(t.referral.dateModerated).setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED)),".",e.deniedHelpText?" "+e.deniedHelpText:"")),t.dateGiven&&h$1("div",null,h$1(TextSpanView,{type:"p"},e.rewardReceivedText," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},luxon.DateTime.fromMillis(t.dateGiven).setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED)))),u==="EXPIRED"&&t.dateExpires&&h$1("div",null,h$1(TextSpanView,{type:"p"},h," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},luxon.DateTime.fromMillis(t.dateExpires).setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED)))),u==="CANCELLED"&&t.dateCancelled&&h$1("div",null,h$1(TextSpanView,{type:"p"},h," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},luxon.DateTime.fromMillis(t.dateCancelled).setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED)))),u==="PENDING"&&t.dateScheduledFor&&h$1("div",null,h$1(TextSpanView,{type:"p"},h," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},luxon.DateTime.fromMillis(t.dateScheduledFor).setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED))))," ",u==="AVAILABLE"&&t.dateExpires&&h$1("div",null,h$1(TextSpanView,{type:"p"},h," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},luxon.DateTime.fromMillis(t.dateExpires).setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED)))),t.fuelTankCode&&h$1("div",null,e.fuelTankText," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},t.fuelTankCode))))}))};return e}();var ReferralTableRewardsColumn=function(){function e(e){registerInstance(this,e);this.columnTitle="Rewards";this.statusText="{status, select, AVAILABLE {Available} CANCELLED {Cancelled} PENDING {Pending} PENDING_REVIEW {Pending} PAYOUT_APPROVED {Payout Approved} PAYOUT_FAILED {Payout Failed} PAYOUT_CANCELLED {Payout Cancelled} PENDING_TAX_REVIEW {Pending} PENDING_NEW_TAX_FORM {Pending} PENDING_TAX_SUBMISSION {Pending} PENDING_PARTNER_CREATION {Pending} DENIED {Denied} EXPIRED {Expired} REDEEMED {Redeemed} other {Not available} }";this.statusLongText="{status, select, AVAILABLE {Reward expiring on} CANCELLED {Reward cancelled on} PENDING {Available on} PENDING_REVIEW {Pending since} PAYOUT_APPROVED {Reward was scheduled for payment based on your settings, barring any account holds.} PAYOUT_FAILED {Payout failed due to a fulfillment issue and is currently being retried.} PAYOUT_CANCELLED {If you think this is a mistake, contact our Support team.} PENDING_TAX_REVIEW {Awaiting tax form review} PENDING_NEW_TAX_FORM {Invalid tax form. Submit a new form to receive your rewards.} PENDING_TAX_SUBMISSION {Submit your tax documents to receive your rewards} PENDING_PARTNER_CREATION {Complete your tax and cash payout setup to receive your rewards} DENIED {Denied on} EXPIRED {Reward expired on} other {Not available} }";this.fuelTankText="Your code is";this.rewardReceivedText="Reward received on";this.expiringText="Expiring in";this.pendingForText="{status} for {date}";this.deniedHelpText="Contact support if you think this is a mistake.";this.hideDetails=false;h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return[2,h$1("sqm-referral-table-rewards-cell",{rewards:e.rewards,taxConnection:t===null||t===void 0?void 0:t.taxConnection,statusText:this.statusText,statusLongText:this.statusLongText,fuelTankText:this.fuelTankText,rewardReceivedText:this.rewardReceivedText,expiringText:this.expiringText,pendingForText:this.pendingForText,hideDetails:this.hideDetails,deniedHelpText:this.deniedHelpText,locale:t===null||t===void 0?void 0:t.locale,exportparts:"sqm-cell-value"})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.columnTitle]}))}))};e.prototype.renderReferrerCell=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,h$1("sqm-referral-table-rewards-cell",{rewards:e.rewards,exportparts:"sqm-cell-value"})]}))}))};e.prototype.render=function(){useRequestRerender([this.columnTitle,this.statusText,this.statusLongText,this.fuelTankText,this.rewardReceivedText,this.expiringText,this.pendingForText,this.hideDetails]);return h$1(Host,{style:{display:"none"}})};return e}();var style={SubText:{fontSize:"var(--sl-font-size-small)",color:"var(--sqm-text-subdued)",margin:"0"},RedeemBadge:{"&::part(base)":{fontSize:"var(--sl-font-size-small)",padding:"4px 8px",textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-informative-color-icon)",color:"var(--sl-color-white)"}},DangerBadge:{"&::part(base)":{fontSize:"var(--sl-font-size-small)",padding:"4px 8px",textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-danger-color-icon)",color:"var(--sl-color-white)"}},WarningBadge:{"&::part(base)":{fontSize:"var(--sl-font-size-small)",padding:"4px 8px",textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-warning-color-icon)",color:"var(--sl-color-white)"}},SuccessBadge:{"&::part(base)":{fontSize:"var(--sl-font-size-small)",padding:"4px 8px",textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-success-color-icon)",color:"var(--sl-color-white)"}}};var sheet=createStyleSheet(style);var styleString=sheet.toString();var ReferralTableStatusCell=function(){function e(e){registerInstance(this,e)}e.prototype.render=function(){var e=this;var t=createStyleSheet(style);var r=t.toString();var a=function(t){if(t==="PENDING")return"warning";if(t==="DENIED")return"danger";if(e.converted)return"success";return"warning"};var n=function(e){switch(e){case"primary":return t.classes.RedeemBadge;case"danger":return t.classes.DangerBadge;case"success":return t.classes.SuccessBadge;case"warning":case"info":return t.classes.WarningBadge;default:return t.classes.WarningBadge}};return h$1("div",null,h$1("style",{type:"text/css"},r),h$1("sl-badge",{pill:true,type:a(this.fraudStatus),class:n(a(this.fraudStatus))},this.statusText),this.statusSubText?h$1("p",{class:t.classes.SubText},this.statusSubText):null)};return e}();var ReferralTableStatusColumn=function(){function e(e){registerInstance(this,e);this.columnTitle="Status";this.convertedStatusText="Converted";this.inProgressStatusText="In Progress";this.pendingReviewStatusText="Pending";this.deniedStatusText="Denied";this.pendingReviewStatusSubText="Awaiting review";this.deniedStatusSubText="Detected self-referral";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,a,n;return __generator(this,(function(i){n=(t=e===null||e===void 0?void 0:e.fraudData)===null||t===void 0?void 0:t.moderationStatus;if(n==="DENIED"){r=this.deniedStatusText;a=this.deniedStatusSubText}else if(n==="PENDING"){r=this.pendingReviewStatusText;a=this.pendingReviewStatusSubText}else{r=e.dateConverted?this.convertedStatusText:this.inProgressStatusText}return[2,h$1("sqm-referral-table-status-cell",{"status-text":r,"status-sub-text":a,"fraud-status":n,converted:e.dateConverted?true:false})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.columnTitle]}))}))};e.prototype.renderReferrerCell=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){t=e.dateConverted?this.convertedStatusText:this.inProgressStatusText;return[2,h$1("sqm-referral-table-status-cell",{"status-text":t,converted:e.dateConverted?true:false})]}))}))};e.prototype.render=function(){useRequestRerender([this.columnTitle,this.convertedStatusText,this.inProgressStatusText]);return h$1(Host,{style:{display:"none"}})};return e}();var ReferralTableUserCell=function(){function e(e){registerInstance(this,e)}e.prototype.render=function(){return this.name};return e}();var ReferralTableUserColumn=function(){function e(e){registerInstance(this,e);this.columnTitle="Customer";this.anonymousUser="Anonymous User";this.deletedUser="Deleted User";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i,l,s,o,d;return __generator(this,(function(u){if(!(e===null||e===void 0?void 0:e.referredUser)&&!(e===null||e===void 0?void 0:e.referrerUser)){d=this.deletedUser}else if(!((t=e===null||e===void 0?void 0:e.referredUser)===null||t===void 0?void 0:t.firstName)&&!((r=e===null||e===void 0?void 0:e.referredUser)===null||r===void 0?void 0:r.lastName)&&!((a=e===null||e===void 0?void 0:e.referrerUser)===null||a===void 0?void 0:a.firstName)&&!((n=e===null||e===void 0?void 0:e.referrerUser)===null||n===void 0?void 0:n.lastName)){d=this.anonymousUser}else if(e===null||e===void 0?void 0:e.referrerUser){d=((i=e===null||e===void 0?void 0:e.referrerUser)===null||i===void 0?void 0:i.firstName)+" "+((l=e===null||e===void 0?void 0:e.referrerUser)===null||l===void 0?void 0:l.lastName)}else{d=((s=e===null||e===void 0?void 0:e.referredUser)===null||s===void 0?void 0:s.firstName)+" "+((o=e===null||e===void 0?void 0:e.referredUser)===null||o===void 0?void 0:o.lastName)}return[2,h$1("sqm-referral-table-user-cell",{name:d})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.columnTitle]}))}))};e.prototype.renderReferrerCell=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i;return __generator(this,(function(l){if(!e){i=this.deletedUser}else if(!((t=e===null||e===void 0?void 0:e.referrerUser)===null||t===void 0?void 0:t.firstName)&&!((r=e.referrerUser)===null||r===void 0?void 0:r.lastName)){i=this.anonymousUser}else{i=((a=e===null||e===void 0?void 0:e.referrerUser)===null||a===void 0?void 0:a.firstName)+" "+((n=e===null||e===void 0?void 0:e.referrerUser)===null||n===void 0?void 0:n.lastName)}return[2,h$1("sqm-referral-table-user-cell",{name:i})]}))}))};e.prototype.render=function(){useRequestRerender([this.deletedUser,this.anonymousUser,this.columnTitle]);return h$1(Host,{style:{display:"none"}})};return e}();export{ReferralTable as sqm_referral_table,ReferralTableCell as sqm_referral_table_cell,ReferralTableGenericColumn as sqm_referral_table_column,ReferralTableDateCell as sqm_referral_table_date_cell,ReferralTableDateColumn as sqm_referral_table_date_column,ReferralTableRewardsCell as sqm_referral_table_rewards_cell,ReferralTableRewardsColumn as sqm_referral_table_rewards_column,ReferralTableStatusCell as sqm_referral_table_status_cell,ReferralTableStatusColumn as sqm_referral_table_status_column,ReferralTableUserCell as sqm_referral_table_user_cell,ReferralTableUserColumn as sqm_referral_table_user_column};
|