@foxy.io/elements 1.27.0-beta.3 → 1.27.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/foxy-cancellation-form.js +1 -1
- package/dist/cdn/foxy-cart-form.js +1 -1
- package/dist/cdn/foxy-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-coupon-codes-form.js +1 -1
- package/dist/cdn/foxy-coupon-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +2 -2
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-donation.js +1 -1
- package/dist/cdn/foxy-downloadable-form.js +1 -1
- package/dist/cdn/foxy-email-template-form.js +1 -1
- package/dist/cdn/foxy-error-entry-card.js +1 -1
- package/dist/cdn/foxy-generate-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-code-form.js +1 -1
- package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-form.js +1 -1
- package/dist/cdn/foxy-item-category-form.js +1 -1
- package/dist/cdn/foxy-item-form.js +2 -2
- package/dist/cdn/foxy-item-option-form.js +1 -1
- package/dist/cdn/foxy-items-form.js +1 -1
- package/dist/cdn/foxy-native-integration-form.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
- package/dist/cdn/foxy-report-form.js +1 -1
- package/dist/cdn/foxy-store-form.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +1 -1
- package/dist/cdn/foxy-subscription-settings-form.js +1 -1
- package/dist/cdn/foxy-tax-form.js +1 -1
- package/dist/cdn/foxy-template-config-form.js +1 -1
- package/dist/cdn/foxy-template-form.js +1 -1
- package/dist/cdn/foxy-transaction.js +1 -1
- package/dist/cdn/foxy-user-form.js +1 -1
- package/dist/cdn/foxy-users-table.js +1 -1
- package/dist/cdn/{shared-bbc0cdd6.js → shared-5c0e3fee.js} +1 -1
- package/dist/cdn/shared-6e9adc43.js +1 -0
- package/dist/cdn/shared-9de9f905.js +1 -0
- package/dist/cdn/{shared-40bece2b.js → shared-c0c7225c.js} +1 -1
- package/dist/cdn/{shared-352c79a6.js → shared-d7892f27.js} +1 -1
- package/dist/cdn/{shared-6e508e5b.js → shared-e4543605.js} +1 -1
- package/dist/cdn/translations/coupon-codes-form/en.json +12 -14
- package/dist/cdn/translations/coupon-form/en.json +46 -24
- package/dist/cdn/translations/generate-codes-form/en.json +34 -14
- package/dist/cdn/translations/gift-card-codes-form/en.json +18 -19
- package/dist/cdn/translations/gift-card-form/en.json +52 -32
- package/dist/elements/internal/InternalEditableListControl/InternalEditableListControl.js +17 -3
- package/dist/elements/internal/InternalEditableListControl/InternalEditableListControl.js.map +1 -1
- package/dist/elements/internal/InternalIntegerControl/InternalIntegerControl.d.ts +0 -2
- package/dist/elements/internal/InternalIntegerControl/InternalIntegerControl.js +1 -8
- package/dist/elements/internal/InternalIntegerControl/InternalIntegerControl.js.map +1 -1
- package/dist/elements/internal/InternalNumberControl/InternalNumberControl.d.ts +0 -2
- package/dist/elements/internal/InternalNumberControl/InternalNumberControl.js +1 -8
- package/dist/elements/internal/InternalNumberControl/InternalNumberControl.js.map +1 -1
- package/dist/elements/private/Checkbox/Checkbox.d.ts +1 -0
- package/dist/elements/private/Checkbox/Checkbox.js +1 -0
- package/dist/elements/private/Checkbox/Checkbox.js.map +1 -1
- package/dist/elements/private/Choice/Choice.d.ts +1 -0
- package/dist/elements/private/Choice/Choice.js +1 -0
- package/dist/elements/private/Choice/Choice.js.map +1 -1
- package/dist/elements/private/Dropdown/Dropdown.d.ts +1 -0
- package/dist/elements/private/Dropdown/Dropdown.js +1 -0
- package/dist/elements/private/Dropdown/Dropdown.js.map +1 -1
- package/dist/elements/private/EditableList/EditableList.d.ts +1 -0
- package/dist/elements/private/EditableList/EditableList.js +1 -0
- package/dist/elements/private/EditableList/EditableList.js.map +1 -1
- package/dist/elements/private/ErrorScreen/ErrorScreen.d.ts +1 -0
- package/dist/elements/private/ErrorScreen/ErrorScreen.js +1 -0
- package/dist/elements/private/ErrorScreen/ErrorScreen.js.map +1 -1
- package/dist/elements/private/FrequencyInput/FrequencyInput.d.ts +1 -0
- package/dist/elements/private/FrequencyInput/FrequencyInput.js +1 -0
- package/dist/elements/private/FrequencyInput/FrequencyInput.js.map +1 -1
- package/dist/elements/private/Group/Group.d.ts +1 -0
- package/dist/elements/private/Group/Group.js +1 -0
- package/dist/elements/private/Group/Group.js.map +1 -1
- package/dist/elements/private/I18N/I18N.d.ts +1 -0
- package/dist/elements/private/I18N/I18N.js +1 -0
- package/dist/elements/private/I18N/I18N.js.map +1 -1
- package/dist/elements/private/List/List.d.ts +1 -0
- package/dist/elements/private/List/List.js +1 -0
- package/dist/elements/private/List/List.js.map +1 -1
- package/dist/elements/private/LoadingScreen/LoadingScreen.d.ts +1 -0
- package/dist/elements/private/LoadingScreen/LoadingScreen.js +1 -0
- package/dist/elements/private/LoadingScreen/LoadingScreen.js.map +1 -1
- package/dist/elements/private/Metadata/Metadata.d.ts +1 -0
- package/dist/elements/private/Metadata/Metadata.js +1 -0
- package/dist/elements/private/Metadata/Metadata.js.map +1 -1
- package/dist/elements/private/MonthdayPicker/MonthdayPicker.d.ts +1 -0
- package/dist/elements/private/MonthdayPicker/MonthdayPicker.js +1 -0
- package/dist/elements/private/MonthdayPicker/MonthdayPicker.js.map +1 -1
- package/dist/elements/private/Page/Page.d.ts +1 -0
- package/dist/elements/private/Page/Page.js +1 -0
- package/dist/elements/private/Page/Page.js.map +1 -1
- package/dist/elements/private/Section/Section.d.ts +1 -0
- package/dist/elements/private/Section/Section.js +1 -0
- package/dist/elements/private/Section/Section.js.map +1 -1
- package/dist/elements/private/Skeleton/Skeleton.d.ts +1 -0
- package/dist/elements/private/Skeleton/Skeleton.js +1 -0
- package/dist/elements/private/Skeleton/Skeleton.js.map +1 -1
- package/dist/elements/private/Switch/Switch.d.ts +1 -0
- package/dist/elements/private/Switch/Switch.js +1 -0
- package/dist/elements/private/Switch/Switch.js.map +1 -1
- package/dist/elements/private/Tabs/Tabs.d.ts +1 -0
- package/dist/elements/private/Tabs/Tabs.js +1 -0
- package/dist/elements/private/Tabs/Tabs.js.map +1 -1
- package/dist/elements/private/Warning/Warning.d.ts +1 -0
- package/dist/elements/private/Warning/Warning.js +1 -0
- package/dist/elements/private/Warning/Warning.js.map +1 -1
- package/dist/elements/private/WeekdayPicker/WeekdayPicker.d.ts +1 -0
- package/dist/elements/private/WeekdayPicker/WeekdayPicker.js +1 -0
- package/dist/elements/private/WeekdayPicker/WeekdayPicker.js.map +1 -1
- package/dist/elements/public/CancellationForm/CancellationForm.d.ts +1 -0
- package/dist/elements/public/CancellationForm/CancellationForm.js +1 -0
- package/dist/elements/public/CancellationForm/CancellationForm.js.map +1 -1
- package/dist/elements/public/CouponCodesForm/CouponCodesForm.d.ts +17 -17
- package/dist/elements/public/CouponCodesForm/CouponCodesForm.js +42 -196
- package/dist/elements/public/CouponCodesForm/CouponCodesForm.js.map +1 -1
- package/dist/elements/public/CouponCodesForm/index.d.ts +2 -6
- package/dist/elements/public/CouponCodesForm/index.js +2 -8
- package/dist/elements/public/CouponCodesForm/index.js.map +1 -1
- package/dist/elements/public/CouponCodesForm/types.d.ts +8 -8
- package/dist/elements/public/CouponCodesForm/types.js.map +1 -1
- package/dist/elements/public/GenerateCodesForm/GenerateCodesForm.d.ts +14 -18
- package/dist/elements/public/GenerateCodesForm/GenerateCodesForm.js +47 -208
- package/dist/elements/public/GenerateCodesForm/GenerateCodesForm.js.map +1 -1
- package/dist/elements/public/GenerateCodesForm/index.d.ts +5 -6
- package/dist/elements/public/GenerateCodesForm/index.js +5 -6
- package/dist/elements/public/GenerateCodesForm/index.js.map +1 -1
- package/dist/elements/public/GenerateCodesForm/types.d.ts +4 -2
- package/dist/elements/public/GenerateCodesForm/types.js.map +1 -1
- package/dist/elements/public/GiftCardCodesForm/GiftCardCodesForm.d.ts +19 -22
- package/dist/elements/public/GiftCardCodesForm/GiftCardCodesForm.js +44 -239
- package/dist/elements/public/GiftCardCodesForm/GiftCardCodesForm.js.map +1 -1
- package/dist/elements/public/GiftCardCodesForm/index.d.ts +3 -7
- package/dist/elements/public/GiftCardCodesForm/index.js +3 -9
- package/dist/elements/public/GiftCardCodesForm/index.js.map +1 -1
- package/dist/elements/public/GiftCardCodesForm/types.d.ts +6 -4
- package/dist/elements/public/GiftCardCodesForm/types.js.map +1 -1
- package/package.json +1 -1
- package/dist/cdn/shared-0cf90158.js +0 -1
- package/dist/cdn/shared-f53d078e.js +0 -1
- package/dist/elements/public/CouponCodesForm/internal/InternalCouponCodesFormListItem.d.ts +0 -14
- package/dist/elements/public/CouponCodesForm/internal/InternalCouponCodesFormListItem.js +0 -48
- package/dist/elements/public/CouponCodesForm/internal/InternalCouponCodesFormListItem.js.map +0 -1
- package/dist/elements/public/GiftCardCodesForm/internal/InternalGiftCardCodesFormListItem.d.ts +0 -19
- package/dist/elements/public/GiftCardCodesForm/internal/InternalGiftCardCodesFormListItem.js +0 -48
- package/dist/elements/public/GiftCardCodesForm/internal/InternalGiftCardCodesFormListItem.js.map +0 -1
- /package/dist/cdn/{shared-f1afbd7b.js → shared-44d207fb.js} +0 -0
- /package/dist/cdn/{shared-497ebb8c.js → shared-597737ce.js} +0 -0
- /package/dist/cdn/{shared-4cec4de0.js → shared-65283d36.js} +0 -0
- /package/dist/cdn/{shared-5dfec3b7.js → shared-a3c5a30c.js} +0 -0
- /package/dist/cdn/{shared-74adbf9e.js → shared-c6707264.js} +0 -0
- /package/dist/cdn/{shared-9fd64015.js → shared-febda61c.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as e,an as t,ag as s,ai as i,ao as a,_ as n,ap as l,aq as r}from"./shared-1522d76f.js";import"./shared-e40937c5.js";import{B as d}from"./shared-37e1a834.js";import{E as o,F as h}from"./shared-352c79a6.js";import"./shared-cfed658c.js";import"./shared-7039733e.js";import{L as u,h as c,c as _}from"./shared-dc73b9a5.js";import{z as g,y as p,x as m,A as v}from"./shared-331a223c.js";import{a as x,C as y,b as $}from"./shared-40bece2b.js";import"./shared-5df32007.js";import{a as f,I as b,D as w,S as k,M as E,W as C,c as S,t as R}from"./shared-6e508e5b.js";import"./shared-db98729a.js";import"./shared-4482e7b9.js";import{I}from"./shared-44bb85d8.js";import{C as j}from"./shared-f94fa366.js";import"./shared-8ab2ba91.js";import{p as V}from"./shared-f5d4dda0.js";import"./shared-9adc47da.js";import"./shared-fd0a4026.js";import"./shared-655e7c5f.js";import{c as M}from"./shared-4e709717.js";import"./shared-8b80db13.js";import{P as q}from"./shared-a5ecd56e.js";import{G as N}from"./shared-497ebb8c.js";import{D as T}from"./shared-f1afbd7b.js";import{j as D}from"./shared-250a399a.js";import{p as A}from"./shared-43e2c3f6.js";import{W as U}from"./shared-5dfec3b7.js";import{D as O}from"./shared-2376abfc.js";import{c as F}from"./shared-3d251e6f.js";import{i as L}from"./shared-eb116b3e.js";import"./shared-bf695fe7.js";import"./shared-61ade33e.js";import"./shared-f588b5c2.js";import"./shared-99940888.js";import"./shared-07e9d1fb.js";import"./shared-343d1fd7.js";import"./shared-9f570db0.js";import"./shared-9803aa7c.js";import"./shared-30cbf0a6.js";import"./shared-6ed07856.js";import"./shared-3f19b914.js";import"./shared-5ba87b6d.js";import"./shared-651c44fa.js";import"./shared-db306674.js";var B=1/0,z=17976931348623157e292;function P(e){return e?(e=g(e))===B||e===-B?(e<0?-1:1)*z:e==e?e:0:0===e?e:0}function Q(e){return e}var K=Math.floor,J=Math.random;var G=parseFloat,H=Math.min,W=Math.random;function Y(a,n,l){if(l&&"boolean"!=typeof l&&function(a,n,l){if(!e(l))return!1;var r=typeof n;return!!("number"==r?t(l)&&s(n,l.length):"string"==r&&n in l)&&i(l[n],a)}(a,n,l)&&(n=l=void 0),void 0===l&&("boolean"==typeof n?(l=n,n=void 0):"boolean"==typeof a&&(l=a,a=void 0)),void 0===a&&void 0===n?(a=0,n=1):(a=P(a),void 0===n?(n=a,a=0):n=P(n)),a>n){var r=a;a=n,n=r}if(l||a%1||n%1){var d=W();return H(a+d*(n-a+G("1e-"+((d+"").length-1))),n)}return function(e,t){return e+K(J()*(t-e+1))}(a,n)}var X=4294967295,Z=Math.min;function ee(e,t){if(e=function(e){var t=P(e),s=t%1;return t==t?s?t-s:t:0}(e),e<1||e>9007199254740991)return[];var s,i=X,n=Z(e,X);e-=X;for(var l=a(n,t="function"==typeof(s=t)?s:Q);++i<e;)t(i);return l}class te extends CustomEvent{constructor(e){super("change",{detail:e})}}let se,ie,ae=e=>e;class ne extends u{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.getText=e=>e}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean},getText:{type:Object}})}static get styles(){return p.styles}render(){return c(se||(se=ae` <div class="font-lumo text-m w-full"> <ul> ${0} </ul> <div class="p-m"> <slot></slot> </div> </div> `),this.value.map(((e,t)=>c(ie||(ie=ae` <li class="${0}"> <slot name="${0}">${0}</slot> <button ?disabled="${0}" class="w-l h-l rounded text-tertiary transition duration-150 hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </li> `),"ml-m h-l text-body flex justify-between items-center"+(t>0?" border-t border-contrast-10":""),t,this.getText(e),this.disabled,(()=>this.__remove(t))))))}__remove(e){this.value=this.value.filter(((t,s)=>s!==e)),this.dispatchEvent(new te(this.value))}}let le,re,de=e=>e;class oe extends u{static get styles(){return[p.styles,_(le||(le=de`:host{position:absolute;top:0;right:0;bottom:0;left:0}.top-center{top:calc(50% - (var(--lumo-size-xl)/ 2))}@keyframes dash0{from{transform:translate(0,0)}to{transform:translate(5.681301px,3.368302px)}}@keyframes dash1{from{transform:translate(0,0)}to{transform:translate(5.677051px,3.457428px)}}@keyframes dash2{from{transform:translate(0,0)}to{transform:translate(5.686002px,3.127455px)}}@keyframes dash3{from{transform:translate(-5.6842px,-3.404556px)}to{transform:translate(0,0)}}`))]}render(){return c(re||(re=de` <div class="h-full bg-base text-primary"> <svg xmlns="http://www.w3.org/2000/svg" class="fill-current w-xl h-xl mx-auto sticky top-center" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" viewBox="0 0 64 64"> <path id="ew5fy7afo2w2" fill-rule="evenodd" stroke="none" stroke-width="1" d="M41.93 49.46c0 .18-.2.3-.36.2l-1.78-1.07-22.73-13.76a1.5 1.5 0 01-.7-1.3V11.08c0-.18.2-.3.36-.2l1.75 1.04c.44.25.74.75.74 1.32v19.27c0 .08.05.16.12.2L41.22 46c.47.28.73.8.72 1.32v2.15z" clip-rule="evenodd"/> <path id="ew5fy7afo2w3" fill-rule="evenodd" stroke="none" stroke-width="1" d="M47.64 52.9c0 .2-.2.3-.36.21l-1.8-1.08c-.42-.26-.7-.74-.7-1.3v-19.3a.24.24 0 00-.12-.2L25.27 19.47a.24.24 0 00-.37.21v12.55c0 .19-.21.3-.37.2l-1.76-1.06a1.46 1.46 0 01-.71-1.28V16.7c0-.54.27-1.03.71-1.3.45-.27 1-.26 1.44 0l22.72 13.77c.44.26.7.76.7 1.3v20.27l.01 2.17z" clip-rule="evenodd"/> <g style="animation:dash0 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w4" fill-rule="evenodd" stroke="none" stroke-width="1" d="M30.59 35.68c0 .2-.21.3-.37.21l-1.8-1.1c-.41-.27-.68-.74-.68-1.28V27v-2.15c0-.2.2-.3.37-.21l1.78 1.06c.42.26.7.74.7 1.3v8.68z" clip-rule="evenodd"/> </g> <g style="animation:dash1 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w5" fill-rule="evenodd" stroke="none" stroke-width="1" d="M36.28 39.13c0 .2-.2.3-.37.21l-1.79-1.1c-.41-.25-.69-.73-.69-1.28v-6.51-2.16c0-.2.2-.31.37-.21l1.76 1.06c.44.26.73.75.73 1.3v8.69z" clip-rule="evenodd"/> </g> <g style="animation:dash2 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w6" fill-rule="evenodd" stroke="none" stroke-width="1" d="M41.96 42.57c0 .2-.2.3-.37.21L39.8 41.7a1.52 1.52 0 01-.71-1.3v-6.51-2.17c0-.2.2-.31.37-.21l1.74 1.06c.45.25.75.75.75 1.32v8.68z" clip-rule="evenodd"/> </g> <g transform="translate(-5.68 -3.4)" style="animation:dash3 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w7" fill-rule="evenodd" stroke="none" stroke-width="1" d="M30.59 35.68c0 .2-.21.3-.37.21l-1.8-1.1c-.41-.27-.68-.74-.68-1.28V27v-2.15c0-.2.2-.3.37-.21l1.78 1.06c.42.26.7.74.7 1.3v8.68z" clip-rule="evenodd"/> </g> </svg> </div> `))}}let he,ue,ce=e=>e;class _e extends u{static get styles(){return[p.styles,_(he||(he=ce`::slotted(:not([slot])){margin-top:var(--lumo-space-xl)}`))]}render(){return c(ue||(ue=ce` <article class="relative antialiased font-lumo"> <header class="space-y-xs leading-s"> <h1 class="font-medium text-header text-xl border-b border-contrast-10 pb-s mb-s"> <slot name="title"></slot> </h1> <p class="text-l text-secondary"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </article> `))}}let ge,pe,me=e=>e;class ve extends _e{static get styles(){return[super.styles,_(ge||(ge=me`::slotted(:not([slot])){margin-top:var(--lumo-space-m)}`))]}render(){return c(pe||(pe=me` <section class="leading-s antialiased font-lumo"> <header> <h2 class="text-header font-medium text-l"> <slot name="title"></slot> </h2> <p class="text-secondary text-m"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </section> `))}}let xe,ye=e=>e;class $e extends CustomEvent{constructor(e){super("change",{detail:e})}}class fe extends u{constructor(){super(...arguments),this.disabled=!1,this.checked=!1}static get properties(){return n(n({},super.properties),{},{disabled:{attribute:!1},checked:{attribute:!1}})}static get styles(){return p.styles}render(){return c(xe||(xe=ye` <label class="${0}"> <span class="text-body font-medium text-m mr-m"> <slot></slot> </span> <span style="border-radius:var(--lumo-size-xl);width:calc((var(--lumo-space-l) * 2) + (var(--lumo-space-xs) * 2))" class="${0}"> <span style="width:var(--lumo-space-l);height:var(--lumo-space-l)" class="${0}"></span> <input type="checkbox" class="opacity-0 absolute inset-0" .checked="${0}" .disabled="${0}" @change="${0}"> </span> </label> `),M({"transition duration-200 flex justify-between items-center group":!0,"cursor-pointer":!this.disabled}),M({"transition duration-150 relative flex flex-shrink-0 items-center":!0,"bg-success focus-within-shadow-outline-success":!this.disabled&&this.checked,"bg-contrast-10 focus-within-shadow-outline":this.disabled||!this.checked,"bg-contrast-20":!this.disabled&&!this.checked}),M({"bg-tint transition duration-200 transform block rounded-full m-xs":!0,"translate-x-l":this.checked,"translate-x-0":!this.checked,"shadow-xs group-hover-shadow-s group-hover-scale-110":!this.disabled}),this.checked,this.disabled,(()=>{this.checked=!this.checked,this.dispatchEvent(new $e(this.checked))}))}}class be extends Error{constructor(){super("Unhandled request detected. Please add a request handler to connect this component to a backend.")}}class we extends CustomEvent{static emit(e){return new Promise(((t,s)=>{const i=new we(n({resolve:t,reject:s},e));e.source.dispatchEvent(i)&&s(new be)}))}constructor({source:e,resolve:t,reject:s,init:i}){var a;super("request",{cancelable:!0,composed:!0,bubbles:!0,detail:{source:e,handle:async function(e){a.stopImmediatePropagation(),a.preventDefault();try{t(await e(...i))}catch(e){s(e)}}}}),a=this}}let ke,Ee=e=>e;class Ce extends CustomEvent{constructor(e){super("change",{detail:e})}}class Se extends m{constructor(){super(...arguments),this.disabled=!1,this.value=1,this.__errorMessage=null,this.__customFieldI18n={formatValue:e=>{const t=parseInt(e[0]);if(isNaN(t))return"0";const s=e[1];return"w"===s?(10080*t).toFixed(0):"d"===s?(1440*t).toFixed(0):"h"===s?(60*t).toFixed(0):t.toFixed(0)},parseValue:e=>{const t=parseInt(e);return t%10080==0?[(t/10080).toFixed(0),"w"]:t%1440==0?[(t/1440).toFixed(0),"d"]:t%60==0?[(t/60).toFixed(0),"h"]:[t.toFixed(0),"m"]}},this.__renderer=this.__renderItems.bind(this)}static get scopedElements(){return{"vaadin-integer-field":I,"vaadin-custom-field":j,"vaadin-select":f,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){var e;return c(ke||(ke=Ee` <div class="text-xs text-tertiary font-lumo"> <vaadin-custom-field ?disabled="${0}" .label="${0}" .value="${0}" .i18n="${0}" data-testid="field" id="field" @change="${0}"> <vaadin-integer-field .disabled="${0}" .min="${0}" data-testid="count" has-controls> </vaadin-integer-field> <vaadin-select .disabled="${0}" .renderer="${0}" data-testid="units"> </vaadin-select> </vaadin-custom-field> <br> <x-i18n .lang="${0}" .ns="${0}" .key="${0}" data-testid="error" class="${0}"> </x-i18n> </div> `),this.disabled||!this._isI18nReady,this._isI18nReady?this._t("session.title").toString():"---",this._isI18nReady?this.value.toString():"",this.__customFieldI18n,this.__handleChange,this.disabled||!this._isI18nReady,1,this.disabled||!this._isI18nReady,this._isI18nReady?this.__renderer:null,this.lang,this.ns,this._t(`session.${null!==(e=this.__errorMessage)&&void 0!==e?e:"subtitle"}`).toString(),M({"text-error":null!==this.__errorMessage&&!this.disabled}))}firstUpdated(){this.shadowRoot.getElementById("field").value=this.value.toString()}updated(e){e.has("value")&&this.__reportValidity()}__renderItems(e){let t=e.querySelector("vaadin-list-box");null===t&&(t=document.createElement("vaadin-list-box"),e.appendChild(t));const s=["m","h","d","w"],i=["minute_plural","hour_plural","d_plural","w_plural"],a=t.querySelectorAll("vaadin-item");for(let e=0;e<Math.max(s.length,a.length);++e)if(s[e]){let n;a[e]?n=a[e]:(n=document.createElement("vaadin-item"),t.appendChild(n)),n.value=s[e],n.textContent=this._t(i[e])}else a[e].remove()}__handleChange(e){e.stopPropagation(),this.value=parseInt(e.target.value),this.dispatchEvent(new Ce({value:this.value,invalid:!this.__reportValidity()}))}__reportValidity(){return this.__errorMessage=this.value<1?"too_short":this.value>40320?"too_long":null,this.requestUpdate(),null===this.__errorMessage}}let Re,Ie=e=>e;class je extends CustomEvent{constructor(e){super("change",{detail:e})}}class Ve extends m{constructor(){super(...arguments),this.disabled=!1,this.value="",this.__errorMessage=""}static get scopedElements(){return{"vaadin-password-field":q,"vaadin-button":d,"iron-icon":customElements.get("iron-icon"),"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){const e=""!==this.__errorMessage&&!this.disabled,t=e?this._t(`jwt.${this.__errorMessage}`).toString():"";return c(Re||(Re=Ie` <div class="space-y-xs"> <div class="flex items-start"> <vaadin-password-field .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" .label="${0}" data-testid="input" class="w-full" @change="${0}" @input="${0}"> </vaadin-password-field> <vaadin-button class="flex-shrink-0 ml-s" style="margin-top:calc(var(--lumo-font-size-s) * 1.5)" theme="error" data-testid="button" .disabled="${0}" @click="${0}"> <x-i18n .lang="${0}" .ns="${0}" key="jwt.refresh"></x-i18n> <iron-icon icon="icons:refresh" slot="suffix"></iron-icon> </vaadin-button> </div> <x-i18n .lang="${0}" .ns="${0}" key="jwt.subtitle" class="text-xs text-tertiary font-lumo"> </x-i18n> </div> `),t,this.disabled||!this._isI18nReady,e,this._isI18nReady?this.value:"",this._isI18nReady?this._t("jwt.title").toString():"---",(e=>e.stopPropagation()),this.__handleInput,this.disabled||!this._isI18nReady,this.__regenerateValue,this.lang,this.ns,this.lang,this.ns)}updated(e){e.has("value")&&this.__reportValidity()}__regenerateValue(){this.__errorMessage="",this.value=ee(72,(()=>Y(35).toString(36))).join(""),this.dispatchEvent(new je({value:this.value,invalid:!1}))}__handleInput(e){this.value=e.target.value,this.dispatchEvent(new je({value:this.value,invalid:!this.__reportValidity()}))}__reportValidity(){var e;return this.__errorMessage=0===this.value.length?"required":this.value.length<40?"too_short":this.value.length>100?"too_long":(e=this.value,/^[a-z0-9-]+$/i.test(e)?"":"invalid"),this.requestUpdate(),""===this.__errorMessage}}function Me(e){return t=>{t.preventDefault(),e(t)}}class qe extends T{}let Ne,Te=e=>e;class De extends m{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=De.defaultValue,this.__items=["y","m","w","d"]}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-button":customElements.get("vaadin-button"),"x-dropdown":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){return c(Ne||(Ne=Te` <div class="grid grid-cols-2 gap-s"> <vaadin-integer-field data-testid="value" class="w-full" min="1" has-controls .value="${0}" .disabled="${0}" @change="${0}"> </vaadin-integer-field> <x-dropdown data-testid="units" .disabled="${0}" .getText="${0}" .items="${0}" .value="${0}" @change="${0}"> </x-dropdown> </div> `),this._isI18nReady?this.__numericValue:"",this.disabled,this.__handleNumberChange,this.disabled,(e=>this._isI18nReady?this._t(`${e}_plural`):""),this.__items,this._isI18nReady?this.__unitsValue:"",this.__handleUnitsChange)}get __numericValue(){var e;return V(null!==(e=this.value)&&void 0!==e?e:"").count}get __unitsValue(){var e;return V(null!==(e=this.value)&&void 0!==e?e:"").units}__handleNumberChange(e){e.stopPropagation();const t=e.target.value;this.value=this.value.replace(String(this.__numericValue),t),this.__sendChange()}__handleUnitsChange(e){this.value=this.value.replace(String(this.__unitsValue),e.detail),this.__sendChange()}__sendChange(){this.dispatchEvent(new qe(this.value))}}De.defaultValue="1w";class Ae extends te{}let Ue,Oe,Fe,Le,Be=e=>e;class ze extends m{constructor(){super("customer-portal-settings"),this.value=[],this.disabled=!1,this.__newValue=De.defaultValue}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-input":De,"x-skeleton":k,"x-list":ne,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.disabled||!this._isI18nReady||this.value.length>=20;return c(Ue||(Ue=Be` <x-list data-testid="list" .value="${0}" .disabled="${0}" @change="${0}"> ${0} <div class="w-full md-flex"> <x-frequency-input data-testid="input" class="mb-s md-mb-0 md-mr-s" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-input> <vaadin-button data-testid="button" class="w-full md-w-auto" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> </div> ${0} </x-list> `),this.value,this.disabled||!this._isI18nReady,this.__handleListChange,this.value.map(((e,t)=>this._isI18nReady?c(Oe||(Oe=Be`<span slot="${0}">${0}</span>`),t,this.__getText(e)):c(Fe||(Fe=Be`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this.lang,this.__newValue,e,this.__handleNewValueChange,e,this.__handleSubmit,this.ns,this.lang,this.value.length>0?c(Le||(Le=Be` <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,M({"block text-xs mt-xs text-center md-text-left":!0,"text-tertiary":this.value.length<20,"text-primary":this.value.length>=20})):"")}__handleNewValueChange(e){this.__newValue=e.detail}__handleListChange(e){this.value=e.detail,this.__sendChange()}__handleSubmit(){this.value=[...this.value,this.__newValue],this.__newValue=De.defaultValue,this.__sendChange()}__sendChange(){this.dispatchEvent(new Ae(this.value))}__getText(e){const t=e[e.length-1],s=parseInt(e.replace(t,""));return this._t("duration",{count:s,units:this._t(t,{count:s})})}}class Pe extends x{}let Qe,Ke,Je=e=>e;class Ge extends m{constructor(){super(...arguments),this.disabled=!1,this.value="*",this.__errorMessage="",this.__items=["all","some"],this.__handleNewValueChange=v((e=>{try{D(e).evaluate({}),this.value=e,this.__errorMessage="",this.__sendChange()}catch(e){this.__errorMessage=e.message}this.requestUpdate()}),275)}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"iron-icon":customElements.get("iron-icon"),"x-choice":y,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){const e="pl-xs text-primary rounded font-medium cursor-pointer transition duration-200 focus-outline-none focus-shadow-outline hover-underline";return c(Qe||(Qe=Je` <x-choice data-testid="choice" .disabled="${0}" .value="${0}" .items="${0}" @change="${0}"> <x-i18n slot="all-label" .ns="${0}" .lang="${0}" key="jsonata.all"></x-i18n> <x-i18n slot="some-label" .ns="${0}" .lang="${0}" key="jsonata.some"></x-i18n> ${0} </x-choice> `),this.disabled||!this._isI18nReady,this.__choice,this.__items,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.__choice===this.__items[1]?c(Ke||(Ke=Je` <div slot="${0}" class="space-y-s pb-m"> <x-i18n .ns="${0}" .lang="${0}" key="jsonata.hint" class="block font-lumo text-s text-tertiary leading-s"> <a target="_blank" class="${0}" href="https://docs.jsonata.org" rel="noopener noreferrer"> JSONata <iron-icon icon="icons:open-in-new" class="icon-inline"></iron-icon> </a> <a target="_blank" class="${0}" href="https://api.foxycart.com/rels/subscription" rel="noopener noreferrer"> hAPI subscription <iron-icon icon="icons:open-in-new" class="icon-inline"></iron-icon> </a> </x-i18n> <vaadin-text-field class="w-full" data-testid="input" .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" @keydown="${0}" @change="${0}" @input="${0}"> </vaadin-text-field> </div> `),this.__items[1],this.ns,this.lang,e,e,this.__errorMessage,this.disabled||!this._isI18nReady,this.__errorMessage.length>0,this._isI18nReady?this.value:"",this.__stopNavigation,(e=>e.stopPropagation()),(e=>this.__handleNewValueChange(e.target.value))):"")}get __choice(){return this.__items["*"===this.value?0:1]}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?"*":'$contains(frequency, "w")',this.__sendChange()}__stopNavigation(e){e.key.startsWith("Arrow")&&e.stopPropagation()}__sendChange(){this.dispatchEvent(new Pe(this.value))}}class He extends CustomEvent{constructor(e){super("change",{detail:e})}}class We extends CustomEvent{constructor(){super("remove")}}let Ye,Xe,Ze=e=>e;class et extends m{constructor(){super(...arguments),this.open=!1,this.value={jsonataQuery:"*",values:[]},this.disabled=!1}static get scopedElements(){return{"x-frequency-list":ze,"x-jsonata-input":Ge,"iron-icon":customElements.get("iron-icon"),"x-group":N,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{open:{attribute:!1},value:{attribute:!1},disabled:{attribute:!1}})}render(){const{jsonataQuery:e,values:t}=this.value,s=this.open?"":"rounded-b-l";return c(Ye||(Ye=Ze` <x-group frame> <details data-testid="details" class="${0}" ?open="${0}" @toggle="${0}"> <summary class="${0} cursor-pointer relative leading-s rounded-t-l focus-outline-none focus-shadow-outline"> <div class="p-m space-y-xs mr-xl"> <x-i18n .ns="${0}" .lang="${0}" .key="${0}" class="block text-m text-header font-medium"> ${0} </x-i18n> <x-i18n .ns="${0}" .lang="${0}" class="block text-s text-tertiary" key="fmod.valuesLabel"> <x-i18n .ns="${0}" .key="${0}" .lang="${0}" .opts="${0}" class="text-secondary"> </x-i18n> </x-i18n> </div> <button data-testid="remove" .disabled="${0}" class="flex items-center justify-center rounded absolute top-0 right-0 text-tertiary hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" style="width:54px;height:54px" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </summary> <div class="space-y-l pt-m" slot="content"> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="fmod.match"></x-i18n> <x-jsonata-input data-testid="jsonata" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-jsonata-input> </x-group> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="fmod.options"> </x-i18n> <x-frequency-list data-testid="frequency" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-list> </x-group> </div> </details> </x-group> `),M({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),s,this.ns,this.lang,`fmod.${"*"===e?"all":"some"}Title`,"*"!==e?this.__renderJSONataSummary(e):"",this.ns,this.lang,this.ns,"fmod.valuesList"+(0===t.length?"Empty":""),this.lang,{values:t.map((e=>this.__translateFrequency(e)))},this.disabled||!this._isI18nReady,Me((()=>{this.dispatchEvent(new We)})),this.ns,this.lang,this.ns,this.lang,this.value.jsonataQuery,this.disabled||!this._isI18nReady,this.__handleQueryChange,this.ns,this.lang,this.lang,this.value.values,this.disabled||!this._isI18nReady,this.__handleValuesChange)}__translateFrequency(e){if(".5m"===e)return this._t("frequency_0_5m");const{count:t,units:s}=V(e);return this._t("frequency",{units:this._t(s,{count:t}),count:t})}__renderJSONataSummary(e){return c(Xe||(Xe=Ze` <code class="inline-block rounded bg-success-10 text-success px-xs text-xs leading-s"> ${0} </code> `),e)}__handleQueryChange(e){this.value=n(n({},this.value),{},{jsonataQuery:e.detail}),this.__sendChange()}__handleValuesChange(e){this.value=n(n({},this.value),{},{values:e.detail}),this.__sendChange()}__sendChange(){this.dispatchEvent(new He(this.value))}}class tt extends CustomEvent{constructor(e){super("change",{detail:e})}}let st,it,at=e=>e;class nt extends m{constructor(){super(...arguments),this.value=[],this.disabled=!1}static get scopedElements(){return{"x-frequency-modification-rule":et,"vaadin-button":customElements.get("vaadin-button"),"x-section":ve,"iron-icon":customElements.get("iron-icon"),"x-group":N,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const{ns:e,lang:t}=this;return c(st||(st=at` <x-section> <x-i18n .ns="${0}" .lang="${0}" key="fmod.title" slot="title" class="text-l"></x-i18n> <x-i18n .ns="${0}" .lang="${0}" key="fmod.subtitle" slot="subtitle" class="mr-xl"></x-i18n> ${0} <div class="mt-m sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="add" theme="primary" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_rule"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="fmod.add_rule_hint" class="${0}"> </x-i18n> </div> </x-section> `),e,t,e,t,this.value.map(((e,t,s)=>c(it||(it=at` <x-frequency-modification-rule data-testid="rule" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @remove="${0}" @change="${0}"> </x-frequency-modification-rule> `),this.disabled,e,this.lang,this.ns,(()=>{this.value=s.filter(((e,s)=>s!==t)),this.__sendChange()}),(e=>{this.value=s.map(((s,i)=>i===t?e.detail:s)),this.__sendChange()})))),this.disabled||this.value.length>=10||!this._isI18nReady,this.__addRule,this.ns,this.lang,this.lang,this.ns,M({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":this.value.length<10,"text-primary":this.value.length>=10,hidden:0===this.value.length}))}__addRule(){this.value=[...this.value,{jsonataQuery:"*",values:[]}],this.__sendChange()}__sendChange(){this.dispatchEvent(new tt(this.value))}}function lt(e,t){const s=(new Date).getFullYear(),i={month:"long",day:"numeric"};return e.split("..").map((e=>{const a=A(e),l=(null==a?void 0:a.getFullYear())===s?void 0:"numeric";return null==a?void 0:a.toLocaleDateString(t,n({year:l},i))})).join(" – ")}class rt extends CustomEvent{constructor(e){super("change",{detail:e})}}let dt,ot,ht,ut=e=>e;class ct extends m{constructor(){super("customer-portal-settings"),this.disabled=!1,this.__items=["all","month","day"]}static get scopedElements(){return{"x-monthday-picker":E,"x-weekday-picker":C,"x-choice":y,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Object}})}render(){var e,t,s,i;return c(dt||(dt=ut` <x-choice data-testid="choice" .value="${0}" .items="${0}" .disabled="${0}" @change="${0}"> <x-i18n slot="all-label" key="ndmod.all" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="month-label" key="ndmod.month" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="day-label" key="ndmod.day" .ns="${0}" .lang="${0}"></x-i18n> ${0} </x-choice> `),null!==(t=null===(e=this.value)||void 0===e?void 0:e.type)&&void 0!==t?t:"all",this.__items,this.disabled,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,"month"===(null===(s=this.value)||void 0===s?void 0:s.type)?c(ot||(ot=ut` <x-monthday-picker slot="month" class="mb-m" data-testid="monthday-picker" .lang="${0}" .disabled="${0}" .value="${0}" @change="${0}"> </x-monthday-picker> `),this.lang,this.disabled||!this._isI18nReady,this.value.days,this.__handleNewValueChange):"day"===(null===(i=this.value)||void 0===i?void 0:i.type)?c(ht||(ht=ut` <x-weekday-picker slot="day" class="mb-m" data-testid="weekday-picker" .lang="${0}" .disabled="${0}" .value="${0}" @change="${0}"> </x-weekday-picker> `),this.lang,this.disabled||!this._isI18nReady,this.value.days,this.__handleNewValueChange):"")}__handleNewValueChange(e){this.value.days=e.detail,this.__sendChange()}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?void 0:e.detail===this.__items[1]?{type:"month",days:[]}:{type:"day",days:[]},this.__sendChange()}__sendChange(){this.dispatchEvent(new rt(this.value))}}class _t extends te{}let gt,pt,mt,vt,xt=e=>e;class yt extends m{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__startValue="",this.__endValue=""}static get scopedElements(){return{"vaadin-date-picker":O,"vaadin-button":d,"x-skeleton":k,"iron-icon":customElements.get("iron-icon"),"x-i18n":b,"x-list":ne}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.value.length>=20||this.disabled||!this._isI18nReady;return c(gt||(gt=xt` <x-list data-testid="list" .value="${0}" .disabled="${0}" @change="${0}"> ${0} <div class="sm-flex sm-items-end"> <div class="grid grid-cols-2 gap-s"> <vaadin-date-picker data-testid="start" .label="${0}" .value="${0}" .disabled="${0}" .placeholder="${0}" @change="${0}"> </vaadin-date-picker> <vaadin-date-picker data-testid="end" .min="${0}" .label="${0}" .value="${0}" .disabled="${0}" .placeholder="${0}" clear-button-visible @change="${0}"> </vaadin-date-picker> </div> <vaadin-button .disabled="${0}" data-testid="submit" class="w-full mt-s sm-mt-0 sm-w-auto sm-ml-s" @click="${0}"> <x-i18n .lang="${0}" .key="ndmod.add_${0}" .ns="${0}"> </x-i18n> <iron-icon icon="icons:add" slot="suffix"></iron-icon> </vaadin-button> </div> ${0} </x-list> `),this.value,this.disabled||!this._isI18nReady,this.__handleListChange,this.value.map(((e,t)=>this._isI18nReady?c(pt||(pt=xt`<span slot="${0}" class="truncate">${0}</span>`),t,lt(e,this.lang)):c(mt||(mt=xt`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this._t("ndmod.range_start").toString(),this.__startValue,e,this._isI18nReady?this._t("ndmod.select").toString():"",this.__handleStartValueChange,this.__startValue,this._t("ndmod.range_end").toString(),this.__endValue,e||!this.__startValue,this._isI18nReady?this._t("ndmod.select").toString():"",this.__handleEndValueChange,e||!this.__startValue,this.__submit,this.lang,this.__endValue?"range":"single",this.ns,this.value.length>0?c(vt||(vt=xt` <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add_range_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,M({"block text-xs mt-xs text-center sm-text-left":!0,"text-tertiary":this.value.length<20,"text-primary":this.value.length>=20})):"")}updated(){const e=this.constructor.getScopedTagName("vaadin-date-picker"),t=this.shadowRoot.querySelectorAll(e);Array.from(t).forEach((e=>e.validate()))}__handleStartValueChange(e){e.stopPropagation(),this.__startValue=e.target.value;const t=A(this.__endValue),s=A(this.__startValue);t&&t.getTime()<s.getTime()&&(this.__endValue=""),this.requestUpdate()}__handleEndValueChange(e){e.stopPropagation(),this.__endValue=e.target.value,this.requestUpdate()}__submit(){this.__startValue&&this.__endValue?this.value=[...this.value,[this.__startValue,this.__endValue].join("..")]:this.value=[...this.value,this.__startValue],this.__sendChange(),this.__startValue="",this.__endValue=""}__handleListChange(e){this.value=e.detail,this.__sendChange()}__sendChange(){this.dispatchEvent(new _t(this.value))}}class $t extends CustomEvent{constructor(e){super("change",{detail:e})}}let ft,bt,wt=e=>e;class kt extends m{constructor(){super("customer-portal-settings"),this.disabled=!1,this.type="min",this.__items=["none","custom"]}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"x-frequency-input":De,"x-choice":y,"x-group":N,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:String},type:{type:String}})}render(){return c(ft||(ft=wt` <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="${0}"> </x-i18n> <x-choice data-testid="choice" .disabled="${0}" .value="${0}" .items="${0}" @change="${0}"> <x-i18n slot="none-label" .ns="${0}" .lang="${0}" key="ndmod.none"></x-i18n> <x-i18n slot="custom-label" .ns="${0}" .lang="${0}" key="ndmod.custom"></x-i18n> ${0} </x-choice> </x-group> `),this.ns,this.lang,`ndmod.${this.type}`,this.disabled,this.__choice,this.__items,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.__choice===this.__items[1]?c(bt||(bt=wt` <div slot="${0}" class="space-y-s"> <x-frequency-input data-testid="input" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-input> <p class="text-s text-tertiary leading-s">${0}</p> </div> `),this.__items[1],this.value,this.disabled,this.__handleNewValueChange,this.__hint):"")}get __choice(){return this.__items[this.value?1:0]}get __hint(){var e;if(!this._isI18nReady)return"";const{count:t,units:s}=V(null!==(e=this.value)&&void 0!==e?e:"");return this._t(`ndmod.${this.type}Hint`,{duration:this._t("duration",{count:t,units:this._t(null!=s?s:"",{count:t})})})}__handleNewValueChange(e){this.value=e.detail,this.__sendChange()}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?void 0:"1w",this.__sendChange()}__sendChange(){this.dispatchEvent(new $t(this.value))}}class Et extends CustomEvent{constructor(e){super("change",{detail:e})}}class Ct extends CustomEvent{constructor(){super("remove")}}let St,Rt,It,jt,Vt,Mt,qt,Nt,Tt,Dt=e=>e;class At extends m{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value={jsonataQuery:"*"},this.open=!1}static get scopedElements(){return{"x-disallowed-dates":yt,"x-jsonata-input":Ge,"x-offset-input":kt,"x-allowed-days":ct,"iron-icon":customElements.get("iron-icon"),"x-warning":U,"x-group":N,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Object},open:{type:Boolean}})}render(){const{min:e,max:t,allowedDays:s,jsonataQuery:i,disallowedDates:a}=this.value,l=e||t,r=s&&s.days.length>0,d=a&&a.length>0,o=this.open?"":"rounded-b-l";return c(St||(St=Dt` <x-group frame> <details data-testid="details" class="${0}" ?open="${0}" @toggle="${0}"> <summary class="${0} cursor-pointer relative leading-s rounded-t-l focus-outline-none focus-shadow-outline"> <div class="p-m mr-xl text-m text-header font-medium space-y-s"> <div> <x-i18n .ns="${0}" .lang="${0}" key="${0}"> ${0} </x-i18n> </div> ${0} </div> <button data-testid="remove" .disabled="${0}" class="flex items-center justify-center rounded absolute top-0 right-0 text-tertiary hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" style="width:54px;height:54px" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </summary> <article class="space-y-l"> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.match"> </x-i18n> <x-jsonata-input data-testid="jsonata" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-jsonata-input> </x-group> <div class="flex flex-col md-flex-row"> <div class="mb-l md-mb-0 md-w-1-2 md-border-r md-border-contrast-10"> <x-offset-input data-testid="min" type="min" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-offset-input> </div> <div class="md-w-1-2"> <x-offset-input data-testid="max" type="max" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-offset-input> </div> </div> ${0} <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.allowed"> </x-i18n> <x-allowed-days data-testid="allowed" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-allowed-days> </x-group> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.excluded"> </x-i18n> <x-disallowed-dates data-testid="disallowed" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-disallowed-dates> </x-group> </article> </details> </x-group> `),M({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),o,this.ns,this.lang,`ndmod.${"*"===i?"all":"some"}Title`,"*"!==i?this.__renderJSONataSummary(i):"",l||r||d?c(Rt||(Rt=Dt` <div> ${0} </div> `),S(l&&this.__renderMinMaxSummary(e,t),r&&this.__renderAllowedSummary(s),d&&this.__renderDisallowedSummary(a))):"",this.disabled||!this._isI18nReady,Me((()=>this.dispatchEvent(new Ct))),this.ns,this.lang,this.ns,this.lang,i,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{jsonataQuery:e.detail}),this.__sendUpdate()}),this.lang,e,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{min:e.detail}),this.__sendUpdate()}),this.lang,t,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{max:e.detail}),this.__sendUpdate()}),-1===this.__compareDurations(e,t)?c(It||(It=Dt` <x-warning class="mx-m" data-testid="warning"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.minWarning"> </x-i18n> </x-warning> `),this.ns,this.lang):"",this.ns,this.lang,this.lang,s,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{allowedDays:e.detail}),this.__sendUpdate()}),this.ns,this.lang,this.ns,this.lang,null!=a?a:[],this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{disallowedDates:e.detail}),this.__sendUpdate()}))}__sendUpdate(){this.dispatchEvent(new Et(this.value))}__getEstimatedDaysFrom(e){const{count:t,units:s}=V(e);return t*{y:365,m:31,w:7,d:1}[s]}__compareDurations(e,t){return e===t?0:e&&t?this.__getEstimatedDaysFrom(e)<this.__getEstimatedDaysFrom(t)?1:-1:1}__renderJSONataSummary(e){return c(jt||(jt=Dt` <code class="inline-block rounded bg-success-10 text-success px-xs text-xs leading-s"> ${0} </code> `),e)}__renderMinMaxContent(e){if(e){const{count:t,units:s}=e;return c(Vt||(Vt=Dt` ${0} <x-i18n .ns="${0}" .lang="${0}" key="${0}" .opts="${0}"></x-i18n> `),t,this.ns,this.lang,s,{count:t})}return c(Mt||(Mt=Dt`<x-i18n .ns="${0}" .lang="${0}" key="ndmod.any"></x-i18n>`),this.ns,this.lang)}__renderMinMaxSummary(e,t){return c(qt||(qt=Dt` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.range"> <span>:</span> <span class="text-secondary"> ${0} — ${0} </span> </x-i18n> </div> `),this.ns,this.lang,this.__renderMinMaxContent(e?V(e):void 0),this.__renderMinMaxContent(t?V(t):void 0))}__renderAllowedSummary({type:e,days:t}){return c(Nt||(Nt=Dt` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.allowed"> <span>:</span> <span class="text-secondary"> ${0} ${0} </span> </x-i18n> </div> `),this.ns,this.lang,"month"===e?t.join(", "):"","day"===e?t.map((e=>R(e,this.lang,"short"))).join(", "):"")}__renderDisallowedSummary(e){return c(Tt||(Tt=Dt` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.excluded"> <span>:</span> <span class="text-secondary"> ${0} </span> </x-i18n> </div> `),this.ns,this.lang,e.map((e=>lt(e,this.lang))).join("; "))}}class Ut extends CustomEvent{constructor(e){super("change",{detail:e})}}let Ot,Ft,Lt,Bt=e=>e;class zt extends m{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-next-date-modification-rule":At,"vaadin-button":customElements.get("vaadin-button"),"x-section":ve,"iron-icon":customElements.get("iron-icon"),"x-switch":fe,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){const e=!this._isI18nReady||this.disabled||!this.value||Array.isArray(this.value)&&this.value.length>=10;return c(Ot||(Ot=Bt` <x-section> <x-switch slot="title" class="-my-xs" data-testid="toggle" .checked="${0}" .disabled="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.title" class="text-l"></x-i18n> </x-switch> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.subtitle" slot="subtitle" class="mr-xl"> </x-i18n> ${0} <div class="mt-m sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="add" theme="primary" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="ndmod.add_hint" class="${0}"> </x-i18n> </div> </x-section> `),Boolean(this.value),this.disabled||!this._isI18nReady,this.__toggleValue,this.ns,this.lang,this.ns,this.lang,this.value?c(Ft||(Ft=Bt` ${0} `),this.__normalizedValue.map(((e,t,s)=>c(Lt||(Lt=Bt` <x-next-date-modification-rule data-testid="rule" .disabled="${0}" .value="${0}" .lang="${0}" @remove="${0}" @change="${0}"> </x-next-date-modification-rule> `),this.disabled||!this._isI18nReady,e,this.lang,(()=>{this.value=s.filter(((e,s)=>s!==t)),this.__sendChange()}),(e=>{this.value=s.map(((s,i)=>i===t?e.detail:s)),this.__sendChange()}))))):"",e,this.__addRule,this.ns,this.lang,this.lang,this.ns,M({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":Array.isArray(this.value)&&this.value.length<10,"text-primary":Array.isArray(this.value)&&this.value.length>=10,hidden:!Array.isArray(this.value)||0===this.value.length}))}get __normalizedValue(){return"boolean"==typeof this.value?[]:this.value}__addRule(){this.value=[...this.__normalizedValue,{jsonataQuery:"*"}],this.__sendChange()}__toggleValue(){this.value=!this.value,this.__sendChange()}__sendChange(){this.dispatchEvent(new Ut(this.value))}}class Pt extends te{}let Qt,Kt,Jt,Gt=e=>e;class Ht extends m{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__errorCode="invalid",this.__invalid=!1,this.__newValue=""}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-button":customElements.get("vaadin-button"),"x-skeleton":k,"iron-icon":customElements.get("iron-icon"),"x-group":N,"x-list":ne,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},invalid:{type:Boolean},disabled:{type:Boolean}})}render(){return c(Qt||(Qt=Gt` <x-group frame> <x-list data-testid="list" .disabled="${0}" .value="${0}" @change="${0}"> ${0} <div class="flex flex-col sm-flex-row sm-items-start"> <vaadin-text-field data-testid="input" class="mb-s sm-mb-0 sm-mr-s" .placeholder="${0}" .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" @keypress="${0}" @change="${0}" @input="${0}"> </vaadin-text-field> <div class="sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="button" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="origins.add"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="origins.add_hint" class="${0}"> </x-i18n> </div> </div> </x-list> </x-group> `),this.disabled||!this._isI18nReady,this.value,this.__handleChange,this.value.map(((e,t)=>this._isI18nReady?c(Kt||(Kt=Gt` <div class="flex items-center" slot="${0}"> <img height="16" width="16" class="mr-m" src="https://www.google.com/s2/favicons?domain=${0}"> ${0} </div> `),t,e,e):c(Jt||(Jt=Gt`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this._isI18nReady?"https://foxy.io":"",this._t(`origins.${this.__errorCode}`).toString(),this.disabled||!this._isI18nReady,this.__invalid,this.__newValue,(e=>"Enter"===e.key&&this.__submit()),(e=>e.stopPropagation()),this.__handleInput,!this._isI18nReady||this.disabled||this.__invalid||this.value.length>=10,this.__submit,this.ns,this.lang,this.lang,this.ns,M({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":this.value.length<10,"text-primary":this.value.length>=10,hidden:0===this.value.length}))}__sendChange(){this.dispatchEvent(new Pt(this.value))}__handleInput(e){this.__newValue=e.target.value;try{const e=new URL(this.__newValue),t="https:"===e.protocol,s="localhost"===e.hostname;this.__invalid=!s&&!t,this.__errorCode="https_only"}catch(e){this.__invalid=this.__newValue.length>0,this.__errorCode="invalid"}this.requestUpdate()}__submit(){this.__newValue.length>0&&(this.value=[...this.value,new URL(this.__newValue).origin],this.__newValue="",this.__invalid=!1,this.__sendChange()),this.requestUpdate()}__handleChange(e){this.value=e.detail,this.__sendChange()}}class Wt extends CustomEvent{constructor(e){super("change",{detail:e})}}let Yt,Xt=e=>e;class Zt extends m{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-section":ve,"x-switch":fe,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){return c(Yt||(Yt=Xt` <x-section> <x-switch slot="title" class="-my-xs" data-testid="toggle" .checked="${0}" .disabled="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="sso.title" class="text-l"></x-i18n> </x-switch> <x-i18n .ns="${0}" .lang="${0}" key="sso.subtitle" slot="subtitle" class="mr-xl"> </x-i18n> </x-section> `),Boolean(this.value),this.disabled||!this._isI18nReady,this.__toggleValue,this.ns,this.lang,this.ns,this.lang)}__toggleValue(){this.value=!this.value,this.__sendChange()}__sendChange(){this.dispatchEvent(new Wt(this.value))}}const es=$.assign({error:(e,t)=>t.data.type}),ts=$.assign({oldResource:(e,t)=>t.data.resource,newResource:(e,t)=>t.data.resource,store:(e,t)=>t.data.store}),ss=$.assign({oldResource:e=>e.newResource}),is=$.assign({invalid:[],newResource:({oldResource:e})=>e}),as=$.assign({invalid:[],newResource:e=>({allowedOrigins:[],subscriptions:{allowFrequencyModification:[],allowNextDateModification:!1},jwtSharedSecret:ee(72,(()=>Y(35).toString(36))).join(""),sessionLifespanInMinutes:40320,signUp:{enabled:!1,verification:{type:"hcaptcha",siteKey:"",secretKey:""}},sso:!1,date_created:(new Date).toISOString(),date_modified:(new Date).toISOString(),_links:{"fx:store":e.store._links.self,curies:e.store._links.curies,self:e.store._links["fx:customer_portal_settings"]}})}),ns=$.assign({newResource:null}),ls=$.assign({error:"setup_needed"}),rs=$.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{allowedOrigins:s})}}),ds=$.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{subscriptions:n(n({},e.subscriptions),{},{allowFrequencyModification:s})})}}),os=$.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{subscriptions:n(n({},e.subscriptions),{},{allowNextDateModification:s})})}}),hs=$.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{signUp:s})}}),us=$.assign({invalid:(e,t)=>{const s="sessionLifespanInMinutes",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{sessionLifespanInMinutes:s})}}),cs=$.assign({invalid:(e,t)=>{const s="jwtSharedSecret",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{jwtSharedSecret:s})}}),_s=$.assign({oldResource:null,newResource:null,store:null,error:null,href:(e,t)=>t.data}),gs=$.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{sso:s})}}),ps={SET_SSO:{target:"#cps.idle",actions:"setSSO"},SET_SECRET:{target:"#cps.idle",actions:"setSecret"},SET_ORIGINS:{target:"#cps.idle",actions:"setOrigins"},SET_SESSION:{target:"#cps.idle",actions:"setSession"},SET_SIGN_UP:{target:"#cps.idle",actions:"setSignUp"},SET_FREQUENCY_MODIFICATION:{target:"#cps.idle",actions:"setFrequencyModification"},SET_NEXT_DATE_MODIFICATION:{target:"#cps.idle",actions:"setNextDateModification"}},ms={initial:"unknown",states:{unknown:{always:[{target:"invalid",cond:"isInvalid"},{target:"valid"}]},invalid:{},valid:{}}},vs=l({id:"cps",initial:"unknown",context:{oldResource:null,newResource:null,invalid:[],store:null,error:null,href:null},states:{unknown:{always:[{target:"error",cond:"isSetupNeeded",actions:"requireSetup"},{target:"idle",cond:"isLoaded"},{target:"busy"}]},error:{on:{RELOAD:{target:"busy.loading"}}},busy:{initial:"loading",states:{loading:{invoke:{src:"load",onDone:{target:"#cps.idle.clean",actions:"handleLoadingSuccess"},onError:{target:"#cps.error",actions:"handleError"}}},saving:{invoke:{src:"save",onDone:{target:"#cps.idle.clean",actions:"handleSavingSuccess"},onError:{target:"#cps.error",actions:"handleError"}}}}},idle:{initial:"unknown",on:{DISABLE:{target:"#cps.idle",actions:"remove"},ENABLE:{target:"#cps.idle",actions:"create"},RESET:{target:"#cps.idle",actions:"reset"}},states:{unknown:{always:[{target:"clean",cond:"isClean"},{target:"dirty"}]},clean:{initial:"unknown",states:{unknown:{always:[{target:"enabled",cond:"isEnabled"},{target:"disabled"}]},enabled:{on:ps},disabled:{}}},dirty:{on:{SAVE:"#cps.busy.saving"},initial:"unknown",states:{unknown:{always:[{target:"created",cond:"isCreated"},{target:"deleted",cond:"isDeleted"},{target:"updated"}]},created:n({on:ps},ms),updated:n({on:ps},ms),deleted:{}}}}}},on:{SET_HREF:{actions:"setHref",target:"unknown"}}},{guards:{isClean:e=>r(e.newResource,e.oldResource),isLoaded:e=>null!==e.store,isInvalid:e=>e.invalid.length>0,isEnabled:e=>null!==e.oldResource,isCreated:e=>null===e.oldResource&&null!==e.newResource,isDeleted:e=>null!==e.oldResource&&null===e.newResource,isSetupNeeded:e=>null===e.href},actions:{setFrequencyModification:ds,setNextDateModification:os,setOrigins:rs,setSession:us,setSecret:cs,setSignUp:hs,setHref:_s,setSSO:gs,handleLoadingSuccess:ts,handleSavingSuccess:ss,handleError:es,create:as,reset:is,remove:ns,requireSetup:ls}});class xs extends CustomEvent{constructor(e){super("change",{detail:e})}}let ys,$s,fs=e=>e;class bs extends m{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=void 0}static get scopedElements(){return{"vaadin-password-field":q,"x-section":ve,"x-switch":fe,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Object}})}render(){var e,t,s;return c(ys||(ys=fs` <x-section> <x-switch data-testid="toggle" class="-my-xs" slot="title" .disabled="${0}" .checked="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="sign_up.title" class="text-l"></x-i18n> </x-switch> <x-i18n class="mr-xl" slot="subtitle" key="sign_up.subtitle" .lang="${0}" .ns="${0}"> </x-i18n> ${0} </x-section> `),this.disabled||!this._isI18nReady,this.__normalizedValue.enabled,(()=>{const e=this.__normalizedValue;e.enabled=!e.enabled,e.enabled||(e.verification.siteKey="",e.verification.secretKey=""),this.value=e,this.requestUpdate(),this.__sendChange()}),this.ns,this.lang,this.lang,this.ns,(null===(e=this.__normalizedValue)||void 0===e?void 0:e.enabled)?c($s||($s=fs` <div class="grid gap-m sm-grid-cols-2"> <vaadin-password-field .placeholder="${0}" .disabled="${0}" .value="${0}" .label="${0}" autocomplete="off" data-testid="site-key" @change="${0}" @input="${0}"> </vaadin-password-field> <vaadin-password-field .placeholder="${0}" .disabled="${0}" .value="${0}" .label="${0}" autocomplete="off" data-testid="secret-key" @change="${0}" @input="${0}"> </vaadin-password-field> <x-i18n class="sm-col-span-2 text-s text-secondary" lang="${0}" key="sign_up.hcaptcha_explainer" ns="${0}"> </x-i18n> </div> `),this._isI18nReady?this._t("sign_up.site_key_placeholder").toString():"---",this.disabled||!this._isI18nReady,this._isI18nReady?null===(t=this.value)||void 0===t?void 0:t.verification.siteKey:"",this._isI18nReady?this._t("sign_up.site_key_label").toString():"---",(e=>e.stopPropagation()),(e=>{const t=this.__normalizedValue;t.verification.siteKey=e.target.value,this.value=t,this.requestUpdate(),this.__sendChange()}),this._isI18nReady?this._t("sign_up.secret_key_placeholder").toString():"---",this.disabled||!this._isI18nReady,this._isI18nReady?null===(s=this.value)||void 0===s?void 0:s.verification.secretKey:"",this._isI18nReady?this._t("sign_up.secret_key_label").toString():"---",(e=>e.stopPropagation()),(e=>{const t=this.__normalizedValue;t.verification.secretKey=e.target.value,this.value=t,this.requestUpdate(),this.__sendChange()}),this.lang,this.ns):"")}get __normalizedValue(){return this.value?F(this.value):{verification:{type:"hcaptcha",siteKey:"",secretKey:""},enabled:!1}}__sendChange(){this.dispatchEvent(new xs(this.value))}}let ws,ks,Es,Cs,Ss=e=>e;function Rs(e){if(!e.ok)throw new h(401===e.status?"unauthorized":"unknown")}class Is extends CustomEvent{constructor(){super("ready")}}class js extends CustomEvent{constructor(){super("update")}}class Vs extends m{constructor(){super("customer-portal-settings"),this.rel="customer_portal_settings",this.__machine=vs.withConfig({services:{load:()=>this.__load(),save:()=>this.__save()}}),this.__service=L(this.__machine).onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-modification":nt,"x-next-date-modification":zt,"x-session-duration":Se,"x-session-secret":Ve,"x-loading-screen":oe,"x-error-screen":o,"x-origins-list":Ht,"x-sso-switch":Zt,"x-skeleton":k,"x-section":ve,"x-sign-up":bs,"x-switch":fe,"x-i18n":b,"x-page":_e}}static get properties(){return n(n({},super.properties),{},{href:{type:String,noAccessor:!0}})}get href(){return this.__service.state.context.href}set href(e){this.__service.send({type:"SET_HREF",data:e})}render(){var e,t,s,i,a,l;if(this.__service.state.matches("error"))return c(ws||(ws=Ss` <x-error-screen data-testid="error" lang="${0}" type="${0}" reload @reload="${0}"> </x-error-screen> `),this.lang,this.__service.state.context.error,this.__reload);const{newResource:r}=this.__service.state.context,d=this.__service.state.matches("idle.dirty.created"),o=this.__service.state.matches("idle.dirty.deleted"),h=this.__service.state.matches("idle.dirty.updated"),u=this.__service.state.matches("idle.clean.enabled"),_=this.__service.state.matches("idle.dirty.updated.invalid")||this.__service.state.matches("idle.dirty.created.invalid");return c(ks||(ks=Ss` <x-page class="relative"> <x-switch slot="title" data-testid="switch" .disabled="${0}" .checked="${0}" @change="${0}"> <x-i18n key="title" class="text-xxl" .ns="${0}" .lang="${0}"> <sup class="text-tertiary"> <x-i18n key="beta" .ns="${0}" .lang="${0}"> </x-i18n> </sup> </x-i18n> </x-switch> <x-i18n class="block mr-xl" slot="subtitle" key="subtitle" .ns="${0}" .lang="${0}"> </x-i18n> <x-section> <x-i18n slot="title" key="origins.title" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="subtitle" key="origins.subtitle" .ns="${0}" .lang="${0}"></x-i18n> <x-origins-list data-testid="origins" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-origins-list> </x-section> <x-frequency-modification data-testid="fmod" .lang="${0}" .ns="${0}" .value="${0}" ?disabled="${0}" @change="${0}"> </x-frequency-modification> <x-next-date-modification data-testid="ndmod" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-next-date-modification> <x-sso-switch data-testid="sso" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-sso-switch> <x-sign-up data-testid="signup" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-sign-up> <x-section> <x-i18n slot="title" key="advanced.title" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="subtitle" key="advanced.subtitle" .ns="${0}" .lang="${0}"> </x-i18n> <x-session-duration data-testid="session" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-session-duration> <x-session-secret data-testid="secret" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-session-secret> </x-section> ${0} </x-page> `),!this.__service.state.matches("idle")||!this._isI18nReady,u||d||h,(e=>{this.__service.send(e.detail?"ENABLE":"DISABLE")}),this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.lang,this.ns,null!==(e=null==r?void 0:r.allowedOrigins)&&void 0!==e?e:[],!r,(e=>{this.__service.send({type:"SET_ORIGINS",value:e.detail})}),this.lang,this.ns,null!==(t=null==r?void 0:r.subscriptions.allowFrequencyModification)&&void 0!==t?t:[],!r,(e=>{this.__service.send({type:"SET_FREQUENCY_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(s=null==r?void 0:r.subscriptions.allowNextDateModification)&&void 0!==s&&s,!r,(e=>{this.__service.send({type:"SET_NEXT_DATE_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(i=null==r?void 0:r.sso)&&void 0!==i&&i,!r,(e=>{this.__service.send({type:"SET_SSO",value:e.detail})}),!r,null==r?void 0:r.signUp,this.lang,this.ns,(e=>{this.__service.send({type:"SET_SIGN_UP",value:e.detail})}),this.ns,this.lang,this.ns,this.lang,!r||!this._isI18nReady,null!==(a=null==r?void 0:r.sessionLifespanInMinutes)&&void 0!==a?a:1,this.lang,this.ns,(({detail:e})=>{this.__service.send(n({type:"SET_SESSION"},e))}),!r||!this._isI18nReady,null!==(l=null==r?void 0:r.jwtSharedSecret)&&void 0!==l?l:"",this.lang,this.ns,(({detail:e})=>{this.__service.send(n({type:"SET_SECRET"},e))}),this.__service.state.matches("idle.dirty")?c(Es||(Es=Ss` <div class="sticky flex justify-between rounded-t-l rounded-b-l shadow-m -mx-s p-s bg-contrast" style="bottom:var(--lumo-space-m)"> <vaadin-button data-testid="save" theme="primary ${0}" .disabled="${0}" @click="${0}"> <x-i18n lang="${0}" ns="${0}" key="save_${0}"> </x-i18n> </vaadin-button> <vaadin-button style="--lumo-contrast:var(--lumo-base-color)" data-testid="reset" theme="contrast tertiary" @click="${0}"> <x-i18n lang="${0}" key="undo_all"></x-i18n> <iron-icon icon="lumo:reload" slot="suffix"></iron-icon> </vaadin-button> </div> `),o?"error":"success",_,(()=>this.__service.send("SAVE")),this.lang,this.ns,d?"create":o?"delete":"update",(()=>this.__service.send("RESET")),this.lang):this.__service.state.matches("busy")?c(Cs||(Cs=Ss`<x-loading-screen data-testid="loading" class="mt-0"></x-loading-screen>`)):"")}async __reload(){this.__service.stop(),this.__service.onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}async __load(){if(null===this.href)throw new h("setup_needed");try{await this.updateComplete;const e=await we.emit({source:this,init:[this.href]});let t,s;if(e.status.toString().startsWith("4")){t=null;const e=await we.emit({source:this,init:["/"]});Rs(e);const i=(await e.json())._links["fx:store"].href,a=await we.emit({source:this,init:[i]});Rs(a),s=await a.json()}else{Rs(e),t=await e.json();const i=t._links["fx:store"].href,a=await we.emit({source:this,init:[i]});Rs(a),s=await a.json()}return{store:s,resource:t}}catch(e){if(e instanceof h)throw e;if(e instanceof be)throw new h("setup_needed");throw new h("unknown")}finally{await this.updateComplete,this.dispatchEvent(new Is)}}async __save(){try{const e=this.__service.state.context,t=F(e.newResource),s=t?"PUT":"DELETE";t&&(delete t._links,delete t.date_created,delete t.date_modified);const i={method:s,body:t?JSON.stringify(t):void 0};Rs(await we.emit({source:this,init:[this.href,i]}))}catch(e){if(e instanceof h)throw e;if(e instanceof be)throw new h("setup_needed");throw new h("unknown")}finally{await this.updateComplete,this.dispatchEvent(new js)}}}customElements.define("foxy-customer-portal-settings",Vs);export{Vs as CustomerPortalSettings};
|
|
1
|
+
import{d as e,an as t,ag as s,ai as i,ao as a,_ as n,ap as l,aq as r}from"./shared-1522d76f.js";import"./shared-e40937c5.js";import{B as d}from"./shared-37e1a834.js";import{E as o,F as h}from"./shared-d7892f27.js";import"./shared-cfed658c.js";import"./shared-7039733e.js";import{L as u,h as c,c as _}from"./shared-dc73b9a5.js";import{z as g,y as p,x as m,A as v}from"./shared-331a223c.js";import{a as x,C as y,b as $}from"./shared-c0c7225c.js";import"./shared-5df32007.js";import{a as f,I as b,D as w,S as k,M as E,W as C,c as S,t as R}from"./shared-e4543605.js";import"./shared-db98729a.js";import"./shared-4482e7b9.js";import{I}from"./shared-44bb85d8.js";import{C as j}from"./shared-f94fa366.js";import"./shared-8ab2ba91.js";import{p as V}from"./shared-f5d4dda0.js";import"./shared-9adc47da.js";import"./shared-fd0a4026.js";import"./shared-655e7c5f.js";import{c as M}from"./shared-4e709717.js";import"./shared-8b80db13.js";import{P as q}from"./shared-a5ecd56e.js";import{G as N}from"./shared-597737ce.js";import{D as T}from"./shared-44d207fb.js";import{j as D}from"./shared-250a399a.js";import{p as A}from"./shared-43e2c3f6.js";import{W as U}from"./shared-a3c5a30c.js";import{D as O}from"./shared-2376abfc.js";import{c as F}from"./shared-3d251e6f.js";import{i as L}from"./shared-eb116b3e.js";import"./shared-bf695fe7.js";import"./shared-61ade33e.js";import"./shared-f588b5c2.js";import"./shared-99940888.js";import"./shared-07e9d1fb.js";import"./shared-343d1fd7.js";import"./shared-9f570db0.js";import"./shared-9803aa7c.js";import"./shared-30cbf0a6.js";import"./shared-6ed07856.js";import"./shared-3f19b914.js";import"./shared-5ba87b6d.js";import"./shared-651c44fa.js";import"./shared-db306674.js";var B=1/0,z=17976931348623157e292;function P(e){return e?(e=g(e))===B||e===-B?(e<0?-1:1)*z:e==e?e:0:0===e?e:0}function Q(e){return e}var K=Math.floor,J=Math.random;var G=parseFloat,H=Math.min,W=Math.random;function Y(a,n,l){if(l&&"boolean"!=typeof l&&function(a,n,l){if(!e(l))return!1;var r=typeof n;return!!("number"==r?t(l)&&s(n,l.length):"string"==r&&n in l)&&i(l[n],a)}(a,n,l)&&(n=l=void 0),void 0===l&&("boolean"==typeof n?(l=n,n=void 0):"boolean"==typeof a&&(l=a,a=void 0)),void 0===a&&void 0===n?(a=0,n=1):(a=P(a),void 0===n?(n=a,a=0):n=P(n)),a>n){var r=a;a=n,n=r}if(l||a%1||n%1){var d=W();return H(a+d*(n-a+G("1e-"+((d+"").length-1))),n)}return function(e,t){return e+K(J()*(t-e+1))}(a,n)}var X=4294967295,Z=Math.min;function ee(e,t){if(e=function(e){var t=P(e),s=t%1;return t==t?s?t-s:t:0}(e),e<1||e>9007199254740991)return[];var s,i=X,n=Z(e,X);e-=X;for(var l=a(n,t="function"==typeof(s=t)?s:Q);++i<e;)t(i);return l}class te extends CustomEvent{constructor(e){super("change",{detail:e})}}let se,ie,ae=e=>e;class ne extends u{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.getText=e=>e}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean},getText:{type:Object}})}static get styles(){return p.styles}render(){return c(se||(se=ae` <div class="font-lumo text-m w-full"> <ul> ${0} </ul> <div class="p-m"> <slot></slot> </div> </div> `),this.value.map(((e,t)=>c(ie||(ie=ae` <li class="${0}"> <slot name="${0}">${0}</slot> <button ?disabled="${0}" class="w-l h-l rounded text-tertiary transition duration-150 hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </li> `),"ml-m h-l text-body flex justify-between items-center"+(t>0?" border-t border-contrast-10":""),t,this.getText(e),this.disabled,(()=>this.__remove(t))))))}__remove(e){this.value=this.value.filter(((t,s)=>s!==e)),this.dispatchEvent(new te(this.value))}}let le,re,de=e=>e;class oe extends u{static get styles(){return[p.styles,_(le||(le=de`:host{position:absolute;top:0;right:0;bottom:0;left:0}.top-center{top:calc(50% - (var(--lumo-size-xl)/ 2))}@keyframes dash0{from{transform:translate(0,0)}to{transform:translate(5.681301px,3.368302px)}}@keyframes dash1{from{transform:translate(0,0)}to{transform:translate(5.677051px,3.457428px)}}@keyframes dash2{from{transform:translate(0,0)}to{transform:translate(5.686002px,3.127455px)}}@keyframes dash3{from{transform:translate(-5.6842px,-3.404556px)}to{transform:translate(0,0)}}`))]}render(){return c(re||(re=de` <div class="h-full bg-base text-primary"> <svg xmlns="http://www.w3.org/2000/svg" class="fill-current w-xl h-xl mx-auto sticky top-center" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" viewBox="0 0 64 64"> <path id="ew5fy7afo2w2" fill-rule="evenodd" stroke="none" stroke-width="1" d="M41.93 49.46c0 .18-.2.3-.36.2l-1.78-1.07-22.73-13.76a1.5 1.5 0 01-.7-1.3V11.08c0-.18.2-.3.36-.2l1.75 1.04c.44.25.74.75.74 1.32v19.27c0 .08.05.16.12.2L41.22 46c.47.28.73.8.72 1.32v2.15z" clip-rule="evenodd"/> <path id="ew5fy7afo2w3" fill-rule="evenodd" stroke="none" stroke-width="1" d="M47.64 52.9c0 .2-.2.3-.36.21l-1.8-1.08c-.42-.26-.7-.74-.7-1.3v-19.3a.24.24 0 00-.12-.2L25.27 19.47a.24.24 0 00-.37.21v12.55c0 .19-.21.3-.37.2l-1.76-1.06a1.46 1.46 0 01-.71-1.28V16.7c0-.54.27-1.03.71-1.3.45-.27 1-.26 1.44 0l22.72 13.77c.44.26.7.76.7 1.3v20.27l.01 2.17z" clip-rule="evenodd"/> <g style="animation:dash0 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w4" fill-rule="evenodd" stroke="none" stroke-width="1" d="M30.59 35.68c0 .2-.21.3-.37.21l-1.8-1.1c-.41-.27-.68-.74-.68-1.28V27v-2.15c0-.2.2-.3.37-.21l1.78 1.06c.42.26.7.74.7 1.3v8.68z" clip-rule="evenodd"/> </g> <g style="animation:dash1 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w5" fill-rule="evenodd" stroke="none" stroke-width="1" d="M36.28 39.13c0 .2-.2.3-.37.21l-1.79-1.1c-.41-.25-.69-.73-.69-1.28v-6.51-2.16c0-.2.2-.31.37-.21l1.76 1.06c.44.26.73.75.73 1.3v8.69z" clip-rule="evenodd"/> </g> <g style="animation:dash2 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w6" fill-rule="evenodd" stroke="none" stroke-width="1" d="M41.96 42.57c0 .2-.2.3-.37.21L39.8 41.7a1.52 1.52 0 01-.71-1.3v-6.51-2.17c0-.2.2-.31.37-.21l1.74 1.06c.45.25.75.75.75 1.32v8.68z" clip-rule="evenodd"/> </g> <g transform="translate(-5.68 -3.4)" style="animation:dash3 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w7" fill-rule="evenodd" stroke="none" stroke-width="1" d="M30.59 35.68c0 .2-.21.3-.37.21l-1.8-1.1c-.41-.27-.68-.74-.68-1.28V27v-2.15c0-.2.2-.3.37-.21l1.78 1.06c.42.26.7.74.7 1.3v8.68z" clip-rule="evenodd"/> </g> </svg> </div> `))}}let he,ue,ce=e=>e;class _e extends u{static get styles(){return[p.styles,_(he||(he=ce`::slotted(:not([slot])){margin-top:var(--lumo-space-xl)}`))]}render(){return c(ue||(ue=ce` <article class="relative antialiased font-lumo"> <header class="space-y-xs leading-s"> <h1 class="font-medium text-header text-xl border-b border-contrast-10 pb-s mb-s"> <slot name="title"></slot> </h1> <p class="text-l text-secondary"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </article> `))}}let ge,pe,me=e=>e;class ve extends _e{static get styles(){return[super.styles,_(ge||(ge=me`::slotted(:not([slot])){margin-top:var(--lumo-space-m)}`))]}render(){return c(pe||(pe=me` <section class="leading-s antialiased font-lumo"> <header> <h2 class="text-header font-medium text-l"> <slot name="title"></slot> </h2> <p class="text-secondary text-m"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </section> `))}}let xe,ye=e=>e;class $e extends CustomEvent{constructor(e){super("change",{detail:e})}}class fe extends u{constructor(){super(...arguments),this.disabled=!1,this.checked=!1}static get properties(){return n(n({},super.properties),{},{disabled:{attribute:!1},checked:{attribute:!1}})}static get styles(){return p.styles}render(){return c(xe||(xe=ye` <label class="${0}"> <span class="text-body font-medium text-m mr-m"> <slot></slot> </span> <span style="border-radius:var(--lumo-size-xl);width:calc((var(--lumo-space-l) * 2) + (var(--lumo-space-xs) * 2))" class="${0}"> <span style="width:var(--lumo-space-l);height:var(--lumo-space-l)" class="${0}"></span> <input type="checkbox" class="opacity-0 absolute inset-0" .checked="${0}" .disabled="${0}" @change="${0}"> </span> </label> `),M({"transition duration-200 flex justify-between items-center group":!0,"cursor-pointer":!this.disabled}),M({"transition duration-150 relative flex flex-shrink-0 items-center":!0,"bg-success focus-within-shadow-outline-success":!this.disabled&&this.checked,"bg-contrast-10 focus-within-shadow-outline":this.disabled||!this.checked,"bg-contrast-20":!this.disabled&&!this.checked}),M({"bg-tint transition duration-200 transform block rounded-full m-xs":!0,"translate-x-l":this.checked,"translate-x-0":!this.checked,"shadow-xs group-hover-shadow-s group-hover-scale-110":!this.disabled}),this.checked,this.disabled,(()=>{this.checked=!this.checked,this.dispatchEvent(new $e(this.checked))}))}}class be extends Error{constructor(){super("Unhandled request detected. Please add a request handler to connect this component to a backend.")}}class we extends CustomEvent{static emit(e){return new Promise(((t,s)=>{const i=new we(n({resolve:t,reject:s},e));e.source.dispatchEvent(i)&&s(new be)}))}constructor({source:e,resolve:t,reject:s,init:i}){var a;super("request",{cancelable:!0,composed:!0,bubbles:!0,detail:{source:e,handle:async function(e){a.stopImmediatePropagation(),a.preventDefault();try{t(await e(...i))}catch(e){s(e)}}}}),a=this}}let ke,Ee=e=>e;class Ce extends CustomEvent{constructor(e){super("change",{detail:e})}}class Se extends m{constructor(){super(...arguments),this.disabled=!1,this.value=1,this.__errorMessage=null,this.__customFieldI18n={formatValue:e=>{const t=parseInt(e[0]);if(isNaN(t))return"0";const s=e[1];return"w"===s?(10080*t).toFixed(0):"d"===s?(1440*t).toFixed(0):"h"===s?(60*t).toFixed(0):t.toFixed(0)},parseValue:e=>{const t=parseInt(e);return t%10080==0?[(t/10080).toFixed(0),"w"]:t%1440==0?[(t/1440).toFixed(0),"d"]:t%60==0?[(t/60).toFixed(0),"h"]:[t.toFixed(0),"m"]}},this.__renderer=this.__renderItems.bind(this)}static get scopedElements(){return{"vaadin-integer-field":I,"vaadin-custom-field":j,"vaadin-select":f,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){var e;return c(ke||(ke=Ee` <div class="text-xs text-tertiary font-lumo"> <vaadin-custom-field ?disabled="${0}" .label="${0}" .value="${0}" .i18n="${0}" data-testid="field" id="field" @change="${0}"> <vaadin-integer-field .disabled="${0}" .min="${0}" data-testid="count" has-controls> </vaadin-integer-field> <vaadin-select .disabled="${0}" .renderer="${0}" data-testid="units"> </vaadin-select> </vaadin-custom-field> <br> <x-i18n .lang="${0}" .ns="${0}" .key="${0}" data-testid="error" class="${0}"> </x-i18n> </div> `),this.disabled||!this._isI18nReady,this._isI18nReady?this._t("session.title").toString():"---",this._isI18nReady?this.value.toString():"",this.__customFieldI18n,this.__handleChange,this.disabled||!this._isI18nReady,1,this.disabled||!this._isI18nReady,this._isI18nReady?this.__renderer:null,this.lang,this.ns,this._t(`session.${null!==(e=this.__errorMessage)&&void 0!==e?e:"subtitle"}`).toString(),M({"text-error":null!==this.__errorMessage&&!this.disabled}))}firstUpdated(){this.shadowRoot.getElementById("field").value=this.value.toString()}updated(e){e.has("value")&&this.__reportValidity()}__renderItems(e){let t=e.querySelector("vaadin-list-box");null===t&&(t=document.createElement("vaadin-list-box"),e.appendChild(t));const s=["m","h","d","w"],i=["minute_plural","hour_plural","d_plural","w_plural"],a=t.querySelectorAll("vaadin-item");for(let e=0;e<Math.max(s.length,a.length);++e)if(s[e]){let n;a[e]?n=a[e]:(n=document.createElement("vaadin-item"),t.appendChild(n)),n.value=s[e],n.textContent=this._t(i[e])}else a[e].remove()}__handleChange(e){e.stopPropagation(),this.value=parseInt(e.target.value),this.dispatchEvent(new Ce({value:this.value,invalid:!this.__reportValidity()}))}__reportValidity(){return this.__errorMessage=this.value<1?"too_short":this.value>40320?"too_long":null,this.requestUpdate(),null===this.__errorMessage}}let Re,Ie=e=>e;class je extends CustomEvent{constructor(e){super("change",{detail:e})}}class Ve extends m{constructor(){super(...arguments),this.disabled=!1,this.value="",this.__errorMessage=""}static get scopedElements(){return{"vaadin-password-field":q,"vaadin-button":d,"iron-icon":customElements.get("iron-icon"),"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){const e=""!==this.__errorMessage&&!this.disabled,t=e?this._t(`jwt.${this.__errorMessage}`).toString():"";return c(Re||(Re=Ie` <div class="space-y-xs"> <div class="flex items-start"> <vaadin-password-field .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" .label="${0}" data-testid="input" class="w-full" @change="${0}" @input="${0}"> </vaadin-password-field> <vaadin-button class="flex-shrink-0 ml-s" style="margin-top:calc(var(--lumo-font-size-s) * 1.5)" theme="error" data-testid="button" .disabled="${0}" @click="${0}"> <x-i18n .lang="${0}" .ns="${0}" key="jwt.refresh"></x-i18n> <iron-icon icon="icons:refresh" slot="suffix"></iron-icon> </vaadin-button> </div> <x-i18n .lang="${0}" .ns="${0}" key="jwt.subtitle" class="text-xs text-tertiary font-lumo"> </x-i18n> </div> `),t,this.disabled||!this._isI18nReady,e,this._isI18nReady?this.value:"",this._isI18nReady?this._t("jwt.title").toString():"---",(e=>e.stopPropagation()),this.__handleInput,this.disabled||!this._isI18nReady,this.__regenerateValue,this.lang,this.ns,this.lang,this.ns)}updated(e){e.has("value")&&this.__reportValidity()}__regenerateValue(){this.__errorMessage="",this.value=ee(72,(()=>Y(35).toString(36))).join(""),this.dispatchEvent(new je({value:this.value,invalid:!1}))}__handleInput(e){this.value=e.target.value,this.dispatchEvent(new je({value:this.value,invalid:!this.__reportValidity()}))}__reportValidity(){var e;return this.__errorMessage=0===this.value.length?"required":this.value.length<40?"too_short":this.value.length>100?"too_long":(e=this.value,/^[a-z0-9-]+$/i.test(e)?"":"invalid"),this.requestUpdate(),""===this.__errorMessage}}function Me(e){return t=>{t.preventDefault(),e(t)}}class qe extends T{}let Ne,Te=e=>e;class De extends m{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=De.defaultValue,this.__items=["y","m","w","d"]}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-button":customElements.get("vaadin-button"),"x-dropdown":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){return c(Ne||(Ne=Te` <div class="grid grid-cols-2 gap-s"> <vaadin-integer-field data-testid="value" class="w-full" min="1" has-controls .value="${0}" .disabled="${0}" @change="${0}"> </vaadin-integer-field> <x-dropdown data-testid="units" .disabled="${0}" .getText="${0}" .items="${0}" .value="${0}" @change="${0}"> </x-dropdown> </div> `),this._isI18nReady?this.__numericValue:"",this.disabled,this.__handleNumberChange,this.disabled,(e=>this._isI18nReady?this._t(`${e}_plural`):""),this.__items,this._isI18nReady?this.__unitsValue:"",this.__handleUnitsChange)}get __numericValue(){var e;return V(null!==(e=this.value)&&void 0!==e?e:"").count}get __unitsValue(){var e;return V(null!==(e=this.value)&&void 0!==e?e:"").units}__handleNumberChange(e){e.stopPropagation();const t=e.target.value;this.value=this.value.replace(String(this.__numericValue),t),this.__sendChange()}__handleUnitsChange(e){this.value=this.value.replace(String(this.__unitsValue),e.detail),this.__sendChange()}__sendChange(){this.dispatchEvent(new qe(this.value))}}De.defaultValue="1w";class Ae extends te{}let Ue,Oe,Fe,Le,Be=e=>e;class ze extends m{constructor(){super("customer-portal-settings"),this.value=[],this.disabled=!1,this.__newValue=De.defaultValue}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-input":De,"x-skeleton":k,"x-list":ne,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.disabled||!this._isI18nReady||this.value.length>=20;return c(Ue||(Ue=Be` <x-list data-testid="list" .value="${0}" .disabled="${0}" @change="${0}"> ${0} <div class="w-full md-flex"> <x-frequency-input data-testid="input" class="mb-s md-mb-0 md-mr-s" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-input> <vaadin-button data-testid="button" class="w-full md-w-auto" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> </div> ${0} </x-list> `),this.value,this.disabled||!this._isI18nReady,this.__handleListChange,this.value.map(((e,t)=>this._isI18nReady?c(Oe||(Oe=Be`<span slot="${0}">${0}</span>`),t,this.__getText(e)):c(Fe||(Fe=Be`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this.lang,this.__newValue,e,this.__handleNewValueChange,e,this.__handleSubmit,this.ns,this.lang,this.value.length>0?c(Le||(Le=Be` <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,M({"block text-xs mt-xs text-center md-text-left":!0,"text-tertiary":this.value.length<20,"text-primary":this.value.length>=20})):"")}__handleNewValueChange(e){this.__newValue=e.detail}__handleListChange(e){this.value=e.detail,this.__sendChange()}__handleSubmit(){this.value=[...this.value,this.__newValue],this.__newValue=De.defaultValue,this.__sendChange()}__sendChange(){this.dispatchEvent(new Ae(this.value))}__getText(e){const t=e[e.length-1],s=parseInt(e.replace(t,""));return this._t("duration",{count:s,units:this._t(t,{count:s})})}}class Pe extends x{}let Qe,Ke,Je=e=>e;class Ge extends m{constructor(){super(...arguments),this.disabled=!1,this.value="*",this.__errorMessage="",this.__items=["all","some"],this.__handleNewValueChange=v((e=>{try{D(e).evaluate({}),this.value=e,this.__errorMessage="",this.__sendChange()}catch(e){this.__errorMessage=e.message}this.requestUpdate()}),275)}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"iron-icon":customElements.get("iron-icon"),"x-choice":y,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){const e="pl-xs text-primary rounded font-medium cursor-pointer transition duration-200 focus-outline-none focus-shadow-outline hover-underline";return c(Qe||(Qe=Je` <x-choice data-testid="choice" .disabled="${0}" .value="${0}" .items="${0}" @change="${0}"> <x-i18n slot="all-label" .ns="${0}" .lang="${0}" key="jsonata.all"></x-i18n> <x-i18n slot="some-label" .ns="${0}" .lang="${0}" key="jsonata.some"></x-i18n> ${0} </x-choice> `),this.disabled||!this._isI18nReady,this.__choice,this.__items,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.__choice===this.__items[1]?c(Ke||(Ke=Je` <div slot="${0}" class="space-y-s pb-m"> <x-i18n .ns="${0}" .lang="${0}" key="jsonata.hint" class="block font-lumo text-s text-tertiary leading-s"> <a target="_blank" class="${0}" href="https://docs.jsonata.org" rel="noopener noreferrer"> JSONata <iron-icon icon="icons:open-in-new" class="icon-inline"></iron-icon> </a> <a target="_blank" class="${0}" href="https://api.foxycart.com/rels/subscription" rel="noopener noreferrer"> hAPI subscription <iron-icon icon="icons:open-in-new" class="icon-inline"></iron-icon> </a> </x-i18n> <vaadin-text-field class="w-full" data-testid="input" .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" @keydown="${0}" @change="${0}" @input="${0}"> </vaadin-text-field> </div> `),this.__items[1],this.ns,this.lang,e,e,this.__errorMessage,this.disabled||!this._isI18nReady,this.__errorMessage.length>0,this._isI18nReady?this.value:"",this.__stopNavigation,(e=>e.stopPropagation()),(e=>this.__handleNewValueChange(e.target.value))):"")}get __choice(){return this.__items["*"===this.value?0:1]}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?"*":'$contains(frequency, "w")',this.__sendChange()}__stopNavigation(e){e.key.startsWith("Arrow")&&e.stopPropagation()}__sendChange(){this.dispatchEvent(new Pe(this.value))}}class He extends CustomEvent{constructor(e){super("change",{detail:e})}}class We extends CustomEvent{constructor(){super("remove")}}let Ye,Xe,Ze=e=>e;class et extends m{constructor(){super(...arguments),this.open=!1,this.value={jsonataQuery:"*",values:[]},this.disabled=!1}static get scopedElements(){return{"x-frequency-list":ze,"x-jsonata-input":Ge,"iron-icon":customElements.get("iron-icon"),"x-group":N,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{open:{attribute:!1},value:{attribute:!1},disabled:{attribute:!1}})}render(){const{jsonataQuery:e,values:t}=this.value,s=this.open?"":"rounded-b-l";return c(Ye||(Ye=Ze` <x-group frame> <details data-testid="details" class="${0}" ?open="${0}" @toggle="${0}"> <summary class="${0} cursor-pointer relative leading-s rounded-t-l focus-outline-none focus-shadow-outline"> <div class="p-m space-y-xs mr-xl"> <x-i18n .ns="${0}" .lang="${0}" .key="${0}" class="block text-m text-header font-medium"> ${0} </x-i18n> <x-i18n .ns="${0}" .lang="${0}" class="block text-s text-tertiary" key="fmod.valuesLabel"> <x-i18n .ns="${0}" .key="${0}" .lang="${0}" .opts="${0}" class="text-secondary"> </x-i18n> </x-i18n> </div> <button data-testid="remove" .disabled="${0}" class="flex items-center justify-center rounded absolute top-0 right-0 text-tertiary hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" style="width:54px;height:54px" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </summary> <div class="space-y-l pt-m" slot="content"> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="fmod.match"></x-i18n> <x-jsonata-input data-testid="jsonata" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-jsonata-input> </x-group> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="fmod.options"> </x-i18n> <x-frequency-list data-testid="frequency" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-list> </x-group> </div> </details> </x-group> `),M({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),s,this.ns,this.lang,`fmod.${"*"===e?"all":"some"}Title`,"*"!==e?this.__renderJSONataSummary(e):"",this.ns,this.lang,this.ns,"fmod.valuesList"+(0===t.length?"Empty":""),this.lang,{values:t.map((e=>this.__translateFrequency(e)))},this.disabled||!this._isI18nReady,Me((()=>{this.dispatchEvent(new We)})),this.ns,this.lang,this.ns,this.lang,this.value.jsonataQuery,this.disabled||!this._isI18nReady,this.__handleQueryChange,this.ns,this.lang,this.lang,this.value.values,this.disabled||!this._isI18nReady,this.__handleValuesChange)}__translateFrequency(e){if(".5m"===e)return this._t("frequency_0_5m");const{count:t,units:s}=V(e);return this._t("frequency",{units:this._t(s,{count:t}),count:t})}__renderJSONataSummary(e){return c(Xe||(Xe=Ze` <code class="inline-block rounded bg-success-10 text-success px-xs text-xs leading-s"> ${0} </code> `),e)}__handleQueryChange(e){this.value=n(n({},this.value),{},{jsonataQuery:e.detail}),this.__sendChange()}__handleValuesChange(e){this.value=n(n({},this.value),{},{values:e.detail}),this.__sendChange()}__sendChange(){this.dispatchEvent(new He(this.value))}}class tt extends CustomEvent{constructor(e){super("change",{detail:e})}}let st,it,at=e=>e;class nt extends m{constructor(){super(...arguments),this.value=[],this.disabled=!1}static get scopedElements(){return{"x-frequency-modification-rule":et,"vaadin-button":customElements.get("vaadin-button"),"x-section":ve,"iron-icon":customElements.get("iron-icon"),"x-group":N,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const{ns:e,lang:t}=this;return c(st||(st=at` <x-section> <x-i18n .ns="${0}" .lang="${0}" key="fmod.title" slot="title" class="text-l"></x-i18n> <x-i18n .ns="${0}" .lang="${0}" key="fmod.subtitle" slot="subtitle" class="mr-xl"></x-i18n> ${0} <div class="mt-m sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="add" theme="primary" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_rule"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="fmod.add_rule_hint" class="${0}"> </x-i18n> </div> </x-section> `),e,t,e,t,this.value.map(((e,t,s)=>c(it||(it=at` <x-frequency-modification-rule data-testid="rule" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @remove="${0}" @change="${0}"> </x-frequency-modification-rule> `),this.disabled,e,this.lang,this.ns,(()=>{this.value=s.filter(((e,s)=>s!==t)),this.__sendChange()}),(e=>{this.value=s.map(((s,i)=>i===t?e.detail:s)),this.__sendChange()})))),this.disabled||this.value.length>=10||!this._isI18nReady,this.__addRule,this.ns,this.lang,this.lang,this.ns,M({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":this.value.length<10,"text-primary":this.value.length>=10,hidden:0===this.value.length}))}__addRule(){this.value=[...this.value,{jsonataQuery:"*",values:[]}],this.__sendChange()}__sendChange(){this.dispatchEvent(new tt(this.value))}}function lt(e,t){const s=(new Date).getFullYear(),i={month:"long",day:"numeric"};return e.split("..").map((e=>{const a=A(e),l=(null==a?void 0:a.getFullYear())===s?void 0:"numeric";return null==a?void 0:a.toLocaleDateString(t,n({year:l},i))})).join(" – ")}class rt extends CustomEvent{constructor(e){super("change",{detail:e})}}let dt,ot,ht,ut=e=>e;class ct extends m{constructor(){super("customer-portal-settings"),this.disabled=!1,this.__items=["all","month","day"]}static get scopedElements(){return{"x-monthday-picker":E,"x-weekday-picker":C,"x-choice":y,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Object}})}render(){var e,t,s,i;return c(dt||(dt=ut` <x-choice data-testid="choice" .value="${0}" .items="${0}" .disabled="${0}" @change="${0}"> <x-i18n slot="all-label" key="ndmod.all" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="month-label" key="ndmod.month" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="day-label" key="ndmod.day" .ns="${0}" .lang="${0}"></x-i18n> ${0} </x-choice> `),null!==(t=null===(e=this.value)||void 0===e?void 0:e.type)&&void 0!==t?t:"all",this.__items,this.disabled,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,"month"===(null===(s=this.value)||void 0===s?void 0:s.type)?c(ot||(ot=ut` <x-monthday-picker slot="month" class="mb-m" data-testid="monthday-picker" .lang="${0}" .disabled="${0}" .value="${0}" @change="${0}"> </x-monthday-picker> `),this.lang,this.disabled||!this._isI18nReady,this.value.days,this.__handleNewValueChange):"day"===(null===(i=this.value)||void 0===i?void 0:i.type)?c(ht||(ht=ut` <x-weekday-picker slot="day" class="mb-m" data-testid="weekday-picker" .lang="${0}" .disabled="${0}" .value="${0}" @change="${0}"> </x-weekday-picker> `),this.lang,this.disabled||!this._isI18nReady,this.value.days,this.__handleNewValueChange):"")}__handleNewValueChange(e){this.value.days=e.detail,this.__sendChange()}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?void 0:e.detail===this.__items[1]?{type:"month",days:[]}:{type:"day",days:[]},this.__sendChange()}__sendChange(){this.dispatchEvent(new rt(this.value))}}class _t extends te{}let gt,pt,mt,vt,xt=e=>e;class yt extends m{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__startValue="",this.__endValue=""}static get scopedElements(){return{"vaadin-date-picker":O,"vaadin-button":d,"x-skeleton":k,"iron-icon":customElements.get("iron-icon"),"x-i18n":b,"x-list":ne}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.value.length>=20||this.disabled||!this._isI18nReady;return c(gt||(gt=xt` <x-list data-testid="list" .value="${0}" .disabled="${0}" @change="${0}"> ${0} <div class="sm-flex sm-items-end"> <div class="grid grid-cols-2 gap-s"> <vaadin-date-picker data-testid="start" .label="${0}" .value="${0}" .disabled="${0}" .placeholder="${0}" @change="${0}"> </vaadin-date-picker> <vaadin-date-picker data-testid="end" .min="${0}" .label="${0}" .value="${0}" .disabled="${0}" .placeholder="${0}" clear-button-visible @change="${0}"> </vaadin-date-picker> </div> <vaadin-button .disabled="${0}" data-testid="submit" class="w-full mt-s sm-mt-0 sm-w-auto sm-ml-s" @click="${0}"> <x-i18n .lang="${0}" .key="ndmod.add_${0}" .ns="${0}"> </x-i18n> <iron-icon icon="icons:add" slot="suffix"></iron-icon> </vaadin-button> </div> ${0} </x-list> `),this.value,this.disabled||!this._isI18nReady,this.__handleListChange,this.value.map(((e,t)=>this._isI18nReady?c(pt||(pt=xt`<span slot="${0}" class="truncate">${0}</span>`),t,lt(e,this.lang)):c(mt||(mt=xt`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this._t("ndmod.range_start").toString(),this.__startValue,e,this._isI18nReady?this._t("ndmod.select").toString():"",this.__handleStartValueChange,this.__startValue,this._t("ndmod.range_end").toString(),this.__endValue,e||!this.__startValue,this._isI18nReady?this._t("ndmod.select").toString():"",this.__handleEndValueChange,e||!this.__startValue,this.__submit,this.lang,this.__endValue?"range":"single",this.ns,this.value.length>0?c(vt||(vt=xt` <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add_range_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,M({"block text-xs mt-xs text-center sm-text-left":!0,"text-tertiary":this.value.length<20,"text-primary":this.value.length>=20})):"")}updated(){const e=this.constructor.getScopedTagName("vaadin-date-picker"),t=this.shadowRoot.querySelectorAll(e);Array.from(t).forEach((e=>e.validate()))}__handleStartValueChange(e){e.stopPropagation(),this.__startValue=e.target.value;const t=A(this.__endValue),s=A(this.__startValue);t&&t.getTime()<s.getTime()&&(this.__endValue=""),this.requestUpdate()}__handleEndValueChange(e){e.stopPropagation(),this.__endValue=e.target.value,this.requestUpdate()}__submit(){this.__startValue&&this.__endValue?this.value=[...this.value,[this.__startValue,this.__endValue].join("..")]:this.value=[...this.value,this.__startValue],this.__sendChange(),this.__startValue="",this.__endValue=""}__handleListChange(e){this.value=e.detail,this.__sendChange()}__sendChange(){this.dispatchEvent(new _t(this.value))}}class $t extends CustomEvent{constructor(e){super("change",{detail:e})}}let ft,bt,wt=e=>e;class kt extends m{constructor(){super("customer-portal-settings"),this.disabled=!1,this.type="min",this.__items=["none","custom"]}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"x-frequency-input":De,"x-choice":y,"x-group":N,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:String},type:{type:String}})}render(){return c(ft||(ft=wt` <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="${0}"> </x-i18n> <x-choice data-testid="choice" .disabled="${0}" .value="${0}" .items="${0}" @change="${0}"> <x-i18n slot="none-label" .ns="${0}" .lang="${0}" key="ndmod.none"></x-i18n> <x-i18n slot="custom-label" .ns="${0}" .lang="${0}" key="ndmod.custom"></x-i18n> ${0} </x-choice> </x-group> `),this.ns,this.lang,`ndmod.${this.type}`,this.disabled,this.__choice,this.__items,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.__choice===this.__items[1]?c(bt||(bt=wt` <div slot="${0}" class="space-y-s"> <x-frequency-input data-testid="input" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-input> <p class="text-s text-tertiary leading-s">${0}</p> </div> `),this.__items[1],this.value,this.disabled,this.__handleNewValueChange,this.__hint):"")}get __choice(){return this.__items[this.value?1:0]}get __hint(){var e;if(!this._isI18nReady)return"";const{count:t,units:s}=V(null!==(e=this.value)&&void 0!==e?e:"");return this._t(`ndmod.${this.type}Hint`,{duration:this._t("duration",{count:t,units:this._t(null!=s?s:"",{count:t})})})}__handleNewValueChange(e){this.value=e.detail,this.__sendChange()}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?void 0:"1w",this.__sendChange()}__sendChange(){this.dispatchEvent(new $t(this.value))}}class Et extends CustomEvent{constructor(e){super("change",{detail:e})}}class Ct extends CustomEvent{constructor(){super("remove")}}let St,Rt,It,jt,Vt,Mt,qt,Nt,Tt,Dt=e=>e;class At extends m{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value={jsonataQuery:"*"},this.open=!1}static get scopedElements(){return{"x-disallowed-dates":yt,"x-jsonata-input":Ge,"x-offset-input":kt,"x-allowed-days":ct,"iron-icon":customElements.get("iron-icon"),"x-warning":U,"x-group":N,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Object},open:{type:Boolean}})}render(){const{min:e,max:t,allowedDays:s,jsonataQuery:i,disallowedDates:a}=this.value,l=e||t,r=s&&s.days.length>0,d=a&&a.length>0,o=this.open?"":"rounded-b-l";return c(St||(St=Dt` <x-group frame> <details data-testid="details" class="${0}" ?open="${0}" @toggle="${0}"> <summary class="${0} cursor-pointer relative leading-s rounded-t-l focus-outline-none focus-shadow-outline"> <div class="p-m mr-xl text-m text-header font-medium space-y-s"> <div> <x-i18n .ns="${0}" .lang="${0}" key="${0}"> ${0} </x-i18n> </div> ${0} </div> <button data-testid="remove" .disabled="${0}" class="flex items-center justify-center rounded absolute top-0 right-0 text-tertiary hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" style="width:54px;height:54px" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </summary> <article class="space-y-l"> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.match"> </x-i18n> <x-jsonata-input data-testid="jsonata" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-jsonata-input> </x-group> <div class="flex flex-col md-flex-row"> <div class="mb-l md-mb-0 md-w-1-2 md-border-r md-border-contrast-10"> <x-offset-input data-testid="min" type="min" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-offset-input> </div> <div class="md-w-1-2"> <x-offset-input data-testid="max" type="max" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-offset-input> </div> </div> ${0} <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.allowed"> </x-i18n> <x-allowed-days data-testid="allowed" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-allowed-days> </x-group> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.excluded"> </x-i18n> <x-disallowed-dates data-testid="disallowed" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-disallowed-dates> </x-group> </article> </details> </x-group> `),M({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),o,this.ns,this.lang,`ndmod.${"*"===i?"all":"some"}Title`,"*"!==i?this.__renderJSONataSummary(i):"",l||r||d?c(Rt||(Rt=Dt` <div> ${0} </div> `),S(l&&this.__renderMinMaxSummary(e,t),r&&this.__renderAllowedSummary(s),d&&this.__renderDisallowedSummary(a))):"",this.disabled||!this._isI18nReady,Me((()=>this.dispatchEvent(new Ct))),this.ns,this.lang,this.ns,this.lang,i,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{jsonataQuery:e.detail}),this.__sendUpdate()}),this.lang,e,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{min:e.detail}),this.__sendUpdate()}),this.lang,t,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{max:e.detail}),this.__sendUpdate()}),-1===this.__compareDurations(e,t)?c(It||(It=Dt` <x-warning class="mx-m" data-testid="warning"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.minWarning"> </x-i18n> </x-warning> `),this.ns,this.lang):"",this.ns,this.lang,this.lang,s,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{allowedDays:e.detail}),this.__sendUpdate()}),this.ns,this.lang,this.ns,this.lang,null!=a?a:[],this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{disallowedDates:e.detail}),this.__sendUpdate()}))}__sendUpdate(){this.dispatchEvent(new Et(this.value))}__getEstimatedDaysFrom(e){const{count:t,units:s}=V(e);return t*{y:365,m:31,w:7,d:1}[s]}__compareDurations(e,t){return e===t?0:e&&t?this.__getEstimatedDaysFrom(e)<this.__getEstimatedDaysFrom(t)?1:-1:1}__renderJSONataSummary(e){return c(jt||(jt=Dt` <code class="inline-block rounded bg-success-10 text-success px-xs text-xs leading-s"> ${0} </code> `),e)}__renderMinMaxContent(e){if(e){const{count:t,units:s}=e;return c(Vt||(Vt=Dt` ${0} <x-i18n .ns="${0}" .lang="${0}" key="${0}" .opts="${0}"></x-i18n> `),t,this.ns,this.lang,s,{count:t})}return c(Mt||(Mt=Dt`<x-i18n .ns="${0}" .lang="${0}" key="ndmod.any"></x-i18n>`),this.ns,this.lang)}__renderMinMaxSummary(e,t){return c(qt||(qt=Dt` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.range"> <span>:</span> <span class="text-secondary"> ${0} — ${0} </span> </x-i18n> </div> `),this.ns,this.lang,this.__renderMinMaxContent(e?V(e):void 0),this.__renderMinMaxContent(t?V(t):void 0))}__renderAllowedSummary({type:e,days:t}){return c(Nt||(Nt=Dt` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.allowed"> <span>:</span> <span class="text-secondary"> ${0} ${0} </span> </x-i18n> </div> `),this.ns,this.lang,"month"===e?t.join(", "):"","day"===e?t.map((e=>R(e,this.lang,"short"))).join(", "):"")}__renderDisallowedSummary(e){return c(Tt||(Tt=Dt` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.excluded"> <span>:</span> <span class="text-secondary"> ${0} </span> </x-i18n> </div> `),this.ns,this.lang,e.map((e=>lt(e,this.lang))).join("; "))}}class Ut extends CustomEvent{constructor(e){super("change",{detail:e})}}let Ot,Ft,Lt,Bt=e=>e;class zt extends m{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-next-date-modification-rule":At,"vaadin-button":customElements.get("vaadin-button"),"x-section":ve,"iron-icon":customElements.get("iron-icon"),"x-switch":fe,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){const e=!this._isI18nReady||this.disabled||!this.value||Array.isArray(this.value)&&this.value.length>=10;return c(Ot||(Ot=Bt` <x-section> <x-switch slot="title" class="-my-xs" data-testid="toggle" .checked="${0}" .disabled="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.title" class="text-l"></x-i18n> </x-switch> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.subtitle" slot="subtitle" class="mr-xl"> </x-i18n> ${0} <div class="mt-m sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="add" theme="primary" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="ndmod.add_hint" class="${0}"> </x-i18n> </div> </x-section> `),Boolean(this.value),this.disabled||!this._isI18nReady,this.__toggleValue,this.ns,this.lang,this.ns,this.lang,this.value?c(Ft||(Ft=Bt` ${0} `),this.__normalizedValue.map(((e,t,s)=>c(Lt||(Lt=Bt` <x-next-date-modification-rule data-testid="rule" .disabled="${0}" .value="${0}" .lang="${0}" @remove="${0}" @change="${0}"> </x-next-date-modification-rule> `),this.disabled||!this._isI18nReady,e,this.lang,(()=>{this.value=s.filter(((e,s)=>s!==t)),this.__sendChange()}),(e=>{this.value=s.map(((s,i)=>i===t?e.detail:s)),this.__sendChange()}))))):"",e,this.__addRule,this.ns,this.lang,this.lang,this.ns,M({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":Array.isArray(this.value)&&this.value.length<10,"text-primary":Array.isArray(this.value)&&this.value.length>=10,hidden:!Array.isArray(this.value)||0===this.value.length}))}get __normalizedValue(){return"boolean"==typeof this.value?[]:this.value}__addRule(){this.value=[...this.__normalizedValue,{jsonataQuery:"*"}],this.__sendChange()}__toggleValue(){this.value=!this.value,this.__sendChange()}__sendChange(){this.dispatchEvent(new Ut(this.value))}}class Pt extends te{}let Qt,Kt,Jt,Gt=e=>e;class Ht extends m{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__errorCode="invalid",this.__invalid=!1,this.__newValue=""}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-button":customElements.get("vaadin-button"),"x-skeleton":k,"iron-icon":customElements.get("iron-icon"),"x-group":N,"x-list":ne,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},invalid:{type:Boolean},disabled:{type:Boolean}})}render(){return c(Qt||(Qt=Gt` <x-group frame> <x-list data-testid="list" .disabled="${0}" .value="${0}" @change="${0}"> ${0} <div class="flex flex-col sm-flex-row sm-items-start"> <vaadin-text-field data-testid="input" class="mb-s sm-mb-0 sm-mr-s" .placeholder="${0}" .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" @keypress="${0}" @change="${0}" @input="${0}"> </vaadin-text-field> <div class="sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="button" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="origins.add"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="origins.add_hint" class="${0}"> </x-i18n> </div> </div> </x-list> </x-group> `),this.disabled||!this._isI18nReady,this.value,this.__handleChange,this.value.map(((e,t)=>this._isI18nReady?c(Kt||(Kt=Gt` <div class="flex items-center" slot="${0}"> <img height="16" width="16" class="mr-m" src="https://www.google.com/s2/favicons?domain=${0}"> ${0} </div> `),t,e,e):c(Jt||(Jt=Gt`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this._isI18nReady?"https://foxy.io":"",this._t(`origins.${this.__errorCode}`).toString(),this.disabled||!this._isI18nReady,this.__invalid,this.__newValue,(e=>"Enter"===e.key&&this.__submit()),(e=>e.stopPropagation()),this.__handleInput,!this._isI18nReady||this.disabled||this.__invalid||this.value.length>=10,this.__submit,this.ns,this.lang,this.lang,this.ns,M({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":this.value.length<10,"text-primary":this.value.length>=10,hidden:0===this.value.length}))}__sendChange(){this.dispatchEvent(new Pt(this.value))}__handleInput(e){this.__newValue=e.target.value;try{const e=new URL(this.__newValue),t="https:"===e.protocol,s="localhost"===e.hostname;this.__invalid=!s&&!t,this.__errorCode="https_only"}catch(e){this.__invalid=this.__newValue.length>0,this.__errorCode="invalid"}this.requestUpdate()}__submit(){this.__newValue.length>0&&(this.value=[...this.value,new URL(this.__newValue).origin],this.__newValue="",this.__invalid=!1,this.__sendChange()),this.requestUpdate()}__handleChange(e){this.value=e.detail,this.__sendChange()}}class Wt extends CustomEvent{constructor(e){super("change",{detail:e})}}let Yt,Xt=e=>e;class Zt extends m{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-section":ve,"x-switch":fe,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){return c(Yt||(Yt=Xt` <x-section> <x-switch slot="title" class="-my-xs" data-testid="toggle" .checked="${0}" .disabled="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="sso.title" class="text-l"></x-i18n> </x-switch> <x-i18n .ns="${0}" .lang="${0}" key="sso.subtitle" slot="subtitle" class="mr-xl"> </x-i18n> </x-section> `),Boolean(this.value),this.disabled||!this._isI18nReady,this.__toggleValue,this.ns,this.lang,this.ns,this.lang)}__toggleValue(){this.value=!this.value,this.__sendChange()}__sendChange(){this.dispatchEvent(new Wt(this.value))}}const es=$.assign({error:(e,t)=>t.data.type}),ts=$.assign({oldResource:(e,t)=>t.data.resource,newResource:(e,t)=>t.data.resource,store:(e,t)=>t.data.store}),ss=$.assign({oldResource:e=>e.newResource}),is=$.assign({invalid:[],newResource:({oldResource:e})=>e}),as=$.assign({invalid:[],newResource:e=>({allowedOrigins:[],subscriptions:{allowFrequencyModification:[],allowNextDateModification:!1},jwtSharedSecret:ee(72,(()=>Y(35).toString(36))).join(""),sessionLifespanInMinutes:40320,signUp:{enabled:!1,verification:{type:"hcaptcha",siteKey:"",secretKey:""}},sso:!1,date_created:(new Date).toISOString(),date_modified:(new Date).toISOString(),_links:{"fx:store":e.store._links.self,curies:e.store._links.curies,self:e.store._links["fx:customer_portal_settings"]}})}),ns=$.assign({newResource:null}),ls=$.assign({error:"setup_needed"}),rs=$.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{allowedOrigins:s})}}),ds=$.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{subscriptions:n(n({},e.subscriptions),{},{allowFrequencyModification:s})})}}),os=$.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{subscriptions:n(n({},e.subscriptions),{},{allowNextDateModification:s})})}}),hs=$.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{signUp:s})}}),us=$.assign({invalid:(e,t)=>{const s="sessionLifespanInMinutes",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{sessionLifespanInMinutes:s})}}),cs=$.assign({invalid:(e,t)=>{const s="jwtSharedSecret",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{jwtSharedSecret:s})}}),_s=$.assign({oldResource:null,newResource:null,store:null,error:null,href:(e,t)=>t.data}),gs=$.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{sso:s})}}),ps={SET_SSO:{target:"#cps.idle",actions:"setSSO"},SET_SECRET:{target:"#cps.idle",actions:"setSecret"},SET_ORIGINS:{target:"#cps.idle",actions:"setOrigins"},SET_SESSION:{target:"#cps.idle",actions:"setSession"},SET_SIGN_UP:{target:"#cps.idle",actions:"setSignUp"},SET_FREQUENCY_MODIFICATION:{target:"#cps.idle",actions:"setFrequencyModification"},SET_NEXT_DATE_MODIFICATION:{target:"#cps.idle",actions:"setNextDateModification"}},ms={initial:"unknown",states:{unknown:{always:[{target:"invalid",cond:"isInvalid"},{target:"valid"}]},invalid:{},valid:{}}},vs=l({id:"cps",initial:"unknown",context:{oldResource:null,newResource:null,invalid:[],store:null,error:null,href:null},states:{unknown:{always:[{target:"error",cond:"isSetupNeeded",actions:"requireSetup"},{target:"idle",cond:"isLoaded"},{target:"busy"}]},error:{on:{RELOAD:{target:"busy.loading"}}},busy:{initial:"loading",states:{loading:{invoke:{src:"load",onDone:{target:"#cps.idle.clean",actions:"handleLoadingSuccess"},onError:{target:"#cps.error",actions:"handleError"}}},saving:{invoke:{src:"save",onDone:{target:"#cps.idle.clean",actions:"handleSavingSuccess"},onError:{target:"#cps.error",actions:"handleError"}}}}},idle:{initial:"unknown",on:{DISABLE:{target:"#cps.idle",actions:"remove"},ENABLE:{target:"#cps.idle",actions:"create"},RESET:{target:"#cps.idle",actions:"reset"}},states:{unknown:{always:[{target:"clean",cond:"isClean"},{target:"dirty"}]},clean:{initial:"unknown",states:{unknown:{always:[{target:"enabled",cond:"isEnabled"},{target:"disabled"}]},enabled:{on:ps},disabled:{}}},dirty:{on:{SAVE:"#cps.busy.saving"},initial:"unknown",states:{unknown:{always:[{target:"created",cond:"isCreated"},{target:"deleted",cond:"isDeleted"},{target:"updated"}]},created:n({on:ps},ms),updated:n({on:ps},ms),deleted:{}}}}}},on:{SET_HREF:{actions:"setHref",target:"unknown"}}},{guards:{isClean:e=>r(e.newResource,e.oldResource),isLoaded:e=>null!==e.store,isInvalid:e=>e.invalid.length>0,isEnabled:e=>null!==e.oldResource,isCreated:e=>null===e.oldResource&&null!==e.newResource,isDeleted:e=>null!==e.oldResource&&null===e.newResource,isSetupNeeded:e=>null===e.href},actions:{setFrequencyModification:ds,setNextDateModification:os,setOrigins:rs,setSession:us,setSecret:cs,setSignUp:hs,setHref:_s,setSSO:gs,handleLoadingSuccess:ts,handleSavingSuccess:ss,handleError:es,create:as,reset:is,remove:ns,requireSetup:ls}});class xs extends CustomEvent{constructor(e){super("change",{detail:e})}}let ys,$s,fs=e=>e;class bs extends m{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=void 0}static get scopedElements(){return{"vaadin-password-field":q,"x-section":ve,"x-switch":fe,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Object}})}render(){var e,t,s;return c(ys||(ys=fs` <x-section> <x-switch data-testid="toggle" class="-my-xs" slot="title" .disabled="${0}" .checked="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="sign_up.title" class="text-l"></x-i18n> </x-switch> <x-i18n class="mr-xl" slot="subtitle" key="sign_up.subtitle" .lang="${0}" .ns="${0}"> </x-i18n> ${0} </x-section> `),this.disabled||!this._isI18nReady,this.__normalizedValue.enabled,(()=>{const e=this.__normalizedValue;e.enabled=!e.enabled,e.enabled||(e.verification.siteKey="",e.verification.secretKey=""),this.value=e,this.requestUpdate(),this.__sendChange()}),this.ns,this.lang,this.lang,this.ns,(null===(e=this.__normalizedValue)||void 0===e?void 0:e.enabled)?c($s||($s=fs` <div class="grid gap-m sm-grid-cols-2"> <vaadin-password-field .placeholder="${0}" .disabled="${0}" .value="${0}" .label="${0}" autocomplete="off" data-testid="site-key" @change="${0}" @input="${0}"> </vaadin-password-field> <vaadin-password-field .placeholder="${0}" .disabled="${0}" .value="${0}" .label="${0}" autocomplete="off" data-testid="secret-key" @change="${0}" @input="${0}"> </vaadin-password-field> <x-i18n class="sm-col-span-2 text-s text-secondary" lang="${0}" key="sign_up.hcaptcha_explainer" ns="${0}"> </x-i18n> </div> `),this._isI18nReady?this._t("sign_up.site_key_placeholder").toString():"---",this.disabled||!this._isI18nReady,this._isI18nReady?null===(t=this.value)||void 0===t?void 0:t.verification.siteKey:"",this._isI18nReady?this._t("sign_up.site_key_label").toString():"---",(e=>e.stopPropagation()),(e=>{const t=this.__normalizedValue;t.verification.siteKey=e.target.value,this.value=t,this.requestUpdate(),this.__sendChange()}),this._isI18nReady?this._t("sign_up.secret_key_placeholder").toString():"---",this.disabled||!this._isI18nReady,this._isI18nReady?null===(s=this.value)||void 0===s?void 0:s.verification.secretKey:"",this._isI18nReady?this._t("sign_up.secret_key_label").toString():"---",(e=>e.stopPropagation()),(e=>{const t=this.__normalizedValue;t.verification.secretKey=e.target.value,this.value=t,this.requestUpdate(),this.__sendChange()}),this.lang,this.ns):"")}get __normalizedValue(){return this.value?F(this.value):{verification:{type:"hcaptcha",siteKey:"",secretKey:""},enabled:!1}}__sendChange(){this.dispatchEvent(new xs(this.value))}}let ws,ks,Es,Cs,Ss=e=>e;function Rs(e){if(!e.ok)throw new h(401===e.status?"unauthorized":"unknown")}class Is extends CustomEvent{constructor(){super("ready")}}class js extends CustomEvent{constructor(){super("update")}}class Vs extends m{constructor(){super("customer-portal-settings"),this.rel="customer_portal_settings",this.__machine=vs.withConfig({services:{load:()=>this.__load(),save:()=>this.__save()}}),this.__service=L(this.__machine).onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-modification":nt,"x-next-date-modification":zt,"x-session-duration":Se,"x-session-secret":Ve,"x-loading-screen":oe,"x-error-screen":o,"x-origins-list":Ht,"x-sso-switch":Zt,"x-skeleton":k,"x-section":ve,"x-sign-up":bs,"x-switch":fe,"x-i18n":b,"x-page":_e}}static get properties(){return n(n({},super.properties),{},{href:{type:String,noAccessor:!0}})}get href(){return this.__service.state.context.href}set href(e){this.__service.send({type:"SET_HREF",data:e})}render(){var e,t,s,i,a,l;if(this.__service.state.matches("error"))return c(ws||(ws=Ss` <x-error-screen data-testid="error" lang="${0}" type="${0}" reload @reload="${0}"> </x-error-screen> `),this.lang,this.__service.state.context.error,this.__reload);const{newResource:r}=this.__service.state.context,d=this.__service.state.matches("idle.dirty.created"),o=this.__service.state.matches("idle.dirty.deleted"),h=this.__service.state.matches("idle.dirty.updated"),u=this.__service.state.matches("idle.clean.enabled"),_=this.__service.state.matches("idle.dirty.updated.invalid")||this.__service.state.matches("idle.dirty.created.invalid");return c(ks||(ks=Ss` <x-page class="relative"> <x-switch slot="title" data-testid="switch" .disabled="${0}" .checked="${0}" @change="${0}"> <x-i18n key="title" class="text-xxl" .ns="${0}" .lang="${0}"> <sup class="text-tertiary"> <x-i18n key="beta" .ns="${0}" .lang="${0}"> </x-i18n> </sup> </x-i18n> </x-switch> <x-i18n class="block mr-xl" slot="subtitle" key="subtitle" .ns="${0}" .lang="${0}"> </x-i18n> <x-section> <x-i18n slot="title" key="origins.title" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="subtitle" key="origins.subtitle" .ns="${0}" .lang="${0}"></x-i18n> <x-origins-list data-testid="origins" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-origins-list> </x-section> <x-frequency-modification data-testid="fmod" .lang="${0}" .ns="${0}" .value="${0}" ?disabled="${0}" @change="${0}"> </x-frequency-modification> <x-next-date-modification data-testid="ndmod" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-next-date-modification> <x-sso-switch data-testid="sso" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-sso-switch> <x-sign-up data-testid="signup" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-sign-up> <x-section> <x-i18n slot="title" key="advanced.title" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="subtitle" key="advanced.subtitle" .ns="${0}" .lang="${0}"> </x-i18n> <x-session-duration data-testid="session" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-session-duration> <x-session-secret data-testid="secret" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-session-secret> </x-section> ${0} </x-page> `),!this.__service.state.matches("idle")||!this._isI18nReady,u||d||h,(e=>{this.__service.send(e.detail?"ENABLE":"DISABLE")}),this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.lang,this.ns,null!==(e=null==r?void 0:r.allowedOrigins)&&void 0!==e?e:[],!r,(e=>{this.__service.send({type:"SET_ORIGINS",value:e.detail})}),this.lang,this.ns,null!==(t=null==r?void 0:r.subscriptions.allowFrequencyModification)&&void 0!==t?t:[],!r,(e=>{this.__service.send({type:"SET_FREQUENCY_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(s=null==r?void 0:r.subscriptions.allowNextDateModification)&&void 0!==s&&s,!r,(e=>{this.__service.send({type:"SET_NEXT_DATE_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(i=null==r?void 0:r.sso)&&void 0!==i&&i,!r,(e=>{this.__service.send({type:"SET_SSO",value:e.detail})}),!r,null==r?void 0:r.signUp,this.lang,this.ns,(e=>{this.__service.send({type:"SET_SIGN_UP",value:e.detail})}),this.ns,this.lang,this.ns,this.lang,!r||!this._isI18nReady,null!==(a=null==r?void 0:r.sessionLifespanInMinutes)&&void 0!==a?a:1,this.lang,this.ns,(({detail:e})=>{this.__service.send(n({type:"SET_SESSION"},e))}),!r||!this._isI18nReady,null!==(l=null==r?void 0:r.jwtSharedSecret)&&void 0!==l?l:"",this.lang,this.ns,(({detail:e})=>{this.__service.send(n({type:"SET_SECRET"},e))}),this.__service.state.matches("idle.dirty")?c(Es||(Es=Ss` <div class="sticky flex justify-between rounded-t-l rounded-b-l shadow-m -mx-s p-s bg-contrast" style="bottom:var(--lumo-space-m)"> <vaadin-button data-testid="save" theme="primary ${0}" .disabled="${0}" @click="${0}"> <x-i18n lang="${0}" ns="${0}" key="save_${0}"> </x-i18n> </vaadin-button> <vaadin-button style="--lumo-contrast:var(--lumo-base-color)" data-testid="reset" theme="contrast tertiary" @click="${0}"> <x-i18n lang="${0}" key="undo_all"></x-i18n> <iron-icon icon="lumo:reload" slot="suffix"></iron-icon> </vaadin-button> </div> `),o?"error":"success",_,(()=>this.__service.send("SAVE")),this.lang,this.ns,d?"create":o?"delete":"update",(()=>this.__service.send("RESET")),this.lang):this.__service.state.matches("busy")?c(Cs||(Cs=Ss`<x-loading-screen data-testid="loading" class="mt-0"></x-loading-screen>`)):"")}async __reload(){this.__service.stop(),this.__service.onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}async __load(){if(null===this.href)throw new h("setup_needed");try{await this.updateComplete;const e=await we.emit({source:this,init:[this.href]});let t,s;if(e.status.toString().startsWith("4")){t=null;const e=await we.emit({source:this,init:["/"]});Rs(e);const i=(await e.json())._links["fx:store"].href,a=await we.emit({source:this,init:[i]});Rs(a),s=await a.json()}else{Rs(e),t=await e.json();const i=t._links["fx:store"].href,a=await we.emit({source:this,init:[i]});Rs(a),s=await a.json()}return{store:s,resource:t}}catch(e){if(e instanceof h)throw e;if(e instanceof be)throw new h("setup_needed");throw new h("unknown")}finally{await this.updateComplete,this.dispatchEvent(new Is)}}async __save(){try{const e=this.__service.state.context,t=F(e.newResource),s=t?"PUT":"DELETE";t&&(delete t._links,delete t.date_created,delete t.date_modified);const i={method:s,body:t?JSON.stringify(t):void 0};Rs(await we.emit({source:this,init:[this.href,i]}))}catch(e){if(e instanceof h)throw e;if(e instanceof be)throw new h("setup_needed");throw new h("unknown")}finally{await this.updateComplete,this.dispatchEvent(new js)}}}customElements.define("foxy-customer-portal-settings",Vs);export{Vs as CustomerPortalSettings};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./foxy-customer.js";import"./shared-37e1a834.js";import"./shared-8b80db13.js";import"./shared-e40937c5.js";import"./shared-51c4a6dd.js";import{I as e}from"./shared-966feb65.js";import"./foxy-access-recovery-form.js";import"./foxy-payment-method-card.js";import{TransactionsTable as t}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-customer-form.js";import"./foxy-sign-in-form.js";import"./foxy-form-dialog.js";import"./foxy-spinner.js";import{_ as s,B as r,aj as o}from"./shared-1522d76f.js";import{h as i,L as n,c as a}from"./shared-dc73b9a5.js";import{A as d}from"./shared-f1e743df.js";import"./shared-250a399a.js";import{C as l}from"./shared-f0269599.js";import{a as c,T as m}from"./shared-331a223c.js";import{i as u}from"./shared-9803aa7c.js";import{c as h}from"./shared-4e709717.js";import{A as p}from"./shared-07e9d1fb.js";import{C as f}from"./shared-9f570db0.js";import{I as g}from"./shared-30cbf0a6.js";import"./shared-bf695fe7.js";import"./foxy-attribute-card.js";import"./shared-a0435ec6.js";import"./shared-343d1fd7.js";import"./shared-3ab0306f.js";import"./shared-eb116b3e.js";import"./shared-f5d4dda0.js";import"./foxy-attribute-form.js";import"./shared-7ea4cb27.js";import"./shared-cfed658c.js";import"./shared-61ade33e.js";import"./shared-fd0a4026.js";import"./shared-2062c274.js";import"./shared-0cbb19f4.js";import"./shared-a0c6a159.js";import"./shared-030f561a.js";import"./shared-5df32007.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./shared-83fc5dca.js";import"./shared-8ab2ba91.js";import"./shared-9adc47da.js";import"./shared-3f19b914.js";import"./shared-655e7c5f.js";import"./shared-651c44fa.js";import"./shared-4482e7b9.js";import"./shared-2920b595.js";import"./foxy-table.js";import"./shared-a19e1dff.js";import"./foxy-nucleon-element.js";import"./shared-7039733e.js";import"./shared-
|
|
1
|
+
import"./foxy-customer.js";import"./shared-37e1a834.js";import"./shared-8b80db13.js";import"./shared-e40937c5.js";import"./shared-51c4a6dd.js";import{I as e}from"./shared-966feb65.js";import"./foxy-access-recovery-form.js";import"./foxy-payment-method-card.js";import{TransactionsTable as t}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-customer-form.js";import"./foxy-sign-in-form.js";import"./foxy-form-dialog.js";import"./foxy-spinner.js";import{_ as s,B as r,aj as o}from"./shared-1522d76f.js";import{h as i,L as n,c as a}from"./shared-dc73b9a5.js";import{A as d}from"./shared-f1e743df.js";import"./shared-250a399a.js";import{C as l}from"./shared-f0269599.js";import{a as c,T as m}from"./shared-331a223c.js";import{i as u}from"./shared-9803aa7c.js";import{c as h}from"./shared-4e709717.js";import{A as p}from"./shared-07e9d1fb.js";import{C as f}from"./shared-9f570db0.js";import{I as g}from"./shared-30cbf0a6.js";import"./shared-bf695fe7.js";import"./foxy-attribute-card.js";import"./shared-a0435ec6.js";import"./shared-343d1fd7.js";import"./shared-3ab0306f.js";import"./shared-eb116b3e.js";import"./shared-f5d4dda0.js";import"./foxy-attribute-form.js";import"./shared-7ea4cb27.js";import"./shared-cfed658c.js";import"./shared-61ade33e.js";import"./shared-fd0a4026.js";import"./shared-2062c274.js";import"./shared-0cbb19f4.js";import"./shared-a0c6a159.js";import"./shared-030f561a.js";import"./shared-5df32007.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./shared-83fc5dca.js";import"./shared-8ab2ba91.js";import"./shared-9adc47da.js";import"./shared-3f19b914.js";import"./shared-655e7c5f.js";import"./shared-651c44fa.js";import"./shared-4482e7b9.js";import"./shared-2920b595.js";import"./foxy-table.js";import"./shared-a19e1dff.js";import"./foxy-nucleon-element.js";import"./shared-7039733e.js";import"./shared-c0c7225c.js";import"./shared-db98729a.js";import"./shared-44bb85d8.js";import"./shared-f588b5c2.js";import"./shared-44d207fb.js";import"./shared-f94fa366.js";import"./shared-99940888.js";import"./shared-e4543605.js";import"./shared-6ed07856.js";import"./shared-5ba87b6d.js";import"./shared-597737ce.js";import"./shared-d9f65ee0.js";import"./shared-6d41c9a9.js";import"./shared-2bf89a21.js";import"./shared-26f4b6bf.js";import"./shared-1024766f.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-9de9f905.js";import"./shared-99f0fee6.js";import"./shared-43e2c3f6.js";import"./shared-79d0699c.js";import"./foxy-transaction-card.js";import"./shared-d0374d0c.js";import"./shared-d244dd07.js";import"./shared-bab2ea2c.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-510a9e1b.js";import"./shared-a5ecd56e.js";import"./shared-b738ee96.js";import"./shared-12390d6f.js";import"./shared-cd8c3429.js";let $,y,v=e=>e;class b extends(c(m(l),"customer-portal")){constructor(){super(...arguments),this.transactionsTableColumns=[t.priceColumn,t.summaryColumn,t.statusColumn,t.idColumn,t.dateColumn,t.receiptColumn],this.group=""}static get properties(){return s(s({},super.properties),{},{transactionsTableColumns:{attribute:!1},group:{type:String}})}render(){let e;try{e=new URL("./customer_portal_settings",this.base).toString()}catch(t){e=void 0}return this.api.storage.getItem(d.SESSION)?i($||($=v` <foxy-internal-customer-portal-logged-in-view customer="${0}" class="h-full" infer="" href="${0}" .transactionsTableColumns="${0}"> </foxy-internal-customer-portal-logged-in-view> `),this.base,u(e),this.transactionsTableColumns):i(y||(y=v` <foxy-internal-customer-portal-logged-out-view class="h-full" infer="" href="${0}"> </foxy-internal-customer-portal-logged-out-view> `),u(e))}}let S,x,_,j,T=e=>e;class O extends(m(n)){constructor(){super(...arguments),this.disabled=!1,this.href="",this.icon=""}static get properties(){return s(s({},super.properties),{},{disabled:{type:Boolean},href:{type:String},icon:{type:String}})}render(){const e=h({"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=i(S||(S=T` ${0} <slot></slot> `),this.icon?i(x||(x=T`<iron-icon icon="${0}" class="icon-inline"></iron-icon>`),this.icon):"");return this.disabled?i(_||(_=T`<button class="${0}" disabled="disabled">${0}</button>`),e,t):i(j||(j=T` <a class="${0}" href="${0}" rel="nofollow noopener">${0}</a> `),e,this.href,t)}}let k,w,z,R,E,U,N,A,C=e=>e;const H=c(e);let I,F,L,q,P,B,D,G,J,K,M,Q,V,W,X,Y=e=>e;const Z=c(e);const ee=["html"],te=["html"];let se,re,oe,ie,ne,ae,de,le,ce,me,ue,he,pe=e=>e;const fe=c(f(m(g(n))));let ge,$e,ye,ve=e=>e;const be=f(m(c(g(n),"customer-portal")));customElements.define("foxy-internal-customer-portal-logged-in-view",class extends H{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,o,n;const a="customer:header:actions:sign-out",d=this.loggingOutState,l=this.disabledSelector.matches(a)||!(null===(t=this.__customerElement)||void 0===t?void 0:t.in({idle:"snapshot"}))||"idle"!==d,c={"border-radius":"100%",padding:"var(--lumo-space-xs)",display:"flex",margin:"0",cursor:l?"default":"pointer"};return i(k||(k=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};`),""),l,(async function(){try{e.loggingOutState="busy",await new p(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"===d?i(w||(w=C`<iron-icon icon="icons:exit-to-app"></iron-icon>`)):i(z||(z=C` <foxy-spinner layout="no-label" state="${0}" style="margin:auto" lang="${0}" ns="${0}"> </foxy-spinner> `),"fail"===d?"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===(o=customElements.get("foxy-spinner"))||void 0===o?void 0:o.defaultNS)&&void 0!==n?n:""].join(" ")),this.renderTemplateOrSlot(`${a}:after`))},this.__renderSubscriptions=(e,t)=>{const s="customer:subscriptions";return e(R||(R=C`
|
|
2
2
|
${0}
|
|
3
3
|
|
|
4
4
|
<foxy-internal-customer-portal-subscriptions
|
|
@@ -145,4 +145,4 @@ import"./foxy-customer.js";import"./shared-37e1a834.js";import"./shared-8b80db13
|
|
|
145
145
|
.templates=${0}
|
|
146
146
|
>
|
|
147
147
|
</foxy-collection-page>
|
|
148
|
-
`),s.ns,s.href,s.lang,s.group,this.__renderPageItem,s.templates)},this.__renderHeader=()=>i(me||(me=pe` ${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 i(ue||(ue=pe` ${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(),u(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 s(s({},super.properties),{},{settings:{attribute:!1},customer:{attribute:!1},group:{type:String}})}render(){return i(he||(he=pe` <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","transaction_template:items"),e.toString()}catch(e){return""}}}),customElements.define("foxy-internal-customer-portal-transactions",class extends
|
|
148
|
+
`),s.ns,s.href,s.lang,s.group,this.__renderPageItem,s.templates)},this.__renderHeader=()=>i(me||(me=pe` ${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 i(ue||(ue=pe` ${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(),u(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 s(s({},super.properties),{},{settings:{attribute:!1},customer:{attribute:!1},group:{type:String}})}render(){return i(he||(he=pe` <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","transaction_template:items"),e.toString()}catch(e){return""}}}),customElements.define("foxy-internal-customer-portal-transactions",class extends be{constructor(){super(...arguments),this.customer=null,this.columns=[],this.group="",this.__renderHeader=()=>i(ge||(ge=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 i($e||($e=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}" .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 s(s({},super.properties),{},{customer:{attribute:!1},columns:{attribute:!1},group:{type:String}})}render(){return i(ye||(ye=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-link",O),customElements.define("foxy-customer-portal",b);export{b as CustomerPortal};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./shared-e40937c5.js";import"./shared-8b80db13.js";import{h as t}from"./shared-bf695fe7.js";import"./shared-37e1a834.js";import"./shared-51c4a6dd.js";import"./foxy-payment-method-card.js";import"./foxy-subscription-form.js";import"./foxy-form-dialog.js";import"./foxy-transactions-table.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-customer-form.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-spinner.js";import"./foxy-table.js";import"./shared-f5d4dda0.js";import{aj as e,_ as s}from"./shared-1522d76f.js";import{L as r,h as a,c as o}from"./shared-dc73b9a5.js";import{C as i}from"./shared-9f570db0.js";import"./shared-cfed658c.js";import"./shared-7039733e.js";import{y as h,S as d,T as n,a as l}from"./shared-331a223c.js";import{c as m}from"./shared-4e709717.js";import"./shared-
|
|
1
|
+
import"./shared-e40937c5.js";import"./shared-8b80db13.js";import{h as t}from"./shared-bf695fe7.js";import"./shared-37e1a834.js";import"./shared-51c4a6dd.js";import"./foxy-payment-method-card.js";import"./foxy-subscription-form.js";import"./foxy-form-dialog.js";import"./foxy-transactions-table.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-customer-form.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-spinner.js";import"./foxy-table.js";import"./shared-f5d4dda0.js";import{aj as e,_ as s}from"./shared-1522d76f.js";import{L as r,h as a,c as o}from"./shared-dc73b9a5.js";import{C as i}from"./shared-9f570db0.js";import"./shared-cfed658c.js";import"./shared-7039733e.js";import{y as h,S as d,T as n,a as l}from"./shared-331a223c.js";import{c as m}from"./shared-4e709717.js";import"./shared-c0c7225c.js";import"./shared-5df32007.js";import{S as c}from"./shared-e4543605.js";import"./shared-db98729a.js";import"./shared-4482e7b9.js";import"./shared-44bb85d8.js";import"./shared-f94fa366.js";import"./shared-8ab2ba91.js";import{G as v}from"./shared-597737ce.js";import"./shared-9adc47da.js";import"./shared-fd0a4026.js";import"./shared-655e7c5f.js";import{N as p}from"./shared-a0435ec6.js";import{S as f}from"./shared-d9f65ee0.js";import{i as g}from"./shared-9803aa7c.js";import"./shared-61ade33e.js";import"./shared-030f561a.js";import"./shared-2bf89a21.js";import"./foxy-nucleon-element.js";import"./shared-07e9d1fb.js";import"./shared-343d1fd7.js";import"./shared-3ab0306f.js";import"./shared-30cbf0a6.js";import"./shared-eb116b3e.js";import"./shared-26f4b6bf.js";import"./shared-966feb65.js";import"./shared-2062c274.js";import"./shared-1024766f.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-9de9f905.js";import"./shared-99f0fee6.js";import"./shared-43e2c3f6.js";import"./shared-79d0699c.js";import"./foxy-transaction-card.js";import"./shared-d0374d0c.js";import"./shared-d244dd07.js";import"./shared-bab2ea2c.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-6d41c9a9.js";import"./shared-f1e743df.js";import"./shared-250a399a.js";import"./shared-99940888.js";import"./shared-a19e1dff.js";import"./shared-a0c6a159.js";import"./shared-7ea4cb27.js";import"./shared-0cbb19f4.js";import"./shared-510a9e1b.js";import"./shared-a5ecd56e.js";import"./shared-2920b595.js";import"./shared-b738ee96.js";import"./shared-83fc5dca.js";import"./shared-3f19b914.js";import"./shared-651c44fa.js";import"./shared-f588b5c2.js";import"./shared-44d207fb.js";import"./shared-6ed07856.js";import"./shared-5ba87b6d.js";let z,u,b,$=t=>t;class H extends r{constructor(){super(...arguments),this.value=0,this.size=0}static get properties(){return{value:{type:Number},size:{type:Number}}}static get styles(){return h.styles}render(){const t=[],e=[];for(let s=0;s<this.size;++s)t.push(a(z||(z=$` <button id="tab-${0}" role="tab" class="${0}" aria-controls="panel-${0}" aria-selected="${0}" @click="${0}" @keydown="${0}"> <slot name="tab-${0}"></slot> </button> `),s,m({"text-l font-medium px-s rounded focus-outline-none focus-shadow-outline":!0,"text-tertiary hover-text-body focus-text-body":this.value!==s}),s,this.value===s,(()=>this.value=s),this.__handleKeyDown,s)),e.push(a(u||(u=$` <slot id="panel-${0}" role="tabpanel" name="panel-${0}" class="${0}" aria-hidden="${0}" aria-labelledby="tab-${0}"> </slot> `),s,s,m({hidden:this.value!==s}),this.value!==s,s));return a(b||(b=$` <div role="tablist" aria-orientation="horizontal" class="-mx-s mb-s">${0}</div> ${0} `),t,e)}__handleKeyDown(t){if(t.key.startsWith("Arrow")){t.preventDefault();const e=t.target;let s=null;"ArrowRight"===t.key||"ArrowDown"===t.key?s=e.nextElementSibling:"ArrowLeft"!==t.key&&"ArrowUp"!==t.key||(s=e.previousElementSibling),null==s||s.click(),null==s||s.focus()}}}
|
|
2
2
|
/**
|
|
3
3
|
@license
|
|
4
4
|
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t}from"./shared-1522d76f.js";import"./shared-37e1a834.js";import"./shared-f588b5c2.js";import"./shared-4482e7b9.js";import{h as e}from"./shared-dc73b9a5.js";import{x as s}from"./shared-331a223c.js";import{p as i}from"./shared-f5d4dda0.js";import{C as n}from"./shared-
|
|
1
|
+
import{_ as t}from"./shared-1522d76f.js";import"./shared-37e1a834.js";import"./shared-f588b5c2.js";import"./shared-4482e7b9.js";import{h as e}from"./shared-dc73b9a5.js";import{x as s}from"./shared-331a223c.js";import{p as i}from"./shared-f5d4dda0.js";import{C as n}from"./shared-febda61c.js";import{C as r}from"./shared-c0c7225c.js";import"./shared-5df32007.js";import{D as a,I as o}from"./shared-e4543605.js";import{E as m}from"./shared-d7892f27.js";import"./shared-db98729a.js";import"./shared-44bb85d8.js";import"./shared-f94fa366.js";import"./shared-8ab2ba91.js";import{G as h}from"./shared-597737ce.js";import"./shared-9adc47da.js";import"./shared-fd0a4026.js";import"./shared-cfed658c.js";import"./shared-655e7c5f.js";import"./shared-e40937c5.js";import"./shared-7039733e.js";import"./shared-bf695fe7.js";import"./shared-61ade33e.js";import"./shared-343d1fd7.js";import"./shared-30cbf0a6.js";import"./shared-4e709717.js";import"./shared-44d207fb.js";import"./shared-99940888.js";import"./shared-eb116b3e.js";import"./shared-07e9d1fb.js";import"./shared-9f570db0.js";import"./shared-9803aa7c.js";import"./shared-6ed07856.js";import"./shared-3f19b914.js";import"./shared-5ba87b6d.js";import"./shared-651c44fa.js";class c extends CustomEvent{constructor(t){super("change",{detail:t})}}class d extends CustomEvent{constructor(){super("submit",{cancelable:!0})}}let u,l,p,y,g,f,$,b,x=t=>t;class _ extends s{constructor(){super("donation"),this.currency=null,this.amount=null,this.store=null,this.name=null,this.custom=null,this.amounts=null,this.frequency=null,this.frequencies=null,this.designation=null,this.designations=null,this.comment=null,this.anonymity=!1,this.anonymous=!1,this.image=null,this.code=null,this.url=null,this.cart="checkout",this.target="_top"}static get scopedElements(){return{"vaadin-text-area":customElements.get("vaadin-text-area"),"x-error-screen":m,"vaadin-button":customElements.get("vaadin-button"),"x-dropdown":a,"x-checkbox":n,"x-choice":r,"x-group":h,"x-i18n":o}}static get properties(){return t(t({},super.properties),{},{currency:{type:String},custom:{type:Array},amount:{type:Number},amounts:{type:Array},frequency:{type:String},frequencies:{type:Array},designation:{type:Array},designations:{type:Array},comment:{type:String},anonymity:{reflect:!0,type:Boolean},anonymous:{reflect:!0,type:Boolean},image:{type:String},store:{type:String},name:{type:String},code:{type:String},url:{type:String},cart:{type:String},target:{type:String},empty:{type:String}})}static get events(){return{change:c,submit:d}}submit(){this.dispatchEvent(new d)&&this.__form.submit()}render(){var t,s;if(!(this.currency&&this.amount&&this.store&&this.name))return e(u||(u=x` <x-error-screen data-testid="error" type="setup_needed" class="relative"></x-error-screen> `));const i=this.store.includes(".")?this.store:`${this.store}.foxycart.com`;return e(l||(l=x` <form target="${0}" class="sr-only" method="POST" action="https://${0}/cart" data-testid="form"> ${0} </form> <section> ${0} </section> <section> ${0} </section> <section> ${0} </section> <section> ${0} <div class="flex flex-wrap -m-s"> ${0} <div class="flex-1 p-s"> <vaadin-button class="w-full" theme="primary" data-testid="submit" @click="${0}"> <x-i18n .opts="${0}" lang="${0}" key="${0}" ns="${0}"> </x-i18n> </vaadin-button> </div> </div> </section> `),this.target,i,[...this.__data.entries()].map((([t,s])=>e(p||(p=x`<input type="hidden" name="${0}" value="${0}">`),t,s))),this.amounts&&this.amounts.length>0?e(y||(y=x` <x-group frame> <x-i18n ns="${0}" lang="${0}" key="amount" slot="header"></x-i18n> <x-choice ?custom="${0}" .getText="${0}" .items="${0}" .value="${0}" type="number" lang="${0}" min="1" ns="${0}" data-testid="amount" @change="${0}"> </x-choice> </x-group> <slot name="amount" class="block my-m"></slot> `),this.ns,this.lang,!!(null===(t=this.custom)||void 0===t?void 0:t.includes("amount")),(t=>this.__translateAmount(parseFloat(t))),this.amounts.map(String),this.amount.toString(),this.lang,this.ns,(t=>{const e=parseFloat(t.detail);this.amount=isNaN(e)?1:e})):"",this.designations&&this.designations.length>0?e(g||(g=x` <x-dropdown .label="${0}" .items="${0}" .value="${0}" data-testid="designation" @change="${0}"> </x-dropdown> <slot name="designation" class="block my-m"></slot> `),this._t("designation").toString(),this.designations,Array.isArray(this.designation)?"${this.designation[0]}: ${this.designation[1]}":this.designation,(t=>{this.designation=t.detail})):"","string"==typeof this.comment?e(f||(f=x` <vaadin-text-area placeholder="${0}" value="${0}" label="${0}" class="w-full" data-testid="comment" @input="${0}"> </vaadin-text-area> <slot name="comment" class="block my-m"></slot> `),this._t("comment_placeholder").toString(),this.comment,this._t("comment_label").toString(),(t=>{t.stopPropagation(),this.comment=t.target.value})):"",this.anonymity?e($||($=x` <x-checkbox class="my-m" data-testid="anonymity" ?checked="${0}" @change="${0}"> ${0} </x-checkbox> `),this.anonymous,(t=>this.anonymous=t.detail),this._t("anonymous")):"",this.frequencies&&this.frequencies.length>0?e(b||(b=x` <div class="flex-1 p-s"> <x-dropdown .value="${0}" .items="${0}" .getText="${0}" data-testid="frequency" @change="${0}"> </x-dropdown> </div> `),this.frequency,this.frequencies,this.__translateFrequency.bind(this),(t=>{this.frequency=t.detail})):"",(()=>this.submit()),{amount:this.__translateAmount(this.amount),frequency:this.frequency?this.__translateFrequency(this.frequency):""},this.lang,this.frequency&&!(null===(s=this.frequencies)||void 0===s?void 0:s.length)?"donate_recurrently":"donate",this.ns)}updated(){this.dispatchEvent(new c(this.__data))}get __data(){const t=new FormData;return"string"==typeof this.designation&&t.set("Designation",this.designation.trim()),"number"==typeof this.amount&&"string"==typeof this.currency&&t.set("price",`${this.amount.toFixed(2)}${this.currency}`),this.frequency&&t.set("sub_frequency",this.frequency),"string"==typeof this.comment&&t.set("Comment",this.comment.trim()),"string"==typeof this.image&&t.set("image",this.image),"string"==typeof this.code&&t.set("code",this.code),"string"==typeof this.name&&t.set("name",this.name.trim()),"string"==typeof this.url&&t.set("url",this.url),"string"==typeof this.cart&&t.set("cart",this.cart),this.empty&&t.set("empty",this.empty),this.anonymous&&t.set("Anonymous","true"),t.set("quantity","1"),t}get __form(){return this.shadowRoot.querySelector("form")}__translateFrequency(t){if(!t||t.match(/^\s*$/))return this._t("frequency_once");if(".5m"===t)return this._t("frequency_0_5m");const{count:e,units:s}=i(t);return this._t("frequency",{units:this._t(s,{count:e}),count:e})}__translateAmount(t){return t.toLocaleString(this.lang,{minimumFractionDigits:0,currency:this.currency,style:"currency"})}}customElements.define("foxy-donation",_);export{_ as Donation};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e}from"./shared-2062c274.js";import"./shared-655e7c5f.js";import{E as r,T as t}from"./shared-cfed658c.js";import"./shared-4482e7b9.js";import"./shared-37e1a834.js";import{h as o,P as a,B as i}from"./shared-bf695fe7.js";import"./shared-e40937c5.js";import"./shared-f5d4dda0.js";import{w as s,a as n}from"./shared-331a223c.js";import{c as l,h as A}from"./shared-dc73b9a5.js";import{i as d}from"./shared-9803aa7c.js";import{c as p}from"./shared-4e709717.js";import"./shared-882e7191.js";import"./shared-
|
|
1
|
+
import{a as e}from"./shared-2062c274.js";import"./shared-655e7c5f.js";import{E as r,T as t}from"./shared-cfed658c.js";import"./shared-4482e7b9.js";import"./shared-37e1a834.js";import{h as o,P as a,B as i}from"./shared-bf695fe7.js";import"./shared-e40937c5.js";import"./shared-f5d4dda0.js";import{w as s,a as n}from"./shared-331a223c.js";import{c as l,h as A}from"./shared-dc73b9a5.js";import{i as d}from"./shared-9803aa7c.js";import{c as p}from"./shared-4e709717.js";import"./shared-882e7191.js";import"./shared-9de9f905.js";import"./shared-2920b595.js";import{I as u}from"./shared-966feb65.js";import"./foxy-nucleon-element.js";import{_ as c,B as m}from"./shared-1522d76f.js";import"./shared-51c4a6dd.js";import"./shared-9f570db0.js";import"./shared-30cbf0a6.js";import"./shared-a0435ec6.js";import"./shared-07e9d1fb.js";import"./shared-343d1fd7.js";import"./shared-3ab0306f.js";import"./shared-eb116b3e.js";import"./shared-fd0a4026.js";import"./shared-61ade33e.js";import"./shared-8ab2ba91.js";import"./shared-9adc47da.js";import"./shared-3f19b914.js";import"./shared-651c44fa.js";import"./shared-db98729a.js";import"./shared-030f561a.js";import"./shared-5df32007.js";import"./foxy-spinner.js";import"./shared-8b80db13.js";const h=o`<dom-module id="lumo-progress-bar" theme-for="vaadin-progress-bar">
|
|
2
2
|
<template>
|
|
3
3
|
<style>
|
|
4
4
|
:host {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-4482e7b9.js";import"./shared-37e1a834.js";import"./shared-83fc5dca.js";import"./shared-030f561a.js";import"./shared-0cbb19f4.js";import"./shared-2920b595.js";import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-f5d4dda0.js";import{_ as e}from"./shared-1522d76f.js";import"./shared-e40937c5.js";import"./shared-cfed658c.js";import"./shared-7039733e.js";import{h as t}from"./shared-dc73b9a5.js";import{S as a,T as s,a as i}from"./shared-331a223c.js";import{c as r}from"./shared-4e709717.js";import{C as o,a as n}from"./shared-40bece2b.js";import"./shared-5df32007.js";import"./shared-6e508e5b.js";import"./shared-db98729a.js";import"./shared-44bb85d8.js";import"./shared-f94fa366.js";import"./shared-8ab2ba91.js";import{G as l}from"./shared-497ebb8c.js";import"./shared-9adc47da.js";import"./shared-fd0a4026.js";import"./shared-655e7c5f.js";import{M as d}from"./shared-4cec4de0.js";import{C as c}from"./shared-9f570db0.js";import{N as h}from"./shared-a0435ec6.js";import{i as m}from"./shared-9803aa7c.js";import"./shared-bf695fe7.js";import"./shared-61ade33e.js";import"./shared-2062c274.js";import"./shared-30cbf0a6.js";import"./shared-a0c6a159.js";import"./shared-8b80db13.js";import"./shared-343d1fd7.js";import"./shared-f588b5c2.js";import"./shared-f1afbd7b.js";import"./shared-99940888.js";import"./shared-eb116b3e.js";import"./shared-07e9d1fb.js";import"./shared-6ed07856.js";import"./shared-3f19b914.js";import"./shared-5ba87b6d.js";import"./shared-651c44fa.js";import"./shared-3ab0306f.js";let p,f,u,_,b,x,y,$,v=e=>e;const j=a(s(c(i(h,"email-template-form"))));class g extends j{constructor(){super(...arguments),this.templates={},this.__templateLanguageOptions=[{label:"Nunjucks",value:"nunjucks"},{label:"Handlebars",value:"handlebars"},{label:"Pug",value:"pug"},{label:"Twig",value:"twig"},{label:"EJS",value:"ejs"}],this.__textContentChoice="default",this.__htmlContentChoice="default",this.__cacheState="idle"}static get properties(){return e(e({},super.properties),{},{__cacheState:{attribute:!1},__contentChoice:{attribute:!1}})}static get scopedElements(){return{"foxy-internal-select-control":customElements.get("foxy-internal-select-control"),"foxy-internal-confirm-dialog":customElements.get("foxy-internal-confirm-dialog"),"foxy-internal-source-control":customElements.get("foxy-internal-source-control"),"foxy-internal-text-control":customElements.get("foxy-internal-text-control"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-button":customElements.get("vaadin-button"),"x-metadata":d,"x-choice":o,"x-group":l}}render(){var e,a,s;const{hiddenSelector:i,href:o,lang:n,ns:l}=this,d=o?"delete":"create",c=this.in("busy"),h=this.in("fail");return t(p||(p=v` <div class="space-y-m"> ${0} <foxy-internal-text-control infer="subject"></foxy-internal-text-control> ${0} ${0} ${0} ${0} <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),i.matches("description",!0)?"":this.__renderDescription(),"Email Receipt Template"===(null===(e=this.data)||void 0===e?void 0:e.description)?"":t(f||(f=v` <foxy-internal-select-control infer="template-language" .options="${0}"> </foxy-internal-select-control> `),this.__templateLanguageOptions),i.matches("content",!0)?"":this.__renderContent(),i.matches("timestamps",!0)||!o?"":this.__renderTimestamps(),i.matches(d)?"":this.__renderAction(d),r({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!c&&!h}),h?"error":c?"busy":"empty",n,l,null!==(s=null===(a=customElements.get("foxy-spinner"))||void 0===a?void 0:a.defaultNS)&&void 0!==s?s:"")}async _sendPost(e){const t=await super._sendPost(e);if(!t.content_html_url&&!t.content_text_url)return t;this.__cacheState="busy";const a=t._links["fx:cache"].href,s=await new g.API(this).fetch(a,{method:"POST"});return this.__cacheState=s.ok?"idle":"fail",await this._fetch(t._links.self.href)}async _sendPatch(e){const t=await super._sendPatch(e);if(!t.content_html_url&&!t.content_text_url)return t;this.__cacheState="busy";const a=t._links["fx:cache"].href,s=await new g.API(this).fetch(a,{method:"POST"});return this.__cacheState=s.ok?"idle":"fail",await this._fetch(t._links.self.href)}__renderDescription(){var e,a;const s="description";return t(u||(u=v` <div> ${0} <vaadin-text-field data-testid="${0}" class="w-full mb-s" label="${0}" ?disabled="${0}" ?readonly="${0}" .value="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot(`${s}:before`),s,this.t(s),!this.in("idle")||this.disabledSelector.matches(s),this.readonlySelector.matches(s),null!==(a=null===(e=this.form)||void 0===e?void 0:e.description)&&void 0!==a?a:"",(e=>"Enter"===e.key&&this.submit()),(e=>{this.edit({description:e.currentTarget.value})}),this.renderTemplateOrSlot(`${s}:after`))}__renderContent(){return t(_||(_=v` <div data-testid="content"> <div class="space-y-l">${0}</div> </div> `),["text","html"].map((e=>this.__renderContentVariant(e))))}__renderContentVariant(e){var a,s;const i="text"===e?"content_text_url":"content_html_url",o="text"===e?"content_text":"content_html",l="text"===e?"text_template":"html_template",d=this.form[i],c=this.form[o],h="text"===e?"__textContentChoice":"__htmlContentChoice",p=d?"url":c?"clipboard":this[h],f=!this.in("idle")||this.disabledSelector.matches("content",!0),u=this.readonlySelector.matches("content",!0),_=u||!(null===(a=this.data)||void 0===a?void 0:a[i])||d!==this.data[i];return t(b||(b=v` <x-group frame> <foxy-i18n class="${0}" lang="${0}" slot="header" key="${0}" ns="${0}"> </foxy-i18n> <x-choice data-testid="${0}-type" .value="${0}" .items="${0}" ?readonly="${0}" ?disabled="${0}" @change="${0}"> ${0} <div style="--lumo-border-radius:var(--lumo-border-radius-s)" class="mb-m" slot="url" ?hidden="${0}"> <div class="flex items-end mt-0"> <vaadin-text-field data-testid="${0}-url" placeholder="https://example.com/my-template" label="${0}" class="flex-1 min-w-0" value="${0}" ?readonly="${0}" ?disabled="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> <vaadin-button data-testid="${0}-cache" class="relative flex-shrink-0 ml-s" ?disabled="${0}" ?hidden="${0}" @click="${0}"> <foxy-i18n class="${0}" lang="${0}" key="cache" ns="${0}"> </foxy-i18n> <div class="${0}"> <foxy-spinner layout="no-label" class="m-auto" state="${0}" lang="${0}" ns="${0}"> </foxy-spinner> </div> </vaadin-button> </div> <foxy-internal-source-control placeholder="${0}" helper-text="" property="${0}" label="${0}" infer="content" class="mt-m${0}" style="--lumo-border-radius:var(--lumo-border-radius-s)"> </foxy-internal-source-control> </div> <foxy-internal-source-control placeholder="${0}" helper-text="" property="${0}" label="${0}" infer="content" class="mb-m${0}" style="--lumo-border-radius:var(--lumo-border-radius-s)" slot="clipboard"> </foxy-internal-source-control> </x-choice> </x-group> `),r({"transition-colors":!0,"text-disabled":f}),this.lang,l,this.ns,o.replace("_","-"),p,["default","url","clipboard"],u,f,(e=>{e instanceof n&&(this.edit({[o]:"",[i]:""}),this[h]=e.detail)}),["default","url","clipboard"].map((e=>t(x||(x=v` <div slot="${0}-label" class="py-s leading-s"> <foxy-i18n class="block" lang="${0}" key="template_${0}" ns="${0}"> </foxy-i18n> </div> `),e,this.lang,e,this.ns))),"url"!==p,o.replace("_","-"),this.t("url"),m(this.form[i]),u,f,(e=>"Enter"===e.key&&this.submit()),(e=>{const t=e.currentTarget.value;this.edit({[o]:"",[i]:t})}),o.replace("_","-"),f||"busy"===this.__cacheState,_,this.__cache,r({"relative transition-opacity":!0,"opacity-0":"idle"!==this.__cacheState}),this.lang,this.ns,r({"absolute inset-0 flex transition-opacity":!0,"opacity-0":"idle"===this.__cacheState}),"fail"===this.__cacheState?"error":"busy",this.lang,this.ns,this.t("url_source_placeholder"),o,this.t("url_source_label"),(null===(s=this.data)||void 0===s?void 0:s[o])?"":" hidden",this.t("clipboard_source_placeholder"),o,this.t("clipboard_source_label"),"clipboard"===p?"":" hidden")}__renderTimestamps(){const e="timestamps";return t(y||(y=v` <div> ${0} <x-metadata data-testid="timestamps" .items="${0}"> </x-metadata> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),["date_modified","date_created"].map((e=>{var t;return{name:this.t(e),value:(null===(t=this.data)||void 0===t?void 0:t[e])?this.t("date",{value:new Date(this.data[e])}):""}})),this.renderTemplateOrSlot(`${e}:after`))}__renderAction(e){const{disabledSelector:a,href:s,lang:i,ns:r}=this,o=this.in({idle:{template:{dirty:"valid"}}}),n=this.in({idle:{snapshot:{dirty:"valid"}}}),l=!this.in("idle")||a.matches(e,!0),d=o||n;return t($||($=v` <div> ${0} <foxy-internal-confirm-dialog message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" data-testid="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button class="w-full" theme="${0}" data-testid="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="${0}" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),i,r,(e=>{e.detail.cancelled||this.delete()}),this.in("idle")?s?"error":"primary success":"",e,this.in({idle:"template"})&&!d||l,(t=>{if("delete"===e){this.renderRoot.querySelector("#confirm").show(t.currentTarget)}else this.submit()}),r,e,i,this.renderTemplateOrSlot(`${e}:after`))}async __cache(){var e,t;this.__cacheState="busy";try{const a=null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:cache"].href)&&void 0!==t?t:"",s=await new g.API(this).fetch(a,{method:"POST"});this.__cacheState=s.ok?"idle":"fail",this.refresh()}catch(e){this.__cacheState="fail"}}}customElements.define("foxy-email-template-form",g);export{g as EmailTemplateForm};
|
|
1
|
+
import"./shared-4482e7b9.js";import"./shared-37e1a834.js";import"./shared-83fc5dca.js";import"./shared-030f561a.js";import"./shared-0cbb19f4.js";import"./shared-2920b595.js";import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-f5d4dda0.js";import{_ as e}from"./shared-1522d76f.js";import"./shared-e40937c5.js";import"./shared-cfed658c.js";import"./shared-7039733e.js";import{h as t}from"./shared-dc73b9a5.js";import{S as a,T as s,a as i}from"./shared-331a223c.js";import{c as r}from"./shared-4e709717.js";import{C as o,a as n}from"./shared-c0c7225c.js";import"./shared-5df32007.js";import"./shared-e4543605.js";import"./shared-db98729a.js";import"./shared-44bb85d8.js";import"./shared-f94fa366.js";import"./shared-8ab2ba91.js";import{G as l}from"./shared-597737ce.js";import"./shared-9adc47da.js";import"./shared-fd0a4026.js";import"./shared-655e7c5f.js";import{M as d}from"./shared-65283d36.js";import{C as c}from"./shared-9f570db0.js";import{N as h}from"./shared-a0435ec6.js";import{i as m}from"./shared-9803aa7c.js";import"./shared-bf695fe7.js";import"./shared-61ade33e.js";import"./shared-2062c274.js";import"./shared-30cbf0a6.js";import"./shared-a0c6a159.js";import"./shared-8b80db13.js";import"./shared-343d1fd7.js";import"./shared-f588b5c2.js";import"./shared-44d207fb.js";import"./shared-99940888.js";import"./shared-eb116b3e.js";import"./shared-07e9d1fb.js";import"./shared-6ed07856.js";import"./shared-3f19b914.js";import"./shared-5ba87b6d.js";import"./shared-651c44fa.js";import"./shared-3ab0306f.js";let p,f,u,_,b,x,y,$,v=e=>e;const j=a(s(c(i(h,"email-template-form"))));class g extends j{constructor(){super(...arguments),this.templates={},this.__templateLanguageOptions=[{label:"Nunjucks",value:"nunjucks"},{label:"Handlebars",value:"handlebars"},{label:"Pug",value:"pug"},{label:"Twig",value:"twig"},{label:"EJS",value:"ejs"}],this.__textContentChoice="default",this.__htmlContentChoice="default",this.__cacheState="idle"}static get properties(){return e(e({},super.properties),{},{__cacheState:{attribute:!1},__contentChoice:{attribute:!1}})}static get scopedElements(){return{"foxy-internal-select-control":customElements.get("foxy-internal-select-control"),"foxy-internal-confirm-dialog":customElements.get("foxy-internal-confirm-dialog"),"foxy-internal-source-control":customElements.get("foxy-internal-source-control"),"foxy-internal-text-control":customElements.get("foxy-internal-text-control"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-button":customElements.get("vaadin-button"),"x-metadata":d,"x-choice":o,"x-group":l}}render(){var e,a,s;const{hiddenSelector:i,href:o,lang:n,ns:l}=this,d=o?"delete":"create",c=this.in("busy"),h=this.in("fail");return t(p||(p=v` <div class="space-y-m"> ${0} <foxy-internal-text-control infer="subject"></foxy-internal-text-control> ${0} ${0} ${0} ${0} <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),i.matches("description",!0)?"":this.__renderDescription(),"Email Receipt Template"===(null===(e=this.data)||void 0===e?void 0:e.description)?"":t(f||(f=v` <foxy-internal-select-control infer="template-language" .options="${0}"> </foxy-internal-select-control> `),this.__templateLanguageOptions),i.matches("content",!0)?"":this.__renderContent(),i.matches("timestamps",!0)||!o?"":this.__renderTimestamps(),i.matches(d)?"":this.__renderAction(d),r({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!c&&!h}),h?"error":c?"busy":"empty",n,l,null!==(s=null===(a=customElements.get("foxy-spinner"))||void 0===a?void 0:a.defaultNS)&&void 0!==s?s:"")}async _sendPost(e){const t=await super._sendPost(e);if(!t.content_html_url&&!t.content_text_url)return t;this.__cacheState="busy";const a=t._links["fx:cache"].href,s=await new g.API(this).fetch(a,{method:"POST"});return this.__cacheState=s.ok?"idle":"fail",await this._fetch(t._links.self.href)}async _sendPatch(e){const t=await super._sendPatch(e);if(!t.content_html_url&&!t.content_text_url)return t;this.__cacheState="busy";const a=t._links["fx:cache"].href,s=await new g.API(this).fetch(a,{method:"POST"});return this.__cacheState=s.ok?"idle":"fail",await this._fetch(t._links.self.href)}__renderDescription(){var e,a;const s="description";return t(u||(u=v` <div> ${0} <vaadin-text-field data-testid="${0}" class="w-full mb-s" label="${0}" ?disabled="${0}" ?readonly="${0}" .value="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot(`${s}:before`),s,this.t(s),!this.in("idle")||this.disabledSelector.matches(s),this.readonlySelector.matches(s),null!==(a=null===(e=this.form)||void 0===e?void 0:e.description)&&void 0!==a?a:"",(e=>"Enter"===e.key&&this.submit()),(e=>{this.edit({description:e.currentTarget.value})}),this.renderTemplateOrSlot(`${s}:after`))}__renderContent(){return t(_||(_=v` <div data-testid="content"> <div class="space-y-l">${0}</div> </div> `),["text","html"].map((e=>this.__renderContentVariant(e))))}__renderContentVariant(e){var a,s;const i="text"===e?"content_text_url":"content_html_url",o="text"===e?"content_text":"content_html",l="text"===e?"text_template":"html_template",d=this.form[i],c=this.form[o],h="text"===e?"__textContentChoice":"__htmlContentChoice",p=d?"url":c?"clipboard":this[h],f=!this.in("idle")||this.disabledSelector.matches("content",!0),u=this.readonlySelector.matches("content",!0),_=u||!(null===(a=this.data)||void 0===a?void 0:a[i])||d!==this.data[i];return t(b||(b=v` <x-group frame> <foxy-i18n class="${0}" lang="${0}" slot="header" key="${0}" ns="${0}"> </foxy-i18n> <x-choice data-testid="${0}-type" .value="${0}" .items="${0}" ?readonly="${0}" ?disabled="${0}" @change="${0}"> ${0} <div style="--lumo-border-radius:var(--lumo-border-radius-s)" class="mb-m" slot="url" ?hidden="${0}"> <div class="flex items-end mt-0"> <vaadin-text-field data-testid="${0}-url" placeholder="https://example.com/my-template" label="${0}" class="flex-1 min-w-0" value="${0}" ?readonly="${0}" ?disabled="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> <vaadin-button data-testid="${0}-cache" class="relative flex-shrink-0 ml-s" ?disabled="${0}" ?hidden="${0}" @click="${0}"> <foxy-i18n class="${0}" lang="${0}" key="cache" ns="${0}"> </foxy-i18n> <div class="${0}"> <foxy-spinner layout="no-label" class="m-auto" state="${0}" lang="${0}" ns="${0}"> </foxy-spinner> </div> </vaadin-button> </div> <foxy-internal-source-control placeholder="${0}" helper-text="" property="${0}" label="${0}" infer="content" class="mt-m${0}" style="--lumo-border-radius:var(--lumo-border-radius-s)"> </foxy-internal-source-control> </div> <foxy-internal-source-control placeholder="${0}" helper-text="" property="${0}" label="${0}" infer="content" class="mb-m${0}" style="--lumo-border-radius:var(--lumo-border-radius-s)" slot="clipboard"> </foxy-internal-source-control> </x-choice> </x-group> `),r({"transition-colors":!0,"text-disabled":f}),this.lang,l,this.ns,o.replace("_","-"),p,["default","url","clipboard"],u,f,(e=>{e instanceof n&&(this.edit({[o]:"",[i]:""}),this[h]=e.detail)}),["default","url","clipboard"].map((e=>t(x||(x=v` <div slot="${0}-label" class="py-s leading-s"> <foxy-i18n class="block" lang="${0}" key="template_${0}" ns="${0}"> </foxy-i18n> </div> `),e,this.lang,e,this.ns))),"url"!==p,o.replace("_","-"),this.t("url"),m(this.form[i]),u,f,(e=>"Enter"===e.key&&this.submit()),(e=>{const t=e.currentTarget.value;this.edit({[o]:"",[i]:t})}),o.replace("_","-"),f||"busy"===this.__cacheState,_,this.__cache,r({"relative transition-opacity":!0,"opacity-0":"idle"!==this.__cacheState}),this.lang,this.ns,r({"absolute inset-0 flex transition-opacity":!0,"opacity-0":"idle"===this.__cacheState}),"fail"===this.__cacheState?"error":"busy",this.lang,this.ns,this.t("url_source_placeholder"),o,this.t("url_source_label"),(null===(s=this.data)||void 0===s?void 0:s[o])?"":" hidden",this.t("clipboard_source_placeholder"),o,this.t("clipboard_source_label"),"clipboard"===p?"":" hidden")}__renderTimestamps(){const e="timestamps";return t(y||(y=v` <div> ${0} <x-metadata data-testid="timestamps" .items="${0}"> </x-metadata> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),["date_modified","date_created"].map((e=>{var t;return{name:this.t(e),value:(null===(t=this.data)||void 0===t?void 0:t[e])?this.t("date",{value:new Date(this.data[e])}):""}})),this.renderTemplateOrSlot(`${e}:after`))}__renderAction(e){const{disabledSelector:a,href:s,lang:i,ns:r}=this,o=this.in({idle:{template:{dirty:"valid"}}}),n=this.in({idle:{snapshot:{dirty:"valid"}}}),l=!this.in("idle")||a.matches(e,!0),d=o||n;return t($||($=v` <div> ${0} <foxy-internal-confirm-dialog message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" data-testid="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button class="w-full" theme="${0}" data-testid="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="${0}" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),i,r,(e=>{e.detail.cancelled||this.delete()}),this.in("idle")?s?"error":"primary success":"",e,this.in({idle:"template"})&&!d||l,(t=>{if("delete"===e){this.renderRoot.querySelector("#confirm").show(t.currentTarget)}else this.submit()}),r,e,i,this.renderTemplateOrSlot(`${e}:after`))}async __cache(){var e,t;this.__cacheState="busy";try{const a=null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:cache"].href)&&void 0!==t?t:"",s=await new g.API(this).fetch(a,{method:"POST"});this.__cacheState=s.ok?"idle":"fail",this.refresh()}catch(e){this.__cacheState="fail"}}}customElements.define("foxy-email-template-form",g);export{g as EmailTemplateForm};
|