@foxy.io/elements 1.22.0-beta.5 → 1.22.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import"./foxy-customer.js";import"./shared-c0ec65fa.js";import"./shared-668947de.js";import"./shared-24a762c1.js";import"./shared-0479553e.js";import"./foxy-access-recovery-form.js";import"./foxy-payment-method-card.js";import"./foxy-transactions-table.js";import"./foxy-subscription-card.js";import"./foxy-subscription-form.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import"./foxy-sign-in-form.js";import"./foxy-form-dialog.js";import"./foxy-spinner.js";import{_ as e,B as t,am as s}from"./shared-98755831.js";import{h as r,L as o,c as i}from"./shared-7f33a83a.js";import{A as n}from"./shared-daf52401.js";import"./shared-b5517c1b.js";import{C as a}from"./shared-bd819b5b.js";import{a as l,T as d,R as c}from"./shared-e9c81269.js";import{A as m}from"./shared-509a2f52.js";import{I as h}from"./shared-a8cf402a.js";import{c as u}from"./shared-4e709717.js";import{C as p}from"./shared-de790de9.js";import{N as f}from"./shared-eb900735.js";import{i as g}from"./shared-d3bf9ac0.js";import"./shared-533c3914.js";import"./foxy-attribute-card.js";import"./shared-b137f17a.js";import"./shared-64657919.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./foxy-attribute-form.js";import"./shared-3b8b5eda.js";import"./shared-9e8bff76.js";import"./shared-57c6cfd1.js";import"./shared-b2474263.js";import"./shared-15c94a90.js";import"./shared-bc36bc72.js";import"./shared-950875f2.js";import"./shared-014f1513.js";import"./shared-c5106979.js";import"./shared-1f4b9c6b.js";import"./shared-f8e3be56.js";import"./shared-178f7222.js";import"./shared-5425e3d3.js";import"./shared-11c2efc8.js";import"./shared-9725c399.js";import"./shared-03858aee.js";import"./shared-e2f4962c.js";import"./shared-9271a609.js";import"./foxy-customer-form.js";import"./foxy-nucleon-element.js";import"./shared-b738ee96.js";import"./foxy-address-card.js";import"./shared-c2ec3291.js";import"./foxy-address-form.js";import"./foxy-table.js";import"./shared-82f873bd.js";import"./shared-3b9b9427.js";import"./shared-c0816371.js";import"./shared-99065f2a.js";import"./shared-6f4005e5.js";import"./shared-38ed7905.js";import"./shared-963c4a87.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-06c64816.js";import"./shared-bcc4cf7f.js";import"./foxy-cancellation-form.js";import"./shared-1a9496d4.js";import"./shared-bc7f58ef.js";import"./foxy-transaction-card.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-cb34d19f.js";import"./shared-9e04b9c3.js";import"./shared-d519a301.js";import"./shared-fcce5337.js";import"./shared-5fbda766.js";import"./shared-4ac2a677.js";let $,y,b=e=>e;class v extends(l(d(a),"customer-portal")){constructor(){super(...arguments),this.group=""}static get properties(){return e(e({},super.properties),{},{group:{type:String}})}render(){return this.api.storage.getItem(n.SESSION)?r($||($=b` <foxy-internal-customer-portal-logged-in-view disabledcontrols="${0}" readonlycontrols="${0}" hiddencontrols="${0}" customer="${0}" group="${0}" class="h-full" lang="${0}" href="${0}" ns="${0}" .templates="${0}"> </foxy-internal-customer-portal-logged-in-view> `),this.disabledSelector.toString(),this.readonlySelector.toString(),this.hiddenSelector.toString(),this.base,this.group,this.lang,new URL("./customer_portal_settings",this.base).toString(),this.ns,this.templates):r(y||(y=b` <foxy-internal-customer-portal-logged-out-view disabledcontrols="${0}" readonlycontrols="${0}" hiddencontrols="${0}" group="${0}" class="h-full" lang="${0}" ns="${0}" .templates="${0}"> </foxy-internal-customer-portal-logged-out-view> `),this.disabledSelector.toString(),this.readonlySelector.toString(),this.hiddenSelector.toString(),this.group,this.lang,this.ns,this.templates)}}let S,x,_=e=>e;const j=c(d(l(h(o))));let w,T,O,k,E=e=>e;class R extends(d(o)){constructor(){super(...arguments),this.disabled=!1,this.href="",this.icon=""}static get properties(){return e(e({},super.properties),{},{disabled:{type:Boolean},href:{type:String},icon:{type:String}})}render(){const e=u({"flex-auto font-medium tracking-wide text-s rounded-s transition-colors":!0,"hover-text-primary hover-cursor-pointer":!this.disabled,"focus-outline-none focus-ring-2 ring-primary-50 ring-offset-2":!this.disabled,"text-disabled cursor-default":this.disabled}),t=r(w||(w=E` ${0} <slot></slot> `),this.icon?r(T||(T=E`<iron-icon icon="${0}" class="icon-inline"></iron-icon>`),this.icon):"");return this.disabled?r(O||(O=E`<button class="${0}" disabled="disabled">${0}</button>`),e,t):r(k||(k=E` <a class="${0}" href="${0}" rel="nofollow noopener">${0}</a> `),e,this.href,t)}}let z,N,A,F,I,H,U,q,L,P,C=e=>e;const D=d(p(l(f)));let V,B,J,W,G,K,M,Q,X,Y,Z=e=>e;const ee=d(p(l(h(o))));const te=["html"],se=["html"];let re,oe,ie,ne,ae,le,de,ce,me,he,ue,pe,fe=e=>e;const ge=l(p(d(h(o))));let $e,ye,be,ve=e=>e;const Se=p(d(l(h(o),"customer-portal")));customElements.define("foxy-internal-customer-portal-logged-in-view",class extends D{constructor(){var e;super(...arguments),e=this,this.templates={},this.customer="",this.loggingOutState="idle",this.loggingOutStateResetTimeout=null,this.__renderHeaderActionsSignOut=()=>{var t,s,o,i,n;const a="customer:header:actions:sign-out",l=this.loggingOutState,d=this.disabledSelector.matches(a)||!(null===(t=this.__customerElement)||void 0===t?void 0:t.in({idle:"snapshot"}))||"idle"!==l,c={"border-radius":"100%",padding:"var(--lumo-space-xs)",display:"flex",margin:"0",cursor:d?"default":"pointer"};return r(z||(z=C` <div style="display:flex;margin-left:var(--lumo-space-m)"> ${0} <vaadin-button data-testid="sign-out" aria-label="${0}" style="${0}" theme="icon" ?disabled="${0}" @click="${0}"> ${0} </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${a}:before`),this.t("sign_out").toString(),Object.entries(c).reduce(((e,[t,s])=>`${e}${t}:${s};`),""),d,(async function(){try{e.loggingOutState="busy",await new m(e).fetch("foxy://customer-api/session",{method:"DELETE"}),e.loggingOutState="idle"}catch(t){e.loggingOutState="fail",e.loggingOutStateResetTimeout=setTimeout((()=>{e.loggingOutState="idle",e.loggingOutStateResetTimeout=null}),1e3)}}),"idle"===l?r(N||(N=C`<iron-icon icon="icons:exit-to-app"></iron-icon>`)):r(A||(A=C` <foxy-spinner layout="no-label" state="${0}" style="margin:auto" lang="${0}" ns="${0}"> </foxy-spinner> `),"fail"===l?"error":"busy",this.lang,[this.ns,null!==(o=null===(s=customElements.get("foxy-customer"))||void 0===s?void 0:s.defaultNS)&&void 0!==o?o:"",null!==(n=null===(i=customElements.get("foxy-spinner"))||void 0===i?void 0:i.defaultNS)&&void 0!==n?n:""].join(" ")),this.renderTemplateOrSlot(`${a}:after`))},this.__renderSubscriptions=(e,t)=>{const s="customer:subscriptions";return e(F||(F=C`
1
+ import"./foxy-customer.js";import"./shared-c0ec65fa.js";import"./shared-668947de.js";import"./shared-24a762c1.js";import"./shared-0479553e.js";import"./foxy-access-recovery-form.js";import"./foxy-payment-method-card.js";import{TransactionsTable as e}from"./foxy-transactions-table.js";import"./foxy-subscription-card.js";import"./foxy-subscription-form.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import"./foxy-sign-in-form.js";import"./foxy-form-dialog.js";import"./foxy-spinner.js";import{_ as t,B as s,am as r}from"./shared-98755831.js";import{h as o,L as i,c as n}from"./shared-7f33a83a.js";import{A as a}from"./shared-daf52401.js";import"./shared-b5517c1b.js";import{C as l}from"./shared-bd819b5b.js";import{a as d,T as c,R as m}from"./shared-e9c81269.js";import{A as h}from"./shared-509a2f52.js";import{I as u}from"./shared-a8cf402a.js";import{c as p}from"./shared-4e709717.js";import{C as f}from"./shared-de790de9.js";import{N as g}from"./shared-eb900735.js";import{i as $}from"./shared-d3bf9ac0.js";import"./shared-533c3914.js";import"./foxy-attribute-card.js";import"./shared-b137f17a.js";import"./shared-64657919.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./foxy-attribute-form.js";import"./shared-3b8b5eda.js";import"./shared-9e8bff76.js";import"./shared-57c6cfd1.js";import"./shared-b2474263.js";import"./shared-15c94a90.js";import"./shared-bc36bc72.js";import"./shared-950875f2.js";import"./shared-014f1513.js";import"./shared-c5106979.js";import"./shared-1f4b9c6b.js";import"./shared-f8e3be56.js";import"./shared-178f7222.js";import"./shared-5425e3d3.js";import"./shared-11c2efc8.js";import"./shared-9725c399.js";import"./shared-03858aee.js";import"./shared-e2f4962c.js";import"./shared-9271a609.js";import"./foxy-customer-form.js";import"./foxy-nucleon-element.js";import"./shared-b738ee96.js";import"./foxy-address-card.js";import"./shared-c2ec3291.js";import"./foxy-address-form.js";import"./foxy-table.js";import"./shared-82f873bd.js";import"./shared-3b9b9427.js";import"./shared-c0816371.js";import"./shared-99065f2a.js";import"./shared-6f4005e5.js";import"./shared-38ed7905.js";import"./shared-963c4a87.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-06c64816.js";import"./shared-bcc4cf7f.js";import"./foxy-cancellation-form.js";import"./shared-1a9496d4.js";import"./shared-bc7f58ef.js";import"./foxy-transaction-card.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-cb34d19f.js";import"./shared-9e04b9c3.js";import"./shared-d519a301.js";import"./shared-fcce5337.js";import"./shared-5fbda766.js";import"./shared-4ac2a677.js";let y,b,v=e=>e;class S extends(d(c(l),"customer-portal")){constructor(){super(...arguments),this.transactionsTableColumns=[e.priceColumn,e.summaryColumn,e.statusColumn,e.idColumn,e.dateColumn,e.receiptColumn],this.group=""}static get properties(){return t(t({},super.properties),{},{transactionsTableColumns:{attribute:!1},group:{type:String}})}render(){return this.api.storage.getItem(a.SESSION)?o(y||(y=v` <foxy-internal-customer-portal-logged-in-view disabledcontrols="${0}" readonlycontrols="${0}" hiddencontrols="${0}" customer="${0}" group="${0}" class="h-full" lang="${0}" href="${0}" ns="${0}" .transactionsTableColumns="${0}" .templates="${0}"> </foxy-internal-customer-portal-logged-in-view> `),this.disabledSelector.toString(),this.readonlySelector.toString(),this.hiddenSelector.toString(),this.base,this.group,this.lang,new URL("./customer_portal_settings",this.base).toString(),this.ns,this.transactionsTableColumns,this.templates):o(b||(b=v` <foxy-internal-customer-portal-logged-out-view disabledcontrols="${0}" readonlycontrols="${0}" hiddencontrols="${0}" group="${0}" class="h-full" lang="${0}" ns="${0}" .templates="${0}"> </foxy-internal-customer-portal-logged-out-view> `),this.disabledSelector.toString(),this.readonlySelector.toString(),this.hiddenSelector.toString(),this.group,this.lang,this.ns,this.templates)}}let x,_,j=e=>e;const T=m(c(d(u(i))));let w,O,k,E,R=e=>e;class z extends(c(i)){constructor(){super(...arguments),this.disabled=!1,this.href="",this.icon=""}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},href:{type:String},icon:{type:String}})}render(){const e=p({"flex-auto font-medium tracking-wide text-s rounded-s transition-colors":!0,"hover-text-primary hover-cursor-pointer":!this.disabled,"focus-outline-none focus-ring-2 ring-primary-50 ring-offset-2":!this.disabled,"text-disabled cursor-default":this.disabled}),t=o(w||(w=R` ${0} <slot></slot> `),this.icon?o(O||(O=R`<iron-icon icon="${0}" class="icon-inline"></iron-icon>`),this.icon):"");return this.disabled?o(k||(k=R`<button class="${0}" disabled="disabled">${0}</button>`),e,t):o(E||(E=R` <a class="${0}" href="${0}" rel="nofollow noopener">${0}</a> `),e,this.href,t)}}let N,A,F,C,I,H,U,q,L,P,D=e=>e;const V=c(f(d(g)));let B,J,W,G,K,M,Q,X,Y,Z,ee=e=>e;const te=c(f(d(u(i))));const se=["html"],re=["html"];let oe,ie,ne,ae,le,de,ce,me,he,ue,pe,fe,ge=e=>e;const $e=d(f(c(u(i))));let ye,be,ve,Se=e=>e;const xe=f(c(d(u(i),"customer-portal")));customElements.define("foxy-internal-customer-portal-logged-in-view",class extends V{constructor(){var e;super(...arguments),e=this,this.templates={},this.customer="",this.loggingOutState="idle",this.transactionsTableColumns=[],this.loggingOutStateResetTimeout=null,this.__renderHeaderActionsSignOut=()=>{var t,s,r,i,n;const a="customer:header:actions:sign-out",l=this.loggingOutState,d=this.disabledSelector.matches(a)||!(null===(t=this.__customerElement)||void 0===t?void 0:t.in({idle:"snapshot"}))||"idle"!==l,c={"border-radius":"100%",padding:"var(--lumo-space-xs)",display:"flex",margin:"0",cursor:d?"default":"pointer"};return o(N||(N=D` <div style="display:flex;margin-left:var(--lumo-space-m)"> ${0} <vaadin-button data-testid="sign-out" aria-label="${0}" style="${0}" theme="icon" ?disabled="${0}" @click="${0}"> ${0} </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${a}:before`),this.t("sign_out").toString(),Object.entries(c).reduce(((e,[t,s])=>`${e}${t}:${s};`),""),d,(async function(){try{e.loggingOutState="busy",await new h(e).fetch("foxy://customer-api/session",{method:"DELETE"}),e.loggingOutState="idle"}catch(t){e.loggingOutState="fail",e.loggingOutStateResetTimeout=setTimeout((()=>{e.loggingOutState="idle",e.loggingOutStateResetTimeout=null}),1e3)}}),"idle"===l?o(A||(A=D`<iron-icon icon="icons:exit-to-app"></iron-icon>`)):o(F||(F=D` <foxy-spinner layout="no-label" state="${0}" style="margin:auto" lang="${0}" ns="${0}"> </foxy-spinner> `),"fail"===l?"error":"busy",this.lang,[this.ns,null!==(r=null===(s=customElements.get("foxy-customer"))||void 0===s?void 0:s.defaultNS)&&void 0!==r?r:"",null!==(n=null===(i=customElements.get("foxy-spinner"))||void 0===i?void 0:i.defaultNS)&&void 0!==n?n:""].join(" ")),this.renderTemplateOrSlot(`${a}:after`))},this.__renderSubscriptions=(e,t)=>{const s="customer:subscriptions";return e(C||(C=D`
2
2
  ${0}
3
3
 
4
4
  <foxy-internal-customer-portal-subscriptions
@@ -15,7 +15,7 @@ import"./foxy-customer.js";import"./shared-c0ec65fa.js";import"./shared-668947de
15
15
  </foxy-internal-customer-portal-subscriptions>
16
16
 
17
17
  ${0}
18
- `),this.renderTemplateOrSlot(`${s}:before`),this.readonlySelector.zoom(s).toString(),this.disabledSelector.zoom(s).toString(),this.hiddenSelector.zoom(s).toString(),t.group,t.lang,t.ns,this.getNestedTemplates(s),this.data,t.data,this.renderTemplateOrSlot(`${s}:after`))},this.__renderTransactions=(e,t)=>{const s="customer:transactions";return e(I||(I=C`
18
+ `),this.renderTemplateOrSlot(`${s}:before`),this.readonlySelector.zoom(s).toString(),this.disabledSelector.zoom(s).toString(),this.hiddenSelector.zoom(s).toString(),t.group,t.lang,t.ns,this.getNestedTemplates(s),this.data,t.data,this.renderTemplateOrSlot(`${s}:after`))},this.__renderTransactions=(e,t)=>{const s="customer:transactions";return e(I||(I=D`
19
19
  ${0}
20
20
 
21
21
  <foxy-internal-customer-portal-transactions
@@ -27,16 +27,17 @@ import"./foxy-customer.js";import"./shared-c0ec65fa.js";import"./shared-668947de
27
27
  ns=${0}
28
28
  .templates=${0}
29
29
  .customer=${0}
30
+ .columns=${0}
30
31
  >
31
32
  </foxy-internal-customer-portal-transactions>
32
33
 
33
34
  ${0}
34
- `),this.renderTemplateOrSlot(`${s}:before`),this.readonlySelector.zoom(s).toString(),this.disabledSelector.zoom(s).toString(),this.hiddenSelector.zoom(s).toString(),t.group,t.lang,t.ns,this.getNestedTemplates(s),t.data,this.renderTemplateOrSlot(`${s}:after`))}}static get properties(){return e(e({},super.properties),{},{customer:{type:String},loggingOutState:{attribute:!1},loggingOutStateResetTimeout:{attribute:!1}})}render(){var e,s;const o=this.hiddenSelector.zoom("customer"),i=new t(["attributes","transactions","subscriptions","addresses:actions:create","header:actions:edit:form:delete",o.toString()].join(" ")).toString(),n=this.getNestedTemplates("customer"),a=n["header:actions:after"],l=n["header:actions:edit:form:timestamps:after"],d=n.default;return n["header:actions:after"]=(e,t)=>{const s=o.matches("header:actions:sign-out",!0);return e(H||(H=C`
35
+ `),this.renderTemplateOrSlot(`${s}:before`),this.readonlySelector.zoom(s).toString(),this.disabledSelector.zoom(s).toString(),this.hiddenSelector.zoom(s).toString(),t.group,t.lang,t.ns,this.getNestedTemplates(s),t.data,this.transactionsTableColumns,this.renderTemplateOrSlot(`${s}:after`))}}static get properties(){return t(t({},super.properties),{},{customer:{type:String},loggingOutState:{attribute:!1},transactionsTableColumns:{attribute:!1},loggingOutStateResetTimeout:{attribute:!1}})}render(){var e,t;const r=this.hiddenSelector.zoom("customer"),i=new s(["attributes","transactions","subscriptions","addresses:actions:create","header:actions:edit:form:delete",r.toString()].join(" ")).toString(),n=this.getNestedTemplates("customer"),a=n["header:actions:after"],l=n["header:actions:edit:form:timestamps:after"],d=n.default;return n["header:actions:after"]=(e,t)=>{const s=r.matches("header:actions:sign-out",!0);return e(H||(H=D`
35
36
  <div style="display:flex">
36
37
  ${0}
37
38
  ${0}
38
39
  </div>
39
- `),s?"":this.__renderHeaderActionsSignOut(),null==a?void 0:a(e,t))},n.default=(e,t)=>{const s=this.__renderSubscriptions,r=this.__renderTransactions;return e(U||(U=C`
40
+ `),s?"":this.__renderHeaderActionsSignOut(),null==a?void 0:a(e,t))},n.default=(e,t)=>{const s=this.__renderSubscriptions,o=this.__renderTransactions;return e(U||(U=D`
40
41
  <style>
41
42
  .space-y-m > :not([hidden]) ~ :not([hidden]) {
42
43
  --tw-space-y-reverse: 0;
@@ -51,10 +52,10 @@ import"./foxy-customer.js";import"./shared-c0ec65fa.js";import"./shared-668947de
51
52
  ${0}
52
53
  ${0}
53
54
  </div>
54
- `),o.matches("default",!0)?"":null==d?void 0:d(e,t),o.matches("subscriptions",!0)?"":s(e,t),o.matches("transactions",!0)?"":r(e,t))},n["header:actions:edit:form:timestamps:after"]=(e,t)=>{var s,r;const o="change-password";return e(q||(q=C`
55
+ `),r.matches("default",!0)?"":null==d?void 0:d(e,t),r.matches("subscriptions",!0)?"":s(e,t),r.matches("transactions",!0)?"":o(e,t))},n["header:actions:edit:form:timestamps:after"]=(e,t)=>{var s,r;const o="change-password";return e(q||(q=D`
55
56
  ${0}
56
57
  ${0}
57
- `),null==l?void 0:l(e,t),t.hiddenSelector.matches(o,!0)?"":e(L||(L=C`
58
+ `),null==l?void 0:l(e,t),t.hiddenSelector.matches(o,!0)?"":e(L||(L=D`
58
59
  ${0}
59
60
 
60
61
  <foxy-internal-customer-portal-change-password
@@ -69,7 +70,7 @@ import"./foxy-customer.js";import"./shared-c0ec65fa.js";import"./shared-668947de
69
70
  </foxy-internal-customer-portal-change-password>
70
71
 
71
72
  ${0}
72
- `),t.renderTemplateOrSlot(`${o}:before`),t.href,null!==(r=null===(s=t.data)||void 0===s?void 0:s.email)&&void 0!==r?r:"",t.lang,t.ns,t.in("busy")||t.disabledSelector.matches(o,!0),t.renderTemplateOrSlot(`${o}:after`)))},r(P||(P=C` <foxy-customer readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="customer" group="${0}" href="${0}" lang="${0}" ns="${0} ${0}" id="customer" .templates="${0}" @update="${0}"> </foxy-customer> `),this.readonlySelector.zoom("customer").toString(),this.disabledSelector.zoom("customer").toString(),i,this.group,this.customer,this.lang,this.ns,null!==(s=null===(e=customElements.get("foxy-customer"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"",n,(()=>this.requestUpdate()))}disconnectedCallback(){super.disconnectedCallback(),this.loggingOutStateResetTimeout&&clearTimeout(this.loggingOutStateResetTimeout)}get __customerElement(){return this.renderRoot.querySelector("#customer")}}),customElements.define("foxy-internal-customer-portal-logged-out-view",class extends ee{constructor(){super(...arguments),this.group="",this.page="sign-in",this.__renderAccessRecoveryHeader=()=>{var e,t,s,o;const{lang:i,ns:n}=this,a=this.renderRoot.querySelector("#access-recovery-form"),l=!!(null==a?void 0:a.in("busy"));return r(V||(V=Z` <div class="flex flex-col leading-m font-lumo" data-testid="access-recovery:header"> ${0} <foxy-i18n class="text-xxl font-medium ${0}" lang="${0}" key="recover_access" ns="${0} ${0}"> </foxy-i18n> <foxy-i18n class="text-l ${0}" lang="${0}" key="recover_access_hint" ns="${0} ${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("access-recovery:header:before"),l?"text-disabled":"text-body",i,n,null!==(t=null===(e=customElements.get("foxy-access-recovery-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",l?"text-disabled":"text-secondary",i,n,null!==(o=null===(s=customElements.get("foxy-access-recovery-form"))||void 0===s?void 0:s.defaultNS)&&void 0!==o?o:"",this.renderTemplateOrSlot("access-recovery:header:after"))},this.__renderAccessRecoveryBack=()=>{var e,t;const s=this.renderRoot.querySelector("#access-recovery-form"),o=this.disabledSelector.zoom("access-recovery");return r(B||(B=Z` <div> ${0} <vaadin-button data-testid="access-recovery:back" class="w-full" theme="tertiary" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="back" ns="${0} ${0}"> </foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("access-recovery:back:before"),!!(null==s?void 0:s.in("busy"))||o.matches("back",!0),(()=>this.page="sign-in"),this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-access-recovery-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",this.renderTemplateOrSlot("access-recovery:back:after"))},this.__renderAccessRecoveryForm=()=>{var e,t;const s="access-recovery:form",o=this.hiddenSelector.zoom(s);return r(J||(J=Z` <div> ${0} <foxy-access-recovery-form readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="access-recovery:form" parent="foxy://customer-api/recover" group="${0}" lang="${0}" ns="${0} ${0}" id="access-recovery-form" .templates="${0}" @update="${0}"> </foxy-access-recovery-form> ${0} </div> `),this.renderTemplateOrSlot(`${s}:before`),this.readonlySelector.zoom(s).toString(),this.disabledSelector.zoom(s).toString(),o.toString(),this.group,this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-access-recovery-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",this.getNestedTemplates(s),(()=>this.requestUpdate()),this.renderTemplateOrSlot(`${s}:after`))},this.__renderAccessRecovery=()=>{const e="access-recovery",t=this.hiddenSelector.zoom(e);return r(W||(W=Z` <div class="h-full flex" data-testid="access-recovery"> <div class="m-auto max-w-20rem flex-1"> ${0} <div class="space-y-l"> ${0} <div class="space-y-s"> ${0} ${0} </div> </div> ${0} </div> </div> `),this.renderTemplateOrSlot(`${e}:before`),t.matches("header",!0)?"":this.__renderAccessRecoveryHeader(),t.matches("form",!0)?"":this.__renderAccessRecoveryForm(),t.matches("back",!0)?"":this.__renderAccessRecoveryBack(),this.renderTemplateOrSlot(`${e}:after`))},this.__renderSignInHeader=()=>{var e,t,s,o;const{lang:i,ns:n}=this,a=this.renderRoot.querySelector("#sign-in-form"),l=!!(null==a?void 0:a.in("busy"));return r(G||(G=Z` <div class="flex flex-col leading-m font-lumo" data-testid="sign-in:header"> ${0} <foxy-i18n class="text-xxl font-medium ${0}" lang="${0}" key="sign_in" ns="${0} ${0}"> </foxy-i18n> <foxy-i18n class="text-l ${0}" lang="${0}" key="sign_in_hint" ns="${0} ${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("sign-in:header:before"),l?"text-disabled":"text-body",i,n,null!==(t=null===(e=customElements.get("foxy-sign-in-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",l?"text-disabled":"text-secondary",i,n,null!==(o=null===(s=customElements.get("foxy-sign-in-form"))||void 0===s?void 0:s.defaultNS)&&void 0!==o?o:"",this.renderTemplateOrSlot("sign-in:header:after"))},this.__renderSignInRecover=()=>{var e,t;const s=this.renderRoot.querySelector("#sign-in-form"),o=this.disabledSelector.zoom("sign-in");return r(K||(K=Z` <div> ${0} <vaadin-button data-testid="sign-in:recover" class="w-full" theme="tertiary" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="recover_access" ns="${0} ${0}"> </foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("sign-in:recover:before"),!!(null==s?void 0:s.in("busy"))||o.matches("recover",!0),(()=>this.page="access-recovery"),this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-sign-in-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",this.renderTemplateOrSlot("sign-in:recover:after"))},this.__renderSignInForm=()=>{var e,t;const s="sign-in:form",o=this.hiddenSelector.zoom(s);return r(M||(M=Z` <div> ${0} <foxy-sign-in-form readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="sign-in:form" parent="foxy://customer-api/session" group="${0}" lang="${0}" id="sign-in-form" ns="${0} ${0}" .templates="${0}" @update="${0}"> </foxy-sign-in-form> ${0} </div> `),this.renderTemplateOrSlot(`${s}:before`),this.readonlySelector.zoom(s).toString(),this.disabledSelector.zoom(s).toString(),o.toString(),this.group,this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-sign-in-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",this.getNestedTemplates("sign-in:form"),(()=>this.requestUpdate()),this.renderTemplateOrSlot(`${s}:after`))},this.__renderSignIn=()=>{const e="sign-in",t=this.hiddenSelector.zoom(e);return r(Q||(Q=Z` <div class="h-full flex" data-testid="sign-in"> <div class="m-auto max-w-20rem flex-1"> ${0} <div class="space-y-l"> ${0} <div class="space-y-s"> ${0} ${0} </div> </div> ${0} </div> </div> `),this.renderTemplateOrSlot("sign-in:before"),t.matches("header",!0)?"":this.__renderSignInHeader(),t.matches("form",!0)?"":this.__renderSignInForm(),t.matches("recover",!0)?"":this.__renderSignInRecover(),this.renderTemplateOrSlot("sign-in:after"))}}static get properties(){return e(e({},super.properties),{},{group:{type:String},page:{type:String}})}static get styles(){return[super.styles,i(X||(X=Z`.max-w-20rem{max-width:20rem}`))]}render(){const{page:e,hiddenSelector:t}=this;return"access-recovery"!==e||t.matches("access-recovery",!0)?"sign-in"!==e||t.matches("sign-in",!0)?r(Y||(Y=Z``)):this.__renderSignIn():this.__renderAccessRecovery()}}),customElements.define("foxy-internal-customer-portal-subscriptions",class extends ge{constructor(){super(...arguments),this.settings=null,this.customer=null,this.group="",this.__renderFormHeaderActionsUpdate=(e,t)=>{var s;const r=!!(null===(s=t.data)||void 0===s?void 0:s.end_date)&&new Date(t.data.end_date).getTime()<=Date.now();let o="";if(!r&&t.in({idle:"snapshot"})){const e=t.data._links["fx:sub_token_url"].href,s=new URL(e);s.searchParams.set("cart","checkout"),s.searchParams.set("sub_restart","auto"),o=s.toString()}return e(re||(re=fe`
73
+ `),t.renderTemplateOrSlot(`${o}:before`),t.href,null!==(r=null===(s=t.data)||void 0===s?void 0:s.email)&&void 0!==r?r:"",t.lang,t.ns,t.in("busy")||t.disabledSelector.matches(o,!0),t.renderTemplateOrSlot(`${o}:after`)))},o(P||(P=D` <foxy-customer readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="customer" group="${0}" href="${0}" lang="${0}" ns="${0} ${0}" id="customer" .templates="${0}" @update="${0}"> </foxy-customer> `),this.readonlySelector.zoom("customer").toString(),this.disabledSelector.zoom("customer").toString(),i,this.group,this.customer,this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-customer"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",n,(()=>this.requestUpdate()))}disconnectedCallback(){super.disconnectedCallback(),this.loggingOutStateResetTimeout&&clearTimeout(this.loggingOutStateResetTimeout)}get __customerElement(){return this.renderRoot.querySelector("#customer")}}),customElements.define("foxy-internal-customer-portal-logged-out-view",class extends te{constructor(){super(...arguments),this.group="",this.page="sign-in",this.__renderAccessRecoveryHeader=()=>{var e,t,s,r;const{lang:i,ns:n}=this,a=this.renderRoot.querySelector("#access-recovery-form"),l=!!(null==a?void 0:a.in("busy"));return o(B||(B=ee` <div class="flex flex-col leading-m font-lumo" data-testid="access-recovery:header"> ${0} <foxy-i18n class="text-xxl font-medium ${0}" lang="${0}" key="recover_access" ns="${0} ${0}"> </foxy-i18n> <foxy-i18n class="text-l ${0}" lang="${0}" key="recover_access_hint" ns="${0} ${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("access-recovery:header:before"),l?"text-disabled":"text-body",i,n,null!==(t=null===(e=customElements.get("foxy-access-recovery-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",l?"text-disabled":"text-secondary",i,n,null!==(r=null===(s=customElements.get("foxy-access-recovery-form"))||void 0===s?void 0:s.defaultNS)&&void 0!==r?r:"",this.renderTemplateOrSlot("access-recovery:header:after"))},this.__renderAccessRecoveryBack=()=>{var e,t;const s=this.renderRoot.querySelector("#access-recovery-form"),r=this.disabledSelector.zoom("access-recovery");return o(J||(J=ee` <div> ${0} <vaadin-button data-testid="access-recovery:back" class="w-full" theme="tertiary" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="back" ns="${0} ${0}"> </foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("access-recovery:back:before"),!!(null==s?void 0:s.in("busy"))||r.matches("back",!0),(()=>this.page="sign-in"),this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-access-recovery-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",this.renderTemplateOrSlot("access-recovery:back:after"))},this.__renderAccessRecoveryForm=()=>{var e,t;const s="access-recovery:form",r=this.hiddenSelector.zoom(s);return o(W||(W=ee` <div> ${0} <foxy-access-recovery-form readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="access-recovery:form" parent="foxy://customer-api/recover" group="${0}" lang="${0}" ns="${0} ${0}" id="access-recovery-form" .templates="${0}" @update="${0}"> </foxy-access-recovery-form> ${0} </div> `),this.renderTemplateOrSlot(`${s}:before`),this.readonlySelector.zoom(s).toString(),this.disabledSelector.zoom(s).toString(),r.toString(),this.group,this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-access-recovery-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",this.getNestedTemplates(s),(()=>this.requestUpdate()),this.renderTemplateOrSlot(`${s}:after`))},this.__renderAccessRecovery=()=>{const e="access-recovery",t=this.hiddenSelector.zoom(e);return o(G||(G=ee` <div class="h-full flex" data-testid="access-recovery"> <div class="m-auto max-w-20rem flex-1"> ${0} <div class="space-y-l"> ${0} <div class="space-y-s"> ${0} ${0} </div> </div> ${0} </div> </div> `),this.renderTemplateOrSlot(`${e}:before`),t.matches("header",!0)?"":this.__renderAccessRecoveryHeader(),t.matches("form",!0)?"":this.__renderAccessRecoveryForm(),t.matches("back",!0)?"":this.__renderAccessRecoveryBack(),this.renderTemplateOrSlot(`${e}:after`))},this.__renderSignInHeader=()=>{var e,t,s,r;const{lang:i,ns:n}=this,a=this.renderRoot.querySelector("#sign-in-form"),l=!!(null==a?void 0:a.in("busy"));return o(K||(K=ee` <div class="flex flex-col leading-m font-lumo" data-testid="sign-in:header"> ${0} <foxy-i18n class="text-xxl font-medium ${0}" lang="${0}" key="sign_in" ns="${0} ${0}"> </foxy-i18n> <foxy-i18n class="text-l ${0}" lang="${0}" key="sign_in_hint" ns="${0} ${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("sign-in:header:before"),l?"text-disabled":"text-body",i,n,null!==(t=null===(e=customElements.get("foxy-sign-in-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",l?"text-disabled":"text-secondary",i,n,null!==(r=null===(s=customElements.get("foxy-sign-in-form"))||void 0===s?void 0:s.defaultNS)&&void 0!==r?r:"",this.renderTemplateOrSlot("sign-in:header:after"))},this.__renderSignInRecover=()=>{var e,t;const s=this.renderRoot.querySelector("#sign-in-form"),r=this.disabledSelector.zoom("sign-in");return o(M||(M=ee` <div> ${0} <vaadin-button data-testid="sign-in:recover" class="w-full" theme="tertiary" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="recover_access" ns="${0} ${0}"> </foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("sign-in:recover:before"),!!(null==s?void 0:s.in("busy"))||r.matches("recover",!0),(()=>this.page="access-recovery"),this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-sign-in-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",this.renderTemplateOrSlot("sign-in:recover:after"))},this.__renderSignInForm=()=>{var e,t;const s="sign-in:form",r=this.hiddenSelector.zoom(s);return o(Q||(Q=ee` <div> ${0} <foxy-sign-in-form readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="sign-in:form" parent="foxy://customer-api/session" group="${0}" lang="${0}" id="sign-in-form" ns="${0} ${0}" .templates="${0}" @update="${0}"> </foxy-sign-in-form> ${0} </div> `),this.renderTemplateOrSlot(`${s}:before`),this.readonlySelector.zoom(s).toString(),this.disabledSelector.zoom(s).toString(),r.toString(),this.group,this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-sign-in-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",this.getNestedTemplates("sign-in:form"),(()=>this.requestUpdate()),this.renderTemplateOrSlot(`${s}:after`))},this.__renderSignIn=()=>{const e="sign-in",t=this.hiddenSelector.zoom(e);return o(X||(X=ee` <div class="h-full flex" data-testid="sign-in"> <div class="m-auto max-w-20rem flex-1"> ${0} <div class="space-y-l"> ${0} <div class="space-y-s"> ${0} ${0} </div> </div> ${0} </div> </div> `),this.renderTemplateOrSlot("sign-in:before"),t.matches("header",!0)?"":this.__renderSignInHeader(),t.matches("form",!0)?"":this.__renderSignInForm(),t.matches("recover",!0)?"":this.__renderSignInRecover(),this.renderTemplateOrSlot("sign-in:after"))}}static get properties(){return t(t({},super.properties),{},{group:{type:String},page:{type:String}})}static get styles(){return[super.styles,n(Y||(Y=ee`.max-w-20rem{max-width:20rem}`))]}render(){const{page:e,hiddenSelector:t}=this;return"access-recovery"!==e||t.matches("access-recovery",!0)?"sign-in"!==e||t.matches("sign-in",!0)?o(Z||(Z=ee``)):this.__renderSignIn():this.__renderAccessRecovery()}}),customElements.define("foxy-internal-customer-portal-subscriptions",class extends $e{constructor(){super(...arguments),this.settings=null,this.customer=null,this.group="",this.__renderFormHeaderActionsUpdate=(e,t)=>{var s;const r=!!(null===(s=t.data)||void 0===s?void 0:s.end_date)&&new Date(t.data.end_date).getTime()<=Date.now();let o="";if(!r&&t.in({idle:"snapshot"})){const e=t.data._links["fx:sub_token_url"].href,s=new URL(e);s.searchParams.set("cart","checkout"),s.searchParams.set("sub_restart","auto"),o=s.toString()}return e(oe||(oe=ge`
73
74
  ${0}
74
75
 
75
76
  <foxy-internal-customer-portal-link
@@ -82,7 +83,7 @@ import"./foxy-customer.js";import"./shared-c0ec65fa.js";import"./shared-668947de
82
83
  </foxy-internal-customer-portal-link>
83
84
 
84
85
  ${0}
85
- `),t.renderTemplateOrSlot("header:actions:update:before"),o,r||!t.in("idle"),t.lang,t.ns,t.renderTemplateOrSlot("header:actions:update:after"))},this.__renderFormHeaderActionsEnd=(e,t)=>{var s;const r=!!(null===(s=t.data)||void 0===s?void 0:s.end_date);let o="";if(!r&&t.in({idle:"snapshot"})){const e=new URL(t.data._links["fx:sub_token_url"].href);e.searchParams.set("sub_cancel","true"),o=e.toString()}return e(oe||(oe=fe`
86
+ `),t.renderTemplateOrSlot("header:actions:update:before"),o,r||!t.in("idle"),t.lang,t.ns,t.renderTemplateOrSlot("header:actions:update:after"))},this.__renderFormHeaderActionsEnd=(e,t)=>{var s;const r=!!(null===(s=t.data)||void 0===s?void 0:s.end_date);let o="";if(!r&&t.in({idle:"snapshot"})){const e=new URL(t.data._links["fx:sub_token_url"].href);e.searchParams.set("sub_cancel","true"),o=e.toString()}return e(ie||(ie=ge`
86
87
  ${0}
87
88
 
88
89
  <foxy-internal-customer-portal-link
@@ -95,7 +96,7 @@ import"./foxy-customer.js";import"./shared-c0ec65fa.js";import"./shared-668947de
95
96
  </foxy-internal-customer-portal-link>
96
97
 
97
98
  ${0}
98
- `),t.renderTemplateOrSlot("header:actions:end:before"),o,r||!t.in("idle"),t.lang,t.ns,t.renderTemplateOrSlot("header:actions:end:after"))},this.__renderFormHeaderActions=(e,t)=>{const s=t.hiddenSelector.matches("header:actions:update"),r=t.hiddenSelector.matches("header:actions:end");return e(ie||(ie=fe`
99
+ `),t.renderTemplateOrSlot("header:actions:end:before"),o,r||!t.in("idle"),t.lang,t.ns,t.renderTemplateOrSlot("header:actions:end:after"))},this.__renderFormHeaderActions=(e,t)=>{const s=t.hiddenSelector.matches("header:actions:update"),r=t.hiddenSelector.matches("header:actions:end");return e(ne||(ne=ge`
99
100
  <style>
100
101
  main {
101
102
  display: flex;
@@ -115,7 +116,7 @@ import"./foxy-customer.js";import"./shared-c0ec65fa.js";import"./shared-668947de
115
116
  </main>
116
117
 
117
118
  ${0}
118
- `),t.renderTemplateOrSlot("header:actions:before"),s?"":this.__renderFormHeaderActionsUpdate(e,t),r?"":this.__renderFormHeaderActionsEnd(e,t),t.renderTemplateOrSlot("header:actions:after"))},this.__renderFormItemsActionsUpdate=(e,t)=>{var s,r,o,i;const n=null!==(o=null===(r=null===(s=t.data)||void 0===s?void 0:s._links["fx:sub_modification_url"])||void 0===r?void 0:r.href)&&void 0!==o?o:"",a=!!(null===(i=t.data)||void 0===i?void 0:i.end_date)&&new Date(t.data.end_date).getTime()<=Date.now();return e(ne||(ne=fe`
119
+ `),t.renderTemplateOrSlot("header:actions:before"),s?"":this.__renderFormHeaderActionsUpdate(e,t),r?"":this.__renderFormHeaderActionsEnd(e,t),t.renderTemplateOrSlot("header:actions:after"))},this.__renderFormItemsActionsUpdate=(e,t)=>{var s,r,o,i;const n=null!==(o=null===(r=null===(s=t.data)||void 0===s?void 0:s._links["fx:sub_modification_url"])||void 0===r?void 0:r.href)&&void 0!==o?o:"",a=!!(null===(i=t.data)||void 0===i?void 0:i.end_date)&&new Date(t.data.end_date).getTime()<=Date.now();return e(ae||(ae=ge`
119
120
  ${0}
120
121
 
121
122
  <foxy-internal-customer-portal-link
@@ -128,13 +129,13 @@ import"./foxy-customer.js";import"./shared-c0ec65fa.js";import"./shared-668947de
128
129
  </foxy-internal-customer-portal-link>
129
130
 
130
131
  ${0}
131
- `),t.renderTemplateOrSlot("items:actions:update:before"),n,a||!t.in("idle"),t.lang,t.ns,t.renderTemplateOrSlot("items:actions:update:after"))},this.__renderForm=s=>{var o,i;const n=e({},s.dialog.templates),a=n["header:after"],l=n["items:actions:after"];return n["header:after"]=(e,t)=>{const s=t.hiddenSelector.matches("header:actions",!0);return e(ae||(ae=fe`
132
+ `),t.renderTemplateOrSlot("items:actions:update:before"),n,a||!t.in("idle"),t.lang,t.ns,t.renderTemplateOrSlot("items:actions:update:after"))},this.__renderForm=e=>{var r,i;const n=t({},e.dialog.templates),a=n["header:after"],l=n["items:actions:after"];return n["header:after"]=(e,t)=>{const s=t.hiddenSelector.matches("header:actions",!0);return e(le||(le=ge`
132
133
  ${0}
133
134
  ${0}
134
- `),s?"":this.__renderFormHeaderActions(e,t),null==a?void 0:a(e,t))},n["items:actions:after"]=(e,t)=>{var s;const r=!!(null===(s=t.data)||void 0===s?void 0:s._links["fx:sub_modification_url"]),o=t.hiddenSelector.matches("items:actions:update",!0);return e(le||(le=fe`
135
+ `),s?"":this.__renderFormHeaderActions(e,t),null==a?void 0:a(e,t))},n["items:actions:after"]=(e,t)=>{var s;const r=!!(null===(s=t.data)||void 0===s?void 0:s._links["fx:sub_modification_url"]),o=t.hiddenSelector.matches("items:actions:update",!0);return e(de||(de=ge`
135
136
  ${0}
136
137
  ${0}
137
- `),r&&!o?this.__renderFormItemsActionsUpdate(e,t):"",null==l?void 0:l(e,t))},r(de||(de=fe` <foxy-subscription-form disabledcontrols="${0}" readonlycontrols="${0}" hiddencontrols="${0}" settings="${0}" parent="${0}" group="${0}" lang="${0}" href="${0}" ns="${0} ${0}" id="form" .templates="${0}" @update="${0}" @fetch="${0}"> </foxy-subscription-form> `),s.dialog.disabledControls.toString(),s.dialog.readonlyControls.toString(),new t(`attributes timestamps start-date past-due-amount customer ${s.dialog.hiddenSelector}`),JSON.stringify(this.settings),s.dialog.parent,s.dialog.group,s.dialog.lang,s.dialog.href,s.dialog.ns,null!==(i=null===(o=customElements.get("foxy-subscription-form"))||void 0===o?void 0:o.defaultNS)&&void 0!==i?i:"",n,s.handleUpdate,s.handleFetch)},this.__renderPageItem=e=>{let{html:t}=e,r=s(e,te);var o,i;return t(ce||(ce=fe`
138
+ `),r&&!o?this.__renderFormItemsActionsUpdate(e,t):"",null==l?void 0:l(e,t))},o(ce||(ce=ge` <foxy-subscription-form disabledcontrols="${0}" readonlycontrols="${0}" hiddencontrols="${0}" settings="${0}" parent="${0}" group="${0}" lang="${0}" href="${0}" ns="${0} ${0}" id="form" .templates="${0}" @update="${0}" @fetch="${0}"> </foxy-subscription-form> `),e.dialog.disabledControls.toString(),e.dialog.readonlyControls.toString(),new s(`attributes timestamps start-date past-due-amount customer ${e.dialog.hiddenSelector}`),JSON.stringify(this.settings),e.dialog.parent,e.dialog.group,e.dialog.lang,e.dialog.href,e.dialog.ns,null!==(i=null===(r=customElements.get("foxy-subscription-form"))||void 0===r?void 0:r.defaultNS)&&void 0!==i?i:"",n,e.handleUpdate,e.handleFetch)},this.__renderPageItem=e=>{let{html:t}=e,s=r(e,se);var o,i;return t(me||(me=ge`
138
139
  <button
139
140
  class=${0}
140
141
  ?disabled=${0}
@@ -151,7 +152,7 @@ import"./foxy-customer.js";import"./shared-c0ec65fa.js";import"./shared-668947de
151
152
  >
152
153
  </foxy-subscription-card>
153
154
  </button>
154
- `),u({"block w-full border border-contrast-10 p-m rounded-t-l rounded-b-l":!0,"focus-outline-none focus-border-primary":!0,"hover-border-contrast-30":null!==r.data}),null===r.data,(e=>{const t=new URL(r.href);t.searchParams.set("zoom","last_transaction,transaction_template:items"),this.__subscriptionDialog.href=t.toString(),this.__subscriptionDialog.show(e.currentTarget)}),r.parent,r.group,r.lang,r.href,r.ns,null!==(i=null===(o=customElements.get("foxy-subscription-card"))||void 0===o?void 0:o.defaultNS)&&void 0!==i?i:"",r.templates)},this.__renderPage=e=>{let{html:t}=e,r=s(e,se);return t(me||(me=fe`
155
+ `),p({"block w-full border border-contrast-10 p-m rounded-t-l rounded-b-l":!0,"focus-outline-none focus-border-primary":!0,"hover-border-contrast-30":null!==s.data}),null===s.data,(e=>{const t=new URL(s.href);t.searchParams.set("zoom","last_transaction,transaction_template:items"),this.__subscriptionDialog.href=t.toString(),this.__subscriptionDialog.show(e.currentTarget)}),s.parent,s.group,s.lang,s.href,s.ns,null!==(i=null===(o=customElements.get("foxy-subscription-card"))||void 0===o?void 0:o.defaultNS)&&void 0!==i?i:"",s.templates)},this.__renderPage=e=>{let{html:t}=e,s=r(e,re);return t(he||(he=ge`
155
156
  <foxy-collection-page
156
157
  ns=${0}
157
158
  href=${0}
@@ -162,4 +163,4 @@ import"./foxy-customer.js";import"./shared-c0ec65fa.js";import"./shared-668947de
162
163
  .templates=${0}
163
164
  >
164
165
  </foxy-collection-page>
165
- `),r.ns,r.href,r.lang,r.group,this.__renderPageItem,r.templates)},this.__renderHeader=()=>r(he||(he=fe` ${0} <foxy-i18n class="block text-l font-medium" lang="${0}" key="subscription_plural" ns="${0}"> </foxy-i18n> ${0} `),this.renderTemplateOrSlot("header:before"),this.lang,this.ns,this.renderTemplateOrSlot("header:after")),this.__renderList=()=>{var e;const t=this.disabledSelector.zoom("list"),s=this.readonlySelector.zoom("list"),o=[this.hiddenSelector.zoom("list").zoom("form").toString(),"end-date"];return r(ue||(ue=fe` ${0} <foxy-form-dialog readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" header="update" parent="${0}" group="${0}" lang="${0}" ns="${0}" id="subscription-dialog" .form="${0}" .templates="${0}"> </foxy-form-dialog> <foxy-collection-pages class="block space-y-m" first="${0}" group="${0}" lang="${0}" ns="${0}" manual .page="${0}" .templates="${0}"> </foxy-collection-pages> ${0} `),this.renderTemplateOrSlot("list:before"),s.zoom("form").toString(),t.zoom("form").toString(),o.join(" ").trim(),g(null===(e=this.customer)||void 0===e?void 0:e._links["fx:subscriptions"].href),this.group,this.lang,this.ns,this.__renderForm,this.getNestedTemplates("list:form"),this.__activeSubscriptionsLink,this.group,this.lang,this.ns,this.__renderPage,this.getNestedTemplates("list:card"),this.renderTemplateOrSlot("list:after"))}}static get properties(){return e(e({},super.properties),{},{settings:{attribute:!1},customer:{attribute:!1},group:{type:String}})}render(){return r(pe||(pe=fe` <div class="space-y-s" data-testid="subscriptions"> ${0} ${0} </div> `),this.hiddenSelector.matches("header",!0)?"":this.__renderHeader(),this.hiddenSelector.matches("list",!0)?"":this.__renderList())}get __subscriptionDialog(){return this.renderRoot.querySelector("#subscription-dialog")}get __activeSubscriptionsLink(){try{const e=new URL(this.customer._links["fx:subscriptions"].href);return e.searchParams.set("zoom","last_transaction,transaction_template:items"),e.toString()}catch(e){return""}}}),customElements.define("foxy-internal-customer-portal-transactions",class extends Se{constructor(){super(...arguments),this.customer=null,this.group="",this.__renderHeader=()=>r($e||($e=ve` <div> ${0} <foxy-i18n class="text-l font-medium" lang="${0}" key="transaction_plural" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("header:before"),this.lang,this.ns,this.renderTemplateOrSlot("header:after")),this.__renderList=()=>{let e="";if(this.customer){const t=new URL(this.customer._links["fx:transactions"].href);t.searchParams.set("zoom","items"),e=t.toString()}return r(ye||(ye=ve` <div> ${0} <foxy-collection-pages spinner="foxy-spinner" group="${0}" first="${0}" class="block divide-y divide-contrast-10 px-m border border-contrast-10 rounded-t-l rounded-b-l" page="foxy-transactions-table" lang="${0}" ns="${0}" manual .templates="${0}"> </foxy-collection-pages> ${0} </div> `),this.renderTemplateOrSlot("list:before"),this.group,e,this.lang,this.ns,this.getNestedTemplates("table"),this.renderTemplateOrSlot("list:after"))}}static get properties(){return e(e({},super.properties),{},{customer:{attribute:!1},group:{type:String}})}render(){return r(be||(be=ve` <div class="space-y-s" data-testid="transactions"> ${0} ${0} </div> `),this.hiddenSelector.matches("header")?"":this.__renderHeader(),this.hiddenSelector.matches("list")?"":this.__renderList())}}),customElements.define("foxy-internal-customer-portal-change-password",class extends j{constructor(){super(...arguments),this.isErrorVisible=!1,this.disabled=!1,this.customer="",this.session="",this.email="",this.step=1,this.__handleTriggerClick=e=>{const t=e.currentTarget,s=this.renderRoot.querySelector("#dialog");this.isErrorVisible=!1,this.step=1,s.show(t)},this.__handleSignInFormUpdate=(e,t)=>{var s,r,o,i;t.handleUpdate(e);const n=e.currentTarget;!(null===(s=n.form.credential)||void 0===s?void 0:s.email)&&this.email&&n.edit({type:null!==(r=n.form.type)&&void 0!==r?r:"password",credential:{email:this.email,password:null!==(i=null===(o=n.form.credential)||void 0===o?void 0:o.password)&&void 0!==i?i:""}})},this.__handleSignInFormFetch=e=>{e.defaultPrevented||"POST"===e.request.method&&e.request.url===this.session&&(e.preventDefault(),e.stopImmediatePropagation(),e.respondWith(this.__getResponse(e.request)))},this.__renderSignInForm=e=>{const t=[],s=["email"];let o="bg-primary-10",i="text-primary",n="icons:lock-outline",a="password:before";return 2===this.step&&(s.push("password"),a="new-password:before",n="icons:lock-open"),3===this.step&&(t.push("new-password"),s.push("password","submit"),o="bg-success-10",i="text-success",a="new-password:before",n="icons:done-all"),this.isErrorVisible||s.push("error"),r(S||(S=_` <foxy-sign-in-form readonlycontrols="${0}" hiddencontrols="${0}" parent="${0}" class="mt-s sm-w-narrow-modal" lang="${0}" ns="${0}" @update="${0}" @fetch="${0}"> <div class="mx-auto flex mb-m w-l h-l rounded-t-l rounded-b-l ${0}" slot="${0}"> <iron-icon icon="${0}" class="m-auto ${0}"></iron-icon> </div> <foxy-i18n class="block text-center text-m text-secondary leading-m mb-m" lang="${0}" slot="${0}" key="change_password_step_${0}" ns="${0}"> </foxy-i18n> </foxy-sign-in-form> `),t.join(" "),s.join(" "),this.session,e.dialog.lang,e.dialog.ns,(t=>this.__handleSignInFormUpdate(t,e)),this.__handleSignInFormFetch,o,a,n,i,e.dialog.lang,a,this.step,e.dialog.ns)}}static get properties(){return e(e({},super.properties),{},{isErrorVisible:{attribute:!1},disabled:{type:Boolean},customer:{type:String},session:{type:String},email:{type:String},step:{attribute:!1},fail:{attribute:!1}})}render(){return r(x||(x=_` <foxy-form-dialog hiddencontrols="save-button" header="change_password" lang="${0}" ns="${0}" alert id="dialog" .form="${0}"> </foxy-form-dialog> <vaadin-button class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="change_password" ns="${0}"></foxy-i18n> </vaadin-button> `),this.lang,this.ns,this.__renderSignInForm,this.disabled,this.__handleTriggerClick,this.lang,this.ns)}async __getResponse(e){const t=await e.clone().json(),s=new m(this);if(this.isErrorVisible=!1,1===this.step){const r=await s.fetch(e.url,{method:e.method,body:JSON.stringify(t)});if(r.ok){this.step=2;const e={_embedded:{"fx:errors":[{code:"new_password_required_error"}]}};return new m.WHATWGResponse(JSON.stringify(e),{status:400})}return this.isErrorVisible=!0,r}if(2===this.step){const r=await s.fetch(this.customer,{method:"PATCH",body:JSON.stringify({password:t.credential.new_password,password_old:t.credential.password})});return r.ok?(this.step=3,t._links={self:{href:e.url}},new m.WHATWGResponse(JSON.stringify(t))):(this.isErrorVisible=!0,r)}return s.fetch(e)}}),customElements.define("foxy-internal-customer-portal-link",R),customElements.define("foxy-customer-portal",v);export{v as CustomerPortal};
166
+ `),s.ns,s.href,s.lang,s.group,this.__renderPageItem,s.templates)},this.__renderHeader=()=>o(ue||(ue=ge` ${0} <foxy-i18n class="block text-l font-medium" lang="${0}" key="subscription_plural" ns="${0}"> </foxy-i18n> ${0} `),this.renderTemplateOrSlot("header:before"),this.lang,this.ns,this.renderTemplateOrSlot("header:after")),this.__renderList=()=>{var e;const t=this.disabledSelector.zoom("list"),s=this.readonlySelector.zoom("list"),r=[this.hiddenSelector.zoom("list").zoom("form").toString(),"end-date"];return o(pe||(pe=ge` ${0} <foxy-form-dialog readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" header="update" parent="${0}" group="${0}" lang="${0}" ns="${0}" id="subscription-dialog" .form="${0}" .templates="${0}"> </foxy-form-dialog> <foxy-collection-pages class="block space-y-m" first="${0}" group="${0}" lang="${0}" ns="${0}" manual .page="${0}" .templates="${0}"> </foxy-collection-pages> ${0} `),this.renderTemplateOrSlot("list:before"),s.zoom("form").toString(),t.zoom("form").toString(),r.join(" ").trim(),$(null===(e=this.customer)||void 0===e?void 0:e._links["fx:subscriptions"].href),this.group,this.lang,this.ns,this.__renderForm,this.getNestedTemplates("list:form"),this.__activeSubscriptionsLink,this.group,this.lang,this.ns,this.__renderPage,this.getNestedTemplates("list:card"),this.renderTemplateOrSlot("list:after"))}}static get properties(){return t(t({},super.properties),{},{settings:{attribute:!1},customer:{attribute:!1},group:{type:String}})}render(){return o(fe||(fe=ge` <div class="space-y-s" data-testid="subscriptions"> ${0} ${0} </div> `),this.hiddenSelector.matches("header",!0)?"":this.__renderHeader(),this.hiddenSelector.matches("list",!0)?"":this.__renderList())}get __subscriptionDialog(){return this.renderRoot.querySelector("#subscription-dialog")}get __activeSubscriptionsLink(){try{const e=new URL(this.customer._links["fx:subscriptions"].href);return e.searchParams.set("zoom","last_transaction,transaction_template:items"),e.toString()}catch(e){return""}}}),customElements.define("foxy-internal-customer-portal-transactions",class extends xe{constructor(){super(...arguments),this.customer=null,this.columns=[],this.group="",this.__renderHeader=()=>o(ye||(ye=Se` <div> ${0} <foxy-i18n class="text-l font-medium" lang="${0}" key="transaction_plural" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("header:before"),this.lang,this.ns,this.renderTemplateOrSlot("header:after")),this.__renderList=()=>{let e="";if(this.customer){const t=new URL(this.customer._links["fx:transactions"].href);t.searchParams.set("zoom","items"),e=t.toString()}return o(be||(be=Se` <div> ${0} <foxy-collection-pages spinner="foxy-spinner" group="${0}" first="${0}" class="block divide-y divide-contrast-10 px-m border border-contrast-10 rounded-t-l rounded-b-l" page="foxy-transactions-table" lang="${0}" ns="${0}" manual .templates="${0}" .props="${0}"> </foxy-collection-pages> ${0} </div> `),this.renderTemplateOrSlot("list:before"),this.group,e,this.lang,this.ns,this.getNestedTemplates("table"),{".columns":this.columns},this.renderTemplateOrSlot("list:after"))}}static get properties(){return t(t({},super.properties),{},{customer:{attribute:!1},columns:{attribute:!1},group:{type:String}})}render(){return o(ve||(ve=Se` <div class="space-y-s" data-testid="transactions"> ${0} ${0} </div> `),this.hiddenSelector.matches("header")?"":this.__renderHeader(),this.hiddenSelector.matches("list")?"":this.__renderList())}}),customElements.define("foxy-internal-customer-portal-change-password",class extends T{constructor(){super(...arguments),this.isErrorVisible=!1,this.disabled=!1,this.customer="",this.session="",this.email="",this.step=1,this.__handleTriggerClick=e=>{const t=e.currentTarget,s=this.renderRoot.querySelector("#dialog");this.isErrorVisible=!1,this.step=1,s.show(t)},this.__handleSignInFormUpdate=(e,t)=>{var s,r,o,i;t.handleUpdate(e);const n=e.currentTarget;!(null===(s=n.form.credential)||void 0===s?void 0:s.email)&&this.email&&n.edit({type:null!==(r=n.form.type)&&void 0!==r?r:"password",credential:{email:this.email,password:null!==(i=null===(o=n.form.credential)||void 0===o?void 0:o.password)&&void 0!==i?i:""}})},this.__handleSignInFormFetch=e=>{e.defaultPrevented||"POST"===e.request.method&&e.request.url===this.session&&(e.preventDefault(),e.stopImmediatePropagation(),e.respondWith(this.__getResponse(e.request)))},this.__renderSignInForm=e=>{const t=[],s=["email"];let r="bg-primary-10",i="text-primary",n="icons:lock-outline",a="password:before";return 2===this.step&&(s.push("password"),a="new-password:before",n="icons:lock-open"),3===this.step&&(t.push("new-password"),s.push("password","submit"),r="bg-success-10",i="text-success",a="new-password:before",n="icons:done-all"),this.isErrorVisible||s.push("error"),o(x||(x=j` <foxy-sign-in-form readonlycontrols="${0}" hiddencontrols="${0}" parent="${0}" class="mt-s sm-w-narrow-modal" lang="${0}" ns="${0}" @update="${0}" @fetch="${0}"> <div class="mx-auto flex mb-m w-l h-l rounded-t-l rounded-b-l ${0}" slot="${0}"> <iron-icon icon="${0}" class="m-auto ${0}"></iron-icon> </div> <foxy-i18n class="block text-center text-m text-secondary leading-m mb-m" lang="${0}" slot="${0}" key="change_password_step_${0}" ns="${0}"> </foxy-i18n> </foxy-sign-in-form> `),t.join(" "),s.join(" "),this.session,e.dialog.lang,e.dialog.ns,(t=>this.__handleSignInFormUpdate(t,e)),this.__handleSignInFormFetch,r,a,n,i,e.dialog.lang,a,this.step,e.dialog.ns)}}static get properties(){return t(t({},super.properties),{},{isErrorVisible:{attribute:!1},disabled:{type:Boolean},customer:{type:String},session:{type:String},email:{type:String},step:{attribute:!1},fail:{attribute:!1}})}render(){return o(_||(_=j` <foxy-form-dialog hiddencontrols="save-button" header="change_password" lang="${0}" ns="${0}" alert id="dialog" .form="${0}"> </foxy-form-dialog> <vaadin-button class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="change_password" ns="${0}"></foxy-i18n> </vaadin-button> `),this.lang,this.ns,this.__renderSignInForm,this.disabled,this.__handleTriggerClick,this.lang,this.ns)}async __getResponse(e){const t=await e.clone().json(),s=new h(this);if(this.isErrorVisible=!1,1===this.step){const r=await s.fetch(e.url,{method:e.method,body:JSON.stringify(t)});if(r.ok){this.step=2;const e={_embedded:{"fx:errors":[{code:"new_password_required_error"}]}};return new h.WHATWGResponse(JSON.stringify(e),{status:400})}return this.isErrorVisible=!0,r}if(2===this.step){const r=await s.fetch(this.customer,{method:"PATCH",body:JSON.stringify({password:t.credential.new_password,password_old:t.credential.password})});return r.ok?(this.step=3,t._links={self:{href:e.url}},new h.WHATWGResponse(JSON.stringify(t))):(this.isErrorVisible=!0,r)}return s.fetch(e)}}),customElements.define("foxy-internal-customer-portal-link",z),customElements.define("foxy-customer-portal",S);export{S as CustomerPortal};
@@ -1,5 +1,6 @@
1
1
  import { PropertyDeclarations, TemplateResult } from 'lit-element';
2
2
  import { CustomerApi } from '../CustomerApi/CustomerApi';
3
+ import { TransactionsTable } from '../TransactionsTable/TransactionsTable';
3
4
  declare const CustomerPortal_base: typeof CustomerApi & {
4
5
  styles: import("lit-element").CSSResultArray;
5
6
  } & import("lit-element").Constructor<import("../../../mixins/translatable").TranslatableMixinHost> & {
@@ -7,6 +8,8 @@ declare const CustomerPortal_base: typeof CustomerApi & {
7
8
  };
8
9
  export declare class CustomerPortal extends CustomerPortal_base {
9
10
  static get properties(): PropertyDeclarations;
11
+ /** Same as `.columns` property on `foxy-transactions-table`. Sets columns of that table. */
12
+ transactionsTableColumns: TransactionsTable['columns'];
10
13
  /** Rumour group. Elements in different groups will not share updates. Empty by default. */
11
14
  group: string;
12
15
  render(): TemplateResult;
@@ -3,15 +3,26 @@ import { API } from '@foxy.io/sdk/customer';
3
3
  import { CustomerApi } from "../CustomerApi/CustomerApi.js";
4
4
  import { ThemeableMixin } from "../../../mixins/themeable.js";
5
5
  import { TranslatableMixin } from "../../../mixins/translatable.js";
6
+ import { TransactionsTable } from "../TransactionsTable/TransactionsTable.js";
6
7
  export class CustomerPortal extends TranslatableMixin(ThemeableMixin(CustomerApi), 'customer-portal') {
7
8
  constructor() {
8
9
  super(...arguments);
10
+ /** Same as `.columns` property on `foxy-transactions-table`. Sets columns of that table. */
11
+ this.transactionsTableColumns = [
12
+ TransactionsTable.priceColumn,
13
+ TransactionsTable.summaryColumn,
14
+ TransactionsTable.statusColumn,
15
+ TransactionsTable.idColumn,
16
+ TransactionsTable.dateColumn,
17
+ TransactionsTable.receiptColumn,
18
+ ];
9
19
  /** Rumour group. Elements in different groups will not share updates. Empty by default. */
10
20
  this.group = '';
11
21
  }
12
22
  static get properties() {
13
23
  return {
14
24
  ...super.properties,
25
+ transactionsTableColumns: { attribute: false },
15
26
  group: { type: String },
16
27
  };
17
28
  }
@@ -28,6 +39,7 @@ export class CustomerPortal extends TranslatableMixin(ThemeableMixin(CustomerApi
28
39
  lang=${this.lang}
29
40
  href=${new URL('./customer_portal_settings', this.base).toString()}
30
41
  ns=${this.ns}
42
+ .transactionsTableColumns=${this.transactionsTableColumns}
31
43
  .templates=${this.templates}
32
44
  >
33
45
  </foxy-internal-customer-portal-logged-in-view>
@@ -1 +1 @@
1
- {"version":3,"file":"CustomerPortal.js","sourceRoot":"","sources":["../../../../src/elements/public/CustomerPortal/CustomerPortal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,IAAI,EAAE,MAAM,aAAa,CAAC;AAEzE,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,sCAAmC;AACzD,OAAO,EAAE,cAAc,EAAE,qCAAkC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AAEjE,MAAM,OAAO,cAAe,SAAQ,iBAAiB,CACnD,cAAc,CAAC,WAAW,CAAC,EAC3B,iBAAiB,CAClB;IAHD;;QAWE,2FAA2F;QAC3F,UAAK,GAAG,EAAE,CAAC;IAiCb,CAAC;IAzCC,MAAM,KAAK,UAAU;QACnB,OAAO;YACL,GAAG,KAAK,CAAC,UAAU;YACnB,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;SACxB,CAAC;IACJ,CAAC;IAKD,MAAM;QACJ,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;YAC1C,CAAC,CAAC,IAAI,CAAA;;+BAEmB,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE;+BAChC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE;6BAClC,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE;uBACpC,IAAI,CAAC,IAAI;oBACZ,IAAI,CAAC,KAAK;;mBAEX,IAAI,CAAC,IAAI;mBACT,IAAI,GAAG,CAAC,4BAA4B,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;iBAC7D,IAAI,CAAC,EAAE;yBACC,IAAI,CAAC,SAAS;;;SAG9B;YACH,CAAC,CAAC,IAAI,CAAA;;+BAEmB,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE;+BAChC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE;6BAClC,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE;oBACvC,IAAI,CAAC,KAAK;;mBAEX,IAAI,CAAC,IAAI;iBACX,IAAI,CAAC,EAAE;yBACC,IAAI,CAAC,SAAS;;;SAG9B,CAAC;IACR,CAAC;CACF","sourcesContent":["import { PropertyDeclarations, TemplateResult, html } from 'lit-element';\n\nimport { API } from '@foxy.io/sdk/customer';\nimport { CustomerApi } from '../CustomerApi/CustomerApi';\nimport { ThemeableMixin } from '../../../mixins/themeable';\nimport { TranslatableMixin } from '../../../mixins/translatable';\n\nexport class CustomerPortal extends TranslatableMixin(\n ThemeableMixin(CustomerApi),\n 'customer-portal'\n) {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n group: { type: String },\n };\n }\n\n /** Rumour group. Elements in different groups will not share updates. Empty by default. */\n group = '';\n\n render(): TemplateResult {\n return this.api.storage.getItem(API.SESSION)\n ? html`\n <foxy-internal-customer-portal-logged-in-view\n disabledcontrols=${this.disabledSelector.toString()}\n readonlycontrols=${this.readonlySelector.toString()}\n hiddencontrols=${this.hiddenSelector.toString()}\n customer=${this.base}\n group=${this.group}\n class=\"h-full\"\n lang=${this.lang}\n href=${new URL('./customer_portal_settings', this.base).toString()}\n ns=${this.ns}\n .templates=${this.templates}\n >\n </foxy-internal-customer-portal-logged-in-view>\n `\n : html`\n <foxy-internal-customer-portal-logged-out-view\n disabledcontrols=${this.disabledSelector.toString()}\n readonlycontrols=${this.readonlySelector.toString()}\n hiddencontrols=${this.hiddenSelector.toString()}\n group=${this.group}\n class=\"h-full\"\n lang=${this.lang}\n ns=${this.ns}\n .templates=${this.templates}\n >\n </foxy-internal-customer-portal-logged-out-view>\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"CustomerPortal.js","sourceRoot":"","sources":["../../../../src/elements/public/CustomerPortal/CustomerPortal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,IAAI,EAAE,MAAM,aAAa,CAAC;AAEzE,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,sCAAmC;AACzD,OAAO,EAAE,cAAc,EAAE,qCAAkC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,iBAAiB,EAAE,kDAA+C;AAE3E,MAAM,OAAO,cAAe,SAAQ,iBAAiB,CACnD,cAAc,CAAC,WAAW,CAAC,EAC3B,iBAAiB,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,EAAE;yBACC,IAAI,CAAC,SAAS;;;SAG9B,CAAC;IACR,CAAC;CACF","sourcesContent":["import { PropertyDeclarations, TemplateResult, html } from 'lit-element';\n\nimport { API } from '@foxy.io/sdk/customer';\nimport { CustomerApi } from '../CustomerApi/CustomerApi';\nimport { ThemeableMixin } from '../../../mixins/themeable';\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { TransactionsTable } from '../TransactionsTable/TransactionsTable';\n\nexport class CustomerPortal extends TranslatableMixin(\n ThemeableMixin(CustomerApi),\n 'customer-portal'\n) {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n transactionsTableColumns: { attribute: false },\n group: { type: String },\n };\n }\n\n /** Same as `.columns` property on `foxy-transactions-table`. Sets columns of that table. */\n transactionsTableColumns: TransactionsTable['columns'] = [\n TransactionsTable.priceColumn,\n TransactionsTable.summaryColumn,\n TransactionsTable.statusColumn,\n TransactionsTable.idColumn,\n TransactionsTable.dateColumn,\n TransactionsTable.receiptColumn,\n ];\n\n /** Rumour group. Elements in different groups will not share updates. Empty by default. */\n group = '';\n\n render(): TemplateResult {\n return this.api.storage.getItem(API.SESSION)\n ? html`\n <foxy-internal-customer-portal-logged-in-view\n disabledcontrols=${this.disabledSelector.toString()}\n readonlycontrols=${this.readonlySelector.toString()}\n hiddencontrols=${this.hiddenSelector.toString()}\n customer=${this.base}\n group=${this.group}\n class=\"h-full\"\n lang=${this.lang}\n href=${new URL('./customer_portal_settings', this.base).toString()}\n ns=${this.ns}\n .transactionsTableColumns=${this.transactionsTableColumns}\n .templates=${this.templates}\n >\n </foxy-internal-customer-portal-logged-in-view>\n `\n : html`\n <foxy-internal-customer-portal-logged-out-view\n disabledcontrols=${this.disabledSelector.toString()}\n readonlycontrols=${this.readonlySelector.toString()}\n hiddencontrols=${this.hiddenSelector.toString()}\n group=${this.group}\n class=\"h-full\"\n lang=${this.lang}\n ns=${this.ns}\n .templates=${this.templates}\n >\n </foxy-internal-customer-portal-logged-out-view>\n `;\n }\n}\n"]}
@@ -5,6 +5,7 @@ import { PropertyDeclarations } from 'lit-element';
5
5
  import { Rels } from '@foxy.io/sdk/customer';
6
6
  import { Resource } from '@foxy.io/sdk/core';
7
7
  import { Templates } from './types';
8
+ import { TransactionsTable } from '../TransactionsTable/TransactionsTable';
8
9
  declare const Base: typeof NucleonElement & import("lit-element").Constructor<import("../../../mixins/translatable").TranslatableMixinHost> & {
9
10
  defaultNS: string;
10
11
  } & import("lit-element").Constructor<import("../../../mixins/configurable").ConfigurableMixinHost> & {
@@ -16,6 +17,7 @@ export declare class InternalCustomerPortalLoggedInView extends Base<Data> {
16
17
  templates: Templates;
17
18
  customer: string;
18
19
  loggingOutState: 'idle' | 'busy' | 'fail';
20
+ transactionsTableColumns: TransactionsTable['columns'];
19
21
  loggingOutStateResetTimeout: NodeJS.Timeout | null;
20
22
  private readonly __renderHeaderActionsSignOut;
21
23
  private readonly __renderSubscriptions;
@@ -12,6 +12,7 @@ export class InternalCustomerPortalLoggedInView extends Base {
12
12
  this.templates = {};
13
13
  this.customer = '';
14
14
  this.loggingOutState = 'idle';
15
+ this.transactionsTableColumns = [];
15
16
  this.loggingOutStateResetTimeout = null;
16
17
  this.__renderHeaderActionsSignOut = () => {
17
18
  var _a, _b, _c, _d, _e;
@@ -110,6 +111,7 @@ export class InternalCustomerPortalLoggedInView extends Base {
110
111
  ns=${host.ns}
111
112
  .templates=${this.getNestedTemplates(scope)}
112
113
  .customer=${host.data}
114
+ .columns=${this.transactionsTableColumns}
113
115
  >
114
116
  </foxy-internal-customer-portal-transactions>
115
117
 
@@ -122,6 +124,7 @@ export class InternalCustomerPortalLoggedInView extends Base {
122
124
  ...super.properties,
123
125
  customer: { type: String },
124
126
  loggingOutState: { attribute: false },
127
+ transactionsTableColumns: { attribute: false },
125
128
  loggingOutStateResetTimeout: { attribute: false },
126
129
  };
127
130
  }
@@ -1 +1 @@
1
- {"version":3,"file":"InternalCustomerPortalLoggedInView.js","sourceRoot":"","sources":["../../../../src/elements/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,CAAC,IAAI;;;wBAGZ,YAAA,IAAI,CAAC,IAAI,0CAAE,KAAK,mCAAI,EAAE;uBACvB,IAAI,CAAC,IAAI;qBACX,IAAI,CAAC,EAAE;4BACA,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC;;;;gBAIzE,IAAI,CAAC,oBAAoB,CAAC,GAAG,KAAK,QAAQ,CAAC;aAC9C;OACN,CAAC;QACJ,CAAC,CAAC;QAEF,OAAO,IAAI,CAAA;;2BAEY,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE;2BACjD,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE;yBACnD,sBAAsB;;gBAE/B,IAAI,CAAC,KAAK;eACX,IAAI,CAAC,QAAQ;eACb,IAAI,CAAC,IAAI;cACV,IAAI,CAAC,EAAE,IAAI,YAAA,cAAc,CAAC,GAAG,CAAC,eAAe,CAAC,0CAAE,SAAS,mCAAI,EAAE;;qBAExD,SAAS;kBACZ,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE;;;KAGvC,CAAC;IACJ,CAAC;IAED,oBAAoB;QAClB,KAAK,CAAC,oBAAoB,EAAE,CAAC;QAC7B,IAAI,IAAI,CAAC,2BAA2B;YAAE,YAAY,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;IACvF,CAAC;IAED,IAAY,iBAAiB;QAC3B,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAW,WAAW,CAAC,CAAC;IAC9D,CAAC;CACF","sourcesContent":["import { ConfigurableMixin, Renderer } from '../../../mixins/configurable';\nimport { TemplateResult, html } from 'lit-html';\n\nimport { API } from '../NucleonElement/API';\nimport { Customer } from '../Customer/Customer';\nimport { Templates as CustomerTemplates } from '../Customer/types';\nimport { NucleonElement } from '../NucleonElement/NucleonElement';\nimport { PropertyDeclarations } from 'lit-element';\nimport { Rels } from '@foxy.io/sdk/customer';\nimport { BooleanSelector, Resource } from '@foxy.io/sdk/core';\nimport { Templates } from './types';\nimport { ThemeableMixin } from '../../../mixins/themeable';\nimport { TranslatableMixin } from '../../../mixins/translatable';\n\nconst Base = ThemeableMixin(ConfigurableMixin(TranslatableMixin(NucleonElement)));\ntype Data = Resource<Rels.CustomerPortalSettings>;\n\nexport class InternalCustomerPortalLoggedInView extends Base<Data> {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n customer: { type: String },\n loggingOutState: { attribute: false },\n loggingOutStateResetTimeout: { attribute: false },\n };\n }\n\n templates: Templates = {};\n\n customer = '';\n\n loggingOutState: 'idle' | 'busy' | 'fail' = 'idle';\n\n loggingOutStateResetTimeout: NodeJS.Timeout | null = null;\n\n private readonly __renderHeaderActionsSignOut = () => {\n const scope = 'customer:header:actions:sign-out';\n const state = this.loggingOutState;\n\n const isDisabled =\n this.disabledSelector.matches(scope) ||\n !this.__customerElement?.in({ idle: 'snapshot' }) ||\n state !== 'idle';\n\n const handleClick = async () => {\n try {\n this.loggingOutState = 'busy';\n await new API(this).fetch('foxy://customer-api/session', { method: 'DELETE' });\n this.loggingOutState = 'idle';\n } catch {\n this.loggingOutState = 'fail';\n this.loggingOutStateResetTimeout = setTimeout(() => {\n this.loggingOutState = 'idle';\n this.loggingOutStateResetTimeout = null;\n }, 1000);\n }\n };\n\n const style = {\n 'border-radius': '100%',\n 'padding': 'var(--lumo-space-xs)',\n 'display': 'flex',\n 'margin': '0',\n 'cursor': isDisabled ? 'default' : 'pointer',\n };\n\n return html`\n <div style=\"display: flex; margin-left: var(--lumo-space-m)\">\n ${this.renderTemplateOrSlot(`${scope}:before`)}\n\n <vaadin-button\n data-testid=\"sign-out\"\n aria-label=${this.t('sign_out').toString()}\n style=${Object.entries(style).reduce((p, [k, v]) => `${p}${k}:${v};`, '')}\n theme=\"icon\"\n ?disabled=${isDisabled}\n @click=${handleClick}\n >\n ${state === 'idle'\n ? html`<iron-icon icon=\"icons:exit-to-app\"></iron-icon>`\n : html`\n <foxy-spinner\n layout=\"no-label\"\n state=${state === 'fail' ? 'error' : 'busy'}\n style=\"margin: auto\"\n lang=${this.lang}\n ns=${[\n this.ns,\n customElements.get('foxy-customer')?.defaultNS ?? '',\n customElements.get('foxy-spinner')?.defaultNS ?? '',\n ].join(' ')}\n >\n </foxy-spinner>\n `}\n </vaadin-button>\n\n ${this.renderTemplateOrSlot(`${scope}:after`)}\n </div>\n `;\n };\n\n private readonly __renderSubscriptions: Renderer<Customer> = (html, host) => {\n const scope = 'customer:subscriptions';\n\n return html`\n ${this.renderTemplateOrSlot(`${scope}:before`)}\n\n <foxy-internal-customer-portal-subscriptions\n readonlycontrols=${this.readonlySelector.zoom(scope).toString()}\n disabledcontrols=${this.disabledSelector.zoom(scope).toString()}\n hiddencontrols=${this.hiddenSelector.zoom(scope).toString()}\n group=${host.group}\n lang=${host.lang}\n ns=${host.ns}\n .templates=${this.getNestedTemplates(scope)}\n .settings=${this.data}\n .customer=${host.data}\n >\n </foxy-internal-customer-portal-subscriptions>\n\n ${this.renderTemplateOrSlot(`${scope}:after`)}\n `;\n };\n\n private readonly __renderTransactions: Renderer<Customer> = (html, host) => {\n const scope = 'customer:transactions';\n\n return html`\n ${this.renderTemplateOrSlot(`${scope}:before`)}\n\n <foxy-internal-customer-portal-transactions\n readonlycontrols=${this.readonlySelector.zoom(scope).toString()}\n disabledcontrols=${this.disabledSelector.zoom(scope).toString()}\n hiddencontrols=${this.hiddenSelector.zoom(scope).toString()}\n group=${host.group}\n lang=${host.lang}\n ns=${host.ns}\n .templates=${this.getNestedTemplates(scope)}\n .customer=${host.data}\n >\n </foxy-internal-customer-portal-transactions>\n\n ${this.renderTemplateOrSlot(`${scope}:after`)}\n `;\n };\n\n render(): TemplateResult {\n const hiddenSelector = this.hiddenSelector.zoom('customer');\n const customerHiddenControls = new BooleanSelector(\n [\n 'attributes',\n 'transactions',\n 'subscriptions',\n 'addresses:actions:create',\n 'header:actions:edit:form:delete',\n hiddenSelector.toString(),\n ].join(' ')\n ).toString();\n\n const templates: CustomerTemplates = this.getNestedTemplates('customer');\n const originalHeaderActionsAfterTemplate = templates['header:actions:after'];\n const originalTimestampsAfterTemplate = templates['header:actions:edit:form:timestamps:after'];\n const originalDefaultTemplate = templates['default'];\n\n templates['header:actions:after'] = (html, host) => {\n const isSignOutHidden = hiddenSelector.matches('header:actions:sign-out', true);\n return html`\n <div style=\"display:flex\">\n ${isSignOutHidden ? '' : this.__renderHeaderActionsSignOut()}\n ${originalHeaderActionsAfterTemplate?.(html, host)}\n </div>\n `;\n };\n\n templates['default'] = (html, host) => {\n const renderSubscriptions = this.__renderSubscriptions;\n const renderTransactions = this.__renderTransactions;\n\n return html`\n <style>\n .space-y-m > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(var(--lumo-space-m, 1rem) * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(var(--lumo-space-m, 1rem) * var(--tw-space-y-reverse));\n }\n </style>\n\n ${hiddenSelector.matches('default', true) ? '' : originalDefaultTemplate?.(html, host)}\n\n <div class=\"space-y-m\">\n ${hiddenSelector.matches('subscriptions', true) ? '' : renderSubscriptions(html, host)}\n ${hiddenSelector.matches('transactions', true) ? '' : renderTransactions(html, host)}\n </div>\n `;\n };\n\n templates['header:actions:edit:form:timestamps:after'] = (html, host) => {\n const scope = 'change-password';\n\n return html`\n ${originalTimestampsAfterTemplate?.(html, host)}\n ${host.hiddenSelector.matches(scope, true)\n ? ''\n : html`\n ${host.renderTemplateOrSlot(`${scope}:before`)}\n\n <foxy-internal-customer-portal-change-password\n customer=${host.href}\n session=\"foxy://customer-api/session\"\n style=\"margin-top: var(--lumo-space-l)\"\n email=${host.data?.email ?? ''}\n lang=${host.lang}\n ns=${host.ns}\n ?disabled=${host.in('busy') || host.disabledSelector.matches(scope, true)}\n >\n </foxy-internal-customer-portal-change-password>\n\n ${host.renderTemplateOrSlot(`${scope}:after`)}\n `}\n `;\n };\n\n return html`\n <foxy-customer\n readonlycontrols=${this.readonlySelector.zoom('customer').toString()}\n disabledcontrols=${this.disabledSelector.zoom('customer').toString()}\n hiddencontrols=${customerHiddenControls}\n data-testid=\"customer\"\n group=${this.group}\n href=${this.customer}\n lang=${this.lang}\n ns=\"${this.ns} ${customElements.get('foxy-customer')?.defaultNS ?? ''}\"\n id=\"customer\"\n .templates=${templates}\n @update=${() => this.requestUpdate()}\n >\n </foxy-customer>\n `;\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n if (this.loggingOutStateResetTimeout) clearTimeout(this.loggingOutStateResetTimeout);\n }\n\n private get __customerElement() {\n return this.renderRoot.querySelector<Customer>('#customer');\n }\n}\n"]}
1
+ {"version":3,"file":"InternalCustomerPortalLoggedInView.js","sourceRoot":"","sources":["../../../../src/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAY,wCAAqC;AAC3E,OAAO,EAAkB,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,EAAE,GAAG,EAAE,iCAA8B;AAG5C,OAAO,EAAE,cAAc,EAAE,4CAAyC;AAGlE,OAAO,EAAE,eAAe,EAAY,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,qCAAkC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AAGjE,MAAM,IAAI,GAAG,cAAc,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;AAGlF,MAAM,OAAO,kCAAmC,SAAQ,IAAU;IAAlE;;QAWE,cAAS,GAAc,EAAE,CAAC;QAE1B,aAAQ,GAAG,EAAE,CAAC;QAEd,oBAAe,GAA6B,MAAM,CAAC;QAEnD,6BAAwB,GAAiC,EAAE,CAAC;QAE5D,gCAA2B,GAA0B,IAAI,CAAC;QAEzC,iCAA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AI,CAAC,QAAQ;eACb,IAAI,CAAC,IAAI;cACV,IAAI,CAAC,EAAE,IAAI,YAAA,cAAc,CAAC,GAAG,CAAC,eAAe,CAAC,0CAAE,SAAS,mCAAI,EAAE;;qBAExD,SAAS;kBACZ,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE;;;KAGvC,CAAC;IACJ,CAAC;IAED,oBAAoB;QAClB,KAAK,CAAC,oBAAoB,EAAE,CAAC;QAC7B,IAAI,IAAI,CAAC,2BAA2B;YAAE,YAAY,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;IACvF,CAAC;IAED,IAAY,iBAAiB;QAC3B,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAW,WAAW,CAAC,CAAC;IAC9D,CAAC;CACF","sourcesContent":["import { ConfigurableMixin, Renderer } from '../../../mixins/configurable';\nimport { TemplateResult, html } from 'lit-html';\n\nimport { API } from '../NucleonElement/API';\nimport { Customer } from '../Customer/Customer';\nimport { Templates as CustomerTemplates } from '../Customer/types';\nimport { NucleonElement } from '../NucleonElement/NucleonElement';\nimport { PropertyDeclarations } from 'lit-element';\nimport { Rels } from '@foxy.io/sdk/customer';\nimport { BooleanSelector, Resource } from '@foxy.io/sdk/core';\nimport { Templates } from './types';\nimport { ThemeableMixin } from '../../../mixins/themeable';\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { TransactionsTable } from '../TransactionsTable/TransactionsTable';\n\nconst Base = ThemeableMixin(ConfigurableMixin(TranslatableMixin(NucleonElement)));\ntype Data = Resource<Rels.CustomerPortalSettings>;\n\nexport class InternalCustomerPortalLoggedInView extends Base<Data> {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n customer: { type: String },\n loggingOutState: { attribute: false },\n transactionsTableColumns: { attribute: false },\n loggingOutStateResetTimeout: { attribute: false },\n };\n }\n\n templates: Templates = {};\n\n customer = '';\n\n loggingOutState: 'idle' | 'busy' | 'fail' = 'idle';\n\n transactionsTableColumns: TransactionsTable['columns'] = [];\n\n loggingOutStateResetTimeout: NodeJS.Timeout | null = null;\n\n private readonly __renderHeaderActionsSignOut = () => {\n const scope = 'customer:header:actions:sign-out';\n const state = this.loggingOutState;\n\n const isDisabled =\n this.disabledSelector.matches(scope) ||\n !this.__customerElement?.in({ idle: 'snapshot' }) ||\n state !== 'idle';\n\n const handleClick = async () => {\n try {\n this.loggingOutState = 'busy';\n await new API(this).fetch('foxy://customer-api/session', { method: 'DELETE' });\n this.loggingOutState = 'idle';\n } catch {\n this.loggingOutState = 'fail';\n this.loggingOutStateResetTimeout = setTimeout(() => {\n this.loggingOutState = 'idle';\n this.loggingOutStateResetTimeout = null;\n }, 1000);\n }\n };\n\n const style = {\n 'border-radius': '100%',\n 'padding': 'var(--lumo-space-xs)',\n 'display': 'flex',\n 'margin': '0',\n 'cursor': isDisabled ? 'default' : 'pointer',\n };\n\n return html`\n <div style=\"display: flex; margin-left: var(--lumo-space-m)\">\n ${this.renderTemplateOrSlot(`${scope}:before`)}\n\n <vaadin-button\n data-testid=\"sign-out\"\n aria-label=${this.t('sign_out').toString()}\n style=${Object.entries(style).reduce((p, [k, v]) => `${p}${k}:${v};`, '')}\n theme=\"icon\"\n ?disabled=${isDisabled}\n @click=${handleClick}\n >\n ${state === 'idle'\n ? html`<iron-icon icon=\"icons:exit-to-app\"></iron-icon>`\n : html`\n <foxy-spinner\n layout=\"no-label\"\n state=${state === 'fail' ? 'error' : 'busy'}\n style=\"margin: auto\"\n lang=${this.lang}\n ns=${[\n this.ns,\n customElements.get('foxy-customer')?.defaultNS ?? '',\n customElements.get('foxy-spinner')?.defaultNS ?? '',\n ].join(' ')}\n >\n </foxy-spinner>\n `}\n </vaadin-button>\n\n ${this.renderTemplateOrSlot(`${scope}:after`)}\n </div>\n `;\n };\n\n private readonly __renderSubscriptions: Renderer<Customer> = (html, host) => {\n const scope = 'customer:subscriptions';\n\n return html`\n ${this.renderTemplateOrSlot(`${scope}:before`)}\n\n <foxy-internal-customer-portal-subscriptions\n readonlycontrols=${this.readonlySelector.zoom(scope).toString()}\n disabledcontrols=${this.disabledSelector.zoom(scope).toString()}\n hiddencontrols=${this.hiddenSelector.zoom(scope).toString()}\n group=${host.group}\n lang=${host.lang}\n ns=${host.ns}\n .templates=${this.getNestedTemplates(scope)}\n .settings=${this.data}\n .customer=${host.data}\n >\n </foxy-internal-customer-portal-subscriptions>\n\n ${this.renderTemplateOrSlot(`${scope}:after`)}\n `;\n };\n\n private readonly __renderTransactions: Renderer<Customer> = (html, host) => {\n const scope = 'customer:transactions';\n\n return html`\n ${this.renderTemplateOrSlot(`${scope}:before`)}\n\n <foxy-internal-customer-portal-transactions\n readonlycontrols=${this.readonlySelector.zoom(scope).toString()}\n disabledcontrols=${this.disabledSelector.zoom(scope).toString()}\n hiddencontrols=${this.hiddenSelector.zoom(scope).toString()}\n group=${host.group}\n lang=${host.lang}\n ns=${host.ns}\n .templates=${this.getNestedTemplates(scope)}\n .customer=${host.data}\n .columns=${this.transactionsTableColumns}\n >\n </foxy-internal-customer-portal-transactions>\n\n ${this.renderTemplateOrSlot(`${scope}:after`)}\n `;\n };\n\n render(): TemplateResult {\n const hiddenSelector = this.hiddenSelector.zoom('customer');\n const customerHiddenControls = new BooleanSelector(\n [\n 'attributes',\n 'transactions',\n 'subscriptions',\n 'addresses:actions:create',\n 'header:actions:edit:form:delete',\n hiddenSelector.toString(),\n ].join(' ')\n ).toString();\n\n const templates: CustomerTemplates = this.getNestedTemplates('customer');\n const originalHeaderActionsAfterTemplate = templates['header:actions:after'];\n const originalTimestampsAfterTemplate = templates['header:actions:edit:form:timestamps:after'];\n const originalDefaultTemplate = templates['default'];\n\n templates['header:actions:after'] = (html, host) => {\n const isSignOutHidden = hiddenSelector.matches('header:actions:sign-out', true);\n return html`\n <div style=\"display:flex\">\n ${isSignOutHidden ? '' : this.__renderHeaderActionsSignOut()}\n ${originalHeaderActionsAfterTemplate?.(html, host)}\n </div>\n `;\n };\n\n templates['default'] = (html, host) => {\n const renderSubscriptions = this.__renderSubscriptions;\n const renderTransactions = this.__renderTransactions;\n\n return html`\n <style>\n .space-y-m > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(var(--lumo-space-m, 1rem) * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(var(--lumo-space-m, 1rem) * var(--tw-space-y-reverse));\n }\n </style>\n\n ${hiddenSelector.matches('default', true) ? '' : originalDefaultTemplate?.(html, host)}\n\n <div class=\"space-y-m\">\n ${hiddenSelector.matches('subscriptions', true) ? '' : renderSubscriptions(html, host)}\n ${hiddenSelector.matches('transactions', true) ? '' : renderTransactions(html, host)}\n </div>\n `;\n };\n\n templates['header:actions:edit:form:timestamps:after'] = (html, host) => {\n const scope = 'change-password';\n\n return html`\n ${originalTimestampsAfterTemplate?.(html, host)}\n ${host.hiddenSelector.matches(scope, true)\n ? ''\n : html`\n ${host.renderTemplateOrSlot(`${scope}:before`)}\n\n <foxy-internal-customer-portal-change-password\n customer=${host.href}\n session=\"foxy://customer-api/session\"\n style=\"margin-top: var(--lumo-space-l)\"\n email=${host.data?.email ?? ''}\n lang=${host.lang}\n ns=${host.ns}\n ?disabled=${host.in('busy') || host.disabledSelector.matches(scope, true)}\n >\n </foxy-internal-customer-portal-change-password>\n\n ${host.renderTemplateOrSlot(`${scope}:after`)}\n `}\n `;\n };\n\n return html`\n <foxy-customer\n readonlycontrols=${this.readonlySelector.zoom('customer').toString()}\n disabledcontrols=${this.disabledSelector.zoom('customer').toString()}\n hiddencontrols=${customerHiddenControls}\n data-testid=\"customer\"\n group=${this.group}\n href=${this.customer}\n lang=${this.lang}\n ns=\"${this.ns} ${customElements.get('foxy-customer')?.defaultNS ?? ''}\"\n id=\"customer\"\n .templates=${templates}\n @update=${() => this.requestUpdate()}\n >\n </foxy-customer>\n `;\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n if (this.loggingOutStateResetTimeout) clearTimeout(this.loggingOutStateResetTimeout);\n }\n\n private get __customerElement() {\n return this.renderRoot.querySelector<Customer>('#customer');\n }\n}\n"]}
@@ -1,6 +1,7 @@
1
1
  import { LitElement, PropertyDeclarations, TemplateResult } from 'lit-element';
2
2
  import { Graph } from '@foxy.io/sdk/customer';
3
3
  import { Resource } from '@foxy.io/sdk/core';
4
+ import { TransactionsTable } from '../TransactionsTable/TransactionsTable';
4
5
  declare const Base: typeof LitElement & import("lit-element").Constructor<import("../../../mixins/inferrable").InferrableMixinHost> & {
5
6
  inferredProperties: string[];
6
7
  } & import("lit-element").Constructor<import("../../../mixins/translatable").TranslatableMixinHost> & {
@@ -11,6 +12,7 @@ declare const Base: typeof LitElement & import("lit-element").Constructor<import
11
12
  export declare class InternalCustomerPortalTransactions extends Base {
12
13
  static get properties(): PropertyDeclarations;
13
14
  customer: Resource<Graph> | null;
15
+ columns: TransactionsTable['columns'];
14
16
  group: string;
15
17
  private readonly __renderHeader;
16
18
  private readonly __renderList;
@@ -9,6 +9,7 @@ export class InternalCustomerPortalTransactions extends Base {
9
9
  constructor() {
10
10
  super(...arguments);
11
11
  this.customer = null;
12
+ this.columns = [];
12
13
  this.group = '';
13
14
  this.__renderHeader = () => {
14
15
  return html `
@@ -48,6 +49,7 @@ export class InternalCustomerPortalTransactions extends Base {
48
49
  ns=${this.ns}
49
50
  manual
50
51
  .templates=${this.getNestedTemplates('table')}
52
+ .props=${{ '.columns': this.columns }}
51
53
  >
52
54
  </foxy-collection-pages>
53
55
 
@@ -60,6 +62,7 @@ export class InternalCustomerPortalTransactions extends Base {
60
62
  return {
61
63
  ...super.properties,
62
64
  customer: { attribute: false },
65
+ columns: { attribute: false },
63
66
  group: { type: String },
64
67
  };
65
68
  }
@@ -1 +1 @@
1
- {"version":3,"file":"InternalCustomerPortalTransactions.js","sourceRoot":"","sources":["../../../../src/elements/public/CustomerPortal/InternalCustomerPortalTransactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAwC,IAAI,EAAE,MAAM,aAAa,CAAC;AAErF,OAAO,EA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UAI7C,IAAI,CAAC,oBAAoB,CAAC,YAAY,CAAC;;KAE5C,CAAC;QACJ,CAAC,CAAC;IAUJ,CAAC;IArEC,MAAM,KAAK,UAAU;QACnB,OAAO;YACL,GAAG,KAAK,CAAC,UAAU;YACnB,QAAQ,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE;YAC9B,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;SACxB,CAAC;IACJ,CAAC;IAuDD,MAAM;QACJ,OAAO,IAAI,CAAA;;UAEL,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,EAAE;UAClE,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE;;KAEnE,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { LitElement, PropertyDeclarations, TemplateResult, html } from 'lit-element';\n\nimport { ConfigurableMixin } from '../../../mixins/configurable';\nimport { Graph } from '@foxy.io/sdk/customer';\nimport { Resource } from '@foxy.io/sdk/core';\nimport { ThemeableMixin } from '../../../mixins/themeable';\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { InferrableMixin } from '../../../mixins/inferrable';\n\nconst NS = 'customer-portal';\nconst Base = ConfigurableMixin(ThemeableMixin(TranslatableMixin(InferrableMixin(LitElement), NS)));\n\nexport class InternalCustomerPortalTransactions extends Base {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n customer: { attribute: false },\n group: { type: String },\n };\n }\n\n customer: Resource<Graph> | null = null;\n\n group = '';\n\n private readonly __renderHeader = () => {\n return html`\n <div>\n ${this.renderTemplateOrSlot('header:before')}\n\n <foxy-i18n\n class=\"text-l font-medium\"\n lang=${this.lang}\n key=\"transaction_plural\"\n ns=${this.ns}\n >\n </foxy-i18n>\n\n ${this.renderTemplateOrSlot('header:after')}\n </div>\n `;\n };\n\n private readonly __renderList = () => {\n let first = '';\n\n if (this.customer) {\n const firstURL = new URL(this.customer._links['fx:transactions'].href);\n firstURL.searchParams.set('zoom', 'items');\n first = firstURL.toString();\n }\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('list:before')}\n\n <foxy-collection-pages\n spinner=\"foxy-spinner\"\n group=${this.group}\n first=${first}\n class=\"block divide-y divide-contrast-10 px-m border border-contrast-10 rounded-t-l rounded-b-l\"\n page=\"foxy-transactions-table\"\n lang=${this.lang}\n ns=${this.ns}\n manual\n .templates=${this.getNestedTemplates('table')}\n >\n </foxy-collection-pages>\n\n ${this.renderTemplateOrSlot('list:after')}\n </div>\n `;\n };\n\n render(): TemplateResult {\n return html`\n <div class=\"space-y-s\" data-testid=\"transactions\">\n ${this.hiddenSelector.matches('header') ? '' : this.__renderHeader()}\n ${this.hiddenSelector.matches('list') ? '' : this.__renderList()}\n </div>\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"InternalCustomerPortalTransactions.js","sourceRoot":"","sources":["../../../../src/elements/public/CustomerPortal/InternalCustomerPortalTransactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAwC,IAAI,EAAE,MAAM,aAAa,CAAC;AAErF,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AAGjE,OAAO,EAAE,cAAc,EAAE,qCAAkC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,eAAe,EAAE,sCAAmC;AAG7D,MAAM,EAAE,GAAG,iBAAiB,CAAC;AAC7B,MAAM,IAAI,GAAG,iBAAiB,CAAC,cAAc,CAAC,iBAAiB,CAAC,eAAe,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AAEnG,MAAM,OAAO,kCAAmC,SAAQ,IAAI;IAA5D;;QAUE,aAAQ,GAA2B,IAAI,CAAC;QAExC,YAAO,GAAiC,EAAE,CAAC;QAE3C,UAAK,GAAG,EA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A;;UAEL,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,EAAE;UAClE,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE;;KAEnE,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { LitElement, PropertyDeclarations, TemplateResult, html } from 'lit-element';\n\nimport { ConfigurableMixin } from '../../../mixins/configurable';\nimport { Graph } from '@foxy.io/sdk/customer';\nimport { Resource } from '@foxy.io/sdk/core';\nimport { ThemeableMixin } from '../../../mixins/themeable';\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { InferrableMixin } from '../../../mixins/inferrable';\nimport { TransactionsTable } from '../TransactionsTable/TransactionsTable';\n\nconst NS = 'customer-portal';\nconst Base = ConfigurableMixin(ThemeableMixin(TranslatableMixin(InferrableMixin(LitElement), NS)));\n\nexport class InternalCustomerPortalTransactions extends Base {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n customer: { attribute: false },\n columns: { attribute: false },\n group: { type: String },\n };\n }\n\n customer: Resource<Graph> | null = null;\n\n columns: TransactionsTable['columns'] = [];\n\n group = '';\n\n private readonly __renderHeader = () => {\n return html`\n <div>\n ${this.renderTemplateOrSlot('header:before')}\n\n <foxy-i18n\n class=\"text-l font-medium\"\n lang=${this.lang}\n key=\"transaction_plural\"\n ns=${this.ns}\n >\n </foxy-i18n>\n\n ${this.renderTemplateOrSlot('header:after')}\n </div>\n `;\n };\n\n private readonly __renderList = () => {\n let first = '';\n\n if (this.customer) {\n const firstURL = new URL(this.customer._links['fx:transactions'].href);\n firstURL.searchParams.set('zoom', 'items');\n first = firstURL.toString();\n }\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('list:before')}\n\n <foxy-collection-pages\n spinner=\"foxy-spinner\"\n group=${this.group}\n first=${first}\n class=\"block divide-y divide-contrast-10 px-m border border-contrast-10 rounded-t-l rounded-b-l\"\n page=\"foxy-transactions-table\"\n lang=${this.lang}\n ns=${this.ns}\n manual\n .templates=${this.getNestedTemplates('table')}\n .props=${{ '.columns': this.columns }}\n >\n </foxy-collection-pages>\n\n ${this.renderTemplateOrSlot('list:after')}\n </div>\n `;\n };\n\n render(): TemplateResult {\n return html`\n <div class=\"space-y-s\" data-testid=\"transactions\">\n ${this.hiddenSelector.matches('header') ? '' : this.__renderHeader()}\n ${this.hiddenSelector.matches('list') ? '' : this.__renderList()}\n </div>\n `;\n }\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@foxy.io/elements",
3
3
  "type": "module",
4
- "version": "1.22.0-beta.5",
4
+ "version": "1.22.0-beta.6",
5
5
  "description": "E-commerce web components by Foxy.",
6
6
  "repository": {
7
7
  "type": "git",