@saasquatch/mint-components 1.15.0-154 → 1.15.0-156
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/{IndirectTaxDetailsView-536eff1a.js → IndirectTaxDetailsView-94d7bd35.js} +2 -2
- package/dist/cjs/{ShadowViewAddon-d0eed472.js → ShadowViewAddon-ff3e4184.js} +1 -1
- package/dist/cjs/{global-f518fd6f.js → global-b4b7cb3b.js} +6 -4
- 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 +3 -11
- package/dist/cjs/sqm-big-stat_44.cjs.entry.js +2 -2
- package/dist/cjs/sqm-code-verification.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-leaderboard-rank.cjs.entry.js +1 -1
- package/dist/cjs/sqm-pagination_3.cjs.entry.js +1 -1
- package/dist/cjs/{sqm-portal-email-verification-view-d866a812.js → sqm-portal-email-verification-view-071dfbb2.js} +1 -1
- package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +2 -2
- package/dist/cjs/{sqm-portal-profile-view-0038a228.js → sqm-portal-profile-view-f9cad491.js} +1 -1
- package/dist/cjs/sqm-portal-profile.cjs.entry.js +2 -2
- package/dist/cjs/sqm-referral-table_11.cjs.entry.js +1 -1
- package/dist/cjs/sqm-rewards-table_9.cjs.entry.js +1 -1
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +6 -6
- package/dist/cjs/sqm-tax-and-cash.cjs.entry.js +2 -2
- package/dist/cjs/{utils-a9f050cd.js → utils-c990e578.js} +1 -1
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +0 -8
- package/dist/collection/global/styles.js +6 -4
- package/dist/collection/global/styles.ts +6 -4
- package/dist/esm/{IndirectTaxDetailsView-2c4eac80.js → IndirectTaxDetailsView-6711b874.js} +2 -2
- package/dist/esm/{ShadowViewAddon-1daee14f.js → ShadowViewAddon-5efd12ed.js} +1 -1
- package/dist/esm/{global-bf2c7ab4.js → global-fe3d8af4.js} +6 -4
- 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 -11
- package/dist/esm/sqm-big-stat_44.entry.js +2 -2
- package/dist/esm/sqm-code-verification.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-leaderboard-rank.entry.js +1 -1
- package/dist/esm/sqm-pagination_3.entry.js +1 -1
- package/dist/esm/{sqm-portal-email-verification-view-99718f68.js → sqm-portal-email-verification-view-0baf1f85.js} +1 -1
- package/dist/esm/sqm-portal-email-verification.entry.js +2 -2
- package/dist/esm/{sqm-portal-profile-view-e6dab79b.js → sqm-portal-profile-view-adc6429f.js} +1 -1
- package/dist/esm/sqm-portal-profile.entry.js +2 -2
- package/dist/esm/sqm-referral-table_11.entry.js +1 -1
- package/dist/esm/sqm-rewards-table_9.entry.js +1 -1
- package/dist/esm/sqm-stencilbook.entry.js +6 -6
- package/dist/esm/sqm-tax-and-cash.entry.js +2 -2
- package/dist/esm/{utils-ab97f280.js → utils-c0b0b58f.js} +1 -1
- package/dist/esm-es5/{IndirectTaxDetailsView-2c4eac80.js → IndirectTaxDetailsView-6711b874.js} +1 -1
- package/dist/esm-es5/{ShadowViewAddon-1daee14f.js → ShadowViewAddon-5efd12ed.js} +1 -1
- package/dist/esm-es5/{global-bf2c7ab4.js → global-fe3d8af4.js} +1 -1
- 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_44.entry.js +1 -1
- package/dist/esm-es5/sqm-code-verification.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-leaderboard-rank.entry.js +1 -1
- package/dist/esm-es5/sqm-pagination_3.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-email-verification-view-99718f68.js → sqm-portal-email-verification-view-0baf1f85.js} +1 -1
- package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-profile-view-e6dab79b.js → sqm-portal-profile-view-adc6429f.js} +1 -1
- package/dist/esm-es5/sqm-portal-profile.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-tax-and-cash.entry.js +1 -1
- package/dist/esm-es5/{utils-ab97f280.js → utils-c0b0b58f.js} +1 -1
- package/dist/mint-components/global/styles.ts +6 -4
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/mint-components.js +1 -1
- package/dist/mint-components/{p-050e9e66.entry.js → p-0284140c.entry.js} +2 -2
- package/dist/mint-components/{p-07ad24bf.system.entry.js → p-0a293398.system.entry.js} +1 -1
- package/dist/mint-components/{p-b2901626.system.js → p-0ac445bc.system.js} +1 -1
- package/dist/mint-components/{p-ba720a49.entry.js → p-17c954e9.entry.js} +1 -1
- package/dist/mint-components/{p-4a3cd07e.system.entry.js → p-18d1cb3a.system.entry.js} +1 -1
- package/dist/mint-components/{p-a3074e3f.entry.js → p-1ef03fb2.entry.js} +1 -1
- package/dist/mint-components/{p-22634073.system.entry.js → p-21f20d95.system.entry.js} +1 -1
- package/dist/mint-components/{p-30709d07.entry.js → p-30f3feff.entry.js} +1 -1
- package/dist/mint-components/{p-00476f9d.js → p-34b1c6e1.js} +1 -1
- package/dist/mint-components/{p-9d0ec84f.system.entry.js → p-34decf97.system.entry.js} +1 -1
- package/dist/mint-components/{p-1f5320e2.js → p-4120e0f1.js} +1 -1
- package/dist/mint-components/{p-adfc00e1.entry.js → p-4f51bfe1.entry.js} +1 -1
- package/dist/mint-components/{p-76079de5.system.entry.js → p-57104dc2.system.entry.js} +1 -1
- package/dist/mint-components/{p-65465fd0.entry.js → p-68b421b9.entry.js} +1 -1
- package/dist/mint-components/{p-94b78fa9.entry.js → p-7492d5a6.entry.js} +1 -1
- package/dist/mint-components/p-753fa18c.entry.js +33 -0
- package/dist/mint-components/{p-733630ba.js → p-87becfcb.js} +1 -1
- package/dist/mint-components/{p-c042e0b7.system.entry.js → p-87cf44f8.system.entry.js} +1 -1
- package/dist/mint-components/{p-5d8b9f3f.system.js → p-8b4ab141.system.js} +1 -1
- package/dist/mint-components/{p-6fb519ce.system.js → p-8b9de7c4.system.js} +1 -1
- package/dist/mint-components/{p-67792687.entry.js → p-8ee40312.entry.js} +2 -2
- package/dist/mint-components/{p-7b33e419.system.entry.js → p-93acc277.system.entry.js} +1 -1
- package/dist/mint-components/{p-3f764180.system.entry.js → p-9a45b3e5.system.entry.js} +1 -1
- package/dist/mint-components/{p-4a387513.system.entry.js → p-9b92612d.system.entry.js} +1 -1
- package/dist/mint-components/{p-8da7e425.system.entry.js → p-9dbf7083.system.entry.js} +1 -1
- package/dist/mint-components/{p-116da763.system.entry.js → p-a0c96568.system.entry.js} +1 -1
- package/dist/mint-components/{p-29a7439c.system.js → p-a875c5cc.system.js} +1 -1
- package/dist/mint-components/{p-3924484d.entry.js → p-ac1796b1.entry.js} +1 -1
- package/dist/mint-components/{p-6ab35935.entry.js → p-ad1da549.entry.js} +1 -1
- package/dist/mint-components/{p-cda78986.system.entry.js → p-af67535d.system.entry.js} +1 -1
- package/dist/mint-components/{p-58a8ab87.system.js → p-b15a2a03.system.js} +1 -1
- package/dist/mint-components/{p-673628d3.entry.js → p-d60960b0.entry.js} +1 -1
- package/dist/mint-components/{p-597dfc84.system.js → p-d7292611.system.js} +1 -1
- package/dist/mint-components/{p-4a890e7b.system.js → p-d9a3e0d7.system.js} +1 -1
- package/dist/mint-components/{p-89236ebe.js → p-da676263.js} +1 -1
- package/dist/mint-components/{p-fcbea133.system.entry.js → p-de4177e3.system.entry.js} +1 -1
- package/dist/mint-components/{p-6fd85efc.js → p-e1e60eba.js} +1 -1
- package/dist/mint-components/{p-d1b74ee3.js → p-f88d44db.js} +1 -1
- package/dist/mint-components/{p-ed83f9bc.entry.js → p-f9e2f02e.entry.js} +1 -1
- package/docs/docs.docx +0 -0
- package/package.json +1 -1
- package/dist/mint-components/p-787f4201.entry.js +0 -33
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,n,i){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function s(e){try{
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,n,i){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function s(e){try{c(i.next(e))}catch(e){a(e)}}function o(e){try{c(i["throw"](e))}catch(e){a(e)}}function c(e){e.done?n(e.value):r(e.value).then(s,o)}c((i=i.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:[]},i,r,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(e){return function(t){return c([e,t])}}function c(s){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,r&&(a=s[0]&2?r["return"]:s[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;if(r=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;r=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1];a=s;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(s);break}if(a[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];r=0}finally{i=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-59b028db.system.js","./p-0ac445bc.system.js","./p-4f5329a2.system.js","./p-171310d9.system.js","./p-4bd679a7.system.js","./p-1a673057.system.js","./p-8a6494c7.system.js","./p-67ad2252.system.js","./p-a875c5cc.system.js"],(function(e){"use strict";var t,n,i,r,a,s,o,c,u,l,f,v,d,g;return{setters:[function(e){t=e.r;n=e.h},function(){},function(e){i=e.k;r=e.m;a=e.f;s=e.n},function(e){o=e.l;c=e.n;u=e.J;l=e.j;f=e.u;v=e.i},function(e){d=e.c},function(){},function(){},function(){},function(e){g=e.P}],execute:function(){function h(e){var t=this;var n,s,v,d,g,h,m,y,p;var w=o(),b=w[0],M=w[1],_=M.loading,k=M.data,E=M.errors;var x=c(),S=x[0],I=x[1],P=I.data,V=I.loading;var j=u();var L=(n=j===null||j===void 0?void 0:j.managedIdentity)===null||n===void 0?void 0:n.email;var R=new URLSearchParams(l.location.search);var T=R.get("nextPage");var B=i(false),H=B[0],C=B[1];var q=i(""),A=q[0],D=q[1];var G=i(10),J=G[0],U=G[1];var Y=r(undefined);var z=r(undefined);var F=function(){return __awaiter(t,void 0,void 0,(function(){var t,n,i,r,a;return __generator(this,(function(s){switch(s.label){case 0:if(!L)return[2];D("");C(false);n=T?{nextPage:T}:null;i=e.redirectPath;r={email:L,urlParams:n,redirectPath:i};return[4,b(r)];case 1:a=s.sent();if(a instanceof Error){if(a.message)D(e.networkErrorMessage);return[2]}if((t=a.requestManagedIdentityVerificationEmail)===null||t===void 0?void 0:t.success)C(true);return[2]}}))}))};function K(){return __awaiter(this,void 0,void 0,(function(){var t,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,S()];case 1:n=i.sent();if((t=n===null||n===void 0?void 0:n.managedIdentitySession)===null||t===void 0?void 0:t.emailVerified){clearInterval(Y.current);return[2,l.push({pathname:e.redirectPath,search:R.toString()&&"?"+R.toString()})]}Q(10);return[2]}}))}))}var N=function(e){if(e===void 0){e=1e4}return setInterval(K,e)};var O=function(e){return setInterval((function(){return U(e)}),1e3)};function Q(e){clearInterval(z.current);clearInterval(Y.current);if(document.visibilityState==="hidden")return;if(e)U(e);var t=J||10;z.current=O(e-1||t-1);Y.current=N(e*1e3||t*1e3)}var W=f((function(){return Q()}),[J]);a((function(){if(!Y.current){K();Y.current=N()}return function(){clearInterval(Y.current)}}),[]);a((function(){if(J>0){clearInterval(z.current);z.current=O(J-1)}document.addEventListener("visibilitychange",W);return function(){clearInterval(z.current);document.removeEventListener("visibilitychange",W)}}),[J]);return{states:{loading:_,error:((g=(d=(v=(s=E===null||E===void 0?void 0:E.response)===null||s===void 0?void 0:s.errors)===null||v===void 0?void 0:v[0])===null||d===void 0?void 0:d.extensions)===null||g===void 0?void 0:g.message)||((y=(m=(h=E===null||E===void 0?void 0:E.response)===null||h===void 0?void 0:h.errors)===null||m===void 0?void 0:m[0])===null||y===void 0?void 0:y.message)||A,success:H,loadingVerification:V,isVerified:!!((p=P===null||P===void 0?void 0:P.managedIdentitySession)===null||p===void 0?void 0:p.emailVerified),countdown:J},callbacks:{submit:F},content:{email:L,verifyMessage:e.verifyMessage,emailVerificationHeader:e.emailVerificationHeader,resendEmailButtonText:e.resendEmailButtonText,verificationLoadingMessage:e.verificationLoadingMessage,verificationStatusMessage:e.verificationStatusMessage,verificationResentMessage:e.verificationResentMessage,networkErrorMessage:e.networkErrorMessage}}}var m=e("sqm_portal_email_verification",function(){function e(e){t(this,e);this.ignored=true;this.redirectPath="/verifyEmail";this.emailVerificationHeader="Verify your email";this.resendEmailButtonText="Re-send Email";this.verifyMessage="A verification email was sent to {email}. Please verify your email to continue to the portal. Resending an email will invalidate the previous email.";this.verificationStatusMessage="Checking verification status in {countdown}";this.verificationLoadingMessage="Checking verification status";this.verificationResentMessage="Your verification email has been resent successfully";this.networkErrorMessage="An error occurred while verifying your password. Please refresh the page.";s(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=v()?y(this):h(this),t=e.states,i=e.callbacks,r=e.content;return n(g,{states:t,callbacks:i,content:r})};return e}());function y(e){var t=this;return d({states:{error:"",loading:false,success:false,countdown:10},callbacks:{submit:function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(e){return[2]}))}))}},content:{email:"test@example.com",verifyMessage:e.verifyMessage,emailVerificationHeader:e.emailVerificationHeader,resendEmailButtonText:e.resendEmailButtonText,verificationLoadingMessage:e.verificationLoadingMessage,verificationStatusMessage:e.verificationStatusMessage,verificationResentMessage:e.verificationResentMessage,networkErrorMessage:e.networkErrorMessage}},e.demoData||{},{arrayMerge:function(e,t){return t}})}}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __makeTemplateObject=this&&this.__makeTemplateObject||function(t,e){if(Object.defineProperty){Object.defineProperty(t,"raw",{value:e})}else{t.raw=e}return t};var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var e,n=1,a=arguments.length;n<a;n++){e=arguments[n];for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]}return t};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(t,e,n,a){function r(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,o){function i(t){try{l(a.next(t))}catch(t){o(t)}}function s(t){try{l(a["throw"](t))}catch(t){o(t)}}function l(t){t.done?n(t.value):r(t.value).then(i,s)}l((a=a.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},a,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(t){return function(e){return l([t,e])}}function l(i){if(a)throw new TypeError("Generator is already executing.");while(n)try{if(a=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:n.label++;return{value:i[1],done:false};case 5:n.label++;r=i[1];i=[0];continue;case 7:i=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){n=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){n.label=i[1];break}if(i[0]===6&&n.label<o[1]){n.label=o[1];o=i;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(i);break}if(o[2])n.ops.pop();n.trys.pop();continue}i=e.call(t,n)}catch(t){i=[6,t];r=0}finally{a=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};System.register(["./p-59b028db.system.js","./p-b2901626.system.js","./p-4f5329a2.system.js","./p-171310d9.system.js","./p-4bd679a7.system.js","./p-15bfd7e2.system.js","./p-1a673057.system.js","./p-17a0f310.system.js","./p-8a6494c7.system.js","./p-c210374a.system.js"],(function(t){"use strict";var e,n,a,r,o,i,s,l,u,c,d,p,f,v,g,y,h,m,b,x,C,T;return{setters:[function(t){e=t.h;n=t.F;a=t.r},function(t){r=t.i},function(t){o=t.n;i=t.k},function(t){s=t.F;l=t.i;u=t.d;c=t.H;d=t.J;p=t.B;f=t.w;v=t.$},function(t){g=t.c},function(t){y=t.g},function(t){h=t.c},function(t){m=t.R;b=t.a;x=t.S;C=t.u},function(){},function(t){T=t.C}],execute:function(){var _={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 w=h(_);var P=w.toString();function S(t){var a=t.states,r=t.callbacks,o=t.text,i=t.buttonType;var s=r.onNext,l=r.onPrev;var u=a.currentPage,c=a.totalPages,d=a.loading;if(c===1)return e(n,null);return e("span",{class:w.classes.Container,part:"sqm-base"},e("style",{type:"text/css"},P),!d&&e(n,null,e("sl-button",{exportparts:"base: "+i+"button-base",onClick:l,part:"sqm-pagination-button",circle:true,disabled:u===1},e("sl-icon",{name:"chevron-left",label:"Previous Page"})),e("div",{class:w.classes.TextContainer},o.paginationText)),e("sl-button",{exportparts:"base: "+i+"button-base",onClick:s,part:"sqm-pagination-button",circle:true,disabled:u===c},e("sl-icon",{name:"chevron-right",label:"Previous Page"})))}function j(t){var e;var n=s(m);var a=n.states.currentPage+1;var o=(e=n.states)===null||e===void 0?void 0:e.pageCount;return{states:{currentPage:a,totalPages:o,loading:n.states.loading},callbacks:{onNext:function(){var t,e;return(t=n.callbacks)===null||t===void 0?void 0:t.setCurrentPage(((e=n.states)===null||e===void 0?void 0:e.currentPage)+1)},onPrev:function(){var t,e;return(t=n.callbacks)===null||t===void 0?void 0:t.setCurrentPage(((e=n.states)===null||e===void 0?void 0:e.currentPage)-1)}},text:{paginationText:r.formatMessage({id:"paginationText",defaultMessage:t.paginationText},{currentPage:a,totalPages:o})}}}var k=t("sqm_pagination",function(){function t(t){a(this,t);this.ignored=true;this.paginationText="{currentPage} of {totalPages}";this.buttonType="secondary";o(this)}t.prototype.disconnectedCallback=function(){};t.prototype.render=function(){var t=l()?I(y(this)):j(y(this));return e(S,Object.assign({},t))};return t}());function I(t){var e=i(1),n=e[0],a=e[1];return g({states:{currentPage:n,totalPages:5,loading:false},buttonType:t.buttonType,callbacks:{onNext:function(){return a(n+1)},onPrev:function(){return a(n-1)}},text:{paginationText:r.formatMessage({id:"paginationText",defaultMessage:t.paginationText||"{currentPage} of {totalPages}"},{currentPage:n,totalPages:5})}},t.demoData||{},{arrayMerge:function(t,e){return e}})}var E=u.gql(__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 M=u.gql(__makeTemplateObject(["\n mutation loadEvent($eventMeta: UserAnalyticsEvent!) {\n createUserAnalyticsEvent(eventMeta: $eventMeta)\n }\n"],["\n mutation loadEvent($eventMeta: UserAnalyticsEvent!) {\n createUserAnalyticsEvent(eventMeta: $eventMeta)\n }\n"]));function q(t){var e,n;var a=t.programId,r=a===void 0?c():a;var o=d();var l=p();var u=s(b);var g=f(E,{programId:r},!(o===null||o===void 0?void 0:o.jwt)||(u===null||u===void 0?void 0:u.referralCode)!==undefined).data;var y=v(M)[0];var h=v(x)[0];var m=(n=(u===null||u===void 0?void 0:u.referralCode)||((e=g===null||g===void 0?void 0:g.user)===null||e===void 0?void 0:e.referralCode))!==null&&n!==void 0?n:"...";var C=i(false),T=C[0],_=C[1];function w(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(!u)return[3,2];return[4,h({referralCode:u.referralCode})];case 1:e.sent();u.refresh();e.label=2;case 2:navigator.clipboard.writeText(m);_(true);setTimeout((function(){return _(false)}),t.tooltiplifespan);y({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:l,shareMedium:"DIRECT"}}});return[2]}}))}))}return __assign(__assign({},t),{onClick:w,open:T,copyString:m,isCopied:u===null||u===void 0?void 0:u.isCopied,showNotificationText:t.showNotificationText&&!!(u===null||u===void 0?void 0:u.singleUse)})}var R=t("sqm_referral_code",function(){function t(t){a(this,t);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";o(this)}t.prototype.disconnectedCallback=function(){};t.prototype.render=function(){var t=y(this);var n=l()?A(t):q(t);return e(T,Object.assign({},n))};return t}());function A(t){var e=i(false),n=e[0],a=e[1];var r="REFERRALCODE001";return g({copyString:r,tooltiptext:t.tooltiptext,textAlign:t.textAlign,copyButtonLabel:t.copyButtonLabel,buttonStyle:t.buttonStyle,notificationText:t.notificationText,showNotificationText:t.showNotificationText,isCopied:t.showNotificationText,borderColor:t.borderColor,backgroundColor:t.backgroundColor,textColor:t.textColor,borderRadius:t.borderRadius,buttonType:t.buttonType,isUsed:false,rewardStatus:"AVAILABLE",open:n,onClick:function(){navigator.clipboard.writeText(r);a(true);setTimeout((function(){return a(false)}),t.tooltiplifespan)}},t.demoData||{},{arrayMerge:function(t,e){return e}})}function O(t){var n=t.slots,a=t.titleText,r=t.states,o=t.textColor,i=o===void 0?"var(--sqm-text-subdued)":o;var s={Wrapper:{width:"100%",display:"flex",alignItems:"flex-start",justifyContent:"center",flexDirection:"column",gap:"var(--sl-spacing-large)",color:i},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 l="\n :host {\n display: block;\n }\n :host([hidden]): {\n display: none;\n }\n ";var u=h(s);var c=u.toString();var d=function(t){if(t.noCodes){return n.empty}if(t.loading){return n.loading}return e("div",{class:u.classes.Wrapper},e("div",{class:u.classes.ShareCodeContainer},n.shareCodes),e("div",{class:u.classes.ShareButtonContainer},n.shareButtons))};return e("div",{class:u.classes.Wrapper,part:"sqm-base"},e("style",{type:"text/css"},l,c),e("div",{class:u.classes.HeaderContainer},e("h2",{class:u.classes.TitleText},a),!r.noCodes&&!r.loading&&n.pagination),d(r))}var U=t("sqm_referral_codes",function(){function t(t){a(this,t);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";o(this)}t.prototype.disconnectedCallback=function(){};t.prototype.render=function(){var t=y(this);var n=l()?$(t):C(t);var a={shareButtons:e("slot",{name:"shareButtons"}),shareCodes:e("slot",{name:"shareCodes"}),pagination:e("slot",{name:"pagination"}),empty:e(D,{headerText:this.emptyStateHeaderText,descriptionText:this.emptyStateDescriptionText,imageUrl:this.emptyStateImageUrl}),loading:e(N,null)};var r=__assign(__assign({slots:a},n),{loading:n.states.loading,noCodes:n.states.noCodes});return e(O,Object.assign({},r))};return t}());function D(t){var n=t.headerText,a=t.descriptionText,r=t.imageUrl;return e("slot",{name:"empty"},e("sqm-empty",{emptyStateHeader:n,emptyStateText:a,emptyStateImage:r}))}function N(){return e("slot",{name:"loading"},e(B,null),e(B,null),e(B,null),e(B,null))}function B(){return e("sl-skeleton",{style:{width:"100%"}})}function $(t){return g({titleText:t.titleText,textColor:t.textColor,states:{noCodes:false,loading:false}},t.demoData||{},{arrayMerge:function(t,e){return e}})}}}}));
|
|
1
|
+
var __makeTemplateObject=this&&this.__makeTemplateObject||function(t,e){if(Object.defineProperty){Object.defineProperty(t,"raw",{value:e})}else{t.raw=e}return t};var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var e,n=1,a=arguments.length;n<a;n++){e=arguments[n];for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]}return t};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(t,e,n,a){function r(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,o){function i(t){try{l(a.next(t))}catch(t){o(t)}}function s(t){try{l(a["throw"](t))}catch(t){o(t)}}function l(t){t.done?n(t.value):r(t.value).then(i,s)}l((a=a.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},a,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(t){return function(e){return l([t,e])}}function l(i){if(a)throw new TypeError("Generator is already executing.");while(n)try{if(a=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:n.label++;return{value:i[1],done:false};case 5:n.label++;r=i[1];i=[0];continue;case 7:i=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){n=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){n.label=i[1];break}if(i[0]===6&&n.label<o[1]){n.label=o[1];o=i;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(i);break}if(o[2])n.ops.pop();n.trys.pop();continue}i=e.call(t,n)}catch(t){i=[6,t];r=0}finally{a=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};System.register(["./p-59b028db.system.js","./p-0ac445bc.system.js","./p-4f5329a2.system.js","./p-171310d9.system.js","./p-4bd679a7.system.js","./p-15bfd7e2.system.js","./p-1a673057.system.js","./p-17a0f310.system.js","./p-8a6494c7.system.js","./p-c210374a.system.js"],(function(t){"use strict";var e,n,a,r,o,i,s,l,u,c,d,p,f,v,g,y,h,m,b,x,C,T;return{setters:[function(t){e=t.h;n=t.F;a=t.r},function(t){r=t.i},function(t){o=t.n;i=t.k},function(t){s=t.F;l=t.i;u=t.d;c=t.H;d=t.J;p=t.B;f=t.w;v=t.$},function(t){g=t.c},function(t){y=t.g},function(t){h=t.c},function(t){m=t.R;b=t.a;x=t.S;C=t.u},function(){},function(t){T=t.C}],execute:function(){var _={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 w=h(_);var P=w.toString();function S(t){var a=t.states,r=t.callbacks,o=t.text,i=t.buttonType;var s=r.onNext,l=r.onPrev;var u=a.currentPage,c=a.totalPages,d=a.loading;if(c===1)return e(n,null);return e("span",{class:w.classes.Container,part:"sqm-base"},e("style",{type:"text/css"},P),!d&&e(n,null,e("sl-button",{exportparts:"base: "+i+"button-base",onClick:l,part:"sqm-pagination-button",circle:true,disabled:u===1},e("sl-icon",{name:"chevron-left",label:"Previous Page"})),e("div",{class:w.classes.TextContainer},o.paginationText)),e("sl-button",{exportparts:"base: "+i+"button-base",onClick:s,part:"sqm-pagination-button",circle:true,disabled:u===c},e("sl-icon",{name:"chevron-right",label:"Previous Page"})))}function j(t){var e;var n=s(m);var a=n.states.currentPage+1;var o=(e=n.states)===null||e===void 0?void 0:e.pageCount;return{states:{currentPage:a,totalPages:o,loading:n.states.loading},callbacks:{onNext:function(){var t,e;return(t=n.callbacks)===null||t===void 0?void 0:t.setCurrentPage(((e=n.states)===null||e===void 0?void 0:e.currentPage)+1)},onPrev:function(){var t,e;return(t=n.callbacks)===null||t===void 0?void 0:t.setCurrentPage(((e=n.states)===null||e===void 0?void 0:e.currentPage)-1)}},text:{paginationText:r.formatMessage({id:"paginationText",defaultMessage:t.paginationText},{currentPage:a,totalPages:o})}}}var k=t("sqm_pagination",function(){function t(t){a(this,t);this.ignored=true;this.paginationText="{currentPage} of {totalPages}";this.buttonType="secondary";o(this)}t.prototype.disconnectedCallback=function(){};t.prototype.render=function(){var t=l()?I(y(this)):j(y(this));return e(S,Object.assign({},t))};return t}());function I(t){var e=i(1),n=e[0],a=e[1];return g({states:{currentPage:n,totalPages:5,loading:false},buttonType:t.buttonType,callbacks:{onNext:function(){return a(n+1)},onPrev:function(){return a(n-1)}},text:{paginationText:r.formatMessage({id:"paginationText",defaultMessage:t.paginationText||"{currentPage} of {totalPages}"},{currentPage:n,totalPages:5})}},t.demoData||{},{arrayMerge:function(t,e){return e}})}var E=u.gql(__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 M=u.gql(__makeTemplateObject(["\n mutation loadEvent($eventMeta: UserAnalyticsEvent!) {\n createUserAnalyticsEvent(eventMeta: $eventMeta)\n }\n"],["\n mutation loadEvent($eventMeta: UserAnalyticsEvent!) {\n createUserAnalyticsEvent(eventMeta: $eventMeta)\n }\n"]));function q(t){var e,n;var a=t.programId,r=a===void 0?c():a;var o=d();var l=p();var u=s(b);var g=f(E,{programId:r},!(o===null||o===void 0?void 0:o.jwt)||(u===null||u===void 0?void 0:u.referralCode)!==undefined).data;var y=v(M)[0];var h=v(x)[0];var m=(n=(u===null||u===void 0?void 0:u.referralCode)||((e=g===null||g===void 0?void 0:g.user)===null||e===void 0?void 0:e.referralCode))!==null&&n!==void 0?n:"...";var C=i(false),T=C[0],_=C[1];function w(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(!u)return[3,2];return[4,h({referralCode:u.referralCode})];case 1:e.sent();u.refresh();e.label=2;case 2:navigator.clipboard.writeText(m);_(true);setTimeout((function(){return _(false)}),t.tooltiplifespan);y({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:l,shareMedium:"DIRECT"}}});return[2]}}))}))}return __assign(__assign({},t),{onClick:w,open:T,copyString:m,isCopied:u===null||u===void 0?void 0:u.isCopied,showNotificationText:t.showNotificationText&&!!(u===null||u===void 0?void 0:u.singleUse)})}var R=t("sqm_referral_code",function(){function t(t){a(this,t);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";o(this)}t.prototype.disconnectedCallback=function(){};t.prototype.render=function(){var t=y(this);var n=l()?A(t):q(t);return e(T,Object.assign({},n))};return t}());function A(t){var e=i(false),n=e[0],a=e[1];var r="REFERRALCODE001";return g({copyString:r,tooltiptext:t.tooltiptext,textAlign:t.textAlign,copyButtonLabel:t.copyButtonLabel,buttonStyle:t.buttonStyle,notificationText:t.notificationText,showNotificationText:t.showNotificationText,isCopied:t.showNotificationText,borderColor:t.borderColor,backgroundColor:t.backgroundColor,textColor:t.textColor,borderRadius:t.borderRadius,buttonType:t.buttonType,isUsed:false,rewardStatus:"AVAILABLE",open:n,onClick:function(){navigator.clipboard.writeText(r);a(true);setTimeout((function(){return a(false)}),t.tooltiplifespan)}},t.demoData||{},{arrayMerge:function(t,e){return e}})}function O(t){var n=t.slots,a=t.titleText,r=t.states,o=t.textColor,i=o===void 0?"var(--sqm-text-subdued)":o;var s={Wrapper:{width:"100%",display:"flex",alignItems:"flex-start",justifyContent:"center",flexDirection:"column",gap:"var(--sl-spacing-large)",color:i},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 l="\n :host {\n display: block;\n }\n :host([hidden]): {\n display: none;\n }\n ";var u=h(s);var c=u.toString();var d=function(t){if(t.noCodes){return n.empty}if(t.loading){return n.loading}return e("div",{class:u.classes.Wrapper},e("div",{class:u.classes.ShareCodeContainer},n.shareCodes),e("div",{class:u.classes.ShareButtonContainer},n.shareButtons))};return e("div",{class:u.classes.Wrapper,part:"sqm-base"},e("style",{type:"text/css"},l,c),e("div",{class:u.classes.HeaderContainer},e("h2",{class:u.classes.TitleText},a),!r.noCodes&&!r.loading&&n.pagination),d(r))}var U=t("sqm_referral_codes",function(){function t(t){a(this,t);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";o(this)}t.prototype.disconnectedCallback=function(){};t.prototype.render=function(){var t=y(this);var n=l()?$(t):C(t);var a={shareButtons:e("slot",{name:"shareButtons"}),shareCodes:e("slot",{name:"shareCodes"}),pagination:e("slot",{name:"pagination"}),empty:e(D,{headerText:this.emptyStateHeaderText,descriptionText:this.emptyStateDescriptionText,imageUrl:this.emptyStateImageUrl}),loading:e(N,null)};var r=__assign(__assign({slots:a},n),{loading:n.states.loading,noCodes:n.states.noCodes});return e(O,Object.assign({},r))};return t}());function D(t){var n=t.headerText,a=t.descriptionText,r=t.imageUrl;return e("slot",{name:"empty"},e("sqm-empty",{emptyStateHeader:n,emptyStateText:a,emptyStateImage:r}))}function N(){return e("slot",{name:"loading"},e(B,null),e(B,null),e(B,null),e(B,null))}function B(){return e("sl-skeleton",{style:{width:"100%"}})}function $(t){return g({titleText:t.titleText,textColor:t.textColor,states:{noCodes:false,loading:false}},t.demoData||{},{arrayMerge:function(t,e){return e}})}}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
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 a in t)if(Object.prototype.hasOwnProperty.call(t,a))e[a]=t[a]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,r,n){function a(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function s(e){try{o(n.next(e))}catch(e){i(e)}}function l(e){try{o(n["throw"](e))}catch(e){i(e)}}function o(e){e.done?r(e.value):a(e.value).then(s,l)}o((n=n.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:[]},n,a,i,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(e){return function(t){return o([e,t])}}function o(s){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,a&&(i=s[0]&2?a["return"]:s[0]?a["throw"]||((i=a["return"])&&i.call(a),0):a.next)&&!(i=i.call(a,s[1])).done)return i;if(a=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;a=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];a=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[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 n=Array(e),a=0,t=0;t<r;t++)for(var i=arguments[t],s=0,l=i.length;s<l;s++,a++)n[a]=i[s];return n};System.register(["./p-59b028db.system.js","./p-b2901626.system.js","./p-4f5329a2.system.js","./p-171310d9.system.js","./p-4bd679a7.system.js","./p-15bfd7e2.system.js","./p-1a673057.system.js","./p-8a6494c7.system.js","./p-0935f9b7.system.js","./p-bb5d153f.system.js","./p-bcac83f0.system.js","./p-7159c51c.system.js","./p-8e28333b.system.js","./p-ff0e1564.system.js","./p-67ad2252.system.js"],(function(e){"use strict";var t,r,n,a,i,s,l,o,d,u,c,f,v,p,h,m,E,_,g,T,N,D;return{setters:[function(e){t=e.r;r=e.h;n=e.g;a=e.c},function(e){i=e.i},function(e){s=e.n;l=e.j;o=e.u;d=e.f},function(e){u=e.i},function(e){c=e.c},function(e){f=e.l},function(e){v=e.c},function(){},function(e){p=e.G},function(e){h=e.a;m=e.u},function(e){E=e.u},function(e){_=e.l},function(e){g=e.g},function(e){T=e.u;N=e.t},function(e){D=e.T}],execute:function(){var y=function(e){if(e===void 0){e=4}var t=__spreadArrays(Array(e)).map((function(){return I()}));return{totalCount:6,count:e,referredByReferral:{dateConverted:null,dateReferralStarted:1643912659850,referrerUser:{firstName:"John",lastName:"Snow",rewards:[]}},data:t}};var x=[["AVAILABLE"],["PENDING"],["CANCELLED"],["EXPIRED"],["REDEEMED"]];var P=["Rajesh","Pierre","Ji-Ho","Chinua","Charleston","Sally","Gael","Jill","Jane","Khadija"];var A=["Smith","Parker","Kent","Chew","Stark","Banner","Jones","Odinson","Pym","Rogers"];var I=function(){return{id:"5cae6b0fcc540e209db45b53",referredUser:{id:"5cae6b0ce4b0d81c67b78e82",accountId:"SPX1MZBIPTFL3E1H",firstName:P[Math.floor(Math.random()*P.length)],lastName:A[Math.floor(Math.random()*A.length)],email:"example.uexwltgh@mailosaur.io",programGoals:[]},shareLinkUsed:null,referralCodeUsed:"JIMBONEUTRON2",moderationStatus:"PENDING",dateConverted:Math.floor(Math.random()*10)>=5?_.DateTime.now().minus({days:6}).toMillis():null,dateFraudChecksCompleted:null,dateModerated:1558730033306,dateModified:1554934543447,dateReferralEnded:null,dateReferralPaid:null,dateReferralStarted:_.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:x[Math.floor(Math.random()*x.length)],globalRewardKey:null,programRewardKey:"partnerReward",meta:__assign({},g()),rewardRedemptionTransactions:{data:[{exchangedRewards:{data:[{prettyValue:"CAD10.00 Visa* Prepaid Card CAD",type:"INTEGRATION",fuelTankCode:null,globalRewardKey:"gc1"}]}}]}}]:[],childNodes:{data:[{data:{id:"5cae6b16cc540e209db45cb3",statuses:x[Math.floor(Math.random()*x.length)],type:"PCT_DISCOUNT",value:50},depth:1},{data:{id:"5cae6b16cc540e209db45cfa",statuses:x[Math.floor(Math.random()*x.length)],type:"CREDIT",value:1},depth:1}]}}};var b=e("sqm_referral_table",function(){function e(e){t(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;s(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=r(w,null);var t=r(R,null);var n=u()?C(this,e,t):T(this,e,t),a=n.states,i=n.data,s=n.callbacks,l=n.elements;h([this.showReferrer,this.perPage]);return r(p,{states:a,data:i,callbacks:s,elements:l})};return e}());function w(){return r("slot",{name:"empty"},r("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 R(){return r("slot",{name:"loading"},r(S,null),r(S,null),r(S,null),r(S,null))}function S(){return r("sqm-table-row",null,r("sqm-table-cell",{colspan:5},r("sl-skeleton",null)))}function C(e,t,r){var n=l((function(e,t){return __assign(__assign({},e),t)}),{columns:[],rows:[],loading:false,page:0}),a=n[0],i=n[1];var s=m();var u=o((function(){var t;return((t=e.demoData)===null||t===void 0?void 0:t.mockData)||y(e.perPage)}),[e.perPage]);var f=E();function v(t){return __awaiter(this,void 0,void 0,(function(){var r,n,a,s,l,o,d,c,f,v,p,h,m,E;var _=this;return __generator(this,(function(g){switch(g.label){case 0:a=u===null||u===void 0?void 0:u.referredByReferral;s=e.showReferrer&&!!((r=u===null||u===void 0?void 0:u.referredByReferral)===null||r===void 0?void 0:r.dateReferralStarted);if(s){n=u.data.slice(0,e.perPage-1)}else{n=u.data.slice(0,e.perPage)}l=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"}));o=l===null||l===void 0?void 0:l.map((function(e,t){return __awaiter(_,void 0,void 0,(function(){var r,n,a;return __generator(this,(function(i){n=(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"&&n!=="loading"&&n!=="empty"){e.setAttribute("slot","column-"+t);e.style.position="absolute";a=e.firstElementChild.childNodes[1];a.innerHTML="+";a.style.lineHeight="20px";return[2,N(e,(function(){return e.renderLabel(t)}))]}return[2,N(e,(function(){return e.renderLabel()}))]}))}))}));if(!s)return[3,2];c=l===null||l===void 0?void 0:l.map((function(e){return __awaiter(_,void 0,void 0,(function(){return __generator(this,(function(t){return[2,N(e,(function t(){return e.renderCell(a,e)}))]}))}))}));return[4,Promise.all(c)];case 1:d=g.sent();g.label=2;case 2:f=n===null||n===void 0?void 0:n.map((function(e){return __awaiter(_,void 0,void 0,(function(){var t,r;var n=this;return __generator(this,(function(a){switch(a.label){case 0:t=l===null||l===void 0?void 0:l.map((function(t){return __awaiter(n,void 0,void 0,(function(){return __generator(this,(function(r){return[2,N(t,(function(){return t.renderCell(e,undefined)}))]}))}))}));return[4,Promise.all(t)];case 1:r=a.sent();return[2,r]}}))}))}));p=f;if(!p)return[3,4];h=[[d]];return[4,Promise.all(f)];case 3:p=__spreadArrays.apply(void 0,h.concat([g.sent()])).filter((function(e){return e}));g.label=4;case 4:v=p;i({rows:v});E=o;if(!E)return[3,6];return[4,Promise.all(o)];case 5:E=g.sent();g.label=6;case 6:m=E;i({columns:m,loading:false,page:0});return[2]}}))}))}d((function(){i({loading:true});(u===null||u===void 0?void 0:u.data)&&v(f)}),[u===null||u===void 0?void 0:u.data,f,s]);var p=c({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:a.columns,rows:a.rows,emptyElement:t,loadingElement:r}},e.demoData||{},{arrayMerge:function(e,t){return t}});return p}var L=e("sqm_referral_table_cell",function(){function e(e){t(this,e);this.ignored=true;s(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){return r("div",{innerHTML:this.innerTemplate})};return e}());var M=e("sqm_referral_table_column",function(){function e(e){t(this,e);s(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,r("sqm-referral-table-cell",{"inner-template":n(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(){h([this.columnTitle]);return r(a,{style:{display:"none"}},r("slot",null))};return e}());var O=e("sqm_referral_table_date_cell",function(){function e(e){t(this,e);this.ignored=true;this.locale="en";s(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e;var t=!this.date?"-":(e=_.DateTime.fromMillis(this.date))===null||e===void 0?void 0:e.setLocale(f(this.locale)).toLocaleString(_.DateTime.DATE_MED);return t};return e}());var U=e("sqm_referral_table_date_column",function(){function e(e){t(this,e);this.columnTitle="Date converted";this.dateShown="dateConverted";s(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,r("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,r("sqm-referral-table-date-cell",{date:e[this.dateShown]})]}))}))};e.prototype.render=function(){h([this.dateShown,this.columnTitle]);return r(a,{style:{display:"none"}})};return e}());var G=e("sqm_referral_table_rewards_cell",function(){function e(e){t(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 approved for payout and was scheduled for payment based on your settings.} 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;i.locale=this.locale;var n={"@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=v(n);var s=a.toString();var l=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 o=function(e,t){var r,n,a,i,s,l,o,d,u,c,f,v;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(((n=(r=e.referral)===null||r===void 0?void 0:r.fraudData)===null||n===void 0?void 0:n.moderationStatus)!=="APPROVED"){if(((i=(a=e.referral)===null||a===void 0?void 0:a.fraudData)===null||i===void 0?void 0:i.moderationStatus)==="PENDING")return"PENDING_REVIEW";if(((l=(s=e.referral)===null||s===void 0?void 0:s.fraudData)===null||l===void 0?void 0:l.moderationStatus)==="DENIED")return"DENIED"}var h=(o=e.partnerFundsTransfer)===null||o===void 0?void 0:o.status;if(h==="NOT_YET_DUE"||h==="TRANSFERRED"){return"PAYOUT_APPROVED"}else if(h==="OVERDUE")return"PAYOUT_FAILED";else if(h==="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")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((v=e===null||e===void 0?void 0:e.pendingReasons)===null||v===void 0?void 0:v.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 d=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 u=function(t){return _.DateTime.fromMillis(t).setLocale(f(e.locale)).toRelative().replace("in","").trim()};return(t=this.rewards)===null||t===void 0?void 0:t.map((function(t){var n,c;var v=o(t,e.taxConnection);var p=d(v);var h=i.formatMessage({id:"statusShortMessage",defaultMessage:e.statusText},{status:v});var m=i.formatMessage({id:"statusLongMessage",defaultMessage:e.statusLongText},{status:v});return r("sl-details",{class:a.classes.Details,disabled:e.hideDetails},r("style",{type:"text/css"},s),r("div",{slot:"summary",class:a.classes.DetailsContainer},r(D,{type:"p"},r("span",{part:"sqm-cell-value",class:a.classes.BoldText},t.prettyValue)),r("div",{class:a.classes.BadgeContainer},v==="PENDING"&&t.dateScheduledFor?r("sl-badge",{class:l(p),type:p,pill:true},i.formatMessage({id:"pendingForText",defaultMessage:e.pendingForText},{status:h,date:u(t.dateScheduledFor)})):r("sl-badge",{class:l(p),type:p,pill:true},h),t.dateExpires&&v==="AVAILABLE"&&r("sl-badge",{class:l(p),type:"info",pill:true},e.expiringText," "+u(t.dateExpires)))),r("div",null,v==="PENDING_REVIEW"&&((n=t.referral)===null||n===void 0?void 0:n.dateModerated)&&r("div",null,r(D,{type:"p"},m," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},_.DateTime.fromMillis(t.referral.dateModerated).setLocale(f(e.locale)).toLocaleString(_.DateTime.DATE_MED)))),v==="PAYOUT_APPROVED"&&r("div",null,r(D,{type:"p"},m)),v==="PAYOUT_FAILED"&&r("div",null,r(D,{type:"p"},m)),v==="PAYOUT_CANCELLED"&&r("div",null,r(D,{type:"p"},m)),v==="PENDING_TAX_REVIEW"&&r("div",null,r(D,{type:"p"},m)),v==="PENDING_NEW_TAX_FORM"&&r("div",null,r(D,{type:"p"},m)),v==="PENDING_TAX_SUBMISSION"&&r("div",null,r(D,{type:"p"},m)),v==="PENDING_PARTNER_CREATION"&&r("div",null,r(D,{type:"p"},m)),v==="DENIED"&&((c=t.referral)===null||c===void 0?void 0:c.dateModerated)&&r("div",null,r(D,{type:"p"},m," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},_.DateTime.fromMillis(t.referral.dateModerated).setLocale(f(e.locale)).toLocaleString(_.DateTime.DATE_MED)),".",e.deniedHelpText?" "+e.deniedHelpText:"")),t.dateGiven&&r("div",null,r(D,{type:"p"},e.rewardReceivedText," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},_.DateTime.fromMillis(t.dateGiven).setLocale(f(e.locale)).toLocaleString(_.DateTime.DATE_MED)))),v==="EXPIRED"&&t.dateExpires&&r("div",null,r(D,{type:"p"},m," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},_.DateTime.fromMillis(t.dateExpires).setLocale(f(e.locale)).toLocaleString(_.DateTime.DATE_MED)))),v==="CANCELLED"&&t.dateCancelled&&r("div",null,r(D,{type:"p"},m," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},_.DateTime.fromMillis(t.dateCancelled).setLocale(f(e.locale)).toLocaleString(_.DateTime.DATE_MED)))),v==="PENDING"&&t.dateScheduledFor&&r("div",null,r(D,{type:"p"},m," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},_.DateTime.fromMillis(t.dateScheduledFor).setLocale(f(e.locale)).toLocaleString(_.DateTime.DATE_MED))))," ",v==="AVAILABLE"&&t.dateExpires&&r("div",null,r(D,{type:"p"},m," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},_.DateTime.fromMillis(t.dateExpires).setLocale(f(e.locale)).toLocaleString(_.DateTime.DATE_MED)))),t.fuelTankCode&&r("div",null,e.fuelTankText," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},t.fuelTankCode))))}))};return e}());var B=e("sqm_referral_table_rewards_column",function(){function e(e){t(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 approved for payout and was scheduled for payment based on your settings.} 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;s(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,r("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,r("sqm-referral-table-rewards-cell",{rewards:e.rewards,exportparts:"sqm-cell-value"})]}))}))};e.prototype.render=function(){h([this.columnTitle,this.statusText,this.statusLongText,this.fuelTankText,this.rewardReceivedText,this.expiringText,this.pendingForText,this.hideDetails]);return r(a,{style:{display:"none"}})};return e}());var k={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 q=v(k);var V=q.toString();var W=e("sqm_referral_table_status_cell",function(){function e(e){t(this,e)}e.prototype.render=function(){var e=this;var t=v(k);var n=t.toString();var a=function(t){if(t==="PENDING")return"warning";if(t==="DENIED")return"danger";if(e.converted)return"success";return"warning"};var i=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 r("div",null,r("style",{type:"text/css"},n),r("sl-badge",{pill:true,type:a(this.fraudStatus),class:i(a(this.fraudStatus))},this.statusText),this.statusSubText?r("p",{class:t.classes.SubText},this.statusSubText):null)};return e}());var F=e("sqm_referral_table_status_column",function(){function e(e){t(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";s(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,a,i;return __generator(this,(function(s){i=(t=e===null||e===void 0?void 0:e.fraudData)===null||t===void 0?void 0:t.moderationStatus;if(i==="DENIED"){n=this.deniedStatusText;a=this.deniedStatusSubText}else if(i==="PENDING"){n=this.pendingReviewStatusText;a=this.pendingReviewStatusSubText}else{n=e.dateConverted?this.convertedStatusText:this.inProgressStatusText}return[2,r("sqm-referral-table-status-cell",{"status-text":n,"status-sub-text":a,"fraud-status":i,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(n){t=e.dateConverted?this.convertedStatusText:this.inProgressStatusText;return[2,r("sqm-referral-table-status-cell",{"status-text":t,converted:e.dateConverted?true:false})]}))}))};e.prototype.render=function(){h([this.columnTitle,this.convertedStatusText,this.inProgressStatusText]);return r(a,{style:{display:"none"}})};return e}());var X=e("sqm_referral_table_user_cell",function(){function e(e){t(this,e)}e.prototype.render=function(){return this.name};return e}());var Y=e("sqm_referral_table_user_column",function(){function e(e){t(this,e);this.columnTitle="Customer";this.anonymousUser="Anonymous User";this.deletedUser="Deleted User";s(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,a,i,s,l,o,d,u;return __generator(this,(function(c){if(!(e===null||e===void 0?void 0:e.referredUser)&&!(e===null||e===void 0?void 0:e.referrerUser)){u=this.deletedUser}else if(!((t=e===null||e===void 0?void 0:e.referredUser)===null||t===void 0?void 0:t.firstName)&&!((n=e===null||e===void 0?void 0:e.referredUser)===null||n===void 0?void 0:n.lastName)&&!((a=e===null||e===void 0?void 0:e.referrerUser)===null||a===void 0?void 0:a.firstName)&&!((i=e===null||e===void 0?void 0:e.referrerUser)===null||i===void 0?void 0:i.lastName)){u=this.anonymousUser}else if(e===null||e===void 0?void 0:e.referrerUser){u=((s=e===null||e===void 0?void 0:e.referrerUser)===null||s===void 0?void 0:s.firstName)+" "+((l=e===null||e===void 0?void 0:e.referrerUser)===null||l===void 0?void 0:l.lastName)}else{u=((o=e===null||e===void 0?void 0:e.referredUser)===null||o===void 0?void 0:o.firstName)+" "+((d=e===null||e===void 0?void 0:e.referredUser)===null||d===void 0?void 0:d.lastName)}return[2,r("sqm-referral-table-user-cell",{name:u})]}))}))};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,n,a,i,s;return __generator(this,(function(l){if(!e){s=this.deletedUser}else if(!((t=e===null||e===void 0?void 0:e.referrerUser)===null||t===void 0?void 0:t.firstName)&&!((n=e.referrerUser)===null||n===void 0?void 0:n.lastName)){s=this.anonymousUser}else{s=((a=e===null||e===void 0?void 0:e.referrerUser)===null||a===void 0?void 0:a.firstName)+" "+((i=e===null||e===void 0?void 0:e.referrerUser)===null||i===void 0?void 0:i.lastName)}return[2,r("sqm-referral-table-user-cell",{name:s})]}))}))};e.prototype.render=function(){h([this.deletedUser,this.anonymousUser,this.columnTitle]);return r(a,{style:{display:"none"}})};return e}())}}}));
|
|
1
|
+
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 a in t)if(Object.prototype.hasOwnProperty.call(t,a))e[a]=t[a]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,r,n){function a(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function s(e){try{o(n.next(e))}catch(e){i(e)}}function l(e){try{o(n["throw"](e))}catch(e){i(e)}}function o(e){e.done?r(e.value):a(e.value).then(s,l)}o((n=n.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:[]},n,a,i,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(e){return function(t){return o([e,t])}}function o(s){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,a&&(i=s[0]&2?a["return"]:s[0]?a["throw"]||((i=a["return"])&&i.call(a),0):a.next)&&!(i=i.call(a,s[1])).done)return i;if(a=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;a=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];a=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[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 n=Array(e),a=0,t=0;t<r;t++)for(var i=arguments[t],s=0,l=i.length;s<l;s++,a++)n[a]=i[s];return n};System.register(["./p-59b028db.system.js","./p-0ac445bc.system.js","./p-4f5329a2.system.js","./p-171310d9.system.js","./p-4bd679a7.system.js","./p-15bfd7e2.system.js","./p-1a673057.system.js","./p-8a6494c7.system.js","./p-0935f9b7.system.js","./p-bb5d153f.system.js","./p-bcac83f0.system.js","./p-7159c51c.system.js","./p-8e28333b.system.js","./p-ff0e1564.system.js","./p-67ad2252.system.js"],(function(e){"use strict";var t,r,n,a,i,s,l,o,d,u,c,f,v,p,h,m,E,_,g,T,N,D;return{setters:[function(e){t=e.r;r=e.h;n=e.g;a=e.c},function(e){i=e.i},function(e){s=e.n;l=e.j;o=e.u;d=e.f},function(e){u=e.i},function(e){c=e.c},function(e){f=e.l},function(e){v=e.c},function(){},function(e){p=e.G},function(e){h=e.a;m=e.u},function(e){E=e.u},function(e){_=e.l},function(e){g=e.g},function(e){T=e.u;N=e.t},function(e){D=e.T}],execute:function(){var y=function(e){if(e===void 0){e=4}var t=__spreadArrays(Array(e)).map((function(){return I()}));return{totalCount:6,count:e,referredByReferral:{dateConverted:null,dateReferralStarted:1643912659850,referrerUser:{firstName:"John",lastName:"Snow",rewards:[]}},data:t}};var x=[["AVAILABLE"],["PENDING"],["CANCELLED"],["EXPIRED"],["REDEEMED"]];var P=["Rajesh","Pierre","Ji-Ho","Chinua","Charleston","Sally","Gael","Jill","Jane","Khadija"];var A=["Smith","Parker","Kent","Chew","Stark","Banner","Jones","Odinson","Pym","Rogers"];var I=function(){return{id:"5cae6b0fcc540e209db45b53",referredUser:{id:"5cae6b0ce4b0d81c67b78e82",accountId:"SPX1MZBIPTFL3E1H",firstName:P[Math.floor(Math.random()*P.length)],lastName:A[Math.floor(Math.random()*A.length)],email:"example.uexwltgh@mailosaur.io",programGoals:[]},shareLinkUsed:null,referralCodeUsed:"JIMBONEUTRON2",moderationStatus:"PENDING",dateConverted:Math.floor(Math.random()*10)>=5?_.DateTime.now().minus({days:6}).toMillis():null,dateFraudChecksCompleted:null,dateModerated:1558730033306,dateModified:1554934543447,dateReferralEnded:null,dateReferralPaid:null,dateReferralStarted:_.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:x[Math.floor(Math.random()*x.length)],globalRewardKey:null,programRewardKey:"partnerReward",meta:__assign({},g()),rewardRedemptionTransactions:{data:[{exchangedRewards:{data:[{prettyValue:"CAD10.00 Visa* Prepaid Card CAD",type:"INTEGRATION",fuelTankCode:null,globalRewardKey:"gc1"}]}}]}}]:[],childNodes:{data:[{data:{id:"5cae6b16cc540e209db45cb3",statuses:x[Math.floor(Math.random()*x.length)],type:"PCT_DISCOUNT",value:50},depth:1},{data:{id:"5cae6b16cc540e209db45cfa",statuses:x[Math.floor(Math.random()*x.length)],type:"CREDIT",value:1},depth:1}]}}};var b=e("sqm_referral_table",function(){function e(e){t(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;s(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=r(w,null);var t=r(R,null);var n=u()?C(this,e,t):T(this,e,t),a=n.states,i=n.data,s=n.callbacks,l=n.elements;h([this.showReferrer,this.perPage]);return r(p,{states:a,data:i,callbacks:s,elements:l})};return e}());function w(){return r("slot",{name:"empty"},r("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 R(){return r("slot",{name:"loading"},r(S,null),r(S,null),r(S,null),r(S,null))}function S(){return r("sqm-table-row",null,r("sqm-table-cell",{colspan:5},r("sl-skeleton",null)))}function C(e,t,r){var n=l((function(e,t){return __assign(__assign({},e),t)}),{columns:[],rows:[],loading:false,page:0}),a=n[0],i=n[1];var s=m();var u=o((function(){var t;return((t=e.demoData)===null||t===void 0?void 0:t.mockData)||y(e.perPage)}),[e.perPage]);var f=E();function v(t){return __awaiter(this,void 0,void 0,(function(){var r,n,a,s,l,o,d,c,f,v,p,h,m,E;var _=this;return __generator(this,(function(g){switch(g.label){case 0:a=u===null||u===void 0?void 0:u.referredByReferral;s=e.showReferrer&&!!((r=u===null||u===void 0?void 0:u.referredByReferral)===null||r===void 0?void 0:r.dateReferralStarted);if(s){n=u.data.slice(0,e.perPage-1)}else{n=u.data.slice(0,e.perPage)}l=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"}));o=l===null||l===void 0?void 0:l.map((function(e,t){return __awaiter(_,void 0,void 0,(function(){var r,n,a;return __generator(this,(function(i){n=(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"&&n!=="loading"&&n!=="empty"){e.setAttribute("slot","column-"+t);e.style.position="absolute";a=e.firstElementChild.childNodes[1];a.innerHTML="+";a.style.lineHeight="20px";return[2,N(e,(function(){return e.renderLabel(t)}))]}return[2,N(e,(function(){return e.renderLabel()}))]}))}))}));if(!s)return[3,2];c=l===null||l===void 0?void 0:l.map((function(e){return __awaiter(_,void 0,void 0,(function(){return __generator(this,(function(t){return[2,N(e,(function t(){return e.renderCell(a,e)}))]}))}))}));return[4,Promise.all(c)];case 1:d=g.sent();g.label=2;case 2:f=n===null||n===void 0?void 0:n.map((function(e){return __awaiter(_,void 0,void 0,(function(){var t,r;var n=this;return __generator(this,(function(a){switch(a.label){case 0:t=l===null||l===void 0?void 0:l.map((function(t){return __awaiter(n,void 0,void 0,(function(){return __generator(this,(function(r){return[2,N(t,(function(){return t.renderCell(e,undefined)}))]}))}))}));return[4,Promise.all(t)];case 1:r=a.sent();return[2,r]}}))}))}));p=f;if(!p)return[3,4];h=[[d]];return[4,Promise.all(f)];case 3:p=__spreadArrays.apply(void 0,h.concat([g.sent()])).filter((function(e){return e}));g.label=4;case 4:v=p;i({rows:v});E=o;if(!E)return[3,6];return[4,Promise.all(o)];case 5:E=g.sent();g.label=6;case 6:m=E;i({columns:m,loading:false,page:0});return[2]}}))}))}d((function(){i({loading:true});(u===null||u===void 0?void 0:u.data)&&v(f)}),[u===null||u===void 0?void 0:u.data,f,s]);var p=c({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:a.columns,rows:a.rows,emptyElement:t,loadingElement:r}},e.demoData||{},{arrayMerge:function(e,t){return t}});return p}var L=e("sqm_referral_table_cell",function(){function e(e){t(this,e);this.ignored=true;s(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){return r("div",{innerHTML:this.innerTemplate})};return e}());var M=e("sqm_referral_table_column",function(){function e(e){t(this,e);s(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,r("sqm-referral-table-cell",{"inner-template":n(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(){h([this.columnTitle]);return r(a,{style:{display:"none"}},r("slot",null))};return e}());var O=e("sqm_referral_table_date_cell",function(){function e(e){t(this,e);this.ignored=true;this.locale="en";s(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e;var t=!this.date?"-":(e=_.DateTime.fromMillis(this.date))===null||e===void 0?void 0:e.setLocale(f(this.locale)).toLocaleString(_.DateTime.DATE_MED);return t};return e}());var U=e("sqm_referral_table_date_column",function(){function e(e){t(this,e);this.columnTitle="Date converted";this.dateShown="dateConverted";s(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,r("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,r("sqm-referral-table-date-cell",{date:e[this.dateShown]})]}))}))};e.prototype.render=function(){h([this.dateShown,this.columnTitle]);return r(a,{style:{display:"none"}})};return e}());var G=e("sqm_referral_table_rewards_cell",function(){function e(e){t(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 approved for payout and was scheduled for payment based on your settings.} 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;i.locale=this.locale;var n={"@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=v(n);var s=a.toString();var l=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 o=function(e,t){var r,n,a,i,s,l,o,d,u,c,f,v;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(((n=(r=e.referral)===null||r===void 0?void 0:r.fraudData)===null||n===void 0?void 0:n.moderationStatus)!=="APPROVED"){if(((i=(a=e.referral)===null||a===void 0?void 0:a.fraudData)===null||i===void 0?void 0:i.moderationStatus)==="PENDING")return"PENDING_REVIEW";if(((l=(s=e.referral)===null||s===void 0?void 0:s.fraudData)===null||l===void 0?void 0:l.moderationStatus)==="DENIED")return"DENIED"}var h=(o=e.partnerFundsTransfer)===null||o===void 0?void 0:o.status;if(h==="NOT_YET_DUE"||h==="TRANSFERRED"){return"PAYOUT_APPROVED"}else if(h==="OVERDUE")return"PAYOUT_FAILED";else if(h==="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")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((v=e===null||e===void 0?void 0:e.pendingReasons)===null||v===void 0?void 0:v.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 d=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 u=function(t){return _.DateTime.fromMillis(t).setLocale(f(e.locale)).toRelative().replace("in","").trim()};return(t=this.rewards)===null||t===void 0?void 0:t.map((function(t){var n,c;var v=o(t,e.taxConnection);var p=d(v);var h=i.formatMessage({id:"statusShortMessage",defaultMessage:e.statusText},{status:v});var m=i.formatMessage({id:"statusLongMessage",defaultMessage:e.statusLongText},{status:v});return r("sl-details",{class:a.classes.Details,disabled:e.hideDetails},r("style",{type:"text/css"},s),r("div",{slot:"summary",class:a.classes.DetailsContainer},r(D,{type:"p"},r("span",{part:"sqm-cell-value",class:a.classes.BoldText},t.prettyValue)),r("div",{class:a.classes.BadgeContainer},v==="PENDING"&&t.dateScheduledFor?r("sl-badge",{class:l(p),type:p,pill:true},i.formatMessage({id:"pendingForText",defaultMessage:e.pendingForText},{status:h,date:u(t.dateScheduledFor)})):r("sl-badge",{class:l(p),type:p,pill:true},h),t.dateExpires&&v==="AVAILABLE"&&r("sl-badge",{class:l(p),type:"info",pill:true},e.expiringText," "+u(t.dateExpires)))),r("div",null,v==="PENDING_REVIEW"&&((n=t.referral)===null||n===void 0?void 0:n.dateModerated)&&r("div",null,r(D,{type:"p"},m," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},_.DateTime.fromMillis(t.referral.dateModerated).setLocale(f(e.locale)).toLocaleString(_.DateTime.DATE_MED)))),v==="PAYOUT_APPROVED"&&r("div",null,r(D,{type:"p"},m)),v==="PAYOUT_FAILED"&&r("div",null,r(D,{type:"p"},m)),v==="PAYOUT_CANCELLED"&&r("div",null,r(D,{type:"p"},m)),v==="PENDING_TAX_REVIEW"&&r("div",null,r(D,{type:"p"},m)),v==="PENDING_NEW_TAX_FORM"&&r("div",null,r(D,{type:"p"},m)),v==="PENDING_TAX_SUBMISSION"&&r("div",null,r(D,{type:"p"},m)),v==="PENDING_PARTNER_CREATION"&&r("div",null,r(D,{type:"p"},m)),v==="DENIED"&&((c=t.referral)===null||c===void 0?void 0:c.dateModerated)&&r("div",null,r(D,{type:"p"},m," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},_.DateTime.fromMillis(t.referral.dateModerated).setLocale(f(e.locale)).toLocaleString(_.DateTime.DATE_MED)),".",e.deniedHelpText?" "+e.deniedHelpText:"")),t.dateGiven&&r("div",null,r(D,{type:"p"},e.rewardReceivedText," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},_.DateTime.fromMillis(t.dateGiven).setLocale(f(e.locale)).toLocaleString(_.DateTime.DATE_MED)))),v==="EXPIRED"&&t.dateExpires&&r("div",null,r(D,{type:"p"},m," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},_.DateTime.fromMillis(t.dateExpires).setLocale(f(e.locale)).toLocaleString(_.DateTime.DATE_MED)))),v==="CANCELLED"&&t.dateCancelled&&r("div",null,r(D,{type:"p"},m," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},_.DateTime.fromMillis(t.dateCancelled).setLocale(f(e.locale)).toLocaleString(_.DateTime.DATE_MED)))),v==="PENDING"&&t.dateScheduledFor&&r("div",null,r(D,{type:"p"},m," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},_.DateTime.fromMillis(t.dateScheduledFor).setLocale(f(e.locale)).toLocaleString(_.DateTime.DATE_MED))))," ",v==="AVAILABLE"&&t.dateExpires&&r("div",null,r(D,{type:"p"},m," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},_.DateTime.fromMillis(t.dateExpires).setLocale(f(e.locale)).toLocaleString(_.DateTime.DATE_MED)))),t.fuelTankCode&&r("div",null,e.fuelTankText," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},t.fuelTankCode))))}))};return e}());var B=e("sqm_referral_table_rewards_column",function(){function e(e){t(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 approved for payout and was scheduled for payment based on your settings.} 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;s(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,r("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,r("sqm-referral-table-rewards-cell",{rewards:e.rewards,exportparts:"sqm-cell-value"})]}))}))};e.prototype.render=function(){h([this.columnTitle,this.statusText,this.statusLongText,this.fuelTankText,this.rewardReceivedText,this.expiringText,this.pendingForText,this.hideDetails]);return r(a,{style:{display:"none"}})};return e}());var k={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 q=v(k);var V=q.toString();var W=e("sqm_referral_table_status_cell",function(){function e(e){t(this,e)}e.prototype.render=function(){var e=this;var t=v(k);var n=t.toString();var a=function(t){if(t==="PENDING")return"warning";if(t==="DENIED")return"danger";if(e.converted)return"success";return"warning"};var i=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 r("div",null,r("style",{type:"text/css"},n),r("sl-badge",{pill:true,type:a(this.fraudStatus),class:i(a(this.fraudStatus))},this.statusText),this.statusSubText?r("p",{class:t.classes.SubText},this.statusSubText):null)};return e}());var F=e("sqm_referral_table_status_column",function(){function e(e){t(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";s(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,a,i;return __generator(this,(function(s){i=(t=e===null||e===void 0?void 0:e.fraudData)===null||t===void 0?void 0:t.moderationStatus;if(i==="DENIED"){n=this.deniedStatusText;a=this.deniedStatusSubText}else if(i==="PENDING"){n=this.pendingReviewStatusText;a=this.pendingReviewStatusSubText}else{n=e.dateConverted?this.convertedStatusText:this.inProgressStatusText}return[2,r("sqm-referral-table-status-cell",{"status-text":n,"status-sub-text":a,"fraud-status":i,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(n){t=e.dateConverted?this.convertedStatusText:this.inProgressStatusText;return[2,r("sqm-referral-table-status-cell",{"status-text":t,converted:e.dateConverted?true:false})]}))}))};e.prototype.render=function(){h([this.columnTitle,this.convertedStatusText,this.inProgressStatusText]);return r(a,{style:{display:"none"}})};return e}());var X=e("sqm_referral_table_user_cell",function(){function e(e){t(this,e)}e.prototype.render=function(){return this.name};return e}());var Y=e("sqm_referral_table_user_column",function(){function e(e){t(this,e);this.columnTitle="Customer";this.anonymousUser="Anonymous User";this.deletedUser="Deleted User";s(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,a,i,s,l,o,d,u;return __generator(this,(function(c){if(!(e===null||e===void 0?void 0:e.referredUser)&&!(e===null||e===void 0?void 0:e.referrerUser)){u=this.deletedUser}else if(!((t=e===null||e===void 0?void 0:e.referredUser)===null||t===void 0?void 0:t.firstName)&&!((n=e===null||e===void 0?void 0:e.referredUser)===null||n===void 0?void 0:n.lastName)&&!((a=e===null||e===void 0?void 0:e.referrerUser)===null||a===void 0?void 0:a.firstName)&&!((i=e===null||e===void 0?void 0:e.referrerUser)===null||i===void 0?void 0:i.lastName)){u=this.anonymousUser}else if(e===null||e===void 0?void 0:e.referrerUser){u=((s=e===null||e===void 0?void 0:e.referrerUser)===null||s===void 0?void 0:s.firstName)+" "+((l=e===null||e===void 0?void 0:e.referrerUser)===null||l===void 0?void 0:l.lastName)}else{u=((o=e===null||e===void 0?void 0:e.referredUser)===null||o===void 0?void 0:o.firstName)+" "+((d=e===null||e===void 0?void 0:e.referredUser)===null||d===void 0?void 0:d.lastName)}return[2,r("sqm-referral-table-user-cell",{name:u})]}))}))};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,n,a,i,s;return __generator(this,(function(l){if(!e){s=this.deletedUser}else if(!((t=e===null||e===void 0?void 0:e.referrerUser)===null||t===void 0?void 0:t.firstName)&&!((n=e.referrerUser)===null||n===void 0?void 0:n.lastName)){s=this.anonymousUser}else{s=((a=e===null||e===void 0?void 0:e.referrerUser)===null||a===void 0?void 0:a.firstName)+" "+((i=e===null||e===void 0?void 0:e.referrerUser)===null||i===void 0?void 0:i.lastName)}return[2,r("sqm-referral-table-user-cell",{name:s})]}))}))};e.prototype.render=function(){h([this.deletedUser,this.anonymousUser,this.columnTitle]);return r(a,{style:{display:"none"}})};return e}())}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __makeTemplateObject=this&&this.__makeTemplateObject||function(e,r){if(Object.defineProperty){Object.defineProperty(e,"raw",{value:r})}else{e.raw=r}return e};System.register(["./p-59b028db.system.js","./p-
|
|
1
|
+
var __makeTemplateObject=this&&this.__makeTemplateObject||function(e,r){if(Object.defineProperty){Object.defineProperty(e,"raw",{value:r})}else{e.raw=r}return e};System.register(["./p-59b028db.system.js","./p-0ac445bc.system.js","./p-4f5329a2.system.js","./p-171310d9.system.js","./p-4bd679a7.system.js","./p-71271fbd.system.js"],(function(e){"use strict";var r,n,t,a,i,o,s,d,l,u,f;return{setters:[function(e){r=e.r;n=e.h},function(e){t=e.i},function(e){a=e.n},function(e){i=e.d;o=e.H;s=e.J;d=e.w;l=e.i},function(e){u=e.c},function(e){f=e.L}],execute:function(){var v=i.gql(__makeTemplateObject(["\n query ($type: String!, $filter: UserLeaderboardFilterInput) {\n viewer {\n ... on User {\n leaderboardRank(type: $type, filter: $filter) {\n rowNumber\n rank\n denseRank\n }\n }\n }\n }\n"],["\n query ($type: String!, $filter: UserLeaderboardFilterInput) {\n viewer {\n ... on User {\n leaderboardRank(type: $type, filter: $filter) {\n rowNumber\n rank\n denseRank\n }\n }\n }\n }\n"]));function p(e){var r,n,a,i;var l=o();var u=(r=e.programId)!==null&&r!==void 0?r:l;var f=s();var p=u?{type:e.leaderboardType,filter:{programId_eq:u}}:{type:e.leaderboardType,filter:{}};if(e.interval){p.filter["interval"]=e.interval}var c=d(v,p,!(f===null||f===void 0?void 0:f.jwt)).data;var y=((n=c===null||c===void 0?void 0:c.viewer)===null||n===void 0?void 0:n.leaderboardRank)?t.formatMessage({id:"rankText",defaultMessage:e.rankText},{rank:(i=(a=c===null||c===void 0?void 0:c.viewer)===null||a===void 0?void 0:a.leaderboardRank)===null||i===void 0?void 0:i[e.rankType]}):e.unrankedText||"unranked";return{data:{rank:y}}}var c="p,.P{font-size:var(--sl-font-size-small);color:var(--sqm-text);margin-top:0px}p.Subtitle,.P.Subtitle{color:var(--sqm-text-subdued);margin:0px}";var y=e("sqm_leaderboard_rank",function(){function e(e){r(this,e);this.rankText="You are currently in {rank, selectordinal, one {#st} two {#nd} few {#rd} other {#th} } place!";a(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=l()?b(this):p(this);return n(f,Object.assign({},e))};return e}());function b(e){var r=t.formatMessage({id:"rankText",defaultMessage:e.rankText},{rank:1})||"1st";return u({data:{rank:r}},e.demoData||{},{arrayMerge:function(e,r){return r}})}y.style=c}}}));
|