@saasquatch/mint-components 1.12.0-6 → 1.12.0-7
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/loader.cjs.js +1 -1
- package/dist/cjs/mint-components.cjs.js +1 -1
- package/dist/cjs/sqm-big-stat_39.cjs.entry.js +14 -5
- package/dist/cjs/sqm-widget-verification-internal.cjs.entry.js +6 -4
- package/dist/collection/components/sqm-widget-verification/sqm-widget-verification-internal.js +6 -5
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.js +3 -3
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.js +28 -1
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.js +6 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/sqm-big-stat_39.entry.js +15 -6
- package/dist/esm/sqm-widget-verification-internal.entry.js +6 -4
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/sqm-big-stat_39.entry.js +1 -1
- package/dist/esm-es5/sqm-widget-verification-internal.entry.js +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/p-0e2d876d.entry.js +240 -0
- package/dist/mint-components/p-22b7bd75.system.entry.js +1 -0
- package/dist/mint-components/{p-696e634f.system.entry.js → p-55fe2ec0.system.entry.js} +1 -1
- package/dist/mint-components/{p-4606b096.entry.js → p-6fb496ac.entry.js} +1 -1
- package/dist/mint-components/p-e05ff098.system.js +1 -1
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.d.ts +4 -0
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.d.ts +4 -0
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.d.ts +4 -0
- package/dist/types/components.d.ts +8 -0
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +1 -1
- package/dist/mint-components/p-46a5718f.system.entry.js +0 -1
- package/dist/mint-components/p-4986a616.entry.js +0 -240
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import{r as e,h as t,c as s}from"./p-64c3217a.js";import{j as r,d as a,f as n,k as o,u as i,e as l,b as c,h as d}from"./p-1b24bb52.js";import{i as u}from"./p-0db003f7.js";import{i as h,T as m,K as p,z as v,b as g,E as f,n as b,Q as y,w as x,x as w,g as k,m as C,W as E,U as I,a as S,o as R,j as M}from"./p-556753b2.js";import{c as q}from"./p-c1086930.js";import"./p-02be1a88.js";import{c as T}from"./p-cef45012.js";import{a as _}from"./p-65a449de.js";import{u as N}from"./p-7507d72b.js";import"./p-9223640e.js";import{d as A}from"./p-6fbfd683.js";import{g as P,a as D,s as L}from"./p-9ec99ced.js";import"./p-5d0c9424.js";import{p as V}from"./p-8d363802.js";import{j as F}from"./p-e7e129ac.js";import{R as $,u as O}from"./p-65de8fb2.js";import{i as j}from"./p-0ecb3019.js";import{A as U}from"./p-121cdc60.js";import{b as B,V as z,B as H,Q as W,K as G,j as Z,M as K,D as Y,E as X,H as Q,I as J,W as ee,L as te,N as se,d as re,i as ae,P as ne,e as oe,f as ie,R as le,X as ce,k as de,a as ue,S as he,C as me,u as pe,c as ve,T as ge}from"./p-8ccb4267.js";import"./p-c7fd9e16.js";const fe=class{constructor(t){e(this,t),this.flexReverse=!1,this.ignored=!0,r(this)}disconnectedCallback(){}render(){var e;const{props:s,label:r}=h()?B(this):z(this),a=!!(null===(e=m().innerHTML)||void 0===e?void 0:e.trim()),n=t("slot",{name:"label"},a?t("slot",null):r);return t(H,Object.assign({},s,{labelSlot:n}))}},be=class{constructor(t){e(this,t),r(this)}disconnectedCallback(){}render(){var e,r;const n=null!==(e=function(e){if(e)try{return W(e)}catch{}}(this.brandColor))&&void 0!==e?e:"",o=(null!==(r=this.brandFont)&&void 0!==r?r:"Nunito Sans").trim()||void 0;a((()=>{if(!o)return;const e=document.createElement("link");return e.setAttribute("href",function(...e){return`https://fonts.googleapis.com/css2?${e.map((e=>`family=${encodeURIComponent(e)}`)).join("&")}`}(o)),e.setAttribute("rel","stylesheet"),document.head.appendChild(e),()=>document.head.removeChild(e)}),[o]);const i=null!=o?o:"";return t(s,null,t("style",null,`\n\n :host{\n display: contents;\n }\n /* \n Selects any element placed inside a slot\n - resets css variable inheritence for fonts\n \n */\n ::slotted(*) {\n --sl-font-sans: "${i}", arial;\n --sl-input-font-family: "${i}", arial;\n --sl-tooltip-font-family: "${i}", arial;\n font-family: "${i}", arial;\n\t\t\t\n ${n}\n\n --sl-focus-ring-color-primary: var(--sl-color-primary-100);\n --sl-input-border-color-focus: var(--sl-color-primary-500);\n --sl-color-primary-hue: var(--sl-color-primary-500);\n }`),t("slot",null))}},ye=class{constructor(t){e(this,t),this.ignored=!0,this.width=347,this.gap=24,r(this)}disconnectedCallback(){}render(){return t(G,Object.assign({},P(this)),t("slot",null))}},xe=T({IconStyle:{display:"block",position:"absolute",top:"23px"},DivStyle:{marginLeft:"28px"},Details:{marginLeft:"28px"},Heading:{display:"inline-block"},Children:{display:"none"}}),we=xe.toString();function ke({missingProps:e,heading:s="There was a problem loading this section",subheading:r="There was a technical problem that prevented this section from loading. Please contact us with the link to this page.",description:a="Error occured while loading <{tagName}>. Values for the following attributes are missing:"},o){if(!e)return!1;const i=m(),[l,c]=n(!1);return t("sl-alert",{type:"danger",open:!0},t("style",{type:"text/css"},we),t("div",{slot:"icon",class:xe.classes.IconStyle},t("sl-icon",{name:"exclamation-octagon"})),t("div",{class:xe.classes.DivStyle},t("h2",{class:xe.classes.Heading},u.formatMessage({id:"error-heading",defaultMessage:s})),t("p",null,u.formatMessage({id:"error-subheading",defaultMessage:r}))),t("details",{class:xe.classes.Details},t("summary",{onClick:()=>c(!l)},l?"Less":"More"," details"),t("p",null,u.formatMessage({id:"error-description",defaultMessage:a},{tagName:i.tagName.toLowerCase()})),t("ul",null,e.map((e=>t("li",null,t("strong",null,e.attribute)))))),t("div",{class:xe.classes.Children},o))}const Ce=class{constructor(t){e(this,t),this.ignored=!0,this.checkboxLabel="By signing up you agree to the {labelLink}",this.checkboxLabelLink="https://example.com",this.checkboxLabelLinkText="Terms and Conditions",this.errorMessage="Must be checked",this.checkboxOptional=!1,r(this)}disconnectedCallback(){}render(){const e=D([{attribute:"checkbox-name",value:this.checkboxName}]);if(!h()&&e)return t(ke,{missingProps:e,heading:"An error occured while loading this form",subheading:"A technical problem prevented this checkbox field from loading. Please contact us with the link to this page.",description:"Values for the following attributes are missing:"});const s={...P(this)},{states:r,callbacks:i}=h()?q({states:{registrationFormState:{},checked:!1},callbacks:{setChecked:()=>{}}},this.demoData||{},{arrayMerge:(e,t)=>t}):function(e){var t;const s=o($),[r,i]=n(!1);return a((()=>{var t,r;(null===(t=null==s?void 0:s.initialData)||void 0===t?void 0:t[e.checkboxName])&&i(!!(null===(r=null==s?void 0:s.initialData)||void 0===r?void 0:r[e.checkboxName]))}),[null===(t=null==s?void 0:s.initialData)||void 0===t?void 0:t[e.checkboxName]]),{states:{registrationFormState:s,checked:r},callbacks:{setChecked:i}}}(this);return t(Z,{states:r,content:s,callbacks:i})}},Ee=A.gql`
|
|
2
|
+
query fuelTankRewardsQuery($programId: ID!) {
|
|
3
|
+
user: viewer {
|
|
4
|
+
... on User {
|
|
5
|
+
instantAccessRewards(
|
|
6
|
+
filter: { type_eq: FUELTANK, programId_eq: $programId }
|
|
7
|
+
) {
|
|
8
|
+
data {
|
|
9
|
+
fuelTankCode
|
|
10
|
+
fuelTankType
|
|
11
|
+
statuses
|
|
12
|
+
dateGiven
|
|
13
|
+
dateExpires
|
|
14
|
+
dateRedeemed
|
|
15
|
+
dateCancelled
|
|
16
|
+
dateScheduledFor
|
|
17
|
+
datePendingForUnhandledError
|
|
18
|
+
}
|
|
19
|
+
count
|
|
20
|
+
totalCount
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
`,Ie=A.gql`
|
|
26
|
+
mutation loadEvent($eventMeta: UserAnalyticsEvent!) {
|
|
27
|
+
createUserAnalyticsEvent(eventMeta: $eventMeta)
|
|
28
|
+
}
|
|
29
|
+
`,Se=class{constructor(t){e(this,t),this.tooltiptext="Copied to Clipboard",this.tooltiplifespan=1e3,this.textAlign="left",this.copyButtonLabel="Copy Coupon",this.buttonStyle="icon",this.couponCodeLabel="Your coupon code:",this.cancelledErrorText="This code has been cancelled. Please reach out to the Support team for help resolving this issue.",this.redeemedErrorText="Looks like you’ve already redeemed this code.",this.expiredErrorText="Looks like this code has expired. Please reach out to the Support team for help resolving this issue.",this.fullfillmentErrorText="We couldn't fetch your code. Please try again later or reach out to the Support team for help resolving this issue.",this.pendingErrorText="Your code will be available on {unpendDate}. Mark your calendar and come back then to redeem your reward!",this.genericErrorText="We couldn't fetch your code. Please try again later or reach out to the Support team for help resolving this issue.",this.couponCodePlaceholder="...",r(this)}disconnectedCallback(){}render(){const e=P(this),s=h()?function(e){const[t,s]=n(!1),r="THANKSJANE125uv125";return q({copyString:r,tooltiptext:e.tooltiptext,textAlign:e.textAlign,buttonStyle:e.buttonStyle,copyButtonLabel:e.copyButtonLabel,error:!1,couponCodePlaceholder:e.couponCodePlaceholder,couponCodeLabel:e.couponCodeLabel,open:t,onClick:()=>{navigator.clipboard.writeText(r),s(!0),setTimeout((()=>s(!1)),e.tooltiplifespan)}},e.demoData||{},{arrayMerge:(e,t)=>t})}(e):function(e){var t,s,r;const a=p(),o=v(),i=b(),[l]=g(Ie),{data:c,loading:d}=f(Ee,{programId:o},!(null==a?void 0:a.jwt)),u=null===(r=null===(s=null===(t=null==c?void 0:c.user)||void 0===t?void 0:t.instantAccessRewards)||void 0===s?void 0:s.data)||void 0===r?void 0:r[0],h=(e=>{if(!e||!e.statuses)return"ERROR";const t=e.statuses[e.statuses.length-1];return"PENDING"===t&&null===e.dateScheduledFor?"EMPTY_TANK":t})(u),m="PENDING"===h&&u.dateScheduledFor?new Date(u.dateScheduledFor).toLocaleDateString("default",{day:"numeric",month:"long",year:"numeric"}):void 0,y=(null==u?void 0:u.fuelTankCode)||"...",[x,w]=n(!1),k=(t=>{switch(t){case"CANCELLED":return e.cancelledErrorText;case"EXPIRED":return e.expiredErrorText;case"EMPTY_TANK":return e.fullfillmentErrorText;case"PENDING":return e.pendingErrorText.replace("{unpendDate}",m);case"REDEEMED":return e.redeemedErrorText;case"AVAILABLE":return"";default:return e.genericErrorText}})(h),C=(e=>{switch(e){case"EXPIRED":case"EMPTY_TANK":case"CANCELLED":case"ERROR":return"warning";case"PENDING":return"info";case"REDEEMED":return"success";default:return}})(h),E="AVAILABLE"!==h;return{...e,onClick:function(){navigator.clipboard.writeText(y),w(!0),setTimeout((()=>w(!1)),e.tooltiplifespan),l({eventMeta:{programId:o,id:null==a?void 0:a.id,accountId:null==a?void 0:a.accountId,type:"USER_REFERRAL_PROGRAM_ENGAGEMENT_EVENT",meta:{engagementMedium:i,shareMedium:"DIRECT"}}})},open:x,copyString:y,error:E,errorText:k,dateAvailable:m,loading:d,errorType:C}}(e);return t(K,Object.assign({},s))}};function Re(e,s){const r=()=>"row"===e.direction?{"border-right":e.dividerStyle||"1px solid #EAEAEA"}:{"border-bottom":e.dividerStyle||"1px solid #EAEAEA"},a={LayoutContainer:{display:"contents","& > :not(:last-child)":{...r()},"& > ::slotted(*:not(:last-child))":{...r()}}},n=`\n display: flex;\n flex: 1;\n box-sizing: border-box;\n flex-direction: ${e.direction};\n background-color: var(--sqm-content-background);\n overflow-x: clip;\n ${"column"===e.direction?"width: 100%; max-width: var(--sqm-portal-main-width);":""}\n ${null!==e.contentAreaWidth?`max-width: ${e.contentAreaWidth} !important;`:""}\n `,o=`\n :host{\n ${n}\n }\n @media screen and (max-width: 570px) {\n :host {\n display: flex;\n flex-direction: column;\n }\n }\n sqm-divided-layout {\n ${n}\n }\n `,i=T(a),l=i.toString();return t("div",{class:i.classes.LayoutContainer,part:"sqm-base"},t("style",{type:"text/css"},o,l),s)}const Me=class{constructor(t){e(this,t),this.dividerStyle="1px solid #EAEAEA",r(this)}disconnectedCallback(){}render(){return t(Re,Object.assign({},P(this)),t("slot",null))}},qe=class{constructor(t){e(this,t),this.ignored=!0,this.dropdownLabel="Select an option",this.errorMessage="Select an option",this.dropdownOptional=!1,r(this)}disconnectedCallback(){}render(){const e=D([{attribute:"dropdown-name",value:this.dropdownName}]);if(!h()&&e)return t(ke,{missingProps:e,heading:"An error occured while loading this form",subheading:"A technical problem prevented this drop down field from loading. Please contact us with the link to this page.",description:"Values for the following attributes are missing:"},t("slot",null));const s={...P(this),selectOptions:t("slot",null)},{states:r}=h()?q({states:{registrationFormState:{}}},this.demoData||{},{arrayMerge:(e,t)=>t}):{states:{registrationFormState:o($)}};return t(Y,{states:r,content:s})}},Te=A.gql`
|
|
30
|
+
query {
|
|
31
|
+
viewer {
|
|
32
|
+
... on User {
|
|
33
|
+
id
|
|
34
|
+
accountId
|
|
35
|
+
firstName
|
|
36
|
+
lastName
|
|
37
|
+
email
|
|
38
|
+
countryCode
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
`,_e=A.gql`
|
|
43
|
+
mutation (
|
|
44
|
+
$id: String!
|
|
45
|
+
$accountId: String!
|
|
46
|
+
$firstName: String!
|
|
47
|
+
$lastName: String!
|
|
48
|
+
) {
|
|
49
|
+
upsertUser(
|
|
50
|
+
userInput: {
|
|
51
|
+
id: $id
|
|
52
|
+
accountId: $accountId
|
|
53
|
+
firstName: $firstName
|
|
54
|
+
lastName: $lastName
|
|
55
|
+
}
|
|
56
|
+
) {
|
|
57
|
+
firstName
|
|
58
|
+
lastName
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
`,Ne={currentRegion:"",firstName:"",lastName:"",errors:{},error:""},Ae=class{constructor(t){e(this,t),this.ignored=!0,this.networkErrorMessage="Network request failed.",this.fieldEmptyText="Cannot be empty",this.formErrorText="Please correct the errors below to update your profile.",r(this)}disconnectedCallback(){}render(){const e=h()?function(e){return q({states:{loading:!1,submitDisabled:!1,formState:{currentRegion:"Canada",firstName:"Bill",lastName:"Bob",errors:{},error:"An error string"},user:{firstName:"Bill",lastName:"Bob",email:"billbob@example.com"},showEdit:!1,text:{editprofileheader:e.editprofileheader?e.editprofileheader:"Edit Profile",editprofiletext:e.editprofiletext?e.editprofiletext:"Update your profile.",firstnametext:e.firstnametext?e.firstnametext:"First Name",lastnametext:e.lastnametext?e.lastnametext:"Last Name",canceltext:e.canceltext?e.canceltext:"Cancel",updatetext:e.updatetext?e.updatetext:"Update",currentregiontext:e.currentregiontext?e.currentregiontext:"Region",showregion:!0,fieldEmptyText:e.fieldEmptyText}},callbacks:{onSubmit:e=>{console.log(e)},resetForm:()=>{console.log("reset")},onChange:()=>{console.log("change")},setShowEdit:e=>{console.log(e)}}},e.demoData||{},{arrayMerge:(e,t)=>t})}(P(this)):function(e){const t=p(),[s,r]=n(!1),[o,i]=n(""),[l,c]=n(void 0),[d,h]=n(Ne),m=f(Te,{},!(null==t?void 0:t.jwt)),[v,b]=g(_e);return a((()=>{!(null==b?void 0:b.loading)&&s&&((null==b?void 0:b.errors)?h((e=>{var t,s,r;return{...e,error:null===(r=null===(s=null===(t=null==b?void 0:b.errors)||void 0===t?void 0:t.response)||void 0===s?void 0:s.errors)||void 0===r?void 0:r[0].message}})):(c((e=>{var t;return{...e,...null===(t=null==b?void 0:b.data)||void 0===t?void 0:t.upsertUser}})),r(!1)))}),[null==b?void 0:b.loading]),a((()=>{c((e=>{var t;return{...e,...null===(t=null==m?void 0:m.data)||void 0===t?void 0:t.viewer}}))}),[null==m?void 0:m.data]),a((()=>{var t;(null===(t=null==b?void 0:b.errors)||void 0===t?void 0:t.message)&&h((t=>({...t,error:e.networkErrorMessage})))}),[null==b?void 0:b.errors]),{states:{loading:(null==m?void 0:m.loading)||b.loading,submitDisabled:!1,formState:d,user:l,showEdit:s,text:{editprofileheader:e.editprofileheader,editprofiletext:e.editprofiletext,firstnametext:e.firstnametext,lastnametext:e.lastnametext,canceltext:e.canceltext,updatetext:e.updatetext,currentregiontext:e.currentregiontext,showregion:e.showregion,fieldEmptyText:e.fieldEmptyText}},callbacks:{onSubmit:()=>{if(d.firstName&&d.lastName)return v({id:null==t?void 0:t.id,accountId:null==t?void 0:t.accountId,firstName:d.firstName,lastName:d.lastName}),void h((e=>({...e,errors:{}})));const s={};d.firstName||(s.firstName={message:e.fieldEmptyText}),d.lastName||(s.lastName={message:e.fieldEmptyText}),j(s)||h((t=>({...t,error:e.formErrorText}))),h((e=>({...e,errors:s})))},resetForm:()=>{var e,t,s,r,a,n;const o=(null===(t=null===(e=null==m?void 0:m.data)||void 0===e?void 0:e.viewer)||void 0===t?void 0:t.countryCode)?u.formatDisplayName(m.data.viewer.countryCode,{type:"region"}):"";c({...null===(s=m.data)||void 0===s?void 0:s.viewer,...null===(r=b.data)||void 0===r?void 0:r.upsertUser}),h({...Ne,...null===(a=m.data)||void 0===a?void 0:a.viewer,...null===(n=b.data)||void 0===n?void 0:n.upsertUser,currentRegion:o})},onChange:e=>{const{name:t,value:s}=e.target;h((e=>({...e,[t]:s})))},setShowEdit:r}}}(P(this));return t(X,Object.assign({},e))}};Ae.style=".ErrorStyles::part(base){background:var(--sl-color-danger-10);border-color:var(--sl-color-danger-500);outline:var(--sl-color-danger-500)}.ErrorStyles:host{--something-random:red;--focus-ring:0 0 0 var(--sl-focus-ring-width) red !important}.ErrorStyles::part(input){color:var(--sl-color-danger-500)}.ErrorStyles::part(input):-webkit-autofill,.ErrorStyles::part(input):-webkit-autofill:hover,.ErrorStyles::part(input):-webkit-autofill:focus,.ErrorStyles::part(input):-webkit-autofill:active{-webkit-box-shadow:0 0 0 var(--sl-input-height-large) var(--sl-input-background-color-hover) inset !important;box-shadow:0 0 0 var(--sl-input-height-large) var(--sl-input-background-color-hover) inset !important;-webkit-text-fill-color:var(--sl-color-danger-500)}.ErrorStyles::part(help-text){color:var(--sl-color-danger-500)}:host{display:block}:host([hidden]){display:none}.FormWrapper>:not(:first-child){margin-top:54px}.FormSection{width:100%}.FormSection>:not(:first-child){margin-top:16px}.ButtonWrapper{display:-ms-flexbox;display:flex;margin-top:24px;-ms-flex-pack:end;justify-content:flex-end}.ButtonWrapper>:not(:first-child){margin-left:var(--sl-font-size-x-small)}.CardWrapper{-webkit-box-sizing:border-box;box-sizing:border-box;background:var(--sl-color-white);padding:40px 30px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between}@media screen and (max-width: 499px){.CardWrapper{-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}}@media screen and (max-width: 880px){.CardWrapper.ShowEdit{-ms-flex-direction:row;flex-direction:row;-ms-flex-align:end;align-items:flex-end}}";const Pe=class{constructor(t){e(this,t),this.columns=1,this.minHeight=200,this.background="var(--sl-color-gray-50)",this.paddingSize="large",this.wrapDirection="wrap",r(this)}disconnectedCallback(){}render(){const e={states:{...P(this)},content:{primaryColumn:t("slot",null),secondaryColumn:t("slot",{name:"secondary-column"})}};return t(Q,Object.assign({},e))}};function De(e,s){const r=Boolean((e.header||e.description||e.buttonText)&&"overlay"===e.layout),a=T({Container:{position:"relative","&:before":{content:r?'""':"",width:"100%",height:"100%",position:"absolute",background:e.overlayColor||"var(--sl-color-primary-900)",opacity:e.overlayOpacity}},Image:{display:"block",width:"100%",height:"100%",objectFit:"cover"},Background:{backgroundImage:`url(${e.imageUrl})`,backgroundSize:"cover",backgroundPosition:e.imagePos||"center",display:"flex",justifyContent:"center",alignItems:"center"},Overlay:{zIndex:"1",padding:"calc(var(--sl-spacing-"+e.paddingText+") + var(--sl-spacing-"+e.paddingImage+"))",textAlign:"center",color:e.textColor||"var(--sl-color-neutral-0)",lineHeight:"var(--sl-line-height-dense)","@media (max-width: 599px)":{padding:"var(--sl-spacing-"+e.paddingText+")"}},Column:{display:"flex",background:e.backgroundColor||"",flexDirection:"right"===e.imagePos?"row-reverse":"row",lineHeight:"var(--sl-line-height-dense)",color:e.textColor||"var(--sl-color-neutral-900)","& .image-area":{width:e.imagePercentage?e.imagePercentage+"%":"50%",padding:"var(--sl-spacing-"+e.paddingImage+")",boxSizing:"border-box",display:"flex",justifyContent:"center",alignItems:"center","@media (max-width: 599px)":{width:"100%"}},"& .text-area":{width:e.imagePercentage?100-e.imagePercentage+"%":"50%",padding:"var(--sl-spacing-"+e.paddingText+")",alignSelf:"center",boxSizing:"border-box","@media (max-width: 599px)":{width:"100%",textAlign:"center",padding:"calc(0.5*var(--sl-spacing-"+e.paddingText+"))"}},"@media (max-width: 599px)":{flexDirection:"bottom"===e.imageMobilePos?"column-reverse":"column"}},Header:{fontSize:"var(--sl-font-size-xxx-large)",fontWeight:"var(--sl-font-weight-bold)","@media (max-width: 599px)":{fontSize:"var(--sl-font-size-xx-large)"}},Description:{fontSize:"var(--sl-font-size-x-large)",margin:"var(--sl-spacing-small) 0","@media (max-width: 599px)":{fontSize:"var(--sl-font-size-large)"}},Button:{marginTop:"var(--sl-spacing-medium)","&::part(base)":{padding:"0 var(--sl-spacing-x-large)"},"@media (max-width: 599px)":{width:"100%"}}}),n=a.toString();return t("div",{class:a.classes.Container,part:"sqm-base"},t("style",{type:"text/css"},"\n :host{\n display: block;\n }",n),"overlay"===e.layout&&t("div",{class:a.classes.Background},t("div",{class:a.classes.Overlay,part:"sqm-overlay"},e.header&&t("div",{class:a.classes.Header},e.header),e.description&&t("div",{class:a.classes.Description},e.description),e.buttonText&&t("sl-button",{class:a.classes.Button,type:"primary",onClick:()=>e.buttonNewTab?window.open(e.buttonLink):window.open(e.buttonLink,"_parent")},e.buttonText),s&&s)),"columns"===e.layout&&t("div",null,t("div",{class:a.classes.Column},t("div",{class:"image-area"},t("img",{class:a.classes.Image,src:e.imageUrl,part:"sqm-columns-image"})),t("div",{class:"text-area",part:"sqm-columns-text-area"},e.header&&t("div",{class:a.classes.Header,part:"sqm-columns-header"},e.header),e.description&&t("div",{class:a.classes.Description,part:"sqm-columns-description"},e.description),e.buttonText&&t("sl-button",{exportparts:"base: sqm-hero-image-button",class:a.classes.Button,type:"primary",onClick:()=>e.buttonNewTab?window.open(e.buttonLink):window.open(e.buttonLink,"_parent")},e.buttonText)))))}const Le=class{constructor(t){e(this,t),this.overlayOpacity="0.75",this.layout="overlay",this.imagePercentage=50,this.imagePos="center",this.imageMobilePos="top",this.buttonNewTab=!1,this.paddingText="xxxx-large",this.paddingImage="none",r(this)}disconnectedCallback(){}render(){return t(De,Object.assign({},P(this)),t("slot",null))}},Ve=class{constructor(t){e(this,t),this.ignored=!0,r(this)}disconnectedCallback(){}render(){return t(this.hookStory,null)}};function Fe(e){const s=T({Container:{display:"flex",width:"100%",justifyContent:e.alignment||"center",background:e.backgroundColor||""},Image:{minHeight:e.minHeight||"100%",width:e.width||"100%",maxWidth:"max-content",objectFit:"cover"}}),r=s.toString();return t("div",null,t("style",{type:"text/css"},r,"\n :host{\n display: block; \n }\n "),t("div",{class:s.classes.Container,part:"sqm-base"},t("img",{part:"sqm-image",src:e.imageUrl,class:s.classes.Image})))}const $e=class{constructor(t){e(this,t),this.alignment="center"}render(){return t(Fe,Object.assign({},P(this)))}},Oe=class{constructor(t){e(this,t),this.ignored=!0,this.fieldType="text",this.errorMessage="Cannot be empty",this.fieldOptional=!1,r(this)}disconnectedCallback(){}render(){const e={...P(this)},s=D([{attribute:"field-name",value:this.fieldName}]);if(!h()&&s)return t(ke,{missingProps:s,heading:"An error occured while loading this form",subheading:"A technical problem prevented this input field from loading. Please contact us with the link to this page.",description:"Values for the following attributes are missing:"});const{states:r}=h()?q({states:{registrationFormState:{}}},this.demoData||{},{arrayMerge:(e,t)=>t}):{states:{registrationFormState:o($)}};return t(J,{states:r,content:e})}},je=A.gql`
|
|
62
|
+
query (
|
|
63
|
+
$type: String!
|
|
64
|
+
$filter: UserLeaderboardFilterInput
|
|
65
|
+
$locale: RSLocale
|
|
66
|
+
$limit: Int!
|
|
67
|
+
) {
|
|
68
|
+
userLeaderboard(type: $type, filter: $filter) {
|
|
69
|
+
dateModified
|
|
70
|
+
rows(limit: $limit) {
|
|
71
|
+
textValue(locale: $locale)
|
|
72
|
+
firstName
|
|
73
|
+
lastInitial
|
|
74
|
+
rank {
|
|
75
|
+
rank
|
|
76
|
+
denseRank
|
|
77
|
+
rowNumber
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
`,Ue=A.gql`
|
|
83
|
+
query (
|
|
84
|
+
$type: String!
|
|
85
|
+
$filter: UserLeaderboardFilterInput
|
|
86
|
+
$locale: RSLocale
|
|
87
|
+
$limit: Int!
|
|
88
|
+
) {
|
|
89
|
+
userLeaderboard(type: $type, filter: $filter) {
|
|
90
|
+
dateModified
|
|
91
|
+
rows(limit: $limit) {
|
|
92
|
+
textValue(locale: $locale)
|
|
93
|
+
rank {
|
|
94
|
+
rank
|
|
95
|
+
denseRank
|
|
96
|
+
rowNumber
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
`,Be=A.gql`
|
|
102
|
+
query (
|
|
103
|
+
$type: String!
|
|
104
|
+
$filter: UserLeaderboardFilterInput
|
|
105
|
+
$locale: RSLocale
|
|
106
|
+
) {
|
|
107
|
+
viewer {
|
|
108
|
+
... on User {
|
|
109
|
+
firstName
|
|
110
|
+
lastInitial
|
|
111
|
+
leaderboardRank(type: $type, filter: $filter) {
|
|
112
|
+
textValue(locale: $locale)
|
|
113
|
+
rank
|
|
114
|
+
denseRank
|
|
115
|
+
rowNumber
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
`,ze=A.gql`
|
|
121
|
+
query (
|
|
122
|
+
$type: String!
|
|
123
|
+
$filter: UserLeaderboardFilterInput
|
|
124
|
+
$locale: RSLocale
|
|
125
|
+
) {
|
|
126
|
+
viewer {
|
|
127
|
+
... on User {
|
|
128
|
+
leaderboardRank(type: $type, filter: $filter) {
|
|
129
|
+
textValue(locale: $locale)
|
|
130
|
+
rank
|
|
131
|
+
denseRank
|
|
132
|
+
rowNumber
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
`,He=class{constructor(t){e(this,t),this.width="100%",this.hideViewer=!1,this.viewingUserText="You",this.hideNames=!1,this.anonymousUser="Anonymous User",this.maxRows=10,this.ignored=!0,r(this),ee(this)}disconnectedCallback(){}render(){const e={empty:t(We,null),usersheading:this.usersheading,statsheading:this.statsheading,rankheading:this.rankheading,rankType:this.rankType,leaderboardType:this.leaderboardType,maxRows:this.maxRows,programId:this.programId,anonymousUser:this.anonymousUser,interval:this.interval,hideViewer:this.hideViewer,viewingUserText:this.viewingUserText,hideNames:this.hideNames,showRank:this.showRank,rankSuffix:this.rankSuffix,width:this.width},s={...e,demoData:this.demoData},r=h()?function(e){var s,r;const a=(null===(r=null===(s=e.demoData)||void 0===s?void 0:s.data)||void 0===r?void 0:r.leaderboard)||[{firstName:"Viktor",lastInitial:"V",textValue:"82",rank:1,rowNumber:1},{firstName:"MF",lastInitial:"D",textValue:"73",rank:2,rowNumber:2},{firstName:"Freddie",lastInitial:"G",textValue:"64",rank:3,rowNumber:3},{firstName:"Benny",lastInitial:"B",textValue:"55",rank:4,rowNumber:4},{textValue:"46",rank:5,rowNumber:5}];return q({states:{loading:!1,hasLeaders:!0,isEssentials:!1,styles:{usersheading:e.usersheading?e.usersheading:"Top referrers",statsheading:e.statsheading?e.statsheading:"New customers",rankheading:e.rankheading?e.rankheading:"Rank",anonymousUser:e.anonymousUser?e.anonymousUser:"Anonymous User",showRank:e.showRank,hideViewer:e.hideViewer,viewingUserText:e.viewingUserText,hideNames:e.hideNames,rankSuffix:e.rankSuffix,width:e.width}},data:{rankType:"rowNumber",leaderboard:a},elements:{empty:t(We,null)}},e.demoData||{},{arrayMerge:(e,t)=>t})}(s):function(e){var t,s,r,a,n,o,l,c,d,u;const h=v(),m=null!==(t=e.programId)&&void 0!==t?t:h,g=p(),b=y(),x=m?{type:e.leaderboardType,filter:{programId_eq:m}}:{type:e.leaderboardType,filter:{}};e.interval&&(x.filter.interval=e.interval),b&&(x.locale=b),e.maxRows>0&&(x.limit=e.maxRows);const{data:w,loading:k,errors:C}=f(e.hideNames?Ue:je,x,!(null==g?void 0:g.jwt),{batch:!1}),{data:E}=f(e.hideNames?ze:Be,x,!(null==g?void 0:g.jwt)),I=null==(M=null===(s=null==w?void 0:w.userLeaderboard)||void 0===s?void 0:s.rows)?void 0:M.flatMap((t=>{var s,r;return{textValue:t.textValue,firstName:t.firstName,lastInitial:t.lastInitial,rank:null===(s=t.rank)||void 0===s?void 0:s[e.rankType],rowNumber:null===(r=t.rank)||void 0===r?void 0:r.rowNumber}})),S=null==I?void 0:I.sort((function(e,t){return e.rank-t.rank})),R={textValue:null===(a=null===(r=null==E?void 0:E.viewer)||void 0===r?void 0:r.leaderboardRank)||void 0===a?void 0:a.textValue,firstName:null===(n=null==E?void 0:E.viewer)||void 0===n?void 0:n.firstName,lastInitial:null===(o=null==E?void 0:E.viewer)||void 0===o?void 0:o.lastInitial,rank:null===(c=null===(l=null==E?void 0:E.viewer)||void 0===l?void 0:l.leaderboardRank)||void 0===c?void 0:c[e.rankType],rowNumber:null===(u=null===(d=null==E?void 0:E.viewer)||void 0===d?void 0:d.leaderboardRank)||void 0===u?void 0:u.rowNumber};var M;return{states:{loading:k,isEssentials:i((()=>{var e,t;return!!(null===(t=null===(e=null==C?void 0:C.response)||void 0===e?void 0:e.errors)||void 0===t?void 0:t.find((e=>{var t,s;return 403===(null===(s=null===(t=null==e?void 0:e.extensions)||void 0===t?void 0:t.apiError)||void 0===s?void 0:s.statusCode)})))}),[C]),hasLeaders:(null==S?void 0:S.length)>0,styles:e},data:{leaderboard:S,rankType:e.rankType,viewerRank:R},elements:{empty:e.empty}}}(e);return t(te,Object.assign({},r))}};function We(){return t("slot",{name:"empty"},t("sqm-empty",{"empty-state-image":"https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png","empty-state-header":"View your rank in the leaderboard","empty-state-text":"Be the first to refer a friend and reach the top of the leaderboard"}))}const Ge=T({Container:{display:"contents"},Link:{textDecoration:"none",color:"inherit"}}),Ze=Ge.toString();function Ke(e){const{onClick:s,buttonText:r}=e;return t("span",{class:Ge.classes.Container,part:"sqm-base"},t("style",{type:"text/css"},Ze,"\n:host{\n display: inline; \n}\n"),t("sl-button",{onClick:s,type:"primary",exportparts:"base: primarybutton-base"},t("a",{class:Ge.classes.Link,part:"sqm-link"},r)))}const Ye=class{constructor(t){e(this,t),this.openInNewTab=!1,this.buttonText="Click here"}render(){return t(Ke,Object.assign({},{...P(this),onClick:()=>{window.open(this.link,this.openInNewTab?"_blank":"_parent")}}))}},Xe=class{constructor(t){e(this,t),this.ignored=!0,this.firstNameLabel="First Name",this.lastNameLabel="Last Name",r(this)}disconnectedCallback(){}render(){const{states:e}=h()?q({states:{validationErrors:[],content:{firstNameLabel:this.firstNameLabel,lastNameLabel:this.lastNameLabel}}},this.demoData||{},{arrayMerge:(e,t)=>t}):function(e){return{states:{registrationFormState:o($),content:{lastNameLabel:e.lastNameLabel,firstNameLabel:e.firstNameLabel}}}}(this);return t(se,{states:e})}};function Qe(e){const{states:s}=e,{styles:r}=s;return s.includeDropdown?t("sl-dropdown",{style:"margin-bottom: var(--sl-spacing-large)"},t("sl-button",{slot:"trigger",caret:!0,onClick:e.callbacks.rerender,exportparts:"base: dropdownbutton-base"},r.menuLabel),t("sl-menu",{ref:t=>{void 0===e.ref.current&&(e.ref.current=t,e.callbacks.rerender())}},t("slot",null))):""}const Je=class{constructor(t){e(this,t),this.ignored=!0,r(this)}disconnectedCallback(){}render(){const e=h()?function(e){return q({states:{includeDropdown:!0,styles:{...e,menuLabel:"Menu"}},callbacks:{rerender:()=>{}},ref:{current:void 0}},e.demoData||{},{arrayMerge:(e,t)=>t})}(P(this)):function(e){const t=l(),[,s]=x(),r=p();return a((()=>{var e;null===(e=t.current)||void 0===e||e.addEventListener("sl-select",(e=>function(e){w.push(e.detail.item.value)}(e)))}),[t.current]),{states:{includeDropdown:void 0!==((null==r?void 0:r.id)||(null==r?void 0:r.accountId)||(null==r?void 0:r.jwt)),styles:{menuLabel:e.menuLabel}},callbacks:{rerender:s},ref:t}}(P(this));return t(s,{slot:"sqm-navigation-menu"},t(Qe,Object.assign({},e)))}};Je.style=":host{display:block}:host([hidden]){display:none}.HeaderWrapper{width:100%;max-width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:var(--sl-spacing-small) var(--sl-spacing-large);-ms-flex-align:center;align-items:center;background-color:var(--sqm-header-background)}@media screen and (max-width: 499px){.HeaderWrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse;-ms-flex-pack:end;justify-content:flex-end;padding:0 var(--sl-spacing-x-small)}}";const et=T({Wrapper:{maxWidth:"200px"},PayoutButtonDescription:{color:"var(--sl-color-neutral-500)",fontSize:"var(--sl-font-size-small)",margin:"0"}}),tt=et.toString();function st(e){const{text:s,states:r}=e;return r.payoutSettingsComplete?t("div",{part:"sqm-base",class:et.classes.Wrapper},t("style",{type:"text/css"},tt),t("sqm-scroll",{"scroll-tag-name":"sqm-tabs","button-text":s.payoutButtonText,"scroll-animation":"smooth"}),t("p",{class:et.classes.PayoutButtonDescription},s.payoutButtonDescription)):t("div",null)}const rt=class{constructor(t){e(this,t),this.payoutButtonText="Payouts & Tax Settings",this.payoutButtonDescription="Check your payout settings to see when you’ll get paid out next",this.ignored=!0,r(this)}disconnectedCallback(){}getTextProps(){return P(this)}render(){const e=function(e){return q({states:{payoutSettingsComplete:!1},text:e.getTextProps()},e.demoData||{},{arrayMerge:(e,t)=>t})}(this);return t(st,Object.assign({},e))}},at=T({SkeletonOne:{width:"50%",height:"16px"},AlertDescriptionText:{margin:"0",marginBottom:"var(--sl-spacing-small)"},WarningAlertContainer:{"&::part(base)":{backgroundColor:"var(--sl-color-yellow-100)",borderTop:"none"},"& sl-icon::part(base)":{color:"var(--sl-color-danger-500)"}},InfoAlertContainer:{"&::part(base)":{backgroundColor:"var(--sl-color-sky-100)",borderTop:"none"},"& sl-icon::part(base)":{color:"var(--sl-color-blue-500)"}}}),nt=at.toString();function ot(e){var s,r,a,n,o;const{text:i,states:l,data:c,callbacks:d}=e;if(l.loading)return t("sl-skeleton",{class:at.classes.SkeletonOne});if("DONE"===l.status)return t("div",null);function u(e){switch(e){case"INFORMATION_REQUIRED":return{header:i.informationRequiredHeader,description:i.informationRequiredDescription,buttonText:i.informationRequiredButtonText,alertType:"info",icon:"info-circle",class:at.classes.InfoAlertContainer};case"VERIFICATION_NEEDED":return{header:i.verificationRequiredHeader,description:i.verificationRequiredDescription,buttonText:i.verificationRequiredButtonText,alertType:"warning",icon:"exclamation-triangle",class:at.classes.WarningAlertContainer};case"HOLD":return{header:i.holdHeader,description:i.holdDescription,buttonText:null,alertType:"warning",icon:"exclamation-triangle",class:at.classes.WarningAlertContainer};default:return}}return t("div",{part:"sqm-base"},t("style",{type:"text/css"},nt),t("sl-alert",{exportparts:"base: alert-base, icon:alert-icon",type:null===(s=u(l.status))||void 0===s?void 0:s.alertType,class:null===(r=u(l.status))||void 0===r?void 0:r.class,open:!0},t("sl-icon",{slot:"icon",name:null===(a=u(l.status))||void 0===a?void 0:a.icon}),t("strong",null,null===(n=u(l.status))||void 0===n?void 0:n.header),t("p",{class:at.classes.AlertDescriptionText},null===(o=u(l.status))||void 0===o?void 0:o.description),function(e){switch(e){case"INFORMATION_REQUIRED":return"SquatchJS2"===c.type?t("sqm-scroll",{"scroll-tag-name":"sqm-tabs","button-text":i.informationRequiredButtonText,"scroll-animation":"smooth"}):t("sl-button","SquatchPortal"===c.type?{type:"default",onClick:d.onTermsClick}:{type:"default"},i.informationRequiredButtonText);case"VERIFICATION_NEEDED":return t("sl-button",{type:"default",loading:l.loading,onClick:()=>d.onClick},i.verificationRequiredButtonText);default:return}}(l.status)),t("sl-dialog",{open:l.showVerifyIdentity,"onSl-hide":d.onCancel},"AL: TODO add IFRAME URL"))}const it=A.gql`
|
|
138
|
+
query getUserStatus {
|
|
139
|
+
user: viewer {
|
|
140
|
+
... on User {
|
|
141
|
+
id
|
|
142
|
+
impactConnection {
|
|
143
|
+
connected
|
|
144
|
+
publisher {
|
|
145
|
+
id
|
|
146
|
+
payoutsAccount {
|
|
147
|
+
hold
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
`,lt=class{constructor(t){e(this,t),this.informationRequiredHeader="Payout and tax information required",this.informationRequiredDescription="Submit your banking details and tax documents to receive your rewards.",this.informationRequiredButtonText="Payouts & Tax Settings",this.verificationRequiredHeader="Verify your identity",this.verificationRequiredDescription="Complete your verification to start receiving your cash rewards. It should only take a few minutes verify.",this.verificationRequiredButtonText="Start Verification",this.holdHeader="Your payouts and account are on hold",this.holdDescription="Please check your inbox for an email from our referral provider, impact.com. It contains details on how to resolve this issue. If you need further assistance, feel free to reach out to {support email}.",this.termsUrl="https://terms.advocate.impact.com/PayoutTermsAndConditions.html",r(this)}disconnectedCallback(){}getTextProps(){return P(this)}render(){const e=h()?function(e){return q({states:{status:"INFORMATION_REQUIRED",loading:!1,showVerifyIdentity:!1},data:{type:"SquatchAdmin"},text:e.getTextProps(),callbacks:{onTermsClick:()=>{},onClick:()=>console.log("show"),onCancel:()=>console.log("hide")}},e.demoData||{},{arrayMerge:(e,t)=>t})}(this):function(e){const{type:t}=k(),{loading:s,data:r,refetch:o}=f(it,{}),[i,l]=n(void 0),[c,d]=n(!1);return a((()=>{if(!r)return;const e=function(e){var t,s;const r=null===(s=null===(t=e.user.impactConnection)||void 0===t?void 0:t.publisher)||void 0===s?void 0:s.payoutsAccount;return r?r.hold?"HOLD":r.verified?"DONE":"VERIFICATION_NEEDED":"INFORMATION_REQUIRED"}(r);l(e)}),[r]),a((()=>{const e=()=>o();return window.addEventListener("sqm:tax-form-updated",e),()=>window.removeEventListener("sqm:tax-form-updated",e)}),[]),{states:{loading:s,status:i,showVerifyIdentity:c},data:{type:t},text:e.getTextProps(),callbacks:{onTermsClick:()=>window.open(e.termsUrl,"_blank").focus(),onClick:()=>d(!0),onCancel:()=>d(!1)}}}(this);return t(ot,Object.assign({},e))}},ct=class{constructor(t){e(this,t),this.ignored=!0,this.modalChangePasswordHeader="Change Password",this.cancelText="Cancel",this.changePasswordButtonText="Change Password",this.passwordFieldLabel="New Password",this.confirmPasswordFieldLabel="Confirm New Password",this.successMessage="Your password has been updated.",this.portalChangePasswordHeader="Password",this.portalChangePasswordButtonText="Change your password...",this.meetsRequirementsText="Password has met all requirements",this.doesNotMeetRequirementsText="Password must meet the following requirements:",this.minErrorText="be a minimum of 8 characters",this.uppercaseErrorText="contain at least 1 uppercase character",this.lowercaseErrorText="contain at least 1 lowercase character",this.nonMatchingPasswordErrorText="contain at least 1 lowercase character",this.invalidSessionErrorText="Please log in again to change your password.",this.hasErrorText="contain at least 1 number or symbol",r(this)}disconnectedCallback(){}render(){const{states:e,callbacks:s}=h()?function(e){const[t,s]=n(!1);return q({states:{open:t,error:"",content:{modalChangePasswordHeader:e.modalChangePasswordHeader,cancelText:e.cancelText,changePasswordButtonText:e.changePasswordButtonText,passwordFieldLabel:e.passwordFieldLabel,confirmPasswordFieldLabel:e.confirmPasswordFieldLabel,successMessage:e.successMessage,portalChangePasswordHeader:e.portalChangePasswordHeader,portalChangePasswordButtonText:e.portalChangePasswordButtonText,meetsRequirementsText:e.meetsRequirementsText,doesNotMeetRequirementsText:e.doesNotMeetRequirementsText,minErrorText:e.minErrorText,uppercaseErrorText:e.uppercaseErrorText,lowercaseErrorText:e.lowercaseErrorText,hasErrorText:e.hasErrorText}},callbacks:{setOpen:e=>s(e),submit:e=>console.log("Submit",e)}},e.demoData||{},{arrayMerge:(e,t)=>t})}(this):function(e){var t,s,r,a,o,i,l;const[c,{loading:d,errors:u}]=C(),[h,m]=n(!1),[v,g]=n(""),[f,b]=n(!1),y=p();return{states:{open:h,loading:d,success:f,error:v||(null===(a=null===(r=null===(s=null===(t=null==u?void 0:u.response)||void 0===t?void 0:t.errors)||void 0===s?void 0:s[0])||void 0===r?void 0:r.extensions)||void 0===a?void 0:a.message)||(null===(l=null===(i=null===(o=null==u?void 0:u.response)||void 0===o?void 0:o.errors)||void 0===i?void 0:i[0])||void 0===l?void 0:l.message),content:{modalChangePasswordHeader:e.modalChangePasswordHeader,cancelText:e.cancelText,changePasswordButtonText:e.changePasswordButtonText,passwordFieldLabel:e.passwordFieldLabel,confirmPasswordFieldLabel:e.confirmPasswordFieldLabel,successMessage:e.successMessage,portalChangePasswordHeader:e.portalChangePasswordHeader,portalChangePasswordButtonText:e.portalChangePasswordButtonText,meetsRequirementsText:e.meetsRequirementsText,doesNotMeetRequirementsText:e.doesNotMeetRequirementsText,minErrorText:e.minErrorText,uppercaseErrorText:e.uppercaseErrorText,lowercaseErrorText:e.lowercaseErrorText,hasErrorText:e.hasErrorText}},data:{},callbacks:{setOpen:m,submit:async t=>{var s,r;b(!1);const a=null===(s=t.detail)||void 0===s?void 0:s.formData;if(null==a||a.forEach(((e,t)=>{F.set(a,t,e)})),!(null==y?void 0:y.jwt))return void g(e.invalidSessionErrorText);if(a.password!==a.confirmPassword)return void g(e.nonMatchingPasswordErrorText);g("");const n={password:a.password},o=await c(n);o instanceof Error||!(null===(r=o.changeManagedIdentityPassword)||void 0===r?void 0:r.success)||b(!0)}}}}(this);return t(re,{states:e,callbacks:s})}},dt=class{constructor(t){e(this,t),this.ignored=!0,this.hideSupportText=!1,this.supportEmail="support@example.com",this.supportText="For program support, contact {email}",this.hidePoweredBy=!1,this.poweredByLink="https://impact.com/advocate/",this.paddingTop="large",this.paddingRight="large",this.paddingBottom="large",this.paddingLeft="large",r(this)}disconnectedCallback(){}render(){return t(ae,Object.assign({},P(this)))}static get assetsDirs(){return["../../assets"]}},ut=class{constructor(t){e(this,t),this.ignored=!0,this.notFullScreen=!1,r(this)}disconnectedCallback(){}render(){const e=t("slot",{name:"footer"}),s=t("slot",{name:"header"}),r=h()?function(e,s,r){return q({notFullScreen:!0,data:{footer:e||t("span",null,"example@example.com"),header:s||t("div",{style:{display:"flex",flexDirection:"column"}},t("span",{style:{fontSize:"var(--sl-font-size-large)",fontWeight:"bold"}},"Portal Header"),t("span",{style:{fontSize:"var(--sl-font-size-small)"}},"A description for the portal"))},callbacks:{rerender:()=>{}}},r.demoData||{},{arrayMerge:(e,t)=>t})}(e,s,this):function(e,t){const[,s]=x();return{data:{footer:e,header:t},callbacks:{rerender:s}}}(e,s);return t(ne,Object.assign({},r),t("slot",null))}},ht=class{constructor(t){e(this,t),this.ignored=!0,this.nextPage="/",this.emailLabel="Email",this.passwordLabel="Password",this.submitLabel="Sign In",this.forgotPasswordPath="/forgotPassword",this.forgotPasswordLabel="Forgot Password?",this.registerLabel="Register",this.registerPath="/register",this.pageLabel="Sign in to your account",this.networkErrorMessage="An error occurred while logging you in. Please refresh the page and try again.",r(this)}disconnectedCallback(){}render(){const{states:e,callbacks:s}=h()?q({states:{error:"",loading:!1,forgotPasswordPath:"/forgotPassword",registerPath:"/register"},callbacks:{submit:async()=>{console.log("submit")}}},this.demoData||{},{arrayMerge:(e,t)=>t}):function(e){var t,s,r,a,o,i,l;const[c,{loading:d,errors:u}]=E(),[h,m]=n(""),p=new URLSearchParams(w.location.search),v=p.get("nextPage");return{states:{loading:d,error:(null===(a=null===(r=null===(s=null===(t=null==u?void 0:u.response)||void 0===t?void 0:t.errors)||void 0===s?void 0:s[0])||void 0===r?void 0:r.extensions)||void 0===a?void 0:a.message)||(null===(l=null===(i=null===(o=null==u?void 0:u.response)||void 0===o?void 0:o.errors)||void 0===i?void 0:i[0])||void 0===l?void 0:l.message)||h,registerPath:e.registerPath,forgotPasswordPath:e.forgotPasswordPath},callbacks:{submit:async t=>{var s,r;m("");let a=t.detail.formData;null==a||a.forEach(((e,t)=>{F.set(a,t,e)}));const n={email:a.email,password:a.password},o=await c(n);if(o instanceof Error)((null==o?void 0:o.message)||(null===(s=null==o?void 0:o.response)||void 0===s?void 0:s.error))&&m(e.networkErrorMessage);else if(null===(r=o.authenticateManagedIdentityWithEmailAndPassword)||void 0===r?void 0:r.token){p.delete("nextPage");const t=L(v||e.nextPage);w.push(t.href)}}}}}(this),r={forgotPasswordButton:t("slot",{name:"forgotPassword"},t("a",{onClick:()=>w.push(e.forgotPasswordPath)},this.forgotPasswordLabel)),secondaryButton:t("slot",{name:"secondaryButton"},t("sl-button",{type:"text",disabled:e.loading,onClick:()=>w.push(e.registerPath)},this.registerLabel)),emailLabel:this.emailLabel,passwordLabel:this.passwordLabel,submitLabel:this.submitLabel,pageLabel:this.pageLabel};return t(oe,{states:e,callbacks:s,content:r})}},mt=class{constructor(t){e(this,t),this.ignored=!0,this.nextPage="/",this.redirectPath="/verifyEmail",this.emailLabel="Email",this.passwordLabel="Password",this.submitLabel="Register",this.loginLabel="Sign in",this.confirmPasswordLabel="Confirm Password",this.confirmPassword=!1,this.disablePasswordValidation=!1,this.hideInputs=!1,this.pageLabel="Register",this.loginPath="/login",this.requiredFieldErrorMessage="Cannot be empty",this.networkErrorMessage="Network request failed.",this.passwordMismatchErrorMessage="Passwords do not match.",this.invalidEmailErrorMessage="Must be a valid email address",this.meetsRequirementsText="Password has met all requirements",this.doesNotMeetRequirementsText="Password must meet the following requirements:",this.minErrorText="be a minimum of 8 characters",this.uppercaseErrorText="contain at least 1 uppercase character",this.lowercaseErrorText="contain at least 1 lowercase character",this.hasErrorText="contain at least 1 number or symbol",r(this)}disconnectedCallback(){}render(){const{states:e,callbacks:s,refs:r}=h()?q({states:{error:"",loading:!1,confirmPassword:(n=this).confirmPassword,hideInputs:n.hideInputs||!1,customPasswordField:!1,loginPath:n.loginPath,disablePasswordValidation:n.disablePasswordValidation},callbacks:{submit:async()=>{console.log("submit")},inputFunction:()=>{}},refs:{formRef:{}}},n.demoData||{},{arrayMerge:(e,t)=>t}):function(e){var t,s,r,n,o,i,c,d,u;const h=l(null),{registrationFormState:m,setRegistrationFormState:p}=O({}),[v,{loading:g,errors:f}]=I();a((()=>{if(!h.current)return;const e=h.current;return e.addEventListener("sl-input",b),()=>{e.removeEventListener("sl-input",b)}}),[h.current]);const b=S((e=>{var t,s;if("tel"!==(null===(s=null===(t=e.target)||void 0===t?void 0:t.type)||void 0===s?void 0:s.toLowerCase()))return;const r=new U("US");e.target.value=r.input(e.target.value)}),[]);let y="";return y=(null===(t=null==f?void 0:f.response)||void 0===t?void 0:t.error)||(null==f?void 0:f.message)&&!(null===(s=null==f?void 0:f.response)||void 0===s?void 0:s.errors.length)?e.networkErrorMessage:(null===(i=null===(o=null===(n=null===(r=null==f?void 0:f.response)||void 0===r?void 0:r.errors)||void 0===n?void 0:n[0])||void 0===o?void 0:o.extensions)||void 0===i?void 0:i.message)||(null===(u=null===(d=null===(c=null==f?void 0:f.response)||void 0===c?void 0:c.errors)||void 0===d?void 0:d[0])||void 0===u?void 0:u.message)||(null==m?void 0:m.error),{states:{loading:g,error:y,registrationFormState:m,confirmPassword:e.confirmPassword,hideInputs:e.hideInputs,loginPath:e.loginPath,disablePasswordValidation:e.disablePasswordValidation},callbacks:{submit:async t=>{var s;let r=t.target.getFormControls(),a={},n={};if(null==r||r.forEach((t=>{if(!t.name)return;const s=t.name,r=t.value;if(F.set(a,s,r),t.required&&!r&&F.set(n,s,e.requiredFieldErrorMessage),"function"==typeof t.validationError){const e=(0,t.validationError)({control:t,key:s,value:r});e&&F.set(n,s,e)}})),(e.confirmPassword||a.confirmPassword)&&a.password!==a.confirmPassword&&(n={...n,confirmPassword:e.passwordMismatchErrorMessage}),Object.keys(n).length)return void p({loading:!1,error:"",validationErrors:n});p({loading:!0,error:"",validationErrors:{}});const{email:o,password:i}=a;delete a.email,delete a.password,delete a.confirmPassword,a={...a};const l={email:o,password:i,formData:a,redirectPath:e.redirectPath};try{const t=await v(l);if(t instanceof Error)throw t;p({loading:!1,error:"",validationErrors:{}}),(null===(s=t.registerManagedIdentityWithEmailAndPassword)||void 0===s?void 0:s.token)&&w.push(e.nextPage)}catch(t){p({loading:!1,error:e.networkErrorMessage,validationErrors:{}})}},inputFunction:b},refs:{formRef:h}}}(this);var n;const o={formData:t("slot",{name:"formData"}),secondaryButton:t("slot",{name:"secondaryButton"},t("sl-button",{type:"text",disabled:e.loading,onClick:()=>w.push(e.loginPath)},this.loginLabel)),terms:t("slot",{name:"terms"}),emailLabel:this.emailLabel,passwordLabel:this.passwordLabel,submitLabel:this.submitLabel,pageLabel:this.pageLabel,confirmPasswordLabel:this.confirmPasswordLabel,invalidEmailErrorMessage:this.invalidEmailErrorMessage,requiredFieldErrorMessage:this.requiredFieldErrorMessage,meetsRequirementsText:this.meetsRequirementsText,doesNotMeetRequirementsText:this.doesNotMeetRequirementsText,minErrorText:this.minErrorText,uppercaseErrorText:this.uppercaseErrorText,lowercaseErrorText:this.lowercaseErrorText,hasErrorText:this.hasErrorText};return t(ie,{states:e,callbacks:s,content:o,refs:r})}};function pt(e,s){const r=T({Container:{color:e.textColor||"var(--sl-color-neutral-900)",background:e.backgroundColor||""},Header:{fontSize:"var(--sl-font-size-x-large)",fontWeight:"var(--sl-font-weight-bold)",lineHeight:"var(--sl-line-height-dense)",marginBottom:"var(--sl-spacing-large)",textAlign:"center"},Grid:{display:"flex",flexDirection:"row",gap:"var(--sl-spacing-large)","@media (max-width: 499px)":{flexDirection:"column"}}}),a=r.toString();return t("div",{class:r.classes.Container,part:"sqm-base"},t("style",{type:"text/css"},a,"\n ::slotted(*){\n display: flex;\n width: 100%;\n }\n @media (max-width: 499px) {\n ::slotted(*){\n display: block;\n }\n }"),t("div",{class:r.classes.Header},t("div",{class:r.classes.Header,part:"sqm-header"},e.header)),t("div",{class:r.classes.Grid,part:"sqm-grid-container"},s))}const vt=class{constructor(t){e(this,t),this.ignored=!0,r(this)}disconnectedCallback(){}render(){return t(pt,Object.assign({},P(this)),t("slot",null))}};function gt(e){const s=T({Container:{display:"flex",flexDirection:"column",width:"100%",padding:"var(--sl-spacing-x-large)",lineHeight:"var(--sl-line-height-dense)",color:e.textColor||"var(--sl-color-neutral-900)",background:e.backgroundColor||"var(--sl-color-primary-50)","@media (max-width: 499px)":{flexDirection:"row",width:"auto",paddingBottom:"var(--sl-spacing-large)"}},Text:{"@media (max-width: 499px)":{marginLeft:"var(--sl-spacing-large)"}},Header:{fontSize:"var(--sl-font-size-large)",fontWeight:"var(--sl-font-weight-bold)",marginTop:"var(--sl-spacing-x-large)","@media (max-width: 499px)":{margin:"0"}},Description:{fontSize:"var(--sl-font-size-medium)",marginTop:"var(--sl-spacing-small)","@media (max-width: 499px)":{marginTop:"var(--sl-spacing-x-small)"}},Media:{width:"64px",height:"64px",borderRadius:"100%",objectFit:"cover",userSelect:"none",background:"#FFF",color:"var(--sl-color-primary-300)",fontSize:"26px",textAlign:"center",lineHeight:"72px"}}),r=s.toString();return t("div",{class:s.classes.Container,part:"sqm-base"},t("style",{type:"text/css"},r),t("div",null,e.imageUrl?t("img",{class:s.classes.Media,src:e.imageUrl,part:"sqm-media"}):t("div",{class:s.classes.Media,part:"sqm-media"},t("sl-icon",{name:e.icon}))),t("div",{class:s.classes.Text},t("div",{class:s.classes.Header,part:"sqm-header"},e.header),t("div",{class:s.classes.Description,part:"sqm-description"},e.description)))}const ft=class{constructor(t){e(this,t),r(this)}disconnectedCallback(){}render(){return t(gt,Object.assign({},P(this)))}},bt=c("sq:useProgramMenu"),yt=class{constructor(t){e(this,t),this.ignored=!0,r(this)}disconnectedCallback(){}render(){const{data:e,ref:r}=function(e){const t=v(),s=m();bt({programId:t,props:e});const r=l(),[,n]=x();return a((()=>{var e;null===(e=r.current)||void 0===e||e.addEventListener("sl-select",(e=>{s.dispatchEvent(new CustomEvent("sq:update-program-id",{detail:e.detail.item.value,bubbles:!0,composed:!0}))}))}),[r.current]),{data:{programId:t},callbacks:{rerender:n},ref:r}}(P(this));return t(s,{style:{display:"contents"}},t("sl-select",{style:{paddingBottom:"var(--sl-spacing-large)"},value:e.programId,ref:e=>r.current=e},t("slot",null)))}},xt=T({Container:{borderRadius:"var(--sl-border-radius-large)",color:"var(--sl-color-neutral-900)",background:"var(--sl-color-neutral-0)",display:"flex",flexDirection:"column",rowGap:"var(--sl-spacing-large)"},EndContainer:{display:"flex",flexDirection:"column",alignItems:"center"},ColumnContainer:{"& p":{margin:"0"},display:"grid",gridAutoColumns:"minmax(0, 1fr)",gridAutoFlow:"column",gap:"calc(2 * var(--sl-spacing-medium))","@media (max-width: 499px)":{gridAutoFlow:"unset",gridAutoColumns:"unset",gridTemplateColumns:"1fr",border:"none"}}}),wt=xt.toString();function kt(e){return t("div",{part:"sqm-base",class:xt.classes.Container,style:{border:e.hideBorder?"none":"1px solid var(--sl-color-neutral-300)","padding-top":`var(--sl-spacing-${e.paddingTop})`,"padding-right":`var(--sl-spacing-${e.paddingRight})`,"padding-bottom":`var(--sl-spacing-${e.paddingBottom})`,"padding-left":`var(--sl-spacing-${e.paddingLeft})`,backgroundColor:e.backgroundColor,maxWidth:e.limitWidth?"600px":"none",margin:e.limitWidth?"auto":"none"}},t("style",{type:"text/css"},wt,"\n :host{\n display: block; \n }\n "),e.hasHeader&&t("div",{class:xt.classes.EndContainer},e.slots.header),t("div",{part:"sqm-column-container",class:xt.classes.ColumnContainer,style:{alignItems:e.verticalAlignment}},e.slots.left,e.slots.right),e.hasFooter&&t("div",{class:xt.classes.EndContainer},e.slots.footer))}const Ct=class{constructor(t){e(this,t),this.ignored=!0,this.verticalAlignment="start",this.hideBorder=!1,this.paddingTop="large",this.paddingRight="large",this.paddingBottom="large",this.paddingLeft="large",this.backgroundColor="#ffffff",this.limitWidth=!1,r(this)}disconnectedCallback(){}render(){const e={left:t("slot",{name:"left"}),right:t("slot",{name:"right"}),header:t("slot",{name:"header"}),footer:t("slot",{name:"footer"})},s=N(),r=s.findIndex((e=>"header"===e.slot))>-1,a=s.findIndex((e=>"footer"===e.slot))>-1;return t(kt,Object.assign({},P(this),{slots:e,hasHeader:r,hasFooter:a}),t("slot",null))}},Et=A.gql`
|
|
155
|
+
query getUser($programId: ID) {
|
|
156
|
+
viewer {
|
|
157
|
+
... on User {
|
|
158
|
+
referralCode(programId: $programId)
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
`,It=class{constructor(t){e(this,t),this.ignored=!0,this.iframeHeight="100%",this.iframeWidth="100%",r(this)}disconnectedCallback(){}render(){const e=D([{attribute:"iframe-src",value:this.iframeSrc}]);if(e)return t(ke,{missingProps:e,heading:"An error occured while loading this page",subheading:"A technical problem prevented this iframe from loading. Please contact us with the link to this page.",description:"Values for the following attributes are missing:"});const{states:r,data:a}=h()?(n=P(this),q({states:{content:{iframeSrc:"https://example.com",...n}},data:{shareCode:"SHARECODE123"}},n.demoData||{},{arrayMerge:(e,t)=>t})):function(e){var t;const s=v(),r=p(),{data:a}=f(Et,{programId:s},!(null==r?void 0:r.jwt)||!s);return{states:{content:e},data:{shareCode:null===(t=null==a?void 0:a.viewer)||void 0===t?void 0:t.referralCode}}}(P(this));var n;return t(s,{style:{display:"contents"}},t(le,{data:a,states:r}))}};var St={};!function e(t,s,r,a){var n=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL);function o(){}function i(e){var r=s.exports.Promise,a=void 0!==r?r:t.Promise;return"function"==typeof a?new a(e):(e(o,o),null)}var l,c,d,u,h,m,p,v,g=(d=Math.floor(1e3/60),u={},h=0,"function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame?(l=function(e){var t=Math.random();return u[t]=requestAnimationFrame((function s(r){h===r||h+d-1<r?(h=r,delete u[t],e()):u[t]=requestAnimationFrame(s)})),t},c=function(e){u[e]&&cancelAnimationFrame(u[e])}):(l=function(e){return setTimeout(e,d)},c=function(e){return clearTimeout(e)}),{frame:l,cancel:c}),f=(v={},function(){if(m)return m;if(!r&&n){var t=["var CONFETTI, SIZE = {}, module = {};","("+e.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join("\n");try{m=new Worker(URL.createObjectURL(new Blob([t])))}catch(e){return void 0!==typeof console&&"function"==typeof console.warn&&console.warn("🎊 Could not load worker",e),null}!function(e){function t(t,s){e.postMessage({options:t||{},callback:s})}e.init=function(t){var s=t.transferControlToOffscreen();e.postMessage({canvas:s},[s])},e.fire=function(s,r,a){if(p)return t(s,null),p;var n=Math.random().toString(36).slice(2);return p=i((function(r){function o(t){t.data.callback===n&&(delete v[n],e.removeEventListener("message",o),p=null,a(),r())}e.addEventListener("message",o),t(s,n),v[n]=o.bind(null,{data:{callback:n}})}))},e.reset=function(){for(var t in e.postMessage({reset:!0}),v)v[t](),delete v[t]}}(m)}return m}),b={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function y(e,t,s){return function(e,t){return t?t(e):e}(e&&null!=e[t]?e[t]:b[t],s)}function x(e){return e<0?0:Math.floor(e)}function w(e){return parseInt(e,16)}function k(e){return e.map(C)}function C(e){var t=String(e).replace(/[^0-9a-f]/gi,"");return t.length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),{r:w(t.substring(0,2)),g:w(t.substring(2,4)),b:w(t.substring(4,6))}}function E(e){e.width=document.documentElement.clientWidth,e.height=document.documentElement.clientHeight}function I(e){var t=e.getBoundingClientRect();e.width=t.width,e.height=t.height}function S(e,s){var o,l=!e,c=!!y(s||{},"resize"),d=y(s,"disableForReducedMotion",Boolean),u=n&&y(s||{},"useWorker")?f():null,h=l?E:I,m=!(!e||!u||!e.__confetti_initialized),p="function"==typeof matchMedia&&matchMedia("(prefers-reduced-motion)").matches;function v(t,s,n){for(var l,c,d,u,m=y(t,"particleCount",x),p=y(t,"angle",Number),v=y(t,"spread",Number),f=y(t,"startVelocity",Number),b=y(t,"decay",Number),w=y(t,"gravity",Number),C=y(t,"drift",Number),E=y(t,"colors",k),I=y(t,"ticks",Number),S=y(t,"shapes"),R=y(t,"scalar"),M=function(e){var t=y(e,"origin",Object);return t.x=y(t,"x",Number),t.y=y(t,"y",Number),t}(t),q=m,T=[],_=e.width*M.x,N=e.height*M.y;q--;)T.push((void 0,void 0,c=(l={x:_,y:N,angle:p,spread:v,startVelocity:f,color:E[q%E.length],shape:S[(0,u=S.length,Math.floor(Math.random()*(u-0))+0)],ticks:I,decay:b,gravity:w,drift:C,scalar:R}).angle*(Math.PI/180),d=l.spread*(Math.PI/180),{x:l.x,y:l.y,wobble:10*Math.random(),velocity:.5*l.startVelocity+Math.random()*l.startVelocity,angle2D:-c+(.5*d-Math.random()*d),tiltAngle:Math.random()*Math.PI,color:l.color,shape:l.shape,tick:0,totalTicks:l.ticks,decay:l.decay,drift:l.drift,random:Math.random()+5,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:3*l.gravity,ovalScalar:.6,scalar:l.scalar}));return o?o.addFettis(T):(o=function(e,t,s,n,o){var l,c,d=t.slice(),u=e.getContext("2d"),h=i((function(t){function i(){l=c=null,u.clearRect(0,0,n.width,n.height),o(),t()}l=g.frame((function t(){!r||n.width===a.width&&n.height===a.height||(n.width=e.width=a.width,n.height=e.height=a.height),n.width||n.height||(s(e),n.width=e.width,n.height=e.height),u.clearRect(0,0,n.width,n.height),(d=d.filter((function(e){return function(e,t){t.x+=Math.cos(t.angle2D)*t.velocity+t.drift,t.y+=Math.sin(t.angle2D)*t.velocity+t.gravity,t.wobble+=.1,t.velocity*=t.decay,t.tiltAngle+=.1,t.tiltSin=Math.sin(t.tiltAngle),t.tiltCos=Math.cos(t.tiltAngle),t.random=Math.random()+5,t.wobbleX=t.x+10*t.scalar*Math.cos(t.wobble),t.wobbleY=t.y+10*t.scalar*Math.sin(t.wobble);var s=t.tick++/t.totalTicks,r=t.x+t.random*t.tiltCos,a=t.y+t.random*t.tiltSin,n=t.wobbleX+t.random*t.tiltCos,o=t.wobbleY+t.random*t.tiltSin;return e.fillStyle="rgba("+t.color.r+", "+t.color.g+", "+t.color.b+", "+(1-s)+")",e.beginPath(),"circle"===t.shape?e.ellipse?e.ellipse(t.x,t.y,Math.abs(n-r)*t.ovalScalar,Math.abs(o-a)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI):function(e,t,s,r,a,n,o,i){e.save(),e.translate(t,s),e.rotate(n),e.scale(r,a),e.arc(0,0,1,0,i,void 0),e.restore()}(e,t.x,t.y,Math.abs(n-r)*t.ovalScalar,Math.abs(o-a)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI):(e.moveTo(Math.floor(t.x),Math.floor(t.y)),e.lineTo(Math.floor(t.wobbleX),Math.floor(a)),e.lineTo(Math.floor(n),Math.floor(o)),e.lineTo(Math.floor(r),Math.floor(t.wobbleY))),e.closePath(),e.fill(),t.tick<t.totalTicks}(u,e)}))).length?l=g.frame(t):i()})),c=i}));return{addFettis:function(e){return d=d.concat(e),h},canvas:e,promise:h,reset:function(){l&&g.cancel(l),c&&c()}}}(e,T,h,s,n)).promise}function b(s){var r=d||y(s,"disableForReducedMotion",Boolean),a=y(s,"zIndex",Number);if(r&&p)return i((function(e){e()}));l&&o?e=o.canvas:l&&!e&&(e=function(e){var t=document.createElement("canvas");return t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",t.style.zIndex=e,t}(a),document.body.appendChild(e)),c&&!m&&h(e);var n={width:e.width,height:e.height};function g(){if(u){var t={getBoundingClientRect:function(){if(!l)return e.getBoundingClientRect()}};return h(t),void u.postMessage({resize:{width:t.width,height:t.height}})}n.width=n.height=null}function f(){o=null,c&&t.removeEventListener("resize",g),l&&e&&(document.body.removeChild(e),e=null,m=!1)}return u&&!m&&u.init(e),m=!0,u&&(e.__confetti_initialized=!0),c&&t.addEventListener("resize",g,!1),u?u.fire(s,n,f):v(s,n,f)}return b.reset=function(){u&&u.reset(),o&&o.reset()},b}s.exports=S(null,{useWorker:!0,resize:!0}),s.exports.create=S}(function(){return"undefined"!=typeof window?window:"undefined"!=typeof self?self:this||{}}(),St,!1);const Rt=St.exports,Mt=A.gql`
|
|
163
|
+
query getExchangeList {
|
|
164
|
+
viewer {
|
|
165
|
+
... on User {
|
|
166
|
+
visibleRewardExchangeItems(limit: 20, offset: 0) {
|
|
167
|
+
data {
|
|
168
|
+
key
|
|
169
|
+
name
|
|
170
|
+
description
|
|
171
|
+
imageUrl
|
|
172
|
+
available
|
|
173
|
+
unavailableReasonCode
|
|
174
|
+
ruleType
|
|
175
|
+
sourceUnit
|
|
176
|
+
sourceValue
|
|
177
|
+
prettySourceValue
|
|
178
|
+
sourceMinValue
|
|
179
|
+
prettySourceMinValue
|
|
180
|
+
sourceMaxValue
|
|
181
|
+
prettySourceMaxValue
|
|
182
|
+
destinationMinValue
|
|
183
|
+
prettyDestinationMinValue
|
|
184
|
+
destinationMaxValue
|
|
185
|
+
prettyDestinationMaxValue
|
|
186
|
+
globalRewardKey
|
|
187
|
+
destinationUnit
|
|
188
|
+
steps {
|
|
189
|
+
sourceValue
|
|
190
|
+
prettySourceValue
|
|
191
|
+
destinationValue
|
|
192
|
+
prettyDestinationValue
|
|
193
|
+
available
|
|
194
|
+
globalRewardKey
|
|
195
|
+
unavailableReasonCode
|
|
196
|
+
rewardInput
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
totalCount
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
`,qt=A.gql`
|
|
205
|
+
mutation exchange($exchangeRewardInput: ExchangeRewardInput!) {
|
|
206
|
+
exchangeReward(exchangeRewardInput: $exchangeRewardInput) {
|
|
207
|
+
reward {
|
|
208
|
+
id
|
|
209
|
+
fuelTankCode
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
`,Tt=class{constructor(t){e(this,t),this.ignored=!0,this.notAvailableError="{unavailableReasonCode, select, US_TAX {US Tax limit} INSUFFICIENT_REDEEMABLE_CREDIT {{sourceValue} required} AVAILABILITY_PREDICATE {Not available} other {{unavailableReasonCode}} }",this.chooseRewardTitle="Rewards",this.chooseAmountTitle="Select",this.confirmationTitle="Confirm",this.rewardTitle="Choose a reward",this.cancelText="Cancel",this.backText="Back",this.continueText="Continue",this.continueToConfirmationText="Continue to confirmation",this.redeemText="Redeem",this.redeemTitle="Confirm and redeem",this.redemptionSuccessText="Redeemed {sourceValue} for {destinationValue}",this.sourceAmountMessage="{ruleType, select, FIXED_GLOBAL_REWARD {{sourceValue}} other {{sourceMinValue} to {sourceMaxValue}}}",this.tooltipText="Copied",this.doneText="Done",this.selectText="Select amount to receive",this.queryError="Unable to load reward exchange list. Please try again",this.redemptionError="An error occured trying to redeem this reward. Please try again",this.notEnoughError="Not enough {sourceUnit} to redeem for this reward",this.rewardRedeemedText="Reward redeemed",this.promoCode="Promo Code",this.skeletonCardNum=8,this.rewardNameTitle="Reward",this.rewardAmountTitle="Reward Amount",this.costTitle="Cost to Redeem",r(this)}disconnectedCallback(){}render(){const e={...P(this),empty:t(_t,null)},{states:r,data:o,callbacks:i,refs:c}=h()?function(e){return q({states:{content:{text:e},redeemStage:"chooseReward",amount:0,selectedStep:void 0,selectedItem:void 0,open:!1,exchangeError:!1,queryError:!1,loading:!1,noExchangeOptions:!1,empty:_t()},data:{shareCode:"SHARECODE123",exchangeList:ce.data.exchangeList},callbacks:{exchangeReward:()=>{},setExchangeState:()=>{},setStage:()=>{},resetState:()=>{},copyFuelTankCode:()=>{}},refs:{canvasRef:{}}},e.demoData||{},{arrayMerge:(e,t)=>t})}(e):function(e){var t,s,r,o,i;const[c,u]=d(((e,t)=>({...e,...t})),{selectedItem:void 0,selectedStep:void 0,redeemStage:"chooseReward",amount:0,exchangeError:!1}),[h,m]=n(!1),{selectedItem:v,selectedStep:b,redeemStage:y,amount:x,exchangeError:w}=c,k=p(),[C,{data:E,loading:I,errors:S}]=g(qt),{data:M,loading:q,refetch:T,errors:_}=f(Mt,{},!(null==k?void 0:k.jwt));a((()=>{var e,t;(null===(t=null===(e=null==E?void 0:E.exchangeReward)||void 0===e?void 0:e.reward)||void 0===t?void 0:t.id)&&u({redeemStage:"success",exchangeError:!1}),S&&u({exchangeError:!0})}),[E,S]);const N=l();a((()=>{if(!N.current)return;const e=N.current;e.confetti=e.confetti||Rt.create(e,{resize:!0}),e.confetti()}),[N.current]);const{refresh:A}=R();return{states:{content:{text:e},selectedItem:v,redeemStage:y,amount:x,selectedStep:b,exchangeError:w,queryError:!!_,loading:q||I,open:h,noExchangeOptions:0===(null===(t=null==M?void 0:M.viewer)||void 0===t?void 0:t.visibleRewardExchangeItems.totalCount)},data:{exchangeList:null===(r=null===(s=null==M?void 0:M.viewer)||void 0===s?void 0:s.visibleRewardExchangeItems)||void 0===r?void 0:r.data,fuelTankCode:null===(i=null===(o=null==E?void 0:E.exchangeReward)||void 0===o?void 0:o.reward)||void 0===i?void 0:i.fuelTankCode},callbacks:{exchangeReward:async function(){if(!v)return;let e={accountId:null==k?void 0:k.accountId,userId:k.id};switch(v.ruleType){case"FIXED_GLOBAL_REWARD":e={...e,redeemCreditInput:{amount:v.sourceValue,unit:v.sourceUnit},globalRewardKey:v.globalRewardKey};break;case"STEPPED_FIXED_GLOBAL_REWARD":e={...e,redeemCreditInput:{amount:b.sourceValue,unit:v.sourceUnit},globalRewardKey:b.globalRewardKey};break;case"VARIABLE_GLOBAL_REWARD":e={...e,redeemCreditInput:{amount:x,unit:v.sourceUnit},globalRewardKey:v.globalRewardKey,rewardInput:b.rewardInput};break;case"VARIABLE_CREDIT_REWARD":e={...e,redeemCreditInput:{amount:x,unit:v.sourceUnit},rewardInput:{type:"CREDIT",unit:v.destinationUnit,assignedCredit:b.destinationValue}};break;default:e={...e,...b.rewardInput}}await C({exchangeRewardInput:e}),A()},setExchangeState:u,setStage:function(e){u({redeemStage:e})},resetState:e=>{e&&T(),u({amount:0,selectedStep:void 0,selectedItem:void 0,exchangeError:!1,redeemStage:"chooseReward"})},copyFuelTankCode:function(){var e,t;navigator.clipboard.writeText(null===(t=null===(e=null==E?void 0:E.exchangeReward)||void 0===e?void 0:e.reward)||void 0===t?void 0:t.fuelTankCode),m(!0),setTimeout((()=>m(!1)),1e3)}},refs:{canvasRef:N}}}(e);return t(s,{style:{display:"contents"}},t(de,{states:r,data:o,callbacks:i,refs:c}))}static get assetsDirs(){return["assets"]}};function _t(){return t("slot",{name:"empty"},t("sqm-empty",{emptyStateImage:"https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_exchange2.png",emptyStateHeader:"Redeem rewards",emptyStateText:"Use your points to redeem rewards once they become available"}))}const Nt=c("sq:useRouter");function At(e,t){if(e)return V(e).exec(t)}const Pt=class{constructor(t){e(this,t),this.ignored=!0,r(this)}disconnectedCallback(){}render(){const{callbacks:e}=function(){const e=M(),t=m(),[s,r]=n(void 0),[o,i]=n(void 0),l=e.pathname;return a((()=>{const e=t.querySelectorAll("sqm-route");Array.from(e).forEach((e=>{const t=document.createElement("template");t.setAttribute("path",e.path),t.innerHTML=e.innerHTML,e.parentNode.appendChild(t),e.parentNode.removeChild(e)}))}),[]),a((()=>{var e,t;if(!o||!s)return void Nt("DOM not ready for navigation rendering on:",l);const r=s.querySelectorAll("template"),a=Array.from(r).find((e=>{var t,s,r;if(null===(r=At(null===(s=null===(t=e.attributes)||void 0===t?void 0:t.path)||void 0===s?void 0:s.nodeValue,l))||void 0===r?void 0:r.length)return e})),n=null===(t=null===(e=null==a?void 0:a.attributes)||void 0===e?void 0:e.path)||void 0===t?void 0:t.nodeValue;if(Nt({containerDatasetPage:o.dataset.page,templatePath:n,page:l}),!a)return Nt("No matching page found for ",l,", so render nothing"),o.innerHTML="",void(o.dataset.page=l);Nt("Page updated to ",l,a),At(n,o.dataset.page)?Nt("don't rerender"):a&&(o.innerHTML=a.innerHTML,o.dataset.page=l)}),[s,o,l]),{callbacks:{setSlot:r,setContainer:i}}}();return t(s,null,t("div",{ref:e.setSlot,style:{display:"none"}},t("slot",null)),t("div",{style:{display:"contents"},ref:e.setContainer}))}};Pt.style="sqm-router{display:contents}";const Dt=class{constructor(t){e(this,t),this.type="default",this.iconslot="prefix",this.hideicon=!1,this.hidetext=!1,this.undefinedLinkText="Error: message link undefined!",this.unsupportedPlatformText="Error: not on a supported device",r(this)}disconnectedCallback(){}render(){const e=P(this),s=h()?function(e){return q({...e,loading:!1,hide:!1,onClick:()=>{}},e.demoData||{},{arrayMerge:(e,t)=>t})}(e):ue(e);return t(he,Object.assign({},s),t("slot",null))}};Dt.style=":host{display:block}:host([hidden]){display:none}sl-button{display:block}";const Lt=A.gql`
|
|
214
|
+
query ($programId: ID) {
|
|
215
|
+
user: viewer {
|
|
216
|
+
... on User {
|
|
217
|
+
referralCode(programId: $programId)
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
`,Vt=A.gql`
|
|
222
|
+
mutation loadEvent($eventMeta: UserAnalyticsEvent!) {
|
|
223
|
+
createUserAnalyticsEvent(eventMeta: $eventMeta)
|
|
224
|
+
}
|
|
225
|
+
`,Ft=class{constructor(t){e(this,t),this.tooltiptext="Copied to Clipboard",this.tooltiplifespan=1e3,this.textAlign="left",this.copyButtonLabel="Copy Code",this.buttonStyle="icon",r(this)}disconnectedCallback(){}render(){const e=P(this),s=h()?function(e){const[t,s]=n(!1),r="SHARECODE001";return q({copyString:r,tooltiptext:e.tooltiptext,textAlign:e.textAlign,copyButtonLabel:e.copyButtonLabel,buttonStyle:e.buttonStyle,rewardStatus:"AVAILABLE",open:t,onClick:()=>{navigator.clipboard.writeText(r),s(!0),setTimeout((()=>s(!1)),e.tooltiplifespan)}},e.demoData||{},{arrayMerge:(e,t)=>t})}(e):function(e){var t,s;const{programId:r=v()}=e,a=p(),o=b(),{data:i}=f(Lt,{programId:r},!(null==a?void 0:a.jwt)),[l]=g(Vt),c=null!==(s=null===(t=null==i?void 0:i.user)||void 0===t?void 0:t.referralCode)&&void 0!==s?s:"...",[d,u]=n(!1);return{...e,onClick:function(){navigator.clipboard.writeText(c),u(!0),setTimeout((()=>u(!1)),e.tooltiplifespan),l({eventMeta:{programId:r,id:null==a?void 0:a.id,accountId:null==a?void 0:a.accountId,type:"USER_REFERRAL_PROGRAM_ENGAGEMENT_EVENT",meta:{engagementMedium:o,shareMedium:"DIRECT"}}})},open:d,copyString:c}}(e);return t(me,Object.assign({},s))}},$t=class{constructor(t){e(this,t),this.tooltiptext="Copied to Clipboard",this.tooltiplifespan=1e3,this.textAlign="left",this.copyButtonLabel="Copy Link",this.buttonStyle="icon",r(this)}disconnectedCallback(){}render(){const e=P(this),s=h()?function(e){const[t,s]=n(!1),r="https://www.example.com/sharelink/abc";return q({copyString:r,tooltiptext:e.tooltiptext,textAlign:e.textAlign,buttonStyle:e.buttonStyle,copyButtonLabel:e.copyButtonLabel,rewardStatus:"AVAILABLE",open:t,onClick:()=>{navigator.clipboard.writeText(r),s(!0),setTimeout((()=>s(!1)),e.tooltiplifespan)}},e.demoData||{},{arrayMerge:(e,t)=>t})}(e):pe(e);return t(me,Object.assign({},s))}},Ot=class{constructor(t){e(this,t),this.ignored=!0,this.space="xxx-large",this.display="grid",r(this)}disconnectedCallback(){}render(){return t(ve,Object.assign({},P(this)),t("slot",null))}},jt=A.gql`
|
|
226
|
+
mutation taskCardEvent($userEventInput: UserEventInput!) {
|
|
227
|
+
logUserEvent(userEventInput: $userEventInput) {
|
|
228
|
+
userId
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
`,Ut=class{constructor(t){e(this,t),this.ignored=!0,this.rewardAmount="0",this.rewardUnit="Points",this.cardTitle="Title Text",this.description="",this.repeatable=!1,this.finite=0,this.showProgressBar=!1,this.goal=1,this.steps=!1,this.progressBarUnit="",this.expiryMessage="Ends {endDate}",this.startsOnMessage="Starts {startDate}",this.endedMessage="Ended {endDate}",this.completedText="Completed {finite, select, 0 {{count, plural, =1 {{count} time} other {{count} times}}} other {{count}/{finite} times}}",this.buttonText="Complete Action",this.openNewTab=!1,this.hideButton=!1,r(this)}disconnectedCallback(){}render(){const{props:e}=h()?B(this):z({...P(this),programId:this.programId}),{value:s,loading:r}=e,{states:n,callbacks:o}=h()?function(e){return q({states:{loadingEvent:!1,locale:"en"},callbacks:{sendEvent:e=>console.log(e),onClick:()=>console.log("clicked")}},e.demoData||{},{arrayMerge:(e,t)=>t})}(this):function(e){const t=p(),s=y(),[r,{data:n,loading:o}]=g(jt),{refresh:i}=R();function l(){e.openNewTab?window.open(e.buttonLink):window.open(e.buttonLink,"_parent")}function c(e){r({userEventInput:{userId:null==t?void 0:t.id,accountId:null==t?void 0:t.accountId,events:[{key:e,fields:{}}]}})}return a((()=>{n&&(i(),l())}),[n]),{states:{loadingEvent:o,locale:s},callbacks:{sendEvent:c,onClick:function(){e.eventKey?c(e.eventKey):l()}}}}(this);return t(ge,{callbacks:o,states:{loading:r,loadingEvent:n.loadingEvent,progress:s,locale:n.locale},content:{...P(this)}})}},Bt=class{constructor(t){e(this,t),this.ignored=!0,this.icon="gift",r(this)}disconnectedCallback(){}render(){return N().forEach((e=>{try{e.setIcon(this.icon)}catch{}})),t("div",null,t("style",{type:"text/css"},"\n\t\t:host{\n\t\t\tdisplay: block; \n\t\t}\n\n\t\t::slotted(*:not(:only-child):not(:last-child)) {\n\t\t\tmargin-bottom: var(--sl-spacing-xx-large);\n\t\t}\n\t"),t("slot",null))}},zt=()=>t("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M22.5 7.5H18.6761H13.5V24H20.75C21.3023 24 21.75 23.5523 21.75 23V22.5V13.5H22.5H23C23.5523 13.5 24 13.0523 24 12.5V12V9V8.5C24 7.94772 23.5523 7.5 23 7.5H22.5Z",fill:"#F2C94C"}),t("path",{d:"M2.25 22.5V23C2.25 23.5523 2.69772 24 3.25 24H10.5V7.5H6.96363H1.5H1C0.447715 7.5 0 7.94772 0 8.5V9V12V12.5C0 13.0523 0.447715 13.5 1 13.5H1.5H2.25V22.5Z",fill:"#F2C94C"}),t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.25 13.5V15H21.75V13.5H2.25Z",fill:"#BE9720"}),t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M21 4.06424C21 5.39348 19.0041 7.4062 18 7.5H13.5V24H10.5027V7.5H6.88188C4.8187 7.05273 3 5.46806 3 3.78109C3 2.1371 3.71404 0.835051 5.01276 0.273062C6.25382 -0.26398 7.68678 0.0304991 8.81964 0.817C10.2101 1.78237 10.9902 3.59446 11.6978 5.2384C11.7599 5.38268 11.8215 5.52566 11.8828 5.66667C11.9426 5.53298 12.0028 5.3969 12.0638 5.25912C12.7649 3.67422 13.5654 1.86488 14.9106 0.893444C16.0997 0.0347157 17.6114 -0.289736 18.9181 0.298417C20.2693 0.906596 21 2.3018 21 4.06424ZM15.9185 2.25C16.6392 1.72957 17.502 1.63518 18.2396 2.25C18.8819 2.78542 18.9162 3.03745 18.9987 3.64389L19.0133 3.75C19.0133 4.64776 18.2396 6 17.4659 6C16.9177 6 16.4871 5.99537 16.0836 5.99103C15.3479 5.98312 14.702 5.97618 13.5974 6C13.808 5.59179 13.9761 5.20003 14.1365 4.82641C14.5654 3.82715 14.9386 2.95763 15.9185 2.25ZM7.40792 2.25C7.05911 2.00783 6.25921 2.11591 5.92748 2.25945C5.65341 2.37805 5.24403 2.73987 5.24403 3.78109C5.24403 4.79286 6.88188 5.66667 6.88188 5.66667C6.88188 5.66667 8.18161 6 10.5027 6C9.71258 4.04177 8.59336 3.073 7.40792 2.25Z",fill:"#EB5757"})),Ht=()=>t("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor",stroke:"currentColor","stroke-width":"2"})),Wt=T({TimelineReward:{color:"var(--sl-color-neutral-900)",lineHeight:"var(--sl-line-height-dense)","& .container":{display:"flex"},"& .line":{display:"none",color:"transparent",userSelect:"none",background:"var(--sl-color-primary-300)",width:"4px",borderRadius:"4px",margin:"-2px",position:"relative",left:"12px",top:"34px"},"& .step":{display:"flex"},"& .icon":{position:"relative",top:"4px",zIndex:"1",color:"var(--sl-color-primary-300)",marginRight:"var(--sl-spacing-large)"},"& .reward":{marginRight:"var(--sl-spacing-x-small)",fontSize:"var(--sl-font-size-x-large)",fontWeight:"var(--sl-font-weight-semibold)"},"& .unit":{textTransform:"uppercase",fontSize:"var(--sl-font-size-small)"},"& .description":{fontSize:"var(--sl-font-size-medium)"}}}),Gt=Wt.toString();function Zt(e){var s;const r=null!==(s=e.icon)&&void 0!==s?s:e.iconState;return t("div",{class:Wt.classes.TimelineReward,part:"sqm-base"},t("style",{type:"text/css"},Gt,"\n\t:host{\n\t\tdisplay: block; \n\t}\n\n\t:host(:not(:last-of-type)) .line {\n\t\tdisplay: block; \n\t}\n\t"),t("div",{class:"container",part:"sqm-entry-container"},t("div",{class:"line"},"/"),t("div",{class:"step"},"gift"===r&&t("div",{class:"icon"},t(zt,null)),"circle"===r&&t("div",{class:"icon"},t(Ht,null)),t("div",null,t("div",null,t("span",{class:"reward",part:"sqm-reward"},e.reward),t("span",{class:"unit",part:"sqm-unit"},e.unit)),t("div",{class:"description",part:"sqm-description"},e.desc)))))}const Kt=class{constructor(t){e(this,t),this.ignored=!0,this.iconState="gift",r(this)}async setIcon(e){this.iconState=e}disconnectedCallback(){}render(){return _([this.reward]),t(Zt,Object.assign({},P(this)))}};function Yt(e){return t(s,null,e.loading?e.loadingText:e.username)}const Xt=A.gql`
|
|
232
|
+
query getUserName {
|
|
233
|
+
viewer {
|
|
234
|
+
... on User {
|
|
235
|
+
firstName
|
|
236
|
+
lastName
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
`,Qt=class{constructor(t){e(this,t),this.ignored=!0,this.fallback="Anonymous User",this.loadingText="...",r(this)}disconnectedCallback(){}render(){const e=h()?function(e){return q({loading:!1,loadingText:"...",username:"John Smith"},e.demoData||{},{arrayMerge:(e,t)=>t})}(this):function(e){var t,s,r,a,n,o,i,l;const c=p(),d=f(Xt,{},!(null==c?void 0:c.jwt)),u=(null===(s=null===(t=d.data)||void 0===t?void 0:t.viewer)||void 0===s?void 0:s.firstName)||(null===(a=null===(r=d.data)||void 0===r?void 0:r.viewer)||void 0===a?void 0:a.lastName)?`${null===(o=null===(n=d.data)||void 0===n?void 0:n.viewer)||void 0===o?void 0:o.firstName} ${null===(l=null===(i=d.data)||void 0===i?void 0:i.viewer)||void 0===l?void 0:l.lastName}`:e.fallback;return{loadingText:e.loadingText,loading:d.loading,username:u}}(this);return t(Yt,Object.assign({},e))}};export{fe as sqm_big_stat,be as sqm_brand,ye as sqm_card_feed,Ce as sqm_checkbox_field,Se as sqm_coupon_code,Me as sqm_divided_layout,qe as sqm_dropdown_field,Ae as sqm_edit_profile,Pe as sqm_hero,Le as sqm_hero_image,Ve as sqm_hook_story_container,$e as sqm_image,Oe as sqm_input_field,He as sqm_leaderboard,Ye as sqm_link_button,Xe as sqm_name_fields,Je as sqm_navigation_menu,rt as sqm_payout_button_scroll,lt as sqm_payout_status_alert,ct as sqm_portal_change_password,dt as sqm_portal_footer,ut as sqm_portal_frame,ht as sqm_portal_login,mt as sqm_portal_register,vt as sqm_program_explainer,ft as sqm_program_explainer_step,yt as sqm_program_menu,Ct as sqm_referral_card,It as sqm_referral_iframe,Tt as sqm_reward_exchange_list,Pt as sqm_router,Dt as sqm_share_button,Ft as sqm_share_code,$t as sqm_share_link,Ot as sqm_stat_container,Ut as sqm_task_card,Bt as sqm_timeline,Kt as sqm_timeline_entry,Qt as sqm_user_name}
|